maz-ui 3.19.2 → 3.19.3
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/MazFullscreenLoader.d.ts +3 -0
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/chunks/{MazBtn-0d8e3249.mjs → MazBtn-b29e3116.mjs} +2 -2
- package/components/chunks/MazPhoneNumberInput-e4f90230.mjs +1423 -0
- package/components/chunks/{MazSpinner-6025406b.mjs → MazSpinner-c9df761f.mjs} +1 -1
- package/nuxt/index.json +1 -1
- package/nuxt/index.mjs +9 -5
- package/package.json +10 -10
- package/types/components/MazFullscreenLoader.vue.d.ts +3 -0
- package/types/modules/directives/v-fullscreen-img/MazFullscreenImg.vue.d.ts +3 -0
- package/types/tailwindcss/tailwind.config.d.ts +1 -2
- package/components/chunks/MazInput-15f3e149.mjs +0 -344
- package/components/chunks/MazPhoneNumberInput-901c4fa6.mjs +0 -651
- package/components/chunks/MazSelect-c5c3f874.mjs +0 -444
|
@@ -1,444 +0,0 @@
|
|
|
1
|
-
import "../assets/MazSelect.css";
|
|
2
|
-
import { ref, defineComponent, defineAsyncComponent, getCurrentInstance, computed, onBeforeMount, watch, nextTick, openBlock, createElementBlock, normalizeClass, createVNode, mergeProps, unref, withModifiers, withCtx, createElementVNode, Transition, normalizeStyle, createCommentVNode, renderSlot, Fragment, renderList, toDisplayString } from "vue";
|
|
3
|
-
import MazInput from "./MazInput-15f3e149.mjs";
|
|
4
|
-
import { u as useInstanceUniqId, _ as _export_sfc } from "./MazPhoneNumberInput-901c4fa6.mjs";
|
|
5
|
-
ref("system");
|
|
6
|
-
ref();
|
|
7
|
-
ref([]);
|
|
8
|
-
let timeout = null;
|
|
9
|
-
function debounceCallback(callback, delay) {
|
|
10
|
-
if (timeout) {
|
|
11
|
-
clearTimeout(timeout);
|
|
12
|
-
}
|
|
13
|
-
timeout = setTimeout(callback, delay);
|
|
14
|
-
}
|
|
15
|
-
const _hoisted_1 = ["onClick"];
|
|
16
|
-
const _hoisted_2 = {
|
|
17
|
-
key: 0,
|
|
18
|
-
tabindex: "-1",
|
|
19
|
-
class: "m-select-list__search-wrapper"
|
|
20
|
-
};
|
|
21
|
-
const _hoisted_3 = { class: "m-select-list__no-results" };
|
|
22
|
-
const _hoisted_4 = {
|
|
23
|
-
key: 2,
|
|
24
|
-
class: "m-select-list__scroll-wrapper",
|
|
25
|
-
tabindex: "-1"
|
|
26
|
-
};
|
|
27
|
-
const _hoisted_5 = ["onClick"];
|
|
28
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
29
|
-
__name: "MazSelect",
|
|
30
|
-
props: {
|
|
31
|
-
modelValue: {
|
|
32
|
-
type: [Number, String, Boolean],
|
|
33
|
-
default: void 0
|
|
34
|
-
},
|
|
35
|
-
id: { type: String, default: void 0 },
|
|
36
|
-
options: { type: Array, default: void 0 },
|
|
37
|
-
optionValueKey: { type: String, default: "value" },
|
|
38
|
-
optionLabelKey: { type: String, default: "label" },
|
|
39
|
-
optionInputValueKey: { type: String, default: "label" },
|
|
40
|
-
listPosition: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: "bottom left",
|
|
43
|
-
validator: (value) => {
|
|
44
|
-
return ["top", "top right", "top left", "bottom", "bottom right", "bottom left"].includes(
|
|
45
|
-
value
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
required: { type: Boolean, default: false },
|
|
50
|
-
disabled: { type: Boolean, default: false },
|
|
51
|
-
open: { type: Boolean, default: false },
|
|
52
|
-
color: {
|
|
53
|
-
type: String,
|
|
54
|
-
default: "primary"
|
|
55
|
-
},
|
|
56
|
-
itemHeight: { type: Number, default: 40 },
|
|
57
|
-
maxListHeight: { type: Number, default: 240 },
|
|
58
|
-
maxListWidth: { type: Number, default: void 0 },
|
|
59
|
-
size: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: "md",
|
|
62
|
-
validator: (value) => {
|
|
63
|
-
return ["mini", "xs", "sm", "md", "lg", "xl"].includes(value);
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
search: { type: Boolean, default: false },
|
|
67
|
-
searchPlaceholder: { type: String, default: "Search in options" }
|
|
68
|
-
},
|
|
69
|
-
emits: [
|
|
70
|
-
"close",
|
|
71
|
-
"open",
|
|
72
|
-
"blur",
|
|
73
|
-
"focus",
|
|
74
|
-
"change",
|
|
75
|
-
"update:model-value",
|
|
76
|
-
/** On selected value, returns the option object */
|
|
77
|
-
"selected-option"
|
|
78
|
-
],
|
|
79
|
-
setup(__props, { emit: __emit }) {
|
|
80
|
-
const SearchIcon = defineAsyncComponent(() => import("./magnifying-glass-6a0dd1a2.mjs"));
|
|
81
|
-
const ChevronDownIcon = defineAsyncComponent(() => import("./chevron-down-7a070b10.mjs"));
|
|
82
|
-
const NoSymbolIcon = defineAsyncComponent(() => import("./no-symbol-6173a20b.mjs"));
|
|
83
|
-
const instance = getCurrentInstance();
|
|
84
|
-
const props = __props;
|
|
85
|
-
const emits = __emit;
|
|
86
|
-
const listOpened = ref(false);
|
|
87
|
-
const tmpModelValueIndex = ref();
|
|
88
|
-
const hasListOpened = computed(() => listOpened.value || props.open);
|
|
89
|
-
const instanceId = useInstanceUniqId({
|
|
90
|
-
componentName: "MazSelect",
|
|
91
|
-
instance,
|
|
92
|
-
providedId: props.id
|
|
93
|
-
});
|
|
94
|
-
onBeforeMount(() => {
|
|
95
|
-
var _a, _b;
|
|
96
|
-
if (!((_a = props.options) == null ? void 0 : _a.length)) {
|
|
97
|
-
console.warn("[maz-ui](MazSelect) you must provide options");
|
|
98
|
-
}
|
|
99
|
-
if (selectedOption.value) {
|
|
100
|
-
tmpModelValueIndex.value = (_b = props.options) == null ? void 0 : _b.findIndex(
|
|
101
|
-
(option) => {
|
|
102
|
-
var _a2;
|
|
103
|
-
return option[props.optionValueKey] === ((_a2 = selectedOption.value) == null ? void 0 : _a2[props.optionValueKey]);
|
|
104
|
-
}
|
|
105
|
-
);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
const mazSelectElement = ref();
|
|
109
|
-
const mazInputComponent = ref();
|
|
110
|
-
const searchInputComponent = ref();
|
|
111
|
-
const optionsListElement = ref();
|
|
112
|
-
const selectedOption = computed(
|
|
113
|
-
() => {
|
|
114
|
-
var _a;
|
|
115
|
-
return (_a = props.options) == null ? void 0 : _a.find((option) => props.modelValue === option[props.optionValueKey]);
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
const isNullOrUndefined = (value) => {
|
|
119
|
-
return value === void 0 || value === null;
|
|
120
|
-
};
|
|
121
|
-
const mazInputValue = computed(() => {
|
|
122
|
-
var _a, _b, _c;
|
|
123
|
-
return isNullOrUndefined((_a = selectedOption.value) == null ? void 0 : _a[props.optionValueKey]) ? void 0 : ((_b = selectedOption.value) == null ? void 0 : _b[props.optionInputValueKey]) ?? ((_c = selectedOption.value) == null ? void 0 : _c[props.optionLabelKey]);
|
|
124
|
-
});
|
|
125
|
-
const listTransition = computed(
|
|
126
|
-
() => props.listPosition.includes("bottom") ? "maz-slide" : "maz-slideinvert"
|
|
127
|
-
);
|
|
128
|
-
const searchQuery = ref("");
|
|
129
|
-
const query = ref("");
|
|
130
|
-
function normalizeString(str) {
|
|
131
|
-
return str.normalize("NFD").replaceAll(/[\u0300-\u036F]/g, "").replaceAll(/[^\dA-Za-z]/g, "");
|
|
132
|
-
}
|
|
133
|
-
const searchInValue = (value, query2) => {
|
|
134
|
-
return query2 && value && normalizeString(value.toString().toLocaleLowerCase().trim()).includes(
|
|
135
|
-
normalizeString(query2.toLocaleLowerCase().trim())
|
|
136
|
-
);
|
|
137
|
-
};
|
|
138
|
-
watch(
|
|
139
|
-
() => props.modelValue,
|
|
140
|
-
(value, oldValue) => {
|
|
141
|
-
if (value && value !== oldValue) {
|
|
142
|
-
scrollToSelected();
|
|
143
|
-
updateTmpModelValueIndex();
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
function getFilteredOptionWithQuery(query2) {
|
|
148
|
-
var _a;
|
|
149
|
-
return query2 ? (_a = props.options) == null ? void 0 : _a.filter((option) => {
|
|
150
|
-
const searchValue = option[props.optionLabelKey];
|
|
151
|
-
const searchValue3 = option[props.optionValueKey];
|
|
152
|
-
const searchValue2 = option[props.optionInputValueKey];
|
|
153
|
-
return searchInValue(searchValue, query2) || searchInValue(searchValue3, query2) || searchInValue(searchValue2, query2);
|
|
154
|
-
}) : props.options;
|
|
155
|
-
}
|
|
156
|
-
const optionsList = computed(() => getFilteredOptionWithQuery(searchQuery.value));
|
|
157
|
-
const closeList = async (event) => {
|
|
158
|
-
var _a;
|
|
159
|
-
if (event && ("relatedTarget" in event && ((_a = mazSelectElement.value) == null ? void 0 : _a.contains(event.relatedTarget)) || event.type === "keydown")) {
|
|
160
|
-
return event.preventDefault();
|
|
161
|
-
}
|
|
162
|
-
await nextTick();
|
|
163
|
-
listOpened.value = false;
|
|
164
|
-
tmpModelValueIndex.value = 0;
|
|
165
|
-
emits("close", event);
|
|
166
|
-
};
|
|
167
|
-
const openList = async (event) => {
|
|
168
|
-
event == null ? void 0 : event.preventDefault();
|
|
169
|
-
if (props.disabled)
|
|
170
|
-
return;
|
|
171
|
-
listOpened.value = true;
|
|
172
|
-
await scrollToSelected();
|
|
173
|
-
emits("focus", event);
|
|
174
|
-
emits("open", listOpened.value);
|
|
175
|
-
};
|
|
176
|
-
function toggleList(event) {
|
|
177
|
-
var _a, _b;
|
|
178
|
-
return listOpened.value ? closeList(event) : ((_b = (_a = mazInputComponent.value) == null ? void 0 : _a.$el.querySelector("input")) == null ? void 0 : _b.focus()) ?? openList();
|
|
179
|
-
}
|
|
180
|
-
function focusSearchInputAndSetQuery(q) {
|
|
181
|
-
var _a;
|
|
182
|
-
searchQuery.value = q;
|
|
183
|
-
(_a = searchInputComponent.value) == null ? void 0 : _a.input.focus();
|
|
184
|
-
}
|
|
185
|
-
function searchOptionWithQuery(keyPressed) {
|
|
186
|
-
var _a;
|
|
187
|
-
if (keyPressed === "Backspace" && query.value.length > 0) {
|
|
188
|
-
query.value = query.value.slice(0, -1);
|
|
189
|
-
} else {
|
|
190
|
-
query.value += keyPressed;
|
|
191
|
-
}
|
|
192
|
-
const filteredOptions = getFilteredOptionWithQuery(query.value);
|
|
193
|
-
if (filteredOptions == null ? void 0 : filteredOptions.length) {
|
|
194
|
-
tmpModelValueIndex.value = (_a = optionsList.value) == null ? void 0 : _a.findIndex(
|
|
195
|
-
(option) => option[props.optionValueKey] === filteredOptions[0][props.optionValueKey]
|
|
196
|
-
);
|
|
197
|
-
scrollToSelected(tmpModelValueIndex.value);
|
|
198
|
-
}
|
|
199
|
-
debounceCallback(() => {
|
|
200
|
-
query.value = "";
|
|
201
|
-
}, 1e3);
|
|
202
|
-
}
|
|
203
|
-
const mainInputKeyboardHandler = (event) => {
|
|
204
|
-
const keyPressed = event.key;
|
|
205
|
-
if (/^[\dA-Za-z]$/.test(keyPressed)) {
|
|
206
|
-
event.preventDefault();
|
|
207
|
-
openList(event);
|
|
208
|
-
props.search ? focusSearchInputAndSetQuery(keyPressed) : searchOptionWithQuery(keyPressed);
|
|
209
|
-
} else {
|
|
210
|
-
keyboardHandler(event);
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
const keyboardHandler = (event) => {
|
|
214
|
-
const code = event.code;
|
|
215
|
-
const isArrow = ["ArrowUp", "ArrowDown"].includes(code);
|
|
216
|
-
const isEnter = "Enter" === code;
|
|
217
|
-
const isEscape = "Escape" === code && hasListOpened.value;
|
|
218
|
-
if (isArrow) {
|
|
219
|
-
arrowHandler(event, tmpModelValueIndex.value);
|
|
220
|
-
} else if (isEnter) {
|
|
221
|
-
enterHandler(event, tmpModelValueIndex.value);
|
|
222
|
-
} else if (isEscape) {
|
|
223
|
-
closeList();
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
const arrowHandler = (event, currentIndex) => {
|
|
227
|
-
var _a;
|
|
228
|
-
event.preventDefault();
|
|
229
|
-
const code = event.code;
|
|
230
|
-
if (!hasListOpened.value)
|
|
231
|
-
openList(event);
|
|
232
|
-
const optionsLength = (_a = optionsList.value) == null ? void 0 : _a.length;
|
|
233
|
-
if (!optionsLength) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
if (typeof currentIndex === "number") {
|
|
237
|
-
if (currentIndex === optionsLength - 1 && code === "ArrowDown") {
|
|
238
|
-
tmpModelValueIndex.value = 0;
|
|
239
|
-
} else if (currentIndex === 0 && code === "ArrowUp") {
|
|
240
|
-
tmpModelValueIndex.value = optionsLength - 1;
|
|
241
|
-
} else {
|
|
242
|
-
tmpModelValueIndex.value = code === "ArrowDown" ? currentIndex + 1 : currentIndex - 1;
|
|
243
|
-
}
|
|
244
|
-
} else {
|
|
245
|
-
tmpModelValueIndex.value = code === "ArrowDown" ? 0 : optionsLength - 1;
|
|
246
|
-
}
|
|
247
|
-
scrollToSelected(tmpModelValueIndex.value);
|
|
248
|
-
};
|
|
249
|
-
const enterHandler = (event, currentIndex) => {
|
|
250
|
-
var _a, _b, _c;
|
|
251
|
-
event.preventDefault();
|
|
252
|
-
if (!hasListOpened.value) {
|
|
253
|
-
return openList(event);
|
|
254
|
-
}
|
|
255
|
-
const newValue = currentIndex ? ((_a = optionsList.value) == null ? void 0 : _a[currentIndex]) ?? ((_b = optionsList.value) == null ? void 0 : _b[0]) : (_c = optionsList.value) == null ? void 0 : _c[0];
|
|
256
|
-
if (!isNullOrUndefined(newValue)) {
|
|
257
|
-
updateValue(newValue);
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
async function scrollToSelected(index) {
|
|
261
|
-
var _a, _b, _c;
|
|
262
|
-
await nextTick();
|
|
263
|
-
const selectedIndex = index ?? ((_a = optionsList.value) == null ? void 0 : _a.findIndex(
|
|
264
|
-
(option) => {
|
|
265
|
-
var _a2;
|
|
266
|
-
return ((_a2 = selectedOption.value) == null ? void 0 : _a2[props.optionValueKey]) === option[props.optionValueKey];
|
|
267
|
-
}
|
|
268
|
-
));
|
|
269
|
-
if (typeof selectedIndex === "number") {
|
|
270
|
-
if (!tmpModelValueIndex.value)
|
|
271
|
-
tmpModelValueIndex.value = selectedIndex;
|
|
272
|
-
(_c = (_b = optionsListElement.value) == null ? void 0 : _b.querySelectorAll(".m-select-list-item")[selectedIndex]) == null ? void 0 : _c.scrollIntoView({
|
|
273
|
-
behavior: "auto",
|
|
274
|
-
block: "nearest",
|
|
275
|
-
inline: "start"
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
function updateTmpModelValueIndex() {
|
|
280
|
-
var _a;
|
|
281
|
-
const index = (_a = optionsList.value) == null ? void 0 : _a.findIndex(
|
|
282
|
-
(option) => selectedOption[props.optionValueKey] === option[props.optionValueKey]
|
|
283
|
-
);
|
|
284
|
-
tmpModelValueIndex.value = index && index >= 0 ? index : void 0;
|
|
285
|
-
}
|
|
286
|
-
const updateValue = (selectedOption2, mustCloseList = true) => {
|
|
287
|
-
if (mustCloseList) {
|
|
288
|
-
nextTick(() => closeList());
|
|
289
|
-
}
|
|
290
|
-
searchQuery.value = "";
|
|
291
|
-
emits("update:model-value", selectedOption2[props.optionValueKey]);
|
|
292
|
-
emits("selected-option", selectedOption2);
|
|
293
|
-
updateTmpModelValueIndex();
|
|
294
|
-
};
|
|
295
|
-
return (_ctx, _cache) => {
|
|
296
|
-
return openBlock(), createElementBlock(
|
|
297
|
-
"div",
|
|
298
|
-
{
|
|
299
|
-
ref_key: "mazSelectElement",
|
|
300
|
-
ref: mazSelectElement,
|
|
301
|
-
class: normalizeClass(["m-select", { "--is-open": hasListOpened.value, "--disabled": __props.disabled }]),
|
|
302
|
-
onBlurCapture: closeList
|
|
303
|
-
},
|
|
304
|
-
[
|
|
305
|
-
createVNode(MazInput, mergeProps({
|
|
306
|
-
id: unref(instanceId),
|
|
307
|
-
ref_key: "mazInputComponent",
|
|
308
|
-
ref: mazInputComponent,
|
|
309
|
-
class: "m-select-input"
|
|
310
|
-
}, _ctx.$attrs, {
|
|
311
|
-
required: __props.required,
|
|
312
|
-
"border-active": listOpened.value,
|
|
313
|
-
color: __props.color,
|
|
314
|
-
"model-value": mazInputValue.value,
|
|
315
|
-
autocomplete: "off",
|
|
316
|
-
size: __props.size,
|
|
317
|
-
disabled: __props.disabled,
|
|
318
|
-
onFocus: withModifiers(openList, ["prevent", "stop"]),
|
|
319
|
-
onChange: _cache[0] || (_cache[0] = ($event) => emits("change", $event)),
|
|
320
|
-
onKeydown: mainInputKeyboardHandler
|
|
321
|
-
}), {
|
|
322
|
-
"right-icon": withCtx(() => [
|
|
323
|
-
createElementVNode("button", {
|
|
324
|
-
tabindex: "-1",
|
|
325
|
-
type: "button",
|
|
326
|
-
class: "m-select-input__toggle-button maz-custom",
|
|
327
|
-
onClick: withModifiers(toggleList, ["stop"])
|
|
328
|
-
}, [
|
|
329
|
-
createVNode(unref(ChevronDownIcon), { class: "m-select-chevron maz-text-xl" })
|
|
330
|
-
], 8, _hoisted_1)
|
|
331
|
-
]),
|
|
332
|
-
_: 1
|
|
333
|
-
/* STABLE */
|
|
334
|
-
}, 16, ["id", "required", "border-active", "color", "model-value", "size", "disabled", "onFocus"]),
|
|
335
|
-
createVNode(Transition, { name: listTransition.value }, {
|
|
336
|
-
default: withCtx(() => [
|
|
337
|
-
hasListOpened.value ? (openBlock(), createElementBlock(
|
|
338
|
-
"div",
|
|
339
|
-
{
|
|
340
|
-
key: 0,
|
|
341
|
-
ref_key: "optionsListElement",
|
|
342
|
-
ref: optionsListElement,
|
|
343
|
-
class: normalizeClass(["m-select-list", {
|
|
344
|
-
"--top": __props.listPosition.includes("top"),
|
|
345
|
-
"--left": __props.listPosition.includes("left"),
|
|
346
|
-
"--right": __props.listPosition.includes("right"),
|
|
347
|
-
"--bottom": __props.listPosition.includes("bottom")
|
|
348
|
-
}]),
|
|
349
|
-
style: normalizeStyle({
|
|
350
|
-
maxHeight: `${__props.maxListHeight}px`,
|
|
351
|
-
maxWidth: `${__props.maxListWidth}px`
|
|
352
|
-
})
|
|
353
|
-
},
|
|
354
|
-
[
|
|
355
|
-
__props.search ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
356
|
-
createVNode(MazInput, {
|
|
357
|
-
ref_key: "searchInputComponent",
|
|
358
|
-
ref: searchInputComponent,
|
|
359
|
-
modelValue: searchQuery.value,
|
|
360
|
-
"onUpdate:modelValue": [
|
|
361
|
-
_cache[1] || (_cache[1] = ($event) => searchQuery.value = $event),
|
|
362
|
-
_cache[2] || (_cache[2] = ($event) => tmpModelValueIndex.value = 0)
|
|
363
|
-
],
|
|
364
|
-
size: "sm",
|
|
365
|
-
color: __props.color,
|
|
366
|
-
placeholder: __props.searchPlaceholder,
|
|
367
|
-
name: "search",
|
|
368
|
-
autocomplete: "off",
|
|
369
|
-
tabindex: "-1",
|
|
370
|
-
class: "m-select-list__search-input",
|
|
371
|
-
onKeydown: keyboardHandler
|
|
372
|
-
}, {
|
|
373
|
-
"left-icon": withCtx(() => [
|
|
374
|
-
createVNode(unref(SearchIcon), { class: "maz-h-[1.3rem] maz-w-[1.3rem]" })
|
|
375
|
-
]),
|
|
376
|
-
_: 1
|
|
377
|
-
/* STABLE */
|
|
378
|
-
}, 8, ["modelValue", "color", "placeholder"])
|
|
379
|
-
])) : createCommentVNode("v-if", true),
|
|
380
|
-
createCommentVNode(" No results slot - Displayed when no results corresponding with seeach query "),
|
|
381
|
-
!optionsList.value || optionsList.value.length <= 0 ? renderSlot(_ctx.$slots, "no-results", { key: 1 }, () => [
|
|
382
|
-
createElementVNode("span", _hoisted_3, [
|
|
383
|
-
createVNode(unref(NoSymbolIcon), { class: "maz-h-6 maz-w-6 maz-text-normal" })
|
|
384
|
-
])
|
|
385
|
-
], true) : (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
386
|
-
(openBlock(true), createElementBlock(
|
|
387
|
-
Fragment,
|
|
388
|
-
null,
|
|
389
|
-
renderList(optionsList.value, (option, i) => {
|
|
390
|
-
var _a, _b, _c;
|
|
391
|
-
return openBlock(), createElementBlock("button", {
|
|
392
|
-
key: i,
|
|
393
|
-
tabindex: "-1",
|
|
394
|
-
type: "button",
|
|
395
|
-
class: normalizeClass(["m-select-list-item maz-custom", [
|
|
396
|
-
{
|
|
397
|
-
"--is-keyboard-selected": tmpModelValueIndex.value === i,
|
|
398
|
-
"--is-selected": ((_a = selectedOption.value) == null ? void 0 : _a[__props.optionValueKey]) === option[__props.optionValueKey] && !isNullOrUndefined(option[__props.optionValueKey]),
|
|
399
|
-
"--is-none-value": isNullOrUndefined(option[__props.optionValueKey])
|
|
400
|
-
},
|
|
401
|
-
`--${__props.color}`
|
|
402
|
-
]]),
|
|
403
|
-
style: normalizeStyle({ minHeight: `${__props.itemHeight}px` }),
|
|
404
|
-
onClick: withModifiers(($event) => updateValue(option), ["prevent", "stop"])
|
|
405
|
-
}, [
|
|
406
|
-
renderSlot(_ctx.$slots, "default", {
|
|
407
|
-
option,
|
|
408
|
-
isSelected: ((_b = selectedOption.value) == null ? void 0 : _b[__props.optionValueKey]) === option[__props.optionValueKey],
|
|
409
|
-
selectedOption: (_c = selectedOption.value) == null ? void 0 : _c[__props.optionValueKey]
|
|
410
|
-
}, () => [
|
|
411
|
-
createElementVNode(
|
|
412
|
-
"span",
|
|
413
|
-
null,
|
|
414
|
-
toDisplayString(option[__props.optionLabelKey]),
|
|
415
|
-
1
|
|
416
|
-
/* TEXT */
|
|
417
|
-
)
|
|
418
|
-
], true)
|
|
419
|
-
], 14, _hoisted_5);
|
|
420
|
-
}),
|
|
421
|
-
128
|
|
422
|
-
/* KEYED_FRAGMENT */
|
|
423
|
-
))
|
|
424
|
-
]))
|
|
425
|
-
],
|
|
426
|
-
6
|
|
427
|
-
/* CLASS, STYLE */
|
|
428
|
-
)) : createCommentVNode("v-if", true)
|
|
429
|
-
]),
|
|
430
|
-
_: 3
|
|
431
|
-
/* FORWARDED */
|
|
432
|
-
}, 8, ["name"])
|
|
433
|
-
],
|
|
434
|
-
34
|
|
435
|
-
/* CLASS, HYDRATE_EVENTS */
|
|
436
|
-
);
|
|
437
|
-
};
|
|
438
|
-
}
|
|
439
|
-
});
|
|
440
|
-
const MazSelect_vue_vue_type_style_index_0_scoped_2589528b_lang = "";
|
|
441
|
-
const MazSelect = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2589528b"]]);
|
|
442
|
-
export {
|
|
443
|
-
MazSelect as default
|
|
444
|
-
};
|