@nivaro/react 0.3.49 → 0.3.51
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 +38 -4
- package/dist/shared/components/ItemEditForm.js +5258 -5034
- package/dist/shared/components/QueryTable.js +489 -347
- package/dist/shared/components/ReportView.js +105 -99
- package/dist/shared/components/alerts/AlertManagerView.js +327 -301
- package/dist/shared/components/item-edit/CatalogPickerField.js +1230 -1175
- package/dist/shared/components/item-edit/CloneDialog.js +192 -142
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +58 -53
- package/dist/shared/components/item-edit/FieldRenderer.js +249 -244
- package/dist/shared/components/item-edit/FieldRow.js +402 -370
- package/dist/shared/components/item-edit/FilePickerField.js +315 -307
- package/dist/shared/components/item-edit/InlineGridField.js +92 -90
- package/dist/shared/components/item-edit/InlineTableField.js +3119 -2951
- 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/RecordHeaderActions.js +76 -75
- package/dist/shared/components/item-edit/RecordLiveSync.js +93 -91
- package/dist/shared/components/item-edit/RelationCombobox.js +198 -191
- package/dist/shared/components/item-edit/SummaryPanel.js +282 -259
- package/dist/shared/components/item-edit/UserChip.js +233 -200
- package/dist/shared/components/item-edit/ValidationSummary.js +64 -47
- package/dist/shared/components/item-edit/header-midair.js +51 -0
- package/dist/shared/components/item-edit/helpers.js +181 -155
- package/dist/shared/components/item-edit/line-midair.js +207 -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/CommentPanel.js +290 -284
- package/dist/shared/components/panels/ItemLockBanner.js +414 -358
- package/dist/shared/components/panels/PipelinePanel.js +1241 -992
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/panels/TaskPanel.js +71 -61
- package/dist/shared/components/panels/TransitionRequirementsDialog.js +569 -439
- package/dist/shared/components/panels/requirement-side-effects.js +40 -0
- package/dist/shared/components/queue/QueueWorklist.js +925 -871
- 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/draft-store.js +48 -34
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/query-stats.js +60 -60
- package/package.json +1 -1
|
@@ -1,56 +1,57 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { ExternalLink as
|
|
3
|
-
import { memo 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
|
|
11
|
-
import { Input as
|
|
1
|
+
import { jsx as n, jsxs as x } from "react/jsx-runtime";
|
|
2
|
+
import { ExternalLink as qe } from "lucide-react";
|
|
3
|
+
import { memo as Te, useContext as Je, useRef as J, useEffect as oe, useState as He } from "react";
|
|
4
|
+
import { useDrilldown as Ve, useParentDraft as $e, RelationPathDataContext as Ge, useApiFetchConfig as Ke, fieldDrilldownConfig as V } from "../../context.js";
|
|
5
|
+
import { getFieldInterface as We } from "../../lib/field-interfaces.js";
|
|
6
|
+
import { precisionOf as Ye } from "../../lib/format-value.js";
|
|
7
|
+
import { resolveOptionFilterTokens as ne } from "../../lib/option-filter-tokens.js";
|
|
8
|
+
import { counterOf as ze } from "../../lib/placement-behaviour.js";
|
|
9
|
+
import { choiceLabel as Ue } from "../../lib/utils.js";
|
|
10
|
+
import { Badge as Qe } from "../ui/badge.js";
|
|
11
|
+
import { Input as T } from "../ui/input.js";
|
|
12
12
|
import { Label as Ce } from "../ui/label.js";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { NumberDraftInput as Xe } from "../ui/number-draft-input.js";
|
|
14
|
+
import { SimpleSelect as Ze } from "../ui/SimpleSelect.js";
|
|
15
|
+
import { Switch as Oe } from "../ui/switch.js";
|
|
15
16
|
import { Textarea as $ } from "../ui/textarea.js";
|
|
16
|
-
import { CatalogPickerField as
|
|
17
|
-
import { columnMaxLength as
|
|
18
|
-
import { useFieldAffordances as
|
|
19
|
-
import { ProgressField 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
|
|
35
|
-
plugin:
|
|
17
|
+
import { CatalogPickerField as et } from "./CatalogPickerField.js";
|
|
18
|
+
import { columnMaxLength as me } from "./column-length.js";
|
|
19
|
+
import { useFieldAffordances as tt } from "./FieldAffordances.js";
|
|
20
|
+
import { ProgressField as ie, RatingScaleField as ae, DurationReadOnly as rt, ChecklistReadOnly as ot, ColorPackField as le, PhoneField as se, EmailField as nt, AddressAutocompleteField as it } from "./FieldPack.js";
|
|
21
|
+
import { FilePickerField as at, FileM2MField as lt } from "./FilePickerField.js";
|
|
22
|
+
import { formatDisplayValue as B } from "./GroupSection.js";
|
|
23
|
+
import { parseJson as y, toLocalDatetime as st } from "./helpers.js";
|
|
24
|
+
import { InlineGridField as ct } from "./InlineGridField.js";
|
|
25
|
+
import { InlineTableField as dt } from "./InlineTableField.js";
|
|
26
|
+
import { checkNumberEntry as ut } from "./line-qty.js";
|
|
27
|
+
import { M2MSingleSelectCombobox as mt, M2MCombobox as pt } from "./M2MCombobox.js";
|
|
28
|
+
import { MembershipSetField as yt } from "./MembershipSetField.js";
|
|
29
|
+
import { PlanGridField as _t } from "./PlanGrid.js";
|
|
30
|
+
import { smartParseDate as ft, CountdownChip as bt, DurationField as xt, FiscalPeriodField as ht, ChecklistField as gt, RepeaterField as vt, RangeSliderField as wt, DateRangeField as Nt, AddressField as kt, maskFor as Ft, applyInputMask as ce } from "./PolishFields.js";
|
|
31
|
+
import { QuickCreateButton as At } from "./QuickCreateButton.js";
|
|
32
|
+
import { RelationCombobox as Rt } from "./RelationCombobox.js";
|
|
33
|
+
import { RelationGroupedCombobox as St } from "./RelationGroupedCombobox.js";
|
|
34
|
+
import { RichTextEditor as jt } from "./RichTextEditor.js";
|
|
35
|
+
function Dt({
|
|
36
|
+
plugin: h,
|
|
36
37
|
props: e
|
|
37
38
|
}) {
|
|
38
|
-
const i = J(null),
|
|
39
|
-
return p.current = e,
|
|
39
|
+
const i = J(null), a = J(void 0), p = J(e);
|
|
40
|
+
return p.current = e, oe(() => {
|
|
40
41
|
if (i.current)
|
|
41
|
-
return i.current.innerHTML = "",
|
|
42
|
+
return i.current.innerHTML = "", a.current = h.mount(i.current, p.current), () => {
|
|
42
43
|
var c, d;
|
|
43
|
-
(d = (c =
|
|
44
|
+
(d = (c = a.current) == null ? void 0 : c.destroy) == null || d.call(c), a.current = void 0;
|
|
44
45
|
};
|
|
45
|
-
}, [
|
|
46
|
+
}, [h]), oe(() => {
|
|
46
47
|
var c, d;
|
|
47
|
-
(d = (c =
|
|
48
|
-
}, [e]), /* @__PURE__ */ n("div", { ref: i, "data-custom-interface":
|
|
48
|
+
(d = (c = a.current) == null ? void 0 : c.update) == null || d.call(c, e);
|
|
49
|
+
}, [e]), /* @__PURE__ */ n("div", { ref: i, "data-custom-interface": h.interface });
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
-
const e =
|
|
51
|
+
function de(h) {
|
|
52
|
+
const e = h.validation_rules, i = Array.isArray(e) ? e : y(typeof e == "string" ? e : null);
|
|
52
53
|
if (!Array.isArray(i)) return {};
|
|
53
|
-
const
|
|
54
|
+
const a = (c) => {
|
|
54
55
|
const d = /* @__PURE__ */ new Date();
|
|
55
56
|
d.setDate(d.getDate() + c);
|
|
56
57
|
const b = (v) => String(v).padStart(2, "0");
|
|
@@ -58,14 +59,18 @@ function me(w) {
|
|
|
58
59
|
}, p = {};
|
|
59
60
|
for (const c of i) {
|
|
60
61
|
const d = Number(c == null ? void 0 : c.value);
|
|
61
|
-
Number.isFinite(d) && ((c == null ? void 0 : c.type) === "min_days_from_today" && (p.min =
|
|
62
|
+
Number.isFinite(d) && ((c == null ? void 0 : c.type) === "min_days_from_today" && (p.min = a(d)), (c == null ? void 0 : c.type) === "max_days_from_today" && (p.max = a(d)));
|
|
62
63
|
}
|
|
63
64
|
return p;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
function ue(h) {
|
|
67
|
+
const e = me(h), i = y(h.options), a = Number(i == null ? void 0 : i.max_length);
|
|
68
|
+
return Number.isFinite(a) && a > 0 ? e != null ? Math.min(e, a) : a : e ?? void 0;
|
|
69
|
+
}
|
|
70
|
+
const pr = Te(function({
|
|
66
71
|
field: e,
|
|
67
72
|
value: i,
|
|
68
|
-
onChange:
|
|
73
|
+
onChange: a,
|
|
69
74
|
relations: p,
|
|
70
75
|
collection: c,
|
|
71
76
|
itemId: d,
|
|
@@ -77,22 +82,22 @@ const dr = qe(function({
|
|
|
77
82
|
prefillParentId: pe,
|
|
78
83
|
pinnedOption: K
|
|
79
84
|
}) {
|
|
80
|
-
var
|
|
81
|
-
const j =
|
|
85
|
+
var U, Q, C, X, Z, O, ee, te, re;
|
|
86
|
+
const j = Ve(), M = tt(), A = $e(), H = Je(Ge), D = A, _ = (() => {
|
|
82
87
|
try {
|
|
83
|
-
return
|
|
88
|
+
return Ke();
|
|
84
89
|
} catch {
|
|
85
90
|
return null;
|
|
86
91
|
}
|
|
87
|
-
})(), s = e.interface ?? "", W = J(
|
|
92
|
+
})(), s = e.interface ?? "", W = J(We(s)).current;
|
|
88
93
|
if (W)
|
|
89
94
|
return /* @__PURE__ */ n(
|
|
90
|
-
|
|
95
|
+
Dt,
|
|
91
96
|
{
|
|
92
97
|
plugin: W,
|
|
93
98
|
props: {
|
|
94
99
|
value: i,
|
|
95
|
-
onChange:
|
|
100
|
+
onChange: a,
|
|
96
101
|
field: { field: e.field, label: e.label, options: e.options },
|
|
97
102
|
readOnly: !!e.readonly || !!G,
|
|
98
103
|
collection: c,
|
|
@@ -103,10 +108,10 @@ const dr = qe(function({
|
|
|
103
108
|
if (s === "file-image" || s === "file") {
|
|
104
109
|
const r = y(e.options);
|
|
105
110
|
return /* @__PURE__ */ n(
|
|
106
|
-
|
|
111
|
+
at,
|
|
107
112
|
{
|
|
108
113
|
value: i,
|
|
109
|
-
onChange:
|
|
114
|
+
onChange: a,
|
|
110
115
|
disabled: e.readonly,
|
|
111
116
|
allowUpload: (r == null ? void 0 : r.allow_upload) !== !1,
|
|
112
117
|
allowPick: (r == null ? void 0 : r.allow_pick) !== !1
|
|
@@ -121,11 +126,11 @@ const dr = qe(function({
|
|
|
121
126
|
const m = y(e.options);
|
|
122
127
|
if (m != null && m.group_field && (m != null && m.option_field))
|
|
123
128
|
return /* @__PURE__ */ n(
|
|
124
|
-
|
|
129
|
+
St,
|
|
125
130
|
{
|
|
126
131
|
collection: k.one_collection,
|
|
127
132
|
value: i,
|
|
128
|
-
onChange:
|
|
133
|
+
onChange: a,
|
|
129
134
|
groupField: m.group_field,
|
|
130
135
|
optionField: m.option_field,
|
|
131
136
|
disabled: e.readonly,
|
|
@@ -135,18 +140,18 @@ const dr = qe(function({
|
|
|
135
140
|
}
|
|
136
141
|
);
|
|
137
142
|
}
|
|
138
|
-
const r = j && i != null && i !== "" ? V(e) : null, o = y(e.options),
|
|
143
|
+
const r = j && i != null && i !== "" ? V(e) : null, o = y(e.options), l = ne(
|
|
139
144
|
o != null && o.option_filter && typeof o.option_filter == "object" ? o.option_filter : void 0,
|
|
140
145
|
A == null ? void 0 : A.draft,
|
|
141
146
|
d
|
|
142
|
-
), t =
|
|
143
|
-
|
|
147
|
+
), t = l ? b ? { _and: [l, b] } : l : b, f = /* @__PURE__ */ n(
|
|
148
|
+
Rt,
|
|
144
149
|
{
|
|
145
150
|
fieldKey: e.field,
|
|
146
|
-
missPlacement: (
|
|
151
|
+
missPlacement: (M == null ? void 0 : M.layoutId) != null && M.pickerMisses !== !1 ? { layoutId: Number(M.layoutId), collection: c, field: e.field } : null,
|
|
147
152
|
collection: k.one_collection,
|
|
148
153
|
value: i,
|
|
149
|
-
onChange:
|
|
154
|
+
onChange: a,
|
|
150
155
|
disabled: e.readonly,
|
|
151
156
|
placeholder: e.placeholder ?? void 0,
|
|
152
157
|
extraFilter: t,
|
|
@@ -161,18 +166,18 @@ const dr = qe(function({
|
|
|
161
166
|
// _and clause pruning) as option_filter, resolved from the same
|
|
162
167
|
// parent draft — keeps facet option lists in sync with the main
|
|
163
168
|
// option query's eligibility clauses.
|
|
164
|
-
filter: m.filter && typeof m.filter == "object" ?
|
|
169
|
+
filter: m.filter && typeof m.filter == "object" ? ne(m.filter, A == null ? void 0 : A.draft, d) : void 0
|
|
165
170
|
})) : void 0
|
|
166
171
|
}
|
|
167
|
-
),
|
|
168
|
-
return !r && !
|
|
172
|
+
), w = o != null && o.quick_create && Array.isArray(o.quick_create.fields) && !e.readonly ? o.quick_create : null;
|
|
173
|
+
return !r && !w ? f : /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
169
174
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: f }),
|
|
170
|
-
|
|
171
|
-
|
|
175
|
+
w && /* @__PURE__ */ n(
|
|
176
|
+
At,
|
|
172
177
|
{
|
|
173
178
|
targetCollection: k.one_collection,
|
|
174
|
-
config:
|
|
175
|
-
onCreated: (m) =>
|
|
179
|
+
config: w,
|
|
180
|
+
onCreated: (m) => a(m)
|
|
176
181
|
}
|
|
177
182
|
),
|
|
178
183
|
r && /* @__PURE__ */ n(
|
|
@@ -187,43 +192,43 @@ const dr = qe(function({
|
|
|
187
192
|
width: r.width
|
|
188
193
|
}),
|
|
189
194
|
className: "shrink-0 rounded p-1 text-slate-400 hover:bg-slate-100 hover:text-nvr-cyan dark:hover:bg-slate-800",
|
|
190
|
-
children: /* @__PURE__ */ n(
|
|
195
|
+
children: /* @__PURE__ */ n(qe, { className: "h-3.5 w-3.5" })
|
|
191
196
|
}
|
|
192
197
|
)
|
|
193
198
|
] });
|
|
194
199
|
}
|
|
195
|
-
const
|
|
200
|
+
const L = Y && !k ? (() => {
|
|
196
201
|
const r = p.find(
|
|
197
|
-
(
|
|
202
|
+
(l) => l.one_collection === c && (l.one_field === e.field || l.junction_field != null && l.many_collection === e.field)
|
|
198
203
|
);
|
|
199
204
|
if (!r) return null;
|
|
200
205
|
if (r.junction_field) return r;
|
|
201
206
|
const o = p.find(
|
|
202
|
-
(
|
|
207
|
+
(l) => l.many_collection === r.many_collection && l.id !== r.id
|
|
203
208
|
);
|
|
204
209
|
return o ? { ...r, junction_field: o.many_field } : null;
|
|
205
210
|
})() : null;
|
|
206
|
-
if (
|
|
211
|
+
if (L) {
|
|
207
212
|
if (s === "files-m2m") {
|
|
208
|
-
const
|
|
213
|
+
const l = y(e.options);
|
|
209
214
|
return /* @__PURE__ */ n(
|
|
210
|
-
|
|
215
|
+
lt,
|
|
211
216
|
{
|
|
212
|
-
relation:
|
|
217
|
+
relation: L,
|
|
213
218
|
parentId: d,
|
|
214
219
|
allRelations: p,
|
|
215
220
|
disabled: e.readonly,
|
|
216
|
-
allowUpload: (
|
|
217
|
-
allowPick: (
|
|
218
|
-
pendingSave: (
|
|
221
|
+
allowUpload: (l == null ? void 0 : l.allow_upload) !== !1,
|
|
222
|
+
allowPick: (l == null ? void 0 : l.allow_pick) !== !1,
|
|
223
|
+
pendingSave: (l == null ? void 0 : l.pending_save) === !0
|
|
219
224
|
}
|
|
220
225
|
);
|
|
221
226
|
}
|
|
222
227
|
const r = y(e.options), o = typeof (r == null ? void 0 : r.option_sort) == "string" && r.option_sort ? r.option_sort : void 0;
|
|
223
228
|
return (r == null ? void 0 : r.max_values) === 1 ? /* @__PURE__ */ n(
|
|
224
|
-
|
|
229
|
+
mt,
|
|
225
230
|
{
|
|
226
|
-
relation:
|
|
231
|
+
relation: L,
|
|
227
232
|
parentId: d,
|
|
228
233
|
allRelations: p,
|
|
229
234
|
extraFilter: b,
|
|
@@ -233,9 +238,9 @@ const dr = qe(function({
|
|
|
233
238
|
readOnly: G
|
|
234
239
|
}
|
|
235
240
|
) : /* @__PURE__ */ n(
|
|
236
|
-
|
|
241
|
+
pt,
|
|
237
242
|
{
|
|
238
|
-
relation:
|
|
243
|
+
relation: L,
|
|
239
244
|
parentId: d,
|
|
240
245
|
allRelations: p,
|
|
241
246
|
extraFilter: b,
|
|
@@ -248,8 +253,8 @@ const dr = qe(function({
|
|
|
248
253
|
}
|
|
249
254
|
if (e.readonly && s !== "inline-table") {
|
|
250
255
|
if (s === "relation-path" && i != null && i !== "" && j) {
|
|
251
|
-
const
|
|
252
|
-
if (
|
|
256
|
+
const l = V(e), t = H == null ? void 0 : H[e.field];
|
|
257
|
+
if (l && (t != null && t.target_collection) && t.ids.length > 0)
|
|
253
258
|
return /* @__PURE__ */ n("div", { className: "min-h-[36px] flex items-center", children: /* @__PURE__ */ n(
|
|
254
259
|
"button",
|
|
255
260
|
{
|
|
@@ -257,99 +262,99 @@ const dr = qe(function({
|
|
|
257
262
|
onClick: () => j.open({
|
|
258
263
|
collection: t.target_collection,
|
|
259
264
|
itemId: t.ids[0],
|
|
260
|
-
layoutId:
|
|
261
|
-
width:
|
|
265
|
+
layoutId: l.layout_id,
|
|
266
|
+
width: l.width,
|
|
262
267
|
title: String(i)
|
|
263
268
|
}),
|
|
264
269
|
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:
|
|
270
|
+
children: B(i, e)
|
|
266
271
|
}
|
|
267
272
|
) });
|
|
268
273
|
}
|
|
269
|
-
const r = (
|
|
274
|
+
const r = (U = e.options) == null ? void 0 : U.__live_delta;
|
|
270
275
|
if (r && Number.isFinite(Number(r.live))) {
|
|
271
|
-
const
|
|
272
|
-
return /* @__PURE__ */
|
|
273
|
-
/* @__PURE__ */ n("span", { className: "text-sm text-slate-400 line-through tabular-nums", children:
|
|
276
|
+
const l = Number(r.original), t = Number(r.live) - (Number.isFinite(l) ? l : 0), f = Math.round(t * 100) / 100;
|
|
277
|
+
return /* @__PURE__ */ x("div", { className: "flex min-h-[36px] flex-wrap items-center gap-x-2 gap-y-0.5", children: [
|
|
278
|
+
/* @__PURE__ */ n("span", { className: "text-sm text-slate-400 line-through tabular-nums", children: B(r.original, e) }),
|
|
274
279
|
/* @__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__ */
|
|
280
|
+
/* @__PURE__ */ n("span", { className: "text-sm font-medium tabular-nums", children: B(r.live, e) }),
|
|
281
|
+
f !== 0 && /* @__PURE__ */ x(
|
|
277
282
|
"span",
|
|
278
283
|
{
|
|
279
284
|
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
285
|
children: [
|
|
281
286
|
f > 0 ? "+" : "−",
|
|
282
|
-
|
|
287
|
+
B(Math.abs(f), e)
|
|
283
288
|
]
|
|
284
289
|
}
|
|
285
290
|
)
|
|
286
291
|
] });
|
|
287
292
|
}
|
|
288
|
-
if (s === "progress") return /* @__PURE__ */ n(
|
|
293
|
+
if (s === "progress") return /* @__PURE__ */ n(ie, { value: i, onChange: a, readOnly: !0 });
|
|
289
294
|
if (s === "rating") {
|
|
290
|
-
const
|
|
291
|
-
return /* @__PURE__ */ n(
|
|
295
|
+
const l = (Q = y(e.options)) == null ? void 0 : Q.rating_max;
|
|
296
|
+
return /* @__PURE__ */ n(ae, { value: i, onChange: a, max: l ?? 5, readOnly: !0 });
|
|
292
297
|
}
|
|
293
|
-
if (s === "duration") return /* @__PURE__ */ n(
|
|
294
|
-
if (s === "checklist") return /* @__PURE__ */ n(
|
|
298
|
+
if (s === "duration") return /* @__PURE__ */ n(rt, { value: i });
|
|
299
|
+
if (s === "checklist") return /* @__PURE__ */ n(ot, { value: i });
|
|
295
300
|
if (s === "color")
|
|
296
|
-
return /* @__PURE__ */ n(
|
|
297
|
-
if (s === "phone") return /* @__PURE__ */ n(
|
|
298
|
-
const o = i == null ? /* @__PURE__ */ n("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof i == "boolean" ? /* @__PURE__ */ n(
|
|
301
|
+
return /* @__PURE__ */ n(le, { field: e, value: i, onChange: a, readOnly: !0 });
|
|
302
|
+
if (s === "phone") return /* @__PURE__ */ n(se, { value: i, onChange: a, readOnly: !0 });
|
|
303
|
+
const o = i == null ? /* @__PURE__ */ n("span", { className: "text-muted-foreground italic text-sm", children: "—" }) : typeof i == "boolean" ? /* @__PURE__ */ n(Qe, { variant: i ? "default" : "secondary", children: i ? "Yes" : "No" }) : /* @__PURE__ */ n("span", { className: "text-sm tabular-nums", children: B(i, e) });
|
|
299
304
|
return /* @__PURE__ */ n("div", { className: "min-h-[36px] flex items-center", children: o });
|
|
300
305
|
}
|
|
301
|
-
const
|
|
306
|
+
const g = i == null ? "" : String(i);
|
|
302
307
|
if (e.type === "boolean")
|
|
303
|
-
return /* @__PURE__ */
|
|
304
|
-
/* @__PURE__ */ n(
|
|
308
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
309
|
+
/* @__PURE__ */ n(Oe, { checked: !!i, onCheckedChange: a }),
|
|
305
310
|
/* @__PURE__ */ n(Ce, { className: "font-normal text-sm", children: i ? "Yes" : "No" })
|
|
306
311
|
] });
|
|
307
312
|
if (e.type === "datetime" || s === "datetime") {
|
|
308
313
|
const r = y(e.options);
|
|
309
314
|
if ((r == null ? void 0 : r.date_mode) === "date") {
|
|
310
|
-
const o =
|
|
315
|
+
const o = de(e);
|
|
311
316
|
return /* @__PURE__ */ n(
|
|
312
|
-
|
|
317
|
+
T,
|
|
313
318
|
{
|
|
314
319
|
type: "date",
|
|
315
|
-
value:
|
|
320
|
+
value: g.slice(0, 10),
|
|
316
321
|
min: o.min,
|
|
317
322
|
max: o.max,
|
|
318
|
-
onChange: (
|
|
323
|
+
onChange: (l) => a(l.target.value || null),
|
|
319
324
|
placeholder: e.placeholder ?? void 0
|
|
320
325
|
}
|
|
321
326
|
);
|
|
322
327
|
}
|
|
323
328
|
return /* @__PURE__ */ n(
|
|
324
|
-
|
|
329
|
+
T,
|
|
325
330
|
{
|
|
326
331
|
type: "datetime-local",
|
|
327
|
-
value:
|
|
328
|
-
onChange: (o) =>
|
|
332
|
+
value: st(i),
|
|
333
|
+
onChange: (o) => a(o.target.value ? new Date(o.target.value).toISOString() : null),
|
|
329
334
|
placeholder: e.placeholder ?? void 0
|
|
330
335
|
}
|
|
331
336
|
);
|
|
332
337
|
}
|
|
333
338
|
if (e.type === "date" || s === "date") {
|
|
334
|
-
const r = ((
|
|
335
|
-
return /* @__PURE__ */
|
|
339
|
+
const r = ((C = y(e.options)) == null ? void 0 : C.countdown) === !0, o = de(e);
|
|
340
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center", children: [
|
|
336
341
|
/* @__PURE__ */ n(
|
|
337
|
-
|
|
342
|
+
T,
|
|
338
343
|
{
|
|
339
344
|
type: "date",
|
|
340
|
-
value:
|
|
345
|
+
value: g.slice(0, 10),
|
|
341
346
|
min: o.min,
|
|
342
347
|
max: o.max,
|
|
343
|
-
onChange: (
|
|
344
|
-
onPaste: (
|
|
345
|
-
const t =
|
|
346
|
-
t && (
|
|
348
|
+
onChange: (l) => a(l.target.value || null),
|
|
349
|
+
onPaste: (l) => {
|
|
350
|
+
const t = ft(l.clipboardData.getData("text"));
|
|
351
|
+
t && (l.preventDefault(), a(t));
|
|
347
352
|
},
|
|
348
353
|
placeholder: e.placeholder ?? void 0,
|
|
349
354
|
className: "flex-1"
|
|
350
355
|
}
|
|
351
356
|
),
|
|
352
|
-
r && /* @__PURE__ */ n(
|
|
357
|
+
r && /* @__PURE__ */ n(bt, { value: g.slice(0, 10) })
|
|
353
358
|
] });
|
|
354
359
|
}
|
|
355
360
|
if ([
|
|
@@ -370,22 +375,22 @@ const dr = qe(function({
|
|
|
370
375
|
].includes(e.type)) {
|
|
371
376
|
const r = ["integer", "bigInteger", "int", "bigint", "smallint", "tinyint"].includes(
|
|
372
377
|
e.type
|
|
373
|
-
), o = r ? 0 :
|
|
374
|
-
return /* @__PURE__ */
|
|
378
|
+
), o = r ? 0 : Ye(e.options, -1), l = r ? "1" : o >= 0 ? String(10 ** -o) : "any", t = ut(i, { type: e.type, label: e.label || "Value" }), f = t.ok ? null : t.message;
|
|
379
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
375
380
|
/* @__PURE__ */ n(
|
|
376
|
-
|
|
381
|
+
Xe,
|
|
377
382
|
{
|
|
378
383
|
type: "number",
|
|
379
384
|
"aria-invalid": f ? !0 : void 0,
|
|
380
|
-
step:
|
|
381
|
-
value:
|
|
382
|
-
|
|
383
|
-
onBlur: (
|
|
384
|
-
if (o < 0 ||
|
|
385
|
-
const m = Number(
|
|
385
|
+
step: l,
|
|
386
|
+
value: i,
|
|
387
|
+
onValue: a,
|
|
388
|
+
onBlur: (w) => {
|
|
389
|
+
if (o < 0 || w.target.value === "") return;
|
|
390
|
+
const m = Number(w.target.value);
|
|
386
391
|
if (!Number.isFinite(m)) return;
|
|
387
|
-
const
|
|
388
|
-
|
|
392
|
+
const E = Number(m.toFixed(o));
|
|
393
|
+
E !== m && a(E);
|
|
389
394
|
},
|
|
390
395
|
placeholder: e.placeholder ?? void 0
|
|
391
396
|
}
|
|
@@ -399,12 +404,12 @@ const dr = qe(function({
|
|
|
399
404
|
{
|
|
400
405
|
className: "font-mono text-xs",
|
|
401
406
|
rows: 4,
|
|
402
|
-
value: typeof i == "object" ? JSON.stringify(i, null, 2) :
|
|
407
|
+
value: typeof i == "object" ? JSON.stringify(i, null, 2) : g,
|
|
403
408
|
onChange: (r) => {
|
|
404
409
|
try {
|
|
405
|
-
|
|
410
|
+
a(JSON.parse(r.target.value));
|
|
406
411
|
} catch {
|
|
407
|
-
|
|
412
|
+
a(r.target.value);
|
|
408
413
|
}
|
|
409
414
|
},
|
|
410
415
|
placeholder: e.placeholder ?? void 0
|
|
@@ -415,9 +420,9 @@ const dr = qe(function({
|
|
|
415
420
|
$,
|
|
416
421
|
{
|
|
417
422
|
rows: 4,
|
|
418
|
-
maxLength:
|
|
419
|
-
value:
|
|
420
|
-
onChange: (r) =>
|
|
423
|
+
maxLength: ue(e),
|
|
424
|
+
value: g,
|
|
425
|
+
onChange: (r) => a(r.target.value),
|
|
421
426
|
placeholder: e.placeholder ?? void 0
|
|
422
427
|
}
|
|
423
428
|
);
|
|
@@ -426,21 +431,21 @@ const dr = qe(function({
|
|
|
426
431
|
$,
|
|
427
432
|
{
|
|
428
433
|
rows: 6,
|
|
429
|
-
value:
|
|
430
|
-
onChange: (r) =>
|
|
434
|
+
value: g,
|
|
435
|
+
onChange: (r) => a(r.target.value),
|
|
431
436
|
placeholder: e.placeholder ?? void 0,
|
|
432
437
|
className: "font-mono text-sm"
|
|
433
438
|
}
|
|
434
439
|
);
|
|
435
440
|
if (s === "input-rich-text-html" || s === "rich_text" || e.type === "rich_text" || s === "extension-editorjs")
|
|
436
441
|
return /* @__PURE__ */ n(
|
|
437
|
-
|
|
442
|
+
jt,
|
|
438
443
|
{
|
|
439
|
-
value:
|
|
440
|
-
onChange:
|
|
444
|
+
value: g,
|
|
445
|
+
onChange: a,
|
|
441
446
|
placeholder: e.placeholder ?? void 0,
|
|
442
447
|
disabled: e.readonly,
|
|
443
|
-
pastePlain: ((
|
|
448
|
+
pastePlain: ((X = y(e.options)) == null ? void 0 : X.paste_plain) === !0
|
|
444
449
|
}
|
|
445
450
|
);
|
|
446
451
|
if (s === "inline-grid" || s === "relation-list" || s === "list-o2m") {
|
|
@@ -448,8 +453,8 @@ const dr = qe(function({
|
|
|
448
453
|
(o) => o.one_collection === c && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
|
|
449
454
|
);
|
|
450
455
|
if (r) {
|
|
451
|
-
const o = r.many_collection ?? null,
|
|
452
|
-
if (o &&
|
|
456
|
+
const o = r.many_collection ?? null, l = r.many_field ?? null;
|
|
457
|
+
if (o && l && d) {
|
|
453
458
|
const f = (typeof e.options == "string" ? (() => {
|
|
454
459
|
try {
|
|
455
460
|
return JSON.parse(e.options);
|
|
@@ -458,10 +463,10 @@ const dr = qe(function({
|
|
|
458
463
|
}
|
|
459
464
|
})() : e.options ?? {}).layout_slug ?? null;
|
|
460
465
|
return /* @__PURE__ */ n(
|
|
461
|
-
|
|
466
|
+
ct,
|
|
462
467
|
{
|
|
463
468
|
relatedCollection: o,
|
|
464
|
-
manyField:
|
|
469
|
+
manyField: l,
|
|
465
470
|
parentId: d,
|
|
466
471
|
layoutSlug: f,
|
|
467
472
|
parentFieldKey: e.field,
|
|
@@ -477,21 +482,21 @@ const dr = qe(function({
|
|
|
477
482
|
(o) => o.one_collection === c && !o.junction_field && (o.one_field === e.field || o.many_collection === e.field)
|
|
478
483
|
);
|
|
479
484
|
if (r) {
|
|
480
|
-
const o = r.many_collection ?? null,
|
|
481
|
-
if (o &&
|
|
485
|
+
const o = r.many_collection ?? null, l = r.many_field ?? null;
|
|
486
|
+
if (o && l && d) {
|
|
482
487
|
const t = typeof e.options == "string" ? (() => {
|
|
483
488
|
try {
|
|
484
489
|
return JSON.parse(e.options);
|
|
485
490
|
} catch {
|
|
486
491
|
return {};
|
|
487
492
|
}
|
|
488
|
-
})() : e.options ?? {}, f = t.layout_id ?? null,
|
|
493
|
+
})() : e.options ?? {}, f = t.layout_id ?? null, w = !!t.show_row_revisions, m = !!t.row_comments, E = t.allow_revision_restore !== !1, _e = t.save_mode ?? "immediate", fe = !!t.show_line_numbers, be = t.enable_reorder !== !1, xe = Array.isArray(t.parent_cascades) ? t.parent_cascades : void 0, he = Array.isArray(t.row_rules) ? t.row_rules : void 0, ge = Array.isArray(t.column_presets) ? t.column_presets : void 0, ve = typeof t.default_preset == "string" && t.default_preset ? t.default_preset : void 0, we = Array.isArray(t.drawer_relations) ? t.drawer_relations : void 0, Ne = Array.isArray(t.parent_context_fields) ? t.parent_context_fields : void 0, ke = Array.isArray(t.unique_by) ? t.unique_by : void 0, Fe = typeof t.sort_field == "string" && t.sort_field ? t.sort_field : void 0, Ae = t.sort_dir === "desc" ? "desc" : "asc", Re = t.freeze_first_column === !0, Se = typeof t.section_group_by == "string" && t.section_group_by.includes(".") ? t.section_group_by : void 0, je = t.row_filter && typeof t.row_filter == "object" ? t.row_filter : void 0, De = t.allocate_drawer && typeof t.allocate_drawer == "object" ? t.allocate_drawer : void 0, Ie = t.auto_allocate && typeof t.auto_allocate == "object" ? t.auto_allocate : void 0, Me = 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, Be = t.row_match_panel ?? void 0, Le = t.row_defaults && typeof t.row_defaults == "object" ? t.row_defaults : void 0, Ee = t.submission_errors === !0 ? {} : t.submission_errors && typeof t.submission_errors == "object" ? t.submission_errors : void 0, R = t.membership_set;
|
|
489
494
|
if (R != null && R.key_field && (R != null && R.value_field))
|
|
490
495
|
return /* @__PURE__ */ n(
|
|
491
|
-
|
|
496
|
+
yt,
|
|
492
497
|
{
|
|
493
498
|
relatedCollection: o,
|
|
494
|
-
manyField:
|
|
499
|
+
manyField: l,
|
|
495
500
|
parentId: d,
|
|
496
501
|
config: R,
|
|
497
502
|
readOnly: e.readonly
|
|
@@ -500,10 +505,10 @@ const dr = qe(function({
|
|
|
500
505
|
const S = t.catalog_mode;
|
|
501
506
|
if (S != null && S.item_field && (S != null && S.section_by))
|
|
502
507
|
return /* @__PURE__ */ n(
|
|
503
|
-
|
|
508
|
+
et,
|
|
504
509
|
{
|
|
505
510
|
relatedCollection: o,
|
|
506
|
-
manyField:
|
|
511
|
+
manyField: l,
|
|
507
512
|
parentId: d,
|
|
508
513
|
parentCollection: c,
|
|
509
514
|
config: S,
|
|
@@ -512,56 +517,56 @@ const dr = qe(function({
|
|
|
512
517
|
);
|
|
513
518
|
const F = t.row_split;
|
|
514
519
|
if (F != null && F.key_field && (F != null && F.category_field) && Array.isArray(F.value_fields)) {
|
|
515
|
-
const
|
|
520
|
+
const q = t.spread_remaining;
|
|
516
521
|
return /* @__PURE__ */ n(
|
|
517
|
-
|
|
522
|
+
_t,
|
|
518
523
|
{
|
|
519
524
|
relatedCollection: o,
|
|
520
|
-
manyField:
|
|
525
|
+
manyField: l,
|
|
521
526
|
parentId: d,
|
|
522
527
|
config: F,
|
|
523
528
|
compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
|
|
524
529
|
stats: Array.isArray(t.stats) ? t.stats : null,
|
|
525
530
|
sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
|
|
526
|
-
remaining: typeof (
|
|
531
|
+
remaining: typeof (q == null ? void 0 : q.remaining) == "string" ? q.remaining : null,
|
|
527
532
|
readOnly: e.readonly,
|
|
528
|
-
showHistory:
|
|
533
|
+
showHistory: w,
|
|
529
534
|
emptyLabel: e.label || void 0
|
|
530
535
|
}
|
|
531
536
|
);
|
|
532
537
|
}
|
|
533
538
|
return /* @__PURE__ */ n(
|
|
534
|
-
|
|
539
|
+
dt,
|
|
535
540
|
{
|
|
536
541
|
relatedCollection: o,
|
|
537
|
-
manyField:
|
|
542
|
+
manyField: l,
|
|
538
543
|
parentId: d,
|
|
539
544
|
parentCollection: c,
|
|
540
545
|
layoutId: f,
|
|
541
|
-
showRowRevisions:
|
|
546
|
+
showRowRevisions: w,
|
|
542
547
|
rowComments: m,
|
|
543
|
-
allowRevisionRestore:
|
|
544
|
-
saveMode:
|
|
545
|
-
showLineNumbers:
|
|
546
|
-
enableReorder:
|
|
547
|
-
parentCascades:
|
|
548
|
-
rowRules:
|
|
549
|
-
columnPresets:
|
|
550
|
-
defaultPreset:
|
|
551
|
-
drawerRelations:
|
|
552
|
-
parentContextFields:
|
|
553
|
-
uniqueBy:
|
|
554
|
-
sortField:
|
|
555
|
-
sortDir:
|
|
556
|
-
sectionGroupBy:
|
|
557
|
-
freezeFirstColumn:
|
|
558
|
-
rowFilter:
|
|
559
|
-
rowDefaults:
|
|
560
|
-
allocateDrawer:
|
|
561
|
-
autoAllocate:
|
|
562
|
-
rowBulkActions:
|
|
548
|
+
allowRevisionRestore: E,
|
|
549
|
+
saveMode: _e,
|
|
550
|
+
showLineNumbers: fe,
|
|
551
|
+
enableReorder: be,
|
|
552
|
+
parentCascades: xe,
|
|
553
|
+
rowRules: he,
|
|
554
|
+
columnPresets: ge,
|
|
555
|
+
defaultPreset: ve,
|
|
556
|
+
drawerRelations: we,
|
|
557
|
+
parentContextFields: Ne,
|
|
558
|
+
uniqueBy: ke,
|
|
559
|
+
sortField: Fe,
|
|
560
|
+
sortDir: Ae,
|
|
561
|
+
sectionGroupBy: Se,
|
|
562
|
+
freezeFirstColumn: Re,
|
|
563
|
+
rowFilter: je,
|
|
564
|
+
rowDefaults: Le,
|
|
565
|
+
allocateDrawer: De,
|
|
566
|
+
autoAllocate: Ie,
|
|
567
|
+
rowBulkActions: Me,
|
|
563
568
|
uploadTemplate: Pe,
|
|
564
|
-
rowMatchPanel:
|
|
569
|
+
rowMatchPanel: Be,
|
|
565
570
|
lineSla: t.line_sla ?? null,
|
|
566
571
|
editorMode: t.editor_mode === "split" ? "split" : "drawer",
|
|
567
572
|
rowLints: Array.isArray(t.row_lints) ? t.row_lints : null,
|
|
@@ -569,7 +574,7 @@ const dr = qe(function({
|
|
|
569
574
|
sumCap: t.sum_cap && typeof t.sum_cap == "object" ? t.sum_cap : null,
|
|
570
575
|
spreadRemaining: t.spread_remaining && typeof t.spread_remaining == "object" ? t.spread_remaining : null,
|
|
571
576
|
compareSeries: t.compare_series && typeof t.compare_series == "object" && typeof t.compare_series.endpoint == "string" ? t.compare_series : null,
|
|
572
|
-
submissionErrors:
|
|
577
|
+
submissionErrors: Ee,
|
|
573
578
|
prefillParentId: pe,
|
|
574
579
|
parentFieldKey: e.field,
|
|
575
580
|
readOnly: e.readonly,
|
|
@@ -580,71 +585,71 @@ const dr = qe(function({
|
|
|
580
585
|
}
|
|
581
586
|
return /* @__PURE__ */ n("p", { className: "text-[12px] text-slate-400 py-1", children: "Inline table editing not available in embedded form" });
|
|
582
587
|
}
|
|
583
|
-
if (s === "color") return /* @__PURE__ */ n(
|
|
588
|
+
if (s === "color") return /* @__PURE__ */ n(le, { field: e, value: i, onChange: a });
|
|
584
589
|
if (s === "rating") {
|
|
585
|
-
const r = (
|
|
586
|
-
return /* @__PURE__ */ n(
|
|
590
|
+
const r = (Z = y(e.options)) == null ? void 0 : Z.rating_max;
|
|
591
|
+
return /* @__PURE__ */ n(ae, { value: i, onChange: a, max: r ?? 5 });
|
|
587
592
|
}
|
|
588
|
-
if (s === "progress") return /* @__PURE__ */ n(
|
|
593
|
+
if (s === "progress") return /* @__PURE__ */ n(ie, { value: i, onChange: a });
|
|
589
594
|
if (s === "phone")
|
|
590
|
-
return /* @__PURE__ */ n(
|
|
595
|
+
return /* @__PURE__ */ n(se, { value: i, onChange: a, placeholder: e.placeholder ?? void 0 });
|
|
591
596
|
if (s === "email")
|
|
592
|
-
return /* @__PURE__ */ n(
|
|
597
|
+
return /* @__PURE__ */ n(nt, { value: i, onChange: a, placeholder: e.placeholder ?? void 0 });
|
|
593
598
|
if (s === "address-autocomplete")
|
|
594
599
|
return /* @__PURE__ */ n(
|
|
595
|
-
|
|
600
|
+
it,
|
|
596
601
|
{
|
|
597
602
|
field: e,
|
|
598
603
|
value: i,
|
|
599
|
-
onChange:
|
|
604
|
+
onChange: a,
|
|
600
605
|
apiBase: _ == null ? void 0 : _.apiBase,
|
|
601
606
|
authHeaders: _ == null ? void 0 : _.authHeaders,
|
|
602
607
|
credentials: _ == null ? void 0 : _.credentials,
|
|
603
608
|
placeholder: e.placeholder ?? void 0
|
|
604
609
|
}
|
|
605
610
|
);
|
|
606
|
-
if (s === "duration") return /* @__PURE__ */ n(
|
|
607
|
-
if (s === "fiscal_period") return /* @__PURE__ */ n(
|
|
608
|
-
if (s === "checklist") return /* @__PURE__ */ n(
|
|
611
|
+
if (s === "duration") return /* @__PURE__ */ n(xt, { value: i, onChange: a });
|
|
612
|
+
if (s === "fiscal_period") return /* @__PURE__ */ n(ht, { value: i, onChange: a });
|
|
613
|
+
if (s === "checklist") return /* @__PURE__ */ n(gt, { value: i, onChange: a });
|
|
609
614
|
if (s === "repeater" || e.repeater_schema && e.type === "json")
|
|
610
|
-
return /* @__PURE__ */ n(
|
|
615
|
+
return /* @__PURE__ */ n(vt, { field: e, value: i, onChange: a });
|
|
611
616
|
if (s === "range_slider") {
|
|
612
|
-
const r = (
|
|
617
|
+
const r = (O = y(e.options)) == null ? void 0 : O.range_end_field;
|
|
613
618
|
return /* @__PURE__ */ n(
|
|
614
|
-
|
|
619
|
+
wt,
|
|
615
620
|
{
|
|
616
621
|
field: e,
|
|
617
622
|
value: i,
|
|
618
|
-
onChange:
|
|
619
|
-
pairedValue: r ? (
|
|
623
|
+
onChange: a,
|
|
624
|
+
pairedValue: r ? (ee = D == null ? void 0 : D.draft) == null ? void 0 : ee[r] : void 0
|
|
620
625
|
}
|
|
621
626
|
);
|
|
622
627
|
}
|
|
623
628
|
if (s === "date_range") {
|
|
624
|
-
const r = (
|
|
629
|
+
const r = (te = y(e.options)) == null ? void 0 : te.range_end_field;
|
|
625
630
|
return /* @__PURE__ */ n(
|
|
626
|
-
|
|
631
|
+
Nt,
|
|
627
632
|
{
|
|
628
633
|
field: e,
|
|
629
634
|
value: i,
|
|
630
|
-
onChange:
|
|
631
|
-
pairedValue: r ? (
|
|
635
|
+
onChange: a,
|
|
636
|
+
pairedValue: r ? (re = D == null ? void 0 : D.draft) == null ? void 0 : re[r] : void 0
|
|
632
637
|
}
|
|
633
638
|
);
|
|
634
639
|
}
|
|
635
640
|
if (s === "address")
|
|
636
641
|
return /* @__PURE__ */ n(
|
|
637
|
-
|
|
642
|
+
kt,
|
|
638
643
|
{
|
|
639
644
|
field: e,
|
|
640
645
|
value: i,
|
|
641
|
-
onChange:
|
|
646
|
+
onChange: a,
|
|
642
647
|
apiBase: _ == null ? void 0 : _.apiBase,
|
|
643
648
|
authHeaders: _ == null ? void 0 : _.authHeaders
|
|
644
649
|
}
|
|
645
650
|
);
|
|
646
651
|
if (s === "tags")
|
|
647
|
-
return /* @__PURE__ */ n(
|
|
652
|
+
return /* @__PURE__ */ n(It, { field: e, value: i, onChange: a });
|
|
648
653
|
if (s === "select-dropdown" || s === "radio-buttons") {
|
|
649
654
|
const r = (() => {
|
|
650
655
|
const o = y(e.options);
|
|
@@ -652,64 +657,64 @@ const dr = qe(function({
|
|
|
652
657
|
})();
|
|
653
658
|
if (r.length > 0)
|
|
654
659
|
return /* @__PURE__ */ n(
|
|
655
|
-
|
|
660
|
+
Ze,
|
|
656
661
|
{
|
|
657
|
-
value:
|
|
658
|
-
onChange: (o) =>
|
|
662
|
+
value: g,
|
|
663
|
+
onChange: (o) => a(o || null),
|
|
659
664
|
options: [
|
|
660
665
|
{ value: "", label: "— Select —" },
|
|
661
|
-
...r.map((o) => ({ value: o.value, label:
|
|
666
|
+
...r.map((o) => ({ value: o.value, label: Ue(o.text) }))
|
|
662
667
|
],
|
|
663
668
|
ariaLabel: e.label ?? e.field,
|
|
664
669
|
className: "h-9 rounded-md text-sm"
|
|
665
670
|
}
|
|
666
671
|
);
|
|
667
672
|
}
|
|
668
|
-
const I =
|
|
673
|
+
const I = Ft(e), ye = me(e), P = (() => {
|
|
669
674
|
const r = y(e.options);
|
|
670
675
|
if (Number.isFinite(Number(r == null ? void 0 : r.max_length))) return Number(r == null ? void 0 : r.max_length);
|
|
671
|
-
const o = y(e.validation_rules),
|
|
672
|
-
return
|
|
673
|
-
})(),
|
|
674
|
-
|
|
676
|
+
const o = y(e.validation_rules), l = Array.isArray(o) ? o.find((t) => (t == null ? void 0 : t.type) === "max") : null;
|
|
677
|
+
return l && Number.isFinite(Number(l.value)) ? Number(l.value) : ye;
|
|
678
|
+
})(), z = /* @__PURE__ */ n(
|
|
679
|
+
T,
|
|
675
680
|
{
|
|
676
|
-
maxLength: I ? void 0 :
|
|
677
|
-
value: I ?
|
|
681
|
+
maxLength: I ? void 0 : ue(e),
|
|
682
|
+
value: I ? ce(I, g).display : g,
|
|
678
683
|
onChange: (r) => {
|
|
679
684
|
if (I) {
|
|
680
|
-
const { clean: o } =
|
|
681
|
-
|
|
685
|
+
const { clean: o } = ce(I, r.target.value);
|
|
686
|
+
a(o || null);
|
|
682
687
|
} else
|
|
683
|
-
|
|
688
|
+
a(r.target.value || null);
|
|
684
689
|
},
|
|
685
690
|
placeholder: e.placeholder ?? I ?? void 0
|
|
686
691
|
}
|
|
687
692
|
);
|
|
688
|
-
if (
|
|
689
|
-
const r =
|
|
690
|
-
return /* @__PURE__ */
|
|
691
|
-
|
|
692
|
-
r >=
|
|
693
|
+
if (P != null && P > 0 && !ze(e._overrides)) {
|
|
694
|
+
const r = g.length;
|
|
695
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
696
|
+
z,
|
|
697
|
+
r >= P * 0.6 && /* @__PURE__ */ x(
|
|
693
698
|
"p",
|
|
694
699
|
{
|
|
695
|
-
className: r >
|
|
700
|
+
className: r > P ? "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",
|
|
696
701
|
children: [
|
|
697
702
|
r,
|
|
698
703
|
"/",
|
|
699
|
-
|
|
704
|
+
P
|
|
700
705
|
]
|
|
701
706
|
}
|
|
702
707
|
)
|
|
703
708
|
] });
|
|
704
709
|
}
|
|
705
|
-
return
|
|
710
|
+
return z;
|
|
706
711
|
});
|
|
707
|
-
function
|
|
708
|
-
field:
|
|
712
|
+
function It({
|
|
713
|
+
field: h,
|
|
709
714
|
value: e,
|
|
710
715
|
onChange: i
|
|
711
716
|
}) {
|
|
712
|
-
const [
|
|
717
|
+
const [a, p] = He(""), c = (() => {
|
|
713
718
|
if (Array.isArray(e)) return e.map(String);
|
|
714
719
|
if (typeof e == "string" && e.trim().startsWith("["))
|
|
715
720
|
try {
|
|
@@ -720,15 +725,15 @@ function jt({
|
|
|
720
725
|
}
|
|
721
726
|
return typeof e == "string" && e.trim() !== "" ? [e] : [];
|
|
722
727
|
})(), d = (() => {
|
|
723
|
-
const u = y(
|
|
728
|
+
const u = y(h.options);
|
|
724
729
|
return Array.isArray(u == null ? void 0 : u.tag_options) ? u.tag_options.map(String) : [];
|
|
725
730
|
})(), b = (u) => i(u.length > 0 ? JSON.stringify(u) : null), v = (u) => {
|
|
726
731
|
const N = u.trim();
|
|
727
732
|
!N || c.includes(N) || (b([...c, N]), p(""));
|
|
728
733
|
};
|
|
729
|
-
return /* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
c.map((u) => /* @__PURE__ */
|
|
734
|
+
return /* @__PURE__ */ x("div", { className: "rounded-md border border-input bg-background px-2 py-1.5", children: [
|
|
735
|
+
/* @__PURE__ */ x("div", { className: "flex flex-wrap items-center gap-1", children: [
|
|
736
|
+
c.map((u) => /* @__PURE__ */ x(
|
|
732
737
|
"span",
|
|
733
738
|
{
|
|
734
739
|
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",
|
|
@@ -751,18 +756,18 @@ function jt({
|
|
|
751
756
|
/* @__PURE__ */ n(
|
|
752
757
|
"input",
|
|
753
758
|
{
|
|
754
|
-
value:
|
|
759
|
+
value: a,
|
|
755
760
|
onChange: (u) => p(u.target.value),
|
|
756
761
|
onKeyDown: (u) => {
|
|
757
|
-
(u.key === "Enter" || u.key === ",") && (u.preventDefault(), v(
|
|
762
|
+
(u.key === "Enter" || u.key === ",") && (u.preventDefault(), v(a)), u.key === "Backspace" && a === "" && c.length > 0 && b(c.slice(0, -1));
|
|
758
763
|
},
|
|
759
|
-
onBlur: () => v(
|
|
764
|
+
onBlur: () => v(a),
|
|
760
765
|
placeholder: c.length === 0 ? "Type and press Enter…" : "",
|
|
761
766
|
className: "h-6 min-w-[120px] flex-1 bg-transparent text-[13px] outline-none"
|
|
762
767
|
}
|
|
763
768
|
)
|
|
764
769
|
] }),
|
|
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__ */
|
|
770
|
+
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
771
|
"button",
|
|
767
772
|
{
|
|
768
773
|
type: "button",
|
|
@@ -778,6 +783,6 @@ function jt({
|
|
|
778
783
|
] });
|
|
779
784
|
}
|
|
780
785
|
export {
|
|
781
|
-
|
|
782
|
-
|
|
786
|
+
pr as FieldRenderer,
|
|
787
|
+
ne as resolveOptionFilterTokens
|
|
783
788
|
};
|