@nivaro/react 0.3.58 → 0.3.60
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/fields/RelationField.js +110 -80
- package/dist/full.css +1 -1
- package/dist/hooks/useRelationOptions.js +1 -0
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +523 -520
- package/dist/shared/components/CollectionBrowserView.js +2083 -2052
- package/dist/shared/components/DataTable.js +497 -465
- package/dist/shared/components/ItemEditForm.js +4430 -4282
- package/dist/shared/components/PageRenderer.js +537 -508
- package/dist/shared/components/QueryTable.js +74 -74
- package/dist/shared/components/WidgetSlot.js +543 -520
- package/dist/shared/components/alerts/AlertManagerView.js +269 -275
- package/dist/shared/components/alerts/types.js +37 -14
- package/dist/shared/components/item-edit/FieldRenderer.js +22 -20
- package/dist/shared/components/item-edit/GridBulkEditDialog.js +55 -54
- package/dist/shared/components/item-edit/InlineTableField.js +2461 -2421
- package/dist/shared/components/item-edit/M2MCombobox.js +141 -137
- package/dist/shared/components/item-edit/PlanGrid.js +876 -820
- package/dist/shared/components/item-edit/QuickCreateButton.js +323 -130
- package/dist/shared/components/item-edit/RelationCombobox.js +408 -375
- package/dist/shared/components/item-edit/RelationGroupedCombobox.js +255 -156
- package/dist/shared/components/item-edit/SummaryPanel.js +356 -343
- package/dist/shared/components/item-edit/duplicate-rehearsal.js +47 -0
- package/dist/shared/components/item-edit/line-midair.js +82 -75
- package/dist/shared/components/item-edit/save-outcome.js +6 -4
- package/dist/shared/components/panels/ItemLockBanner.js +212 -209
- package/dist/shared/components/panels/PipelinePanel.js +775 -737
- package/dist/shared/components/panels/RecordIntegrityBanner.js +114 -86
- package/dist/shared/components/panels/RevisionsPanel.js +313 -299
- package/dist/shared/components/pipeline/PipelineEditorView.js +26 -16
- package/dist/shared/components/queue/QueueQuickFilters.js +13 -13
- package/dist/shared/components/queue/QueueWorklist.js +978 -953
- package/dist/shared/components/queue/live-state-aspect.js +9 -5
- package/dist/shared/components/widgets/ReviewListWidget.js +152 -149
- package/dist/shared/lib/display-prefs.js +60 -52
- package/dist/shared/lib/draft-store.js +71 -48
- package/dist/shared/lib/expression.js +53 -53
- package/dist/shared/lib/list-page-memory.js +42 -20
- package/dist/shared/lib/money-input.js +45 -0
- package/dist/shared/lib/sanitize-html.js +10 -6
- package/dist/shared/lib/staged-row-labels.js +18 -0
- package/package.json +1 -1
|
@@ -1,41 +1,63 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s = "nvr:list-page:";
|
|
2
2
|
function l() {
|
|
3
|
-
var
|
|
3
|
+
var e;
|
|
4
4
|
if (typeof window > "u") return null;
|
|
5
|
-
const
|
|
6
|
-
return typeof (
|
|
5
|
+
const t = (e = window.history) == null ? void 0 : e.state;
|
|
6
|
+
return typeof (t == null ? void 0 : t.key) == "string" && t.key ? t.key : null;
|
|
7
7
|
}
|
|
8
|
-
function f(
|
|
9
|
-
|
|
8
|
+
function f() {
|
|
9
|
+
const t = l();
|
|
10
|
+
if (t || typeof window > "u" || !window.history) return t;
|
|
11
|
+
try {
|
|
12
|
+
const e = window.history.state, r = e && typeof e == "object" ? e : {}, n = `nvr${Math.random().toString(36).slice(2, 10)}`;
|
|
13
|
+
return window.history.replaceState({ ...r, key: n }, ""), l();
|
|
14
|
+
} catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
10
17
|
}
|
|
11
|
-
function a(
|
|
12
|
-
|
|
18
|
+
function a(t, e) {
|
|
19
|
+
return `${s}${t}|${e}`;
|
|
20
|
+
}
|
|
21
|
+
function h(t, e = l()) {
|
|
22
|
+
if (!e) return null;
|
|
13
23
|
try {
|
|
14
|
-
const r = window.sessionStorage.getItem(
|
|
24
|
+
const r = window.sessionStorage.getItem(a(t, e)), n = r == null ? Number.NaN : Number(r);
|
|
15
25
|
return Number.isInteger(n) && n > 1 && n < 1e5 ? n : null;
|
|
16
26
|
} catch {
|
|
17
27
|
return null;
|
|
18
28
|
}
|
|
19
29
|
}
|
|
20
|
-
function
|
|
30
|
+
function y(t, e, r = e > 1 ? f() : l()) {
|
|
21
31
|
if (r)
|
|
22
32
|
try {
|
|
23
|
-
const n = window.sessionStorage,
|
|
24
|
-
if (!(
|
|
25
|
-
n.removeItem(
|
|
33
|
+
const n = window.sessionStorage, c = a(t, r);
|
|
34
|
+
if (!(e > 1)) {
|
|
35
|
+
n.removeItem(c);
|
|
26
36
|
return;
|
|
27
37
|
}
|
|
28
|
-
n.setItem(
|
|
29
|
-
const
|
|
38
|
+
n.setItem(c, String(Math.floor(e)));
|
|
39
|
+
const u = [];
|
|
30
40
|
for (let o = 0; o < n.length; o++) {
|
|
31
|
-
const
|
|
32
|
-
|
|
41
|
+
const i = n.key(o);
|
|
42
|
+
i != null && i.startsWith(s) && u.push(i);
|
|
33
43
|
}
|
|
34
|
-
for (const o of
|
|
44
|
+
for (const o of u.slice(0, Math.max(0, u.length - 50))) n.removeItem(o);
|
|
35
45
|
} catch {
|
|
36
46
|
}
|
|
37
47
|
}
|
|
48
|
+
function g(t, e) {
|
|
49
|
+
return t && t > 1 && e === 1 ? t : e;
|
|
50
|
+
}
|
|
51
|
+
function w(t) {
|
|
52
|
+
if (t.pending == null) return null;
|
|
53
|
+
if (t.failed && !t.fetching) return { close: !0, page: null };
|
|
54
|
+
if (!t.gateOpen || !t.loaded || t.fetching || t.placeholder) return null;
|
|
55
|
+
const e = t.totalUnknown || t.total == null ? null : Math.max(1, Math.ceil(t.total / t.pageSize));
|
|
56
|
+
return { close: !0, page: e != null && t.page > e ? e : null };
|
|
57
|
+
}
|
|
38
58
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
59
|
+
g as pageWhileSettling,
|
|
60
|
+
y as rememberListPage,
|
|
61
|
+
h as rememberedListPage,
|
|
62
|
+
w as restoreWindowOutcome
|
|
41
63
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const u = 999999999999e-2, a = "Enter an amount of zero or more", f = /[\t\r\n]/, c = /^(\d+(\.\d*)?|\.\d+)$/, d = /^\d{1,3}(,\d{3})+(\.\d*)?$/, m = /^\d{1,3}( \d{3})+(\.\d*)?$/;
|
|
2
|
+
function h(s) {
|
|
3
|
+
const t = +`${s}e2`;
|
|
4
|
+
return Number.isFinite(t) ? Math.round(t) / 100 : Math.round(Number(s) * 100) / 100;
|
|
5
|
+
}
|
|
6
|
+
function N(s) {
|
|
7
|
+
const t = String(s ?? "").trim();
|
|
8
|
+
if (f.test(t)) return { ok: !1, error: "Paste one amount per cell" };
|
|
9
|
+
if (t === "" || t === "—" || t === "-")
|
|
10
|
+
return { ok: !0, value: 0, rounded: !1 };
|
|
11
|
+
let e = t, o = !1;
|
|
12
|
+
/^\(.*\)$/.test(e) && (o = !0, e = e.slice(1, -1).trim());
|
|
13
|
+
let l = !1;
|
|
14
|
+
for (; ; )
|
|
15
|
+
if (e.startsWith("-")) {
|
|
16
|
+
if (o) return { ok: !1, error: a };
|
|
17
|
+
o = !0, e = e.slice(1).trim();
|
|
18
|
+
} else if (e.startsWith("$")) {
|
|
19
|
+
if (l) return { ok: !1, error: a };
|
|
20
|
+
l = !0, e = e.slice(1).trim();
|
|
21
|
+
} else break;
|
|
22
|
+
e = e.replace(/\s+/g, " ");
|
|
23
|
+
let r;
|
|
24
|
+
if (c.test(e)) r = e;
|
|
25
|
+
else if (d.test(e)) r = e.replace(/,/g, "");
|
|
26
|
+
else if (m.test(e)) r = e.replace(/ /g, "");
|
|
27
|
+
else return /^[\d., ]+$/.test(e) && /,/.test(e) ? {
|
|
28
|
+
ok: !1,
|
|
29
|
+
error: `"${t}" is not clear — use a comma only between thousands (1,234) and a point for cents (12.34)`
|
|
30
|
+
} : { ok: !1, error: a };
|
|
31
|
+
const i = Number(r);
|
|
32
|
+
if (!Number.isFinite(i)) return { ok: !1, error: a };
|
|
33
|
+
if (i > u)
|
|
34
|
+
return { ok: !1, error: "That is more than a month can hold ($9,999,999,999.99)" };
|
|
35
|
+
const n = h(r);
|
|
36
|
+
return {
|
|
37
|
+
ok: !0,
|
|
38
|
+
value: o && n !== 0 ? -n : n,
|
|
39
|
+
rounded: Math.abs(i - n) > 1e-9
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
u as MONEY_INPUT_MAX,
|
|
44
|
+
N as parseMoneyInput
|
|
45
|
+
};
|
|
@@ -52,20 +52,24 @@ const l = /* @__PURE__ */ new Set([
|
|
|
52
52
|
"template",
|
|
53
53
|
"base",
|
|
54
54
|
"noscript"
|
|
55
|
-
]), f = /* @__PURE__ */ new Set(["href", "title", "colspan", "rowspan", "start", "type"]), p = /^(https?:|mailto:|tel:)/i,
|
|
55
|
+
]), f = /* @__PURE__ */ new Set(["href", "title", "colspan", "rowspan", "start", "type"]), p = /^(https?:|mailto:|tel:)/i, h = (n) => {
|
|
56
56
|
let e = "";
|
|
57
57
|
for (const r of n) r.charCodeAt(0) > 32 && (e += r);
|
|
58
58
|
return e = e.toLowerCase(), !e || p.test(e) ? !0 : !/^[a-z][a-z0-9+.-]*:/.test(e);
|
|
59
59
|
};
|
|
60
|
-
function
|
|
60
|
+
function u(n) {
|
|
61
61
|
if (typeof DOMParser < "u") {
|
|
62
62
|
const e = new DOMParser().parseFromString(n, "text/html");
|
|
63
63
|
for (const r of e.body.querySelectorAll("script,style,template,noscript")) r.remove();
|
|
64
|
+
for (const r of e.body.querySelectorAll(
|
|
65
|
+
"br,p,div,li,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre"
|
|
66
|
+
))
|
|
67
|
+
r.nextSibling && r.after(e.createTextNode(" "));
|
|
64
68
|
return (e.body.textContent || "").replace(/\s+/g, " ");
|
|
65
69
|
}
|
|
66
70
|
return n.replace(/<(script|style|template|noscript)\b[\s\S]*?<\/\1>/gi, " ").replace(/<[^>]+>/g, " ").replace(/ /g, " ").replace(/\s+/g, " ");
|
|
67
71
|
}
|
|
68
|
-
function
|
|
72
|
+
function d(n) {
|
|
69
73
|
if (typeof DOMParser > "u") return "";
|
|
70
74
|
const e = new DOMParser().parseFromString(n, "text/html"), r = (i) => {
|
|
71
75
|
for (const t of [...i.children]) {
|
|
@@ -84,7 +88,7 @@ function m(n) {
|
|
|
84
88
|
}
|
|
85
89
|
for (const o of [...t.attributes]) {
|
|
86
90
|
const a = o.name.toLowerCase();
|
|
87
|
-
(!f.has(a) || a === "href" && !
|
|
91
|
+
(!f.has(a) || a === "href" && !h(o.value)) && t.removeAttribute(o.name);
|
|
88
92
|
}
|
|
89
93
|
s === "a" && (t.setAttribute("rel", "noopener noreferrer"), t.setAttribute("target", "_blank")), r(t);
|
|
90
94
|
}
|
|
@@ -92,6 +96,6 @@ function m(n) {
|
|
|
92
96
|
return r(e.body), e.body.innerHTML;
|
|
93
97
|
}
|
|
94
98
|
export {
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
u as htmlToText,
|
|
100
|
+
d as sanitizeHtml
|
|
97
101
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const s = /* @__PURE__ */ new Map();
|
|
2
|
+
function o(t, n) {
|
|
3
|
+
const e = s.get(t) ?? /* @__PURE__ */ new Set();
|
|
4
|
+
return e.add(n), s.set(t, e), () => {
|
|
5
|
+
e.delete(n), e.size === 0 && s.delete(t);
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function a(t, n) {
|
|
9
|
+
for (const e of s.get(t) ?? []) {
|
|
10
|
+
const r = e(n);
|
|
11
|
+
if (r != null && r.trim()) return r;
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
o as registerStagedRowLabel,
|
|
17
|
+
a as stagedRowLabel
|
|
18
|
+
};
|