@nxgt/material 3.62.0 → 3.64.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +1 -1
  3. package/dist/alert-dialog-RHm6WtQj.js +189 -0
  4. package/dist/{async-slice-HJY_VJjD.js → async-slice-DmX59NyA.js} +3 -4
  5. package/dist/{button-7BuUCGRm.js → button-DfS_amfQ.js} +1 -1
  6. package/dist/charts.js +3 -3
  7. package/dist/{chip-kQOrHlDX.js → chip-Cbndukko.js} +2 -2
  8. package/dist/{code-editor-Ckc9TTCM.js → code-editor-B0tN8Ha_.js} +11 -11
  9. package/dist/code-editor.js +5 -5
  10. package/dist/{code-language-items-rCPB0Xee.js → code-language-items-andgHKrM.js} +2 -2
  11. package/dist/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
  12. package/dist/{components-TDDUQ1Y0.js → components-2kTVPsMg.js} +15801 -15541
  13. package/dist/components.js +28 -26
  14. package/dist/dialog-Bd7Hid2L.js +219 -0
  15. package/dist/dnd.js +1 -1
  16. package/dist/{dropdown-menu-CiobN1wi.js → dropdown-menu-_SyVmSuy.js} +1 -1
  17. package/dist/editor.js +707 -706
  18. package/dist/{empty-state-DA517HAb.js → empty-state-D-2ZMXXJ.js} +2 -2
  19. package/dist/escape-owner-DpaP0lm1.js +19 -0
  20. package/dist/{field-blur-DdvY0NQQ.js → field-blur-DyOByjzw.js} +1 -1
  21. package/dist/{field-blur-context-DbJQZkEB.js → field-blur-context-DPe5_Nv5.js} +1 -1
  22. package/dist/hooks-a7_exKWS.js +329 -0
  23. package/dist/hooks.js +3 -3
  24. package/dist/{hover-card-DPs9huSs.js → hover-card-D_0smKBQ.js} +2 -2
  25. package/dist/i18n.js +8 -10
  26. package/dist/{icon-badge-C646JTOI.js → icon-badge-CBCU3ySF.js} +14 -14
  27. package/dist/{icon-button-DvP0Gy3j.js → icon-button-hKHsWTAt.js} +1 -1
  28. package/dist/lib/components/ui/actions/load-more-footer/load-more-footer.d.ts +11 -2
  29. package/dist/lib/components/ui/actions/load-more-footer/use-footer-focus.d.ts +15 -0
  30. package/dist/lib/components/ui/actions/load-more-footer/use-last-page.d.ts +9 -0
  31. package/dist/lib/components/ui/collections/filter/bar/partials/filter-inline-chips.d.ts +11 -0
  32. package/dist/lib/components/ui/collections/filter/bar/partials/filter-inline-list.d.ts +6 -0
  33. package/dist/lib/components/ui/collections/server-table/partials/server-table-grid-paging.d.ts +9 -0
  34. package/dist/lib/components/ui/collections/server-table/partials/server-table-load-more.d.ts +17 -0
  35. package/dist/lib/components/ui/collections/server-table/types-paging.d.ts +10 -0
  36. package/dist/lib/components/ui/feedback/index.d.ts +1 -0
  37. package/dist/lib/components/ui/feedback/unsaved-dialog/index.d.ts +1 -0
  38. package/dist/lib/components/ui/feedback/unsaved-dialog/unsaved-dialog.d.ts +20 -0
  39. package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
  40. package/dist/lib/components/ui/fields/textarea-field/textarea-footer.d.ts +2 -1
  41. package/dist/lib/components/ui/widgets/education/questions/index.d.ts +3 -1
  42. package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
  43. package/dist/lib/components/ui/widgets/education/questions/partials/question-top.d.ts +6 -0
  44. package/dist/lib/components/ui/widgets/education/questions/question-long-text.d.ts +5 -0
  45. package/dist/lib/components/ui/widgets/education/questions/question-media-content.d.ts +24 -0
  46. package/dist/lib/components/ui/widgets/education/questions/question-media-helpers.d.ts +11 -0
  47. package/dist/lib/components/ui/widgets/education/questions/question-media-view.d.ts +18 -0
  48. package/dist/lib/components/ui/widgets/education/questions/question-media-view.types.d.ts +32 -0
  49. package/dist/lib/components/ui/widgets/education/questions/question-options.d.ts +2 -2
  50. package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
  51. package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
  52. package/dist/lib/components/ui/widgets/education/questions/types.d.ts +52 -1
  53. package/dist/lib/components/ui/widgets/education/questions/use-reload-focus.d.ts +13 -0
  54. package/dist/lib/hooks/index.d.ts +3 -0
  55. package/dist/lib/hooks/unsaved-guard-rules.d.ts +30 -0
  56. package/dist/lib/hooks/use-react-router-block.d.ts +11 -0
  57. package/dist/lib/hooks/use-unsaved-guard/guard-core.d.ts +30 -0
  58. package/dist/lib/hooks/use-unsaved-guard/index.d.ts +3 -0
  59. package/dist/lib/hooks/use-unsaved-guard/types.d.ts +63 -0
  60. package/dist/lib/hooks/use-unsaved-guard/use-discard-guard.d.ts +15 -0
  61. package/dist/lib/hooks/use-unsaved-guard/use-unsaved-guard.d.ts +19 -0
  62. package/dist/lib/i18n/resources/en/en.d.ts +20 -0
  63. package/dist/lib/i18n/resources/en/material.json.d.ts +21 -1
  64. package/dist/lib/i18n/resources/fr/fr.d.ts +20 -0
  65. package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -1
  66. package/dist/lib/i18n/resources/resources.d.ts +40 -0
  67. package/dist/lib/i18n/translator.d.ts +1 -1
  68. package/dist/lib.js +1 -1
  69. package/dist/main.js +42 -43
  70. package/dist/map.js +63 -63
  71. package/dist/material.css +1 -1
  72. package/dist/pdf-reader.js +1 -1
  73. package/dist/print.js +1 -2
  74. package/dist/{public-BYsrhyPW.js → public-D8JGp3PH.js} +823 -822
  75. package/dist/{rich-code-block-WJxDWPPY.js → rich-code-block-0R3bidsM.js} +5 -5
  76. package/dist/{sortable-provider-oPjlhlZo.js → sortable-provider-B75v53sB.js} +2 -2
  77. package/dist/{spinner-C5lObWXT.js → spinner-CAnpF3RK.js} +1 -1
  78. package/dist/theme-picker.js +2 -2
  79. package/dist/{theme-toggle-CPEq5JG-.js → theme-toggle-pQ5F602V.js} +1 -1
  80. package/dist/{toolbar-items-ByvXcMHm.js → toolbar-items-_ezD5B0r.js} +4 -4
  81. package/dist/translate-material-CvZK8_S6.js +96 -0
  82. package/dist/{stored-language-B-tiWZU2.js → translator-Caf-d96e.js} +2497 -8
  83. package/dist/{escape-owner-r57kuPjn.js → typography-CEK19bj8.js} +17 -34
  84. package/dist/{use-chat-composer-CzOVaIed.js → use-chat-composer-Dpvi_-CR.js} +5164 -5338
  85. package/dist/{use-heading-spy-BOtygPFu.js → use-heading-spy-mmcyEGmm.js} +186 -71
  86. package/dist/{use-material-translation-B5j3jZs7.js → use-material-translation-C_1cWRzW.js} +1 -2
  87. package/dist/use-return-focus-1ZIchrBM.js +269 -0
  88. package/docs/components/buttons-and-actions.md +2 -2
  89. package/docs/components/data-table-filter-and-lists.md +96 -0
  90. package/docs/components/feedback-and-status.md +23 -0
  91. package/docs/components/navigation-and-layout.md +4 -3
  92. package/docs/components/rich-widgets.md +75 -1
  93. package/docs/guides/helpers.md +63 -0
  94. package/docs/guides/theming.md +13 -3
  95. package/docs/previews/feedback-status-unsaveddialog.webp +0 -0
  96. package/docs/roadmap.md +4 -0
  97. package/lib/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
  98. package/package.json +2 -2
  99. package/dist/dialog-yfPkLqUQ.js +0 -482
  100. package/dist/hooks-CGnqFngB.js +0 -187
  101. package/dist/i18n-provider-BehR6cU7.js +0 -79
  102. package/dist/translate-material-tUaLZUmT.js +0 -20
  103. package/dist/translator-B9XjUDRu.js +0 -2451
@@ -1,187 +0,0 @@
1
- import { r as e } from "./i18n-provider-BehR6cU7.js";
2
- import { t } from "./number.utils-BG_eEt5g.js";
3
- import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
4
- import { useNavigate as s, useSearchParams as c } from "react-router";
5
- import { createFormatters as l } from "@nxgt/material-core/print-format";
6
- //#region lib/hooks/use-allowed-transitions.ts
7
- function u(e, t, n) {
8
- return (t[e] || []).map((e) => {
9
- let t = n[e];
10
- return t ? {
11
- targetStatus: e,
12
- ...t
13
- } : null;
14
- }).filter((e) => e !== null);
15
- }
16
- //#endregion
17
- //#region lib/hooks/drafts-store.ts
18
- function d(e, t, n) {
19
- let r = {};
20
- try {
21
- let i = e?.getItem(t);
22
- if (!i) return r;
23
- let a = JSON.parse(i);
24
- if (!a || typeof a != "object" || Array.isArray(a)) return r;
25
- for (let [e, t] of Object.entries(a)) if (typeof t == "string") try {
26
- let i = n(t);
27
- i !== void 0 && (r[e] = i);
28
- } catch {}
29
- } catch {}
30
- return r;
31
- }
32
- function f(e, t, n, r) {
33
- try {
34
- let i = Object.keys(n);
35
- if (i.length === 0) {
36
- e?.removeItem(t);
37
- return;
38
- }
39
- let a = {};
40
- for (let e of i) a[e] = r(n[e]);
41
- e?.setItem(t, JSON.stringify(a));
42
- } catch {}
43
- }
44
- //#endregion
45
- //#region lib/hooks/use-drafts.ts
46
- function p() {
47
- try {
48
- return window.sessionStorage;
49
- } catch {
50
- return;
51
- }
52
- }
53
- var m = (e) => JSON.parse(e);
54
- function h(e) {
55
- try {
56
- return e === void 0 ? p() : typeof e == "function" ? e() : e;
57
- } catch {
58
- return;
59
- }
60
- }
61
- function g(e, t) {
62
- try {
63
- h(t)?.removeItem(e);
64
- } catch {}
65
- }
66
- function _(e, t = {}) {
67
- let { serialize: s = JSON.stringify, parse: c = m, storage: l } = t, [u, p] = o({
68
- key: e,
69
- drafts: {},
70
- loaded: !1
71
- }), g = a(u), _ = u.key === e, y = _ ? u.drafts : v, b = _ && u.loaded;
72
- r(() => {
73
- let t = d(h(l), e, c), n = g.current, r = {
74
- key: e,
75
- drafts: n.key === e ? {
76
- ...t,
77
- ...n.drafts
78
- } : t,
79
- loaded: !0
80
- };
81
- g.current = r, p(r);
82
- }, [e]);
83
- let x = n((t) => {
84
- let n = h(l), r = g.current, i = r.key === e && r.loaded, a = {
85
- key: e,
86
- drafts: t(i ? r.drafts : d(n, e, c)),
87
- loaded: i
88
- };
89
- f(n, e, a.drafts, s), g.current = a, p(a);
90
- }, [e]), S = n((e, t) => x((n) => ({
91
- ...n,
92
- [e]: t
93
- })), [x]), C = n((e) => x((t) => {
94
- let { [e]: n, ...r } = t;
95
- return r;
96
- }), [x]), w = n(() => x(() => ({})), [x]);
97
- return {
98
- get: n((e) => y[e], [y]),
99
- set: S,
100
- drop: C,
101
- clear: w,
102
- keys: i(() => Object.keys(y), [y]),
103
- loaded: b
104
- };
105
- }
106
- var v = {};
107
- //#endregion
108
- //#region lib/hooks/use-formatters.ts
109
- function y(t = {}) {
110
- let n = e(), r = t.locale ?? n?.language ?? "en", { timeZone: a } = t;
111
- return i(() => l({
112
- locale: r,
113
- timeZone: a
114
- }), [r, a]);
115
- }
116
- //#endregion
117
- //#region lib/hooks/use-navigation.ts
118
- function b(e, t) {
119
- let r = s();
120
- return n(() => {
121
- r(e, t);
122
- }, [
123
- r,
124
- e,
125
- t
126
- ]);
127
- }
128
- function x(e) {
129
- let t = s();
130
- return i(() => e.map(({ to: e, options: n }) => () => {
131
- t(e, n);
132
- }), [t, e]);
133
- }
134
- //#endregion
135
- //#region lib/hooks/use-number-formatter.ts
136
- function S() {
137
- let r = e(), i = n((e, n) => t(e, {
138
- ...n,
139
- language: r?.language
140
- }), [r?.language]);
141
- return {
142
- formatCurrency: n((e, t) => i(e, {
143
- ...t,
144
- currency: t?.currency,
145
- style: t?.currency ? "currency" : void 0
146
- }), [i]),
147
- formatNumber: i
148
- };
149
- }
150
- //#endregion
151
- //#region lib/hooks/use-options.ts
152
- function C(e, { filter: t, value: n, label: r, expanded: i }) {
153
- return e.filter((e) => e && (t?.(e) ?? !0)).map((e) => {
154
- let t = typeof n == "function" ? n(e) : e[n]?.toString() ?? "", a = "";
155
- return a = typeof r == "function" ? r(e) : Array.isArray(r) ? r.map((t) => e[t]).filter(Boolean).join(" ") : e[r]?.toString() ?? "", {
156
- value: t,
157
- label: a,
158
- ...i ? e : {}
159
- };
160
- });
161
- }
162
- function w(e, t) {
163
- let { filter: n, value: r, label: a, expanded: o } = t;
164
- return i(() => C(e, {
165
- filter: n,
166
- value: r,
167
- label: a,
168
- expanded: o
169
- }), [
170
- e,
171
- n,
172
- r,
173
- a,
174
- o
175
- ]);
176
- }
177
- function T(e) {
178
- return e?.edges?.map((e) => e.node) ?? [];
179
- }
180
- //#endregion
181
- //#region lib/hooks/use-search-param.ts
182
- function E(e) {
183
- let [t, n] = c();
184
- return i(() => t.get(e), [t, e]);
185
- }
186
- //#endregion
187
- export { S as a, y as c, u as d, w as i, g as l, C as n, b as o, T as r, x as s, E as t, _ as u };
@@ -1,79 +0,0 @@
1
- import { i as e, r as t, t as n } from "./stored-language-B-tiWZU2.js";
2
- import { createContext as r, useCallback as i, useContext as a, useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
3
- import { jsx as u } from "react/jsx-runtime";
4
- //#region lib/i18n/material-resources-registry.ts
5
- var d = [], f = /* @__PURE__ */ new WeakMap();
6
- function p(e, t) {
7
- let n = {
8
- resources: e,
9
- language: t
10
- };
11
- d.push(n);
12
- let r = () => {
13
- let e = d.lastIndexOf(n);
14
- e !== -1 && d.splice(e, 1);
15
- };
16
- return f.set(r, n), r;
17
- }
18
- function m(e, t, n) {
19
- let r = f.get(e);
20
- r && (r.resources = t, r.language = n);
21
- }
22
- function h() {
23
- return d[d.length - 1];
24
- }
25
- //#endregion
26
- //#region lib/i18n/i18n-provider.tsx
27
- var g = r(null);
28
- function _({ children: r, defaultLanguage: a = "en", storageKey: d = t, supportedLanguages: f = e, onLanguageChange: h, initialLanguage: _, resources: v }) {
29
- let [y, b] = l(() => _ && f.includes(_) ? _ : n(d, a, f)), x = i((e) => {
30
- if (!f.includes(e)) {
31
- console.warn(`[@nxgt/material] Unsupported language: "${e}".`);
32
- return;
33
- }
34
- if (typeof localStorage < "u") try {
35
- localStorage.setItem(d, e);
36
- } catch {}
37
- b(e), h?.(e);
38
- }, [
39
- d,
40
- f,
41
- h
42
- ]), S = c(null), C = c({
43
- resources: v,
44
- language: y
45
- });
46
- C.current = {
47
- resources: v,
48
- language: y
49
- }, o(() => (S.current = p(C.current.resources, C.current.language), () => {
50
- S.current?.(), S.current = null;
51
- }), []), o(() => {
52
- S.current && m(S.current, v, y);
53
- }, [v, y]);
54
- let w = s(() => ({
55
- language: y,
56
- changeLanguage: x,
57
- supportedLanguages: f,
58
- resources: v
59
- }), [
60
- y,
61
- x,
62
- f,
63
- v
64
- ]);
65
- return /* @__PURE__ */ u(g.Provider, {
66
- value: w,
67
- children: r
68
- });
69
- }
70
- function v() {
71
- let e = a(g);
72
- if (!e) throw Error("useI18nContext must be used within an I18nProvider");
73
- return e;
74
- }
75
- function y() {
76
- return a(g);
77
- }
78
- //#endregion
79
- export { h as i, v as n, y as r, _ as t };
@@ -1,20 +0,0 @@
1
- import "./stored-language-B-tiWZU2.js";
2
- import { a as e, r as t, t as n } from "./translator-B9XjUDRu.js";
3
- //#region lib/i18n/translate-material.ts
4
- var r = /* @__PURE__ */ new WeakMap();
5
- function i(e) {
6
- let t = r.get(e);
7
- return t || (t = n(e), r.set(e, t)), t;
8
- }
9
- function a(n, r, a, o, s) {
10
- if (n) {
11
- let e = s ? [i(s), t] : [t];
12
- for (let t of /* @__PURE__ */ new Set([n, n.split("-")[0]])) for (let n of e) {
13
- let e = n(r, o, () => t);
14
- if (e !== r) return e;
15
- }
16
- }
17
- return e(a, n || "en", o);
18
- }
19
- //#endregion
20
- export { a as t };