@ea-lab/reactive-json 1.0.1 → 1.1.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.
@@ -1,29 +1,30 @@
1
1
  import { jsx as v } from "react/jsx-runtime";
2
- import { J as g } from "../jsonpath-B9kE9k9e.js";
3
- import { l as O } from "../lodash-CYNxjS-I.js";
4
- import { useContext as C } from "react";
5
- import { GlobalDataContext as A } from "./GlobalDataContext.js";
2
+ import { J as A } from "../jsonpath-B9kE9k9e.js";
3
+ import { l as C } from "../lodash-CYNxjS-I.js";
4
+ import { useContext as O } from "react";
5
+ import { GlobalDataContext as g } from "./GlobalDataContext.js";
6
6
  import { TemplateContext as x } from "./TemplateContext.js";
7
- import { isTemplateValue as b, evaluateTemplateValue as D } from "./TemplateSystem.js";
8
- const P = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), m = (e, c, u) => {
7
+ import { isTemplateValue as E, evaluateTemplateValue as b } from "./TemplateSystem.js";
8
+ import { reactEventProps as D } from "./utility/reactEventProps.js";
9
+ const P = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), p = (e, c, s) => {
9
10
  const { globalDataContext: h, templateContext: l } = c;
10
11
  if (Array.isArray(e.andConditions))
11
- return e.andConditions.reduce((t, s) => t && m(s, c, u), !0);
12
+ return e.andConditions.reduce((t, o) => t && p(o, c, s), !0);
12
13
  if (Array.isArray(e.orConditions)) {
13
14
  const t = e.orConditions;
14
- for (const s of t)
15
- if (m(s, c, u))
15
+ for (const o of t)
16
+ if (p(o, c, s))
16
17
  return !0;
17
18
  return !1;
18
19
  }
19
- if (e.when !== void 0 && !b(e.when))
20
+ if (e.when !== void 0 && !E(e.when))
20
21
  return !1;
21
- const f = (t) => D({
22
+ const i = (t) => b({
22
23
  globalDataContext: h,
23
24
  templateContext: l,
24
25
  valueToEvaluate: t
25
26
  });
26
- let r;
27
+ let n;
27
28
  if (e.when === void 0 && e.hasOwnProperty("whenDataCountOf")) {
28
29
  let t;
29
30
  switch (e.inContext) {
@@ -37,127 +38,145 @@ const P = (e) => e && e.charAt(0).toUpperCase() + e.slice(1), m = (e, c, u) => {
37
38
  t = h.templateData;
38
39
  break;
39
40
  }
40
- r = g.query(t, e.whenDataCountOf).length;
41
+ n = A.query(t, e.whenDataCountOf).length;
41
42
  } else
42
- r = (() => {
43
- if (u) {
44
- for (const [t, s] of u)
43
+ n = (() => {
44
+ if (s) {
45
+ for (const [t, o] of s)
45
46
  if (e.hasOwnProperty(t))
46
- return s({
47
+ return o({
47
48
  condition: e,
48
49
  templateContexts: c,
49
- evaluateAgainstTemplates: (a) => f(a)
50
+ evaluateAgainstTemplates: (a) => i(a)
50
51
  });
51
52
  }
52
- return f(e.when);
53
+ return i(e.when);
53
54
  })();
54
55
  if (e.hasOwnProperty("isEmpty") || e.hasOwnProperty("isNotEmpty")) {
55
- const t = (s) => e.hasOwnProperty("isEmpty") ? e.isEmpty === "not" ? !s : s : !s;
56
- if (r === null)
56
+ const t = (o) => e.hasOwnProperty("isEmpty") ? e.isEmpty === "not" ? !o : o : !o;
57
+ if (n === null)
57
58
  return t(!0);
58
- switch (typeof r) {
59
+ switch (typeof n) {
59
60
  case "undefined":
60
61
  return t(!0);
61
62
  case "string":
62
- return t(r.length === 0);
63
+ return t(n.length === 0);
63
64
  case "object":
64
- return t(Object.keys(r).length === 0);
65
+ return t(Object.keys(n).length === 0);
65
66
  default:
66
- return t(!r);
67
+ return t(!n);
67
68
  }
68
69
  }
69
- const n = e.compareAsDates;
70
+ const r = e.compareAsDates;
70
71
  if (e.hasOwnProperty("isNot"))
71
- return o(n, r) !== o(n, f(e.isNot));
72
+ return u(r, n) !== u(r, i(e.isNot));
72
73
  if (e.hasOwnProperty("is"))
73
- return o(n, r) === o(n, f(e.is));
74
+ return u(r, n) === u(r, i(e.is));
74
75
  if (e.hasOwnProperty("containsNot") || e.hasOwnProperty("contains")) {
75
- const t = e.hasOwnProperty("containsNot"), s = t ? e.containsNot : e.contains, a = o(n, f(s));
76
- if (typeof r == "string") {
76
+ const t = e.hasOwnProperty("containsNot"), o = t ? e.containsNot : e.contains, a = u(r, i(o));
77
+ if (typeof n == "string") {
77
78
  if (typeof a != "string")
78
79
  return t;
79
- const i = r.toLowerCase().indexOf(a.toLowerCase()) !== -1;
80
- return t ? !i : i;
80
+ const f = n.toLowerCase().indexOf(a.toLowerCase()) !== -1;
81
+ return t ? !f : f;
81
82
  } else
82
- for (const i of Object.values(r))
83
- if (O.isEqual(o(n, i), a))
83
+ for (const f of Object.values(n))
84
+ if (C.isEqual(u(r, f), a))
84
85
  return !t;
85
86
  return t;
86
87
  }
87
88
  if (e.hasOwnProperty("containedByNot") || e.hasOwnProperty("containedBy")) {
88
- const t = e.hasOwnProperty("containedByNot"), s = t ? e.containedByNot : e.containedBy, a = o(n, f(s));
89
- if (typeof r == "string") {
89
+ const t = e.hasOwnProperty("containedByNot"), o = t ? e.containedByNot : e.containedBy, a = u(r, i(o));
90
+ if (typeof n == "string") {
90
91
  if (typeof a != "string")
91
92
  return t;
92
- const i = a.toLowerCase().indexOf(r.toLowerCase()) !== -1;
93
- return t ? !i : i;
93
+ const f = a.toLowerCase().indexOf(n.toLowerCase()) !== -1;
94
+ return t ? !f : f;
94
95
  } else
95
- for (const i of Object.values(a))
96
- if (O.isEqual(o(n, i), r))
96
+ for (const f of Object.values(a))
97
+ if (C.isEqual(u(r, f), n))
97
98
  return !t;
98
99
  return t;
99
100
  }
100
- return e.hasOwnProperty(">") ? o(n, r) > o(n, f(e[">"])) : e.hasOwnProperty(">=") ? o(n, r) >= o(n, f(e[">="])) : e.hasOwnProperty("<") ? o(n, r) < o(n, f(e["<"])) : e.hasOwnProperty("<=") ? o(n, r) <= o(n, f(e["<="])) : !0;
101
- }, E = (e, c) => {
102
- const u = [];
101
+ return e.hasOwnProperty(">") ? u(r, n) > u(r, i(e[">"])) : e.hasOwnProperty(">=") ? u(r, n) >= u(r, i(e[">="])) : e.hasOwnProperty("<") ? u(r, n) < u(r, i(e["<"])) : e.hasOwnProperty("<=") ? u(r, n) <= u(r, i(e["<="])) : !0;
102
+ }, L = (e, c) => {
103
+ const s = [];
103
104
  let h = !1;
104
105
  const l = {};
105
106
  if (!Array.isArray(e))
106
- return u;
107
- const { globalDataContext: f } = c, r = f.plugins ?? {}, n = (r == null ? void 0 : r.action) ?? {}, t = (r == null ? void 0 : r.reaction) ?? {};
108
- if (!n)
109
- return u;
110
- for (const [s, a] of e.entries()) {
111
- const i = (a == null ? void 0 : a.what) ?? void 0;
112
- if (!i)
107
+ return s;
108
+ const { globalDataContext: i } = c, n = i.plugins ?? {}, r = (n == null ? void 0 : n.action) ?? {}, t = (n == null ? void 0 : n.reaction) ?? {};
109
+ if (!r)
110
+ return s;
111
+ for (const [o, a] of e.entries()) {
112
+ const f = (a == null ? void 0 : a.what) ?? void 0;
113
+ if (!f)
113
114
  continue;
114
- let y = n[i] ?? void 0, w = t[i] ?? void 0;
115
- if (!y && !w && (y = n[P(i)]), !y) {
116
- if (!w || a.on === void 0 || !m(a, c))
115
+ let m = r[f] ?? void 0, w = t[f] ?? void 0;
116
+ if (!m && !w && (m = r[P(f)]), !m) {
117
+ if (!w || a.on === void 0 || !p(a, c))
117
118
  continue;
118
119
  if (a.on === "message") {
119
- if (!n.MessageListener)
120
+ if (!r.MessageListener)
120
121
  continue;
121
- u.push({ ActionComponent: n.MessageListener, actionProps: a, actionIndex: s });
122
+ s.push({
123
+ ActionComponent: r.MessageListener,
124
+ actionProps: a,
125
+ actionIndex: o
126
+ });
122
127
  continue;
123
128
  }
124
129
  if (a.on === "hashchange") {
125
- if (!n.HashChangeListener)
130
+ if (!r.HashChangeListener)
126
131
  continue;
127
- u.push({ ActionComponent: n.HashChangeListener, actionProps: a, actionIndex: s });
132
+ s.push({
133
+ ActionComponent: r.HashChangeListener,
134
+ actionProps: a,
135
+ actionIndex: o
136
+ });
128
137
  continue;
129
138
  }
130
- h = !0;
131
- const p = "on" + P(a.on);
132
- Array.isArray(l[p]) || (l[p] = []), l[p].push(a);
139
+ if (D.has(a.on)) {
140
+ h = !0;
141
+ const y = "on" + P(a.on);
142
+ Array.isArray(l[y]) || (l[y] = []), l[y].push(a);
143
+ continue;
144
+ }
145
+ if (!r.CustomEventListener)
146
+ continue;
147
+ s.push({
148
+ ActionComponent: r.CustomEventListener,
149
+ actionProps: a,
150
+ actionIndex: o
151
+ });
133
152
  continue;
134
153
  }
135
- m(a, c) && u.push({ ActionComponent: y, actionProps: a, actionIndex: s });
154
+ p(a, c) && s.push({ ActionComponent: m, actionProps: a, actionIndex: o });
136
155
  }
137
156
  if (h) {
138
- if (!n.ReactOnEvent)
139
- return u;
140
- u.push({
141
- ActionComponent: n.ReactOnEvent,
157
+ if (!r.ReactOnEvent)
158
+ return s;
159
+ s.push({
160
+ ActionComponent: r.ReactOnEvent,
142
161
  actionProps: l,
143
162
  actionIndex: "_reactOnEvent"
144
163
  });
145
164
  }
146
- return u;
147
- }, o = (e, c) => e ? new Date(c) : c, k = (e) => {
148
- const c = C(A), u = C(x);
149
- return e ? E((e == null ? void 0 : e.actions) ?? [], { globalDataContext: c, templateContext: u }).reverse().reduce((l, { ActionComponent: f, actionProps: r, actionIndex: n }) => /* @__PURE__ */ v(
150
- f,
165
+ return s;
166
+ }, u = (e, c) => e ? new Date(c) : c, F = (e) => {
167
+ const c = O(g), s = O(x);
168
+ return e ? L((e == null ? void 0 : e.actions) ?? [], { globalDataContext: c, templateContext: s }).reverse().reduce((l, { ActionComponent: i, actionProps: n, actionIndex: r }) => /* @__PURE__ */ v(
169
+ i,
151
170
  {
152
171
  componentProps: e,
153
- actionProps: r,
154
- actionIndex: n,
172
+ actionProps: n,
173
+ actionIndex: r,
155
174
  attributesHolderRef: e.attributesHolderRef,
156
175
  children: l
157
176
  }
158
177
  ), (e == null ? void 0 : e.children) ?? null) : null;
159
178
  };
160
179
  export {
161
- k as ActionDependant,
162
- m as isValid
180
+ F as ActionDependant,
181
+ p as isValid
163
182
  };
@@ -1,7 +1,7 @@
1
1
  import { jsx as C, jsxs as L, Fragment as pt } from "react/jsx-runtime";
2
- import { a as _ } from "../httpRequestCommon-DUo2Oxgl.js";
2
+ import { a as _ } from "../httpRequestCommon-vfSMynsl.js";
3
3
  import { l as ut } from "../lodash-CYNxjS-I.js";
4
- import { useReducer as dt, useState as v, useRef as ft, useEffect as q } from "react";
4
+ import { useReducer as dt, useState as w, useRef as ft, useEffect as q } from "react";
5
5
  import { r as mt } from "../dnd-kit-sortable-tree.esm-Cz1RJyIg.js";
6
6
  import { coreComponentsPlugin as tt } from "../coreComponentsPlugin.js";
7
7
  import { mergeComponentCollections as ht } from "./ComponentCollector.js";
@@ -16,7 +16,7 @@ import { parseRjBuild as vt } from "./utility/parseRjBuild.js";
16
16
  import { stringToBoolean as wt } from "./utility/stringToBoolean.js";
17
17
  import { View as St } from "./View.js";
18
18
  const xt = ({
19
- dataOverride: w,
19
+ dataOverride: S,
20
20
  dataFetchMethod: M,
21
21
  dataUrl: z,
22
22
  debugMode: et,
@@ -48,7 +48,7 @@ const xt = ({
48
48
  }), d = $), h.length > 0 && console.warn(
49
49
  "A ReactiveJsonRoot component got the following deprecated properties that must be replaced: " + h.map((t) => t.deprecatedProperty + " -> " + t.newProperty).join(", ")
50
50
  );
51
- const [S, g] = dt(
51
+ const [x, g] = dt(
52
52
  (t, a) => {
53
53
  switch (a.type) {
54
54
  case "setData":
@@ -60,14 +60,14 @@ const xt = ({
60
60
  }
61
61
  },
62
62
  { updateId: 0, realCurrentData: {} }
63
- ), [at, ot] = v({}), [nt, Q] = v({}), [st, Y] = v([]), [x, T] = v(() => {
63
+ ), [at, ot] = w({}), [nt, Q] = w({}), [st, Y] = w([]), [I, T] = w(() => {
64
64
  if (d)
65
65
  return typeof d == "string" ? d : JSON.stringify(d);
66
- }), [V, Z] = v(null), n = ft(null);
66
+ }), [V, Z] = w(null), n = ft(null);
67
67
  q(() => () => {
68
68
  typeof document < "u" && n.current && n.current.parentNode && (n.current.parentNode.removeChild(n.current), n.current = null);
69
69
  }, []);
70
- const I = H ? ht([tt, H]) : tt;
70
+ const E = H ? ht([tt, H]) : tt;
71
71
  q(() => {
72
72
  f && (typeof b == "string" && b.toLowerCase() === "post" ? _.post(f, {
73
73
  headers: c
@@ -79,9 +79,9 @@ const xt = ({
79
79
  T(t.data);
80
80
  }));
81
81
  }, [f, c]), q(() => {
82
- if (!x)
82
+ if (!I)
83
83
  return;
84
- const t = vt(x);
84
+ const t = vt(I);
85
85
  if (!t.success) {
86
86
  if (console.group(
87
87
  `Tried to load the app's RjBuild but the ${t.format} content could not be parsed.`
@@ -90,7 +90,7 @@ const xt = ({
90
90
  rjBuildFetchMethod: b,
91
91
  headersForRjBuild: c,
92
92
  maybeRawAppRjBuild: d,
93
- dataOverride: w
93
+ dataOverride: S
94
94
  }), console.debug("Error details:", t.error), console.groupEnd(), typeof document < "u") {
95
95
  let e = document.getElementById("rj-parsing-error-root");
96
96
  if (e || (e = document.createElement("div"), e.id = "rj-parsing-error-root", document.body.appendChild(e)), !n.current) {
@@ -125,7 +125,7 @@ const xt = ({
125
125
  ot(a.templates ?? a.listForms), !a.templates && a.listForms && console.log(
126
126
  "'listForms' needs to be renamed to 'templates'. The support for 'listForms' will be removed in the next releases of reactive-json."
127
127
  );
128
- let i = w === void 0 ? a.data : w;
128
+ let i = S === void 0 ? a.data : S;
129
129
  const s = a.additionalDataSource;
130
130
  if (!Array.isArray(s) || s.length === 0) {
131
131
  g({ type: "setData", data: i }), Q(a.renderView), Y(Object.keys(a.renderView));
@@ -133,6 +133,7 @@ const xt = ({
133
133
  }
134
134
  const m = {
135
135
  headersForRjBuild: c,
136
+ plugins: E,
136
137
  templateData: i,
137
138
  templatePath: "data",
138
139
  setData: R,
@@ -140,7 +141,7 @@ const xt = ({
140
141
  }, r = {
141
142
  templateData: i,
142
143
  templatePath: "data"
143
- }, l = s.filter((e) => e.blocking === !0), E = s.filter((e) => e.blocking !== !0), o = async (e, p) => {
144
+ }, l = s.filter((e) => e.blocking === !0), v = s.filter((e) => e.blocking !== !0), o = async (e, p) => {
144
145
  var y;
145
146
  try {
146
147
  if (!e.src) {
@@ -167,7 +168,7 @@ const xt = ({
167
168
  responseBody: k.data,
168
169
  // additionalDataSource always processes raw data, not RjBuild.
169
170
  isRjBuild: !1,
170
- dataProcessors: (I == null ? void 0 : I.dataProcessor) || {}
171
+ dataProcessors: (E == null ? void 0 : E.dataProcessor) || {}
171
172
  });
172
173
  if (e.dataMapping)
173
174
  try {
@@ -234,14 +235,14 @@ const xt = ({
234
235
  console.error("Error processing blocking additionalDataSource:", p);
235
236
  });
236
237
  }
237
- if (Q(a.renderView), Y(Object.keys(a.renderView)), E.length > 0) {
238
- const e = E.map(
238
+ if (Q(a.renderView), Y(Object.keys(a.renderView)), v.length > 0) {
239
+ const e = v.map(
239
240
  (p, y) => o(p, l.length + y)
240
241
  );
241
242
  Promise.allSettled(e);
242
243
  }
243
244
  })();
244
- }, [x, w, c]);
245
+ }, [I, S, c]);
245
246
  function j(t, a, i) {
246
247
  if (!N || N.size === 0)
247
248
  return !1;
@@ -276,9 +277,9 @@ const xt = ({
276
277
  const m = a.split(".");
277
278
  (typeof t.realCurrentData != "object" || t.realCurrentData === null || Array.isArray(t.realCurrentData)) && (t.realCurrentData = {});
278
279
  let r = t.realCurrentData;
279
- for (let l = 0, E = m.length; l < E; l++) {
280
+ for (let l = 0, v = m.length; l < v; l++) {
280
281
  const o = m[l];
281
- if (l === E - 1) {
282
+ if (l === v - 1) {
282
283
  if (s === "remove" && Array.isArray(r))
283
284
  r.splice(o, 1);
284
285
  else if (s === "move")
@@ -318,7 +319,7 @@ const xt = ({
318
319
  }
319
320
  throw new Error("Could not update data.");
320
321
  }
321
- if (!x)
322
+ if (!I)
322
323
  return null;
323
324
  const U = st.map((t) => {
324
325
  var a;
@@ -328,7 +329,7 @@ const xt = ({
328
329
  datafield: t,
329
330
  props: nt[t],
330
331
  path: "data." + t,
331
- currentData: (a = S.realCurrentData) == null ? void 0 : a[t]
332
+ currentData: (a = x.realCurrentData) == null ? void 0 : a[t]
332
333
  },
333
334
  t
334
335
  );
@@ -338,12 +339,12 @@ const xt = ({
338
339
  value: {
339
340
  element: at,
340
341
  headersForRjBuild: c,
341
- plugins: I,
342
+ plugins: E,
342
343
  // Expose the root component to avoid import cycles in core plugins.
343
344
  ReactiveJsonRoot: xt,
344
345
  setData: R,
345
346
  setRawAppRjBuild: T,
346
- templateData: S.realCurrentData,
347
+ templateData: x.realCurrentData,
347
348
  templatePath: "data",
348
349
  updateData: W
349
350
  },
@@ -352,13 +353,13 @@ const xt = ({
352
353
  Pt.Provider,
353
354
  {
354
355
  value: {
355
- templateData: S.realCurrentData,
356
+ templateData: x.realCurrentData,
356
357
  templatePath: "data"
357
358
  },
358
359
  children: O && A ? /* @__PURE__ */ C(A, { children: U }) : U
359
360
  }
360
361
  ),
361
- O ? K && /* @__PURE__ */ C(K, { children: JSON.stringify(S.realCurrentData, null, " ") }) : null
362
+ O ? K && /* @__PURE__ */ C(K, { children: JSON.stringify(x.realCurrentData, null, " ") }) : null
362
363
  ]
363
364
  }
364
365
  ) });
@@ -1,50 +1,52 @@
1
1
  import { ActionDependant as o, isValid as r } from "./Actions.js";
2
2
  import { mergeComponentCollections as p } from "./ComponentCollector.js";
3
3
  import { EventDispatcherContext as m } from "./EventDispatcherContext.js";
4
- import { EventDispatcherProvider as l, addEventListener as x, removeEventListener as f } from "./EventDispatcherProvider.js";
4
+ import { EventDispatcherProvider as i, addEventListener as x, removeEventListener as f } from "./EventDispatcherProvider.js";
5
5
  import { GlobalDataContext as u } from "./GlobalDataContext.js";
6
6
  import { GlobalDataContextProvider as c } from "./GlobalDataContextProvider.js";
7
7
  import { PaginationContext as D } from "./PaginationContext.js";
8
8
  import { ReactiveJsonRoot as b } from "./ReactiveJsonRoot.js";
9
9
  import { TemplateContext as g } from "./TemplateContext.js";
10
- import { dataLocationToPath as R, evaluateAttributes as V, evaluateTemplateValue as E, evaluateTemplateValueCollection as P, isTemplateValue as h, useEvaluatedAttributes as L } from "./TemplateSystem.js";
10
+ import { dataLocationToPath as E, evaluateAttributes as P, evaluateTemplateValue as R, evaluateTemplateValueCollection as V, isTemplateValue as h, useEvaluatedAttributes as L } from "./TemplateSystem.js";
11
11
  import { alterData as z } from "./utility/alterData.js";
12
12
  import { analyzeDataOverrideReferences as J } from "./utility/analyzeDataOverrideReferences.js";
13
13
  import { applyDataMapping as G } from "./utility/dataMappingSystem.js";
14
- import { formatString as j, maybeFormatString as w } from "./utility/formatString.js";
15
- import { propsDataLocationToPathAndValue as N } from "./utility/formElementsCommon.js";
16
- import { parseRjBuild as k } from "./utility/parseRjBuild.js";
17
- import { normalizeAttributeNameForReactJsx as H, normalizeAttributesForReactJsx as I } from "./utility/reactJsxHelpers.js";
18
- import { stringToBoolean as Q } from "./utility/stringToBoolean.js";
19
- import { View as W } from "./View.js";
14
+ import { replaceEventPlaceholders as j } from "./utility/eventPlaceholderSystem.js";
15
+ import { formatString as M, maybeFormatString as N } from "./utility/formatString.js";
16
+ import { propsDataLocationToPathAndValue as k } from "./utility/formElementsCommon.js";
17
+ import { parseRjBuild as H } from "./utility/parseRjBuild.js";
18
+ import { normalizeAttributeNameForReactJsx as K, normalizeAttributesForReactJsx as Q } from "./utility/reactJsxHelpers.js";
19
+ import { stringToBoolean as W } from "./utility/stringToBoolean.js";
20
+ import { View as Y } from "./View.js";
20
21
  export {
21
22
  o as ActionDependant,
22
23
  m as EventDispatcherContext,
23
- l as EventDispatcherProvider,
24
+ i as EventDispatcherProvider,
24
25
  u as GlobalDataContext,
25
26
  c as GlobalDataContextProvider,
26
27
  D as PaginationContext,
27
28
  b as ReactiveJsonRoot,
28
29
  g as TemplateContext,
29
- W as View,
30
+ Y as View,
30
31
  x as addEventListener,
31
32
  z as alterData,
32
33
  J as analyzeDataOverrideReferences,
33
34
  G as applyDataMapping,
34
- R as dataLocationToPath,
35
- V as evaluateAttributes,
36
- E as evaluateTemplateValue,
37
- P as evaluateTemplateValueCollection,
38
- j as formatString,
35
+ E as dataLocationToPath,
36
+ P as evaluateAttributes,
37
+ R as evaluateTemplateValue,
38
+ V as evaluateTemplateValueCollection,
39
+ M as formatString,
39
40
  h as isTemplateValue,
40
41
  r as isValid,
41
- w as maybeFormatString,
42
+ N as maybeFormatString,
42
43
  p as mergeComponentCollections,
43
- H as normalizeAttributeNameForReactJsx,
44
- I as normalizeAttributesForReactJsx,
45
- k as parseRjBuild,
46
- N as propsDataLocationToPathAndValue,
44
+ K as normalizeAttributeNameForReactJsx,
45
+ Q as normalizeAttributesForReactJsx,
46
+ H as parseRjBuild,
47
+ k as propsDataLocationToPathAndValue,
47
48
  f as removeEventListener,
48
- Q as stringToBoolean,
49
+ j as replaceEventPlaceholders,
50
+ W as stringToBoolean,
49
51
  L as useEvaluatedAttributes
50
52
  };
@@ -0,0 +1,42 @@
1
+ const f = "<reactive-json:event>", d = "<reactive-json:event-new-value>", s = (e) => {
2
+ var n;
3
+ if (e) {
4
+ if (e instanceof CustomEvent)
5
+ return (n = e == null ? void 0 : e.detail) == null ? void 0 : n.value;
6
+ if (e.target) {
7
+ const t = e.target;
8
+ if (t.type === "checkbox")
9
+ return t.checked;
10
+ if (t.type === "radio")
11
+ return t.checked ? t.value : void 0;
12
+ if (typeof t.value < "u")
13
+ return t.value;
14
+ if (typeof t.checked < "u")
15
+ return t.checked;
16
+ }
17
+ }
18
+ }, o = (e, n) => {
19
+ if (typeof e != "string")
20
+ return e;
21
+ let t;
22
+ if (e.startsWith(d) && (t = d), e.startsWith(f) && (t = f), !t)
23
+ return e;
24
+ let i, r;
25
+ if (t === d && (i = s(n), r = e.slice(d.length)), t === f && (i = n, r = e.slice(f.length)), r.startsWith(".") && (r = r.slice(1)), !r)
26
+ return t === f ? void 0 : i;
27
+ if (!(typeof i != "object" || !i))
28
+ return r.split(".").reduce((c, a) => c ? c[a] : void 0, i);
29
+ }, u = (e, n) => {
30
+ if (Array.isArray(e))
31
+ return e.map((t) => u(t, n));
32
+ if (e && typeof e == "object") {
33
+ const t = {};
34
+ for (const [i, r] of Object.entries(e))
35
+ t[i] = u(r, n);
36
+ return t;
37
+ }
38
+ return o(e, n);
39
+ };
40
+ export {
41
+ u as replaceEventPlaceholders
42
+ };
@@ -1,20 +1,22 @@
1
- import { alterData as t } from "./alterData.js";
1
+ import { alterData as o } from "./alterData.js";
2
2
  import { analyzeDataOverrideReferences as a } from "./analyzeDataOverrideReferences.js";
3
3
  import { applyDataMapping as m } from "./dataMappingSystem.js";
4
- import { formatString as n, maybeFormatString as f } from "./formatString.js";
5
- import { propsDataLocationToPathAndValue as l } from "./formElementsCommon.js";
6
- import { parseRjBuild as c } from "./parseRjBuild.js";
7
- import { normalizeAttributeNameForReactJsx as u, normalizeAttributesForReactJsx as D } from "./reactJsxHelpers.js";
8
- import { stringToBoolean as b } from "./stringToBoolean.js";
4
+ import { replaceEventPlaceholders as f } from "./eventPlaceholderSystem.js";
5
+ import { formatString as l, maybeFormatString as x } from "./formatString.js";
6
+ import { propsDataLocationToPathAndValue as c } from "./formElementsCommon.js";
7
+ import { parseRjBuild as g } from "./parseRjBuild.js";
8
+ import { normalizeAttributeNameForReactJsx as D, normalizeAttributesForReactJsx as R } from "./reactJsxHelpers.js";
9
+ import { stringToBoolean as y } from "./stringToBoolean.js";
9
10
  export {
10
- t as alterData,
11
+ o as alterData,
11
12
  a as analyzeDataOverrideReferences,
12
13
  m as applyDataMapping,
13
- n as formatString,
14
- f as maybeFormatString,
15
- u as normalizeAttributeNameForReactJsx,
16
- D as normalizeAttributesForReactJsx,
17
- c as parseRjBuild,
18
- l as propsDataLocationToPathAndValue,
19
- b as stringToBoolean
14
+ l as formatString,
15
+ x as maybeFormatString,
16
+ D as normalizeAttributeNameForReactJsx,
17
+ R as normalizeAttributesForReactJsx,
18
+ g as parseRjBuild,
19
+ c as propsDataLocationToPathAndValue,
20
+ f as replaceEventPlaceholders,
21
+ y as stringToBoolean
20
22
  };
@@ -0,0 +1,82 @@
1
+ const e = /* @__PURE__ */ new Set([
2
+ "abort",
3
+ "animationEnd",
4
+ "animationIteration",
5
+ "animationStart",
6
+ "blur",
7
+ "canPlay",
8
+ "canPlayThrough",
9
+ "change",
10
+ "click",
11
+ "contextMenu",
12
+ "copy",
13
+ "cut",
14
+ "doubleClick",
15
+ "drag",
16
+ "dragEnd",
17
+ "dragEnter",
18
+ "dragExit",
19
+ "dragLeave",
20
+ "dragOver",
21
+ "dragStart",
22
+ "drop",
23
+ "durationChange",
24
+ "emptied",
25
+ "encrypted",
26
+ "ended",
27
+ "error",
28
+ "focus",
29
+ "gotPointerCapture",
30
+ "input",
31
+ "invalid",
32
+ "keyDown",
33
+ "keyPress",
34
+ "keyUp",
35
+ "load",
36
+ "loadedData",
37
+ "loadedMetadata",
38
+ "loadStart",
39
+ "lostPointerCapture",
40
+ "mouseDown",
41
+ "mouseEnter",
42
+ "mouseLeave",
43
+ "mouseMove",
44
+ "mouseOut",
45
+ "mouseOver",
46
+ "mouseUp",
47
+ "paste",
48
+ "pause",
49
+ "play",
50
+ "playing",
51
+ "pointerCancel",
52
+ "pointerDown",
53
+ "pointerEnter",
54
+ "pointerLeave",
55
+ "pointerMove",
56
+ "pointerOut",
57
+ "pointerOver",
58
+ "pointerUp",
59
+ "progress",
60
+ "rateChange",
61
+ "reset",
62
+ "scroll",
63
+ "seeked",
64
+ "seeking",
65
+ "select",
66
+ "stalled",
67
+ "submit",
68
+ "suspend",
69
+ "timeUpdate",
70
+ "toggle",
71
+ "touchCancel",
72
+ "touchEnd",
73
+ "touchMove",
74
+ "touchStart",
75
+ "transitionEnd",
76
+ "volumeChange",
77
+ "waiting",
78
+ "wheel"
79
+ ]);
80
+ export {
81
+ e as reactEventProps
82
+ };