@webitel/ui-sdk 26.8.149 → 26.8.150

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.
@@ -1,4 +1,4 @@
1
- import "./components-BQNe8f-D.js";
1
+ import "./components-7m-8aZmi.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,4 +1,4 @@
1
- import { C as e, i as t } from "./components-BQNe8f-D.js";
1
+ import { C as e, i as t } from "./components-7m-8aZmi.js";
2
2
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { t as r } from "./utils-DQQQIpjz.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";
@@ -1,6 +1,6 @@
1
- import { n as e } from "./components-BQNe8f-D.js";
1
+ import { n as e } from "./components-7m-8aZmi.js";
2
2
  import "./convertDuration-CIPonKKW.js";
3
- import { i as t, r as n } from "./clients-CvTW64Rq.js";
3
+ import { i as t, r as n } from "./clients-x0gCJQbb.js";
4
4
  import { n as r } from "./vue-i18n-VBiROMZ4.js";
5
5
  import { n as i } from "./useEventBus-B-ZeklLu.js";
6
6
  import { createBlock as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeProps as l, onMounted as u, openBlock as d, ref as f, resolveComponent as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
@@ -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-BQNe8f-D.js";
4
- import { n as o, t as s } from "./clients-CvTW64Rq.js";
3
+ import { a as t, o as n, r, s as i, w as a } from "./components-7m-8aZmi.js";
4
+ import { n as o, t as s } from "./clients-x0gCJQbb.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-BQNe8f-D.js";
1
+ import { T as e } from "./components-7m-8aZmi.js";
2
2
  import "./convertDuration-CIPonKKW.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.149",
3
+ "version": "26.8.150",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -114,4 +114,29 @@ describe('WtSingleSelect', () => {
114
114
  .vm.$emit('hide');
115
115
  expect(wrapper.emitted().hide).toBeTruthy();
116
116
  });
117
+
118
+ it('emits the filter text on search and on Enter', async () => {
119
+ const wrapper = mount(WtSingleSelect, {
120
+ global: {
121
+ stubs: {
122
+ Select: {
123
+ name: 'Select',
124
+ template: '<div><slot name="header" /></div>',
125
+ },
126
+ },
127
+ },
128
+ });
129
+ const filter = wrapper.findComponent({
130
+ name: 'wt-input-text',
131
+ });
132
+ await filter.vm.$emit('update:model-value', 'custom-file.mp3');
133
+ expect(wrapper.emitted('search-change')?.at(-1)).toEqual([
134
+ 'custom-file.mp3',
135
+ ]);
136
+
137
+ await filter.trigger('keydown.enter');
138
+ expect(wrapper.emitted('search-enter')?.at(-1)).toEqual([
139
+ 'custom-file.mp3',
140
+ ]);
141
+ });
117
142
  });
@@ -46,8 +46,8 @@
46
46
  class="wt-single-select__input"
47
47
  :model-value="filterText"
48
48
  :size="ComponentSize.SM"
49
- @update:model-value="filterOptions($event)"
50
- @keydown.enter.stop="onInputKeydown"
49
+ @update:model-value="onFilterModelUpdate"
50
+ @keydown.enter.stop.prevent="onFilterEnter"
51
51
  >
52
52
  <template #suffix>
53
53
  <wt-icon v-if="allowCustomValues && filterText" disabled icon="select-custom-value-enter" />
@@ -194,6 +194,12 @@ const model = defineModel<string>({
194
194
  const emit = defineEmits<{
195
195
  reset: [];
196
196
  hide: [];
197
+ 'search-change': [
198
+ value: string,
199
+ ];
200
+ 'search-enter': [
201
+ value: string,
202
+ ];
197
203
  }>();
198
204
 
199
205
  const selectId = `select-${Math.random().toString(36).slice(2, 11)}`;
@@ -257,6 +263,18 @@ const handleDropdownHide = () => {
257
263
  onDropdownHide();
258
264
  emit('hide');
259
265
  };
266
+
267
+ const onFilterModelUpdate = (value: string) => {
268
+ const text = value ?? '';
269
+ filterOptions(text);
270
+ emit('search-change', text);
271
+ };
272
+
273
+ const onFilterEnter = () => {
274
+ emit('search-enter', filterText.value);
275
+ onInputKeydown();
276
+ selectRef.value?.hide?.();
277
+ };
260
278
  </script>
261
279
 
262
280
  <style scoped>