@nxgt/material 3.75.0 → 3.76.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 +37 -1
- package/dist/{alert-dialog-BfO_ri-N.js → alert-dialog-653apk3f.js} +8 -7
- package/dist/{async-slice-roMAJVzG.js → async-slice-CXLbQuOc.js} +1 -1
- package/dist/{bubble-input-B7BVd9fX.js → bubble-input-CQwVSoU3.js} +30 -29
- package/dist/{button-DgenqmpS.js → button-3op3rtZh.js} +5 -4
- package/dist/calculator-BaSMe0SK.js +1189 -0
- package/dist/calculator-announce-DRd2c6Dq.js +89 -0
- package/dist/calculator-context-BugcKuVG.js +10 -0
- package/dist/calculator-field.js +172 -0
- package/dist/calculator-panel-announce-AZSnZUSr.js +29 -0
- package/dist/calculator-segment-BlJE1LaS.js +22 -0
- package/dist/calculator.js +2 -0
- package/dist/charts.js +3 -3
- package/dist/{chip-CiDczNxO.js → chip-MuKDwtkG.js} +2 -2
- package/dist/{code-editor-CohlhFsA.js → code-editor-Bp2RrdNx.js} +13 -13
- package/dist/code-editor.js +37 -37
- package/dist/{code-language-items-Cs8GLYDp.js → code-language-items-B7WR5ua_.js} +19 -24
- package/dist/components/base-content.css +9 -4
- package/dist/components/ui/collections/server-table/server-table-phone-row.css +10 -3
- package/dist/{components-zJdfH4im.js → components-Ci3Zo8kC.js} +15837 -17245
- package/dist/components.js +37 -28
- package/dist/conversion-variant-BDFAxqe9.js +529 -0
- package/dist/copy-to-clipboard-Be5Ffvs_.js +7 -0
- package/dist/currency-B-r3ig11.js +16 -0
- package/dist/currency-field-BJ9rSrif.js +285 -0
- package/dist/{number.utils-BG_eEt5g.js → date.utils-DUvqcjan.js} +1 -7
- package/dist/dialog-Bm5LvVlB.js +166 -0
- package/dist/dist-BZe2evxL.js +139 -0
- package/dist/dist-CxhKjOYm.js +28 -0
- package/dist/dist-DHdUUM1w.js +241 -0
- package/dist/{dist-C4wtXCjf.js → dist-DOK3zo5C.js} +33 -32
- package/dist/dist-DWZXlCZR.js +182 -0
- package/dist/dist-DkQbkF9T.js +33 -0
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-CzR6JP31.js → dropdown-menu-xlZ6NYUA.js} +160 -159
- package/dist/editor.js +299 -298
- package/dist/{empty-state-DjHGMp5F.js → empty-state-C0kviQdW.js} +2 -2
- package/dist/{field-blur-CdASxjL7.js → field-blur-DkiZOVNV.js} +178 -180
- package/dist/{field-blur-context-kZ4SD7xu.js → field-blur-context-BLGgf_3z.js} +2 -2
- package/dist/financial-variant-BsZEa5sF.js +459 -0
- package/dist/{hooks-Dqq8O3Az.js → hooks-Dg94jPRq.js} +12 -12
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-BPKqte4a.js → hover-card-B1g55Hi6.js} +44 -43
- package/dist/i18n.js +3 -3
- package/dist/icon-badge-BcW66bRk.js +17 -0
- package/dist/{icon-button-Cr-DyDGg.js → icon-button-Cogxy1cy.js} +5 -4
- package/dist/{in-dialog-Vwkyp-M5.js → in-dialog-D61Yeaol.js} +2 -1
- package/dist/input-CC2joTjB.js +56 -0
- package/dist/key-layout-cR79xfGE.js +38 -0
- package/dist/lib/calculator/index.d.ts +16 -0
- package/dist/lib/calculator-field/index.d.ts +12 -0
- package/dist/lib/components/ui/collections/filter/use-filter-field-config.d.ts +2 -2
- package/dist/lib/components/ui/feedback/moment/moment-body.d.ts +17 -2
- package/dist/lib/components/ui/feedback/moment/moment-passive.d.ts +13 -0
- package/dist/lib/components/ui/feedback/moment/moment.d.ts +16 -2
- package/dist/lib/components/ui/fields/calculator-field/apply-calculated.d.ts +17 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-field-content.d.ts +16 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-field-trigger.d.ts +4 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-field.d.ts +12 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-field.types.d.ts +31 -0
- package/dist/lib/components/ui/fields/calculator-field/calculator-form-field.d.ts +4 -0
- package/dist/lib/components/ui/fields/calculator-field/index.d.ts +3 -0
- package/dist/lib/components/ui/fields/calculator-field/use-calculator-field.d.ts +15 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/currency-field/currency-field.d.ts +7 -1
- package/dist/lib/components/ui/layout/app-shell/app-sidebar-context.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-announce.d.ts +27 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-clipboard.d.ts +19 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-context.d.ts +49 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-feedback.d.ts +18 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-keyboard.d.ts +30 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-storage.d.ts +17 -0
- package/dist/lib/components/ui/widgets/calculator/calculator-variant-steps.d.ts +16 -0
- package/dist/lib/components/ui/widgets/calculator/calculator.d.ts +11 -0
- package/dist/lib/components/ui/widgets/calculator/calculator.selectors.d.ts +23 -0
- package/dist/lib/components/ui/widgets/calculator/calculator.slice.d.ts +1881 -0
- package/dist/lib/components/ui/widgets/calculator/currency.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/engine.d.ts +22 -0
- package/dist/lib/components/ui/widgets/calculator/index.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-announcer.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-display.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-key.d.ts +17 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-keypad.d.ts +8 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-loading.d.ts +6 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-memory.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-panel-announce.d.ts +10 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-panel-body.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-screen.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-segment.d.ts +21 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-shell.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-switcher.d.ts +5 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-tape.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/partials/calculator-tools.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/partials/keypad-navigation.d.ts +24 -0
- package/dist/lib/components/ui/widgets/calculator/types.d.ts +102 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-clipboard.d.ts +19 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-conversion.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-feedback.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-keyboard.d.ts +22 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-persistence.d.ts +14 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-pos.d.ts +25 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-press.d.ts +26 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-tape.d.ts +29 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-value.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator-variant.d.ts +23 -0
- package/dist/lib/components/ui/widgets/calculator/use-calculator.d.ts +10 -0
- package/dist/lib/components/ui/widgets/calculator/use-engine-settings.d.ts +10 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-fields.d.ts +19 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-labels.d.ts +17 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-math.d.ts +31 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-names.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-panel.d.ts +7 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-rates.d.ts +29 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-result.d.ts +15 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-state.d.ts +36 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/conversion-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/conversion/use-conversion.d.ts +24 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-change.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-figures.d.ts +43 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-format.d.ts +12 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-loan-math.d.ts +14 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-loan.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-margin.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-math.d.ts +10 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-panel.d.ts +7 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-parts.d.ts +35 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-table.d.ts +7 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/financial/financial-vat.d.ts +4 -0
- package/dist/lib/components/ui/widgets/calculator/variants/key-layout.d.ts +51 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-announce.d.ts +16 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-aside.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-display.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-fields.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-layout.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-line.d.ts +6 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-names.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-state.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-tender.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-ticket-data.d.ts +41 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-ticket.d.ts +5 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-totals.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-types.d.ts +76 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-vat.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/pos/pos-view.d.ts +28 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-announce.d.ts +19 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-base.d.ts +11 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-bitpad.d.ts +14 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-display.d.ts +9 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-layout.d.ts +6 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-names.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-readouts.d.ts +14 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-reduce.d.ts +29 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-state.d.ts +22 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-toolbar.d.ts +5 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/programmer/programmer-word.d.ts +15 -0
- package/dist/lib/components/ui/widgets/calculator/variants/registry.d.ts +21 -0
- package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-layout.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-names.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-toolbar.d.ts +2 -0
- package/dist/lib/components/ui/widgets/calculator/variants/scientific/scientific-variant.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/standard/standard-layout.d.ts +3 -0
- package/dist/lib/components/ui/widgets/calculator/variants/variant-loader.d.ts +34 -0
- package/dist/lib/components/ui/widgets/calculator/variants/variant-logic.d.ts +40 -0
- package/dist/lib/components/ui/widgets/calculator/variants/variant-types.d.ts +62 -0
- package/dist/lib/i18n/resources/en/en.d.ts +412 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +412 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +412 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +412 -0
- package/dist/lib/i18n/resources/resources.d.ts +824 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +4 -3
- package/dist/main.js +50 -40
- package/dist/map.js +66 -65
- package/dist/material.css +1 -1
- package/dist/native-select-w_FlBLHV.js +40 -0
- package/dist/number.utils-CSueQZcv.js +7 -0
- package/dist/pdf-reader.js +1 -1
- package/dist/percent-field-lahyDJDG.js +14 -0
- package/dist/picker-surface-CV09H7Nb.js +1220 -0
- package/dist/popover-Cd7DkND4.js +233 -0
- package/dist/pos-types-DKCkOTYy.js +49 -0
- package/dist/pos-variant-GrUfbTTP.js +603 -0
- package/dist/print.js +1 -1
- package/dist/programmer-variant-eKJNKENL.js +501 -0
- package/dist/programmer-word-CNCF7DJF.js +15 -0
- package/dist/{public-DC9VQw4Z.js → public-y6g4ddxd.js} +895 -892
- package/dist/{rich-code-block-DBSL9zEN.js → rich-code-block-CRQ0iyLb.js} +5 -5
- package/dist/scientific-variant-2y3UxAAU.js +149 -0
- package/dist/{sortable-provider-C4tk5esY.js → sortable-provider-DdiI3Fwk.js} +2 -2
- package/dist/{spinner-B2MubVWb.js → spinner-C1QIewWv.js} +133 -159
- package/dist/standard-layout-BuSRr3TY.js +40 -0
- package/dist/tabs-DzEqMb1W.js +383 -0
- package/dist/{icon-badge-B9uvDoyY.js → text-field-BAdY-kpO.js} +20 -34
- package/dist/theme-picker.js +3 -3
- package/dist/{theme-toggle-BInlu21G.js → theme-toggle-C_VeiiCm.js} +2 -2
- package/dist/toggle-FeCCJqbg.js +40 -0
- package/dist/{toggle-group-DXXlqid2.js → toggle-group-CVMxEpWi.js} +1 -1
- package/dist/{toolbar-items-CRJSx1MU.js → toolbar-items-D310xDuM.js} +333 -554
- package/dist/{translate-material-pVlPJ1v4.js → translate-material-BypJJ1l5.js} +1 -1
- package/dist/{translator-BoYCward.js → translator-DJkf4J7t.js} +824 -0
- package/dist/{typography-B6YMbCge.js → typography-CYEquVeb.js} +1 -1
- package/dist/{use-chat-composer-BvWQogJe.js → use-chat-composer-DMXu9E1O.js} +4198 -4600
- package/dist/{use-heading-spy-B_Z4ArDh.js → use-heading-spy-DJR8YYm6.js} +19 -19
- package/dist/{use-material-translation-CIS2n3RB.js → use-material-translation-CD6QoVal.js} +1 -1
- package/dist/{use-return-focus-DNQtADAR.js → use-return-focus-Cevw_6yq.js} +106 -105
- package/dist/useLatest-C2PnQEeD.js +8 -0
- package/docs/README.md +1 -0
- package/docs/components/feedback-and-status.md +10 -1
- package/docs/components/form-fields.md +1 -0
- package/docs/components/rich-widgets.md +108 -0
- package/docs/getting-started.md +1 -0
- package/docs/guides/calculator.md +468 -0
- package/docs/guides/forms.md +4 -2
- package/docs/guides/i18n.md +5 -0
- package/docs/previews/rich-widgets-calculator-conversion.webp +0 -0
- package/docs/previews/rich-widgets-calculator-point-of-sale.webp +0 -0
- package/docs/previews/rich-widgets-calculator.webp +0 -0
- package/docs/roadmap.md +9 -3
- package/docs/troubleshooting.md +134 -0
- package/lib/components/base-content.css +9 -4
- package/lib/components/ui/collections/server-table/server-table-phone-row.css +10 -3
- package/lib/components/ui/widgets/calculator/calculator-bands.css +146 -0
- package/lib/components/ui/widgets/calculator/calculator-display.css +83 -0
- package/lib/components/ui/widgets/calculator/calculator-keys.css +118 -0
- package/lib/components/ui/widgets/calculator/calculator-pos-ticket.css +185 -0
- package/lib/components/ui/widgets/calculator/calculator-pos.css +38 -0
- package/lib/components/ui/widgets/calculator/calculator-tape.css +71 -0
- package/lib/components/ui/widgets/calculator/calculator.css +97 -0
- package/lib/components/ui/widgets/calculator/variants/conversion/conversion.css +98 -0
- package/lib/components/ui/widgets/calculator/variants/financial/financial.css +162 -0
- package/lib/components/ui/widgets/calculator/variants/programmer/programmer.css +162 -0
- package/package.json +17 -3
- package/dist/dialog-AGsB3bv4.js +0 -219
- package/dist/dist-B7RjY7SL.js +0 -158
- package/dist/dist-lmHmz_bu.js +0 -419
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { a as t, c as n, d as r, i, n as a, r as o, t as s, u as c } from "./alert-dialog-
|
|
3
|
-
import { a as l } from "./button-
|
|
4
|
-
import { i as u } from "./translate-material-
|
|
5
|
-
import { t as d } from "./use-material-translation-
|
|
6
|
-
import { _ as f, g as p, h as m,
|
|
2
|
+
import { a as t, c as n, d as r, i, n as a, r as o, t as s, u as c } from "./alert-dialog-653apk3f.js";
|
|
3
|
+
import { a as l } from "./button-3op3rtZh.js";
|
|
4
|
+
import { i as u } from "./translate-material-BypJJ1l5.js";
|
|
5
|
+
import { t as d } from "./use-material-translation-CD6QoVal.js";
|
|
6
|
+
import { _ as f, g as p, h as m, m as h, t as g, v as _ } from "./date.utils-DUvqcjan.js";
|
|
7
7
|
import { useCallback as v, useEffect as y, useMemo as b, useRef as x, useState as S } from "react";
|
|
8
8
|
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
9
9
|
import { busySettler as E, busySettler as D, createSubmitGuard as O, createSubmitGuard as k } from "@nxgt/material-core/submit-guard";
|
|
@@ -254,7 +254,7 @@ var A = {
|
|
|
254
254
|
], a;
|
|
255
255
|
return a = n === 1 ? r && i.includes(r) ? "ère" : "er" : "ème", n + a;
|
|
256
256
|
}, z = ["MMM", "MMMM"], B = {
|
|
257
|
-
en:
|
|
257
|
+
en: h,
|
|
258
258
|
fr: {
|
|
259
259
|
code: "fr",
|
|
260
260
|
formatDistance: j,
|
|
@@ -266,35 +266,35 @@ var A = {
|
|
|
266
266
|
value: "d"
|
|
267
267
|
} : e),
|
|
268
268
|
ordinalNumber: R,
|
|
269
|
-
era:
|
|
269
|
+
era: f({
|
|
270
270
|
values: ee,
|
|
271
271
|
defaultWidth: "wide"
|
|
272
272
|
}),
|
|
273
|
-
quarter:
|
|
273
|
+
quarter: f({
|
|
274
274
|
values: te,
|
|
275
275
|
defaultWidth: "wide",
|
|
276
276
|
argumentCallback: (e) => e - 1
|
|
277
277
|
}),
|
|
278
|
-
month:
|
|
278
|
+
month: f({
|
|
279
279
|
values: F,
|
|
280
280
|
defaultWidth: "wide"
|
|
281
281
|
}),
|
|
282
|
-
day:
|
|
282
|
+
day: f({
|
|
283
283
|
values: I,
|
|
284
284
|
defaultWidth: "wide"
|
|
285
285
|
}),
|
|
286
|
-
dayPeriod:
|
|
286
|
+
dayPeriod: f({
|
|
287
287
|
values: L,
|
|
288
288
|
defaultWidth: "wide"
|
|
289
289
|
})
|
|
290
290
|
},
|
|
291
291
|
match: {
|
|
292
|
-
ordinalNumber:
|
|
292
|
+
ordinalNumber: m({
|
|
293
293
|
matchPattern: /^(\d+)(ième|ère|ème|er|e)?/i,
|
|
294
294
|
parsePattern: /\d+/i,
|
|
295
295
|
valueCallback: (e) => parseInt(e)
|
|
296
296
|
}),
|
|
297
|
-
era:
|
|
297
|
+
era: p({
|
|
298
298
|
matchPatterns: {
|
|
299
299
|
narrow: /^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,
|
|
300
300
|
abbreviated: /^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,
|
|
@@ -304,7 +304,7 @@ var A = {
|
|
|
304
304
|
parsePatterns: { any: [/^av/i, /^ap/i] },
|
|
305
305
|
defaultParseWidth: "any"
|
|
306
306
|
}),
|
|
307
|
-
quarter:
|
|
307
|
+
quarter: p({
|
|
308
308
|
matchPatterns: {
|
|
309
309
|
narrow: /^T?[1234]/i,
|
|
310
310
|
abbreviated: /^[1234](er|ème|e)? trim\.?/i,
|
|
@@ -320,7 +320,7 @@ var A = {
|
|
|
320
320
|
defaultParseWidth: "any",
|
|
321
321
|
valueCallback: (e) => e + 1
|
|
322
322
|
}),
|
|
323
|
-
month:
|
|
323
|
+
month: p({
|
|
324
324
|
matchPatterns: {
|
|
325
325
|
narrow: /^[jfmasond]/i,
|
|
326
326
|
abbreviated: /^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,
|
|
@@ -359,7 +359,7 @@ var A = {
|
|
|
359
359
|
},
|
|
360
360
|
defaultParseWidth: "any"
|
|
361
361
|
}),
|
|
362
|
-
day:
|
|
362
|
+
day: p({
|
|
363
363
|
matchPatterns: {
|
|
364
364
|
narrow: /^[lmjvsd]/i,
|
|
365
365
|
short: /^(di|lu|ma|me|je|ve|sa)/i,
|
|
@@ -389,7 +389,7 @@ var A = {
|
|
|
389
389
|
},
|
|
390
390
|
defaultParseWidth: "any"
|
|
391
391
|
}),
|
|
392
|
-
dayPeriod:
|
|
392
|
+
dayPeriod: p({
|
|
393
393
|
matchPatterns: {
|
|
394
394
|
narrow: /^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,
|
|
395
395
|
any: /^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i
|
|
@@ -415,11 +415,11 @@ var A = {
|
|
|
415
415
|
}
|
|
416
416
|
};
|
|
417
417
|
function V() {
|
|
418
|
-
let e = u()?.language ?? "en", t = b(() => B[e] ??
|
|
418
|
+
let e = u()?.language ?? "en", t = b(() => B[e] ?? h, [e]);
|
|
419
419
|
return {
|
|
420
420
|
language: e,
|
|
421
421
|
locale: t,
|
|
422
|
-
format: v((e, n) =>
|
|
422
|
+
format: v((e, n) => g.format(e, n, t), [t])
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
425
|
//#endregion
|
|
@@ -1,125 +1,126 @@
|
|
|
1
1
|
import { o as e, r as t } from "./dist-DVRQkaTK.js";
|
|
2
|
-
import {
|
|
3
|
-
import { C as
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
2
|
+
import { i as n, n as r, r as i, t as a } from "./dist-DWZXlCZR.js";
|
|
3
|
+
import { C as o, S as s, x as c } from "./spinner-C1QIewWv.js";
|
|
4
|
+
import { a as l, i as u, r as d } from "./dist-DHdUUM1w.js";
|
|
5
|
+
import { c as f, i as p, l as m, o as h, r as g, s as ee } from "./in-dialog-D61Yeaol.js";
|
|
6
|
+
import { r as te } from "./escape-owner-DpaP0lm1.js";
|
|
7
|
+
import * as _ from "react";
|
|
8
|
+
import { useCallback as v, useContext as y, useRef as b } from "react";
|
|
9
|
+
import { Fragment as ne, jsx as x } from "react/jsx-runtime";
|
|
10
|
+
import { forwardEscape as S, keepListEscape as C } from "@nxgt/material-core/escape-forward";
|
|
10
11
|
//#region ../../node_modules/@radix-ui/react-dialog/dist/index.mjs
|
|
11
|
-
var
|
|
12
|
+
var w = Object.defineProperty, T = (e, t) => w(e, "name", {
|
|
12
13
|
value: t,
|
|
13
14
|
configurable: !0
|
|
14
|
-
}),
|
|
15
|
-
let { __scopeDialog: t, children:
|
|
16
|
-
prop:
|
|
17
|
-
defaultProp:
|
|
15
|
+
}), E = "Dialog", [D, O] = l(E), [re, k] = D(E), A = /* @__PURE__ */ T((e) => {
|
|
16
|
+
let { __scopeDialog: t, children: n, open: r, defaultOpen: i, onOpenChange: o, modal: s = !0 } = e, c = _.useRef(null), l = _.useRef(null), [u, f] = a({
|
|
17
|
+
prop: r,
|
|
18
|
+
defaultProp: i ?? !1,
|
|
18
19
|
onChange: o,
|
|
19
|
-
caller:
|
|
20
|
-
}), [p, m] =
|
|
21
|
-
return /* @__PURE__ */
|
|
20
|
+
caller: E
|
|
21
|
+
}), [p, m] = _.useState(0), [h, g] = _.useState(0);
|
|
22
|
+
return /* @__PURE__ */ x(re, {
|
|
22
23
|
scope: t,
|
|
23
|
-
triggerRef:
|
|
24
|
-
contentRef:
|
|
25
|
-
contentId:
|
|
26
|
-
titleId:
|
|
27
|
-
descriptionId:
|
|
24
|
+
triggerRef: c,
|
|
25
|
+
contentRef: l,
|
|
26
|
+
contentId: d(),
|
|
27
|
+
titleId: d(),
|
|
28
|
+
descriptionId: d(),
|
|
28
29
|
titlePresent: p > 0,
|
|
29
30
|
descriptionPresent: h > 0,
|
|
30
31
|
setTitleCount: m,
|
|
31
32
|
setDescriptionCount: g,
|
|
32
|
-
open:
|
|
33
|
+
open: u,
|
|
33
34
|
onOpenChange: f,
|
|
34
|
-
onOpenToggle:
|
|
35
|
-
modal:
|
|
36
|
-
children:
|
|
35
|
+
onOpenToggle: _.useCallback(() => f((e) => !e), [f]),
|
|
36
|
+
modal: s,
|
|
37
|
+
children: n
|
|
37
38
|
});
|
|
38
|
-
}, "Dialog"), j = "DialogTrigger", M = /* @__PURE__ */
|
|
39
|
-
let { __scopeDialog:
|
|
40
|
-
return /* @__PURE__ */
|
|
39
|
+
}, "Dialog"), j = "DialogTrigger", M = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(t, r) {
|
|
40
|
+
let { __scopeDialog: a, ...o } = t, s = k(j, a), c = e(r, s.triggerRef);
|
|
41
|
+
return /* @__PURE__ */ x(n.button, {
|
|
41
42
|
type: "button",
|
|
42
43
|
"aria-haspopup": "dialog",
|
|
43
|
-
"aria-expanded":
|
|
44
|
-
"aria-controls":
|
|
45
|
-
"data-state": Z(
|
|
46
|
-
...
|
|
47
|
-
ref:
|
|
48
|
-
onClick:
|
|
44
|
+
"aria-expanded": s.open,
|
|
45
|
+
"aria-controls": s.open ? s.contentId : void 0,
|
|
46
|
+
"data-state": Z(s.open),
|
|
47
|
+
...o,
|
|
48
|
+
ref: c,
|
|
49
|
+
onClick: i(t.onClick, s.onOpenToggle)
|
|
49
50
|
});
|
|
50
|
-
}, "DialogTrigger")), N = "DialogPortal", [P, F] =
|
|
51
|
-
let { __scopeDialog: t, forceMount: n, children: r, container:
|
|
52
|
-
return /* @__PURE__ */
|
|
51
|
+
}, "DialogTrigger")), N = "DialogPortal", [P, F] = D(N, { forceMount: void 0 }), I = /* @__PURE__ */ T((e) => {
|
|
52
|
+
let { __scopeDialog: t, forceMount: n, children: r, container: i } = e, a = k(N, t);
|
|
53
|
+
return /* @__PURE__ */ x(P, {
|
|
53
54
|
scope: t,
|
|
54
55
|
forceMount: n,
|
|
55
|
-
children:
|
|
56
|
-
present: n ||
|
|
57
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: _.Children.map(r, (e) => /* @__PURE__ */ x(u, {
|
|
57
|
+
present: n || a.open,
|
|
58
|
+
children: /* @__PURE__ */ x(c, {
|
|
58
59
|
asChild: !0,
|
|
59
|
-
container:
|
|
60
|
+
container: i,
|
|
60
61
|
children: e
|
|
61
62
|
})
|
|
62
63
|
}))
|
|
63
64
|
});
|
|
64
|
-
}, "DialogPortal"), L = "DialogOverlay", R = /* @__PURE__ */
|
|
65
|
-
let n = F(L, e.__scopeDialog), { forceMount: r = n.forceMount, ...
|
|
66
|
-
return
|
|
67
|
-
present: r ||
|
|
68
|
-
children: /* @__PURE__ */
|
|
69
|
-
...
|
|
65
|
+
}, "DialogPortal"), L = "DialogOverlay", R = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(e, t) {
|
|
66
|
+
let n = F(L, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = k(L, e.__scopeDialog);
|
|
67
|
+
return a.modal ? /* @__PURE__ */ x(u, {
|
|
68
|
+
present: r || a.open,
|
|
69
|
+
children: /* @__PURE__ */ x(B, {
|
|
70
|
+
...i,
|
|
70
71
|
ref: t
|
|
71
72
|
})
|
|
72
73
|
}) : null;
|
|
73
|
-
}, "DialogOverlay")), z = t("DialogOverlay.RemoveScroll"), B = /* @__PURE__ */
|
|
74
|
-
let { __scopeDialog:
|
|
75
|
-
return /* @__PURE__ */
|
|
74
|
+
}, "DialogOverlay")), z = t("DialogOverlay.RemoveScroll"), B = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(t, r) {
|
|
75
|
+
let { __scopeDialog: i, ...a } = t, s = k(L, i), c = e(r, o());
|
|
76
|
+
return /* @__PURE__ */ x(ee, {
|
|
76
77
|
as: z,
|
|
77
78
|
allowPinchZoom: !0,
|
|
78
|
-
shards: [
|
|
79
|
-
children: /* @__PURE__ */
|
|
80
|
-
"data-state": Z(
|
|
81
|
-
...
|
|
82
|
-
ref:
|
|
79
|
+
shards: [s.contentRef],
|
|
80
|
+
children: /* @__PURE__ */ x(n.div, {
|
|
81
|
+
"data-state": Z(s.open),
|
|
82
|
+
...a,
|
|
83
|
+
ref: c,
|
|
83
84
|
style: {
|
|
84
85
|
pointerEvents: "auto",
|
|
85
|
-
...
|
|
86
|
+
...a.style
|
|
86
87
|
}
|
|
87
88
|
})
|
|
88
89
|
});
|
|
89
|
-
}, "DialogOverlayImpl")), V = "DialogContent", H = /* @__PURE__ */
|
|
90
|
-
let n = F(V, e.__scopeDialog), { forceMount: r = n.forceMount, ...
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
-
present: r ||
|
|
93
|
-
children:
|
|
94
|
-
...
|
|
90
|
+
}, "DialogOverlayImpl")), V = "DialogContent", H = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(e, t) {
|
|
91
|
+
let n = F(V, e.__scopeDialog), { forceMount: r = n.forceMount, ...i } = e, a = k(V, e.__scopeDialog);
|
|
92
|
+
return /* @__PURE__ */ x(u, {
|
|
93
|
+
present: r || a.open,
|
|
94
|
+
children: a.modal ? /* @__PURE__ */ x(U, {
|
|
95
|
+
...i,
|
|
95
96
|
ref: t
|
|
96
|
-
}) : /* @__PURE__ */
|
|
97
|
-
...
|
|
97
|
+
}) : /* @__PURE__ */ x(W, {
|
|
98
|
+
...i,
|
|
98
99
|
ref: t
|
|
99
100
|
})
|
|
100
101
|
});
|
|
101
|
-
}, "DialogContent")), U = /* @__PURE__ */
|
|
102
|
-
let r = k(V, t.__scopeDialog),
|
|
103
|
-
return
|
|
104
|
-
let e =
|
|
102
|
+
}, "DialogContent")), U = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(t, n) {
|
|
103
|
+
let r = k(V, t.__scopeDialog), a = _.useRef(null), o = e(n, r.contentRef, a);
|
|
104
|
+
return _.useEffect(() => {
|
|
105
|
+
let e = a.current;
|
|
105
106
|
if (e) return h(e);
|
|
106
|
-
}, []), /* @__PURE__ */
|
|
107
|
+
}, []), /* @__PURE__ */ x(G, {
|
|
107
108
|
...t,
|
|
108
|
-
ref:
|
|
109
|
+
ref: o,
|
|
109
110
|
trapFocus: r.open,
|
|
110
111
|
disableOutsidePointerEvents: r.open,
|
|
111
|
-
onCloseAutoFocus:
|
|
112
|
+
onCloseAutoFocus: i(t.onCloseAutoFocus, (e) => {
|
|
112
113
|
e.preventDefault(), r.triggerRef.current?.focus();
|
|
113
114
|
}),
|
|
114
|
-
onPointerDownOutside:
|
|
115
|
+
onPointerDownOutside: i(t.onPointerDownOutside, (e) => {
|
|
115
116
|
let t = e.detail.originalEvent, n = t.button === 0 && t.ctrlKey === !0;
|
|
116
117
|
(t.button === 2 || n) && e.preventDefault();
|
|
117
118
|
}),
|
|
118
|
-
onFocusOutside:
|
|
119
|
+
onFocusOutside: i(t.onFocusOutside, (e) => e.preventDefault())
|
|
119
120
|
});
|
|
120
|
-
}, "DialogContentModal")), W = /* @__PURE__ */
|
|
121
|
-
let n = k(V, e.__scopeDialog), r =
|
|
122
|
-
return /* @__PURE__ */
|
|
121
|
+
}, "DialogContentModal")), W = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(e, t) {
|
|
122
|
+
let n = k(V, e.__scopeDialog), r = _.useRef(!1), i = _.useRef(!1);
|
|
123
|
+
return /* @__PURE__ */ x(G, {
|
|
123
124
|
...e,
|
|
124
125
|
ref: t,
|
|
125
126
|
trapFocus: !1,
|
|
@@ -133,53 +134,53 @@ var T = Object.defineProperty, E = (e, t) => T(e, "name", {
|
|
|
133
134
|
n.triggerRef.current?.contains(a) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && i.current && t.preventDefault();
|
|
134
135
|
}
|
|
135
136
|
});
|
|
136
|
-
}, "DialogContentNonModal")), G = /* @__PURE__ */
|
|
137
|
-
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, ...o } = e,
|
|
138
|
-
return f(), /* @__PURE__ */
|
|
137
|
+
}, "DialogContentNonModal")), G = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(e, t) {
|
|
138
|
+
let { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: i, onCloseAutoFocus: a, ...o } = e, c = k(V, n);
|
|
139
|
+
return f(), /* @__PURE__ */ x(ne, { children: /* @__PURE__ */ x(m, {
|
|
139
140
|
asChild: !0,
|
|
140
141
|
loop: !0,
|
|
141
142
|
trapped: r,
|
|
142
143
|
onMountAutoFocus: i,
|
|
143
144
|
onUnmountAutoFocus: a,
|
|
144
|
-
children: /* @__PURE__ */
|
|
145
|
+
children: /* @__PURE__ */ x(s, {
|
|
145
146
|
role: "dialog",
|
|
146
|
-
id:
|
|
147
|
-
"aria-describedby":
|
|
148
|
-
"aria-labelledby":
|
|
149
|
-
"data-state": Z(
|
|
147
|
+
id: c.contentId,
|
|
148
|
+
"aria-describedby": c.descriptionPresent ? c.descriptionId : void 0,
|
|
149
|
+
"aria-labelledby": c.titlePresent ? c.titleId : void 0,
|
|
150
|
+
"data-state": Z(c.open),
|
|
150
151
|
...o,
|
|
151
152
|
ref: t,
|
|
152
153
|
deferPointerDownOutside: !0,
|
|
153
|
-
onDismiss: () =>
|
|
154
|
+
onDismiss: () => c.onOpenChange(!1)
|
|
154
155
|
})
|
|
155
156
|
}) });
|
|
156
|
-
}, "DialogContentImpl")), K = "DialogTitle", q = /* @__PURE__ */
|
|
157
|
-
let { __scopeDialog:
|
|
158
|
-
return
|
|
159
|
-
id:
|
|
160
|
-
...
|
|
157
|
+
}, "DialogContentImpl")), K = "DialogTitle", q = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(e, t) {
|
|
158
|
+
let { __scopeDialog: i, ...a } = e, o = k(K, i), { setTitleCount: s } = o;
|
|
159
|
+
return r(() => (s((e) => e + 1), () => s((e) => e - 1)), [s]), /* @__PURE__ */ x(n.h2, {
|
|
160
|
+
id: o.titleId,
|
|
161
|
+
...a,
|
|
161
162
|
ref: t
|
|
162
163
|
});
|
|
163
|
-
}, "DialogTitle")), J = "DialogDescription", Y = /* @__PURE__ */
|
|
164
|
-
let { __scopeDialog:
|
|
165
|
-
return
|
|
166
|
-
id:
|
|
167
|
-
...
|
|
164
|
+
}, "DialogTitle")), J = "DialogDescription", Y = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(e, t) {
|
|
165
|
+
let { __scopeDialog: i, ...a } = e, o = k(J, i), { setDescriptionCount: s } = o;
|
|
166
|
+
return r(() => (s((e) => e + 1), () => s((e) => e - 1)), [s]), /* @__PURE__ */ x(n.p, {
|
|
167
|
+
id: o.descriptionId,
|
|
168
|
+
...a,
|
|
168
169
|
ref: t
|
|
169
170
|
});
|
|
170
|
-
}, "DialogDescription")), X = "DialogClose", ie = /* @__PURE__ */
|
|
171
|
-
let { __scopeDialog:
|
|
172
|
-
return /* @__PURE__ */
|
|
171
|
+
}, "DialogDescription")), X = "DialogClose", ie = /* @__PURE__ */ _.forwardRef(/* @__PURE__ */ T(function(e, t) {
|
|
172
|
+
let { __scopeDialog: r, ...a } = e, o = k(X, r);
|
|
173
|
+
return /* @__PURE__ */ x(n.button, {
|
|
173
174
|
type: "button",
|
|
174
|
-
...
|
|
175
|
+
...a,
|
|
175
176
|
ref: t,
|
|
176
|
-
onClick:
|
|
177
|
+
onClick: i(e.onClick, () => o.onOpenChange(!1))
|
|
177
178
|
});
|
|
178
179
|
}, "DialogClose"));
|
|
179
180
|
function Z(e) {
|
|
180
181
|
return e ? "open" : "closed";
|
|
181
182
|
}
|
|
182
|
-
|
|
183
|
+
T(Z, "getState");
|
|
183
184
|
//#endregion
|
|
184
185
|
//#region lib/components/ui/overlays/dialog/use-escape-forward.ts
|
|
185
186
|
function ae(t, n) {
|
|
@@ -187,7 +188,7 @@ function ae(t, n) {
|
|
|
187
188
|
return {
|
|
188
189
|
ref: e(r, n),
|
|
189
190
|
onEscapeKeyDown(e) {
|
|
190
|
-
|
|
191
|
+
C(e), te(e, r.current), t?.(e), S(r.current, e);
|
|
191
192
|
}
|
|
192
193
|
};
|
|
193
194
|
}
|
|
@@ -196,7 +197,7 @@ function ae(t, n) {
|
|
|
196
197
|
function oe(t) {
|
|
197
198
|
let n = b(null);
|
|
198
199
|
return {
|
|
199
|
-
overlayRef:
|
|
200
|
+
overlayRef: v((e) => {
|
|
200
201
|
let t = n.current;
|
|
201
202
|
!e || !t?.isConnected || t.parentNode === e.parentNode && t.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING && t.before(e);
|
|
202
203
|
}, []),
|
|
@@ -206,7 +207,7 @@ function oe(t) {
|
|
|
206
207
|
//#endregion
|
|
207
208
|
//#region lib/components/ui/overlays/dialog/use-modal-content.ts
|
|
208
209
|
function se({ ref: e, onEscapeKeyDown: t, ...n }, r) {
|
|
209
|
-
let i =
|
|
210
|
+
let i = y(g) ?? !0, a = ae(t, p(r ?? i, e)), o = oe(a.ref);
|
|
210
211
|
return {
|
|
211
212
|
ref: o.contentRef,
|
|
212
213
|
overlayRef: o.overlayRef,
|
|
@@ -266,4 +267,4 @@ function fe(e, { focusFallback: t = !1 } = {}) {
|
|
|
266
267
|
};
|
|
267
268
|
}
|
|
268
269
|
//#endregion
|
|
269
|
-
export { H as a, I as c,
|
|
270
|
+
export { H as a, I as c, O as d, ie as i, q as l, se as n, Y as o, A as r, R as s, fe as t, M as u };
|
package/docs/README.md
CHANGED
|
@@ -10,6 +10,7 @@ detail: every option, the second example, and the traps.
|
|
|
10
10
|
| [Forms](guides/forms.md) | You are building a form: the field / `*FormField` pair, React Hook Form + Zod, what each field emits, server errors, multi-step forms |
|
|
11
11
|
| [Themes for your app](guides/themes.md) | You define your own themes: `defineTheme` modules, the Vite plugin's `themes` option, the `nxgt-theme` command and its CI check, the tone warnings |
|
|
12
12
|
| [Barcodes and label sheets](guides/barcode.md) | You draw a Code 128 or Data Matrix code and print a sheet of labels with `@nxgt/material/barcode`: `Barcode`, `LabelSheet` and `Label`, label size, columns, rows, gaps and a start offset, dark mode, print and accessibility |
|
|
13
|
+
| [Calculator](guides/calculator.md) | You add an exact-decimal calculator with `@nxgt/material/calculator` (and `CalculatorField` with `@nxgt/material/calculator-field`): `Calculator`, the keyboard, the tape and memory, copy and paste, what is stored, feedback, sizing and accessibility |
|
|
13
14
|
| [Charts](guides/charts.md) | You draw charts with `@nxgt/material/charts`: each chart, the shared props, reference bands, thresholds and point tones, zoom and phone scroll, the keyboard, accessibility, theming the `--chart-1..5` tokens, and moving off the Nivo charts, removed in 3.0 |
|
|
14
15
|
| [Cards and tiles](guides/cards-and-tiles.md) | You want a `DataTable` as a list of cards or tiles: `layout`, `renderCard`, `renderTile`, the card's one link, selection, the sort control, columns by the list's width |
|
|
15
16
|
| [DataGrid](guides/data-grid.md) | You are building an editable grid: columns and editors, save modes and conflicts, resizing, hiding and reordering columns, paste, fill and series, undo, totals, long lists, phones, custom editors, CSP |
|
|
@@ -580,8 +580,17 @@ import { Illustration } from '@nxgt/material/illustrations';
|
|
|
580
580
|
| `tone` | `Tone` | `neutral` | the colour of the meaning: a named tone or one of your `AppTones` |
|
|
581
581
|
| `closeLabel` | `string` | translated | name of the close button |
|
|
582
582
|
| `className` | `string` | — | on the full-screen surface |
|
|
583
|
+
| `modal` | `boolean` | `true` | `false`: a non-modal announcement, see below |
|
|
583
584
|
|
|
584
|
-
|
|
585
|
+
On the modal variant a tap anywhere dismisses, so keep text a reader must act on out of a short `duration`. Without a `description` the modal dialog is described by the hint `material.moment.hint` ("Press Escape or tap to dismiss."), read by assistive technology only. The close button is named by `material.buttons.close`.
|
|
586
|
+
|
|
587
|
+
### Non-modal: an event the user did not trigger
|
|
588
|
+
|
|
589
|
+
A realtime update that shows a `Moment` while the user types or is about to press a button must not take their focus or swallow their next tap. With `modal={false}` it is not a dialog: focus stays where it is (no move, no trap, no return), the page behind stays interactive, and the backdrop lets pointer events through (only the text and the close button take them). The text is announced politely through a `role="status"` live region (`aria-live="polite"`) holding the picture, title and description (the action and close button sit beside it), and it does not interrupt a screen reader. Visuals, `duration` and the reduced-motion behaviour are the same. Escape dismisses it through a document listener that never moves focus (and stands down when the page already handled the key); the close button, a tap on the text and `duration` dismiss it too. Give a non-modal Moment a `duration`: nothing takes the user to it, so it should not stay.
|
|
590
|
+
|
|
591
|
+
```tsx
|
|
592
|
+
<Moment modal={false} open={open} onOpenChange={setOpen} duration={5000} title="Mira was eliminated" />
|
|
593
|
+
```
|
|
585
594
|
|
|
586
595
|
**Storybook:** `Feedback & status/Moment` · **Vue:** not yet (#2248)
|
|
587
596
|
|
|
@@ -734,6 +734,7 @@ export function Amount() {
|
|
|
734
734
|
| `value` / `defaultValue` | `number \| null` | `null` | the amount |
|
|
735
735
|
| `onChange` | `(value: number \| null) => void` | — | called while typing and on blur |
|
|
736
736
|
| `currency` | `string` | `'EUR'` | the suffix text; formatting follows the `I18nProvider` language |
|
|
737
|
+
| `trailingAction` | `ReactNode` | — | a button after the currency code, inside the field (`CalculatorField`'s "Open calculator" uses it); it keeps its own name and focus, and the input leaves room for it |
|
|
737
738
|
| `fractionDigits` | `number` | the currency's own | decimals shown once the amount is committed (on blur): ISO 4217 by default — `JPY` 0, `EUR` 2, `KWD` 3 (2 for a code `Intl` does not know). Pass `2` to keep two decimals whatever the currency; the value is clamped to 0–20 (the range every `Intl` accepts), and `NaN` or `Infinity` counts as not given. What is typed is not rounded, on screen until blur nor in the emitted number: a `JPY` field shows `1,235` for `1234.5` and emits `1234.5` |
|
|
738
739
|
|
|
739
740
|
**Emits:** `number | null` — never the formatted string.
|
|
@@ -12,6 +12,7 @@ the app owns the data.
|
|
|
12
12
|
| <img src="../previews/rich-widgets-native-charts-linechart.webp" width="96" alt=""> | [Charts](#charts) | Native SVG charts (line, area, bar, pie, donut, gauge, radial, funnel, heat map, radar, scatter, combo) with keyboard, summary and View data; the Nivo ones were removed in 3.0 |
|
|
13
13
|
| <img src="../previews/rich-widgets-drawing.webp" width="96" alt=""> | [Drawing](#drawing) | Vector drawing from a scene of plain data or JSX primitives: theme colours, accessible, focusable nodes, strict-CSP safe |
|
|
14
14
|
| <img src="../previews/rich-widgets-barcode.webp" width="96" alt=""> | [Barcode](#barcode) | Code 128 and Data Matrix as accessible SVG, themed and dark-aware, black on white in print, with `LabelSheet` for a printed sheet of labels |
|
|
15
|
+
| <img src="../previews/rich-widgets-calculator.webp" width="96" alt=""> | [Calculator](#calculator) | Exact decimal calculator (Standard, Scientific, a point of sale, Financial, Conversion and Programmer) with the usual precedence, a shaped keypad, tape, memory, keyboard, copy and paste, and a number field whose button opens it (`CalculatorField`, in `@nxgt/material/calculator-field`), in its own entry; variants other than Standard load on demand |
|
|
15
16
|
| <img src="../previews/rich-widgets-emojipicker.webp" width="96" alt=""> | [EmojiPicker](#emojipicker) | Shared emoji picker and list |
|
|
16
17
|
| <img src="../previews/rich-widgets-mentionlist.webp" width="96" alt=""> | [MentionList](#mentionlist) | `@` mention list with local search |
|
|
17
18
|
| <img src="../previews/rich-widgets-documenteditor.webp" width="96" alt=""> | [DocumentEditor](#documenteditor) | Rich text editor for long-form writing, built on a headless core |
|
|
@@ -684,6 +685,113 @@ first); lengths are millimetres or a string with a unit. A value a symbology can
|
|
|
684
685
|
[barcode guide](../guides/barcode.md) for printing a sheet and for the limits
|
|
685
686
|
of each symbology.
|
|
686
687
|
|
|
688
|
+
## Calculator
|
|
689
|
+
|
|
690
|
+

|
|
691
|
+
|
|
692
|
+
An exact-decimal calculator from `@nxgt/material/calculator`: `0.1 + 0.2` is
|
|
693
|
+
`0.3`, `2 + 3 × 4` is `14`, and the whole expression stays above the result. A
|
|
694
|
+
large display previews the value while you type; the keypad is native buttons
|
|
695
|
+
in one `role="group"` (one tab stop, arrow keys over the grid); `=` is a
|
|
696
|
+
primary pill. A tape keeps every result to replay or reuse, `MC MR M+ M−` keep
|
|
697
|
+
a memory, the physical keyboard works, and copy and paste take the locale's
|
|
698
|
+
separators. A live region announces each result. The maths is
|
|
699
|
+
`@nxgt/material-core/calculator`, with no `eval`, so a strict CSP is
|
|
700
|
+
satisfied. Only Standard is in the entry: the other variants load on demand the first time they are shown, behind a skeleton of the same size with a polite status (the server renders that loading body, then the client fetches the variant). Its own entry, server-safe, with an opt-in stylesheet: import
|
|
701
|
+
`@nxgt/material/calculator.css` once, after `styles.css` (`styles.css` does not
|
|
702
|
+
carry it).
|
|
703
|
+
|
|
704
|
+
```tsx
|
|
705
|
+
import { Calculator } from '@nxgt/material/calculator';
|
|
706
|
+
|
|
707
|
+
<Calculator />
|
|
708
|
+
<Calculator locale="fr" persist={{ key: 'till-1' }} globalKeyboard onResult={(value) => save(value)} />
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
`persist` (default `true`) keeps the tape and memory in `localStorage` after
|
|
712
|
+
mount, `feedback={{ haptics, sound }}` is off by default, and the layout follows
|
|
713
|
+
the calculator's own width (compact under 360px, the tape beside the keypad
|
|
714
|
+
from 720px). `variants` and `variant` choose among the available variants
|
|
715
|
+
(Standard, Scientific, the point of sale, Financial, Conversion and Programmer now; the switcher shows them all
|
|
716
|
+
unless `variants={['standard']}`). Scientific adds `sin cos tan` and their hyperbolic
|
|
717
|
+
forms (2nd for the inverses), logarithms, powers and roots, `n!`, `π`, `e`,
|
|
718
|
+
`EE` and `mod`, with a toolbar for the angle unit (degrees, radians, gradians)
|
|
719
|
+
and the result notation (auto, scientific, engineering), exact to 34 digits:
|
|
720
|
+
`sin(30)` is `0.5`.
|
|
721
|
+
|
|
722
|
+
```tsx
|
|
723
|
+
<Calculator defaultVariant="scientific" />
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
### Point of sale
|
|
727
|
+
|
|
728
|
+
A point of sale till: type an amount like a till (`1`, `2`, `5` is `1.25`), `×` a
|
|
729
|
+
quantity, `%` a discount, `+` to add the line, a ticket whose lines go one by
|
|
730
|
+
one, VAT by rate from your `vatRates` (prices with or without it), the bills
|
|
731
|
+
to hand over from your `denominations`, the change due and a Charge button.
|
|
732
|
+
Exact to the currency's minor unit, and the ticket is never stored.
|
|
733
|
+
|
|
734
|
+
```tsx
|
|
735
|
+
<Calculator
|
|
736
|
+
defaultVariant="pos"
|
|
737
|
+
currency="EUR"
|
|
738
|
+
vatRates={[20, 5.5]}
|
|
739
|
+
denominations={[5, 10, 20, 50]}
|
|
740
|
+
onCharge={(total, ticket) => pay(total, ticket)}
|
|
741
|
+
/>
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
### Financial
|
|
745
|
+
|
|
746
|
+
Financial is a panel of forms on the library's own fields, in four sub-tabs:
|
|
747
|
+
VAT (add it, or take it out of a price), margin and markup (the rates of a
|
|
748
|
+
cost and a price, or the price or cost a rate gives), percent change, and a
|
|
749
|
+
loan (payment, totals and a captioned amortisation `<table>`). The amounts are
|
|
750
|
+
exact decimals rounded to the minor unit of `currency`, written in `locale`,
|
|
751
|
+
and a result is announced once the fields settle. `currency` is the shared
|
|
752
|
+
prop (the point of sale reads it too): with none, amounts have two decimals
|
|
753
|
+
and no code.
|
|
754
|
+
|
|
755
|
+
```tsx
|
|
756
|
+
<Calculator defaultVariant="financial" currency="EUR" />
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
### Conversion
|
|
760
|
+
|
|
761
|
+

|
|
762
|
+
|
|
763
|
+
A unit converter: a category (length, mass, temperature, volume, area, speed,
|
|
764
|
+
time, data), a value, the unit it is in and the unit wanted, a swap button and
|
|
765
|
+
the exact result in the locale (`1 in` is `2.54 cm`; `32 °F` is `0 °C`). Add
|
|
766
|
+
`currencyRates` for a Currency category, as an object or a function that fetches
|
|
767
|
+
the rates.
|
|
768
|
+
|
|
769
|
+
```tsx
|
|
770
|
+
<Calculator
|
|
771
|
+
defaultVariant="conversion"
|
|
772
|
+
currencyRates={{ base: 'EUR', rates: { USD: '1.085', JPY: '160.5' }, asOf: '2026-10-28' }}
|
|
773
|
+
/>
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
### CalculatorField
|
|
777
|
+
|
|
778
|
+
Its own entry, `@nxgt/material/calculator-field`: a number field (a currency field with `currency`) whose button opens the
|
|
779
|
+
calculator, seeded with the field's number: a popover from 768px, a bottom
|
|
780
|
+
sheet below. Apply writes the rounded result, Cancel and Escape keep the
|
|
781
|
+
number. `CalculatorFormField` is the React Hook Form wrapper. It needs the
|
|
782
|
+
calculator's stylesheet, `@nxgt/material/calculator.css`. The calculator it opens loads a variant other than Standard on demand, so the first time one is chosen it shows the loading skeleton for a moment.
|
|
783
|
+
|
|
784
|
+
With `currency` the field is a `CurrencyField`, which takes no `suffix`, `step` or `hideSteppers`, and `min` / `max` do not limit what is typed (Apply still holds a currency amount to them): those props apply only without `currency`.
|
|
785
|
+
|
|
786
|
+
```tsx
|
|
787
|
+
import { CalculatorField, CalculatorFormField } from '@nxgt/material/calculator-field';
|
|
788
|
+
|
|
789
|
+
<CalculatorField label="Price" currency="EUR" value={price} onChange={setPrice} />
|
|
790
|
+
<CalculatorFormField control={form.control} name="total" label="Total" />
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
See the [calculator guide](../guides/calculator.md).
|
|
794
|
+
|
|
687
795
|
## EmojiPicker
|
|
688
796
|
|
|
689
797
|

|
package/docs/getting-started.md
CHANGED
|
@@ -154,6 +154,7 @@ and need nothing.
|
|
|
154
154
|
| `@nxgt/material/models` | `Status<T>` |
|
|
155
155
|
| `@nxgt/material/types` | Shared function types (`PromiseOr`, `FunctionOr`, …) |
|
|
156
156
|
| `@nxgt/material/styles.css` | Source Tailwind v4 tokens. **This** is the stylesheet a Tailwind app imports |
|
|
157
|
+
| `@nxgt/material/calculator.css` | The calculator's stylesheet, for apps that use `/calculator` or `/calculator-field`. Not part of `styles.css` |
|
|
157
158
|
| `@nxgt/material/map.css` | Leaflet's stylesheet, for apps that use `/map`. Not part of `styles.css` |
|
|
158
159
|
| `@nxgt/material/backgrounds.css` | Every background preset's CSS, for apps that use `/backgrounds`; `@nxgt/material/backgrounds/<preset>.css` loads one. Not part of `styles.css` |
|
|
159
160
|
|