@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,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as n } from "./typography-
|
|
2
|
+
import { i as t } from "./dist-DWZXlCZR.js";
|
|
3
|
+
import { t as n } from "./typography-CYEquVeb.js";
|
|
4
4
|
import * as r from "react";
|
|
5
5
|
import { createContext as i, use as a, useMemo as o } from "react";
|
|
6
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
import { n as e, r as t, t as n, u as r } from "./tabs-DzEqMb1W.js";
|
|
2
|
+
import { t as i } from "./use-material-translation-CD6QoVal.js";
|
|
3
|
+
import { r as a, t as o } from "./currency-field-BJ9rSrif.js";
|
|
4
|
+
import { t as s } from "./percent-field-lahyDJDG.js";
|
|
5
|
+
import { n as c } from "./calculator-context-BugcKuVG.js";
|
|
6
|
+
import { t as l } from "./calculator-announce-DRd2c6Dq.js";
|
|
7
|
+
import { n as u, t as d } from "./calculator-panel-announce-AZSnZUSr.js";
|
|
8
|
+
import { t as f } from "./currency-B-r3ig11.js";
|
|
9
|
+
import { t as p } from "./calculator-segment-BlJE1LaS.js";
|
|
10
|
+
import { useId as m, useMemo as h, useState as g } from "react";
|
|
11
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
12
|
+
import { currencyFractionDigits as y } from "@nxgt/material-core/currency-digits";
|
|
13
|
+
import { CalcError as b, calcErrorMessage as x, compare as ee, dec as S, formatDecimal as C, sub as w } from "@nxgt/material-core/calculator";
|
|
14
|
+
import { amortisation as T, costFromMargin as E, costFromMarkup as D, loanPayment as O, marginPercent as k, markupPercent as A, percentChange as j, priceFromMargin as M, priceFromMarkup as te, vatFromGross as ne, vatFromNet as re } from "@nxgt/material-core/calculator/financial";
|
|
15
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-figures.ts
|
|
16
|
+
var N = "material.calculator.financial.figure", ie = {
|
|
17
|
+
net: `${N}.net`,
|
|
18
|
+
vat: `${N}.vat`,
|
|
19
|
+
gross: `${N}.gross`,
|
|
20
|
+
margin: `${N}.margin`,
|
|
21
|
+
markup: `${N}.markup`,
|
|
22
|
+
profit: `${N}.profit`,
|
|
23
|
+
price: `${N}.price`,
|
|
24
|
+
cost: `${N}.cost`,
|
|
25
|
+
change: `${N}.change`,
|
|
26
|
+
difference: `${N}.difference`,
|
|
27
|
+
payment: `${N}.payment`,
|
|
28
|
+
interest: `${N}.interest`,
|
|
29
|
+
total: `${N}.total`,
|
|
30
|
+
"last-payment": `${N}.last-payment`
|
|
31
|
+
}, P = (e, t, n, r, i) => ({
|
|
32
|
+
id: e,
|
|
33
|
+
label: {
|
|
34
|
+
key: ie[e],
|
|
35
|
+
fallback: t
|
|
36
|
+
},
|
|
37
|
+
value: n,
|
|
38
|
+
unit: r,
|
|
39
|
+
main: i
|
|
40
|
+
});
|
|
41
|
+
function F(e, t) {
|
|
42
|
+
if (e.some((e) => e === null || !Number.isFinite(e))) return null;
|
|
43
|
+
try {
|
|
44
|
+
return { figures: t(e.map(String)) };
|
|
45
|
+
} catch (e) {
|
|
46
|
+
if (e instanceof b) return { error: e.code };
|
|
47
|
+
throw e;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-math.ts
|
|
52
|
+
var I = (e, t, n, r) => F([t, n], ([t = "0", n = "0"]) => {
|
|
53
|
+
let i = e === "add" ? re(t, n, r) : ne(t, n, r);
|
|
54
|
+
return [
|
|
55
|
+
P("net", "Excluding VAT", i.net, "money", e === "remove"),
|
|
56
|
+
P("vat", "VAT", i.vat, "money"),
|
|
57
|
+
P("gross", "Including VAT", i.gross, "money", e === "add")
|
|
58
|
+
];
|
|
59
|
+
}), L = (e, t, n, r, i) => F([n, r], ([n = "0", r = "0"]) => {
|
|
60
|
+
if (e === "rates") {
|
|
61
|
+
let e = {
|
|
62
|
+
...i,
|
|
63
|
+
percentDigits: 2
|
|
64
|
+
};
|
|
65
|
+
return [
|
|
66
|
+
P("margin", "Margin", k(n, r, e), "percent", !0),
|
|
67
|
+
P("markup", "Markup", A(n, r, e), "percent"),
|
|
68
|
+
P("profit", "Profit", w(S(r), S(n)), "money")
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
let a = e === "price" ? t === "margin" ? M(n, r, i) : te(n, r, i) : t === "margin" ? E(n, r, i) : D(n, r, i), o = e === "price" ? a : S(n), s = e === "price" ? S(n) : a;
|
|
72
|
+
return [e === "price" ? P("price", "Selling price", a, "money", !0) : P("cost", "Cost", a, "money", !0), P("profit", "Profit", w(o, s), "money")];
|
|
73
|
+
}), R = (e, t) => F([e, t], ([e = "0", t = "0"]) => [P("change", "Change", j(e, t, { percentDigits: 2 }), "percent", !0), P("difference", "Difference", w(S(t), S(e)), "number")]), z = "\xA0", B = (e, t) => `${C(e, { locale: t })}${z}%`, V = (e, t) => e.unit === "percent" ? B(e.value, t.locale) : e.unit === "number" ? C(e.value, { locale: t.locale }) : f(e.value, {
|
|
74
|
+
locale: t.locale,
|
|
75
|
+
currency: t.currency,
|
|
76
|
+
digits: t.fractionDigits
|
|
77
|
+
});
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-parts.tsx
|
|
80
|
+
function H() {
|
|
81
|
+
let { currency: e, locale: t } = c();
|
|
82
|
+
return h(() => ({
|
|
83
|
+
locale: t,
|
|
84
|
+
currency: e,
|
|
85
|
+
fractionDigits: e ? y(e) : 2
|
|
86
|
+
}), [t, e]);
|
|
87
|
+
}
|
|
88
|
+
function U({ label: e, value: t, onChange: n }) {
|
|
89
|
+
let r = H();
|
|
90
|
+
return r.currency ? /* @__PURE__ */ _(o, {
|
|
91
|
+
label: e,
|
|
92
|
+
value: t,
|
|
93
|
+
onChange: n,
|
|
94
|
+
currency: r.currency,
|
|
95
|
+
fractionDigits: r.fractionDigits,
|
|
96
|
+
className: "nxgt-fin-field"
|
|
97
|
+
}) : /* @__PURE__ */ _(G, {
|
|
98
|
+
label: e,
|
|
99
|
+
value: t,
|
|
100
|
+
onChange: n,
|
|
101
|
+
min: 0
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function W({ max: e = 100, ...t }) {
|
|
105
|
+
return /* @__PURE__ */ _(s, {
|
|
106
|
+
label: t.label,
|
|
107
|
+
value: t.value,
|
|
108
|
+
onChange: t.onChange,
|
|
109
|
+
max: e,
|
|
110
|
+
step: .5,
|
|
111
|
+
hideSteppers: !0,
|
|
112
|
+
className: "nxgt-fin-field"
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function G({ min: e, max: t, ...n }) {
|
|
116
|
+
return /* @__PURE__ */ _(a, {
|
|
117
|
+
label: n.label,
|
|
118
|
+
value: n.value,
|
|
119
|
+
onChange: n.onChange,
|
|
120
|
+
min: e,
|
|
121
|
+
max: t,
|
|
122
|
+
hideSteppers: !0,
|
|
123
|
+
className: "nxgt-fin-field"
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function K({ outcome: e, active: t }) {
|
|
127
|
+
let { t: n } = i(), r = H(), a = e && "figures" in e ? e.figures.find((e) => e.main) : void 0, o = a && n(a.label.key, a.label.fallback), s = e && "error" in e ? {
|
|
128
|
+
key: l[e.error],
|
|
129
|
+
fallback: x({ code: e.error }).fallback
|
|
130
|
+
} : null;
|
|
131
|
+
return u(a && o ? n("material.calculator.financial.announce", "{label}: {value}", {
|
|
132
|
+
label: o,
|
|
133
|
+
value: V(a, r)
|
|
134
|
+
}) : s && n(s.key, s.fallback), t), /* @__PURE__ */ _("section", {
|
|
135
|
+
"aria-label": n("material.calculator.financial.results", "Results"),
|
|
136
|
+
"data-slot": "calculator-financial-results",
|
|
137
|
+
className: "nxgt-fin-results",
|
|
138
|
+
children: e === null ? /* @__PURE__ */ _("p", {
|
|
139
|
+
className: "nxgt-fin-hint",
|
|
140
|
+
children: n("material.calculator.financial.empty", "Enter the figures to see the result.")
|
|
141
|
+
}) : "error" in e && s ? /* @__PURE__ */ _("p", {
|
|
142
|
+
className: "nxgt-fin-error",
|
|
143
|
+
children: n(s.key, s.fallback)
|
|
144
|
+
}) : "figures" in e ? /* @__PURE__ */ _("dl", {
|
|
145
|
+
className: "nxgt-fin-figures",
|
|
146
|
+
dir: "ltr",
|
|
147
|
+
children: e.figures.map((e) => /* @__PURE__ */ v("div", {
|
|
148
|
+
"data-main": e.main ? "" : void 0,
|
|
149
|
+
children: [/* @__PURE__ */ _("dt", { children: n(e.label.key, e.label.fallback) }), /* @__PURE__ */ _("dd", {
|
|
150
|
+
"data-figure": e.id,
|
|
151
|
+
children: V(e, r)
|
|
152
|
+
})]
|
|
153
|
+
}, e.id))
|
|
154
|
+
}) : null
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
var q = (e, t) => ({
|
|
158
|
+
id: e,
|
|
159
|
+
glyph: t,
|
|
160
|
+
name: t
|
|
161
|
+
});
|
|
162
|
+
//#endregion
|
|
163
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-change.tsx
|
|
164
|
+
function J({ active: e }) {
|
|
165
|
+
let { t } = i(), [n, r] = g(null), [a, o] = g(null);
|
|
166
|
+
return /* @__PURE__ */ v("div", {
|
|
167
|
+
className: "nxgt-fin-panel",
|
|
168
|
+
children: [/* @__PURE__ */ v("div", {
|
|
169
|
+
className: "nxgt-fin-fields",
|
|
170
|
+
children: [/* @__PURE__ */ _(G, {
|
|
171
|
+
label: t("material.calculator.financial.change.from", "From"),
|
|
172
|
+
value: n,
|
|
173
|
+
onChange: r
|
|
174
|
+
}), /* @__PURE__ */ _(G, {
|
|
175
|
+
label: t("material.calculator.financial.change.to", "To"),
|
|
176
|
+
value: a,
|
|
177
|
+
onChange: o
|
|
178
|
+
})]
|
|
179
|
+
}), /* @__PURE__ */ _(K, {
|
|
180
|
+
active: e,
|
|
181
|
+
outcome: R(n, a)
|
|
182
|
+
})]
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
function ae(e, t, n, r) {
|
|
186
|
+
let i = {
|
|
187
|
+
outcome: null,
|
|
188
|
+
loan: null
|
|
189
|
+
};
|
|
190
|
+
if ([
|
|
191
|
+
e,
|
|
192
|
+
t,
|
|
193
|
+
n
|
|
194
|
+
].some((e) => e === null)) return i;
|
|
195
|
+
try {
|
|
196
|
+
let i = {
|
|
197
|
+
principal: String(e),
|
|
198
|
+
annualRate: String(t),
|
|
199
|
+
periods: Number(n)
|
|
200
|
+
}, a = T(i, {
|
|
201
|
+
...r,
|
|
202
|
+
limit: 12
|
|
203
|
+
}), o = ee(a.lastPayment, a.payment) !== 0;
|
|
204
|
+
return {
|
|
205
|
+
outcome: { figures: [
|
|
206
|
+
P("payment", "Payment", O(i, r), "money", !0),
|
|
207
|
+
P("interest", "Total interest", a.totalInterest, "money"),
|
|
208
|
+
P("total", "Total paid", a.totalPaid, "money"),
|
|
209
|
+
...o ? [P("last-payment", "Last payment", a.lastPayment, "money")] : []
|
|
210
|
+
] },
|
|
211
|
+
loan: {
|
|
212
|
+
rows: a.rows,
|
|
213
|
+
periods: a.periods,
|
|
214
|
+
truncated: a.truncated
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
} catch (e) {
|
|
218
|
+
if (e instanceof b) return {
|
|
219
|
+
outcome: { error: e.code },
|
|
220
|
+
loan: null
|
|
221
|
+
};
|
|
222
|
+
throw e;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-table.tsx
|
|
227
|
+
var Y = "material.calculator.financial.table";
|
|
228
|
+
function oe({ loan: e, format: t }) {
|
|
229
|
+
let { t: n } = i(), r = m(), a = (e) => C(e, {
|
|
230
|
+
locale: t.locale,
|
|
231
|
+
fractionDigits: t.fractionDigits
|
|
232
|
+
});
|
|
233
|
+
return /* @__PURE__ */ _("section", {
|
|
234
|
+
className: "nxgt-fin-table-wrap",
|
|
235
|
+
tabIndex: 0,
|
|
236
|
+
"aria-labelledby": r,
|
|
237
|
+
children: /* @__PURE__ */ v("table", {
|
|
238
|
+
className: "nxgt-fin-table",
|
|
239
|
+
dir: "ltr",
|
|
240
|
+
children: [
|
|
241
|
+
/* @__PURE__ */ _("caption", {
|
|
242
|
+
id: r,
|
|
243
|
+
children: e.truncated ? n(`${Y}.caption`, "First {shown} of {count} payments", {
|
|
244
|
+
shown: e.rows.length,
|
|
245
|
+
count: e.periods
|
|
246
|
+
}) : n(`${Y}.caption-all`, "All {count} payments", { count: e.periods })
|
|
247
|
+
}),
|
|
248
|
+
/* @__PURE__ */ _("thead", { children: /* @__PURE__ */ v("tr", { children: [
|
|
249
|
+
/* @__PURE__ */ _("th", {
|
|
250
|
+
scope: "col",
|
|
251
|
+
children: n(`${Y}.period`, "No.")
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ _("th", {
|
|
254
|
+
scope: "col",
|
|
255
|
+
children: n(`${Y}.payment`, "Payment")
|
|
256
|
+
}),
|
|
257
|
+
/* @__PURE__ */ _("th", {
|
|
258
|
+
scope: "col",
|
|
259
|
+
children: n(`${Y}.interest`, "Interest")
|
|
260
|
+
}),
|
|
261
|
+
/* @__PURE__ */ _("th", {
|
|
262
|
+
scope: "col",
|
|
263
|
+
children: n(`${Y}.principal`, "Principal")
|
|
264
|
+
}),
|
|
265
|
+
/* @__PURE__ */ _("th", {
|
|
266
|
+
scope: "col",
|
|
267
|
+
children: n(`${Y}.balance`, "Balance")
|
|
268
|
+
})
|
|
269
|
+
] }) }),
|
|
270
|
+
/* @__PURE__ */ _("tbody", { children: e.rows.map((e) => /* @__PURE__ */ v("tr", { children: [
|
|
271
|
+
/* @__PURE__ */ _("th", {
|
|
272
|
+
scope: "row",
|
|
273
|
+
children: e.period
|
|
274
|
+
}),
|
|
275
|
+
/* @__PURE__ */ _("td", { children: a(e.payment) }),
|
|
276
|
+
/* @__PURE__ */ _("td", { children: a(e.interest) }),
|
|
277
|
+
/* @__PURE__ */ _("td", { children: a(e.principal) }),
|
|
278
|
+
/* @__PURE__ */ _("td", { children: a(e.balance) })
|
|
279
|
+
] }, e.period)) })
|
|
280
|
+
]
|
|
281
|
+
})
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-loan.tsx
|
|
286
|
+
var X = "material.calculator.financial.loan";
|
|
287
|
+
function se({ active: e }) {
|
|
288
|
+
let { t } = i(), n = H(), [r, a] = g(null), [o, s] = g(null), [c, l] = g(null), { outcome: u, loan: d } = ae(r, o, c, n);
|
|
289
|
+
return /* @__PURE__ */ v("div", {
|
|
290
|
+
className: "nxgt-fin-panel",
|
|
291
|
+
children: [
|
|
292
|
+
/* @__PURE__ */ v("div", {
|
|
293
|
+
className: "nxgt-fin-fields",
|
|
294
|
+
children: [
|
|
295
|
+
/* @__PURE__ */ _(U, {
|
|
296
|
+
label: t(`${X}.principal`, "Amount borrowed"),
|
|
297
|
+
value: r,
|
|
298
|
+
onChange: a
|
|
299
|
+
}),
|
|
300
|
+
/* @__PURE__ */ _(W, {
|
|
301
|
+
label: t(`${X}.rate`, "Yearly rate"),
|
|
302
|
+
value: o,
|
|
303
|
+
onChange: s
|
|
304
|
+
}),
|
|
305
|
+
/* @__PURE__ */ _(G, {
|
|
306
|
+
label: t(`${X}.periods`, "Monthly payments"),
|
|
307
|
+
value: c,
|
|
308
|
+
onChange: l,
|
|
309
|
+
min: 1,
|
|
310
|
+
max: 1200
|
|
311
|
+
})
|
|
312
|
+
]
|
|
313
|
+
}),
|
|
314
|
+
/* @__PURE__ */ _(K, {
|
|
315
|
+
active: e,
|
|
316
|
+
outcome: u
|
|
317
|
+
}),
|
|
318
|
+
d ? /* @__PURE__ */ _(oe, {
|
|
319
|
+
loan: d,
|
|
320
|
+
format: n
|
|
321
|
+
}) : null
|
|
322
|
+
]
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-margin.tsx
|
|
327
|
+
var Z = "material.calculator.financial.margin";
|
|
328
|
+
function Q({ active: e }) {
|
|
329
|
+
let { t } = i(), { fractionDigits: n } = H(), [r, a] = g("rates"), [o, s] = g("margin"), [c, l] = g(null), [u, d] = g(null), f = r === "rates", m = t(`${Z}.cost-field`, "Cost"), h = t(`${Z}.price-field`, "Selling price"), y = r === "cost" ? h : m;
|
|
330
|
+
return /* @__PURE__ */ v("div", {
|
|
331
|
+
className: "nxgt-fin-panel",
|
|
332
|
+
children: [
|
|
333
|
+
/* @__PURE__ */ _(p, {
|
|
334
|
+
label: t(`${Z}.mode`, "Find"),
|
|
335
|
+
value: r,
|
|
336
|
+
onChange: a,
|
|
337
|
+
choices: [
|
|
338
|
+
q("rates", t(`${Z}.rates`, "Rates")),
|
|
339
|
+
q("price", t(`${Z}.price`, "Price")),
|
|
340
|
+
q("cost", t(`${Z}.cost`, "Cost"))
|
|
341
|
+
]
|
|
342
|
+
}),
|
|
343
|
+
f ? null : /* @__PURE__ */ _(p, {
|
|
344
|
+
label: t(`${Z}.basis`, "Based on"),
|
|
345
|
+
value: o,
|
|
346
|
+
onChange: s,
|
|
347
|
+
choices: [q("margin", t(`${Z}.margin`, "Margin")), q("markup", t(`${Z}.markup`, "Markup"))]
|
|
348
|
+
}),
|
|
349
|
+
/* @__PURE__ */ v("div", {
|
|
350
|
+
className: "nxgt-fin-fields",
|
|
351
|
+
children: [/* @__PURE__ */ _(U, {
|
|
352
|
+
label: y,
|
|
353
|
+
value: c,
|
|
354
|
+
onChange: l
|
|
355
|
+
}), f ? /* @__PURE__ */ _(U, {
|
|
356
|
+
label: h,
|
|
357
|
+
value: u,
|
|
358
|
+
onChange: d
|
|
359
|
+
}) : /* @__PURE__ */ _(W, {
|
|
360
|
+
label: t(o === "margin" ? `${Z}.margin` : `${Z}.markup`, o === "margin" ? "Margin" : "Markup"),
|
|
361
|
+
max: o === "margin" ? 99.99 : 1e5,
|
|
362
|
+
value: u,
|
|
363
|
+
onChange: d
|
|
364
|
+
})]
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ _(K, {
|
|
367
|
+
active: e,
|
|
368
|
+
outcome: L(r, o, c, u, { fractionDigits: n })
|
|
369
|
+
})
|
|
370
|
+
]
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-vat.tsx
|
|
375
|
+
function ce({ active: e }) {
|
|
376
|
+
let { t } = i(), { fractionDigits: n } = H(), [r, a] = g("add"), [o, s] = g(null), [c, l] = g(null);
|
|
377
|
+
return /* @__PURE__ */ v("div", {
|
|
378
|
+
className: "nxgt-fin-panel",
|
|
379
|
+
children: [
|
|
380
|
+
/* @__PURE__ */ _(p, {
|
|
381
|
+
label: t("material.calculator.financial.vat.direction", "Direction"),
|
|
382
|
+
value: r,
|
|
383
|
+
onChange: a,
|
|
384
|
+
choices: [q("add", t("material.calculator.financial.vat.add", "Add VAT")), q("remove", t("material.calculator.financial.vat.remove", "Remove VAT"))]
|
|
385
|
+
}),
|
|
386
|
+
/* @__PURE__ */ v("div", {
|
|
387
|
+
className: "nxgt-fin-fields",
|
|
388
|
+
children: [/* @__PURE__ */ _(U, {
|
|
389
|
+
label: r === "add" ? t("material.calculator.financial.vat.net", "Price excluding VAT") : t("material.calculator.financial.vat.gross", "Price including VAT"),
|
|
390
|
+
value: o,
|
|
391
|
+
onChange: s
|
|
392
|
+
}), /* @__PURE__ */ _(W, {
|
|
393
|
+
label: t("material.calculator.financial.vat.rate", "VAT rate"),
|
|
394
|
+
value: c,
|
|
395
|
+
onChange: l
|
|
396
|
+
})]
|
|
397
|
+
}),
|
|
398
|
+
/* @__PURE__ */ _(K, {
|
|
399
|
+
active: e,
|
|
400
|
+
outcome: I(r, o, c, { fractionDigits: n })
|
|
401
|
+
})
|
|
402
|
+
]
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-panel.tsx
|
|
407
|
+
var $ = "material.calculator.financial", le = [
|
|
408
|
+
"vat",
|
|
409
|
+
"margin",
|
|
410
|
+
"change",
|
|
411
|
+
"loan"
|
|
412
|
+
], ue = (e) => le.includes(e);
|
|
413
|
+
function de() {
|
|
414
|
+
let { t: a } = i(), [o, s] = g("vat"), c = [
|
|
415
|
+
[
|
|
416
|
+
"vat",
|
|
417
|
+
a(`${$}.tabs.vat`, "VAT"),
|
|
418
|
+
ce
|
|
419
|
+
],
|
|
420
|
+
[
|
|
421
|
+
"margin",
|
|
422
|
+
a(`${$}.tabs.margin`, "Margin"),
|
|
423
|
+
Q
|
|
424
|
+
],
|
|
425
|
+
[
|
|
426
|
+
"change",
|
|
427
|
+
a(`${$}.tabs.change`, "% change"),
|
|
428
|
+
J
|
|
429
|
+
],
|
|
430
|
+
[
|
|
431
|
+
"loan",
|
|
432
|
+
a(`${$}.tabs.loan`, "Loan"),
|
|
433
|
+
se
|
|
434
|
+
]
|
|
435
|
+
];
|
|
436
|
+
return /* @__PURE__ */ _(d, { children: /* @__PURE__ */ v(n, {
|
|
437
|
+
value: o,
|
|
438
|
+
onValueChange: (e) => ue(e) && s(e),
|
|
439
|
+
className: "nxgt-fin-tabs",
|
|
440
|
+
children: [/* @__PURE__ */ _(t, {
|
|
441
|
+
"aria-label": a(`${$}.tabs.label`, "Calculation"),
|
|
442
|
+
className: "nxgt-fin-tablist",
|
|
443
|
+
children: c.map(([t, n]) => /* @__PURE__ */ _(e, {
|
|
444
|
+
value: t,
|
|
445
|
+
children: n
|
|
446
|
+
}, t))
|
|
447
|
+
}), c.map(([e, , t]) => /* @__PURE__ */ _(r, {
|
|
448
|
+
value: e,
|
|
449
|
+
forceMount: !0,
|
|
450
|
+
className: "nxgt-fin-body",
|
|
451
|
+
children: /* @__PURE__ */ _(t, { active: o === e })
|
|
452
|
+
}, e))]
|
|
453
|
+
}) });
|
|
454
|
+
}
|
|
455
|
+
//#endregion
|
|
456
|
+
//#region lib/components/ui/widgets/calculator/variants/financial/financial-variant.ts
|
|
457
|
+
var fe = { part: { panel: de } };
|
|
458
|
+
//#endregion
|
|
459
|
+
export { fe as variant };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as e } from "./translate-material-
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { n } from "./
|
|
1
|
+
import { i as e } from "./translate-material-BypJJ1l5.js";
|
|
2
|
+
import { n as t } from "./use-heading-spy-DJR8YYm6.js";
|
|
3
|
+
import { t as n } from "./number.utils-CSueQZcv.js";
|
|
4
4
|
import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
5
5
|
import { jsx as c } from "react/jsx-runtime";
|
|
6
6
|
import { useBlocker as l, useNavigate as u, useSearchParams as d } from "react-router";
|
|
@@ -146,10 +146,10 @@ function E(e) {
|
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region lib/hooks/use-number-formatter.ts
|
|
148
148
|
function D() {
|
|
149
|
-
let
|
|
149
|
+
let t = e(), i = r((e, r) => n(e, {
|
|
150
150
|
...r,
|
|
151
|
-
language:
|
|
152
|
-
}), [
|
|
151
|
+
language: t?.language
|
|
152
|
+
}), [t?.language]);
|
|
153
153
|
return {
|
|
154
154
|
formatCurrency: r((e, t) => i(e, {
|
|
155
155
|
...t,
|
|
@@ -251,7 +251,7 @@ async function I(e) {
|
|
|
251
251
|
}
|
|
252
252
|
//#endregion
|
|
253
253
|
//#region lib/hooks/use-unsaved-guard/use-discard-guard.tsx
|
|
254
|
-
function L(e,
|
|
254
|
+
function L(e, n = {}) {
|
|
255
255
|
let i = o(e);
|
|
256
256
|
i.current = e;
|
|
257
257
|
let [a, l] = s(null);
|
|
@@ -259,8 +259,8 @@ function L(e, t = {}) {
|
|
|
259
259
|
close: r((e) => {
|
|
260
260
|
N(i.current) ? l(() => e) : e();
|
|
261
261
|
}, []),
|
|
262
|
-
dialog: /* @__PURE__ */ c(
|
|
263
|
-
...
|
|
262
|
+
dialog: /* @__PURE__ */ c(t, {
|
|
263
|
+
...n,
|
|
264
264
|
open: a !== null,
|
|
265
265
|
onOpenChange: (e) => {
|
|
266
266
|
e || l(null);
|
|
@@ -294,8 +294,8 @@ function z(e, t) {
|
|
|
294
294
|
blockerRef: c
|
|
295
295
|
};
|
|
296
296
|
}
|
|
297
|
-
function B(e,
|
|
298
|
-
let { block: a, leaves: l, ignoreSearch: u, onBlock: d, ...f } =
|
|
297
|
+
function B(e, n) {
|
|
298
|
+
let { block: a, leaves: l, ignoreSearch: u, onBlock: d, ...f } = n, p = o(e);
|
|
299
299
|
p.current = e;
|
|
300
300
|
let [m] = s(() => P(() => p.current)), h = o(!1), { asking: g, setAsking: _, blockerRef: v } = z(a((e) => m.shouldBlock(e, {
|
|
301
301
|
leaves: l,
|
|
@@ -307,7 +307,7 @@ function B(e, t) {
|
|
|
307
307
|
y && m.rearm();
|
|
308
308
|
}, [y, m]), {
|
|
309
309
|
release: r(() => m.release(), [m]),
|
|
310
|
-
dialog: /* @__PURE__ */ c(
|
|
310
|
+
dialog: /* @__PURE__ */ c(t, {
|
|
311
311
|
...f,
|
|
312
312
|
open: g,
|
|
313
313
|
onOpenChange: (e) => {
|
package/dist/hooks.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as e, i as t, o as n, r, s as i } from "./theme-store-BdPp43cV.js";
|
|
2
2
|
import { n as a, t as o } from "./use-theme-BCLireTd.js";
|
|
3
|
-
import { a as s, i as c, m as l, o as u, r as d, s as f, t as p } from "./use-heading-spy-
|
|
3
|
+
import { a as s, i as c, m as l, o as u, r as d, s as f, t as p } from "./use-heading-spy-DJR8YYm6.js";
|
|
4
4
|
import { r as m } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
5
5
|
import { t as h } from "./use-mobile-BDro060N.js";
|
|
6
6
|
import { t as g } from "./use-scroll-away-PQRFZkT2.js";
|
|
7
|
-
import { a as _, c as v, d as y, f as b, g as x, h as S, i as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M } from "./hooks-
|
|
7
|
+
import { a as _, c as v, d as y, f as b, g as x, h as S, i as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M } from "./hooks-Dg94jPRq.js";
|
|
8
8
|
export { r as DEFAULT_THEME, t as applyResolvedTheme, e as applyThemeName, _ as buildOptions, c as busySettler, b as clearDrafts, s as createSubmitGuard, D as extractNode, S as isLeaving, n as resolveTheme, i as resolveThemeName, x as shouldBlockNavigation, T as useAllowedTransitions, d as useCountdown, m as useCspNonce, E as useDiscardGuard, O as useDrafts, f as useFocusOnMount, y as useFormatters, p as useHeadingSpy, a as useIsClient, h as useIsMobile, l as useLocalizedDate, w as useNavigationHandler, M as useNavigationHandlers, v as useNumberFormatter, A as useOptions, C as useReactRouterBlock, g as useScrollAway, k as useSearchParam, u as useSubmitOnce, o as useTheme, j as useUnsavedGuard };
|