web-mojo 2.1.147 → 2.1.149
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 +11 -11
- 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-CvfjL2Tm.js → ContextMenu-BaT3bSsd.js} +2 -2
- package/dist/chunks/{ContextMenu-CvfjL2Tm.js.map → ContextMenu-BaT3bSsd.js.map} +1 -1
- package/dist/chunks/{ContextMenu-CPIEKhAe.js → ContextMenu-CzRnabNO.js} +2 -2
- package/dist/chunks/{ContextMenu-CPIEKhAe.js.map → ContextMenu-CzRnabNO.js.map} +1 -1
- package/dist/chunks/{DataView-BzZORYgB.js → DataView-B2TreRHx.js} +2 -2
- package/dist/chunks/{DataView-BzZORYgB.js.map → DataView-B2TreRHx.js.map} +1 -1
- package/dist/chunks/{DataView-DfNl1VoV.js → DataView-BHAv1gI6.js} +2 -2
- package/dist/chunks/{DataView-DfNl1VoV.js.map → DataView-BHAv1gI6.js.map} +1 -1
- package/dist/chunks/{Dialog-BF8UHMNy.js → Dialog-CyF6pqgx.js} +10 -6
- package/dist/chunks/{Dialog-BF8UHMNy.js.map → Dialog-CyF6pqgx.js.map} +1 -1
- package/dist/chunks/{Dialog-DniGRMw_.js → Dialog-DcTbr_yY.js} +2 -2
- package/dist/chunks/{Dialog-DniGRMw_.js.map → Dialog-DcTbr_yY.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-BxZefCLj.js → FilePreviewView-B23wdIER.js} +2 -2
- package/dist/chunks/{FilePreviewView-BxZefCLj.js.map → FilePreviewView-B23wdIER.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-_ECi-fEk.js → FilePreviewView-ChONkEOl.js} +12 -6
- package/dist/chunks/{FilePreviewView-_ECi-fEk.js.map → FilePreviewView-ChONkEOl.js.map} +1 -1
- package/dist/chunks/{FormView-DGHRC7wG.js → FormView-B8Oo_gZo.js} +65 -2
- package/dist/chunks/FormView-B8Oo_gZo.js.map +1 -0
- package/dist/chunks/FormView-D9bqoZtL.js +2 -0
- package/dist/chunks/FormView-D9bqoZtL.js.map +1 -0
- package/dist/chunks/{MetricsChart-onWZGQmb.js → MetricsChart-Cs1AtSTU.js} +3 -3
- package/dist/chunks/{MetricsChart-onWZGQmb.js.map → MetricsChart-Cs1AtSTU.js.map} +1 -1
- package/dist/chunks/{MetricsChart-4PvN69Bv.js → MetricsChart-DFMLp4BK.js} +2 -2
- package/dist/chunks/{MetricsChart-4PvN69Bv.js.map → MetricsChart-DFMLp4BK.js.map} +1 -1
- package/dist/chunks/{PDFViewer-dRczotpR.js → PDFViewer-C6hUsPJw.js} +3 -3
- package/dist/chunks/{PDFViewer-dRczotpR.js.map → PDFViewer-C6hUsPJw.js.map} +1 -1
- package/dist/chunks/{PDFViewer-R3eSNkMi.js → PDFViewer-CbyEKEQG.js} +2 -2
- package/dist/chunks/{PDFViewer-R3eSNkMi.js.map → PDFViewer-CbyEKEQG.js.map} +1 -1
- package/dist/chunks/{Page-CGYufWec.js → Page-DYhMoi-t.js} +2 -2
- package/dist/chunks/{Page-CGYufWec.js.map → Page-DYhMoi-t.js.map} +1 -1
- package/dist/chunks/{Page-DUxSoIUM.js → Page-tCsxO3Ys.js} +2 -2
- package/dist/chunks/{Page-DUxSoIUM.js.map → Page-tCsxO3Ys.js.map} +1 -1
- package/dist/chunks/{TopNav-Cd1xa-tK.js → TopNav-BpZzHPji.js} +2 -2
- package/dist/chunks/{TopNav-Cd1xa-tK.js.map → TopNav-BpZzHPji.js.map} +1 -1
- package/dist/chunks/{TopNav-DvLNJ72o.js → TopNav-DuyHTGK_.js} +2 -2
- package/dist/chunks/{TopNav-DvLNJ72o.js.map → TopNav-DuyHTGK_.js.map} +1 -1
- package/dist/chunks/{User-B9hllSGN.js → User-C6Ahhl6c.js} +2 -2
- package/dist/chunks/{User-B9hllSGN.js.map → User-C6Ahhl6c.js.map} +1 -1
- package/dist/chunks/{User-CdCiF7nV.js → User-C6lshdJ5.js} +2 -2
- package/dist/chunks/{User-CdCiF7nV.js.map → User-C6lshdJ5.js.map} +1 -1
- package/dist/chunks/WebApp-Cl84Zgqx.js +2 -0
- package/dist/chunks/WebApp-Cl84Zgqx.js.map +1 -0
- package/dist/chunks/{WebApp-BY8mVIDV.js → WebApp-NTXAWvFg.js} +39 -16
- package/dist/chunks/WebApp-NTXAWvFg.js.map +1 -0
- package/dist/docit.cjs.js +1 -1
- package/dist/docit.es.js +6 -6
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +10 -10
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/FormView-C_lQKxCQ.js +0 -2
- package/dist/chunks/FormView-C_lQKxCQ.js.map +0 -1
- package/dist/chunks/FormView-DGHRC7wG.js.map +0 -1
- package/dist/chunks/WebApp-BY8mVIDV.js.map +0 -1
- package/dist/chunks/WebApp-CSME0_mA.js +0 -2
- package/dist/chunks/WebApp-CSME0_mA.js.map +0 -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-NTXAWvFg.js";
|
|
2
2
|
class FormBuilder {
|
|
3
3
|
constructor(config = {}) {
|
|
4
4
|
this.fields = config.fields || [];
|
|
@@ -469,6 +469,9 @@ class FormBuilder {
|
|
|
469
469
|
case "search":
|
|
470
470
|
fieldHTML = this.renderSearchField(field);
|
|
471
471
|
break;
|
|
472
|
+
case "hex":
|
|
473
|
+
fieldHTML = this.renderHexField(field);
|
|
474
|
+
break;
|
|
472
475
|
case "textarea":
|
|
473
476
|
fieldHTML = this.renderTextareaField(field);
|
|
474
477
|
break;
|
|
@@ -644,6 +647,66 @@ class FormBuilder {
|
|
|
644
647
|
};
|
|
645
648
|
return this.renderInputField(searchField, "search");
|
|
646
649
|
}
|
|
650
|
+
/**
|
|
651
|
+
* Render hex input field with validation
|
|
652
|
+
* @param {Object} field - Field configuration
|
|
653
|
+
* @returns {string} Field HTML
|
|
654
|
+
*/
|
|
655
|
+
renderHexField(field) {
|
|
656
|
+
const {
|
|
657
|
+
hexType = "color",
|
|
658
|
+
// 'color', 'string', 'any'
|
|
659
|
+
allowPrefix = true,
|
|
660
|
+
minLength: originalMinLength,
|
|
661
|
+
maxLength: originalMaxLength,
|
|
662
|
+
...baseField
|
|
663
|
+
} = field;
|
|
664
|
+
let pattern, minLength, maxLength, placeholder, help;
|
|
665
|
+
switch (hexType) {
|
|
666
|
+
case "color":
|
|
667
|
+
pattern = allowPrefix ? "^#?[0-9A-Fa-f]{6}$" : "^[0-9A-Fa-f]{6}$";
|
|
668
|
+
minLength = allowPrefix ? 6 : 6;
|
|
669
|
+
maxLength = allowPrefix ? 7 : 6;
|
|
670
|
+
placeholder = allowPrefix ? "#FF0000" : "FF0000";
|
|
671
|
+
help = help || "Enter a valid hex color (e.g., " + placeholder + ")";
|
|
672
|
+
break;
|
|
673
|
+
case "color-short":
|
|
674
|
+
pattern = allowPrefix ? "^#?[0-9A-Fa-f]{3}([0-9A-Fa-f]{3})?$" : "^[0-9A-Fa-f]{3}([0-9A-Fa-f]{3})?$";
|
|
675
|
+
minLength = allowPrefix ? 4 : 3;
|
|
676
|
+
maxLength = allowPrefix ? 7 : 6;
|
|
677
|
+
placeholder = allowPrefix ? "#F00 or #FF0000" : "F00 or FF0000";
|
|
678
|
+
help = help || "Enter a valid hex color (3 or 6 digits)";
|
|
679
|
+
break;
|
|
680
|
+
case "string":
|
|
681
|
+
pattern = "^[0-9A-Fa-f]+$";
|
|
682
|
+
minLength = originalMinLength || 1;
|
|
683
|
+
maxLength = originalMaxLength || 64;
|
|
684
|
+
placeholder = "ABCDEF123456";
|
|
685
|
+
help = help || "Only hexadecimal characters (0-9, A-F) allowed";
|
|
686
|
+
break;
|
|
687
|
+
default:
|
|
688
|
+
pattern = allowPrefix ? "^#?[0-9A-Fa-f]+$" : "^[0-9A-Fa-f]+$";
|
|
689
|
+
minLength = originalMinLength || 1;
|
|
690
|
+
maxLength = originalMaxLength || 64;
|
|
691
|
+
placeholder = allowPrefix ? "#ABCDEF or ABCDEF" : "ABCDEF";
|
|
692
|
+
help = help || "Enter hexadecimal characters only";
|
|
693
|
+
}
|
|
694
|
+
const hexField = {
|
|
695
|
+
...baseField,
|
|
696
|
+
pattern,
|
|
697
|
+
minLength,
|
|
698
|
+
maxLength,
|
|
699
|
+
placeholder: baseField.placeholder || placeholder,
|
|
700
|
+
help: baseField.help || help,
|
|
701
|
+
attributes: {
|
|
702
|
+
"data-hex-type": hexType,
|
|
703
|
+
"data-allow-prefix": allowPrefix,
|
|
704
|
+
"style": "text-transform: uppercase;",
|
|
705
|
+
...baseField.attributes
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
return this.renderInputField(hexField, "text");
|
|
709
|
+
}
|
|
647
710
|
/**
|
|
648
711
|
* Render generic input field
|
|
649
712
|
* @param {Object} field - Field configuration
|
|
@@ -5119,4 +5182,4 @@ export {
|
|
|
5119
5182
|
applyFileDropMixin as a,
|
|
5120
5183
|
FormView$1 as b
|
|
5121
5184
|
};
|
|
5122
|
-
//# sourceMappingURL=FormView-
|
|
5185
|
+
//# sourceMappingURL=FormView-B8Oo_gZo.js.map
|