@nxgt/material 3.100.1 → 3.103.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 +44 -0
- package/README.md +32 -2
- package/dist/{alert-dialog-DYzxchiS.js → alert-dialog-NFyAiSqc.js} +1 -1
- package/dist/{async-slice-drJyPvuM.js → async-slice-D35bX79S.js} +1 -1
- package/dist/{bubble-input-CQwVSoU3.js → bubble-input-BxI1WmNs.js} +17 -5
- package/dist/{button-GeIsUekU.js → button-Be7GZzF9.js} +2 -2
- package/dist/{calculator-BS4PAm6l.js → calculator-BGy1Q7rn.js} +261 -460
- package/dist/calculator-field.js +7 -7
- package/dist/{calculator-segment-CEdwE24M.js → calculator-segment-uixk6lBg.js} +1 -1
- package/dist/calculator.js +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-BdEtFQ85.js → chip-3rWebZEM.js} +2 -2
- package/dist/{code-editor-BByXZOGy.js → code-editor-BqSVMfy-.js} +178 -177
- package/dist/code-editor.js +5 -5
- package/dist/{code-language-items-CSZX5zxD.js → code-language-items-Cf2LJVg2.js} +14 -5
- package/dist/components/ui/actions/action-card/action-card-tile.css +47 -0
- package/dist/components/ui/display/code/code-moonlight.css +10 -10
- package/dist/{components-BrZkSs3O.js → components-D2liJ9Yu.js} +17725 -17287
- package/dist/components.js +38 -37
- package/dist/{conversion-variant-DTQqAyDt.js → conversion-variant-clFZ6ZMJ.js} +5 -5
- package/dist/{currency-field-Dnju7ss2.js → currency-field-CBFEVNM1.js} +24 -23
- package/dist/{dialog-5_2__tu8.js → dialog-CrIIINTk.js} +3 -3
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-FdGC5kIP.js → dropdown-menu-BnfLWu8n.js} +1 -1
- package/dist/editor.js +9 -9
- package/dist/{empty-state-BoepPG5v.js → empty-state-CuUaCPY7.js} +1 -1
- package/dist/{field-blur-DkiZOVNV.js → field-blur-DMJwPLsg.js} +9 -9
- package/dist/field-blur-context-3rKussBQ.js +29 -0
- package/dist/{financial-variant-BhqJp5C-.js → financial-variant-BY_VCUuk.js} +5 -5
- package/dist/{hooks-C8MhL6hs.js → hooks-hHoZbL-4.js} +106 -61
- package/dist/hooks.js +6 -6
- package/dist/{hover-card-CmHJeBeY.js → hover-card-Do2-uzlF.js} +1 -1
- package/dist/i18n.js +3 -3
- package/dist/{icon-badge-LGUPQh_c.js → icon-badge-CHaVNEmb.js} +1 -1
- package/dist/{icon-button-BSVpO1jP.js → icon-button-BIAubLeJ.js} +1 -1
- package/dist/key-layout-D2goCDkD.js +31 -0
- package/dist/keypad.js +551 -0
- package/dist/label-DR-zZyGQ.js +47 -0
- package/dist/lib/components/ui/display/code/code-block-parts.d.ts +1 -1
- package/dist/lib/components/ui/display/code/code-block.d.ts +4 -1
- package/dist/lib/components/ui/display/code/languages.d.ts +2 -0
- package/dist/lib/components/ui/display/code/moonlight-tokens.d.ts +10 -10
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-props.d.ts +73 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog-rules.d.ts +12 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-dialog.d.ts +5 -61
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-footer.d.ts +12 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/confirm-phrase.d.ts +26 -0
- package/dist/lib/components/ui/feedback/confirm-dialog/use-confirm-action.d.ts +1 -1
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/layout/index.d.ts +1 -0
- package/dist/lib/components/ui/layout/panel-card/index.d.ts +1 -0
- package/dist/lib/components/ui/layout/panel-card/panel-card.d.ts +21 -0
- package/dist/lib/components/ui/selection/index.d.ts +1 -0
- package/dist/lib/components/ui/selection/status-menu/index.d.ts +3 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-confirm.d.ts +12 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-icon.d.ts +6 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-items.d.ts +18 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-menu-list.d.ts +14 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-sheet-row.d.ts +11 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-sheet.d.ts +21 -0
- package/dist/lib/components/ui/selection/status-menu/partials/status-trigger.d.ts +18 -0
- package/dist/lib/components/ui/selection/status-menu/status-menu-data.d.ts +12 -0
- package/dist/lib/components/ui/selection/status-menu/status-menu-form-field.d.ts +20 -0
- package/dist/lib/components/ui/selection/status-menu/status-menu.d.ts +13 -0
- package/dist/lib/components/ui/selection/status-menu/types.d.ts +76 -0
- package/dist/lib/components/ui/selection/status-menu/use-status-change.d.ts +18 -0
- package/dist/lib/components/ui/selection/status-menu/use-status-menu.d.ts +30 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +1 -5
- package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +3 -49
- package/dist/lib/components/ui/widgets/keypad/cash-model.d.ts +16 -0
- package/dist/lib/components/ui/widgets/keypad/index.d.ts +5 -0
- package/dist/lib/components/ui/widgets/keypad/key-layout.d.ts +56 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-binding.d.ts +32 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-cash.d.ts +28 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-display.d.ts +11 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-entry.d.ts +39 -0
- package/dist/lib/components/ui/widgets/keypad/keypad-grid.d.ts +27 -0
- package/dist/lib/components/ui/widgets/{calculator/partials/calculator-key.d.ts → keypad/keypad-key.d.ts} +6 -3
- package/dist/lib/components/ui/widgets/keypad/keypad-layout.d.ts +19 -0
- package/dist/lib/components/ui/widgets/{calculator/partials → keypad}/keypad-navigation.d.ts +1 -1
- package/dist/lib/components/ui/widgets/keypad/keypad.d.ts +9 -0
- package/dist/lib/components/ui/widgets/keypad/keypad.types.d.ts +91 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-cash.d.ts +14 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-keyboard.d.ts +7 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-number.d.ts +10 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-quantity.d.ts +16 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad-value.d.ts +17 -0
- package/dist/lib/components/ui/widgets/keypad/use-keypad.d.ts +23 -0
- package/dist/lib/hooks/index.d.ts +2 -0
- package/dist/lib/hooks/use-barcode-scanner.d.ts +39 -0
- package/dist/lib/hooks/use-latched.d.ts +18 -0
- package/dist/lib/i18n/resources/en/en.d.ts +25 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +26 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +25 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +26 -1
- package/dist/lib/i18n/resources/resources.d.ts +50 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/keypad/index.d.ts +20 -0
- package/dist/lib.js +1 -1
- package/dist/main.js +54 -53
- package/dist/map.js +9 -9
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/{percent-field-DGlU_xii.js → percent-field-DU8eIMD3.js} +15 -14
- package/dist/{picker-surface-CGhqNR8a.js → picker-surface-XmA--JVI.js} +4 -4
- package/dist/{popover-ZxL7ktKk.js → popover-D8iHiAbl.js} +1 -1
- package/dist/{pos-types-BQ0QpYMp.js → pos-types-BEAY27Rm.js} +1 -1
- package/dist/{pos-variant-CKy8h_5i.js → pos-variant-ClGI92Lt.js} +25 -25
- package/dist/print.js +1 -1
- package/dist/{programmer-variant-CbHstE28.js → programmer-variant-Boq2O8hB.js} +30 -30
- package/dist/{public-D-tdOz4b.js → public-DOrXKmcL.js} +9 -9
- package/dist/{rich-code-block-CTPj1LuD.js → rich-code-block-Djj2XE_u.js} +18 -18
- package/dist/{scientific-variant-B8U9h3II.js → scientific-variant-BzF_aMQP.js} +8 -8
- package/dist/{sortable-provider-CSoWE7Ce.js → sortable-provider-DCZjsIIH.js} +2 -2
- package/dist/{spinner-ffuwBXHl.js → spinner-Cg0y_E_K.js} +1 -1
- package/dist/standard-layout-DTr9yy8Z.js +48 -0
- package/dist/{tabs-JgRq6ZJx.js → tabs-DpessV5s.js} +1 -1
- package/dist/{text-field-DURkIP-v.js → text-field-Dxk9lAKM.js} +16 -15
- package/dist/theme-picker.js +13 -13
- package/dist/{theme-toggle-n_Zg7JAA.js → theme-toggle-B6Jl5Kfn.js} +1 -1
- package/dist/{toolbar-items-IANZdcw4.js → toolbar-items-Cs1XrZsH.js} +4 -4
- package/dist/{translate-material-CMHUH5Ha.js → translate-material-Du0j0t97.js} +1 -1
- package/dist/{translator-9zA-Um3W.js → translator-BVs4n0Fz.js} +52 -2
- package/dist/use-calculator-keyboard-BZ1CA4Ut.js +222 -0
- package/dist/{use-chat-composer-BoIN7RCA.js → use-chat-composer-B4m3OEm1.js} +241 -240
- package/dist/{use-heading-spy-8o20PEZH.js → use-heading-spy-CO3_AtY9.js} +240 -142
- package/dist/{use-material-translation-CLNaMhUf.js → use-material-translation-uNc1FyC8.js} +1 -1
- package/dist/{use-return-focus-DWhbTGVe.js → use-return-focus-AfLRrUm-.js} +1 -1
- package/docs/README.md +1 -0
- package/docs/components/README.md +1 -0
- package/docs/components/buttons-and-actions.md +34 -2
- package/docs/components/data-display.md +4 -1
- package/docs/components/feedback-and-status.md +34 -0
- package/docs/components/navigation-and-layout.md +28 -0
- package/docs/components/rich-widgets.md +28 -0
- package/docs/components/selection-and-choice.md +120 -0
- package/docs/guides/calculator.md +1 -1
- package/docs/guides/cards-and-tiles.md +21 -24
- package/docs/guides/forms.md +1 -0
- package/docs/guides/helpers.md +78 -0
- package/docs/guides/keypad.md +225 -0
- package/docs/previews/data-display-codeblock.webp +0 -0
- package/docs/previews/data-display-codegroup.webp +0 -0
- package/docs/previews/data-display-jsonviewer.webp +0 -0
- package/docs/previews/navigation-layout-panelcard.webp +0 -0
- package/docs/previews/rich-widgets-keypad.webp +0 -0
- package/docs/previews/selection-choice-statusmenu.webp +0 -0
- package/docs/roadmap.md +21 -0
- package/docs/troubleshooting.md +63 -0
- package/lib/components/ui/actions/action-card/action-card-tile.css +47 -0
- package/lib/components/ui/display/code/code-moonlight.css +10 -10
- package/lib/components/ui/widgets/calculator/calculator.css +87 -0
- package/package.json +7 -2
- package/dist/field-blur-context-BLGgf_3z.js +0 -73
- package/dist/key-layout-cR79xfGE.js +0 -38
- package/dist/standard-layout-BuSRr3TY.js +0 -40
package/dist/theme-picker.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { a as t,
|
|
2
|
+
import { a as t, n, o as r, r as i, s as a, t as o } from "./bubble-input-BxI1WmNs.js";
|
|
3
3
|
import { a as s, r as c } from "./icon-sprites-CaYXzOL4.js";
|
|
4
|
-
import { t as l } from "./use-material-translation-
|
|
4
|
+
import { t as l } from "./use-material-translation-uNc1FyC8.js";
|
|
5
5
|
import { t as u } from "./use-theme-BCLireTd.js";
|
|
6
6
|
import { a as d, r as f } from "./theme-context-Cofk6vgs.js";
|
|
7
|
-
import { t as p } from "./theme-toggle-
|
|
7
|
+
import { t as p } from "./theme-toggle-B6Jl5Kfn.js";
|
|
8
8
|
import { n as m, t as h } from "./nxgt-theme-DA1IQe0O.js";
|
|
9
9
|
import { useContext as g } from "react";
|
|
10
10
|
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
@@ -67,11 +67,11 @@ function A({ background: e }) {
|
|
|
67
67
|
}
|
|
68
68
|
//#endregion
|
|
69
69
|
//#region lib/theme-picker/partials/theme-tile.tsx
|
|
70
|
-
function j({ theme: e, label:
|
|
70
|
+
function j({ theme: e, label: n, showBackground: s, background: c }) {
|
|
71
71
|
let l = /* @__PURE__ */ _(h, {
|
|
72
72
|
theme: e,
|
|
73
73
|
asChild: !0,
|
|
74
|
-
children: /* @__PURE__ */ v(
|
|
74
|
+
children: /* @__PURE__ */ v(a, {
|
|
75
75
|
"data-slot": "theme-tile",
|
|
76
76
|
children: [
|
|
77
77
|
s && /* @__PURE__ */ _(A, { background: c }),
|
|
@@ -86,9 +86,9 @@ function j({ theme: e, label: r, showBackground: s, background: c }) {
|
|
|
86
86
|
}),
|
|
87
87
|
/* @__PURE__ */ _("span", {
|
|
88
88
|
"data-slot": "theme-tile-label",
|
|
89
|
-
children:
|
|
89
|
+
children: n
|
|
90
90
|
}),
|
|
91
|
-
/* @__PURE__ */ _(
|
|
91
|
+
/* @__PURE__ */ _(i, {
|
|
92
92
|
asChild: !0,
|
|
93
93
|
children: /* @__PURE__ */ _(T, {
|
|
94
94
|
"aria-hidden": !0,
|
|
@@ -98,9 +98,9 @@ function j({ theme: e, label: r, showBackground: s, background: c }) {
|
|
|
98
98
|
]
|
|
99
99
|
})
|
|
100
100
|
});
|
|
101
|
-
return /* @__PURE__ */ _(
|
|
101
|
+
return /* @__PURE__ */ _(r, {
|
|
102
102
|
value: e.name,
|
|
103
|
-
...o(l, /* @__PURE__ */ _(
|
|
103
|
+
...o(l, /* @__PURE__ */ _(t, {}))
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
//#endregion
|
|
@@ -116,19 +116,19 @@ function M(e, t) {
|
|
|
116
116
|
}
|
|
117
117
|
//#endregion
|
|
118
118
|
//#region lib/theme-picker/theme-picker.tsx
|
|
119
|
-
function N({ themes: t, value:
|
|
119
|
+
function N({ themes: t, value: r, onValueChange: i, showMode: a = !0, showBackground: o = !0, layout: s = "grid", className: c, ...p }) {
|
|
120
120
|
let { t: h, language: y } = l(), b = g(f), { themeName: x, setThemeName: S } = u(), C = d()?.name ?? x, w = t ?? b ?? E;
|
|
121
121
|
return /* @__PURE__ */ v("div", {
|
|
122
122
|
"data-slot": "theme-picker",
|
|
123
123
|
"data-layout": s,
|
|
124
124
|
className: e("flex flex-col gap-4", c),
|
|
125
125
|
...p,
|
|
126
|
-
children: [/* @__PURE__ */ _(
|
|
126
|
+
children: [/* @__PURE__ */ _(n, {
|
|
127
127
|
"data-slot": "theme-picker-group",
|
|
128
128
|
"aria-label": h("material.theme-picker.label", "Theme"),
|
|
129
|
-
value:
|
|
129
|
+
value: r ?? C,
|
|
130
130
|
onValueChange: (e) => {
|
|
131
|
-
|
|
131
|
+
r === void 0 && S(e), i?.(e);
|
|
132
132
|
},
|
|
133
133
|
children: w.map((e) => /* @__PURE__ */ _(j, {
|
|
134
134
|
theme: e,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./use-material-translation-
|
|
1
|
+
import { t as e } from "./use-material-translation-uNc1FyC8.js";
|
|
2
2
|
import { i as t } from "./theme-store-BdPp43cV.js";
|
|
3
3
|
import { n, t as r } from "./use-theme-BCLireTd.js";
|
|
4
4
|
import { r as i } from "./theme-context-Cofk6vgs.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { o as t, t as n } from "./dist-DVRQkaTK.js";
|
|
3
3
|
import { i as r, r as i } from "./dist-DWZXlCZR.js";
|
|
4
|
-
import { n as a } from "./spinner-
|
|
4
|
+
import { n as a } from "./spinner-Cg0y_E_K.js";
|
|
5
5
|
import { a as o } from "./dist-DHdUUM1w.js";
|
|
6
6
|
import { i as s, n as c, r as l, t as u } from "./dist-DOK3zo5C.js";
|
|
7
7
|
import { t as d } from "./in-dialog-D61Yeaol.js";
|
|
8
|
-
import { A as f, M as p, N as m, b as h, d as g, f as _, i as v, j as y, l as b, n as x, o as S, r as C, t as w, u as T, y as ee } from "./dropdown-menu-
|
|
9
|
-
import { a as te, n as ne } from "./popover-
|
|
8
|
+
import { A as f, M as p, N as m, b as h, d as g, f as _, i as v, j as y, l as b, n as x, o as S, r as C, t as w, u as T, y as ee } from "./dropdown-menu-BnfLWu8n.js";
|
|
9
|
+
import { a as te, n as ne } from "./popover-D8iHiAbl.js";
|
|
10
10
|
import { i as re, n as ie, r as ae, t as oe } from "./dist-BZe2evxL.js";
|
|
11
11
|
import { t as se } from "./warn-once-C_e47JM8.js";
|
|
12
|
-
import { t as ce } from "./use-material-translation-
|
|
12
|
+
import { t as ce } from "./use-material-translation-uNc1FyC8.js";
|
|
13
13
|
import * as E from "react";
|
|
14
14
|
import { createContext as D, useCallback as le, useContext as O, useEffect as k, useId as ue, useLayoutEffect as A, useMemo as j, useReducer as de, useRef as M, useState as N } from "react";
|
|
15
15
|
import { Fragment as P, jsx as F, jsxs as I } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, l as t, r as n, s as r, t as i, u as a } from "./translator-
|
|
1
|
+
import { a as e, l as t, r as n, s as r, t as i, u as a } from "./translator-BVs4n0Fz.js";
|
|
2
2
|
import { createContext as o, useCallback as s, useContext as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
3
3
|
import { jsx as p } from "react/jsx-runtime";
|
|
4
4
|
//#region lib/i18n/material-resources-registry.ts
|
|
@@ -65,7 +65,8 @@ var r = {
|
|
|
65
65
|
cancel: "Cancel",
|
|
66
66
|
processing: "Processing...",
|
|
67
67
|
failed: "The action failed.",
|
|
68
|
-
"form-failed": "The form could not be loaded."
|
|
68
|
+
"form-failed": "The form could not be loaded.",
|
|
69
|
+
"type-phrase": "Type {phrase} to confirm"
|
|
69
70
|
},
|
|
70
71
|
"scroll-progress": "Scroll progress",
|
|
71
72
|
"skip-link": "Skip to content",
|
|
@@ -1410,6 +1411,19 @@ var r = {
|
|
|
1410
1411
|
invalid: "Enter a valid URL",
|
|
1411
1412
|
open: "Open URL"
|
|
1412
1413
|
},
|
|
1414
|
+
"status-menu": {
|
|
1415
|
+
trigger: "Status of {label}: {status}",
|
|
1416
|
+
current: "Current status",
|
|
1417
|
+
confirms: "Asks first",
|
|
1418
|
+
"confirm-default": "Change the status to {label}?",
|
|
1419
|
+
locked: "Locked",
|
|
1420
|
+
unavailable: "Not available from {status}",
|
|
1421
|
+
saving: "Saving the status of {label}",
|
|
1422
|
+
changed: "Status of {label} changed to {status}",
|
|
1423
|
+
failed: "The status of {label} could not be changed",
|
|
1424
|
+
close: "Close",
|
|
1425
|
+
choose: "Choose a status"
|
|
1426
|
+
},
|
|
1413
1427
|
stepper: {
|
|
1414
1428
|
step: "Step {step}",
|
|
1415
1429
|
completed: "Completed",
|
|
@@ -3457,6 +3471,17 @@ var r = {
|
|
|
3457
3471
|
cancel: "Cancel"
|
|
3458
3472
|
}
|
|
3459
3473
|
},
|
|
3474
|
+
keypad: {
|
|
3475
|
+
commit: "Enter",
|
|
3476
|
+
tender: "Tender",
|
|
3477
|
+
total: "Total",
|
|
3478
|
+
change: "Change {amount}",
|
|
3479
|
+
due: "Still due {amount}",
|
|
3480
|
+
shortcuts: "Quick amounts",
|
|
3481
|
+
"change-label": "Change",
|
|
3482
|
+
"due-label": "Still due",
|
|
3483
|
+
amount: "Amount {amount}"
|
|
3484
|
+
},
|
|
3460
3485
|
"record-actions": {
|
|
3461
3486
|
archive: "Archive",
|
|
3462
3487
|
restore: "Restore",
|
|
@@ -3589,7 +3614,8 @@ var r = {
|
|
|
3589
3614
|
cancel: "Annuler",
|
|
3590
3615
|
processing: "Traitement en cours…",
|
|
3591
3616
|
failed: "L’action a échoué.",
|
|
3592
|
-
"form-failed": "Le formulaire n’a pas pu être chargé."
|
|
3617
|
+
"form-failed": "Le formulaire n’a pas pu être chargé.",
|
|
3618
|
+
"type-phrase": "Saisissez {phrase} pour confirmer"
|
|
3593
3619
|
},
|
|
3594
3620
|
"scroll-progress": "Progression du défilement",
|
|
3595
3621
|
"skip-link": "Aller au contenu",
|
|
@@ -4934,6 +4960,19 @@ var r = {
|
|
|
4934
4960
|
invalid: "Saisissez une URL valide",
|
|
4935
4961
|
open: "Ouvrir l’URL"
|
|
4936
4962
|
},
|
|
4963
|
+
"status-menu": {
|
|
4964
|
+
trigger: "Statut de {label} : {status}",
|
|
4965
|
+
current: "Statut actuel",
|
|
4966
|
+
confirms: "Demande confirmation",
|
|
4967
|
+
"confirm-default": "Changer le statut en {label} ?",
|
|
4968
|
+
locked: "Verrouillé",
|
|
4969
|
+
unavailable: "Indisponible depuis {status}",
|
|
4970
|
+
saving: "Enregistrement du statut de {label}",
|
|
4971
|
+
changed: "Statut de {label} changé en {status}",
|
|
4972
|
+
failed: "Le statut de {label} n'a pas pu être changé",
|
|
4973
|
+
close: "Fermer",
|
|
4974
|
+
choose: "Choisir un statut"
|
|
4975
|
+
},
|
|
4937
4976
|
stepper: {
|
|
4938
4977
|
step: "Étape {step}",
|
|
4939
4978
|
completed: "Terminée",
|
|
@@ -6981,6 +7020,17 @@ var r = {
|
|
|
6981
7020
|
cancel: "Annuler"
|
|
6982
7021
|
}
|
|
6983
7022
|
},
|
|
7023
|
+
keypad: {
|
|
7024
|
+
commit: "Valider",
|
|
7025
|
+
tender: "Encaisser",
|
|
7026
|
+
total: "Total",
|
|
7027
|
+
change: "Monnaie à rendre {amount}",
|
|
7028
|
+
due: "Reste à payer {amount}",
|
|
7029
|
+
shortcuts: "Montants rapides",
|
|
7030
|
+
"change-label": "Monnaie",
|
|
7031
|
+
"due-label": "Reste à payer",
|
|
7032
|
+
amount: "Montant {amount}"
|
|
7033
|
+
},
|
|
6984
7034
|
"record-actions": {
|
|
6985
7035
|
archive: "Archiver",
|
|
6986
7036
|
restore: "Restaurer",
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
+
import { t } from "./use-material-translation-uNc1FyC8.js";
|
|
3
|
+
import { t as n } from "./useEvent-2fKq-6w8.js";
|
|
4
|
+
import { t as r } from "./useLatest-C2PnQEeD.js";
|
|
5
|
+
import { useCallback as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
6
|
+
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
import { keyFromEvent as d } from "@nxgt/material-core/calculator";
|
|
8
|
+
//#region lib/components/ui/widgets/keypad/keypad-key.tsx
|
|
9
|
+
var f = {
|
|
10
|
+
digit: "bg-muted text-foreground",
|
|
11
|
+
operator: "bg-secondary-container text-foreground",
|
|
12
|
+
equals: "bg-primary text-primary-foreground",
|
|
13
|
+
utility: "bg-tertiary-container text-foreground",
|
|
14
|
+
function: "bg-muted text-foreground",
|
|
15
|
+
memory: "bg-muted text-foreground",
|
|
16
|
+
bracket: "bg-muted text-foreground"
|
|
17
|
+
};
|
|
18
|
+
function p({ def: n, row: r, index: i, tabIndex: a, decimal: o, unavailable: s, onPress: c, onFocus: u, buttonRef: d, slot: p = "calculator-key", className: m = "nxgt-calc-key" }) {
|
|
19
|
+
let { t: h } = t();
|
|
20
|
+
return /* @__PURE__ */ l("button", {
|
|
21
|
+
ref: d,
|
|
22
|
+
type: "button",
|
|
23
|
+
"data-slot": p,
|
|
24
|
+
"data-key": n.id,
|
|
25
|
+
"data-role": n.role,
|
|
26
|
+
"data-span": n.span,
|
|
27
|
+
"aria-disabled": s ? !0 : void 0,
|
|
28
|
+
tabIndex: a,
|
|
29
|
+
"aria-label": n.label ?? h(n.name.key, n.name.fallback),
|
|
30
|
+
className: e(m, f[n.role]),
|
|
31
|
+
onClick: () => !s && c(n),
|
|
32
|
+
onFocus: () => u(r, i),
|
|
33
|
+
children: /* @__PURE__ */ l("span", {
|
|
34
|
+
"aria-hidden": "true",
|
|
35
|
+
children: n.key === "." ? o : n.glyph
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region lib/components/ui/widgets/keypad/keypad-navigation.ts
|
|
41
|
+
function m(e) {
|
|
42
|
+
return e.rows.map((e) => {
|
|
43
|
+
let t = 0;
|
|
44
|
+
return e.map((e) => {
|
|
45
|
+
let n = t;
|
|
46
|
+
return t += e.span ?? 1, {
|
|
47
|
+
start: n,
|
|
48
|
+
end: t
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
var h = (e) => Math.max(e - 1, 0);
|
|
54
|
+
function g(e, t, n, r) {
|
|
55
|
+
let i = t.row < r, a = i ? 0 : r, o = i ? r - 1 : h(e.length), s = e[t.row] ?? [];
|
|
56
|
+
if (n === "ArrowUp" || n === "ArrowDown") {
|
|
57
|
+
let e = t.row + (n === "ArrowUp" ? -1 : 1);
|
|
58
|
+
return e < a || e > o ? void 0 : null;
|
|
59
|
+
}
|
|
60
|
+
if (!(i ? n === "ArrowRight" && t.index === h(s.length) : n === "ArrowLeft" && t.index === 0)) return null;
|
|
61
|
+
let c = t.row - a, l = i ? [r, h(e.length)] : [0, r - 1], u = Math.min(l[0] + c, l[1]);
|
|
62
|
+
return {
|
|
63
|
+
row: u,
|
|
64
|
+
index: i ? 0 : h((e[u] ?? []).length)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function _(e, t, n, r = !1, i) {
|
|
68
|
+
let a = e[t.row] ?? [], o = a[t.index];
|
|
69
|
+
if (!o) return;
|
|
70
|
+
if (i && !(r && (n === "Home" || n === "End"))) {
|
|
71
|
+
let r = g(e, t, n, i);
|
|
72
|
+
if (r != null) return r;
|
|
73
|
+
if (r === void 0) return;
|
|
74
|
+
}
|
|
75
|
+
let s = h(e.length);
|
|
76
|
+
switch (n) {
|
|
77
|
+
case "ArrowLeft": return t.index > 0 ? {
|
|
78
|
+
row: t.row,
|
|
79
|
+
index: t.index - 1
|
|
80
|
+
} : void 0;
|
|
81
|
+
case "ArrowRight": return t.index < h(a.length) ? {
|
|
82
|
+
row: t.row,
|
|
83
|
+
index: t.index + 1
|
|
84
|
+
} : void 0;
|
|
85
|
+
case "ArrowUp":
|
|
86
|
+
case "ArrowDown": {
|
|
87
|
+
let r = t.row + (n === "ArrowUp" ? -1 : 1), i = e[r];
|
|
88
|
+
if (!i) return;
|
|
89
|
+
let a = i.findIndex((e) => e.start <= o.start && o.start < e.end);
|
|
90
|
+
return {
|
|
91
|
+
row: r,
|
|
92
|
+
index: Math.max(a, 0)
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
case "Home": return r ? {
|
|
96
|
+
row: 0,
|
|
97
|
+
index: 0
|
|
98
|
+
} : {
|
|
99
|
+
row: t.row,
|
|
100
|
+
index: 0
|
|
101
|
+
};
|
|
102
|
+
case "End": return r ? {
|
|
103
|
+
row: s,
|
|
104
|
+
index: h((e[s] ?? []).length)
|
|
105
|
+
} : {
|
|
106
|
+
row: t.row,
|
|
107
|
+
index: h(a.length)
|
|
108
|
+
};
|
|
109
|
+
default: return;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
function v(e) {
|
|
113
|
+
let t = e.querySelectorAll("[data-pane]"), [n, r] = [t[0]?.firstElementChild, t[1]?.firstElementChild];
|
|
114
|
+
return !n || !r ? !1 : n.getBoundingClientRect().right <= r.getBoundingClientRect().left;
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region lib/components/ui/widgets/keypad/keypad-grid.tsx
|
|
118
|
+
var y = /* @__PURE__ */ new Set([
|
|
119
|
+
"ArrowLeft",
|
|
120
|
+
"ArrowRight",
|
|
121
|
+
"ArrowUp",
|
|
122
|
+
"ArrowDown",
|
|
123
|
+
"Home",
|
|
124
|
+
"End"
|
|
125
|
+
]);
|
|
126
|
+
function b(e, t, n, r) {
|
|
127
|
+
let i = e.map((e, t) => r(e, t));
|
|
128
|
+
return t ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", {
|
|
129
|
+
className: n,
|
|
130
|
+
"data-pane": "functions",
|
|
131
|
+
children: i.slice(0, t)
|
|
132
|
+
}), /* @__PURE__ */ l("div", {
|
|
133
|
+
className: n,
|
|
134
|
+
"data-pane": "main",
|
|
135
|
+
children: i.slice(t)
|
|
136
|
+
})] }) : i;
|
|
137
|
+
}
|
|
138
|
+
function x({ layout: e, label: t, describedBy: n, decimal: r, faceOf: i = (e) => e, unavailable: c, onPress: u, slot: d = "calculator-keypad", className: f = "nxgt-calc-keys", keySlot: h, keyClassName: g, paneClassName: x = "nxgt-calc-pane" }) {
|
|
139
|
+
let S = a(() => m(e), [e]), [C, w] = s({
|
|
140
|
+
row: 0,
|
|
141
|
+
index: 0
|
|
142
|
+
}), T = S[C.row]?.[C.index] ? C : {
|
|
143
|
+
row: 0,
|
|
144
|
+
index: 0
|
|
145
|
+
}, E = o(/* @__PURE__ */ new Map());
|
|
146
|
+
function D(t) {
|
|
147
|
+
if (!y.has(t.key) || t.altKey || t.metaKey) return;
|
|
148
|
+
let n = _(S, T, t.key, t.ctrlKey, v(t.currentTarget) ? e.split : void 0);
|
|
149
|
+
t.preventDefault(), n && E.current.get(`${n.row}:${n.index}`)?.focus();
|
|
150
|
+
}
|
|
151
|
+
return /* @__PURE__ */ l("div", {
|
|
152
|
+
role: "group",
|
|
153
|
+
"aria-label": t,
|
|
154
|
+
"aria-describedby": n,
|
|
155
|
+
dir: "ltr",
|
|
156
|
+
"data-slot": d,
|
|
157
|
+
"data-columns": e.columns,
|
|
158
|
+
className: f,
|
|
159
|
+
onKeyDown: D,
|
|
160
|
+
children: b(e.rows, e.split, x, (e, t) => e.map((e, n) => {
|
|
161
|
+
let a = i(e);
|
|
162
|
+
return /* @__PURE__ */ l(p, {
|
|
163
|
+
def: a,
|
|
164
|
+
row: t,
|
|
165
|
+
index: n,
|
|
166
|
+
decimal: r,
|
|
167
|
+
unavailable: c?.(a),
|
|
168
|
+
tabIndex: T.row === t && T.index === n ? 0 : -1,
|
|
169
|
+
slot: h,
|
|
170
|
+
className: g,
|
|
171
|
+
buttonRef: (e) => {
|
|
172
|
+
E.current.set(`${t}:${n}`, e);
|
|
173
|
+
},
|
|
174
|
+
onFocus: (e, t) => w({
|
|
175
|
+
row: e,
|
|
176
|
+
index: t
|
|
177
|
+
}),
|
|
178
|
+
onPress: u
|
|
179
|
+
}, a.id);
|
|
180
|
+
}))
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region lib/components/ui/widgets/calculator/calculator-keyboard.ts
|
|
185
|
+
var S = /* @__PURE__ */ new Set([
|
|
186
|
+
"INPUT",
|
|
187
|
+
"TEXTAREA",
|
|
188
|
+
"SELECT"
|
|
189
|
+
]);
|
|
190
|
+
function C(e) {
|
|
191
|
+
return e ? S.has(e.tagName?.toUpperCase() ?? "") || e.isContentEditable === !0 : !1;
|
|
192
|
+
}
|
|
193
|
+
function w(e, t) {
|
|
194
|
+
if (e.defaultPrevented) return null;
|
|
195
|
+
let n = e.target;
|
|
196
|
+
if (t.global && C(n) || e.key === "Enter" && n?.closest?.("button")) return null;
|
|
197
|
+
let r = d(e, {
|
|
198
|
+
locale: t.locale,
|
|
199
|
+
programmer: t.programmer
|
|
200
|
+
});
|
|
201
|
+
return r === null ? null : r === "copy" ? t.hasSelection?.() ? null : r : r === "paste" ? null : t.accepts(r) ? r : null;
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region lib/components/ui/widgets/calculator/use-calculator-keyboard.ts
|
|
205
|
+
var T = () => (globalThis.getSelection?.()?.toString() ?? "") !== "";
|
|
206
|
+
function E(e) {
|
|
207
|
+
let t = r(e), a = i((e) => {
|
|
208
|
+
let { locale: n, accepts: r, global: i, programmer: a, onKey: o, onCopy: s, beforeKey: c } = t.current;
|
|
209
|
+
if (!e.defaultPrevented && c?.(e)) return e.preventDefault();
|
|
210
|
+
let l = w(e, {
|
|
211
|
+
locale: n,
|
|
212
|
+
accepts: r,
|
|
213
|
+
global: i,
|
|
214
|
+
programmer: a,
|
|
215
|
+
hasSelection: T
|
|
216
|
+
});
|
|
217
|
+
l !== null && (e.preventDefault(), l === "copy" ? s() : l !== "paste" && o(l));
|
|
218
|
+
}, [t]);
|
|
219
|
+
return n("keydown", i((e) => a(e), [a]), e.global && typeof window < "u" ? window : null), i((e) => a(e), [a]);
|
|
220
|
+
}
|
|
221
|
+
//#endregion
|
|
222
|
+
export { x as n, E as t };
|