voiptime-components 0.0.25 → 0.0.27

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.d.ts CHANGED
@@ -124,7 +124,18 @@ declare const __VLS_component_4: DefineComponent<__VLS_PublicProps, {
124
124
  }) => any) | undefined;
125
125
  "onColumns-change"?: ((columns: VTableColumnProps[]) => any) | undefined;
126
126
  "onInfinity-scroll"?: (() => any) | undefined;
127
- }>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {
127
+ }>, {
128
+ maxHeight: number;
129
+ selectable: boolean;
130
+ columns: VTableColumnProps[];
131
+ columnsSelector: VTableColumnGroup[];
132
+ showSummary: boolean;
133
+ selectionKey: string;
134
+ defaultSelection: any[];
135
+ selectOnClickRow: boolean;
136
+ highlightCurrentRow: boolean;
137
+ allData: Record<string, any>[];
138
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {
128
139
  tableWrapperRef: HTMLDivElement;
129
140
  }, HTMLDivElement>;
130
141
 
@@ -135,7 +146,7 @@ declare type __VLS_Props = {
135
146
  declare type __VLS_Props_2 = VTableProps;
136
147
 
137
148
  declare type __VLS_PublicProps = {
138
- 'columns'?: VTableColumnProps[];
149
+ 'columns'?: VTableColumnProps[] | undefined;
139
150
  } & __VLS_Props_2;
140
151
 
141
152
  declare function __VLS_template(): {
@@ -168,7 +179,9 @@ declare function __VLS_template_3(): {
168
179
 
169
180
  declare function __VLS_template_4(): {
170
181
  attrs: Partial<{}>;
171
- slots: Readonly<VTableColumnSlots> & VTableColumnSlots;
182
+ slots: {
183
+ default?(_: {}): any;
184
+ };
172
185
  refs: {
173
186
  tableWrapperRef: HTMLDivElement;
174
187
  };
@@ -208,12 +221,12 @@ declare type __VLS_WithTemplateSlots_4<T, S> = T & {
208
221
  };
209
222
 
210
223
  export declare const DEFAULT_COLUMN_CONFIG: {
211
- sortable: boolean;
212
- actionColumn: boolean;
213
- showOverflowTooltip: boolean;
214
- visible: boolean;
215
- pinnedLeft: boolean;
216
- pinnedRight: boolean;
224
+ readonly sortable: true;
225
+ readonly actionColumn: false;
226
+ readonly showOverflowTooltip: true;
227
+ readonly visible: true;
228
+ readonly pinnedLeft: false;
229
+ readonly pinnedRight: false;
217
230
  };
218
231
 
219
232
  export declare type IconName = keyof typeof icons;
@@ -505,10 +518,6 @@ export declare interface VTableColumnProps {
505
518
  sortMethod?: Function;
506
519
  }
507
520
 
508
- declare interface VTableColumnSlots {
509
- default?: () => VNode[];
510
- }
511
-
512
521
  export declare interface VTableEmits {
513
522
  'sort-change': [payload: SortChangeEventData];
514
523
  'selection-change': [payload: SelectionChangeEventData];
@@ -545,25 +554,38 @@ export declare interface VTableEmits {
545
554
  }
546
555
 
547
556
  export declare interface VTableProps {
557
+ /** Масив даних для відображення в таблиці */
548
558
  data: Record<string, any>[];
559
+ /** Максимальна висота таблиці (для sticky header) */
549
560
  maxHeight?: number;
561
+ /** Початкове сортування */
550
562
  defaultSort?: SortState;
563
+ /** Показувати підсумковий рядок */
551
564
  showSummary?: boolean;
565
+ /** Метод для обчислення підсумкових значень */
552
566
  summaryMethod?: (params: {
553
567
  columns: VTableColumnProps[];
554
568
  data: Record<string, any>[];
555
569
  }) => any[];
570
+ /** Групи колонок для селектора */
556
571
  columnsSelector?: VTableColumnGroup[];
572
+ /** Чи включити функціонал виділення рядків */
557
573
  selectable?: boolean;
574
+ /** Ключ для ідентифікації рядків (за замовчуванням 'id') */
558
575
  selectionKey?: string;
576
+ /** Рядки виділені за замовчуванням */
559
577
  defaultSelection?: any[];
578
+ /** Виділяти рядок при кліку на нього */
560
579
  selectOnClickRow?: boolean;
580
+ /** Підсвічувати поточний рядок */
561
581
  highlightCurrentRow?: boolean;
582
+ /** Всі дані для повного виділення (якщо відрізняються від data) */
562
583
  allData?: Record<string, any>[];
584
+ /** Конфігурація колонок */
563
585
  columns?: VTableColumnProps[];
564
586
  }
565
587
 
566
- declare type VTableRenderSlot = (props: {
588
+ export declare type VTableRenderSlot = (props: {
567
589
  row: Record<string, any>;
568
590
  column: VTableColumnProps;
569
591
  value: any;
@@ -589,7 +611,7 @@ export { }
589
611
 
590
612
  declare module '@vue/runtime-core' {
591
613
  interface ComponentCustomProperties {
592
- $modal: VModalInstance;
614
+ $modal: import('./components/modal/types').VModalInstance;
593
615
  }
594
616
  }
595
617
 
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createElementBlock as m, openBlock as p, createElementVNode as h, createStaticVNode as Ae, defineComponent as le, computed as x, createBlock as ae, createCommentVNode as D, resolveDynamicComponent as Oe, useSlots as je, resolveDirective as Fe, withDirectives as Le, normalizeClass as z, renderSlot as pe, Teleport as st, normalizeStyle as re, withModifiers as he, toDisplayString as te, watch as me, Fragment as ne, renderList as oe, vModelSelect as rt, createVNode as Z, withCtx as xe, createTextVNode as _e, ref as A, createApp as it, h as be, onMounted as ve, onUnmounted as $e, nextTick as at, mergeModels as Re, useModel as ct, reactive as ut, provide as dt, unref as q, inject as pt } from "vue";
1
+ import { createElementBlock as m, openBlock as p, createElementVNode as h, createStaticVNode as Ae, defineComponent as le, computed as x, createBlock as ae, createCommentVNode as D, resolveDynamicComponent as Oe, useSlots as je, resolveDirective as Ne, withDirectives as Le, normalizeClass as z, renderSlot as pe, Teleport as st, normalizeStyle as re, withModifiers as he, toDisplayString as te, watch as me, Fragment as ne, renderList as oe, vModelSelect as rt, createVNode as Z, withCtx as xe, createTextVNode as _e, ref as A, createApp as it, h as be, onMounted as ve, onUnmounted as $e, nextTick as at, mergeModels as Re, useModel as ct, reactive as ut, provide as dt, unref as q, inject as pt } from "vue";
2
2
  const H = (t, e) => {
3
3
  const o = t.__vccOpts || t;
4
4
  for (const [n, s] of e)
@@ -147,7 +147,7 @@ const At = /* @__PURE__ */ H(Wt, [["render", Pt]]), Ot = {}, jt = {
147
147
  fill: "none",
148
148
  xmlns: "http://www.w3.org/2000/svg"
149
149
  };
150
- function Ft(t, e) {
150
+ function Nt(t, e) {
151
151
  return p(), m("svg", jt, e[0] || (e[0] = [
152
152
  h("path", {
153
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",
@@ -164,7 +164,7 @@ function Ft(t, e) {
164
164
  }, null, -1)
165
165
  ]));
166
166
  }
167
- const Nt = /* @__PURE__ */ H(Ot, [["render", Ft]]), Zt = {}, Ut = {
167
+ const Ft = /* @__PURE__ */ H(Ot, [["render", Nt]]), Zt = {}, Ut = {
168
168
  xmlns: "http://www.w3.org/2000/svg",
169
169
  width: "60",
170
170
  height: "60",
@@ -411,7 +411,7 @@ function jn(t, e) {
411
411
  Ae('<circle cx="4.5" cy="12.5" r="1.5" stroke="currentColor" stroke-width="1.5"></circle><circle cx="9.5" cy="8.5" r="1.5" transform="rotate(-180 9.5 8.5)" stroke="currentColor" stroke-width="1.5"></circle><circle cx="14.5" cy="12.5" r="1.5" stroke="currentColor" stroke-width="1.5"></circle><path d="M4.55469 10.5V2" stroke="currentColor" stroke-width="1.5"></path><path d="M9.44531 9.5L9.44531 18" stroke="currentColor" stroke-width="1.5"></path><path d="M14.5547 10.5V2" stroke="currentColor" stroke-width="1.5"></path><path d="M4.55469 18V15.5" stroke="currentColor" stroke-width="1.5"></path><path d="M9.44531 2L9.44531 5.5" stroke="currentColor" stroke-width="1.5"></path><path d="M14.5547 18V15.5" stroke="currentColor" stroke-width="1.5"></path>', 9)
412
412
  ]));
413
413
  }
414
- const Fn = /* @__PURE__ */ H(An, [["render", jn]]), Nn = {}, Zn = {
414
+ const Nn = /* @__PURE__ */ H(An, [["render", jn]]), Fn = {}, Zn = {
415
415
  width: "20",
416
416
  height: "20",
417
417
  viewBox: "0 0 20 20",
@@ -436,7 +436,7 @@ function Un(t, e) {
436
436
  }, null, -1)
437
437
  ]));
438
438
  }
439
- const qn = /* @__PURE__ */ H(Nn, [["render", Un]]), Xn = {
439
+ const qn = /* @__PURE__ */ H(Fn, [["render", Un]]), Xn = {
440
440
  // arrow icons
441
441
  arrowDown: ft,
442
442
  arrowTop: wt,
@@ -446,7 +446,7 @@ const qn = /* @__PURE__ */ H(Nn, [["render", Un]]), Xn = {
446
446
  // table icons
447
447
  columnInsert: Ht,
448
448
  freeze: At,
449
- unfreeze: Nt,
449
+ unfreeze: Ft,
450
450
  columnsMove: Jt,
451
451
  empty: Xt,
452
452
  // actions icons
@@ -461,7 +461,7 @@ const qn = /* @__PURE__ */ H(Nn, [["render", Un]]), Xn = {
461
461
  filterExchange: Bn,
462
462
  filterEdit: zn,
463
463
  filterDateCheck: Pn,
464
- filterAdvanced: Fn,
464
+ filterAdvanced: Nn,
465
465
  filterAdd: qn
466
466
  }, Y = /* @__PURE__ */ le({
467
467
  __name: "VIcon",
@@ -476,7 +476,7 @@ const qn = /* @__PURE__ */ H(Nn, [["render", Un]]), Xn = {
476
476
  function Yn(t, e) {
477
477
  return p(), m("span", Kn);
478
478
  }
479
- const Ne = /* @__PURE__ */ H(Gn, [["render", Yn]]), Jn = ["disabled", "type", "data-placement"], Qn = {
479
+ const Fe = /* @__PURE__ */ H(Gn, [["render", Yn]]), Jn = ["disabled", "type", "data-placement"], Qn = {
480
480
  key: 2,
481
481
  class: "vt-button__content"
482
482
  }, ge = /* @__PURE__ */ le({
@@ -510,7 +510,7 @@ const Ne = /* @__PURE__ */ H(Gn, [["render", Yn]]), Jn = ["disabled", "type", "d
510
510
  !o.disabled && !o.loading && n("click", c);
511
511
  };
512
512
  return (c, b) => {
513
- const M = Fe("tooltip");
513
+ const M = Ne("tooltip");
514
514
  return Le((p(), m("button", {
515
515
  class: z(r.value),
516
516
  disabled: o.disabled || o.loading,
@@ -518,7 +518,7 @@ const Ne = /* @__PURE__ */ H(Gn, [["render", Yn]]), Jn = ["disabled", "type", "d
518
518
  "data-placement": o.tooltipPlacement,
519
519
  onClick: u
520
520
  }, [
521
- o.loading ? (p(), ae(Ne, {
521
+ o.loading ? (p(), ae(Fe, {
522
522
  key: 0,
523
523
  class: "vt-button__icon"
524
524
  })) : o.icon ? (p(), ae(Y, {
@@ -625,13 +625,13 @@ const Ne = /* @__PURE__ */ H(Gn, [["render", Yn]]), Jn = ["disabled", "type", "d
625
625
  });
626
626
  }, X = (L) => {
627
627
  typeof L == "number" && L !== s.value && (s.value = L, M());
628
- }, F = () => {
628
+ }, N = () => {
629
629
  u.value || (s.value--, M());
630
630
  }, Q = () => {
631
631
  c.value || (s.value++, M());
632
632
  }, U = () => {
633
633
  s.value = 1, M();
634
- }, N = () => {
634
+ }, F = () => {
635
635
  n("reloadData", s.value);
636
636
  };
637
637
  return me(
@@ -664,7 +664,7 @@ const Ne = /* @__PURE__ */ H(Gn, [["render", Yn]]), Jn = ["disabled", "type", "d
664
664
  ]),
665
665
  h("div", io, [
666
666
  h("button", {
667
- onClick: F,
667
+ onClick: N,
668
668
  disabled: u.value,
669
669
  class: z({ "vt-pagination__nav-button": !0, "has-items": !u.value })
670
670
  }, [
@@ -691,7 +691,7 @@ const Ne = /* @__PURE__ */ H(Gn, [["render", Yn]]), Jn = ["disabled", "type", "d
691
691
  shape: "circle",
692
692
  tooltip: "",
693
693
  tooltipPlacement: "left",
694
- onClick: N
694
+ onClick: F
695
695
  }, {
696
696
  default: xe(() => W[2] || (W[2] = [
697
697
  _e("Оновити дані ", -1)
@@ -913,10 +913,10 @@ function _o() {
913
913
  const r = (u) => {
914
914
  const { resizingCol: c, startX: b, startWidth: M } = t.value;
915
915
  if (!c) return;
916
- document.querySelectorAll(`[data-resizer="${c.prop}"]`).forEach((N) => {
917
- N.classList.add("vt-table__resizer--active");
916
+ document.querySelectorAll(`[data-resizer="${c.prop}"]`).forEach((F) => {
917
+ F.classList.add("vt-table__resizer--active");
918
918
  });
919
- const X = u.clientX - b, F = c.minWidth || 50, Q = c.maxWidth || 1e3, U = Math.max(Math.min(M + X, Q), F);
919
+ const X = u.clientX - b, N = c.minWidth || 50, Q = c.maxWidth || 1e3, U = Math.max(Math.min(M + X, Q), N);
920
920
  c.width = U;
921
921
  }, i = () => {
922
922
  const { resizingCol: u } = t.value;
@@ -937,7 +937,7 @@ function go(t, e, o, n) {
937
937
  if (r.value) return !1;
938
938
  const v = c.value;
939
939
  return v > 0 && v < e.value.length;
940
- }), X = x(() => r.value ? !0 : b.value && !M.value), F = x(() => r.value), Q = (v, O) => {
940
+ }), X = x(() => r.value ? !0 : b.value && !M.value), N = x(() => r.value), Q = (v, O) => {
941
941
  const R = i(v), K = l.value.some((_) => i(_) === i(v)), d = O !== void 0 ? O : !K;
942
942
  if (r.value && !d) {
943
943
  r.value = !1, n != null && n.value && (l.value = n.value.filter((_) => i(_) !== R)), $(v, !1);
@@ -945,7 +945,7 @@ function go(t, e, o, n) {
945
945
  }
946
946
  r.value && d || (d && !K ? l.value.push(v) : !d && K && (l.value = l.value.filter((_) => i(_) !== R)), t.selectOnClickRow && O === void 0 && G(d ? v : null), $(v, d));
947
947
  }, U = () => {
948
- switch (N()) {
948
+ switch (F()) {
949
949
  case "none":
950
950
  case "partial":
951
951
  L();
@@ -957,7 +957,7 @@ function go(t, e, o, n) {
957
957
  B();
958
958
  break;
959
959
  }
960
- }, N = () => r.value ? "absoluteAll" : b.value ? "allVisible" : c.value > 0 ? "partial" : "none", L = () => {
960
+ }, F = () => r.value ? "absoluteAll" : b.value ? "allVisible" : c.value > 0 ? "partial" : "none", L = () => {
961
961
  const v = [], O = new Set(l.value.map((R) => i(R)));
962
962
  l.value.forEach((R) => {
963
963
  v.push(R);
@@ -996,7 +996,7 @@ function go(t, e, o, n) {
996
996
  isRowSelected: u,
997
997
  isAllSelected: X,
998
998
  isIndeterminate: M,
999
- isDoubleCheck: F,
999
+ isDoubleCheck: N,
1000
1000
  isFullSelection: r,
1001
1001
  toggleRowSelection: Q,
1002
1002
  toggleAllSelection: U,
@@ -1166,7 +1166,7 @@ const ie = new yo(), xo = {
1166
1166
  minIndex: _ + 1,
1167
1167
  maxIndex: g - 1
1168
1168
  };
1169
- }, F = (d) => {
1169
+ }, N = (d) => {
1170
1170
  const _ = X();
1171
1171
  return !(d < _.minIndex || d > _.maxIndex + 1);
1172
1172
  }, Q = (d, _) => {
@@ -1181,8 +1181,8 @@ const ie = new yo(), xo = {
1181
1181
  d.preventDefault();
1182
1182
  const g = d.currentTarget.getBoundingClientRect(), k = d.clientY, V = g.top + g.height / 2;
1183
1183
  let S = _, ee = "before";
1184
- k < V ? (S = _, ee = "before") : (S = _ + 1, ee = "after"), a.value < S && S--, F(S) ? (r.value = _, i.value = ee, d.dataTransfer.dropEffect = "move") : (r.value = -1, d.dataTransfer.dropEffect = "none");
1185
- }, N = () => {
1184
+ k < V ? (S = _, ee = "before") : (S = _ + 1, ee = "after"), a.value < S && S--, N(S) ? (r.value = _, i.value = ee, d.dataTransfer.dropEffect = "move") : (r.value = -1, d.dataTransfer.dropEffect = "none");
1185
+ }, F = () => {
1186
1186
  setTimeout(() => {
1187
1187
  a.value === -1 && (r.value = -1);
1188
1188
  }, 50);
@@ -1193,7 +1193,7 @@ const ie = new yo(), xo = {
1193
1193
  }
1194
1194
  const g = d.currentTarget.getBoundingClientRect(), k = d.clientY, V = g.top + g.height / 2;
1195
1195
  let S = _;
1196
- if (k >= V && (S = _ + 1), a.value < S && S--, !F(S) || S === a.value) {
1196
+ if (k >= V && (S = _ + 1), a.value < S && S--, !N(S) || S === a.value) {
1197
1197
  B();
1198
1198
  return;
1199
1199
  }
@@ -1253,7 +1253,7 @@ const ie = new yo(), xo = {
1253
1253
  draggable: M(g),
1254
1254
  onDragstart: (V) => Q(V, k),
1255
1255
  onDragover: (V) => U(V, k),
1256
- onDragleave: N,
1256
+ onDragleave: F,
1257
1257
  onDrop: (V) => L(V, k),
1258
1258
  onDragend: W
1259
1259
  }, [
@@ -1359,7 +1359,7 @@ const ie = new yo(), xo = {
1359
1359
  i.value = !0, r.value = !1, a.value && a.value.style.removeProperty("z-index"), setTimeout(() => {
1360
1360
  i.value = !1;
1361
1361
  }, 100);
1362
- }, F = (y) => {
1362
+ }, N = (y) => {
1363
1363
  var E, $;
1364
1364
  !((E = l.value) != null && E.contains(y.target)) && !(($ = s.value) != null && $.contains(y.target)) && X();
1365
1365
  }, Q = () => {
@@ -1370,7 +1370,7 @@ const ie = new yo(), xo = {
1370
1370
  order: 999,
1371
1371
  // Найвищий порядок, щоб відображались останніми
1372
1372
  columns: y
1373
- }), N = (y) => {
1373
+ }), F = (y) => {
1374
1374
  var O;
1375
1375
  const E = new Set(y.map((R) => R.prop)), $ = /* @__PURE__ */ new Set();
1376
1376
  (O = o.columnsSelector) == null || O.forEach((R) => {
@@ -1390,7 +1390,7 @@ const ie = new yo(), xo = {
1390
1390
  const v = [...o.columnsSelector || []];
1391
1391
  J.length > 0 && v.push(U(J)), u.value = v;
1392
1392
  }, L = () => {
1393
- N(o.allColumns), ie.open({
1393
+ F(o.allColumns), ie.open({
1394
1394
  component: zo,
1395
1395
  title: "Управління колонками таблиці",
1396
1396
  props: {
@@ -1399,7 +1399,7 @@ const ie = new yo(), xo = {
1399
1399
  columnsSelector: u.value,
1400
1400
  // Передаємо оновлені доступні колонки
1401
1401
  "onUpdate-columns": (y) => {
1402
- console.log("ColumnActions отримав оновлені колонки:", y), n("update-columns", y), N(y);
1402
+ console.log("ColumnActions отримав оновлені колонки:", y), n("update-columns", y), F(y);
1403
1403
  }
1404
1404
  },
1405
1405
  size: "large",
@@ -1407,9 +1407,9 @@ const ie = new yo(), xo = {
1407
1407
  }), X();
1408
1408
  }, W = () => o.column.pinnedLeft, B = () => o.column.pinnedRight, G = () => W() || B();
1409
1409
  return ve(() => {
1410
- document.addEventListener("click", F), l.value && (a.value = l.value.closest("th")), N(o.allColumns);
1410
+ document.addEventListener("click", N), l.value && (a.value = l.value.closest("th")), F(o.allColumns);
1411
1411
  }), $e(() => {
1412
- document.removeEventListener("click", F);
1412
+ document.removeEventListener("click", N);
1413
1413
  }), (y, E) => (p(), m("div", {
1414
1414
  ref_key: "triggerRef",
1415
1415
  ref: l,
@@ -1439,41 +1439,44 @@ const ie = new yo(), xo = {
1439
1439
  }), Wo = { class: "vt-table" }, Do = { class: "vt-th__content" }, Po = { class: "vt-th__content" }, Ao = { class: "vt-th__label" }, Oo = {
1440
1440
  key: 0,
1441
1441
  class: "vt-th__sortable"
1442
- }, jo = ["data-resizer", "onMousedown"], Fo = {
1442
+ }, jo = ["data-resizer", "onMousedown"], No = {
1443
1443
  key: 0,
1444
1444
  class: "vt-table__empty-row"
1445
- }, No = ["colspan"], Zo = { class: "vt-table__empty-content" }, Uo = ["onClick"], qo = { class: "vt-table__cell-content" }, Xo = { class: "vt-table__cell-content vt-table__cell-content--ellipsis" }, Go = { key: 1 }, Ko = ["data-resizer", "onMousedown"], Yo = {
1445
+ }, Fo = ["colspan"], Zo = { class: "vt-table__empty-content" }, Uo = ["onClick"], qo = { class: "vt-table__cell-content" }, Xo = { class: "vt-table__cell-content vt-table__cell-content--ellipsis" }, Go = { key: 1 }, Ko = ["data-resizer", "onMousedown"], Yo = {
1446
1446
  key: 0,
1447
1447
  class: "vt-table__summary"
1448
1448
  }, Jo = { class: "vt-table__cell-content vt-table__cell-content--summary" }, ye = 50, Qo = /* @__PURE__ */ le({
1449
1449
  __name: "VTable",
1450
1450
  props: /* @__PURE__ */ Re({
1451
1451
  data: {},
1452
- maxHeight: {},
1452
+ maxHeight: { default: void 0 },
1453
1453
  defaultSort: {},
1454
- showSummary: { type: Boolean },
1455
- summaryMethod: { type: Function },
1456
- columnsSelector: {},
1457
- selectable: { type: Boolean },
1458
- selectionKey: {},
1459
- defaultSelection: {},
1460
- selectOnClickRow: { type: Boolean },
1461
- highlightCurrentRow: { type: Boolean },
1462
- allData: {},
1463
- columns: {}
1454
+ showSummary: { type: Boolean, default: !1 },
1455
+ summaryMethod: {},
1456
+ columnsSelector: { default: () => [] },
1457
+ selectable: { type: Boolean, default: !1 },
1458
+ selectionKey: { default: "id" },
1459
+ defaultSelection: { default: () => [] },
1460
+ selectOnClickRow: { type: Boolean, default: !1 },
1461
+ highlightCurrentRow: { type: Boolean, default: !1 },
1462
+ allData: { default: void 0 },
1463
+ columns: { default: () => [] }
1464
1464
  }, {
1465
- columns: { required: !1 },
1465
+ columns: {
1466
+ required: !1,
1467
+ default: void 0
1468
+ },
1466
1469
  columnsModifiers: {}
1467
1470
  }),
1468
1471
  emits: /* @__PURE__ */ Re(["sort-change", "selection-change", "current-change", "row-click", "update:columns", "column-pin", "column-resize", "column-visibility", "column-sort", "columns-change", "infinity-scroll"], ["update:columns"]),
1469
1472
  setup(t, { expose: e, emit: o }) {
1470
- const n = t, s = ct(t, "columns"), l = o, a = A({}), r = A(), i = ut([]), u = A(n.defaultSort || null), c = x(() => s.value !== void 0), b = x(() => n.data && n.data.length > 0), M = A(!1), X = A(0);
1471
- let F = null;
1473
+ const n = t, s = o, l = ct(t, "columns"), a = A({}), r = A(), i = ut([]), u = A(n.defaultSort || null), c = x(() => l.value !== void 0), b = x(() => n.data && n.data.length > 0), M = A(!1), X = A(0);
1474
+ let N = null;
1472
1475
  const Q = () => {
1473
- c.value && s.value ? i.splice(0, i.length, ...s.value) : n.columns && i.splice(0, i.length, ...n.columns);
1476
+ c.value && l.value ? i.splice(0, i.length, ...l.value) : n.columns && n.columns.length > 0 && i.splice(0, i.length, ...n.columns);
1474
1477
  };
1475
1478
  me(
1476
- () => s.value,
1479
+ () => l.value,
1477
1480
  (f) => {
1478
1481
  f && c.value && i.splice(0, i.length, ...f);
1479
1482
  },
@@ -1485,7 +1488,7 @@ const ie = new yo(), xo = {
1485
1488
  },
1486
1489
  { deep: !0 }
1487
1490
  ), dt("vt-table-columns", i);
1488
- const { sortedColumns: U, getDefaultColumnWidth: N, getStickyOffset: L } = vo(i), { getTableWrapperStyle: W, getColumnStyle: B, getHeaderStyle: G, getFooterStyle: y } = fo(n), { onMouseDown: E } = _o(), $ = x(() => bo(n.data, u.value, i)), J = x(() => n.allData || n.data), v = n.selectable ? go(n, $, l, J) : null, O = () => ({
1491
+ const { sortedColumns: U, getDefaultColumnWidth: F, getStickyOffset: L } = vo(i), { getTableWrapperStyle: W, getColumnStyle: B, getHeaderStyle: G, getFooterStyle: y } = fo(n), { onMouseDown: E } = _o(), $ = x(() => bo(n.data, u.value, i)), J = x(() => n.allData || n.data), v = n.selectable ? go(n, $, s, J) : null, O = () => ({
1489
1492
  width: `${ye}px`,
1490
1493
  minWidth: `${ye}px`,
1491
1494
  maxWidth: `${ye}px`,
@@ -1511,9 +1514,9 @@ const ie = new yo(), xo = {
1511
1514
  }, d = () => {
1512
1515
  if (!r.value || M.value) return;
1513
1516
  const f = r.value, C = f.scrollTop, I = f.scrollHeight, T = f.clientHeight, P = 30;
1514
- F && clearTimeout(F), F = setTimeout(() => {
1517
+ N && clearTimeout(N), N = setTimeout(() => {
1515
1518
  const fe = C - X.value > 1, w = I - C - T <= P, ce = I - C - T <= 5;
1516
- X.value = C, fe && (w || ce) && (M.value = !0, l("infinity-scroll"), setTimeout(() => {
1519
+ X.value = C, fe && (w || ce) && (M.value = !0, s("infinity-scroll"), setTimeout(() => {
1517
1520
  M.value = !1;
1518
1521
  }, 1e3));
1519
1522
  }, 50);
@@ -1523,12 +1526,12 @@ const ie = new yo(), xo = {
1523
1526
  ve(() => {
1524
1527
  r.value && r.value.addEventListener("scroll", d);
1525
1528
  }), $e(() => {
1526
- F && clearTimeout(F), r.value && r.value.removeEventListener("scroll", d);
1529
+ N && clearTimeout(N), r.value && r.value.removeEventListener("scroll", d);
1527
1530
  });
1528
1531
  const g = (f, C) => {
1529
1532
  ko(f, C, (I) => {
1530
1533
  var T, P;
1531
- ((T = u.value) == null ? void 0 : T.prop) === f.prop && u.value.direction === C ? u.value = null : u.value = I, l("sort-change", {
1534
+ ((T = u.value) == null ? void 0 : T.prop) === f.prop && u.value.direction === C ? u.value = null : u.value = I, s("sort-change", {
1532
1535
  column: f,
1533
1536
  direction: ((P = u.value) == null ? void 0 : P.direction) || null,
1534
1537
  prop: f.prop,
@@ -1540,20 +1543,20 @@ const ie = new yo(), xo = {
1540
1543
  pinnedLeft: C === "left",
1541
1544
  pinnedRight: C === "right"
1542
1545
  };
1543
- S(f.prop, I), l("column-pin", { column: { ...f, ...I }, position: C });
1546
+ S(f.prop, I), s("column-pin", { column: { ...f, ...I }, position: C });
1544
1547
  }, V = (f) => {
1545
- i.splice(0, i.length, ...f), c.value && (s.value = [...f]), l("columns-change", [...f]);
1548
+ i.splice(0, i.length, ...f), c.value && (l.value = [...f]), s("columns-change", [...f]);
1546
1549
  }, S = (f, C) => {
1547
1550
  const I = i.findIndex((T) => T.prop === f);
1548
1551
  if (I !== -1) {
1549
- if (Object.assign(i[I], C), c.value && s.value) {
1550
- const T = s.value.findIndex((P) => P.prop === f);
1552
+ if (Object.assign(i[I], C), c.value && l.value) {
1553
+ const T = l.value.findIndex((P) => P.prop === f);
1551
1554
  if (T !== -1) {
1552
- const P = [...s.value];
1553
- P[T] = { ...P[T], ...C }, s.value = P;
1555
+ const P = [...l.value];
1556
+ P[T] = { ...P[T], ...C }, l.value = P;
1554
1557
  }
1555
1558
  }
1556
- l("columns-change", [...i]);
1559
+ s("columns-change", [...i]);
1557
1560
  } else
1558
1561
  console.error(
1559
1562
  "Колонку не знайдено:",
@@ -1562,7 +1565,7 @@ const ie = new yo(), xo = {
1562
1565
  i.map((T) => T.prop)
1563
1566
  );
1564
1567
  }, ee = (f, C, I) => {
1565
- l("row-click", { row: f, column: C, event: I }), n.highlightCurrentRow && v && v.setCurrentRow(f);
1568
+ s("row-click", { row: f, column: C, event: I }), n.highlightCurrentRow && v && v.setCurrentRow(f);
1566
1569
  }, Ce = (f, C, I) => {
1567
1570
  I.stopPropagation(), v && v.toggleRowSelection(C, f);
1568
1571
  }, Ue = (f, C) => {
@@ -1570,15 +1573,15 @@ const ie = new yo(), xo = {
1570
1573
  }, Se = (f, C) => {
1571
1574
  f && (a.value[C] = f);
1572
1575
  }, Ie = (f, C) => {
1573
- const I = C.width || N();
1574
- E(f, C, N, (T) => {
1575
- S(C.prop, { width: T }), l("column-resize", {
1576
+ const I = C.width || F();
1577
+ E(f, C, F, (T) => {
1578
+ S(C.prop, { width: T }), s("column-resize", {
1576
1579
  column: { ...C, width: T },
1577
1580
  width: T,
1578
1581
  oldWidth: I
1579
1582
  });
1580
1583
  });
1581
- }, qe = (f, C) => B(f, C, L, N), Xe = (f, C) => G(f, C, L, N), Ge = (f, C) => y(f, C, L, N), Ke = (f, C) => {
1584
+ }, qe = (f, C) => B(f, C, L, F), Xe = (f, C) => G(f, C, L, F), Ge = (f, C) => y(f, C, L, F), Ke = (f, C) => {
1582
1585
  if (!C || !C.prop) return "";
1583
1586
  const I = f[C.prop];
1584
1587
  return I == null ? "" : String(I);
@@ -1623,7 +1626,7 @@ const ie = new yo(), xo = {
1623
1626
  // Додаємо метод для скидання infinity scroll
1624
1627
  }), (f, C) => {
1625
1628
  var T, P, de, fe;
1626
- const I = Fe("tooltip");
1629
+ const I = Ne("tooltip");
1627
1630
  return p(), m("div", {
1628
1631
  ref_key: "tableWrapperRef",
1629
1632
  ref: r,
@@ -1752,7 +1755,7 @@ const ie = new yo(), xo = {
1752
1755
  }, null, 40, Ko)
1753
1756
  ], 6))), 128))
1754
1757
  ], 10, Uo);
1755
- }), 128)) : (p(), m("tr", Fo, [
1758
+ }), 128)) : (p(), m("tr", No, [
1756
1759
  h("td", {
1757
1760
  colspan: q(U).length + (n.selectable ? 1 : 0),
1758
1761
  class: "vt-table__empty-cell"
@@ -1764,7 +1767,7 @@ const ie = new yo(), xo = {
1764
1767
  }),
1765
1768
  C[0] || (C[0] = h("span", { class: "vt-table__empty-text" }, "Немає даних!", -1))
1766
1769
  ])
1767
- ], 8, No)
1770
+ ], 8, Fo)
1768
1771
  ]))
1769
1772
  ]),
1770
1773
  Je.value ? (p(), m("tfoot", Yo, [
@@ -2002,24 +2005,32 @@ const ie = new yo(), xo = {
2002
2005
  beforeUnmount(t) {
2003
2006
  t.__tooltipEl && t.__tooltipEl.parentElement && (t.__tooltipEl.parentElement.removeChild(t.__tooltipEl), delete t.__tooltipEl), t.__mouseenterHandler && (t.removeEventListener("mouseenter", t.__mouseenterHandler), delete t.__mouseenterHandler), t.__mouseleaveHandler && (t.removeEventListener("mouseleave", t.__mouseleaveHandler), delete t.__mouseleaveHandler), t.__scrollHandler && (window.removeEventListener("scroll", t.__scrollHandler, !0), window.removeEventListener("resize", t.__scrollHandler), delete t.__scrollHandler);
2004
2007
  }
2008
+ }, ll = {
2009
+ sortable: !0,
2010
+ actionColumn: !1,
2011
+ showOverflowTooltip: !0,
2012
+ visible: !0,
2013
+ pinnedLeft: !1,
2014
+ pinnedRight: !1
2005
2015
  }, nl = {
2006
2016
  install(t, e = {}) {
2007
2017
  const { prefix: o = "V", modal: n = !0 } = e;
2008
- t.component(`${o}Button`, ge), t.component(`${o}Icon`, Y), t.component(`${o}Loader`, Ne), t.component(`${o}Modal`, Ze), t.component(`${o}Pagination`, po), t.component(`${o}Checkbox`, ue), t.component(`${o}Table`, Qo), t.component(`${o}TableColumn`, el), t.directive("tooltip", tl), n && t.use(xo);
2018
+ t.component(`${o}Button`, ge), t.component(`${o}Icon`, Y), t.component(`${o}Loader`, Fe), t.component(`${o}Modal`, Ze), t.component(`${o}Pagination`, po), t.component(`${o}Checkbox`, ue), t.component(`${o}Table`, Qo), t.component(`${o}TableColumn`, el), t.directive("tooltip", tl), n && t.use(xo);
2009
2019
  }
2010
- }, ll = nl.install;
2020
+ }, sl = nl.install;
2011
2021
  export {
2022
+ ll as DEFAULT_COLUMN_CONFIG,
2012
2023
  ge as VButton,
2013
2024
  ue as VCheckbox,
2014
2025
  Y as VIcon,
2015
- Ne as VLoader,
2026
+ Fe as VLoader,
2016
2027
  Ze as VModal,
2017
2028
  xo as VModalPlugin,
2018
2029
  po as VPagination,
2019
2030
  Qo as VTable,
2020
2031
  el as VTableColumn,
2021
2032
  nl as default,
2022
- ll as install,
2033
+ sl as install,
2023
2034
  ie as modalManager,
2024
2035
  tl as tooltipDirective
2025
2036
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "voiptime-components",
3
3
  "private": false,
4
- "version": "0.0.25",
4
+ "version": "0.0.27",
5
5
  "type": "module",
6
6
  "main": "dist/index.umd.js",
7
7
  "module": "dist/index.es.js",
@@ -16,7 +16,8 @@
16
16
  "import": "./dist/index.es.js",
17
17
  "require": "./dist/index.cjs"
18
18
  },
19
- "./index.css": "./dist/index.css"
19
+ "./index.css": "./dist/index.css",
20
+ "./scss/mixins": "./src/assets/_mixins.scss"
20
21
  },
21
22
  "scripts": {
22
23
  "dev": "vite",