@nivaro/react 0.3.49 → 0.3.50
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/components/InlineGridField.js +166 -105
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +25 -1
- package/dist/shared/components/ItemEditForm.js +4676 -4579
- package/dist/shared/components/QueryTable.js +461 -332
- package/dist/shared/components/item-edit/CatalogPickerField.js +1144 -1127
- package/dist/shared/components/item-edit/CloneDialog.js +192 -142
- package/dist/shared/components/item-edit/FieldRenderer.js +127 -126
- package/dist/shared/components/item-edit/FieldRow.js +236 -226
- package/dist/shared/components/item-edit/InlineGridField.js +92 -90
- package/dist/shared/components/item-edit/InlineTableField.js +3088 -2945
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +175 -0
- package/dist/shared/components/item-edit/PlanGrid.js +162 -162
- package/dist/shared/components/item-edit/PolishFields.js +169 -162
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -181
- package/dist/shared/components/item-edit/SummaryPanel.js +148 -135
- package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
- package/dist/shared/components/item-edit/helpers.js +181 -155
- package/dist/shared/components/item-edit/line-midair.js +201 -0
- package/dist/shared/components/item-edit/soft-rules.js +27 -0
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/panels/ItemLockBanner.js +414 -358
- package/dist/shared/components/panels/PipelinePanel.js +1157 -963
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/queue/QueueWorklist.js +870 -827
- package/dist/shared/components/queue/column-chooser.js +21 -0
- package/dist/shared/components/queue/live-state-aspect.js +6 -0
- package/dist/shared/components/ui/number-draft-input.js +93 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +191 -166
- package/dist/shared/lib/error-hints.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
1
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import { ExternalLink as Ee } from "lucide-react";
|
|
3
3
|
import { memo as qe, useContext as Te, useRef as J, useEffect as ne, useState as Je } from "react";
|
|
4
4
|
import { useDrilldown as He, useParentDraft as Ve, RelationPathDataContext as $e, useApiFetchConfig as Ge, fieldDrilldownConfig as V } from "../../context.js";
|
|
@@ -8,30 +8,31 @@ import { resolveOptionFilterTokens as ie } from "../../lib/option-filter-tokens.
|
|
|
8
8
|
import { counterOf as Ye } from "../../lib/placement-behaviour.js";
|
|
9
9
|
import { choiceLabel as ze } from "../../lib/utils.js";
|
|
10
10
|
import { Badge as Ue } from "../ui/badge.js";
|
|
11
|
-
import { Input as
|
|
12
|
-
import { Label as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { Input as T } from "../ui/input.js";
|
|
12
|
+
import { Label as Qe } from "../ui/label.js";
|
|
13
|
+
import { NumberDraftInput as Ce } from "../ui/number-draft-input.js";
|
|
14
|
+
import { SimpleSelect as Xe } from "../ui/SimpleSelect.js";
|
|
15
|
+
import { Switch as Ze } from "../ui/switch.js";
|
|
15
16
|
import { Textarea as $ } from "../ui/textarea.js";
|
|
16
|
-
import { CatalogPickerField as
|
|
17
|
+
import { CatalogPickerField as Oe } from "./CatalogPickerField.js";
|
|
17
18
|
import { columnMaxLength as ae } from "./column-length.js";
|
|
18
|
-
import { useFieldAffordances as
|
|
19
|
-
import { ProgressField as le, RatingScaleField as se, DurationReadOnly as
|
|
20
|
-
import { FilePickerField as
|
|
21
|
-
import { formatDisplayValue as
|
|
22
|
-
import { parseJson as y, toLocalDatetime as
|
|
23
|
-
import { InlineGridField as
|
|
24
|
-
import { InlineTableField as
|
|
25
|
-
import { checkNumberEntry as
|
|
26
|
-
import { M2MSingleSelectCombobox as
|
|
27
|
-
import { MembershipSetField as
|
|
28
|
-
import { PlanGridField as
|
|
29
|
-
import { smartParseDate as
|
|
30
|
-
import { QuickCreateButton as
|
|
31
|
-
import { RelationCombobox as
|
|
32
|
-
import { RelationGroupedCombobox as
|
|
33
|
-
import { RichTextEditor as
|
|
34
|
-
function
|
|
19
|
+
import { useFieldAffordances as et } from "./FieldAffordances.js";
|
|
20
|
+
import { ProgressField as le, RatingScaleField as se, DurationReadOnly as tt, ChecklistReadOnly as rt, ColorPackField as ce, PhoneField as de, EmailField as ot, AddressAutocompleteField as nt } from "./FieldPack.js";
|
|
21
|
+
import { FilePickerField as it, FileM2MField as at } from "./FilePickerField.js";
|
|
22
|
+
import { formatDisplayValue as B } from "./GroupSection.js";
|
|
23
|
+
import { parseJson as y, toLocalDatetime as lt } from "./helpers.js";
|
|
24
|
+
import { InlineGridField as st } from "./InlineGridField.js";
|
|
25
|
+
import { InlineTableField as ct } from "./InlineTableField.js";
|
|
26
|
+
import { checkNumberEntry as dt } from "./line-qty.js";
|
|
27
|
+
import { M2MSingleSelectCombobox as ut, M2MCombobox as mt } from "./M2MCombobox.js";
|
|
28
|
+
import { MembershipSetField as pt } from "./MembershipSetField.js";
|
|
29
|
+
import { PlanGridField as yt } from "./PlanGrid.js";
|
|
30
|
+
import { smartParseDate as _t, CountdownChip as ft, DurationField as bt, FiscalPeriodField as xt, ChecklistField as ht, RepeaterField as gt, RangeSliderField as vt, DateRangeField as wt, AddressField as Nt, maskFor as kt, applyInputMask as ue } from "./PolishFields.js";
|
|
31
|
+
import { QuickCreateButton as Ft } from "./QuickCreateButton.js";
|
|
32
|
+
import { RelationCombobox as At } from "./RelationCombobox.js";
|
|
33
|
+
import { RelationGroupedCombobox as Rt } from "./RelationGroupedCombobox.js";
|
|
34
|
+
import { RichTextEditor as St } from "./RichTextEditor.js";
|
|
35
|
+
function jt({
|
|
35
36
|
plugin: w,
|
|
36
37
|
props: e
|
|
37
38
|
}) {
|
|
@@ -53,7 +54,7 @@ function me(w) {
|
|
|
53
54
|
const l = (c) => {
|
|
54
55
|
const d = /* @__PURE__ */ new Date();
|
|
55
56
|
d.setDate(d.getDate() + c);
|
|
56
|
-
const b = (
|
|
57
|
+
const b = (g) => String(g).padStart(2, "0");
|
|
57
58
|
return `${d.getFullYear()}-${b(d.getMonth() + 1)}-${b(d.getDate())}`;
|
|
58
59
|
}, p = {};
|
|
59
60
|
for (const c of i) {
|
|
@@ -62,7 +63,7 @@ function me(w) {
|
|
|
62
63
|
}
|
|
63
64
|
return p;
|
|
64
65
|
}
|
|
65
|
-
const
|
|
66
|
+
const mr = qe(function({
|
|
66
67
|
field: e,
|
|
67
68
|
value: i,
|
|
68
69
|
onChange: l,
|
|
@@ -70,15 +71,15 @@ const dr = qe(function({
|
|
|
70
71
|
collection: c,
|
|
71
72
|
itemId: d,
|
|
72
73
|
cascadeFilter: b,
|
|
73
|
-
requiredParentLabel:
|
|
74
|
+
requiredParentLabel: g,
|
|
74
75
|
narrowedBy: u,
|
|
75
76
|
onCountChange: N,
|
|
76
77
|
displayOnly: G,
|
|
77
78
|
prefillParentId: pe,
|
|
78
79
|
pinnedOption: K
|
|
79
80
|
}) {
|
|
80
|
-
var
|
|
81
|
-
const j = He(), P =
|
|
81
|
+
var Q, C, X, Z, O, ee, te, re, oe;
|
|
82
|
+
const j = He(), P = et(), A = Ve(), H = Te($e), D = A, _ = (() => {
|
|
82
83
|
try {
|
|
83
84
|
return Ge();
|
|
84
85
|
} catch {
|
|
@@ -87,7 +88,7 @@ const dr = qe(function({
|
|
|
87
88
|
})(), s = e.interface ?? "", W = J(Ke(s)).current;
|
|
88
89
|
if (W)
|
|
89
90
|
return /* @__PURE__ */ n(
|
|
90
|
-
|
|
91
|
+
jt,
|
|
91
92
|
{
|
|
92
93
|
plugin: W,
|
|
93
94
|
props: {
|
|
@@ -103,7 +104,7 @@ const dr = qe(function({
|
|
|
103
104
|
if (s === "file-image" || s === "file") {
|
|
104
105
|
const r = y(e.options);
|
|
105
106
|
return /* @__PURE__ */ n(
|
|
106
|
-
|
|
107
|
+
it,
|
|
107
108
|
{
|
|
108
109
|
value: i,
|
|
109
110
|
onChange: l,
|
|
@@ -121,7 +122,7 @@ const dr = qe(function({
|
|
|
121
122
|
const m = y(e.options);
|
|
122
123
|
if (m != null && m.group_field && (m != null && m.option_field))
|
|
123
124
|
return /* @__PURE__ */ n(
|
|
124
|
-
|
|
125
|
+
Rt,
|
|
125
126
|
{
|
|
126
127
|
collection: k.one_collection,
|
|
127
128
|
value: i,
|
|
@@ -140,7 +141,7 @@ const dr = qe(function({
|
|
|
140
141
|
A == null ? void 0 : A.draft,
|
|
141
142
|
d
|
|
142
143
|
), t = a ? b ? { _and: [a, b] } : a : b, f = /* @__PURE__ */ n(
|
|
143
|
-
|
|
144
|
+
At,
|
|
144
145
|
{
|
|
145
146
|
fieldKey: e.field,
|
|
146
147
|
missPlacement: (P == null ? void 0 : P.layoutId) != null && P.pickerMisses !== !1 ? { layoutId: Number(P.layoutId), collection: c, field: e.field } : null,
|
|
@@ -152,7 +153,7 @@ const dr = qe(function({
|
|
|
152
153
|
extraFilter: t,
|
|
153
154
|
autoSelectSingle: (o == null ? void 0 : o.auto_select_single) === !0,
|
|
154
155
|
optionSort: typeof (o == null ? void 0 : o.option_sort) == "string" && o.option_sort ? o.option_sort : void 0,
|
|
155
|
-
requiredParent:
|
|
156
|
+
requiredParent: g ?? void 0,
|
|
156
157
|
narrowedBy: u,
|
|
157
158
|
pinned: K,
|
|
158
159
|
facets: Array.isArray(o == null ? void 0 : o.picker_facets) ? o.picker_facets.map((m) => ({
|
|
@@ -164,14 +165,14 @@ const dr = qe(function({
|
|
|
164
165
|
filter: m.filter && typeof m.filter == "object" ? ie(m.filter, A == null ? void 0 : A.draft, d) : void 0
|
|
165
166
|
})) : void 0
|
|
166
167
|
}
|
|
167
|
-
),
|
|
168
|
-
return !r && !
|
|
168
|
+
), v = o != null && o.quick_create && Array.isArray(o.quick_create.fields) && !e.readonly ? o.quick_create : null;
|
|
169
|
+
return !r && !v ? f : /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
169
170
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: f }),
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
v && /* @__PURE__ */ n(
|
|
172
|
+
Ft,
|
|
172
173
|
{
|
|
173
174
|
targetCollection: k.one_collection,
|
|
174
|
-
config:
|
|
175
|
+
config: v,
|
|
175
176
|
onCreated: (m) => l(m)
|
|
176
177
|
}
|
|
177
178
|
),
|
|
@@ -192,7 +193,7 @@ const dr = qe(function({
|
|
|
192
193
|
)
|
|
193
194
|
] });
|
|
194
195
|
}
|
|
195
|
-
const
|
|
196
|
+
const L = Y && !k ? (() => {
|
|
196
197
|
const r = p.find(
|
|
197
198
|
(a) => a.one_collection === c && (a.one_field === e.field || a.junction_field != null && a.many_collection === e.field)
|
|
198
199
|
);
|
|
@@ -203,13 +204,13 @@ const dr = qe(function({
|
|
|
203
204
|
);
|
|
204
205
|
return o ? { ...r, junction_field: o.many_field } : null;
|
|
205
206
|
})() : null;
|
|
206
|
-
if (
|
|
207
|
+
if (L) {
|
|
207
208
|
if (s === "files-m2m") {
|
|
208
209
|
const a = y(e.options);
|
|
209
210
|
return /* @__PURE__ */ n(
|
|
210
|
-
|
|
211
|
+
at,
|
|
211
212
|
{
|
|
212
|
-
relation:
|
|
213
|
+
relation: L,
|
|
213
214
|
parentId: d,
|
|
214
215
|
allRelations: p,
|
|
215
216
|
disabled: e.readonly,
|
|
@@ -221,26 +222,26 @@ const dr = qe(function({
|
|
|
221
222
|
}
|
|
222
223
|
const r = y(e.options), o = typeof (r == null ? void 0 : r.option_sort) == "string" && r.option_sort ? r.option_sort : void 0;
|
|
223
224
|
return (r == null ? void 0 : r.max_values) === 1 ? /* @__PURE__ */ n(
|
|
224
|
-
|
|
225
|
+
ut,
|
|
225
226
|
{
|
|
226
|
-
relation:
|
|
227
|
+
relation: L,
|
|
227
228
|
parentId: d,
|
|
228
229
|
allRelations: p,
|
|
229
230
|
extraFilter: b,
|
|
230
231
|
optionSort: o,
|
|
231
|
-
requiredParent:
|
|
232
|
+
requiredParent: g ?? void 0,
|
|
232
233
|
onCountChange: N,
|
|
233
234
|
readOnly: G
|
|
234
235
|
}
|
|
235
236
|
) : /* @__PURE__ */ n(
|
|
236
|
-
|
|
237
|
+
mt,
|
|
237
238
|
{
|
|
238
|
-
relation:
|
|
239
|
+
relation: L,
|
|
239
240
|
parentId: d,
|
|
240
241
|
allRelations: p,
|
|
241
242
|
extraFilter: b,
|
|
242
243
|
optionSort: o,
|
|
243
|
-
requiredParent:
|
|
244
|
+
requiredParent: g ?? void 0,
|
|
244
245
|
onCountChange: N,
|
|
245
246
|
drilldown: V(e)
|
|
246
247
|
}
|
|
@@ -262,24 +263,24 @@ const dr = qe(function({
|
|
|
262
263
|
title: String(i)
|
|
263
264
|
}),
|
|
264
265
|
className: "text-left text-sm text-slate-700 underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-[#172940] hover:decoration-nvr-cyan dark:text-slate-200 dark:hover:text-nvr-cyan",
|
|
265
|
-
children:
|
|
266
|
+
children: B(i, e)
|
|
266
267
|
}
|
|
267
268
|
) });
|
|
268
269
|
}
|
|
269
|
-
const r = (
|
|
270
|
+
const r = (Q = e.options) == null ? void 0 : Q.__live_delta;
|
|
270
271
|
if (r && Number.isFinite(Number(r.live))) {
|
|
271
272
|
const a = Number(r.original), t = Number(r.live) - (Number.isFinite(a) ? a : 0), f = Math.round(t * 100) / 100;
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */ n("span", { className: "text-sm text-slate-400 line-through tabular-nums", children:
|
|
273
|
+
return /* @__PURE__ */ x("div", { className: "flex min-h-[36px] flex-wrap items-center gap-x-2 gap-y-0.5", children: [
|
|
274
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-slate-400 line-through tabular-nums", children: B(r.original, e) }),
|
|
274
275
|
/* @__PURE__ */ n("span", { className: "text-slate-300", "aria-hidden": !0, children: "→" }),
|
|
275
|
-
/* @__PURE__ */ n("span", { className: "text-sm font-medium tabular-nums", children:
|
|
276
|
-
f !== 0 && /* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ n("span", { className: "text-sm font-medium tabular-nums", children: B(r.live, e) }),
|
|
277
|
+
f !== 0 && /* @__PURE__ */ x(
|
|
277
278
|
"span",
|
|
278
279
|
{
|
|
279
280
|
className: `rounded px-1.5 py-px text-[11px] font-medium tabular-nums ${f > 0 ? "bg-emerald-50 text-emerald-700 dark:bg-emerald-900/20 dark:text-emerald-400" : "bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-400"}`,
|
|
280
281
|
children: [
|
|
281
282
|
f > 0 ? "+" : "−",
|
|
282
|
-
|
|
283
|
+
B(Math.abs(f), e)
|
|
283
284
|
]
|
|
284
285
|
}
|
|
285
286
|
)
|
|
@@ -287,32 +288,32 @@ const dr = qe(function({
|
|
|
287
288
|
}
|
|
288
289
|
if (s === "progress") return /* @__PURE__ */ n(le, { value: i, onChange: l, readOnly: !0 });
|
|
289
290
|
if (s === "rating") {
|
|
290
|
-
const a = (
|
|
291
|
+
const a = (C = y(e.options)) == null ? void 0 : C.rating_max;
|
|
291
292
|
return /* @__PURE__ */ n(se, { value: i, onChange: l, max: a ?? 5, readOnly: !0 });
|
|
292
293
|
}
|
|
293
|
-
if (s === "duration") return /* @__PURE__ */ n(
|
|
294
|
-
if (s === "checklist") return /* @__PURE__ */ n(
|
|
294
|
+
if (s === "duration") return /* @__PURE__ */ n(tt, { value: i });
|
|
295
|
+
if (s === "checklist") return /* @__PURE__ */ n(rt, { value: i });
|
|
295
296
|
if (s === "color")
|
|
296
297
|
return /* @__PURE__ */ n(ce, { field: e, value: i, onChange: l, readOnly: !0 });
|
|
297
298
|
if (s === "phone") return /* @__PURE__ */ n(de, { value: i, onChange: l, readOnly: !0 });
|
|
298
|
-
const o = i == null ? /* @__PURE__ */ n("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof i == "boolean" ? /* @__PURE__ */ n(Ue, { variant: i ? "default" : "secondary", children: i ? "Yes" : "No" }) : /* @__PURE__ */ n("span", { className: "text-sm tabular-nums", children:
|
|
299
|
+
const o = i == null ? /* @__PURE__ */ n("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof i == "boolean" ? /* @__PURE__ */ n(Ue, { variant: i ? "default" : "secondary", children: i ? "Yes" : "No" }) : /* @__PURE__ */ n("span", { className: "text-sm tabular-nums", children: B(i, e) });
|
|
299
300
|
return /* @__PURE__ */ n("div", { className: "min-h-[36px] flex items-center", children: o });
|
|
300
301
|
}
|
|
301
|
-
const
|
|
302
|
+
const h = i == null ? "" : String(i);
|
|
302
303
|
if (e.type === "boolean")
|
|
303
|
-
return /* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */ n(
|
|
305
|
-
/* @__PURE__ */ n(
|
|
304
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
305
|
+
/* @__PURE__ */ n(Ze, { checked: !!i, onCheckedChange: l }),
|
|
306
|
+
/* @__PURE__ */ n(Qe, { className: "font-normal text-sm", children: i ? "Yes" : "No" })
|
|
306
307
|
] });
|
|
307
308
|
if (e.type === "datetime" || s === "datetime") {
|
|
308
309
|
const r = y(e.options);
|
|
309
310
|
if ((r == null ? void 0 : r.date_mode) === "date") {
|
|
310
311
|
const o = me(e);
|
|
311
312
|
return /* @__PURE__ */ n(
|
|
312
|
-
|
|
313
|
+
T,
|
|
313
314
|
{
|
|
314
315
|
type: "date",
|
|
315
|
-
value:
|
|
316
|
+
value: h.slice(0, 10),
|
|
316
317
|
min: o.min,
|
|
317
318
|
max: o.max,
|
|
318
319
|
onChange: (a) => l(a.target.value || null),
|
|
@@ -321,10 +322,10 @@ const dr = qe(function({
|
|
|
321
322
|
);
|
|
322
323
|
}
|
|
323
324
|
return /* @__PURE__ */ n(
|
|
324
|
-
|
|
325
|
+
T,
|
|
325
326
|
{
|
|
326
327
|
type: "datetime-local",
|
|
327
|
-
value:
|
|
328
|
+
value: lt(i),
|
|
328
329
|
onChange: (o) => l(o.target.value ? new Date(o.target.value).toISOString() : null),
|
|
329
330
|
placeholder: e.placeholder ?? void 0
|
|
330
331
|
}
|
|
@@ -332,24 +333,24 @@ const dr = qe(function({
|
|
|
332
333
|
}
|
|
333
334
|
if (e.type === "date" || s === "date") {
|
|
334
335
|
const r = ((X = y(e.options)) == null ? void 0 : X.countdown) === !0, o = me(e);
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center", children: [
|
|
336
337
|
/* @__PURE__ */ n(
|
|
337
|
-
|
|
338
|
+
T,
|
|
338
339
|
{
|
|
339
340
|
type: "date",
|
|
340
|
-
value:
|
|
341
|
+
value: h.slice(0, 10),
|
|
341
342
|
min: o.min,
|
|
342
343
|
max: o.max,
|
|
343
344
|
onChange: (a) => l(a.target.value || null),
|
|
344
345
|
onPaste: (a) => {
|
|
345
|
-
const t =
|
|
346
|
+
const t = _t(a.clipboardData.getData("text"));
|
|
346
347
|
t && (a.preventDefault(), l(t));
|
|
347
348
|
},
|
|
348
349
|
placeholder: e.placeholder ?? void 0,
|
|
349
350
|
className: "flex-1"
|
|
350
351
|
}
|
|
351
352
|
),
|
|
352
|
-
r && /* @__PURE__ */ n(
|
|
353
|
+
r && /* @__PURE__ */ n(ft, { value: h.slice(0, 10) })
|
|
353
354
|
] });
|
|
354
355
|
}
|
|
355
356
|
if ([
|
|
@@ -370,22 +371,22 @@ const dr = qe(function({
|
|
|
370
371
|
].includes(e.type)) {
|
|
371
372
|
const r = ["integer", "bigInteger", "int", "bigint", "smallint", "tinyint"].includes(
|
|
372
373
|
e.type
|
|
373
|
-
), o = r ? 0 : We(e.options, -1), a = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t =
|
|
374
|
-
return /* @__PURE__ */
|
|
374
|
+
), o = r ? 0 : We(e.options, -1), a = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = dt(i, { type: e.type, label: e.label || "Value" }), f = t.ok ? null : t.message;
|
|
375
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
375
376
|
/* @__PURE__ */ n(
|
|
376
|
-
|
|
377
|
+
Ce,
|
|
377
378
|
{
|
|
378
379
|
type: "number",
|
|
379
380
|
"aria-invalid": f ? !0 : void 0,
|
|
380
381
|
step: a,
|
|
381
|
-
value:
|
|
382
|
-
|
|
383
|
-
onBlur: (
|
|
384
|
-
if (o < 0 ||
|
|
385
|
-
const m = Number(
|
|
382
|
+
value: i,
|
|
383
|
+
onValue: l,
|
|
384
|
+
onBlur: (v) => {
|
|
385
|
+
if (o < 0 || v.target.value === "") return;
|
|
386
|
+
const m = Number(v.target.value);
|
|
386
387
|
if (!Number.isFinite(m)) return;
|
|
387
|
-
const
|
|
388
|
-
|
|
388
|
+
const E = Number(m.toFixed(o));
|
|
389
|
+
E !== m && l(E);
|
|
389
390
|
},
|
|
390
391
|
placeholder: e.placeholder ?? void 0
|
|
391
392
|
}
|
|
@@ -399,7 +400,7 @@ const dr = qe(function({
|
|
|
399
400
|
{
|
|
400
401
|
className: "font-mono text-xs",
|
|
401
402
|
rows: 4,
|
|
402
|
-
value: typeof i == "object" ? JSON.stringify(i, null, 2) :
|
|
403
|
+
value: typeof i == "object" ? JSON.stringify(i, null, 2) : h,
|
|
403
404
|
onChange: (r) => {
|
|
404
405
|
try {
|
|
405
406
|
l(JSON.parse(r.target.value));
|
|
@@ -416,7 +417,7 @@ const dr = qe(function({
|
|
|
416
417
|
{
|
|
417
418
|
rows: 4,
|
|
418
419
|
maxLength: ae(e) ?? void 0,
|
|
419
|
-
value:
|
|
420
|
+
value: h,
|
|
420
421
|
onChange: (r) => l(r.target.value),
|
|
421
422
|
placeholder: e.placeholder ?? void 0
|
|
422
423
|
}
|
|
@@ -426,7 +427,7 @@ const dr = qe(function({
|
|
|
426
427
|
$,
|
|
427
428
|
{
|
|
428
429
|
rows: 6,
|
|
429
|
-
value:
|
|
430
|
+
value: h,
|
|
430
431
|
onChange: (r) => l(r.target.value),
|
|
431
432
|
placeholder: e.placeholder ?? void 0,
|
|
432
433
|
className: "font-mono text-sm"
|
|
@@ -434,9 +435,9 @@ const dr = qe(function({
|
|
|
434
435
|
);
|
|
435
436
|
if (s === "input-rich-text-html" || s === "rich_text" || e.type === "rich_text" || s === "extension-editorjs")
|
|
436
437
|
return /* @__PURE__ */ n(
|
|
437
|
-
|
|
438
|
+
St,
|
|
438
439
|
{
|
|
439
|
-
value:
|
|
440
|
+
value: h,
|
|
440
441
|
onChange: l,
|
|
441
442
|
placeholder: e.placeholder ?? void 0,
|
|
442
443
|
disabled: e.readonly,
|
|
@@ -458,7 +459,7 @@ const dr = qe(function({
|
|
|
458
459
|
}
|
|
459
460
|
})() : e.options ?? {}).layout_slug ?? null;
|
|
460
461
|
return /* @__PURE__ */ n(
|
|
461
|
-
|
|
462
|
+
st,
|
|
462
463
|
{
|
|
463
464
|
relatedCollection: o,
|
|
464
465
|
manyField: a,
|
|
@@ -485,10 +486,10 @@ const dr = qe(function({
|
|
|
485
486
|
} catch {
|
|
486
487
|
return {};
|
|
487
488
|
}
|
|
488
|
-
})() : e.options ?? {}, f = t.layout_id ?? null,
|
|
489
|
+
})() : e.options ?? {}, f = t.layout_id ?? null, v = !!t.show_row_revisions, m = !!t.row_comments, E = t.allow_revision_restore !== !1, ye = t.save_mode ?? "immediate", _e = !!t.show_line_numbers, fe = t.enable_reorder !== !1, be = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, xe = Array.isArray(t.row_rules) ? t.row_rules : void 0, he = Array.isArray(t.column_presets) ? t.column_presets : void 0, ge = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, ve = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, we = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, Ne = Array.isArray(t.unique_by) ? t.unique_by : void 0, ke = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, Fe = t.sort_dir === "desc" ? "desc" : "asc", Ae = t.freeze_first_column === !0, Re = typeof t.section_group_by == "string" && t.section_group_by.includes(".") ? t.section_group_by : void 0, Se = t.row_filter && typeof t.row_filter == "object" ? t.row_filter : void 0, je = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, De = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, Ie = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Pe = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, Me = t.row_match_panel ?? void 0, Be = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Le = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, R = t.membership_set;
|
|
489
490
|
if (R != null && R.key_field && (R != null && R.value_field))
|
|
490
491
|
return /* @__PURE__ */ n(
|
|
491
|
-
|
|
492
|
+
pt,
|
|
492
493
|
{
|
|
493
494
|
relatedCollection: o,
|
|
494
495
|
manyField: a,
|
|
@@ -500,7 +501,7 @@ const dr = qe(function({
|
|
|
500
501
|
const S = t.catalog_mode;
|
|
501
502
|
if (S != null && S.item_field && (S != null && S.section_by))
|
|
502
503
|
return /* @__PURE__ */ n(
|
|
503
|
-
|
|
504
|
+
Oe,
|
|
504
505
|
{
|
|
505
506
|
relatedCollection: o,
|
|
506
507
|
manyField: a,
|
|
@@ -512,9 +513,9 @@ const dr = qe(function({
|
|
|
512
513
|
);
|
|
513
514
|
const F = t.row_split;
|
|
514
515
|
if (F != null && F.key_field && (F != null && F.category_field) && Array.isArray(F.value_fields)) {
|
|
515
|
-
const
|
|
516
|
+
const q = t.spread_remaining;
|
|
516
517
|
return /* @__PURE__ */ n(
|
|
517
|
-
|
|
518
|
+
yt,
|
|
518
519
|
{
|
|
519
520
|
relatedCollection: o,
|
|
520
521
|
manyField: a,
|
|
@@ -523,24 +524,24 @@ const dr = qe(function({
|
|
|
523
524
|
compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
|
|
524
525
|
stats: Array.isArray(t.stats) ? t.stats : null,
|
|
525
526
|
sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
|
|
526
|
-
remaining: typeof (
|
|
527
|
+
remaining: typeof (q == null ? void 0 : q.remaining) == "string" ? q.remaining : null,
|
|
527
528
|
readOnly: e.readonly,
|
|
528
|
-
showHistory:
|
|
529
|
+
showHistory: v,
|
|
529
530
|
emptyLabel: e.label || void 0
|
|
530
531
|
}
|
|
531
532
|
);
|
|
532
533
|
}
|
|
533
534
|
return /* @__PURE__ */ n(
|
|
534
|
-
|
|
535
|
+
ct,
|
|
535
536
|
{
|
|
536
537
|
relatedCollection: o,
|
|
537
538
|
manyField: a,
|
|
538
539
|
parentId: d,
|
|
539
540
|
parentCollection: c,
|
|
540
541
|
layoutId: f,
|
|
541
|
-
showRowRevisions:
|
|
542
|
+
showRowRevisions: v,
|
|
542
543
|
rowComments: m,
|
|
543
|
-
allowRevisionRestore:
|
|
544
|
+
allowRevisionRestore: E,
|
|
544
545
|
saveMode: ye,
|
|
545
546
|
showLineNumbers: _e,
|
|
546
547
|
enableReorder: fe,
|
|
@@ -589,10 +590,10 @@ const dr = qe(function({
|
|
|
589
590
|
if (s === "phone")
|
|
590
591
|
return /* @__PURE__ */ n(de, { value: i, onChange: l, placeholder: e.placeholder ?? void 0 });
|
|
591
592
|
if (s === "email")
|
|
592
|
-
return /* @__PURE__ */ n(
|
|
593
|
+
return /* @__PURE__ */ n(ot, { value: i, onChange: l, placeholder: e.placeholder ?? void 0 });
|
|
593
594
|
if (s === "address-autocomplete")
|
|
594
595
|
return /* @__PURE__ */ n(
|
|
595
|
-
|
|
596
|
+
nt,
|
|
596
597
|
{
|
|
597
598
|
field: e,
|
|
598
599
|
value: i,
|
|
@@ -603,15 +604,15 @@ const dr = qe(function({
|
|
|
603
604
|
placeholder: e.placeholder ?? void 0
|
|
604
605
|
}
|
|
605
606
|
);
|
|
606
|
-
if (s === "duration") return /* @__PURE__ */ n(
|
|
607
|
-
if (s === "fiscal_period") return /* @__PURE__ */ n(
|
|
608
|
-
if (s === "checklist") return /* @__PURE__ */ n(
|
|
607
|
+
if (s === "duration") return /* @__PURE__ */ n(bt, { value: i, onChange: l });
|
|
608
|
+
if (s === "fiscal_period") return /* @__PURE__ */ n(xt, { value: i, onChange: l });
|
|
609
|
+
if (s === "checklist") return /* @__PURE__ */ n(ht, { value: i, onChange: l });
|
|
609
610
|
if (s === "repeater" || e.repeater_schema && e.type === "json")
|
|
610
|
-
return /* @__PURE__ */ n(
|
|
611
|
+
return /* @__PURE__ */ n(gt, { field: e, value: i, onChange: l });
|
|
611
612
|
if (s === "range_slider") {
|
|
612
613
|
const r = (ee = y(e.options)) == null ? void 0 : ee.range_end_field;
|
|
613
614
|
return /* @__PURE__ */ n(
|
|
614
|
-
|
|
615
|
+
vt,
|
|
615
616
|
{
|
|
616
617
|
field: e,
|
|
617
618
|
value: i,
|
|
@@ -623,7 +624,7 @@ const dr = qe(function({
|
|
|
623
624
|
if (s === "date_range") {
|
|
624
625
|
const r = (re = y(e.options)) == null ? void 0 : re.range_end_field;
|
|
625
626
|
return /* @__PURE__ */ n(
|
|
626
|
-
|
|
627
|
+
wt,
|
|
627
628
|
{
|
|
628
629
|
field: e,
|
|
629
630
|
value: i,
|
|
@@ -634,7 +635,7 @@ const dr = qe(function({
|
|
|
634
635
|
}
|
|
635
636
|
if (s === "address")
|
|
636
637
|
return /* @__PURE__ */ n(
|
|
637
|
-
|
|
638
|
+
Nt,
|
|
638
639
|
{
|
|
639
640
|
field: e,
|
|
640
641
|
value: i,
|
|
@@ -644,7 +645,7 @@ const dr = qe(function({
|
|
|
644
645
|
}
|
|
645
646
|
);
|
|
646
647
|
if (s === "tags")
|
|
647
|
-
return /* @__PURE__ */ n(
|
|
648
|
+
return /* @__PURE__ */ n(Dt, { field: e, value: i, onChange: l });
|
|
648
649
|
if (s === "select-dropdown" || s === "radio-buttons") {
|
|
649
650
|
const r = (() => {
|
|
650
651
|
const o = y(e.options);
|
|
@@ -652,9 +653,9 @@ const dr = qe(function({
|
|
|
652
653
|
})();
|
|
653
654
|
if (r.length > 0)
|
|
654
655
|
return /* @__PURE__ */ n(
|
|
655
|
-
|
|
656
|
+
Xe,
|
|
656
657
|
{
|
|
657
|
-
value:
|
|
658
|
+
value: h,
|
|
658
659
|
onChange: (o) => l(o || null),
|
|
659
660
|
options: [
|
|
660
661
|
{ value: "", label: "— Select —" },
|
|
@@ -665,16 +666,16 @@ const dr = qe(function({
|
|
|
665
666
|
}
|
|
666
667
|
);
|
|
667
668
|
}
|
|
668
|
-
const I =
|
|
669
|
+
const I = kt(e), z = ae(e), M = (() => {
|
|
669
670
|
const r = y(e.options);
|
|
670
671
|
if (Number.isFinite(Number(r == null ? void 0 : r.max_length))) return Number(r == null ? void 0 : r.max_length);
|
|
671
672
|
const o = y(e.validation_rules), a = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
|
|
672
673
|
return a && Number.isFinite(Number(a.value)) ? Number(a.value) : z;
|
|
673
674
|
})(), U = /* @__PURE__ */ n(
|
|
674
|
-
|
|
675
|
+
T,
|
|
675
676
|
{
|
|
676
677
|
maxLength: I ? void 0 : z ?? void 0,
|
|
677
|
-
value: I ? ue(I,
|
|
678
|
+
value: I ? ue(I, h).display : h,
|
|
678
679
|
onChange: (r) => {
|
|
679
680
|
if (I) {
|
|
680
681
|
const { clean: o } = ue(I, r.target.value);
|
|
@@ -686,10 +687,10 @@ const dr = qe(function({
|
|
|
686
687
|
}
|
|
687
688
|
);
|
|
688
689
|
if (M != null && M > 0 && !Ye(e._overrides)) {
|
|
689
|
-
const r =
|
|
690
|
-
return /* @__PURE__ */
|
|
690
|
+
const r = h.length;
|
|
691
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
691
692
|
U,
|
|
692
|
-
r >= M * 0.6 && /* @__PURE__ */
|
|
693
|
+
r >= M * 0.6 && /* @__PURE__ */ x(
|
|
693
694
|
"p",
|
|
694
695
|
{
|
|
695
696
|
className: r > M ? "mt-0.5 text-right text-[10.5px] tabular-nums text-red-500" : "mt-0.5 text-right text-[10.5px] tabular-nums text-slate-400",
|
|
@@ -704,7 +705,7 @@ const dr = qe(function({
|
|
|
704
705
|
}
|
|
705
706
|
return U;
|
|
706
707
|
});
|
|
707
|
-
function
|
|
708
|
+
function Dt({
|
|
708
709
|
field: w,
|
|
709
710
|
value: e,
|
|
710
711
|
onChange: i
|
|
@@ -722,13 +723,13 @@ function jt({
|
|
|
722
723
|
})(), d = (() => {
|
|
723
724
|
const u = y(w.options);
|
|
724
725
|
return Array.isArray(u == null ? void 0 : u.tag_options) ? u.tag_options.map(String) : [];
|
|
725
|
-
})(), b = (u) => i(u.length > 0 ? JSON.stringify(u) : null),
|
|
726
|
+
})(), b = (u) => i(u.length > 0 ? JSON.stringify(u) : null), g = (u) => {
|
|
726
727
|
const N = u.trim();
|
|
727
728
|
!N || c.includes(N) || (b([...c, N]), p(""));
|
|
728
729
|
};
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
c.map((u) => /* @__PURE__ */
|
|
730
|
+
return /* @__PURE__ */ x("div", { className: "rounded-md border border-input bg-background px-2 py-1.5", children: [
|
|
731
|
+
/* @__PURE__ */ x("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
732
|
+
c.map((u) => /* @__PURE__ */ x(
|
|
732
733
|
"span",
|
|
733
734
|
{
|
|
734
735
|
className: "inline-flex items-center gap-1 rounded-full bg-nvr-cyan/10 px-2 py-0.5 text-[11.5px] font-medium text-nvr-navy dark:bg-nvr-cyan/15 dark:text-nvr-cyan",
|
|
@@ -754,19 +755,19 @@ function jt({
|
|
|
754
755
|
value: l,
|
|
755
756
|
onChange: (u) => p(u.target.value),
|
|
756
757
|
onKeyDown: (u) => {
|
|
757
|
-
(u.key === "Enter" || u.key === ",") && (u.preventDefault(),
|
|
758
|
+
(u.key === "Enter" || u.key === ",") && (u.preventDefault(), g(l)), u.key === "Backspace" && l === "" && c.length > 0 && b(c.slice(0, -1));
|
|
758
759
|
},
|
|
759
|
-
onBlur: () =>
|
|
760
|
+
onBlur: () => g(l),
|
|
760
761
|
placeholder: c.length === 0 ? "Type and press Enter…" : "",
|
|
761
762
|
className: "h-6 min-w-[120px] flex-1 bg-transparent text-[13px] outline-none"
|
|
762
763
|
}
|
|
763
764
|
)
|
|
764
765
|
] }),
|
|
765
|
-
d.length > 0 && /* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap gap-1 border-t border-slate-100 pt-1 dark:border-border/60", children: d.filter((u) => !c.includes(u)).map((u) => /* @__PURE__ */
|
|
766
|
+
d.length > 0 && /* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap gap-1 border-t border-slate-100 pt-1 dark:border-border/60", children: d.filter((u) => !c.includes(u)).map((u) => /* @__PURE__ */ x(
|
|
766
767
|
"button",
|
|
767
768
|
{
|
|
768
769
|
type: "button",
|
|
769
|
-
onClick: () =>
|
|
770
|
+
onClick: () => g(u),
|
|
770
771
|
className: "rounded-full border border-slate-200 px-2 py-0.5 text-[11px] text-slate-500 hover:border-nvr-cyan/50 hover:text-slate-700 dark:border-border dark:text-slate-400",
|
|
771
772
|
children: [
|
|
772
773
|
"+ ",
|
|
@@ -778,6 +779,6 @@ function jt({
|
|
|
778
779
|
] });
|
|
779
780
|
}
|
|
780
781
|
export {
|
|
781
|
-
|
|
782
|
+
mr as FieldRenderer,
|
|
782
783
|
ie as resolveOptionFilterTokens
|
|
783
784
|
};
|