@luzmo/lucero 0.0.3 → 0.0.6
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/components/accordion/accordion-item.d.ts +24 -0
- package/components/accordion/accordion.d.ts +42 -0
- package/components/accordion/index.cjs +43 -0
- package/components/accordion/index.d.ts +10 -0
- package/components/accordion/index.js +181 -0
- package/components/action-bar/action-bar.d.ts +42 -0
- package/components/action-bar/index.cjs +39 -0
- package/components/action-bar/index.d.ts +7 -0
- package/components/action-bar/index.js +107 -0
- package/components/action-button/action-button.d.ts +81 -0
- package/components/action-button/index.cjs +24 -0
- package/components/action-button/index.d.ts +7 -0
- package/components/action-button/index.js +161 -0
- package/components/action-group/action-group.d.ts +50 -0
- package/components/action-group/index.cjs +18 -0
- package/components/action-group/index.d.ts +7 -0
- package/components/action-group/index.js +29 -0
- package/components/action-group-B7oQXv30.js +258 -0
- package/components/action-group-C8YUQzt8.cjs +20 -0
- package/components/action-menu/action-menu.d.ts +40 -0
- package/components/action-menu/index.cjs +56 -0
- package/components/action-menu/index.d.ts +7 -0
- package/components/action-menu/index.js +126 -0
- package/components/async-directive-BhRGSTWB.js +82 -0
- package/components/async-directive-_65ULPLK.cjs +22 -0
- package/components/avatar/avatar.d.ts +31 -0
- package/components/avatar/index.cjs +24 -0
- package/components/avatar/index.d.ts +7 -0
- package/components/avatar/index.js +81 -0
- package/components/base-BjTwmyRF.cjs +22 -0
- package/components/base-CxUap9HL.js +665 -0
- package/components/base-D76d76ww.js +26 -0
- package/components/base-rtxi7uaR.cjs +40 -0
- package/components/button/button-base.d.ts +44 -0
- package/components/button/button.d.ts +59 -0
- package/components/button/clear-button.d.ts +22 -0
- package/components/button/close-button.d.ts +24 -0
- package/components/button/index.cjs +20 -0
- package/components/button/index.d.ts +13 -0
- package/components/button/index.js +127 -0
- package/components/button-base-CgrTYVgq.js +142 -0
- package/components/button-base-DjqSZyn2.cjs +25 -0
- package/components/button-group/button-group.d.ts +19 -0
- package/components/button-group/index.cjs +18 -0
- package/components/button-group/index.d.ts +7 -0
- package/components/button-group/index.js +59 -0
- package/components/checkbox/checkbox-base.d.ts +9 -0
- package/components/checkbox/checkbox-mixin.d.ts +14 -0
- package/components/checkbox/checkbox.d.ts +54 -0
- package/components/checkbox/index.cjs +25 -0
- package/components/checkbox/index.d.ts +7 -0
- package/components/checkbox/index.js +96 -0
- package/components/checkbox-mixin-BRluTF9s.js +70 -0
- package/components/checkbox-mixin-iB-0ivgo.cjs +27 -0
- package/components/clear-button-CyLF5dx_.js +53 -0
- package/components/clear-button-DFXE6MLx.cjs +18 -0
- package/components/close-button-CcD-aVqh.cjs +18 -0
- package/components/close-button-CzpdWCWI.js +51 -0
- package/components/color-Bg3tYsAQ.js +178 -0
- package/components/color-DphK4hwx.cjs +18 -0
- package/components/color-area/color-area.d.ts +67 -0
- package/components/color-area/index.cjs +80 -0
- package/components/color-area/index.d.ts +7 -0
- package/components/color-area/index.js +372 -0
- package/components/color-field/color-field.d.ts +20 -0
- package/components/color-field/index.cjs +23 -0
- package/components/color-field/index.d.ts +7 -0
- package/components/color-field/index.js +80 -0
- package/components/color-handle/color-handle.d.ts +13 -0
- package/components/color-handle/index.cjs +24 -0
- package/components/color-handle/index.d.ts +7 -0
- package/components/color-handle/index.js +73 -0
- package/components/color-loupe/color-loupe.d.ts +7 -0
- package/components/color-loupe/index.cjs +18 -0
- package/components/color-loupe/index.d.ts +7 -0
- package/components/color-loupe/index.js +29 -0
- package/components/color-loupe-BN3k1ACF.cjs +56 -0
- package/components/color-loupe-CD-dhmB1.js +81 -0
- package/components/color-menu/color-menu.d.ts +54 -0
- package/components/color-menu/index.cjs +86 -0
- package/components/color-menu/index.d.ts +7 -0
- package/components/color-menu/index.js +203 -0
- package/components/color-picker/color-picker.d.ts +39 -0
- package/components/color-picker/index.cjs +48 -0
- package/components/color-picker/index.d.ts +7 -0
- package/components/color-picker/index.js +141 -0
- package/components/color-slider/color-slider.d.ts +57 -0
- package/components/color-slider/index.cjs +57 -0
- package/components/color-slider/index.d.ts +7 -0
- package/components/color-slider/index.js +317 -0
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
- package/components/condition-attribute-with-id-Dv4lSRbe.js +31 -0
- package/components/dependency-manger-C5HCkMMB.cjs +18 -0
- package/components/dependency-manger-CEXvGQUV.js +54 -0
- package/components/directive-C7oCP5Bh.cjs +22 -0
- package/components/directive-helpers-C3pAxRR3.cjs +22 -0
- package/components/directive-helpers-D0vm0gvF.js +28 -0
- package/components/directive-oAbCiebi.js +44 -0
- package/components/divider/divider.d.ts +24 -0
- package/components/divider/index.cjs +18 -0
- package/components/divider/index.d.ts +7 -0
- package/components/divider/index.js +61 -0
- package/components/divider.module-CXMNveQc.cjs +18 -0
- package/components/divider.module-DwOuLGU3.js +21 -0
- package/components/element-resolution-BvRLGqIU.cjs +18 -0
- package/components/element-resolution-FCUT-wql.js +91 -0
- package/components/field-group/field-group.d.ts +24 -0
- package/components/field-group/index.cjs +18 -0
- package/components/field-group/index.d.ts +7 -0
- package/components/field-group/index.js +29 -0
- package/components/field-group-DAImvhSF.js +66 -0
- package/components/field-group-d5Hkb8UW.cjs +23 -0
- package/components/field-label/field-label.d.ts +50 -0
- package/components/field-label/index.cjs +18 -0
- package/components/field-label/index.d.ts +7 -0
- package/components/field-label/index.js +29 -0
- package/components/field-label-D1zKXSG6.cjs +25 -0
- package/components/field-label-DY9iRmRI.js +106 -0
- package/components/focus-group-DHeTq18L.js +218 -0
- package/components/focus-group-DnxZUBhQ.cjs +18 -0
- package/components/focus-visible-B0P9aY_G.cjs +18 -0
- package/components/focus-visible-DBlJGoEW.js +74 -0
- package/components/focusable-Bze9xE25.js +153 -0
- package/components/focusable-DyyBr-J-.cjs +18 -0
- package/components/focusable-selectors-B4YgbghQ.js +31 -0
- package/components/focusable-selectors-BgFlyFcY.cjs +18 -0
- package/components/icon/icon-base.d.ts +11 -0
- package/components/icon/icon.d.ts +12 -0
- package/components/icon/index.cjs +18 -0
- package/components/icon/index.d.ts +7 -0
- package/components/icon/index.js +88 -0
- package/components/if-defined-C-8FyBSN.cjs +22 -0
- package/components/if-defined-XzWkhMhg.js +27 -0
- package/components/index-C1chwzNp.js +727 -0
- package/components/index-CNtoBntg.cjs +77 -0
- package/components/index-Ci6Jnhu4.js +927 -0
- package/components/index-DCKCHDTt.cjs +18 -0
- package/components/index.cjs +27 -0
- package/components/index.js +207 -0
- package/components/infield-button/index.cjs +22 -0
- package/components/infield-button/index.d.ts +7 -0
- package/components/infield-button/index.js +64 -0
- package/components/infield-button/infield-button.d.ts +25 -0
- package/components/label/index.cjs +18 -0
- package/components/label/index.d.ts +7 -0
- package/components/label/index.js +51 -0
- package/components/label/label.d.ts +7 -0
- package/components/legend-position/index.d.ts +7 -0
- package/components/legend-position/legend-position.d.ts +10 -0
- package/components/like-anchor-DKuw8fJA.cjs +32 -0
- package/components/like-anchor-DnsAwo_O.js +69 -0
- package/components/manage-help-text-B-FXFXgT.js +92 -0
- package/components/manage-help-text-I5aYDAKT.cjs +30 -0
- package/components/menu/index.cjs +18 -0
- package/components/menu/index.d.ts +16 -0
- package/components/menu/index.js +32 -0
- package/components/menu/menu-divider.d.ts +14 -0
- package/components/menu/menu-group.d.ts +17 -0
- package/components/menu/menu-item.d.ts +125 -0
- package/components/menu/menu.d.ts +119 -0
- package/components/multi-language-field/index.cjs +39 -0
- package/components/multi-language-field/index.d.ts +7 -0
- package/components/multi-language-field/index.js +148 -0
- package/components/multi-language-field/multi-language-field.d.ts +41 -0
- package/components/mutation-controller-DH7YOCyj.js +52 -0
- package/components/mutation-controller-DkOMCW-c.cjs +22 -0
- package/components/number-field/index.cjs +57 -0
- package/components/number-field/index.d.ts +7 -0
- package/components/number-field/index.js +735 -0
- package/components/number-field/number-field.d.ts +113 -0
- package/components/observe-slot-text-DeSKIzvP.cjs +18 -0
- package/components/observe-slot-text-DrM71me1.js +87 -0
- package/components/overlay/abstract-overlay.d.ts +72 -0
- package/components/overlay/click-controller.d.ts +14 -0
- package/components/overlay/events.d.ts +23 -0
- package/components/overlay/full-size-plugin.d.ts +12 -0
- package/components/overlay/hover-controller.d.ts +20 -0
- package/components/overlay/index.cjs +73 -0
- package/components/overlay/index.d.ts +22 -0
- package/components/overlay/index.js +342 -0
- package/components/overlay/interaction-controller.d.ts +38 -0
- package/components/overlay/loader.d.ts +4 -0
- package/components/overlay/longpress-controller.d.ts +21 -0
- package/components/overlay/overlay-dialog.d.ts +4 -0
- package/components/overlay/overlay-events.d.ts +11 -0
- package/components/overlay/overlay-no-popover.d.ts +4 -0
- package/components/overlay/overlay-popover.d.ts +4 -0
- package/components/overlay/overlay-stack.d.ts +44 -0
- package/components/overlay/overlay-timer.d.ts +21 -0
- package/components/overlay/overlay-trigger-directive.d.ts +26 -0
- package/components/overlay/overlay-trigger.d.ts +53 -0
- package/components/overlay/overlay-types.d.ts +50 -0
- package/components/overlay/overlay.d.ts +464 -0
- package/components/overlay/placement-controller.d.ts +157 -0
- package/components/overlay/slottable-request-directive.d.ts +17 -0
- package/components/overlay/slottable-request-event.d.ts +12 -0
- package/components/overlay/strategies.d.ts +8 -0
- package/components/overlay/virtual-trigger.d.ts +7 -0
- package/components/overlay-C2Cck0Az.js +2712 -0
- package/components/overlay-dn6Xe_vz.cjs +47 -0
- package/components/pending-state--XOfTjzE.js +61 -0
- package/components/pending-state-BeJ7iP-O.cjs +26 -0
- package/components/picker/desktop-controller.d.ts +7 -0
- package/components/picker/index.cjs +18 -0
- package/components/picker/index.d.ts +7 -0
- package/components/picker/index.js +32 -0
- package/components/picker/interaction-controller.d.ts +43 -0
- package/components/picker/mobile-controller.d.ts +9 -0
- package/components/picker/picker.d.ts +154 -0
- package/components/picker/strategies.d.ts +6 -0
- package/components/picker-8cOc-jjh.cjs +127 -0
- package/components/picker-BZAWrSDk.js +655 -0
- package/components/platform-CQzYNWKq.cjs +18 -0
- package/components/platform-DQYMG7JI.js +54 -0
- package/components/popover/index.cjs +18 -0
- package/components/popover/index.d.ts +7 -0
- package/components/popover/index.js +29 -0
- package/components/popover/popover.d.ts +29 -0
- package/components/popover-CCzs4VH8.cjs +30 -0
- package/components/popover-D0EliN0L.js +67 -0
- package/components/progress-circle/index.cjs +18 -0
- package/components/progress-circle/index.d.ts +7 -0
- package/components/progress-circle/index.js +29 -0
- package/components/progress-circle/progress-circle.d.ts +35 -0
- package/components/progress-circle-DYSSkjlY.cjs +33 -0
- package/components/progress-circle-_-9sAlMM.js +97 -0
- package/components/query-BL-TJj7K.cjs +22 -0
- package/components/query-D_KR_GUc.js +51 -0
- package/components/query-assigned-elements-DjfhL1cl.js +36 -0
- package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
- package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
- package/components/query-assigned-nodes-C76XVPWY.js +36 -0
- package/components/radio/index.cjs +22 -0
- package/components/radio/index.d.ts +10 -0
- package/components/radio/index.js +191 -0
- package/components/radio/radio-group.d.ts +27 -0
- package/components/radio/radio.d.ts +39 -0
- package/components/random-id-ByCz1xaq.js +26 -0
- package/components/random-id-CqvckpWe.cjs +18 -0
- package/components/roving-tabindex-By_fCy_e.cjs +18 -0
- package/components/roving-tabindex-DOg4z6ZU.js +66 -0
- package/components/search/index.cjs +45 -0
- package/components/search/index.d.ts +7 -0
- package/components/search/index.js +131 -0
- package/components/search/search.d.ts +27 -0
- package/components/sized-mixin-BAI6NiE2.cjs +18 -0
- package/components/sized-mixin-DcJTTohI.js +63 -0
- package/components/slider/index.cjs +18 -0
- package/components/slider/index.d.ts +7 -0
- package/components/slider/index.js +1158 -0
- package/components/slider/slider.d.ts +24 -0
- package/components/slottable-request-event-BfUUt1Mh.cjs +18 -0
- package/components/slottable-request-event-DggLA4Rx.js +31 -0
- package/components/state-D8vot9IB.js +29 -0
- package/components/state-WWHLNMRG.cjs +22 -0
- package/components/streaming-listener-BbmNyKWO.js +125 -0
- package/components/streaming-listener-C2A7ZJZP.cjs +18 -0
- package/components/style-map-CoBJRbvu.js +53 -0
- package/components/style-map-DH0jkl7s.cjs +22 -0
- package/components/swatch/index.cjs +49 -0
- package/components/swatch/index.d.ts +10 -0
- package/components/swatch/index.js +342 -0
- package/components/swatch/swatch-group.d.ts +41 -0
- package/components/swatch/swatch.d.ts +40 -0
- package/components/switch/index.cjs +22 -0
- package/components/switch/index.d.ts +7 -0
- package/components/switch/index.js +73 -0
- package/components/switch/switch.d.ts +27 -0
- package/components/tags/index.cjs +32 -0
- package/components/tags/index.d.ts +10 -0
- package/components/tags/index.js +173 -0
- package/components/tags/tag.d.ts +29 -0
- package/components/tags/tags.d.ts +28 -0
- package/components/text-field/help-text-manager.d.ts +19 -0
- package/components/text-field/help-text.d.ts +20 -0
- package/components/text-field/index.cjs +21 -0
- package/components/text-field/index.d.ts +14 -0
- package/components/text-field/index.js +62 -0
- package/components/text-field/manage-help-text.d.ts +13 -0
- package/components/text-field/text-field.d.ts +142 -0
- package/components/text-field-05QNK_Lj.js +313 -0
- package/components/text-field-BU7yxiOR.cjs +85 -0
- package/components/toast/index.cjs +51 -0
- package/components/toast/index.d.ts +7 -0
- package/components/toast/index.js +153 -0
- package/components/toast/toast.d.ts +77 -0
- package/components/tooltip/index.cjs +45 -0
- package/components/tooltip/index.d.ts +8 -0
- package/components/tooltip/index.js +220 -0
- package/components/tooltip/tooltip-directive.d.ts +5 -0
- package/components/tooltip/tooltip.d.ts +55 -0
- package/components/unit-input/index.cjs +43 -0
- package/components/unit-input/index.d.ts +7 -0
- package/components/unit-input/index.js +183 -0
- package/components/unit-input/unit-input.d.ts +33 -0
- package/components/when-CDK1Tt5Y.js +28 -0
- package/components/when-CDZyJPvd.cjs +22 -0
- package/index.d.ts +39 -0
- package/package.json +139 -101
- package/utils/base.d.ts +16 -0
- package/utils/condition-attribute-with-id.d.ts +2 -0
- package/utils/first-focusable-in.d.ts +3 -0
- package/utils/focus-visible.d.ts +29 -0
- package/utils/focusable-selectors.d.ts +2 -0
- package/utils/focusable.d.ts +58 -0
- package/utils/get-css-variable.d.ts +1 -0
- package/utils/get-label-from-slot.d.ts +1 -0
- package/utils/like-anchor.d.ts +23 -0
- package/utils/observe-slot-presence.d.ts +12 -0
- package/utils/observe-slot-text.d.ts +11 -0
- package/utils/platform.d.ts +10 -0
- package/utils/random-id.d.ts +1 -0
- package/utils/reactive-controllers/color.d.ts +54 -0
- package/utils/reactive-controllers/dependency-manger.d.ts +26 -0
- package/utils/reactive-controllers/element-resolution.d.ts +23 -0
- package/utils/reactive-controllers/focus-group.d.ts +62 -0
- package/utils/reactive-controllers/language-resolution.d.ts +11 -0
- package/utils/reactive-controllers/match-media.d.ts +13 -0
- package/utils/reactive-controllers/pending-state.d.ts +41 -0
- package/utils/reactive-controllers/roving-tabindex.d.ts +19 -0
- package/utils/reparent-child.d.ts +4 -0
- package/utils/sized-mixin.d.ts +17 -0
- package/utils/streaming-listener.d.ts +48 -0
|
@@ -0,0 +1,735 @@
|
|
|
1
|
+
/*! * Lucero - The design system for Luzmo.
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 Luzmo
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
* Lucero (“Luzmo Design System”) must be used according to the Luzmo Terms of Service.
|
|
6
|
+
* This license allows users with a current active Luzmo account to use Lucero.
|
|
7
|
+
* This license terminates automatically if a user no longer has an active Luzmo account.
|
|
8
|
+
* Please view the Luzmo Terms of Service at: https://www.luzmo.com/information-pages/terms-of-use.
|
|
9
|
+
*
|
|
10
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
11
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
12
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
13
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
14
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
15
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
|
+
* SOFTWARE.
|
|
17
|
+
* */
|
|
18
|
+
import { luzmoIcon as S, luzmoAngleUp as K, luzmoAngleDown as W } from "@luzmo/icons";
|
|
19
|
+
import { r as Y, E as X, x as N, n as h } from "../base-CxUap9HL.js";
|
|
20
|
+
import { e as Z } from "../query-D_KR_GUc.js";
|
|
21
|
+
import { a as E, b as J, i as Q } from "../platform-DQYMG7JI.js";
|
|
22
|
+
import { L as ee, s as te, l as re } from "../streaming-listener-BbmNyKWO.js";
|
|
23
|
+
import "../infield-button/index.js";
|
|
24
|
+
import { a as oe } from "../text-field-05QNK_Lj.js";
|
|
25
|
+
const G = () => {
|
|
26
|
+
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
27
|
+
const s = document.createElement("style");
|
|
28
|
+
s.setAttribute("data-luzmo-vars", ""), s.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-color-disabled);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-color-negative: #ca221c;--luzmo-color-negative-hover: #b3241f;--luzmo-color-negative-down: #9f231f;--luzmo-color-negative-focus: #b3241f;--luzmo-color-negative-rgb: 202, 34, 28;--luzmo-color-positive: rgb(20, 150, 101);--luzmo-color-positive-hover: rgb(17, 128, 86);--luzmo-color-positive-down: rgb(16, 105, 71);--luzmo-color-positive-focus: rgb(17, 128, 86);--luzmo-color-positive-rgb: 20, 150, 101;--luzmo-color-selected: rgb(110, 110, 110);--luzmo-color-selected-hover: rgb(70, 70, 70);--luzmo-color-selected-down: rgb(40, 40, 40);--luzmo-color-selected-focus: rgb(70, 70, 70);--luzmo-color-selected-hard: #1e1e1e;--luzmo-color-selected-hard-hover: rgb(0, 0, 0);--luzmo-color-selected-hard-down: rgb(0, 0, 0);--luzmo-color-selected-hard-focus: rgb(0, 0, 0);--luzmo-color-informative: #1a77e9;--luzmo-color-informative-rgb: 26, 119, 233;--luzmo-color-disabled: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(s);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
G();
|
|
32
|
+
let w = /* @__PURE__ */ new Map(), F = !1;
|
|
33
|
+
try {
|
|
34
|
+
F = new Intl.NumberFormat("de-DE", {
|
|
35
|
+
signDisplay: "exceptZero"
|
|
36
|
+
}).resolvedOptions().signDisplay === "exceptZero";
|
|
37
|
+
} catch {
|
|
38
|
+
}
|
|
39
|
+
let z = !1;
|
|
40
|
+
try {
|
|
41
|
+
z = new Intl.NumberFormat("de-DE", {
|
|
42
|
+
style: "unit",
|
|
43
|
+
unit: "degree"
|
|
44
|
+
}).resolvedOptions().style === "unit";
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
const q = {
|
|
48
|
+
degree: {
|
|
49
|
+
narrow: {
|
|
50
|
+
default: "°",
|
|
51
|
+
"ja-JP": " 度",
|
|
52
|
+
"zh-TW": "度",
|
|
53
|
+
"sl-SI": " °"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
class g {
|
|
58
|
+
/** Formats a number value as a string, according to the locale and options provided to the constructor. */
|
|
59
|
+
format(e) {
|
|
60
|
+
let t = "";
|
|
61
|
+
if (!F && this.options.signDisplay != null ? t = se(this.numberFormatter, this.options.signDisplay, e) : t = this.numberFormatter.format(e), this.options.style === "unit" && !z) {
|
|
62
|
+
var r;
|
|
63
|
+
let { unit: o, unitDisplay: i = "short", locale: l } = this.resolvedOptions();
|
|
64
|
+
if (!o) return t;
|
|
65
|
+
let a = (r = q[o]) === null || r === void 0 ? void 0 : r[i];
|
|
66
|
+
t += a[l] || a.default;
|
|
67
|
+
}
|
|
68
|
+
return t;
|
|
69
|
+
}
|
|
70
|
+
/** Formats a number to an array of parts such as separators, digits, punctuation, and more. */
|
|
71
|
+
formatToParts(e) {
|
|
72
|
+
return this.numberFormatter.formatToParts(e);
|
|
73
|
+
}
|
|
74
|
+
/** Formats a number range as a string. */
|
|
75
|
+
formatRange(e, t) {
|
|
76
|
+
if (typeof this.numberFormatter.formatRange == "function") return this.numberFormatter.formatRange(e, t);
|
|
77
|
+
if (t < e) throw new RangeError("End date must be >= start date");
|
|
78
|
+
return `${this.format(e)} – ${this.format(t)}`;
|
|
79
|
+
}
|
|
80
|
+
/** Formats a number range as an array of parts. */
|
|
81
|
+
formatRangeToParts(e, t) {
|
|
82
|
+
if (typeof this.numberFormatter.formatRangeToParts == "function") return this.numberFormatter.formatRangeToParts(e, t);
|
|
83
|
+
if (t < e) throw new RangeError("End date must be >= start date");
|
|
84
|
+
let r = this.numberFormatter.formatToParts(e), o = this.numberFormatter.formatToParts(t);
|
|
85
|
+
return [
|
|
86
|
+
...r.map((i) => ({
|
|
87
|
+
...i,
|
|
88
|
+
source: "startRange"
|
|
89
|
+
})),
|
|
90
|
+
{
|
|
91
|
+
type: "literal",
|
|
92
|
+
value: " – ",
|
|
93
|
+
source: "shared"
|
|
94
|
+
},
|
|
95
|
+
...o.map((i) => ({
|
|
96
|
+
...i,
|
|
97
|
+
source: "endRange"
|
|
98
|
+
}))
|
|
99
|
+
];
|
|
100
|
+
}
|
|
101
|
+
/** Returns the resolved formatting options based on the values passed to the constructor. */
|
|
102
|
+
resolvedOptions() {
|
|
103
|
+
let e = this.numberFormatter.resolvedOptions();
|
|
104
|
+
return !F && this.options.signDisplay != null && (e = {
|
|
105
|
+
...e,
|
|
106
|
+
signDisplay: this.options.signDisplay
|
|
107
|
+
}), !z && this.options.style === "unit" && (e = {
|
|
108
|
+
...e,
|
|
109
|
+
style: "unit",
|
|
110
|
+
unit: this.options.unit,
|
|
111
|
+
unitDisplay: this.options.unitDisplay
|
|
112
|
+
}), e;
|
|
113
|
+
}
|
|
114
|
+
constructor(e, t = {}) {
|
|
115
|
+
this.numberFormatter = ie(e, t), this.options = t;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function ie(s, e = {}) {
|
|
119
|
+
let { numberingSystem: t } = e;
|
|
120
|
+
if (t && s.includes("-nu-") && (s.includes("-u-") || (s += "-u-"), s += `-nu-${t}`), e.style === "unit" && !z) {
|
|
121
|
+
var r;
|
|
122
|
+
let { unit: l, unitDisplay: a = "short" } = e;
|
|
123
|
+
if (!l) throw new Error('unit option must be provided with style: "unit"');
|
|
124
|
+
if (!(!((r = q[l]) === null || r === void 0) && r[a])) throw new Error(`Unsupported unit ${l} with unitDisplay = ${a}`);
|
|
125
|
+
e = {
|
|
126
|
+
...e,
|
|
127
|
+
style: "decimal"
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
let o = s + (e ? Object.entries(e).sort((l, a) => l[0] < a[0] ? -1 : 1).join() : "");
|
|
131
|
+
if (w.has(o)) return w.get(o);
|
|
132
|
+
let i = new Intl.NumberFormat(s, e);
|
|
133
|
+
return w.set(o, i), i;
|
|
134
|
+
}
|
|
135
|
+
function se(s, e, t) {
|
|
136
|
+
if (e === "auto") return s.format(t);
|
|
137
|
+
if (e === "never") return s.format(Math.abs(t));
|
|
138
|
+
{
|
|
139
|
+
let r = !1;
|
|
140
|
+
if (e === "always" ? r = t > 0 || Object.is(t, 0) : e === "exceptZero" && (Object.is(t, -0) || Object.is(t, 0) ? t = Math.abs(t) : r = t > 0), r) {
|
|
141
|
+
let o = s.format(-t), i = s.format(t), l = o.replace(i, "").replace(/\u200e|\u061C/, "");
|
|
142
|
+
return [
|
|
143
|
+
...l
|
|
144
|
+
].length !== 1 && console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"), o.replace(i, "!!!").replace(l, "+").replace("!!!", i);
|
|
145
|
+
} else return s.format(t);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
const le = new RegExp("^.*\\(.*\\).*$"), ae = [
|
|
149
|
+
"latn",
|
|
150
|
+
"arab",
|
|
151
|
+
"hanidec",
|
|
152
|
+
"deva",
|
|
153
|
+
"beng"
|
|
154
|
+
];
|
|
155
|
+
class $ {
|
|
156
|
+
/**
|
|
157
|
+
* Parses the given string to a number. Returns NaN if a valid number could not be parsed.
|
|
158
|
+
*/
|
|
159
|
+
parse(e) {
|
|
160
|
+
return k(this.locale, this.options, e).parse(e);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Returns whether the given string could potentially be a valid number. This should be used to
|
|
164
|
+
* validate user input as the user types. If a `minValue` or `maxValue` is provided, the validity
|
|
165
|
+
* of the minus/plus sign characters can be checked.
|
|
166
|
+
*/
|
|
167
|
+
isValidPartialNumber(e, t, r) {
|
|
168
|
+
return k(this.locale, this.options, e).isValidPartialNumber(e, t, r);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Returns a numbering system for which the given string is valid in the current locale.
|
|
172
|
+
* If no numbering system could be detected, the default numbering system for the current
|
|
173
|
+
* locale is returned.
|
|
174
|
+
*/
|
|
175
|
+
getNumberingSystem(e) {
|
|
176
|
+
return k(this.locale, this.options, e).options.numberingSystem;
|
|
177
|
+
}
|
|
178
|
+
constructor(e, t = {}) {
|
|
179
|
+
this.locale = e, this.options = t;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
const _ = /* @__PURE__ */ new Map();
|
|
183
|
+
function k(s, e, t) {
|
|
184
|
+
let r = D(s, e);
|
|
185
|
+
if (!s.includes("-nu-") && !r.isValidPartialNumber(t)) {
|
|
186
|
+
for (let o of ae) if (o !== r.options.numberingSystem) {
|
|
187
|
+
let i = D(s + (s.includes("-u-") ? "-nu-" : "-u-nu-") + o, e);
|
|
188
|
+
if (i.isValidPartialNumber(t)) return i;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return r;
|
|
192
|
+
}
|
|
193
|
+
function D(s, e) {
|
|
194
|
+
let t = s + (e ? Object.entries(e).sort((o, i) => o[0] < i[0] ? -1 : 1).join() : ""), r = _.get(t);
|
|
195
|
+
return r || (r = new ne(s, e), _.set(t, r)), r;
|
|
196
|
+
}
|
|
197
|
+
class ne {
|
|
198
|
+
parse(e) {
|
|
199
|
+
let t = this.sanitize(e);
|
|
200
|
+
if (this.symbols.group && (t = f(t, this.symbols.group, "")), this.symbols.decimal && (t = t.replace(this.symbols.decimal, ".")), this.symbols.minusSign && (t = t.replace(this.symbols.minusSign, "-")), t = t.replace(this.symbols.numeral, this.symbols.index), this.options.style === "percent") {
|
|
201
|
+
let l = t.indexOf("-");
|
|
202
|
+
t = t.replace("-", "");
|
|
203
|
+
let a = t.indexOf(".");
|
|
204
|
+
a === -1 && (a = t.length), t = t.replace(".", ""), a - 2 === 0 ? t = `0.${t}` : a - 2 === -1 ? t = `0.0${t}` : a - 2 === -2 ? t = "0.00" : t = `${t.slice(0, a - 2)}.${t.slice(a - 2)}`, l > -1 && (t = `-${t}`);
|
|
205
|
+
}
|
|
206
|
+
let r = t ? +t : NaN;
|
|
207
|
+
if (isNaN(r)) return NaN;
|
|
208
|
+
if (this.options.style === "percent") {
|
|
209
|
+
var o, i;
|
|
210
|
+
let l = {
|
|
211
|
+
...this.options,
|
|
212
|
+
style: "decimal",
|
|
213
|
+
minimumFractionDigits: Math.min(((o = this.options.minimumFractionDigits) !== null && o !== void 0 ? o : 0) + 2, 20),
|
|
214
|
+
maximumFractionDigits: Math.min(((i = this.options.maximumFractionDigits) !== null && i !== void 0 ? i : 0) + 2, 20)
|
|
215
|
+
};
|
|
216
|
+
return new $(this.locale, l).parse(new g(this.locale, l).format(r));
|
|
217
|
+
}
|
|
218
|
+
return this.options.currencySign === "accounting" && le.test(e) && (r = -1 * r), r;
|
|
219
|
+
}
|
|
220
|
+
sanitize(e) {
|
|
221
|
+
return e = e.replace(this.symbols.literals, ""), this.symbols.minusSign && (e = e.replace("-", this.symbols.minusSign)), this.options.numberingSystem === "arab" && (this.symbols.decimal && (e = e.replace(",", this.symbols.decimal), e = e.replace("،", this.symbols.decimal)), this.symbols.group && (e = f(e, ".", this.symbols.group))), this.options.locale === "fr-FR" && (e = f(e, ".", " ")), e;
|
|
222
|
+
}
|
|
223
|
+
isValidPartialNumber(e, t = -1 / 0, r = 1 / 0) {
|
|
224
|
+
return e = this.sanitize(e), this.symbols.minusSign && e.startsWith(this.symbols.minusSign) && t < 0 ? e = e.slice(this.symbols.minusSign.length) : this.symbols.plusSign && e.startsWith(this.symbols.plusSign) && r > 0 && (e = e.slice(this.symbols.plusSign.length)), this.symbols.group && e.startsWith(this.symbols.group) || this.symbols.decimal && e.indexOf(this.symbols.decimal) > -1 && this.options.maximumFractionDigits === 0 ? !1 : (this.symbols.group && (e = f(e, this.symbols.group, "")), e = e.replace(this.symbols.numeral, ""), this.symbols.decimal && (e = e.replace(this.symbols.decimal, "")), e.length === 0);
|
|
225
|
+
}
|
|
226
|
+
constructor(e, t = {}) {
|
|
227
|
+
this.locale = e, this.formatter = new Intl.NumberFormat(e, t), this.options = this.formatter.resolvedOptions(), this.symbols = ue(e, this.formatter, this.options, t);
|
|
228
|
+
var r, o;
|
|
229
|
+
this.options.style === "percent" && (((r = this.options.minimumFractionDigits) !== null && r !== void 0 ? r : 0) > 18 || ((o = this.options.maximumFractionDigits) !== null && o !== void 0 ? o : 0) > 18) && console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.");
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const V = /* @__PURE__ */ new Set([
|
|
233
|
+
"decimal",
|
|
234
|
+
"fraction",
|
|
235
|
+
"integer",
|
|
236
|
+
"minusSign",
|
|
237
|
+
"plusSign",
|
|
238
|
+
"group"
|
|
239
|
+
]), de = [
|
|
240
|
+
0,
|
|
241
|
+
4,
|
|
242
|
+
2,
|
|
243
|
+
1,
|
|
244
|
+
11,
|
|
245
|
+
20,
|
|
246
|
+
3,
|
|
247
|
+
7,
|
|
248
|
+
100,
|
|
249
|
+
21,
|
|
250
|
+
0.1,
|
|
251
|
+
1.1
|
|
252
|
+
];
|
|
253
|
+
function ue(s, e, t, r) {
|
|
254
|
+
var o, i, l, a;
|
|
255
|
+
let d = new Intl.NumberFormat(s, {
|
|
256
|
+
...t,
|
|
257
|
+
// Resets so we get the full range of symbols
|
|
258
|
+
minimumSignificantDigits: 1,
|
|
259
|
+
maximumSignificantDigits: 21,
|
|
260
|
+
roundingIncrement: 1,
|
|
261
|
+
roundingPriority: "auto",
|
|
262
|
+
roundingMode: "halfExpand"
|
|
263
|
+
}), u = d.formatToParts(-10000.111), b = d.formatToParts(10000.111), M = de.map((n) => d.formatToParts(n));
|
|
264
|
+
var y;
|
|
265
|
+
let O = (y = (o = u.find((n) => n.type === "minusSign")) === null || o === void 0 ? void 0 : o.value) !== null && y !== void 0 ? y : "-", x = (i = b.find((n) => n.type === "plusSign")) === null || i === void 0 ? void 0 : i.value;
|
|
266
|
+
!x && ((r == null ? void 0 : r.signDisplay) === "exceptZero" || (r == null ? void 0 : r.signDisplay) === "always") && (x = "+");
|
|
267
|
+
let A = (l = new Intl.NumberFormat(s, {
|
|
268
|
+
...t,
|
|
269
|
+
minimumFractionDigits: 2,
|
|
270
|
+
maximumFractionDigits: 2
|
|
271
|
+
}).formatToParts(1e-3).find((n) => n.type === "decimal")) === null || l === void 0 ? void 0 : l.value, L = (a = u.find((n) => n.type === "group")) === null || a === void 0 ? void 0 : a.value, U = u.filter((n) => !V.has(n.type)).map((n) => R(n.value)), T = M.flatMap((n) => n.filter((m) => !V.has(m.type)).map((m) => R(m.value))), P = [
|
|
272
|
+
.../* @__PURE__ */ new Set([
|
|
273
|
+
...U,
|
|
274
|
+
...T
|
|
275
|
+
])
|
|
276
|
+
].sort((n, m) => m.length - n.length), B = P.length === 0 ? new RegExp("[\\p{White_Space}]", "gu") : new RegExp(`${P.join("|")}|[\\p{White_Space}]`, "gu"), C = [
|
|
277
|
+
...new Intl.NumberFormat(t.locale, {
|
|
278
|
+
useGrouping: !1
|
|
279
|
+
}).format(9876543210)
|
|
280
|
+
].reverse(), j = new Map(C.map((n, m) => [
|
|
281
|
+
n,
|
|
282
|
+
m
|
|
283
|
+
])), H = new RegExp(`[${C.join("")}]`, "g");
|
|
284
|
+
return {
|
|
285
|
+
minusSign: O,
|
|
286
|
+
plusSign: x,
|
|
287
|
+
decimal: A,
|
|
288
|
+
group: L,
|
|
289
|
+
literals: B,
|
|
290
|
+
numeral: H,
|
|
291
|
+
index: (n) => String(j.get(n))
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function f(s, e, t) {
|
|
295
|
+
return s.replaceAll ? s.replaceAll(e, t) : s.split(e).join(t);
|
|
296
|
+
}
|
|
297
|
+
function R(s) {
|
|
298
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
299
|
+
}
|
|
300
|
+
const pe = '#text-field{--stepper-width: calc( var(--luzmo-stepper-height, var(--stepper-height)) * var( --luzmo-stepper-min-width-multiplier, var(--stepper-min-width-multiplier) ) + var(--luzmo-stepper-button-width, var(--stepper-button-width)) + var(--luzmo-stepper-border-width, var(--stepper-border-width)) * 2 );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color, var( --luzmo-stepper-buttons-border-color, var(--stepper-buttons-border-color) ) );--luzmo-infield-button-border-width: var( --luzmo-stepper-button-border-width, var(--stepper-button-border-width) );--luzmo-infield-button-border-radius-reset: var( --stepper-button-border-radius-reset );--luzmo-text-field-border-width: var( --luzmo-stepper-border-width, var(--stepper-border-width) );inline-size:var(--luzmo-stepper-width, var(--stepper-width));block-size:var(--luzmo-stepper-height, var(--stepper-height));border-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius));border-color:var(--highcontrast-stepper-border-color, var(--luzmo-stepper-border-color, var(--stepper-border-color)));flex-flow:row;display:inline-flex;position:relative}#text-field:after{content:"";inline-size:100%;block-size:var(--luzmo-stepper-focus-indicator-width, var(--stepper-focus-indicator-width));position:absolute;inset-block-end:calc((var(--luzmo-stepper-focus-indicator-gap, var(--stepper-focus-indicator-gap)) + var(--luzmo-stepper-focus-indicator-width, var(--stepper-focus-indicator-width))) * -1);inset-inline-start:0}:host([focused]) #text-field,#text-field:focus{--luzmo-stepper-border-color: var( --highcontrast-stepper-border-color-focus, var(--luzmo-stepper-border-color-focus, var(--stepper-border-color-focus)) );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-focus, var( --luzmo-stepper-buttons-border-color-focus, var(--stepper-buttons-border-color-focus) ) )}:host([focused]:not([disabled])) #text-field .input,:host(:not([disabled])) #text-field:focus .input{outline:none}:host([focused]:not([disabled])) #text-field .buttons,:host([focused]:not([disabled])) #text-field .input,:host(:not([disabled])) #text-field:focus .buttons,:host(:not([disabled])) #text-field:focus .input{border-color:var(--highcontrast-stepper-border-color-focus, var(--luzmo-stepper-border-color-focus, var(--stepper-border-color-focus)))}:host([keyboard-focused]) #text-field,#text-field:focus-visible{--luzmo-stepper-border-color: var( --highcontrast-stepper-border-color-keyboard-focus, var( --luzmo-stepper-buttons-border-color-keyboard-focus, var(--stepper-buttons-border-color-keyboard-focus) ) );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-keyboard-focus, var( --luzmo-stepper-buttons-border-color-keyboard-focus, var(--stepper-buttons-border-color-keyboard-focus) ) )}:host([keyboard-focused]:not([disabled])) #text-field,:host(:not([disabled])) #text-field:focus-visible{outline:var(--luzmo-stepper-focus-indicator-width, var(--stepper-focus-indicator-width)) solid;outline-color:var(--highcontrast-stepper-focus-indicator-color, var(--luzmo-stepper-focus-indicator-color, var(--stepper-focus-indicator-color)));outline-offset:var(--luzmo-stepper-focus-indicator-gap, var(--stepper-focus-indicator-gap))}:host([keyboard-focused]:not([disabled])) #text-field .input,:host(:not([disabled])) #text-field:focus-visible .input{outline:none}:host([keyboard-focused]:not([disabled])) #text-field .buttons,:host([keyboard-focused]:not([disabled])) #text-field .input,:host(:not([disabled])) #text-field:focus-visible .buttons,:host(:not([disabled])) #text-field:focus-visible .input{border-color:var(--highcontrast-stepper-border-color-keyboard-focus, var(--luzmo-stepper-border-color-keyboard-focus, var(--stepper-border-color-keyboard-focus)))}:host([invalid]:not([disabled])) #text-field{--luzmo-stepper-border-color: var( --luzmo-stepper-border-color-invalid, var(--stepper-border-color-invalid) );--luzmo-stepper-border-color-hover: var( --luzmo-stepper-border-color-hover-invalid, var(--stepper-border-color-hover-invalid) );--luzmo-stepper-border-color-focus: var( --luzmo-stepper-border-color-focus-invalid, var(--stepper-border-color-focus-invalid) );--luzmo-stepper-border-color-focus-hover: var( --luzmo-stepper-border-color-focus-hover-invalid, var(--stepper-border-color-focus-hover-invalid) );--luzmo-stepper-border-color-keyboard-focus: var( --luzmo-stepper-border-color-keyboard-focus-invalid, var(--stepper-border-color-keyboard-focus-invalid) );--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-invalid, var(--stepper-border-color-invalid) );--luzmo-text-field-icon-spacing-inline-start-invalid: 0}:host([invalid][focused]:not([disabled])) #text-field,:host([invalid]:not([disabled])) #text-field:focus{--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-focus-invalid, var(--stepper-border-color-focus-invalid) )}:host([invalid][keyboard-focused]:not([disabled])) #text-field,:host([invalid]:not([disabled])) #text-field:focus-visible{--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-keyboard-focus-invalid, var(--stepper-border-color-keyboard-focus-invalid) )}:host([disabled]) #text-field{--luzmo-stepper-border-color: var(--stepper-button-border-color-disabled);--luzmo-stepper-border-color-hover: var( --stepper-button-border-color-disabled );--luzmo-stepper-border-color-focus: var( --stepper-button-border-color-disabled );--luzmo-stepper-border-color-focus-hover: var( --stepper-button-border-color-disabled );--luzmo-stepper-border-color-keyboard-focus: var( --stepper-button-border-color-disabled );--luzmo-stepper-buttons-background-color: var( --stepper-buttons-background-color-disabled );--luzmo-infield-button-border-width: var( --stepper-button-border-width-disabled );--luzmo-infield-button-border-color: var( --stepper-button-border-color-disabled );--luzmo-text-field-border-color-disabled: var( --stepper-button-border-color-disabled )}#text-field .input{border-color:var(--highcontrast-stepper-border-color, var(--luzmo-stepper-border-color, var(--stepper-border-color)));border-inline-end-width:0;border-start-end-radius:0;border-end-end-radius:0}#text-field.hide-stepper .input{border-inline-end-width:var(--luzmo-stepper-border-width, var(--stepper-border-width));border-start-end-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius));border-end-end-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius))}#text-field .buttons{box-sizing:border-box;block-size:var(--luzmo-stepper-height, var(--stepper-height));inline-size:var(--luzmo-stepper-button-width, var(--stepper-button-width));border-color:var(--highcontrast-stepper-border-color, var(--luzmo-stepper-border-color, var(--stepper-border-color)));border-style:var(--luzmo-stepper-buttons-border-style, var(--stepper-buttons-border-style));border-width:var(--highcontrast-stepper-buttons-border-width, var(--luzmo-stepper-buttons-border-width, var(--stepper-buttons-border-width)));background-color:var(--highcontrast-stepper-buttons-background-color, var(--luzmo-stepper-buttons-background-color, var(--stepper-buttons-background-color)));transition:border-color var(--luzmo-stepper-animation-duration, var(--stepper-animation-duration)) ease-in-out;border-inline-start-width:0;border-start-end-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius));border-end-end-radius:var(--luzmo-stepper-border-radius, var(--stepper-border-radius));flex-direction:column;justify-content:center;display:flex}:host([quiet]) #text-field{border-start-start-radius:0;border-start-end-radius:0;border-end-end-radius:0;border-end-start-radius:0}:host([quiet]) #text-field .input{--luzmo-text-field-focus-indicator-color: transparent}:host([quiet]) #text-field.hide-stepper .input{border-inline-end-width:0;border-end-end-radius:0}:host([quiet]) #text-field .buttons{--luzmo-infield-button-border-color: transparent;border-width:0;border-block-end-width:var(--luzmo-stepper-border-width, var(--stepper-border-width));border-block-end-color:var(--highcontrast-stepper-border-color, var(--luzmo-stepper-border-color, var(--stepper-border-color)));border-block-end-style:solid;border-end-end-radius:0}:host([quiet]) #text-field .button{--luzmo-infield-button-width-stacked: var( --luzmo-stepper-button-width-quiet, var(--stepper-button-width) );--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-quiet, var(--stepper-button-border-color-quiet) );--luzmo-infield-button-stacked-bottom-border-block-end-width: var( --luzmo-stepper-border-width, var(--stepper-border-width) );--luzmo-infield-button-stacked-bottom-border-radius-end-end: 0;--luzmo-infield-button-stacked-bottom-border-radius-end-start: 0;--luzmo-infield-button-fill-justify-content: flex-end;padding:0}:host([quiet]) #text-field .buttons,:host([quiet]) #text-field .input{background-color:initial}:host([quiet][focused]) #text-field,:host([quiet]) #text-field:focus{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-focus, var(--luzmo-stepper-border-color-focus, var(--stepper-border-color-focus)) )}:host([quiet][keyboard-focused]:not([disabled])) #text-field{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-keyboard-focus, var( --luzmo-stepper-border-color-keyboard-focus, var(--stepper-border-color-keyboard-focus) ) );outline:none}:host([quiet][keyboard-focused]:not([disabled])) #text-field:after{background-color:var(--highcontrast-stepper-focus-indicator-color, var(--luzmo-stepper-focus-indicator-color, var(--stepper-focus-indicator-color)))}@media (hover: hover){:host(:hover:not([disabled])) #text-field{--luzmo-stepper-border-color: var( --highcontrast-stepper-border-color-hover, var(--luzmo-stepper-border-color-hover, var(--stepper-border-color-hover)) );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-hover, var( --luzmo-stepper-buttons-border-color-hover, var(--stepper-buttons-border-color-hover) ) )}:host([focused]:hover) #text-field,:host(:hover) #text-field:focus{--luzmo-stepper-border-color: var( --highcontrast-stepper-border-color-focus-hover, var( --luzmo-stepper-buttons-border-color-focus-hover, var(--stepper-buttons-border-color-focus-hover) ) );--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-focus-hover, var( --luzmo-stepper-buttons-border-color-focus-hover, var(--stepper-buttons-border-color-focus-hover) ) )}:host([focused]:hover) #text-field .buttons,:host([focused]:hover) #text-field .input,:host(:hover) #text-field:focus .buttons,:host(:hover) #text-field:focus .input{border-color:var(--highcontrast-stepper-border-color-focus-hover, var(--luzmo-stepper-border-color-focus-hover, var(--stepper-border-color-focus-hover)))}:host([invalid]:not([disabled]):hover) #text-field{--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-hover-invalid, var(--stepper-border-color-hover-invalid) )}:host([invalid][focused]:not([disabled]):hover) #text-field,:host([invalid]:not([disabled]):hover) #text-field:focus{--luzmo-infield-button-border-color: var( --luzmo-stepper-border-color-focus-hover-invalid, var(--stepper-border-color-focus-hover-invalid) )}:host([quiet]:not([disabled]):hover) #text-field{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-hover, var(--luzmo-stepper-border-color-hover, var(--stepper-border-color-hover)) )}:host([quiet]:not([disabled]):hover) #text-field .buttons{background-color:initial}:host([quiet][focused]:hover) #text-field,:host([quiet]:hover) #text-field:focus{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-focus-hover, var( --luzmo-stepper-border-color-focus-hover, var(--stepper-border-color-focus-hover) ) )}:host([quiet][keyboard-focused]:not([disabled]):hover) #text-field{--luzmo-infield-button-border-color: var( --highcontrast-stepper-border-color-hover, var(--luzmo-stepper-border-color-hover, var(--stepper-border-color-hover)) )}}@media (forced-colors: active){:host{--highcontrast-stepper-border-color: CanvasText;--highcontrast-stepper-border-color-hover: Highlight;--highcontrast-stepper-border-color-focus: Highlight;--highcontrast-stepper-border-color-focus-hover: Highlight;--highcontrast-stepper-border-color-keyboard-focus: CanvasText;--highcontrast-stepper-button-background-color-default: Canvas;--highcontrast-stepper-button-background-color-hover: Canvas;--highcontrast-stepper-button-background-color-focus: Canvas;--highcontrast-stepper-button-background-color-keyboard-focus: Canvas;--highcontrast-stepper-focus-indicator-color: Highlight}:host([invalid]) #text-field{--highcontrast-stepper-border-color: Highlight;--highcontrast-stepper-border-color-hover: Highlight;--highcontrast-stepper-border-color-focus: Highlight;--highcontrast-stepper-border-color-focus-hover: Highlight;--highcontrast-stepper-border-color-keyboard-focus: Highlight;--highcontrast-infield-button-border-color: Highlight}:host([disabled]) #text-field{--highcontrast-stepper-border-color: GrayText;--highcontrast-infield-button-border-color: GrayText;--highcontrast-stepper-buttons-border-width: var( --luzmo-stepper-border-width, var(--stepper-border-width) )}}:host{--text-field-minimum-width-multiplier: 1.75;--stepper-border-width: var(--luzmo-border-width);--stepper-border-color: var(--luzmo-border-color);--stepper-border-color-hover: var(--luzmo-border-color-full-hover);--stepper-border-color-focus: var(--luzmo-border-color-full-focus);--stepper-border-color-focus-hover: var(--luzmo-border-color-full-focus);--stepper-border-color-keyboard-focus: var(--luzmo-border-color-full-focus);--stepper-border-radius: var(--luzmo-border-radius-s);--stepper-min-width-multiplier: 1.5;--stepper-animation-duration: var(--luzmo-animation-duration);--stepper-buttons-background-color: var(--luzmo-background-color);--stepper-buttons-border-style: none;--stepper-buttons-border-width: 0;--stepper-buttons-border-color: var(--luzmo-border-color);--stepper-buttons-border-color-hover: var(--luzmo-border-color-full-hover);--stepper-buttons-border-color-focus: var(--luzmo-border-color-full-focus);--stepper-buttons-border-color-keyboard-focus: var( --luzmo-border-color-focus );--stepper-button-padding: 0px;--stepper-button-border-radius-reset: 0;--stepper-button-border-width: var(--luzmo-border-width);--stepper-button-background-color-focus: var(--luzmo-background-color-focus);--stepper-button-background-color-keyboard-focus: var( --luzmo-background-color-focus );--stepper-border-color-invalid: var(--luzmo-color-negative);--stepper-border-color-hover-invalid: var(--luzmo-color-negative-hover);--stepper-border-color-focus-invalid: var(--luzmo-color-negative-focus);--stepper-border-color-focus-hover-invalid: var(--luzmo-color-negative-focus);--stepper-border-color-keyboard-focus-invalid: var( --luzmo-color-negative-focus );--stepper-focus-indicator-width: var(--luzmo-indicator-width);--stepper-focus-indicator-gap: calc(-1 * var(--luzmo-border-width));--stepper-focus-indicator-color: var(--luzmo-indicator-color);--stepper-button-border-color-quiet: transparent;--stepper-button-border-color-disabled: var(--luzmo-border-color-disabled);--stepper-button-border-width-disabled: var(--luzmo-border-width);--stepper-buttons-background-color-disabled: var( --luzmo-background-color-disabled );--stepper-button-width: 28px;--stepper-height: var(--luzmo-component-height)}:host([size=s]) #text-field{--stepper-button-width: 16px;--stepper-height: var(--luzmo-component-height-s)}:host([size=m]) #text-field{--stepper-button-width: 20px;--stepper-height: var(--luzmo-component-height)}:host([size=l]) #text-field{--stepper-button-width: 28px;--stepper-height: var(--luzmo-component-height-l)}:host([size=xl]) #text-field{--stepper-button-width: 36px;--stepper-height: var(--luzmo-component-height-xl)}:host{inline-size:var(--luzmo-stepper-width, var(--stepper-width));--swc-number-field-width: calc( var(--luzmo-stepper-height, var(--stepper-height)) * var( --luzmo-stepper-min-width-multiplier, var(--text-field-minimum-width-multiplier) ) + var(--luzmo-stepper-button-width, var(--stepper-button-width)) + var(--luzmo-stepper-border-width, var(--stepper-border-width)) * 2 );--luzmo-infield-button-border-width: var(--unset-value-resets-inheritance);--stepper-width: var(--swc-number-field-width)}:host([size=s]){--stepper-width: calc(var(--swc-number-field-width) / 5 * 4)}:host([size=l]){--stepper-width: calc(var(--swc-number-field-width) * 1.25)}:host([size=xl]){--stepper-width: calc(var(--swc-number-field-width) * 1.25 * 1.25)}#text-field{inline-size:100%}.input{font-variant-numeric:tabular-nums}:host([readonly]) .buttons{pointer-events:none;visibility:hidden}:host([readonly]:not([disabled],[invalid],[focused],[keyboard-focused])) #text-field:hover .input{border-color:transparent}:host([hide-stepper]:not([quiet])) #text-field input{border:var(--luzmo-text-field-border-width, var(--text-field-border-width)) solid var(--luzmo-text-field-border-color, var(--text-field-border-color));border-radius:var(--text-field-corner-radius)}:host([quiet]) #text-field .button{--luzmo-infield-button-border-color: var( --luzmo-infield-border-color-quiet, transparent );--luzmo-infield-button-edge-to-fill: 0;--luzmo-infield-button-border-width: var( --luzmo-infield-button-border-width-quiet, 0 )}';
|
|
301
|
+
var ce = Object.defineProperty, he = Object.getOwnPropertyDescriptor, c = (s, e, t, r) => {
|
|
302
|
+
for (var o = r > 1 ? void 0 : r ? he(e, t) : e, i = s.length - 1, l; i >= 0; i--)
|
|
303
|
+
(l = s[i]) && (o = (r ? l(e, t, o) : l(o)) || o);
|
|
304
|
+
return r && o && ce(e, t, o), o;
|
|
305
|
+
};
|
|
306
|
+
const me = 5, be = 100, v = "-", I = {
|
|
307
|
+
"1": "1",
|
|
308
|
+
"2": "2",
|
|
309
|
+
"3": "3",
|
|
310
|
+
"4": "4",
|
|
311
|
+
"5": "5",
|
|
312
|
+
"6": "6",
|
|
313
|
+
"7": "7",
|
|
314
|
+
"8": "8",
|
|
315
|
+
"9": "9",
|
|
316
|
+
"0": "0",
|
|
317
|
+
"、": ",",
|
|
318
|
+
",": ",",
|
|
319
|
+
"。": ".",
|
|
320
|
+
".": ".",
|
|
321
|
+
"%": "%",
|
|
322
|
+
"+": "+",
|
|
323
|
+
ー: "-",
|
|
324
|
+
一: "1",
|
|
325
|
+
二: "2",
|
|
326
|
+
三: "3",
|
|
327
|
+
四: "4",
|
|
328
|
+
五: "5",
|
|
329
|
+
六: "6",
|
|
330
|
+
七: "7",
|
|
331
|
+
八: "8",
|
|
332
|
+
九: "9",
|
|
333
|
+
零: "0"
|
|
334
|
+
};
|
|
335
|
+
class p extends oe {
|
|
336
|
+
constructor() {
|
|
337
|
+
super(...arguments), this.focused = !1, this._forcedUnit = "", this.formatOptions = {}, this.hideStepper = !1, this.indeterminate = !1, this.keyboardFocused = !1, this.managedInput = !1, this.stepModifier = 10, this._value = Number.NaN, this._trackingValue = "", this.decimalsChars = /* @__PURE__ */ new Set([".", ","]), this.valueBeforeFocus = "", this.isIntentDecimal = !1, this.changeCount = 0, this.languageResolver = new ee(this), this.wasIndeterminate = !1, this.hasRecentlyReceivedPointerDown = !1, this.applyFocusElementLabel = (e) => {
|
|
338
|
+
this.appliedLabel = e;
|
|
339
|
+
}, this.isComposing = !1;
|
|
340
|
+
}
|
|
341
|
+
static get styles() {
|
|
342
|
+
return [...super.styles, Y(pe)];
|
|
343
|
+
}
|
|
344
|
+
set value(e) {
|
|
345
|
+
const t = this.validateInput(e);
|
|
346
|
+
if (t === this.value)
|
|
347
|
+
return;
|
|
348
|
+
this.lastCommitedValue = t;
|
|
349
|
+
const r = this._value;
|
|
350
|
+
this._value = t, this.requestUpdate("value", r);
|
|
351
|
+
}
|
|
352
|
+
get value() {
|
|
353
|
+
return this._value;
|
|
354
|
+
}
|
|
355
|
+
get inputValue() {
|
|
356
|
+
return this.indeterminate ? this.formattedValue : this.inputElement.value;
|
|
357
|
+
}
|
|
358
|
+
setValue(e = this.value) {
|
|
359
|
+
const t = this.lastCommitedValue;
|
|
360
|
+
this.value = e, !(t === void 0 || t === this.value) && (this.lastCommitedValue = this.value, this.dispatchEvent(new Event("change", { bubbles: !0, composed: !0 })));
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Retreive the value of the element parsed to a Number.
|
|
364
|
+
*/
|
|
365
|
+
get valueAsString() {
|
|
366
|
+
return this._value.toString();
|
|
367
|
+
}
|
|
368
|
+
set valueAsString(e) {
|
|
369
|
+
this.value = this.numberParser.parse(e);
|
|
370
|
+
}
|
|
371
|
+
get formattedValue() {
|
|
372
|
+
return Number.isNaN(this.value) ? "" : this.numberFormatter.format(this.value) + (this.focused ? "" : this._forcedUnit);
|
|
373
|
+
}
|
|
374
|
+
convertValueToNumber(e) {
|
|
375
|
+
let t = [...e].map((i) => I[i] || i).join("");
|
|
376
|
+
const r = [...this.valueBeforeFocus].filter(
|
|
377
|
+
(i) => this.decimalsChars.has(i)
|
|
378
|
+
), o = new Set(r);
|
|
379
|
+
if (E() && this.inputElement.inputMode === "decimal" && t !== this.valueBeforeFocus) {
|
|
380
|
+
const l = this.numberFormatter.formatToParts(1000.1).find(
|
|
381
|
+
(u) => u.type === "decimal"
|
|
382
|
+
).value;
|
|
383
|
+
for (const u of o)
|
|
384
|
+
!(u === l) && !this.isIntentDecimal && (t = t.replaceAll(
|
|
385
|
+
new RegExp(u, "g"),
|
|
386
|
+
""
|
|
387
|
+
));
|
|
388
|
+
let a = !1;
|
|
389
|
+
const d = [...t];
|
|
390
|
+
for (let u = d.length - 1; u >= 0; u--) {
|
|
391
|
+
const b = d[u];
|
|
392
|
+
this.decimalsChars.has(b) && (a ? d[u] = "" : (d[u] = l, a = !0));
|
|
393
|
+
}
|
|
394
|
+
t = d.join("");
|
|
395
|
+
}
|
|
396
|
+
return this.numberParser.parse(t);
|
|
397
|
+
}
|
|
398
|
+
get _step() {
|
|
399
|
+
var e;
|
|
400
|
+
return this.step !== void 0 ? this.step : ((e = this.formatOptions) == null ? void 0 : e.style) === "percent" ? 0.01 : 1;
|
|
401
|
+
}
|
|
402
|
+
handlePointerdown(e) {
|
|
403
|
+
if (e.button !== 0) {
|
|
404
|
+
e.preventDefault();
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
this.managedInput = !0, this.buttons.setPointerCapture(e.pointerId);
|
|
408
|
+
const t = this.buttons.children[0].getBoundingClientRect(), r = this.buttons.children[1].getBoundingClientRect();
|
|
409
|
+
this.findChange = (o) => {
|
|
410
|
+
o.clientX >= t.x && o.clientY >= t.y && o.clientX <= t.x + t.width && o.clientY <= t.y + t.height ? this.change = (i) => this.increment(i.shiftKey ? this.stepModifier : 1) : o.clientX >= r.x && o.clientY >= r.y && o.clientX <= r.x + r.width && o.clientY <= r.y + r.height && (this.change = (i) => this.decrement(i.shiftKey ? this.stepModifier : 1));
|
|
411
|
+
}, this.findChange(e), this.startChange(e);
|
|
412
|
+
}
|
|
413
|
+
startChange(e) {
|
|
414
|
+
this.changeCount = 0, this.doChange(e), this.safty = setTimeout(() => {
|
|
415
|
+
this.doNextChange(e);
|
|
416
|
+
}, 400);
|
|
417
|
+
}
|
|
418
|
+
doChange(e) {
|
|
419
|
+
this.change(e);
|
|
420
|
+
}
|
|
421
|
+
handlePointermove(e) {
|
|
422
|
+
this.findChange(e);
|
|
423
|
+
}
|
|
424
|
+
handlePointerup(e) {
|
|
425
|
+
this.buttons.releasePointerCapture(e.pointerId), cancelAnimationFrame(this.nextChange), clearTimeout(this.safty), this.managedInput = !1, this.setValue();
|
|
426
|
+
}
|
|
427
|
+
doNextChange(e) {
|
|
428
|
+
return this.changeCount += 1, this.changeCount % me === 0 && this.doChange(e), requestAnimationFrame(() => {
|
|
429
|
+
this.nextChange = this.doNextChange(e);
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
stepBy(e) {
|
|
433
|
+
if (this.disabled || this.readonly)
|
|
434
|
+
return;
|
|
435
|
+
const t = this.min === void 0 ? 0 : this.min;
|
|
436
|
+
let r = this.value;
|
|
437
|
+
r += e * this._step, Number.isNaN(this.value) && (r = t), r = this.valueWithLimits(r), this.requestUpdate(), this._value = this.validateInput(r), this.inputElement.value = this.numberFormatter.format(r), this.inputElement.dispatchEvent(
|
|
438
|
+
new Event("input", { bubbles: !0, composed: !0 })
|
|
439
|
+
), this.indeterminate = !1, this.focus();
|
|
440
|
+
}
|
|
441
|
+
increment(e = 1) {
|
|
442
|
+
this.stepBy(1 * e);
|
|
443
|
+
}
|
|
444
|
+
decrement(e = 1) {
|
|
445
|
+
this.stepBy(-1 * e);
|
|
446
|
+
}
|
|
447
|
+
handleKeydown(e) {
|
|
448
|
+
if (!this.isComposing)
|
|
449
|
+
switch (e.code) {
|
|
450
|
+
case "ArrowUp": {
|
|
451
|
+
e.preventDefault(), this.increment(e.shiftKey ? this.stepModifier : 1), this.setValue();
|
|
452
|
+
break;
|
|
453
|
+
}
|
|
454
|
+
case "ArrowDown": {
|
|
455
|
+
e.preventDefault(), this.decrement(e.shiftKey ? this.stepModifier : 1), this.setValue();
|
|
456
|
+
break;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
onScroll(e) {
|
|
461
|
+
e.preventDefault(), this.managedInput = !0;
|
|
462
|
+
const t = e.shiftKey ? e.deltaX / Math.abs(e.deltaX) : e.deltaY / Math.abs(e.deltaY);
|
|
463
|
+
t !== 0 && !Number.isNaN(t) && (this.stepBy(t * (e.shiftKey ? this.stepModifier : 1)), clearTimeout(this.queuedChangeEvent), this.queuedChangeEvent = setTimeout(() => {
|
|
464
|
+
this.setValue();
|
|
465
|
+
}, be)), this.managedInput = !1;
|
|
466
|
+
}
|
|
467
|
+
onFocus() {
|
|
468
|
+
super.onFocus(), this._trackingValue = this.inputValue, this.keyboardFocused = !this.readonly && !0, this.addEventListener("wheel", this.onScroll, { passive: !1 }), this.valueBeforeFocus = this.inputElement.value;
|
|
469
|
+
}
|
|
470
|
+
onBlur(e) {
|
|
471
|
+
super.onBlur(e), this.keyboardFocused = !this.readonly && !1, this.removeEventListener("wheel", this.onScroll), this.isIntentDecimal = !1;
|
|
472
|
+
}
|
|
473
|
+
handleFocusin() {
|
|
474
|
+
this.focused = !this.readonly && !0, this.keyboardFocused = !this.readonly && !0;
|
|
475
|
+
}
|
|
476
|
+
handleFocusout() {
|
|
477
|
+
this.focused = !this.readonly && !1, this.keyboardFocused = !this.readonly && !1;
|
|
478
|
+
}
|
|
479
|
+
handleChange() {
|
|
480
|
+
const e = this.convertValueToNumber(this.inputValue);
|
|
481
|
+
if (this.wasIndeterminate && (this.wasIndeterminate = !1, this.indeterminateValue = void 0, Number.isNaN(e))) {
|
|
482
|
+
this.indeterminate = !0;
|
|
483
|
+
return;
|
|
484
|
+
}
|
|
485
|
+
this.setValue(e), this.inputElement.value = this.formattedValue;
|
|
486
|
+
}
|
|
487
|
+
handleCompositionStart() {
|
|
488
|
+
this.isComposing = !0;
|
|
489
|
+
}
|
|
490
|
+
handleCompositionEnd() {
|
|
491
|
+
this.isComposing = !1, requestAnimationFrame(() => {
|
|
492
|
+
this.inputElement.dispatchEvent(
|
|
493
|
+
new Event("input", {
|
|
494
|
+
composed: !0,
|
|
495
|
+
bubbles: !0
|
|
496
|
+
})
|
|
497
|
+
);
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
handleInputElementPointerdown() {
|
|
501
|
+
this.hasRecentlyReceivedPointerDown = !0, this.updateComplete.then(() => {
|
|
502
|
+
requestAnimationFrame(() => {
|
|
503
|
+
this.hasRecentlyReceivedPointerDown = !1;
|
|
504
|
+
});
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
handleInput(e) {
|
|
508
|
+
if (this.isComposing) {
|
|
509
|
+
if (e.data) {
|
|
510
|
+
const d = this.convertValueToNumber(e.data);
|
|
511
|
+
Number.isNaN(d) && (this.inputElement.value = this.indeterminate ? v : this._trackingValue, this.isComposing = !1);
|
|
512
|
+
}
|
|
513
|
+
e.stopPropagation();
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
this.indeterminate && (this.wasIndeterminate = !0, this.indeterminateValue = this.value, this.inputElement.value = this.inputElement.value.replace(
|
|
517
|
+
v,
|
|
518
|
+
""
|
|
519
|
+
)), e.data && this.decimalsChars.has(e.data) && (this.isIntentDecimal = !0);
|
|
520
|
+
const { value: t, selectionStart: r } = this.inputElement, o = [...t].map((d) => I[d] || d).join("");
|
|
521
|
+
if (this.numberParser.isValidPartialNumber(o)) {
|
|
522
|
+
this.lastCommitedValue = this.lastCommitedValue ?? this.value;
|
|
523
|
+
const d = this.convertValueToNumber(o);
|
|
524
|
+
!o && this.indeterminateValue ? (this.indeterminate = !0, this._value = this.indeterminateValue) : (this.indeterminate = !1, this._value = this.validateInput(d)), this._trackingValue = o, this.inputElement.value = o, this.inputElement.setSelectionRange(r, r);
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
this.inputElement.value = this.indeterminate ? v : this._trackingValue, e.stopPropagation();
|
|
528
|
+
const i = o.length, l = this._trackingValue.length, a = (r || i) - (i - l);
|
|
529
|
+
this.inputElement.setSelectionRange(a, a);
|
|
530
|
+
}
|
|
531
|
+
valueWithLimits(e) {
|
|
532
|
+
let t = e;
|
|
533
|
+
return this.min !== void 0 && (t = Math.max(this.min, t)), this.max !== void 0 && (t = Math.min(this.max, t)), t;
|
|
534
|
+
}
|
|
535
|
+
validateInput(e) {
|
|
536
|
+
e = this.valueWithLimits(e);
|
|
537
|
+
const t = e < 0 ? -1 : 1;
|
|
538
|
+
if (e *= t, this.step) {
|
|
539
|
+
const r = this.min === void 0 ? 0 : this.min, o = Number.parseFloat(
|
|
540
|
+
this.valueFormatter.format((e - r) % this.step)
|
|
541
|
+
);
|
|
542
|
+
if (o === 0 || (Math.round(o / this.step) === 1 ? e += this.step - o : e -= o), this.max !== void 0)
|
|
543
|
+
for (; e > this.max; )
|
|
544
|
+
e -= this.step;
|
|
545
|
+
e = Number.parseFloat(this.valueFormatter.format(e));
|
|
546
|
+
}
|
|
547
|
+
return e *= t, e;
|
|
548
|
+
}
|
|
549
|
+
get displayValue() {
|
|
550
|
+
const e = this.focused ? "" : v;
|
|
551
|
+
return this.indeterminate ? e : this.formattedValue;
|
|
552
|
+
}
|
|
553
|
+
clearNumberFormatterCache() {
|
|
554
|
+
this._numberFormatter = void 0, this._numberParser = void 0;
|
|
555
|
+
}
|
|
556
|
+
get numberFormatter() {
|
|
557
|
+
if (!this._numberFormatter || !this._numberFormatterFocused) {
|
|
558
|
+
const {
|
|
559
|
+
style: e,
|
|
560
|
+
unit: t,
|
|
561
|
+
unitDisplay: r,
|
|
562
|
+
...o
|
|
563
|
+
} = this.formatOptions;
|
|
564
|
+
e !== "unit" && (o.style = e), this._numberFormatterFocused = new g(
|
|
565
|
+
this.languageResolver.language,
|
|
566
|
+
o
|
|
567
|
+
);
|
|
568
|
+
try {
|
|
569
|
+
this._numberFormatter = new g(
|
|
570
|
+
this.languageResolver.language,
|
|
571
|
+
this.formatOptions
|
|
572
|
+
), this._forcedUnit = "", this._numberFormatter.format(1);
|
|
573
|
+
} catch {
|
|
574
|
+
e === "unit" && (this._forcedUnit = t), this._numberFormatter = this._numberFormatterFocused;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return this.focused ? this._numberFormatterFocused : this._numberFormatter;
|
|
578
|
+
}
|
|
579
|
+
clearValueFormatterCache() {
|
|
580
|
+
this._valueFormatter = void 0;
|
|
581
|
+
}
|
|
582
|
+
get valueFormatter() {
|
|
583
|
+
if (!this._valueFormatter) {
|
|
584
|
+
const e = this.step ? this.step === Math.floor(this.step) ? 0 : this.step.toString().split(".")[1].length : 0;
|
|
585
|
+
this._valueFormatter = new g("en", {
|
|
586
|
+
useGrouping: !1,
|
|
587
|
+
maximumFractionDigits: e
|
|
588
|
+
});
|
|
589
|
+
}
|
|
590
|
+
return this._valueFormatter;
|
|
591
|
+
}
|
|
592
|
+
get numberParser() {
|
|
593
|
+
if (!this._numberParser || !this._numberParserFocused) {
|
|
594
|
+
const {
|
|
595
|
+
style: e,
|
|
596
|
+
unit: t,
|
|
597
|
+
unitDisplay: r,
|
|
598
|
+
...o
|
|
599
|
+
} = this.formatOptions;
|
|
600
|
+
e !== "unit" && (o.style = e), this._numberParserFocused = new $(
|
|
601
|
+
this.languageResolver.language,
|
|
602
|
+
o
|
|
603
|
+
);
|
|
604
|
+
try {
|
|
605
|
+
this._numberParser = new $(
|
|
606
|
+
this.languageResolver.language,
|
|
607
|
+
this.formatOptions
|
|
608
|
+
), this._forcedUnit = "", this._numberParser.parse("0");
|
|
609
|
+
} catch {
|
|
610
|
+
e === "unit" && (this._forcedUnit = t), this._numberParser = this._numberParserFocused;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return this.focused ? this._numberParserFocused : this._numberParser;
|
|
614
|
+
}
|
|
615
|
+
renderField() {
|
|
616
|
+
return this.autocomplete = "off", N`
|
|
617
|
+
${super.renderField()}
|
|
618
|
+
${this.hideStepper ? X : N`
|
|
619
|
+
<span
|
|
620
|
+
class="buttons"
|
|
621
|
+
@focusin=${this.handleFocusin}
|
|
622
|
+
@focusout=${this.handleFocusout}
|
|
623
|
+
${te({
|
|
624
|
+
start: ["pointerdown", this.handlePointerdown],
|
|
625
|
+
streamInside: [
|
|
626
|
+
[
|
|
627
|
+
"pointermove",
|
|
628
|
+
"pointerenter",
|
|
629
|
+
"pointerleave",
|
|
630
|
+
"pointerover",
|
|
631
|
+
"pointerout"
|
|
632
|
+
],
|
|
633
|
+
this.handlePointermove
|
|
634
|
+
],
|
|
635
|
+
end: [
|
|
636
|
+
["pointerup", "pointercancel", "pointerleave"],
|
|
637
|
+
this.handlePointerup
|
|
638
|
+
]
|
|
639
|
+
})}
|
|
640
|
+
>
|
|
641
|
+
<luzmo-infield-button
|
|
642
|
+
inline="end"
|
|
643
|
+
block="start"
|
|
644
|
+
class="button step-up"
|
|
645
|
+
aria-hidden="true"
|
|
646
|
+
label=${"Increase " + this.appliedLabel}
|
|
647
|
+
size=${this.size}
|
|
648
|
+
tabindex="-1"
|
|
649
|
+
?focused=${this.focused}
|
|
650
|
+
?disabled=${this.disabled || this.readonly || this.max !== void 0 && this.value === this.max}
|
|
651
|
+
?quiet=${this.quiet}
|
|
652
|
+
>
|
|
653
|
+
${S(K)}
|
|
654
|
+
</luzmo-infield-button>
|
|
655
|
+
<luzmo-infield-button
|
|
656
|
+
inline="end"
|
|
657
|
+
block="end"
|
|
658
|
+
class="button step-down"
|
|
659
|
+
aria-hidden="true"
|
|
660
|
+
label=${"Decrease " + this.appliedLabel}
|
|
661
|
+
size=${this.size}
|
|
662
|
+
tabindex="-1"
|
|
663
|
+
?focused=${this.focused}
|
|
664
|
+
?disabled=${this.disabled || this.readonly || this.min !== void 0 && this.value === this.min}
|
|
665
|
+
?quiet=${this.quiet}
|
|
666
|
+
>
|
|
667
|
+
${S(W)}
|
|
668
|
+
</luzmo-infield-button>
|
|
669
|
+
</span>
|
|
670
|
+
`}
|
|
671
|
+
`;
|
|
672
|
+
}
|
|
673
|
+
update(e) {
|
|
674
|
+
if ((e.has("formatOptions") || e.has("resolvedLanguage")) && this.clearNumberFormatterCache(), e.has("value") || e.has("max") || e.has("min") || e.has("step")) {
|
|
675
|
+
const t = this.numberParser.parse(
|
|
676
|
+
this.formattedValue.replace(this._forcedUnit, "")
|
|
677
|
+
);
|
|
678
|
+
this.value = t, this.clearValueFormatterCache();
|
|
679
|
+
}
|
|
680
|
+
super.update(e);
|
|
681
|
+
}
|
|
682
|
+
willUpdate(e) {
|
|
683
|
+
this.multiline = !1, e.has(re) && this.clearNumberFormatterCache();
|
|
684
|
+
}
|
|
685
|
+
firstUpdated(e) {
|
|
686
|
+
super.firstUpdated(e), this.addEventListener("keydown", this.handleKeydown), this.addEventListener("compositionstart", this.handleCompositionStart), this.addEventListener("compositionend", this.handleCompositionEnd);
|
|
687
|
+
}
|
|
688
|
+
updated(e) {
|
|
689
|
+
if (!(!this.inputElement || !this.isConnected)) {
|
|
690
|
+
if (e.has("min") || e.has("formatOptions")) {
|
|
691
|
+
const t = this.min !== void 0 && this.min >= 0, { maximumFractionDigits: r } = this.numberFormatter.resolvedOptions(), o = r && r > 0;
|
|
692
|
+
let i = "numeric";
|
|
693
|
+
J() && !t ? i = "text" : (E() && o || Q() && o && t) && (i = "decimal"), this.inputElement.inputMode = i;
|
|
694
|
+
}
|
|
695
|
+
e.has("focused") && this.focused && !this.hasRecentlyReceivedPointerDown && this.formatOptions.unit && this.setSelectionRange(0, this.displayValue.length);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
c([
|
|
700
|
+
Z(".buttons")
|
|
701
|
+
], p.prototype, "buttons", 2);
|
|
702
|
+
c([
|
|
703
|
+
h({ type: Boolean, reflect: !0 })
|
|
704
|
+
], p.prototype, "focused", 2);
|
|
705
|
+
c([
|
|
706
|
+
h({ type: Object, attribute: "format-options" })
|
|
707
|
+
], p.prototype, "formatOptions", 2);
|
|
708
|
+
c([
|
|
709
|
+
h({ type: Boolean, reflect: !0, attribute: "hide-stepper" })
|
|
710
|
+
], p.prototype, "hideStepper", 2);
|
|
711
|
+
c([
|
|
712
|
+
h({ type: Boolean, reflect: !0 })
|
|
713
|
+
], p.prototype, "indeterminate", 2);
|
|
714
|
+
c([
|
|
715
|
+
h({ type: Boolean, reflect: !0, attribute: "keyboard-focused" })
|
|
716
|
+
], p.prototype, "keyboardFocused", 2);
|
|
717
|
+
c([
|
|
718
|
+
h({ type: Number })
|
|
719
|
+
], p.prototype, "max", 2);
|
|
720
|
+
c([
|
|
721
|
+
h({ type: Number })
|
|
722
|
+
], p.prototype, "min", 2);
|
|
723
|
+
c([
|
|
724
|
+
h({ type: Number })
|
|
725
|
+
], p.prototype, "step", 2);
|
|
726
|
+
c([
|
|
727
|
+
h({ type: Number, reflect: !0, attribute: "step-modifier" })
|
|
728
|
+
], p.prototype, "stepModifier", 2);
|
|
729
|
+
c([
|
|
730
|
+
h({ type: Number })
|
|
731
|
+
], p.prototype, "value", 1);
|
|
732
|
+
customElements.get("luzmo-number-field") || customElements.define("luzmo-number-field", p);
|
|
733
|
+
export {
|
|
734
|
+
p as LuzmoNumberField
|
|
735
|
+
};
|