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,256 +0,0 @@
1
- import "../assets/MazDrawer.css";
2
- import { defineComponent, ref, onMounted, watch, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, createElementBlock, normalizeClass, createElementVNode, withModifiers, mergeProps, renderSlot, createCommentVNode, defineAsyncComponent, createTextVNode, toDisplayString, unref } from "vue";
3
- const MODAL_OPENED_CLASS = "--backdrop-present";
4
- const addClassToDocument = () => {
5
- document.documentElement.classList.add(MODAL_OPENED_CLASS);
6
- };
7
- const removeClassFromDocument = async () => {
8
- const backdropPresents = document.querySelector(".m-backdrop.--present");
9
- if (!backdropPresents) {
10
- document.documentElement.classList.remove(MODAL_OPENED_CLASS);
11
- }
12
- };
13
- const _sfc_main$1 = defineComponent({
14
- inheritAttrs: false,
15
- props: {
16
- modelValue: { type: Boolean, default: false },
17
- teleportSelector: { type: String, default: "body" },
18
- beforeClose: {
19
- // eslint-disable-next-line @typescript-eslint/ban-types
20
- type: Function,
21
- default: void 0
22
- },
23
- persistent: { type: Boolean, default: false },
24
- noCloseOnEscKey: { type: Boolean, default: false },
25
- transitionName: { type: String, default: "backdrop-anim" },
26
- backdropClass: { type: [Array, String, Object], default: void 0 },
27
- backdropContentClass: {
28
- type: [Array, String, Object],
29
- default: void 0
30
- }
31
- },
32
- emits: ["open", "before-close", "close", "update:model-value"],
33
- setup(props, { emit: emits }) {
34
- const present = ref(props.modelValue);
35
- const close = () => {
36
- toggleModal(false);
37
- };
38
- const toggleModal = async (value) => {
39
- var _a;
40
- if (!value) {
41
- emits("before-close");
42
- await ((_a = props.beforeClose) == null ? void 0 : _a.call(props));
43
- }
44
- present.value = value;
45
- };
46
- const onBackdropAnimationEnter = () => {
47
- emits("open");
48
- };
49
- const onBackdropAnimationLeave = () => {
50
- emits("update:model-value", false);
51
- emits("close");
52
- removeClassAndEventToDocument();
53
- };
54
- const onBackdropClicked = () => {
55
- if (!props.persistent) {
56
- close();
57
- }
58
- };
59
- const onKeyPress = (event) => {
60
- if (!props.noCloseOnEscKey && event.key === "Escape" && !props.persistent) {
61
- close();
62
- }
63
- };
64
- const addClassAndEventToDocument = () => {
65
- addClassToDocument();
66
- document.addEventListener("keyup", onKeyPress, false);
67
- };
68
- const removeClassAndEventToDocument = () => {
69
- document.removeEventListener("keyup", onKeyPress);
70
- removeClassFromDocument();
71
- };
72
- onMounted(() => {
73
- if (props.modelValue) {
74
- addClassAndEventToDocument();
75
- } else {
76
- removeClassAndEventToDocument();
77
- }
78
- });
79
- watch(
80
- () => props.modelValue,
81
- (value) => {
82
- present.value = value;
83
- if (value) {
84
- addClassAndEventToDocument();
85
- } else {
86
- removeClassAndEventToDocument();
87
- }
88
- }
89
- );
90
- return {
91
- onBackdropAnimationEnter,
92
- onBackdropAnimationLeave,
93
- onBackdropClicked,
94
- close,
95
- present,
96
- toggleModal,
97
- onKeyPress
98
- };
99
- }
100
- });
101
- const MazBackdrop_vue_vue_type_style_index_0_lang = "";
102
- const MazBackdrop_vue_vue_type_style_index_1_lang = "";
103
- const _export_sfc = (sfc, props) => {
104
- const target = sfc.__vccOpts || sfc;
105
- for (const [key, val] of props) {
106
- target[key] = val;
107
- }
108
- return target;
109
- };
110
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
111
- return openBlock(), createBlock(Teleport, { to: _ctx.teleportSelector }, [
112
- createVNode(Transition, {
113
- appear: "",
114
- name: _ctx.transitionName,
115
- onAfterEnter: _ctx.onBackdropAnimationEnter,
116
- onAfterLeave: _ctx.onBackdropAnimationLeave
117
- }, {
118
- default: withCtx(() => [
119
- _ctx.present ? (openBlock(), createElementBlock(
120
- "div",
121
- {
122
- key: 0,
123
- class: normalizeClass(["m-backdrop --present", [_ctx.backdropClass]]),
124
- tabindex: "-1",
125
- role: "dialog"
126
- },
127
- [
128
- createElementVNode(
129
- "button",
130
- {
131
- class: normalizeClass(["m-backdrop-overlay", { "--disabled": _ctx.persistent }]),
132
- tabindex: "-1",
133
- onClick: _cache[0] || (_cache[0] = withModifiers((...args) => _ctx.onBackdropClicked && _ctx.onBackdropClicked(...args), ["self"]))
134
- },
135
- null,
136
- 2
137
- /* CLASS */
138
- ),
139
- createElementVNode(
140
- "div",
141
- mergeProps({
142
- class: ["m-backdrop-content", _ctx.backdropContentClass]
143
- }, _ctx.$attrs, {
144
- role: "document",
145
- tabindex: "0"
146
- }),
147
- [
148
- renderSlot(_ctx.$slots, "default", { close: _ctx.close })
149
- ],
150
- 16
151
- /* FULL_PROPS */
152
- )
153
- ],
154
- 2
155
- /* CLASS */
156
- )) : createCommentVNode("v-if", true)
157
- ]),
158
- _: 3
159
- /* FORWARDED */
160
- }, 8, ["name", "onAfterEnter", "onAfterLeave"])
161
- ], 8, ["to"]);
162
- }
163
- const MazBackdrop = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
164
- const _hoisted_1 = { class: "m-drawer-header__title" };
165
- const _hoisted_2 = {
166
- key: 0,
167
- class: "m-drawer-header__close"
168
- };
169
- const _hoisted_3 = { class: "m-drawer-body" };
170
- const _sfc_main = /* @__PURE__ */ defineComponent({
171
- __name: "MazDrawer",
172
- props: {
173
- noClose: { type: Boolean, default: false },
174
- title: { type: String, default: void 0 },
175
- variant: {
176
- type: String,
177
- default: "right",
178
- validator: (value) => {
179
- return ["right", "top", "left", "bottom"].includes(value);
180
- }
181
- },
182
- backdropClass: { type: String, default: void 0 },
183
- size: { type: String, default: "30rem" }
184
- },
185
- emits: ["open", "close", "update:model-value"],
186
- setup(__props) {
187
- const MazBtn = defineAsyncComponent(() => import("./MazBtn-84e12b6a.mjs"));
188
- const XIcon = defineAsyncComponent(() => import("./x-mark-c6ff45dd.mjs"));
189
- return (_ctx, _cache) => {
190
- return openBlock(), createBlock(MazBackdrop, mergeProps(_ctx.$attrs, {
191
- "backdrop-class": ["m-drawer", `--${__props.variant}`, __props.backdropClass],
192
- style: {
193
- "--maz-drawer-size": __props.size
194
- },
195
- onClose: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close", $event)),
196
- onOpen: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("open", $event)),
197
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:model-value", $event))
198
- }), {
199
- default: withCtx(({ close }) => [
200
- createElementVNode(
201
- "div",
202
- {
203
- class: normalizeClass(["m-drawer-content-wrap", [`--${__props.variant}`]])
204
- },
205
- [
206
- createElementVNode(
207
- "header",
208
- {
209
- class: normalizeClass(["m-drawer-header", [_ctx.$slots["title"] || __props.title ? "--between" : "--end"]])
210
- },
211
- [
212
- createElementVNode("h4", _hoisted_1, [
213
- renderSlot(_ctx.$slots, "title", { close }, () => [
214
- createTextVNode(
215
- toDisplayString(__props.title),
216
- 1
217
- /* TEXT */
218
- )
219
- ])
220
- ]),
221
- !__props.noClose ? (openBlock(), createElementBlock("div", _hoisted_2, [
222
- createVNode(unref(MazBtn), {
223
- size: "sm",
224
- color: "transparent",
225
- onClick: close
226
- }, {
227
- default: withCtx(() => [
228
- createVNode(unref(XIcon), { class: "icon maz-text-lg" })
229
- ]),
230
- _: 2
231
- /* DYNAMIC */
232
- }, 1032, ["onClick"])
233
- ])) : createCommentVNode("v-if", true)
234
- ],
235
- 2
236
- /* CLASS */
237
- ),
238
- createElementVNode("div", _hoisted_3, [
239
- renderSlot(_ctx.$slots, "default", { close })
240
- ])
241
- ],
242
- 2
243
- /* CLASS */
244
- )
245
- ]),
246
- _: 3
247
- /* FORWARDED */
248
- }, 16, ["backdrop-class", "style"]);
249
- };
250
- }
251
- });
252
- const MazDrawer_vue_vue_type_style_index_0_lang = "";
253
- export {
254
- _export_sfc as _,
255
- _sfc_main as a
256
- };
@@ -1,426 +0,0 @@
1
- import "../assets/MazDropdown.css";
2
- import { defineComponent, defineAsyncComponent, useAttrs, useSlots, onBeforeMount, computed, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, createElementBlock, normalizeClass, renderSlot, unref, createCommentVNode, createElementVNode, getCurrentInstance, ref, watch, createVNode, withModifiers, Transition, Fragment, renderList, createTextVNode, toDisplayString } from "vue";
3
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
4
- __name: "MazBtn",
5
- props: {
6
- variant: {
7
- type: String,
8
- default: "button",
9
- validator: (value) => {
10
- return ["button", "link"].includes(value);
11
- }
12
- },
13
- size: {
14
- type: String,
15
- default: "md",
16
- validator: (value) => {
17
- return ["mini", "xs", "sm", "md", "lg", "xl"].includes(value);
18
- }
19
- },
20
- color: {
21
- type: String,
22
- default: "primary"
23
- },
24
- type: {
25
- type: String,
26
- default: "button",
27
- validator: (value) => {
28
- return ["button", "submit", "reset"].includes(value);
29
- }
30
- },
31
- rounded: { type: Boolean, default: false },
32
- noRounded: { type: Boolean, default: false },
33
- outline: { type: Boolean, default: false },
34
- pastel: { type: Boolean, default: false },
35
- block: { type: Boolean, default: false },
36
- noUnderline: { type: Boolean, default: false },
37
- noLeading: { type: Boolean, default: false },
38
- loading: { type: Boolean, default: false },
39
- disabled: { type: Boolean, default: false },
40
- fab: { type: Boolean, default: false },
41
- icon: { type: String, default: void 0 },
42
- leftIcon: { type: String, default: void 0 },
43
- rightIcon: { type: String, default: void 0 },
44
- noPadding: { type: Boolean, default: false },
45
- noElevation: { type: Boolean, default: false }
46
- },
47
- setup(__props) {
48
- const MazSpinner = defineAsyncComponent(() => import("./MazSpinner-e92bd359.mjs"));
49
- const MazIcon = defineAsyncComponent(() => import("./MazIcon-bda198b4.mjs"));
50
- const { href, to } = useAttrs();
51
- const slots = useSlots();
52
- const props = __props;
53
- onBeforeMount(() => {
54
- if (props.icon && !props.fab) {
55
- console.error('[maz-ui](MazBtn) the prop "icon" must be used only with "fab" props');
56
- }
57
- });
58
- const component = computed(() => {
59
- if (href)
60
- return "a";
61
- else if (to)
62
- return "router-link";
63
- return "button";
64
- });
65
- const btnColorClass = computed(
66
- () => props.pastel ? `--${props.color}-pastel` : props.outline ? `--${props.color}-outline` : `--${props.color}`
67
- );
68
- const isDisabled = computed(
69
- () => (props.loading || props.disabled) && component.value === "button"
70
- );
71
- const cursorClass = computed(() => isDisabled.value ? "--cursor-default" : "--cursor-pointer");
72
- const variantClass = computed(() => `--is-${props.variant}`);
73
- const hasLoader = computed(() => props.loading && props.variant === "button");
74
- const hasLeftIcon = computed(() => !!slots["left-icon"] || props.leftIcon);
75
- const hasRightIcon = computed(() => !!slots["right-icon"] || props.rightIcon);
76
- const hasIcon = computed(() => hasLeftIcon.value || hasRightIcon.value);
77
- const hasFabIcon = computed(() => props.fab && props.icon);
78
- const btnType = computed(() => component.value === "button" ? props.type : void 0);
79
- return (_ctx, _cache) => {
80
- return openBlock(), createBlock(resolveDynamicComponent(component.value), mergeProps(_ctx.$attrs, {
81
- disabled: isDisabled.value,
82
- class: ["m-btn", [
83
- `--${__props.size}`,
84
- btnColorClass.value,
85
- cursorClass.value,
86
- variantClass.value,
87
- {
88
- "--block": __props.block,
89
- "--no-underline": __props.noUnderline,
90
- "--no-leading": __props.noLeading,
91
- "--fab": __props.fab,
92
- "--loading": __props.loading,
93
- "--disabled": isDisabled.value,
94
- "--icon": hasIcon.value,
95
- "--rounded": __props.rounded,
96
- "--no-rounded": __props.noRounded,
97
- "--no-padding": __props.noPadding,
98
- "--no-elevation": __props.noElevation
99
- }
100
- ]],
101
- type: btnType.value
102
- }), {
103
- default: withCtx(() => [
104
- hasLeftIcon.value ? (openBlock(), createElementBlock(
105
- "div",
106
- {
107
- key: 0,
108
- class: normalizeClass(["m-btn__icon-left maz-flex maz-flex-center", { "maz-invisible": hasLoader.value }])
109
- },
110
- [
111
- renderSlot(_ctx.$slots, "left-icon", {}, () => [
112
- __props.leftIcon ? (openBlock(), createBlock(unref(MazIcon), {
113
- key: 0,
114
- name: __props.leftIcon
115
- }, null, 8, ["name"])) : createCommentVNode("v-if", true)
116
- ], true)
117
- ],
118
- 2
119
- /* CLASS */
120
- )) : createCommentVNode("v-if", true),
121
- hasFabIcon.value ? (openBlock(), createElementBlock(
122
- "div",
123
- {
124
- key: 1,
125
- class: normalizeClass(["m-btn__icon maz-flex maz-flex-center", { "maz-invisible": hasLoader.value }])
126
- },
127
- [
128
- renderSlot(_ctx.$slots, "icon", {}, () => [
129
- __props.icon ? (openBlock(), createBlock(unref(MazIcon), {
130
- key: 0,
131
- name: __props.icon
132
- }, null, 8, ["name"])) : createCommentVNode("v-if", true)
133
- ], true)
134
- ],
135
- 2
136
- /* CLASS */
137
- )) : createCommentVNode("v-if", true),
138
- createElementVNode(
139
- "span",
140
- {
141
- class: normalizeClass(["maz-flex maz-flex-center", { "maz-invisible": hasLoader.value }])
142
- },
143
- [
144
- renderSlot(_ctx.$slots, "default", {}, void 0, true)
145
- ],
146
- 2
147
- /* CLASS */
148
- ),
149
- hasRightIcon.value ? (openBlock(), createElementBlock(
150
- "div",
151
- {
152
- key: 2,
153
- class: normalizeClass(["m-btn__icon-right maz-flex maz-flex-center", { "maz-invisible": hasLoader.value }])
154
- },
155
- [
156
- renderSlot(_ctx.$slots, "right-icon", {}, () => [
157
- __props.rightIcon ? (openBlock(), createBlock(unref(MazIcon), {
158
- key: 0,
159
- name: __props.rightIcon
160
- }, null, 8, ["name"])) : createCommentVNode("v-if", true)
161
- ], true)
162
- ],
163
- 2
164
- /* CLASS */
165
- )) : createCommentVNode("v-if", true),
166
- hasLoader.value ? (openBlock(), createBlock(unref(MazSpinner), {
167
- key: 3,
168
- size: "2em",
169
- color: __props.color,
170
- class: "maz-absolute"
171
- }, null, 8, ["color"])) : createCommentVNode("v-if", true)
172
- ]),
173
- _: 3
174
- /* FORWARDED */
175
- }, 16, ["disabled", "class", "type"]);
176
- };
177
- }
178
- });
179
- const MazBtn_vue_vue_type_style_index_0_scoped_06ad874b_lang = "";
180
- const _export_sfc = (sfc, props) => {
181
- const target = sfc.__vccOpts || sfc;
182
- for (const [key, val] of props) {
183
- target[key] = val;
184
- }
185
- return target;
186
- };
187
- const MazBtn = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-06ad874b"]]);
188
- const useInstanceUniqId = ({
189
- componentName,
190
- instance,
191
- providedId
192
- }) => {
193
- return computed(() => providedId ?? `${componentName}-${instance == null ? void 0 : instance.uid}`);
194
- };
195
- function debounce(fn, delay) {
196
- let timeout;
197
- return function(...args) {
198
- clearTimeout(timeout);
199
- timeout = setTimeout(() => {
200
- fn.apply(this, args);
201
- }, delay);
202
- };
203
- }
204
- const _hoisted_1 = ["id"];
205
- const _sfc_main = /* @__PURE__ */ defineComponent({
206
- __name: "MazDropdown",
207
- props: {
208
- items: {},
209
- open: { type: Boolean },
210
- id: { default: "maz-dropdown" },
211
- trigger: { default: "both" },
212
- color: { default: "transparent" },
213
- position: { default: "bottom left" },
214
- noCloseOnClick: { type: Boolean },
215
- disabled: { type: Boolean }
216
- },
217
- emits: [
218
- /**
219
- * emitted when a menu item is clicked
220
- */
221
- "menuitem-clicked",
222
- /**
223
- * Triggers when the number changes
224
- *
225
- * @property {boolean} open new value
226
- */
227
- "update:open"
228
- ],
229
- setup(__props, { emit: __emit }) {
230
- const props = __props;
231
- const emits = __emit;
232
- const instanceId = useInstanceUniqId({
233
- componentName: "MazCheckbox",
234
- instance: getCurrentInstance(),
235
- providedId: props.id
236
- });
237
- const dropdownOpen = ref(props.open);
238
- const keyboardSelectedIndex = ref();
239
- function toggleDropdown() {
240
- setDropdown(!dropdownOpen.value);
241
- }
242
- const setDropdown = (value) => {
243
- if (props.disabled)
244
- return;
245
- dropdownOpen.value = value;
246
- emits("update:open", value);
247
- };
248
- const setDropdownDebounced = debounce((value) => {
249
- setDropdown(value);
250
- }, 200);
251
- async function runAction(item, event) {
252
- var _a;
253
- emits("menuitem-clicked", event);
254
- await ((_a = item.action) == null ? void 0 : _a.call(item));
255
- closeOnClick();
256
- }
257
- function closeOnClick() {
258
- if (props.noCloseOnClick === false)
259
- setDropdown(false);
260
- }
261
- function keydownHandler(event) {
262
- if (event.key === "Escape") {
263
- event.preventDefault();
264
- setDropdown(false);
265
- } else if (["ArrowDown", "ArrowUp"].includes(event.key)) {
266
- arrowHandler(event);
267
- } else if (event.key === "Enter" && typeof keyboardSelectedIndex.value === "number") {
268
- event.preventDefault();
269
- const item = document.querySelectorAll(`#${instanceId.value} .menuitem`)[keyboardSelectedIndex.value];
270
- item.click();
271
- closeOnClick();
272
- }
273
- }
274
- function keyboardOpenDropdown(event) {
275
- if (["ArrowDown", "ArrowUp", "Enter"].includes(event.key) && dropdownOpen.value === false) {
276
- event.preventDefault();
277
- setDropdown(true);
278
- }
279
- }
280
- function arrowHandler(event) {
281
- var _a;
282
- event.preventDefault();
283
- const code = event.key;
284
- if (!dropdownOpen.value)
285
- setDropdown(true);
286
- const itemLength = (_a = props.items) == null ? void 0 : _a.length;
287
- if (!itemLength)
288
- return;
289
- if (typeof keyboardSelectedIndex.value === "number") {
290
- if (keyboardSelectedIndex.value === itemLength - 1 && code === "ArrowDown") {
291
- keyboardSelectedIndex.value = 0;
292
- } else if (keyboardSelectedIndex.value === 0 && code === "ArrowUp") {
293
- keyboardSelectedIndex.value = itemLength - 1;
294
- } else {
295
- keyboardSelectedIndex.value = code === "ArrowDown" ? keyboardSelectedIndex.value + 1 : keyboardSelectedIndex.value - 1;
296
- }
297
- } else {
298
- keyboardSelectedIndex.value = code === "ArrowDown" ? 0 : itemLength - 1;
299
- }
300
- }
301
- watch(
302
- () => dropdownOpen.value,
303
- (value) => {
304
- if (value) {
305
- document.addEventListener("keydown", keydownHandler);
306
- } else {
307
- document.removeEventListener("keydown", keydownHandler);
308
- }
309
- keyboardSelectedIndex.value = void 0;
310
- }
311
- );
312
- watch(
313
- () => props.open,
314
- (value) => setDropdown(value)
315
- );
316
- return (_ctx, _cache) => {
317
- return openBlock(), createElementBlock("div", {
318
- id: unref(instanceId),
319
- class: "m-dropdown"
320
- }, [
321
- createVNode(MazBtn, mergeProps({
322
- color: _ctx.color,
323
- size: "md",
324
- "aria-expanded": dropdownOpen.value,
325
- "aria-haspopup": "menu",
326
- disabled: _ctx.disabled
327
- }, _ctx.$attrs, {
328
- onClick: _cache[0] || (_cache[0] = withModifiers(($event) => ["click"].includes(_ctx.trigger) ? toggleDropdown() : void 0, ["stop"])),
329
- onFocus: _cache[1] || (_cache[1] = ($event) => ["hover", "both"].includes(_ctx.trigger) ? setDropdown(true) : void 0),
330
- onBlur: _cache[2] || (_cache[2] = ($event) => unref(setDropdownDebounced)(false)),
331
- onKeydown: keyboardOpenDropdown,
332
- onMouseenter: _cache[3] || (_cache[3] = ($event) => ["hover", "both"].includes(_ctx.trigger) ? dropdownOpen.value === false ? setDropdown(true) : unref(setDropdownDebounced)(true) : void 0),
333
- onMouseleave: _cache[4] || (_cache[4] = ($event) => ["hover", "both"].includes(_ctx.trigger) ? unref(setDropdownDebounced)(false) : void 0)
334
- }), {
335
- default: withCtx(() => [
336
- createCommentVNode(" @slot Menu Label "),
337
- renderSlot(_ctx.$slots, "default")
338
- ]),
339
- _: 3
340
- /* FORWARDED */
341
- }, 16, ["color", "aria-expanded", "disabled"]),
342
- createVNode(Transition, { name: "maz-scale-fade" }, {
343
- default: withCtx(() => [
344
- dropdownOpen.value ? (openBlock(), createElementBlock(
345
- "div",
346
- {
347
- key: 0,
348
- role: "menu",
349
- "aria-label": "Menu",
350
- class: normalizeClass(["menu", {
351
- "--top": _ctx.position.includes("top"),
352
- "--left": _ctx.position.includes("left"),
353
- "--right": _ctx.position.includes("right"),
354
- "--bottom": _ctx.position.includes("bottom")
355
- }]),
356
- tabindex: "-1",
357
- onFocus: _cache[5] || (_cache[5] = ($event) => unref(setDropdownDebounced)(true)),
358
- onBlur: _cache[6] || (_cache[6] = ($event) => unref(setDropdownDebounced)(false)),
359
- onMouseenter: _cache[7] || (_cache[7] = ($event) => ["hover", "both"].includes(_ctx.trigger) ? unref(setDropdownDebounced)(true) : void 0),
360
- onMouseleave: _cache[8] || (_cache[8] = ($event) => ["hover", "both"].includes(_ctx.trigger) ? unref(setDropdownDebounced)(false) : void 0)
361
- },
362
- [
363
- (openBlock(true), createElementBlock(
364
- Fragment,
365
- null,
366
- renderList(_ctx.items, (item, index) => {
367
- return openBlock(), createElementBlock(
368
- Fragment,
369
- null,
370
- [
371
- createCommentVNode("\n @slot Custom menu item\n @binding {Object} item - menu item\n "),
372
- renderSlot(_ctx.$slots, "menuitem", { item }, () => [
373
- (openBlock(), createBlock(resolveDynamicComponent(item.to ? "router-link" : item.action ? "button" : "a"), {
374
- key: index,
375
- href: item.href,
376
- tabindex: "-1",
377
- target: item.href ? item.target ?? "_self" : void 0,
378
- type: item.action ? "button" : void 0,
379
- class: normalizeClass([[
380
- {
381
- "--is-keyboard-selected": keyboardSelectedIndex.value === index
382
- },
383
- item.class
384
- ], "menuitem"]),
385
- to: item.to,
386
- onClick: withModifiers(($event) => item.action ? runAction(item, $event) : closeOnClick(), ["stop"])
387
- }, {
388
- default: withCtx(() => [
389
- createCommentVNode("\n @slot Custom menu item label\n @binding {Object} item - menu item\n "),
390
- renderSlot(_ctx.$slots, "menuitem-label", { item }, () => [
391
- createTextVNode(
392
- toDisplayString(item.label),
393
- 1
394
- /* TEXT */
395
- )
396
- ])
397
- ]),
398
- _: 2
399
- /* DYNAMIC */
400
- }, 1032, ["href", "target", "type", "class", "to", "onClick"]))
401
- ])
402
- ],
403
- 64
404
- /* STABLE_FRAGMENT */
405
- );
406
- }),
407
- 256
408
- /* UNKEYED_FRAGMENT */
409
- ))
410
- ],
411
- 34
412
- /* CLASS, HYDRATE_EVENTS */
413
- )) : createCommentVNode("v-if", true)
414
- ]),
415
- _: 3
416
- /* FORWARDED */
417
- })
418
- ], 8, _hoisted_1);
419
- };
420
- }
421
- });
422
- const MazDropdown_vue_vue_type_style_index_0_lang = "";
423
- export {
424
- _export_sfc as _,
425
- _sfc_main as a
426
- };