maz-ui 3.22.3 → 3.23.0
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/components/MazAvatar.mjs +2 -2
- package/components/MazBackdrop.mjs +67 -107
- package/components/MazBadge.mjs +41 -50
- package/components/MazBottomSheet.mjs +2 -2
- package/components/MazBtn.mjs +2 -2
- package/components/MazCard.mjs +2 -2
- package/components/MazCarousel.mjs +2 -2
- package/components/MazChart.mjs +53 -63
- package/components/MazCheckbox.mjs +84 -128
- package/components/MazDialog.mjs +2 -2
- package/components/MazDialogPromise.mjs +3 -3
- package/components/MazDrawer.mjs +2 -2
- package/components/MazDropdown.mjs +2 -2
- package/components/MazDropzone.mjs +2 -2
- package/components/MazFullscreenLoader.mjs +14 -18
- package/components/MazGallery.d.ts +41 -0
- package/components/MazGallery.mjs +370 -567
- package/components/MazIcon.mjs +76 -140
- package/components/MazInput.mjs +2 -2
- package/components/MazInputNumber.mjs +72 -99
- package/components/MazInputPrice.mjs +2 -2
- package/components/MazInputTags.mjs +2 -2
- package/components/MazLazyImg.mjs +2 -2
- package/components/MazPhoneNumberInput.mjs +2 -2
- package/components/MazPicker.mjs +2 -2
- package/components/MazRadio.mjs +65 -94
- package/components/MazRadioButtons.mjs +64 -78
- package/components/MazSelect.mjs +2 -2
- package/components/MazSlider.mjs +213 -325
- package/components/MazSpinner.mjs +25 -34
- package/components/MazStepper.mjs +2 -2
- package/components/MazSwitch.mjs +43 -60
- package/components/MazTabs.mjs +16 -25
- package/components/MazTabsBar.mjs +2 -2
- package/components/MazTabsContent.mjs +34 -43
- package/components/MazTabsContentItem.mjs +49 -63
- package/components/MazTextarea.mjs +124 -169
- package/components/MazTransitionExpand.mjs +36 -54
- package/components/assets/MazBackdrop.css +1 -1
- package/components/assets/MazBottomSheet.css +1 -1
- package/components/assets/MazDialog.css +1 -1
- package/components/assets/MazDialogPromise.css +1 -1
- package/components/assets/MazDrawer.css +1 -1
- package/components/assets/MazGallery.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/chunks/MazAvatar-1636f58b.mjs +126 -0
- package/components/chunks/MazBottomSheet-c24f92f8.mjs +217 -0
- package/components/chunks/MazBtn-124f3700.mjs +153 -0
- package/components/chunks/MazBtn-1e61862b.mjs +153 -0
- package/components/chunks/MazBtn-2d1d1ba5.mjs +153 -0
- package/components/chunks/MazBtn-3d74f737.mjs +153 -0
- package/components/chunks/MazBtn-4a447126.mjs +153 -0
- package/components/chunks/MazBtn-555928ed.mjs +153 -0
- package/components/chunks/MazBtn-571454f6.mjs +153 -0
- package/components/chunks/MazBtn-5e426592.mjs +153 -0
- package/components/chunks/MazBtn-6905cc39.mjs +153 -0
- package/components/chunks/MazBtn-6ce4cfd3.mjs +153 -0
- package/components/chunks/MazBtn-74656d5b.mjs +153 -0
- package/components/chunks/MazBtn-7706b2da.mjs +158 -0
- package/components/chunks/MazBtn-a7a913dd.mjs +153 -0
- package/components/chunks/MazBtn-ba27c61d.mjs +153 -0
- package/components/chunks/MazBtn-fb3c7af8.mjs +153 -0
- package/components/chunks/MazCard-bcc36489.mjs +214 -0
- package/components/chunks/MazCarousel-6da75122.mjs +107 -0
- package/components/chunks/MazCheckbox-040dc2c4.mjs +117 -0
- package/components/chunks/MazCheckbox-3a2b48b4.mjs +117 -0
- package/components/chunks/MazDialog-44eda544.mjs +250 -0
- package/components/chunks/MazDialogPromise-eec5acde.mjs +419 -0
- package/components/chunks/MazDrawer-b628b37e.mjs +206 -0
- package/components/chunks/MazDropdown-6f2248b0.mjs +345 -0
- package/components/chunks/MazDropzone-8cac10a6.mjs +242 -0
- package/components/chunks/MazGallery-6b8ecedf.mjs +617 -0
- package/components/chunks/MazIcon-52a76873.mjs +101 -0
- package/components/chunks/MazIcon-95e31ff8.mjs +96 -0
- package/components/chunks/MazInput-1ed4f946.mjs +283 -0
- package/components/chunks/MazInput-c51881ea.mjs +278 -0
- package/components/chunks/MazInput-e1373eaf.mjs +271 -0
- package/components/chunks/MazInputPrice-cd348d46.mjs +392 -0
- package/components/chunks/MazInputTags-aa95fae7.mjs +446 -0
- package/components/chunks/MazLazyImg-0412ab38.mjs +259 -0
- package/components/chunks/MazLazyImg-47d3449a.mjs +254 -0
- package/components/chunks/MazPhoneNumberInput-e1bf46f9.mjs +1216 -0
- package/components/chunks/MazPicker-c85774e5.mjs +1140 -0
- package/components/chunks/MazPickerCalendar-f5bbea58.mjs +532 -0
- package/components/chunks/MazPickerHeader-31a3619b.mjs +186 -0
- package/components/chunks/MazPickerMonthSwitcher-aaa759b9.mjs +97 -0
- package/components/chunks/MazPickerShortcuts-d0623e2d.mjs +74 -0
- package/components/chunks/MazPickerTime-de9cfc63.mjs +219 -0
- package/components/chunks/MazPickerYearSwitcher-746c84fc.mjs +106 -0
- package/components/chunks/MazSelect-6ff6bb96.mjs +652 -0
- package/components/chunks/MazSpinner-054f948c.mjs +39 -0
- package/components/chunks/MazSpinner-059ee1d2.mjs +39 -0
- package/components/chunks/MazSpinner-08ee440b.mjs +39 -0
- package/components/chunks/MazSpinner-13403729.mjs +39 -0
- package/components/chunks/MazSpinner-44011019.mjs +39 -0
- package/components/chunks/MazSpinner-452a1534.mjs +39 -0
- package/components/chunks/MazSpinner-4c02cfd2.mjs +39 -0
- package/components/chunks/MazSpinner-6d1d24d5.mjs +39 -0
- package/components/chunks/MazSpinner-6e7c4705.mjs +39 -0
- package/components/chunks/MazSpinner-7895f54f.mjs +39 -0
- package/components/chunks/MazSpinner-7eee202e.mjs +39 -0
- package/components/chunks/MazSpinner-805e14a6.mjs +39 -0
- package/components/chunks/MazSpinner-85080b43.mjs +39 -0
- package/components/chunks/MazSpinner-a13a50c9.mjs +39 -0
- package/components/chunks/MazSpinner-a6d61cee.mjs +43 -0
- package/components/chunks/MazSpinner-b065168a.mjs +39 -0
- package/components/chunks/MazSpinner-c67b05bb.mjs +39 -0
- package/components/chunks/MazSpinner-caa33afc.mjs +39 -0
- package/components/chunks/MazSpinner-cb8fbe9a.mjs +39 -0
- package/components/chunks/MazSpinner-d9ef329f.mjs +39 -0
- package/components/chunks/MazStepper-39f018f3.mjs +191 -0
- package/components/chunks/MazTabsBar-27965f16.mjs +132 -0
- package/components/chunks/MazTransitionExpand-55cfbecb.mjs +41 -0
- package/components/chunks/MazTransitionExpand-cd24498f.mjs +41 -0
- package/components/chunks/_plugin-vue_export-helper-dad06003.mjs +9 -0
- package/components/chunks/check-31d7ba2f.mjs +30 -0
- package/components/chunks/check-c9b483c0.mjs +30 -0
- package/components/chunks/{check-circle-7acfa4c4.mjs → check-circle-59c383ed.mjs} +10 -12
- package/components/chunks/chevron-down-2b60111a.mjs +30 -0
- package/components/chunks/chevron-left-39b4621e.mjs +30 -0
- package/components/chunks/chevron-right-949a60fa.mjs +30 -0
- package/components/chunks/debounce-19c516b6.mjs +11 -0
- package/components/chunks/examples.mobile.json-f63d22fb.mjs +4 -0
- package/components/chunks/{exclamation-circle-2e115536.mjs → exclamation-circle-e2620aab.mjs} +10 -12
- package/components/chunks/{exclamation-triangle-10eb48dc.mjs → exclamation-triangle-21bf116a.mjs} +10 -12
- package/components/chunks/{eye-fbb13657.mjs → eye-dc12ce09.mjs} +12 -15
- package/components/chunks/{eye-slash-342420ff.mjs → eye-slash-fa42a017.mjs} +10 -12
- package/components/chunks/{magnifying-glass-5dffa35e.mjs → magnifying-glass-908981c0.mjs} +10 -12
- package/components/chunks/minus-e71140e1.mjs +30 -0
- package/components/chunks/no-photography-4c6c77cf.mjs +4 -0
- package/components/chunks/{no-photography-b0d08d6f.mjs → no-photography-be94ddda.mjs} +12 -15
- package/components/chunks/{no-symbol-975ce547.mjs → no-symbol-87477ad0.mjs} +10 -12
- package/components/chunks/{pencil-2f766dc8.mjs → pencil-4c35b4e7.mjs} +10 -12
- package/components/chunks/plus-c20544c3.mjs +30 -0
- package/components/chunks/x-mark-35f2f1e7.mjs +30 -0
- package/components/chunks/x-mark-7761acf4.mjs +29 -0
- package/modules/chunks/MazBtn-82a868df.mjs +153 -0
- package/modules/chunks/MazIcon-169747b4.mjs +96 -0
- package/modules/chunks/MazSpinner-3febbfdc.mjs +39 -0
- package/modules/chunks/{arrow-top-right-on-square-32bbe5a1.mjs → arrow-top-right-on-square-15191934.mjs} +10 -12
- package/modules/chunks/chevron-left-39b4621e.mjs +30 -0
- package/modules/chunks/index-d9a25303.mjs +1628 -0
- package/modules/chunks/{link-4eb05848.mjs → link-bb14441d.mjs} +10 -12
- package/modules/chunks/no-photography-4c6c77cf.mjs +4 -0
- package/modules/chunks/x-mark-35f2f1e7.mjs +30 -0
- package/modules/index.mjs +45 -44
- package/nuxt/index.json +1 -1
- package/nuxt/types.d.mts +3 -2
- package/nuxt/types.d.ts +3 -2
- package/package.json +11 -7
- package/types/components/MazGallery.vue.d.ts +41 -0
- package/types/modules/index.d.ts +1 -0
- package/types/modules/resolvers/index.d.ts +2 -0
- package/components/chunks/MazAvatar-358d78d4.mjs +0 -138
- package/components/chunks/MazBottomSheet-61090f4a.mjs +0 -267
- package/components/chunks/MazBtn-0e02f0da.mjs +0 -184
- package/components/chunks/MazBtn-2f4fa942.mjs +0 -184
- package/components/chunks/MazBtn-31c6b731.mjs +0 -184
- package/components/chunks/MazBtn-48382169.mjs +0 -184
- package/components/chunks/MazBtn-4e1e116e.mjs +0 -184
- package/components/chunks/MazBtn-50abc4c5.mjs +0 -184
- package/components/chunks/MazBtn-84e12b6a.mjs +0 -184
- package/components/chunks/MazBtn-b42e3575.mjs +0 -184
- package/components/chunks/MazBtn-b56a7278.mjs +0 -184
- package/components/chunks/MazBtn-bbd6e9c8.mjs +0 -184
- package/components/chunks/MazBtn-cf0c8fcb.mjs +0 -184
- package/components/chunks/MazBtn-d92908b2.mjs +0 -191
- package/components/chunks/MazBtn-f48da79c.mjs +0 -184
- package/components/chunks/MazBtn-f7e94b59.mjs +0 -184
- package/components/chunks/MazBtn-fec4c3b7.mjs +0 -184
- package/components/chunks/MazCard-01b81dd2.mjs +0 -237
- package/components/chunks/MazCarousel-7825c7c9.mjs +0 -133
- package/components/chunks/MazCheckbox-ab5ddda2.mjs +0 -153
- package/components/chunks/MazCheckbox-e0bbe6ec.mjs +0 -153
- package/components/chunks/MazDialog-83e54b8c.mjs +0 -290
- package/components/chunks/MazDialogPromise-6967e821.mjs +0 -474
- package/components/chunks/MazDrawer-d778b3d2.mjs +0 -256
- package/components/chunks/MazDropdown-6f4482d7.mjs +0 -426
- package/components/chunks/MazDropzone-d1bb62dc.mjs +0 -325
- package/components/chunks/MazGallery-a8f6748b.mjs +0 -812
- package/components/chunks/MazIcon-b779da0a.mjs +0 -159
- package/components/chunks/MazIcon-bda198b4.mjs +0 -165
- package/components/chunks/MazInput-713b00d0.mjs +0 -326
- package/components/chunks/MazInput-b9386887.mjs +0 -341
- package/components/chunks/MazInput-c33627dd.mjs +0 -334
- package/components/chunks/MazInputPrice-452297f5.mjs +0 -481
- package/components/chunks/MazInputTags-7a463b81.mjs +0 -526
- package/components/chunks/MazLazyImg-6e395356.mjs +0 -336
- package/components/chunks/MazLazyImg-e0d8b6d0.mjs +0 -329
- package/components/chunks/MazPhoneNumberInput-48fe2445.mjs +0 -1536
- package/components/chunks/MazPicker-50fc11d1.mjs +0 -1352
- package/components/chunks/MazPickerCalendar-cacb361c.mjs +0 -689
- package/components/chunks/MazPickerHeader-63d45179.mjs +0 -216
- package/components/chunks/MazPickerMonthSwitcher-913c6e2c.mjs +0 -110
- package/components/chunks/MazPickerShortcuts-c6fabfc6.mjs +0 -88
- package/components/chunks/MazPickerTime-5e4475da.mjs +0 -301
- package/components/chunks/MazPickerYearSwitcher-dd4fa89c.mjs +0 -125
- package/components/chunks/MazSelect-2e5cd411.mjs +0 -850
- package/components/chunks/MazSpinner-022d7bee.mjs +0 -46
- package/components/chunks/MazSpinner-100c99b8.mjs +0 -46
- package/components/chunks/MazSpinner-191ad23b.mjs +0 -46
- package/components/chunks/MazSpinner-3155378b.mjs +0 -46
- package/components/chunks/MazSpinner-339a9006.mjs +0 -46
- package/components/chunks/MazSpinner-53979e96.mjs +0 -46
- package/components/chunks/MazSpinner-68d2f2ac.mjs +0 -46
- package/components/chunks/MazSpinner-6b563b22.mjs +0 -46
- package/components/chunks/MazSpinner-7cdc13e7.mjs +0 -46
- package/components/chunks/MazSpinner-8859d658.mjs +0 -46
- package/components/chunks/MazSpinner-8e180605.mjs +0 -52
- package/components/chunks/MazSpinner-98dd1f9d.mjs +0 -46
- package/components/chunks/MazSpinner-9950424b.mjs +0 -46
- package/components/chunks/MazSpinner-c8270a93.mjs +0 -46
- package/components/chunks/MazSpinner-cb491238.mjs +0 -46
- package/components/chunks/MazSpinner-cb6f99f3.mjs +0 -46
- package/components/chunks/MazSpinner-ce4be8f1.mjs +0 -46
- package/components/chunks/MazSpinner-e5a9f319.mjs +0 -46
- package/components/chunks/MazSpinner-e92bd359.mjs +0 -46
- package/components/chunks/MazSpinner-eea9056d.mjs +0 -46
- package/components/chunks/MazStepper-4c19dbfc.mjs +0 -255
- package/components/chunks/MazTabsBar-3c2e2d69.mjs +0 -157
- package/components/chunks/MazTransitionExpand-f293b830.mjs +0 -57
- package/components/chunks/MazTransitionExpand-f9e5a2d6.mjs +0 -57
- package/components/chunks/_plugin-vue_export-helper-cc2b3d55.mjs +0 -10
- package/components/chunks/check-8da249b1.mjs +0 -32
- package/components/chunks/check-f2fcce10.mjs +0 -32
- package/components/chunks/chevron-down-a78b9604.mjs +0 -32
- package/components/chunks/chevron-left-3365d59b.mjs +0 -32
- package/components/chunks/chevron-right-02f9e837.mjs +0 -32
- package/components/chunks/debounce-7d66ffa9.mjs +0 -12
- package/components/chunks/examples.mobile.json-618ba782.mjs +0 -4
- package/components/chunks/minus-c9cdee90.mjs +0 -32
- package/components/chunks/no-photography-7f2be516.mjs +0 -4
- package/components/chunks/plus-b1b0a5a8.mjs +0 -32
- package/components/chunks/x-mark-3b05101b.mjs +0 -31
- package/components/chunks/x-mark-c6ff45dd.mjs +0 -32
- package/modules/chunks/MazBtn-90ffd148.mjs +0 -184
- package/modules/chunks/MazIcon-988edef7.mjs +0 -159
- package/modules/chunks/MazSpinner-a16a3d8f.mjs +0 -46
- package/modules/chunks/chevron-left-3365d59b.mjs +0 -32
- package/modules/chunks/index-b1625fc2.mjs +0 -2315
- package/modules/chunks/no-photography-7f2be516.mjs +0 -4
- package/modules/chunks/x-mark-c6ff45dd.mjs +0 -32
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import "../assets/MazPickerHeader.css";
|
|
2
|
+
import { defineComponent as q, computed as l, ref as z, watch as D, openBlock as r, createElementBlock as o, normalizeClass as k, createVNode as d, TransitionGroup as c, withCtx as p, Fragment as y, renderList as f, toDisplayString as _, createCommentVNode as g } from "vue";
|
|
3
|
+
import { a as i, c as v, d as Z, _ as j } from "./MazPicker-c85774e5.mjs";
|
|
4
|
+
const B = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "m-picker-header__date"
|
|
7
|
+
}, w = /* @__PURE__ */ q({
|
|
8
|
+
__name: "MazPickerHeader",
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [String, Object],
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
color: { type: String, required: !0 },
|
|
15
|
+
locale: { type: String, required: !0 },
|
|
16
|
+
noShortcuts: { type: Boolean, required: !0 },
|
|
17
|
+
double: { type: Boolean, required: !0 },
|
|
18
|
+
hasDate: { type: Boolean, required: !0 },
|
|
19
|
+
hasTime: { type: Boolean, required: !0 },
|
|
20
|
+
formatterOptions: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: !0
|
|
23
|
+
},
|
|
24
|
+
calendarDate: { type: String, required: !0 }
|
|
25
|
+
},
|
|
26
|
+
setup(s) {
|
|
27
|
+
const e = s, h = l(
|
|
28
|
+
() => {
|
|
29
|
+
var t;
|
|
30
|
+
return typeof e.modelValue == "string" ? e.modelValue : (t = e.modelValue) == null ? void 0 : t.start;
|
|
31
|
+
}
|
|
32
|
+
), m = z("maz-slidevnext"), O = l(() => e.modelValue && typeof e.modelValue == "object" ? `${e.modelValue.start ? i(e.modelValue.start, e.locale, {
|
|
33
|
+
year: "numeric",
|
|
34
|
+
timeZone: e.formatterOptions.timeZone
|
|
35
|
+
}) : "..."} - ${e.modelValue.end ? i(e.modelValue.end, e.locale, {
|
|
36
|
+
year: "numeric",
|
|
37
|
+
timeZone: e.formatterOptions.timeZone
|
|
38
|
+
}) : "..."}` : typeof e.modelValue == "string" ? i(e.modelValue, e.locale, {
|
|
39
|
+
year: "numeric",
|
|
40
|
+
timeZone: e.formatterOptions.timeZone
|
|
41
|
+
}) : "-"), S = l(() => e.hasDate ? [O.value] : void 0), $ = l(() => {
|
|
42
|
+
if (e.modelValue && typeof e.modelValue == "object" && (e.modelValue.start || e.modelValue.end)) {
|
|
43
|
+
const t = e.noShortcuts && !e.double ? "short" : "long";
|
|
44
|
+
return `${e.modelValue.start ? v(
|
|
45
|
+
i(e.modelValue.start, e.locale, {
|
|
46
|
+
weekday: t,
|
|
47
|
+
month: t,
|
|
48
|
+
day: "numeric",
|
|
49
|
+
timeZone: e.formatterOptions.timeZone
|
|
50
|
+
})
|
|
51
|
+
) : "..."} - ${e.modelValue.end ? v(
|
|
52
|
+
i(e.modelValue.end, e.locale, {
|
|
53
|
+
weekday: t,
|
|
54
|
+
month: t,
|
|
55
|
+
day: "numeric",
|
|
56
|
+
timeZone: e.formatterOptions.timeZone
|
|
57
|
+
})
|
|
58
|
+
) : "..."}`;
|
|
59
|
+
} else if (typeof e.modelValue == "string")
|
|
60
|
+
return v(
|
|
61
|
+
i(e.modelValue, e.locale, {
|
|
62
|
+
weekday: "long",
|
|
63
|
+
month: "long",
|
|
64
|
+
day: "numeric",
|
|
65
|
+
timeZone: e.formatterOptions.timeZone
|
|
66
|
+
})
|
|
67
|
+
);
|
|
68
|
+
return "-";
|
|
69
|
+
}), x = l(() => e.hasDate ? [$.value] : void 0), b = l(() => h.value ? i(h.value, e.locale, {
|
|
70
|
+
timeStyle: "short",
|
|
71
|
+
timeZone: e.formatterOptions.timeZone,
|
|
72
|
+
hour12: e.formatterOptions.hour12
|
|
73
|
+
}) : void 0), V = l(() => e.hasTime ? [b.value] : void 0);
|
|
74
|
+
return D(
|
|
75
|
+
() => e.modelValue,
|
|
76
|
+
(t, u) => {
|
|
77
|
+
const a = typeof t == "object" ? t.start : t, n = typeof u == "object" ? u.start : u;
|
|
78
|
+
m.value = Z(a).isAfter(n, "date") || Z(a).isSame(n, "date") ? "maz-slidevnext" : "maz-slidevprev";
|
|
79
|
+
}
|
|
80
|
+
), (t, u) => (r(), o(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
class: k(["m-picker-header", [`--${s.color}`]])
|
|
84
|
+
},
|
|
85
|
+
[
|
|
86
|
+
s.hasDate ? (r(), o("div", B, [
|
|
87
|
+
d(c, {
|
|
88
|
+
name: m.value,
|
|
89
|
+
tag: "div",
|
|
90
|
+
class: "m-picker-header__year-transition"
|
|
91
|
+
}, {
|
|
92
|
+
default: p(() => [
|
|
93
|
+
(r(!0), o(
|
|
94
|
+
y,
|
|
95
|
+
null,
|
|
96
|
+
f(S.value, (a, n) => (r(), o(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
key: `${a}-${n}`,
|
|
100
|
+
class: "m-picker-header__year-text"
|
|
101
|
+
},
|
|
102
|
+
_(a),
|
|
103
|
+
1
|
|
104
|
+
/* TEXT */
|
|
105
|
+
))),
|
|
106
|
+
128
|
|
107
|
+
/* KEYED_FRAGMENT */
|
|
108
|
+
))
|
|
109
|
+
]),
|
|
110
|
+
_: 1
|
|
111
|
+
/* STABLE */
|
|
112
|
+
}, 8, ["name"]),
|
|
113
|
+
d(c, {
|
|
114
|
+
name: m.value,
|
|
115
|
+
tag: "div",
|
|
116
|
+
class: "m-picker-header__date-transition"
|
|
117
|
+
}, {
|
|
118
|
+
default: p(() => [
|
|
119
|
+
(r(!0), o(
|
|
120
|
+
y,
|
|
121
|
+
null,
|
|
122
|
+
f(x.value, (a, n) => (r(), o(
|
|
123
|
+
"span",
|
|
124
|
+
{
|
|
125
|
+
key: `${a}-${n}`,
|
|
126
|
+
class: "m-picker-header__date-text"
|
|
127
|
+
},
|
|
128
|
+
_(a),
|
|
129
|
+
1
|
|
130
|
+
/* TEXT */
|
|
131
|
+
))),
|
|
132
|
+
128
|
|
133
|
+
/* KEYED_FRAGMENT */
|
|
134
|
+
))
|
|
135
|
+
]),
|
|
136
|
+
_: 1
|
|
137
|
+
/* STABLE */
|
|
138
|
+
}, 8, ["name"])
|
|
139
|
+
])) : g("v-if", !0),
|
|
140
|
+
V.value ? (r(), o(
|
|
141
|
+
"div",
|
|
142
|
+
{
|
|
143
|
+
key: 1,
|
|
144
|
+
class: k(["m-picker-header__time", { "--has-date": s.hasDate }])
|
|
145
|
+
},
|
|
146
|
+
[
|
|
147
|
+
d(c, {
|
|
148
|
+
name: m.value,
|
|
149
|
+
tag: "div",
|
|
150
|
+
class: "m-picker-header__time-transition"
|
|
151
|
+
}, {
|
|
152
|
+
default: p(() => [
|
|
153
|
+
(r(!0), o(
|
|
154
|
+
y,
|
|
155
|
+
null,
|
|
156
|
+
f(V.value, (a, n) => (r(), o(
|
|
157
|
+
"span",
|
|
158
|
+
{
|
|
159
|
+
key: `${a}-${n}`,
|
|
160
|
+
class: "m-picker-header__time-text"
|
|
161
|
+
},
|
|
162
|
+
_(a),
|
|
163
|
+
1
|
|
164
|
+
/* TEXT */
|
|
165
|
+
))),
|
|
166
|
+
128
|
|
167
|
+
/* KEYED_FRAGMENT */
|
|
168
|
+
))
|
|
169
|
+
]),
|
|
170
|
+
_: 1
|
|
171
|
+
/* STABLE */
|
|
172
|
+
}, 8, ["name"])
|
|
173
|
+
],
|
|
174
|
+
2
|
|
175
|
+
/* CLASS */
|
|
176
|
+
)) : g("v-if", !0)
|
|
177
|
+
],
|
|
178
|
+
2
|
|
179
|
+
/* CLASS */
|
|
180
|
+
));
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
const N = /* @__PURE__ */ j(w, [["__scopeId", "data-v-fcf07ce1"]]);
|
|
184
|
+
export {
|
|
185
|
+
N as default
|
|
186
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import "../assets/MazPickerMonthSwitcher.css";
|
|
2
|
+
import { defineComponent as g, computed as v, openBlock as n, createElementBlock as d, createElementVNode as m, createVNode as u, withModifiers as p, withCtx as h, unref as s, normalizeClass as _, Fragment as M, renderList as w, createBlock as x, createTextVNode as S, toDisplayString as D } from "vue";
|
|
3
|
+
import { d as C, c as l, a as c, i as f, _ as B } from "./MazPicker-c85774e5.mjs";
|
|
4
|
+
import k from "./MazBtn-ba27c61d.mjs";
|
|
5
|
+
import { X as q } from "./x-mark-7761acf4.mjs";
|
|
6
|
+
const $ = { class: "maz-picker-month-switcher" }, N = { class: "maz-picker-month-switcher__header" }, P = /* @__PURE__ */ g({
|
|
7
|
+
__name: "MazPickerMonthSwitcher",
|
|
8
|
+
props: {
|
|
9
|
+
calendarDate: { type: String, required: !0 },
|
|
10
|
+
color: { type: String, required: !0 },
|
|
11
|
+
locale: { type: String, required: !0 },
|
|
12
|
+
double: { type: Boolean, required: !0 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:calendar-date", "close"],
|
|
15
|
+
setup(r, { emit: z }) {
|
|
16
|
+
const a = r, i = z, y = v(() => Array.from({ length: 12 }, (o, e) => e).map((o) => {
|
|
17
|
+
const e = C(a.calendarDate).set("month", o);
|
|
18
|
+
return a.double ? {
|
|
19
|
+
label: `${l(
|
|
20
|
+
c(e.format(), a.locale, {
|
|
21
|
+
month: "short"
|
|
22
|
+
})
|
|
23
|
+
)} - ${l(
|
|
24
|
+
c(e.add(1, "month").format(), a.locale, {
|
|
25
|
+
month: "short"
|
|
26
|
+
})
|
|
27
|
+
)}`,
|
|
28
|
+
date: e
|
|
29
|
+
} : {
|
|
30
|
+
label: l(
|
|
31
|
+
c(e.format(), a.locale, {
|
|
32
|
+
month: "long"
|
|
33
|
+
})
|
|
34
|
+
),
|
|
35
|
+
date: e
|
|
36
|
+
};
|
|
37
|
+
})), b = (o) => {
|
|
38
|
+
i("update:calendar-date", o.format()), i("close");
|
|
39
|
+
};
|
|
40
|
+
return (o, e) => (n(), d("div", $, [
|
|
41
|
+
m("div", N, [
|
|
42
|
+
u(k, {
|
|
43
|
+
size: "xs",
|
|
44
|
+
color: "transparent",
|
|
45
|
+
type: "button",
|
|
46
|
+
onClick: e[0] || (e[0] = p((t) => o.$emit("close", t), ["stop"]))
|
|
47
|
+
}, {
|
|
48
|
+
default: h(() => [
|
|
49
|
+
u(s(q), { class: "maz-text-lg" })
|
|
50
|
+
]),
|
|
51
|
+
_: 1
|
|
52
|
+
/* STABLE */
|
|
53
|
+
})
|
|
54
|
+
]),
|
|
55
|
+
m(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
class: _(["maz-picker-month-switcher__main", { "--has-double": r.double }])
|
|
59
|
+
},
|
|
60
|
+
[
|
|
61
|
+
(n(!0), d(
|
|
62
|
+
M,
|
|
63
|
+
null,
|
|
64
|
+
w(y.value, (t) => (n(), x(k, {
|
|
65
|
+
key: t.label,
|
|
66
|
+
size: a.double ? "sm" : "xs",
|
|
67
|
+
class: _({
|
|
68
|
+
"--is-selected": s(f)(t.date, r.calendarDate, "month")
|
|
69
|
+
}),
|
|
70
|
+
color: s(f)(t.date, r.calendarDate, "month") ? r.color : "transparent",
|
|
71
|
+
type: "button",
|
|
72
|
+
onClick: p((V) => b(t.date), ["stop"])
|
|
73
|
+
}, {
|
|
74
|
+
default: h(() => [
|
|
75
|
+
S(
|
|
76
|
+
D(t.label),
|
|
77
|
+
1
|
|
78
|
+
/* TEXT */
|
|
79
|
+
)
|
|
80
|
+
]),
|
|
81
|
+
_: 2
|
|
82
|
+
/* DYNAMIC */
|
|
83
|
+
}, 1032, ["size", "class", "color", "onClick"]))),
|
|
84
|
+
128
|
|
85
|
+
/* KEYED_FRAGMENT */
|
|
86
|
+
))
|
|
87
|
+
],
|
|
88
|
+
2
|
|
89
|
+
/* CLASS */
|
|
90
|
+
)
|
|
91
|
+
]));
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const F = /* @__PURE__ */ B(P, [["__scopeId", "data-v-0730e711"]]);
|
|
95
|
+
export {
|
|
96
|
+
F as default
|
|
97
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "../assets/MazPickerShortcuts.css";
|
|
2
|
+
import { defineComponent as _, ref as h, watch as i, openBlock as l, createElementBlock as n, Fragment as v, renderList as f, createBlock as y, normalizeClass as k, withModifiers as S, withCtx as b, createTextVNode as z, toDisplayString as g } from "vue";
|
|
3
|
+
import x from "./MazBtn-ba27c61d.mjs";
|
|
4
|
+
import { _ as B } from "./MazPicker-c85774e5.mjs";
|
|
5
|
+
const C = { class: "maz-picker-shortcuts" }, M = /* @__PURE__ */ _({
|
|
6
|
+
__name: "MazPickerShortcuts",
|
|
7
|
+
props: {
|
|
8
|
+
color: { type: String, required: !0 },
|
|
9
|
+
modelValue: {
|
|
10
|
+
type: [String, Object],
|
|
11
|
+
default: void 0
|
|
12
|
+
},
|
|
13
|
+
shortcuts: {
|
|
14
|
+
type: Array,
|
|
15
|
+
required: !0
|
|
16
|
+
},
|
|
17
|
+
double: { type: Boolean, required: !0 },
|
|
18
|
+
shortcut: { type: String, default: void 0 },
|
|
19
|
+
disabled: { type: Boolean, required: !0 }
|
|
20
|
+
},
|
|
21
|
+
emits: ["update:model-value"],
|
|
22
|
+
setup(c, { emit: d }) {
|
|
23
|
+
const r = c, p = d, s = h(r.shortcut), u = (o, e) => {
|
|
24
|
+
s.value = e, p("update:model-value", o);
|
|
25
|
+
};
|
|
26
|
+
return i(
|
|
27
|
+
() => r.modelValue,
|
|
28
|
+
(o) => {
|
|
29
|
+
const e = o;
|
|
30
|
+
e != null && e.end || (s.value = void 0);
|
|
31
|
+
}
|
|
32
|
+
), i(
|
|
33
|
+
() => r.shortcut,
|
|
34
|
+
(o) => {
|
|
35
|
+
const e = r.shortcuts.find(({ identifier: t }) => o === t);
|
|
36
|
+
if (e) {
|
|
37
|
+
const { value: t, identifier: a } = e;
|
|
38
|
+
u(t, a);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{ immediate: !0 }
|
|
42
|
+
), (o, e) => (l(), n("div", C, [
|
|
43
|
+
(l(!0), n(
|
|
44
|
+
v,
|
|
45
|
+
null,
|
|
46
|
+
f(c.shortcuts, ({ identifier: t, label: a, value: m }) => (l(), y(x, {
|
|
47
|
+
key: t,
|
|
48
|
+
type: "button",
|
|
49
|
+
size: "sm",
|
|
50
|
+
disabled: c.disabled,
|
|
51
|
+
color: t === s.value ? r.color : "transparent",
|
|
52
|
+
class: k({ "--is-selected": t === s.value }),
|
|
53
|
+
onClick: S((q) => u(m, t), ["stop"])
|
|
54
|
+
}, {
|
|
55
|
+
default: b(() => [
|
|
56
|
+
z(
|
|
57
|
+
g(a),
|
|
58
|
+
1
|
|
59
|
+
/* TEXT */
|
|
60
|
+
)
|
|
61
|
+
]),
|
|
62
|
+
_: 2
|
|
63
|
+
/* DYNAMIC */
|
|
64
|
+
}, 1032, ["disabled", "color", "class", "onClick"]))),
|
|
65
|
+
128
|
|
66
|
+
/* KEYED_FRAGMENT */
|
|
67
|
+
))
|
|
68
|
+
]));
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const A = /* @__PURE__ */ B(M, [["__scopeId", "data-v-e013a34a"]]);
|
|
72
|
+
export {
|
|
73
|
+
A as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import "../assets/MazPickerTime.css";
|
|
2
|
+
import { defineComponent as W, ref as x, computed as n, watch as B, nextTick as _, openBlock as d, createElementBlock as y, normalizeClass as g, Fragment as M, renderList as w, createElementVNode as b, normalizeStyle as S, createBlock as E, withModifiers as G, withCtx as J, createTextVNode as K, toDisplayString as Q } from "vue";
|
|
3
|
+
import { d as i, f as P, s as R, _ as U } from "./MazPicker-c85774e5.mjs";
|
|
4
|
+
import X from "./MazBtn-ba27c61d.mjs";
|
|
5
|
+
const Y = { class: "m-picker-time__column__items" }, Z = /* @__PURE__ */ W({
|
|
6
|
+
__name: "MazPickerTime",
|
|
7
|
+
props: {
|
|
8
|
+
modelValue: {
|
|
9
|
+
type: [String, Object],
|
|
10
|
+
default: void 0
|
|
11
|
+
},
|
|
12
|
+
calendarDate: { type: String, required: !0 },
|
|
13
|
+
formatterOptions: {
|
|
14
|
+
type: Object,
|
|
15
|
+
required: !0
|
|
16
|
+
},
|
|
17
|
+
locale: { type: String, required: !0 },
|
|
18
|
+
color: { type: String, required: !0 },
|
|
19
|
+
isOpen: { type: Boolean, required: !0 },
|
|
20
|
+
hasDate: { type: Boolean, required: !0 },
|
|
21
|
+
minuteInterval: { type: Number, required: !0 },
|
|
22
|
+
disabledHours: { type: Array, default: void 0 },
|
|
23
|
+
format: { type: String, required: !0 },
|
|
24
|
+
isHour12: { type: Boolean, required: !0 },
|
|
25
|
+
minDate: { type: String, default: void 0 },
|
|
26
|
+
maxDate: { type: String, default: void 0 },
|
|
27
|
+
disabled: { type: Boolean, required: !0 }
|
|
28
|
+
},
|
|
29
|
+
emits: ["update:model-value"],
|
|
30
|
+
setup(v, { emit: T }) {
|
|
31
|
+
const a = v, $ = (e) => {
|
|
32
|
+
if (!a.disabledHours)
|
|
33
|
+
return e;
|
|
34
|
+
const t = Array.from({ length: 24 }, (u, s) => s).filter(
|
|
35
|
+
(u) => {
|
|
36
|
+
var s;
|
|
37
|
+
return !((s = a.disabledHours) != null && s.includes(u));
|
|
38
|
+
}
|
|
39
|
+
), r = P(t, e);
|
|
40
|
+
return r !== e && q("hour", i(o.value).set("hour", r)), r;
|
|
41
|
+
}, z = T, l = x(), c = x(), p = n(() => typeof o.value == "string" ? $(i(o.value).get("hour")) : void 0), A = n(
|
|
42
|
+
() => typeof o.value == "string" ? P(
|
|
43
|
+
H.value.map(({ value: e }) => e.get("minute")),
|
|
44
|
+
i(o.value).get("minute")
|
|
45
|
+
) : void 0
|
|
46
|
+
), C = (e) => {
|
|
47
|
+
if (a.isHour12) {
|
|
48
|
+
const r = h.value === "pm" ? e + 12 : e;
|
|
49
|
+
return r === 12 ? 0 : r === 24 ? 12 : r;
|
|
50
|
+
} else
|
|
51
|
+
return e;
|
|
52
|
+
}, N = n(() => Array.from({ length: a.isHour12 ? 12 : 24 }, (e, t) => t).map((e) => {
|
|
53
|
+
const t = e + (a.isHour12 ? 1 : 0), r = C(t), u = i(o.value).set("hour", r), s = I(r) || (a.minDate && o.value ? i(a.minDate).isAfter(u, "hour") : !1) || (a.maxDate && o.value ? i(a.maxDate).isBefore(u, "hour") : !1);
|
|
54
|
+
return {
|
|
55
|
+
label: `${t < 10 ? "0" : ""}${t}`,
|
|
56
|
+
value: i(o.value).set("hour", r),
|
|
57
|
+
isDisabled: s
|
|
58
|
+
};
|
|
59
|
+
})), H = n(() => {
|
|
60
|
+
const e = Math.floor(60 / a.minuteInterval) - 0;
|
|
61
|
+
return Array.from({ length: e }, (t, r) => r * a.minuteInterval).map((t) => {
|
|
62
|
+
const r = i(o.value).set("minute", t), u = (a.minDate && o.value ? i(a.minDate).isAfter(r, "minute") : !1) || (a.maxDate && o.value ? i(a.maxDate).isBefore(r, "minute") : !1);
|
|
63
|
+
return {
|
|
64
|
+
label: `${t < 10 ? "0" : ""}${t}`,
|
|
65
|
+
value: r,
|
|
66
|
+
isDisabled: u
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
}), h = n(() => typeof p.value == "number" ? p.value >= 12 ? "pm" : "am" : void 0), V = n(
|
|
70
|
+
() => a.isHour12 ? [
|
|
71
|
+
{ label: "AM", value: "am" },
|
|
72
|
+
{ label: "PM", value: "pm" }
|
|
73
|
+
] : []
|
|
74
|
+
), j = n(() => {
|
|
75
|
+
const e = [
|
|
76
|
+
{
|
|
77
|
+
identifier: "hour",
|
|
78
|
+
values: N.value
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
identifier: "minute",
|
|
82
|
+
values: H.value
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
return a.isHour12 && e.push({
|
|
86
|
+
identifier: "ampm",
|
|
87
|
+
values: V.value
|
|
88
|
+
}), e;
|
|
89
|
+
}), o = n({
|
|
90
|
+
get: () => a.modelValue,
|
|
91
|
+
set: (e) => {
|
|
92
|
+
z("update:model-value", e);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
B(
|
|
96
|
+
() => a.isOpen,
|
|
97
|
+
async (e) => {
|
|
98
|
+
var t;
|
|
99
|
+
if (e) {
|
|
100
|
+
if (await _(), l.value) {
|
|
101
|
+
const r = l.value.querySelector(
|
|
102
|
+
".m-picker-time__column .m-btn"
|
|
103
|
+
), u = r == null ? void 0 : r.offsetHeight, m = ((t = l.value) == null ? void 0 : t.offsetHeight) / 2 - u / 2;
|
|
104
|
+
c.value = m / 16;
|
|
105
|
+
}
|
|
106
|
+
k(!1);
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{ immediate: !0 }
|
|
110
|
+
), B(
|
|
111
|
+
() => a.modelValue,
|
|
112
|
+
async (e, t) => {
|
|
113
|
+
e !== t && (await _(), k(!0));
|
|
114
|
+
},
|
|
115
|
+
{ immediate: !0 }
|
|
116
|
+
);
|
|
117
|
+
const k = (e) => {
|
|
118
|
+
f("hour", e), f("minute", e), a.isHour12 && f("ampm", e);
|
|
119
|
+
}, I = (e) => (a.disabledHours && a.disabledHours.includes(e)) ?? !1, D = (e, t) => t === "am" || t === "pm" ? h.value === t : e === "hour" ? p.value === t.get(e) : e === "minute" ? A.value === t.get(e) : !1, f = async (e, t = !0) => {
|
|
120
|
+
if (l.value) {
|
|
121
|
+
const r = l.value.querySelector(`.m-picker-time__column__${e}`), u = l.value.querySelector(
|
|
122
|
+
`.m-picker-time__column__${e} .--is-selected`
|
|
123
|
+
);
|
|
124
|
+
c.value && r && u && l.value && (await _(), R(r, u, c.value * 16, t));
|
|
125
|
+
}
|
|
126
|
+
}, q = async (e, t) => {
|
|
127
|
+
const r = i(o.value);
|
|
128
|
+
if (e === "hour" && typeof t == "object" && (o.value = r.set("hour", t.get("hour")).format()), e === "minute" && typeof t == "object") {
|
|
129
|
+
const u = r.set("minute", t.get("minute"));
|
|
130
|
+
o.value = u.format();
|
|
131
|
+
}
|
|
132
|
+
if (e === "ampm" && (h.value !== t || !p.value) && (t === "am" && (o.value = r.set("hour", r.get("hour")).subtract(12, "hour").format()), t === "pm")) {
|
|
133
|
+
const u = r.get("hour"), s = u + 12 > 12 && u + 12 < 24 ? u + 12 : u === 0 ? 12 : u;
|
|
134
|
+
o.value = r.set("hour", s).format();
|
|
135
|
+
}
|
|
136
|
+
await _(), f(e);
|
|
137
|
+
};
|
|
138
|
+
return (e, t) => (d(), y(
|
|
139
|
+
"div",
|
|
140
|
+
{
|
|
141
|
+
ref_key: "MazPickerTime",
|
|
142
|
+
ref: l,
|
|
143
|
+
class: g(["m-picker-time", { "--has-date": v.hasDate }])
|
|
144
|
+
},
|
|
145
|
+
[
|
|
146
|
+
(d(!0), y(
|
|
147
|
+
M,
|
|
148
|
+
null,
|
|
149
|
+
w(j.value, ({ values: r, identifier: u }, s) => (d(), y(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
key: s,
|
|
153
|
+
class: g(["m-picker-time__column", [`m-picker-time__column__${u}`]])
|
|
154
|
+
},
|
|
155
|
+
[
|
|
156
|
+
b(
|
|
157
|
+
"div",
|
|
158
|
+
{
|
|
159
|
+
style: S({ height: `${c.value}rem` }),
|
|
160
|
+
class: "m-picker-time__column__divider"
|
|
161
|
+
},
|
|
162
|
+
null,
|
|
163
|
+
4
|
|
164
|
+
/* STYLE */
|
|
165
|
+
),
|
|
166
|
+
b("div", Y, [
|
|
167
|
+
(d(!0), y(
|
|
168
|
+
M,
|
|
169
|
+
null,
|
|
170
|
+
w(r, ({ value: m, label: O, isDisabled: L }, F) => (d(), E(X, {
|
|
171
|
+
key: F,
|
|
172
|
+
size: "xs",
|
|
173
|
+
color: D(u, m) ? v.color : "transparent",
|
|
174
|
+
class: g({ "--is-selected": D(u, m) }),
|
|
175
|
+
disabled: L || v.disabled,
|
|
176
|
+
type: "button",
|
|
177
|
+
onClick: G((ee) => q(u, m), ["stop"])
|
|
178
|
+
}, {
|
|
179
|
+
default: J(() => [
|
|
180
|
+
K(
|
|
181
|
+
Q(O),
|
|
182
|
+
1
|
|
183
|
+
/* TEXT */
|
|
184
|
+
)
|
|
185
|
+
]),
|
|
186
|
+
_: 2
|
|
187
|
+
/* DYNAMIC */
|
|
188
|
+
}, 1032, ["color", "class", "disabled", "onClick"]))),
|
|
189
|
+
128
|
|
190
|
+
/* KEYED_FRAGMENT */
|
|
191
|
+
))
|
|
192
|
+
]),
|
|
193
|
+
b(
|
|
194
|
+
"div",
|
|
195
|
+
{
|
|
196
|
+
style: S({ height: `${c.value}rem` }),
|
|
197
|
+
class: "m-picker-time__column__divider"
|
|
198
|
+
},
|
|
199
|
+
null,
|
|
200
|
+
4
|
|
201
|
+
/* STYLE */
|
|
202
|
+
)
|
|
203
|
+
],
|
|
204
|
+
2
|
|
205
|
+
/* CLASS */
|
|
206
|
+
))),
|
|
207
|
+
128
|
|
208
|
+
/* KEYED_FRAGMENT */
|
|
209
|
+
))
|
|
210
|
+
],
|
|
211
|
+
2
|
|
212
|
+
/* CLASS */
|
|
213
|
+
));
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
const oe = /* @__PURE__ */ U(Z, [["__scopeId", "data-v-3b0c1ed8"]]);
|
|
217
|
+
export {
|
|
218
|
+
oe as default
|
|
219
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import "../assets/MazPickerYearSwitcher.css";
|
|
2
|
+
import { defineComponent as g, ref as b, computed as w, openBlock as m, createElementBlock as f, createElementVNode as u, createVNode as o, withModifiers as l, withCtx as i, unref as s, Fragment as S, renderList as Y, createBlock as D, normalizeClass as M, createTextVNode as B, toDisplayString as q } from "vue";
|
|
3
|
+
import { d as c, a as I, i as y, _ as N } from "./MazPicker-c85774e5.mjs";
|
|
4
|
+
import d from "./MazBtn-ba27c61d.mjs";
|
|
5
|
+
import { X as P } from "./x-mark-7761acf4.mjs";
|
|
6
|
+
import { C as v } from "./MazPickerCalendar-f5bbea58.mjs";
|
|
7
|
+
const V = { class: "maz-picker-year-switcher" }, E = { class: "maz-picker-year-switcher__header" }, L = { class: "maz-flex maz-space-x-2" }, T = { class: "maz-picker-year-switcher__main" }, X = /* @__PURE__ */ g({
|
|
8
|
+
__name: "MazPickerYearSwitcher",
|
|
9
|
+
props: {
|
|
10
|
+
color: { type: String, required: !0 },
|
|
11
|
+
locale: { type: String, required: !0 },
|
|
12
|
+
calendarDate: { type: String, required: !0 }
|
|
13
|
+
},
|
|
14
|
+
emits: ["update:calendar-date", "close"],
|
|
15
|
+
setup(n, { emit: z }) {
|
|
16
|
+
const p = n, _ = z, t = b(p.calendarDate), k = w(() => Array.from({ length: 15 }, (a, r) => r - 7).map((a) => {
|
|
17
|
+
const r = c(t.value).get("year"), e = c(t.value).set("year", r + a);
|
|
18
|
+
return {
|
|
19
|
+
label: I(e.format(), p.locale, {
|
|
20
|
+
year: "numeric"
|
|
21
|
+
}),
|
|
22
|
+
date: e
|
|
23
|
+
};
|
|
24
|
+
})), h = (a) => {
|
|
25
|
+
_("update:calendar-date", c(a).format()), _("close");
|
|
26
|
+
}, x = () => {
|
|
27
|
+
t.value = c(t.value).subtract(7, "year").format();
|
|
28
|
+
}, C = () => {
|
|
29
|
+
t.value = c(t.value).add(7, "year").format();
|
|
30
|
+
};
|
|
31
|
+
return (a, r) => (m(), f("div", V, [
|
|
32
|
+
u("div", E, [
|
|
33
|
+
u("div", L, [
|
|
34
|
+
o(d, {
|
|
35
|
+
size: "xs",
|
|
36
|
+
color: "transparent",
|
|
37
|
+
type: "button",
|
|
38
|
+
onClick: l(x, ["stop"])
|
|
39
|
+
}, {
|
|
40
|
+
default: i(() => [
|
|
41
|
+
o(s(v), { class: "maz-text-lg" })
|
|
42
|
+
]),
|
|
43
|
+
_: 1
|
|
44
|
+
/* STABLE */
|
|
45
|
+
}, 8, ["onClick"]),
|
|
46
|
+
o(d, {
|
|
47
|
+
size: "xs",
|
|
48
|
+
color: "transparent",
|
|
49
|
+
type: "button",
|
|
50
|
+
onClick: l(C, ["stop"])
|
|
51
|
+
}, {
|
|
52
|
+
default: i(() => [
|
|
53
|
+
o(s(v), { class: "maz-rotate-180 maz-text-lg" })
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
/* STABLE */
|
|
57
|
+
}, 8, ["onClick"])
|
|
58
|
+
]),
|
|
59
|
+
o(d, {
|
|
60
|
+
size: "xs",
|
|
61
|
+
color: "transparent",
|
|
62
|
+
type: "button",
|
|
63
|
+
onClick: r[0] || (r[0] = l((e) => a.$emit("close", e), ["stop"]))
|
|
64
|
+
}, {
|
|
65
|
+
default: i(() => [
|
|
66
|
+
o(s(P), { class: "maz-text-lg" })
|
|
67
|
+
]),
|
|
68
|
+
_: 1
|
|
69
|
+
/* STABLE */
|
|
70
|
+
})
|
|
71
|
+
]),
|
|
72
|
+
u("div", T, [
|
|
73
|
+
(m(!0), f(
|
|
74
|
+
S,
|
|
75
|
+
null,
|
|
76
|
+
Y(k.value, (e) => (m(), D(d, {
|
|
77
|
+
key: e.label,
|
|
78
|
+
size: "sm",
|
|
79
|
+
type: "button",
|
|
80
|
+
class: M({
|
|
81
|
+
"--is-selected": s(y)(e.date, n.calendarDate, "year")
|
|
82
|
+
}),
|
|
83
|
+
color: s(y)(e.date, n.calendarDate, "year") ? n.color : "transparent",
|
|
84
|
+
onClick: l(($) => h(e.date), ["stop"])
|
|
85
|
+
}, {
|
|
86
|
+
default: i(() => [
|
|
87
|
+
B(
|
|
88
|
+
q(e.label),
|
|
89
|
+
1
|
|
90
|
+
/* TEXT */
|
|
91
|
+
)
|
|
92
|
+
]),
|
|
93
|
+
_: 2
|
|
94
|
+
/* DYNAMIC */
|
|
95
|
+
}, 1032, ["class", "color", "onClick"]))),
|
|
96
|
+
128
|
|
97
|
+
/* KEYED_FRAGMENT */
|
|
98
|
+
))
|
|
99
|
+
])
|
|
100
|
+
]));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const K = /* @__PURE__ */ N(X, [["__scopeId", "data-v-698468b9"]]);
|
|
104
|
+
export {
|
|
105
|
+
K as default
|
|
106
|
+
};
|