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,84 +0,0 @@
1
- import { defineComponent, computed, ref, openBlock, createElementBlock, normalizeStyle, normalizeClass, unref, createElementVNode, mergeProps, renderSlot, createTextVNode, toDisplayString, createCommentVNode } from "vue";
2
- import { useInstanceUniqId } from "../composables/useInstanceUniqId.js";
3
- import '../assets/MazSwitch.BsABVQx2.css';const _hoisted_1 = ["for", "aria-checked"], _hoisted_2 = ["id", "name", "checked", "aria-label", "disabled"], _hoisted_3 = {
4
- key: 0,
5
- class: "m-switch__text"
6
- }, _sfc_main = /* @__PURE__ */ defineComponent({
7
- inheritAttrs: !1,
8
- __name: "MazSwitch",
9
- props: {
10
- style: { type: [Boolean, null, String, Object, Array], default: void 0 },
11
- class: { type: [Boolean, null, String, Object, Array], default: void 0 },
12
- modelValue: { type: Boolean, default: !1 },
13
- id: { default: void 0 },
14
- disabled: { type: Boolean, default: !1 },
15
- name: { default: void 0 },
16
- label: {},
17
- color: { default: "primary" },
18
- error: { type: Boolean },
19
- success: { type: Boolean },
20
- warning: { type: Boolean },
21
- hint: {}
22
- },
23
- emits: ["update:model-value", "change", "blur", "focus"],
24
- setup(__props, { emit: __emit }) {
25
- const props = __props, emits = __emit, instanceId = useInstanceUniqId({
26
- componentName: "MazSwitch",
27
- providedId: props.id
28
- }), bgColorClassVar = computed(() => `hsl(var(--maz-${props.color}))`);
29
- function emit() {
30
- emits("update:model-value", !props.modelValue), emits("change", !props.modelValue);
31
- }
32
- const inputRef = ref();
33
- function keyboardHandler(event) {
34
- ["Space"].includes(event.code) && (event.preventDefault(), emit());
35
- }
36
- function onBlur(event) {
37
- inputRef.value?.dispatchEvent(new Event("blur")), emits("blur", event);
38
- }
39
- function onFocus(event) {
40
- inputRef.value?.dispatchEvent(new Event("focus")), emits("focus", event);
41
- }
42
- return (_ctx, _cache) => (openBlock(), createElementBlock("label", {
43
- for: unref(instanceId),
44
- class: normalizeClass(["m-switch m-reset-css", [{ "--is-disabled": __props.disabled }, props.class]]),
45
- role: "switch",
46
- style: normalizeStyle([__props.style, { "--switch-color": bgColorClassVar.value }]),
47
- "aria-checked": __props.modelValue,
48
- tabindex: "0",
49
- onBlur,
50
- onFocus,
51
- onKeydown: keyboardHandler
52
- }, [
53
- createElementVNode("input", mergeProps({ id: unref(instanceId) }, _ctx.$attrs, {
54
- ref_key: "inputRef",
55
- ref: inputRef,
56
- type: "checkbox",
57
- name: __props.name,
58
- tabindex: "-1",
59
- checked: __props.modelValue,
60
- "aria-label": __props.label,
61
- disabled: __props.disabled,
62
- class: "m-switch__input",
63
- onChange: emit
64
- }), null, 16, _hoisted_2),
65
- _cache[0] || (_cache[0] = createElementVNode("span", { class: "m-switch__toggle" }, null, -1)),
66
- _ctx.$slots.default || __props.label || __props.hint ? (openBlock(), createElementBlock("span", _hoisted_3, [
67
- renderSlot(_ctx.$slots, "default", { value: __props.modelValue }, () => [
68
- createTextVNode(toDisplayString(__props.label), 1)
69
- ]),
70
- __props.hint ? (openBlock(), createElementBlock("span", {
71
- key: 0,
72
- class: normalizeClass(["m-switch__hint", {
73
- "--error": __props.error,
74
- "--success": __props.success,
75
- "--warning": __props.warning
76
- }])
77
- }, toDisplayString(__props.hint), 3)) : createCommentVNode("", !0)
78
- ])) : createCommentVNode("", !0)
79
- ], 46, _hoisted_1));
80
- }
81
- });
82
- export {
83
- _sfc_main as _
84
- };
@@ -1,517 +0,0 @@
1
- import { defineComponent, useCssVars, defineAsyncComponent, computed, toRefs, provide, ref, watch, useSlots, onBeforeMount, openBlock, createElementBlock, normalizeClass, renderSlot, createElementVNode, toDisplayString, createCommentVNode, createBlock, unref, createVNode, normalizeStyle, createTextVNode, withCtx, Fragment, renderList } from "vue";
2
- import { MazMagnifyingGlass, MazArrowUp, MazChevronDoubleLeft, MazChevronLeft } from "@maz-ui/icons/lazy";
3
- import { useTranslations } from "@maz-ui/translations/composables/useTranslations";
4
- const _hoisted_1 = {
5
- key: 0,
6
- class: "m-table-header"
7
- }, _hoisted_2 = {
8
- key: 0,
9
- class: "m-table-spacer"
10
- }, _hoisted_3 = { class: "m-table-header-title" }, _hoisted_4 = {
11
- key: 1,
12
- class: "m-table-header-search"
13
- }, _hoisted_5 = { key: 0 }, _hoisted_6 = { key: 1 }, _hoisted_7 = {
14
- key: 0,
15
- class: "m-table-sort-icon-wrapper"
16
- }, _hoisted_8 = { class: "maz-text-center maz-text-muted" }, _hoisted_9 = {
17
- key: 1,
18
- class: "m-table-footer"
19
- }, _hoisted_10 = {
20
- key: 0,
21
- class: "m-table-footer-pagination"
22
- }, _hoisted_11 = { class: "m-table-footer-pagination-items-per-page" }, _hoisted_12 = { class: "maz-hidden maz-text-sm tab-s:maz-block" }, _hoisted_13 = {
23
- key: 0,
24
- class: "maz-whitespace-nowrap maz-text-sm"
25
- }, _hoisted_14 = { class: "m-table-footer-pagination-buttons" }, mazTableKey = /* @__PURE__ */ Symbol("maz-table"), _sfc_main = /* @__PURE__ */ defineComponent({
26
- __name: "MazTable",
27
- props: {
28
- tableClass: { type: [Boolean, null, String, Object, Array] },
29
- tableStyle: { type: [Boolean, null, String, Object, Array] },
30
- modelValue: {},
31
- size: { default: "md" },
32
- inputSize: {},
33
- title: {},
34
- headers: {},
35
- sortable: { type: Boolean },
36
- headersAlign: { default: "left" },
37
- rows: {},
38
- hoverable: { type: Boolean },
39
- search: { type: Boolean },
40
- hideSearchInRow: { type: Boolean },
41
- hideSearchBy: { type: Boolean },
42
- searchQuery: {},
43
- backgroundOdd: { type: Boolean },
44
- backgroundEven: { type: Boolean },
45
- elevation: { type: Boolean },
46
- divider: { type: Boolean, default: !1 },
47
- caption: {},
48
- captionSide: { default: "bottom" },
49
- pagination: { type: Boolean },
50
- page: { default: 1 },
51
- pageSize: { default: 20 },
52
- totalPages: {},
53
- paginateRows: { type: Boolean, default: !0 },
54
- totalItems: {},
55
- loading: { type: Boolean },
56
- selectable: { type: Boolean },
57
- selectedKey: {},
58
- tableLayout: {},
59
- color: { default: "primary" },
60
- translations: {},
61
- roundedSize: { default: "lg" },
62
- scrollable: { type: Boolean, default: !1 }
63
- },
64
- emits: ["update:model-value", "update:search-query", "update:page", "update:page-size"],
65
- setup(__props, { emit: __emit }) {
66
- useCssVars((_ctx) => ({
67
- v19f2cb1e: _ctx.tableLayout,
68
- v7a969236: _ctx.captionSide
69
- }));
70
- const props = __props, emits = __emit, MazBtn = defineAsyncComponent(() => import("../components/MazBtn.js")), MazCheckbox = defineAsyncComponent(() => import("../components/MazCheckbox.js")), MazInput = defineAsyncComponent(() => import("../components/MazInput.js")), MazLoadingBar = defineAsyncComponent(() => import("../components/MazLoadingBar.js")), MazSelect = defineAsyncComponent(() => import("../components/MazSelect.js")), MazTableCell = defineAsyncComponent(() => import("../components/MazTableCell.js")), MazTableRowComponent = defineAsyncComponent(() => import("../components/MazTableRow.js")), MazTableTitle = defineAsyncComponent(() => import("../components/MazTableTitle.js")), { t } = useTranslations(), messages = computed(() => ({
71
- noResults: props.translations?.noResults ?? t("table.noResults"),
72
- actionColumnTitle: props.translations?.actionColumnTitle ?? t("table.actionColumnTitle"),
73
- searchByInput: {
74
- all: props.translations?.searchByInput?.all ?? t("table.searchByInput.all"),
75
- placeholder: props.translations?.searchByInput?.placeholder ?? t("table.searchByInput.placeholder")
76
- },
77
- searchInput: {
78
- placeholder: props.translations?.searchInput?.placeholder ?? t("table.searchInput.placeholder")
79
- },
80
- pagination: {
81
- all: props.translations?.pagination?.all ?? t("table.pagination.all"),
82
- rowsPerPage: props.translations?.pagination?.rowsPerPage ?? t("table.pagination.rowsPerPage"),
83
- of: props.translations?.pagination?.of ?? t("table.pagination.of")
84
- }
85
- })), hasDivider = computed(
86
- () => props.divider && !props.backgroundEven && !props.backgroundOdd
87
- ), { size, hoverable, backgroundEven, backgroundOdd } = toRefs(props);
88
- provide(mazTableKey, {
89
- size,
90
- hoverable,
91
- backgroundEven,
92
- backgroundOdd
93
- });
94
- const rowsNormalized = ref(getNormalizedRows()), isSelectable = computed(() => props.selectable || !!props.selectedKey), currentPage = ref(props.page);
95
- watch(
96
- () => props.page,
97
- (value) => {
98
- currentPage.value = value;
99
- }
100
- );
101
- const currentPageModel = computed({
102
- get: () => currentPage.value,
103
- set: (value) => {
104
- currentPage.value = value, emits("update:page", value);
105
- }
106
- }), pageSizeOptions = computed(() => [
107
- { label: messages.value.pagination.all, value: Number.POSITIVE_INFINITY },
108
- { label: 5, value: 5 },
109
- { label: 10, value: 10 },
110
- { label: 20, value: 20 },
111
- { label: 50, value: 50 },
112
- { label: 100, value: 100 },
113
- { label: 200, value: 200 }
114
- ]), pageSizeModelInternal = ref(props.pageSize);
115
- watch(
116
- () => props.pageSize,
117
- (value) => {
118
- pageSizeModelInternal.value = value;
119
- }
120
- );
121
- const pageSizeModel = computed({
122
- get: () => pageSizeModelInternal.value,
123
- set: (value) => {
124
- pageSizeModelInternal.value = value, emits("update:page-size", value);
125
- }
126
- }), totalPagesInternal = computed(() => props.totalPages ? props.totalPages : pageSizeModel.value === Number.POSITIVE_INFINITY || !totalItemsInternal.value ? 1 : Math.ceil(totalItemsInternal.value / pageSizeModel.value)), totalItemsInternal = computed(() => props.totalItems ?? props.rows?.length), rowsOfPage = computed(() => {
127
- if (!props.pagination || !props.paginateRows || pageSizeModel.value === Number.POSITIVE_INFINITY)
128
- return rowsNormalized.value;
129
- const start = (currentPage.value - 1) * pageSizeModel.value, end = start + pageSizeModel.value;
130
- return rowsNormalized.value.slice(start, end);
131
- }), rowsFromTo = computed(() => ({
132
- from: (currentPage.value - 1) * pageSizeModel.value + 1,
133
- to: Math.min(currentPage.value * pageSizeModel.value, totalItemsInternal.value ?? 0)
134
- }));
135
- function firstPage() {
136
- currentPageModel.value = 1;
137
- }
138
- function lastPage() {
139
- currentPageModel.value = totalPagesInternal.value;
140
- }
141
- function previousPage() {
142
- currentPageModel.value--;
143
- }
144
- function nextPage() {
145
- currentPageModel.value++;
146
- }
147
- watch(
148
- () => [props.rows, props.modelValue],
149
- () => {
150
- rowsNormalized.value = getNormalizedRows();
151
- }
152
- );
153
- const sortedColumnIndex = ref(), sortType = ref(), headersNormalized = computed(() => getNormalizedHeaders(props.headers)), searchByKey = ref(), searchByOptions = computed(() => {
154
- const headerOptions = headersNormalized.value.map(({ label, key }) => ({
155
- label,
156
- value: key
157
- }));
158
- return [{ label: messages.value.searchByInput.all, value: null }, ...headerOptions];
159
- }), searchQueryModelInternal = ref(props.searchQuery);
160
- watch(
161
- () => props.searchQuery,
162
- (value) => {
163
- searchQueryModelInternal.value = value;
164
- }
165
- );
166
- const searchQueryModel = computed({
167
- get: () => searchQueryModelInternal.value,
168
- set: (value) => {
169
- searchQueryModelInternal.value = value, emits("update:search-query", value);
170
- }
171
- });
172
- function getSortedRows(rows) {
173
- return rows.toSorted((a, b) => {
174
- if (sortedColumnIndex.value === void 0 || sortType.value === void 0)
175
- return 0;
176
- const aValue = a[headersNormalized.value[sortedColumnIndex.value].key], bValue = b[headersNormalized.value[sortedColumnIndex.value].key];
177
- return typeof aValue == "string" && typeof bValue == "string" ? sortType.value === "ASC" ? aValue.localeCompare(bValue) : bValue.localeCompare(aValue) : sortType.value === "ASC" ? aValue - bValue : bValue - aValue;
178
- });
179
- }
180
- function getFilteredRows(rows) {
181
- if (props.hideSearchInRow || typeof searchQueryModel.value != "string")
182
- return rowsOfPage.value;
183
- const query = searchQueryModel.value.toLowerCase();
184
- return [...rows].filter((row) => searchByKey.value ? String(row[searchByKey.value]).toLowerCase().includes(query) : Object.values(row).some((value) => typeof value == "string" || typeof value == "number" || typeof value == "boolean" ? String(value).toLowerCase().includes(query) : !1));
185
- }
186
- const rowsFiltered = computed(() => {
187
- const filteredResults = getFilteredRows(rowsOfPage.value);
188
- return getSortedRows(filteredResults);
189
- }), slots = useSlots(), hasHeader = computed(() => props.search || !!props.title || !!slots.title), hasFooter = computed(() => props.pagination);
190
- function getNormalizedHeaders(headers) {
191
- return headers?.map(
192
- (header) => typeof header == "string" ? { label: header, align: props.headersAlign } : { align: props.headersAlign, thHeaders: header.headers, ...header }
193
- ) ?? [];
194
- }
195
- function getNormalizedRows() {
196
- return props.rows?.map((row) => ({
197
- selected: props.modelValue?.includes(props.selectedKey ? row[props.selectedKey] : row),
198
- ...row
199
- })) ?? [];
200
- }
201
- function sortColumn(columnIndex) {
202
- if (columnIndex === sortedColumnIndex.value) {
203
- const sortTypeValue = sortType.value === "DESC" ? "ASC" : void 0;
204
- sortType.value = sortType.value === void 0 ? "DESC" : sortTypeValue;
205
- } else
206
- sortType.value = "DESC";
207
- sortedColumnIndex.value = sortType.value === void 0 ? void 0 : columnIndex;
208
- }
209
- const allSelected = computed({
210
- get: () => rowsFiltered.value.every((row) => row.selected) ?? !1,
211
- set: selectAll
212
- });
213
- function selectAll(value) {
214
- for (const row of rowsFiltered.value)
215
- row.selected = value;
216
- emitValues();
217
- }
218
- function selectRow(value, index) {
219
- rowsFiltered.value[index].selected = value, emitValues();
220
- }
221
- function emitValues(selectedRows) {
222
- selectedRows = selectedRows ?? getSelectedRows();
223
- const rows = selectedRows?.length ? selectedRows : void 0;
224
- emits("update:model-value", rows);
225
- }
226
- function getSelectedRows() {
227
- return rowsNormalized.value.filter((row) => row.selected).map((row) => props.selectedKey ? row[props.selectedKey] : row);
228
- }
229
- return onBeforeMount(() => {
230
- const selectedRows = getSelectedRows();
231
- selectedRows?.length && emitValues(selectedRows);
232
- }), (_ctx, _cache) => (openBlock(), createElementBlock("div", {
233
- class: normalizeClass(["m-table m-reset-css", { "--has-header": hasHeader.value }])
234
- }, [
235
- hasHeader.value ? (openBlock(), createElementBlock("div", _hoisted_1, [
236
- __props.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", _hoisted_2, [
237
- renderSlot(_ctx.$slots, "title", {}, () => [
238
- createElementVNode("span", _hoisted_3, toDisplayString(__props.title), 1)
239
- ], !0)
240
- ])) : createCommentVNode("", !0),
241
- __props.search ? (openBlock(), createElementBlock("div", _hoisted_4, [
242
- __props.hideSearchBy ? createCommentVNode("", !0) : (openBlock(), createBlock(unref(MazSelect), {
243
- key: 0,
244
- modelValue: searchByKey.value,
245
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchByKey.value = $event),
246
- "rounded-size": __props.roundedSize,
247
- color: __props.color,
248
- style: { width: "8rem" },
249
- placeholder: messages.value.searchByInput.placeholder,
250
- size: __props.inputSize ?? unref(size),
251
- options: searchByOptions.value
252
- }, null, 8, ["modelValue", "rounded-size", "color", "placeholder", "size", "options"])),
253
- createVNode(unref(MazInput), {
254
- modelValue: searchQueryModel.value,
255
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => searchQueryModel.value = $event),
256
- size: __props.inputSize ?? unref(size),
257
- "rounded-size": __props.roundedSize,
258
- color: __props.color,
259
- debounce: 300,
260
- placeholder: messages.value.searchInput.placeholder,
261
- "left-icon": unref(MazMagnifyingGlass)
262
- }, null, 8, ["modelValue", "size", "rounded-size", "color", "placeholder", "left-icon"])
263
- ])) : createCommentVNode("", !0)
264
- ])) : createCommentVNode("", !0),
265
- createElementVNode("div", {
266
- class: normalizeClass(["m-table-wrapper", [`--rounded-${__props.roundedSize}`, {
267
- "--scrollable": __props.scrollable
268
- }]])
269
- }, [
270
- createElementVNode("table", {
271
- class: normalizeClass([{ "--elevation": __props.elevation, "--has-layout": __props.tableLayout }, __props.tableClass]),
272
- style: normalizeStyle(__props.tableStyle)
273
- }, [
274
- __props.caption || _ctx.$slots.caption ? (openBlock(), createElementBlock("caption", _hoisted_5, [
275
- renderSlot(_ctx.$slots, "caption", {}, () => [
276
- createTextVNode(toDisplayString(__props.caption), 1)
277
- ], !0)
278
- ])) : createCommentVNode("", !0),
279
- headersNormalized.value ? (openBlock(), createElementBlock("thead", _hoisted_6, [
280
- renderSlot(_ctx.$slots, "thead", {}, () => [
281
- createVNode(unref(MazTableRowComponent), { "is-head": "" }, {
282
- default: withCtx(() => [
283
- isSelectable.value ? (openBlock(), createBlock(unref(MazTableTitle), {
284
- key: 0,
285
- align: "left",
286
- class: normalizeClass([`--${unref(size)}`, "m-table-select-column"])
287
- }, {
288
- default: withCtx(() => [
289
- createVNode(unref(MazCheckbox), {
290
- modelValue: allSelected.value,
291
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => allSelected.value = $event),
292
- size: "sm"
293
- }, null, 8, ["modelValue"])
294
- ]),
295
- _: 1
296
- }, 8, ["class"])) : createCommentVNode("", !0),
297
- (openBlock(!0), createElementBlock(Fragment, null, renderList(headersNormalized.value, (header, columnIndex) => (openBlock(), createBlock(unref(MazTableTitle), {
298
- key: columnIndex,
299
- scope: header.scope,
300
- align: header.align,
301
- rowspan: header.rowspan,
302
- colspan: header.colspan,
303
- headers: header.thHeaders,
304
- style: normalizeStyle({ width: header.width, textAlign: header.align }),
305
- class: normalizeClass(["maz-group", [
306
- { "--hidden": header.hidden, "--sortable": header.sortable ?? __props.sortable },
307
- header.classes,
308
- `--${unref(size)}`
309
- ]]),
310
- onClick: ($event) => (header.sortable ?? __props.sortable) && sortColumn(columnIndex)
311
- }, {
312
- default: withCtx(() => [
313
- createElementVNode("span", {
314
- class: normalizeClass({ "maz-sr-only": header.srOnly })
315
- }, [
316
- renderSlot(_ctx.$slots, "header", {
317
- header,
318
- label: header.label
319
- }, () => [
320
- renderSlot(_ctx.$slots, `header-label-${header.key}`, {
321
- header,
322
- label: header.label
323
- }, () => [
324
- createTextVNode(toDisplayString(header.label), 1)
325
- ], !0),
326
- header.sortable ?? __props.sortable ? (openBlock(), createElementBlock("div", _hoisted_7, [
327
- createVNode(unref(MazArrowUp), {
328
- class: normalizeClass(["m-table-sort-icon maz-hidden group-hover:maz-block", {
329
- "--sorted": columnIndex === sortedColumnIndex.value,
330
- "--up": sortType.value === "DESC",
331
- "--down": sortType.value === "ASC"
332
- }])
333
- }, null, 8, ["class"])
334
- ])) : createCommentVNode("", !0)
335
- ], !0)
336
- ], 2)
337
- ]),
338
- _: 2
339
- }, 1032, ["scope", "align", "rowspan", "colspan", "headers", "style", "class", "onClick"]))), 128)),
340
- _ctx.$slots.actions ? (openBlock(), createBlock(unref(MazTableTitle), {
341
- key: 1,
342
- align: "left",
343
- class: normalizeClass(`--${unref(size)}`)
344
- }, {
345
- default: withCtx(() => [
346
- renderSlot(_ctx.$slots, "actions-header", {}, () => [
347
- createTextVNode(toDisplayString(messages.value.actionColumnTitle), 1)
348
- ], !0)
349
- ]),
350
- _: 3
351
- }, 8, ["class"])) : createCommentVNode("", !0)
352
- ]),
353
- _: 3
354
- })
355
- ], !0)
356
- ])) : createCommentVNode("", !0),
357
- __props.loading ? (openBlock(), createBlock(unref(MazLoadingBar), {
358
- key: 2,
359
- color: __props.color,
360
- class: "!maz-absolute"
361
- }, null, 8, ["color"])) : createCommentVNode("", !0),
362
- createElementVNode("tbody", {
363
- class: normalizeClass({ "--divider": hasDivider.value })
364
- }, [
365
- renderSlot(_ctx.$slots, "default", {}, () => [
366
- rowsFiltered.value.length > 0 ? (openBlock(!0), createElementBlock(Fragment, { key: 0 }, renderList(rowsFiltered.value, (row, rowIndex) => (openBlock(), createBlock(unref(MazTableRowComponent), {
367
- key: rowIndex,
368
- class: normalizeClass(row.classes),
369
- onClick: ($event) => row.action && row.action(row)
370
- }, {
371
- default: withCtx(() => [
372
- isSelectable.value ? (openBlock(), createBlock(unref(MazTableCell), {
373
- key: 0,
374
- class: "m-table-select-column"
375
- }, {
376
- default: withCtx(() => [
377
- renderSlot(_ctx.$slots, "select", {
378
- row,
379
- selected: row.selected
380
- }, () => [
381
- createVNode(unref(MazCheckbox), {
382
- size: "sm",
383
- "model-value": row.selected,
384
- "onUpdate:modelValue": ($event) => selectRow($event, rowIndex)
385
- }, null, 8, ["model-value", "onUpdate:modelValue"])
386
- ], !0)
387
- ]),
388
- _: 2
389
- }, 1024)) : createCommentVNode("", !0),
390
- (openBlock(!0), createElementBlock(Fragment, null, renderList(headersNormalized.value, ({ key, align, classes }, dataIndex) => (openBlock(), createBlock(unref(MazTableCell), {
391
- key: dataIndex,
392
- align,
393
- class: normalizeClass(classes)
394
- }, {
395
- default: withCtx(() => [
396
- key ? renderSlot(_ctx.$slots, "cell", {
397
- key: 0,
398
- row,
399
- value: row[key]
400
- }, () => [
401
- renderSlot(_ctx.$slots, `cell-${key}`, {
402
- row,
403
- value: row[key]
404
- }, () => [
405
- createTextVNode(toDisplayString(row[key]), 1)
406
- ], !0)
407
- ], !0) : createCommentVNode("", !0)
408
- ]),
409
- _: 2
410
- }, 1032, ["align", "class"]))), 128)),
411
- _ctx.$slots.actions ? (openBlock(), createBlock(unref(MazTableCell), { key: 1 }, {
412
- default: withCtx(() => [
413
- renderSlot(_ctx.$slots, "actions", { row }, void 0, !0)
414
- ]),
415
- _: 2
416
- }, 1024)) : createCommentVNode("", !0)
417
- ]),
418
- _: 2
419
- }, 1032, ["class", "onClick"]))), 128)) : (openBlock(), createBlock(unref(MazTableRowComponent), { key: 1 }, {
420
- default: withCtx(() => [
421
- createVNode(unref(MazTableCell), {
422
- colspan: headersNormalized.value.length + (isSelectable.value ? 1 : 0) + (_ctx.$slots.actions ? 1 : 0)
423
- }, {
424
- default: withCtx(() => [
425
- renderSlot(_ctx.$slots, "no-results", {}, () => [
426
- createElementVNode("p", _hoisted_8, [
427
- renderSlot(_ctx.$slots, "no-results-text", {}, () => [
428
- createTextVNode(toDisplayString(messages.value.noResults), 1)
429
- ], !0)
430
- ])
431
- ], !0)
432
- ]),
433
- _: 3
434
- }, 8, ["colspan"])
435
- ]),
436
- _: 3
437
- }))
438
- ], !0)
439
- ], 2)
440
- ], 6)
441
- ], 2),
442
- hasFooter.value ? (openBlock(), createElementBlock("div", _hoisted_9, [
443
- _cache[4] || (_cache[4] = createElementVNode("div", { class: "m-table-spacer" }, null, -1)),
444
- __props.pagination ? (openBlock(), createElementBlock("div", _hoisted_10, [
445
- createElementVNode("div", _hoisted_11, [
446
- createElementVNode("span", _hoisted_12, toDisplayString(messages.value.pagination.rowsPerPage), 1),
447
- createVNode(unref(MazSelect), {
448
- modelValue: pageSizeModel.value,
449
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => pageSizeModel.value = $event),
450
- options: pageSizeOptions.value,
451
- "rounded-size": __props.roundedSize,
452
- size: __props.inputSize ?? unref(size),
453
- color: __props.color,
454
- "list-position": "top",
455
- style: { width: "5rem" }
456
- }, null, 8, ["modelValue", "options", "rounded-size", "size", "color"])
457
- ]),
458
- totalPagesInternal.value ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(rowsFromTo.value.from) + " - " + toDisplayString(rowsFromTo.value.to) + " " + toDisplayString(messages.value.pagination.of) + " " + toDisplayString(totalItemsInternal.value), 1)) : createCommentVNode("", !0),
459
- createElementVNode("div", _hoisted_14, [
460
- createVNode(unref(MazBtn), {
461
- disabled: currentPageModel.value === 1,
462
- size: __props.inputSize ?? unref(size),
463
- color: "transparent",
464
- "rounded-size": __props.roundedSize,
465
- onClick: firstPage
466
- }, {
467
- default: withCtx(() => [
468
- createVNode(unref(MazChevronDoubleLeft), { class: "maz-text-base" })
469
- ]),
470
- _: 1
471
- }, 8, ["disabled", "size", "rounded-size"]),
472
- createVNode(unref(MazBtn), {
473
- disabled: currentPageModel.value === 1,
474
- size: __props.inputSize ?? unref(size),
475
- color: "transparent",
476
- "rounded-size": __props.roundedSize,
477
- onClick: previousPage
478
- }, {
479
- default: withCtx(() => [
480
- createVNode(unref(MazChevronLeft), { class: "maz-text-base" })
481
- ]),
482
- _: 1
483
- }, 8, ["disabled", "size", "rounded-size"]),
484
- createVNode(unref(MazBtn), {
485
- disabled: currentPageModel.value === totalPagesInternal.value,
486
- size: __props.inputSize ?? unref(size),
487
- color: "transparent",
488
- "rounded-size": __props.roundedSize,
489
- onClick: nextPage
490
- }, {
491
- default: withCtx(() => [
492
- createVNode(unref(MazChevronLeft), { class: "maz-rotate-180 maz-text-base" })
493
- ]),
494
- _: 1
495
- }, 8, ["disabled", "size", "rounded-size"]),
496
- createVNode(unref(MazBtn), {
497
- disabled: currentPageModel.value === totalPagesInternal.value,
498
- size: __props.inputSize ?? unref(size),
499
- color: "transparent",
500
- "rounded-size": __props.roundedSize,
501
- onClick: lastPage
502
- }, {
503
- default: withCtx(() => [
504
- createVNode(unref(MazChevronDoubleLeft), { class: "maz-rotate-180 maz-text-base" })
505
- ]),
506
- _: 1
507
- }, 8, ["disabled", "size", "rounded-size"])
508
- ])
509
- ])) : createCommentVNode("", !0)
510
- ])) : createCommentVNode("", !0)
511
- ], 2));
512
- }
513
- });
514
- export {
515
- _sfc_main as _,
516
- mazTableKey as m
517
- };
@@ -1,28 +0,0 @@
1
- import { defineComponent, ref, computed, provide, openBlock, createElementBlock, renderSlot } from "vue";
2
- const _hoisted_1 = { class: "m-tabs m-reset-css" }, _sfc_main = /* @__PURE__ */ defineComponent({
3
- __name: "MazTabs",
4
- props: {
5
- modelValue: {}
6
- },
7
- emits: ["update:model-value"],
8
- setup(__props, { emit: __emit }) {
9
- const props = __props, emits = __emit, localValue = ref(1), currentTab = computed({
10
- get: () => props.modelValue ?? localValue.value,
11
- set: (index) => {
12
- localValue.value = index, emits("update:model-value", index);
13
- }
14
- });
15
- function updateCurrentTab(index) {
16
- return currentTab.value = index, index;
17
- }
18
- return provide("maz-tabs", {
19
- currentTab,
20
- updateCurrentTab
21
- }), (_ctx, _cache) => (openBlock(), createElementBlock("div", _hoisted_1, [
22
- renderSlot(_ctx.$slots, "default")
23
- ]));
24
- }
25
- });
26
- export {
27
- _sfc_main as _
28
- };
@@ -1,26 +0,0 @@
1
- import { defineComponent, ref, watch, openBlock, createElementBlock, normalizeClass, renderSlot } from "vue";
2
- import { debounce } from "@maz-ui/utils/helpers/debounce";
3
- import { useInjectStrict } from "../composables/useInjectStrict.js";
4
- const _sfc_main = /* @__PURE__ */ defineComponent({
5
- __name: "MazTabsContent",
6
- setup(__props) {
7
- const hideOverflow = ref(!1), { currentTab } = useInjectStrict("maz-tabs"), allowOverFlow = debounce(() => {
8
- hideOverflow.value = !1;
9
- }, 700);
10
- function setOverflowHiddenTemp() {
11
- hideOverflow.value = !0, allowOverFlow();
12
- }
13
- return watch(
14
- () => currentTab.value,
15
- () => setOverflowHiddenTemp(),
16
- { immediate: !0 }
17
- ), (_ctx, _cache) => (openBlock(), createElementBlock("div", {
18
- class: normalizeClass(["m-tabs-content m-reset-css maz-relative", { "maz-overflow-hidden": hideOverflow.value }])
19
- }, [
20
- renderSlot(_ctx.$slots, "default")
21
- ], 2));
22
- }
23
- });
24
- export {
25
- _sfc_main as _
26
- };