web-mojo 2.1.372 → 2.1.377
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-D-w2BOgg.js → ContextMenu-BWnqzYVd.js} +2 -2
- package/dist/chunks/{ContextMenu-D-w2BOgg.js.map → ContextMenu-BWnqzYVd.js.map} +1 -1
- package/dist/chunks/{ContextMenu-BFXKKmA9.js → ContextMenu-D2tBgZ0e.js} +2 -2
- package/dist/chunks/{ContextMenu-BFXKKmA9.js.map → ContextMenu-D2tBgZ0e.js.map} +1 -1
- package/dist/chunks/{DataView-DyVN7Dgw.js → DataView-CW3BsyCC.js} +2 -2
- package/dist/chunks/{DataView-DyVN7Dgw.js.map → DataView-CW3BsyCC.js.map} +1 -1
- package/dist/chunks/{DataView-DMNTQ844.js → DataView-CzkzVfVN.js} +2 -2
- package/dist/chunks/{DataView-DMNTQ844.js.map → DataView-CzkzVfVN.js.map} +1 -1
- package/dist/chunks/{Dialog-BQkDAgaw.js → Dialog-CJnRsIRI.js} +2 -2
- package/dist/chunks/{Dialog-BQkDAgaw.js.map → Dialog-CJnRsIRI.js.map} +1 -1
- package/dist/chunks/{Dialog-DJd5Dc9M.js → Dialog-LGRqcq9L.js} +5 -5
- package/dist/chunks/{Dialog-DJd5Dc9M.js.map → Dialog-LGRqcq9L.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-QaWuYNyQ.js → FilePreviewView-D566wPDs.js} +2 -2
- package/dist/chunks/{FilePreviewView-QaWuYNyQ.js.map → FilePreviewView-D566wPDs.js.map} +1 -1
- package/dist/chunks/{FilePreviewView-DCxHAjbW.js → FilePreviewView-D_Vxhbgh.js} +6 -6
- package/dist/chunks/{FilePreviewView-DCxHAjbW.js.map → FilePreviewView-D_Vxhbgh.js.map} +1 -1
- package/dist/chunks/FormView-DJqs63UC.js +2 -0
- package/dist/chunks/FormView-DJqs63UC.js.map +1 -0
- package/dist/chunks/{FormView-ztYkGiQH.js → FormView-m5tw5nNB.js} +35 -17
- package/dist/chunks/FormView-m5tw5nNB.js.map +1 -0
- package/dist/chunks/{MetricsChart-6XZQB-72.js → MetricsChart-DAsnnfJU.js} +3 -3
- package/dist/chunks/{MetricsChart-6XZQB-72.js.map → MetricsChart-DAsnnfJU.js.map} +1 -1
- package/dist/chunks/{MetricsChart-BL0Pv-jr.js → MetricsChart-Dv1FjVHY.js} +2 -2
- package/dist/chunks/{MetricsChart-BL0Pv-jr.js.map → MetricsChart-Dv1FjVHY.js.map} +1 -1
- package/dist/chunks/{PDFViewer-C5d3FQTe.js → PDFViewer-mJGc4Jhu.js} +3 -3
- package/dist/chunks/{PDFViewer-C5d3FQTe.js.map → PDFViewer-mJGc4Jhu.js.map} +1 -1
- package/dist/chunks/{PDFViewer-ClLGECuY.js → PDFViewer-t0RM_1eX.js} +2 -2
- package/dist/chunks/{PDFViewer-ClLGECuY.js.map → PDFViewer-t0RM_1eX.js.map} +1 -1
- package/dist/chunks/{Page-Bpv-mpMU.js → Page-Bs2o-GSU.js} +2 -2
- package/dist/chunks/{Page-Bpv-mpMU.js.map → Page-Bs2o-GSU.js.map} +1 -1
- package/dist/chunks/{Page-BRjl-24B.js → Page-Ds6akb5s.js} +2 -2
- package/dist/chunks/{Page-BRjl-24B.js.map → Page-Ds6akb5s.js.map} +1 -1
- package/dist/chunks/{TopNav-CpTPzR0u.js → TopNav-COdpl44u.js} +2 -2
- package/dist/chunks/{TopNav-CpTPzR0u.js.map → TopNav-COdpl44u.js.map} +1 -1
- package/dist/chunks/{TopNav-QbLM7l64.js → TopNav-Ck5XOp7S.js} +2 -2
- package/dist/chunks/{TopNav-QbLM7l64.js.map → TopNav-Ck5XOp7S.js.map} +1 -1
- package/dist/chunks/{WebApp-BlQQJ2mI.js → WebApp-B3IFukwD.js} +2 -2
- package/dist/chunks/{WebApp-BlQQJ2mI.js.map → WebApp-B3IFukwD.js.map} +1 -1
- package/dist/chunks/{WebApp-Cd8arpc1.js → WebApp-BHqYQKaY.js} +12 -12
- package/dist/chunks/{WebApp-Cd8arpc1.js.map → WebApp-BHqYQKaY.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-CUjBGNVX.js +0 -2
- package/dist/chunks/FormView-CUjBGNVX.js.map +0 -1
- package/dist/chunks/FormView-ztYkGiQH.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-BHqYQKaY.js";
|
|
2
2
|
class FormBuilder {
|
|
3
3
|
constructor(config = {}) {
|
|
4
4
|
this.fields = config.fields || [];
|
|
@@ -286,8 +286,13 @@ class FormBuilder {
|
|
|
286
286
|
buttongroup: `
|
|
287
287
|
<div class="btn-group btn-group-{{size}}" role="group">
|
|
288
288
|
{{#options}}
|
|
289
|
-
<button type="button" class="{{buttonClass}} {{#active}}active{{/active}}
|
|
289
|
+
<button type="button" class="{{buttonClass}} {{#active}}active{{/active}}"
|
|
290
|
+
{{^action}}
|
|
290
291
|
data-action="select-button-option"
|
|
292
|
+
{{/action}}
|
|
293
|
+
{{#action}}
|
|
294
|
+
data-action='{{action}}'
|
|
295
|
+
{{/action}}
|
|
291
296
|
data-field="{{fieldName}}"
|
|
292
297
|
data-value="{{value}}">
|
|
293
298
|
{{#icon}}<i class="{{icon}} me-1"></i> {{/icon}} {{label}}
|
|
@@ -4189,6 +4194,8 @@ class FormView extends View {
|
|
|
4189
4194
|
this.autosaveModelField = autosaveModelField;
|
|
4190
4195
|
this.customComponents = /* @__PURE__ */ new Map();
|
|
4191
4196
|
this.fieldStatusManagers = /* @__PURE__ */ new Map();
|
|
4197
|
+
this.saveTimeouts = /* @__PURE__ */ new Map();
|
|
4198
|
+
this.isSaving = false;
|
|
4192
4199
|
this.data = this.prepareFormData();
|
|
4193
4200
|
this.formConfig = formConfig || { fields: fields || [] };
|
|
4194
4201
|
this.formBuilder = new FormBuilder({
|
|
@@ -4431,26 +4438,36 @@ class FormView extends View {
|
|
|
4431
4438
|
this.emit("field:change", { field: fieldName, value });
|
|
4432
4439
|
}
|
|
4433
4440
|
/**
|
|
4434
|
-
* Handle saving individual field changes to the model
|
|
4441
|
+
* Handle saving individual field changes to the model with debouncing
|
|
4435
4442
|
* @param {string} fieldName - Name of the field being saved
|
|
4436
4443
|
* @param {*} value - New value to save
|
|
4437
4444
|
*/
|
|
4438
4445
|
async handleFieldSave(fieldName, value) {
|
|
4439
|
-
if (!this.model) return;
|
|
4446
|
+
if (!this.model || this.isSaving) return;
|
|
4447
|
+
if (this.saveTimeouts.has(fieldName)) {
|
|
4448
|
+
clearTimeout(this.saveTimeouts.get(fieldName));
|
|
4449
|
+
}
|
|
4440
4450
|
const statusManager = this.getFieldStatusManager(fieldName);
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
this.model.
|
|
4451
|
+
statusManager.showStatus("saving");
|
|
4452
|
+
const timeoutId = setTimeout(async () => {
|
|
4453
|
+
try {
|
|
4454
|
+
this.isSaving = true;
|
|
4455
|
+
this.saveTimeouts.delete(fieldName);
|
|
4456
|
+
this._isFormDrivenChange = true;
|
|
4457
|
+
if (typeof this.model.save === "function") {
|
|
4458
|
+
await this.model.save({ [fieldName]: value });
|
|
4459
|
+
} else {
|
|
4460
|
+
this.model.set(fieldName, value);
|
|
4461
|
+
}
|
|
4462
|
+
statusManager.showStatus("saved");
|
|
4463
|
+
} catch (error) {
|
|
4464
|
+
console.error("Field save error:", error);
|
|
4465
|
+
statusManager.showStatus("error", { message: error.message });
|
|
4466
|
+
} finally {
|
|
4467
|
+
this.isSaving = false;
|
|
4448
4468
|
}
|
|
4449
|
-
|
|
4450
|
-
|
|
4451
|
-
console.error("Field save error:", error);
|
|
4452
|
-
statusManager.showStatus("error", { message: error.message });
|
|
4453
|
-
}
|
|
4469
|
+
}, 300);
|
|
4470
|
+
this.saveTimeouts.set(fieldName, timeoutId);
|
|
4454
4471
|
}
|
|
4455
4472
|
/**
|
|
4456
4473
|
* Get or create a field status manager for a specific field
|
|
@@ -4961,6 +4978,7 @@ class FormView extends View {
|
|
|
4961
4978
|
}
|
|
4962
4979
|
}
|
|
4963
4980
|
_onModelChange() {
|
|
4981
|
+
if (this.isSaving) return;
|
|
4964
4982
|
this.data = this.prepareFormData();
|
|
4965
4983
|
if (this.isMounted()) {
|
|
4966
4984
|
if (!this._isFormDrivenChange) {
|
|
@@ -5913,4 +5931,4 @@ export {
|
|
|
5913
5931
|
applyFileDropMixin as a,
|
|
5914
5932
|
FormView$1 as b
|
|
5915
5933
|
};
|
|
5916
|
-
//# sourceMappingURL=FormView-
|
|
5934
|
+
//# sourceMappingURL=FormView-m5tw5nNB.js.map
|