@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,78 +1,79 @@
|
|
|
1
|
-
import { jsx as c, jsxs as
|
|
1
|
+
import { jsx as c, jsxs as x } from "react/jsx-runtime";
|
|
2
2
|
import { Check as F, MapPin as S } from "lucide-react";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { fiscalPeriodOf as $, getFiscalStartMonth as
|
|
3
|
+
import { useState as N, useEffect as C } from "react";
|
|
4
|
+
import { fiscalPeriodOf as $, getFiscalStartMonth as D } from "../../lib/fiscal.js";
|
|
5
5
|
import { Input as g } from "../ui/input.js";
|
|
6
|
+
import { NumberDraftInput as _ } from "../ui/number-draft-input.js";
|
|
6
7
|
import { parseJson as w } from "./helpers.js";
|
|
7
|
-
function
|
|
8
|
-
window.dispatchEvent(new CustomEvent("nvr:set-field", { detail: { field:
|
|
8
|
+
function k(s, n) {
|
|
9
|
+
window.dispatchEvent(new CustomEvent("nvr:set-field", { detail: { field: s, value: n } }));
|
|
9
10
|
}
|
|
10
|
-
function v(
|
|
11
|
-
return w(
|
|
11
|
+
function v(s) {
|
|
12
|
+
return w(s.options) ?? {};
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
const e =
|
|
15
|
-
let
|
|
16
|
-
for (const d of
|
|
14
|
+
function E(s, n) {
|
|
15
|
+
const e = n.replace(/[^a-zA-Z0-9]/g, "").split("");
|
|
16
|
+
let l = "", o = "";
|
|
17
|
+
for (const d of s) {
|
|
17
18
|
if (e.length === 0) break;
|
|
18
19
|
if (d === "#") {
|
|
19
20
|
for (; e.length > 0 && !/\d/.test(e[0]); ) e.shift();
|
|
20
21
|
if (e.length === 0) break;
|
|
21
22
|
const r = e.shift();
|
|
22
|
-
|
|
23
|
+
l += r, o += r;
|
|
23
24
|
} else if (d === "A") {
|
|
24
25
|
for (; e.length > 0 && !/[a-zA-Z]/.test(e[0]); ) e.shift();
|
|
25
26
|
if (e.length === 0) break;
|
|
26
27
|
const r = e.shift();
|
|
27
|
-
|
|
28
|
+
l += r, o += r;
|
|
28
29
|
} else if (d === "*") {
|
|
29
30
|
const r = e.shift();
|
|
30
|
-
|
|
31
|
+
l += r, o += r;
|
|
31
32
|
} else
|
|
32
|
-
|
|
33
|
+
l += d;
|
|
33
34
|
}
|
|
34
|
-
return { display:
|
|
35
|
+
return { display: l, clean: o };
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
-
const
|
|
38
|
-
return typeof
|
|
37
|
+
function J(s) {
|
|
38
|
+
const n = v(s).input_mask;
|
|
39
|
+
return typeof n == "string" && n.trim() ? n.trim() : null;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
43
|
-
const e = (t) => `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`,
|
|
44
|
-
if (
|
|
45
|
-
if (
|
|
46
|
-
const o =
|
|
47
|
-
if (o) return e(new Date(
|
|
48
|
-
if (
|
|
49
|
-
if (
|
|
50
|
-
const d = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"], r =
|
|
41
|
+
function R(s) {
|
|
42
|
+
const n = s.trim().toLowerCase();
|
|
43
|
+
if (!n) return null;
|
|
44
|
+
const e = (t) => `${t.getFullYear()}-${String(t.getMonth() + 1).padStart(2, "0")}-${String(t.getDate()).padStart(2, "0")}`, l = /* @__PURE__ */ new Date();
|
|
45
|
+
if (n === "today") return e(l);
|
|
46
|
+
if (n === "tomorrow") return e(new Date(l.getTime() + 864e5));
|
|
47
|
+
const o = n.match(/^\+(\d{1,4})$/);
|
|
48
|
+
if (o) return e(new Date(l.getTime() + Number(o[1]) * 864e5));
|
|
49
|
+
if (n === "eom") return e(new Date(l.getFullYear(), l.getMonth() + 1, 0));
|
|
50
|
+
if (n === "eoy") return e(new Date(l.getFullYear(), 11, 31));
|
|
51
|
+
const d = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"], r = n.match(/^(?:next\s+)?(sun|mon|tue|wed|thu|fri|sat)[a-z]*$/);
|
|
51
52
|
if (r) {
|
|
52
|
-
const t = d.findIndex((
|
|
53
|
+
const t = d.findIndex((a) => a.startsWith(r[1]));
|
|
53
54
|
if (t >= 0) {
|
|
54
|
-
let
|
|
55
|
-
return (
|
|
55
|
+
let a = (t - l.getDay() + 7) % 7;
|
|
56
|
+
return (a === 0 || n.startsWith("next")) && (a += a === 0 ? 7 : 0), a === 0 && (a = 7), e(new Date(l.getTime() + a * 864e5));
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
59
|
return null;
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
value:
|
|
62
|
-
onChange:
|
|
61
|
+
function z({
|
|
62
|
+
value: s,
|
|
63
|
+
onChange: n
|
|
63
64
|
}) {
|
|
64
|
-
const e = Number(
|
|
65
|
-
C(() => d(
|
|
65
|
+
const e = Number(s), l = Number.isFinite(e) && s != null && s !== "" ? `${Math.floor(e / 60)}:${String(Math.round(e % 60)).padStart(2, "0")}` : "", [o, d] = N(l);
|
|
66
|
+
C(() => d(l), [l]);
|
|
66
67
|
const r = () => {
|
|
67
68
|
const t = o.trim();
|
|
68
69
|
if (!t) {
|
|
69
|
-
|
|
70
|
+
n(null);
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
|
-
const
|
|
73
|
-
|
|
73
|
+
const a = t.match(/^(\d{1,4})(?::([0-5]?\d))?$/);
|
|
74
|
+
a ? n(Number(a[1]) * 60 + Number(a[2] ?? 0)) : d(l);
|
|
74
75
|
};
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
76
77
|
/* @__PURE__ */ c(
|
|
77
78
|
g,
|
|
78
79
|
{
|
|
@@ -84,28 +85,28 @@ function J({
|
|
|
84
85
|
className: "w-28 tabular-nums"
|
|
85
86
|
}
|
|
86
87
|
),
|
|
87
|
-
/* @__PURE__ */ c("span", { className: "text-[11.5px] text-slate-400", children: Number.isFinite(e) &&
|
|
88
|
+
/* @__PURE__ */ c("span", { className: "text-[11.5px] text-slate-400", children: Number.isFinite(e) && s != null && s !== "" ? `${e} min` : "stored as minutes" })
|
|
88
89
|
] });
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
-
field:
|
|
92
|
-
value:
|
|
91
|
+
function P({
|
|
92
|
+
field: s,
|
|
93
|
+
value: n,
|
|
93
94
|
onChange: e,
|
|
94
|
-
pairedValue:
|
|
95
|
+
pairedValue: l
|
|
95
96
|
}) {
|
|
96
|
-
const o = v(
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
97
|
+
const o = v(s), d = Number.isFinite(Number(o.range_min)) ? Number(o.range_min) : 0, r = Number.isFinite(Number(o.range_max)) ? Number(o.range_max) : 100, t = o.range_end_field, a = Number(n ?? d), i = Number(l ?? r);
|
|
98
|
+
return /* @__PURE__ */ x("div", { className: "py-1.5", children: [
|
|
99
|
+
/* @__PURE__ */ x("div", { className: "flex items-center gap-3", children: [
|
|
99
100
|
/* @__PURE__ */ c(
|
|
100
101
|
"input",
|
|
101
102
|
{
|
|
102
103
|
type: "range",
|
|
103
104
|
min: d,
|
|
104
105
|
max: r,
|
|
105
|
-
value: Number.isFinite(
|
|
106
|
+
value: Number.isFinite(a) ? a : d,
|
|
106
107
|
onChange: (m) => e(Number(m.target.value)),
|
|
107
108
|
className: "flex-1 accent-nvr-cyan",
|
|
108
|
-
"aria-label": `${
|
|
109
|
+
"aria-label": `${s.label ?? s.field} minimum`
|
|
109
110
|
}
|
|
110
111
|
),
|
|
111
112
|
t && /* @__PURE__ */ c(
|
|
@@ -115,17 +116,17 @@ function R({
|
|
|
115
116
|
min: d,
|
|
116
117
|
max: r,
|
|
117
118
|
value: Number.isFinite(i) ? i : r,
|
|
118
|
-
onChange: (m) =>
|
|
119
|
+
onChange: (m) => k(t, Number(m.target.value)),
|
|
119
120
|
className: "flex-1 accent-[#172940]",
|
|
120
|
-
"aria-label": `${
|
|
121
|
+
"aria-label": `${s.label ?? s.field} maximum`
|
|
121
122
|
}
|
|
122
123
|
)
|
|
123
124
|
] }),
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
Number.isFinite(
|
|
125
|
+
/* @__PURE__ */ x("p", { className: "mt-1 text-[12px] tabular-nums text-slate-500", children: [
|
|
126
|
+
Number.isFinite(a) ? a : "—",
|
|
126
127
|
t ? ` – ${Number.isFinite(i) ? i : "—"}` : "",
|
|
127
128
|
" ",
|
|
128
|
-
/* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ x("span", { className: "text-slate-400", children: [
|
|
129
130
|
"(range ",
|
|
130
131
|
d,
|
|
131
132
|
"–",
|
|
@@ -135,44 +136,44 @@ function R({
|
|
|
135
136
|
] })
|
|
136
137
|
] });
|
|
137
138
|
}
|
|
138
|
-
function
|
|
139
|
-
field:
|
|
140
|
-
value:
|
|
139
|
+
function L({
|
|
140
|
+
field: s,
|
|
141
|
+
value: n,
|
|
141
142
|
onChange: e,
|
|
142
|
-
apiBase:
|
|
143
|
+
apiBase: l,
|
|
143
144
|
authHeaders: o
|
|
144
145
|
}) {
|
|
145
|
-
const d = v(
|
|
146
|
-
if (
|
|
147
|
-
if (typeof
|
|
146
|
+
const d = v(s), r = (() => {
|
|
147
|
+
if (n && typeof n == "object") return n;
|
|
148
|
+
if (typeof n == "string")
|
|
148
149
|
try {
|
|
149
|
-
return JSON.parse(
|
|
150
|
+
return JSON.parse(n);
|
|
150
151
|
} catch {
|
|
151
|
-
return { street:
|
|
152
|
+
return { street: n };
|
|
152
153
|
}
|
|
153
154
|
return {};
|
|
154
|
-
})(), [t,
|
|
155
|
-
const p = { ...r, [u]: f }, h = Object.values(p).every((
|
|
155
|
+
})(), [t, a] = N(!1), i = (u, f) => {
|
|
156
|
+
const p = { ...r, [u]: f }, h = Object.values(p).every((b) => !b);
|
|
156
157
|
e(h ? null : JSON.stringify(p));
|
|
157
158
|
}, m = async () => {
|
|
158
159
|
var u, f;
|
|
159
|
-
if (
|
|
160
|
-
|
|
160
|
+
if (l) {
|
|
161
|
+
a(!0);
|
|
161
162
|
try {
|
|
162
|
-
const p = [r.street, r.city, r.state, r.zip].filter(Boolean).join(", "),
|
|
163
|
+
const p = [r.street, r.city, r.state, r.zip].filter(Boolean).join(", "), b = await (await fetch(`${l}/geocode`, {
|
|
163
164
|
method: "POST",
|
|
164
165
|
headers: { ...o ?? {}, "content-type": "application/json" },
|
|
165
166
|
credentials: "include",
|
|
166
167
|
body: JSON.stringify({ q: p })
|
|
167
168
|
})).json();
|
|
168
|
-
((u =
|
|
169
|
+
((u = b == null ? void 0 : b.data) == null ? void 0 : u.lat) != null && d.lat_field && k(d.lat_field, b.data.lat), ((f = b == null ? void 0 : b.data) == null ? void 0 : f.lng) != null && d.lng_field && k(d.lng_field, b.data.lng);
|
|
169
170
|
} catch {
|
|
170
171
|
} finally {
|
|
171
|
-
|
|
172
|
+
a(!1);
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
|
-
return /* @__PURE__ */
|
|
176
|
+
return /* @__PURE__ */ x("div", { className: "space-y-1.5", children: [
|
|
176
177
|
/* @__PURE__ */ c(
|
|
177
178
|
g,
|
|
178
179
|
{
|
|
@@ -181,7 +182,7 @@ function z({
|
|
|
181
182
|
placeholder: "Street address"
|
|
182
183
|
}
|
|
183
184
|
),
|
|
184
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ x("div", { className: "flex gap-1.5", children: [
|
|
185
186
|
/* @__PURE__ */ c(
|
|
186
187
|
g,
|
|
187
188
|
{
|
|
@@ -210,7 +211,7 @@ function z({
|
|
|
210
211
|
}
|
|
211
212
|
)
|
|
212
213
|
] }),
|
|
213
|
-
(d.lat_field || d.lng_field) && /* @__PURE__ */
|
|
214
|
+
(d.lat_field || d.lng_field) && /* @__PURE__ */ x(
|
|
214
215
|
"button",
|
|
215
216
|
{
|
|
216
217
|
type: "button",
|
|
@@ -225,53 +226,53 @@ function z({
|
|
|
225
226
|
)
|
|
226
227
|
] });
|
|
227
228
|
}
|
|
228
|
-
function
|
|
229
|
-
value:
|
|
230
|
-
onChange:
|
|
229
|
+
function Q({
|
|
230
|
+
value: s,
|
|
231
|
+
onChange: n
|
|
231
232
|
}) {
|
|
232
|
-
const e = typeof
|
|
233
|
-
return /* @__PURE__ */
|
|
233
|
+
const e = typeof s == "string" ? s.match(/^FY(\d{4})-Q([1-4])$/) : null, l = e ? Number(e[1]) : (/* @__PURE__ */ new Date()).getFullYear(), o = e ? Number(e[2]) : 1, d = (a, i) => n(`FY${a}-Q${i}`), r = Array.from({ length: 8 }, (a, i) => (/* @__PURE__ */ new Date()).getFullYear() - 3 + i), t = $(/* @__PURE__ */ new Date());
|
|
234
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-1.5", children: [
|
|
234
235
|
/* @__PURE__ */ c(
|
|
235
236
|
"button",
|
|
236
237
|
{
|
|
237
238
|
type: "button",
|
|
238
|
-
onClick: () =>
|
|
239
|
-
"data-tip": `Set to the current period (fiscal year starts month ${
|
|
240
|
-
className:
|
|
239
|
+
onClick: () => n(t),
|
|
240
|
+
"data-tip": `Set to the current period (fiscal year starts month ${D()})`,
|
|
241
|
+
className: s === t ? "rounded-md bg-nvr-cyan/10 px-2 py-1.5 text-[11.5px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "rounded-md border border-slate-200 px-2 py-1.5 text-[11.5px] text-slate-500 hover:bg-muted dark:border-border",
|
|
241
242
|
children: "Now"
|
|
242
243
|
}
|
|
243
244
|
),
|
|
244
|
-
/* @__PURE__ */ c("div", { className: "flex overflow-hidden rounded-md border border-input", children: r.slice(2, 6).map((
|
|
245
|
+
/* @__PURE__ */ c("div", { className: "flex overflow-hidden rounded-md border border-input", children: r.slice(2, 6).map((a) => /* @__PURE__ */ x(
|
|
245
246
|
"button",
|
|
246
247
|
{
|
|
247
248
|
type: "button",
|
|
248
|
-
onClick: () => d(
|
|
249
|
-
className: e &&
|
|
249
|
+
onClick: () => d(a, o),
|
|
250
|
+
className: e && l === a ? "bg-nvr-cyan/10 px-2 py-1.5 text-[12px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "px-2 py-1.5 text-[12px] text-slate-500 hover:bg-muted",
|
|
250
251
|
children: [
|
|
251
252
|
"FY",
|
|
252
|
-
String(
|
|
253
|
+
String(a).slice(2)
|
|
253
254
|
]
|
|
254
255
|
},
|
|
255
|
-
|
|
256
|
+
a
|
|
256
257
|
)) }),
|
|
257
|
-
/* @__PURE__ */ c("div", { className: "flex overflow-hidden rounded-md border border-input", children: [1, 2, 3, 4].map((
|
|
258
|
+
/* @__PURE__ */ c("div", { className: "flex overflow-hidden rounded-md border border-input", children: [1, 2, 3, 4].map((a) => /* @__PURE__ */ x(
|
|
258
259
|
"button",
|
|
259
260
|
{
|
|
260
261
|
type: "button",
|
|
261
|
-
onClick: () => d(
|
|
262
|
-
className: e && o ===
|
|
262
|
+
onClick: () => d(l, a),
|
|
263
|
+
className: e && o === a ? "bg-nvr-cyan/10 px-2 py-1.5 text-[12px] font-semibold text-nvr-navy dark:text-nvr-cyan" : "px-2 py-1.5 text-[12px] text-slate-500 hover:bg-muted",
|
|
263
264
|
children: [
|
|
264
265
|
"Q",
|
|
265
|
-
|
|
266
|
+
a
|
|
266
267
|
]
|
|
267
268
|
},
|
|
268
|
-
|
|
269
|
+
a
|
|
269
270
|
)) }),
|
|
270
271
|
e && /* @__PURE__ */ c(
|
|
271
272
|
"button",
|
|
272
273
|
{
|
|
273
274
|
type: "button",
|
|
274
|
-
onClick: () =>
|
|
275
|
+
onClick: () => n(null),
|
|
275
276
|
className: "px-1 text-[12px] text-slate-400 hover:text-red-500",
|
|
276
277
|
"aria-label": "Clear fiscal period",
|
|
277
278
|
children: "✕"
|
|
@@ -279,22 +280,22 @@ function P({
|
|
|
279
280
|
)
|
|
280
281
|
] });
|
|
281
282
|
}
|
|
282
|
-
function
|
|
283
|
-
value:
|
|
284
|
-
onChange:
|
|
283
|
+
function Z({
|
|
284
|
+
value: s,
|
|
285
|
+
onChange: n
|
|
285
286
|
}) {
|
|
286
287
|
const e = (() => {
|
|
287
|
-
const t = typeof
|
|
288
|
+
const t = typeof s == "string" ? (() => {
|
|
288
289
|
try {
|
|
289
|
-
return JSON.parse(
|
|
290
|
+
return JSON.parse(s);
|
|
290
291
|
} catch {
|
|
291
292
|
return [];
|
|
292
293
|
}
|
|
293
|
-
})() :
|
|
294
|
-
return Array.isArray(t) ? t.filter((
|
|
295
|
-
})(), [
|
|
296
|
-
return /* @__PURE__ */
|
|
297
|
-
e.length > 0 && /* @__PURE__ */ c("p", { className: "mb-1.5 text-[11px] tabular-nums text-slate-400", children: /* @__PURE__ */
|
|
294
|
+
})() : s;
|
|
295
|
+
return Array.isArray(t) ? t.filter((a) => a && typeof a.text == "string").map((a) => ({ text: a.text, done: !!a.done })) : [];
|
|
296
|
+
})(), [l, o] = N(""), d = (t) => n(t.length > 0 ? JSON.stringify(t) : null), r = e.filter((t) => t.done).length;
|
|
297
|
+
return /* @__PURE__ */ x("div", { className: "rounded-md border border-input bg-background p-2", children: [
|
|
298
|
+
e.length > 0 && /* @__PURE__ */ c("p", { className: "mb-1.5 text-[11px] tabular-nums text-slate-400", children: /* @__PURE__ */ x(
|
|
298
299
|
"span",
|
|
299
300
|
{
|
|
300
301
|
className: r === e.length ? "rounded-full bg-emerald-100 px-1.5 py-px font-medium text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-300" : "rounded-full bg-slate-100 px-1.5 py-px font-medium text-slate-500 dark:bg-muted",
|
|
@@ -306,14 +307,14 @@ function L({
|
|
|
306
307
|
]
|
|
307
308
|
}
|
|
308
309
|
) }),
|
|
309
|
-
/* @__PURE__ */ c("ul", { className: "space-y-1", children: e.map((t,
|
|
310
|
+
/* @__PURE__ */ c("ul", { className: "space-y-1", children: e.map((t, a) => (
|
|
310
311
|
// biome-ignore lint/suspicious/noArrayIndexKey: positional list editor
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
+
/* @__PURE__ */ x("li", { className: "group flex items-center gap-2", children: [
|
|
312
313
|
/* @__PURE__ */ c(
|
|
313
314
|
"button",
|
|
314
315
|
{
|
|
315
316
|
type: "button",
|
|
316
|
-
onClick: () => d(e.map((i, m) => m ===
|
|
317
|
+
onClick: () => d(e.map((i, m) => m === a ? { ...i, done: !i.done } : i)),
|
|
317
318
|
className: t.done ? "flex h-4 w-4 items-center justify-center rounded border border-emerald-500 bg-emerald-500" : "h-4 w-4 rounded border border-slate-300 hover:border-nvr-cyan dark:border-slate-600",
|
|
318
319
|
"aria-label": t.done ? "Mark not done" : "Mark done",
|
|
319
320
|
children: t.done && /* @__PURE__ */ c(F, { className: "h-3 w-3 text-white" })
|
|
@@ -330,21 +331,21 @@ function L({
|
|
|
330
331
|
"button",
|
|
331
332
|
{
|
|
332
333
|
type: "button",
|
|
333
|
-
onClick: () => d(e.filter((i, m) => m !==
|
|
334
|
+
onClick: () => d(e.filter((i, m) => m !== a)),
|
|
334
335
|
className: "hidden text-slate-300 hover:text-red-500 group-hover:inline",
|
|
335
336
|
"aria-label": `Remove ${t.text}`,
|
|
336
337
|
children: "×"
|
|
337
338
|
}
|
|
338
339
|
)
|
|
339
|
-
] },
|
|
340
|
+
] }, a)
|
|
340
341
|
)) }),
|
|
341
342
|
/* @__PURE__ */ c(
|
|
342
343
|
"input",
|
|
343
344
|
{
|
|
344
|
-
value:
|
|
345
|
+
value: l,
|
|
345
346
|
onChange: (t) => o(t.target.value),
|
|
346
347
|
onKeyDown: (t) => {
|
|
347
|
-
t.key === "Enter" &&
|
|
348
|
+
t.key === "Enter" && l.trim() && (t.preventDefault(), d([...e, { text: l.trim(), done: !1 }]), o(""));
|
|
348
349
|
},
|
|
349
350
|
placeholder: "+ Add item and press Enter",
|
|
350
351
|
className: "mt-1.5 h-7 w-full rounded border border-dashed border-slate-200 bg-transparent px-2 text-[12.5px] outline-none focus:border-nvr-cyan dark:border-border"
|
|
@@ -352,19 +353,19 @@ function L({
|
|
|
352
353
|
)
|
|
353
354
|
] });
|
|
354
355
|
}
|
|
355
|
-
function
|
|
356
|
-
field:
|
|
357
|
-
value:
|
|
356
|
+
function B({
|
|
357
|
+
field: s,
|
|
358
|
+
value: n,
|
|
358
359
|
onChange: e,
|
|
359
|
-
pairedValue:
|
|
360
|
+
pairedValue: l
|
|
360
361
|
}) {
|
|
361
|
-
const o = v(
|
|
362
|
-
return /* @__PURE__ */
|
|
362
|
+
const o = v(s).range_end_field, d = (r) => typeof r == "string" && r ? r.slice(0, 10) : "";
|
|
363
|
+
return /* @__PURE__ */ x("div", { className: "flex items-center gap-2", children: [
|
|
363
364
|
/* @__PURE__ */ c(
|
|
364
365
|
g,
|
|
365
366
|
{
|
|
366
367
|
type: "date",
|
|
367
|
-
value: d(
|
|
368
|
+
value: d(n),
|
|
368
369
|
onChange: (r) => e(r.target.value || null),
|
|
369
370
|
className: "w-40"
|
|
370
371
|
}
|
|
@@ -374,55 +375,55 @@ function Q({
|
|
|
374
375
|
g,
|
|
375
376
|
{
|
|
376
377
|
type: "date",
|
|
377
|
-
value: d(
|
|
378
|
-
onChange: (r) =>
|
|
378
|
+
value: d(l),
|
|
379
|
+
onChange: (r) => k(o, r.target.value || null),
|
|
379
380
|
className: "w-40"
|
|
380
381
|
}
|
|
381
382
|
) : /* @__PURE__ */ c("span", { className: "text-[11.5px] text-amber-600", children: "set options.range_end_field" })
|
|
382
383
|
] });
|
|
383
384
|
}
|
|
384
|
-
function
|
|
385
|
-
const [,
|
|
385
|
+
function K({ value: s }) {
|
|
386
|
+
const [, n] = N(0);
|
|
386
387
|
if (C(() => {
|
|
387
|
-
const i = setInterval(() =>
|
|
388
|
+
const i = setInterval(() => n((m) => m + 1), 6e4);
|
|
388
389
|
return () => clearInterval(i);
|
|
389
|
-
}, []), typeof
|
|
390
|
-
const e = new Date(
|
|
390
|
+
}, []), typeof s != "string" || !s) return null;
|
|
391
|
+
const e = new Date(s.length === 10 ? `${s}T00:00:00` : s);
|
|
391
392
|
if (Number.isNaN(e.getTime())) return null;
|
|
392
|
-
const
|
|
393
|
+
const l = e.getTime() - Date.now(), o = l < 0, d = Math.abs(l), r = Math.floor(d / 864e5), t = Math.floor(d % 864e5 / 36e5), a = r > 0 ? `${r}d ${t}h` : `${t}h ${Math.floor(d % 36e5 / 6e4)}m`;
|
|
393
394
|
return /* @__PURE__ */ c(
|
|
394
395
|
"span",
|
|
395
396
|
{
|
|
396
397
|
className: o ? "ml-2 rounded-full bg-red-100 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-red-700 dark:bg-red-500/15 dark:text-red-300" : r < 3 ? "ml-2 rounded-full bg-amber-100 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-amber-700 dark:bg-amber-500/15 dark:text-amber-300" : "ml-2 rounded-full bg-slate-100 px-2 py-0.5 text-[10.5px] font-semibold tabular-nums text-slate-500 dark:bg-muted dark:text-muted-foreground",
|
|
397
398
|
"data-tip": e.toLocaleString(),
|
|
398
|
-
children: o ? `T+${
|
|
399
|
+
children: o ? `T+${a}` : `T−${a}`
|
|
399
400
|
}
|
|
400
401
|
);
|
|
401
402
|
}
|
|
402
|
-
function
|
|
403
|
-
field:
|
|
404
|
-
value:
|
|
403
|
+
function W({
|
|
404
|
+
field: s,
|
|
405
|
+
value: n,
|
|
405
406
|
onChange: e
|
|
406
407
|
}) {
|
|
407
|
-
const
|
|
408
|
-
const i = w(
|
|
408
|
+
const l = (() => {
|
|
409
|
+
const i = w(s.repeater_schema);
|
|
409
410
|
return Array.isArray(i) ? i : [];
|
|
410
411
|
})(), o = (() => {
|
|
411
|
-
const i = typeof
|
|
412
|
+
const i = typeof n == "string" ? w(n) : n;
|
|
412
413
|
return Array.isArray(i) ? i : [];
|
|
413
|
-
})(), [d, r] =
|
|
414
|
+
})(), [d, r] = N(/* @__PURE__ */ new Set()), t = (i) => e(i.length > 0 ? JSON.stringify(i) : null), a = (i, m) => {
|
|
414
415
|
const u = i + m;
|
|
415
416
|
if (u < 0 || u >= o.length) return;
|
|
416
417
|
const f = [...o];
|
|
417
418
|
[f[i], f[u]] = [f[u], f[i]], t(f);
|
|
418
419
|
};
|
|
419
|
-
return
|
|
420
|
+
return l.length === 0 ? /* @__PURE__ */ c("p", { className: "text-[12px] text-amber-600", children: "No repeater schema configured." }) : /* @__PURE__ */ x("div", { className: "space-y-1.5", children: [
|
|
420
421
|
o.map((i, m) => {
|
|
421
|
-
const u = d.has(m), f =
|
|
422
|
+
const u = d.has(m), f = l.slice(0, 2).map((p) => String(i[p.key] ?? "")).filter(Boolean).join(" · ");
|
|
422
423
|
return (
|
|
423
424
|
// biome-ignore lint/suspicious/noArrayIndexKey: positional rows
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ x("div", { className: "rounded-md border border-slate-200 dark:border-border", children: [
|
|
426
|
+
/* @__PURE__ */ x("div", { className: "flex items-center gap-1 border-b border-slate-100 bg-slate-50 px-2 py-1 dark:border-border/60 dark:bg-muted/40", children: [
|
|
426
427
|
/* @__PURE__ */ c(
|
|
427
428
|
"button",
|
|
428
429
|
{
|
|
@@ -441,7 +442,7 @@ function B({
|
|
|
441
442
|
"button",
|
|
442
443
|
{
|
|
443
444
|
type: "button",
|
|
444
|
-
onClick: () =>
|
|
445
|
+
onClick: () => a(m, -1),
|
|
445
446
|
disabled: m === 0,
|
|
446
447
|
className: "px-1 text-[12px] text-slate-400 hover:text-slate-700 disabled:opacity-30",
|
|
447
448
|
"aria-label": "Move up",
|
|
@@ -452,7 +453,7 @@ function B({
|
|
|
452
453
|
"button",
|
|
453
454
|
{
|
|
454
455
|
type: "button",
|
|
455
|
-
onClick: () =>
|
|
456
|
+
onClick: () => a(m, 1),
|
|
456
457
|
disabled: m === o.length - 1,
|
|
457
458
|
className: "px-1 text-[12px] text-slate-400 hover:text-slate-700 disabled:opacity-30",
|
|
458
459
|
"aria-label": "Move down",
|
|
@@ -470,7 +471,7 @@ function B({
|
|
|
470
471
|
}
|
|
471
472
|
)
|
|
472
473
|
] }),
|
|
473
|
-
!u && /* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-1.5 p-2", children:
|
|
474
|
+
!u && /* @__PURE__ */ c("div", { className: "grid grid-cols-2 gap-1.5 p-2", children: l.map((p) => /* @__PURE__ */ x("label", { className: "block", children: [
|
|
474
475
|
/* @__PURE__ */ c("span", { className: "text-[10.5px] uppercase tracking-wide text-slate-400", children: p.label ?? p.key }),
|
|
475
476
|
p.type === "boolean" ? /* @__PURE__ */ c(
|
|
476
477
|
"input",
|
|
@@ -479,23 +480,29 @@ function B({
|
|
|
479
480
|
checked: i[p.key] === !0,
|
|
480
481
|
onChange: (h) => t(
|
|
481
482
|
o.map(
|
|
482
|
-
(
|
|
483
|
+
(b, y) => y === m ? { ...b, [p.key]: h.target.checked } : b
|
|
483
484
|
)
|
|
484
485
|
),
|
|
485
486
|
className: "mt-1 block h-4 w-4 accent-nvr-cyan"
|
|
486
487
|
}
|
|
488
|
+
) : p.type === "number" ? (
|
|
489
|
+
// Keeps "2.0" as typed until the next key (army 4 a01-15).
|
|
490
|
+
/* @__PURE__ */ c(
|
|
491
|
+
_,
|
|
492
|
+
{
|
|
493
|
+
type: "number",
|
|
494
|
+
value: i[p.key],
|
|
495
|
+
onValue: (h) => t(o.map((b, y) => y === m ? { ...b, [p.key]: h } : b)),
|
|
496
|
+
className: "mt-0.5 h-7 text-[12.5px]"
|
|
497
|
+
}
|
|
498
|
+
)
|
|
487
499
|
) : /* @__PURE__ */ c(
|
|
488
500
|
g,
|
|
489
501
|
{
|
|
490
|
-
type: p.type === "
|
|
502
|
+
type: p.type === "date" ? "date" : "text",
|
|
491
503
|
value: String(i[p.key] ?? ""),
|
|
492
504
|
onChange: (h) => t(
|
|
493
|
-
o.map(
|
|
494
|
-
(x, k) => k === m ? {
|
|
495
|
-
...x,
|
|
496
|
-
[p.key]: p.type === "number" ? h.target.value === "" ? null : Number(h.target.value) : h.target.value
|
|
497
|
-
} : x
|
|
498
|
-
)
|
|
505
|
+
o.map((b, y) => y === m ? { ...b, [p.key]: h.target.value } : b)
|
|
499
506
|
),
|
|
500
507
|
className: "mt-0.5 h-7 text-[12.5px]"
|
|
501
508
|
}
|
|
@@ -516,16 +523,16 @@ function B({
|
|
|
516
523
|
] });
|
|
517
524
|
}
|
|
518
525
|
export {
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
526
|
+
L as AddressField,
|
|
527
|
+
Z as ChecklistField,
|
|
528
|
+
K as CountdownChip,
|
|
529
|
+
B as DateRangeField,
|
|
530
|
+
z as DurationField,
|
|
531
|
+
Q as FiscalPeriodField,
|
|
532
|
+
P as RangeSliderField,
|
|
533
|
+
W as RepeaterField,
|
|
534
|
+
E as applyInputMask,
|
|
535
|
+
J as maskFor,
|
|
536
|
+
k as setSiblingField,
|
|
537
|
+
R as smartParseDate
|
|
531
538
|
};
|