@webitel/ui-sdk 25.12.28 → 25.12.30
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/{install-Bqlm16sb.js → install-D_xtJZB0.js} +70562 -66328
- package/dist/{plyr-Br33nnwi.js → plyr-DNPJWtDF.js} +1 -1
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1 -1
- package/dist/ui-sdk.umd.cjs +251 -251
- package/dist/{vidstack-Bq6c3Bam-CxzFv3Ko.js → vidstack-Bq6c3Bam-iboJqKVr.js} +2 -2
- package/dist/{vidstack-D2pY00kU-DcpelJcf.js → vidstack-D2pY00kU-Ct14APC8.js} +2 -2
- package/dist/{vidstack-DDXt6fpN-Cg0bEHId.js → vidstack-DDXt6fpN-Dt79RJ4W.js} +1 -1
- package/dist/{vidstack-D_-9AA6_-bnYaKyO1.js → vidstack-D_-9AA6_-DDXWcVDN.js} +1 -1
- package/dist/{vidstack-DqAw8m9J-DdJYKLyM.js → vidstack-DqAw8m9J-DRb_cwVy.js} +1 -1
- package/dist/{vidstack-audio-DduGjEcQ.js → vidstack-audio-ciWGdZoD.js} +2 -2
- package/dist/{vidstack-dash-CKzRjcLs.js → vidstack-dash-BjbkCaQh.js} +3 -3
- package/dist/{vidstack-google-cast-BiPwnnpT.js → vidstack-google-cast-BWfbN1oJ.js} +3 -3
- package/dist/{vidstack-hls-OkFNv20L.js → vidstack-hls-BqpGa4dW.js} +3 -3
- package/dist/{vidstack-video-CB59bElo.js → vidstack-video-5xriTd1y.js} +2 -2
- package/dist/{vidstack-vimeo-NoVxwrcD.js → vidstack-vimeo-BC8x2jc8.js} +3 -3
- package/dist/{vidstack-youtube-C1voQhH8.js → vidstack-youtube-B8OrDxFV.js} +2 -2
- package/dist/{vuex.esm-bundler-C04hKLcf.js → vuex.esm-bundler-BOZ1SHXV.js} +1 -1
- package/package.json +2 -1
- package/src/components/wt-app-header/wt-header-actions.vue +4 -1
- package/src/composables/useTableColumnDrag/useTableColumnDrag.ts +81 -2
- package/src/enums/FormatDateMode/FormatDateMode.ts +6 -0
- package/src/enums/index.ts +2 -0
- package/src/modules/AuditForm/components/form-answers/answer-editing-info/audit-form-answer-editing-info.vue +3 -1
- package/src/scripts/prettifyTime.js +5 -1
- package/src/utils/formatDate.ts +48 -0
- package/src/utils/index.ts +1 -0
- package/types/components/wt-datepicker/wt-datepicker.vue.d.ts +2 -2
- package/types/enums/FormatDateMode/FormatDateMode.d.ts +6 -0
- package/types/enums/index.d.ts +2 -1
- package/types/utils/formatDate.d.ts +2 -0
- package/types/utils/index.d.ts +1 -0
|
@@ -5,8 +5,8 @@ var ot = (n) => {
|
|
|
5
5
|
var Xt = (n, t, s) => t in n ? Qt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[t] = s;
|
|
6
6
|
var N = (n, t, s) => Xt(n, typeof t != "symbol" ? t + "" : t, s), X = (n, t, s) => t.has(n) || ot("Cannot " + s);
|
|
7
7
|
var i = (n, t, s) => (X(n, t, "read from private field"), s ? s.call(n) : t.get(n)), d = (n, t, s) => t.has(n) ? ot("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, s), c = (n, t, s, r) => (X(n, t, "write to private field"), r ? r.call(n, s) : t.set(n, s), s), a = (n, t, s) => (X(n, t, "access private method"), s);
|
|
8
|
-
import { A as Yt, z as ut, B as j, C as Zt, b as ti, E as nt, e as lt, F as _, G as ii, H as ei, f as si, J as ai, l as rt, K as dt, D as ni, L as Y, M as Z } from "./install-
|
|
9
|
-
import { R as ri } from "./vidstack-DqAw8m9J-
|
|
8
|
+
import { A as Yt, z as ut, B as j, C as Zt, b as ti, E as nt, e as lt, F as _, G as ii, H as ei, f as si, J as ai, l as rt, K as dt, D as ni, L as Y, M as Z } from "./install-D_xtJZB0.js";
|
|
9
|
+
import { R as ri } from "./vidstack-DqAw8m9J-DRb_cwVy.js";
|
|
10
10
|
let q = null, K = [], z = [];
|
|
11
11
|
function ht() {
|
|
12
12
|
return q ?? (q = new AudioContext());
|
|
@@ -5,7 +5,7 @@ var w = (t) => {
|
|
|
5
5
|
var P = (t, e, a) => e in t ? _(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
|
|
6
6
|
var u = (t, e, a) => P(t, typeof e != "symbol" ? e + "" : e, a), C = (t, e, a) => e.has(t) || w("Cannot " + a);
|
|
7
7
|
var c = (t, e, a) => (C(t, e, "read from private field"), a ? a.call(t) : e.get(t)), m = (t, e, a) => e.has(t) ? w("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, a), y = (t, e, a, o) => (C(t, e, "write to private field"), o ? o.call(t, a) : e.set(t, a), a), s = (t, e, a) => (C(t, e, "access private method"), a);
|
|
8
|
-
import { l as b, k as A, V as O, G as D, f as R, o as G } from "./install-
|
|
8
|
+
import { l as b, k as A, V as O, G as D, f as R, o as G } from "./install-D_xtJZB0.js";
|
|
9
9
|
function M() {
|
|
10
10
|
return "https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1";
|
|
11
11
|
}
|
|
@@ -94,7 +94,7 @@ class F {
|
|
|
94
94
|
async load(e) {
|
|
95
95
|
if (!c(this, n))
|
|
96
96
|
throw Error("[vidstack] google cast player was not initialized");
|
|
97
|
-
return new (await import("./vidstack-google-cast-
|
|
97
|
+
return new (await import("./vidstack-google-cast-BWfbN1oJ.js")).GoogleCastProvider(c(this, n), e);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
n = new WeakMap(), r = new WeakSet(), S = async function(e) {
|
|
@@ -5,7 +5,7 @@ var g = (s) => {
|
|
|
5
5
|
var M = (s, t, i) => t in s ? y(s, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[t] = i;
|
|
6
6
|
var c = (s, t, i) => M(s, typeof t != "symbol" ? t + "" : t, i), h = (s, t, i) => t.has(s) || g("Cannot " + i);
|
|
7
7
|
var e = (s, t, i) => (h(s, t, "read from private field"), i ? i.call(s) : t.get(s)), l = (s, t, i) => t.has(s) ? g("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, i), p = (s, t, i, a) => (h(s, t, "write to private field"), a ? a.call(s, i) : t.set(s, i), i), u = (s, t, i) => (h(s, t, "access private method"), i);
|
|
8
|
-
import { M as w, l as f, e as A, f as P, U as O, b as S } from "./install-
|
|
8
|
+
import { M as w, l as f, e as A, f as P, U as O, b as S } from "./install-D_xtJZB0.js";
|
|
9
9
|
var r, o, b, m;
|
|
10
10
|
class J {
|
|
11
11
|
constructor(t) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as d, a as i, I as l, e as m } from "./install-
|
|
1
|
+
import { c as d, a as i, I as l, e as m } from "./install-D_xtJZB0.js";
|
|
2
2
|
const p = /* @__PURE__ */ i(
|
|
3
3
|
'<svg viewBox="0 0 32 32" fill="none" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"></svg>'
|
|
4
4
|
);
|
|
@@ -3,7 +3,7 @@ var l = (i) => {
|
|
|
3
3
|
};
|
|
4
4
|
var m = (i, t, s) => t.has(i) || l("Cannot " + s);
|
|
5
5
|
var r = (i, t, s) => (m(i, t, "read from private field"), s ? s.call(i) : t.get(i)), e = (i, t, s) => t.has(i) ? l("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, s), h = (i, t, s, f) => (m(i, t, "write to private field"), f ? f.call(i, s) : t.set(i, s), s), c = (i, t, s) => (m(i, t, "access private method"), s);
|
|
6
|
-
import { m as p, v as u } from "./install-
|
|
6
|
+
import { m as p, v as u } from "./install-D_xtJZB0.js";
|
|
7
7
|
var o, a, n, d;
|
|
8
8
|
class F {
|
|
9
9
|
constructor(t) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var a = Object.defineProperty;
|
|
2
2
|
var o = (i, e, t) => e in i ? a(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
3
|
var r = (i, e, t) => o(i, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { s as p } from "./install-
|
|
5
|
-
import { H as d, a as u } from "./vidstack-Bq6c3Bam-
|
|
4
|
+
import { s as p } from "./install-D_xtJZB0.js";
|
|
5
|
+
import { H as d, a as u } from "./vidstack-Bq6c3Bam-iboJqKVr.js";
|
|
6
6
|
class n extends d {
|
|
7
7
|
constructor(t, s) {
|
|
8
8
|
super(t, s);
|
|
@@ -5,9 +5,9 @@ var Y = (n) => {
|
|
|
5
5
|
var wt = (n, t, e) => t in n ? vt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
6
6
|
var I = (n, t, e) => wt(n, typeof t != "symbol" ? t + "" : t, e), b = (n, t, e) => t.has(n) || Y("Cannot " + e);
|
|
7
7
|
var i = (n, t, e) => (b(n, t, "read from private field"), e ? e.call(n) : t.get(n)), f = (n, t, e) => t.has(n) ? Y("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), p = (n, t, e, r) => (b(n, t, "write to private field"), r ? r.call(n, e) : t.set(n, e), e), h = (n, t, e) => (b(n, t, "access private method"), e);
|
|
8
|
-
import { r as Et, b as _, d as Lt, f as At, Q as z, l as J, e as Dt, D as N, h as xt, j as O, T as Mt, L as q, t as Ct, u as Nt, v as Rt, k as Ft, m as Z, n as Pt, o as qt, q as _t } from "./install-
|
|
9
|
-
import { VideoProvider as $t } from "./vidstack-video-
|
|
10
|
-
import { R as jt } from "./vidstack-DqAw8m9J-
|
|
8
|
+
import { r as Et, b as _, d as Lt, f as At, Q as z, l as J, e as Dt, D as N, h as xt, j as O, T as Mt, L as q, t as Ct, u as Nt, v as Rt, k as Ft, m as Z, n as Pt, o as qt, q as _t } from "./install-D_xtJZB0.js";
|
|
9
|
+
import { VideoProvider as $t } from "./vidstack-video-5xriTd1y.js";
|
|
10
|
+
import { R as jt } from "./vidstack-DqAw8m9J-DRb_cwVy.js";
|
|
11
11
|
function W(n) {
|
|
12
12
|
try {
|
|
13
13
|
return new Intl.DisplayNames(navigator.languages, { type: "language" }).of(n) ?? null;
|
|
@@ -5,9 +5,9 @@ var Q = (d) => {
|
|
|
5
5
|
var vt = (d, t, s) => t in d ? Lt(d, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : d[t] = s;
|
|
6
6
|
var G = (d, t, s) => vt(d, typeof t != "symbol" ? t + "" : t, s), O = (d, t, s) => t.has(d) || Q("Cannot " + s);
|
|
7
7
|
var e = (d, t, s) => (O(d, t, "read from private field"), s ? s.call(d) : t.get(d)), T = (d, t, s) => t.has(d) ? Q("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(d) : t.set(d, s), l = (d, t, s, i) => (O(d, t, "write to private field"), i ? i.call(d, s) : t.set(d, s), s), r = (d, t, s) => (O(d, t, "access private method"), s);
|
|
8
|
-
import { A as St, N as L, W as Z, z as At, D as tt, f as V, l as et, e as It, X as bt, L as Rt } from "./install-
|
|
9
|
-
import { R as wt } from "./vidstack-DqAw8m9J-
|
|
10
|
-
import { g as Mt, a as Dt, b as it, h as st, l as Nt, c as Pt } from "./vidstack-D2pY00kU-
|
|
8
|
+
import { A as St, N as L, W as Z, z as At, D as tt, f as V, l as et, e as It, X as bt, L as Rt } from "./install-D_xtJZB0.js";
|
|
9
|
+
import { R as wt } from "./vidstack-DqAw8m9J-DRb_cwVy.js";
|
|
10
|
+
import { g as Mt, a as Dt, b as it, h as st, l as Nt, c as Pt } from "./vidstack-D2pY00kU-Ct14APC8.js";
|
|
11
11
|
var g, _, at;
|
|
12
12
|
class _t {
|
|
13
13
|
constructor(t) {
|
|
@@ -5,9 +5,9 @@ var q = (n) => {
|
|
|
5
5
|
var ot = (n, t, i) => t in n ? rt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : n[t] = i;
|
|
6
6
|
var _ = (n, t, i) => ot(n, typeof t != "symbol" ? t + "" : t, i), R = (n, t, i) => t.has(n) || q("Cannot " + i);
|
|
7
7
|
var e = (n, t, i) => (R(n, t, "read from private field"), i ? i.call(n) : t.get(n)), f = (n, t, i) => t.has(n) ? q("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, i), p = (n, t, i, s) => (R(n, t, "write to private field"), s ? s.call(n, i) : t.set(n, i), i), a = (n, t, i) => (R(n, t, "access private method"), i);
|
|
8
|
-
import { i as ht, b as C, d as at, f as O, Q as N, l as V, e as dt, D as x, h as ut, T as ct, j, L as $, k as lt, m as k, n as ft, o as pt, q as vt } from "./install-
|
|
9
|
-
import { VideoProvider as yt } from "./vidstack-video-
|
|
10
|
-
import { R as gt } from "./vidstack-DqAw8m9J-
|
|
8
|
+
import { i as ht, b as C, d as at, f as O, Q as N, l as V, e as dt, D as x, h as ut, T as ct, j, L as $, k as lt, m as k, n as ft, o as pt, q as vt } from "./install-D_xtJZB0.js";
|
|
9
|
+
import { VideoProvider as yt } from "./vidstack-video-5xriTd1y.js";
|
|
10
|
+
import { R as gt } from "./vidstack-DqAw8m9J-DRb_cwVy.js";
|
|
11
11
|
const Lt = (n) => ut(n);
|
|
12
12
|
var T, h, o, D, b, r, E, M, U, F, Q, K, W, B, J, X, Y, z, G, Z, tt;
|
|
13
13
|
class St {
|
|
@@ -5,8 +5,8 @@ var b = (i) => {
|
|
|
5
5
|
var N = (i, t, e) => t in i ? $(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
6
6
|
var y = (i, t, e) => N(i, typeof t != "symbol" ? t + "" : t, e), E = (i, t, e) => t.has(i) || b("Cannot " + e);
|
|
7
7
|
var s = (i, t, e) => (E(i, t, "read from private field"), e ? e.call(i) : t.get(i)), r = (i, t, e) => t.has(i) ? b("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), c = (i, t, e, n) => (E(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), p = (i, t, e) => (E(i, t, "access private method"), e);
|
|
8
|
-
import { s as U, w as V, x as A, y as j, z as C, l as q, D as z, E as F, T as Y, j as v } from "./install-
|
|
9
|
-
import { H as _, a as B } from "./vidstack-Bq6c3Bam-
|
|
8
|
+
import { s as U, w as V, x as A, y as j, z as C, l as q, D as z, E as F, T as Y, j as v } from "./install-D_xtJZB0.js";
|
|
9
|
+
import { H as _, a as B } from "./vidstack-Bq6c3Bam-iboJqKVr.js";
|
|
10
10
|
var P, f, k, D, H;
|
|
11
11
|
class G {
|
|
12
12
|
constructor(t, e) {
|
|
@@ -5,9 +5,9 @@ var N = (r) => {
|
|
|
5
5
|
var de = (r, c, e) => c in r ? ue(r, c, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[c] = e;
|
|
6
6
|
var b = (r, c, e) => de(r, typeof c != "symbol" ? c + "" : c, e), S = (r, c, e) => c.has(r) || N("Cannot " + e);
|
|
7
7
|
var t = (r, c, e) => (S(r, c, "read from private field"), e ? e.call(r) : c.get(r)), f = (r, c, e) => c.has(r) ? N("Cannot add the same private member more than once") : c instanceof WeakSet ? c.add(r) : c.set(r, e), u = (r, c, e, i) => (S(r, c, "write to private field"), i ? i.call(r, e) : c.set(r, e), e), o = (r, c, e) => (S(r, c, "access private method"), e);
|
|
8
|
-
import { A as fe, M as U, N as C, d as pe, e as q, f as Q, b as ye, O as _, L as R, l as be, P as ke, T as ve, Q as W } from "./install-
|
|
9
|
-
import { R as me } from "./vidstack-DqAw8m9J-
|
|
10
|
-
import { E as we } from "./vidstack-DDXt6fpN-
|
|
8
|
+
import { A as fe, M as U, N as C, d as pe, e as q, f as Q, b as ye, O as _, L as R, l as be, P as ke, T as ve, Q as W } from "./install-D_xtJZB0.js";
|
|
9
|
+
import { R as me } from "./vidstack-DqAw8m9J-DRb_cwVy.js";
|
|
10
|
+
import { E as we } from "./vidstack-DDXt6fpN-Dt79RJ4W.js";
|
|
11
11
|
import { resolveVimeoVideoId as Pe, getVimeoVideoInfo as Te } from "./vidstack-krOAtKMi-B4IZWKdc.js";
|
|
12
12
|
const Ce = [
|
|
13
13
|
"bufferend",
|
|
@@ -5,8 +5,8 @@ var B = (r) => {
|
|
|
5
5
|
var q = (r, n, e) => n in r ? A(r, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[n] = e;
|
|
6
6
|
var T = (r, n, e) => q(r, typeof n != "symbol" ? n + "" : n, e), M = (r, n, e) => n.has(r) || B("Cannot " + e);
|
|
7
7
|
var s = (r, n, e) => (M(r, n, "read from private field"), e ? e.call(r) : n.get(r)), p = (r, n, e) => n.has(r) ? B("Cannot add the same private member more than once") : n instanceof WeakSet ? n.add(r) : n.set(r, e), l = (r, n, e, t) => (M(r, n, "write to private field"), t ? t.call(r, e) : n.set(r, e), e), o = (r, n, e) => (M(r, n, "access private method"), e);
|
|
8
|
-
import { A as z, M as G, d as H, e as J, b as K, O as Q, N as C, R as W, v as $, S as X } from "./install-
|
|
9
|
-
import { E as Z } from "./vidstack-DDXt6fpN-
|
|
8
|
+
import { A as z, M as G, d as H, e as J, b as K, O as Q, N as C, R as W, v as $, S as X } from "./install-D_xtJZB0.js";
|
|
9
|
+
import { E as Z } from "./vidstack-DDXt6fpN-Dt79RJ4W.js";
|
|
10
10
|
import { resolveYouTubeVideoId as ee } from "./vidstack-Dm1xEU9Q-qSXq3AI-.js";
|
|
11
11
|
const b = {
|
|
12
12
|
Ended: 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webitel/ui-sdk",
|
|
3
|
-
"version": "25.12.
|
|
3
|
+
"version": "25.12.30",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"make-all": "npm version patch --git-tag-version false && npm run build && (npm run build:types || true) && (npm run lint:fix || true) && npm run publish-lib",
|
|
@@ -62,6 +62,7 @@
|
|
|
62
62
|
"clipboard-copy": "^4.0.1",
|
|
63
63
|
"csv-stringify": "^5.5.3",
|
|
64
64
|
"date-fns": "^4.1.0",
|
|
65
|
+
"date-fns-tz": "^3.2.0",
|
|
65
66
|
"deep-copy": "^1.4.2",
|
|
66
67
|
"deep-equal": "^2.2.3",
|
|
67
68
|
"deepmerge": "^4.3.1",
|
|
@@ -75,6 +75,9 @@
|
|
|
75
75
|
</template>
|
|
76
76
|
|
|
77
77
|
<script>
|
|
78
|
+
import { FormatDateMode } from '@webitel/ui-sdk/enums';
|
|
79
|
+
import { formatDate } from '@webitel/ui-sdk/utils';
|
|
80
|
+
|
|
78
81
|
export default {
|
|
79
82
|
name: 'WtHeaderActions',
|
|
80
83
|
props: {
|
|
@@ -107,7 +110,7 @@ export default {
|
|
|
107
110
|
let buildString = '';
|
|
108
111
|
buildString = `${this.$t('webitelUI.headerActions.buildVersion')}: v${this.buildInfo.release}-${this.buildInfo.build}`;
|
|
109
112
|
if (this.buildInfo.timestamp) {
|
|
110
|
-
buildString += `, ${
|
|
113
|
+
buildString += `, ${formatDate(this.buildInfo.timestamp, FormatDateMode.DATETIME)}`;
|
|
111
114
|
}
|
|
112
115
|
return buildString;
|
|
113
116
|
},
|
|
@@ -1,4 +1,50 @@
|
|
|
1
1
|
export const useTableColumnDrag = (table, reorderableColumns) => {
|
|
2
|
+
let animationFrameId = null;
|
|
3
|
+
let containerEl = null;
|
|
4
|
+
let currentMouseX = null;
|
|
5
|
+
let isDragging = false;
|
|
6
|
+
|
|
7
|
+
const autoScroll = () => {
|
|
8
|
+
if (!containerEl || !isDragging || currentMouseX === null) return;
|
|
9
|
+
|
|
10
|
+
const rect = containerEl.getBoundingClientRect();
|
|
11
|
+
const scrollZone = 150; // pixels from edge to trigger scroll
|
|
12
|
+
const minScrollSpeed = 1; // minimum scroll speed
|
|
13
|
+
const maxScrollSpeed = 25; // maximum scroll speed
|
|
14
|
+
|
|
15
|
+
const distanceFromLeft = currentMouseX - rect.left;
|
|
16
|
+
const distanceFromRight = rect.right - currentMouseX;
|
|
17
|
+
|
|
18
|
+
// Easing function for smooth acceleration (ease-in-out cubic)
|
|
19
|
+
const easeInOutCubic = (t) => {
|
|
20
|
+
return t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Determine scroll direction and distance
|
|
24
|
+
let scrollDirection = 0; // -1 for left, 1 for right, 0 for no scroll
|
|
25
|
+
let distance = 0;
|
|
26
|
+
|
|
27
|
+
if (distanceFromLeft < scrollZone && containerEl.scrollLeft > 0) {
|
|
28
|
+
scrollDirection = -1;
|
|
29
|
+
distance = distanceFromLeft;
|
|
30
|
+
} else if (distanceFromRight < scrollZone) {
|
|
31
|
+
scrollDirection = 1;
|
|
32
|
+
distance = distanceFromRight;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Apply scroll if needed
|
|
36
|
+
if (scrollDirection !== 0) {
|
|
37
|
+
const proximity = 1 - (distance / scrollZone); // 0 to 1, where 1 is at the edge
|
|
38
|
+
const easedProximity = easeInOutCubic(proximity);
|
|
39
|
+
const scrollSpeed = minScrollSpeed + (maxScrollSpeed - minScrollSpeed) * easedProximity;
|
|
40
|
+
containerEl.scrollLeft += scrollSpeed * scrollDirection;
|
|
41
|
+
|
|
42
|
+
animationFrameId = requestAnimationFrame(autoScroll);
|
|
43
|
+
} else {
|
|
44
|
+
animationFrameId = null;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
2
48
|
const tableDragHandler = (event) => {
|
|
3
49
|
event.dataTransfer.effectAllowed = 'move'
|
|
4
50
|
const copyEl = event.target.cloneNode(true);
|
|
@@ -12,16 +58,49 @@ export const useTableColumnDrag = (table, reorderableColumns) => {
|
|
|
12
58
|
setTimeout(() => {
|
|
13
59
|
document.body.removeChild(copyEl);
|
|
14
60
|
}, 0);
|
|
61
|
+
|
|
62
|
+
// Initialize dragging state
|
|
63
|
+
isDragging = true;
|
|
64
|
+
if (!containerEl) {
|
|
65
|
+
containerEl = table.value?.$el?.querySelector('.p-datatable-table-container');
|
|
66
|
+
}
|
|
15
67
|
}
|
|
68
|
+
|
|
69
|
+
const tableDragOverHandler = (event) => {
|
|
70
|
+
// Update mouse position
|
|
71
|
+
currentMouseX = event.clientX;
|
|
72
|
+
|
|
73
|
+
// Start animation loop if not already running
|
|
74
|
+
if (!animationFrameId && isDragging) {
|
|
75
|
+
animationFrameId = requestAnimationFrame(autoScroll);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const tableDragEndHandler = () => {
|
|
80
|
+
// Stop animation loop
|
|
81
|
+
if (animationFrameId) {
|
|
82
|
+
cancelAnimationFrame(animationFrameId);
|
|
83
|
+
animationFrameId = null;
|
|
84
|
+
}
|
|
85
|
+
isDragging = false;
|
|
86
|
+
currentMouseX = null;
|
|
87
|
+
containerEl = null;
|
|
88
|
+
};
|
|
16
89
|
|
|
17
90
|
const addTableDragListener = () => {
|
|
18
91
|
if (!reorderableColumns) return;
|
|
19
|
-
table.value?.$el
|
|
92
|
+
const el = table.value?.$el;
|
|
93
|
+
el?.addEventListener('dragstart', tableDragHandler);
|
|
94
|
+
el?.addEventListener('dragover', tableDragOverHandler);
|
|
95
|
+
el?.addEventListener('dragend', tableDragEndHandler);
|
|
20
96
|
}
|
|
21
97
|
|
|
22
98
|
const removeTableDragListener = () => {
|
|
23
99
|
if (!reorderableColumns) return;
|
|
24
|
-
table.value?.$el
|
|
100
|
+
const el = table.value?.$el;
|
|
101
|
+
el?.removeEventListener('dragstart', tableDragHandler);
|
|
102
|
+
el?.removeEventListener('dragover', tableDragOverHandler);
|
|
103
|
+
el?.removeEventListener('dragend', tableDragEndHandler);
|
|
25
104
|
}
|
|
26
105
|
|
|
27
106
|
return {
|
package/src/enums/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { ChipColor } from './ChipColor/ChipColor';
|
|
|
9
9
|
import { ComponentSize } from './ComponentSize/ComponentSize';
|
|
10
10
|
import { CrudAction } from './CrudAction/CrudAction';
|
|
11
11
|
import { EmptyCause } from './EmptyCause/EmptyCause';
|
|
12
|
+
import { FormatDateMode } from './FormatDateMode/FormatDateMode';
|
|
12
13
|
import IconAction from './IconAction/IconAction.enum.js';
|
|
13
14
|
import { IconColor } from './IconColor/IconColor';
|
|
14
15
|
import { ProcessingTableColumnType } from './ProcessingTableColumnType/ProcessingTableColumnType';
|
|
@@ -38,6 +39,7 @@ export {
|
|
|
38
39
|
CrmSections,
|
|
39
40
|
CrudAction,
|
|
40
41
|
EmptyCause,
|
|
42
|
+
FormatDateMode,
|
|
41
43
|
IconAction,
|
|
42
44
|
IconColor,
|
|
43
45
|
ProcessingTableColumnType,
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
33
|
<script setup lang="ts">
|
|
34
|
+
import { FormatDateMode } from '@webitel/ui-sdk/enums'
|
|
35
|
+
import { formatDate } from '@webitel/ui-sdk/utils'
|
|
34
36
|
import {computed, ref, useTemplateRef } from "vue";
|
|
35
37
|
import { useI18n } from 'vue-i18n';
|
|
36
38
|
import {EngineQuestionAnswer} from "webitel-sdk";
|
|
@@ -53,7 +55,7 @@ const { t } = useI18n();
|
|
|
53
55
|
const initialComment = props.answer.comment; /* prevent editing-info change if comment is changing */
|
|
54
56
|
|
|
55
57
|
const updateTime = computed(() => {
|
|
56
|
-
return
|
|
58
|
+
return formatDate(props.answer.updatedAt, FormatDateMode.DATETIME);
|
|
57
59
|
});
|
|
58
60
|
|
|
59
61
|
const isCommentClamped = props.collapsible && computed(() => {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
+
import { FormatDateMode } from '../enums';
|
|
2
|
+
import { formatDate } from '../utils';
|
|
3
|
+
|
|
1
4
|
const prettifyTime = (time) => {
|
|
2
5
|
let date;
|
|
3
6
|
if (time instanceof Date) date = time;
|
|
4
7
|
else if (typeof time === 'number') date = new Date(time);
|
|
5
8
|
else date = new Date(+time);
|
|
6
|
-
|
|
9
|
+
|
|
10
|
+
return formatDate(date, FormatDateMode.TIME);
|
|
7
11
|
};
|
|
8
12
|
|
|
9
13
|
export default prettifyTime;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Locale } from 'date-fns/locale';
|
|
2
|
+
import { enUS, es, kk, pl, ro, ru, uk, uz, vi } from 'date-fns/locale';
|
|
3
|
+
import { formatInTimeZone } from 'date-fns-tz';
|
|
4
|
+
|
|
5
|
+
import { FormatDateMode } from '../enums';
|
|
6
|
+
import { TIMEZONE_STORAGE_KEY } from '../modules/Userinfo/v2/constants/UserSettingsConstants';
|
|
7
|
+
|
|
8
|
+
const localeMap: Record<string, Locale> = {
|
|
9
|
+
en: enUS,
|
|
10
|
+
ru: ru,
|
|
11
|
+
uk: uk,
|
|
12
|
+
es: es,
|
|
13
|
+
kz: kk,
|
|
14
|
+
pl: pl,
|
|
15
|
+
ro: ro,
|
|
16
|
+
uz: uz,
|
|
17
|
+
vi: vi,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function getUserTimeZone(): string {
|
|
21
|
+
return (
|
|
22
|
+
localStorage.getItem(TIMEZONE_STORAGE_KEY) ||
|
|
23
|
+
Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getUserLocale(): Locale {
|
|
28
|
+
const lang = localStorage.getItem('lang') || 'en';
|
|
29
|
+
return localeMap[lang] || enUS;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function formatDate(
|
|
33
|
+
date: string | number | Date,
|
|
34
|
+
to: typeof FormatDateMode[keyof typeof FormatDateMode],
|
|
35
|
+
): string {
|
|
36
|
+
const timeZone = getUserTimeZone();
|
|
37
|
+
const locale = getUserLocale();
|
|
38
|
+
|
|
39
|
+
// https://date-fns.org/v4.1.0/docs/format
|
|
40
|
+
const formatStaringMap = {
|
|
41
|
+
date: 'P', //MM/DD/YYYY 11/13/2025 | DD.MM.YYYY 13.11.2025
|
|
42
|
+
time: 'p', // 3:53 PM | 15:53
|
|
43
|
+
datetime: 'Ppp', // 11/13/2025, 3:53:00 PM | 13.11.2025, 15:53:00
|
|
44
|
+
datetimeShort: 'Pp', // 11/13/2025, 3:53 PM | 13.11.2025, 15:53
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return formatInTimeZone(date, timeZone, formatStaringMap[to], { locale });
|
|
48
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -9,9 +9,9 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
|
9
9
|
value: string | number;
|
|
10
10
|
required: boolean;
|
|
11
11
|
label: string;
|
|
12
|
+
lang: string;
|
|
12
13
|
placeholder: string;
|
|
13
14
|
mode: string;
|
|
14
|
-
lang: string;
|
|
15
15
|
clearable: boolean;
|
|
16
16
|
v?: Record<string, any>;
|
|
17
17
|
disabledDates?: Record<string, any>;
|
|
@@ -21,9 +21,9 @@ declare const __VLS_component: import("vue").DefineComponent<{}, {
|
|
|
21
21
|
readonly value?: string | number;
|
|
22
22
|
readonly required?: boolean;
|
|
23
23
|
readonly label?: string;
|
|
24
|
+
readonly lang?: string;
|
|
24
25
|
readonly placeholder?: string;
|
|
25
26
|
readonly mode?: string;
|
|
26
|
-
readonly lang?: string;
|
|
27
27
|
readonly clearable?: boolean;
|
|
28
28
|
readonly v?: Record<string, any>;
|
|
29
29
|
readonly disabledDates?: Record<string, any>;
|
package/types/enums/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { ChipColor } from './ChipColor/ChipColor';
|
|
|
8
8
|
import { ComponentSize } from './ComponentSize/ComponentSize';
|
|
9
9
|
import { CrudAction } from './CrudAction/CrudAction';
|
|
10
10
|
import { EmptyCause } from './EmptyCause/EmptyCause';
|
|
11
|
+
import { FormatDateMode } from './FormatDateMode/FormatDateMode';
|
|
11
12
|
import IconAction from './IconAction/IconAction.enum.js';
|
|
12
13
|
import { IconColor } from './IconColor/IconColor';
|
|
13
14
|
import { ProcessingTableColumnType } from './ProcessingTableColumnType/ProcessingTableColumnType';
|
|
@@ -23,4 +24,4 @@ import { WfmSections } from './WebitelApplications/WfmSections';
|
|
|
23
24
|
import { WtApplication } from './WebitelApplications/WtApplication';
|
|
24
25
|
import { WtObject } from './WtObject/WtObject';
|
|
25
26
|
import { WtTypeExtensionFieldKind } from './WtTypeExtensionFieldKind/WtTypeExtensionFieldKind';
|
|
26
|
-
export { AbstractUserStatus, AdminSections, AgentStatus, AuditorSections, ButtonColor, ButtonVariant, ChatGatewayProvider, ChipColor, ComponentSize, CrmSections, CrudAction, EmptyCause, IconAction, IconColor, ProcessingTableColumnType, ProviderIconType, QueueType, QueueTypeName, RelativeDatetimeValue, SupervisorSections, TypesExportedSettings, WebitelApplications, WfmSections, WtApplication, WtObject, WtTypeExtensionFieldKind, };
|
|
27
|
+
export { AbstractUserStatus, AdminSections, AgentStatus, AuditorSections, ButtonColor, ButtonVariant, ChatGatewayProvider, ChipColor, ComponentSize, CrmSections, CrudAction, EmptyCause, FormatDateMode, IconAction, IconColor, ProcessingTableColumnType, ProviderIconType, QueueType, QueueTypeName, RelativeDatetimeValue, SupervisorSections, TypesExportedSettings, WebitelApplications, WfmSections, WtApplication, WtObject, WtTypeExtensionFieldKind, };
|
package/types/utils/index.d.ts
CHANGED