@opencitylabs/formio-custom-components 0.7.10 → 0.8.0
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/index.iife.js +1 -1
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7956,13 +7956,30 @@ function fr(e) {
|
|
|
7956
7956
|
}
|
|
7957
7957
|
//#endregion
|
|
7958
7958
|
//#region src/customComponentFormio/Select/Select.js
|
|
7959
|
-
var pr = e.components.select, mr =
|
|
7959
|
+
var pr = e.components.select, mr = {
|
|
7960
|
+
type: "checkbox",
|
|
7961
|
+
input: !0,
|
|
7962
|
+
key: "cacheValues",
|
|
7963
|
+
label: "Cache Values",
|
|
7964
|
+
weight: 26,
|
|
7965
|
+
tooltip: "Cache the fetched values to avoid repeated API calls on every re-render.",
|
|
7966
|
+
defaultValue: !1,
|
|
7967
|
+
conditional: { json: { "===": [{ var: "data.dataSrc" }, "custom"] } }
|
|
7968
|
+
}, hr = class e extends fr(pr) {
|
|
7969
|
+
static _dataCache = /* @__PURE__ */ new Map();
|
|
7960
7970
|
static schema(...e) {
|
|
7961
7971
|
return fr(pr).schema(...e);
|
|
7962
7972
|
}
|
|
7963
7973
|
static editForm(...e) {
|
|
7964
7974
|
let t = pr.editForm(...e), n = (t.components?.find((e) => e.key === "tabs"))?.components?.find((e) => e.key === "data");
|
|
7965
|
-
return n?.components && n.components.push(dr), t;
|
|
7975
|
+
return n?.components && n.components.push(dr, mr), t;
|
|
7976
|
+
}
|
|
7977
|
+
getCustomItems() {
|
|
7978
|
+
if (!this.component.cacheValues) return super.getCustomItems();
|
|
7979
|
+
let t = this.i18next?.language || "default", n = `${this.component.data?.custom || ""}::${t}`;
|
|
7980
|
+
if (e._dataCache.has(n)) return this.asyncValues = !0, Promise.resolve(e._dataCache.get(n));
|
|
7981
|
+
let r = super.getCustomItems();
|
|
7982
|
+
return r instanceof Promise ? r.then((t) => (e._dataCache.set(n, t), t)) : (e._dataCache.set(n, r), r);
|
|
7966
7983
|
}
|
|
7967
7984
|
choicesOptions() {
|
|
7968
7985
|
let e = this.component.customOptions;
|
|
@@ -7992,7 +8009,7 @@ var pr = e.components.select, mr = class extends fr(pr) {
|
|
|
7992
8009
|
e?.parentNode && e.parentNode.removeChild(e);
|
|
7993
8010
|
}), t;
|
|
7994
8011
|
}
|
|
7995
|
-
},
|
|
8012
|
+
}, gr = {
|
|
7996
8013
|
pagebreak: _e,
|
|
7997
8014
|
dynamic_calendar: dt,
|
|
7998
8015
|
calendar: _t,
|
|
@@ -8000,15 +8017,15 @@ var pr = e.components.select, mr = class extends fr(pr) {
|
|
|
8000
8017
|
sdcfile: Yn,
|
|
8001
8018
|
address_map: ar,
|
|
8002
8019
|
"list-services": ur,
|
|
8003
|
-
select:
|
|
8020
|
+
select: hr
|
|
8004
8021
|
};
|
|
8005
|
-
function
|
|
8022
|
+
function _r(e) {
|
|
8006
8023
|
if (!e || typeof e.addComponent != "function") throw Error("registerFormioComponents requires Formio Components with addComponent(name, component)");
|
|
8007
|
-
return Object.entries(
|
|
8024
|
+
return Object.entries(gr).forEach(([t, n]) => {
|
|
8008
8025
|
e.addComponent(t, n);
|
|
8009
|
-
}),
|
|
8026
|
+
}), gr;
|
|
8010
8027
|
}
|
|
8011
8028
|
//#endregion
|
|
8012
|
-
export { _t as Calendar, Nt as CalendarAdvanced, ar as FormioAddressMap, dt as FormioDynamicCalendar, ur as FormioListServices, _e as FormioPageBreak, Yn as SdcFile,
|
|
8029
|
+
export { _t as Calendar, Nt as CalendarAdvanced, ar as FormioAddressMap, dt as FormioDynamicCalendar, ur as FormioListServices, _e as FormioPageBreak, Yn as SdcFile, hr as Select, gr as formioCustomComponents, _r as registerFormioComponents, dr as resetValueOnEditField, fr as withResetValueOn };
|
|
8013
8030
|
|
|
8014
8031
|
//# sourceMappingURL=index.js.map
|