web-mojo 2.1.698 → 2.1.699
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/{ChatView-DKHI5WSQ.js → ChatView-Bvm6s3lL.js} +2 -2
- package/dist/chunks/{ChatView-DKHI5WSQ.js.map → ChatView-Bvm6s3lL.js.map} +1 -1
- package/dist/chunks/{ChatView-Cl4A2GG_.js → ChatView-f83l3Xdw.js} +6 -6
- package/dist/chunks/{ChatView-Cl4A2GG_.js.map → ChatView-f83l3Xdw.js.map} +1 -1
- package/dist/chunks/{ContextMenu-C7VR2K56.js → ContextMenu-CaRTIPyI.js} +2 -2
- package/dist/chunks/{ContextMenu-C7VR2K56.js.map → ContextMenu-CaRTIPyI.js.map} +1 -1
- package/dist/chunks/{ContextMenu-ZMjPSCOL.js → ContextMenu-xR2hFn_G.js} +2 -2
- package/dist/chunks/{ContextMenu-ZMjPSCOL.js.map → ContextMenu-xR2hFn_G.js.map} +1 -1
- package/dist/chunks/{DataView-C2J-ES5x.js → DataView-BChtBLLm.js} +2 -2
- package/dist/chunks/{DataView-C2J-ES5x.js.map → DataView-BChtBLLm.js.map} +1 -1
- package/dist/chunks/{DataView-BdDvQgda.js → DataView-CdxyJy4U.js} +2 -2
- package/dist/chunks/{DataView-BdDvQgda.js.map → DataView-CdxyJy4U.js.map} +1 -1
- package/dist/chunks/{Dialog-7Q6jVzma.js → Dialog-C9WBKR7l.js} +5 -5
- package/dist/chunks/{Dialog-7Q6jVzma.js.map → Dialog-C9WBKR7l.js.map} +1 -1
- package/dist/chunks/{Dialog-DcEsiySb.js → Dialog-yZyU8QbA.js} +2 -2
- package/dist/chunks/{Dialog-DcEsiySb.js.map → Dialog-yZyU8QbA.js.map} +1 -1
- package/dist/chunks/{FormView-NYlkp_rL.js → FormView-DGeNywQz.js} +2 -2
- package/dist/chunks/FormView-DGeNywQz.js.map +1 -0
- package/dist/chunks/{FormView-D1GaAaSs.js → FormView-Dh8Yqk2d.js} +40 -17
- package/dist/chunks/FormView-Dh8Yqk2d.js.map +1 -0
- package/dist/chunks/{MetricsMiniChartWidget-Cgl3z0P7.js → MetricsMiniChartWidget-BDoykhIh.js} +3 -3
- package/dist/chunks/{MetricsMiniChartWidget-Cgl3z0P7.js.map → MetricsMiniChartWidget-BDoykhIh.js.map} +1 -1
- package/dist/chunks/{MetricsMiniChartWidget-DnvuJLYU.js → MetricsMiniChartWidget-CmH0UNxw.js} +2 -2
- package/dist/chunks/{MetricsMiniChartWidget-DnvuJLYU.js.map → MetricsMiniChartWidget-CmH0UNxw.js.map} +1 -1
- package/dist/chunks/{PDFViewer-Bm0_D3So.js → PDFViewer-Bqih2-YH.js} +3 -3
- package/dist/chunks/{PDFViewer-Bm0_D3So.js.map → PDFViewer-Bqih2-YH.js.map} +1 -1
- package/dist/chunks/{PDFViewer-0XGpnus3.js → PDFViewer-C8tWPu9l.js} +2 -2
- package/dist/chunks/{PDFViewer-0XGpnus3.js.map → PDFViewer-C8tWPu9l.js.map} +1 -1
- package/dist/chunks/{Page-dbGRgWFn.js → Page-ChnmGaXN.js} +2 -2
- package/dist/chunks/{Page-dbGRgWFn.js.map → Page-ChnmGaXN.js.map} +1 -1
- package/dist/chunks/{Page-CusMiM2I.js → Page-DecngD1D.js} +2 -2
- package/dist/chunks/{Page-CusMiM2I.js.map → Page-DecngD1D.js.map} +1 -1
- package/dist/chunks/{TopNav-CG0_zVCD.js → TopNav-C0GKPOSi.js} +5 -5
- package/dist/chunks/{TopNav-CG0_zVCD.js.map → TopNav-C0GKPOSi.js.map} +1 -1
- package/dist/chunks/{TopNav-BtI4SIXh.js → TopNav-DEf4Q_5K.js} +2 -2
- package/dist/chunks/{TopNav-BtI4SIXh.js.map → TopNav-DEf4Q_5K.js.map} +1 -1
- package/dist/chunks/{WebApp-BH3MsXRH.js → WebApp-CCK9ce5Y.js} +13 -13
- package/dist/chunks/{WebApp-BH3MsXRH.js.map → WebApp-CCK9ce5Y.js.map} +1 -1
- package/dist/chunks/{WebApp-B5MSTwfY.js → WebApp-zMt0FZbX.js} +2 -2
- package/dist/chunks/{WebApp-B5MSTwfY.js.map → WebApp-zMt0FZbX.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-D1GaAaSs.js.map +0 -1
- package/dist/chunks/FormView-NYlkp_rL.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-CCK9ce5Y.js";
|
|
2
2
|
class FormBuilder {
|
|
3
3
|
constructor(config = {}) {
|
|
4
4
|
this.fields = config.fields || [];
|
|
@@ -1629,6 +1629,7 @@ class FormBuilder {
|
|
|
1629
1629
|
maxItems = 10,
|
|
1630
1630
|
emptyFetch = false,
|
|
1631
1631
|
debounceMs = 300,
|
|
1632
|
+
requiresActiveGroup = false,
|
|
1632
1633
|
help = field.helpText || field.help || ""
|
|
1633
1634
|
} = field;
|
|
1634
1635
|
const fieldId = this.getFieldId(name);
|
|
@@ -1651,7 +1652,8 @@ class FormBuilder {
|
|
|
1651
1652
|
debounceMs,
|
|
1652
1653
|
disabled,
|
|
1653
1654
|
readonly,
|
|
1654
|
-
required
|
|
1655
|
+
required,
|
|
1656
|
+
requiresActiveGroup
|
|
1655
1657
|
})}'>
|
|
1656
1658
|
<input type="text"
|
|
1657
1659
|
id="${fieldId}"
|
|
@@ -2734,14 +2736,18 @@ class CollectionDropdownView extends View {
|
|
|
2734
2736
|
this.focusedIndex = options.focusedIndex || -1;
|
|
2735
2737
|
}
|
|
2736
2738
|
async getViewData() {
|
|
2737
|
-
const items = this.collection ? this.collection.toJSON().map((item, index) =>
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2739
|
+
const items = this.collection ? this.collection.toJSON().map((item, index) => {
|
|
2740
|
+
const labelValue = MOJOUtils.getNestedValue(item, this.labelField);
|
|
2741
|
+
const fieldValue = MOJOUtils.getNestedValue(item, this.valueField);
|
|
2742
|
+
return {
|
|
2743
|
+
...item,
|
|
2744
|
+
labelField: labelValue,
|
|
2745
|
+
valueField: fieldValue,
|
|
2746
|
+
isSelected: fieldValue == this.selectedValue,
|
|
2747
|
+
isFocused: index === this.focusedIndex,
|
|
2748
|
+
index
|
|
2749
|
+
};
|
|
2750
|
+
}) : [];
|
|
2745
2751
|
return {
|
|
2746
2752
|
loading: this.loading,
|
|
2747
2753
|
hasSearched: this.hasSearched,
|
|
@@ -2830,8 +2836,8 @@ class CollectionSelectView extends View {
|
|
|
2830
2836
|
this.hasError = false;
|
|
2831
2837
|
this.errorMessage = "";
|
|
2832
2838
|
if (this.selectedValue && typeof this.selectedValue === "object") {
|
|
2833
|
-
this.selectedLabel = this.selectedValue
|
|
2834
|
-
this.selectedValue = this.selectedValue
|
|
2839
|
+
this.selectedLabel = MOJOUtils.getNestedValue(this.selectedValue, this.labelField) || "";
|
|
2840
|
+
this.selectedValue = MOJOUtils.getNestedValue(this.selectedValue, this.valueField) || "0";
|
|
2835
2841
|
}
|
|
2836
2842
|
this.searchTimer = null;
|
|
2837
2843
|
this.dropdownView = null;
|
|
@@ -2889,13 +2895,13 @@ class CollectionSelectView extends View {
|
|
|
2889
2895
|
if (this.selectedLabel) return;
|
|
2890
2896
|
const selectedModel = this.collection?.get(this.selectedValue);
|
|
2891
2897
|
if (selectedModel) {
|
|
2892
|
-
this.selectedLabel =
|
|
2898
|
+
this.selectedLabel = this.getFieldValue(selectedModel, this.labelField);
|
|
2893
2899
|
this.render(false);
|
|
2894
2900
|
return;
|
|
2895
2901
|
}
|
|
2896
2902
|
let model = await this.collection.fetchOne(this.selectedValue);
|
|
2897
2903
|
if (model) {
|
|
2898
|
-
this.selectedLabel =
|
|
2904
|
+
this.selectedLabel = this.getFieldValue(model, this.labelField) || `${model.constructor.name} #${model.id}`;
|
|
2899
2905
|
this.render(false);
|
|
2900
2906
|
}
|
|
2901
2907
|
} catch (error) {
|
|
@@ -3167,8 +3173,8 @@ class CollectionSelectView extends View {
|
|
|
3167
3173
|
let newValue = value;
|
|
3168
3174
|
let newLabel = "";
|
|
3169
3175
|
if (newValue && typeof newValue === "object") {
|
|
3170
|
-
newLabel = newValue
|
|
3171
|
-
newValue = newValue
|
|
3176
|
+
newLabel = MOJOUtils.getNestedValue(newValue, this.labelField) || "";
|
|
3177
|
+
newValue = MOJOUtils.getNestedValue(newValue, this.valueField);
|
|
3172
3178
|
}
|
|
3173
3179
|
newValue = newValue || "0";
|
|
3174
3180
|
if (newValue == this.selectedValue) {
|
|
@@ -3189,6 +3195,23 @@ class CollectionSelectView extends View {
|
|
|
3189
3195
|
this.render();
|
|
3190
3196
|
}
|
|
3191
3197
|
}
|
|
3198
|
+
/**
|
|
3199
|
+
* Helper method to get field value from model or plain object with dot notation support
|
|
3200
|
+
* @param {Object|Model} item - The item to get value from
|
|
3201
|
+
* @param {string} fieldPath - The field path (supports dot notation)
|
|
3202
|
+
* @returns {*} The field value
|
|
3203
|
+
*/
|
|
3204
|
+
getFieldValue(item, fieldPath) {
|
|
3205
|
+
if (!item || !fieldPath) return void 0;
|
|
3206
|
+
if (typeof item.get === "function") {
|
|
3207
|
+
const value = item.get(fieldPath);
|
|
3208
|
+
if (value === void 0 && fieldPath.includes(".")) {
|
|
3209
|
+
return MOJOUtils.getNestedValue(item, fieldPath);
|
|
3210
|
+
}
|
|
3211
|
+
return value;
|
|
3212
|
+
}
|
|
3213
|
+
return MOJOUtils.getNestedValue(item, fieldPath);
|
|
3214
|
+
}
|
|
3192
3215
|
}
|
|
3193
3216
|
class DatePicker extends View {
|
|
3194
3217
|
constructor(options = {}) {
|
|
@@ -6196,4 +6219,4 @@ export {
|
|
|
6196
6219
|
applyFileDropMixin as a,
|
|
6197
6220
|
FormView$1 as b
|
|
6198
6221
|
};
|
|
6199
|
-
//# sourceMappingURL=FormView-
|
|
6222
|
+
//# sourceMappingURL=FormView-Dh8Yqk2d.js.map
|