@fragiola/primitives-vue 0.0.0-stage → 0.0.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/LICENSE +21 -0
- package/README.md +41 -2
- package/dist/accordion-CmKuKHkK.js +278 -0
- package/dist/accordion-CmKuKHkK.js.map +1 -0
- package/dist/accordion.d.ts +4 -0
- package/dist/accordion.js +1 -0
- package/dist/alert-dialog-CPG51QOk.js +38 -0
- package/dist/alert-dialog-CPG51QOk.js.map +1 -0
- package/dist/alert-dialog.d.ts +9 -0
- package/dist/alert-dialog.js +1 -0
- package/dist/aspect-ratio-Ba7GaRnV.js +37 -0
- package/dist/aspect-ratio-Ba7GaRnV.js.map +1 -0
- package/dist/aspect-ratio.d.ts +3 -0
- package/dist/aspect-ratio.js +1 -0
- package/dist/async-list-Dc8wqcxe.js +39 -0
- package/dist/async-list-Dc8wqcxe.js.map +1 -0
- package/dist/async-list.d.ts +2 -0
- package/dist/async-list.js +1 -0
- package/dist/autocomplete-virtual-D_2Wuih7.js +55 -0
- package/dist/autocomplete-virtual-D_2Wuih7.js.map +1 -0
- package/dist/autocomplete-virtual.d.ts +2 -0
- package/dist/autocomplete-virtual.js +3 -0
- package/dist/autocomplete.d.ts +6 -0
- package/dist/autocomplete.js +1 -0
- package/dist/avatar-DdDGa6x7.js +166 -0
- package/dist/avatar-DdDGa6x7.js.map +1 -0
- package/dist/avatar.d.ts +3 -0
- package/dist/avatar.js +1 -0
- package/dist/breadcrumbs-BFAjlnC_.js +131 -0
- package/dist/breadcrumbs-BFAjlnC_.js.map +1 -0
- package/dist/breadcrumbs.d.ts +3 -0
- package/dist/breadcrumbs.js +1 -0
- package/dist/button-DVUcUCXc.js +56 -0
- package/dist/button-DVUcUCXc.js.map +1 -0
- package/dist/button-attributes-Ue6sUse5.js +83 -0
- package/dist/button-attributes-Ue6sUse5.js.map +1 -0
- package/dist/button.d.ts +3 -0
- package/dist/button.js +1 -0
- package/dist/calendar-preset-Bjc7rcNX.js +84 -0
- package/dist/calendar-preset-Bjc7rcNX.js.map +1 -0
- package/dist/calendar-preset.d.ts +3 -0
- package/dist/calendar-preset.js +3 -0
- package/dist/calendar-prev-button-jluYmM-3.js +307 -0
- package/dist/calendar-prev-button-jluYmM-3.js.map +1 -0
- package/dist/calendar-root-base-C9dfkl55.js +310 -0
- package/dist/calendar-root-base-C9dfkl55.js.map +1 -0
- package/dist/calendar-view-Djy5iHGK.js +160 -0
- package/dist/calendar-view-Djy5iHGK.js.map +1 -0
- package/dist/calendar-view.d.ts +4 -0
- package/dist/calendar-view.js +4 -0
- package/dist/calendar.d.ts +5 -0
- package/dist/calendar.js +1 -0
- package/dist/carousel-BOacnCmz.js +553 -0
- package/dist/carousel-BOacnCmz.js.map +1 -0
- package/dist/carousel.d.ts +4 -0
- package/dist/carousel.js +1 -0
- package/dist/cascade-select-B-Nf6eOA.js +697 -0
- package/dist/cascade-select-B-Nf6eOA.js.map +1 -0
- package/dist/cascade-select.d.ts +6 -0
- package/dist/cascade-select.js +1 -0
- package/dist/change-details-Bc4-Xzdm.d.ts +37 -0
- package/dist/checkbox-D5NvqFgS.js +230 -0
- package/dist/checkbox-D5NvqFgS.js.map +1 -0
- package/dist/checkbox-group-C3XftlZd.js +104 -0
- package/dist/checkbox-group-C3XftlZd.js.map +1 -0
- package/dist/checkbox-group-context-C0Z5sWM1.js +5 -0
- package/dist/checkbox-group-context-C0Z5sWM1.js.map +1 -0
- package/dist/checkbox-group.d.ts +4 -0
- package/dist/checkbox-group.js +1 -0
- package/dist/checkbox.d.ts +4 -0
- package/dist/checkbox.js +1 -0
- package/dist/clipboard-BM-4-lTv.js +195 -0
- package/dist/clipboard-BM-4-lTv.js.map +1 -0
- package/dist/clipboard.d.ts +4 -0
- package/dist/clipboard.js +1 -0
- package/dist/collapsible-DSCxhlQN.js +158 -0
- package/dist/collapsible-DSCxhlQN.js.map +1 -0
- package/dist/collapsible.d.ts +4 -0
- package/dist/collapsible.js +1 -0
- package/dist/color-area-uEHPo-Nq.js +350 -0
- package/dist/color-area-uEHPo-Nq.js.map +1 -0
- package/dist/color-area.d.ts +4 -0
- package/dist/color-area.js +1 -0
- package/dist/color-field-Di2IbTa3.js +384 -0
- package/dist/color-field-Di2IbTa3.js.map +1 -0
- package/dist/color-field.d.ts +4 -0
- package/dist/color-field.js +1 -0
- package/dist/color-picker-BgFgq5R0.js +311 -0
- package/dist/color-picker-BgFgq5R0.js.map +1 -0
- package/dist/color-picker-binding-CJ-Cbxbj.js +5 -0
- package/dist/color-picker-binding-CJ-Cbxbj.js.map +1 -0
- package/dist/color-picker-popover-Dx6LX0V3.js +233 -0
- package/dist/color-picker-popover-Dx6LX0V3.js.map +1 -0
- package/dist/color-picker-popover.d.ts +6 -0
- package/dist/color-picker-popover.js +1 -0
- package/dist/color-picker.d.ts +4 -0
- package/dist/color-picker.js +1 -0
- package/dist/color-slider-BCqoolnY.js +410 -0
- package/dist/color-slider-BCqoolnY.js.map +1 -0
- package/dist/color-slider.d.ts +4 -0
- package/dist/color-slider.js +1 -0
- package/dist/color-swatch-C-8IN28V.js +54 -0
- package/dist/color-swatch-C-8IN28V.js.map +1 -0
- package/dist/color-swatch-picker-CU1wrhjX.js +312 -0
- package/dist/color-swatch-picker-CU1wrhjX.js.map +1 -0
- package/dist/color-swatch-picker.d.ts +4 -0
- package/dist/color-swatch-picker.js +1 -0
- package/dist/color-swatch.d.ts +3 -0
- package/dist/color-swatch.js +1 -0
- package/dist/color-wheel-F_BoXKON.js +284 -0
- package/dist/color-wheel-F_BoXKON.js.map +1 -0
- package/dist/color-wheel.d.ts +4 -0
- package/dist/color-wheel.js +1 -0
- package/dist/combobox-virtual-DTRTVq5N.js +56 -0
- package/dist/combobox-virtual-DTRTVq5N.js.map +1 -0
- package/dist/combobox-virtual.d.ts +2 -0
- package/dist/combobox-virtual.js +3 -0
- package/dist/combobox.d.ts +6 -0
- package/dist/combobox.js +1 -0
- package/dist/command-virtual-LoTBDEY5.js +59 -0
- package/dist/command-virtual-LoTBDEY5.js.map +1 -0
- package/dist/command-virtual.d.ts +3 -0
- package/dist/command-virtual.js +3 -0
- package/dist/command.d.ts +4 -0
- package/dist/command.js +1 -0
- package/dist/context-menu-zdHIGS9E.js +151 -0
- package/dist/context-menu-zdHIGS9E.js.map +1 -0
- package/dist/context-menu.d.ts +7 -0
- package/dist/context-menu.js +1 -0
- package/dist/date-field-pgSTZiPb.js +78 -0
- package/dist/date-field-pgSTZiPb.js.map +1 -0
- package/dist/date-field-root-base-CYLuAykm.js +212 -0
- package/dist/date-field-root-base-CYLuAykm.js.map +1 -0
- package/dist/date-field.d.ts +4 -0
- package/dist/date-field.js +1 -0
- package/dist/date-picker-input-CiuuRiWZ.js +16 -0
- package/dist/date-picker-input-CiuuRiWZ.js.map +1 -0
- package/dist/date-picker-input-root-base-ExPSLeKw.js +318 -0
- package/dist/date-picker-input-root-base-ExPSLeKw.js.map +1 -0
- package/dist/date-picker-input.d.ts +4 -0
- package/dist/date-picker-input.js +3 -0
- package/dist/date-picker-trigger-C2BlzvfR.js +349 -0
- package/dist/date-picker-trigger-C2BlzvfR.js.map +1 -0
- package/dist/date-picker.d.ts +6 -0
- package/dist/date-picker.js +1 -0
- package/dist/date-range-field-Bygmkl5c.js +80 -0
- package/dist/date-range-field-Bygmkl5c.js.map +1 -0
- package/dist/date-range-field-input-CivpQMYd.js +69 -0
- package/dist/date-range-field-input-CivpQMYd.js.map +1 -0
- package/dist/date-range-field-root-base-BP26TSWz.js +267 -0
- package/dist/date-range-field-root-base-BP26TSWz.js.map +1 -0
- package/dist/date-range-field.d.ts +4 -0
- package/dist/date-range-field.js +1 -0
- package/dist/date-range-picker-input-BUNCCXUY.js +17 -0
- package/dist/date-range-picker-input-BUNCCXUY.js.map +1 -0
- package/dist/date-range-picker-input.d.ts +4 -0
- package/dist/date-range-picker-input.js +3 -0
- package/dist/date-range-picker.d.ts +7 -0
- package/dist/date-range-picker.js +1 -0
- package/dist/dialog-MNjIMCfA.js +38 -0
- package/dist/dialog-MNjIMCfA.js.map +1 -0
- package/dist/dialog-root-base-jbZipaoQ.js +329 -0
- package/dist/dialog-root-base-jbZipaoQ.js.map +1 -0
- package/dist/dialog-viewport-tYqWTs9Q.d.ts +54 -0
- package/dist/dialog.d.ts +9 -0
- package/dist/dialog.js +1 -0
- package/dist/direction-CN_deiZU.js +30 -0
- package/dist/direction-CN_deiZU.js.map +1 -0
- package/dist/direction-context-D-C_P6Lm.js +19 -0
- package/dist/direction-context-D-C_P6Lm.js.map +1 -0
- package/dist/direction.d.ts +2 -0
- package/dist/direction.js +1 -0
- package/dist/drawer-BcnuGtEt.js +357 -0
- package/dist/drawer-BcnuGtEt.js.map +1 -0
- package/dist/drawer.d.ts +9 -0
- package/dist/drawer.js +1 -0
- package/dist/drop-zone-vFJ5Kvsy.js +98 -0
- package/dist/drop-zone-vFJ5Kvsy.js.map +1 -0
- package/dist/drop-zone.d.ts +4 -0
- package/dist/drop-zone.js +1 -0
- package/dist/editable-CabzXgiN.js +436 -0
- package/dist/editable-CabzXgiN.js.map +1 -0
- package/dist/editable.d.ts +4 -0
- package/dist/editable.js +1 -0
- package/dist/field-DQ2d5nhC.js +397 -0
- package/dist/field-DQ2d5nhC.js.map +1 -0
- package/dist/field.d.ts +4 -0
- package/dist/field.js +1 -0
- package/dist/fieldset-CmmDzOPs.js +80 -0
- package/dist/fieldset-CmmDzOPs.js.map +1 -0
- package/dist/fieldset-context-DtEOoG6M.js +5 -0
- package/dist/fieldset-context-DtEOoG6M.js.map +1 -0
- package/dist/fieldset.d.ts +3 -0
- package/dist/fieldset.js +1 -0
- package/dist/file-upload-_Hh-STdv.js +644 -0
- package/dist/file-upload-_Hh-STdv.js.map +1 -0
- package/dist/file-upload.d.ts +4 -0
- package/dist/file-upload.js +1 -0
- package/dist/form-context-DBnVT1lw.js +5 -0
- package/dist/form-context-DBnVT1lw.js.map +1 -0
- package/dist/form-s9HijjTL.js +92 -0
- package/dist/form-s9HijjTL.js.map +1 -0
- package/dist/form.d.ts +3 -0
- package/dist/form.js +1 -0
- package/dist/hover-card-rmd0fD17.js +355 -0
- package/dist/hover-card-rmd0fD17.js.map +1 -0
- package/dist/hover-card.d.ts +9 -0
- package/dist/hover-card.js +1 -0
- package/dist/index-5WtjXdX9.d.ts +63 -0
- package/dist/index-5eBkkEtv.d.ts +36 -0
- package/dist/index-B-vqAG6g.d.ts +33 -0
- package/dist/index-B1uYYVtV.d.ts +18 -0
- package/dist/index-B8E3X1CK.d.ts +66 -0
- package/dist/index-B8Ufhgzu.d.ts +36 -0
- package/dist/index-BJz7OWbi.d.ts +88 -0
- package/dist/index-BMjRueuv.d.ts +40 -0
- package/dist/index-BP7Tmb0E.d.ts +95 -0
- package/dist/index-Bbb1Zgwo.d.ts +50 -0
- package/dist/index-BdJFU5tH.d.ts +28 -0
- package/dist/index-BdfnRo-h.d.ts +55 -0
- package/dist/index-BniQvFN-.d.ts +38 -0
- package/dist/index-Bt0B-8RV.d.ts +14 -0
- package/dist/index-BuWJcRPC.d.ts +18 -0
- package/dist/index-Byf0GNd9.d.ts +41 -0
- package/dist/index-BzHLkAWU.d.ts +35 -0
- package/dist/index-C-QYKtWy.d.ts +28 -0
- package/dist/index-C7nh2Oil.d.ts +40 -0
- package/dist/index-CDKebSlA.d.ts +41 -0
- package/dist/index-CFPqV6qJ.d.ts +72 -0
- package/dist/index-CRJv_zWm.d.ts +37 -0
- package/dist/index-CTzUalDO.d.ts +76 -0
- package/dist/index-CZHLD5cJ.d.ts +17 -0
- package/dist/index-Cgwn5qgy.d.ts +88 -0
- package/dist/index-Ch4h1DFC.d.ts +55 -0
- package/dist/index-Cj3B9gY_.d.ts +50 -0
- package/dist/index-Cj6NwCBD.d.ts +44 -0
- package/dist/index-CkDThwop.d.ts +21 -0
- package/dist/index-Cn-D14iz.d.ts +13 -0
- package/dist/index-CpTiLSql.d.ts +53 -0
- package/dist/index-CqP363e5.d.ts +118 -0
- package/dist/index-Cv4dRdEa.d.ts +72 -0
- package/dist/index-CyI637MF.d.ts +37 -0
- package/dist/index-D11YCkvR.d.ts +42 -0
- package/dist/index-D3yyJGzf.d.ts +74 -0
- package/dist/index-D5PbKxcs.d.ts +26 -0
- package/dist/index-DAYklR-H.d.ts +18 -0
- package/dist/index-DIZSgXHM.d.ts +79 -0
- package/dist/index-DZckp3H0.d.ts +37 -0
- package/dist/index-DaqoBvQf.d.ts +56 -0
- package/dist/index-Df9i45Gr.d.ts +65 -0
- package/dist/index-DqI6n06W.d.ts +59 -0
- package/dist/index-Drp7svmT.d.ts +30 -0
- package/dist/index-DxsUcSGT.d.ts +99 -0
- package/dist/index-Dyyi-1mv.d.ts +35 -0
- package/dist/index-I2ewgOGz.d.ts +76 -0
- package/dist/index-JGhlANKo.d.ts +24 -0
- package/dist/index-KASc7z5u.d.ts +38 -0
- package/dist/index-LTcmDERY.d.ts +65 -0
- package/dist/index-Mf2RPgmw.d.ts +38 -0
- package/dist/index-NdY27G_d.d.ts +58 -0
- package/dist/index-QO79pDtI.d.ts +70 -0
- package/dist/index-S0FIwOSw.d.ts +59 -0
- package/dist/index-UxsyZS_A.d.ts +23 -0
- package/dist/index-W8aOtVIu.d.ts +40 -0
- package/dist/index-WC9xwMaX.d.ts +34 -0
- package/dist/index-Xwb9OtVU.d.ts +7 -0
- package/dist/index-ZWJJ2V_J.d.ts +49 -0
- package/dist/index-_Q_N8ZbU.d.ts +35 -0
- package/dist/index-bC3hHzam.d.ts +101 -0
- package/dist/index-baY49J-s.d.ts +15 -0
- package/dist/index-dCTvA7uS.d.ts +20 -0
- package/dist/index-mhpoLESL.d.ts +77 -0
- package/dist/index-p3t0BKd4.d.ts +22 -0
- package/dist/index-sgaMj_3p.d.ts +69 -0
- package/dist/index-tSLNRqTo.d.ts +33 -0
- package/dist/index-t_lSQgLA.d.ts +1346 -0
- package/dist/index-uL1dEAhG.d.ts +28 -0
- package/dist/index.d.ts +79 -0
- package/dist/index.js +106 -0
- package/dist/label-Ce-gIayi.js +35 -0
- package/dist/label-Ce-gIayi.js.map +1 -0
- package/dist/label.d.ts +3 -0
- package/dist/label.js +1 -0
- package/dist/labelled-part-DB2rXJFG.js +56 -0
- package/dist/labelled-part-DB2rXJFG.js.map +1 -0
- package/dist/link-CZ3ISaPX.js +42 -0
- package/dist/link-CZ3ISaPX.js.map +1 -0
- package/dist/link-attributes-D9UusWws.js +29 -0
- package/dist/link-attributes-D9UusWws.js.map +1 -0
- package/dist/link.d.ts +3 -0
- package/dist/link.js +1 -0
- package/dist/listbox-virtual-He6BWlPj.js +291 -0
- package/dist/listbox-virtual-He6BWlPj.js.map +1 -0
- package/dist/listbox-virtual.d.ts +5 -0
- package/dist/listbox-virtual.js +3 -0
- package/dist/listbox.d.ts +4 -0
- package/dist/listbox.js +1 -0
- package/dist/live-region-style-9ofmajhO.js +46 -0
- package/dist/live-region-style-9ofmajhO.js.map +1 -0
- package/dist/menu-D7TVxPdb.js +144 -0
- package/dist/menu-D7TVxPdb.js.map +1 -0
- package/dist/menu-bar-context-k5vMlwmW.js +13 -0
- package/dist/menu-bar-context-k5vMlwmW.js.map +1 -0
- package/dist/menu-submenu-trigger-ClI2Pm4X.js +885 -0
- package/dist/menu-submenu-trigger-ClI2Pm4X.js.map +1 -0
- package/dist/menu-submenu-trigger-DNH8_uUB.d.ts +127 -0
- package/dist/menu.d.ts +10 -0
- package/dist/menu.js +1 -0
- package/dist/menubar-CQn3AOiQ.js +212 -0
- package/dist/menubar-CQn3AOiQ.js.map +1 -0
- package/dist/menubar.d.ts +3 -0
- package/dist/menubar.js +1 -0
- package/dist/meter-7Qd_WaUY.js +202 -0
- package/dist/meter-7Qd_WaUY.js.map +1 -0
- package/dist/meter.d.ts +3 -0
- package/dist/meter.js +1 -0
- package/dist/month-calendar-root-base-VcD8ZNW5.js +354 -0
- package/dist/month-calendar-root-base-VcD8ZNW5.js.map +1 -0
- package/dist/month-calendar.d.ts +5 -0
- package/dist/month-calendar.js +1 -0
- package/dist/month-picker-DzOYqW1S.js +15 -0
- package/dist/month-picker-DzOYqW1S.js.map +1 -0
- package/dist/month-picker-root-base-ByMK_Mfq.js +158 -0
- package/dist/month-picker-root-base-ByMK_Mfq.js.map +1 -0
- package/dist/month-picker.d.ts +7 -0
- package/dist/month-picker.js +3 -0
- package/dist/month-range-calendar-CJAWu1-Z.js +18 -0
- package/dist/month-range-calendar-CJAWu1-Z.js.map +1 -0
- package/dist/month-range-calendar.d.ts +5 -0
- package/dist/month-range-calendar.js +3 -0
- package/dist/month-range-picker-CRJDG2HG.js +15 -0
- package/dist/month-range-picker-CRJDG2HG.js.map +1 -0
- package/dist/month-range-picker.d.ts +8 -0
- package/dist/month-range-picker.js +3 -0
- package/dist/multiple-calendar-BIb2zfBH.js +176 -0
- package/dist/multiple-calendar-BIb2zfBH.js.map +1 -0
- package/dist/multiple-calendar.d.ts +5 -0
- package/dist/multiple-calendar.js +3 -0
- package/dist/navigation-menu-COTxGol_.js +727 -0
- package/dist/navigation-menu-COTxGol_.js.map +1 -0
- package/dist/navigation-menu.d.ts +5 -0
- package/dist/navigation-menu.js +1 -0
- package/dist/number-field-CqxEnwiS.js +581 -0
- package/dist/number-field-CqxEnwiS.js.map +1 -0
- package/dist/number-field.d.ts +4 -0
- package/dist/number-field.js +1 -0
- package/dist/otp-field-DIDuypLU.js +420 -0
- package/dist/otp-field-DIDuypLU.js.map +1 -0
- package/dist/otp-field.d.ts +4 -0
- package/dist/otp-field.js +1 -0
- package/dist/overlay-handle-DUptsQOb.js +42 -0
- package/dist/overlay-handle-DUptsQOb.js.map +1 -0
- package/dist/overlay-handle-DzC9LJQo.d.ts +16 -0
- package/dist/overlay-portal-Cmn7Dt7E.d.ts +30 -0
- package/dist/overlay-portal-ZNtXmoFd.js +32 -0
- package/dist/overlay-portal-ZNtXmoFd.js.map +1 -0
- package/dist/pagination-BNUjFYxK.js +264 -0
- package/dist/pagination-BNUjFYxK.js.map +1 -0
- package/dist/pagination.d.ts +4 -0
- package/dist/pagination.js +1 -0
- package/dist/parts--mC44S1N.js +1023 -0
- package/dist/parts--mC44S1N.js.map +1 -0
- package/dist/parts-BP00C3Q5.js +874 -0
- package/dist/parts-BP00C3Q5.js.map +1 -0
- package/dist/parts-CMh29O5y.js +14 -0
- package/dist/parts-CMh29O5y.js.map +1 -0
- package/dist/parts-CZqNGRqe.js +20 -0
- package/dist/parts-CZqNGRqe.js.map +1 -0
- package/dist/parts-DMy2yQZs.js +254 -0
- package/dist/parts-DMy2yQZs.js.map +1 -0
- package/dist/parts-DVv0aov9.js +14 -0
- package/dist/parts-DVv0aov9.js.map +1 -0
- package/dist/parts-M3ThgZzl.js +489 -0
- package/dist/parts-M3ThgZzl.js.map +1 -0
- package/dist/parts-stPOp8dr.js +451 -0
- package/dist/parts-stPOp8dr.js.map +1 -0
- package/dist/parts-uxRkRrFr.js +668 -0
- package/dist/parts-uxRkRrFr.js.map +1 -0
- package/dist/password-input-DC39W-do.js +231 -0
- package/dist/password-input-DC39W-do.js.map +1 -0
- package/dist/password-input.d.ts +4 -0
- package/dist/password-input.js +1 -0
- package/dist/popover-BaQTGAYJ.js +328 -0
- package/dist/popover-BaQTGAYJ.js.map +1 -0
- package/dist/popover.d.ts +9 -0
- package/dist/popover.js +1 -0
- package/dist/progress-DH1Xrj73.js +219 -0
- package/dist/progress-DH1Xrj73.js.map +1 -0
- package/dist/progress.d.ts +3 -0
- package/dist/progress.js +1 -0
- package/dist/public-component-AV8E7mGp.js +8 -0
- package/dist/public-component-AV8E7mGp.js.map +1 -0
- package/dist/public-component-DYpU9aDh.d.ts +33 -0
- package/dist/radio-B9YCSnFs.js +159 -0
- package/dist/radio-B9YCSnFs.js.map +1 -0
- package/dist/radio-group-CmSF4FTc.js +173 -0
- package/dist/radio-group-CmSF4FTc.js.map +1 -0
- package/dist/radio-group-context-C196JZ9D.js +5 -0
- package/dist/radio-group-context-C196JZ9D.js.map +1 -0
- package/dist/radio-group.d.ts +4 -0
- package/dist/radio-group.js +1 -0
- package/dist/radio.d.ts +3 -0
- package/dist/radio.js +1 -0
- package/dist/range-calendar-BDbNdL75.js +20 -0
- package/dist/range-calendar-BDbNdL75.js.map +1 -0
- package/dist/range-calendar.d.ts +5 -0
- package/dist/range-calendar.js +1 -0
- package/dist/rating-oC2t52av.js +351 -0
- package/dist/rating-oC2t52av.js.map +1 -0
- package/dist/rating.d.ts +4 -0
- package/dist/rating.js +1 -0
- package/dist/render-part-B5XVbHaS.js +36 -0
- package/dist/render-part-B5XVbHaS.js.map +1 -0
- package/dist/render-part-BaTKiWBp.d.ts +28 -0
- package/dist/render.d.ts +3 -0
- package/dist/render.js +3 -0
- package/dist/roving-context-LyHQFJqZ.js +32 -0
- package/dist/roving-context-LyHQFJqZ.js.map +1 -0
- package/dist/scroll-area-_EApTP33.js +328 -0
- package/dist/scroll-area-_EApTP33.js.map +1 -0
- package/dist/scroll-area.d.ts +3 -0
- package/dist/scroll-area.js +1 -0
- package/dist/search-field-DJIr926A.js +221 -0
- package/dist/search-field-DJIr926A.js.map +1 -0
- package/dist/search-field.d.ts +4 -0
- package/dist/search-field.js +1 -0
- package/dist/segmented-control-BMvmqBpR.js +389 -0
- package/dist/segmented-control-BMvmqBpR.js.map +1 -0
- package/dist/segmented-control.d.ts +4 -0
- package/dist/segmented-control.js +1 -0
- package/dist/select-virtual-BwZrX4bh.js +53 -0
- package/dist/select-virtual-BwZrX4bh.js.map +1 -0
- package/dist/select-virtual.d.ts +3 -0
- package/dist/select-virtual.js +3 -0
- package/dist/select.d.ts +6 -0
- package/dist/select.js +1 -0
- package/dist/separator-SgHyzEHB.js +42 -0
- package/dist/separator-SgHyzEHB.js.map +1 -0
- package/dist/separator.d.ts +3 -0
- package/dist/separator.js +1 -0
- package/dist/slider-DU5Cx7yj.js +539 -0
- package/dist/slider-DU5Cx7yj.js.map +1 -0
- package/dist/slider.d.ts +4 -0
- package/dist/slider.js +1 -0
- package/dist/state-attributes-DhboDeMS.js +14 -0
- package/dist/state-attributes-DhboDeMS.js.map +1 -0
- package/dist/steps-Dl_mMqRB.js +363 -0
- package/dist/steps-Dl_mMqRB.js.map +1 -0
- package/dist/steps.d.ts +4 -0
- package/dist/steps.js +1 -0
- package/dist/switch-CT9QBKOs.js +183 -0
- package/dist/switch-CT9QBKOs.js.map +1 -0
- package/dist/switch.d.ts +4 -0
- package/dist/switch.js +1 -0
- package/dist/tabs-BhVbQ7AV.js +369 -0
- package/dist/tabs-BhVbQ7AV.js.map +1 -0
- package/dist/tabs.d.ts +4 -0
- package/dist/tabs.js +1 -0
- package/dist/tag-group-DdpjWmzb.js +422 -0
- package/dist/tag-group-DdpjWmzb.js.map +1 -0
- package/dist/tag-group.d.ts +4 -0
- package/dist/tag-group.js +1 -0
- package/dist/tags-input-Iw3mST3A.js +627 -0
- package/dist/tags-input-Iw3mST3A.js.map +1 -0
- package/dist/tags-input.d.ts +4 -0
- package/dist/tags-input.js +1 -0
- package/dist/time-field-5Ghk_4SZ.js +76 -0
- package/dist/time-field-5Ghk_4SZ.js.map +1 -0
- package/dist/time-field.d.ts +4 -0
- package/dist/time-field.js +1 -0
- package/dist/time-range-field-DNOZQK4F.js +77 -0
- package/dist/time-range-field-DNOZQK4F.js.map +1 -0
- package/dist/time-range-field.d.ts +4 -0
- package/dist/time-range-field.js +1 -0
- package/dist/toast-DBKxX79M.js +426 -0
- package/dist/toast-DBKxX79M.js.map +1 -0
- package/dist/toast.d.ts +3 -0
- package/dist/toast.js +1 -0
- package/dist/toggle-Cca0PFQv.js +101 -0
- package/dist/toggle-Cca0PFQv.js.map +1 -0
- package/dist/toggle-group-DTUrLX_H.js +102 -0
- package/dist/toggle-group-DTUrLX_H.js.map +1 -0
- package/dist/toggle-group-context-gMEC8r-Z.js +5 -0
- package/dist/toggle-group-context-gMEC8r-Z.js.map +1 -0
- package/dist/toggle-group.d.ts +4 -0
- package/dist/toggle-group.js +1 -0
- package/dist/toggle.d.ts +4 -0
- package/dist/toggle.js +1 -0
- package/dist/toolbar-WU8JwFd0.js +272 -0
- package/dist/toolbar-WU8JwFd0.js.map +1 -0
- package/dist/toolbar.d.ts +3 -0
- package/dist/toolbar.js +1 -0
- package/dist/tooltip-C1kKsTSh.js +358 -0
- package/dist/tooltip-C1kKsTSh.js.map +1 -0
- package/dist/tooltip.d.ts +9 -0
- package/dist/tooltip.js +1 -0
- package/dist/use-color-picker-binding-BrG-whys.js +32 -0
- package/dist/use-color-picker-binding-BrG-whys.js.map +1 -0
- package/dist/use-controllable-B46G4v0A.js +30 -0
- package/dist/use-controllable-B46G4v0A.js.map +1 -0
- package/dist/use-field-control-CdYqr0dK.js +109 -0
- package/dist/use-field-control-CdYqr0dK.js.map +1 -0
- package/dist/use-overlay-root-BkyTQIsX.js +296 -0
- package/dist/use-overlay-root-BkyTQIsX.js.map +1 -0
- package/dist/use-overlay-trigger-D9OXZ_6K.d.ts +12 -0
- package/dist/use-overlay-trigger-KM35pX0a.js +61 -0
- package/dist/use-overlay-trigger-KM35pX0a.js.map +1 -0
- package/dist/use-panel-transition-DF7f1nmF.js +112 -0
- package/dist/use-panel-transition-DF7f1nmF.js.map +1 -0
- package/dist/use-panel-transition-r_BlVRob.d.ts +2 -0
- package/dist/use-positioner-BD24G6q1.js +73 -0
- package/dist/use-positioner-BD24G6q1.js.map +1 -0
- package/dist/use-positioner-D98pYl_K.d.ts +12 -0
- package/dist/use-presence-BcvBOTDI.d.ts +3 -0
- package/dist/use-required-context-CPpEkr4Q.js +11 -0
- package/dist/use-required-context-CPpEkr4Q.js.map +1 -0
- package/dist/use-roving-composite-CW0mE_VU.js +71 -0
- package/dist/use-roving-composite-CW0mE_VU.js.map +1 -0
- package/dist/use-roving-item-B9Cil5Rq.js +42 -0
- package/dist/use-roving-item-B9Cil5Rq.js.map +1 -0
- package/dist/use-segment-group-CAlwM3KP.js +304 -0
- package/dist/use-segment-group-CAlwM3KP.js.map +1 -0
- package/dist/use-virtual-rows-DesBexmk.js +142 -0
- package/dist/use-virtual-rows-DesBexmk.js.map +1 -0
- package/dist/virtual-list-BNvYqnFf.js +49 -0
- package/dist/virtual-list-BNvYqnFf.js.map +1 -0
- package/dist/year-calendar-cYl3WHEM.js +18 -0
- package/dist/year-calendar-cYl3WHEM.js.map +1 -0
- package/dist/year-calendar.d.ts +5 -0
- package/dist/year-calendar.js +3 -0
- package/dist/year-picker-DYQZbF1h.js +15 -0
- package/dist/year-picker-DYQZbF1h.js.map +1 -0
- package/dist/year-picker.d.ts +8 -0
- package/dist/year-picker.js +3 -0
- package/dist/year-range-calendar-ODgfmdiv.js +18 -0
- package/dist/year-range-calendar-ODgfmdiv.js.map +1 -0
- package/dist/year-range-calendar.d.ts +5 -0
- package/dist/year-range-calendar.js +3 -0
- package/dist/year-range-picker-DKXlcy7I.js +15 -0
- package/dist/year-range-picker-DKXlcy7I.js.map +1 -0
- package/dist/year-range-picker.d.ts +8 -0
- package/dist/year-range-picker.js +3 -0
- package/package.json +548 -3
|
@@ -0,0 +1,1023 @@
|
|
|
1
|
+
import { a as useOverlayRoot, n as overlayRootEmits, r as overlayRootProps, t as elementSetter } from "./use-overlay-root-BkyTQIsX.js";
|
|
2
|
+
import { t as useRequiredContext } from "./use-required-context-CPpEkr4Q.js";
|
|
3
|
+
import { n as useProvidedDirection } from "./direction-context-D-C_P6Lm.js";
|
|
4
|
+
import { t as publicComponent } from "./public-component-AV8E7mGp.js";
|
|
5
|
+
import { n as renderPart, t as asProp } from "./render-part-B5XVbHaS.js";
|
|
6
|
+
import { t as stateAttributes } from "./state-attributes-DhboDeMS.js";
|
|
7
|
+
import { n as useOverlayPortal, t as overlayPortalProps } from "./overlay-portal-ZNtXmoFd.js";
|
|
8
|
+
import { n as usePositioner, t as positionerProps } from "./use-positioner-BD24G6q1.js";
|
|
9
|
+
import { t as useControllable } from "./use-controllable-B46G4v0A.js";
|
|
10
|
+
import { n as useFieldControl } from "./use-field-control-CdYqr0dK.js";
|
|
11
|
+
import { Fragment, computed, defineComponent, h, nextTick, provide, ref, shallowRef, toRaw, useId, watch } from "vue";
|
|
12
|
+
import { chipArrows, chipKeyTarget, containsFilter, filterItems, includesItem, itemFormValue, itemLabel, queryIsLabel, scrollIntoViewWithin, stepThroughNone, toggleItem } from "@fragiola/primitives/collection";
|
|
13
|
+
import { getDirection } from "@fragiola/primitives/direction";
|
|
14
|
+
import { openOverlaySession } from "@fragiola/primitives/overlay";
|
|
15
|
+
import { VISUALLY_HIDDEN_INPUT_STYLE, bridgeForm } from "@fragiola/primitives/form";
|
|
16
|
+
// src/components/combobox/combobox-context.ts
|
|
17
|
+
const ComboboxKey = Symbol("Combobox");
|
|
18
|
+
const ComboboxItemKey = Symbol("ComboboxItem");
|
|
19
|
+
const ComboboxGroupKey = Symbol("ComboboxGroup");
|
|
20
|
+
/** The chip's element, read when a key or a press removes it. */
|
|
21
|
+
const ComboboxChipKey = Symbol("ComboboxChip");
|
|
22
|
+
/** Whether the list holds no item: no matching entry, or no rendered Item. */
|
|
23
|
+
function isEmpty(context) {
|
|
24
|
+
return context.hasItems() ? context.entries.value.length === 0 : context.itemCount.value === 0;
|
|
25
|
+
}
|
|
26
|
+
/** The rendered items of the list, in order. */
|
|
27
|
+
function orderedItems(context) {
|
|
28
|
+
const list = context.list.value;
|
|
29
|
+
if (list === null) return [];
|
|
30
|
+
return [...list.querySelectorAll("[role=\"option\"]")].map((element) => context.items.get(element)).filter((item) => item !== void 0);
|
|
31
|
+
}
|
|
32
|
+
/** The highlighted item, as registered. */
|
|
33
|
+
function highlightedItem(context) {
|
|
34
|
+
const id = context.highlighted.value;
|
|
35
|
+
if (id === null) return;
|
|
36
|
+
for (const item of context.items.values()) if (item.id === id) return item;
|
|
37
|
+
}
|
|
38
|
+
/** The rendered chips, in value order. */
|
|
39
|
+
function chipElements(context) {
|
|
40
|
+
const chips = context.chips.value;
|
|
41
|
+
if (chips === null) return [];
|
|
42
|
+
return [...chips.querySelectorAll("[data-primitives-part=\"combobox-chip\"]")];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A press on the InputGroup or the Chips, outside their buttons, chips and input: focuses the
|
|
46
|
+
* input and opens the list (spec/combobox.md, "Pointer").
|
|
47
|
+
*/
|
|
48
|
+
function pressToOpen(context, event) {
|
|
49
|
+
const target = event.target;
|
|
50
|
+
if (target === null || target === context.trigger.value || target.closest("button, [data-primitives-part=\"combobox-chip\"]") !== null) return;
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
if (context.disabled()) return;
|
|
53
|
+
context.trigger.value?.focus();
|
|
54
|
+
openOnPress(context);
|
|
55
|
+
}
|
|
56
|
+
/** A press on the input opens the list, on the selected item in single mode. */
|
|
57
|
+
function openOnPress(context) {
|
|
58
|
+
if (context.open.value || context.disabled()) return;
|
|
59
|
+
context.pendingHighlight.current = context.multiple() ? null : "selected";
|
|
60
|
+
context.setOpen(true, "input-press");
|
|
61
|
+
}
|
|
62
|
+
// src/components/combobox/combobox-chip.ts
|
|
63
|
+
/** One value of a `multiple` combobox; the arrows move between chips (spec/combobox.md). */
|
|
64
|
+
const ComboboxChip = publicComponent(defineComponent({
|
|
65
|
+
name: "ComboboxChip",
|
|
66
|
+
inheritAttrs: false,
|
|
67
|
+
props: asProp,
|
|
68
|
+
setup(props, { attrs, slots }) {
|
|
69
|
+
const direction = useProvidedDirection();
|
|
70
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Chip");
|
|
71
|
+
const element = shallowRef(null);
|
|
72
|
+
const setElement = elementSetter(element);
|
|
73
|
+
provide(ComboboxChipKey, () => element.value);
|
|
74
|
+
const onKeydown = (event) => {
|
|
75
|
+
if (context.disabled() || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
76
|
+
const current = event.currentTarget;
|
|
77
|
+
const chips = chipElements(context);
|
|
78
|
+
const index = chips.indexOf(current);
|
|
79
|
+
const action = chipKeyTarget(event.key, index, chips.length, getDirection(current, direction()) === "rtl");
|
|
80
|
+
if (action === null) return;
|
|
81
|
+
if (event.key.length !== 1 || event.key === " ") event.preventDefault();
|
|
82
|
+
if (action.open) context.setOpen(true, "list-navigation");
|
|
83
|
+
const focus = () => {
|
|
84
|
+
(action.focus === "input" ? context.trigger.value : chipElements(context)[action.focus])?.focus();
|
|
85
|
+
};
|
|
86
|
+
if (!action.remove) {
|
|
87
|
+
focus();
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
context.removeAt(index, "none");
|
|
91
|
+
nextTick().then(focus);
|
|
92
|
+
};
|
|
93
|
+
return () => {
|
|
94
|
+
const disabled = context.disabled();
|
|
95
|
+
return renderPart("div", {
|
|
96
|
+
attrs,
|
|
97
|
+
slots
|
|
98
|
+
}, props.as, { disabled }, {
|
|
99
|
+
tabindex: -1,
|
|
100
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
101
|
+
"data-primitives-part": "combobox-chip",
|
|
102
|
+
...stateAttributes({ disabled }),
|
|
103
|
+
onKeydown,
|
|
104
|
+
ref: setElement
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}));
|
|
109
|
+
// src/components/combobox/combobox-chip-remove.ts
|
|
110
|
+
/** Removes its chip's value and returns focus to the input. */
|
|
111
|
+
const ComboboxChipRemove = publicComponent(defineComponent({
|
|
112
|
+
name: "ComboboxChipRemove",
|
|
113
|
+
inheritAttrs: false,
|
|
114
|
+
props: asProp,
|
|
115
|
+
setup(props, { attrs, slots }) {
|
|
116
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.ChipRemove");
|
|
117
|
+
const chip = useRequiredContext(ComboboxChipKey, "Combobox.ChipRemove");
|
|
118
|
+
return () => {
|
|
119
|
+
const disabled = context.disabled();
|
|
120
|
+
return renderPart("button", {
|
|
121
|
+
attrs,
|
|
122
|
+
slots
|
|
123
|
+
}, props.as, { disabled }, {
|
|
124
|
+
type: "button",
|
|
125
|
+
tabindex: -1,
|
|
126
|
+
disabled,
|
|
127
|
+
"data-primitives-part": "combobox-chip-remove",
|
|
128
|
+
...stateAttributes({ disabled }),
|
|
129
|
+
onPointerdown: (event) => event.preventDefault(),
|
|
130
|
+
onClick: () => {
|
|
131
|
+
const element = chip();
|
|
132
|
+
const index = element === null ? -1 : chipElements(context).indexOf(element);
|
|
133
|
+
if (index >= 0) context.removeAt(index, "chip-remove-press");
|
|
134
|
+
context.trigger.value?.focus();
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}));
|
|
140
|
+
// src/components/combobox/combobox-chips.ts
|
|
141
|
+
/** `multiple`: holds the chips and the Input; a `toolbar` while it holds a chip. */
|
|
142
|
+
const ComboboxChips = publicComponent(defineComponent({
|
|
143
|
+
name: "ComboboxChips",
|
|
144
|
+
inheritAttrs: false,
|
|
145
|
+
props: asProp,
|
|
146
|
+
setup(props, { attrs, slots }) {
|
|
147
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Chips");
|
|
148
|
+
const setChips = elementSetter(context.chips);
|
|
149
|
+
return () => renderPart("div", {
|
|
150
|
+
attrs,
|
|
151
|
+
slots
|
|
152
|
+
}, props.as, {}, {
|
|
153
|
+
role: context.values.value.length > 0 ? "toolbar" : void 0,
|
|
154
|
+
"data-primitives-part": "combobox-chips",
|
|
155
|
+
onMousedown: (event) => pressToOpen(context, event),
|
|
156
|
+
ref: setChips
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}));
|
|
160
|
+
// src/components/combobox/combobox-clear.ts
|
|
161
|
+
/** Clears the text and the value; rendered only while there is a value (spec/combobox.md). */
|
|
162
|
+
const ComboboxClear = publicComponent(defineComponent({
|
|
163
|
+
name: "ComboboxClear",
|
|
164
|
+
inheritAttrs: false,
|
|
165
|
+
props: asProp,
|
|
166
|
+
setup(props, { attrs, slots }) {
|
|
167
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Clear");
|
|
168
|
+
const setClearButton = elementSetter(context.clearButton);
|
|
169
|
+
return () => {
|
|
170
|
+
if (context.values.value.length === 0) return null;
|
|
171
|
+
const disabled = context.disabled();
|
|
172
|
+
return renderPart("button", {
|
|
173
|
+
attrs,
|
|
174
|
+
slots
|
|
175
|
+
}, props.as, { disabled }, {
|
|
176
|
+
type: "button",
|
|
177
|
+
tabindex: -1,
|
|
178
|
+
disabled,
|
|
179
|
+
"data-primitives-part": "combobox-clear",
|
|
180
|
+
...stateAttributes({ disabled }),
|
|
181
|
+
onPointerdown: (event) => event.preventDefault(),
|
|
182
|
+
onClick: () => {
|
|
183
|
+
context.clear("clear-press");
|
|
184
|
+
context.trigger.value?.focus();
|
|
185
|
+
},
|
|
186
|
+
ref: setClearButton
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}));
|
|
191
|
+
// src/components/combobox/combobox-empty.ts
|
|
192
|
+
/**
|
|
193
|
+
* A polite live region, always rendered; its children are shown only while the list is empty
|
|
194
|
+
* (spec/combobox.md).
|
|
195
|
+
*/
|
|
196
|
+
const ComboboxEmpty = publicComponent(defineComponent({
|
|
197
|
+
name: "ComboboxEmpty",
|
|
198
|
+
inheritAttrs: false,
|
|
199
|
+
props: asProp,
|
|
200
|
+
setup(props, { attrs, slots }) {
|
|
201
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Empty");
|
|
202
|
+
return () => {
|
|
203
|
+
const empty = isEmpty(context);
|
|
204
|
+
return renderPart("div", {
|
|
205
|
+
attrs,
|
|
206
|
+
slots
|
|
207
|
+
}, props.as, {}, {
|
|
208
|
+
role: "status",
|
|
209
|
+
"aria-live": "polite",
|
|
210
|
+
"aria-atomic": "true",
|
|
211
|
+
"data-primitives-part": "combobox-empty"
|
|
212
|
+
}, () => empty ? slots.default?.({ state: {} }) : []);
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}));
|
|
216
|
+
// src/components/combobox/combobox-group.ts
|
|
217
|
+
/** A `group` of items, named by its GroupLabel (spec/combobox.md). */
|
|
218
|
+
const ComboboxGroup = publicComponent(defineComponent({
|
|
219
|
+
name: "ComboboxGroup",
|
|
220
|
+
inheritAttrs: false,
|
|
221
|
+
props: asProp,
|
|
222
|
+
setup(props, { attrs, slots }) {
|
|
223
|
+
const labelId = `${useId()}-label`;
|
|
224
|
+
provide(ComboboxGroupKey, { labelId });
|
|
225
|
+
return () => renderPart("div", {
|
|
226
|
+
attrs,
|
|
227
|
+
slots
|
|
228
|
+
}, props.as, {}, {
|
|
229
|
+
role: "group",
|
|
230
|
+
"aria-labelledby": labelId,
|
|
231
|
+
"data-primitives-part": "combobox-group"
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}));
|
|
235
|
+
// src/components/combobox/combobox-group-label.ts
|
|
236
|
+
/** Names its Group. */
|
|
237
|
+
const ComboboxGroupLabel = publicComponent(defineComponent({
|
|
238
|
+
name: "ComboboxGroupLabel",
|
|
239
|
+
inheritAttrs: false,
|
|
240
|
+
props: asProp,
|
|
241
|
+
setup(props, { attrs, slots }) {
|
|
242
|
+
const group = useRequiredContext(ComboboxGroupKey, "Combobox.GroupLabel");
|
|
243
|
+
return () => renderPart("div", {
|
|
244
|
+
attrs,
|
|
245
|
+
slots
|
|
246
|
+
}, props.as, {}, {
|
|
247
|
+
id: group.labelId,
|
|
248
|
+
"data-primitives-part": "combobox-group-label"
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}));
|
|
252
|
+
// src/components/combobox/combobox-input.ts
|
|
253
|
+
/**
|
|
254
|
+
* The `combobox`: keeps DOM focus while the list is open; the highlighted item is announced with
|
|
255
|
+
* `aria-activedescendant` (spec/combobox.md, "Keyboard").
|
|
256
|
+
*/
|
|
257
|
+
const ComboboxInput = publicComponent(defineComponent({
|
|
258
|
+
name: "ComboboxInput",
|
|
259
|
+
inheritAttrs: false,
|
|
260
|
+
props: asProp,
|
|
261
|
+
setup(props, { attrs, slots }) {
|
|
262
|
+
const direction = useProvidedDirection();
|
|
263
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Input");
|
|
264
|
+
const setInput = elementSetter(context.trigger);
|
|
265
|
+
const openWith = (highlight, event) => {
|
|
266
|
+
context.pendingHighlight.current = highlight;
|
|
267
|
+
context.setOpen(true, "list-navigation", event);
|
|
268
|
+
};
|
|
269
|
+
const move = (delta) => {
|
|
270
|
+
const items = orderedItems(context);
|
|
271
|
+
const index = items.findIndex((item) => item.id === context.highlighted.value);
|
|
272
|
+
context.highlighted.value = items[stepThroughNone(items.length, index, delta)]?.id ?? null;
|
|
273
|
+
};
|
|
274
|
+
const onKeydown = (event) => {
|
|
275
|
+
const input = event.currentTarget;
|
|
276
|
+
const open = context.open.value;
|
|
277
|
+
switch (event.key) {
|
|
278
|
+
case "ArrowDown":
|
|
279
|
+
case "ArrowUp":
|
|
280
|
+
event.preventDefault();
|
|
281
|
+
if (event.altKey) {
|
|
282
|
+
if (event.key === "ArrowDown" && !open) openWith(null, event);
|
|
283
|
+
else if (event.key === "ArrowUp" && open) context.setOpen(false, "list-navigation", event);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (!open) {
|
|
287
|
+
openWith(event.key === "ArrowDown" ? "first" : "last", event);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
move(event.key === "ArrowDown" ? 1 : -1);
|
|
291
|
+
return;
|
|
292
|
+
case "Enter":
|
|
293
|
+
if (open) {
|
|
294
|
+
event.preventDefault();
|
|
295
|
+
const active = highlightedItem(context);
|
|
296
|
+
if (active !== void 0 && !active.disabled) context.choose(active.value);
|
|
297
|
+
}
|
|
298
|
+
return;
|
|
299
|
+
case "Escape":
|
|
300
|
+
if (!open && (context.inputValue.value !== "" || context.values.value.length > 0)) {
|
|
301
|
+
event.preventDefault();
|
|
302
|
+
context.clear("escape-key");
|
|
303
|
+
}
|
|
304
|
+
return;
|
|
305
|
+
case "Tab":
|
|
306
|
+
if (open) context.setOpen(false, "focus-out", event);
|
|
307
|
+
return;
|
|
308
|
+
case "Backspace":
|
|
309
|
+
if (context.multiple() && input.value === "" && context.values.value.length > 0) context.removeAt(context.values.value.length - 1, "none");
|
|
310
|
+
return;
|
|
311
|
+
default: {
|
|
312
|
+
const chips = chipElements(context);
|
|
313
|
+
if (context.multiple() && event.key === chipArrows(getDirection(input, direction()) === "rtl").previous && input.selectionStart === 0 && input.selectionEnd === 0 && chips.length > 0) {
|
|
314
|
+
event.preventDefault();
|
|
315
|
+
chips.at(-1)?.focus();
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
};
|
|
320
|
+
const onInput = (event) => {
|
|
321
|
+
const element = event.target;
|
|
322
|
+
context.setInputValue(element.value, "input-change");
|
|
323
|
+
nextTick().then(() => {
|
|
324
|
+
if (element.value !== context.inputValue.value) element.value = context.inputValue.value;
|
|
325
|
+
});
|
|
326
|
+
context.highlighted.value = null;
|
|
327
|
+
context.markTyped();
|
|
328
|
+
context.pendingHighlight.current = null;
|
|
329
|
+
if (!context.open.value) context.setOpen(true, "input-change", event);
|
|
330
|
+
};
|
|
331
|
+
return () => {
|
|
332
|
+
const open = context.open.value;
|
|
333
|
+
const disabled = context.disabled();
|
|
334
|
+
const highlighted = context.highlighted.value;
|
|
335
|
+
context.itemCount.value;
|
|
336
|
+
const active = highlighted === null ? void 0 : orderedItems(context).find((item) => item.id === highlighted);
|
|
337
|
+
const { field } = context;
|
|
338
|
+
return renderPart("input", {
|
|
339
|
+
attrs,
|
|
340
|
+
slots
|
|
341
|
+
}, props.as, {
|
|
342
|
+
open,
|
|
343
|
+
disabled
|
|
344
|
+
}, {
|
|
345
|
+
type: "text",
|
|
346
|
+
id: context.triggerId,
|
|
347
|
+
role: "combobox",
|
|
348
|
+
autocomplete: "off",
|
|
349
|
+
disabled,
|
|
350
|
+
value: context.inputValue.value,
|
|
351
|
+
"aria-autocomplete": "list",
|
|
352
|
+
"aria-expanded": open ? "true" : "false",
|
|
353
|
+
"aria-controls": context.listId,
|
|
354
|
+
"aria-activedescendant": open && active ? active.id : void 0,
|
|
355
|
+
...field.aria(),
|
|
356
|
+
"data-primitives-part": "combobox-input",
|
|
357
|
+
...field.attributes(),
|
|
358
|
+
...stateAttributes({
|
|
359
|
+
"popup-open": open,
|
|
360
|
+
disabled
|
|
361
|
+
}),
|
|
362
|
+
onInput,
|
|
363
|
+
onClick: () => openOnPress(context),
|
|
364
|
+
onKeydown,
|
|
365
|
+
onFocus: field.onFocus,
|
|
366
|
+
onBlur: field.onBlur,
|
|
367
|
+
ref: setInput
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
}));
|
|
372
|
+
// src/components/combobox/combobox-input-group.ts
|
|
373
|
+
/** Holds the Input and its buttons; anchors the list (spec/combobox.md). */
|
|
374
|
+
const ComboboxInputGroup = publicComponent(defineComponent({
|
|
375
|
+
name: "ComboboxInputGroup",
|
|
376
|
+
inheritAttrs: false,
|
|
377
|
+
props: asProp,
|
|
378
|
+
setup(props, { attrs, slots }) {
|
|
379
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.InputGroup");
|
|
380
|
+
const setInputGroup = elementSetter(context.inputGroup);
|
|
381
|
+
return () => {
|
|
382
|
+
const open = context.open.value;
|
|
383
|
+
const disabled = context.disabled();
|
|
384
|
+
return renderPart("div", {
|
|
385
|
+
attrs,
|
|
386
|
+
slots
|
|
387
|
+
}, props.as, {
|
|
388
|
+
open,
|
|
389
|
+
disabled
|
|
390
|
+
}, {
|
|
391
|
+
role: "group",
|
|
392
|
+
"data-primitives-part": "combobox-input-group",
|
|
393
|
+
...stateAttributes({
|
|
394
|
+
"popup-open": open,
|
|
395
|
+
disabled
|
|
396
|
+
}),
|
|
397
|
+
onMousedown: (event) => pressToOpen(context, event),
|
|
398
|
+
ref: setInputGroup
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
}));
|
|
403
|
+
// src/components/combobox/combobox-item.ts
|
|
404
|
+
/** An `option` (spec/combobox.md). */
|
|
405
|
+
const ComboboxItem = publicComponent(defineComponent({
|
|
406
|
+
name: "ComboboxItem",
|
|
407
|
+
inheritAttrs: false,
|
|
408
|
+
props: {
|
|
409
|
+
...asProp,
|
|
410
|
+
/** The item: written into the input as `itemToStringLabel(value)` when chosen. */
|
|
411
|
+
value: {
|
|
412
|
+
type: null,
|
|
413
|
+
required: true
|
|
414
|
+
},
|
|
415
|
+
/** Can be highlighted, never chosen. */
|
|
416
|
+
disabled: {
|
|
417
|
+
type: Boolean,
|
|
418
|
+
default: false
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
setup(props, { attrs, slots }) {
|
|
422
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Item");
|
|
423
|
+
const element = shallowRef(null);
|
|
424
|
+
const setElement = elementSetter(element);
|
|
425
|
+
const id = useId();
|
|
426
|
+
const { items, itemCount } = context;
|
|
427
|
+
watch(() => [
|
|
428
|
+
element.value,
|
|
429
|
+
props.value,
|
|
430
|
+
props.disabled
|
|
431
|
+
], ([node, value, disabled], _, onCleanup) => {
|
|
432
|
+
if (node === null) return;
|
|
433
|
+
items.set(node, {
|
|
434
|
+
value,
|
|
435
|
+
disabled,
|
|
436
|
+
id
|
|
437
|
+
});
|
|
438
|
+
itemCount.value = items.size;
|
|
439
|
+
onCleanup(() => {
|
|
440
|
+
items.delete(node);
|
|
441
|
+
itemCount.value = items.size;
|
|
442
|
+
});
|
|
443
|
+
}, {
|
|
444
|
+
flush: "post",
|
|
445
|
+
immediate: true
|
|
446
|
+
});
|
|
447
|
+
const state = computed(() => ({
|
|
448
|
+
highlighted: context.highlighted.value === id,
|
|
449
|
+
selected: context.isSelected(props.value),
|
|
450
|
+
disabled: props.disabled
|
|
451
|
+
}));
|
|
452
|
+
provide(ComboboxItemKey, state);
|
|
453
|
+
watch(() => [
|
|
454
|
+
state.value.highlighted,
|
|
455
|
+
element.value,
|
|
456
|
+
context.positioner.value
|
|
457
|
+
], ([highlighted]) => {
|
|
458
|
+
if (highlighted && element.value) scrollIntoViewWithin(element.value, context.positioner.value);
|
|
459
|
+
}, {
|
|
460
|
+
flush: "post",
|
|
461
|
+
immediate: true
|
|
462
|
+
});
|
|
463
|
+
return () => {
|
|
464
|
+
const { highlighted, selected, disabled } = state.value;
|
|
465
|
+
return renderPart("div", {
|
|
466
|
+
attrs,
|
|
467
|
+
slots
|
|
468
|
+
}, props.as, state.value, {
|
|
469
|
+
role: "option",
|
|
470
|
+
id,
|
|
471
|
+
"aria-selected": selected ? "true" : void 0,
|
|
472
|
+
"aria-disabled": disabled ? "true" : void 0,
|
|
473
|
+
"data-primitives-part": "combobox-item",
|
|
474
|
+
...stateAttributes({
|
|
475
|
+
highlighted,
|
|
476
|
+
selected,
|
|
477
|
+
disabled
|
|
478
|
+
}),
|
|
479
|
+
onPointermove: () => {
|
|
480
|
+
if (!state.value.highlighted) context.highlighted.value = id;
|
|
481
|
+
},
|
|
482
|
+
onPointerdown: (event) => event.preventDefault(),
|
|
483
|
+
onClick: () => {
|
|
484
|
+
if (!props.disabled) context.choose(props.value);
|
|
485
|
+
},
|
|
486
|
+
ref: setElement
|
|
487
|
+
});
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
}));
|
|
491
|
+
// src/components/combobox/combobox-item-indicator.ts
|
|
492
|
+
/** Marks a selected item; hidden from assistive technologies (spec/combobox.md). */
|
|
493
|
+
const ComboboxItemIndicator = publicComponent(defineComponent({
|
|
494
|
+
name: "ComboboxItemIndicator",
|
|
495
|
+
inheritAttrs: false,
|
|
496
|
+
props: {
|
|
497
|
+
...asProp,
|
|
498
|
+
/** Rendered while the item is not selected too. */
|
|
499
|
+
keepMounted: {
|
|
500
|
+
type: Boolean,
|
|
501
|
+
default: false
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
setup(props, { attrs, slots }) {
|
|
505
|
+
const item = useRequiredContext(ComboboxItemKey, "Combobox.ItemIndicator");
|
|
506
|
+
return () => {
|
|
507
|
+
const selected = item.value.selected;
|
|
508
|
+
if (!selected && !props.keepMounted) return null;
|
|
509
|
+
return renderPart("span", {
|
|
510
|
+
attrs,
|
|
511
|
+
slots
|
|
512
|
+
}, props.as, { selected }, {
|
|
513
|
+
"aria-hidden": "true",
|
|
514
|
+
"data-primitives-part": "combobox-item-indicator"
|
|
515
|
+
});
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
}));
|
|
519
|
+
// src/components/combobox/combobox-list.ts
|
|
520
|
+
/**
|
|
521
|
+
* The `listbox`. With the Root's `items`, its default scoped slot renders each matching entry
|
|
522
|
+
* (`v-slot="{ entry, index }"`: an item, or a group); without them, its content as is. Applies
|
|
523
|
+
* the highlight the keyboard asked for once its items render.
|
|
524
|
+
*/
|
|
525
|
+
const ComboboxList = publicComponent(defineComponent({
|
|
526
|
+
name: "ComboboxList",
|
|
527
|
+
inheritAttrs: false,
|
|
528
|
+
props: asProp,
|
|
529
|
+
setup(props, { attrs, slots }) {
|
|
530
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.List");
|
|
531
|
+
const setList = elementSetter(context.list);
|
|
532
|
+
watch(() => [
|
|
533
|
+
context.list.value,
|
|
534
|
+
context.itemCount.value,
|
|
535
|
+
context.open.value
|
|
536
|
+
], ([list]) => {
|
|
537
|
+
const pending = context.pendingHighlight.current;
|
|
538
|
+
if (list === null || pending === null) return;
|
|
539
|
+
const items = orderedItems(context);
|
|
540
|
+
if (items.length < list.querySelectorAll("[role=\"option\"]").length) return;
|
|
541
|
+
context.pendingHighlight.current = null;
|
|
542
|
+
const selected = context.multiple() ? void 0 : items.find((item) => context.isSelected(item.value));
|
|
543
|
+
const edge = pending === "first" ? items[0] : items.at(-1);
|
|
544
|
+
const target = selected ?? (pending === "selected" ? void 0 : edge);
|
|
545
|
+
context.highlighted.value = target?.id ?? null;
|
|
546
|
+
}, {
|
|
547
|
+
flush: "post",
|
|
548
|
+
immediate: true
|
|
549
|
+
});
|
|
550
|
+
return () => {
|
|
551
|
+
const empty = isEmpty(context);
|
|
552
|
+
return renderPart("div", {
|
|
553
|
+
attrs,
|
|
554
|
+
slots
|
|
555
|
+
}, props.as, { empty }, {
|
|
556
|
+
role: "listbox",
|
|
557
|
+
id: context.listId,
|
|
558
|
+
"aria-multiselectable": context.multiple() ? "true" : void 0,
|
|
559
|
+
"data-primitives-part": "combobox-list",
|
|
560
|
+
...stateAttributes({ empty }),
|
|
561
|
+
ref: setList
|
|
562
|
+
}, () => context.hasItems() ? context.entries.value.flatMap((entry, index) => slots.default?.({
|
|
563
|
+
entry,
|
|
564
|
+
index,
|
|
565
|
+
state: { empty }
|
|
566
|
+
}) ?? []) : slots.default?.({ state: { empty } }));
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
}));
|
|
570
|
+
// src/components/combobox/combobox-popup.ts
|
|
571
|
+
/** The floating container of the list (no role of its own). */
|
|
572
|
+
const ComboboxPopup = publicComponent(defineComponent({
|
|
573
|
+
name: "ComboboxPopup",
|
|
574
|
+
inheritAttrs: false,
|
|
575
|
+
props: asProp,
|
|
576
|
+
setup(props, { attrs, slots }) {
|
|
577
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Popup");
|
|
578
|
+
const setPopup = elementSetter(context.popup);
|
|
579
|
+
return () => {
|
|
580
|
+
const open = context.open.value;
|
|
581
|
+
const status = context.presence.status.value;
|
|
582
|
+
const placed = context.placed.value;
|
|
583
|
+
return renderPart("div", {
|
|
584
|
+
attrs,
|
|
585
|
+
slots
|
|
586
|
+
}, props.as, {
|
|
587
|
+
open,
|
|
588
|
+
...placed
|
|
589
|
+
}, {
|
|
590
|
+
"data-primitives-part": "combobox-popup",
|
|
591
|
+
...stateAttributes({
|
|
592
|
+
open,
|
|
593
|
+
closed: !open,
|
|
594
|
+
side: placed.side,
|
|
595
|
+
align: placed.align,
|
|
596
|
+
"starting-style": status === "starting",
|
|
597
|
+
"ending-style": status === "ending"
|
|
598
|
+
}),
|
|
599
|
+
ref: setPopup
|
|
600
|
+
});
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
}));
|
|
604
|
+
// src/components/combobox/combobox-portal.ts
|
|
605
|
+
/** Moves the content to `container` (default: the body) while mounted, or always with `keep-mounted`. */
|
|
606
|
+
const ComboboxPortal = publicComponent(defineComponent({
|
|
607
|
+
name: "ComboboxPortal",
|
|
608
|
+
props: overlayPortalProps,
|
|
609
|
+
setup(props, { slots }) {
|
|
610
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Portal");
|
|
611
|
+
return useOverlayPortal(context.presence.mounted, props, slots);
|
|
612
|
+
}
|
|
613
|
+
}));
|
|
614
|
+
// src/components/combobox/combobox-positioner.ts
|
|
615
|
+
/**
|
|
616
|
+
* Places the list under the InputGroup (else the Chips, else the Input); the open list is a layer
|
|
617
|
+
* (Escape, outside press).
|
|
618
|
+
*/
|
|
619
|
+
const ComboboxPositioner = publicComponent(defineComponent({
|
|
620
|
+
name: "ComboboxPositioner",
|
|
621
|
+
inheritAttrs: false,
|
|
622
|
+
props: {
|
|
623
|
+
...asProp,
|
|
624
|
+
...positionerProps
|
|
625
|
+
},
|
|
626
|
+
setup(props, { attrs, slots }) {
|
|
627
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Positioner");
|
|
628
|
+
const setPositioner = elementSetter(context.positioner);
|
|
629
|
+
const anchor = computed(() => context.inputGroup.value ?? context.chips.value ?? context.trigger.value);
|
|
630
|
+
const placed = usePositioner(props, {
|
|
631
|
+
side: "bottom",
|
|
632
|
+
align: "start"
|
|
633
|
+
}, anchor, context.positioner, null, context.presence.mounted);
|
|
634
|
+
watch(placed, (value) => context.placed.value = value, { immediate: true });
|
|
635
|
+
watch(() => [context.open.value, context.positioner.value], ([open, positioner], _, onCleanup) => {
|
|
636
|
+
if (!open || positioner === null) return;
|
|
637
|
+
onCleanup(openOverlaySession(positioner.ownerDocument, {
|
|
638
|
+
elements: () => [positioner],
|
|
639
|
+
ignore: () => [
|
|
640
|
+
context.trigger.value,
|
|
641
|
+
context.button.value,
|
|
642
|
+
context.inputGroup.value,
|
|
643
|
+
context.chips.value,
|
|
644
|
+
context.clearButton.value
|
|
645
|
+
],
|
|
646
|
+
dismiss: (reason, event) => context.setOpen(false, reason, event)
|
|
647
|
+
}).end);
|
|
648
|
+
}, {
|
|
649
|
+
flush: "post",
|
|
650
|
+
immediate: true
|
|
651
|
+
});
|
|
652
|
+
return () => {
|
|
653
|
+
const open = context.open.value;
|
|
654
|
+
return renderPart("div", {
|
|
655
|
+
attrs,
|
|
656
|
+
slots
|
|
657
|
+
}, props.as, {
|
|
658
|
+
open,
|
|
659
|
+
...placed.value
|
|
660
|
+
}, {
|
|
661
|
+
role: "presentation",
|
|
662
|
+
hidden: context.presence.mounted.value ? void 0 : true,
|
|
663
|
+
"data-primitives-part": "combobox-positioner",
|
|
664
|
+
...stateAttributes({
|
|
665
|
+
open,
|
|
666
|
+
closed: !open,
|
|
667
|
+
side: placed.value.side,
|
|
668
|
+
align: placed.value.align
|
|
669
|
+
}),
|
|
670
|
+
ref: setPositioner
|
|
671
|
+
});
|
|
672
|
+
};
|
|
673
|
+
}
|
|
674
|
+
}));
|
|
675
|
+
// src/components/combobox/combobox-root.ts
|
|
676
|
+
const NONE = [];
|
|
677
|
+
/**
|
|
678
|
+
* Holds the combobox's state (`v-model:value`, `v-model:input-value`, `v-model:open`); renders
|
|
679
|
+
* its hidden form inputs (spec/combobox.md).
|
|
680
|
+
*/
|
|
681
|
+
const ComboboxRoot = publicComponent(defineComponent({
|
|
682
|
+
name: "ComboboxRoot",
|
|
683
|
+
props: {
|
|
684
|
+
...overlayRootProps,
|
|
685
|
+
/** The items, or groups of items: the combobox filters them (spec/combobox.md). */
|
|
686
|
+
items: {
|
|
687
|
+
type: Array,
|
|
688
|
+
default: void 0
|
|
689
|
+
},
|
|
690
|
+
/** Whether an item matches the query; `null` turns filtering off. */
|
|
691
|
+
filter: {
|
|
692
|
+
type: Function,
|
|
693
|
+
default: void 0
|
|
694
|
+
},
|
|
695
|
+
/** The most items the list renders; `-1` for no limit. */
|
|
696
|
+
limit: {
|
|
697
|
+
type: Number,
|
|
698
|
+
default: -1
|
|
699
|
+
},
|
|
700
|
+
locale: {
|
|
701
|
+
type: String,
|
|
702
|
+
default: void 0
|
|
703
|
+
},
|
|
704
|
+
multiple: {
|
|
705
|
+
type: Boolean,
|
|
706
|
+
default: false
|
|
707
|
+
},
|
|
708
|
+
/** The selected item (or `null`), or the selected items with `multiple`. */
|
|
709
|
+
value: {
|
|
710
|
+
type: null,
|
|
711
|
+
default: void 0
|
|
712
|
+
},
|
|
713
|
+
defaultValue: {
|
|
714
|
+
type: null,
|
|
715
|
+
default: void 0
|
|
716
|
+
},
|
|
717
|
+
inputValue: {
|
|
718
|
+
type: String,
|
|
719
|
+
default: void 0
|
|
720
|
+
},
|
|
721
|
+
defaultInputValue: {
|
|
722
|
+
type: String,
|
|
723
|
+
default: void 0
|
|
724
|
+
},
|
|
725
|
+
isItemEqualToValue: {
|
|
726
|
+
type: Function,
|
|
727
|
+
default: void 0
|
|
728
|
+
},
|
|
729
|
+
itemToStringLabel: {
|
|
730
|
+
type: Function,
|
|
731
|
+
default: void 0
|
|
732
|
+
},
|
|
733
|
+
itemToStringValue: {
|
|
734
|
+
type: Function,
|
|
735
|
+
default: void 0
|
|
736
|
+
},
|
|
737
|
+
name: {
|
|
738
|
+
type: String,
|
|
739
|
+
default: void 0
|
|
740
|
+
},
|
|
741
|
+
required: {
|
|
742
|
+
type: Boolean,
|
|
743
|
+
default: false
|
|
744
|
+
},
|
|
745
|
+
disabled: {
|
|
746
|
+
type: Boolean,
|
|
747
|
+
default: false
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
emits: {
|
|
751
|
+
...overlayRootEmits,
|
|
752
|
+
"update:value": (_value) => true,
|
|
753
|
+
valueChange: (_value, _details) => true,
|
|
754
|
+
"update:inputValue": (_value) => true,
|
|
755
|
+
inputValueChange: (_value, _details) => true
|
|
756
|
+
},
|
|
757
|
+
setup(props, { emit, slots, expose }) {
|
|
758
|
+
const root = useOverlayRoot(props, emit);
|
|
759
|
+
expose(root.actions);
|
|
760
|
+
const multiple = () => props.multiple;
|
|
761
|
+
const defaultValue = () => props.defaultValue ?? (props.multiple ? NONE : null);
|
|
762
|
+
const label = (item) => itemLabel(item, props.itemToStringLabel);
|
|
763
|
+
const formValue = (item) => itemFormValue(item, props.itemToStringValue);
|
|
764
|
+
const valueState = useControllable(() => props.value, defaultValue(), (next, details) => {
|
|
765
|
+
emit("update:value", next);
|
|
766
|
+
emit("valueChange", next, details);
|
|
767
|
+
});
|
|
768
|
+
const value = computed(() => valueState.value.value);
|
|
769
|
+
const values = computed(() => {
|
|
770
|
+
const current = value.value;
|
|
771
|
+
if (props.multiple) return current ?? NONE;
|
|
772
|
+
return current === null || current === void 0 ? NONE : [current];
|
|
773
|
+
});
|
|
774
|
+
const inputState = useControllable(() => props.inputValue, props.defaultInputValue ?? (props.multiple ? "" : label(props.value ?? defaultValue())), (next, details) => {
|
|
775
|
+
emit("update:inputValue", next);
|
|
776
|
+
emit("inputValueChange", next, details);
|
|
777
|
+
});
|
|
778
|
+
const inputValue = computed(() => inputState.value.value);
|
|
779
|
+
const hidden = shallowRef(null);
|
|
780
|
+
const field = useFieldControl({
|
|
781
|
+
id: () => root.trigger.value?.id || root.triggerId,
|
|
782
|
+
labelable: true,
|
|
783
|
+
value: () => value.value,
|
|
784
|
+
filled: () => values.value.length > 0,
|
|
785
|
+
input: () => hidden.value,
|
|
786
|
+
focusTarget: () => root.trigger.value
|
|
787
|
+
});
|
|
788
|
+
const disabled = () => props.disabled || field.disabled();
|
|
789
|
+
const highlighted = ref(null);
|
|
790
|
+
const typed = ref(false);
|
|
791
|
+
const pendingHighlight = { current: null };
|
|
792
|
+
const setOpen = (next, reason, event) => {
|
|
793
|
+
const changed = root.setOpen(next, reason, event);
|
|
794
|
+
if ((!next || reason !== "input-change") && (changed || next)) typed.value = false;
|
|
795
|
+
if (next || !changed) return changed;
|
|
796
|
+
highlighted.value = null;
|
|
797
|
+
pendingHighlight.current = null;
|
|
798
|
+
if (reason === "item-press") return changed;
|
|
799
|
+
const text = props.multiple ? "" : label(value.value);
|
|
800
|
+
if (inputValue.value !== text) inputState.set(text, { reason: text === "" ? "input-clear" : "none" });
|
|
801
|
+
return changed;
|
|
802
|
+
};
|
|
803
|
+
const isEqual = (item, other) => props.isItemEqualToValue ? props.isItemEqualToValue(item, other) : Object.is(toRaw(item), toRaw(other));
|
|
804
|
+
const filter = computed(() => props.filter === void 0 ? containsFilter(props.locale) : props.filter);
|
|
805
|
+
const entries = computed(() => {
|
|
806
|
+
const items = props.items;
|
|
807
|
+
if (items === void 0) return NONE;
|
|
808
|
+
const query = inputValue.value.trim();
|
|
809
|
+
const whole = !props.multiple && !typed.value && values.value.length > 0 && queryIsLabel(label(values.value[0]), query, props.locale);
|
|
810
|
+
return filterItems(items, whole ? "" : query, {
|
|
811
|
+
filter: filter.value,
|
|
812
|
+
limit: props.limit,
|
|
813
|
+
itemToString: label
|
|
814
|
+
});
|
|
815
|
+
});
|
|
816
|
+
const context = {
|
|
817
|
+
...root,
|
|
818
|
+
setOpen,
|
|
819
|
+
field,
|
|
820
|
+
multiple,
|
|
821
|
+
value,
|
|
822
|
+
values,
|
|
823
|
+
inputValue,
|
|
824
|
+
setInputValue: (next, reason) => inputState.set(next, { reason }),
|
|
825
|
+
disabled,
|
|
826
|
+
highlighted,
|
|
827
|
+
isSelected: (item) => includesItem(values.value, item, isEqual),
|
|
828
|
+
choose(item) {
|
|
829
|
+
highlighted.value = null;
|
|
830
|
+
if (!props.multiple) {
|
|
831
|
+
valueState.set(item, { reason: "item-press" });
|
|
832
|
+
inputState.set(label(item), { reason: "item-press" });
|
|
833
|
+
setOpen(false, "item-press");
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
valueState.set(toggleItem(values.value, item, isEqual), { reason: "item-press" });
|
|
837
|
+
if (inputValue.value.trim() !== "") {
|
|
838
|
+
inputState.set("", { reason: "input-clear" });
|
|
839
|
+
setOpen(false, "item-press");
|
|
840
|
+
}
|
|
841
|
+
},
|
|
842
|
+
clear(reason) {
|
|
843
|
+
inputState.set("", { reason });
|
|
844
|
+
valueState.set(props.multiple ? [] : null, { reason });
|
|
845
|
+
highlighted.value = null;
|
|
846
|
+
},
|
|
847
|
+
removeAt(index, reason) {
|
|
848
|
+
valueState.set(values.value.filter((_, at) => at !== index), { reason });
|
|
849
|
+
},
|
|
850
|
+
label,
|
|
851
|
+
hasItems: () => props.items !== void 0,
|
|
852
|
+
entries,
|
|
853
|
+
markTyped: () => {
|
|
854
|
+
typed.value = true;
|
|
855
|
+
},
|
|
856
|
+
items: /* @__PURE__ */ new Map(),
|
|
857
|
+
list: shallowRef(null),
|
|
858
|
+
button: shallowRef(null),
|
|
859
|
+
inputGroup: shallowRef(null),
|
|
860
|
+
chips: shallowRef(null),
|
|
861
|
+
clearButton: shallowRef(null),
|
|
862
|
+
listId: `${useId()}-list`,
|
|
863
|
+
pendingHighlight,
|
|
864
|
+
placed: ref({
|
|
865
|
+
side: "bottom",
|
|
866
|
+
align: "start"
|
|
867
|
+
}),
|
|
868
|
+
itemCount: ref(0)
|
|
869
|
+
};
|
|
870
|
+
provide(ComboboxKey, context);
|
|
871
|
+
watch(hidden, (element, _, onCleanup) => {
|
|
872
|
+
if (element === null) return;
|
|
873
|
+
onCleanup(bridgeForm(element, {
|
|
874
|
+
reset: () => {
|
|
875
|
+
const initial = defaultValue();
|
|
876
|
+
field.reset();
|
|
877
|
+
valueState.set(initial, { reason: "none" });
|
|
878
|
+
inputState.set(props.multiple ? "" : label(initial), { reason: "none" });
|
|
879
|
+
nextTick().then(() => {
|
|
880
|
+
const input = root.trigger.value;
|
|
881
|
+
if (input instanceof HTMLInputElement && input.value !== inputValue.value) input.value = inputValue.value;
|
|
882
|
+
if (!props.multiple) element.value = formValue(value.value);
|
|
883
|
+
});
|
|
884
|
+
},
|
|
885
|
+
invalid: () => root.trigger.value
|
|
886
|
+
}));
|
|
887
|
+
}, { flush: "post" });
|
|
888
|
+
return () => {
|
|
889
|
+
const fieldName = field.name() ?? props.name;
|
|
890
|
+
const isMultiple = props.multiple;
|
|
891
|
+
const count = values.value.length;
|
|
892
|
+
return h(Fragment, [
|
|
893
|
+
slots.default?.(),
|
|
894
|
+
h("input", {
|
|
895
|
+
ref: (element) => {
|
|
896
|
+
hidden.value = element;
|
|
897
|
+
},
|
|
898
|
+
"aria-hidden": "true",
|
|
899
|
+
tabindex: -1,
|
|
900
|
+
name: isMultiple ? void 0 : fieldName,
|
|
901
|
+
value: isMultiple ? "" : formValue(value.value),
|
|
902
|
+
required: isMultiple ? props.required && count === 0 : props.required,
|
|
903
|
+
disabled: disabled(),
|
|
904
|
+
style: VISUALLY_HIDDEN_INPUT_STYLE,
|
|
905
|
+
"data-primitives-part": "combobox-hidden-input"
|
|
906
|
+
}),
|
|
907
|
+
...isMultiple && fieldName !== void 0 ? values.value.map((item, index) => h("input", {
|
|
908
|
+
key: index,
|
|
909
|
+
type: "hidden",
|
|
910
|
+
name: fieldName,
|
|
911
|
+
value: formValue(item),
|
|
912
|
+
disabled: disabled(),
|
|
913
|
+
"data-primitives-part": "combobox-hidden-input"
|
|
914
|
+
})) : []
|
|
915
|
+
]);
|
|
916
|
+
};
|
|
917
|
+
}
|
|
918
|
+
}));
|
|
919
|
+
// src/components/combobox/combobox-separator.ts
|
|
920
|
+
/** Between groups; no role of its own (a `listbox` owns only groups and options). */
|
|
921
|
+
const ComboboxSeparator = publicComponent(defineComponent({
|
|
922
|
+
name: "ComboboxSeparator",
|
|
923
|
+
inheritAttrs: false,
|
|
924
|
+
props: asProp,
|
|
925
|
+
setup(props, { attrs, slots }) {
|
|
926
|
+
return () => renderPart("div", {
|
|
927
|
+
attrs,
|
|
928
|
+
slots
|
|
929
|
+
}, props.as, {}, {
|
|
930
|
+
role: "presentation",
|
|
931
|
+
"data-orientation": "horizontal",
|
|
932
|
+
"data-primitives-part": "combobox-separator"
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
}));
|
|
936
|
+
// src/components/combobox/combobox-status.ts
|
|
937
|
+
/** A polite live region for the consumer's text (spec/combobox.md). */
|
|
938
|
+
const ComboboxStatus = publicComponent(defineComponent({
|
|
939
|
+
name: "ComboboxStatus",
|
|
940
|
+
inheritAttrs: false,
|
|
941
|
+
props: asProp,
|
|
942
|
+
setup(props, { attrs, slots }) {
|
|
943
|
+
return () => renderPart("div", {
|
|
944
|
+
attrs,
|
|
945
|
+
slots
|
|
946
|
+
}, props.as, {}, {
|
|
947
|
+
role: "status",
|
|
948
|
+
"aria-live": "polite",
|
|
949
|
+
"aria-atomic": "true",
|
|
950
|
+
"data-primitives-part": "combobox-status"
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
}));
|
|
954
|
+
// src/components/combobox/parts.ts
|
|
955
|
+
/** spec/combobox.md */
|
|
956
|
+
const Combobox = {
|
|
957
|
+
Root: ComboboxRoot,
|
|
958
|
+
InputGroup: ComboboxInputGroup,
|
|
959
|
+
Input: ComboboxInput,
|
|
960
|
+
Trigger: publicComponent(defineComponent({
|
|
961
|
+
name: "ComboboxTrigger",
|
|
962
|
+
inheritAttrs: false,
|
|
963
|
+
props: asProp,
|
|
964
|
+
setup(props, { attrs, slots }) {
|
|
965
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Trigger");
|
|
966
|
+
const setButton = elementSetter(context.button);
|
|
967
|
+
return () => {
|
|
968
|
+
const open = context.open.value;
|
|
969
|
+
const disabled = context.disabled();
|
|
970
|
+
return renderPart("button", {
|
|
971
|
+
attrs,
|
|
972
|
+
slots
|
|
973
|
+
}, props.as, {
|
|
974
|
+
open,
|
|
975
|
+
disabled
|
|
976
|
+
}, {
|
|
977
|
+
type: "button",
|
|
978
|
+
tabindex: -1,
|
|
979
|
+
disabled,
|
|
980
|
+
"aria-expanded": open ? "true" : "false",
|
|
981
|
+
"aria-controls": context.listId,
|
|
982
|
+
"data-primitives-part": "combobox-trigger",
|
|
983
|
+
...stateAttributes({
|
|
984
|
+
"popup-open": open,
|
|
985
|
+
disabled
|
|
986
|
+
}),
|
|
987
|
+
onPointerdown: (event) => event.preventDefault(),
|
|
988
|
+
onClick: (event) => {
|
|
989
|
+
context.pendingHighlight.current = null;
|
|
990
|
+
context.setOpen(!context.open.value, "trigger-press", event);
|
|
991
|
+
context.trigger.value?.focus();
|
|
992
|
+
},
|
|
993
|
+
ref: setButton
|
|
994
|
+
});
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
})),
|
|
998
|
+
Clear: ComboboxClear,
|
|
999
|
+
Chips: ComboboxChips,
|
|
1000
|
+
Chip: ComboboxChip,
|
|
1001
|
+
ChipRemove: ComboboxChipRemove,
|
|
1002
|
+
Value: publicComponent(defineComponent({
|
|
1003
|
+
name: "ComboboxValue",
|
|
1004
|
+
setup(_, { slots }) {
|
|
1005
|
+
const context = useRequiredContext(ComboboxKey, "Combobox.Value");
|
|
1006
|
+
return () => slots.default?.({ value: context.value.value }) ?? context.values.value.map(context.label).join(", ");
|
|
1007
|
+
}
|
|
1008
|
+
})),
|
|
1009
|
+
Status: ComboboxStatus,
|
|
1010
|
+
Portal: ComboboxPortal,
|
|
1011
|
+
Positioner: ComboboxPositioner,
|
|
1012
|
+
Popup: ComboboxPopup,
|
|
1013
|
+
Empty: ComboboxEmpty,
|
|
1014
|
+
List: ComboboxList,
|
|
1015
|
+
Group: ComboboxGroup,
|
|
1016
|
+
GroupLabel: ComboboxGroupLabel,
|
|
1017
|
+
Separator: ComboboxSeparator,
|
|
1018
|
+
Item: ComboboxItem,
|
|
1019
|
+
ItemIndicator: ComboboxItemIndicator
|
|
1020
|
+
};
|
|
1021
|
+
export { ComboboxList as n, ComboboxKey as r, Combobox as t };
|
|
1022
|
+
|
|
1023
|
+
//# sourceMappingURL=parts--mC44S1N.js.map
|