@declarion/react 0.241.0 → 0.245.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.
@@ -14,6 +14,10 @@ async function n(t, n = {}) {
14
14
  return (await e(`/api/params/${encodeURIComponent(t)}`, {}, n)).data;
15
15
  }
16
16
  async function r(t) {
17
- return (await e(`/api/params${t === "tenant" ? "?resolution=tenant" : ""}`)).data ?? [];
17
+ let n = await e(`/api/params${t === "tenant" ? "?resolution=tenant" : ""}`);
18
+ return {
19
+ params: n.data ?? [],
20
+ refs: n.$refs
21
+ };
18
22
  }
19
23
  export { r as fetchAllParams, n as fetchParam, t as fetchPublicParams };
@@ -33,13 +33,18 @@ function i({ header: i, children: a, scrollRef: o }) {
33
33
  paddingTop: 4,
34
34
  paddingBottom: "calc(24px + var(--safe-area-bottom))",
35
35
  ...c,
36
- display: "flex",
37
- flexDirection: "column",
38
- gap: 16,
39
36
  minWidth: 0,
40
37
  WebkitOverflowScrolling: "touch"
41
38
  },
42
- children: a
39
+ children: /* @__PURE__ */ n("div", {
40
+ style: {
41
+ display: "flex",
42
+ flexDirection: "column",
43
+ gap: 16,
44
+ minWidth: 0
45
+ },
46
+ children: a
47
+ })
43
48
  })]
44
49
  });
45
50
  }
@@ -396,7 +396,7 @@ function Z(e) {
396
396
  return e?.entities.profile?.params_scope ?? "profile";
397
397
  }
398
398
  function Q() {
399
- let e = I(), { data: t } = k(), n = F().data?.find((e) => e.code === R);
399
+ let e = I(), { data: t } = k(), n = F().data?.params.find((e) => e.code === R);
400
400
  if (n?.scopes?.includes(Z(t))) return null;
401
401
  let r = typeof n?.value == "string" ? n.value : e.language, i = t?.languages?.find((e) => e.code === r);
402
402
  return /* @__PURE__ */ G(p, {
@@ -4,105 +4,104 @@ import { Btn as n } from "../../primitives/Btn.js";
4
4
  import { Spinner as r } from "../../primitives/Spinner.js";
5
5
  import { Select as i, TextInput as a } from "../../primitives/Fields.js";
6
6
  import { BoolToggle as o } from "../../primitives/BoolToggle.js";
7
- import { useAllParams as s, useCarrierParamOverrides as c } from "../../../hooks/useParams.js";
8
- import { useAuthStore as l } from "../../../stores/auth.js";
9
- import { EditParamDialog as u, ErrorLine as d, ResetParamControl as f, ValuePreview as p, paramSourceName as m, paramTenantEditable as h, useParamRefLabels as g } from "../../params/param-editors.js";
10
- import { useResponsiveMode as _ } from "../../../hooks/useResponsiveMode.js";
11
- import { PageHeader as ee } from "../../chrome/PageHeader.js";
12
- import { PageShell as v } from "../../chrome/PageShell.js";
13
- import { dataTableCellStyle as y, dataTableHeadCellStyle as b, dataTableStyle as x } from "../../primitives/dataTableStyles.js";
14
- import { useText as S } from "../../../hooks/useText.js";
15
- import { useSchema as C } from "../../../hooks/useSchema.js";
16
- import { useMemo as w, useState as T } from "react";
17
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
7
+ import { useAllParams as s, useCarrierParamOverrides as ee } from "../../../hooks/useParams.js";
8
+ import { useAuthStore as te } from "../../../stores/auth.js";
9
+ import { EditParamDialog as c, ErrorLine as l, ResetParamControl as u, ValuePreview as ne, paramSourceName as d, paramTenantEditable as f, useParamRefLabels as p } from "../../params/param-editors.js";
10
+ import { useResponsiveMode as m } from "../../../hooks/useResponsiveMode.js";
11
+ import { PageHeader as h } from "../../chrome/PageHeader.js";
12
+ import { PageShell as g } from "../../chrome/PageShell.js";
13
+ import { dataTableCellStyle as _, dataTableHeadCellStyle as v, dataTableStyle as y } from "../../primitives/dataTableStyles.js";
14
+ import { useText as b } from "../../../hooks/useText.js";
15
+ import { useSchema as x } from "../../../hooks/useSchema.js";
16
+ import { useMemo as S, useState as C } from "react";
17
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
18
18
  // src/components/pages/tenant-params/TenantParamsPage.impl.tsx
19
- var te = "my_tenant", ne = [
19
+ var E = "my_tenant", re = [
20
20
  "yaml",
21
21
  "env",
22
22
  "tenant"
23
- ], re = [
23
+ ], D = [
24
+ "29%",
25
+ "12%",
26
+ "11%",
24
27
  "21%",
25
- "17%",
26
28
  "9%",
27
- "7%",
28
- "15%",
29
- "11%",
30
- "20%"
29
+ "18%"
31
30
  ], O = {
32
- ...y,
31
+ ..._,
33
32
  overflow: "hidden",
34
33
  textOverflow: "ellipsis",
35
34
  whiteSpace: "nowrap"
36
- }, ie = {
37
- ...y,
35
+ }, k = {
36
+ ..._,
38
37
  whiteSpace: "nowrap",
39
38
  textAlign: "right"
40
39
  };
41
- function k(e) {
40
+ function A(e) {
42
41
  return e === "tenant" ? "violet" : e === "env" ? "amber" : "slate";
43
42
  }
44
- function A(e) {
45
- let t = S(), n = S("errors"), f = l((e) => e.activeTenant?.id) ?? "", { isPhone: h } = _(), y = s("tenant"), [k, A] = T(""), [N, P] = T(""), [F, I] = T(""), [L, R] = T(!1), [z, B] = T(null), { overrideByCode: V, missingParams: H, isLoading: U, retry: W, error: G, clearError: K, save: q, reset: J } = c({
46
- carrierEntityCode: te,
47
- rowId: f
48
- }), Y = async (e, t) => {
49
- await q(e, t) && B((t) => t === e ? null : t);
50
- }, X = w(() => y.data ?? [], [y.data]), { data: Z } = C(), Q = w(() => {
43
+ function j(e) {
44
+ let t = b(), n = b("errors"), u = te((e) => e.activeTenant?.id) ?? "", { isPhone: f } = m(), A = s("tenant"), [j, P] = C(""), [F, I] = C(""), [L, R] = C(""), [z, B] = C(!1), [V, H] = C(null), { overrideByCode: U, missingParams: W, isLoading: G, retry: K, error: q, clearError: J, save: Y, reset: ie } = ee({
45
+ carrierEntityCode: E,
46
+ rowId: u
47
+ }), ae = async (e, t) => {
48
+ await Y(e, t) && H((t) => t === e ? null : t);
49
+ }, X = S(() => A.data?.params ?? [], [A.data]), { data: Z } = x(), Q = S(() => {
51
50
  let e = new Map((Z?.enums?.parameter_category?.values ?? []).map((e) => [e.code, t(e.name) || e.code]));
52
51
  return (t) => t ? e.get(t) ?? t : "";
53
- }, [Z, t]), ae = w(() => Array.from(new Set(X.map((e) => e.category).filter(Boolean))).map((e) => ({
52
+ }, [Z, t]), oe = S(() => Array.from(new Set(X.map((e) => e.category).filter(Boolean))).map((e) => ({
54
53
  value: e,
55
54
  label: Q(e)
56
55
  })).sort((e, n) => e.label.localeCompare(n.label, t.language)), [
57
56
  X,
58
57
  Q,
59
58
  t.language
60
- ]), oe = w(() => {
61
- let e = k.trim().toLowerCase();
62
- return X.filter((n) => !(N && n.category !== N || F && n.source !== F || L && !V.has(n.code) || e && !`${n.code} ${t(n.name)}`.toLowerCase().includes(e))).sort((e, n) => (t(e.name) || e.code).localeCompare(t(n.name) || n.code, t.language) || e.code.localeCompare(n.code));
59
+ ]), se = S(() => {
60
+ let e = j.trim().toLowerCase();
61
+ return X.filter((n) => !(F && n.category !== F || L && n.source !== L || z && !U.has(n.code) || e && !`${n.code} ${t(n.name)}`.toLowerCase().includes(e))).sort((e, n) => (t(e.name) || e.code).localeCompare(t(n.name) || n.code, t.language) || e.code.localeCompare(n.code));
63
62
  }, [
64
63
  t,
65
64
  X,
66
- k,
67
- N,
65
+ j,
68
66
  F,
69
67
  L,
70
- V
71
- ]), se = y.isLoading || U, ce = g(X), $ = oe.map((e) => {
72
- let t = V.get(e.code);
68
+ z,
69
+ U
70
+ ]), ce = A.isLoading || G, le = p(X, A.data?.refs), $ = se.map((e) => {
71
+ let t = U.get(e.code);
73
72
  return {
74
73
  param: e,
75
- state: /* @__PURE__ */ E(j, {
74
+ state: /* @__PURE__ */ w(M, {
76
75
  param: e,
77
76
  override: t
78
77
  }),
79
- value: /* @__PURE__ */ E(p, {
78
+ value: /* @__PURE__ */ w(ne, {
80
79
  type: e.type,
81
80
  value: e.value,
82
81
  values: e.values,
83
82
  structure: e.structure,
84
- label: ce(e),
83
+ label: le(e),
85
84
  maxWidth: "100%"
86
85
  }),
87
- actions: /* @__PURE__ */ E(M, {
86
+ actions: /* @__PURE__ */ w(N, {
88
87
  param: e,
89
88
  stored: t !== void 0,
90
89
  onEdit: () => {
91
- K(), B(e);
90
+ J(), H(e);
92
91
  },
93
- onReset: (e) => void J(e)
92
+ onReset: (e) => void ie(e)
94
93
  })
95
94
  };
96
95
  });
97
- return /* @__PURE__ */ D(v, {
98
- header: /* @__PURE__ */ E(ee, { description: t("params.tenant.subtitle", "Tenant configuration. Editing a value stores a tenant override; Reset restores the platform default.") }),
96
+ return /* @__PURE__ */ T(g, {
97
+ header: /* @__PURE__ */ w(h, { description: t("params.tenant.subtitle", "Tenant configuration. Editing a value stores a tenant override; Reset restores the platform default.") }),
99
98
  children: [
100
- G && /* @__PURE__ */ E(d, { text: G }),
101
- H && /* @__PURE__ */ E(d, {
99
+ q && /* @__PURE__ */ w(l, { text: q }),
100
+ W && /* @__PURE__ */ w(l, {
102
101
  text: n("param.overrides_unreadable", "The current parameter overrides could not be read."),
103
- onRetry: W
102
+ onRetry: K
104
103
  }),
105
- /* @__PURE__ */ D("div", {
104
+ /* @__PURE__ */ T("div", {
106
105
  "data-testid": "tenant-params-filters",
107
106
  style: {
108
107
  display: "flex",
@@ -111,63 +110,63 @@ function A(e) {
111
110
  alignItems: "center"
112
111
  },
113
112
  children: [
114
- /* @__PURE__ */ E("div", {
113
+ /* @__PURE__ */ w("div", {
115
114
  style: {
116
115
  minWidth: 200,
117
116
  flex: 1
118
117
  },
119
- children: /* @__PURE__ */ E(a, {
120
- value: k,
121
- onChange: A,
118
+ children: /* @__PURE__ */ w(a, {
119
+ value: j,
120
+ onChange: P,
122
121
  placeholder: t("params.search", "Search name or code…")
123
122
  })
124
123
  }),
125
- /* @__PURE__ */ E("div", {
124
+ /* @__PURE__ */ w("div", {
126
125
  style: { minWidth: 160 },
127
- children: /* @__PURE__ */ E(i, {
128
- value: N,
126
+ children: /* @__PURE__ */ w(i, {
127
+ value: F,
129
128
  options: [{
130
129
  value: "",
131
130
  label: t("params.filter.all_categories", "All categories")
132
- }, ...ae],
133
- onChange: P
131
+ }, ...oe],
132
+ onChange: I
134
133
  })
135
134
  }),
136
- /* @__PURE__ */ E("div", {
135
+ /* @__PURE__ */ w("div", {
137
136
  style: { minWidth: 140 },
138
- children: /* @__PURE__ */ E(i, {
139
- value: F,
137
+ children: /* @__PURE__ */ w(i, {
138
+ value: L,
140
139
  options: [{
141
140
  value: "",
142
141
  label: t("params.filter.all_sources", "All sources")
143
- }, ...ne.map((e) => ({
142
+ }, ...re.map((e) => ({
144
143
  value: e,
145
- label: m(t, e)
144
+ label: d(t, e)
146
145
  }))],
147
- onChange: I
146
+ onChange: R
148
147
  })
149
148
  }),
150
- /* @__PURE__ */ D("label", {
149
+ /* @__PURE__ */ T("label", {
151
150
  style: {
152
151
  display: "flex",
153
152
  alignItems: "center",
154
153
  gap: 6,
155
154
  fontSize: 12
156
155
  },
157
- children: [/* @__PURE__ */ E(o, {
158
- value: L,
159
- onChange: R
156
+ children: [/* @__PURE__ */ w(o, {
157
+ value: z,
158
+ onChange: B
160
159
  }), t("params.filter.overridden_only", "Overridden only")]
161
160
  })
162
161
  ]
163
162
  }),
164
- se ? /* @__PURE__ */ E("div", {
163
+ ce ? /* @__PURE__ */ w("div", {
165
164
  style: {
166
165
  padding: "24px 0",
167
166
  textAlign: "center"
168
167
  },
169
- children: /* @__PURE__ */ E(r, { size: 18 })
170
- }) : $.length === 0 ? /* @__PURE__ */ E("div", {
168
+ children: /* @__PURE__ */ w(r, { size: 18 })
169
+ }) : $.length === 0 ? /* @__PURE__ */ w("div", {
171
170
  style: {
172
171
  padding: 16,
173
172
  color: "var(--text-4)",
@@ -175,14 +174,14 @@ function A(e) {
175
174
  fontSize: 12.5
176
175
  },
177
176
  children: t("params.empty", "No parameters match.")
178
- }) : h ? /* @__PURE__ */ E("div", {
177
+ }) : f ? /* @__PURE__ */ w("div", {
179
178
  "data-testid": "tenant-params-cards",
180
179
  style: {
181
180
  display: "flex",
182
181
  flexDirection: "column",
183
182
  gap: 8
184
183
  },
185
- children: $.map(({ param: e, state: n, value: r, actions: i }) => /* @__PURE__ */ D("div", {
184
+ children: $.map(({ param: e, state: n, value: r, actions: i }) => /* @__PURE__ */ T("div", {
186
185
  "data-testid": `tenant-param-row-${e.code}`,
187
186
  style: {
188
187
  border: "1px solid var(--border)",
@@ -195,14 +194,14 @@ function A(e) {
195
194
  minWidth: 0
196
195
  },
197
196
  children: [
198
- /* @__PURE__ */ D("div", {
197
+ /* @__PURE__ */ T("div", {
199
198
  style: {
200
199
  display: "flex",
201
200
  alignItems: "center",
202
201
  gap: 8,
203
202
  minWidth: 0
204
203
  },
205
- children: [/* @__PURE__ */ E("div", {
204
+ children: [/* @__PURE__ */ w("div", {
206
205
  style: {
207
206
  flex: 1,
208
207
  minWidth: 0,
@@ -214,7 +213,7 @@ function A(e) {
214
213
  children: t(e.name) || e.code
215
214
  }), n]
216
215
  }),
217
- /* @__PURE__ */ E("div", {
216
+ /* @__PURE__ */ w("div", {
218
217
  className: "mono",
219
218
  style: {
220
219
  fontSize: 11.5,
@@ -223,18 +222,18 @@ function A(e) {
223
222
  },
224
223
  children: e.code
225
224
  }),
226
- /* @__PURE__ */ E("div", {
225
+ /* @__PURE__ */ w("div", {
227
226
  style: { minWidth: 0 },
228
227
  children: r
229
228
  }),
230
- /* @__PURE__ */ D("div", {
229
+ /* @__PURE__ */ T("div", {
231
230
  style: {
232
231
  display: "flex",
233
232
  alignItems: "center",
234
233
  gap: 6,
235
234
  flexWrap: "wrap"
236
235
  },
237
- children: [/* @__PURE__ */ E("span", {
236
+ children: [/* @__PURE__ */ w("span", {
238
237
  style: {
239
238
  flex: 1,
240
239
  fontSize: 11.5,
@@ -245,7 +244,7 @@ function A(e) {
245
244
  })
246
245
  ]
247
246
  }, e.code))
248
- }) : /* @__PURE__ */ E("div", {
247
+ }) : /* @__PURE__ */ w("div", {
249
248
  "data-testid": "tenant-params-table",
250
249
  style: {
251
250
  border: "1px solid var(--border)",
@@ -253,77 +252,77 @@ function A(e) {
253
252
  background: "var(--surface)",
254
253
  overflow: "hidden"
255
254
  },
256
- children: /* @__PURE__ */ D("table", {
255
+ children: /* @__PURE__ */ T("table", {
257
256
  style: {
258
- ...x,
257
+ ...y,
259
258
  tableLayout: "fixed"
260
259
  },
261
260
  children: [
262
- /* @__PURE__ */ E("colgroup", { children: re.map((e, t) => /* @__PURE__ */ E("col", { style: { width: e } }, t)) }),
263
- /* @__PURE__ */ E("thead", { children: /* @__PURE__ */ D("tr", { children: [
264
- /* @__PURE__ */ E("th", {
265
- style: b,
261
+ /* @__PURE__ */ w("colgroup", { children: D.map((e, t) => /* @__PURE__ */ w("col", { style: { width: e } }, t)) }),
262
+ /* @__PURE__ */ w("thead", { children: /* @__PURE__ */ T("tr", { children: [
263
+ /* @__PURE__ */ w("th", {
264
+ style: v,
266
265
  children: t("params.column.name", "Name")
267
266
  }),
268
- /* @__PURE__ */ E("th", {
269
- style: b,
270
- children: t("params.column.code", "Code")
271
- }),
272
- /* @__PURE__ */ E("th", {
273
- style: b,
267
+ /* @__PURE__ */ w("th", {
268
+ style: v,
274
269
  children: t("params.column.category", "Category")
275
270
  }),
276
- /* @__PURE__ */ E("th", {
277
- style: b,
271
+ /* @__PURE__ */ w("th", {
272
+ style: v,
278
273
  children: t("params.column.type", "Type")
279
274
  }),
280
- /* @__PURE__ */ E("th", {
281
- style: b,
275
+ /* @__PURE__ */ w("th", {
276
+ style: v,
282
277
  children: t("params.value", "Value")
283
278
  }),
284
- /* @__PURE__ */ E("th", {
285
- style: b,
279
+ /* @__PURE__ */ w("th", {
280
+ style: v,
286
281
  children: t("params.column.source", "Source")
287
282
  }),
288
- /* @__PURE__ */ E("th", { style: b })
283
+ /* @__PURE__ */ w("th", { style: v })
289
284
  ] }) }),
290
- /* @__PURE__ */ E("tbody", { children: $.map(({ param: e, state: n, value: r, actions: i }) => /* @__PURE__ */ D("tr", {
285
+ /* @__PURE__ */ w("tbody", { children: $.map(({ param: e, state: n, value: r, actions: i }) => /* @__PURE__ */ T("tr", {
291
286
  "data-testid": `tenant-param-row-${e.code}`,
292
287
  children: [
293
- /* @__PURE__ */ E("td", {
294
- style: O,
295
- title: t(e.name) || e.code,
296
- children: t(e.name) || e.code
297
- }),
298
- /* @__PURE__ */ E("td", {
299
- style: O,
300
- title: e.code,
301
- children: /* @__PURE__ */ E("span", {
288
+ /* @__PURE__ */ T("td", {
289
+ style: {
290
+ ..._,
291
+ overflowWrap: "anywhere"
292
+ },
293
+ children: [/* @__PURE__ */ w("div", {
294
+ style: { color: "var(--text)" },
295
+ children: t(e.name) || e.code
296
+ }), t(e.name) && t(e.name) !== e.code && /* @__PURE__ */ w("div", {
297
+ "data-testid": "tenant-param-code",
302
298
  className: "mono",
303
- style: { color: "var(--text-3)" },
299
+ style: {
300
+ fontSize: 11.5,
301
+ color: "var(--text-3)"
302
+ },
304
303
  children: e.code
305
- })
304
+ })]
306
305
  }),
307
- /* @__PURE__ */ E("td", {
306
+ /* @__PURE__ */ w("td", {
308
307
  style: O,
309
- title: e.category,
308
+ title: Q(e.category) || void 0,
310
309
  children: Q(e.category) || "—"
311
310
  }),
312
- /* @__PURE__ */ E("td", {
311
+ /* @__PURE__ */ w("td", {
313
312
  style: O,
314
313
  title: e.type,
315
314
  children: e.type
316
315
  }),
317
- /* @__PURE__ */ E("td", {
316
+ /* @__PURE__ */ w("td", {
318
317
  style: O,
319
318
  children: r
320
319
  }),
321
- /* @__PURE__ */ E("td", {
320
+ /* @__PURE__ */ w("td", {
322
321
  style: O,
323
322
  children: n
324
323
  }),
325
- /* @__PURE__ */ E("td", {
326
- style: ie,
324
+ /* @__PURE__ */ w("td", {
325
+ style: k,
327
326
  children: i
328
327
  })
329
328
  ]
@@ -331,58 +330,58 @@ function A(e) {
331
330
  ]
332
331
  })
333
332
  }),
334
- z && /* @__PURE__ */ E(u, {
335
- param: z,
336
- current: V.get(z.code)?.value ?? z.value,
337
- error: G,
333
+ V && /* @__PURE__ */ w(c, {
334
+ param: V,
335
+ current: U.get(V.code)?.value ?? V.value,
336
+ error: q,
338
337
  onCancel: () => {
339
- B(null), K();
338
+ H(null), J();
340
339
  },
341
- onSave: (e) => Y(z, e)
340
+ onSave: (e) => ae(V, e)
342
341
  })
343
342
  ]
344
343
  });
345
344
  }
346
- function j({ param: e, override: n }) {
347
- let r = S();
348
- return n !== void 0 && e.source !== "tenant" ? /* @__PURE__ */ E("span", {
345
+ function M({ param: e, override: n }) {
346
+ let r = b();
347
+ return n !== void 0 && e.source !== "tenant" ? /* @__PURE__ */ w("span", {
349
348
  "data-testid": `tenant-param-not-applied-${e.code}`,
350
349
  title: r("params.tenant.not_applied_hint", "This tenant is set to {value}, and it no longer satisfies the parameter's declaration. Source of the value in effect: {source}. Reset to remove it, or edit it to a value the declaration accepts.", {
351
350
  value: JSON.stringify(n.value),
352
- source: m(r, e.source)
351
+ source: d(r, e.source)
353
352
  }),
354
- children: /* @__PURE__ */ E(t, {
353
+ children: /* @__PURE__ */ w(t, {
355
354
  tone: "amber",
356
355
  size: "xs",
357
356
  dot: !0,
358
357
  children: r("params.not_applied", "not applied")
359
358
  })
360
- }) : /* @__PURE__ */ E(t, {
361
- tone: k(e.source),
359
+ }) : /* @__PURE__ */ w(t, {
360
+ tone: A(e.source),
362
361
  size: "xs",
363
- children: m(r, e.source)
362
+ children: d(r, e.source)
364
363
  });
365
364
  }
366
- function M({ param: t, stored: r, onEdit: i, onReset: a }) {
367
- let o = S();
368
- return h(t) ? /* @__PURE__ */ D("span", {
365
+ function N({ param: t, stored: r, onEdit: i, onReset: a }) {
366
+ let o = b();
367
+ return f(t) ? /* @__PURE__ */ T("span", {
369
368
  style: {
370
369
  display: "inline-flex",
371
370
  flexWrap: "wrap",
372
371
  justifyContent: "flex-end",
373
372
  gap: 6
374
373
  },
375
- children: [/* @__PURE__ */ E(n, {
374
+ children: [/* @__PURE__ */ w(n, {
376
375
  size: "xs",
377
- icon: /* @__PURE__ */ E(e.edit, { size: 12 }),
376
+ icon: /* @__PURE__ */ w(e.edit, { size: 12 }),
378
377
  onClick: i,
379
378
  children: o("params.edit", "Edit")
380
- }), r && /* @__PURE__ */ E(f, {
379
+ }), r && /* @__PURE__ */ w(u, {
381
380
  param: t,
382
381
  description: o("params.reset_confirm.tenant_description", "The value this tenant set is removed, and the platform default applies again."),
383
382
  onReset: a
384
383
  })]
385
- }) : /* @__PURE__ */ D("span", {
384
+ }) : /* @__PURE__ */ T("span", {
386
385
  title: o("params.tenant.read_only_hint", "Not editable at tenant scope (its declared scopes do not admit tenant)."),
387
386
  style: {
388
387
  display: "inline-flex",
@@ -392,10 +391,10 @@ function M({ param: t, stored: r, onEdit: i, onReset: a }) {
392
391
  fontSize: 11
393
392
  },
394
393
  children: [
395
- /* @__PURE__ */ E(e.lock, { size: 12 }),
394
+ /* @__PURE__ */ w(e.lock, { size: 12 }),
396
395
  " ",
397
396
  o("params.read_only", "read-only")
398
397
  ]
399
398
  });
400
399
  }
401
- export { A as TenantParamsPage };
400
+ export { j as TenantParamsPage };
@@ -16,7 +16,7 @@ function y(e, t) {
16
16
  return e ? e.filter((e) => e.scopes?.includes(t)) : [];
17
17
  }
18
18
  function b({ carrierEntityCode: b, carrierScope: x, rowId: S, title: C, icon: w, writeOneByOne: T }) {
19
- let E = p(), D = p("errors"), O = a(), k = m(() => y(O.data, x), [O.data, x]), [A, j] = h(null), { overrideByCode: M, missingParams: N, isLoading: P, retry: F, error: I, clearError: L, save: R, reset: z } = o({
19
+ let E = p(), D = p("errors"), O = a(), k = m(() => y(O.data?.params, x), [O.data, x]), [A, j] = h(null), { overrideByCode: M, missingParams: N, isLoading: P, retry: F, error: I, clearError: L, save: R, reset: z } = o({
20
20
  carrierEntityCode: b,
21
21
  rowId: S,
22
22
  enabled: k.length > 0,
@@ -31,7 +31,7 @@ function b({ carrierEntityCode: b, carrierScope: x, rowId: S, title: C, icon: w,
31
31
  k,
32
32
  B,
33
33
  M
34
- ]), H = f(V), U = async (e, t) => {
34
+ ]), H = f(V, O.data?.refs), U = async (e, t) => {
35
35
  await R(e, t) && j((t) => t === e ? null : t);
36
36
  };
37
37
  return k.length === 0 ? null : /* @__PURE__ */ _(e, {
@@ -62,12 +62,12 @@ function x({ text: e, onRetry: n }) {
62
62
  ]
63
63
  });
64
64
  }
65
- function S(e) {
66
- let t = d(), { data: n } = c(), r = e.flatMap((e) => e.ref?.entity && e.value != null && e.value !== "" ? [{
65
+ function S(e, t) {
66
+ let n = d(), { data: r } = c(), i = e.flatMap((e) => e.ref?.entity && e.value != null && e.value !== "" ? [{
67
67
  ref: e.ref,
68
68
  value: e.value
69
- }] : []), { refs: i } = s(r, void 0, n?.entities);
70
- return (e) => e.ref?.entity ? o(t, i, e.ref, e.value, n?.entities) : void 0;
69
+ }] : []), { refs: a } = s(i, t, r?.entities);
70
+ return (e) => e.ref?.entity ? o(n, a, e.ref, e.value, r?.entities) : void 0;
71
71
  }
72
72
  function C({ type: e, value: t, values: n, structure: r, label: i, maxWidth: a = 180 }) {
73
73
  let o = d(), { data: s } = c(), l = (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@declarion/react",
3
- "version": "0.241.0",
3
+ "version": "0.245.0",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "React SDK for Declarion, the schema-driven business apps platform.",