maz-ui 3.31.0 → 3.31.2
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/README.md +6 -6
- package/components/MazAccordion.d.ts +2 -2
- package/components/MazAccordion.mjs +1 -1
- package/components/MazDropdown.d.ts +2 -2
- package/components/MazDropdown.mjs +16 -16
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazSelect.d.ts +2 -2
- package/components/MazSelect.mjs +1 -1
- package/components/MazTable.d.ts +8 -0
- package/components/MazTable.mjs +1 -1
- package/components/assets/MazAccordion.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/chunks/{MazAccordion-wRHTLK7X.mjs → MazAccordion-3KSb_aBw.mjs} +37 -37
- package/components/chunks/{MazBtn-bL_VYiL1.mjs → MazBtn-M7Pnxit5.mjs} +2 -2
- package/components/chunks/{MazBtn-A_B9pbiE.mjs → MazBtn-WsXG0JB8.mjs} +2 -2
- package/components/chunks/{MazCheckbox-eI5DclIt.mjs → MazCheckbox-4gr5TnSK.mjs} +1 -1
- package/components/chunks/{MazCheckbox-GE-RvDQj.mjs → MazCheckbox-EadIf3L9.mjs} +1 -1
- package/components/chunks/{MazIcon-icjrWrvA.mjs → MazIcon-002AxbwZ.mjs} +1 -1
- package/components/chunks/{MazPhoneNumberInput-BiFGrTa7.mjs → MazPhoneNumberInput-TdklZIjq.mjs} +155 -159
- package/components/chunks/{MazSelect-nwyPkcJ-.mjs → MazSelect-ABbMoI-M.mjs} +173 -177
- package/components/chunks/{MazSpinner-Q96BIyG0.mjs → MazSpinner-1Sy8XBOO.mjs} +1 -1
- package/components/chunks/{MazSpinner-OKizZUdU.mjs → MazSpinner-B2tSR6e8.mjs} +1 -1
- package/components/chunks/{MazSpinner-LpsGR4tG.mjs → MazSpinner-eGQPU8Yp.mjs} +1 -1
- package/components/chunks/{MazSpinner-kv0RbQpi.mjs → MazSpinner-liomP-Gb.mjs} +1 -1
- package/components/chunks/{MazTable-rnu9lv5r.mjs → MazTable-4_j2qksi.mjs} +611 -610
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +2 -2
- package/nuxt/types.d.mts +2 -2
- package/package.json +4 -4
- package/resolvers/unplugin-vue-components-resolver.d.ts +1 -1
- package/types/components/MazAccordion.vue.d.ts +2 -2
- package/types/components/MazDropdown.vue.d.ts +2 -2
- package/types/components/MazSelect.vue.d.ts +2 -2
- package/types/components/MazTable.vue.d.ts +8 -0
- package/types/resolvers/unplugin-vue-components-resolver.d.ts +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../assets/MazSelect.css";
|
|
2
|
-
import { computed as i, defineComponent as pe, defineAsyncComponent as
|
|
2
|
+
import { computed as i, defineComponent as pe, defineAsyncComponent as I, ref as f, getCurrentInstance as me, onMounted as Ie, useSlots as Ke, openBlock as u, createElementBlock as V, normalizeClass as T, normalizeStyle as G, createElementVNode as P, createCommentVNode as d, renderSlot as O, createBlock as w, unref as v, resolveDynamicComponent as de, withDirectives as Be, mergeProps as fe, toHandlers as Ce, vModelDynamic as $e, createTextVNode as Se, toDisplayString as ve, withModifiers as E, withCtx as J, createVNode as M, useCssVars as Le, onBeforeMount as Ae, Transition as De, Fragment as Me, renderList as Te, nextTick as ne } from "vue";
|
|
3
3
|
function Pe(y, p) {
|
|
4
4
|
let b;
|
|
5
|
-
return function(...
|
|
5
|
+
return function(...K) {
|
|
6
6
|
clearTimeout(b), b = setTimeout(() => {
|
|
7
|
-
y.apply(this,
|
|
7
|
+
y.apply(this, K);
|
|
8
8
|
}, p);
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -15,7 +15,7 @@ const ye = ({
|
|
|
15
15
|
}) => i(() => b ?? `${y}-${p == null ? void 0 : p.uid}`), Ne = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "m-input-wrapper-left"
|
|
18
|
-
}, qe = { class: "m-input-wrapper-input" }, Fe = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"],
|
|
18
|
+
}, qe = { class: "m-input-wrapper-input" }, Fe = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"], He = { key: 0 }, Ee = {
|
|
19
19
|
key: 1,
|
|
20
20
|
class: "m-input-wrapper-right"
|
|
21
21
|
}, Oe = /* @__PURE__ */ pe({
|
|
@@ -54,16 +54,16 @@ const ye = ({
|
|
|
54
54
|
},
|
|
55
55
|
emits: ["focus", "blur", "update:model-value", "click", "change"],
|
|
56
56
|
setup(y, { emit: p }) {
|
|
57
|
-
const b =
|
|
57
|
+
const b = I(() => import("./MazBtn-WsXG0JB8.mjs")), K = I(() => import("./MazIcon-C329_2BT.mjs")), N = I(() => import("./eye-slash-rdPLIzFI.mjs")), X = I(() => import("./eye-3jm1b22X.mjs")), Y = I(() => import("./check-_5Up9njX.mjs")), t = y, h = p, z = f(!1), s = f(!1), L = f(), x = me(), _ = ye({
|
|
58
58
|
componentName: "MazInput",
|
|
59
59
|
instance: x,
|
|
60
60
|
providedId: t.id
|
|
61
61
|
});
|
|
62
62
|
Ie(() => {
|
|
63
|
-
var
|
|
64
|
-
t.autoFocus && ((
|
|
63
|
+
var l;
|
|
64
|
+
t.autoFocus && ((l = L.value) == null || l.focus());
|
|
65
65
|
});
|
|
66
|
-
const U = i(() => t.type === "password"),
|
|
66
|
+
const U = i(() => t.type === "password"), B = i(() => z.value ? "text" : t.type), ee = i(() => {
|
|
67
67
|
if (!t.noBorder) {
|
|
68
68
|
if (t.error)
|
|
69
69
|
return "maz-border-danger";
|
|
@@ -91,60 +91,60 @@ const ye = ({
|
|
|
91
91
|
}
|
|
92
92
|
return "--default-border";
|
|
93
93
|
}
|
|
94
|
-
}), k = Ke(),
|
|
95
|
-
const { required:
|
|
94
|
+
}), k = Ke(), A = i(() => {
|
|
95
|
+
const { required: l, placeholder: m } = t;
|
|
96
96
|
if (m)
|
|
97
|
-
return
|
|
97
|
+
return l ? `${m} *` : m;
|
|
98
98
|
}), W = i(() => t.modelValue !== void 0 && t.modelValue !== ""), q = i({
|
|
99
99
|
get: () => t.modelValue,
|
|
100
|
-
set: (
|
|
101
|
-
}), Q = i(() => (!!t.label || !!t.hint) && (s.value || !!W.value || !!t.placeholder || ["date", "month", "week"].includes(t.type))), R = i(() => !!t.label || !!t.hint), $ = () => !!k["right-icon"] || U.value || !!k["valid-button"] || t.validButton || !!t.rightIcon, F = () => !!k["left-icon"] || !!t.leftIcon, te = (
|
|
102
|
-
h("focus",
|
|
103
|
-
}, oe = (
|
|
104
|
-
h("blur",
|
|
105
|
-
}, S = (
|
|
106
|
-
h("update:model-value",
|
|
107
|
-
}, t.debounceDelay), j = (
|
|
100
|
+
set: (l) => j(l)
|
|
101
|
+
}), Q = i(() => (!!t.label || !!t.hint) && (s.value || !!W.value || !!t.placeholder || ["date", "month", "week"].includes(t.type))), R = i(() => !!t.label || !!t.hint), $ = () => !!k["right-icon"] || U.value || !!k["valid-button"] || t.validButton || !!t.rightIcon, F = () => !!k["left-icon"] || !!t.leftIcon, te = (l) => {
|
|
102
|
+
h("focus", l), s.value = !0;
|
|
103
|
+
}, oe = (l) => {
|
|
104
|
+
h("blur", l), s.value = !1;
|
|
105
|
+
}, S = (l) => h("change", l), C = Pe((l) => {
|
|
106
|
+
h("update:model-value", l);
|
|
107
|
+
}, t.debounceDelay), j = (l) => {
|
|
108
108
|
if (t.debounce)
|
|
109
|
-
return
|
|
110
|
-
h("update:model-value",
|
|
109
|
+
return C(l);
|
|
110
|
+
h("update:model-value", l);
|
|
111
111
|
};
|
|
112
|
-
return (
|
|
112
|
+
return (l, m) => (u(), V(
|
|
113
113
|
"div",
|
|
114
114
|
{
|
|
115
115
|
class: T(["m-input", [
|
|
116
116
|
{
|
|
117
|
-
"--is-focused": s.value ||
|
|
117
|
+
"--is-focused": s.value || l.borderActive,
|
|
118
118
|
"--should-up": Q.value,
|
|
119
119
|
"--has-label": R.value,
|
|
120
|
-
"--is-disabled":
|
|
121
|
-
"--is-readonly":
|
|
122
|
-
"--has-z-2":
|
|
123
|
-
"--has-state":
|
|
120
|
+
"--is-disabled": l.disabled,
|
|
121
|
+
"--is-readonly": l.readonly,
|
|
122
|
+
"--has-z-2": l.error || l.warning || l.success,
|
|
123
|
+
"--has-state": l.error || l.warning || l.success
|
|
124
124
|
},
|
|
125
125
|
t.class,
|
|
126
|
-
`--${
|
|
127
|
-
`--${
|
|
126
|
+
`--${l.color}`,
|
|
127
|
+
`--${l.size}`
|
|
128
128
|
]]),
|
|
129
|
-
style: G(
|
|
129
|
+
style: G(l.style)
|
|
130
130
|
},
|
|
131
131
|
[
|
|
132
132
|
P(
|
|
133
133
|
"div",
|
|
134
134
|
{
|
|
135
|
-
class: T(["m-input-wrapper", [
|
|
135
|
+
class: T(["m-input-wrapper", [l.inputClasses, ee.value, { "maz-rounded": !l.noRadius }]])
|
|
136
136
|
},
|
|
137
137
|
[
|
|
138
138
|
F() ? (u(), V("div", Ne, [
|
|
139
139
|
d(`
|
|
140
140
|
@slot left-icon - The icon to display on the left of the input
|
|
141
141
|
`),
|
|
142
|
-
|
|
143
|
-
typeof
|
|
142
|
+
l.$slots["left-icon"] || l.leftIcon ? O(l.$slots, "left-icon", { key: 0 }, () => [
|
|
143
|
+
typeof l.leftIcon == "string" ? (u(), w(v(K), {
|
|
144
144
|
key: 0,
|
|
145
|
-
name:
|
|
145
|
+
name: l.leftIcon,
|
|
146
146
|
class: "maz-text-xl maz-text-muted"
|
|
147
|
-
}, null, 8, ["name"])) :
|
|
147
|
+
}, null, 8, ["name"])) : l.leftIcon ? (u(), w(de(l.leftIcon), {
|
|
148
148
|
key: 1,
|
|
149
149
|
class: "maz-text-xl maz-text-muted"
|
|
150
150
|
})) : d("v-if", !0)
|
|
@@ -154,78 +154,78 @@ const ye = ({
|
|
|
154
154
|
Be(P("input", fe({
|
|
155
155
|
id: v(_),
|
|
156
156
|
ref_key: "input",
|
|
157
|
-
ref:
|
|
157
|
+
ref: L,
|
|
158
158
|
"onUpdate:modelValue": m[0] || (m[0] = (c) => q.value = c),
|
|
159
|
-
type:
|
|
160
|
-
name:
|
|
161
|
-
},
|
|
162
|
-
inputmode:
|
|
163
|
-
placeholder:
|
|
164
|
-
"aria-label":
|
|
165
|
-
disabled:
|
|
166
|
-
readonly:
|
|
167
|
-
required:
|
|
159
|
+
type: B.value,
|
|
160
|
+
name: l.name
|
|
161
|
+
}, l.$attrs, {
|
|
162
|
+
inputmode: l.inputmode,
|
|
163
|
+
placeholder: A.value,
|
|
164
|
+
"aria-label": l.label || l.placeholder,
|
|
165
|
+
disabled: l.disabled,
|
|
166
|
+
readonly: l.readonly,
|
|
167
|
+
required: l.required,
|
|
168
168
|
class: "m-input-input"
|
|
169
169
|
}, Ce({
|
|
170
170
|
blur: oe,
|
|
171
171
|
focus: te,
|
|
172
172
|
change: S
|
|
173
173
|
}, !0), {
|
|
174
|
-
onClick: m[1] || (m[1] = (c) =>
|
|
174
|
+
onClick: m[1] || (m[1] = (c) => l.$emit("click", c))
|
|
175
175
|
}), null, 16, Fe), [
|
|
176
176
|
[$e, q.value]
|
|
177
177
|
]),
|
|
178
|
-
|
|
178
|
+
l.label || l.hint ? (u(), V(
|
|
179
179
|
"span",
|
|
180
180
|
{
|
|
181
181
|
key: 0,
|
|
182
182
|
ref: "label",
|
|
183
183
|
class: T(["m-input-label", [
|
|
184
184
|
{
|
|
185
|
-
"maz-text-danger-600":
|
|
186
|
-
"maz-text-success-600":
|
|
187
|
-
"maz-text-warning-600":
|
|
185
|
+
"maz-text-danger-600": l.error,
|
|
186
|
+
"maz-text-success-600": l.success,
|
|
187
|
+
"maz-text-warning-600": l.warning
|
|
188
188
|
}
|
|
189
189
|
]])
|
|
190
190
|
},
|
|
191
191
|
[
|
|
192
192
|
Se(
|
|
193
|
-
ve(
|
|
193
|
+
ve(l.hint || l.label) + " ",
|
|
194
194
|
1
|
|
195
195
|
/* TEXT */
|
|
196
196
|
),
|
|
197
|
-
|
|
197
|
+
l.required ? (u(), V("sup", He, "*")) : d("v-if", !0)
|
|
198
198
|
],
|
|
199
199
|
2
|
|
200
200
|
/* CLASS */
|
|
201
201
|
)) : d("v-if", !0)
|
|
202
202
|
]),
|
|
203
|
-
$() ? (u(), V("div",
|
|
203
|
+
$() ? (u(), V("div", Ee, [
|
|
204
204
|
d(`
|
|
205
205
|
@slot right-icon - The icon to display on the right of the input
|
|
206
206
|
`),
|
|
207
|
-
|
|
208
|
-
typeof
|
|
207
|
+
l.$slots["right-icon"] || l.rightIcon ? O(l.$slots, "right-icon", { key: 0 }, () => [
|
|
208
|
+
typeof l.rightIcon == "string" ? (u(), w(v(K), {
|
|
209
209
|
key: 0,
|
|
210
|
-
name:
|
|
210
|
+
name: l.rightIcon,
|
|
211
211
|
class: "maz-text-xl maz-text-muted"
|
|
212
|
-
}, null, 8, ["name"])) :
|
|
212
|
+
}, null, 8, ["name"])) : l.rightIcon ? (u(), w(de(l.rightIcon), {
|
|
213
213
|
key: 1,
|
|
214
214
|
class: "maz-text-xl maz-text-muted"
|
|
215
215
|
})) : d("v-if", !0)
|
|
216
216
|
], !0) : d("v-if", !0),
|
|
217
|
-
U.value ? (u(),
|
|
217
|
+
U.value ? (u(), w(v(b), {
|
|
218
218
|
key: 1,
|
|
219
219
|
color: "transparent",
|
|
220
220
|
tabindex: "-1",
|
|
221
221
|
size: "mini",
|
|
222
|
-
onClick: m[2] || (m[2] =
|
|
222
|
+
onClick: m[2] || (m[2] = E((c) => z.value = !z.value, ["stop"]))
|
|
223
223
|
}, {
|
|
224
224
|
default: J(() => [
|
|
225
|
-
z.value ? (u(),
|
|
225
|
+
z.value ? (u(), w(v(N), {
|
|
226
226
|
key: 0,
|
|
227
227
|
class: "maz-text-xl maz-text-muted"
|
|
228
|
-
})) : (u(),
|
|
228
|
+
})) : (u(), w(v(X), {
|
|
229
229
|
key: 1,
|
|
230
230
|
class: "maz-text-xl maz-text-muted"
|
|
231
231
|
}))
|
|
@@ -236,18 +236,18 @@ const ye = ({
|
|
|
236
236
|
d(`
|
|
237
237
|
@slot valid-button - Replace the valid button by your own
|
|
238
238
|
`),
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
l.$slots["valid-button"] || l.validButton ? O(l.$slots, "valid-button", { key: 2 }, () => [
|
|
240
|
+
M(v(b), {
|
|
241
241
|
color: "transparent",
|
|
242
|
-
disabled:
|
|
242
|
+
disabled: l.disabled,
|
|
243
243
|
tabindex: "-1",
|
|
244
|
-
loading:
|
|
244
|
+
loading: l.validButtonLoading,
|
|
245
245
|
class: "m-input-valid-button",
|
|
246
246
|
size: "mini",
|
|
247
247
|
type: "submit"
|
|
248
248
|
}, {
|
|
249
249
|
default: J(() => [
|
|
250
|
-
|
|
250
|
+
M(v(Y), { class: "maz-text-2xl maz-text-normal" })
|
|
251
251
|
]),
|
|
252
252
|
_: 1
|
|
253
253
|
/* STABLE */
|
|
@@ -265,8 +265,8 @@ const ye = ({
|
|
|
265
265
|
}
|
|
266
266
|
}), be = (y, p) => {
|
|
267
267
|
const b = y.__vccOpts || y;
|
|
268
|
-
for (const [
|
|
269
|
-
b[
|
|
268
|
+
for (const [K, N] of p)
|
|
269
|
+
b[K] = N;
|
|
270
270
|
return b;
|
|
271
271
|
}, ce = /* @__PURE__ */ be(Oe, [["__scopeId", "data-v-e9e7fe2d"]]);
|
|
272
272
|
f("system");
|
|
@@ -275,15 +275,11 @@ let se = null;
|
|
|
275
275
|
function Ue(y, p) {
|
|
276
276
|
se && clearTimeout(se), se = setTimeout(y, p);
|
|
277
277
|
}
|
|
278
|
-
const We = {
|
|
279
|
-
key: 0,
|
|
280
|
-
tabindex: "-1",
|
|
281
|
-
class: "m-select-list__search-wrapper"
|
|
282
|
-
}, Qe = { class: "m-select-list__no-results" }, Re = {
|
|
278
|
+
const We = { class: "m-select-list__no-results" }, Qe = {
|
|
283
279
|
key: 2,
|
|
284
280
|
class: "m-select-list__scroll-wrapper",
|
|
285
281
|
tabindex: "-1"
|
|
286
|
-
},
|
|
282
|
+
}, Re = ["onClick"], je = /* @__PURE__ */ pe({
|
|
287
283
|
inheritAttrs: !1,
|
|
288
284
|
__name: "MazSelect",
|
|
289
285
|
props: {
|
|
@@ -296,7 +292,7 @@ const We = {
|
|
|
296
292
|
optionLabelKey: { default: "label" },
|
|
297
293
|
optionInputValueKey: { default: "label" },
|
|
298
294
|
listPosition: { default: "bottom left" },
|
|
299
|
-
itemHeight: { default:
|
|
295
|
+
itemHeight: { default: void 0 },
|
|
300
296
|
maxListHeight: { default: 240 },
|
|
301
297
|
maxListWidth: { default: void 0 },
|
|
302
298
|
size: { default: "md" },
|
|
@@ -311,39 +307,40 @@ const We = {
|
|
|
311
307
|
emits: ["close", "open", "blur", "focus", "change", "update:model-value", "selected-option"],
|
|
312
308
|
setup(y, { emit: p }) {
|
|
313
309
|
Le((e) => ({
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
"
|
|
310
|
+
"5e7d1dfe": U.value,
|
|
311
|
+
b3b9ed86: x.value,
|
|
312
|
+
"55cb06e5": _.value
|
|
317
313
|
}));
|
|
318
|
-
const b =
|
|
314
|
+
const b = I(() => import("./MazCheckbox-EadIf3L9.mjs")), K = I(() => import("./magnifying-glass-ebhrla2J.mjs")), N = I(() => import("./chevron-down-bC0s_0yH.mjs")), X = I(() => import("./no-symbol-JnXtUaU-.mjs")), Y = me(), t = y, h = p, z = f(!1), s = f(), L = i(
|
|
319
315
|
() => ["black", "transparent", "white"].includes(t.color)
|
|
320
316
|
), x = i(
|
|
321
|
-
() =>
|
|
317
|
+
() => L.value ? "var(--maz-color-black)" : `var(--maz-color-${t.color}-800)`
|
|
322
318
|
), _ = i(
|
|
323
|
-
() =>
|
|
319
|
+
() => L.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-100)`
|
|
324
320
|
), U = i(
|
|
325
|
-
() =>
|
|
326
|
-
),
|
|
321
|
+
() => L.value ? "var(--maz-color-muted)" : `var(--maz-color-${t.color}-200)`
|
|
322
|
+
), B = i(() => z.value || t.open), ee = ye({
|
|
327
323
|
componentName: "MazSelect",
|
|
328
324
|
instance: Y,
|
|
329
325
|
providedId: t.id
|
|
330
326
|
}), k = i(
|
|
331
327
|
() => {
|
|
332
328
|
var e;
|
|
333
|
-
return (e = t.options) == null ? void 0 : e.map((
|
|
334
|
-
[t.optionValueKey]:
|
|
335
|
-
[t.optionLabelKey]:
|
|
336
|
-
[t.optionInputValueKey]:
|
|
329
|
+
return (e = t.options) == null ? void 0 : e.map((o) => typeof o == "string" || typeof o == "number" || typeof o == "boolean" ? {
|
|
330
|
+
[t.optionValueKey]: o,
|
|
331
|
+
[t.optionLabelKey]: o,
|
|
332
|
+
[t.optionInputValueKey]: o
|
|
337
333
|
} : {
|
|
338
|
-
|
|
339
|
-
[t.
|
|
340
|
-
[t.
|
|
334
|
+
...o,
|
|
335
|
+
[t.optionValueKey]: o[t.optionValueKey],
|
|
336
|
+
[t.optionLabelKey]: o[t.optionLabelKey],
|
|
337
|
+
[t.optionInputValueKey]: o[t.optionInputValueKey]
|
|
341
338
|
});
|
|
342
339
|
}
|
|
343
|
-
),
|
|
340
|
+
), A = i(
|
|
344
341
|
() => {
|
|
345
342
|
var e;
|
|
346
|
-
return ((e = k.value) == null ? void 0 : e.filter((
|
|
343
|
+
return ((e = k.value) == null ? void 0 : e.filter((o) => t.multiple ? Array.isArray(t.modelValue) ? t.modelValue.includes(o[t.optionValueKey]) && !$(o[t.optionValueKey]) : !1 : t.modelValue === o[t.optionValueKey] && !$(o[t.optionValueKey]))) ?? [];
|
|
347
344
|
}
|
|
348
345
|
);
|
|
349
346
|
Ae(() => {
|
|
@@ -353,90 +350,90 @@ const We = {
|
|
|
353
350
|
const W = f(), q = f(), Q = f(), R = f(), $ = (e) => e == null;
|
|
354
351
|
function F(e) {
|
|
355
352
|
var a;
|
|
356
|
-
return (((a =
|
|
353
|
+
return (((a = A.value) == null ? void 0 : a.some(
|
|
357
354
|
(n) => n[t.optionValueKey] === e[t.optionValueKey]
|
|
358
355
|
)) ?? !1) && !$(e[t.optionValueKey]);
|
|
359
356
|
}
|
|
360
357
|
const te = i(() => {
|
|
361
|
-
var e,
|
|
358
|
+
var e, o;
|
|
362
359
|
return t.multiple && t.modelValue && Array.isArray(t.modelValue) ? t.modelValue.map(
|
|
363
360
|
(a) => {
|
|
364
361
|
var n, r;
|
|
365
362
|
return (r = (n = k.value) == null ? void 0 : n.find((g) => g[t.optionValueKey] === a)) == null ? void 0 : r[t.optionInputValueKey];
|
|
366
363
|
}
|
|
367
|
-
).join(", ") : (
|
|
364
|
+
).join(", ") : (o = (e = k.value) == null ? void 0 : e.find(
|
|
368
365
|
(a) => a[t.optionValueKey] === t.modelValue
|
|
369
|
-
)) == null ? void 0 :
|
|
366
|
+
)) == null ? void 0 : o[t.optionInputValueKey];
|
|
370
367
|
}), oe = i(
|
|
371
368
|
() => t.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
|
|
372
|
-
), S = f(""),
|
|
369
|
+
), S = f(""), C = f("");
|
|
373
370
|
function j(e) {
|
|
374
371
|
return e.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[^\dA-Za-z\u0400-\u04FF]/g, "");
|
|
375
372
|
}
|
|
376
|
-
const
|
|
377
|
-
j(
|
|
373
|
+
const l = (e, o) => o && e && j(e.toString().toLocaleLowerCase().trim()).includes(
|
|
374
|
+
j(o.toLocaleLowerCase().trim())
|
|
378
375
|
);
|
|
379
376
|
function m(e) {
|
|
380
|
-
var
|
|
381
|
-
return e ? (
|
|
377
|
+
var o;
|
|
378
|
+
return e ? (o = k.value) == null ? void 0 : o.filter((a) => {
|
|
382
379
|
const n = a[t.optionLabelKey], r = a[t.optionValueKey], g = a[t.optionInputValueKey];
|
|
383
|
-
return
|
|
380
|
+
return l(n, e) || l(r, e) || l(g, e);
|
|
384
381
|
}) : k.value;
|
|
385
382
|
}
|
|
386
383
|
const c = i(() => m(S.value)), Z = async (e) => {
|
|
387
|
-
var
|
|
388
|
-
if (e && ("relatedTarget" in e && ((
|
|
384
|
+
var o;
|
|
385
|
+
if (e && ("relatedTarget" in e && ((o = W.value) != null && o.contains(e.relatedTarget)) || e.type === "keydown"))
|
|
389
386
|
return e.preventDefault();
|
|
390
387
|
await ne(), z.value = !1, s.value = 0, h("close", e);
|
|
391
|
-
},
|
|
392
|
-
t.disabled ||
|
|
388
|
+
}, H = async (e) => {
|
|
389
|
+
t.disabled || B.value || (e == null || e.preventDefault(), z.value = !0, await le(), h("focus", e), h("open", z.value));
|
|
393
390
|
};
|
|
394
391
|
function re() {
|
|
395
|
-
var e,
|
|
396
|
-
(
|
|
392
|
+
var e, o;
|
|
393
|
+
(o = ((e = q.value) == null ? void 0 : e.$el).querySelector("input")) == null || o.focus();
|
|
397
394
|
}
|
|
398
395
|
function he(e) {
|
|
399
396
|
z.value ? Z(e) : re();
|
|
400
397
|
}
|
|
401
398
|
function ge(e) {
|
|
402
|
-
var
|
|
403
|
-
S.value = e, (a = ((
|
|
399
|
+
var o, a;
|
|
400
|
+
S.value = e, (a = ((o = Q.value) == null ? void 0 : o.$el).querySelector("input")) == null || a.focus();
|
|
404
401
|
}
|
|
405
402
|
function ze(e) {
|
|
406
403
|
var a;
|
|
407
|
-
e === "Backspace" &&
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
(n) => n[t.optionValueKey] ===
|
|
404
|
+
e === "Backspace" && C.value.length > 0 ? C.value = C.value.slice(0, -1) : C.value += e;
|
|
405
|
+
const o = m(C.value);
|
|
406
|
+
o != null && o.length && (s.value = (a = c.value) == null ? void 0 : a.findIndex(
|
|
407
|
+
(n) => n[t.optionValueKey] === o[0][t.optionValueKey]
|
|
411
408
|
), typeof s.value == "number" && s.value >= 0 && le(s.value)), Ue(() => {
|
|
412
|
-
|
|
409
|
+
C.value = "";
|
|
413
410
|
}, 1e3);
|
|
414
411
|
}
|
|
415
412
|
const Ve = (e) => {
|
|
416
|
-
const
|
|
417
|
-
/^[\dA-Za-z\u0400-\u04FF]$/.test(
|
|
413
|
+
const o = e.key;
|
|
414
|
+
/^[\dA-Za-z\u0400-\u04FF]$/.test(o) ? (e.preventDefault(), H(e), t.search ? ge(o) : ze(o)) : ue(e);
|
|
418
415
|
}, ue = (e) => {
|
|
419
|
-
const
|
|
416
|
+
const o = e.code, a = ["ArrowUp", "ArrowDown"].includes(o), n = ["Enter", "Space"].includes(o), r = o === "Escape" && B.value;
|
|
420
417
|
a ? ke(e, s.value) : n ? we(e, s.value) : r && Z();
|
|
421
|
-
}, ke = (e,
|
|
418
|
+
}, ke = (e, o) => {
|
|
422
419
|
var r;
|
|
423
420
|
e.preventDefault();
|
|
424
421
|
const a = e.code;
|
|
425
|
-
|
|
422
|
+
B.value || H(e);
|
|
426
423
|
const n = (r = c.value) == null ? void 0 : r.length;
|
|
427
|
-
n && (typeof
|
|
428
|
-
}, we = (e,
|
|
424
|
+
n && (typeof o == "number" ? o === n - 1 && a === "ArrowDown" ? s.value = 0 : o === 0 && a === "ArrowUp" ? s.value = n - 1 : s.value = a === "ArrowDown" ? o + 1 : o - 1 : s.value = a === "ArrowDown" ? 0 : n - 1, le(s.value));
|
|
425
|
+
}, we = (e, o) => {
|
|
429
426
|
var n, r, g;
|
|
430
|
-
if (e.preventDefault(), !
|
|
431
|
-
return
|
|
432
|
-
const a =
|
|
427
|
+
if (e.preventDefault(), !B.value)
|
|
428
|
+
return H(e);
|
|
429
|
+
const a = o ? ((n = c.value) == null ? void 0 : n[o]) ?? ((r = c.value) == null ? void 0 : r[0]) : (g = c.value) == null ? void 0 : g[0];
|
|
433
430
|
$(a) || ie(a);
|
|
434
431
|
};
|
|
435
432
|
async function le(e) {
|
|
436
433
|
var a, n;
|
|
437
434
|
await ne(), typeof e != "number" && ae();
|
|
438
|
-
const
|
|
439
|
-
typeof
|
|
435
|
+
const o = e ?? s.value;
|
|
436
|
+
typeof o == "number" && o >= 0 && ((n = (a = R.value) == null ? void 0 : a.querySelectorAll(".m-select-list-item")[o]) == null || n.scrollIntoView({
|
|
440
437
|
behavior: "auto",
|
|
441
438
|
block: "nearest",
|
|
442
439
|
inline: "start"
|
|
@@ -444,36 +441,36 @@ const We = {
|
|
|
444
441
|
}
|
|
445
442
|
function ae(e) {
|
|
446
443
|
var a;
|
|
447
|
-
const
|
|
444
|
+
const o = (a = c.value) == null ? void 0 : a.findIndex((n) => {
|
|
448
445
|
var r, g;
|
|
449
|
-
return t.multiple && Array.isArray(t.modelValue) ? e ? e[t.optionValueKey] === n[t.optionValueKey] : [...t.modelValue].reverse()[0] === n[t.optionValueKey] : ((g = (r =
|
|
446
|
+
return t.multiple && Array.isArray(t.modelValue) ? e ? e[t.optionValueKey] === n[t.optionValueKey] : [...t.modelValue].reverse()[0] === n[t.optionValueKey] : ((g = (r = A.value) == null ? void 0 : r[0]) == null ? void 0 : g[t.optionValueKey]) === n[t.optionValueKey];
|
|
450
447
|
});
|
|
451
|
-
s.value =
|
|
448
|
+
s.value = o && o >= 0 ? o : 0;
|
|
452
449
|
}
|
|
453
|
-
const ie = (e,
|
|
450
|
+
const ie = (e, o = !0) => {
|
|
454
451
|
var g;
|
|
455
|
-
|
|
456
|
-
const a = (g =
|
|
457
|
-
(
|
|
452
|
+
o && !t.multiple && ne(() => Z()), S.value = "";
|
|
453
|
+
const a = (g = A.value) == null ? void 0 : g.some(
|
|
454
|
+
(D) => D[t.optionValueKey] === e[t.optionValueKey]
|
|
458
455
|
);
|
|
459
|
-
let n =
|
|
456
|
+
let n = A.value;
|
|
460
457
|
a && t.multiple ? n = n == null ? void 0 : n.filter(
|
|
461
|
-
(
|
|
458
|
+
(D) => D[t.optionValueKey] !== e[t.optionValueKey]
|
|
462
459
|
) : t.multiple ? n.push(e) : n = [e];
|
|
463
|
-
const r = n.map((
|
|
460
|
+
const r = n.map((D) => D[t.optionValueKey]);
|
|
464
461
|
h("update:model-value", t.multiple ? r : r[0]), h("selected-option", e), ae(e), re();
|
|
465
462
|
};
|
|
466
|
-
return (e,
|
|
463
|
+
return (e, o) => (u(), V(
|
|
467
464
|
"div",
|
|
468
465
|
{
|
|
469
466
|
ref_key: "mazSelectElement",
|
|
470
467
|
ref: W,
|
|
471
|
-
class: T(["m-select", [{ "--is-open":
|
|
468
|
+
class: T(["m-select", [{ "--is-open": B.value, "--disabled": e.disabled }, t.class, `--${e.size}`]]),
|
|
472
469
|
style: G(e.style),
|
|
473
470
|
onBlurCapture: Z
|
|
474
471
|
},
|
|
475
472
|
[
|
|
476
|
-
|
|
473
|
+
M(ce, fe({
|
|
477
474
|
id: v(ee),
|
|
478
475
|
ref_key: "mazInputComponent",
|
|
479
476
|
ref: q,
|
|
@@ -486,9 +483,9 @@ const We = {
|
|
|
486
483
|
autocomplete: "off",
|
|
487
484
|
size: e.size,
|
|
488
485
|
disabled: e.disabled,
|
|
489
|
-
onFocus: H
|
|
490
|
-
onClick: H
|
|
491
|
-
onChange:
|
|
486
|
+
onFocus: E(H, ["prevent", "stop"]),
|
|
487
|
+
onClick: E(H, ["prevent", "stop"]),
|
|
488
|
+
onChange: o[0] || (o[0] = (a) => h("change", a)),
|
|
492
489
|
onKeydown: Ve
|
|
493
490
|
}), {
|
|
494
491
|
"right-icon": J(() => [
|
|
@@ -496,17 +493,17 @@ const We = {
|
|
|
496
493
|
tabindex: "-1",
|
|
497
494
|
type: "button",
|
|
498
495
|
class: "m-select-input__toggle-button maz-custom",
|
|
499
|
-
onClick:
|
|
496
|
+
onClick: E(he, ["stop"])
|
|
500
497
|
}, [
|
|
501
|
-
|
|
498
|
+
M(v(N), { class: "m-select-chevron maz-text-xl" })
|
|
502
499
|
])
|
|
503
500
|
]),
|
|
504
501
|
_: 1
|
|
505
502
|
/* STABLE */
|
|
506
503
|
}, 16, ["id", "required", "border-active", "color", "model-value", "size", "disabled"]),
|
|
507
|
-
|
|
504
|
+
M(De, { name: oe.value }, {
|
|
508
505
|
default: J(() => [
|
|
509
|
-
|
|
506
|
+
B.value ? (u(), V(
|
|
510
507
|
"div",
|
|
511
508
|
{
|
|
512
509
|
key: 0,
|
|
@@ -524,34 +521,33 @@ const We = {
|
|
|
524
521
|
})
|
|
525
522
|
},
|
|
526
523
|
[
|
|
527
|
-
e.search ? (u(),
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
])) : d("v-if", !0),
|
|
524
|
+
e.search ? (u(), w(ce, {
|
|
525
|
+
key: 0,
|
|
526
|
+
ref_key: "searchInputComponent",
|
|
527
|
+
ref: Q,
|
|
528
|
+
modelValue: S.value,
|
|
529
|
+
"onUpdate:modelValue": [
|
|
530
|
+
o[1] || (o[1] = (a) => S.value = a),
|
|
531
|
+
o[2] || (o[2] = (a) => s.value = 0)
|
|
532
|
+
],
|
|
533
|
+
size: "sm",
|
|
534
|
+
color: e.color,
|
|
535
|
+
placeholder: e.searchPlaceholder,
|
|
536
|
+
name: "search",
|
|
537
|
+
autocomplete: "off",
|
|
538
|
+
tabindex: "-1",
|
|
539
|
+
class: "m-select-list__search-input maz-flex-none",
|
|
540
|
+
"left-icon": v(K),
|
|
541
|
+
onKeydown: ue
|
|
542
|
+
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : d("v-if", !0),
|
|
547
543
|
d(`
|
|
548
544
|
@slot No results slot - Displayed when no results corresponding with search query
|
|
549
545
|
`),
|
|
550
546
|
!c.value || c.value.length <= 0 ? O(e.$slots, "no-results", { key: 1 }, () => [
|
|
551
|
-
P("span",
|
|
552
|
-
|
|
547
|
+
P("span", We, [
|
|
548
|
+
M(v(X), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
553
549
|
])
|
|
554
|
-
], !0) : (u(), V("div",
|
|
550
|
+
], !0) : (u(), V("div", Qe, [
|
|
555
551
|
(u(!0), V(
|
|
556
552
|
Me,
|
|
557
553
|
null,
|
|
@@ -559,17 +555,17 @@ const We = {
|
|
|
559
555
|
key: n,
|
|
560
556
|
tabindex: "-1",
|
|
561
557
|
type: "button",
|
|
562
|
-
class: T(["m-select-list-item maz-custom", [
|
|
558
|
+
class: T(["m-select-list-item maz-custom maz-flex-none", [
|
|
563
559
|
{
|
|
564
560
|
"--is-keyboard-selected": s.value === n,
|
|
565
561
|
"--is-selected": F(a),
|
|
566
562
|
"--is-none-value": $(a[e.optionValueKey])
|
|
567
563
|
}
|
|
568
564
|
]]),
|
|
569
|
-
style: G({ minHeight: `${e.itemHeight}px` }),
|
|
570
|
-
onClick:
|
|
565
|
+
style: G(e.itemHeight ? { minHeight: `${e.itemHeight}px` } : void 0),
|
|
566
|
+
onClick: E((r) => ie(a), ["prevent", "stop"])
|
|
571
567
|
}, [
|
|
572
|
-
e.multiple ? (u(),
|
|
568
|
+
e.multiple ? (u(), w(v(b), {
|
|
573
569
|
key: 0,
|
|
574
570
|
tabindex: "-1",
|
|
575
571
|
"model-value": F(a),
|
|
@@ -593,7 +589,7 @@ const We = {
|
|
|
593
589
|
/* TEXT */
|
|
594
590
|
)
|
|
595
591
|
], !0)
|
|
596
|
-
], 14,
|
|
592
|
+
], 14, Re))),
|
|
597
593
|
128
|
|
598
594
|
/* KEYED_FRAGMENT */
|
|
599
595
|
))
|
|
@@ -611,9 +607,9 @@ const We = {
|
|
|
611
607
|
/* CLASS, STYLE, NEED_HYDRATION */
|
|
612
608
|
));
|
|
613
609
|
}
|
|
614
|
-
}),
|
|
610
|
+
}), Je = /* @__PURE__ */ be(je, [["__scopeId", "data-v-8272b643"]]);
|
|
615
611
|
export {
|
|
616
|
-
|
|
612
|
+
Je as M,
|
|
617
613
|
be as _,
|
|
618
614
|
ye as u
|
|
619
615
|
};
|