@fragiola/primitives-vue 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- 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,351 @@
|
|
|
1
|
+
import { t as useRequiredContext } from "./use-required-context-CPpEkr4Q.js";
|
|
2
|
+
import { t as publicComponent } from "./public-component-AV8E7mGp.js";
|
|
3
|
+
import { n as renderPart, t as asProp } from "./render-part-B5XVbHaS.js";
|
|
4
|
+
import { t as elementSetter } from "./use-overlay-root-BkyTQIsX.js";
|
|
5
|
+
import { t as stateAttributes } from "./state-attributes-DhboDeMS.js";
|
|
6
|
+
import { t as useControllable } from "./use-controllable-B46G4v0A.js";
|
|
7
|
+
import { n as useFieldControl } from "./use-field-control-CdYqr0dK.js";
|
|
8
|
+
import { n as useProvidedDirection } from "./direction-context-D-C_P6Lm.js";
|
|
9
|
+
import { computed, defineComponent, onBeforeUnmount, provide, shallowRef, watch } from "vue";
|
|
10
|
+
import { getDirection } from "@fragiola/primitives/direction";
|
|
11
|
+
import { VISUALLY_HIDDEN_INPUT_STYLE, bridgeForm } from "@fragiola/primitives/form";
|
|
12
|
+
import { fractionAlong, ratingItemState, ratingKeyTarget, ratingValueAt } from "@fragiola/primitives/range";
|
|
13
|
+
// src/components/rating/rating-context.ts
|
|
14
|
+
const RatingKey = Symbol("Rating");
|
|
15
|
+
// src/components/rating/rating-hidden-input.ts
|
|
16
|
+
/**
|
|
17
|
+
* The Rating's form value (spec/rating.md, "Forms"): a visually hidden input with the score as
|
|
18
|
+
* text, its `name` only while there is one, validated by the browser.
|
|
19
|
+
*/
|
|
20
|
+
const RatingHiddenInput = publicComponent(defineComponent({
|
|
21
|
+
name: "RatingHiddenInput",
|
|
22
|
+
inheritAttrs: false,
|
|
23
|
+
props: { ...asProp },
|
|
24
|
+
setup(props, { attrs, slots }) {
|
|
25
|
+
const rating = useRequiredContext(RatingKey, "Rating.HiddenInput");
|
|
26
|
+
const input = shallowRef(null);
|
|
27
|
+
watch(input, (element, _, onCleanup) => {
|
|
28
|
+
rating.setHiddenInput(element);
|
|
29
|
+
if (element === null) return;
|
|
30
|
+
onCleanup(bridgeForm(element, {
|
|
31
|
+
reset: () => {
|
|
32
|
+
rating.reset();
|
|
33
|
+
const value = rating.value.value;
|
|
34
|
+
element.value = value > 0 ? String(value) : "";
|
|
35
|
+
},
|
|
36
|
+
invalid: () => rating.tabStopElement()
|
|
37
|
+
}));
|
|
38
|
+
}, { flush: "post" });
|
|
39
|
+
onBeforeUnmount(() => rating.setHiddenInput(null));
|
|
40
|
+
const setInput = (node) => {
|
|
41
|
+
input.value = node;
|
|
42
|
+
};
|
|
43
|
+
return () => {
|
|
44
|
+
const value = rating.value.value;
|
|
45
|
+
const state = {
|
|
46
|
+
value,
|
|
47
|
+
disabled: rating.disabled(),
|
|
48
|
+
readOnly: rating.readOnly(),
|
|
49
|
+
required: rating.required()
|
|
50
|
+
};
|
|
51
|
+
return renderPart("input", {
|
|
52
|
+
attrs,
|
|
53
|
+
slots
|
|
54
|
+
}, props.as, state, {
|
|
55
|
+
"aria-hidden": "true",
|
|
56
|
+
tabindex: -1,
|
|
57
|
+
name: value > 0 ? rating.name() : void 0,
|
|
58
|
+
value: value > 0 ? String(value) : "",
|
|
59
|
+
required: state.required,
|
|
60
|
+
disabled: state.disabled,
|
|
61
|
+
style: VISUALLY_HIDDEN_INPUT_STYLE,
|
|
62
|
+
"data-primitives-part": "rating-hidden-input",
|
|
63
|
+
ref: setInput
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
// src/components/rating/rating-item.ts
|
|
69
|
+
/** The value under the pointer on a star (spec/rating.md, "Pointer"). */
|
|
70
|
+
function valueAt(event, index, allowHalf) {
|
|
71
|
+
const star = event.currentTarget;
|
|
72
|
+
const fraction = fractionAlong(star.getBoundingClientRect(), {
|
|
73
|
+
x: event.clientX,
|
|
74
|
+
y: event.clientY
|
|
75
|
+
}, "horizontal", getDirection(star) === "rtl");
|
|
76
|
+
return ratingValueAt(index, fraction, allowHalf);
|
|
77
|
+
}
|
|
78
|
+
/** A star: a `radio` of the Rating (spec/rating.md). */
|
|
79
|
+
const RatingItem = publicComponent(defineComponent({
|
|
80
|
+
name: "RatingItem",
|
|
81
|
+
inheritAttrs: false,
|
|
82
|
+
props: {
|
|
83
|
+
...asProp,
|
|
84
|
+
index: {
|
|
85
|
+
type: Number,
|
|
86
|
+
required: true
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
slots: Object,
|
|
90
|
+
setup(props, { attrs, slots }) {
|
|
91
|
+
const rating = useRequiredContext(RatingKey, "Rating.Item");
|
|
92
|
+
const element = shallowRef(null);
|
|
93
|
+
const setElement = elementSetter(element);
|
|
94
|
+
watch(() => [element.value, props.index], ([node, index], _, onCleanup) => {
|
|
95
|
+
if (node !== null) onCleanup(rating.registerItem(index, node));
|
|
96
|
+
}, {
|
|
97
|
+
flush: "post",
|
|
98
|
+
immediate: true
|
|
99
|
+
});
|
|
100
|
+
const interactive = () => !rating.disabled() && !rating.readOnly();
|
|
101
|
+
const onPointermove = (event) => {
|
|
102
|
+
if (interactive() && event.pointerType !== "touch") rating.preview(valueAt(event, props.index, rating.allowHalf()));
|
|
103
|
+
};
|
|
104
|
+
const onClick = (event) => {
|
|
105
|
+
if (!interactive()) return;
|
|
106
|
+
event.currentTarget.focus();
|
|
107
|
+
const next = event.detail === 0 ? props.index : valueAt(event, props.index, rating.allowHalf());
|
|
108
|
+
if (next !== rating.value.value) rating.choose(next, "item-press", event);
|
|
109
|
+
else if (rating.allowClear()) rating.choose(0, "item-press", event);
|
|
110
|
+
};
|
|
111
|
+
const onKeydown = (event) => {
|
|
112
|
+
if (event.key === "Enter") {
|
|
113
|
+
event.preventDefault();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (event.key === " ") event.preventDefault();
|
|
117
|
+
if (rating.keyDown(event.key, props.index, event)) event.preventDefault();
|
|
118
|
+
};
|
|
119
|
+
const onKeyup = (event) => {
|
|
120
|
+
if (event.key === " ") event.preventDefault();
|
|
121
|
+
};
|
|
122
|
+
return () => {
|
|
123
|
+
const { index } = props;
|
|
124
|
+
const disabled = rating.disabled();
|
|
125
|
+
const readOnly = rating.readOnly();
|
|
126
|
+
const state = {
|
|
127
|
+
index,
|
|
128
|
+
...ratingItemState(index, rating.value.value, rating.displayed.value),
|
|
129
|
+
disabled,
|
|
130
|
+
readOnly
|
|
131
|
+
};
|
|
132
|
+
return renderPart("button", {
|
|
133
|
+
attrs,
|
|
134
|
+
slots
|
|
135
|
+
}, props.as, state, {
|
|
136
|
+
type: "button",
|
|
137
|
+
role: "radio",
|
|
138
|
+
disabled,
|
|
139
|
+
"aria-checked": state.checked ? "true" : "false",
|
|
140
|
+
tabindex: rating.tabStop.value === index ? 0 : -1,
|
|
141
|
+
"data-primitives-part": "rating-item",
|
|
142
|
+
...stateAttributes({
|
|
143
|
+
checked: state.checked,
|
|
144
|
+
unchecked: !state.checked,
|
|
145
|
+
highlighted: state.highlighted,
|
|
146
|
+
half: state.half,
|
|
147
|
+
disabled,
|
|
148
|
+
readonly: readOnly
|
|
149
|
+
}),
|
|
150
|
+
onPointermove,
|
|
151
|
+
onClick,
|
|
152
|
+
onKeydown,
|
|
153
|
+
onKeyup,
|
|
154
|
+
ref: setElement
|
|
155
|
+
}, () => slots.default?.(state));
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}));
|
|
159
|
+
// src/components/rating/parts.ts
|
|
160
|
+
/** spec/rating.md */
|
|
161
|
+
const Rating = {
|
|
162
|
+
Root: publicComponent(defineComponent({
|
|
163
|
+
name: "RatingRoot",
|
|
164
|
+
inheritAttrs: false,
|
|
165
|
+
props: {
|
|
166
|
+
...asProp,
|
|
167
|
+
value: {
|
|
168
|
+
type: Number,
|
|
169
|
+
default: void 0
|
|
170
|
+
},
|
|
171
|
+
defaultValue: {
|
|
172
|
+
type: Number,
|
|
173
|
+
default: 0
|
|
174
|
+
},
|
|
175
|
+
count: {
|
|
176
|
+
type: Number,
|
|
177
|
+
default: 5
|
|
178
|
+
},
|
|
179
|
+
allowHalf: {
|
|
180
|
+
type: Boolean,
|
|
181
|
+
default: false
|
|
182
|
+
},
|
|
183
|
+
allowClear: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
default: false
|
|
186
|
+
},
|
|
187
|
+
readOnly: {
|
|
188
|
+
type: Boolean,
|
|
189
|
+
default: false
|
|
190
|
+
},
|
|
191
|
+
disabled: {
|
|
192
|
+
type: Boolean,
|
|
193
|
+
default: false
|
|
194
|
+
},
|
|
195
|
+
required: {
|
|
196
|
+
type: Boolean,
|
|
197
|
+
default: false
|
|
198
|
+
},
|
|
199
|
+
name: {
|
|
200
|
+
type: String,
|
|
201
|
+
default: void 0
|
|
202
|
+
},
|
|
203
|
+
loopFocus: {
|
|
204
|
+
type: Boolean,
|
|
205
|
+
default: true
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
emits: {
|
|
209
|
+
"update:value": (_value) => true,
|
|
210
|
+
valueChange: (_value, _details) => true
|
|
211
|
+
},
|
|
212
|
+
slots: Object,
|
|
213
|
+
setup(props, { attrs, slots, emit }) {
|
|
214
|
+
const own = useControllable(() => props.value, props.defaultValue, (next, details) => {
|
|
215
|
+
emit("update:value", next);
|
|
216
|
+
emit("valueChange", next, details);
|
|
217
|
+
});
|
|
218
|
+
const value = computed(() => own.value.value);
|
|
219
|
+
const element = shallowRef(null);
|
|
220
|
+
const setElement = elementSetter(element);
|
|
221
|
+
const direction = useProvidedDirection();
|
|
222
|
+
const hovered = shallowRef(null);
|
|
223
|
+
const stars = /* @__PURE__ */ new Map();
|
|
224
|
+
let hiddenInput = null;
|
|
225
|
+
const tabStopElement = () => {
|
|
226
|
+
if (disabled()) return null;
|
|
227
|
+
const current = value.value;
|
|
228
|
+
return stars.get(current > 0 ? Math.ceil(current) : 1) ?? null;
|
|
229
|
+
};
|
|
230
|
+
const field = useFieldControl({
|
|
231
|
+
id: () => void 0,
|
|
232
|
+
labelable: false,
|
|
233
|
+
value: () => value.value,
|
|
234
|
+
filled: () => value.value > 0,
|
|
235
|
+
input: () => hiddenInput,
|
|
236
|
+
element: () => element.value,
|
|
237
|
+
focusTarget: tabStopElement
|
|
238
|
+
});
|
|
239
|
+
const disabled = () => props.disabled || field.disabled();
|
|
240
|
+
const interactive = () => !disabled() && !props.readOnly;
|
|
241
|
+
const choose = (next, reason, event) => own.set(next, {
|
|
242
|
+
reason,
|
|
243
|
+
event
|
|
244
|
+
});
|
|
245
|
+
const preview = (next) => {
|
|
246
|
+
hovered.value = interactive() ? next : null;
|
|
247
|
+
};
|
|
248
|
+
const keyDown = (key, index, event) => {
|
|
249
|
+
const root = element.value;
|
|
250
|
+
if (!interactive() || root === null) return false;
|
|
251
|
+
const current = value.value;
|
|
252
|
+
if (key === " ") {
|
|
253
|
+
if (Math.ceil(current) !== index || current <= 0) choose(index, "keyboard", event);
|
|
254
|
+
return true;
|
|
255
|
+
}
|
|
256
|
+
const target = ratingKeyTarget(key, current, {
|
|
257
|
+
count: props.count,
|
|
258
|
+
allowHalf: props.allowHalf,
|
|
259
|
+
rtl: getDirection(root, direction()) === "rtl",
|
|
260
|
+
loop: props.loopFocus
|
|
261
|
+
});
|
|
262
|
+
if (target === null) return false;
|
|
263
|
+
stars.get(Math.ceil(target))?.focus();
|
|
264
|
+
choose(target, "keyboard", event);
|
|
265
|
+
return true;
|
|
266
|
+
};
|
|
267
|
+
const registerItem = (index, star) => {
|
|
268
|
+
stars.set(index, star);
|
|
269
|
+
return () => {
|
|
270
|
+
if (stars.get(index) === star) stars.delete(index);
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
const setHiddenInput = (input) => {
|
|
274
|
+
hiddenInput = input;
|
|
275
|
+
};
|
|
276
|
+
const reset = () => {
|
|
277
|
+
field.reset();
|
|
278
|
+
own.set(props.defaultValue, { reason: "none" });
|
|
279
|
+
};
|
|
280
|
+
const displayed = computed(() => interactive() && hovered.value !== null ? hovered.value : value.value);
|
|
281
|
+
const tabStop = computed(() => disabled() ? null : value.value > 0 ? Math.ceil(value.value) : 1);
|
|
282
|
+
provide(RatingKey, {
|
|
283
|
+
value,
|
|
284
|
+
displayed,
|
|
285
|
+
allowHalf: () => props.allowHalf,
|
|
286
|
+
allowClear: () => props.allowClear,
|
|
287
|
+
disabled,
|
|
288
|
+
readOnly: () => props.readOnly,
|
|
289
|
+
required: () => props.required,
|
|
290
|
+
name: () => field.name() ?? props.name,
|
|
291
|
+
tabStop,
|
|
292
|
+
choose,
|
|
293
|
+
preview,
|
|
294
|
+
keyDown,
|
|
295
|
+
registerItem,
|
|
296
|
+
setHiddenInput,
|
|
297
|
+
reset,
|
|
298
|
+
tabStopElement
|
|
299
|
+
});
|
|
300
|
+
const items = computed(() => Array.from({ length: props.count }, (_, index) => index + 1));
|
|
301
|
+
const onPointerleave = () => {
|
|
302
|
+
hovered.value = null;
|
|
303
|
+
};
|
|
304
|
+
const onFocusin = () => field.onFocus();
|
|
305
|
+
const onFocusout = (event) => {
|
|
306
|
+
const next = event.relatedTarget;
|
|
307
|
+
if (next === null || !element.value?.contains(next)) field.onBlur();
|
|
308
|
+
};
|
|
309
|
+
return () => {
|
|
310
|
+
const isDisabled = disabled();
|
|
311
|
+
const { readOnly, required } = props;
|
|
312
|
+
const current = value.value;
|
|
313
|
+
const state = {
|
|
314
|
+
value: current,
|
|
315
|
+
disabled: isDisabled,
|
|
316
|
+
readOnly,
|
|
317
|
+
required
|
|
318
|
+
};
|
|
319
|
+
return renderPart("div", {
|
|
320
|
+
attrs,
|
|
321
|
+
slots
|
|
322
|
+
}, props.as, state, {
|
|
323
|
+
role: "radiogroup",
|
|
324
|
+
"aria-readonly": readOnly ? "true" : void 0,
|
|
325
|
+
"aria-disabled": isDisabled ? "true" : void 0,
|
|
326
|
+
"aria-required": required ? "true" : void 0,
|
|
327
|
+
...field.aria(),
|
|
328
|
+
"data-primitives-part": "rating-root",
|
|
329
|
+
...field.attributes(),
|
|
330
|
+
...stateAttributes({
|
|
331
|
+
disabled: isDisabled,
|
|
332
|
+
readonly: readOnly,
|
|
333
|
+
required
|
|
334
|
+
}),
|
|
335
|
+
onPointerleave,
|
|
336
|
+
onFocusin,
|
|
337
|
+
onFocusout,
|
|
338
|
+
ref: setElement
|
|
339
|
+
}, () => slots.default?.({
|
|
340
|
+
items: items.value,
|
|
341
|
+
value: current
|
|
342
|
+
}));
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
})),
|
|
346
|
+
Item: RatingItem,
|
|
347
|
+
HiddenInput: RatingHiddenInput
|
|
348
|
+
};
|
|
349
|
+
export { Rating as t };
|
|
350
|
+
|
|
351
|
+
//# sourceMappingURL=rating-oC2t52av.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rating-oC2t52av.js","names":[],"sources":["../src/components/rating/rating-context.ts","../src/components/rating/rating-hidden-input.ts","../src/components/rating/rating-item.ts","../src/components/rating/rating-root.ts","../src/components/rating/parts.ts"],"sourcesContent":["import type { ComputedRef, InjectionKey } from \"vue\";\nimport type { ChangeReason } from \"../../utils/change-details.ts\";\n\nexport interface RatingContext {\n /** The score, `0` for none. */\n value: ComputedRef<number>;\n /** The value the stars draw: the pointer's preview while it runs, else the value. */\n displayed: ComputedRef<number>;\n allowHalf: () => boolean;\n /** A press on the current value clears it. */\n allowClear: () => boolean;\n disabled: () => boolean;\n readOnly: () => boolean;\n required: () => boolean;\n /** The HiddenInput's name: the Root's, or its Field's. */\n name: () => string | undefined;\n /** The star holding the tab stop (1 to `count`), `null` for none (disabled). */\n tabStop: ComputedRef<number | null>;\n /** Sets the value. */\n choose: (value: number, reason: ChangeReason, event: Event) => void;\n /** The pointer's preview over a star, `null` when it left the Root. */\n preview: (value: number | null) => void;\n /** A key on a star (spec/rating.md, \"Keyboard\"); `true` when it was handled. */\n keyDown: (key: string, index: number, event: Event) => boolean;\n /** A star's element, which a key focuses once the value moved to it. */\n registerItem: (index: number, element: HTMLElement) => () => void;\n /** The HiddenInput's element, for the Field and the form bridge. */\n setHiddenInput: (input: HTMLInputElement | null) => void;\n /** A form reset: back to `defaultValue`. */\n reset: () => void;\n /** The tab stop's element, where a failed validation sends the focus. */\n tabStopElement: () => HTMLElement | null;\n}\n\nexport const RatingKey: InjectionKey<RatingContext> = Symbol(\"Rating\");\n","import {\n bridgeForm,\n VISUALLY_HIDDEN_INPUT_STYLE,\n} from \"@fragiola/primitives/form\";\nimport { defineComponent, onBeforeUnmount, shallowRef, watch } from \"vue\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PartComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport { asProp, renderPart } from \"../../utils/render-part.ts\";\nimport { RatingKey } from \"./rating-context.ts\";\nimport type { RatingRootState } from \"./rating-root.ts\";\n\n/**\n * The Rating's form value (spec/rating.md, \"Forms\"): a visually hidden input with the score as\n * text, its `name` only while there is one, validated by the browser.\n */\nexport const RatingHiddenInput: PartComponent<\n Record<never, never>,\n RatingRootState\n> = publicComponent(\n defineComponent({\n name: \"RatingHiddenInput\",\n inheritAttrs: false,\n props: { ...asProp },\n setup(props, { attrs, slots }) {\n const rating = useRequiredContext(RatingKey, \"Rating.HiddenInput\");\n const input = shallowRef<HTMLInputElement | null>(null);\n watch(\n input,\n (element, _, onCleanup) => {\n rating.setHiddenInput(element);\n if (element === null) {\n return;\n }\n onCleanup(\n bridgeForm(element, {\n reset: () => {\n rating.reset();\n // the browser reset the input to its default: write the\n // rendered value back (a patch follows a change)\n const value = rating.value.value;\n element.value = value > 0 ? String(value) : \"\";\n },\n invalid: () => rating.tabStopElement(),\n }),\n );\n },\n { flush: \"post\" },\n );\n onBeforeUnmount(() => rating.setHiddenInput(null));\n const setInput = (node: unknown) => {\n input.value = node as HTMLInputElement | null;\n };\n return () => {\n const value = rating.value.value;\n const state: RatingRootState = {\n value,\n disabled: rating.disabled(),\n readOnly: rating.readOnly(),\n required: rating.required(),\n };\n return renderPart(\"input\", { attrs, slots }, props.as, state, {\n \"aria-hidden\": \"true\",\n tabindex: -1,\n name: value > 0 ? rating.name() : undefined,\n value: value > 0 ? String(value) : \"\",\n required: state.required,\n disabled: state.disabled,\n style: VISUALLY_HIDDEN_INPUT_STYLE,\n \"data-primitives-part\": \"rating-hidden-input\",\n ref: setInput,\n });\n };\n },\n }),\n);\n","import { getDirection } from \"@fragiola/primitives/direction\";\nimport {\n fractionAlong,\n ratingItemState,\n ratingValueAt,\n} from \"@fragiola/primitives/range\";\nimport {\n defineComponent,\n type SlotsType,\n shallowRef,\n type VNode,\n watch,\n} from \"vue\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useRequiredContext } from \"../../composables/use-required-context.ts\";\nimport {\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type AsProp,\n asProp,\n type RenderSlotProps,\n renderPart,\n} from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { RatingKey } from \"./rating-context.ts\";\n\n/** A star's state (spec/rating.md, \"API\"). */\nexport interface RatingItemState {\n index: number;\n checked: boolean;\n highlighted: boolean;\n half: boolean;\n disabled: boolean;\n readOnly: boolean;\n}\n\n/** Its default scoped slot receives its state (`v-slot=\"state\"`), its `render` slot as a part's. */\nexport interface RatingItemSlots {\n default?: (state: RatingItemState) => VNode[];\n render?: (scope: RenderSlotProps<RatingItemState>) => VNode[];\n}\n\nexport interface RatingItemProps {\n as?: AsProp;\n /** The star's number, `1` to `count`: its whole value. */\n index: number;\n}\n\n/** The value under the pointer on a star (spec/rating.md, \"Pointer\"). */\nfunction valueAt(event: MouseEvent, index: number, allowHalf: boolean): number {\n const star = event.currentTarget as HTMLElement;\n const fraction = fractionAlong(\n star.getBoundingClientRect(),\n { x: event.clientX, y: event.clientY },\n \"horizontal\",\n getDirection(star) === \"rtl\",\n );\n return ratingValueAt(index, fraction, allowHalf);\n}\n\n/** A star: a `radio` of the Rating (spec/rating.md). */\nexport const RatingItem: PublicComponent<RatingItemProps, RatingItemSlots> =\n publicComponent(\n defineComponent({\n name: \"RatingItem\",\n inheritAttrs: false,\n props: {\n ...asProp,\n index: { type: Number, required: true },\n },\n slots: Object as SlotsType<RatingItemSlots>,\n setup(props, { attrs, slots }) {\n const rating = useRequiredContext(RatingKey, \"Rating.Item\");\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n // registered once its element is (never on a server), again when its index changes\n watch(\n () => [element.value, props.index] as const,\n ([node, index], _, onCleanup) => {\n if (node !== null) {\n onCleanup(rating.registerItem(index, node));\n }\n },\n { flush: \"post\", immediate: true },\n );\n\n const interactive = () =>\n !rating.disabled() && !rating.readOnly();\n const onPointermove = (event: PointerEvent) => {\n // a mouse or a pen previews the value under it; a touch has no hover\n if (interactive() && event.pointerType !== \"touch\") {\n rating.preview(\n valueAt(event, props.index, rating.allowHalf()),\n );\n }\n };\n const onClick = (event: MouseEvent) => {\n if (!interactive()) {\n return;\n }\n (event.currentTarget as HTMLElement).focus();\n // a click with no pointer (a label's, a script's) chooses the whole star\n const next =\n event.detail === 0\n ? props.index\n : valueAt(event, props.index, rating.allowHalf());\n if (next !== rating.value.value) {\n rating.choose(next, \"item-press\", event);\n } else if (rating.allowClear()) {\n rating.choose(0, \"item-press\", event);\n }\n };\n const onKeydown = (event: KeyboardEvent) => {\n // a native radio does not check on Enter (a button would click)\n if (event.key === \"Enter\") {\n event.preventDefault();\n return;\n }\n if (event.key === \" \") {\n // Space is a key, not a press: its click on key up is prevented\n event.preventDefault();\n }\n if (rating.keyDown(event.key, props.index, event)) {\n event.preventDefault();\n }\n };\n const onKeyup = (event: KeyboardEvent) => {\n if (event.key === \" \") {\n event.preventDefault();\n }\n };\n\n return () => {\n const { index } = props;\n const disabled = rating.disabled();\n const readOnly = rating.readOnly();\n const state: RatingItemState = {\n index,\n ...ratingItemState(\n index,\n rating.value.value,\n rating.displayed.value,\n ),\n disabled,\n readOnly,\n };\n return renderPart(\n \"button\",\n { attrs, slots },\n props.as,\n state,\n {\n type: \"button\",\n role: \"radio\",\n disabled,\n \"aria-checked\": state.checked ? \"true\" : \"false\",\n tabindex: rating.tabStop.value === index ? 0 : -1,\n \"data-primitives-part\": \"rating-item\",\n ...stateAttributes({\n checked: state.checked,\n unchecked: !state.checked,\n highlighted: state.highlighted,\n half: state.half,\n disabled,\n readonly: readOnly,\n }),\n onPointermove,\n onClick,\n onKeydown,\n onKeyup,\n ref: setElement,\n },\n () => slots.default?.(state),\n );\n };\n },\n }),\n );\n","import { getDirection } from \"@fragiola/primitives/direction\";\nimport { ratingKeyTarget } from \"@fragiola/primitives/range\";\nimport {\n computed,\n defineComponent,\n provide,\n type SlotsType,\n shallowRef,\n type VNode,\n} from \"vue\";\nimport { useControllable } from \"../../composables/use-controllable.ts\";\nimport { useFieldControl } from \"../../composables/use-field-control.ts\";\nimport { elementSetter } from \"../../composables/use-overlay-root.ts\";\nimport { useProvidedDirection } from \"../../direction/direction-context.ts\";\nimport type {\n ChangeDetails,\n ChangeReason,\n} from \"../../utils/change-details.ts\";\nimport {\n type PublicComponent,\n publicComponent,\n} from \"../../utils/public-component.ts\";\nimport {\n type AsProp,\n asProp,\n type RenderSlotProps,\n renderPart,\n} from \"../../utils/render-part.ts\";\nimport { stateAttributes } from \"../../utils/state-attributes.ts\";\nimport { RatingKey } from \"./rating-context.ts\";\n\nexport interface RatingRootState {\n value: number;\n disabled: boolean;\n readOnly: boolean;\n required: boolean;\n}\n\n/** What the Root's default scoped slot receives (spec/rating.md, \"API\"). */\nexport interface RatingRootRenderState {\n /** The stars' indexes, `1` to `count`. */\n items: number[];\n value: number;\n}\n\nexport interface RatingRootSlots {\n default?: (scope: RatingRootRenderState) => VNode[];\n render?: (scope: RenderSlotProps<RatingRootState>) => VNode[];\n}\n\nexport interface RatingRootProps {\n as?: AsProp;\n /** The score, `0` for none (controlled). */\n value?: number;\n /** The score at first (default `0`: none). */\n defaultValue?: number;\n /** The number of stars (default `5`). */\n count?: number;\n /** Half steps: the arrows step by 0.5, a press on a star's inline-start half chooses its half. */\n allowHalf?: boolean;\n /** A press that chooses the current value again clears it (default `false`). */\n allowClear?: boolean;\n /** Shown and focusable; nothing changes it. */\n readOnly?: boolean;\n /** Every star is disabled. */\n disabled?: boolean;\n /** The form's validation fails while the value is `0`. */\n required?: boolean;\n /** The HiddenInput's name. */\n name?: string;\n /** The arrows wrap from `count` to the first step and back (default `true`). */\n loopFocus?: boolean;\n}\n\nexport type RatingRootEmits = {\n /** The new score (`v-model:value`); `0` for none. */\n \"update:value\": (value: number) => true;\n valueChange: (value: number, details: ChangeDetails) => true;\n};\n\n/**\n * A score chosen among stars (`v-model:value`; spec/rating.md, the APG's rating radio group): the\n * `radiogroup`, one `radio` per star, one tab stop, the arrows step the value and move the focus,\n * a pointer previews the value it would choose.\n */\nexport const RatingRoot: PublicComponent<\n RatingRootProps,\n RatingRootSlots,\n RatingRootEmits\n> = publicComponent(\n defineComponent({\n name: \"RatingRoot\",\n inheritAttrs: false,\n props: {\n ...asProp,\n value: { type: Number, default: undefined },\n defaultValue: { type: Number, default: 0 },\n count: { type: Number, default: 5 },\n allowHalf: { type: Boolean, default: false },\n allowClear: { type: Boolean, default: false },\n readOnly: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n required: { type: Boolean, default: false },\n name: { type: String, default: undefined },\n loopFocus: { type: Boolean, default: true },\n },\n emits: {\n \"update:value\": (_value: number) => true,\n valueChange: (_value: number, _details: ChangeDetails) => true,\n },\n slots: Object as SlotsType<RatingRootSlots>,\n setup(props, { attrs, slots, emit }) {\n const own = useControllable<number, ChangeDetails>(\n () => props.value,\n props.defaultValue,\n (next, details) => {\n emit(\"update:value\", next);\n emit(\"valueChange\", next, details);\n },\n );\n const value = computed(() => own.value.value);\n const element = shallowRef<HTMLElement | null>(null);\n const setElement = elementSetter(element);\n const direction = useProvidedDirection();\n const hovered = shallowRef<number | null>(null);\n const stars = new Map<number, HTMLElement>();\n let hiddenInput: HTMLInputElement | null = null;\n\n // a disabled Root has no tab stop: the Field focuses nothing (spec/rating.md, \"Focus\")\n const tabStopElement = () => {\n if (disabled()) {\n return null;\n }\n const current = value.value;\n return stars.get(current > 0 ? Math.ceil(current) : 1) ?? null;\n };\n // inside a Field, the Root is the field's control (spec/field.md, \"Integration\n // contract\"), as RadioGroup; the validated element is the HiddenInput\n const field = useFieldControl({\n id: () => undefined,\n labelable: false,\n value: () => value.value,\n filled: () => value.value > 0,\n input: () => hiddenInput,\n element: () => element.value,\n focusTarget: tabStopElement,\n });\n const disabled = () => props.disabled || field.disabled();\n const interactive = () => !disabled() && !props.readOnly;\n\n const choose = (next: number, reason: ChangeReason, event: Event) =>\n own.set(next, { reason, event });\n const preview = (next: number | null) => {\n hovered.value = interactive() ? next : null;\n };\n const keyDown = (key: string, index: number, event: Event) => {\n const root = element.value;\n if (!interactive() || root === null) {\n return false;\n }\n const current = value.value;\n if (key === \" \") {\n // checks the focused star, when it is not checked (spec/rating.md,\n // \"Keyboard\")\n if (Math.ceil(current) !== index || current <= 0) {\n choose(index, \"keyboard\", event);\n }\n return true;\n }\n const target = ratingKeyTarget(key, current, {\n count: props.count,\n allowHalf: props.allowHalf,\n rtl: getDirection(root, direction()) === \"rtl\",\n loop: props.loopFocus,\n });\n if (target === null) {\n return false;\n }\n stars.get(Math.ceil(target))?.focus();\n choose(target, \"keyboard\", event);\n return true;\n };\n const registerItem = (index: number, star: HTMLElement) => {\n stars.set(index, star);\n return () => {\n if (stars.get(index) === star) {\n stars.delete(index);\n }\n };\n };\n const setHiddenInput = (input: HTMLInputElement | null) => {\n hiddenInput = input;\n };\n const reset = () => {\n field.reset();\n own.set(props.defaultValue, { reason: \"none\" });\n };\n\n const displayed = computed(() =>\n interactive() && hovered.value !== null\n ? hovered.value\n : value.value,\n );\n const tabStop = computed(() =>\n disabled()\n ? null\n : value.value > 0\n ? Math.ceil(value.value)\n : 1,\n );\n provide(RatingKey, {\n value,\n displayed,\n allowHalf: () => props.allowHalf,\n allowClear: () => props.allowClear,\n disabled,\n readOnly: () => props.readOnly,\n required: () => props.required,\n name: () => field.name() ?? props.name,\n tabStop,\n choose,\n preview,\n keyDown,\n registerItem,\n setHiddenInput,\n reset,\n tabStopElement,\n });\n const items = computed(() =>\n Array.from({ length: props.count }, (_, index) => index + 1),\n );\n\n // the preview ends when the pointer leaves the stars' Root\n const onPointerleave = () => {\n hovered.value = null;\n };\n // focus within the Root; touched once focus leaves it\n const onFocusin = () => field.onFocus();\n const onFocusout = (event: FocusEvent) => {\n const next = event.relatedTarget as Node | null;\n if (next === null || !element.value?.contains(next)) {\n field.onBlur();\n }\n };\n return () => {\n const isDisabled = disabled();\n const { readOnly, required } = props;\n const current = value.value;\n const state: RatingRootState = {\n value: current,\n disabled: isDisabled,\n readOnly,\n required,\n };\n return renderPart(\n \"div\",\n { attrs, slots },\n props.as,\n state,\n {\n role: \"radiogroup\",\n \"aria-readonly\": readOnly ? \"true\" : undefined,\n \"aria-disabled\": isDisabled ? \"true\" : undefined,\n \"aria-required\": required ? \"true\" : undefined,\n ...field.aria(),\n \"data-primitives-part\": \"rating-root\",\n ...field.attributes(),\n ...stateAttributes({\n disabled: isDisabled,\n readonly: readOnly,\n required,\n }),\n onPointerleave,\n onFocusin,\n onFocusout,\n ref: setElement,\n },\n () =>\n slots.default?.({ items: items.value, value: current }),\n );\n };\n },\n }),\n);\n","import { RatingHiddenInput } from \"./rating-hidden-input.ts\";\nimport { RatingItem } from \"./rating-item.ts\";\nimport { RatingRoot } from \"./rating-root.ts\";\n\n/** spec/rating.md */\nexport const Rating = {\n Root: RatingRoot,\n Item: RatingItem,\n HiddenInput: RatingHiddenInput,\n};\n"],"mappings":";;;;;;;;;;;;;AAkCA,MAAa,YAAyC,OAAO,QAAQ;;;;;;AChBrE,MAAa,oBAGT,gBACA,gBAAgB;CACZ,MAAM;CACN,cAAc;CACd,OAAO,EAAE,GAAG,OAAO;CACnB,MAAM,OAAO,EAAE,OAAO,SAAS;EAC3B,MAAM,SAAS,mBAAmB,WAAW,oBAAoB;EACjE,MAAM,QAAQ,WAAoC,IAAI;EACtD,MACI,QACC,SAAS,GAAG,cAAc;GACvB,OAAO,eAAe,OAAO;GAC7B,IAAI,YAAY,MACZ;GAEJ,UACI,WAAW,SAAS;IAChB,aAAa;KACT,OAAO,MAAM;KAGb,MAAM,QAAQ,OAAO,MAAM;KAC3B,QAAQ,QAAQ,QAAQ,IAAI,OAAO,KAAK,IAAI;IAChD;IACA,eAAe,OAAO,eAAe;GACzC,CAAC,CACL;EACJ,GACA,EAAE,OAAO,OAAO,CACpB;EACA,sBAAsB,OAAO,eAAe,IAAI,CAAC;EACjD,MAAM,YAAY,SAAkB;GAChC,MAAM,QAAQ;EAClB;EACA,aAAa;GACT,MAAM,QAAQ,OAAO,MAAM;GAC3B,MAAM,QAAyB;IAC3B;IACA,UAAU,OAAO,SAAS;IAC1B,UAAU,OAAO,SAAS;IAC1B,UAAU,OAAO,SAAS;GAC9B;GACA,OAAO,WAAW,SAAS;IAAE;IAAO;GAAM,GAAG,MAAM,IAAI,OAAO;IAC1D,eAAe;IACf,UAAU;IACV,MAAM,QAAQ,IAAI,OAAO,KAAK,IAAI,KAAA;IAClC,OAAO,QAAQ,IAAI,OAAO,KAAK,IA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ACA;IACA;GACJ,CAAC;GACD,MAAM,QAAQ,eACV,MAAM,KAAK,EAAE,QAAQ,MAAM,MAAM,IAAI,GAAG,UAAU,QAAQ,CAAC,CAC/D;GAGA,MAAM,uBAAuB;IACzB,QAAQ,QAAQ;GACpB;GAEA,MAAM,kBAAkB,MAAM,QAAQ;GACtC,MAAM,cAAc,UAAsB;IACtC,MAAM,OAAO,MAAM;IACnB,IAAI,SAAS,QAAQ,CAAC,QAAQ,OAAO,SAAS,IAAI,GAC9C,MAAM,OAAO;GAErB;GACA,aAAa;IACT,MAAM,aAAa,SAAS;IAC5B,MAAM,EAAE,UAAU,aAAa;IAC/B,MAAM,UAAU,MAAM;IACtB,MAAM,QAAyB;KAC3B,OAAO;KACP,UAAU;KACV;KACA;IACJ;IACA,OAAO,WACH,OACA;KAAE;KAAO;IAAM,GACf,MAAM,IACN,OACA;KACI,MAAM;KACN,iBAAiB,WAAW,SAAS,KAAA;KACrC,iBAAiB,aAAa,SAAS,KAAA;KACvC,iBAAiB,WAAW,SAAS,KAAA;KACrC,GAAG,MAAM,KAAK;KACd,wBAAwB;KACxB,GAAG,MAAM,WAAW;KACpB,GAAG,gBAAgB;MACf,UAAU;MACV,UAAU;MACV;KACJ,CAAC;KACD;KACA;KACA;KACA,KAAK;IACT,SAEI,MAAM,UAAU;KAAE,OAAO,MAAM;KAAO,OAAO;IAAQ,CAAC,CAC9D;GACJ;EACJ;CACJ,CAAC,CCpRK;CACN,MAAM;CACN,aAAa;AACjB"}
|
package/dist/rating.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { n as ChangeReason, t as ChangeDetails } from "./change-details-Bc4-Xzdm.js";
|
|
2
|
+
import { n as RenderSlotProps } from "./render-part-BaTKiWBp.js";
|
|
3
|
+
import { a as RatingRootEmits, c as RatingRootSlots, i as RatingItemState, l as RatingRootState, n as RatingItemProps, o as RatingRootProps, r as RatingItemSlots, s as RatingRootRenderState, t as Rating } from "./index-D3yyJGzf.js";
|
|
4
|
+
export { type ChangeDetails, type ChangeReason, Rating, type RatingItemProps, type RatingItemSlots, type RatingItemState, type RatingRootEmits, type RatingRootProps, type RatingRootRenderState, type RatingRootSlots, type RatingRootState, type RenderSlotProps };
|
package/dist/rating.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Rating } from "./rating-oC2t52av.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Fragment, h, mergeProps } from "vue";
|
|
2
|
+
// src/utils/render-part.ts
|
|
3
|
+
/** The `as` prop every part takes. */
|
|
4
|
+
const asProp = { as: {
|
|
5
|
+
type: [
|
|
6
|
+
String,
|
|
7
|
+
Object,
|
|
8
|
+
Function
|
|
9
|
+
],
|
|
10
|
+
default: void 0
|
|
11
|
+
} };
|
|
12
|
+
const PartChildren = (props) => props.content?.();
|
|
13
|
+
PartChildren.props = ["content"];
|
|
14
|
+
/**
|
|
15
|
+
* Renders a part: the part's props merged with the consumer's attributes (Vue's `mergeProps`:
|
|
16
|
+
* `class` and `style` join, listeners run the part's first, other attributes the consumer's), on
|
|
17
|
+
* the default element, on `as`, or through the `render` slot.
|
|
18
|
+
*/
|
|
19
|
+
function renderPart(tag, context, as, state, internal, children) {
|
|
20
|
+
const props = mergeProps(internal, context.attrs);
|
|
21
|
+
const content = children ?? (() => context.slots.default?.({ state }));
|
|
22
|
+
const render = context.slots.render;
|
|
23
|
+
if (render) return h(Fragment, render({
|
|
24
|
+
props,
|
|
25
|
+
state,
|
|
26
|
+
children: h(PartChildren, { content })
|
|
27
|
+
}));
|
|
28
|
+
return h(as ?? tag, props, { default: () => {
|
|
29
|
+
const nodes = content();
|
|
30
|
+
if (nodes === void 0 || nodes === null) return [];
|
|
31
|
+
return Array.isArray(nodes) ? nodes : [nodes];
|
|
32
|
+
} });
|
|
33
|
+
}
|
|
34
|
+
export { renderPart as n, asProp as t };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=render-part-B5XVbHaS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-part-B5XVbHaS.js","names":[],"sources":["../src/utils/render-part.ts"],"sourcesContent":["import {\n type Component,\n Fragment,\n type FunctionalComponent,\n h,\n mergeProps,\n type PropType,\n type Slots,\n type VNode,\n type VNodeChild,\n} from \"vue\";\n\n/** A tag or component a part renders instead of its own element (the `as` prop, never `asChild`). */\nexport type AsProp = string | Component;\n\n/** The `as` prop every part takes. */\nexport const asProp = {\n as: {\n type: [String, Object, Function] as PropType<AsProp>,\n default: undefined,\n },\n};\n\n/** What a part's `render` scoped slot receives (spec/README.md, API mapping: Vue). */\nexport interface RenderSlotProps<State> {\n /** Bind on your own element (`v-bind=\"props\"`): ARIA, `data-*`, listeners, the template ref. */\n props: Record<string, unknown>;\n state: State;\n /** The part's content, as one stable component (`<component :is=\"children\" />`). */\n children: VNode;\n}\n\nconst PartChildren: FunctionalComponent<{\n content?: (() => VNodeChild) | undefined;\n}> = (props) => props.content?.();\nPartChildren.props = [\"content\"];\n\n/**\n * Renders a part: the part's props merged with the consumer's attributes (Vue's `mergeProps`:\n * `class` and `style` join, listeners run the part's first, other attributes the consumer's), on\n * the default element, on `as`, or through the `render` slot.\n */\nexport function renderPart<State>(\n tag: string,\n context: { attrs: Record<string, unknown>; slots: Slots },\n as: AsProp | undefined,\n state: State,\n internal: Record<string, unknown>,\n children?: () => VNodeChild,\n): VNode {\n const props = mergeProps(internal, context.attrs);\n const content = children ?? (() => context.slots.default?.({ state }));\n const render = context.slots.render;\n if (render) {\n return h(\n Fragment,\n render({ props, state, children: h(PartChildren, { content }) }),\n );\n }\n // an element's children must be an array: a single vnode would read as a slots object; no\n // content is no child (not a comment placeholder, which a void element such as an `input`\n // cannot take from a server render: Epic #22)\n return h(as ?? tag, props, {\n default: () => {\n const nodes = content();\n if (nodes === undefined || nodes === null) {\n return [];\n }\n return Array.isArray(nodes) ? nodes : [nodes];\n },\n });\n}\n"],"mappings":";;;AAgBA,MAAa,SAAS,EAClB,IAAI;CACA,MAAM;EAAC;EAAQ;EAAQ;CAAQ;CAC/B,SAAS,KAAA;AACb,EACJ;AAWA,MAAM,gBAEA,UAAU,MAAM,UAAU;AAChC,aAAa,QAAQ,CAAC,SAAS;;;;;;AAO/B,SAAgB,WACZ,KACA,SACA,IACA,OACA,UACA,UACK;CACL,MAAM,QAAQ,WAAW,UAAU,QAAQ,KAAK;CAChD,MAAM,UAAU,mBAAmB,QAAQ,MAAM,UAAU,EAAE,MAAM,CAAC;CACpE,MAAM,SAAS,QAAQ,MAAM;CAC7B,IAAI,QACA,OAAO,EACH,UACA,OAAO;EAAE;EAAO;EAAO,UAAU,EAAE,cAAc,EAAE,QAAQ,CAAC;CAAE,CAAC,CACnE;CAKJ,OAAO,EAAE,MAAM,KAAK,OAAO,EACvB,eAAe;EACX,MAAM,QAAQ,QAAQ;EACtB,IAAI,UAAU,KAAA,KAAa,UAAU,MACjC,OAAO,CAAC;EAEZ,OAAO,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,KAAK;CAChD,EACJ,CAAC;AACL"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Component, PropType, Slots, VNode, VNodeChild } from "vue";
|
|
2
|
+
/** A tag or component a part renders instead of its own element (the `as` prop, never `asChild`). */
|
|
3
|
+
type AsProp = string | Component;
|
|
4
|
+
/** The `as` prop every part takes. */
|
|
5
|
+
declare const asProp: {
|
|
6
|
+
as: {
|
|
7
|
+
type: PropType<AsProp>;
|
|
8
|
+
default: undefined;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/** What a part's `render` scoped slot receives (spec/README.md, API mapping: Vue). */
|
|
12
|
+
interface RenderSlotProps<State> {
|
|
13
|
+
/** Bind on your own element (`v-bind="props"`): ARIA, `data-*`, listeners, the template ref. */
|
|
14
|
+
props: Record<string, unknown>;
|
|
15
|
+
state: State;
|
|
16
|
+
/** The part's content, as one stable component (`<component :is="children" />`). */
|
|
17
|
+
children: VNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Renders a part: the part's props merged with the consumer's attributes (Vue's `mergeProps`:
|
|
21
|
+
* `class` and `style` join, listeners run the part's first, other attributes the consumer's), on
|
|
22
|
+
* the default element, on `as`, or through the `render` slot.
|
|
23
|
+
*/
|
|
24
|
+
declare function renderPart<State>(tag: string, context: {
|
|
25
|
+
attrs: Record<string, unknown>;
|
|
26
|
+
slots: Slots;
|
|
27
|
+
}, as: AsProp | undefined, state: State, internal: Record<string, unknown>, children?: () => VNodeChild): VNode;
|
|
28
|
+
export { renderPart as i, RenderSlotProps as n, asProp as r, AsProp as t };
|
package/dist/render.d.ts
ADDED
package/dist/render.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// src/utils/roving-context.ts
|
|
2
|
+
const RovingKey = Symbol("RovingScope");
|
|
3
|
+
/**
|
|
4
|
+
* The scope an element is in: `scope`, unless the element is outside the scope's root (a Toggle in
|
|
5
|
+
* a popup that a Teleport renders from a Toolbar's item: `inject` passes through the Teleport, the
|
|
6
|
+
* element is elsewhere), then `null`. While either element is unknown (a server render, before
|
|
7
|
+
* the mount), the element is taken as inside, so the server's output does not change. Reactive
|
|
8
|
+
* through the scope's `root`.
|
|
9
|
+
*/
|
|
10
|
+
function scopeOfElement(scope, element) {
|
|
11
|
+
const root = scope?.root() ?? null;
|
|
12
|
+
if (scope === null || element === null || root === null) return scope;
|
|
13
|
+
return root.contains(element) ? scope : null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A scope that forwards every field to `current()`'s (a ToggleGroup's: the Toolbar's around it,
|
|
17
|
+
* or its own once it is known to be outside the toolbar's element). Its `root` changes with
|
|
18
|
+
* `current`, so its items register again with the scope they are now in.
|
|
19
|
+
*/
|
|
20
|
+
function forwardingScope(current) {
|
|
21
|
+
return {
|
|
22
|
+
orientation: () => current().orientation(),
|
|
23
|
+
disabled: () => current().disabled(),
|
|
24
|
+
root: () => current().root(),
|
|
25
|
+
tabStop: () => current().tabStop(),
|
|
26
|
+
register: (element, focusable) => current().register(element, focusable),
|
|
27
|
+
focused: (element) => current().focused(element)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export { forwardingScope as n, scopeOfElement as r, RovingKey as t };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=roving-context-LyHQFJqZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roving-context-LyHQFJqZ.js","names":[],"sources":["../src/utils/roving-context.ts"],"sourcesContent":["import type { RovingOrientation } from \"@fragiola/primitives/collection\";\nimport type { InjectionKey } from \"vue\";\n\n/**\n * A roving-focus scope (spec/toolbar.md, \"Nested composites\"): provided by a Toolbar.Root, or by a\n * ToggleGroup with none around it; every item inside registers with the nearest one. It lives in\n * the package's shared code, so no component entry imports another's for it (D8).\n */\nexport interface RovingScope {\n orientation: () => RovingOrientation;\n /** The scope disables its items (a disabled Toolbar.Root or Toolbar.Group). */\n disabled: () => boolean;\n /**\n * The scope's root element (`null` before it mounts, on a server): only an element inside it\n * is one of its items (\"Nested composites\", 6).\n */\n root: () => HTMLElement | null;\n /** The item holding the tab stop (`tabindex=\"0\"`); `null` before the items are known. */\n tabStop: () => HTMLElement | null;\n /** Registers an item; `focusable`: it can take focus (not disabled, or focusable when disabled). */\n register: (element: HTMLElement, focusable: () => boolean) => () => void;\n /** An item took focus: it holds the tab stop now. */\n focused: (element: HTMLElement) => void;\n}\n\nexport const RovingKey: InjectionKey<RovingScope> = Symbol(\"RovingScope\");\n\n/**\n * The scope an element is in: `scope`, unless the element is outside the scope's root (a Toggle in\n * a popup that a Teleport renders from a Toolbar's item: `inject` passes through the Teleport, the\n * element is elsewhere), then `null`. While either element is unknown (a server render, before\n * the mount), the element is taken as inside, so the server's output does not change. Reactive\n * through the scope's `root`.\n */\nexport function scopeOfElement(\n scope: RovingScope | null,\n element: HTMLElement | null,\n): RovingScope | null {\n const root = scope?.root() ?? null;\n if (scope === null || element === null || root === null) {\n return scope;\n }\n return root.contains(element) ? scope : null;\n}\n\n/**\n * A scope that forwards every field to `current()`'s (a ToggleGroup's: the Toolbar's around it,\n * or its own once it is known to be outside the toolbar's element). Its `root` changes with\n * `current`, so its items register again with the scope they are now in.\n */\nexport function forwardingScope(current: () => RovingScope): RovingScope {\n return {\n orientation: () => current().orientation(),\n disabled: () => current().disabled(),\n root: () => current().root(),\n tabStop: () => current().tabStop(),\n register: (element, focusable) =>\n current().register(element, focusable),\n focused: (element) => current().focused(element),\n };\n}\n"],"mappings":";AAyBA,MAAa,YAAuC,OAAO,aAAa;;;;;;;;AASxE,SAAgB,eACZ,OACA,SACkB;CAClB,MAAM,OAAO,OAAO,KAAK,KAAK;CAC9B,IAAI,UAAU,QAAQ,YAAY,QAAQ,SAAS,MAC/C,OAAO;CAEX,OAAO,KAAK,SAAS,OAAO,IAAI,QAAQ;AAC5C;;;;;;AAOA,SAAgB,gBAAgB,SAAyC;CACrE,OAAO;EACH,mBAAmB,QAAQ,CAAC,CAAC,YAAY;EACzC,gBAAgB,QAAQ,CAAC,CAAC,SAAS;EACnC,YAAY,QAAQ,CAAC,CAAC,KAAK;EAC3B,eAAe,QAAQ,CAAC,CAAC,QAAQ;EACjC,WAAW,SAAS,cAChB,QAAQ,CAAC,CAAC,SAAS,SAAS,SAAS;EACzC,UAAU,YAAY,QAAQ,CAAC,CAAC,QAAQ,OAAO;CACnD;AACJ"}
|