@webitel/ui-sdk 26.6.43 → 26.6.45

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.
@@ -0,0 +1,134 @@
1
+ import { t as e } from "./wt-icon-pxO7IjwV.js";
2
+ import { c as t, d as n, u as r } from "./enums-pbYAJNeb.js";
3
+ import { computed as i, createBlock as a, createCommentVNode as o, createElementVNode as s, createTextVNode as c, defineComponent as l, inject as u, mergeProps as d, normalizeClass as f, openBlock as p, ref as m, renderSlot as h, resolveComponent as g, toDisplayString as _, toRef as v, unref as y, useAttrs as b, watch as x, withCtx as S, withModifiers as C } from "vue";
4
+ //#endregion
5
+ //#region src/components/wt-badge-new/wt-badge.vue
6
+ var w = /* @__PURE__ */ l({
7
+ __name: "wt-badge",
8
+ props: {
9
+ value: { default: "" },
10
+ severity: { default: null },
11
+ size: { default: t.MD }
12
+ },
13
+ setup(e) {
14
+ let t = e;
15
+ return (e, n) => {
16
+ let r = g("p-badge");
17
+ return p(), a(r, {
18
+ value: t.value,
19
+ class: f([[t.size && `p-badge--${t.size}`, t.severity && `p-badge--${t.severity}`], "wt-badge typo-caption"])
20
+ }, {
21
+ default: S(() => [h(e.$slots, "default")], void 0, !0),
22
+ _: 3
23
+ }, 8, ["value", "class"]);
24
+ };
25
+ }
26
+ }), T = { class: "wt-button__contents" }, E = /* @__PURE__ */ l({
27
+ __name: "wt-button",
28
+ props: {
29
+ color: { default: n.PRIMARY },
30
+ disabled: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ loading: {
35
+ type: Boolean,
36
+ default: !1
37
+ },
38
+ size: { default: t.MD },
39
+ wide: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
43
+ widthByContent: {
44
+ type: Boolean,
45
+ default: !1
46
+ },
47
+ icon: { default: "" },
48
+ iconPrefix: { default: "" },
49
+ badge: {},
50
+ badgeSeverity: {},
51
+ badgeAbsolutePosition: { type: Boolean },
52
+ variant: { default: r.ACTIVE }
53
+ },
54
+ emits: ["click"],
55
+ setup(n, { emit: r }) {
56
+ let l = {
57
+ [t.XS]: "extra-small",
58
+ [t.SM]: "small",
59
+ [t.MD]: "medium"
60
+ }, E = {
61
+ [t.XS]: "sm",
62
+ [t.SM]: "sm",
63
+ [t.MD]: "md"
64
+ }, D = n, O = r, k = b(), A = m(!1), j = i(() => ({ "wt-badge--absolute": D.badgeAbsolutePosition })), M = v(u("darkMode")), N = i(() => M.value ? "on-dark" : "on-light");
65
+ return x(() => D.loading, (e) => {
66
+ e ? A.value = !0 : setTimeout(() => {
67
+ A.value = e;
68
+ }, 1e3);
69
+ }, { immediate: !0 }), (r, i) => {
70
+ let u = g("wt-loader"), m = g("p-button");
71
+ return p(), a(m, d(y(k), {
72
+ class: [{
73
+ "p-button--width-by-content": n.widthByContent || n.icon,
74
+ "p-button--wide": n.wide,
75
+ "p-button--with-badge": D.badge,
76
+ "p-button--loading": A.value,
77
+ "p-button--icon": n.icon,
78
+ [`p-button--size-${n.size}`]: !0,
79
+ [`p-button--icon-${n.variant} p-button--icon-${n.size}`]: n.icon
80
+ }, "wt-button typo-button typo-button"],
81
+ disabled: n.disabled,
82
+ loading: A.value,
83
+ severity: n.color,
84
+ size: l[n.size],
85
+ variant: n.variant
86
+ }, { onClick: i[0] ||= C((e) => O("click", e), ["prevent"]) }), {
87
+ default: S(() => [A.value ? (p(), a(u, {
88
+ key: 0,
89
+ color: N.value,
90
+ size: "sm"
91
+ }, null, 8, ["color"])) : o("", !0), s("div", T, [
92
+ n.icon ? o("", !0) : h(r.$slots, "default", { key: 0 }, () => [i[1] ||= c(" no content provided", -1)]),
93
+ D.badge ? (p(), a(w, {
94
+ key: 1,
95
+ value: D.badge,
96
+ severity: D.badgeSeverity,
97
+ class: f(j.value),
98
+ size: y(t).MD
99
+ }, {
100
+ default: S(() => [h(r.$slots, "badge", {}, () => [c(_(D.badge), 1)])]),
101
+ _: 3
102
+ }, 8, [
103
+ "value",
104
+ "severity",
105
+ "class",
106
+ "size"
107
+ ])) : o("", !0),
108
+ n.icon ? (p(), a(e, {
109
+ key: 2,
110
+ class: f({ "wt-button__icon--hidden": A.value }),
111
+ icon: n.icon,
112
+ "icon-prefix": n.iconPrefix,
113
+ size: E[n.size]
114
+ }, null, 8, [
115
+ "class",
116
+ "icon",
117
+ "icon-prefix",
118
+ "size"
119
+ ])) : o("", !0)
120
+ ])], void 0, !0),
121
+ _: 3
122
+ }, 16, [
123
+ "class",
124
+ "disabled",
125
+ "loading",
126
+ "severity",
127
+ "size",
128
+ "variant"
129
+ ]);
130
+ };
131
+ }
132
+ });
133
+ //#endregion
134
+ export { w as n, E as t };
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./chunk-CY3AvKd6.js";
2
2
  import { n as t, t as n } from "./dist-BYiYpK00.js";
3
- import "./components-XaNw-CXF.js";
3
+ import "./components-Z7U49tas.js";
4
4
  import { t as r } from "./_plugin-vue_export-helper-B3ysoDQm.js";
5
5
  import { c as i } from "./enums-pbYAJNeb.js";
6
- import { t as a } from "./wt-button-DENbrKdy.js";
6
+ import { t as a } from "./wt-button-BJmzJIU6.js";
7
7
  import "./sortQueryAdapters-CyYXvnDN.js";
8
8
  import { t as o } from "./isObject-Dgs_L5xI.js";
9
9
  import { a as s, i as c, n as l, o as u, r as d, s as f } from "./debounce-DrmECuJ2.js";
@@ -1,4 +1,4 @@
1
- import { c as e, i as t } from "./components-XaNw-CXF.js";
1
+ import { c as e, i as t } from "./components-Z7U49tas.js";
2
2
  import { t as n } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { t as r } from "./displayText-CtaxzaBz.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 "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { c as t } from "./enums-pbYAJNeb.js";
3
3
  import { t as n } from "./useExpansion-DVdIpoOn.js";
4
- import "./composables-DJxQeK6R.js";
4
+ import "./composables-C5OKo5yW.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 { t } from "./vue-i18n-B8Px6VcD.js";
3
- import { a as n, o as r } from "./composables-DJxQeK6R.js";
3
+ import { a as n, o as r } from "./composables-C5OKo5yW.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.js
6
6
  var j = () => {
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./wt-icon-pxO7IjwV.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { c as n } from "./enums-pbYAJNeb.js";
4
- import { t as r } from "./wt-button-DENbrKdy.js";
4
+ import { t as r } from "./wt-button-BJmzJIU6.js";
5
5
  import { n as i, t as a } from "./useVidstackSrc-DfNrFbOO.js";
6
6
  import { t as o } from "./wt-popover-CJZH3wMl.js";
7
7
  import { t as s } from "./wt-slider-BS3SoGht.js";
@@ -1,4 +1,4 @@
1
- import { n as e } from "./components-XaNw-CXF.js";
1
+ import { n as e } from "./components-Z7U49tas.js";
2
2
  import { t } from "./vue-i18n-B8Px6VcD.js";
3
3
  import { n, r } from "./clients-aQCH0OHp.js";
4
4
  import { createBlock as i, createTextVNode as a, createVNode as o, defineComponent as s, inject 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 { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
2
2
  import { t } from "./vue-i18n-B8Px6VcD.js";
3
3
  import { n, t as r } from "./sortQueryAdapters-CyYXvnDN.js";
4
- import { t as i } from "./composables-DJxQeK6R.js";
4
+ import { t as i } from "./composables-C5OKo5yW.js";
5
5
  import { Fragment as ee, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createSlots as u, createTextVNode as d, createVNode as f, defineComponent as p, nextTick as m, normalizeStyle as h, onMounted as g, onUnmounted as _, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveComponent as S, resolveDirective as C, toDisplayString as w, useSlots as T, useTemplateRef as E, withCtx as D, withDirectives as O, withModifiers as k } from "vue";
6
6
  //#region src/components/wt-table/wt-table.vue?vue&type=script&setup=true&lang.ts
7
7
  var A = { class: "wt-table__th__content typo-body-1-bold" }, j = { class: "wt-table__td__actions" }, M = 10, N = /*#__PURE__*/ e(/* @__PURE__ */ p({
@@ -1,4 +1,4 @@
1
- import { a as e, o as t, r as n, s as r } from "./components-XaNw-CXF.js";
1
+ import { a as e, o as t, r as n, s as r } from "./components-Z7U49tas.js";
2
2
  import { t as i } from "./enums-pbYAJNeb.js";
3
3
  import { t as a } from "./vue-i18n-B8Px6VcD.js";
4
4
  import { t as o } from "./clients-aQCH0OHp.js";
@@ -1,7 +1,7 @@
1
- import { l as e } from "./components-XaNw-CXF.js";
1
+ import { l as e } from "./components-Z7U49tas.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { c as n } from "./enums-pbYAJNeb.js";
4
- import "./wt-button-DENbrKdy.js";
4
+ import "./wt-button-BJmzJIU6.js";
5
5
  import { t as r } from "./wt-icon-btn-CjjI4cgE.js";
6
6
  import { $ as i, A as a, B as o, C as s, F as c, G as l, H as u, I as d, J as f, K as p, L as m, M as h, N as g, O as ee, P as te, Q as _, R as ne, T as re, U as v, W as ie, X as ae, Y as oe, Z as y, _ as b, a as se, at as ce, b as le, c as ue, d as de, et as x, f as fe, g as pe, h as me, i as S, it as he, k as ge, l as C, m as _e, n as w, nt as ve, o as T, p as E, q as D, r as O, rt as k, st as ye, t as be, tt as xe, u as Se, v as A, w as j, x as Ce, y as we, z as Te } from "./vidstack-BGSTndAW-CyKM_CM4.js";
7
7
  import { _ as Ee, a as De, c as Oe, f as ke, g as Ae, h as je, i as Me, l as Ne, n as Pe, r as Fe, s as Ie, t as Le, u as Re, v as ze, x as Be, y as Ve } from "./useVidstackSrc-DfNrFbOO.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.6.43",
3
+ "version": "26.6.45",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -110,14 +110,16 @@ export const useSelectOptions = ({
110
110
  search,
111
111
  page,
112
112
  });
113
+ const matchingCached = search
114
+ ? selectedOptionsCache.value.filter((option) =>
115
+ getOptionLabel(option).toLowerCase().includes(search.toLowerCase()),
116
+ )
117
+ : selectedOptionsCache.value;
113
118
  const baseOptions =
114
119
  searchParams.page === 1
115
120
  ? dedupeByKey(
116
121
  [
117
- ...(!allowCustomValues.value ? selectedOptionsCache.value : []),
118
- ...toArray(selected.value).filter(
119
- (s) => s != null && typeof s === 'object',
120
- ),
122
+ ...matchingCached,
121
123
  ...items,
122
124
  ],
123
125
  dataKey.value,
@@ -146,7 +148,6 @@ export const useSelectOptions = ({
146
148
  filteredOptions.value = sortOptions(
147
149
  dedupeByKey(
148
150
  [
149
- ...(!allowCustomValues.value ? selectedOptionsCache.value : []),
150
151
  ...matchingOptions,
151
152
  ],
152
153
  dataKey.value,
@@ -53,8 +53,7 @@
53
53
 
54
54
  <script lang="ts" setup>
55
55
  import type { ButtonProps } from 'primevue';
56
- import { computed, inject, ref, useAttrs, watch } from 'vue';
57
- import { useStore } from 'vuex';
56
+ import { computed, inject, toRef, ref, useAttrs, watch } from 'vue';
58
57
 
59
58
  import { ButtonColor, ButtonVariant, ComponentSize } from '../../enums';
60
59
  import WtBadge from '../wt-badge-new/wt-badge.vue';
@@ -111,28 +110,7 @@ const badgeClass = computed(() => ({
111
110
  'wt-badge--absolute': props.badgeAbsolutePosition,
112
111
  }));
113
112
 
114
- // @Ler24
115
- // Compatibility mode for Vuex (old mode) and when there is no Vuex in project (new mode)
116
- let store = null;
117
- try {
118
- store = useStore();
119
- } catch {
120
- store = null;
121
- }
122
-
123
- const injectDarkMode = inject('darkMode');
124
-
125
- const darkMode = computed(() => {
126
- if (injectDarkMode?.value) {
127
- return injectDarkMode.value;
128
- }
129
-
130
- if (store?.getters) {
131
- return store.getters['appearance/DARK_MODE'] ?? false;
132
- }
133
-
134
- return false;
135
- });
113
+ const darkMode = toRef(inject<boolean>('darkMode'));
136
114
 
137
115
  /**
138
116
  * @author: @Opelsandr Palonnyi
@@ -22,6 +22,7 @@
22
22
  :id="selectId"
23
23
  :show-clear="showClear"
24
24
  :focus-on-hover="false"
25
+ :auto-option-focus="true"
25
26
  :disabled="disabled"
26
27
  :placeholder="placeholder || label"
27
28
  :option-disabled="() => disabledOptions"
@@ -45,6 +46,17 @@
45
46
  @show="onDropdownShow"
46
47
  @hide="onDropdownHide"
47
48
  >
49
+ <template v-if="!chipsView" #value="{ value, placeholder }">
50
+ <span v-if="value && value.length">
51
+ <template v-if="value.length > MAX_SELECTED_LABELS">
52
+ {{ value.length }} {{ t('webitelUI.select.selectedItemsLabel') }}
53
+ </template>
54
+ <template v-else>
55
+ {{ value.map((v) => getOptionLabel(v)).join(', ') }}
56
+ </template>
57
+ </span>
58
+ <span v-else class="p-placeholder">{{ placeholder }}</span>
59
+ </template>
48
60
  <template #header>
49
61
  <wt-input-text
50
62
  v-if="filterable"
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="wt-single-select">
2
+ <div class="wt-single-select" :class="{ 'wt-single-select--has-value': model }">
3
3
  <wt-label
4
4
  v-if="hasLabel"
5
5
  :disabled="disabled"
@@ -235,6 +235,17 @@ onMounted(() => {
235
235
  min-width: 0;
236
236
  }
237
237
 
238
+ /*
239
+ @author @HlukhovYe
240
+
241
+ PrimeVue applies data-p="placeholder" to the label span when the selected item
242
+ is not found in visibleOptions (e.g. during search). Override the placeholder
243
+ color since our #value slot renders the correct label from the model directly.
244
+ */
245
+ .wt-single-select--has-value :deep(.p-select-label[data-p~='placeholder']) {
246
+ color: inherit;
247
+ }
248
+
238
249
  .wt-single-select__option-label {
239
250
  user-select: none;
240
251
  }
@@ -1,7 +1,6 @@
1
1
  import deepmerge from 'deepmerge';
2
- import { computed, inject } from 'vue';
2
+ import { computed, inject, toRef } from 'vue';
3
3
  import { useI18n } from 'vue-i18n';
4
- import { useStore } from 'vuex';
5
4
 
6
5
  import { EmptyCause } from '../../../enums/index';
7
6
  import { isEmpty } from '../../../scripts/index.js';
@@ -14,7 +13,6 @@ export const useTableEmpty = (
14
13
  { dataList, filters, error, isLoading },
15
14
  overrides = {},
16
15
  ) => {
17
- const store = useStore();
18
16
  const { t } = useI18n();
19
17
 
20
18
  // use computed, so that at locale change, texts will be updated too
@@ -62,17 +60,7 @@ export const useTableEmpty = (
62
60
 
63
61
  const merged = computed(() => deepmerge(defaults.value, overrides));
64
62
 
65
- let darkMode = computed(() => false);
66
-
67
- try {
68
- darkMode = inject('darkMode');
69
- } catch {
70
- try {
71
- darkMode = computed(() => store.getters['appearance/DARK_MODE']);
72
- } catch {
73
- console.warn('"darkMode" value not found, using "false" as default');
74
- }
75
- }
63
+ const darkMode = toRef(inject('darkMode'));
76
64
 
77
65
  const emptyState = computed(() => {
78
66
  return !isLoading?.value && !error?.value && !dataList?.value?.length;