@vc-shell/framework 1.0.61 → 1.0.63

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.
@@ -44213,9 +44213,10 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44213
44213
  resizableColumns: { type: Boolean, default: !0 },
44214
44214
  reorderableColumns: { type: Boolean, default: !0 },
44215
44215
  reorderableRows: { type: Boolean },
44216
- stateKey: null
44216
+ stateKey: null,
44217
+ bulkDelete: { type: Boolean }
44217
44218
  },
44218
- emits: ["paginationClick", "selectionChanged", "search:change", "headerClick", "itemClick", "scroll:ptr", "row:reorder"],
44219
+ emits: ["paginationClick", "selectionChanged", "search:change", "headerClick", "itemClick", "scroll:ptr", "row:reorder", "bulk:delete"],
44219
44220
  setup(t, { emit: e }) {
44220
44221
  const n = t, r = ce([]), i = ce([]), s = ce(), f = ce();
44221
44222
  let h = null, u = null;
@@ -44274,7 +44275,11 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44274
44275
  { deep: !0, immediate: !0 }
44275
44276
  );
44276
44277
  function N() {
44277
- l.value = !l.value, l.value || (d.value = []);
44278
+ if (l.value = !l.value, !l.value) {
44279
+ d.value = [];
44280
+ return;
44281
+ }
44282
+ e("bulk:delete");
44278
44283
  }
44279
44284
  function z(fe) {
44280
44285
  return d.value.indexOf(fe) > -1;
@@ -44329,7 +44334,7 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44329
44334
  });
44330
44335
  async function ue(fe) {
44331
44336
  if (typeof n.itemActionBuilder == "function") {
44332
- let Ae = [];
44337
+ const Ae = [];
44333
44338
  for (let we = 0; we < fe.length; we++)
44334
44339
  if (typeof fe[we] == "object") {
44335
44340
  const Fe = await n.itemActionBuilder(fe[we]);
@@ -44348,7 +44353,7 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44348
44353
  e("headerClick", fe);
44349
44354
  }
44350
44355
  function me(fe, Ae) {
44351
- let we = _e(b.value).left;
44356
+ const we = _e(b.value).left;
44352
44357
  w.value = Ae, y.value = !0, _.value = fe.pageX - we + b.value.scrollLeft, ke();
44353
44358
  }
44354
44359
  function ke() {
@@ -44362,23 +44367,23 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44362
44367
  h && (document.removeEventListener("document", h), h = null), u && (document.removeEventListener("document", u), u = null);
44363
44368
  }
44364
44369
  function he(fe) {
44365
- let Ae = _e(b.value).left;
44370
+ const Ae = _e(b.value).left;
44366
44371
  E.value.style.top = "0px", E.value.style.left = fe.pageX - Ae + b.value.scrollLeft + "px", E.value.style.display = "block";
44367
44372
  }
44368
44373
  function _e(fe) {
44369
44374
  if (!fe.getClientRects().length)
44370
44375
  return { top: 0, left: 0 };
44371
- let Ae = fe.getBoundingClientRect(), we = fe.ownerDocument.defaultView;
44376
+ const Ae = fe.getBoundingClientRect(), we = fe.ownerDocument.defaultView;
44372
44377
  return {
44373
44378
  top: Ae.top + we.pageYOffset,
44374
44379
  left: Ae.left + we.pageXOffset
44375
44380
  };
44376
44381
  }
44377
44382
  function Y() {
44378
- let fe = E.value.offsetLeft - _.value, we = b.value.querySelector(`#${w.value.id}`).offsetWidth, Fe = we + fe, Ge = 15;
44383
+ const fe = E.value.offsetLeft - _.value, we = b.value.querySelector(`#${w.value.id}`).offsetWidth, Fe = we + fe, Ge = 15;
44379
44384
  if (we + fe > parseInt(Ge.toString(), 10))
44380
44385
  if (x.value = I.value[I.value.indexOf(w.value) + 1], x.value) {
44381
- let An = b.value.querySelector(`#${x.value.id}`).offsetWidth - fe;
44386
+ const An = b.value.querySelector(`#${x.value.id}`).offsetWidth - fe;
44382
44387
  Fe > 15 && An > 15 && X(Fe, An);
44383
44388
  } else
44384
44389
  Fe > 15 && (w.value.width = Fe + "px");
@@ -44405,12 +44410,12 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44405
44410
  }
44406
44411
  }
44407
44412
  function pe(fe) {
44408
- let Ae = ie(fe.target);
44413
+ const Ae = ie(fe.target);
44409
44414
  if (n.reorderableColumns && C.value && Ae) {
44410
44415
  fe.preventDefault();
44411
- let we = _e(b.value), Fe = _e(Ae);
44416
+ const we = _e(b.value), Fe = _e(Ae);
44412
44417
  if (g.value !== Ae) {
44413
- let Ge = Fe.left - we.left, Tt = Fe.left + Ae.offsetWidth / 2;
44418
+ const Ge = Fe.left - we.left, Tt = Fe.left + Ae.offsetWidth / 2;
44414
44419
  s.value.style.top = Fe.top - _e(f.value).top + "px", fe.pageX > Tt ? (s.value.style.left = Ge + Ae.offsetWidth + "px", S.value = 1) : (s.value.style.left = Ge + "px", S.value = -1), s.value.style.display = "block";
44415
44420
  }
44416
44421
  }
@@ -44420,7 +44425,8 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44420
44425
  }
44421
44426
  function Le(fe, Ae) {
44422
44427
  if (fe.preventDefault(), C.value) {
44423
- let we = A.value.indexOf(C.value), Fe = A.value.indexOf(Ae), Ge = we !== Fe;
44428
+ const we = A.value.indexOf(C.value), Fe = A.value.indexOf(Ae);
44429
+ let Ge = we !== Fe;
44424
44430
  Ge && (Fe - we === 1 && S.value === -1 || Fe - we === -1 && S.value === 1) && (Ge = !1), Ge && (ot(A.value, we, Fe), Oe() && He()), s.value.style.display = "none", g.value.draggable = !1, C.value = null, S.value = null;
44425
44431
  }
44426
44432
  }
@@ -44453,13 +44459,13 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44453
44459
  return;
44454
44460
  const we = n.items.indexOf(Ae);
44455
44461
  if (O.value && T.value !== Ae) {
44456
- let Fe = fe.currentTarget, Ge = _e(Fe).top, Tt = fe.pageY, An = Ge + Fe.offsetHeight / 2, Fn = Fe.previousElementSibling;
44462
+ const Fe = fe.currentTarget, Ge = _e(Fe).top, Tt = fe.pageY, An = Ge + Fe.offsetHeight / 2, Fn = Fe.previousElementSibling;
44457
44463
  Tt < An ? (Fe.classList.remove("vc-table__drag-row-bottom"), $.value = we, Fn ? Fn.classList.add("vc-table__drag-row-bottom") : Fe.classList.add("vc-table__drag-row-top")) : (Fn ? Fn.classList.remove("vc-table__drag-row-bottom") : Fe.classList.add("vc-table__drag-row-top"), $.value = we + 1, Fe.classList.add("vc-table__drag-row-bottom")), fe.preventDefault();
44458
44464
  }
44459
44465
  }
44460
44466
  function ir(fe) {
44461
44467
  fe.preventDefault();
44462
- let Ae = fe.currentTarget, we = Ae.previousElementSibling;
44468
+ const Ae = fe.currentTarget, we = Ae.previousElementSibling;
44463
44469
  we && we.classList.remove("vc-table__drag-row-bottom"), Ae.classList.remove("vc-table__drag-row-top"), Ae.classList.remove("vc-table__drag-row-bottom");
44464
44470
  }
44465
44471
  function Dn(fe) {
@@ -44467,7 +44473,7 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44467
44473
  }
44468
44474
  function fn(fe) {
44469
44475
  if ($.value != null) {
44470
- let Ae = L.value > $.value ? $.value : $.value === 0 ? 0 : $.value - 1, we = [...n.items];
44476
+ const Ae = L.value > $.value ? $.value : $.value === 0 ? 0 : $.value - 1, we = [...n.items];
44471
44477
  ot(we, L.value, Ae), e("row:reorder", {
44472
44478
  dragIndex: L.value,
44473
44479
  dropIndex: Ae,
@@ -44620,7 +44626,7 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44620
44626
  class: "tw-w-0.5 tw-bg-[#41afe6] tw-h-full tw-absolute tw-top-0 tw-bottom-0 tw-z-[2] tw-hidden"
44621
44627
  }, null, 512)
44622
44628
  ])) : de("", !0),
44623
- H(D) ? (J(), ne("div", uF, [
44629
+ t.bulkDelete && H(D) ? (J(), ne("div", uF, [
44624
44630
  oe("div", cF, [
44625
44631
  oe("div", null, [
44626
44632
  ze(be(l.value ? fe.$t("COMPONENTS.ORGANISMS.VC_TABLE.ALL_BULK_SELECTED") : fe.$t("COMPONENTS.ORGANISMS.VC_TABLE.ALL_SELECTED")) + " ", 1),
@@ -44639,7 +44645,7 @@ const CD = { class: "tw-text-[#a5a5a5] tw-text-xs" }, OD = { key: 1 }, $D = {
44639
44645
  ])) : de("", !0),
44640
44646
  t.items ? (J(), ne("tbody", {
44641
44647
  key: 2,
44642
- class: Ue(["vc-table__body", { "tw-translate-y-[60px]": H(D) }])
44648
+ class: Ue(["vc-table__body", { "tw-translate-y-[60px]": t.bulkDelete && H(D) }])
44643
44649
  }, [
44644
44650
  (J(!0), ne(je, null, vt(t.items, (we, Fe) => (J(), ne("tr", {
44645
44651
  key: typeof we == "object" && "id" in we && we.id || Fe,
@@ -127,6 +127,9 @@ export declare const VcTable: {
127
127
  type: import("vue").PropType<string>;
128
128
  required: true;
129
129
  };
130
+ bulkDelete: {
131
+ type: import("vue").PropType<boolean>;
132
+ };
130
133
  }>> & {
131
134
  onHeaderClick?: (value: Record<string, unknown>) => any;
132
135
  "onScroll:ptr"?: () => any;
@@ -139,6 +142,7 @@ export declare const VcTable: {
139
142
  dropIndex: number;
140
143
  value: import("./vc-table.vue").TableItemType[];
141
144
  }) => any;
145
+ "onBulk:delete"?: () => any;
142
146
  } & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "footer" | "header" | "expanded" | "items" | "totalCount" | "pages" | "totalLabel" | "currentPage" | "searchPlaceholder" | "empty" | "notfound" | "activeFilterCount" | "resizableColumns" | "reorderableColumns">;
143
147
  $attrs: {
144
148
  [x: string]: unknown;
@@ -155,7 +159,7 @@ export declare const VcTable: {
155
159
  dragIndex: number;
156
160
  dropIndex: number;
157
161
  value: import("./vc-table.vue").TableItemType[];
158
- }) => void);
162
+ }) => void) & ((event: "bulk:delete") => void);
159
163
  $el: any;
160
164
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
161
165
  sort: {
@@ -265,6 +269,9 @@ export declare const VcTable: {
265
269
  type: import("vue").PropType<string>;
266
270
  required: true;
267
271
  };
272
+ bulkDelete: {
273
+ type: import("vue").PropType<boolean>;
274
+ };
268
275
  }>> & {
269
276
  onHeaderClick?: (value: Record<string, unknown>) => any;
270
277
  "onScroll:ptr"?: () => any;
@@ -277,6 +284,7 @@ export declare const VcTable: {
277
284
  dropIndex: number;
278
285
  value: import("./vc-table.vue").TableItemType[];
279
286
  }) => any;
287
+ "onBulk:delete"?: () => any;
280
288
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
281
289
  paginationClick: (page: number) => void;
282
290
  } & {
@@ -295,6 +303,8 @@ export declare const VcTable: {
295
303
  dropIndex: number;
296
304
  value: import("./vc-table.vue").TableItemType[];
297
305
  }) => void;
306
+ } & {
307
+ "bulk:delete": () => void;
298
308
  }, string, {
299
309
  footer: boolean;
300
310
  header: boolean;
@@ -438,6 +448,9 @@ export declare const VcTable: {
438
448
  type: import("vue").PropType<string>;
439
449
  required: true;
440
450
  };
451
+ bulkDelete: {
452
+ type: import("vue").PropType<boolean>;
453
+ };
441
454
  }>> & {
442
455
  onHeaderClick?: (value: Record<string, unknown>) => any;
443
456
  "onScroll:ptr"?: () => any;
@@ -450,6 +463,7 @@ export declare const VcTable: {
450
463
  dropIndex: number;
451
464
  value: import("./vc-table.vue").TableItemType[];
452
465
  }) => any;
466
+ "onBulk:delete"?: () => any;
453
467
  } & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties & {};
454
468
  __isFragment?: never;
455
469
  __isTeleport?: never;
@@ -562,6 +576,9 @@ export declare const VcTable: {
562
576
  type: import("vue").PropType<string>;
563
577
  required: true;
564
578
  };
579
+ bulkDelete: {
580
+ type: import("vue").PropType<boolean>;
581
+ };
565
582
  }>> & {
566
583
  onHeaderClick?: (value: Record<string, unknown>) => any;
567
584
  "onScroll:ptr"?: () => any;
@@ -574,6 +591,7 @@ export declare const VcTable: {
574
591
  dropIndex: number;
575
592
  value: import("./vc-table.vue").TableItemType[];
576
593
  }) => any;
594
+ "onBulk:delete"?: () => any;
577
595
  }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
578
596
  paginationClick: (page: number) => void;
579
597
  } & {
@@ -592,6 +610,8 @@ export declare const VcTable: {
592
610
  dropIndex: number;
593
611
  value: import("./vc-table.vue").TableItemType[];
594
612
  }) => void;
613
+ } & {
614
+ "bulk:delete": () => void;
595
615
  }, string, {
596
616
  footer: boolean;
597
617
  header: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-table/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAMmB,KAAK,EAAE;;;;oBACwB,MAAM;;kBAAU,aAAa;cAAO,KAAK,EAAE;gBAJnG,MAAM,KAAK,EAAE;wBACL;YAAE,UAAU,EAAE,MAAM,IAAI,CAAA;SAAE,KAAK,KAAK,EAAE;;;;oBACA,MAAM;;cAAS,KAAK,EAAE;kBAGlE,MAAM,KAAK,EAAE;eAChB,MAAM,KAAK,EAAE;gBACZ,MAAM,KAAK,EAAE;;EAG1B,CAAC"}
@@ -36,6 +36,7 @@ export interface Props {
36
36
  reorderableColumns?: boolean;
37
37
  reorderableRows?: boolean;
38
38
  stateKey: string;
39
+ bulkDelete?: boolean;
39
40
  }
40
41
  export interface Emits {
41
42
  (event: "paginationClick", page: number): void;
@@ -49,6 +50,7 @@ export interface Emits {
49
50
  dropIndex: number;
50
51
  value: TableItemType[];
51
52
  }): void;
53
+ (event: "bulk:delete"): void;
52
54
  }
53
55
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
54
56
  items: () => any[];
@@ -87,6 +89,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
87
89
  dropIndex: number;
88
90
  value: TableItemType[];
89
91
  }) => void;
92
+ } & {
93
+ "bulk:delete": () => void;
90
94
  }, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
91
95
  items: () => any[];
92
96
  totalLabel: string;
@@ -118,6 +122,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
118
122
  dropIndex: number;
119
123
  value: TableItemType[];
120
124
  }) => any;
125
+ "onBulk:delete"?: () => any;
121
126
  }, {
122
127
  footer: boolean;
123
128
  header: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"vc-table.vue.d.ts","sourceRoot":"","sources":["../../../../../ui/components/organisms/vc-table/vc-table.vue.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI/E,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,SAAS;IAExB,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,oBAAoB,EAAE,CAAC;CAClC;AAED,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,oBAAoB,EAAE,CAAC;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QA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AC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;QACzD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,GAAG,CAAC,CAAC,CAAC,CAAC;CACR,CAAC;AA6GN,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAAE,MAAM,EAAE,CAAC,CAAA;KAAE,CAAA;CAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vc-shell/framework",
3
- "version": "1.0.61",
3
+ "version": "1.0.63",
4
4
  "main": "./dist/framework.mjs",
5
5
  "module": "./dist/framework.mjs",
6
6
  "types": "./dist/index.d.ts",
@@ -54,8 +54,8 @@
54
54
  "vue3-touch-events": "^4.1.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@vc-shell/api-client-generator": "^1.0.61",
58
- "@vc-shell/config-generator": "^1.0.61",
57
+ "@vc-shell/api-client-generator": "^1.0.63",
58
+ "@vc-shell/config-generator": "^1.0.63",
59
59
  "sass": "^1.49.0",
60
60
  "typescript": "^4.9.5",
61
61
  "url-pattern": "^1.0.3"
@@ -64,5 +64,5 @@
64
64
  "access": "public",
65
65
  "registry": "https://registry.npmjs.org/"
66
66
  },
67
- "gitHead": "cc48043a60c219e1b788a5f91ed4fdda681512ff"
67
+ "gitHead": "6d7f0db6e68c798060068efaa6d630bd6be16f5c"
68
68
  }
@@ -203,7 +203,7 @@
203
203
  </thead>
204
204
  <div
205
205
  class="tw-h-[60px] tw-bg-[#dfeef9] tw-w-full tw-absolute tw-flex"
206
- v-if="allSelected"
206
+ v-if="bulkDelete && allSelected"
207
207
  >
208
208
  <div class="tw-w-full tw-flex tw-items-center tw-justify-center">
209
209
  <div>
@@ -228,7 +228,7 @@
228
228
  <tbody
229
229
  v-if="items"
230
230
  class="vc-table__body"
231
- :class="{ 'tw-translate-y-[60px]': allSelected }"
231
+ :class="{ 'tw-translate-y-[60px]': bulkDelete && allSelected }"
232
232
  >
233
233
  <tr
234
234
  v-for="(item, itemIndex) in items"
@@ -475,6 +475,7 @@ export interface Props {
475
475
  reorderableColumns?: boolean;
476
476
  reorderableRows?: boolean;
477
477
  stateKey: string;
478
+ bulkDelete?: boolean;
478
479
  }
479
480
 
480
481
  export interface Emits {
@@ -485,6 +486,7 @@ export interface Emits {
485
486
  (event: "itemClick", item: TableItemType): void;
486
487
  (event: "scroll:ptr"): void;
487
488
  (event: "row:reorder", args: { dragIndex: number; dropIndex: number; value: TableItemType[] }): void;
489
+ (event: "bulk:delete"): void;
488
490
  }
489
491
 
490
492
  const props = withDefaults(defineProps<Props>(), {
@@ -657,7 +659,10 @@ function handleBulkSelection() {
657
659
 
658
660
  if (!bulkSelected.value) {
659
661
  selection.value = [];
662
+ return;
660
663
  }
664
+
665
+ emit("bulk:delete");
661
666
  }
662
667
 
663
668
  function isSelected(item: TableItemType) {
@@ -750,7 +755,7 @@ const arrowStyle = computed(() => {
750
755
 
751
756
  async function calculateActions(items: TableItemType[]) {
752
757
  if (typeof props.itemActionBuilder === "function") {
753
- let populatedItems = [];
758
+ const populatedItems = [];
754
759
  for (let index = 0; index < items.length; index++) {
755
760
  if (typeof items[index] === "object") {
756
761
  const elementWithActions = await props.itemActionBuilder(items[index] as TableItem);
@@ -774,7 +779,7 @@ function handleHeaderClick(item: ITableColumns) {
774
779
  }
775
780
 
776
781
  function handleMouseDown(e: MouseEvent, item: ITableColumns) {
777
- let containerLeft = getOffset(table.value as HTMLElement).left;
782
+ const containerLeft = getOffset(table.value as HTMLElement).left;
778
783
  resizeColumnElement.value = item;
779
784
  columnResizing.value = true;
780
785
  lastResize.value = e.pageX - containerLeft + table.value.scrollLeft;
@@ -812,7 +817,7 @@ function unbindColumnResizeEvents() {
812
817
  }
813
818
 
814
819
  function onColumnResize(event: MouseEvent) {
815
- let containerLeft = getOffset(table.value as HTMLElement).left;
820
+ const containerLeft = getOffset(table.value as HTMLElement).left;
816
821
 
817
822
  resizer.value.style.top = 0 + "px";
818
823
  resizer.value.style.left = event.pageX - containerLeft + table.value.scrollLeft + "px";
@@ -824,8 +829,8 @@ function getOffset(element: HTMLElement) {
824
829
  return { top: 0, left: 0 };
825
830
  }
826
831
 
827
- let rect = element.getBoundingClientRect();
828
- let win = element.ownerDocument.defaultView;
832
+ const rect = element.getBoundingClientRect();
833
+ const win = element.ownerDocument.defaultView;
829
834
  return {
830
835
  top: rect.top + win.pageYOffset,
831
836
  left: rect.left + win.pageXOffset,
@@ -833,14 +838,14 @@ function getOffset(element: HTMLElement) {
833
838
  }
834
839
 
835
840
  function onColumnResizeEnd() {
836
- let delta = resizer.value.offsetLeft - lastResize.value;
841
+ const delta = resizer.value.offsetLeft - lastResize.value;
837
842
 
838
843
  const columnElement: HTMLElement = table.value.querySelector(`#${resizeColumnElement.value.id}`);
839
844
 
840
- let columnWidth = columnElement.offsetWidth;
841
- let newColumnWidth = columnWidth + delta;
845
+ const columnWidth = columnElement.offsetWidth;
846
+ const newColumnWidth = columnWidth + delta;
842
847
 
843
- let minWidth = 15;
848
+ const minWidth = 15;
844
849
 
845
850
  if (columnWidth + delta > parseInt(minWidth.toString(), 10)) {
846
851
  nextColumn.value = filteredCols.value[filteredCols.value.indexOf(resizeColumnElement.value) + 1];
@@ -848,7 +853,7 @@ function onColumnResizeEnd() {
848
853
  if (nextColumn.value) {
849
854
  const nextColElement: HTMLElement = table.value.querySelector(`#${nextColumn.value.id}`);
850
855
 
851
- let nextColumnWidth = nextColElement.offsetWidth - delta;
856
+ const nextColumnWidth = nextColElement.offsetWidth - delta;
852
857
  if (newColumnWidth > 15 && nextColumnWidth > 15) {
853
858
  resizeTableCells(newColumnWidth, nextColumnWidth);
854
859
  }
@@ -897,16 +902,16 @@ function findParentHeader(element: HTMLElement) {
897
902
  }
898
903
 
899
904
  function onColumnHeaderDragOver(event: DragEvent) {
900
- let dropHeader = findParentHeader(event.target as HTMLElement);
905
+ const dropHeader = findParentHeader(event.target as HTMLElement);
901
906
 
902
907
  if (props.reorderableColumns && draggedColumn.value && dropHeader) {
903
908
  event.preventDefault();
904
- let containerOffset = getOffset(table.value as HTMLElement);
905
- let dropHeaderOffset = getOffset(dropHeader);
909
+ const containerOffset = getOffset(table.value as HTMLElement);
910
+ const dropHeaderOffset = getOffset(dropHeader);
906
911
 
907
912
  if (draggedElement.value !== dropHeader) {
908
- let targetLeft = dropHeaderOffset.left - containerOffset.left;
909
- let columnCenter = dropHeaderOffset.left + dropHeader.offsetWidth / 2;
913
+ const targetLeft = dropHeaderOffset.left - containerOffset.left;
914
+ const columnCenter = dropHeaderOffset.left + dropHeader.offsetWidth / 2;
910
915
 
911
916
  reorderRef.value.style.top = dropHeaderOffset.top - getOffset(tableRef.value).top + "px";
912
917
 
@@ -936,8 +941,8 @@ function onColumnHeaderDrop(event: DragEvent, item: ITableColumns) {
936
941
  event.preventDefault();
937
942
 
938
943
  if (draggedColumn.value) {
939
- let dragIndex = defaultColumns.value.indexOf(draggedColumn.value);
940
- let dropIndex = defaultColumns.value.indexOf(item);
944
+ const dragIndex = defaultColumns.value.indexOf(draggedColumn.value);
945
+ const dropIndex = defaultColumns.value.indexOf(item);
941
946
 
942
947
  let allowDrop = dragIndex !== dropIndex;
943
948
 
@@ -1036,11 +1041,11 @@ function onRowDragOver(event: DragEvent, item: TableItem | string) {
1036
1041
  const index = props.items.indexOf(item);
1037
1042
 
1038
1043
  if (rowDragged.value && draggedRow.value !== item) {
1039
- let rowElement = event.currentTarget as HTMLElement;
1040
- let rowY = getOffset(rowElement).top;
1041
- let pageY = event.pageY;
1042
- let rowMidY = rowY + rowElement.offsetHeight / 2;
1043
- let previousRowElement = rowElement.previousElementSibling;
1044
+ const rowElement = event.currentTarget as HTMLElement;
1045
+ const rowY = getOffset(rowElement).top;
1046
+ const pageY = event.pageY;
1047
+ const rowMidY = rowY + rowElement.offsetHeight / 2;
1048
+ const previousRowElement = rowElement.previousElementSibling;
1044
1049
 
1045
1050
  if (pageY < rowMidY) {
1046
1051
  rowElement.classList.remove("vc-table__drag-row-bottom");
@@ -1068,8 +1073,8 @@ function onRowDragOver(event: DragEvent, item: TableItem | string) {
1068
1073
  function onRowDragLeave(event: DragEvent) {
1069
1074
  event.preventDefault();
1070
1075
 
1071
- let rowElement = event.currentTarget as HTMLElement;
1072
- let previousRowElement = rowElement.previousElementSibling;
1076
+ const rowElement = event.currentTarget as HTMLElement;
1077
+ const previousRowElement = rowElement.previousElementSibling;
1073
1078
 
1074
1079
  if (previousRowElement) {
1075
1080
  previousRowElement.classList.remove("vc-table__drag-row-bottom");
@@ -1088,14 +1093,14 @@ function onRowDragEnd(event: DragEvent & { currentTarget?: { draggable: boolean
1088
1093
 
1089
1094
  function onRowDrop(event: DragEvent) {
1090
1095
  if (droppedRowIndex.value != null) {
1091
- let dropIndex =
1096
+ const dropIndex =
1092
1097
  draggedRowIndex.value > droppedRowIndex.value
1093
1098
  ? droppedRowIndex.value
1094
1099
  : droppedRowIndex.value === 0
1095
1100
  ? 0
1096
1101
  : droppedRowIndex.value - 1;
1097
1102
 
1098
- let processedItems = [...props.items];
1103
+ const processedItems = [...props.items];
1099
1104
 
1100
1105
  reorderArray(processedItems, draggedRowIndex.value, dropIndex);
1101
1106