@nivaro/react 0.3.64 → 0.3.66
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 +62 -8
- package/dist/shared/components/CollectionBrowserView.js +3127 -3204
- package/dist/shared/components/ConformanceView.js +235 -221
- package/dist/shared/components/DataTable.js +478 -459
- package/dist/shared/components/ItemEditForm.js +4842 -4500
- package/dist/shared/components/MyWorkView.js +124 -113
- package/dist/shared/components/PageRenderer.js +146 -138
- package/dist/shared/components/ProfileView.js +483 -472
- package/dist/shared/components/RecordDrilldownSheet.js +73 -65
- package/dist/shared/components/ReportView.js +1100 -1094
- package/dist/shared/components/bulk/BulkActionButtons.js +72 -72
- package/dist/shared/components/bulk/BulkCompareButton.js +62 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +114 -103
- package/dist/shared/components/bulk/BulkFieldUpdateButton.js +73 -0
- package/dist/shared/components/bulk/MessageStakeholders.js +235 -0
- package/dist/shared/components/bulk/bulk-field-options.js +29 -23
- package/dist/shared/components/integrations/IntegrationObligationsView.js +191 -173
- package/dist/shared/components/integrations/IntegrationStatusLines.js +101 -85
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +11 -9
- package/dist/shared/components/integrations/SendCurrentData.js +126 -0
- package/dist/shared/components/item-edit/CatalogPickerField.js +1535 -1440
- package/dist/shared/components/item-edit/FieldRenderer.js +49 -45
- package/dist/shared/components/item-edit/FieldRow.js +413 -403
- package/dist/shared/components/item-edit/GroupSection.js +555 -538
- package/dist/shared/components/item-edit/InlineTableField.js +2903 -2816
- package/dist/shared/components/item-edit/M2MCombobox.js +407 -338
- package/dist/shared/components/item-edit/MidairCollisionDialog.js +367 -116
- package/dist/shared/components/item-edit/NestedRelationEditor.js +171 -163
- package/dist/shared/components/item-edit/PlanGrid.js +783 -724
- package/dist/shared/components/item-edit/QuickCreateButton.js +291 -224
- package/dist/shared/components/item-edit/RecordInsights.js +113 -111
- package/dist/shared/components/item-edit/RecordLiveSync.js +4 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +398 -364
- package/dist/shared/components/item-edit/SummaryPanel.js +146 -144
- package/dist/shared/components/item-edit/UserChip.js +264 -229
- package/dist/shared/components/item-edit/cascade-clear-notice.js +56 -0
- package/dist/shared/components/item-edit/collision-format.js +37 -0
- package/dist/shared/components/item-edit/field-a11y.js +25 -0
- package/dist/shared/components/item-edit/header-path-preview.js +52 -0
- package/dist/shared/components/item-edit/line-merge.js +84 -0
- package/dist/shared/components/item-edit/line-midair.js +94 -87
- package/dist/shared/components/item-edit/move-guard.js +17 -0
- package/dist/shared/components/item-edit/picker-search.js +27 -16
- package/dist/shared/components/item-edit/rail-width.js +8 -0
- package/dist/shared/components/monitoring/InactiveUserLinksView.js +126 -124
- package/dist/shared/components/panels/AccessDeniedPanel.js +96 -55
- package/dist/shared/components/panels/CommentPanel.js +142 -136
- package/dist/shared/components/panels/ItemLockBanner.js +246 -240
- package/dist/shared/components/panels/PipelinePanel.js +1366 -1194
- package/dist/shared/components/panels/RevisionsPanel.js +106 -102
- package/dist/shared/components/panels/SlaBreachBanner.js +16 -20
- package/dist/shared/components/panels/SlaClock.js +90 -68
- package/dist/shared/components/queue/QueueItemSheet.js +94 -87
- package/dist/shared/components/queue/QueueWorklist.js +1522 -1347
- package/dist/shared/components/queue/worklist-csv.js +75 -0
- package/dist/shared/components/queue/worklist-helpers.js +20 -0
- package/dist/shared/components/widgets/ReviewListWidget.js +226 -207
- package/dist/shared/lib/bulk-copy.js +17 -0
- package/dist/shared/lib/cbv-export.js +122 -0
- package/dist/shared/lib/delete-offer.js +13 -0
- package/dist/shared/lib/error-hints.js +1 -0
- package/dist/shared/lib/leave-guard.js +41 -26
- package/dist/shared/lib/list-link.js +72 -56
- package/dist/shared/lib/live-queries.js +32 -30
- package/dist/shared/lib/moved-notice.js +25 -0
- package/dist/shared/lib/notification-target.js +56 -54
- package/dist/shared/lib/obligation-banner.js +11 -8
- package/dist/shared/lib/obligation-reason-text.js +6 -6
- package/dist/shared/lib/quick-filter-cascade.js +29 -19
- package/dist/shared/lib/sort-cycle.js +6 -0
- package/dist/shared/lib/summary-mode.js +59 -41
- package/package.json +1 -1
|
@@ -1,129 +1,131 @@
|
|
|
1
|
-
import { canOpenChatRoom as
|
|
2
|
-
const
|
|
1
|
+
import { canOpenChatRoom as g, openChatRoom as S } from "../components/chat/chat-core.js";
|
|
2
|
+
const u = /* @__PURE__ */ new Set([
|
|
3
3
|
"nivaro_metric_alert_log",
|
|
4
4
|
"nivaro_anomaly_log",
|
|
5
5
|
"nivaro_alert_definitions",
|
|
6
6
|
"nivaro_alert_log"
|
|
7
7
|
]), q = /* @__PURE__ */ new Set(["nivaro_import_queue", "nivaro_import_jobs"]);
|
|
8
|
-
function
|
|
9
|
-
var
|
|
10
|
-
const c =
|
|
8
|
+
function C(l, n, a) {
|
|
9
|
+
var f, d, _, y, m, b, k;
|
|
10
|
+
const c = l == null ? void 0 : l.trim();
|
|
11
11
|
if (!c) return null;
|
|
12
|
-
const
|
|
12
|
+
const t = n != null && String(n).trim() !== "" ? String(n) : null;
|
|
13
13
|
if (c === "__chat__")
|
|
14
|
-
return
|
|
14
|
+
return t && g() ? { type: "chat", room: t } : null;
|
|
15
15
|
if (c === "nivaro_report_defs") {
|
|
16
|
-
const
|
|
17
|
-
return
|
|
16
|
+
const i = t ? (f = a.report) == null ? void 0 : f.call(a, t) : null;
|
|
17
|
+
return i ? { type: "path", path: i } : null;
|
|
18
18
|
}
|
|
19
19
|
if (c === "nivaro_queues") {
|
|
20
|
-
const
|
|
21
|
-
return
|
|
20
|
+
const i = t ? (d = a.queue) == null ? void 0 : d.call(a, t) : null;
|
|
21
|
+
return i ? { type: "path", path: i } : null;
|
|
22
22
|
}
|
|
23
23
|
if (c === "nivaro_dashboards") {
|
|
24
|
-
const
|
|
25
|
-
return
|
|
24
|
+
const i = t ? (_ = a.dashboard) == null ? void 0 : _.call(a, t) : null;
|
|
25
|
+
return i ? { type: "path", path: i } : null;
|
|
26
26
|
}
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
return
|
|
27
|
+
if (u.has(c)) {
|
|
28
|
+
const i = (y = a.alerts) == null ? void 0 : y.call(a);
|
|
29
|
+
return i ? { type: "path", path: i } : null;
|
|
30
30
|
}
|
|
31
31
|
if (q.has(c)) {
|
|
32
|
-
const
|
|
33
|
-
return
|
|
32
|
+
const i = (m = a.imports) == null ? void 0 : m.call(a);
|
|
33
|
+
return i ? { type: "path", path: i } : null;
|
|
34
34
|
}
|
|
35
35
|
if (c === "nivaro_issues") {
|
|
36
|
-
const
|
|
37
|
-
return
|
|
36
|
+
const i = (b = a.issues) == null ? void 0 : b.call(a);
|
|
37
|
+
return i ? { type: "path", path: i } : null;
|
|
38
38
|
}
|
|
39
39
|
if (/^nivaro_/i.test(c) || /^directus_/i.test(c)) return null;
|
|
40
|
-
if (
|
|
41
|
-
const
|
|
42
|
-
return
|
|
40
|
+
if (t) {
|
|
41
|
+
const i = a.record(c, t);
|
|
42
|
+
return i ? { type: "path", path: i } : null;
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
return
|
|
44
|
+
const h = (k = a.list) == null ? void 0 : k.call(a, c);
|
|
45
|
+
return h ? { type: "path", path: h } : null;
|
|
46
46
|
}
|
|
47
|
-
const
|
|
47
|
+
const $ = (l, n) => {
|
|
48
48
|
const a = [];
|
|
49
|
-
return n.query && a.push(n.query), n.tab && a.push(`tab=${encodeURIComponent(n.tab)}`), n.focus && a.push(`focus=${encodeURIComponent(n.focus)}`), a.length === 0 ?
|
|
49
|
+
return n.query && a.push(n.query), n.tab && a.push(`tab=${encodeURIComponent(n.tab)}`), n.focus && a.push(`focus=${encodeURIComponent(n.focus)}`), a.length === 0 ? l : `${l}${l.includes("?") ? "&" : "?"}${a.join("&")}`;
|
|
50
50
|
};
|
|
51
|
-
function
|
|
51
|
+
function v(l) {
|
|
52
52
|
try {
|
|
53
53
|
if (typeof window > "u") return null;
|
|
54
|
-
const n = new URL(
|
|
54
|
+
const n = new URL(l, window.location.origin);
|
|
55
55
|
return n.origin !== window.location.origin ? null : `${n.pathname}${n.search}${n.hash}`;
|
|
56
56
|
} catch {
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function R(
|
|
61
|
-
var c,
|
|
62
|
-
const a =
|
|
60
|
+
function R(l, n) {
|
|
61
|
+
var c, t, h, f, d, _, y, m, b, k, i, o, w;
|
|
62
|
+
const a = l.target ?? null;
|
|
63
63
|
if (a) {
|
|
64
|
-
const
|
|
64
|
+
const r = (e) => e ? { type: "path", path: $(e, a) } : null;
|
|
65
65
|
let p = null;
|
|
66
66
|
switch (a.kind) {
|
|
67
67
|
case "record":
|
|
68
68
|
case "sla":
|
|
69
69
|
case "approval": {
|
|
70
|
-
a.collection && a.id != null ? p =
|
|
70
|
+
a.collection && a.id != null ? p = r(n.record(a.collection, String(a.id))) : a.collection ? p = r((c = n.list) == null ? void 0 : c.call(n, a.collection)) : a.kind === "approval" && (p = r((t = n.approvals) == null ? void 0 : t.call(n)));
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
case "task":
|
|
74
|
-
p =
|
|
74
|
+
p = r(((h = n.tasks) == null ? void 0 : h.call(n, a.id != null ? String(a.id) : null)) ?? ((f = n.my_work) == null ? void 0 : f.call(n)));
|
|
75
75
|
break;
|
|
76
76
|
case "access_request":
|
|
77
|
-
p =
|
|
77
|
+
p = r((d = n.access_requests) == null ? void 0 : d.call(n));
|
|
78
78
|
break;
|
|
79
79
|
case "support":
|
|
80
|
-
p =
|
|
80
|
+
p = r((_ = n.support) == null ? void 0 : _.call(n, a.id != null ? String(a.id) : null));
|
|
81
81
|
break;
|
|
82
82
|
case "chat":
|
|
83
|
-
p = a.room &&
|
|
83
|
+
p = a.room && g() ? { type: "chat", room: a.room } : null;
|
|
84
84
|
break;
|
|
85
85
|
case "queue":
|
|
86
|
-
p = a.id != null ?
|
|
86
|
+
p = a.id != null ? r((y = n.queue) == null ? void 0 : y.call(n, String(a.id))) : null;
|
|
87
87
|
break;
|
|
88
88
|
case "report":
|
|
89
|
-
p = a.id != null ?
|
|
89
|
+
p = a.id != null ? r((m = n.report) == null ? void 0 : m.call(n, String(a.id))) : null;
|
|
90
90
|
break;
|
|
91
91
|
case "dashboard":
|
|
92
|
-
p = a.id != null ?
|
|
92
|
+
p = a.id != null ? r((b = n.dashboard) == null ? void 0 : b.call(n, String(a.id))) : null;
|
|
93
93
|
break;
|
|
94
94
|
case "alerts":
|
|
95
|
-
p =
|
|
95
|
+
p = r((k = n.alerts) == null ? void 0 : k.call(n));
|
|
96
96
|
break;
|
|
97
97
|
case "import":
|
|
98
|
-
p =
|
|
98
|
+
p = r((i = n.imports) == null ? void 0 : i.call(n));
|
|
99
99
|
break;
|
|
100
100
|
case "issue":
|
|
101
|
-
p =
|
|
101
|
+
p = r((o = n.issues) == null ? void 0 : o.call(n));
|
|
102
102
|
break;
|
|
103
103
|
case "my_work":
|
|
104
|
-
p =
|
|
104
|
+
p = r((w = n.my_work) == null ? void 0 : w.call(n));
|
|
105
105
|
break;
|
|
106
106
|
case "home":
|
|
107
107
|
p = { type: "path", path: "/" };
|
|
108
108
|
break;
|
|
109
|
-
case "external":
|
|
110
|
-
|
|
109
|
+
case "external": {
|
|
110
|
+
const e = a.url ? v(a.url) : null;
|
|
111
|
+
p = e ? { type: "path", path: e } : a.url ? { type: "external", url: a.url } : null;
|
|
111
112
|
break;
|
|
113
|
+
}
|
|
112
114
|
}
|
|
113
115
|
if (p) return p;
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
return
|
|
116
|
+
if (l.url) {
|
|
117
|
+
const e = v(l.url);
|
|
118
|
+
return e ? { type: "path", path: e } : { type: "external", url: l.url };
|
|
117
119
|
}
|
|
118
120
|
return null;
|
|
119
121
|
}
|
|
120
|
-
return
|
|
122
|
+
return C(l.collection, l.item, n);
|
|
121
123
|
}
|
|
122
|
-
function T(
|
|
123
|
-
return
|
|
124
|
+
function T(l, n) {
|
|
125
|
+
return l ? l.type === "chat" ? (S(l.room), !0) : l.type === "external" ? (typeof window < "u" && window.open(l.url, "_blank", "noopener"), !0) : (n(l.path), !0) : !1;
|
|
124
126
|
}
|
|
125
127
|
export {
|
|
126
|
-
|
|
128
|
+
C as resolveNotificationTarget,
|
|
127
129
|
R as resolveNotificationTargetFor,
|
|
128
130
|
T as runNotificationTarget
|
|
129
131
|
};
|
|
@@ -9,7 +9,7 @@ const g = (o) => {
|
|
|
9
9
|
...t ? { timeZone: t } : {}
|
|
10
10
|
}).format(new Date(o));
|
|
11
11
|
};
|
|
12
|
-
function
|
|
12
|
+
function _(o, t) {
|
|
13
13
|
const l = t.getTime() - new Date(o).getTime(), e = Math.floor(l / 6e4);
|
|
14
14
|
if (e < 1) return "just now";
|
|
15
15
|
if (e < 60) return `${e}m ago`;
|
|
@@ -18,7 +18,7 @@ function h(o, t) {
|
|
|
18
18
|
const i = Math.floor(n / 24);
|
|
19
19
|
return i < 7 ? `${i}d ago` : $(o);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function h(o) {
|
|
22
22
|
return o.split(/[._-]+/).filter(Boolean).map((t) => t[0].toUpperCase() + t.slice(1)).join(" ");
|
|
23
23
|
}
|
|
24
24
|
function T(o, t = /* @__PURE__ */ new Date()) {
|
|
@@ -29,14 +29,14 @@ function T(o, t = /* @__PURE__ */ new Date()) {
|
|
|
29
29
|
(!n || e.id > n.id) && l.set(e.api, e);
|
|
30
30
|
}
|
|
31
31
|
return [...l.values()].map((e) => {
|
|
32
|
-
var
|
|
33
|
-
const n = e.resolved_at ?? e.due_at, i = `${
|
|
32
|
+
var c;
|
|
33
|
+
const n = e.resolved_at ?? e.due_at, i = `${_(n, t)} (${g(n)})`, r = e.reason ? ` — ${f(e.reason)}` : "", u = ((c = e.label) == null ? void 0 : c.trim()) || (e.trigger === "transition" ? h(e.kind) : ""), a = u ? ` · ${u}` : "";
|
|
34
34
|
let s;
|
|
35
35
|
if (e.outcome === "sent") s = `told ${i}${a}`;
|
|
36
36
|
else if (e.outcome === "pending") {
|
|
37
|
-
const
|
|
38
|
-
s = `sent ${i}${a}, awaiting acknowledgement (${
|
|
39
|
-
} else e.outcome === "skipped" ? s = `should have been told ${i}${a}${
|
|
37
|
+
const m = Math.round((t.getTime() - new Date(e.due_at).getTime()) / 6e4);
|
|
38
|
+
s = `sent ${i}${a}, awaiting acknowledgement (${m} min)`;
|
|
39
|
+
} else e.outcome === "skipped" ? s = `should have been told ${i}${a}${r}` : e.outcome === "failed" ? s = `send failed ${i}${a}${r}` : e.outcome === "missing" ? s = `never told${a}${r}` : s = `still not told${a}${r}`;
|
|
40
40
|
return {
|
|
41
41
|
api: e.api,
|
|
42
42
|
tone: d(e.outcome),
|
|
@@ -45,7 +45,10 @@ function T(o, t = /* @__PURE__ */ new Date()) {
|
|
|
45
45
|
outcome: e.outcome,
|
|
46
46
|
submission_id: e.submission_id ?? null,
|
|
47
47
|
transition_id: e.transition_id ?? null,
|
|
48
|
-
transition_label: e.transition_label ?? null
|
|
48
|
+
transition_label: e.transition_label ?? null,
|
|
49
|
+
// An older server sends neither: keep the one button it always had.
|
|
50
|
+
can_resend: e.can_resend ?? !0,
|
|
51
|
+
can_send_current: e.can_send_current ?? !1
|
|
49
52
|
};
|
|
50
53
|
});
|
|
51
54
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
function
|
|
1
|
+
const i = /* @__PURE__ */ new Set(["id", "po", "req", "url", "sku", "uom", "erp", "api", "ids", "mwf"]);
|
|
2
|
+
function r(n) {
|
|
3
3
|
const t = n.trim().replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[_\s.-]+/).filter(Boolean).map((e) => e.toLowerCase());
|
|
4
|
-
return t.length === 0 ? n : t.map((e,
|
|
4
|
+
return t.length === 0 ? n : t.map((e, s) => i.has(e) ? e === "ids" ? "IDs" : e.toUpperCase() : s === 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e).join(" ");
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function o(n) {
|
|
7
7
|
const t = String(n ?? "").trim();
|
|
8
8
|
let e = /^skip_when_empty: (.+) empty$/.exec(t);
|
|
9
|
-
return e ? `this record has no ${
|
|
9
|
+
return e ? `this record has no ${r(e[1])} yet` : (e = /^skip_unless_any: none of (.+) is set$/.exec(t), e ? `this record has none of ${e[1].split(/,\s*/).filter(Boolean).map(r).join(", ")} yet` : (e = /^guard unmet: (.+)$/.exec(t), e ? `its send condition was not met (${e[1]})` : (e = /^not configured: (.+) missing on the action$/.exec(t), e ? `the send is not set up yet (${e[1]} is missing)` : (e = /^payload template error: (.+)$/.exec(t), e ? `the message could not be built (${e[1]})` : (e = /^flow condition rejected at "(.+)"$/.exec(t), e ? `a flow step ("${e[1]}") stopped it` : /^no send was ever attempted\b/.test(t) ? "nothing was sent when this changed" : t)))));
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
|
-
|
|
12
|
+
o as plainObligationReason
|
|
13
13
|
};
|
|
@@ -1,29 +1,39 @@
|
|
|
1
|
-
import { get as
|
|
2
|
-
function
|
|
3
|
-
const
|
|
4
|
-
for (const
|
|
5
|
-
if (
|
|
6
|
-
const
|
|
7
|
-
(
|
|
1
|
+
import { get as a } from "./commands.js";
|
|
2
|
+
function r(o, t, c) {
|
|
3
|
+
const e = [];
|
|
4
|
+
for (const n of c) {
|
|
5
|
+
if (n.values.length === 0 || n.collection === o) continue;
|
|
6
|
+
const l = t.find(
|
|
7
|
+
(i) => i.many_collection === o && i.one_collection === n.collection && !i.junction_field && !!i.many_field
|
|
8
8
|
);
|
|
9
|
-
if (!
|
|
10
|
-
const
|
|
11
|
-
(
|
|
9
|
+
if (!l) continue;
|
|
10
|
+
const f = t.find(
|
|
11
|
+
(i) => i.many_collection === n.collection && i.one_collection === o && !i.junction_field
|
|
12
12
|
);
|
|
13
|
-
|
|
14
|
-
[
|
|
13
|
+
f && f.one_field && !l.one_field || e.push({
|
|
14
|
+
[l.many_field]: n.field === "id" ? { _in: n.values } : { [n.field]: { _in: n.values } }
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return e.length === 0 ? null : e.length === 1 ? e[0] : { _and: e };
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
21
|
-
queryKey: ["cascade-relations",
|
|
22
|
-
queryFn: () =>
|
|
19
|
+
function s(o, t, c) {
|
|
20
|
+
return t.fetchQuery({
|
|
21
|
+
queryKey: ["cascade-relations", c],
|
|
22
|
+
queryFn: () => o.request(a(`/data-model/relations/for/${c}`)).then((e) => e.data ?? []).catch(() => []),
|
|
23
23
|
staleTime: 10 * 6e4
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
+
function d(o, t) {
|
|
27
|
+
if (!t) return [];
|
|
28
|
+
const c = [];
|
|
29
|
+
for (const e of t.dimensions) {
|
|
30
|
+
const n = t.restricted[e.name] ?? [];
|
|
31
|
+
n.length === 0 || e.target_collection === o || c.push({ collection: e.target_collection, field: "id", values: n });
|
|
32
|
+
}
|
|
33
|
+
return c;
|
|
34
|
+
}
|
|
26
35
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
r as cascadeFilter,
|
|
37
|
+
s as fetchCascadeRelations,
|
|
38
|
+
d as restrictedScopeSelections
|
|
29
39
|
};
|
|
@@ -1,55 +1,73 @@
|
|
|
1
|
-
import { normalizeRecordConditions as a, recordMatchesAll as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
1
|
+
import { normalizeRecordConditions as a, recordMatchesAll as m } from "./record-conditions.js";
|
|
2
|
+
const d = "__none__", c = { default: "edit", rules: [] };
|
|
3
|
+
function _(e) {
|
|
4
4
|
if (!e || typeof e != "object") return c;
|
|
5
|
-
const
|
|
6
|
-
if (Array.isArray(
|
|
7
|
-
for (const
|
|
8
|
-
if (!
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
roles: Array.isArray(
|
|
12
|
-
states: Array.isArray(
|
|
13
|
-
states_op:
|
|
14
|
-
conditions: a(
|
|
15
|
-
mode:
|
|
5
|
+
const t = e, o = t.default === "summary" ? "summary" : "edit", n = [];
|
|
6
|
+
if (Array.isArray(t.rules))
|
|
7
|
+
for (const r of t.rules) {
|
|
8
|
+
if (!r || typeof r != "object") continue;
|
|
9
|
+
const s = r;
|
|
10
|
+
n.push({
|
|
11
|
+
roles: Array.isArray(s.roles) ? s.roles.map(String) : null,
|
|
12
|
+
states: Array.isArray(s.states) ? s.states.map(String) : null,
|
|
13
|
+
states_op: s.states_op === "not_in" ? "not_in" : "in",
|
|
14
|
+
conditions: a(s.conditions),
|
|
15
|
+
mode: s.mode === "summary" ? "summary" : "edit"
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
return { default:
|
|
18
|
+
return { default: o, rules: n, ...t.edit_lock ? { edit_lock: t.edit_lock } : {} };
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
var
|
|
22
|
-
return (((
|
|
23
|
-
})),
|
|
24
|
-
var
|
|
25
|
-
return (((
|
|
26
|
-
})), R = (e) => !!(e != null && e.rules.some((
|
|
27
|
-
var
|
|
28
|
-
return (((
|
|
20
|
+
const S = (e) => !!(e != null && e.rules.some((t) => {
|
|
21
|
+
var o;
|
|
22
|
+
return (((o = t.roles) == null ? void 0 : o.length) ?? 0) > 0;
|
|
23
|
+
})), p = (e) => !!(e != null && e.rules.some((t) => {
|
|
24
|
+
var o;
|
|
25
|
+
return (((o = t.states) == null ? void 0 : o.length) ?? 0) > 0;
|
|
26
|
+
})), R = (e) => !!(e != null && e.rules.some((t) => {
|
|
27
|
+
var o;
|
|
28
|
+
return (((o = t.conditions) == null ? void 0 : o.length) ?? 0) > 0;
|
|
29
29
|
}));
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
if (
|
|
33
|
-
const
|
|
34
|
-
for (const
|
|
35
|
-
const l =
|
|
36
|
-
if (l.length > 0 && (!
|
|
37
|
-
const u =
|
|
30
|
+
function A(e, t) {
|
|
31
|
+
var r;
|
|
32
|
+
if (t.isNew || !e) return "edit";
|
|
33
|
+
const o = t.role ? t.role.toLowerCase() : null, n = t.stateKey ?? d;
|
|
34
|
+
for (const s of e.rules) {
|
|
35
|
+
const l = s.roles ?? [];
|
|
36
|
+
if (l.length > 0 && (!o || !l.some((i) => i.toLowerCase() === o))) continue;
|
|
37
|
+
const u = s.states ?? [];
|
|
38
38
|
if (u.length > 0) {
|
|
39
|
-
const i = u.includes(
|
|
40
|
-
if (!(
|
|
39
|
+
const i = u.includes(n);
|
|
40
|
+
if (!(s.states_op === "not_in" ? !i : i)) continue;
|
|
41
41
|
}
|
|
42
|
-
if (!((((
|
|
43
|
-
return
|
|
42
|
+
if (!((((r = s.conditions) == null ? void 0 : r.length) ?? 0) > 0 && (!t.record || !m(t.record, s.conditions))))
|
|
43
|
+
return s.mode;
|
|
44
44
|
}
|
|
45
45
|
return e.default;
|
|
46
46
|
}
|
|
47
|
+
function h(e, t, o) {
|
|
48
|
+
return JSON.stringify([e, t ?? null, o ? o.toLowerCase() : null]);
|
|
49
|
+
}
|
|
50
|
+
function N(e, t) {
|
|
51
|
+
if (!e) return !1;
|
|
52
|
+
try {
|
|
53
|
+
const o = JSON.parse(e);
|
|
54
|
+
return Array.isArray(o) && o[0] === t;
|
|
55
|
+
} catch {
|
|
56
|
+
return !1;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function M(e) {
|
|
60
|
+
return !e.first && (e.unsaved || e.lineDrafts > 0);
|
|
61
|
+
}
|
|
47
62
|
export {
|
|
48
63
|
c as EMPTY_SUMMARY_RULES,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
d as NO_STATE,
|
|
65
|
+
M as holdSummaryReresolve,
|
|
66
|
+
_ as normalizeSummaryModeRules,
|
|
67
|
+
A as resolveSummaryMode,
|
|
68
|
+
N as sameSummaryRecord,
|
|
69
|
+
h as summaryResolveSignature,
|
|
52
70
|
R as summaryRulesNeedRecord,
|
|
53
|
-
|
|
54
|
-
|
|
71
|
+
S as summaryRulesNeedRole,
|
|
72
|
+
p as summaryRulesNeedState
|
|
55
73
|
};
|