@nivaro/react 0.3.15 → 0.3.16
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +127 -6
- package/dist/index.js +736 -734
- package/dist/shared/components/CollectionBrowserView.js +2344 -2309
- package/dist/shared/components/ItemEditForm.js +3773 -3604
- package/dist/shared/components/RecordGridEditor.js +319 -282
- package/dist/shared/components/RecordReadView.js +202 -200
- package/dist/shared/components/cbv/unknown-fields.js +18 -8
- package/dist/shared/components/import/DocumentAutofillButton.js +148 -142
- package/dist/shared/components/item-edit/CatalogPickerField.js +264 -276
- package/dist/shared/components/item-edit/FieldRenderer.js +136 -133
- package/dist/shared/components/item-edit/FieldRow.js +198 -184
- package/dist/shared/components/item-edit/HeaderTools.js +107 -99
- package/dist/shared/components/item-edit/InlineTableField.js +138 -136
- package/dist/shared/components/item-edit/RecordLiveSync.js +1 -0
- package/dist/shared/components/item-edit/RelationCombobox.js +30 -23
- package/dist/shared/components/item-edit/SummaryPanel.js +334 -294
- package/dist/shared/components/item-edit/column-length.js +12 -0
- package/dist/shared/components/panels/AccessDeniedPanel.js +47 -37
- package/dist/shared/components/panels/ItemLockBanner.js +307 -285
- package/dist/shared/components/panels/PipelinePanel.js +486 -465
- package/dist/shared/components/panels/RevisionsPanel.js +210 -204
- package/dist/shared/components/profile/DelegationCard.js +178 -121
- package/dist/shared/components/profile/PersonActivity.js +152 -139
- package/dist/shared/components/queue/QueueWorklist.js +668 -659
- package/dist/shared/components/queue/transition-note.js +90 -0
- package/dist/shared/components/support/SupportRequestDialog.js +100 -89
- package/dist/shared/components/support/TicketDetailSheet.js +104 -91
- package/dist/shared/lib/autofill-runs.js +33 -26
- package/dist/shared/lib/draft-store.js +40 -24
- package/dist/shared/lib/live-queries.js +10 -9
- package/dist/shared/lib/restore-skipped.js +10 -0
- package/package.json +1 -1
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
import { jsx as i, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import { ExternalLink as
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { useDrilldown as
|
|
5
|
-
import { getFieldInterface as
|
|
6
|
-
import { precisionOf as
|
|
7
|
-
import { resolveOptionFilterTokens as
|
|
8
|
-
import { counterOf as
|
|
9
|
-
import { choiceLabel as
|
|
10
|
-
import { Badge as
|
|
2
|
+
import { ExternalLink as Le } from "lucide-react";
|
|
3
|
+
import { useContext as Ee, useRef as J, useEffect as oe, useState as qe } from "react";
|
|
4
|
+
import { useDrilldown as Te, useParentDraft as Je, RelationPathDataContext as He, useApiFetchConfig as Ve, fieldDrilldownConfig as V } from "../../context.js";
|
|
5
|
+
import { getFieldInterface as $e } from "../../lib/field-interfaces.js";
|
|
6
|
+
import { precisionOf as Ge } from "../../lib/format-value.js";
|
|
7
|
+
import { resolveOptionFilterTokens as ne } from "../../lib/option-filter-tokens.js";
|
|
8
|
+
import { counterOf as Ke } from "../../lib/placement-behaviour.js";
|
|
9
|
+
import { choiceLabel as We } from "../../lib/utils.js";
|
|
10
|
+
import { Badge as Ye } from "../ui/badge.js";
|
|
11
11
|
import { Input as B } from "../ui/input.js";
|
|
12
|
-
import { Label as
|
|
13
|
-
import { SimpleSelect as
|
|
14
|
-
import { Switch as
|
|
12
|
+
import { Label as ze } from "../ui/label.js";
|
|
13
|
+
import { SimpleSelect as Ue } from "../ui/SimpleSelect.js";
|
|
14
|
+
import { Switch as Ce } from "../ui/switch.js";
|
|
15
15
|
import { Textarea as $ } from "../ui/textarea.js";
|
|
16
|
-
import { CatalogPickerField as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
16
|
+
import { CatalogPickerField as Qe } from "./CatalogPickerField.js";
|
|
17
|
+
import { columnMaxLength as ie } from "./column-length.js";
|
|
18
|
+
import { useFieldAffordances as Xe } from "./FieldAffordances.js";
|
|
19
|
+
import { ProgressField as ae, RatingScaleField as le, DurationReadOnly as Ze, ChecklistReadOnly as Oe, ColorPackField as se, PhoneField as ce, EmailField as et, AddressAutocompleteField as tt } from "./FieldPack.js";
|
|
20
|
+
import { FilePickerField as rt, FileM2MField as ot } from "./FilePickerField.js";
|
|
20
21
|
import { formatDisplayValue as L } from "./GroupSection.js";
|
|
21
|
-
import { parseJson as _, toLocalDatetime as
|
|
22
|
-
import { InlineGridField as
|
|
23
|
-
import { InlineTableField as
|
|
24
|
-
import { checkNumberEntry as
|
|
25
|
-
import { M2MSingleSelectCombobox as
|
|
26
|
-
import { MembershipSetField as
|
|
27
|
-
import { PlanGridField as
|
|
28
|
-
import { smartParseDate as
|
|
29
|
-
import { QuickCreateButton as
|
|
30
|
-
import { RelationCombobox as
|
|
31
|
-
import { RelationGroupedCombobox as
|
|
32
|
-
import { RichTextEditor as
|
|
33
|
-
function
|
|
22
|
+
import { parseJson as _, toLocalDatetime as nt } from "./helpers.js";
|
|
23
|
+
import { InlineGridField as it } from "./InlineGridField.js";
|
|
24
|
+
import { InlineTableField as at } from "./InlineTableField.js";
|
|
25
|
+
import { checkNumberEntry as lt } from "./line-qty.js";
|
|
26
|
+
import { M2MSingleSelectCombobox as st, M2MCombobox as ct } from "./M2MCombobox.js";
|
|
27
|
+
import { MembershipSetField as dt } from "./MembershipSetField.js";
|
|
28
|
+
import { PlanGridField as ut } from "./PlanGrid.js";
|
|
29
|
+
import { smartParseDate as mt, CountdownChip as pt, DurationField as yt, FiscalPeriodField as _t, ChecklistField as ft, RepeaterField as bt, RangeSliderField as xt, DateRangeField as ht, AddressField as gt, maskFor as vt, applyInputMask as de } from "./PolishFields.js";
|
|
30
|
+
import { QuickCreateButton as wt } from "./QuickCreateButton.js";
|
|
31
|
+
import { RelationCombobox as Nt } from "./RelationCombobox.js";
|
|
32
|
+
import { RelationGroupedCombobox as kt } from "./RelationGroupedCombobox.js";
|
|
33
|
+
import { RichTextEditor as Ft } from "./RichTextEditor.js";
|
|
34
|
+
function At({
|
|
34
35
|
plugin: e,
|
|
35
36
|
props: n
|
|
36
37
|
}) {
|
|
37
38
|
const l = J(null), m = J(void 0), y = J(n);
|
|
38
|
-
return y.current = n,
|
|
39
|
+
return y.current = n, oe(() => {
|
|
39
40
|
if (l.current)
|
|
40
41
|
return l.current.innerHTML = "", m.current = e.mount(l.current, y.current), () => {
|
|
41
42
|
var c, u;
|
|
42
43
|
(u = (c = m.current) == null ? void 0 : c.destroy) == null || u.call(c), m.current = void 0;
|
|
43
44
|
};
|
|
44
|
-
}, [e]),
|
|
45
|
+
}, [e]), oe(() => {
|
|
45
46
|
var c, u;
|
|
46
47
|
(u = (c = m.current) == null ? void 0 : c.update) == null || u.call(c, n);
|
|
47
48
|
}, [n]), /* @__PURE__ */ i("div", { ref: l, "data-custom-interface": e.interface });
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function ue(e) {
|
|
50
51
|
const n = e.validation_rules, l = Array.isArray(n) ? n : _(typeof n == "string" ? n : null);
|
|
51
52
|
if (!Array.isArray(l)) return {};
|
|
52
53
|
const m = (c) => {
|
|
@@ -61,7 +62,7 @@ function ce(e) {
|
|
|
61
62
|
}
|
|
62
63
|
return y;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
+
function sr({
|
|
65
66
|
field: e,
|
|
66
67
|
value: n,
|
|
67
68
|
onChange: l,
|
|
@@ -73,20 +74,20 @@ function ir({
|
|
|
73
74
|
narrowedBy: F,
|
|
74
75
|
onCountChange: d,
|
|
75
76
|
displayOnly: w,
|
|
76
|
-
prefillParentId:
|
|
77
|
+
prefillParentId: me,
|
|
77
78
|
pinnedOption: G
|
|
78
79
|
}) {
|
|
79
|
-
var
|
|
80
|
-
const j =
|
|
80
|
+
var U, C, Q, X, Z, O, ee, te, re;
|
|
81
|
+
const j = Te(), P = Xe(), A = Je(), H = Ee(He), D = A, f = (() => {
|
|
81
82
|
try {
|
|
82
|
-
return
|
|
83
|
+
return Ve();
|
|
83
84
|
} catch {
|
|
84
85
|
return null;
|
|
85
86
|
}
|
|
86
|
-
})(), s = e.interface ?? "", K = J(
|
|
87
|
+
})(), s = e.interface ?? "", K = J($e(s)).current;
|
|
87
88
|
if (K)
|
|
88
89
|
return /* @__PURE__ */ i(
|
|
89
|
-
|
|
90
|
+
At,
|
|
90
91
|
{
|
|
91
92
|
plugin: K,
|
|
92
93
|
props: {
|
|
@@ -102,7 +103,7 @@ function ir({
|
|
|
102
103
|
if (s === "file-image" || s === "file") {
|
|
103
104
|
const r = _(e.options);
|
|
104
105
|
return /* @__PURE__ */ i(
|
|
105
|
-
|
|
106
|
+
rt,
|
|
106
107
|
{
|
|
107
108
|
value: n,
|
|
108
109
|
onChange: l,
|
|
@@ -120,7 +121,7 @@ function ir({
|
|
|
120
121
|
const p = _(e.options);
|
|
121
122
|
if (p != null && p.group_field && (p != null && p.option_field))
|
|
122
123
|
return /* @__PURE__ */ i(
|
|
123
|
-
|
|
124
|
+
kt,
|
|
124
125
|
{
|
|
125
126
|
collection: N.one_collection,
|
|
126
127
|
value: n,
|
|
@@ -134,15 +135,15 @@ function ir({
|
|
|
134
135
|
}
|
|
135
136
|
);
|
|
136
137
|
}
|
|
137
|
-
const r = j && n != null && n !== "" ? V(e) : null, o = _(e.options), a =
|
|
138
|
+
const r = j && n != null && n !== "" ? V(e) : null, o = _(e.options), a = ne(
|
|
138
139
|
o != null && o.option_filter && typeof o.option_filter == "object" ? o.option_filter : void 0,
|
|
139
140
|
A == null ? void 0 : A.draft,
|
|
140
141
|
c
|
|
141
142
|
), t = a ? u ? { _and: [a, u] } : a : u, b = /* @__PURE__ */ i(
|
|
142
|
-
|
|
143
|
+
Nt,
|
|
143
144
|
{
|
|
144
145
|
fieldKey: e.field,
|
|
145
|
-
missPlacement: (
|
|
146
|
+
missPlacement: (P == null ? void 0 : P.layoutId) != null && P.pickerMisses !== !1 ? { layoutId: Number(P.layoutId), collection: y, field: e.field } : null,
|
|
146
147
|
collection: N.one_collection,
|
|
147
148
|
value: n,
|
|
148
149
|
onChange: l,
|
|
@@ -160,14 +161,14 @@ function ir({
|
|
|
160
161
|
// _and clause pruning) as option_filter, resolved from the same
|
|
161
162
|
// parent draft — keeps facet option lists in sync with the main
|
|
162
163
|
// option query's eligibility clauses.
|
|
163
|
-
filter: p.filter && typeof p.filter == "object" ?
|
|
164
|
+
filter: p.filter && typeof p.filter == "object" ? ne(p.filter, A == null ? void 0 : A.draft, c) : void 0
|
|
164
165
|
})) : void 0
|
|
165
166
|
}
|
|
166
167
|
), h = o != null && o.quick_create && Array.isArray(o.quick_create.fields) && !e.readonly ? o.quick_create : null;
|
|
167
168
|
return !r && !h ? b : /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
|
|
168
169
|
/* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: b }),
|
|
169
170
|
h && /* @__PURE__ */ i(
|
|
170
|
-
|
|
171
|
+
wt,
|
|
171
172
|
{
|
|
172
173
|
targetCollection: N.one_collection,
|
|
173
174
|
config: h,
|
|
@@ -186,7 +187,7 @@ function ir({
|
|
|
186
187
|
width: r.width
|
|
187
188
|
}),
|
|
188
189
|
className: "shrink-0 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-slate-800",
|
|
189
|
-
children: /* @__PURE__ */ i(
|
|
190
|
+
children: /* @__PURE__ */ i(Le, { className: "h-3.5 w-3.5" })
|
|
190
191
|
}
|
|
191
192
|
)
|
|
192
193
|
] });
|
|
@@ -206,7 +207,7 @@ function ir({
|
|
|
206
207
|
if (s === "files-m2m") {
|
|
207
208
|
const a = _(e.options);
|
|
208
209
|
return /* @__PURE__ */ i(
|
|
209
|
-
|
|
210
|
+
ot,
|
|
210
211
|
{
|
|
211
212
|
relation: E,
|
|
212
213
|
parentId: c,
|
|
@@ -220,7 +221,7 @@ function ir({
|
|
|
220
221
|
}
|
|
221
222
|
const r = _(e.options), o = typeof (r == null ? void 0 : r.option_sort) == "string" && r.option_sort ? r.option_sort : void 0;
|
|
222
223
|
return (r == null ? void 0 : r.max_values) === 1 ? /* @__PURE__ */ i(
|
|
223
|
-
|
|
224
|
+
st,
|
|
224
225
|
{
|
|
225
226
|
relation: E,
|
|
226
227
|
parentId: c,
|
|
@@ -232,7 +233,7 @@ function ir({
|
|
|
232
233
|
readOnly: w
|
|
233
234
|
}
|
|
234
235
|
) : /* @__PURE__ */ i(
|
|
235
|
-
|
|
236
|
+
ct,
|
|
236
237
|
{
|
|
237
238
|
relation: E,
|
|
238
239
|
parentId: c,
|
|
@@ -265,7 +266,7 @@ function ir({
|
|
|
265
266
|
}
|
|
266
267
|
) });
|
|
267
268
|
}
|
|
268
|
-
const r = (
|
|
269
|
+
const r = (U = e.options) == null ? void 0 : U.__live_delta;
|
|
269
270
|
if (r && Number.isFinite(Number(r.live))) {
|
|
270
271
|
const a = Number(r.original), t = Number(r.live) - (Number.isFinite(a) ? a : 0), b = Math.round(t * 100) / 100;
|
|
271
272
|
return /* @__PURE__ */ g("div", { className: "flex min-h-[36px] flex-wrap items-center gap-x-2 gap-y-0.5", children: [
|
|
@@ -284,29 +285,29 @@ function ir({
|
|
|
284
285
|
)
|
|
285
286
|
] });
|
|
286
287
|
}
|
|
287
|
-
if (s === "progress") return /* @__PURE__ */ i(
|
|
288
|
+
if (s === "progress") return /* @__PURE__ */ i(ae, { value: n, onChange: l, readOnly: !0 });
|
|
288
289
|
if (s === "rating") {
|
|
289
|
-
const a = (
|
|
290
|
-
return /* @__PURE__ */ i(
|
|
290
|
+
const a = (C = _(e.options)) == null ? void 0 : C.rating_max;
|
|
291
|
+
return /* @__PURE__ */ i(le, { value: n, onChange: l, max: a ?? 5, readOnly: !0 });
|
|
291
292
|
}
|
|
292
|
-
if (s === "duration") return /* @__PURE__ */ i(
|
|
293
|
-
if (s === "checklist") return /* @__PURE__ */ i(
|
|
293
|
+
if (s === "duration") return /* @__PURE__ */ i(Ze, { value: n });
|
|
294
|
+
if (s === "checklist") return /* @__PURE__ */ i(Oe, { value: n });
|
|
294
295
|
if (s === "color")
|
|
295
|
-
return /* @__PURE__ */ i(
|
|
296
|
-
if (s === "phone") return /* @__PURE__ */ i(
|
|
297
|
-
const o = n == null ? /* @__PURE__ */ i("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof n == "boolean" ? /* @__PURE__ */ i(
|
|
296
|
+
return /* @__PURE__ */ i(se, { field: e, value: n, onChange: l, readOnly: !0 });
|
|
297
|
+
if (s === "phone") return /* @__PURE__ */ i(ce, { value: n, onChange: l, readOnly: !0 });
|
|
298
|
+
const o = n == null ? /* @__PURE__ */ i("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof n == "boolean" ? /* @__PURE__ */ i(Ye, { variant: n ? "default" : "secondary", children: n ? "Yes" : "No" }) : /* @__PURE__ */ i("span", { className: "text-sm tabular-nums", children: L(n, e) });
|
|
298
299
|
return /* @__PURE__ */ i("div", { className: "min-h-[36px] flex items-center", children: o });
|
|
299
300
|
}
|
|
300
301
|
const x = n == null ? "" : String(n);
|
|
301
302
|
if (e.type === "boolean")
|
|
302
303
|
return /* @__PURE__ */ g("div", { className: "flex items-center gap-2", children: [
|
|
303
|
-
/* @__PURE__ */ i(
|
|
304
|
-
/* @__PURE__ */ i(
|
|
304
|
+
/* @__PURE__ */ i(Ce, { checked: !!n, onCheckedChange: l }),
|
|
305
|
+
/* @__PURE__ */ i(ze, { className: "font-normal text-sm", children: n ? "Yes" : "No" })
|
|
305
306
|
] });
|
|
306
307
|
if (e.type === "datetime" || s === "datetime") {
|
|
307
308
|
const r = _(e.options);
|
|
308
309
|
if ((r == null ? void 0 : r.date_mode) === "date") {
|
|
309
|
-
const o =
|
|
310
|
+
const o = ue(e);
|
|
310
311
|
return /* @__PURE__ */ i(
|
|
311
312
|
B,
|
|
312
313
|
{
|
|
@@ -323,14 +324,14 @@ function ir({
|
|
|
323
324
|
B,
|
|
324
325
|
{
|
|
325
326
|
type: "datetime-local",
|
|
326
|
-
value:
|
|
327
|
+
value: nt(n),
|
|
327
328
|
onChange: (o) => l(o.target.value ? new Date(o.target.value).toISOString() : null),
|
|
328
329
|
placeholder: e.placeholder ?? void 0
|
|
329
330
|
}
|
|
330
331
|
);
|
|
331
332
|
}
|
|
332
333
|
if (e.type === "date" || s === "date") {
|
|
333
|
-
const r = ((
|
|
334
|
+
const r = ((Q = _(e.options)) == null ? void 0 : Q.countdown) === !0, o = ue(e);
|
|
334
335
|
return /* @__PURE__ */ g("div", { className: "flex items-center", children: [
|
|
335
336
|
/* @__PURE__ */ i(
|
|
336
337
|
B,
|
|
@@ -341,14 +342,14 @@ function ir({
|
|
|
341
342
|
max: o.max,
|
|
342
343
|
onChange: (a) => l(a.target.value || null),
|
|
343
344
|
onPaste: (a) => {
|
|
344
|
-
const t =
|
|
345
|
+
const t = mt(a.clipboardData.getData("text"));
|
|
345
346
|
t && (a.preventDefault(), l(t));
|
|
346
347
|
},
|
|
347
348
|
placeholder: e.placeholder ?? void 0,
|
|
348
349
|
className: "flex-1"
|
|
349
350
|
}
|
|
350
351
|
),
|
|
351
|
-
r && /* @__PURE__ */ i(
|
|
352
|
+
r && /* @__PURE__ */ i(pt, { value: x.slice(0, 10) })
|
|
352
353
|
] });
|
|
353
354
|
}
|
|
354
355
|
if ([
|
|
@@ -369,7 +370,7 @@ function ir({
|
|
|
369
370
|
].includes(e.type)) {
|
|
370
371
|
const r = ["integer", "bigInteger", "int", "bigint", "smallint", "tinyint"].includes(
|
|
371
372
|
e.type
|
|
372
|
-
), o = r ? 0 :
|
|
373
|
+
), o = r ? 0 : Ge(e.options, -1), a = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = lt(n, { type: e.type, label: e.label || "Value" }), b = t.ok ? null : t.message;
|
|
373
374
|
return /* @__PURE__ */ g("div", { children: [
|
|
374
375
|
/* @__PURE__ */ i(
|
|
375
376
|
B,
|
|
@@ -414,6 +415,7 @@ function ir({
|
|
|
414
415
|
$,
|
|
415
416
|
{
|
|
416
417
|
rows: 4,
|
|
418
|
+
maxLength: ie(e) ?? void 0,
|
|
417
419
|
value: x,
|
|
418
420
|
onChange: (r) => l(r.target.value),
|
|
419
421
|
placeholder: e.placeholder ?? void 0
|
|
@@ -432,13 +434,13 @@ function ir({
|
|
|
432
434
|
);
|
|
433
435
|
if (s === "input-rich-text-html" || s === "rich_text" || e.type === "rich_text" || s === "extension-editorjs")
|
|
434
436
|
return /* @__PURE__ */ i(
|
|
435
|
-
|
|
437
|
+
Ft,
|
|
436
438
|
{
|
|
437
439
|
value: x,
|
|
438
440
|
onChange: l,
|
|
439
441
|
placeholder: e.placeholder ?? void 0,
|
|
440
442
|
disabled: e.readonly,
|
|
441
|
-
pastePlain: ((
|
|
443
|
+
pastePlain: ((X = _(e.options)) == null ? void 0 : X.paste_plain) === !0
|
|
442
444
|
}
|
|
443
445
|
);
|
|
444
446
|
if (s === "inline-grid" || s === "relation-list" || s === "list-o2m") {
|
|
@@ -456,7 +458,7 @@ function ir({
|
|
|
456
458
|
}
|
|
457
459
|
})() : e.options ?? {}).layout_slug ?? null;
|
|
458
460
|
return /* @__PURE__ */ i(
|
|
459
|
-
|
|
461
|
+
it,
|
|
460
462
|
{
|
|
461
463
|
relatedCollection: o,
|
|
462
464
|
manyField: a,
|
|
@@ -483,10 +485,10 @@ function ir({
|
|
|
483
485
|
} catch {
|
|
484
486
|
return {};
|
|
485
487
|
}
|
|
486
|
-
})() : e.options ?? {}, b = t.layout_id ?? null, h = !!t.show_row_revisions, p = !!t.row_comments, q = t.allow_revision_restore !== !1,
|
|
488
|
+
})() : e.options ?? {}, b = t.layout_id ?? null, h = !!t.show_row_revisions, p = !!t.row_comments, q = t.allow_revision_restore !== !1, pe = t.save_mode ?? "immediate", ye = !!t.show_line_numbers, _e = t.enable_reorder !== !1, fe = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, be = Array.isArray(t.row_rules) ? t.row_rules : void 0, xe = Array.isArray(t.column_presets) ? t.column_presets : void 0, he = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, ge = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, ve = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, we = Array.isArray(t.unique_by) ? t.unique_by : void 0, Ne = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, ke = t.sort_dir === "desc" ? "desc" : "asc", Fe = t.freeze_first_column === !0, Ae = 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, Re = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, je = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, De = Array.isArray(t.row_bulk_actions) ? t.row_bulk_actions : void 0, Ie = typeof t.upload_template == "string" && t.upload_template ? t.upload_template : void 0, Pe = t.row_match_panel ?? void 0, Me = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Be = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, S = t.membership_set;
|
|
487
489
|
if (S != null && S.key_field && (S != null && S.value_field))
|
|
488
490
|
return /* @__PURE__ */ i(
|
|
489
|
-
|
|
491
|
+
dt,
|
|
490
492
|
{
|
|
491
493
|
relatedCollection: o,
|
|
492
494
|
manyField: a,
|
|
@@ -498,7 +500,7 @@ function ir({
|
|
|
498
500
|
const R = t.catalog_mode;
|
|
499
501
|
if (R != null && R.item_field && (R != null && R.section_by))
|
|
500
502
|
return /* @__PURE__ */ i(
|
|
501
|
-
|
|
503
|
+
Qe,
|
|
502
504
|
{
|
|
503
505
|
relatedCollection: o,
|
|
504
506
|
manyField: a,
|
|
@@ -512,7 +514,7 @@ function ir({
|
|
|
512
514
|
if (k != null && k.key_field && (k != null && k.category_field) && Array.isArray(k.value_fields)) {
|
|
513
515
|
const T = t.spread_remaining;
|
|
514
516
|
return /* @__PURE__ */ i(
|
|
515
|
-
|
|
517
|
+
ut,
|
|
516
518
|
{
|
|
517
519
|
relatedCollection: o,
|
|
518
520
|
manyField: a,
|
|
@@ -529,7 +531,7 @@ function ir({
|
|
|
529
531
|
);
|
|
530
532
|
}
|
|
531
533
|
return /* @__PURE__ */ i(
|
|
532
|
-
|
|
534
|
+
at,
|
|
533
535
|
{
|
|
534
536
|
relatedCollection: o,
|
|
535
537
|
manyField: a,
|
|
@@ -539,27 +541,27 @@ function ir({
|
|
|
539
541
|
showRowRevisions: h,
|
|
540
542
|
rowComments: p,
|
|
541
543
|
allowRevisionRestore: q,
|
|
542
|
-
saveMode:
|
|
543
|
-
showLineNumbers:
|
|
544
|
-
enableReorder:
|
|
545
|
-
parentCascades:
|
|
546
|
-
rowRules:
|
|
547
|
-
columnPresets:
|
|
548
|
-
defaultPreset:
|
|
549
|
-
drawerRelations:
|
|
550
|
-
parentContextFields:
|
|
551
|
-
uniqueBy:
|
|
552
|
-
sortField:
|
|
553
|
-
sortDir:
|
|
554
|
-
sectionGroupBy:
|
|
555
|
-
freezeFirstColumn:
|
|
556
|
-
rowFilter:
|
|
557
|
-
rowDefaults:
|
|
558
|
-
allocateDrawer:
|
|
559
|
-
autoAllocate:
|
|
560
|
-
rowBulkActions:
|
|
561
|
-
uploadTemplate:
|
|
562
|
-
rowMatchPanel:
|
|
544
|
+
saveMode: pe,
|
|
545
|
+
showLineNumbers: ye,
|
|
546
|
+
enableReorder: _e,
|
|
547
|
+
parentCascades: fe,
|
|
548
|
+
rowRules: be,
|
|
549
|
+
columnPresets: xe,
|
|
550
|
+
defaultPreset: he,
|
|
551
|
+
drawerRelations: ge,
|
|
552
|
+
parentContextFields: ve,
|
|
553
|
+
uniqueBy: we,
|
|
554
|
+
sortField: Ne,
|
|
555
|
+
sortDir: ke,
|
|
556
|
+
sectionGroupBy: Ae,
|
|
557
|
+
freezeFirstColumn: Fe,
|
|
558
|
+
rowFilter: Se,
|
|
559
|
+
rowDefaults: Me,
|
|
560
|
+
allocateDrawer: Re,
|
|
561
|
+
autoAllocate: je,
|
|
562
|
+
rowBulkActions: De,
|
|
563
|
+
uploadTemplate: Ie,
|
|
564
|
+
rowMatchPanel: Pe,
|
|
563
565
|
lineSla: t.line_sla ?? null,
|
|
564
566
|
editorMode: t.editor_mode === "split" ? "split" : "drawer",
|
|
565
567
|
rowLints: Array.isArray(t.row_lints) ? t.row_lints : null,
|
|
@@ -567,8 +569,8 @@ function ir({
|
|
|
567
569
|
sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
|
|
568
570
|
spreadRemaining: t.spread_remaining && typeof t.spread_remaining == "object" ? t.spread_remaining : null,
|
|
569
571
|
compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
|
|
570
|
-
submissionErrors:
|
|
571
|
-
prefillParentId:
|
|
572
|
+
submissionErrors: Be,
|
|
573
|
+
prefillParentId: me,
|
|
572
574
|
parentFieldKey: e.field,
|
|
573
575
|
readOnly: e.readonly,
|
|
574
576
|
emptyLabel: e.label || void 0
|
|
@@ -578,19 +580,19 @@ function ir({
|
|
|
578
580
|
}
|
|
579
581
|
return /* @__PURE__ */ i("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline table editing not available in embedded form" });
|
|
580
582
|
}
|
|
581
|
-
if (s === "color") return /* @__PURE__ */ i(
|
|
583
|
+
if (s === "color") return /* @__PURE__ */ i(se, { field: e, value: n, onChange: l });
|
|
582
584
|
if (s === "rating") {
|
|
583
|
-
const r = (
|
|
584
|
-
return /* @__PURE__ */ i(
|
|
585
|
+
const r = (Z = _(e.options)) == null ? void 0 : Z.rating_max;
|
|
586
|
+
return /* @__PURE__ */ i(le, { value: n, onChange: l, max: r ?? 5 });
|
|
585
587
|
}
|
|
586
|
-
if (s === "progress") return /* @__PURE__ */ i(
|
|
588
|
+
if (s === "progress") return /* @__PURE__ */ i(ae, { value: n, onChange: l });
|
|
587
589
|
if (s === "phone")
|
|
588
|
-
return /* @__PURE__ */ i(
|
|
590
|
+
return /* @__PURE__ */ i(ce, { value: n, onChange: l, placeholder: e.placeholder ?? void 0 });
|
|
589
591
|
if (s === "email")
|
|
590
|
-
return /* @__PURE__ */ i(
|
|
592
|
+
return /* @__PURE__ */ i(et, { value: n, onChange: l, placeholder: e.placeholder ?? void 0 });
|
|
591
593
|
if (s === "address-autocomplete")
|
|
592
594
|
return /* @__PURE__ */ i(
|
|
593
|
-
|
|
595
|
+
tt,
|
|
594
596
|
{
|
|
595
597
|
field: e,
|
|
596
598
|
value: n,
|
|
@@ -601,38 +603,38 @@ function ir({
|
|
|
601
603
|
placeholder: e.placeholder ?? void 0
|
|
602
604
|
}
|
|
603
605
|
);
|
|
604
|
-
if (s === "duration") return /* @__PURE__ */ i(
|
|
605
|
-
if (s === "fiscal_period") return /* @__PURE__ */ i(
|
|
606
|
-
if (s === "checklist") return /* @__PURE__ */ i(
|
|
606
|
+
if (s === "duration") return /* @__PURE__ */ i(yt, { value: n, onChange: l });
|
|
607
|
+
if (s === "fiscal_period") return /* @__PURE__ */ i(_t, { value: n, onChange: l });
|
|
608
|
+
if (s === "checklist") return /* @__PURE__ */ i(ft, { value: n, onChange: l });
|
|
607
609
|
if (s === "repeater" || e.repeater_schema && e.type === "json")
|
|
608
|
-
return /* @__PURE__ */ i(
|
|
610
|
+
return /* @__PURE__ */ i(bt, { field: e, value: n, onChange: l });
|
|
609
611
|
if (s === "range_slider") {
|
|
610
|
-
const r = (
|
|
612
|
+
const r = (O = _(e.options)) == null ? void 0 : O.range_end_field;
|
|
611
613
|
return /* @__PURE__ */ i(
|
|
612
|
-
|
|
614
|
+
xt,
|
|
613
615
|
{
|
|
614
616
|
field: e,
|
|
615
617
|
value: n,
|
|
616
618
|
onChange: l,
|
|
617
|
-
pairedValue: r ? (
|
|
619
|
+
pairedValue: r ? (ee = D == null ? void 0 : D.draft) == null ? void 0 : ee[r] : void 0
|
|
618
620
|
}
|
|
619
621
|
);
|
|
620
622
|
}
|
|
621
623
|
if (s === "date_range") {
|
|
622
|
-
const r = (
|
|
624
|
+
const r = (te = _(e.options)) == null ? void 0 : te.range_end_field;
|
|
623
625
|
return /* @__PURE__ */ i(
|
|
624
|
-
|
|
626
|
+
ht,
|
|
625
627
|
{
|
|
626
628
|
field: e,
|
|
627
629
|
value: n,
|
|
628
630
|
onChange: l,
|
|
629
|
-
pairedValue: r ? (
|
|
631
|
+
pairedValue: r ? (re = D == null ? void 0 : D.draft) == null ? void 0 : re[r] : void 0
|
|
630
632
|
}
|
|
631
633
|
);
|
|
632
634
|
}
|
|
633
635
|
if (s === "address")
|
|
634
636
|
return /* @__PURE__ */ i(
|
|
635
|
-
|
|
637
|
+
gt,
|
|
636
638
|
{
|
|
637
639
|
field: e,
|
|
638
640
|
value: n,
|
|
@@ -642,7 +644,7 @@ function ir({
|
|
|
642
644
|
}
|
|
643
645
|
);
|
|
644
646
|
if (s === "tags")
|
|
645
|
-
return /* @__PURE__ */ i(
|
|
647
|
+
return /* @__PURE__ */ i(St, { field: e, value: n, onChange: l });
|
|
646
648
|
if (s === "select-dropdown" || s === "radio-buttons") {
|
|
647
649
|
const r = (() => {
|
|
648
650
|
const o = _(e.options);
|
|
@@ -650,42 +652,43 @@ function ir({
|
|
|
650
652
|
})();
|
|
651
653
|
if (r.length > 0)
|
|
652
654
|
return /* @__PURE__ */ i(
|
|
653
|
-
|
|
655
|
+
Ue,
|
|
654
656
|
{
|
|
655
657
|
value: x,
|
|
656
658
|
onChange: (o) => l(o || null),
|
|
657
659
|
options: [
|
|
658
660
|
{ value: "", label: "— Select —" },
|
|
659
|
-
...r.map((o) => ({ value: o.value, label:
|
|
661
|
+
...r.map((o) => ({ value: o.value, label: We(o.text) }))
|
|
660
662
|
],
|
|
661
663
|
ariaLabel: e.label ?? e.field,
|
|
662
664
|
className: "h-9 rounded-md text-sm"
|
|
663
665
|
}
|
|
664
666
|
);
|
|
665
667
|
}
|
|
666
|
-
const
|
|
668
|
+
const I = vt(e), Y = ie(e), M = (() => {
|
|
667
669
|
const r = _(e.options);
|
|
668
670
|
if (Number.isFinite(Number(r == null ? void 0 : r.max_length))) return Number(r == null ? void 0 : r.max_length);
|
|
669
671
|
const o = _(e.validation_rules), a = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
|
|
670
|
-
return a && Number.isFinite(Number(a.value)) ? Number(a.value) :
|
|
671
|
-
})(),
|
|
672
|
+
return a && Number.isFinite(Number(a.value)) ? Number(a.value) : Y;
|
|
673
|
+
})(), z = /* @__PURE__ */ i(
|
|
672
674
|
B,
|
|
673
675
|
{
|
|
674
|
-
|
|
676
|
+
maxLength: I ? void 0 : Y ?? void 0,
|
|
677
|
+
value: I ? de(I, x).display : x,
|
|
675
678
|
onChange: (r) => {
|
|
676
|
-
if (
|
|
677
|
-
const { clean: o } =
|
|
679
|
+
if (I) {
|
|
680
|
+
const { clean: o } = de(I, r.target.value);
|
|
678
681
|
l(o || null);
|
|
679
682
|
} else
|
|
680
683
|
l(r.target.value || null);
|
|
681
684
|
},
|
|
682
|
-
placeholder: e.placeholder ??
|
|
685
|
+
placeholder: e.placeholder ?? I ?? void 0
|
|
683
686
|
}
|
|
684
687
|
);
|
|
685
|
-
if (M != null && M > 0 &&
|
|
688
|
+
if (M != null && M > 0 && !Ke(e._overrides)) {
|
|
686
689
|
const r = x.length;
|
|
687
690
|
return /* @__PURE__ */ g("div", { children: [
|
|
688
|
-
|
|
691
|
+
z,
|
|
689
692
|
r >= M * 0.6 && /* @__PURE__ */ g(
|
|
690
693
|
"p",
|
|
691
694
|
{
|
|
@@ -699,14 +702,14 @@ function ir({
|
|
|
699
702
|
)
|
|
700
703
|
] });
|
|
701
704
|
}
|
|
702
|
-
return
|
|
705
|
+
return z;
|
|
703
706
|
}
|
|
704
|
-
function
|
|
707
|
+
function St({
|
|
705
708
|
field: e,
|
|
706
709
|
value: n,
|
|
707
710
|
onChange: l
|
|
708
711
|
}) {
|
|
709
|
-
const [m, y] =
|
|
712
|
+
const [m, y] = qe(""), c = (() => {
|
|
710
713
|
if (Array.isArray(n)) return n.map(String);
|
|
711
714
|
if (typeof n == "string" && n.trim().startsWith("["))
|
|
712
715
|
try {
|
|
@@ -775,6 +778,6 @@ function Ft({
|
|
|
775
778
|
] });
|
|
776
779
|
}
|
|
777
780
|
export {
|
|
778
|
-
|
|
779
|
-
|
|
781
|
+
sr as FieldRenderer,
|
|
782
|
+
ne as resolveOptionFilterTokens
|
|
780
783
|
};
|