@nxgt/material 3.82.0 → 3.84.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/CHANGELOG.md +40 -0
- package/README.md +4 -3
- package/dist/{alert-dialog-DXLJ4AZP.js → alert-dialog-1t6ULy5i.js} +1 -1
- package/dist/{async-slice-BfVokA46.js → async-slice-xyA9Uzct.js} +1 -1
- package/dist/{button-CSKUtMI3.js → button-DhiNGrdT.js} +1 -1
- package/dist/{calculator-Cv00UQgR.js → calculator-BcgxxScL.js} +10 -10
- package/dist/calculator-field.js +6 -6
- package/dist/{calculator-segment-CwnC2cV_.js → calculator-segment-C4WQAHcN.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-BGn0V6Pt.js → chip-m0_usuzd.js} +2 -2
- package/dist/{code-editor-B25-mWhb.js → code-editor-BgKFrcld.js} +4 -4
- package/dist/code-editor.js +4 -4
- package/dist/{code-language-items-oRjtO3qV.js → code-language-items-BWw17W9s.js} +2 -2
- package/dist/components/theme-tokens.css +3 -3
- package/dist/components/ui/collections/server-table/server-table-phone-row.css +12 -0
- package/dist/{components-BmZk-git.js → components-JPnObL9i.js} +8914 -8812
- package/dist/components.js +37 -37
- package/dist/{conversion-variant-wZd-G6xR.js → conversion-variant-DultZZQm.js} +3 -3
- package/dist/{currency-field-DizBTAat.js → currency-field-CPbaM7ay.js} +4 -4
- package/dist/{dialog-B-3s-oXt.js → dialog-DmlG9opW.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-C6rcYGB9.js → dropdown-menu-CDKev8dk.js} +1 -1
- package/dist/editor.js +7 -7
- package/dist/{empty-state-CSkghnD9.js → empty-state-C56000TB.js} +1 -1
- package/dist/{financial-variant-igpGRbGw.js → financial-variant-BYjQ690K.js} +5 -5
- package/dist/{hooks-k8_f3B0k.js → hooks-BTwLAy_A.js} +119 -83
- package/dist/hooks.js +3 -3
- package/dist/{hover-card-DuaVVKMb.js → hover-card-CDtW6utN.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-3ThP6EOl.js → icon-badge-ec7MmUGA.js} +1 -1
- package/dist/{icon-button-4PKlaI1g.js → icon-button-CG4aO8Gh.js} +1 -1
- package/dist/lib/components/ui/display/index.d.ts +1 -0
- package/dist/lib/components/ui/display/totals-list/index.d.ts +2 -0
- package/dist/lib/components/ui/display/totals-list/totals-list.d.ts +43 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/media/galleries/types.d.ts +8 -0
- package/dist/lib/components/ui/media/galleries/use-gallery.d.ts +1 -0
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-context.d.ts +6 -1
- package/dist/lib/components/ui/widgets/event-calendar/event-calendar-shell.d.ts +1 -1
- package/dist/lib/components/ui/widgets/event-calendar/index.d.ts +1 -1
- package/dist/lib/components/ui/widgets/event-calendar/partials/event-preview-title.d.ts +6 -2
- package/dist/lib/components/ui/widgets/event-calendar/partials/event-preview.d.ts +3 -1
- package/dist/lib/components/ui/widgets/event-calendar/template.types.d.ts +5 -1
- package/dist/lib/components/ui/widgets/event-calendar/types.d.ts +20 -0
- package/dist/lib/components/ui/widgets/event-calendar/use-template-calendar.d.ts +3 -1
- package/dist/lib/hooks/index.d.ts +1 -0
- package/dist/lib/hooks/poll.d.ts +26 -0
- package/dist/lib/hooks/use-poll.d.ts +30 -0
- package/dist/lib/i18n/resources/en/en.d.ts +1 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +1 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +1 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +1 -0
- package/dist/lib/i18n/resources/resources.d.ts +2 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +53 -53
- package/dist/map.js +7 -7
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{percent-field-QwU1l2Q4.js → percent-field-8_pILs15.js} +1 -1
- package/dist/{picker-surface-CiTycWgV.js → picker-surface-pyGv-Qh9.js} +4 -4
- package/dist/{popover-YmbzbKQG.js → popover-3EF4q2CT.js} +1 -1
- package/dist/{pos-types-BFrapNmx.js → pos-types-Dv2UxKSN.js} +1 -1
- package/dist/{pos-variant-CctfqieO.js → pos-variant-DJvtN9N8.js} +4 -4
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-Dd0YOixn.js → programmer-variant-Bmcq2KzC.js} +2 -2
- package/dist/{public-CshR_aW7.js → public-BNebh4z0.js} +9 -9
- package/dist/{rich-code-block-BuJLDoBu.js → rich-code-block-DmX7d58S.js} +5 -5
- package/dist/{scientific-variant-CjErQxuZ.js → scientific-variant-DijUrpP8.js} +2 -2
- package/dist/{sortable-provider-DU2nvpFc.js → sortable-provider-Cnmt_gWu.js} +2 -2
- package/dist/{spinner-DH1mm8hH.js → spinner-C6LP2Rw8.js} +1 -1
- package/dist/{tabs-Um0SFyf1.js → tabs-Bj1zOe7-.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-C-Ih4uQU.js → theme-toggle-Cxku5iBP.js} +1 -1
- package/dist/{toolbar-items-BoEY5bkt.js → toolbar-items-CEIuSxU_.js} +4 -4
- package/dist/{translate-material-D4rn5UaQ.js → translate-material-DI3nmQ6I.js} +1 -1
- package/dist/{translator-CcEgQ-H7.js → translator-BstxG_hN.js} +177 -163
- package/dist/{use-chat-composer-BfFcmDua.js → use-chat-composer-BqLkk_iH.js} +71 -66
- package/dist/{use-heading-spy-gDNtK1sU.js → use-heading-spy-nFyb9_KE.js} +4 -4
- package/dist/{use-material-translation-DYrfV_JJ.js → use-material-translation-1kCHtB0p.js} +1 -1
- package/dist/{use-return-focus-C_Qz_yTk.js → use-return-focus-Hv8rn55-.js} +1 -1
- package/docs/components/data-display.md +38 -8
- package/docs/components/media-and-files.md +11 -0
- package/docs/components/rich-widgets.md +22 -1
- package/docs/guides/helpers.md +40 -0
- package/docs/guides/layouts.md +5 -2
- package/docs/guides/theming.md +2 -2
- package/docs/roadmap.md +9 -4
- package/docs/troubleshooting.md +2 -2
- package/lib/components/theme-tokens.css +3 -3
- package/lib/components/ui/collections/server-table/server-table-phone-row.css +12 -0
- package/lib/themes/ambre.css +2 -2
- package/lib/themes/ardoise.css +2 -2
- package/lib/themes/bleumono.css +2 -2
- package/lib/themes/bluemoon.css +2 -2
- package/lib/themes/corail.css +2 -2
- package/lib/themes/foret.css +2 -2
- package/lib/themes/lavande.css +2 -2
- package/lib/themes/menthe.css +2 -2
- package/lib/themes/ocean.css +2 -2
- package/lib/themes/pink.css +2 -2
- package/lib/themes/prune.css +1 -1
- package/lib/themes/sable.css +2 -2
- package/lib/themes/slate.css +1 -1
- package/lib/themes/teal.css +2 -2
- package/package.json +4 -4
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { i as e } from "./translate-material-
|
|
2
|
-
import { n as t } from "./use-heading-spy-
|
|
1
|
+
import { i as e } from "./translate-material-DI3nmQ6I.js";
|
|
2
|
+
import { n as t } from "./use-heading-spy-nFyb9_KE.js";
|
|
3
3
|
import { t as n } from "./number.utils-CSueQZcv.js";
|
|
4
|
-
import { useCallback as r, useEffect as i,
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { useBlocker as
|
|
7
|
-
import { createFormatters as
|
|
4
|
+
import { useCallback as r, useEffect as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
5
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
6
|
+
import { useBlocker as u, useNavigate as d, useSearchParams as f } from "react-router";
|
|
7
|
+
import { createFormatters as p } from "@nxgt/material-core/print-format";
|
|
8
8
|
//#region lib/hooks/unsaved-guard-rules.ts
|
|
9
|
-
function
|
|
9
|
+
function m(e, t, n = {}) {
|
|
10
10
|
return e.pathname !== t.pathname || !n.ignoreSearch && e.search !== t.search;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function h({ dirty: e, released: t, context: n, leaves: r, ignoreSearch: i }) {
|
|
13
13
|
if (t || !e) return !1;
|
|
14
14
|
let { currentLocation: a, nextLocation: o } = n;
|
|
15
|
-
return r ? r(a, o) :
|
|
15
|
+
return r ? r(a, o) : m(a, o, { ignoreSearch: i });
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region lib/hooks/use-allowed-transitions.ts
|
|
19
|
-
function
|
|
19
|
+
function g(e, t, n) {
|
|
20
20
|
return (t[e] || []).map((e) => {
|
|
21
21
|
let t = n[e];
|
|
22
22
|
return t ? {
|
|
@@ -27,7 +27,7 @@ function h(e, t, n) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region lib/hooks/drafts-store.ts
|
|
30
|
-
function
|
|
30
|
+
function _(e, t, n) {
|
|
31
31
|
let r = {};
|
|
32
32
|
try {
|
|
33
33
|
let i = e?.getItem(t);
|
|
@@ -41,7 +41,7 @@ function g(e, t, n) {
|
|
|
41
41
|
} catch {}
|
|
42
42
|
return r;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function v(e, t, n, r) {
|
|
45
45
|
try {
|
|
46
46
|
let i = Object.keys(n);
|
|
47
47
|
if (i.length === 0) {
|
|
@@ -55,34 +55,34 @@ function _(e, t, n, r) {
|
|
|
55
55
|
}
|
|
56
56
|
//#endregion
|
|
57
57
|
//#region lib/hooks/use-drafts.ts
|
|
58
|
-
function
|
|
58
|
+
function y() {
|
|
59
59
|
try {
|
|
60
60
|
return window.sessionStorage;
|
|
61
61
|
} catch {
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
var
|
|
66
|
-
function
|
|
65
|
+
var b = (e) => JSON.parse(e);
|
|
66
|
+
function x(e) {
|
|
67
67
|
try {
|
|
68
|
-
return e === void 0 ?
|
|
68
|
+
return e === void 0 ? y() : typeof e == "function" ? e() : e;
|
|
69
69
|
} catch {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function S(e, t) {
|
|
74
74
|
try {
|
|
75
|
-
|
|
75
|
+
x(t)?.removeItem(e);
|
|
76
76
|
} catch {}
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
let { serialize: n = JSON.stringify, parse:
|
|
78
|
+
function C(e, t = {}) {
|
|
79
|
+
let { serialize: n = JSON.stringify, parse: a = b, storage: l } = t, [u, d] = c({
|
|
80
80
|
key: e,
|
|
81
81
|
drafts: {},
|
|
82
82
|
loaded: !1
|
|
83
|
-
}), f =
|
|
83
|
+
}), f = s(u), p = u.key === e, m = p ? u.drafts : w, h = p && u.loaded;
|
|
84
84
|
i(() => {
|
|
85
|
-
let t =
|
|
85
|
+
let t = _(x(l), e, a), n = f.current, r = {
|
|
86
86
|
key: e,
|
|
87
87
|
drafts: n.key === e ? {
|
|
88
88
|
...t,
|
|
@@ -92,43 +92,43 @@ function S(e, t = {}) {
|
|
|
92
92
|
};
|
|
93
93
|
f.current = r, d(r);
|
|
94
94
|
}, [e]);
|
|
95
|
-
let
|
|
96
|
-
let r =
|
|
95
|
+
let g = r((t) => {
|
|
96
|
+
let r = x(l), i = f.current, o = i.key === e && i.loaded, s = {
|
|
97
97
|
key: e,
|
|
98
|
-
drafts: t(
|
|
99
|
-
loaded:
|
|
98
|
+
drafts: t(o ? i.drafts : _(r, e, a)),
|
|
99
|
+
loaded: o
|
|
100
100
|
};
|
|
101
|
-
|
|
102
|
-
}, [e]),
|
|
101
|
+
v(r, e, s.drafts, n), f.current = s, d(s);
|
|
102
|
+
}, [e]), y = r((e, t) => g((n) => ({
|
|
103
103
|
...n,
|
|
104
104
|
[e]: t
|
|
105
|
-
})), [
|
|
105
|
+
})), [g]), S = r((e) => g((t) => {
|
|
106
106
|
let { [e]: n, ...r } = t;
|
|
107
107
|
return r;
|
|
108
|
-
}), [
|
|
108
|
+
}), [g]), C = r(() => g(() => ({})), [g]);
|
|
109
109
|
return {
|
|
110
110
|
get: r((e) => m[e], [m]),
|
|
111
|
-
set:
|
|
111
|
+
set: y,
|
|
112
112
|
drop: S,
|
|
113
|
-
clear:
|
|
114
|
-
keys:
|
|
113
|
+
clear: C,
|
|
114
|
+
keys: o(() => Object.keys(m), [m]),
|
|
115
115
|
loaded: h
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
var
|
|
118
|
+
var w = {};
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region lib/hooks/use-formatters.ts
|
|
121
|
-
function
|
|
121
|
+
function T(t = {}) {
|
|
122
122
|
let n = e(), r = t.locale ?? n?.language ?? "en", { timeZone: i } = t;
|
|
123
|
-
return
|
|
123
|
+
return o(() => p({
|
|
124
124
|
locale: r,
|
|
125
125
|
timeZone: i
|
|
126
126
|
}), [r, i]);
|
|
127
127
|
}
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region lib/hooks/use-navigation.ts
|
|
130
|
-
function
|
|
131
|
-
let n =
|
|
130
|
+
function E(e, t) {
|
|
131
|
+
let n = d();
|
|
132
132
|
return r(() => {
|
|
133
133
|
n(e, t);
|
|
134
134
|
}, [
|
|
@@ -137,15 +137,15 @@ function T(e, t) {
|
|
|
137
137
|
t
|
|
138
138
|
]);
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
let t =
|
|
142
|
-
return
|
|
140
|
+
function D(e) {
|
|
141
|
+
let t = d();
|
|
142
|
+
return o(() => e.map(({ to: e, options: n }) => () => {
|
|
143
143
|
t(e, n);
|
|
144
144
|
}), [t, e]);
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region lib/hooks/use-number-formatter.ts
|
|
148
|
-
function
|
|
148
|
+
function O() {
|
|
149
149
|
let t = e(), i = r((e, r) => n(e, {
|
|
150
150
|
...r,
|
|
151
151
|
language: t?.language
|
|
@@ -161,7 +161,7 @@ function D() {
|
|
|
161
161
|
}
|
|
162
162
|
//#endregion
|
|
163
163
|
//#region lib/hooks/use-options.ts
|
|
164
|
-
function
|
|
164
|
+
function k(e, { filter: t, value: n, label: r, expanded: i }) {
|
|
165
165
|
return e.filter((e) => e && (t?.(e) ?? !0)).map((e) => {
|
|
166
166
|
let t = typeof n == "function" ? n(e) : e[n]?.toString() ?? "", a = "";
|
|
167
167
|
return a = typeof r == "function" ? r(e) : Array.isArray(r) ? r.map((t) => e[t]).filter(Boolean).join(" ") : e[r]?.toString() ?? "", {
|
|
@@ -171,28 +171,64 @@ function O(e, { filter: t, value: n, label: r, expanded: i }) {
|
|
|
171
171
|
};
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
let { filter: n, value: r, label: i, expanded:
|
|
176
|
-
return
|
|
174
|
+
function A(e, t) {
|
|
175
|
+
let { filter: n, value: r, label: i, expanded: a } = t;
|
|
176
|
+
return o(() => k(e, {
|
|
177
177
|
filter: n,
|
|
178
178
|
value: r,
|
|
179
179
|
label: i,
|
|
180
|
-
expanded:
|
|
180
|
+
expanded: a
|
|
181
181
|
}), [
|
|
182
182
|
e,
|
|
183
183
|
n,
|
|
184
184
|
r,
|
|
185
185
|
i,
|
|
186
|
-
|
|
186
|
+
a
|
|
187
187
|
]);
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function j(e) {
|
|
190
190
|
return e?.edges?.map((e) => e.node) ?? [];
|
|
191
191
|
}
|
|
192
192
|
//#endregion
|
|
193
|
+
//#region lib/hooks/poll.ts
|
|
194
|
+
var M = () => typeof document > "u" || document.visibilityState === "visible";
|
|
195
|
+
function N({ ms: e, read: t, active: n = () => !0, visible: r = M, onError: i, flight: a = { current: !1 } }) {
|
|
196
|
+
let o = !1, s = setInterval(() => {
|
|
197
|
+
a.current || !n() || !r() || (a.current = !0, new Promise((e) => e(t())).catch((e) => {
|
|
198
|
+
o || i?.(e);
|
|
199
|
+
}).finally(() => {
|
|
200
|
+
a.current = !1;
|
|
201
|
+
}));
|
|
202
|
+
}, e);
|
|
203
|
+
return () => {
|
|
204
|
+
o = !0, clearInterval(s);
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region lib/hooks/use-poll.ts
|
|
209
|
+
function P({ ms: e, enabled: t = !0, read: n, onError: r }) {
|
|
210
|
+
let o = s({
|
|
211
|
+
read: n,
|
|
212
|
+
onError: r
|
|
213
|
+
}), c = s(!1);
|
|
214
|
+
a(() => {
|
|
215
|
+
o.current = {
|
|
216
|
+
read: n,
|
|
217
|
+
onError: r
|
|
218
|
+
};
|
|
219
|
+
}), i(() => {
|
|
220
|
+
if (t) return N({
|
|
221
|
+
ms: e,
|
|
222
|
+
read: () => o.current.read(),
|
|
223
|
+
onError: (e) => o.current.onError?.(e),
|
|
224
|
+
flight: c
|
|
225
|
+
});
|
|
226
|
+
}, [e, t]);
|
|
227
|
+
}
|
|
228
|
+
//#endregion
|
|
193
229
|
//#region lib/hooks/use-react-router-block.ts
|
|
194
|
-
var
|
|
195
|
-
let t =
|
|
230
|
+
var F = (e) => {
|
|
231
|
+
let t = u(e);
|
|
196
232
|
return {
|
|
197
233
|
state: t.state,
|
|
198
234
|
proceed: () => t.state === "blocked" && t.proceed(),
|
|
@@ -201,14 +237,14 @@ var j = (e) => {
|
|
|
201
237
|
};
|
|
202
238
|
//#endregion
|
|
203
239
|
//#region lib/hooks/use-search-param.ts
|
|
204
|
-
function
|
|
205
|
-
let [t, n] =
|
|
206
|
-
return
|
|
240
|
+
function I(e) {
|
|
241
|
+
let [t, n] = f();
|
|
242
|
+
return o(() => t.get(e), [t, e]);
|
|
207
243
|
}
|
|
208
244
|
//#endregion
|
|
209
245
|
//#region lib/hooks/use-unsaved-guard/guard-core.ts
|
|
210
|
-
var
|
|
211
|
-
function
|
|
246
|
+
var L = (e) => typeof e == "function" ? e() : e;
|
|
247
|
+
function R(e) {
|
|
212
248
|
let t = !1, n, r = () => {
|
|
213
249
|
n !== void 0 && clearTimeout(n), n = void 0;
|
|
214
250
|
}, i = () => {
|
|
@@ -221,27 +257,27 @@ function P(e) {
|
|
|
221
257
|
rearm: i,
|
|
222
258
|
dispose: r,
|
|
223
259
|
shouldBlock(n, r) {
|
|
224
|
-
if (!
|
|
260
|
+
if (!h({
|
|
225
261
|
dirty: !0,
|
|
226
262
|
released: !1,
|
|
227
263
|
context: n,
|
|
228
264
|
...r
|
|
229
265
|
})) return !1;
|
|
230
266
|
let a = t;
|
|
231
|
-
return i(), !a &&
|
|
267
|
+
return i(), !a && L(e());
|
|
232
268
|
},
|
|
233
269
|
shouldWarnUnload() {
|
|
234
|
-
return !t &&
|
|
270
|
+
return !t && L(e());
|
|
235
271
|
}
|
|
236
272
|
};
|
|
237
273
|
}
|
|
238
|
-
function
|
|
274
|
+
function z(e, t) {
|
|
239
275
|
let n = (e) => {
|
|
240
276
|
t.shouldWarnUnload() && (e.preventDefault(), e.returnValue = "");
|
|
241
277
|
};
|
|
242
278
|
return e.addEventListener("beforeunload", n), () => e.removeEventListener("beforeunload", n);
|
|
243
279
|
}
|
|
244
|
-
async function
|
|
280
|
+
async function B(e) {
|
|
245
281
|
if (!e) return !1;
|
|
246
282
|
try {
|
|
247
283
|
return await e() === !0;
|
|
@@ -251,19 +287,19 @@ async function I(e) {
|
|
|
251
287
|
}
|
|
252
288
|
//#endregion
|
|
253
289
|
//#region lib/hooks/use-unsaved-guard/use-discard-guard.tsx
|
|
254
|
-
function
|
|
255
|
-
let i =
|
|
290
|
+
function V(e, n = {}) {
|
|
291
|
+
let i = s(e);
|
|
256
292
|
i.current = e;
|
|
257
|
-
let [a,
|
|
293
|
+
let [a, o] = c(null);
|
|
258
294
|
return {
|
|
259
295
|
close: r((e) => {
|
|
260
|
-
|
|
296
|
+
L(i.current) ? o(() => e) : e();
|
|
261
297
|
}, []),
|
|
262
|
-
dialog: /* @__PURE__ */
|
|
298
|
+
dialog: /* @__PURE__ */ l(t, {
|
|
263
299
|
...n,
|
|
264
300
|
open: a !== null,
|
|
265
301
|
onOpenChange: (e) => {
|
|
266
|
-
e ||
|
|
302
|
+
e || o(null);
|
|
267
303
|
},
|
|
268
304
|
onLeave: () => {
|
|
269
305
|
a?.();
|
|
@@ -273,41 +309,41 @@ function L(e, n = {}) {
|
|
|
273
309
|
}
|
|
274
310
|
//#endregion
|
|
275
311
|
//#region lib/hooks/use-unsaved-guard/use-unsaved-guard.tsx
|
|
276
|
-
function
|
|
277
|
-
i(() =>
|
|
312
|
+
function H(e) {
|
|
313
|
+
i(() => z(window, e), [e]);
|
|
278
314
|
}
|
|
279
|
-
function
|
|
280
|
-
let [n, r] =
|
|
281
|
-
|
|
282
|
-
let l =
|
|
315
|
+
function U(e, t) {
|
|
316
|
+
let [n, r] = c(!1), a = s(!1), o = s(e);
|
|
317
|
+
o.current = e;
|
|
318
|
+
let l = s(t);
|
|
283
319
|
return l.current = t, i(() => {
|
|
284
320
|
if (e.state !== "blocked") {
|
|
285
321
|
a.current = !1, r(!1);
|
|
286
322
|
return;
|
|
287
323
|
}
|
|
288
|
-
a.current || (a.current = !0,
|
|
289
|
-
e ?
|
|
324
|
+
a.current || (a.current = !0, B(l.current).then((e) => {
|
|
325
|
+
e ? o.current.proceed() : r(!0);
|
|
290
326
|
}));
|
|
291
327
|
}, [e.state]), {
|
|
292
328
|
asking: n && e.state === "blocked",
|
|
293
329
|
setAsking: r,
|
|
294
|
-
blockerRef:
|
|
330
|
+
blockerRef: o
|
|
295
331
|
};
|
|
296
332
|
}
|
|
297
|
-
function
|
|
298
|
-
let { block: a, leaves:
|
|
333
|
+
function W(e, n) {
|
|
334
|
+
let { block: a, leaves: o, ignoreSearch: u, onBlock: d, ...f } = n, p = s(e);
|
|
299
335
|
p.current = e;
|
|
300
|
-
let [m] =
|
|
301
|
-
leaves:
|
|
336
|
+
let [m] = c(() => R(() => p.current)), h = s(!1), { asking: g, setAsking: _, blockerRef: v } = U(a((e) => m.shouldBlock(e, {
|
|
337
|
+
leaves: o,
|
|
302
338
|
ignoreSearch: u
|
|
303
339
|
})), d);
|
|
304
|
-
|
|
340
|
+
H(m), i(() => m.dispose, [m]);
|
|
305
341
|
let y = typeof e == "boolean" ? e : void 0;
|
|
306
342
|
return i(() => {
|
|
307
343
|
y && m.rearm();
|
|
308
344
|
}, [y, m]), {
|
|
309
345
|
release: r(() => m.release(), [m]),
|
|
310
|
-
dialog: /* @__PURE__ */
|
|
346
|
+
dialog: /* @__PURE__ */ l(t, {
|
|
311
347
|
...f,
|
|
312
348
|
open: g,
|
|
313
349
|
onOpenChange: (e) => {
|
|
@@ -326,4 +362,4 @@ function B(e, n) {
|
|
|
326
362
|
};
|
|
327
363
|
}
|
|
328
364
|
//#endregion
|
|
329
|
-
export {
|
|
365
|
+
export { m as _, P as a, j as c, E as d, D as f, g, C as h, F as i, A as l, S as m, V as n, N as o, T as p, I as r, k as s, W as t, O as u, h as v };
|
package/dist/hooks.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./use-ssr-media-query-C6M5m8sf.js";
|
|
2
2
|
import { a as t, i as n, o as r, r as i, s as a } from "./theme-store-BdPp43cV.js";
|
|
3
3
|
import { n as o, t as s } from "./use-theme-BCLireTd.js";
|
|
4
|
-
import { a as c, i as l, m as u, o as d, r as f, s as p, t as m } from "./use-heading-spy-
|
|
4
|
+
import { a as c, i as l, m as u, o as d, r as f, s as p, t as m } from "./use-heading-spy-nFyb9_KE.js";
|
|
5
5
|
import { r as h } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
6
6
|
import { t as g } from "./use-mobile-BDro060N.js";
|
|
7
7
|
import { t as _ } from "./use-scroll-away-PQRFZkT2.js";
|
|
8
|
-
import {
|
|
9
|
-
export { i as DEFAULT_THEME, n as applyResolvedTheme, t as applyThemeName,
|
|
8
|
+
import { _ as v, a as y, c as b, d as x, f as S, g as C, h as w, i as T, l as E, m as D, n as O, o as k, p as A, r as j, s as M, t as N, u as P, v as F } from "./hooks-BTwLAy_A.js";
|
|
9
|
+
export { i as DEFAULT_THEME, n as applyResolvedTheme, t as applyThemeName, M as buildOptions, l as busySettler, D as clearDrafts, c as createSubmitGuard, b as extractNode, v as isLeaving, r as resolveTheme, a as resolveThemeName, F as shouldBlockNavigation, k as startPoll, C as useAllowedTransitions, f as useCountdown, h as useCspNonce, O as useDiscardGuard, w as useDrafts, p as useFocusOnMount, A as useFormatters, m as useHeadingSpy, o as useIsClient, g as useIsMobile, u as useLocalizedDate, x as useNavigationHandler, S as useNavigationHandlers, P as useNumberFormatter, E as useOptions, y as usePoll, T as useReactRouterBlock, _ as useScrollAway, j as useSearchParam, e as useSsrMediaQuery, d as useSubmitOnce, s as useTheme, N as useUnsavedGuard };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { o as t } from "./dist-DVRQkaTK.js";
|
|
3
3
|
import { i as n, r, t as i } from "./dist-DWZXlCZR.js";
|
|
4
|
-
import { S as a, d as o, f as s, l as c, p as l, x as u } from "./spinner-
|
|
4
|
+
import { S as a, d as o, f as s, l as c, p as l, x as u } from "./spinner-C6LP2Rw8.js";
|
|
5
5
|
import { a as d, i as f } from "./dist-DHdUUM1w.js";
|
|
6
6
|
import { t as p } from "./in-dialog-D61Yeaol.js";
|
|
7
7
|
import { i as m } from "./escape-owner-DpaP0lm1.js";
|
package/dist/i18n.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as e } from "./is-production-GLw59WU8.js";
|
|
2
|
-
import { c as t, d as n, i as r, l as i, n as a, o, r as s, t as c, u as l } from "./translator-
|
|
3
|
-
import { i as u, n as d, r as f, t as p } from "./translate-material-
|
|
2
|
+
import { c as t, d as n, i as r, l as i, n as a, o, r as s, t as c, u as l } from "./translator-BstxG_hN.js";
|
|
3
|
+
import { i as u, n as d, r as f, t as p } from "./translate-material-DI3nmQ6I.js";
|
|
4
4
|
import { o as m, t as h } from "./merge-BCZE6HGq.js";
|
|
5
|
-
import { t as g } from "./use-material-translation-
|
|
5
|
+
import { t as g } from "./use-material-translation-1kCHtB0p.js";
|
|
6
6
|
import { useCallback as _ } from "react";
|
|
7
7
|
//#region lib/i18n/merge-resources.ts
|
|
8
8
|
function v(e, t, n = "") {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { t } from "./icon-button-
|
|
2
|
+
import { t } from "./icon-button-CG4aO8Gh.js";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
//#region lib/components/ui/actions/icon-button/icon-badge.tsx
|
|
5
5
|
function r({ children: r, className: i, ...a }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { n as t } from "./use-shape-morph-BKA_R5P5.js";
|
|
3
3
|
import { n, t as r } from "./dist-DVRQkaTK.js";
|
|
4
|
-
import { n as i, t as a } from "./spinner-
|
|
4
|
+
import { n as i, t as a } from "./spinner-C6LP2Rw8.js";
|
|
5
5
|
import { t as o } from "./dist-DkQbkF9T.js";
|
|
6
6
|
import { a as s, i as c, n as l, o as u, r as d, s as f, t as p } from "./use-click-lock-Bwg_caHO.js";
|
|
7
7
|
import { t as m } from "./is-production-GLw59WU8.js";
|
|
@@ -35,6 +35,7 @@ export * from './status-indicator/index.js';
|
|
|
35
35
|
export * from './summary-data/index.js';
|
|
36
36
|
export * from './terminal/index.js';
|
|
37
37
|
export * from './timeline/index.js';
|
|
38
|
+
export * from './totals-list/index.js';
|
|
38
39
|
export * from './tube-cap/index.js';
|
|
39
40
|
export * from './vote-tally/index.js';
|
|
40
41
|
export * from './zoned-time/index.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import { Tone } from '../../tones.js';
|
|
3
|
+
/** One labelled figure of a `TotalsList`; the same shape as `PrintTotalRow`, plus `tone` and `strong`. */
|
|
4
|
+
export type TotalsRow = {
|
|
5
|
+
/** What the figure is: "Subtotal", "Tax". */
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
/** The figure, already formatted for the locale: "1,190.00". */
|
|
8
|
+
value: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* The grand total, as `PrintTotalRow`'s `last`: larger and bold, with a rule
|
|
11
|
+
* above it.
|
|
12
|
+
*/
|
|
13
|
+
last?: boolean;
|
|
14
|
+
/** Larger and bold, with no rule: a subtotal that stands out. */
|
|
15
|
+
strong?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Colours the amount (`data-tone` and the tone's text colour): `error` for a
|
|
18
|
+
* negative or due amount, `success` for a credit. A tone an app declared in
|
|
19
|
+
* `AppTones` works as a named one. The label keeps its colour.
|
|
20
|
+
*/
|
|
21
|
+
tone?: Tone;
|
|
22
|
+
};
|
|
23
|
+
export type TotalsListProps = Omit<ComponentProps<'div'>, 'children'> & {
|
|
24
|
+
/** The rows, top to bottom. Share the array with the `PrintTotals` of the document. */
|
|
25
|
+
rows: readonly TotalsRow[];
|
|
26
|
+
/**
|
|
27
|
+
* The accessible name of the block ("Order totals"), set as `aria-label` on a
|
|
28
|
+
* `group` around the `dl`.
|
|
29
|
+
*/
|
|
30
|
+
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* `card` (default) draws the block as a bordered card; `plain` leaves it bare
|
|
33
|
+
* to sit inside a card or a side rail you already have.
|
|
34
|
+
*/
|
|
35
|
+
variant?: 'card' | 'plain';
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* TotalsList - the on-screen counterpart of `PrintTotals`: a `dl` of labelled
|
|
39
|
+
* figures, labels at the start and amounts right-aligned at the end with
|
|
40
|
+
* tabular numerals. One column at any width, so it fits a narrow side rail and
|
|
41
|
+
* a phone. A long label wraps and the amount stays on its first line.
|
|
42
|
+
*/
|
|
43
|
+
export declare function TotalsList({ rows, label, variant, className, ...props }: TotalsListProps): import("react").JSX.Element;
|