@webitel/ui-sdk 26.8.155 → 26.10.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.
Files changed (23) hide show
  1. package/dist/{clients-CD7NXpWz.js → clients-BuWrwEVp.js} +1 -1
  2. package/dist/{components-BaLs0ZtL.js → components-D1ukd_PU.js} +4 -4
  3. package/dist/{composables-BeyROIj_.js → composables-Cy5nWaAF.js} +44 -40
  4. package/dist/ui-sdk.js +1 -1
  5. package/dist/ui-sdk.umd.cjs +1 -1
  6. package/dist/{wt-chat-emoji-Ctwc4VYl.js → wt-chat-emoji-CRt5jka9.js} +1 -1
  7. package/dist/{wt-display-chip-items-BsaEZtrc.js → wt-display-chip-items-2KUHhVtF.js} +1 -1
  8. package/dist/{wt-expansion-card-CNkGLQvo.js → wt-expansion-card-Bpj0G5u9.js} +1 -1
  9. package/dist/{wt-galleria-BIczN4CP.js → wt-galleria-C3oGpcUO.js} +1 -1
  10. package/dist/{wt-send-message-popup--fi3UrPJ.js → wt-send-message-popup-B-nGWr7E.js} +2 -2
  11. package/dist/{wt-table-Cy3TfK4i.js → wt-table-BAmMqyti.js} +1 -1
  12. package/dist/{wt-type-extension-value-input-DOivJ4hj.js → wt-type-extension-value-input-CGsB_7Nc.js} +2 -2
  13. package/dist/{wt-vidstack-player-D-W9J2CY.js → wt-vidstack-player-CGsUsqeG.js} +1 -1
  14. package/package.json +4 -4
  15. package/src/components/_internals/composables/useSelect/types.ts +1 -0
  16. package/src/components/_internals/composables/useSelect/useSelect.ts +2 -0
  17. package/src/components/_internals/composables/useSelect/useSelectDropdown.ts +5 -1
  18. package/src/components/_internals/composables/useSelect/useSelectOptions.ts +5 -0
  19. package/src/components/wt-single-select/__tests__/WtSingleSelect.spec.js +44 -0
  20. package/types/.tsbuildinfo +1 -1
  21. package/types/components/_internals/composables/useSelect/types.d.ts +1 -0
  22. package/types/components/_internals/composables/useSelect/useSelectDropdown.d.ts +1 -1
  23. package/types/components/_internals/composables/useSelect/useSelectOptions.d.ts +1 -0
@@ -1,4 +1,4 @@
1
- import "./components-BaLs0ZtL.js";
1
+ import "./components-D1ukd_PU.js";
2
2
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { E as t, h as n } from "./enums-CKer6GJR.js";
4
4
  import { t as r } from "./wt-button-DnbIcGvU.js";
@@ -1,5 +1,5 @@
1
1
  import { n as e } from "./utils-zi9lfi8f.js";
2
- import { C as t, i as n } from "./components-BaLs0ZtL.js";
2
+ import { C as t, i as n } from "./components-D1ukd_PU.js";
3
3
  import { t as r } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { Fragment as i, computed as a, createCommentVNode as o, createElementBlock as s, createTextVNode as c, createVNode as l, defineComponent as u, openBlock as d, renderList as f, renderSlot as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
5
5
  //#region src/components/on-demand/wt-display-chip-items/wt-display-chip-items.vue?vue&type=script&setup=true&lang.ts
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { h as t } from "./enums-CKer6GJR.js";
3
3
  import { t as n } from "./useExpansion-DVdIpoOn.js";
4
- import "./composables-BeyROIj_.js";
4
+ import "./composables-Cy5nWaAF.js";
5
5
  import { t as r } from "./wt-expand-transition-C2p9bR4j.js";
6
6
  import { createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, guardReactiveProps as c, normalizeClass as l, normalizeProps as u, openBlock as d, renderSlot as f, resolveComponent as p, toRef as m, unref as h, vShow as g, withCtx as _, withDirectives as v, withKeys as y } from "vue";
7
7
  //#region src/components/wt-expansion-card/wt-expansion-card.vue?vue&type=script&setup=true&lang.ts
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { n as t } from "./vue-i18n-VBiROMZ4.js";
3
- import { a as n, o as r } from "./composables-BeyROIj_.js";
3
+ import { a as n, o as r } from "./composables-Cy5nWaAF.js";
4
4
  import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeModels as p, mergeProps as m, nextTick as h, normalizeClass as g, onMounted as _, onUnmounted as v, openBlock as y, ref as b, renderSlot as x, resolveComponent as S, toDisplayString as C, unref as w, useAttrs as T, useModel as E, vShow as D, watch as O, withCtx as k, withDirectives as A } from "vue";
5
5
  //#region src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup.ts
6
6
  var j = () => {
@@ -1,5 +1,5 @@
1
- import { n as e } from "./components-BaLs0ZtL.js";
2
- import { i as t, r as n } from "./clients-CD7NXpWz.js";
1
+ import { n as e } from "./components-D1ukd_PU.js";
2
+ import { i as t, r as n } from "./clients-BuWrwEVp.js";
3
3
  import "./convertDuration-DZkUGHBR.js";
4
4
  import { n as r } from "./vue-i18n-VBiROMZ4.js";
5
5
  import { n as i } from "./useEventBus-B-ZeklLu.js";
@@ -4,7 +4,7 @@ import { t as n } from "./wt-badge-B3NI2a3-.js";
4
4
  import { n as r } from "./vue-i18n-VBiROMZ4.js";
5
5
  import { n as i, t as a } from "./sortQueryAdapters-Bb1yt_LD.js";
6
6
  import { t as o } from "./wt-icon-btn-8EHSKSxB.js";
7
- import { t as s } from "./composables-BeyROIj_.js";
7
+ import { t as s } from "./composables-Cy5nWaAF.js";
8
8
  import { t as c } from "./wt-popover-BI6YyXy0.js";
9
9
  import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createSlots as h, createTextVNode as g, createVNode as _, defineComponent as v, guardReactiveProps as y, nextTick as b, normalizeClass as x, normalizeProps as S, normalizeStyle as C, onMounted as w, onUnmounted as T, openBlock as E, ref as D, renderList as ee, renderSlot as O, resolveComponent as k, resolveDirective as te, toDisplayString as A, unref as j, useSlots as M, useTemplateRef as ne, withCtx as N, withDirectives as P, withModifiers as F } from "vue";
10
10
  //#region src/components/wt-table/_internals/wt-table-column-filter.vue?vue&type=script&setup=true&lang.ts
@@ -1,7 +1,7 @@
1
1
  import "./dist-EXdgfpvN.js";
2
2
  import { n as e } from "./genClient-CvWlQ0TZ.js";
3
- import { a as t, o as n, r, s as i, w as a } from "./components-BaLs0ZtL.js";
4
- import { n as o, t as s } from "./clients-CD7NXpWz.js";
3
+ import { a as t, o as n, r, s as i, w as a } from "./components-D1ukd_PU.js";
4
+ import { n as o, t as s } from "./clients-BuWrwEVp.js";
5
5
  import { a as c, c as l, i as u, n as d, o as f, p, r as m, s as h, t as g } from "./enums-CKer6GJR.js";
6
6
  import { n as _ } from "./vue-i18n-VBiROMZ4.js";
7
7
  import "./wt-toast-3-3ZylQ9.js";
@@ -1,4 +1,4 @@
1
- import { T as e } from "./components-BaLs0ZtL.js";
1
+ import { T as e } from "./components-D1ukd_PU.js";
2
2
  import "./convertDuration-DZkUGHBR.js";
3
3
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
4
4
  import { h as n } from "./enums-CKer6GJR.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.8.155",
3
+ "version": "26.10.2",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -89,8 +89,8 @@
89
89
  "peerDependencies": {
90
90
  "@vuelidate/core": "^2.0.3",
91
91
  "@vuelidate/validators": "^2.0.4",
92
- "@webitel/api-services": "~26.8",
93
- "@webitel/styleguide": "~26.8",
92
+ "@webitel/api-services": "~26.10",
93
+ "@webitel/styleguide": "~26.10",
94
94
  "axios": "^1.18.1",
95
95
  "date-fns": "^4.1.0",
96
96
  "deep-copy": "^1.4.2",
@@ -144,7 +144,7 @@
144
144
  "@vue/tsconfig": "^0.8.1",
145
145
  "@vuelidate/core": "^2.0.3",
146
146
  "@vuelidate/validators": "^2.0.4",
147
- "@webitel/styleguide": "~26.8",
147
+ "@webitel/styleguide": "~26.10",
148
148
  "autolinker": "^4.1.5",
149
149
  "clipboard-copy": "^4.x",
150
150
  "globals": "^16.0.0",
@@ -40,6 +40,7 @@ export interface UseSelectDropdownParams {
40
40
  filterText: Ref<string>;
41
41
  filterOptions: (value: string) => void;
42
42
  resetAndFetch: (search?: string) => void;
43
+ cancelPendingSearch: () => void;
43
44
  sortOptions: (opts: SelectOption[]) => SelectOption[];
44
45
  fetchOptions: () => void;
45
46
  isLoading: Ref<boolean>;
@@ -35,6 +35,7 @@ export const useSelect = ({
35
35
  fetchOptions,
36
36
  fetchSelectedByIds,
37
37
  resetAndFetch,
38
+ cancelPendingSearch,
38
39
  filterOptionsBase,
39
40
  updateSelectedOptionsCache,
40
41
  } = useSelectOptions({
@@ -64,6 +65,7 @@ export const useSelect = ({
64
65
  filterText,
65
66
  filterOptions: filterOptionsBase,
66
67
  resetAndFetch,
68
+ cancelPendingSearch,
67
69
  sortOptions,
68
70
  fetchOptions,
69
71
  isLoading,
@@ -10,6 +10,7 @@ export const useSelectDropdown = ({
10
10
  filterText,
11
11
  filterOptions,
12
12
  resetAndFetch,
13
+ cancelPendingSearch,
13
14
  sortOptions,
14
15
  fetchOptions,
15
16
  isLoading,
@@ -157,7 +158,10 @@ export const useSelectDropdown = ({
157
158
  remove scroll listener on dropdown close, no need to remove it on unmount
158
159
  */
159
160
  getListContainer()?.removeEventListener('scroll', handleScroll);
160
- if (filterText.value) resetAndFetch();
161
+ if (filterText.value) {
162
+ cancelPendingSearch();
163
+ resetAndFetch();
164
+ }
161
165
  } else {
162
166
  filterOptions('');
163
167
  }
@@ -176,6 +176,10 @@ export const useSelectOptions = ({
176
176
 
177
177
  const debouncedFetch = debounce((value: string) => resetAndFetch(value));
178
178
 
179
+ const cancelPendingSearch = () => {
180
+ debouncedFetch.cancel();
181
+ };
182
+
179
183
  const filterOptionsBase = (value: string) => {
180
184
  filterText.value = value;
181
185
  if (!searchMethod.value) {
@@ -249,6 +253,7 @@ export const useSelectOptions = ({
249
253
  fetchOptions,
250
254
  fetchSelectedByIds,
251
255
  resetAndFetch,
256
+ cancelPendingSearch,
252
257
  filterOptionsBase,
253
258
  updateSelectedOptionsCache,
254
259
  };
@@ -139,4 +139,48 @@ describe('WtSingleSelect', () => {
139
139
  'custom-file.mp3',
140
140
  ]);
141
141
  });
142
+
143
+ it('drops a pending lookup when the dropdown closes after a custom value', async () => {
144
+ vi.useFakeTimers();
145
+ const searchMethod = vi.fn().mockResolvedValue({
146
+ items: [
147
+ {
148
+ id: '1',
149
+ name: 'file.mp3',
150
+ },
151
+ ],
152
+ next: false,
153
+ });
154
+ const wrapper = mount(WtSingleSelect, {
155
+ props: {
156
+ searchMethod,
157
+ },
158
+ global: {
159
+ stubs: {
160
+ Select: {
161
+ name: 'Select',
162
+ template: '<div><slot name="header" /></div>',
163
+ methods: {
164
+ hide() {
165
+ this.$emit('hide');
166
+ },
167
+ },
168
+ },
169
+ },
170
+ },
171
+ });
172
+
173
+ const filter = wrapper.findComponent({
174
+ name: 'wt-input-text',
175
+ });
176
+ await filter.vm.$emit('update:model-value', 'custom-file.mp3');
177
+ await filter.trigger('keydown.enter');
178
+ await vi.advanceTimersByTimeAsync(1000);
179
+
180
+ const searches = searchMethod.mock.calls.map((call) => call[0].search);
181
+ expect(searches).not.toContain('custom-file.mp3');
182
+ expect(searches.at(-1)).toBe('');
183
+
184
+ vi.useRealTimers();
185
+ });
142
186
  });