@dpa-id-components/dpa-shared-components 18.0.4 → 18.2.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/README.md +19 -1
- package/dist/{activities-BbwWiVLr.js → activities-DBOTkOwa.js} +1 -1
- package/dist/{ai-BFVdTg_m.js → ai-DAmPady4.js} +1 -1
- package/dist/{alert-BwViN8RZ.js → alert-1FaMSnki.js} +1 -1
- package/dist/{alert-fill-BmVddBoF.js → alert-fill-C-9rdgVF.js} +1 -1
- package/dist/{alert-octagon-Du1XFZ53.js → alert-octagon-CjiI3gg8.js} +1 -1
- package/dist/{apps-C4H9zjLm.js → apps-VVZpHQKg.js} +1 -1
- package/dist/{archive-DXjJhFYK.js → archive-CYzjCtBh.js} +1 -1
- package/dist/{arrow-down-CtM3fKlO.js → arrow-down-DN5P6hUS.js} +1 -1
- package/dist/{arrow-left-DFdL0wI9.js → arrow-left-CByf6Dnx.js} +1 -1
- package/dist/{arrow-nav-left-CuQCQTCr.js → arrow-nav-left-B9zeLdYX.js} +1 -1
- package/dist/{arrow-nav-right-Brt5i_Yw.js → arrow-nav-right-qW3WaQKM.js} +1 -1
- package/dist/{arrow-right-Cp1rwJXG.js → arrow-right-byk5_E6K.js} +1 -1
- package/dist/{arrow-up-B9TSL6kL.js → arrow-up-_khnbh_s.js} +1 -1
- package/dist/{arrowhead-left-HG8C9_Zm.js → arrowhead-left-BFTpLxZU.js} +1 -1
- package/dist/{arrowhead-right-Br5XG148.js → arrowhead-right-C_J1DDYj.js} +1 -1
- package/dist/{arrowhead-top-xqXr5CO4.js → arrowhead-top-74kCivhA.js} +1 -1
- package/dist/{atmo-DCSxGFJp.js → atmo-Du3wq9P7.js} +1 -1
- package/dist/{audio-CMQihYDI.js → audio-CEIJb0L-.js} +1 -1
- package/dist/{audio-circled-Qo6GRiKj.js → audio-circled-Dqtx_b5e.js} +1 -1
- package/dist/{audio-filled-CEfg9Wc-.js → audio-filled-C08Q6H-0.js} +1 -1
- package/dist/{bag-PfT7w_tn.js → bag-rYIFpSaN.js} +1 -1
- package/dist/{bell-3FVAjfSe.js → bell-Din6yIAG.js} +1 -1
- package/dist/{bell-fill-ARImnk3u.js → bell-fill-BTMAbK8t.js} +1 -1
- package/dist/{book-MqLuW2Wt.js → book-DSa3OTwK.js} +1 -1
- package/dist/{bookmark-VZAkhaGt.js → bookmark-DM8511hw.js} +1 -1
- package/dist/{bookmark-fill-jSYoGzam.js → bookmark-fill-XV3vxuCG.js} +1 -1
- package/dist/{bookmark-outlined-B2S0D1no.js → bookmark-outlined-BaAh8lkL.js} +1 -1
- package/dist/{box-BWnkjo3S.js → box-BA4ZyqZ3.js} +1 -1
- package/dist/{bulb-DE5GZzPb.js → bulb-CHZL7RDw.js} +1 -1
- package/dist/{call-BvW3lV_e.js → call-DNOv41LP.js} +1 -1
- package/dist/{camera-pz3ZKqAK.js → camera-BzGMiidM.js} +1 -1
- package/dist/{check-D4CJpxFW.js → check-C_xtLnK-.js} +1 -1
- package/dist/{checklist-3lNRfKJx.js → checklist-DkUX0fBq.js} +1 -1
- package/dist/{checkmark-92_YFNHI.js → checkmark-CVb7nsJS.js} +1 -1
- package/dist/{checkmark-double-Dq1UhRPV.js → checkmark-double-Coj2Q_kE.js} +1 -1
- package/dist/{chevron-down-Bm9SI1LK.js → chevron-down-Cz2SBsMT.js} +1 -1
- package/dist/{chevron-left-CsDImGOu.js → chevron-left-Cu2dAwRo.js} +1 -1
- package/dist/{chevron-right-aUZRNunb.js → chevron-right-fzgN_lVM.js} +1 -1
- package/dist/{chevron-up-S9m_Pf4u.js → chevron-up-Bb4DZOk5.js} +1 -1
- package/dist/{clipboard-CiRQciLt.js → clipboard-CHkqTAOc.js} +1 -1
- package/dist/{clock-DkroIQt6.js → clock-LI02Q_hg.js} +1 -1
- package/dist/{close-BLAdH-OL.js → close-BgTkEAsg.js} +1 -1
- package/dist/{cloud-save-BvSpBb1a.js → cloud-save-Pi_VQbXb.js} +1 -1
- package/dist/{code-B9axM9y-.js → code-6iOOBKP2.js} +1 -1
- package/dist/{collapse-D0bdI_e2.js → collapse-BMbXljnc.js} +1 -1
- package/dist/{color-palette-BRFLv-4b.js → color-palette-Df1UIKz3.js} +1 -1
- package/dist/{comment-COt4Oxum.js → comment-DC6pd0vu.js} +1 -1
- package/dist/{comment-fill-Dg_e-UZq.js → comment-fill-DFBN_31W.js} +1 -1
- package/dist/components/UiAutocomplete/UiAutocomplete.vue.d.ts +2 -0
- package/dist/components/UiCheckbox/UiCheckbox.vue.d.ts +12 -0
- package/dist/components/UiInput/UiInput.vue.d.ts +14 -0
- package/dist/components/UiLabel/UiLabel.vue.d.ts +25 -0
- package/dist/components/UiMenu/UiMenu.vue.d.ts +1 -1
- package/dist/components/UiSearchInput/UiSearchInput.vue.d.ts +20 -2
- package/dist/components/UiSelect/UiSelect.vue.d.ts +54 -0
- package/dist/components/UiToggleButton/UiToggleButton.vue.d.ts +12 -2
- package/dist/components/index.d.ts +3 -1
- package/dist/{copy-Bmj3wtIm.js → copy-CYuDMCxU.js} +1 -1
- package/dist/{copy-link-C0h0PIRd.js → copy-link-By6fNaYZ.js} +1 -1
- package/dist/{delete-DJAERQbJ.js → delete-B1fOQbfG.js} +1 -1
- package/dist/{download-C52aOh6x.js → download-ByvmGkiG.js} +1 -1
- package/dist/{dpa-id-DW1Jp4QB.js → dpa-id-dar5SIuC.js} +1 -1
- package/dist/dpa-shared-components.js +32 -30
- package/dist/{edit-BHlIIDcs.js → edit-Cjr2lB-z.js} +1 -1
- package/dist/{edit-add-INmEZDrx.js → edit-add-DMpc7KKI.js} +1 -1
- package/dist/{eil-D5RxVTPc.js → eil-CSRuSyro.js} +1 -1
- package/dist/{emoji-hbkVElJc.js → emoji-DTgmc2XT.js} +1 -1
- package/dist/{emoji-add-Dt0cyMwM.js → emoji-add-CvtDx997.js} +1 -1
- package/dist/{envelope-C94rUx0x.js → envelope-6geJKAeo.js} +1 -1
- package/dist/{event-ADUpxBiN.js → event-XppRfECh.js} +1 -1
- package/dist/{expand-C_Nqkvw9.js → expand-CE9WixTh.js} +1 -1
- package/dist/{external-link-C-GC-l-g.js → external-link-BtrTzZw7.js} +1 -1
- package/dist/{file-D6aS-55P.js → file-a6UIDvQE.js} +1 -1
- package/dist/{file-pdf-CRcUtL3A.js → file-pdf-D4uv85W1.js} +1 -1
- package/dist/{filter-ABRcuJ_0.js → filter-Eqclvd3T.js} +1 -1
- package/dist/{filter-outline-CFuo1az3.js → filter-outline-J02IsLf8.js} +1 -1
- package/dist/{flag-BPc_mtYK.js → flag-BZvYlOs_.js} +1 -1
- package/dist/{flag-fill-ugjDl8am.js → flag-fill-Beilb5tV.js} +1 -1
- package/dist/{flag-filled-CSMtd-hr.js → flag-filled-CDj3PjMs.js} +1 -1
- package/dist/{flag-outline-Cw1aHxX7.js → flag-outline-37CyLzvj.js} +1 -1
- package/dist/{flags-B0qdS8TL.js → flags-CzOSidfF.js} +1 -1
- package/dist/{flash-DFdHjbK9.js → flash-qzaiXL9I.js} +1 -1
- package/dist/{folder-Btu1EcHk.js → folder-C_omBwGG.js} +1 -1
- package/dist/{folder-add-CXJuJFde.js → folder-add-COhVRS2Q.js} +1 -1
- package/dist/{folder-fill-BKCbcjAx.js → folder-fill-B-aCdPaA.js} +1 -1
- package/dist/{folder-filled-Bfx6W-C4.js → folder-filled-_8x33NHk.js} +1 -1
- package/dist/{gallery-BlaQ1fE-.js → gallery-oe0yfqV5.js} +1 -1
- package/dist/{graphic-circled-BOR22uSp.js → graphic-circled-BnndzZwG.js} +1 -1
- package/dist/{graphic-filled-atRaNeyj.js → graphic-filled-Cbdt-kUm.js} +1 -1
- package/dist/{graphic-DSw-8gHy.js → graphic-fxlN60OP.js} +1 -1
- package/dist/{graphics-LE15zCcH.js → graphics-wLB9veQ7.js} +1 -1
- package/dist/{grid-1-B7zIJuPX.js → grid-1-BWk09YvF.js} +1 -1
- package/dist/{grid-2-CvIXQAr8.js → grid-2-CNTSlFpK.js} +1 -1
- package/dist/{grid-3-Ccw0LWFQ.js → grid-3-DY7RH1L_.js} +1 -1
- package/dist/{grid-4-gm0M_j66.js → grid-4-C4cEcK8d.js} +1 -1
- package/dist/{grid-6-B7YoB9b2.js → grid-6-B2acS0TM.js} +1 -1
- package/dist/{grid-9-QG_tmIS_.js → grid-9-D-8Cnj06.js} +1 -1
- package/dist/{grid-masonry-9-ONwNQWPO.js → grid-masonry-9-BWOclryX.js} +1 -1
- package/dist/{grid-masonry-DuGAh8mH.js → grid-masonry-Chg78xeZ.js} +1 -1
- package/dist/{help-DYf7WQe7.js → help-DVcGAiEl.js} +1 -1
- package/dist/{home-pJFLQROc.js → home-DBDoZAwq.js} +1 -1
- package/dist/{image focus point-tP21-FA6.js → image focus point-C4Zu1H9e.js } +1 -1
- package/dist/{image-BZueRuGe.js → image-BdZoHCBT.js} +1 -1
- package/dist/{impact-high-GC2HRy72.js → impact-high-CpOr124M.js} +1 -1
- package/dist/{impact-low-BoBOwM8u.js → impact-low-DGoNqVOI.js} +1 -1
- package/dist/{impact-medium-BbUgtjDU.js → impact-medium-CA42I5Wh.js} +1 -1
- package/dist/{impact-very-high-Cpnddf8J.js → impact-very-high-CeKODZNo.js} +1 -1
- package/dist/{impact-very-low-C-6uquzx.js → impact-very-low-BHqqkPkY.js} +1 -1
- package/dist/{index-Dv7nm4aM.js → index-CbN3Dab1.js} +3988 -3824
- package/dist/{info-V40cTf5t.js → info-GC9Zyl_U.js} +1 -1
- package/dist/{info-fill-CrohdG84.js → info-fill-CxscS7Wv.js} +1 -1
- package/dist/{info-filled-BkqFdglQ.js → info-filled-CEtKeY49.js} +1 -1
- package/dist/{label-B80SS4P-.js → label-DSC6M5vX.js} +1 -1
- package/dist/{label-filled-BXIUgk-g.js → label-filled-BX9ZkQSL.js} +1 -1
- package/dist/{language-BEj4V8a8.js → language-CZlJF0LV.js} +1 -1
- package/dist/{latest-DMC05fKt.js → latest-B_tUj1dz.js} +1 -1
- package/dist/{lightbulb-401lIxAe.js → lightbulb-DKoz-2GM.js} +1 -1
- package/dist/{list-C0R3e0SU.js → list-ZDU_gl33.js} +1 -1
- package/dist/{list-search-B1N0Dfaz.js → list-search-DNIFAFF9.js} +1 -1
- package/dist/{lock-5fwuAGDf.js → lock-BDehh7Qa.js} +1 -1
- package/dist/{lock-filled-DxxhfAfn.js → lock-filled-CaqpGIY3.js} +1 -1
- package/dist/{mail-DEizanBY.js → mail-Li6s30ny.js} +1 -1
- package/dist/{map-DhVhFfUu.js → map-BFA3mwrv.js} +1 -1
- package/dist/{map-outline-DUZmZn-1.js → map-outline-UVcSdR9k.js} +1 -1
- package/dist/{menu-CwMwgwAw.js → menu-P8upw51k.js} +1 -1
- package/dist/{minus-CnTIHuR2.js → minus-uqvOFBsa.js} +1 -1
- package/dist/{more-horizontal-CghMRJVo.js → more-horizontal-C2NeWWb7.js} +1 -1
- package/dist/{more-vertical-C0XQRK0N.js → more-vertical-UXE3-Kcj.js} +1 -1
- package/dist/{move-D1ck-MZ3.js → move-DBmFjqMr.js} +1 -1
- package/dist/{move-up-down-BP7Od7Ac.js → move-up-down-B6s2I3Gq.js} +1 -1
- package/dist/{navigation-ClS6f-3Z.js → navigation-2RRLjeWC.js} +1 -1
- package/dist/{note-DbxrCI_5.js → note-BtadzFLH.js} +1 -1
- package/dist/{offline-C3OanK_f.js → offline-Dx_-5jCU.js} +1 -1
- package/dist/{package-ZYdpv1ge.js → package-FCPdj9W1.js} +1 -1
- package/dist/{paper-plane-s7xBbP39.js → paper-plane-BcWwAQnC.js} +1 -1
- package/dist/{paperplane-Dl2ilmua.js → paperplane-CfY0ciHn.js} +1 -1
- package/dist/{pause-DaPa9lEz.js → pause-BKrunCA6.js} +1 -1
- package/dist/{pause-circle-BNsPjIAv.js → pause-circle-C0dg0fio.js} +1 -1
- package/dist/{pdf-KYltIHyA.js → pdf-7kW_7ZGm.js} +1 -1
- package/dist/{pen-B4eAtxSi.js → pen-B2_Vo8Ma.js} +1 -1
- package/dist/{pen-check-kDkdMrOI.js → pen-check-CATNN6gh.js} +1 -1
- package/dist/{people-C70YATVw.js → people-C0M3WkBM.js} +1 -1
- package/dist/{phone-BPnung5r.js → phone-B-z7llyN.js} +1 -1
- package/dist/{picture-D7xlooNu.js → picture-9oFCjkJl.js} +1 -1
- package/dist/{picture-circled-DWnLMugI.js → picture-circled-B6O4zgCQ.js} +1 -1
- package/dist/{picture-filled-B6oZx2SL.js → picture-filled-B8seok1m.js} +1 -1
- package/dist/{picture-gallery-CUMpQqrP.js → picture-gallery-B9SgQjy0.js} +1 -1
- package/dist/{pin-drPa4hVL.js → pin-DYlgxPq4.js} +1 -1
- package/dist/{planning-CJkQTdBI.js → planning-CwZIOD2H.js} +1 -1
- package/dist/{play-CBYXQht-.js → play-2RwfqFNR.js} +1 -1
- package/dist/{play-circle-CI3C0c1w.js → play-circle-LzH5tap2.js} +1 -1
- package/dist/{play-fill-BBlVQZYO.js → play-fill-DgWnKLh2.js} +1 -1
- package/dist/{plus-DAzwGEQ1.js → plus-B7JCjMuk.js} +1 -1
- package/dist/{plus-circle-Dxl8Mg-W.js → plus-circle-yGd0Osz1.js} +1 -1
- package/dist/{print-C-cBMLcJ.js → print-B8ECw5Q4.js} +1 -1
- package/dist/{refresh-NxKYdx7S.js → refresh-drShnJsn.js} +1 -1
- package/dist/{reset-BtO5MoJe.js → reset-CHbOKLHT.js} +1 -1
- package/dist/{responsive-Cgs2b9oh.js → responsive-DLvrK1Ld.js} +1 -1
- package/dist/{rubix-thema-BvCOGmAA.js → rubix-thema-BBFBS2Zr.js} +1 -1
- package/dist/{save-BjGYc9Oz.js → save-jhkMPsjE.js} +1 -1
- package/dist/{saved-search-BOPAgxXE.js → saved-search-Cy7y__4d.js} +1 -1
- package/dist/{saved-search-fill-DcukcZ8I.js → saved-search-fill-JL8YyV0w.js} +1 -1
- package/dist/{search-Cy0g7KPu.js → search-h6A7HFAS.js} +1 -1
- package/dist/{settings-CJASe3MC.js → settings-SzH3_5G2.js} +1 -1
- package/dist/{share-tfBL6a2o.js → share-BMnrmHw7.js} +1 -1
- package/dist/{share-alternative-F5ZneLHK.js → share-alternative-BpoUOZqG.js} +1 -1
- package/dist/{sidebar-DUDBvBVF.js → sidebar-B9jfIsw5.js} +1 -1
- package/dist/{sidebar-fill-DUdq-Xn6.js → sidebar-fill-ntMhgXlw.js} +1 -1
- package/dist/{slack-DcICWZm4.js → slack-9hizBT3l.js} +1 -1
- package/dist/{slider-config-DQPsONUo.js → slider-config-Dh3W3dLr.js} +1 -1
- package/dist/{spellcheck-vp7alkKt.js → spellcheck-DcwX1LIM.js} +1 -1
- package/dist/{spinner-CrvwQeFB.js → spinner-D2PPLAp9.js} +1 -1
- package/dist/src/components/UiCheckbox/UiCheckbox.stories.ts +34 -1
- package/dist/src/components/UiCheckbox/UiCheckbox.vue +22 -13
- package/dist/src/components/UiColorPicker/README.md +5 -5
- package/dist/src/components/UiColorPicker/UiColorPicker.stories.ts +3 -2
- package/dist/src/components/UiInput/README.md +1 -0
- package/dist/src/components/UiInput/UiInput.spec.ts +1 -1
- package/dist/src/components/UiInput/UiInput.stories.ts +8 -5
- package/dist/src/components/UiInput/UiInput.vue +107 -48
- package/dist/src/components/UiLabel/README.md +33 -0
- package/dist/src/components/UiLabel/UiLabel.vue +16 -0
- package/dist/src/components/UiMenu/UiMenu.stories.ts +108 -83
- package/dist/src/components/UiMenu/UiMenu.vue +33 -25
- package/dist/src/components/UiRadioInputGroup/UiRadioInputGroup.vue +4 -3
- package/dist/src/components/UiSearchInput/README.md +28 -22
- package/dist/src/components/UiSearchInput/UiSearchInput.vue +31 -3
- package/dist/src/components/UiSelect/README.md +54 -0
- package/dist/src/components/UiSelect/UIiSelect.spec.ts +102 -0
- package/dist/src/components/UiSelect/UiSelect.stories.ts +94 -0
- package/dist/src/components/UiSelect/UiSelect.vue +76 -0
- package/dist/src/components/UiToggleButton/README.md +3 -3
- package/dist/src/components/UiToggleButton/UiToggleButton.vue +14 -3
- package/dist/src/components/index.ts +4 -0
- package/dist/{standard-view-D-qovy-w.js → standard-view-DWnO6327.js} +1 -1
- package/dist/{star-DkEtXygS.js → star-D34LaykK.js} +1 -1
- package/dist/{star-fill-B3UIgpwR.js → star-fill-BMnVo20i.js} +1 -1
- package/dist/{star-filled-CABVyxaj.js → star-filled-D12SGOY_.js} +1 -1
- package/dist/{stop-DVMTK2hL.js → stop-B5PxqQNX.js} +1 -1
- package/dist/{story-CxxjsD-k.js → story-Bw57frGC.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{sync-zMXY0V1C.js → sync-_OLmNnXY.js} +1 -1
- package/dist/{tasks-DpN7WQZz.js → tasks-C8BnoJ1P.js} +1 -1
- package/dist/{text-W_RbrRon.js → text-CNBgOowl.js} +1 -1
- package/dist/{text-circled-BHd0dMnB.js → text-circled-D-DhQaXL.js} +1 -1
- package/dist/{text-filled-jsyj0ExF.js → text-filled-Du8xx2Hg.js} +1 -1
- package/dist/{thumbs-down-C2ptPqZc.js → thumbs-down-CuOZ5bHK.js} +1 -1
- package/dist/{thumbs-up-BMCx64e0.js → thumbs-up-CsE9N-kZ.js} +1 -1
- package/dist/{thumbs-up-double-MTOYJ2Fl.js → thumbs-up-double-DxRJYR-h.js} +1 -1
- package/dist/{topic-9Otcj69g.js → topic-BjmgQJ5r.js} +1 -1
- package/dist/{union-B40CNI61.js → union-CxO_q5mx.js} +1 -1
- package/dist/{upload-cVhWF-6z.js → upload-BczPICAn.js} +1 -1
- package/dist/{video overlay-DkK7hhfX.js → video overlay-BqZg7hIx.js } +1 -1
- package/dist/{video-circled-PNxZBQ-s.js → video-circled-DtDZa-om.js} +1 -1
- package/dist/{video-filled-Bb-vqKj8.js → video-filled-ohcN-sgz.js} +1 -1
- package/dist/{video-DYgatdw7.js → video-rUgd4UxT.js} +1 -1
- package/dist/{video-rounded-D3l9Fqt-.js → video-rounded-Bh7wJXIS.js} +1 -1
- package/dist/{view-B2bcpRUS.js → view-CIA3pNnT.js} +1 -1
- package/dist/{view-off-CtEPSsc9.js → view-off-BorgK5mG.js} +1 -1
- package/dist/{volume-up-DE0_cC3L.js → volume-up-t_-3AzfX.js} +1 -1
- package/package.json +29 -20
- package/src/components/UiCheckbox/UiCheckbox.vue +22 -13
- package/src/components/UiColorPicker/README.md +5 -5
- package/src/components/UiInput/README.md +1 -0
- package/src/components/UiInput/UiInput.vue +107 -48
- package/src/components/UiLabel/README.md +33 -0
- package/src/components/UiLabel/UiLabel.vue +16 -0
- package/src/components/UiMenu/UiMenu.vue +33 -25
- package/src/components/UiRadioInputGroup/UiRadioInputGroup.vue +4 -3
- package/src/components/UiSearchInput/README.md +28 -22
- package/src/components/UiSearchInput/UiSearchInput.vue +31 -3
- package/src/components/UiSelect/README.md +54 -0
- package/src/components/UiSelect/UiSelect.vue +76 -0
- package/src/components/UiToggleButton/README.md +3 -3
- package/src/components/UiToggleButton/UiToggleButton.vue +14 -3
- package/src/components/index.ts +4 -0
|
@@ -3,7 +3,11 @@ import { action } from "storybook/actions";
|
|
|
3
3
|
import { computed, ref } from "vue";
|
|
4
4
|
|
|
5
5
|
import { icons } from "../UiIcon/icons.js";
|
|
6
|
-
import UiMenu
|
|
6
|
+
import UiMenu, {
|
|
7
|
+
type UiMenuGroupedOption,
|
|
8
|
+
type UiMenuOptionType,
|
|
9
|
+
type UiMenuSelectedOption,
|
|
10
|
+
} from "./UiMenu.vue";
|
|
7
11
|
|
|
8
12
|
const meta = {
|
|
9
13
|
title: "Ui/UiMenu",
|
|
@@ -111,7 +115,7 @@ type Story = StoryObj<typeof meta>;
|
|
|
111
115
|
|
|
112
116
|
const renderDefault: Story["render"] = (args) => ({
|
|
113
117
|
setup() {
|
|
114
|
-
const options = ref([
|
|
118
|
+
const options = ref<UiMenuOptionType<string>[]>([
|
|
115
119
|
{
|
|
116
120
|
label: "Option 1",
|
|
117
121
|
value: "value 1",
|
|
@@ -140,7 +144,7 @@ const renderDefault: Story["render"] = (args) => ({
|
|
|
140
144
|
});
|
|
141
145
|
const onClose = () => (isOpen.value = false);
|
|
142
146
|
const onOpen = () => (isOpen.value = true);
|
|
143
|
-
const onSelect = (e:
|
|
147
|
+
const onSelect = (e: UiMenuSelectedOption<string>) => {
|
|
144
148
|
filteredOptions.value[e.index].selected =
|
|
145
149
|
!filteredOptions.value[e.index].selected;
|
|
146
150
|
};
|
|
@@ -168,8 +172,19 @@ const renderDefault: Story["render"] = (args) => ({
|
|
|
168
172
|
};
|
|
169
173
|
},
|
|
170
174
|
components: { UiMenu },
|
|
171
|
-
template:
|
|
172
|
-
|
|
175
|
+
template: `
|
|
176
|
+
<UiMenu
|
|
177
|
+
v-bind="args"
|
|
178
|
+
:options="filteredOptions"
|
|
179
|
+
:is-open="isOpen"
|
|
180
|
+
:disabled-reset="resetIsDisabled"
|
|
181
|
+
@option-selected="(e)=> { onSelect(e); optionSelected(e); }"
|
|
182
|
+
@open="() => { onOpen(); open(); }"
|
|
183
|
+
@close="() => { onClose(); close(); }"
|
|
184
|
+
@input="(e) => { onInput(e); input(e); }"
|
|
185
|
+
@reset="() => { onReset(); reset(); }"
|
|
186
|
+
/>
|
|
187
|
+
`,
|
|
173
188
|
methods: {
|
|
174
189
|
open: action("open"),
|
|
175
190
|
close: action("close"),
|
|
@@ -182,40 +197,7 @@ const renderDefault: Story["render"] = (args) => ({
|
|
|
182
197
|
export const Default: Story = {
|
|
183
198
|
render: renderDefault,
|
|
184
199
|
};
|
|
185
|
-
export const WithBlankButton: Story = {
|
|
186
|
-
render: renderDefault,
|
|
187
|
-
args: {
|
|
188
|
-
buttonVariant: "blank",
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
export const WithCheckboxes: Story = {
|
|
192
|
-
render: renderDefault,
|
|
193
|
-
args: {
|
|
194
|
-
listVariant: "checkbox",
|
|
195
|
-
},
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export const WithCheckmark: Story = {
|
|
199
|
-
render: renderDefault,
|
|
200
|
-
args: {
|
|
201
|
-
listVariant: "selectable",
|
|
202
|
-
},
|
|
203
|
-
};
|
|
204
|
-
export const WithFullWidth: Story = {
|
|
205
|
-
render: renderDefault,
|
|
206
|
-
args: {
|
|
207
|
-
listVariant: "selectable",
|
|
208
|
-
listWidth: "full",
|
|
209
|
-
},
|
|
210
|
-
};
|
|
211
200
|
|
|
212
|
-
export const WithMaxWidth: Story = {
|
|
213
|
-
render: renderDefault,
|
|
214
|
-
args: {
|
|
215
|
-
listVariant: "selectable",
|
|
216
|
-
listWidth: "max",
|
|
217
|
-
},
|
|
218
|
-
};
|
|
219
201
|
export const WithResetAndSearch: Story = {
|
|
220
202
|
render: renderDefault,
|
|
221
203
|
args: {
|
|
@@ -232,54 +214,85 @@ export const WithResetAndSearch: Story = {
|
|
|
232
214
|
};
|
|
233
215
|
|
|
234
216
|
export const WithGroupedOptions: Story = {
|
|
217
|
+
args: {
|
|
218
|
+
hasResetOption: true,
|
|
219
|
+
hasSearch: true,
|
|
220
|
+
resetLabel: "Zurücksetzen",
|
|
221
|
+
searchPlaceholder: "Suchen",
|
|
222
|
+
buttonVariant: "transparent-rounded",
|
|
223
|
+
listVariant: "checkbox",
|
|
224
|
+
checkboxSize: "small",
|
|
225
|
+
defaultTitle: "Optionen",
|
|
226
|
+
hasAutoFocus: true,
|
|
227
|
+
},
|
|
235
228
|
render: (args) => ({
|
|
236
229
|
setup() {
|
|
237
|
-
const groupedOptions = ref([
|
|
230
|
+
const groupedOptions = ref<UiMenuGroupedOption<string>[]>([
|
|
238
231
|
{
|
|
239
232
|
options: [
|
|
240
233
|
{
|
|
241
|
-
label: "
|
|
242
|
-
value: "
|
|
234
|
+
label: "Four Tet",
|
|
235
|
+
value: "four-tet",
|
|
243
236
|
selected: true,
|
|
244
237
|
},
|
|
245
238
|
{
|
|
246
|
-
label: "
|
|
247
|
-
value: "
|
|
239
|
+
label: "Floating Points",
|
|
240
|
+
value: "floating-points",
|
|
248
241
|
selected: false,
|
|
249
242
|
},
|
|
250
243
|
{
|
|
251
|
-
label: "
|
|
252
|
-
value: "
|
|
244
|
+
label: "Burial",
|
|
245
|
+
value: "burial",
|
|
253
246
|
selected: false,
|
|
254
247
|
},
|
|
255
248
|
{
|
|
256
|
-
label: "
|
|
257
|
-
value: "
|
|
249
|
+
label: "Daphni",
|
|
250
|
+
value: "daphni",
|
|
258
251
|
selected: false,
|
|
259
252
|
},
|
|
260
253
|
],
|
|
261
254
|
},
|
|
262
255
|
{
|
|
263
|
-
groupLabel: "
|
|
256
|
+
groupLabel: "Aliases",
|
|
264
257
|
options: [
|
|
265
258
|
{
|
|
266
|
-
label: "
|
|
267
|
-
value: "
|
|
259
|
+
label: "KH",
|
|
260
|
+
value: "alias-1",
|
|
268
261
|
selected: true,
|
|
269
262
|
},
|
|
270
263
|
{
|
|
271
|
-
label: "
|
|
272
|
-
value: "
|
|
264
|
+
label: "△▃△▓",
|
|
265
|
+
value: "alias-2",
|
|
266
|
+
selected: false,
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
label: "⣎⡇ꉺლ༽இ•̛)ྀ◞ ༎ຶ ༽ৣৢ؞ৢ؞ؖ ꉺლ",
|
|
270
|
+
value: "alias-3",
|
|
271
|
+
selected: false,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
label: "00110100 01010100",
|
|
275
|
+
value: "alias-4",
|
|
276
|
+
selected: false,
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
label: "4T Recordings",
|
|
280
|
+
value: "alias-5",
|
|
273
281
|
selected: false,
|
|
274
282
|
},
|
|
275
283
|
{
|
|
276
|
-
label: "
|
|
277
|
-
value: "
|
|
284
|
+
label: "4TLRPercussions",
|
|
285
|
+
value: "alias-6",
|
|
278
286
|
selected: false,
|
|
279
287
|
},
|
|
280
288
|
{
|
|
281
|
-
label: "
|
|
282
|
-
value: "
|
|
289
|
+
label: "00000ooooo",
|
|
290
|
+
value: "alias-7",
|
|
291
|
+
selected: false,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
label: "Joshua Falken",
|
|
295
|
+
value: "alias-8",
|
|
283
296
|
selected: false,
|
|
284
297
|
},
|
|
285
298
|
],
|
|
@@ -295,7 +308,7 @@ export const WithGroupedOptions: Story = {
|
|
|
295
308
|
});
|
|
296
309
|
const onClose = () => (isOpen.value = false);
|
|
297
310
|
const onOpen = () => (isOpen.value = true);
|
|
298
|
-
const onSelect = (e:
|
|
311
|
+
const onSelect = (e: UiMenuSelectedOption<string>) => {
|
|
299
312
|
filteredOptions.value.forEach(({ options }, groupIndex) => {
|
|
300
313
|
options.forEach(({ value }, optionsIndex) => {
|
|
301
314
|
if (value === e.value) {
|
|
@@ -340,16 +353,16 @@ export const WithGroupedOptions: Story = {
|
|
|
340
353
|
components: { UiMenu },
|
|
341
354
|
template: `
|
|
342
355
|
<UiMenu
|
|
343
|
-
v-bind=
|
|
356
|
+
v-bind="args"
|
|
344
357
|
:grouped-options="filteredOptions"
|
|
345
358
|
:is-open="isOpen"
|
|
346
359
|
has-search
|
|
347
|
-
:disabled-reset=
|
|
348
|
-
@option-selected=
|
|
349
|
-
@open=
|
|
350
|
-
@close=
|
|
351
|
-
@input=
|
|
352
|
-
@reset=
|
|
360
|
+
:disabled-reset="resetIsDisabled"
|
|
361
|
+
@option-selected="(e)=> { onSelect(e); optionSelected(e); }"
|
|
362
|
+
@open="() => { onOpen(); open(); }"
|
|
363
|
+
@close="() => { onClose(); close(); }"
|
|
364
|
+
@input="(e) => { onInput(e); input(e); }"
|
|
365
|
+
@reset="() => { onReset(); reset(); }"
|
|
353
366
|
/>
|
|
354
367
|
`,
|
|
355
368
|
methods: {
|
|
@@ -360,22 +373,11 @@ export const WithGroupedOptions: Story = {
|
|
|
360
373
|
reset: action("reset"),
|
|
361
374
|
},
|
|
362
375
|
}),
|
|
363
|
-
args: {
|
|
364
|
-
hasResetOption: true,
|
|
365
|
-
hasSearch: true,
|
|
366
|
-
resetLabel: "Zurücksetzen",
|
|
367
|
-
searchPlaceholder: "Suchen",
|
|
368
|
-
buttonVariant: "transparent-rounded",
|
|
369
|
-
listVariant: "checkbox",
|
|
370
|
-
checkboxSize: "small",
|
|
371
|
-
defaultTitle: "Optionen",
|
|
372
|
-
hasAutoFocus: true,
|
|
373
|
-
},
|
|
374
376
|
};
|
|
375
377
|
|
|
376
378
|
const renderWithImage: Story["render"] = (args) => ({
|
|
377
379
|
setup() {
|
|
378
|
-
const options = ref([
|
|
380
|
+
const options = ref<UiMenuOptionType<string>[]>([
|
|
379
381
|
{
|
|
380
382
|
label: "T-Online",
|
|
381
383
|
value: "t-online",
|
|
@@ -398,7 +400,7 @@ const renderWithImage: Story["render"] = (args) => ({
|
|
|
398
400
|
});
|
|
399
401
|
const onClose = () => (isOpen.value = false);
|
|
400
402
|
const onOpen = () => (isOpen.value = true);
|
|
401
|
-
const onSelect = (e:
|
|
403
|
+
const onSelect = (e: UiMenuSelectedOption<string>) => {
|
|
402
404
|
filteredOptions.value[e.index].selected =
|
|
403
405
|
!filteredOptions.value[e.index].selected;
|
|
404
406
|
};
|
|
@@ -426,8 +428,19 @@ const renderWithImage: Story["render"] = (args) => ({
|
|
|
426
428
|
};
|
|
427
429
|
},
|
|
428
430
|
components: { UiMenu },
|
|
429
|
-
template:
|
|
430
|
-
|
|
431
|
+
template: `
|
|
432
|
+
<UiMenu
|
|
433
|
+
v-bind="args"
|
|
434
|
+
:options="filteredOptions"
|
|
435
|
+
:is-open="isOpen"
|
|
436
|
+
:disabled-reset="resetIsDisabled"
|
|
437
|
+
@option-selected="(e)=> { onSelect(e); optionSelected(e); }"
|
|
438
|
+
@open="() => { onOpen(); open(); }"
|
|
439
|
+
@close="() => { onClose(); close(); }"
|
|
440
|
+
@input="(e) => { onInput(e); input(e); }"
|
|
441
|
+
@reset="() => { onReset(); reset(); }"
|
|
442
|
+
/>
|
|
443
|
+
`,
|
|
431
444
|
methods: {
|
|
432
445
|
open: action("open"),
|
|
433
446
|
close: action("close"),
|
|
@@ -447,7 +460,7 @@ export const WithImages: Story = {
|
|
|
447
460
|
|
|
448
461
|
const renderDefaultAnimated: Story["render"] = (args) => ({
|
|
449
462
|
setup() {
|
|
450
|
-
const options = ref([
|
|
463
|
+
const options = ref<UiMenuOptionType<string>[]>([
|
|
451
464
|
{
|
|
452
465
|
label: "Option 1",
|
|
453
466
|
value: "value 1",
|
|
@@ -476,7 +489,7 @@ const renderDefaultAnimated: Story["render"] = (args) => ({
|
|
|
476
489
|
});
|
|
477
490
|
const onClose = () => (isOpen.value = false);
|
|
478
491
|
const onOpen = () => (isOpen.value = true);
|
|
479
|
-
const onSelect = (e:
|
|
492
|
+
const onSelect = (e: UiMenuSelectedOption<string>) => {
|
|
480
493
|
filteredOptions.value[e.index].selected =
|
|
481
494
|
!filteredOptions.value[e.index].selected;
|
|
482
495
|
};
|
|
@@ -504,8 +517,20 @@ const renderDefaultAnimated: Story["render"] = (args) => ({
|
|
|
504
517
|
};
|
|
505
518
|
},
|
|
506
519
|
components: { UiMenu },
|
|
507
|
-
template:
|
|
508
|
-
|
|
520
|
+
template: `
|
|
521
|
+
<UiMenu
|
|
522
|
+
v-bind="args"
|
|
523
|
+
:options="filteredOptions"
|
|
524
|
+
:is-open="isOpen"
|
|
525
|
+
:animate="true"
|
|
526
|
+
:disabled-reset="resetIsDisabled"
|
|
527
|
+
@option-selected="(e)=> { onSelect(e); optionSelected(e); }"
|
|
528
|
+
@open="() => { onOpen(); open(); }"
|
|
529
|
+
@close="() => { onClose(); close(); }"
|
|
530
|
+
@input="(e) => { onInput(e); input(e); }"
|
|
531
|
+
@reset="() => { onReset(); reset(); }"
|
|
532
|
+
/>
|
|
533
|
+
`,
|
|
509
534
|
methods: {
|
|
510
535
|
open: action("open"),
|
|
511
536
|
close: action("close"),
|
|
@@ -74,7 +74,12 @@
|
|
|
74
74
|
:grouped-options="groupedOptions"
|
|
75
75
|
>
|
|
76
76
|
<ul
|
|
77
|
-
v-if="
|
|
77
|
+
v-if="
|
|
78
|
+
Array.isArray(groupedOptions) &&
|
|
79
|
+
groupedOptions.some(
|
|
80
|
+
(groupedOption) => groupedOption.options.length > 0,
|
|
81
|
+
)
|
|
82
|
+
"
|
|
78
83
|
class="max-h-80 overflow-y-auto"
|
|
79
84
|
tabindex="0"
|
|
80
85
|
>
|
|
@@ -82,29 +87,32 @@
|
|
|
82
87
|
v-for="groupedOption in groupedOptions"
|
|
83
88
|
:key="groupedOption.groupLabel"
|
|
84
89
|
>
|
|
85
|
-
<
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
90
|
+
<template v-if="groupedOption.options.length > 0">
|
|
91
|
+
<li
|
|
92
|
+
v-if="groupedOption.groupLabel"
|
|
93
|
+
class="flex h-6 items-center border-t bg-gray-100 px-4 text-xs font-semibold tracking-wider text-gray-700 uppercase first:border-t-0"
|
|
94
|
+
>
|
|
95
|
+
{{ groupedOption.groupLabel }}
|
|
96
|
+
</li>
|
|
97
|
+
|
|
98
|
+
<UiListItem
|
|
99
|
+
v-for="(option, index) in groupedOption.options"
|
|
100
|
+
:key="`${groupedOption.groupLabel}-menuOptions-${index}`"
|
|
101
|
+
:selected="option.selected"
|
|
102
|
+
:selectable="listVariant === 'selectable'"
|
|
103
|
+
:is-checked="option.selected"
|
|
104
|
+
:check-box-menu="listVariant === 'checkbox'"
|
|
105
|
+
:icon-size="iconSize"
|
|
106
|
+
:image-shape="imageShape"
|
|
107
|
+
:image-src="option.imageSrc"
|
|
108
|
+
:checkbox-size="checkboxSize"
|
|
109
|
+
:check-box-color="checkboxColor"
|
|
110
|
+
class="hover:bg-gray-100 focus:bg-gray-300"
|
|
111
|
+
:data-testid="`menu-option-button-${index}`"
|
|
112
|
+
@list-item-click="selectOption(option)"
|
|
113
|
+
>{{ option.label }}
|
|
114
|
+
</UiListItem>
|
|
115
|
+
</template>
|
|
108
116
|
</template>
|
|
109
117
|
</ul>
|
|
110
118
|
<ul v-else class="max-h-60 overflow-y-auto" tabindex="0">
|
|
@@ -184,7 +192,7 @@ export type UiMenuSelectedOption<Value = unknown> = UiMenuOptionType<Value> & {
|
|
|
184
192
|
};
|
|
185
193
|
|
|
186
194
|
export type UiMenuGroupedOption<Value = unknown> = {
|
|
187
|
-
groupLabel
|
|
195
|
+
groupLabel?: string;
|
|
188
196
|
options: UiMenuOptionType<Value>[];
|
|
189
197
|
};
|
|
190
198
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
]"
|
|
10
10
|
>
|
|
11
11
|
<li v-for="option in internalOptions" :key="option.value">
|
|
12
|
-
<
|
|
12
|
+
<UiLabel class="flex">
|
|
13
13
|
<input
|
|
14
14
|
v-model="pickedOption"
|
|
15
15
|
:name="groupName"
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
/>
|
|
23
23
|
<span
|
|
24
24
|
class="ml-1 cursor-pointer"
|
|
25
|
-
:class="[labelClass, disabled ? 'text-gray-500' : '
|
|
25
|
+
:class="[labelClass, disabled ? 'text-gray-500' : '']"
|
|
26
26
|
>
|
|
27
27
|
{{ option.label }}
|
|
28
28
|
</span>
|
|
29
|
-
</
|
|
29
|
+
</UiLabel>
|
|
30
30
|
</li>
|
|
31
31
|
</ul>
|
|
32
32
|
</template>
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
import { computed } from "vue";
|
|
36
36
|
|
|
37
37
|
import { cn } from "../../utils/cn.js";
|
|
38
|
+
import UiLabel from "../UiLabel/UiLabel.vue";
|
|
38
39
|
|
|
39
40
|
export interface UiRadioInputGroupOption<T> {
|
|
40
41
|
value: T;
|
|
@@ -2,36 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
## Usage
|
|
4
4
|
|
|
5
|
-
```
|
|
5
|
+
```vue
|
|
6
6
|
<template>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
<UiSearchInput
|
|
8
|
+
:has-add-entry-option="true"
|
|
9
|
+
:model-value="internalValue"
|
|
10
|
+
label="This is a Label"
|
|
11
|
+
placeholder="This is a placeholder"
|
|
12
|
+
@update:model-value="handleInput"
|
|
13
|
+
@handle-keypress="handleKeypress"
|
|
14
|
+
@blur="handleBlur"
|
|
15
|
+
/>
|
|
16
16
|
</template>
|
|
17
17
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
|
-
|
|
19
|
+
import { UiSearchInput } from "./UiSearchInput.vue";
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const internalValue = ref([""]);
|
|
22
|
+
function handleInput(newValue) {
|
|
23
|
+
internalValue.value = newValue;
|
|
24
|
+
}
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
26
|
+
function handleKeypress({ event, value }) {
|
|
27
|
+
if (event.key === 'Enter') {
|
|
28
|
+
// do something when enter key is pressed
|
|
30
29
|
}
|
|
30
|
+
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
function handleBlur(value) {
|
|
33
|
+
// value is the same as from handleInput
|
|
34
|
+
}
|
|
35
35
|
</script>
|
|
36
36
|
```
|
|
37
37
|
|
|
@@ -43,6 +43,12 @@
|
|
|
43
43
|
| `label` | `string` | `""` | Sets Label for the input field |
|
|
44
44
|
| `placeholder` | `string` | `Default placeholder` | Sets Placeholder attribute for the input |
|
|
45
45
|
|
|
46
|
+
### Slots
|
|
47
|
+
|
|
48
|
+
| Name | Description |
|
|
49
|
+
|-----------|---------------|
|
|
50
|
+
| `default` | Label content |
|
|
51
|
+
|
|
46
52
|
### Events
|
|
47
53
|
|
|
48
54
|
| Name | Type | Description |
|
|
@@ -10,7 +10,11 @@
|
|
|
10
10
|
v-if="hasLabel"
|
|
11
11
|
class="col-span-1 flex items-center pr-5 text-sm lg:py-2"
|
|
12
12
|
>
|
|
13
|
-
<
|
|
13
|
+
<UiLabel :for="id" class="font-medium">
|
|
14
|
+
<slot>
|
|
15
|
+
{{ label }}
|
|
16
|
+
</slot>
|
|
17
|
+
</UiLabel>
|
|
14
18
|
<slot name="tooltip"></slot>
|
|
15
19
|
</div>
|
|
16
20
|
|
|
@@ -21,6 +25,7 @@
|
|
|
21
25
|
>
|
|
22
26
|
<div class="flex items-center">
|
|
23
27
|
<input
|
|
28
|
+
:id="id"
|
|
24
29
|
ref="inputs"
|
|
25
30
|
:value="internalValue[index]"
|
|
26
31
|
type="text"
|
|
@@ -56,18 +61,33 @@
|
|
|
56
61
|
</template>
|
|
57
62
|
|
|
58
63
|
<script setup lang="ts">
|
|
59
|
-
import {
|
|
64
|
+
import { v4 as uuidv4 } from "uuid";
|
|
65
|
+
import { computed, nextTick, onBeforeUpdate, ref, watchEffect } from "vue";
|
|
60
66
|
|
|
61
67
|
import UiIconButton from "../UiIconButton/UiIconButton.vue";
|
|
68
|
+
import UiLabel from "../UiLabel/UiLabel.vue";
|
|
69
|
+
|
|
70
|
+
const slots = defineSlots<{
|
|
71
|
+
/**
|
|
72
|
+
* Label content.
|
|
73
|
+
*/
|
|
74
|
+
default?: () => any;
|
|
75
|
+
/**
|
|
76
|
+
* Tooltip content.
|
|
77
|
+
*/
|
|
78
|
+
tooltip?: () => any;
|
|
79
|
+
}>();
|
|
62
80
|
|
|
63
81
|
const props = withDefaults(
|
|
64
82
|
defineProps<{
|
|
83
|
+
id?: string;
|
|
65
84
|
hasAddEntryOption?: boolean;
|
|
66
85
|
label?: string;
|
|
67
86
|
modelValue: string[];
|
|
68
87
|
placeholder?: string;
|
|
69
88
|
}>(),
|
|
70
89
|
{
|
|
90
|
+
id: undefined,
|
|
71
91
|
hasAddEntryOption: false,
|
|
72
92
|
placeholder: "Default placeholder",
|
|
73
93
|
label: "",
|
|
@@ -89,6 +109,8 @@ const addRow = async () => {
|
|
|
89
109
|
}
|
|
90
110
|
};
|
|
91
111
|
|
|
112
|
+
const id = ref(props.id ?? `id-${uuidv4()}`);
|
|
113
|
+
|
|
92
114
|
const canAddRow = computed(() => {
|
|
93
115
|
return (
|
|
94
116
|
internalValue.value[internalValue.value.length - 1].length > 0 &&
|
|
@@ -131,9 +153,15 @@ function handleBlur() {
|
|
|
131
153
|
const isLastIndex = (index: number) => {
|
|
132
154
|
return index === internalValue.value.length - 1;
|
|
133
155
|
};
|
|
156
|
+
const hasDefaultSlot = ref(false);
|
|
157
|
+
|
|
158
|
+
// Manually tracks whether the “errors” slot is in use since `useSlots()` isn't reactive and so can't be correctly used inside computed reactive state.
|
|
159
|
+
onBeforeUpdate(() => {
|
|
160
|
+
hasDefaultSlot.value = "default" in slots;
|
|
161
|
+
});
|
|
134
162
|
|
|
135
163
|
const hasLabel = computed(() => {
|
|
136
|
-
return props.label.length > 0;
|
|
164
|
+
return hasDefaultSlot.value || props.label.length > 0;
|
|
137
165
|
});
|
|
138
166
|
|
|
139
167
|
const inputWrapperClass = computed(() => {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# UiSelect
|
|
2
|
+
|
|
3
|
+
Wraps the native `select` element.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
|
|
9
|
+
<UiSelect
|
|
10
|
+
v-model="appearance"
|
|
11
|
+
name="appearance"
|
|
12
|
+
required
|
|
13
|
+
>
|
|
14
|
+
Appearance
|
|
15
|
+
|
|
16
|
+
<template #options>
|
|
17
|
+
<option
|
|
18
|
+
v-for="appearance in appearances"
|
|
19
|
+
:key="appearance.id"
|
|
20
|
+
:value="appearance.id"
|
|
21
|
+
>
|
|
22
|
+
{{ appearance.name }}
|
|
23
|
+
</option>
|
|
24
|
+
</template>
|
|
25
|
+
</UiSelect>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Props
|
|
29
|
+
|
|
30
|
+
**Note**: This component binds all non-prop attributes (apart from `class`) on its principal element (the `select` element) instead of the root element. This allows you to add arbitrary HTML attributes (and event listeners) on the principal element without them being explicitly supported by the component.
|
|
31
|
+
|
|
32
|
+
### modelValue
|
|
33
|
+
|
|
34
|
+
- **Description**: Sets the `value` IDL attribute of the underlying `select` element. Allows using `v-model` on `UiSelect`.
|
|
35
|
+
- **Type**: `string`
|
|
36
|
+
- **Required**: No
|
|
37
|
+
- **Default**: `undefined`
|
|
38
|
+
|
|
39
|
+
## Slots
|
|
40
|
+
|
|
41
|
+
### default
|
|
42
|
+
|
|
43
|
+
The label content.
|
|
44
|
+
|
|
45
|
+
### options
|
|
46
|
+
|
|
47
|
+
Receives arbitrarily many `option` elements (or anything that is allowed in a native `select` element, see [select: Technical summary](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/select#technical_summary)).
|
|
48
|
+
|
|
49
|
+
## Events
|
|
50
|
+
|
|
51
|
+
### update:modelValue
|
|
52
|
+
|
|
53
|
+
- **Description**: Fired when `select` fires `input`. Allows using `v-model` on `UiSelect`.
|
|
54
|
+
- **Type**: `string`
|