maz-ui 3.37.3 → 3.37.4
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/MazBottomSheet.mjs +1 -1
- package/components/MazBtn.d.ts +2 -2
- package/components/MazBtn.mjs +1 -1
- package/components/MazCard.d.ts +2 -0
- package/components/MazCard.mjs +1 -1
- package/components/MazCarousel.mjs +1 -1
- package/components/MazDialog.mjs +1 -1
- package/components/MazDialogPromise.mjs +1 -1
- package/components/MazDrawer.mjs +1 -1
- package/components/MazDropdown.mjs +1 -1
- package/components/MazInput.mjs +1 -1
- package/components/MazInputNumber.mjs +1 -1
- package/components/MazInputPrice.mjs +1 -1
- package/components/MazInputTags.d.ts +4 -4
- package/components/MazInputTags.mjs +1 -1
- package/components/MazPagination.mjs +1 -1
- package/components/MazPhoneNumberInput/CountrySelector.vue.d.ts +8 -4
- package/components/MazPhoneNumberInput/use-maz-phone-number-input.d.ts +2 -2
- package/components/MazPhoneNumberInput.d.ts +21 -8
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.mjs +1 -1
- package/components/MazRadio.d.ts +89 -92
- package/components/MazRadio.mjs +67 -73
- package/components/MazRadioButtons.d.ts +84 -62
- package/components/MazRadioButtons.mjs +112 -60
- package/components/MazSelect.d.ts +12 -7
- package/components/MazSelect.mjs +1 -1
- package/components/MazSwitch.d.ts +61 -67
- package/components/MazSwitch.mjs +41 -48
- package/components/MazTable.mjs +1 -1
- package/components/MazTextarea.d.ts +23 -8
- package/components/MazTextarea.mjs +1 -1
- package/components/assets/MazBtn.css +1 -1
- package/components/assets/MazCard.css +1 -1
- package/components/assets/MazInputNumber.css +1 -1
- package/components/assets/MazInputTags.css +1 -1
- package/components/assets/MazPagination.css +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazRadio.css +1 -1
- package/components/assets/MazRadioButtons.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazSwitch.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/assets/MazTextarea.css +1 -1
- package/components/chunks/{MazBottomSheet-DZ1n4bGL.mjs → MazBottomSheet-B9OYmgyx.mjs} +1 -1
- package/components/chunks/{MazBtn-CnZU5zlG.mjs → MazBtn-4stpYG-V.mjs} +8 -8
- package/components/chunks/{MazBtn-BJs3rzUf.mjs → MazBtn-BQZOiUux.mjs} +8 -8
- package/components/chunks/{MazBtn-DLYgzr9e.mjs → MazBtn-Bgt41rUb.mjs} +11 -11
- package/components/chunks/MazBtn-CNyFbl9Y.mjs +151 -0
- package/components/chunks/{MazBtn-BTHDxDz7.mjs → MazBtn-CrNEwd_M.mjs} +8 -8
- package/components/chunks/MazBtn-CyXtFeAh.mjs +151 -0
- package/components/chunks/{MazBtn-CnkBOGKK.mjs → MazBtn-DOtOjQOl.mjs} +11 -11
- package/components/chunks/{MazBtn-IH6bjzah.mjs → MazBtn-DXC8jXNK.mjs} +8 -8
- package/components/chunks/{MazBtn-Dbe098kd.mjs → MazBtn-De3ZeaJJ.mjs} +8 -8
- package/components/chunks/{MazBtn-CDQAW3fg.mjs → MazBtn-g6VJMuer.mjs} +8 -8
- package/components/chunks/MazBtn-v1mwE1O3.mjs +151 -0
- package/components/chunks/{MazBtn-pLRsSxug.mjs → MazBtn-z9IFp0ZS.mjs} +8 -8
- package/components/chunks/{MazCard-CNE9c3L5.mjs → MazCard-E9Eg2VRn.mjs} +10 -8
- package/components/chunks/{MazCarousel-CMJgMJf1.mjs → MazCarousel-CtSpgIm6.mjs} +1 -1
- package/components/chunks/{MazCheckbox-DJBo7Ejt.mjs → MazCheckbox-BE7eLIkK.mjs} +1 -1
- package/components/chunks/{MazCheckbox-CM7mucQa.mjs → MazCheckbox-eSSrvpn9.mjs} +1 -1
- package/components/chunks/{MazDialog-BVqOTysP.mjs → MazDialog-CjsC6fGo.mjs} +1 -1
- package/components/chunks/{MazDialogPromise-BjciKAwR.mjs → MazDialogPromise-Blv60XZR.mjs} +2 -2
- package/components/chunks/{MazGallery-BUUq89aM.mjs → MazGallery-DRgvR7K0.mjs} +2 -2
- package/components/chunks/{MazIcon-BKfQ_rkt.mjs → MazIcon-C_IIdjqr.mjs} +1 -1
- package/components/chunks/{MazInput-Caas-0Nk.mjs → MazInput-Dn4JzYhe.mjs} +1 -1
- package/components/chunks/{MazInputNumber-CnoCQQzg.mjs → MazInputNumber-Df31nPnc.mjs} +2 -2
- package/components/chunks/{MazInputPrice---5nCUKm.mjs → MazInputPrice-DATyEiwP.mjs} +1 -1
- package/components/chunks/{MazInputTags-CipoVBP2.mjs → MazInputTags-DBzwE87F.mjs} +3 -3
- package/components/chunks/{MazPagination-CXw3yqbu.mjs → MazPagination-BU6fSHr2.mjs} +2 -2
- package/components/chunks/MazPhoneNumberInput-D8hP4ZzW.mjs +1419 -0
- package/components/chunks/{MazPicker-CfhI75aw.mjs → MazPicker-D71j9m8h.mjs} +2 -2
- package/components/chunks/{MazPickerCalendar-DnkNE-Am.mjs → MazPickerCalendar-psuBcTR7.mjs} +3 -3
- package/components/chunks/{MazPickerHeader-Vt86yzXS.mjs → MazPickerHeader-BmqHJE0a.mjs} +1 -1
- package/components/chunks/{MazPickerMonthSwitcher-zfKhsjW1.mjs → MazPickerMonthSwitcher-DgU0pLkF.mjs} +2 -2
- package/components/chunks/{MazPickerShortcuts-DUIKfOO8.mjs → MazPickerShortcuts-D9YXi3Ns.mjs} +2 -2
- package/components/chunks/{MazPickerTime-B2znRxr2.mjs → MazPickerTime-8ZqSEb_N.mjs} +2 -2
- package/components/chunks/{MazPickerYearSwitcher-CB339kof.mjs → MazPickerYearSwitcher-D-zu0tMs.mjs} +3 -3
- package/components/chunks/MazSelect-Cc8JAFML.mjs +731 -0
- package/components/chunks/{MazSpinner-DFseK3o_.mjs → MazSpinner-2-OAJWTi.mjs} +1 -1
- package/components/chunks/MazSpinner-B0xEVmcj.mjs +38 -0
- package/components/chunks/{MazSpinner-2fDI3i5h.mjs → MazSpinner-B3Gt0AEt.mjs} +1 -1
- package/components/chunks/MazSpinner-B6Z6X_KC.mjs +38 -0
- package/components/chunks/{MazSpinner-CORsBFCP.mjs → MazSpinner-BVaJBGw5.mjs} +1 -1
- package/components/chunks/{MazSpinner-CVBVegaS.mjs → MazSpinner-BVflp3wp.mjs} +1 -1
- package/components/chunks/MazSpinner-BmqyUsTZ.mjs +38 -0
- package/components/chunks/{MazSpinner-XMLkiLTL.mjs → MazSpinner-Btk7fYzq.mjs} +1 -1
- package/components/chunks/{MazSpinner-BtFWH26r.mjs → MazSpinner-CAQqdZfW.mjs} +1 -1
- package/components/chunks/MazSpinner-COqX5baD.mjs +38 -0
- package/components/chunks/{MazSpinner-Bky73siD.mjs → MazSpinner-CV3h3CKR.mjs} +1 -1
- package/components/chunks/MazSpinner-Cm5GeVV-.mjs +38 -0
- package/components/chunks/{MazSpinner-CkHAaRhk.mjs → MazSpinner-D9uDPRkX.mjs} +1 -1
- package/components/chunks/MazSpinner-DO1id61e.mjs +38 -0
- package/components/chunks/MazSpinner-K26cuR_A.mjs +38 -0
- package/components/chunks/MazSpinner-LCpiZGMP.mjs +38 -0
- package/components/chunks/MazTable-vcm_SC7e.mjs +1846 -0
- package/components/chunks/{MazTransitionExpand-BWsQP7UF.mjs → MazTransitionExpand-DXKtquVe.mjs} +1 -1
- package/css/main.css +1 -1
- package/modules/assets/MazBtn.css +1 -1
- package/modules/chunks/{MazBtn-BxYYeNGe.mjs → MazBtn-CNsgLyRm.mjs} +8 -8
- package/modules/chunks/{MazBtn-CHUwa3fu.cjs → MazBtn-DmXrGuUE.cjs} +2 -2
- package/modules/chunks/{MazIcon-CnOCvJTw.mjs → MazIcon-DwRWkhhR.mjs} +1 -1
- package/modules/chunks/{MazIcon-DcbutTbM.cjs → MazIcon-rh9PwwaQ.cjs} +1 -1
- package/modules/chunks/{MazSpinner-TL9_4BOs.cjs → MazSpinner-BzucVZXm.cjs} +1 -1
- package/modules/chunks/{MazSpinner-ClFhZyF_.mjs → MazSpinner-mCJd14Kq.mjs} +1 -1
- package/modules/chunks/{index-DksGhf51.cjs → index-DHsybBwE.cjs} +1 -1
- package/modules/chunks/{index-_xAQ9uTd.mjs → index-DrSSNP9y.mjs} +2 -2
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +5 -5
- package/package.json +6 -6
- package/types/components/MazBtn.vue.d.ts +2 -2
- package/types/components/MazCard.vue.d.ts +2 -0
- package/types/components/MazInputTags.vue.d.ts +4 -4
- package/types/components/MazPhoneNumberInput/CountrySelector.vue.d.ts +8 -4
- package/types/components/MazPhoneNumberInput/use-maz-phone-number-input.d.ts +2 -2
- package/types/components/MazPhoneNumberInput.vue.d.ts +21 -8
- package/types/components/MazRadio.vue.d.ts +89 -92
- package/types/components/MazRadioButtons.vue.d.ts +84 -62
- package/types/components/MazSelect.vue.d.ts +12 -7
- package/types/components/MazSwitch.vue.d.ts +61 -67
- package/types/components/MazTextarea.vue.d.ts +23 -8
- package/components/chunks/MazBtn-Cpnby6Lb.mjs +0 -151
- package/components/chunks/MazBtn-D5q0p_mK.mjs +0 -151
- package/components/chunks/MazBtn-Koayc6g_.mjs +0 -151
- package/components/chunks/MazPhoneNumberInput-BDiyO_6j.mjs +0 -1423
- package/components/chunks/MazSelect-Cr1xT89o.mjs +0 -767
- package/components/chunks/MazSpinner-CdKm_Lcp.mjs +0 -38
- package/components/chunks/MazSpinner-CkdjTE0y.mjs +0 -38
- package/components/chunks/MazSpinner-CtMh7fIX.mjs +0 -38
- package/components/chunks/MazSpinner-DECa8Pby.mjs +0 -38
- package/components/chunks/MazSpinner-DMBy6mx3.mjs +0 -38
- package/components/chunks/MazSpinner-DPmNDRtT.mjs +0 -38
- package/components/chunks/MazSpinner-Dq4o-_GM.mjs +0 -38
- package/components/chunks/MazSpinner-DyE_USVF.mjs +0 -38
- package/components/chunks/MazTable-CIlP0a61.mjs +0 -1882
|
@@ -0,0 +1,731 @@
|
|
|
1
|
+
import '../assets/MazSelect.css';
|
|
2
|
+
import { getCurrentInstance as Se, computed as r, defineComponent as he, defineAsyncComponent as C, ref as w, onMounted as Ae, useSlots as Le, openBlock as f, createElementBlock as I, normalizeClass as E, normalizeStyle as Y, createElementVNode as D, createCommentVNode as m, renderSlot as H, createBlock as $, unref as z, resolveDynamicComponent as me, withDirectives as Me, mergeProps as ge, toHandlers as De, vModelDynamic as Te, createTextVNode as Ne, toDisplayString as re, withModifiers as W, withCtx as x, createVNode as F, useCssVars as Pe, onBeforeMount as Fe, nextTick as se, Transition as Ee, Fragment as ve, renderList as He } from "vue";
|
|
3
|
+
function Oe(s, u) {
|
|
4
|
+
let i;
|
|
5
|
+
return function(...v) {
|
|
6
|
+
clearTimeout(i), i = setTimeout(() => {
|
|
7
|
+
s.apply(this, v);
|
|
8
|
+
}, u);
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
const ze = ({
|
|
12
|
+
componentName: s,
|
|
13
|
+
providedId: u
|
|
14
|
+
}) => {
|
|
15
|
+
const i = Se();
|
|
16
|
+
return r(() => u ?? `${s}-${i == null ? void 0 : i.uid}`);
|
|
17
|
+
}, qe = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "m-input-wrapper-left"
|
|
20
|
+
}, Ue = { class: "m-input-wrapper-input" }, Re = ["id", "type", "name", "inputmode", "placeholder", "aria-label", "disabled", "readonly", "required"], We = { key: 0 }, Qe = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "m-input-wrapper-right"
|
|
23
|
+
}, je = /* @__PURE__ */ he({
|
|
24
|
+
inheritAttrs: !1,
|
|
25
|
+
__name: "MazInput",
|
|
26
|
+
props: {
|
|
27
|
+
style: { default: void 0 },
|
|
28
|
+
class: { default: void 0 },
|
|
29
|
+
modelValue: { type: [String, Number, null, Boolean], default: void 0 },
|
|
30
|
+
placeholder: { default: void 0 },
|
|
31
|
+
label: { default: void 0 },
|
|
32
|
+
name: { default: void 0 },
|
|
33
|
+
color: { default: "primary" },
|
|
34
|
+
type: { default: "text" },
|
|
35
|
+
required: { type: Boolean, default: !1 },
|
|
36
|
+
disabled: { type: Boolean, default: !1 },
|
|
37
|
+
readonly: { type: Boolean, default: !1 },
|
|
38
|
+
id: { default: void 0 },
|
|
39
|
+
error: { type: Boolean, default: !1 },
|
|
40
|
+
success: { type: Boolean, default: !1 },
|
|
41
|
+
warning: { type: Boolean, default: !1 },
|
|
42
|
+
hint: { default: void 0 },
|
|
43
|
+
inputClasses: { default: void 0 },
|
|
44
|
+
noBorder: { type: Boolean, default: !1 },
|
|
45
|
+
noRadius: { type: Boolean, default: !1 },
|
|
46
|
+
inputmode: { default: "text" },
|
|
47
|
+
size: { default: "md" },
|
|
48
|
+
debounce: { type: [Boolean, Number], default: !1 },
|
|
49
|
+
debounceDelay: { default: 500 },
|
|
50
|
+
validButton: { type: Boolean, default: !1 },
|
|
51
|
+
validButtonLoading: { type: Boolean, default: !1 },
|
|
52
|
+
autoFocus: { type: Boolean, default: !1 },
|
|
53
|
+
borderActive: { type: Boolean, default: !1 },
|
|
54
|
+
leftIcon: { default: void 0 },
|
|
55
|
+
rightIcon: { default: void 0 },
|
|
56
|
+
roundedSize: { default: void 0 },
|
|
57
|
+
block: { type: Boolean }
|
|
58
|
+
},
|
|
59
|
+
emits: ["update:model-value", "focus", "blur", "click", "change"],
|
|
60
|
+
setup(s, { emit: u }) {
|
|
61
|
+
const i = C(() => import("./MazBtn-BQZOiUux.mjs")), v = C(() => import("./MazIcon-Cxrv3_OK.mjs")), b = C(() => import("./eye-slash-tjfxO0LK.mjs")), d = C(() => import("./eye-DqO_Jx56.mjs")), g = C(() => import("./check-7UA4j2f2.mjs")), o = s, V = u, k = w(!1), c = w(!1), T = w(), _ = ze({
|
|
62
|
+
componentName: "MazInput",
|
|
63
|
+
providedId: o.id
|
|
64
|
+
});
|
|
65
|
+
Ae(() => {
|
|
66
|
+
var t;
|
|
67
|
+
o.autoFocus && ((t = T.value) == null || t.focus());
|
|
68
|
+
});
|
|
69
|
+
const Q = r(() => o.type === "password"), ee = r(() => k.value ? "text" : o.type), K = r(() => {
|
|
70
|
+
if (!o.noBorder) {
|
|
71
|
+
if (o.error)
|
|
72
|
+
return "maz-border-danger";
|
|
73
|
+
if (o.success)
|
|
74
|
+
return "maz-border-success";
|
|
75
|
+
if (o.warning)
|
|
76
|
+
return "maz-border-warning";
|
|
77
|
+
if (c.value || o.borderActive) {
|
|
78
|
+
if (o.color === "black")
|
|
79
|
+
return "maz-border-black";
|
|
80
|
+
if (o.color === "danger")
|
|
81
|
+
return "maz-border-danger";
|
|
82
|
+
if (o.color === "info")
|
|
83
|
+
return "maz-border-info";
|
|
84
|
+
if (o.color === "primary")
|
|
85
|
+
return "maz-border-primary";
|
|
86
|
+
if (o.color === "secondary")
|
|
87
|
+
return "maz-border-secondary";
|
|
88
|
+
if (o.color === "success")
|
|
89
|
+
return "maz-border-success";
|
|
90
|
+
if (o.color === "warning")
|
|
91
|
+
return "maz-border-warning";
|
|
92
|
+
if (o.color === "white")
|
|
93
|
+
return "maz-border-white";
|
|
94
|
+
}
|
|
95
|
+
return "--default-border";
|
|
96
|
+
}
|
|
97
|
+
}), O = Le(), j = r(() => {
|
|
98
|
+
const { required: t, placeholder: y } = o;
|
|
99
|
+
if (y)
|
|
100
|
+
return t ? `${y} *` : y;
|
|
101
|
+
}), G = r(() => S.value !== void 0 && S.value !== ""), L = Oe(
|
|
102
|
+
(t) => {
|
|
103
|
+
S.value = t;
|
|
104
|
+
},
|
|
105
|
+
typeof o.debounce == "number" ? o.debounce : o.debounceDelay ?? 500
|
|
106
|
+
), S = r({
|
|
107
|
+
get: () => o.modelValue,
|
|
108
|
+
set: (t) => {
|
|
109
|
+
if (o.debounce)
|
|
110
|
+
return L(t);
|
|
111
|
+
V("update:model-value", t);
|
|
112
|
+
}
|
|
113
|
+
}), Z = r(() => (!!o.label || !!o.hint) && (c.value || !!G.value || !!o.placeholder || ["date", "month", "week"].includes(o.type))), J = r(() => !!o.label || !!o.hint);
|
|
114
|
+
function X() {
|
|
115
|
+
return !!O["right-icon"] || Q.value || !!O["valid-button"] || o.validButton || !!o.rightIcon;
|
|
116
|
+
}
|
|
117
|
+
function A() {
|
|
118
|
+
return !!O["left-icon"] || !!o.leftIcon;
|
|
119
|
+
}
|
|
120
|
+
function U(t) {
|
|
121
|
+
V("focus", t), c.value = !0;
|
|
122
|
+
}
|
|
123
|
+
function oe(t) {
|
|
124
|
+
V("blur", t), c.value = !1;
|
|
125
|
+
}
|
|
126
|
+
function te(t) {
|
|
127
|
+
return V("change", t);
|
|
128
|
+
}
|
|
129
|
+
return (t, y) => (f(), I(
|
|
130
|
+
"div",
|
|
131
|
+
{
|
|
132
|
+
class: E(["m-input", [
|
|
133
|
+
{
|
|
134
|
+
"--is-focused": c.value || t.borderActive,
|
|
135
|
+
"--should-up": Z.value,
|
|
136
|
+
"--has-label": J.value,
|
|
137
|
+
"--is-disabled": t.disabled,
|
|
138
|
+
"--is-readonly": t.readonly,
|
|
139
|
+
"--has-z-2": t.error || t.warning || t.success,
|
|
140
|
+
"--has-state": t.error || t.warning || t.success,
|
|
141
|
+
"--block": t.block
|
|
142
|
+
},
|
|
143
|
+
o.class,
|
|
144
|
+
`--${t.color}`,
|
|
145
|
+
`--${t.size}`
|
|
146
|
+
]]),
|
|
147
|
+
style: Y(t.style)
|
|
148
|
+
},
|
|
149
|
+
[
|
|
150
|
+
D(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
class: E(["m-input-wrapper", [
|
|
154
|
+
t.inputClasses,
|
|
155
|
+
K.value,
|
|
156
|
+
t.roundedSize ? `--rounded-${t.roundedSize}` : { "maz-rounded": !t.noRadius }
|
|
157
|
+
]])
|
|
158
|
+
},
|
|
159
|
+
[
|
|
160
|
+
A() ? (f(), I("div", qe, [
|
|
161
|
+
m(`
|
|
162
|
+
@slot left-icon - The icon to display on the left of the input
|
|
163
|
+
`),
|
|
164
|
+
t.$slots["left-icon"] || t.leftIcon ? H(t.$slots, "left-icon", { key: 0 }, () => [
|
|
165
|
+
typeof t.leftIcon == "string" ? (f(), $(z(v), {
|
|
166
|
+
key: 0,
|
|
167
|
+
name: t.leftIcon,
|
|
168
|
+
class: "maz-text-xl maz-text-muted"
|
|
169
|
+
}, null, 8, ["name"])) : t.leftIcon ? (f(), $(me(t.leftIcon), {
|
|
170
|
+
key: 1,
|
|
171
|
+
class: "maz-text-xl maz-text-muted"
|
|
172
|
+
})) : m("v-if", !0)
|
|
173
|
+
], !0) : m("v-if", !0)
|
|
174
|
+
])) : m("v-if", !0),
|
|
175
|
+
D("div", Ue, [
|
|
176
|
+
Me(D("input", ge({
|
|
177
|
+
id: z(_),
|
|
178
|
+
ref_key: "input",
|
|
179
|
+
ref: T,
|
|
180
|
+
"onUpdate:modelValue": y[0] || (y[0] = (M) => S.value = M),
|
|
181
|
+
type: ee.value,
|
|
182
|
+
name: t.name
|
|
183
|
+
}, t.$attrs, {
|
|
184
|
+
inputmode: t.inputmode,
|
|
185
|
+
placeholder: j.value,
|
|
186
|
+
"aria-label": t.label || t.placeholder,
|
|
187
|
+
disabled: t.disabled,
|
|
188
|
+
readonly: t.readonly,
|
|
189
|
+
required: t.required,
|
|
190
|
+
class: "m-input-input"
|
|
191
|
+
}, De({
|
|
192
|
+
blur: oe,
|
|
193
|
+
focus: U,
|
|
194
|
+
change: te
|
|
195
|
+
}, !0), {
|
|
196
|
+
onClick: y[1] || (y[1] = (M) => t.$emit("click", M))
|
|
197
|
+
}), null, 16, Re), [
|
|
198
|
+
[Te, S.value]
|
|
199
|
+
]),
|
|
200
|
+
t.label || t.hint ? (f(), I(
|
|
201
|
+
"span",
|
|
202
|
+
{
|
|
203
|
+
key: 0,
|
|
204
|
+
ref: "label",
|
|
205
|
+
class: E(["m-input-label", [
|
|
206
|
+
{
|
|
207
|
+
"maz-text-danger-600": t.error,
|
|
208
|
+
"maz-text-success-600": t.success,
|
|
209
|
+
"maz-text-warning-600": t.warning
|
|
210
|
+
}
|
|
211
|
+
]])
|
|
212
|
+
},
|
|
213
|
+
[
|
|
214
|
+
Ne(
|
|
215
|
+
re(t.hint || t.label) + " ",
|
|
216
|
+
1
|
|
217
|
+
/* TEXT */
|
|
218
|
+
),
|
|
219
|
+
t.required ? (f(), I("sup", We, "*")) : m("v-if", !0)
|
|
220
|
+
],
|
|
221
|
+
2
|
|
222
|
+
/* CLASS */
|
|
223
|
+
)) : m("v-if", !0)
|
|
224
|
+
]),
|
|
225
|
+
X() ? (f(), I("div", Qe, [
|
|
226
|
+
m(`
|
|
227
|
+
@slot right-icon - The icon to display on the right of the input
|
|
228
|
+
`),
|
|
229
|
+
t.$slots["right-icon"] || t.rightIcon ? H(t.$slots, "right-icon", { key: 0 }, () => [
|
|
230
|
+
typeof t.rightIcon == "string" ? (f(), $(z(v), {
|
|
231
|
+
key: 0,
|
|
232
|
+
name: t.rightIcon,
|
|
233
|
+
class: "maz-text-xl maz-text-muted"
|
|
234
|
+
}, null, 8, ["name"])) : t.rightIcon ? (f(), $(me(t.rightIcon), {
|
|
235
|
+
key: 1,
|
|
236
|
+
class: "maz-text-xl maz-text-muted"
|
|
237
|
+
})) : m("v-if", !0)
|
|
238
|
+
], !0) : m("v-if", !0),
|
|
239
|
+
Q.value ? (f(), $(z(i), {
|
|
240
|
+
key: 1,
|
|
241
|
+
color: "transparent",
|
|
242
|
+
tabindex: "-1",
|
|
243
|
+
size: "mini",
|
|
244
|
+
onClick: y[2] || (y[2] = W((M) => k.value = !k.value, ["stop"]))
|
|
245
|
+
}, {
|
|
246
|
+
default: x(() => [
|
|
247
|
+
k.value ? (f(), $(z(b), {
|
|
248
|
+
key: 0,
|
|
249
|
+
class: "maz-text-xl maz-text-muted"
|
|
250
|
+
})) : (f(), $(z(d), {
|
|
251
|
+
key: 1,
|
|
252
|
+
class: "maz-text-xl maz-text-muted"
|
|
253
|
+
}))
|
|
254
|
+
]),
|
|
255
|
+
_: 1
|
|
256
|
+
/* STABLE */
|
|
257
|
+
})) : m("v-if", !0),
|
|
258
|
+
m(`
|
|
259
|
+
@slot valid-button - Replace the valid button by your own
|
|
260
|
+
`),
|
|
261
|
+
t.$slots["valid-button"] || t.validButton ? H(t.$slots, "valid-button", { key: 2 }, () => [
|
|
262
|
+
F(z(i), {
|
|
263
|
+
color: "transparent",
|
|
264
|
+
disabled: t.disabled,
|
|
265
|
+
tabindex: "-1",
|
|
266
|
+
loading: t.validButtonLoading,
|
|
267
|
+
class: "m-input-valid-button",
|
|
268
|
+
size: "mini",
|
|
269
|
+
type: "submit"
|
|
270
|
+
}, {
|
|
271
|
+
default: x(() => [
|
|
272
|
+
F(z(g), { class: "maz-text-2xl maz-text-normal" })
|
|
273
|
+
]),
|
|
274
|
+
_: 1
|
|
275
|
+
/* STABLE */
|
|
276
|
+
}, 8, ["disabled", "loading"])
|
|
277
|
+
], !0) : m("v-if", !0)
|
|
278
|
+
])) : m("v-if", !0)
|
|
279
|
+
],
|
|
280
|
+
2
|
|
281
|
+
/* CLASS */
|
|
282
|
+
)
|
|
283
|
+
],
|
|
284
|
+
6
|
|
285
|
+
/* CLASS, STYLE */
|
|
286
|
+
));
|
|
287
|
+
}
|
|
288
|
+
}), Ve = (s, u) => {
|
|
289
|
+
const i = s.__vccOpts || s;
|
|
290
|
+
for (const [v, b] of u)
|
|
291
|
+
i[v] = b;
|
|
292
|
+
return i;
|
|
293
|
+
}, ye = /* @__PURE__ */ Ve(je, [["__scopeId", "data-v-78090be8"]]);
|
|
294
|
+
let ie = null;
|
|
295
|
+
function Ge(s, u) {
|
|
296
|
+
ie && clearTimeout(ie), ie = setTimeout(s, u);
|
|
297
|
+
}
|
|
298
|
+
function Ze(s, u) {
|
|
299
|
+
const i = s.length, v = u.length, b = [];
|
|
300
|
+
for (let d = 0; d <= i; d++)
|
|
301
|
+
b[d] = [d];
|
|
302
|
+
for (let d = 0; d <= v; d++)
|
|
303
|
+
b[0][d] = d;
|
|
304
|
+
for (let d = 1; d <= i; d++)
|
|
305
|
+
for (let g = 1; g <= v; g++) {
|
|
306
|
+
const o = s[d - 1] === u[g - 1] ? 0 : 1;
|
|
307
|
+
b[d][g] = Math.min(
|
|
308
|
+
b[d - 1][g] + 1,
|
|
309
|
+
b[d][g - 1] + 1,
|
|
310
|
+
b[d - 1][g - 1] + o
|
|
311
|
+
);
|
|
312
|
+
}
|
|
313
|
+
return b[i][v];
|
|
314
|
+
}
|
|
315
|
+
function be(s) {
|
|
316
|
+
return s.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").toLowerCase();
|
|
317
|
+
}
|
|
318
|
+
function ke(s, u) {
|
|
319
|
+
const i = Ze(s, u), v = Math.max(s.length, u.length);
|
|
320
|
+
return 1 - i / v;
|
|
321
|
+
}
|
|
322
|
+
function Je(s, u, i = 0.75) {
|
|
323
|
+
return ke(s, u) >= i;
|
|
324
|
+
}
|
|
325
|
+
function ue(s, u, i = 0.75) {
|
|
326
|
+
const v = r(
|
|
327
|
+
() => be(typeof s == "string" ? s : s.value)
|
|
328
|
+
), b = r(
|
|
329
|
+
() => be(typeof u == "string" ? u : u.value)
|
|
330
|
+
), d = r(() => typeof i == "number" ? i : i.value), g = r(() => ke(v.value, b.value));
|
|
331
|
+
return {
|
|
332
|
+
isMatching: r(
|
|
333
|
+
() => Je(v.value, b.value, d.value)
|
|
334
|
+
),
|
|
335
|
+
score: g
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
const Xe = ["aria-label"], Ye = { class: "m-select-list__no-results" }, xe = {
|
|
339
|
+
key: 2,
|
|
340
|
+
class: "m-select-list__scroll-wrapper",
|
|
341
|
+
tabindex: "-1"
|
|
342
|
+
}, _e = { class: "m-select-list-optgroup" }, eo = ["onClick"], oo = /* @__PURE__ */ he({
|
|
343
|
+
inheritAttrs: !1,
|
|
344
|
+
__name: "MazSelect",
|
|
345
|
+
props: {
|
|
346
|
+
style: { default: void 0 },
|
|
347
|
+
class: { default: void 0 },
|
|
348
|
+
id: { default: void 0 },
|
|
349
|
+
modelValue: { type: [String, Number, null, Boolean, Array], default: void 0 },
|
|
350
|
+
options: { default: void 0 },
|
|
351
|
+
optionValueKey: { default: "value" },
|
|
352
|
+
optionLabelKey: { default: "label" },
|
|
353
|
+
optionInputValueKey: { default: "label" },
|
|
354
|
+
listPosition: { default: "bottom left" },
|
|
355
|
+
itemHeight: { default: void 0 },
|
|
356
|
+
maxListHeight: { default: 240 },
|
|
357
|
+
maxListWidth: { default: void 0 },
|
|
358
|
+
size: { default: "md" },
|
|
359
|
+
color: { default: "primary" },
|
|
360
|
+
search: { type: Boolean },
|
|
361
|
+
searchPlaceholder: { default: "Search in options" },
|
|
362
|
+
open: { type: Boolean },
|
|
363
|
+
multiple: { type: Boolean },
|
|
364
|
+
required: { type: Boolean },
|
|
365
|
+
disabled: { type: Boolean },
|
|
366
|
+
block: { type: Boolean }
|
|
367
|
+
},
|
|
368
|
+
emits: ["close", "open", "blur", "focus", "change", "update:model-value", "selected-option"],
|
|
369
|
+
setup(s, { expose: u, emit: i }) {
|
|
370
|
+
Pe((e) => ({
|
|
371
|
+
b5e9a382: ee.value,
|
|
372
|
+
"98e2c384": _.value,
|
|
373
|
+
"4f69e826": Q.value
|
|
374
|
+
}));
|
|
375
|
+
const v = C(() => import("./MazCheckbox-BE7eLIkK.mjs")), b = C(() => import("./magnifying-glass-DZGg7953.mjs")), d = C(() => import("./chevron-down-CzMH-gFW.mjs")), g = C(() => import("./no-symbol-QAqP9IlR.mjs"));
|
|
376
|
+
u({
|
|
377
|
+
openList: N,
|
|
378
|
+
closeList: R
|
|
379
|
+
});
|
|
380
|
+
const o = s, V = i, k = w(!1), c = w(), T = r(
|
|
381
|
+
() => ["black", "transparent", "white"].includes(o.color)
|
|
382
|
+
), _ = r(
|
|
383
|
+
() => T.value ? "var(--maz-color-black)" : `var(--maz-color-${o.color}-800)`
|
|
384
|
+
), Q = r(
|
|
385
|
+
() => T.value ? "var(--maz-color-muted)" : `var(--maz-color-${o.color}-100)`
|
|
386
|
+
), ee = r(
|
|
387
|
+
() => T.value ? "var(--maz-color-muted)" : `var(--maz-color-${o.color}-200)`
|
|
388
|
+
), K = r(() => k.value || o.open), O = ze({
|
|
389
|
+
componentName: "MazSelect",
|
|
390
|
+
providedId: o.id
|
|
391
|
+
});
|
|
392
|
+
function j(e) {
|
|
393
|
+
return {
|
|
394
|
+
[o.optionValueKey]: e,
|
|
395
|
+
[o.optionLabelKey]: e,
|
|
396
|
+
[o.optionInputValueKey]: e
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
function G(e) {
|
|
400
|
+
return {
|
|
401
|
+
...e,
|
|
402
|
+
[o.optionValueKey]: e[o.optionValueKey],
|
|
403
|
+
[o.optionLabelKey]: e[o.optionLabelKey],
|
|
404
|
+
[o.optionInputValueKey]: e[o.optionInputValueKey]
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
const L = r(() => {
|
|
408
|
+
var l;
|
|
409
|
+
const e = [];
|
|
410
|
+
if (!((l = o.options) != null && l.length))
|
|
411
|
+
return [];
|
|
412
|
+
for (const a of o.options)
|
|
413
|
+
typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? e.push(j(a)) : "options" in a && Array.isArray(a.options) ? e.push(
|
|
414
|
+
{ label: a.label, isOptGroup: !0 },
|
|
415
|
+
...a.options.map(
|
|
416
|
+
(n) => typeof n == "string" || typeof n == "number" || typeof n == "boolean" ? j(n) : G(n)
|
|
417
|
+
)
|
|
418
|
+
) : e.push(G(a));
|
|
419
|
+
return e;
|
|
420
|
+
}), q = r(
|
|
421
|
+
() => {
|
|
422
|
+
var e;
|
|
423
|
+
return ((e = L.value) == null ? void 0 : e.filter((l) => o.multiple ? Array.isArray(o.modelValue) ? o.modelValue.includes(l[o.optionValueKey]) && !A(l[o.optionValueKey]) : !1 : o.modelValue === l[o.optionValueKey] && !A(l[o.optionValueKey]))) ?? [];
|
|
424
|
+
}
|
|
425
|
+
);
|
|
426
|
+
Fe(() => {
|
|
427
|
+
var e;
|
|
428
|
+
(e = o.options) != null && e.length || console.warn("[maz-ui](MazSelect) you must provide options"), ne();
|
|
429
|
+
});
|
|
430
|
+
const S = w(), Z = w(), J = w(), X = w(), A = (e) => e == null;
|
|
431
|
+
function U(e) {
|
|
432
|
+
var a;
|
|
433
|
+
return (((a = q.value) == null ? void 0 : a.some(
|
|
434
|
+
(n) => n[o.optionValueKey] === e[o.optionValueKey]
|
|
435
|
+
)) ?? !1) && !A(e[o.optionValueKey]);
|
|
436
|
+
}
|
|
437
|
+
const oe = r(() => {
|
|
438
|
+
var l;
|
|
439
|
+
if (o.multiple && o.modelValue && Array.isArray(o.modelValue))
|
|
440
|
+
return o.modelValue.map(
|
|
441
|
+
(a) => {
|
|
442
|
+
var n, p;
|
|
443
|
+
return (p = (n = L.value) == null ? void 0 : n.find((h) => h[o.optionValueKey] === a)) == null ? void 0 : p[o.optionInputValueKey];
|
|
444
|
+
}
|
|
445
|
+
).join(", ");
|
|
446
|
+
const e = (l = L.value) == null ? void 0 : l.find(
|
|
447
|
+
(a) => a[o.optionValueKey] === o.modelValue
|
|
448
|
+
);
|
|
449
|
+
return A(o.modelValue) || e == null ? void 0 : e[o.optionInputValueKey];
|
|
450
|
+
}), te = r(
|
|
451
|
+
() => o.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
|
|
452
|
+
), t = w(""), y = w("");
|
|
453
|
+
function M(e) {
|
|
454
|
+
return e.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[^\dA-Za-z\u0400-\u04FF]/g, "");
|
|
455
|
+
}
|
|
456
|
+
const le = (e, l) => l && e && M(e.toString().toLocaleLowerCase().trim()).includes(
|
|
457
|
+
M(l.toLocaleLowerCase().trim())
|
|
458
|
+
);
|
|
459
|
+
function de(e) {
|
|
460
|
+
var l;
|
|
461
|
+
return e ? (l = L.value) == null ? void 0 : l.filter((a) => {
|
|
462
|
+
const n = a[o.optionLabelKey], p = a[o.optionValueKey], h = a[o.optionInputValueKey];
|
|
463
|
+
return le(n, e) || le(h, e) || le(p, e) || typeof n == "string" && ue(n, e).isMatching.value || typeof h == "string" && ue(h, e).isMatching.value || typeof p == "string" && ue(p, e).isMatching.value;
|
|
464
|
+
}) : L.value;
|
|
465
|
+
}
|
|
466
|
+
const B = r(() => de(t.value));
|
|
467
|
+
async function R(e) {
|
|
468
|
+
var l;
|
|
469
|
+
if (K.value) {
|
|
470
|
+
if (e && ("relatedTarget" in e && ((l = S.value) != null && l.contains(e.relatedTarget)) || e.type === "keydown"))
|
|
471
|
+
return e.preventDefault();
|
|
472
|
+
await se(), k.value = !1, c.value = 0, V("close", e);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
async function N(e) {
|
|
476
|
+
o.disabled || K.value || (e == null || e.preventDefault(), k.value = !0, await ae(), V("focus", e), V("open", k.value));
|
|
477
|
+
}
|
|
478
|
+
function ce() {
|
|
479
|
+
var e, l;
|
|
480
|
+
(l = ((e = Z.value) == null ? void 0 : e.$el).querySelector("input")) == null || l.focus();
|
|
481
|
+
}
|
|
482
|
+
function we(e) {
|
|
483
|
+
k.value ? R(e) : ce();
|
|
484
|
+
}
|
|
485
|
+
function Ie(e) {
|
|
486
|
+
var l, a;
|
|
487
|
+
t.value = e, (a = ((l = J.value) == null ? void 0 : l.$el).querySelector("input")) == null || a.focus();
|
|
488
|
+
}
|
|
489
|
+
function Ke(e) {
|
|
490
|
+
var a;
|
|
491
|
+
e === "Backspace" && y.value.length > 0 ? y.value = y.value.slice(0, -1) : y.value += e;
|
|
492
|
+
const l = de(y.value);
|
|
493
|
+
l != null && l.length && (c.value = (a = B.value) == null ? void 0 : a.findIndex(
|
|
494
|
+
(n) => n[o.optionValueKey] === l[0][o.optionValueKey]
|
|
495
|
+
), typeof c.value == "number" && c.value >= 0 && ae(c.value)), Ge(() => {
|
|
496
|
+
y.value = "";
|
|
497
|
+
}, 1e3);
|
|
498
|
+
}
|
|
499
|
+
const Be = (e) => {
|
|
500
|
+
const l = e.key;
|
|
501
|
+
/^[\dA-Za-z\u0400-\u04FF]$/.test(l) ? (e.preventDefault(), N(e), o.search ? Ie(l) : Ke(l)) : pe(e);
|
|
502
|
+
}, pe = (e) => {
|
|
503
|
+
const l = e.code, a = ["ArrowUp", "ArrowDown"].includes(l), n = ["Enter", "Space"].includes(l), p = l === "Escape" && K.value;
|
|
504
|
+
a ? $e(e, c.value) : n ? Ce(e, c.value) : p && R();
|
|
505
|
+
}, $e = (e, l) => {
|
|
506
|
+
var p;
|
|
507
|
+
e.preventDefault();
|
|
508
|
+
const a = e.code;
|
|
509
|
+
K.value || N(e);
|
|
510
|
+
const n = (p = B.value) == null ? void 0 : p.length;
|
|
511
|
+
n && (typeof l == "number" ? l === n - 1 && a === "ArrowDown" ? c.value = 0 : l === 0 && a === "ArrowUp" ? c.value = n - 1 : c.value = a === "ArrowDown" ? l + 1 : l - 1 : c.value = a === "ArrowDown" ? 0 : n - 1, ae(c.value));
|
|
512
|
+
}, Ce = (e, l) => {
|
|
513
|
+
var n, p, h;
|
|
514
|
+
if (e.preventDefault(), !K.value)
|
|
515
|
+
return N(e);
|
|
516
|
+
const a = l ? ((n = B.value) == null ? void 0 : n[l]) ?? ((p = B.value) == null ? void 0 : p[0]) : (h = B.value) == null ? void 0 : h[0];
|
|
517
|
+
A(a) || fe(a);
|
|
518
|
+
};
|
|
519
|
+
async function ae(e) {
|
|
520
|
+
var a, n;
|
|
521
|
+
await se(), typeof e != "number" && ne();
|
|
522
|
+
const l = e ?? c.value;
|
|
523
|
+
typeof l == "number" && l >= 0 && ((n = (a = X.value) == null ? void 0 : a.querySelectorAll(".m-select-list-item")[l]) == null || n.scrollIntoView({
|
|
524
|
+
behavior: "auto",
|
|
525
|
+
block: "nearest",
|
|
526
|
+
inline: "start"
|
|
527
|
+
}));
|
|
528
|
+
}
|
|
529
|
+
function ne(e) {
|
|
530
|
+
var a;
|
|
531
|
+
const l = (a = B.value) == null ? void 0 : a.findIndex((n) => {
|
|
532
|
+
var p, h;
|
|
533
|
+
return o.multiple && Array.isArray(o.modelValue) ? e ? e[o.optionValueKey] === n[o.optionValueKey] : [...o.modelValue].reverse()[0] === n[o.optionValueKey] : ((h = (p = q.value) == null ? void 0 : p[0]) == null ? void 0 : h[o.optionValueKey]) === n[o.optionValueKey];
|
|
534
|
+
});
|
|
535
|
+
c.value = l && l >= 0 ? l : 0;
|
|
536
|
+
}
|
|
537
|
+
const fe = (e, l = !0) => {
|
|
538
|
+
var h;
|
|
539
|
+
l && !o.multiple && se(() => R()), t.value = "";
|
|
540
|
+
const a = (h = q.value) == null ? void 0 : h.some(
|
|
541
|
+
(P) => P[o.optionValueKey] === e[o.optionValueKey]
|
|
542
|
+
);
|
|
543
|
+
let n = q.value;
|
|
544
|
+
a && o.multiple ? n = n == null ? void 0 : n.filter(
|
|
545
|
+
(P) => P[o.optionValueKey] !== e[o.optionValueKey]
|
|
546
|
+
) : o.multiple ? n.push(e) : n = [e];
|
|
547
|
+
const p = n.map((P) => P[o.optionValueKey]);
|
|
548
|
+
V("update:model-value", o.multiple ? p : p[0]), V("selected-option", e), ne(e), ce();
|
|
549
|
+
};
|
|
550
|
+
return (e, l) => (f(), I(
|
|
551
|
+
"div",
|
|
552
|
+
{
|
|
553
|
+
ref_key: "mazSelectElement",
|
|
554
|
+
ref: S,
|
|
555
|
+
class: E(["m-select", [
|
|
556
|
+
{ "--is-open": K.value, "--disabled": e.disabled, "--block": e.block },
|
|
557
|
+
o.class,
|
|
558
|
+
`--${e.size}`
|
|
559
|
+
]]),
|
|
560
|
+
style: Y(e.style),
|
|
561
|
+
onBlurCapture: R
|
|
562
|
+
},
|
|
563
|
+
[
|
|
564
|
+
F(ye, ge({
|
|
565
|
+
id: z(O),
|
|
566
|
+
ref_key: "mazInputComponent",
|
|
567
|
+
ref: Z,
|
|
568
|
+
class: "m-select-input"
|
|
569
|
+
}, e.$attrs, {
|
|
570
|
+
required: e.required,
|
|
571
|
+
"border-active": k.value,
|
|
572
|
+
color: e.color,
|
|
573
|
+
"model-value": oe.value,
|
|
574
|
+
autocomplete: "off",
|
|
575
|
+
size: e.size,
|
|
576
|
+
block: "",
|
|
577
|
+
disabled: e.disabled,
|
|
578
|
+
onFocus: W(N, ["prevent", "stop"]),
|
|
579
|
+
onClick: W(N, ["prevent", "stop"]),
|
|
580
|
+
onChange: l[0] || (l[0] = (a) => V("change", a)),
|
|
581
|
+
onKeydown: Be
|
|
582
|
+
}), {
|
|
583
|
+
"right-icon": x(() => [
|
|
584
|
+
D("button", {
|
|
585
|
+
tabindex: "-1",
|
|
586
|
+
type: "button",
|
|
587
|
+
class: "m-select-input__toggle-button maz-custom",
|
|
588
|
+
"aria-label": `${K.value ? "collapse" : "expand"} list of options`,
|
|
589
|
+
onClick: W(we, ["stop"])
|
|
590
|
+
}, [
|
|
591
|
+
F(z(d), { class: "m-select-chevron maz-text-xl" })
|
|
592
|
+
], 8, Xe)
|
|
593
|
+
]),
|
|
594
|
+
_: 1
|
|
595
|
+
/* STABLE */
|
|
596
|
+
}, 16, ["id", "required", "border-active", "color", "model-value", "size", "disabled"]),
|
|
597
|
+
F(Ee, { name: te.value }, {
|
|
598
|
+
default: x(() => [
|
|
599
|
+
K.value ? (f(), I(
|
|
600
|
+
"div",
|
|
601
|
+
{
|
|
602
|
+
key: 0,
|
|
603
|
+
ref_key: "optionsListElement",
|
|
604
|
+
ref: X,
|
|
605
|
+
class: E(["m-select-list", {
|
|
606
|
+
"--top": e.listPosition.includes("top"),
|
|
607
|
+
"--left": e.listPosition.includes("left"),
|
|
608
|
+
"--right": e.listPosition.includes("right"),
|
|
609
|
+
"--bottom": e.listPosition.includes("bottom")
|
|
610
|
+
}]),
|
|
611
|
+
style: Y({
|
|
612
|
+
maxHeight: `${e.maxListHeight}px`,
|
|
613
|
+
maxWidth: `${e.maxListWidth}px`
|
|
614
|
+
})
|
|
615
|
+
},
|
|
616
|
+
[
|
|
617
|
+
e.search ? (f(), $(ye, {
|
|
618
|
+
key: 0,
|
|
619
|
+
ref_key: "searchInputComponent",
|
|
620
|
+
ref: J,
|
|
621
|
+
modelValue: t.value,
|
|
622
|
+
"onUpdate:modelValue": [
|
|
623
|
+
l[1] || (l[1] = (a) => t.value = a),
|
|
624
|
+
l[2] || (l[2] = (a) => c.value = 0)
|
|
625
|
+
],
|
|
626
|
+
size: "sm",
|
|
627
|
+
color: e.color,
|
|
628
|
+
placeholder: e.searchPlaceholder,
|
|
629
|
+
name: "search",
|
|
630
|
+
autocomplete: "off",
|
|
631
|
+
tabindex: "-1",
|
|
632
|
+
class: "m-select-list__search-input maz-flex-none",
|
|
633
|
+
"left-icon": z(b),
|
|
634
|
+
onKeydown: pe
|
|
635
|
+
}, null, 8, ["modelValue", "color", "placeholder", "left-icon"])) : m("v-if", !0),
|
|
636
|
+
m(`
|
|
637
|
+
@slot No results slot - Displayed when no results corresponding with search query
|
|
638
|
+
`),
|
|
639
|
+
!B.value || B.value.length <= 0 ? H(e.$slots, "no-results", { key: 1 }, () => [
|
|
640
|
+
D("span", Ye, [
|
|
641
|
+
F(z(g), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
642
|
+
])
|
|
643
|
+
], !0) : (f(), I("div", xe, [
|
|
644
|
+
(f(!0), I(
|
|
645
|
+
ve,
|
|
646
|
+
null,
|
|
647
|
+
He(B.value, (a, n) => (f(), I(
|
|
648
|
+
ve,
|
|
649
|
+
{ key: n },
|
|
650
|
+
[
|
|
651
|
+
m(`
|
|
652
|
+
@slot Custom optgroup label
|
|
653
|
+
@binding {String} label - the label of the optgroup
|
|
654
|
+
`),
|
|
655
|
+
a.label && a.isOptGroup ? H(e.$slots, "optgroup", {
|
|
656
|
+
key: 0,
|
|
657
|
+
label: a.label
|
|
658
|
+
}, () => [
|
|
659
|
+
D(
|
|
660
|
+
"span",
|
|
661
|
+
_e,
|
|
662
|
+
re(a.label),
|
|
663
|
+
1
|
|
664
|
+
/* TEXT */
|
|
665
|
+
)
|
|
666
|
+
], !0) : (f(), I("button", {
|
|
667
|
+
key: 1,
|
|
668
|
+
tabindex: "-1",
|
|
669
|
+
type: "button",
|
|
670
|
+
class: E(["m-select-list-item maz-custom maz-flex-none", [
|
|
671
|
+
{
|
|
672
|
+
"--is-keyboard-selected": c.value === n,
|
|
673
|
+
"--is-selected": U(a),
|
|
674
|
+
"--is-none-value": A(a[e.optionValueKey])
|
|
675
|
+
}
|
|
676
|
+
]]),
|
|
677
|
+
style: Y(e.itemHeight ? { height: `${e.itemHeight}px` } : void 0),
|
|
678
|
+
onClick: W((p) => fe(a), ["prevent", "stop"])
|
|
679
|
+
}, [
|
|
680
|
+
e.multiple ? (f(), $(z(v), {
|
|
681
|
+
key: 0,
|
|
682
|
+
tabindex: "-1",
|
|
683
|
+
"model-value": U(a),
|
|
684
|
+
size: "sm",
|
|
685
|
+
color: e.color
|
|
686
|
+
}, null, 8, ["model-value", "color"])) : m("v-if", !0),
|
|
687
|
+
m(`
|
|
688
|
+
@slot Custom option
|
|
689
|
+
@binding {Object} option - the option object
|
|
690
|
+
@binding {Boolean} is-selected - if the option is selected
|
|
691
|
+
`),
|
|
692
|
+
H(e.$slots, "default", {
|
|
693
|
+
option: a,
|
|
694
|
+
isSelected: U(a)
|
|
695
|
+
}, () => [
|
|
696
|
+
D(
|
|
697
|
+
"span",
|
|
698
|
+
null,
|
|
699
|
+
re(a[e.optionLabelKey]),
|
|
700
|
+
1
|
|
701
|
+
/* TEXT */
|
|
702
|
+
)
|
|
703
|
+
], !0)
|
|
704
|
+
], 14, eo))
|
|
705
|
+
],
|
|
706
|
+
64
|
|
707
|
+
/* STABLE_FRAGMENT */
|
|
708
|
+
))),
|
|
709
|
+
128
|
|
710
|
+
/* KEYED_FRAGMENT */
|
|
711
|
+
))
|
|
712
|
+
]))
|
|
713
|
+
],
|
|
714
|
+
6
|
|
715
|
+
/* CLASS, STYLE */
|
|
716
|
+
)) : m("v-if", !0)
|
|
717
|
+
]),
|
|
718
|
+
_: 3
|
|
719
|
+
/* FORWARDED */
|
|
720
|
+
}, 8, ["name"])
|
|
721
|
+
],
|
|
722
|
+
38
|
|
723
|
+
/* CLASS, STYLE, NEED_HYDRATION */
|
|
724
|
+
));
|
|
725
|
+
}
|
|
726
|
+
}), lo = /* @__PURE__ */ Ve(oo, [["__scopeId", "data-v-03e7398d"]]);
|
|
727
|
+
export {
|
|
728
|
+
lo as M,
|
|
729
|
+
Ve as _,
|
|
730
|
+
ze as u
|
|
731
|
+
};
|