@nickaux/form-configurator 1.1.243 → 1.1.245
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/FormConfigurator.esm.js +82 -59
- package/package.json +1 -1
|
@@ -6260,20 +6260,20 @@ function v4(u, c, d) {
|
|
|
6260
6260
|
}
|
|
6261
6261
|
return stringify$1(h);
|
|
6262
6262
|
}
|
|
6263
|
-
var __defProp$
|
|
6263
|
+
var __defProp$i = Object.defineProperty, __defProps$c = Object.defineProperties, __getOwnPropDescs$c = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$s = Object.getOwnPropertySymbols, __hasOwnProp$t = Object.prototype.hasOwnProperty, __propIsEnum$s = Object.prototype.propertyIsEnumerable, __defNormalProp$h = (u, c, d) => c in u ? __defProp$i(u, c, { enumerable: !0, configurable: !0, writable: !0, value: d }) : u[c] = d, __spreadValues$h = (u, c) => {
|
|
6264
6264
|
for (var d in c || (c = {}))
|
|
6265
|
-
__hasOwnProp$
|
|
6266
|
-
if (__getOwnPropSymbols$
|
|
6267
|
-
for (var d of __getOwnPropSymbols$
|
|
6268
|
-
__propIsEnum$
|
|
6265
|
+
__hasOwnProp$t.call(c, d) && __defNormalProp$h(u, d, c[d]);
|
|
6266
|
+
if (__getOwnPropSymbols$s)
|
|
6267
|
+
for (var d of __getOwnPropSymbols$s(c))
|
|
6268
|
+
__propIsEnum$s.call(c, d) && __defNormalProp$h(u, d, c[d]);
|
|
6269
6269
|
return u;
|
|
6270
6270
|
}, __spreadProps$c = (u, c) => __defProps$c(u, __getOwnPropDescs$c(c)), __objRest$h = (u, c) => {
|
|
6271
6271
|
var d = {};
|
|
6272
6272
|
for (var h in u)
|
|
6273
|
-
__hasOwnProp$
|
|
6274
|
-
if (u != null && __getOwnPropSymbols$
|
|
6275
|
-
for (var h of __getOwnPropSymbols$
|
|
6276
|
-
c.indexOf(h) < 0 && __propIsEnum$
|
|
6273
|
+
__hasOwnProp$t.call(u, h) && c.indexOf(h) < 0 && (d[h] = u[h]);
|
|
6274
|
+
if (u != null && __getOwnPropSymbols$s)
|
|
6275
|
+
for (var h of __getOwnPropSymbols$s(u))
|
|
6276
|
+
c.indexOf(h) < 0 && __propIsEnum$s.call(u, h) && (d[h] = u[h]);
|
|
6277
6277
|
return d;
|
|
6278
6278
|
};
|
|
6279
6279
|
React__default.forwardRef(function(c, d) {
|
|
@@ -6307,7 +6307,7 @@ function DBoxConfirmation(u) {
|
|
|
6307
6307
|
return typeof h == "function" && (q = h()), /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
6308
6308
|
/* @__PURE__ */ jsx$2(
|
|
6309
6309
|
"button",
|
|
6310
|
-
__spreadProps$c(__spreadValues$
|
|
6310
|
+
__spreadProps$c(__spreadValues$h({
|
|
6311
6311
|
onClick: k,
|
|
6312
6312
|
className: "btn btn-type2 " + (y != null ? y : "")
|
|
6313
6313
|
}, I), {
|
|
@@ -41860,13 +41860,13 @@ const assignValueByPath = (u, c, d, h = "overwrite", p = "/") => {
|
|
|
41860
41860
|
setValueFromPath,
|
|
41861
41861
|
testValue
|
|
41862
41862
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
41863
|
-
var __getOwnPropSymbols$
|
|
41863
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols, __hasOwnProp$s = Object.prototype.hasOwnProperty, __propIsEnum$r = Object.prototype.propertyIsEnumerable, __objRest$g = (u, c) => {
|
|
41864
41864
|
var d = {};
|
|
41865
41865
|
for (var h in u)
|
|
41866
|
-
__hasOwnProp$
|
|
41867
|
-
if (u != null && __getOwnPropSymbols$
|
|
41868
|
-
for (var h of __getOwnPropSymbols$
|
|
41869
|
-
c.indexOf(h) < 0 && __propIsEnum$
|
|
41866
|
+
__hasOwnProp$s.call(u, h) && c.indexOf(h) < 0 && (d[h] = u[h]);
|
|
41867
|
+
if (u != null && __getOwnPropSymbols$r)
|
|
41868
|
+
for (var h of __getOwnPropSymbols$r(u))
|
|
41869
|
+
c.indexOf(h) < 0 && __propIsEnum$r.call(u, h) && (d[h] = u[h]);
|
|
41870
41870
|
return d;
|
|
41871
41871
|
};
|
|
41872
41872
|
const Field = React__default.memo(forwardRef((u, c) => {
|
|
@@ -41938,14 +41938,14 @@ const Field = React__default.memo(forwardRef((u, c) => {
|
|
|
41938
41938
|
} else
|
|
41939
41939
|
return /* @__PURE__ */ jsx$2("div", { style: { display: "none" } }, h.param.id);
|
|
41940
41940
|
}));
|
|
41941
|
-
var __defProp$
|
|
41941
|
+
var __defProp$h = Object.defineProperty, __defProps$b = Object.defineProperties, __getOwnPropDescs$b = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$q = Object.getOwnPropertySymbols, __hasOwnProp$r = Object.prototype.hasOwnProperty, __propIsEnum$q = Object.prototype.propertyIsEnumerable, __defNormalProp$g = (u, c, d) => c in u ? __defProp$h(u, c, { enumerable: !0, configurable: !0, writable: !0, value: d }) : u[c] = d, __spreadValues$g = (u, c) => {
|
|
41942
41942
|
for (var d in c || (c = {}))
|
|
41943
|
-
__hasOwnProp$
|
|
41944
|
-
if (__getOwnPropSymbols$
|
|
41945
|
-
for (var d of __getOwnPropSymbols$
|
|
41946
|
-
__propIsEnum$
|
|
41943
|
+
__hasOwnProp$r.call(c, d) && __defNormalProp$g(u, d, c[d]);
|
|
41944
|
+
if (__getOwnPropSymbols$q)
|
|
41945
|
+
for (var d of __getOwnPropSymbols$q(c))
|
|
41946
|
+
__propIsEnum$q.call(c, d) && __defNormalProp$g(u, d, c[d]);
|
|
41947
41947
|
return u;
|
|
41948
|
-
}, __spreadProps$b = (u, c) => __defProps$b(u, __getOwnPropDescs$b(c)), __publicField = (u, c, d) => (__defNormalProp$
|
|
41948
|
+
}, __spreadProps$b = (u, c) => __defProps$b(u, __getOwnPropDescs$b(c)), __publicField = (u, c, d) => (__defNormalProp$g(u, typeof c != "symbol" ? c + "" : c, d), d);
|
|
41949
41949
|
class TypeDefault {
|
|
41950
41950
|
constructor(c, d, h, p, g) {
|
|
41951
41951
|
__publicField(this, "getValue", () => {
|
|
@@ -42017,7 +42017,7 @@ class TypeDefault {
|
|
|
42017
42017
|
case "clear":
|
|
42018
42018
|
const un = getFormatedPath$1(this.id, rn.action_path), mn = un.replace("__.", ".").split("."), fn = mn.shift(), dn = mn.join("/");
|
|
42019
42019
|
if (un && ((an = (sn = this.formManager) == null ? void 0 : sn.fieldsByPath) != null && an[fn])) {
|
|
42020
|
-
const hn = __spreadValues$
|
|
42020
|
+
const hn = __spreadValues$g({}, this.formManager.fieldsByPath[fn].getValue());
|
|
42021
42021
|
if (hn) {
|
|
42022
42022
|
const ln = setValueFromPath(
|
|
42023
42023
|
hn,
|
|
@@ -42146,7 +42146,7 @@ class TypeDefault {
|
|
|
42146
42146
|
}, [pe]);
|
|
42147
42147
|
const an = getHandlebars();
|
|
42148
42148
|
return /* @__PURE__ */ jsxs(Field, { ref: tn, field: this, children: [
|
|
42149
|
-
/* @__PURE__ */ jsx$2(sn, __spreadValues$
|
|
42149
|
+
/* @__PURE__ */ jsx$2(sn, __spreadValues$g({}, this)),
|
|
42150
42150
|
this.param.info && /* @__PURE__ */ jsx$2("p", { className: "field-info", children: formatText(an.compile(this.param.info)()) })
|
|
42151
42151
|
] }, this.uniqueId);
|
|
42152
42152
|
});
|
|
@@ -42210,7 +42210,7 @@ class TypeDefault {
|
|
|
42210
42210
|
}
|
|
42211
42211
|
change(c) {
|
|
42212
42212
|
var d, h, p, g, y, b, S, I, $, O, k, F, N, q, Y, X, ne, se, te, Q, ee, oe, re, ae, Ue, nn, ze, ce, pe, en;
|
|
42213
|
-
const tn = (on, rn) => on && typeof on == "object" && !Array.isArray(on) && rn && typeof rn == "object" && !Array.isArray(rn) && on._uid && !rn._uid ? __spreadProps$b(__spreadValues$
|
|
42213
|
+
const tn = (on, rn) => on && typeof on == "object" && !Array.isArray(on) && rn && typeof rn == "object" && !Array.isArray(rn) && on._uid && !rn._uid ? __spreadProps$b(__spreadValues$g({}, rn), { _uid: on._uid }) : rn;
|
|
42214
42214
|
if (this.isSubItem && ((d = this.param) != null && d.valuePath) && (this.param.valuePath === "../" || this.param.valuePath.startsWith("../"))) {
|
|
42215
42215
|
const on = (h = this.formManager.dynamicPathPart) == null ? void 0 : h[this.uniqueId];
|
|
42216
42216
|
if ((g = (p = this.formManager).shouldDebugField) != null && g.call(p, this.id) && ((b = (y = this.formManager).logField) == null || b.call(y, this.id, '🟡 [change] valuePath "../" détecté:', {
|
|
@@ -42231,7 +42231,7 @@ class TypeDefault {
|
|
|
42231
42231
|
for (; an.length <= on; )
|
|
42232
42232
|
an.push({});
|
|
42233
42233
|
const un = an[on];
|
|
42234
|
-
typeof un == "object" && un !== null && !Array.isArray(un) ? (an[on] = __spreadValues$
|
|
42234
|
+
typeof un == "object" && un !== null && !Array.isArray(un) ? (an[on] = __spreadValues$g(__spreadValues$g({}, un), tn(un, c)), (F = (k = this.formManager).shouldDebugField) != null && F.call(k, this.id) && ((q = (N = this.formManager).logField) == null || q.call(N, this.id, '🟡 [change] Fusion valuePath "../":', {
|
|
42235
42235
|
existingItem: un,
|
|
42236
42236
|
value: c,
|
|
42237
42237
|
merged: an[on]
|
|
@@ -44007,7 +44007,16 @@ const Collapse$1 = Object.assign(Collapse, {
|
|
|
44007
44007
|
* @deprecated use `items` instead, will be removed in `v4.0.0`
|
|
44008
44008
|
*/
|
|
44009
44009
|
Panel: CollapsePanel
|
|
44010
|
-
})
|
|
44010
|
+
});
|
|
44011
|
+
var __defProp$g = Object.defineProperty, __getOwnPropSymbols$p = Object.getOwnPropertySymbols, __hasOwnProp$q = Object.prototype.hasOwnProperty, __propIsEnum$p = Object.prototype.propertyIsEnumerable, __defNormalProp$f = (u, c, d) => c in u ? __defProp$g(u, c, { enumerable: !0, configurable: !0, writable: !0, value: d }) : u[c] = d, __spreadValues$f = (u, c) => {
|
|
44012
|
+
for (var d in c || (c = {}))
|
|
44013
|
+
__hasOwnProp$q.call(c, d) && __defNormalProp$f(u, d, c[d]);
|
|
44014
|
+
if (__getOwnPropSymbols$p)
|
|
44015
|
+
for (var d of __getOwnPropSymbols$p(c))
|
|
44016
|
+
__propIsEnum$p.call(c, d) && __defNormalProp$f(u, d, c[d]);
|
|
44017
|
+
return u;
|
|
44018
|
+
};
|
|
44019
|
+
const isHTMLString = (u) => u && typeof u == "string" && /<[^>]+>/g.test(u), resolveNavigationPath = (u, c, d) => {
|
|
44011
44020
|
try {
|
|
44012
44021
|
let h = "";
|
|
44013
44022
|
switch (d) {
|
|
@@ -44071,43 +44080,40 @@ const Collapse$1 = Object.assign(Collapse, {
|
|
|
44071
44080
|
}
|
|
44072
44081
|
const { templateFormated: F, contextData: N } = useMemo$1(() => {
|
|
44073
44082
|
var te;
|
|
44074
|
-
const Q = ((te = d.formData) == null ? void 0 : te.data) || d.formData || {};
|
|
44075
|
-
let
|
|
44083
|
+
const Q = d.getData ? d.getData() : ((te = d.formData) == null ? void 0 : te.data) || d.formData || {}, ee = Q && typeof Q == "object" && !Array.isArray(Q) ? __spreadValues$f({}, Q) : Array.isArray(Q) ? [...Q] : Q;
|
|
44084
|
+
let oe = u, re = ee;
|
|
44076
44085
|
try {
|
|
44077
44086
|
if (k) {
|
|
44078
|
-
|
|
44079
|
-
const
|
|
44080
|
-
let
|
|
44081
|
-
for (const
|
|
44082
|
-
if (
|
|
44083
|
-
|
|
44087
|
+
oe = u;
|
|
44088
|
+
const ae = $.split(".");
|
|
44089
|
+
let Ue = ee;
|
|
44090
|
+
for (const ze of ae)
|
|
44091
|
+
if (Ue && typeof Ue == "object")
|
|
44092
|
+
Ue = Ue[ze];
|
|
44084
44093
|
else {
|
|
44085
|
-
|
|
44094
|
+
Ue = void 0;
|
|
44086
44095
|
break;
|
|
44087
44096
|
}
|
|
44088
|
-
|
|
44089
|
-
|
|
44090
|
-
|
|
44091
|
-
|
|
44092
|
-
|
|
44093
|
-
|
|
44094
|
-
|
|
44095
|
-
|
|
44096
|
-
|
|
44097
|
-
}), oe = Object.keys(Ue).length > 0 ? Ue : ae || {};
|
|
44098
|
-
} else
|
|
44099
|
-
oe = ae;
|
|
44097
|
+
const nn = {};
|
|
44098
|
+
c.children && Array.isArray(c.children) && c.children.forEach((ze) => {
|
|
44099
|
+
if (ze && ze.param && ze.param.id)
|
|
44100
|
+
try {
|
|
44101
|
+
const ce = ze.getValue ? ze.getValue() : d.getFieldValueByPath(ze.id);
|
|
44102
|
+
ce != null && (nn[ze.param.id] = ce);
|
|
44103
|
+
} catch (ce) {
|
|
44104
|
+
}
|
|
44105
|
+
}), Object.keys(nn).length > 0 ? re = __spreadValues$f({}, nn) : Ue ? typeof Ue == "object" && !Array.isArray(Ue) ? re = __spreadValues$f({}, Ue) : Array.isArray(Ue) ? re = [...Ue] : re = Ue : re = {};
|
|
44100
44106
|
} else
|
|
44101
|
-
O && O.trim() !== "" ?
|
|
44107
|
+
O && O.trim() !== "" ? oe = convertHandlebarsTemplate(
|
|
44102
44108
|
u,
|
|
44103
44109
|
$,
|
|
44104
44110
|
// Utiliser le chemin complet du champ, pas le parent
|
|
44105
44111
|
d.formData
|
|
44106
|
-
) :
|
|
44107
|
-
} catch (
|
|
44108
|
-
|
|
44112
|
+
) : oe = u;
|
|
44113
|
+
} catch (ae) {
|
|
44114
|
+
oe = u;
|
|
44109
44115
|
}
|
|
44110
|
-
return { templateFormated:
|
|
44116
|
+
return { templateFormated: oe, contextData: re };
|
|
44111
44117
|
}, [u, c.id, c.uniqueId, $, k, O, d, p, b]), q = useMemo$1(() => {
|
|
44112
44118
|
try {
|
|
44113
44119
|
return HandlebarsGetVarFromTemplate(u);
|
|
@@ -44115,8 +44121,8 @@ const Collapse$1 = Object.assign(Collapse, {
|
|
|
44115
44121
|
return {};
|
|
44116
44122
|
}
|
|
44117
44123
|
}, [u, d, c.id]), Y = useMemo$1(() => {
|
|
44118
|
-
let te = d.getNormalizedFieldPath ? d.getNormalizedFieldPath(c.id) : c.id
|
|
44119
|
-
return
|
|
44124
|
+
let te = d.getNormalizedFieldPath ? d.getNormalizedFieldPath(c.id) : c.id;
|
|
44125
|
+
return d.getJsonDataPath ? d.getJsonDataPath(te) : te;
|
|
44120
44126
|
}, [d, c.id, c.uniqueId, b]), X = useRef$1(() => {
|
|
44121
44127
|
y.current(Date.now());
|
|
44122
44128
|
});
|
|
@@ -119732,19 +119738,36 @@ class TypeJson extends TypeDefault {
|
|
|
119732
119738
|
"onChange",
|
|
119733
119739
|
"initComponent"
|
|
119734
119740
|
]);
|
|
119735
|
-
const [b, S] = useState(
|
|
119736
|
-
|
|
119737
|
-
|
|
119741
|
+
const [b, S] = useState(() => {
|
|
119742
|
+
const k = h();
|
|
119743
|
+
if (typeof k == "string") {
|
|
119744
|
+
const F = k.trim();
|
|
119745
|
+
if (F === "")
|
|
119746
|
+
return {};
|
|
119747
|
+
try {
|
|
119748
|
+
return JSON.parse(F);
|
|
119749
|
+
} catch (N) {
|
|
119750
|
+
return {};
|
|
119751
|
+
}
|
|
119752
|
+
}
|
|
119753
|
+
return ["object", "array"].includes(typeof k) ? k : {};
|
|
119754
|
+
});
|
|
119738
119755
|
useRef$1(!1);
|
|
119739
119756
|
const I = (k, F, { contentErrors: N, patchResult: q }) => {
|
|
119740
119757
|
try {
|
|
119741
119758
|
if (k.json)
|
|
119742
119759
|
g && g(k.json);
|
|
119743
119760
|
else if (k.text) {
|
|
119744
|
-
const Y =
|
|
119745
|
-
|
|
119761
|
+
const Y = k.text.trim();
|
|
119762
|
+
if (Y === "") {
|
|
119763
|
+
g && g({});
|
|
119764
|
+
return;
|
|
119765
|
+
}
|
|
119766
|
+
const X = JSON.parse(Y);
|
|
119767
|
+
g && g(X);
|
|
119746
119768
|
}
|
|
119747
119769
|
} catch (Y) {
|
|
119770
|
+
g && g({});
|
|
119748
119771
|
}
|
|
119749
119772
|
}, O = (!p.displayLabel || p.displayLabel !== "notDisplay") && p.label ? /* @__PURE__ */ jsx$2("label", { children: p.label }) : "";
|
|
119750
119773
|
return this.userAllow === "read-only" ? /* @__PURE__ */ jsx$2("p", { children: b }) : /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|