@dtjoy/dt-design 1.0.6 → 1.0.8

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 (222) hide show
  1. package/esm/_util/easings.d.ts +1 -0
  2. package/esm/_util/easings.js +9 -0
  3. package/esm/_util/extendsObject.d.ts +4 -0
  4. package/esm/_util/extendsObject.js +17 -0
  5. package/esm/_util/gapSize.d.ts +3 -3
  6. package/esm/_util/getScroll.d.ts +3 -0
  7. package/esm/_util/getScroll.js +32 -0
  8. package/esm/_util/hooks/index.d.ts +4 -1
  9. package/esm/_util/hooks/index.js +4 -1
  10. package/esm/_util/hooks/useForceUpdate.d.ts +2 -0
  11. package/esm/_util/hooks/useForceUpdate.js +6 -0
  12. package/esm/_util/hooks/useOrientation.d.ts +2 -2
  13. package/esm/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
  14. package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
  15. package/esm/_util/hooks/useSyncState.d.ts +3 -0
  16. package/esm/_util/hooks/useSyncState.js +20 -0
  17. package/esm/_util/index.d.ts +3 -3
  18. package/esm/_util/isNonNullable.d.ts +2 -2
  19. package/esm/_util/scrollTo.d.ts +10 -0
  20. package/esm/_util/scrollTo.js +38 -0
  21. package/esm/_util/type.d.ts +52 -52
  22. package/esm/_util/warning.d.ts +31 -31
  23. package/esm/_util/warning.js +5 -5
  24. package/esm/blockHeader/index.d.ts +50 -48
  25. package/esm/blockHeader/index.js +13 -15
  26. package/esm/blockHeader/style/index.d.ts +2 -2
  27. package/esm/blockHeader/style/index.less +143 -143
  28. package/esm/button/index.d.ts +10 -10
  29. package/esm/button/index.js +2 -2
  30. package/esm/button/style/index.d.ts +2 -2
  31. package/esm/collapsible/index.d.ts +102 -97
  32. package/esm/collapsible/index.js +53 -55
  33. package/esm/collapsible/style/index.d.ts +1 -1
  34. package/esm/collapsibleActionItems/index.d.ts +24 -24
  35. package/esm/collapsibleActionItems/index.js +2 -2
  36. package/esm/collapsibleActionItems/style/index.d.ts +2 -2
  37. package/esm/flex/index.d.ts +7 -7
  38. package/esm/flex/index.js +1 -1
  39. package/esm/flex/interface.d.ts +16 -16
  40. package/esm/flex/style/index.d.ts +2 -2
  41. package/esm/flex/style/index.less +76 -76
  42. package/esm/flex/utils.d.ts +7 -7
  43. package/esm/flex/utils.js +1 -1
  44. package/esm/formList/index.d.ts +78 -77
  45. package/esm/formList/index.js +13 -11
  46. package/esm/formList/style/index.d.ts +2 -2
  47. package/esm/formList/style/index.less +45 -45
  48. package/esm/index.d.ts +17 -14
  49. package/esm/index.js +3 -1
  50. package/esm/overflowList/index.d.ts +40 -39
  51. package/esm/overflowList/index.js +4 -3
  52. package/esm/overflowList/style/index.d.ts +2 -2
  53. package/esm/resize/index.d.ts +9 -8
  54. package/esm/resize/index.js +1 -1
  55. package/esm/resizeObserver/index.d.ts +45 -45
  56. package/esm/resizeObserver/index.js +3 -2
  57. package/esm/splitter/Panel.d.ts +7 -7
  58. package/esm/splitter/Panel.js +3 -3
  59. package/esm/splitter/SplitBar.d.ts +24 -24
  60. package/esm/splitter/SplitBar.js +8 -7
  61. package/esm/splitter/Splitter.d.ts +5 -5
  62. package/esm/splitter/Splitter.js +5 -4
  63. package/esm/splitter/hooks/sizeUtil.d.ts +3 -3
  64. package/esm/splitter/hooks/useItems.d.ts +14 -14
  65. package/esm/splitter/hooks/useItems.js +2 -2
  66. package/esm/splitter/hooks/useResizable.d.ts +10 -10
  67. package/esm/splitter/hooks/useResize.d.ts +6 -6
  68. package/esm/splitter/hooks/useResize.js +5 -5
  69. package/esm/splitter/hooks/useSizes.d.ts +4 -4
  70. package/esm/splitter/index.d.ts +8 -8
  71. package/esm/splitter/interface.d.ts +69 -69
  72. package/esm/splitter/style/index.d.ts +2 -2
  73. package/esm/statusTag/index.d.ts +29 -28
  74. package/esm/statusTag/index.js +8 -8
  75. package/esm/statusTag/style/index.d.ts +2 -2
  76. package/esm/style/index.d.ts +1 -1
  77. package/esm/style/index.less +1 -1
  78. package/esm/style/themes/index.less +2 -2
  79. package/esm/style/themes/variable.less +4 -0
  80. package/esm/table/InternalTable.d.ts +32 -0
  81. package/esm/table/InternalTable.js +429 -0
  82. package/esm/table/RcTable/VirtualTable.d.ts +2 -0
  83. package/esm/table/RcTable/VirtualTable.js +9 -0
  84. package/esm/table/RcTable/index.d.ts +2 -0
  85. package/esm/table/RcTable/index.js +9 -0
  86. package/esm/table/Table.d.ts +17 -0
  87. package/esm/table/Table.js +28 -0
  88. package/esm/table/TableMeasureRowContext.d.ts +3 -0
  89. package/esm/table/TableMeasureRowContext.js +3 -0
  90. package/esm/table/hooks/useContainerWidth.d.ts +1 -0
  91. package/esm/table/hooks/useContainerWidth.js +14 -0
  92. package/esm/table/index.d.ts +7 -0
  93. package/esm/table/index.js +2 -0
  94. package/esm/table/interface.d.ts +196 -0
  95. package/esm/table/interface.js +4 -0
  96. package/esm/table/style/bordered.less +141 -0
  97. package/esm/table/style/fixed.less +88 -0
  98. package/esm/table/style/index.d.ts +2 -0
  99. package/esm/table/style/index.js +2 -0
  100. package/esm/table/style/index.less +150 -0
  101. package/esm/table/style/selection.less +90 -0
  102. package/esm/table/style/sticky.less +55 -0
  103. package/esm/table/style/virtual.less +65 -0
  104. package/esm/table/util.d.ts +14 -0
  105. package/esm/table/util.js +33 -0
  106. package/lib/_util/easings.d.ts +1 -0
  107. package/lib/_util/easings.js +15 -0
  108. package/lib/_util/extendsObject.d.ts +4 -0
  109. package/lib/_util/extendsObject.js +20 -0
  110. package/lib/_util/gapSize.d.ts +3 -3
  111. package/lib/_util/getScroll.d.ts +3 -0
  112. package/lib/_util/getScroll.js +39 -0
  113. package/lib/_util/hooks/index.d.ts +4 -1
  114. package/lib/_util/hooks/index.js +33 -0
  115. package/lib/_util/hooks/useForceUpdate.d.ts +2 -0
  116. package/lib/_util/hooks/useForceUpdate.js +12 -0
  117. package/lib/_util/hooks/useOrientation.d.ts +2 -2
  118. package/lib/_util/hooks/useProxyImperativeHandle.d.ts +4 -0
  119. package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
  120. package/lib/_util/hooks/useSyncState.d.ts +3 -0
  121. package/lib/_util/hooks/useSyncState.js +19 -0
  122. package/lib/_util/index.d.ts +3 -3
  123. package/lib/_util/isNonNullable.d.ts +2 -2
  124. package/lib/_util/scrollTo.d.ts +10 -0
  125. package/lib/_util/scrollTo.js +44 -0
  126. package/lib/_util/type.d.ts +52 -52
  127. package/lib/_util/warning.d.ts +31 -31
  128. package/lib/_util/warning.js +7 -8
  129. package/lib/blockHeader/index.d.ts +50 -48
  130. package/lib/blockHeader/index.js +13 -12
  131. package/lib/blockHeader/style/index.d.ts +2 -2
  132. package/lib/blockHeader/style/index.less +143 -143
  133. package/lib/button/index.d.ts +10 -10
  134. package/lib/button/index.js +2 -2
  135. package/lib/button/style/index.d.ts +2 -2
  136. package/lib/collapsible/index.d.ts +102 -97
  137. package/lib/collapsible/index.js +49 -49
  138. package/lib/collapsible/style/index.d.ts +1 -1
  139. package/lib/collapsibleActionItems/index.d.ts +24 -24
  140. package/lib/collapsibleActionItems/index.js +2 -2
  141. package/lib/collapsibleActionItems/style/index.d.ts +2 -2
  142. package/lib/flex/index.d.ts +7 -7
  143. package/lib/flex/index.js +2 -2
  144. package/lib/flex/interface.d.ts +16 -16
  145. package/lib/flex/style/index.d.ts +2 -2
  146. package/lib/flex/style/index.less +76 -76
  147. package/lib/flex/utils.d.ts +7 -7
  148. package/lib/flex/utils.js +2 -2
  149. package/lib/formList/index.d.ts +78 -77
  150. package/lib/formList/index.js +10 -10
  151. package/lib/formList/style/index.d.ts +2 -2
  152. package/lib/formList/style/index.less +45 -45
  153. package/lib/index.d.ts +17 -14
  154. package/lib/index.js +21 -2
  155. package/lib/overflowList/index.d.ts +40 -39
  156. package/lib/overflowList/index.js +4 -3
  157. package/lib/overflowList/style/index.d.ts +2 -2
  158. package/lib/resize/index.d.ts +9 -8
  159. package/lib/resize/index.js +1 -1
  160. package/lib/resizeObserver/index.d.ts +45 -45
  161. package/lib/resizeObserver/index.js +3 -2
  162. package/lib/splitter/Panel.d.ts +7 -7
  163. package/lib/splitter/Panel.js +3 -3
  164. package/lib/splitter/SplitBar.d.ts +24 -24
  165. package/lib/splitter/SplitBar.js +8 -7
  166. package/lib/splitter/Splitter.d.ts +5 -5
  167. package/lib/splitter/Splitter.js +5 -4
  168. package/lib/splitter/hooks/sizeUtil.d.ts +3 -3
  169. package/lib/splitter/hooks/useItems.d.ts +14 -14
  170. package/lib/splitter/hooks/useItems.js +2 -2
  171. package/lib/splitter/hooks/useResizable.d.ts +10 -10
  172. package/lib/splitter/hooks/useResize.d.ts +6 -6
  173. package/lib/splitter/hooks/useResize.js +5 -5
  174. package/lib/splitter/hooks/useSizes.d.ts +4 -4
  175. package/lib/splitter/index.d.ts +8 -8
  176. package/lib/splitter/interface.d.ts +69 -69
  177. package/lib/splitter/style/index.d.ts +2 -2
  178. package/lib/statusTag/index.d.ts +29 -28
  179. package/lib/statusTag/index.js +8 -8
  180. package/lib/statusTag/style/index.d.ts +2 -2
  181. package/lib/style/index.d.ts +1 -1
  182. package/lib/style/index.less +1 -1
  183. package/lib/style/themes/index.less +2 -2
  184. package/lib/style/themes/variable.less +4 -0
  185. package/lib/table/InternalTable.d.ts +32 -0
  186. package/lib/table/InternalTable.js +395 -0
  187. package/lib/table/RcTable/VirtualTable.d.ts +2 -0
  188. package/lib/table/RcTable/VirtualTable.js +17 -0
  189. package/lib/table/RcTable/index.d.ts +2 -0
  190. package/lib/table/RcTable/index.js +17 -0
  191. package/lib/table/Table.d.ts +17 -0
  192. package/lib/table/Table.js +37 -0
  193. package/lib/table/TableMeasureRowContext.d.ts +3 -0
  194. package/lib/{_util/zindexContext.js → table/TableMeasureRowContext.js} +2 -5
  195. package/lib/table/hooks/useContainerWidth.d.ts +1 -0
  196. package/lib/table/hooks/useContainerWidth.js +20 -0
  197. package/lib/table/index.d.ts +7 -0
  198. package/lib/table/index.js +9 -0
  199. package/lib/table/interface.d.ts +196 -0
  200. package/lib/table/interface.js +8 -0
  201. package/lib/table/style/bordered.less +141 -0
  202. package/lib/table/style/fixed.less +88 -0
  203. package/lib/table/style/index.d.ts +2 -0
  204. package/lib/table/style/index.js +4 -0
  205. package/lib/table/style/index.less +150 -0
  206. package/lib/table/style/selection.less +90 -0
  207. package/lib/table/style/sticky.less +55 -0
  208. package/lib/table/style/virtual.less +65 -0
  209. package/lib/table/util.d.ts +14 -0
  210. package/lib/table/util.js +44 -0
  211. package/package.json +82 -66
  212. package/esm/_util/convertToTooltipProps.d.ts +0 -4
  213. package/esm/_util/convertToTooltipProps.js +0 -15
  214. package/esm/_util/hooks/useZIndex.d.ts +0 -8
  215. package/esm/_util/hooks/useZIndex.js +0 -51
  216. package/esm/_util/zindexContext.d.ts +0 -3
  217. package/esm/_util/zindexContext.js +0 -6
  218. package/lib/_util/convertToTooltipProps.d.ts +0 -4
  219. package/lib/_util/convertToTooltipProps.js +0 -21
  220. package/lib/_util/hooks/useZIndex.d.ts +0 -8
  221. package/lib/_util/hooks/useZIndex.js +0 -59
  222. package/lib/_util/zindexContext.d.ts +0 -3
@@ -0,0 +1,150 @@
1
+ @import '../../style/themes/index.less';
2
+ @import '~antd/es/style/mixins/index.less';
3
+
4
+ @table-prefix-cls: ~'@{ant-prefix}-table';
5
+
6
+ @table-expand-column-width: 48px;
7
+
8
+ @import './bordered.less';
9
+ @import './virtual.less';
10
+ @import './sticky.less';
11
+ @import './fixed.less';
12
+ @import './selection.less';
13
+
14
+ .@{table-prefix-cls}-wrapper {
15
+ clear: both;
16
+ max-width: 100%;
17
+ --rc-virtual-list-scrollbar-bg: @border-color-split;
18
+ .clearfix();
19
+
20
+ .@{table-prefix-cls} {
21
+ .reset-component();
22
+ font-size: @font-size-base;
23
+ border-radius: @border-radius-base @border-radius-base 0 0;
24
+ scrollbar-color: @table-sticky-scroll-bar-bg @border-color-split;
25
+ }
26
+
27
+ table {
28
+ width: 100%;
29
+ text-align: left;
30
+ border-radius: @border-radius-base @border-radius-base 0 0;
31
+ border-collapse: separate;
32
+ border-spacing: 0;
33
+ }
34
+
35
+ // ============================= Cell ==============================
36
+ .@{table-prefix-cls}-cell,
37
+ .@{table-prefix-cls}-thead > tr > th,
38
+ .@{table-prefix-cls}-tbody > tr > th,
39
+ .@{table-prefix-cls}-tbody > tr > td,
40
+ tfoot > tr > th,
41
+ tfoot > tr > td {
42
+ position: relative;
43
+ padding: @table-padding-vertical @table-padding-horizontal;
44
+ overflow-wrap: break-word;
45
+ }
46
+
47
+ // ============================ Title 表格标题 =============================
48
+ .@{table-prefix-cls}-title {
49
+ padding: @table-padding-vertical @table-padding-horizontal;
50
+ }
51
+
52
+ // ============================ Header 表头 ============================
53
+ .@{table-prefix-cls}-thead {
54
+ > tr > th,
55
+ > tr > td {
56
+ position: relative;
57
+ color: @table-header-color;
58
+ font-weight: 500;
59
+ text-align: start;
60
+ background: @table-header-bg;
61
+ border-bottom: @border-width-base @border-style-base @border-color-base;
62
+ transition: background @motion-duration-mid ease;
63
+
64
+ // 跨列单元格居中对齐
65
+ &[colspan]:not([colspan='1']) {
66
+ text-align: center;
67
+ }
68
+
69
+ &:not(:last-child):not(.@{table-prefix-cls}-selection-column):not(
70
+ .@{table-prefix-cls}-row-expand-icon-cell
71
+ ):not([colspan])::before {
72
+ position: absolute;
73
+ top: 50%;
74
+ right: 0;
75
+ width: 1px;
76
+ height: 1.6em;
77
+ background-color: @border-color-base;
78
+ transform: translateY(-50%);
79
+ transition: background-color @motion-duration-mid;
80
+ content: '';
81
+ }
82
+ }
83
+
84
+ // 跨列表头去除底部边框(非最后一行)
85
+ > tr:not(:last-child) > th[colspan] {
86
+ border-bottom: 0;
87
+ }
88
+ }
89
+
90
+ // ============================ Body 表体 ============================
91
+ .@{table-prefix-cls}-tbody {
92
+ > tr {
93
+ > th,
94
+ > td {
95
+ transition: background @motion-duration-mid, border-color @motion-duration-mid;
96
+ border-bottom: @border-width-base @border-style-base @border-color-base;
97
+
98
+ // ========================= Nest Table 嵌套表格 ===========================
99
+ > .@{table-prefix-cls}-wrapper:only-child,
100
+ > .@{table-prefix-cls}-expanded-row-fixed
101
+ > .@{table-prefix-cls}-wrapper:only-child {
102
+ .@{table-prefix-cls} {
103
+ margin: -@table-padding-vertical -@table-padding-horizontal -@table-padding-vertical
104
+ (@table-expand-column-width - @table-padding-horizontal);
105
+
106
+ .@{table-prefix-cls}-tbody > tr:last-child > td {
107
+ border-bottom-width: 0;
108
+ &:first-child,
109
+ &:last-child {
110
+ border-radius: 0;
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+ // 表体中的表头单元格样式(特殊场景)
118
+ > th {
119
+ position: relative;
120
+ color: @table-header-color;
121
+ font-weight: 500;
122
+ text-align: left;
123
+ background: @table-header-bg;
124
+ border-bottom: @border-width-base @border-style-base @table-border-color;
125
+ transition: background 0.3s ease;
126
+ }
127
+
128
+ // 测量单元格样式
129
+ & > .@{table-prefix-cls}-measure-cell {
130
+ padding-top: 0 !important;
131
+ padding-bottom: 0 !important;
132
+ border-top: 0 !important;
133
+ border-bottom: 0 !important;
134
+
135
+ .@{table-prefix-cls}-measure-cell-content {
136
+ height: 0;
137
+ overflow: hidden;
138
+ pointer-events: none;
139
+ }
140
+ }
141
+ }
142
+ }
143
+
144
+ // ============================ Footer 表脚 ============================
145
+ .@{table-prefix-cls}-footer {
146
+ padding: @table-padding-vertical @table-padding-horizontal;
147
+ color: @table-footer-color;
148
+ background: @table-footer-bg;
149
+ }
150
+ }
@@ -0,0 +1,90 @@
1
+ @import '../../style/themes/index.less';
2
+ @import '~antd/es/style/mixins/index.less';
3
+
4
+ @table-prefix-cls: ~'@{ant-prefix}-table';
5
+ @table-expand-icon-size: 17px;
6
+
7
+ @{table-prefix-cls}-wrapper {
8
+ @{table-prefix-cls}-selection-col {
9
+ width: @table-selection-column-width;
10
+
11
+ &.@{table-prefix-cls}-selection-col-with-dropdown {
12
+ width: calc(@table-selection-column-width + @table-expand-icon-size + (@padding-md / 4));
13
+ }
14
+ }
15
+
16
+ @{table-prefix-cls}-bordered @{table-prefix-cls}-selection-col {
17
+ width: calc(@table-selection-column-width + (@padding-xs * 2));
18
+
19
+ &.@{table-prefix-cls}-selection-col-with-dropdown {
20
+ width: calc(
21
+ @table-selection-column-width + @table-expand-icon-size + (@padding-md / 4) +
22
+ (@padding-xs * 2)
23
+ );
24
+ }
25
+ }
26
+
27
+ table tr th.@{table-prefix-cls}-selection-column,
28
+ table tr td.@{table-prefix-cls}-selection-column,
29
+ @{table-prefix-cls}-selection-column {
30
+ padding-right: @padding-xs;
31
+ padding-left: @padding-xs;
32
+ text-align: center;
33
+
34
+ .@{ant-prefix}-radio-wrapper {
35
+ margin-right: 0;
36
+ }
37
+ }
38
+
39
+ table tr th.@{table-prefix-cls}-selection-column.@{table-prefix-cls}-cell-fix-left {
40
+ z-index: calc(@zindex-table-fixed + 1);
41
+ }
42
+
43
+ table tr th.@{table-prefix-cls}-selection-column::after {
44
+ background-color: transparent !important;
45
+ }
46
+
47
+ @{table-prefix-cls}-selection {
48
+ position: relative;
49
+ display: inline-flex;
50
+ flex-direction: column;
51
+ }
52
+
53
+ @{table-prefix-cls}-selection-extra {
54
+ position: absolute;
55
+ top: 0;
56
+ z-index: 1;
57
+ cursor: pointer;
58
+ transition: all @motion-duration-slow;
59
+ margin-left: 100%;
60
+ padding-left: calc(@table-padding-horizontal / 4);
61
+
62
+ .@{iconfont-css-prefix} {
63
+ color: @table-header-bg;
64
+ font-size: @table-expand-icon-size;
65
+ vertical-align: baseline;
66
+
67
+ &:hover {
68
+ color: @primary-color;
69
+ }
70
+ }
71
+ }
72
+
73
+ @{table-prefix-cls}-tbody {
74
+ @{table-prefix-cls}-row {
75
+ &.@{table-prefix-cls}-row-selected {
76
+ > @{table-prefix-cls}-cell {
77
+ background: @table-selected-row-bg;
78
+
79
+ &.@{table-prefix-cls}-cell-row-hover {
80
+ background: @table-selected-row-hover-bg;
81
+ }
82
+ }
83
+ }
84
+
85
+ > @{table-prefix-cls}-cell-row-hover {
86
+ background: @table-row-hover-bg;
87
+ }
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,55 @@
1
+ @import '../../style/themes/index.less';
2
+
3
+ @table-prefix-cls: ~'@{ant-prefix}-table';
4
+
5
+ @table-scroll-thumb-bg: #c1c1c1;
6
+ @table-scroll-thumb-bg-hover: #a8a8a8;
7
+ @table-scroll-thumb-size: 6px;
8
+ @table-scroll-bg: #fafafa;
9
+ @sticky-scroll-bar-border-radius: @border-radius-base;
10
+ @opacity-loading: 0.6;
11
+
12
+ @motion-duration-slow: 0.3s;
13
+
14
+ .@{table-prefix-cls}-wrapper {
15
+ .@{table-prefix-cls}-sticky {
16
+ &-holder {
17
+ position: sticky;
18
+
19
+ z-index: calc(var(--columns-count) * 2 + @zindex-table-fixed + 1);
20
+ background: @background-color-base;
21
+ }
22
+
23
+ &-scroll {
24
+ position: sticky;
25
+ bottom: 0;
26
+
27
+ height: @table-scroll-thumb-size !important;
28
+ z-index: calc(var(--columns-count) * 2 + @zindex-table-fixed + 1);
29
+ display: flex;
30
+ align-items: center;
31
+ background: @table-scroll-bg;
32
+ border-top: @border-width-base @border-style-base @border-color-base;
33
+ opacity: @opacity-loading;
34
+
35
+ &:hover {
36
+ transform-origin: center bottom;
37
+ }
38
+
39
+ &-bar {
40
+ height: @table-scroll-thumb-size;
41
+ background-color: @table-scroll-thumb-bg;
42
+ border-radius: @sticky-scroll-bar-border-radius;
43
+
44
+ transition: all @motion-duration-slow, transform 0s;
45
+ position: absolute;
46
+ bottom: 0;
47
+
48
+ &:hover,
49
+ &-active {
50
+ background-color: @table-scroll-thumb-bg-hover;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,65 @@
1
+ @import '../../style/themes/index.less';
2
+
3
+ @table-prefix-cls: ~'@{ant-prefix}-table';
4
+
5
+ .@{table-prefix-cls}-wrapper {
6
+ .@{table-prefix-cls}-tbody-virtual {
7
+ .@{table-prefix-cls}-tbody-virtual-holder-inner {
8
+ & > .@{table-prefix-cls}-row,
9
+ & > div:not(.@{table-prefix-cls}-row) > .@{table-prefix-cls}-row {
10
+ display: flex;
11
+ box-sizing: border-box;
12
+ width: 100%;
13
+ }
14
+ }
15
+
16
+ .@{table-prefix-cls}-cell {
17
+ border-bottom: @border-width-base @border-style-base @border-color-base;
18
+ transition: background 0.2s;
19
+ }
20
+
21
+ .@{table-prefix-cls}-expanded-row {
22
+ .@{table-prefix-cls}-expanded-row-cell.@{table-prefix-cls}-expanded-row-cell-fixed {
23
+ position: sticky;
24
+ left: 0;
25
+ overflow: hidden;
26
+
27
+ width: calc(var(--virtual-width) - @border-width-base);
28
+ border-right: none;
29
+ }
30
+ }
31
+ }
32
+
33
+ .@{table-prefix-cls}-bordered {
34
+ .@{table-prefix-cls}-tbody-virtual {
35
+ &:after {
36
+ content: '';
37
+ left: 0;
38
+ right: 0;
39
+ bottom: 0;
40
+ border-bottom: @border-width-base @border-style-base @border-color-base;
41
+ position: absolute;
42
+ }
43
+
44
+ .@{table-prefix-cls}-cell {
45
+ border-right: @border-width-base @border-style-base @border-color-base;
46
+
47
+ &.@{table-prefix-cls}-cell-fix-right-first:before {
48
+ content: '';
49
+ position: absolute;
50
+ top: 0;
51
+ bottom: 0;
52
+ left: calc(-@border-width-base);
53
+ border-left: @border-width-base @border-style-base @border-color-base;
54
+ }
55
+ }
56
+ }
57
+
58
+ &.@{table-prefix-cls}-virtual {
59
+ .@{table-prefix-cls}-placeholder .@{table-prefix-cls}-cell {
60
+ border-right: @border-width-base @border-style-base @border-color-base;
61
+ border-bottom: @border-width-base @border-style-base @border-color-base;
62
+ }
63
+ }
64
+ }
65
+ }
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import type { AnyObject } from '../_util/type';
3
+ import type { ColumnTitle, ColumnTitleProps, ColumnType, Key } from './interface';
4
+ export declare const getColumnKey: <RecordType extends AnyObject = AnyObject>(column: ColumnType<RecordType>, defaultKey: string) => Key;
5
+ export declare function getColumnPos(index: number, pos?: string): string;
6
+ export declare const renderColumnTitle: <RecordType extends AnyObject = AnyObject>(title: ColumnTitle<RecordType>, props: ColumnTitleProps<RecordType>) => import("react").ReactNode;
7
+ /**
8
+ * Safe get column title
9
+ *
10
+ * Should filter [object Object]
11
+ *
12
+ * @param title
13
+ */
14
+ export declare const safeColumnTitle: <RecordType extends AnyObject = AnyObject>(title: ColumnTitle<RecordType>, props: ColumnTitleProps<RecordType>) => import("react").ReactNode;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getColumnKey = void 0;
7
+ exports.getColumnPos = getColumnPos;
8
+ exports.safeColumnTitle = exports.renderColumnTitle = void 0;
9
+ const getColumnKey = (column, defaultKey) => {
10
+ if ('key' in column && column.key !== undefined && column.key !== null) {
11
+ return column.key;
12
+ }
13
+ if (column.dataIndex) {
14
+ return Array.isArray(column.dataIndex) ? column.dataIndex.join('.') : column.dataIndex;
15
+ }
16
+ return defaultKey;
17
+ };
18
+ exports.getColumnKey = getColumnKey;
19
+ function getColumnPos(index, pos) {
20
+ return pos ? `${pos}-${index}` : `${index}`;
21
+ }
22
+ const renderColumnTitle = (title, props) => {
23
+ if (typeof title === 'function') {
24
+ return title(props);
25
+ }
26
+ return title;
27
+ };
28
+
29
+ /**
30
+ * Safe get column title
31
+ *
32
+ * Should filter [object Object]
33
+ *
34
+ * @param title
35
+ */
36
+ exports.renderColumnTitle = renderColumnTitle;
37
+ const safeColumnTitle = (title, props) => {
38
+ const res = renderColumnTitle(title, props);
39
+ if (Object.prototype.toString.call(res) === '[object Object]') {
40
+ return '';
41
+ }
42
+ return res;
43
+ };
44
+ exports.safeColumnTitle = safeColumnTitle;
package/package.json CHANGED
@@ -1,85 +1,93 @@
1
1
  {
2
2
  "name": "@dtjoy/dt-design",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "react-component",
5
+ "author": {
6
+ "name": "夕颜",
7
+ "email": "wx-zhaog@dtjoy.com",
8
+ "url": "https://github.com/ZhaoFxxkSky/dt-design"
9
+ },
10
+ "license": "MIT",
5
11
  "repository": "https://github.com/ZhaoFxxkSky/dt-design",
12
+ "keywords": [
13
+ "react",
14
+ "react-component",
15
+ "ui-library",
16
+ "typescript",
17
+ "ant-design"
18
+ ],
19
+ "sideEffects": [
20
+ "esm/**/style/*",
21
+ "lib/**/style/*",
22
+ "**/style/*"
23
+ ],
6
24
  "main": "lib/index.js",
7
25
  "module": "esm/index.js",
8
26
  "types": "esm/index.d.ts",
27
+ "files": [
28
+ "esm",
29
+ "lib"
30
+ ],
9
31
  "scripts": {
10
32
  "start": "npm run dev",
11
33
  "dev": "dumi dev",
12
34
  "build": "father build",
13
35
  "build:watch": "father dev",
36
+ "format": "biome format --write .",
37
+ "lint:script": "eslint . --cache",
38
+ "lint:biome": "biome lint",
39
+ "biome": "biome check --write",
14
40
  "test": "jest",
15
41
  "docs:build": "dumi build",
16
42
  "prepare": "husky install && dumi setup",
17
43
  "doctor": "father doctor",
18
- "lint": "npm run lint:es && npm run lint:css",
19
- "lint:es-fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\" --fix",
20
- "lint:css-fix": "stylelint \"src/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\" --fix",
21
- "lint:css": "stylelint \"src/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\"",
22
- "lint:es": "eslint \"src/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\"",
44
+ "lint": "npm run tsc && npm run lint:script && npm run lint:biome",
45
+ "lint:es-fix": "eslint \"components/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\" --fix",
46
+ "lint:css-fix": "stylelint \"components/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\" --fix",
47
+ "lint:css": "stylelint \"components/**/*.{css,less,scss}\" \".dumi/**/*.{css,less,scss}\"",
48
+ "lint:es": "eslint \"components/**/*.{js,jsx,ts,tsx}\" \".dumi/**/*.{js,jsx,ts,tsx}\"",
23
49
  "prepublishOnly": "npm run build",
24
50
  "deploy": "npm run docs:build && gh-pages -d docs-dist",
25
- "release": "./scripts/release.sh"
51
+ "release": "./scripts/release.sh",
52
+ "tsc": "tsc --noEmit",
53
+ "tsc:old": "tsc --noEmit -p tsconfig-old-react.json"
26
54
  },
27
- "author": {
28
- "name": "夕颜",
29
- "email": "wx-zhaog@dtjoy.com",
30
- "url": "https://github.com/ZhaoFxxkSky/dt-design"
31
- },
32
- "license": "MIT",
33
- "files": [
34
- "lib",
35
- "esm"
36
- ],
37
- "sideEffects": [
38
- "esm/**/style/*",
39
- "lib/**/style/*",
40
- "**/style/*"
41
- ],
42
- "keywords": [
43
- "react",
44
- "react-component",
45
- "ui-library",
46
- "typescript",
47
- "ant-design"
48
- ],
49
55
  "commitlint": {
50
56
  "extends": [
51
57
  "@commitlint/config-conventional"
52
58
  ]
53
59
  },
54
- "lint-staged": {
55
- "*.{md,json}": [
56
- "prettier --write --no-error-on-unmatched-pattern"
57
- ],
58
- "*.{css,scss}": [
59
- "stylelint --fix"
60
- ],
61
- "*.{js,jsx}": [
62
- "eslint --fix",
63
- "prettier --write"
64
- ],
65
- "*.{ts,tsx}": [
66
- "eslint --fix",
67
- "prettier --parser=typescript --write"
68
-
69
- ]
70
- },
71
60
  "publishConfig": {
72
61
  "access": "public"
73
62
  },
74
63
  "peerDependencies": {
64
+ "antd": "^4.x",
75
65
  "react": ">=16.9.0",
76
- "react-dom": ">=16.9.0",
77
- "antd": "^4.x"
66
+ "react-dom": ">=16.9.0"
67
+ },
68
+ "dependencies": {
69
+ "@ant-design/icons": "^4.8.3",
70
+ "@dtinsight/dt-utils": "^1.3.1",
71
+ "@rc-component/table": "^1.9.1",
72
+ "@rc-component/util": "^1.7.0",
73
+ "clsx": "^2.1.1",
74
+ "immer": "~10.1.1",
75
+ "lodash-es": "^4.17.21",
76
+ "rc-drawer": "~5.1.0",
77
+ "rc-resize-observer": "^1.4.3",
78
+ "rc-util": "^5.44.4",
79
+ "rc-virtual-list": "^3.4.13"
78
80
  },
79
81
  "devDependencies": {
82
+ "@antfu/eslint-config": "^6.6.1",
83
+ "@biomejs/biome": "^2.3.10",
80
84
  "@commitlint/cli": "^17.1.2",
81
85
  "@commitlint/config-conventional": "^17.1.0",
86
+ "@eslint-react/eslint-plugin": "^2.5.0",
82
87
  "@faker-js/faker": "^7.6.0",
88
+ "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
89
+ "@npmcli/run-script": "^10.0.3",
90
+ "@prettier/sync": "^0.6.1",
83
91
  "@testing-library/jest-dom": "^5.16.5",
84
92
  "@testing-library/react": "^13.4.0",
85
93
  "@testing-library/react-hooks": "^8.0.1",
@@ -88,6 +96,7 @@
88
96
  "@types/lodash-es": "^4.17.12",
89
97
  "@types/node": "^24.3.1",
90
98
  "@types/react": "^18.0.0",
99
+ "@types/react-dom": "18.0.0",
91
100
  "@types/react-resizable": "^3.0.8",
92
101
  "@types/react-syntax-highlighter": "~15.5.13",
93
102
  "@types/shortid": "^0.0.31",
@@ -96,10 +105,15 @@
96
105
  "ant-design-testing": "^1.1.0",
97
106
  "babel-plugin-import": "^1.13.8",
98
107
  "cz-conventional-changelog": "^3.3.0",
99
- "dumi": "^2.2.12",
100
- "eslint": "^8.23.0",
101
- "father": "~4.1.0",
102
- "gh-pages": "^4.0.0",
108
+ "dumi": "~2.4.21",
109
+ "eslint": "^9.39.2",
110
+ "eslint-plugin-compat": "^6.0.2",
111
+ "eslint-plugin-jest": "^29.12.0",
112
+ "eslint-plugin-jsx-a11y": "^6.10.2",
113
+ "eslint-plugin-react-hooks": "^7.0.1",
114
+ "eslint-plugin-react-refresh": "^0.4.26",
115
+ "father": "4.6.13",
116
+ "gh-pages": "^6.3.0",
103
117
  "husky": "^8.0.1",
104
118
  "jest": "^29.3.1",
105
119
  "jest-environment-jsdom": "^29.3.1",
@@ -112,22 +126,15 @@
112
126
  "react-test-renderer": "^18.2.0",
113
127
  "resize-observer-polyfill": "^1.5.1",
114
128
  "standard-version": "^9.5.0",
115
- "stylelint": "^14.9.1",
129
+ "stylelint": "^14.9.0",
130
+ "stylelint-config-prettier": "^9.0.2",
131
+ "stylelint-config-rational-order": "^0.1.2",
132
+ "stylelint-config-standard": "^29.0.0",
133
+ "stylelint-declaration-block-no-ignored-properties": "^2.1.0",
134
+ "stylelint-order": "^5.0.0",
116
135
  "ts-jest": "^29.0.3",
117
- "typescript": "~4.5.2"
136
+ "typescript": "~5.9.3"
118
137
  },
119
- "dependencies": {
120
- "@ant-design/icons": "^4.8.3",
121
- "@dtinsight/dt-utils": "^1.3.1",
122
- "rc-util": "^5.44.4",
123
- "classnames": "^2.2.6",
124
- "immer": "~10.1.1",
125
- "lodash-es": "^4.17.21",
126
- "rc-drawer": "~5.1.0",
127
- "rc-resize-observer": "^1.4.3",
128
- "rc-virtual-list": "^3.4.13"
129
- },
130
-
131
138
  "config": {
132
139
  "commitizen": {
133
140
  "path": "./node_modules/cz-conventional-changelog"
@@ -135,5 +142,14 @@
135
142
  },
136
143
  "resolutions": {
137
144
  "rc-motion": "2.6.2"
145
+ },
146
+ "lint-staged": {
147
+ "*.{ts,tsx,js,jsx,css,mjs,json}": [
148
+ "biome check --write --no-errors-on-unmatched",
149
+ "eslint"
150
+ ],
151
+ "*.{md,yml}": [
152
+ "prettier --ignore-unknown --write"
153
+ ]
138
154
  }
139
155
  }
@@ -1,4 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { TooltipProps } from 'antd';
3
- declare const convertToTooltipProps: <P extends TooltipProps>(tooltip: P | ReactNode) => P | null;
4
- export default convertToTooltipProps;
@@ -1,15 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- import { isValidElement } from 'react';
3
- import isNonNullable from "./isNonNullable";
4
- var convertToTooltipProps = function convertToTooltipProps(tooltip) {
5
- if (!isNonNullable(tooltip)) {
6
- return null;
7
- }
8
- if (_typeof(tooltip) === 'object' && ! /*#__PURE__*/isValidElement(tooltip)) {
9
- return tooltip;
10
- }
11
- return {
12
- title: tooltip
13
- };
14
- };
15
- export default convertToTooltipProps;
@@ -1,8 +0,0 @@
1
- export declare type ZIndexContainer = 'Modal' | 'Drawer' | 'Popover' | 'Popconfirm' | 'Tooltip' | 'Tour' | 'FloatButton';
2
- export declare type ZIndexConsumer = 'SelectLike' | 'Dropdown' | 'DatePicker' | 'Menu' | 'ImagePreview';
3
- export declare const CONTAINER_MAX_OFFSET: number;
4
- export declare const containerBaseZIndexOffset: Record<ZIndexContainer, number>;
5
- export declare const consumerBaseZIndexOffset: Record<ZIndexConsumer, number>;
6
- declare type ReturnResult = [zIndex: number | undefined, contextZIndex: number];
7
- export declare const useZIndex: (componentType: ZIndexContainer | ZIndexConsumer, customZIndex?: number) => ReturnResult;
8
- export {};