web-mojo 2.1.1093 → 2.1.1095
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.cjs.js.map +1 -1
- package/dist/admin.es.js +10 -10
- package/dist/admin.es.js.map +1 -1
- package/dist/auth.cjs.js +1 -1
- package/dist/auth.es.js +1 -1
- package/dist/charts.cjs.js +1 -1
- package/dist/charts.es.js +3 -3
- package/dist/chunks/{ChatView-CrXEFQ__.js → ChatView-C38Wrw9h.js} +62 -14
- package/dist/chunks/ChatView-C38Wrw9h.js.map +1 -0
- package/dist/chunks/{ChatView-CLBeyN97.js → ChatView-D5-rDTq1.js} +2 -2
- package/dist/chunks/ChatView-D5-rDTq1.js.map +1 -0
- package/dist/chunks/{Collection-CsAk0UhA.js → Collection-DpdzB_n7.js} +2 -2
- package/dist/chunks/{Collection-CsAk0UhA.js.map → Collection-DpdzB_n7.js.map} +1 -1
- package/dist/chunks/{ContextMenu-Cvls3QC_.js → ContextMenu-CLRRrCUp.js} +34 -20
- package/dist/chunks/ContextMenu-CLRRrCUp.js.map +1 -0
- package/dist/chunks/ContextMenu-DWau8gXS.js +3 -0
- package/dist/chunks/ContextMenu-DWau8gXS.js.map +1 -0
- package/dist/chunks/{Dialog-C1y6Judh.js → Dialog-B7Sr0SnN.js} +3 -3
- package/dist/chunks/{Dialog-C1y6Judh.js.map → Dialog-B7Sr0SnN.js.map} +1 -1
- package/dist/chunks/{Dialog-Cf92bPOJ.js → Dialog-CTQabcag.js} +2 -2
- package/dist/chunks/{Dialog-Cf92bPOJ.js.map → Dialog-CTQabcag.js.map} +1 -1
- package/dist/chunks/{FormView-CpO15n9K.js → FormView-4TUGCb-w.js} +46 -22
- package/dist/chunks/{FormView-CpO15n9K.js.map → FormView-4TUGCb-w.js.map} +1 -1
- package/dist/chunks/{FormView-DEd56e3c.js → FormView-D7b279iQ.js} +3 -3
- package/dist/chunks/{FormView-DEd56e3c.js.map → FormView-D7b279iQ.js.map} +1 -1
- package/dist/chunks/{ListView-BGJG4GYH.js → ListView-B2gyVSMW.js} +2 -2
- package/dist/chunks/{ListView-BGJG4GYH.js.map → ListView-B2gyVSMW.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-BkPzKGdr.js → MetricsMiniChartWidget-DqqNihMU.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-BkPzKGdr.js.map → MetricsMiniChartWidget-DqqNihMU.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-BGwacIIm.js → MetricsMiniChartWidget-Dro33AOK.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-BGwacIIm.js.map → MetricsMiniChartWidget-Dro33AOK.js.map} +1 -1
- package/dist/chunks/{PDFViewer-SxvYCSe3.js → PDFViewer-CD2LK6vG.js} +2 -2
- package/dist/chunks/{PDFViewer-SxvYCSe3.js.map → PDFViewer-CD2LK6vG.js.map} +1 -1
- package/dist/chunks/{PDFViewer-BbCEgVAv.js → PDFViewer-Dijf-xZd.js} +2 -2
- package/dist/chunks/{PDFViewer-BbCEgVAv.js.map → PDFViewer-Dijf-xZd.js.map} +1 -1
- package/dist/chunks/{TokenManager-Cq8ZMY8x.js → TokenManager-OY8r8Z8L.js} +2 -2
- package/dist/chunks/{TokenManager-Cq8ZMY8x.js.map → TokenManager-OY8r8Z8L.js.map} +1 -1
- package/dist/chunks/{TokenManager-Di-gKFFY.js → TokenManager-Wocv3-Vf.js} +4 -4
- package/dist/chunks/{TokenManager-Di-gKFFY.js.map → TokenManager-Wocv3-Vf.js.map} +1 -1
- package/dist/chunks/{version-Xh8vXoia.js → version-5etTHU_a.js} +4 -4
- package/dist/chunks/{version-Xh8vXoia.js.map → version-5etTHU_a.js.map} +1 -1
- package/dist/chunks/{version-C4ykRlg_.js → version-Bk6cvxq4.js} +2 -2
- package/dist/chunks/{version-C4ykRlg_.js.map → version-Bk6cvxq4.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/dist/map.es.js +1 -1
- package/dist/timeline.es.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/ChatView-CLBeyN97.js.map +0 -1
- package/dist/chunks/ChatView-CrXEFQ__.js.map +0 -1
- package/dist/chunks/ContextMenu-CfMAB33c.js +0 -3
- package/dist/chunks/ContextMenu-CfMAB33c.js.map +0 -1
- package/dist/chunks/ContextMenu-Cvls3QC_.js.map +0 -1
|
@@ -5755,6 +5755,8 @@ class FormView extends View {
|
|
|
5755
5755
|
this.customComponents = /* @__PURE__ */ new Map();
|
|
5756
5756
|
this.fieldStatusManagers = /* @__PURE__ */ new Map();
|
|
5757
5757
|
this.saveTimeouts = /* @__PURE__ */ new Map();
|
|
5758
|
+
this.pendingSaveFields = /* @__PURE__ */ new Map();
|
|
5759
|
+
this.batchSaveTimeout = null;
|
|
5758
5760
|
this.isSaving = false;
|
|
5759
5761
|
this.data = this.prepareFormData();
|
|
5760
5762
|
this.formConfig = formConfig || { fields: fields || [] };
|
|
@@ -6172,35 +6174,57 @@ class FormView extends View {
|
|
|
6172
6174
|
FormPlugins.onFieldChange?.(this, fieldName, value);
|
|
6173
6175
|
}
|
|
6174
6176
|
/**
|
|
6175
|
-
* Handle saving
|
|
6177
|
+
* Handle saving field changes to the model with intelligent batching
|
|
6178
|
+
* When multiple fields change within a short time (e.g., autofill), they are batched together
|
|
6176
6179
|
* @param {string} fieldName - Name of the field being saved
|
|
6177
6180
|
* @param {*} value - New value to save
|
|
6178
6181
|
*/
|
|
6179
6182
|
async handleFieldSave(fieldName, value) {
|
|
6180
|
-
if (!this.model
|
|
6181
|
-
|
|
6182
|
-
clearTimeout(this.saveTimeouts.get(fieldName));
|
|
6183
|
-
}
|
|
6183
|
+
if (!this.model) return;
|
|
6184
|
+
this.pendingSaveFields.set(fieldName, value);
|
|
6184
6185
|
const statusManager = this.getFieldStatusManager(fieldName);
|
|
6185
6186
|
statusManager.showStatus("saving");
|
|
6186
|
-
|
|
6187
|
-
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6187
|
+
if (this.batchSaveTimeout) {
|
|
6188
|
+
clearTimeout(this.batchSaveTimeout);
|
|
6189
|
+
}
|
|
6190
|
+
this.batchSaveTimeout = setTimeout(async () => {
|
|
6191
|
+
await this.executeBatchSave();
|
|
6192
|
+
}, 300);
|
|
6193
|
+
}
|
|
6194
|
+
/**
|
|
6195
|
+
* Execute a batch save of all pending field changes
|
|
6196
|
+
* This sends all changed fields in a single request to avoid race conditions
|
|
6197
|
+
* @private
|
|
6198
|
+
*/
|
|
6199
|
+
async executeBatchSave() {
|
|
6200
|
+
if (this.isSaving || this.pendingSaveFields.size === 0) return;
|
|
6201
|
+
try {
|
|
6202
|
+
this.isSaving = true;
|
|
6203
|
+
const changes = Object.fromEntries(this.pendingSaveFields);
|
|
6204
|
+
const fieldNames = Array.from(this.pendingSaveFields.keys());
|
|
6205
|
+
this.pendingSaveFields.clear();
|
|
6206
|
+
this.batchSaveTimeout = null;
|
|
6207
|
+
this._isFormDrivenChange = true;
|
|
6208
|
+
if (typeof this.model.save === "function") {
|
|
6209
|
+
await this.model.save(changes);
|
|
6210
|
+
} else {
|
|
6211
|
+
Object.entries(changes).forEach(([key, val]) => {
|
|
6212
|
+
this.model.set(key, val);
|
|
6213
|
+
});
|
|
6214
|
+
}
|
|
6215
|
+
fieldNames.forEach((fieldName) => {
|
|
6216
|
+
const statusManager = this.getFieldStatusManager(fieldName);
|
|
6196
6217
|
statusManager.showStatus("saved");
|
|
6197
|
-
}
|
|
6218
|
+
});
|
|
6219
|
+
} catch (error) {
|
|
6220
|
+
console.error("Batch save error:", error);
|
|
6221
|
+
Array.from(this.pendingSaveFields.keys()).forEach((fieldName) => {
|
|
6222
|
+
const statusManager = this.getFieldStatusManager(fieldName);
|
|
6198
6223
|
statusManager.showStatus("error", { message: error.message });
|
|
6199
|
-
}
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
}
|
|
6203
|
-
this.saveTimeouts.set(fieldName, timeoutId);
|
|
6224
|
+
});
|
|
6225
|
+
} finally {
|
|
6226
|
+
this.isSaving = false;
|
|
6227
|
+
}
|
|
6204
6228
|
}
|
|
6205
6229
|
/**
|
|
6206
6230
|
* Get or create a field status manager for a specific field
|
|
@@ -7752,4 +7776,4 @@ export {
|
|
|
7752
7776
|
applyFileDropMixin as a,
|
|
7753
7777
|
FormView$1 as b
|
|
7754
7778
|
};
|
|
7755
|
-
//# sourceMappingURL=FormView-
|
|
7779
|
+
//# sourceMappingURL=FormView-4TUGCb-w.js.map
|