Skip to content

Commit

Permalink
Deploying to gh-pages from @ 2bfa389 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
suxrobGM committed Aug 3, 2024
1 parent 576445f commit eb73473
Show file tree
Hide file tree
Showing 135 changed files with 222,929 additions and 77,160 deletions.
5 changes: 0 additions & 5 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<title>Blazor Form Builder</title>
<base href="/blazor-form-builder/" />
<link rel="icon" type="image/png" href="favicon.png" />
<!-- <link href="_content/FormBuilder/css/app.css" rel="stylesheet" />-->
<link href="_content/Radzen.Blazor/css/material-base.css" rel="stylesheet" /> <!-- Radzen CSS, specified explicitly for GitHub Pages -->
<link href="_content/FormBuilder/css/bootstrap/bootstrap.min.css" rel="stylesheet" /> <!-- Bootstrap 5 CSS, specified explicitly for GitHub Pages -->
<link href="css/app.css" rel="stylesheet" />
<link href="FormBuilder.DesignerApp.styles.css" rel="stylesheet" />
</head>
Expand All @@ -29,8 +26,6 @@
<a class="dismiss">🗙</a>
</div>
<script src="_framework/blazor.webassembly.js" autostart="false"></script>
<!-- <script type="module" src="_content/FormBuilder/js/app.js"></script>-->
<script src="_content/Radzen.Blazor/Radzen.Blazor.js"></script> <!-- Radzen JS, specified explicitly for GitHub Pages -->
<script src="brotliloader.min.js" type="module"></script>
</body>

Expand Down
15 changes: 15 additions & 0 deletions _content/FormBuilder/Components/InitComponents.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Loads bootstrap styles and Radzen.Blazor.js files
*/
export function loadStaticFiles() {
const link = document.createElement("link");
link.rel = "stylesheet";
link.href = "_content/FormBuilder/css/bootstrap/bootstrap.min.css";
document.head.appendChild(link);

const script = document.createElement("script");
script.src = "_content/Radzen.Blazor/Radzen.Blazor.js";
document.body.appendChild(script);

console.log("Bootstrap and Radzen static files loaded");
}
2 changes: 0 additions & 2 deletions _content/FormBuilder/css/app.css

This file was deleted.

1 change: 0 additions & 1 deletion _content/FormBuilder/js/app.js

This file was deleted.

84 changes: 70 additions & 14 deletions _content/Radzen.Blazor/Radzen.Blazor.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ var rejectCallbacks = [];
var radzenRecognition;

window.Radzen = {
isRTL: function (el) {
return el && getComputedStyle(el).direction == 'rtl';
},
throttle: function (callback, delay) {
var timeout = null;
return function () {
Expand All @@ -45,7 +48,7 @@ window.Radzen = {
for (var i = 0; i < mask.length; i++) {
const c = mask[i];
if (chars && chars[count]) {
if (/\*/.test(c)) {
if (c === '*' || c == chars[count]) {
formatted += chars[count];
count++;
} else {
Expand Down Expand Up @@ -196,7 +199,7 @@ window.Radzen = {
script.src =
'https://maps.googleapis.com/maps/api/js?' +
(apiKey ? 'key=' + apiKey + '&' : '') +
'callback=rz_map_init';
'callback=rz_map_init&libraries=marker';

script.async = true;
script.defer = true;
Expand All @@ -208,7 +211,7 @@ window.Radzen = {

document.body.appendChild(script);
},
createMap: function (wrapper, ref, id, apiKey, zoom, center, markers, options, fitBoundsToMarkersOnUpdate) {
createMap: function (wrapper, ref, id, apiKey, mapId, zoom, center, markers, options, fitBoundsToMarkersOnUpdate) {
var api = function () {
var defaultView = document.defaultView;

Expand All @@ -227,7 +230,8 @@ window.Radzen = {

Radzen[id].instance = new google.maps.Map(wrapper, {
center: center,
zoom: zoom
zoom: zoom,
mapId: mapId
});

Radzen[id].instance.addListener('click', function (e) {
Expand Down Expand Up @@ -265,16 +269,23 @@ window.Radzen = {
Radzen[id].instance.markers = [];

markers.forEach(function (m) {
var marker = new this.google.maps.Marker({
var content;

if (m.label) {
content = document.createElement('span');
content.innerHTML = m.label;
}

var marker = new this.google.maps.marker.AdvancedMarkerElement({
position: m.position,
title: m.title,
label: m.label
content: content
});

marker.addListener('click', function (e) {
Radzen[id].invokeMethodAsync('RadzenGoogleMap.OnMarkerClick', {
Title: marker.title,
Label: marker.label,
Label: marker.content.innerText,
Position: marker.position
});
});
Expand Down Expand Up @@ -444,7 +455,8 @@ window.Radzen = {
e.targetTouches && e.targetTouches[0]
? e.targetTouches[0].pageX - e.target.getBoundingClientRect().left
: e.pageX - handle.getBoundingClientRect().left;
var percent = (handle.offsetLeft + offsetX) / parent.offsetWidth;
var percent = (Radzen.isRTL(handle) ? parent.offsetWidth - handle.offsetLeft - offsetX
: handle.offsetLeft + offsetX) / parent.offsetWidth;

if (percent > 1) {
percent = 1;
Expand Down Expand Up @@ -1009,7 +1021,7 @@ window.Radzen = {
var input = el.querySelector('.rz-inputtext');
if (input) {
input.onclick = function (e) {
handler(e, e.currentTarget.classList.contains('rz-readonly'));
handler(e, e.currentTarget.classList.contains('rz-readonly') || e.currentTarget.classList.contains('rz-input-trigger') );
};
}
},
Expand Down Expand Up @@ -1043,7 +1055,7 @@ window.Radzen = {

popup.style.top = top + 'px';
},
openPopup: function (parent, id, syncWidth, position, x, y, instance, callback, closeOnDocumentClick = true, autoFocusFirstElement = false) {
openPopup: function (parent, id, syncWidth, position, x, y, instance, callback, closeOnDocumentClick = true, autoFocusFirstElement = false, disableSmartPosition = false) {
var popup = document.getElementById(id);
if (!popup) return;

Expand Down Expand Up @@ -1085,7 +1097,9 @@ window.Radzen = {
var smartPosition = !position || position == 'bottom';

if (smartPosition && top + rect.height > window.innerHeight && parentRect.top > rect.height) {
top = parentRect.top - rect.height;
if (disableSmartPosition !== true) {
top = parentRect.top - rect.height;
}

if (position) {
top = top - 40;
Expand Down Expand Up @@ -1370,6 +1384,37 @@ window.Radzen = {
Radzen.dialogResizer = new ResizeObserver(dialogResize).observe(lastDialog.parentElement);
}

if (options.draggable) {
var dialogTitle = lastDialog.parentElement.querySelector('.rz-dialog-titlebar');
if (dialogTitle) {
Radzen[dialogTitle] = function (e) {
var rect = lastDialog.parentElement.getBoundingClientRect();
var offsetX = e.clientX - rect.left;
var offsetY = e.clientY - rect.top;

var move = function (e) {
var left = e.clientX - offsetX;
var top = e.clientY - offsetY;

lastDialog.parentElement.style.left = left + 'px';
lastDialog.parentElement.style.top = top + 'px';

dialog.invokeMethodAsync('RadzenDialog.OnDrag', top, left);
};

var stop = function () {
document.removeEventListener('mousemove', move);
document.removeEventListener('mouseup', stop);
};

document.addEventListener('mousemove', move);
document.addEventListener('mouseup', stop);
};

dialogTitle.addEventListener('mousedown', Radzen[dialogTitle]);
}
}

if (options.autoFocusFirstElement) {
var focusable = Radzen.getFocusableElements(lastDialog);
var editor = lastDialog.querySelector('.rz-html-editor');
Expand Down Expand Up @@ -1404,6 +1449,17 @@ window.Radzen = {
Radzen.dialogResizer = null;
document.body.classList.remove('no-scroll');
var dialogs = document.querySelectorAll('.rz-dialog-content');

var lastDialog = dialogs.length && dialogs[dialogs.length - 1];
if (lastDialog) {
var dialogTitle = lastDialog.parentElement.querySelector('.rz-dialog-titlebar');
if (dialogTitle) {
dialogTitle.removeEventListener('mousedown', Radzen[dialogTitle]);
Radzen[dialogTitle] = null;
delete Radzen[dialogTitle];
}
}

if (dialogs.length <= 1) {
document.removeEventListener('keydown', Radzen.closePopupOrDialog);
delete Radzen.dialogService;
Expand Down Expand Up @@ -1882,7 +1938,7 @@ window.Radzen = {
}
return attributes.reduce(function (result, name) {
if (target) {
result[name] = target[name];
result[name] = target[name].toString();
}
return result;
}, { innerText: selection.toString(), innerHTML: innerHTML });
Expand Down Expand Up @@ -2033,7 +2089,7 @@ window.Radzen = {
},
mouseMoveHandler: function (e) {
if (Radzen[el]) {
var widthFloat = (Radzen[el].width - (Radzen[el].clientX - e.clientX));
var widthFloat = (Radzen[el].width - (Radzen.isRTL(cell) ? -1 : 1) * (Radzen[el].clientX - e.clientX));
var minWidth = parseFloat(cell.style.minWidth || 0)

if (widthFloat < minWidth) {
Expand Down Expand Up @@ -2164,7 +2220,7 @@ window.Radzen = {
var spaceLength = Radzen[el].paneLength + Radzen[el].paneNextLength;

var length = (Radzen[el].paneLength -
(Radzen[el].clientPos - (isHOrientation ? e.clientX : e.clientY)));
(isHOrientation && Radzen.isRTL(e.target) ? -1 : 1) * (Radzen[el].clientPos - (isHOrientation ? e.clientX : e.clientY)));

if (length > spaceLength)
length = spaceLength;
Expand Down
Loading

0 comments on commit eb73473

Please sign in to comment.