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,326 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { offset, hide, shift, autoPlacement, flip, useFloating, autoUpdate } from "@floating-ui/vue";
|
|
3
|
-
import { isClient } from "@maz-ui/utils/helpers/isClient";
|
|
4
|
-
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
5
|
-
import { vClickOutside as directive } from "../directives/vClickOutside.js";
|
|
6
|
-
import { g as getColor } from "../chunks/types.D0Bp_UhS.js";
|
|
7
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
8
|
-
import '../assets/MazPopover.-QaA_4Xd.css';const _hoisted_1 = ["id", "aria-expanded", "aria-haspopup", "aria-describedby", "aria-labelledby", "aria-controls"], _hoisted_2 = ["id", "role", "aria-label", "aria-labelledby", "aria-describedby", "aria-modal", "tabindex", "aria-live"], _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
name: "MazPopover",
|
|
10
|
-
inheritAttrs: !1,
|
|
11
|
-
__name: "MazPopover",
|
|
12
|
-
props: /* @__PURE__ */ mergeModels({
|
|
13
|
-
modelValue: { type: Boolean },
|
|
14
|
-
position: { default: "auto" },
|
|
15
|
-
preferPosition: {},
|
|
16
|
-
fallbackPosition: {},
|
|
17
|
-
trigger: { default: "click" },
|
|
18
|
-
role: { default: "dialog" },
|
|
19
|
-
ariaLabel: {},
|
|
20
|
-
announceChanges: { type: Boolean, default: !1 },
|
|
21
|
-
disabled: { type: Boolean, default: !1 },
|
|
22
|
-
offset: { default: 8 },
|
|
23
|
-
delay: { default: 0 },
|
|
24
|
-
hoverDelay: { default: 150 },
|
|
25
|
-
transition: { default: "scale-pop" },
|
|
26
|
-
teleportTo: { default: "body" },
|
|
27
|
-
overlayClass: { type: [Boolean, null, String, Object, Array] },
|
|
28
|
-
panelClass: { type: [Boolean, null, String, Object, Array] },
|
|
29
|
-
panelStyle: { type: [Boolean, null, String, Object, Array] },
|
|
30
|
-
closeOnClickOutside: { type: Boolean, default: !0 },
|
|
31
|
-
closeOnEscape: { type: Boolean, default: !0 },
|
|
32
|
-
persistent: { type: Boolean, default: !1 },
|
|
33
|
-
id: {},
|
|
34
|
-
ariaLabelledby: {},
|
|
35
|
-
ariaDescribedby: {},
|
|
36
|
-
color: { default: "background" },
|
|
37
|
-
trapFocus: { type: Boolean, default: !0 },
|
|
38
|
-
keepOpenOnHover: { type: Boolean, default: !1 },
|
|
39
|
-
block: { type: Boolean, default: !1 },
|
|
40
|
-
positionReference: {}
|
|
41
|
-
}, {
|
|
42
|
-
modelValue: { default: !1 },
|
|
43
|
-
modelModifiers: {}
|
|
44
|
-
}),
|
|
45
|
-
emits: /* @__PURE__ */ mergeModels(["update:model-value", "open", "close", "after-close-animation", "toggle"], ["update:modelValue"]),
|
|
46
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
47
|
-
const emits = __emit, triggerId = useInstanceUniqId({
|
|
48
|
-
componentName: "MazPopover",
|
|
49
|
-
providedId: __props.id
|
|
50
|
-
}), attrs = useAttrs(), triggerRef = useTemplateRef("trigger"), panelRef = 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), positionRef = computed(() => {
|
|
62
|
-
if (!__props.positionReference)
|
|
63
|
-
return triggerRef.value;
|
|
64
|
-
if (typeof __props.positionReference == "string") {
|
|
65
|
-
const withinTrigger = triggerRef.value?.querySelector(__props.positionReference);
|
|
66
|
-
return withinTrigger || (isClient() ? document.querySelector(__props.positionReference) : null);
|
|
67
|
-
}
|
|
68
|
-
return __props.positionReference;
|
|
69
|
-
}), reference = computed(() => positionRef.value || triggerRef.value), { floatingStyles, placement, update, middlewareData } = useFloating(
|
|
70
|
-
reference,
|
|
71
|
-
panelRef,
|
|
72
|
-
{
|
|
73
|
-
placement: floatingPosition,
|
|
74
|
-
middleware,
|
|
75
|
-
transform: !1,
|
|
76
|
-
whileElementsMounted: autoUpdate
|
|
77
|
-
}
|
|
78
|
-
), computedPosition = computed(() => placement.value ?? floatingPosition.value), isOpen = useModel(__props, "modelValue");
|
|
79
|
-
let openTimeout = null, closeTimeout = null, initialFocusElement = null, ignoreNextClickOutside = !1;
|
|
80
|
-
const panelId = computed(() => `${triggerId.value}-panel`), rootStyles = computed(() => attrs.style), panelStyles = computed(() => ({
|
|
81
|
-
...floatingStyles.value,
|
|
82
|
-
pointerEvents: isOpen.value ? "auto" : "none"
|
|
83
|
-
})), isTouchDevice = computed(() => isClient() ? "ontouchstart" in globalThis || navigator.maxTouchPoints > 0 : !1), effectiveTrigger = computed(() => __props.trigger === "adaptive" ? isTouchDevice.value ? "click" : "hover" : __props.trigger), triggerEvents = computed(() => {
|
|
84
|
-
if (__props.disabled || effectiveTrigger.value === "manual")
|
|
85
|
-
return {};
|
|
86
|
-
const events = {};
|
|
87
|
-
return effectiveTrigger.value === "hover" && (events.onMouseenter = () => {
|
|
88
|
-
clearCloseTimeout(), open();
|
|
89
|
-
}, events.onMouseleave = close), effectiveTrigger.value === "click" && (events.onClick = toggle), events;
|
|
90
|
-
}), panelEvents = computed(() => effectiveTrigger.value !== "hover" ? {} : {
|
|
91
|
-
onMouseenter: () => {
|
|
92
|
-
__props.keepOpenOnHover && clearCloseTimeout();
|
|
93
|
-
},
|
|
94
|
-
onMouseleave: () => {
|
|
95
|
-
__props.keepOpenOnHover && close();
|
|
96
|
-
}
|
|
97
|
-
}), panelClasses = computed(() => [
|
|
98
|
-
__props.overlayClass,
|
|
99
|
-
__props.panelClass,
|
|
100
|
-
`--position-${computedPosition.value}`,
|
|
101
|
-
`--${getColor(__props.color)}`
|
|
102
|
-
]);
|
|
103
|
-
function cleanup() {
|
|
104
|
-
clearOpenTimeout(), clearCloseTimeout(), isClient() && document.removeEventListener("keydown", onKeydown);
|
|
105
|
-
}
|
|
106
|
-
function open() {
|
|
107
|
-
__props.disabled || (clearCloseTimeout(), effectiveTrigger.value === "click" && (ignoreNextClickOutside = !0), __props.delay > 0 ? openTimeout = setTimeout(() => {
|
|
108
|
-
setOpen(!0);
|
|
109
|
-
}, __props.delay) : setOpen(!0));
|
|
110
|
-
}
|
|
111
|
-
function close() {
|
|
112
|
-
clearOpenTimeout(), __props.delay > 0 && effectiveTrigger.value === "hover" ? closeTimeout = setTimeout(() => {
|
|
113
|
-
setOpen(!1);
|
|
114
|
-
}, __props.delay) : effectiveTrigger.value === "hover" && __props.keepOpenOnHover ? closeTimeout = setTimeout(() => {
|
|
115
|
-
setOpen(!1);
|
|
116
|
-
}, __props.hoverDelay) : setOpen(!1);
|
|
117
|
-
}
|
|
118
|
-
function toggle() {
|
|
119
|
-
isOpen.value ? close() : open();
|
|
120
|
-
}
|
|
121
|
-
function setOpen(value) {
|
|
122
|
-
isOpen.value = value, ignoreNextClickOutside = !1, value ? (emits("open"), emits("toggle", value), nextTick(() => {
|
|
123
|
-
update(), setupFocusTrap();
|
|
124
|
-
})) : (emits("toggle", value), emits("close"), __props.trapFocus && restoreFocus());
|
|
125
|
-
}
|
|
126
|
-
function clearOpenTimeout() {
|
|
127
|
-
openTimeout && (clearTimeout(openTimeout), openTimeout = null);
|
|
128
|
-
}
|
|
129
|
-
function clearCloseTimeout() {
|
|
130
|
-
closeTimeout && (clearTimeout(closeTimeout), closeTimeout = null);
|
|
131
|
-
}
|
|
132
|
-
function getTransformOrigin(position) {
|
|
133
|
-
switch (position) {
|
|
134
|
-
case "top":
|
|
135
|
-
return "center bottom";
|
|
136
|
-
case "top-start":
|
|
137
|
-
return "left bottom";
|
|
138
|
-
case "top-end":
|
|
139
|
-
return "right bottom";
|
|
140
|
-
case "bottom":
|
|
141
|
-
return "center top";
|
|
142
|
-
case "bottom-start":
|
|
143
|
-
return "left top";
|
|
144
|
-
case "bottom-end":
|
|
145
|
-
return "right top";
|
|
146
|
-
case "left":
|
|
147
|
-
return "right center";
|
|
148
|
-
case "left-start":
|
|
149
|
-
return "right top";
|
|
150
|
-
case "left-end":
|
|
151
|
-
return "right bottom";
|
|
152
|
-
case "right":
|
|
153
|
-
return "left center";
|
|
154
|
-
case "right-start":
|
|
155
|
-
return "left top";
|
|
156
|
-
case "right-end":
|
|
157
|
-
return "left bottom";
|
|
158
|
-
default:
|
|
159
|
-
return "center";
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function setupFocusTrap() {
|
|
163
|
-
__props.role === "tooltip" || effectiveTrigger.value === "hover" || !__props.trapFocus || !isClient() || (initialFocusElement = document.activeElement, nextTick(() => {
|
|
164
|
-
const focusableElements = panelRef.value?.querySelectorAll(
|
|
165
|
-
'a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select, [tabindex]:not([tabindex="-1"])'
|
|
166
|
-
);
|
|
167
|
-
focusableElements && focusableElements.length > 0 ? focusableElements[0].focus({ preventScroll: !0 }) : panelRef.value?.focus({ preventScroll: !0 });
|
|
168
|
-
}));
|
|
169
|
-
}
|
|
170
|
-
function restoreFocus() {
|
|
171
|
-
__props.role === "tooltip" || effectiveTrigger.value === "hover" || !__props.trapFocus || !isClient() || nextTick(() => {
|
|
172
|
-
initialFocusElement?.focus({ preventScroll: !0 });
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
function onKeydown(event) {
|
|
176
|
-
isOpen.value && (event.key === "Escape" && __props.closeOnEscape && !__props.persistent && (event.preventDefault(), close()), event.key === "Tab" && __props.trapFocus && handleTrapFocus(event));
|
|
177
|
-
}
|
|
178
|
-
function handleTrapFocus(event) {
|
|
179
|
-
if (!panelRef.value || !isClient())
|
|
180
|
-
return;
|
|
181
|
-
const focusableElements = panelRef.value.querySelectorAll(
|
|
182
|
-
'a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select, [tabindex]:not([tabindex="-1"])'
|
|
183
|
-
);
|
|
184
|
-
if (focusableElements.length === 0)
|
|
185
|
-
return;
|
|
186
|
-
const firstElement = focusableElements[0], lastElement = focusableElements[focusableElements.length - 1];
|
|
187
|
-
event.shiftKey ? document.activeElement === firstElement && (event.preventDefault(), lastElement.focus()) : document.activeElement === lastElement && (event.preventDefault(), firstElement.focus());
|
|
188
|
-
}
|
|
189
|
-
function onClickOutside(event) {
|
|
190
|
-
if (effectiveTrigger.value !== "manual") {
|
|
191
|
-
if (ignoreNextClickOutside) {
|
|
192
|
-
ignoreNextClickOutside = !1;
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (__props.closeOnClickOutside && !__props.persistent) {
|
|
196
|
-
if (triggerRef.value && triggerRef.value.contains(event.target))
|
|
197
|
-
return;
|
|
198
|
-
close();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return watch(isOpen, (value, oldValue) => {
|
|
203
|
-
!isClient() || value === oldValue || (value ? open() : oldValue && !value && close());
|
|
204
|
-
}, { immediate: !0 }), watch(() => __props.position, () => {
|
|
205
|
-
isOpen.value && nextTick(() => update());
|
|
206
|
-
}), onMounted(() => {
|
|
207
|
-
document.addEventListener("keydown", onKeydown);
|
|
208
|
-
}), onBeforeUnmount(cleanup), onUnmounted(cleanup), __expose({
|
|
209
|
-
/**
|
|
210
|
-
* Open the popover
|
|
211
|
-
* @description Programmatically open the popover
|
|
212
|
-
* @usage `mazPopoverInstance.value?.open()`
|
|
213
|
-
*/
|
|
214
|
-
open,
|
|
215
|
-
/**
|
|
216
|
-
* Close the popover
|
|
217
|
-
* @description Programmatically close the popover
|
|
218
|
-
* @usage `mazPopoverInstance.value?.close()`
|
|
219
|
-
*/
|
|
220
|
-
close,
|
|
221
|
-
/**
|
|
222
|
-
* Toggle the popover
|
|
223
|
-
* @description Programmatically toggle the popover open/close state
|
|
224
|
-
* @usage `mazPopoverInstance.value?.toggle()`
|
|
225
|
-
*/
|
|
226
|
-
toggle,
|
|
227
|
-
/**
|
|
228
|
-
* Check if the popover is open
|
|
229
|
-
* @type {ModelRef<boolean>}
|
|
230
|
-
* @description Reactive reference to the popover open state
|
|
231
|
-
* @usage `const isPopoverOpen = mazPopoverInstance.value?.isOpen`
|
|
232
|
-
*/
|
|
233
|
-
isOpen,
|
|
234
|
-
/**
|
|
235
|
-
* Update the popover position
|
|
236
|
-
* @description Manually recalculate and update the popover position
|
|
237
|
-
* @usage `mazPopoverInstance.value?.updatePosition()`
|
|
238
|
-
*/
|
|
239
|
-
updatePosition: update,
|
|
240
|
-
/**
|
|
241
|
-
* Panel reference
|
|
242
|
-
* @type {Ref<HTMLElement>}
|
|
243
|
-
* @description Reference to the popover panel element
|
|
244
|
-
* @usage `mazPopoverInstance.value?.panelRef`
|
|
245
|
-
*/
|
|
246
|
-
panelRef
|
|
247
|
-
}), (_ctx, _cache) => (openBlock(), createElementBlock(Fragment, null, [
|
|
248
|
-
_ctx.$slots.trigger ? (openBlock(), createElementBlock("div", {
|
|
249
|
-
key: 0,
|
|
250
|
-
class: normalizeClass(["m-popover m-reset-css", [
|
|
251
|
-
unref(attrs).class,
|
|
252
|
-
{
|
|
253
|
-
"--open": isOpen.value,
|
|
254
|
-
"--disabled": __props.disabled,
|
|
255
|
-
"--block": __props.block
|
|
256
|
-
}
|
|
257
|
-
]]),
|
|
258
|
-
style: normalizeStyle(rootStyles.value)
|
|
259
|
-
}, [
|
|
260
|
-
createElementVNode("div", mergeProps({
|
|
261
|
-
id: unref(triggerId),
|
|
262
|
-
ref: "trigger",
|
|
263
|
-
role: "button",
|
|
264
|
-
class: "m-popover-trigger",
|
|
265
|
-
"aria-expanded": __props.role === "dialog" || __props.role === "menu" ? isOpen.value : void 0,
|
|
266
|
-
"aria-haspopup": __props.role === "dialog" ? "dialog" : void 0,
|
|
267
|
-
"aria-describedby": __props.role === "tooltip" && isOpen.value ? panelId.value : __props.ariaDescribedby,
|
|
268
|
-
"aria-labelledby": __props.ariaLabelledby,
|
|
269
|
-
"aria-controls": panelId.value
|
|
270
|
-
}, triggerEvents.value), [
|
|
271
|
-
renderSlot(_ctx.$slots, "trigger", {
|
|
272
|
-
open,
|
|
273
|
-
close,
|
|
274
|
-
toggle,
|
|
275
|
-
isOpen: isOpen.value,
|
|
276
|
-
trigger: effectiveTrigger.value
|
|
277
|
-
}, void 0, !0)
|
|
278
|
-
], 16, _hoisted_1)
|
|
279
|
-
], 6)) : createCommentVNode("", !0),
|
|
280
|
-
(openBlock(), createBlock(Teleport, { to: __props.teleportTo }, [
|
|
281
|
-
createVNode(Transition, {
|
|
282
|
-
name: transitionName.value,
|
|
283
|
-
appear: "",
|
|
284
|
-
onAfterLeave: _cache[0] || (_cache[0] = ($event) => emits("after-close-animation"))
|
|
285
|
-
}, {
|
|
286
|
-
default: withCtx(() => [
|
|
287
|
-
isOpen.value ? withDirectives((openBlock(), createElementBlock("div", mergeProps({
|
|
288
|
-
key: 0,
|
|
289
|
-
id: panelId.value,
|
|
290
|
-
ref: "panel",
|
|
291
|
-
role: __props.role,
|
|
292
|
-
"aria-label": __props.ariaLabel,
|
|
293
|
-
"aria-labelledby": __props.role === "dialog" ? __props.ariaLabelledby || unref(triggerId) : void 0,
|
|
294
|
-
"aria-describedby": __props.role === "dialog" ? __props.ariaDescribedby : void 0,
|
|
295
|
-
"aria-modal": __props.role === "dialog" ? "true" : void 0,
|
|
296
|
-
tabindex: __props.role === "dialog" ? "-1" : void 0,
|
|
297
|
-
class: ["m-popover-panel", panelClasses.value],
|
|
298
|
-
"aria-live": __props.announceChanges ? "polite" : void 0,
|
|
299
|
-
style: [
|
|
300
|
-
__props.panelStyle,
|
|
301
|
-
panelStyles.value,
|
|
302
|
-
{
|
|
303
|
-
transformOrigin: getTransformOrigin(computedPosition.value),
|
|
304
|
-
visibility: unref(middlewareData).hide?.referenceHidden ? "hidden" : "visible"
|
|
305
|
-
}
|
|
306
|
-
]
|
|
307
|
-
}, panelEvents.value), [
|
|
308
|
-
renderSlot(_ctx.$slots, "default", {
|
|
309
|
-
open,
|
|
310
|
-
close,
|
|
311
|
-
toggle,
|
|
312
|
-
isOpen: isOpen.value
|
|
313
|
-
}, void 0, !0)
|
|
314
|
-
], 16, _hoisted_2)), [
|
|
315
|
-
[unref(directive), onClickOutside]
|
|
316
|
-
]) : createCommentVNode("", !0)
|
|
317
|
-
]),
|
|
318
|
-
_: 3
|
|
319
|
-
}, 8, ["name"])
|
|
320
|
-
], 8, ["to"]))
|
|
321
|
-
], 64));
|
|
322
|
-
}
|
|
323
|
-
}), MazPopover = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-08b18b31"]]);
|
|
324
|
-
export {
|
|
325
|
-
MazPopover as default
|
|
326
|
-
};
|
|
1
|
+
import{t as MazPopover_default}from"../chunks/MazPopover.Co8BEopX.js";export{MazPopover_default as default};
|
|
@@ -1,145 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { isClient } from "@maz-ui/utils/helpers/isClient";
|
|
3
|
-
import { isStandaloneMode } from "@maz-ui/utils/helpers/isStandaloneMode";
|
|
4
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
5
|
-
import '../assets/MazPullToRefresh.CqLZBqlg.css';const _hoisted_1 = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "header-text"
|
|
8
|
-
}, _hoisted_2 = {
|
|
9
|
-
key: 1,
|
|
10
|
-
class: "header-text"
|
|
11
|
-
}, _hoisted_3 = {
|
|
12
|
-
key: 2,
|
|
13
|
-
class: "header-text"
|
|
14
|
-
}, _hoisted_4 = { class: "maz-flex maz-flex-col maz-flex-center" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
-
__name: "MazPullToRefresh",
|
|
16
|
-
props: {
|
|
17
|
-
distance: { default: 100 },
|
|
18
|
-
offset: { default: 0 },
|
|
19
|
-
onClick: { type: Function, default: void 0 },
|
|
20
|
-
containerSelector: { default: void 0 },
|
|
21
|
-
headerClass: { default: void 0 },
|
|
22
|
-
spinnerColor: { default: "contrast" },
|
|
23
|
-
disabled: { type: Boolean, default: !1 },
|
|
24
|
-
standaloneMode: { type: Boolean, default: !1 }
|
|
25
|
-
},
|
|
26
|
-
emits: ["loaded", "start", "error", "finish", "response"],
|
|
27
|
-
setup(__props, { emit: __emit }) {
|
|
28
|
-
const props = __props, emits = __emit, MazSpinner = defineAsyncComponent(() => import("./MazSpinner.js")), isDisabled = computed(
|
|
29
|
-
() => props.disabled || props.onClick === void 0 || props.standaloneMode && isClient() && !isStandaloneMode()
|
|
30
|
-
), margin = ref({
|
|
31
|
-
top: 0,
|
|
32
|
-
bottom: 0
|
|
33
|
-
}), pull = ref({
|
|
34
|
-
from: -1,
|
|
35
|
-
to: -1,
|
|
36
|
-
distance: 0,
|
|
37
|
-
available: !1,
|
|
38
|
-
state: "end"
|
|
39
|
-
}), internalLoading = ref(!1), container = computed(() => {
|
|
40
|
-
if (typeof document > "u" || isDisabled.value)
|
|
41
|
-
return;
|
|
42
|
-
const element = props.containerSelector ? document.querySelector(props.containerSelector) : document.body;
|
|
43
|
-
if (!element)
|
|
44
|
-
throw new Error("MazPullToRefresh - container not found");
|
|
45
|
-
return element;
|
|
46
|
-
}), pullHeight = computed(() => pull.value.state !== "move" && pull.value.state !== "end" || isDisabled.value ? 0 : pull.value.distance > props.distance ? props.distance : pull.value.distance);
|
|
47
|
-
function updateView(container2) {
|
|
48
|
-
const { top, height } = container2.getBoundingClientRect();
|
|
49
|
-
margin.value = {
|
|
50
|
-
top,
|
|
51
|
-
bottom: window.innerHeight - (height + top + props.offset)
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
function setLoading(type) {
|
|
55
|
-
internalLoading.value = type;
|
|
56
|
-
}
|
|
57
|
-
function handleTouchStart(event) {
|
|
58
|
-
if (internalLoading.value || margin.value.top < 0 && margin.value.bottom < 0 || isDisabled.value)
|
|
59
|
-
return;
|
|
60
|
-
const item = event.touches.item(0);
|
|
61
|
-
item && (pull.value.state = "start", pull.value.from = item.pageY);
|
|
62
|
-
}
|
|
63
|
-
function handleTouchMove(event) {
|
|
64
|
-
if (internalLoading.value || pull.value.from < 0 || window.scrollY > 0 || isDisabled.value)
|
|
65
|
-
return;
|
|
66
|
-
const item = event.touches.item(0);
|
|
67
|
-
if (!item)
|
|
68
|
-
return;
|
|
69
|
-
pull.value.to = item.pageY;
|
|
70
|
-
const distance = pull.value.to - pull.value.from;
|
|
71
|
-
pull.value.distance = distance > 0 ? distance : 0, pull.value.available = pull.value.distance >= props.distance, pull.value.state = "move";
|
|
72
|
-
}
|
|
73
|
-
function handleTouchEnd() {
|
|
74
|
-
internalLoading.value || isDisabled.value || (pullHeight.value === props.distance && pull.value.state === "move" && window.scrollY <= 0 ? runAction() : resetPull());
|
|
75
|
-
}
|
|
76
|
-
function resetPull() {
|
|
77
|
-
pull.value = {
|
|
78
|
-
from: -1,
|
|
79
|
-
to: -1,
|
|
80
|
-
distance: 0,
|
|
81
|
-
available: !1,
|
|
82
|
-
state: "end"
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
async function runAction() {
|
|
86
|
-
try {
|
|
87
|
-
setLoading(!0), emits("start");
|
|
88
|
-
const response = await props.onClick?.();
|
|
89
|
-
emits("loaded"), emits("response", response);
|
|
90
|
-
} catch (error) {
|
|
91
|
-
throw emits("error", error), error;
|
|
92
|
-
} finally {
|
|
93
|
-
resetPull(), setLoading(!1), emits("finish");
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
watch(
|
|
97
|
-
() => isDisabled.value,
|
|
98
|
-
(disabled) => {
|
|
99
|
-
disabled === !0 ? removeEvents() : initComponentAndEvents();
|
|
100
|
-
},
|
|
101
|
-
{ immediate: !0 }
|
|
102
|
-
);
|
|
103
|
-
function initComponentAndEvents() {
|
|
104
|
-
!container.value || isDisabled.value || document === void 0 || (container.value.addEventListener("touchstart", handleTouchStart), container.value.addEventListener("touchmove", handleTouchMove), container.value.addEventListener("touchend", handleTouchEnd), updateView(container.value));
|
|
105
|
-
}
|
|
106
|
-
function removeEvents() {
|
|
107
|
-
!container.value || document === void 0 || (container.value.removeEventListener("touchstart", handleTouchStart), container.value.removeEventListener("touchmove", handleTouchMove), container.value.removeEventListener("touchend", handleTouchEnd));
|
|
108
|
-
}
|
|
109
|
-
return onUnmounted(() => {
|
|
110
|
-
removeEvents();
|
|
111
|
-
}), (_ctx, _cache) => (openBlock(), createElementBlock("div", {
|
|
112
|
-
class: normalizeClass(["m-pull-to-refresh m-reset-css", { "--available": pull.value.available || pullHeight.value > 10 }])
|
|
113
|
-
}, [
|
|
114
|
-
isDisabled.value ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", {
|
|
115
|
-
key: 0,
|
|
116
|
-
class: normalizeClass(["loading-header", __props.headerClass]),
|
|
117
|
-
style: normalizeStyle({ height: `${pullHeight.value}px` })
|
|
118
|
-
}, [
|
|
119
|
-
pull.value.available ? pull.value.available && !internalLoading.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
120
|
-
renderSlot(_ctx.$slots, "pull-ready", {}, () => [
|
|
121
|
-
_cache[1] || (_cache[1] = createElementVNode("span", null, " Release to refresh ", -1))
|
|
122
|
-
], !0)
|
|
123
|
-
])) : createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
124
|
-
renderSlot(_ctx.$slots, "pull-before", {}, () => [
|
|
125
|
-
_cache[0] || (_cache[0] = createElementVNode("span", null, "Pull to refresh", -1))
|
|
126
|
-
], !0)
|
|
127
|
-
])),
|
|
128
|
-
internalLoading.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
129
|
-
renderSlot(_ctx.$slots, "pull-loading", {}, () => [
|
|
130
|
-
createElementVNode("div", _hoisted_4, [
|
|
131
|
-
createVNode(unref(MazSpinner), {
|
|
132
|
-
color: __props.spinnerColor,
|
|
133
|
-
size: "2.5em"
|
|
134
|
-
}, null, 8, ["color"])
|
|
135
|
-
])
|
|
136
|
-
], !0)
|
|
137
|
-
])) : createCommentVNode("", !0)
|
|
138
|
-
], 6)),
|
|
139
|
-
renderSlot(_ctx.$slots, "default", {}, void 0, !0)
|
|
140
|
-
], 2));
|
|
141
|
-
}
|
|
142
|
-
}), MazPullToRefresh = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d798244e"]]);
|
|
143
|
-
export {
|
|
144
|
-
MazPullToRefresh as default
|
|
145
|
-
};
|
|
1
|
+
import{t as MazPullToRefresh_default}from"../chunks/MazPullToRefresh.DMtb6Oa3.js";export{MazPullToRefresh_default as default};
|
|
@@ -1,103 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
|
|
3
|
-
import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
4
|
-
import '../assets/MazRadio.BwJxf7ZC.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
|
-
__name: "MazRadio",
|
|
6
|
-
props: {
|
|
7
|
-
style: { type: [Boolean, null, String, Object, Array], default: void 0 },
|
|
8
|
-
class: { type: [Boolean, null, String, Object, Array], default: void 0 },
|
|
9
|
-
id: { default: void 0 },
|
|
10
|
-
modelValue: { default: void 0 },
|
|
11
|
-
value: {},
|
|
12
|
-
name: {},
|
|
13
|
-
label: { default: void 0 },
|
|
14
|
-
color: { default: "primary" },
|
|
15
|
-
size: { default: "md" },
|
|
16
|
-
disabled: { type: Boolean, default: !1 },
|
|
17
|
-
error: { type: Boolean },
|
|
18
|
-
success: { type: Boolean },
|
|
19
|
-
warning: { type: Boolean },
|
|
20
|
-
hint: {}
|
|
21
|
-
},
|
|
22
|
-
emits: ["update:model-value", "change", "blur", "focus"],
|
|
23
|
-
setup(__props, { emit: __emit }) {
|
|
24
|
-
const props = __props, emits = __emit, instanceId = useInstanceUniqId({
|
|
25
|
-
componentName: "MazRadio",
|
|
26
|
-
providedId: props.id
|
|
27
|
-
}), inputRef = ref(), isFocused = ref(!1), isSelected = computed(() => props.modelValue === props.value), radioSize = computed(() => {
|
|
28
|
-
switch (props.size) {
|
|
29
|
-
case "xl":
|
|
30
|
-
return "2.25rem";
|
|
31
|
-
case "lg":
|
|
32
|
-
return "2rem";
|
|
33
|
-
case "sm":
|
|
34
|
-
return "1.425rem";
|
|
35
|
-
case "xs":
|
|
36
|
-
return "1.325rem";
|
|
37
|
-
case "mini":
|
|
38
|
-
return "1.2rem";
|
|
39
|
-
default:
|
|
40
|
-
return "1.625rem";
|
|
41
|
-
}
|
|
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%)`);
|
|
43
|
-
function keyboardHandler(event) {
|
|
44
|
-
["Space"].includes(event.code) && (event.preventDefault(), emitValue());
|
|
45
|
-
}
|
|
46
|
-
function emitValue() {
|
|
47
|
-
emits("update:model-value", props.value), emits("change", props.value);
|
|
48
|
-
}
|
|
49
|
-
function onBlur(event) {
|
|
50
|
-
isFocused.value = !1, inputRef.value?.dispatchEvent(new Event("blur")), emits("blur", event);
|
|
51
|
-
}
|
|
52
|
-
function onFocus(event) {
|
|
53
|
-
isFocused.value = !0, inputRef.value?.dispatchEvent(new Event("focus")), emits("focus", event);
|
|
54
|
-
}
|
|
55
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("label", {
|
|
56
|
-
for: unref(instanceId),
|
|
57
|
-
class: normalizeClass(["m-radio m-reset-css", [{ "--selected": isSelected.value, "--error": __props.error, "--warning": __props.warning, "--success": __props.success }, props.class]]),
|
|
58
|
-
tabindex: "0",
|
|
59
|
-
role: "radio",
|
|
60
|
-
style: normalizeStyle([__props.style, { "--radio-size": radioSize.value, "--radio-selected-color": radioSelectedColor.value, "--radio-box-shadow": radioBoxShadow.value }]),
|
|
61
|
-
"aria-checked": isSelected.value,
|
|
62
|
-
onBlur,
|
|
63
|
-
onFocus,
|
|
64
|
-
onKeydown: keyboardHandler
|
|
65
|
-
}, [
|
|
66
|
-
createElementVNode("input", mergeProps({
|
|
67
|
-
id: unref(instanceId),
|
|
68
|
-
ref_key: "inputRef",
|
|
69
|
-
ref: inputRef,
|
|
70
|
-
value: __props.value
|
|
71
|
-
}, _ctx.$attrs, {
|
|
72
|
-
tabindex: "-1",
|
|
73
|
-
disabled: __props.disabled,
|
|
74
|
-
name: __props.name,
|
|
75
|
-
type: "radio",
|
|
76
|
-
checked: isSelected.value,
|
|
77
|
-
onChange: _cache[0] || (_cache[0] = ($event) => emitValue())
|
|
78
|
-
}), null, 16, _hoisted_2),
|
|
79
|
-
_cache[1] || (_cache[1] = createElementVNode("span", null, [
|
|
80
|
-
createElementVNode("span", { class: "round" })
|
|
81
|
-
], -1)),
|
|
82
|
-
createElementVNode("div", _hoisted_3, [
|
|
83
|
-
renderSlot(_ctx.$slots, "default", {
|
|
84
|
-
isSelected: isSelected.value,
|
|
85
|
-
value: __props.value
|
|
86
|
-
}, () => [
|
|
87
|
-
createTextVNode(toDisplayString(__props.label), 1)
|
|
88
|
-
], !0),
|
|
89
|
-
__props.hint ? (openBlock(), createElementBlock("span", {
|
|
90
|
-
key: 0,
|
|
91
|
-
class: normalizeClass(["m-radio__hint", {
|
|
92
|
-
"--error": __props.error,
|
|
93
|
-
"--success": __props.success,
|
|
94
|
-
"--warning": __props.warning
|
|
95
|
-
}])
|
|
96
|
-
}, toDisplayString(__props.hint), 3)) : createCommentVNode("", !0)
|
|
97
|
-
])
|
|
98
|
-
], 46, _hoisted_1));
|
|
99
|
-
}
|
|
100
|
-
}), MazRadio = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e9c69959"]]);
|
|
101
|
-
export {
|
|
102
|
-
MazRadio as default
|
|
103
|
-
};
|
|
1
|
+
import{t as MazRadio_default}from"../chunks/MazRadio.75ipjTw2.js";export{MazRadio_default as default};
|