maz-ui 3.32.2 → 3.34.0
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.
- package/components/MazDropdown.d.ts +7 -1
- package/components/MazDropdown.mjs +125 -119
- package/components/MazPagination.d.ts +98 -0
- package/components/MazPagination.mjs +4 -0
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazSelect.mjs +1 -1
- package/components/MazTable.d.ts +2 -2
- package/components/MazTable.mjs +1 -1
- package/components/assets/MazDropdown.css +1 -1
- package/components/assets/MazPagination.css +1 -0
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/chunks/{MazBtn-BSbEqTOO.mjs → MazBtn-BdEnwPnp.mjs} +2 -2
- package/components/chunks/{MazBtn-EtLqM2iD.mjs → MazBtn-DEM8T_xK.mjs} +2 -2
- package/components/chunks/{MazCheckbox-BPkflsJh.mjs → MazCheckbox-DDw-_poJ.mjs} +1 -1
- package/components/chunks/{MazCheckbox-CPcllL6q.mjs → MazCheckbox-DKvq4VIy.mjs} +1 -1
- package/components/chunks/{MazIcon-CtSznV7P.mjs → MazIcon-CSZF8Zgz.mjs} +1 -1
- package/components/chunks/MazPagination-Br-f0ZVV.mjs +389 -0
- package/components/chunks/{MazPhoneNumberInput-XtiVMdCD.mjs → MazPhoneNumberInput-srnmCNgX.mjs} +46 -45
- package/components/chunks/{MazSelect-DR7qJS0-.mjs → MazSelect-qw3H2BrO.mjs} +161 -160
- package/components/chunks/{MazSpinner-CzQz8yXB.mjs → MazSpinner-6_mdlWzG.mjs} +1 -1
- package/components/chunks/{MazSpinner-DqdhKhP4.mjs → MazSpinner-Ben5F7h9.mjs} +1 -1
- package/components/chunks/MazSpinner-DpeLSgmM.mjs +38 -0
- package/components/chunks/{MazSpinner-DB5-SHwJ.mjs → MazSpinner-Pnq_8QwR.mjs} +1 -1
- package/components/chunks/{MazTable-DX4Pdzt_.mjs → MazTable-BL_3hR2Z.mjs} +120 -119
- package/components/chunks/chevron-double-left-zoBBzOlh.mjs +30 -0
- package/components/chunks/ellipsis-horizontal-VGAsnCwV.mjs +30 -0
- package/components/index.d.ts +1 -0
- package/components/index.mjs +1 -0
- package/css/main.css +1 -1
- package/modules/chunks/{MazBtn-eN8rfU-2.cjs → MazBtn-Ds3ljkPz.cjs} +1 -1
- package/modules/chunks/{MazBtn-DzJx2DA3.mjs → MazBtn-slucsujG.mjs} +2 -2
- package/modules/chunks/{MazIcon-DaoNEj_U.cjs → MazIcon-BFDvFiQo.cjs} +1 -1
- package/modules/chunks/{MazIcon-e9fryb1P.mjs → MazIcon-DaJQEFh2.mjs} +1 -1
- package/modules/chunks/{MazSpinner-DvCq0zSA.cjs → MazSpinner-B2otf393.cjs} +1 -1
- package/modules/chunks/{MazSpinner-BHGuV2dF.mjs → MazSpinner-_fcsae1V.mjs} +1 -1
- package/modules/chunks/{index-DYwwNo_Y.cjs → index-B48OKfFt.cjs} +2 -2
- package/modules/chunks/{index-CcXCRwty.mjs → index-CWAO7a8o.mjs} +451 -440
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +1 -1
- package/package.json +15 -15
- package/types/components/MazDropdown.vue.d.ts +7 -1
- package/types/components/MazPagination.vue.d.ts +98 -0
- package/types/components/MazTable.vue.d.ts +2 -2
- package/types/components/index.d.ts +1 -0
- package/types/modules/composables/use-theme-handler.d.ts +1 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../assets/MazSelect.css";
|
|
2
|
-
import { computed as
|
|
2
|
+
import { computed as r, defineComponent as pe, defineAsyncComponent as K, ref as f, getCurrentInstance as me, onMounted as Ie, useSlots as Ke, openBlock as i, createElementBlock as V, normalizeClass as N, normalizeStyle as Z, createElementVNode as P, createCommentVNode as d, renderSlot as O, createBlock as I, unref as v, resolveDynamicComponent as de, withDirectives as Be, mergeProps as fe, toHandlers as $e, vModelDynamic as Ce, createTextVNode as Se, toDisplayString as ve, withModifiers as E, withCtx as G, createVNode as T, useCssVars as Le, onBeforeMount as Ae, Transition as De, Fragment as Me, renderList as Te, nextTick as ne } from "vue";
|
|
3
3
|
function Ne(y, p) {
|
|
4
4
|
let b;
|
|
5
|
-
return function(...
|
|
5
|
+
return function(...B) {
|
|
6
6
|
clearTimeout(b), b = setTimeout(() => {
|
|
7
|
-
y.apply(this,
|
|
7
|
+
y.apply(this, B);
|
|
8
8
|
}, p);
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -12,7 +12,7 @@ const ye = ({
|
|
|
12
12
|
componentName: y,
|
|
13
13
|
instance: p,
|
|
14
14
|
providedId: b
|
|
15
|
-
}) =>
|
|
15
|
+
}) => r(() => b ?? `${y}-${p == null ? void 0 : p.uid}`), Pe = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "m-input-wrapper-left"
|
|
18
18
|
}, qe = { class: "m-input-wrapper-input" }, Fe = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"], He = { key: 0 }, Ee = {
|
|
@@ -55,76 +55,76 @@ const ye = ({
|
|
|
55
55
|
},
|
|
56
56
|
emits: ["update:model-value", "focus", "blur", "click", "change"],
|
|
57
57
|
setup(y, { emit: p }) {
|
|
58
|
-
const b =
|
|
58
|
+
const b = K(() => import("./MazBtn-DEM8T_xK.mjs")), B = K(() => import("./MazIcon-Cxrv3_OK.mjs")), q = K(() => import("./eye-slash-tjfxO0LK.mjs")), J = K(() => import("./eye-DqO_Jx56.mjs")), X = K(() => import("./check-7UA4j2f2.mjs")), o = y, z = p, g = f(!1), s = f(!1), A = f(), Y = me(), x = ye({
|
|
59
59
|
componentName: "MazInput",
|
|
60
60
|
instance: Y,
|
|
61
|
-
providedId:
|
|
61
|
+
providedId: o.id
|
|
62
62
|
});
|
|
63
63
|
Ie(() => {
|
|
64
64
|
var l;
|
|
65
|
-
|
|
65
|
+
o.autoFocus && ((l = A.value) == null || l.focus());
|
|
66
66
|
});
|
|
67
|
-
const U =
|
|
68
|
-
if (!
|
|
69
|
-
if (
|
|
67
|
+
const U = r(() => o.type === "password"), k = r(() => g.value ? "text" : o.type), _ = r(() => {
|
|
68
|
+
if (!o.noBorder) {
|
|
69
|
+
if (o.error)
|
|
70
70
|
return "maz-border-danger";
|
|
71
|
-
if (
|
|
71
|
+
if (o.success)
|
|
72
72
|
return "maz-border-success";
|
|
73
|
-
if (
|
|
73
|
+
if (o.warning)
|
|
74
74
|
return "maz-border-warning";
|
|
75
|
-
if (s.value ||
|
|
76
|
-
if (
|
|
75
|
+
if (s.value || o.borderActive) {
|
|
76
|
+
if (o.color === "black")
|
|
77
77
|
return "maz-border-black";
|
|
78
|
-
if (
|
|
78
|
+
if (o.color === "danger")
|
|
79
79
|
return "maz-border-danger";
|
|
80
|
-
if (
|
|
80
|
+
if (o.color === "info")
|
|
81
81
|
return "maz-border-info";
|
|
82
|
-
if (
|
|
82
|
+
if (o.color === "primary")
|
|
83
83
|
return "maz-border-primary";
|
|
84
|
-
if (
|
|
84
|
+
if (o.color === "secondary")
|
|
85
85
|
return "maz-border-secondary";
|
|
86
|
-
if (
|
|
86
|
+
if (o.color === "success")
|
|
87
87
|
return "maz-border-success";
|
|
88
|
-
if (
|
|
88
|
+
if (o.color === "warning")
|
|
89
89
|
return "maz-border-warning";
|
|
90
|
-
if (
|
|
90
|
+
if (o.color === "white")
|
|
91
91
|
return "maz-border-white";
|
|
92
92
|
}
|
|
93
93
|
return "--default-border";
|
|
94
94
|
}
|
|
95
|
-
}),
|
|
96
|
-
const { required: l, placeholder: m } =
|
|
95
|
+
}), w = Ke(), D = r(() => {
|
|
96
|
+
const { required: l, placeholder: m } = o;
|
|
97
97
|
if (m)
|
|
98
98
|
return l ? `${m} *` : m;
|
|
99
|
-
}), W =
|
|
99
|
+
}), W = r(() => $.value !== void 0 && $.value !== ""), Q = Ne(
|
|
100
100
|
(l) => {
|
|
101
|
-
|
|
101
|
+
$.value = l;
|
|
102
102
|
},
|
|
103
|
-
typeof
|
|
104
|
-
),
|
|
105
|
-
get: () =>
|
|
103
|
+
typeof o.debounce == "number" ? o.debounce : o.debounceDelay ?? 500
|
|
104
|
+
), $ = r({
|
|
105
|
+
get: () => o.modelValue,
|
|
106
106
|
set: (l) => {
|
|
107
|
-
if (
|
|
107
|
+
if (o.debounce)
|
|
108
108
|
return Q(l);
|
|
109
109
|
z("update:model-value", l);
|
|
110
110
|
}
|
|
111
|
-
}), S =
|
|
112
|
-
function te() {
|
|
113
|
-
return !!k["right-icon"] || U.value || !!k["valid-button"] || t.validButton || !!t.rightIcon;
|
|
114
|
-
}
|
|
111
|
+
}), S = r(() => (!!o.label || !!o.hint) && (s.value || !!W.value || !!o.placeholder || ["date", "month", "week"].includes(o.type))), F = r(() => !!o.label || !!o.hint);
|
|
115
112
|
function oe() {
|
|
116
|
-
return !!
|
|
113
|
+
return !!w["right-icon"] || U.value || !!w["valid-button"] || o.validButton || !!o.rightIcon;
|
|
114
|
+
}
|
|
115
|
+
function te() {
|
|
116
|
+
return !!w["left-icon"] || !!o.leftIcon;
|
|
117
117
|
}
|
|
118
118
|
function L(l) {
|
|
119
119
|
z("focus", l), s.value = !0;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function C(l) {
|
|
122
122
|
z("blur", l), s.value = !1;
|
|
123
123
|
}
|
|
124
124
|
function R(l) {
|
|
125
125
|
return z("change", l);
|
|
126
126
|
}
|
|
127
|
-
return (l, m) => (
|
|
127
|
+
return (l, m) => (i(), V(
|
|
128
128
|
"div",
|
|
129
129
|
{
|
|
130
130
|
class: N(["m-input", [
|
|
@@ -137,7 +137,7 @@ const ye = ({
|
|
|
137
137
|
"--has-z-2": l.error || l.warning || l.success,
|
|
138
138
|
"--has-state": l.error || l.warning || l.success
|
|
139
139
|
},
|
|
140
|
-
|
|
140
|
+
o.class,
|
|
141
141
|
`--${l.color}`,
|
|
142
142
|
`--${l.size}`
|
|
143
143
|
]]),
|
|
@@ -154,16 +154,16 @@ const ye = ({
|
|
|
154
154
|
]])
|
|
155
155
|
},
|
|
156
156
|
[
|
|
157
|
-
|
|
157
|
+
te() ? (i(), V("div", Pe, [
|
|
158
158
|
d(`
|
|
159
159
|
@slot left-icon - The icon to display on the left of the input
|
|
160
160
|
`),
|
|
161
161
|
l.$slots["left-icon"] || l.leftIcon ? O(l.$slots, "left-icon", { key: 0 }, () => [
|
|
162
|
-
typeof l.leftIcon == "string" ? (
|
|
162
|
+
typeof l.leftIcon == "string" ? (i(), I(v(B), {
|
|
163
163
|
key: 0,
|
|
164
164
|
name: l.leftIcon,
|
|
165
165
|
class: "maz-text-xl maz-text-muted"
|
|
166
|
-
}, null, 8, ["name"])) : l.leftIcon ? (
|
|
166
|
+
}, null, 8, ["name"])) : l.leftIcon ? (i(), I(de(l.leftIcon), {
|
|
167
167
|
key: 1,
|
|
168
168
|
class: "maz-text-xl maz-text-muted"
|
|
169
169
|
})) : d("v-if", !0)
|
|
@@ -174,8 +174,8 @@ const ye = ({
|
|
|
174
174
|
id: v(x),
|
|
175
175
|
ref_key: "input",
|
|
176
176
|
ref: A,
|
|
177
|
-
"onUpdate:modelValue": m[0] || (m[0] = (c) =>
|
|
178
|
-
type:
|
|
177
|
+
"onUpdate:modelValue": m[0] || (m[0] = (c) => $.value = c),
|
|
178
|
+
type: k.value,
|
|
179
179
|
name: l.name
|
|
180
180
|
}, l.$attrs, {
|
|
181
181
|
inputmode: l.inputmode,
|
|
@@ -185,16 +185,16 @@ const ye = ({
|
|
|
185
185
|
readonly: l.readonly,
|
|
186
186
|
required: l.required,
|
|
187
187
|
class: "m-input-input"
|
|
188
|
-
},
|
|
189
|
-
blur:
|
|
188
|
+
}, $e({
|
|
189
|
+
blur: C,
|
|
190
190
|
focus: L,
|
|
191
191
|
change: R
|
|
192
192
|
}, !0), {
|
|
193
193
|
onClick: m[1] || (m[1] = (c) => l.$emit("click", c))
|
|
194
194
|
}), null, 16, Fe), [
|
|
195
|
-
[
|
|
195
|
+
[Ce, $.value]
|
|
196
196
|
]),
|
|
197
|
-
l.label || l.hint ? (
|
|
197
|
+
l.label || l.hint ? (i(), V(
|
|
198
198
|
"span",
|
|
199
199
|
{
|
|
200
200
|
key: 0,
|
|
@@ -213,27 +213,27 @@ const ye = ({
|
|
|
213
213
|
1
|
|
214
214
|
/* TEXT */
|
|
215
215
|
),
|
|
216
|
-
l.required ? (
|
|
216
|
+
l.required ? (i(), V("sup", He, "*")) : d("v-if", !0)
|
|
217
217
|
],
|
|
218
218
|
2
|
|
219
219
|
/* CLASS */
|
|
220
220
|
)) : d("v-if", !0)
|
|
221
221
|
]),
|
|
222
|
-
|
|
222
|
+
oe() ? (i(), V("div", Ee, [
|
|
223
223
|
d(`
|
|
224
224
|
@slot right-icon - The icon to display on the right of the input
|
|
225
225
|
`),
|
|
226
226
|
l.$slots["right-icon"] || l.rightIcon ? O(l.$slots, "right-icon", { key: 0 }, () => [
|
|
227
|
-
typeof l.rightIcon == "string" ? (
|
|
227
|
+
typeof l.rightIcon == "string" ? (i(), I(v(B), {
|
|
228
228
|
key: 0,
|
|
229
229
|
name: l.rightIcon,
|
|
230
230
|
class: "maz-text-xl maz-text-muted"
|
|
231
|
-
}, null, 8, ["name"])) : l.rightIcon ? (
|
|
231
|
+
}, null, 8, ["name"])) : l.rightIcon ? (i(), I(de(l.rightIcon), {
|
|
232
232
|
key: 1,
|
|
233
233
|
class: "maz-text-xl maz-text-muted"
|
|
234
234
|
})) : d("v-if", !0)
|
|
235
235
|
], !0) : d("v-if", !0),
|
|
236
|
-
U.value ? (
|
|
236
|
+
U.value ? (i(), I(v(b), {
|
|
237
237
|
key: 1,
|
|
238
238
|
color: "transparent",
|
|
239
239
|
tabindex: "-1",
|
|
@@ -241,10 +241,10 @@ const ye = ({
|
|
|
241
241
|
onClick: m[2] || (m[2] = E((c) => g.value = !g.value, ["stop"]))
|
|
242
242
|
}, {
|
|
243
243
|
default: G(() => [
|
|
244
|
-
g.value ? (
|
|
244
|
+
g.value ? (i(), I(v(q), {
|
|
245
245
|
key: 0,
|
|
246
246
|
class: "maz-text-xl maz-text-muted"
|
|
247
|
-
})) : (
|
|
247
|
+
})) : (i(), I(v(J), {
|
|
248
248
|
key: 1,
|
|
249
249
|
class: "maz-text-xl maz-text-muted"
|
|
250
250
|
}))
|
|
@@ -284,8 +284,8 @@ const ye = ({
|
|
|
284
284
|
}
|
|
285
285
|
}), be = (y, p) => {
|
|
286
286
|
const b = y.__vccOpts || y;
|
|
287
|
-
for (const [
|
|
288
|
-
b[
|
|
287
|
+
for (const [B, q] of p)
|
|
288
|
+
b[B] = q;
|
|
289
289
|
return b;
|
|
290
290
|
}, ce = /* @__PURE__ */ be(Oe, [["__scopeId", "data-v-2b90b4c7"]]);
|
|
291
291
|
f("system");
|
|
@@ -294,11 +294,11 @@ let se = null;
|
|
|
294
294
|
function Ue(y, p) {
|
|
295
295
|
se && clearTimeout(se), se = setTimeout(y, p);
|
|
296
296
|
}
|
|
297
|
-
const We = { class: "m-select-list__no-results" },
|
|
297
|
+
const We = ["aria-label"], Qe = { class: "m-select-list__no-results" }, Re = {
|
|
298
298
|
key: 2,
|
|
299
299
|
class: "m-select-list__scroll-wrapper",
|
|
300
300
|
tabindex: "-1"
|
|
301
|
-
},
|
|
301
|
+
}, je = ["onClick"], Ze = /* @__PURE__ */ pe({
|
|
302
302
|
inheritAttrs: !1,
|
|
303
303
|
__name: "MazSelect",
|
|
304
304
|
props: {
|
|
@@ -326,133 +326,133 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
326
326
|
emits: ["close", "open", "blur", "focus", "change", "update:model-value", "selected-option"],
|
|
327
327
|
setup(y, { emit: p }) {
|
|
328
328
|
Le((e) => ({
|
|
329
|
-
"
|
|
330
|
-
"
|
|
331
|
-
"
|
|
329
|
+
"4675cece": U.value,
|
|
330
|
+
"0e35d418": Y.value,
|
|
331
|
+
"2238cc80": x.value
|
|
332
332
|
}));
|
|
333
|
-
const b =
|
|
334
|
-
() => ["black", "transparent", "white"].includes(
|
|
335
|
-
), Y =
|
|
336
|
-
() => A.value ? "var(--maz-color-black)" : `var(--maz-color-${
|
|
337
|
-
), x =
|
|
338
|
-
() => A.value ? "var(--maz-color-muted)" : `var(--maz-color-${
|
|
339
|
-
), U =
|
|
340
|
-
() => A.value ? "var(--maz-color-muted)" : `var(--maz-color-${
|
|
341
|
-
),
|
|
333
|
+
const b = K(() => import("./MazCheckbox-DKvq4VIy.mjs")), B = K(() => import("./magnifying-glass-DZGg7953.mjs")), q = K(() => import("./chevron-down-CzMH-gFW.mjs")), J = K(() => import("./no-symbol-QAqP9IlR.mjs")), X = me(), o = y, z = p, g = f(!1), s = f(), A = r(
|
|
334
|
+
() => ["black", "transparent", "white"].includes(o.color)
|
|
335
|
+
), Y = r(
|
|
336
|
+
() => A.value ? "var(--maz-color-black)" : `var(--maz-color-${o.color}-800)`
|
|
337
|
+
), x = r(
|
|
338
|
+
() => A.value ? "var(--maz-color-muted)" : `var(--maz-color-${o.color}-100)`
|
|
339
|
+
), U = r(
|
|
340
|
+
() => A.value ? "var(--maz-color-muted)" : `var(--maz-color-${o.color}-200)`
|
|
341
|
+
), k = r(() => g.value || o.open), _ = ye({
|
|
342
342
|
componentName: "MazSelect",
|
|
343
343
|
instance: X,
|
|
344
|
-
providedId:
|
|
345
|
-
}),
|
|
344
|
+
providedId: o.id
|
|
345
|
+
}), w = r(
|
|
346
346
|
() => {
|
|
347
347
|
var e;
|
|
348
|
-
return (e =
|
|
349
|
-
[
|
|
350
|
-
[
|
|
351
|
-
[
|
|
348
|
+
return (e = o.options) == null ? void 0 : e.map((t) => typeof t == "string" || typeof t == "number" || typeof t == "boolean" ? {
|
|
349
|
+
[o.optionValueKey]: t,
|
|
350
|
+
[o.optionLabelKey]: t,
|
|
351
|
+
[o.optionInputValueKey]: t
|
|
352
352
|
} : {
|
|
353
|
-
...
|
|
354
|
-
[
|
|
355
|
-
[
|
|
356
|
-
[
|
|
353
|
+
...t,
|
|
354
|
+
[o.optionValueKey]: t[o.optionValueKey],
|
|
355
|
+
[o.optionLabelKey]: t[o.optionLabelKey],
|
|
356
|
+
[o.optionInputValueKey]: t[o.optionInputValueKey]
|
|
357
357
|
});
|
|
358
358
|
}
|
|
359
|
-
), D =
|
|
359
|
+
), D = r(
|
|
360
360
|
() => {
|
|
361
361
|
var e;
|
|
362
|
-
return ((e =
|
|
362
|
+
return ((e = w.value) == null ? void 0 : e.filter((t) => o.multiple ? Array.isArray(o.modelValue) ? o.modelValue.includes(t[o.optionValueKey]) && !S(t[o.optionValueKey]) : !1 : o.modelValue === t[o.optionValueKey] && !S(t[o.optionValueKey]))) ?? [];
|
|
363
363
|
}
|
|
364
364
|
);
|
|
365
365
|
Ae(() => {
|
|
366
366
|
var e;
|
|
367
|
-
(e =
|
|
367
|
+
(e = o.options) != null && e.length || console.warn("[maz-ui](MazSelect) you must provide options"), ae();
|
|
368
368
|
});
|
|
369
|
-
const W = f(), Q = f(), ee = f(),
|
|
369
|
+
const W = f(), Q = f(), ee = f(), $ = f(), S = (e) => e == null;
|
|
370
370
|
function F(e) {
|
|
371
371
|
var a;
|
|
372
372
|
return (((a = D.value) == null ? void 0 : a.some(
|
|
373
|
-
(n) => n[
|
|
374
|
-
)) ?? !1) && !S(e[
|
|
373
|
+
(n) => n[o.optionValueKey] === e[o.optionValueKey]
|
|
374
|
+
)) ?? !1) && !S(e[o.optionValueKey]);
|
|
375
375
|
}
|
|
376
|
-
const
|
|
377
|
-
var e,
|
|
378
|
-
return
|
|
376
|
+
const oe = r(() => {
|
|
377
|
+
var e, t;
|
|
378
|
+
return o.multiple && o.modelValue && Array.isArray(o.modelValue) ? o.modelValue.map(
|
|
379
379
|
(a) => {
|
|
380
380
|
var n, u;
|
|
381
|
-
return (u = (n =
|
|
381
|
+
return (u = (n = w.value) == null ? void 0 : n.find((h) => h[o.optionValueKey] === a)) == null ? void 0 : u[o.optionInputValueKey];
|
|
382
382
|
}
|
|
383
|
-
).join(", ") : (
|
|
384
|
-
(a) => a[
|
|
385
|
-
)) == null ? void 0 : o
|
|
386
|
-
}),
|
|
387
|
-
() =>
|
|
388
|
-
), L = f(""),
|
|
383
|
+
).join(", ") : (t = (e = w.value) == null ? void 0 : e.find(
|
|
384
|
+
(a) => a[o.optionValueKey] === o.modelValue
|
|
385
|
+
)) == null ? void 0 : t[o.optionInputValueKey];
|
|
386
|
+
}), te = r(
|
|
387
|
+
() => o.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
|
|
388
|
+
), L = f(""), C = f("");
|
|
389
389
|
function R(e) {
|
|
390
390
|
return e.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[^\dA-Za-z\u0400-\u04FF]/g, "");
|
|
391
391
|
}
|
|
392
|
-
const l = (e,
|
|
393
|
-
R(
|
|
392
|
+
const l = (e, t) => t && e && R(e.toString().toLocaleLowerCase().trim()).includes(
|
|
393
|
+
R(t.toLocaleLowerCase().trim())
|
|
394
394
|
);
|
|
395
395
|
function m(e) {
|
|
396
|
-
var
|
|
397
|
-
return e ? (
|
|
398
|
-
const n = a[
|
|
396
|
+
var t;
|
|
397
|
+
return e ? (t = w.value) == null ? void 0 : t.filter((a) => {
|
|
398
|
+
const n = a[o.optionLabelKey], u = a[o.optionValueKey], h = a[o.optionInputValueKey];
|
|
399
399
|
return l(n, e) || l(u, e) || l(h, e);
|
|
400
|
-
}) :
|
|
400
|
+
}) : w.value;
|
|
401
401
|
}
|
|
402
|
-
const c =
|
|
403
|
-
var
|
|
404
|
-
if (e && ("relatedTarget" in e && ((
|
|
402
|
+
const c = r(() => m(L.value)), j = async (e) => {
|
|
403
|
+
var t;
|
|
404
|
+
if (e && ("relatedTarget" in e && ((t = W.value) != null && t.contains(e.relatedTarget)) || e.type === "keydown"))
|
|
405
405
|
return e.preventDefault();
|
|
406
406
|
await ne(), g.value = !1, s.value = 0, z("close", e);
|
|
407
407
|
}, H = async (e) => {
|
|
408
|
-
|
|
408
|
+
o.disabled || k.value || (e == null || e.preventDefault(), g.value = !0, await le(), z("focus", e), z("open", g.value));
|
|
409
409
|
};
|
|
410
410
|
function ue() {
|
|
411
|
-
var e,
|
|
412
|
-
(
|
|
411
|
+
var e, t;
|
|
412
|
+
(t = ((e = Q.value) == null ? void 0 : e.$el).querySelector("input")) == null || t.focus();
|
|
413
413
|
}
|
|
414
414
|
function he(e) {
|
|
415
415
|
g.value ? j(e) : ue();
|
|
416
416
|
}
|
|
417
417
|
function ze(e) {
|
|
418
|
-
var
|
|
419
|
-
L.value = e, (a = ((
|
|
418
|
+
var t, a;
|
|
419
|
+
L.value = e, (a = ((t = ee.value) == null ? void 0 : t.$el).querySelector("input")) == null || a.focus();
|
|
420
420
|
}
|
|
421
421
|
function ge(e) {
|
|
422
422
|
var a;
|
|
423
|
-
e === "Backspace" &&
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
(n) => n[
|
|
423
|
+
e === "Backspace" && C.value.length > 0 ? C.value = C.value.slice(0, -1) : C.value += e;
|
|
424
|
+
const t = m(C.value);
|
|
425
|
+
t != null && t.length && (s.value = (a = c.value) == null ? void 0 : a.findIndex(
|
|
426
|
+
(n) => n[o.optionValueKey] === t[0][o.optionValueKey]
|
|
427
427
|
), typeof s.value == "number" && s.value >= 0 && le(s.value)), Ue(() => {
|
|
428
|
-
|
|
428
|
+
C.value = "";
|
|
429
429
|
}, 1e3);
|
|
430
430
|
}
|
|
431
431
|
const Ve = (e) => {
|
|
432
|
-
const
|
|
433
|
-
/^[\dA-Za-z\u0400-\u04FF]$/.test(
|
|
434
|
-
},
|
|
435
|
-
const
|
|
432
|
+
const t = e.key;
|
|
433
|
+
/^[\dA-Za-z\u0400-\u04FF]$/.test(t) ? (e.preventDefault(), H(e), o.search ? ze(t) : ge(t)) : ie(e);
|
|
434
|
+
}, ie = (e) => {
|
|
435
|
+
const t = e.code, a = ["ArrowUp", "ArrowDown"].includes(t), n = ["Enter", "Space"].includes(t), u = t === "Escape" && k.value;
|
|
436
436
|
a ? ke(e, s.value) : n ? we(e, s.value) : u && j();
|
|
437
|
-
}, ke = (e,
|
|
437
|
+
}, ke = (e, t) => {
|
|
438
438
|
var u;
|
|
439
439
|
e.preventDefault();
|
|
440
440
|
const a = e.code;
|
|
441
|
-
|
|
441
|
+
k.value || H(e);
|
|
442
442
|
const n = (u = c.value) == null ? void 0 : u.length;
|
|
443
|
-
n && (typeof
|
|
444
|
-
}, we = (e,
|
|
443
|
+
n && (typeof t == "number" ? t === n - 1 && a === "ArrowDown" ? s.value = 0 : t === 0 && a === "ArrowUp" ? s.value = n - 1 : s.value = a === "ArrowDown" ? t + 1 : t - 1 : s.value = a === "ArrowDown" ? 0 : n - 1, le(s.value));
|
|
444
|
+
}, we = (e, t) => {
|
|
445
445
|
var n, u, h;
|
|
446
|
-
if (e.preventDefault(), !
|
|
446
|
+
if (e.preventDefault(), !k.value)
|
|
447
447
|
return H(e);
|
|
448
|
-
const a =
|
|
449
|
-
S(a) ||
|
|
448
|
+
const a = t ? ((n = c.value) == null ? void 0 : n[t]) ?? ((u = c.value) == null ? void 0 : u[0]) : (h = c.value) == null ? void 0 : h[0];
|
|
449
|
+
S(a) || re(a);
|
|
450
450
|
};
|
|
451
451
|
async function le(e) {
|
|
452
452
|
var a, n;
|
|
453
453
|
await ne(), typeof e != "number" && ae();
|
|
454
|
-
const
|
|
455
|
-
typeof
|
|
454
|
+
const t = e ?? s.value;
|
|
455
|
+
typeof t == "number" && t >= 0 && ((n = (a = $.value) == null ? void 0 : a.querySelectorAll(".m-select-list-item")[t]) == null || n.scrollIntoView({
|
|
456
456
|
behavior: "auto",
|
|
457
457
|
block: "nearest",
|
|
458
458
|
inline: "start"
|
|
@@ -460,31 +460,31 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
460
460
|
}
|
|
461
461
|
function ae(e) {
|
|
462
462
|
var a;
|
|
463
|
-
const
|
|
463
|
+
const t = (a = c.value) == null ? void 0 : a.findIndex((n) => {
|
|
464
464
|
var u, h;
|
|
465
|
-
return
|
|
465
|
+
return o.multiple && Array.isArray(o.modelValue) ? e ? e[o.optionValueKey] === n[o.optionValueKey] : [...o.modelValue].reverse()[0] === n[o.optionValueKey] : ((h = (u = D.value) == null ? void 0 : u[0]) == null ? void 0 : h[o.optionValueKey]) === n[o.optionValueKey];
|
|
466
466
|
});
|
|
467
|
-
s.value =
|
|
467
|
+
s.value = t && t >= 0 ? t : 0;
|
|
468
468
|
}
|
|
469
|
-
const
|
|
469
|
+
const re = (e, t = !0) => {
|
|
470
470
|
var h;
|
|
471
|
-
|
|
471
|
+
t && !o.multiple && ne(() => j()), L.value = "";
|
|
472
472
|
const a = (h = D.value) == null ? void 0 : h.some(
|
|
473
|
-
(M) => M[
|
|
473
|
+
(M) => M[o.optionValueKey] === e[o.optionValueKey]
|
|
474
474
|
);
|
|
475
475
|
let n = D.value;
|
|
476
|
-
a &&
|
|
477
|
-
(M) => M[
|
|
478
|
-
) :
|
|
479
|
-
const u = n.map((M) => M[
|
|
480
|
-
z("update:model-value",
|
|
476
|
+
a && o.multiple ? n = n == null ? void 0 : n.filter(
|
|
477
|
+
(M) => M[o.optionValueKey] !== e[o.optionValueKey]
|
|
478
|
+
) : o.multiple ? n.push(e) : n = [e];
|
|
479
|
+
const u = n.map((M) => M[o.optionValueKey]);
|
|
480
|
+
z("update:model-value", o.multiple ? u : u[0]), z("selected-option", e), ae(e), ue();
|
|
481
481
|
};
|
|
482
|
-
return (e,
|
|
482
|
+
return (e, t) => (i(), V(
|
|
483
483
|
"div",
|
|
484
484
|
{
|
|
485
485
|
ref_key: "mazSelectElement",
|
|
486
486
|
ref: W,
|
|
487
|
-
class: N(["m-select", [{ "--is-open":
|
|
487
|
+
class: N(["m-select", [{ "--is-open": k.value, "--disabled": e.disabled }, o.class, `--${e.size}`]]),
|
|
488
488
|
style: Z(e.style),
|
|
489
489
|
onBlurCapture: j
|
|
490
490
|
},
|
|
@@ -498,13 +498,13 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
498
498
|
required: e.required,
|
|
499
499
|
"border-active": g.value,
|
|
500
500
|
color: e.color,
|
|
501
|
-
"model-value":
|
|
501
|
+
"model-value": oe.value,
|
|
502
502
|
autocomplete: "off",
|
|
503
503
|
size: e.size,
|
|
504
504
|
disabled: e.disabled,
|
|
505
505
|
onFocus: E(H, ["prevent", "stop"]),
|
|
506
506
|
onClick: E(H, ["prevent", "stop"]),
|
|
507
|
-
onChange:
|
|
507
|
+
onChange: t[0] || (t[0] = (a) => z("change", a)),
|
|
508
508
|
onKeydown: Ve
|
|
509
509
|
}), {
|
|
510
510
|
"right-icon": G(() => [
|
|
@@ -512,22 +512,23 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
512
512
|
tabindex: "-1",
|
|
513
513
|
type: "button",
|
|
514
514
|
class: "m-select-input__toggle-button maz-custom",
|
|
515
|
+
"aria-label": `${k.value ? "collapse" : "expand"} list of options`,
|
|
515
516
|
onClick: E(he, ["stop"])
|
|
516
517
|
}, [
|
|
517
518
|
T(v(q), { class: "m-select-chevron maz-text-xl" })
|
|
518
|
-
])
|
|
519
|
+
], 8, We)
|
|
519
520
|
]),
|
|
520
521
|
_: 1
|
|
521
522
|
/* STABLE */
|
|
522
523
|
}, 16, ["id", "required", "border-active", "color", "model-value", "size", "disabled"]),
|
|
523
|
-
T(De, { name:
|
|
524
|
+
T(De, { name: te.value }, {
|
|
524
525
|
default: G(() => [
|
|
525
|
-
|
|
526
|
+
k.value ? (i(), V(
|
|
526
527
|
"div",
|
|
527
528
|
{
|
|
528
529
|
key: 0,
|
|
529
530
|
ref_key: "optionsListElement",
|
|
530
|
-
ref:
|
|
531
|
+
ref: $,
|
|
531
532
|
class: N(["m-select-list", {
|
|
532
533
|
"--top": e.listPosition.includes("top"),
|
|
533
534
|
"--left": e.listPosition.includes("left"),
|
|
@@ -540,14 +541,14 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
540
541
|
})
|
|
541
542
|
},
|
|
542
543
|
[
|
|
543
|
-
e.search ? (
|
|
544
|
+
e.search ? (i(), I(ce, {
|
|
544
545
|
key: 0,
|
|
545
546
|
ref_key: "searchInputComponent",
|
|
546
547
|
ref: ee,
|
|
547
548
|
modelValue: L.value,
|
|
548
549
|
"onUpdate:modelValue": [
|
|
549
|
-
|
|
550
|
-
|
|
550
|
+
t[1] || (t[1] = (a) => L.value = a),
|
|
551
|
+
t[2] || (t[2] = (a) => s.value = 0)
|
|
551
552
|
],
|
|
552
553
|
size: "sm",
|
|
553
554
|
color: e.color,
|
|
@@ -556,21 +557,21 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
556
557
|
autocomplete: "off",
|
|
557
558
|
tabindex: "-1",
|
|
558
559
|
class: "m-select-list__search-input maz-flex-none",
|
|
559
|
-
"left-icon": v(
|
|
560
|
-
onKeydown:
|
|
560
|
+
"left-icon": v(B),
|
|
561
|
+
onKeydown: ie
|
|
561
562
|
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : d("v-if", !0),
|
|
562
563
|
d(`
|
|
563
564
|
@slot No results slot - Displayed when no results corresponding with search query
|
|
564
565
|
`),
|
|
565
566
|
!c.value || c.value.length <= 0 ? O(e.$slots, "no-results", { key: 1 }, () => [
|
|
566
|
-
P("span",
|
|
567
|
+
P("span", Qe, [
|
|
567
568
|
T(v(J), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
568
569
|
])
|
|
569
|
-
], !0) : (
|
|
570
|
-
(
|
|
570
|
+
], !0) : (i(), V("div", Re, [
|
|
571
|
+
(i(!0), V(
|
|
571
572
|
Me,
|
|
572
573
|
null,
|
|
573
|
-
Te(c.value, (a, n) => (
|
|
574
|
+
Te(c.value, (a, n) => (i(), V("button", {
|
|
574
575
|
key: n,
|
|
575
576
|
tabindex: "-1",
|
|
576
577
|
type: "button",
|
|
@@ -582,9 +583,9 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
582
583
|
}
|
|
583
584
|
]]),
|
|
584
585
|
style: Z(e.itemHeight ? { minHeight: `${e.itemHeight}px` } : void 0),
|
|
585
|
-
onClick: E((u) =>
|
|
586
|
+
onClick: E((u) => re(a), ["prevent", "stop"])
|
|
586
587
|
}, [
|
|
587
|
-
e.multiple ? (
|
|
588
|
+
e.multiple ? (i(), I(v(b), {
|
|
588
589
|
key: 0,
|
|
589
590
|
tabindex: "-1",
|
|
590
591
|
"model-value": F(a),
|
|
@@ -608,7 +609,7 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
608
609
|
/* TEXT */
|
|
609
610
|
)
|
|
610
611
|
], !0)
|
|
611
|
-
], 14,
|
|
612
|
+
], 14, je))),
|
|
612
613
|
128
|
|
613
614
|
/* KEYED_FRAGMENT */
|
|
614
615
|
))
|
|
@@ -626,9 +627,9 @@ const We = { class: "m-select-list__no-results" }, Qe = {
|
|
|
626
627
|
/* CLASS, STYLE, NEED_HYDRATION */
|
|
627
628
|
));
|
|
628
629
|
}
|
|
629
|
-
}),
|
|
630
|
+
}), Xe = /* @__PURE__ */ be(Ze, [["__scopeId", "data-v-0fceffd9"]]);
|
|
630
631
|
export {
|
|
631
|
-
|
|
632
|
+
Xe as M,
|
|
632
633
|
be as _,
|
|
633
634
|
ye as u
|
|
634
635
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../assets/MazSpinner.css";
|
|
2
2
|
import { defineComponent as t, openBlock as o, createElementBlock as c, normalizeClass as n, pushScopeId as s, popScopeId as r, createElementVNode as i } from "vue";
|
|
3
|
-
import { _ as p } from "./MazTable-
|
|
3
|
+
import { _ as p } from "./MazTable-BL_3hR2Z.mjs";
|
|
4
4
|
const a = (e) => (s("data-v-c67298ec"), e = e(), r(), e), d = ["width", "height"], l = /* @__PURE__ */ a(() => /* @__PURE__ */ i(
|
|
5
5
|
"path",
|
|
6
6
|
{ d: "M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z" },
|