@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
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { announcement as e, formatDecimal as t, parseDecimal as n } from "@nxgt/material-core/calculator";
|
|
2
|
+
//#region lib/components/ui/widgets/calculator/variants/variant-logic.ts
|
|
3
|
+
var r = /* @__PURE__ */ new Map(), i = (e, t) => {
|
|
4
|
+
r.set(e, t);
|
|
5
|
+
}, a = (e) => r.get(e), o = {
|
|
6
|
+
empty: "material.calculator.error.empty",
|
|
7
|
+
syntax: "material.calculator.error.syntax",
|
|
8
|
+
unbalanced: "material.calculator.error.unbalanced",
|
|
9
|
+
"division-by-zero": "material.calculator.error.division-by-zero",
|
|
10
|
+
domain: "material.calculator.error.domain",
|
|
11
|
+
overflow: "material.calculator.error.overflow",
|
|
12
|
+
"too-large": "material.calculator.error.too-large",
|
|
13
|
+
"unknown-function": "material.calculator.error.unknown-function",
|
|
14
|
+
arity: "material.calculator.error.arity",
|
|
15
|
+
"invalid-digit": "material.calculator.error.invalid-digit",
|
|
16
|
+
"unknown-unit": "material.calculator.error.unknown-unit",
|
|
17
|
+
"unit-mismatch": "material.calculator.error.unit-mismatch",
|
|
18
|
+
"unknown-currency": "material.calculator.error.unknown-currency",
|
|
19
|
+
"invalid-rates": "material.calculator.error.invalid-rates",
|
|
20
|
+
"invalid-amount": "material.calculator.error.invalid-amount",
|
|
21
|
+
"duplicate-line": "material.calculator.error.duplicate-line",
|
|
22
|
+
"unknown-line": "material.calculator.error.unknown-line"
|
|
23
|
+
}, s = /* @__PURE__ */ new Set([
|
|
24
|
+
"mc",
|
|
25
|
+
"mr",
|
|
26
|
+
"m+",
|
|
27
|
+
"m-"
|
|
28
|
+
]);
|
|
29
|
+
function c(e, r) {
|
|
30
|
+
let i = n(e);
|
|
31
|
+
return i ? t(i, { locale: r }) : e;
|
|
32
|
+
}
|
|
33
|
+
function l(t, n) {
|
|
34
|
+
let r = e(t, n);
|
|
35
|
+
return r ? {
|
|
36
|
+
key: t.error ? o[t.error] : "material.calculator.announce.result",
|
|
37
|
+
fallback: r.fallback,
|
|
38
|
+
values: r.values
|
|
39
|
+
} : null;
|
|
40
|
+
}
|
|
41
|
+
function u(e, t, n, r, i) {
|
|
42
|
+
if (e === "=" || n.error && n.error !== t.error) {
|
|
43
|
+
let e = l(n, r), t = a("programmer")?.said;
|
|
44
|
+
return i && t ? t(e, n, i) : e;
|
|
45
|
+
}
|
|
46
|
+
if (!s.has(e)) return null;
|
|
47
|
+
let o = c(n.memory, r);
|
|
48
|
+
return e === "mc" ? {
|
|
49
|
+
key: "material.calculator.announce.memory-cleared",
|
|
50
|
+
fallback: "Memory cleared"
|
|
51
|
+
} : e === "mr" ? {
|
|
52
|
+
key: "material.calculator.announce.memory-recalled",
|
|
53
|
+
fallback: "Memory {value} recalled",
|
|
54
|
+
values: { value: o }
|
|
55
|
+
} : {
|
|
56
|
+
key: "material.calculator.announce.memory-changed",
|
|
57
|
+
fallback: "Memory is {value}",
|
|
58
|
+
values: { value: o }
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
var d = (e) => e === "copied" ? {
|
|
62
|
+
key: "material.calculator.announce.copied",
|
|
63
|
+
fallback: "Result copied"
|
|
64
|
+
} : {
|
|
65
|
+
key: "material.calculator.announce.pasted",
|
|
66
|
+
fallback: "Expression pasted"
|
|
67
|
+
}, f = {
|
|
68
|
+
deg: "Angles in degrees",
|
|
69
|
+
rad: "Angles in radians",
|
|
70
|
+
grad: "Angles in gradians"
|
|
71
|
+
}, p = (e) => ({
|
|
72
|
+
key: `material.calculator.angle.set-${e}`,
|
|
73
|
+
fallback: f[e]
|
|
74
|
+
}), m = {
|
|
75
|
+
auto: "Automatic notation",
|
|
76
|
+
sci: "Scientific notation",
|
|
77
|
+
eng: "Engineering notation"
|
|
78
|
+
}, h = (e) => ({
|
|
79
|
+
key: `material.calculator.notation.set-${e}`,
|
|
80
|
+
fallback: m[e]
|
|
81
|
+
}), g = (e) => e ? {
|
|
82
|
+
key: "material.calculator.second-on",
|
|
83
|
+
fallback: "Second functions on"
|
|
84
|
+
} : {
|
|
85
|
+
key: "material.calculator.second-off",
|
|
86
|
+
fallback: "Second functions off"
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { d as a, a as c, c as i, i as l, p as n, h as o, u as r, g as s, o as t };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createContext as e, useContext as t } from "react";
|
|
2
|
+
//#region lib/components/ui/widgets/calculator/calculator-context.tsx
|
|
3
|
+
var n = e(null), r = n.Provider;
|
|
4
|
+
function i() {
|
|
5
|
+
let e = t(n);
|
|
6
|
+
if (!e) throw Error("Calculator components must be used inside <Calculator>");
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { i as n, r as t };
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
+
import { t } from "./button-3op3rtZh.js";
|
|
3
|
+
import { t as n } from "./use-material-translation-CD6QoVal.js";
|
|
4
|
+
import { t as r } from "./icon-button-Cogxy1cy.js";
|
|
5
|
+
import { a as i, i as a, n as o, r as s, t as c } from "./picker-surface-CV09H7Nb.js";
|
|
6
|
+
import { r as l, t as u } from "./currency-field-BJ9rSrif.js";
|
|
7
|
+
import { r as d, t as f } from "./field-blur-DkiZOVNV.js";
|
|
8
|
+
import { t as p } from "./calculator-BaSMe0SK.js";
|
|
9
|
+
import { useId as m, useState as h } from "react";
|
|
10
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
11
|
+
import { Calculator as y } from "lucide-react";
|
|
12
|
+
import { currencyFractionDigits as b } from "@nxgt/material-core/currency-digits";
|
|
13
|
+
import { parseDecimal as x, roundTo as S, toCanonical as C } from "@nxgt/material-core/calculator";
|
|
14
|
+
//#region lib/components/ui/fields/calculator-field/apply-calculated.ts
|
|
15
|
+
function w(e, { currency: t, fractionDigits: n, min: r, max: i }) {
|
|
16
|
+
let a = x(e);
|
|
17
|
+
if (!a) return;
|
|
18
|
+
let o = t ? S(a, b(t, n), "half-up") : a, s = Number(C(o));
|
|
19
|
+
if (Number.isFinite(s)) return r != null && (s = Math.max(s, r)), i != null && (s = Math.min(s, i)), s;
|
|
20
|
+
}
|
|
21
|
+
var T = (e) => e == null || !Number.isFinite(e) ? void 0 : String(e), E = ["standard"], D = "pointer-coarse:[--btn-h:44px] pointer-coarse:h-(--btn-h)";
|
|
22
|
+
function O({ titleId: e, seed: r, variant: i, variants: a, onApply: o, onCancel: c }) {
|
|
23
|
+
let { t: l } = n(), u = l("material.calculator.field.title", "Calculator"), [d, f] = h("");
|
|
24
|
+
return /* @__PURE__ */ v(s, {
|
|
25
|
+
labelledBy: e,
|
|
26
|
+
sheetTitle: u,
|
|
27
|
+
"data-slot": "calculator-field-content",
|
|
28
|
+
className: "flex max-h-(--radix-popover-content-available-height) w-[min(24rem,calc(100vw-1rem))] flex-col p-3",
|
|
29
|
+
placement: { align: "end" },
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ _("span", {
|
|
32
|
+
id: e,
|
|
33
|
+
className: "sr-only",
|
|
34
|
+
children: u
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ _("div", {
|
|
37
|
+
className: "min-h-0 w-full flex-1 overflow-y-auto",
|
|
38
|
+
children: /* @__PURE__ */ _(p, {
|
|
39
|
+
defaultVariant: i ?? "standard",
|
|
40
|
+
variants: a ?? E,
|
|
41
|
+
persist: !1,
|
|
42
|
+
defaultValue: T(r),
|
|
43
|
+
onValueChange: f,
|
|
44
|
+
className: "w-full"
|
|
45
|
+
})
|
|
46
|
+
}),
|
|
47
|
+
/* @__PURE__ */ v("div", {
|
|
48
|
+
className: "flex shrink-0 gap-2 self-end pt-3",
|
|
49
|
+
children: [/* @__PURE__ */ _(t, {
|
|
50
|
+
variant: "tonal",
|
|
51
|
+
className: `${D} pointer-coarse:px-6`,
|
|
52
|
+
onClick: c,
|
|
53
|
+
children: l("material.calculator.field.cancel", "Cancel")
|
|
54
|
+
}), /* @__PURE__ */ _(t, {
|
|
55
|
+
className: `${D} pointer-coarse:px-6`,
|
|
56
|
+
disabled: d === "",
|
|
57
|
+
onClick: () => o(d),
|
|
58
|
+
children: l("material.calculator.field.apply", "Apply")
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region lib/components/ui/fields/calculator-field/calculator-field-trigger.tsx
|
|
66
|
+
function k({ disabled: e }) {
|
|
67
|
+
let { t } = n();
|
|
68
|
+
return /* @__PURE__ */ _(a, {
|
|
69
|
+
asChild: !0,
|
|
70
|
+
children: /* @__PURE__ */ _(r, {
|
|
71
|
+
variant: "ghost",
|
|
72
|
+
size: "sm",
|
|
73
|
+
"data-slot": "calculator-field-trigger",
|
|
74
|
+
"aria-label": t("material.calculator.field.open", "Open calculator"),
|
|
75
|
+
disabled: e,
|
|
76
|
+
className: "pointer-coarse:size-11",
|
|
77
|
+
children: /* @__PURE__ */ _(y, {})
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region lib/components/ui/fields/calculator-field/use-calculator-field.ts
|
|
83
|
+
function A({ value: e, defaultValue: t = null, onChange: n, currency: r, fractionDigits: i, min: a, max: o, onExactValueChange: s }) {
|
|
84
|
+
let [c, l] = h(!1), [u, d] = h(t), f = (e) => {
|
|
85
|
+
d(e), n?.(e);
|
|
86
|
+
};
|
|
87
|
+
return {
|
|
88
|
+
open: c,
|
|
89
|
+
setOpen: l,
|
|
90
|
+
current: e === void 0 ? u : e,
|
|
91
|
+
change: f,
|
|
92
|
+
apply: (e) => {
|
|
93
|
+
let t = w(e, {
|
|
94
|
+
currency: r,
|
|
95
|
+
fractionDigits: i,
|
|
96
|
+
min: a,
|
|
97
|
+
max: o
|
|
98
|
+
});
|
|
99
|
+
t !== void 0 && (s?.(e), f(t), l(!1));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
//#region lib/components/ui/fields/calculator-field/calculator-field.tsx
|
|
105
|
+
function j({ currency: t, fractionDigits: n, calculatorVariant: r, calculatorVariants: a, surface: s, onExactValueChange: d, value: f, defaultValue: p, onChange: h, className: y, min: b, max: x, step: S, hideSteppers: C, suffix: w, ...T }) {
|
|
106
|
+
let E = i(s), D = m(), j = A({
|
|
107
|
+
value: f,
|
|
108
|
+
defaultValue: p,
|
|
109
|
+
onChange: h,
|
|
110
|
+
currency: t,
|
|
111
|
+
fractionDigits: n,
|
|
112
|
+
min: b,
|
|
113
|
+
max: x,
|
|
114
|
+
onExactValueChange: d
|
|
115
|
+
}), M = /* @__PURE__ */ _(k, { disabled: T.disabled }), N = {
|
|
116
|
+
...T,
|
|
117
|
+
value: j.current,
|
|
118
|
+
onChange: j.change
|
|
119
|
+
};
|
|
120
|
+
return /* @__PURE__ */ v(c, {
|
|
121
|
+
kind: E,
|
|
122
|
+
open: j.open,
|
|
123
|
+
onOpenChange: j.setOpen,
|
|
124
|
+
children: [/* @__PURE__ */ _(o, { children: /* @__PURE__ */ _("div", {
|
|
125
|
+
"data-slot": "calculator-field",
|
|
126
|
+
className: e("w-full", y),
|
|
127
|
+
children: t ? /* @__PURE__ */ _(u, {
|
|
128
|
+
...N,
|
|
129
|
+
currency: t,
|
|
130
|
+
fractionDigits: n,
|
|
131
|
+
trailingAction: M
|
|
132
|
+
}) : /* @__PURE__ */ _(l, {
|
|
133
|
+
...N,
|
|
134
|
+
min: b,
|
|
135
|
+
max: x,
|
|
136
|
+
step: S,
|
|
137
|
+
hideSteppers: C,
|
|
138
|
+
suffix: /* @__PURE__ */ v(g, { children: [w, M] })
|
|
139
|
+
})
|
|
140
|
+
}) }), /* @__PURE__ */ _(O, {
|
|
141
|
+
titleId: D,
|
|
142
|
+
seed: j.current,
|
|
143
|
+
variant: r,
|
|
144
|
+
variants: a,
|
|
145
|
+
onApply: j.apply,
|
|
146
|
+
onCancel: () => j.setOpen(!1)
|
|
147
|
+
})]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region lib/components/ui/fields/calculator-field/calculator-form-field.tsx
|
|
152
|
+
function M({ control: e, name: t, ...n }) {
|
|
153
|
+
return /* @__PURE__ */ _(d, {
|
|
154
|
+
control: e,
|
|
155
|
+
name: t,
|
|
156
|
+
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ _(f, {
|
|
157
|
+
onBlur: e.onBlur,
|
|
158
|
+
children: /* @__PURE__ */ _(j, {
|
|
159
|
+
...n,
|
|
160
|
+
ref: e.ref,
|
|
161
|
+
name: e.name,
|
|
162
|
+
value: e.value ?? null,
|
|
163
|
+
disabled: n.disabled || e.disabled,
|
|
164
|
+
onChange: e.onChange,
|
|
165
|
+
error: t.invalid,
|
|
166
|
+
helperText: t.error?.message ?? n.helperText
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
//#endregion
|
|
172
|
+
export { j as CalculatorField, M as CalculatorFormField };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { t as e } from "./live-status-BGPaN8r8.js";
|
|
2
|
+
import { createContext as t, useContext as n, useEffect as r, useState as i } from "react";
|
|
3
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
//#region lib/components/ui/widgets/calculator/partials/calculator-panel-announce.tsx
|
|
5
|
+
var s = t(() => {}), c = 700;
|
|
6
|
+
function l({ children: t }) {
|
|
7
|
+
let [n, r] = i(null);
|
|
8
|
+
return /* @__PURE__ */ o(s.Provider, {
|
|
9
|
+
value: r,
|
|
10
|
+
children: [t, /* @__PURE__ */ a(e, {
|
|
11
|
+
slot: "calculator-status",
|
|
12
|
+
children: n
|
|
13
|
+
})]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function u(e, t) {
|
|
17
|
+
let i = n(s);
|
|
18
|
+
r(() => {
|
|
19
|
+
if (!t || !e) return;
|
|
20
|
+
let n = setTimeout(() => i(e), c);
|
|
21
|
+
return () => clearTimeout(n);
|
|
22
|
+
}, [
|
|
23
|
+
e,
|
|
24
|
+
t,
|
|
25
|
+
i
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { u as n, l as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { t as e } from "./use-material-translation-CD6QoVal.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region lib/components/ui/widgets/calculator/partials/calculator-segment.tsx
|
|
4
|
+
function n({ label: n, choices: r, value: i, nameKey: a, onChange: o }) {
|
|
5
|
+
let { t: s } = e();
|
|
6
|
+
return /* @__PURE__ */ t("div", {
|
|
7
|
+
role: "group",
|
|
8
|
+
"aria-label": n,
|
|
9
|
+
className: "nxgt-calc-segment",
|
|
10
|
+
children: r.map(({ id: e, glyph: n, name: r, spoken: c }) => /* @__PURE__ */ t("button", {
|
|
11
|
+
type: "button",
|
|
12
|
+
"aria-pressed": i === e,
|
|
13
|
+
"aria-label": c ?? (a ? s(a(e), r) : r),
|
|
14
|
+
"data-pw": `calculator-${e}`,
|
|
15
|
+
className: "nxgt-calc-segment-item",
|
|
16
|
+
onClick: () => o(e),
|
|
17
|
+
children: n
|
|
18
|
+
}, e))
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as t };
|
package/dist/charts.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as e } from "./ui.utils-CAnKTCw5.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
3
|
import { t as n } from "./warn-once-C_e47JM8.js";
|
|
4
|
-
import { t as r } from "./button-
|
|
5
|
-
import { t as i } from "./use-material-translation-
|
|
4
|
+
import { t as r } from "./button-3op3rtZh.js";
|
|
5
|
+
import { t as i } from "./use-material-translation-CD6QoVal.js";
|
|
6
6
|
import { t as a } from "./use-ssr-media-query-C6M5m8sf.js";
|
|
7
7
|
import { i as o, n as s, r as c, t as l } from "./util-4heV2LPI.js";
|
|
8
8
|
import { t as u } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
9
|
-
import { t as d } from "./chip-
|
|
9
|
+
import { t as d } from "./chip-MuKDwtkG.js";
|
|
10
10
|
import { c as f, d as p, f as m, i as h, o as g, p as _, s as v, t as y } from "./line-path-C5pZGC49.js";
|
|
11
11
|
import { t as b } from "./live-status-BGPaN8r8.js";
|
|
12
12
|
import { t as x } from "./linear-G97mfnKF.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as t } from "./spinner-C1QIewWv.js";
|
|
3
3
|
import { s as n } from "./use-click-lock-BZYtTmVt.js";
|
|
4
|
-
import { t as r } from "./use-material-translation-
|
|
4
|
+
import { t as r } from "./use-material-translation-CD6QoVal.js";
|
|
5
5
|
import { t as i } from "./react-node-text-Crkpfpco.js";
|
|
6
6
|
import { cloneElement as a, isValidElement as o } from "react";
|
|
7
7
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
|
-
import {
|
|
4
|
-
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-
|
|
5
|
-
import { a as c, i as l, n as u } from "./field-blur-context-
|
|
6
|
-
import { a as d,
|
|
3
|
+
import { t as n } from "./dist-DWZXlCZR.js";
|
|
4
|
+
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-xlZ6NYUA.js";
|
|
5
|
+
import { a as c, i as l, n as u } from "./field-blur-context-BLGgf_3z.js";
|
|
6
|
+
import { a as d, o as f, r as p, s as m, t as h } from "./toolbar-items-D310xDuM.js";
|
|
7
7
|
import { t as g } from "./is-production-GLw59WU8.js";
|
|
8
|
-
import { t as _ } from "./use-material-translation-
|
|
9
|
-
import { i as v, n as y, o as b, t as x } from "./code-language-items-
|
|
8
|
+
import { t as _ } from "./use-material-translation-CD6QoVal.js";
|
|
9
|
+
import { i as v, n as y, o as b, t as x } from "./code-language-items-B7WR5ua_.js";
|
|
10
10
|
import { t as S } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
11
11
|
import { n as C, t as w } from "./escape-owner-DpaP0lm1.js";
|
|
12
12
|
import { t as T } from "./skeleton-DSdtr2qc.js";
|
|
@@ -1415,7 +1415,7 @@ function Bn({ reader: e, status: t, disabled: n, onCopy: r }) {
|
|
|
1415
1415
|
onClick: r,
|
|
1416
1416
|
children: [o, /* @__PURE__ */ I("span", { children: t === "copied" ? i("material.code.copied", "Copied") : a })]
|
|
1417
1417
|
})
|
|
1418
|
-
}) : /* @__PURE__ */ I(
|
|
1418
|
+
}) : /* @__PURE__ */ I(h, {
|
|
1419
1419
|
icon: o,
|
|
1420
1420
|
label: a,
|
|
1421
1421
|
priority: 2,
|
|
@@ -1466,11 +1466,11 @@ function Vn({ language: e, onLanguageChange: t, disabled: n }) {
|
|
|
1466
1466
|
//#region lib/components/ui/widgets/code-editor/toolbar/code-view-tools.tsx
|
|
1467
1467
|
function Hn({ disabled: e, wordWrap: t, onWordWrapChange: n, fullscreen: r, onFullscreenChange: i, onFind: a }) {
|
|
1468
1468
|
let { t: o } = _();
|
|
1469
|
-
return /* @__PURE__ */ L(
|
|
1469
|
+
return /* @__PURE__ */ L(f, {
|
|
1470
1470
|
label: o("material.code.view", "View"),
|
|
1471
1471
|
priority: 3,
|
|
1472
1472
|
children: [
|
|
1473
|
-
/* @__PURE__ */ I(
|
|
1473
|
+
/* @__PURE__ */ I(h, {
|
|
1474
1474
|
icon: /* @__PURE__ */ I(ce, {}),
|
|
1475
1475
|
label: o("material.code.find", "Find"),
|
|
1476
1476
|
disabled: e,
|
|
@@ -1518,10 +1518,10 @@ function Wn(e) {
|
|
|
1518
1518
|
//#endregion
|
|
1519
1519
|
//#region lib/components/ui/widgets/code-editor/toolbar/code-editor-toolbar.tsx
|
|
1520
1520
|
function Gn({ editor: e, language: t, onLanguageChange: n, wordWrap: r, onWordWrapChange: i, fallbackCode: a = "", readOnly: o, disabled: s, fullscreen: c, onFullscreenChange: l }) {
|
|
1521
|
-
let { t: u } = _(), { status: d, copy:
|
|
1521
|
+
let { t: u } = _(), { status: d, copy: f } = b(), p = Wn(e), g = (t) => {
|
|
1522
1522
|
e?.focus(), e?.getAction(t)?.run();
|
|
1523
1523
|
};
|
|
1524
|
-
return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ L(
|
|
1524
|
+
return /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ L(m, {
|
|
1525
1525
|
label: u("material.code.tools", "Code tools"),
|
|
1526
1526
|
variant: "floating",
|
|
1527
1527
|
selectedLook: "morph",
|
|
@@ -1544,7 +1544,7 @@ function Gn({ editor: e, language: t, onLanguageChange: n, wordWrap: r, onWordWr
|
|
|
1544
1544
|
onFullscreenChange: l,
|
|
1545
1545
|
onFind: () => g("actions.find")
|
|
1546
1546
|
}),
|
|
1547
|
-
|
|
1547
|
+
p && !o && /* @__PURE__ */ I(h, {
|
|
1548
1548
|
icon: /* @__PURE__ */ I(ue, {}),
|
|
1549
1549
|
label: u("material.code.format", "Format document"),
|
|
1550
1550
|
priority: 1,
|
|
@@ -1555,7 +1555,7 @@ function Gn({ editor: e, language: t, onLanguageChange: n, wordWrap: r, onWordWr
|
|
|
1555
1555
|
reader: o,
|
|
1556
1556
|
status: d,
|
|
1557
1557
|
disabled: s,
|
|
1558
|
-
onCopy: () => void
|
|
1558
|
+
onCopy: () => void f(e?.getValue() ?? a)
|
|
1559
1559
|
})
|
|
1560
1560
|
]
|
|
1561
1561
|
}), /* @__PURE__ */ I(y, {
|
package/dist/code-editor.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as o } from "./use-material-translation-
|
|
5
|
-
import { i as s, n as c, o as l } from "./code-language-items-
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { t } from "./dist-DWZXlCZR.js";
|
|
3
|
+
import { o as n, r, s as i, t as a } from "./toolbar-items-D310xDuM.js";
|
|
4
|
+
import { t as o } from "./use-material-translation-CD6QoVal.js";
|
|
5
|
+
import { i as s, n as c, o as l } from "./code-language-items-B7WR5ua_.js";
|
|
6
|
+
import { t as u } from "./skeleton-DSdtr2qc.js";
|
|
7
|
+
import { t as d } from "./live-status-BGPaN8r8.js";
|
|
8
|
+
import { t as f } from "./use-mobile-BDro060N.js";
|
|
9
|
+
import { t as p } from "./react-node-text-Crkpfpco.js";
|
|
10
|
+
import { a as m, c as h, d as g, f as _, i as v, l as y, m as b, o as x, p as S, r as C, s as w, t as T, u as E } from "./code-editor-Bp2RrdNx.js";
|
|
11
|
+
import { r as D, t as O } from "./field-blur-DkiZOVNV.js";
|
|
12
12
|
import { useEffect as k, useRef as A, useState as j } from "react";
|
|
13
13
|
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
14
14
|
import { getCspNonce as F } from "@nxgt/material-core/csp-nonce";
|
|
15
15
|
import { ChevronDown as I, ChevronUp as L, Columns2 as R } from "lucide-react";
|
|
16
16
|
//#region lib/components/ui/widgets/code-editor/code-editor-form-field.tsx
|
|
17
17
|
function z({ control: e, name: t, ...n }) {
|
|
18
|
-
return /* @__PURE__ */ N(
|
|
18
|
+
return /* @__PURE__ */ N(D, {
|
|
19
19
|
control: e,
|
|
20
20
|
name: t,
|
|
21
|
-
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ N(
|
|
21
|
+
render: ({ field: e, fieldState: t }) => /* @__PURE__ */ N(O, {
|
|
22
22
|
onBlur: e.onBlur,
|
|
23
23
|
focusRef: e.ref,
|
|
24
|
-
children: /* @__PURE__ */ N(
|
|
24
|
+
children: /* @__PURE__ */ N(T, {
|
|
25
25
|
...n,
|
|
26
26
|
name: e.name,
|
|
27
27
|
value: e.value ?? "",
|
|
@@ -52,7 +52,7 @@ function V() {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
function H(e) {
|
|
55
|
-
V(),
|
|
55
|
+
V(), b.config(e);
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region lib/components/ui/widgets/code-editor/diff/code-diff-parts.tsx
|
|
@@ -95,7 +95,7 @@ function W({ index: e, count: t, language: n, children: r }) {
|
|
|
95
95
|
}),
|
|
96
96
|
/* @__PURE__ */ N("span", { className: "nxgt-code-status-gap" }),
|
|
97
97
|
/* @__PURE__ */ N("span", { children: s(n) }),
|
|
98
|
-
/* @__PURE__ */ N(
|
|
98
|
+
/* @__PURE__ */ N(d, {
|
|
99
99
|
slot: "code-diff-change-status",
|
|
100
100
|
children: e < 0 ? null : a
|
|
101
101
|
})
|
|
@@ -106,7 +106,7 @@ function W({ index: e, count: t, language: n, children: r }) {
|
|
|
106
106
|
//#region lib/components/ui/widgets/code-editor/diff/code-diff-toolbar.tsx
|
|
107
107
|
function G({ sideBySide: e, onSideBySideChange: t, changeCount: s, onStep: u, getCode: d }) {
|
|
108
108
|
let { t: f } = o(), { status: p, copy: m } = l();
|
|
109
|
-
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(
|
|
109
|
+
return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P(i, {
|
|
110
110
|
label: f("material.code.diff-tools", "Diff tools"),
|
|
111
111
|
variant: "floating",
|
|
112
112
|
selectedLook: "morph",
|
|
@@ -123,22 +123,22 @@ function G({ sideBySide: e, onSideBySideChange: t, changeCount: s, onStep: u, ge
|
|
|
123
123
|
pressed: !!e,
|
|
124
124
|
onPressedChange: t
|
|
125
125
|
}),
|
|
126
|
-
/* @__PURE__ */ P(
|
|
126
|
+
/* @__PURE__ */ P(n, {
|
|
127
127
|
label: f("material.code.changes", "Changes"),
|
|
128
128
|
priority: 3,
|
|
129
|
-
children: [/* @__PURE__ */ N(
|
|
129
|
+
children: [/* @__PURE__ */ N(a, {
|
|
130
130
|
icon: /* @__PURE__ */ N(L, {}),
|
|
131
131
|
label: f("material.code.previous-change", "Previous change"),
|
|
132
132
|
disabled: !s,
|
|
133
133
|
onClick: () => u(-1)
|
|
134
|
-
}), /* @__PURE__ */ N(
|
|
134
|
+
}), /* @__PURE__ */ N(a, {
|
|
135
135
|
icon: /* @__PURE__ */ N(I, {}),
|
|
136
136
|
label: f("material.code.next-change", "Next change"),
|
|
137
137
|
disabled: !s,
|
|
138
138
|
onClick: () => u(1)
|
|
139
139
|
})]
|
|
140
140
|
}),
|
|
141
|
-
/* @__PURE__ */ N(
|
|
141
|
+
/* @__PURE__ */ N(C, {
|
|
142
142
|
status: p,
|
|
143
143
|
onCopy: () => void m(d())
|
|
144
144
|
})
|
|
@@ -206,12 +206,12 @@ function Z(e, t) {
|
|
|
206
206
|
//#region lib/components/ui/widgets/code-editor/diff/code-diff.tsx
|
|
207
207
|
var Q = 480;
|
|
208
208
|
function $(n) {
|
|
209
|
-
let { original: r, modified: i, language: a = "typescript", height: o = 280 } = n, s = n.showChrome ?? !0, c =
|
|
209
|
+
let { original: r, modified: i, language: a = "typescript", height: o = 280 } = n, s = n.showChrome ?? !0, c = g(), l = v(n.theme, n.scheme), d = f(), m = Z(l.surfaceRef, Q), b = d || m, [x, C] = t({
|
|
210
210
|
prop: n.sideBySide,
|
|
211
211
|
defaultProp: n.defaultSideBySide ?? !0,
|
|
212
212
|
onChange: n.onSideBySideChange
|
|
213
|
-
}), [
|
|
214
|
-
A.keep(e),
|
|
213
|
+
}), [w, T] = j(), { changes: D, index: O, go: k } = X(w), A = ne(), M = ee(p(n.label) || p(n.filename)), F = (e, t) => {
|
|
214
|
+
A.keep(e), y(t), T(e);
|
|
215
215
|
};
|
|
216
216
|
return /* @__PURE__ */ P("div", {
|
|
217
217
|
ref: l.surfaceRef,
|
|
@@ -226,38 +226,38 @@ function $(n) {
|
|
|
226
226
|
className: "nxgt-code-filename",
|
|
227
227
|
children: n.filename
|
|
228
228
|
}),
|
|
229
|
-
|
|
229
|
+
w && /* @__PURE__ */ N(U, { ...q(D) }),
|
|
230
230
|
/* @__PURE__ */ N(G, {
|
|
231
|
-
sideBySide:
|
|
232
|
-
onSideBySideChange:
|
|
233
|
-
changeCount:
|
|
231
|
+
sideBySide: x,
|
|
232
|
+
onSideBySideChange: b ? void 0 : C,
|
|
233
|
+
changeCount: D.length,
|
|
234
234
|
onStep: k,
|
|
235
|
-
getCode: () =>
|
|
235
|
+
getCode: () => w?.getModifiedEditor().getValue() ?? i
|
|
236
236
|
})
|
|
237
237
|
]
|
|
238
238
|
}),
|
|
239
|
-
c ? /* @__PURE__ */ N(
|
|
239
|
+
c ? /* @__PURE__ */ N(_, { height: o }) : /* @__PURE__ */ N(S, {
|
|
240
240
|
original: r,
|
|
241
241
|
modified: i,
|
|
242
242
|
language: a,
|
|
243
|
-
theme:
|
|
244
|
-
beforeMount:
|
|
243
|
+
theme: h,
|
|
244
|
+
beforeMount: E,
|
|
245
245
|
height: o,
|
|
246
246
|
keepCurrentOriginalModel: !0,
|
|
247
247
|
keepCurrentModifiedModel: !0,
|
|
248
248
|
onMount: F,
|
|
249
249
|
options: {
|
|
250
|
-
...te(l.overflow,
|
|
250
|
+
...te(l.overflow, x && !b),
|
|
251
251
|
...M
|
|
252
252
|
},
|
|
253
|
-
loading: /* @__PURE__ */ N(
|
|
253
|
+
loading: /* @__PURE__ */ N(u, {
|
|
254
254
|
style: { height: o },
|
|
255
255
|
className: "w-full"
|
|
256
256
|
})
|
|
257
257
|
}),
|
|
258
258
|
s && /* @__PURE__ */ N(W, {
|
|
259
|
-
index:
|
|
260
|
-
count:
|
|
259
|
+
index: O,
|
|
260
|
+
count: D.length,
|
|
261
261
|
language: a
|
|
262
262
|
})
|
|
263
263
|
]
|
|
@@ -272,7 +272,7 @@ function ee(e) {
|
|
|
272
272
|
}
|
|
273
273
|
function te(e, t) {
|
|
274
274
|
return {
|
|
275
|
-
...
|
|
275
|
+
...w,
|
|
276
276
|
overflowWidgetsDomNode: e,
|
|
277
277
|
readOnly: !0,
|
|
278
278
|
renderSideBySide: t,
|
|
@@ -294,4 +294,4 @@ function ne() {
|
|
|
294
294
|
} };
|
|
295
295
|
}
|
|
296
296
|
//#endregion
|
|
297
|
-
export {
|
|
297
|
+
export { m as CODE_THEMES, $ as CodeDiff, T as CodeEditor, z as CodeEditorFormField, H as configureMonaco, x as defineCodeTheme };
|