voiptime-components 0.0.9 → 0.0.11

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/index.es.js CHANGED
@@ -1,56 +1,1759 @@
1
- import { defineComponent as s, createElementBlock as l, openBlock as r, renderSlot as a, createElementVNode as u, computed as _, createBlock as m, createCommentVNode as p, resolveDynamicComponent as i } from "vue";
2
- const d = /* @__PURE__ */ s({
3
- __name: "VButton",
4
- setup(n) {
5
- function t() {
6
- alert("Hello World1!");
7
- }
8
- return (o, e) => (r(), l("button", {
9
- class: "vt-button",
10
- onClick: t
11
- }, [
12
- a(o.$slots, "default")
13
- ]));
14
- }
15
- }), f = (n, t) => {
16
- const o = n.__vccOpts || n;
17
- for (const [e, c] of t)
18
- o[e] = c;
19
- return o;
20
- }, k = {}, v = {
1
+ import { createElementBlock as h, openBlock as p, createElementVNode as f, defineComponent as oe, computed as S, createBlock as ie, createCommentVNode as V, resolveDynamicComponent as Ie, useSlots as Re, resolveDirective as Be, withDirectives as be, normalizeClass as E, renderSlot as re, Teleport as Ne, normalizeStyle as le, withModifiers as ce, toDisplayString as Q, watch as ue, Fragment as te, renderList as ne, vModelSelect as Ze, createVNode as j, withCtx as ge, createTextVNode as de, ref as P, createApp as Fe, h as fe, onMounted as me, onUnmounted as Te, nextTick as Ue, mergeModels as we, useModel as qe, reactive as Xe, provide as Ge, unref as U, inject as Ke } from "vue";
2
+ const X = (e, t) => {
3
+ const n = e.__vccOpts || e;
4
+ for (const [o, s] of t)
5
+ n[o] = s;
6
+ return n;
7
+ }, Ye = {}, Je = {
8
+ width: "20",
9
+ height: "20",
10
+ viewBox: "0 0 20 20",
11
+ fill: "none",
12
+ xmlns: "http://www.w3.org/2000/svg"
13
+ };
14
+ function Qe(e, t) {
15
+ return p(), h("svg", Je, t[0] || (t[0] = [
16
+ f("path", {
17
+ d: "M14 8L10 12L6 8",
18
+ stroke: "currentColor",
19
+ "stroke-width": "1.5",
20
+ "stroke-linecap": "round",
21
+ "stroke-linejoin": "round"
22
+ }, null, -1)
23
+ ]));
24
+ }
25
+ const et = /* @__PURE__ */ X(Ye, [["render", Qe]]), tt = {}, nt = {
26
+ width: "20",
27
+ height: "20",
28
+ viewBox: "0 0 20 20",
29
+ fill: "none",
30
+ xmlns: "http://www.w3.org/2000/svg"
31
+ };
32
+ function ot(e, t) {
33
+ return p(), h("svg", nt, t[0] || (t[0] = [
34
+ f("path", {
35
+ d: "M6 12L10 8L14 12",
36
+ stroke: "currentColor",
37
+ "stroke-width": "1.5",
38
+ "stroke-linecap": "round",
39
+ "stroke-linejoin": "round"
40
+ }, null, -1)
41
+ ]));
42
+ }
43
+ const lt = /* @__PURE__ */ X(tt, [["render", ot]]), st = {}, it = {
44
+ width: "14",
45
+ height: "15",
46
+ viewBox: "0 0 14 15",
47
+ fill: "none",
48
+ xmlns: "http://www.w3.org/2000/svg"
49
+ };
50
+ function at(e, t) {
51
+ return p(), h("svg", it, t[0] || (t[0] = [
52
+ f("path", {
53
+ d: "M11.8789 4.90517L11.2561 4.20124C10.4045 3.33504 9.28504 2.7626 8.06789 2.5709C6.85074 2.3792 5.60245 2.57874 4.5127 3.13917C3.42296 3.69961 2.55134 4.59032 2.03031 5.67593C1.50928 6.76155 1.36732 7.98272 1.626 9.15387C1.88469 10.325 2.52987 11.3821 3.46351 12.1645C4.39716 12.9469 5.56821 13.4119 6.79871 13.4887C8.02921 13.5655 9.25189 13.25 10.2809 12.5901C11.31 11.9302 12.0891 10.962 12.5 9.83266",
54
+ stroke: "currentColor",
55
+ "stroke-width": "1.5",
56
+ "stroke-miterlimit": "10",
57
+ "stroke-linecap": "round"
58
+ }, null, -1),
59
+ f("path", {
60
+ d: "M8.5157 6.5C8.07025 6.5 7.84716 5.96143 8.16215 5.64645L10.3086 3.5L12.455 1.35355C12.77 1.03857 13.3086 1.26165 13.3086 1.70711V6C13.3086 6.27614 13.0847 6.5 12.8086 6.5L8.5157 6.5Z",
61
+ fill: "currentColor"
62
+ }, null, -1)
63
+ ]));
64
+ }
65
+ const rt = /* @__PURE__ */ X(st, [["render", at]]), ct = {}, ut = {
66
+ width: "21",
67
+ height: "20",
68
+ viewBox: "0 0 21 20",
69
+ fill: "none",
70
+ xmlns: "http://www.w3.org/2000/svg"
71
+ };
72
+ function dt(e, t) {
73
+ return p(), h("svg", ut, t[0] || (t[0] = [
74
+ f("path", {
75
+ d: "M8.60352 6L12.6035 10L8.60352 14",
76
+ stroke: "currentColor",
77
+ "stroke-width": "1.5",
78
+ "stroke-linecap": "round",
79
+ "stroke-linejoin": "round"
80
+ }, null, -1)
81
+ ]));
82
+ }
83
+ const pt = /* @__PURE__ */ X(ct, [["render", dt]]), mt = {}, ht = {
84
+ width: "21",
85
+ height: "20",
86
+ viewBox: "0 0 21 20",
87
+ fill: "none",
88
+ xmlns: "http://www.w3.org/2000/svg"
89
+ };
90
+ function vt(e, t) {
91
+ return p(), h("svg", ht, t[0] || (t[0] = [
92
+ f("path", {
93
+ d: "M12.3984 14L8.39844 10L12.3984 6",
94
+ stroke: "currentColor",
95
+ "stroke-width": "1.5",
96
+ "stroke-linecap": "round",
97
+ "stroke-linejoin": "round"
98
+ }, null, -1)
99
+ ]));
100
+ }
101
+ const ft = /* @__PURE__ */ X(mt, [["render", vt]]), _t = {}, gt = {
102
+ width: "20",
103
+ height: "20",
104
+ viewBox: "0 0 20 20",
105
+ fill: "none",
106
+ xmlns: "http://www.w3.org/2000/svg"
107
+ };
108
+ function Ct(e, t) {
109
+ return p(), h("svg", gt, t[0] || (t[0] = [
110
+ f("path", {
111
+ d: "M12.5 1.66406L11.1783 2.94156C10.6233 3.47906 10.345 3.7474 10 3.7474C9.655 3.7474 9.37667 3.47906 8.82167 2.94156L7.5 1.66406M14.5833 5.83073C15.7533 5.83073 16.3392 5.83073 16.7592 6.11156C16.9412 6.23319 17.0975 6.3895 17.2192 6.57156C17.5 6.99156 17.5 7.5774 17.5 8.7474V15.4141C17.5 16.5841 17.5 17.1699 17.2192 17.5899C17.0975 17.772 16.9412 17.9283 16.7592 18.0499C16.3392 18.3307 15.7533 18.3307 14.5833 18.3307C13.4133 18.3307 12.8275 18.3307 12.4075 18.0499C12.2254 17.9283 12.0691 17.772 11.9475 17.5899C11.6667 17.1699 11.6667 16.5841 11.6667 15.4141V8.7474C11.6667 7.5774 11.6667 6.99156 11.9475 6.57156C12.0691 6.3895 12.2254 6.23319 12.4075 6.11156C12.8275 5.83073 13.4133 5.83073 14.5833 5.83073ZM5.41667 5.83073C6.58667 5.83073 7.1725 5.83073 7.5925 6.11156C7.77456 6.23319 7.93087 6.3895 8.0525 6.57156C8.33333 6.99156 8.33333 7.5774 8.33333 8.7474V15.4141C8.33333 16.5841 8.33333 17.1699 8.0525 17.5899C7.93087 17.772 7.77456 17.9283 7.5925 18.0499C7.1725 18.3307 6.58667 18.3307 5.41667 18.3307C4.24667 18.3307 3.66083 18.3307 3.24083 18.0499C3.05877 17.9283 2.90246 17.772 2.78083 17.5899C2.5 17.1699 2.5 16.5841 2.5 15.4141V8.7474C2.5 7.5774 2.5 6.99156 2.78083 6.57156C2.90246 6.3895 3.05877 6.23319 3.24083 6.11156C3.66083 5.83073 4.24667 5.83073 5.41667 5.83073Z",
112
+ stroke: "currentColor",
113
+ "stroke-width": "1.5",
114
+ "stroke-linecap": "round",
115
+ "stroke-linejoin": "round"
116
+ }, null, -1)
117
+ ]));
118
+ }
119
+ const bt = /* @__PURE__ */ X(_t, [["render", Ct]]), wt = {}, kt = {
120
+ width: "20",
121
+ height: "20",
122
+ viewBox: "0 0 20 20",
123
+ fill: "none",
124
+ xmlns: "http://www.w3.org/2000/svg"
125
+ };
126
+ function yt(e, t) {
127
+ return p(), h("svg", kt, t[0] || (t[0] = [
128
+ f("path", {
129
+ d: "M8 3V5.2225M8 5.2225V10.7775M8 5.2225L9.875 4.25M8 5.2225L6.125 4.25M8 10.7775V13M8 10.7775L6.125 11.75M8 10.7775L9.875 11.75M13 8H10.7775M10.7775 8H5.2225M10.7775 8L11.75 9.875M10.7775 8L11.75 6.125M5.2225 8H3M5.2225 8L4.25 6.125M5.2225 8L4.25 9.875",
130
+ stroke: "currentColor",
131
+ "stroke-width": "1.5",
132
+ "stroke-linecap": "round",
133
+ "stroke-linejoin": "round"
134
+ }, null, -1),
135
+ f("path", {
136
+ d: "M12 14.7143L13.1151 15.6701C13.3268 15.8515 13.646 15.8247 13.8246 15.6105L16 13",
137
+ stroke: "currentColor",
138
+ "stroke-width": "1.5",
139
+ "stroke-linecap": "round"
140
+ }, null, -1)
141
+ ]));
142
+ }
143
+ const xt = /* @__PURE__ */ X(wt, [["render", yt]]), St = {}, $t = {
144
+ width: "20",
145
+ height: "20",
146
+ viewBox: "0 0 20 20",
147
+ fill: "none",
148
+ xmlns: "http://www.w3.org/2000/svg"
149
+ };
150
+ function Mt(e, t) {
151
+ return p(), h("svg", $t, t[0] || (t[0] = [
152
+ f("path", {
153
+ d: "M8 3V5.2225M8 5.2225V10.7775M8 5.2225L9.875 4.25M8 5.2225L6.125 4.25M8 10.7775V13M8 10.7775L6.125 11.75M8 10.7775L9.875 11.75M13 8H10.7775M10.7775 8H5.2225M10.7775 8L11.75 9.875M10.7775 8L11.75 6.125M5.2225 8H3M5.2225 8L4.25 6.125M5.2225 8L4.25 9.875",
154
+ stroke: "currentColor",
155
+ "stroke-width": "1.5",
156
+ "stroke-linecap": "round",
157
+ "stroke-linejoin": "round"
158
+ }, null, -1),
159
+ f("path", {
160
+ d: "M13 16L14.5 14.5M16 13L14.5 14.5M14.5 14.5L13 13M14.5 14.5L16 16",
161
+ stroke: "currentColor",
162
+ "stroke-width": "1.5",
163
+ "stroke-linecap": "round"
164
+ }, null, -1)
165
+ ]));
166
+ }
167
+ const Lt = /* @__PURE__ */ X(St, [["render", Mt]]), It = {}, Rt = {
168
+ width: "20",
169
+ height: "20",
170
+ viewBox: "0 0 20 20",
171
+ fill: "none",
172
+ xmlns: "http://www.w3.org/2000/svg"
173
+ };
174
+ function Bt(e, t) {
175
+ return p(), h("svg", Rt, t[0] || (t[0] = [
176
+ f("path", {
177
+ "fill-rule": "evenodd",
178
+ "clip-rule": "evenodd",
179
+ d: "M6.99479 8.75521C6.55276 8.75521 6.12884 8.57961 5.81628 8.26705C5.50372 7.95449 5.32812 7.53057 5.32812 7.08854C5.32812 6.64651 5.50372 6.22259 5.81628 5.91003C6.12884 5.59747 6.55276 5.42187 6.99479 5.42188C7.43682 5.42187 7.86074 5.59747 8.1733 5.91003C8.48586 6.22259 8.66146 6.64651 8.66146 7.08854C8.66146 7.53057 8.48586 7.95449 8.1733 8.26705C7.86074 8.57961 7.43682 8.75521 6.99479 8.75521ZM6.99479 14.5885C6.55276 14.5885 6.12884 14.4129 5.81628 14.1004C5.50372 13.7878 5.32812 13.3639 5.32812 12.9219C5.32812 12.4798 5.50372 12.0559 5.81628 11.7434C6.12884 11.4308 6.55276 11.2552 6.99479 11.2552C7.43682 11.2552 7.86074 11.4308 8.1733 11.7434C8.48586 12.0559 8.66146 12.4798 8.66146 12.9219C8.66146 13.3639 8.48586 13.7878 8.1733 14.1004C7.86074 14.4129 7.43682 14.5885 6.99479 14.5885Z",
180
+ fill: "currentColor"
181
+ }, null, -1),
182
+ f("path", {
183
+ "fill-rule": "evenodd",
184
+ "clip-rule": "evenodd",
185
+ d: "M12.9948 8.75521C12.5528 8.75521 12.1288 8.57961 11.8163 8.26705C11.5037 7.95449 11.3281 7.53057 11.3281 7.08854C11.3281 6.64651 11.5037 6.22259 11.8163 5.91003C12.1288 5.59747 12.5528 5.42187 12.9948 5.42188C13.4368 5.42187 13.8607 5.59747 14.1733 5.91003C14.4859 6.22259 14.6615 6.64651 14.6615 7.08854C14.6615 7.53057 14.4859 7.95449 14.1733 8.26705C13.8607 8.57961 13.4368 8.75521 12.9948 8.75521ZM12.9948 14.5885C12.5528 14.5885 12.1288 14.4129 11.8163 14.1004C11.5037 13.7878 11.3281 13.3639 11.3281 12.9219C11.3281 12.4798 11.5037 12.0559 11.8163 11.7434C12.1288 11.4308 12.5528 11.2552 12.9948 11.2552C13.4368 11.2552 13.8607 11.4308 14.1733 11.7434C14.4859 12.0559 14.6615 12.4798 14.6615 12.9219C14.6615 13.3639 14.4859 13.7878 14.1733 14.1004C13.8607 14.4129 13.4368 14.5885 12.9948 14.5885Z",
186
+ fill: "currentColor"
187
+ }, null, -1)
188
+ ]));
189
+ }
190
+ const Tt = /* @__PURE__ */ X(It, [["render", Bt]]), zt = {}, Et = {
191
+ width: "20",
192
+ height: "20",
193
+ viewBox: "0 0 20 20",
194
+ fill: "none",
195
+ xmlns: "http://www.w3.org/2000/svg"
196
+ };
197
+ function Wt(e, t) {
198
+ return p(), h("svg", Et, t[0] || (t[0] = [
199
+ f("path", {
200
+ "fill-rule": "evenodd",
201
+ "clip-rule": "evenodd",
202
+ d: "M10.1667 5.83333C9.72464 5.83333 9.30072 5.65774 8.98816 5.34518C8.67559 5.03262 8.5 4.60869 8.5 4.16667C8.5 3.72464 8.67559 3.30072 8.98816 2.98816C9.30072 2.67559 9.72464 2.5 10.1667 2.5C10.6087 2.5 11.0326 2.67559 11.3452 2.98816C11.6577 3.30072 11.8333 3.72464 11.8333 4.16667C11.8333 4.60869 11.6577 5.03262 11.3452 5.34518C11.0326 5.65774 10.6087 5.83333 10.1667 5.83333ZM10.1667 11.6667C9.72464 11.6667 9.30072 11.4911 8.98816 11.1785C8.67559 10.8659 8.5 10.442 8.5 10C8.5 9.55797 8.67559 9.13405 8.98816 8.82149C9.30072 8.50893 9.72464 8.33333 10.1667 8.33333C10.6087 8.33333 11.0326 8.50893 11.3452 8.82149C11.6577 9.13405 11.8333 9.55797 11.8333 10C11.8333 10.442 11.6577 10.8659 11.3452 11.1785C11.0326 11.4911 10.6087 11.6667 10.1667 11.6667ZM10.1667 17.5C9.72464 17.5 9.30072 17.3244 8.98816 17.0118C8.67559 16.6993 8.5 16.2754 8.5 15.8333C8.5 15.3913 8.67559 14.9674 8.98816 14.6548C9.30072 14.3423 9.72464 14.1667 10.1667 14.1667C10.6087 14.1667 11.0326 14.3423 11.3452 14.6548C11.6577 14.9674 11.8333 15.3913 11.8333 15.8333C11.8333 16.2754 11.6577 16.6993 11.3452 17.0118C11.0326 17.3244 10.6087 17.5 10.1667 17.5Z",
203
+ fill: "currentColor"
204
+ }, null, -1)
205
+ ]));
206
+ }
207
+ const Vt = /* @__PURE__ */ X(zt, [["render", Wt]]), Dt = {}, Pt = {
208
+ width: "21",
209
+ height: "20",
210
+ viewBox: "0 0 21 20",
211
+ fill: "none",
212
+ xmlns: "http://www.w3.org/2000/svg"
213
+ };
214
+ function Ht(e, t) {
215
+ return p(), h("svg", Pt, t[0] || (t[0] = [
216
+ f("path", {
217
+ "fill-rule": "evenodd",
218
+ "clip-rule": "evenodd",
219
+ d: "M6.33333 9.83333C6.33333 10.2754 6.15774 10.6993 5.84518 11.0118C5.53262 11.3244 5.10869 11.5 4.66667 11.5C4.22464 11.5 3.80072 11.3244 3.48816 11.0118C3.17559 10.6993 3 10.2754 3 9.83333C3 9.39131 3.17559 8.96738 3.48816 8.65482C3.80072 8.34226 4.22464 8.16667 4.66667 8.16667C5.10869 8.16667 5.53262 8.34226 5.84518 8.65482C6.15774 8.96738 6.33333 9.39131 6.33333 9.83333ZM12.1667 9.83333C12.1667 10.2754 11.9911 10.6993 11.6785 11.0118C11.3659 11.3244 10.942 11.5 10.5 11.5C10.058 11.5 9.63405 11.3244 9.32149 11.0118C9.00893 10.6993 8.83333 10.2754 8.83333 9.83333C8.83333 9.39131 9.00893 8.96738 9.32149 8.65482C9.63405 8.34226 10.058 8.16667 10.5 8.16667C10.942 8.16667 11.3659 8.34226 11.6785 8.65482C11.9911 8.96738 12.1667 9.39131 12.1667 9.83333ZM18 9.83333C18 10.2754 17.8244 10.6993 17.5118 11.0118C17.1993 11.3244 16.7754 11.5 16.3333 11.5C15.8913 11.5 15.4674 11.3244 15.1548 11.0118C14.8423 10.6993 14.6667 10.2754 14.6667 9.83333C14.6667 9.39131 14.8423 8.96738 15.1548 8.65482C15.4674 8.34226 15.8913 8.16667 16.3333 8.16667C16.7754 8.16667 17.1993 8.34226 17.5118 8.65482C17.8244 8.96738 18 9.39131 18 9.83333Z",
220
+ fill: "currentColor"
221
+ }, null, -1)
222
+ ]));
223
+ }
224
+ const At = /* @__PURE__ */ X(Dt, [["render", Ht]]), Ot = {}, jt = {
225
+ width: "20",
226
+ height: "20",
21
227
  viewBox: "0 0 20 20",
22
228
  fill: "none",
23
229
  xmlns: "http://www.w3.org/2000/svg"
24
230
  };
25
- function V(n, t) {
26
- return r(), l("svg", v, t[0] || (t[0] = [
27
- u("path", {
28
- d: "M10.228 4.04565V15.2643M4.61865 9.65495H15.8373",
231
+ function Nt(e, t) {
232
+ return p(), h("svg", jt, t[0] || (t[0] = [
233
+ f("path", {
234
+ d: "M6 14L10 10M10 10L14 6M10 10L6 6M10 10L14 14",
29
235
  stroke: "currentColor",
30
- "stroke-width": "1.60586",
236
+ "stroke-width": "1.5",
31
237
  "stroke-linecap": "round",
32
238
  "stroke-linejoin": "round"
33
239
  }, null, -1)
34
240
  ]));
35
241
  }
36
- const B = /* @__PURE__ */ f(k, [["render", V]]), w = {
37
- plus: B
38
- }, x = /* @__PURE__ */ s({
242
+ const Zt = /* @__PURE__ */ X(Ot, [["render", Nt]]), Ft = {
243
+ // arrow icons
244
+ arrowDown: et,
245
+ arrowTop: lt,
246
+ arrowRight: pt,
247
+ arrowLeft: ft,
248
+ arrowReload: rt,
249
+ // table icons
250
+ columnInsert: bt,
251
+ freeze: xt,
252
+ unfreeze: Lt,
253
+ columnsMove: Tt,
254
+ // actions icons
255
+ listBullet: Vt,
256
+ listBulletHorizontal: At,
257
+ close: Zt
258
+ }, G = /* @__PURE__ */ oe({
39
259
  __name: "VIcon",
40
260
  props: {
41
261
  name: {}
42
262
  },
43
- setup(n) {
44
- const t = n, o = _(() => w[t.name]);
45
- return (e, c) => o.value ? (r(), m(i(o.value), { key: 0 })) : p("", !0);
263
+ setup(e) {
264
+ const t = e, n = S(() => Ft[t.name]);
265
+ return (o, s) => n.value ? (p(), ie(Ie(n.value), { key: 0 })) : V("", !0);
266
+ }
267
+ }), Ut = {}, qt = { class: "vt-loader" };
268
+ function Xt(e, t) {
269
+ return p(), h("span", qt);
270
+ }
271
+ const ze = /* @__PURE__ */ X(Ut, [["render", Xt]]), Gt = ["disabled", "type", "data-placement"], Kt = {
272
+ key: 2,
273
+ class: "vt-button__content"
274
+ }, pe = /* @__PURE__ */ oe({
275
+ __name: "VButton",
276
+ props: {
277
+ type: { default: "default" },
278
+ shape: {},
279
+ disabled: { type: Boolean, default: !1 },
280
+ loading: { type: Boolean, default: !1 },
281
+ icon: {},
282
+ tooltip: { type: Boolean, default: !1 },
283
+ tooltipPlacement: { default: "top" },
284
+ htmlType: { default: "button" }
285
+ },
286
+ emits: ["click"],
287
+ setup(e, { emit: t }) {
288
+ const n = e, o = t, s = Re(), l = S(() => !!(n.icon && n.shape)), i = S(() => s.default?.()?.[0]?.children?.toString() ?? ""), a = S(() => [
289
+ "vt-button",
290
+ `vt-button--${n.type}`,
291
+ {
292
+ [`vt-button--${n.shape}`]: n.shape,
293
+ "vt-button--icon-only": l.value,
294
+ "vt-button--disabled": n.disabled || n.loading,
295
+ "vt-button--loading": n.loading
296
+ }
297
+ ]), r = S(() => l.value && n.tooltip ? i.value : null), u = (c) => {
298
+ !n.disabled && !n.loading && o("click", c);
299
+ };
300
+ return (c, M) => {
301
+ const $ = Be("tooltip");
302
+ return be((p(), h("button", {
303
+ class: E(a.value),
304
+ disabled: n.disabled || n.loading,
305
+ type: n.htmlType,
306
+ "data-placement": n.tooltipPlacement,
307
+ onClick: u
308
+ }, [
309
+ n.loading ? (p(), ie(ze, {
310
+ key: 0,
311
+ class: "vt-button__icon"
312
+ })) : n.icon ? (p(), ie(G, {
313
+ key: 1,
314
+ name: n.icon,
315
+ class: "vt-button__icon"
316
+ }, null, 8, ["name"])) : V("", !0),
317
+ l.value ? V("", !0) : (p(), h("span", Kt, [
318
+ re(c.$slots, "default")
319
+ ]))
320
+ ], 10, Gt)), [
321
+ [$, r.value]
322
+ ]);
323
+ };
324
+ }
325
+ }), Yt = {
326
+ key: 0,
327
+ class: "vt-modal__header"
328
+ }, Jt = {
329
+ key: 0,
330
+ class: "vt-modal__title"
331
+ }, Qt = { class: "vt-modal__content" }, Ee = /* @__PURE__ */ oe({
332
+ __name: "VModal",
333
+ props: {
334
+ modelValue: { type: Boolean },
335
+ title: {},
336
+ size: { default: "medium" },
337
+ showCloseButton: { type: Boolean, default: !0 },
338
+ closeOnBackdropClick: { type: Boolean, default: !0 },
339
+ zIndex: { default: 1e3 }
340
+ },
341
+ emits: ["update:modelValue", "close"],
342
+ setup(e, { emit: t }) {
343
+ const n = e, o = t, s = S(() => ["vt-modal__container", `vt-modal__container--${n.size}`]), l = S(() => ({
344
+ zIndex: n.zIndex
345
+ })), i = () => {
346
+ o("update:modelValue", !1), o("close");
347
+ }, a = () => {
348
+ n.closeOnBackdropClick && i();
349
+ };
350
+ return (r, u) => (p(), ie(Ne, { to: "body" }, [
351
+ r.modelValue ? (p(), h("div", {
352
+ key: 0,
353
+ class: "vt-modal__backdrop",
354
+ style: le(l.value),
355
+ onClick: a
356
+ }, [
357
+ f("div", {
358
+ class: E(s.value),
359
+ onClick: u[0] || (u[0] = ce(() => {
360
+ }, ["stop"]))
361
+ }, [
362
+ r.title || r.showCloseButton ? (p(), h("div", Yt, [
363
+ r.title ? (p(), h("h2", Jt, Q(r.title), 1)) : V("", !0),
364
+ r.showCloseButton ? (p(), ie(G, {
365
+ key: 1,
366
+ name: "close",
367
+ class: "vt-modal__close",
368
+ onClick: i
369
+ })) : V("", !0)
370
+ ])) : V("", !0),
371
+ f("div", Qt, [
372
+ re(r.$slots, "default")
373
+ ])
374
+ ], 2)
375
+ ], 4)) : V("", !0)
376
+ ]));
377
+ }
378
+ }), en = { class: "vt-pagination" }, tn = { class: "vt-pagination__info" }, nn = { class: "vt-pagination__rows-per-page" }, on = ["value"], ln = { class: "vt-pagination__navigation" }, sn = ["disabled"], an = ["onClick"], rn = ["disabled"], cn = /* @__PURE__ */ oe({
379
+ __name: "VPagination",
380
+ props: {
381
+ totalItems: {},
382
+ pageSize: { default: 10 },
383
+ currentPage: { default: 1 },
384
+ pageSizeOptions: { default: () => [5, 10, 20, 50] },
385
+ maxVisiblePages: { default: 6 }
386
+ },
387
+ emits: ["update:currentPage", "update:pageSize", "pageChange", "reloadData"],
388
+ setup(e, { emit: t }) {
389
+ const n = e, o = t, s = S({
390
+ get: () => n.currentPage,
391
+ set: (L) => o("update:currentPage", L)
392
+ }), l = S({
393
+ get: () => n.pageSize,
394
+ set: (L) => o("update:pageSize", L)
395
+ }), i = S(() => Math.ceil(n.totalItems / l.value)), a = S(() => n.totalItems === 0 ? 0 : (s.value - 1) * l.value + 1), r = S(() => Math.min(s.value * l.value, n.totalItems)), u = S(() => s.value <= 1), c = S(() => s.value >= i.value), M = S(() => {
396
+ const L = [], W = i.value, x = s.value, Z = n.maxVisiblePages;
397
+ if (W <= Z)
398
+ for (let v = 1; v <= W; v++)
399
+ L.push(v);
400
+ else {
401
+ L.push(1);
402
+ const v = Math.max(2, x - Math.floor(Z / 2)), T = Math.min(W - 1, x + Math.floor(Z / 2));
403
+ v > 2 && L.push("...");
404
+ for (let D = v; D <= T; D++)
405
+ L.push(D);
406
+ T < W - 1 && L.push("..."), W > 1 && L.push(W);
407
+ }
408
+ return L;
409
+ }), $ = () => {
410
+ o("pageChange", {
411
+ page: s.value,
412
+ pageSize: l.value
413
+ });
414
+ }, H = (L) => {
415
+ typeof L == "number" && L !== s.value && (s.value = L, $());
416
+ }, N = () => {
417
+ u.value || (s.value--, $());
418
+ }, K = () => {
419
+ c.value || (s.value++, $());
420
+ }, Y = () => {
421
+ s.value = 1, $();
422
+ }, q = () => {
423
+ o("reloadData", s.value);
424
+ };
425
+ return ue(
426
+ () => n.totalItems,
427
+ () => {
428
+ s.value > i.value && i.value > 0 && (s.value = i.value, $());
429
+ }
430
+ ), (L, W) => (p(), h("div", en, [
431
+ f("div", tn, [
432
+ f("div", nn, [
433
+ W[1] || (W[1] = f("label", {
434
+ for: "rowsSelect",
435
+ class: "vt-pagination__label"
436
+ }, "Рядків на сторінку:", -1)),
437
+ be(f("select", {
438
+ id: "rowsSelect",
439
+ "onUpdate:modelValue": W[0] || (W[0] = (x) => l.value = x),
440
+ onChange: Y,
441
+ class: "vt-pagination__select"
442
+ }, [
443
+ (p(!0), h(te, null, ne(L.pageSizeOptions, (x) => (p(), h("option", {
444
+ key: x,
445
+ value: x
446
+ }, Q(x), 9, on))), 128))
447
+ ], 544), [
448
+ [Ze, l.value]
449
+ ])
450
+ ]),
451
+ f("span", null, Q(a.value) + " - " + Q(r.value) + " з " + Q(L.totalItems), 1)
452
+ ]),
453
+ f("div", ln, [
454
+ f("button", {
455
+ onClick: N,
456
+ disabled: u.value,
457
+ class: E({ "vt-pagination__nav-button": !0, "has-items": !u.value })
458
+ }, [
459
+ j(G, { name: "arrowLeft" })
460
+ ], 10, sn),
461
+ (p(!0), h(te, null, ne(M.value, (x) => (p(), h("button", {
462
+ key: x,
463
+ onClick: (Z) => H(x),
464
+ class: E(["vt-pagination__nav-button", {
465
+ "vt-pagination__nav-button--active": x === s.value
466
+ }])
467
+ }, Q(x), 11, an))), 128)),
468
+ f("button", {
469
+ onClick: K,
470
+ disabled: c.value,
471
+ class: E({ "vt-pagination__nav-button": !0, "has-items": !c.value })
472
+ }, [
473
+ j(G, { name: "arrowRight" })
474
+ ], 10, rn)
475
+ ]),
476
+ f("div", null, [
477
+ j(pe, {
478
+ icon: "arrowReload",
479
+ shape: "circle",
480
+ tooltip: "",
481
+ tooltipPlacement: "left",
482
+ onClick: q
483
+ }, {
484
+ default: ge(() => W[2] || (W[2] = [
485
+ de("Оновити дані ", -1)
486
+ ])),
487
+ _: 1,
488
+ __: [2]
489
+ })
490
+ ])
491
+ ]));
46
492
  }
47
- }), h = {
48
- install(n) {
49
- n.component("VButton", d), n.component("VIcon", x);
493
+ }), un = ["for"], dn = ["id", "name", "value", "checked", "disabled", "required", ".indeterminate"], ae = /* @__PURE__ */ oe({
494
+ __name: "VCheckbox",
495
+ props: {
496
+ modelValue: { type: Boolean, default: void 0 },
497
+ checked: { type: Boolean, default: !1 },
498
+ label: {},
499
+ disabled: { type: Boolean, default: !1 },
500
+ id: {},
501
+ name: {},
502
+ value: {},
503
+ indeterminate: { type: Boolean, default: !1 },
504
+ size: { default: "medium" },
505
+ variant: { default: "primary" },
506
+ required: { type: Boolean, default: !1 },
507
+ isDouble: { type: Boolean, default: !1 }
508
+ },
509
+ emits: ["update:modelValue", "change", "focus", "blur"],
510
+ setup(e, { emit: t }) {
511
+ const n = e, o = t, s = () => `vt-checkbox-${Math.random().toString(36).substr(2, 9)}`, l = S(() => n.id || s()), i = S(() => n.modelValue ?? n.checked), a = (c) => {
512
+ if (n.disabled) return;
513
+ const $ = c.target.checked;
514
+ o("update:modelValue", $), o("change", $, c);
515
+ }, r = (c) => {
516
+ o("focus", c);
517
+ }, u = (c) => {
518
+ o("blur", c);
519
+ };
520
+ return (c, M) => (p(), h("label", {
521
+ class: E([
522
+ "vt-checkbox",
523
+ `vt-checkbox--${c.size}`,
524
+ `vt-checkbox--${c.variant}`,
525
+ {
526
+ "vt-checkbox--disabled": c.disabled,
527
+ "vt-checkbox--double": c.isDouble
528
+ }
529
+ ]),
530
+ for: l.value
531
+ }, [
532
+ f("input", {
533
+ id: l.value,
534
+ name: c.name,
535
+ value: c.value,
536
+ checked: i.value,
537
+ disabled: c.disabled,
538
+ required: c.required,
539
+ ".indeterminate": c.indeterminate,
540
+ type: "checkbox",
541
+ class: "vt-checkbox__input",
542
+ onChange: a,
543
+ onFocus: r,
544
+ onBlur: u
545
+ }, null, 40, dn),
546
+ f("div", {
547
+ class: E([
548
+ "vt-checkbox__box",
549
+ {
550
+ "vt-checkbox__box--checked": i.value && !c.indeterminate && !c.isDouble,
551
+ "vt-checkbox__box--indeterminate": c.indeterminate,
552
+ "vt-checkbox__box--double": c.isDouble && i.value,
553
+ "vt-checkbox__box--disabled": c.disabled
554
+ }
555
+ ])
556
+ }, [
557
+ !c.indeterminate && !c.isDouble ? (p(), h("svg", {
558
+ key: 0,
559
+ class: E([
560
+ "vt-checkbox__checkmark",
561
+ {
562
+ "vt-checkbox__checkmark--checked": i.value
563
+ }
564
+ ]),
565
+ width: "10",
566
+ height: "9",
567
+ viewBox: "0 0 10 9",
568
+ fill: "none",
569
+ xmlns: "http://www.w3.org/2000/svg"
570
+ }, M[0] || (M[0] = [
571
+ f("path", {
572
+ d: "M1 5L3.58264 7.58264C3.80112 7.80112 4.16348 7.77113 4.34306 7.51971L9 1",
573
+ stroke: "currentColor",
574
+ "stroke-width": "2",
575
+ "stroke-linecap": "round"
576
+ }, null, -1)
577
+ ]), 2)) : V("", !0),
578
+ c.isDouble && i.value ? (p(), h("svg", {
579
+ key: 1,
580
+ class: E([
581
+ "vt-checkbox__checkmark",
582
+ {
583
+ "vt-checkbox__checkmark--checked": i.value
584
+ }
585
+ ]),
586
+ width: "13",
587
+ height: "6",
588
+ viewBox: "0 0 13 6",
589
+ fill: "none",
590
+ xmlns: "http://www.w3.org/2000/svg"
591
+ }, M[1] || (M[1] = [
592
+ f("path", {
593
+ d: "M6 3L8.25 5L12 1",
594
+ stroke: "currentColor",
595
+ "stroke-width": "2",
596
+ "stroke-linecap": "round",
597
+ "stroke-linejoin": "round"
598
+ }, null, -1),
599
+ f("path", {
600
+ d: "M1 3L3.25 5L7 1",
601
+ stroke: "currentColor",
602
+ "stroke-width": "2",
603
+ "stroke-linecap": "round",
604
+ "stroke-linejoin": "round"
605
+ }, null, -1)
606
+ ]), 2)) : V("", !0),
607
+ c.indeterminate ? (p(), h("div", {
608
+ key: 2,
609
+ class: E([
610
+ "vt-checkbox__indeterminate-mark",
611
+ {
612
+ "vt-checkbox__indeterminate-mark--visible": c.indeterminate
613
+ }
614
+ ])
615
+ }, null, 2)) : V("", !0)
616
+ ], 2),
617
+ c.label || c.$slots.label || c.$slots.default ? (p(), h("span", {
618
+ key: 0,
619
+ class: E([
620
+ "vt-checkbox__label",
621
+ {
622
+ "vt-checkbox__label--disabled": c.disabled
623
+ }
624
+ ])
625
+ }, [
626
+ re(c.$slots, "label", {}, () => [
627
+ re(c.$slots, "default", {}, () => [
628
+ de(Q(c.label), 1)
629
+ ])
630
+ ])
631
+ ], 2)) : V("", !0)
632
+ ], 10, un));
50
633
  }
634
+ });
635
+ function pn(e) {
636
+ const t = S(() => [...e].sort((s, l) => s.pinnedLeft && !l.pinnedLeft ? -1 : !s.pinnedLeft && l.pinnedLeft || s.pinnedRight && !l.pinnedRight ? 1 : !s.pinnedRight && l.pinnedRight ? -1 : 0)), n = () => {
637
+ const s = t.value.length, l = t.value.filter((c) => c.width || c.minWidth), i = l.reduce((c, M) => c + (M.width || M.minWidth || 0), 0), a = s - l.length;
638
+ if (a === 0)
639
+ return 150;
640
+ const u = Math.max(800 - i, a * 80);
641
+ return Math.max(Math.floor(u / a), 120);
642
+ };
643
+ return {
644
+ sortedColumns: t,
645
+ getDefaultColumnWidth: n,
646
+ getStickyOffset: (s, l, i = !1) => {
647
+ const a = t.value;
648
+ let r = 0;
649
+ if (s === "left") {
650
+ i && (r += 50);
651
+ for (let u = 0; u < l; u++) {
652
+ const c = a[u];
653
+ c.pinnedLeft && (r += c.width || c.minWidth || n());
654
+ }
655
+ } else
656
+ for (let u = a.length - 1; u > l; u--) {
657
+ const c = a[u];
658
+ c.pinnedRight && (r += c.width || c.minWidth || n());
659
+ }
660
+ return r;
661
+ }
662
+ };
663
+ }
664
+ function mn(e) {
665
+ const t = () => {
666
+ const l = {};
667
+ return e.maxHeight && (l.maxHeight = `${e.maxHeight}px`), l;
668
+ }, n = (l, i, a, r) => {
669
+ const u = {};
670
+ if (l.width)
671
+ u.width = `${l.width}px`, u.minWidth = `${l.width}px`, u.maxWidth = `${l.width}px`;
672
+ else if (l.minWidth)
673
+ u.minWidth = `${l.minWidth}px`, u.width = `${l.minWidth}px`, u.maxWidth = "none";
674
+ else {
675
+ const c = r();
676
+ u.width = `${c}px`, u.minWidth = "80px", u.maxWidth = "none";
677
+ }
678
+ return l.pinnedLeft ? (u.position = "sticky", u.left = `${a("left", i, e.selectable)}px`, u.zIndex = "10") : l.pinnedRight && (u.position = "sticky", u.right = `${a("right", i, !1)}px`, u.zIndex = "10"), u;
679
+ };
680
+ return {
681
+ getTableWrapperStyle: t,
682
+ getColumnStyle: n,
683
+ getHeaderStyle: (l, i, a, r) => {
684
+ const u = n(l, i, a, r);
685
+ return e.maxHeight && (u.position = "sticky", u.top = "0", l.pinnedLeft || l.pinnedRight ? u.zIndex = "12" : u.zIndex = "11"), u;
686
+ },
687
+ getFooterStyle: (l, i, a, r) => {
688
+ const u = n(l, i, a, r);
689
+ return e.maxHeight && (u.position = "sticky", u.bottom = "0", l.pinnedLeft || l.pinnedRight ? u.zIndex = "12" : u.zIndex = "11"), u;
690
+ }
691
+ };
692
+ }
693
+ function hn() {
694
+ const e = P({
695
+ resizingCol: null,
696
+ startX: 0,
697
+ startWidth: 0
698
+ }), t = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'><path d='M5 13L2 10L5 7' stroke='%23828282' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M15 7L18 10L15 13' stroke='%23828282' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/><path d='M10 3L10 17' stroke='%23828282' stroke-width='3' stroke-linecap='round'/></svg>") 10 10, col-resize`;
699
+ return {
700
+ onMouseDown: (o, s, l, i) => {
701
+ o.preventDefault(), o.stopPropagation(), e.value.resizingCol = s, e.value.startX = o.clientX, e.value.startWidth = s.width || s.minWidth || l(s.prop);
702
+ const a = (u) => {
703
+ const { resizingCol: c, startX: M, startWidth: $ } = e.value;
704
+ if (!c)
705
+ return;
706
+ document.querySelectorAll(`[data-resizer="${c.prop}"]`).forEach((q) => {
707
+ q.classList.add("vt-table__resizer--active");
708
+ });
709
+ const H = u.clientX - M, N = c.minWidth || 50, K = c.maxWidth || 1e3, Y = Math.max(Math.min($ + H, K), N);
710
+ c.width = Y;
711
+ }, r = () => {
712
+ const { resizingCol: u } = e.value;
713
+ document.removeEventListener("mousemove", a), document.removeEventListener("mouseup", r), document.body.style.cursor = "", document.body.style.userSelect = "", document.body.classList.remove("vt-table-resizing"), u && (document.querySelectorAll(`[data-resizer="${u.prop}"]`).forEach((c) => {
714
+ c.classList.remove("vt-table__resizer--active");
715
+ }), i && u.width && (console.log("📏 Викликаємо callback з новою шириною:", u.width), i(u.width))), e.value.resizingCol = null;
716
+ };
717
+ document.addEventListener("mousemove", a), document.addEventListener("mouseup", r), document.body.style.cursor = t, document.body.style.userSelect = "none", document.body.classList.add("vt-table-resizing");
718
+ },
719
+ resizeState: e
720
+ };
721
+ }
722
+ function vn(e, t, n, o) {
723
+ const s = e.selectionKey || "id", l = P([]), i = P(null), a = P(!1);
724
+ e.defaultSelection?.length && (l.value = [...e.defaultSelection]);
725
+ const r = (k) => k[s], u = (k) => a.value ? !0 : l.value.some((z) => r(z) === r(k)), c = S(() => t.value.filter((k) => u(k)).length), M = S(() => t.value.length > 0 && c.value === t.value.length), $ = S(() => {
726
+ if (a.value)
727
+ return !1;
728
+ const k = c.value;
729
+ return k > 0 && k < t.value.length;
730
+ }), H = S(() => a.value ? !0 : M.value && !$.value), N = S(() => a.value), K = (k, z) => {
731
+ const B = r(k), A = l.value.some((d) => r(d) === r(k)), F = z !== void 0 ? z : !A;
732
+ if (a.value && !F) {
733
+ a.value = !1, o?.value && (l.value = o.value.filter((d) => r(d) !== B)), D(k, !1);
734
+ return;
735
+ }
736
+ a.value && F || (F && !A ? l.value.push(k) : !F && A && (l.value = l.value.filter((d) => r(d) !== B)), e.selectOnClickRow && z === void 0 && Z(F ? k : null), D(k, F));
737
+ }, Y = () => {
738
+ switch (q()) {
739
+ case "none":
740
+ case "partial":
741
+ L();
742
+ break;
743
+ case "allVisible":
744
+ W();
745
+ break;
746
+ case "absoluteAll":
747
+ x();
748
+ break;
749
+ }
750
+ }, q = () => a.value ? "absoluteAll" : M.value ? "allVisible" : c.value > 0 ? "partial" : "none", L = () => {
751
+ const k = [], z = new Set(l.value.map((B) => r(B)));
752
+ l.value.forEach((B) => {
753
+ k.push(B);
754
+ }), t.value.forEach((B) => {
755
+ z.has(r(B)) || k.push(B);
756
+ }), l.value = k, a.value = !1, D();
757
+ }, W = () => {
758
+ a.value = !0, o?.value ? l.value = [...o.value] : l.value = [...t.value], D(void 0, void 0, !0);
759
+ }, x = () => {
760
+ l.value = [], a.value = !1, i.value = null, D();
761
+ }, Z = (k) => {
762
+ const z = i.value;
763
+ i.value = k, n("current-change", {
764
+ currentRow: i.value,
765
+ oldCurrentRow: z
766
+ });
767
+ }, v = () => [...l.value], T = (k) => {
768
+ l.value = [...k], a.value = !1, D();
769
+ }, D = (k, z, B = !1) => {
770
+ const A = {
771
+ selection: [...l.value],
772
+ row: k,
773
+ selected: z,
774
+ isAllSelected: B || a.value
775
+ };
776
+ n("selection-change", A);
777
+ };
778
+ return ue(() => e.defaultSelection, (k) => {
779
+ k?.length && (l.value = [...k]);
780
+ }), {
781
+ selectedRows: l,
782
+ currentRow: i,
783
+ isRowSelected: u,
784
+ isAllSelected: H,
785
+ isIndeterminate: $,
786
+ isDoubleCheck: N,
787
+ isFullSelection: a,
788
+ toggleRowSelection: K,
789
+ toggleAllSelection: Y,
790
+ clearSelection: x,
791
+ setCurrentRow: Z,
792
+ getSelectionRows: v,
793
+ setSelectionRows: T,
794
+ selectAbsolutelyAll: W
795
+ };
796
+ }
797
+ const fn = (e, t, n = "asc") => {
798
+ if (e == null && t == null)
799
+ return 0;
800
+ if (e == null)
801
+ return n === "asc" ? 1 : -1;
802
+ if (t == null)
803
+ return n === "asc" ? -1 : 1;
804
+ if (e === t)
805
+ return 0;
806
+ let o = 0;
807
+ const s = Number(e), l = Number(t);
808
+ return !isNaN(s) && !isNaN(l) ? o = s - l : ke(e) && ke(t) ? o = new Date(e).getTime() - new Date(t).getTime() : typeof e == "boolean" && typeof t == "boolean" ? o = e === t ? 0 : e ? -1 : 1 : o = String(e).localeCompare(String(t), void 0, {
809
+ numeric: !0,
810
+ sensitivity: "base"
811
+ }), n === "desc" ? -o : o;
812
+ }, ke = (e) => e instanceof Date ? !isNaN(e.getTime()) : typeof e == "string" && /\d{4}-\d{2}-\d{2}|\//.test(e) ? !isNaN(new Date(e).getTime()) : !1, _n = (e, t, n) => {
813
+ e.sortable && n({
814
+ prop: e.prop,
815
+ direction: t
816
+ });
817
+ }, ye = (e, t) => {
818
+ const n = t?.prop === e.prop, o = t?.direction;
819
+ return {
820
+ asc: ["vt-th__sort-icon", n && o === "asc" && "vt-th__sortable-active"].filter(Boolean).join(" "),
821
+ desc: ["vt-th__sort-icon", n && o === "desc" && "vt-th__sortable-active"].filter(Boolean).join(" ")
822
+ };
823
+ }, gn = (e, t, n) => {
824
+ if (!t)
825
+ return [...e];
826
+ const o = n.find((l) => l.prop === t.prop);
827
+ if (!o?.sortable)
828
+ return [...e];
829
+ const s = o.sortMethod || fn;
830
+ return [...e].sort((l, i) => {
831
+ const a = l[o.prop], r = i[o.prop];
832
+ return s(a, r, t.direction);
833
+ });
51
834
  };
835
+ class Cn {
836
+ modalStack = [];
837
+ baseZIndex = 1e3;
838
+ open(t = {}) {
839
+ const n = `modal-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, o = document.createElement("div");
840
+ o.setAttribute("data-vt-modal", n), document.body.appendChild(o);
841
+ const s = P(!0), l = this.baseZIndex + this.modalStack.length * 10, i = Fe({
842
+ setup() {
843
+ const r = () => {
844
+ s.value = !1, setTimeout(() => {
845
+ se.closeById(n);
846
+ }, 100);
847
+ };
848
+ return () => fe(Ee, {
849
+ modelValue: s.value,
850
+ "onUpdate:modelValue": r,
851
+ title: t.title,
852
+ size: t.size || "medium",
853
+ showCloseButton: t.showCloseButton !== !1,
854
+ closeOnBackdropClick: t.closeOnBackdropClick !== !1,
855
+ onClose: r,
856
+ zIndex: l
857
+ }, {
858
+ default: () => t.component ? fe(t.component, t.props || {}) : t.content ? fe("div", { innerHTML: t.content }) : null
859
+ });
860
+ }
861
+ });
862
+ i.mount(o);
863
+ const a = {
864
+ id: n,
865
+ app: i,
866
+ container: o,
867
+ isOpen: s
868
+ };
869
+ return this.modalStack.push(a), n;
870
+ }
871
+ close() {
872
+ if (this.modalStack.length > 0) {
873
+ const t = this.modalStack[this.modalStack.length - 1];
874
+ this.closeById(t.id);
875
+ }
876
+ }
877
+ closeById(t) {
878
+ const n = this.modalStack.findIndex((o) => o.id === t);
879
+ if (n !== -1) {
880
+ const o = this.modalStack[n];
881
+ this.cleanupModal(o), this.modalStack.splice(n, 1), this.recalculateZIndices();
882
+ }
883
+ }
884
+ closeAll() {
885
+ for (; this.modalStack.length > 0; ) {
886
+ const t = this.modalStack.pop();
887
+ t && this.cleanupModal(t);
888
+ }
889
+ }
890
+ getOpenModalsCount() {
891
+ return this.modalStack.length;
892
+ }
893
+ cleanupModal(t) {
894
+ t.app && t.app.unmount(), t.container && t.container.parentNode && document.body.removeChild(t.container);
895
+ }
896
+ recalculateZIndices() {
897
+ }
898
+ }
899
+ const se = new Cn(), bn = {
900
+ install(e) {
901
+ e.config.globalProperties.$modal = se, e.config.globalProperties.$modalStack = {
902
+ closeAll: () => se.closeAll(),
903
+ getCount: () => se.getOpenModalsCount(),
904
+ closeById: (t) => se.closeById(t)
905
+ };
906
+ }
907
+ }, wn = { class: "vt-columns-selector-body" }, kn = { class: "vt-columns-selector" }, yn = { class: "vt-columns-selector__panel" }, xn = ["draggable", "onDragstart", "onDragover", "onDrop"], Sn = {
908
+ key: 0,
909
+ class: "vt-columns-selector__panel-item-pinned"
910
+ }, $n = { class: "vt-columns-selector__available" }, Mn = ["onClick"], Ln = {
911
+ key: 0,
912
+ class: "vt-columns-selector__group-columns"
913
+ }, In = {
914
+ key: 0,
915
+ class: "vt-columns-selector__pinned-note"
916
+ }, Rn = { class: "vt-modal__content-button" }, Bn = /* @__PURE__ */ oe({
917
+ __name: "VTableColumnSelector",
918
+ props: {
919
+ columns: {},
920
+ columnsSelector: { default: () => [] }
921
+ },
922
+ emits: ["update-columns"],
923
+ setup(e, { emit: t }) {
924
+ const n = e, o = t, s = P([]), l = P(/* @__PURE__ */ new Set()), i = P(-1), a = P(-1), r = P("before"), u = S(() => {
925
+ const d = {};
926
+ return n.columnsSelector.forEach((g) => {
927
+ if (g.name === "removed")
928
+ return;
929
+ const C = g.columns.map((I) => I.prop), w = s.value.filter((I) => C.includes(I.prop));
930
+ w.length === 0 ? d[g.name] = { checked: !1, indeterminate: !1 } : w.length === g.columns.length ? d[g.name] = { checked: !0, indeterminate: !1 } : d[g.name] = { checked: !1, indeterminate: !0 };
931
+ }), d;
932
+ }), c = S(() => n.columnsSelector.filter((d) => d.name !== "removed")), M = (d) => d.pinnedLeft || d.pinnedRight, $ = (d) => !M(d), H = () => {
933
+ const d = s.value;
934
+ let g = -1;
935
+ for (let w = 0; w < d.length; w++)
936
+ d[w].pinnedLeft && (g = w);
937
+ let C = d.length;
938
+ for (let w = 0; w < d.length; w++)
939
+ if (d[w].pinnedRight) {
940
+ C = w;
941
+ break;
942
+ }
943
+ return {
944
+ minIndex: g + 1,
945
+ maxIndex: C - 1
946
+ };
947
+ }, N = (d) => {
948
+ const g = H();
949
+ return !(d < g.minIndex || d > g.maxIndex + 1);
950
+ }, K = (d, g) => {
951
+ const C = s.value[g];
952
+ if (!$(C)) {
953
+ d.preventDefault();
954
+ return;
955
+ }
956
+ i.value = g, d.dataTransfer && (d.dataTransfer.effectAllowed = "move", d.dataTransfer.setData("text/plain", C.prop)), document.body.style.cursor = "grabbing";
957
+ }, Y = (d, g) => {
958
+ if (i.value === -1) return;
959
+ d.preventDefault();
960
+ const C = d.currentTarget.getBoundingClientRect(), w = d.clientY, I = C.top + C.height / 2;
961
+ let O = g, ee = "before";
962
+ w < I ? (O = g, ee = "before") : (O = g + 1, ee = "after"), i.value < O && O--, N(O) ? (a.value = g, r.value = ee, d.dataTransfer.dropEffect = "move") : (a.value = -1, d.dataTransfer.dropEffect = "none");
963
+ }, q = () => {
964
+ setTimeout(() => {
965
+ i.value === -1 && (a.value = -1);
966
+ }, 50);
967
+ }, L = (d, g) => {
968
+ if (d.preventDefault(), i.value === -1 || a.value === -1) {
969
+ x();
970
+ return;
971
+ }
972
+ const C = d.currentTarget.getBoundingClientRect(), w = d.clientY, I = C.top + C.height / 2;
973
+ let O = g;
974
+ if (w >= I && (O = g + 1), i.value < O && O--, !N(O) || O === i.value) {
975
+ x();
976
+ return;
977
+ }
978
+ const ee = [...s.value], [he] = ee.splice(i.value, 1);
979
+ ee.splice(O, 0, he), s.value = ee, x();
980
+ }, W = () => {
981
+ x();
982
+ }, x = () => {
983
+ i.value = -1, a.value = -1, r.value = "before", document.body.style.cursor = "";
984
+ }, Z = (d) => {
985
+ const g = ["vt-columns-selector__panel-item"];
986
+ return i.value === d && g.push("vt-columns-selector__panel-item--dragging"), a.value === d && r.value === "before" && g.push("vt-columns-selector__panel-item--drop-before"), a.value === d && r.value === "after" && g.push("vt-columns-selector__panel-item--drop-after"), g;
987
+ }, v = () => {
988
+ s.value = [...n.columns.map((d) => ({ ...d }))], n.columnsSelector.forEach((d) => {
989
+ d.name !== "removed" && l.value.add(d.name);
990
+ });
991
+ }, T = (d, g) => {
992
+ if (g)
993
+ s.value.some((C) => C.prop === d.prop) || s.value.push({ ...d });
994
+ else {
995
+ if (M(d))
996
+ return;
997
+ s.value = s.value.filter((C) => C.prop !== d.prop);
998
+ }
999
+ }, D = (d, g) => {
1000
+ if (g)
1001
+ d.columns.forEach((C) => {
1002
+ s.value.some((w) => w.prop === C.prop) || s.value.push({ ...C });
1003
+ });
1004
+ else {
1005
+ const C = [];
1006
+ d.columns.forEach((w) => {
1007
+ const I = s.value.find((O) => O.prop === w.prop);
1008
+ I && !M(I) && C.push(I);
1009
+ }), s.value = s.value.filter(
1010
+ (w) => !C.some((I) => I.prop === w.prop)
1011
+ );
1012
+ }
1013
+ }, k = (d) => s.value.some((g) => g.prop === d.prop), z = (d) => {
1014
+ const g = s.value.find((C) => C.prop === d.prop);
1015
+ return !g || !M(g);
1016
+ }, B = (d) => {
1017
+ l.value.has(d) ? l.value.delete(d) : l.value.add(d);
1018
+ }, A = () => {
1019
+ o("update-columns", [...s.value]), se.close();
1020
+ }, F = () => {
1021
+ se.close();
1022
+ };
1023
+ return me(() => {
1024
+ v();
1025
+ }), (d, g) => (p(), h("div", wn, [
1026
+ f("div", kn, [
1027
+ f("div", yn, [
1028
+ (p(!0), h(te, null, ne(s.value, (C, w) => (p(), h("div", {
1029
+ key: C.prop,
1030
+ class: E(Z(w)),
1031
+ draggable: $(C),
1032
+ onDragstart: (I) => K(I, w),
1033
+ onDragover: (I) => Y(I, w),
1034
+ onDragleave: q,
1035
+ onDrop: (I) => L(I, w),
1036
+ onDragend: W
1037
+ }, [
1038
+ j(G, {
1039
+ name: $(C) ? "columnsMove" : "freeze",
1040
+ class: E(["vt-columns-selector__panel-item-icon", { "vt-columns-selector__panel-item-icon--draggable": $(C) }])
1041
+ }, null, 8, ["name", "class"]),
1042
+ j(ae, {
1043
+ label: C.label,
1044
+ checked: !0,
1045
+ disabled: M(C),
1046
+ onChange: (I) => T(C, I),
1047
+ onClick: g[0] || (g[0] = ce(() => {
1048
+ }, ["stop"]))
1049
+ }, null, 8, ["label", "disabled", "onChange"]),
1050
+ M(C) ? (p(), h("span", Sn, "pinned")) : V("", !0)
1051
+ ], 42, xn))), 128))
1052
+ ]),
1053
+ f("div", $n, [
1054
+ (p(!0), h(te, null, ne(c.value, (C) => (p(), h("div", {
1055
+ key: C.name,
1056
+ class: "vt-columns-selector__group"
1057
+ }, [
1058
+ f("div", {
1059
+ class: "vt-columns-selector__group-header",
1060
+ onClick: (w) => B(C.name)
1061
+ }, [
1062
+ j(ae, {
1063
+ label: C.label,
1064
+ checked: u.value[C.name]?.checked || !1,
1065
+ indeterminate: u.value[C.name]?.indeterminate || !1,
1066
+ onChange: (w) => D(C, w),
1067
+ onClick: g[1] || (g[1] = ce(() => {
1068
+ }, ["stop"]))
1069
+ }, null, 8, ["label", "checked", "indeterminate", "onChange"]),
1070
+ C.icon ? (p(), ie(G, {
1071
+ key: 0,
1072
+ name: C.icon,
1073
+ class: "vt-columns-selector__group-icon"
1074
+ }, null, 8, ["name"])) : V("", !0)
1075
+ ], 8, Mn),
1076
+ l.value.has(C.name) ? (p(), h("div", Ln, [
1077
+ (p(!0), h(te, null, ne(C.columns, (w) => (p(), h("div", {
1078
+ key: w.prop,
1079
+ class: "vt-columns-selector__group-column"
1080
+ }, [
1081
+ j(ae, {
1082
+ label: w.label,
1083
+ checked: k(w),
1084
+ disabled: !z(w),
1085
+ onChange: (I) => T(w, I)
1086
+ }, null, 8, ["label", "checked", "disabled", "onChange"]),
1087
+ z(w) ? V("", !0) : (p(), h("span", In, " (закріплена) "))
1088
+ ]))), 128))
1089
+ ])) : V("", !0)
1090
+ ]))), 128))
1091
+ ])
1092
+ ]),
1093
+ f("div", Rn, [
1094
+ j(pe, { onClick: F }, {
1095
+ default: ge(() => g[2] || (g[2] = [
1096
+ de("Скасувати", -1)
1097
+ ])),
1098
+ _: 1,
1099
+ __: [2]
1100
+ }),
1101
+ j(pe, {
1102
+ type: "primary",
1103
+ onClick: A
1104
+ }, {
1105
+ default: ge(() => g[3] || (g[3] = [
1106
+ de("Зберегти", -1)
1107
+ ])),
1108
+ _: 1,
1109
+ __: [3]
1110
+ })
1111
+ ])
1112
+ ]));
1113
+ }
1114
+ }), Tn = /* @__PURE__ */ oe({
1115
+ __name: "ColumnActions",
1116
+ props: {
1117
+ column: {},
1118
+ allColumns: {},
1119
+ columnsSelector: {}
1120
+ },
1121
+ emits: ["pin", "update-columns"],
1122
+ setup(e, { emit: t }) {
1123
+ const n = e, o = t, s = P(), l = P(), i = P(), a = P(!1), r = P(!1), u = P([]), c = async () => {
1124
+ if (await Ue(), !s.value || !l.value) return;
1125
+ const v = l.value.getBoundingClientRect(), T = s.value, D = T.offsetWidth, k = v.left + v.width / 2;
1126
+ T.style.top = `${v.bottom - 20}px`, T.style.left = `${k - D / 2}px`;
1127
+ const z = T.getBoundingClientRect();
1128
+ z.right > window.innerWidth && (T.style.left = `${window.innerWidth - D - 8}px`), z.left < 0 && (T.style.left = "8px");
1129
+ }, M = (v) => {
1130
+ v.stopPropagation(), !r.value && (a.value ? H() : $());
1131
+ }, $ = () => {
1132
+ r.value || (a.value = !0, c(), i.value && (i.value.style.zIndex = "22"));
1133
+ }, H = () => {
1134
+ r.value = !0, a.value = !1, i.value && i.value.style.removeProperty("z-index"), setTimeout(() => {
1135
+ r.value = !1;
1136
+ }, 100);
1137
+ }, N = (v) => {
1138
+ !l.value?.contains(v.target) && !s.value?.contains(v.target) && H();
1139
+ }, K = () => {
1140
+ Z() ? (o("pin", n.column, "none"), console.log(`Колонка "${n.column.label}" відкріплена`)) : (o("pin", n.column, "left"), console.log(`Колонка "${n.column.label}" прикріплена зліва`)), H();
1141
+ }, Y = (v) => ({
1142
+ name: "removed",
1143
+ label: "Видалені колонки",
1144
+ order: 999,
1145
+ // Найвищий порядок, щоб відображались останніми
1146
+ columns: v
1147
+ }), q = (v) => {
1148
+ const T = new Set(v.map((B) => B.prop)), D = /* @__PURE__ */ new Set();
1149
+ n.columnsSelector?.forEach((B) => {
1150
+ B.columns.forEach((A) => D.add(A.prop));
1151
+ }), n.allColumns.forEach((B) => D.add(B.prop));
1152
+ const k = [];
1153
+ D.forEach((B) => {
1154
+ if (!T.has(B)) {
1155
+ let A;
1156
+ n.columnsSelector?.forEach((F) => {
1157
+ const d = F.columns.find((g) => g.prop === B);
1158
+ d && (A = d);
1159
+ }), A || (A = n.allColumns.find((F) => F.prop === B)), A && k.push(A);
1160
+ }
1161
+ });
1162
+ const z = [...n.columnsSelector || []];
1163
+ k.length > 0 && z.push(Y(k)), u.value = z;
1164
+ }, L = () => {
1165
+ q(n.allColumns), se.open({
1166
+ component: Bn,
1167
+ title: "Управління колонками таблиці",
1168
+ props: {
1169
+ columns: n.allColumns,
1170
+ // Передаємо всі колонки
1171
+ columnsSelector: u.value,
1172
+ // Передаємо оновлені доступні колонки
1173
+ "onUpdate-columns": (v) => {
1174
+ console.log("ColumnActions отримав оновлені колонки:", v), o("update-columns", v), q(v);
1175
+ }
1176
+ },
1177
+ size: "large",
1178
+ closeOnBackdropClick: !1
1179
+ }), H();
1180
+ }, W = () => n.column.pinnedLeft, x = () => n.column.pinnedRight, Z = () => W() || x();
1181
+ return me(() => {
1182
+ document.addEventListener("click", N), l.value && (i.value = l.value.closest("th")), q(n.allColumns);
1183
+ }), Te(() => {
1184
+ document.removeEventListener("click", N);
1185
+ }), (v, T) => (p(), h("div", {
1186
+ ref_key: "triggerRef",
1187
+ ref: l,
1188
+ class: "vt-table-header-actions",
1189
+ onClick: M
1190
+ }, [
1191
+ j(G, { name: "listBullet" }),
1192
+ a.value ? (p(), h("ul", {
1193
+ key: 0,
1194
+ ref_key: "menuRef",
1195
+ ref: s,
1196
+ class: E(["dropdown-menu", "vt-table-dropdown", { visible: a.value }])
1197
+ }, [
1198
+ f("li", { onClick: K }, [
1199
+ j(G, {
1200
+ name: Z() ? "unfreeze" : "freeze"
1201
+ }, null, 8, ["name"]),
1202
+ f("span", null, Q(Z() ? "Розморозити" : "Заморозити"), 1)
1203
+ ]),
1204
+ f("li", { onClick: L }, [
1205
+ j(G, { name: "columnInsert" }),
1206
+ T[0] || (T[0] = f("span", null, "Колонки", -1))
1207
+ ])
1208
+ ], 2)) : V("", !0)
1209
+ ], 512));
1210
+ }
1211
+ }), zn = { class: "vt-table" }, En = { class: "vt-th__content" }, Wn = { class: "vt-th__content" }, Vn = { class: "vt-th__label" }, Dn = {
1212
+ key: 0,
1213
+ class: "vt-th__sortable"
1214
+ }, Pn = ["data-resizer", "onMousedown"], Hn = ["onClick"], An = { class: "vt-table__cell-content" }, On = { class: "vt-table__cell-content vt-table__cell-content--ellipsis" }, jn = { key: 1 }, Nn = ["data-resizer", "onMousedown"], Zn = {
1215
+ key: 0,
1216
+ class: "vt-table__summary"
1217
+ }, Fn = { class: "vt-table__cell-content vt-table__cell-content--summary" }, _e = 50, Un = /* @__PURE__ */ oe({
1218
+ __name: "VTable",
1219
+ props: /* @__PURE__ */ we({
1220
+ data: {},
1221
+ maxHeight: {},
1222
+ defaultSort: {},
1223
+ showSummary: { type: Boolean },
1224
+ summaryMethod: { type: Function },
1225
+ columnsSelector: {},
1226
+ selectable: { type: Boolean },
1227
+ selectionKey: {},
1228
+ defaultSelection: {},
1229
+ selectOnClickRow: { type: Boolean },
1230
+ highlightCurrentRow: { type: Boolean },
1231
+ allData: {},
1232
+ columns: {}
1233
+ }, {
1234
+ columns: { required: !1 },
1235
+ columnsModifiers: {}
1236
+ }),
1237
+ emits: /* @__PURE__ */ we(["sort-change", "selection-change", "current-change", "row-click", "update:columns", "column-pin", "column-resize", "column-visibility", "column-sort", "columns-change"], ["update:columns"]),
1238
+ setup(e, { expose: t, emit: n }) {
1239
+ const o = e, s = qe(e, "columns"), l = n, i = P({}), a = P(), r = Xe([]), u = P(o.defaultSort || null), c = S(() => s.value !== void 0), M = () => {
1240
+ c.value && s.value ? r.splice(0, r.length, ...s.value) : o.columns && r.splice(0, r.length, ...o.columns);
1241
+ };
1242
+ ue(
1243
+ () => s.value,
1244
+ (m) => {
1245
+ m && c.value && r.splice(0, r.length, ...m);
1246
+ },
1247
+ { deep: !0 }
1248
+ ), ue(
1249
+ () => o.columns,
1250
+ (m) => {
1251
+ m && !c.value && r.splice(0, r.length, ...m);
1252
+ },
1253
+ { deep: !0 }
1254
+ ), Ge("vt-table-columns", r);
1255
+ const { sortedColumns: $, getDefaultColumnWidth: H, getStickyOffset: N } = pn(r), { getTableWrapperStyle: K, getColumnStyle: Y, getHeaderStyle: q, getFooterStyle: L } = mn(o), { onMouseDown: W } = hn(), x = S(() => gn(o.data, u.value, r)), Z = S(() => o.allData || o.data), v = o.selectable ? vn(o, x, l, Z) : null, T = () => ({
1256
+ width: `${_e}px`,
1257
+ minWidth: `${_e}px`,
1258
+ maxWidth: `${_e}px`,
1259
+ left: "0px",
1260
+ position: "sticky",
1261
+ zIndex: 10
1262
+ }), D = () => {
1263
+ const m = T();
1264
+ return o.maxHeight ? {
1265
+ ...m,
1266
+ top: "0px",
1267
+ zIndex: 11
1268
+ // Вищий z-index для header
1269
+ } : m;
1270
+ }, k = () => {
1271
+ const m = T();
1272
+ return o.maxHeight ? {
1273
+ ...m,
1274
+ bottom: "0px",
1275
+ zIndex: 11
1276
+ // Вищий z-index для footer
1277
+ } : m;
1278
+ }, z = (m, b) => {
1279
+ _n(m, b, (R) => {
1280
+ u.value?.prop === m.prop && u.value.direction === b ? u.value = null : u.value = R, l("sort-change", {
1281
+ column: m,
1282
+ direction: u.value?.direction || null,
1283
+ prop: m.prop,
1284
+ sortedData: x.value
1285
+ });
1286
+ });
1287
+ }, B = (m, b) => {
1288
+ console.log(`Колонка "${m.label}" закріплення: ${b}`);
1289
+ const R = {
1290
+ pinnedLeft: b === "left",
1291
+ pinnedRight: b === "right"
1292
+ };
1293
+ F(m.prop, R), l("column-pin", { column: { ...m, ...R }, position: b });
1294
+ }, A = (m) => {
1295
+ console.log("handleColumnsUpdate викликано з колонками:", m), r.splice(0, r.length, ...m), c.value && (s.value = [...m]), l("columns-change", [...m]);
1296
+ }, F = (m, b) => {
1297
+ console.log("updateColumn викликано:", { prop: m, updates: b, hasColumnsModel: c.value });
1298
+ const R = r.findIndex((_) => _.prop === m);
1299
+ if (R !== -1) {
1300
+ if (console.log("Оновлюємо internalColumns:", R, b), Object.assign(r[R], b), c.value && s.value) {
1301
+ const _ = s.value.findIndex((y) => y.prop === m);
1302
+ if (_ !== -1) {
1303
+ const y = [...s.value];
1304
+ y[_] = { ...y[_], ...b }, console.log("Оновлюємо через defineModel:", y), s.value = y;
1305
+ }
1306
+ }
1307
+ l("columns-change", [...r]);
1308
+ } else
1309
+ console.error(
1310
+ "Колонку не знайдено:",
1311
+ m,
1312
+ "Доступні колонки:",
1313
+ r.map((_) => _.prop)
1314
+ );
1315
+ }, d = (m, b, R) => {
1316
+ l("row-click", { row: m, column: b, event: R }), o.highlightCurrentRow && v && v.setCurrentRow(m);
1317
+ }, g = (m, b, R) => {
1318
+ R.stopPropagation(), v && v.toggleRowSelection(b, m);
1319
+ }, C = (m, b) => {
1320
+ b.stopPropagation(), v && v.toggleAllSelection(), m === void 0 && console.log(m);
1321
+ }, w = (m, b) => {
1322
+ m && (i.value[b] = m);
1323
+ }, I = (m, b) => {
1324
+ const R = b.width || H();
1325
+ console.log(R), W(m, b, H, (_) => {
1326
+ console.log(_), F(b.prop, { width: _ }), l("column-resize", {
1327
+ column: { ...b, width: _ },
1328
+ width: _,
1329
+ oldWidth: R
1330
+ });
1331
+ });
1332
+ }, O = (m, b) => Y(m, b, N, H), ee = (m, b) => q(m, b, N, H), he = (m, b) => L(m, b, N, H), We = (m, b) => {
1333
+ if (!b || !b.prop) return "";
1334
+ const R = m[b.prop];
1335
+ return R == null ? "" : String(R);
1336
+ }, Ve = S(() => {
1337
+ if (!o.showSummary) return {};
1338
+ const m = r;
1339
+ if (typeof o.summaryMethod == "function") {
1340
+ const b = o.summaryMethod({ columns: m, data: x.value });
1341
+ return m.reduce(
1342
+ (R, _, y) => (R[_.prop] = b[y], R),
1343
+ {}
1344
+ );
1345
+ }
1346
+ return m.reduce(
1347
+ (b, R) => {
1348
+ const _ = x.value.map((y) => y[R.prop]);
1349
+ return b[R.prop] = _.every((y) => typeof y == "number") ? _.reduce((y, J) => y + J, 0) : "", b;
1350
+ },
1351
+ {}
1352
+ );
1353
+ }), De = (m, b) => {
1354
+ v && v.toggleRowSelection(m, b);
1355
+ }, Pe = () => {
1356
+ v && v.toggleAllSelection();
1357
+ }, He = () => {
1358
+ v && v.selectAbsolutelyAll();
1359
+ }, Ae = () => {
1360
+ v && v.clearSelection();
1361
+ }, Oe = () => v ? v.getSelectionRows() : [], je = (m) => {
1362
+ v && v.setSelectionRows(m);
1363
+ };
1364
+ return me(() => {
1365
+ M();
1366
+ }), t({
1367
+ toggleRowSelection: De,
1368
+ toggleAllSelection: Pe,
1369
+ selectAbsolutelyAll: He,
1370
+ clearSelection: Ae,
1371
+ getSelectionRows: Oe,
1372
+ setSelectionRows: je
1373
+ }), (m, b) => {
1374
+ const R = Be("tooltip");
1375
+ return p(), h("div", {
1376
+ ref_key: "tableWrapperRef",
1377
+ ref: a,
1378
+ class: "vt-table-wrapper",
1379
+ style: le(U(K)())
1380
+ }, [
1381
+ re(m.$slots, "default"),
1382
+ f("table", zn, [
1383
+ f("thead", null, [
1384
+ f("tr", null, [
1385
+ o.selectable ? (p(), h("th", {
1386
+ key: 0,
1387
+ class: E(["vt-table__th vt-table__th--selection", {
1388
+ "vt-table__th--sticky": o.maxHeight,
1389
+ "vt-table__th--pinned-left": !0
1390
+ }]),
1391
+ style: le(D())
1392
+ }, [
1393
+ f("div", En, [
1394
+ j(ae, {
1395
+ checked: U(v)?.isAllSelected.value,
1396
+ indeterminate: U(v)?.isIndeterminate.value,
1397
+ "is-double": U(v)?.isDoubleCheck?.value,
1398
+ onChange: C
1399
+ }, null, 8, ["checked", "indeterminate", "is-double"])
1400
+ ])
1401
+ ], 6)) : V("", !0),
1402
+ (p(!0), h(te, null, ne(U($), (_, y) => (p(), h("th", {
1403
+ key: _.prop,
1404
+ ref_for: !0,
1405
+ ref: (J) => w(J, _.prop),
1406
+ style: le(ee(_, y)),
1407
+ class: E([
1408
+ "vt-table__th",
1409
+ {
1410
+ "vt-table__th--sticky": o.maxHeight,
1411
+ "vt-table__th--pinned-left": _.pinnedLeft,
1412
+ "vt-table__th--pinned-right": _.pinnedRight,
1413
+ "vt-table__th--sortable": _.sortable
1414
+ }
1415
+ ])
1416
+ }, [
1417
+ f("div", Wn, [
1418
+ f("div", Vn, Q(_.label), 1),
1419
+ _.sortable ? (p(), h("div", Dn, [
1420
+ j(G, {
1421
+ name: "arrowTop",
1422
+ class: E(U(ye)(_, u.value).asc),
1423
+ onClick: ce((J) => z(_, "asc"), ["stop"])
1424
+ }, null, 8, ["class", "onClick"]),
1425
+ j(G, {
1426
+ name: "arrowDown",
1427
+ class: E(U(ye)(_, u.value).desc),
1428
+ onClick: ce((J) => z(_, "desc"), ["stop"])
1429
+ }, null, 8, ["class", "onClick"])
1430
+ ])) : V("", !0),
1431
+ _.actionColumn ? (p(), ie(Tn, {
1432
+ key: 1,
1433
+ column: _,
1434
+ "all-columns": U($),
1435
+ columnsSelector: o.columnsSelector,
1436
+ onPin: B,
1437
+ onUpdateColumns: A
1438
+ }, null, 8, ["column", "all-columns", "columnsSelector"])) : V("", !0)
1439
+ ]),
1440
+ f("div", {
1441
+ class: "vt-table__resizer",
1442
+ "data-resizer": _.prop,
1443
+ onMousedown: (J) => I(J, _)
1444
+ }, null, 40, Pn)
1445
+ ], 6))), 128))
1446
+ ])
1447
+ ]),
1448
+ f("tbody", null, [
1449
+ (p(!0), h(te, null, ne(x.value, (_) => (p(), h("tr", {
1450
+ key: _.id,
1451
+ class: E([
1452
+ "vt-table__row",
1453
+ {
1454
+ "vt-table__row--selected": U(v)?.isRowSelected(_),
1455
+ "vt-table__row--current": U(v)?.currentRow.value === _,
1456
+ "vt-table__row--clickable": o.selectOnClickRow || o.highlightCurrentRow
1457
+ }
1458
+ ]),
1459
+ onClick: (y) => d(_, U($)[0], y)
1460
+ }, [
1461
+ o.selectable ? (p(), h("td", {
1462
+ key: 0,
1463
+ class: E(["vt-table__td vt-table__td--selection", {
1464
+ "vt-table__td--pinned-left": !0
1465
+ }]),
1466
+ style: le(T())
1467
+ }, [
1468
+ f("div", An, [
1469
+ j(ae, {
1470
+ checked: U(v)?.isRowSelected(_),
1471
+ onChange: (y, J) => g(y, _, J)
1472
+ }, null, 8, ["checked", "onChange"])
1473
+ ])
1474
+ ], 4)) : V("", !0),
1475
+ (p(!0), h(te, null, ne(U($), (y, J) => (p(), h("td", {
1476
+ key: y.prop,
1477
+ ref_for: !0,
1478
+ ref: (ve) => w(ve, y.prop),
1479
+ style: le(O(y, J)),
1480
+ class: E([
1481
+ "vt-table__td",
1482
+ {
1483
+ "vt-table__td--pinned-left": y.pinnedLeft,
1484
+ "vt-table__td--pinned-right": y.pinnedRight
1485
+ }
1486
+ ])
1487
+ }, [
1488
+ be((p(), h("div", On, [
1489
+ y.renderSlot ? (p(), ie(Ie(y.renderSlot), {
1490
+ key: 0,
1491
+ row: _,
1492
+ column: y,
1493
+ value: _[y.prop]
1494
+ }, null, 8, ["row", "column", "value"])) : (p(), h("span", jn, Q(_[y.prop]), 1))
1495
+ ])), [
1496
+ [R, y.showOverflowTooltip ? We(_, y) : null]
1497
+ ]),
1498
+ f("div", {
1499
+ class: "vt-table__resizer",
1500
+ "data-resizer": y.prop,
1501
+ onMousedown: (ve) => I(ve, y)
1502
+ }, null, 40, Nn)
1503
+ ], 6))), 128))
1504
+ ], 10, Hn))), 128))
1505
+ ]),
1506
+ o.showSummary ? (p(), h("tfoot", Zn, [
1507
+ f("tr", null, [
1508
+ o.selectable ? (p(), h("td", {
1509
+ key: 0,
1510
+ class: E(["vt-table__td", {
1511
+ "vt-table__td--pinned-left": !0
1512
+ }]),
1513
+ style: le(k())
1514
+ }, b[0] || (b[0] = [
1515
+ f("div", { class: "vt-table__cell-content vt-table__cell-content--summary" }, null, -1)
1516
+ ]), 4)) : V("", !0),
1517
+ (p(!0), h(te, null, ne(U($), (_, y) => (p(), h("td", {
1518
+ key: _.prop,
1519
+ style: le(he(_, y)),
1520
+ class: E([
1521
+ "vt-table__td",
1522
+ {
1523
+ "vt-table__td--pinned-left": _.pinnedLeft,
1524
+ "vt-table__td--pinned-right": _.pinnedRight
1525
+ }
1526
+ ])
1527
+ }, [
1528
+ f("div", Fn, Q(Ve.value[_.prop]), 1)
1529
+ ], 6))), 128))
1530
+ ])
1531
+ ])) : V("", !0)
1532
+ ])
1533
+ ], 4);
1534
+ };
1535
+ }
1536
+ }), qn = /* @__PURE__ */ oe({
1537
+ __name: "VTableColumn",
1538
+ props: {
1539
+ prop: {},
1540
+ label: {},
1541
+ width: {},
1542
+ minWidth: {},
1543
+ maxWidth: {},
1544
+ sortable: { type: Boolean, default: !0 },
1545
+ pinnedLeft: { type: Boolean, default: !1 },
1546
+ pinnedRight: { type: Boolean, default: !1 },
1547
+ actionColumn: { type: Boolean, default: !0 },
1548
+ showOverflowTooltip: { type: Boolean, default: !0 },
1549
+ selectable: { type: Boolean, default: !0 },
1550
+ renderSlot: {},
1551
+ sortMethod: {}
1552
+ },
1553
+ setup(e) {
1554
+ const t = e, n = Re(), o = Ke("vt-table-columns");
1555
+ o || console.error(
1556
+ "VTableColumn: не знайдено контекст таблиці. Переконайтеся, що компонент використовується всередині VTable."
1557
+ );
1558
+ const s = () => ({
1559
+ prop: t.prop,
1560
+ label: t.label,
1561
+ width: t.width,
1562
+ minWidth: t.minWidth,
1563
+ maxWidth: t.maxWidth,
1564
+ sortable: t.sortable,
1565
+ pinnedLeft: t.pinnedLeft,
1566
+ pinnedRight: t.pinnedRight,
1567
+ actionColumn: t.actionColumn,
1568
+ showOverflowTooltip: t.showOverflowTooltip,
1569
+ selectable: t.selectable,
1570
+ // Зберігаємо слот - пріоритет: назва колонки -> default -> slot
1571
+ renderSlot: n[t.prop] || n.default || n.slot
1572
+ });
1573
+ let l = -1;
1574
+ return me(() => {
1575
+ if (o) {
1576
+ const i = s();
1577
+ o.push(i), l = o.length - 1, console.log(`VTableColumn: зареєстровано колонку "${t.label}" (${t.prop}) на позиції ${l}`);
1578
+ }
1579
+ }), ue(
1580
+ () => [
1581
+ t.width,
1582
+ t.minWidth,
1583
+ t.maxWidth,
1584
+ t.sortable,
1585
+ t.pinnedLeft,
1586
+ t.pinnedRight,
1587
+ t.actionColumn,
1588
+ t.showOverflowTooltip,
1589
+ t.selectable,
1590
+ t.label
1591
+ ],
1592
+ () => {
1593
+ if (o && l !== -1) {
1594
+ const i = o.findIndex((a) => a.prop === t.prop);
1595
+ if (i !== -1) {
1596
+ const a = o[i], r = {
1597
+ ...s(),
1598
+ renderSlot: a.renderSlot
1599
+ // Зберігаємо існуючий renderSlot
1600
+ };
1601
+ o[i] = r, console.log(`VTableColumn: оновлено колонку "${t.label}" (${t.prop})`);
1602
+ }
1603
+ }
1604
+ },
1605
+ { deep: !0 }
1606
+ ), Te(() => {
1607
+ if (o) {
1608
+ const i = o.findIndex((a) => a.prop === t.prop);
1609
+ i > -1 && (o.splice(i, 1), console.log(`VTableColumn: видалено колонку "${t.label}" (${t.prop})`));
1610
+ }
1611
+ }), (i, a) => null;
1612
+ }
1613
+ }), xe = (e, t) => {
1614
+ const n = document.createElement("div");
1615
+ n.className = `vt-tooltip vt-tooltip--${t}`, n.innerText = e, Object.assign(n.style, {
1616
+ position: "absolute",
1617
+ background: "rgba(0, 0, 0, 0.8)",
1618
+ color: "white",
1619
+ padding: "8px 12px",
1620
+ borderRadius: "4px",
1621
+ fontSize: "12px",
1622
+ lineHeight: "1.4",
1623
+ zIndex: "9999",
1624
+ pointerEvents: "none",
1625
+ visibility: "hidden",
1626
+ opacity: "0",
1627
+ transition: "opacity 0.2s ease, visibility 0.2s ease",
1628
+ maxWidth: "300px",
1629
+ minWidth: "max-content",
1630
+ wordWrap: "break-word",
1631
+ whiteSpace: "normal",
1632
+ boxShadow: "0 2px 8px rgba(0, 0, 0, 0.2)"
1633
+ }), e.length < 50 && (n.style.whiteSpace = "nowrap");
1634
+ const o = document.createElement("div");
1635
+ switch (o.className = "vt-tooltip__arrow", Object.assign(o.style, {
1636
+ position: "absolute",
1637
+ width: "0",
1638
+ height: "0",
1639
+ borderStyle: "solid"
1640
+ }), t) {
1641
+ case "top":
1642
+ Object.assign(o.style, {
1643
+ top: "100%",
1644
+ left: "50%",
1645
+ marginLeft: "-5px",
1646
+ borderWidth: "5px 5px 0 5px",
1647
+ borderColor: "rgba(0, 0, 0, 0.8) transparent transparent transparent"
1648
+ });
1649
+ break;
1650
+ case "bottom":
1651
+ Object.assign(o.style, {
1652
+ bottom: "100%",
1653
+ left: "50%",
1654
+ marginLeft: "-5px",
1655
+ borderWidth: "0 5px 5px 5px",
1656
+ borderColor: "transparent transparent rgba(0, 0, 0, 0.8) transparent"
1657
+ });
1658
+ break;
1659
+ case "left":
1660
+ Object.assign(o.style, {
1661
+ top: "50%",
1662
+ left: "100%",
1663
+ marginTop: "-5px",
1664
+ borderWidth: "5px 0 5px 5px",
1665
+ borderColor: "transparent transparent transparent rgba(0, 0, 0, 0.8)"
1666
+ });
1667
+ break;
1668
+ case "right":
1669
+ Object.assign(o.style, {
1670
+ top: "50%",
1671
+ right: "100%",
1672
+ marginTop: "-5px",
1673
+ borderWidth: "5px 5px 5px 0",
1674
+ borderColor: "transparent rgba(0, 0, 0, 0.8) transparent transparent"
1675
+ });
1676
+ break;
1677
+ }
1678
+ return n.appendChild(o), n;
1679
+ }, Ce = (e, t, n) => {
1680
+ const o = t.getBoundingClientRect(), s = e.getBoundingClientRect(), l = window.pageXOffset || document.documentElement.scrollLeft, i = window.pageYOffset || document.documentElement.scrollTop;
1681
+ let a = 0, r = 0;
1682
+ switch (n) {
1683
+ case "top":
1684
+ a = o.top + i - s.height - 8, r = o.left + l + (o.width - s.width) / 2;
1685
+ break;
1686
+ case "bottom":
1687
+ a = o.bottom + i + 8, r = o.left + l + (o.width - s.width) / 2;
1688
+ break;
1689
+ case "left":
1690
+ a = o.top + i + (o.height - s.height) / 2, r = o.left + l - s.width - 8;
1691
+ break;
1692
+ case "right":
1693
+ a = o.top + i + (o.height - s.height) / 2, r = o.right + l + 8;
1694
+ break;
1695
+ }
1696
+ const u = window.innerWidth, c = window.innerHeight;
1697
+ r < 8 ? r = 8 : r + s.width > u - 8 && (r = u - s.width - 8), a < i + 8 ? n === "top" ? a = o.bottom + i + 8 : a = i + 8 : a + s.height > i + c - 8 && (n === "bottom" ? a = o.top + i - s.height - 8 : a = i + c - s.height - 8), e.style.top = `${a}px`, e.style.left = `${r}px`;
1698
+ }, Se = (e, t, n) => {
1699
+ e.parentElement || document.body.appendChild(e), e.style.visibility = "visible", Ce(e, t, n), requestAnimationFrame(() => {
1700
+ e.style.opacity = "1";
1701
+ });
1702
+ }, $e = (e) => {
1703
+ e.style.opacity = "0", e.style.visibility = "hidden";
1704
+ }, Me = (e) => e.scrollWidth > e.clientWidth || e.scrollHeight > e.clientHeight, Le = (e) => !!e.closest(".vt-table, table"), Xn = {
1705
+ mounted(e, t) {
1706
+ const n = t.value?.trim();
1707
+ if (!n) return;
1708
+ const o = e.dataset.placement || "top", s = xe(n, o);
1709
+ e.__tooltipEl = s;
1710
+ const l = () => {
1711
+ (Le(e) ? Me(e) : !0) && Se(s, e, o);
1712
+ }, i = () => {
1713
+ $e(s);
1714
+ }, a = () => {
1715
+ s.style.opacity === "1" && Ce(s, e, o);
1716
+ };
1717
+ e.__mouseenterHandler = l, e.__mouseleaveHandler = i, e.__scrollHandler = a, e.addEventListener("mouseenter", l), e.addEventListener("mouseleave", i), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a);
1718
+ },
1719
+ updated(e, t) {
1720
+ const n = t.value?.trim();
1721
+ if (e.__tooltipEl)
1722
+ n ? e.__tooltipEl.firstChild.textContent = n : (e.__tooltipEl.parentElement && e.__tooltipEl.parentElement.removeChild(e.__tooltipEl), delete e.__tooltipEl);
1723
+ else if (n) {
1724
+ const o = e.dataset.placement || "top", s = xe(n, o);
1725
+ e.__tooltipEl = s;
1726
+ const l = () => {
1727
+ (Le(e) ? Me(e) : !0) && Se(s, e, o);
1728
+ }, i = () => {
1729
+ $e(s);
1730
+ }, a = () => {
1731
+ s.style.opacity === "1" && Ce(s, e, o);
1732
+ };
1733
+ e.__mouseenterHandler = l, e.__mouseleaveHandler = i, e.__scrollHandler = a, e.addEventListener("mouseenter", l), e.addEventListener("mouseleave", i), window.addEventListener("scroll", a, !0), window.addEventListener("resize", a);
1734
+ }
1735
+ },
1736
+ beforeUnmount(e) {
1737
+ e.__tooltipEl && e.__tooltipEl.parentElement && (e.__tooltipEl.parentElement.removeChild(e.__tooltipEl), delete e.__tooltipEl), e.__mouseenterHandler && (e.removeEventListener("mouseenter", e.__mouseenterHandler), delete e.__mouseenterHandler), e.__mouseleaveHandler && (e.removeEventListener("mouseleave", e.__mouseleaveHandler), delete e.__mouseleaveHandler), e.__scrollHandler && (window.removeEventListener("scroll", e.__scrollHandler, !0), window.removeEventListener("resize", e.__scrollHandler), delete e.__scrollHandler);
1738
+ }
1739
+ }, Gn = {
1740
+ install(e, t = {}) {
1741
+ const { prefix: n = "V", modal: o = !0 } = t;
1742
+ e.component(`${n}Button`, pe), e.component(`${n}Icon`, G), e.component(`${n}Loader`, ze), e.component(`${n}Modal`, Ee), e.component(`${n}Pagination`, cn), e.component(`${n}Checkbox`, ae), e.component(`${n}Table`, Un), e.component(`${n}TableColumn`, qn), e.directive("tooltip", Xn), o && e.use(bn);
1743
+ }
1744
+ }, Yn = Gn.install;
52
1745
  export {
53
- d as VButton,
54
- x as VIcon,
55
- h as default
1746
+ pe as VButton,
1747
+ ae as VCheckbox,
1748
+ G as VIcon,
1749
+ ze as VLoader,
1750
+ Ee as VModal,
1751
+ bn as VModalPlugin,
1752
+ cn as VPagination,
1753
+ Un as VTable,
1754
+ qn as VTableColumn,
1755
+ Gn as default,
1756
+ Yn as install,
1757
+ se as modalManager,
1758
+ Xn as tooltipDirective
56
1759
  };