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,12 +1,9 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => {
4
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
5
- return value;
6
- };
1
+ var _ = Object.defineProperty;
2
+ var H = (o, e, t) => e in o ? _(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var i = (o, e, t) => (H(o, typeof e != "symbol" ? e + "" : e, t), t);
7
4
  import "./assets/MazGallery.css";
8
- import { defineComponent, useCssVars, defineAsyncComponent, onBeforeMount, computed, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, withDirectives, unref, toDisplayString, createCommentVNode, createVNode } from "vue";
9
- const style = `
5
+ import { defineComponent as B, useCssVars as S, defineAsyncComponent as O, onBeforeMount as M, computed as p, openBlock as u, createElementBlock as g, normalizeClass as y, normalizeStyle as E, createElementVNode as b, Fragment as x, renderList as C, withDirectives as w, unref as v, toDisplayString as T, createCommentVNode as L, createVNode as N } from "vue";
6
+ const R = `
10
7
  .maz-zoom-img {
11
8
  position: fixed;
12
9
  top: 0;
@@ -129,512 +126,341 @@ const style = `
129
126
 
130
127
  .maz-zoom-img .maz-zoom-btn:hover {
131
128
  background-color: hsl(0, 0%, 0%);
132
- }`;
133
- const svgs = {
129
+ }`, P = {
134
130
  close: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',
135
131
  next: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',
136
132
  previous: '<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>',
137
133
  spinner: '<svg width="40px" height="40px" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" x="0px" y="0px" viewBox="0 0 50 50" xml:space="preserve" class="maz-zoom-img__loader__svg" data-v-6d1cb50c=""><path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path></svg>'
138
134
  };
139
- class VueZoomImg {
140
- constructor(binding) {
141
- __publicField(this, "options");
142
- __publicField(this, "loader");
143
- __publicField(this, "wrapper");
144
- __publicField(this, "img");
145
- __publicField(this, "keydownHandler");
146
- __publicField(this, "onImgLoadedCallback");
147
- __publicField(this, "buttonsAdded");
148
- __publicField(this, "defaultOptions", {
149
- scale: true,
150
- blur: true,
151
- disabled: false
135
+ class U {
136
+ constructor(e) {
137
+ i(this, "options");
138
+ i(this, "loader");
139
+ i(this, "wrapper");
140
+ i(this, "img");
141
+ i(this, "keydownHandler");
142
+ i(this, "onImgLoadedCallback");
143
+ i(this, "buttonsAdded");
144
+ i(this, "defaultOptions", {
145
+ scale: !0,
146
+ blur: !0,
147
+ disabled: !1
152
148
  });
153
- __publicField(this, "mouseEnterListener");
154
- __publicField(this, "mouseLeaveListener");
155
- __publicField(this, "renderPreviewListener");
156
- if (!binding.value) {
149
+ i(this, "mouseEnterListener");
150
+ i(this, "mouseLeaveListener");
151
+ i(this, "renderPreviewListener");
152
+ if (!e.value)
157
153
  throw new Error(
158
154
  '[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`'
159
155
  );
160
- }
161
- if (typeof binding.value === "object" && !binding.value.src) {
156
+ if (typeof e.value == "object" && !e.value.src)
162
157
  throw new Error("[maz-ui](zoom-img) src of image must be provided");
163
- }
164
- this.buttonsAdded = false;
165
- this.options = this.buildOptions(binding);
166
- this.keydownHandler = this.keydownLister.bind(this);
167
- this.loader = this.getLoader();
168
- this.wrapper = document.createElement("div");
169
- this.wrapper.classList.add("maz-zoom-img__wrapper");
170
- this.wrapper.prepend(this.loader);
171
- this.img = document.createElement("img");
172
- this.onImgLoadedCallback = this.onImgLoaded.bind(this);
173
- this.imgEventHandler(true);
174
- }
175
- buildOptions(binding) {
158
+ this.buttonsAdded = !1, this.options = this.buildOptions(e), this.keydownHandler = this.keydownLister.bind(this), this.loader = this.getLoader(), this.wrapper = document.createElement("div"), this.wrapper.classList.add("maz-zoom-img__wrapper"), this.wrapper.prepend(this.loader), this.img = document.createElement("img"), this.onImgLoadedCallback = this.onImgLoaded.bind(this), this.imgEventHandler(!0);
159
+ }
160
+ buildOptions(e) {
176
161
  return {
177
162
  ...this.defaultOptions,
178
- ...typeof binding.value === "object" ? binding.value : { src: binding.value }
163
+ ...typeof e.value == "object" ? e.value : { src: e.value }
179
164
  };
180
165
  }
181
166
  get allInstances() {
182
167
  return [...document.querySelectorAll(".maz-zoom-img-instance")];
183
168
  }
184
- create(el) {
185
- if (this.options.disabled)
186
- return;
187
- el.style.cursor = "pointer";
188
- setTimeout(() => el.classList.add("maz-zoom-img-instance"));
189
- el.setAttribute("data-zoom-src", this.options.src);
190
- if (this.options.alt)
191
- el.setAttribute("data-zoom-alt", this.options.alt);
192
- el.style.transition = "all 300ms ease-in-out";
193
- this.mouseEnterListener = () => this.mouseEnter(el);
194
- this.mouseLeaveListener = () => this.mouseLeave(el);
195
- this.renderPreviewListener = () => this.renderPreview(el, this.options);
196
- el.addEventListener("mouseenter", this.mouseEnterListener);
197
- el.addEventListener("mouseleave", this.mouseLeaveListener);
198
- el.addEventListener("click", this.renderPreviewListener);
199
- }
200
- update(binding) {
201
- this.options = this.buildOptions(binding);
202
- }
203
- remove(el) {
204
- this.imgEventHandler(false);
205
- el.removeEventListener("mouseenter", this.mouseEnterListener);
206
- el.removeEventListener("mouseleave", this.mouseLeaveListener);
207
- el.removeEventListener("click", this.renderPreviewListener);
208
- el.classList.remove("maz-zoom-img-instance");
209
- el.removeAttribute("data-zoom-src");
210
- el.removeAttribute("data-zoom-alt");
211
- el.style.cursor = "";
212
- }
213
- renderPreview(el, options) {
214
- el.classList.add(
169
+ create(e) {
170
+ this.options.disabled || (e.style.cursor = "pointer", setTimeout(() => e.classList.add("maz-zoom-img-instance")), e.setAttribute("data-zoom-src", this.options.src), this.options.alt && e.setAttribute("data-zoom-alt", this.options.alt), e.style.transition = "all 300ms ease-in-out", this.mouseEnterListener = () => this.mouseEnter(e), this.mouseLeaveListener = () => this.mouseLeave(e), this.renderPreviewListener = () => this.renderPreview(e, this.options), e.addEventListener("mouseenter", this.mouseEnterListener), e.addEventListener("mouseleave", this.mouseLeaveListener), e.addEventListener("click", this.renderPreviewListener));
171
+ }
172
+ update(e) {
173
+ this.options = this.buildOptions(e);
174
+ }
175
+ remove(e) {
176
+ this.imgEventHandler(!1), e.removeEventListener("mouseenter", this.mouseEnterListener), e.removeEventListener("mouseleave", this.mouseLeaveListener), e.removeEventListener("click", this.renderPreviewListener), e.classList.remove("maz-zoom-img-instance"), e.removeAttribute("data-zoom-src"), e.removeAttribute("data-zoom-alt"), e.style.cursor = "";
177
+ }
178
+ renderPreview(e, t) {
179
+ e.classList.add(
215
180
  "maz-is-open"
216
181
  /* OPEN */
217
- );
218
- this.addStyle(style);
219
- const container = document.createElement("div");
220
- container.classList.add("maz-zoom-img");
221
- container.setAttribute("id", "MazImgPreviewFullsize");
222
- container.addEventListener("click", (e) => {
223
- if (container.isEqualNode(e.target)) {
224
- this.closePreview();
225
- }
226
- });
227
- if (typeof options === "object") {
228
- this.img.setAttribute("src", options.src);
229
- if (options.alt)
230
- this.img.setAttribute("alt", options.alt);
231
- this.img.id = "MazImgElement";
232
- }
233
- this.wrapper.append(this.img);
234
- container.append(this.wrapper);
235
- document.body.append(container);
236
- this.keyboardEventHandler(true);
237
- setTimeout(() => {
238
- if (container)
239
- container.classList.add("maz-animate");
182
+ ), this.addStyle(R);
183
+ const s = document.createElement("div");
184
+ s.classList.add("maz-zoom-img"), s.setAttribute("id", "MazImgPreviewFullsize"), s.addEventListener("click", (a) => {
185
+ s.isEqualNode(a.target) && this.closePreview();
186
+ }), typeof t == "object" && (this.img.setAttribute("src", t.src), t.alt && this.img.setAttribute("alt", t.alt), this.img.id = "MazImgElement"), this.wrapper.append(this.img), s.append(this.wrapper), document.body.append(s), this.keyboardEventHandler(!0), setTimeout(() => {
187
+ s && s.classList.add("maz-animate");
240
188
  }, 100);
241
189
  }
242
190
  onImgLoaded() {
243
- this.wrapper.style.width = `${this.img.width}px`;
244
- this.wrapper.style.minWidth = `200px`;
245
- this.loader.hidden = true;
246
- const closeButton = this.getButton();
247
- const buttons = [];
248
- const hasMultipleInstance = this.allInstances.length > 1;
191
+ this.wrapper.style.width = `${this.img.width}px`, this.wrapper.style.minWidth = "200px", this.loader.hidden = !0;
192
+ const e = this.getButton(), t = [], s = this.allInstances.length > 1;
249
193
  if (!this.buttonsAdded) {
250
- this.buttonsAdded = true;
251
- if (hasMultipleInstance) {
252
- const previousButton = this.getButton("previous");
253
- const nextButton = this.getButton("next");
254
- buttons.push(previousButton, nextButton);
255
- }
256
- this.wrapper.append(closeButton);
257
- if (hasMultipleInstance) {
258
- this.wrapper.prepend(buttons[0]);
259
- this.wrapper.append(buttons[1]);
194
+ if (this.buttonsAdded = !0, s) {
195
+ const a = this.getButton("previous"), l = this.getButton("next");
196
+ t.push(a, l);
260
197
  }
198
+ this.wrapper.append(e), s && (this.wrapper.prepend(t[0]), this.wrapper.append(t[1]));
261
199
  }
262
200
  }
263
201
  getLoader() {
264
- const loader = document.createElement("div");
265
- loader.classList.add("maz-zoom-img__loader");
266
- loader.innerHTML = svgs.spinner;
267
- return loader;
268
- }
269
- mouseLeave(el) {
270
- if (this.options.scale)
271
- el.style.transform = "";
272
- if (this.options.blur)
273
- el.style.filter = "";
274
- el.style.zIndex = "";
275
- }
276
- mouseEnter(el) {
277
- el.style.zIndex = "1";
278
- if (this.options.scale)
279
- el.style.transform = "scale(1.1)";
280
- if (this.options.blur)
281
- el.style.filter = "blur(2px)";
202
+ const e = document.createElement("div");
203
+ return e.classList.add("maz-zoom-img__loader"), e.innerHTML = P.spinner, e;
204
+ }
205
+ mouseLeave(e) {
206
+ this.options.scale && (e.style.transform = ""), this.options.blur && (e.style.filter = ""), e.style.zIndex = "";
207
+ }
208
+ mouseEnter(e) {
209
+ e.style.zIndex = "1", this.options.scale && (e.style.transform = "scale(1.1)"), this.options.blur && (e.style.filter = "blur(2px)");
282
210
  }
283
211
  keydownLister(e) {
284
- e.preventDefault();
285
- if (e.key === "Escape" || e.key === " ") {
286
- this.closePreview();
287
- }
288
- if (e.key === "ArrowLeft" || e.key === "ArrowRight") {
289
- this.nextPreviousImage(e.key === "ArrowRight");
290
- }
212
+ e.preventDefault(), (e.key === "Escape" || e.key === " ") && this.closePreview(), (e.key === "ArrowLeft" || e.key === "ArrowRight") && this.nextPreviousImage(e.key === "ArrowRight");
291
213
  }
292
- getButton(iconName = "close") {
293
- const button = document.createElement("button");
294
- button.innerHTML = svgs[iconName];
295
- button.addEventListener("click", () => {
296
- iconName === "close" ? this.closePreview() : this.allInstances ? this.nextPreviousImage(iconName === "next") : null;
297
- });
298
- button.classList.add("maz-zoom-btn");
299
- button.classList.add(`maz-zoom-btn--${iconName}`);
300
- return button;
214
+ getButton(e = "close") {
215
+ const t = document.createElement("button");
216
+ return t.innerHTML = P[e], t.addEventListener("click", () => {
217
+ e === "close" ? this.closePreview() : this.allInstances && this.nextPreviousImage(e === "next");
218
+ }), t.classList.add("maz-zoom-btn"), t.classList.add(`maz-zoom-btn--${e}`), t;
301
219
  }
302
220
  closePreview() {
303
- const container = document.querySelector("#MazImgPreviewFullsize");
304
- const style2 = document.querySelector("#MazPreviewStyle");
305
- const instance2 = document.querySelector(
221
+ const e = document.querySelector("#MazImgPreviewFullsize"), t = document.querySelector("#MazPreviewStyle"), s = document.querySelector(
306
222
  ".maz-zoom-img-instance.maz-is-open"
307
223
  );
308
- if (instance2)
309
- instance2.classList.remove(
310
- "maz-is-open"
311
- /* OPEN */
312
- );
313
- if (container)
314
- container.classList.remove("maz-animate");
315
- this.keyboardEventHandler(false);
316
- setTimeout(() => {
317
- if (container)
318
- container.remove();
319
- if (style2)
320
- style2.remove();
224
+ s && s.classList.remove(
225
+ "maz-is-open"
226
+ /* OPEN */
227
+ ), e && e.classList.remove("maz-animate"), this.keyboardEventHandler(!1), setTimeout(() => {
228
+ e && e.remove(), t && t.remove();
321
229
  }, 300);
322
230
  }
323
- getNewInstanceIndex(newInstanceIndex) {
324
- return newInstanceIndex < 0 ? this.allInstances.length - 1 : newInstanceIndex >= this.allInstances.length ? 0 : newInstanceIndex;
231
+ getNewInstanceIndex(e) {
232
+ return e < 0 ? this.allInstances.length - 1 : e >= this.allInstances.length ? 0 : e;
325
233
  }
326
- nextPreviousImage(isNext) {
327
- const selectNextInstance = isNext;
328
- const currentInstance = document.querySelector(
234
+ nextPreviousImage(e) {
235
+ const t = e, s = document.querySelector(
329
236
  ".maz-zoom-img-instance.maz-is-open"
330
237
  );
331
- if (currentInstance) {
332
- const currentInstanceIndex = this.allInstances.indexOf(currentInstance);
333
- const newInstanceIndex = selectNextInstance ? currentInstanceIndex + 1 : currentInstanceIndex - 1;
334
- const nextInstance = this.allInstances[this.getNewInstanceIndex(newInstanceIndex)];
335
- if (nextInstance) {
336
- this.useNextInstance(currentInstance, nextInstance);
337
- }
238
+ if (s) {
239
+ const a = this.allInstances.indexOf(s), l = t ? a + 1 : a - 1, m = this.allInstances[this.getNewInstanceIndex(l)];
240
+ m && this.useNextInstance(s, m);
338
241
  }
339
242
  }
340
- useNextInstance(currentInstance, nextInstance) {
341
- currentInstance.classList.remove(
243
+ useNextInstance(e, t) {
244
+ e.classList.remove(
342
245
  "maz-is-open"
343
246
  /* OPEN */
344
- );
345
- nextInstance.classList.add(
247
+ ), t.classList.add(
346
248
  "maz-is-open"
347
249
  /* OPEN */
348
250
  );
349
- const src = nextInstance.getAttribute("data-zoom-src");
350
- const alt = nextInstance.getAttribute("data-zoom-alt");
351
- this.wrapper.style.width = "";
352
- this.loader.hidden = false;
353
- if (src)
354
- this.img.setAttribute("src", src);
355
- if (alt)
356
- this.img.setAttribute("alt", alt);
357
- }
358
- addStyle(styleString) {
359
- const style2 = document.createElement("style");
360
- style2.id = "MazPreviewStyle";
361
- style2.textContent = styleString;
362
- document.head.append(style2);
363
- }
364
- keyboardEventHandler(add) {
365
- if (add)
251
+ const s = t.getAttribute("data-zoom-src"), a = t.getAttribute("data-zoom-alt");
252
+ this.wrapper.style.width = "", this.loader.hidden = !1, s && this.img.setAttribute("src", s), a && this.img.setAttribute("alt", a);
253
+ }
254
+ addStyle(e) {
255
+ const t = document.createElement("style");
256
+ t.id = "MazPreviewStyle", t.textContent = e, document.head.append(t);
257
+ }
258
+ keyboardEventHandler(e) {
259
+ if (e)
366
260
  return document.addEventListener("keydown", this.keydownHandler);
367
261
  document.removeEventListener("keydown", this.keydownHandler);
368
262
  }
369
- imgEventHandler(add) {
370
- if (add)
263
+ imgEventHandler(e) {
264
+ if (e)
371
265
  return this.img.addEventListener("load", this.onImgLoadedCallback);
372
266
  this.img.removeEventListener("load", this.onImgLoadedCallback);
373
267
  }
374
268
  }
375
- let instance$1;
376
- const vZoomImg = {
377
- created(el, binding) {
378
- instance$1 = new VueZoomImg(binding);
379
- instance$1.create(el);
269
+ let z;
270
+ const I = {
271
+ created(o, e) {
272
+ z = new U(e), z.create(o);
380
273
  },
381
- updated(_el, binding) {
382
- instance$1.update(binding);
274
+ updated(o, e) {
275
+ z.update(e);
383
276
  },
384
- unmounted(el) {
385
- instance$1.remove(el);
277
+ unmounted(o) {
278
+ z.remove(o);
386
279
  }
387
- };
388
- const EMPTY_PHOTO = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
389
- const DEFAULT_OPTIONS = {
280
+ }, $ = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", j = {
390
281
  baseClass: "m-lazy-img",
391
282
  loadedClass: "m-lazy-loaded",
392
283
  loadingClass: "m-lazy-loading",
393
284
  errorClass: "m-lazy-error",
394
285
  noPhotoClass: "m-lazy-no-photo",
395
- noPhoto: false,
396
- observerOnce: true,
397
- loadOnce: false,
398
- noUseErrorPhoto: false,
286
+ noPhoto: !1,
287
+ observerOnce: !0,
288
+ loadOnce: !1,
289
+ noUseErrorPhoto: !1,
399
290
  observerOptions: {
400
291
  threshold: 0.1
401
292
  }
402
293
  };
403
- class LazyImg {
404
- constructor(opts = {}) {
405
- __publicField(this, "observers", []);
406
- __publicField(this, "defaultOptions", DEFAULT_OPTIONS);
407
- __publicField(this, "options");
408
- __publicField(this, "onImgLoadedCallback");
409
- __publicField(this, "onImgErrorCallback");
410
- __publicField(this, "hasImgLoaded", false);
411
- this.options = this.buildOptions(opts);
412
- this.onImgLoadedCallback = this.imageIsLoaded.bind(this);
413
- this.onImgErrorCallback = this.imageHasError.bind(this);
294
+ class q {
295
+ constructor(e = {}) {
296
+ i(this, "observers", []);
297
+ i(this, "defaultOptions", j);
298
+ i(this, "options");
299
+ i(this, "onImgLoadedCallback");
300
+ i(this, "onImgErrorCallback");
301
+ i(this, "hasImgLoaded", !1);
302
+ this.options = this.buildOptions(e), this.onImgLoadedCallback = this.imageIsLoaded.bind(this), this.onImgErrorCallback = this.imageHasError.bind(this);
414
303
  }
415
304
  async loadErrorPhoto() {
416
- const { default: photo } = await import("./chunks/no-photography-7f2be516.mjs");
417
- return photo;
305
+ const { default: e } = await import("./chunks/no-photography-4c6c77cf.mjs");
306
+ return e;
418
307
  }
419
- buildOptions(opts) {
308
+ buildOptions(e) {
420
309
  return {
421
310
  ...this.defaultOptions,
422
- ...opts,
311
+ ...e,
423
312
  observerOptions: {
424
313
  ...this.defaultOptions.observerOptions,
425
- ...opts.observerOptions
314
+ ...e.observerOptions
426
315
  }
427
316
  };
428
317
  }
429
- removeClass(el, className) {
430
- el.classList.remove(className);
431
- }
432
- addClass(el, className) {
433
- el.classList.add(className);
434
- }
435
- removeAllStateClasses(el) {
436
- this.removeClass(el, this.options.loadedClass);
437
- this.removeClass(el, this.options.loadingClass);
438
- this.removeClass(el, this.options.errorClass);
439
- this.removeClass(el, this.options.noPhotoClass);
440
- }
441
- setBaseClass(el) {
442
- this.addClass(el, this.options.baseClass);
443
- }
444
- imageIsLoading(el) {
445
- var _a, _b;
446
- this.addClass(el, this.options.loadingClass);
447
- (_b = (_a = this.options).onLoading) == null ? void 0 : _b.call(_a, el);
448
- }
449
- imageHasNoPhoto(el) {
450
- this.removeClass(el, this.options.loadingClass);
451
- this.addClass(el, this.options.noPhotoClass);
452
- this.setDefaultPhoto(el);
453
- }
454
- imageIsLoaded(el) {
455
- var _a, _b;
456
- this.hasImgLoaded = true;
457
- this.removeClass(el, this.options.loadingClass);
458
- this.addClass(el, this.options.loadedClass);
459
- (_b = (_a = this.options).onLoaded) == null ? void 0 : _b.call(_a, el);
460
- }
461
- imageHasError(el, event) {
462
- var _a, _b;
463
- console.warn(`[maz-ui][MazLazyImg] Error while loading image`, event);
464
- this.removeClass(el, this.options.loadingClass);
465
- this.addClass(el, this.options.errorClass);
466
- (_b = (_a = this.options).onError) == null ? void 0 : _b.call(_a, el);
467
- this.setDefaultPhoto(el);
468
- }
469
- getImageUrl(el, binding) {
470
- const dataSrc = this.getImgElement(el).getAttribute("data-lazy-src");
471
- if (dataSrc)
472
- return dataSrc;
473
- binding.value;
474
- const bindingSrc = typeof binding.value === "object" ? binding.value.src : binding.value;
475
- if (!bindingSrc)
476
- console.warn(`[maz-ui][MazLazyImg] src url is not defined`);
477
- return bindingSrc;
478
- }
479
- async setPictureSourceUrls(el) {
480
- const sourceElements = el.querySelectorAll("source");
481
- if (sourceElements.length > 0) {
482
- for await (const source of sourceElements) {
483
- const srcSet = source.getAttribute("data-lazy-srcset");
484
- if (srcSet) {
485
- source.srcset = srcSet;
486
- } else {
487
- console.warn(
488
- '[maz-ui][MazLazyImg] the "[data-lazy-srcset]" attribute is not provided on "<source />"'
489
- );
490
- }
318
+ removeClass(e, t) {
319
+ e.classList.remove(t);
320
+ }
321
+ addClass(e, t) {
322
+ e.classList.add(t);
323
+ }
324
+ removeAllStateClasses(e) {
325
+ this.removeClass(e, this.options.loadedClass), this.removeClass(e, this.options.loadingClass), this.removeClass(e, this.options.errorClass), this.removeClass(e, this.options.noPhotoClass);
326
+ }
327
+ setBaseClass(e) {
328
+ this.addClass(e, this.options.baseClass);
329
+ }
330
+ imageIsLoading(e) {
331
+ var t, s;
332
+ this.addClass(e, this.options.loadingClass), (s = (t = this.options).onLoading) == null || s.call(t, e);
333
+ }
334
+ imageHasNoPhoto(e) {
335
+ this.removeClass(e, this.options.loadingClass), this.addClass(e, this.options.noPhotoClass), this.setDefaultPhoto(e);
336
+ }
337
+ imageIsLoaded(e) {
338
+ var t, s;
339
+ this.hasImgLoaded = !0, this.removeClass(e, this.options.loadingClass), this.addClass(e, this.options.loadedClass), (s = (t = this.options).onLoaded) == null || s.call(t, e);
340
+ }
341
+ imageHasError(e, t) {
342
+ var s, a;
343
+ console.warn("[maz-ui][MazLazyImg] Error while loading image", t), this.removeClass(e, this.options.loadingClass), this.addClass(e, this.options.errorClass), (a = (s = this.options).onError) == null || a.call(s, e), this.setDefaultPhoto(e);
344
+ }
345
+ getImageUrl(e, t) {
346
+ const s = this.getImgElement(e).getAttribute("data-lazy-src");
347
+ if (s)
348
+ return s;
349
+ t.value;
350
+ const a = typeof t.value == "object" ? t.value.src : t.value;
351
+ return a || console.warn("[maz-ui][MazLazyImg] src url is not defined"), a;
352
+ }
353
+ async setPictureSourceUrls(e) {
354
+ const t = e.querySelectorAll("source");
355
+ if (t.length > 0)
356
+ for await (const s of t) {
357
+ const a = s.getAttribute("data-lazy-srcset");
358
+ a ? s.srcset = a : console.warn(
359
+ '[maz-ui][MazLazyImg] the "[data-lazy-srcset]" attribute is not provided on "<source />"'
360
+ );
491
361
  }
492
- } else {
362
+ else
493
363
  console.warn(
494
364
  '[maz-ui][MazLazyImg] No "<source />" elements provided into the "<picture />" element'
495
- );
496
- this.imageHasError(el);
497
- }
365
+ ), this.imageHasError(e);
498
366
  }
499
- hasBgImgMode(binding) {
500
- return binding.arg === "bg-image";
367
+ hasBgImgMode(e) {
368
+ return e.arg === "bg-image";
501
369
  }
502
- isPictureElement(el) {
503
- return el instanceof HTMLPictureElement;
370
+ isPictureElement(e) {
371
+ return e instanceof HTMLPictureElement;
504
372
  }
505
- getImgElement(el) {
506
- const isPictureElement = this.isPictureElement(el);
507
- return isPictureElement ? el.querySelector("img") : el;
373
+ getImgElement(e) {
374
+ return this.isPictureElement(e) ? e.querySelector("img") : e;
508
375
  }
509
- async setDefaultPhoto(el) {
376
+ async setDefaultPhoto(e) {
510
377
  if (this.options.noUseErrorPhoto)
511
378
  return;
512
- const errorPhoto = this.options.errorPhoto ?? await this.loadErrorPhoto();
513
- const sourceElements = el.querySelectorAll("source");
514
- if (sourceElements.length > 0) {
515
- for await (const source of sourceElements) {
516
- source.srcset = errorPhoto;
517
- }
518
- } else {
519
- this.setImgSrc(el, errorPhoto);
379
+ const t = this.options.errorPhoto ?? await this.loadErrorPhoto(), s = e.querySelectorAll("source");
380
+ if (s.length > 0)
381
+ for await (const a of s)
382
+ a.srcset = t;
383
+ else
384
+ this.setImgSrc(e, t);
385
+ }
386
+ addEventListenerToImg(e) {
387
+ const t = this.getImgElement(e);
388
+ t.addEventListener("load", () => this.onImgLoadedCallback(e), {
389
+ once: !0
390
+ }), t.addEventListener("error", (s) => this.onImgErrorCallback(e, s), { once: !0 });
391
+ }
392
+ async loadImage(e, t) {
393
+ if (this.imageIsLoading(e), this.isPictureElement(e))
394
+ this.addEventListenerToImg(e), await this.setPictureSourceUrls(e);
395
+ else {
396
+ const s = this.getImageUrl(e, t);
397
+ if (!s)
398
+ return this.imageHasError(e);
399
+ this.hasBgImgMode(t) ? (e.style.backgroundImage = `url('${s}')`, this.imageIsLoaded(e)) : (this.addEventListenerToImg(e), this.setImgSrc(e, s));
520
400
  }
521
401
  }
522
- addEventListenerToImg(el) {
523
- const imgElement = this.getImgElement(el);
524
- imgElement.addEventListener("load", () => this.onImgLoadedCallback(el), {
525
- once: true
526
- });
527
- imgElement.addEventListener("error", (err) => this.onImgErrorCallback(el, err), { once: true });
528
- }
529
- async loadImage(el, binding) {
530
- this.imageIsLoading(el);
531
- if (this.isPictureElement(el)) {
532
- this.addEventListenerToImg(el);
533
- await this.setPictureSourceUrls(el);
534
- } else {
535
- const imageUrl = this.getImageUrl(el, binding);
536
- if (!imageUrl)
537
- return this.imageHasError(el);
538
- if (this.hasBgImgMode(binding)) {
539
- el.style.backgroundImage = `url('${imageUrl}')`;
540
- this.imageIsLoaded(el);
541
- } else {
542
- this.addEventListenerToImg(el);
543
- this.setImgSrc(el, imageUrl);
544
- }
545
- }
402
+ setImgSrc(e, t) {
403
+ const s = this.getImgElement(e);
404
+ s.src = t;
546
405
  }
547
- setImgSrc(el, src) {
548
- const imgElement = this.getImgElement(el);
549
- imgElement.src = src;
550
- }
551
- handleIntersectionObserver(el, binding, entries, observer) {
552
- var _a, _b;
553
- this.observers.push(observer);
554
- for (const entry of entries) {
555
- if (entry.isIntersecting) {
556
- (_b = (_a = this.options).onIntersecting) == null ? void 0 : _b.call(_a, entry.target);
557
- if (this.options.observerOnce) {
558
- observer.unobserve(el);
559
- }
560
- if (this.options.loadOnce && this.hasImgLoaded)
406
+ handleIntersectionObserver(e, t, s, a) {
407
+ var l, m;
408
+ this.observers.push(a);
409
+ for (const c of s)
410
+ if (c.isIntersecting) {
411
+ if ((m = (l = this.options).onIntersecting) == null || m.call(l, c.target), this.options.observerOnce && a.unobserve(e), this.options.loadOnce && this.hasImgLoaded)
561
412
  return;
562
- this.loadImage(el, binding);
413
+ this.loadImage(e, t);
563
414
  }
564
- }
565
415
  }
566
- createObserver(el, binding) {
567
- const observerCallback = (entries, intersectionObserver) => {
568
- this.handleIntersectionObserver(el, binding, entries, intersectionObserver);
569
- };
570
- const observerOptions = this.options.observerOptions;
571
- const observer = new IntersectionObserver(observerCallback, observerOptions);
572
- observer.observe(el);
573
- }
574
- async imageHandler(el, binding, type) {
575
- if (type === "update") {
576
- for await (const observer of this.observers)
577
- observer.unobserve(el);
578
- }
579
- if (window.IntersectionObserver) {
580
- this.createObserver(el, binding);
581
- } else {
582
- this.loadImage(el, binding);
583
- }
416
+ createObserver(e, t) {
417
+ const s = (m, c) => {
418
+ this.handleIntersectionObserver(e, t, m, c);
419
+ }, a = this.options.observerOptions;
420
+ new IntersectionObserver(s, a).observe(e);
421
+ }
422
+ async imageHandler(e, t, s) {
423
+ if (s === "update")
424
+ for await (const a of this.observers)
425
+ a.unobserve(e);
426
+ window.IntersectionObserver ? this.createObserver(e, t) : this.loadImage(e, t);
584
427
  }
585
- async bindUpdateHandler(el, binding, type) {
428
+ async bindUpdateHandler(e, t, s) {
586
429
  if (this.options.noPhoto)
587
- return this.imageHasNoPhoto(el);
588
- await this.imageHandler(el, binding, type);
430
+ return this.imageHasNoPhoto(e);
431
+ await this.imageHandler(e, t, s);
589
432
  }
590
- async add(el, binding) {
591
- if (this.hasBgImgMode(binding) && this.isPictureElement(el)) {
433
+ async add(e, t) {
434
+ if (this.hasBgImgMode(t) && this.isPictureElement(e))
592
435
  throw new Error(`[MazLazyImg] You can't use the "bg-image" mode with "<picture />" element`);
593
- }
594
- setTimeout(() => this.setBaseClass(el), 0);
595
- if (!el.getAttribute("src"))
596
- this.setImgSrc(el, EMPTY_PHOTO);
597
- await this.bindUpdateHandler(el, binding, "bind");
598
- }
599
- async update(el, binding) {
600
- if (binding.value !== binding.oldValue) {
601
- this.hasImgLoaded = false;
602
- this.removeAllStateClasses(el);
603
- await this.bindUpdateHandler(el, binding, "update");
604
- }
436
+ setTimeout(() => this.setBaseClass(e), 0), e.getAttribute("src") || this.setImgSrc(e, $), await this.bindUpdateHandler(e, t, "bind");
605
437
  }
606
- remove(el, binding) {
607
- this.hasImgLoaded = false;
608
- if (this.hasBgImgMode(binding))
609
- el.style.backgroundImage = "";
610
- this.removeAllStateClasses(el);
611
- for (const observer of this.observers)
612
- observer.unobserve(el);
438
+ async update(e, t) {
439
+ t.value !== t.oldValue && (this.hasImgLoaded = !1, this.removeAllStateClasses(e), await this.bindUpdateHandler(e, t, "update"));
440
+ }
441
+ remove(e, t) {
442
+ this.hasImgLoaded = !1, this.hasBgImgMode(t) && (e.style.backgroundImage = ""), this.removeAllStateClasses(e);
443
+ for (const s of this.observers)
444
+ s.unobserve(e);
613
445
  this.observers = [];
614
446
  }
615
447
  }
616
- let instance;
617
- const vLazyImg = {
618
- created(el, binding) {
619
- const options = typeof binding.value === "object" ? binding.value : {};
620
- instance = new LazyImg(options);
621
- instance.add(el, binding);
448
+ let f;
449
+ const D = {
450
+ created(o, e) {
451
+ const t = typeof e.value == "object" ? e.value : {};
452
+ f = new q(t), f.add(o, e);
622
453
  },
623
- updated(el, binding) {
624
- instance.update(el, binding);
454
+ updated(o, e) {
455
+ f.update(o, e);
625
456
  },
626
- unmounted(el, binding) {
627
- instance.remove(el, binding);
457
+ unmounted(o, e) {
458
+ f.remove(o, e);
628
459
  }
629
- };
630
- const _hoisted_1 = { class: "m-gallery__wrapper maz-flex maz-flex-1" };
631
- const _hoisted_2 = ["alt"];
632
- const _hoisted_3 = {
460
+ }, G = { class: "m-gallery__wrapper maz-flex maz-flex-1" }, V = ["alt"], Z = {
633
461
  key: 0,
634
462
  class: "m-gallery__remaining-layer maz-flex maz-bg-overlay maz-flex-center"
635
- };
636
- const _hoisted_4 = { class: "maz-text-2xl maz-text-white" };
637
- const _sfc_main = /* @__PURE__ */ defineComponent({
463
+ }, F = { class: "maz-text-2xl maz-text-white" }, W = /* @__PURE__ */ B({
638
464
  __name: "MazGallery",
639
465
  props: {
640
466
  /**
@@ -647,181 +473,149 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
647
473
  /** Images count shown (max: 5) */
648
474
  imagesShownCount: { type: Number, default: 5 },
649
475
  /** Remove transparent layer with the remain count (ex: +2) */
650
- noRemaining: { type: Boolean, default: false },
476
+ noRemaining: { type: Boolean, default: !1 },
651
477
  /** Height of gallery */
652
478
  height: { type: [Number, String], default: 150 },
653
479
  /** Remove default height */
654
- noHeight: { type: Boolean, default: false },
480
+ noHeight: { type: Boolean, default: !1 },
655
481
  /** Width of gallery */
656
482
  width: { type: [Number, String], default: "100%" },
657
483
  /** Remove default width */
658
- noWidth: { type: Boolean, default: false },
484
+ noWidth: { type: Boolean, default: !1 },
659
485
  /** Disable the border radius of the gallery */
660
- noRadius: { type: Boolean, default: false },
486
+ noRadius: { type: Boolean, default: !1 },
661
487
  /** Disable full size display when clicking on image */
662
- noZoom: { type: Boolean, default: false },
488
+ noZoom: { type: Boolean, default: !1 },
663
489
  /** Layer with photography icon when no images is provided */
664
- hasEmptyLayer: { type: Boolean, default: true },
490
+ hasEmptyLayer: { type: Boolean, default: !0 },
665
491
  /** Lazy load image - if false, images are directly loaded */
666
- lazy: { type: Boolean, default: true },
492
+ lazy: { type: Boolean, default: !0 },
667
493
  /** Disable blur effect on image hover */
668
- blur: { type: Boolean, default: true },
494
+ blur: { type: Boolean, default: !0 },
669
495
  /** Disable scale animation effect on image hover */
670
- scale: { type: Boolean, default: true },
496
+ scale: { type: Boolean, default: !0 },
671
497
  /** Choose color of borders between images - Should be a CSS color or CSS variable - Ex: `#000` or `var(--maz-color-bg-light)` */
672
498
  separatorColor: { type: String, default: "transparent" }
673
499
  },
674
- setup(__props) {
675
- useCssVars((_ctx) => ({
676
- "7a2c056e": __props.separatorColor
500
+ setup(o) {
501
+ S((n) => ({
502
+ "7a2c056e": o.separatorColor
677
503
  }));
678
- const NoPhotographyIcon = defineAsyncComponent(() => import("./chunks/no-photography-b0d08d6f.mjs"));
679
- const props = __props;
680
- onBeforeMount(() => {
681
- if (props.imagesShownCount > 5)
682
- console.warn('[MazUI](m-gallery) The maximum of "images-shown-count" is 5');
504
+ const e = O(() => import("./chunks/no-photography-be94ddda.mjs")), t = o;
505
+ M(() => {
506
+ t.imagesShownCount > 5 && console.warn('[MazUI](m-gallery) The maximum of "images-shown-count" is 5');
683
507
  });
684
- const sizeStyle = computed(() => {
685
- const noWidth = props.noWidth;
686
- const width = props.width;
687
- const noHeight = props.noHeight;
688
- const height = props.height;
508
+ const s = p(() => {
509
+ const n = t.noWidth, h = t.width, d = t.noHeight, r = t.height;
689
510
  return {
690
- ...noWidth ? {} : {
691
- flex: "0 0 " + typeof width === "number" ? `${width}px` : width,
692
- width: typeof width === "number" ? `${width}px` : width
511
+ ...n ? {} : {
512
+ flex: "0 0 " + typeof h == "number" ? `${h}px` : h,
513
+ width: typeof h == "number" ? `${h}px` : h
693
514
  },
694
- ...noHeight ? {} : {
695
- height: typeof height === "number" ? `${height}px` : `${height}`,
696
- minHeight: typeof height === "number" ? `${height}px` : `${height}`
515
+ ...d ? {} : {
516
+ height: typeof r == "number" ? `${r}px` : `${r}`,
517
+ minHeight: typeof r == "number" ? `${r}px` : `${r}`
697
518
  }
698
519
  };
699
- });
700
- const imagesCount = computed(() => {
701
- return props.imagesShownCount <= 5 ? props.imagesShownCount : 5;
702
- });
703
- const numberImagesRemaining = computed(() => {
704
- return props.images.length - (props.images.length < imagesCount.value ? props.images.length : imagesCount.value);
705
- });
706
- const imagesNormalized = computed(() => {
707
- return props.images.map(
708
- (image) => typeof image === "object" ? { ...image, thumbnail: image.thumbnail ?? image.src } : { src: image, thumbnail: image, alt: void 0 }
709
- );
710
- });
711
- const imagesShown = computed(() => {
712
- return imagesNormalized.value.slice(0, imagesCount.value);
713
- });
714
- const imagesHidden = computed(() => {
715
- return imagesNormalized.value.slice(imagesCount.value, props.images.length);
716
- });
717
- const shouldHaveRemainingLayer = (index) => {
718
- return numberImagesRemaining.value && index + 1 === imagesShown.value.length && !props.noRemaining;
719
- };
720
- return (_ctx, _cache) => {
721
- return __props.images.length > 0 || __props.hasEmptyLayer ? (openBlock(), createElementBlock(
722
- "div",
723
- {
724
- key: 0,
725
- class: normalizeClass(["m-gallery maz-flex", { "maz-rounded": !__props.noRadius }]),
726
- style: normalizeStyle([sizeStyle.value])
727
- },
728
- [
729
- createElementVNode("section", _hoisted_1, [
730
- (openBlock(true), createElementBlock(
731
- Fragment,
732
- null,
733
- renderList(imagesShown.value, (image, i) => {
734
- return openBlock(), createElementBlock(
735
- "figure",
736
- {
737
- key: i,
738
- class: normalizeClass(["m-gallery__item !maz-my-0 maz-flex maz-flex-center", [`m-gallery__item--${i + 1}`]])
739
- },
740
- [
741
- withDirectives(createElementVNode("img", {
742
- class: "m-gallery__item__image maz-flex-1",
743
- src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
744
- alt: image.alt,
745
- loading: "lazy"
746
- }, null, 8, _hoisted_2), [
747
- [unref(vLazyImg), { src: image.thumbnail, disabled: !__props.lazy }, "bg-image"],
748
- [unref(vZoomImg), {
749
- src: image.src,
750
- alt: image.alt,
751
- disabled: __props.noZoom || shouldHaveRemainingLayer(i),
752
- blur: __props.blur,
753
- scale: __props.scale
754
- }]
755
- ]),
756
- shouldHaveRemainingLayer(i) ? withDirectives((openBlock(), createElementBlock("div", _hoisted_3, [
757
- createElementVNode(
758
- "span",
759
- _hoisted_4,
760
- "+" + toDisplayString(numberImagesRemaining.value),
761
- 1
762
- /* TEXT */
763
- )
764
- ])), [
765
- [unref(vZoomImg), {
766
- src: image.src,
767
- alt: image.alt,
768
- disabled: __props.noZoom,
769
- blur: false,
770
- scale: __props.scale
771
- }]
772
- ]) : createCommentVNode("v-if", true)
773
- ],
774
- 2
775
- /* CLASS */
776
- );
777
- }),
778
- 128
779
- /* KEYED_FRAGMENT */
780
- )),
781
- __props.hasEmptyLayer && __props.images.length === 0 ? (openBlock(), createElementBlock(
782
- "div",
520
+ }), a = p(() => t.imagesShownCount <= 5 ? t.imagesShownCount : 5), l = p(() => t.images.length - (t.images.length < a.value ? t.images.length : a.value)), m = p(() => t.images.map(
521
+ (n) => typeof n == "object" ? { ...n, thumbnail: n.thumbnail ?? n.src } : { src: n, thumbnail: n, alt: void 0 }
522
+ )), c = p(() => m.value.slice(0, a.value)), k = p(() => m.value.slice(a.value, t.images.length)), A = (n) => l.value && n + 1 === c.value.length && !t.noRemaining;
523
+ return (n, h) => o.images.length > 0 || o.hasEmptyLayer ? (u(), g(
524
+ "div",
525
+ {
526
+ key: 0,
527
+ class: y(["m-gallery maz-flex", { "maz-rounded": !o.noRadius }]),
528
+ style: E([s.value])
529
+ },
530
+ [
531
+ b("section", G, [
532
+ (u(!0), g(
533
+ x,
534
+ null,
535
+ C(c.value, (d, r) => (u(), g(
536
+ "figure",
783
537
  {
784
- key: 0,
785
- class: normalizeClass(["empty-layer maz-flex maz-w-full maz-bg-color-light maz-text-normal maz-flex-center", { "maz-rounded-xl": !__props.noRadius }]),
786
- style: normalizeStyle([sizeStyle.value])
538
+ key: r,
539
+ class: y(["m-gallery__item !maz-my-0 maz-flex maz-flex-center", [`m-gallery__item--${r + 1}`]])
787
540
  },
788
541
  [
789
- createVNode(unref(NoPhotographyIcon), { class: "maz-h-8 maz-w-8" })
542
+ w(b("img", {
543
+ class: "m-gallery__item__image maz-flex-1",
544
+ src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
545
+ alt: d.alt,
546
+ loading: "lazy"
547
+ }, null, 8, V), [
548
+ [v(D), { src: d.thumbnail, disabled: !o.lazy }, "bg-image"],
549
+ [v(I), {
550
+ src: d.src,
551
+ alt: d.alt,
552
+ disabled: o.noZoom || A(r),
553
+ blur: o.blur,
554
+ scale: o.scale
555
+ }]
556
+ ]),
557
+ A(r) ? w((u(), g("div", Z, [
558
+ b(
559
+ "span",
560
+ F,
561
+ "+" + T(l.value),
562
+ 1
563
+ /* TEXT */
564
+ )
565
+ ])), [
566
+ [v(I), {
567
+ src: d.src,
568
+ alt: d.alt,
569
+ disabled: o.noZoom,
570
+ blur: !1,
571
+ scale: o.scale
572
+ }]
573
+ ]) : L("v-if", !0)
790
574
  ],
791
- 6
792
- /* CLASS, STYLE */
793
- )) : createCommentVNode("v-if", true)
794
- ]),
795
- (openBlock(true), createElementBlock(
796
- Fragment,
797
- null,
798
- renderList(imagesHidden.value, (image, i) => {
799
- return withDirectives((openBlock(), createElementBlock("div", {
800
- key: i,
801
- class: "m-gallery__hidden"
802
- })), [
803
- [unref(vZoomImg), { src: image.src, disabled: __props.noZoom }]
804
- ]);
805
- }),
575
+ 2
576
+ /* CLASS */
577
+ ))),
806
578
  128
807
579
  /* KEYED_FRAGMENT */
808
- ))
809
- ],
810
- 6
811
- /* CLASS, STYLE */
812
- )) : createCommentVNode("v-if", true);
813
- };
580
+ )),
581
+ o.hasEmptyLayer && o.images.length === 0 ? (u(), g(
582
+ "div",
583
+ {
584
+ key: 0,
585
+ class: y(["empty-layer maz-flex maz-w-full maz-bg-color-light maz-text-normal maz-flex-center", { "maz-rounded-xl": !o.noRadius }]),
586
+ style: E([s.value])
587
+ },
588
+ [
589
+ N(v(e), { class: "maz-h-8 maz-w-8" })
590
+ ],
591
+ 6
592
+ /* CLASS, STYLE */
593
+ )) : L("v-if", !0)
594
+ ]),
595
+ (u(!0), g(
596
+ x,
597
+ null,
598
+ C(k.value, (d, r) => w((u(), g("div", {
599
+ key: r,
600
+ class: "m-gallery__hidden"
601
+ })), [
602
+ [v(I), { src: d.src, disabled: o.noZoom }]
603
+ ])),
604
+ 128
605
+ /* KEYED_FRAGMENT */
606
+ ))
607
+ ],
608
+ 6
609
+ /* CLASS, STYLE */
610
+ )) : L("v-if", !0);
814
611
  }
815
612
  });
816
- const MazGallery_vue_vue_type_style_index_0_scoped_4e6fbc0c_lang = "";
817
- const _export_sfc = (sfc, props) => {
818
- const target = sfc.__vccOpts || sfc;
819
- for (const [key, val] of props) {
820
- target[key] = val;
821
- }
822
- return target;
823
- };
824
- const MazGallery = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4e6fbc0c"]]);
613
+ const Q = (o, e) => {
614
+ const t = o.__vccOpts || o;
615
+ for (const [s, a] of e)
616
+ t[s] = a;
617
+ return t;
618
+ }, X = /* @__PURE__ */ Q(W, [["__scopeId", "data-v-4e6fbc0c"]]);
825
619
  export {
826
- MazGallery as default
620
+ X as default
827
621
  };