tsv2-library 1.1.0-dev-alpha.26 → 1.1.0-dev-alpha.28

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.
@@ -54747,18 +54747,22 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
54747
54747
  return void 0;
54748
54748
  }
54749
54749
  });
54750
+ const currentPageData = computed(
54751
+ () => {
54752
+ var _a;
54753
+ return props.lazy ? currentPageTableData.value : (_a = props.data) == null ? void 0 : _a.slice(first3.value, first3.value + tableRows.value);
54754
+ }
54755
+ );
54750
54756
  const isSelectedAll = computed(() => {
54751
- var _a, _b, _c, _d;
54752
- if (props.disableAllRows || !((_a = currentPageTableData.value) == null ? void 0 : _a.length) || props.selectionType !== "checkbox")
54757
+ var _a, _b, _c, _d, _e;
54758
+ if (props.disableAllRows || !((_a = currentPageData.value) == null ? void 0 : _a.length) || props.selectionType !== "checkbox")
54753
54759
  return false;
54754
54760
  const length = (_b = props.selectedData) == null ? void 0 : _b.length;
54755
- const currentPageDataKey = ((_c = filterDisabledRows(currentPageTableData.value)) == null ? void 0 : _c.map(
54756
- (dt2) => dt2[props.dataKey]
54757
- )) ?? [];
54761
+ const currentPageDataKey = ((_c = filterDisabledRows(currentPageData.value)) == null ? void 0 : _c.map((dt2) => dt2[props.dataKey])) ?? [];
54758
54762
  const selectedDataKey = ((_d = props.selectedData) == null ? void 0 : _d.map((dt2) => dt2[props.dataKey])) ?? [];
54759
54763
  const isCurrentPageAllDataSelected = selectedDataKey.length ? isArrayIncluded(currentPageDataKey, selectedDataKey) : false;
54760
54764
  const isAllRecordSelected = !!length && // 0 means no data selected
54761
- length === (totalRecords2.value ?? 0) - (props.totalDisabledRows ?? currentPageDisabledRows.value.length ?? 0);
54765
+ length === ((props.lazy ? totalRecords2.value : (_e = props.data) == null ? void 0 : _e.length) ?? 0) - (props.totalDisabledRows ?? currentPageDisabledRows.value.length ?? 0);
54762
54766
  return isCurrentPageAllDataSelected || isAllRecordSelected;
54763
54767
  });
54764
54768
  const selectedData = computed({
@@ -54913,7 +54917,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
54913
54917
  refetch();
54914
54918
  };
54915
54919
  const onSelectAllChange = (event2) => {
54916
- const filteredRows = filterDisabledRows(currentPageTableData.value);
54920
+ const filteredRows = filterDisabledRows(currentPageData.value);
54917
54921
  currentPageDataSelected.value = event2.checked ? JSON.parse(JSON.stringify(filteredRows)) : [];
54918
54922
  if (!props.lazy)
54919
54923
  dispatchUpdateTotalRecordsEvent();
@@ -55160,7 +55164,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
55160
55164
  );
55161
55165
  const rows3 = ((_a = dataTableElement == null ? void 0 : dataTableElement.querySelector("tbody")) == null ? void 0 : _a.querySelectorAll("tr")) ?? [];
55162
55166
  currentPageDisabledRows.value.forEach((rowID) => {
55163
- const index2 = (props.data ?? currentPageTableData.value ?? []).findIndex(
55167
+ const index2 = (currentPageData.value ?? []).findIndex(
55164
55168
  (data30) => data30[props.dataKey] === rowID
55165
55169
  );
55166
55170
  if (index2 !== -1 && rows3[index2]) {
@@ -55274,6 +55278,7 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
55274
55278
  { immediate: true }
55275
55279
  );
55276
55280
  return (_ctx, _cache) => {
55281
+ var _a;
55277
55282
  const _component_DataTable = resolveComponent("DataTable", true);
55278
55283
  return openBlock(), createElementBlock(Fragment, null, [
55279
55284
  props.data || currentPageTableData.value || loadingTable.value ? (openBlock(), createBlock(unref(script$j), {
@@ -55299,9 +55304,9 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
55299
55304
  rows: _ctx.usePaginator ? tableRows.value : void 0,
55300
55305
  "rows-per-page-options": rowsPerPageOptions.value,
55301
55306
  "scroll-height": _ctx.scrollHeight,
55302
- "select-all": props.lazy ? isSelectedAll.value : void 0,
55307
+ "select-all": isSelectedAll.value,
55303
55308
  "selection-mode": selectionMode.value,
55304
- "total-records": props.lazy ? totalRecords2.value : void 0,
55309
+ "total-records": props.lazy ? totalRecords2.value : (_a = _ctx.data) == null ? void 0 : _a.length,
55305
55310
  value: props.data ?? currentPageTableData.value,
55306
55311
  "virtual-scroller-options": _ctx.virtualScrollerOptions,
55307
55312
  onColumnResizeEnd: updateTableColumnsWidth,
@@ -55340,9 +55345,9 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
55340
55345
  style: { "width": "32px", "min-width": "32px", "max-width": "32px" }
55341
55346
  }, {
55342
55347
  body: withCtx(({ rowTogglerCallback, data: rowData }) => {
55343
- var _a;
55348
+ var _a2;
55344
55349
  return [
55345
- (rowData == null ? void 0 : rowData.hasChildren) || ((_a = rowData.children) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_1$$, [
55350
+ (rowData == null ? void 0 : rowData.hasChildren) || ((_a2 = rowData.children) == null ? void 0 : _a2.length) ? (openBlock(), createElementBlock("div", _hoisted_1$$, [
55346
55351
  createVNode(unref(_sfc_main$1N), {
55347
55352
  class: normalizeClass([{ "rotate-90": isRowExpanded(rowData[props.dataKey]) }, "!p-0 !m-0 !w-auto !h-auto"]),
55348
55353
  onClick: ($event) => rowTogglerCallback($event),
@@ -55450,12 +55455,12 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
55450
55455
  col.bodyComponent(itemData).events ? col.bodyComponent(itemData).events : {}
55451
55456
  ), {
55452
55457
  onChange: ($event) => {
55453
- var _a, _b;
55454
- return (_b = (_a = col.bodyComponent(itemData)).onChange) == null ? void 0 : _b.call(_a, itemData);
55458
+ var _a2, _b;
55459
+ return (_b = (_a2 = col.bodyComponent(itemData)).onChange) == null ? void 0 : _b.call(_a2, itemData);
55455
55460
  },
55456
55461
  "onUpdate:modelValue": ($event) => {
55457
- var _a, _b;
55458
- return (_b = (_a = col.bodyComponent(itemData)).onChange) == null ? void 0 : _b.call(_a, itemData);
55462
+ var _a2, _b;
55463
+ return (_b = (_a2 = col.bodyComponent(itemData)).onChange) == null ? void 0 : _b.call(_a2, itemData);
55459
55464
  }
55460
55465
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onChange"])) : (openBlock(), createElementBlock("span", {
55461
55466
  key: 1,
@@ -55485,10 +55490,10 @@ const _sfc_main$15 = /* @__PURE__ */ defineComponent({
55485
55490
  props.customColumn ? {
55486
55491
  name: "header",
55487
55492
  fn: withCtx(() => {
55488
- var _a;
55493
+ var _a2;
55489
55494
  return [
55490
55495
  createVNode(_sfc_main$1O, {
55491
- onClick: (_a = customColumn.value) == null ? void 0 : _a.toggleMenu,
55496
+ onClick: (_a2 = customColumn.value) == null ? void 0 : _a2.toggleMenu,
55492
55497
  class: "!w-4 !h-4 !mx-auto",
55493
55498
  "data-ts-section": "columnvisibilitytoggle",
55494
55499
  icon: "ellipsis-h",
@@ -62916,6 +62921,12 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
62916
62921
  delete filter4[field2];
62917
62922
  });
62918
62923
  });
62924
+ watch(visible4, (value) => {
62925
+ if (value) {
62926
+ containerKey.value++;
62927
+ dataTableKey.value++;
62928
+ }
62929
+ });
62919
62930
  return (_ctx, _cache) => {
62920
62931
  var _a;
62921
62932
  return openBlock(), createElementBlock(Fragment, null, [