@gx-design-vue/pro-table 0.2.0-alpha.2 → 0.2.0-alpha.21

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 (160) hide show
  1. package/dist/ProTable.d.ts +14 -493
  2. package/dist/ProTable.js +902 -511
  3. package/dist/components/Drag/Handle.d.ts +90 -0
  4. package/dist/components/Drag/Handle.js +64 -0
  5. package/dist/components/Drag/Tbody.d.ts +17 -0
  6. package/dist/components/Drag/Tbody.js +27 -0
  7. package/dist/components/EllipsisText/index.d.ts +50 -0
  8. package/dist/components/EllipsisText/index.js +65 -0
  9. package/dist/components/ScrollBar/Bar.d.ts +79 -0
  10. package/dist/components/ScrollBar/Bar.js +84 -0
  11. package/dist/components/ScrollBar/Thumb.d.ts +50 -0
  12. package/dist/components/ScrollBar/{Thumb/index.js → Thumb.js} +67 -58
  13. package/dist/components/ScrollBar/context.d.ts +3 -4
  14. package/dist/components/ScrollBar/context.js +3 -5
  15. package/dist/components/ScrollBar/util.d.ts +6 -5
  16. package/dist/components/ScrollBar/util.js +1 -14
  17. package/dist/components/SearchForm/CollapseToggle.d.ts +53 -0
  18. package/dist/components/SearchForm/CollapseToggle.js +47 -0
  19. package/dist/components/SearchForm/FormItemContainer.d.ts +73 -0
  20. package/dist/components/SearchForm/FormItemContainer.js +225 -0
  21. package/dist/components/SearchForm/FormItemWrapper.d.ts +80 -0
  22. package/dist/components/SearchForm/FormItemWrapper.js +62 -0
  23. package/dist/components/SearchForm/SearchForm.d.ts +128 -0
  24. package/dist/components/SearchForm/SearchForm.js +319 -0
  25. package/dist/components/SearchForm/index.d.ts +2 -0
  26. package/dist/components/SearchForm/index.js +2 -0
  27. package/dist/components/Toolbar/FullscreenIcon.d.ts +24 -0
  28. package/dist/components/Toolbar/FullscreenIcon.js +22 -0
  29. package/dist/components/Toolbar/ListToolBar.d.ts +109 -0
  30. package/dist/components/Toolbar/ListToolBar.js +101 -0
  31. package/dist/components/Toolbar/index.d.ts +101 -0
  32. package/dist/components/Toolbar/index.js +101 -0
  33. package/dist/components/Toolbar/style.d.ts +8 -0
  34. package/dist/components/{ListToolBar → Toolbar}/style.js +32 -27
  35. package/dist/context/TableContext.d.ts +15 -27
  36. package/dist/context/TableContext.js +3 -5
  37. package/dist/hooks/index.d.ts +19 -0
  38. package/dist/hooks/index.js +19 -0
  39. package/dist/hooks/useAutoScroll.d.ts +32 -0
  40. package/dist/hooks/useAutoScroll.js +127 -0
  41. package/dist/hooks/useBreakpoints.d.ts +13 -0
  42. package/dist/hooks/useBreakpoints.js +65 -0
  43. package/dist/hooks/useCellRender.d.ts +13 -0
  44. package/dist/hooks/useCellRender.js +40 -0
  45. package/dist/hooks/useColumnResize.d.ts +29 -0
  46. package/dist/hooks/useColumnResize.js +112 -0
  47. package/dist/hooks/useColumns.d.ts +35 -24
  48. package/dist/hooks/useColumns.js +89 -58
  49. package/dist/hooks/useDragHandleColumn.d.ts +26 -0
  50. package/dist/hooks/useDragHandleColumn.js +52 -0
  51. package/dist/hooks/useEllipsis.d.ts +20 -0
  52. package/dist/hooks/useEllipsis.js +51 -0
  53. package/dist/hooks/useFetchData.d.ts +42 -65
  54. package/dist/hooks/useFetchData.js +160 -176
  55. package/dist/hooks/useFitPage.d.ts +19 -0
  56. package/dist/hooks/useFitPage.js +90 -0
  57. package/dist/hooks/useKeepAliveReload.d.ts +21 -0
  58. package/dist/hooks/useKeepAliveReload.js +24 -0
  59. package/dist/hooks/useLoading.d.ts +18 -7
  60. package/dist/hooks/useLoading.js +27 -11
  61. package/dist/hooks/usePagination.d.ts +10 -7
  62. package/dist/hooks/usePagination.js +38 -29
  63. package/dist/hooks/useRequestOptions.d.ts +18 -0
  64. package/dist/hooks/useRequestOptions.js +39 -0
  65. package/dist/hooks/useRowDrag.d.ts +42 -0
  66. package/dist/hooks/useRowDrag.js +268 -0
  67. package/dist/hooks/useRowSelection.d.ts +27 -15
  68. package/dist/hooks/useRowSelection.js +93 -80
  69. package/dist/hooks/useTable.d.ts +35 -77
  70. package/dist/hooks/useTable.js +76 -49
  71. package/dist/hooks/useTableForm.d.ts +17 -82
  72. package/dist/hooks/useTableForm.js +137 -52
  73. package/dist/hooks/useTableScroll.d.ts +33 -31
  74. package/dist/hooks/useTableScroll.js +71 -28
  75. package/dist/hooks/useTableSize.d.ts +17 -7
  76. package/dist/hooks/useTableSize.js +21 -9
  77. package/dist/index.d.ts +11 -7
  78. package/dist/index.js +10 -4
  79. package/dist/interface.d.ts +537 -0
  80. package/dist/interface.js +1 -0
  81. package/dist/pro-table.esm.js +8897 -4012
  82. package/dist/pro-table.js +4 -1
  83. package/dist/style/ellipsis.d.ts +13 -0
  84. package/dist/style/ellipsis.js +16 -0
  85. package/dist/style/fit-page.d.ts +4 -2
  86. package/dist/style/fit-page.js +10 -5
  87. package/dist/style/index.d.ts +3 -7
  88. package/dist/style/index.js +38 -76
  89. package/dist/style/list.d.ts +4 -2
  90. package/dist/style/list.js +2 -12
  91. package/dist/style/resizable.d.ts +8 -0
  92. package/dist/style/resizable.js +18 -0
  93. package/dist/style/row-drag.d.ts +8 -0
  94. package/dist/style/row-drag.js +44 -0
  95. package/dist/style/scroll.d.ts +4 -2
  96. package/dist/style/scroll.js +9 -9
  97. package/dist/style/search.d.ts +8 -0
  98. package/dist/{components/Form/style.js → style/search.js} +22 -9
  99. package/dist/theme/augment.d.ts +8 -0
  100. package/dist/theme/augment.js +1 -0
  101. package/dist/theme/interface/components.d.ts +8 -0
  102. package/dist/theme/interface/components.js +1 -0
  103. package/dist/utils/arrayMove.d.ts +9 -0
  104. package/dist/utils/arrayMove.js +15 -0
  105. package/dist/utils/dateFormat.d.ts +9 -0
  106. package/dist/utils/dateFormat.js +29 -0
  107. package/dist/utils/ellipsis.d.ts +19 -0
  108. package/dist/utils/ellipsis.js +30 -0
  109. package/dist/utils/flipAnimate.d.ts +25 -0
  110. package/dist/utils/flipAnimate.js +40 -0
  111. package/dist/utils/formConstants.d.ts +9 -0
  112. package/dist/utils/formConstants.js +29 -0
  113. package/dist/utils/valueFormat.d.ts +9 -0
  114. package/dist/utils/valueFormat.js +27 -0
  115. package/package.json +23 -11
  116. package/dist/components/Form/components/RequestSelect.d.ts +0 -50
  117. package/dist/components/Form/components/RequestSelect.js +0 -58
  118. package/dist/components/Form/hooks/useForm.d.ts +0 -11
  119. package/dist/components/Form/hooks/useForm.js +0 -32
  120. package/dist/components/Form/index.d.ts +0 -33
  121. package/dist/components/Form/index.js +0 -479
  122. package/dist/components/Form/style.d.ts +0 -6
  123. package/dist/components/Form/utils/config.d.ts +0 -9
  124. package/dist/components/Form/utils/config.js +0 -30
  125. package/dist/components/Form/utils/dateFormat.d.ts +0 -22
  126. package/dist/components/Form/utils/dateFormat.js +0 -45
  127. package/dist/components/ListToolBar/index.d.ts +0 -60
  128. package/dist/components/ListToolBar/index.js +0 -123
  129. package/dist/components/ListToolBar/style.d.ts +0 -6
  130. package/dist/components/ScrollBar/Bar/index.d.ts +0 -49
  131. package/dist/components/ScrollBar/Bar/index.js +0 -71
  132. package/dist/components/ScrollBar/Bar/props.d.ts +0 -25
  133. package/dist/components/ScrollBar/Bar/props.js +0 -18
  134. package/dist/components/ScrollBar/Thumb/index.d.ts +0 -40
  135. package/dist/components/ScrollBar/Thumb/props.d.ts +0 -20
  136. package/dist/components/ScrollBar/Thumb/props.js +0 -18
  137. package/dist/components/TableCell/index.d.ts +0 -37
  138. package/dist/components/TableCell/index.js +0 -72
  139. package/dist/components/ToolBar/FullscreenIcon.d.ts +0 -7
  140. package/dist/components/ToolBar/FullscreenIcon.js +0 -14
  141. package/dist/components/ToolBar/index.d.ts +0 -34
  142. package/dist/components/ToolBar/index.js +0 -100
  143. package/dist/hooks/tryOnActivated.d.ts +0 -6
  144. package/dist/hooks/tryOnActivated.js +0 -14
  145. package/dist/hooks/useDebounceFn.d.ts +0 -8
  146. package/dist/hooks/useDebounceFn.js +0 -34
  147. package/dist/hooks/useScrollArea.d.ts +0 -24
  148. package/dist/hooks/useScrollArea.js +0 -104
  149. package/dist/props.d.ts +0 -340
  150. package/dist/props.js +0 -251
  151. package/dist/types/ColumnTypings.d.ts +0 -129
  152. package/dist/types/ColumnTypings.js +0 -1
  153. package/dist/types/SlotsTypings.d.ts +0 -63
  154. package/dist/types/SlotsTypings.js +0 -13
  155. package/dist/types/TableTypings.d.ts +0 -359
  156. package/dist/types/TableTypings.js +0 -1
  157. package/dist/types/index.d.ts +0 -9
  158. package/dist/types/index.js +0 -1
  159. package/dist/utils/utils.d.ts +0 -10
  160. package/dist/utils/utils.js +0 -91
@@ -0,0 +1,16 @@
1
+ //#region src/style/ellipsis.ts
2
+ /**
3
+ * 单元格文本溢出样式。
4
+ * `-webkit-line-clamp`(行数)由 EllipsisText 内联 style 动态注入;
5
+ * 这里只承载静态的 `-webkit-box` 多行省略容器结构。
6
+ */
7
+ const genProTableEllipsis = (token) => {
8
+ return { [token.componentCls]: { [`${token.componentCls}-cell-ellipsis`]: {
9
+ display: "-webkit-box",
10
+ "-webkit-box-orient": "vertical",
11
+ overflow: "hidden",
12
+ "word-break": "break-word"
13
+ } } };
14
+ };
15
+ //#endregion
16
+ export { genProTableEllipsis };
@@ -1,6 +1,8 @@
1
- import { GenerateStyle } from "@gx-design-vue/pro-provider";
1
+ import { ProFullToken } from "@gx-design-vue/pro-provider";
2
+ import { CSSObject } from "@antdv-next/cssinjs";
3
+ import { GenerateStyle } from "antdv-next/dist/theme/internal";
2
4
 
3
5
  //#region src/style/fit-page.d.ts
4
- declare const genProTableFitPage: GenerateStyle;
6
+ declare const genProTableFitPage: GenerateStyle<ProFullToken<'ProTable'>, CSSObject>;
5
7
  //#endregion
6
8
  export { genProTableFitPage };
@@ -1,29 +1,34 @@
1
1
  //#region src/style/fit-page.ts
2
2
  const genProTableFitPage = (token) => {
3
- const tableBorder = `${token.lineWidth}px ${token.lineType} ${token.colorBorderSecondary}`;
3
+ const tableBorder = `${token.lineWidth} ${token.lineType} ${token.colorBorderSecondary}`;
4
4
  return { [token.componentCls]: { [`&${token.componentCls}-full-page`]: {
5
- flex: 1,
5
+ flex: "1 1 auto",
6
+ minHeight: 0,
6
7
  height: "100%",
7
8
  overflow: "hidden",
8
9
  [`${token.componentCls}-content`]: {
10
+ flex: "1 1 auto",
9
11
  display: "flex",
10
12
  flexDirection: "column",
13
+ gap: token.marginLG,
14
+ minHeight: 0,
11
15
  height: "100%",
12
16
  overflow: "hidden",
17
+ [`${token.componentCls}-search-border`]: { marginBottom: 0 },
13
18
  [`${token.componentCls}-card`]: {
14
19
  position: "relative",
15
20
  flex: 1,
21
+ minHeight: 0,
16
22
  overflow: "hidden",
17
23
  [`${token.componentCls}-overflow-hidden`]: { [`${token.antCls}-table${token.antCls}-table-bordered>${token.antCls}-table-container`]: {
18
24
  borderBlockEnd: tableBorder,
19
25
  [`${token.antCls}-table-body`]: { borderInlineEnd: tableBorder },
20
- [`${token.antCls}-table-row`]: { [`${token.antCls}-table-cell`]: { "&:last-child": { borderRightWidth: 0 } } }
26
+ [`${token.antCls}-table-row`]: { "& > td:last-child, & > th:last-child": { borderInlineEndWidth: 0 } }
21
27
  } },
22
28
  [`${token.componentCls}-list`]: { overflow: "auto" }
23
29
  }
24
30
  }
25
31
  } } };
26
32
  };
27
-
28
33
  //#endregion
29
- export { genProTableFitPage };
34
+ export { genProTableFitPage };
@@ -1,9 +1,5 @@
1
- import { genProTableFitPage } from "./fit-page.js";
2
- import { genProTableList } from "./list.js";
3
- import { genProTableScroll } from "./scroll.js";
4
- import { GenerateStyle } from "@gx-design-vue/pro-provider";
5
-
6
1
  //#region src/style/index.d.ts
7
- declare const genProTableStyle: GenerateStyle;
2
+ type ComponentToken = Record<string, any>;
3
+ declare const _default: (prefixCls: import("vue").Ref<string>, rootCls?: import("vue").Ref<string | undefined>) => readonly [import("vue").Ref<string, string>, import("vue").ComputedRef<string | undefined>];
8
4
  //#endregion
9
- export { genProTableFitPage, genProTableList, genProTableScroll, genProTableStyle };
5
+ export { ComponentToken, _default as default };
@@ -1,10 +1,19 @@
1
+ import { genToolbarStyle } from "../components/Toolbar/style.js";
2
+ import { genProTableEllipsis } from "./ellipsis.js";
1
3
  import { genProTableFitPage } from "./fit-page.js";
2
4
  import { genProTableList } from "./list.js";
5
+ import { genProTableResizable } from "./resizable.js";
6
+ import { genProTableRowDrag } from "./row-drag.js";
3
7
  import { genProTableScroll } from "./scroll.js";
4
-
8
+ import { genProTableSearch } from "./search.js";
9
+ import { proGenStyleHooks } from "@gx-design-vue/pro-provider";
5
10
  //#region src/style/index.ts
6
11
  const genProTableStyle = (token) => {
7
12
  return { [token.componentCls]: {
13
+ [`${token.componentCls}-content`]: {
14
+ display: "flex",
15
+ flexDirection: "column"
16
+ },
8
17
  [`${token.componentCls}-card`]: { [`${token.antCls}-table-pagination${token.antCls}-pagination`]: {
9
18
  margin: 0,
10
19
  marginTop: token.margin
@@ -20,35 +29,26 @@ const genProTableStyle = (token) => {
20
29
  justifyContent: "center",
21
30
  marginBlock: token.marginXL
22
31
  },
23
- "&-table-tree": { [`${token.antCls}-table-row-cell-ellipsis`]: {
24
- overflow: "hidden",
25
- textOverflow: "ellipsis",
26
- whiteSpace: "nowrap",
27
- [`${token.antCls}-table-column-title`]: {
28
- overflow: "hidden",
29
- textOverflow: "ellipsis",
30
- whiteSpace: "nowrap"
31
- }
32
- } },
32
+ "&-loading-container": { position: "relative" },
33
+ "&-loading-mask": {
34
+ position: "absolute",
35
+ inset: 0,
36
+ display: "flex",
37
+ alignItems: "center",
38
+ justifyContent: "center",
39
+ backgroundColor: `color-mix(in srgb, ${token.colorBgContainer} 50%, transparent)`,
40
+ zIndex: 10
41
+ },
33
42
  "&-full-screen": { [`${token.componentCls}-content`]: {
34
43
  height: "100% !important",
35
44
  padding: 24,
36
45
  backgroundColor: token.colorWhite,
37
46
  boxShadow: "0 4px 8px #0003, 0 6px 20px #00000030 !important"
38
47
  } },
39
- "&-no-scroll": {
40
- [`${token.antCls}-table`]: { table: {
41
- width: "100% !important",
42
- minWidth: "unset"
43
- } },
44
- [`${token.antCls}-table-ping-right:not(${token.antCls}-table-has-fix-right)`]: { [`${token.antCls}-table-container::after`]: { boxShadow: "none" } },
45
- [`${token.antCls}-table-bordered ${token.antCls}-table-fixed-left ${token.antCls}-table-thead > tr > th`]: { "&:last-child": { borderRight: 0 } },
46
- [`${token.antCls}-table-bordered ${token.antCls}-table-fixed-left ${token.antCls}-table-tbody > tr > td`]: { "&:last-child": { borderRight: 0 } }
47
- },
48
48
  [`&-card-border`]: {
49
49
  paddingInline: token.paddingMD,
50
50
  paddingBlock: token.paddingMD,
51
- border: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
51
+ border: `${token.lineWidth} ${token.lineType} ${token.colorSplit}`,
52
52
  borderRadius: token.borderRadiusLG,
53
53
  backgroundColor: token.colorBgContainer,
54
54
  [`${token.antCls}-table-wrapper ${token.antCls}-table-pagination${token.antCls}-pagination`]: { marginBottom: 0 }
@@ -62,62 +62,24 @@ const genProTableStyle = (token) => {
62
62
  cursor: "pointer"
63
63
  }
64
64
  },
65
- [`${token.componentCls}-ellipsis`]: {
66
- overflow: "hidden",
67
- textOverflow: "ellipsis",
68
- display: "-webkit-box",
69
- "-webkit-box-orient": "vertical",
70
- "word-break": "break-word"
71
- },
72
65
  [`${token.componentCls}-action-size`]: { display: "inline-block" },
73
- [`${token.componentCls}-action-columns`]: {
74
- display: "inline-block",
75
- [`${token.antCls}-popover-inner-content`]: { padding: "8px 0 8px 16px" },
76
- [`${token.antCls}-tree ${token.antCls}-tree-switcher-noop`]: { display: "none" },
77
- [`${token.antCls}-tree > ${token.antCls}-tree-treenode`]: {
78
- width: "100%",
79
- alignItems: "center",
80
- "&:first-child": { paddingTop: 0 },
81
- "&:last-child": { paddingBottom: 4 },
82
- "&:hover": {
83
- backgroundColor: "#e6f7ff",
84
- [`${token.componentCls}-action-columns-list-item-actions`]: { display: "block" }
85
- }
86
- },
87
- [`${token.antCls}-tree ${token.antCls}-tree-node-content-wrapper`]: {
88
- flex: "1",
89
- "&:hover": { backgroundColor: "transparent" }
90
- },
91
- "&-popover-title": {
92
- display: "flex",
93
- alignItems: "center",
94
- justifyContent: "space-between",
95
- "&-check": { marginRight: 8 },
96
- [`${token.antCls}-btn-sm`]: { padding: 0 }
97
- },
98
- "&-list-group": {
99
- marginTop: 6,
100
- marginBottom: 6,
101
- fontSize: 12,
102
- color: "rgba(0, 0, 0, 0.45)"
103
- },
104
- "$-list-item": {
105
- display: "flex",
106
- alignItems: "center",
107
- justifyContent: "space-between",
108
- "&-actions": {
109
- display: "block",
110
- float: "right",
111
- cursor: "pointer",
112
- "> span + span": { marginLeft: 8 },
113
- "&-disabled": { "action": { color: "rgba(0, 0, 0, 0.25)" } },
114
- "anticon": { color: token.colorPrimary }
115
- }
116
- }
117
- },
118
- [`${token.antCls}-tooltip-inner`]: { a: { color: token.colorWhite } }
66
+ [`${token.componentCls}-a`]: {
67
+ color: token.colorPrimary,
68
+ cursor: "pointer",
69
+ "&:hover": { color: token.colorPrimaryHover }
70
+ }
119
71
  } };
120
72
  };
121
-
73
+ var style_default = proGenStyleHooks("ProTable", (token) => [
74
+ genProTableStyle(token),
75
+ genProTableEllipsis(token),
76
+ genProTableList(token),
77
+ genProTableScroll(token),
78
+ genProTableFitPage(token),
79
+ genProTableResizable(token),
80
+ genProTableRowDrag(token),
81
+ genProTableSearch(token),
82
+ genToolbarStyle(token)
83
+ ]);
122
84
  //#endregion
123
- export { genProTableFitPage, genProTableList, genProTableScroll, genProTableStyle };
85
+ export { style_default as default };
@@ -1,6 +1,8 @@
1
- import { GenerateStyle } from "@gx-design-vue/pro-provider";
1
+ import { ProFullToken } from "@gx-design-vue/pro-provider";
2
+ import { CSSObject } from "@antdv-next/cssinjs";
3
+ import { GenerateStyle } from "antdv-next/dist/theme/internal";
2
4
 
3
5
  //#region src/style/list.d.ts
4
- declare const genProTableList: GenerateStyle;
6
+ declare const genProTableList: GenerateStyle<ProFullToken<'ProTable'>, CSSObject>;
5
7
  //#endregion
6
8
  export { genProTableList };
@@ -3,18 +3,8 @@ const genProTableList = (token) => {
3
3
  return { [token.componentCls]: { [`${token.componentCls}-list`]: {
4
4
  clear: "both",
5
5
  maxWidth: "100%",
6
- [`${token.componentCls}-pagination${token.antCls}-pagination`]: { marginTop: token.margin },
7
- [`${token.componentCls}-pagination`]: {
8
- display: "flex",
9
- flexWrap: "wrap",
10
- rowGap: token.paddingXS,
11
- "> *": { flex: "none" },
12
- "&-left": { justifyContent: "flex-start" },
13
- "&-center": { justifyContent: "center" },
14
- "&-right": { justifyContent: "flex-end" }
15
- }
6
+ [`${token.componentCls}-pagination${token.antCls}-pagination`]: { marginTop: token.margin }
16
7
  } } };
17
8
  };
18
-
19
9
  //#endregion
20
- export { genProTableList };
10
+ export { genProTableList };
@@ -0,0 +1,8 @@
1
+ import { ProFullToken } from "@gx-design-vue/pro-provider";
2
+ import { CSSObject } from "@antdv-next/cssinjs";
3
+ import { GenerateStyle } from "antdv-next/dist/theme/internal";
4
+
5
+ //#region src/style/resizable.d.ts
6
+ declare const genProTableResizable: GenerateStyle<ProFullToken<'ProTable'>, CSSObject>;
7
+ //#endregion
8
+ export { genProTableResizable };
@@ -0,0 +1,18 @@
1
+ //#region src/style/resizable.ts
2
+ const genProTableResizable = (token) => {
3
+ return { [token.componentCls]: {
4
+ ".resizable-title": { position: "relative" },
5
+ ".resizable-handle": {
6
+ position: "absolute",
7
+ top: 0,
8
+ right: -5,
9
+ width: 10,
10
+ height: "100%",
11
+ cursor: "col-resize",
12
+ userSelect: "none",
13
+ zIndex: 1
14
+ }
15
+ } };
16
+ };
17
+ //#endregion
18
+ export { genProTableResizable };
@@ -0,0 +1,8 @@
1
+ import { ProFullToken } from "@gx-design-vue/pro-provider";
2
+ import { CSSObject } from "@antdv-next/cssinjs";
3
+ import { GenerateStyle } from "antdv-next/dist/theme/internal";
4
+
5
+ //#region src/style/row-drag.d.ts
6
+ declare const genProTableRowDrag: GenerateStyle<ProFullToken<'ProTable'>, CSSObject>;
7
+ //#endregion
8
+ export { genProTableRowDrag };
@@ -0,0 +1,44 @@
1
+ //#region src/style/row-drag.ts
2
+ const genProTableRowDrag = (token) => {
3
+ const draggingZIndex = token.zIndexPopupBase;
4
+ return { [token.componentCls]: {
5
+ [`${token.componentCls}-drag-handle`]: {
6
+ display: "inline-flex",
7
+ alignItems: "center",
8
+ justifyContent: "center",
9
+ padding: 4,
10
+ fontSize: 12,
11
+ color: token.colorTextSecondary,
12
+ cursor: "grab",
13
+ borderRadius: token.borderRadius,
14
+ transition: "all 0.2s",
15
+ userSelect: "none",
16
+ "&:hover": {
17
+ color: token.colorText,
18
+ backgroundColor: token.colorFillSecondary
19
+ },
20
+ "&:active": { cursor: "grabbing" }
21
+ },
22
+ [`${token.componentCls}-drag-handle-disabled`]: {
23
+ cursor: "not-allowed",
24
+ opacity: .45,
25
+ "&:hover": {
26
+ color: token.colorTextSecondary,
27
+ backgroundColor: "transparent"
28
+ }
29
+ },
30
+ [`${token.antCls}-table-tbody tr.row-dragging`]: {
31
+ position: "relative",
32
+ backgroundColor: `${token.colorPrimaryBg} !important`,
33
+ boxShadow: `0 4px 12px ${token.boxShadowTertiary}`,
34
+ zIndex: draggingZIndex,
35
+ [`> ${token.antCls}-table-cell`]: {
36
+ backgroundColor: `${token.colorPrimaryBg} !important`,
37
+ zIndex: draggingZIndex
38
+ }
39
+ },
40
+ [`${token.antCls}-table-tbody > tr`]: { willChange: "auto" }
41
+ } };
42
+ };
43
+ //#endregion
44
+ export { genProTableRowDrag };
@@ -1,6 +1,8 @@
1
- import { GenerateStyle } from "@gx-design-vue/pro-provider";
1
+ import { ProFullToken } from "@gx-design-vue/pro-provider";
2
+ import { CSSObject } from "@antdv-next/cssinjs";
3
+ import { GenerateStyle } from "antdv-next/dist/theme/internal";
2
4
 
3
5
  //#region src/style/scroll.d.ts
4
- declare const genProTableScroll: GenerateStyle;
6
+ declare const genProTableScroll: GenerateStyle<ProFullToken<'ProTable'>, CSSObject>;
5
7
  //#endregion
6
8
  export { genProTableScroll };
@@ -1,6 +1,8 @@
1
- import { TinyColor } from "@ctrl/tinycolor";
2
-
1
+ import { unit } from "@gx-design-vue/pro-provider";
3
2
  //#region src/style/scroll.ts
3
+ function withAlpha(color, alpha) {
4
+ return `color-mix(in srgb, ${color} ${alpha * 100}%, transparent)`;
5
+ }
4
6
  function scrollBarStyle() {
5
7
  return {
6
8
  scrollbarWidth: "none",
@@ -11,8 +13,8 @@ function scrollBarStyle() {
11
13
  };
12
14
  }
13
15
  const genProTableScroll = (token) => {
14
- const color = new TinyColor(token.colorText).setAlpha(.2).toRgbString();
15
- const colorHover = new TinyColor(token.colorText).setAlpha(.4).toRgbString();
16
+ const color = withAlpha(token.colorText, .2);
17
+ const colorHover = withAlpha(token.colorText, .4);
16
18
  return { [token.componentCls]: {
17
19
  [`${token.antCls}-table-container`]: { position: "relative" },
18
20
  [`${token.componentCls}-scroll`]: {
@@ -21,7 +23,7 @@ const genProTableScroll = (token) => {
21
23
  right: 2,
22
24
  bottom: 2,
23
25
  zIndex: 100,
24
- borderRadius: token.borderRadius - 2,
26
+ borderRadius: `calc(${unit(token.borderRadius)} - 2px)`,
25
27
  "&.is-vertical": {
26
28
  top: 2,
27
29
  width: 6,
@@ -49,11 +51,9 @@ const genProTableScroll = (token) => {
49
51
  }
50
52
  }
51
53
  },
52
- [`${token.antCls}-table-content`]: scrollBarStyle(),
53
54
  [`${token.antCls}-table-body`]: scrollBarStyle(),
54
- [`${token.antCls}-table-empty`]: { [`${token.antCls}-table-content`]: scrollBarStyle() }
55
+ [`${token.antCls}-table-container`]: scrollBarStyle()
55
56
  } };
56
57
  };
57
-
58
58
  //#endregion
59
- export { genProTableScroll };
59
+ export { genProTableScroll };
@@ -0,0 +1,8 @@
1
+ import { ProFullToken } from "@gx-design-vue/pro-provider";
2
+ import { CSSObject } from "@antdv-next/cssinjs";
3
+ import { GenerateStyle } from "antdv-next/dist/theme/internal";
4
+
5
+ //#region src/style/search.d.ts
6
+ declare const genProTableSearch: GenerateStyle<ProFullToken<'ProTable'>, CSSObject>;
7
+ //#endregion
8
+ export { genProTableSearch };
@@ -1,6 +1,7 @@
1
- //#region src/components/Form/style.ts
2
- const genTableFormStyle = (token) => {
3
- return {
1
+ import { unit } from "@gx-design-vue/pro-provider";
2
+ //#region src/style/search.ts
3
+ const genProTableSearch = (token) => {
4
+ return { [token.componentCls]: {
4
5
  [`${token.componentCls}-search`]: {
5
6
  position: "relative",
6
7
  display: "flex",
@@ -9,8 +10,8 @@ const genTableFormStyle = (token) => {
9
10
  "&-border": {
10
11
  paddingInline: token.paddingMD,
11
12
  paddingBlock: token.paddingMD,
12
- paddingBlockEnd: token.paddingMD - 16,
13
- border: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
13
+ paddingBlockEnd: `calc(${unit(token.paddingMD)} - 16px)`,
14
+ border: `${token.lineWidth} ${token.lineType} ${token.colorSplit}`,
14
15
  borderRadius: token.borderRadiusLG,
15
16
  marginBottom: token.marginLG,
16
17
  backgroundColor: token.colorBgContainer
@@ -64,6 +65,19 @@ const genTableFormStyle = (token) => {
64
65
  borderRightWidth: 0,
65
66
  backgroundColor: "transparent",
66
67
  cursor: "default"
68
+ },
69
+ [`${token.antCls}-input${token.componentCls}-number-range-separator`]: {
70
+ textAlign: "center",
71
+ borderInlineStartWidth: 0,
72
+ borderInlineEndWidth: 0,
73
+ backgroundColor: "transparent",
74
+ color: token.colorTextTertiary,
75
+ cursor: "default",
76
+ [`&:disabled, &${token.antCls}-input-disabled`]: {
77
+ backgroundColor: "transparent",
78
+ color: token.colorTextTertiary,
79
+ cursor: "default"
80
+ }
67
81
  }
68
82
  },
69
83
  "&-label": {
@@ -72,7 +86,7 @@ const genTableFormStyle = (token) => {
72
86
  content: "\":\"",
73
87
  position: "relative",
74
88
  marginBlock: 0,
75
- marginInlineStart: token.marginXXS / 2,
89
+ marginInlineStart: `calc(${unit(token.marginXXS)} / 2)`,
76
90
  marginInlineEnd: token.marginXS
77
91
  },
78
92
  [`&${token.componentCls}-search-item-label-no-colon::after`]: { content: "\" \"" },
@@ -89,8 +103,7 @@ const genTableFormStyle = (token) => {
89
103
  justifyContent: "center",
90
104
  alignItems: "center"
91
105
  }
92
- };
106
+ } };
93
107
  };
94
-
95
108
  //#endregion
96
- export { genTableFormStyle };
109
+ export { genProTableSearch };
@@ -0,0 +1,8 @@
1
+ import { ComponentToken } from "../style/index.js";
2
+
3
+ //#region src/theme/augment.d.ts
4
+ declare module 'antdv-next/dist/theme/interface/components' {
5
+ interface ComponentTokenMap {
6
+ ProTable?: ComponentToken;
7
+ }
8
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ComponentToken } from "../../style/index.js";
2
+
3
+ //#region src/theme/interface/components.d.ts
4
+ interface ComponentTokenMap {
5
+ ProTable: ComponentToken;
6
+ }
7
+ //#endregion
8
+ export { ComponentTokenMap };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ //#region src/utils/arrayMove.d.ts
2
+ /**
3
+ * 将数组中 `from` 位置的元素移动到 `to` 位置,返回新数组(不修改原数组)。
4
+ *
5
+ * 对标 `@dnd-kit/helpers` 的 `arrayMove`,用于行拖拽排序后的数据重排。
6
+ */
7
+ declare function arrayMove<T>(array: readonly T[], from: number, to: number): T[];
8
+ //#endregion
9
+ export { arrayMove };
@@ -0,0 +1,15 @@
1
+ //#region src/utils/arrayMove.ts
2
+ /**
3
+ * 将数组中 `from` 位置的元素移动到 `to` 位置,返回新数组(不修改原数组)。
4
+ *
5
+ * 对标 `@dnd-kit/helpers` 的 `arrayMove`,用于行拖拽排序后的数据重排。
6
+ */
7
+ function arrayMove(array, from, to) {
8
+ if (from === to || from < 0 || from >= array.length) return [...array];
9
+ const result = [...array];
10
+ const [moved] = result.splice(from, 1);
11
+ result.splice(to, 0, moved);
12
+ return result;
13
+ }
14
+ //#endregion
15
+ export { arrayMove };
@@ -0,0 +1,9 @@
1
+ import dayjs from "dayjs";
2
+
3
+ //#region src/utils/dateFormat.d.ts
4
+ type DateFormatType = ((day: dayjs.Dayjs) => string) | string | undefined;
5
+ declare function formatStringValue(value: any, format: DateFormatType): string;
6
+ declare function resolveValueFormat(valueFormat?: string, showTime?: boolean | Record<string, any>): string;
7
+ declare function formatDateRangeArray(values: any[], format: DateFormatType | DateFormatType[], type?: 'dayjs' | 'string'): any[] | undefined;
8
+ //#endregion
9
+ export { formatDateRangeArray, formatStringValue, resolveValueFormat };
@@ -0,0 +1,29 @@
1
+ import dayjs from "dayjs";
2
+ //#region src/utils/dateFormat.ts
3
+ function formatStringValue(value, format) {
4
+ if (typeof format === "function") return format(dayjs(value));
5
+ return dayjs(value).format(format);
6
+ }
7
+ function resolveValueFormat(valueFormat, showTime) {
8
+ return showTime ? "YYYY-MM-DD HH:mm:ss" : valueFormat ?? "YYYY-MM-DD";
9
+ }
10
+ function formatDateRangeArray(values, format, type = "string") {
11
+ if (!Array.isArray(values) || values.length !== 2) return;
12
+ const [startText, endText] = values;
13
+ let formatFirst;
14
+ let formatEnd;
15
+ if (Array.isArray(format)) {
16
+ formatFirst = format[0];
17
+ formatEnd = format[1];
18
+ } else if (typeof format === "object" && format !== void 0) {
19
+ formatFirst = format.format;
20
+ formatEnd = format.format;
21
+ } else {
22
+ formatFirst = format;
23
+ formatEnd = format;
24
+ }
25
+ if (type === "dayjs") return [dayjs(startText), dayjs(endText)];
26
+ return [startText ? formatStringValue(startText, formatFirst) : "", endText ? formatStringValue(endText, formatEnd) : ""];
27
+ }
28
+ //#endregion
29
+ export { formatDateRangeArray, formatStringValue, resolveValueFormat };
@@ -0,0 +1,19 @@
1
+ import { ProColumnEllipsis } from "../interface.js";
2
+ import { TooltipProps } from "antdv-next";
3
+
4
+ //#region src/utils/ellipsis.d.ts
5
+ /** 归一化后的列溢出配置,供渲染层消费 */
6
+ interface NormalizedEllipsis {
7
+ /** 是否启用溢出处理 */
8
+ enabled: boolean;
9
+ /** 省略行数,≥1 */
10
+ lines: number;
11
+ /** 是否使用原生 title 属性展示完整文本 */
12
+ showTitle: boolean;
13
+ /** tooltip 配置;false 表示仅省略不显示 tooltip */
14
+ tooltip: false | TooltipProps;
15
+ }
16
+ /** 将 column.ellipsis 归一化为渲染层统一消费的结构 */
17
+ declare function normalizeEllipsis(ellipsis?: boolean | ProColumnEllipsis): NormalizedEllipsis;
18
+ //#endregion
19
+ export { NormalizedEllipsis, normalizeEllipsis };
@@ -0,0 +1,30 @@
1
+ import { isObject } from "@gx-design-vue/pro-utils";
2
+ //#region src/utils/ellipsis.ts
3
+ /** 将 column.ellipsis 归一化为渲染层统一消费的结构 */
4
+ function normalizeEllipsis(ellipsis) {
5
+ if (ellipsis === true) return {
6
+ enabled: true,
7
+ lines: 1,
8
+ showTitle: false,
9
+ tooltip: {}
10
+ };
11
+ if (isObject(ellipsis)) {
12
+ const rawLines = ellipsis.lines;
13
+ const lines = Number.isFinite(rawLines) && rawLines >= 1 ? Math.floor(rawLines) : 1;
14
+ const rawTooltip = ellipsis.tooltip;
15
+ return {
16
+ enabled: true,
17
+ lines,
18
+ showTitle: ellipsis.showTitle ?? false,
19
+ tooltip: rawTooltip === false ? false : { ...rawTooltip ?? {} }
20
+ };
21
+ }
22
+ return {
23
+ enabled: false,
24
+ lines: 1,
25
+ showTitle: false,
26
+ tooltip: {}
27
+ };
28
+ }
29
+ //#endregion
30
+ export { normalizeEllipsis };
@@ -0,0 +1,25 @@
1
+ //#region src/utils/flipAnimate.d.ts
2
+ interface FlipAnimateOptions {
3
+ /** 动画时长 ms,默认 200 */
4
+ duration?: number;
5
+ /** 缓动函数,默认 cubic-bezier(0.2,0,0,1)(对齐 dnd-kit motionEase) */
6
+ easing?: string;
7
+ }
8
+ interface FlipEntry {
9
+ /** 行唯一标识,支持 string | number(rowKey 可能是数字 id) */
10
+ key: string | number;
11
+ el: HTMLElement;
12
+ }
13
+ /**
14
+ * FLIP 动画 —— 精简复刻 `@dnd-kit/dom` 的 `sortable#animate`。
15
+ *
16
+ * 用 Web Animations API(`element.animate`)+ CSS `translate` 属性(非 transform):
17
+ * 1. 取消元素上 transform/translate/scale 的 CSS transition(避免 getBoundingClientRect 取到中间帧)
18
+ * 2. 测新旧位置算 `delta = prev.top - next.top`(同时支持 X/Y)
19
+ * 3. `el.animate({ translate: [delta, 0] }, { duration, easing })`
20
+ *
21
+ * 命中 `prefers-reduced-motion` 时 duration 置 0。
22
+ */
23
+ declare function flipAnimate(entries: FlipEntry[], prevRects: Map<string | number, DOMRect>, options?: FlipAnimateOptions): void;
24
+ //#endregion
25
+ export { FlipAnimateOptions, FlipEntry, flipAnimate };