@webitel/ui-sdk 26.6.80 → 26.6.82
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/dist/{components-B78RTsRa.js → components-rPVG1iQS.js} +53 -51
- package/dist/{composables-BtjgpN_Q.js → composables-DEdhzUqN.js} +79 -76
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1 -1
- package/dist/ui-sdk.umd.cjs +1 -1
- package/dist/{wt-chat-emoji-D3pE1OO5.js → wt-chat-emoji-DnG7Ikl3.js} +1 -1
- package/dist/{wt-display-chip-items--NfaCbMo.js → wt-display-chip-items-DUicVxt2.js} +1 -1
- package/dist/{wt-expansion-card-IE8wNONx.js → wt-expansion-card-BANe4zX2.js} +1 -1
- package/dist/{wt-galleria-UzlXk6Xn.js → wt-galleria-YxNez7SX.js} +1 -1
- package/dist/{wt-send-message-popup-XyCF_GJE.js → wt-send-message-popup-C2r4l9Ln.js} +1 -1
- package/dist/{wt-table-BMyEF8Xb.js → wt-table-CPGSqs5Z.js} +1 -1
- package/dist/{wt-type-extension-value-input-fPbwjEnF.js → wt-type-extension-value-input-B9CGBDQg.js} +1 -1
- package/dist/{wt-vidstack-player-BstGrhQ4.js → wt-vidstack-player-DYCrCT9T.js} +1 -1
- package/package.json +1 -1
- package/src/components/_internals/composables/useSelect/useSelect.ts +4 -0
- package/src/components/_internals/composables/useSelect/useSelectOptions.ts +17 -0
- package/src/components/wt-card/wt-card.vue +1 -0
- package/src/components/wt-multi-select/wt-multi-select.vue +5 -3
- package/src/components/wt-single-select/wt-single-select.vue +5 -3
- package/types/components/_internals/composables/useSelect/useSelect.d.ts +3 -1
- package/types/components/_internals/composables/useSelect/useSelectOptions.d.ts +3 -1
- package/types/components/wt-multi-select/wt-multi-select.vue.d.ts +2 -2
- package/types/components/wt-single-select/wt-single-select.vue.d.ts +2 -2
|
@@ -113,140 +113,143 @@ var l = () => {
|
|
|
113
113
|
t.value = !1;
|
|
114
114
|
}, 500);
|
|
115
115
|
}), { showFooterLoader: t };
|
|
116
|
-
}, y = ({ selected: n, options: r, optionLabel: i, optionValue: a, dataKey: l, allowCustomValues: u, searchMethod: d }) => {
|
|
117
|
-
let { t:
|
|
116
|
+
}, y = ({ selected: n, options: r, optionLabel: i, optionValue: a, dataKey: l, allowCustomValues: u, searchMethod: d, disabledOptions: g }) => {
|
|
117
|
+
let { t: _ } = e(), v = s(""), y = s(r.value), b = s(!1), x = s(!0), S = o({
|
|
118
118
|
page: 1,
|
|
119
119
|
search: ""
|
|
120
|
-
}),
|
|
120
|
+
}), C = (e) => {
|
|
121
121
|
let t = m(e, l.value);
|
|
122
122
|
if (!n.value) return t;
|
|
123
123
|
let r = f(n.value), i = [], a = [];
|
|
124
124
|
for (let e of t) (p(e, r, l.value) ? i : a).push(e);
|
|
125
125
|
return i.concat(a);
|
|
126
|
-
},
|
|
126
|
+
}, w = (e) => {
|
|
127
127
|
if (!e) return "";
|
|
128
128
|
if (u.value && e.isTag) return e.label;
|
|
129
129
|
if (a?.value && typeof e != "object") {
|
|
130
|
-
let t = [...
|
|
131
|
-
return t ?
|
|
130
|
+
let t = [...y.value, ...E.value].find((t) => t[a.value] === e);
|
|
131
|
+
return t ? w(t) : String(e);
|
|
132
132
|
}
|
|
133
|
-
return i.value && e[i.value] ? e[i.value] : e.locale ? Array.isArray(e.locale) ?
|
|
134
|
-
},
|
|
133
|
+
return i.value && e[i.value] ? e[i.value] : e.locale ? Array.isArray(e.locale) ? _(...e.locale) : _(e.locale) : e.name || e;
|
|
134
|
+
}, T = (e, t) => h(e, t, w), E = s([]), D = () => {
|
|
135
135
|
if (!n.value) {
|
|
136
|
-
|
|
136
|
+
E.value = [];
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
let e = f(n.value), t = (t) => p(t, e, l.value), r =
|
|
140
|
-
|
|
141
|
-
},
|
|
139
|
+
let e = f(n.value), t = (t) => p(t, e, l.value), r = y.value.filter(t), i = m([...E.value, ...r], l.value);
|
|
140
|
+
E.value = i.filter(t);
|
|
141
|
+
}, O = async () => {
|
|
142
142
|
if (!d.value || !a?.value || !n.value) return;
|
|
143
143
|
let e = f(n.value);
|
|
144
144
|
if (!e.length) return;
|
|
145
|
-
|
|
145
|
+
b.value = !0;
|
|
146
146
|
let { items: t } = await d.value({
|
|
147
147
|
[l.value]: e,
|
|
148
148
|
size: e.length
|
|
149
149
|
});
|
|
150
|
-
|
|
151
|
-
},
|
|
150
|
+
E.value = m([...E.value, ...t], l.value), b.value = !1;
|
|
151
|
+
}, k = async () => {
|
|
152
152
|
if (!d.value) return;
|
|
153
|
-
let { search: e, page: t } =
|
|
154
|
-
|
|
153
|
+
let { search: e, page: t } = S;
|
|
154
|
+
b.value = !0;
|
|
155
155
|
let { items: r, next: i } = await d.value({
|
|
156
156
|
search: e,
|
|
157
157
|
page: t
|
|
158
|
-
}), a = e ?
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
},
|
|
163
|
-
if (
|
|
158
|
+
}), a = e ? T(E.value, e) : E.value, o = S.page === 1 ? m([...a, ...r], l.value) : y.value.concat(r);
|
|
159
|
+
y.value = C(o), N(n.value), x.value = i, S.page += 1, b.value = !1;
|
|
160
|
+
}, A = (e = "") => {
|
|
161
|
+
S.search = e, S.page = 1, k();
|
|
162
|
+
}, j = t((e) => A(e)), M = (e) => {
|
|
163
|
+
if (v.value = e, d.value) j(e);
|
|
164
164
|
else {
|
|
165
|
-
let t =
|
|
166
|
-
|
|
165
|
+
let t = T(E.value, e), n = T(r.value, e);
|
|
166
|
+
y.value = C(m([...t, ...n], l.value));
|
|
167
167
|
}
|
|
168
|
-
},
|
|
168
|
+
}, N = (e) => {
|
|
169
169
|
if (!e || !d.value) return;
|
|
170
|
-
let t = f(e).filter((e) => !p(e,
|
|
170
|
+
let t = f(e).filter((e) => !p(e, y.value, l.value));
|
|
171
171
|
if (t.length) {
|
|
172
|
-
let e = t.map((e) =>
|
|
173
|
-
|
|
172
|
+
let e = t.map((e) => E.value.find((t) => t[l.value] === e) ?? e);
|
|
173
|
+
y.value = C(m([...T(e, v.value), ...y.value], l.value));
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
return c(() => n.value, (e, t) => {
|
|
177
|
-
|
|
177
|
+
D(), N(e);
|
|
178
178
|
}), c(() => r.value, (e) => {
|
|
179
|
-
d.value || (
|
|
179
|
+
d.value || (y.value = C(e));
|
|
180
180
|
}), {
|
|
181
|
-
filterText:
|
|
182
|
-
filteredOptions:
|
|
183
|
-
isLoading:
|
|
184
|
-
searchHasNext:
|
|
185
|
-
sortOptions:
|
|
186
|
-
getOptionLabel:
|
|
187
|
-
fetchOptions:
|
|
188
|
-
fetchSelectedByIds:
|
|
189
|
-
resetAndFetch:
|
|
190
|
-
filterOptions:
|
|
191
|
-
updateSelectedOptionsCache:
|
|
181
|
+
filterText: v,
|
|
182
|
+
filteredOptions: y,
|
|
183
|
+
isLoading: b,
|
|
184
|
+
searchHasNext: x,
|
|
185
|
+
sortOptions: C,
|
|
186
|
+
getOptionLabel: w,
|
|
187
|
+
fetchOptions: k,
|
|
188
|
+
fetchSelectedByIds: O,
|
|
189
|
+
resetAndFetch: A,
|
|
190
|
+
filterOptions: M,
|
|
191
|
+
updateSelectedOptionsCache: D,
|
|
192
|
+
isOptionDisabled: (e) => g?.value ? Array.isArray(g.value) ? g.value.some((t) => typeof t == "object" && !!t && typeof e == "object" && !!e && t[l.value] === e[l.value]) : !!g.value : !1
|
|
192
193
|
};
|
|
193
|
-
}, b = ({ selected: e, options: t, optionLabel: n, optionValue: r, dataKey: a, allowCustomValues: o, manualCustomValues: s = !1, filterInput: c, selectRef: l, searchMethod: u, selectId: d, isSingle: f,
|
|
194
|
-
let { filterText:
|
|
194
|
+
}, b = ({ selected: e, options: t, optionLabel: n, optionValue: r, dataKey: a, allowCustomValues: o, manualCustomValues: s = !1, filterInput: c, selectRef: l, searchMethod: u, selectId: d, isSingle: f, disabledOptions: p = void 0, emit: m = () => {} }) => {
|
|
195
|
+
let { filterText: h, filteredOptions: b, isLoading: x, searchHasNext: S, sortOptions: C, getOptionLabel: w, fetchOptions: T, fetchSelectedByIds: E, resetAndFetch: D, filterOptions: O, updateSelectedOptionsCache: k, isOptionDisabled: A } = y({
|
|
195
196
|
selected: e,
|
|
196
197
|
options: t,
|
|
197
198
|
optionLabel: n,
|
|
198
199
|
optionValue: r,
|
|
199
200
|
dataKey: a,
|
|
200
201
|
allowCustomValues: o,
|
|
201
|
-
searchMethod: u
|
|
202
|
-
|
|
202
|
+
searchMethod: u,
|
|
203
|
+
disabledOptions: p
|
|
204
|
+
}), { isDropdownOpen: j, onDropdownBeforeShow: M, onDropdownBeforeHide: N, onDropdownShow: P, onDropdownHide: F } = _({
|
|
203
205
|
selectId: d,
|
|
204
206
|
selectRef: l,
|
|
205
207
|
filterInput: c,
|
|
206
208
|
searchMethod: u,
|
|
207
|
-
filteredOptions:
|
|
208
|
-
filterText:
|
|
209
|
-
filterOptions:
|
|
210
|
-
resetAndFetch:
|
|
211
|
-
sortOptions:
|
|
212
|
-
fetchOptions:
|
|
213
|
-
isLoading:
|
|
214
|
-
searchHasNext:
|
|
215
|
-
}), { showFooterLoader:
|
|
209
|
+
filteredOptions: b,
|
|
210
|
+
filterText: h,
|
|
211
|
+
filterOptions: O,
|
|
212
|
+
resetAndFetch: D,
|
|
213
|
+
sortOptions: C,
|
|
214
|
+
fetchOptions: T,
|
|
215
|
+
isLoading: x,
|
|
216
|
+
searchHasNext: S
|
|
217
|
+
}), { showFooterLoader: I } = v(x), { onInputKeydown: L } = g({
|
|
216
218
|
selected: e,
|
|
217
|
-
filteredOptions:
|
|
219
|
+
filteredOptions: b,
|
|
218
220
|
options: t,
|
|
219
221
|
optionValue: r,
|
|
220
222
|
dataKey: a,
|
|
221
|
-
filterText:
|
|
222
|
-
filterOptions:
|
|
223
|
-
updateSelectedOptionsCache:
|
|
223
|
+
filterText: h,
|
|
224
|
+
filterOptions: O,
|
|
225
|
+
updateSelectedOptionsCache: k,
|
|
224
226
|
selectRef: l,
|
|
225
227
|
allowCustomValues: o,
|
|
226
228
|
manualCustomValues: s,
|
|
227
229
|
isSingle: f,
|
|
228
|
-
emit:
|
|
230
|
+
emit: m
|
|
229
231
|
});
|
|
230
232
|
return i(async () => {
|
|
231
|
-
await
|
|
233
|
+
await E(), u.value && T();
|
|
232
234
|
}), {
|
|
233
|
-
isLoading:
|
|
234
|
-
showFooterLoader:
|
|
235
|
-
isDropdownOpen:
|
|
236
|
-
filterText:
|
|
237
|
-
filteredOptions:
|
|
238
|
-
getOptionLabel:
|
|
239
|
-
fetchOptions:
|
|
240
|
-
filterOptions:
|
|
241
|
-
onDropdownBeforeShow:
|
|
242
|
-
onDropdownBeforeHide:
|
|
243
|
-
onDropdownShow:
|
|
244
|
-
onDropdownHide:
|
|
245
|
-
onInputKeydown:
|
|
235
|
+
isLoading: x,
|
|
236
|
+
showFooterLoader: I,
|
|
237
|
+
isDropdownOpen: j,
|
|
238
|
+
filterText: h,
|
|
239
|
+
filteredOptions: b,
|
|
240
|
+
getOptionLabel: w,
|
|
241
|
+
fetchOptions: T,
|
|
242
|
+
filterOptions: O,
|
|
243
|
+
onDropdownBeforeShow: M,
|
|
244
|
+
onDropdownBeforeHide: N,
|
|
245
|
+
onDropdownShow: P,
|
|
246
|
+
onDropdownHide: F,
|
|
247
|
+
onInputKeydown: L,
|
|
246
248
|
clearValue: () => {
|
|
247
249
|
let t = "";
|
|
248
|
-
Array.isArray(e.value) ? t = [] : typeof e.value == "object" && e.value !== null && (t = {}), e.value = t,
|
|
249
|
-
}
|
|
250
|
+
Array.isArray(e.value) ? t = [] : typeof e.value == "object" && e.value !== null && (t = {}), e.value = t, m("reset", t);
|
|
251
|
+
},
|
|
252
|
+
isOptionDisabled: A
|
|
250
253
|
};
|
|
251
254
|
}, x = (e, t) => {
|
|
252
255
|
let n = null, r = null, i = null, a = !1, o = () => {
|