maz-ui 4.7.5 → 4.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/dist/chunks/MazAccordion.CKnz73h4.js +1 -0
  2. package/dist/chunks/MazAlert.B8hE7wet.js +1 -0
  3. package/dist/chunks/MazAnimatedCounter.GLLYbZAz.js +1 -0
  4. package/dist/chunks/MazAnimatedElement._8NY8WgC.js +1 -0
  5. package/dist/chunks/MazAnimatedText.BSZ8FNf-.js +1 -0
  6. package/dist/chunks/MazAvatar.vO5VNPi8.js +1 -0
  7. package/dist/chunks/MazBackdrop.Cjbwi8-V.js +1 -0
  8. package/dist/chunks/MazBadge.BBZJgHXm.js +1 -0
  9. package/dist/chunks/MazBottomSheet.WgZ6qobx.js +1 -0
  10. package/dist/chunks/MazBtn.Cc9C1v2l.js +1 -0
  11. package/dist/chunks/MazBtnGroup.3B1XcqWM.js +1 -0
  12. package/dist/chunks/MazCard.YYC0LaHY.js +1 -0
  13. package/dist/chunks/MazCardSpotlight.SpZF61hl.js +1 -0
  14. package/dist/chunks/MazCarousel.1NT4jcvR.js +1 -0
  15. package/dist/chunks/MazChart.CDZ2PBTC.js +1 -0
  16. package/dist/chunks/MazCheckbox.DurIbKdf.js +1 -0
  17. package/dist/chunks/MazChecklist.D9ezwGpQ.js +1 -0
  18. package/dist/chunks/MazCircularProgressBar.rATx_hD9.js +1 -0
  19. package/dist/chunks/MazContainer.zXcfMOs-.js +1 -0
  20. package/dist/chunks/MazDatePicker.KUP34cbV.js +1 -0
  21. package/dist/chunks/MazDialog.CtKF3Xzo.js +1 -0
  22. package/dist/chunks/MazDialogConfirm.CAAHeBPE.js +1 -0
  23. package/dist/chunks/MazDrawer.Dc_RGG8a.js +1 -0
  24. package/dist/chunks/MazDropdown.2DUcivzO.js +1 -0
  25. package/dist/chunks/MazDropzone.CiWiPcFM.js +1 -0
  26. package/dist/chunks/MazExpandAnimation.CMMwtuQA.js +1 -0
  27. package/dist/chunks/MazFullscreenLoader.BIVRcZJ8.js +1 -0
  28. package/dist/chunks/MazGallery.CEmGy0K9.js +1 -0
  29. package/dist/chunks/MazIcon.ZWAk25ZX.js +1 -0
  30. package/dist/chunks/MazInput.DJjWLaKg.js +1 -0
  31. package/dist/chunks/MazInputCode.DKnl3i-X.js +1 -0
  32. package/dist/chunks/MazInputNumber.B42Mn-9h.js +1 -0
  33. package/dist/chunks/MazInputPhoneNumber.CLivThtK.js +1 -0
  34. package/dist/chunks/MazInputPrice.BeL-M944.js +1 -0
  35. package/dist/chunks/MazInputTags.CIVT9F6Q.js +1 -0
  36. package/dist/chunks/MazLazyImg.-EMwandx.js +1 -0
  37. package/dist/chunks/MazLink.BOpxMATj.js +1 -0
  38. package/dist/chunks/MazLoadingBar.C86AX2Tk.js +1 -0
  39. package/dist/chunks/MazPagination.CNNKXBsg.js +1 -0
  40. package/dist/chunks/MazPickerCalendarDays.CSZZbk5Z.js +1 -0
  41. package/dist/chunks/MazPickerCalendarGrid.DrUHBH6-.js +1 -0
  42. package/dist/chunks/MazPickerContainer.BZ74M74V.js +1 -0
  43. package/dist/chunks/MazPopover.Co8BEopX.js +1 -0
  44. package/dist/chunks/MazPullToRefresh.DMtb6Oa3.js +1 -0
  45. package/dist/chunks/MazRadio.75ipjTw2.js +1 -0
  46. package/dist/chunks/MazRadioButtons.DenHCgB3.js +1 -0
  47. package/dist/chunks/MazReadMore.CDXacQIw.js +1 -0
  48. package/dist/chunks/MazReadingProgressBar.828Y0mxA.js +1 -0
  49. package/dist/chunks/MazSelect.yYFAbBb5.js +1 -0
  50. package/dist/chunks/MazSelectCountry.DvVgk2es.js +1 -0
  51. package/dist/chunks/MazSkeleton.BewTYJC2.js +1 -0
  52. package/dist/chunks/MazSlider.BS5QHWK6.js +1 -0
  53. package/dist/chunks/MazSpinner.D3NN2pow.js +1 -0
  54. package/dist/chunks/MazStepper.DTu8HG9T.js +1 -0
  55. package/dist/chunks/MazSwitch.Dvmj-rTW.js +1 -0
  56. package/dist/chunks/MazTable.DnOehvN6.js +1 -0
  57. package/dist/chunks/MazTableCell.xbm2NGWL.js +1 -0
  58. package/dist/chunks/MazTableRow.B5dJiXk1.js +1 -0
  59. package/dist/chunks/MazTableTitle.DNA_1mCy.js +1 -0
  60. package/dist/chunks/MazTabs.-0-YP3QQ.js +1 -0
  61. package/dist/chunks/MazTabsBar.D2JVKMS7.js +1 -0
  62. package/dist/chunks/MazTabsContent.C9omK25X.js +1 -0
  63. package/dist/chunks/MazTabsContentItem.mJEAS5R8.js +1 -0
  64. package/dist/chunks/MazTextarea.BliEP5G5.js +1 -0
  65. package/dist/chunks/MazUiProvider.BgN8V0lD.js +1 -0
  66. package/dist/chunks/_plugin-vue_export-helper.ChmETRGw.js +1 -0
  67. package/dist/chunks/dialog.DexeIC3K.js +1 -0
  68. package/dist/chunks/dom-events.BPrKJiCz.js +1 -0
  69. package/dist/chunks/resolveLinkComponent.DAc3sqGH.js +1 -0
  70. package/dist/chunks/toast.UQ8RRuT9.js +1 -0
  71. package/dist/chunks/types.DDbvTVqf.js +1 -0
  72. package/dist/chunks/useMazInputPhoneNumber.B_qQ0ldP.js +1 -0
  73. package/dist/chunks/utils.B8bfGQxN.js +1 -0
  74. package/dist/chunks/vFullscreenImg.CZeRh3mw.js +1 -0
  75. package/dist/chunks/vLazyImg.CXmd3Lp0.js +1 -0
  76. package/dist/chunks/vZoomImg.CaAHb98S.js +124 -0
  77. package/dist/components/MazAccordion.js +1 -86
  78. package/dist/components/MazAlert.js +1 -85
  79. package/dist/components/MazAnimatedCounter.js +1 -73
  80. package/dist/components/MazAnimatedElement.js +1 -44
  81. package/dist/components/MazAnimatedText.js +1 -103
  82. package/dist/components/MazAvatar.js +1 -125
  83. package/dist/components/MazBackdrop.js +1 -163
  84. package/dist/components/MazBadge.js +1 -29
  85. package/dist/components/MazBottomSheet.js +1 -55
  86. package/dist/components/MazBtn.js +1 -109
  87. package/dist/components/MazBtnGroup.js +1 -44
  88. package/dist/components/MazCard.js +1 -184
  89. package/dist/components/MazCardSpotlight.js +1 -81
  90. package/dist/components/MazCarousel.js +1 -104
  91. package/dist/components/MazChart.js +1 -4
  92. package/dist/components/MazCheckbox.js +1 -128
  93. package/dist/components/MazChecklist.js +1 -133
  94. package/dist/components/MazCircularProgressBar.js +1 -131
  95. package/dist/components/MazContainer.js +1 -71
  96. package/dist/components/MazDatePicker/MazPickerCalendar.js +1 -113
  97. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarDays.js +1 -19
  98. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarGrid.js +1 -181
  99. package/dist/components/MazDatePicker/MazPickerCalendarMonth/MazPickerCalendarMonth.js +1 -75
  100. package/dist/components/MazDatePicker/MazPickerCalendarSwitcher.js +1 -90
  101. package/dist/components/MazDatePicker/MazPickerContainer.js +1 -116
  102. package/dist/components/MazDatePicker/MazPickerHeader.js +1 -126
  103. package/dist/components/MazDatePicker/MazPickerMonthSwitcher.js +1 -82
  104. package/dist/components/MazDatePicker/MazPickerShortcuts.js +1 -55
  105. package/dist/components/MazDatePicker/MazPickerTime.js +1 -178
  106. package/dist/components/MazDatePicker/MazPickerYearSwitcher.js +1 -95
  107. package/dist/components/MazDatePicker.js +1 -466
  108. package/dist/components/MazDatePicker.vue.d.ts +2 -6
  109. package/dist/components/MazDialog.js +1 -115
  110. package/dist/components/MazDialog.vue.d.ts +2 -6
  111. package/dist/components/MazDialogConfirm.js +1 -6
  112. package/dist/components/MazDialogConfirm.vue.d.ts +2 -6
  113. package/dist/components/MazDrawer.js +1 -70
  114. package/dist/components/MazDropdown.js +1 -277
  115. package/dist/components/MazDropdown.vue.d.ts +2 -6
  116. package/dist/components/MazDropzone.js +1 -533
  117. package/dist/components/MazExpandAnimation.js +1 -46
  118. package/dist/components/MazFullscreenLoader.js +1 -38
  119. package/dist/components/MazGallery.js +1 -105
  120. package/dist/components/MazIcon.js +1 -114
  121. package/dist/components/MazInput.js +1 -256
  122. package/dist/components/MazInputCode.js +1 -152
  123. package/dist/components/MazInputNumber.js +1 -152
  124. package/dist/components/MazInputPhoneNumber/PhoneInput.js +1 -114
  125. package/dist/components/MazInputPhoneNumber.js +1 -253
  126. package/dist/components/MazInputPrice.js +1 -4
  127. package/dist/components/MazInputTags.js +1 -145
  128. package/dist/components/MazLazyImg.js +1 -62
  129. package/dist/components/MazLink.js +1 -80
  130. package/dist/components/MazLoadingBar.js +1 -24
  131. package/dist/components/MazPagination.js +1 -184
  132. package/dist/components/MazPopover.js +1 -326
  133. package/dist/components/MazPullToRefresh.js +1 -145
  134. package/dist/components/MazRadio.js +1 -103
  135. package/dist/components/MazRadioButtons.js +1 -135
  136. package/dist/components/MazReadMore.js +1 -110
  137. package/dist/components/MazReadingProgressBar.js +1 -68
  138. package/dist/components/MazSelect.js +1 -413
  139. package/dist/components/MazSelectCountry.js +1 -192
  140. package/dist/components/MazSkeleton.js +1 -50
  141. package/dist/components/MazSlider.js +1 -205
  142. package/dist/components/MazSpinner.js +1 -27
  143. package/dist/components/MazStepper.js +1 -170
  144. package/dist/components/MazSwitch.js +1 -4
  145. package/dist/components/MazTable.js +1 -8
  146. package/dist/components/MazTableCell.js +1 -18
  147. package/dist/components/MazTableRow.js +1 -26
  148. package/dist/components/MazTableTitle.js +1 -18
  149. package/dist/components/MazTabs.js +1 -4
  150. package/dist/components/MazTabsBar.js +1 -138
  151. package/dist/components/MazTabsContent.js +1 -4
  152. package/dist/components/MazTabsContentItem.js +1 -37
  153. package/dist/components/MazTextarea.js +1 -147
  154. package/dist/components/MazUiProvider.js +1 -4
  155. package/dist/components/index.js +1 -127
  156. package/dist/composables/index.js +1 -44
  157. package/dist/composables/useAos.js +1 -7
  158. package/dist/composables/useBreakpoints.js +1 -34
  159. package/dist/composables/useDialog.js +1 -7
  160. package/dist/composables/useDisplayNames.js +1 -111
  161. package/dist/composables/useDropzone.js +1 -66
  162. package/dist/composables/useFormField.js +1 -101
  163. package/dist/composables/useFormValidator.js +1 -163
  164. package/dist/composables/useFreezeValue.js +1 -8
  165. package/dist/composables/useIdleTimeout.js +1 -10
  166. package/dist/composables/useInjectStrict.js +1 -10
  167. package/dist/composables/useInstanceUniqId.js +1 -12
  168. package/dist/composables/useMountComponent.js +1 -16
  169. package/dist/composables/useMutationObserver.js +1 -37
  170. package/dist/composables/useReadingTime.js +1 -33
  171. package/dist/composables/useStringMatching.js +1 -42
  172. package/dist/composables/useSwipe.js +1 -26
  173. package/dist/composables/useTimer.js +1 -36
  174. package/dist/composables/useToast.js +1 -14
  175. package/dist/composables/useUserVisibility.js +1 -10
  176. package/dist/composables/useWait.js +1 -7
  177. package/dist/composables/useWindowSize.js +1 -21
  178. package/dist/directives/index.js +1 -19
  179. package/dist/directives/vClickOutside.js +1 -104
  180. package/dist/directives/vFullscreenImg.js +1 -10
  181. package/dist/directives/vLazyImg.js +1 -23
  182. package/dist/directives/vTooltip.js +1 -161
  183. package/dist/directives/vZoomImg.js +1 -286
  184. package/dist/index.js +1 -1
  185. package/dist/plugins/aos.js +1 -89
  186. package/dist/plugins/dialog.js +1 -61
  187. package/dist/plugins/index.js +1 -17
  188. package/dist/plugins/maz-ui.js +1 -11
  189. package/dist/plugins/toast.js +1 -261
  190. package/dist/plugins/wait.js +1 -43
  191. package/dist/resolvers/MazComponentsResolver.js +1 -18
  192. package/dist/resolvers/MazDirectivesResolver.js +1 -14
  193. package/dist/resolvers/MazModulesResolver.js +1 -76
  194. package/dist/resolvers/index.js +1 -8
  195. package/dist/tailwindcss/index.js +1 -20
  196. package/dist/tailwindcss/tailwind.config.js +1 -35
  197. package/dist/tailwindcss/utils/colors.js +1 -25
  198. package/dist/tailwindcss/variables/breakpoints.js +1 -29
  199. package/dist/tailwindcss/variables/colors.js +1 -33
  200. package/dist/tailwindcss/variables/design-tokens.js +1 -42
  201. package/dist/tailwindcss/variables/utilities.js +1 -20
  202. package/dist/tailwindcss/variables/z-indexes.js +1 -17
  203. package/package.json +12 -13
  204. package/dist/chunks/MazChart.vue_vue_type_script_setup_true_lang.DpG9UYdm.js +0 -50
  205. package/dist/chunks/MazDialogConfirm.vue_vue_type_script_setup_true_lang.BB2rYkwY.js +0 -215
  206. package/dist/chunks/MazInputPrice.vue_vue_type_script_setup_true_lang.DcNkyw1C.js +0 -77
  207. package/dist/chunks/MazSwitch.vue_vue_type_style_index_0_lang.lYfYsI0R.js +0 -84
  208. package/dist/chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js +0 -517
  209. package/dist/chunks/MazTabs.vue_vue_type_script_setup_true_lang.CiIFxs7J.js +0 -28
  210. package/dist/chunks/MazTabsContent.vue_vue_type_script_setup_true_lang.MO7zA8LZ.js +0 -26
  211. package/dist/chunks/MazUiProvider.vue_vue_type_script_setup_true_lang.DtnM1DOn.js +0 -34
  212. package/dist/chunks/_plugin-vue_export-helper.B--vMWp3.js +0 -9
  213. package/dist/chunks/dom-events.DTx6Kblx.js +0 -368
  214. package/dist/chunks/fullscreen-img.directive.BJieSSIt.js +0 -321
  215. package/dist/chunks/lazy-img.directive.GRfYbidn.js +0 -174
  216. package/dist/chunks/resolveLinkComponent.CKR2McYy.js +0 -8
  217. package/dist/chunks/types.D0Bp_UhS.js +0 -6
  218. package/dist/chunks/useMazInputPhoneNumber.Os-2y9bz.js +0 -157
  219. package/dist/chunks/utils.D89Q5cCP.js +0 -207
  220. /package/dist/assets/{fullscreen-img.DFp1SMPU.css → vFullscreenImg.DFp1SMPU.css} +0 -0
@@ -1,205 +1 @@
1
- import { defineComponent, ref, computed, watch, onMounted, onBeforeUnmount, nextTick, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, Fragment, renderList, toDisplayString } from "vue";
2
- import { debounce } from "@maz-ui/utils/helpers/debounce";
3
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
4
- import '../assets/MazSlider.DpWhzEK8.css';function getOffset(elem) {
5
- const doc = document.documentElement, body = document.body, rect = elem.getBoundingClientRect();
6
- return {
7
- y: rect.top + (window.pageYOffset || doc.scrollTop) - (doc.clientTop || body.clientTop || 0),
8
- x: rect.left + (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || body.clientLeft || 0)
9
- };
10
- }
11
- function getPos(e, elem, isReverse = !1) {
12
- const event = "targetTouches" in e ? e.targetTouches[0] : e, offset = getOffset(elem), posObj = {
13
- x: event.pageX - offset.x,
14
- y: event.pageY - offset.y
15
- };
16
- return {
17
- x: isReverse ? elem.offsetWidth - posObj.x : posObj.x,
18
- y: isReverse ? elem.offsetHeight - posObj.y : posObj.y
19
- };
20
- }
21
- function isBetween(value, prev, next, direction) {
22
- return direction === "minus" ? prev ? value >= prev : !0 : next ? value <= next : !0;
23
- }
24
- function getOpacityCoeff(index, middle, length) {
25
- const currentIndex = index + 1, deviation = middle < currentIndex ? currentIndex - middle : middle - currentIndex;
26
- return 100 / length * deviation / 100;
27
- }
28
- const _hoisted_1 = ["aria-valuenow", "aria-valuemin", "aria-valuemax"], _hoisted_2 = ["data-label", "onMousedownPassive", "onTouchstartPassive", "onFocusPassive", "onBlurPassive", "onTouchendPassive", "onKeydownPassive"], _sfc_main = /* @__PURE__ */ defineComponent({
29
- __name: "MazSlider",
30
- props: {
31
- modelValue: {},
32
- labels: {},
33
- min: { default: 0 },
34
- max: { default: 100 },
35
- step: { default: 1 },
36
- size: {},
37
- divider: { type: Boolean, default: !0 },
38
- log: { type: Boolean, default: !1 },
39
- color: { default: "primary" },
40
- cursorAnim: { type: Boolean, default: !0 }
41
- },
42
- emits: ["update:model-value"],
43
- setup(__props, { emit: __emit }) {
44
- const emits = __emit, MazSlider2 = ref(), activeCursor = ref(), buttonPositions = ref(), tmpValues = ref(), buttonStyles = ref([]), dividers = ref([]), computedValue = computed(() => typeof __props.modelValue == "number" ? [__props.modelValue] : __props.modelValue ? __props.modelValue : [0]), minLog = computed(() => Math.log(__props.min || 1)), maxLog = computed(() => Math.log(__props.max)), scale = computed(() => (maxLog.value - minLog.value) / (__props.max - __props.min)), range = computed(() => __props.max - __props.min), wrapperStyle = computed(() => ({
45
- paddingTop: __props.labels ? "2.5em" : "1em"
46
- })), hasMultipleValues = computed(() => Array.isArray(__props.modelValue));
47
- watch(
48
- () => __props.modelValue,
49
- () => tmpValues.value = computedValue.value,
50
- { immediate: !0 }
51
- ), watch(
52
- () => [computedValue.value, __props.min, __props.max, __props.log].join(","),
53
- () => buildComponent(!0)
54
- );
55
- const resizeListenerFunction = debounce(() => buildComponent(), 300);
56
- onMounted(() => {
57
- buildComponent(!0), window.addEventListener("resize", resizeListenerFunction);
58
- }), onBeforeUnmount(() => {
59
- window.removeEventListener("resize", resizeListenerFunction);
60
- });
61
- async function buildComponent(emitValue2) {
62
- emitValue2 === !0 && checkValues(), await calcPos(), await nextTick();
63
- for (const [index] of computedValue.value.entries())
64
- setBtnDividers(index);
65
- }
66
- function roundToStep(value) {
67
- return Math.round((value - __props.min) / __props.step) * __props.step + __props.min;
68
- }
69
- function cursorKeyDown(event, i) {
70
- event.key === "ArrowLeft" ? tmpValues.value && isBetween(tmpValues.value[i] - __props.step, tmpValues.value[i - 1], tmpValues.value[i + 1], "minus") && (tmpValues.value[i] = Math.max(__props.min, tmpValues.value[i] - __props.step), emitValue(tmpValues.value)) : event.key === "ArrowRight" && tmpValues.value && isBetween(tmpValues.value[i] + __props.step, tmpValues.value[i - 1], tmpValues.value[i + 1], "plus") && (tmpValues.value[i] = Math.min(__props.max, tmpValues.value[i] + __props.step), emitValue(tmpValues.value));
71
- }
72
- function blurCursor(i) {
73
- activeCursor.value = void 0, setBtnStyle(i);
74
- }
75
- function checkValues() {
76
- const valuesChecked = computedValue.value.map((v) => {
77
- const checkedValue = v < __props.min ? __props.min : v > __props.max ? __props.max : v;
78
- return roundToStep(checkedValue);
79
- });
80
- emitValue(valuesChecked), tmpValues.value = valuesChecked;
81
- }
82
- function emitValue(values) {
83
- const valueToEmit = hasMultipleValues.value ? [...values] : values[0];
84
- emits("update:model-value", valueToEmit);
85
- }
86
- function getLabel(i) {
87
- return __props.labels ? __props.labels[i] : void 0;
88
- }
89
- function setBtnDividers(i) {
90
- setBtnStyle(i), __props.divider && setDividers();
91
- }
92
- async function setBtnStyle(i) {
93
- await nextTick();
94
- const currentCursor = document.querySelectorAll(".m-slider .m-slider__btn");
95
- if (currentCursor) {
96
- const width = currentCursor[i]?.clientWidth + 16, btnStyle = {
97
- left: typeof buttonPositions.value?.[i] == "number" ? `${buttonPositions.value[i] - width / 2 || 1}px` : ""
98
- };
99
- buttonStyles.value[i] = btnStyle;
100
- }
101
- }
102
- function setDividers() {
103
- if (buttonPositions.value) {
104
- const base = [...buttonPositions.value];
105
- base.push(0);
106
- const baseLength = base.length, middle = Math.round(baseLength / 2);
107
- dividers.value = base.map((pos, i) => ({
108
- left: i === 0 ? 0 : `${base[i - 1]}px`,
109
- // ATTENTION: buttonPositions.value[i - 1]
110
- right: i + 1 === baseLength ? 0 : `calc( 100% - ${pos}px )`,
111
- backgroundColor: middle === i + 1 ? void 0 : i < middle ? `rgba(255, 255, 255, ${getOpacityCoeff(i, middle, baseLength)})` : `rgba(0, 0, 0, ${getOpacityCoeff(i, middle, baseLength)})`
112
- // darken
113
- }));
114
- }
115
- }
116
- async function calcPos() {
117
- await nextTick();
118
- const barWidth = MazSlider2.value?.clientWidth;
119
- typeof barWidth == "number" ? buttonPositions.value = tmpValues.value?.map(
120
- (v) => __props.log ? barWidth / __props.max * (__props.min + (Math.log(v) - minLog.value) / scale.value) : barWidth / range.value * (v - __props.min)
121
- ) : console.warn("[maz-ui][MazSlider] ref component not found");
122
- }
123
- async function getCursorsValues() {
124
- await nextTick();
125
- const barWidth = MazSlider2.value?.clientWidth;
126
- if (typeof barWidth == "number")
127
- return __props.log ? buttonPositions.value?.map((pos) => {
128
- const position = pos / (barWidth / __props.max), value = Math.exp((position - __props.min) * scale.value + minLog.value);
129
- return roundToStep(Math.round(value));
130
- }) : buttonPositions.value?.map(
131
- (pos) => roundToStep(Math.round(pos / (barWidth / range.value)) + __props.min)
132
- );
133
- console.warn("[maz-ui][MazSlider] ref component not found");
134
- }
135
- function handleMousedown(_event, i) {
136
- activeCursor.value === void 0 && (activeCursor.value = i, setBtnDividers(i));
137
- }
138
- async function handleMouseup() {
139
- if (activeCursor.value === void 0)
140
- return;
141
- const values = await getCursorsValues();
142
- values && emitValue(values), activeCursor.value = void 0;
143
- }
144
- async function handleMousemove(event) {
145
- if (await nextTick(), activeCursor.value === void 0)
146
- return;
147
- const barWidth = MazSlider2.value?.clientWidth;
148
- if (buttonPositions.value) {
149
- const prevValue = buttonPositions.value[activeCursor.value - 1] || 0, nextValue = buttonPositions.value[activeCursor.value + 1] || barWidth;
150
- if (!MazSlider2.value)
151
- return console.error("[maz-ui](MazSlider/handleMousemove) MazSlider not available");
152
- buttonPositions.value[activeCursor.value] = (() => {
153
- const movement = getPos(event, MazSlider2.value).x;
154
- return movement < prevValue ? prevValue : nextValue && movement > nextValue ? nextValue : movement;
155
- })(), tmpValues.value = await getCursorsValues(), setBtnDividers(activeCursor.value);
156
- }
157
- }
158
- return (_ctx, _cache) => (openBlock(), createElementBlock("div", {
159
- style: normalizeStyle([wrapperStyle.value, { fontSize: __props.size }]),
160
- class: normalizeClass(["m-slider m-reset-css", [`m-slider--${__props.color}`]]),
161
- role: "button",
162
- tabindex: "-1",
163
- onMousemovePassive: handleMousemove,
164
- onMouseupPassive: handleMouseup,
165
- onMouseleavePassive: handleMouseup,
166
- onTouchmovePassive: handleMousemove
167
- }, [
168
- createElementVNode("div", {
169
- ref_key: "MazSlider",
170
- ref: MazSlider2,
171
- class: "m-slider__bar",
172
- role: "slider",
173
- "aria-valuenow": __props.modelValue?.toString(),
174
- "aria-valuemin": __props.min,
175
- "aria-valuemax": __props.max
176
- }, [
177
- (openBlock(!0), createElementBlock(Fragment, null, renderList(dividers.value, (div, i) => (openBlock(), createElementBlock("div", {
178
- key: `divider-${i}`,
179
- style: normalizeStyle([div]),
180
- class: "m-slider__divider"
181
- }, null, 4))), 128)),
182
- (openBlock(!0), createElementBlock(Fragment, null, renderList(computedValue.value, (_btn, i) => (openBlock(), createElementBlock("button", {
183
- key: `cursor-${i}`,
184
- type: "button",
185
- "data-label": getLabel(i),
186
- class: normalizeClass(["m-slider__btn", {
187
- "active-cursor": i === activeCursor.value && __props.cursorAnim
188
- }]),
189
- style: normalizeStyle([buttonStyles.value[i]]),
190
- onMousedownPassive: ($event) => handleMousedown($event, i),
191
- onTouchstartPassive: ($event) => handleMousedown($event, i),
192
- onFocusPassive: ($event) => handleMousedown($event, i),
193
- onBlurPassive: ($event) => blurCursor(i),
194
- onTouchendPassive: ($event) => blurCursor(i),
195
- onKeydownPassive: ($event) => cursorKeyDown($event, i)
196
- }, [
197
- createElementVNode("span", null, toDisplayString(tmpValues.value?.[i]), 1)
198
- ], 46, _hoisted_2))), 128))
199
- ], 8, _hoisted_1)
200
- ], 38));
201
- }
202
- }), MazSlider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f0d4efc2"]]);
203
- export {
204
- MazSlider as default
205
- };
1
+ import{t as MazSlider_default}from"../chunks/MazSlider.BS5QHWK6.js";export{MazSlider_default as default};
@@ -1,27 +1 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode } from "vue";
2
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
3
- import '../assets/MazSpinner.CD-aBOsm.css';const _hoisted_1 = ["width", "height"], _sfc_main = /* @__PURE__ */ defineComponent({
4
- __name: "MazSpinner",
5
- props: {
6
- size: { default: "2em" },
7
- color: { default: "theme" }
8
- },
9
- setup(__props) {
10
- return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
11
- width: __props.size,
12
- height: __props.size,
13
- version: "1.1",
14
- xmlns: "http://www.w3.org/2000/svg",
15
- x: "0px",
16
- y: "0px",
17
- viewBox: "0 0 50 50",
18
- "xml:space": "preserve",
19
- class: normalizeClass(["m-spinner m-reset-css", `m-spinner--${__props.color}`])
20
- }, [..._cache[0] || (_cache[0] = [
21
- createElementVNode("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" }, null, -1)
22
- ])], 10, _hoisted_1));
23
- }
24
- }), MazSpinner = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d6d01f3d"]]);
25
- export {
26
- MazSpinner as default
27
- };
1
+ import{t as MazSpinner_default}from"../chunks/MazSpinner.D3NN2pow.js";export{MazSpinner_default as default};
@@ -1,170 +1 @@
1
- import { defineComponent, defineAsyncComponent, computed, useSlots, ref, openBlock, createElementBlock, normalizeStyle, Fragment, renderList, normalizeClass, createElementVNode, renderSlot, createBlock, resolveDynamicComponent, createCommentVNode, unref, createTextVNode, toDisplayString, createVNode, withCtx } from "vue";
2
- import { MazCheckCircle, MazExclamationTriangle, MazExclamationCircle } from "@maz-ui/icons/lazy";
3
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
4
- import '../assets/MazStepper.D40wFoXK.css';const _hoisted_1 = ["id", "disabled", "onClick"], _hoisted_2 = { class: "m-stepper__header__wrapper" }, _hoisted_3 = { class: "m-stepper__header__point__wrapper" }, _hoisted_4 = { class: "m-stepper__count --primary" }, _hoisted_5 = { class: "m-stepper__count__circle" }, _hoisted_6 = { class: "m-stepper__header__content" }, _hoisted_7 = { class: "m-stepper__title" }, _hoisted_8 = ["innerHTML"], _hoisted_9 = {
5
- key: 0,
6
- class: "m-stepper__subtitle"
7
- }, _hoisted_10 = ["innerHTML"], _hoisted_11 = {
8
- key: 0,
9
- class: "m-stepper__right"
10
- }, _hoisted_12 = ["innerHTML"], _hoisted_13 = { class: "m-stepper__content__wrapper" }, _hoisted_14 = ["innerHTML"], _sfc_main = /* @__PURE__ */ defineComponent({
11
- __name: "MazStepper",
12
- props: {
13
- modelValue: {},
14
- steps: {},
15
- color: { default: "primary" },
16
- disabledNextSteps: { type: Boolean },
17
- disabledPreviousSteps: { type: Boolean },
18
- autoValidateSteps: { type: Boolean },
19
- allStepsOpened: { type: Boolean },
20
- allStepsValidated: { type: Boolean },
21
- canCloseSteps: { type: Boolean }
22
- },
23
- emits: ["update:model-value"],
24
- setup(__props, { emit: __emit }) {
25
- const emits = __emit, MazIcon = defineAsyncComponent(() => import("./MazIcon.js")), MazExpandAnimation = defineAsyncComponent(() => import("./MazExpandAnimation.js")), roundStepBgColor = computed(() => `hsl(var(--maz-${__props.color}))`), roundStepTextColor = computed(() => `hsl(var(--maz-${__props.color}-foreground))`), slots = useSlots(), stepCount = computed(
26
- () => Object.keys(slots).filter((slot) => slot.startsWith("content-")).length || __props.steps?.filter((step) => step.content).length || 0
27
- ), localModelValue = ref(1), currentStep = computed({
28
- get: () => __props.modelValue ?? localModelValue.value,
29
- set: (value) => {
30
- localModelValue.value = value, emits("update:model-value", value);
31
- }
32
- });
33
- function getStepStateData(step) {
34
- return isStepSuccess(step) ? { icon: MazCheckCircle, class: "--success" } : isStepWarning(step) ? { icon: MazExclamationTriangle, class: "--warning" } : isStepError(step) ? { icon: MazExclamationCircle, class: "--error" } : { class: "--normal" };
35
- }
36
- function getStepIcon(step) {
37
- return __props.steps?.[step - 1]?.icon;
38
- }
39
- function getPropertyInStep(property, step) {
40
- return __props.steps?.[step - 1]?.[property];
41
- }
42
- function selectStep(step) {
43
- currentStep.value === step && __props.canCloseSteps ? currentStep.value = 0 : step < 1 ? currentStep.value = 1 : step > stepCount.value ? currentStep.value = stepCount.value : currentStep.value = step;
44
- }
45
- function hasDataForStep(property, step) {
46
- const data = property === "titleInfo" ? "title-info" : property, hasSlot = Object.keys(slots).filter((slot) => slot.startsWith(`${data}-`)).includes(`${data}-${step}`), hasData = !!__props.steps?.[step - 1]?.[property];
47
- return hasSlot || hasData;
48
- }
49
- function isStepSuccess(step) {
50
- const isValidated = __props.steps?.[step - 1]?.success, hasErrorOrWarningState = isStepError(step) || isStepWarning(step), isAutoValidated = __props.autoValidateSteps && step < currentStep.value && !hasErrorOrWarningState;
51
- return isValidated ?? (isAutoValidated || __props.allStepsValidated);
52
- }
53
- function isStepDisabled(step) {
54
- const isDisabled = __props.steps?.[step - 1]?.disabled, isCurrentStepDisabled = currentStep.value === step && !__props.canCloseSteps, isAutoDisabledNext = __props.disabledNextSteps && step > currentStep.value, isAutoDisabledPrevious = __props.disabledPreviousSteps && step < currentStep.value;
55
- return isDisabled ?? (isCurrentStepDisabled || isAutoDisabledNext || isAutoDisabledPrevious || __props.allStepsOpened);
56
- }
57
- function isStepError(step) {
58
- return __props.steps?.[step - 1]?.error;
59
- }
60
- function isStepWarning(step) {
61
- return __props.steps?.[step - 1]?.warning;
62
- }
63
- function isLastStep(step) {
64
- return step === stepCount.value;
65
- }
66
- return (_ctx, _cache) => (openBlock(), createElementBlock("div", {
67
- class: "m-stepper m-reset-css",
68
- style: normalizeStyle([{ "--round-step-bg-color": roundStepBgColor.value, "--round-step-text-color": roundStepTextColor.value }])
69
- }, [
70
- (openBlock(!0), createElementBlock(Fragment, null, renderList(stepCount.value, (step) => (openBlock(), createElementBlock(Fragment, { key: step }, [
71
- hasDataForStep("title", step) ? (openBlock(), createElementBlock("button", {
72
- key: 0,
73
- id: `header-step-${step}`,
74
- type: "button",
75
- disabled: isStepDisabled(step),
76
- class: normalizeClass(["m-stepper__header", [
77
- {
78
- "--is-current-step": step === currentStep.value || __props.allStepsOpened,
79
- "--disabled": step !== currentStep.value && !__props.allStepsOpened && isStepDisabled(step)
80
- },
81
- `${getStepStateData(step).class}`
82
- ]]),
83
- onClick: ($event) => selectStep(step)
84
- }, [
85
- createElementVNode("div", _hoisted_2, [
86
- createElementVNode("div", _hoisted_3, [
87
- renderSlot(_ctx.$slots, "point", { step }, () => [
88
- createElementVNode("span", _hoisted_4, [
89
- createElementVNode("div", _hoisted_5, [
90
- getStepStateData(step).icon ? (openBlock(), createBlock(resolveDynamicComponent(getStepStateData(step).icon), {
91
- key: 0,
92
- class: "icon maz-text-xl"
93
- })) : createCommentVNode("", !0)
94
- ]),
95
- renderSlot(_ctx.$slots, `icon-${step}`, {}, () => [
96
- getStepIcon(step) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
97
- typeof getStepIcon(step) == "string" ? (openBlock(), createBlock(unref(MazIcon), {
98
- key: 0,
99
- name: getStepIcon(step)
100
- }, null, 8, ["name"])) : getStepIcon(step) ? (openBlock(), createBlock(resolveDynamicComponent(getStepIcon(step)), { key: 1 })) : createCommentVNode("", !0)
101
- ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
102
- createTextVNode(toDisplayString(step), 1)
103
- ], 64))
104
- ], !0)
105
- ])
106
- ], !0)
107
- ]),
108
- createElementVNode("div", _hoisted_6, [
109
- createElementVNode("span", _hoisted_7, [
110
- renderSlot(_ctx.$slots, `title-${step}`, {}, () => [
111
- getPropertyInStep("title", step) ? (openBlock(), createElementBlock("span", {
112
- key: 0,
113
- innerHTML: getPropertyInStep("title", step)
114
- }, null, 8, _hoisted_8)) : createCommentVNode("", !0)
115
- ], !0)
116
- ]),
117
- hasDataForStep("subtitle", step) ? (openBlock(), createElementBlock("span", _hoisted_9, [
118
- renderSlot(_ctx.$slots, `subtitle-${step}`, {}, () => [
119
- getPropertyInStep("subtitle", step) ? (openBlock(), createElementBlock("span", {
120
- key: 0,
121
- innerHTML: getPropertyInStep("subtitle", step)
122
- }, null, 8, _hoisted_10)) : createCommentVNode("", !0)
123
- ], !0)
124
- ])) : createCommentVNode("", !0)
125
- ])
126
- ]),
127
- hasDataForStep("titleInfo", step) ? (openBlock(), createElementBlock("span", _hoisted_11, [
128
- renderSlot(_ctx.$slots, `title-info-${step}`, {}, () => [
129
- getPropertyInStep("titleInfo", step) ? (openBlock(), createElementBlock("span", {
130
- key: 0,
131
- innerHTML: getPropertyInStep("titleInfo", step)
132
- }, null, 8, _hoisted_12)) : createCommentVNode("", !0)
133
- ], !0)
134
- ])) : createCommentVNode("", !0)
135
- ], 10, _hoisted_1)) : createCommentVNode("", !0),
136
- createElementVNode("div", {
137
- class: normalizeClass(["m-stepper__content", {
138
- "--no-border": isLastStep(step)
139
- }])
140
- }, [
141
- createVNode(unref(MazExpandAnimation), {
142
- "model-value": __props.allStepsOpened || currentStep.value === step,
143
- "aria-labelledby": `header-step-${step}`
144
- }, {
145
- default: withCtx(() => [
146
- createElementVNode("div", _hoisted_13, [
147
- renderSlot(_ctx.$slots, `content-${step}`, {
148
- validated: isStepSuccess(step),
149
- error: isStepError(step),
150
- warning: isStepWarning(step),
151
- nextStep: () => selectStep(step + 1),
152
- previousStep: () => selectStep(step - 1)
153
- }, () => [
154
- getPropertyInStep("content", step) ? (openBlock(), createElementBlock("span", {
155
- key: 0,
156
- innerHTML: getPropertyInStep("content", step)
157
- }, null, 8, _hoisted_14)) : createCommentVNode("", !0)
158
- ], !0)
159
- ])
160
- ]),
161
- _: 2
162
- }, 1032, ["model-value", "aria-labelledby"])
163
- ], 2)
164
- ], 64))), 128))
165
- ], 4));
166
- }
167
- }), MazStepper = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-1f5f1962"]]);
168
- export {
169
- MazStepper as default
170
- };
1
+ import{t as MazStepper_default}from"../chunks/MazStepper.DTu8HG9T.js";export{MazStepper_default as default};
@@ -1,4 +1 @@
1
- import { _ as _sfc_main } from "../chunks/MazSwitch.vue_vue_type_style_index_0_lang.lYfYsI0R.js";
2
- export {
3
- _sfc_main as default
4
- };
1
+ import{t as MazSwitch_default}from"../chunks/MazSwitch.Dvmj-rTW.js";export{MazSwitch_default as default};
@@ -1,8 +1 @@
1
- import { _ as _sfc_main } from "../chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js";
2
- import { m } from "../chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js";
3
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
4
- import '../assets/MazTable.Dip-n-1s.css';const MazTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-06d3d24b"]]);
5
- export {
6
- MazTable as default,
7
- m as mazTableKey
8
- };
1
+ import{n as mazTableKey,t as MazTable_default}from"../chunks/MazTable.DnOehvN6.js";export{MazTable_default as default,mazTableKey};
@@ -1,18 +1 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from "vue";
2
- import { useInjectStrict } from "../composables/useInjectStrict.js";
3
- import { m as mazTableKey } from "../chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js";
4
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
5
- import '../assets/MazTableCell.B5eudh73.css';const _sfc_main = /* @__PURE__ */ defineComponent({
6
- __name: "MazTableCell",
7
- setup(__props) {
8
- const { size } = useInjectStrict(mazTableKey);
9
- return (_ctx, _cache) => (openBlock(), createElementBlock("td", {
10
- class: normalizeClass(["m-table-cell m-reset-css", [`--${unref(size)}`]])
11
- }, [
12
- renderSlot(_ctx.$slots, "default", {}, void 0, !0)
13
- ], 2));
14
- }
15
- }), MazTableCell = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-83698c73"]]);
16
- export {
17
- MazTableCell as default
18
- };
1
+ import"../chunks/MazTable.DnOehvN6.js";import{t as MazTableCell_default}from"../chunks/MazTableCell.xbm2NGWL.js";export{MazTableCell_default as default};
@@ -1,26 +1 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from "vue";
2
- import { useInjectStrict } from "../composables/useInjectStrict.js";
3
- import { m as mazTableKey } from "../chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js";
4
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
5
- import '../assets/MazTableRow.DD1Cwtss.css';const _sfc_main = /* @__PURE__ */ defineComponent({
6
- __name: "MazTableRow",
7
- props: {
8
- hoverable: { type: Boolean, default: !0 },
9
- isHead: { type: Boolean, default: !1 }
10
- },
11
- setup(__props) {
12
- const { backgroundEven, backgroundOdd, hoverable: injectedHoverable } = useInjectStrict(mazTableKey);
13
- return (_ctx, _cache) => (openBlock(), createElementBlock("tr", {
14
- class: normalizeClass(["m-table-row m-reset-css", {
15
- "--hoverable": unref(injectedHoverable) && __props.hoverable && !__props.isHead,
16
- "--background-odd": unref(backgroundOdd),
17
- "--background-even": unref(backgroundEven)
18
- }])
19
- }, [
20
- renderSlot(_ctx.$slots, "default", {}, void 0, !0)
21
- ], 2));
22
- }
23
- }), MazTableRow = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6d32024a"]]);
24
- export {
25
- MazTableRow as default
26
- };
1
+ import"../chunks/MazTable.DnOehvN6.js";import{t as MazTableRow_default}from"../chunks/MazTableRow.B5dJiXk1.js";export{MazTableRow_default as default};
@@ -1,18 +1 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from "vue";
2
- import { useInjectStrict } from "../composables/useInjectStrict.js";
3
- import { m as mazTableKey } from "../chunks/MazTable.vue_vue_type_script_setup_true_lang.ycpSYFvJ.js";
4
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
5
- import '../assets/MazTableTitle.TySlOaCv.css';const _sfc_main = /* @__PURE__ */ defineComponent({
6
- __name: "MazTableTitle",
7
- setup(__props) {
8
- const { size } = useInjectStrict(mazTableKey);
9
- return (_ctx, _cache) => (openBlock(), createElementBlock("th", {
10
- class: normalizeClass(["m-table-title m-reset-css", [`--${unref(size)}`]])
11
- }, [
12
- renderSlot(_ctx.$slots, "default", {}, void 0, !0)
13
- ], 2));
14
- }
15
- }), MazTableTitle = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a8c56ea9"]]);
16
- export {
17
- MazTableTitle as default
18
- };
1
+ import"../chunks/MazTable.DnOehvN6.js";import{t as MazTableTitle_default}from"../chunks/MazTableTitle.DNA_1mCy.js";export{MazTableTitle_default as default};
@@ -1,4 +1 @@
1
- import { _ as _sfc_main } from "../chunks/MazTabs.vue_vue_type_script_setup_true_lang.CiIFxs7J.js";
2
- export {
3
- _sfc_main as default
4
- };
1
+ import{t as MazTabs_default}from"../chunks/MazTabs.-0-YP3QQ.js";export{MazTabs_default as default};
@@ -1,138 +1 @@
1
- import { defineComponent, defineAsyncComponent, ref, computed, onBeforeMount, onMounted, watch, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, Fragment, renderList, renderSlot, createTextVNode, toDisplayString, createBlock, unref, mergeProps, withCtx, createCommentVNode } from "vue";
2
- import { sleep } from "@maz-ui/utils/helpers/sleep";
3
- import { useInjectStrict } from "../composables/useInjectStrict.js";
4
- import { _ as _export_sfc } from "../chunks/_plugin-vue_export-helper.B--vMWp3.js";
5
- import '../assets/MazTabsBar.Bok1O7TL.css';const _hoisted_1 = ["disabled", "onClick"], _sfc_main = /* @__PURE__ */ defineComponent({
6
- __name: "MazTabsBar",
7
- props: {
8
- items: {},
9
- persistent: { type: Boolean, default: !1 },
10
- queryParam: { default: "tab" },
11
- block: { type: Boolean, default: !1 },
12
- elevation: { type: Boolean, default: !1 },
13
- autoScroll: { type: Boolean, default: !0 },
14
- bordered: { type: Boolean, default: !0 }
15
- },
16
- setup(__props) {
17
- const MazBadge = defineAsyncComponent(() => import("./MazBadge.js")), { currentTab, updateCurrentTab } = useInjectStrict("maz-tabs");
18
- function selectTab(tabIndex) {
19
- updateCurrentTab(tabIndex + 1), __props.persistent && addOrUpdateQueryParamTab(tabIndex + 1);
20
- }
21
- const tabsBarRef = ref(), itemRefs = ref([]);
22
- function isActiveTab(index) {
23
- return currentTab.value === index + 1;
24
- }
25
- function addElementToItemRefs({
26
- mazBtn,
27
- index
28
- }) {
29
- itemRefs.value[index] = mazBtn && "$el" in mazBtn ? mazBtn.$el : mazBtn;
30
- }
31
- const normalizedItems = computed(
32
- () => __props.items.map((item) => ({
33
- label: typeof item == "string" ? item : item.label,
34
- disabled: typeof item == "string" ? !1 : item.disabled ?? !1,
35
- badge: typeof item == "string" ? void 0 : item.badge
36
- }))
37
- ), tabsIndicatorState = ref(), tabsBarHasScrollAnimation = ref(!1);
38
- async function setIndicatorAndScroll() {
39
- if (!__props.autoScroll)
40
- return;
41
- await sleep(150);
42
- const tabsBar = tabsBarRef.value, activeTab = itemRefs.value[currentTab.value - 1];
43
- if (!tabsBar || !activeTab)
44
- return;
45
- const scrollOffset = 50;
46
- if (activeTab.offsetLeft - scrollOffset < tabsBar.scrollLeft || activeTab.offsetLeft + activeTab.offsetWidth > tabsBar.scrollLeft + tabsBar.clientWidth) {
47
- const tabBarPaddingLeft = globalThis.getComputedStyle(tabsBar, "padding-left").paddingLeft, tabsBarPaddingOffset = Number(tabBarPaddingLeft.slice(0, -2));
48
- tabsBar.scrollTo({
49
- left: activeTab.offsetLeft - tabsBarPaddingOffset - scrollOffset,
50
- behavior: tabsBarHasScrollAnimation.value ? "smooth" : "instant"
51
- });
52
- }
53
- if (typeof currentTab.value != "number")
54
- return;
55
- const indicatorWidth = activeTab?.offsetWidth ?? 0, indicatorHeight = activeTab?.offsetHeight ?? 0, translateXValue = activeTab?.offsetLeft ?? 0;
56
- tabsIndicatorState.value = {
57
- transform: `translateX(${translateXValue}px)`,
58
- width: `${indicatorWidth}px`,
59
- height: `${indicatorHeight}px`
60
- }, tabsBarHasScrollAnimation.value = !0;
61
- }
62
- function getTabStyle(index, disabled) {
63
- return disabled ? {} : currentTab.value === index + 1 ? "color: hsl(var(--maz-foreground))" : "color: hsl(var(--maz-muted))";
64
- }
65
- onBeforeMount(() => {
66
- (currentTab.value < 1 || currentTab.value > normalizedItems.value.length) && console.error(
67
- `[maz-ui](MazTabsBar) The model-value should be between 1 and ${normalizedItems.value.length}`
68
- );
69
- }), onMounted(() => {
70
- (__props.persistent || currentTab.value) && setIndicatorAndScroll();
71
- }), watch(
72
- () => [currentTab.value, normalizedItems.value],
73
- () => {
74
- setIndicatorAndScroll();
75
- }
76
- );
77
- function getQueryParamTab() {
78
- const urlActuelle = new URL(globalThis.location.href);
79
- return Number(urlActuelle.searchParams.get(__props.queryParam));
80
- }
81
- function addOrUpdateQueryParamTab(tab) {
82
- const urlActuelle = new URL(globalThis.location.href);
83
- urlActuelle.searchParams.set(__props.queryParam, String(tab)), globalThis.history.replaceState({}, document.title, urlActuelle.toString());
84
- }
85
- return onMounted(() => {
86
- __props.persistent && updateCurrentTab(getQueryParamTab() || currentTab.value || 1);
87
- }), (_ctx, _cache) => (openBlock(), createElementBlock("div", {
88
- ref_key: "tabsBarRef",
89
- ref: tabsBarRef,
90
- class: normalizeClass(["m-tabs-bar m-reset-css", {
91
- "--block": __props.block,
92
- "--elevation": __props.elevation,
93
- "--bordered": __props.bordered
94
- }])
95
- }, [
96
- createElementVNode("div", {
97
- class: normalizeClass(["m-tabs-bar__indicator", { "--animated": tabsBarHasScrollAnimation.value }]),
98
- style: normalizeStyle([tabsIndicatorState.value])
99
- }, null, 6),
100
- (openBlock(!0), createElementBlock(Fragment, null, renderList(normalizedItems.value, (item, index) => (openBlock(), createElementBlock("button", {
101
- key: index,
102
- ref_for: !0,
103
- ref: (mazBtn) => addElementToItemRefs({ mazBtn, index }),
104
- class: normalizeClass([{ "--active": isActiveTab(index), "--disabled": item.disabled }, "m-tabs-bar__item"]),
105
- disabled: item.disabled,
106
- style: normalizeStyle(getTabStyle(index, item.disabled)),
107
- onClick: ($event) => item.disabled ? void 0 : selectTab(index)
108
- }, [
109
- renderSlot(_ctx.$slots, "item", {
110
- item,
111
- active: isActiveTab(index),
112
- index
113
- }, () => [
114
- createTextVNode(toDisplayString(item.label) + " ", 1),
115
- item.badge ? (openBlock(), createBlock(unref(MazBadge), mergeProps({
116
- key: 0,
117
- ref_for: !0
118
- }, item.badge, {
119
- size: item.badge.size ?? "0.7rem",
120
- class: "m-tabs-bar__item__badge"
121
- }), {
122
- default: withCtx(() => [
123
- renderSlot(_ctx.$slots, "badge-content", {
124
- content: item.badge.content
125
- }, () => [
126
- createTextVNode(toDisplayString(item.badge.content), 1)
127
- ], !0)
128
- ]),
129
- _: 2
130
- }, 1040, ["size"])) : createCommentVNode("", !0)
131
- ], !0)
132
- ], 14, _hoisted_1))), 128))
133
- ], 2));
134
- }
135
- }), MazTabsBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-060189e6"]]);
136
- export {
137
- MazTabsBar as default
138
- };
1
+ import{t as MazTabsBar_default}from"../chunks/MazTabsBar.D2JVKMS7.js";export{MazTabsBar_default as default};
@@ -1,4 +1 @@
1
- import { _ as _sfc_main } from "../chunks/MazTabsContent.vue_vue_type_script_setup_true_lang.MO7zA8LZ.js";
2
- export {
3
- _sfc_main as default
4
- };
1
+ import{t as MazTabsContent_default}from"../chunks/MazTabsContent.C9omK25X.js";export{MazTabsContent_default as default};