@nickaux/form-configurator 1.1.243 → 1.1.244

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.
@@ -6260,20 +6260,20 @@ function v4(u, c, d) {
6260
6260
  }
6261
6261
  return stringify$1(h);
6262
6262
  }
6263
- var __defProp$h = Object.defineProperty, __defProps$c = Object.defineProperties, __getOwnPropDescs$c = Object.getOwnPropertyDescriptors, __getOwnPropSymbols$r = Object.getOwnPropertySymbols, __hasOwnProp$s = Object.prototype.hasOwnProperty, __propIsEnum$r = 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) => {
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$s.call(c, d) && __defNormalProp$g(u, d, c[d]);
6266
- if (__getOwnPropSymbols$r)
6267
- for (var d of __getOwnPropSymbols$r(c))
6268
- __propIsEnum$r.call(c, d) && __defNormalProp$g(u, d, c[d]);
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$s.call(u, h) && c.indexOf(h) < 0 && (d[h] = u[h]);
6274
- if (u != null && __getOwnPropSymbols$r)
6275
- for (var h of __getOwnPropSymbols$r(u))
6276
- c.indexOf(h) < 0 && __propIsEnum$r.call(u, h) && (d[h] = u[h]);
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$g({
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$q = Object.getOwnPropertySymbols, __hasOwnProp$r = Object.prototype.hasOwnProperty, __propIsEnum$q = Object.prototype.propertyIsEnumerable, __objRest$g = (u, c) => {
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$r.call(u, h) && c.indexOf(h) < 0 && (d[h] = u[h]);
41867
- if (u != null && __getOwnPropSymbols$q)
41868
- for (var h of __getOwnPropSymbols$q(u))
41869
- c.indexOf(h) < 0 && __propIsEnum$q.call(u, h) && (d[h] = u[h]);
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$g = Object.defineProperty, __defProps$b = Object.defineProperties, __getOwnPropDescs$b = Object.getOwnPropertyDescriptors, __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) => {
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$q.call(c, d) && __defNormalProp$f(u, d, c[d]);
41944
- if (__getOwnPropSymbols$p)
41945
- for (var d of __getOwnPropSymbols$p(c))
41946
- __propIsEnum$p.call(c, d) && __defNormalProp$f(u, d, c[d]);
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$f(u, typeof c != "symbol" ? c + "" : c, d), d);
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$f({}, this.formManager.fieldsByPath[fn].getValue());
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$f({}, this)),
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$f({}, rn), { _uid: on._uid }) : rn;
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$f(__spreadValues$f({}, 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 "../":', {
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
- }), isHTMLString = (u) => u && typeof u == "string" && /<[^>]+>/g.test(u), resolveNavigationPath = (u, c, d) => {
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 ee = u, oe = Q;
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
- ee = u;
44079
- const re = $.split(".");
44080
- let ae = Q;
44081
- for (const Ue of re)
44082
- if (ae && typeof ae == "object")
44083
- ae = ae[Ue];
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
- ae = void 0;
44094
+ Ue = void 0;
44086
44095
  break;
44087
44096
  }
44088
- if (!ae || Object.keys(ae || {}).length === 0) {
44089
- const Ue = {};
44090
- c.children && Array.isArray(c.children) && c.children.forEach((nn) => {
44091
- if (nn && nn.param && nn.param.id)
44092
- try {
44093
- const ze = nn.getValue ? nn.getValue() : d.getFieldValueByPath(nn.id);
44094
- ze != null && (Ue[nn.param.id] = ze);
44095
- } catch (ze) {
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() !== "" ? ee = convertHandlebarsTemplate(
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
- ) : ee = u;
44107
- } catch (re) {
44108
- ee = u;
44112
+ ) : oe = u;
44113
+ } catch (ae) {
44114
+ oe = u;
44109
44115
  }
44110
- return { templateFormated: ee, contextData: oe };
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, Q = d.getJsonDataPath ? d.getJsonDataPath(te) : te;
44119
- return c.uniqueId && b !== null && (Q = String(b)), Q;
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
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nickaux/form-configurator",
3
- "version": "1.1.243",
3
+ "version": "1.1.244",
4
4
  "description": "A React form manager",
5
5
  "type": "module",
6
6
  "main": "dist/FormConfigurator.cjs.js",