@dv.net/ui-kit 7.5.1 → 7.5.2

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 (28) hide show
  1. package/dist/assets/UiChat.vue_vue_type_script_setup_true_lang.BrVReK9q.js +93 -0
  2. package/dist/assets/UiChatAttachments.vue_vue_type_script_setup_true_lang.mJdMkaps.js +97 -0
  3. package/dist/assets/UiChatFooter.vue_vue_type_script_setup_true_lang.C6KE8NDI.js +103 -0
  4. package/dist/assets/UiChatHeader.vue_vue_type_script_setup_true_lang.BJzoLe2U.js +147 -0
  5. package/dist/assets/UiDatepickerRange.vue_vue_type_script_setup_true_lang.DCzJY2wh.js +240 -0
  6. package/dist/components/UiChat/UiChat.js +1 -1
  7. package/dist/components/UiChat/UiChat.vue.d.ts +107 -2
  8. package/dist/components/UiChat/UiChatAttachments.js +1 -1
  9. package/dist/components/UiChat/UiChatAttachments.vue.d.ts +2 -0
  10. package/dist/components/UiChat/UiChatFooter.js +1 -1
  11. package/dist/components/UiChat/UiChatFooter.vue.d.ts +15 -3
  12. package/dist/components/UiChat/UiChatHeader.js +1 -1
  13. package/dist/components/UiChat/UiChatHeader.vue.d.ts +2 -0
  14. package/dist/components/UiChat/types.d.ts +10 -1
  15. package/dist/components/UiChat/types.js +4 -1
  16. package/dist/components/UiDatepicker/UiDatepickerRange.js +1 -1
  17. package/dist/components/UiDatepicker/UiDatepickerRange.vue.d.ts +13 -4
  18. package/dist/components/UiDatepicker/types.d.ts +1 -0
  19. package/dist/components/UiSkeleton/UiSkeleton.vue.d.ts +1 -1
  20. package/dist/components/UiTextarea/UiTextarea.vue.d.ts +1 -1
  21. package/dist/index.js +2 -2
  22. package/dist/style.css +1 -1
  23. package/package.json +1 -1
  24. package/dist/assets/UiChat.vue_vue_type_script_setup_true_lang.CTu88TXM.js +0 -79
  25. package/dist/assets/UiChatAttachments.vue_vue_type_script_setup_true_lang.CCGby5Jd.js +0 -94
  26. package/dist/assets/UiChatFooter.vue_vue_type_script_setup_true_lang.CqDExA87.js +0 -88
  27. package/dist/assets/UiChatHeader.vue_vue_type_script_setup_true_lang.BT2QlOtu.js +0 -95
  28. package/dist/assets/UiDatepickerRange.vue_vue_type_script_setup_true_lang.BfxSFgGk.js +0 -213
@@ -0,0 +1,93 @@
1
+ import { defineComponent as S, ref as w, computed as n, createElementBlock as o, openBlock as a, createVNode as p, createElementVNode as u, createBlock as d, createCommentVNode as m, Transition as E, withCtx as B, Fragment as y, renderList as h, toDisplayString as D } from "vue";
2
+ import { _ as b } from "./UiChatHeader.vue_vue_type_script_setup_true_lang.BJzoLe2U.js";
3
+ import "./style.C3xG1ALc.js";
4
+ import { _ as F } from "./UiChatFooter.vue_vue_type_script_setup_true_lang.C6KE8NDI.js";
5
+ import { _ as N } from "./UiChatMessage.vue_vue_type_script_setup_true_lang.BuCaTu3U.js";
6
+ /* empty css */
7
+ import { _ as R } from "./UiChatManagerAlert.vue_vue_type_script_setup_true_lang.DzU8TXYU.js";
8
+ /* empty css */
9
+ import { d as T } from "./useDatePicker.DnhbkLG1.js";
10
+ import { config as V } from "../config/index.js";
11
+ import { UiChatTicketStatusValue as v } from "../components/UiChat/types.js";
12
+ import { d as Y } from "./UiChatAttachments.vue_vue_type_script_setup_true_lang.mJdMkaps.js";
13
+ const $ = { class: "ui-chat" }, I = { class: "ui-chat__body" }, O = { class: "ui-chat__group-date" }, ee = /* @__PURE__ */ S({
14
+ __name: "UiChat",
15
+ props: {
16
+ ticket: {},
17
+ messages: { default: () => [] },
18
+ currentUserUuid: {},
19
+ showManagerAlert: { type: Boolean, default: !1 },
20
+ managerAlertSeconds: {},
21
+ ticketLoading: { type: Boolean, default: !1 },
22
+ sendingLoading: { type: Boolean, default: !1 }
23
+ },
24
+ emits: ["action-ticket", "submit", "attach"],
25
+ setup(i, { expose: A, emit: C }) {
26
+ const r = C, f = w(), M = (e) => e.split(" ")[0], L = (e) => e.user.uuid === i.currentUserUuid, l = n(() => !i.messages.length || !i.ticket || !i.currentUserUuid), g = n(
27
+ () => !i.ticket || i.ticket.status.value === v.MANAGER_CLOSED || i.ticket.status.value === v.USER_CLOSED
28
+ ), U = n(() => {
29
+ if (!l.value) return i.messages;
30
+ const e = T().format("DD.MM.YYYY HH:mm");
31
+ return [Y(V.uiChat.translations.defaultMessage, e)];
32
+ }), _ = n(() => {
33
+ const e = {};
34
+ for (const s of U.value) {
35
+ const t = M(s.created_at);
36
+ e[t] || (e[t] = []), e[t].push(s);
37
+ }
38
+ return e;
39
+ });
40
+ return A({ clearInputAndFiles: () => {
41
+ f.value?.clearInputAndFiles();
42
+ } }), (e, s) => (a(), o("div", $, [
43
+ p(b, {
44
+ ticket: e.ticket,
45
+ "is-empty": l.value,
46
+ "is-closed-ticket": g.value,
47
+ "ticket-loading": e.ticketLoading,
48
+ onActionTicket: s[0] || (s[0] = (t) => r("action-ticket", t))
49
+ }, null, 8, ["ticket", "is-empty", "is-closed-ticket", "ticket-loading"]),
50
+ u("div", I, [
51
+ e.ticketLoading ? m("", !0) : (a(), d(E, {
52
+ key: 0,
53
+ name: "alert",
54
+ mode: "out-in",
55
+ appear: ""
56
+ }, {
57
+ default: B(() => [
58
+ e.showManagerAlert ? (a(), d(R, {
59
+ key: 0,
60
+ seconds: e.managerAlertSeconds
61
+ }, null, 8, ["seconds"])) : m("", !0)
62
+ ]),
63
+ _: 1
64
+ })),
65
+ e.ticketLoading ? m("", !0) : (a(!0), o(y, { key: 1 }, h(_.value, (t, k) => (a(), o("div", {
66
+ key: k,
67
+ class: "ui-chat__group"
68
+ }, [
69
+ u("div", O, [
70
+ u("span", null, D(k), 1)
71
+ ]),
72
+ (a(!0), o(y, null, h(t, (c) => (a(), d(N, {
73
+ key: c.id,
74
+ message: c,
75
+ "is-own": L(c)
76
+ }, null, 8, ["message", "is-own"]))), 128))
77
+ ]))), 128))
78
+ ]),
79
+ p(F, {
80
+ ref_key: "footerRef",
81
+ ref: f,
82
+ "is-empty": l.value,
83
+ "is-closed-ticket": g.value,
84
+ "sending-loading": e.sendingLoading,
85
+ onSubmit: s[1] || (s[1] = (t) => r("submit", t)),
86
+ onAttach: s[2] || (s[2] = (t) => r("attach", t))
87
+ }, null, 8, ["is-empty", "is-closed-ticket", "sending-loading"])
88
+ ]));
89
+ }
90
+ });
91
+ export {
92
+ ee as _
93
+ };
@@ -0,0 +1,97 @@
1
+ import { defineComponent as w, ref as o, computed as U, createElementBlock as d, openBlock as h, createElementVNode as i, createVNode as _, Fragment as R, renderList as j, toDisplayString as E } from "vue";
2
+ import { _ as g } from "./UiIcon.vue_vue_type_script_setup_true_lang.BjdWpbZ0.js";
3
+ /* empty css */
4
+ import { _ as I } from "./UiGallery.vue_vue_type_script_setup_true_lang.pDss49af.js";
5
+ /* empty css */
6
+ const J = (n, u) => ({
7
+ id: 0,
8
+ ticket_id: 0,
9
+ message: n,
10
+ created_at: u,
11
+ updated_at: u,
12
+ files: [],
13
+ attachments: [],
14
+ user: { uuid: "", avatar: null, telegram: null, email: "", name: null }
15
+ }), O = 10, f = ["jpg", "jpeg", "png", "heic", "heif"], K = f.join(", "), V = f.map((n) => `.${n}`).join(","), M = { class: "ui-chat-attachments" }, S = ["accept", "multiple"], $ = { class: "ui-chat-attachments__file" }, H = ["src", "alt"], x = { class: "ui-chat-attachments__overlay" }, B = ["onClick"], D = ["disabled", "onClick"], P = { class: "ui-chat-attachments__description" }, Q = /* @__PURE__ */ w({
16
+ __name: "UiChatAttachments",
17
+ props: {
18
+ maxFiles: { default: () => O },
19
+ accept: { default: () => V },
20
+ sendingLoading: { type: Boolean, default: !1 }
21
+ },
22
+ emits: ["change"],
23
+ setup(n, { expose: u, emit: A }) {
24
+ const r = A, v = o(), t = o([]), l = o(/* @__PURE__ */ new Map()), F = () => {
25
+ t.value.length >= n.maxFiles || n.sendingLoading || v.value?.click();
26
+ }, y = (e) => {
27
+ const a = e.target;
28
+ if (!a.files?.length) return;
29
+ const s = n.maxFiles - t.value.length, c = Array.from(a.files).slice(0, s);
30
+ t.value.push(...c), r("change", t.value), a.value = "";
31
+ }, C = (e) => {
32
+ if (n.sendingLoading) return;
33
+ const a = l.value.get(t.value[e]);
34
+ a && (window.URL.revokeObjectURL(a), l.value.delete(t.value[e])), t.value.splice(e, 1), r("change", t.value);
35
+ }, L = (e) => (l.value.has(e) || l.value.set(e, window.URL.createObjectURL(e)), l.value.get(e)), m = o(!1), p = o(0), b = U(() => t.value.map((e) => ({ file: e }))), k = (e) => {
36
+ p.value = e, m.value = !0;
37
+ };
38
+ return u({ openFileDialog: F, clearFiles: () => {
39
+ l.value.forEach((e) => window.URL.revokeObjectURL(e)), l.value.clear(), t.value = [], r("change", []);
40
+ } }), (e, a) => (h(), d("div", M, [
41
+ i("input", {
42
+ ref_key: "fileInput",
43
+ ref: v,
44
+ type: "file",
45
+ accept: e.accept,
46
+ multiple: e.maxFiles > 1,
47
+ hidden: "",
48
+ onChange: y
49
+ }, null, 40, S),
50
+ (h(!0), d(R, null, j(t.value, (s, c) => (h(), d("div", {
51
+ key: c,
52
+ class: "ui-chat-attachments__item"
53
+ }, [
54
+ i("div", $, [
55
+ i("img", {
56
+ src: L(s),
57
+ alt: s.name
58
+ }, null, 8, H),
59
+ i("div", x, [
60
+ i("button", {
61
+ class: "ui-chat-attachments__btn ui-chat-attachments__btn--show",
62
+ onClick: (T) => k(c)
63
+ }, [
64
+ _(g, {
65
+ name: "visibility",
66
+ type: "400"
67
+ })
68
+ ], 8, B),
69
+ i("button", {
70
+ class: "ui-chat-attachments__btn ui-chat-attachments__btn--remove",
71
+ disabled: e.sendingLoading,
72
+ onClick: (T) => C(c)
73
+ }, [
74
+ _(g, {
75
+ name: "close",
76
+ type: "400"
77
+ })
78
+ ], 8, D)
79
+ ])
80
+ ]),
81
+ i("span", P, E(s.name), 1)
82
+ ]))), 128)),
83
+ _(I, {
84
+ modelValue: m.value,
85
+ "onUpdate:modelValue": a[0] || (a[0] = (s) => m.value = s),
86
+ images: b.value,
87
+ "initial-index": p.value
88
+ }, null, 8, ["modelValue", "images", "initial-index"])
89
+ ]));
90
+ }
91
+ });
92
+ export {
93
+ O as A,
94
+ Q as _,
95
+ K as a,
96
+ J as d
97
+ };
@@ -0,0 +1,103 @@
1
+ import { defineComponent as A, ref as m, computed as x, createElementBlock as L, createCommentVNode as g, openBlock as _, createElementVNode as t, createVNode as r, createBlock as T, withCtx as h, renderSlot as v, toDisplayString as d, unref as l, normalizeClass as $ } from "vue";
2
+ import { A as c, a as B, _ as V } from "./UiChatAttachments.vue_vue_type_script_setup_true_lang.mJdMkaps.js";
3
+ /* empty css */
4
+ import { _ as y } from "./UiIconButton.vue_vue_type_script_setup_true_lang.cJvSLKjQ.js";
5
+ import "./style.C3xG1ALc.js";
6
+ import { _ as E } from "./UiTextarea.vue_vue_type_script_setup_true_lang.bD1zcxkh.js";
7
+ /* empty css */
8
+ import { _ as S } from "./UiTooltip.vue_vue_type_script_setup_true_lang.DNZTJcY4.js";
9
+ import { config as p } from "../config/index.js";
10
+ const z = {
11
+ key: 0,
12
+ class: "ui-chat__footer-wrapper"
13
+ }, w = { class: "ui-chat__footer" }, I = { class: "ui-chat__footer-tooltip" }, M = { class: "ui-chat__footer-input" }, G = /* @__PURE__ */ A({
14
+ __name: "UiChatFooter",
15
+ props: {
16
+ isEmpty: { type: Boolean },
17
+ isClosedTicket: { type: Boolean },
18
+ sendingLoading: { type: Boolean, default: !1 }
19
+ },
20
+ emits: ["submit", "attach"],
21
+ setup(C, { expose: F, emit: b }) {
22
+ const u = b, a = m(null), i = m([]), n = m(), k = x(() => i.value.length >= c), f = () => {
23
+ !a.value || C.sendingLoading || u("submit", { message: a.value, files: i.value });
24
+ };
25
+ return F({ clearInputAndFiles: () => {
26
+ if (a.value = null, n.value?.clearFiles) {
27
+ n.value.clearFiles();
28
+ return;
29
+ }
30
+ i.value = [], u("attach", []);
31
+ } }), (e, o) => e.isClosedTicket ? g("", !0) : (_(), L("div", z, [
32
+ t("div", w, [
33
+ k.value ? g("", !0) : (_(), T(S, { key: 0 }, {
34
+ text: h(() => [
35
+ t("p", I, [
36
+ t("span", null, d(l(p).uiChat.translations.maxFiles) + ": " + d(l(c)), 1),
37
+ t("span", null, d(l(p).uiChat.translations.supportsFormats) + ": " + d(l(B)), 1)
38
+ ])
39
+ ]),
40
+ default: h(() => [
41
+ t("div", {
42
+ style: { "margin-left": "-16px" },
43
+ onClick: o[0] || (o[0] = (s) => n.value?.openFileDialog())
44
+ }, [
45
+ v(e.$slots, "footer-left", {}, () => [
46
+ r(y, {
47
+ "icon-name": "attach-file_add",
48
+ type: "clear",
49
+ "icon-type": "100",
50
+ "icon-color": "#1968e5",
51
+ size: "xl",
52
+ disabled: e.sendingLoading
53
+ }, null, 8, ["disabled"])
54
+ ])
55
+ ])
56
+ ]),
57
+ _: 3
58
+ })),
59
+ t("div", M, [
60
+ r(E, {
61
+ modelValue: a.value,
62
+ "onUpdate:modelValue": o[1] || (o[1] = (s) => a.value = s),
63
+ size: "auto",
64
+ placeholder: l(p).uiChat.translations.messagePlaceholder,
65
+ submitOnEnter: "",
66
+ disabled: e.sendingLoading,
67
+ onSubmit: f,
68
+ "is-empty-value-null": ""
69
+ }, null, 8, ["modelValue", "placeholder", "disabled"])
70
+ ]),
71
+ t("div", {
72
+ style: { "margin-right": "-16px", width: "48px", height: "48px" },
73
+ onClick: f
74
+ }, [
75
+ v(e.$slots, "footer-right", {}, () => [
76
+ r(y, {
77
+ "icon-name": "send",
78
+ type: "clear",
79
+ "icon-type": "400",
80
+ "icon-color": "#1968e5",
81
+ size: "xl",
82
+ loading: e.sendingLoading,
83
+ disabled: !a.value
84
+ }, null, 8, ["loading", "disabled"])
85
+ ])
86
+ ])
87
+ ]),
88
+ r(V, {
89
+ ref_key: "attachmentsRef",
90
+ ref: n,
91
+ "max-files": l(c),
92
+ "sending-loading": e.sendingLoading,
93
+ class: $(["ui-chat__footer-attachments", { "ui-chat__footer-attachments--empty": !i.value.length }]),
94
+ onChange: o[2] || (o[2] = (s) => {
95
+ i.value = s, u("attach", s);
96
+ })
97
+ }, null, 8, ["max-files", "sending-loading", "class"])
98
+ ]));
99
+ }
100
+ });
101
+ export {
102
+ G as _
103
+ };
@@ -0,0 +1,147 @@
1
+ import { defineComponent as b, ref as w, computed as p, createElementBlock as c, openBlock as i, createElementVNode as t, createCommentVNode as u, createVNode as m, createBlock as V, unref as n, Fragment as B, toDisplayString as a, withCtx as _, normalizeStyle as S } from "vue";
2
+ import { _ as h } from "./UiIcon.vue_vue_type_script_setup_true_lang.BjdWpbZ0.js";
3
+ /* empty css */
4
+ import { _ as T } from "./UiSelect.vue_vue_type_script_setup_true_lang.KW-gAx4L.js";
5
+ import "./style.C3xG1ALc.js";
6
+ import { config as s } from "../config/index.js";
7
+ import "./vue3-lottie.es.BGWavb2-.js";
8
+ /* empty css */
9
+ /* empty css */
10
+ /* empty css */
11
+ /* empty css */
12
+ /* empty css */
13
+ /* empty css */
14
+ /* empty css */
15
+ import "./useDatePicker.DnhbkLG1.js";
16
+ /* empty css */
17
+ /* empty css */
18
+ import "../components/UiDatepicker/composables/useDatePickerPresets.js";
19
+ /* empty css */
20
+ /* empty css */
21
+ /* empty css */
22
+ /* empty css */
23
+ /* empty css */
24
+ /* empty css */
25
+ /* empty css */
26
+ /* empty css */
27
+ import "vue-router";
28
+ /* empty css */
29
+ /* empty css */
30
+ /* empty css */
31
+ import { _ as k } from "./UiSkeleton.vue_vue_type_script_setup_true_lang.DdPvBHJ7.js";
32
+ /* empty css */
33
+ /* empty css */
34
+ /* empty css */
35
+ /* empty css */
36
+ const E = { class: "ui-chat__header" }, z = { class: "ui-chat__header-content" }, A = { class: "ui-chat__header-icon" }, L = { class: "ui-chat__header-info" }, N = { class: "ui-chat__header-ticket" }, O = { class: "ui-chat__header-title" }, $ = {
37
+ key: 0,
38
+ class: "ui-chat__header-id"
39
+ }, U = { class: "ui-chat__header-support" }, j = { class: "ui-chat__header-name" }, D = {
40
+ key: 0,
41
+ class: "ui-chat__actions"
42
+ }, F = {
43
+ key: 1,
44
+ class: "ui-chat__actions"
45
+ }, H = { class: "ui-chat__actions-selected" }, Ct = /* @__PURE__ */ b({
46
+ __name: "UiChatHeader",
47
+ props: {
48
+ ticket: {},
49
+ isEmpty: { type: Boolean },
50
+ isClosedTicket: { type: Boolean },
51
+ ticketLoading: { type: Boolean, default: !1 }
52
+ },
53
+ emits: ["action-ticket"],
54
+ setup(d, { emit: f }) {
55
+ const v = f, r = w(null), y = p(() => [
56
+ {
57
+ value: "remind-ticket",
58
+ label: s.uiChat.translations.remindAboutTicket,
59
+ icon: "notifications-active"
60
+ },
61
+ {
62
+ value: "change-operator",
63
+ label: s.uiChat.translations.changeOperator,
64
+ icon: "sync-alt"
65
+ },
66
+ {
67
+ value: "close-ticket",
68
+ label: s.uiChat.translations.closeTicket,
69
+ icon: "delete",
70
+ color: "var(--color-text-negative)"
71
+ }
72
+ ]), g = p(() => !d.isEmpty && !d.isClosedTicket), C = () => {
73
+ r.value && v("action-ticket", r.value), r.value = null;
74
+ };
75
+ return (e, l) => (i(), c("div", E, [
76
+ t("div", z, [
77
+ t("div", A, [
78
+ m(h, {
79
+ name: "support-agent 2",
80
+ type: "100"
81
+ })
82
+ ]),
83
+ t("div", L, [
84
+ e.ticketLoading ? (i(), V(n(k), {
85
+ key: 0,
86
+ class: "ui-chat__header-info-skeleton",
87
+ "row-height": 36,
88
+ rows: 1,
89
+ "item-border-radius": 6,
90
+ "first-color": "var(--color-background-tertiary)",
91
+ "second-color": "var(--color-background-primary)"
92
+ })) : (i(), c(B, { key: 1 }, [
93
+ t("div", N, [
94
+ t("span", O, a(e.ticket?.subject || n(s).uiChat.translations.newTicket), 1),
95
+ e.ticket?.id ? (i(), c("span", $, a(n(s).uiChat.translations.ticket) + " #" + a(e.ticket.id), 1)) : u("", !0)
96
+ ]),
97
+ t("div", U, [
98
+ t("span", j, a(e.ticket?.support_name || "Sofia"), 1),
99
+ l[1] || (l[1] = t("span", { class: "ui-chat__header-status" }, "Online", -1))
100
+ ])
101
+ ], 64))
102
+ ])
103
+ ]),
104
+ e.ticketLoading ? (i(), c("div", D, [
105
+ m(n(k), {
106
+ "row-height": 36,
107
+ rows: 1,
108
+ "item-border-radius": 6,
109
+ "first-color": "var(--color-background-tertiary)",
110
+ "second-color": "var(--color-background-primary)"
111
+ })
112
+ ])) : g.value ? (i(), c("div", F, [
113
+ m(T, {
114
+ modelValue: r.value,
115
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => r.value = o),
116
+ options: y.value,
117
+ size: "sm",
118
+ placement: "bottom-end",
119
+ "fit-content-width": !1,
120
+ teleport: !1,
121
+ onChange: C
122
+ }, {
123
+ selected: _(() => [
124
+ t("span", H, a(n(s).uiChat.translations.actions), 1)
125
+ ]),
126
+ default: _(({ option: o }) => [
127
+ t("span", {
128
+ class: "ui-chat__actions-item",
129
+ style: S(o.color && { color: o.color })
130
+ }, [
131
+ m(h, {
132
+ name: o.icon,
133
+ type: "400",
134
+ size: "sm"
135
+ }, null, 8, ["name"]),
136
+ t("span", null, a(o.label), 1)
137
+ ], 4)
138
+ ]),
139
+ _: 1
140
+ }, 8, ["modelValue", "options"])
141
+ ])) : u("", !0)
142
+ ]));
143
+ }
144
+ });
145
+ export {
146
+ Ct as _
147
+ };
@@ -0,0 +1,240 @@
1
+ import { defineComponent as X, mergeModels as Z, useModel as Y, computed as k, ref as $, onMounted as x, createElementBlock as P, openBlock as p, normalizeClass as ee, createVNode as r, unref as t, withCtx as s, createElementVNode as D, createCommentVNode as z, renderSlot as N, createBlock as R, createTextVNode as C, toDisplayString as y } from "vue";
2
+ import { _ as te } from "./DatePickerInputs.vue_vue_type_script_setup_true_lang.BDpkRcEN.js";
3
+ import { Q as ae } from "./style.C3xG1ALc.js";
4
+ import { _ as ie } from "./DatePickerPresets.vue_vue_type_script_setup_true_lang.CKckhapZ.js";
5
+ /* empty css */
6
+ import { _ as oe } from "./DatePickerSlider.vue_vue_type_script_setup_true_lang.BGkzUy3Z.js";
7
+ import { _ as U } from "./UiIconButton.vue_vue_type_script_setup_true_lang.cJvSLKjQ.js";
8
+ import { a as le } from "./index.Cp1LhIxy.js";
9
+ import "./vue3-lottie.es.BGWavb2-.js";
10
+ import { _ as F } from "./UiButton.vue_vue_type_script_setup_true_lang.C58Ve9-q.js";
11
+ import { _ as ne } from "./UiIcon.vue_vue_type_script_setup_true_lang.BjdWpbZ0.js";
12
+ /* empty css */
13
+ /* empty css */
14
+ import { config as b } from "../config/index.js";
15
+ /* empty css */
16
+ /* empty css */
17
+ /* empty css */
18
+ /* empty css */
19
+ /* empty css */
20
+ /* empty css */
21
+ /* empty css */
22
+ import { u as re } from "./useDatePicker.DnhbkLG1.js";
23
+ /* empty css */
24
+ import { useDatePickerPresets as se } from "../components/UiDatepicker/composables/useDatePickerPresets.js";
25
+ import { useDatePickerSelected as me } from "../components/UiDatepicker/composables/useDatePickerSelected.js";
26
+ /* empty css */
27
+ /* empty css */
28
+ /* empty css */
29
+ /* empty css */
30
+ /* empty css */
31
+ /* empty css */
32
+ /* empty css */
33
+ /* empty css */
34
+ import "vue-router";
35
+ /* empty css */
36
+ /* empty css */
37
+ /* empty css */
38
+ /* empty css */
39
+ /* empty css */
40
+ /* empty css */
41
+ /* empty css */
42
+ const ue = {
43
+ key: 1,
44
+ class: "ui-datepicker__trigger"
45
+ }, de = { class: "ui-datepicker__navigate" }, ce = { class: "ui-datepicker__navigate-value" }, pe = { class: "ui-datepicker__actions" }, ve = {
46
+ key: 0,
47
+ class: "ui-datepicker__actions-slot"
48
+ }, fe = { class: "ui-datepicker__actions-btns" }, it = /* @__PURE__ */ X({
49
+ __name: "UiDatepickerRange",
50
+ props: /* @__PURE__ */ Z({
51
+ disabled: { type: Boolean },
52
+ beginDate: {},
53
+ size: { default: "xs" },
54
+ clearable: { type: Boolean },
55
+ autoApply: { type: Boolean },
56
+ maxDate: {},
57
+ minDate: {},
58
+ timezone: {},
59
+ single: { type: Boolean },
60
+ hideSliderArrows: { type: Boolean },
61
+ enableTimePicker: { type: Boolean, default: !1 }
62
+ }, {
63
+ modelValue: { default: [] },
64
+ modelModifiers: {}
65
+ }),
66
+ emits: ["update:modelValue"],
67
+ setup(w) {
68
+ const n = w, i = Y(w, "modelValue"), { width: E } = le(), { dayjs: m, today: Q, endDate: _, startDate: V, beginDate: j, modelValueFormat: h } = re(i), M = k(
69
+ () => n.enableTimePicker ? `${h.value} HH:mm` : h.value
70
+ ), u = $(), l = $(["", ""]), d = $(!1), W = k(
71
+ () => n.beginDate ? m(n.beginDate).format(h.value) : null
72
+ ), v = k(() => n.maxDate ?? Q), B = k(() => n.minDate), { presets: f } = se({ beginDate: W.value ?? j.value }), { isAllTimeSelected: q, selectedDate: A, formattedSelectedDate: G, selectedRange: J } = me({
73
+ presets: f,
74
+ startDate: V,
75
+ endDate: _,
76
+ minDate: B,
77
+ maxDate: v
78
+ });
79
+ function K(e) {
80
+ H(e.date), u.value.closeMenu();
81
+ }
82
+ function L(e) {
83
+ if (!e) return;
84
+ const a = Array.isArray(e) ? e : [e, e];
85
+ d.value = e.length < 2, a.length === 2 && (l.value = a);
86
+ }
87
+ function T(e) {
88
+ i.value = [m(e[0]).format(M.value), m(e[1]).format(M.value)];
89
+ }
90
+ function H(e) {
91
+ const a = Array.isArray(e) ? e : [e, e];
92
+ if (V.value && _.value) {
93
+ const o = n.enableTimePicker ? "minute" : "day";
94
+ V.value.isSame(a[0], o) && _.value.isSame(a[1], o) || T(a);
95
+ } else
96
+ T(a);
97
+ }
98
+ function O() {
99
+ const e = n.single ? m(l.value[0], b.uiDatePicker.modelValueFormat).toDate() : l.value;
100
+ u.value?.updateInternalModelValue(e), u.value?.setMonthYear({
101
+ month: m(l.value[0]).month(),
102
+ year: m(l.value[0]).year()
103
+ });
104
+ }
105
+ const I = () => {
106
+ i.value = [], l.value = ["", ""], d.value = !0, u.value?.closeMenu();
107
+ };
108
+ return x(() => {
109
+ i.value.length || (d.value = !0);
110
+ }), (e, a) => (p(), P("div", {
111
+ class: ee(["ui-datepicker-range", [e.size, { "is-disabled": e.disabled }]])
112
+ }, [
113
+ r(oe, {
114
+ disabled: !i.value.length || t(q),
115
+ modelValue: i.value,
116
+ "onUpdate:modelValue": a[2] || (a[2] = (o) => i.value = o),
117
+ "selected-range": t(J),
118
+ "is-show": !e.hideSliderArrows,
119
+ "min-date": B.value,
120
+ "max-date": v.value
121
+ }, {
122
+ default: s(() => [
123
+ r(t(ae), {
124
+ position: "center",
125
+ locale: t(b).locale,
126
+ ref_key: "pickerRef",
127
+ ref: u,
128
+ "model-value": e.single ? i.value[0] : i.value,
129
+ "enable-time-picker": e.enableTimePicker,
130
+ "time-picker-inline": e.enableTimePicker,
131
+ "hours-grid-increment": 1,
132
+ "minutes-grid-increment": 1,
133
+ range: !e.single,
134
+ "multi-calendars": !e.single && t(E) > 1e3,
135
+ "month-name-format": "long",
136
+ "max-date": v.value,
137
+ "min-date": B.value,
138
+ "start-date": v.value,
139
+ "auto-apply": e.autoApply,
140
+ offset: 0,
141
+ timezone: e.timezone,
142
+ "onUpdate:modelValue": H,
143
+ onInternalModelChange: L
144
+ }, {
145
+ "left-sidebar": s(() => [
146
+ !e.single && t(f).length ? (p(), R(ie, {
147
+ key: 0,
148
+ presets: t(f),
149
+ date: l.value,
150
+ onChange: K
151
+ }, null, 8, ["presets", "date"])) : z("", !0),
152
+ r(te, {
153
+ onChange: O,
154
+ onSubmit: a[0] || (a[0] = (o) => u.value.selectDate()),
155
+ modelValue: l.value,
156
+ "onUpdate:modelValue": a[1] || (a[1] = (o) => l.value = o),
157
+ single: e.single
158
+ }, null, 8, ["modelValue", "single"])
159
+ ]),
160
+ trigger: s(() => [
161
+ e.$slots.trigger ? N(e.$slots, "trigger", {
162
+ key: 0,
163
+ date: i.value,
164
+ presets: t(f),
165
+ selectedDate: t(A),
166
+ formattedSelectedDate: t(G)
167
+ }) : (p(), P("button", ue, [
168
+ r(t(ne), {
169
+ type: "400",
170
+ name: "calendar-month"
171
+ }),
172
+ C(y(t(A)), 1)
173
+ ]))
174
+ ]),
175
+ "month-year": s(({ month: o, months: c, handleMonthYearChange: g }) => [
176
+ D("div", de, [
177
+ r(U, {
178
+ onClick: (S) => g && g(!1),
179
+ "icon-type": "400",
180
+ size: "lg",
181
+ "icon-name": "chevron-left 1",
182
+ "no-size": ""
183
+ }, null, 8, ["onClick"]),
184
+ D("span", ce, y(c?.find((S) => S.value === o)?.text), 1),
185
+ r(U, {
186
+ onClick: (S) => g && g(!0),
187
+ "icon-type": "400",
188
+ size: "lg",
189
+ "icon-name": "chevron-right",
190
+ "no-size": ""
191
+ }, null, 8, ["onClick"])
192
+ ])
193
+ ]),
194
+ "action-row": s(({ disabled: o, selectDate: c }) => [
195
+ D("div", pe, [
196
+ e.$slots["action-row"] ? (p(), P("div", ve, [
197
+ N(e.$slots, "action-row", {
198
+ disabled: o,
199
+ selectDate: c,
200
+ clearDate: I,
201
+ isDisabledBtn: d.value,
202
+ modelValue: i.value,
203
+ clearable: e.clearable
204
+ })
205
+ ])) : z("", !0),
206
+ D("div", fe, [
207
+ r(t(F), {
208
+ disabled: d.value || o,
209
+ mode: "neutral",
210
+ onClick: c
211
+ }, {
212
+ default: s(() => [
213
+ C(y(t(b).uiDatePicker.translations.applyButton), 1)
214
+ ]),
215
+ _: 2
216
+ }, 1032, ["disabled", "onClick"]),
217
+ i.value.length && e.clearable ? (p(), R(t(F), {
218
+ key: 0,
219
+ type: "secondary",
220
+ onClick: I
221
+ }, {
222
+ default: s(() => [
223
+ C(y(t(b).uiDatePicker.translations.clearButton), 1)
224
+ ]),
225
+ _: 1
226
+ })) : z("", !0)
227
+ ])
228
+ ])
229
+ ]),
230
+ _: 3
231
+ }, 8, ["locale", "model-value", "enable-time-picker", "time-picker-inline", "range", "multi-calendars", "max-date", "min-date", "start-date", "auto-apply", "timezone"])
232
+ ]),
233
+ _: 3
234
+ }, 8, ["disabled", "modelValue", "selected-range", "is-show", "min-date", "max-date"])
235
+ ], 2));
236
+ }
237
+ });
238
+ export {
239
+ it as _
240
+ };