maz-ui 4.7.5 → 4.7.6
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/dist/chunks/MazAccordion.CKnz73h4.js +1 -0
- package/dist/chunks/MazAlert.B8hE7wet.js +1 -0
- package/dist/chunks/MazAnimatedCounter.GLLYbZAz.js +1 -0
- package/dist/chunks/MazAnimatedElement._8NY8WgC.js +1 -0
- package/dist/chunks/MazAnimatedText.BSZ8FNf-.js +1 -0
- package/dist/chunks/MazAvatar.vO5VNPi8.js +1 -0
- package/dist/chunks/MazBackdrop.Cjbwi8-V.js +1 -0
- package/dist/chunks/MazBadge.BBZJgHXm.js +1 -0
- package/dist/chunks/MazBottomSheet.WgZ6qobx.js +1 -0
- package/dist/chunks/MazBtn.Cc9C1v2l.js +1 -0
- package/dist/chunks/MazBtnGroup.3B1XcqWM.js +1 -0
- package/dist/chunks/MazCard.YYC0LaHY.js +1 -0
- package/dist/chunks/MazCardSpotlight.SpZF61hl.js +1 -0
- package/dist/chunks/MazCarousel.1NT4jcvR.js +1 -0
- package/dist/chunks/MazChart.CDZ2PBTC.js +1 -0
- package/dist/chunks/MazCheckbox.DurIbKdf.js +1 -0
- package/dist/chunks/MazChecklist.D9ezwGpQ.js +1 -0
- package/dist/chunks/MazCircularProgressBar.rATx_hD9.js +1 -0
- package/dist/chunks/MazContainer.zXcfMOs-.js +1 -0
- package/dist/chunks/MazDatePicker.KUP34cbV.js +1 -0
- package/dist/chunks/MazDialog.CtKF3Xzo.js +1 -0
- package/dist/chunks/MazDialogConfirm.CAAHeBPE.js +1 -0
- package/dist/chunks/MazDrawer.Dc_RGG8a.js +1 -0
- package/dist/chunks/MazDropdown.2DUcivzO.js +1 -0
- package/dist/chunks/MazDropzone.CiWiPcFM.js +1 -0
- package/dist/chunks/MazExpandAnimation.CMMwtuQA.js +1 -0
- package/dist/chunks/MazFullscreenLoader.BIVRcZJ8.js +1 -0
- package/dist/chunks/MazGallery.CEmGy0K9.js +1 -0
- package/dist/chunks/MazIcon.ZWAk25ZX.js +1 -0
- package/dist/chunks/MazInput.DJjWLaKg.js +1 -0
- package/dist/chunks/MazInputCode.DKnl3i-X.js +1 -0
- package/dist/chunks/MazInputNumber.B42Mn-9h.js +1 -0
- package/dist/chunks/MazInputPhoneNumber.CLivThtK.js +1 -0
- package/dist/chunks/MazInputPrice.BeL-M944.js +1 -0
- package/dist/chunks/MazInputTags.CIVT9F6Q.js +1 -0
- package/dist/chunks/MazLazyImg.-EMwandx.js +1 -0
- package/dist/chunks/MazLink.BOpxMATj.js +1 -0
- package/dist/chunks/MazLoadingBar.C86AX2Tk.js +1 -0
- package/dist/chunks/MazPagination.CNNKXBsg.js +1 -0
- package/dist/chunks/MazPickerCalendarDays.CSZZbk5Z.js +1 -0
- package/dist/chunks/MazPickerCalendarGrid.DrUHBH6-.js +1 -0
- package/dist/chunks/MazPickerContainer.BZ74M74V.js +1 -0
- package/dist/chunks/MazPopover.Co8BEopX.js +1 -0
- package/dist/chunks/MazPullToRefresh.DMtb6Oa3.js +1 -0
- package/dist/chunks/MazRadio.75ipjTw2.js +1 -0
- package/dist/chunks/MazRadioButtons.DenHCgB3.js +1 -0
- package/dist/chunks/MazReadMore.CDXacQIw.js +1 -0
- package/dist/chunks/MazReadingProgressBar.828Y0mxA.js +1 -0
- package/dist/chunks/MazSelect.yYFAbBb5.js +1 -0
- package/dist/chunks/MazSelectCountry.DvVgk2es.js +1 -0
- package/dist/chunks/MazSkeleton.BewTYJC2.js +1 -0
- package/dist/chunks/MazSlider.BS5QHWK6.js +1 -0
- package/dist/chunks/MazSpinner.D3NN2pow.js +1 -0
- package/dist/chunks/MazStepper.DTu8HG9T.js +1 -0
- package/dist/chunks/MazSwitch.Dvmj-rTW.js +1 -0
- package/dist/chunks/MazTable.DnOehvN6.js +1 -0
- package/dist/chunks/MazTableCell.xbm2NGWL.js +1 -0
- package/dist/chunks/MazTableRow.B5dJiXk1.js +1 -0
- package/dist/chunks/MazTableTitle.DNA_1mCy.js +1 -0
- package/dist/chunks/MazTabs.-0-YP3QQ.js +1 -0
- package/dist/chunks/MazTabsBar.D2JVKMS7.js +1 -0
- package/dist/chunks/MazTabsContent.C9omK25X.js +1 -0
- package/dist/chunks/MazTabsContentItem.mJEAS5R8.js +1 -0
- package/dist/chunks/MazTextarea.BliEP5G5.js +1 -0
- package/dist/chunks/MazUiProvider.BgN8V0lD.js +1 -0
- package/dist/chunks/_plugin-vue_export-helper.ChmETRGw.js +1 -0
- package/dist/chunks/dialog.DexeIC3K.js +1 -0
- package/dist/chunks/dom-events.BPrKJiCz.js +1 -0
- package/dist/chunks/resolveLinkComponent.DAc3sqGH.js +1 -0
- package/dist/chunks/toast.UQ8RRuT9.js +1 -0
- package/dist/chunks/types.DDbvTVqf.js +1 -0
- package/dist/chunks/useMazInputPhoneNumber.B_qQ0ldP.js +1 -0
- package/dist/chunks/utils.B8bfGQxN.js +1 -0
- package/dist/chunks/vFullscreenImg.CZeRh3mw.js +1 -0
- package/dist/chunks/vLazyImg.CXmd3Lp0.js +1 -0
- package/dist/chunks/vZoomImg.CaAHb98S.js +124 -0
- package/dist/components/MazAccordion.js +1 -86
- package/dist/components/MazAlert.js +1 -85
- package/dist/components/MazAnimatedCounter.js +1 -73
- package/dist/components/MazAnimatedElement.js +1 -44
- package/dist/components/MazAnimatedText.js +1 -103
- package/dist/components/MazAvatar.js +1 -125
- package/dist/components/MazBackdrop.js +1 -163
- package/dist/components/MazBadge.js +1 -29
- package/dist/components/MazBottomSheet.js +1 -55
- package/dist/components/MazBtn.js +1 -109
- package/dist/components/MazBtnGroup.js +1 -44
- package/dist/components/MazCard.js +1 -184
- package/dist/components/MazCardSpotlight.js +1 -81
- package/dist/components/MazCarousel.js +1 -104
- package/dist/components/MazChart.js +1 -4
- package/dist/components/MazCheckbox.js +1 -128
- package/dist/components/MazChecklist.js +1 -133
- package/dist/components/MazCircularProgressBar.js +1 -131
- package/dist/components/MazContainer.js +1 -71
- package/dist/components/MazDatePicker/MazPickerCalendar.js +1 -113
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarDays.js +1 -19
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarGrid.js +1 -181
- package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarMonth.js +1 -75
- package/dist/components/MazDatePicker/MazPickerCalendarSwitcher.js +1 -90
- package/dist/components/MazDatePicker/MazPickerContainer.js +1 -116
- package/dist/components/MazDatePicker/MazPickerHeader.js +1 -126
- package/dist/components/MazDatePicker/MazPickerMonthSwitcher.js +1 -82
- package/dist/components/MazDatePicker/MazPickerShortcuts.js +1 -55
- package/dist/components/MazDatePicker/MazPickerTime.js +1 -178
- package/dist/components/MazDatePicker/MazPickerYearSwitcher.js +1 -95
- package/dist/components/MazDatePicker.js +1 -466
- package/dist/components/MazDatePicker.vue.d.ts +2 -6
- package/dist/components/MazDialog.js +1 -115
- package/dist/components/MazDialog.vue.d.ts +2 -6
- package/dist/components/MazDialogConfirm.js +1 -6
- package/dist/components/MazDialogConfirm.vue.d.ts +2 -6
- package/dist/components/MazDrawer.js +1 -70
- package/dist/components/MazDropdown.js +1 -277
- package/dist/components/MazDropdown.vue.d.ts +2 -6
- package/dist/components/MazDropzone.js +1 -533
- package/dist/components/MazExpandAnimation.js +1 -46
- package/dist/components/MazFullscreenLoader.js +1 -38
- package/dist/components/MazGallery.js +1 -105
- package/dist/components/MazIcon.js +1 -114
- package/dist/components/MazInput.js +1 -256
- package/dist/components/MazInputCode.js +1 -152
- package/dist/components/MazInputNumber.js +1 -152
- package/dist/components/MazInputPhoneNumber/PhoneInput.js +1 -114
- package/dist/components/MazInputPhoneNumber.js +1 -253
- package/dist/components/MazInputPrice.js +1 -4
- package/dist/components/MazInputTags.js +1 -145
- package/dist/components/MazLazyImg.js +1 -62
- package/dist/components/MazLink.js +1 -80
- package/dist/components/MazLoadingBar.js +1 -24
- package/dist/components/MazPagination.js +1 -184
- package/dist/components/MazPopover.js +1 -326
- package/dist/components/MazPullToRefresh.js +1 -145
- package/dist/components/MazRadio.js +1 -103
- package/dist/components/MazRadioButtons.js +1 -135
- package/dist/components/MazReadMore.js +1 -110
- package/dist/components/MazReadingProgressBar.js +1 -68
- package/dist/components/MazSelect.js +1 -413
- package/dist/components/MazSelectCountry.js +1 -192
- package/dist/components/MazSkeleton.js +1 -50
- package/dist/components/MazSlider.js +1 -205
- package/dist/components/MazSpinner.js +1 -27
- package/dist/components/MazStepper.js +1 -170
- package/dist/components/MazSwitch.js +1 -4
- package/dist/components/MazTable.js +1 -8
- package/dist/components/MazTableCell.js +1 -18
- package/dist/components/MazTableRow.js +1 -26
- package/dist/components/MazTableTitle.js +1 -18
- package/dist/components/MazTabs.js +1 -4
- package/dist/components/MazTabsBar.js +1 -138
- package/dist/components/MazTabsContent.js +1 -4
- package/dist/components/MazTabsContentItem.js +1 -37
- package/dist/components/MazTextarea.js +1 -147
- package/dist/components/MazUiProvider.js +1 -4
- package/dist/components/index.js +1 -127
- package/dist/composables/index.js +1 -44
- package/dist/composables/useAos.js +1 -7
- package/dist/composables/useBreakpoints.js +1 -34
- package/dist/composables/useDialog.js +1 -7
- package/dist/composables/useDisplayNames.js +1 -111
- package/dist/composables/useDropzone.js +1 -66
- package/dist/composables/useFormField.js +1 -101
- package/dist/composables/useFormValidator.js +1 -163
- package/dist/composables/useFreezeValue.js +1 -8
- package/dist/composables/useIdleTimeout.js +1 -10
- package/dist/composables/useInjectStrict.js +1 -10
- package/dist/composables/useInstanceUniqId.js +1 -12
- package/dist/composables/useMountComponent.js +1 -16
- package/dist/composables/useMutationObserver.js +1 -37
- package/dist/composables/useReadingTime.js +1 -33
- package/dist/composables/useStringMatching.js +1 -42
- package/dist/composables/useSwipe.js +1 -26
- package/dist/composables/useTimer.js +1 -36
- package/dist/composables/useToast.js +1 -14
- package/dist/composables/useUserVisibility.js +1 -10
- package/dist/composables/useWait.js +1 -7
- package/dist/composables/useWindowSize.js +1 -21
- package/dist/directives/index.js +1 -19
- package/dist/directives/vClickOutside.js +1 -104
- package/dist/directives/vFullscreenImg.js +1 -10
- package/dist/directives/vLazyImg.js +1 -23
- package/dist/directives/vTooltip.js +1 -161
- package/dist/directives/vZoomImg.js +1 -286
- package/dist/index.js +1 -1
- package/dist/plugins/aos.js +1 -89
- package/dist/plugins/dialog.js +1 -61
- package/dist/plugins/index.js +1 -17
- package/dist/plugins/maz-ui.js +1 -11
- package/dist/plugins/toast.js +1 -261
- package/dist/plugins/wait.js +1 -43
- package/dist/resolvers/MazComponentsResolver.js +1 -18
- package/dist/resolvers/MazDirectivesResolver.js +1 -14
- package/dist/resolvers/MazModulesResolver.js +1 -76
- package/dist/resolvers/index.js +1 -8
- package/dist/tailwindcss/index.js +1 -20
- package/dist/tailwindcss/tailwind.config.js +1 -35
- package/dist/tailwindcss/utils/colors.js +1 -25
- package/dist/tailwindcss/variables/breakpoints.js +1 -29
- package/dist/tailwindcss/variables/colors.js +1 -33
- package/dist/tailwindcss/variables/design-tokens.js +1 -42
- package/dist/tailwindcss/variables/utilities.js +1 -20
- package/dist/tailwindcss/variables/z-indexes.js +1 -17
- package/package.json +12 -13
- package/dist/chunks/MazChart.vue_vue_type_script_setup_true_lang.DpG9UYdm.js +0 -50
- package/dist/chunks/MazDialogConfirm.vue_vue_type_script_setup_true_lang.BB2rYkwY.js +0 -215
- package/dist/chunks/MazInputPrice.vue_vue_type_script_setup_true_lang.DcNkyw1C.js +0 -77
- package/dist/chunks/MazSwitch.vue_vue_type_style_index_0_lang.lYfYsI0R.js +0 -84
- package/dist/chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js +0 -517
- package/dist/chunks/MazTabs.vue_vue_type_script_setup_true_lang.CiIFxs7J.js +0 -28
- package/dist/chunks/MazTabsContent.vue_vue_type_script_setup_true_lang.MO7zA8LZ.js +0 -26
- package/dist/chunks/MazUiProvider.vue_vue_type_script_setup_true_lang.DtnM1DOn.js +0 -34
- package/dist/chunks/_plugin-vue_export-helper.B--vMWp3.js +0 -9
- package/dist/chunks/dom-events.DTx6Kblx.js +0 -368
- package/dist/chunks/fullscreen-img.directive.BJieSSIt.js +0 -321
- package/dist/chunks/lazy-img.directive.GRfYbidn.js +0 -174
- package/dist/chunks/resolveLinkComponent.CKR2McYy.js +0 -8
- package/dist/chunks/types.D0Bp_UhS.js +0 -6
- package/dist/chunks/useMazInputPhoneNumber.Os-2y9bz.js +0 -157
- package/dist/chunks/utils.D89Q5cCP.js +0 -207
- /package/dist/assets/{fullscreen-img.DFp1SMPU.css → vFullscreenImg.DFp1SMPU.css} +0 -0
|
@@ -1,70 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MazXMark } from "@maz-ui/icons/static";
|
|
3
|
-
import MazBackdrop from "./MazBackdrop.js";
|
|
4
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
5
|
-
import '../assets/MazDrawer.CmPjFbhW.css';const _hoisted_1 = { class: "m-drawer-header__title" }, _hoisted_2 = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "m-drawer-header__close"
|
|
8
|
-
}, _hoisted_3 = { class: "m-drawer-body" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
__name: "MazDrawer",
|
|
10
|
-
props: {
|
|
11
|
-
title: { default: void 0 },
|
|
12
|
-
variant: { default: "right" },
|
|
13
|
-
size: { default: "30rem" },
|
|
14
|
-
backdropClass: { default: void 0 },
|
|
15
|
-
hideCloseButton: { type: Boolean }
|
|
16
|
-
},
|
|
17
|
-
emits: ["before-close", "open", "close", "update:model-value"],
|
|
18
|
-
setup(__props) {
|
|
19
|
-
const props = __props, MazBtn = defineAsyncComponent(() => import("./MazBtn.js")), justify = computed(() => props.variant === "left" ? "start" : props.variant === "right" ? "end" : "none"), align = computed(() => props.variant === "top" ? "start" : props.variant === "bottom" ? "end" : "none"), slots = useSlots(), hasTitle = computed(() => !!(props.title || slots.title));
|
|
20
|
-
return (_ctx, _cache) => (openBlock(), createBlock(MazBackdrop, {
|
|
21
|
-
"backdrop-class": ["m-drawer", __props.backdropClass],
|
|
22
|
-
justify: justify.value,
|
|
23
|
-
align: align.value,
|
|
24
|
-
variant: "drawer",
|
|
25
|
-
"transition-name": `drawer-anim-${__props.variant}`,
|
|
26
|
-
onClose: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close")),
|
|
27
|
-
onOpen: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("open")),
|
|
28
|
-
onBeforeClose: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("before-close")),
|
|
29
|
-
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.$emit("update:model-value", $event))
|
|
30
|
-
}, {
|
|
31
|
-
default: withCtx(({ close }) => [
|
|
32
|
-
createElementVNode("div", {
|
|
33
|
-
class: normalizeClass(["m-drawer-content-wrap", [`--${__props.variant}`]]),
|
|
34
|
-
style: normalizeStyle({
|
|
35
|
-
"--maz-drawer-size": __props.size
|
|
36
|
-
})
|
|
37
|
-
}, [
|
|
38
|
-
createElementVNode("header", {
|
|
39
|
-
class: normalizeClass(["m-drawer-header", [hasTitle.value ? "--justify-between" : "--justify-end"]])
|
|
40
|
-
}, [
|
|
41
|
-
createElementVNode("h4", _hoisted_1, [
|
|
42
|
-
renderSlot(_ctx.$slots, "title", { close }, () => [
|
|
43
|
-
createTextVNode(toDisplayString(__props.title), 1)
|
|
44
|
-
], !0)
|
|
45
|
-
]),
|
|
46
|
-
__props.hideCloseButton ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
47
|
-
createVNode(unref(MazBtn), {
|
|
48
|
-
size: "sm",
|
|
49
|
-
color: "transparent",
|
|
50
|
-
onClick: close
|
|
51
|
-
}, {
|
|
52
|
-
default: withCtx(() => [
|
|
53
|
-
createVNode(unref(MazXMark), { class: "icon maz-text-lg" })
|
|
54
|
-
]),
|
|
55
|
-
_: 1
|
|
56
|
-
}, 8, ["onClick"])
|
|
57
|
-
]))
|
|
58
|
-
], 2),
|
|
59
|
-
createElementVNode("div", _hoisted_3, [
|
|
60
|
-
renderSlot(_ctx.$slots, "default", { close }, void 0, !0)
|
|
61
|
-
])
|
|
62
|
-
], 6)
|
|
63
|
-
]),
|
|
64
|
-
_: 3
|
|
65
|
-
}, 8, ["backdrop-class", "justify", "align", "transition-name"]));
|
|
66
|
-
}
|
|
67
|
-
}), MazDrawer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-50d9de90"]]);
|
|
68
|
-
export {
|
|
69
|
-
MazDrawer as default
|
|
70
|
-
};
|
|
1
|
+
import"../chunks/MazBackdrop.Cjbwi8-V.js";import{t as MazDrawer_default}from"../chunks/MazDrawer.Dc_RGG8a.js";export{MazDrawer_default as default};
|
|
@@ -1,277 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { MazChevronDown } from "@maz-ui/icons/static";
|
|
3
|
-
import { useTranslations } from "@maz-ui/translations/composables/useTranslations";
|
|
4
|
-
import { isClient } from "@maz-ui/utils/helpers/isClient";
|
|
5
|
-
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
6
|
-
import MazPopover from "./MazPopover.js";
|
|
7
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
8
|
-
import '../assets/MazDropdown.gQ0Sr_Kf.css';const _hoisted_1 = ["id"], _hoisted_2 = ["id"], _hoisted_3 = ["id"], _hoisted_4 = ["onClick", "onKeypress"], _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
inheritAttrs: !1,
|
|
10
|
-
__name: "MazDropdown",
|
|
11
|
-
props: /* @__PURE__ */ mergeModels({
|
|
12
|
-
modelValue: { type: Boolean },
|
|
13
|
-
style: { type: [Boolean, null, String, Object, Array] },
|
|
14
|
-
class: { type: [Boolean, null, String, Object, Array] },
|
|
15
|
-
items: { default: () => [] },
|
|
16
|
-
id: {},
|
|
17
|
-
trigger: { default: "adaptive" },
|
|
18
|
-
color: { default: "transparent" },
|
|
19
|
-
position: { default: "auto" },
|
|
20
|
-
closeOnClick: { type: Boolean, default: !1 },
|
|
21
|
-
disabled: { type: Boolean, default: !1 },
|
|
22
|
-
chevron: { type: Boolean, default: !0 },
|
|
23
|
-
screenReaderDescription: {},
|
|
24
|
-
menuPanelClass: { type: [Boolean, null, String, Object, Array] },
|
|
25
|
-
menuPanelStyle: { type: [Boolean, null, String, Object, Array] },
|
|
26
|
-
block: { type: Boolean },
|
|
27
|
-
dropdownIcon: { type: [String, Function, Object] },
|
|
28
|
-
dropdownIconAnimation: { type: Boolean, default: !0 },
|
|
29
|
-
size: { default: "md" },
|
|
30
|
-
transition: { default: "scale-pop" },
|
|
31
|
-
preferPosition: { default: "bottom-start" },
|
|
32
|
-
fallbackPosition: {},
|
|
33
|
-
ariaLabel: {},
|
|
34
|
-
announceChanges: { type: Boolean },
|
|
35
|
-
offset: {},
|
|
36
|
-
delay: {},
|
|
37
|
-
hoverDelay: {},
|
|
38
|
-
teleportTo: {},
|
|
39
|
-
overlayClass: { type: [Boolean, null, String, Object, Array] },
|
|
40
|
-
panelClass: { type: [Boolean, null, String, Object, Array] },
|
|
41
|
-
panelStyle: { type: [Boolean, null, String, Object, Array] },
|
|
42
|
-
closeOnClickOutside: { type: Boolean },
|
|
43
|
-
closeOnEscape: { type: Boolean },
|
|
44
|
-
persistent: { type: Boolean },
|
|
45
|
-
ariaLabelledby: {},
|
|
46
|
-
ariaDescribedby: {},
|
|
47
|
-
trapFocus: { type: Boolean },
|
|
48
|
-
keepOpenOnHover: { type: Boolean },
|
|
49
|
-
positionReference: {}
|
|
50
|
-
}, {
|
|
51
|
-
modelValue: {
|
|
52
|
-
default: !1
|
|
53
|
-
},
|
|
54
|
-
modelModifiers: {}
|
|
55
|
-
}),
|
|
56
|
-
emits: /* @__PURE__ */ mergeModels(["menuitem-clicked", "update:model-value"], ["update:modelValue"]),
|
|
57
|
-
setup(__props, { emit: __emit }) {
|
|
58
|
-
const emits = __emit, MazBtn = defineAsyncComponent(() => import("./MazBtn.js")), MazIcon = defineAsyncComponent(() => import("./MazIcon.js")), MazLink = defineAsyncComponent(() => import("./MazLink.js")), instanceId = useInstanceUniqId({
|
|
59
|
-
componentName: "MazDropdown",
|
|
60
|
-
providedId: __props.id
|
|
61
|
-
}), { t } = useTranslations(), isOpen = useModel(__props, "modelValue"), iconClassSize = computed(() => __props.size === "xl" ? "maz-text-lg" : __props.size === "lg" || __props.size === "md" || __props.size === "sm" ? "maz-text-base" : __props.size === "xs" || __props.size === "mini" ? "maz-text-sm" : "maz-text-lg");
|
|
62
|
-
function setDropdown(value) {
|
|
63
|
-
__props.disabled || (isOpen.value = value);
|
|
64
|
-
}
|
|
65
|
-
function isLinkItem(item) {
|
|
66
|
-
return "href" in item || "to" in item;
|
|
67
|
-
}
|
|
68
|
-
async function runAction(item, event) {
|
|
69
|
-
emits("menuitem-clicked", event), await item.onClick?.(), closeDropdown();
|
|
70
|
-
}
|
|
71
|
-
function closeDropdown() {
|
|
72
|
-
__props.closeOnClick && setDropdown(!1);
|
|
73
|
-
}
|
|
74
|
-
function keydownHandler(event) {
|
|
75
|
-
["ArrowDown", "ArrowUp"].includes(event.key) ? arrowHandler(event) : event.key === "Enter" && (event.preventDefault(), document.activeElement?.click(), closeDropdown());
|
|
76
|
-
}
|
|
77
|
-
function arrowHandler(event) {
|
|
78
|
-
event.preventDefault();
|
|
79
|
-
const code = event.key, itemLength = __props.items?.length;
|
|
80
|
-
if (!itemLength)
|
|
81
|
-
return;
|
|
82
|
-
const currentElement = document.activeElement, itemsElements = document.querySelectorAll(`#${instanceId.value}-menu .menuitem`), currentIndex = [...itemsElements].indexOf(currentElement);
|
|
83
|
-
if (currentIndex === -1) {
|
|
84
|
-
itemsElements[0]?.focus();
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const nextIndex = code === "ArrowDown" ? (currentIndex + 1) % itemLength : (currentIndex - 1 + itemLength) % itemLength;
|
|
88
|
-
itemsElements[nextIndex]?.focus();
|
|
89
|
-
}
|
|
90
|
-
const mazPopoverElement = useTemplateRef("mazPopoverRef");
|
|
91
|
-
function onBlurTrigger(event) {
|
|
92
|
-
event.preventDefault();
|
|
93
|
-
const nextElementSibling = mazPopoverElement.value?.panelRef, relatedTarget = event.relatedTarget;
|
|
94
|
-
nextElementSibling?.contains(relatedTarget) || setDropdown(!1);
|
|
95
|
-
}
|
|
96
|
-
return watch(
|
|
97
|
-
isOpen,
|
|
98
|
-
(value) => {
|
|
99
|
-
isClient() && (value ? document.addEventListener("keydown", keydownHandler) : document.removeEventListener("keydown", keydownHandler));
|
|
100
|
-
}
|
|
101
|
-
), (_ctx, _cache) => (openBlock(), createBlock(MazPopover, {
|
|
102
|
-
ref: "mazPopoverRef",
|
|
103
|
-
trigger: __props.trigger,
|
|
104
|
-
"model-value": isOpen.value,
|
|
105
|
-
class: normalizeClass(["m-dropdown m-reset-css", [__props.class]]),
|
|
106
|
-
role: "menu",
|
|
107
|
-
style: normalizeStyle(__props.style),
|
|
108
|
-
"prefer-position": __props.preferPosition,
|
|
109
|
-
color: "background",
|
|
110
|
-
position: __props.position,
|
|
111
|
-
transition: __props.transition,
|
|
112
|
-
disabled: __props.disabled,
|
|
113
|
-
offset: __props.offset,
|
|
114
|
-
delay: __props.delay,
|
|
115
|
-
"fallback-position": __props.fallbackPosition,
|
|
116
|
-
persistent: __props.persistent,
|
|
117
|
-
"hover-delay": __props.hoverDelay,
|
|
118
|
-
"panel-class": __props.panelClass,
|
|
119
|
-
"panel-style": __props.panelStyle,
|
|
120
|
-
"close-on-escape": __props.closeOnEscape,
|
|
121
|
-
"close-on-click": __props.closeOnClick,
|
|
122
|
-
"teleport-to": __props.teleportTo,
|
|
123
|
-
"trap-focus": __props.trapFocus,
|
|
124
|
-
"overlay-class": __props.overlayClass,
|
|
125
|
-
"close-on-click-outside": __props.closeOnClickOutside,
|
|
126
|
-
"aria-describedby": __props.ariaDescribedby,
|
|
127
|
-
"announce-changes": __props.announceChanges,
|
|
128
|
-
"aria-label": __props.ariaLabel,
|
|
129
|
-
"aria-labelledby": __props.ariaLabelledby,
|
|
130
|
-
"position-reference": __props.positionReference,
|
|
131
|
-
"keep-open-on-hover": __props.trigger === "hover" || __props.trigger === "adaptive",
|
|
132
|
-
block: __props.block,
|
|
133
|
-
"onUpdate:modelValue": setDropdown
|
|
134
|
-
}, {
|
|
135
|
-
trigger: withCtx(({ toggle, close, open }) => [
|
|
136
|
-
createElementVNode("div", {
|
|
137
|
-
id: unref(instanceId),
|
|
138
|
-
tabindex: "-1",
|
|
139
|
-
class: "m-dropdown__wrapper"
|
|
140
|
-
}, [
|
|
141
|
-
createElementVNode("span", {
|
|
142
|
-
id: `${unref(instanceId)}-labelspan`,
|
|
143
|
-
class: "maz-sr-only"
|
|
144
|
-
}, [
|
|
145
|
-
renderSlot(_ctx.$slots, "screen-reader-description", {}, () => [
|
|
146
|
-
createTextVNode(toDisplayString(__props.screenReaderDescription || unref(t)("dropdown.screenReaderDescription")), 1)
|
|
147
|
-
], !0)
|
|
148
|
-
], 8, _hoisted_2),
|
|
149
|
-
renderSlot(_ctx.$slots, "trigger", {
|
|
150
|
-
isOpen: isOpen.value,
|
|
151
|
-
toggle,
|
|
152
|
-
close,
|
|
153
|
-
open
|
|
154
|
-
}, () => [
|
|
155
|
-
createVNode(unref(MazBtn), mergeProps({
|
|
156
|
-
"aria-labelledby": `${unref(instanceId)}-labelspan`,
|
|
157
|
-
color: __props.color,
|
|
158
|
-
disabled: __props.disabled
|
|
159
|
-
}, _ctx.$attrs, {
|
|
160
|
-
block: __props.block,
|
|
161
|
-
size: __props.size,
|
|
162
|
-
onKeydown: [
|
|
163
|
-
withKeys(withModifiers(toggle, ["stop", "prevent"]), ["enter"]),
|
|
164
|
-
withKeys(withModifiers(toggle, ["stop", "prevent"]), ["space"]),
|
|
165
|
-
withKeys(withModifiers(close, ["stop", "prevent"]), ["escape"])
|
|
166
|
-
],
|
|
167
|
-
onBlur: withModifiers(onBlurTrigger, ["stop", "prevent"])
|
|
168
|
-
}), createSlots({
|
|
169
|
-
default: withCtx(() => [
|
|
170
|
-
renderSlot(_ctx.$slots, "default", {}, void 0, !0)
|
|
171
|
-
]),
|
|
172
|
-
_: 2
|
|
173
|
-
}, [
|
|
174
|
-
__props.chevron || _ctx.$slots["dropdown-icon"] ? {
|
|
175
|
-
name: "right-icon",
|
|
176
|
-
fn: withCtx(() => [
|
|
177
|
-
renderSlot(_ctx.$slots, "dropdown-icon", {
|
|
178
|
-
isOpen: isOpen.value,
|
|
179
|
-
toggle,
|
|
180
|
-
close,
|
|
181
|
-
open
|
|
182
|
-
}, () => [
|
|
183
|
-
typeof __props.dropdownIcon == "string" ? (openBlock(), createBlock(unref(MazIcon), {
|
|
184
|
-
key: 0,
|
|
185
|
-
name: __props.dropdownIcon,
|
|
186
|
-
class: normalizeClass([{ "--open": isOpen.value && __props.dropdownIconAnimation }, iconClassSize.value])
|
|
187
|
-
}, null, 8, ["name", "class"])) : __props.dropdownIcon ? (openBlock(), createBlock(resolveDynamicComponent(__props.dropdownIcon), {
|
|
188
|
-
key: 1,
|
|
189
|
-
class: normalizeClass([[{ "--open": isOpen.value && __props.dropdownIconAnimation }, iconClassSize.value], "m-dropdown__icon"])
|
|
190
|
-
}, null, 8, ["class"])) : (openBlock(), createBlock(unref(MazChevronDown), {
|
|
191
|
-
key: 2,
|
|
192
|
-
class: normalizeClass([[{ "--open": isOpen.value && __props.dropdownIconAnimation }, iconClassSize.value], "m-dropdown__icon"])
|
|
193
|
-
}, null, 8, ["class"]))
|
|
194
|
-
], !0)
|
|
195
|
-
]),
|
|
196
|
-
key: "0"
|
|
197
|
-
} : void 0
|
|
198
|
-
]), 1040, ["aria-labelledby", "color", "disabled", "block", "size", "onKeydown"])
|
|
199
|
-
], !0)
|
|
200
|
-
], 8, _hoisted_1)
|
|
201
|
-
]),
|
|
202
|
-
default: withCtx(({ open, close, toggle }) => [
|
|
203
|
-
createElementVNode("div", {
|
|
204
|
-
id: `${unref(instanceId)}-menu`,
|
|
205
|
-
role: "menu",
|
|
206
|
-
"aria-label": "Menu",
|
|
207
|
-
class: normalizeClass(["m-dropdown__menu", __props.menuPanelClass]),
|
|
208
|
-
tabindex: "-1",
|
|
209
|
-
style: normalizeStyle(__props.menuPanelStyle)
|
|
210
|
-
}, [
|
|
211
|
-
renderSlot(_ctx.$slots, "dropdown", {
|
|
212
|
-
items: __props.items,
|
|
213
|
-
open,
|
|
214
|
-
close,
|
|
215
|
-
isOpen: isOpen.value,
|
|
216
|
-
toggle
|
|
217
|
-
}, () => [
|
|
218
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(__props.items, (item, index) => renderSlot(_ctx.$slots, "menuitem", {
|
|
219
|
-
key: index,
|
|
220
|
-
item,
|
|
221
|
-
open,
|
|
222
|
-
close,
|
|
223
|
-
isOpen: isOpen.value,
|
|
224
|
-
toggle
|
|
225
|
-
}, () => [
|
|
226
|
-
isLinkItem(item) ? (openBlock(), createBlock(unref(MazLink), mergeProps({
|
|
227
|
-
key: 0,
|
|
228
|
-
target: item.href ? item.target ?? "_self" : void 0,
|
|
229
|
-
to: item.to,
|
|
230
|
-
href: item.href,
|
|
231
|
-
color: item.color ?? "contrast"
|
|
232
|
-
}, { ref_for: !0 }, item, {
|
|
233
|
-
"underline-only-hover": item.underlineOnlyHover ?? !1,
|
|
234
|
-
class: ["menuitem", [item.class]],
|
|
235
|
-
onClick: withModifiers(closeDropdown, ["stop"])
|
|
236
|
-
}), {
|
|
237
|
-
default: withCtx(() => [
|
|
238
|
-
renderSlot(_ctx.$slots, "menuitem-label", {
|
|
239
|
-
item,
|
|
240
|
-
open,
|
|
241
|
-
close,
|
|
242
|
-
isOpen: isOpen.value,
|
|
243
|
-
toggle
|
|
244
|
-
}, () => [
|
|
245
|
-
createTextVNode(toDisplayString(item.label), 1)
|
|
246
|
-
], !0)
|
|
247
|
-
]),
|
|
248
|
-
_: 2
|
|
249
|
-
}, 1040, ["target", "to", "href", "color", "underline-only-hover", "class"])) : (openBlock(), createElementBlock("button", mergeProps({
|
|
250
|
-
key: 1,
|
|
251
|
-
type: "button"
|
|
252
|
-
}, { ref_for: !0 }, { ...item, onClick: void 0 }, {
|
|
253
|
-
class: ["menuitem menuitem__button", [item.class, item.color ? `--${item.color}` : ""]],
|
|
254
|
-
onClick: withModifiers(($event) => runAction(item, $event), ["stop"]),
|
|
255
|
-
onKeypress: withKeys(withModifiers(($event) => runAction(item, $event), ["stop", "prevent"]), ["enter"])
|
|
256
|
-
}), [
|
|
257
|
-
renderSlot(_ctx.$slots, "menuitem-label", {
|
|
258
|
-
item,
|
|
259
|
-
open,
|
|
260
|
-
close,
|
|
261
|
-
isOpen: isOpen.value,
|
|
262
|
-
toggle
|
|
263
|
-
}, () => [
|
|
264
|
-
createTextVNode(toDisplayString(item.label), 1)
|
|
265
|
-
], !0)
|
|
266
|
-
], 16, _hoisted_4))
|
|
267
|
-
], !0)), 128))
|
|
268
|
-
], !0)
|
|
269
|
-
], 14, _hoisted_3)
|
|
270
|
-
]),
|
|
271
|
-
_: 3
|
|
272
|
-
}, 8, ["trigger", "model-value", "style", "prefer-position", "position", "transition", "disabled", "offset", "delay", "fallback-position", "persistent", "hover-delay", "panel-class", "panel-style", "close-on-escape", "close-on-click", "teleport-to", "trap-focus", "overlay-class", "close-on-click-outside", "aria-describedby", "announce-changes", "aria-label", "aria-labelledby", "position-reference", "keep-open-on-hover", "class", "block"]));
|
|
273
|
-
}
|
|
274
|
-
}), MazDropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-06d39d35"]]);
|
|
275
|
-
export {
|
|
276
|
-
MazDropdown as default
|
|
277
|
-
};
|
|
1
|
+
import"../chunks/MazPopover.Co8BEopX.js";import{t as MazDropdown_default}from"../chunks/MazDropdown.2DUcivzO.js";export{MazDropdown_default as default};
|
|
@@ -264,9 +264,7 @@ declare function __VLS_template(): {
|
|
|
264
264
|
readonly "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
265
265
|
readonly "onAfter-close-animation"?: (() => any) | undefined;
|
|
266
266
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
267
|
-
$attrs:
|
|
268
|
-
[x: string]: unknown;
|
|
269
|
-
};
|
|
267
|
+
$attrs: import('vue').Attrs;
|
|
270
268
|
$refs: {
|
|
271
269
|
[x: string]: unknown;
|
|
272
270
|
} & {
|
|
@@ -409,9 +407,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
409
407
|
readonly "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
410
408
|
readonly "onAfter-close-animation"?: (() => any) | undefined;
|
|
411
409
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
412
|
-
$attrs:
|
|
413
|
-
[x: string]: unknown;
|
|
414
|
-
};
|
|
410
|
+
$attrs: import('vue').Attrs;
|
|
415
411
|
$refs: {
|
|
416
412
|
[x: string]: unknown;
|
|
417
413
|
} & {
|