@webitel/ui-sdk 26.8.98 → 26.8.100

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 (46) hide show
  1. package/dist/{clients-D7xoQatS.js → clients-ClR-VL_c.js} +24 -28
  2. package/dist/{components-Bbzj_P4l.js → components-CB2t5ag8.js} +2865 -1055
  3. package/dist/convertDuration-CGW5IDMW.js +89 -0
  4. package/dist/{enums-B_9ZBu01.js → enums-Bd-8yrmg.js} +30 -30
  5. package/dist/ui-sdk.css +1 -1
  6. package/dist/ui-sdk.js +15 -15
  7. package/dist/ui-sdk.umd.cjs +380 -380
  8. package/dist/{useValidation-Dmm2xos_.js → useValidation-CtEfmUkB.js} +1 -1
  9. package/dist/utils-B_8uwL9P.js +4 -0
  10. package/dist/{wt-action-bar-BpuER6TA.js → wt-action-bar-B4rcG26w.js} +2 -2
  11. package/dist/{wt-badge-tosjsmJU.js → wt-badge-lFnfK2an.js} +1 -1
  12. package/dist/{wt-button-CNQAK85M.js → wt-button-BzYDkfhK.js} +17 -17
  13. package/dist/{wt-chat-emoji-CEagxzmF.js → wt-chat-emoji-DwGl685x.js} +4 -4
  14. package/dist/{wt-datepicker-BS3przUJ.js → wt-datepicker-D_O49-Ab.js} +43 -43
  15. package/dist/{wt-display-chip-items-DaoXxPnn.js → wt-display-chip-items-_VHRHB6L.js} +2 -2
  16. package/dist/{wt-dual-panel-Cs_Yzfxt.js → wt-dual-panel-B0inNxRm.js} +1 -1
  17. package/dist/{wt-expansion-card-8YzHs8F1.js → wt-expansion-card-CJjtuFDk.js} +1 -1
  18. package/dist/{wt-expansion-panel-kZmHSvPU.js → wt-expansion-panel-tqCCM3go.js} +1 -1
  19. package/dist/{wt-icon-ClDNfV5I.js → wt-icon-DFtSR4bO.js} +1 -1
  20. package/dist/{wt-icon-action-B8vuj9cC.js → wt-icon-action-DUAnoMrj.js} +1 -1
  21. package/dist/{wt-icon-btn-DDElLZil.js → wt-icon-btn-CeGGT2PO.js} +1 -1
  22. package/dist/{wt-notifications-bar-DZidZ2VZ.js → wt-notifications-bar-DWME3pmb.js} +2 -2
  23. package/dist/{wt-player-CxMTs3eF.js → wt-player-DXCQLKch.js} +3 -3
  24. package/dist/{wt-screen-recordings-action-BTtZq2BR.js → wt-screen-recordings-action-Cx7-2gDE.js} +1 -1
  25. package/dist/{wt-search-bar-CE4WhuJ6.js → wt-search-bar-BkopW1qp.js} +1 -1
  26. package/dist/{wt-send-message-popup-DlNzrav9.js → wt-send-message-popup-Dl-FeGOx.js} +13 -12
  27. package/dist/{wt-status-select-CDt8sZr9.js → wt-status-select-DnaJ04Gw.js} +12 -12
  28. package/dist/{wt-table-DHpnLu_f.js → wt-table-xmGhfp4p.js} +3 -3
  29. package/dist/{wt-timepicker-D-tnO-gX.js → wt-timepicker-C0DHJSeR.js} +2 -2
  30. package/dist/{wt-toast-DKjRJFE2.js → wt-toast-Lge1Y6IO.js} +10 -10
  31. package/dist/{wt-tree-table-DDH6vMh7.js → wt-tree-table-BTHxl_MY.js} +1 -1
  32. package/dist/{wt-type-extension-value-input-LfOZd5LP.js → wt-type-extension-value-input-Cd0towde.js} +17 -17
  33. package/dist/{wt-vidstack-player-DwrfsR41.js → wt-vidstack-player-IfN1Nbyd.js} +5 -4
  34. package/package.json +1 -1
  35. package/src/components/wt-input-text/__tests__/WtInputText.spec.js +29 -6
  36. package/src/components/wt-input-text/wt-input-text.vue +12 -2
  37. package/src/enums/FormatDateMode/FormatDateMode.ts +1 -10
  38. package/src/scripts/convertDuration.js +1 -13
  39. package/src/utils/formatDate.ts +1 -37
  40. package/types/.tsbuildinfo +1 -1
  41. package/types/components/wt-input-text/wt-input-text.vue.d.ts +4 -2
  42. package/types/enums/FormatDateMode/FormatDateMode.d.ts +1 -8
  43. package/types/scripts/convertDuration.d.ts +1 -1
  44. package/types/utils/formatDate.d.ts +1 -4
  45. package/dist/convertDuration-1K7fuEpO.js +0 -8
  46. package/dist/utils-DReAiJBV.js +0 -1902
@@ -1,6 +1,6 @@
1
- import { t as e } from "./clients-D7xoQatS.js";
2
- import { a as t, o as n, r, s as i } from "./components-Bbzj_P4l.js";
3
- import { t as a } from "./enums-B_9ZBu01.js";
1
+ import { a as e, o as t, r as n, s as r } from "./components-CB2t5ag8.js";
2
+ import { t as i } from "./clients-ClR-VL_c.js";
3
+ import { t as a } from "./enums-Bd-8yrmg.js";
4
4
  import { t as o } from "./vue-i18n-B88GcHzn.js";
5
5
  import { computed as s, createBlock as c, createCommentVNode as l, createVNode as u, defineComponent as d, mergeModels as f, mergeProps as p, openBlock as m, renderSlot as h, resolveComponent as g, unref as _, useModel as v } from "vue";
6
6
  //#endregion
@@ -34,11 +34,11 @@ var y = /* @__PURE__ */ d({
34
34
  searchMethod: O(y.field.lookup)
35
35
  })), E = s(() => ({ ...T.value })), D = (e) => {
36
36
  f.value = e;
37
- }, O = ({ path: t = "", display: n = "", primary: r = "" } = {}) => (i) => e.getLookup({
38
- ...i,
39
- path: t,
40
- display: n,
41
- primary: r
37
+ }, O = ({ path: e = "", display: t = "", primary: n = "" } = {}) => (r) => i.getLookup({
38
+ ...r,
39
+ path: e,
40
+ display: t,
41
+ primary: n
42
42
  }), k = (e) => {
43
43
  let t = e ?? {};
44
44
  if (Object.values(t).length === 0) return D(null);
@@ -52,7 +52,7 @@ var y = /* @__PURE__ */ d({
52
52
  name: e.name
53
53
  })));
54
54
  };
55
- return (e, o) => {
55
+ return (i, o) => {
56
56
  let s = g("wt-input-text"), f = g("wt-input-number");
57
57
  return d.field.kind === _(a).Text ? (m(), c(s, p({ key: 0 }, w.value, {
58
58
  "model-value": C.value,
@@ -60,44 +60,44 @@ var y = /* @__PURE__ */ d({
60
60
  }), null, 16, ["model-value"])) : d.field.kind === _(a).Number ? (m(), c(f, p({ key: 1 }, w.value, {
61
61
  "model-value": C.value,
62
62
  "onUpdate:modelValue": D
63
- }), null, 16, ["model-value"])) : d.field.kind === _(a).Boolean ? h(e.$slots, _(a).Boolean, {
63
+ }), null, 16, ["model-value"])) : d.field.kind === _(a).Boolean ? h(i.$slots, _(a).Boolean, {
64
64
  key: 2,
65
65
  defaultProps: { ...w.value }
66
- }, () => [u(_(t), p(w.value, {
66
+ }, () => [u(_(e), p(w.value, {
67
67
  "model-value": C.value,
68
68
  "onUpdate:modelValue": D
69
- }), null, 16, ["model-value"])]) : d.field.kind === _(a).Select ? h(e.$slots, _(a).Select, {
69
+ }), null, 16, ["model-value"])]) : d.field.kind === _(a).Select ? h(i.$slots, _(a).Select, {
70
70
  key: 3,
71
71
  defaultProps: {
72
72
  ...w.value,
73
73
  ...T.value,
74
74
  value: C.value
75
75
  }
76
- }, () => [u(_(n), p(w.value, {
76
+ }, () => [u(_(t), p(w.value, {
77
77
  "model-value": C.value,
78
78
  "search-method": O(d.field.lookup),
79
79
  "data-key": "id",
80
80
  "onUpdate:modelValue": k
81
- }), null, 16, ["model-value", "search-method"])]) : d.field.kind === _(a).Multiselect ? h(e.$slots, _(a).Multiselect, {
81
+ }), null, 16, ["model-value", "search-method"])]) : d.field.kind === _(a).Multiselect ? h(i.$slots, _(a).Multiselect, {
82
82
  key: 4,
83
83
  defaultProps: {
84
84
  ...w.value,
85
85
  ...E.value,
86
86
  value: C.value
87
87
  }
88
- }, () => [u(_(i), p({
88
+ }, () => [u(_(r), p({
89
89
  ...w.value,
90
90
  ...E.value
91
91
  }, {
92
92
  "model-value": C.value,
93
93
  "onUpdate:modelValue": A
94
- }), null, 16, ["model-value"])]) : d.field.kind === _(a).Calendar ? h(e.$slots, _(a).Calendar, {
94
+ }), null, 16, ["model-value"])]) : d.field.kind === _(a).Calendar ? h(i.$slots, _(a).Calendar, {
95
95
  key: 5,
96
96
  defaultProps: {
97
97
  ...w.value,
98
98
  value: C.value
99
99
  }
100
- }, () => [u(_(r), p(w.value, {
100
+ }, () => [u(_(n), p(w.value, {
101
101
  "model-value": C.value,
102
102
  "show-time": "",
103
103
  "onUpdate:modelValue": D
@@ -1,8 +1,9 @@
1
- import { D as e } from "./components-Bbzj_P4l.js";
1
+ import { w as e } from "./components-CB2t5ag8.js";
2
+ import "./convertDuration-CGW5IDMW.js";
2
3
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
- import { l as n } from "./enums-B_9ZBu01.js";
4
- import "./wt-button-CNQAK85M.js";
5
- import { t as r } from "./wt-icon-btn-DDElLZil.js";
4
+ import { c as n } from "./enums-Bd-8yrmg.js";
5
+ import "./wt-button-BzYDkfhK.js";
6
+ import { t as r } from "./wt-icon-btn-CeGGT2PO.js";
6
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";
7
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";
8
9
  import { _ as ze, a as Be, c as Ve, f as He, g as Ue, h as We, i as Ge, l as Ke, n as qe, r as Je, s as Ye, t as Xe, u as Ze, v as Qe, x as $e, y as et } from "./useVidstackSrc-aQcqC_v0.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.8.98",
3
+ "version": "26.8.100",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -28,32 +28,55 @@ describe('WtInputText', () => {
28
28
  expect(wrapper.find('.wt-label').text()).toBe('Name');
29
29
  });
30
30
 
31
- it('trims the value by default on input', () => {
31
+ it('does not trim the value on input', () => {
32
32
  const wrapper = mount(WtInputText);
33
33
  const input = wrapper.findComponent({
34
34
  name: 'InputText',
35
35
  });
36
36
  input.vm.$emit('update:model-value', ' hello ');
37
37
  expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
38
- 'hello',
38
+ ' hello ',
39
39
  ]);
40
40
  });
41
41
 
42
- it('does not trim the value when preventTrim is true', () => {
42
+ it('trims the value on blur by default', async () => {
43
43
  const wrapper = mount(WtInputText, {
44
44
  props: {
45
- preventTrim: true,
45
+ modelValue: ' hello ',
46
46
  },
47
47
  });
48
48
  const input = wrapper.findComponent({
49
49
  name: 'InputText',
50
50
  });
51
- input.vm.$emit('update:model-value', ' hello ');
51
+ await input.vm.$emit('blur', new Event('blur'));
52
52
  expect(wrapper.emitted()['update:modelValue'][0]).toEqual([
53
- ' hello ',
53
+ 'hello',
54
54
  ]);
55
55
  });
56
56
 
57
+ it('does not trim the value on blur when preventTrim is true', async () => {
58
+ const wrapper = mount(WtInputText, {
59
+ props: {
60
+ modelValue: ' hello ',
61
+ preventTrim: true,
62
+ },
63
+ });
64
+ const input = wrapper.findComponent({
65
+ name: 'InputText',
66
+ });
67
+ await input.vm.$emit('blur', new Event('blur'));
68
+ expect(wrapper.emitted()['update:modelValue']).toBeFalsy();
69
+ });
70
+
71
+ it('emits blur when the underlying input is blurred', async () => {
72
+ const wrapper = mount(WtInputText);
73
+ const input = wrapper.findComponent({
74
+ name: 'InputText',
75
+ });
76
+ await input.vm.$emit('blur', new Event('blur'));
77
+ expect(wrapper.emitted().blur).toBeTruthy();
78
+ });
79
+
57
80
  it('toggles the eye icon and masks the input when hideInputValue is true', async () => {
58
81
  const wrapper = mount(WtInputText, {
59
82
  props: {
@@ -37,6 +37,7 @@
37
37
  @update:model-value="inputHandler"
38
38
  @keyup="handleKeyup"
39
39
  @focus="emit('focus', $event)"
40
+ @blur="handleBlur"
40
41
  />
41
42
  <p-input-group-addon
42
43
  v-if="hideInputValue || $slots.suffix"
@@ -135,6 +136,9 @@ const emit = defineEmits<{
135
136
  focus: [
136
137
  FocusEvent,
137
138
  ];
139
+ blur: [
140
+ FocusEvent,
141
+ ];
138
142
  }>();
139
143
 
140
144
  const slots = useSlots();
@@ -170,8 +174,14 @@ const requiredLabel = computed(() => {
170
174
  });
171
175
 
172
176
  const inputHandler = (value: string) => {
173
- const handledValue = props.preventTrim ? value : value.trim();
174
- model.value = handledValue;
177
+ model.value = value;
178
+ };
179
+
180
+ const handleBlur = (event: FocusEvent) => {
181
+ if (!props.preventTrim && typeof model.value === 'string') {
182
+ model.value = model.value.trim();
183
+ }
184
+ emit('blur', event);
175
185
  };
176
186
 
177
187
  const isValueHidden = ref(props.hideInputValue);
@@ -1,10 +1 @@
1
- export const FormatDateMode = {
2
- DATE: 'date',
3
- TIME: 'time',
4
- TIME_SEC: 'timeSec',
5
- DATETIME: 'datetime',
6
- DATETIME_SHORT: 'datetimeShort',
7
- } as const;
8
-
9
- export type FormatDateMode =
10
- (typeof FormatDateMode)[keyof typeof FormatDateMode];
1
+ export { FormatDateMode } from '@webitel/api-services/enums';
@@ -1,15 +1,3 @@
1
- const convertDuration = (duration) => {
2
- if (!duration) return '00:00:00';
3
-
4
- let hour = `${Math.floor(duration / 3600)}`;
5
- let min = `${Math.floor((duration % 3600) / 60)}`;
6
- let sec = `${Math.floor((duration % 3600) % 60)}`;
7
-
8
- if (hour.length === 1) hour = `0${hour}`;
9
- if (min.length === 1) min = `0${min}`;
10
- if (sec.length === 1) sec = `0${sec}`;
11
-
12
- return `${hour}:${min}:${sec}`;
13
- };
1
+ import { convertDuration } from '@webitel/api-services/scripts';
14
2
 
15
3
  export default convertDuration;
@@ -1,37 +1 @@
1
- import { uk } from 'date-fns/locale';
2
- import { formatInTimeZone } from 'date-fns-tz';
3
-
4
- import type { FormatDateMode } from '../enums';
5
- import { TIMEZONE_STORAGE_KEY } from '../modules/Userinfo/constants/UserSettingsConstants';
6
-
7
- function getUserTimeZone(): string {
8
- return (
9
- localStorage.getItem(TIMEZONE_STORAGE_KEY) ||
10
- Intl.DateTimeFormat().resolvedOptions().timeZone
11
- );
12
- }
13
-
14
- // https://date-fns.org/v4.1.0/docs/format
15
- const formatStringMap = {
16
- date: 'P', // dd.MM.yyyy (13.11.2025)
17
- time: 'p', // HH:mm (15:53)
18
- timeSec: 'pp', // HH:mm:ss (15:53:00)
19
- datetime: 'Ppp', // dd.MM.yyyy, HH:mm:ss (13.11.2025, 15:53:00)
20
- datetimeShort: 'Pp', // dd.MM.yyyy, HH:mm (13.11.2025, 15:53)
21
- };
22
-
23
- export function formatDate(
24
- date: string | number | Date,
25
- to: (typeof FormatDateMode)[keyof typeof FormatDateMode],
26
- {
27
- timezone = undefined,
28
- }: {
29
- timezone?: string;
30
- } = {},
31
- ): string {
32
- const timeZone = timezone ?? getUserTimeZone();
33
-
34
- return formatInTimeZone(date, timeZone, formatStringMap[to], {
35
- locale: uk,
36
- });
37
- }
1
+ export { formatDate } from '@webitel/api-services/utils';