@webitel/ui-sdk 26.8.148 → 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.
@@ -45,6 +45,7 @@ var w = /* @__PURE__ */ l({
45
45
  default: !1
46
46
  },
47
47
  icon: { default: "" },
48
+ iconColor: {},
48
49
  iconPrefix: { default: "" },
49
50
  badge: {},
50
51
  badgeSeverity: {},
@@ -108,12 +109,17 @@ var w = /* @__PURE__ */ l({
108
109
  ])) : o("", !0),
109
110
  t.icon ? (p(), a(e, {
110
111
  key: 2,
111
- class: f({ "wt-button__icon--hidden": A.value }),
112
+ class: f({
113
+ "wt-button__icon--hidden": A.value,
114
+ "wt-button__icon--custom-color": t.iconColor
115
+ }),
116
+ color: t.iconColor,
112
117
  icon: t.icon,
113
118
  "icon-prefix": t.iconPrefix,
114
119
  size: E[t.size]
115
120
  }, null, 8, [
116
121
  "class",
122
+ "color",
117
123
  "icon",
118
124
  "icon-prefix",
119
125
  "size"
@@ -1,7 +1,7 @@
1
- import "./components-BtmD0hC5.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
- import { t as r } from "./wt-button-DipbKGWn.js";
4
+ import { t as r } from "./wt-button-DnbIcGvU.js";
5
5
  import { n as i } from "./wt-toast-3-3ZylQ9.js";
6
6
  import { Teleport as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createVNode as u, nextTick as d, onBeforeUnmount as f, openBlock as p, ref as m, resolveDirective as h, unref as g, withDirectives as ee } from "vue";
7
7
  //#region node_modules/emoji-picker-element/database.js
@@ -1,4 +1,4 @@
1
- import { C as e, i as t } from "./components-BtmD0hC5.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,7 +1,7 @@
1
1
  import { t as e } from "./wt-icon-B9Yy9aye.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { h as n } from "./enums-CKer6GJR.js";
4
- import { t as r } from "./wt-button-DipbKGWn.js";
4
+ import { t as r } from "./wt-button-DnbIcGvU.js";
5
5
  import { n as i, t as a } from "./useVidstackSrc-aQcqC_v0.js";
6
6
  import { t as o } from "./wt-popover-BI6YyXy0.js";
7
7
  import { t as s } from "./wt-slider-x-Tch7RT.js";
@@ -1,6 +1,6 @@
1
- import { n as e } from "./components-BtmD0hC5.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-Czz3NjJo.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-BtmD0hC5.js";
4
- import { n as o, t as s } from "./clients-Czz3NjJo.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,8 +1,8 @@
1
- import { T as e } from "./components-BtmD0hC5.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";
5
- import "./wt-button-DipbKGWn.js";
5
+ import "./wt-button-DnbIcGvU.js";
6
6
  import { t as r } from "./wt-icon-btn-8EHSKSxB.js";
7
7
  import { $ as i, C as a, D as o, F as s, G as c, H as l, I as u, J as d, K as f, L as p, M as m, N as h, O as g, P as ee, Q as _, R as te, S as v, U as ne, V as y, W as b, X as x, Y as re, Z as S, _ as C, a as ie, b as ae, c as oe, d as se, et as ce, f as le, g as ue, h as de, i as w, it as fe, j as pe, k as me, l as T, m as he, n as E, nt as D, o as O, ot as ge, p as k, q as A, r as j, rt as _e, t as ve, tt as ye, u as be, v as M, w as xe, y as Se, z as Ce } from "./vidstack-D9mvYVIz-DesuYgKV.js";
8
8
  import { _ as N, a as we, c as Te, d as Ee, f as De, g as Oe, h as ke, i as Ae, l as je, m as Me, n as Ne, o as Pe, p as Fe, r as Ie, s as Le, t as P, u as Re } from "./vidstack-CgfrU1hS-CNTJkyzm.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.8.148",
3
+ "version": "26.8.150",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -43,7 +43,11 @@
43
43
 
44
44
  <wt-icon
45
45
  v-if="icon"
46
- :class="{ 'wt-button__icon--hidden': showLoader }"
46
+ :class="{
47
+ 'wt-button__icon--hidden': showLoader,
48
+ 'wt-button__icon--custom-color': iconColor,
49
+ }"
50
+ :color="iconColor"
47
51
  :icon="icon"
48
52
  :icon-prefix="iconPrefix"
49
53
  :size="iconButtonSizeMap[size]"
@@ -56,7 +60,12 @@
56
60
  import type { ButtonProps } from 'primevue';
57
61
  import { computed, inject, ref, toRef, useAttrs, watch } from 'vue';
58
62
 
59
- import { ButtonColor, ButtonVariant, ComponentSize } from '../../enums';
63
+ import {
64
+ ButtonColor,
65
+ ButtonVariant,
66
+ ComponentSize,
67
+ type IconColor,
68
+ } from '../../enums';
60
69
  import type { BadgeSeverity } from '../wt-badge-new/types/WtBadge';
61
70
  import WtBadge from '../wt-badge-new/wt-badge.vue';
62
71
  import WtIcon from '../wt-icon/wt-icon.vue';
@@ -81,6 +90,10 @@ interface WtButtonProps extends /* @vue-ignore */ ButtonProps {
81
90
  wide?: boolean;
82
91
  widthByContent?: boolean;
83
92
  icon?: string;
93
+ /**
94
+ * Overrides icon color; by default color is derived from button color/variant
95
+ */
96
+ iconColor?: IconColor;
84
97
  iconPrefix?: string;
85
98
  badge?: string;
86
99
  badgeSeverity?: BadgeSeverity;
@@ -165,6 +178,14 @@ watch(
165
178
  opacity: 0;
166
179
  }
167
180
 
181
+ /*
182
+ Theme sets svg fill by button color; let the explicit iconColor
183
+ (set on .wt-icon) win. Disabled state keeps theme color.
184
+ */
185
+ .p-button:not(:disabled) .wt-button__icon--custom-color svg {
186
+ fill: inherit !important;
187
+ }
188
+
168
189
  .wt-badge.wt-badge--absolute {
169
190
  position: absolute;
170
191
  top: 0;
@@ -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>
@@ -197,13 +197,13 @@ const button = {
197
197
  background: transparent;
198
198
  outline-offset: -1px;
199
199
  }
200
- .p-button--icon-${ComponentSize.XS} {
200
+ .p-button.p-button--icon-${ComponentSize.XS} {
201
201
  padding: ${dt('button.icon.xs.padding')};
202
202
  }
203
- .p-button--icon-${ComponentSize.SM} {
203
+ .p-button.p-button--icon-${ComponentSize.SM} {
204
204
  padding: ${dt('button.icon.sm.padding')};
205
205
  }
206
- .p-button--icon-${ComponentSize.MD} {
206
+ .p-button.p-button--icon-${ComponentSize.MD} {
207
207
  padding: ${dt('button.icon.md.padding')};
208
208
  }
209
209
  .p-button--icon-active:disabled svg {