maz-ui 3.46.1-beta.5 → 3.46.1-beta.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 (122) hide show
  1. package/components/MazBottomSheet.mjs +1 -1
  2. package/components/MazBtn.d.ts +5 -0
  3. package/components/MazBtn.mjs +1 -1
  4. package/components/MazCard.mjs +1 -1
  5. package/components/MazCarousel.mjs +1 -1
  6. package/components/MazDialog.mjs +1 -1
  7. package/components/MazDialogPromise.mjs +1 -1
  8. package/components/MazDrawer.mjs +1 -1
  9. package/components/MazDropdown.mjs +1 -1
  10. package/components/MazInput.mjs +1 -1
  11. package/components/MazInputNumber.mjs +1 -1
  12. package/components/MazInputPrice.mjs +1 -1
  13. package/components/MazInputTags.mjs +1 -1
  14. package/components/MazPagination.mjs +1 -1
  15. package/components/MazPhoneNumberInput.mjs +1 -1
  16. package/components/MazPicker.mjs +1 -1
  17. package/components/MazPullToRefresh.d.ts +2 -2
  18. package/components/MazSelect.mjs +1 -1
  19. package/components/MazTable.d.ts +2 -2
  20. package/components/MazTable.mjs +1 -1
  21. package/components/assets/MazBtn.css +1 -1
  22. package/components/assets/MazInputNumber.css +1 -1
  23. package/components/assets/MazInputTags.css +1 -1
  24. package/components/assets/MazPagination.css +1 -1
  25. package/components/assets/MazPicker.css +1 -1
  26. package/components/assets/MazSelect.css +1 -1
  27. package/components/assets/MazTable.css +1 -1
  28. package/components/chunks/{MazBottomSheet-s9lLaK1M.mjs → MazBottomSheet-DeAah_or.mjs} +1 -1
  29. package/components/chunks/MazBtn-BV212IYv.mjs +118 -0
  30. package/components/chunks/{MazBtn-CHABo63Y.mjs → MazBtn-BXvObcWn.mjs} +21 -19
  31. package/components/chunks/{MazBtn-BXdap6JU.mjs → MazBtn-C2dJYsnq.mjs} +21 -19
  32. package/components/chunks/MazBtn-C2htID_X.mjs +118 -0
  33. package/components/chunks/MazBtn-C4xZC-A2.mjs +118 -0
  34. package/components/chunks/{MazBtn-CVB5qDjV.mjs → MazBtn-C5IbN0rp.mjs} +34 -32
  35. package/components/chunks/MazBtn-CEFfMm7k.mjs +118 -0
  36. package/components/chunks/{MazBtn-BMmuCciQ.mjs → MazBtn-CESOVC-a.mjs} +20 -18
  37. package/components/chunks/MazBtn-CLFly8Ie.mjs +118 -0
  38. package/components/chunks/MazBtn-CRpqDW12.mjs +118 -0
  39. package/components/chunks/MazBtn-D2H26ExI.mjs +118 -0
  40. package/components/chunks/MazBtn-y4vRRWDg.mjs +118 -0
  41. package/components/chunks/{MazBtn-DarjZUV4.mjs → MazBtn-zMzxqcCs.mjs} +34 -32
  42. package/components/chunks/{MazCard-BaJ5Ee3I.mjs → MazCard-BF-2_gZV.mjs} +1 -1
  43. package/components/chunks/{MazCarousel-Bb4fpVqN.mjs → MazCarousel-DVBUt8NL.mjs} +1 -1
  44. package/components/chunks/{MazCheckbox-C4diNXJq.mjs → MazCheckbox-CEfJco3U.mjs} +1 -1
  45. package/components/chunks/MazCheckbox-CeVxgVY8.mjs +146 -0
  46. package/components/chunks/{MazCheckbox-8n6NtRBb.mjs → MazCheckbox-mgtQBs4K.mjs} +1 -1
  47. package/components/chunks/{MazDialog-Bv2PzQBz.mjs → MazDialog-fn7vXgBg.mjs} +1 -1
  48. package/components/chunks/{MazDialogPromise-BZLP9sXZ.mjs → MazDialogPromise-C8dpQb5k.mjs} +2 -2
  49. package/components/chunks/{MazGallery-C9secrXc.mjs → MazGallery-CXJsK5ve.mjs} +2 -2
  50. package/components/chunks/{MazIcon-CudB1a0D.mjs → MazIcon-BXX3RaoN.mjs} +1 -1
  51. package/components/chunks/{MazIcon-BaJm2s8_.mjs → MazIcon-DjMuw8Bz.mjs} +1 -1
  52. package/components/chunks/MazInput-AcA93-8Q.mjs +291 -0
  53. package/components/chunks/{MazInput-B3RzuuNv.mjs → MazInput-Dnwxraz4.mjs} +1 -1
  54. package/components/chunks/{MazInputNumber-mLgq5obR.mjs → MazInputNumber-OY_UqCMs.mjs} +173 -171
  55. package/components/chunks/{MazInputPrice-DhYRBqTS.mjs → MazInputPrice-DvVAZa12.mjs} +1 -1
  56. package/components/chunks/{MazInputTags-DinwbXaD.mjs → MazInputTags-DKlGT2IB.mjs} +170 -168
  57. package/components/chunks/MazLoadingBar-By1umvdC.mjs +32 -0
  58. package/components/chunks/{MazPagination-Cqnr19iI.mjs → MazPagination-BL9LU84U.mjs} +132 -130
  59. package/components/chunks/{MazPhoneNumberInput-C3GdtqN2.mjs → MazPhoneNumberInput-C7gUk5lg.mjs} +3 -3
  60. package/components/chunks/{MazPicker-DA92HhwS.mjs → MazPicker-Dhm3u2MN.mjs} +536 -534
  61. package/components/chunks/{MazPickerMonthSwitcher-CPWkw0Hq.mjs → MazPickerMonthSwitcher-ck8cl1-N.mjs} +1 -1
  62. package/components/chunks/{MazPickerShortcuts-Fwcoqg5M.mjs → MazPickerShortcuts-hEpUqVC-.mjs} +1 -1
  63. package/components/chunks/{MazPickerYearSwitcher-DfSXPGfT.mjs → MazPickerYearSwitcher-CmMxOc69.mjs} +1 -1
  64. package/components/chunks/MazSelect-CGsMRdr7.mjs +568 -0
  65. package/components/chunks/{MazSelect-DPTuyc26.mjs → MazSelect-ed445MXs.mjs} +2 -2
  66. package/components/chunks/{MazSpinner-BCQzF6j-.mjs → MazSpinner-Akyx5wgU.mjs} +1 -1
  67. package/components/chunks/{MazSpinner-B-mc1FWS.mjs → MazSpinner-B2dsE23u.mjs} +1 -1
  68. package/components/chunks/{MazSpinner-CVBz5HIx.mjs → MazSpinner-BCOeuzTB.mjs} +1 -1
  69. package/components/chunks/{MazSpinner-BpjK60ul.mjs → MazSpinner-BakExtKd.mjs} +1 -1
  70. package/components/chunks/{MazSpinner-CFJmcsGl.mjs → MazSpinner-C9meLNrb.mjs} +1 -1
  71. package/components/chunks/{MazSpinner-C2ok6AlJ.mjs → MazSpinner-CKOy0M1T.mjs} +1 -1
  72. package/components/chunks/MazSpinner-CL6orjX7.mjs +37 -0
  73. package/components/chunks/MazSpinner-CQTq0J6f.mjs +37 -0
  74. package/components/chunks/{MazSpinner-BEqvmPiV.mjs → MazSpinner-CeZk8jA9.mjs} +1 -1
  75. package/components/chunks/MazSpinner-CqS3onAE.mjs +37 -0
  76. package/components/chunks/MazSpinner-D1zj-581.mjs +37 -0
  77. package/components/chunks/MazSpinner-DJ2t85tY.mjs +37 -0
  78. package/components/chunks/{MazSpinner-DEdQlQr1.mjs → MazSpinner-DbaTlD5B.mjs} +1 -1
  79. package/components/chunks/MazSpinner-DgJ9tVv_.mjs +37 -0
  80. package/components/chunks/{MazSpinner-BCHAzmqS.mjs → MazSpinner-DoKvoICM.mjs} +1 -1
  81. package/components/chunks/MazSpinner-Oy4E193R.mjs +37 -0
  82. package/components/chunks/MazTable-QwG-Kh88.mjs +692 -0
  83. package/components/chunks/MazTableCell-BSNyqTSX.mjs +23 -0
  84. package/components/chunks/MazTableRow-CgubMdrX.mjs +30 -0
  85. package/components/chunks/MazTableTitle-h4dattYD.mjs +23 -0
  86. package/components/chunks/{MazTransitionExpand-BoTQeNNf.mjs → MazTransitionExpand-BvqRDM9d.mjs} +1 -1
  87. package/components/chunks/arrow-up-DjSlktWl.mjs +30 -0
  88. package/components/chunks/inject-strict-BmiaNiwC.mjs +10 -0
  89. package/components/chunks/useInstanceUniqId-DW9jO1Sz.mjs +11 -0
  90. package/css/main.css +1 -1
  91. package/modules/assets/MazBtn.css +1 -1
  92. package/modules/chunks/{MazBtn-BG2dUdHV.cjs → MazBtn-DeAZcD0R.cjs} +3 -3
  93. package/{components/chunks/MazBtn-CXxOU7fp.mjs → modules/chunks/MazBtn-DvffpPyV.mjs} +21 -19
  94. package/modules/chunks/{MazIcon-RkWxQ8JM.cjs → MazIcon-BiwOZEZl.cjs} +1 -1
  95. package/modules/chunks/{MazIcon-BqfELHOt.mjs → MazIcon-D2B0umvn.mjs} +1 -1
  96. package/modules/chunks/{MazSpinner-GfL807jq.cjs → MazSpinner-CZIYnX05.cjs} +1 -1
  97. package/modules/chunks/{MazSpinner-DgSRxVEo.mjs → MazSpinner-Csgl_Uho.mjs} +1 -1
  98. package/modules/chunks/index-B6Pf_QhC.cjs +149 -0
  99. package/modules/chunks/{index-aKGx1nxl.mjs → index-C34aEXzu.mjs} +319 -314
  100. package/modules/index.cjs +1 -1
  101. package/modules/index.mjs +1 -1
  102. package/nuxt/index.json +1 -1
  103. package/package.json +1 -1
  104. package/types/components/MazBtn.vue.d.ts +5 -0
  105. package/types/components/MazPullToRefresh.vue.d.ts +2 -2
  106. package/types/components/MazTable.vue.d.ts +2 -2
  107. package/components/chunks/MazBtn-CZSXnr3w.mjs +0 -116
  108. package/components/chunks/MazBtn-CwYBz6QO.mjs +0 -116
  109. package/components/chunks/MazBtn-DIE2eM-g.mjs +0 -116
  110. package/components/chunks/MazBtn-DKD-ZMaF.mjs +0 -116
  111. package/components/chunks/MazBtn-OKT5-Y4s.mjs +0 -116
  112. package/components/chunks/MazBtn-e3abHT2L.mjs +0 -116
  113. package/components/chunks/MazSpinner-BoG1T_ZX.mjs +0 -37
  114. package/components/chunks/MazSpinner-DhHVVBJE.mjs +0 -37
  115. package/components/chunks/MazSpinner-DuGaC-cw.mjs +0 -37
  116. package/components/chunks/MazSpinner-Iwon82He.mjs +0 -37
  117. package/components/chunks/MazSpinner-JbfjMNFL.mjs +0 -37
  118. package/components/chunks/MazSpinner-QgcgF5j5.mjs +0 -37
  119. package/components/chunks/MazSpinner-yQGVxaFm.mjs +0 -37
  120. package/components/chunks/MazTable-CrtVI-dp.mjs +0 -2015
  121. package/modules/chunks/MazBtn-BeqYSSYI.mjs +0 -116
  122. package/modules/chunks/index-CE2CsQsx.cjs +0 -149
@@ -1,2015 +0,0 @@
1
- import { openBlock as u, createElementBlock as z, createElementVNode as B, defineComponent as te, defineAsyncComponent as _, useAttrs as Je, useSlots as Ke, computed as c, createBlock as C, resolveDynamicComponent as de, normalizeClass as w, withCtx as K, createCommentVNode as d, renderSlot as I, unref as y, createVNode as M, useId as Xe, useCssVars as $e, ref as P, normalizeStyle as ie, mergeProps as Ee, createTextVNode as re, toDisplayString as F, onMounted as xe, withDirectives as Re, toHandlers as et, vModelDynamic as tt, withModifiers as ue, onBeforeMount as Ue, nextTick as Ce, Transition as ot, Fragment as me, renderList as we, inject as lt, toRefs as at, provide as nt, watch as ze } from "vue";
2
- import '../assets/MazTable.css';const st = {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- width: "1em",
5
- height: "1em",
6
- fill: "none",
7
- viewBox: "0 0 24 24"
8
- };
9
- function rt(f, n) {
10
- return u(), z("svg", st, n[0] || (n[0] = [
11
- B(
12
- "path",
13
- {
14
- stroke: "currentColor",
15
- "stroke-linecap": "round",
16
- "stroke-linejoin": "round",
17
- "stroke-width": "1.5",
18
- d: "M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"
19
- },
20
- null,
21
- -1
22
- /* HOISTED */
23
- )
24
- ]));
25
- }
26
- const it = { render: rt }, ut = {
27
- xmlns: "http://www.w3.org/2000/svg",
28
- width: "1em",
29
- height: "1em",
30
- fill: "none",
31
- viewBox: "0 0 24 24"
32
- };
33
- function dt(f, n) {
34
- return u(), z("svg", ut, n[0] || (n[0] = [
35
- B(
36
- "path",
37
- {
38
- stroke: "currentColor",
39
- "stroke-linecap": "round",
40
- "stroke-linejoin": "round",
41
- "stroke-width": "1.5",
42
- d: "m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5"
43
- },
44
- null,
45
- -1
46
- /* HOISTED */
47
- )
48
- ]));
49
- }
50
- const De = { render: dt }, ct = {
51
- xmlns: "http://www.w3.org/2000/svg",
52
- width: "1em",
53
- height: "1em",
54
- fill: "none",
55
- viewBox: "0 0 24 24"
56
- };
57
- function pt(f, n) {
58
- return u(), z("svg", ct, n[0] || (n[0] = [
59
- B(
60
- "path",
61
- {
62
- stroke: "currentColor",
63
- "stroke-linecap": "round",
64
- "stroke-linejoin": "round",
65
- "stroke-width": "1.5",
66
- d: "M15.75 19.5 8.25 12l7.5-7.5"
67
- },
68
- null,
69
- -1
70
- /* HOISTED */
71
- )
72
- ]));
73
- }
74
- const Fe = { render: pt }, ft = {
75
- xmlns: "http://www.w3.org/2000/svg",
76
- width: "1em",
77
- height: "1em",
78
- fill: "none",
79
- viewBox: "0 0 24 24"
80
- };
81
- function qe(f, n) {
82
- return u(), z("svg", ft, n[0] || (n[0] = [
83
- B(
84
- "path",
85
- {
86
- stroke: "currentColor",
87
- "stroke-linecap": "round",
88
- "stroke-linejoin": "round",
89
- "stroke-width": "1.5",
90
- d: "m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607"
91
- },
92
- null,
93
- -1
94
- /* HOISTED */
95
- )
96
- ]));
97
- }
98
- const Qe = { render: qe }, mt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
99
- __proto__: null,
100
- default: Qe,
101
- render: qe
102
- }, Symbol.toStringTag, { value: "Module" })), vt = {
103
- key: 2,
104
- class: "m-btn-loader-container"
105
- }, bt = /* @__PURE__ */ te({
106
- __name: "MazBtn",
107
- props: {
108
- variant: { default: "button" },
109
- size: { default: "md" },
110
- color: { default: "primary" },
111
- type: { default: "button" },
112
- rounded: { type: Boolean },
113
- roundedSize: { default: "lg" },
114
- noRounded: { type: Boolean },
115
- outline: { type: Boolean },
116
- pastel: { type: Boolean },
117
- block: { type: Boolean },
118
- noUnderline: { type: Boolean },
119
- loading: { type: Boolean },
120
- disabled: { type: Boolean },
121
- fab: { type: Boolean },
122
- icon: { type: [String, Function, Object], default: void 0 },
123
- leftIcon: { type: [String, Function, Object], default: void 0 },
124
- rightIcon: { type: [String, Function, Object], default: void 0 },
125
- noPadding: { type: Boolean },
126
- noElevation: { type: Boolean }
127
- },
128
- setup(f) {
129
- const n = f, e = _(() => import("./MazSpinner-BCHAzmqS.mjs")), o = _(() => import("./MazIcon-BaJm2s8_.mjs")), { href: i, to: b } = Je(), A = Ke(), V = c(() => i ? "a" : b ? "router-link" : "button"), W = c(
130
- () => n.pastel ? `--${n.color}-pastel` : n.outline ? `--${n.color}-outline` : `--${n.color}`
131
- ), L = c(
132
- () => (n.loading || n.disabled) && V.value === "button"
133
- ), $ = c(() => L.value ? "--cursor-default" : "--cursor-pointer"), H = c(() => `--is-${n.variant}`), G = c(() => n.loading && n.variant === "button"), R = c(() => !!A["left-icon"] || n.leftIcon), T = c(() => !!A["right-icon"] || n.rightIcon), j = c(() => R.value || T.value), U = c(() => n.icon || !!A.icon), v = c(() => V.value === "button" ? n.type : void 0), k = c(() => n.size === "xl" ? "maz-text-3xl" : n.size === "lg" ? "maz-text-2xl" : n.size === "md" ? "maz-text-xl" : n.size === "sm" ? "maz-text-lg" : n.size === "xs" ? "maz-text-base" : n.size === "mini" ? "maz-text-sm" : "md");
134
- return (h, Q) => (u(), C(de(V.value), {
135
- disabled: L.value || void 0,
136
- class: w(["m-btn", [
137
- `--${h.size}`,
138
- !h.fab && !h.rounded && h.roundedSize && `--rounded-${h.roundedSize}`,
139
- W.value,
140
- $.value,
141
- H.value,
142
- {
143
- "--block": h.block,
144
- "--no-underline": h.noUnderline,
145
- "--fab": h.fab,
146
- "--loading": h.loading,
147
- "--disabled": L.value,
148
- "--icon": j.value,
149
- "--rounded": h.rounded,
150
- "--no-rounded": h.noRounded,
151
- "--no-padding": h.noPadding,
152
- "--no-elevation": h.noElevation
153
- }
154
- ]]),
155
- type: v.value
156
- }, {
157
- default: K(() => [
158
- d(`
159
- @slot left-icon - The icon to display on the left of the button
160
- `),
161
- I(h.$slots, "left-icon", {}, () => [
162
- typeof h.leftIcon == "string" ? (u(), C(y(o), {
163
- key: 0,
164
- name: h.leftIcon,
165
- class: w([k.value])
166
- }, null, 8, ["name", "class"])) : h.leftIcon ? (u(), C(de(h.leftIcon), {
167
- key: 1,
168
- class: w([k.value])
169
- }, null, 8, ["class"])) : d("v-if", !0)
170
- ], !0),
171
- d(`
172
- @slot icon - The icon to display on the fab button
173
- `),
174
- U.value ? I(h.$slots, "icon", { key: 0 }, () => [
175
- typeof h.icon == "string" ? (u(), C(y(o), {
176
- key: 0,
177
- name: h.icon,
178
- class: w([k.value])
179
- }, null, 8, ["name", "class"])) : h.icon ? (u(), C(de(h.icon), {
180
- key: 1,
181
- class: w([k.value])
182
- }, null, 8, ["class"])) : d("v-if", !0)
183
- ], !0) : d("v-if", !0),
184
- d(`
185
- @slot default - The content of the button
186
- `),
187
- I(h.$slots, "default", {}, void 0, !0),
188
- d(`
189
- @slot left-icon - The icon to display on the left of the button
190
- `),
191
- T.value ? I(h.$slots, "right-icon", { key: 1 }, () => [
192
- typeof h.rightIcon == "string" ? (u(), C(y(o), {
193
- key: 0,
194
- name: h.rightIcon,
195
- class: w([k.value])
196
- }, null, 8, ["name", "class"])) : h.rightIcon ? (u(), C(de(h.rightIcon), {
197
- key: 1,
198
- class: w([k.value])
199
- }, null, 8, ["class"])) : d("v-if", !0)
200
- ], !0) : d("v-if", !0),
201
- G.value ? (u(), z("div", vt, [
202
- M(y(e), {
203
- size: "2em",
204
- color: h.color
205
- }, null, 8, ["color"])
206
- ])) : d("v-if", !0)
207
- ]),
208
- _: 3
209
- /* FORWARDED */
210
- }, 8, ["disabled", "class", "type"]));
211
- }
212
- }), oe = (f, n) => {
213
- const e = f.__vccOpts || f;
214
- for (const [o, i] of n)
215
- e[o] = i;
216
- return e;
217
- }, fe = /* @__PURE__ */ oe(bt, [["__scopeId", "data-v-8deef21f"]]), ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
218
- __proto__: null,
219
- default: fe
220
- }, Symbol.toStringTag, { value: "Module" }));
221
- function Ne({
222
- componentName: f,
223
- providedId: n
224
- }) {
225
- const e = Xe();
226
- return c(() => n ?? `${f}-${e}`);
227
- }
228
- const yt = {
229
- xmlns: "http://www.w3.org/2000/svg",
230
- width: "1em",
231
- height: "1em",
232
- fill: "none",
233
- viewBox: "0 0 24 24"
234
- };
235
- function We(f, n) {
236
- return u(), z("svg", yt, n[0] || (n[0] = [
237
- B(
238
- "path",
239
- {
240
- stroke: "currentColor",
241
- "stroke-linecap": "round",
242
- "stroke-linejoin": "round",
243
- "stroke-width": "1.5",
244
- d: "m4.5 12.75 6 6 9-13.5"
245
- },
246
- null,
247
- -1
248
- /* HOISTED */
249
- )
250
- ]));
251
- }
252
- const Ge = { render: We }, gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
253
- __proto__: null,
254
- default: Ge,
255
- render: We
256
- }, Symbol.toStringTag, { value: "Module" })), zt = ["for", "aria-checked"], kt = ["id", "checked", "disabled", "name"], wt = { class: "m-checkbox__text" }, St = /* @__PURE__ */ te({
257
- inheritAttrs: !1,
258
- __name: "MazCheckbox",
259
- props: {
260
- style: { default: void 0 },
261
- class: { default: void 0 },
262
- modelValue: { default: void 0 },
263
- id: { default: void 0 },
264
- color: { default: "primary" },
265
- value: { type: [String, Number, Boolean], default: void 0 },
266
- name: { default: "m-checkbox" },
267
- size: { default: "md" },
268
- label: { default: void 0 },
269
- disabled: { type: Boolean, default: !1 },
270
- error: { type: Boolean },
271
- success: { type: Boolean },
272
- warning: { type: Boolean },
273
- hint: {}
274
- },
275
- emits: ["update:model-value", "change", "blur", "focus"],
276
- setup(f, { emit: n }) {
277
- $e((v) => ({
278
- b7df6194: W.value,
279
- "89a0ef50": A.value,
280
- "199d7f11": L.value,
281
- b0e1d658: $.value
282
- }));
283
- const e = f, o = n, i = Ne({
284
- componentName: "MazCheckbox",
285
- providedId: e.id
286
- }), b = c(
287
- () => typeof e.value != "boolean" && Array.isArray(e.modelValue) ? e.modelValue.includes(e.value) : typeof e.modelValue == "boolean" ? e.modelValue : !1
288
- ), A = c(() => {
289
- switch (e.size) {
290
- case "xl":
291
- return "2rem";
292
- case "lg":
293
- return "1.75rem";
294
- case "sm":
295
- return "1.25rem";
296
- case "xs":
297
- return "1rem";
298
- case "mini":
299
- return "0.75rem";
300
- default:
301
- return "1.5rem";
302
- }
303
- }), V = c(() => {
304
- switch (e.size) {
305
- case "xl":
306
- return "maz-text-2xl";
307
- case "lg":
308
- return "maz-text-xl";
309
- case "sm":
310
- return "maz-text-base";
311
- case "xs":
312
- return "maz-text-sm";
313
- case "mini":
314
- return "maz-text-xs";
315
- default:
316
- return "maz-text-lg";
317
- }
318
- }), W = c(() => e.color === "theme" ? "var(--maz-color-bg)" : `var(--maz-color-${e.color}-contrast)`), L = c(() => e.color === "theme" ? "var(--maz-color-bg-theme)" : `var(--maz-color-${e.color})`), $ = c(() => e.error ? "var(--maz-color-danger)" : e.warning ? "var(--maz-color-warning)" : e.success ? "var(--maz-color-success)" : ["black", "transparent", "theme"].includes(e.color) ? "var(--maz-color-muted)" : `var(--maz-color-${e.color}-alpha)`);
319
- function H(v) {
320
- ["Space"].includes(v.code) && (v.preventDefault(), R(e.value ?? !e.modelValue));
321
- }
322
- function G(v) {
323
- return typeof v == "boolean" && (typeof e.modelValue == "boolean" || e.modelValue === void 0 || e.modelValue === null) ? !e.modelValue : Array.isArray(e.modelValue) && typeof v != "boolean" ? e.modelValue.includes(v) ? e.modelValue.filter((k) => k !== v) : [...e.modelValue, v] : [v];
324
- }
325
- function R(v) {
326
- const k = G(v);
327
- o("update:model-value", k), o("change", k);
328
- }
329
- const T = P();
330
- function j(v) {
331
- var k;
332
- (k = T.value) == null || k.dispatchEvent(new Event("blur")), o("blur", v);
333
- }
334
- function U(v) {
335
- var k;
336
- (k = T.value) == null || k.dispatchEvent(new Event("focus")), o("focus", v);
337
- }
338
- return (v, k) => (u(), z("label", {
339
- for: y(i),
340
- class: w(["m-checkbox", [{ "--disabled": v.disabled, "--error": v.error, "--warning": v.warning, "--success": v.success }, e.class]]),
341
- tabindex: "0",
342
- style: ie(v.style),
343
- role: "checkbox",
344
- "aria-checked": b.value,
345
- onKeydown: H,
346
- onBlur: j,
347
- onFocus: U
348
- }, [
349
- B("input", Ee({
350
- id: y(i),
351
- ref_key: "inputRef",
352
- ref: T,
353
- checked: b.value
354
- }, v.$attrs, {
355
- tabindex: "-1",
356
- disabled: v.disabled,
357
- name: v.name,
358
- type: "checkbox",
359
- onChange: k[0] || (k[0] = (h) => {
360
- var Q;
361
- return R(v.value ?? ((Q = h == null ? void 0 : h.target) == null ? void 0 : Q.checked));
362
- })
363
- }), null, 16, kt),
364
- B("span", null, [
365
- M(y(Ge), {
366
- class: w(["check-icon", V.value])
367
- }, null, 8, ["class"])
368
- ]),
369
- B("div", wt, [
370
- I(v.$slots, "default", { value: v.value }, () => [
371
- re(
372
- F(v.label),
373
- 1
374
- /* TEXT */
375
- )
376
- ], !0),
377
- v.hint ? (u(), z(
378
- "span",
379
- {
380
- key: 0,
381
- class: w(["m-checkbox__hint", {
382
- "--error": v.error,
383
- "--success": v.success,
384
- "--warning": v.warning
385
- }])
386
- },
387
- F(v.hint),
388
- 3
389
- /* TEXT, CLASS */
390
- )) : d("v-if", !0)
391
- ])
392
- ], 46, zt));
393
- }
394
- }), Le = /* @__PURE__ */ oe(St, [["__scopeId", "data-v-178c6a46"]]), $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
395
- __proto__: null,
396
- default: Le
397
- }, Symbol.toStringTag, { value: "Module" }));
398
- function It(f, n) {
399
- let e;
400
- return function(...o) {
401
- clearTimeout(e), e = setTimeout(() => {
402
- f.apply(this, o);
403
- }, n);
404
- };
405
- }
406
- const Vt = {
407
- key: 0,
408
- class: "m-input-wrapper-left"
409
- }, Bt = { class: "m-input-wrapper-input" }, Ct = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"], At = { key: 0 }, Mt = {
410
- key: 1,
411
- class: "m-input-wrapper-right"
412
- }, Tt = /* @__PURE__ */ te({
413
- inheritAttrs: !1,
414
- __name: "MazInput",
415
- props: {
416
- style: { default: void 0 },
417
- class: { default: void 0 },
418
- modelValue: { default: void 0 },
419
- placeholder: { default: void 0 },
420
- label: { default: void 0 },
421
- name: { default: void 0 },
422
- color: { default: "primary" },
423
- type: { default: "text" },
424
- required: { type: Boolean, default: !1 },
425
- disabled: { type: Boolean, default: !1 },
426
- readonly: { type: Boolean, default: !1 },
427
- id: { default: void 0 },
428
- error: { type: Boolean, default: !1 },
429
- success: { type: Boolean, default: !1 },
430
- warning: { type: Boolean, default: !1 },
431
- hint: { default: void 0 },
432
- inputClasses: { default: void 0 },
433
- noBorder: { type: Boolean, default: !1 },
434
- noRadius: { type: Boolean, default: !1 },
435
- inputmode: { default: "text" },
436
- size: { default: "md" },
437
- debounce: { type: [Boolean, Number], default: !1 },
438
- debounceDelay: { default: 500 },
439
- validButton: { type: Boolean, default: !1 },
440
- validButtonLoading: { type: Boolean, default: !1 },
441
- autoFocus: { type: Boolean, default: !1 },
442
- borderActive: { type: Boolean, default: !1 },
443
- leftIcon: { type: [String, Function, Object], default: void 0 },
444
- rightIcon: { type: [String, Function, Object], default: void 0 },
445
- roundedSize: { default: void 0 },
446
- block: { type: Boolean }
447
- },
448
- emits: ["update:model-value", "focus", "blur", "click", "change", "input"],
449
- setup(f, { emit: n }) {
450
- const e = f, o = n, i = _(() => Promise.resolve().then(() => ht)), b = _(() => import("./MazIcon-BaJm2s8_.mjs")), A = _(() => import("./eye-slash-BoO00xzs.mjs")), V = _(() => import("./eye-f8zAUc30.mjs")), W = _(() => Promise.resolve().then(() => gt)), L = P(!1), $ = P(!1), H = P(), G = Ne({
451
- componentName: "MazInput",
452
- providedId: e.id
453
- });
454
- xe(() => {
455
- var s;
456
- e.autoFocus && ((s = H.value) == null || s.focus());
457
- });
458
- const R = c(() => e.type === "password"), T = c(() => L.value ? "text" : e.type), j = c(() => {
459
- if (!e.noBorder) {
460
- if (e.error)
461
- return "maz-border-danger";
462
- if (e.success)
463
- return "maz-border-success";
464
- if (e.warning)
465
- return "maz-border-warning";
466
- if ($.value || e.borderActive) {
467
- if (e.color === "black")
468
- return "maz-border-black";
469
- if (e.color === "danger")
470
- return "maz-border-danger";
471
- if (e.color === "info")
472
- return "maz-border-info";
473
- if (e.color === "primary")
474
- return "maz-border-primary";
475
- if (e.color === "secondary")
476
- return "maz-border-secondary";
477
- if (e.color === "success")
478
- return "maz-border-success";
479
- if (e.color === "warning")
480
- return "maz-border-warning";
481
- if (e.color === "white")
482
- return "maz-border-white";
483
- }
484
- return "--default-border";
485
- }
486
- }), U = Ke(), v = c(() => {
487
- const { required: s, placeholder: D } = e;
488
- if (D)
489
- return s ? `${D} *` : D;
490
- }), k = c(() => X.value !== void 0 && X.value !== ""), h = It(
491
- (s) => {
492
- o("update:model-value", s);
493
- },
494
- typeof e.debounce == "number" ? e.debounce : e.debounceDelay ?? 500
495
- );
496
- function Q(s) {
497
- if (e.debounce)
498
- return h(s);
499
- o("update:model-value", s);
500
- }
501
- const X = c({
502
- get: () => e.modelValue,
503
- set: (s) => Q(s)
504
- }), ne = c(() => (!!e.label || !!e.hint) && ($.value || !!k.value || !!e.placeholder || ["date", "month", "week"].includes(e.type))), se = c(() => !!e.label || !!e.hint);
505
- function Y() {
506
- return !!U["right-icon"] || R.value || !!U["valid-button"] || e.validButton || !!e.rightIcon;
507
- }
508
- function O() {
509
- return !!U["left-icon"] || !!e.leftIcon;
510
- }
511
- function q(s) {
512
- o("focus", s), $.value = !0;
513
- }
514
- function le(s) {
515
- o("blur", s), $.value = !1;
516
- }
517
- function ce(s) {
518
- return o("change", s);
519
- }
520
- function Z(s) {
521
- return o("input", s);
522
- }
523
- return (s, D) => (u(), z(
524
- "div",
525
- {
526
- class: w(["m-input", [
527
- {
528
- "--is-focused": $.value || s.borderActive,
529
- "--should-up": ne.value,
530
- "--has-label": se.value,
531
- "--is-disabled": s.disabled,
532
- "--is-readonly": s.readonly,
533
- "--has-z-2": s.error || s.warning || s.success,
534
- "--has-state": s.error || s.warning || s.success,
535
- "--block": s.block
536
- },
537
- e.class,
538
- `--${s.color}`,
539
- `--${s.size}`
540
- ]]),
541
- style: ie(s.style)
542
- },
543
- [
544
- B(
545
- "div",
546
- {
547
- class: w(["m-input-wrapper", [
548
- s.inputClasses,
549
- j.value,
550
- s.roundedSize ? `--rounded-${s.roundedSize}` : { "maz-rounded": !s.noRadius }
551
- ]])
552
- },
553
- [
554
- O() ? (u(), z("div", Vt, [
555
- d(`
556
- @slot left-icon - The icon to display on the left of the input
557
- `),
558
- s.$slots["left-icon"] || s.leftIcon ? I(s.$slots, "left-icon", { key: 0 }, () => [
559
- typeof s.leftIcon == "string" ? (u(), C(y(b), {
560
- key: 0,
561
- name: s.leftIcon,
562
- class: "maz-text-xl maz-text-muted"
563
- }, null, 8, ["name"])) : s.leftIcon ? (u(), C(de(s.leftIcon), {
564
- key: 1,
565
- class: "maz-text-xl maz-text-muted"
566
- })) : d("v-if", !0)
567
- ], !0) : d("v-if", !0)
568
- ])) : d("v-if", !0),
569
- B("div", Bt, [
570
- Re(B("input", Ee({
571
- id: y(G),
572
- ref_key: "input",
573
- ref: H,
574
- "onUpdate:modelValue": D[0] || (D[0] = (x) => X.value = x),
575
- type: T.value,
576
- name: s.name
577
- }, s.$attrs, {
578
- inputmode: s.inputmode,
579
- placeholder: v.value,
580
- "aria-label": s.label || s.placeholder,
581
- disabled: s.disabled,
582
- readonly: s.readonly,
583
- required: s.required,
584
- class: "m-input-input"
585
- }, et({
586
- blur: le,
587
- focus: q,
588
- change: ce,
589
- input: Z
590
- }, !0), {
591
- onClick: D[1] || (D[1] = (x) => s.$emit("click", x))
592
- }), null, 16, Ct), [
593
- [tt, X.value]
594
- ]),
595
- s.label || s.hint ? (u(), z(
596
- "span",
597
- {
598
- key: 0,
599
- class: w(["m-input-label", [
600
- {
601
- "maz-text-danger-600": s.error,
602
- "maz-text-success-600": s.success,
603
- "maz-text-warning-600": s.warning
604
- }
605
- ]])
606
- },
607
- [
608
- re(
609
- F(s.hint || s.label) + " ",
610
- 1
611
- /* TEXT */
612
- ),
613
- s.required ? (u(), z("sup", At, "*")) : d("v-if", !0)
614
- ],
615
- 2
616
- /* CLASS */
617
- )) : d("v-if", !0)
618
- ]),
619
- Y() ? (u(), z("div", Mt, [
620
- d(`
621
- @slot right-icon - The icon to display on the right of the input
622
- `),
623
- s.$slots["right-icon"] || s.rightIcon ? I(s.$slots, "right-icon", { key: 0 }, () => [
624
- typeof s.rightIcon == "string" ? (u(), C(y(b), {
625
- key: 0,
626
- name: s.rightIcon,
627
- class: "maz-text-xl maz-text-muted"
628
- }, null, 8, ["name"])) : s.rightIcon ? (u(), C(de(s.rightIcon), {
629
- key: 1,
630
- class: "maz-text-xl maz-text-muted"
631
- })) : d("v-if", !0)
632
- ], !0) : d("v-if", !0),
633
- R.value ? (u(), C(y(i), {
634
- key: 1,
635
- color: "transparent",
636
- tabindex: "-1",
637
- size: "mini",
638
- onClick: D[2] || (D[2] = ue((x) => L.value = !L.value, ["stop"]))
639
- }, {
640
- default: K(() => [
641
- L.value ? (u(), C(y(A), {
642
- key: 0,
643
- class: "maz-text-xl maz-text-muted"
644
- })) : (u(), C(y(V), {
645
- key: 1,
646
- class: "maz-text-xl maz-text-muted"
647
- }))
648
- ]),
649
- _: 1
650
- /* STABLE */
651
- })) : d("v-if", !0),
652
- d(`
653
- @slot valid-button - Replace the valid button by your own
654
- `),
655
- s.$slots["valid-button"] || s.validButton ? I(s.$slots, "valid-button", { key: 2 }, () => [
656
- M(y(i), {
657
- color: "transparent",
658
- disabled: s.disabled,
659
- tabindex: "-1",
660
- loading: s.validButtonLoading,
661
- class: "m-input-valid-button",
662
- size: "mini",
663
- type: "submit"
664
- }, {
665
- default: K(() => [
666
- M(y(W), { class: "maz-text-2xl maz-text-normal" })
667
- ]),
668
- _: 1
669
- /* STABLE */
670
- }, 8, ["disabled", "loading"])
671
- ], !0) : d("v-if", !0)
672
- ])) : d("v-if", !0)
673
- ],
674
- 2
675
- /* CLASS */
676
- )
677
- ],
678
- 6
679
- /* CLASS, STYLE */
680
- ));
681
- }
682
- }), Oe = /* @__PURE__ */ oe(Tt, [["__scopeId", "data-v-b3e1e126"]]), Pt = { class: "m-loading-bar" }, Lt = /* @__PURE__ */ te({
683
- __name: "MazLoadingBar",
684
- props: {
685
- color: { default: "primary" },
686
- height: { default: "0.125rem" }
687
- },
688
- setup(f) {
689
- $e((o) => ({
690
- "67978ed9": o.height,
691
- "05ad2446": e.value.alpha,
692
- "943cd45e": e.value.main
693
- }));
694
- const n = f, e = c(() => ({
695
- alpha: `var(--maz-color-${n.color}-alpha-20)`,
696
- main: `var(--maz-color-${n.color})`
697
- }));
698
- return (o, i) => (u(), z("div", Pt, i[0] || (i[0] = [
699
- B(
700
- "div",
701
- null,
702
- null,
703
- -1
704
- /* HOISTED */
705
- )
706
- ])));
707
- }
708
- }), Ot = /* @__PURE__ */ oe(Lt, [["__scopeId", "data-v-3cd29bd9"]]), Kt = {
709
- removeAccents: !0,
710
- caseSensitive: !1,
711
- replaceSpaces: !0,
712
- removeSpecialCharacters: !1,
713
- trim: !0,
714
- normalizeSpaces: !0,
715
- removeNumbers: !1,
716
- customNormalizationForms: ["NFC", "NFKD"]
717
- };
718
- function Se(f, n) {
719
- const e = { ...Kt, ...n }, o = {
720
- À: "A",
721
- Á: "A",
722
- Â: "A",
723
- Ã: "A",
724
- Ä: "A",
725
- Å: "A",
726
- à: "a",
727
- á: "a",
728
- â: "a",
729
- ã: "a",
730
- ä: "a",
731
- å: "a",
732
- È: "E",
733
- É: "E",
734
- Ê: "E",
735
- Ë: "E",
736
- è: "e",
737
- é: "e",
738
- ê: "e",
739
- ë: "e",
740
- Î: "I",
741
- Ï: "I",
742
- í: "I",
743
- î: "i",
744
- ï: "i",
745
- Ô: "O",
746
- Õ: "O",
747
- Ö: "O",
748
- Ø: "O",
749
- ô: "o",
750
- õ: "o",
751
- ö: "o",
752
- ø: "o",
753
- Ù: "U",
754
- Ú: "U",
755
- Û: "U",
756
- Ü: "U",
757
- ù: "u",
758
- ú: "u",
759
- û: "u",
760
- ü: "u",
761
- Ç: "C",
762
- ç: "c",
763
- ÿ: "y",
764
- Ñ: "N",
765
- ñ: "n",
766
- ó: "o"
767
- };
768
- let i = f.toString();
769
- if (e.trim && (i = i.trim()), e.normalizeSpaces && (i = i.replaceAll(/\s+/g, " ")), e.replaceSpaces && (i = i.replaceAll(" ", "-")), e.removeNumbers && (i = i.replaceAll(/\d/g, "")), e.removeAccents && (i = i.replaceAll(/[ÀÁÂÃÄÅÇÈÉÊËÎÏÑÔÕÖØÙÚÛÜàáâãäåçèéêëíîïñóôõöøùúûüÿ]/g, (b) => o[b] || b), i = i.replaceAll(/[\u0300-\u036F]/g, "")), e.caseSensitive === !1 && (i = i.toLowerCase()), e.removeSpecialCharacters && (i = i.replaceAll(/[^\dA-Z-]/gi, "")), e.trim && (i = i.trim()), e.customNormalizationForms)
770
- for (const b of e.customNormalizationForms)
771
- i = i.normalize(b);
772
- return i;
773
- }
774
- function Et(f, n) {
775
- const e = f.length, o = n.length, i = [];
776
- for (let b = 0; b <= e; b++)
777
- i[b] = [b];
778
- for (let b = 0; b <= o; b++)
779
- i[0][b] = b;
780
- for (let b = 1; b <= e; b++)
781
- for (let A = 1; A <= o; A++) {
782
- const V = f[b - 1] === n[A - 1] ? 0 : 1;
783
- i[b][A] = Math.min(
784
- i[b - 1][A] + 1,
785
- i[b][A - 1] + 1,
786
- i[b - 1][A - 1] + V
787
- );
788
- }
789
- return i[e][o];
790
- }
791
- function Ye(f, n) {
792
- const e = Et(f, n), o = Math.max(f.length, n.length);
793
- return 1 - e / o;
794
- }
795
- function Nt(f, n, e = 0.75) {
796
- return Ye(f, n) >= e;
797
- }
798
- function Ae(f, n, e = 0.75) {
799
- const o = c(
800
- () => Se(typeof f == "string" ? f : f.value)
801
- ), i = c(
802
- () => Se(typeof n == "string" ? n : n.value)
803
- ), b = c(() => typeof e == "number" ? e : e.value), A = c(() => Ye(o.value, i.value));
804
- return {
805
- isMatching: c(
806
- () => Nt(o.value, i.value, b.value)
807
- ),
808
- score: A
809
- };
810
- }
811
- function Ze(f, n, e) {
812
- var A;
813
- f.stopPropagation();
814
- const o = typeof e.value == "function" ? e.value : e.value.handler, i = typeof e.value == "object" ? e.value.exclude : void 0;
815
- let b = !1;
816
- if (i && i.length > 0) {
817
- for (const V of i)
818
- if (!b && f.target instanceof HTMLElement) {
819
- const W = (A = document.querySelector(V)) == null ? void 0 : A.getAttribute("id");
820
- b = f.target.getAttribute("id") === W;
821
- }
822
- }
823
- !n.contains(f.target) && !b && (o == null || o());
824
- }
825
- function _e() {
826
- return document.ontouchstart === null ? "touchstart" : "click";
827
- }
828
- function jt(f, n) {
829
- const e = _e();
830
- document.removeEventListener(e, (o) => Ze(o, f, n));
831
- }
832
- function Dt(f, n) {
833
- if (typeof n.value != "function" && typeof n.value == "object" && typeof n.value.handler != "function") {
834
- console.error("[maz-ui](vClosable) v-closable directive requires a handler function");
835
- return;
836
- }
837
- const e = _e();
838
- document.addEventListener(e, (o) => Ze(o, f, n));
839
- }
840
- const Ft = {
841
- mounted: Dt,
842
- unmounted: jt
843
- };
844
- let Me = null;
845
- function Ht(f, n) {
846
- Me && clearTimeout(Me), Me = setTimeout(f, n);
847
- }
848
- const Rt = ["aria-label"], Ut = { class: "m-select-list__no-results" }, qt = {
849
- key: 2,
850
- class: "m-select-list__scroll-wrapper",
851
- tabindex: "-1"
852
- }, Qt = { class: "m-select-list-optgroup" }, Wt = ["onClick"], Gt = /* @__PURE__ */ te({
853
- inheritAttrs: !1,
854
- __name: "MazSelect",
855
- props: {
856
- style: { default: void 0 },
857
- class: { default: void 0 },
858
- id: { default: void 0 },
859
- modelValue: { default: void 0 },
860
- options: { default: void 0 },
861
- optionValueKey: { default: "value" },
862
- optionLabelKey: { default: "label" },
863
- optionInputValueKey: { default: "label" },
864
- listPosition: { default: "bottom left" },
865
- itemHeight: { default: void 0 },
866
- maxListHeight: { default: 240 },
867
- maxListWidth: { default: void 0 },
868
- minListHeight: { default: void 0 },
869
- minListWidth: { default: void 0 },
870
- size: { default: "md" },
871
- color: { default: "primary" },
872
- search: { type: Boolean },
873
- searchPlaceholder: { default: "Search in options" },
874
- searchThreshold: { default: 0.75 },
875
- open: { type: Boolean },
876
- multiple: { type: Boolean, default: void 0 },
877
- required: { type: Boolean },
878
- disabled: { type: Boolean },
879
- block: { type: Boolean },
880
- excludeSelectors: { default: void 0 },
881
- autocomplete: { default: "off" }
882
- },
883
- emits: ["close", "open", "blur", "focus", "change", "input", "update:model-value", "selected-option"],
884
- setup(f, { expose: n, emit: e }) {
885
- $e((t) => ({
886
- cb149e58: T.value,
887
- "215ff493": G.value,
888
- "64d6cfbb": R.value
889
- }));
890
- const o = f, i = e, b = _(() => Promise.resolve().then(() => $t)), A = _(() => Promise.resolve().then(() => mt)), V = _(() => import("./chevron-down-BkvtON3b.mjs")), W = _(() => import("./no-symbol-CIgKzsrB.mjs"));
891
- n({
892
- /** Method to open the option list */
893
- openList: ee,
894
- /** Method to close the option list */
895
- closeList: ae
896
- });
897
- const L = P(!1), $ = P(), H = c(
898
- () => ["black", "transparent", "white"].includes(o.color)
899
- ), G = c(
900
- () => H.value ? "var(--maz-color-black)" : `var(--maz-color-${o.color}-800)`
901
- ), R = c(
902
- () => H.value ? "var(--maz-color-muted)" : `var(--maz-color-${o.color}-100)`
903
- ), T = c(
904
- () => H.value ? "var(--maz-color-muted)" : `var(--maz-color-${o.color}-200)`
905
- ), j = c(() => L.value || o.open), U = Ne({
906
- componentName: "MazSelect",
907
- providedId: o.id
908
- });
909
- function v(t) {
910
- return {
911
- [o.optionValueKey]: t,
912
- [o.optionLabelKey]: t,
913
- [o.optionInputValueKey]: t
914
- };
915
- }
916
- function k(t) {
917
- return {
918
- ...t,
919
- [o.optionValueKey]: t[o.optionValueKey],
920
- [o.optionLabelKey]: t[o.optionLabelKey],
921
- [o.optionInputValueKey]: t[o.optionInputValueKey]
922
- };
923
- }
924
- const h = c(() => {
925
- var a;
926
- const t = [];
927
- if (!((a = o.options) != null && a.length))
928
- return [];
929
- for (const p of o.options)
930
- typeof p == "string" || typeof p == "number" || typeof p == "boolean" ? t.push(v(p)) : typeof p == "object" && "options" in p && Array.isArray(p.options) ? t.push(
931
- { label: p.label, isOptGroup: !0 },
932
- ...p.options.map(
933
- (r) => typeof r == "string" || typeof r == "number" || typeof r == "boolean" ? v(r) : k(r)
934
- )
935
- ) : t.push(k(p));
936
- return t;
937
- }), Q = c(
938
- () => {
939
- var t;
940
- return ((t = h.value) == null ? void 0 : t.filter((a) => o.multiple ? Array.isArray(o.modelValue) ? o.modelValue.includes(a[o.optionValueKey]) && !O(a[o.optionValueKey]) : !1 : o.modelValue === a[o.optionValueKey] && !O(a[o.optionValueKey]))) ?? [];
941
- }
942
- );
943
- Ue(() => {
944
- var t;
945
- (t = o.options) != null && t.length || console.warn("[maz-ui](MazSelect) you must provide options"), g();
946
- });
947
- const X = P(), ne = P(), se = P(), Y = P();
948
- function O(t) {
949
- return t == null;
950
- }
951
- function q(t) {
952
- var p;
953
- return (((p = Q.value) == null ? void 0 : p.some(
954
- (r) => r[o.optionValueKey] === t[o.optionValueKey]
955
- )) ?? !1) && !O(t[o.optionValueKey]);
956
- }
957
- const le = c(() => {
958
- var a;
959
- if (o.multiple && o.modelValue && Array.isArray(o.modelValue))
960
- return o.modelValue.map(
961
- (p) => {
962
- var r, S;
963
- return (S = (r = h.value) == null ? void 0 : r.find((N) => N[o.optionValueKey] === p)) == null ? void 0 : S[o.optionInputValueKey];
964
- }
965
- ).join(", ");
966
- const t = (a = h.value) == null ? void 0 : a.find(
967
- (p) => p[o.optionValueKey] === o.modelValue
968
- );
969
- return O(o.modelValue) || t == null ? void 0 : t[o.optionInputValueKey];
970
- }), ce = c(
971
- () => o.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
972
- ), Z = P(""), s = P("");
973
- function D(t, a) {
974
- return a && t && Se(t).includes(Se(a));
975
- }
976
- function x(t) {
977
- var a;
978
- return t ? (a = h.value) == null ? void 0 : a.filter((p) => {
979
- const r = p[o.optionLabelKey], S = p[o.optionValueKey], N = p[o.optionInputValueKey], J = o.searchThreshold;
980
- return D(r, t) || D(N, t) || D(S, t) || typeof r == "string" && Ae(r, t, J).isMatching.value || typeof N == "string" && Ae(N, t, J).isMatching.value || typeof S == "string" && Ae(S, t, J).isMatching.value;
981
- }) : h.value;
982
- }
983
- const E = c(() => x(Z.value));
984
- async function ae(t) {
985
- var p, r;
986
- if (!j.value)
987
- return;
988
- if (t && ("relatedTarget" in t && ((p = X.value) != null && p.contains(t.relatedTarget)) || t.type === "keydown"))
989
- return t.preventDefault();
990
- const a = t && "relatedTarget" in t && t.relatedTarget instanceof HTMLElement && t.relatedTarget.getAttribute("id");
991
- if ((r = o.excludeSelectors) != null && r.includes(`#${a}`))
992
- return t == null ? void 0 : t.preventDefault();
993
- await Ce(), L.value = !1, $.value = 0, i("close", t);
994
- }
995
- async function ee(t) {
996
- o.disabled || j.value || (t == null || t.preventDefault(), L.value = !0, await l(), i("focus", t), i("open", L.value));
997
- }
998
- function ve() {
999
- var t, a;
1000
- (a = ((t = ne.value) == null ? void 0 : t.$el).querySelector("input")) == null || a.focus();
1001
- }
1002
- function Ie() {
1003
- var t, a;
1004
- (a = ((t = ne.value) == null ? void 0 : t.$el).querySelector("input")) == null || a.dispatchEvent(new Event("input"));
1005
- }
1006
- function be(t) {
1007
- L.value ? ae(t) : ve();
1008
- }
1009
- function Ve(t) {
1010
- var a, p;
1011
- Z.value = t, (p = ((a = se.value) == null ? void 0 : a.$el).querySelector("input")) == null || p.focus();
1012
- }
1013
- function he(t) {
1014
- var p;
1015
- t === "Backspace" && s.value.length > 0 ? s.value = s.value.slice(0, -1) : s.value += t;
1016
- const a = x(s.value);
1017
- a != null && a.length && ($.value = (p = E.value) == null ? void 0 : p.findIndex(
1018
- (r) => r[o.optionValueKey] === a[0][o.optionValueKey]
1019
- ), typeof $.value == "number" && $.value >= 0 && l($.value)), Ht(() => {
1020
- s.value = "";
1021
- }, 1e3);
1022
- }
1023
- function Be(t) {
1024
- const a = t.key;
1025
- /^[\dA-Za-z\u0400-\u04FF]$/.test(a) ? (t.preventDefault(), ee(t), o.search ? Ve(a) : he(a)) : ye(t);
1026
- }
1027
- function ye(t, a = !0) {
1028
- const p = t.code, r = ["ArrowUp", "ArrowDown"].includes(p), S = (a ? ["Enter", "Space"] : ["Enter"]).includes(p), N = p === "Escape" && j.value;
1029
- r ? pe(t, $.value) : S ? ge(t, $.value) : N && ae(t);
1030
- }
1031
- function pe(t, a) {
1032
- var S;
1033
- t.preventDefault();
1034
- const p = t.code;
1035
- j.value || ee(t);
1036
- const r = (S = E.value) == null ? void 0 : S.length;
1037
- r && (typeof a == "number" ? a === r - 1 && p === "ArrowDown" ? $.value = 0 : a === 0 && p === "ArrowUp" ? $.value = r - 1 : $.value = p === "ArrowDown" ? a + 1 : a - 1 : $.value = p === "ArrowDown" ? 0 : r - 1, l($.value));
1038
- }
1039
- function ge(t, a) {
1040
- var r, S, N;
1041
- if (t.preventDefault(), !j.value)
1042
- return ee(t);
1043
- const p = a ? ((r = E.value) == null ? void 0 : r[a]) ?? ((S = E.value) == null ? void 0 : S[0]) : (N = E.value) == null ? void 0 : N[0];
1044
- O(p) || m(p);
1045
- }
1046
- async function l(t) {
1047
- var p, r;
1048
- await Ce(), typeof t != "number" && g();
1049
- const a = t ?? $.value;
1050
- if (typeof a == "number" && a >= 0) {
1051
- const S = (p = Y.value) == null ? void 0 : p.querySelectorAll(".m-select-list-item");
1052
- (r = S == null ? void 0 : S[a]) == null || r.scrollIntoView({
1053
- behavior: "auto",
1054
- block: "nearest",
1055
- inline: "start"
1056
- });
1057
- }
1058
- }
1059
- function g(t) {
1060
- var p;
1061
- const a = (p = E.value) == null ? void 0 : p.findIndex((r) => {
1062
- var S, N;
1063
- return o.multiple && Array.isArray(o.modelValue) ? t ? t[o.optionValueKey] === r[o.optionValueKey] : [...o.modelValue].reverse()[0] === r[o.optionValueKey] : ((N = (S = Q.value) == null ? void 0 : S[0]) == null ? void 0 : N[o.optionValueKey]) === r[o.optionValueKey];
1064
- });
1065
- $.value = a && a >= 0 ? a : 0;
1066
- }
1067
- function m(t, a = !0) {
1068
- var N;
1069
- a && !o.multiple && Ce(() => ae()), Z.value = "";
1070
- const p = (N = Q.value) == null ? void 0 : N.some(
1071
- (J) => J[o.optionValueKey] === t[o.optionValueKey]
1072
- );
1073
- let r = Q.value;
1074
- p && o.multiple ? r = r == null ? void 0 : r.filter(
1075
- (J) => J[o.optionValueKey] !== t[o.optionValueKey]
1076
- ) : o.multiple ? r.push(t) : r = [t];
1077
- const S = r.map((J) => J[o.optionValueKey]);
1078
- i("update:model-value", o.multiple ? S : S[0]), i("selected-option", t), Ie(), g(t), ve();
1079
- }
1080
- return (t, a) => {
1081
- var p;
1082
- return Re((u(), z(
1083
- "div",
1084
- {
1085
- ref_key: "mazSelectElement",
1086
- ref: X,
1087
- class: w(["m-select", [
1088
- { "--is-open": j.value, "--disabled": t.disabled, "--block": t.block },
1089
- o.class,
1090
- `--${t.size}`
1091
- ]]),
1092
- style: ie(t.style)
1093
- },
1094
- [
1095
- M(Oe, Ee({
1096
- id: y(U),
1097
- ref_key: "mazInputComponent",
1098
- ref: ne,
1099
- class: "m-select-input"
1100
- }, t.$attrs, {
1101
- required: t.required,
1102
- "border-active": L.value,
1103
- color: t.color,
1104
- "model-value": le.value,
1105
- size: t.size,
1106
- block: "",
1107
- autocomplete: t.autocomplete,
1108
- disabled: t.disabled,
1109
- onFocus: ue(ee, ["prevent", "stop"]),
1110
- onBlur: ue(ae, ["prevent", "stop"]),
1111
- onClick: ue(ee, ["prevent", "stop"]),
1112
- onChange: a[0] || (a[0] = (r) => i("change", r)),
1113
- onInput: a[1] || (a[1] = (r) => i("input", r)),
1114
- onKeydown: Be
1115
- }), {
1116
- "right-icon": K(() => [
1117
- B("button", {
1118
- tabindex: "-1",
1119
- type: "button",
1120
- class: "m-select-input__toggle-button maz-custom",
1121
- "aria-label": `${j.value ? "collapse" : "expand"} list of options`,
1122
- onClick: ue(be, ["stop"])
1123
- }, [
1124
- M(y(V), { class: "m-select-chevron maz-text-xl" })
1125
- ], 8, Rt)
1126
- ]),
1127
- _: 1
1128
- /* STABLE */
1129
- }, 16, ["id", "required", "border-active", "color", "model-value", "size", "autocomplete", "disabled"]),
1130
- M(ot, { name: ce.value }, {
1131
- default: K(() => [
1132
- j.value ? (u(), z(
1133
- "div",
1134
- {
1135
- key: 0,
1136
- ref_key: "optionsListElement",
1137
- ref: Y,
1138
- class: w(["m-select-list", {
1139
- "--top": t.listPosition.includes("top"),
1140
- "--left": t.listPosition.includes("left"),
1141
- "--right": t.listPosition.includes("right"),
1142
- "--bottom": t.listPosition.includes("bottom")
1143
- }]),
1144
- style: ie({
1145
- maxHeight: `${t.maxListHeight}px`,
1146
- maxWidth: `${t.maxListWidth}px`,
1147
- minHeight: `${t.minListHeight}px`,
1148
- minWidth: `${t.minListWidth}px`
1149
- })
1150
- },
1151
- [
1152
- t.search ? (u(), C(Oe, {
1153
- key: 0,
1154
- ref_key: "searchInputComponent",
1155
- ref: se,
1156
- modelValue: Z.value,
1157
- "onUpdate:modelValue": [
1158
- a[2] || (a[2] = (r) => Z.value = r),
1159
- a[4] || (a[4] = (r) => $.value = 0)
1160
- ],
1161
- size: "sm",
1162
- color: t.color,
1163
- placeholder: t.searchPlaceholder,
1164
- name: "search",
1165
- inputmode: "search",
1166
- autocomplete: "off",
1167
- tabindex: "-1",
1168
- class: "m-select-list__search-input maz-flex-none",
1169
- "left-icon": y(A),
1170
- onKeydown: a[3] || (a[3] = (r) => ye(r, !1))
1171
- }, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : d("v-if", !0),
1172
- d(`
1173
- @slot No results slot - Displayed when no results corresponding with search query
1174
- `),
1175
- !E.value || E.value.length <= 0 ? I(t.$slots, "no-results", { key: 1 }, () => [
1176
- B("span", Ut, [
1177
- M(y(W), { class: "maz-h-6 maz-w-6 maz-text-normal" })
1178
- ])
1179
- ], !0) : (u(), z("div", qt, [
1180
- (u(!0), z(
1181
- me,
1182
- null,
1183
- we(E.value, (r, S) => (u(), z(
1184
- me,
1185
- { key: S },
1186
- [
1187
- d(`
1188
- @slot Custom optgroup label
1189
- @binding {String} label - the label of the optgroup
1190
- `),
1191
- r.label && r.isOptGroup ? I(t.$slots, "optgroup", {
1192
- key: 0,
1193
- label: r.label
1194
- }, () => [
1195
- B(
1196
- "span",
1197
- Qt,
1198
- F(r.label),
1199
- 1
1200
- /* TEXT */
1201
- )
1202
- ], !0) : (u(), z("button", {
1203
- key: 1,
1204
- tabindex: "-1",
1205
- type: "button",
1206
- class: w(["m-select-list-item maz-custom maz-flex-none", [
1207
- {
1208
- "--is-keyboard-selected": $.value === S,
1209
- "--is-selected": q(r),
1210
- "--is-none-value": O(r[t.optionValueKey])
1211
- }
1212
- ]]),
1213
- style: ie(t.itemHeight ? { height: `${t.itemHeight}px` } : void 0),
1214
- onClick: ue((N) => m(r), ["prevent", "stop"])
1215
- }, [
1216
- t.multiple ? (u(), C(y(b), {
1217
- key: 0,
1218
- tabindex: "-1",
1219
- "model-value": q(r),
1220
- size: "sm",
1221
- color: t.color
1222
- }, null, 8, ["model-value", "color"])) : d("v-if", !0),
1223
- d(`
1224
- @slot Custom option
1225
- @binding {Object} option - the option object
1226
- @binding {Boolean} is-selected - if the option is selected
1227
- `),
1228
- I(t.$slots, "default", {
1229
- option: r,
1230
- isSelected: q(r)
1231
- }, () => [
1232
- B(
1233
- "span",
1234
- null,
1235
- F(r[t.optionLabelKey]),
1236
- 1
1237
- /* TEXT */
1238
- )
1239
- ], !0)
1240
- ], 14, Wt))
1241
- ],
1242
- 64
1243
- /* STABLE_FRAGMENT */
1244
- ))),
1245
- 128
1246
- /* KEYED_FRAGMENT */
1247
- ))
1248
- ]))
1249
- ],
1250
- 6
1251
- /* CLASS, STYLE */
1252
- )) : d("v-if", !0)
1253
- ]),
1254
- _: 3
1255
- /* FORWARDED */
1256
- }, 8, ["name"])
1257
- ],
1258
- 6
1259
- /* CLASS, STYLE */
1260
- )), [
1261
- [y(Ft), {
1262
- exclude: (p = t.excludeSelectors) != null && p.length ? t.excludeSelectors : [],
1263
- handler: ae
1264
- }]
1265
- ]);
1266
- };
1267
- }
1268
- }), He = /* @__PURE__ */ oe(Gt, [["__scopeId", "data-v-e35a36a6"]]);
1269
- function je(f, n) {
1270
- const e = lt(f, n);
1271
- if (!e)
1272
- throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${f}`);
1273
- return e;
1274
- }
1275
- const Yt = /* @__PURE__ */ te({
1276
- __name: "MazTableCell",
1277
- setup(f) {
1278
- const { size: n } = je("maz-table");
1279
- return (e, o) => (u(), z(
1280
- "td",
1281
- {
1282
- class: w(["m-table-cell", `--${y(n)}`])
1283
- },
1284
- [
1285
- I(e.$slots, "default", {}, void 0, !0)
1286
- ],
1287
- 2
1288
- /* CLASS */
1289
- ));
1290
- }
1291
- }), ke = /* @__PURE__ */ oe(Yt, [["__scopeId", "data-v-15457736"]]), Zt = /* @__PURE__ */ te({
1292
- __name: "MazTableRow",
1293
- props: {
1294
- noHoverable: { type: Boolean }
1295
- },
1296
- setup(f) {
1297
- const { hoverable: n, backgroundEven: e, backgroundOdd: o } = je("maz-table");
1298
- return (i, b) => (u(), z(
1299
- "tr",
1300
- {
1301
- class: w(["m-table-row", {
1302
- "--hoverable": y(n) && !i.noHoverable,
1303
- "--background-odd": y(o),
1304
- "--background-even": y(e)
1305
- }])
1306
- },
1307
- [
1308
- I(i.$slots, "default", {}, void 0, !0)
1309
- ],
1310
- 2
1311
- /* CLASS */
1312
- ));
1313
- }
1314
- }), Te = /* @__PURE__ */ oe(Zt, [["__scopeId", "data-v-aabc42eb"]]), _t = /* @__PURE__ */ te({
1315
- __name: "MazTableTitle",
1316
- setup(f) {
1317
- const { size: n } = je("maz-table");
1318
- return (e, o) => (u(), z(
1319
- "th",
1320
- {
1321
- class: w(["m-table-title", `--${y(n)}`])
1322
- },
1323
- [
1324
- I(e.$slots, "default", {}, void 0, !0)
1325
- ],
1326
- 2
1327
- /* CLASS */
1328
- ));
1329
- }
1330
- }), Pe = /* @__PURE__ */ oe(_t, [["__scopeId", "data-v-b12e9afc"]]), Jt = {
1331
- key: 0,
1332
- class: "m-table-header"
1333
- }, Xt = {
1334
- key: 0,
1335
- class: "m-table-spacer"
1336
- }, xt = { class: "m-table-header-title" }, eo = {
1337
- key: 1,
1338
- class: "m-table-header-search"
1339
- }, to = { key: 0 }, oo = { key: 1 }, lo = {
1340
- key: 0,
1341
- class: "m-table-sort-icon-wrapper"
1342
- }, ao = { class: "maz-text-center maz-text-muted" }, no = {
1343
- key: 1,
1344
- class: "m-table-footer"
1345
- }, so = {
1346
- key: 0,
1347
- class: "m-table-footer-pagination"
1348
- }, ro = { class: "m-table-footer-pagination-items-per-page" }, io = { class: "maz-hidden maz-text-sm tab-s:maz-block" }, uo = {
1349
- key: 0,
1350
- class: "maz-whitespace-nowrap maz-text-sm"
1351
- }, co = { class: "m-table-footer-pagination-buttons" }, po = /* @__PURE__ */ te({
1352
- __name: "MazTable",
1353
- props: {
1354
- tableClass: { default: void 0 },
1355
- tableStyle: { type: [Boolean, null, String, Object, Array], default: void 0 },
1356
- modelValue: { default: void 0 },
1357
- size: { default: "md" },
1358
- searchInputSize: {},
1359
- title: { default: void 0 },
1360
- headers: { default: void 0 },
1361
- sortable: { type: Boolean },
1362
- headersAlign: { default: "left" },
1363
- rows: { default: void 0 },
1364
- hoverable: { type: Boolean },
1365
- search: { type: Boolean },
1366
- noSearchInRow: { type: Boolean },
1367
- searchPlaceholder: { default: "Search" },
1368
- noSearchBy: { type: Boolean },
1369
- searchByPlaceholder: { default: "Search by" },
1370
- searchByAllLabel: { default: "All" },
1371
- searchQuery: { default: void 0 },
1372
- backgroundOdd: { type: Boolean },
1373
- backgroundEven: { type: Boolean },
1374
- elevation: { type: Boolean },
1375
- divider: { type: Boolean },
1376
- caption: { default: void 0 },
1377
- captionSide: { default: "bottom" },
1378
- pagination: { type: Boolean },
1379
- page: { default: 1 },
1380
- pageSize: { default: 20 },
1381
- totalPages: { default: void 0 },
1382
- paginationAllLabel: { default: "All" },
1383
- noPaginateRows: { type: Boolean },
1384
- totalItems: { default: void 0 },
1385
- loading: { type: Boolean },
1386
- selectable: { type: Boolean },
1387
- selectedKey: { default: void 0 },
1388
- tableLayout: { default: void 0 },
1389
- color: { default: "primary" },
1390
- translations: {},
1391
- roundedSize: { default: "lg" }
1392
- },
1393
- emits: ["update:model-value", "update:search-query", "update:page", "update:page-size"],
1394
- setup(f, { emit: n }) {
1395
- $e((l) => ({
1396
- "0abd42a6": e.tableLayout,
1397
- fb9d531c: e.captionSide
1398
- }));
1399
- const e = f, o = n, i = {
1400
- noResults: "No results",
1401
- actionHeader: "Actions",
1402
- searchByAllLabel: "All",
1403
- searchByPlaceholder: "Search by",
1404
- searchPlaceholder: "Search",
1405
- paginationAllLabel: "All",
1406
- paginationRowsPerPage: "Rows per page",
1407
- paginationOf: "of"
1408
- }, b = c(() => {
1409
- const { translations: l, searchByAllLabel: g, searchByPlaceholder: m, searchPlaceholder: t, paginationAllLabel: a } = e;
1410
- return {
1411
- ...i,
1412
- ...l,
1413
- searchByAllLabel: g,
1414
- searchByPlaceholder: m,
1415
- searchPlaceholder: t,
1416
- paginationAllLabel: a
1417
- };
1418
- }), A = c(
1419
- () => e.divider && !e.backgroundEven && !e.backgroundOdd
1420
- ), { size: V, hoverable: W, backgroundEven: L, backgroundOdd: $ } = at(e);
1421
- nt("maz-table", {
1422
- size: V,
1423
- hoverable: W,
1424
- backgroundEven: L,
1425
- backgroundOdd: $
1426
- });
1427
- const H = P(be()), G = c(() => e.selectable || !!e.selectedKey), R = P(e.page);
1428
- ze(
1429
- () => e.page,
1430
- (l) => {
1431
- R.value = l;
1432
- }
1433
- );
1434
- const T = c({
1435
- get: () => R.value,
1436
- set: (l) => {
1437
- R.value = l, o("update:page", l);
1438
- }
1439
- }), j = c(() => [
1440
- { label: b.value.paginationAllLabel, value: Number.POSITIVE_INFINITY },
1441
- { label: 5, value: 5 },
1442
- { label: 10, value: 10 },
1443
- { label: 20, value: 20 },
1444
- { label: 50, value: 50 },
1445
- { label: 100, value: 100 },
1446
- { label: 200, value: 200 }
1447
- ]), U = P(e.pageSize);
1448
- ze(
1449
- () => e.pageSize,
1450
- (l) => {
1451
- U.value = l;
1452
- }
1453
- );
1454
- const v = c({
1455
- get: () => U.value,
1456
- set: (l) => {
1457
- U.value = l, o("update:page-size", l);
1458
- }
1459
- }), k = c(() => {
1460
- var l;
1461
- return e.totalPages ?? (v.value === Number.POSITIVE_INFINITY || !((l = e.rows) != null && l.length)) ? 1 : Math.ceil(e.rows.length / v.value);
1462
- });
1463
- function h() {
1464
- T.value = 1;
1465
- }
1466
- function Q() {
1467
- T.value = k.value;
1468
- }
1469
- function X() {
1470
- T.value = T.value - 1;
1471
- }
1472
- function ne() {
1473
- T.value = T.value + 1;
1474
- }
1475
- const se = c(() => {
1476
- if (!e.pagination || e.noPaginateRows || v.value === Number.POSITIVE_INFINITY)
1477
- return H.value;
1478
- const l = (R.value - 1) * v.value, g = l + v.value;
1479
- return H.value.slice(l, g);
1480
- });
1481
- ze(
1482
- () => [e.rows, e.modelValue],
1483
- () => {
1484
- H.value = be();
1485
- }
1486
- );
1487
- const Y = P(), O = P(), q = P(Ie()), le = P("all"), ce = c(() => [
1488
- { label: e.searchByAllLabel, value: "all" },
1489
- ...q.value.map((l) => ({
1490
- label: l.label,
1491
- value: l.key
1492
- }))
1493
- ]), Z = P(e.searchQuery);
1494
- ze(
1495
- () => e.searchQuery,
1496
- (l) => {
1497
- Z.value = l;
1498
- }
1499
- );
1500
- const s = c({
1501
- get: () => Z.value,
1502
- set: (l) => {
1503
- Z.value = l, o("update:search-query", l);
1504
- }
1505
- });
1506
- function D(l) {
1507
- return [...l].sort((g, m) => {
1508
- if (Y.value === void 0 || O.value === void 0)
1509
- return 0;
1510
- const t = g[q.value[Y.value].key], a = m[q.value[Y.value].key];
1511
- return typeof t == "string" && typeof a == "string" ? O.value === "ASC" ? t.localeCompare(a) : a.localeCompare(t) : O.value === "ASC" ? t - a : a - t;
1512
- });
1513
- }
1514
- function x(l) {
1515
- if (e.noSearchInRow || typeof s.value != "string")
1516
- return se.value;
1517
- const g = s.value.toLowerCase();
1518
- return [...l].filter((m) => le.value ? String(m[le.value]).toLowerCase().includes(g) : Object.values(m).some((t) => typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? String(t).toLowerCase().includes(g) : !1));
1519
- }
1520
- const E = c(() => {
1521
- const l = x(se.value);
1522
- return D(l);
1523
- }), ae = Ke(), ee = c(() => e.search || !!e.title || !!ae.title), ve = c(() => e.pagination);
1524
- function Ie() {
1525
- var l;
1526
- return ((l = e.headers) == null ? void 0 : l.map(
1527
- (g) => typeof g == "string" ? { label: g, align: e.headersAlign } : { align: e.headersAlign, thHeaders: g.headers, ...g }
1528
- )) ?? [];
1529
- }
1530
- function be() {
1531
- var l;
1532
- return ((l = e.rows) == null ? void 0 : l.map((g) => {
1533
- var m;
1534
- return {
1535
- selected: (m = e.modelValue) == null ? void 0 : m.includes(e.selectedKey ? g[e.selectedKey] : g),
1536
- ...g
1537
- };
1538
- })) ?? [];
1539
- }
1540
- function Ve(l) {
1541
- l === Y.value ? O.value = O.value === void 0 ? "DESC" : O.value === "DESC" ? "ASC" : void 0 : O.value = "DESC", Y.value = O.value === void 0 ? void 0 : l;
1542
- }
1543
- const he = c({
1544
- get: () => E.value.every((l) => l.selected) ?? !1,
1545
- set: Be
1546
- });
1547
- function Be(l) {
1548
- for (const g of E.value)
1549
- g.selected = l;
1550
- pe();
1551
- }
1552
- function ye(l, g) {
1553
- E.value[g].selected = l, pe();
1554
- }
1555
- function pe(l) {
1556
- l = l ?? ge();
1557
- const g = l != null && l.length ? l : void 0;
1558
- o("update:model-value", g);
1559
- }
1560
- function ge() {
1561
- return E.value.filter((l) => l.selected).map((l) => e.selectedKey ? l[e.selectedKey] : l);
1562
- }
1563
- return Ue(() => {
1564
- const l = ge();
1565
- l != null && l.length && pe(l);
1566
- }), (l, g) => (u(), z(
1567
- "div",
1568
- {
1569
- class: w(["m-table", { "--has-header": ee.value }])
1570
- },
1571
- [
1572
- ee.value ? (u(), z("div", Jt, [
1573
- l.title || l.$slots.title ? (u(), z("div", Xt, [
1574
- I(l.$slots, "title", {}, () => [
1575
- B(
1576
- "span",
1577
- xt,
1578
- F(l.title),
1579
- 1
1580
- /* TEXT */
1581
- )
1582
- ], !0)
1583
- ])) : d("v-if", !0),
1584
- l.search ? (u(), z("div", eo, [
1585
- l.noSearchBy ? d("v-if", !0) : (u(), C(He, {
1586
- key: 0,
1587
- modelValue: le.value,
1588
- "onUpdate:modelValue": g[0] || (g[0] = (m) => le.value = m),
1589
- "rounded-size": l.roundedSize,
1590
- color: l.color,
1591
- style: { width: "8rem" },
1592
- placeholder: b.value.searchByPlaceholder,
1593
- size: l.searchInputSize ?? y(V),
1594
- options: ce.value
1595
- }, null, 8, ["modelValue", "rounded-size", "color", "placeholder", "size", "options"])),
1596
- M(Oe, {
1597
- modelValue: s.value,
1598
- "onUpdate:modelValue": g[1] || (g[1] = (m) => s.value = m),
1599
- size: l.searchInputSize ?? y(V),
1600
- "rounded-size": l.roundedSize,
1601
- color: l.color,
1602
- placeholder: b.value.searchPlaceholder,
1603
- "left-icon": y(Qe)
1604
- }, null, 8, ["modelValue", "size", "rounded-size", "color", "placeholder", "left-icon"])
1605
- ])) : d("v-if", !0)
1606
- ])) : d("v-if", !0),
1607
- B(
1608
- "div",
1609
- {
1610
- class: w(["m-table-wrapper", [`--rounded-${l.roundedSize}`]])
1611
- },
1612
- [
1613
- B(
1614
- "table",
1615
- {
1616
- class: w([{ "--elevation": l.elevation, "--has-layout": l.tableLayout }, l.tableClass]),
1617
- style: ie(l.tableStyle)
1618
- },
1619
- [
1620
- l.caption || l.$slots.caption ? (u(), z("caption", to, [
1621
- d(`
1622
- @slot caption - add caption on top or bottom of the table
1623
- `),
1624
- I(l.$slots, "caption", {}, () => [
1625
- re(
1626
- F(l.caption),
1627
- 1
1628
- /* TEXT */
1629
- )
1630
- ], !0)
1631
- ])) : d("v-if", !0),
1632
- q.value ? (u(), z("thead", oo, [
1633
- d(`
1634
- @slot thead - content in thead element
1635
- `),
1636
- I(l.$slots, "thead", {}, () => [
1637
- M(Te, { "no-hoverable": "" }, {
1638
- default: K(() => [
1639
- G.value ? (u(), C(Pe, {
1640
- key: 0,
1641
- align: "left",
1642
- class: w([`--${y(V)}`, "m-table-select-column"])
1643
- }, {
1644
- default: K(() => [
1645
- M(Le, {
1646
- modelValue: he.value,
1647
- "onUpdate:modelValue": g[2] || (g[2] = (m) => he.value = m),
1648
- size: "xs"
1649
- }, null, 8, ["modelValue"])
1650
- ]),
1651
- _: 1
1652
- /* STABLE */
1653
- }, 8, ["class"])) : d("v-if", !0),
1654
- (u(!0), z(
1655
- me,
1656
- null,
1657
- we(q.value, (m, t) => (u(), C(Pe, {
1658
- key: t,
1659
- scope: m.scope,
1660
- align: m.align,
1661
- rowspan: m.rowspan,
1662
- colspan: m.colspan,
1663
- headers: m.thHeaders,
1664
- style: ie({ width: m.width, textAlign: m.align }),
1665
- class: w(["maz-group", [
1666
- { "--hidden": m.hidden, "--sortable": m.sortable ?? l.sortable },
1667
- m.classes,
1668
- `--${y(V)}`
1669
- ]]),
1670
- onClick: (a) => (m.sortable ?? l.sortable) && Ve(t)
1671
- }, {
1672
- default: K(() => [
1673
- B(
1674
- "span",
1675
- {
1676
- class: w({ "maz-sr-only": m.srOnly })
1677
- },
1678
- [
1679
- d(`
1680
- @slot header - replace column header
1681
- @binding {Object} header - header data
1682
- @binding {String} label - header label
1683
- `),
1684
- I(l.$slots, "header", {
1685
- header: m,
1686
- label: m.label
1687
- }, () => [
1688
- d(`
1689
- @slot header-label-{key} - replace column header label
1690
- @binding {Object} header - header data
1691
- @binding {String} label - header label
1692
- `),
1693
- I(l.$slots, `header-label-${m.key}`, {
1694
- header: m,
1695
- label: m.label
1696
- }, () => [
1697
- re(
1698
- F(m.label),
1699
- 1
1700
- /* TEXT */
1701
- )
1702
- ], !0),
1703
- m.sortable ?? l.sortable ? (u(), z("div", lo, [
1704
- M(y(it), {
1705
- class: w(["m-table-sort-icon maz-hidden group-hover:maz-block", {
1706
- "--sorted": t === Y.value,
1707
- "--up": O.value === "DESC",
1708
- "--down": O.value === "ASC"
1709
- }])
1710
- }, null, 8, ["class"])
1711
- ])) : d("v-if", !0)
1712
- ], !0)
1713
- ],
1714
- 2
1715
- /* CLASS */
1716
- )
1717
- ]),
1718
- _: 2
1719
- /* DYNAMIC */
1720
- }, 1032, ["scope", "align", "rowspan", "colspan", "headers", "style", "class", "onClick"]))),
1721
- 128
1722
- /* KEYED_FRAGMENT */
1723
- )),
1724
- l.$slots.actions ? (u(), C(Pe, {
1725
- key: 1,
1726
- align: "left",
1727
- class: w(`--${y(V)}`)
1728
- }, {
1729
- default: K(() => [
1730
- d(`
1731
- @slot actions-header - replace text of actions header
1732
- `),
1733
- I(l.$slots, "actions-header", {}, () => [
1734
- re(
1735
- F(b.value.actionHeader),
1736
- 1
1737
- /* TEXT */
1738
- )
1739
- ], !0)
1740
- ]),
1741
- _: 3
1742
- /* FORWARDED */
1743
- }, 8, ["class"])) : d("v-if", !0)
1744
- ]),
1745
- _: 3
1746
- /* FORWARDED */
1747
- })
1748
- ], !0)
1749
- ])) : d("v-if", !0),
1750
- l.loading ? (u(), C(Ot, {
1751
- key: 2,
1752
- color: l.color,
1753
- class: "!maz-absolute"
1754
- }, null, 8, ["color"])) : d("v-if", !0),
1755
- B(
1756
- "tbody",
1757
- {
1758
- class: w({ "--divider": A.value })
1759
- },
1760
- [
1761
- I(l.$slots, "default", {}, () => [
1762
- E.value.length > 0 ? (u(!0), z(
1763
- me,
1764
- { key: 0 },
1765
- we(E.value, (m, t) => (u(), C(Te, {
1766
- key: t,
1767
- class: w(m.classes),
1768
- onClick: (a) => m.action && m.action(m)
1769
- }, {
1770
- default: K(() => [
1771
- G.value ? (u(), C(
1772
- ke,
1773
- {
1774
- key: 0,
1775
- class: "m-table-select-column"
1776
- },
1777
- {
1778
- default: K(() => [
1779
- d(`
1780
- @slot select - replace checkbox component
1781
- @binding {Object} row - row data
1782
- @binding {Boolean} selected - if selected or not
1783
- `),
1784
- I(l.$slots, "select", {
1785
- row: m,
1786
- selected: m.selected
1787
- }, () => [
1788
- M(Le, {
1789
- size: "xs",
1790
- "model-value": m.selected,
1791
- "onUpdate:modelValue": (a) => ye(a, t)
1792
- }, null, 8, ["model-value", "onUpdate:modelValue"])
1793
- ], !0)
1794
- ]),
1795
- _: 2
1796
- /* DYNAMIC */
1797
- },
1798
- 1024
1799
- /* DYNAMIC_SLOTS */
1800
- )) : d("v-if", !0),
1801
- (u(!0), z(
1802
- me,
1803
- null,
1804
- we(q.value, ({ key: a, align: p, classes: r }, S) => (u(), C(ke, {
1805
- key: S,
1806
- align: p,
1807
- class: w(r)
1808
- }, {
1809
- default: K(() => [
1810
- d(`
1811
- @slot cell - replace all row cells
1812
- @binding {Object} row - row data
1813
- @binding {Boolean} value - cell value
1814
- `),
1815
- a ? I(l.$slots, "cell", {
1816
- key: 0,
1817
- row: m,
1818
- value: m[a]
1819
- }, () => [
1820
- d(`
1821
- @slot cell-{key} - replace row cells of column
1822
- @binding {Object} row - row data
1823
- @binding {Boolean} value - cell value
1824
- `),
1825
- I(l.$slots, `cell-${a}`, {
1826
- row: m,
1827
- value: m[a]
1828
- }, () => [
1829
- re(
1830
- F(m[a]),
1831
- 1
1832
- /* TEXT */
1833
- )
1834
- ], !0)
1835
- ], !0) : d("v-if", !0)
1836
- ]),
1837
- _: 2
1838
- /* DYNAMIC */
1839
- }, 1032, ["align", "class"]))),
1840
- 128
1841
- /* KEYED_FRAGMENT */
1842
- )),
1843
- l.$slots.actions ? (u(), C(
1844
- ke,
1845
- { key: 1 },
1846
- {
1847
- default: K(() => [
1848
- d(`
1849
- @slot actions - will add actions column
1850
- @binding {Object} row - row data
1851
- `),
1852
- I(l.$slots, "actions", { row: m }, void 0, !0)
1853
- ]),
1854
- _: 2
1855
- /* DYNAMIC */
1856
- },
1857
- 1024
1858
- /* DYNAMIC_SLOTS */
1859
- )) : d("v-if", !0)
1860
- ]),
1861
- _: 2
1862
- /* DYNAMIC */
1863
- }, 1032, ["class", "onClick"]))),
1864
- 128
1865
- /* KEYED_FRAGMENT */
1866
- )) : (u(), C(Te, { key: 1 }, {
1867
- default: K(() => [
1868
- M(ke, {
1869
- colspan: q.value.length + (G.value ? 1 : 0) + (l.$slots.actions ? 1 : 0)
1870
- }, {
1871
- default: K(() => [
1872
- d(`
1873
- @slot no-results - replace no results
1874
- `),
1875
- I(l.$slots, "no-results", {}, () => [
1876
- B("p", ao, [
1877
- d(`
1878
- @slot no-results-text - replace no results test only
1879
- `),
1880
- I(l.$slots, "no-results-text", {}, () => [
1881
- re(
1882
- F(b.value.noResults),
1883
- 1
1884
- /* TEXT */
1885
- )
1886
- ], !0)
1887
- ])
1888
- ], !0)
1889
- ]),
1890
- _: 3
1891
- /* FORWARDED */
1892
- }, 8, ["colspan"])
1893
- ]),
1894
- _: 3
1895
- /* FORWARDED */
1896
- }))
1897
- ], !0)
1898
- ],
1899
- 2
1900
- /* CLASS */
1901
- )
1902
- ],
1903
- 6
1904
- /* CLASS, STYLE */
1905
- )
1906
- ],
1907
- 2
1908
- /* CLASS */
1909
- ),
1910
- ve.value ? (u(), z("div", no, [
1911
- g[4] || (g[4] = B(
1912
- "div",
1913
- { class: "m-table-spacer" },
1914
- null,
1915
- -1
1916
- /* HOISTED */
1917
- )),
1918
- l.pagination ? (u(), z("div", so, [
1919
- B("div", ro, [
1920
- B(
1921
- "span",
1922
- io,
1923
- F(b.value.paginationRowsPerPage),
1924
- 1
1925
- /* TEXT */
1926
- ),
1927
- M(He, {
1928
- modelValue: v.value,
1929
- "onUpdate:modelValue": g[3] || (g[3] = (m) => v.value = m),
1930
- options: j.value,
1931
- "rounded-size": l.roundedSize,
1932
- size: y(V),
1933
- color: l.color,
1934
- "list-position": "top",
1935
- style: { width: "5rem" }
1936
- }, null, 8, ["modelValue", "options", "rounded-size", "size", "color"])
1937
- ]),
1938
- k.value ? (u(), z(
1939
- "span",
1940
- uo,
1941
- F(T.value) + " - " + F(E.value.length) + " " + F(b.value.paginationOf) + " " + F(k.value),
1942
- 1
1943
- /* TEXT */
1944
- )) : d("v-if", !0),
1945
- B("div", co, [
1946
- M(fe, {
1947
- disabled: T.value === 1,
1948
- size: y(V),
1949
- color: "transparent",
1950
- "rounded-size": l.roundedSize,
1951
- "no-elevation": "",
1952
- onClick: h
1953
- }, {
1954
- default: K(() => [
1955
- M(y(De), { class: "maz-text-base" })
1956
- ]),
1957
- _: 1
1958
- /* STABLE */
1959
- }, 8, ["disabled", "size", "rounded-size"]),
1960
- M(fe, {
1961
- disabled: T.value === 1,
1962
- size: y(V),
1963
- color: "transparent",
1964
- "rounded-size": l.roundedSize,
1965
- "no-elevation": "",
1966
- onClick: X
1967
- }, {
1968
- default: K(() => [
1969
- M(y(Fe), { class: "maz-text-base" })
1970
- ]),
1971
- _: 1
1972
- /* STABLE */
1973
- }, 8, ["disabled", "size", "rounded-size"]),
1974
- M(fe, {
1975
- disabled: T.value === k.value,
1976
- size: y(V),
1977
- color: "transparent",
1978
- "rounded-size": l.roundedSize,
1979
- "no-elevation": "",
1980
- onClick: ne
1981
- }, {
1982
- default: K(() => [
1983
- M(y(Fe), { class: "maz-rotate-180 maz-text-base" })
1984
- ]),
1985
- _: 1
1986
- /* STABLE */
1987
- }, 8, ["disabled", "size", "rounded-size"]),
1988
- M(fe, {
1989
- disabled: T.value === k.value,
1990
- size: y(V),
1991
- color: "transparent",
1992
- "rounded-size": l.roundedSize,
1993
- "no-elevation": "",
1994
- onClick: Q
1995
- }, {
1996
- default: K(() => [
1997
- M(y(De), { class: "maz-rotate-180 maz-text-base" })
1998
- ]),
1999
- _: 1
2000
- /* STABLE */
2001
- }, 8, ["disabled", "size", "rounded-size"])
2002
- ])
2003
- ])) : d("v-if", !0)
2004
- ])) : d("v-if", !0)
2005
- ],
2006
- 2
2007
- /* CLASS */
2008
- ));
2009
- }
2010
- }), mo = /* @__PURE__ */ oe(po, [["__scopeId", "data-v-80a2cb7f"]]);
2011
- export {
2012
- mo as M,
2013
- oe as _,
2014
- je as i
2015
- };