maz-ui 3.22.4 → 3.23.1

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.
Files changed (249) hide show
  1. package/components/MazAvatar.mjs +2 -2
  2. package/components/MazBackdrop.mjs +67 -107
  3. package/components/MazBadge.mjs +41 -50
  4. package/components/MazBottomSheet.mjs +2 -2
  5. package/components/MazBtn.mjs +2 -2
  6. package/components/MazCard.mjs +2 -2
  7. package/components/MazCarousel.mjs +2 -2
  8. package/components/MazChart.mjs +53 -63
  9. package/components/MazCheckbox.mjs +84 -128
  10. package/components/MazDialog.mjs +2 -2
  11. package/components/MazDialogPromise.mjs +3 -3
  12. package/components/MazDrawer.mjs +2 -2
  13. package/components/MazDropdown.mjs +2 -2
  14. package/components/MazDropzone.mjs +2 -2
  15. package/components/MazFullscreenLoader.mjs +14 -18
  16. package/components/MazGallery.mjs +352 -558
  17. package/components/MazIcon.mjs +76 -140
  18. package/components/MazInput.mjs +2 -2
  19. package/components/MazInputNumber.mjs +72 -99
  20. package/components/MazInputPrice.mjs +2 -2
  21. package/components/MazInputTags.mjs +2 -2
  22. package/components/MazLazyImg.mjs +2 -2
  23. package/components/MazPhoneNumberInput.mjs +2 -2
  24. package/components/MazPicker.mjs +2 -2
  25. package/components/MazRadio.mjs +65 -94
  26. package/components/MazRadioButtons.mjs +64 -78
  27. package/components/MazSelect.mjs +2 -2
  28. package/components/MazSlider.mjs +213 -325
  29. package/components/MazSpinner.mjs +25 -34
  30. package/components/MazStepper.mjs +2 -2
  31. package/components/MazSwitch.mjs +43 -60
  32. package/components/MazTabs.mjs +16 -25
  33. package/components/MazTabsBar.mjs +2 -2
  34. package/components/MazTabsContent.mjs +34 -43
  35. package/components/MazTabsContentItem.mjs +49 -63
  36. package/components/MazTextarea.mjs +124 -169
  37. package/components/MazTransitionExpand.mjs +36 -54
  38. package/components/assets/MazBackdrop.css +1 -1
  39. package/components/assets/MazBottomSheet.css +1 -1
  40. package/components/assets/MazDialog.css +1 -1
  41. package/components/assets/MazDialogPromise.css +1 -1
  42. package/components/assets/MazDrawer.css +1 -1
  43. package/components/assets/MazPhoneNumberInput.css +1 -1
  44. package/components/assets/MazSelect.css +1 -1
  45. package/components/chunks/MazAvatar-1636f58b.mjs +126 -0
  46. package/components/chunks/MazBottomSheet-c24f92f8.mjs +217 -0
  47. package/components/chunks/MazBtn-124f3700.mjs +153 -0
  48. package/components/chunks/MazBtn-1e61862b.mjs +153 -0
  49. package/components/chunks/MazBtn-2d1d1ba5.mjs +153 -0
  50. package/components/chunks/MazBtn-3d74f737.mjs +153 -0
  51. package/components/chunks/MazBtn-4a447126.mjs +153 -0
  52. package/components/chunks/MazBtn-555928ed.mjs +153 -0
  53. package/components/chunks/MazBtn-571454f6.mjs +153 -0
  54. package/components/chunks/MazBtn-5e426592.mjs +153 -0
  55. package/components/chunks/MazBtn-683effc1.mjs +153 -0
  56. package/components/chunks/MazBtn-6905cc39.mjs +153 -0
  57. package/components/chunks/MazBtn-6ce4cfd3.mjs +153 -0
  58. package/components/chunks/MazBtn-74656d5b.mjs +153 -0
  59. package/components/chunks/MazBtn-7706b2da.mjs +158 -0
  60. package/components/chunks/MazBtn-a7a913dd.mjs +153 -0
  61. package/components/chunks/MazBtn-fb3c7af8.mjs +153 -0
  62. package/components/chunks/MazCard-bcc36489.mjs +214 -0
  63. package/components/chunks/MazCarousel-6da75122.mjs +107 -0
  64. package/components/chunks/MazCheckbox-040dc2c4.mjs +117 -0
  65. package/components/chunks/MazCheckbox-3a2b48b4.mjs +117 -0
  66. package/components/chunks/MazDialog-44eda544.mjs +250 -0
  67. package/components/chunks/MazDialogPromise-eec5acde.mjs +419 -0
  68. package/components/chunks/MazDrawer-b628b37e.mjs +206 -0
  69. package/components/chunks/MazDropdown-6f2248b0.mjs +345 -0
  70. package/components/chunks/MazDropzone-8cac10a6.mjs +242 -0
  71. package/components/chunks/MazGallery-6b8ecedf.mjs +617 -0
  72. package/components/chunks/MazIcon-52a76873.mjs +101 -0
  73. package/components/chunks/MazIcon-95e31ff8.mjs +96 -0
  74. package/components/chunks/MazInput-1ed4f946.mjs +283 -0
  75. package/components/chunks/MazInput-8a217995.mjs +271 -0
  76. package/components/chunks/MazInput-c51881ea.mjs +278 -0
  77. package/components/chunks/MazInputPrice-cd348d46.mjs +392 -0
  78. package/components/chunks/MazInputTags-aa95fae7.mjs +446 -0
  79. package/components/chunks/MazLazyImg-0412ab38.mjs +259 -0
  80. package/components/chunks/MazLazyImg-47d3449a.mjs +254 -0
  81. package/components/chunks/MazPhoneNumberInput-e1bf46f9.mjs +1216 -0
  82. package/components/chunks/MazPicker-e4620d8b.mjs +1140 -0
  83. package/components/chunks/MazPickerCalendar-da62262c.mjs +535 -0
  84. package/components/chunks/MazPickerHeader-a2e041eb.mjs +186 -0
  85. package/components/chunks/MazPickerMonthSwitcher-5bf8bd08.mjs +97 -0
  86. package/components/chunks/MazPickerShortcuts-7f95430e.mjs +74 -0
  87. package/components/chunks/MazPickerTime-717402ae.mjs +219 -0
  88. package/components/chunks/MazPickerYearSwitcher-85f97b6d.mjs +106 -0
  89. package/components/chunks/MazSelect-6ff6bb96.mjs +652 -0
  90. package/components/chunks/MazSpinner-054f948c.mjs +39 -0
  91. package/components/chunks/MazSpinner-059ee1d2.mjs +39 -0
  92. package/components/chunks/MazSpinner-08ee440b.mjs +39 -0
  93. package/components/chunks/MazSpinner-13403729.mjs +39 -0
  94. package/components/chunks/MazSpinner-44011019.mjs +39 -0
  95. package/components/chunks/MazSpinner-452a1534.mjs +39 -0
  96. package/components/chunks/MazSpinner-4c02cfd2.mjs +39 -0
  97. package/components/chunks/MazSpinner-51aa73ca.mjs +39 -0
  98. package/components/chunks/MazSpinner-6d1d24d5.mjs +39 -0
  99. package/components/chunks/MazSpinner-6e7c4705.mjs +39 -0
  100. package/components/chunks/MazSpinner-7895f54f.mjs +39 -0
  101. package/components/chunks/MazSpinner-7eee202e.mjs +39 -0
  102. package/components/chunks/MazSpinner-805e14a6.mjs +39 -0
  103. package/components/chunks/MazSpinner-85080b43.mjs +39 -0
  104. package/components/chunks/MazSpinner-a13a50c9.mjs +39 -0
  105. package/components/chunks/MazSpinner-a6d61cee.mjs +43 -0
  106. package/components/chunks/MazSpinner-c67b05bb.mjs +39 -0
  107. package/components/chunks/MazSpinner-caa33afc.mjs +39 -0
  108. package/components/chunks/MazSpinner-cb8fbe9a.mjs +39 -0
  109. package/components/chunks/MazSpinner-d9ef329f.mjs +39 -0
  110. package/components/chunks/MazStepper-39f018f3.mjs +191 -0
  111. package/components/chunks/MazTabsBar-27965f16.mjs +132 -0
  112. package/components/chunks/MazTransitionExpand-55cfbecb.mjs +41 -0
  113. package/components/chunks/MazTransitionExpand-cd24498f.mjs +41 -0
  114. package/components/chunks/_plugin-vue_export-helper-dad06003.mjs +9 -0
  115. package/components/chunks/check-31d7ba2f.mjs +30 -0
  116. package/components/chunks/check-c9b483c0.mjs +30 -0
  117. package/components/chunks/{check-circle-7acfa4c4.mjs → check-circle-59c383ed.mjs} +10 -12
  118. package/components/chunks/chevron-down-2b60111a.mjs +30 -0
  119. package/components/chunks/chevron-left-39b4621e.mjs +30 -0
  120. package/components/chunks/chevron-right-949a60fa.mjs +30 -0
  121. package/components/chunks/debounce-19c516b6.mjs +11 -0
  122. package/components/chunks/examples.mobile.json-f63d22fb.mjs +4 -0
  123. package/components/chunks/{exclamation-circle-2e115536.mjs → exclamation-circle-e2620aab.mjs} +10 -12
  124. package/components/chunks/{exclamation-triangle-10eb48dc.mjs → exclamation-triangle-21bf116a.mjs} +10 -12
  125. package/components/chunks/{eye-fbb13657.mjs → eye-dc12ce09.mjs} +12 -15
  126. package/components/chunks/{eye-slash-342420ff.mjs → eye-slash-fa42a017.mjs} +10 -12
  127. package/components/chunks/{magnifying-glass-5dffa35e.mjs → magnifying-glass-908981c0.mjs} +10 -12
  128. package/components/chunks/minus-e71140e1.mjs +30 -0
  129. package/components/chunks/no-photography-4c6c77cf.mjs +4 -0
  130. package/components/chunks/{no-photography-b0d08d6f.mjs → no-photography-be94ddda.mjs} +12 -15
  131. package/components/chunks/{no-symbol-975ce547.mjs → no-symbol-87477ad0.mjs} +10 -12
  132. package/components/chunks/{pencil-2f766dc8.mjs → pencil-4c35b4e7.mjs} +10 -12
  133. package/components/chunks/plus-c20544c3.mjs +30 -0
  134. package/components/chunks/x-mark-35f2f1e7.mjs +30 -0
  135. package/components/chunks/x-mark-7761acf4.mjs +29 -0
  136. package/modules/chunks/MazBtn-2f302422.cjs +1 -0
  137. package/modules/chunks/MazBtn-760c3b29.mjs +153 -0
  138. package/modules/chunks/MazIcon-0bd6b78e.mjs +96 -0
  139. package/modules/chunks/MazIcon-599a907f.cjs +1 -0
  140. package/modules/chunks/MazSpinner-03bd76bd.mjs +39 -0
  141. package/modules/chunks/MazSpinner-6ffa8db1.cjs +1 -0
  142. package/modules/chunks/{arrow-top-right-on-square-32bbe5a1.mjs → arrow-top-right-on-square-15191934.mjs} +10 -12
  143. package/modules/chunks/arrow-top-right-on-square-8e4ea6e2.cjs +1 -0
  144. package/modules/chunks/chevron-left-36731110.cjs +1 -0
  145. package/modules/chunks/chevron-left-39b4621e.mjs +30 -0
  146. package/modules/chunks/index-6a90ef88.mjs +1618 -0
  147. package/modules/chunks/index-794680d2.cjs +124 -0
  148. package/modules/chunks/{link-4eb05848.mjs → link-bb14441d.mjs} +10 -12
  149. package/modules/chunks/link-c7791a2a.cjs +1 -0
  150. package/modules/chunks/no-photography-0f6fcaf4.cjs +1 -0
  151. package/modules/chunks/no-photography-4c6c77cf.mjs +4 -0
  152. package/modules/chunks/x-mark-35f2f1e7.mjs +30 -0
  153. package/modules/chunks/x-mark-a28deca5.cjs +1 -0
  154. package/modules/index.cjs +1 -0
  155. package/modules/index.mjs +42 -42
  156. package/nuxt/index.json +1 -1
  157. package/package.json +14 -4
  158. package/types/resolvers/index.d.ts +1 -0
  159. package/types/resolvers/unplugin-vue-components-resolver.d.ts +8 -0
  160. package/types/utils/index.d.ts +3 -0
  161. package/components/chunks/MazAvatar-358d78d4.mjs +0 -138
  162. package/components/chunks/MazBottomSheet-61090f4a.mjs +0 -267
  163. package/components/chunks/MazBtn-0e02f0da.mjs +0 -184
  164. package/components/chunks/MazBtn-1daf9063.mjs +0 -184
  165. package/components/chunks/MazBtn-2f4fa942.mjs +0 -184
  166. package/components/chunks/MazBtn-31c6b731.mjs +0 -184
  167. package/components/chunks/MazBtn-48382169.mjs +0 -184
  168. package/components/chunks/MazBtn-4e1e116e.mjs +0 -184
  169. package/components/chunks/MazBtn-50abc4c5.mjs +0 -184
  170. package/components/chunks/MazBtn-84e12b6a.mjs +0 -184
  171. package/components/chunks/MazBtn-b42e3575.mjs +0 -184
  172. package/components/chunks/MazBtn-b56a7278.mjs +0 -184
  173. package/components/chunks/MazBtn-bbd6e9c8.mjs +0 -184
  174. package/components/chunks/MazBtn-cf0c8fcb.mjs +0 -184
  175. package/components/chunks/MazBtn-d92908b2.mjs +0 -191
  176. package/components/chunks/MazBtn-f48da79c.mjs +0 -184
  177. package/components/chunks/MazBtn-fec4c3b7.mjs +0 -184
  178. package/components/chunks/MazCard-4331dca0.mjs +0 -237
  179. package/components/chunks/MazCarousel-7825c7c9.mjs +0 -133
  180. package/components/chunks/MazCheckbox-ab5ddda2.mjs +0 -153
  181. package/components/chunks/MazCheckbox-e0bbe6ec.mjs +0 -153
  182. package/components/chunks/MazDialog-83e54b8c.mjs +0 -290
  183. package/components/chunks/MazDialogPromise-6967e821.mjs +0 -474
  184. package/components/chunks/MazDrawer-d778b3d2.mjs +0 -256
  185. package/components/chunks/MazDropdown-6f4482d7.mjs +0 -426
  186. package/components/chunks/MazDropzone-d1bb62dc.mjs +0 -325
  187. package/components/chunks/MazGallery-b2dc4286.mjs +0 -821
  188. package/components/chunks/MazIcon-b779da0a.mjs +0 -159
  189. package/components/chunks/MazIcon-bda198b4.mjs +0 -165
  190. package/components/chunks/MazInput-713b00d0.mjs +0 -326
  191. package/components/chunks/MazInput-b9386887.mjs +0 -341
  192. package/components/chunks/MazInput-c33627dd.mjs +0 -334
  193. package/components/chunks/MazInputPrice-452297f5.mjs +0 -481
  194. package/components/chunks/MazInputTags-7a463b81.mjs +0 -526
  195. package/components/chunks/MazLazyImg-6e395356.mjs +0 -336
  196. package/components/chunks/MazLazyImg-e0d8b6d0.mjs +0 -329
  197. package/components/chunks/MazPhoneNumberInput-48fe2445.mjs +0 -1536
  198. package/components/chunks/MazPicker-50fc11d1.mjs +0 -1352
  199. package/components/chunks/MazPickerCalendar-cacb361c.mjs +0 -689
  200. package/components/chunks/MazPickerHeader-63d45179.mjs +0 -216
  201. package/components/chunks/MazPickerMonthSwitcher-913c6e2c.mjs +0 -110
  202. package/components/chunks/MazPickerShortcuts-c6fabfc6.mjs +0 -88
  203. package/components/chunks/MazPickerTime-5e4475da.mjs +0 -301
  204. package/components/chunks/MazPickerYearSwitcher-dd4fa89c.mjs +0 -125
  205. package/components/chunks/MazSelect-2e5cd411.mjs +0 -850
  206. package/components/chunks/MazSpinner-022d7bee.mjs +0 -46
  207. package/components/chunks/MazSpinner-100c99b8.mjs +0 -46
  208. package/components/chunks/MazSpinner-191ad23b.mjs +0 -46
  209. package/components/chunks/MazSpinner-3155378b.mjs +0 -46
  210. package/components/chunks/MazSpinner-339a9006.mjs +0 -46
  211. package/components/chunks/MazSpinner-53979e96.mjs +0 -46
  212. package/components/chunks/MazSpinner-68d2f2ac.mjs +0 -46
  213. package/components/chunks/MazSpinner-6b563b22.mjs +0 -46
  214. package/components/chunks/MazSpinner-7cdc13e7.mjs +0 -46
  215. package/components/chunks/MazSpinner-8859d658.mjs +0 -46
  216. package/components/chunks/MazSpinner-8e180605.mjs +0 -52
  217. package/components/chunks/MazSpinner-9950424b.mjs +0 -46
  218. package/components/chunks/MazSpinner-c8270a93.mjs +0 -46
  219. package/components/chunks/MazSpinner-cb491238.mjs +0 -46
  220. package/components/chunks/MazSpinner-cb6f99f3.mjs +0 -46
  221. package/components/chunks/MazSpinner-ce4be8f1.mjs +0 -46
  222. package/components/chunks/MazSpinner-e5a9f319.mjs +0 -46
  223. package/components/chunks/MazSpinner-e92bd359.mjs +0 -46
  224. package/components/chunks/MazSpinner-eea9056d.mjs +0 -46
  225. package/components/chunks/MazSpinner-f1e69f29.mjs +0 -46
  226. package/components/chunks/MazStepper-4c19dbfc.mjs +0 -255
  227. package/components/chunks/MazTabsBar-3c2e2d69.mjs +0 -157
  228. package/components/chunks/MazTransitionExpand-474b00d4.mjs +0 -57
  229. package/components/chunks/MazTransitionExpand-f9e5a2d6.mjs +0 -57
  230. package/components/chunks/_plugin-vue_export-helper-cc2b3d55.mjs +0 -10
  231. package/components/chunks/check-8da249b1.mjs +0 -32
  232. package/components/chunks/check-f2fcce10.mjs +0 -32
  233. package/components/chunks/chevron-down-a78b9604.mjs +0 -32
  234. package/components/chunks/chevron-left-3365d59b.mjs +0 -32
  235. package/components/chunks/chevron-right-02f9e837.mjs +0 -32
  236. package/components/chunks/debounce-7d66ffa9.mjs +0 -12
  237. package/components/chunks/examples.mobile.json-618ba782.mjs +0 -4
  238. package/components/chunks/minus-c9cdee90.mjs +0 -32
  239. package/components/chunks/no-photography-7f2be516.mjs +0 -4
  240. package/components/chunks/plus-b1b0a5a8.mjs +0 -32
  241. package/components/chunks/x-mark-3b05101b.mjs +0 -31
  242. package/components/chunks/x-mark-c6ff45dd.mjs +0 -32
  243. package/modules/chunks/MazBtn-90ffd148.mjs +0 -184
  244. package/modules/chunks/MazIcon-988edef7.mjs +0 -159
  245. package/modules/chunks/MazSpinner-a16a3d8f.mjs +0 -46
  246. package/modules/chunks/chevron-left-3365d59b.mjs +0 -32
  247. package/modules/chunks/index-b1625fc2.mjs +0 -2315
  248. package/modules/chunks/no-photography-7f2be516.mjs +0 -4
  249. package/modules/chunks/x-mark-c6ff45dd.mjs +0 -32
@@ -1,1352 +0,0 @@
1
- import "../assets/MazPicker.css";
2
- import { nextTick, defineComponent, defineAsyncComponent, computed, openBlock, createElementBlock, normalizeClass, createBlock, unref, createCommentVNode, createElementVNode, getCurrentInstance, ref, onBeforeMount, onMounted as onMounted$1, onUnmounted as onUnmounted$1, watch, withDirectives, normalizeStyle, mergeProps, withCtx, createVNode, Transition, vShow } from "vue";
3
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
4
- function getDefaultExportFromCjs(x) {
5
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
6
- }
7
- var dayjs_min = { exports: {} };
8
- (function(module, exports) {
9
- !function(t, e) {
10
- module.exports = e();
11
- }(commonjsGlobal, function() {
12
- var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
13
- var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
14
- return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
15
- } }, m = function(t2, e2, n2) {
16
- var r2 = String(t2);
17
- return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
18
- }, v = { s: m, z: function(t2) {
19
- var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
20
- return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
21
- }, m: function t2(e2, n2) {
22
- if (e2.date() < n2.date())
23
- return -t2(n2, e2);
24
- var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
25
- return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
26
- }, a: function(t2) {
27
- return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
28
- }, p: function(t2) {
29
- return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
30
- }, u: function(t2) {
31
- return void 0 === t2;
32
- } }, g = "en", D = {};
33
- D[g] = M;
34
- var p = "$isDayjsObject", S = function(t2) {
35
- return t2 instanceof _ || !(!t2 || !t2[p]);
36
- }, w = function t2(e2, n2, r2) {
37
- var i2;
38
- if (!e2)
39
- return g;
40
- if ("string" == typeof e2) {
41
- var s2 = e2.toLowerCase();
42
- D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
43
- var u2 = e2.split("-");
44
- if (!i2 && u2.length > 1)
45
- return t2(u2[0]);
46
- } else {
47
- var a2 = e2.name;
48
- D[a2] = e2, i2 = a2;
49
- }
50
- return !r2 && i2 && (g = i2), i2 || !r2 && g;
51
- }, O = function(t2, e2) {
52
- if (S(t2))
53
- return t2.clone();
54
- var n2 = "object" == typeof e2 ? e2 : {};
55
- return n2.date = t2, n2.args = arguments, new _(n2);
56
- }, b = v;
57
- b.l = w, b.i = S, b.w = function(t2, e2) {
58
- return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
59
- };
60
- var _ = function() {
61
- function M2(t2) {
62
- this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
63
- }
64
- var m2 = M2.prototype;
65
- return m2.parse = function(t2) {
66
- this.$d = function(t3) {
67
- var e2 = t3.date, n2 = t3.utc;
68
- if (null === e2)
69
- return /* @__PURE__ */ new Date(NaN);
70
- if (b.u(e2))
71
- return /* @__PURE__ */ new Date();
72
- if (e2 instanceof Date)
73
- return new Date(e2);
74
- if ("string" == typeof e2 && !/Z$/i.test(e2)) {
75
- var r2 = e2.match($);
76
- if (r2) {
77
- var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
78
- return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
79
- }
80
- }
81
- return new Date(e2);
82
- }(t2), this.init();
83
- }, m2.init = function() {
84
- var t2 = this.$d;
85
- this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
86
- }, m2.$utils = function() {
87
- return b;
88
- }, m2.isValid = function() {
89
- return !(this.$d.toString() === l);
90
- }, m2.isSame = function(t2, e2) {
91
- var n2 = O(t2);
92
- return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
93
- }, m2.isAfter = function(t2, e2) {
94
- return O(t2) < this.startOf(e2);
95
- }, m2.isBefore = function(t2, e2) {
96
- return this.endOf(e2) < O(t2);
97
- }, m2.$g = function(t2, e2, n2) {
98
- return b.u(t2) ? this[e2] : this.set(n2, t2);
99
- }, m2.unix = function() {
100
- return Math.floor(this.valueOf() / 1e3);
101
- }, m2.valueOf = function() {
102
- return this.$d.getTime();
103
- }, m2.startOf = function(t2, e2) {
104
- var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
105
- var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
106
- return r2 ? i2 : i2.endOf(a);
107
- }, $2 = function(t3, e3) {
108
- return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
109
- }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
110
- switch (f2) {
111
- case h:
112
- return r2 ? l2(1, 0) : l2(31, 11);
113
- case c:
114
- return r2 ? l2(1, M3) : l2(0, M3 + 1);
115
- case o:
116
- var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
117
- return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
118
- case a:
119
- case d:
120
- return $2(v2 + "Hours", 0);
121
- case u:
122
- return $2(v2 + "Minutes", 1);
123
- case s:
124
- return $2(v2 + "Seconds", 2);
125
- case i:
126
- return $2(v2 + "Milliseconds", 3);
127
- default:
128
- return this.clone();
129
- }
130
- }, m2.endOf = function(t2) {
131
- return this.startOf(t2, false);
132
- }, m2.$set = function(t2, e2) {
133
- var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
134
- if (o2 === c || o2 === h) {
135
- var y2 = this.clone().set(d, 1);
136
- y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
137
- } else
138
- l2 && this.$d[l2]($2);
139
- return this.init(), this;
140
- }, m2.set = function(t2, e2) {
141
- return this.clone().$set(t2, e2);
142
- }, m2.get = function(t2) {
143
- return this[b.p(t2)]();
144
- }, m2.add = function(r2, f2) {
145
- var d2, l2 = this;
146
- r2 = Number(r2);
147
- var $2 = b.p(f2), y2 = function(t2) {
148
- var e2 = O(l2);
149
- return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
150
- };
151
- if ($2 === c)
152
- return this.set(c, this.$M + r2);
153
- if ($2 === h)
154
- return this.set(h, this.$y + r2);
155
- if ($2 === a)
156
- return y2(1);
157
- if ($2 === o)
158
- return y2(7);
159
- var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
160
- return b.w(m3, this);
161
- }, m2.subtract = function(t2, e2) {
162
- return this.add(-1 * t2, e2);
163
- }, m2.format = function(t2) {
164
- var e2 = this, n2 = this.$locale();
165
- if (!this.isValid())
166
- return n2.invalidDate || l;
167
- var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
168
- return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
169
- }, d2 = function(t3) {
170
- return b.s(s2 % 12 || 12, t3, "0");
171
- }, $2 = f2 || function(t3, e3, n3) {
172
- var r3 = t3 < 12 ? "AM" : "PM";
173
- return n3 ? r3.toLowerCase() : r3;
174
- };
175
- return r2.replace(y, function(t3, r3) {
176
- return r3 || function(t4) {
177
- switch (t4) {
178
- case "YY":
179
- return String(e2.$y).slice(-2);
180
- case "YYYY":
181
- return b.s(e2.$y, 4, "0");
182
- case "M":
183
- return a2 + 1;
184
- case "MM":
185
- return b.s(a2 + 1, 2, "0");
186
- case "MMM":
187
- return h2(n2.monthsShort, a2, c2, 3);
188
- case "MMMM":
189
- return h2(c2, a2);
190
- case "D":
191
- return e2.$D;
192
- case "DD":
193
- return b.s(e2.$D, 2, "0");
194
- case "d":
195
- return String(e2.$W);
196
- case "dd":
197
- return h2(n2.weekdaysMin, e2.$W, o2, 2);
198
- case "ddd":
199
- return h2(n2.weekdaysShort, e2.$W, o2, 3);
200
- case "dddd":
201
- return o2[e2.$W];
202
- case "H":
203
- return String(s2);
204
- case "HH":
205
- return b.s(s2, 2, "0");
206
- case "h":
207
- return d2(1);
208
- case "hh":
209
- return d2(2);
210
- case "a":
211
- return $2(s2, u2, true);
212
- case "A":
213
- return $2(s2, u2, false);
214
- case "m":
215
- return String(u2);
216
- case "mm":
217
- return b.s(u2, 2, "0");
218
- case "s":
219
- return String(e2.$s);
220
- case "ss":
221
- return b.s(e2.$s, 2, "0");
222
- case "SSS":
223
- return b.s(e2.$ms, 3, "0");
224
- case "Z":
225
- return i2;
226
- }
227
- return null;
228
- }(t3) || i2.replace(":", "");
229
- });
230
- }, m2.utcOffset = function() {
231
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
232
- }, m2.diff = function(r2, d2, l2) {
233
- var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
234
- return b.m(y2, m3);
235
- };
236
- switch (M3) {
237
- case h:
238
- $2 = D2() / 12;
239
- break;
240
- case c:
241
- $2 = D2();
242
- break;
243
- case f:
244
- $2 = D2() / 3;
245
- break;
246
- case o:
247
- $2 = (g2 - v2) / 6048e5;
248
- break;
249
- case a:
250
- $2 = (g2 - v2) / 864e5;
251
- break;
252
- case u:
253
- $2 = g2 / n;
254
- break;
255
- case s:
256
- $2 = g2 / e;
257
- break;
258
- case i:
259
- $2 = g2 / t;
260
- break;
261
- default:
262
- $2 = g2;
263
- }
264
- return l2 ? $2 : b.a($2);
265
- }, m2.daysInMonth = function() {
266
- return this.endOf(c).$D;
267
- }, m2.$locale = function() {
268
- return D[this.$L];
269
- }, m2.locale = function(t2, e2) {
270
- if (!t2)
271
- return this.$L;
272
- var n2 = this.clone(), r2 = w(t2, e2, true);
273
- return r2 && (n2.$L = r2), n2;
274
- }, m2.clone = function() {
275
- return b.w(this.$d, this);
276
- }, m2.toDate = function() {
277
- return new Date(this.valueOf());
278
- }, m2.toJSON = function() {
279
- return this.isValid() ? this.toISOString() : null;
280
- }, m2.toISOString = function() {
281
- return this.$d.toISOString();
282
- }, m2.toString = function() {
283
- return this.$d.toUTCString();
284
- }, M2;
285
- }(), k = _.prototype;
286
- return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t2) {
287
- k[t2[1]] = function(e2) {
288
- return this.$g(e2, t2[0], t2[1]);
289
- };
290
- }), O.extend = function(t2, e2) {
291
- return t2.$i || (t2(e2, _, O), t2.$i = true), O;
292
- }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
293
- return O(1e3 * t2);
294
- }, O.en = D[g], O.Ls = D, O.p = {}, O;
295
- });
296
- })(dayjs_min);
297
- var dayjs_minExports = dayjs_min.exports;
298
- const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports);
299
- var customParseFormat$1 = { exports: {} };
300
- (function(module, exports) {
301
- !function(e, t) {
302
- module.exports = t();
303
- }(commonjsGlobal, function() {
304
- var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d\d/, r = /\d\d?/, i = /\d*[^-_:/,()\s\d]+/, o = {}, s = function(e2) {
305
- return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
306
- };
307
- var a = function(e2) {
308
- return function(t2) {
309
- this[e2] = +t2;
310
- };
311
- }, f = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
312
- (this.zone || (this.zone = {})).offset = function(e3) {
313
- if (!e3)
314
- return 0;
315
- if ("Z" === e3)
316
- return 0;
317
- var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
318
- return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
319
- }(e2);
320
- }], h = function(e2) {
321
- var t2 = o[e2];
322
- return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
323
- }, u = function(e2, t2) {
324
- var n2, r2 = o.meridiem;
325
- if (r2) {
326
- for (var i2 = 1; i2 <= 24; i2 += 1)
327
- if (e2.indexOf(r2(i2, 0, t2)) > -1) {
328
- n2 = i2 > 12;
329
- break;
330
- }
331
- } else
332
- n2 = e2 === (t2 ? "pm" : "PM");
333
- return n2;
334
- }, d = { A: [i, function(e2) {
335
- this.afternoon = u(e2, false);
336
- }], a: [i, function(e2) {
337
- this.afternoon = u(e2, true);
338
- }], S: [/\d/, function(e2) {
339
- this.milliseconds = 100 * +e2;
340
- }], SS: [n, function(e2) {
341
- this.milliseconds = 10 * +e2;
342
- }], SSS: [/\d{3}/, function(e2) {
343
- this.milliseconds = +e2;
344
- }], s: [r, a("seconds")], ss: [r, a("seconds")], m: [r, a("minutes")], mm: [r, a("minutes")], H: [r, a("hours")], h: [r, a("hours")], HH: [r, a("hours")], hh: [r, a("hours")], D: [r, a("day")], DD: [n, a("day")], Do: [i, function(e2) {
345
- var t2 = o.ordinal, n2 = e2.match(/\d+/);
346
- if (this.day = n2[0], t2)
347
- for (var r2 = 1; r2 <= 31; r2 += 1)
348
- t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
349
- }], M: [r, a("month")], MM: [n, a("month")], MMM: [i, function(e2) {
350
- var t2 = h("months"), n2 = (h("monthsShort") || t2.map(function(e3) {
351
- return e3.slice(0, 3);
352
- })).indexOf(e2) + 1;
353
- if (n2 < 1)
354
- throw new Error();
355
- this.month = n2 % 12 || n2;
356
- }], MMMM: [i, function(e2) {
357
- var t2 = h("months").indexOf(e2) + 1;
358
- if (t2 < 1)
359
- throw new Error();
360
- this.month = t2 % 12 || t2;
361
- }], Y: [/[+-]?\d+/, a("year")], YY: [n, function(e2) {
362
- this.year = s(e2);
363
- }], YYYY: [/\d{4}/, a("year")], Z: f, ZZ: f };
364
- function c(n2) {
365
- var r2, i2;
366
- r2 = n2, i2 = o && o.formats;
367
- for (var s2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t2, n3, r3) {
368
- var o2 = r3 && r3.toUpperCase();
369
- return n3 || i2[r3] || e[r3] || i2[o2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e2, t3, n4) {
370
- return t3 || n4.slice(1);
371
- });
372
- })).match(t), a2 = s2.length, f2 = 0; f2 < a2; f2 += 1) {
373
- var h2 = s2[f2], u2 = d[h2], c2 = u2 && u2[0], l = u2 && u2[1];
374
- s2[f2] = l ? { regex: c2, parser: l } : h2.replace(/^\[|\]$/g, "");
375
- }
376
- return function(e2) {
377
- for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
378
- var i3 = s2[n3];
379
- if ("string" == typeof i3)
380
- r3 += i3.length;
381
- else {
382
- var o2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = o2.exec(h3)[0];
383
- f3.call(t2, u3), e2 = e2.replace(u3, "");
384
- }
385
- }
386
- return function(e3) {
387
- var t3 = e3.afternoon;
388
- if (void 0 !== t3) {
389
- var n4 = e3.hours;
390
- t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
391
- }
392
- }(t2), t2;
393
- };
394
- }
395
- return function(e2, t2, n2) {
396
- n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (s = e2.parseTwoDigitYear);
397
- var r2 = t2.prototype, i2 = r2.parse;
398
- r2.parse = function(e3) {
399
- var t3 = e3.date, r3 = e3.utc, s2 = e3.args;
400
- this.$u = r3;
401
- var a2 = s2[1];
402
- if ("string" == typeof a2) {
403
- var f2 = true === s2[2], h2 = true === s2[3], u2 = f2 || h2, d2 = s2[2];
404
- h2 && (d2 = s2[2]), o = this.$locale(), !f2 && d2 && (o = n2.Ls[d2]), this.$d = function(e4, t4, n3) {
405
- try {
406
- if (["x", "X"].indexOf(t4) > -1)
407
- return new Date(("X" === t4 ? 1e3 : 1) * e4);
408
- var r4 = c(t4)(e4), i3 = r4.year, o2 = r4.month, s3 = r4.day, a3 = r4.hours, f3 = r4.minutes, h3 = r4.seconds, u3 = r4.milliseconds, d3 = r4.zone, l2 = /* @__PURE__ */ new Date(), m2 = s3 || (i3 || o2 ? 1 : l2.getDate()), M2 = i3 || l2.getFullYear(), Y = 0;
409
- i3 && !o2 || (Y = o2 > 0 ? o2 - 1 : l2.getMonth());
410
- var p = a3 || 0, v = f3 || 0, D = h3 || 0, g = u3 || 0;
411
- return d3 ? new Date(Date.UTC(M2, Y, m2, p, v, D, g + 60 * d3.offset * 1e3)) : n3 ? new Date(Date.UTC(M2, Y, m2, p, v, D, g)) : new Date(M2, Y, m2, p, v, D, g);
412
- } catch (e5) {
413
- return /* @__PURE__ */ new Date("");
414
- }
415
- }(t3, a2, r3), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), o = {};
416
- } else if (a2 instanceof Array)
417
- for (var l = a2.length, m = 1; m <= l; m += 1) {
418
- s2[1] = a2[m - 1];
419
- var M = n2.apply(this, s2);
420
- if (M.isValid()) {
421
- this.$d = M.$d, this.$L = M.$L, this.init();
422
- break;
423
- }
424
- m === l && (this.$d = /* @__PURE__ */ new Date(""));
425
- }
426
- else
427
- i2.call(this, e3);
428
- };
429
- };
430
- });
431
- })(customParseFormat$1);
432
- var customParseFormatExports = customParseFormat$1.exports;
433
- const customParseFormat = /* @__PURE__ */ getDefaultExportFromCjs(customParseFormatExports);
434
- var isBetween$1 = { exports: {} };
435
- (function(module, exports) {
436
- !function(e, i) {
437
- module.exports = i();
438
- }(commonjsGlobal, function() {
439
- return function(e, i, t) {
440
- i.prototype.isBetween = function(e2, i2, s, f) {
441
- var n = t(e2), o = t(i2), r = "(" === (f = f || "()")[0], u = ")" === f[1];
442
- return (r ? this.isAfter(n, s) : !this.isBefore(n, s)) && (u ? this.isBefore(o, s) : !this.isAfter(o, s)) || (r ? this.isBefore(n, s) : !this.isAfter(n, s)) && (u ? this.isAfter(o, s) : !this.isBefore(o, s));
443
- };
444
- };
445
- });
446
- })(isBetween$1);
447
- var isBetweenExports = isBetween$1.exports;
448
- const isBetween = /* @__PURE__ */ getDefaultExportFromCjs(isBetweenExports);
449
- const UNIQUE_ID = "__vue_click_away__";
450
- const getEventType = () => {
451
- return document.ontouchstart === null ? "touchstart" : "click";
452
- };
453
- const onMounted = async (el, binding) => {
454
- onUnmounted(el);
455
- const vm = binding.instance;
456
- const callback = binding.value;
457
- const isCallbackFunction = typeof callback === "function";
458
- if (!isCallbackFunction) {
459
- throw new Error("[maz-ui](vClickOutside) the callback should be a function");
460
- }
461
- await nextTick();
462
- el[UNIQUE_ID] = (event) => {
463
- if ((!el || !el.contains(event.target)) && callback && isCallbackFunction) {
464
- return callback.call(vm, event);
465
- }
466
- };
467
- const eventType = getEventType();
468
- document.addEventListener(eventType, el[UNIQUE_ID], false);
469
- };
470
- const onUnmounted = (el) => {
471
- const eventType = getEventType();
472
- document.removeEventListener(eventType, el[UNIQUE_ID], false);
473
- delete el[UNIQUE_ID];
474
- };
475
- const onUpdated = (el, binding) => {
476
- if (binding.value === binding.oldValue) {
477
- return;
478
- }
479
- onMounted(el, binding);
480
- };
481
- const directive = {
482
- mounted: onMounted,
483
- updated: onUpdated,
484
- unmounted: onUnmounted
485
- };
486
- const DEFAULT_OPTIONS = {
487
- month: "short",
488
- day: "numeric",
489
- year: "numeric"
490
- };
491
- const date = (date2, locale, options) => {
492
- if (locale === void 0) {
493
- throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");
494
- }
495
- if (typeof locale !== "string") {
496
- throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");
497
- }
498
- const opts = options ?? DEFAULT_OPTIONS;
499
- try {
500
- const usedDate = date2 instanceof Date ? date2 : new Date(date2);
501
- return new Intl.DateTimeFormat(locale, opts).format(usedDate);
502
- } catch (error) {
503
- throw new Error(`[maz-ui](FilterDate) ${error}`);
504
- }
505
- };
506
- var weekday$1 = { exports: {} };
507
- (function(module, exports) {
508
- !function(e, t) {
509
- module.exports = t();
510
- }(commonjsGlobal, function() {
511
- return function(e, t) {
512
- t.prototype.weekday = function(e2) {
513
- var t2 = this.$locale().weekStart || 0, i = this.$W, n = (i < t2 ? i + 7 : i) - t2;
514
- return this.$utils().u(e2) ? n : this.subtract(n, "day").add(e2, "day");
515
- };
516
- };
517
- });
518
- })(weekday$1);
519
- var weekdayExports = weekday$1.exports;
520
- const weekday = /* @__PURE__ */ getDefaultExportFromCjs(weekdayExports);
521
- const capitalize = (value) => {
522
- if (!value)
523
- return "";
524
- value = value.toString();
525
- return value.charAt(0).toUpperCase() + value.slice(1);
526
- };
527
- dayjs.extend(weekday);
528
- function getFormattedDate({
529
- value,
530
- locale,
531
- options
532
- }) {
533
- return value ? capitalize(date(value, locale, options)) : void 0;
534
- }
535
- function getRangeFormattedDate({
536
- value,
537
- locale,
538
- options
539
- }) {
540
- const startValue = getFormattedDate({
541
- value: value.start,
542
- locale,
543
- options
544
- });
545
- const endValue = getFormattedDate({
546
- value: value.end,
547
- locale,
548
- options
549
- });
550
- return startValue || endValue ? `${startValue || "..."} - ${endValue || "..."}` : void 0;
551
- }
552
- function getFirstDayOfMonth(value) {
553
- return dayjs(value).startOf("month").day();
554
- }
555
- function getDaysOfWeek(locale, firstDayOfWeek) {
556
- const currentDate = dayjs().locale(locale);
557
- const days = [];
558
- for (let i = 0; i < 7; i++) {
559
- const day = currentDate.day(i + firstDayOfWeek).toDate();
560
- const dayName = date(day, locale, { weekday: "short" });
561
- days.push(dayName);
562
- }
563
- return days;
564
- }
565
- function getDaysInMonth(date2) {
566
- return dayjs(date2).daysInMonth();
567
- }
568
- function isToday(date2) {
569
- return dayjs().isSame(date2, "date");
570
- }
571
- function isSameDate(date2, date22, unit) {
572
- return dayjs(date2).isSame(date22, unit);
573
- }
574
- function isSameDay(date2, dayNumber) {
575
- return dayjs(date2).day() === dayNumber;
576
- }
577
- function getISODate(value, format = "YYYY-MM-DD") {
578
- if (!value) {
579
- return void 0;
580
- }
581
- return dayjs(value).format(format);
582
- }
583
- function getRangeISODate(value, format = "YYYY-MM-DD") {
584
- return {
585
- start: getISODate(value.start, format),
586
- end: getISODate(value.end, format)
587
- };
588
- }
589
- function checkValueWithMinMaxDates({
590
- value,
591
- minDate,
592
- maxDate,
593
- format
594
- }) {
595
- if (minDate && dayjs(value).isBefore(minDate)) {
596
- return {
597
- newValue: minDate,
598
- newCurrentDate: dayjs(minDate, format).format()
599
- };
600
- } else if (maxDate && dayjs(value).isAfter(maxDate)) {
601
- return {
602
- newValue: maxDate,
603
- newCurrentDate: dayjs(maxDate, format).format()
604
- };
605
- }
606
- return {
607
- newValue: void 0,
608
- newCurrentDate: void 0
609
- };
610
- }
611
- function isValueDisabledWeekly({
612
- value,
613
- disabledWeekly
614
- }) {
615
- return disabledWeekly.some((dayNumber) => isSameDay(value, dayNumber));
616
- }
617
- function isValueDisabledDate({
618
- value,
619
- disabledDates
620
- }) {
621
- return disabledDates.some((disabledDate) => dayjs(value).isSame(dayjs(disabledDate), "date"));
622
- }
623
- const scrollToTarget = function(scrollContainer, target, offset = 0, hasSmoothEffect = true) {
624
- scrollContainer.scrollTo({
625
- top: target.offsetTop - offset,
626
- behavior: hasSmoothEffect ? "smooth" : "auto"
627
- });
628
- };
629
- const findNearestNumberInList = (list, number) => {
630
- return list.reduce((prev, curr) => {
631
- return Math.abs(curr - number) < Math.abs(prev - number) ? curr : prev;
632
- });
633
- };
634
- function getBrowserLocale() {
635
- try {
636
- if (typeof window === "undefined") {
637
- return void 0;
638
- }
639
- return window.navigator.language;
640
- } catch (error) {
641
- throw new Error(`[MazPhoneNumberInput] (browserLocale) ${error}`);
642
- }
643
- }
644
- async function fetchLocale() {
645
- try {
646
- const reponse = await fetch("https://ipwho.is");
647
- const { country_code } = await reponse.json();
648
- return country_code;
649
- } catch (error) {
650
- console.error(`[maz-ui](MazPicker)(fetchCountryCode) ${error}`);
651
- }
652
- }
653
- const _hoisted_1$1 = { class: "m-picker-container__wrapper" };
654
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
655
- __name: "MazPickerContainer",
656
- props: {
657
- modelValue: {
658
- type: [String, Object],
659
- default: void 0
660
- },
661
- calendarDate: { type: String, required: true },
662
- color: { type: String, required: true },
663
- locale: { type: String, required: true },
664
- noHeader: { type: Boolean, default: false },
665
- firstDayOfWeek: { type: Number, required: true },
666
- double: { type: Boolean, required: true },
667
- hasDate: { type: Boolean, required: true },
668
- minDate: { type: String, default: void 0 },
669
- maxDate: { type: String, default: void 0 },
670
- inline: { type: Boolean, required: true },
671
- noShortcuts: { type: Boolean, required: true },
672
- shortcuts: {
673
- type: Array,
674
- required: true
675
- },
676
- shortcut: { type: String, default: void 0 },
677
- hasTime: { type: Boolean, required: true },
678
- isOpen: { type: Boolean, required: true },
679
- format: { type: String, required: true },
680
- isHour12: { type: Boolean, required: true },
681
- formatterOptions: {
682
- type: Object,
683
- required: true
684
- },
685
- minuteInterval: { type: Number, required: true },
686
- disabled: { type: Boolean, required: true },
687
- disabledWeekly: { type: Array, required: true },
688
- disabledHours: { type: Array, required: true },
689
- disabledDates: { type: Array, required: true }
690
- },
691
- emits: ["update:model-value", "update:calendar-date", "close"],
692
- setup(__props, { emit: __emit }) {
693
- const MazPickerTime = defineAsyncComponent(() => import("./MazPickerTime-5e4475da.mjs"));
694
- const MazPickerHeader = defineAsyncComponent(() => import("./MazPickerHeader-63d45179.mjs"));
695
- const MazPickerCalendar = defineAsyncComponent(() => import("./MazPickerCalendar-cacb361c.mjs").then((n) => n.M));
696
- const props = __props;
697
- const emits = __emit;
698
- const currentDate = computed({
699
- get: () => props.modelValue,
700
- set: (value) => {
701
- emits("update:model-value", value);
702
- }
703
- });
704
- const calendarDate = computed({
705
- get: () => props.calendarDate,
706
- set: (calendarDate2) => emits("update:calendar-date", calendarDate2)
707
- });
708
- return (_ctx, _cache) => {
709
- return openBlock(), createElementBlock(
710
- "div",
711
- {
712
- class: normalizeClass(["m-picker-container", {
713
- "--has-double": __props.double,
714
- "--is-inline": __props.inline,
715
- "--has-date": __props.hasDate
716
- }])
717
- },
718
- [
719
- !__props.noHeader ? (openBlock(), createBlock(unref(MazPickerHeader), {
720
- key: 0,
721
- color: __props.color,
722
- "has-time": __props.hasTime,
723
- "model-value": __props.modelValue,
724
- locale: __props.locale,
725
- "calendar-date": calendarDate.value,
726
- "has-date": __props.hasDate,
727
- "formatter-options": __props.formatterOptions,
728
- double: __props.double,
729
- "no-shortcuts": __props.noShortcuts,
730
- class: "m-picker-container__header"
731
- }, null, 8, ["color", "has-time", "model-value", "locale", "calendar-date", "has-date", "formatter-options", "double", "no-shortcuts"])) : createCommentVNode("v-if", true),
732
- createElementVNode("div", _hoisted_1$1, [
733
- __props.hasDate ? (openBlock(), createBlock(unref(MazPickerCalendar), {
734
- key: 0,
735
- modelValue: currentDate.value,
736
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentDate.value = $event),
737
- "calendar-date": calendarDate.value,
738
- "onUpdate:calendarDate": _cache[1] || (_cache[1] = ($event) => calendarDate.value = $event),
739
- color: __props.color,
740
- locale: __props.locale,
741
- "has-time": __props.hasTime,
742
- double: __props.double,
743
- "min-date": __props.minDate,
744
- "max-date": __props.maxDate,
745
- "first-day-of-week": __props.firstDayOfWeek,
746
- disabled: __props.disabled,
747
- "disabled-weekly": __props.disabledWeekly,
748
- "disabled-dates": __props.disabledDates,
749
- shortcuts: __props.shortcuts,
750
- shortcut: __props.shortcut,
751
- "no-shortcuts": __props.noShortcuts,
752
- class: "m-picker-container__calendar"
753
- }, null, 8, ["modelValue", "calendar-date", "color", "locale", "has-time", "double", "min-date", "max-date", "first-day-of-week", "disabled", "disabled-weekly", "disabled-dates", "shortcuts", "shortcut", "no-shortcuts"])) : createCommentVNode("v-if", true),
754
- __props.hasTime ? (openBlock(), createBlock(unref(MazPickerTime), {
755
- key: 1,
756
- modelValue: currentDate.value,
757
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => currentDate.value = $event),
758
- "calendar-date": calendarDate.value,
759
- "onUpdate:calendarDate": _cache[3] || (_cache[3] = ($event) => calendarDate.value = $event),
760
- "is-open": __props.isOpen,
761
- color: __props.color,
762
- locale: __props.locale,
763
- "min-date": __props.minDate,
764
- "max-date": __props.maxDate,
765
- "has-date": __props.hasDate,
766
- format: __props.format,
767
- disabled: __props.disabled,
768
- "disabled-hours": __props.disabledHours,
769
- "minute-interval": __props.minuteInterval,
770
- "formatter-options": __props.formatterOptions,
771
- "is-hour12": __props.isHour12,
772
- class: "m-picker-container__time"
773
- }, null, 8, ["modelValue", "calendar-date", "is-open", "color", "locale", "min-date", "max-date", "has-date", "format", "disabled", "disabled-hours", "minute-interval", "formatter-options", "is-hour12"])) : createCommentVNode("v-if", true)
774
- ])
775
- ],
776
- 2
777
- /* CLASS */
778
- );
779
- };
780
- }
781
- });
782
- const MazPickerContainer_vue_vue_type_style_index_0_scoped_eea709c5_lang = "";
783
- const _export_sfc = (sfc, props) => {
784
- const target = sfc.__vccOpts || sfc;
785
- for (const [key, val] of props) {
786
- target[key] = val;
787
- }
788
- return target;
789
- };
790
- const MazPickerContainer = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-eea709c5"]]);
791
- const _hoisted_1 = {
792
- type: "button",
793
- tabindex: "-1",
794
- class: "m-picker__button"
795
- };
796
- const _sfc_main = /* @__PURE__ */ defineComponent({
797
- __name: "MazPicker",
798
- props: {
799
- modelValue: {
800
- type: [String, Object],
801
- default: void 0
802
- },
803
- format: { type: String, default: "YYYY-MM-DD" },
804
- open: { type: Boolean, default: false },
805
- label: { type: String, default: void 0 },
806
- placeholder: { type: String, default: void 0 },
807
- inputDateStyle: {
808
- type: Object,
809
- default: () => ({
810
- dateStyle: "full"
811
- })
812
- },
813
- locale: { type: String, default: void 0 },
814
- style: { type: Object, default: void 0 },
815
- noHeader: { type: Boolean, default: false },
816
- disabled: { type: Boolean, default: false },
817
- firstDayOfWeek: {
818
- type: Number,
819
- default: 0,
820
- validator: (value) => {
821
- const isValid = Array.from({ length: 7 }, (_v, i) => i).includes(value);
822
- if (!isValid) {
823
- console.error('[maz-ui](MazPicker) "first-day-of-week" should be between 0 and 6');
824
- }
825
- return isValid;
826
- }
827
- },
828
- autoClose: { type: Boolean, default: false },
829
- customElementSelector: { type: String, default: void 0 },
830
- double: { type: Boolean, default: false },
831
- inline: { type: Boolean, default: false },
832
- color: {
833
- type: String,
834
- default: "primary"
835
- },
836
- pickerPosition: {
837
- type: String,
838
- default: void 0,
839
- validator: (value) => {
840
- return [
841
- "top",
842
- "top right",
843
- "top left",
844
- "bottom",
845
- "bottom right",
846
- "bottom left",
847
- "left",
848
- "right"
849
- ].includes(value);
850
- }
851
- },
852
- time: { type: Boolean, default: false },
853
- onlyTime: { type: Boolean, default: false },
854
- minuteInterval: { type: Number, default: 5 },
855
- noUseBrowserLocale: { type: Boolean, default: false },
856
- noFetchLocal: { type: Boolean, default: false },
857
- noShortcuts: { type: Boolean, default: false },
858
- shortcuts: {
859
- type: Array,
860
- default: () => [
861
- {
862
- label: "Last 7 days",
863
- identifier: "last7Days",
864
- value: {
865
- start: dayjs().subtract(6, "day").format("YYYY-MM-DD"),
866
- end: dayjs().format("YYYY-MM-DD")
867
- }
868
- },
869
- {
870
- label: "Last 30 days",
871
- identifier: "last30Days",
872
- value: {
873
- start: dayjs().subtract(29, "day").format("YYYY-MM-DD"),
874
- end: dayjs().format("YYYY-MM-DD")
875
- }
876
- },
877
- {
878
- label: "This week",
879
- identifier: "thisWeek",
880
- value: {
881
- start: dayjs().startOf("week").format("YYYY-MM-DD"),
882
- end: dayjs().endOf("week").format("YYYY-MM-DD")
883
- }
884
- },
885
- {
886
- label: "Last week",
887
- identifier: "lastWeek",
888
- value: {
889
- start: dayjs().subtract(1, "week").startOf("week").format("YYYY-MM-DD"),
890
- end: dayjs().subtract(1, "week").endOf("week").format("YYYY-MM-DD")
891
- }
892
- },
893
- {
894
- label: "This month",
895
- identifier: "thisMonth",
896
- value: {
897
- start: dayjs().set("date", 1).format("YYYY-MM-DD"),
898
- end: dayjs().set("date", dayjs().daysInMonth()).format("YYYY-MM-DD")
899
- }
900
- },
901
- {
902
- label: "This year",
903
- identifier: "thisYear",
904
- value: {
905
- start: dayjs().startOf("year").format("YYYY-MM-DD"),
906
- end: dayjs().endOf("year").format("YYYY-MM-DD")
907
- }
908
- },
909
- {
910
- label: "Last year",
911
- identifier: "lastYear",
912
- value: {
913
- start: dayjs().subtract(1, "year").startOf("year").format("YYYY-MM-DD"),
914
- end: dayjs().subtract(1, "year").endOf("year").format("YYYY-MM-DD")
915
- }
916
- }
917
- ]
918
- },
919
- shortcut: { type: String, default: void 0 },
920
- minDate: { type: String, default: void 0 },
921
- maxDate: { type: String, default: void 0 },
922
- disabledWeekly: {
923
- type: Array,
924
- default: () => [],
925
- validator: (value) => {
926
- return 7 >= value && value >= 0;
927
- }
928
- },
929
- disabledDates: { type: Array, default: () => [] },
930
- disabledHours: {
931
- type: Array,
932
- default: () => [],
933
- validator: (value) => {
934
- return 23 >= value && value >= 0;
935
- }
936
- }
937
- },
938
- emits: ["update:model-value", "close"],
939
- setup(__props, { emit: __emit }) {
940
- const ChevronDownIcon = defineAsyncComponent(() => import("./chevron-down-a78b9604.mjs"));
941
- const MazInput = defineAsyncComponent(() => import("./MazInput-713b00d0.mjs"));
942
- dayjs.extend(customParseFormat);
943
- dayjs.extend(isBetween);
944
- const defaultInputDateStyle = {
945
- dateStyle: "full"
946
- };
947
- const props = __props;
948
- const instance = getCurrentInstance();
949
- const internalLocale = ref(props.locale || "en-US");
950
- const currentLocale = computed(() => props.locale ?? internalLocale.value);
951
- const containerUniqueId = computed(() => `mazPickerContainer-${instance == null ? void 0 : instance.uid}`);
952
- const emits = __emit;
953
- const MazPicker2 = ref();
954
- const hasTime = computed(() => props.time || props.onlyTime);
955
- const hasDouble = computed(() => props.double && !props.onlyTime);
956
- const hasDate = computed(() => !props.onlyTime);
957
- const isRangeMode = computed(() => typeof currentValue.value === "object");
958
- onBeforeMount(() => {
959
- if (isRangeMode.value && hasTime.value) {
960
- console.error(`[maz-ui](MazPicker) You can't use time picker with range picker`);
961
- }
962
- if (hasTime.value && !(props.format.includes("h") || props.format.includes("H"))) {
963
- console.error(
964
- `[maz-ui](MazPicker) When you use the time picker, you must provided a format with time - Ex: "YYYY-MM-DD HH:mm"`
965
- );
966
- }
967
- if (props.format.includes("h") && !(props.format.includes("a") || props.format.includes("A"))) {
968
- console.error(
969
- '[maz-ui](MazPicker) if you use the 12 format "h" or "hh", you must add "a" or "A" at the end of the format - Ex: "YYYY-MM-DD hh:mm a"'
970
- );
971
- }
972
- });
973
- const currentValue = computed({
974
- get: () => {
975
- return props.modelValue && typeof props.modelValue === "object" ? {
976
- start: props.modelValue.start ? dayjs(props.modelValue.start, props.format).format() : void 0,
977
- end: props.modelValue.end ? dayjs(props.modelValue.end, props.format).format() : void 0
978
- } : props.modelValue ? dayjs(props.modelValue, props.format).format() : void 0;
979
- },
980
- set: (value) => {
981
- if (props.disabled) {
982
- return;
983
- }
984
- emitValue(value);
985
- if (props.autoClose && value !== "object") {
986
- closeCalendar();
987
- }
988
- }
989
- });
990
- const getCalendarDate = (value) => {
991
- const baseDate = (typeof value === "object" ? value.start : value) ?? dayjs().format();
992
- if (props.minDate && dayjs(baseDate).isBefore(props.minDate)) {
993
- return props.minDate;
994
- } else if (props.maxDate && dayjs(baseDate).isAfter(props.maxDate)) {
995
- return props.minDate ?? props.maxDate;
996
- } else {
997
- return baseDate;
998
- }
999
- };
1000
- const calendarDate = ref(getCalendarDate(currentValue.value));
1001
- const isHour12 = computed(
1002
- () => props.format.includes("a") || props.format.includes("A") || props.format.includes("h")
1003
- );
1004
- const formatterOptions = computed(() => ({
1005
- ...defaultInputDateStyle,
1006
- ...props.inputDateStyle,
1007
- timeStyle: props.inputDateStyle.timeStyle ?? hasTime.value ? "short" : void 0,
1008
- hour12: props.inputDateStyle.hour12 ?? isHour12.value
1009
- }));
1010
- const inputValue = computed(() => {
1011
- if (!currentValue.value)
1012
- return;
1013
- if (props.onlyTime) {
1014
- return currentValue.value ? date(dayjs(currentValue.value).format(), currentLocale.value, {
1015
- timeStyle: formatterOptions.value.timeStyle,
1016
- hour12: formatterOptions.value.hour12
1017
- }) : void 0;
1018
- } else if (typeof currentValue.value === "object") {
1019
- return getRangeFormattedDate({
1020
- value: currentValue.value,
1021
- locale: currentLocale.value,
1022
- options: formatterOptions.value
1023
- });
1024
- } else {
1025
- return getFormattedDate({
1026
- value: dayjs(currentValue.value).format(),
1027
- locale: currentLocale.value,
1028
- options: formatterOptions.value
1029
- });
1030
- }
1031
- });
1032
- const isFocused = ref(false);
1033
- const programaticallyOpened = ref(false);
1034
- const pickerContainerPosition = ref({
1035
- vertical: "bottom",
1036
- horizontal: "left"
1037
- });
1038
- const isOpen = computed(() => {
1039
- return (isFocused.value || props.open || programaticallyOpened.value) && !props.disabled || props.inline;
1040
- });
1041
- const isMounted = ref(false);
1042
- onMounted$1(async () => {
1043
- isMounted.value = true;
1044
- if (props.customElementSelector) {
1045
- addEventToTriggerCustomElement(props.customElementSelector);
1046
- }
1047
- if (!props.locale) {
1048
- const browserLocale = getBrowserLocale();
1049
- if (!props.noUseBrowserLocale && browserLocale) {
1050
- internalLocale.value = browserLocale;
1051
- } else if (!props.noFetchLocal) {
1052
- const locale = await fetchLocale();
1053
- if (locale)
1054
- internalLocale.value = locale;
1055
- }
1056
- }
1057
- });
1058
- onUnmounted$1(() => {
1059
- if (props.customElementSelector) {
1060
- removeEventToTriggerCustomElement(props.customElementSelector);
1061
- }
1062
- });
1063
- const getPickerContainerPosition = async () => {
1064
- if (props.pickerPosition) {
1065
- const horizontal = props.pickerPosition.includes("right") ? "right" : "left";
1066
- const vertical = props.pickerPosition.includes("top") ? "top" : "bottom";
1067
- return {
1068
- horizontal,
1069
- vertical
1070
- };
1071
- } else {
1072
- return {
1073
- horizontal: "left",
1074
- vertical: await calcVerticalPosition(MazPicker2.value)
1075
- };
1076
- }
1077
- };
1078
- const calcVerticalPosition = async (parent) => {
1079
- if (typeof window === "undefined") {
1080
- return "bottom";
1081
- }
1082
- const OFFSET = 30;
1083
- await nextTick();
1084
- const pickerContainer = document.querySelector(`#${containerUniqueId.value}`);
1085
- const parentRect = parent == null ? void 0 : parent.getBoundingClientRect();
1086
- const windowHeight = window.innerHeight;
1087
- const pickerHeight = ((pickerContainer == null ? void 0 : pickerContainer.clientHeight) ?? 0) - OFFSET;
1088
- const spaceOnBottom = (parentRect && windowHeight - parentRect.bottom) ?? 0;
1089
- const spaceOnTop = (parentRect && parentRect.top) ?? 0;
1090
- const hasSpaceOnBottom = spaceOnBottom && spaceOnBottom >= pickerHeight;
1091
- const hasSpaceOnTop = spaceOnTop && spaceOnTop >= pickerHeight;
1092
- if (!hasSpaceOnBottom && (hasSpaceOnTop || spaceOnTop >= spaceOnBottom)) {
1093
- return "top";
1094
- }
1095
- return "bottom";
1096
- };
1097
- const closeCalendar = () => {
1098
- isFocused.value = false;
1099
- programaticallyOpened.value = false;
1100
- emits("close");
1101
- };
1102
- function closeCalendarOnClickOutside() {
1103
- if (!props.customElementSelector) {
1104
- closeCalendar();
1105
- }
1106
- }
1107
- const toggleProgramatically = () => {
1108
- programaticallyOpened.value = !programaticallyOpened.value;
1109
- };
1110
- const addEventToTriggerCustomElement = (selector) => {
1111
- const target = document.querySelector(selector);
1112
- if (target) {
1113
- target.addEventListener("click", toggleProgramatically);
1114
- } else {
1115
- throw new Error(
1116
- `[maz-ui](MazPicker) impossible to find custom element with selector "${selector}"`
1117
- );
1118
- }
1119
- };
1120
- const removeEventToTriggerCustomElement = (selector) => {
1121
- const target = document.querySelector(selector);
1122
- target == null ? void 0 : target.removeEventListener("click", toggleProgramatically);
1123
- };
1124
- const checkMinMaxValues = (value) => {
1125
- if (props.minDate || props.maxDate) {
1126
- if (typeof value === "string") {
1127
- const { newValue, newCurrentDate } = checkValueWithMinMaxDates({
1128
- value,
1129
- minDate: props.minDate,
1130
- maxDate: props.maxDate,
1131
- format: props.format
1132
- });
1133
- if (newValue) {
1134
- emitValue(newValue);
1135
- }
1136
- if (newCurrentDate) {
1137
- setCalendarDate(newCurrentDate);
1138
- }
1139
- } else if (typeof value === "object" && (value.start || value.end)) {
1140
- let newStartValue = value.start;
1141
- let newEndValue = value.end;
1142
- if (value.start) {
1143
- const { newValue, newCurrentDate } = checkValueWithMinMaxDates({
1144
- value: value.start,
1145
- minDate: props.minDate,
1146
- maxDate: props.maxDate,
1147
- format: props.format
1148
- });
1149
- if (newValue)
1150
- newStartValue = newValue;
1151
- if (newCurrentDate) {
1152
- setCalendarDate(newCurrentDate);
1153
- }
1154
- }
1155
- if (value.end) {
1156
- const { newValue } = checkValueWithMinMaxDates({
1157
- value: value.end,
1158
- minDate: props.minDate,
1159
- maxDate: props.maxDate,
1160
- format: props.format
1161
- });
1162
- if (newValue)
1163
- newEndValue = newValue;
1164
- }
1165
- emitValue({
1166
- start: newStartValue,
1167
- end: newEndValue
1168
- });
1169
- }
1170
- }
1171
- };
1172
- const setCalendarDate = (value) => {
1173
- if (value && !dayjs(calendarDate.value).isSame(value, "month")) {
1174
- calendarDate.value = value;
1175
- }
1176
- };
1177
- const emitValue = (value) => {
1178
- if (typeof value === "object") {
1179
- const newValue = getRangeISODate(value, props.format);
1180
- emits("update:model-value", newValue);
1181
- if (newValue.start) {
1182
- setCalendarDate(newValue.start);
1183
- }
1184
- } else {
1185
- emits("update:model-value", getISODate(value, props.format));
1186
- }
1187
- };
1188
- watch(
1189
- () => [currentValue.value, props.minDate, props.maxDate],
1190
- (values, oldValues) => {
1191
- const value = values[0];
1192
- const oldValue = oldValues == null ? void 0 : oldValues[0];
1193
- if (typeof value === "object" && (value.start || value.end)) {
1194
- if (!oldValue || typeof oldValue === "object" && (oldValue.start !== value.start || oldValue.end !== value.end)) {
1195
- emitValue(value);
1196
- checkMinMaxValues(value);
1197
- }
1198
- } else if (typeof value === "string" && value !== oldValue) {
1199
- emitValue(value);
1200
- checkMinMaxValues(value);
1201
- }
1202
- },
1203
- { immediate: true }
1204
- );
1205
- function keyboardHandler(event) {
1206
- if (event.code === "Escape" && isOpen.value) {
1207
- event.preventDefault();
1208
- closeCalendar();
1209
- }
1210
- }
1211
- watch(
1212
- () => isOpen.value,
1213
- async (value) => {
1214
- if (value) {
1215
- pickerContainerPosition.value = await getPickerContainerPosition();
1216
- if (!props.inline && isMounted.value)
1217
- document.addEventListener("keydown", keyboardHandler);
1218
- } else {
1219
- if (!props.inline && isMounted.value) {
1220
- document.removeEventListener("keydown", keyboardHandler);
1221
- }
1222
- }
1223
- },
1224
- { immediate: true }
1225
- );
1226
- watch(
1227
- () => [currentValue.value, props.disabledWeekly, props.disabledDates],
1228
- (values) => {
1229
- const value = values[0];
1230
- const disabledWeekly = values[1];
1231
- const disabledDates = values[2];
1232
- if (typeof value === "object" && (value.start || value.end)) {
1233
- if (value.start && isValueDisabledWeekly({ value: value.start, disabledWeekly }) || value.start && isValueDisabledDate({ value: value.start, disabledDates }) || value.end && isValueDisabledWeekly({ value: value.end, disabledWeekly }) || value.end && isValueDisabledDate({ value: value.end, disabledDates })) {
1234
- currentValue.value = { start: void 0, end: void 0 };
1235
- }
1236
- if (value.end && isValueDisabledWeekly({ value: value.end, disabledWeekly }) || value.end && isValueDisabledDate({ value: value.end, disabledDates })) {
1237
- currentValue.value = { start: value.start, end: void 0 };
1238
- }
1239
- } else if (typeof value === "string" && (isValueDisabledWeekly({ value, disabledWeekly }) || isValueDisabledDate({ value, disabledDates }))) {
1240
- currentValue.value = void 0;
1241
- }
1242
- },
1243
- { immediate: true }
1244
- );
1245
- return (_ctx, _cache) => {
1246
- return withDirectives((openBlock(), createElementBlock(
1247
- "div",
1248
- {
1249
- ref_key: "MazPicker",
1250
- ref: MazPicker2,
1251
- class: normalizeClass(["m-picker", [
1252
- `m-picker--${__props.color}`,
1253
- `m-picker--${pickerContainerPosition.value.vertical}`,
1254
- `m-picker--${pickerContainerPosition.value.horizontal}`,
1255
- {
1256
- "--is-open": isOpen.value,
1257
- "--is-disabled": __props.disabled
1258
- }
1259
- ]]),
1260
- role: "none",
1261
- style: normalizeStyle(__props.style)
1262
- },
1263
- [
1264
- !__props.customElementSelector && !__props.inline ? (openBlock(), createBlock(unref(MazInput), mergeProps({
1265
- key: 0,
1266
- "model-value": inputValue.value,
1267
- readonly: ""
1268
- }, _ctx.$attrs, {
1269
- autocomplete: "off",
1270
- class: "m-picker__input",
1271
- label: __props.label,
1272
- disabled: __props.disabled,
1273
- placeholder: __props.placeholder,
1274
- color: __props.color,
1275
- onClick: _cache[0] || (_cache[0] = ($event) => isFocused.value = !isFocused.value)
1276
- }), {
1277
- "right-icon": withCtx(() => [
1278
- createElementVNode("button", _hoisted_1, [
1279
- createVNode(unref(ChevronDownIcon), { class: "m-picker__button__chevron maz-text-lg" })
1280
- ])
1281
- ]),
1282
- _: 1
1283
- /* STABLE */
1284
- }, 16, ["model-value", "label", "disabled", "placeholder", "color"])) : createCommentVNode("v-if", true),
1285
- createVNode(Transition, {
1286
- name: pickerContainerPosition.value.vertical === "top" ? "maz-slideinvert" : "maz-slide",
1287
- persisted: ""
1288
- }, {
1289
- default: withCtx(() => [
1290
- withDirectives(createVNode(MazPickerContainer, {
1291
- id: containerUniqueId.value,
1292
- ref: "PickerContainer",
1293
- modelValue: currentValue.value,
1294
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => currentValue.value = $event),
1295
- "calendar-date": calendarDate.value,
1296
- "onUpdate:calendarDate": _cache[2] || (_cache[2] = ($event) => calendarDate.value = $event),
1297
- "is-open": isOpen.value,
1298
- color: __props.color,
1299
- locale: currentLocale.value,
1300
- "has-date": hasDate.value,
1301
- double: hasDouble.value,
1302
- "has-time": hasTime.value,
1303
- "formatter-options": formatterOptions.value,
1304
- "no-header": __props.noHeader,
1305
- "min-date": __props.minDate,
1306
- format: __props.format,
1307
- "is-hour12": isHour12.value,
1308
- "max-date": __props.maxDate,
1309
- "disabled-weekly": __props.disabledWeekly,
1310
- inline: __props.inline,
1311
- "first-day-of-week": __props.firstDayOfWeek,
1312
- shortcuts: __props.shortcuts,
1313
- shortcut: __props.shortcut,
1314
- disabled: __props.disabled,
1315
- "disabled-hours": __props.disabledHours,
1316
- "disabled-dates": __props.disabledDates,
1317
- "minute-interval": __props.minuteInterval,
1318
- "no-shortcuts": __props.noShortcuts,
1319
- onClose: closeCalendar
1320
- }, null, 8, ["id", "modelValue", "calendar-date", "is-open", "color", "locale", "has-date", "double", "has-time", "formatter-options", "no-header", "min-date", "format", "is-hour12", "max-date", "disabled-weekly", "inline", "first-day-of-week", "shortcuts", "shortcut", "disabled", "disabled-hours", "disabled-dates", "minute-interval", "no-shortcuts"]), [
1321
- [vShow, isOpen.value]
1322
- ])
1323
- ]),
1324
- _: 1
1325
- /* STABLE */
1326
- }, 8, ["name"])
1327
- ],
1328
- 6
1329
- /* CLASS, STYLE */
1330
- )), [
1331
- [unref(directive), closeCalendarOnClickOutside]
1332
- ]);
1333
- };
1334
- }
1335
- });
1336
- const MazPicker_vue_vue_type_style_index_0_scoped_015a6233_lang = "";
1337
- const MazPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-015a6233"]]);
1338
- export {
1339
- MazPicker as M,
1340
- _export_sfc as _,
1341
- date as a,
1342
- getFirstDayOfMonth as b,
1343
- capitalize as c,
1344
- dayjs as d,
1345
- isToday as e,
1346
- findNearestNumberInList as f,
1347
- getDaysInMonth as g,
1348
- isSameDay as h,
1349
- isSameDate as i,
1350
- getDaysOfWeek as j,
1351
- scrollToTarget as s
1352
- };