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,113 +1 @@
|
|
|
1
|
-
import { defineComponent, defineAsyncComponent
|
|
2
|
-
import { _ as _export_sfc } from "../../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
3
|
-
import '../../assets/MazPickerCalendar.snBBsmEq.css';const _hoisted_1 = { class: "maz-picker-calendar flex" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
-
__name: "MazPickerCalendar",
|
|
5
|
-
props: {
|
|
6
|
-
modelValue: {},
|
|
7
|
-
calendarDate: {},
|
|
8
|
-
color: {},
|
|
9
|
-
locale: {},
|
|
10
|
-
inline: { type: Boolean },
|
|
11
|
-
firstDayOfWeek: {},
|
|
12
|
-
double: { type: Boolean },
|
|
13
|
-
minDate: {},
|
|
14
|
-
maxDate: {},
|
|
15
|
-
disabledWeekly: {},
|
|
16
|
-
disabledDates: {},
|
|
17
|
-
shortcuts: { type: [Array, Boolean] },
|
|
18
|
-
hasTime: { type: Boolean },
|
|
19
|
-
shortcut: {},
|
|
20
|
-
disabled: { type: Boolean },
|
|
21
|
-
range: { type: Boolean }
|
|
22
|
-
},
|
|
23
|
-
emits: ["update:model-value", "update:calendar-date"],
|
|
24
|
-
setup(__props, { emit: __emit }) {
|
|
25
|
-
const props = __props, emits = __emit, MazPickerCalendarMonth = defineAsyncComponent(() => import("./MazPickerCalendarMonth/MazPickerCalendarMonth.js")), MazPickerCalendarSwitcher = defineAsyncComponent(() => import("./MazPickerCalendarSwitcher.js")), MazPickerMonthSwitcher = defineAsyncComponent(() => import("./MazPickerMonthSwitcher.js")), MazPickerShortcuts = defineAsyncComponent(() => import("./MazPickerShortcuts.js")), MazPickerYearSwitcher = defineAsyncComponent(() => import("./MazPickerYearSwitcher.js")), hoverredDay = ref(), hasShortcuts = computed(
|
|
26
|
-
() => props.shortcuts && props.shortcuts.length > 0 && props.range
|
|
27
|
-
), monthSwitcherOpen = ref(!1), yearSwitcherOpen = ref(!1), currentValue = computed({
|
|
28
|
-
get: () => props.modelValue,
|
|
29
|
-
set: (value) => emits("update:model-value", value)
|
|
30
|
-
}), months = computed(() => Array.from({ length: props.double ? 2 : 1 }, (_v, i) => i)), calendarDate = computed({
|
|
31
|
-
get: () => props.calendarDate,
|
|
32
|
-
set: (calendarDate2) => emits("update:calendar-date", calendarDate2)
|
|
33
|
-
});
|
|
34
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
35
|
-
hasShortcuts.value && __props.shortcuts ? (openBlock(), createBlock(unref(MazPickerShortcuts), {
|
|
36
|
-
key: 0,
|
|
37
|
-
modelValue: currentValue.value,
|
|
38
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentValue.value = $event),
|
|
39
|
-
color: __props.color,
|
|
40
|
-
shortcuts: __props.shortcuts,
|
|
41
|
-
shortcut: __props.shortcut,
|
|
42
|
-
double: __props.double,
|
|
43
|
-
disabled: __props.disabled
|
|
44
|
-
}, null, 8, ["modelValue", "color", "shortcuts", "shortcut", "double", "disabled"])) : createCommentVNode("", !0),
|
|
45
|
-
createElementVNode("div", {
|
|
46
|
-
class: normalizeClass(["maz-picker-calendar__main", { "--has-double": __props.double }])
|
|
47
|
-
}, [
|
|
48
|
-
createVNode(unref(MazPickerCalendarSwitcher), {
|
|
49
|
-
"calendar-date": calendarDate.value,
|
|
50
|
-
"onUpdate:calendarDate": _cache[1] || (_cache[1] = ($event) => calendarDate.value = $event),
|
|
51
|
-
locale: __props.locale,
|
|
52
|
-
double: __props.double,
|
|
53
|
-
onOpenMonthSwitcher: _cache[2] || (_cache[2] = ($event) => monthSwitcherOpen.value = !0),
|
|
54
|
-
onOpenYearSwitcher: _cache[3] || (_cache[3] = ($event) => yearSwitcherOpen.value = !0)
|
|
55
|
-
}, null, 8, ["calendar-date", "locale", "double"]),
|
|
56
|
-
createVNode(Transition, { name: "maz-picker-slide" }, {
|
|
57
|
-
default: withCtx(() => [
|
|
58
|
-
monthSwitcherOpen.value ? (openBlock(), createBlock(unref(MazPickerMonthSwitcher), {
|
|
59
|
-
key: 0,
|
|
60
|
-
"calendar-date": calendarDate.value,
|
|
61
|
-
"onUpdate:calendarDate": _cache[4] || (_cache[4] = ($event) => calendarDate.value = $event),
|
|
62
|
-
color: __props.color,
|
|
63
|
-
double: __props.double,
|
|
64
|
-
locale: __props.locale,
|
|
65
|
-
onClose: _cache[5] || (_cache[5] = ($event) => monthSwitcherOpen.value = !1)
|
|
66
|
-
}, null, 8, ["calendar-date", "color", "double", "locale"])) : createCommentVNode("", !0)
|
|
67
|
-
]),
|
|
68
|
-
_: 1
|
|
69
|
-
}),
|
|
70
|
-
createVNode(Transition, { name: "maz-picker-slide" }, {
|
|
71
|
-
default: withCtx(() => [
|
|
72
|
-
yearSwitcherOpen.value ? (openBlock(), createBlock(unref(MazPickerYearSwitcher), {
|
|
73
|
-
key: 0,
|
|
74
|
-
"calendar-date": calendarDate.value,
|
|
75
|
-
"onUpdate:calendarDate": _cache[6] || (_cache[6] = ($event) => calendarDate.value = $event),
|
|
76
|
-
color: __props.color,
|
|
77
|
-
locale: __props.locale,
|
|
78
|
-
onClose: _cache[7] || (_cache[7] = ($event) => yearSwitcherOpen.value = !1)
|
|
79
|
-
}, null, 8, ["calendar-date", "color", "locale"])) : createCommentVNode("", !0)
|
|
80
|
-
]),
|
|
81
|
-
_: 1
|
|
82
|
-
}),
|
|
83
|
-
createElementVNode("div", {
|
|
84
|
-
class: normalizeClass(["maz-picker-calendar__months", { "--is-range": __props.range }])
|
|
85
|
-
}, [
|
|
86
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(months.value, (month) => (openBlock(), createBlock(unref(MazPickerCalendarMonth), {
|
|
87
|
-
key: month,
|
|
88
|
-
modelValue: currentValue.value,
|
|
89
|
-
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => currentValue.value = $event),
|
|
90
|
-
"hoverred-day": hoverredDay.value,
|
|
91
|
-
"onUpdate:hoverredDay": _cache[9] || (_cache[9] = ($event) => hoverredDay.value = $event),
|
|
92
|
-
"calendar-date": calendarDate.value,
|
|
93
|
-
locale: __props.locale,
|
|
94
|
-
"has-time": __props.hasTime,
|
|
95
|
-
inline: __props.inline,
|
|
96
|
-
color: __props.color,
|
|
97
|
-
"offset-month": month,
|
|
98
|
-
"first-day-of-week": __props.firstDayOfWeek,
|
|
99
|
-
"min-date": __props.minDate,
|
|
100
|
-
"max-date": __props.maxDate,
|
|
101
|
-
disabled: __props.disabled,
|
|
102
|
-
"disabled-weekly": __props.disabledWeekly,
|
|
103
|
-
"disabled-dates": __props.disabledDates,
|
|
104
|
-
range: __props.range
|
|
105
|
-
}, null, 8, ["modelValue", "hoverred-day", "calendar-date", "locale", "has-time", "inline", "color", "offset-month", "first-day-of-week", "min-date", "max-date", "disabled", "disabled-weekly", "disabled-dates", "range"]))), 128))
|
|
106
|
-
], 2)
|
|
107
|
-
], 2)
|
|
108
|
-
]));
|
|
109
|
-
}
|
|
110
|
-
}), MazPickerCalendar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5c47cb02"]]);
|
|
111
|
-
export {
|
|
112
|
-
MazPickerCalendar as default
|
|
113
|
-
};
|
|
1
|
+
import{t as _plugin_vue_export_helper_default}from"../../chunks/_plugin-vue_export-helper.ChmETRGw.js";import{Fragment,Transition,computed,createBlock,createCommentVNode,createElementBlock,createElementVNode,createVNode,defineAsyncComponent,defineComponent,normalizeClass,openBlock,ref,renderList,unref,withCtx}from"vue";import '../../assets/MazPickerCalendar.snBBsmEq.css';var _hoisted_1={class:`maz-picker-calendar flex`};var MazPickerCalendar_default=_plugin_vue_export_helper_default(defineComponent({__name:`MazPickerCalendar`,props:{modelValue:{},calendarDate:{},color:{},locale:{},inline:{type:Boolean},firstDayOfWeek:{},double:{type:Boolean},minDate:{},maxDate:{},disabledWeekly:{},disabledDates:{},shortcuts:{type:[Array,Boolean]},hasTime:{type:Boolean},shortcut:{},disabled:{type:Boolean},range:{type:Boolean}},emits:[`update:model-value`,`update:calendar-date`],setup(__props,{emit:__emit}){let props=__props;let emits=__emit;let MazPickerCalendarMonth=defineAsyncComponent(()=>import(`./MazPickerCalendarMonth/MazPickerCalendarMonth.js`));let MazPickerCalendarSwitcher=defineAsyncComponent(()=>import(`./MazPickerCalendarSwitcher.js`));let MazPickerMonthSwitcher=defineAsyncComponent(()=>import(`./MazPickerMonthSwitcher.js`));let MazPickerShortcuts=defineAsyncComponent(()=>import(`./MazPickerShortcuts.js`));let MazPickerYearSwitcher=defineAsyncComponent(()=>import(`./MazPickerYearSwitcher.js`));let hoverredDay=ref();let hasShortcuts=computed(()=>props.shortcuts&&props.shortcuts.length>0&&props.range);let monthSwitcherOpen=ref(!1);let yearSwitcherOpen=ref(!1);let currentValue=computed({get:()=>props.modelValue,set:value=>emits(`update:model-value`,value)});let months=computed(()=>Array.from({length:props.double?2:1},(_v,i)=>i));let calendarDate=computed({get:()=>props.calendarDate,set:calendarDate=>emits(`update:calendar-date`,calendarDate)});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1,[hasShortcuts.value&&__props.shortcuts?(openBlock(),createBlock(unref(MazPickerShortcuts),{key:0,modelValue:currentValue.value,"onUpdate:modelValue":_cache[0]||=$event=>currentValue.value=$event,color:__props.color,shortcuts:__props.shortcuts,shortcut:__props.shortcut,double:__props.double,disabled:__props.disabled},null,8,[`modelValue`,`color`,`shortcuts`,`shortcut`,`double`,`disabled`])):createCommentVNode(``,!0),createElementVNode(`div`,{class:normalizeClass([`maz-picker-calendar__main`,{"--has-double":__props.double}])},[createVNode(unref(MazPickerCalendarSwitcher),{"calendar-date":calendarDate.value,"onUpdate:calendarDate":_cache[1]||=$event=>calendarDate.value=$event,locale:__props.locale,double:__props.double,onOpenMonthSwitcher:_cache[2]||=$event=>monthSwitcherOpen.value=!0,onOpenYearSwitcher:_cache[3]||=$event=>yearSwitcherOpen.value=!0},null,8,[`calendar-date`,`locale`,`double`]),createVNode(Transition,{name:`maz-picker-slide`},{default:withCtx(()=>[monthSwitcherOpen.value?(openBlock(),createBlock(unref(MazPickerMonthSwitcher),{key:0,"calendar-date":calendarDate.value,"onUpdate:calendarDate":_cache[4]||=$event=>calendarDate.value=$event,color:__props.color,double:__props.double,locale:__props.locale,onClose:_cache[5]||=$event=>monthSwitcherOpen.value=!1},null,8,[`calendar-date`,`color`,`double`,`locale`])):createCommentVNode(``,!0)]),_:1}),createVNode(Transition,{name:`maz-picker-slide`},{default:withCtx(()=>[yearSwitcherOpen.value?(openBlock(),createBlock(unref(MazPickerYearSwitcher),{key:0,"calendar-date":calendarDate.value,"onUpdate:calendarDate":_cache[6]||=$event=>calendarDate.value=$event,color:__props.color,locale:__props.locale,onClose:_cache[7]||=$event=>yearSwitcherOpen.value=!1},null,8,[`calendar-date`,`color`,`locale`])):createCommentVNode(``,!0)]),_:1}),createElementVNode(`div`,{class:normalizeClass([`maz-picker-calendar__months`,{"--is-range":__props.range}])},[(openBlock(!0),createElementBlock(Fragment,null,renderList(months.value,month=>(openBlock(),createBlock(unref(MazPickerCalendarMonth),{key:month,modelValue:currentValue.value,"onUpdate:modelValue":_cache[8]||=$event=>currentValue.value=$event,"hoverred-day":hoverredDay.value,"onUpdate:hoverredDay":_cache[9]||=$event=>hoverredDay.value=$event,"calendar-date":calendarDate.value,locale:__props.locale,"has-time":__props.hasTime,inline:__props.inline,color:__props.color,"offset-month":month,"first-day-of-week":__props.firstDayOfWeek,"min-date":__props.minDate,"max-date":__props.maxDate,disabled:__props.disabled,"disabled-weekly":__props.disabledWeekly,"disabled-dates":__props.disabledDates,range:__props.range},null,8,[`modelValue`,`hoverred-day`,`calendar-date`,`locale`,`has-time`,`inline`,`color`,`offset-month`,`first-day-of-week`,`min-date`,`max-date`,`disabled`,`disabled-weekly`,`disabled-dates`,`range`]))),128))],2)],2)]))}}),[[`__scopeId`,`data-v-5c47cb02`]]);export{MazPickerCalendar_default as default};
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { g as getDaysOfWeek } from "../../../chunks/utils.D89Q5cCP.js";
|
|
3
|
-
import { _ as _export_sfc } from "../../../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
4
|
-
import '../../../assets/MazPickerCalendarDays.Cv_yUILr.css';const _hoisted_1 = { class: "maz-picker-calendar-days" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
-
__name: "MazPickerCalendarDays",
|
|
6
|
-
props: {
|
|
7
|
-
locale: { type: String, required: !0 },
|
|
8
|
-
firstDayOfWeek: { type: Number, required: !0 }
|
|
9
|
-
},
|
|
10
|
-
setup(__props) {
|
|
11
|
-
const props = __props, days = computed(() => getDaysOfWeek(props.locale, props.firstDayOfWeek));
|
|
12
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
13
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(days.value, (label) => (openBlock(), createElementBlock("span", { key: label }, toDisplayString(label), 1))), 128))
|
|
14
|
-
]));
|
|
15
|
-
}
|
|
16
|
-
}), MazPickerCalendarDays = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4efca99e"]]);
|
|
17
|
-
export {
|
|
18
|
-
MazPickerCalendarDays as default
|
|
19
|
-
};
|
|
1
|
+
import{t as MazPickerCalendarDays_default}from"../../../chunks/MazPickerCalendarDays.CSZZbk5Z.js";export{MazPickerCalendarDays_default as default};
|
|
@@ -1,181 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { debounce } from "@maz-ui/utils/helpers/debounce";
|
|
3
|
-
import dayjs from "dayjs";
|
|
4
|
-
import MazBtn from "../../MazBtn.js";
|
|
5
|
-
import { a as getDaysInMonth, b as getFirstDayOfMonth, c as isRangeValue, i as isSameDate, d as isValidDate, e as isSameDay } from "../../../chunks/utils.D89Q5cCP.js";
|
|
6
|
-
import { _ as _export_sfc } from "../../../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
7
|
-
import '../../../assets/MazPickerCalendarGrid.Ba1xBVlX.css';const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
-
__name: "MazPickerCalendarGrid",
|
|
9
|
-
props: {
|
|
10
|
-
modelValue: {
|
|
11
|
-
type: [String, Object],
|
|
12
|
-
default: void 0
|
|
13
|
-
},
|
|
14
|
-
calendarDate: { type: String, required: !0 },
|
|
15
|
-
hasTime: { type: Boolean, required: !0 },
|
|
16
|
-
locale: { type: String, required: !0 },
|
|
17
|
-
firstDayOfWeek: { type: Number, required: !0 },
|
|
18
|
-
color: { type: String, required: !0 },
|
|
19
|
-
minDate: { type: String, default: void 0 },
|
|
20
|
-
inline: { type: Boolean, required: !0 },
|
|
21
|
-
maxDate: { type: String, default: void 0 },
|
|
22
|
-
disabledWeekly: { type: Array, required: !0 },
|
|
23
|
-
disabledDates: { type: Array, required: !0 },
|
|
24
|
-
hoverredDay: { type: Object, default: void 0 },
|
|
25
|
-
disabled: { type: Boolean, required: !0 },
|
|
26
|
-
range: { type: Boolean, required: !0 }
|
|
27
|
-
},
|
|
28
|
-
emits: ["update:model-value", "update:hoverred-day"],
|
|
29
|
-
setup(__props, { emit: __emit }) {
|
|
30
|
-
useCssVars((_ctx) => ({
|
|
31
|
-
v56c06bd6: hoverColor.value,
|
|
32
|
-
v50f9c030: hoverTextColor.value
|
|
33
|
-
}));
|
|
34
|
-
const props = __props, emits = __emit, MazDatePickerGrid = ref(), transitionName = ref("maz-slidenext"), calendarDateArray = computed(() => [props.calendarDate]), hoverColor = computed(() => `hsl(var(--maz-${props.color}) / 20%)`), hoverTextColor = computed(() => `hsl(var(--maz-${props.color}-foreground))`), modelValue = computed({
|
|
35
|
-
get: () => props.modelValue,
|
|
36
|
-
set: (value) => emits("update:model-value", value)
|
|
37
|
-
}), monthDays = computed(
|
|
38
|
-
() => Array.from({ length: getDaysInMonth(props.calendarDate) }, (_v, i) => i + 1).map((day) => ({
|
|
39
|
-
label: day,
|
|
40
|
-
date: dayjs(props.calendarDate).set("date", day)
|
|
41
|
-
}))
|
|
42
|
-
), emptyDaysCount = computed(() => (getFirstDayOfMonth(props.calendarDate) - props.firstDayOfWeek + 7) % 7);
|
|
43
|
-
function setHoverredDay(day) {
|
|
44
|
-
const value = props.modelValue;
|
|
45
|
-
!value || !isRangeValue(value) || (value.start && !value.end && day && day.isAfter(value.start) ? emits("update:hoverred-day", day) : emits("update:hoverred-day"));
|
|
46
|
-
}
|
|
47
|
-
function isBetweenHoverred(day) {
|
|
48
|
-
const value = props.modelValue;
|
|
49
|
-
return !value || !isRangeValue(value) || !value.start || !props.hoverredDay ? void 0 : dayjs(day).isBetween(value.start, props.hoverredDay, "date", "()") ? 3 : void 0;
|
|
50
|
-
}
|
|
51
|
-
function isLastDayHoverred(day) {
|
|
52
|
-
if (props.hoverredDay)
|
|
53
|
-
return dayjs(day).isSame(props.hoverredDay);
|
|
54
|
-
}
|
|
55
|
-
function isFirstDay(day) {
|
|
56
|
-
return props.modelValue && props.modelValue && typeof props.modelValue == "object" && props.modelValue?.start ? isSameDate(day, props.modelValue.start, "date") : !1;
|
|
57
|
-
}
|
|
58
|
-
function isLastDay(day) {
|
|
59
|
-
return props.modelValue && props.modelValue && typeof props.modelValue == "object" && props.modelValue?.end ? isSameDate(day, props.modelValue.end, "date") : !1;
|
|
60
|
-
}
|
|
61
|
-
function getDayButtonColor(date) {
|
|
62
|
-
const value = props.modelValue;
|
|
63
|
-
if (typeof value == "object") {
|
|
64
|
-
const isStartDate = value.start ? isSameDate(date, value.start, "date") : !1, isEndDate = value.end ? isSameDate(date, value.end, "date") : !1, isBetweenDates = checkIsBetween(date);
|
|
65
|
-
return isStartDate || isEndDate || isBetweenDates ? props.color : "transparent";
|
|
66
|
-
} else
|
|
67
|
-
return checkIsSameDate(date) ? props.color : "transparent";
|
|
68
|
-
}
|
|
69
|
-
function isSelectedOrBetween(day) {
|
|
70
|
-
if (props.modelValue && typeof props.modelValue == "object") {
|
|
71
|
-
if (props.modelValue.start && isSameDate(day, props.modelValue.start, "date"))
|
|
72
|
-
return 1;
|
|
73
|
-
if (props.modelValue.end) {
|
|
74
|
-
if (isSameDate(day, props.modelValue.end, "date"))
|
|
75
|
-
return 1;
|
|
76
|
-
if (checkIsBetween(day))
|
|
77
|
-
return 2;
|
|
78
|
-
}
|
|
79
|
-
} else if (checkIsSameDate(day))
|
|
80
|
-
return 1;
|
|
81
|
-
return 0;
|
|
82
|
-
}
|
|
83
|
-
function selectDay(value) {
|
|
84
|
-
props.range && setHoverredDay();
|
|
85
|
-
const valueFormatted = value.format();
|
|
86
|
-
if (typeof modelValue.value == "object") {
|
|
87
|
-
let values = modelValue.value;
|
|
88
|
-
values.start && values.end && (values = {
|
|
89
|
-
start: void 0,
|
|
90
|
-
end: void 0
|
|
91
|
-
});
|
|
92
|
-
const isBeforeStartDate = dayjs(valueFormatted).isBefore(values.start, "date");
|
|
93
|
-
modelValue.value = !values.start || isBeforeStartDate ? {
|
|
94
|
-
start: valueFormatted,
|
|
95
|
-
end: void 0
|
|
96
|
-
} : {
|
|
97
|
-
start: values.start,
|
|
98
|
-
end: valueFormatted
|
|
99
|
-
};
|
|
100
|
-
} else
|
|
101
|
-
modelValue.value = valueFormatted;
|
|
102
|
-
}
|
|
103
|
-
function checkIsSameDate(day) {
|
|
104
|
-
const value = props.modelValue;
|
|
105
|
-
return !value || !isValidDate(value) ? !1 : isSameDate(day, value, "date");
|
|
106
|
-
}
|
|
107
|
-
function checkIsBetween(day) {
|
|
108
|
-
const value = props.modelValue;
|
|
109
|
-
return !isRangeValue(value) || !value.start || !value.end ? !1 : dayjs(day).isBetween(value.start, value.end, "date", "()");
|
|
110
|
-
}
|
|
111
|
-
function isSmallerMinDate(day) {
|
|
112
|
-
return props.minDate ? dayjs(day).isBefore(props.minDate, "date") : !1;
|
|
113
|
-
}
|
|
114
|
-
function isDisabledWeekly(day) {
|
|
115
|
-
return props.disabledWeekly?.length ? props.disabledWeekly.some((disabledDay) => isSameDay(day, disabledDay)) : !1;
|
|
116
|
-
}
|
|
117
|
-
function isDisabledDate(day) {
|
|
118
|
-
return props.disabledDates?.length ? props.disabledDates.some((disabledDay) => isSameDate(day, disabledDay, "date")) : !1;
|
|
119
|
-
}
|
|
120
|
-
function isBiggerMaxDate(day) {
|
|
121
|
-
return props.maxDate ? dayjs(day).isAfter(props.maxDate, "date") : !1;
|
|
122
|
-
}
|
|
123
|
-
const removeContainerHeight = debounce(() => {
|
|
124
|
-
MazDatePickerGrid.value && (MazDatePickerGrid.value.style.minHeight = "");
|
|
125
|
-
}, 400);
|
|
126
|
-
function setContainerHeight() {
|
|
127
|
-
MazDatePickerGrid.value && (MazDatePickerGrid.value.style.minHeight = `${MazDatePickerGrid.value?.clientHeight || 176}px`, removeContainerHeight());
|
|
128
|
-
}
|
|
129
|
-
return watch(
|
|
130
|
-
() => props.calendarDate,
|
|
131
|
-
(calendarDate, oldCalendarValue) => {
|
|
132
|
-
transitionName.value = dayjs(calendarDate).isAfter(oldCalendarValue, "date") ? "maz-slidenext" : "maz-slideprev", setContainerHeight();
|
|
133
|
-
}
|
|
134
|
-
), (_ctx, _cache) => (openBlock(), createElementBlock("div", {
|
|
135
|
-
ref_key: "MazDatePickerGrid",
|
|
136
|
-
ref: MazDatePickerGrid,
|
|
137
|
-
class: "maz-picker-calendar-grid"
|
|
138
|
-
}, [
|
|
139
|
-
createVNode(TransitionGroup, { name: transitionName.value }, {
|
|
140
|
-
default: withCtx(() => [
|
|
141
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList([calendarDateArray.value], (dateArray, dateIndex) => (openBlock(), createElementBlock("div", {
|
|
142
|
-
key: `${dateArray[dateIndex]}`,
|
|
143
|
-
class: normalizeClass(["maz-picker-calendar-grid__container", { "--is-range": __props.range }])
|
|
144
|
-
}, [
|
|
145
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(emptyDaysCount.value, (first) => (openBlock(), createElementBlock("div", { key: first }))), 128)),
|
|
146
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(monthDays.value, ({ label, date }, i) => (openBlock(), createBlock(MazBtn, {
|
|
147
|
-
key: i,
|
|
148
|
-
size: "mini",
|
|
149
|
-
color: getDayButtonColor(date),
|
|
150
|
-
type: "button",
|
|
151
|
-
block: __props.inline,
|
|
152
|
-
disabled: __props.disabled || isSmallerMinDate(date) || isBiggerMaxDate(date) || isDisabledWeekly(date) || isDisabledDate(date),
|
|
153
|
-
class: normalizeClass({
|
|
154
|
-
"--is-first": isFirstDay(date) && isSelectedOrBetween(date) === 1,
|
|
155
|
-
"--is-last": isLastDay(date) && isSelectedOrBetween(date) === 1,
|
|
156
|
-
"--is-last-hoverred": isLastDayHoverred(date),
|
|
157
|
-
"--is-selected": isSelectedOrBetween(date) === 1,
|
|
158
|
-
"--is-between": isSelectedOrBetween(date) === 2,
|
|
159
|
-
"--is-between-hoverred": __props.range ? isBetweenHoverred(date) === 3 : void 0
|
|
160
|
-
}),
|
|
161
|
-
onClick: ($event) => selectDay(date),
|
|
162
|
-
onMouseover: ($event) => __props.range ? setHoverredDay(date) : void 0,
|
|
163
|
-
onMouseleave: _cache[0] || (_cache[0] = ($event) => __props.range ? setHoverredDay() : void 0),
|
|
164
|
-
onFocus: ($event) => __props.range ? setHoverredDay(date) : void 0,
|
|
165
|
-
onBlur: _cache[1] || (_cache[1] = ($event) => __props.range ? setHoverredDay() : void 0)
|
|
166
|
-
}, {
|
|
167
|
-
default: withCtx(() => [
|
|
168
|
-
createElementVNode("span", null, toDisplayString(label), 1)
|
|
169
|
-
]),
|
|
170
|
-
_: 2
|
|
171
|
-
}, 1032, ["color", "block", "disabled", "class", "onClick", "onMouseover", "onFocus"]))), 128))
|
|
172
|
-
], 2))), 128))
|
|
173
|
-
]),
|
|
174
|
-
_: 1
|
|
175
|
-
}, 8, ["name"])
|
|
176
|
-
], 512));
|
|
177
|
-
}
|
|
178
|
-
}), MazPickerCalendarGrid = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f69e1470"]]);
|
|
179
|
-
export {
|
|
180
|
-
MazPickerCalendarGrid as default
|
|
181
|
-
};
|
|
1
|
+
import"../../../chunks/MazBtn.Cc9C1v2l.js";import{t as MazPickerCalendarGrid_default}from"../../../chunks/MazPickerCalendarGrid.DrUHBH6-.js";export{MazPickerCalendarGrid_default as default};
|
|
@@ -1,75 +1 @@
|
|
|
1
|
-
import { defineComponent,
|
|
2
|
-
import dayjs from "dayjs";
|
|
3
|
-
import MazPickerCalendarDays from "./MazPickerCalendarDays.js";
|
|
4
|
-
import MazPickerCalendarGrid from "./MazPickerCalendarGrid.js";
|
|
5
|
-
import { _ as _export_sfc } from "../../../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
6
|
-
import '../../../assets/MazPickerCalendarMonth.C9dBYe1z.css';const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
-
__name: "MazPickerCalendarMonth",
|
|
8
|
-
props: {
|
|
9
|
-
modelValue: {
|
|
10
|
-
type: [String, Object],
|
|
11
|
-
default: void 0
|
|
12
|
-
},
|
|
13
|
-
color: { type: String, required: !0 },
|
|
14
|
-
locale: { type: String, required: !0 },
|
|
15
|
-
hasTime: { type: Boolean, required: !0 },
|
|
16
|
-
firstDayOfWeek: { type: Number, required: !0 },
|
|
17
|
-
inline: { type: Boolean, required: !0 },
|
|
18
|
-
calendarDate: { type: String, required: !0 },
|
|
19
|
-
offsetMonth: { type: Number, default: 0 },
|
|
20
|
-
minDate: { type: String, default: void 0 },
|
|
21
|
-
maxDate: { type: String, default: void 0 },
|
|
22
|
-
disabledWeekly: { type: Array, required: !0 },
|
|
23
|
-
disabledDates: { type: Array, required: !0 },
|
|
24
|
-
hoverredDay: { type: Object, default: void 0 },
|
|
25
|
-
disabled: { type: Boolean, required: !0 },
|
|
26
|
-
range: { type: Boolean, required: !0 }
|
|
27
|
-
},
|
|
28
|
-
emits: ["update:model-value", "update:calendar-date", "update:hoverred-day"],
|
|
29
|
-
setup(__props, { emit: __emit }) {
|
|
30
|
-
const props = __props, emits = __emit, modelValue = computed({
|
|
31
|
-
get: () => props.modelValue,
|
|
32
|
-
set: (value) => emits("update:model-value", value)
|
|
33
|
-
}), hoverredDay = computed({
|
|
34
|
-
get: () => props.hoverredDay,
|
|
35
|
-
set: (value) => emits("update:hoverred-day", value)
|
|
36
|
-
});
|
|
37
|
-
function getCalendarDateWithOffset(offset) {
|
|
38
|
-
return dayjs(props.calendarDate).add(offset, "month").format();
|
|
39
|
-
}
|
|
40
|
-
const calendarDateWithOffset = computed({
|
|
41
|
-
get: () => getCalendarDateWithOffset(props.offsetMonth),
|
|
42
|
-
set: (calendarDate) => emits("update:calendar-date", calendarDate)
|
|
43
|
-
});
|
|
44
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("div", {
|
|
45
|
-
class: normalizeClass(["maz-picker-calendar-month", { "--has-padding": !__props.range }])
|
|
46
|
-
}, [
|
|
47
|
-
createVNode(MazPickerCalendarDays, {
|
|
48
|
-
locale: __props.locale,
|
|
49
|
-
"first-day-of-week": __props.firstDayOfWeek,
|
|
50
|
-
class: "maz-picker-calendar-month__days"
|
|
51
|
-
}, null, 8, ["locale", "first-day-of-week"]),
|
|
52
|
-
createVNode(MazPickerCalendarGrid, {
|
|
53
|
-
modelValue: modelValue.value,
|
|
54
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => modelValue.value = $event),
|
|
55
|
-
"hoverred-day": hoverredDay.value,
|
|
56
|
-
"onUpdate:hoverredDay": _cache[1] || (_cache[1] = ($event) => hoverredDay.value = $event),
|
|
57
|
-
locale: __props.locale,
|
|
58
|
-
color: __props.color,
|
|
59
|
-
"has-time": __props.hasTime,
|
|
60
|
-
inline: __props.inline,
|
|
61
|
-
"calendar-date": calendarDateWithOffset.value,
|
|
62
|
-
"first-day-of-week": __props.firstDayOfWeek,
|
|
63
|
-
"min-date": __props.minDate,
|
|
64
|
-
"max-date": __props.maxDate,
|
|
65
|
-
"disabled-weekly": __props.disabledWeekly,
|
|
66
|
-
"disabled-dates": __props.disabledDates,
|
|
67
|
-
disabled: __props.disabled,
|
|
68
|
-
range: __props.range
|
|
69
|
-
}, null, 8, ["modelValue", "hoverred-day", "locale", "color", "has-time", "inline", "calendar-date", "first-day-of-week", "min-date", "max-date", "disabled-weekly", "disabled-dates", "disabled", "range"])
|
|
70
|
-
], 2));
|
|
71
|
-
}
|
|
72
|
-
}), MazPickerCalendarMonth = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-61bcb66b"]]);
|
|
73
|
-
export {
|
|
74
|
-
MazPickerCalendarMonth as default
|
|
75
|
-
};
|
|
1
|
+
import{t as _plugin_vue_export_helper_default}from"../../../chunks/_plugin-vue_export-helper.ChmETRGw.js";import"../../../chunks/MazBtn.Cc9C1v2l.js";import{t as MazPickerCalendarDays_default}from"../../../chunks/MazPickerCalendarDays.CSZZbk5Z.js";import{t as MazPickerCalendarGrid_default}from"../../../chunks/MazPickerCalendarGrid.DrUHBH6-.js";import{computed,createElementBlock,createVNode,defineComponent,normalizeClass,openBlock}from"vue";import dayjs from"dayjs";import '../../../assets/MazPickerCalendarMonth.C9dBYe1z.css';var MazPickerCalendarMonth_default=_plugin_vue_export_helper_default(defineComponent({__name:`MazPickerCalendarMonth`,props:{modelValue:{type:[String,Object],default:void 0},color:{type:String,required:!0},locale:{type:String,required:!0},hasTime:{type:Boolean,required:!0},firstDayOfWeek:{type:Number,required:!0},inline:{type:Boolean,required:!0},calendarDate:{type:String,required:!0},offsetMonth:{type:Number,default:0},minDate:{type:String,default:void 0},maxDate:{type:String,default:void 0},disabledWeekly:{type:Array,required:!0},disabledDates:{type:Array,required:!0},hoverredDay:{type:Object,default:void 0},disabled:{type:Boolean,required:!0},range:{type:Boolean,required:!0}},emits:[`update:model-value`,`update:calendar-date`,`update:hoverred-day`],setup(__props,{emit:__emit}){let props=__props;let emits=__emit;let modelValue=computed({get:()=>props.modelValue,set:value=>emits(`update:model-value`,value)});let hoverredDay=computed({get:()=>props.hoverredDay,set:value=>emits(`update:hoverred-day`,value)});function getCalendarDateWithOffset(offset){return dayjs(props.calendarDate).add(offset,`month`).format()}let calendarDateWithOffset=computed({get:()=>getCalendarDateWithOffset(props.offsetMonth),set:calendarDate=>emits(`update:calendar-date`,calendarDate)});return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,{class:normalizeClass([`maz-picker-calendar-month`,{"--has-padding":!__props.range}])},[createVNode(MazPickerCalendarDays_default,{locale:__props.locale,"first-day-of-week":__props.firstDayOfWeek,class:`maz-picker-calendar-month__days`},null,8,[`locale`,`first-day-of-week`]),createVNode(MazPickerCalendarGrid_default,{modelValue:modelValue.value,"onUpdate:modelValue":_cache[0]||=$event=>modelValue.value=$event,"hoverred-day":hoverredDay.value,"onUpdate:hoverredDay":_cache[1]||=$event=>hoverredDay.value=$event,locale:__props.locale,color:__props.color,"has-time":__props.hasTime,inline:__props.inline,"calendar-date":calendarDateWithOffset.value,"first-day-of-week":__props.firstDayOfWeek,"min-date":__props.minDate,"max-date":__props.maxDate,"disabled-weekly":__props.disabledWeekly,"disabled-dates":__props.disabledDates,disabled:__props.disabled,range:__props.range},null,8,[`modelValue`,`hoverred-day`,`locale`,`color`,`has-time`,`inline`,`calendar-date`,`first-day-of-week`,`min-date`,`max-date`,`disabled-weekly`,`disabled-dates`,`disabled`,`range`])],2))}}),[[`__scopeId`,`data-v-61bcb66b`]]);export{MazPickerCalendarMonth_default as default};
|
|
@@ -1,90 +1 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock,
|
|
2
|
-
import { MazChevronLeft } from "@maz-ui/icons/static";
|
|
3
|
-
import { capitalize } from "@maz-ui/utils/helpers/capitalize";
|
|
4
|
-
import { formatDate } from "@maz-ui/utils/helpers/formatDate";
|
|
5
|
-
import dayjs from "dayjs";
|
|
6
|
-
import MazBtn from "../MazBtn.js";
|
|
7
|
-
import { _ as _export_sfc } from "../../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
8
|
-
import '../../assets/MazPickerCalendarSwitcher.CdCkE20u.css';const _hoisted_1 = { class: "m-date-picker-calendar-switcher" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
-
__name: "MazPickerCalendarSwitcher",
|
|
10
|
-
props: {
|
|
11
|
-
calendarDate: { type: String, default: void 0 },
|
|
12
|
-
locale: { type: String, required: !0 },
|
|
13
|
-
double: { type: Boolean, required: !0 }
|
|
14
|
-
},
|
|
15
|
-
emits: [
|
|
16
|
-
"previous",
|
|
17
|
-
"next",
|
|
18
|
-
"open-month-switcher",
|
|
19
|
-
"open-year-switcher",
|
|
20
|
-
"update:calendar-date"
|
|
21
|
-
],
|
|
22
|
-
setup(__props, { emit: __emit }) {
|
|
23
|
-
const props = __props, emits = __emit, calendarDate2 = computed(() => dayjs(props.calendarDate)), monthLabel = computed(() => props.double ? `${capitalize(
|
|
24
|
-
formatDate(calendarDate2.value.format(), props.locale, { month: "short" }) ?? calendarDate2.value.format()
|
|
25
|
-
)} - ${capitalize(
|
|
26
|
-
formatDate(calendarDate2.value.add(1, "month").format(), props.locale, {
|
|
27
|
-
month: "short"
|
|
28
|
-
}) ?? calendarDate2.value.add(1, "month").format()
|
|
29
|
-
)}` : capitalize(formatDate(calendarDate2.value.format(), props.locale, { month: "short" }) ?? calendarDate2.value.format())), yearLabel = computed(
|
|
30
|
-
() => formatDate(calendarDate2.value.format(), props.locale, { year: "numeric" })
|
|
31
|
-
);
|
|
32
|
-
function previousMonth() {
|
|
33
|
-
emits("update:calendar-date", dayjs(props.calendarDate).subtract(1, "month").format());
|
|
34
|
-
}
|
|
35
|
-
function nextMonth() {
|
|
36
|
-
emits("update:calendar-date", dayjs(props.calendarDate).add(1, "month").format());
|
|
37
|
-
}
|
|
38
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
39
|
-
createVNode(MazBtn, {
|
|
40
|
-
size: "xs",
|
|
41
|
-
color: "transparent",
|
|
42
|
-
type: "button",
|
|
43
|
-
onClick: previousMonth
|
|
44
|
-
}, {
|
|
45
|
-
default: withCtx(() => [
|
|
46
|
-
createVNode(unref(MazChevronLeft), { class: "maz-text-lg" })
|
|
47
|
-
]),
|
|
48
|
-
_: 1
|
|
49
|
-
}),
|
|
50
|
-
createVNode(MazBtn, {
|
|
51
|
-
size: "sm",
|
|
52
|
-
color: "transparent",
|
|
53
|
-
type: "button",
|
|
54
|
-
class: "m-date-picker-calendar-switcher__date",
|
|
55
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("open-month-switcher", $event))
|
|
56
|
-
}, {
|
|
57
|
-
default: withCtx(() => [
|
|
58
|
-
createTextVNode(toDisplayString(monthLabel.value), 1)
|
|
59
|
-
]),
|
|
60
|
-
_: 1
|
|
61
|
-
}),
|
|
62
|
-
createVNode(MazBtn, {
|
|
63
|
-
size: "sm",
|
|
64
|
-
color: "transparent",
|
|
65
|
-
type: "button",
|
|
66
|
-
class: "m-date-picker-calendar-switcher__date",
|
|
67
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("open-year-switcher", $event))
|
|
68
|
-
}, {
|
|
69
|
-
default: withCtx(() => [
|
|
70
|
-
createTextVNode(toDisplayString(yearLabel.value), 1)
|
|
71
|
-
]),
|
|
72
|
-
_: 1
|
|
73
|
-
}),
|
|
74
|
-
createVNode(MazBtn, {
|
|
75
|
-
size: "xs",
|
|
76
|
-
color: "transparent",
|
|
77
|
-
type: "button",
|
|
78
|
-
onClick: nextMonth
|
|
79
|
-
}, {
|
|
80
|
-
default: withCtx(() => [
|
|
81
|
-
createVNode(unref(MazChevronLeft), { class: "maz-rotate-180 maz-text-lg" })
|
|
82
|
-
]),
|
|
83
|
-
_: 1
|
|
84
|
-
})
|
|
85
|
-
]));
|
|
86
|
-
}
|
|
87
|
-
}), MazPickerCalendarSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b41a7b9d"]]);
|
|
88
|
-
export {
|
|
89
|
-
MazPickerCalendarSwitcher as default
|
|
90
|
-
};
|
|
1
|
+
import{t as _plugin_vue_export_helper_default}from"../../chunks/_plugin-vue_export-helper.ChmETRGw.js";import{t as MazBtn_default}from"../../chunks/MazBtn.Cc9C1v2l.js";import{computed,createElementBlock,createTextVNode,createVNode,defineComponent,openBlock,toDisplayString,unref,withCtx}from"vue";import{MazChevronLeft}from"@maz-ui/icons/static";import{formatDate}from"@maz-ui/utils/helpers/formatDate";import dayjs from"dayjs";import{capitalize}from"@maz-ui/utils/helpers/capitalize";import '../../assets/MazPickerCalendarSwitcher.CdCkE20u.css';var _hoisted_1={class:`m-date-picker-calendar-switcher`};var MazPickerCalendarSwitcher_default=_plugin_vue_export_helper_default(defineComponent({__name:`MazPickerCalendarSwitcher`,props:{calendarDate:{type:String,default:void 0},locale:{type:String,required:!0},double:{type:Boolean,required:!0}},emits:[`previous`,`next`,`open-month-switcher`,`open-year-switcher`,`update:calendar-date`],setup(__props,{emit:__emit}){let props=__props;let emits=__emit;let calendarDate2=computed(()=>dayjs(props.calendarDate));let monthLabel=computed(()=>props.double?`${capitalize(formatDate(calendarDate2.value.format(),props.locale,{month:`short`})??calendarDate2.value.format())} - ${capitalize(formatDate(calendarDate2.value.add(1,`month`).format(),props.locale,{month:`short`})??calendarDate2.value.add(1,`month`).format())}`:capitalize(formatDate(calendarDate2.value.format(),props.locale,{month:`short`})??calendarDate2.value.format()));let yearLabel=computed(()=>formatDate(calendarDate2.value.format(),props.locale,{year:`numeric`}));function previousMonth(){emits(`update:calendar-date`,dayjs(props.calendarDate).subtract(1,`month`).format())}function nextMonth(){emits(`update:calendar-date`,dayjs(props.calendarDate).add(1,`month`).format())}return(_ctx,_cache)=>(openBlock(),createElementBlock(`div`,_hoisted_1,[createVNode(MazBtn_default,{size:`xs`,color:`transparent`,type:`button`,onClick:previousMonth},{default:withCtx(()=>[createVNode(unref(MazChevronLeft),{class:`maz-text-lg`})]),_:1}),createVNode(MazBtn_default,{size:`sm`,color:`transparent`,type:`button`,class:`m-date-picker-calendar-switcher__date`,onClick:_cache[0]||=$event=>_ctx.$emit(`open-month-switcher`,$event)},{default:withCtx(()=>[createTextVNode(toDisplayString(monthLabel.value),1)]),_:1}),createVNode(MazBtn_default,{size:`sm`,color:`transparent`,type:`button`,class:`m-date-picker-calendar-switcher__date`,onClick:_cache[1]||=$event=>_ctx.$emit(`open-year-switcher`,$event)},{default:withCtx(()=>[createTextVNode(toDisplayString(yearLabel.value),1)]),_:1}),createVNode(MazBtn_default,{size:`xs`,color:`transparent`,type:`button`,onClick:nextMonth},{default:withCtx(()=>[createVNode(unref(MazChevronLeft),{class:`maz-rotate-180 maz-text-lg`})]),_:1})]))}}),[[`__scopeId`,`data-v-b41a7b9d`]]);export{MazPickerCalendarSwitcher_default as default};
|
|
@@ -1,116 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import dayjs from "dayjs";
|
|
3
|
-
import { _ as _export_sfc } from "../../chunks/_plugin-vue_export-helper.B--vMWp3.js";
|
|
4
|
-
import '../../assets/MazPickerContainer.CqMyVj6l.css';const _hoisted_1 = { class: "m-date-picker-container__wrapper" }, _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
-
__name: "MazPickerContainer",
|
|
6
|
-
props: {
|
|
7
|
-
modelValue: {},
|
|
8
|
-
calendarDate: {},
|
|
9
|
-
color: {},
|
|
10
|
-
locale: {},
|
|
11
|
-
hideHeader: { type: Boolean },
|
|
12
|
-
firstDayOfWeek: {},
|
|
13
|
-
double: { type: Boolean },
|
|
14
|
-
hasDate: { type: Boolean },
|
|
15
|
-
minDate: {},
|
|
16
|
-
maxDate: {},
|
|
17
|
-
inline: { type: Boolean },
|
|
18
|
-
shortcuts: { type: [Array, Boolean] },
|
|
19
|
-
shortcut: {},
|
|
20
|
-
hasTime: { type: Boolean },
|
|
21
|
-
format: {},
|
|
22
|
-
isHour12: { type: Boolean },
|
|
23
|
-
formatterOptions: {},
|
|
24
|
-
minuteInterval: {},
|
|
25
|
-
disabled: { type: Boolean },
|
|
26
|
-
disabledWeekly: {},
|
|
27
|
-
disabledHours: {},
|
|
28
|
-
disabledDates: {},
|
|
29
|
-
range: { type: Boolean }
|
|
30
|
-
},
|
|
31
|
-
emits: ["update:model-value", "update:calendar-date", "close"],
|
|
32
|
-
setup(__props, { emit: __emit }) {
|
|
33
|
-
const emits = __emit, MazPickerCalendar = defineAsyncComponent(() => import("./MazPickerCalendar.js")), MazPickerHeader = defineAsyncComponent(() => import("./MazPickerHeader.js")), MazPickerTime = defineAsyncComponent(() => import("./MazPickerTime.js")), lastTimeValue = ref(typeof __props.modelValue == "string" && __props.hasTime ? dayjs(__props.modelValue).format("HH:mm") : "00:00");
|
|
34
|
-
function saveLastTimeValue(value) {
|
|
35
|
-
lastTimeValue.value = dayjs(value).format("HH:mm"), emits("update:model-value", value);
|
|
36
|
-
}
|
|
37
|
-
function emitDateValue(value) {
|
|
38
|
-
if (__props.hasTime) {
|
|
39
|
-
const date = dayjs(value).format("YYYY-MM-DD"), time = lastTimeValue.value || "00:00", timeEmitted = dayjs(`${date} ${time}`).format(__props.format);
|
|
40
|
-
emits("update:model-value", timeEmitted);
|
|
41
|
-
} else
|
|
42
|
-
emits("update:model-value", value);
|
|
43
|
-
}
|
|
44
|
-
const currentDate = computed({
|
|
45
|
-
get: () => __props.modelValue,
|
|
46
|
-
set: (value) => emits("update:model-value", value)
|
|
47
|
-
}), currentCalendarDate = computed({
|
|
48
|
-
get: () => __props.calendarDate,
|
|
49
|
-
set: (calendarDate) => emits("update:calendar-date", calendarDate)
|
|
50
|
-
});
|
|
51
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("div", {
|
|
52
|
-
class: normalizeClass(["m-date-picker-container", {
|
|
53
|
-
"--has-double": __props.double,
|
|
54
|
-
"--is-inline": __props.inline,
|
|
55
|
-
"--has-date": __props.hasDate
|
|
56
|
-
}])
|
|
57
|
-
}, [
|
|
58
|
-
__props.hideHeader ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(MazPickerHeader), {
|
|
59
|
-
key: 0,
|
|
60
|
-
color: __props.color,
|
|
61
|
-
"has-time": __props.hasTime,
|
|
62
|
-
"model-value": __props.modelValue,
|
|
63
|
-
locale: __props.locale,
|
|
64
|
-
"has-date": __props.hasDate,
|
|
65
|
-
"formatter-options": __props.formatterOptions,
|
|
66
|
-
double: __props.double,
|
|
67
|
-
"hide-shortcuts": !__props.shortcuts,
|
|
68
|
-
class: "m-date-picker-container__header"
|
|
69
|
-
}, null, 8, ["color", "has-time", "model-value", "locale", "has-date", "formatter-options", "double", "hide-shortcuts"])),
|
|
70
|
-
createElementVNode("div", _hoisted_1, [
|
|
71
|
-
__props.hasDate ? (openBlock(), createBlock(unref(MazPickerCalendar), {
|
|
72
|
-
key: 0,
|
|
73
|
-
"calendar-date": currentCalendarDate.value,
|
|
74
|
-
"onUpdate:calendarDate": _cache[0] || (_cache[0] = ($event) => currentCalendarDate.value = $event),
|
|
75
|
-
"model-value": currentDate.value,
|
|
76
|
-
color: __props.color,
|
|
77
|
-
locale: __props.locale,
|
|
78
|
-
"has-time": __props.hasTime,
|
|
79
|
-
double: __props.double,
|
|
80
|
-
"min-date": __props.minDate,
|
|
81
|
-
"max-date": __props.maxDate,
|
|
82
|
-
inline: __props.inline,
|
|
83
|
-
"first-day-of-week": __props.firstDayOfWeek,
|
|
84
|
-
disabled: __props.disabled,
|
|
85
|
-
"disabled-weekly": __props.disabledWeekly,
|
|
86
|
-
"disabled-dates": __props.disabledDates,
|
|
87
|
-
shortcuts: __props.shortcuts,
|
|
88
|
-
shortcut: __props.shortcut,
|
|
89
|
-
range: __props.range,
|
|
90
|
-
class: "m-date-picker-container__calendar",
|
|
91
|
-
"onUpdate:modelValue": emitDateValue
|
|
92
|
-
}, null, 8, ["calendar-date", "model-value", "color", "locale", "has-time", "double", "min-date", "max-date", "inline", "first-day-of-week", "disabled", "disabled-weekly", "disabled-dates", "shortcuts", "shortcut", "range"])) : createCommentVNode("", !0),
|
|
93
|
-
__props.hasTime ? (openBlock(), createBlock(unref(MazPickerTime), {
|
|
94
|
-
key: 1,
|
|
95
|
-
"model-value": currentDate.value,
|
|
96
|
-
color: __props.color,
|
|
97
|
-
locale: __props.locale,
|
|
98
|
-
"min-date": __props.minDate,
|
|
99
|
-
"max-date": __props.maxDate,
|
|
100
|
-
"has-date": __props.hasDate,
|
|
101
|
-
format: __props.format,
|
|
102
|
-
disabled: __props.disabled,
|
|
103
|
-
"disabled-hours": __props.disabledHours,
|
|
104
|
-
"minute-interval": __props.minuteInterval,
|
|
105
|
-
"formatter-options": __props.formatterOptions,
|
|
106
|
-
"is-hour12": __props.isHour12,
|
|
107
|
-
class: "m-date-picker-container__time",
|
|
108
|
-
"onUpdate:modelValue": saveLastTimeValue
|
|
109
|
-
}, null, 8, ["model-value", "color", "locale", "min-date", "max-date", "has-date", "format", "disabled", "disabled-hours", "minute-interval", "formatter-options", "is-hour12"])) : createCommentVNode("", !0)
|
|
110
|
-
])
|
|
111
|
-
], 2));
|
|
112
|
-
}
|
|
113
|
-
}), MazPickerContainer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-aad199c3"]]);
|
|
114
|
-
export {
|
|
115
|
-
MazPickerContainer as default
|
|
116
|
-
};
|
|
1
|
+
import{t as MazPickerContainer_default}from"../../chunks/MazPickerContainer.BZ74M74V.js";export{MazPickerContainer_default as default};
|