@teammodlr/ui-kit 3.0.0-beta.26 → 3.0.0-beta.28
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/lib/index.es.js
CHANGED
|
@@ -15843,7 +15843,9 @@ let ao = !1;
|
|
|
15843
15843
|
const $C = T({
|
|
15844
15844
|
name: "MSelect",
|
|
15845
15845
|
emits: {
|
|
15846
|
-
...Ae.emits()
|
|
15846
|
+
...Ae.emits(),
|
|
15847
|
+
"on-open": () => !0,
|
|
15848
|
+
"on-close": () => !0
|
|
15847
15849
|
},
|
|
15848
15850
|
props: {
|
|
15849
15851
|
...Ae.props(),
|
|
@@ -16082,8 +16084,8 @@ const $C = T({
|
|
|
16082
16084
|
(le) => le.value === Y
|
|
16083
16085
|
) && (e.multiple ? Array.isArray(S.value) ? S.value.indexOf(Y) !== -1 ? S.value = S.value.filter((we) => we !== Y) : S.value = [...S.value, Y] : S.value = [Y] : (b.value = !0, S.value = Y, d.value = !1));
|
|
16084
16086
|
}
|
|
16085
|
-
function fe(Y
|
|
16086
|
-
|
|
16087
|
+
function fe(Y) {
|
|
16088
|
+
e.multiple && Array.isArray(S.value) && (S.value = S.value.filter((se) => se !== Y));
|
|
16087
16089
|
}
|
|
16088
16090
|
Be("resize", () => {
|
|
16089
16091
|
d.value = !1;
|
|
@@ -16187,7 +16189,7 @@ const $C = T({
|
|
|
16187
16189
|
p.value && typeof Y < "u" && ((se = a.value) == null || se.scrollToIndex(Y, { align: "nearest" }));
|
|
16188
16190
|
}), te(d, (Y) => {
|
|
16189
16191
|
ge(() => {
|
|
16190
|
-
if (Y || (c.value = ""), Y && (q.value = C()), Y && e.searchable && r.value ? r.value.focus() : Y && o.value && o.value.focus(), !Y && b.value && o.value && (b.value = !1, w.value = !0, requestAnimationFrame(() => {
|
|
16192
|
+
if (Y || (t("on-close"), c.value = ""), Y && (t("on-open"), q.value = C()), Y && e.searchable && r.value ? r.value.focus() : Y && o.value && o.value.focus(), !Y && b.value && o.value && (b.value = !1, w.value = !0, requestAnimationFrame(() => {
|
|
16191
16193
|
var se;
|
|
16192
16194
|
(se = o.value) == null || se.focus();
|
|
16193
16195
|
})), Y) {
|
|
@@ -16349,7 +16351,7 @@ function RC(e, t, n, o, a, r) {
|
|
|
16349
16351
|
(g(!0), E(de, null, Ee(e.selectedMax, (f) => (g(), B(s, {
|
|
16350
16352
|
key: f,
|
|
16351
16353
|
closeable: !0,
|
|
16352
|
-
onClose: (
|
|
16354
|
+
onClose: () => e.removeSelected(f),
|
|
16353
16355
|
size: e.size
|
|
16354
16356
|
}, {
|
|
16355
16357
|
default: $(() => [
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<div :class="selectComputedClasses">
|
|
17
17
|
<template v-if="multiple && Array.isArray(selected) && selected.length > 0">
|
|
18
18
|
<MTag v-for="value in selectedMax" :key="value" :closeable="true"
|
|
19
|
-
@close="
|
|
19
|
+
@close="() => removeSelected(value)" :size="size">
|
|
20
20
|
{{ getSelectedLabel(value) }}
|
|
21
21
|
</MTag>
|
|
22
22
|
<template v-if="selectedCountNotShown > 0">
|
|
@@ -138,7 +138,9 @@ let shouldOpenNextFocusedSelect = false;
|
|
|
138
138
|
export default defineComponent({
|
|
139
139
|
name: 'MSelect',
|
|
140
140
|
emits: {
|
|
141
|
-
...useInput.emits()
|
|
141
|
+
...useInput.emits(),
|
|
142
|
+
'on-open': () => true,
|
|
143
|
+
'on-close': () => true
|
|
142
144
|
},
|
|
143
145
|
props: {
|
|
144
146
|
...useInput.props(),
|
|
@@ -613,9 +615,7 @@ export default defineComponent({
|
|
|
613
615
|
}
|
|
614
616
|
}
|
|
615
617
|
|
|
616
|
-
function removeSelected(
|
|
617
|
-
event.preventDefault();
|
|
618
|
-
event.stopPropagation();
|
|
618
|
+
function removeSelected(value: string | number) {
|
|
619
619
|
if (!props.multiple) {
|
|
620
620
|
return;
|
|
621
621
|
}
|
|
@@ -827,10 +827,12 @@ export default defineComponent({
|
|
|
827
827
|
watch(open, (value: boolean) => {
|
|
828
828
|
nextTick(() => {
|
|
829
829
|
if (!value) {
|
|
830
|
+
emit('on-close');
|
|
830
831
|
search.value = '';
|
|
831
832
|
}
|
|
832
833
|
|
|
833
834
|
if (value) {
|
|
835
|
+
emit('on-open');
|
|
834
836
|
zIndex.value = nextZIndex();
|
|
835
837
|
}
|
|
836
838
|
|