@astryx-vue/core 0.2.6 → 0.4.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/THIRD_PARTY_NOTICES.md +9 -0
- package/dist/AlertDialog/index.js +1 -1
- package/dist/{AlertDialog-BBhl5P1X.js → AlertDialog-C2inDZWG.js} +13 -7
- package/dist/AppShell/index.d.ts +1 -1
- package/dist/AppShell/index.js +1 -1
- package/dist/{AppShell-mrflO0Uy.js → AppShell-CumzH-8z.js} +3 -3
- package/dist/Avatar/index.d.ts +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/{Avatar-pPZ4dI_s.js → Avatar-BW0TE8t9.js} +47 -34
- package/dist/AvatarGroup/index.d.ts +1 -1
- package/dist/AvatarGroup/index.js +1 -1
- package/dist/{AvatarGroup-B--NQSB3.js → AvatarGroup-DLC_FFR5.js} +57 -13
- package/dist/Banner/index.d.ts +1 -1
- package/dist/Banner/index.js +1 -1
- package/dist/{Banner-GbGxrqQO.js → Banner-C5VAwo4D.js} +68 -34
- package/dist/Blockquote/index.js +1 -1
- package/dist/Blockquote-DRoKdcxZ.js +27 -0
- package/dist/BottomSheet/index.d.ts +1 -1
- package/dist/BottomSheet/index.js +2 -2
- package/dist/{BottomSheet-eJ3FzTBD.js → BottomSheet-B4sc3F1S.js} +288 -140
- package/dist/{BottomSheet-DIVwbGr3.js → BottomSheet-m54uCMJN.js} +20 -4
- package/dist/Breadcrumbs/index.d.ts +2 -2
- package/dist/Breadcrumbs/index.js +2 -2
- package/dist/Breadcrumbs-CTaz7Kh4.js +223 -0
- package/dist/Button/index.d.ts +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/{Button-B6Hj_O_s.js → Button-ONOoHdkg.js} +25 -15
- package/dist/ButtonGroup/index.d.ts +1 -1
- package/dist/ButtonGroup/index.js +1 -1
- package/dist/ButtonGroup-DnkSZ9a5.js +87 -0
- package/dist/{ButtonTooltip-nWWrth8j.js → ButtonTooltip-CNKOQHYR.js} +7 -4
- package/dist/Calendar/index.d.ts +1 -1
- package/dist/Calendar/index.js +1 -1
- package/dist/{Calendar-B7vIowKq.js → Calendar-BAqzzQm2.js} +5 -5
- package/dist/Card/index.d.ts +2 -2
- package/dist/Card/index.js +1 -1
- package/dist/{Card-HAjZQg2s.js → Card-B-I24X9S.js} +2 -0
- package/dist/Carousel/index.js +1 -1
- package/dist/{Carousel-DAkOa7KK.js → Carousel-DXC22UWq.js} +50 -33
- package/dist/Chat/index.d.ts +1 -1
- package/dist/Chat/index.js +1 -1
- package/dist/{Chat-DVoI6UOA.js → Chat-BdJW6IX5.js} +152 -83
- package/dist/CheckboxIndicator/index.js +1 -1
- package/dist/{CheckboxIndicator-D37cm2Rh.js → CheckboxIndicator-fH4d-JE1.js} +9 -3
- package/dist/CheckboxInput/index.d.ts +1 -1
- package/dist/CheckboxInput/index.js +1 -1
- package/dist/{CheckboxInput-BS9J6edf.js → CheckboxInput-DJHCbwgC.js} +19 -11
- package/dist/CheckboxList/index.d.ts +1 -1
- package/dist/CheckboxList/index.js +1 -1
- package/dist/{CheckboxList-CX1i_jVP.js → CheckboxList-BdZIP4_J.js} +155 -38
- package/dist/Citation/index.js +1 -1
- package/dist/{Citation-Djgwa0ko.js → Citation-DbZn2vms.js} +8 -3
- package/dist/ClickableCard/index.d.ts +1 -1
- package/dist/ClickableCard/index.js +1 -1
- package/dist/{ClickableCard-Bhds4RRe.js → ClickableCard-ChAfiw9T.js} +10 -7
- package/dist/Code/index.d.ts +1 -1
- package/dist/Code/index.js +3 -3
- package/dist/{Code-XnPuGxey.js → Code-Bg7GBdxy.js} +2 -1
- package/dist/{CodeBlock-BUM3czCS.js → CodeBlock-Caaflp7C.js} +7 -3
- package/dist/Collapsible/index.d.ts +1 -1
- package/dist/Collapsible/index.js +1 -1
- package/dist/{Collapsible-Cov3Pyq5.js → Collapsible-Bdj0WYpb.js} +13 -11
- package/dist/CommandPalette/index.d.ts +1 -1
- package/dist/CommandPalette/index.js +1 -1
- package/dist/{CommandPalette-D6wYS30d.js → CommandPalette-C_MClfAg.js} +146 -62
- package/dist/ComplexSelector/index.d.ts +1 -1
- package/dist/ComplexSelector/index.js +1 -1
- package/dist/{ComplexSelector-Bil81sfq.js → ComplexSelector-BeVQaqRf.js} +94 -22
- package/dist/ContextMenu/index.d.ts +2 -2
- package/dist/ContextMenu/index.js +2 -2
- package/dist/{ContextMenu-DdLJnxNN.js → ContextMenu-C6hPYvYz.js} +299 -179
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.js +1 -1
- package/dist/{DateInput-u2XKccpK.js → DateInput-BjLdmYor.js} +567 -76
- package/dist/DateRangeInput/index.d.ts +1 -1
- package/dist/DateRangeInput/index.js +1 -1
- package/dist/{DateRangeInput-u7LhH6up.js → DateRangeInput-Br3wVEfD.js} +99 -28
- package/dist/DateTimeInput/index.d.ts +1 -1
- package/dist/DateTimeInput/index.js +1 -1
- package/dist/DateTimeInput-CAZBwoRe.js +562 -0
- package/dist/Dialog/index.d.ts +1 -1
- package/dist/Dialog/index.js +2 -2
- package/dist/{Dialog-BiOSKQso.js → Dialog-Dce4Y97V.js} +28 -11
- package/dist/{Dialog-FGHfDu5M.js → Dialog-fhyxB00e.js} +32 -5
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +1 -1
- package/dist/{Divider-BtwnL18I.js → Divider-mOZ6vIQw.js} +5 -1
- package/dist/DropdownMenu/index.d.ts +2 -2
- package/dist/DropdownMenu/index.js +3 -3
- package/dist/{DropdownMenu-SM_BEOgM.js → DropdownMenu-BdGmQVb1.js} +85 -57
- package/dist/{DropdownMenu-BEasdJ6R.js → DropdownMenu-BzQrNV9C.js} +481 -264
- package/dist/{DropdownMenuRadioItem.vue-CXEURBcq.d.ts → DropdownMenuRadioItem.vue-Qd-8Rg4Q.d.ts} +236 -230
- package/dist/EmptyState/index.js +1 -1
- package/dist/{EmptyState-C_GH7IV5.js → EmptyState-CmOQf2SH.js} +2 -2
- package/dist/Field/index.d.ts +4 -3
- package/dist/Field/index.js +4 -3
- package/dist/{Field-D5gUEGw4.js → Field--OEsLBfE.js} +4 -3
- package/dist/{FieldInfoTip-Ds-sW_jY.js → FieldInfoTip-gxsnfkZw.js} +3 -3
- package/dist/{FieldLabel-BNeXRuGH.js → FieldLabel-jxIiWgLw.js} +12 -7
- package/dist/FieldStatus/index.d.ts +1 -1
- package/dist/FileInput/index.d.ts +1 -1
- package/dist/FileInput/index.js +1 -1
- package/dist/{FileInput-BpdiO1V8.js → FileInput-B_pUxB0Y.js} +106 -29
- package/dist/FormLayout/index.d.ts +1 -1
- package/dist/FormLayout/index.js +1 -1
- package/dist/{FormLayout-D47FjiOq.js → FormLayout-B9dUB6Ps.js} +1 -1
- package/dist/Heading/index.d.ts +1 -1
- package/dist/Heading/index.js +1 -1
- package/dist/{Heading-BnwWEWkp.js → Heading-BzBunfN7.js} +1 -1
- package/dist/HoverCard/index.js +1 -1
- package/dist/{HoverCard-ycY50pRN.js → HoverCard-BpJhT0sn.js} +35 -22
- package/dist/Icon/index.d.ts +4 -4
- package/dist/Icon/index.js +1 -1
- package/dist/{Icon-bteSId7T.js → Icon-KDnUyY7f.js} +12 -20
- package/dist/IconButton/index.js +1 -1
- package/dist/{IconButton-DDNgNl7B.js → IconButton-DI-XBbtV.js} +1 -1
- package/dist/Indicator/index.d.ts +2 -2
- package/dist/Indicator/index.js +2 -1
- package/dist/InputClearButton-CwXPan8c.js +40 -0
- package/dist/InputGroup/index.d.ts +1 -1
- package/dist/InputGroup/index.js +2 -2
- package/dist/{InputGroup-CA03Smrs.js → InputGroup-DiiocoIW.js} +2 -2
- package/dist/InternationalizationProvider/index.d.ts +1 -1
- package/dist/InternationalizationProvider/index.js +1 -1
- package/dist/{InternationalizationProvider-DJay_w3B.js → InternationalizationProvider-kBapgKAQ.js} +5 -9
- package/dist/{Item-KhFKX9St.js → Item-DWMIjN8n.js} +34 -9
- package/dist/Kbd/index.js +1 -1
- package/dist/{Kbd-BB-Dw6zE.js → Kbd-CV3LO2Ge.js} +18 -2
- package/dist/LayerContentBoundary-CvsKxwwm.js +27 -0
- package/dist/LayerProvider/index.js +1 -1
- package/dist/{LayerProvider-D9NsQFzL.js → LayerProvider-B6zpMBWC.js} +15 -3
- package/dist/Layout/index.d.ts +1 -1
- package/dist/Layout/index.js +2 -2
- package/dist/{Layout-9X6eCUoY.js → Layout-JJRCG7Mf.js} +1 -1
- package/dist/{LayoutPanel-DeOh00p5.js → LayoutPanel-zM5vjrKS.js} +15 -8
- package/dist/Lightbox/index.js +1 -1
- package/dist/{Lightbox-DTF9EdTG.js → Lightbox-D8wyPgMK.js} +8 -6
- package/dist/Link/index.d.ts +2 -2
- package/dist/Link/index.js +1 -1
- package/dist/{Link-BqHCtiyt.js → Link-DweIpOtN.js} +29 -12
- package/dist/List/index.d.ts +1 -1
- package/dist/List/index.js +2 -2
- package/dist/{ListItem-8RWT8XAG.js → ListItem-BQXMu1Tb.js} +1 -1
- package/dist/Markdown/index.d.ts +5 -2
- package/dist/Markdown/index.js +5 -2
- package/dist/Markdown/parser/index.d.ts +4 -0
- package/dist/Markdown/parser/index.js +3 -0
- package/dist/Markdown/plugin-protocol/index.d.ts +35 -0
- package/dist/Markdown/plugin-protocol/index.js +107 -0
- package/dist/Markdown/plugin-renderer/index.d.ts +31 -0
- package/dist/Markdown/plugin-renderer/index.js +42 -0
- package/dist/{Markdown-2CVyZDuB.js → Markdown-DhVfOvXk.js} +195 -484
- package/dist/MediaTheme-DlLqYhDy.js +433 -0
- package/dist/MetadataList/index.js +1 -1
- package/dist/{MetadataList-B-OelQlt.js → MetadataList-CEYceIlN.js} +15 -7
- package/dist/MobileNav/index.js +1 -1
- package/dist/{MobileNavToggle-C3dkrM98.js → MobileNavToggle-pdoJFZHx.js} +60 -19
- package/dist/MoreMenu/index.d.ts +1 -1
- package/dist/MoreMenu/index.js +1 -1
- package/dist/{MoreMenu-D1WFGqGU.js → MoreMenu-CFNqSRev.js} +87 -67
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.js +1 -1
- package/dist/MultiSelector-DuVatmq5.js +1456 -0
- package/dist/{NavDisclosure-C_fugrQ3.js → NavDisclosure-Bq9DTZLO.js} +29 -7
- package/dist/{NavHeadingSurface-B3yJspSN.js → NavHeadingSurface-C4v_MtkX.js} +29 -26
- package/dist/NavItem/index.d.ts +1 -1
- package/dist/NavItem/index.js +2 -2
- package/dist/{NavItem-BBIGSvDj.js → NavItem-BPb3yfgz.js} +17 -4
- package/dist/NavMenu/index.d.ts +1 -1
- package/dist/NavMenu/index.js +3 -3
- package/dist/{NavMenu-ThXguZAz.js → NavMenu-BYIDzjix.js} +42 -15
- package/dist/{NavMenuItem-BvJNsDFC.js → NavMenuItem-D3FO90GR.js} +14 -12
- package/dist/NumberInput/index.d.ts +1 -1
- package/dist/NumberInput/index.js +1 -1
- package/dist/NumberInput-B0vzOg3N.js +727 -0
- package/dist/Outline/index.d.ts +2 -2
- package/dist/Outline/index.js +2 -2
- package/dist/{Outline-755h-lMP.js → Outline-CfGv2F1o.js} +91 -6
- package/dist/OverflowList/index.d.ts +2 -2
- package/dist/OverflowList/index.js +1 -1
- package/dist/{OverflowList-NmrSMbxb.js → OverflowList-BgRLZ3dh.js} +23 -6
- package/dist/Pagination/index.d.ts +1 -1
- package/dist/Pagination/index.js +1 -1
- package/dist/{Pagination-Cc4BrjQg.js → Pagination-Bfe12018.js} +2 -2
- package/dist/PickerWheel-CSwUYfes.js +69 -0
- package/dist/Popover/index.d.ts +1 -1
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-CtoBfVlD.js → Popover-78dFjTb9.js} +28 -17
- package/dist/PowerSearch/index.d.ts +1 -1
- package/dist/PowerSearch/index.js +1 -1
- package/dist/{PowerSearch-DHoiObLn.js → PowerSearch-BoAMdFaT.js} +776 -586
- package/dist/ProgressBar/index.d.ts +1 -1
- package/dist/ProgressBar/index.js +1 -1
- package/dist/{ProgressBar-CVLzdoBK.js → ProgressBar-VP4JS7vm.js} +10 -7
- package/dist/Radio/index.d.ts +1 -1
- package/dist/Radio/index.js +1 -1
- package/dist/{RadioGroup-Bfu6JSNV.js → RadioGroup-BIipql-L.js} +94 -26
- package/dist/RadioList/index.d.ts +1 -1
- package/dist/RadioList/index.js +1 -1
- package/dist/{RadioList-xY1cwLdZ.js → RadioList-GyhgBg4j.js} +57 -8
- package/dist/Resizable/index.d.ts +1 -1
- package/dist/Resizable/index.js +1 -1
- package/dist/{ResizeHandle-q4nD_586.js → ResizeHandle-TPlUCAHD.js} +103 -50
- package/dist/ScrollableArea/index.d.ts +1 -1
- package/dist/ScrollableArea/index.js +1 -1
- package/dist/{ScrollableArea-CJiaALHm.js → ScrollableArea-0u6RWtGG.js} +14 -3
- package/dist/Scrollbars/index.d.ts +2 -0
- package/dist/Scrollbars/index.js +3 -0
- package/dist/Scrollbars-D_93hJYK.js +75 -0
- package/dist/SegmentedControl/index.js +1 -1
- package/dist/{SegmentedControl-ChHmFrrC.js → SegmentedControl-D1wWGBZo.js} +11 -5
- package/dist/SelectableCard/index.d.ts +1 -1
- package/dist/SelectableCard/index.js +1 -1
- package/dist/{SelectableCard-Bj5s_tIN.js → SelectableCard-BEqnhPaX.js} +17 -12
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.js +1 -1
- package/dist/Selector-CPISLzp7.js +1049 -0
- package/dist/SideNav/index.d.ts +1 -1
- package/dist/SideNav/index.js +1 -1
- package/dist/{SideNav-Dtv8eA2j.js → SideNav-CN2QeAtY.js} +64 -41
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-DWobsPgm.js → Slider-pdC0jpHu.js} +172 -46
- package/dist/Spinner/index.js +1 -1
- package/dist/Spinner-DdVUadii.js +200 -0
- package/dist/Stack/index.d.ts +1 -1
- package/dist/Stack/index.js +2 -2
- package/dist/{Stack-CjQEavuq.js → Stack-Bb_h60t3.js} +10 -3
- package/dist/{Stack-D_Bhs-3r.js → Stack-Bp-XN9J4.js} +20 -9
- package/dist/StatusDot/index.d.ts +1 -1
- package/dist/StatusDot/index.js +1 -1
- package/dist/{StatusDot-BPUhMOff.js → StatusDot-BS_ohXhd.js} +8 -4
- package/dist/Stepper/index.d.ts +1 -1
- package/dist/Stepper/index.js +1 -1
- package/dist/{Stepper-CE8dHysu.js → Stepper-CyaSRSdu.js} +101 -79
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DaVPRxvN.js → Switch-Z2Vfiiic.js} +38 -22
- package/dist/TabList/index.d.ts +2 -2
- package/dist/TabList/index.js +1 -1
- package/dist/{TabList-DIkK9sgK.js → TabList-DRqP0Hrv.js} +205 -63
- package/dist/Table/index.d.ts +3 -3
- package/dist/Table/index.js +1 -1
- package/dist/{Table-hqZMmzfU.js → Table-BcrrylMX.js} +727 -448
- package/dist/Text/index.d.ts +2 -2
- package/dist/Text/index.js +1 -1
- package/dist/{Text-CV3LmscH.js → Text-CmTOgYXf.js} +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-Ab5Sw60T.js → TextArea-DA9CCG_J.js} +104 -50
- package/dist/TextInput/index.d.ts +1 -1
- package/dist/TextInput/index.js +1 -1
- package/dist/{TextInput-zFT1_qgI.js → TextInput-CI96einV.js} +71 -38
- package/dist/Theme/index.d.ts +3 -3
- package/dist/Theme/index.js +3 -2
- package/dist/Theme-BbDT8B_C.js +2125 -0
- package/dist/Thumbnail/index.js +1 -1
- package/dist/{Thumbnail-C3NnJUFG.js → Thumbnail-B2ZAY59J.js} +13 -10
- package/dist/{TimeField-ByiJKBRM.js → TimeField-CpAgja9D.js} +299 -40
- package/dist/TimeInput/index.d.ts +1 -1
- package/dist/TimeInput/index.js +1 -1
- package/dist/{TimeInput-S8n946tp.js → TimeInput-Bw_lHS4M.js} +78 -9
- package/dist/Timer/index.d.ts +1 -1
- package/dist/Timer/index.js +1 -1
- package/dist/{Timer-avMQk5DN.js → Timer-CH7GsEVu.js} +1 -1
- package/dist/Timestamp/index.d.ts +1 -1
- package/dist/Timestamp/index.js +1 -1
- package/dist/{Timestamp-xpQKCk0d.js → Timestamp-BFNuoTZ0.js} +5 -5
- package/dist/Toast/index.d.ts +1 -1
- package/dist/Toast/index.js +1 -1
- package/dist/Toast-DwnPjx6j.js +685 -0
- package/dist/ToggleButton/index.d.ts +1 -1
- package/dist/ToggleButton/index.js +1 -1
- package/dist/{ToggleButton-B-C-Q7XP.js → ToggleButton-cLjh9W-x.js} +5 -4
- package/dist/Token/index.d.ts +1 -1
- package/dist/Token/index.js +1 -1
- package/dist/{Token-DsntTYhQ.js → Token-BfS4vi__.js} +32 -17
- package/dist/Tokenizer/index.d.ts +1 -1
- package/dist/Tokenizer/index.js +1 -1
- package/dist/{Tokenizer-41p035dX.js → Tokenizer-Ci3E5bvP.js} +109 -23
- package/dist/Toolbar/index.d.ts +2 -2
- package/dist/Toolbar/index.js +1 -1
- package/dist/{Toolbar-BrgvvTCk.js → Toolbar-C0pMWL4S.js} +1 -1
- package/dist/Tooltip/index.d.ts +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{Tooltip-C4Vaqd3G.js → Tooltip-sAM8i1eO.js} +23 -19
- package/dist/TopNav/index.d.ts +1 -1
- package/dist/TopNav/index.js +1 -1
- package/dist/{TopNav-CeSeEMX3.js → TopNav-gW59zp1o.js} +16 -15
- package/dist/TreeList/index.d.ts +1 -1
- package/dist/TreeList/index.js +1 -1
- package/dist/{TreeList-BUz-KZJd.js → TreeList-DaoI7zaH.js} +124 -41
- package/dist/Typeahead/index.d.ts +1 -1
- package/dist/Typeahead/index.js +2 -2
- package/dist/{Typeahead-k3xhFxkr.js → Typeahead-D4JjvjK4.js} +125 -26
- package/dist/{TypeaheadMenu-DBW6rHeO.js → TypeaheadMenu-BQlMrfqX.js} +141 -51
- package/dist/{announce-Cnio10Wk.js → announce-B210eJVf.js} +17 -2
- package/dist/characterReferences-BJ-jLhsR.js +65 -0
- package/dist/characters-rcDbGt71.d.ts +29 -0
- package/dist/characters-wTnzjkkR.js +58 -0
- package/dist/{colorMode-CBgdgDSn.js → colorMode-BxqfDP4P.js} +1 -4
- package/dist/composables/index.d.ts +5 -4
- package/dist/composables/index.js +23 -18
- package/dist/{composables-CbKx9C1Y.js → composables-Bc02zKAO.js} +167 -197
- package/dist/context-B6UElI5X.js +5 -0
- package/dist/{context-Cfjh8te1.js → context-Cfml4jaK.js} +5 -3
- package/dist/{context-iABt_ueM.js → context-DWfi56sq.js} +451 -122
- package/dist/context-IvbU9c3T.js +8 -0
- package/dist/context-pjBxaMSh.js +28 -0
- package/dist/fieldParts--SyRZVQG.js +44 -0
- package/dist/fieldParts-LXpQMKE8.d.ts +27 -0
- package/dist/{focus-CpficIgf.js → focus-l8jVTcqd.js} +1 -1
- package/dist/hoverIntent-DMHGb85c.js +115 -0
- package/dist/{index-Cde5JvtX.d.ts → index-B-nESNam.d.ts} +8 -7
- package/dist/{index-CsNi1I8j.d.ts → index-B08-Uxhv.d.ts} +4 -2
- package/dist/{index-Cn-sSds-.d.ts → index-B56j4eI2.d.ts} +24 -1
- package/dist/{index-BJMJ09K-.d.ts → index-BEZ4ezJk.d.ts} +1 -1
- package/dist/{index-DeQwYJbg.d.ts → index-BNaRK-s5.d.ts} +10 -1
- package/dist/{index-CQCTKjIO.d.ts → index-BO9TY87G.d.ts} +5 -4
- package/dist/{index-BJSxFVXH.d.ts → index-BQEJj72c.d.ts} +21 -8
- package/dist/{index-BXk7Wng7.d.ts → index-BULhhnGf.d.ts} +1 -1
- package/dist/{index-D97pQbua.d.ts → index-BV2D2x_u.d.ts} +1 -1
- package/dist/{index-BPYzIIYn.d.ts → index-BZKgbyN9.d.ts} +2 -2
- package/dist/index-BkUkm6Al.d.ts +11 -0
- package/dist/{index-ClNU2Th8.d.ts → index-Bn-v89Vt.d.ts} +10 -6
- package/dist/{index-Bu8NA2SD.d.ts → index-BnEhvmdR.d.ts} +16 -7
- package/dist/index-Bo-ofFyg.d.ts +166 -0
- package/dist/{index-i0tNFWfz.d.ts → index-BqhgeAT4.d.ts} +2 -0
- package/dist/{index-DWh2WC8W.d.ts → index-C4Cjz6OK.d.ts} +2 -2
- package/dist/{index-B7yhzGUT.d.ts → index-C7sam-SB.d.ts} +2 -2
- package/dist/{index-BrJzFA5X.d.ts → index-C90l2rH1.d.ts} +1 -1
- package/dist/{index-vP0EtrJJ.d.ts → index-C9gAlDt_.d.ts} +6 -3
- package/dist/{index-csA1lH_0.d.ts → index-CJ6ajsUC.d.ts} +2 -2
- package/dist/{index-CY-KvZ9B.d.ts → index-CK-Dbh0f.d.ts} +1 -1
- package/dist/index-CKUfpmFL.d.ts +375 -0
- package/dist/{index-DXpSFlPG.d.ts → index-CKgBTAzC.d.ts} +4 -4
- package/dist/{index-EFqQF2Bx.d.ts → index-CPtDjmcX.d.ts} +4 -4
- package/dist/{index-12QYAbiz.d.ts → index-CRrSHbok.d.ts} +3 -2
- package/dist/{index-DG52Bg0W.d.ts → index-CTf3SK0b.d.ts} +6 -0
- package/dist/{index-BNy3SW4S.d.ts → index-CTjkJP4x.d.ts} +32 -3
- package/dist/{index-Ca8VIE4l.d.ts → index-CVn0GBdB.d.ts} +1 -1
- package/dist/{index-YKCx03zD.d.ts → index-CdvmnNMH.d.ts} +1 -1
- package/dist/{index-BUEPz7BL.d.ts → index-CikMzeab.d.ts} +3 -3
- package/dist/{index-CdtZjkmG.d.ts → index-CpNlPLBF.d.ts} +183 -129
- package/dist/{index-N7OVZ38M.d.ts → index-Cs1xsHKi.d.ts} +28 -16
- package/dist/{index-Cyb9Du5Z.d.ts → index-CtTGt6Dv.d.ts} +1 -1
- package/dist/{index-HV6W3xCx.d.ts → index-D05JGsT3.d.ts} +5 -2
- package/dist/{index-CsTbMVDS.d.ts → index-D0_HsuC3.d.ts} +4 -4
- package/dist/{index-BgT6mH3U.d.ts → index-D7ShT2c-.d.ts} +1 -1
- package/dist/{index-CkKPMIeX.d.ts → index-D7XRtUTY.d.ts} +9 -0
- package/dist/{index-TntQsADQ.d.ts → index-DEm3kRBO.d.ts} +4 -3
- package/dist/{index-DamRHh1i.d.ts → index-DLAG3m9W.d.ts} +11 -1
- package/dist/{index-DUnDGFQE.d.ts → index-DNA2l1RN.d.ts} +1 -1
- package/dist/{index-WnUY4Kxu.d.ts → index-DRJZ-v1E.d.ts} +4 -4
- package/dist/{index-DYp2RWkM.d.ts → index-DY8Wph-A.d.ts} +3 -3
- package/dist/{index-B1WJxt-n.d.ts → index-DfC05uKG.d.ts} +17 -7
- package/dist/{index-C5e-7Obr.d.ts → index-Dj1_1t3j.d.ts} +19 -6
- package/dist/{index-jW-mP58D.d.ts → index-Dr4b_oji.d.ts} +22 -15
- package/dist/{index-uKnRGtzi.d.ts → index-Ds201-d2.d.ts} +18 -4
- package/dist/{index-DIXAzTKL.d.ts → index-DxxudRgB.d.ts} +1 -1
- package/dist/{index-DQmK3Lq_.d.ts → index-IfsSCj8J.d.ts} +19 -6
- package/dist/{index-B1eCxBCY.d.ts → index-TXcNH86P.d.ts} +1 -1
- package/dist/{index-XuAAcYiP.d.ts → index-f3d9cVtj.d.ts} +1 -1
- package/dist/index-fAZaRruV.d.ts +125 -0
- package/dist/{index-D5N9ikrS.d.ts → index-hCpxKePE.d.ts} +1 -1
- package/dist/{index-T2FOcOuI.d.ts → index-jOwU3YoR.d.ts} +400 -90
- package/dist/{index-DdGck82Y.d.ts → index-pNtfr-RW.d.ts} +2 -2
- package/dist/{index-BhpAUzUr.d.ts → index-unAZVFGz.d.ts} +2 -2
- package/dist/index.d.ts +84 -77
- package/dist/index.js +151 -134
- package/dist/inlineSize-BNe8wggI.js +66 -0
- package/dist/inputPresentation-BOyHkCDr.js +62 -0
- package/dist/interactionModality-ACpTMhak.js +44 -0
- package/dist/isApplePlatform-B1ju6F5B.js +27 -0
- package/dist/isRenderable-BnKHIqfd.js +21 -0
- package/dist/layerDepth-CNDh-IHb.js +181 -0
- package/dist/link-DuuA2eCL.js +30 -0
- package/dist/{loadCatalog-BGHKG_9N.d.ts → loadCatalog-DlLFZreI.d.ts} +281 -7
- package/dist/loadCatalog-eopw74qb.js +424 -0
- package/dist/locale/index.d.ts +2 -2
- package/dist/locale/index.js +4 -3
- package/dist/locale-CabGJlGp.js +343 -0
- package/dist/modalOutlet-CUOcrhIu.js +56 -0
- package/dist/optionAction-Cg7xQLUA.d.ts +6 -0
- package/dist/{power-search-DrDfcoL1.d.ts → power-search-gHLIYXs5.d.ts} +2 -0
- package/dist/protocol-DHxY0NI8.js +113 -0
- package/dist/protocol-RSeMzAN1.d.ts +238 -0
- package/dist/publicParser-B0MRoikr.d.ts +141 -0
- package/dist/publicParser-uHC_T0Fo.js +895 -0
- package/dist/resizableChannel-3vivrEcT.js +20 -0
- package/dist/safeUrl-CsvfcZ9m.js +54 -0
- package/dist/scopedProvide-C-Df7c15.js +30 -0
- package/dist/scrollKeyboardDelegation-D7cumnOl.js +238 -0
- package/dist/scrollLock-C3aT4-0z.js +102 -0
- package/dist/{searchResultMessage-hXXNOFJP.js → searchResultMessage-mCpJBvra.js} +5 -14
- package/dist/{semantic-CKH9XVqa.d.ts → semantic-BF_AjLvk.d.ts} +6 -3
- package/dist/slug-C65CUsf9.js +32 -0
- package/dist/syntaxContext-DmIfNNtb.js +4 -0
- package/dist/triggerVariant-BsL8jMHs.js +16 -0
- package/dist/{types-0Q_SJv_F.d.ts → types-Bb7OGivY.d.ts} +6 -1
- package/dist/{types-H4Bbbxiw.d.ts → types-BnNTzEnd.d.ts} +1 -1
- package/dist/{types-CwyibrRB.d.ts → types-C5GQ2KCK.d.ts} +23 -3
- package/dist/{types-BBWrcHMD.d.ts → types-Ckih2YJi.d.ts} +3 -2
- package/dist/{types-gKsEkk2g.d.ts → types-CsqwQkf1.d.ts} +143 -10
- package/dist/upstreamMap-xr3gvREu.js +731 -0
- package/dist/{useAnchoredListbox-DwztMNjP.js → useAnchoredListbox-DGxxKHZb.js} +2 -2
- package/dist/{useAsyncSource-xpQovjV_.d.ts → useAsyncSource-aGzrvRkI.d.ts} +3 -0
- package/dist/{useClickableContainer-DyNpnSEa.js → useClickableContainer-CdGp_Cev.js} +1 -1
- package/dist/{useClipboard-BDfbEsWd.js → useClipboard-Dk8cS810.js} +1 -1
- package/dist/useHoverLayerDismiss-kYJ_NqL4.js +27 -0
- package/dist/{useIndicator-i1NORM7W.js → useIndicator-MZmfBWid.js} +5 -23
- package/dist/{useInputContainer-CpgDe2-4.js → useInputContainer-CLcYrby4.js} +1 -1
- package/dist/{useInputStatusIcon-DBOwxV4x.js → useInputStatusIcon-DAE7PExr.js} +1 -1
- package/dist/useLayerMountTarget-BmZyeKWE.js +156 -0
- package/dist/{useListFocus-D0iOJl39.js → useListFocus-ChxLg0b4.js} +3 -2
- package/dist/{useMenuDrillIn-DzKGkTho.js → useMenuDrillIn-DhUnPvKs.js} +6 -5
- package/dist/useMenuHover-Djreu23i.js +170 -0
- package/dist/useMenuPress-8foxY8z4.js +764 -0
- package/dist/{useMergedRefs-CfHHlCsn.js → useMergedRefs-Cb6_w93m.js} +24 -4
- package/dist/{useNumberField-4-dIGVed.js → useNumberField-Dk1BE3-K.js} +3 -3
- package/dist/useOptionActionGrid-CkJcuvaU.js +97 -0
- package/dist/{usePositionedLayer-Cru9_00b.js → usePositionedLayer-B7cvG-_v.js} +43 -49
- package/dist/usePressFeedback-BJCpjEpv.js +319 -0
- package/dist/{useResizable-DDwPpPe6.d.ts → useResizable-1MHPNaRD.d.ts} +19 -1
- package/dist/{useResizable-B3ahKLoZ.js → useResizable-I3BCiLSL.js} +72 -40
- package/dist/useResolvedLabelHidden-B2rlWiaI.js +30 -0
- package/dist/{useRestoreFocus-Djw9RUIf.js → useRestoreFocus-XEKs5-gp.js} +49 -7
- package/dist/useScrollOverflow-DuMoGXmm.js +67 -0
- package/dist/useScrollableArea-BE8b3qm7.js +222 -0
- package/dist/useScrollbars-C2NJ6Qwq.js +43 -0
- package/dist/{useTimeValue-6ufHM15W.js → useTimeValue-BJd0xBhG.js} +4 -22
- package/dist/useTranslator-BmWt2BBt.js +35 -0
- package/dist/{useTypeahead-PAK8lMYz.js → useTypeahead-BvtflkRk.js} +4 -5
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +5 -0
- package/dist/{utils-D33VQDnk.js → utils-ClVseK2w.js} +29 -2
- package/dist/utils-z3Q6BGIJ.js +819 -0
- package/locales/SOURCE.json +1 -1
- package/package.json +24 -3
- package/reset.css +364 -1
- package/styles/avatar-group.css +9 -1
- package/styles/badge.css +8 -5
- package/styles/banner.css +124 -26
- package/styles/blockquote.css +1 -0
- package/styles/bordered-control.css +1 -1
- package/styles/bottom-sheet.css +74 -6
- package/styles/breadcrumbs.css +16 -2
- package/styles/button-group.css +3 -1
- package/styles/button.css +53 -11
- package/styles/card.css +1 -1
- package/styles/chat.css +16 -6
- package/styles/checkbox-input.css +10 -0
- package/styles/clickable-card.css +10 -3
- package/styles/collapsible.css +12 -5
- package/styles/command-palette.css +29 -14
- package/styles/complex-selector.css +22 -5
- package/styles/context-menu.css +3 -3
- package/styles/date-input.css +111 -1
- package/styles/dialog-header.css +4 -1
- package/styles/dialog.css +7 -0
- package/styles/dropdown-menu.css +12 -3
- package/styles/field.css +5 -0
- package/styles/form-layout.css +1 -0
- package/styles/heading.css +18 -8
- package/styles/icon.css +4 -0
- package/styles/kbd.css +1 -1
- package/styles/layer.css +72 -0
- package/styles/list.css +9 -2
- package/styles/metadata-list.css +1 -0
- package/styles/mobile-nav.css +4 -1
- package/styles/multi-selector.css +48 -1
- package/styles/nav-item.css +9 -2
- package/styles/nav-menu.css +12 -2
- package/styles/number-input.css +9 -1
- package/styles/overflow-list.css +1 -1
- package/styles/popover.css +2 -1
- package/styles/power-search.css +5 -3
- package/styles/pressable.css +63 -22
- package/styles/progress-bar.css +15 -3
- package/styles/radio.css +16 -0
- package/styles/resize-handle.css +42 -0
- package/styles/scrollbars.css +28 -0
- package/styles/segmented-control.css +12 -4
- package/styles/selector.css +53 -1
- package/styles/side-nav.css +19 -0
- package/styles/slider.css +4 -3
- package/styles/spinner.css +48 -42
- package/styles/stepper.css +58 -4
- package/styles/switch.css +26 -0
- package/styles/tab-list.css +132 -3
- package/styles/table.css +88 -10
- package/styles/text-area.css +1 -1
- package/styles/text-input.css +1 -1
- package/styles/text.css +6 -6
- package/styles/thumbnail.css +11 -3
- package/styles/time-input.css +8 -0
- package/styles/toast.css +37 -3
- package/styles/token.css +2 -2
- package/styles/tokenizer.css +1 -1
- package/styles/toolbar.css +4 -1
- package/styles/tree-list.css +1 -1
- package/styles/typeahead.css +34 -1
- package/styles.css +1 -0
- package/dist/Blockquote-DFqBv_oJ.js +0 -18
- package/dist/Breadcrumbs-DPVaziH4.js +0 -141
- package/dist/ButtonGroup-ySQWanDP.js +0 -125
- package/dist/DateTimeInput-DHp683jZ.js +0 -268
- package/dist/MultiSelector-BeV98x7X.js +0 -988
- package/dist/NumberInput-AZ9x3oja.js +0 -473
- package/dist/Selector-DuVozKNq.js +0 -675
- package/dist/Spinner-9cYUCnDy.js +0 -84
- package/dist/Theme-CtaUWo4g.js +0 -1246
- package/dist/Toast-BuqIZV5z.js +0 -322
- package/dist/context-4PuqD1Ic.js +0 -4
- package/dist/context-D5-MwxnN.js +0 -4
- package/dist/index-BH9PzQ1F.d.ts +0 -87
- package/dist/link-C4_WogdF.js +0 -18
- package/dist/loadCatalog-CXKqEB9s.js +0 -877
- package/dist/locale-DgkZEMTn.js +0 -105
- package/dist/platform-B_9W_aHW.js +0 -33
- package/dist/scrollLock-BzIvIimL.js +0 -42
- package/dist/useMenuPress-D-FRNrBW.js +0 -573
- package/dist/useScrollableArea-DDk_CluT.js +0 -172
- /package/dist/{index-lgvUFSCO.d.ts → index-CryFtTT6.d.ts} +0 -0
|
@@ -0,0 +1,727 @@
|
|
|
1
|
+
import { t as _sfc_main$1 } from "./VisuallyHidden-C7NN3VEP.js";
|
|
2
|
+
import { n as useButtonTooltip } from "./Button-ONOoHdkg.js";
|
|
3
|
+
import { t as _sfc_main$2 } from "./ButtonTooltip-CNKOQHYR.js";
|
|
4
|
+
import { n as useDevWarning } from "./useDevWarning-DznOpOHT.js";
|
|
5
|
+
import { t as _sfc_main$3 } from "./FieldIcon--NTgW5IU.js";
|
|
6
|
+
import { t as _sfc_main$4 } from "./FieldInfoTip-gxsnfkZw.js";
|
|
7
|
+
import { o as useAstryxLocale, s as useAstryxMessages } from "./context-DWfi56sq.js";
|
|
8
|
+
import { n as useNumberField, t as computeSteppedValue } from "./useNumberField-Dk1BE3-K.js";
|
|
9
|
+
import { t as _sfc_main$5 } from "./Icon-KDnUyY7f.js";
|
|
10
|
+
import { i as useAriaRequired } from "./context-Cfml4jaK.js";
|
|
11
|
+
import { t as _sfc_main$6 } from "./Field--OEsLBfE.js";
|
|
12
|
+
import { t as useFieldPartStyling } from "./fieldParts--SyRZVQG.js";
|
|
13
|
+
import { t as _sfc_main$7 } from "./InputClearButton-CwXPan8c.js";
|
|
14
|
+
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, unref, useAttrs, useId, useTemplateRef, withCtx, withModifiers } from "vue";
|
|
15
|
+
import "../styles/number-input.css";
|
|
16
|
+
//#region src/NumberInput/numberParser.ts
|
|
17
|
+
const symbolsByLocale = /* @__PURE__ */ new Map();
|
|
18
|
+
function getLocaleNumberSymbols(locale) {
|
|
19
|
+
const key = locale ?? "";
|
|
20
|
+
let symbols = symbolsByLocale.get(key);
|
|
21
|
+
if (symbols === void 0) {
|
|
22
|
+
let format;
|
|
23
|
+
try {
|
|
24
|
+
format = new Intl.NumberFormat(locale);
|
|
25
|
+
} catch {
|
|
26
|
+
format = new Intl.NumberFormat("en");
|
|
27
|
+
}
|
|
28
|
+
const parts = format.formatToParts(12345.6);
|
|
29
|
+
const groupSizes = format.formatToParts(11111111111).filter((part) => part.type === "integer").map((part) => part.value.length);
|
|
30
|
+
const hasGrouping = groupSizes.length > 1;
|
|
31
|
+
const primary = groupSizes[groupSizes.length - 1];
|
|
32
|
+
const secondary = groupSizes[groupSizes.length - 2];
|
|
33
|
+
symbols = {
|
|
34
|
+
group: (parts.find((part) => part.type === "group")?.value ?? ",").normalize("NFKC"),
|
|
35
|
+
decimal: parts.find((part) => part.type === "decimal")?.value ?? ".",
|
|
36
|
+
primaryGroupSize: hasGrouping && primary != null ? primary : 3,
|
|
37
|
+
secondaryGroupSize: hasGrouping && secondary != null ? secondary : 3
|
|
38
|
+
};
|
|
39
|
+
symbolsByLocale.set(key, symbols);
|
|
40
|
+
}
|
|
41
|
+
return symbols;
|
|
42
|
+
}
|
|
43
|
+
const DECIMAL_DIGIT = /\p{Nd}/u;
|
|
44
|
+
const CURRENCY = /\p{Sc}/u;
|
|
45
|
+
const INVISIBLES = /[\u200B-\u200D\u200E\u200F\u061C\u2066-\u2069\uFEFF]/g;
|
|
46
|
+
const MINUS_SIGNS = "−‒–-";
|
|
47
|
+
const NUMBER_BODY = new RegExp(`^[0-9,.' ’٫٬]+$`);
|
|
48
|
+
/** 没有分组、最多一个句点,也就是 `Number()` 能直接读的样子。 */
|
|
49
|
+
const MACHINE_NUMBER = /^(?:\d+(?:\.\d*)?|\.\d+)$/;
|
|
50
|
+
/** 十进制数字的数值。每种数字从 0 起连续排,往回找到 0 即可。 */
|
|
51
|
+
function digitValue(char) {
|
|
52
|
+
const codePoint = char.codePointAt(0);
|
|
53
|
+
if (codePoint == null) return null;
|
|
54
|
+
for (let zero = codePoint; codePoint - zero < 10; zero--) if (!DECIMAL_DIGIT.test(String.fromCodePoint(zero - 1))) return codePoint - zero;
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
function toAsciiDigits(text) {
|
|
58
|
+
let out = "";
|
|
59
|
+
for (const char of text) {
|
|
60
|
+
if (!DECIMAL_DIGIT.test(char)) {
|
|
61
|
+
out += char;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
const value = digitValue(char);
|
|
65
|
+
if (value == null) return null;
|
|
66
|
+
out += String(value);
|
|
67
|
+
}
|
|
68
|
+
return out;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* 按一种读法把数字和分隔符收成机器数字。不成组就返回 null。
|
|
72
|
+
* `minGroups` 是至少要看到几个分组符,才相信它是分组而不是小数点。
|
|
73
|
+
*/
|
|
74
|
+
function readUnder(core, group, decimal, primaryGroupSize, secondaryGroupSize, minGroups) {
|
|
75
|
+
let intText = core;
|
|
76
|
+
let fracText = null;
|
|
77
|
+
if (decimal !== "" && core.includes(decimal)) {
|
|
78
|
+
const at = core.indexOf(decimal);
|
|
79
|
+
if (core.includes(decimal, at + decimal.length)) return null;
|
|
80
|
+
intText = core.slice(0, at);
|
|
81
|
+
fracText = core.slice(at + decimal.length);
|
|
82
|
+
if (!/^\d*$/.test(fracText)) return null;
|
|
83
|
+
}
|
|
84
|
+
let digits;
|
|
85
|
+
if (group !== "" && intText.includes(group)) {
|
|
86
|
+
const chunks = intText.split(group);
|
|
87
|
+
if (chunks.length - 1 < minGroups || !chunks.every((chunk) => /^\d+$/.test(chunk))) return null;
|
|
88
|
+
const first = chunks[0] ?? "";
|
|
89
|
+
if ((chunks[chunks.length - 1] ?? "").length !== primaryGroupSize || first.length > secondaryGroupSize) return null;
|
|
90
|
+
for (let index = 1; index < chunks.length - 1; index++) if ((chunks[index] ?? "").length !== secondaryGroupSize) return null;
|
|
91
|
+
digits = chunks.join("");
|
|
92
|
+
} else {
|
|
93
|
+
if (!/^\d*$/.test(intText)) return null;
|
|
94
|
+
digits = intText;
|
|
95
|
+
}
|
|
96
|
+
if (digits === "" && (fracText == null || fracText === "")) return null;
|
|
97
|
+
return fracText == null ? digits : `${digits}.${fracText}`;
|
|
98
|
+
}
|
|
99
|
+
/** 没有语言拿来当小数点的分隔符。出现一次、组宽正确,就可以当分组。 */
|
|
100
|
+
function isGroupOnlySeparator(separator) {
|
|
101
|
+
return /^[\s'\u2019]$/.test(separator);
|
|
102
|
+
}
|
|
103
|
+
function toPlainNumber(core, locale) {
|
|
104
|
+
if (!NUMBER_BODY.test(core)) return null;
|
|
105
|
+
const { group, decimal, primaryGroupSize, secondaryGroupSize } = getLocaleNumberSymbols(locale);
|
|
106
|
+
const inLocale = readUnder(core, group, decimal, primaryGroupSize, secondaryGroupSize, 1);
|
|
107
|
+
if (inLocale != null) return inLocale;
|
|
108
|
+
if (MACHINE_NUMBER.test(core)) return core;
|
|
109
|
+
const separators = [...new Set(core.replace(/\d/g, ""))];
|
|
110
|
+
if (separators.length === 0 || separators.length > 2) return null;
|
|
111
|
+
for (const candidate of separators) {
|
|
112
|
+
const occurrences = core.split(candidate).length - 1;
|
|
113
|
+
const minGroups = isGroupOnlySeparator(candidate) ? 1 : 2;
|
|
114
|
+
if (occurrences < minGroups) continue;
|
|
115
|
+
const other = separators.find((item) => item !== candidate) ?? "";
|
|
116
|
+
if (other !== "" && core.split(other).length - 1 !== 1) continue;
|
|
117
|
+
const read = readUnder(core, candidate, other, 3, 3, minGroups);
|
|
118
|
+
if (read != null) return read;
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
function stripCurrency(text) {
|
|
123
|
+
let out = text.trim();
|
|
124
|
+
if (CURRENCY.test(out.charAt(0))) out = out.slice(1).trim();
|
|
125
|
+
if (CURRENCY.test(out.charAt(out.length - 1))) out = out.slice(0, -1).trim();
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 按 `locale` 的写法读一个数字:分组、小数点、数字字形、可选的货币符号,以及表格贴出来的样子。
|
|
130
|
+
* 读不出就返回 null。`123-456-789` 不是数字。
|
|
131
|
+
*/
|
|
132
|
+
function parseLocaleNumber(text, locale) {
|
|
133
|
+
const normalized = toAsciiDigits(text.normalize("NFKC").replace(INVISIBLES, ""));
|
|
134
|
+
if (normalized == null) return null;
|
|
135
|
+
let rest = normalized.trim();
|
|
136
|
+
let sign = 1;
|
|
137
|
+
const accounting = /^\((.*)\)$/s.exec(rest);
|
|
138
|
+
if (accounting) {
|
|
139
|
+
sign = -1;
|
|
140
|
+
rest = (accounting[1] ?? "").trim();
|
|
141
|
+
}
|
|
142
|
+
rest = stripCurrency(rest);
|
|
143
|
+
let hasWrittenSign = false;
|
|
144
|
+
const leadingSign = new RegExp(`^([+${MINUS_SIGNS}])\\s*`).exec(rest);
|
|
145
|
+
if (leadingSign) {
|
|
146
|
+
hasWrittenSign = true;
|
|
147
|
+
sign = leadingSign[1] === "+" ? sign : -sign;
|
|
148
|
+
rest = rest.slice(leadingSign[0].length);
|
|
149
|
+
} else {
|
|
150
|
+
const trailingSign = new RegExp(`\\s*([+${MINUS_SIGNS}])$`).exec(rest);
|
|
151
|
+
if (trailingSign) {
|
|
152
|
+
hasWrittenSign = true;
|
|
153
|
+
sign = trailingSign[1] === "+" ? sign : -sign;
|
|
154
|
+
rest = rest.slice(0, rest.length - trailingSign[0].length);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (accounting && hasWrittenSign) return null;
|
|
158
|
+
rest = stripCurrency(rest);
|
|
159
|
+
let exponent = 0;
|
|
160
|
+
const exponentMatch = /\s*e\s*([+-]?\d+)$/i.exec(rest);
|
|
161
|
+
if (exponentMatch) {
|
|
162
|
+
exponent = Number(exponentMatch[1]);
|
|
163
|
+
rest = rest.slice(0, rest.length - exponentMatch[0].length);
|
|
164
|
+
}
|
|
165
|
+
const core = rest.trim();
|
|
166
|
+
if (core === "") return null;
|
|
167
|
+
const plain = toPlainNumber(core, locale);
|
|
168
|
+
if (plain == null) return null;
|
|
169
|
+
const magnitude = Number(plain);
|
|
170
|
+
if (!Number.isFinite(magnitude)) return null;
|
|
171
|
+
const scaled = exponent === 0 ? magnitude : Number((magnitude * 10 ** exponent).toPrecision(15));
|
|
172
|
+
if (!Number.isFinite(scaled)) return null;
|
|
173
|
+
const result = sign * scaled;
|
|
174
|
+
return Object.is(result, -0) ? 0 : result;
|
|
175
|
+
}
|
|
176
|
+
/** 聚焦时显示的文字:机器数字,只把小数点换成当前语言的。 */
|
|
177
|
+
function formatEditableNumber(value, locale) {
|
|
178
|
+
const { decimal } = getLocaleNumberSymbols(locale);
|
|
179
|
+
const raw = String(value);
|
|
180
|
+
return decimal === "." ? raw : raw.replace(".", decimal);
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
//#region src/NumberInput/numberInputCommit.ts
|
|
184
|
+
function parseNumericInput(input, options) {
|
|
185
|
+
const trimmed = input.trim();
|
|
186
|
+
if (trimmed === "") return null;
|
|
187
|
+
const value = parseLocaleNumber(trimmed, options.locale);
|
|
188
|
+
if (value == null || !Number.isFinite(value)) return null;
|
|
189
|
+
if (options.isIntegerOnly && !Number.isInteger(value)) return null;
|
|
190
|
+
return value;
|
|
191
|
+
}
|
|
192
|
+
/** 草稿在范围内才算有效。超出范围返回 null,输入过程中用来标成无效。 */
|
|
193
|
+
function parseNumberInput(input, options) {
|
|
194
|
+
const value = parseNumericInput(input, options);
|
|
195
|
+
if (value === null) return null;
|
|
196
|
+
if (options.min != null && value < options.min) return null;
|
|
197
|
+
if (options.max != null && value > options.max) return null;
|
|
198
|
+
return value;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* 整段草稿只在离开或按 Enter 时做一次决定。
|
|
202
|
+
* 空草稿:有清除按钮就清空,否则回到原值。
|
|
203
|
+
* 读不出来就回到原值,不把前面几个数字先交上去。
|
|
204
|
+
* 超出范围收到最近的边界。
|
|
205
|
+
*/
|
|
206
|
+
function resolveNumberInputCommit(input, options) {
|
|
207
|
+
if (input.trim() === "") return options.hasClear ? { type: "clear" } : { type: "revert" };
|
|
208
|
+
const value = parseNumericInput(input, options);
|
|
209
|
+
if (value === null) return { type: "revert" };
|
|
210
|
+
const min = options.min == null ? null : options.isIntegerOnly ? Math.ceil(options.min) : options.min;
|
|
211
|
+
const max = options.max == null ? null : options.isIntegerOnly ? Math.floor(options.max) : options.max;
|
|
212
|
+
if (min != null && max != null && min > max) return { type: "revert" };
|
|
213
|
+
const committedValue = min != null && value < min ? min : max != null && value > max ? max : value;
|
|
214
|
+
return {
|
|
215
|
+
type: "commit",
|
|
216
|
+
value: committedValue,
|
|
217
|
+
didClamp: committedValue !== value
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/NumberInput/NumberInput.vue
|
|
222
|
+
const _hoisted_1 = [
|
|
223
|
+
"data-status",
|
|
224
|
+
"data-disabled",
|
|
225
|
+
"data-readonly"
|
|
226
|
+
];
|
|
227
|
+
const _hoisted_2 = {
|
|
228
|
+
key: 0,
|
|
229
|
+
class: "astryx-number-input-icon",
|
|
230
|
+
"aria-hidden": "true"
|
|
231
|
+
};
|
|
232
|
+
const _hoisted_3 = [
|
|
233
|
+
"id",
|
|
234
|
+
"inputmode",
|
|
235
|
+
"value",
|
|
236
|
+
"name",
|
|
237
|
+
"placeholder",
|
|
238
|
+
"autocomplete",
|
|
239
|
+
"disabled",
|
|
240
|
+
"readonly",
|
|
241
|
+
"aria-disabled",
|
|
242
|
+
"aria-valuemin",
|
|
243
|
+
"aria-valuemax",
|
|
244
|
+
"aria-valuenow",
|
|
245
|
+
"aria-valuetext",
|
|
246
|
+
"aria-required",
|
|
247
|
+
"aria-invalid",
|
|
248
|
+
"aria-labelledby",
|
|
249
|
+
"aria-describedby",
|
|
250
|
+
"data-autofocus",
|
|
251
|
+
"aria-label"
|
|
252
|
+
];
|
|
253
|
+
const _hoisted_4 = {
|
|
254
|
+
key: 5,
|
|
255
|
+
class: "astryx-number-input-buttons"
|
|
256
|
+
};
|
|
257
|
+
const _hoisted_5 = ["disabled", "aria-label"];
|
|
258
|
+
const _hoisted_6 = ["disabled", "aria-label"];
|
|
259
|
+
const _hoisted_7 = ["name", "value"];
|
|
260
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
261
|
+
name: "AstryxNumberInput",
|
|
262
|
+
inheritAttrs: false,
|
|
263
|
+
__name: "NumberInput",
|
|
264
|
+
props: {
|
|
265
|
+
modelValue: { default: null },
|
|
266
|
+
id: {},
|
|
267
|
+
placeholder: { default: "" },
|
|
268
|
+
min: {},
|
|
269
|
+
max: {},
|
|
270
|
+
step: { default: 1 },
|
|
271
|
+
isDisabled: { type: Boolean },
|
|
272
|
+
disabled: { type: Boolean },
|
|
273
|
+
disabledMessage: {},
|
|
274
|
+
disabledReason: {},
|
|
275
|
+
isReadOnly: { type: Boolean },
|
|
276
|
+
size: { default: "md" },
|
|
277
|
+
label: {},
|
|
278
|
+
description: {},
|
|
279
|
+
isLabelHidden: { type: Boolean },
|
|
280
|
+
isOptional: { type: Boolean },
|
|
281
|
+
isRequired: { type: Boolean },
|
|
282
|
+
labelTooltip: {},
|
|
283
|
+
labelIcon: {},
|
|
284
|
+
startIcon: {},
|
|
285
|
+
units: {},
|
|
286
|
+
hasClear: { type: Boolean },
|
|
287
|
+
clearable: { type: Boolean },
|
|
288
|
+
hasNumberSteppers: { type: Boolean },
|
|
289
|
+
hasAutoFocus: { type: Boolean },
|
|
290
|
+
isIntegerOnly: { type: Boolean },
|
|
291
|
+
isWheelEnabled: {
|
|
292
|
+
type: Boolean,
|
|
293
|
+
default: true
|
|
294
|
+
},
|
|
295
|
+
formatValue: {},
|
|
296
|
+
autoComplete: {},
|
|
297
|
+
width: {},
|
|
298
|
+
htmlName: {},
|
|
299
|
+
name: {},
|
|
300
|
+
status: {},
|
|
301
|
+
statusVariant: { default: "attached" },
|
|
302
|
+
containerClass: { type: [
|
|
303
|
+
Boolean,
|
|
304
|
+
null,
|
|
305
|
+
String,
|
|
306
|
+
Object,
|
|
307
|
+
Array
|
|
308
|
+
] },
|
|
309
|
+
containerStyle: { type: [
|
|
310
|
+
Boolean,
|
|
311
|
+
null,
|
|
312
|
+
String,
|
|
313
|
+
Object,
|
|
314
|
+
Array
|
|
315
|
+
] },
|
|
316
|
+
controlClass: { type: [
|
|
317
|
+
Boolean,
|
|
318
|
+
null,
|
|
319
|
+
String,
|
|
320
|
+
Object,
|
|
321
|
+
Array
|
|
322
|
+
] },
|
|
323
|
+
controlStyle: { type: [
|
|
324
|
+
Boolean,
|
|
325
|
+
null,
|
|
326
|
+
String,
|
|
327
|
+
Object,
|
|
328
|
+
Array
|
|
329
|
+
] }
|
|
330
|
+
},
|
|
331
|
+
emits: [
|
|
332
|
+
"update:modelValue",
|
|
333
|
+
"change",
|
|
334
|
+
"focus",
|
|
335
|
+
"blur",
|
|
336
|
+
"enter",
|
|
337
|
+
"keydown"
|
|
338
|
+
],
|
|
339
|
+
setup(__props, { emit: __emit }) {
|
|
340
|
+
const props = __props;
|
|
341
|
+
const emit = __emit;
|
|
342
|
+
const PassThrough = defineComponent({
|
|
343
|
+
name: "NumberInputPassThrough",
|
|
344
|
+
setup(_, { slots }) {
|
|
345
|
+
return () => slots.default?.({});
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
const attrs = useAttrs();
|
|
349
|
+
const inputElement = useTemplateRef("input");
|
|
350
|
+
const container = useTemplateRef("container");
|
|
351
|
+
const generatedId = `astryx-number-input-${useId()}`;
|
|
352
|
+
const unitsId = `${generatedId}-units`;
|
|
353
|
+
const disabledDescriptionId = `${generatedId}-disabled`;
|
|
354
|
+
const disabledTooltipId = `${generatedId}-tooltip`;
|
|
355
|
+
const inputId = computed(() => props.id ?? generatedId);
|
|
356
|
+
const messages = useAstryxMessages();
|
|
357
|
+
const locale = useAstryxLocale();
|
|
358
|
+
const incrementLabel = computed(() => messages.value.numberInput.increment(props.label));
|
|
359
|
+
const decrementLabel = computed(() => messages.value.numberInput.decrement(props.label));
|
|
360
|
+
const resolvedClearLabel = computed(() => messages.value.numberInput.clear(props.label));
|
|
361
|
+
const ariaRequired = useAriaRequired(props);
|
|
362
|
+
const isDisabled = computed(() => Boolean(props.isDisabled || props.disabled));
|
|
363
|
+
const isReadOnly = computed(() => Boolean(props.isReadOnly));
|
|
364
|
+
const isIntegerOnly = computed(() => Boolean(props.isIntegerOnly));
|
|
365
|
+
const hasClear = computed(() => Boolean(props.hasClear || props.clearable));
|
|
366
|
+
const resolvedName = computed(() => props.htmlName ?? props.name);
|
|
367
|
+
const disabledMessage = computed(() => props.disabledMessage ?? props.disabledReason);
|
|
368
|
+
const showsDisabledMessage = computed(() => isDisabled.value && !!disabledMessage.value?.trim());
|
|
369
|
+
const disabledTooltip = useButtonTooltip(showsDisabledMessage);
|
|
370
|
+
const icon = computed(() => props.startIcon ? toRaw(props.startIcon) : void 0);
|
|
371
|
+
const labelIcon = computed(() => props.labelIcon ? toRaw(props.labelIcon) : void 0);
|
|
372
|
+
/** 正在编辑的原始文本;null 表示没有未提交的输入,按聚焦状态决定显示什么 */
|
|
373
|
+
const draft = shallowRef(null);
|
|
374
|
+
const isFocused = shallowRef(false);
|
|
375
|
+
const formattedText = computed(() => {
|
|
376
|
+
if (props.modelValue == null) return "";
|
|
377
|
+
return props.formatValue?.(props.modelValue) ?? String(props.modelValue);
|
|
378
|
+
});
|
|
379
|
+
const displayValue = computed(() => {
|
|
380
|
+
if (draft.value !== null) return draft.value;
|
|
381
|
+
if (props.modelValue == null) return "";
|
|
382
|
+
return isFocused.value ? formatEditableNumber(props.modelValue, locale.value) : formattedText.value;
|
|
383
|
+
});
|
|
384
|
+
function draftOptions() {
|
|
385
|
+
return {
|
|
386
|
+
min: props.min,
|
|
387
|
+
max: props.max,
|
|
388
|
+
isIntegerOnly: isIntegerOnly.value,
|
|
389
|
+
locale: locale.value
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
/** 草稿文本是否有问题:解析不出数字,或者跑出范围。空草稿不算无效。 */
|
|
393
|
+
const isDraftValid = computed(() => {
|
|
394
|
+
if (draft.value === null || draft.value.trim() === "") return true;
|
|
395
|
+
return parseNumberInput(draft.value, draftOptions()) !== null;
|
|
396
|
+
});
|
|
397
|
+
/** 步进从草稿的读数走。读不出来就用已经提交的值。 */
|
|
398
|
+
const valueForStepping = computed(() => {
|
|
399
|
+
if (draft.value === null) return props.modelValue ?? null;
|
|
400
|
+
if (draft.value.trim() === "") return null;
|
|
401
|
+
return parseNumberInput(draft.value, draftOptions()) ?? props.modelValue ?? null;
|
|
402
|
+
});
|
|
403
|
+
const modelValueRef = computed({
|
|
404
|
+
get: () => props.modelValue ?? null,
|
|
405
|
+
set: (value) => {
|
|
406
|
+
emit("update:modelValue", value);
|
|
407
|
+
emit("change", value);
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
const numberField = useNumberField({
|
|
411
|
+
value: modelValueRef,
|
|
412
|
+
min: () => props.min,
|
|
413
|
+
max: () => props.max,
|
|
414
|
+
step: () => props.step,
|
|
415
|
+
disabled: isDisabled,
|
|
416
|
+
readOnly: isReadOnly,
|
|
417
|
+
integerOnly: isIntegerOnly,
|
|
418
|
+
onChange: (value) => {
|
|
419
|
+
modelValueRef.value = value;
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
function resolvedStatus(status) {
|
|
423
|
+
if (status == null || status === "default") return void 0;
|
|
424
|
+
if (typeof status === "string") return { type: status };
|
|
425
|
+
return status;
|
|
426
|
+
}
|
|
427
|
+
const statusValue = computed(() => resolvedStatus(props.status));
|
|
428
|
+
const statusType = computed(() => statusValue.value?.type);
|
|
429
|
+
const showsField = computed(() => {
|
|
430
|
+
if (props.isLabelHidden && !props.description && !statusValue.value?.message) return false;
|
|
431
|
+
return Boolean(props.label || props.description || statusValue.value?.message);
|
|
432
|
+
});
|
|
433
|
+
const shell = computed(() => showsField.value ? _sfc_main$6 : PassThrough);
|
|
434
|
+
const fieldBindings = computed(() => showsField.value ? {
|
|
435
|
+
label: props.label ?? "",
|
|
436
|
+
inputId: inputId.value,
|
|
437
|
+
description: props.description,
|
|
438
|
+
isLabelHidden: props.isLabelHidden || !props.label,
|
|
439
|
+
isDisabled: isDisabled.value,
|
|
440
|
+
isOptional: props.isOptional,
|
|
441
|
+
isRequired: props.isRequired,
|
|
442
|
+
labelIcon: labelIcon.value,
|
|
443
|
+
labelTooltip: props.labelTooltip,
|
|
444
|
+
status: statusValue.value,
|
|
445
|
+
statusVariant: props.statusVariant,
|
|
446
|
+
width: props.width
|
|
447
|
+
} : {});
|
|
448
|
+
const parts = useFieldPartStyling({
|
|
449
|
+
component: "NumberInput",
|
|
450
|
+
props,
|
|
451
|
+
attrs,
|
|
452
|
+
reservedAttrs: [
|
|
453
|
+
"id",
|
|
454
|
+
"value",
|
|
455
|
+
"type",
|
|
456
|
+
"disabled",
|
|
457
|
+
"readonly",
|
|
458
|
+
"autofocus",
|
|
459
|
+
"role",
|
|
460
|
+
"inputmode",
|
|
461
|
+
"aria-labelledby",
|
|
462
|
+
"aria-describedby",
|
|
463
|
+
"aria-required",
|
|
464
|
+
"aria-invalid",
|
|
465
|
+
"aria-disabled",
|
|
466
|
+
"aria-valuenow",
|
|
467
|
+
"aria-valuemin",
|
|
468
|
+
"aria-valuemax",
|
|
469
|
+
"aria-valuetext",
|
|
470
|
+
"name"
|
|
471
|
+
]
|
|
472
|
+
});
|
|
473
|
+
useDevWarning("NumberInput", "`containerClass`/`containerStyle` have no effect here because no Field box renders.", () => !showsField.value && (props.containerClass != null && props.containerClass !== false || props.containerStyle != null && props.containerStyle !== false));
|
|
474
|
+
function inputAttrs() {
|
|
475
|
+
return parts.forwardedAttrs();
|
|
476
|
+
}
|
|
477
|
+
function describedBy(fieldIds) {
|
|
478
|
+
return [
|
|
479
|
+
attrs["aria-describedby"],
|
|
480
|
+
fieldIds,
|
|
481
|
+
props.units ? unitsId : void 0,
|
|
482
|
+
showsDisabledMessage.value ? disabledDescriptionId : void 0
|
|
483
|
+
].filter(Boolean).join(" ") || void 0;
|
|
484
|
+
}
|
|
485
|
+
function labelledBy(fieldLabelId) {
|
|
486
|
+
return [fieldLabelId, attrs["aria-labelledby"]].filter(Boolean).join(" ") || void 0;
|
|
487
|
+
}
|
|
488
|
+
function nextStep(direction) {
|
|
489
|
+
return computeSteppedValue({
|
|
490
|
+
currentValue: valueForStepping.value,
|
|
491
|
+
direction,
|
|
492
|
+
min: props.min ?? null,
|
|
493
|
+
max: props.max ?? null,
|
|
494
|
+
step: props.step,
|
|
495
|
+
integerOnly: isIntegerOnly.value
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
const canIncrement = computed(() => nextStep(1) !== valueForStepping.value);
|
|
499
|
+
const canDecrement = computed(() => nextStep(-1) !== valueForStepping.value);
|
|
500
|
+
function stepBy(direction) {
|
|
501
|
+
if (isDisabled.value || isReadOnly.value) return;
|
|
502
|
+
const next = nextStep(direction);
|
|
503
|
+
if (next == null) return;
|
|
504
|
+
draft.value = null;
|
|
505
|
+
if (next !== (props.modelValue ?? null)) numberField.setValue(next);
|
|
506
|
+
}
|
|
507
|
+
function focusInput() {
|
|
508
|
+
inputElement.value?.focus({ preventScroll: true });
|
|
509
|
+
}
|
|
510
|
+
function onInput(event) {
|
|
511
|
+
const target = event.target;
|
|
512
|
+
if (isDisabled.value || isReadOnly.value) {
|
|
513
|
+
target.value = displayValue.value;
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
draft.value = target.value;
|
|
517
|
+
}
|
|
518
|
+
function commitDraft(trigger) {
|
|
519
|
+
if (draft.value === null) return;
|
|
520
|
+
const decision = resolveNumberInputCommit(draft.value, {
|
|
521
|
+
...draftOptions(),
|
|
522
|
+
hasClear: hasClear.value
|
|
523
|
+
});
|
|
524
|
+
if (trigger === "blur" || decision.type === "commit" && decision.didClamp) draft.value = null;
|
|
525
|
+
if (decision.type === "clear") {
|
|
526
|
+
if (hasClear.value && props.modelValue != null) numberField.setValue(null);
|
|
527
|
+
} else if (decision.type === "commit" && decision.value !== props.modelValue) numberField.setValue(decision.value);
|
|
528
|
+
}
|
|
529
|
+
function onFocus(event) {
|
|
530
|
+
draft.value = null;
|
|
531
|
+
isFocused.value = true;
|
|
532
|
+
disabledTooltip.onTooltipPointerEnter();
|
|
533
|
+
emit("focus", event);
|
|
534
|
+
}
|
|
535
|
+
function onBlur(event) {
|
|
536
|
+
commitDraft("blur");
|
|
537
|
+
isFocused.value = false;
|
|
538
|
+
disabledTooltip.onBlur();
|
|
539
|
+
emit("blur", event);
|
|
540
|
+
}
|
|
541
|
+
function onKeyDown(event) {
|
|
542
|
+
if (event.isComposing || event.keyCode === 229) return;
|
|
543
|
+
if (!(event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) && (event.key === "ArrowUp" || event.key === "ArrowDown")) {
|
|
544
|
+
emit("keydown", event);
|
|
545
|
+
if (event.defaultPrevented) return;
|
|
546
|
+
event.preventDefault();
|
|
547
|
+
stepBy(event.key === "ArrowUp" ? 1 : -1);
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
if (event.key === "Enter") {
|
|
551
|
+
commitDraft("enter");
|
|
552
|
+
emit("enter", event);
|
|
553
|
+
}
|
|
554
|
+
emit("keydown", event);
|
|
555
|
+
}
|
|
556
|
+
function onWheel(event) {
|
|
557
|
+
if (!props.isWheelEnabled || isDisabled.value || isReadOnly.value) return;
|
|
558
|
+
if (document.activeElement !== inputElement.value) return;
|
|
559
|
+
if (event.deltaY === 0 || event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
|
|
560
|
+
event.preventDefault();
|
|
561
|
+
event.stopPropagation();
|
|
562
|
+
stepBy(event.deltaY < 0 ? 1 : -1);
|
|
563
|
+
}
|
|
564
|
+
async function clearValue() {
|
|
565
|
+
if (isDisabled.value || isReadOnly.value) return;
|
|
566
|
+
draft.value = null;
|
|
567
|
+
numberField.setValue(null);
|
|
568
|
+
await nextTick();
|
|
569
|
+
focusInput();
|
|
570
|
+
}
|
|
571
|
+
function focusFromContainer(event) {
|
|
572
|
+
if (isDisabled.value) return;
|
|
573
|
+
const target = event.target;
|
|
574
|
+
if (target instanceof Element && target.closest("input,button,a,select,textarea,[role=\"button\"]")) return;
|
|
575
|
+
if (inputElement.value?.ownerDocument.getSelection()?.toString()) return;
|
|
576
|
+
focusInput();
|
|
577
|
+
}
|
|
578
|
+
function stepFromButton(direction) {
|
|
579
|
+
focusInput();
|
|
580
|
+
stepBy(direction);
|
|
581
|
+
}
|
|
582
|
+
onMounted(() => {
|
|
583
|
+
if (props.hasAutoFocus) focusInput();
|
|
584
|
+
});
|
|
585
|
+
return (_ctx, _cache) => {
|
|
586
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
587
|
+
(openBlock(), createBlock(resolveDynamicComponent(shell.value), mergeProps(fieldBindings.value, {
|
|
588
|
+
class: showsField.value ? unref(parts).containerClass.value : void 0,
|
|
589
|
+
style: showsField.value ? unref(parts).containerStyle.value : void 0
|
|
590
|
+
}), createSlots({
|
|
591
|
+
default: withCtx((field) => [createElementVNode("div", {
|
|
592
|
+
ref_key: "container",
|
|
593
|
+
ref: container,
|
|
594
|
+
class: normalizeClass(["astryx-number-input", [`size-${props.size}`, unref(parts).controlClass()]]),
|
|
595
|
+
style: normalizeStyle(unref(parts).controlStyle()),
|
|
596
|
+
"data-status": statusType.value,
|
|
597
|
+
"data-disabled": isDisabled.value || void 0,
|
|
598
|
+
"data-readonly": isReadOnly.value || void 0,
|
|
599
|
+
onPointerup: focusFromContainer,
|
|
600
|
+
onPointerenter: _cache[4] || (_cache[4] = (...args) => unref(disabledTooltip).onPointerEnter && unref(disabledTooltip).onPointerEnter(...args)),
|
|
601
|
+
onPointerleave: _cache[5] || (_cache[5] = (...args) => unref(disabledTooltip).onPointerLeave && unref(disabledTooltip).onPointerLeave(...args))
|
|
602
|
+
}, [
|
|
603
|
+
_ctx.$slots.icon || icon.value ? (openBlock(), createElementBlock("span", _hoisted_2, [renderSlot(_ctx.$slots, "icon", {}, () => [icon.value ? (openBlock(), createBlock(resolveDynamicComponent(icon.value), { key: 0 })) : createCommentVNode("v-if", true)])])) : createCommentVNode("v-if", true),
|
|
604
|
+
createElementVNode("input", mergeProps({
|
|
605
|
+
id: inputId.value,
|
|
606
|
+
ref: "input"
|
|
607
|
+
}, inputAttrs(), {
|
|
608
|
+
type: "text",
|
|
609
|
+
class: "astryx-number-input-field",
|
|
610
|
+
inputmode: isIntegerOnly.value ? "numeric" : "decimal",
|
|
611
|
+
role: "spinbutton",
|
|
612
|
+
value: displayValue.value,
|
|
613
|
+
name: resolvedName.value && !isDisabled.value && !props.formatValue ? resolvedName.value : void 0,
|
|
614
|
+
placeholder: props.placeholder,
|
|
615
|
+
autocomplete: props.autoComplete ?? inputAttrs().autocomplete,
|
|
616
|
+
disabled: isDisabled.value && !showsDisabledMessage.value,
|
|
617
|
+
readonly: isReadOnly.value || showsDisabledMessage.value,
|
|
618
|
+
"aria-disabled": showsDisabledMessage.value || void 0,
|
|
619
|
+
"aria-valuemin": props.min ?? void 0,
|
|
620
|
+
"aria-valuemax": props.max ?? void 0,
|
|
621
|
+
"aria-valuenow": props.modelValue ?? void 0,
|
|
622
|
+
"aria-valuetext": props.modelValue == null || !props.formatValue ? void 0 : formattedText.value,
|
|
623
|
+
"aria-required": unref(ariaRequired),
|
|
624
|
+
"aria-invalid": statusType.value === "error" || !isDraftValid.value ? "true" : void 0,
|
|
625
|
+
"aria-labelledby": labelledBy(field?.labelId),
|
|
626
|
+
"aria-describedby": describedBy(field?.describedBy),
|
|
627
|
+
"data-autofocus": props.hasAutoFocus || void 0,
|
|
628
|
+
"aria-label": showsField.value ? void 0 : props.label,
|
|
629
|
+
onInput,
|
|
630
|
+
onKeydown: onKeyDown,
|
|
631
|
+
onFocus,
|
|
632
|
+
onBlur,
|
|
633
|
+
onWheel
|
|
634
|
+
}), null, 16, _hoisted_3),
|
|
635
|
+
props.units ? (openBlock(), createElementBlock("span", {
|
|
636
|
+
key: 1,
|
|
637
|
+
id: unitsId,
|
|
638
|
+
class: "astryx-number-input-units"
|
|
639
|
+
}, toDisplayString(props.units), 1)) : createCommentVNode("v-if", true),
|
|
640
|
+
createVNode(_sfc_main$1, {
|
|
641
|
+
as: "div",
|
|
642
|
+
role: "alert",
|
|
643
|
+
"aria-live": "assertive"
|
|
644
|
+
}, {
|
|
645
|
+
default: withCtx(() => [createTextVNode(toDisplayString(isDraftValid.value ? "" : unref(messages).numberInput.invalidNumber), 1)]),
|
|
646
|
+
_: 1
|
|
647
|
+
}),
|
|
648
|
+
hasClear.value && props.modelValue != null && !isDisabled.value && !isReadOnly.value ? (openBlock(), createBlock(_sfc_main$7, {
|
|
649
|
+
key: 2,
|
|
650
|
+
class: "astryx-number-input-clear",
|
|
651
|
+
label: resolvedClearLabel.value,
|
|
652
|
+
onClick: clearValue
|
|
653
|
+
}, null, 8, ["label"])) : createCommentVNode("v-if", true),
|
|
654
|
+
statusValue.value?.message && props.statusVariant === "tooltip" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
655
|
+
key: 3,
|
|
656
|
+
text: statusValue.value.message,
|
|
657
|
+
type: statusValue.value.type
|
|
658
|
+
}, null, 8, ["text", "type"])) : statusValue.value ? (openBlock(), createBlock(_sfc_main$3, {
|
|
659
|
+
key: 4,
|
|
660
|
+
type: statusValue.value.type
|
|
661
|
+
}, null, 8, ["type"])) : createCommentVNode("v-if", true),
|
|
662
|
+
props.hasNumberSteppers ? (openBlock(), createElementBlock("div", _hoisted_4, [createElementVNode("button", {
|
|
663
|
+
type: "button",
|
|
664
|
+
class: "astryx-number-input-button increment",
|
|
665
|
+
disabled: isDisabled.value || isReadOnly.value || !canIncrement.value,
|
|
666
|
+
"aria-label": incrementLabel.value,
|
|
667
|
+
tabindex: "-1",
|
|
668
|
+
onPointerdown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
|
|
669
|
+
onClick: _cache[1] || (_cache[1] = ($event) => stepFromButton(1))
|
|
670
|
+
}, [createVNode(_sfc_main$5, {
|
|
671
|
+
class: "astryx-number-input-chevron",
|
|
672
|
+
icon: "numberInput:stepperDown",
|
|
673
|
+
size: "xsm"
|
|
674
|
+
})], 40, _hoisted_5), createElementVNode("button", {
|
|
675
|
+
type: "button",
|
|
676
|
+
class: "astryx-number-input-button decrement",
|
|
677
|
+
disabled: isDisabled.value || isReadOnly.value || !canDecrement.value,
|
|
678
|
+
"aria-label": decrementLabel.value,
|
|
679
|
+
tabindex: "-1",
|
|
680
|
+
onPointerdown: _cache[2] || (_cache[2] = withModifiers(() => {}, ["prevent"])),
|
|
681
|
+
onClick: _cache[3] || (_cache[3] = ($event) => stepFromButton(-1))
|
|
682
|
+
}, [createVNode(_sfc_main$5, {
|
|
683
|
+
class: "astryx-number-input-chevron",
|
|
684
|
+
icon: "numberInput:stepperDown",
|
|
685
|
+
size: "xsm"
|
|
686
|
+
})], 40, _hoisted_6)])) : createCommentVNode("v-if", true),
|
|
687
|
+
resolvedName.value && !isDisabled.value && props.formatValue ? (openBlock(), createElementBlock("input", {
|
|
688
|
+
key: 6,
|
|
689
|
+
type: "hidden",
|
|
690
|
+
name: resolvedName.value,
|
|
691
|
+
value: props.modelValue ?? ""
|
|
692
|
+
}, null, 8, _hoisted_7)) : createCommentVNode("v-if", true)
|
|
693
|
+
], 46, _hoisted_1)]),
|
|
694
|
+
_: 2
|
|
695
|
+
}, [_ctx.$slots.labelIcon ? {
|
|
696
|
+
name: "labelIcon",
|
|
697
|
+
fn: withCtx(() => [renderSlot(_ctx.$slots, "labelIcon")]),
|
|
698
|
+
key: "0"
|
|
699
|
+
} : void 0]), 1040, ["class", "style"])),
|
|
700
|
+
showsDisabledMessage.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
701
|
+
key: 0,
|
|
702
|
+
id: disabledDescriptionId
|
|
703
|
+
}, {
|
|
704
|
+
default: withCtx(() => [createTextVNode(toDisplayString(disabledMessage.value), 1)]),
|
|
705
|
+
_: 1
|
|
706
|
+
})) : createCommentVNode("v-if", true),
|
|
707
|
+
showsDisabledMessage.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
708
|
+
key: 1,
|
|
709
|
+
id: disabledTooltipId,
|
|
710
|
+
anchor: container.value,
|
|
711
|
+
open: unref(disabledTooltip).isOpen.value,
|
|
712
|
+
text: disabledMessage.value ?? "",
|
|
713
|
+
onPointerEnter: unref(disabledTooltip).onTooltipPointerEnter,
|
|
714
|
+
onPointerLeave: unref(disabledTooltip).onTooltipPointerLeave
|
|
715
|
+
}, null, 8, [
|
|
716
|
+
"anchor",
|
|
717
|
+
"open",
|
|
718
|
+
"text",
|
|
719
|
+
"onPointerEnter",
|
|
720
|
+
"onPointerLeave"
|
|
721
|
+
])) : createCommentVNode("v-if", true)
|
|
722
|
+
], 64);
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
//#endregion
|
|
727
|
+
export { resolveNumberInputCommit as n, _sfc_main as t };
|