maz-ui 4.7.5 → 4.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/chunks/MazAccordion.CKnz73h4.js +1 -0
  2. package/dist/chunks/MazAlert.B8hE7wet.js +1 -0
  3. package/dist/chunks/MazAnimatedCounter.GLLYbZAz.js +1 -0
  4. package/dist/chunks/MazAnimatedElement._8NY8WgC.js +1 -0
  5. package/dist/chunks/MazAnimatedText.BSZ8FNf-.js +1 -0
  6. package/dist/chunks/MazAvatar.vO5VNPi8.js +1 -0
  7. package/dist/chunks/MazBackdrop.Cjbwi8-V.js +1 -0
  8. package/dist/chunks/MazBadge.BBZJgHXm.js +1 -0
  9. package/dist/chunks/MazBottomSheet.WgZ6qobx.js +1 -0
  10. package/dist/chunks/MazBtn.Cc9C1v2l.js +1 -0
  11. package/dist/chunks/MazBtnGroup.3B1XcqWM.js +1 -0
  12. package/dist/chunks/MazCard.YYC0LaHY.js +1 -0
  13. package/dist/chunks/MazCardSpotlight.SpZF61hl.js +1 -0
  14. package/dist/chunks/MazCarousel.1NT4jcvR.js +1 -0
  15. package/dist/chunks/MazChart.CDZ2PBTC.js +1 -0
  16. package/dist/chunks/MazCheckbox.DurIbKdf.js +1 -0
  17. package/dist/chunks/MazChecklist.D9ezwGpQ.js +1 -0
  18. package/dist/chunks/MazCircularProgressBar.rATx_hD9.js +1 -0
  19. package/dist/chunks/MazContainer.zXcfMOs-.js +1 -0
  20. package/dist/chunks/MazDatePicker.KUP34cbV.js +1 -0
  21. package/dist/chunks/MazDialog.CtKF3Xzo.js +1 -0
  22. package/dist/chunks/MazDialogConfirm.CAAHeBPE.js +1 -0
  23. package/dist/chunks/MazDrawer.Dc_RGG8a.js +1 -0
  24. package/dist/chunks/MazDropdown.2DUcivzO.js +1 -0
  25. package/dist/chunks/MazDropzone.CiWiPcFM.js +1 -0
  26. package/dist/chunks/MazExpandAnimation.CMMwtuQA.js +1 -0
  27. package/dist/chunks/MazFullscreenLoader.BIVRcZJ8.js +1 -0
  28. package/dist/chunks/MazGallery.CEmGy0K9.js +1 -0
  29. package/dist/chunks/MazIcon.ZWAk25ZX.js +1 -0
  30. package/dist/chunks/MazInput.DJjWLaKg.js +1 -0
  31. package/dist/chunks/MazInputCode.DKnl3i-X.js +1 -0
  32. package/dist/chunks/MazInputNumber.B42Mn-9h.js +1 -0
  33. package/dist/chunks/MazInputPhoneNumber.CLivThtK.js +1 -0
  34. package/dist/chunks/MazInputPrice.BeL-M944.js +1 -0
  35. package/dist/chunks/MazInputTags.CIVT9F6Q.js +1 -0
  36. package/dist/chunks/MazLazyImg.-EMwandx.js +1 -0
  37. package/dist/chunks/MazLink.BOpxMATj.js +1 -0
  38. package/dist/chunks/MazLoadingBar.C86AX2Tk.js +1 -0
  39. package/dist/chunks/MazPagination.CNNKXBsg.js +1 -0
  40. package/dist/chunks/MazPickerCalendarDays.CSZZbk5Z.js +1 -0
  41. package/dist/chunks/MazPickerCalendarGrid.DrUHBH6-.js +1 -0
  42. package/dist/chunks/MazPickerContainer.BZ74M74V.js +1 -0
  43. package/dist/chunks/MazPopover.Co8BEopX.js +1 -0
  44. package/dist/chunks/MazPullToRefresh.DMtb6Oa3.js +1 -0
  45. package/dist/chunks/MazRadio.75ipjTw2.js +1 -0
  46. package/dist/chunks/MazRadioButtons.DenHCgB3.js +1 -0
  47. package/dist/chunks/MazReadMore.CDXacQIw.js +1 -0
  48. package/dist/chunks/MazReadingProgressBar.828Y0mxA.js +1 -0
  49. package/dist/chunks/MazSelect.yYFAbBb5.js +1 -0
  50. package/dist/chunks/MazSelectCountry.DvVgk2es.js +1 -0
  51. package/dist/chunks/MazSkeleton.BewTYJC2.js +1 -0
  52. package/dist/chunks/MazSlider.BS5QHWK6.js +1 -0
  53. package/dist/chunks/MazSpinner.D3NN2pow.js +1 -0
  54. package/dist/chunks/MazStepper.DTu8HG9T.js +1 -0
  55. package/dist/chunks/MazSwitch.Dvmj-rTW.js +1 -0
  56. package/dist/chunks/MazTable.DnOehvN6.js +1 -0
  57. package/dist/chunks/MazTableCell.xbm2NGWL.js +1 -0
  58. package/dist/chunks/MazTableRow.B5dJiXk1.js +1 -0
  59. package/dist/chunks/MazTableTitle.DNA_1mCy.js +1 -0
  60. package/dist/chunks/MazTabs.-0-YP3QQ.js +1 -0
  61. package/dist/chunks/MazTabsBar.D2JVKMS7.js +1 -0
  62. package/dist/chunks/MazTabsContent.C9omK25X.js +1 -0
  63. package/dist/chunks/MazTabsContentItem.mJEAS5R8.js +1 -0
  64. package/dist/chunks/MazTextarea.BliEP5G5.js +1 -0
  65. package/dist/chunks/MazUiProvider.BgN8V0lD.js +1 -0
  66. package/dist/chunks/_plugin-vue_export-helper.ChmETRGw.js +1 -0
  67. package/dist/chunks/dialog.DexeIC3K.js +1 -0
  68. package/dist/chunks/dom-events.BPrKJiCz.js +1 -0
  69. package/dist/chunks/resolveLinkComponent.DAc3sqGH.js +1 -0
  70. package/dist/chunks/toast.UQ8RRuT9.js +1 -0
  71. package/dist/chunks/types.DDbvTVqf.js +1 -0
  72. package/dist/chunks/useMazInputPhoneNumber.B_qQ0ldP.js +1 -0
  73. package/dist/chunks/utils.B8bfGQxN.js +1 -0
  74. package/dist/chunks/vFullscreenImg.CZeRh3mw.js +1 -0
  75. package/dist/chunks/vLazyImg.CXmd3Lp0.js +1 -0
  76. package/dist/chunks/vZoomImg.CaAHb98S.js +124 -0
  77. package/dist/components/MazAccordion.js +1 -86
  78. package/dist/components/MazAlert.js +1 -85
  79. package/dist/components/MazAnimatedCounter.js +1 -73
  80. package/dist/components/MazAnimatedElement.js +1 -44
  81. package/dist/components/MazAnimatedText.js +1 -103
  82. package/dist/components/MazAvatar.js +1 -125
  83. package/dist/components/MazBackdrop.js +1 -163
  84. package/dist/components/MazBadge.js +1 -29
  85. package/dist/components/MazBottomSheet.js +1 -55
  86. package/dist/components/MazBtn.js +1 -109
  87. package/dist/components/MazBtnGroup.js +1 -44
  88. package/dist/components/MazCard.js +1 -184
  89. package/dist/components/MazCardSpotlight.js +1 -81
  90. package/dist/components/MazCarousel.js +1 -104
  91. package/dist/components/MazChart.js +1 -4
  92. package/dist/components/MazCheckbox.js +1 -128
  93. package/dist/components/MazChecklist.js +1 -133
  94. package/dist/components/MazCircularProgressBar.js +1 -131
  95. package/dist/components/MazContainer.js +1 -71
  96. package/dist/components/MazDatePicker/MazPickerCalendar.js +1 -113
  97. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarDays.js +1 -19
  98. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarGrid.js +1 -181
  99. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarMonth.js +1 -75
  100. package/dist/components/MazDatePicker/MazPickerCalendarSwitcher.js +1 -90
  101. package/dist/components/MazDatePicker/MazPickerContainer.js +1 -116
  102. package/dist/components/MazDatePicker/MazPickerHeader.js +1 -126
  103. package/dist/components/MazDatePicker/MazPickerMonthSwitcher.js +1 -82
  104. package/dist/components/MazDatePicker/MazPickerShortcuts.js +1 -55
  105. package/dist/components/MazDatePicker/MazPickerTime.js +1 -178
  106. package/dist/components/MazDatePicker/MazPickerYearSwitcher.js +1 -95
  107. package/dist/components/MazDatePicker.js +1 -466
  108. package/dist/components/MazDatePicker.vue.d.ts +2 -6
  109. package/dist/components/MazDialog.js +1 -115
  110. package/dist/components/MazDialog.vue.d.ts +2 -6
  111. package/dist/components/MazDialogConfirm.js +1 -6
  112. package/dist/components/MazDialogConfirm.vue.d.ts +2 -6
  113. package/dist/components/MazDrawer.js +1 -70
  114. package/dist/components/MazDropdown.js +1 -277
  115. package/dist/components/MazDropdown.vue.d.ts +2 -6
  116. package/dist/components/MazDropzone.js +1 -533
  117. package/dist/components/MazExpandAnimation.js +1 -46
  118. package/dist/components/MazFullscreenLoader.js +1 -38
  119. package/dist/components/MazGallery.js +1 -105
  120. package/dist/components/MazIcon.js +1 -114
  121. package/dist/components/MazInput.js +1 -256
  122. package/dist/components/MazInputCode.js +1 -152
  123. package/dist/components/MazInputNumber.js +1 -152
  124. package/dist/components/MazInputPhoneNumber/PhoneInput.js +1 -114
  125. package/dist/components/MazInputPhoneNumber.js +1 -253
  126. package/dist/components/MazInputPrice.js +1 -4
  127. package/dist/components/MazInputTags.js +1 -145
  128. package/dist/components/MazLazyImg.js +1 -62
  129. package/dist/components/MazLink.js +1 -80
  130. package/dist/components/MazLoadingBar.js +1 -24
  131. package/dist/components/MazPagination.js +1 -184
  132. package/dist/components/MazPopover.js +1 -326
  133. package/dist/components/MazPullToRefresh.js +1 -145
  134. package/dist/components/MazRadio.js +1 -103
  135. package/dist/components/MazRadioButtons.js +1 -135
  136. package/dist/components/MazReadMore.js +1 -110
  137. package/dist/components/MazReadingProgressBar.js +1 -68
  138. package/dist/components/MazSelect.js +1 -413
  139. package/dist/components/MazSelectCountry.js +1 -192
  140. package/dist/components/MazSkeleton.js +1 -50
  141. package/dist/components/MazSlider.js +1 -205
  142. package/dist/components/MazSpinner.js +1 -27
  143. package/dist/components/MazStepper.js +1 -170
  144. package/dist/components/MazSwitch.js +1 -4
  145. package/dist/components/MazTable.js +1 -8
  146. package/dist/components/MazTableCell.js +1 -18
  147. package/dist/components/MazTableRow.js +1 -26
  148. package/dist/components/MazTableTitle.js +1 -18
  149. package/dist/components/MazTabs.js +1 -4
  150. package/dist/components/MazTabsBar.js +1 -138
  151. package/dist/components/MazTabsContent.js +1 -4
  152. package/dist/components/MazTabsContentItem.js +1 -37
  153. package/dist/components/MazTextarea.js +1 -147
  154. package/dist/components/MazUiProvider.js +1 -4
  155. package/dist/components/index.js +1 -127
  156. package/dist/composables/index.js +1 -44
  157. package/dist/composables/useAos.js +1 -7
  158. package/dist/composables/useBreakpoints.js +1 -34
  159. package/dist/composables/useDialog.js +1 -7
  160. package/dist/composables/useDisplayNames.js +1 -111
  161. package/dist/composables/useDropzone.js +1 -66
  162. package/dist/composables/useFormField.js +1 -101
  163. package/dist/composables/useFormValidator.js +1 -163
  164. package/dist/composables/useFreezeValue.js +1 -8
  165. package/dist/composables/useIdleTimeout.js +1 -10
  166. package/dist/composables/useInjectStrict.js +1 -10
  167. package/dist/composables/useInstanceUniqId.js +1 -12
  168. package/dist/composables/useMountComponent.js +1 -16
  169. package/dist/composables/useMutationObserver.js +1 -37
  170. package/dist/composables/useReadingTime.js +1 -33
  171. package/dist/composables/useStringMatching.js +1 -42
  172. package/dist/composables/useSwipe.js +1 -26
  173. package/dist/composables/useTimer.js +1 -36
  174. package/dist/composables/useToast.js +1 -14
  175. package/dist/composables/useUserVisibility.js +1 -10
  176. package/dist/composables/useWait.js +1 -7
  177. package/dist/composables/useWindowSize.js +1 -21
  178. package/dist/directives/index.js +1 -19
  179. package/dist/directives/vClickOutside.js +1 -104
  180. package/dist/directives/vFullscreenImg.js +1 -10
  181. package/dist/directives/vLazyImg.js +1 -23
  182. package/dist/directives/vTooltip.js +1 -161
  183. package/dist/directives/vZoomImg.js +1 -286
  184. package/dist/index.js +1 -1
  185. package/dist/plugins/aos.js +1 -89
  186. package/dist/plugins/dialog.js +1 -61
  187. package/dist/plugins/index.js +1 -17
  188. package/dist/plugins/maz-ui.js +1 -11
  189. package/dist/plugins/toast.js +1 -261
  190. package/dist/plugins/wait.js +1 -43
  191. package/dist/resolvers/MazComponentsResolver.js +1 -18
  192. package/dist/resolvers/MazDirectivesResolver.js +1 -14
  193. package/dist/resolvers/MazModulesResolver.js +1 -76
  194. package/dist/resolvers/index.js +1 -8
  195. package/dist/tailwindcss/index.js +1 -20
  196. package/dist/tailwindcss/tailwind.config.js +1 -35
  197. package/dist/tailwindcss/utils/colors.js +1 -25
  198. package/dist/tailwindcss/variables/breakpoints.js +1 -29
  199. package/dist/tailwindcss/variables/colors.js +1 -33
  200. package/dist/tailwindcss/variables/design-tokens.js +1 -42
  201. package/dist/tailwindcss/variables/utilities.js +1 -20
  202. package/dist/tailwindcss/variables/z-indexes.js +1 -17
  203. package/package.json +12 -13
  204. package/dist/chunks/MazChart.vue_vue_type_script_setup_true_lang.DpG9UYdm.js +0 -50
  205. package/dist/chunks/MazDialogConfirm.vue_vue_type_script_setup_true_lang.BB2rYkwY.js +0 -215
  206. package/dist/chunks/MazInputPrice.vue_vue_type_script_setup_true_lang.DcNkyw1C.js +0 -77
  207. package/dist/chunks/MazSwitch.vue_vue_type_style_index_0_lang.lYfYsI0R.js +0 -84
  208. package/dist/chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js +0 -517
  209. package/dist/chunks/MazTabs.vue_vue_type_script_setup_true_lang.CiIFxs7J.js +0 -28
  210. package/dist/chunks/MazTabsContent.vue_vue_type_script_setup_true_lang.MO7zA8LZ.js +0 -26
  211. package/dist/chunks/MazUiProvider.vue_vue_type_script_setup_true_lang.DtnM1DOn.js +0 -34
  212. package/dist/chunks/_plugin-vue_export-helper.B--vMWp3.js +0 -9
  213. package/dist/chunks/dom-events.DTx6Kblx.js +0 -368
  214. package/dist/chunks/fullscreen-img.directive.BJieSSIt.js +0 -321
  215. package/dist/chunks/lazy-img.directive.GRfYbidn.js +0 -174
  216. package/dist/chunks/resolveLinkComponent.CKR2McYy.js +0 -8
  217. package/dist/chunks/types.D0Bp_UhS.js +0 -6
  218. package/dist/chunks/useMazInputPhoneNumber.Os-2y9bz.js +0 -157
  219. package/dist/chunks/utils.D89Q5cCP.js +0 -207
  220. /package/dist/assets/{fullscreen-img.DFp1SMPU.css → vFullscreenImg.DFp1SMPU.css} +0 -0
@@ -1,466 +1 @@
1
- import { defineComponent, defineAsyncComponent, computed, useModel, useTemplateRef, onBeforeMount, ref, watch, openBlock, createBlock, unref, normalizeStyle, normalizeClass, withCtx, createVNode, renderSlot, withDirectives, mergeProps, createCommentVNode, vShow, mergeModels } from "vue";
2
- import { MazCalendar, MazClock } from "@maz-ui/icons/lazy";
3
- import { MazChevronDown } from "@maz-ui/icons/static";
4
- import { useTranslations } from "@maz-ui/translations/composables/useTranslations";
5
- import { formatDate } from "@maz-ui/utils/helpers/formatDate";
6
- import dayjs from "dayjs";
7
- import { h as getDefaultExportFromCjs, j as getDefaultsShortcuts, c as isRangeValue, k as getRangeFormattedDate, l as getFormattedDate, m as getRangeISODate, n as getISODate, o as isValueDisabledWeekly, p as isValueDisabledDate, q as checkValueWithMinMaxDates } from "../chunks/utils.D89Q5cCP.js";
8
- import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
9
- import MazPickerContainer from "./MazDatePicker/MazPickerContainer.js";
10
- import MazPopover from "./MazPopover.js";
11
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
12
- import '../assets/MazDatePicker.CQTJ2MSi.css';var customParseFormat$2 = { exports: {} }, customParseFormat$1 = customParseFormat$2.exports, hasRequiredCustomParseFormat;
13
- function requireCustomParseFormat() {
14
- return hasRequiredCustomParseFormat || (hasRequiredCustomParseFormat = 1, (function(module, exports$1) {
15
- (function(e, t) {
16
- module.exports = t();
17
- })(customParseFormat$1, (function() {
18
- 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|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e2) {
19
- return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
20
- }, f = function(e2) {
21
- return function(t2) {
22
- this[e2] = +t2;
23
- };
24
- }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
25
- (this.zone || (this.zone = {})).offset = (function(e3) {
26
- if (!e3 || e3 === "Z") return 0;
27
- var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
28
- return n2 === 0 ? 0 : t2[0] === "+" ? -n2 : n2;
29
- })(e2);
30
- }], u = function(e2) {
31
- var t2 = s[e2];
32
- return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
33
- }, d = function(e2, t2) {
34
- var n2, r2 = s.meridiem;
35
- if (r2) {
36
- for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t2)) > -1) {
37
- n2 = i2 > 12;
38
- break;
39
- }
40
- } else n2 = e2 === (t2 ? "pm" : "PM");
41
- return n2;
42
- }, c = { A: [o, function(e2) {
43
- this.afternoon = d(e2, !1);
44
- }], a: [o, function(e2) {
45
- this.afternoon = d(e2, !0);
46
- }], Q: [n, function(e2) {
47
- this.month = 3 * (e2 - 1) + 1;
48
- }], S: [n, function(e2) {
49
- this.milliseconds = 100 * +e2;
50
- }], SS: [r, function(e2) {
51
- this.milliseconds = 10 * +e2;
52
- }], SSS: [/\d{3}/, function(e2) {
53
- this.milliseconds = +e2;
54
- }], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [r, f("day")], Do: [o, function(e2) {
55
- var t2 = s.ordinal, n2 = e2.match(/\d+/);
56
- if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
57
- }], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
58
- var t2 = u("months"), n2 = (u("monthsShort") || t2.map((function(e3) {
59
- return e3.slice(0, 3);
60
- }))).indexOf(e2) + 1;
61
- if (n2 < 1) throw new Error();
62
- this.month = n2 % 12 || n2;
63
- }], MMMM: [o, function(e2) {
64
- var t2 = u("months").indexOf(e2) + 1;
65
- if (t2 < 1) throw new Error();
66
- this.month = t2 % 12 || t2;
67
- }], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
68
- this.year = a(e2);
69
- }], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
70
- function l(n2) {
71
- var r2, i2;
72
- r2 = n2, i2 = s && s.formats;
73
- for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t2, n3, r3) {
74
- var o3 = r3 && r3.toUpperCase();
75
- return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t3, n4) {
76
- return t3 || n4.slice(1);
77
- }));
78
- }))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
79
- var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
80
- o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
81
- }
82
- return function(e2) {
83
- for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
84
- var i3 = o2[n3];
85
- if (typeof i3 == "string") r3 += i3.length;
86
- else {
87
- var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
88
- f3.call(t2, u3), e2 = e2.replace(u3, "");
89
- }
90
- }
91
- return (function(e3) {
92
- var t3 = e3.afternoon;
93
- if (t3 !== void 0) {
94
- var n4 = e3.hours;
95
- t3 ? n4 < 12 && (e3.hours += 12) : n4 === 12 && (e3.hours = 0), delete e3.afternoon;
96
- }
97
- })(t2), t2;
98
- };
99
- }
100
- return function(e2, t2, n2) {
101
- n2.p.customParseFormat = !0, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
102
- var r2 = t2.prototype, i2 = r2.parse;
103
- r2.parse = function(e3) {
104
- var t3 = e3.date, r3 = e3.utc, o2 = e3.args;
105
- this.$u = r3;
106
- var a2 = o2[1];
107
- if (typeof a2 == "string") {
108
- var f2 = o2[2] === !0, h2 = o2[3] === !0, u2 = f2 || h2, d2 = o2[2];
109
- h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t4, n3, r4) {
110
- try {
111
- if (["x", "X"].indexOf(t4) > -1) return new Date((t4 === "X" ? 1e3 : 1) * e4);
112
- var i3 = l(t4)(e4), o3 = i3.year, s2 = i3.month, a3 = i3.day, f3 = i3.hours, h3 = i3.minutes, u3 = i3.seconds, d3 = i3.milliseconds, c3 = i3.zone, m2 = i3.week, M2 = /* @__PURE__ */ new Date(), Y = a3 || (o3 || s2 ? 1 : M2.getDate()), p = o3 || M2.getFullYear(), v = 0;
113
- o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
114
- var D, w = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
115
- return c3 ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c3.offset * 1e3)) : n3 ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m2 && (D = r4(D).week(m2).toDate()), D);
116
- } catch {
117
- return /* @__PURE__ */ new Date("");
118
- }
119
- })(t3, a2, r3, n2), this.init(), d2 && d2 !== !0 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
120
- } else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
121
- o2[1] = a2[m - 1];
122
- var M = n2.apply(this, o2);
123
- if (M.isValid()) {
124
- this.$d = M.$d, this.$L = M.$L, this.init();
125
- break;
126
- }
127
- m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
128
- }
129
- else i2.call(this, e3);
130
- };
131
- };
132
- }));
133
- })(customParseFormat$2)), customParseFormat$2.exports;
134
- }
135
- var customParseFormatExports = /* @__PURE__ */ requireCustomParseFormat();
136
- const customParseFormat = /* @__PURE__ */ getDefaultExportFromCjs(customParseFormatExports);
137
- var isBetween$2 = { exports: {} }, isBetween$1 = isBetween$2.exports, hasRequiredIsBetween;
138
- function requireIsBetween() {
139
- return hasRequiredIsBetween || (hasRequiredIsBetween = 1, (function(module, exports$1) {
140
- (function(e, i) {
141
- module.exports = i();
142
- })(isBetween$1, (function() {
143
- return function(e, i, t) {
144
- i.prototype.isBetween = function(e2, i2, s, f) {
145
- var n = t(e2), o = t(i2), r = (f = f || "()")[0] === "(", u = f[1] === ")";
146
- 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));
147
- };
148
- };
149
- }));
150
- })(isBetween$2)), isBetween$2.exports;
151
- }
152
- var isBetweenExports = /* @__PURE__ */ requireIsBetween();
153
- const isBetween = /* @__PURE__ */ getDefaultExportFromCjs(isBetweenExports), _sfc_main = /* @__PURE__ */ defineComponent({
154
- inheritAttrs: !1,
155
- __name: "MazDatePicker",
156
- props: /* @__PURE__ */ mergeModels({
157
- id: {},
158
- style: { type: [Boolean, null, String, Object, Array] },
159
- class: { type: [Boolean, null, String, Object, Array] },
160
- inputProps: {},
161
- modelValue: {},
162
- format: { default: "YYYY-MM-DD" },
163
- open: { type: Boolean, default: !1 },
164
- label: {},
165
- placeholder: {},
166
- inputDateFormat: { default: () => ({ dateStyle: "medium", timeStyle: "short" }) },
167
- inputDateTransformer: {},
168
- locale: {},
169
- hideHeader: { type: Boolean, default: !1 },
170
- disabled: { type: Boolean, default: !1 },
171
- firstDayOfWeek: { default: 0 },
172
- autoClose: { type: Boolean, default: !1 },
173
- customElementSelector: {},
174
- double: { type: Boolean, default: !1 },
175
- inline: { type: Boolean, default: !1 },
176
- color: { default: "primary" },
177
- pickerPosition: { default: "auto" },
178
- pickerPreferPosition: { default: "bottom-start" },
179
- pickerFallbackPosition: { default: "top-start" },
180
- time: { type: Boolean, default: !1 },
181
- onlyTime: { type: Boolean, default: !1 },
182
- minuteInterval: { default: 5 },
183
- useBrowserLocale: { type: Boolean, default: !0 },
184
- fetchLocal: { type: Boolean, default: !0 },
185
- shortcuts: { type: [Array, Boolean], default: !0 },
186
- shortcut: {},
187
- minDate: { default: void 0 },
188
- maxDate: { default: void 0 },
189
- minMaxAuto: { type: Boolean, default: !0 },
190
- disabledWeekly: { default: () => [] },
191
- disabledDates: { default: () => [] },
192
- disabledHours: { default: () => [] },
193
- block: { type: Boolean },
194
- range: { type: Boolean, default: !1 },
195
- transition: { default: "scale-fade" }
196
- }, {
197
- locale: { default: void 0 },
198
- localeModifiers: {},
199
- open: { default: !1 },
200
- openModifiers: {}
201
- }),
202
- emits: /* @__PURE__ */ mergeModels(["update:model-value", "close"], ["update:locale", "update:open"]),
203
- setup(__props, { emit: __emit }) {
204
- const props = __props, emits = __emit, { t, locale } = useTranslations();
205
- dayjs.extend(customParseFormat), dayjs.extend(isBetween);
206
- const MazInput = defineAsyncComponent(() => import("./MazInput.js")), instanceId = useInstanceUniqId({ componentName: "MazDatePicker", providedId: props.id });
207
- function isRangeModelValue(value) {
208
- return typeof value == "object" && value !== null;
209
- }
210
- const currentValue = computed({
211
- get: () => isRangeModelValue(props.modelValue) || props.range ? {
212
- start: isRangeModelValue(props.modelValue) && props.modelValue.start ? dayjs(props.modelValue.start, props.format).format() : void 0,
213
- end: isRangeModelValue(props.modelValue) && props.modelValue.end ? dayjs(props.modelValue.end, props.format).format() : void 0
214
- } : typeof props.modelValue == "string" && props.modelValue ? dayjs(props.modelValue, props.format).format() : void 0,
215
- set: (value) => {
216
- if (props.disabled)
217
- return;
218
- const emittedValue = props.range && !isRangeValue(value) ? {
219
- start: value,
220
- end: void 0
221
- } : value;
222
- emitValue(emittedValue);
223
- const isRangeMode2 = isRangeModelValue(value) || props.range;
224
- props.autoClose && (!isRangeMode2 || isRangeMode2 && isRangeModelValue(value) && value.end) && closeCalendar();
225
- }
226
- }), hasTime = computed(() => props.time || props.onlyTime), hasDouble = computed(() => props.double && !props.onlyTime), hasDate = computed(() => !props.onlyTime), isRangeMode = computed(() => isRangeModelValue(currentValue.value) || props.range), internalShortcuts = computed(() => !isRangeMode.value || props.shortcuts === !1 ? !1 : props.shortcuts && Array.isArray(props.shortcuts) ? props.shortcuts : getDefaultsShortcuts({
227
- lastSevenDays: t("datePicker.shortcuts.lastSevenDays"),
228
- lastThirtyDays: t("datePicker.shortcuts.lastThirtyDays"),
229
- thisWeek: t("datePicker.shortcuts.thisWeek"),
230
- lastWeek: t("datePicker.shortcuts.lastWeek"),
231
- thisMonth: t("datePicker.shortcuts.thisMonth"),
232
- thisYear: t("datePicker.shortcuts.thisYear"),
233
- lastYear: t("datePicker.shortcuts.lastYear")
234
- })), localeModel = useModel(__props, "locale");
235
- localeModel.value = props.locale ?? locale.value;
236
- const containerUniqueId = computed(() => `MazDatePickerContainer-${instanceId.value}`), popoverRef = useTemplateRef("popover");
237
- onBeforeMount(() => {
238
- isRangeMode.value && hasTime.value && console.error("[maz-ui](MazDatePicker) You can't use time picker with range picker"), hasTime.value && !(props.format.includes("h") || props.format.includes("H")) && console.error(
239
- '[maz-ui](MazDatePicker) When you use the time picker, you must provided a format with time - Ex: "YYYY-MM-DD HH:mm"'
240
- ), props.format.includes("h") && !(props.format.includes("a") || props.format.includes("A")) && console.error(
241
- '[maz-ui](MazDatePicker) 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"'
242
- );
243
- });
244
- function getCalendarDate(value) {
245
- const baseDate = (isRangeModelValue(value) ? value.start : value) ?? dayjs().format();
246
- return props.minDate && dayjs(baseDate).isBefore(props.minDate) ? props.minDate : props.maxDate && dayjs(baseDate).isAfter(props.maxDate) ? props.minDate ?? props.maxDate : baseDate;
247
- }
248
- const calendarDate = ref(getCalendarDate(currentValue.value)), isHour12 = computed(
249
- () => props.format.includes("a") || props.format.includes("A") || props.format.includes("h")
250
- ), formatterOptions = computed(() => ({
251
- ...props.inputDateFormat,
252
- timeStyle: hasTime.value ? props.inputDateFormat.timeStyle ?? "short" : void 0,
253
- hour12: hasTime.value ? props.inputDateFormat.hour12 ?? isHour12.value : void 0
254
- })), inputValue = computed(() => {
255
- if (!currentValue.value)
256
- return;
257
- let formattedDate;
258
- return props.onlyTime && typeof currentValue.value == "string" && currentValue.value ? formattedDate = currentValue.value ? formatDate(dayjs(currentValue.value).format(), localeModel.value, {
259
- timeStyle: formatterOptions.value.timeStyle,
260
- hour12: formatterOptions.value.hour12
261
- }) : void 0 : isRangeMode.value && isRangeValue(currentValue.value) ? formattedDate = getRangeFormattedDate({
262
- value: currentValue.value,
263
- locale: localeModel.value,
264
- options: formatterOptions.value
265
- }) : typeof currentValue.value == "string" && currentValue.value && (formattedDate = getFormattedDate({
266
- value: dayjs(currentValue.value).format(),
267
- locale: localeModel.value,
268
- options: formatterOptions.value
269
- })), props.inputDateTransformer && formattedDate ? props.inputDateTransformer({ formattedDate, value: props.modelValue, locale: localeModel.value }) : formattedDate;
270
- }), hasPickerOpen = useModel(__props, "open");
271
- function closeCalendar() {
272
- popoverRef.value?.close(), emits("close");
273
- }
274
- function checkMinMaxValues(value) {
275
- if (!(!props.minDate && !props.maxDate)) {
276
- if (!isRangeMode.value && (typeof value == "string" && value || !value)) {
277
- const { newValue, newCurrentDate } = checkValueWithMinMaxDates({
278
- value,
279
- minDate: props.minDate,
280
- maxDate: props.maxDate,
281
- format: props.format,
282
- minMaxAuto: props.minMaxAuto
283
- });
284
- newValue && emitValue(newValue), newCurrentDate && setCalendarDate(newCurrentDate);
285
- } else if (isRangeMode.value && isRangeValue(value)) {
286
- let newStartValue = value.start, newEndValue = value.end;
287
- if (value.start) {
288
- const { newValue, newCurrentDate } = checkValueWithMinMaxDates({
289
- value: value.start,
290
- minDate: props.minDate,
291
- maxDate: props.maxDate,
292
- format: props.format,
293
- minMaxAuto: props.minMaxAuto
294
- });
295
- newValue && (newStartValue = newValue), newCurrentDate && setCalendarDate(newCurrentDate);
296
- }
297
- if (value.end) {
298
- const { newValue } = checkValueWithMinMaxDates({
299
- value: value.end,
300
- minDate: props.minDate,
301
- maxDate: props.maxDate,
302
- format: props.format,
303
- minMaxAuto: props.minMaxAuto
304
- });
305
- newValue && (newEndValue = newValue);
306
- }
307
- emitValue({
308
- start: newStartValue,
309
- end: newEndValue
310
- });
311
- }
312
- }
313
- }
314
- function setCalendarDate(value) {
315
- value && !dayjs(calendarDate.value).isSame(value, "month") && (calendarDate.value = value);
316
- }
317
- function emitValue(value) {
318
- if (isRangeMode.value && (isRangeModelValue(value) || value === void 0)) {
319
- const newValue = getRangeISODate(value, props.format) ?? { start: void 0, end: void 0 };
320
- emits("update:model-value", newValue), newValue.start && setCalendarDate(newValue.start);
321
- } else (typeof value == "string" && value || value === void 0) && emits("update:model-value", getISODate(value, props.format));
322
- }
323
- return watch(
324
- () => [currentValue.value, props.minDate, props.maxDate],
325
- (values, oldValues) => {
326
- const value = values[0], oldValue = oldValues?.[0];
327
- isRangeModelValue(value) && (value.start || value.end) ? (!oldValue || isRangeModelValue(oldValue) && (oldValue.start !== value.start || oldValue.end !== value.end)) && (emitValue(value), checkMinMaxValues(value)) : typeof value == "string" && value && value !== oldValue && (emitValue(value), checkMinMaxValues(value));
328
- },
329
- { immediate: !0 }
330
- ), watch(
331
- () => [currentValue.value, props.disabledWeekly, props.disabledDates],
332
- (values) => {
333
- const value = values[0], disabledWeekly = values[1], disabledDates = values[2];
334
- isRangeModelValue(value) && (value.start || value.end) ? ((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 })) && (currentValue.value = { start: void 0, end: void 0 }), (value.end && isValueDisabledWeekly({ value: value.end, disabledWeekly }) || value.end && isValueDisabledDate({ value: value.end, disabledDates })) && (currentValue.value = { start: value.start, end: void 0 })) : typeof value == "string" && value && (isValueDisabledWeekly({ value, disabledWeekly }) || isValueDisabledDate({ value, disabledDates })) && (currentValue.value = void 0);
335
- },
336
- { immediate: !0 }
337
- ), (_ctx, _cache) => __props.inline ? (openBlock(), createBlock(MazPickerContainer, {
338
- key: 1,
339
- id: containerUniqueId.value,
340
- modelValue: currentValue.value,
341
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => currentValue.value = $event),
342
- "calendar-date": calendarDate.value,
343
- "onUpdate:calendarDate": _cache[4] || (_cache[4] = ($event) => calendarDate.value = $event),
344
- color: __props.color,
345
- locale: localeModel.value,
346
- "has-date": hasDate.value,
347
- double: hasDouble.value,
348
- "has-time": hasTime.value,
349
- "formatter-options": formatterOptions.value,
350
- "hide-header": __props.hideHeader,
351
- "min-date": __props.minDate,
352
- format: __props.format,
353
- "is-hour12": isHour12.value,
354
- "max-date": __props.maxDate,
355
- "disabled-weekly": __props.disabledWeekly,
356
- inline: __props.inline,
357
- "first-day-of-week": __props.firstDayOfWeek,
358
- shortcuts: internalShortcuts.value,
359
- shortcut: __props.shortcut,
360
- disabled: __props.disabled,
361
- "disabled-hours": __props.disabledHours,
362
- "disabled-dates": __props.disabledDates,
363
- "minute-interval": __props.minuteInterval,
364
- range: isRangeMode.value,
365
- onClose: closeCalendar
366
- }, null, 8, ["id", "modelValue", "calendar-date", "color", "locale", "has-date", "double", "has-time", "formatter-options", "hide-header", "min-date", "format", "is-hour12", "max-date", "disabled-weekly", "inline", "first-day-of-week", "shortcuts", "shortcut", "disabled", "disabled-hours", "disabled-dates", "minute-interval", "range"])) : (openBlock(), createBlock(MazPopover, {
367
- key: 0,
368
- id: `${unref(instanceId)}-popover`,
369
- ref: "popover",
370
- modelValue: hasPickerOpen.value,
371
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => hasPickerOpen.value = $event),
372
- class: normalizeClass(["m-date-picker m-reset-css", [
373
- `m-date-picker--${__props.color}`,
374
- {
375
- "--is-open": hasPickerOpen.value,
376
- "--is-disabled": __props.disabled
377
- },
378
- props.class
379
- ]]),
380
- style: normalizeStyle(__props.style),
381
- offset: 0,
382
- trigger: "click",
383
- transition: __props.transition,
384
- disabled: __props.disabled,
385
- block: __props.block,
386
- position: __props.pickerPosition,
387
- "prefer-position": __props.pickerPreferPosition,
388
- "fallback-position": __props.pickerFallbackPosition,
389
- "position-reference": `#${unref(instanceId)}-popover .m-input-wrapper`
390
- }, {
391
- trigger: withCtx(({ isOpen, close, open: openPicker, toggle: togglePicker }) => [
392
- renderSlot(_ctx.$slots, "trigger", {
393
- isOpen,
394
- close,
395
- open: openPicker,
396
- toggle: togglePicker
397
- }, () => [
398
- withDirectives(createVNode(unref(MazInput), mergeProps({
399
- id: unref(instanceId),
400
- "model-value": inputValue.value,
401
- readonly: ""
402
- }, { ...__props.inputProps, ..._ctx.$attrs }, {
403
- block: "",
404
- autocomplete: "off",
405
- class: "m-date-picker__input",
406
- label: __props.label,
407
- disabled: __props.disabled,
408
- placeholder: __props.placeholder,
409
- color: __props.color
410
- }), {
411
- "left-icon": withCtx(() => [
412
- hasDate.value ? (openBlock(), createBlock(unref(MazCalendar), {
413
- key: 0,
414
- class: "maz-text-xl"
415
- })) : hasTime.value ? (openBlock(), createBlock(unref(MazClock), {
416
- key: 1,
417
- class: "maz-text-xl"
418
- })) : createCommentVNode("", !0)
419
- ]),
420
- "right-icon": withCtx(() => [
421
- createVNode(unref(MazChevronDown), { class: "m-date-picker__button__chevron maz-text-lg" })
422
- ]),
423
- _: 1
424
- }, 16, ["id", "model-value", "label", "disabled", "placeholder", "color"]), [
425
- [vShow, !__props.customElementSelector && !__props.inline]
426
- ])
427
- ], !0)
428
- ]),
429
- default: withCtx(() => [
430
- createVNode(MazPickerContainer, {
431
- id: containerUniqueId.value,
432
- modelValue: currentValue.value,
433
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => currentValue.value = $event),
434
- "calendar-date": calendarDate.value,
435
- "onUpdate:calendarDate": _cache[1] || (_cache[1] = ($event) => calendarDate.value = $event),
436
- color: __props.color,
437
- locale: localeModel.value,
438
- "has-date": hasDate.value,
439
- double: hasDouble.value,
440
- "has-time": hasTime.value,
441
- "formatter-options": formatterOptions.value,
442
- "hide-header": __props.hideHeader,
443
- "min-date": __props.minDate,
444
- format: __props.format,
445
- "is-hour12": isHour12.value,
446
- "max-date": __props.maxDate,
447
- "disabled-weekly": __props.disabledWeekly,
448
- inline: __props.inline,
449
- "first-day-of-week": __props.firstDayOfWeek,
450
- shortcuts: internalShortcuts.value,
451
- shortcut: __props.shortcut,
452
- disabled: __props.disabled,
453
- "disabled-hours": __props.disabledHours,
454
- "disabled-dates": __props.disabledDates,
455
- "minute-interval": __props.minuteInterval,
456
- range: isRangeMode.value,
457
- onClose: closeCalendar
458
- }, null, 8, ["id", "modelValue", "calendar-date", "color", "locale", "has-date", "double", "has-time", "formatter-options", "hide-header", "min-date", "format", "is-hour12", "max-date", "disabled-weekly", "inline", "first-day-of-week", "shortcuts", "shortcut", "disabled", "disabled-hours", "disabled-dates", "minute-interval", "range"])
459
- ]),
460
- _: 3
461
- }, 8, ["id", "modelValue", "style", "class", "transition", "disabled", "block", "position", "prefer-position", "fallback-position", "position-reference"]));
462
- }
463
- }), MazDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-bd9b2992"]]);
464
- export {
465
- MazDatePicker as default
466
- };
1
+ import"../chunks/MazPopover.Co8BEopX.js";import{t as MazDatePicker_default}from"../chunks/MazDatePicker.KUP34cbV.js";import"../chunks/MazPickerContainer.BZ74M74V.js";export{MazDatePicker_default as default};
@@ -293,9 +293,7 @@ declare function __VLS_template(): {
293
293
  readonly "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
294
294
  readonly "onAfter-close-animation"?: (() => any) | undefined;
295
295
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
296
- $attrs: {
297
- [x: string]: unknown;
298
- };
296
+ $attrs: import('vue').Attrs;
299
297
  $refs: {
300
298
  [x: string]: unknown;
301
299
  } & {
@@ -468,9 +466,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
468
466
  readonly "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
469
467
  readonly "onAfter-close-animation"?: (() => any) | undefined;
470
468
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
471
- $attrs: {
472
- [x: string]: unknown;
473
- };
469
+ $attrs: import('vue').Attrs;
474
470
  $refs: {
475
471
  [x: string]: unknown;
476
472
  } & {
@@ -1,115 +1 @@
1
- import { defineComponent, createPropsRestProxy, defineAsyncComponent, useAttrs, ref, computed, useSlots, watch, nextTick, openBlock, createBlock, mergeProps, withCtx, createElementVNode, renderSlot, normalizeClass, createElementBlock, createTextVNode, toDisplayString, createCommentVNode, unref } from "vue";
2
- import { MazXMark } from "@maz-ui/icons/static";
3
- import MazBackdrop from "./MazBackdrop.js";
4
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
5
- import '../assets/MazDialog.BjYlRnV_.css';const _hoisted_1 = {
6
- key: 0,
7
- id: "dialogTitle",
8
- class: "m-dialog-title"
9
- }, _hoisted_2 = {
10
- key: 0,
11
- class: "m-dialog-footer"
12
- }, _sfc_main = /* @__PURE__ */ defineComponent({
13
- name: "MazDialog",
14
- inheritAttrs: !1,
15
- __name: "MazDialog",
16
- props: {
17
- modelValue: { type: Boolean },
18
- title: {},
19
- hideCloseButton: { type: Boolean },
20
- maxWidth: { default: "100%" },
21
- minWidth: { default: "32rem" },
22
- scrollable: { type: Boolean },
23
- persistent: { type: Boolean },
24
- teleportSelector: {},
25
- beforeClose: { type: Function },
26
- closeOnEscape: { type: Boolean, default: !0 },
27
- transitionName: {},
28
- backdropClass: { type: [Boolean, null, String, Object, Array] },
29
- backdropContentClass: { type: [Boolean, null, String, Object, Array] },
30
- contentPadding: { type: Boolean },
31
- justify: {},
32
- align: {},
33
- variant: {},
34
- ariaLabelledby: {},
35
- ariaDescribedby: {}
36
- },
37
- emits: ["open", "close", "update:model-value"],
38
- setup(__props, { expose: __expose }) {
39
- const backdropProps = createPropsRestProxy(__props, ["modelValue", "maxWidth", "minWidth", "scrollable", "closeOnEscape"]), MazBtn = defineAsyncComponent(() => import("./MazBtn.js")), attrs = useAttrs(), backdrop = ref();
40
- __expose({
41
- /**
42
- * Close the dialog
43
- * @description This is used to close the dialog
44
- */
45
- close: () => backdrop.value?.close?.()
46
- });
47
- const wrapperAttrs = computed(() => ({
48
- class: attrs.class,
49
- style: attrs.style
50
- })), dialogContent = ref(), slots = useSlots(), hasFooter = computed(() => !!slots.footer);
51
- return __props.scrollable && watch(() => __props.modelValue, async (newVal) => {
52
- await nextTick(), newVal && dialogContent.value && setTimeout(() => {
53
- dialogContent.value?.scrollTo({ top: 0, behavior: "instant" });
54
- }, 0);
55
- }), (_ctx, _cache) => (openBlock(), createBlock(MazBackdrop, mergeProps(backdropProps, {
56
- ref_key: "backdrop",
57
- ref: backdrop,
58
- "model-value": __props.modelValue,
59
- "transition-name": "modal-anim",
60
- "aria-labelledby": "dialogTitle",
61
- "aria-describedby": "dialogDesc",
62
- "close-on-escape": __props.closeOnEscape,
63
- "content-padding": "",
64
- persistent: __props.persistent,
65
- justify: "center",
66
- variant: "dialog",
67
- onClose: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close", $event)),
68
- onOpen: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("open", $event)),
69
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:model-value", $event))
70
- }), {
71
- default: withCtx(({ close }) => [
72
- createElementVNode("div", mergeProps({
73
- class: ["m-dialog", { "--scrollable": __props.scrollable }],
74
- role: "dialog",
75
- "aria-modal": "true",
76
- style: [{ "--max-width": __props.maxWidth, "--min-width": __props.minWidth }]
77
- }, wrapperAttrs.value), [
78
- renderSlot(_ctx.$slots, "header", { close }, () => [
79
- createElementVNode("div", {
80
- class: normalizeClass(["m-dialog-header", { "--has-title": _ctx.$slots.title || __props.title }])
81
- }, [
82
- _ctx.$slots.title || __props.title ? (openBlock(), createElementBlock("h2", _hoisted_1, [
83
- renderSlot(_ctx.$slots, "title", {}, () => [
84
- createTextVNode(toDisplayString(__props.title), 1)
85
- ], !0)
86
- ])) : createCommentVNode("", !0),
87
- !__props.hideCloseButton && !__props.persistent ? (openBlock(), createBlock(unref(MazBtn), {
88
- key: 1,
89
- color: "transparent",
90
- size: "sm",
91
- icon: unref(MazXMark),
92
- onClick: close
93
- }, null, 8, ["icon", "onClick"])) : createCommentVNode("", !0)
94
- ], 2)
95
- ], !0),
96
- createElementVNode("div", {
97
- id: "dialogDesc",
98
- ref_key: "dialogContent",
99
- ref: dialogContent,
100
- class: normalizeClass(["m-dialog-content", { "--bottom-padding": !hasFooter.value }])
101
- }, [
102
- renderSlot(_ctx.$slots, "default", { close }, void 0, !0)
103
- ], 2),
104
- hasFooter.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
105
- renderSlot(_ctx.$slots, "footer", { close }, void 0, !0)
106
- ])) : createCommentVNode("", !0)
107
- ], 16)
108
- ]),
109
- _: 3
110
- }, 16, ["model-value", "close-on-escape", "persistent"]));
111
- }
112
- }), MazDialog = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-b83764d2"]]);
113
- export {
114
- MazDialog as default
115
- };
1
+ import"../chunks/MazBackdrop.Cjbwi8-V.js";import{t as MazDialog_default}from"../chunks/MazDialog.CtKF3Xzo.js";export{MazDialog_default as default};
@@ -57,9 +57,7 @@ declare function __VLS_template(): {
57
57
  readonly "onUpdate:model-value"?: ((value: boolean) => any) | undefined;
58
58
  readonly "onBefore-close"?: ((value?: void | undefined) => any) | undefined;
59
59
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
60
- $attrs: {
61
- [x: string]: unknown;
62
- };
60
+ $attrs: import('vue').Attrs;
63
61
  $refs: {
64
62
  [x: string]: unknown;
65
63
  };
@@ -168,9 +166,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {
168
166
  readonly "onUpdate:model-value"?: ((value: boolean) => any) | undefined;
169
167
  readonly "onBefore-close"?: ((value?: void | undefined) => any) | undefined;
170
168
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
171
- $attrs: {
172
- [x: string]: unknown;
173
- };
169
+ $attrs: import('vue').Attrs;
174
170
  $refs: {
175
171
  [x: string]: unknown;
176
172
  };
@@ -1,6 +1 @@
1
- import { _ as _sfc_main } from "../chunks/MazDialogConfirm.vue_vue_type_script_setup_true_lang.BB2rYkwY.js";
2
- import { u } from "../chunks/MazDialogConfirm.vue_vue_type_script_setup_true_lang.BB2rYkwY.js";
3
- export {
4
- _sfc_main as default,
5
- u as useMazDialogConfirm
6
- };
1
+ import"../chunks/MazBackdrop.Cjbwi8-V.js";import"../chunks/MazDialog.CtKF3Xzo.js";import{n as useMazDialogConfirm,t as MazDialogConfirm_default}from"../chunks/MazDialogConfirm.CAAHeBPE.js";export{MazDialogConfirm_default as default,useMazDialogConfirm};
@@ -94,9 +94,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Ma
94
94
  readonly onOpen?: ((value?: void | undefined) => any) | undefined;
95
95
  readonly "onUpdate:model-value"?: ((value: boolean) => any) | undefined;
96
96
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
97
- $attrs: {
98
- [x: string]: unknown;
99
- };
97
+ $attrs: import('vue').Attrs;
100
98
  $refs: {
101
99
  [x: string]: unknown;
102
100
  } & {
@@ -123,9 +121,7 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<Ma
123
121
  readonly "onUpdate:model-value"?: ((value: boolean) => any) | undefined;
124
122
  readonly "onBefore-close"?: ((value?: void | undefined) => any) | undefined;
125
123
  } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
126
- $attrs: {
127
- [x: string]: unknown;
128
- };
124
+ $attrs: import('vue').Attrs;
129
125
  $refs: {
130
126
  [x: string]: unknown;
131
127
  };