@v-c/table 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/Body/BodyRow.js +6 -8
  2. package/dist/Body/ExpandedRow.js +4 -6
  3. package/dist/Body/MeasureCell.js +2 -4
  4. package/dist/Body/MeasureRow.js +4 -6
  5. package/dist/Body/index.js +8 -10
  6. package/dist/Cell/index.js +2 -4
  7. package/dist/Cell/useHoverState.js +0 -2
  8. package/dist/ColGroup.js +2 -4
  9. package/dist/FixedHolder/index.js +4 -6
  10. package/dist/Footer/Cell.js +4 -6
  11. package/dist/Footer/Row.js +2 -4
  12. package/dist/Footer/Summary.js +6 -7
  13. package/dist/Footer/SummaryContext.js +0 -2
  14. package/dist/Footer/index.js +6 -8
  15. package/dist/Header/Header.js +4 -6
  16. package/dist/Header/HeaderRow.js +4 -6
  17. package/dist/Panel/index.js +2 -4
  18. package/dist/Table.js +26 -52
  19. package/dist/VirtualTable/BodyGrid.js +10 -12
  20. package/dist/VirtualTable/BodyLine.js +6 -8
  21. package/dist/VirtualTable/VirtualCell.js +4 -6
  22. package/dist/VirtualTable/context.js +0 -2
  23. package/dist/VirtualTable/index.js +10 -15
  24. package/dist/constant.js +2 -4
  25. package/dist/context/PerfContext.js +0 -2
  26. package/dist/context/TableContext.js +3 -5
  27. package/dist/hooks/useColumns/index.js +2 -4
  28. package/dist/hooks/useColumns/useWidthColumns.js +0 -2
  29. package/dist/hooks/useExpand.js +1 -3
  30. package/dist/hooks/useFixedInfo.js +0 -2
  31. package/dist/hooks/useFlattenRecords.js +0 -2
  32. package/dist/hooks/useFrame.js +0 -2
  33. package/dist/hooks/useHover.js +0 -2
  34. package/dist/hooks/useRowInfo.js +0 -2
  35. package/dist/hooks/useSticky.js +0 -2
  36. package/dist/hooks/useStickyOffsets.js +0 -2
  37. package/dist/index.js +8 -10
  38. package/dist/stickyScrollBar.js +2 -4
  39. package/dist/sugar/Column.js +2 -8
  40. package/dist/sugar/ColumnGroup.js +2 -8
  41. package/dist/utils/expandUtil.js +0 -2
  42. package/dist/utils/fixUtil.js +0 -2
  43. package/dist/utils/legacyUtil.js +1 -3
  44. package/dist/utils/offsetUtil.js +0 -2
  45. package/dist/utils/valueUtil.js +0 -2
  46. package/package.json +2 -2
@@ -1,10 +1,9 @@
1
- import Cell from "../Cell/index.js";
1
+ import Cell_default from "../Cell/index.js";
2
2
  import useRowInfo from "../hooks/useRowInfo.js";
3
3
  import { computedExpandedClassName } from "../utils/expandUtil.js";
4
- import ExpandedRow from "./ExpandedRow.js";
4
+ import ExpandedRow_default from "./ExpandedRow.js";
5
5
  import { Fragment, computed, createVNode, defineComponent, isVNode, mergeProps, ref, watchEffect } from "vue";
6
6
  import { clsx } from "@v-c/util";
7
- //#region src/Body/BodyRow.tsx
8
7
  function _isSlot(s) {
9
8
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
10
9
  }
@@ -43,7 +42,7 @@ function getCellProps(rowInfo, record, column, colIndex, indent, index, rowKeys
43
42
  additionalCellProps
44
43
  };
45
44
  }
46
- var BodyRow = /* @__PURE__ */ defineComponent({
45
+ var BodyRow_default = /* @__PURE__ */ defineComponent({
47
46
  name: "TableBodyRow",
48
47
  props: [
49
48
  "record",
@@ -92,7 +91,7 @@ var BodyRow = /* @__PURE__ */ defineComponent({
92
91
  const { key, fixedInfo, appendCellNode, additionalCellProps } = getCellProps(rowInfo, record, column, colIndex, indent, index, rowKeys, expandedRowInfo?.offset);
93
92
  const scope = column.rowScope ? column.rowScope : column.title ? "row" : void 0;
94
93
  const CellComponent = column.rowScope ? scopeCellComponent : BodyCellComponent;
95
- return createVNode(Cell, mergeProps({
94
+ return createVNode(Cell_default, mergeProps({
96
95
  "className": clsx(columnClassName, classNames?.cell),
97
96
  "style": styles?.cell,
98
97
  "ellipsis": column.ellipsis,
@@ -117,7 +116,7 @@ var BodyRow = /* @__PURE__ */ defineComponent({
117
116
  if (rowSupportExpand.value && (expandedRef.value || expanded.value)) {
118
117
  const expandContent = expandedRowRender(record, index, indent + 1, expanded.value);
119
118
  const computedExpandedRowClassName = computedExpandedClassName(expandedRowClassName, record, index, indent);
120
- expandRowNode = createVNode(ExpandedRow, {
119
+ expandRowNode = createVNode(ExpandedRow_default, {
121
120
  "expanded": expanded.value,
122
121
  "className": clsx(`${prefixCls}-expanded-row`, `${prefixCls}-expanded-row-level-${indent + 1}`, computedExpandedRowClassName),
123
122
  "key": `expanded-row-${rowKey}`,
@@ -134,5 +133,4 @@ var BodyRow = /* @__PURE__ */ defineComponent({
134
133
  };
135
134
  }
136
135
  });
137
- //#endregion
138
- export { BodyRow as default, getCellProps };
136
+ export { BodyRow_default as default, getCellProps };
@@ -1,11 +1,10 @@
1
1
  import { useInjectTableContext } from "../context/TableContext.js";
2
- import Cell from "../Cell/index.js";
2
+ import Cell_default from "../Cell/index.js";
3
3
  import { createVNode, defineComponent, isVNode } from "vue";
4
- //#region src/Body/ExpandedRow.tsx
5
4
  function _isSlot(s) {
6
5
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
7
6
  }
8
- var ExpandedRow = /* @__PURE__ */ defineComponent({
7
+ var ExpandedRow_default = /* @__PURE__ */ defineComponent({
9
8
  name: "TableExpandedRow",
10
9
  props: [
11
10
  "prefixCls",
@@ -39,7 +38,7 @@ var ExpandedRow = /* @__PURE__ */ defineComponent({
39
38
  return createVNode(Component, {
40
39
  "class": className,
41
40
  "style": { display: expanded ? null : "none" }
42
- }, { default: () => [createVNode(Cell, {
41
+ }, { default: () => [createVNode(Cell_default, {
43
42
  "component": cellComponent,
44
43
  "prefixCls": prefixCls,
45
44
  "colSpan": colSpan
@@ -47,5 +46,4 @@ var ExpandedRow = /* @__PURE__ */ defineComponent({
47
46
  };
48
47
  }
49
48
  });
50
- //#endregion
51
- export { ExpandedRow as default };
49
+ export { ExpandedRow_default as default };
@@ -1,8 +1,7 @@
1
1
  import { createVNode, defineComponent, ref } from "vue";
2
2
  import ResizeObserver from "@v-c/resize-observer";
3
3
  import { useLayoutEffect } from "@v-c/util/dist/hooks/useLayoutEffect";
4
- //#region src/Body/MeasureCell.tsx
5
- var MeasureCell = /* @__PURE__ */ defineComponent({
4
+ var MeasureCell_default = /* @__PURE__ */ defineComponent({
6
5
  name: "TableMeasureCell",
7
6
  props: [
8
7
  "columnKey",
@@ -30,5 +29,4 @@ var MeasureCell = /* @__PURE__ */ defineComponent({
30
29
  } }, [props.title || "\xA0"])])] });
31
30
  }
32
31
  });
33
- //#endregion
34
- export { MeasureCell as default };
32
+ export { MeasureCell_default as default };
@@ -1,14 +1,13 @@
1
1
  import { useInjectTableContext } from "../context/TableContext.js";
2
- import MeasureCell from "./MeasureCell.js";
2
+ import MeasureCell_default from "./MeasureCell.js";
3
3
  import { cloneVNode, createVNode, defineComponent, isVNode, ref } from "vue";
4
4
  import ResizeObserver from "@v-c/resize-observer";
5
5
  import { filterEmpty } from "@v-c/util/dist/props-util";
6
6
  import isVisible from "@v-c/util/dist/Dom/isVisible";
7
- //#region src/Body/MeasureRow.tsx
8
7
  function _isSlot(s) {
9
8
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
10
9
  }
11
- var MeasureRow = /* @__PURE__ */ defineComponent({
10
+ var MeasureRow_default = /* @__PURE__ */ defineComponent({
12
11
  name: "TableMeasureRow",
13
12
  props: [
14
13
  "prefixCls",
@@ -47,7 +46,7 @@ var MeasureRow = /* @__PURE__ */ defineComponent({
47
46
  });
48
47
  } }, _isSlot(_slot = props.columnsKey.map((columnKey) => {
49
48
  const titleForMeasure = cloneTitle(props.columns.find((col) => col.key === columnKey)?.title);
50
- return createVNode(MeasureCell, {
49
+ return createVNode(MeasureCell_default, {
51
50
  "key": columnKey,
52
51
  "columnKey": columnKey,
53
52
  "onColumnResize": props.onColumnResize,
@@ -58,5 +57,4 @@ var MeasureRow = /* @__PURE__ */ defineComponent({
58
57
  };
59
58
  }
60
59
  });
61
- //#endregion
62
- export { MeasureRow as default };
60
+ export { MeasureRow_default as default };
@@ -2,13 +2,12 @@ import { useInjectTableContext } from "../context/TableContext.js";
2
2
  import { useProvidePerfContext } from "../context/PerfContext.js";
3
3
  import useFlattenRecords from "../hooks/useFlattenRecords.js";
4
4
  import { getColumnsKey } from "../utils/valueUtil.js";
5
- import ExpandedRow from "./ExpandedRow.js";
6
- import BodyRow from "./BodyRow.js";
7
- import MeasureRow from "./MeasureRow.js";
5
+ import ExpandedRow_default from "./ExpandedRow.js";
6
+ import BodyRow_default from "./BodyRow.js";
7
+ import MeasureRow_default from "./MeasureRow.js";
8
8
  import { computed, createVNode, defineComponent } from "vue";
9
9
  import { clsx } from "@v-c/util";
10
- //#region src/Body/index.tsx
11
- var Body = /* @__PURE__ */ defineComponent({
10
+ var Body_default = /* @__PURE__ */ defineComponent({
12
11
  name: "TableBody",
13
12
  props: ["data", "measureColumnWidth"],
14
13
  setup(props) {
@@ -36,7 +35,7 @@ var Body = /* @__PURE__ */ defineComponent({
36
35
  let rows;
37
36
  if (props.data.length) rows = flattenData.value.map((item, idx) => {
38
37
  const { record, indent, index: renderIndex, rowKey } = item;
39
- return createVNode(BodyRow, {
38
+ return createVNode(BodyRow_default, {
40
39
  "classNames": bodyCls.value,
41
40
  "styles": bodyStyles.value,
42
41
  "key": rowKey,
@@ -52,7 +51,7 @@ var Body = /* @__PURE__ */ defineComponent({
52
51
  "expandedRowInfo": expandedRowInfo.value
53
52
  }, null);
54
53
  });
55
- else rows = createVNode(ExpandedRow, {
54
+ else rows = createVNode(ExpandedRow_default, {
56
55
  "expanded": true,
57
56
  "className": `${context.prefixCls}-placeholder`,
58
57
  "prefixCls": context.prefixCls,
@@ -65,7 +64,7 @@ var Body = /* @__PURE__ */ defineComponent({
65
64
  return createVNode(WrapperComponent, {
66
65
  "style": bodyStyles.value.wrapper,
67
66
  "class": clsx(`${context.prefixCls}-tbody`, bodyCls.value.wrapper)
68
- }, { default: () => [props.measureColumnWidth && createVNode(MeasureRow, {
67
+ }, { default: () => [props.measureColumnWidth && createVNode(MeasureRow_default, {
69
68
  "prefixCls": context.prefixCls,
70
69
  "columnsKey": columnsKey,
71
70
  "onColumnResize": context.onColumnResize,
@@ -74,5 +73,4 @@ var Body = /* @__PURE__ */ defineComponent({
74
73
  };
75
74
  }
76
75
  });
77
- //#endregion
78
- export { Body as default };
76
+ export { Body_default as default };
@@ -6,7 +6,6 @@ import { computed, createVNode, defineComponent, isVNode, mergeProps } from "vue
6
6
  import { clsx, warning } from "@v-c/util";
7
7
  import { filterEmpty, getStylePxValue } from "@v-c/util/dist/props-util";
8
8
  import getValue from "@v-c/util/dist/utils/get";
9
- //#region src/Cell/index.tsx
10
9
  function getTitleFromCellRenderChildren({ ellipsis, rowType, children }) {
11
10
  const ellipsisConfig = ellipsis === true ? { showTitle: true } : ellipsis;
12
11
  const showTitle = !!(ellipsisConfig && typeof ellipsisConfig === "object" && ellipsisConfig.showTitle);
@@ -39,7 +38,7 @@ function resolveCellRender({ record, dataIndex, renderIndex, children, render, p
39
38
  }
40
39
  return [returnChildNode, returnCellProps];
41
40
  }
42
- var Cell = /* @__PURE__ */ defineComponent({
41
+ var Cell_default = /* @__PURE__ */ defineComponent({
43
42
  name: "TableCell",
44
43
  props: [
45
44
  "prefixCls",
@@ -193,5 +192,4 @@ var Cell = /* @__PURE__ */ defineComponent({
193
192
  };
194
193
  }
195
194
  });
196
- //#endregion
197
- export { Cell as default };
195
+ export { Cell_default as default };
@@ -1,5 +1,4 @@
1
1
  import { computed } from "vue";
2
- //#region src/Cell/useHoverState.ts
3
2
  function inHoverRange(cellStartRow, cellRowSpan, startRow, endRow) {
4
3
  const cellEndRow = cellStartRow + cellRowSpan - 1;
5
4
  return cellStartRow <= endRow && cellEndRow >= startRow;
@@ -9,5 +8,4 @@ function useHoverState(rowIndex, rowSpan, context) {
9
8
  return inHoverRange(rowIndex, rowSpan || 1, context.hoverStartRow, context.hoverEndRow);
10
9
  }), context.onHover];
11
10
  }
12
- //#endregion
13
11
  export { useHoverState as default };
package/dist/ColGroup.js CHANGED
@@ -1,8 +1,7 @@
1
1
  import { useInjectTableContext } from "./context/TableContext.js";
2
2
  import { INTERNAL_COL_DEFINE } from "./utils/legacyUtil.js";
3
3
  import { createVNode, defineComponent, mergeProps } from "vue";
4
- //#region src/ColGroup.tsx
5
- var ColGroup = /* @__PURE__ */ defineComponent({
4
+ var ColGroup_default = /* @__PURE__ */ defineComponent({
6
5
  name: "TableColGroup",
7
6
  props: [
8
7
  "colWidths",
@@ -43,5 +42,4 @@ var ColGroup = /* @__PURE__ */ defineComponent({
43
42
  };
44
43
  }
45
44
  });
46
- //#endregion
47
- export { ColGroup as default };
45
+ export { ColGroup_default as default };
@@ -1,9 +1,8 @@
1
1
  import { useInjectTableContext } from "../context/TableContext.js";
2
- import ColGroup from "../ColGroup.js";
2
+ import ColGroup_default from "../ColGroup.js";
3
3
  import { computed, createVNode, defineComponent, onBeforeUnmount, onMounted, ref } from "vue";
4
4
  import { clsx } from "@v-c/util";
5
5
  import { getStylePxValue, toPropsRefs } from "@v-c/util/dist/props-util";
6
- //#region src/FixedHolder/index.tsx
7
6
  function useColumnWidth(colWidths, columnCount) {
8
7
  return computed(() => {
9
8
  const cloneColumns = [];
@@ -15,7 +14,7 @@ function useColumnWidth(colWidths, columnCount) {
15
14
  return cloneColumns;
16
15
  });
17
16
  }
18
- var FixedHolder = /* @__PURE__ */ defineComponent({
17
+ var FixedHolder_default = /* @__PURE__ */ defineComponent({
19
18
  name: "TableFixedHolder",
20
19
  props: [
21
20
  "className",
@@ -126,7 +125,7 @@ var FixedHolder = /* @__PURE__ */ defineComponent({
126
125
  tableLayout: props.tableLayout,
127
126
  minWidth: "100%",
128
127
  width: typeof props.scrollX === "number" ? `${props.scrollX}px` : props.scrollX
129
- } }, { default: () => [isColGroupEmpty.value ? props.colGroup : createVNode(ColGroup, {
128
+ } }, { default: () => [isColGroupEmpty.value ? props.colGroup : createVNode(ColGroup_default, {
130
129
  "colWidths": [...mergedColumnWidth.value || [], combinationScrollBarSize.value],
131
130
  "columCount": props.columCount + 1,
132
131
  "columns": flattenColumnsWithScrollbar.value
@@ -134,5 +133,4 @@ var FixedHolder = /* @__PURE__ */ defineComponent({
134
133
  };
135
134
  }
136
135
  });
137
- //#endregion
138
- export { FixedHolder as default };
136
+ export { FixedHolder_default as default };
@@ -1,10 +1,9 @@
1
1
  import { useInjectTableContext } from "../context/TableContext.js";
2
- import Cell from "../Cell/index.js";
2
+ import Cell_default$1 from "../Cell/index.js";
3
3
  import { getCellFixedInfo } from "../utils/fixUtil.js";
4
4
  import { useInjectSummaryContext } from "./SummaryContext.js";
5
5
  import { computed, createVNode, defineComponent, mergeProps } from "vue";
6
- //#region src/Footer/Cell.tsx
7
- var SummaryCell = /* @__PURE__ */ defineComponent({
6
+ var Cell_default = /* @__PURE__ */ defineComponent({
8
7
  name: "TableSummaryCell",
9
8
  props: [
10
9
  "className",
@@ -29,7 +28,7 @@ var SummaryCell = /* @__PURE__ */ defineComponent({
29
28
  };
30
29
  return getCellFixedInfo(props.index, props.index + mergedColSpan.value - 1, summaryContext.flattenColumns || [], stickyOffsets);
31
30
  });
32
- return () => createVNode(Cell, mergeProps({
31
+ return () => createVNode(Cell_default$1, mergeProps({
33
32
  "className": props.className,
34
33
  "index": props.index,
35
34
  "component": "td",
@@ -43,5 +42,4 @@ var SummaryCell = /* @__PURE__ */ defineComponent({
43
42
  }, fixedInfo.value), null);
44
43
  }
45
44
  });
46
- //#endregion
47
- export { SummaryCell as default };
45
+ export { Cell_default as default };
@@ -1,6 +1,5 @@
1
1
  import { createVNode, defineComponent } from "vue";
2
- //#region src/Footer/Row.tsx
3
- var FooterRow = /* @__PURE__ */ defineComponent({
2
+ var Row_default = /* @__PURE__ */ defineComponent({
4
3
  name: "TableFooterRow",
5
4
  props: [
6
5
  "className",
@@ -15,5 +14,4 @@ var FooterRow = /* @__PURE__ */ defineComponent({
15
14
  }, [slots.default?.()]);
16
15
  }
17
16
  });
18
- //#endregion
19
- export { FooterRow as default };
17
+ export { Row_default as default };
@@ -1,7 +1,6 @@
1
- import SummaryCell from "./Cell.js";
2
- import FooterRow from "./Row.js";
1
+ import Cell_default from "./Cell.js";
2
+ import Row_default from "./Row.js";
3
3
  import { defineComponent } from "vue";
4
- //#region src/Footer/Summary.tsx
5
4
  var Summary = /* @__PURE__ */ defineComponent({
6
5
  name: "TableSummary",
7
6
  props: ["fixed"],
@@ -9,7 +8,7 @@ var Summary = /* @__PURE__ */ defineComponent({
9
8
  return () => slots.default?.();
10
9
  }
11
10
  });
12
- Summary.Row = FooterRow;
13
- Summary.Cell = SummaryCell;
14
- //#endregion
15
- export { Summary as default };
11
+ Summary.Row = Row_default;
12
+ Summary.Cell = Cell_default;
13
+ var Summary_default = Summary;
14
+ export { Summary_default as default };
@@ -1,5 +1,4 @@
1
1
  import { inject, provide } from "vue";
2
- //#region src/Footer/SummaryContext.tsx
3
2
  var SummaryContextKey = Symbol("TableSummaryContext");
4
3
  function useProvideSummaryContext(value) {
5
4
  provide(SummaryContextKey, value);
@@ -7,5 +6,4 @@ function useProvideSummaryContext(value) {
7
6
  function useInjectSummaryContext() {
8
7
  return inject(SummaryContextKey, {});
9
8
  }
10
- //#endregion
11
9
  export { useInjectSummaryContext, useProvideSummaryContext };
@@ -1,11 +1,10 @@
1
1
  import { useInjectTableContext } from "../context/TableContext.js";
2
2
  import { useProvideSummaryContext } from "./SummaryContext.js";
3
- import SummaryCell from "./Cell.js";
4
- import FooterRow from "./Row.js";
5
- import Summary from "./Summary.js";
3
+ import Cell_default from "./Cell.js";
4
+ import Row_default from "./Row.js";
5
+ import Summary_default from "./Summary.js";
6
6
  import { createVNode, defineComponent, reactive, watchEffect } from "vue";
7
- //#region src/Footer/index.tsx
8
- var Footer = /* @__PURE__ */ defineComponent({
7
+ var Footer_default = /* @__PURE__ */ defineComponent({
9
8
  name: "TableFooter",
10
9
  props: ["stickyOffsets", "flattenColumns"],
11
10
  inheritAttrs: false,
@@ -27,6 +26,5 @@ var Footer = /* @__PURE__ */ defineComponent({
27
26
  return () => createVNode("tfoot", { "class": `${context.prefixCls}-summary` }, [slots.default?.()]);
28
27
  }
29
28
  });
30
- var FooterComponents = Summary;
31
- //#endregion
32
- export { FooterComponents, SummaryCell, FooterRow as SummaryRow, Footer as default };
29
+ const FooterComponents = Summary_default;
30
+ export { FooterComponents, Cell_default as SummaryCell, Row_default as SummaryRow, Footer_default as default };
@@ -1,8 +1,7 @@
1
1
  import { useInjectTableContext } from "../context/TableContext.js";
2
- import HeaderRow from "./HeaderRow.js";
2
+ import HeaderRow_default from "./HeaderRow.js";
3
3
  import { computed, createVNode, defineComponent, isVNode } from "vue";
4
4
  import { clsx } from "@v-c/util";
5
- //#region src/Header/Header.tsx
6
5
  function _isSlot(s) {
7
6
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
8
7
  }
@@ -42,7 +41,7 @@ function parseHeaderRows(rootColumns, classNames, styles) {
42
41
  });
43
42
  return rows;
44
43
  }
45
- var Header = /* @__PURE__ */ defineComponent({
44
+ var Header_default = /* @__PURE__ */ defineComponent({
46
45
  name: "TableHeader",
47
46
  inheritAttrs: false,
48
47
  props: [
@@ -65,7 +64,7 @@ var Header = /* @__PURE__ */ defineComponent({
65
64
  "class": clsx(`${context.prefixCls}-thead`, headerCls.value.wrapper),
66
65
  "style": headerStyles.value.wrapper
67
66
  }, _isSlot(_slot = rows.map((row, rowIndex) => {
68
- return createVNode(HeaderRow, {
67
+ return createVNode(HeaderRow_default, {
69
68
  "classNames": headerCls.value,
70
69
  "styles": headerStyles.value,
71
70
  "key": rowIndex,
@@ -81,5 +80,4 @@ var Header = /* @__PURE__ */ defineComponent({
81
80
  };
82
81
  }
83
82
  });
84
- //#endregion
85
- export { Header as default };
83
+ export { Header_default as default };
@@ -1,14 +1,13 @@
1
1
  import { useInjectTableContext } from "../context/TableContext.js";
2
2
  import { getColumnsKey } from "../utils/valueUtil.js";
3
- import Cell from "../Cell/index.js";
3
+ import Cell_default from "../Cell/index.js";
4
4
  import { getCellFixedInfo } from "../utils/fixUtil.js";
5
5
  import { createVNode, defineComponent, isVNode, mergeProps } from "vue";
6
6
  import { clsx } from "@v-c/util";
7
- //#region src/Header/HeaderRow.tsx
8
7
  function _isSlot(s) {
9
8
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
10
9
  }
11
- var HeaderRow = /* @__PURE__ */ defineComponent({
10
+ var HeaderRow_default = /* @__PURE__ */ defineComponent({
12
11
  name: "TableHeaderRow",
13
12
  props: [
14
13
  "cells",
@@ -42,7 +41,7 @@ var HeaderRow = /* @__PURE__ */ defineComponent({
42
41
  const { column, colStart, colEnd, colSpan } = cell;
43
42
  const fixedInfo = getCellFixedInfo(colStart, colEnd, flattenColumns, stickyOffsets);
44
43
  const additionalProps = column?.onHeaderCell?.(column) || {};
45
- return createVNode(Cell, mergeProps(cell, {
44
+ return createVNode(Cell_default, mergeProps(cell, {
46
45
  "colIndex": colStart ?? cellIndex,
47
46
  "scope": column.title ? colSpan > 1 ? "colgroup" : "col" : null,
48
47
  "ellipsis": column.ellipsis,
@@ -58,5 +57,4 @@ var HeaderRow = /* @__PURE__ */ defineComponent({
58
57
  };
59
58
  }
60
59
  });
61
- //#endregion
62
- export { HeaderRow as default };
60
+ export { HeaderRow_default as default };
@@ -1,9 +1,7 @@
1
1
  import { createVNode, defineComponent } from "vue";
2
- //#region src/Panel/index.tsx
3
- var Panel = /* @__PURE__ */ defineComponent((_, { attrs, slots }) => {
2
+ var Panel_default = /* @__PURE__ */ defineComponent((_, { attrs, slots }) => {
4
3
  return () => {
5
4
  return createVNode("div", attrs, [slots?.default?.()]);
6
5
  };
7
6
  });
8
- //#endregion
9
- export { Panel as default };
7
+ export { Panel_default as default };
package/dist/Table.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { useProvideTableContext } from "./context/TableContext.js";
2
- import ColGroup from "./ColGroup.js";
2
+ import ColGroup_default from "./ColGroup.js";
3
3
  import { getColumnsKey, validNumberValue, validateValue } from "./utils/valueUtil.js";
4
- import Body from "./Body/index.js";
4
+ import Body_default from "./Body/index.js";
5
5
  import { EXPAND_COLUMN, INTERNAL_HOOKS } from "./constant.js";
6
- import FixedHolder from "./FixedHolder/index.js";
7
- import Footer, { FooterComponents } from "./Footer/index.js";
8
- import Header from "./Header/Header.js";
6
+ import FixedHolder_default from "./FixedHolder/index.js";
7
+ import Footer_default, { FooterComponents } from "./Footer/index.js";
8
+ import Header_default from "./Header/Header.js";
9
9
  import useColumns from "./hooks/useColumns/index.js";
10
10
  import useExpand from "./hooks/useExpand.js";
11
11
  import useFixedInfo from "./hooks/useFixedInfo.js";
@@ -13,10 +13,10 @@ import { useTimeoutLock } from "./hooks/useFrame.js";
13
13
  import useHover from "./hooks/useHover.js";
14
14
  import useSticky from "./hooks/useSticky.js";
15
15
  import useStickyOffsets from "./hooks/useStickyOffsets.js";
16
- import Panel from "./Panel/index.js";
17
- import StickyScrollBar from "./stickyScrollBar.js";
18
- import Column from "./sugar/Column.js";
19
- import ColumnGroup from "./sugar/ColumnGroup.js";
16
+ import Panel_default from "./Panel/index.js";
17
+ import stickyScrollBar_default from "./stickyScrollBar.js";
18
+ import Column_default from "./sugar/Column.js";
19
+ import ColumnGroup_default from "./sugar/ColumnGroup.js";
20
20
  import { Fragment, computed, createVNode, defineComponent, isVNode, mergeDefaults, mergeProps, nextTick, onMounted, reactive, ref, shallowRef, watch, watchEffect } from "vue";
21
21
  import ResizeObserver from "@v-c/resize-observer";
22
22
  import { clsx, get, warning } from "@v-c/util";
@@ -26,36 +26,10 @@ import { getTargetScrollBarSize } from "@v-c/util/dist/getScrollBarSize";
26
26
  import isEqual from "@v-c/util/dist/isEqual";
27
27
  import pickAttrs from "@v-c/util/dist/pickAttrs";
28
28
  import { filterEmpty } from "@v-c/util/dist/props-util";
29
- //#region src/Table.tsx
30
- /**
31
- * Feature:
32
- * - fixed not need to set width
33
- * - support `rowExpandable` to config row expand logic
34
- * - add `summary` to support `() => VueNode`
35
- *
36
- * Update:
37
- * - `dataIndex` is `array[]` now
38
- * - `expandable` wrap all the expand related props
39
- *
40
- * Removed:
41
- * - expandIconAsCell
42
- * - useFixedHeader
43
- * - rowRef
44
- * - columns[number].onCellClick
45
- * - onRowClick
46
- * - onRowDoubleClick
47
- * - onRowMouseEnter
48
- * - onRowMouseLeave
49
- * - getBodyWrapper
50
- * - bodyStyle
51
- *
52
- * Deprecated:
53
- * - All expanded props, move into expandable
54
- */
55
29
  function _isSlot(s) {
56
30
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
57
31
  }
58
- var DEFAULT_PREFIX = "vc-table";
32
+ const DEFAULT_PREFIX = "vc-table";
59
33
  var EMPTY_DATA = [];
60
34
  var EMPTY_SCROLL_TARGET = {};
61
35
  function defaultEmpty() {
@@ -363,14 +337,14 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
363
337
  let _slot, _slot2;
364
338
  slotChildren.value = slots.default?.();
365
339
  const renderFixedHeaderTable = (fixedHolderPassProps) => {
366
- return createVNode(Fragment, null, [createVNode(Header, fixedHolderPassProps, null), fixFooter.value === "top" && createVNode(Footer, fixedHolderPassProps, { default: () => [summaryNode.value] })]);
340
+ return createVNode(Fragment, null, [createVNode(Header_default, fixedHolderPassProps, null), fixFooter.value === "top" && createVNode(Footer_default, fixedHolderPassProps, { default: () => [summaryNode.value] })]);
367
341
  };
368
- const renderFixedFooterTable = (fixedHolderPassProps) => createVNode(Footer, fixedHolderPassProps, { default: () => [summaryNode.value] });
369
- const bodyTableNode = createVNode(Body, {
342
+ const renderFixedFooterTable = (fixedHolderPassProps) => createVNode(Footer_default, fixedHolderPassProps, { default: () => [summaryNode.value] });
343
+ const bodyTableNode = createVNode(Body_default, {
370
344
  "data": mergedData.value,
371
345
  "measureColumnWidth": fixHeader.value || horizonScroll.value || stickyConfig.value.isSticky
372
346
  }, null);
373
- const bodyColGroupNode = createVNode(ColGroup, {
347
+ const bodyColGroupNode = createVNode(ColGroup_default, {
374
348
  "colWidths": flattenColumns.value.map(({ width }) => width),
375
349
  "columns": flattenColumns.value
376
350
  }, null);
@@ -400,7 +374,7 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
400
374
  captionElement,
401
375
  bodyColGroupNode,
402
376
  bodyTableNode,
403
- !fixFooter.value && summaryNode.value && createVNode(Footer, {
377
+ !fixFooter.value && summaryNode.value && createVNode(Footer_default, {
404
378
  "stickyOffsets": mergedStickyOffsets.value,
405
379
  "flattenColumns": flattenColumns.value
406
380
  }, { default: () => [summaryNode.value] })
@@ -419,20 +393,20 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
419
393
  onScroll: onInternalScroll
420
394
  };
421
395
  groupTableNode = createVNode(Fragment, null, [
422
- props.showHeader !== false && createVNode(FixedHolder, mergeProps(fixedHolderProps, {
396
+ props.showHeader !== false && createVNode(FixedHolder_default, mergeProps(fixedHolderProps, {
423
397
  "stickyTopOffset": stickyConfig.value.offsetHeader,
424
398
  "className": `${mergedPrefixCls.value}-header`,
425
399
  "ref": scrollHeaderRef,
426
400
  "colGroup": bodyColGroupNode
427
401
  }), { default: renderFixedHeaderTable }),
428
402
  bodyContent,
429
- fixFooter.value && fixFooter.value !== "top" && createVNode(FixedHolder, mergeProps(fixedHolderProps, {
403
+ fixFooter.value && fixFooter.value !== "top" && createVNode(FixedHolder_default, mergeProps(fixedHolderProps, {
430
404
  "stickyBottomOffset": stickyConfig.value.offsetSummary,
431
405
  "className": `${mergedPrefixCls.value}-summary`,
432
406
  "ref": scrollSummaryRef,
433
407
  "colGroup": bodyColGroupNode
434
408
  }), { default: renderFixedFooterTable }),
435
- stickyConfig.value.isSticky && scrollBodyRef.value?.nodeType === 1 && createVNode(StickyScrollBar, {
409
+ stickyConfig.value.isSticky && scrollBodyRef.value?.nodeType === 1 && createVNode(stickyScrollBar_default, {
436
410
  "ref": stickyRef,
437
411
  "offsetScroll": stickyConfig.value.offsetScroll,
438
412
  "scrollBodyRef": scrollBodyRef,
@@ -458,12 +432,12 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
458
432
  } }, ariaProps), { default: () => [
459
433
  captionElement,
460
434
  bodyColGroupNode,
461
- props.showHeader !== false && createVNode(Header, mergeProps(headerProps.value, {
435
+ props.showHeader !== false && createVNode(Header_default, mergeProps(headerProps.value, {
462
436
  "columns": columns.value,
463
437
  "flattenColumns": flattenColumns.value
464
438
  }), null),
465
439
  bodyTableNode,
466
- !fixFooter.value && summaryNode.value && createVNode(Footer, {
440
+ !fixFooter.value && summaryNode.value && createVNode(Footer_default, {
467
441
  "stickyOffsets": mergedStickyOffsets.value,
468
442
  "flattenColumns": flattenColumns.value
469
443
  }, { default: () => [summaryNode.value] })
@@ -489,7 +463,7 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
489
463
  "id": props.id,
490
464
  "ref": fullTableRef
491
465
  }, dataProps), [
492
- props.title && createVNode(Panel, {
466
+ props.title && createVNode(Panel_default, {
493
467
  "className": clsx(`${mergedPrefixCls.value}-title`, props.classNames?.title),
494
468
  "style": props.styles?.title
495
469
  }, _isSlot(_slot = props.title(mergedData.value)) ? _slot : { default: () => [_slot] }),
@@ -498,7 +472,7 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
498
472
  "class": clsx(`${mergedPrefixCls.value}-container`, props.classNames?.section),
499
473
  "style": props.styles?.section
500
474
  }, [groupTableNode]),
501
- props.footer && createVNode(Panel, {
475
+ props.footer && createVNode(Panel_default, {
502
476
  "className": clsx(`${mergedPrefixCls.value}-footer`, props.classNames?.footer),
503
477
  "style": props.styles?.footer
504
478
  }, _isSlot(_slot2 = props.footer(mergedData.value)) ? _slot2 : { default: () => [_slot2] })
@@ -750,8 +724,8 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
750
724
  }, defaults) });
751
725
  ImmutableTable.EXPAND_COLUMN = EXPAND_COLUMN;
752
726
  ImmutableTable.INTERNAL_HOOKS = INTERNAL_HOOKS;
753
- ImmutableTable.Column = Column;
754
- ImmutableTable.ColumnGroup = ColumnGroup;
727
+ ImmutableTable.Column = Column_default;
728
+ ImmutableTable.ColumnGroup = ColumnGroup_default;
755
729
  ImmutableTable.Summary = FooterComponents;
756
- //#endregion
757
- export { DEFAULT_PREFIX, ImmutableTable as default };
730
+ var Table_default = ImmutableTable;
731
+ export { DEFAULT_PREFIX, Table_default as default };
@@ -1,17 +1,16 @@
1
1
  import { useInjectTableContext } from "../context/TableContext.js";
2
2
  import useFlattenRecords from "../hooks/useFlattenRecords.js";
3
3
  import { useInjectStaticContext, useProvideGridContext } from "./context.js";
4
- import BodyLine from "./BodyLine.js";
4
+ import BodyLine_default from "./BodyLine.js";
5
5
  import { computed, createVNode, defineComponent, reactive, ref, toRaw, watch, watchEffect } from "vue";
6
6
  import { getStylePxValue } from "@v-c/util/dist/props-util";
7
7
  import VirtualList from "@v-c/virtual-list";
8
- //#region src/VirtualTable/BodyGrid.tsx
9
8
  var ALIGN_MAP = {
10
9
  start: "top",
11
10
  end: "bottom",
12
11
  nearest: "auto"
13
12
  };
14
- var BodyGrid = /* @__PURE__ */ defineComponent({
13
+ var BodyGrid_default = /* @__PURE__ */ defineComponent({
15
14
  name: "TableBodyGrid",
16
15
  props: ["data", "onScroll"],
17
16
  setup(props, { expose }) {
@@ -85,16 +84,16 @@ var BodyGrid = /* @__PURE__ */ defineComponent({
85
84
  const endItemIndex = index + rowSpan - 1;
86
85
  const endItem = rawData[endItemIndex];
87
86
  if (!endItem || !endItem.record) {
88
- const endItemKey = rawData[Math.min(endItemIndex, rawData.length - 1)].rowKey;
89
- const sizeInfo = getSize(rowKey, endItemKey);
90
- return sizeInfo.bottom - sizeInfo.top;
87
+ const endItemKey$1 = rawData[Math.min(endItemIndex, rawData.length - 1)].rowKey;
88
+ const sizeInfo$2 = getSize(rowKey, endItemKey$1);
89
+ return sizeInfo$2.bottom - sizeInfo$2.top;
91
90
  }
92
91
  const endItemKey = endItem.rowKey;
93
- const sizeInfo = getSize(rowKey, endItemKey);
94
- return sizeInfo.bottom - sizeInfo.top;
92
+ const sizeInfo$1 = getSize(rowKey, endItemKey);
93
+ return sizeInfo$1.bottom - sizeInfo$1.top;
95
94
  };
96
95
  const sizeInfo = getSize(rowKey);
97
- return createVNode(BodyLine, {
96
+ return createVNode(BodyLine_default, {
98
97
  "key": index,
99
98
  "data": item,
100
99
  "rowKey": rowKey,
@@ -166,7 +165,7 @@ var BodyGrid = /* @__PURE__ */ defineComponent({
166
165
  "extraRender": extraRender
167
166
  }, { default: (dataInfo) => {
168
167
  const { item, index, ...itemProps } = dataInfo;
169
- return createVNode(BodyLine, {
168
+ return createVNode(BodyLine_default, {
170
169
  "data": dataInfo.item,
171
170
  "rowKey": item.rowKey,
172
171
  "index": index,
@@ -176,5 +175,4 @@ var BodyGrid = /* @__PURE__ */ defineComponent({
176
175
  };
177
176
  }
178
177
  });
179
- //#endregion
180
- export { BodyGrid as default };
178
+ export { BodyGrid_default as default };
@@ -1,15 +1,14 @@
1
- import Cell from "../Cell/index.js";
1
+ import Cell_default from "../Cell/index.js";
2
2
  import useRowInfo from "../hooks/useRowInfo.js";
3
3
  import { computedExpandedClassName } from "../utils/expandUtil.js";
4
4
  import { useInjectStaticContext } from "./context.js";
5
- import VirtualCell from "./VirtualCell.js";
5
+ import VirtualCell_default from "./VirtualCell.js";
6
6
  import { computed, createVNode, defineComponent, isVNode, mergeProps } from "vue";
7
7
  import { clsx } from "@v-c/util";
8
- //#region src/VirtualTable/BodyLine.tsx
9
8
  function _isSlot(s) {
10
9
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
11
10
  }
12
- var BodyLine = /* @__PURE__ */ defineComponent({
11
+ var BodyLine_default = /* @__PURE__ */ defineComponent({
13
12
  name: "TableBodyLine",
14
13
  props: [
15
14
  "data",
@@ -40,7 +39,7 @@ var BodyLine = /* @__PURE__ */ defineComponent({
40
39
  let additionalProps = {};
41
40
  if (tableContext.fixColumn) additionalProps = { style: { ["--virtual-width"]: `${tableContext.componentWidth}px` } };
42
41
  const rowCellCls = `${tableContext.prefixCls}-expanded-row-cell`;
43
- expandRowNode = createVNode(RowComponent, { "class": clsx(`${tableContext.prefixCls}-expanded-row`, `${tableContext.prefixCls}-expanded-row-level-${indent + 1}`, expandedClsName) }, { default: () => [createVNode(Cell, {
42
+ expandRowNode = createVNode(RowComponent, { "class": clsx(`${tableContext.prefixCls}-expanded-row`, `${tableContext.prefixCls}-expanded-row-level-${indent + 1}`, expandedClsName) }, { default: () => [createVNode(Cell_default, {
44
43
  "component": CellComponent,
45
44
  "prefixCls": tableContext.prefixCls,
46
45
  "className": clsx(rowCellCls, { [`${rowCellCls}-fixed`]: tableContext.fixColumn }),
@@ -65,7 +64,7 @@ var BodyLine = /* @__PURE__ */ defineComponent({
65
64
  "class": clsx(className, `${tableContext.prefixCls}-row`, rowProps.value?.className, rowProps.value?.class, { [`${tableContext.prefixCls}-row-extra`]: extra }),
66
65
  "style": mergedRowStyle
67
66
  }), _isSlot(_slot = tableContext.flattenColumns.map((column, colIndex) => {
68
- return createVNode(VirtualCell, {
67
+ return createVNode(VirtualCell_default, {
69
68
  "key": colIndex,
70
69
  "component": CellComponent,
71
70
  "rowInfo": rowInfo,
@@ -84,5 +83,4 @@ var BodyLine = /* @__PURE__ */ defineComponent({
84
83
  };
85
84
  }
86
85
  });
87
- //#endregion
88
- export { BodyLine as default };
86
+ export { BodyLine_default as default };
@@ -1,14 +1,13 @@
1
- import Cell from "../Cell/index.js";
1
+ import Cell_default from "../Cell/index.js";
2
2
  import { getCellProps } from "../Body/BodyRow.js";
3
3
  import { useInjectGridContext } from "./context.js";
4
4
  import { createVNode, defineComponent, mergeProps } from "vue";
5
5
  import { clsx } from "@v-c/util";
6
6
  import { getStylePxValue } from "@v-c/util/dist/props-util";
7
- //#region src/VirtualTable/VirtualCell.tsx
8
7
  function getColumnWidth(colIndex, colSpan, columnsOffset) {
9
8
  return columnsOffset[colIndex + (colSpan || 1)] - (columnsOffset[colIndex] || 0);
10
9
  }
11
- var VirtualCell = /* @__PURE__ */ defineComponent({
10
+ var VirtualCell_default = /* @__PURE__ */ defineComponent({
12
11
  name: "TableVirtualCell",
13
12
  props: [
14
13
  "rowInfo",
@@ -51,7 +50,7 @@ var VirtualCell = /* @__PURE__ */ defineComponent({
51
50
  cellSpan.rowSpan = 1;
52
51
  cellSpan.colSpan = 1;
53
52
  }
54
- return createVNode(Cell, mergeProps({
53
+ return createVNode(Cell_default, mergeProps({
55
54
  "className": clsx(columnClassName, className),
56
55
  "ellipsis": column.ellipsis,
57
56
  "align": column.align,
@@ -78,5 +77,4 @@ var VirtualCell = /* @__PURE__ */ defineComponent({
78
77
  };
79
78
  }
80
79
  });
81
- //#endregion
82
- export { VirtualCell as default, getColumnWidth };
80
+ export { VirtualCell_default as default, getColumnWidth };
@@ -1,5 +1,4 @@
1
1
  import { inject, provide } from "vue";
2
- //#region src/VirtualTable/context.tsx
3
2
  var StaticContextKey = Symbol("TableVirtualStaticContext");
4
3
  var GridContextKey = Symbol("TableVirtualGridContext");
5
4
  function useProvideStaticContext(value) {
@@ -14,5 +13,4 @@ function useProvideGridContext(value) {
14
13
  function useInjectGridContext() {
15
14
  return inject(GridContextKey, {});
16
15
  }
17
- //#endregion
18
16
  export { useInjectGridContext, useInjectStaticContext, useProvideGridContext, useProvideStaticContext };
@@ -1,11 +1,10 @@
1
1
  import { INTERNAL_HOOKS } from "../constant.js";
2
- import ImmutableTable from "../Table.js";
2
+ import Table_default, { DEFAULT_PREFIX } from "../Table.js";
3
3
  import { useProvideStaticContext } from "./context.js";
4
- import BodyGrid from "./BodyGrid.js";
4
+ import BodyGrid_default from "./BodyGrid.js";
5
5
  import { computed, createVNode, defineComponent, isRef, mergeProps, reactive, ref, watchEffect } from "vue";
6
6
  import { clsx, get, warning } from "@v-c/util";
7
- //#region src/VirtualTable/index.tsx
8
- var VirtualTable = /* @__PURE__ */ defineComponent((props, { expose, slots, attrs }) => {
7
+ var VirtualTable_default = /* @__PURE__ */ defineComponent((props, { expose, slots, attrs }) => {
9
8
  const tableRef = ref(null);
10
9
  const bodyRef = ref();
11
10
  const mergedScrollX = computed(() => {
@@ -55,7 +54,7 @@ var VirtualTable = /* @__PURE__ */ defineComponent((props, { expose, slots, attr
55
54
  const { scroll, listItemHeight, components, ...restProps } = props;
56
55
  const mergedClassName = clsx(restProps.className, `${props.prefixCls || "vc-table"}-virtual`);
57
56
  const renderBody = (rawData, info) => {
58
- return createVNode(BodyGrid, {
57
+ return createVNode(BodyGrid_default, {
59
58
  "ref": (el) => {
60
59
  bodyRef.value = el;
61
60
  if (typeof info.ref === "function") info.ref(el);
@@ -65,7 +64,7 @@ var VirtualTable = /* @__PURE__ */ defineComponent((props, { expose, slots, attr
65
64
  "onScroll": info.onScroll
66
65
  }, null);
67
66
  };
68
- return createVNode(ImmutableTable, mergeProps(attrs, restProps, {
67
+ return createVNode(Table_default, mergeProps(attrs, restProps, {
69
68
  "className": mergedClassName,
70
69
  "scroll": {
71
70
  ...scroll,
@@ -89,7 +88,8 @@ var VirtualTable = /* @__PURE__ */ defineComponent((props, { expose, slots, attr
89
88
  },
90
89
  scroll: {
91
90
  type: Object,
92
- required: true
91
+ required: true,
92
+ default: void 0
93
93
  },
94
94
  prefixCls: {
95
95
  type: String,
@@ -127,13 +127,9 @@ var VirtualTable = /* @__PURE__ */ defineComponent((props, { expose, slots, attr
127
127
  default: void 0
128
128
  },
129
129
  rowKey: {
130
- type: [
131
- String,
132
- Number,
133
- Symbol,
134
- Function
135
- ],
130
+ type: [String, Function],
136
131
  required: false,
132
+ skipCheck: true,
137
133
  default: void 0
138
134
  },
139
135
  tableLayout: {
@@ -332,5 +328,4 @@ var VirtualTable = /* @__PURE__ */ defineComponent((props, { expose, slots, attr
332
328
  default: void 0
333
329
  }
334
330
  } });
335
- //#endregion
336
- export { VirtualTable as default };
331
+ export { VirtualTable_default as default };
package/dist/constant.js CHANGED
@@ -1,5 +1,3 @@
1
- //#region src/constant.ts
2
- var EXPAND_COLUMN = {};
3
- var INTERNAL_HOOKS = "vc-table-internal-hook";
4
- //#endregion
1
+ const EXPAND_COLUMN = {};
2
+ const INTERNAL_HOOKS = "vc-table-internal-hook";
5
3
  export { EXPAND_COLUMN, INTERNAL_HOOKS };
@@ -1,5 +1,4 @@
1
1
  import { inject, provide, reactive } from "vue";
2
- //#region src/context/PerfContext.tsx
3
2
  var defaultPerfRecord = { renderWithProps: false };
4
3
  var PerfContextKey = Symbol("TablePerfContext");
5
4
  function useProvidePerfContext(record = reactive({ ...defaultPerfRecord })) {
@@ -9,5 +8,4 @@ function useProvidePerfContext(record = reactive({ ...defaultPerfRecord })) {
9
8
  function useInjectPerfContext() {
10
9
  return inject(PerfContextKey, defaultPerfRecord);
11
10
  }
12
- //#endregion
13
11
  export { useInjectPerfContext, useProvidePerfContext };
@@ -1,16 +1,14 @@
1
1
  import { inject, provide, ref } from "vue";
2
- //#region src/context/TableContext.tsx
3
- var TableContextKey = Symbol("TableContextProps");
2
+ const TableContextKey = Symbol("TableContextProps");
4
3
  function useProvideTableContext(props) {
5
4
  provide(TableContextKey, props);
6
5
  }
7
6
  function useInjectTableContext() {
8
7
  return inject(TableContextKey, {});
9
8
  }
10
- var makeImmutable = (component, _shouldTriggerRender) => component;
11
- var responseImmutable = (component) => component;
9
+ const makeImmutable = (component, _shouldTriggerRender) => component;
10
+ const responseImmutable = (component) => component;
12
11
  function useImmutableMark() {
13
12
  return ref(0);
14
13
  }
15
- //#endregion
16
14
  export { TableContextKey, makeImmutable, responseImmutable, useImmutableMark, useInjectTableContext, useProvideTableContext };
@@ -4,7 +4,6 @@ import useWidthColumns from "./useWidthColumns.js";
4
4
  import { computed, createVNode, isVNode, unref } from "vue";
5
5
  import { warning } from "@v-c/util";
6
6
  import { flattenChildren } from "@v-c/util/dist/props-util";
7
- //#region src/hooks/useColumns/index.tsx
8
7
  function convertChildrenToColumns(children) {
9
8
  return flattenChildren(children).filter((node) => isVNode(node)).map((node) => {
10
9
  const { key, props, children: nodeChildren } = node;
@@ -54,8 +53,8 @@ function useColumns(options, transformColumns) {
54
53
  if (process.env.NODE_ENV !== "production" && expandIconColumnIndex !== void 0) warning(false, "`expandIconColumnIndex` is deprecated. Please use `Table.EXPAND_COLUMN` in `columns` instead.");
55
54
  if (!cloneColumns.includes(EXPAND_COLUMN)) {
56
55
  const expandColIndex = expandIconColumnIndex || 0;
57
- const fixed = unref(options.fixed);
58
- const insertIndex = expandColIndex === 0 && (fixed === "right" || fixed === "end") ? baseColumns.value.length : expandColIndex;
56
+ const fixed$1 = unref(options.fixed);
57
+ const insertIndex = expandColIndex === 0 && (fixed$1 === "right" || fixed$1 === "end") ? baseColumns.value.length : expandColIndex;
59
58
  if (insertIndex >= 0) cloneColumns.splice(insertIndex, 0, EXPAND_COLUMN);
60
59
  }
61
60
  if (process.env.NODE_ENV !== "production" && cloneColumns.filter((c) => c === EXPAND_COLUMN).length > 1) warning(false, "There exist more than one `EXPAND_COLUMN` in `columns`.");
@@ -119,5 +118,4 @@ function useColumns(options, transformColumns) {
119
118
  computed(() => widthColumns.value[1])
120
119
  ];
121
120
  }
122
- //#endregion
123
121
  export { convertChildrenToColumns, useColumns as default };
@@ -1,5 +1,4 @@
1
1
  import { computed, unref } from "vue";
2
- //#region src/hooks/useColumns/useWidthColumns.tsx
3
2
  function parseColWidth(totalWidth, width = "") {
4
3
  if (typeof width === "number") return width;
5
4
  if (typeof width === "string" && width.endsWith("%")) return totalWidth * parseFloat(width) / 100;
@@ -50,5 +49,4 @@ function useWidthColumns(flattenColumns, scrollWidth, clientWidth) {
50
49
  return [mergedColumns, mergedScrollWidth ?? void 0];
51
50
  });
52
51
  }
53
- //#endregion
54
52
  export { useWidthColumns as default };
@@ -1,9 +1,8 @@
1
1
  import { getExpandableProps } from "../utils/legacyUtil.js";
2
2
  import { findAllChildrenKeys, renderExpandIcon } from "../utils/expandUtil.js";
3
- import "../constant.js";
3
+ import { INTERNAL_HOOKS } from "../constant.js";
4
4
  import { computed, ref, unref } from "vue";
5
5
  import { warning } from "@v-c/util";
6
- //#region src/hooks/useExpand.ts
7
6
  function useExpand(props, mergedData, getRowKey) {
8
7
  const expandableConfig = computed(() => getExpandableProps(props));
9
8
  const mergedExpandIcon = computed(() => expandableConfig.value.expandIcon || renderExpandIcon);
@@ -49,5 +48,4 @@ function useExpand(props, mergedData, getRowKey) {
49
48
  onTriggerExpand
50
49
  ];
51
50
  }
52
- //#endregion
53
51
  export { useExpand as default };
@@ -2,7 +2,6 @@ import { getCellFixedInfo } from "../utils/fixUtil.js";
2
2
  import { computed, unref } from "vue";
3
3
  import isEqual from "@v-c/util/dist/isEqual";
4
4
  import useMemo from "@v-c/util/dist/hooks/useMemo";
5
- //#region src/hooks/useFixedInfo.ts
6
5
  function useFixedInfo(flattenColumns, stickyOffsets) {
7
6
  const fixedInfoList = computed(() => {
8
7
  const mergedColumns = unref(flattenColumns) || [];
@@ -11,5 +10,4 @@ function useFixedInfo(flattenColumns, stickyOffsets) {
11
10
  });
12
11
  return useMemo(() => fixedInfoList.value, [fixedInfoList], (prev, next) => !isEqual(prev, next));
13
12
  }
14
- //#endregion
15
13
  export { useFixedInfo as default };
@@ -1,5 +1,4 @@
1
1
  import { computed, unref } from "vue";
2
- //#region src/hooks/useFlattenRecords.ts
3
2
  function fillRecords(list, record, indent, childrenColumnName, expandedKeys, getRowKey, index) {
4
3
  const key = getRowKey(record, index);
5
4
  list.push({
@@ -31,5 +30,4 @@ function useFlattenRecords(data, childrenColumnName, expandedKeys, getRowKey) {
31
30
  }));
32
31
  });
33
32
  }
34
- //#endregion
35
33
  export { useFlattenRecords as default };
@@ -1,6 +1,5 @@
1
1
  import { onBeforeUnmount, ref, shallowRef } from "vue";
2
2
  import raf from "@v-c/util/dist/raf";
3
- //#region src/hooks/useFrame.ts
4
3
  function useLayoutState(defaultState) {
5
4
  const stateRef = shallowRef(defaultState);
6
5
  let rafId;
@@ -43,5 +42,4 @@ function useTimeoutLock(defaultState) {
43
42
  });
44
43
  return [setState, getState];
45
44
  }
46
- //#endregion
47
45
  export { useLayoutState, useTimeoutLock };
@@ -1,5 +1,4 @@
1
1
  import { ref } from "vue";
2
- //#region src/hooks/useHover.ts
3
2
  function useHover() {
4
3
  const startRow = ref(-1);
5
4
  const endRow = ref(-1);
@@ -13,5 +12,4 @@ function useHover() {
13
12
  onHover
14
13
  ];
15
14
  }
16
- //#endregion
17
15
  export { useHover as default };
@@ -2,7 +2,6 @@ import { useInjectTableContext } from "../context/TableContext.js";
2
2
  import { getColumnsKey } from "../utils/valueUtil.js";
3
3
  import { computed, unref } from "vue";
4
4
  import { clsx } from "@v-c/util";
5
- //#region src/hooks/useRowInfo.ts
6
5
  function useRowInfo(record, rowKey, recordIndex, indent) {
7
6
  const tableContext = useInjectTableContext();
8
7
  const nestExpandable = computed(() => tableContext.expandableType === "nest");
@@ -46,5 +45,4 @@ function useRowInfo(record, rowKey, recordIndex, indent) {
46
45
  rowProps
47
46
  };
48
47
  }
49
- //#endregion
50
48
  export { useRowInfo as default };
@@ -1,6 +1,5 @@
1
1
  import { computed, unref } from "vue";
2
2
  import canUseDom from "@v-c/util/dist/Dom/canUseDom";
3
- //#region src/hooks/useSticky.ts
4
3
  var defaultContainer = canUseDom() ? window : null;
5
4
  function useSticky(sticky, prefixCls) {
6
5
  return computed(() => {
@@ -19,5 +18,4 @@ function useSticky(sticky, prefixCls) {
19
18
  };
20
19
  });
21
20
  }
22
- //#endregion
23
21
  export { useSticky as default };
@@ -1,5 +1,4 @@
1
1
  import { computed, unref } from "vue";
2
- //#region src/hooks/useStickyOffsets.ts
3
2
  function useStickyOffsets(colWidths, flattenColumns) {
4
3
  return computed(() => {
5
4
  const mergedWidths = unref(colWidths) || [];
@@ -34,5 +33,4 @@ function useStickyOffsets(colWidths, flattenColumns) {
34
33
  };
35
34
  });
36
35
  }
37
- //#endregion
38
36
  export { useStickyOffsets as default };
package/dist/index.js CHANGED
@@ -1,13 +1,11 @@
1
1
  import { INTERNAL_COL_DEFINE } from "./utils/legacyUtil.js";
2
2
  import { EXPAND_COLUMN, INTERNAL_HOOKS } from "./constant.js";
3
- import SummaryCell from "./Footer/Cell.js";
4
- import FooterRow from "./Footer/Row.js";
3
+ import Cell_default from "./Footer/Cell.js";
4
+ import Row_default from "./Footer/Row.js";
5
5
  import { FooterComponents } from "./Footer/index.js";
6
- import Column from "./sugar/Column.js";
7
- import ColumnGroup from "./sugar/ColumnGroup.js";
8
- import ImmutableTable from "./Table.js";
9
- import VirtualTable from "./VirtualTable/index.js";
10
- //#region src/index.ts
11
- var src_default = ImmutableTable;
12
- //#endregion
13
- export { Column, ColumnGroup, EXPAND_COLUMN, INTERNAL_COL_DEFINE, INTERNAL_HOOKS, FooterComponents as Summary, SummaryCell, FooterRow as SummaryRow, VirtualTable, src_default as default };
6
+ import Column_default from "./sugar/Column.js";
7
+ import ColumnGroup_default from "./sugar/ColumnGroup.js";
8
+ import Table_default from "./Table.js";
9
+ import VirtualTable_default from "./VirtualTable/index.js";
10
+ var src_default = Table_default;
11
+ export { Column_default as Column, ColumnGroup_default as ColumnGroup, EXPAND_COLUMN, INTERNAL_COL_DEFINE, INTERNAL_HOOKS, FooterComponents as Summary, Cell_default as SummaryCell, Row_default as SummaryRow, VirtualTable_default as VirtualTable, src_default as default };
@@ -6,12 +6,11 @@ import { clsx } from "@v-c/util";
6
6
  import { getDOM } from "@v-c/util/dist/Dom/findDOMNode";
7
7
  import getScrollBarSize from "@v-c/util/dist/getScrollBarSize";
8
8
  import raf from "@v-c/util/dist/raf";
9
- //#region src/stickyScrollBar.tsx
10
9
  var MOUSEUP_EVENT = "mouseup";
11
10
  var MOUSEMOVE_EVENT = "mousemove";
12
11
  var SCROLL_EVENT = "scroll";
13
12
  var RESIZE_EVENT = "resize";
14
- var StickyScrollBar = /* @__PURE__ */ defineComponent({
13
+ var stickyScrollBar_default = /* @__PURE__ */ defineComponent({
15
14
  name: "TableStickyScrollBar",
16
15
  props: [
17
16
  "scrollBodyRef",
@@ -163,5 +162,4 @@ var StickyScrollBar = /* @__PURE__ */ defineComponent({
163
162
  };
164
163
  }
165
164
  });
166
- //#endregion
167
- export { StickyScrollBar as default };
165
+ export { stickyScrollBar_default as default };
@@ -1,10 +1,5 @@
1
1
  import { defineComponent } from "vue";
2
- //#region src/sugar/Column.tsx
3
- /**
4
- * This is a syntactic sugar for `columns` prop.
5
- * So HOC will not work on this.
6
- */
7
- var Column = /* @__PURE__ */ defineComponent(() => {
2
+ var Column_default = /* @__PURE__ */ defineComponent(() => {
8
3
  return () => null;
9
4
  }, { props: {
10
5
  colSpan: {
@@ -105,5 +100,4 @@ var Column = /* @__PURE__ */ defineComponent(() => {
105
100
  default: void 0
106
101
  }
107
102
  } });
108
- //#endregion
109
- export { Column as default };
103
+ export { Column_default as default };
@@ -1,10 +1,5 @@
1
1
  import { defineComponent } from "vue";
2
- //#region src/sugar/ColumnGroup.tsx
3
- /**
4
- * This is a syntactic sugar for `columns` prop.
5
- * So HOC will not work on this.
6
- */
7
- var ColumnGroup = /* @__PURE__ */ defineComponent(() => {
2
+ var ColumnGroup_default = /* @__PURE__ */ defineComponent(() => {
8
3
  return () => null;
9
4
  }, { props: {
10
5
  colSpan: {
@@ -105,5 +100,4 @@ var ColumnGroup = /* @__PURE__ */ defineComponent(() => {
105
100
  default: void 0
106
101
  }
107
102
  } });
108
- //#endregion
109
- export { ColumnGroup as default };
103
+ export { ColumnGroup_default as default };
@@ -1,6 +1,5 @@
1
1
  import { createVNode } from "vue";
2
2
  import { clsx } from "@v-c/util";
3
- //#region src/utils/expandUtil.tsx
4
3
  function renderExpandIcon({ prefixCls, record, onExpand, expanded, expandable }) {
5
4
  const expandClassName = `${prefixCls}-row-expand-icon`;
6
5
  if (!expandable) return createVNode("span", { "class": clsx(expandClassName, `${prefixCls}-row-spaced`) }, null);
@@ -32,5 +31,4 @@ function computedExpandedClassName(cls, record, index, indent) {
32
31
  if (typeof cls === "function") return cls(record, index, indent);
33
32
  return "";
34
33
  }
35
- //#endregion
36
34
  export { computedExpandedClassName, findAllChildrenKeys, renderExpandIcon };
@@ -1,4 +1,3 @@
1
- //#region src/utils/fixUtil.ts
2
1
  function isFixedStart(column) {
3
2
  return column.fixed === "start";
4
3
  }
@@ -46,5 +45,4 @@ function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets) {
46
45
  zIndexReverse
47
46
  };
48
47
  }
49
- //#endregion
50
48
  export { getCellFixedInfo };
@@ -1,6 +1,5 @@
1
1
  import warning from "@v-c/util/dist/warning";
2
- //#region src/utils/legacyUtil.ts
3
- var INTERNAL_COL_DEFINE = "VC_TABLE_INTERNAL_COL_DEFINE";
2
+ const INTERNAL_COL_DEFINE = "VC_TABLE_INTERNAL_COL_DEFINE";
4
3
  function getExpandableProps(props) {
5
4
  const { expandable, ...legacyExpandableConfig } = props;
6
5
  let config;
@@ -29,5 +28,4 @@ function getExpandableProps(props) {
29
28
  if (config.showExpandColumn === false) config.expandIconColumnIndex = -1;
30
29
  return config;
31
30
  }
32
- //#endregion
33
31
  export { INTERNAL_COL_DEFINE, getExpandableProps };
@@ -1,5 +1,4 @@
1
1
  import { getDOM } from "@v-c/util/dist/Dom/findDOMNode";
2
- //#region src/utils/offsetUtil.ts
3
2
  function getOffset(node) {
4
3
  const box = getDOM(node).getBoundingClientRect();
5
4
  const docElem = document.documentElement;
@@ -8,5 +7,4 @@ function getOffset(node) {
8
7
  top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || document.body.clientTop || 0)
9
8
  };
10
9
  }
11
- //#endregion
12
10
  export { getOffset };
@@ -1,4 +1,3 @@
1
- //#region src/utils/valueUtil.tsx
2
1
  var INTERNAL_KEY_PREFIX = "VC_TABLE_KEY";
3
2
  function toArray(arr) {
4
3
  if (arr === void 0 || arr === null) return [];
@@ -23,5 +22,4 @@ function validateValue(val) {
23
22
  function validNumberValue(value) {
24
23
  return typeof value === "number" && !Number.isNaN(value);
25
24
  }
26
- //#endregion
27
25
  export { getColumnsKey, validNumberValue, validateValue };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/table",
3
3
  "type": "module",
4
- "version": "1.0.4",
4
+ "version": "1.0.5",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@v-c/resize-observer": "^1.0.8",
24
24
  "@v-c/util": "^1.0.19",
25
- "@v-c/virtual-list": "^1.0.6"
25
+ "@v-c/virtual-list": "^1.0.7"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"