@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.
- package/dist/{components-Bim818Xf.js → components-CSWXogKF.js} +3 -3
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1 -1
- package/dist/ui-sdk.umd.cjs +382 -382
- package/dist/{wt-chat-emoji-CX65m8Dd.js → wt-chat-emoji-Zfe96hoz.js} +1 -1
- package/dist/{wt-datepicker-BP9bBbGY.js → wt-datepicker-BtjegGDk.js} +174 -91
- package/dist/{wt-display-chip-items-tL17x2-U.js → wt-display-chip-items-YauywYzZ.js} +1 -1
- package/dist/{wt-send-message-popup-8TZWTO40.js → wt-send-message-popup-DV1i1Q52.js} +1 -1
- package/dist/{wt-type-extension-value-input-D1wNUHkh.js → wt-type-extension-value-input-CpYbzjDU.js} +1 -1
- package/dist/{wt-vidstack-player-Z3cdtFBu.js → wt-vidstack-player-CC6dwrnv.js} +1 -1
- package/package.json +1 -1
- package/src/components/wt-datepicker/_internals/composables/useAutoSeparator.ts +96 -0
- package/src/components/wt-datepicker/_internals/composables/useDatepicker.ts +78 -0
- package/src/components/wt-datepicker/_internals/composables/usePreventZeroPad.ts +10 -24
- package/src/components/wt-datepicker/_internals/composables/useStrictInput.ts +61 -0
- package/src/components/wt-datepicker/wt-datepicker.vue +4 -8
- package/src/composables/useEventBus/useEventBus.d.ts +4 -4
- package/src/enums/BroadcastChannelName/BroadcastChannelName.d.ts +3 -2
- package/src/enums/BroadcastChannelName/UserSettingsBroadcastMessage.d.ts +7 -7
- package/src/enums/ButtonColor/ButtonColor.d.ts +8 -8
- package/src/enums/ButtonVariant/ButtonVariant.d.ts +3 -3
- package/src/enums/ChipColor/ChipColor.d.ts +8 -8
- package/src/enums/ComponentSize/ComponentSize.d.ts +14 -14
- package/src/enums/ConnectionQualityLevel/ConnectionQualityLevel.enum.d.ts +5 -4
- package/src/enums/CrudAction/CrudAction.d.ts +4 -4
- package/src/enums/DefaultWorkspaceTabSettings/DefaultWorkspaceTabSettings.d.ts +8 -7
- package/src/enums/EmptyCause/EmptyCause.d.ts +3 -3
- package/src/enums/FormatDateMode/FormatDateMode.d.ts +7 -6
- package/src/enums/IconColor/IconColor.d.ts +14 -14
- package/src/enums/LoginOptions/LoginOptions.d.ts +3 -3
- package/src/enums/MessageColor/MessageColor.d.ts +6 -6
- package/src/enums/MessageVariant/MessageVariant.d.ts +3 -3
- package/src/enums/MimeTypes/MimeTypes.enum.d.ts +14 -14
- package/src/enums/ProcessingTableColumnType/ProcessingTableColumnType.d.ts +7 -6
- package/src/enums/QueueType/QueueType.enum.d.ts +22 -22
- package/src/enums/RelativeDatetimeValue/RelativeDatetimeValue.d.ts +6 -5
- package/src/enums/RingtoneType/RingtoneType.d.ts +3 -3
- package/src/enums/SingleSignOnProvider/SingleSignOnProvider.d.ts +6 -5
- package/src/enums/SingleSignOnProviderIconMappings/SingleSignOnProviderIconMappings.d.ts +6 -2
- package/src/enums/WebitelApplications/AdminSections.d.ts +38 -38
- package/src/enums/WebitelApplications/AuditorSections.d.ts +3 -2
- package/src/enums/WebitelApplications/CrmSections.d.ts +13 -13
- package/src/enums/WebitelApplications/SupervisorSections.d.ts +5 -4
- package/src/enums/WebitelApplications/WfmSections.d.ts +3 -3
- package/src/enums/WebitelApplications/WtApplication.d.ts +9 -9
- package/src/enums/WtObject/WtObject.d.ts +57 -57
- package/src/enums/WtTypeExtensionFieldKind/WtTypeExtensionFieldKind.d.ts +8 -7
- package/src/enums/index.d.ts +54 -4
- package/src/modules/Userinfo/constants/UserSettingsConstants.d.ts +1 -1
- package/src/utils/displayText.d.ts +1 -1
- package/src/utils/formatDate.d.ts +9 -3
- package/types/components/wt-datepicker/_internals/composables/useAutoSeparator.d.ts +17 -0
- package/types/components/wt-datepicker/_internals/composables/useDatepicker.d.ts +19 -0
- package/types/components/wt-datepicker/_internals/composables/usePreventZeroPad.d.ts +9 -5
- package/types/components/wt-datepicker/_internals/composables/useStrictInput.d.ts +17 -0
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
49
|
-
let
|
|
50
|
-
function
|
|
51
|
-
let n =
|
|
52
|
-
for (let
|
|
53
|
-
let n = a[
|
|
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
|
-
|
|
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
|
|
65
|
-
if (!
|
|
66
|
-
let n =
|
|
67
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
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
|
|
115
|
+
function H(e, t) {
|
|
80
116
|
function n() {
|
|
81
117
|
if (t()) return;
|
|
82
118
|
let n = e();
|
|
83
|
-
n && n.rawValue === null &&
|
|
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
|
|
176
|
+
var G = { class: "wt-datepicker" }, K = { class: "wt-datepicker__button-bar" }, q = [
|
|
92
177
|
"onMousedown",
|
|
93
178
|
"onMouseup",
|
|
94
179
|
"onMouseleave"
|
|
95
|
-
],
|
|
180
|
+
], J = [
|
|
96
181
|
"onMousedown",
|
|
97
182
|
"onMouseup",
|
|
98
183
|
"onMouseleave"
|
|
99
|
-
],
|
|
184
|
+
], Y = [
|
|
100
185
|
"onMousedown",
|
|
101
186
|
"onMouseup",
|
|
102
187
|
"onMouseleave"
|
|
103
|
-
],
|
|
188
|
+
], X = [
|
|
104
189
|
"onMousedown",
|
|
105
190
|
"onMouseup",
|
|
106
191
|
"onMouseleave"
|
|
107
|
-
],
|
|
192
|
+
], Z = /*#__PURE__*/ e(/* @__PURE__ */ y({
|
|
108
193
|
__name: "wt-datepicker",
|
|
109
|
-
props: /*@__PURE__*/
|
|
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__*/
|
|
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 =
|
|
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
|
-
}),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
231
|
-
let e =
|
|
232
|
-
e && (e.style.minWidth = "",
|
|
313
|
+
x.value?.alignOverlay();
|
|
314
|
+
let e = x.value?.overlay;
|
|
315
|
+
e && (e.style.minWidth = "", z(e));
|
|
233
316
|
}, 0);
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
},
|
|
237
|
-
v:
|
|
238
|
-
customValidators:
|
|
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 =
|
|
242
|
-
return
|
|
243
|
-
|
|
244
|
-
for:
|
|
245
|
-
invalid:
|
|
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(() => [
|
|
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
|
-
|
|
333
|
+
v(M(L), {
|
|
251
334
|
ref_key: "datepicker",
|
|
252
|
-
ref:
|
|
253
|
-
id:
|
|
254
|
-
modelValue:
|
|
255
|
-
"onUpdate:modelValue": o[0] ||= (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:
|
|
264
|
-
"show-clear": e.clearable &&
|
|
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:
|
|
277
|
-
onHide:
|
|
278
|
-
onBlur:
|
|
359
|
+
onShow: H,
|
|
360
|
+
onHide: U,
|
|
361
|
+
onBlur: M(E)
|
|
279
362
|
}, {
|
|
280
|
-
buttonbar: F(({ todayCallback: i, clearCallback: a }) => [
|
|
281
|
-
color:
|
|
282
|
-
variant:
|
|
283
|
-
size:
|
|
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(() => [
|
|
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(
|
|
294
|
-
color:
|
|
295
|
-
variant:
|
|
296
|
-
size:
|
|
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(() => [
|
|
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 &&
|
|
307
|
-
prevbutton: F(({ actionCallback: e }) => [
|
|
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 }) => [
|
|
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 }) => [
|
|
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 }) => [
|
|
403
|
+
hourincrementbutton: F(({ callbacks: e }) => [g("span", {
|
|
321
404
|
onMousedown: e.mousedown,
|
|
322
405
|
onMouseup: e.mouseup,
|
|
323
406
|
onMouseleave: e.mouseleave
|
|
324
|
-
}, [
|
|
325
|
-
hourdecrementbutton: F(({ callbacks: e }) => [
|
|
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
|
-
}, [
|
|
330
|
-
minuteincrementbutton: F(({ callbacks: e }) => [
|
|
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
|
-
}, [
|
|
335
|
-
minutedecrementbutton: F(({ callbacks: e }) => [
|
|
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
|
-
}, [
|
|
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
|
-
|
|
435
|
+
M(ne) && M($) ? (D(), p(d, {
|
|
353
436
|
key: 0,
|
|
354
|
-
color:
|
|
355
|
-
variant:
|
|
356
|
-
size:
|
|
437
|
+
color: M(ie),
|
|
438
|
+
variant: M(i).SIMPLE,
|
|
439
|
+
size: M(r).SM
|
|
357
440
|
}, {
|
|
358
|
-
default: F(() => [
|
|
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-
|
|
451
|
+
}), [["__scopeId", "data-v-bdb1c01b"]]);
|
|
369
452
|
//#endregion
|
|
370
|
-
export {
|
|
453
|
+
export { Z as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e, i as t } from "./components-
|
|
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-
|
|
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
|
package/dist/{wt-type-extension-value-input-D1wNUHkh.js → wt-type-extension-value-input-CpYbzjDU.js}
RENAMED
|
@@ -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-
|
|
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";
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|