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