web-mojo 2.1.339 → 2.1.362
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.cjs.js +1 -1
- package/dist/admin.es.js +10 -10
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.cjs.js.map +1 -1
- package/dist/auth.es.js +3 -3
- package/dist/auth.es.js.map +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +2 -2
- package/dist/chunks/{ContextMenu-BT3vN7aw.js → ContextMenu-B1iN4ArK.js} +2 -2
- package/dist/chunks/{ContextMenu-BT3vN7aw.js.map → ContextMenu-B1iN4ArK.js.map} +1 -1
- package/dist/chunks/{ContextMenu-BqOWkQTt.js → ContextMenu-Bh_lLoz2.js} +2 -2
- package/dist/chunks/{ContextMenu-BqOWkQTt.js.map → ContextMenu-Bh_lLoz2.js.map} +1 -1
- package/dist/chunks/{DataView-NZ1_P0Uf.js → DataView-BPZ5eISe.js} +2 -2
- package/dist/chunks/{DataView-NZ1_P0Uf.js.map → DataView-BPZ5eISe.js.map} +1 -1
- package/dist/chunks/{DataView-DdcSHghg.js → DataView-pFA8BU-t.js} +2 -2
- package/dist/chunks/{DataView-DdcSHghg.js.map → DataView-pFA8BU-t.js.map} +1 -1
- package/dist/chunks/{Dialog-B71VE40z.js → Dialog-BccYQCCA.js} +5 -5
- package/dist/chunks/{Dialog-B71VE40z.js.map → Dialog-BccYQCCA.js.map} +1 -1
- package/dist/chunks/{Dialog-CCDZACXQ.js → Dialog-xGWlYBDO.js} +2 -2
- package/dist/chunks/{Dialog-CCDZACXQ.js.map → Dialog-xGWlYBDO.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-BGOBqhUE.js → FilePreviewView-BGZUCgI4.js} +2 -2
- package/dist/chunks/{FilePreviewView-BGOBqhUE.js.map → FilePreviewView-BGZUCgI4.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-WjbdoWrT.js → FilePreviewView-DvZzrOtt.js} +6 -6
- package/dist/chunks/{FilePreviewView-WjbdoWrT.js.map → FilePreviewView-DvZzrOtt.js.map} +1 -1
- package/dist/chunks/{FormView-D3_d_L41.js → FormView-DRPt29EF.js} +2 -2
- package/dist/chunks/{FormView-D3_d_L41.js.map → FormView-DRPt29EF.js.map} +1 -1
- package/dist/chunks/{FormView-BljGVlOM.js → FormView-rtiwVHoR.js} +161 -12
- package/dist/chunks/{FormView-BljGVlOM.js.map → FormView-rtiwVHoR.js.map} +1 -1
- package/dist/chunks/{MetricsChart-C2Wr4Vom.js → MetricsChart-BJ9LBu5Q.js} +2 -2
- package/dist/chunks/{MetricsChart-C2Wr4Vom.js.map → MetricsChart-BJ9LBu5Q.js.map} +1 -1
- package/dist/chunks/{MetricsChart-qAL4Xpge.js → MetricsChart-DE3G8LgS.js} +3 -3
- package/dist/chunks/{MetricsChart-qAL4Xpge.js.map → MetricsChart-DE3G8LgS.js.map} +1 -1
- package/dist/chunks/{PDFViewer-DZjz2YPF.js → PDFViewer-D7kCo1x3.js} +2 -2
- package/dist/chunks/{PDFViewer-DZjz2YPF.js.map → PDFViewer-D7kCo1x3.js.map} +1 -1
- package/dist/chunks/{PDFViewer-iEMG_tQF.js → PDFViewer-DRKZrcCF.js} +3 -3
- package/dist/chunks/{PDFViewer-iEMG_tQF.js.map → PDFViewer-DRKZrcCF.js.map} +1 -1
- package/dist/chunks/{Page-BK3BbbvR.js → Page-CC9vB_Gi.js} +2 -2
- package/dist/chunks/{Page-BK3BbbvR.js.map → Page-CC9vB_Gi.js.map} +1 -1
- package/dist/chunks/{Page-B9zFcwAg.js → Page-DnYOBzbF.js} +2 -2
- package/dist/chunks/{Page-B9zFcwAg.js.map → Page-DnYOBzbF.js.map} +1 -1
- package/dist/chunks/{TopNav-B4-mTytV.js → TopNav-CkWwWYMm.js} +2 -2
- package/dist/chunks/{TopNav-B4-mTytV.js.map → TopNav-CkWwWYMm.js.map} +1 -1
- package/dist/chunks/{TopNav-C38znvne.js → TopNav-FSY-N8Q-.js} +2 -2
- package/dist/chunks/{TopNav-C38znvne.js.map → TopNav-FSY-N8Q-.js.map} +1 -1
- package/dist/chunks/{WebApp-BoP0b5Ze.js → WebApp-BM2CoF7q.js} +2 -2
- package/dist/chunks/{WebApp-BoP0b5Ze.js.map → WebApp-BM2CoF7q.js.map} +1 -1
- package/dist/chunks/{WebApp-CYe2_G2E.js → WebApp-DYte9XVv.js} +12 -12
- package/dist/chunks/{WebApp-CYe2_G2E.js.map → WebApp-DYte9XVv.js.map} +1 -1
- package/dist/core.css +47 -1
- package/dist/css/web-mojo.css +1 -1
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.es.js +5 -5
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +11 -11
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as Mustache, h as MOJOUtils, V as View } from "./WebApp-
|
|
1
|
+
import { M as Mustache, h as MOJOUtils, V as View } from "./WebApp-DYte9XVv.js";
|
|
2
2
|
class FormBuilder {
|
|
3
3
|
constructor(config = {}) {
|
|
4
4
|
this.fields = config.fields || [];
|
|
@@ -5587,24 +5587,135 @@ class FieldStatusManager {
|
|
|
5587
5587
|
this.timeouts = /* @__PURE__ */ new Map();
|
|
5588
5588
|
}
|
|
5589
5589
|
/**
|
|
5590
|
-
* Find existing status container or create one
|
|
5590
|
+
* Find existing status container or create one based on field type
|
|
5591
5591
|
*/
|
|
5592
5592
|
findOrCreateStatusContainer() {
|
|
5593
|
-
let container = this.fieldElement.parentElement.querySelector(".field-status");
|
|
5593
|
+
let container = this.fieldElement.parentElement.querySelector(".field-status-label-inline");
|
|
5594
5594
|
if (!container) {
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5595
|
+
const label = this.findFieldLabel();
|
|
5596
|
+
if (label) {
|
|
5597
|
+
container = label.querySelector(".field-status-label-inline");
|
|
5598
|
+
}
|
|
5599
|
+
}
|
|
5600
|
+
if (!container) {
|
|
5601
|
+
container = this.createStatusContainer();
|
|
5602
|
+
}
|
|
5603
|
+
return container;
|
|
5604
|
+
}
|
|
5605
|
+
/**
|
|
5606
|
+
* Create appropriate status container based on field type
|
|
5607
|
+
*/
|
|
5608
|
+
createStatusContainer() {
|
|
5609
|
+
const fieldType = this.getFieldType();
|
|
5610
|
+
this.getPlacementStrategy(fieldType);
|
|
5611
|
+
const container = document.createElement("div");
|
|
5612
|
+
return this.createLabelInlineContainer(container);
|
|
5613
|
+
}
|
|
5614
|
+
/**
|
|
5615
|
+
* Determine field type from element
|
|
5616
|
+
*/
|
|
5617
|
+
getFieldType() {
|
|
5618
|
+
const tagName = this.fieldElement.tagName.toLowerCase();
|
|
5619
|
+
const type = this.fieldElement.type?.toLowerCase();
|
|
5620
|
+
const classes = this.fieldElement.className;
|
|
5621
|
+
if (type === "checkbox" || classes.includes("form-check-input") || classes.includes("form-switch")) {
|
|
5622
|
+
return "toggle";
|
|
5623
|
+
} else if (tagName === "select") {
|
|
5624
|
+
return "select";
|
|
5625
|
+
} else if (tagName === "textarea") {
|
|
5626
|
+
return "textarea";
|
|
5627
|
+
} else if (tagName === "input") {
|
|
5628
|
+
return "input";
|
|
5629
|
+
}
|
|
5630
|
+
return "input";
|
|
5631
|
+
}
|
|
5632
|
+
/**
|
|
5633
|
+
* Determine placement strategy for field type
|
|
5634
|
+
*/
|
|
5635
|
+
getPlacementStrategy(fieldType) {
|
|
5636
|
+
return "label-inline";
|
|
5637
|
+
}
|
|
5638
|
+
/**
|
|
5639
|
+
* Create inline label status container (for all input types)
|
|
5640
|
+
*/
|
|
5641
|
+
createLabelInlineContainer(container) {
|
|
5642
|
+
container.className = "field-status-label-inline";
|
|
5643
|
+
container.innerHTML = this.getStatusHTML();
|
|
5644
|
+
const label = this.findFieldLabel();
|
|
5645
|
+
if (label) {
|
|
5646
|
+
label.appendChild(container);
|
|
5647
|
+
} else {
|
|
5648
|
+
this.fieldElement.parentElement.appendChild(container);
|
|
5649
|
+
}
|
|
5650
|
+
return container;
|
|
5651
|
+
}
|
|
5652
|
+
/**
|
|
5653
|
+
* Find the label associated with any field type
|
|
5654
|
+
*/
|
|
5655
|
+
findFieldLabel() {
|
|
5656
|
+
if (this.fieldElement.id) {
|
|
5657
|
+
const label2 = document.querySelector(`label[for="${this.fieldElement.id}"]`);
|
|
5658
|
+
if (label2) return label2;
|
|
5659
|
+
}
|
|
5660
|
+
const label = this.fieldElement.parentElement.querySelector("label");
|
|
5661
|
+
if (label) return label;
|
|
5662
|
+
const parentLabel = this.fieldElement.closest("label");
|
|
5663
|
+
if (parentLabel) return parentLabel;
|
|
5664
|
+
return null;
|
|
5665
|
+
}
|
|
5666
|
+
/**
|
|
5667
|
+
* Create input overlay container (for text inputs/selects)
|
|
5668
|
+
*/
|
|
5669
|
+
createInputOverlayContainer(container) {
|
|
5670
|
+
container.className = "field-status-overlay";
|
|
5671
|
+
container.innerHTML = this.getStatusHTML();
|
|
5672
|
+
const parent = this.fieldElement.parentElement;
|
|
5673
|
+
if (getComputedStyle(parent).position === "static") {
|
|
5674
|
+
parent.style.position = "relative";
|
|
5675
|
+
}
|
|
5676
|
+
parent.appendChild(container);
|
|
5677
|
+
return container;
|
|
5678
|
+
}
|
|
5679
|
+
/**
|
|
5680
|
+
* Create full overlay container (for textareas/large inputs)
|
|
5681
|
+
*/
|
|
5682
|
+
createFullOverlayContainer(container) {
|
|
5683
|
+
container.className = "field-status-full-overlay d-none";
|
|
5684
|
+
container.innerHTML = `
|
|
5685
|
+
<div class="saving-indicator">
|
|
5686
|
+
<div class="spinner-border spinner-border-sm text-primary" role="status">
|
|
5599
5687
|
<span class="visually-hidden">Saving...</span>
|
|
5600
5688
|
</div>
|
|
5601
|
-
<
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5689
|
+
<span class="ms-2">Saving...</span>
|
|
5690
|
+
</div>
|
|
5691
|
+
<div class="success-indicator d-none">
|
|
5692
|
+
<i class="bi bi-check-circle text-success"></i>
|
|
5693
|
+
<span class="ms-2">Saved</span>
|
|
5694
|
+
</div>
|
|
5695
|
+
<div class="error-indicator d-none">
|
|
5696
|
+
<i class="bi bi-exclamation-circle text-danger"></i>
|
|
5697
|
+
<span class="ms-2">Error saving</span>
|
|
5698
|
+
</div>
|
|
5699
|
+
`;
|
|
5700
|
+
const parent = this.fieldElement.parentElement;
|
|
5701
|
+
if (getComputedStyle(parent).position === "static") {
|
|
5702
|
+
parent.style.position = "relative";
|
|
5605
5703
|
}
|
|
5704
|
+
parent.appendChild(container);
|
|
5606
5705
|
return container;
|
|
5607
5706
|
}
|
|
5707
|
+
/**
|
|
5708
|
+
* Get standard status HTML for simple containers
|
|
5709
|
+
*/
|
|
5710
|
+
getStatusHTML() {
|
|
5711
|
+
return `
|
|
5712
|
+
<div class="spinner-border spinner-border-sm text-primary d-none" data-status="saving" role="status">
|
|
5713
|
+
<span class="visually-hidden">Saving...</span>
|
|
5714
|
+
</div>
|
|
5715
|
+
<i class="bi bi-check-circle text-success d-none" data-status="saved"></i>
|
|
5716
|
+
<i class="bi bi-exclamation-circle text-danger d-none" data-status="error"></i>
|
|
5717
|
+
`;
|
|
5718
|
+
}
|
|
5608
5719
|
/**
|
|
5609
5720
|
* Show a status indicator
|
|
5610
5721
|
* @param {string} type - Status type: 'saving', 'saved', 'error'
|
|
@@ -5612,6 +5723,12 @@ class FieldStatusManager {
|
|
|
5612
5723
|
*/
|
|
5613
5724
|
showStatus(type, options = {}) {
|
|
5614
5725
|
this.clearTimeout(type);
|
|
5726
|
+
this.showStandardStatus(type, options);
|
|
5727
|
+
}
|
|
5728
|
+
/**
|
|
5729
|
+
* Show status for standard containers (right-side, input-overlay)
|
|
5730
|
+
*/
|
|
5731
|
+
showStandardStatus(type, options = {}) {
|
|
5615
5732
|
this.hideAllStatuses();
|
|
5616
5733
|
const indicator = this.statusContainer.querySelector(`[data-status="${type}"]`);
|
|
5617
5734
|
if (indicator) {
|
|
@@ -5627,6 +5744,38 @@ class FieldStatusManager {
|
|
|
5627
5744
|
}
|
|
5628
5745
|
}
|
|
5629
5746
|
}
|
|
5747
|
+
/**
|
|
5748
|
+
* Show status for full overlay containers (textareas)
|
|
5749
|
+
*/
|
|
5750
|
+
showFullOverlayStatus(type, options = {}) {
|
|
5751
|
+
const indicators = this.statusContainer.querySelectorAll(".saving-indicator, .success-indicator, .error-indicator");
|
|
5752
|
+
indicators.forEach((ind) => ind.classList.add("d-none"));
|
|
5753
|
+
this.statusContainer.classList.remove("d-none");
|
|
5754
|
+
let indicatorClass;
|
|
5755
|
+
switch (type) {
|
|
5756
|
+
case "saving":
|
|
5757
|
+
indicatorClass = ".saving-indicator";
|
|
5758
|
+
break;
|
|
5759
|
+
case "saved":
|
|
5760
|
+
indicatorClass = ".success-indicator";
|
|
5761
|
+
this.setTimeout(type, () => this.hideStatus(type), 2500);
|
|
5762
|
+
break;
|
|
5763
|
+
case "error":
|
|
5764
|
+
indicatorClass = ".error-indicator";
|
|
5765
|
+
if (options.message) {
|
|
5766
|
+
const errorSpan = this.statusContainer.querySelector(".error-indicator span");
|
|
5767
|
+
if (errorSpan) errorSpan.textContent = options.message;
|
|
5768
|
+
}
|
|
5769
|
+
this.setTimeout(type, () => this.hideStatus(type), 6e3);
|
|
5770
|
+
break;
|
|
5771
|
+
}
|
|
5772
|
+
if (indicatorClass) {
|
|
5773
|
+
const indicator = this.statusContainer.querySelector(indicatorClass);
|
|
5774
|
+
if (indicator) {
|
|
5775
|
+
indicator.classList.remove("d-none");
|
|
5776
|
+
}
|
|
5777
|
+
}
|
|
5778
|
+
}
|
|
5630
5779
|
/**
|
|
5631
5780
|
* Hide a specific status indicator
|
|
5632
5781
|
* @param {string} type - Status type to hide
|
|
@@ -5692,4 +5841,4 @@ export {
|
|
|
5692
5841
|
applyFileDropMixin as a,
|
|
5693
5842
|
FormView$1 as b
|
|
5694
5843
|
};
|
|
5695
|
-
//# sourceMappingURL=FormView-
|
|
5844
|
+
//# sourceMappingURL=FormView-rtiwVHoR.js.map
|