web-mojo 2.1.339 → 2.1.355
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-CaO_Wb-z.js} +2 -2
- package/dist/chunks/{ContextMenu-BT3vN7aw.js.map → ContextMenu-CaO_Wb-z.js.map} +1 -1
- package/dist/chunks/{ContextMenu-BqOWkQTt.js → ContextMenu-iaY1S0SP.js} +2 -2
- package/dist/chunks/{ContextMenu-BqOWkQTt.js.map → ContextMenu-iaY1S0SP.js.map} +1 -1
- package/dist/chunks/{DataView-NZ1_P0Uf.js → DataView-Cyk0e7AN.js} +2 -2
- package/dist/chunks/{DataView-NZ1_P0Uf.js.map → DataView-Cyk0e7AN.js.map} +1 -1
- package/dist/chunks/{DataView-DdcSHghg.js → DataView-krcnWI32.js} +2 -2
- package/dist/chunks/{DataView-DdcSHghg.js.map → DataView-krcnWI32.js.map} +1 -1
- package/dist/chunks/{Dialog-B71VE40z.js → Dialog-CYmFy-eO.js} +5 -5
- package/dist/chunks/{Dialog-B71VE40z.js.map → Dialog-CYmFy-eO.js.map} +1 -1
- package/dist/chunks/{Dialog-CCDZACXQ.js → Dialog-DYw31Dje.js} +2 -2
- package/dist/chunks/{Dialog-CCDZACXQ.js.map → Dialog-DYw31Dje.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-WjbdoWrT.js → FilePreviewView-Bsnm2Kci.js} +6 -6
- package/dist/chunks/{FilePreviewView-WjbdoWrT.js.map → FilePreviewView-Bsnm2Kci.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-BGOBqhUE.js → FilePreviewView-CKGKsiXj.js} +2 -2
- package/dist/chunks/{FilePreviewView-BGOBqhUE.js.map → FilePreviewView-CKGKsiXj.js.map} +1 -1
- package/dist/chunks/{FormView-BljGVlOM.js → FormView-C0vzlNsh.js} +185 -12
- package/dist/chunks/{FormView-BljGVlOM.js.map → FormView-C0vzlNsh.js.map} +1 -1
- package/dist/chunks/{FormView-D3_d_L41.js → FormView-DUd1S8uG.js} +2 -2
- package/dist/chunks/{FormView-D3_d_L41.js.map → FormView-DUd1S8uG.js.map} +1 -1
- package/dist/chunks/{MetricsChart-C2Wr4Vom.js → MetricsChart-BZoxSlBL.js} +2 -2
- package/dist/chunks/{MetricsChart-C2Wr4Vom.js.map → MetricsChart-BZoxSlBL.js.map} +1 -1
- package/dist/chunks/{MetricsChart-qAL4Xpge.js → MetricsChart-CUTtFUtT.js} +3 -3
- package/dist/chunks/{MetricsChart-qAL4Xpge.js.map → MetricsChart-CUTtFUtT.js.map} +1 -1
- package/dist/chunks/{PDFViewer-DZjz2YPF.js → PDFViewer-CMUMrupI.js} +2 -2
- package/dist/chunks/{PDFViewer-DZjz2YPF.js.map → PDFViewer-CMUMrupI.js.map} +1 -1
- package/dist/chunks/{PDFViewer-iEMG_tQF.js → PDFViewer-Cu7dvzI9.js} +3 -3
- package/dist/chunks/{PDFViewer-iEMG_tQF.js.map → PDFViewer-Cu7dvzI9.js.map} +1 -1
- package/dist/chunks/{Page-BK3BbbvR.js → Page-CvTKpKY7.js} +2 -2
- package/dist/chunks/{Page-BK3BbbvR.js.map → Page-CvTKpKY7.js.map} +1 -1
- package/dist/chunks/{Page-B9zFcwAg.js → Page-D1uPtRm3.js} +2 -2
- package/dist/chunks/{Page-B9zFcwAg.js.map → Page-D1uPtRm3.js.map} +1 -1
- package/dist/chunks/{TopNav-B4-mTytV.js → TopNav-C97SDt7k.js} +2 -2
- package/dist/chunks/{TopNav-B4-mTytV.js.map → TopNav-C97SDt7k.js.map} +1 -1
- package/dist/chunks/{TopNav-C38znvne.js → TopNav-CpuxII1x.js} +2 -2
- package/dist/chunks/{TopNav-C38znvne.js.map → TopNav-CpuxII1x.js.map} +1 -1
- package/dist/chunks/{WebApp-BoP0b5Ze.js → WebApp-BGlgRy-V.js} +2 -2
- package/dist/chunks/{WebApp-BoP0b5Ze.js.map → WebApp-BGlgRy-V.js.map} +1 -1
- package/dist/chunks/{WebApp-CYe2_G2E.js → WebApp-Br3Dja6P.js} +12 -12
- package/dist/chunks/{WebApp-CYe2_G2E.js.map → WebApp-Br3Dja6P.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-Br3Dja6P.js";
|
|
2
2
|
class FormBuilder {
|
|
3
3
|
constructor(config = {}) {
|
|
4
4
|
this.fields = config.fields || [];
|
|
@@ -5587,24 +5587,155 @@ 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, .field-status-overlay, .field-status-full-overlay, .field-status-label-inline");
|
|
5594
|
+
if (!container && this.getFieldType() === "toggle") {
|
|
5595
|
+
const label = this.findToggleLabel();
|
|
5596
|
+
if (label) {
|
|
5597
|
+
container = label.querySelector(".field-status-label-inline");
|
|
5598
|
+
}
|
|
5599
|
+
}
|
|
5594
5600
|
if (!container) {
|
|
5595
|
-
container =
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
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
|
+
const placement = this.getPlacementStrategy(fieldType);
|
|
5611
|
+
const container = document.createElement("div");
|
|
5612
|
+
switch (placement) {
|
|
5613
|
+
case "label-inline":
|
|
5614
|
+
return this.createLabelInlineContainer(container);
|
|
5615
|
+
case "input-overlay":
|
|
5616
|
+
return this.createInputOverlayContainer(container);
|
|
5617
|
+
case "full-overlay":
|
|
5618
|
+
return this.createFullOverlayContainer(container);
|
|
5619
|
+
default:
|
|
5620
|
+
return this.createInputOverlayContainer(container);
|
|
5621
|
+
}
|
|
5622
|
+
}
|
|
5623
|
+
/**
|
|
5624
|
+
* Determine field type from element
|
|
5625
|
+
*/
|
|
5626
|
+
getFieldType() {
|
|
5627
|
+
const tagName = this.fieldElement.tagName.toLowerCase();
|
|
5628
|
+
const type = this.fieldElement.type?.toLowerCase();
|
|
5629
|
+
const classes = this.fieldElement.className;
|
|
5630
|
+
if (type === "checkbox" || classes.includes("form-check-input") || classes.includes("form-switch")) {
|
|
5631
|
+
return "toggle";
|
|
5632
|
+
} else if (tagName === "select") {
|
|
5633
|
+
return "select";
|
|
5634
|
+
} else if (tagName === "textarea") {
|
|
5635
|
+
return "textarea";
|
|
5636
|
+
} else if (tagName === "input") {
|
|
5637
|
+
return "input";
|
|
5638
|
+
}
|
|
5639
|
+
return "input";
|
|
5640
|
+
}
|
|
5641
|
+
/**
|
|
5642
|
+
* Determine placement strategy for field type
|
|
5643
|
+
*/
|
|
5644
|
+
getPlacementStrategy(fieldType) {
|
|
5645
|
+
switch (fieldType) {
|
|
5646
|
+
case "toggle":
|
|
5647
|
+
return "label-inline";
|
|
5648
|
+
// New inline label approach
|
|
5649
|
+
case "textarea":
|
|
5650
|
+
return "full-overlay";
|
|
5651
|
+
case "input":
|
|
5652
|
+
case "select":
|
|
5653
|
+
return "input-overlay";
|
|
5654
|
+
default:
|
|
5655
|
+
return "input-overlay";
|
|
5656
|
+
}
|
|
5657
|
+
}
|
|
5658
|
+
/**
|
|
5659
|
+
* Create inline label status container (for toggles/checkboxes)
|
|
5660
|
+
*/
|
|
5661
|
+
createLabelInlineContainer(container) {
|
|
5662
|
+
container.className = "field-status-label-inline";
|
|
5663
|
+
container.innerHTML = this.getStatusHTML();
|
|
5664
|
+
const label = this.findToggleLabel();
|
|
5665
|
+
if (label) {
|
|
5666
|
+
label.appendChild(container);
|
|
5667
|
+
} else {
|
|
5668
|
+
this.fieldElement.parentElement.appendChild(container);
|
|
5669
|
+
}
|
|
5670
|
+
return container;
|
|
5671
|
+
}
|
|
5672
|
+
/**
|
|
5673
|
+
* Find the label associated with this toggle field
|
|
5674
|
+
*/
|
|
5675
|
+
findToggleLabel() {
|
|
5676
|
+
if (this.fieldElement.id) {
|
|
5677
|
+
const label2 = document.querySelector(`label[for="${this.fieldElement.id}"]`);
|
|
5678
|
+
if (label2) return label2;
|
|
5679
|
+
}
|
|
5680
|
+
const label = this.fieldElement.parentElement.querySelector("label");
|
|
5681
|
+
if (label) return label;
|
|
5682
|
+
const parentLabel = this.fieldElement.closest("label");
|
|
5683
|
+
if (parentLabel) return parentLabel;
|
|
5684
|
+
return null;
|
|
5685
|
+
}
|
|
5686
|
+
/**
|
|
5687
|
+
* Create input overlay container (for text inputs/selects)
|
|
5688
|
+
*/
|
|
5689
|
+
createInputOverlayContainer(container) {
|
|
5690
|
+
container.className = "field-status-overlay";
|
|
5691
|
+
container.innerHTML = this.getStatusHTML();
|
|
5692
|
+
const parent = this.fieldElement.parentElement;
|
|
5693
|
+
if (getComputedStyle(parent).position === "static") {
|
|
5694
|
+
parent.style.position = "relative";
|
|
5695
|
+
}
|
|
5696
|
+
parent.appendChild(container);
|
|
5697
|
+
return container;
|
|
5698
|
+
}
|
|
5699
|
+
/**
|
|
5700
|
+
* Create full overlay container (for textareas/large inputs)
|
|
5701
|
+
*/
|
|
5702
|
+
createFullOverlayContainer(container) {
|
|
5703
|
+
container.className = "field-status-full-overlay d-none";
|
|
5704
|
+
container.innerHTML = `
|
|
5705
|
+
<div class="saving-indicator">
|
|
5706
|
+
<div class="spinner-border spinner-border-sm text-primary" role="status">
|
|
5599
5707
|
<span class="visually-hidden">Saving...</span>
|
|
5600
5708
|
</div>
|
|
5601
|
-
<
|
|
5602
|
-
|
|
5603
|
-
|
|
5604
|
-
|
|
5709
|
+
<span class="ms-2">Saving...</span>
|
|
5710
|
+
</div>
|
|
5711
|
+
<div class="success-indicator d-none">
|
|
5712
|
+
<i class="bi bi-check-circle text-success"></i>
|
|
5713
|
+
<span class="ms-2">Saved</span>
|
|
5714
|
+
</div>
|
|
5715
|
+
<div class="error-indicator d-none">
|
|
5716
|
+
<i class="bi bi-exclamation-circle text-danger"></i>
|
|
5717
|
+
<span class="ms-2">Error saving</span>
|
|
5718
|
+
</div>
|
|
5719
|
+
`;
|
|
5720
|
+
const parent = this.fieldElement.parentElement;
|
|
5721
|
+
if (getComputedStyle(parent).position === "static") {
|
|
5722
|
+
parent.style.position = "relative";
|
|
5605
5723
|
}
|
|
5724
|
+
parent.appendChild(container);
|
|
5606
5725
|
return container;
|
|
5607
5726
|
}
|
|
5727
|
+
/**
|
|
5728
|
+
* Get standard status HTML for simple containers
|
|
5729
|
+
*/
|
|
5730
|
+
getStatusHTML() {
|
|
5731
|
+
return `
|
|
5732
|
+
<div class="spinner-border spinner-border-sm text-primary d-none" data-status="saving" role="status">
|
|
5733
|
+
<span class="visually-hidden">Saving...</span>
|
|
5734
|
+
</div>
|
|
5735
|
+
<i class="bi bi-check-circle text-success d-none" data-status="saved"></i>
|
|
5736
|
+
<i class="bi bi-exclamation-circle text-danger d-none" data-status="error"></i>
|
|
5737
|
+
`;
|
|
5738
|
+
}
|
|
5608
5739
|
/**
|
|
5609
5740
|
* Show a status indicator
|
|
5610
5741
|
* @param {string} type - Status type: 'saving', 'saved', 'error'
|
|
@@ -5612,6 +5743,16 @@ class FieldStatusManager {
|
|
|
5612
5743
|
*/
|
|
5613
5744
|
showStatus(type, options = {}) {
|
|
5614
5745
|
this.clearTimeout(type);
|
|
5746
|
+
if (this.statusContainer.classList.contains("field-status-full-overlay")) {
|
|
5747
|
+
this.showFullOverlayStatus(type, options);
|
|
5748
|
+
} else {
|
|
5749
|
+
this.showStandardStatus(type, options);
|
|
5750
|
+
}
|
|
5751
|
+
}
|
|
5752
|
+
/**
|
|
5753
|
+
* Show status for standard containers (right-side, input-overlay)
|
|
5754
|
+
*/
|
|
5755
|
+
showStandardStatus(type, options = {}) {
|
|
5615
5756
|
this.hideAllStatuses();
|
|
5616
5757
|
const indicator = this.statusContainer.querySelector(`[data-status="${type}"]`);
|
|
5617
5758
|
if (indicator) {
|
|
@@ -5627,6 +5768,38 @@ class FieldStatusManager {
|
|
|
5627
5768
|
}
|
|
5628
5769
|
}
|
|
5629
5770
|
}
|
|
5771
|
+
/**
|
|
5772
|
+
* Show status for full overlay containers (textareas)
|
|
5773
|
+
*/
|
|
5774
|
+
showFullOverlayStatus(type, options = {}) {
|
|
5775
|
+
const indicators = this.statusContainer.querySelectorAll(".saving-indicator, .success-indicator, .error-indicator");
|
|
5776
|
+
indicators.forEach((ind) => ind.classList.add("d-none"));
|
|
5777
|
+
this.statusContainer.classList.remove("d-none");
|
|
5778
|
+
let indicatorClass;
|
|
5779
|
+
switch (type) {
|
|
5780
|
+
case "saving":
|
|
5781
|
+
indicatorClass = ".saving-indicator";
|
|
5782
|
+
break;
|
|
5783
|
+
case "saved":
|
|
5784
|
+
indicatorClass = ".success-indicator";
|
|
5785
|
+
this.setTimeout(type, () => this.hideStatus(type), 2500);
|
|
5786
|
+
break;
|
|
5787
|
+
case "error":
|
|
5788
|
+
indicatorClass = ".error-indicator";
|
|
5789
|
+
if (options.message) {
|
|
5790
|
+
const errorSpan = this.statusContainer.querySelector(".error-indicator span");
|
|
5791
|
+
if (errorSpan) errorSpan.textContent = options.message;
|
|
5792
|
+
}
|
|
5793
|
+
this.setTimeout(type, () => this.hideStatus(type), 6e3);
|
|
5794
|
+
break;
|
|
5795
|
+
}
|
|
5796
|
+
if (indicatorClass) {
|
|
5797
|
+
const indicator = this.statusContainer.querySelector(indicatorClass);
|
|
5798
|
+
if (indicator) {
|
|
5799
|
+
indicator.classList.remove("d-none");
|
|
5800
|
+
}
|
|
5801
|
+
}
|
|
5802
|
+
}
|
|
5630
5803
|
/**
|
|
5631
5804
|
* Hide a specific status indicator
|
|
5632
5805
|
* @param {string} type - Status type to hide
|
|
@@ -5692,4 +5865,4 @@ export {
|
|
|
5692
5865
|
applyFileDropMixin as a,
|
|
5693
5866
|
FormView$1 as b
|
|
5694
5867
|
};
|
|
5695
|
-
//# sourceMappingURL=FormView-
|
|
5868
|
+
//# sourceMappingURL=FormView-C0vzlNsh.js.map
|