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,159 +0,0 @@
1
- import { defineComponent, ref, computed, onMounted, watchEffect, openBlock, createElementBlock, Fragment, createCommentVNode, mergeProps, nextTick } from "vue";
2
- import { i as injectStrict } from "./MazTabsBar-3c2e2d69.mjs";
3
- const _hoisted_1 = ["innerHTML"];
4
- const _sfc_main = /* @__PURE__ */ defineComponent({
5
- __name: "MazIcon",
6
- props: {
7
- src: { type: String, default: void 0 },
8
- path: { type: String, default: void 0 },
9
- name: { type: String, default: void 0 },
10
- size: { type: String, default: void 0 },
11
- title: { type: String, default: void 0 },
12
- transformSource: {
13
- type: Function,
14
- default: (svg) => svg
15
- }
16
- },
17
- emits: ["loaded", "unloaded", "error"],
18
- setup(__props, { emit: __emit }) {
19
- const cache = {};
20
- const svgElSource = ref();
21
- const svgElem = ref();
22
- const getMazIconPath = () => {
23
- try {
24
- return injectStrict("mazIconPath");
25
- } catch {
26
- return void 0;
27
- }
28
- };
29
- const props = __props;
30
- const emits = __emit;
31
- const iconPath = computed(() => props.path ?? getMazIconPath());
32
- const fullSrc = computed(() => {
33
- if (props.src) {
34
- return props.src;
35
- } else if (iconPath.value) {
36
- return `${iconPath.value}/${props.name}.svg`;
37
- } else {
38
- return `/${props.name}.svg`;
39
- }
40
- });
41
- onMounted(() => {
42
- if (!props.name && !props.src) {
43
- console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop');
44
- }
45
- });
46
- const setTitle = (svg, title) => {
47
- const titleTags = svg.querySelectorAll("title");
48
- if (titleTags.length > 0) {
49
- titleTags[0].textContent = title;
50
- } else {
51
- const titleEl = document.createElementNS("http://www.w3.org/2000/svg", "title");
52
- titleEl.textContent = title;
53
- svg.append(titleEl);
54
- }
55
- };
56
- const filterAttrs = (attrs) => {
57
- return Object.keys(attrs).reduce((result, key) => {
58
- if (attrs[key] !== false && attrs[key] !== null && attrs[key] !== void 0) {
59
- result[key] = attrs[key];
60
- }
61
- return result;
62
- }, {});
63
- };
64
- const getSvgAttrs = (svgEl) => {
65
- const svgAttrs = {};
66
- const attrs = svgEl.attributes;
67
- if (!attrs) {
68
- return svgAttrs;
69
- }
70
- for (let i = attrs.length - 1; i >= 0; i--) {
71
- svgAttrs[attrs[i].name] = attrs[i].value;
72
- }
73
- return svgAttrs;
74
- };
75
- const getSvgContent = (svgEl) => {
76
- let svgElNode = svgEl.cloneNode(true);
77
- svgElNode = props.transformSource(svgEl);
78
- if (props.title) {
79
- setTitle(svgElNode, props.title);
80
- }
81
- return svgEl.innerHTML;
82
- };
83
- const getSource = async (src) => {
84
- if (!cache[src]) {
85
- cache[src] = download(src);
86
- }
87
- try {
88
- svgElSource.value = await cache[src];
89
- await nextTick();
90
- emits("loaded", svgElem.value);
91
- } catch (error) {
92
- if (svgElSource.value) {
93
- svgElSource.value = void 0;
94
- emits("unloaded");
95
- }
96
- delete cache[src];
97
- emits("error", error);
98
- }
99
- };
100
- const download = (url) => {
101
- return new Promise((resolve, reject) => {
102
- const request = new XMLHttpRequest();
103
- request.open("GET", url, true);
104
- request.addEventListener("load", () => {
105
- if (request.status >= 200 && request.status < 400) {
106
- try {
107
- const parser = new DOMParser();
108
- const result = parser.parseFromString(request.responseText, "text/xml");
109
- let svgEl = result.querySelectorAll("svg")[0];
110
- if (svgEl) {
111
- svgEl = props.transformSource(svgEl);
112
- resolve(svgEl);
113
- } else {
114
- reject(new Error('Loaded file is not valid SVG"'));
115
- }
116
- } catch (error) {
117
- reject(error);
118
- }
119
- } else {
120
- reject(new Error("Error loading SVG"));
121
- }
122
- });
123
- request.addEventListener("error", () => reject());
124
- request.send();
125
- });
126
- };
127
- watchEffect(() => getSource(fullSrc.value));
128
- return (_ctx, _cache) => {
129
- return openBlock(), createElementBlock(
130
- Fragment,
131
- null,
132
- [
133
- createCommentVNode(" eslint-disable vue/no-v-html "),
134
- createCommentVNode(" eslint-disable vue/html-self-closing "),
135
- svgElSource.value ? (openBlock(), createElementBlock("svg", mergeProps({
136
- key: 0,
137
- ref_key: "svgElem",
138
- ref: svgElem,
139
- width: "1em",
140
- height: "1em"
141
- }, {
142
- ...getSvgAttrs(svgElSource.value),
143
- ...filterAttrs(_ctx.$attrs)
144
- }, {
145
- style: `font-size: ${__props.size}`,
146
- innerHTML: getSvgContent(svgElSource.value)
147
- }), null, 16, _hoisted_1)) : createCommentVNode("v-if", true),
148
- createCommentVNode(" eslint-enable vue/no-v-html "),
149
- createCommentVNode(" eslint-enable vue/html-self-closing ")
150
- ],
151
- 2112
152
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
153
- );
154
- };
155
- }
156
- });
157
- export {
158
- _sfc_main as default
159
- };
@@ -1,165 +0,0 @@
1
- import { inject, defineComponent, ref, computed, onMounted, watchEffect, openBlock, createElementBlock, Fragment, createCommentVNode, mergeProps, nextTick } from "vue";
2
- function injectStrict(key, fallback) {
3
- const resolved = inject(key, fallback);
4
- if (!resolved) {
5
- throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${key}`);
6
- }
7
- return resolved;
8
- }
9
- const _hoisted_1 = ["innerHTML"];
10
- const _sfc_main = /* @__PURE__ */ defineComponent({
11
- __name: "MazIcon",
12
- props: {
13
- src: { type: String, default: void 0 },
14
- path: { type: String, default: void 0 },
15
- name: { type: String, default: void 0 },
16
- size: { type: String, default: void 0 },
17
- title: { type: String, default: void 0 },
18
- transformSource: {
19
- type: Function,
20
- default: (svg) => svg
21
- }
22
- },
23
- emits: ["loaded", "unloaded", "error"],
24
- setup(__props, { emit: __emit }) {
25
- const cache = {};
26
- const svgElSource = ref();
27
- const svgElem = ref();
28
- const getMazIconPath = () => {
29
- try {
30
- return injectStrict("mazIconPath");
31
- } catch {
32
- return void 0;
33
- }
34
- };
35
- const props = __props;
36
- const emits = __emit;
37
- const iconPath = computed(() => props.path ?? getMazIconPath());
38
- const fullSrc = computed(() => {
39
- if (props.src) {
40
- return props.src;
41
- } else if (iconPath.value) {
42
- return `${iconPath.value}/${props.name}.svg`;
43
- } else {
44
- return `/${props.name}.svg`;
45
- }
46
- });
47
- onMounted(() => {
48
- if (!props.name && !props.src) {
49
- console.error('[maz-ui](MazIcon) you should provide "name" or "src" as prop');
50
- }
51
- });
52
- const setTitle = (svg, title) => {
53
- const titleTags = svg.querySelectorAll("title");
54
- if (titleTags.length > 0) {
55
- titleTags[0].textContent = title;
56
- } else {
57
- const titleEl = document.createElementNS("http://www.w3.org/2000/svg", "title");
58
- titleEl.textContent = title;
59
- svg.append(titleEl);
60
- }
61
- };
62
- const filterAttrs = (attrs) => {
63
- return Object.keys(attrs).reduce((result, key) => {
64
- if (attrs[key] !== false && attrs[key] !== null && attrs[key] !== void 0) {
65
- result[key] = attrs[key];
66
- }
67
- return result;
68
- }, {});
69
- };
70
- const getSvgAttrs = (svgEl) => {
71
- const svgAttrs = {};
72
- const attrs = svgEl.attributes;
73
- if (!attrs) {
74
- return svgAttrs;
75
- }
76
- for (let i = attrs.length - 1; i >= 0; i--) {
77
- svgAttrs[attrs[i].name] = attrs[i].value;
78
- }
79
- return svgAttrs;
80
- };
81
- const getSvgContent = (svgEl) => {
82
- let svgElNode = svgEl.cloneNode(true);
83
- svgElNode = props.transformSource(svgEl);
84
- if (props.title) {
85
- setTitle(svgElNode, props.title);
86
- }
87
- return svgEl.innerHTML;
88
- };
89
- const getSource = async (src) => {
90
- if (!cache[src]) {
91
- cache[src] = download(src);
92
- }
93
- try {
94
- svgElSource.value = await cache[src];
95
- await nextTick();
96
- emits("loaded", svgElem.value);
97
- } catch (error) {
98
- if (svgElSource.value) {
99
- svgElSource.value = void 0;
100
- emits("unloaded");
101
- }
102
- delete cache[src];
103
- emits("error", error);
104
- }
105
- };
106
- const download = (url) => {
107
- return new Promise((resolve, reject) => {
108
- const request = new XMLHttpRequest();
109
- request.open("GET", url, true);
110
- request.addEventListener("load", () => {
111
- if (request.status >= 200 && request.status < 400) {
112
- try {
113
- const parser = new DOMParser();
114
- const result = parser.parseFromString(request.responseText, "text/xml");
115
- let svgEl = result.querySelectorAll("svg")[0];
116
- if (svgEl) {
117
- svgEl = props.transformSource(svgEl);
118
- resolve(svgEl);
119
- } else {
120
- reject(new Error('Loaded file is not valid SVG"'));
121
- }
122
- } catch (error) {
123
- reject(error);
124
- }
125
- } else {
126
- reject(new Error("Error loading SVG"));
127
- }
128
- });
129
- request.addEventListener("error", () => reject());
130
- request.send();
131
- });
132
- };
133
- watchEffect(() => getSource(fullSrc.value));
134
- return (_ctx, _cache) => {
135
- return openBlock(), createElementBlock(
136
- Fragment,
137
- null,
138
- [
139
- createCommentVNode(" eslint-disable vue/no-v-html "),
140
- createCommentVNode(" eslint-disable vue/html-self-closing "),
141
- svgElSource.value ? (openBlock(), createElementBlock("svg", mergeProps({
142
- key: 0,
143
- ref_key: "svgElem",
144
- ref: svgElem,
145
- width: "1em",
146
- height: "1em"
147
- }, {
148
- ...getSvgAttrs(svgElSource.value),
149
- ...filterAttrs(_ctx.$attrs)
150
- }, {
151
- style: `font-size: ${__props.size}`,
152
- innerHTML: getSvgContent(svgElSource.value)
153
- }), null, 16, _hoisted_1)) : createCommentVNode("v-if", true),
154
- createCommentVNode(" eslint-enable vue/no-v-html "),
155
- createCommentVNode(" eslint-enable vue/html-self-closing ")
156
- ],
157
- 2112
158
- /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
159
- );
160
- };
161
- }
162
- });
163
- export {
164
- _sfc_main as default
165
- };
@@ -1,326 +0,0 @@
1
- import "../assets/MazInput.css";
2
- import { computed, defineComponent, defineAsyncComponent, ref, getCurrentInstance, onMounted, useSlots, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, renderSlot, createVNode, unref, createCommentVNode, withDirectives, mergeProps, toHandlers, vModelDynamic, createTextVNode, toDisplayString, createBlock, withModifiers, withCtx } from "vue";
3
- import { d as debounce } from "./debounce-7d66ffa9.mjs";
4
- import { _ as _export_sfc } from "./MazPicker-50fc11d1.mjs";
5
- const useInstanceUniqId = ({
6
- componentName,
7
- instance,
8
- providedId
9
- }) => {
10
- return computed(() => providedId ?? `${componentName}-${instance == null ? void 0 : instance.uid}`);
11
- };
12
- const _hoisted_1 = {
13
- key: 0,
14
- class: "m-input-wrapper-left"
15
- };
16
- const _hoisted_2 = { class: "m-input-wrapper-input" };
17
- const _hoisted_3 = ["id", "type", "name", "placeholder", "aria-label", "disabled", "readonly", "required"];
18
- const _hoisted_4 = { key: 0 };
19
- const _hoisted_5 = {
20
- key: 1,
21
- class: "m-input-wrapper-right"
22
- };
23
- const _sfc_main = /* @__PURE__ */ defineComponent({
24
- ...{
25
- inheritAttrs: false
26
- },
27
- __name: "MazInput",
28
- props: {
29
- style: { type: [String, Array, Object], default: void 0 },
30
- class: { type: String, default: void 0 },
31
- modelValue: {
32
- type: [String, Number, Boolean],
33
- default: void 0
34
- },
35
- placeholder: { type: String, default: void 0 },
36
- color: {
37
- type: String,
38
- default: "primary"
39
- },
40
- label: { type: String, default: void 0 },
41
- name: { type: String, default: "input" },
42
- type: {
43
- type: String,
44
- default: "text",
45
- validator: (value) => {
46
- return [
47
- "text",
48
- "date",
49
- "number",
50
- "tel",
51
- "search",
52
- "url",
53
- "password",
54
- "month",
55
- "time",
56
- "week",
57
- "email"
58
- ].includes(value);
59
- }
60
- },
61
- required: { type: Boolean, default: false },
62
- disabled: { type: Boolean, default: false },
63
- readonly: { type: Boolean, default: false },
64
- id: { type: String, default: void 0 },
65
- error: { type: Boolean, default: false },
66
- success: { type: Boolean, default: false },
67
- warning: { type: Boolean, default: false },
68
- hint: { type: String, default: void 0 },
69
- inputClasses: { type: String, default: void 0 },
70
- noBorder: { type: Boolean, default: false },
71
- noRadius: { type: Boolean, default: false },
72
- size: {
73
- type: String,
74
- default: "md",
75
- validator: (value) => {
76
- return ["mini", "xs", "sm", "md", "lg", "xl"].includes(value);
77
- }
78
- },
79
- debounce: { type: Boolean, default: false },
80
- debounceDelay: { type: Number, default: 500 },
81
- validButton: { type: Boolean, default: false },
82
- validButtonLoading: { type: Boolean, default: false },
83
- autoFocus: { type: Boolean, default: false },
84
- borderActive: { type: Boolean, default: false },
85
- leftIcon: { type: String, default: void 0 },
86
- rightIcon: { type: String, default: void 0 }
87
- },
88
- emits: ["focus", "blur", "update:model-value", "click", "change", "update"],
89
- setup(__props, { emit: __emit }) {
90
- const MazBtn = defineAsyncComponent(() => import("./MazBtn-0e02f0da.mjs"));
91
- const MazIcon = defineAsyncComponent(() => import("./MazIcon-bda198b4.mjs"));
92
- const EyeOffIcon = defineAsyncComponent(() => import("./eye-slash-342420ff.mjs"));
93
- const EyeIcon = defineAsyncComponent(() => import("./eye-fbb13657.mjs"));
94
- const CheckIcon = defineAsyncComponent(() => import("./check-f2fcce10.mjs"));
95
- const props = __props;
96
- const emits = __emit;
97
- const hasPasswordVisible = ref(false);
98
- const isFocused = ref(false);
99
- const input = ref();
100
- const instance = getCurrentInstance();
101
- const instanceId = useInstanceUniqId({
102
- componentName: "MazInput",
103
- instance,
104
- providedId: props.id
105
- });
106
- onMounted(() => {
107
- var _a;
108
- if (props.autoFocus) {
109
- (_a = input.value) == null ? void 0 : _a.focus();
110
- }
111
- });
112
- const inheritClasses = computed(() => props.class);
113
- const isPasswordType = computed(() => props.type === "password");
114
- const inputType = computed(() => hasPasswordVisible.value ? "text" : props.type);
115
- const borderStyle = computed(() => {
116
- if (props.noBorder)
117
- return void 0;
118
- if (props.error)
119
- return "maz-border-danger";
120
- if (props.success)
121
- return "maz-border-success";
122
- if (props.warning)
123
- return "maz-border-warning";
124
- if (isFocused.value || props.borderActive) {
125
- if (props.color === "black")
126
- return "maz-border-black";
127
- if (props.color === "danger")
128
- return "maz-border-danger";
129
- if (props.color === "info")
130
- return "maz-border-info";
131
- if (props.color === "primary")
132
- return "maz-border-primary";
133
- if (props.color === "secondary")
134
- return "maz-border-secondary";
135
- if (props.color === "success")
136
- return "maz-border-success";
137
- if (props.color === "warning")
138
- return "maz-border-warning";
139
- if (props.color === "white")
140
- return "maz-border-white";
141
- }
142
- return "--default-border";
143
- });
144
- const slots = useSlots();
145
- const computedPlaceholder = computed(() => {
146
- const { required, placeholder } = props;
147
- if (!placeholder)
148
- return void 0;
149
- return required ? `${placeholder} *` : placeholder;
150
- });
151
- const hasValue = computed(() => props.modelValue !== void 0 && props.modelValue !== "");
152
- const inputValue = computed({
153
- get: () => props.modelValue,
154
- set: (value) => emitValue(value)
155
- });
156
- const shouldUp = computed(() => {
157
- return (!!props.label || !!props.hint) && (isFocused.value || !!hasValue.value || !!props.placeholder || ["date", "month", "week"].includes(props.type));
158
- });
159
- const hasLabel = computed(() => !!props.label || !!props.hint);
160
- const hasRightPart = () => {
161
- return !!slots["right-icon"] || isPasswordType.value || !!slots["valid-button"] || props.validButton || !!props.rightIcon;
162
- };
163
- const hasLeftPart = () => {
164
- return !!slots["left-icon"] || !!props.leftIcon;
165
- };
166
- const focus = (event) => {
167
- emits("focus", event);
168
- isFocused.value = true;
169
- };
170
- const blur = (event) => {
171
- emits("blur", event);
172
- isFocused.value = false;
173
- };
174
- const change = (event) => emits("change", event);
175
- const debounceEmitValue = debounce((value) => {
176
- emits("update:model-value", value);
177
- }, props.debounceDelay);
178
- const emitValue = (value) => {
179
- if (props.debounce)
180
- return debounceEmitValue(value);
181
- emits("update:model-value", value);
182
- };
183
- return (_ctx, _cache) => {
184
- return openBlock(), createElementBlock(
185
- "div",
186
- {
187
- class: normalizeClass(["m-input", [
188
- {
189
- "--is-focused": isFocused.value || __props.borderActive,
190
- "--should-up": shouldUp.value,
191
- "--has-label": hasLabel.value,
192
- "--is-disabled": __props.disabled,
193
- "--is-readonly": __props.readonly,
194
- "--has-z-2": __props.error || __props.warning || __props.success,
195
- "--has-state": __props.error || __props.warning || __props.success
196
- },
197
- inheritClasses.value,
198
- `--${__props.color}`,
199
- `--${__props.size}`
200
- ]]),
201
- style: normalizeStyle(__props.style)
202
- },
203
- [
204
- createElementVNode(
205
- "div",
206
- {
207
- class: normalizeClass(["m-input-wrapper", [__props.inputClasses, borderStyle.value, { "maz-rounded": !__props.noRadius }]])
208
- },
209
- [
210
- hasLeftPart() ? (openBlock(), createElementBlock("div", _hoisted_1, [
211
- _ctx.$slots["left-icon"] || __props.leftIcon ? renderSlot(_ctx.$slots, "left-icon", { key: 0 }, () => [
212
- createVNode(unref(MazIcon), {
213
- name: __props.leftIcon,
214
- class: "maz-text-xl maz-text-muted"
215
- }, null, 8, ["name"])
216
- ], true) : createCommentVNode("v-if", true)
217
- ])) : createCommentVNode("v-if", true),
218
- createElementVNode("div", _hoisted_2, [
219
- withDirectives(createElementVNode("input", mergeProps({
220
- id: unref(instanceId),
221
- ref_key: "input",
222
- ref: input,
223
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => inputValue.value = $event),
224
- type: inputType.value,
225
- name: __props.name
226
- }, _ctx.$attrs, {
227
- placeholder: computedPlaceholder.value,
228
- "aria-label": __props.label || __props.placeholder,
229
- disabled: __props.disabled,
230
- readonly: __props.readonly,
231
- required: __props.required,
232
- class: "m-input-input"
233
- }, toHandlers({
234
- blur,
235
- focus,
236
- change
237
- }, true), {
238
- onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click", $event))
239
- }), null, 16, _hoisted_3), [
240
- [vModelDynamic, inputValue.value]
241
- ]),
242
- __props.label || __props.hint ? (openBlock(), createElementBlock(
243
- "span",
244
- {
245
- key: 0,
246
- ref: "label",
247
- class: normalizeClass(["m-input-label", [
248
- {
249
- "maz-text-danger-600": __props.error,
250
- "maz-text-success-600": __props.success,
251
- "maz-text-warning-600": __props.warning
252
- }
253
- ]])
254
- },
255
- [
256
- createTextVNode(
257
- toDisplayString(__props.hint || __props.label) + " ",
258
- 1
259
- /* TEXT */
260
- ),
261
- __props.required ? (openBlock(), createElementBlock("sup", _hoisted_4, "*")) : createCommentVNode("v-if", true)
262
- ],
263
- 2
264
- /* CLASS */
265
- )) : createCommentVNode("v-if", true)
266
- ]),
267
- hasRightPart() ? (openBlock(), createElementBlock("div", _hoisted_5, [
268
- _ctx.$slots["right-icon"] || __props.rightIcon ? renderSlot(_ctx.$slots, "right-icon", { key: 0 }, () => [
269
- createVNode(unref(MazIcon), {
270
- name: __props.rightIcon,
271
- class: "maz-text-xl maz-text-muted"
272
- }, null, 8, ["name"])
273
- ], true) : createCommentVNode("v-if", true),
274
- isPasswordType.value ? (openBlock(), createBlock(unref(MazBtn), {
275
- key: 1,
276
- color: "transparent",
277
- tabindex: "-1",
278
- size: "mini",
279
- onClick: _cache[2] || (_cache[2] = withModifiers(($event) => hasPasswordVisible.value = !hasPasswordVisible.value, ["stop"]))
280
- }, {
281
- default: withCtx(() => [
282
- hasPasswordVisible.value ? (openBlock(), createBlock(unref(EyeOffIcon), {
283
- key: 0,
284
- class: "maz-text-xl maz-text-muted"
285
- })) : (openBlock(), createBlock(unref(EyeIcon), {
286
- key: 1,
287
- class: "maz-text-xl maz-text-muted"
288
- }))
289
- ]),
290
- _: 1
291
- /* STABLE */
292
- })) : createCommentVNode("v-if", true),
293
- _ctx.$slots["valid-button"] || __props.validButton ? renderSlot(_ctx.$slots, "valid-button", { key: 2 }, () => [
294
- createVNode(unref(MazBtn), {
295
- color: "transparent",
296
- disabled: __props.disabled,
297
- tabindex: "-1",
298
- loading: __props.validButtonLoading,
299
- class: "m-input-valid-button",
300
- size: "mini",
301
- type: "submit"
302
- }, {
303
- default: withCtx(() => [
304
- createVNode(unref(CheckIcon), { class: "maz-text-2xl maz-text-normal" })
305
- ]),
306
- _: 1
307
- /* STABLE */
308
- }, 8, ["disabled", "loading"])
309
- ], true) : createCommentVNode("v-if", true)
310
- ])) : createCommentVNode("v-if", true)
311
- ],
312
- 2
313
- /* CLASS */
314
- )
315
- ],
316
- 6
317
- /* CLASS, STYLE */
318
- );
319
- };
320
- }
321
- });
322
- const MazInput_vue_vue_type_style_index_0_scoped_32fa5093_lang = "";
323
- const MazInput = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-32fa5093"]]);
324
- export {
325
- MazInput as default
326
- };