maz-ui 4.0.0-beta.3 → 4.0.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/assets/MazAccordion.DUQCf8vy.css +1 -0
- package/dist/assets/{MazAnimatedCounter.CTG-PC5W.css → MazAnimatedCounter.DkZNPRLp.css} +1 -1
- package/dist/assets/MazAnimatedText.DDqCxrFX.css +1 -0
- package/dist/assets/MazBackdrop.BnhcmjbP.css +1 -0
- package/dist/assets/{MazBadge.DN8tdE8_.css → MazBadge.ChI2DaTU.css} +1 -1
- package/dist/assets/MazBtn.BYOKMl_2.css +1 -0
- package/dist/assets/MazCard.D0ksni8A.css +1 -0
- package/dist/assets/{MazCardSpotlight.Dy-wuLQq.css → MazCardSpotlight.IbPp_y0j.css} +1 -1
- package/dist/assets/MazCarousel.D4zTkRsG.css +1 -0
- package/dist/assets/MazCheckbox.aH1IKnrR.css +1 -0
- package/dist/assets/MazChecklist.BzF5KtZ3.css +1 -0
- package/dist/assets/MazDatePicker.BUVI9tfN.css +1 -0
- package/dist/assets/MazDropzone.C2SunLAI.css +1 -0
- package/dist/assets/MazInput.BPhjbYZG.css +1 -0
- package/dist/assets/MazInputCode.FA2z4HQd.css +1 -0
- package/dist/assets/MazInputPhoneNumber.DQKElfIM.css +1 -0
- package/dist/assets/MazInputTags.KNTpDHof.css +1 -0
- package/dist/assets/MazLazyImg.NlPRN3Nk.css +1 -0
- package/dist/assets/MazLink.CFscNMFr.css +1 -0
- package/dist/assets/MazPickerCalendar.e-eF8E7m.css +1 -0
- package/dist/assets/MazPickerCalendarMonth.BRoEh_ad.css +1 -0
- package/dist/assets/{MazPickerCalendarSwitcher.uni8vJJv.css → MazPickerCalendarSwitcher.CI9Vw1sJ.css} +1 -1
- package/dist/assets/{MazPickerContainer.k3DGjyHC.css → MazPickerContainer.DmHuaFqE.css} +1 -1
- package/dist/assets/{MazPickerHeader.ZYCJY5bX.css → MazPickerHeader.C4W93yMD.css} +1 -1
- package/dist/assets/MazPickerMonthSwitcher.D9lfVzYo.css +1 -0
- package/dist/assets/{MazPickerYearSwitcher.Dl30Dwor.css → MazPickerYearSwitcher.CFiH13QC.css} +1 -1
- package/dist/assets/MazPopover.B3kR2Gsa.css +1 -0
- package/dist/assets/MazPullToRefresh.BQ64UvzA.css +1 -0
- package/dist/assets/MazRadio.aTHM-mpx.css +1 -0
- package/dist/assets/MazRadioButtons.DN_rAzT9.css +1 -0
- package/dist/assets/MazReadingProgressBar.CwBVXE3g.css +1 -0
- package/dist/assets/MazSelect.DuRAHZGW.css +1 -0
- package/dist/assets/{MazSelectCountry.D2Qudf0K.css → MazSelectCountry.EW8fKXFX.css} +1 -1
- package/dist/assets/{MazSlider.D5SgmZLH.css → MazSlider.y4qpnD0N.css} +1 -1
- package/dist/assets/MazSpinner.CsiFJ1DS.css +1 -0
- package/dist/assets/MazStepper.BD2gDGAX.css +1 -0
- package/dist/assets/MazSwitch.Bxmh2iFj.css +1 -0
- package/dist/assets/{MazTable.B1tkeUfE.css → MazTable.DMlQdImb.css} +1 -1
- package/dist/assets/MazTableRow.DgBXpK9J.css +1 -0
- package/dist/assets/{MazTabsBar.B9N_jdqU.css → MazTabsBar.gcS2Fc-B.css} +1 -1
- package/dist/assets/{MazTabsContentItem.CHfy19ZF.css → MazTabsContentItem.C84SDmj0.css} +1 -1
- package/dist/assets/MazTextarea.li9dWBax.css +1 -0
- package/dist/assets/{PhoneInput.CyWO76iq.css → PhoneInput.DCWA_-gC.css} +1 -1
- package/dist/assets/{fullscreen-img.pvt6196l.css → fullscreen-img.Bkuz1GOX.css} +1 -1
- package/dist/assets/{toast.kunueRvo.css → toast.DH9mbkvs.css} +1 -1
- package/dist/chunks/{MazDatePicker.CT5yJhSN.js → MazDatePicker.bKFpslPf.js} +54 -44
- package/dist/chunks/{MazDialogPromise.vue_vue_type_script_setup_true_lang.BQvDEofz.js → MazDialogConfirm.vue_vue_type_script_setup_true_lang.Grn2kB3x.js} +78 -18
- package/dist/chunks/{MazDropdown.vue_vue_type_style_index_0_lang.abk1IbMX.js → MazDropdown.vue_vue_type_style_index_0_lang.X8ygqBUZ.js} +22 -27
- package/dist/chunks/{MazInputPhoneNumber.Uwhn1Q9j.js → MazInputPhoneNumber.BVHi0OiN.js} +28 -18
- package/dist/chunks/{MazInputPrice.vue_vue_type_script_setup_true_lang.GMKzSu7R.js → MazInputPrice.vue_vue_type_script_setup_true_lang.BA6TDX-T.js} +31 -1
- package/dist/chunks/{MazPickerCalendar.RS6ZMdDK.js → MazPickerCalendar.lLfvUtrb.js} +8 -8
- package/dist/chunks/{MazPickerCalendarMonth.hQBSVkc9.js → MazPickerCalendarMonth.Djzgo1tF.js} +9 -9
- package/dist/chunks/{MazPickerCalendarSwitcher.Cp2ux3E4.js → MazPickerCalendarSwitcher.Bf24kKw6.js} +3 -3
- package/dist/chunks/{MazPickerContainer.DnfB3Dqg.js → MazPickerContainer.7hYHiOaa.js} +4 -6
- package/dist/chunks/{MazPickerHeader.Dlz2yJ1D.js → MazPickerHeader.B00RAQPS.js} +3 -3
- package/dist/chunks/{MazPickerMonthSwitcher.BpfCGGxQ.js → MazPickerMonthSwitcher.B2ZgNJWy.js} +5 -6
- package/dist/chunks/{MazPickerTime.EuWWNfid.js → MazPickerTime.Bd4khA2e.js} +1 -1
- package/dist/chunks/{MazPickerYearSwitcher.D4aO09D3.js → MazPickerYearSwitcher.BIy9xGIw.js} +8 -27
- package/dist/chunks/{MazSwitch.vue_vue_type_style_index_0_lang.DnCjlD6D.js → MazSwitch.vue_vue_type_style_index_0_lang.CU43Y1ky.js} +2 -2
- package/dist/chunks/{MazTable.vue_vue_type_script_setup_true_lang.bm7ng8fK.js → MazTable.vue_vue_type_script_setup_true_lang.BcTw9Tyh.js} +3 -3
- package/dist/chunks/{PhoneInput.CPjyZ8Sq.js → PhoneInput.D9vRIgS6.js} +21 -27
- package/dist/chunks/{utils.BBuYjMbK.js → dom-events.Bbe7wDQl.js} +221 -115
- package/dist/chunks/{en.BzBlrE0C.js → en.Q_4-KljL.js} +12 -0
- package/dist/chunks/{fullscreen-img.directive.CyOHexcO.js → fullscreen-img.directive.Be383en8.js} +2 -2
- package/dist/chunks/{lazy-img.directive.D5zCo3Zi.js → lazy-img.directive.BLFnGqQa.js} +1 -1
- package/dist/chunks/pascalCase.GdDKKQ-O.js +19 -0
- package/dist/chunks/types.D0Bp_UhS.js +6 -0
- package/dist/chunks/useStringMatching.BBezu-6J.js +134 -0
- package/dist/chunks/{useTranslations.BXuww4ux.js → useTranslations.D5aoYwD7.js} +1 -1
- package/dist/chunks/vClickOutside.DIOiluy0.js +107 -0
- package/dist/components/MazAccordion.js +2 -2
- package/dist/components/MazAnimatedCounter.js +3 -3
- package/dist/components/MazAnimatedText.js +2 -2
- package/dist/components/MazBackdrop.js +3 -3
- package/dist/components/MazBadge.js +5 -4
- package/dist/components/MazBtn.js +9 -7
- package/dist/components/MazCard.js +2 -2
- package/dist/components/MazCardSpotlight.js +4 -4
- package/dist/components/MazCarousel.js +12 -9
- package/dist/components/MazCheckbox.js +10 -12
- package/dist/components/MazChecklist.js +4 -5
- package/dist/components/MazDatePicker.js +1 -1
- package/dist/components/MazDialogConfirm.js +6 -0
- package/dist/components/MazDropdown.js +1 -1
- package/dist/components/MazDropzone.js +5 -5
- package/dist/components/MazGallery.js +2 -2
- package/dist/components/MazInput.js +21 -16
- package/dist/components/MazInputCode.js +2 -2
- package/dist/components/MazInputPhoneNumber.js +1 -1
- package/dist/components/MazInputPrice.js +1 -1
- package/dist/components/MazInputTags.js +2 -2
- package/dist/components/MazLazyImg.js +9 -9
- package/dist/components/MazLink.js +9 -5
- package/dist/components/MazPagination.js +1 -1
- package/dist/components/MazPopover.js +124 -162
- package/dist/components/MazPullToRefresh.js +8 -3
- package/dist/components/MazRadio.js +8 -16
- package/dist/components/MazRadioButtons.js +8 -7
- package/dist/components/MazReadingProgressBar.js +10 -3
- package/dist/components/MazSelect.js +31 -18
- package/dist/components/MazSelectCountry.js +18 -11
- package/dist/components/MazSlider.js +2 -2
- package/dist/components/MazSpinner.js +3 -4
- package/dist/components/MazStepper.js +2 -2
- package/dist/components/MazSwitch.js +1 -1
- package/dist/components/MazTable.js +3 -3
- package/dist/components/MazTableCell.js +1 -1
- package/dist/components/MazTableRow.js +3 -3
- package/dist/components/MazTableTitle.js +1 -1
- package/dist/components/MazTabsBar.js +6 -6
- package/dist/components/MazTabsContentItem.js +6 -7
- package/dist/components/MazTextarea.js +24 -3
- package/dist/components/index.js +8 -8
- package/dist/composables/index.js +4 -2
- package/dist/composables/useAos.js +1 -1
- package/dist/composables/useDialog.js +1 -1
- package/dist/composables/useDisplayNames.js +17 -13
- package/dist/composables/useDropzone.js +7 -7
- package/dist/composables/useFormField.js +15 -19
- package/dist/composables/useFormValidator.js +58 -29
- package/dist/composables/useIdleTimeout.js +108 -1
- package/dist/composables/useInjectStrict.js +2 -2
- package/dist/composables/useInstanceUniqId.js +3 -2
- package/dist/composables/useStringMatching.js +3 -40
- package/dist/composables/useSwipe.js +77 -1
- package/dist/composables/useToast.js +1 -1
- package/dist/composables/useUserVisibility.js +47 -1
- package/dist/composables/useWait.js +1 -1
- package/dist/composables/useWindowSize.js +1 -1
- package/dist/css/main.css +1 -1
- package/dist/directives/index.js +7 -7
- package/dist/directives/vClickOutside.js +4 -102
- package/dist/directives/vFullscreenImg.js +1 -1
- package/dist/directives/vLazyImg.js +2 -2
- package/dist/directives/vTooltip.js +97 -62
- package/dist/index.js +1 -114
- package/dist/plugins/dialog.js +3 -3
- package/dist/plugins/maz-ui.js +235 -195
- package/dist/plugins/toast.js +13 -14
- package/dist/resolvers/MazComponentsResolver.js +1 -1
- package/dist/resolvers/MazDirectivesResolver.js +1 -1
- package/dist/resolvers/MazModulesResolver.js +6 -2
- package/dist/tailwindcss/tailwind.config.js +5 -2
- package/dist/tailwindcss/variables/design-tokens.js +3 -0
- package/dist/types/components/MazAccordion.vue.d.ts +15 -2
- package/dist/types/components/MazBtn.vue.d.ts +1 -0
- package/dist/types/components/MazCard.vue.d.ts +1 -1
- package/dist/types/components/MazCarousel.vue.d.ts +4 -1
- package/dist/types/components/MazCheckbox.vue.d.ts +0 -6
- package/dist/types/components/MazChecklist.vue.d.ts +1 -1
- package/dist/types/components/MazDatePicker/utils.d.ts +5 -4
- package/dist/types/components/MazDatePicker.vue.d.ts +39 -51
- package/dist/types/components/MazDialogConfirm/useMazDialogConfirm.d.ts +47 -0
- package/dist/types/components/{MazDialogPromise.vue.d.ts → MazDialogConfirm.vue.d.ts} +43 -10
- package/dist/types/components/MazDropdown.vue.d.ts +12 -12
- package/dist/types/components/MazInput.vue.d.ts +7 -0
- package/dist/types/components/MazInputNumber.vue.d.ts +4 -4
- package/dist/types/components/MazInputPhoneNumber/PhoneInput.vue.d.ts +1 -1
- package/dist/types/components/MazInputPhoneNumber/useLibphonenumber.d.ts +3 -3
- package/dist/types/components/MazInputPhoneNumber/useMazInputPhoneNumber.d.ts +8 -2
- package/dist/types/components/MazInputPhoneNumber.vue.d.ts +45 -23
- package/dist/types/components/MazInputPrice.vue.d.ts +3 -3
- package/dist/types/components/MazInputTags.vue.d.ts +1 -1
- package/dist/types/components/MazLazyImg.vue.d.ts +8 -8
- package/dist/types/components/MazLink.vue.d.ts +11 -0
- package/dist/types/components/MazPopover.vue.d.ts +26 -20
- package/dist/types/components/MazRadioButtons.vue.d.ts +9 -9
- package/dist/types/components/MazReadingProgressBar.vue.d.ts +1 -1
- package/dist/types/components/MazSelect.vue.d.ts +11 -4
- package/dist/types/components/MazSelectCountry.vue.d.ts +15 -6
- package/dist/types/components/MazStepper.vue.d.ts +13 -2
- package/dist/types/components/MazTable.vue.d.ts +63 -2
- package/dist/types/components/index.d.ts +4 -4
- package/dist/types/components/types.d.ts +1 -0
- package/dist/types/composables/index.d.ts +2 -1
- package/dist/types/composables/useDisplayNames.d.ts +3 -8
- package/dist/types/composables/useDropzone.d.ts +3 -3
- package/dist/types/composables/useFormField.d.ts +16 -56
- package/dist/types/composables/useFormValidator/config.d.ts +2 -2
- package/dist/types/composables/useFormValidator/dom-events.d.ts +19 -0
- package/dist/types/composables/useFormValidator/state-management.d.ts +72 -0
- package/dist/types/composables/useFormValidator/types.d.ts +20 -32
- package/dist/types/composables/useFormValidator/validation.d.ts +37 -0
- package/dist/types/composables/useFormValidator.d.ts +16 -10
- package/dist/types/composables/useIdleTimeout.d.ts +1 -1
- package/dist/types/composables/useInjectStrict.d.ts +1 -1
- package/dist/types/composables/useSwipe.d.ts +1 -1
- package/dist/types/composables/useUserVisibility.d.ts +1 -1
- package/dist/types/directives/vClickOutside.d.ts +11 -18
- package/dist/types/directives/vFullscreenImg/MazFullscreenImg.vue.d.ts +2 -2
- package/dist/types/directives/vFullscreenImg/fullscreen-img.directive.d.ts +3 -5
- package/dist/types/directives/vFullscreenImg.d.ts +9 -4
- package/dist/types/directives/vLazyImg/lazy-img.directive.d.ts +3 -5
- package/dist/types/directives/vLazyImg.d.ts +11 -6
- package/dist/types/directives/vTooltip.d.ts +14 -14
- package/dist/types/directives/vZoomImg/zoom-img.directive.d.ts +2 -0
- package/dist/types/directives/vZoomImg.d.ts +9 -5
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins/aos.d.ts +30 -4
- package/dist/types/plugins/dialog/DialogHandler.d.ts +2 -2
- package/dist/types/plugins/dialog.d.ts +2 -4
- package/dist/types/plugins/maz-ui.d.ts +2 -63
- package/dist/types/plugins/toast.d.ts +2 -4
- package/dist/types/plugins/wait.d.ts +2 -3
- package/dist/types/tailwindcss/tailwind.config.d.ts +5 -0
- package/dist/types/tailwindcss/variables/design-tokens.d.ts +3 -0
- package/package.json +38 -37
- package/dist/assets/MazAccordion.esK3rR4p.css +0 -1
- package/dist/assets/MazAnimatedText.BrOwWuqf.css +0 -1
- package/dist/assets/MazBackdrop.DNpnLh63.css +0 -1
- package/dist/assets/MazBtn.BnRxVlqS.css +0 -1
- package/dist/assets/MazCard.C6nDaeIC.css +0 -1
- package/dist/assets/MazCarousel.BaqN4hLP.css +0 -1
- package/dist/assets/MazCheckbox.C_qIngLy.css +0 -1
- package/dist/assets/MazChecklist.CWK_Gl-t.css +0 -1
- package/dist/assets/MazDatePicker.V5JwKPrQ.css +0 -1
- package/dist/assets/MazDropzone.DafxQwbq.css +0 -1
- package/dist/assets/MazInput.DW2KOJHY.css +0 -1
- package/dist/assets/MazInputCode.CG6EJBEk.css +0 -1
- package/dist/assets/MazInputPhoneNumber.vpA2mrZn.css +0 -1
- package/dist/assets/MazInputTags.B_s9J3sw.css +0 -1
- package/dist/assets/MazLazyImg.BNaVtpfX.css +0 -1
- package/dist/assets/MazLink.CCfbrUs0.css +0 -1
- package/dist/assets/MazPickerCalendar.CHpWIzhL.css +0 -1
- package/dist/assets/MazPickerCalendarMonth.zkrPVHDv.css +0 -1
- package/dist/assets/MazPickerMonthSwitcher.168v7Hs1.css +0 -1
- package/dist/assets/MazPopover.Bth9NWia.css +0 -1
- package/dist/assets/MazPullToRefresh.DABqbGtK.css +0 -1
- package/dist/assets/MazRadio.DKMFWwy_.css +0 -1
- package/dist/assets/MazRadioButtons.BA4rjgK9.css +0 -1
- package/dist/assets/MazReadingProgressBar.n1Is8_Y3.css +0 -1
- package/dist/assets/MazSelect.DZZpDg8z.css +0 -1
- package/dist/assets/MazSpinner.CP85N7RJ.css +0 -1
- package/dist/assets/MazStepper.DYMde9uq.css +0 -1
- package/dist/assets/MazSwitch.Z1ZMm7tx.css +0 -1
- package/dist/assets/MazTableRow.B78Bd4Kv.css +0 -1
- package/dist/assets/MazTextarea.Dz11mUeK.css +0 -1
- package/dist/chunks/TextareaAutogrow.C22LQx0k.js +0 -25
- package/dist/chunks/debounceCallback.B69vn57Q.js +0 -7
- package/dist/chunks/formatCurrency.C8NzW9Ii.js +0 -34
- package/dist/chunks/formatDate.DZ_OzdnV.js +0 -21
- package/dist/chunks/getCountryFlagUrl.dQjriBXx.js +0 -9
- package/dist/chunks/idleTimeout.-ICpdeGV.js +0 -111
- package/dist/chunks/isServer.BokzeB-Q.js +0 -6
- package/dist/chunks/isStandaloneMode.BpUpOTbA.js +0 -10
- package/dist/chunks/normalizeString.CFe2M8S_.js +0 -69
- package/dist/chunks/pascalCase.D_nuQ66I.js +0 -11
- package/dist/chunks/swipeHandler.8emelhOL.js +0 -80
- package/dist/chunks/throttle.DN8ARw0a.js +0 -11
- package/dist/chunks/throttleId.7PhWZjcS.js +0 -62
- package/dist/chunks/userVisibility.BbQSJASv.js +0 -50
- package/dist/chunks/x-mark.CTalOvvY.js +0 -23
- package/dist/components/MazDialogPromise.js +0 -6
- package/dist/types/components/MazDialogPromise/useMazDialogPromise.d.ts +0 -54
- package/dist/types/components/MazInputPhoneNumber/types.d.ts +0 -22
- package/dist/types/composables/useFormValidator/utils.d.ts +0 -116
- package/dist/chunks/{pristine.ylgbwjxO.js → pristine.CxBZzgUG.js} +4 -4
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, mergeModels, useAttrs, useTemplateRef,
|
|
1
|
+
import { defineComponent, mergeModels, useAttrs, useTemplateRef, computed, useModel, nextTick, watch, onMounted, onBeforeUnmount, onUnmounted, createElementBlock, openBlock, Fragment, createCommentVNode, createBlock, normalizeStyle, normalizeClass, unref, createElementVNode, mergeProps, renderSlot, Teleport, createVNode, Transition, withCtx, withDirectives } from "vue";
|
|
2
|
+
import { offset, hide, shift, autoPlacement, flip, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
2
3
|
import { i as isClient } from "../chunks/isClient.WI4oSt66.js";
|
|
3
|
-
import { t as throttle } from "../chunks/throttle.DN8ARw0a.js";
|
|
4
4
|
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
5
|
-
import {
|
|
5
|
+
import { d as directive } from "../chunks/vClickOutside.DIOiluy0.js";
|
|
6
|
+
import { g as getColor } from "../chunks/types.D0Bp_UhS.js";
|
|
6
7
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
7
|
-
import '../assets/MazPopover.
|
|
8
|
+
import '../assets/MazPopover.B3kR2Gsa.css';const _hoisted_1 = ["id", "aria-expanded", "aria-haspopup", "aria-describedby", "aria-labelledby"], _hoisted_2 = ["id", "role", "aria-label", "aria-labelledby", "aria-describedby", "aria-modal", "tabindex", "aria-live"], _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
9
|
name: "MazPopover",
|
|
9
10
|
inheritAttrs: !1,
|
|
10
11
|
__name: "MazPopover",
|
|
@@ -20,8 +21,8 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
20
21
|
disabled: { type: Boolean, default: !1 },
|
|
21
22
|
offset: { default: 8 },
|
|
22
23
|
delay: { default: 0 },
|
|
23
|
-
hoverDelay: { default:
|
|
24
|
-
transition: { default: "
|
|
24
|
+
hoverDelay: { default: 150 },
|
|
25
|
+
transition: { default: "scale-pop" },
|
|
25
26
|
teleportTo: { default: "body" },
|
|
26
27
|
overlayClass: {},
|
|
27
28
|
panelClass: {},
|
|
@@ -36,7 +37,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
36
37
|
trapFocus: { type: Boolean, default: !0 },
|
|
37
38
|
keepOpenOnHover: { type: Boolean, default: !1 },
|
|
38
39
|
block: { type: Boolean, default: !1 },
|
|
39
|
-
|
|
40
|
+
positionReference: {}
|
|
40
41
|
}, {
|
|
41
42
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
42
43
|
modelModifiers: {}
|
|
@@ -46,16 +47,49 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
46
47
|
const emits = __emit, triggerId = useInstanceUniqId({
|
|
47
48
|
componentName: "MazPopover",
|
|
48
49
|
providedId: __props.id
|
|
49
|
-
}), attrs = useAttrs(), triggerElement = useTemplateRef("trigger"), panelElement = useTemplateRef("panel"),
|
|
50
|
+
}), attrs = useAttrs(), triggerElement = useTemplateRef("trigger"), panelElement = useTemplateRef("panel"), middleware = computed(() => {
|
|
51
|
+
const middleware2 = [
|
|
52
|
+
offset(__props.offset),
|
|
53
|
+
hide(),
|
|
54
|
+
shift({ padding: 5 })
|
|
55
|
+
];
|
|
56
|
+
return __props.position === "auto" && !__props.preferPosition && !__props.fallbackPosition ? middleware2.push(autoPlacement({
|
|
57
|
+
allowedPlacements: ["top", "bottom", "left", "right"]
|
|
58
|
+
})) : middleware2.push(flip({
|
|
59
|
+
fallbackPlacements: __props.fallbackPosition ? [__props.fallbackPosition] : void 0
|
|
60
|
+
})), middleware2;
|
|
61
|
+
}), floatingPosition = computed(() => __props.position === "auto" ? __props.preferPosition : __props.position), transitionName = computed(() => ["scale-pop", "scale-fade"].includes(__props.transition) ? `maz-${__props.transition}` : __props.transition), reference = computed(() => getPositionReference() || triggerElement.value), { floatingStyles, placement, update, middlewareData } = useFloating(
|
|
62
|
+
reference,
|
|
63
|
+
panelElement,
|
|
64
|
+
{
|
|
65
|
+
placement: floatingPosition,
|
|
66
|
+
middleware,
|
|
67
|
+
transform: !1,
|
|
68
|
+
whileElementsMounted: autoUpdate
|
|
69
|
+
}
|
|
70
|
+
), computedPosition = computed(() => placement.value ?? floatingPosition.value);
|
|
71
|
+
function getPositionReference() {
|
|
72
|
+
if (!__props.positionReference)
|
|
73
|
+
return triggerElement.value;
|
|
74
|
+
if (typeof __props.positionReference == "string") {
|
|
75
|
+
const withinTrigger = triggerElement.value?.querySelector(__props.positionReference);
|
|
76
|
+
return withinTrigger || (isClient() ? document.querySelector(__props.positionReference) : null);
|
|
77
|
+
}
|
|
78
|
+
return __props.positionReference;
|
|
79
|
+
}
|
|
80
|
+
const isOpen = useModel(__props, "modelValue");
|
|
50
81
|
let openTimeout = null, closeTimeout = null, initialFocusElement = null, ignoreNextClickOutside = !1;
|
|
51
|
-
const panelId = computed(() => `${triggerId.value}-panel`),
|
|
52
|
-
|
|
82
|
+
const panelId = computed(() => `${triggerId.value}-panel`), rootStyles = computed(() => attrs.style), panelStyles = computed(() => ({
|
|
83
|
+
...floatingStyles.value,
|
|
84
|
+
pointerEvents: isOpen.value ? "auto" : "none"
|
|
85
|
+
})), isTouchDevice = computed(() => isClient() ? "ontouchstart" in globalThis || navigator.maxTouchPoints > 0 : !1), effectiveTrigger = computed(() => __props.trigger === "adaptive" ? isTouchDevice.value ? "click" : "hover" : __props.trigger), triggerEvents = computed(() => {
|
|
86
|
+
if (__props.disabled || effectiveTrigger.value === "manual")
|
|
53
87
|
return {};
|
|
54
88
|
const events = {};
|
|
55
|
-
return
|
|
89
|
+
return effectiveTrigger.value === "hover" && (events.onMouseenter = () => {
|
|
56
90
|
clearCloseTimeout(), open();
|
|
57
|
-
}, events.onMouseleave = close),
|
|
58
|
-
}), panelEvents = computed(() =>
|
|
91
|
+
}, events.onMouseleave = close), effectiveTrigger.value === "click" && (events.onClick = toggle), events;
|
|
92
|
+
}), panelEvents = computed(() => effectiveTrigger.value !== "hover" ? {} : {
|
|
59
93
|
onMouseenter: () => {
|
|
60
94
|
__props.keepOpenOnHover && clearCloseTimeout();
|
|
61
95
|
},
|
|
@@ -66,54 +100,20 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
66
100
|
__props.overlayClass,
|
|
67
101
|
__props.panelClass,
|
|
68
102
|
`--position-${computedPosition.value}`,
|
|
69
|
-
`--${__props.color}`
|
|
103
|
+
`--${getColor(__props.color)}`
|
|
70
104
|
]);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if (!triggerElement.value || !panelElement.value || isUpdatingPosition)
|
|
74
|
-
return;
|
|
75
|
-
isUpdatingPosition = !0;
|
|
76
|
-
const viewport = { width: window.innerWidth, height: window.innerHeight }, scrollTop = window.scrollY || document.documentElement.scrollTop, scrollLeft = window.scrollX || document.documentElement.scrollLeft;
|
|
77
|
-
let newPosition;
|
|
78
|
-
const triggerRect = triggerElement.value.getBoundingClientRect();
|
|
79
|
-
__props.position === "auto" ? newPosition = getBestPosition(triggerRect, viewport) : newPosition = __props.position;
|
|
80
|
-
const panelRect = panelElement.value.getBoundingClientRect(), coordinates = calculatePosition(newPosition, triggerRect, panelRect, scrollTop, scrollLeft);
|
|
81
|
-
panelStyles.value = {
|
|
82
|
-
position: "absolute",
|
|
83
|
-
top: `${coordinates.top}px`,
|
|
84
|
-
left: `${coordinates.left}px`,
|
|
85
|
-
visibility: "visible"
|
|
86
|
-
}, computedPosition.value = newPosition, isUpdatingPosition = !1;
|
|
87
|
-
}
|
|
88
|
-
const trottledUpdatePosition = throttle(() => {
|
|
89
|
-
isOpen.value && !isUpdatingPosition && nextTick(updatePosition);
|
|
90
|
-
}, 16);
|
|
91
|
-
function setupObservers() {
|
|
92
|
-
panelElement.value && (window.ResizeObserver && (resizeObserver = new ResizeObserver(() => {
|
|
93
|
-
isUpdatingPosition || trottledUpdatePosition();
|
|
94
|
-
}), resizeObserver.observe(panelElement.value)), mutationObserver = new MutationObserver((mutations) => {
|
|
95
|
-
if (isUpdatingPosition)
|
|
96
|
-
return;
|
|
97
|
-
mutations.filter((mutation) => mutation.target === panelElement.value && mutation.type === "attributes" && mutation.attributeName === "style" ? !1 : mutation.type === "childList" || mutation.type === "attributes" && mutation.attributeName === "class" && mutation.target !== panelElement.value).length > 0 && trottledUpdatePosition();
|
|
98
|
-
}), mutationObserver.observe(panelElement.value, {
|
|
99
|
-
childList: !0,
|
|
100
|
-
subtree: !0,
|
|
101
|
-
attributes: !0,
|
|
102
|
-
attributeFilter: ["class"]
|
|
103
|
-
}));
|
|
104
|
-
}
|
|
105
|
-
function cleanupObservers() {
|
|
106
|
-
resizeObserver && (resizeObserver.disconnect(), resizeObserver = null), mutationObserver && (mutationObserver.disconnect(), mutationObserver = null);
|
|
105
|
+
function cleanup() {
|
|
106
|
+
clearOpenTimeout(), clearCloseTimeout(), isClient() && document.removeEventListener("keydown", onKeydown);
|
|
107
107
|
}
|
|
108
108
|
function open() {
|
|
109
|
-
__props.disabled || (clearCloseTimeout(), ignoreNextClickOutside = !0, __props.delay > 0 ? openTimeout = setTimeout(() => {
|
|
109
|
+
__props.disabled || (clearCloseTimeout(), effectiveTrigger.value === "click" && (ignoreNextClickOutside = !0), __props.delay > 0 ? openTimeout = setTimeout(() => {
|
|
110
110
|
setOpen(!0);
|
|
111
111
|
}, __props.delay) : setOpen(!0));
|
|
112
112
|
}
|
|
113
113
|
function close() {
|
|
114
|
-
clearOpenTimeout(), __props.delay > 0 &&
|
|
114
|
+
clearOpenTimeout(), __props.delay > 0 && effectiveTrigger.value === "hover" ? closeTimeout = setTimeout(() => {
|
|
115
115
|
setOpen(!1);
|
|
116
|
-
}, __props.delay) :
|
|
116
|
+
}, __props.delay) : effectiveTrigger.value === "hover" && __props.keepOpenOnHover ? closeTimeout = setTimeout(() => {
|
|
117
117
|
setOpen(!1);
|
|
118
118
|
}, __props.hoverDelay) : setOpen(!1);
|
|
119
119
|
}
|
|
@@ -121,11 +121,9 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
121
121
|
isOpen.value ? close() : open();
|
|
122
122
|
}
|
|
123
123
|
function setOpen(value) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}, __props.positionDelay);
|
|
128
|
-
})) : (emits("close"), panelStyles.value = void 0, ignoreNextClickOutside = !1, cleanupObservers(), __props.trapFocus && restoreFocus());
|
|
124
|
+
value ? (emits("open"), isOpen.value = value, emits("toggle", value), nextTick(() => {
|
|
125
|
+
update(), setupFocusTrap();
|
|
126
|
+
})) : (isOpen.value = value, emits("toggle", value), emits("close"), ignoreNextClickOutside = !1, __props.trapFocus && restoreFocus());
|
|
129
127
|
}
|
|
130
128
|
function clearOpenTimeout() {
|
|
131
129
|
openTimeout && (clearTimeout(openTimeout), openTimeout = null);
|
|
@@ -133,78 +131,38 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
133
131
|
function clearCloseTimeout() {
|
|
134
132
|
closeTimeout && (clearTimeout(closeTimeout), closeTimeout = null);
|
|
135
133
|
}
|
|
136
|
-
function
|
|
137
|
-
return coords.left >= scrollLeft && coords.left + panelRect.width <= scrollLeft + viewport.width && coords.top >= scrollTop && coords.top + panelRect.height <= scrollTop + viewport.height;
|
|
138
|
-
}
|
|
139
|
-
function isPositionVisible(position, triggerRect, panelRect, viewport, scrollTop, scrollLeft) {
|
|
140
|
-
const coords = calculatePosition(position, triggerRect, panelRect, scrollTop, scrollLeft);
|
|
141
|
-
return getIsVisible(coords, panelRect, viewport, scrollTop, scrollLeft);
|
|
142
|
-
}
|
|
143
|
-
function getValidPositions(positions, triggerRect, panelRect, viewport, scrollTop, scrollLeft) {
|
|
144
|
-
const spaces = {
|
|
145
|
-
bottom: viewport.height + scrollTop - triggerRect.bottom,
|
|
146
|
-
top: triggerRect.top - scrollTop,
|
|
147
|
-
right: viewport.width + scrollLeft - triggerRect.right,
|
|
148
|
-
left: triggerRect.left - scrollLeft
|
|
149
|
-
};
|
|
150
|
-
return positions.reduce((acc, pos) => {
|
|
151
|
-
if (isPositionVisible(pos, triggerRect, panelRect, viewport, scrollTop, scrollLeft)) {
|
|
152
|
-
let positionBonus = 0;
|
|
153
|
-
pos === "bottom" ? positionBonus = 1e3 : pos === "top" ? positionBonus = 800 : pos === "right" ? positionBonus = 600 : pos === "left" && (positionBonus = 400);
|
|
154
|
-
const score = spaces[pos] + positionBonus;
|
|
155
|
-
acc.push({ position: pos, score });
|
|
156
|
-
}
|
|
157
|
-
return acc;
|
|
158
|
-
}, []);
|
|
159
|
-
}
|
|
160
|
-
function getBestPosition(triggerRect, viewport) {
|
|
161
|
-
if (!panelElement.value)
|
|
162
|
-
return "bottom";
|
|
163
|
-
const panelRect = panelElement.value.getBoundingClientRect(), scrollTop = window.scrollY || document.documentElement.scrollTop, scrollLeft = window.scrollX || document.documentElement.scrollLeft;
|
|
164
|
-
if (__props.preferPosition && isPositionVisible(__props.preferPosition, triggerRect, panelRect, viewport, scrollTop, scrollLeft))
|
|
165
|
-
return __props.preferPosition;
|
|
166
|
-
if (__props.preferPosition && __props.fallbackPosition)
|
|
167
|
-
return __props.fallbackPosition;
|
|
168
|
-
const positions = ["bottom", "top", "right", "left"], validPositions = getValidPositions(positions, triggerRect, panelRect, viewport, scrollTop, scrollLeft);
|
|
169
|
-
if (validPositions.length === 0) {
|
|
170
|
-
const spaces = {
|
|
171
|
-
top: triggerRect.top,
|
|
172
|
-
bottom: viewport.height - triggerRect.bottom,
|
|
173
|
-
left: triggerRect.left,
|
|
174
|
-
right: viewport.width - triggerRect.right
|
|
175
|
-
};
|
|
176
|
-
return positions.sort((a, b) => spaces[b] - spaces[a])[0];
|
|
177
|
-
}
|
|
178
|
-
return validPositions.sort((a, b) => b.score - a.score)[0].position;
|
|
179
|
-
}
|
|
180
|
-
function calculatePosition(position, triggerRect, panelRect, scrollTop, scrollLeft) {
|
|
181
|
-
let top = 0, left = 0;
|
|
134
|
+
function getTransformOrigin(position) {
|
|
182
135
|
switch (position) {
|
|
183
136
|
case "top":
|
|
137
|
+
return "center bottom";
|
|
184
138
|
case "top-start":
|
|
139
|
+
return "left bottom";
|
|
185
140
|
case "top-end":
|
|
186
|
-
|
|
187
|
-
break;
|
|
141
|
+
return "right bottom";
|
|
188
142
|
case "bottom":
|
|
143
|
+
return "center top";
|
|
189
144
|
case "bottom-start":
|
|
145
|
+
return "left top";
|
|
190
146
|
case "bottom-end":
|
|
191
|
-
|
|
192
|
-
break;
|
|
147
|
+
return "right top";
|
|
193
148
|
case "left":
|
|
149
|
+
return "right center";
|
|
194
150
|
case "left-start":
|
|
151
|
+
return "right top";
|
|
195
152
|
case "left-end":
|
|
196
|
-
|
|
197
|
-
break;
|
|
153
|
+
return "right bottom";
|
|
198
154
|
case "right":
|
|
155
|
+
return "left center";
|
|
199
156
|
case "right-start":
|
|
157
|
+
return "left top";
|
|
200
158
|
case "right-end":
|
|
201
|
-
|
|
202
|
-
|
|
159
|
+
return "left bottom";
|
|
160
|
+
default:
|
|
161
|
+
return "center";
|
|
203
162
|
}
|
|
204
|
-
return { top, left };
|
|
205
163
|
}
|
|
206
164
|
function setupFocusTrap() {
|
|
207
|
-
__props.role === "tooltip" || __props.role === "menu" ||
|
|
165
|
+
__props.role === "tooltip" || __props.role === "menu" || effectiveTrigger.value === "hover" || !__props.trapFocus || !isClient() || (initialFocusElement = document.activeElement, nextTick(() => {
|
|
208
166
|
const focusableElements = panelElement.value?.querySelectorAll(
|
|
209
167
|
'a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select, [tabindex]:not([tabindex="-1"])'
|
|
210
168
|
);
|
|
@@ -212,7 +170,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
212
170
|
}));
|
|
213
171
|
}
|
|
214
172
|
function restoreFocus() {
|
|
215
|
-
__props.role === "tooltip" || __props.role === "menu" ||
|
|
173
|
+
__props.role === "tooltip" || __props.role === "menu" || effectiveTrigger.value === "hover" || !__props.trapFocus || !isClient() || nextTick(() => {
|
|
216
174
|
initialFocusElement?.focus({ preventScroll: !0 });
|
|
217
175
|
});
|
|
218
176
|
}
|
|
@@ -220,7 +178,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
220
178
|
isOpen.value && (event.key === "Escape" && __props.closeOnEscape && !__props.persistent && (event.preventDefault(), close()), (__props.role === "dialog" || __props.role === "menu") && event.key === "Tab" && handleTrapFocus(event));
|
|
221
179
|
}
|
|
222
180
|
function handleTrapFocus(event) {
|
|
223
|
-
if (!panelElement.value)
|
|
181
|
+
if (!panelElement.value || !isClient())
|
|
224
182
|
return;
|
|
225
183
|
const focusableElements = panelElement.value.querySelectorAll(
|
|
226
184
|
'a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select, [tabindex]:not([tabindex="-1"])'
|
|
@@ -231,7 +189,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
231
189
|
event.shiftKey ? document.activeElement === firstElement && (event.preventDefault(), lastElement.focus()) : document.activeElement === lastElement && (event.preventDefault(), firstElement.focus());
|
|
232
190
|
}
|
|
233
191
|
function onClickOutside(event) {
|
|
234
|
-
if (
|
|
192
|
+
if (effectiveTrigger.value !== "manual") {
|
|
235
193
|
if (ignoreNextClickOutside) {
|
|
236
194
|
ignoreNextClickOutside = !1;
|
|
237
195
|
return;
|
|
@@ -243,18 +201,13 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
243
201
|
}
|
|
244
202
|
}
|
|
245
203
|
}
|
|
246
|
-
function onScroll() {
|
|
247
|
-
isOpen.value && updatePosition();
|
|
248
|
-
}
|
|
249
204
|
return watch(isOpen, (value, oldValue) => {
|
|
250
205
|
!isClient() || value === oldValue || (value ? open() : oldValue && !value && close());
|
|
251
206
|
}, { immediate: !0 }), watch(() => __props.position, () => {
|
|
252
|
-
isOpen.value && nextTick(
|
|
207
|
+
isOpen.value && nextTick(() => update());
|
|
253
208
|
}), onMounted(() => {
|
|
254
|
-
document.addEventListener("keydown", onKeydown)
|
|
255
|
-
}), onUnmounted(
|
|
256
|
-
document.removeEventListener("keydown", onKeydown), window.removeEventListener("scroll", onScroll, !0), window.removeEventListener("resize", onScroll), clearOpenTimeout(), clearCloseTimeout(), cleanupObservers();
|
|
257
|
-
}), __expose({
|
|
209
|
+
document.addEventListener("keydown", onKeydown);
|
|
210
|
+
}), onBeforeUnmount(cleanup), onUnmounted(cleanup), __expose({
|
|
258
211
|
/**
|
|
259
212
|
* Open the popover
|
|
260
213
|
* @description Programmatically open the popover
|
|
@@ -275,7 +228,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
275
228
|
toggle,
|
|
276
229
|
/**
|
|
277
230
|
* Check if the popover is open
|
|
278
|
-
* @type {
|
|
231
|
+
* @type {ComputedRef<boolean>}
|
|
279
232
|
* @description Reactive reference to the popover open state
|
|
280
233
|
* @usage `const isPopoverOpen = mazPopoverInstance.value?.isOpen`
|
|
281
234
|
*/
|
|
@@ -285,40 +238,42 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
285
238
|
* @description Manually recalculate and update the popover position
|
|
286
239
|
* @usage `mazPopoverInstance.value?.updatePosition()`
|
|
287
240
|
*/
|
|
288
|
-
updatePosition
|
|
289
|
-
}), (_ctx, _cache) => (openBlock(), createElementBlock(
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
id: unref(triggerId),
|
|
302
|
-
ref: "trigger",
|
|
303
|
-
class: "m-popover-trigger",
|
|
304
|
-
"aria-expanded": _ctx.role === "dialog" || _ctx.role === "menu" ? isOpen.value : void 0,
|
|
305
|
-
"aria-haspopup": _ctx.role === "dialog" ? "dialog" : void 0,
|
|
306
|
-
"aria-describedby": _ctx.role === "tooltip" && isOpen.value ? panelId.value : _ctx.ariaDescribedby,
|
|
307
|
-
"aria-labelledby": _ctx.ariaLabelledby
|
|
308
|
-
}, triggerEvents.value), [
|
|
309
|
-
renderSlot(_ctx.$slots, "trigger", {
|
|
310
|
-
open,
|
|
311
|
-
close,
|
|
312
|
-
toggle,
|
|
313
|
-
isOpen: isOpen.value
|
|
314
|
-
}, void 0, !0)
|
|
315
|
-
], 16, _hoisted_1),
|
|
316
|
-
(openBlock(), createBlock(Teleport, {
|
|
317
|
-
to: _ctx.teleportTo,
|
|
318
|
-
disabled: !isOpen.value
|
|
241
|
+
updatePosition: update
|
|
242
|
+
}), (_ctx, _cache) => (openBlock(), createElementBlock(Fragment, null, [
|
|
243
|
+
_ctx.$slots.trigger ? (openBlock(), createElementBlock("div", {
|
|
244
|
+
key: 0,
|
|
245
|
+
class: normalizeClass(["m-popover m-reset-css", [
|
|
246
|
+
unref(attrs).class,
|
|
247
|
+
{
|
|
248
|
+
"--open": isOpen.value,
|
|
249
|
+
"--disabled": _ctx.disabled,
|
|
250
|
+
"--block": _ctx.block
|
|
251
|
+
}
|
|
252
|
+
]]),
|
|
253
|
+
style: normalizeStyle(rootStyles.value)
|
|
319
254
|
}, [
|
|
255
|
+
createElementVNode("div", mergeProps({
|
|
256
|
+
id: unref(triggerId),
|
|
257
|
+
ref: "trigger",
|
|
258
|
+
role: "button",
|
|
259
|
+
class: "m-popover-trigger",
|
|
260
|
+
"aria-expanded": _ctx.role === "dialog" || _ctx.role === "menu" ? isOpen.value : void 0,
|
|
261
|
+
"aria-haspopup": _ctx.role === "dialog" ? "dialog" : void 0,
|
|
262
|
+
"aria-describedby": _ctx.role === "tooltip" && isOpen.value ? panelId.value : _ctx.ariaDescribedby,
|
|
263
|
+
"aria-labelledby": _ctx.ariaLabelledby
|
|
264
|
+
}, triggerEvents.value), [
|
|
265
|
+
renderSlot(_ctx.$slots, "trigger", {
|
|
266
|
+
open,
|
|
267
|
+
close,
|
|
268
|
+
toggle,
|
|
269
|
+
isOpen: isOpen.value,
|
|
270
|
+
trigger: effectiveTrigger.value
|
|
271
|
+
}, void 0, !0)
|
|
272
|
+
], 16, _hoisted_1)
|
|
273
|
+
], 6)) : createCommentVNode("", !0),
|
|
274
|
+
(openBlock(), createBlock(Teleport, { to: _ctx.teleportTo }, [
|
|
320
275
|
createVNode(Transition, {
|
|
321
|
-
name:
|
|
276
|
+
name: transitionName.value,
|
|
322
277
|
appear: ""
|
|
323
278
|
}, {
|
|
324
279
|
default: withCtx(() => [
|
|
@@ -334,7 +289,14 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
334
289
|
tabindex: _ctx.role === "dialog" ? "-1" : void 0,
|
|
335
290
|
class: ["m-popover-panel", panelClasses.value],
|
|
336
291
|
"aria-live": _ctx.announceChanges ? "polite" : void 0,
|
|
337
|
-
style: [
|
|
292
|
+
style: [
|
|
293
|
+
_ctx.panelStyle,
|
|
294
|
+
panelStyles.value,
|
|
295
|
+
{
|
|
296
|
+
transformOrigin: getTransformOrigin(computedPosition.value),
|
|
297
|
+
visibility: unref(middlewareData).hide?.referenceHidden ? "hidden" : "visible"
|
|
298
|
+
}
|
|
299
|
+
]
|
|
338
300
|
}, panelEvents.value), [
|
|
339
301
|
renderSlot(_ctx.$slots, "default", {
|
|
340
302
|
open,
|
|
@@ -348,10 +310,10 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
348
310
|
]),
|
|
349
311
|
_: 3
|
|
350
312
|
}, 8, ["name"])
|
|
351
|
-
], 8, ["to"
|
|
352
|
-
],
|
|
313
|
+
], 8, ["to"]))
|
|
314
|
+
], 64));
|
|
353
315
|
}
|
|
354
|
-
}), MazPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
316
|
+
}), MazPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e29d62fb"]]);
|
|
355
317
|
export {
|
|
356
318
|
MazPopover as default
|
|
357
319
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import { defineComponent, defineAsyncComponent, computed, ref, watch, onUnmounted, createElementBlock, openBlock, normalizeClass, createCommentVNode, renderSlot, normalizeStyle, createElementVNode, createVNode, unref } from "vue";
|
|
2
2
|
import { i as isClient } from "../chunks/isClient.WI4oSt66.js";
|
|
3
|
-
import { i as isStandaloneMode } from "../chunks/isStandaloneMode.BpUpOTbA.js";
|
|
4
3
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
5
|
-
import '../assets/MazPullToRefresh.
|
|
4
|
+
import '../assets/MazPullToRefresh.BQ64UvzA.css';function isStandaloneMode() {
|
|
5
|
+
if (!isClient())
|
|
6
|
+
return !1;
|
|
7
|
+
const nav = navigator, isStandalone = globalThis.matchMedia("(display-mode: standalone)").matches;
|
|
8
|
+
return nav.standalone || isStandalone;
|
|
9
|
+
}
|
|
10
|
+
const _hoisted_1 = {
|
|
6
11
|
key: 0,
|
|
7
12
|
class: "header-text"
|
|
8
13
|
}, _hoisted_2 = {
|
|
@@ -139,7 +144,7 @@ import '../assets/MazPullToRefresh.DABqbGtK.css';const _hoisted_1 = {
|
|
|
139
144
|
renderSlot(_ctx.$slots, "default", {}, void 0, !0)
|
|
140
145
|
], 2));
|
|
141
146
|
}
|
|
142
|
-
}), MazPullToRefresh = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
147
|
+
}), MazPullToRefresh = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-67a0e41a"]]);
|
|
143
148
|
export {
|
|
144
149
|
MazPullToRefresh as default
|
|
145
150
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, ref, computed, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createElementVNode, mergeProps, renderSlot, createCommentVNode, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
3
3
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
4
|
-
import '../assets/MazRadio.
|
|
4
|
+
import '../assets/MazRadio.aTHM-mpx.css';const _hoisted_1 = ["for", "aria-checked"], _hoisted_2 = ["id", "value", "disabled", "name", "checked"], _hoisted_3 = { class: "m-radio__text" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "MazRadio",
|
|
6
6
|
props: {
|
|
7
7
|
style: { default: void 0 },
|
|
@@ -24,7 +24,7 @@ import '../assets/MazRadio.DKMFWwy_.css';const _hoisted_1 = ["for", "aria-checke
|
|
|
24
24
|
const props = __props, emits = __emit, instanceId = useInstanceUniqId({
|
|
25
25
|
componentName: "MazRadio",
|
|
26
26
|
providedId: props.id
|
|
27
|
-
}), isSelected = computed(() => props.modelValue === props.value), radioSize = computed(() => {
|
|
27
|
+
}), inputRef = ref(), isFocused = ref(!1), isSelected = computed(() => props.modelValue === props.value), radioSize = computed(() => {
|
|
28
28
|
switch (props.size) {
|
|
29
29
|
case "xl":
|
|
30
30
|
return "2.25rem";
|
|
@@ -39,30 +39,22 @@ import '../assets/MazRadio.DKMFWwy_.css';const _hoisted_1 = ["for", "aria-checke
|
|
|
39
39
|
default:
|
|
40
40
|
return "1.625rem";
|
|
41
41
|
}
|
|
42
|
-
}), radioSelectedColor = computed(() => `hsl(var(--maz-${props.color}))`), radioBoxShadow = computed(() => {
|
|
43
|
-
if (props.error)
|
|
44
|
-
return "hsl(var(--maz-destructive))";
|
|
45
|
-
if (props.warning)
|
|
46
|
-
return "hsl(var(--maz-warning))";
|
|
47
|
-
if (props.success)
|
|
48
|
-
return "hsl(var(--maz-success))";
|
|
49
|
-
});
|
|
42
|
+
}), radioSelectedColor = computed(() => `hsl(var(--maz-${props.color}))`), radioBoxShadow = computed(() => props.error && !isFocused.value ? "hsl(var(--maz-destructive))" : props.warning && !isFocused.value ? "hsl(var(--maz-warning))" : props.success && !isFocused.value ? "hsl(var(--maz-success))" : ["transparent", "contrast"].includes(props.color) ? "hsl(var(--maz-muted))" : `hsl(var(--maz-${props.color}) / 60%)`);
|
|
50
43
|
function keyboardHandler(event) {
|
|
51
44
|
["Space"].includes(event.code) && (event.preventDefault(), emitValue());
|
|
52
45
|
}
|
|
53
46
|
function emitValue() {
|
|
54
47
|
emits("update:model-value", props.value), emits("change", props.value);
|
|
55
48
|
}
|
|
56
|
-
const inputRef = ref();
|
|
57
49
|
function onBlur(event) {
|
|
58
|
-
inputRef.value?.dispatchEvent(new Event("blur")), emits("blur", event);
|
|
50
|
+
isFocused.value = !1, inputRef.value?.dispatchEvent(new Event("blur")), emits("blur", event);
|
|
59
51
|
}
|
|
60
52
|
function onFocus(event) {
|
|
61
|
-
inputRef.value?.dispatchEvent(new Event("focus")), emits("focus", event);
|
|
53
|
+
isFocused.value = !0, inputRef.value?.dispatchEvent(new Event("focus")), emits("focus", event);
|
|
62
54
|
}
|
|
63
55
|
return (_ctx, _cache) => (openBlock(), createElementBlock("label", {
|
|
64
56
|
for: unref(instanceId),
|
|
65
|
-
class: normalizeClass(["m-radio m-reset-css", [{ "--
|
|
57
|
+
class: normalizeClass(["m-radio m-reset-css", [{ "--selected": isSelected.value, "--error": _ctx.error, "--warning": _ctx.warning, "--success": _ctx.success }, props.class]]),
|
|
66
58
|
tabindex: "0",
|
|
67
59
|
role: "radio",
|
|
68
60
|
style: normalizeStyle([_ctx.style, { "--radio-size": radioSize.value, "--radio-selected-color": radioSelectedColor.value, "--radio-box-shadow": radioBoxShadow.value }]),
|
|
@@ -105,7 +97,7 @@ import '../assets/MazRadio.DKMFWwy_.css';const _hoisted_1 = ["for", "aria-checke
|
|
|
105
97
|
])
|
|
106
98
|
], 46, _hoisted_1));
|
|
107
99
|
}
|
|
108
|
-
}), MazRadio = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
100
|
+
}), MazRadio = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-94df11f6"]]);
|
|
109
101
|
export {
|
|
110
102
|
MazRadio as default
|
|
111
103
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent, ref, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, Fragment, renderList, normalizeStyle, renderSlot, createVNode, Transition, withCtx, withDirectives,
|
|
1
|
+
import { defineComponent, ref, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, Fragment, renderList, normalizeStyle, unref, renderSlot, createVNode, Transition, withCtx, withDirectives, vShow, createTextVNode, toDisplayString } from "vue";
|
|
2
2
|
import { MazCheck } from "@maz-ui/icons";
|
|
3
|
+
import { g as getColor } from "../chunks/types.D0Bp_UhS.js";
|
|
3
4
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
4
|
-
import '../assets/MazRadioButtons.
|
|
5
|
+
import '../assets/MazRadioButtons.DN_rAzT9.css';const _hoisted_1 = { class: "m-radio-buttons m-reset-css" }, _hoisted_2 = ["for", "aria-checked", "onKeydown", "onBlur", "onFocus"], _hoisted_3 = ["id", "name", "value", "onChange"], _hoisted_4 = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "m-radio-buttons__items__checkbox"
|
|
7
8
|
}, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
@@ -26,7 +27,7 @@ import '../assets/MazRadioButtons.BA4rjgK9.css';const _hoisted_1 = { class: "m-r
|
|
|
26
27
|
setup(__props, { emit: __emit }) {
|
|
27
28
|
const props = __props, emits = __emit;
|
|
28
29
|
function selectOption(option) {
|
|
29
|
-
emits("update:model-value", option.value);
|
|
30
|
+
emits("update:model-value", option.value), emits("change", option.value);
|
|
30
31
|
}
|
|
31
32
|
function isSelected(value) {
|
|
32
33
|
return props.modelValue === value;
|
|
@@ -62,8 +63,8 @@ import '../assets/MazRadioButtons.BA4rjgK9.css';const _hoisted_1 = { class: "m-r
|
|
|
62
63
|
tabindex: "0",
|
|
63
64
|
style: normalizeStyle([
|
|
64
65
|
isSelected(option.value) ? {
|
|
65
|
-
color: `hsl(var(--maz-${_ctx.color}-foreground))`,
|
|
66
|
-
backgroundColor: `hsl(var(--maz-${_ctx.color}))`
|
|
66
|
+
color: `hsl(var(--maz-${unref(getColor)(_ctx.color)}-foreground))`,
|
|
67
|
+
backgroundColor: `hsl(var(--maz-${unref(getColor)(_ctx.color)}))`
|
|
67
68
|
} : {},
|
|
68
69
|
option.style
|
|
69
70
|
]),
|
|
@@ -91,7 +92,7 @@ import '../assets/MazRadioButtons.BA4rjgK9.css';const _hoisted_1 = { class: "m-r
|
|
|
91
92
|
"--is-selected": isSelected(option.value)
|
|
92
93
|
}),
|
|
93
94
|
style: normalizeStyle([
|
|
94
|
-
isSelected(option.value) ? { backgroundColor: `hsl(var(--maz-${props.color}-600))` } : {}
|
|
95
|
+
isSelected(option.value) ? { backgroundColor: `hsl(var(--maz-${unref(getColor)(props.color)}-600))` } : {}
|
|
95
96
|
])
|
|
96
97
|
}, [
|
|
97
98
|
createVNode(Transition, { name: "maz-radio-buttons-scale" }, {
|
|
@@ -122,7 +123,7 @@ import '../assets/MazRadioButtons.BA4rjgK9.css';const _hoisted_1 = { class: "m-r
|
|
|
122
123
|
}, toDisplayString(_ctx.hint), 3)) : createCommentVNode("", !0)
|
|
123
124
|
]));
|
|
124
125
|
}
|
|
125
|
-
}), MazRadioButtons = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
126
|
+
}), MazRadioButtons = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-50724ef5"]]);
|
|
126
127
|
export {
|
|
127
128
|
MazRadioButtons as default
|
|
128
129
|
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { defineComponent, computed, ref, watch, onMounted, onBeforeUnmount, createBlock, openBlock, Teleport, createElementVNode, mergeProps, normalizeStyle, normalizeClass, nextTick } from "vue";
|
|
2
|
-
import { t as throttle } from "../chunks/throttle.DN8ARw0a.js";
|
|
3
2
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
4
|
-
import '../assets/MazReadingProgressBar.
|
|
3
|
+
import '../assets/MazReadingProgressBar.CwBVXE3g.css';function throttle(func, limit) {
|
|
4
|
+
let inThrottle = !1, lastFunc, lastRan;
|
|
5
|
+
return function(...args) {
|
|
6
|
+
inThrottle ? (clearTimeout(lastFunc), lastFunc = setTimeout(() => {
|
|
7
|
+
Date.now() - lastRan >= limit && (func.apply(this, args), lastRan = Date.now());
|
|
8
|
+
}, Math.max(limit - (Date.now() - lastRan), 0))) : (func.apply(this, args), lastRan = Date.now(), inThrottle = !0);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
12
|
__name: "MazReadingProgressBar",
|
|
6
13
|
props: {
|
|
7
14
|
height: { default: "4px" },
|
|
@@ -61,7 +68,7 @@ import '../assets/MazReadingProgressBar.n1Is8_Y3.css';const _sfc_main = /* @__PU
|
|
|
61
68
|
], 16)
|
|
62
69
|
], 8, ["to"]));
|
|
63
70
|
}
|
|
64
|
-
}), MazReadingProgressBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
71
|
+
}), MazReadingProgressBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fe8cbda7"]]);
|
|
65
72
|
export {
|
|
66
73
|
MazReadingProgressBar as default
|
|
67
74
|
};
|