web-mojo 2.1.148 → 2.1.150
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-BD2Mq0HO.js → ContextMenu-QF9ZwZrY.js} +2 -2
- package/dist/chunks/{ContextMenu-BD2Mq0HO.js.map → ContextMenu-QF9ZwZrY.js.map} +1 -1
- package/dist/chunks/{ContextMenu-Kmf5lBFO.js → ContextMenu-XiQkI2dD.js} +2 -2
- package/dist/chunks/{ContextMenu-Kmf5lBFO.js.map → ContextMenu-XiQkI2dD.js.map} +1 -1
- package/dist/chunks/{DataView-BIhNGfi4.js → DataView-DLwwky88.js} +2 -2
- package/dist/chunks/{DataView-BIhNGfi4.js.map → DataView-DLwwky88.js.map} +1 -1
- package/dist/chunks/{DataView-CTdUJoOT.js → DataView-MS4cRzLQ.js} +2 -2
- package/dist/chunks/{DataView-CTdUJoOT.js.map → DataView-MS4cRzLQ.js.map} +1 -1
- package/dist/chunks/{Dialog-ZdL6pkRV.js → Dialog-BXp4_OKF.js} +10 -6
- package/dist/chunks/{Dialog-ZdL6pkRV.js.map → Dialog-BXp4_OKF.js.map} +1 -1
- package/dist/chunks/{Dialog-BxfPKg0I.js → Dialog-Qec_9opM.js} +2 -2
- package/dist/chunks/{Dialog-BxfPKg0I.js.map → Dialog-Qec_9opM.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-CKG0cTAb.js → FilePreviewView-BXIfs9s2.js} +2 -2
- package/dist/chunks/{FilePreviewView-CKG0cTAb.js.map → FilePreviewView-BXIfs9s2.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-BaB9mH6Z.js → FilePreviewView-CMV_GXSo.js} +17 -6
- package/dist/chunks/{FilePreviewView-BaB9mH6Z.js.map → FilePreviewView-CMV_GXSo.js.map} +1 -1
- package/dist/chunks/FormView-BxJB5CR4.js +2 -0
- package/dist/chunks/FormView-BxJB5CR4.js.map +1 -0
- package/dist/chunks/{FormView-DWZpiMt-.js → FormView-W8hQ1TSD.js} +65 -2
- package/dist/chunks/FormView-W8hQ1TSD.js.map +1 -0
- package/dist/chunks/{MetricsChart--dg0dX5p.js → MetricsChart-Cp8yjAov.js} +3 -3
- package/dist/chunks/{MetricsChart--dg0dX5p.js.map → MetricsChart-Cp8yjAov.js.map} +1 -1
- package/dist/chunks/{MetricsChart-sc1d5n8r.js → MetricsChart-D16WsIML.js} +2 -2
- package/dist/chunks/{MetricsChart-sc1d5n8r.js.map → MetricsChart-D16WsIML.js.map} +1 -1
- package/dist/chunks/{PDFViewer-BwtpTuNi.js → PDFViewer-DBQedX8U.js} +2 -2
- package/dist/chunks/{PDFViewer-BwtpTuNi.js.map → PDFViewer-DBQedX8U.js.map} +1 -1
- package/dist/chunks/{PDFViewer-CreSzhQh.js → PDFViewer-DuTWfs3P.js} +3 -3
- package/dist/chunks/{PDFViewer-CreSzhQh.js.map → PDFViewer-DuTWfs3P.js.map} +1 -1
- package/dist/chunks/{Page-CylN9BT4.js → Page-DiQtAn7T.js} +2 -2
- package/dist/chunks/{Page-CylN9BT4.js.map → Page-DiQtAn7T.js.map} +1 -1
- package/dist/chunks/{Page-xC4O39VU.js → Page-q5jV9C1F.js} +2 -2
- package/dist/chunks/{Page-xC4O39VU.js.map → Page-q5jV9C1F.js.map} +1 -1
- package/dist/chunks/{TopNav-DYiaDJhN.js → TopNav-YVTSw6Nr.js} +2 -2
- package/dist/chunks/{TopNav-DYiaDJhN.js.map → TopNav-YVTSw6Nr.js.map} +1 -1
- package/dist/chunks/{TopNav-CnPSzhmm.js → TopNav-f8K7Hflv.js} +2 -2
- package/dist/chunks/{TopNav-CnPSzhmm.js.map → TopNav-f8K7Hflv.js.map} +1 -1
- package/dist/chunks/{User-BSjI92_2.js → User-Cg7Ioqxu.js} +2 -2
- package/dist/chunks/{User-BSjI92_2.js.map → User-Cg7Ioqxu.js.map} +1 -1
- package/dist/chunks/{User-B2ZZnkfJ.js → User-DuqQ4_pt.js} +2 -2
- package/dist/chunks/{User-B2ZZnkfJ.js.map → User-DuqQ4_pt.js.map} +1 -1
- package/dist/chunks/WebApp-B9-TnsfD.js +2 -0
- package/dist/chunks/WebApp-B9-TnsfD.js.map +1 -0
- package/dist/chunks/{WebApp-fCAzeIRX.js → WebApp-ORVEEBcu.js} +40 -17
- package/dist/chunks/WebApp-ORVEEBcu.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.cjs.js.map +1 -1
- package/dist/index.es.js +14 -10
- package/dist/index.es.js.map +1 -1
- package/dist/lightbox.cjs.js +1 -1
- package/dist/lightbox.es.js +4 -4
- package/package.json +1 -1
- package/dist/chunks/FormView-DWZpiMt-.js.map +0 -1
- package/dist/chunks/FormView-Dhufnc7l.js +0 -2
- package/dist/chunks/FormView-Dhufnc7l.js.map +0 -1
- package/dist/chunks/WebApp-3w-NBj8q.js +0 -2
- package/dist/chunks/WebApp-3w-NBj8q.js.map +0 -1
- package/dist/chunks/WebApp-fCAzeIRX.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-ORVEEBcu.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-W8hQ1TSD.js.map
|