web-mojo 2.1.355 → 2.1.363
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-iaY1S0SP.js → ContextMenu-DrHCzNnj.js} +2 -2
- package/dist/chunks/{ContextMenu-iaY1S0SP.js.map → ContextMenu-DrHCzNnj.js.map} +1 -1
- package/dist/chunks/{ContextMenu-CaO_Wb-z.js → ContextMenu-SMFZHEDO.js} +2 -2
- package/dist/chunks/{ContextMenu-CaO_Wb-z.js.map → ContextMenu-SMFZHEDO.js.map} +1 -1
- package/dist/chunks/{DataView-Cyk0e7AN.js → DataView-Bm9_usKv.js} +2 -2
- package/dist/chunks/{DataView-Cyk0e7AN.js.map → DataView-Bm9_usKv.js.map} +1 -1
- package/dist/chunks/{DataView-krcnWI32.js → DataView-D1DjZoRB.js} +2 -2
- package/dist/chunks/{DataView-krcnWI32.js.map → DataView-D1DjZoRB.js.map} +1 -1
- package/dist/chunks/{Dialog-DYw31Dje.js → Dialog-C3mArOEz.js} +2 -2
- package/dist/chunks/{Dialog-DYw31Dje.js.map → Dialog-C3mArOEz.js.map} +1 -1
- package/dist/chunks/{Dialog-CYmFy-eO.js → Dialog-DA0Jexiu.js} +5 -5
- package/dist/chunks/{Dialog-CYmFy-eO.js.map → Dialog-DA0Jexiu.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-CKGKsiXj.js → FilePreviewView-CKtwzViT.js} +2 -2
- package/dist/chunks/{FilePreviewView-CKGKsiXj.js.map → FilePreviewView-CKtwzViT.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-Bsnm2Kci.js → FilePreviewView-namQCgKp.js} +6 -6
- package/dist/chunks/{FilePreviewView-Bsnm2Kci.js.map → FilePreviewView-namQCgKp.js.map} +1 -1
- package/dist/chunks/FormView-BgRpyNaT.js +2 -0
- package/dist/chunks/FormView-BgRpyNaT.js.map +1 -0
- package/dist/chunks/{FormView-C0vzlNsh.js → FormView-DGibmo-j.js} +87 -38
- package/dist/chunks/FormView-DGibmo-j.js.map +1 -0
- package/dist/chunks/{MetricsChart-CUTtFUtT.js → MetricsChart-B5x5Xtkg.js} +3 -3
- package/dist/chunks/{MetricsChart-CUTtFUtT.js.map → MetricsChart-B5x5Xtkg.js.map} +1 -1
- package/dist/chunks/{MetricsChart-BZoxSlBL.js → MetricsChart-CEZMtvXV.js} +2 -2
- package/dist/chunks/{MetricsChart-BZoxSlBL.js.map → MetricsChart-CEZMtvXV.js.map} +1 -1
- package/dist/chunks/{PDFViewer-CMUMrupI.js → PDFViewer-BaLs5yZd.js} +2 -2
- package/dist/chunks/{PDFViewer-CMUMrupI.js.map → PDFViewer-BaLs5yZd.js.map} +1 -1
- package/dist/chunks/{PDFViewer-Cu7dvzI9.js → PDFViewer-CHQxyUy5.js} +3 -3
- package/dist/chunks/{PDFViewer-Cu7dvzI9.js.map → PDFViewer-CHQxyUy5.js.map} +1 -1
- package/dist/chunks/{Page-D1uPtRm3.js → Page-ZRkR7-jK.js} +2 -2
- package/dist/chunks/{Page-D1uPtRm3.js.map → Page-ZRkR7-jK.js.map} +1 -1
- package/dist/chunks/{Page-CvTKpKY7.js → Page-xvLUmYX_.js} +2 -2
- package/dist/chunks/{Page-CvTKpKY7.js.map → Page-xvLUmYX_.js.map} +1 -1
- package/dist/chunks/{TopNav-C97SDt7k.js → TopNav-BWKrbIkW.js} +2 -2
- package/dist/chunks/{TopNav-C97SDt7k.js.map → TopNav-BWKrbIkW.js.map} +1 -1
- package/dist/chunks/{TopNav-CpuxII1x.js → TopNav-CPVs22hG.js} +2 -2
- package/dist/chunks/{TopNav-CpuxII1x.js.map → TopNav-CPVs22hG.js.map} +1 -1
- package/dist/chunks/{WebApp-BGlgRy-V.js → WebApp-C7mMR289.js} +2 -2
- package/dist/chunks/{WebApp-BGlgRy-V.js.map → WebApp-C7mMR289.js.map} +1 -1
- package/dist/chunks/{WebApp-Br3Dja6P.js → WebApp-CBz7WZw_.js} +12 -12
- package/dist/chunks/{WebApp-Br3Dja6P.js.map → WebApp-CBz7WZw_.js.map} +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
- package/dist/chunks/FormView-C0vzlNsh.js.map +0 -1
- package/dist/chunks/FormView-DUd1S8uG.js +0 -2
- package/dist/chunks/FormView-DUd1S8uG.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-CBz7WZw_.js";
|
|
2
2
|
class FormBuilder {
|
|
3
3
|
constructor(config = {}) {
|
|
4
4
|
this.fields = config.fields || [];
|
|
@@ -306,6 +306,31 @@ class FormBuilder {
|
|
|
306
306
|
{{/fields}}
|
|
307
307
|
</div>
|
|
308
308
|
</div>
|
|
309
|
+
`,
|
|
310
|
+
color: `
|
|
311
|
+
<div class="mojo-form-control">
|
|
312
|
+
{{#label}}
|
|
313
|
+
<label for="{{fieldId}}" class="{{labelClass}}">
|
|
314
|
+
{{label}}{{#required}}<span class="text-danger">*</span>{{/required}}
|
|
315
|
+
</label>
|
|
316
|
+
{{/label}}
|
|
317
|
+
<div class="input-group">
|
|
318
|
+
<input type="color" id="{{fieldId}}" name="{{name}}"
|
|
319
|
+
class="{{inputClass}}{{#error}} is-invalid{{/error}}"
|
|
320
|
+
value="{{fieldValue}}"
|
|
321
|
+
{{#required}}required{{/required}} {{#disabled}}disabled{{/disabled}}
|
|
322
|
+
{{#readonly}}readonly{{/readonly}} data-change-action="validate-field" {{{attrs}}}>
|
|
323
|
+
{{#hasValue}}
|
|
324
|
+
<button type="button" class="btn btn-outline-secondary"
|
|
325
|
+
data-action="clear-color" data-field="{{name}}"
|
|
326
|
+
title="Clear color">
|
|
327
|
+
<i class="bi bi-x"></i>
|
|
328
|
+
</button>
|
|
329
|
+
{{/hasValue}}
|
|
330
|
+
</div>
|
|
331
|
+
{{#help}}<div class="{{helpClass}}">{{help}}</div>{{/help}}
|
|
332
|
+
{{#error}}<div class="{{errorClass}}">{{error}}</div>{{/error}}
|
|
333
|
+
</div>
|
|
309
334
|
`
|
|
310
335
|
};
|
|
311
336
|
}
|
|
@@ -1297,7 +1322,42 @@ class FormBuilder {
|
|
|
1297
1322
|
* @returns {string} Field HTML
|
|
1298
1323
|
*/
|
|
1299
1324
|
renderColorField(field) {
|
|
1300
|
-
|
|
1325
|
+
const {
|
|
1326
|
+
name,
|
|
1327
|
+
label,
|
|
1328
|
+
value = "",
|
|
1329
|
+
placeholder = "",
|
|
1330
|
+
required = false,
|
|
1331
|
+
disabled = false,
|
|
1332
|
+
readonly = false,
|
|
1333
|
+
class: fieldClass = "",
|
|
1334
|
+
attributes = {},
|
|
1335
|
+
help = field.helpText || field.help || ""
|
|
1336
|
+
} = field;
|
|
1337
|
+
const inputClass = `${this.options.inputClass} ${fieldClass}`.trim();
|
|
1338
|
+
const error = this.errors[name];
|
|
1339
|
+
const fieldValue = this.getFieldValue(name) ?? value;
|
|
1340
|
+
const attrs = Object.entries(attributes).map(([key, val]) => `${key}="${this.escapeHtml(val)}"`).join(" ");
|
|
1341
|
+
const fieldId = this.getFieldId(name);
|
|
1342
|
+
const context = {
|
|
1343
|
+
labelClass: this.options.labelClass,
|
|
1344
|
+
inputClass,
|
|
1345
|
+
helpClass: this.options.helpClass,
|
|
1346
|
+
errorClass: this.options.errorClass,
|
|
1347
|
+
fieldId,
|
|
1348
|
+
name,
|
|
1349
|
+
fieldValue: this.escapeHtml(fieldValue),
|
|
1350
|
+
label: label ? this.escapeHtml(label) : null,
|
|
1351
|
+
placeholder: placeholder ? this.escapeHtml(placeholder) : null,
|
|
1352
|
+
help: help ? this.escapeHtml(help) : null,
|
|
1353
|
+
error: error ? this.escapeHtml(error) : null,
|
|
1354
|
+
required,
|
|
1355
|
+
disabled,
|
|
1356
|
+
readonly,
|
|
1357
|
+
attrs,
|
|
1358
|
+
hasValue: fieldValue && fieldValue !== ""
|
|
1359
|
+
};
|
|
1360
|
+
return Mustache.render(this.templates.color, context);
|
|
1301
1361
|
}
|
|
1302
1362
|
/**
|
|
1303
1363
|
* Render range field
|
|
@@ -4526,6 +4586,19 @@ class FormView extends View {
|
|
|
4526
4586
|
this.emit("change", { field: fieldName, value: null, form: this });
|
|
4527
4587
|
await this.updateField(fieldName);
|
|
4528
4588
|
}
|
|
4589
|
+
/**
|
|
4590
|
+
* Handle clear color action
|
|
4591
|
+
*/
|
|
4592
|
+
async onActionClearColor(event, element) {
|
|
4593
|
+
const fieldName = element.getAttribute("data-field");
|
|
4594
|
+
if (!fieldName) return;
|
|
4595
|
+
const colorInput = this.element.querySelector(`input[name="${fieldName}"]`);
|
|
4596
|
+
if (colorInput) {
|
|
4597
|
+
colorInput.value = "";
|
|
4598
|
+
this.handleFieldChange(fieldName, "");
|
|
4599
|
+
await this.updateField(fieldName);
|
|
4600
|
+
}
|
|
4601
|
+
}
|
|
4529
4602
|
/**
|
|
4530
4603
|
* Handle button group selection
|
|
4531
4604
|
*/
|
|
@@ -5590,9 +5663,9 @@ class FieldStatusManager {
|
|
|
5590
5663
|
* Find existing status container or create one based on field type
|
|
5591
5664
|
*/
|
|
5592
5665
|
findOrCreateStatusContainer() {
|
|
5593
|
-
let container = this.fieldElement.parentElement.querySelector(".field-status
|
|
5594
|
-
if (!container
|
|
5595
|
-
const label = this.
|
|
5666
|
+
let container = this.fieldElement.parentElement.querySelector(".field-status-label-inline");
|
|
5667
|
+
if (!container) {
|
|
5668
|
+
const label = this.findFieldLabel();
|
|
5596
5669
|
if (label) {
|
|
5597
5670
|
container = label.querySelector(".field-status-label-inline");
|
|
5598
5671
|
}
|
|
@@ -5607,18 +5680,9 @@ class FieldStatusManager {
|
|
|
5607
5680
|
*/
|
|
5608
5681
|
createStatusContainer() {
|
|
5609
5682
|
const fieldType = this.getFieldType();
|
|
5610
|
-
|
|
5683
|
+
this.getPlacementStrategy(fieldType);
|
|
5611
5684
|
const container = document.createElement("div");
|
|
5612
|
-
|
|
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
|
-
}
|
|
5685
|
+
return this.createLabelInlineContainer(container);
|
|
5622
5686
|
}
|
|
5623
5687
|
/**
|
|
5624
5688
|
* Determine field type from element
|
|
@@ -5642,26 +5706,15 @@ class FieldStatusManager {
|
|
|
5642
5706
|
* Determine placement strategy for field type
|
|
5643
5707
|
*/
|
|
5644
5708
|
getPlacementStrategy(fieldType) {
|
|
5645
|
-
|
|
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
|
-
}
|
|
5709
|
+
return "label-inline";
|
|
5657
5710
|
}
|
|
5658
5711
|
/**
|
|
5659
|
-
* Create inline label status container (for
|
|
5712
|
+
* Create inline label status container (for all input types)
|
|
5660
5713
|
*/
|
|
5661
5714
|
createLabelInlineContainer(container) {
|
|
5662
5715
|
container.className = "field-status-label-inline";
|
|
5663
5716
|
container.innerHTML = this.getStatusHTML();
|
|
5664
|
-
const label = this.
|
|
5717
|
+
const label = this.findFieldLabel();
|
|
5665
5718
|
if (label) {
|
|
5666
5719
|
label.appendChild(container);
|
|
5667
5720
|
} else {
|
|
@@ -5670,9 +5723,9 @@ class FieldStatusManager {
|
|
|
5670
5723
|
return container;
|
|
5671
5724
|
}
|
|
5672
5725
|
/**
|
|
5673
|
-
* Find the label associated with
|
|
5726
|
+
* Find the label associated with any field type
|
|
5674
5727
|
*/
|
|
5675
|
-
|
|
5728
|
+
findFieldLabel() {
|
|
5676
5729
|
if (this.fieldElement.id) {
|
|
5677
5730
|
const label2 = document.querySelector(`label[for="${this.fieldElement.id}"]`);
|
|
5678
5731
|
if (label2) return label2;
|
|
@@ -5743,11 +5796,7 @@ class FieldStatusManager {
|
|
|
5743
5796
|
*/
|
|
5744
5797
|
showStatus(type, options = {}) {
|
|
5745
5798
|
this.clearTimeout(type);
|
|
5746
|
-
|
|
5747
|
-
this.showFullOverlayStatus(type, options);
|
|
5748
|
-
} else {
|
|
5749
|
-
this.showStandardStatus(type, options);
|
|
5750
|
-
}
|
|
5799
|
+
this.showStandardStatus(type, options);
|
|
5751
5800
|
}
|
|
5752
5801
|
/**
|
|
5753
5802
|
* Show status for standard containers (right-side, input-overlay)
|
|
@@ -5865,4 +5914,4 @@ export {
|
|
|
5865
5914
|
applyFileDropMixin as a,
|
|
5866
5915
|
FormView$1 as b
|
|
5867
5916
|
};
|
|
5868
|
-
//# sourceMappingURL=FormView-
|
|
5917
|
+
//# sourceMappingURL=FormView-DGibmo-j.js.map
|