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