@webitel/ui-sdk 26.6.96 → 26.6.97

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 (55) hide show
  1. package/dist/{components-Bim818Xf.js → components-CSWXogKF.js} +3 -3
  2. package/dist/ui-sdk.css +1 -1
  3. package/dist/ui-sdk.js +1 -1
  4. package/dist/ui-sdk.umd.cjs +382 -382
  5. package/dist/{wt-chat-emoji-CX65m8Dd.js → wt-chat-emoji-Zfe96hoz.js} +1 -1
  6. package/dist/{wt-datepicker-BP9bBbGY.js → wt-datepicker-BtjegGDk.js} +174 -91
  7. package/dist/{wt-display-chip-items-tL17x2-U.js → wt-display-chip-items-YauywYzZ.js} +1 -1
  8. package/dist/{wt-send-message-popup-8TZWTO40.js → wt-send-message-popup-DV1i1Q52.js} +1 -1
  9. package/dist/{wt-type-extension-value-input-D1wNUHkh.js → wt-type-extension-value-input-CpYbzjDU.js} +1 -1
  10. package/dist/{wt-vidstack-player-Z3cdtFBu.js → wt-vidstack-player-CC6dwrnv.js} +1 -1
  11. package/package.json +1 -1
  12. package/src/components/wt-datepicker/_internals/composables/useAutoSeparator.ts +96 -0
  13. package/src/components/wt-datepicker/_internals/composables/useDatepicker.ts +78 -0
  14. package/src/components/wt-datepicker/_internals/composables/usePreventZeroPad.ts +10 -24
  15. package/src/components/wt-datepicker/_internals/composables/useStrictInput.ts +61 -0
  16. package/src/components/wt-datepicker/wt-datepicker.vue +4 -8
  17. package/src/composables/useEventBus/useEventBus.d.ts +4 -4
  18. package/src/enums/BroadcastChannelName/BroadcastChannelName.d.ts +3 -2
  19. package/src/enums/BroadcastChannelName/UserSettingsBroadcastMessage.d.ts +7 -7
  20. package/src/enums/ButtonColor/ButtonColor.d.ts +8 -8
  21. package/src/enums/ButtonVariant/ButtonVariant.d.ts +3 -3
  22. package/src/enums/ChipColor/ChipColor.d.ts +8 -8
  23. package/src/enums/ComponentSize/ComponentSize.d.ts +14 -14
  24. package/src/enums/ConnectionQualityLevel/ConnectionQualityLevel.enum.d.ts +5 -4
  25. package/src/enums/CrudAction/CrudAction.d.ts +4 -4
  26. package/src/enums/DefaultWorkspaceTabSettings/DefaultWorkspaceTabSettings.d.ts +8 -7
  27. package/src/enums/EmptyCause/EmptyCause.d.ts +3 -3
  28. package/src/enums/FormatDateMode/FormatDateMode.d.ts +7 -6
  29. package/src/enums/IconColor/IconColor.d.ts +14 -14
  30. package/src/enums/LoginOptions/LoginOptions.d.ts +3 -3
  31. package/src/enums/MessageColor/MessageColor.d.ts +6 -6
  32. package/src/enums/MessageVariant/MessageVariant.d.ts +3 -3
  33. package/src/enums/MimeTypes/MimeTypes.enum.d.ts +14 -14
  34. package/src/enums/ProcessingTableColumnType/ProcessingTableColumnType.d.ts +7 -6
  35. package/src/enums/QueueType/QueueType.enum.d.ts +22 -22
  36. package/src/enums/RelativeDatetimeValue/RelativeDatetimeValue.d.ts +6 -5
  37. package/src/enums/RingtoneType/RingtoneType.d.ts +3 -3
  38. package/src/enums/SingleSignOnProvider/SingleSignOnProvider.d.ts +6 -5
  39. package/src/enums/SingleSignOnProviderIconMappings/SingleSignOnProviderIconMappings.d.ts +6 -2
  40. package/src/enums/WebitelApplications/AdminSections.d.ts +38 -38
  41. package/src/enums/WebitelApplications/AuditorSections.d.ts +3 -2
  42. package/src/enums/WebitelApplications/CrmSections.d.ts +13 -13
  43. package/src/enums/WebitelApplications/SupervisorSections.d.ts +5 -4
  44. package/src/enums/WebitelApplications/WfmSections.d.ts +3 -3
  45. package/src/enums/WebitelApplications/WtApplication.d.ts +9 -9
  46. package/src/enums/WtObject/WtObject.d.ts +57 -57
  47. package/src/enums/WtTypeExtensionFieldKind/WtTypeExtensionFieldKind.d.ts +8 -7
  48. package/src/enums/index.d.ts +54 -4
  49. package/src/modules/Userinfo/constants/UserSettingsConstants.d.ts +1 -1
  50. package/src/utils/displayText.d.ts +1 -1
  51. package/src/utils/formatDate.d.ts +9 -3
  52. package/types/components/wt-datepicker/_internals/composables/useAutoSeparator.d.ts +17 -0
  53. package/types/components/wt-datepicker/_internals/composables/useDatepicker.d.ts +19 -0
  54. package/types/components/wt-datepicker/_internals/composables/usePreventZeroPad.d.ts +9 -5
  55. package/types/components/wt-datepicker/_internals/composables/useStrictInput.d.ts +17 -0
@@ -1,4 +1,4 @@
1
- import "./components-Bim818Xf.js";
1
+ import "./components-CSWXogKF.js";
2
2
  import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { l as t } from "./enums-De8CDKZ1.js";
4
4
  import { t as n } from "./wt-button-dC4nOW56.js";
@@ -3,7 +3,7 @@ import { d as t, f as n, l as r, r as i } from "./enums-De8CDKZ1.js";
3
3
  import { a, i as o, n as s, r as c, t as l } from "./toZonedTime-B8L5kbse.js";
4
4
  import { t as u } from "./vue-i18n-Db_oYfO8.js";
5
5
  import { t as d } from "./useValidation-lRiKF7xV.js";
6
- import { computed as f, createBlock as p, createCommentVNode as m, createElementBlock as ee, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, guardReactiveProps as y, mergeModels as b, mergeProps as x, nextTick as S, normalizeProps as C, onMounted as w, onUnmounted as T, openBlock as E, renderSlot as D, resolveComponent as O, toDisplayString as k, toRefs as A, unref as j, useModel as M, useTemplateRef as N, vShow as P, withCtx as F, withDirectives as I } from "vue";
6
+ import { computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as g, createTextVNode as _, createVNode as v, defineComponent as y, guardReactiveProps as b, mergeModels as x, mergeProps as S, nextTick as C, normalizeProps as w, onMounted as T, onUnmounted as E, openBlock as D, renderSlot as O, resolveComponent as k, toDisplayString as A, toRefs as j, unref as M, useModel as N, useTemplateRef as ee, vShow as P, withCtx as F, withDirectives as I } from "vue";
7
7
  import L from "primevue/datepicker";
8
8
  //#region node_modules/date-fns-tz/dist/esm/fromZonedTime/index.js
9
9
  function R(e, t, n) {
@@ -16,8 +16,47 @@ function R(e, t, n) {
16
16
  return new Date(r + i);
17
17
  }
18
18
  //#endregion
19
+ //#region src/components/wt-datepicker/_internals/composables/useAutoSeparator.ts
20
+ function z(e) {
21
+ let t = [{
22
+ afterPos: 2,
23
+ sep: "/"
24
+ }, {
25
+ afterPos: 5,
26
+ sep: "/"
27
+ }], n = [{
28
+ afterPos: 10,
29
+ sep: " "
30
+ }, {
31
+ afterPos: 13,
32
+ sep: ":"
33
+ }], r = 0, i = !1;
34
+ function a(a) {
35
+ if (i) return;
36
+ let o = a.target, s = o.value, c = o.selectionStart ?? s.length, l = s.length, u = l < r;
37
+ if (r = l, u) return;
38
+ let d = e() ? [...t, ...n] : t;
39
+ for (let { afterPos: e, sep: t } of d) {
40
+ if (c < e) break;
41
+ if (s[e] === t) continue;
42
+ let n = s.slice(0, e) + t + s.slice(e);
43
+ o.value = n, r = n.length;
44
+ let a = c + t.length;
45
+ o.setSelectionRange(a, a), i = !0, o.dispatchEvent(new Event("input", { bubbles: !0 })), i = !1;
46
+ break;
47
+ }
48
+ }
49
+ function o(e) {
50
+ r = e.value.length;
51
+ }
52
+ return {
53
+ onInputBubble: a,
54
+ resetLength: o
55
+ };
56
+ }
57
+ //#endregion
19
58
  //#region src/components/wt-datepicker/_internals/composables/useOverlayAnchor.ts
20
- function z() {
59
+ function B() {
21
60
  let e = null;
22
61
  function t(e, t) {
23
62
  e.style.width !== t && (e.style.width = t, e.style.minWidth = "");
@@ -38,21 +77,21 @@ function z() {
38
77
  function i() {
39
78
  e?.disconnect(), e = null;
40
79
  }
41
- return T(i), {
80
+ return E(i), {
42
81
  lock: r,
43
82
  unlock: i
44
83
  };
45
84
  }
46
85
  //#endregion
47
86
  //#region src/components/wt-datepicker/_internals/composables/usePreventZeroPad.ts
48
- function B(e) {
49
- let t = null;
50
- function n(e) {
51
- let n = e.target, r = n.value, i = n.selectionStart ?? 0, a = r.split("/"), o = 0;
52
- for (let e = 0; e < Math.min(a.length, 2); e++) {
53
- let n = a[e], s = o + n.length;
87
+ function V() {
88
+ let e = null;
89
+ function t(t) {
90
+ let n = t.target, r = n.value, i = n.selectionStart ?? 0, a = r.split("/"), o = 0;
91
+ for (let t = 0; t < Math.min(a.length, 2); t++) {
92
+ let n = a[t], s = o + n.length;
54
93
  if (i <= s && n.length === 1 && /^\d$/.test(n)) {
55
- t = {
94
+ e = {
56
95
  value: r,
57
96
  cursor: i
58
97
  };
@@ -61,52 +100,98 @@ function B(e) {
61
100
  o = s + 1;
62
101
  }
63
102
  }
64
- function r(e) {
65
- if (!t) return;
66
- let n = e.target, { value: r, cursor: i } = t;
67
- t = null, n.value !== r && (n.value = r, n.setSelectionRange(i, i), e.stopImmediatePropagation());
103
+ function n(t) {
104
+ if (!e) return;
105
+ let n = t.target, { value: r, cursor: i } = e;
106
+ e = null, n.value !== r && (n.value = r, n.setSelectionRange(i, i), t.stopImmediatePropagation());
68
107
  }
69
- w(() => {
70
- let t = e();
71
- t && (t.addEventListener("input", n, { capture: !0 }), t.addEventListener("input", r));
72
- }), T(() => {
73
- let t = e();
74
- t && (t.removeEventListener("input", n, { capture: !0 }), t.removeEventListener("input", r));
75
- });
108
+ return {
109
+ onInputCapture: t,
110
+ onInputBubble: n
111
+ };
76
112
  }
77
113
  //#endregion
78
114
  //#region src/components/wt-datepicker/_internals/composables/useRestoreOnBlur.ts
79
- function V(e, t) {
115
+ function H(e, t) {
80
116
  function n() {
81
117
  if (t()) return;
82
118
  let n = e();
83
- n && n.rawValue === null && S(() => {
119
+ n && n.rawValue === null && C(() => {
84
120
  n.updateModel(/* @__PURE__ */ new Date());
85
121
  });
86
122
  }
87
123
  return { onBlur: n };
88
124
  }
89
125
  //#endregion
126
+ //#region src/components/wt-datepicker/_internals/composables/useStrictInput.ts
127
+ function U(e) {
128
+ let t = /^[0-9]$/, n = /* @__PURE__ */ new Set([
129
+ "Backspace",
130
+ "Delete",
131
+ "Tab",
132
+ "Enter",
133
+ "Escape",
134
+ "ArrowLeft",
135
+ "ArrowRight",
136
+ "ArrowUp",
137
+ "ArrowDown",
138
+ "Home",
139
+ "End"
140
+ ]);
141
+ function r(r) {
142
+ if (n.has(r.key) || r.ctrlKey || r.metaKey) return;
143
+ if (!t.test(r.key)) {
144
+ r.preventDefault();
145
+ return;
146
+ }
147
+ let i = r.target, a = e() ? 16 : 10;
148
+ (i.selectionEnd ?? 0) - (i.selectionStart ?? 0) > 0 || i.value.length >= a && r.preventDefault();
149
+ }
150
+ return { onKeydown: r };
151
+ }
152
+ //#endregion
153
+ //#region src/components/wt-datepicker/_internals/composables/useDatepicker.ts
154
+ function W(e, t, n, r) {
155
+ let { onInputCapture: i, onInputBubble: a } = V(), { onInputBubble: o, resetLength: s } = z(n), { onKeydown: c } = U(n), { lock: l, unlock: u } = B(), { onBlur: d } = H(t, r);
156
+ function f(e) {
157
+ i(e);
158
+ }
159
+ function p(e) {
160
+ a(e), o(e);
161
+ }
162
+ return T(() => {
163
+ let t = e();
164
+ t && (s(t), t.addEventListener("input", f, { capture: !0 }), t.addEventListener("input", p), t.addEventListener("keydown", c));
165
+ }), E(() => {
166
+ let t = e();
167
+ t && (t.removeEventListener("input", f, { capture: !0 }), t.removeEventListener("input", p), t.removeEventListener("keydown", c));
168
+ }), {
169
+ onBlur: d,
170
+ lockOverlay: l,
171
+ unlockOverlay: u
172
+ };
173
+ }
174
+ //#endregion
90
175
  //#region src/components/wt-datepicker/wt-datepicker.vue?vue&type=script&setup=true&lang.ts
91
- var H = { class: "wt-datepicker" }, U = { class: "wt-datepicker__button-bar" }, W = [
176
+ var G = { class: "wt-datepicker" }, K = { class: "wt-datepicker__button-bar" }, q = [
92
177
  "onMousedown",
93
178
  "onMouseup",
94
179
  "onMouseleave"
95
- ], G = [
180
+ ], J = [
96
181
  "onMousedown",
97
182
  "onMouseup",
98
183
  "onMouseleave"
99
- ], K = [
184
+ ], Y = [
100
185
  "onMousedown",
101
186
  "onMouseup",
102
187
  "onMouseleave"
103
- ], q = [
188
+ ], X = [
104
189
  "onMousedown",
105
190
  "onMouseup",
106
191
  "onMouseleave"
107
- ], J = /*#__PURE__*/ e(/* @__PURE__ */ v({
192
+ ], Z = /*#__PURE__*/ e(/* @__PURE__ */ y({
108
193
  __name: "wt-datepicker",
109
- props: /*@__PURE__*/ b({
194
+ props: /*@__PURE__*/ x({
110
195
  showTime: { type: Boolean },
111
196
  minDate: {},
112
197
  maxDate: {},
@@ -186,7 +271,7 @@ var H = { class: "wt-datepicker" }, U = { class: "wt-datepicker__button-bar" },
186
271
  modelValue: { default: null },
187
272
  modelModifiers: {}
188
273
  }),
189
- emits: /*@__PURE__*/ b([
274
+ emits: /*@__PURE__*/ x([
190
275
  "update:modelValue",
191
276
  "value-change",
192
277
  "input",
@@ -202,7 +287,7 @@ var H = { class: "wt-datepicker" }, U = { class: "wt-datepicker__button-bar" },
202
287
  "keydown"
203
288
  ], ["update:modelValue"]),
204
289
  setup(e, { emit: a }) {
205
- let o = e, s = M(e, "modelValue"), { t: c } = u(), v = f({
290
+ let o = e, s = N(e, "modelValue"), { t: c } = u(), y = f({
206
291
  get() {
207
292
  if (!s.value) return null;
208
293
  let e = /* @__PURE__ */ new Date(+s.value);
@@ -217,42 +302,40 @@ var H = { class: "wt-datepicker" }, U = { class: "wt-datepicker__button-bar" },
217
302
  let t = o.timezone ? R(e, o.timezone) : e;
218
303
  s.value = t.getTime();
219
304
  }
220
- }), b = N("datepicker"), w = `datepicker-${Math.random().toString(36).slice(2, 11)}`;
221
- B(() => b.value?.$el?.querySelector("input"));
222
- let { onBlur: T } = V(() => b.value, () => !!o.clearable), J = f(() => o.placholder || `dd/mm/yyyy ${o.showTime ? "hh:mm" : ""}`), { lock: Y, unlock: X } = z(), Z = () => {
223
- if (o.showTime && v.value) {
224
- let e = v.value;
225
- S(() => {
226
- v.value = new Date(e.getTime());
305
+ }), x = ee("datepicker"), T = `datepicker-${Math.random().toString(36).slice(2, 11)}`, { onBlur: E, lockOverlay: z, unlockOverlay: B } = W(() => x.value?.$el?.querySelector("input"), () => x.value, () => !!o.showTime, () => !!o.clearable), V = f(() => o.placholder || `dd/mm/yyyy ${o.showTime ? "hh:mm" : ""}`), H = () => {
306
+ if (o.showTime && y.value) {
307
+ let e = y.value;
308
+ C(() => {
309
+ y.value = new Date(e.getTime());
227
310
  });
228
311
  }
229
312
  setTimeout(() => {
230
- b.value?.alignOverlay();
231
- let e = b.value?.overlay;
232
- e && (e.style.minWidth = "", Y(e));
313
+ x.value?.alignOverlay();
314
+ let e = x.value?.overlay;
315
+ e && (e.style.minWidth = "", z(e));
233
316
  }, 0);
234
- }, Q = () => {
235
- X();
236
- }, te = f(() => o.required ? `${o.label}*` : o.label), { v: ne, customValidators: re } = A(o), { isValidation: ie, invalid: ae, validationText: $, validationTextColor: oe } = d({
237
- v: ne,
238
- customValidators: re
317
+ }, U = () => {
318
+ B();
319
+ }, Z = f(() => o.required ? `${o.label}*` : o.label), { v: Q, customValidators: te } = j(o), { isValidation: ne, invalid: re, validationText: $, validationTextColor: ie } = d({
320
+ v: Q,
321
+ customValidators: te
239
322
  });
240
323
  return (a, o) => {
241
- let s = O("wt-label"), l = O("wt-button"), u = O("wt-icon-btn"), d = O("wt-message");
242
- return E(), ee("div", H, [
243
- _(s, x(e.labelProps, { disabled: e.disabled }, {
244
- for: w,
245
- invalid: j(ae)
324
+ let s = k("wt-label"), l = k("wt-button"), u = k("wt-icon-btn"), d = k("wt-message");
325
+ return D(), h("div", G, [
326
+ v(s, S(e.labelProps, { disabled: e.disabled }, {
327
+ for: T,
328
+ invalid: M(re)
246
329
  }), {
247
- default: F(() => [D(a.$slots, "label", C(y({ label: e.label })), () => [g(k(te.value), 1)], !0)], void 0, !0),
330
+ default: F(() => [O(a.$slots, "label", w(b({ label: e.label })), () => [_(A(Z.value), 1)], !0)], void 0, !0),
248
331
  _: 3
249
332
  }, 16, ["disabled", "invalid"]),
250
- _(j(L), {
333
+ v(M(L), {
251
334
  ref_key: "datepicker",
252
- ref: b,
253
- id: w,
254
- modelValue: v.value,
255
- "onUpdate:modelValue": o[0] ||= (e) => v.value = e,
335
+ ref: x,
336
+ id: T,
337
+ modelValue: y.value,
338
+ "onUpdate:modelValue": o[0] ||= (e) => y.value = e,
256
339
  "date-format": "dd/mm/yy",
257
340
  "input-class": "typo-body-1",
258
341
  required: e.required,
@@ -260,8 +343,8 @@ var H = { class: "wt-datepicker" }, U = { class: "wt-datepicker__button-bar" },
260
343
  "show-time": e.showTime,
261
344
  "min-date": e.minDate,
262
345
  "max-date": e.maxDate,
263
- placeholder: J.value,
264
- "show-clear": e.clearable && v.value,
346
+ placeholder: V.value,
347
+ "show-clear": e.clearable && y.value,
265
348
  "show-button-bar": "",
266
349
  fluid: "",
267
350
  pt: {
@@ -273,70 +356,70 @@ var H = { class: "wt-datepicker" }, U = { class: "wt-datepicker__button-bar" },
273
356
  minute: { class: "typo-body-2" },
274
357
  panel: { style: { maxWidth: "380px" } }
275
358
  },
276
- onShow: Z,
277
- onHide: Q,
278
- onBlur: j(T)
359
+ onShow: H,
360
+ onHide: U,
361
+ onBlur: M(E)
279
362
  }, {
280
- buttonbar: F(({ todayCallback: i, clearCallback: a }) => [h("div", U, [_(l, {
281
- color: j(n).SECONDARY,
282
- variant: j(t).OUTLINED,
283
- size: j(r).SM,
363
+ buttonbar: F(({ todayCallback: i, clearCallback: a }) => [g("div", K, [v(l, {
364
+ color: M(n).SECONDARY,
365
+ variant: M(t).OUTLINED,
366
+ size: M(r).SM,
284
367
  onClick: i
285
368
  }, {
286
- default: F(() => [g(k(j(c)("reusable.today")), 1)], void 0, !0),
369
+ default: F(() => [_(A(M(c)("reusable.today")), 1)], void 0, !0),
287
370
  _: 1
288
371
  }, 8, [
289
372
  "color",
290
373
  "variant",
291
374
  "size",
292
375
  "onClick"
293
- ]), I(_(l, {
294
- color: j(n).SECONDARY,
295
- variant: j(t).OUTLINED,
296
- size: j(r).SM,
376
+ ]), I(v(l, {
377
+ color: M(n).SECONDARY,
378
+ variant: M(t).OUTLINED,
379
+ size: M(r).SM,
297
380
  onClick: a
298
381
  }, {
299
- default: F(() => [g(k(j(c)("reusable.clear")), 1)], void 0, !0),
382
+ default: F(() => [_(A(M(c)("reusable.clear")), 1)], void 0, !0),
300
383
  _: 1
301
384
  }, 8, [
302
385
  "color",
303
386
  "variant",
304
387
  "size",
305
388
  "onClick"
306
- ]), [[P, e.clearable && v.value]])])]),
307
- prevbutton: F(({ actionCallback: e }) => [_(u, {
389
+ ]), [[P, e.clearable && y.value]])])]),
390
+ prevbutton: F(({ actionCallback: e }) => [v(u, {
308
391
  icon: "arrow-left",
309
392
  onClick: e
310
393
  }, null, 8, ["onClick"])]),
311
- nextbutton: F(({ actionCallback: e }) => [_(u, {
394
+ nextbutton: F(({ actionCallback: e }) => [v(u, {
312
395
  icon: "arrow-right",
313
396
  onClick: e
314
397
  }, null, 8, ["onClick"])]),
315
- clearicon: F(({ clearCallback: e }) => [_(u, {
398
+ clearicon: F(({ clearCallback: e }) => [v(u, {
316
399
  icon: "close",
317
400
  class: "wt-datepicker__clear-icon",
318
401
  onClick: e
319
402
  }, null, 8, ["onClick"])]),
320
- hourincrementbutton: F(({ callbacks: e }) => [h("span", {
403
+ hourincrementbutton: F(({ callbacks: e }) => [g("span", {
321
404
  onMousedown: e.mousedown,
322
405
  onMouseup: e.mouseup,
323
406
  onMouseleave: e.mouseleave
324
- }, [_(u, { icon: "arrow-up" })], 40, W)]),
325
- hourdecrementbutton: F(({ callbacks: e }) => [h("span", {
407
+ }, [v(u, { icon: "arrow-up" })], 40, q)]),
408
+ hourdecrementbutton: F(({ callbacks: e }) => [g("span", {
326
409
  onMousedown: e.mousedown,
327
410
  onMouseup: e.mouseup,
328
411
  onMouseleave: e.mouseleave
329
- }, [_(u, { icon: "arrow-down" })], 40, G)]),
330
- minuteincrementbutton: F(({ callbacks: e }) => [h("span", {
412
+ }, [v(u, { icon: "arrow-down" })], 40, J)]),
413
+ minuteincrementbutton: F(({ callbacks: e }) => [g("span", {
331
414
  onMousedown: e.mousedown,
332
415
  onMouseup: e.mouseup,
333
416
  onMouseleave: e.mouseleave
334
- }, [_(u, { icon: "arrow-up" })], 40, K)]),
335
- minutedecrementbutton: F(({ callbacks: e }) => [h("span", {
417
+ }, [v(u, { icon: "arrow-up" })], 40, Y)]),
418
+ minutedecrementbutton: F(({ callbacks: e }) => [g("span", {
336
419
  onMousedown: e.mousedown,
337
420
  onMouseup: e.mouseup,
338
421
  onMouseleave: e.mouseleave
339
- }, [_(u, { icon: "arrow-down" })], 40, q)]),
422
+ }, [v(u, { icon: "arrow-down" })], 40, X)]),
340
423
  _: 1
341
424
  }, 8, [
342
425
  "modelValue",
@@ -349,13 +432,13 @@ var H = { class: "wt-datepicker" }, U = { class: "wt-datepicker__button-bar" },
349
432
  "show-clear",
350
433
  "onBlur"
351
434
  ]),
352
- j(ie) && j($) ? (E(), p(d, {
435
+ M(ne) && M($) ? (D(), p(d, {
353
436
  key: 0,
354
- color: j(oe),
355
- variant: j(i).SIMPLE,
356
- size: j(r).SM
437
+ color: M(ie),
438
+ variant: M(i).SIMPLE,
439
+ size: M(r).SM
357
440
  }, {
358
- default: F(() => [g(k(j($)), 1)], void 0, !0),
441
+ default: F(() => [_(A(M($)), 1)], void 0, !0),
359
442
  _: 1
360
443
  }, 8, [
361
444
  "color",
@@ -365,6 +448,6 @@ var H = { class: "wt-datepicker" }, U = { class: "wt-datepicker__button-bar" },
365
448
  ]);
366
449
  };
367
450
  }
368
- }), [["__scopeId", "data-v-d1bf89b4"]]);
451
+ }), [["__scopeId", "data-v-bdb1c01b"]]);
369
452
  //#endregion
370
- export { J as default };
453
+ export { Z as default };
@@ -1,4 +1,4 @@
1
- import { C as e, i as t } from "./components-Bim818Xf.js";
1
+ import { C as e, i as t } from "./components-CSWXogKF.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,5 +1,5 @@
1
1
  import { n as e, r as t } from "./clients-Ban2DI-G.js";
2
- import { n } from "./components-Bim818Xf.js";
2
+ import { n } from "./components-CSWXogKF.js";
3
3
  import { t as r } from "./vue-i18n-Db_oYfO8.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";
5
5
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./clients-Ban2DI-G.js";
2
- import { a as t, o as n, r, s as i } from "./components-Bim818Xf.js";
2
+ import { a as t, o as n, r, s as i } from "./components-CSWXogKF.js";
3
3
  import { t as a } from "./enums-De8CDKZ1.js";
4
4
  import { t as o } from "./vue-i18n-Db_oYfO8.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";
@@ -1,4 +1,4 @@
1
- import { w as e } from "./components-Bim818Xf.js";
1
+ import { w as e } from "./components-CSWXogKF.js";
2
2
  import { t } from "./_plugin-vue_export-helper-B3ysoDQm.js";
3
3
  import { l as n } from "./enums-De8CDKZ1.js";
4
4
  import "./wt-button-dC4nOW56.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webitel/ui-sdk",
3
- "version": "26.6.96",
3
+ "version": "26.6.97",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "npm run docs:dev",
@@ -0,0 +1,96 @@
1
+ /**
2
+ * @author @HlukhovYe
3
+ *
4
+ * Automatically inserts date/time separators while the user types into the
5
+ * PrimeVue DatePicker input so they don't have to type '/' or ':' manually.
6
+ *
7
+ * Format without time: dd/mm/yyyy → inserts '/' after positions 2 and 5
8
+ * Format with time: dd/mm/yyyy hh:mm → also inserts ' ' after position 10
9
+ * and ':' after position 13
10
+ *
11
+ * The handler runs in the bubble phase (after PrimeVue's own input handler).
12
+ * Listener registration is handled by useDatepicker.
13
+ */
14
+ export function createAutoSeparatorHandler(showTime: () => boolean) {
15
+ const DATE_SEPARATORS: Array<{
16
+ afterPos: number;
17
+ sep: string;
18
+ }> = [
19
+ {
20
+ afterPos: 2,
21
+ sep: '/',
22
+ }, // dd → dd/
23
+ {
24
+ afterPos: 5,
25
+ sep: '/',
26
+ }, // mm → mm/
27
+ ];
28
+
29
+ const TIME_SEPARATORS: Array<{
30
+ afterPos: number;
31
+ sep: string;
32
+ }> = [
33
+ {
34
+ afterPos: 10,
35
+ sep: ' ',
36
+ }, // yyyy → yyyy<space>
37
+ {
38
+ afterPos: 13,
39
+ sep: ':',
40
+ }, // hh → hh:
41
+ ];
42
+
43
+ let lastLength = 0;
44
+ let injecting = false;
45
+
46
+ function onInputBubble(event: Event) {
47
+ if (injecting) return;
48
+ const input = event.target as HTMLInputElement;
49
+ const value = input.value;
50
+ const cursor = input.selectionStart ?? value.length;
51
+ const currentLength = value.length;
52
+
53
+ const isDeleting = currentLength < lastLength;
54
+ lastLength = currentLength;
55
+ if (isDeleting) return;
56
+
57
+ const separators = showTime()
58
+ ? [
59
+ ...DATE_SEPARATORS,
60
+ ...TIME_SEPARATORS,
61
+ ]
62
+ : DATE_SEPARATORS;
63
+
64
+ // Find the first separator position the cursor has reached or passed
65
+ // where the separator character is missing. Covers two cases:
66
+ // 1. Normal typing: cursor === afterPos (just finished a segment).
67
+ // 2. Separator was deleted then user typed next digit: cursor > afterPos
68
+ // but value[afterPos] is a digit instead of the separator.
69
+ for (const { afterPos, sep } of separators) {
70
+ if (cursor < afterPos) break;
71
+ if (value[afterPos] === sep) continue;
72
+ const newValue = value.slice(0, afterPos) + sep + value.slice(afterPos);
73
+ input.value = newValue;
74
+ lastLength = newValue.length;
75
+ const newCursor = cursor + sep.length;
76
+ input.setSelectionRange(newCursor, newCursor);
77
+ injecting = true;
78
+ input.dispatchEvent(
79
+ new Event('input', {
80
+ bubbles: true,
81
+ }),
82
+ );
83
+ injecting = false;
84
+ break;
85
+ }
86
+ }
87
+
88
+ function resetLength(input: HTMLInputElement) {
89
+ lastLength = input.value.length;
90
+ }
91
+
92
+ return {
93
+ onInputBubble,
94
+ resetLength,
95
+ };
96
+ }
@@ -0,0 +1,78 @@
1
+ import { onMounted, onUnmounted } from 'vue';
2
+ import { createAutoSeparatorHandler } from './useAutoSeparator';
3
+ import { useOverlayAnchor } from './useOverlayAnchor';
4
+ import { createPreventZeroPadHandlers } from './usePreventZeroPad';
5
+ import { useRestoreOnBlur } from './useRestoreOnBlur';
6
+ import { createStrictInputHandler } from './useStrictInput';
7
+
8
+ /**
9
+ * @author @HlukhovYe
10
+ *
11
+ * Single composable entry point for wt-datepicker. Composes all input-handling
12
+ * and overlay logic into a minimal set of DOM listeners — one capture input,
13
+ * one bubble input, one keydown — so the browser dispatches each event once.
14
+ *
15
+ * Returns:
16
+ * onBlur — forward to p-datepicker's @blur
17
+ * lockOverlay / unlockOverlay — forward to onPanelShow / onPanelHide
18
+ */
19
+ export function useDatepicker(
20
+ getInput: () => HTMLInputElement | null,
21
+ getDatepicker: () => {
22
+ rawValue: Date | null;
23
+ updateModel: (v: Date) => void;
24
+ } | null,
25
+ showTime: () => boolean,
26
+ isClearable: () => boolean,
27
+ ) {
28
+ const { onInputCapture: zeroPadCapture, onInputBubble: zeroPadBubble } =
29
+ createPreventZeroPadHandlers();
30
+
31
+ const { onInputBubble: separatorBubble, resetLength } =
32
+ createAutoSeparatorHandler(showTime);
33
+
34
+ const { onKeydown } = createStrictInputHandler(showTime);
35
+
36
+ const { lock: lockOverlay, unlock: unlockOverlay } = useOverlayAnchor();
37
+
38
+ const { onBlur } = useRestoreOnBlur(getDatepicker, isClearable);
39
+
40
+ function onInputCaptureHandler(event: Event) {
41
+ zeroPadCapture(event);
42
+ }
43
+
44
+ function onInputBubbleHandler(event: Event) {
45
+ // Zero-pad handler runs first: it may stop propagation if it restores a
46
+ // partial value, which also prevents the separator handler from seeing a
47
+ // half-formed string and injecting a separator too early.
48
+ zeroPadBubble(event);
49
+ separatorBubble(event);
50
+ }
51
+
52
+ onMounted(() => {
53
+ const input = getInput();
54
+ if (!input) return;
55
+ resetLength(input);
56
+ input.addEventListener('input', onInputCaptureHandler, {
57
+ capture: true,
58
+ });
59
+ input.addEventListener('input', onInputBubbleHandler);
60
+ input.addEventListener('keydown', onKeydown);
61
+ });
62
+
63
+ onUnmounted(() => {
64
+ const input = getInput();
65
+ if (!input) return;
66
+ input.removeEventListener('input', onInputCaptureHandler, {
67
+ capture: true,
68
+ });
69
+ input.removeEventListener('input', onInputBubbleHandler);
70
+ input.removeEventListener('keydown', onKeydown);
71
+ });
72
+
73
+ return {
74
+ onBlur,
75
+ lockOverlay,
76
+ unlockOverlay,
77
+ };
78
+ }