maz-ui 4.0.0-beta.2 → 4.0.0-beta.21
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.BFhP-9HO.css +1 -0
- package/dist/assets/MazCard.DBuQhXtl.css +1 -0
- package/dist/assets/{MazCardSpotlight.Dy-wuLQq.css → MazCardSpotlight.IbPp_y0j.css} +1 -1
- package/dist/assets/MazCheckbox.aH1IKnrR.css +1 -0
- package/dist/assets/MazChecklist.BzF5KtZ3.css +1 -0
- package/dist/assets/MazDatePicker.8GyrtM-j.css +1 -0
- package/dist/assets/MazDropzone.CXu1QtnY.css +1 -0
- package/dist/assets/MazInput.ByolKDfx.css +1 -0
- package/dist/assets/MazInputCode.FA2z4HQd.css +1 -0
- package/dist/assets/MazInputPhoneNumber.CrXS7DOY.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/MazPickerCalendarMonth.Boe_8k4x.css +1 -0
- package/dist/assets/MazPickerMonthSwitcher.CszcpCcY.css +1 -0
- package/dist/assets/{MazPickerYearSwitcher.Dl30Dwor.css → MazPickerYearSwitcher.Cn-nS-Vv.css} +1 -1
- package/dist/assets/MazPopover.rBpotMKW.css +1 -0
- package/dist/assets/MazPullToRefresh.BQ64UvzA.css +1 -0
- package/dist/assets/MazRadio.aTHM-mpx.css +1 -0
- package/dist/assets/MazRadioButtons.SGytq4d7.css +1 -0
- package/dist/assets/MazReadingProgressBar.CwBVXE3g.css +1 -0
- package/dist/assets/MazSelect.CwjnAZiu.css +1 -0
- package/dist/assets/{MazSelectCountry.D2Qudf0K.css → MazSelectCountry.t3GsKyqw.css} +1 -1
- package/dist/assets/{MazSlider.D5SgmZLH.css → MazSlider.y4qpnD0N.css} +1 -1
- 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.BJiKqOF6.css} +1 -1
- package/dist/assets/{fullscreen-img.pvt6196l.css → fullscreen-img.Bkuz1GOX.css} +1 -1
- package/dist/assets/{toast.kunueRvo.css → toast.CC2VQab8.css} +1 -1
- package/dist/chunks/{MazDatePicker.CT5yJhSN.js → MazDatePicker.De3Ltb2F.js} +29 -31
- 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.BES3jpuw.js} +12 -22
- package/dist/chunks/{MazInputPhoneNumber.Uwhn1Q9j.js → MazInputPhoneNumber.Ch-PCGiv.js} +14 -12
- 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.DKXNI8O4.js} +1 -1
- package/dist/chunks/{MazPickerCalendarMonth.hQBSVkc9.js → MazPickerCalendarMonth.DKBqgrNp.js} +5 -5
- package/dist/chunks/{MazPickerCalendarSwitcher.Cp2ux3E4.js → MazPickerCalendarSwitcher.CzIZol3Z.js} +1 -1
- package/dist/chunks/{MazPickerContainer.DnfB3Dqg.js → MazPickerContainer.Mrh-Q52I.js} +1 -1
- package/dist/chunks/{MazPickerHeader.Dlz2yJ1D.js → MazPickerHeader.Bm9vIrtB.js} +1 -1
- package/dist/chunks/{MazPickerMonthSwitcher.BpfCGGxQ.js → MazPickerMonthSwitcher.BSD2GtY6.js} +5 -6
- package/dist/chunks/{MazPickerTime.EuWWNfid.js → MazPickerTime.D0hilq5b.js} +1 -1
- package/dist/chunks/{MazPickerYearSwitcher.D4aO09D3.js → MazPickerYearSwitcher.BIUYJMvj.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.BzL1_XS5.js} +5 -4
- 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/types.D0Bp_UhS.js +6 -0
- package/dist/chunks/{normalizeString.CFe2M8S_.js → useStringMatching.Ba1yCuA4.js} +40 -1
- 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 +1 -1
- 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 +177 -89
- package/dist/components/MazPullToRefresh.js +8 -3
- package/dist/components/MazRadio.js +8 -16
- package/dist/components/MazRadioButtons.js +7 -6
- package/dist/components/MazReadingProgressBar.js +10 -3
- package/dist/components/MazSelect.js +24 -14
- package/dist/components/MazSelectCountry.js +15 -9
- package/dist/components/MazSlider.js +2 -2
- 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 +7 -1
- 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/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 -60
- package/dist/index.js +1 -114
- package/dist/plugins/dialog.js +3 -3
- package/dist/plugins/maz-ui.js +150 -143
- package/dist/plugins/toast.js +8 -11
- package/dist/resolvers/MazComponentsResolver.js +7 -1
- package/dist/resolvers/MazDirectivesResolver.js +1 -1
- package/dist/resolvers/MazModulesResolver.js +3 -1
- 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/MazCheckbox.vue.d.ts +0 -6
- package/dist/types/components/MazChecklist.vue.d.ts +1 -1
- package/dist/types/components/MazDatePicker.vue.d.ts +15 -23
- 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 +2 -2
- package/dist/types/components/MazInputPhoneNumber/useLibphonenumber.d.ts +2 -2
- package/dist/types/components/MazInputPhoneNumber/useMazInputPhoneNumber.d.ts +6 -2
- package/dist/types/components/MazInputPhoneNumber.vue.d.ts +38 -15
- 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 +18 -15
- package/dist/types/components/MazRadioButtons.vue.d.ts +1 -1
- package/dist/types/components/MazSelect.vue.d.ts +2 -2
- package/dist/types/components/MazSelectCountry.vue.d.ts +13 -4
- 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 +2 -2
- 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/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 +42 -39
- 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/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/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/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/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
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent, mergeModels, useAttrs, useTemplateRef, useModel, ref, computed, nextTick, watch, onMounted, onUnmounted, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createElementVNode, createBlock, mergeProps, renderSlot, Teleport, createVNode, Transition, withCtx, withDirectives, createCommentVNode } from "vue";
|
|
1
|
+
import { defineComponent, mergeModels, useAttrs, useTemplateRef, useModel, ref, computed, nextTick, watch, onMounted, onBeforeUnmount, onUnmounted, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, createElementVNode, createBlock, mergeProps, renderSlot, Teleport, createVNode, Transition, withCtx, withDirectives, createCommentVNode } from "vue";
|
|
2
2
|
import { i as isClient } from "../chunks/isClient.WI4oSt66.js";
|
|
3
|
-
import { t as throttle } from "../chunks/throttle.DN8ARw0a.js";
|
|
4
3
|
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
5
|
-
import {
|
|
4
|
+
import { d as directive } from "../chunks/vClickOutside.DIOiluy0.js";
|
|
5
|
+
import { g as getColor } from "../chunks/types.D0Bp_UhS.js";
|
|
6
6
|
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
7
|
-
import '../assets/MazPopover.
|
|
7
|
+
import '../assets/MazPopover.rBpotMKW.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
8
|
name: "MazPopover",
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "MazPopover",
|
|
@@ -36,7 +36,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
36
36
|
trapFocus: { type: Boolean, default: !0 },
|
|
37
37
|
keepOpenOnHover: { type: Boolean, default: !1 },
|
|
38
38
|
block: { type: Boolean, default: !1 },
|
|
39
|
-
|
|
39
|
+
positionReference: {}
|
|
40
40
|
}, {
|
|
41
41
|
modelValue: { type: Boolean, required: !1, default: !1 },
|
|
42
42
|
modelModifiers: {}
|
|
@@ -46,16 +46,26 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
46
46
|
const emits = __emit, triggerId = useInstanceUniqId({
|
|
47
47
|
componentName: "MazPopover",
|
|
48
48
|
providedId: __props.id
|
|
49
|
-
}), attrs = useAttrs(), triggerElement = useTemplateRef("trigger"), panelElement = useTemplateRef("panel")
|
|
49
|
+
}), attrs = useAttrs(), triggerElement = useTemplateRef("trigger"), panelElement = useTemplateRef("panel");
|
|
50
|
+
function getPositionReference() {
|
|
51
|
+
if (!__props.positionReference)
|
|
52
|
+
return triggerElement.value;
|
|
53
|
+
if (typeof __props.positionReference == "string") {
|
|
54
|
+
const withinTrigger = triggerElement.value?.querySelector(__props.positionReference);
|
|
55
|
+
return withinTrigger || document.querySelector(__props.positionReference);
|
|
56
|
+
}
|
|
57
|
+
return __props.positionReference;
|
|
58
|
+
}
|
|
59
|
+
const isOpen = useModel(__props, "modelValue"), computedPosition = ref(__props.position === "auto" ? "bottom" : __props.position);
|
|
50
60
|
let openTimeout = null, closeTimeout = null, initialFocusElement = null, ignoreNextClickOutside = !1;
|
|
51
|
-
const panelId = computed(() => `${triggerId.value}-panel`), panelStyles = ref(), rootStyles = computed(() => attrs.style), triggerEvents = computed(() => {
|
|
52
|
-
if (__props.disabled ||
|
|
61
|
+
const panelId = computed(() => `${triggerId.value}-panel`), panelStyles = ref(), rootStyles = computed(() => attrs.style), isTouchDevice = computed(() => isClient() ? "ontouchstart" in globalThis || navigator.maxTouchPoints > 0 : !1), effectiveTrigger = computed(() => __props.trigger === "adaptive" ? isTouchDevice.value ? "click" : "hover" : __props.trigger), triggerEvents = computed(() => {
|
|
62
|
+
if (__props.disabled || effectiveTrigger.value === "manual")
|
|
53
63
|
return {};
|
|
54
64
|
const events = {};
|
|
55
|
-
return
|
|
65
|
+
return effectiveTrigger.value === "hover" && (events.onMouseenter = () => {
|
|
56
66
|
clearCloseTimeout(), open();
|
|
57
|
-
}, events.onMouseleave = close),
|
|
58
|
-
}), panelEvents = computed(() =>
|
|
67
|
+
}, events.onMouseleave = close), effectiveTrigger.value === "click" && (events.onClick = toggle), events;
|
|
68
|
+
}), panelEvents = computed(() => effectiveTrigger.value !== "hover" ? {} : {
|
|
59
69
|
onMouseenter: () => {
|
|
60
70
|
__props.keepOpenOnHover && clearCloseTimeout();
|
|
61
71
|
},
|
|
@@ -66,35 +76,74 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
66
76
|
__props.overlayClass,
|
|
67
77
|
__props.panelClass,
|
|
68
78
|
`--position-${computedPosition.value}`,
|
|
69
|
-
`--${__props.color}`
|
|
79
|
+
`--${getColor(__props.color)}`
|
|
70
80
|
]);
|
|
71
|
-
let resizeObserver = null, mutationObserver = null,
|
|
81
|
+
let resizeObserver = null, mutationObserver = null, isPositioning = !1, positioningFrame = null;
|
|
82
|
+
function calculateAndApplyPosition(options = {}) {
|
|
83
|
+
if (!triggerElement.value || !panelElement.value || isPositioning)
|
|
84
|
+
return null;
|
|
85
|
+
const { applyStyles = !0, forAnimation = !1 } = options;
|
|
86
|
+
applyStyles && (isPositioning = !0, positioningFrame && cancelAnimationFrame(positioningFrame));
|
|
87
|
+
const doCalculation = () => {
|
|
88
|
+
if (!triggerElement.value || !panelElement.value)
|
|
89
|
+
return applyStyles && (isPositioning = !1), null;
|
|
90
|
+
try {
|
|
91
|
+
const viewport = { width: window.innerWidth, height: window.innerHeight }, positionRef = getPositionReference();
|
|
92
|
+
if (!positionRef)
|
|
93
|
+
return applyStyles && (isPositioning = !1), null;
|
|
94
|
+
const triggerRect = positionRef.getBoundingClientRect();
|
|
95
|
+
let wasHidden = !1;
|
|
96
|
+
forAnimation && (wasHidden = panelElement.value.style.visibility === "hidden", panelElement.value.style.visibility = "hidden", panelElement.value.style.display = "block");
|
|
97
|
+
let newPosition;
|
|
98
|
+
if (__props.position === "auto" ? newPosition = getBestPosition(triggerRect, viewport) : newPosition = __props.position, computedPosition.value = newPosition, applyStyles) {
|
|
99
|
+
const panelRect = panelElement.value.getBoundingClientRect(), styles = calculatePosition(newPosition, triggerRect, panelRect);
|
|
100
|
+
panelStyles.value = styles;
|
|
101
|
+
}
|
|
102
|
+
return forAnimation && !applyStyles && (wasHidden ? panelElement.value.style.visibility = "hidden" : panelElement.value.style.display = ""), newPosition;
|
|
103
|
+
} catch (error) {
|
|
104
|
+
return console.warn("[MazPopover] Error calculating position:", error), null;
|
|
105
|
+
} finally {
|
|
106
|
+
applyStyles && (isPositioning = !1, positioningFrame = null);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
return applyStyles ? (positioningFrame = requestAnimationFrame(doCalculation), null) : doCalculation();
|
|
110
|
+
}
|
|
72
111
|
function updatePosition() {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
__props.position === "auto"
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
112
|
+
calculateAndApplyPosition({ applyStyles: !0 });
|
|
113
|
+
}
|
|
114
|
+
function schedulePositionUpdate() {
|
|
115
|
+
isOpen.value && !isPositioning && updatePosition();
|
|
116
|
+
}
|
|
117
|
+
function preparePositionForAnimation() {
|
|
118
|
+
if (__props.position === "auto" && triggerElement.value) {
|
|
119
|
+
const positionRef = getPositionReference();
|
|
120
|
+
if (positionRef) {
|
|
121
|
+
const triggerRect = positionRef.getBoundingClientRect(), viewport = { width: window.innerWidth, height: window.innerHeight }, newPosition = getBestPosition(triggerRect, viewport);
|
|
122
|
+
computedPosition.value = newPosition;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return calculateAndApplyPosition({ applyStyles: !1, forAnimation: !0 });
|
|
87
126
|
}
|
|
88
|
-
const trottledUpdatePosition = throttle(() => {
|
|
89
|
-
isOpen.value && !isUpdatingPosition && nextTick(updatePosition);
|
|
90
|
-
}, 16);
|
|
91
127
|
function setupObservers() {
|
|
92
|
-
panelElement.value
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
128
|
+
if (!panelElement.value || !triggerElement.value)
|
|
129
|
+
return;
|
|
130
|
+
const positionRef = getPositionReference();
|
|
131
|
+
positionRef && (globalThis.ResizeObserver && (resizeObserver = new ResizeObserver((entries) => {
|
|
132
|
+
for (const entry of entries)
|
|
133
|
+
if (entry.target === panelElement.value || entry.target === triggerElement.value || entry.target === positionRef) {
|
|
134
|
+
schedulePositionUpdate();
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
}), resizeObserver.observe(panelElement.value), resizeObserver.observe(triggerElement.value), positionRef !== triggerElement.value && resizeObserver.observe(positionRef), resizeObserver.observe(document.documentElement)), mutationObserver = new MutationObserver((mutations) => {
|
|
138
|
+
if (isPositioning)
|
|
96
139
|
return;
|
|
97
|
-
|
|
140
|
+
let shouldUpdate = !1;
|
|
141
|
+
for (const mutation of mutations)
|
|
142
|
+
if (!(mutation.target === panelElement.value && mutation.type === "attributes" && mutation.attributeName === "style") && (mutation.type === "childList" || mutation.type === "attributes" && mutation.attributeName === "class")) {
|
|
143
|
+
shouldUpdate = !0;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
shouldUpdate && schedulePositionUpdate();
|
|
98
147
|
}), mutationObserver.observe(panelElement.value, {
|
|
99
148
|
childList: !0,
|
|
100
149
|
subtree: !0,
|
|
@@ -103,17 +152,17 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
103
152
|
}));
|
|
104
153
|
}
|
|
105
154
|
function cleanupObservers() {
|
|
106
|
-
resizeObserver && (resizeObserver.disconnect(), resizeObserver = null), mutationObserver && (mutationObserver.disconnect(), mutationObserver = null);
|
|
155
|
+
positioningFrame && (cancelAnimationFrame(positioningFrame), positioningFrame = null), resizeObserver && (resizeObserver.disconnect(), resizeObserver = null), mutationObserver && (mutationObserver.disconnect(), mutationObserver = null);
|
|
107
156
|
}
|
|
108
157
|
function open() {
|
|
109
|
-
__props.disabled || (clearCloseTimeout(), ignoreNextClickOutside = !0, __props.delay > 0 ? openTimeout = setTimeout(() => {
|
|
158
|
+
__props.disabled || (clearCloseTimeout(), effectiveTrigger.value === "click" && (ignoreNextClickOutside = !0), __props.delay > 0 ? openTimeout = setTimeout(() => {
|
|
110
159
|
setOpen(!0);
|
|
111
160
|
}, __props.delay) : setOpen(!0));
|
|
112
161
|
}
|
|
113
162
|
function close() {
|
|
114
|
-
clearOpenTimeout(), __props.delay > 0 &&
|
|
163
|
+
clearOpenTimeout(), __props.delay > 0 && effectiveTrigger.value === "hover" ? closeTimeout = setTimeout(() => {
|
|
115
164
|
setOpen(!1);
|
|
116
|
-
}, __props.delay) :
|
|
165
|
+
}, __props.delay) : effectiveTrigger.value === "hover" && __props.keepOpenOnHover ? closeTimeout = setTimeout(() => {
|
|
117
166
|
setOpen(!1);
|
|
118
167
|
}, __props.hoverDelay) : setOpen(!1);
|
|
119
168
|
}
|
|
@@ -121,11 +170,15 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
121
170
|
isOpen.value ? close() : open();
|
|
122
171
|
}
|
|
123
172
|
function setOpen(value) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
updatePosition(), setupObservers();
|
|
127
|
-
}
|
|
128
|
-
})) : (
|
|
173
|
+
value ? (emits("open"), nextTick(() => {
|
|
174
|
+
triggerElement.value && panelElement.value && preparePositionForAnimation(), (() => {
|
|
175
|
+
isOpen.value = value, emits("toggle", value), updatePosition(), setupObservers(), setupFocusTrap();
|
|
176
|
+
})();
|
|
177
|
+
})) : (isOpen.value = value, emits("toggle", value), emits("close"), panelStyles.value = {
|
|
178
|
+
position: "fixed",
|
|
179
|
+
visibility: "hidden",
|
|
180
|
+
pointerEvents: "none"
|
|
181
|
+
}, ignoreNextClickOutside = !1, cleanupObservers(), __props.trapFocus && restoreFocus());
|
|
129
182
|
}
|
|
130
183
|
function clearOpenTimeout() {
|
|
131
184
|
openTimeout && (clearTimeout(openTimeout), openTimeout = null);
|
|
@@ -133,39 +186,15 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
133
186
|
function clearCloseTimeout() {
|
|
134
187
|
closeTimeout && (clearTimeout(closeTimeout), closeTimeout = null);
|
|
135
188
|
}
|
|
136
|
-
function getIsVisible(coords, panelRect, viewport, scrollTop, scrollLeft) {
|
|
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
189
|
function getBestPosition(triggerRect, viewport) {
|
|
161
190
|
if (!panelElement.value)
|
|
162
191
|
return "bottom";
|
|
163
|
-
const panelRect = panelElement.value.getBoundingClientRect()
|
|
164
|
-
if (__props.preferPosition && isPositionVisible(__props.preferPosition, triggerRect, panelRect, viewport
|
|
192
|
+
const panelRect = panelElement.value.getBoundingClientRect();
|
|
193
|
+
if (__props.preferPosition && isPositionVisible(__props.preferPosition, triggerRect, panelRect, viewport))
|
|
165
194
|
return __props.preferPosition;
|
|
166
195
|
if (__props.preferPosition && __props.fallbackPosition)
|
|
167
196
|
return __props.fallbackPosition;
|
|
168
|
-
const positions = ["bottom", "top", "right", "left"], validPositions = getValidPositions(positions, triggerRect, panelRect, viewport
|
|
197
|
+
const positions = ["bottom", "top", "right", "left"], validPositions = getValidPositions(positions, triggerRect, panelRect, viewport);
|
|
169
198
|
if (validPositions.length === 0) {
|
|
170
199
|
const spaces = {
|
|
171
200
|
top: triggerRect.top,
|
|
@@ -177,34 +206,90 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
177
206
|
}
|
|
178
207
|
return validPositions.sort((a, b) => b.score - a.score)[0].position;
|
|
179
208
|
}
|
|
180
|
-
function calculatePosition(position, triggerRect,
|
|
181
|
-
|
|
209
|
+
function calculatePosition(position, triggerRect, _panelRect) {
|
|
210
|
+
const viewport = { width: window.innerWidth, height: window.innerHeight }, styles = {
|
|
211
|
+
position: "fixed",
|
|
212
|
+
visibility: "visible",
|
|
213
|
+
transformOrigin: getTransformOrigin(position)
|
|
214
|
+
};
|
|
182
215
|
switch (position) {
|
|
183
216
|
case "top":
|
|
184
217
|
case "top-start":
|
|
185
218
|
case "top-end":
|
|
186
|
-
|
|
219
|
+
styles.bottom = `${viewport.height - triggerRect.top + __props.offset}px`, position === "top-start" ? styles.left = `${triggerRect.left}px` : position === "top-end" ? styles.right = `${viewport.width - triggerRect.right}px` : styles.left = `${triggerRect.left + triggerRect.width / 2 - _panelRect.width / 2}px`;
|
|
187
220
|
break;
|
|
188
221
|
case "bottom":
|
|
189
222
|
case "bottom-start":
|
|
190
223
|
case "bottom-end":
|
|
191
|
-
top = triggerRect.bottom +
|
|
224
|
+
styles.top = `${triggerRect.bottom + __props.offset}px`, position === "bottom-start" ? styles.left = `${triggerRect.left}px` : position === "bottom-end" ? styles.right = `${viewport.width - triggerRect.right}px` : styles.left = `${triggerRect.left + triggerRect.width / 2 - _panelRect.width / 2}px`;
|
|
192
225
|
break;
|
|
193
226
|
case "left":
|
|
194
227
|
case "left-start":
|
|
195
228
|
case "left-end":
|
|
196
|
-
|
|
229
|
+
styles.right = `${viewport.width - triggerRect.left + __props.offset}px`, position === "left-start" ? styles.top = `${triggerRect.top}px` : position === "left-end" ? styles.bottom = `${viewport.height - triggerRect.bottom}px` : styles.top = `${triggerRect.top + triggerRect.height / 2 - _panelRect.height / 2}px`;
|
|
197
230
|
break;
|
|
198
231
|
case "right":
|
|
199
232
|
case "right-start":
|
|
200
233
|
case "right-end":
|
|
201
|
-
left = triggerRect.right +
|
|
234
|
+
styles.left = `${triggerRect.right + __props.offset}px`, position === "right-start" ? styles.top = `${triggerRect.top}px` : position === "right-end" ? styles.bottom = `${viewport.height - triggerRect.bottom}px` : styles.top = `${triggerRect.top + triggerRect.height / 2 - _panelRect.height / 2}px`;
|
|
202
235
|
break;
|
|
203
236
|
}
|
|
204
|
-
return
|
|
237
|
+
return styles;
|
|
238
|
+
}
|
|
239
|
+
function getTransformOrigin(position) {
|
|
240
|
+
switch (position) {
|
|
241
|
+
case "top":
|
|
242
|
+
return "center bottom";
|
|
243
|
+
case "top-start":
|
|
244
|
+
return "left bottom";
|
|
245
|
+
case "top-end":
|
|
246
|
+
return "right bottom";
|
|
247
|
+
case "bottom":
|
|
248
|
+
return "center top";
|
|
249
|
+
case "bottom-start":
|
|
250
|
+
return "left top";
|
|
251
|
+
case "bottom-end":
|
|
252
|
+
return "right top";
|
|
253
|
+
case "left":
|
|
254
|
+
return "right center";
|
|
255
|
+
case "left-start":
|
|
256
|
+
return "right top";
|
|
257
|
+
case "left-end":
|
|
258
|
+
return "right bottom";
|
|
259
|
+
case "right":
|
|
260
|
+
return "left center";
|
|
261
|
+
case "right-start":
|
|
262
|
+
return "left top";
|
|
263
|
+
case "right-end":
|
|
264
|
+
return "left bottom";
|
|
265
|
+
default:
|
|
266
|
+
return "center";
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function isPositionVisible(position, triggerRect, panelRect, viewport) {
|
|
270
|
+
const styles = calculatePosition(position, triggerRect, panelRect);
|
|
271
|
+
let top = 0, left = 0;
|
|
272
|
+
return styles.top ? top = Number.parseInt(styles.top) : styles.bottom && (top = viewport.height - Number.parseInt(styles.bottom) - panelRect.height), styles.left ? left = Number.parseInt(styles.left) : styles.right && (left = viewport.width - Number.parseInt(styles.right) - panelRect.width), styles.transform?.includes("translateX(-50%)") && (left -= panelRect.width / 2), styles.transform?.includes("translateY(-50%)") && (top -= panelRect.height / 2), left >= 0 && left + panelRect.width <= viewport.width && top >= 0 && top + panelRect.height <= viewport.height;
|
|
273
|
+
}
|
|
274
|
+
function getValidPositions(positions, triggerRect, panelRect, viewport) {
|
|
275
|
+
const spaces = {
|
|
276
|
+
bottom: viewport.height - triggerRect.bottom,
|
|
277
|
+
top: triggerRect.top,
|
|
278
|
+
right: viewport.width - triggerRect.right,
|
|
279
|
+
left: triggerRect.left
|
|
280
|
+
};
|
|
281
|
+
return positions.reduce((acc, pos) => {
|
|
282
|
+
if (isPositionVisible(pos, triggerRect, panelRect, viewport)) {
|
|
283
|
+
let positionBonus = 0;
|
|
284
|
+
pos === "bottom" ? positionBonus = 1e3 : pos === "top" ? positionBonus = 800 : pos === "right" ? positionBonus = 600 : pos === "left" && (positionBonus = 400);
|
|
285
|
+
const score = spaces[pos] + positionBonus;
|
|
286
|
+
acc.push({ position: pos, score });
|
|
287
|
+
}
|
|
288
|
+
return acc;
|
|
289
|
+
}, []);
|
|
205
290
|
}
|
|
206
291
|
function setupFocusTrap() {
|
|
207
|
-
__props.role === "tooltip" || __props.role === "menu" ||
|
|
292
|
+
__props.role === "tooltip" || __props.role === "menu" || effectiveTrigger.value === "hover" || !__props.trapFocus || (initialFocusElement = document.activeElement, nextTick(() => {
|
|
208
293
|
const focusableElements = panelElement.value?.querySelectorAll(
|
|
209
294
|
'a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select, [tabindex]:not([tabindex="-1"])'
|
|
210
295
|
);
|
|
@@ -212,7 +297,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
212
297
|
}));
|
|
213
298
|
}
|
|
214
299
|
function restoreFocus() {
|
|
215
|
-
__props.role === "tooltip" || __props.role === "menu" ||
|
|
300
|
+
__props.role === "tooltip" || __props.role === "menu" || effectiveTrigger.value === "hover" || !__props.trapFocus || nextTick(() => {
|
|
216
301
|
initialFocusElement?.focus({ preventScroll: !0 });
|
|
217
302
|
});
|
|
218
303
|
}
|
|
@@ -231,7 +316,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
231
316
|
event.shiftKey ? document.activeElement === firstElement && (event.preventDefault(), lastElement.focus()) : document.activeElement === lastElement && (event.preventDefault(), firstElement.focus());
|
|
232
317
|
}
|
|
233
318
|
function onClickOutside(event) {
|
|
234
|
-
if (
|
|
319
|
+
if (effectiveTrigger.value !== "manual") {
|
|
235
320
|
if (ignoreNextClickOutside) {
|
|
236
321
|
ignoreNextClickOutside = !1;
|
|
237
322
|
return;
|
|
@@ -243,17 +328,19 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
243
328
|
}
|
|
244
329
|
}
|
|
245
330
|
}
|
|
246
|
-
function
|
|
247
|
-
isOpen.value &&
|
|
331
|
+
function onScrollThrottled() {
|
|
332
|
+
isOpen.value && schedulePositionUpdate();
|
|
248
333
|
}
|
|
249
334
|
return watch(isOpen, (value, oldValue) => {
|
|
250
335
|
!isClient() || value === oldValue || (value ? open() : oldValue && !value && close());
|
|
251
|
-
}, { immediate: !0 }), watch(() => __props.position, () => {
|
|
252
|
-
isOpen.value && nextTick(updatePosition);
|
|
336
|
+
}, { immediate: !0 }), watch(() => __props.position, (newPosition) => {
|
|
337
|
+
newPosition !== "auto" && (computedPosition.value = newPosition), isOpen.value && nextTick(updatePosition);
|
|
253
338
|
}), onMounted(() => {
|
|
254
|
-
document.addEventListener("keydown", onKeydown), window.addEventListener("scroll",
|
|
339
|
+
document.addEventListener("keydown", onKeydown), window.addEventListener("scroll", onScrollThrottled, { passive: !0, capture: !0 }), window.addEventListener("resize", onScrollThrottled, { passive: !0 });
|
|
340
|
+
}), onBeforeUnmount(() => {
|
|
341
|
+
cleanupObservers(), clearOpenTimeout(), clearCloseTimeout();
|
|
255
342
|
}), onUnmounted(() => {
|
|
256
|
-
document.removeEventListener("keydown", onKeydown), window.removeEventListener("scroll",
|
|
343
|
+
document.removeEventListener("keydown", onKeydown), window.removeEventListener("scroll", onScrollThrottled, !0), window.removeEventListener("resize", onScrollThrottled);
|
|
257
344
|
}), __expose({
|
|
258
345
|
/**
|
|
259
346
|
* Open the popover
|
|
@@ -275,7 +362,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
275
362
|
toggle,
|
|
276
363
|
/**
|
|
277
364
|
* Check if the popover is open
|
|
278
|
-
* @type {
|
|
365
|
+
* @type {ComputedRef<boolean>}
|
|
279
366
|
* @description Reactive reference to the popover open state
|
|
280
367
|
* @usage `const isPopoverOpen = mazPopoverInstance.value?.isOpen`
|
|
281
368
|
*/
|
|
@@ -300,6 +387,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
300
387
|
createElementVNode("div", mergeProps({
|
|
301
388
|
id: unref(triggerId),
|
|
302
389
|
ref: "trigger",
|
|
390
|
+
role: "button",
|
|
303
391
|
class: "m-popover-trigger",
|
|
304
392
|
"aria-expanded": _ctx.role === "dialog" || _ctx.role === "menu" ? isOpen.value : void 0,
|
|
305
393
|
"aria-haspopup": _ctx.role === "dialog" ? "dialog" : void 0,
|
|
@@ -351,7 +439,7 @@ import '../assets/MazPopover.Bth9NWia.css';const _hoisted_1 = ["id", "aria-expan
|
|
|
351
439
|
], 8, ["to", "disabled"]))
|
|
352
440
|
], 6));
|
|
353
441
|
}
|
|
354
|
-
}), MazPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
442
|
+
}), MazPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-89cd1397"]]);
|
|
355
443
|
export {
|
|
356
444
|
MazPopover as default
|
|
357
445
|
};
|
|
@@ -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.SGytq4d7.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({
|
|
@@ -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-4dd98338"]]);
|
|
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
|
};
|