@cldemo/ui-kit 1.0.9 → 1.0.11
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/COMPONENT_CATALOG.md +2 -2
- package/buildLibs/all/index.cjs +2 -5
- package/buildLibs/all/index.css +1 -0
- package/buildLibs/all/index.js +82 -6
- package/buildLibs/mobile/index.cjs +2 -5
- package/buildLibs/mobile/index.css +1 -0
- package/buildLibs/mobile/index.js +50 -6
- package/buildLibs/utils/Element/ClBadge.d.ts +3 -0
- package/buildLibs/utils/Element/ClBreadcrumb.d.ts +3 -0
- package/buildLibs/utils/Element/ClButton.d.ts +3 -0
- package/buildLibs/utils/Element/ClCallout.d.ts +3 -0
- package/buildLibs/utils/Element/ClCard.d.ts +3 -0
- package/buildLibs/utils/Element/ClCardColor.d.ts +3 -0
- package/buildLibs/utils/Element/ClCheckbox.d.ts +3 -0
- package/buildLibs/utils/Element/ClCheckboxOne.cjs +2 -0
- package/buildLibs/utils/Element/ClCheckboxOne.cjs.map +1 -0
- package/buildLibs/utils/Element/ClCheckboxOne.d.ts +3 -0
- package/buildLibs/utils/Element/ClCheckboxOne.js +5 -0
- package/buildLibs/utils/Element/ClCheckboxOne.js.map +1 -0
- package/buildLibs/utils/Element/ClClipboard.d.ts +3 -0
- package/buildLibs/utils/Element/ClCollapse.d.ts +3 -0
- package/buildLibs/utils/Element/ClCountDown.d.ts +3 -0
- package/buildLibs/utils/Element/ClCountUp.d.ts +3 -0
- package/buildLibs/utils/Element/ClCropper.d.ts +3 -0
- package/buildLibs/utils/Element/ClDarg.d.ts +3 -0
- package/buildLibs/utils/Element/ClDivider.d.ts +3 -0
- package/buildLibs/utils/Element/ClEllipsis.d.ts +3 -0
- package/buildLibs/utils/Element/ClEmpty.d.ts +3 -0
- package/buildLibs/utils/Element/ClForm.d.ts +3 -0
- package/buildLibs/utils/Element/ClFormGroup.d.ts +3 -0
- package/buildLibs/utils/Element/ClFormValidate.cjs +2 -0
- package/buildLibs/utils/Element/ClFormValidate.cjs.map +1 -0
- package/buildLibs/utils/Element/ClFormValidate.d.ts +3 -0
- package/buildLibs/utils/Element/ClFormValidate.js +5 -0
- package/buildLibs/utils/Element/ClFormValidate.js.map +1 -0
- package/buildLibs/utils/Element/ClIconFont.d.ts +3 -0
- package/buildLibs/utils/Element/ClImage.cjs +1 -1
- package/buildLibs/utils/Element/ClImage.d.ts +3 -0
- package/buildLibs/utils/Element/ClImage.js +1 -1
- package/buildLibs/utils/Element/ClInput.d.ts +3 -0
- package/buildLibs/utils/Element/ClInputCaptcha.d.ts +3 -0
- package/buildLibs/utils/Element/ClInputNumber.d.ts +3 -0
- package/buildLibs/utils/Element/ClInputNumberStepper.d.ts +3 -0
- package/buildLibs/utils/Element/ClInputPassword.d.ts +3 -0
- package/buildLibs/utils/Element/ClInputSearch.d.ts +3 -0
- package/buildLibs/utils/Element/ClInputTextarea.d.ts +3 -0
- package/buildLibs/utils/Element/ClLink.d.ts +3 -0
- package/buildLibs/utils/Element/ClLoad.d.ts +3 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.cjs +2 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.cjs.map +1 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.css +1 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.d.ts +3 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.js +45 -0
- package/buildLibs/utils/Element/ClLoadFullCenter.js.map +1 -0
- package/buildLibs/utils/Element/ClLoadIng.cjs +2 -0
- package/buildLibs/utils/Element/ClLoadIng.cjs.map +1 -0
- package/buildLibs/utils/Element/ClLoadIng.d.ts +3 -0
- package/buildLibs/utils/Element/ClLoadIng.js +5 -0
- package/buildLibs/utils/Element/ClLoadIng.js.map +1 -0
- package/buildLibs/utils/Element/ClLoadScreen.d.ts +3 -0
- package/buildLibs/utils/Element/ClLoadWarp.cjs +2 -0
- package/buildLibs/utils/Element/ClLoadWarp.cjs.map +1 -0
- package/buildLibs/utils/Element/ClLoadWarp.css +1 -0
- package/buildLibs/utils/Element/ClLoadWarp.d.ts +3 -0
- package/buildLibs/utils/Element/ClLoadWarp.js +53 -0
- package/buildLibs/utils/Element/ClLoadWarp.js.map +1 -0
- package/buildLibs/utils/Element/ClModal.d.ts +3 -0
- package/buildLibs/utils/Element/ClOverlay.d.ts +3 -0
- package/buildLibs/utils/Element/ClProgress.d.ts +3 -0
- package/buildLibs/utils/Element/ClRadio.d.ts +3 -0
- package/buildLibs/utils/Element/ClRadioOne.cjs +2 -0
- package/buildLibs/utils/Element/ClRadioOne.cjs.map +1 -0
- package/buildLibs/utils/Element/ClRadioOne.d.ts +3 -0
- package/buildLibs/utils/Element/ClRadioOne.js +5 -0
- package/buildLibs/utils/Element/ClRadioOne.js.map +1 -0
- package/buildLibs/utils/Element/ClSlider.d.ts +3 -0
- package/buildLibs/utils/Element/ClSwitchery.d.ts +3 -0
- package/buildLibs/utils/Element/ClTags.d.ts +3 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.cjs +2 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.cjs.map +1 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.d.ts +3 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.js +5 -0
- package/buildLibs/utils/Element/ClTransitionSlideupdown.js.map +1 -0
- package/buildLibs/utils/Element/ClWaterfall.d.ts +3 -0
- package/buildLibs/utils/Element/ClWaterfallImage.cjs +2 -0
- package/buildLibs/utils/Element/ClWaterfallImage.cjs.map +1 -0
- package/buildLibs/utils/Element/ClWaterfallImage.css +1 -0
- package/buildLibs/utils/Element/ClWaterfallImage.d.ts +3 -0
- package/buildLibs/utils/Element/ClWaterfallImage.js +48 -0
- package/buildLibs/utils/Element/ClWaterfallImage.js.map +1 -0
- package/buildLibs/utils/Mobile/ClActionBar.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClActionSheet.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClAreaM.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClBackTop.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClBanner.cjs +1 -1
- package/buildLibs/utils/Mobile/ClBanner.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClBanner.js +1 -1
- package/buildLibs/utils/Mobile/ClCalendarM.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClCell.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClCellSwipe.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClCodeLegendM.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuM.cjs +1 -1
- package/buildLibs/utils/Mobile/ClDropdownMenuM.cjs.map +1 -1
- package/buildLibs/utils/Mobile/ClDropdownMenuM.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuM.js +13 -12
- package/buildLibs/utils/Mobile/ClDropdownMenuM.js.map +1 -1
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.cjs +2 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.cjs.map +1 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.js +160 -0
- package/buildLibs/utils/Mobile/ClDropdownMenuMItem.js.map +1 -0
- package/buildLibs/utils/Mobile/ClFloatingBubble.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClFloatingPanel.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClGrid.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClHighlightM.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClIndexBar.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClInputOtp.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClNavBar.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClNoticeBar.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClNotifyM.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClNumberKeyboard.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClPicker.cjs +1 -1
- package/buildLibs/utils/Mobile/ClPicker.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClPicker.js +1 -1
- package/buildLibs/utils/Mobile/ClPickerCascader.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClPickerDate.cjs +1 -1
- package/buildLibs/utils/Mobile/ClPickerDate.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClPickerDate.js +1 -1
- package/buildLibs/utils/Mobile/ClPickerTime.cjs +1 -1
- package/buildLibs/utils/Mobile/ClPickerTime.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClPickerTime.js +1 -1
- package/buildLibs/utils/Mobile/ClPopup.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClPullToRefresh.cjs +1 -1
- package/buildLibs/utils/Mobile/ClPullToRefresh.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClPullToRefresh.js +1 -1
- package/buildLibs/utils/Mobile/ClRate.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClScrollCard.cjs +1 -1
- package/buildLibs/utils/Mobile/ClScrollCard.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClScrollCard.js +1 -1
- package/buildLibs/utils/Mobile/ClShareSheet.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClSidebar.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClSidebarSelect.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClSignature.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClSteps.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClSwipe.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClTabM.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClTabbar.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClToast.d.ts +3 -0
- package/buildLibs/utils/Mobile/ClWatermark.d.ts +3 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BPgunUb2.js → Index.vue_vue_type_script_setup_true_lang-6KT1IHDu.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BPgunUb2.js.map → Index.vue_vue_type_script_setup_true_lang-6KT1IHDu.js.map} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-B-yZtW91.js +71 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-B-yZtW91.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-gtDsWrhd.js → Index.vue_vue_type_script_setup_true_lang-BDPkmgGP.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-gtDsWrhd.js.map → Index.vue_vue_type_script_setup_true_lang-BDPkmgGP.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D_IwyxiV.js → Index.vue_vue_type_script_setup_true_lang-Bnjm8vi-.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D_IwyxiV.js.map → Index.vue_vue_type_script_setup_true_lang-Bnjm8vi-.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Cpb9rd-y.js → Index.vue_vue_type_script_setup_true_lang-Bs8FGIQa.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Cpb9rd-y.js.map → Index.vue_vue_type_script_setup_true_lang-Bs8FGIQa.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-hm75HKxP.js → Index.vue_vue_type_script_setup_true_lang-C7FRB7fV.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-hm75HKxP.js.map → Index.vue_vue_type_script_setup_true_lang-C7FRB7fV.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Xe4BacqD.js → Index.vue_vue_type_script_setup_true_lang-CFzimlB_.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Xe4BacqD.js.map → Index.vue_vue_type_script_setup_true_lang-CFzimlB_.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Bp39ENoP.js → Index.vue_vue_type_script_setup_true_lang-CGeXNRtY.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Bp39ENoP.js.map → Index.vue_vue_type_script_setup_true_lang-CGeXNRtY.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-4NloX3Qk.js → Index.vue_vue_type_script_setup_true_lang-CSV9UWJx.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-4NloX3Qk.js.map → Index.vue_vue_type_script_setup_true_lang-CSV9UWJx.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CRJ3-pTH.js → Index.vue_vue_type_script_setup_true_lang-ChE1tZwr.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CRJ3-pTH.js.map → Index.vue_vue_type_script_setup_true_lang-ChE1tZwr.js.map} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CjgtxJ6a.js +2 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CjgtxJ6a.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-N1GhNa1r.js → Index.vue_vue_type_script_setup_true_lang-CpuYxzDD.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-N1GhNa1r.js.map → Index.vue_vue_type_script_setup_true_lang-CpuYxzDD.js.map} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CumTbPny.js +2 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CumTbPny.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-NdqbsOrG.js → Index.vue_vue_type_script_setup_true_lang-CvF_iIQS.js} +2 -2
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-NdqbsOrG.js.map → Index.vue_vue_type_script_setup_true_lang-CvF_iIQS.js.map} +1 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CxVAWr6w.js +266 -0
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CxVAWr6w.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DgMvq-RQ.js → Index.vue_vue_type_script_setup_true_lang-DFKjhT_C.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DgMvq-RQ.js.map → Index.vue_vue_type_script_setup_true_lang-DFKjhT_C.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D22m4oiN.js → Index.vue_vue_type_script_setup_true_lang-DdWmaT86.js} +2 -2
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-D22m4oiN.js.map → Index.vue_vue_type_script_setup_true_lang-DdWmaT86.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BtoovAWs.js → Index.vue_vue_type_script_setup_true_lang-DxHfO8TH.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BtoovAWs.js.map → Index.vue_vue_type_script_setup_true_lang-DxHfO8TH.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CW63TdvW.js → Index.vue_vue_type_script_setup_true_lang-HwprdMv4.js} +2 -2
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-CW63TdvW.js.map → Index.vue_vue_type_script_setup_true_lang-HwprdMv4.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BLp0owhs.js → Index.vue_vue_type_script_setup_true_lang-IGgTDykL.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BLp0owhs.js.map → Index.vue_vue_type_script_setup_true_lang-IGgTDykL.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BKr3_J68.js → Index.vue_vue_type_script_setup_true_lang-Lwl-M8kR.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BKr3_J68.js.map → Index.vue_vue_type_script_setup_true_lang-Lwl-M8kR.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Dxb_K2w0.js → Index.vue_vue_type_script_setup_true_lang-gsnpWNek.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Dxb_K2w0.js.map → Index.vue_vue_type_script_setup_true_lang-gsnpWNek.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-EGKo8cIw.js → Index.vue_vue_type_script_setup_true_lang-huUkL0wY.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-EGKo8cIw.js.map → Index.vue_vue_type_script_setup_true_lang-huUkL0wY.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BFSRH9yz.js → Index.vue_vue_type_script_setup_true_lang-in1ZSapu.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BFSRH9yz.js.map → Index.vue_vue_type_script_setup_true_lang-in1ZSapu.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C8HQVerr.js → Index.vue_vue_type_script_setup_true_lang-r6RBdV4y.js} +2 -2
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C8HQVerr.js.map → Index.vue_vue_type_script_setup_true_lang-r6RBdV4y.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DvzXfKhj.js → Index.vue_vue_type_script_setup_true_lang-tTHdssVu.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-DvzXfKhj.js.map → Index.vue_vue_type_script_setup_true_lang-tTHdssVu.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BxxIDGfR.js → Index.vue_vue_type_script_setup_true_lang-tjRv0vNR.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-BxxIDGfR.js.map → Index.vue_vue_type_script_setup_true_lang-tjRv0vNR.js.map} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Bk2WD0GS.js → Index.vue_vue_type_script_setup_true_lang-yahz6Ej5.js} +1 -1
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-Bk2WD0GS.js.map → Index.vue_vue_type_script_setup_true_lang-yahz6Ej5.js.map} +1 -1
- package/buildLibs/utils/Shared/Index24.css +1 -1
- package/buildLibs/utils/Shared/Index25.css +1 -1
- package/buildLibs/utils/Shared/Index26.css +1 -1
- package/buildLibs/utils/Shared/Index27.css +1 -1
- package/buildLibs/utils/Shared/Index28.css +1 -1
- package/buildLibs/utils/Shared/Index29.css +1 -1
- package/buildLibs/utils/Shared/Index30.css +1 -1
- package/buildLibs/utils/Shared/Index31.css +1 -1
- package/buildLibs/utils/Shared/Index32.css +1 -1
- package/buildLibs/utils/Shared/Index33.css +1 -1
- package/buildLibs/utils/Shared/Index34.css +1 -1
- package/buildLibs/utils/Shared/Index35.css +1 -1
- package/buildLibs/utils/Shared/Index36.css +1 -1
- package/buildLibs/utils/Shared/Index37.css +1 -0
- package/buildLibs/utils/Shared/One.vue_vue_type_script_setup_true_lang-CR1t8XZl.js +2 -0
- package/buildLibs/utils/Shared/One.vue_vue_type_script_setup_true_lang-CR1t8XZl.js.map +1 -0
- package/buildLibs/utils/Shared/One.vue_vue_type_script_setup_true_lang-oBeFlRzi.js +148 -0
- package/buildLibs/utils/Shared/One.vue_vue_type_script_setup_true_lang-oBeFlRzi.js.map +1 -0
- package/buildLibs/utils/Shared/Validate.vue_vue_type_script_setup_true_lang-Bquk40ES.js +406 -0
- package/buildLibs/utils/Shared/Validate.vue_vue_type_script_setup_true_lang-Bquk40ES.js.map +1 -0
- package/buildLibs/utils/Shared/Validate.vue_vue_type_script_setup_true_lang-CAmKX5pn.js +2 -0
- package/buildLibs/utils/Shared/Validate.vue_vue_type_script_setup_true_lang-CAmKX5pn.js.map +1 -0
- package/buildLibs/utils/Shared/{Index.vue_vue_type_script_setup_true_lang-C9mOHVoE.js → use-CKNkvmW4.js} +78 -141
- package/buildLibs/utils/Shared/use-CKNkvmW4.js.map +1 -0
- package/buildLibs/utils/Shared/use-D0Yu2Dbn.js +2 -0
- package/buildLibs/utils/Shared/use-D0Yu2Dbn.js.map +1 -0
- package/buildLibs/utils/Web/ClAnchorNav.d.ts +3 -0
- package/buildLibs/utils/Web/ClCalendar.d.ts +3 -0
- package/buildLibs/utils/Web/ClCodeLegend.d.ts +3 -0
- package/buildLibs/utils/Web/ClColorpicker.d.ts +3 -0
- package/buildLibs/utils/Web/ClCropperPreview.cjs +1 -1
- package/buildLibs/utils/Web/ClCropperPreview.d.ts +3 -0
- package/buildLibs/utils/Web/ClCropperPreview.js +2 -2
- package/buildLibs/utils/Web/ClDatetime.cjs +1 -1
- package/buildLibs/utils/Web/ClDatetime.d.ts +3 -0
- package/buildLibs/utils/Web/ClDatetime.js +1 -1
- package/buildLibs/utils/Web/ClDropdownMenu.d.ts +3 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.cjs +2 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.cjs.map +1 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.css +1 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.d.ts +3 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.js +72 -0
- package/buildLibs/utils/Web/ClDropdownMenuItem.js.map +1 -0
- package/buildLibs/utils/Web/ClDropdownPopup.d.ts +3 -0
- package/buildLibs/utils/Web/ClEcharts.cjs +1 -1
- package/buildLibs/utils/Web/ClEcharts.d.ts +3 -0
- package/buildLibs/utils/Web/ClEcharts.js +1 -1
- package/buildLibs/utils/Web/ClEchartsLineAxisTag.cjs +1 -1
- package/buildLibs/utils/Web/ClEchartsLineAxisTag.d.ts +3 -0
- package/buildLibs/utils/Web/ClEchartsLineAxisTag.js +1 -1
- package/buildLibs/utils/Web/ClFileUpload.cjs +1 -1
- package/buildLibs/utils/Web/ClFileUpload.d.ts +3 -0
- package/buildLibs/utils/Web/ClFileUpload.js +1 -1
- package/buildLibs/utils/Web/ClFramePhone.d.ts +3 -0
- package/buildLibs/utils/Web/ClInputTag.cjs +1 -1
- package/buildLibs/utils/Web/ClInputTag.d.ts +3 -0
- package/buildLibs/utils/Web/ClInputTag.js +1 -1
- package/buildLibs/utils/Web/ClPaginate.cjs +1 -1
- package/buildLibs/utils/Web/ClPaginate.d.ts +3 -0
- package/buildLibs/utils/Web/ClPaginate.js +1 -1
- package/buildLibs/utils/Web/ClPortlet.d.ts +3 -0
- package/buildLibs/utils/Web/ClPreviewExample.cjs +1 -1
- package/buildLibs/utils/Web/ClPreviewExample.d.ts +3 -0
- package/buildLibs/utils/Web/ClPreviewExample.js +1 -1
- package/buildLibs/utils/Web/ClScrollXFence.cjs +1 -1
- package/buildLibs/utils/Web/ClScrollXFence.d.ts +3 -0
- package/buildLibs/utils/Web/ClScrollXFence.js +1 -1
- package/buildLibs/utils/Web/ClSelect.cjs +1 -1
- package/buildLibs/utils/Web/ClSelect.d.ts +3 -0
- package/buildLibs/utils/Web/ClSelect.js +1 -1
- package/buildLibs/utils/Web/ClSelectCascade.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectCascade.d.ts +3 -0
- package/buildLibs/utils/Web/ClSelectCascade.js +1 -1
- package/buildLibs/utils/Web/ClSelectTag.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectTag.d.ts +3 -0
- package/buildLibs/utils/Web/ClSelectTag.js +1 -1
- package/buildLibs/utils/Web/ClSelectTree.cjs +1 -1
- package/buildLibs/utils/Web/ClSelectTree.d.ts +3 -0
- package/buildLibs/utils/Web/ClSelectTree.js +1 -1
- package/buildLibs/utils/Web/ClSelectmove.d.ts +3 -0
- package/buildLibs/utils/Web/ClSidemenu.d.ts +3 -0
- package/buildLibs/utils/Web/ClTable.cjs +1 -1
- package/buildLibs/utils/Web/ClTable.cjs.map +1 -1
- package/buildLibs/utils/Web/ClTable.d.ts +3 -0
- package/buildLibs/utils/Web/ClTable.js +1081 -1218
- package/buildLibs/utils/Web/ClTable.js.map +1 -1
- package/buildLibs/utils/Web/ClTableEdit.d.ts +3 -0
- package/buildLibs/utils/Web/ClTableSimple.d.ts +3 -0
- package/buildLibs/utils/Web/ClTabs.cjs +1 -1
- package/buildLibs/utils/Web/ClTabs.d.ts +3 -0
- package/buildLibs/utils/Web/ClTabs.js +1 -1
- package/buildLibs/utils/Web/ClTree.cjs +1 -1
- package/buildLibs/utils/Web/ClTree.d.ts +3 -0
- package/buildLibs/utils/Web/ClTree.js +1 -1
- package/buildLibs/utils/Web/ClWeekhour.d.ts +3 -0
- package/buildLibs/utils/Web/ClXeditable.cjs +1 -1
- package/buildLibs/utils/Web/ClXeditable.cjs.map +1 -1
- package/buildLibs/utils/Web/ClXeditable.d.ts +3 -0
- package/buildLibs/utils/Web/ClXeditable.js +33 -32
- package/buildLibs/utils/Web/ClXeditable.js.map +1 -1
- package/buildLibs/web/index.cjs +2 -5
- package/buildLibs/web/index.css +1 -0
- package/buildLibs/web/index.js +76 -6
- package/docs/components/Element/Input.md +1 -1
- package/docs/components/Element/InputNumber.md +1 -1
- package/package.json +21 -8
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-B-yxIx8F.js +0 -663
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-B-yxIx8F.js.map +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-C9mOHVoE.js.map +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CcOk4kyd.js +0 -2
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-CcOk4kyd.js.map +0 -1
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DtZgYjSl.js +0 -2
- package/buildLibs/utils/Shared/Index.vue_vue_type_script_setup_true_lang-DtZgYjSl.js.map +0 -1
- package/buildLibs/utils/Shared/Video-BV0YLYT2.js +0 -114
- package/buildLibs/utils/Shared/Video-BV0YLYT2.js.map +0 -1
- package/buildLibs/utils/Shared/Video-c3jHJSxl.js +0 -2
- package/buildLibs/utils/Shared/Video-c3jHJSxl.js.map +0 -1
- package/buildLibs/utils/Shared/Video.css +0 -1
- package/buildLibs/utils/Web/ClDropdownMenuM.css +0 -1
- package/buildLibs/utils/Web/ClPreview.cjs +0 -2
- package/buildLibs/utils/Web/ClPreview.cjs.map +0 -1
- package/buildLibs/utils/Web/ClPreview.css +0 -1
- package/buildLibs/utils/Web/ClPreview.js +0 -353
- package/buildLibs/utils/Web/ClPreview.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),
|
|
1
|
+
"use strict";const e=require("vue"),u=require("../Shared/base-C2QOJBgB.js"),N=require("../Shared/index-DAgtltwJ.js");;/* empty css */const S=["id"],z={class:"dropdownmenum-bar"},M=e.defineComponent({name:"ClDropdownMenuM",__name:"Index",props:{id:String,className:String,activeColor:{type:String,default:"var(--cl-primary)"},direction:{type:String,default:"down",validator:c=>["down","up"].includes(c)},zIndex:{type:Number,default:2e3},duration:{type:Number,default:200},isOverlay:{type:Boolean,default:!0},isCloseOnClickOverlay:{type:Boolean,default:!0},isCloseOnClickOutside:{type:Boolean,default:!0}},emits:["onOpen","onClose","onOpened","onClosed","onClickOverlay"],setup(c,{expose:f,emit:y}){const t=c,s=y,O=t.id,l=e.ref(-1);let d=0;const a=e.ref(null),m=e.computed(()=>t.direction==="up"?"up":"down"),k=e.computed(()=>t.activeColor),p=e.computed(()=>u.CommonBase.isFinite(t.duration)&&t.duration>0?t.duration:200),v=e.computed(()=>{const o=Number(t.zIndex);return u.CommonBase.isFinite(o)&&o>0?Math.round(o):2e3}),g=e.computed(()=>t.isOverlay&&l.value!==-1),w=e.computed(()=>{const o={"panel-dropdownmenum":!0,"dropdownmenum--up":m.value==="up"};return u.CommonBase.getJsonMerge(o,N.CommonElement.getClassNameJson(t.className))}),I=e.computed(()=>({zIndex:v.value-1})),r=o=>{const n=l.value!==-1;l.value=o,o!==-1?n||s("onOpen"):n&&s("onClose")},x=()=>{s("onClickOverlay"),t.isCloseOnClickOverlay&&r(-1)},C=o=>{l.value===o?r(-1):r(o)},B=o=>{r(o)},E=()=>{const o=d;return d++,o};e.provide("$DropdownMenuMTop",{activeIndex:l,direction:m,activeColor:k,zIndex:v,duration:p,registerItem:E,toggleItem:C,setActiveIndex:B});const i=o=>{if(!t.isCloseOnClickOutside||l.value===-1)return;const n=o.target??null;a.value&&a.value.contains(n)||r(-1)};return e.onMounted(()=>{document.addEventListener("click",i)}),e.onActivated(()=>{document.addEventListener("click",i)}),e.onDeactivated(()=>{document.removeEventListener("click",i)}),e.onBeforeUnmount(()=>{document.removeEventListener("click",i)}),f({toggle:o=>{C(o)},open:o=>{r(o)},close:()=>{r(-1)}}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:a,id:e.unref(O),class:e.normalizeClass(w.value)},[e.createElementVNode("div",z,[e.renderSlot(o.$slots,"default")]),e.createVNode(e.Transition,{name:"dropdownmenum-fade",duration:p.value,onAfterEnter:n[0]||(n[0]=_=>s("onOpened")),onAfterLeave:n[1]||(n[1]=_=>s("onClosed"))},{default:e.withCtx(()=>[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dropdownmenum-overlay",style:e.normalizeStyle(I.value),onClick:x},null,4)):e.createCommentVNode("",!0)]),_:1},8,["duration"])],10,S))}});module.exports=M;
|
|
2
2
|
//# sourceMappingURL=ClDropdownMenuM.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClDropdownMenuM.cjs","sources":["../../../src/libs/Mobile/DropdownMenuM/Index.vue"],"sourcesContent":["<template>\n <div\n ref=\"rootEl\"\n :id=\"elId\"\n :class=\"clsParent\"\n >\n <div class=\"dropdownmenum-bar\">\n <slot></slot>\n </div>\n <Transition\n name=\"dropdownmenum-fade\"\n :duration=\"optDuration\"\n @after-enter=\"emit('onOpened')\"\n @after-leave=\"emit('onClosed')\"\n >\n <div\n v-if=\"optIsShowOverlay\"\n class=\"dropdownmenum-overlay\"\n :style=\"styOverlay\"\n @click=\"onClickOverlay\"\n ></div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onActivated, onBeforeUnmount, onDeactivated, onMounted, provide, ref } from 'vue';\nimport CommonBase from '../../Common/base';\nimport CommonElement from '../../Common/Element/index';\nimport './Index.css';\n\n// 容器向下提供的上下文(配置项为 computed,保证响应式:父 props 变更后子项同步)\nexport interface DropdownMenuMTop {\n activeIndex: import('vue').Ref<number>;\n direction: import('vue').ComputedRef<string>;\n activeColor: import('vue').ComputedRef<string>;\n zIndex: import('vue').ComputedRef<number>;\n duration: import('vue').ComputedRef<number>;\n registerItem: () => number;\n toggleItem: (index: number) => void;\n setActiveIndex: (index: number) => void;\n}\n\ndefineOptions({ name: 'ClDropdownMenuM' });\n\nconst props = defineProps({\n id: String, // desc: 组件实例唯一标识,用于多实例场景下 DOM 查询限定\n className: String, // desc: 自定义CSS类名\n activeColor: {\n type: String,\n default: 'var(--cl-primary)', // desc: 菜单标题和选项的选中态颜色\n },\n direction: {\n type: String,\n default: 'down', // desc: 菜单展开方向 | enum: down, up\n validator: (v: string) => ['down', 'up'].includes(v),\n },\n zIndex: {\n type: Number,\n default: 2000, // desc: 菜单栏 z-index 层级\n },\n duration: {\n type: Number,\n default: 200, // desc: 菜单展开/收起动画时长(ms)\n },\n isOverlay: {\n type: Boolean,\n default: true, // desc: 是否显示遮罩层\n },\n isCloseOnClickOverlay: {\n type: Boolean,\n default: true, // desc: 点击遮罩层后是否关闭菜单\n },\n isCloseOnClickOutside: {\n type: Boolean,\n default: true, // desc: 是否在点击外部元素后关闭菜单\n },\n});\n\n// emit\nconst emit = defineEmits<{\n (e: 'onOpen'): void; // desc: 打开菜单时触发\n (e: 'onClose'): void; // desc: 关闭菜单时触发\n (e: 'onOpened'): void; // desc: 打开动画结束后触发\n (e: 'onClosed'): void; // desc: 关闭动画结束后触发\n (e: 'onClickOverlay'): void; // desc: 点击遮罩层时触发\n}>();\n\n// slots: default(菜单项列表)\n\nconst elId = props.id; // || `dropdownmenum-${CommonBase.getRandom(8)}`\n\n// 当前展开的菜单项索引,-1 表示全部收起\nconst activeIndex = ref(-1);\n// 子项注册序号(每个 DropdownMenuItemM 挂载时递增取号)\nlet _itemSeq = 0;\n// 根元素(点击外部关闭判定)\nconst rootEl = ref<HTMLElement | null>(null);\n\n// computed\nconst optDirection = computed(() => (props.direction === 'up' ? 'up' : 'down'));\n\nconst optActiveColor = computed(() => props.activeColor);\n\nconst optDuration = computed(() =>\n CommonBase.isFinite(props.duration) && props.duration > 0 ? props.duration : 200,\n);\n\nconst optZIndex = computed(() => {\n const z = Number(props.zIndex);\n return CommonBase.isFinite(z) && z > 0 ? Math.round(z) : 2000;\n});\n\nconst optIsShowOverlay = computed(() => props.isOverlay && activeIndex.value !== -1);\n\nconst clsParent = computed(() => {\n const clsTemp: Record<string, boolean> = {\n 'panel-dropdownmenum': true,\n 'dropdownmenum--up': optDirection.value === 'up',\n };\n return CommonBase.getJsonMerge(clsTemp, CommonElement.getClassNameJson(props.className));\n});\n\nconst styOverlay = computed(() => ({\n zIndex: optZIndex.value - 1,\n}));\n\n// 内部方法\nconst _setActive = (index: number) => {\n const wasOpen = activeIndex.value !== -1;\n activeIndex.value = index;\n if (index !== -1) {\n if (!wasOpen) {\n emit('onOpen');\n }\n } else {\n if (wasOpen) {\n emit('onClose');\n }\n }\n};\n\n// 事件方法\nconst onClickOverlay = () => {\n emit('onClickOverlay');\n if (props.isCloseOnClickOverlay) {\n _setActive(-1);\n }\n};\n\n// 对外开放:切换/设置当前展开项\nconst toggleItem = (index: number) => {\n if (activeIndex.value === index) {\n _setActive(-1);\n } else {\n _setActive(index);\n }\n};\n\nconst setActiveIndex = (index: number) => {\n _setActive(index);\n};\n\n// 子项注册:返回该子项在容器内的序号(index)\nconst registerItem = (): number => {\n const index = _itemSeq;\n _itemSeq++;\n return index;\n};\n\n// provide(配置项传 computed,父 props 变更子项实时同步)\nprovide<DropdownMenuMTop>('$DropdownMenuMTop', {\n activeIndex,\n direction: optDirection,\n activeColor: optActiveColor,\n zIndex: optZIndex,\n duration: optDuration,\n registerItem,\n toggleItem,\n setActiveIndex,\n});\n\n// 点击外部关闭(isCloseOnClickOutside)\nconst _onDocumentClick = (event: MouseEvent) => {\n if (!props.isCloseOnClickOutside) return;\n if (activeIndex.value === -1) return;\n const el = (event.target as Node | null) ?? null;\n if (rootEl.value && rootEl.value.contains(el)) return;\n _setActive(-1);\n};\n\n// 生命周期(keep-alive 缓存时暂停/恢复监听)\nonMounted(() => {\n document.addEventListener('click', _onDocumentClick);\n});\nonActivated(() => {\n document.addEventListener('click', _onDocumentClick);\n});\nonDeactivated(() => {\n document.removeEventListener('click', _onDocumentClick);\n});\nonBeforeUnmount(() => {\n document.removeEventListener('click', _onDocumentClick);\n});\n\n// 开放给外部使用的方法(Vant DropdownMenu 同款 API)\nconst toggle = (index: number) => {\n toggleItem(index);\n};\n\nconst open = (index: number) => {\n _setActive(index);\n};\n\nconst close = () => {\n _setActive(-1);\n};\n\n// 导出类型定义(在 defineExpose 之前)\nexport interface ClDropdownMenuMExpose {\n toggle: (index: number) => void;\n open: (index: number) => void;\n close: () => void;\n}\n\n// defineExpose(必须放在最后)\ndefineExpose({\n toggle,\n open,\n close,\n});\n</script>\n"],"names":["props","__props","emit","__emit","elId","activeIndex","ref","_itemSeq","rootEl","optDirection","computed","optActiveColor","optDuration","CommonBase","optZIndex","z","optIsShowOverlay","clsParent","clsTemp","CommonElement","styOverlay","_setActive","index","wasOpen","onClickOverlay","toggleItem","setActiveIndex","registerItem","provide","_onDocumentClick","event","el","onMounted","onActivated","onDeactivated","onBeforeUnmount","__expose","_createElementBlock","_unref","_createElementVNode","_hoisted_2","_renderSlot","_ctx","_createVNode","_Transition"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClDropdownMenuM.cjs","sources":["../../../src/libs/Mobile/DropdownMenuM/Index.vue"],"sourcesContent":["<template>\n <div\n ref=\"rootEl\"\n :id=\"elId\"\n :class=\"clsParent\"\n >\n <div class=\"dropdownmenum-bar\">\n <slot></slot>\n </div>\n <Transition\n name=\"dropdownmenum-fade\"\n :duration=\"optDuration\"\n @after-enter=\"emit('onOpened')\"\n @after-leave=\"emit('onClosed')\"\n >\n <div\n v-if=\"optIsShowOverlay\"\n class=\"dropdownmenum-overlay\"\n :style=\"styOverlay\"\n @click=\"onClickOverlay\"\n ></div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onActivated, onBeforeUnmount, onDeactivated, onMounted, provide, ref } from 'vue';\nimport CommonBase from '../../Common/base';\nimport CommonElement from '../../Common/Element/index';\nimport './Index.css';\n\n// 容器向下提供的上下文(配置项为 computed,保证响应式:父 props 变更后子项同步)\nexport interface DropdownMenuMTop {\n activeIndex: import('vue').Ref<number>;\n direction: import('vue').ComputedRef<string>;\n activeColor: import('vue').ComputedRef<string>;\n zIndex: import('vue').ComputedRef<number>;\n duration: import('vue').ComputedRef<number>;\n registerItem: () => number;\n toggleItem: (index: number) => void;\n setActiveIndex: (index: number) => void;\n}\n\ndefineOptions({ name: 'ClDropdownMenuM' });\n\nconst props = defineProps({\n id: String, // desc: 组件实例唯一标识,用于多实例场景下 DOM 查询限定\n className: String, // desc: 自定义CSS类名\n activeColor: {\n type: String,\n default: 'var(--cl-primary)', // desc: 菜单标题和选项的选中态颜色\n },\n direction: {\n type: String,\n default: 'down', // desc: 菜单展开方向 | enum: down, up\n validator: (v: string) => ['down', 'up'].includes(v),\n },\n zIndex: {\n type: Number,\n default: 2000, // desc: 菜单栏 z-index 层级\n },\n duration: {\n type: Number,\n default: 200, // desc: 菜单展开/收起动画时长(ms)\n },\n isOverlay: {\n type: Boolean,\n default: true, // desc: 是否显示遮罩层\n },\n isCloseOnClickOverlay: {\n type: Boolean,\n default: true, // desc: 点击遮罩层后是否关闭菜单\n },\n isCloseOnClickOutside: {\n type: Boolean,\n default: true, // desc: 是否在点击外部元素后关闭菜单\n },\n});\n\n// emit\nconst emit = defineEmits<{\n (e: 'onOpen'): void; // desc: 打开菜单时触发\n (e: 'onClose'): void; // desc: 关闭菜单时触发\n (e: 'onOpened'): void; // desc: 打开动画结束后触发\n (e: 'onClosed'): void; // desc: 关闭动画结束后触发\n (e: 'onClickOverlay'): void; // desc: 点击遮罩层时触发\n}>();\n\n// slots: default(菜单项列表)\n\nconst elId = props.id; // || `dropdownmenum-${CommonBase.getRandom(8)}`\n\n// 当前展开的菜单项索引,-1 表示全部收起\nconst activeIndex = ref(-1);\n// 子项注册序号(每个 DropdownMenuItemM 挂载时递增取号)\nlet _itemSeq = 0;\n// 根元素(点击外部关闭判定)\nconst rootEl = ref<HTMLElement | null>(null);\n\n// computed\nconst optDirection = computed(() => (props.direction === 'up' ? 'up' : 'down'));\n\nconst optActiveColor = computed(() => props.activeColor);\n\nconst optDuration = computed(() =>\n CommonBase.isFinite(props.duration) && props.duration > 0 ? props.duration : 200,\n);\n\nconst optZIndex = computed(() => {\n const z = Number(props.zIndex);\n return CommonBase.isFinite(z) && z > 0 ? Math.round(z) : 2000;\n});\n\nconst optIsShowOverlay = computed(() => props.isOverlay && activeIndex.value !== -1);\n\nconst clsParent = computed(() => {\n const clsTemp: Record<string, boolean> = {\n 'panel-dropdownmenum': true,\n 'dropdownmenum--up': optDirection.value === 'up',\n };\n return CommonBase.getJsonMerge(clsTemp, CommonElement.getClassNameJson(props.className));\n});\n\nconst styOverlay = computed(() => ({\n zIndex: optZIndex.value - 1,\n}));\n\n// 内部方法\nconst _setActive = (index: number) => {\n const wasOpen = activeIndex.value !== -1;\n activeIndex.value = index;\n if (index !== -1) {\n if (!wasOpen) {\n emit('onOpen');\n }\n } else {\n if (wasOpen) {\n emit('onClose');\n }\n }\n};\n\n// 事件方法\nconst onClickOverlay = () => {\n emit('onClickOverlay');\n if (props.isCloseOnClickOverlay) {\n _setActive(-1);\n }\n};\n\n// 对外开放:切换/设置当前展开项\nconst toggleItem = (index: number) => {\n if (activeIndex.value === index) {\n _setActive(-1);\n } else {\n _setActive(index);\n }\n};\n\nconst setActiveIndex = (index: number) => {\n _setActive(index);\n};\n\n// 子项注册:返回该子项在容器内的序号(index)\nconst registerItem = (): number => {\n const index = _itemSeq;\n _itemSeq++;\n return index;\n};\n\n// provide(配置项传 computed,父 props 变更子项实时同步)\nprovide<DropdownMenuMTop>('$DropdownMenuMTop', {\n activeIndex,\n direction: optDirection,\n activeColor: optActiveColor,\n zIndex: optZIndex,\n duration: optDuration,\n registerItem,\n toggleItem,\n setActiveIndex,\n});\n\n// 点击外部关闭(isCloseOnClickOutside)\nconst _onDocumentClick = (event: MouseEvent) => {\n if (!props.isCloseOnClickOutside) return;\n if (activeIndex.value === -1) return;\n const el = (event.target as Node | null) ?? null;\n if (rootEl.value && rootEl.value.contains(el)) return;\n _setActive(-1);\n};\n\n// 生命周期(keep-alive 缓存时暂停/恢复监听)\nonMounted(() => {\n document.addEventListener('click', _onDocumentClick);\n});\nonActivated(() => {\n document.addEventListener('click', _onDocumentClick);\n});\nonDeactivated(() => {\n document.removeEventListener('click', _onDocumentClick);\n});\nonBeforeUnmount(() => {\n document.removeEventListener('click', _onDocumentClick);\n});\n\n// 开放给外部使用的方法(Vant DropdownMenu 同款 API)\nconst toggle = (index: number) => {\n toggleItem(index);\n};\n\nconst open = (index: number) => {\n _setActive(index);\n};\n\nconst close = () => {\n _setActive(-1);\n};\n\n// 导出类型定义(在 defineExpose 之前)\nexport interface ClDropdownMenuMExpose {\n toggle: (index: number) => void;\n open: (index: number) => void;\n close: () => void;\n}\n\n// defineExpose(必须放在最后)\ndefineExpose({\n toggle,\n open,\n close,\n});\n</script>\n"],"names":["props","__props","emit","__emit","elId","activeIndex","ref","_itemSeq","rootEl","optDirection","computed","optActiveColor","optDuration","CommonBase","optZIndex","z","optIsShowOverlay","clsParent","clsTemp","CommonElement","styOverlay","_setActive","index","wasOpen","onClickOverlay","toggleItem","setActiveIndex","registerItem","provide","_onDocumentClick","event","el","onMounted","onActivated","onDeactivated","onBeforeUnmount","__expose","_createElementBlock","_unref","_createElementVNode","_hoisted_2","_renderSlot","_ctx","_createVNode","_Transition"],"mappings":"gtBA6CA,MAAMA,EAAQC,EAmCRC,EAAOC,EAUPC,EAAOJ,EAAM,GAGbK,EAAcC,EAAAA,IAAI,EAAE,EAE1B,IAAIC,EAAW,EAEf,MAAMC,EAASF,EAAAA,IAAwB,IAAI,EAGrCG,EAAeC,EAAAA,SAAS,IAAOV,EAAM,YAAc,KAAO,KAAO,MAAO,EAExEW,EAAiBD,EAAAA,SAAS,IAAMV,EAAM,WAAW,EAEjDY,EAAcF,EAAAA,SAAS,IAC3BG,EAAAA,WAAW,SAASb,EAAM,QAAQ,GAAKA,EAAM,SAAW,EAAIA,EAAM,SAAW,GAAA,EAGzEc,EAAYJ,EAAAA,SAAS,IAAM,CAC/B,MAAMK,EAAI,OAAOf,EAAM,MAAM,EAC7B,OAAOa,EAAAA,WAAW,SAASE,CAAC,GAAKA,EAAI,EAAI,KAAK,MAAMA,CAAC,EAAI,GAC3D,CAAC,EAEKC,EAAmBN,EAAAA,SAAS,IAAMV,EAAM,WAAaK,EAAY,QAAU,EAAE,EAE7EY,EAAYP,EAAAA,SAAS,IAAM,CAC/B,MAAMQ,EAAmC,CACvC,sBAAuB,GACvB,oBAAqBT,EAAa,QAAU,IAAA,E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,EAuBDO,EAAa,CACX,OArBcd,GAAkB,CAChCG,EAAWH,CAAK,CAClB,EAoBE,KAlBYA,GAAkB,CAC9BD,EAAWC,CAAK,CAClB,EAiBE,MAfY,IAAM,CAClBD,EAAW,EAAE,CACf,CAaE,CACD,wBArOCgB,EAAAA,mBAqBM,MAAA,SApBA,SAAJ,IAAI7B,EACH,GAAI8B,EAAAA,MAAAlC,CAAA,EACJ,uBAAOa,EAAA,KAAS,CAAA,GAEjBsB,EAAAA,mBAEM,MAFNC,EAEM,CADJC,aAAaC,EAAA,OAAA,SAAA,CAAA,GAEfC,EAAAA,YAYaC,EAAAA,WAAA,CAXX,KAAK,qBACJ,SAAUhC,EAAA,MACV,4BAAaV,EAAI,UAAA,GACjB,4BAAaA,EAAI,UAAA,EAAA,qBAElB,IAKO,CAJCc,EAAA,qBADRqB,EAAAA,mBAKO,MAAA,OAHL,MAAM,wBACL,uBAAOjB,EAAA,KAAU,EACjB,QAAOI,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { defineComponent as z, ref as C, computed as r, provide as A, onMounted as B, onActivated as M, onDeactivated as D, onBeforeUnmount as L, openBlock as y, createElementBlock as O, normalizeClass as b, unref as $, createElementVNode as T, renderSlot as V, createVNode as h, Transition as F, withCtx as J, normalizeStyle as q, createCommentVNode as P } from "vue";
|
|
2
2
|
import { C as c } from "../Shared/base-DU7nGSf6.js";
|
|
3
3
|
import { C as U } from "../Shared/index-DvNmQjNH.js";
|
|
4
|
-
|
|
4
|
+
/* empty css */
|
|
5
|
+
const Z = ["id"], j = { class: "dropdownmenum-bar" }, te = /* @__PURE__ */ z({
|
|
5
6
|
name: "ClDropdownMenuM",
|
|
6
7
|
__name: "Index",
|
|
7
8
|
props: {
|
|
@@ -48,7 +49,7 @@ const Z = ["id"], j = { class: "dropdownmenum-bar" }, ee = /* @__PURE__ */ z({
|
|
|
48
49
|
},
|
|
49
50
|
emits: ["onOpen", "onClose", "onOpened", "onClosed", "onClickOverlay"],
|
|
50
51
|
setup(a, { expose: k, emit: g }) {
|
|
51
|
-
const t = a,
|
|
52
|
+
const t = a, i = g, I = t.id, l = C(-1);
|
|
52
53
|
let u = 0;
|
|
53
54
|
const d = C(null), m = r(() => t.direction === "up" ? "up" : "down"), w = r(() => t.activeColor), p = r(
|
|
54
55
|
() => c.isFinite(t.duration) && t.duration > 0 ? t.duration : 200
|
|
@@ -65,9 +66,9 @@ const Z = ["id"], j = { class: "dropdownmenum-bar" }, ee = /* @__PURE__ */ z({
|
|
|
65
66
|
zIndex: v.value - 1
|
|
66
67
|
})), n = (e) => {
|
|
67
68
|
const o = l.value !== -1;
|
|
68
|
-
l.value = e, e !== -1 ? o ||
|
|
69
|
+
l.value = e, e !== -1 ? o || i("onOpen") : o && i("onClose");
|
|
69
70
|
}, N = () => {
|
|
70
|
-
|
|
71
|
+
i("onClickOverlay"), t.isCloseOnClickOverlay && n(-1);
|
|
71
72
|
}, f = (e) => {
|
|
72
73
|
l.value === e ? n(-1) : n(e);
|
|
73
74
|
};
|
|
@@ -86,19 +87,19 @@ const Z = ["id"], j = { class: "dropdownmenum-bar" }, ee = /* @__PURE__ */ z({
|
|
|
86
87
|
n(e);
|
|
87
88
|
}
|
|
88
89
|
});
|
|
89
|
-
const
|
|
90
|
+
const s = (e) => {
|
|
90
91
|
if (!t.isCloseOnClickOutside || l.value === -1) return;
|
|
91
92
|
const o = e.target ?? null;
|
|
92
93
|
d.value && d.value.contains(o) || n(-1);
|
|
93
94
|
};
|
|
94
95
|
return B(() => {
|
|
95
|
-
document.addEventListener("click",
|
|
96
|
+
document.addEventListener("click", s);
|
|
96
97
|
}), M(() => {
|
|
97
|
-
document.addEventListener("click",
|
|
98
|
+
document.addEventListener("click", s);
|
|
98
99
|
}), D(() => {
|
|
99
|
-
document.removeEventListener("click",
|
|
100
|
+
document.removeEventListener("click", s);
|
|
100
101
|
}), L(() => {
|
|
101
|
-
document.removeEventListener("click",
|
|
102
|
+
document.removeEventListener("click", s);
|
|
102
103
|
}), k({
|
|
103
104
|
toggle: (e) => {
|
|
104
105
|
f(e);
|
|
@@ -121,8 +122,8 @@ const Z = ["id"], j = { class: "dropdownmenum-bar" }, ee = /* @__PURE__ */ z({
|
|
|
121
122
|
h(F, {
|
|
122
123
|
name: "dropdownmenum-fade",
|
|
123
124
|
duration: p.value,
|
|
124
|
-
onAfterEnter: o[0] || (o[0] = (S) =>
|
|
125
|
-
onAfterLeave: o[1] || (o[1] = (S) =>
|
|
125
|
+
onAfterEnter: o[0] || (o[0] = (S) => i("onOpened")),
|
|
126
|
+
onAfterLeave: o[1] || (o[1] = (S) => i("onClosed"))
|
|
126
127
|
}, {
|
|
127
128
|
default: J(() => [
|
|
128
129
|
x.value ? (y(), O("div", {
|
|
@@ -138,6 +139,6 @@ const Z = ["id"], j = { class: "dropdownmenum-bar" }, ee = /* @__PURE__ */ z({
|
|
|
138
139
|
}
|
|
139
140
|
});
|
|
140
141
|
export {
|
|
141
|
-
|
|
142
|
+
te as default
|
|
142
143
|
};
|
|
143
144
|
//# sourceMappingURL=ClDropdownMenuM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClDropdownMenuM.js","sources":["../../../src/libs/Mobile/DropdownMenuM/Index.vue"],"sourcesContent":["<template>\n <div\n ref=\"rootEl\"\n :id=\"elId\"\n :class=\"clsParent\"\n >\n <div class=\"dropdownmenum-bar\">\n <slot></slot>\n </div>\n <Transition\n name=\"dropdownmenum-fade\"\n :duration=\"optDuration\"\n @after-enter=\"emit('onOpened')\"\n @after-leave=\"emit('onClosed')\"\n >\n <div\n v-if=\"optIsShowOverlay\"\n class=\"dropdownmenum-overlay\"\n :style=\"styOverlay\"\n @click=\"onClickOverlay\"\n ></div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onActivated, onBeforeUnmount, onDeactivated, onMounted, provide, ref } from 'vue';\nimport CommonBase from '../../Common/base';\nimport CommonElement from '../../Common/Element/index';\nimport './Index.css';\n\n// 容器向下提供的上下文(配置项为 computed,保证响应式:父 props 变更后子项同步)\nexport interface DropdownMenuMTop {\n activeIndex: import('vue').Ref<number>;\n direction: import('vue').ComputedRef<string>;\n activeColor: import('vue').ComputedRef<string>;\n zIndex: import('vue').ComputedRef<number>;\n duration: import('vue').ComputedRef<number>;\n registerItem: () => number;\n toggleItem: (index: number) => void;\n setActiveIndex: (index: number) => void;\n}\n\ndefineOptions({ name: 'ClDropdownMenuM' });\n\nconst props = defineProps({\n id: String, // desc: 组件实例唯一标识,用于多实例场景下 DOM 查询限定\n className: String, // desc: 自定义CSS类名\n activeColor: {\n type: String,\n default: 'var(--cl-primary)', // desc: 菜单标题和选项的选中态颜色\n },\n direction: {\n type: String,\n default: 'down', // desc: 菜单展开方向 | enum: down, up\n validator: (v: string) => ['down', 'up'].includes(v),\n },\n zIndex: {\n type: Number,\n default: 2000, // desc: 菜单栏 z-index 层级\n },\n duration: {\n type: Number,\n default: 200, // desc: 菜单展开/收起动画时长(ms)\n },\n isOverlay: {\n type: Boolean,\n default: true, // desc: 是否显示遮罩层\n },\n isCloseOnClickOverlay: {\n type: Boolean,\n default: true, // desc: 点击遮罩层后是否关闭菜单\n },\n isCloseOnClickOutside: {\n type: Boolean,\n default: true, // desc: 是否在点击外部元素后关闭菜单\n },\n});\n\n// emit\nconst emit = defineEmits<{\n (e: 'onOpen'): void; // desc: 打开菜单时触发\n (e: 'onClose'): void; // desc: 关闭菜单时触发\n (e: 'onOpened'): void; // desc: 打开动画结束后触发\n (e: 'onClosed'): void; // desc: 关闭动画结束后触发\n (e: 'onClickOverlay'): void; // desc: 点击遮罩层时触发\n}>();\n\n// slots: default(菜单项列表)\n\nconst elId = props.id; // || `dropdownmenum-${CommonBase.getRandom(8)}`\n\n// 当前展开的菜单项索引,-1 表示全部收起\nconst activeIndex = ref(-1);\n// 子项注册序号(每个 DropdownMenuItemM 挂载时递增取号)\nlet _itemSeq = 0;\n// 根元素(点击外部关闭判定)\nconst rootEl = ref<HTMLElement | null>(null);\n\n// computed\nconst optDirection = computed(() => (props.direction === 'up' ? 'up' : 'down'));\n\nconst optActiveColor = computed(() => props.activeColor);\n\nconst optDuration = computed(() =>\n CommonBase.isFinite(props.duration) && props.duration > 0 ? props.duration : 200,\n);\n\nconst optZIndex = computed(() => {\n const z = Number(props.zIndex);\n return CommonBase.isFinite(z) && z > 0 ? Math.round(z) : 2000;\n});\n\nconst optIsShowOverlay = computed(() => props.isOverlay && activeIndex.value !== -1);\n\nconst clsParent = computed(() => {\n const clsTemp: Record<string, boolean> = {\n 'panel-dropdownmenum': true,\n 'dropdownmenum--up': optDirection.value === 'up',\n };\n return CommonBase.getJsonMerge(clsTemp, CommonElement.getClassNameJson(props.className));\n});\n\nconst styOverlay = computed(() => ({\n zIndex: optZIndex.value - 1,\n}));\n\n// 内部方法\nconst _setActive = (index: number) => {\n const wasOpen = activeIndex.value !== -1;\n activeIndex.value = index;\n if (index !== -1) {\n if (!wasOpen) {\n emit('onOpen');\n }\n } else {\n if (wasOpen) {\n emit('onClose');\n }\n }\n};\n\n// 事件方法\nconst onClickOverlay = () => {\n emit('onClickOverlay');\n if (props.isCloseOnClickOverlay) {\n _setActive(-1);\n }\n};\n\n// 对外开放:切换/设置当前展开项\nconst toggleItem = (index: number) => {\n if (activeIndex.value === index) {\n _setActive(-1);\n } else {\n _setActive(index);\n }\n};\n\nconst setActiveIndex = (index: number) => {\n _setActive(index);\n};\n\n// 子项注册:返回该子项在容器内的序号(index)\nconst registerItem = (): number => {\n const index = _itemSeq;\n _itemSeq++;\n return index;\n};\n\n// provide(配置项传 computed,父 props 变更子项实时同步)\nprovide<DropdownMenuMTop>('$DropdownMenuMTop', {\n activeIndex,\n direction: optDirection,\n activeColor: optActiveColor,\n zIndex: optZIndex,\n duration: optDuration,\n registerItem,\n toggleItem,\n setActiveIndex,\n});\n\n// 点击外部关闭(isCloseOnClickOutside)\nconst _onDocumentClick = (event: MouseEvent) => {\n if (!props.isCloseOnClickOutside) return;\n if (activeIndex.value === -1) return;\n const el = (event.target as Node | null) ?? null;\n if (rootEl.value && rootEl.value.contains(el)) return;\n _setActive(-1);\n};\n\n// 生命周期(keep-alive 缓存时暂停/恢复监听)\nonMounted(() => {\n document.addEventListener('click', _onDocumentClick);\n});\nonActivated(() => {\n document.addEventListener('click', _onDocumentClick);\n});\nonDeactivated(() => {\n document.removeEventListener('click', _onDocumentClick);\n});\nonBeforeUnmount(() => {\n document.removeEventListener('click', _onDocumentClick);\n});\n\n// 开放给外部使用的方法(Vant DropdownMenu 同款 API)\nconst toggle = (index: number) => {\n toggleItem(index);\n};\n\nconst open = (index: number) => {\n _setActive(index);\n};\n\nconst close = () => {\n _setActive(-1);\n};\n\n// 导出类型定义(在 defineExpose 之前)\nexport interface ClDropdownMenuMExpose {\n toggle: (index: number) => void;\n open: (index: number) => void;\n close: () => void;\n}\n\n// defineExpose(必须放在最后)\ndefineExpose({\n toggle,\n open,\n close,\n});\n</script>\n"],"names":["props","__props","emit","__emit","elId","activeIndex","ref","_itemSeq","rootEl","optDirection","computed","optActiveColor","optDuration","CommonBase","optZIndex","z","optIsShowOverlay","clsParent","clsTemp","CommonElement","styOverlay","_setActive","index","wasOpen","onClickOverlay","toggleItem","provide","_onDocumentClick","event","el","onMounted","onActivated","onDeactivated","onBeforeUnmount","__expose","_createElementBlock","_unref","_createElementVNode","_hoisted_2","_renderSlot","_ctx","_createVNode","_Transition"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClDropdownMenuM.js","sources":["../../../src/libs/Mobile/DropdownMenuM/Index.vue"],"sourcesContent":["<template>\n <div\n ref=\"rootEl\"\n :id=\"elId\"\n :class=\"clsParent\"\n >\n <div class=\"dropdownmenum-bar\">\n <slot></slot>\n </div>\n <Transition\n name=\"dropdownmenum-fade\"\n :duration=\"optDuration\"\n @after-enter=\"emit('onOpened')\"\n @after-leave=\"emit('onClosed')\"\n >\n <div\n v-if=\"optIsShowOverlay\"\n class=\"dropdownmenum-overlay\"\n :style=\"styOverlay\"\n @click=\"onClickOverlay\"\n ></div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, onActivated, onBeforeUnmount, onDeactivated, onMounted, provide, ref } from 'vue';\nimport CommonBase from '../../Common/base';\nimport CommonElement from '../../Common/Element/index';\nimport './Index.css';\n\n// 容器向下提供的上下文(配置项为 computed,保证响应式:父 props 变更后子项同步)\nexport interface DropdownMenuMTop {\n activeIndex: import('vue').Ref<number>;\n direction: import('vue').ComputedRef<string>;\n activeColor: import('vue').ComputedRef<string>;\n zIndex: import('vue').ComputedRef<number>;\n duration: import('vue').ComputedRef<number>;\n registerItem: () => number;\n toggleItem: (index: number) => void;\n setActiveIndex: (index: number) => void;\n}\n\ndefineOptions({ name: 'ClDropdownMenuM' });\n\nconst props = defineProps({\n id: String, // desc: 组件实例唯一标识,用于多实例场景下 DOM 查询限定\n className: String, // desc: 自定义CSS类名\n activeColor: {\n type: String,\n default: 'var(--cl-primary)', // desc: 菜单标题和选项的选中态颜色\n },\n direction: {\n type: String,\n default: 'down', // desc: 菜单展开方向 | enum: down, up\n validator: (v: string) => ['down', 'up'].includes(v),\n },\n zIndex: {\n type: Number,\n default: 2000, // desc: 菜单栏 z-index 层级\n },\n duration: {\n type: Number,\n default: 200, // desc: 菜单展开/收起动画时长(ms)\n },\n isOverlay: {\n type: Boolean,\n default: true, // desc: 是否显示遮罩层\n },\n isCloseOnClickOverlay: {\n type: Boolean,\n default: true, // desc: 点击遮罩层后是否关闭菜单\n },\n isCloseOnClickOutside: {\n type: Boolean,\n default: true, // desc: 是否在点击外部元素后关闭菜单\n },\n});\n\n// emit\nconst emit = defineEmits<{\n (e: 'onOpen'): void; // desc: 打开菜单时触发\n (e: 'onClose'): void; // desc: 关闭菜单时触发\n (e: 'onOpened'): void; // desc: 打开动画结束后触发\n (e: 'onClosed'): void; // desc: 关闭动画结束后触发\n (e: 'onClickOverlay'): void; // desc: 点击遮罩层时触发\n}>();\n\n// slots: default(菜单项列表)\n\nconst elId = props.id; // || `dropdownmenum-${CommonBase.getRandom(8)}`\n\n// 当前展开的菜单项索引,-1 表示全部收起\nconst activeIndex = ref(-1);\n// 子项注册序号(每个 DropdownMenuItemM 挂载时递增取号)\nlet _itemSeq = 0;\n// 根元素(点击外部关闭判定)\nconst rootEl = ref<HTMLElement | null>(null);\n\n// computed\nconst optDirection = computed(() => (props.direction === 'up' ? 'up' : 'down'));\n\nconst optActiveColor = computed(() => props.activeColor);\n\nconst optDuration = computed(() =>\n CommonBase.isFinite(props.duration) && props.duration > 0 ? props.duration : 200,\n);\n\nconst optZIndex = computed(() => {\n const z = Number(props.zIndex);\n return CommonBase.isFinite(z) && z > 0 ? Math.round(z) : 2000;\n});\n\nconst optIsShowOverlay = computed(() => props.isOverlay && activeIndex.value !== -1);\n\nconst clsParent = computed(() => {\n const clsTemp: Record<string, boolean> = {\n 'panel-dropdownmenum': true,\n 'dropdownmenum--up': optDirection.value === 'up',\n };\n return CommonBase.getJsonMerge(clsTemp, CommonElement.getClassNameJson(props.className));\n});\n\nconst styOverlay = computed(() => ({\n zIndex: optZIndex.value - 1,\n}));\n\n// 内部方法\nconst _setActive = (index: number) => {\n const wasOpen = activeIndex.value !== -1;\n activeIndex.value = index;\n if (index !== -1) {\n if (!wasOpen) {\n emit('onOpen');\n }\n } else {\n if (wasOpen) {\n emit('onClose');\n }\n }\n};\n\n// 事件方法\nconst onClickOverlay = () => {\n emit('onClickOverlay');\n if (props.isCloseOnClickOverlay) {\n _setActive(-1);\n }\n};\n\n// 对外开放:切换/设置当前展开项\nconst toggleItem = (index: number) => {\n if (activeIndex.value === index) {\n _setActive(-1);\n } else {\n _setActive(index);\n }\n};\n\nconst setActiveIndex = (index: number) => {\n _setActive(index);\n};\n\n// 子项注册:返回该子项在容器内的序号(index)\nconst registerItem = (): number => {\n const index = _itemSeq;\n _itemSeq++;\n return index;\n};\n\n// provide(配置项传 computed,父 props 变更子项实时同步)\nprovide<DropdownMenuMTop>('$DropdownMenuMTop', {\n activeIndex,\n direction: optDirection,\n activeColor: optActiveColor,\n zIndex: optZIndex,\n duration: optDuration,\n registerItem,\n toggleItem,\n setActiveIndex,\n});\n\n// 点击外部关闭(isCloseOnClickOutside)\nconst _onDocumentClick = (event: MouseEvent) => {\n if (!props.isCloseOnClickOutside) return;\n if (activeIndex.value === -1) return;\n const el = (event.target as Node | null) ?? null;\n if (rootEl.value && rootEl.value.contains(el)) return;\n _setActive(-1);\n};\n\n// 生命周期(keep-alive 缓存时暂停/恢复监听)\nonMounted(() => {\n document.addEventListener('click', _onDocumentClick);\n});\nonActivated(() => {\n document.addEventListener('click', _onDocumentClick);\n});\nonDeactivated(() => {\n document.removeEventListener('click', _onDocumentClick);\n});\nonBeforeUnmount(() => {\n document.removeEventListener('click', _onDocumentClick);\n});\n\n// 开放给外部使用的方法(Vant DropdownMenu 同款 API)\nconst toggle = (index: number) => {\n toggleItem(index);\n};\n\nconst open = (index: number) => {\n _setActive(index);\n};\n\nconst close = () => {\n _setActive(-1);\n};\n\n// 导出类型定义(在 defineExpose 之前)\nexport interface ClDropdownMenuMExpose {\n toggle: (index: number) => void;\n open: (index: number) => void;\n close: () => void;\n}\n\n// defineExpose(必须放在最后)\ndefineExpose({\n toggle,\n open,\n close,\n});\n</script>\n"],"names":["props","__props","emit","__emit","elId","activeIndex","ref","_itemSeq","rootEl","optDirection","computed","optActiveColor","optDuration","CommonBase","optZIndex","z","optIsShowOverlay","clsParent","clsTemp","CommonElement","styOverlay","_setActive","index","wasOpen","onClickOverlay","toggleItem","provide","_onDocumentClick","event","el","onMounted","onActivated","onDeactivated","onBeforeUnmount","__expose","_createElementBlock","_unref","_createElementVNode","_hoisted_2","_renderSlot","_ctx","_createVNode","_Transition"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,UAAMA,IAAQC,GAmCRC,IAAOC,GAUPC,IAAOJ,EAAM,IAGbK,IAAcC,EAAI,EAAE;AAE1B,QAAIC,IAAW;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A;AAAA,QACjB,qCAAaA,EAAI,UAAA;AAAA,MAAA;mBAElB,MAKO;AAAA,UAJCc,EAAA,cADRmB,EAKO,OAAA;AAAA;YAHL,OAAM;AAAA,YACL,SAAOf,EAAA,KAAU;AAAA,YACjB,SAAOI;AAAA,UAAA;;;;;;;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),a=require("../Shared/base-C2QOJBgB.js"),k=require("../Shared/index-DAgtltwJ.js"),_=require("../Shared/Index.vue_vue_type_script_setup_true_lang-g88DiQYZ.js"),z=require("../Shared/Index.vue_vue_type_script_setup_true_lang-Dvy5B6_y.js");;/* empty css */const M=["id"],$={class:"dropdownmenum-item-title-text"},D={key:0,class:"dropdownmenum-panel-loading"},A={key:0,class:"dropdownmenum-options"},q=["onClick"],F={class:"dropdownmenum-option-text"},J=e.defineComponent({name:"ClDropdownMenuMItem",__name:"Item",props:{id:String,className:String,title:String,modelValue:{type:[String,Number],default:void 0},optionsList:{type:Array,default:()=>[]},optionLabel:{type:String,default:"text"},optionValue:{type:String,default:"value"},disabled:Boolean,isLoading:Boolean},emits:["update:modelValue","onChange"],setup(i,{emit:g}){const o=i,d=g,w=o.id,B=`dropdownmenumItem-${a.CommonBase.getRandom(5)}`,n=e.inject("$DropdownMenuMTop"),y=e.useSlots(),s=e.ref(-1),r=e.computed(()=>s.value!==-1&&n?.activeIndex.value===s.value),u=e.computed(()=>n?.direction.value||"down"),C=e.computed(()=>{const t=u.value==="up";return r.value?t?"caret-down":"caret-up":t?"caret-up":"caret-down"}),m=e.computed(()=>n?.duration.value||200),f=e.computed(()=>!!y.default),S=e.computed(()=>Array.isArray(o.optionsList)&&o.optionsList.length>0),x=e.computed(()=>r.value&&!o.disabled),p=t=>t[o.optionValue]===o.modelValue,v=t=>{const l=t[o.optionLabel];return a.CommonBase.isString(l)?l:a.CommonBase.isNumber(l)?String(l):""},V=e.computed(()=>{if(a.CommonBase.isNonEmptyString(o.title))return o.title;if(a.CommonBase.isEmpty(o.modelValue))return"";const t=(o.optionsList||[]).find(l=>l[o.optionValue]===o.modelValue);return t?v(t):""}),E=e.computed(()=>{const t={"dropdownmenum-item":!0,"dropdownmenum-item--disabled":o.disabled};return a.CommonBase.getJsonMerge(t,k.CommonElement.getClassNameJson(o.className))}),N=e.computed(()=>r.value&&n?{color:n.activeColor.value}:void 0),I=e.computed(()=>({zIndex:n?.zIndex.value||2e3,"--dropdownmenum-duration":`${m.value}ms`})),h=t=>{const l={"dropdownmenum-option":!0,"dropdownmenum-option--disabled":!!t.disabled,"dropdownmenum-option--selected":p(t)};return a.CommonBase.getJsonMerge(l,k.CommonElement.getClassNameJson(t.className))};e.onMounted(()=>{if(!n){console.warn("[ClDropdownMenuMItem] 警告:必须放置在 cl-dropdown-menu-m 容器内使用");return}s.value=n.registerItem()}),e.onBeforeUnmount(()=>{n&&s.value!==-1&&n.activeIndex.value===s.value&&n.setActiveIndex(-1)});const b=()=>{o.disabled||!n||n.toggleItem(s.value)},T=t=>{if(t.disabled)return;const l=t[o.optionValue];d("update:modelValue",l),d("onChange",l),n?.setActiveIndex(-1)};return(t,l)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(w),class:e.normalizeClass(E.value)},[e.createElementVNode("div",{class:e.normalizeClass(["dropdownmenum-item-title",{"dropdownmenum-item-title--active":r.value}]),style:e.normalizeStyle(N.value),onClick:b},[e.createElementVNode("span",$,[e.renderSlot(t.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(V.value),1)])]),e.createVNode(_._sfc_main,{class:"dropdownmenum-item-arrow",name:C.value},null,8,["name"])],6),e.createVNode(e.Transition,{name:"dropdownmenum-panel",duration:m.value},{default:e.withCtx(()=>[x.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dropdownmenum-panel",{"dropdownmenum-panel--up":u.value==="up"}]),style:e.normalizeStyle(I.value)},[f.value?e.renderSlot(t.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[i.isLoading?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(z._sfc_main,{size:"small"})])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[S.value?(e.openBlock(),e.createElementBlock("ul",A,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.optionsList,(c,L)=>(e.openBlock(),e.createElementBlock("li",{key:`${B}-${L}`,class:e.normalizeClass(h(c)),onClick:O=>T(c)},[e.createElementVNode("span",F,e.toDisplayString(v(c)),1),p(c)?(e.openBlock(),e.createBlock(_._sfc_main,{key:0,class:"dropdownmenum-option-check",name:"check"})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],10,q))),128))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[],64))],64))],64))],6)):e.createCommentVNode("",!0)]),_:3},8,["duration"])],10,M))}});module.exports=J;
|
|
2
|
+
//# sourceMappingURL=ClDropdownMenuMItem.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClDropdownMenuMItem.cjs","sources":["../../../src/libs/Mobile/DropdownMenuM/Item.vue"],"sourcesContent":["<template>\n <div\n :id=\"elId\"\n :class=\"clsItem\"\n >\n <div\n class=\"dropdownmenum-item-title\"\n :class=\"{ 'dropdownmenum-item-title--active': optIsActive }\"\n :style=\"styTitle\"\n @click=\"onClickTitle\"\n >\n <span class=\"dropdownmenum-item-title-text\">\n <slot name=\"title\">{{ optTitleText }}</slot>\n </span>\n <cl-icon-font\n class=\"dropdownmenum-item-arrow\"\n :name=\"optArrowName\"\n ></cl-icon-font>\n </div>\n <Transition\n name=\"dropdownmenum-panel\"\n :duration=\"optDuration\"\n >\n <div\n v-if=\"optIsShowPanel\"\n class=\"dropdownmenum-panel\"\n :class=\"{ 'dropdownmenum-panel--up': optDirection === 'up' }\"\n :style=\"styPanel\"\n >\n <template v-if=\"optHasDefaultSlot\">\n <slot></slot>\n </template>\n <template v-else>\n <div\n v-if=\"isLoading\"\n class=\"dropdownmenum-panel-loading\"\n >\n <cl-load size=\"small\"></cl-load>\n </div>\n <template v-else>\n <ul\n v-if=\"optIsShowOptions\"\n class=\"dropdownmenum-options\"\n >\n <li\n v-for=\"(optionItem, inx) in optionsList\"\n :key=\"`${_keyIndex}-${inx}`\"\n :class=\"clsOption(optionItem)\"\n @click=\"onClickOption(optionItem)\"\n >\n <span class=\"dropdownmenum-option-text\">{{ optOptionText(optionItem) }}</span>\n <cl-icon-font\n v-if=\"optIsSelected(optionItem)\"\n class=\"dropdownmenum-option-check\"\n name=\"check\"\n ></cl-icon-font>\n <template v-else></template>\n </li>\n </ul>\n <template v-else></template>\n </template>\n </template>\n </div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, onBeforeUnmount, onMounted, ref, useSlots, type PropType } from 'vue';\nimport CommonBase from '../../Common/base';\nimport CommonElement from '../../Common/Element/index';\nimport ClIconFont from '../../Element/IconFont/Index.vue';\nimport ClLoad from '../../Element/Load/Index.vue';\nimport type { DropdownMenuMTop } from './Index.vue';\nimport './Index.css';\n\n// 选项数据结构\nexport interface DropdownMenuItemOption {\n text?: string;\n value?: string | number;\n disabled?: boolean;\n className?: string;\n [key: string]: unknown;\n}\n\ndefineOptions({ name: 'ClDropdownMenuMItem' });\n\n// props\nconst props = defineProps({\n id: String, // desc: 组件实例唯一标识,用于多实例场景下 DOM 查询限定\n className: String, // desc: 自定义CSS类名\n title: String, // desc: 菜单项标题文本\n modelValue: {\n type: [String, Number] as PropType<string | number>,\n default: undefined, // desc: 当前选中项对应的值,支持 v-model\n },\n optionsList: {\n type: Array as PropType<DropdownMenuItemOption[]>,\n default: () => [], // desc: 选项列表(含 text/value/disabled 字段)\n },\n optionLabel: {\n type: String,\n default: 'text', // desc: 选项展示文案字段名\n },\n optionValue: {\n type: String,\n default: 'value', // desc: 选项值字段名\n },\n disabled: Boolean, // desc: 是否禁用该菜单项\n isLoading: Boolean, // desc: 是否显示加载中状态\n});\n\n// emit\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: string | number | undefined): void; // desc: 选中值变化(支持 v-model)\n (e: 'onChange', value: string | number | undefined): void; // desc: 选中项变化时触发\n}>();\n\n// slots: title(自定义标题), default(自定义下拉内容)\n\nconst elId = props.id; // || `dropdownmenum-item-${CommonBase.getRandom(8)}`\nconst _keyIndex = `dropdownmenumItem-${CommonBase.getRandom(5)}`;\n\nconst _selfTop = inject<DropdownMenuMTop>('$DropdownMenuMTop');\nconst _slots = useSlots();\n\n// 本子项在容器中的序号(挂载时注册获得)\nconst _selfIndex = ref(-1);\n\n// computed\nconst optIsActive = computed(() => _selfIndex.value !== -1 && _selfTop?.activeIndex.value === _selfIndex.value);\n\nconst optDirection = computed(() => _selfTop?.direction.value || 'down');\n\n// 箭头方向:收起时指向展开方向(down→下、up→上),展开时翻转(可收起)\nconst optArrowName = computed(() => {\n const expandUp = optDirection.value === 'up';\n if (optIsActive.value) {\n return expandUp ? 'caret-down' : 'caret-up';\n }\n return expandUp ? 'caret-up' : 'caret-down';\n});\n\nconst optDuration = computed(() => (_selfTop?.duration.value || 200));\n\nconst optHasDefaultSlot = computed(() => !!_slots.default);\n\nconst optIsShowOptions = computed(\n () => Array.isArray(props.optionsList) && props.optionsList.length > 0,\n);\n\nconst optIsShowPanel = computed(() => optIsActive.value && !props.disabled);\n\nconst optIsSelected = (optionItem: DropdownMenuItemOption): boolean => {\n return optionItem[props.optionValue] === props.modelValue;\n};\n\nconst optOptionText = (optionItem: DropdownMenuItemOption): string => {\n const raw = optionItem[props.optionLabel];\n return CommonBase.isString(raw) ? (raw as string) : CommonBase.isNumber(raw) ? String(raw) : '';\n};\n\n// 标题文本:显式传入 title 时固定显示;未传 title 时跟随当前选中项的 text(Vant 同款行为)\nconst optTitleText = computed(() => {\n if (CommonBase.isNonEmptyString(props.title)) {\n return props.title as string;\n }\n if (CommonBase.isEmpty(props.modelValue)) return '';\n const found = (props.optionsList || []).find(\n optionItem => optionItem[props.optionValue] === props.modelValue,\n );\n return found ? optOptionText(found) : '';\n});\n\nconst clsItem = computed(() => {\n const clsTemp: Record<string, boolean> = {\n 'dropdownmenum-item': true,\n 'dropdownmenum-item--disabled': props.disabled,\n };\n return CommonBase.getJsonMerge(clsTemp, CommonElement.getClassNameJson(props.className));\n});\n\nconst styTitle = computed(() =>\n optIsActive.value && _selfTop\n ? { color: _selfTop.activeColor.value }\n : undefined,\n);\n\nconst styPanel = computed(() => ({\n zIndex: (_selfTop?.zIndex.value || 2000),\n '--dropdownmenum-duration': `${optDuration.value}ms`,\n}));\n\nconst clsOption = (optionItem: DropdownMenuItemOption) => {\n const clsTemp: Record<string, boolean> = {\n 'dropdownmenum-option': true,\n 'dropdownmenum-option--disabled': !!optionItem.disabled,\n 'dropdownmenum-option--selected': optIsSelected(optionItem),\n };\n return CommonBase.getJsonMerge(clsTemp, CommonElement.getClassNameJson(optionItem.className));\n};\n\n// 生命周期\nonMounted(() => {\n if (!_selfTop) {\n console.warn('[ClDropdownMenuMItem] 警告:必须放置在 cl-dropdown-menu-m 容器内使用');\n return;\n }\n _selfIndex.value = _selfTop.registerItem();\n});\n\nonBeforeUnmount(() => {\n // 仅当卸载的是当前激活项时才收起,避免误关闭其他展开项\n if (_selfTop && _selfIndex.value !== -1 && _selfTop.activeIndex.value === _selfIndex.value) {\n _selfTop.setActiveIndex(-1);\n }\n});\n\n// 事件方法\nconst onClickTitle = () => {\n if (props.disabled || !_selfTop) return;\n _selfTop.toggleItem(_selfIndex.value);\n};\n\nconst onClickOption = (optionItem: DropdownMenuItemOption) => {\n if (optionItem.disabled) return;\n const value = optionItem[props.optionValue] as string | number | undefined;\n emit('update:modelValue', value);\n emit('onChange', value);\n _selfTop?.setActiveIndex(-1);\n};\n</script>\n"],"names":["props","__props","emit","__emit","elId","_keyIndex","CommonBase","_selfTop","inject","_slots","useSlots","_selfIndex","ref","optIsActive","computed","optDirection","optArrowName","expandUp","optDuration","optHasDefaultSlot","optIsShowOptions","optIsShowPanel","optIsSelected","optionItem","optOptionText","raw","optTitleText","found","clsItem","clsTemp","CommonElement","styTitle","styPanel","clsOption","onMounted","onBeforeUnmount","onClickTitle","onClickOption","value","_createElementBlock","_unref","_createElementVNode","_normalizeClass","_hoisted_2","_renderSlot","_ctx","_createVNode","ClIconFont","_Transition","_Fragment","_openBlock","_hoisted_3","ClLoad","_hoisted_4","_renderList","inx","$event","_hoisted_6","_toDisplayString","_createBlock"],"mappings":"+2BAwFA,MAAMA,EAAQC,EAyBRC,EAAOC,EAOPC,EAAOJ,EAAM,GACbK,EAAY,qBAAqBC,EAAAA,WAAW,UAAU,CAAC,CAAC,GAExDC,EAAWC,EAAAA,OAAyB,mBAAmB,EACvDC,EAASC,EAAAA,SAAA,EAGTC,EAAaC,EAAAA,IAAI,EAAE,EAGnBC,EAAcC,EAAAA,SAAS,IAAMH,EAAW,QAAU,IAAMJ,GAAU,YAAY,QAAUI,EAAW,KAAK,EAExGI,EAAeD,EAAAA,SAAS,IAAMP,GAAU,UAAU,OAAS,MAAM,EAGjES,EAAeF,EAAAA,SAAS,IAAM,CAClC,MAAMG,EAAWF,EAAa,QAAU,KACxC,OAAIF,EAAY,MACPI,EAAW,aAAe,WAE5BA,EAAW,WAAa,YACjC,CAAC,EAEKC,EAAcJ,EAAAA,SAAS,IAAOP,GAAU,SAAS,OAAS,GAAI,EAE9DY,EAAoBL,EAAAA,SAAS,IAAM,CAAC,CAACL,EAAO,OAAO,EAEnDW,EAAmBN,EAAAA,SACvB,IAAM,MAAM,QAAQd,EAAM,WAAW,GAAKA,EAAM,YAAY,OAAS,CAAA,EAGjEqB,EAAiBP,EAAAA,SAAS,IAAMD,EAAY,OAAS,CAACb,EAAM,QAAQ,EAEpEsB,EAAiBC,GACdA,EAAWvB,EAAM,WAAW,IAAMA,EAAM,WAG3CwB,EAAiBD,GAA+C,CACpE,MAAME,EAAMF,EAAWvB,EAAM,WAAW,EACxC,OAAOM,aAAW,SAASmB,CAAG,EAAKA,EAAiBnB,EAAAA,WAAW,SAASmB,CAA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AAA,mBAEvBb,EAAAA,mBAqBWU,EAAAA,SAAA,CAAA,IAAA,GAAA,CAnBD7B,EAAA,OADR8B,EAAAA,UAAA,EAAAX,EAAAA,mBAkBK,KAlBLc,EAkBK,EAdHH,EAAAA,UAAA,EAAA,EAAAX,EAAAA,mBAaKU,WAAA,KAAAK,EAAAA,WAZyBrD,EAAA,YAAW,CAA/BsB,EAAYgC,mBADtBhB,EAAAA,mBAaK,KAAA,CAXF,IAAG,GAAKlC,CAAS,IAAIkD,CAAG,GACxB,MAAKb,EAAAA,eAAET,EAAUV,CAAU,CAAA,EAC3B,QAAKiC,GAAEnB,EAAcd,CAAU,CAAA,GAEhCkB,EAAAA,mBAA8E,OAA9EgB,EAA8EC,EAAAA,gBAAnClC,EAAcD,CAAU,CAAA,EAAA,CAAA,EAE3DD,EAAcC,CAAU,iBADhCoC,EAAAA,YAIgBZ,EAAAA,UAAA,OAFd,MAAM,6BACN,KAAK,OAAA,mBAEPR,EAAAA,mBAA4BU,EAAAA,SAAA,CAAA,IAAA,CAAA,EAAA,CAAA,EAAA,EAAA,EAAA,kCAGhCV,EAAAA,mBAA4BU,EAAAA,SAAA,CAAA,IAAA,CAAA,EAAA,CAAA,EAAA,EAAA,EAAA"}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { defineComponent as j, inject as F, useSlots as H, ref as R, computed as s, onMounted as q, onBeforeUnmount as G, openBlock as a, createElementBlock as l, normalizeClass as c, unref as K, createElementVNode as v, normalizeStyle as C, renderSlot as S, createTextVNode as Q, toDisplayString as x, createVNode as f, Transition as W, withCtx as X, Fragment as d, renderList as Y, createBlock as Z, createCommentVNode as ee } from "vue";
|
|
2
|
+
import { C as i } from "../Shared/base-DU7nGSf6.js";
|
|
3
|
+
import { C as h } from "../Shared/index-DvNmQjNH.js";
|
|
4
|
+
import { _ as I } from "../Shared/Index.vue_vue_type_script_setup_true_lang-D4kAoS8e.js";
|
|
5
|
+
import { _ as te } from "../Shared/Index.vue_vue_type_script_setup_true_lang-C06bNoBf.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
const oe = ["id"], ne = { class: "dropdownmenum-item-title-text" }, se = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "dropdownmenum-panel-loading"
|
|
10
|
+
}, ae = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "dropdownmenum-options"
|
|
13
|
+
}, le = ["onClick"], ie = { class: "dropdownmenum-option-text" }, fe = /* @__PURE__ */ j({
|
|
14
|
+
name: "ClDropdownMenuMItem",
|
|
15
|
+
__name: "Item",
|
|
16
|
+
props: {
|
|
17
|
+
id: String,
|
|
18
|
+
// desc: 组件实例唯一标识,用于多实例场景下 DOM 查询限定
|
|
19
|
+
className: String,
|
|
20
|
+
// desc: 自定义CSS类名
|
|
21
|
+
title: String,
|
|
22
|
+
// desc: 菜单项标题文本
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: [String, Number],
|
|
25
|
+
default: void 0
|
|
26
|
+
// desc: 当前选中项对应的值,支持 v-model
|
|
27
|
+
},
|
|
28
|
+
optionsList: {
|
|
29
|
+
type: Array,
|
|
30
|
+
default: () => []
|
|
31
|
+
// desc: 选项列表(含 text/value/disabled 字段)
|
|
32
|
+
},
|
|
33
|
+
optionLabel: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "text"
|
|
36
|
+
// desc: 选项展示文案字段名
|
|
37
|
+
},
|
|
38
|
+
optionValue: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "value"
|
|
41
|
+
// desc: 选项值字段名
|
|
42
|
+
},
|
|
43
|
+
disabled: Boolean,
|
|
44
|
+
// desc: 是否禁用该菜单项
|
|
45
|
+
isLoading: Boolean
|
|
46
|
+
// desc: 是否显示加载中状态
|
|
47
|
+
},
|
|
48
|
+
emits: ["update:modelValue", "onChange"],
|
|
49
|
+
setup(p, { emit: V }) {
|
|
50
|
+
const t = p, w = V, N = t.id, b = `dropdownmenumItem-${i.getRandom(5)}`, o = F("$DropdownMenuMTop"), T = H(), r = R(-1), u = s(() => r.value !== -1 && o?.activeIndex.value === r.value), g = s(() => o?.direction.value || "down"), L = s(() => {
|
|
51
|
+
const e = g.value === "up";
|
|
52
|
+
return u.value ? e ? "caret-down" : "caret-up" : e ? "caret-up" : "caret-down";
|
|
53
|
+
}), y = s(() => o?.duration.value || 200), $ = s(() => !!T.default), M = s(
|
|
54
|
+
() => Array.isArray(t.optionsList) && t.optionsList.length > 0
|
|
55
|
+
), A = s(() => u.value && !t.disabled), _ = (e) => e[t.optionValue] === t.modelValue, k = (e) => {
|
|
56
|
+
const n = e[t.optionLabel];
|
|
57
|
+
return i.isString(n) ? n : i.isNumber(n) ? String(n) : "";
|
|
58
|
+
}, B = s(() => {
|
|
59
|
+
if (i.isNonEmptyString(t.title))
|
|
60
|
+
return t.title;
|
|
61
|
+
if (i.isEmpty(t.modelValue)) return "";
|
|
62
|
+
const e = (t.optionsList || []).find(
|
|
63
|
+
(n) => n[t.optionValue] === t.modelValue
|
|
64
|
+
);
|
|
65
|
+
return e ? k(e) : "";
|
|
66
|
+
}), D = s(() => {
|
|
67
|
+
const e = {
|
|
68
|
+
"dropdownmenum-item": !0,
|
|
69
|
+
"dropdownmenum-item--disabled": t.disabled
|
|
70
|
+
};
|
|
71
|
+
return i.getJsonMerge(e, h.getClassNameJson(t.className));
|
|
72
|
+
}), z = s(
|
|
73
|
+
() => u.value && o ? { color: o.activeColor.value } : void 0
|
|
74
|
+
), E = s(() => ({
|
|
75
|
+
zIndex: o?.zIndex.value || 2e3,
|
|
76
|
+
"--dropdownmenum-duration": `${y.value}ms`
|
|
77
|
+
})), J = (e) => {
|
|
78
|
+
const n = {
|
|
79
|
+
"dropdownmenum-option": !0,
|
|
80
|
+
"dropdownmenum-option--disabled": !!e.disabled,
|
|
81
|
+
"dropdownmenum-option--selected": _(e)
|
|
82
|
+
};
|
|
83
|
+
return i.getJsonMerge(n, h.getClassNameJson(e.className));
|
|
84
|
+
};
|
|
85
|
+
q(() => {
|
|
86
|
+
if (!o) {
|
|
87
|
+
console.warn("[ClDropdownMenuMItem] 警告:必须放置在 cl-dropdown-menu-m 容器内使用");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
r.value = o.registerItem();
|
|
91
|
+
}), G(() => {
|
|
92
|
+
o && r.value !== -1 && o.activeIndex.value === r.value && o.setActiveIndex(-1);
|
|
93
|
+
});
|
|
94
|
+
const O = () => {
|
|
95
|
+
t.disabled || !o || o.toggleItem(r.value);
|
|
96
|
+
}, P = (e) => {
|
|
97
|
+
if (e.disabled) return;
|
|
98
|
+
const n = e[t.optionValue];
|
|
99
|
+
w("update:modelValue", n), w("onChange", n), o?.setActiveIndex(-1);
|
|
100
|
+
};
|
|
101
|
+
return (e, n) => (a(), l("div", {
|
|
102
|
+
id: K(N),
|
|
103
|
+
class: c(D.value)
|
|
104
|
+
}, [
|
|
105
|
+
v("div", {
|
|
106
|
+
class: c(["dropdownmenum-item-title", { "dropdownmenum-item-title--active": u.value }]),
|
|
107
|
+
style: C(z.value),
|
|
108
|
+
onClick: O
|
|
109
|
+
}, [
|
|
110
|
+
v("span", ne, [
|
|
111
|
+
S(e.$slots, "title", {}, () => [
|
|
112
|
+
Q(x(B.value), 1)
|
|
113
|
+
])
|
|
114
|
+
]),
|
|
115
|
+
f(I, {
|
|
116
|
+
class: "dropdownmenum-item-arrow",
|
|
117
|
+
name: L.value
|
|
118
|
+
}, null, 8, ["name"])
|
|
119
|
+
], 6),
|
|
120
|
+
f(W, {
|
|
121
|
+
name: "dropdownmenum-panel",
|
|
122
|
+
duration: y.value
|
|
123
|
+
}, {
|
|
124
|
+
default: X(() => [
|
|
125
|
+
A.value ? (a(), l("div", {
|
|
126
|
+
key: 0,
|
|
127
|
+
class: c(["dropdownmenum-panel", { "dropdownmenum-panel--up": g.value === "up" }]),
|
|
128
|
+
style: C(E.value)
|
|
129
|
+
}, [
|
|
130
|
+
$.value ? S(e.$slots, "default", { key: 0 }) : (a(), l(d, { key: 1 }, [
|
|
131
|
+
p.isLoading ? (a(), l("div", se, [
|
|
132
|
+
f(te, { size: "small" })
|
|
133
|
+
])) : (a(), l(d, { key: 1 }, [
|
|
134
|
+
M.value ? (a(), l("ul", ae, [
|
|
135
|
+
(a(!0), l(d, null, Y(p.optionsList, (m, U) => (a(), l("li", {
|
|
136
|
+
key: `${b}-${U}`,
|
|
137
|
+
class: c(J(m)),
|
|
138
|
+
onClick: (re) => P(m)
|
|
139
|
+
}, [
|
|
140
|
+
v("span", ie, x(k(m)), 1),
|
|
141
|
+
_(m) ? (a(), Z(I, {
|
|
142
|
+
key: 0,
|
|
143
|
+
class: "dropdownmenum-option-check",
|
|
144
|
+
name: "check"
|
|
145
|
+
})) : (a(), l(d, { key: 1 }, [], 64))
|
|
146
|
+
], 10, le))), 128))
|
|
147
|
+
])) : (a(), l(d, { key: 1 }, [], 64))
|
|
148
|
+
], 64))
|
|
149
|
+
], 64))
|
|
150
|
+
], 6)) : ee("", !0)
|
|
151
|
+
]),
|
|
152
|
+
_: 3
|
|
153
|
+
}, 8, ["duration"])
|
|
154
|
+
], 10, oe));
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
export {
|
|
158
|
+
fe as default
|
|
159
|
+
};
|
|
160
|
+
//# sourceMappingURL=ClDropdownMenuMItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClDropdownMenuMItem.js","sources":["../../../src/libs/Mobile/DropdownMenuM/Item.vue"],"sourcesContent":["<template>\n <div\n :id=\"elId\"\n :class=\"clsItem\"\n >\n <div\n class=\"dropdownmenum-item-title\"\n :class=\"{ 'dropdownmenum-item-title--active': optIsActive }\"\n :style=\"styTitle\"\n @click=\"onClickTitle\"\n >\n <span class=\"dropdownmenum-item-title-text\">\n <slot name=\"title\">{{ optTitleText }}</slot>\n </span>\n <cl-icon-font\n class=\"dropdownmenum-item-arrow\"\n :name=\"optArrowName\"\n ></cl-icon-font>\n </div>\n <Transition\n name=\"dropdownmenum-panel\"\n :duration=\"optDuration\"\n >\n <div\n v-if=\"optIsShowPanel\"\n class=\"dropdownmenum-panel\"\n :class=\"{ 'dropdownmenum-panel--up': optDirection === 'up' }\"\n :style=\"styPanel\"\n >\n <template v-if=\"optHasDefaultSlot\">\n <slot></slot>\n </template>\n <template v-else>\n <div\n v-if=\"isLoading\"\n class=\"dropdownmenum-panel-loading\"\n >\n <cl-load size=\"small\"></cl-load>\n </div>\n <template v-else>\n <ul\n v-if=\"optIsShowOptions\"\n class=\"dropdownmenum-options\"\n >\n <li\n v-for=\"(optionItem, inx) in optionsList\"\n :key=\"`${_keyIndex}-${inx}`\"\n :class=\"clsOption(optionItem)\"\n @click=\"onClickOption(optionItem)\"\n >\n <span class=\"dropdownmenum-option-text\">{{ optOptionText(optionItem) }}</span>\n <cl-icon-font\n v-if=\"optIsSelected(optionItem)\"\n class=\"dropdownmenum-option-check\"\n name=\"check\"\n ></cl-icon-font>\n <template v-else></template>\n </li>\n </ul>\n <template v-else></template>\n </template>\n </template>\n </div>\n </Transition>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, inject, onBeforeUnmount, onMounted, ref, useSlots, type PropType } from 'vue';\nimport CommonBase from '../../Common/base';\nimport CommonElement from '../../Common/Element/index';\nimport ClIconFont from '../../Element/IconFont/Index.vue';\nimport ClLoad from '../../Element/Load/Index.vue';\nimport type { DropdownMenuMTop } from './Index.vue';\nimport './Index.css';\n\n// 选项数据结构\nexport interface DropdownMenuItemOption {\n text?: string;\n value?: string | number;\n disabled?: boolean;\n className?: string;\n [key: string]: unknown;\n}\n\ndefineOptions({ name: 'ClDropdownMenuMItem' });\n\n// props\nconst props = defineProps({\n id: String, // desc: 组件实例唯一标识,用于多实例场景下 DOM 查询限定\n className: String, // desc: 自定义CSS类名\n title: String, // desc: 菜单项标题文本\n modelValue: {\n type: [String, Number] as PropType<string | number>,\n default: undefined, // desc: 当前选中项对应的值,支持 v-model\n },\n optionsList: {\n type: Array as PropType<DropdownMenuItemOption[]>,\n default: () => [], // desc: 选项列表(含 text/value/disabled 字段)\n },\n optionLabel: {\n type: String,\n default: 'text', // desc: 选项展示文案字段名\n },\n optionValue: {\n type: String,\n default: 'value', // desc: 选项值字段名\n },\n disabled: Boolean, // desc: 是否禁用该菜单项\n isLoading: Boolean, // desc: 是否显示加载中状态\n});\n\n// emit\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: string | number | undefined): void; // desc: 选中值变化(支持 v-model)\n (e: 'onChange', value: string | number | undefined): void; // desc: 选中项变化时触发\n}>();\n\n// slots: title(自定义标题), default(自定义下拉内容)\n\nconst elId = props.id; // || `dropdownmenum-item-${CommonBase.getRandom(8)}`\nconst _keyIndex = `dropdownmenumItem-${CommonBase.getRandom(5)}`;\n\nconst _selfTop = inject<DropdownMenuMTop>('$DropdownMenuMTop');\nconst _slots = useSlots();\n\n// 本子项在容器中的序号(挂载时注册获得)\nconst _selfIndex = ref(-1);\n\n// computed\nconst optIsActive = computed(() => _selfIndex.value !== -1 && _selfTop?.activeIndex.value === _selfIndex.value);\n\nconst optDirection = computed(() => _selfTop?.direction.value || 'down');\n\n// 箭头方向:收起时指向展开方向(down→下、up→上),展开时翻转(可收起)\nconst optArrowName = computed(() => {\n const expandUp = optDirection.value === 'up';\n if (optIsActive.value) {\n return expandUp ? 'caret-down' : 'caret-up';\n }\n return expandUp ? 'caret-up' : 'caret-down';\n});\n\nconst optDuration = computed(() => (_selfTop?.duration.value || 200));\n\nconst optHasDefaultSlot = computed(() => !!_slots.default);\n\nconst optIsShowOptions = computed(\n () => Array.isArray(props.optionsList) && props.optionsList.length > 0,\n);\n\nconst optIsShowPanel = computed(() => optIsActive.value && !props.disabled);\n\nconst optIsSelected = (optionItem: DropdownMenuItemOption): boolean => {\n return optionItem[props.optionValue] === props.modelValue;\n};\n\nconst optOptionText = (optionItem: DropdownMenuItemOption): string => {\n const raw = optionItem[props.optionLabel];\n return CommonBase.isString(raw) ? (raw as string) : CommonBase.isNumber(raw) ? String(raw) : '';\n};\n\n// 标题文本:显式传入 title 时固定显示;未传 title 时跟随当前选中项的 text(Vant 同款行为)\nconst optTitleText = computed(() => {\n if (CommonBase.isNonEmptyString(props.title)) {\n return props.title as string;\n }\n if (CommonBase.isEmpty(props.modelValue)) return '';\n const found = (props.optionsList || []).find(\n optionItem => optionItem[props.optionValue] === props.modelValue,\n );\n return found ? optOptionText(found) : '';\n});\n\nconst clsItem = computed(() => {\n const clsTemp: Record<string, boolean> = {\n 'dropdownmenum-item': true,\n 'dropdownmenum-item--disabled': props.disabled,\n };\n return CommonBase.getJsonMerge(clsTemp, CommonElement.getClassNameJson(props.className));\n});\n\nconst styTitle = computed(() =>\n optIsActive.value && _selfTop\n ? { color: _selfTop.activeColor.value }\n : undefined,\n);\n\nconst styPanel = computed(() => ({\n zIndex: (_selfTop?.zIndex.value || 2000),\n '--dropdownmenum-duration': `${optDuration.value}ms`,\n}));\n\nconst clsOption = (optionItem: DropdownMenuItemOption) => {\n const clsTemp: Record<string, boolean> = {\n 'dropdownmenum-option': true,\n 'dropdownmenum-option--disabled': !!optionItem.disabled,\n 'dropdownmenum-option--selected': optIsSelected(optionItem),\n };\n return CommonBase.getJsonMerge(clsTemp, CommonElement.getClassNameJson(optionItem.className));\n};\n\n// 生命周期\nonMounted(() => {\n if (!_selfTop) {\n console.warn('[ClDropdownMenuMItem] 警告:必须放置在 cl-dropdown-menu-m 容器内使用');\n return;\n }\n _selfIndex.value = _selfTop.registerItem();\n});\n\nonBeforeUnmount(() => {\n // 仅当卸载的是当前激活项时才收起,避免误关闭其他展开项\n if (_selfTop && _selfIndex.value !== -1 && _selfTop.activeIndex.value === _selfIndex.value) {\n _selfTop.setActiveIndex(-1);\n }\n});\n\n// 事件方法\nconst onClickTitle = () => {\n if (props.disabled || !_selfTop) return;\n _selfTop.toggleItem(_selfIndex.value);\n};\n\nconst onClickOption = (optionItem: DropdownMenuItemOption) => {\n if (optionItem.disabled) return;\n const value = optionItem[props.optionValue] as string | number | undefined;\n emit('update:modelValue', value);\n emit('onChange', value);\n _selfTop?.setActiveIndex(-1);\n};\n</script>\n"],"names":["props","__props","emit","__emit","elId","_keyIndex","CommonBase","_selfTop","inject","_slots","useSlots","_selfIndex","ref","optIsActive","computed","optDirection","optArrowName","expandUp","optDuration","optHasDefaultSlot","optIsShowOptions","optIsShowPanel","optIsSelected","optionItem","optOptionText","raw","optTitleText","found","clsItem","clsTemp","CommonElement","styTitle","styPanel","clsOption","onMounted","onBeforeUnmount","onClickTitle","onClickOption","value","_createElementBlock","_unref","_createElementVNode","_normalizeClass","_hoisted_2","_renderSlot","_ctx","_createVNode","ClIconFont","_Transition","_Fragment","_openBlock","_hoisted_3","ClLoad","_hoisted_4","_renderList","inx","$event","_hoisted_6","_toDisplayString","_createBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,UAAMA,IAAQC,GAyBRC,IAAOC,GAOPC,IAAOJ,EAAM,IACbK,IAAY,qBAAqBC,EAAW,UAAU,CAAC,CAAC,IAExDC,IAAWC,EAAyB,mBAAmB,GACvDC,IAASC,EAAA,GAGTC,IAAaC,EAAI,EAAE,GAGnBC,IAAcC,EAAS,MAAMH,EAAW,UAAU,MAAMJ,GAAU,YAAY,UAAUI,EAAW,KAAK,GAExGI,IAAeD,EAAS,MAAMP,GAAU,UAAU,SAAS,MAAM,GAGjES,IAAeF,EAAS,MAAM;AAClC,YAAMG,IAAWF,EAAa,UAAU;AACxC,aAAIF,EAAY,QACPI,IAAW,eAAe,aAE5BA,IAAW,aAAa;AAAA,IACjC,CAAC,GAEKC,IAAcJ,EAAS,MAAOP,GAAU,SAAS,SAAS,GAAI,GAE9DY,IAAoBL,EAAS,MAAM,CAAC,CAACL,EAAO,OAAO,GAEnDW,IAAmBN;AAAA,MACvB,MAAM,MAAM,QAAQd,EAAM,WAAW,KAAKA,EAAM,YAAY,SAAS;AAAA,IAAA,GAGjEqB,IAAiBP,EAAS,MAAMD,EAAY,SAAS,CAACb,EAAM,QA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A,UAAY,KAAA,CAAA,CAAA;AAAA,YAChD,SAAOiB,EAAA,KAAQ;AAAA,UAAA;YAEAb,EAAA,QACdyB,EAAaC,EAAA,QAAA,WAAA,EAAA,KAAA,EAAA,CAAA,UAEfN,EA6BWU,GAAA,EAAA,KAAA,KAAA;AAAA,cA3BDhD,EAAA,aADRiD,EAAA,GAAAX,EAKM,OALNY,IAKM;AAAA,gBADJL,EAAgCM,IAAA,EAAvB,MAAK,SAAO;AAAA,cAAA,YAEvBb,EAqBWU,GAAA,EAAA,KAAA,KAAA;AAAA,gBAnBD7B,EAAA,SADR8B,EAAA,GAAAX,EAkBK,MAlBLc,IAkBK;AAAA,mBAdHH,EAAA,EAAA,GAAAX,EAaKU,GAAA,MAAAK,EAZyBrD,EAAA,aAAW,CAA/BsB,GAAYgC,YADtBhB,EAaK,MAAA;AAAA,oBAXF,KAAG,GAAKlC,CAAS,IAAIkD,CAAG;AAAA,oBACxB,OAAKb,EAAET,EAAUV,CAAU,CAAA;AAAA,oBAC3B,SAAK,CAAAiC,OAAEnB,EAAcd,CAAU;AAAA,kBAAA;oBAEhCkB,EAA8E,QAA9EgB,IAA8EC,EAAnClC,EAAcD,CAAU,CAAA,GAAA,CAAA;AAAA,oBAE3DD,EAAcC,CAAU,UADhCoC,EAIgBZ,GAAA;AAAA;sBAFd,OAAM;AAAA,sBACN,MAAK;AAAA,oBAAA,YAEPR,EAA4BU,GAAA,EAAA,KAAA,EAAA,GAAA,CAAA,GAAA,EAAA;AAAA,kBAAA;4BAGhCV,EAA4BU,GAAA,EAAA,KAAA,EAAA,GAAA,CAAA,GAAA,EAAA;AAAA,cAAA;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";const e=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CFzimlB_.js");module.exports=e._sfc_main;
|
|
2
2
|
//# sourceMappingURL=ClPicker.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),c=require("../Shared/base-C2QOJBgB.js"),d=require("../Shared/day-DsoTTeo8.js"),Q=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CET_xKsO.js"),L=require("../Shared/Index.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";const n=require("vue"),c=require("../Shared/base-C2QOJBgB.js"),d=require("../Shared/day-DsoTTeo8.js"),Q=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CET_xKsO.js"),L=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CFzimlB_.js"),W=n.defineComponent({name:"ClPickerDate",__name:"Index",props:{id:String,value:{type:Array,default:()=>[]},className:String,show:Boolean,isPoppable:{type:Boolean,default:!0},columnsTypeArr:{type:Array,default:()=>["year","month","day"],validator:h=>h.length>0&&h.every(x=>["year","month","day"].indexOf(x)!==-1)&&new Set(h).size===h.length},minDate:{type:Date,default:()=>d.CommDay.objDay().subtract(10,"year").startOf("day").toDate()},maxDate:{type:Date,default:()=>d.CommDay.objDay().add(10,"year").startOf("day").toDate()},title:String,confirmButtonText:{type:String,default:"确认"},cancelButtonText:{type:String,default:"取消"},isShowToolbar:{type:Boolean,default:!0},isLoading:Boolean,isReadonly:Boolean,isAllowHtml:Boolean,optionHeight:{type:Number,default:44},visibleOptionNum:{type:Number,default:6},swipeDuration:{type:Number,default:1e3}},emits:["update:value","update:show","onConfirm","onCancel","onChange"],setup(h,{expose:x,emit:R}){const t=h,g=R,M=t.id,i=n.ref([]),y=n.ref(t.show),m=n.ref(null),D=(()=>{if(!Array.isArray(t.columnsTypeArr)||t.columnsTypeArr.length===0)return["year","month","day"];const e=t.columnsTypeArr.filter(a=>a==="year"||a==="month"||a==="day");return e.length>0?[...new Set(e)]:["year","month","day"]})(),z=n.computed(()=>t.isPoppable),U=n.computed(()=>J()),O=n.computed(()=>({value:i.value,columnsList:U.value,title:t.title,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText,isShowToolbar:t.isShowToolbar,isLoading:t.isLoading,isReadonly:t.isReadonly,isAllowHtml:t.isAllowHtml,optionHeight:t.optionHeight,visibleOptionNum:t.visibleOptionNum,swipeDuration:t.swipeDuration})),$=n.computed(()=>c.CommonBase.isNonEmptyString(t.className)?t.className:""),V=n.computed(()=>c.CommonBase.isNonEmptyString(t.className)?t.className:""),b=e=>Array.isArray(e)&&e.length===D.length&&e.every(a=>c.CommonBase.isString(a)||c.CommonBase.isNumber(a)&&c.CommonBase.isFinite(a)),C=e=>String(e).padStart(2,"0"),G=(e,a)=>d.CommDay.objDay({year:e,month:a-1,day:1}).daysInMonth(),A=()=>t.minDate instanceof Date&&!c.CommonBase.isNaN(t.minDate.getTime())?t.minDate:d.CommDay.objDay().subtract(10,"year").startOf("day").toDate(),S=()=>t.maxDate instanceof Date&&!c.CommonBase.isNaN(t.maxDate.getTime())?t.maxDate:d.CommDay.objDay().add(10,"year").startOf("day").toDate(),k=()=>{let e=A(),a=S();if(e.getTime()>a.getTime()){const r=e;e=a,a=r}const u=d.CommDay.objDay().valueOf(),f=Math.max(e.getTime(),Math.min(u,a.getTime())),p=d.CommDay.objDay(f),v={year:String(p.year()),month:C(p.month()+1),day:C(p.date())};return D.map(r=>v[r])},P=()=>{const e=t.value;b(e)?i.value=[...e]:i.value=k()},J=()=>{let e=A(),a=S();if(e.getTime()>a.getTime()){const l=e;e=a,a=l}const u=e.getFullYear(),f=a.getFullYear(),p=l=>{const s=D.indexOf(l);if(s===-1){const N=d.CommDay.objDay();return l==="year"?N.year():l==="month"?N.month()+1:N.date()}const o=Number(i.value[s]);return c.CommonBase.isFinite(o)?o:Number(k()[s])},v=(l,s,o)=>Math.max(s,Math.min(l,o)),r=v(p("year"),u,f),w=r===u?e.getMonth()+1:1,H=r===f?a.getMonth()+1:12,q=v(p("month"),w,H),B=D.indexOf("month")!==-1?q:r===f?a.getMonth()+1:e.getMonth()+1,Y=G(r,B),T=r===u&&B===e.getMonth()+1?e.getDate():1,F=r===f&&B===a.getMonth()+1?Math.min(a.getDate(),Y):Y,K=v(p("day"),T,F),_=[];return D.forEach(l=>{if(l==="year"){const s=[];for(let o=u;o<=f;o++)s.push(String(o));_.push({values:s,defaultIndex:r-u})}else if(l==="month"){const s=[];for(let o=w;o<=H;o++)s.push(C(o));_.push({values:s,defaultIndex:q-w})}else if(l==="day"){const s=[];for(let o=T;o<=F;o++)s.push(C(o));_.push({values:s,defaultIndex:K-T})}}),_};P(),n.watch(()=>t.show,e=>{if(e){const a=t.value;b(a)&&P(),y.value=!0}else y.value=!1},{immediate:!0}),n.watch(y,e=>{g("update:show",e)}),n.watch(()=>t.value,e=>{b(e)&&(i.value=[...e])},{deep:!0});const I=e=>{i.value=[...e.selectedValues],g("onChange",e)},j=e=>{g("update:value",[...e.selectedValues]),g("onConfirm",e),t.isPoppable&&(y.value=!1)},E=e=>{Array.isArray(t.value)&&(i.value=[...t.value]),g("onCancel",e),t.isPoppable&&(y.value=!1)};return x({getValue:()=>m.value?[...m.value.getValue()]:[...i.value],setValue:e=>{Array.isArray(e)&&(i.value=[...e],m.value?.setValue?.(e))},getValueData:()=>m.value?m.value.getValueData():[],confirm:()=>{m.value?.confirm()}}),(e,a)=>z.value?(n.openBlock(),n.createBlock(Q._sfc_main,{key:0,show:y.value,"onUpdate:show":a[0]||(a[0]=u=>y.value=u),position:"bottom",isRound:!0,isCloseOnClickOverlay:!1,className:$.value},{default:n.withCtx(()=>[n.createVNode(L._sfc_main,n.mergeProps({id:n.unref(M),ref_key:"refElPicker",ref:m,class:V.value},O.value,{onOnChange:I,onOnConfirm:j,onOnCancel:E}),null,16,["id","class"])]),_:1},8,["show","className"])):(n.openBlock(),n.createBlock(L._sfc_main,n.mergeProps({key:1,id:n.unref(M),ref_key:"refElPicker",ref:m,class:V.value},O.value,{onOnChange:I,onOnConfirm:j,onOnCancel:E}),null,16,["id","class"]))}});module.exports=W;
|
|
2
2
|
//# sourceMappingURL=ClPickerDate.cjs.map
|
|
@@ -2,7 +2,7 @@ import { defineComponent as ae, ref as O, computed as D, watch as V, openBlock a
|
|
|
2
2
|
import { C as c } from "../Shared/base-DU7nGSf6.js";
|
|
3
3
|
import { C as m } from "../Shared/day-DUeF3BZu.js";
|
|
4
4
|
import { _ as se } from "../Shared/Index.vue_vue_type_script_setup_true_lang-BlJJqne4.js";
|
|
5
|
-
import { _ as J } from "../Shared/Index.vue_vue_type_script_setup_true_lang-
|
|
5
|
+
import { _ as J } from "../Shared/Index.vue_vue_type_script_setup_true_lang-huUkL0wY.js";
|
|
6
6
|
const ye = /* @__PURE__ */ ae({
|
|
7
7
|
name: "ClPickerDate",
|
|
8
8
|
__name: "Index",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const t=require("vue"),a=require("../Shared/base-C2QOJBgB.js"),z=require("../Shared/day-DsoTTeo8.js"),ee=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CET_xKsO.js"),U=require("../Shared/Index.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";const t=require("vue"),a=require("../Shared/base-C2QOJBgB.js"),z=require("../Shared/day-DsoTTeo8.js"),ee=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CET_xKsO.js"),U=require("../Shared/Index.vue_vue_type_script_setup_true_lang-CFzimlB_.js"),ne=t.defineComponent({name:"ClPickerTime",__name:"Index",props:{id:String,value:{type:Array,default:()=>[]},className:String,show:Boolean,isPoppable:{type:Boolean,default:!0},columnsTypeArr:{type:Array,default:()=>["hour","minute"],validator:d=>d.length>0&&d.every(y=>["hour","minute","second"].indexOf(y)!==-1)&&new Set(d).size===d.length},minHour:{type:Number,default:0},maxHour:{type:Number,default:23},minMinute:{type:Number,default:0},maxMinute:{type:Number,default:59},minSecond:{type:Number,default:0},maxSecond:{type:Number,default:59},title:String,confirmButtonText:{type:String,default:"确认"},cancelButtonText:{type:String,default:"取消"},isShowToolbar:{type:Boolean,default:!0},isLoading:Boolean,isReadonly:Boolean,isAllowHtml:Boolean,optionHeight:{type:Number,default:44},visibleOptionNum:{type:Number,default:6},swipeDuration:{type:Number,default:1e3}},emits:["update:value","update:show","onConfirm","onCancel","onChange"],setup(d,{expose:y,emit:G}){const e=d,f=G,B=e.id,r=t.ref([]),l=t.ref(e.show),m=t.ref(null),h=(()=>{if(!Array.isArray(e.columnsTypeArr)||e.columnsTypeArr.length===0)return["hour","minute"];const n=e.columnsTypeArr.filter(o=>o==="hour"||o==="minute"||o==="second");return n.length>0?[...new Set(n)]:["hour","minute"]})(),J=t.computed(()=>e.isPoppable),K=t.computed(()=>W()),w=t.computed(()=>({value:r.value,columnsList:K.value,title:e.title,confirmButtonText:e.confirmButtonText,cancelButtonText:e.cancelButtonText,isShowToolbar:e.isShowToolbar,isLoading:e.isLoading,isReadonly:e.isReadonly,isAllowHtml:e.isAllowHtml,optionHeight:e.optionHeight,visibleOptionNum:e.visibleOptionNum,swipeDuration:e.swipeDuration})),Q=t.computed(()=>a.CommonBase.isNonEmptyString(e.className)?e.className:""),H=t.computed(()=>a.CommonBase.isNonEmptyString(e.className)?e.className:""),x=n=>Array.isArray(n)&&n.length===h.length&&[...n].every(o=>a.CommonBase.isString(o)?/^\d{1,2}$/.test(o):a.CommonBase.isNumber(o)&&a.CommonBase.isFinite(o)),p=n=>String(n).padStart(2,"0"),V=()=>a.CommonBase.isFinite(e.minHour)&&Number.isInteger(e.minHour)&&e.minHour>=0&&e.minHour<=23?e.minHour:0,I=()=>a.CommonBase.isFinite(e.maxHour)&&Number.isInteger(e.maxHour)&&e.maxHour>=0&&e.maxHour<=23?e.maxHour:23,k=()=>a.CommonBase.isFinite(e.minMinute)&&Number.isInteger(e.minMinute)&&e.minMinute>=0&&e.minMinute<=59?e.minMinute:0,P=()=>a.CommonBase.isFinite(e.maxMinute)&&Number.isInteger(e.maxMinute)&&e.maxMinute>=0&&e.maxMinute<=59?e.maxMinute:59,T=()=>a.CommonBase.isFinite(e.minSecond)&&Number.isInteger(e.minSecond)&&e.minSecond>=0&&e.minSecond<=59?e.minSecond:0,A=()=>a.CommonBase.isFinite(e.maxSecond)&&Number.isInteger(e.maxSecond)&&e.maxSecond>=0&&e.maxSecond<=59?e.maxSecond:59,O=()=>{const n=z.CommDay.objDay(),o={hour:p(n.hour()),minute:p(n.minute()),second:p(n.second())};return h.map(c=>o[c])},D=()=>{const n=e.value;x(n)?r.value=[...n]:r.value=O()},W=()=>{const n=Math.min(V(),I()),o=Math.max(V(),I()),c=Math.min(k(),P()),_=Math.max(k(),P()),X=Math.min(T(),A()),Y=Math.max(T(),A()),C=s=>{const i=h.indexOf(s);if(i===-1){const S=z.CommDay.objDay();return s==="hour"?S.hour():s==="minute"?S.minute():S.second()}const u=Number(r.value[i]);return a.CommonBase.isFinite(u)?u:Number(O()[i])},M=(s,i,u)=>Math.max(i,Math.min(s,u)),g=M(C("hour"),n,o),b=g===n?c:0,L=g===o?_:59,R=M(C("minute"),b,L),j=h.indexOf("minute")!==-1?R:g===o?_:c,N=j===c?X:0,$=j===_?Y:59,Z=M(C("second"),N,$),v=[];return h.forEach(s=>{if(s==="hour"){const i=[];for(let u=n;u<=o;u++)i.push(p(u));v.push({values:i,defaultIndex:g-n})}else if(s==="minute"){const i=[];for(let u=b;u<=L;u++)i.push(p(u));v.push({values:i,defaultIndex:R-b})}else if(s==="second"){const i=[];for(let u=N;u<=$;u++)i.push(p(u));v.push({values:i,defaultIndex:Z-N})}}),v};D(),t.watch(()=>e.show,n=>{if(n){const o=e.value;x(o)&&D(),l.value=!0}else l.value=!1},{immediate:!0}),t.watch(l,n=>{f("update:show",n)}),t.watch(()=>e.value,n=>{x(n)&&(r.value=[...n])},{immediate:!0,deep:!0});const F=n=>{r.value=[...n.selectedValues],f("onChange",n)},E=n=>{f("update:value",[...n.selectedValues]),f("onConfirm",n),e.isPoppable&&(l.value=!1)},q=n=>{f("onCancel",n),e.isPoppable&&(l.value=!1)};return y({getValue:()=>m.value?[...m.value.getValue()]:[...r.value],setValue:n=>{x(n)&&(r.value=[...n],m.value?.setValue?.(n))},getValueData:()=>m.value?m.value.getValueData():[],confirm:()=>{m.value?.confirm()}}),(n,o)=>J.value?(t.openBlock(),t.createBlock(ee._sfc_main,{key:0,show:l.value,"onUpdate:show":o[0]||(o[0]=c=>l.value=c),position:"bottom",isRound:!0,isCloseOnClickOverlay:!1,className:Q.value},{default:t.withCtx(()=>[t.createVNode(U._sfc_main,t.mergeProps({id:t.unref(B),ref_key:"refElPicker",ref:m,className:H.value},w.value,{onOnChange:F,onOnConfirm:E,onOnCancel:q}),null,16,["id","className"])]),_:1},8,["show","className"])):(t.openBlock(),t.createBlock(U._sfc_main,t.mergeProps({key:1,id:t.unref(B),ref_key:"refElPicker",ref:m,className:H.value},w.value,{onOnChange:F,onOnConfirm:E,onOnCancel:q}),null,16,["id","className"]))}});module.exports=ne;
|
|
2
2
|
//# sourceMappingURL=ClPickerTime.cjs.map
|