@declarion/react 0.87.0 → 0.89.0
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-lib/app.js +28 -28
- package/dist-lib/components/actions/ActionButton.js +86 -85
- package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
- package/dist-lib/components/actions/ActionRunner.js +47 -47
- package/dist-lib/components/actions/ObjectActionBar.js +9 -9
- package/dist-lib/components/actions/RowActionsKebab.js +19 -19
- package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
- package/dist-lib/components/chrome/AssociationTabs.js +21 -21
- package/dist-lib/components/chrome/RecordHeader.js +33 -40
- package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
- package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
- package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
- package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
- package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
- package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
- package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
- package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
- package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
- package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
- package/dist-lib/components/fields/FileReferenceField.js +9 -9
- package/dist-lib/components/fields/StructureField.js +57 -47
- package/dist-lib/components/fields/TimestampField.js +59 -54
- package/dist-lib/components/fields/cells/factories/money.js +14 -23
- package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
- package/dist-lib/components/fields/cells/factories/text.js +18 -3
- package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
- package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
- package/dist-lib/components/layout/Layout.js +306 -361
- package/dist-lib/components/layout/Rail.js +42 -41
- package/dist-lib/components/layout/Sidebar.js +132 -117
- package/dist-lib/components/layout/TabStrip.js +116 -115
- package/dist-lib/components/layout/TenantChip.js +47 -54
- package/dist-lib/components/layout/TopBar.js +108 -105
- package/dist-lib/components/list/InlineEditCell.js +23 -23
- package/dist-lib/components/list/QuickPeek.js +65 -66
- package/dist-lib/components/pages/DocumentsMenu.js +42 -42
- package/dist-lib/components/pages/ExportMenu.js +25 -25
- package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
- package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
- package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
- package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
- package/dist-lib/components/pages/auth/AuthShell.js +73 -73
- package/dist-lib/components/pages/auth/SignIn.js +32 -32
- package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
- package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
- package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
- package/dist-lib/components/pages/list/ListHeader.js +19 -19
- package/dist-lib/components/pages/list/ListNoRows.js +15 -15
- package/dist-lib/components/pages/list/ListToolbar.js +145 -145
- package/dist-lib/components/pages/list/useActiveView.js +14 -5
- package/dist-lib/components/pages/list/useListQuery.js +121 -81
- package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
- package/dist-lib/components/pages/list/useRowMenu.js +7 -7
- package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
- package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
- package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
- package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
- package/dist-lib/hooks/useAuth.js +11 -11
- package/dist-lib/hooks/useBranding.js +4 -4
- package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
- package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
- package/dist-lib/hooks/useImpersonation.js +6 -6
- package/dist-lib/hooks/useMutations.js +23 -23
- package/dist-lib/hooks/useObjectStatus.js +5 -5
- package/dist-lib/hooks/useParams.js +59 -51
- package/dist-lib/hooks/useProperties.js +8 -8
- package/dist-lib/hooks/useRowTenant.js +18 -6
- package/dist-lib/hooks/useText.js +9 -7
- package/dist-lib/hooks/useUiPreferences.js +71 -0
- package/dist-lib/index.d.ts +22 -6
- package/dist-lib/index.js +127 -126
- package/dist-lib/lib/actions.js +116 -84
- package/dist-lib/lib/child-config.js +10 -1
- package/dist-lib/lib/format-count.js +16 -1
- package/dist-lib/lib/language.js +23 -21
- package/dist-lib/lib/money-text.js +29 -0
- package/dist-lib/lib/profile.js +4 -0
- package/dist-lib/lib/role-label.js +8 -0
- package/dist-lib/lib/schema-routing.js +34 -14
- package/dist-lib/lib/shortcut.js +10 -0
- package/dist-lib/lib/timestamp.js +93 -31
- package/dist-lib/stores/auth.js +9 -8
- package/dist-lib/stores/preferences.js +56 -17
- package/dist-lib/testing.d.ts +1 -1
- package/dist-lib/testing.js +25 -28
- package/dist-lib/types/schema.js +33 -27
- package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
- package/package.json +1 -1
package/dist-lib/lib/actions.js
CHANGED
|
@@ -18,30 +18,62 @@ function u(t, i) {
|
|
|
18
18
|
let a = t.id;
|
|
19
19
|
return typeof a == "string" ? a : a == null ? "" : e(a);
|
|
20
20
|
}
|
|
21
|
-
function d(e, t) {
|
|
21
|
+
function d(e, t, n) {
|
|
22
22
|
if (!e || e.length === 0) return !0;
|
|
23
|
-
for (let
|
|
24
|
-
if (
|
|
23
|
+
for (let r of e) {
|
|
24
|
+
if (r.status && r.status.length > 0) {
|
|
25
25
|
let e = t.status;
|
|
26
|
-
if (typeof e != "string" || !
|
|
26
|
+
if (typeof e != "string" || !r.status.includes(e)) return !1;
|
|
27
27
|
}
|
|
28
|
-
if (
|
|
28
|
+
if (r.field && !h(r, t, n)) return !1;
|
|
29
29
|
}
|
|
30
30
|
return !0;
|
|
31
31
|
}
|
|
32
32
|
function f(e, t) {
|
|
33
33
|
return t.startsWith("$status.") ? !Array.isArray(e.$statuses) : t.startsWith("$property.") ? !Array.isArray(e.$properties) : !1;
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
var p = {
|
|
36
|
+
"$user.id": "userId",
|
|
37
|
+
"$user.email": "email",
|
|
38
|
+
"$user.tenant_id": "tenantId"
|
|
39
|
+
};
|
|
40
|
+
function m(e, t) {
|
|
41
|
+
if (Array.isArray(e)) {
|
|
42
|
+
let n = e.map((e) => m(e, t));
|
|
43
|
+
return {
|
|
44
|
+
value: n.map((e) => e.value),
|
|
45
|
+
resolved: n.every((e) => e.resolved)
|
|
46
|
+
};
|
|
41
47
|
}
|
|
42
|
-
|
|
48
|
+
if (typeof e != "string" || !(e in p)) return {
|
|
49
|
+
value: e,
|
|
50
|
+
resolved: !0
|
|
51
|
+
};
|
|
52
|
+
let n = t?.[p[e]];
|
|
53
|
+
return n ? {
|
|
54
|
+
value: n,
|
|
55
|
+
resolved: !0
|
|
56
|
+
} : {
|
|
57
|
+
value: void 0,
|
|
58
|
+
resolved: !1
|
|
59
|
+
};
|
|
43
60
|
}
|
|
44
|
-
function
|
|
61
|
+
function h(t, n, r) {
|
|
62
|
+
let { value: i, resolved: a } = m(t.value, r);
|
|
63
|
+
if (!a) return !1;
|
|
64
|
+
let o = {
|
|
65
|
+
...t,
|
|
66
|
+
value: i
|
|
67
|
+
};
|
|
68
|
+
if (f(n, o.field)) return !1;
|
|
69
|
+
let s = g(n, o.field), c = o.op || "eq";
|
|
70
|
+
if (c === "in" || c === "not_in") {
|
|
71
|
+
let t = Array.isArray(o.value) ? o.value : [o.value], n = e(s), r = t.some((t) => e(t) === n);
|
|
72
|
+
return c === "in" ? r : !r;
|
|
73
|
+
}
|
|
74
|
+
return typeof o.value == "boolean" && c === "eq" ? v(s) === o.value : typeof s == "number" && typeof o.value == "number" ? y(s, o.value, c) : y(e(s), e(o.value), c);
|
|
75
|
+
}
|
|
76
|
+
function g(e, t) {
|
|
45
77
|
if (Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
46
78
|
if (t.startsWith("$status.")) {
|
|
47
79
|
let n = t.slice(8), r = e.$statuses;
|
|
@@ -52,27 +84,27 @@ function m(e, t) {
|
|
|
52
84
|
return Array.isArray(r) ? r.find((e) => !e || typeof e != "object" ? !1 : e.property_code === n)?.value : void 0;
|
|
53
85
|
}
|
|
54
86
|
}
|
|
55
|
-
function
|
|
87
|
+
function _(e) {
|
|
56
88
|
let t = null, n = (n, r) => {
|
|
57
89
|
Object.prototype.hasOwnProperty.call(e, n) || (t === null && (t = { ...e }), t[n] = r);
|
|
58
90
|
}, r = e.$statuses;
|
|
59
91
|
if (Array.isArray(r)) for (let t of r) {
|
|
60
92
|
if (!t || typeof t != "object") continue;
|
|
61
93
|
let r = t.group_code;
|
|
62
|
-
typeof r == "string" && n(`$status.${r}`,
|
|
94
|
+
typeof r == "string" && n(`$status.${r}`, g(e, `$status.${r}`));
|
|
63
95
|
}
|
|
64
96
|
let i = e.$properties;
|
|
65
97
|
if (Array.isArray(i)) for (let t of i) {
|
|
66
98
|
if (!t || typeof t != "object") continue;
|
|
67
99
|
let r = t.property_code;
|
|
68
|
-
typeof r == "string" && n(`$property.${r}`,
|
|
100
|
+
typeof r == "string" && n(`$property.${r}`, g(e, `$property.${r}`));
|
|
69
101
|
}
|
|
70
102
|
return t ?? e;
|
|
71
103
|
}
|
|
72
|
-
function
|
|
104
|
+
function v(e) {
|
|
73
105
|
return e == null ? !1 : typeof e == "boolean" ? e : typeof e == "string" ? e !== "" : typeof e != "number" || e !== 0;
|
|
74
106
|
}
|
|
75
|
-
function
|
|
107
|
+
function y(e, t, n) {
|
|
76
108
|
switch (n) {
|
|
77
109
|
case "eq": return e === t;
|
|
78
110
|
case "ne": return e !== t;
|
|
@@ -85,14 +117,14 @@ function _(e, t, n) {
|
|
|
85
117
|
default: return !1;
|
|
86
118
|
}
|
|
87
119
|
}
|
|
88
|
-
function
|
|
120
|
+
function b(e, t) {
|
|
89
121
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).map(([e, t]) => ({
|
|
90
122
|
code: e,
|
|
91
123
|
action: t
|
|
92
124
|
})) : [];
|
|
93
125
|
}
|
|
94
|
-
function
|
|
95
|
-
return !e && !r ? [] : t === void 0 ?
|
|
126
|
+
function x(e, t, n, r) {
|
|
127
|
+
return !e && !r ? [] : t === void 0 ? b(e, n) : t.map((t) => {
|
|
96
128
|
let n = e?.[t] ?? r?.[t];
|
|
97
129
|
return n ? {
|
|
98
130
|
code: t,
|
|
@@ -100,37 +132,37 @@ function y(e, t, n, r) {
|
|
|
100
132
|
} : null;
|
|
101
133
|
}).filter((e) => e !== null);
|
|
102
134
|
}
|
|
103
|
-
function
|
|
135
|
+
function S(e, t) {
|
|
104
136
|
let n = a[e];
|
|
105
137
|
return !n || n === "create" ? () => !0 : (e) => i(t.entity, e, t.tenantId);
|
|
106
138
|
}
|
|
107
|
-
function
|
|
139
|
+
function C(e, n) {
|
|
108
140
|
return e.filter(({ code: e }) => {
|
|
109
141
|
let r = a[e];
|
|
110
142
|
return !r || t(n, r);
|
|
111
143
|
});
|
|
112
144
|
}
|
|
113
|
-
function
|
|
114
|
-
return e?.type !== "list" || !e.entity || !t(n, "create") ? !1 : x(
|
|
145
|
+
function w(e, n, r) {
|
|
146
|
+
return e?.type !== "list" || !e.entity || !t(n, "create") ? !1 : C(x(n?.actions, e.actions, "list_toolbar", r), n).some(({ code: e }) => e === "__new" || e === "__create");
|
|
115
147
|
}
|
|
116
|
-
function
|
|
148
|
+
function T(e) {
|
|
117
149
|
return !!e?.confirmation && Object.keys(e.confirmation).length > 0;
|
|
118
150
|
}
|
|
119
|
-
function
|
|
120
|
-
return
|
|
151
|
+
function E(e, t) {
|
|
152
|
+
return T(t) ? e(t.confirmation) : t?.destructive ? e("action.confirm.destructive", "This action cannot be undone.") : null;
|
|
121
153
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
154
|
+
function D(e) {
|
|
155
|
+
return T(e) || !!e?.destructive;
|
|
124
156
|
}
|
|
125
|
-
function
|
|
157
|
+
function O(e, t, n, r, i, a = !1) {
|
|
126
158
|
if (r && i) return i;
|
|
127
159
|
let o = e(t?.display?.description);
|
|
128
160
|
return o ? a || t?.display?.icon_only === !0 ? `${n}\n${o}` : o : n;
|
|
129
161
|
}
|
|
130
|
-
function
|
|
162
|
+
function k(e) {
|
|
131
163
|
return !!e.association;
|
|
132
164
|
}
|
|
133
|
-
function
|
|
165
|
+
function A(e, t) {
|
|
134
166
|
if (e) {
|
|
135
167
|
for (let n of Object.values(e.screens)) if (n.entity === t && n.type === "list") {
|
|
136
168
|
let r = e.entities[t];
|
|
@@ -141,21 +173,21 @@ function O(e, t) {
|
|
|
141
173
|
}
|
|
142
174
|
}
|
|
143
175
|
}
|
|
144
|
-
function
|
|
176
|
+
function j(e, t, n, r, i, a, o, s) {
|
|
145
177
|
let c = [];
|
|
146
178
|
for (let l of t) {
|
|
147
|
-
let t =
|
|
179
|
+
let t = M(e, l, n, r, i, a, o, s);
|
|
148
180
|
t !== null && c.push(t);
|
|
149
181
|
}
|
|
150
182
|
return c;
|
|
151
183
|
}
|
|
152
|
-
function
|
|
153
|
-
return t.kind === "group" ?
|
|
184
|
+
function M(e, t, n, r, i, a, o, s) {
|
|
185
|
+
return t.kind === "group" ? N(e, t, n, r, i, a, o, s) : P(e, t, n, r, i, a, o, s);
|
|
154
186
|
}
|
|
155
|
-
function
|
|
187
|
+
function N(e, t, n, r, i, a, o, s) {
|
|
156
188
|
let c = [];
|
|
157
189
|
for (let l of t.items) {
|
|
158
|
-
let t =
|
|
190
|
+
let t = M(e, l, n, r, i, a, o, s);
|
|
159
191
|
t !== null && c.push(t);
|
|
160
192
|
}
|
|
161
193
|
return c.length === 0 ? null : {
|
|
@@ -163,72 +195,72 @@ function j(e, t, n, r, i, a, o, s) {
|
|
|
163
195
|
items: c
|
|
164
196
|
};
|
|
165
197
|
}
|
|
166
|
-
function
|
|
198
|
+
function P(e, t, n, r, i, a, o, s) {
|
|
167
199
|
if (s && !t.code.startsWith("__") && !s.has(t.code)) return null;
|
|
168
|
-
let c =
|
|
200
|
+
let c = L(t.code, n, r);
|
|
169
201
|
if (!c) return null;
|
|
170
|
-
let l =
|
|
202
|
+
let l = S(t.code, o);
|
|
171
203
|
if (a.length > 0) {
|
|
172
|
-
let n =
|
|
204
|
+
let n = F(e, c, a, l, o);
|
|
173
205
|
return n.visible ? {
|
|
174
206
|
...t,
|
|
175
207
|
enabled: n.enabled,
|
|
176
208
|
reason: n.reason
|
|
177
209
|
} : null;
|
|
178
210
|
}
|
|
179
|
-
if (!l(i) || !d(c.conditions, i) || !d(
|
|
180
|
-
let { enabled: u, reason: f } =
|
|
211
|
+
if (!l(i) || !d(c.conditions, i, o) || !d(R(c.visible_if), i, o)) return null;
|
|
212
|
+
let { enabled: u, reason: f } = I(e, c, i, o);
|
|
181
213
|
return {
|
|
182
214
|
...t,
|
|
183
215
|
enabled: u,
|
|
184
216
|
reason: f
|
|
185
217
|
};
|
|
186
218
|
}
|
|
187
|
-
function
|
|
188
|
-
let
|
|
219
|
+
function F(e, t, n, r, i) {
|
|
220
|
+
let a = R(t.visible_if), o = R(t.enabled_if), s = t.conditions, c = 0, l = 0, u = 0;
|
|
189
221
|
for (let e of n) {
|
|
190
222
|
let t = r(e);
|
|
191
|
-
t ||
|
|
192
|
-
let n = d(
|
|
193
|
-
n &&
|
|
194
|
-
let
|
|
195
|
-
(!n || !
|
|
223
|
+
t || u++;
|
|
224
|
+
let n = d(a, e, i) && d(s, e, i);
|
|
225
|
+
n && c++;
|
|
226
|
+
let f = t && d(o, e, i);
|
|
227
|
+
(!n || !f) && l++;
|
|
196
228
|
}
|
|
197
|
-
if (
|
|
229
|
+
if (c === 0) return {
|
|
198
230
|
visible: !1,
|
|
199
231
|
enabled: !1,
|
|
200
232
|
reason: null
|
|
201
233
|
};
|
|
202
|
-
if (
|
|
234
|
+
if (l === 0) return {
|
|
203
235
|
visible: !0,
|
|
204
236
|
enabled: !0,
|
|
205
237
|
reason: null
|
|
206
238
|
};
|
|
207
|
-
let
|
|
208
|
-
if (
|
|
239
|
+
let f = n.length;
|
|
240
|
+
if (u > 0) return {
|
|
209
241
|
visible: !0,
|
|
210
242
|
enabled: !1,
|
|
211
243
|
reason: e("action.bulk.rows_other_tenant", "{failing} of {total} selected rows are set in another tenant; change them from that tenant.", {
|
|
212
|
-
failing:
|
|
213
|
-
total:
|
|
244
|
+
failing: u,
|
|
245
|
+
total: f
|
|
214
246
|
})
|
|
215
247
|
};
|
|
216
|
-
let
|
|
217
|
-
failing:
|
|
218
|
-
total:
|
|
219
|
-
},
|
|
248
|
+
let p = {
|
|
249
|
+
failing: l,
|
|
250
|
+
total: f
|
|
251
|
+
}, m = e(t.enabled_if_reason);
|
|
220
252
|
return {
|
|
221
253
|
visible: !0,
|
|
222
254
|
enabled: !1,
|
|
223
|
-
reason:
|
|
224
|
-
reason:
|
|
225
|
-
...
|
|
226
|
-
}) : e("action.bulk.rows_fail", "({failing} of {total} rows fail)",
|
|
255
|
+
reason: m ? e("action.bulk.reason_rows_fail", "{reason} ({failing} of {total} rows fail)", {
|
|
256
|
+
reason: m,
|
|
257
|
+
...p
|
|
258
|
+
}) : e("action.bulk.rows_fail", "({failing} of {total} rows fail)", p)
|
|
227
259
|
};
|
|
228
260
|
}
|
|
229
|
-
function
|
|
230
|
-
let
|
|
231
|
-
return !
|
|
261
|
+
function I(e, t, n, r) {
|
|
262
|
+
let i = R(t.enabled_if);
|
|
263
|
+
return !i || i.length === 0 || d(i, n, r) ? {
|
|
232
264
|
enabled: !0,
|
|
233
265
|
reason: null
|
|
234
266
|
} : {
|
|
@@ -236,46 +268,46 @@ function P(e, t, n) {
|
|
|
236
268
|
reason: e(t.enabled_if_reason) || null
|
|
237
269
|
};
|
|
238
270
|
}
|
|
239
|
-
function
|
|
271
|
+
function L(e, t, n) {
|
|
240
272
|
if (t && e in t) return t[e];
|
|
241
273
|
if (n && e in n) return n[e];
|
|
242
274
|
}
|
|
243
|
-
function
|
|
275
|
+
function R(e) {
|
|
244
276
|
return e;
|
|
245
277
|
}
|
|
246
|
-
function
|
|
278
|
+
function z(e, t, n, r, i) {
|
|
247
279
|
let a = [];
|
|
248
280
|
for (let o of e) {
|
|
249
281
|
if (o.kind === "group") {
|
|
250
|
-
let e =
|
|
282
|
+
let e = z(o.items, t, n, r, i);
|
|
251
283
|
e.length > 0 && a.push({
|
|
252
284
|
...o,
|
|
253
285
|
items: e
|
|
254
286
|
});
|
|
255
287
|
continue;
|
|
256
288
|
}
|
|
257
|
-
let e =
|
|
289
|
+
let e = L(o.code, t, n);
|
|
258
290
|
e && e.visibility?.includes(r) && (i?.bulkRequired === void 0 || (i.bulkRequiredPredicate ? i.bulkRequiredPredicate(e) : !1) === i.bulkRequired) && (i?.excludeIf && i.excludeIf(e) || a.push(o));
|
|
259
291
|
}
|
|
260
292
|
return a;
|
|
261
293
|
}
|
|
262
|
-
function
|
|
294
|
+
function B(e, t, n, r, i, a) {
|
|
263
295
|
let o = e ?? t;
|
|
264
|
-
return o ?
|
|
296
|
+
return o ? z(o, n, r, i, a) : W(n, i);
|
|
265
297
|
}
|
|
266
|
-
function
|
|
267
|
-
return e.requires_selection === void 0 ?
|
|
298
|
+
function V(e) {
|
|
299
|
+
return e.requires_selection === void 0 ? H(e) : e.requires_selection;
|
|
268
300
|
}
|
|
269
|
-
function
|
|
301
|
+
function H(e) {
|
|
270
302
|
return e.visibility?.includes("list_floatbar") ?? !1;
|
|
271
303
|
}
|
|
272
|
-
function
|
|
304
|
+
function U(e, t, n, r, i) {
|
|
273
305
|
return e.map((e) => {
|
|
274
306
|
if (e.kind === "group") return {
|
|
275
307
|
...e,
|
|
276
|
-
items:
|
|
308
|
+
items: U(e.items, t, n, r, i)
|
|
277
309
|
};
|
|
278
|
-
let a =
|
|
310
|
+
let a = L(e.code, t, n);
|
|
279
311
|
return a && r(a) ? {
|
|
280
312
|
...e,
|
|
281
313
|
enabled: !1,
|
|
@@ -283,7 +315,7 @@ function V(e, t, n, r, i) {
|
|
|
283
315
|
} : e;
|
|
284
316
|
});
|
|
285
317
|
}
|
|
286
|
-
function
|
|
318
|
+
function W(e, t) {
|
|
287
319
|
return e ? Object.entries(e).filter(([, e]) => e.visibility?.includes(t)).sort(([e, t], [n, r]) => {
|
|
288
320
|
let i = t.position ?? 0, a = r.position ?? 0;
|
|
289
321
|
return i === a ? e < n ? -1 : +(e > n) : i - a;
|
|
@@ -295,4 +327,4 @@ function H(e, t) {
|
|
|
295
327
|
})) : [];
|
|
296
328
|
}
|
|
297
329
|
//#endregion
|
|
298
|
-
export { c as EDIT_ACTION_CODE, s as OPEN_ACTION_CODE, o as PEEK_ACTION_CODE,
|
|
330
|
+
export { c as EDIT_ACTION_CODE, s as OPEN_ACTION_CODE, o as PEEK_ACTION_CODE, g as actionConditionFieldValue, E as actionConfirmMessage, H as actionInFloatbarSlot, D as actionNeedsConfirm, V as actionRequiresSelection, O as actionTooltip, j as applyRowState, W as defaultFlatForSlot, U as disableLeavesWhere, d as evaluateConditions, z as filterLayoutForSlot, C as filterUnavailableMutationActions, A as findListScreenForEntity, b as getActionsByVisibility, x as getScreenActions, k as isAssociationAction, l as isNavDefaultCode, B as resolveActionLayoutForSlot, u as rowDetailId, w as screenOffersCreate, _ as withActionConditionFields };
|
|
@@ -107,5 +107,14 @@ function m(e) {
|
|
|
107
107
|
function h(e, t) {
|
|
108
108
|
return e.children?.find((e) => e.entity === t);
|
|
109
109
|
}
|
|
110
|
+
function g(t, n) {
|
|
111
|
+
return !!t.editable && t.interaction !== "navigate" && t.interaction !== "readonly" && e(n, "update") && t.mode === "table";
|
|
112
|
+
}
|
|
113
|
+
function _(e, t, r) {
|
|
114
|
+
if (e.associated) return !1;
|
|
115
|
+
if (!e.children) return !0;
|
|
116
|
+
let i = h(t, e.children), a = i ? r[i.entity] : void 0;
|
|
117
|
+
return !i || !a ? !1 : g(n(i, a, e), a);
|
|
118
|
+
}
|
|
110
119
|
//#endregion
|
|
111
|
-
export { h as findChildRelation, m as findPrimaryKey, s as inferColumns, o as inferSort, c as inferTimelineFields, n as resolveChildConfig };
|
|
120
|
+
export { g as editsChildrenInline, h as findChildRelation, m as findPrimaryKey, s as inferColumns, o as inferSort, c as inferTimelineFields, n as resolveChildConfig, _ as showsOnNewRecord };
|
|
@@ -20,5 +20,20 @@ function n(e, t) {
|
|
|
20
20
|
function r(e, r, i) {
|
|
21
21
|
return r === "estimated" ? t(e, i) : n(e, i);
|
|
22
22
|
}
|
|
23
|
+
function i(e, t, n) {
|
|
24
|
+
if (t !== "estimated") return {
|
|
25
|
+
total: e,
|
|
26
|
+
mode: t
|
|
27
|
+
};
|
|
28
|
+
if (n.page <= 1 && !n.hasMore) return {
|
|
29
|
+
total: n.rows,
|
|
30
|
+
mode: "exact"
|
|
31
|
+
};
|
|
32
|
+
let r = (Math.max(n.page, 1) - 1) * n.perPage + n.rows;
|
|
33
|
+
return {
|
|
34
|
+
total: Math.max(e, r),
|
|
35
|
+
mode: t
|
|
36
|
+
};
|
|
37
|
+
}
|
|
23
38
|
//#endregion
|
|
24
|
-
export { r as formatCount, t as formatEstimatedCount, n as formatExactCount };
|
|
39
|
+
export { i as correctEstimateAgainstWindow, r as formatCount, t as formatEstimatedCount, n as formatExactCount };
|
package/dist-lib/lib/language.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { browserTimeZone as e } from "./timestamp.js";
|
|
2
|
+
import { Fragment as t, createElement as n } from "react";
|
|
2
3
|
//#region src/lib/language.ts
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
if (e) for (let r of
|
|
4
|
+
var r = "en", i = "ui_language";
|
|
5
|
+
function a(e, t, n) {
|
|
6
|
+
if (e) for (let r of o(t, n)) {
|
|
6
7
|
let t = e[r];
|
|
7
8
|
if (t) return [r, t];
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
|
-
function
|
|
11
|
+
function o(e, t) {
|
|
11
12
|
let n = [];
|
|
12
13
|
for (let r of [
|
|
13
14
|
e,
|
|
@@ -21,32 +22,33 @@ function a(e, t) {
|
|
|
21
22
|
}
|
|
22
23
|
return n;
|
|
23
24
|
}
|
|
24
|
-
function o(e, t, n) {
|
|
25
|
-
return i(e, t, n)?.[1];
|
|
26
|
-
}
|
|
27
25
|
function s(e, t, n) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
return a(e, t, n)?.[1];
|
|
27
|
+
}
|
|
28
|
+
function c(t, n, r, i = e()) {
|
|
29
|
+
function a(e, i, a) {
|
|
30
|
+
if (typeof e != "string") return s(e, n, r) ?? "";
|
|
31
|
+
let o = s(t?.[e], n, r) ?? i ?? "";
|
|
32
|
+
return a ? o.replace(/\{(\w+)\}/g, (e, t) => Object.hasOwn(a, t) ? String(a[t]) : e) : o;
|
|
32
33
|
}
|
|
33
|
-
return Object.assign(
|
|
34
|
-
language:
|
|
35
|
-
deploymentLanguage:
|
|
34
|
+
return Object.assign(a, {
|
|
35
|
+
language: n,
|
|
36
|
+
deploymentLanguage: r,
|
|
37
|
+
timeZone: i
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
|
-
function
|
|
40
|
+
function l(e, t, n, r, i) {
|
|
39
41
|
let a = new Intl.PluralRules(e.language).select(n), o = {
|
|
40
42
|
...i,
|
|
41
43
|
count: new Intl.NumberFormat(e.language).format(n)
|
|
42
44
|
};
|
|
43
45
|
return e(`${t}.${a}`, "", o) || e(`${t}.other`, a === "one" ? r.one : r.other, o);
|
|
44
46
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
let a = /^\{(\w+)\}$/.exec(
|
|
48
|
-
return t
|
|
47
|
+
function u(e, r) {
|
|
48
|
+
return e.split(/(\{[A-Za-z_][A-Za-z0-9_]*\})/).filter((e) => e !== "").map((e, i) => {
|
|
49
|
+
let a = /^\{(\w+)\}$/.exec(e)?.[1];
|
|
50
|
+
return n(t, { key: i }, a !== void 0 && Object.hasOwn(r, a) ? r[a] : e);
|
|
49
51
|
});
|
|
50
52
|
}
|
|
51
53
|
//#endregion
|
|
52
|
-
export {
|
|
54
|
+
export { i as LANGUAGE_PARAMETER, r as MANDATORY_LANGUAGE, o as languageLookup, c as makeTextFn, s as pickLocalized, a as pickLocalizedEntry, l as pluralText, u as textWithNodes };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/lib/money-text.ts
|
|
2
|
+
var e = /* @__PURE__ */ new Map();
|
|
3
|
+
function t(t, n) {
|
|
4
|
+
let r = e.get(t);
|
|
5
|
+
return r || (r = n(), e.set(t, r)), r;
|
|
6
|
+
}
|
|
7
|
+
function n(e, t) {
|
|
8
|
+
return new Intl.NumberFormat(e, {
|
|
9
|
+
style: "currency",
|
|
10
|
+
currency: t
|
|
11
|
+
}).resolvedOptions().maximumFractionDigits ?? 2;
|
|
12
|
+
}
|
|
13
|
+
function r(e, r) {
|
|
14
|
+
let { language: i, currency: a } = r, o = r.currencyDisplay ?? "code", s = typeof e == "number" ? e : Number(e), c = typeof e == "number" ? e : e.trim(), l = n(i, a), u = 10 ** -l, d = s !== 0 && Math.abs(s) < u;
|
|
15
|
+
return t(`${i}:${a}:${o}:${d ? "small" : "minor"}`, () => new Intl.NumberFormat(i, d ? {
|
|
16
|
+
style: "currency",
|
|
17
|
+
currency: a,
|
|
18
|
+
currencyDisplay: o,
|
|
19
|
+
maximumSignificantDigits: 4
|
|
20
|
+
} : {
|
|
21
|
+
style: "currency",
|
|
22
|
+
currency: a,
|
|
23
|
+
currencyDisplay: o,
|
|
24
|
+
minimumFractionDigits: l,
|
|
25
|
+
maximumFractionDigits: l
|
|
26
|
+
})).format(c);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { n as currencyMinorUnits, r as formatMoneyText };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/lib/role-label.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
if (e?.is_tenant_owner) return t("profile.role.owner", "Owner");
|
|
4
|
+
let n = (e?.roles ?? []).map((n) => t(e?.role_names?.[n]) || n);
|
|
5
|
+
return n.length > 0 ? n.join(", ") : t("profile.role.none", "No role");
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as activeRoleLabel };
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
var e = /* @__PURE__ */ new Set(["/preferences", "/admin/catalog"]);
|
|
3
3
|
function t(e) {
|
|
4
4
|
if (!e?.navigation) return null;
|
|
5
|
-
let t
|
|
6
|
-
|
|
7
|
-
if (
|
|
8
|
-
let r = a(e, t);
|
|
9
|
-
if (r) return r;
|
|
5
|
+
for (let t of e.areas ?? []) {
|
|
6
|
+
let n = a(e, t.code);
|
|
7
|
+
if (n) return n;
|
|
10
8
|
}
|
|
11
9
|
for (let t of e.navigation) {
|
|
12
|
-
let n =
|
|
10
|
+
let n = o(e, t);
|
|
13
11
|
if (n) return n;
|
|
14
12
|
}
|
|
15
13
|
return null;
|
|
@@ -17,9 +15,9 @@ function t(e) {
|
|
|
17
15
|
function n(n, i) {
|
|
18
16
|
let a = t(i) || "/";
|
|
19
17
|
if (!i || n === "/" || n === "/admin") return a;
|
|
20
|
-
let
|
|
21
|
-
if (e.has(
|
|
22
|
-
for (let e of Object.values(i.screens ?? {})) if (e.route &&
|
|
18
|
+
let o = r(n);
|
|
19
|
+
if (e.has(o)) return n;
|
|
20
|
+
for (let e of Object.values(i.screens ?? {})) if (e.route && s(i, e) && c(e.route).test(o)) return n;
|
|
23
21
|
return a;
|
|
24
22
|
}
|
|
25
23
|
function r(e) {
|
|
@@ -28,24 +26,46 @@ function r(e) {
|
|
|
28
26
|
}
|
|
29
27
|
function i(e, t) {
|
|
30
28
|
let n = e.screens[t];
|
|
31
|
-
return !!n &&
|
|
29
|
+
return !!n && s(e, n);
|
|
32
30
|
}
|
|
33
31
|
function a(e, t) {
|
|
32
|
+
let n = e.areas?.find((e) => e.code === t)?.home_screen;
|
|
33
|
+
if (n && i(e, n)) return e.screens[n].route;
|
|
34
|
+
for (let n of e.navigation ?? []) {
|
|
35
|
+
if ((n.area || "default") !== t) continue;
|
|
36
|
+
let r = o(e, n);
|
|
37
|
+
if (r) return r;
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
function o(e, t) {
|
|
34
42
|
if (t.screen && i(e, t.screen)) return e.screens[t.screen].route;
|
|
35
43
|
for (let n of [...t.items ?? [], ...t.children ?? []]) {
|
|
36
|
-
let t =
|
|
44
|
+
let t = o(e, n);
|
|
37
45
|
if (t) return t;
|
|
38
46
|
}
|
|
39
47
|
return null;
|
|
40
48
|
}
|
|
41
|
-
function
|
|
49
|
+
function s(e, t) {
|
|
42
50
|
if (t.type !== "list") return !0;
|
|
43
51
|
let n = t.entity;
|
|
44
52
|
return !(n ? e.entities?.[n] : void 0)?.singleton;
|
|
45
53
|
}
|
|
46
|
-
function
|
|
54
|
+
function c(e) {
|
|
47
55
|
let t = e.replace(/\/+$/, "").split("/").map((e) => e.startsWith(":") ? "[^/]+" : e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
48
56
|
return RegExp("^" + t.join("/") + "$");
|
|
49
57
|
}
|
|
58
|
+
function l(e, t, n) {
|
|
59
|
+
let r = null, i = -1, a = (e, o, s) => {
|
|
60
|
+
let c = [...o, e], l = e.screen ? t[e.screen]?.route : void 0;
|
|
61
|
+
l && l.length > i && (l === n || n.startsWith(l + "/")) && (r = {
|
|
62
|
+
chain: c,
|
|
63
|
+
area: s
|
|
64
|
+
}, i = l.length);
|
|
65
|
+
for (let t of [...e.items ?? [], ...e.children ?? []]) a(t, c, s);
|
|
66
|
+
};
|
|
67
|
+
for (let t of e ?? []) a(t, [], t.area || "default");
|
|
68
|
+
return r;
|
|
69
|
+
}
|
|
50
70
|
//#endregion
|
|
51
|
-
export { n as accessibleRedirectPath, t as schemaDefaultRoute };
|
|
71
|
+
export { n as accessibleRedirectPath, a as areaRoute, l as findNavMatch, t as schemaDefaultRoute };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/lib/shortcut.ts
|
|
2
|
+
function e(e = typeof navigator > "u" ? void 0 : navigator) {
|
|
3
|
+
let t = e?.userAgentData?.platform || e?.platform || "";
|
|
4
|
+
return /mac|iphone|ipad|ipod/i.test(t);
|
|
5
|
+
}
|
|
6
|
+
function t(t, n = e()) {
|
|
7
|
+
return n ? `⌘${t}` : `Ctrl+${t}`;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { e as isApplePlatform, t as shortcutLabel };
|