@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
@@ -1,2 +1,2 @@
1
- import '../../style';
2
- import './index.less';
1
+ import '../../style';
2
+ import './index.less';
@@ -1,143 +1,143 @@
1
- @import '../../style/themes/index.less';
2
-
3
- @card_prefix: ~'@{ant-prefix}-block-header';
4
-
5
- .@{card_prefix} {
6
- &__title {
7
- border-radius: 4px;
8
- display: flex;
9
- align-items: center;
10
- justify-content: space-between;
11
- &--large {
12
- .title__box {
13
- line-height: 24px;
14
- .title__text {
15
- font-size: 16px;
16
- }
17
- }
18
- }
19
- &--middle {
20
- .title__box {
21
- line-height: 22px;
22
- .title__text {
23
- font-size: 14px;
24
- }
25
- }
26
- }
27
- &--small {
28
- .title__box {
29
- line-height: 20px;
30
- .title__text {
31
- font-size: 12px;
32
- }
33
- }
34
- }
35
- &--background {
36
- padding: 0 12px;
37
- background-color: #f9f9fa;
38
- &.@{card_prefix}__title {
39
- &--middle,
40
- &--large {
41
- height: 40px;
42
- }
43
- &--small {
44
- height: 32px;
45
- }
46
- }
47
- }
48
- &--pointer {
49
- cursor: pointer;
50
- }
51
- .title {
52
- &__box {
53
- flex: 1;
54
- display: flex;
55
- align-items: center;
56
- }
57
- &__addon-before {
58
- margin-right: 8px;
59
- color: @primary-color;
60
- &--middle {
61
- .addon-before--default {
62
- width: 4px;
63
- height: 16px;
64
- background-color: @primary-color;
65
- }
66
- font-size: 20px;
67
- }
68
- &--small {
69
- .addon-before--default {
70
- width: 4px;
71
- height: 16px;
72
- background-color: @primary-color;
73
- }
74
- font-size: 16px;
75
- }
76
- &--large {
77
- .addon-before--default {
78
- width: 4px;
79
- height: 20px;
80
- background-color: @primary-color;
81
- }
82
- font-size: 24px;
83
- }
84
- }
85
- &__tooltip {
86
- display: flex;
87
- margin-right: 4px;
88
- font-size: 14px;
89
- color: #b1b4c5;
90
- cursor: pointer;
91
- }
92
- &__text {
93
- color: @text-color;
94
- font-weight: 500;
95
- margin-right: 4px;
96
- }
97
- &__description {
98
- display: flex;
99
- align-items: center;
100
- color: @label-color;
101
- font-size: 12px;
102
- }
103
- &__addon-after {
104
- color: @label-color;
105
- }
106
- &__collapse {
107
- color: @label-color;
108
- display: flex;
109
- align-items: center;
110
- cursor: pointer;
111
- user-select: none;
112
- .collapse {
113
- &__text {
114
- font-size: 12px;
115
- margin: 0 4px;
116
- }
117
- &__icon {
118
- font-size: 16px;
119
- transition: transform 0.4s;
120
- &--down {
121
- transform: rotate(-180deg);
122
- }
123
- &--up {
124
- transform: rotate(0deg);
125
- }
126
- }
127
- }
128
- }
129
- }
130
- }
131
- &__content {
132
- padding: 16px 24px;
133
-
134
- // opacity: 0;
135
- // height: 0;
136
- // overflow: hidden;
137
- // transition: opacity 0.5s ease, height 0.5s ease;
138
- &--active {
139
- // opacity: 1;
140
- // height: auto;
141
- }
142
- }
143
- }
1
+ @import '../../style/themes/index.less';
2
+
3
+ @card_prefix: ~'@{ant-prefix}-block-header';
4
+
5
+ .@{card_prefix} {
6
+ &__title {
7
+ border-radius: 4px;
8
+ display: flex;
9
+ align-items: center;
10
+ justify-content: space-between;
11
+ &--large {
12
+ .title__box {
13
+ line-height: 24px;
14
+ .title__text {
15
+ font-size: 16px;
16
+ }
17
+ }
18
+ }
19
+ &--middle {
20
+ .title__box {
21
+ line-height: 22px;
22
+ .title__text {
23
+ font-size: 14px;
24
+ }
25
+ }
26
+ }
27
+ &--small {
28
+ .title__box {
29
+ line-height: 20px;
30
+ .title__text {
31
+ font-size: 12px;
32
+ }
33
+ }
34
+ }
35
+ &--background {
36
+ padding: 0 12px;
37
+ background-color: #f9f9fa;
38
+ &.@{card_prefix}__title {
39
+ &--middle,
40
+ &--large {
41
+ height: 40px;
42
+ }
43
+ &--small {
44
+ height: 32px;
45
+ }
46
+ }
47
+ }
48
+ &--pointer {
49
+ cursor: pointer;
50
+ }
51
+ .title {
52
+ &__box {
53
+ flex: 1;
54
+ display: flex;
55
+ align-items: center;
56
+ }
57
+ &__addon-before {
58
+ margin-right: 8px;
59
+ color: @primary-color;
60
+ &--middle {
61
+ .addon-before--default {
62
+ width: 4px;
63
+ height: 16px;
64
+ background-color: @primary-color;
65
+ }
66
+ font-size: 20px;
67
+ }
68
+ &--small {
69
+ .addon-before--default {
70
+ width: 4px;
71
+ height: 16px;
72
+ background-color: @primary-color;
73
+ }
74
+ font-size: 16px;
75
+ }
76
+ &--large {
77
+ .addon-before--default {
78
+ width: 4px;
79
+ height: 20px;
80
+ background-color: @primary-color;
81
+ }
82
+ font-size: 24px;
83
+ }
84
+ }
85
+ &__tooltip {
86
+ display: flex;
87
+ margin-right: 4px;
88
+ font-size: 14px;
89
+ color: #b1b4c5;
90
+ cursor: pointer;
91
+ }
92
+ &__text {
93
+ color: @text-color;
94
+ font-weight: 500;
95
+ margin-right: 4px;
96
+ }
97
+ &__description {
98
+ display: flex;
99
+ align-items: center;
100
+ color: @label-color;
101
+ font-size: 12px;
102
+ }
103
+ &__addon-after {
104
+ color: @label-color;
105
+ }
106
+ &__collapse {
107
+ color: @label-color;
108
+ display: flex;
109
+ align-items: center;
110
+ cursor: pointer;
111
+ user-select: none;
112
+ .collapse {
113
+ &__text {
114
+ font-size: 12px;
115
+ margin: 0 4px;
116
+ }
117
+ &__icon {
118
+ font-size: 16px;
119
+ transition: transform 0.4s;
120
+ &--down {
121
+ transform: rotate(-180deg);
122
+ }
123
+ &--up {
124
+ transform: rotate(0deg);
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ &__content {
132
+ padding: 16px 24px;
133
+
134
+ // opacity: 0;
135
+ // height: 0;
136
+ // overflow: hidden;
137
+ // transition: opacity 0.5s ease, height 0.5s ease;
138
+ &--active {
139
+ // opacity: 1;
140
+ // height: auto;
141
+ }
142
+ }
143
+ }
@@ -1,10 +1,10 @@
1
- import React from 'react';
2
- import { ButtonProps as AntdButtonProps } from 'antd';
3
- import { ButtonType as AntdButtonType } from 'antd/es/button';
4
- import './style';
5
- declare type ButtonType = AntdButtonType | 'secondary' | 'tertiary';
6
- export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
7
- type?: ButtonType;
8
- }
9
- declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
10
- export default _default;
1
+ import React from 'react';
2
+ import type { ButtonProps as AntdButtonProps } from 'antd';
3
+ import type { ButtonType as AntdButtonType } from 'antd/es/button';
4
+ import './style';
5
+ type ButtonType = AntdButtonType | 'secondary' | 'tertiary';
6
+ export interface ButtonProps extends Omit<AntdButtonProps, 'type'> {
7
+ type?: ButtonType;
8
+ }
9
+ declare const _default: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLElement>>;
10
+ export default _default;
@@ -4,7 +4,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
4
4
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
5
  import React from 'react';
6
6
  import { Button as AntdButton } from 'antd';
7
- import classNames from 'classnames';
7
+ import clsx from 'clsx';
8
8
  import "./style";
9
9
  function Button(_ref) {
10
10
  var className = _ref.className,
@@ -13,7 +13,7 @@ function Button(_ref) {
13
13
  type = _ref.type,
14
14
  rest = _objectWithoutProperties(_ref, _excluded);
15
15
  return /*#__PURE__*/React.createElement(AntdButton, _extends({
16
- className: classNames(className),
16
+ className: clsx(className),
17
17
  size: size,
18
18
  type: type
19
19
  }, rest));
@@ -1,2 +1,2 @@
1
- import '../../style/index.less';
2
- import './index.less';
1
+ import '../../style/index.less';
2
+ import './index.less';
@@ -1,97 +1,102 @@
1
- import React from 'react';
2
- import './style';
3
- interface BaseComponentProps {
4
- /**
5
- * 类名
6
- */
7
- className?: string;
8
- /**
9
- * 样式
10
- */
11
- style?: React.CSSProperties;
12
- /**
13
- * id
14
- */
15
- id?: string;
16
- 'data-*'?: string;
17
- }
18
- export interface CollapsibleProps extends BaseComponentProps {
19
- /**
20
- * 是否开启动画
21
- */
22
- motion?: boolean;
23
- /**
24
- * 子元素
25
- */
26
- children?: React.ReactNode;
27
- /**
28
- * 是否展开内容区域
29
- */
30
- isOpen?: boolean;
31
- /**
32
- * 动画执行的时间
33
- */
34
- duration?: number;
35
- /**
36
- * 是否保留隐藏的面板 DOM 树,默认销毁
37
- */
38
- keepDOM?: boolean;
39
- /**
40
- * 配合 keepDOM 使用,为 true 时挂载时不会渲染组件
41
- */
42
- lazyRender?: boolean;
43
- /**
44
- * 折叠高度
45
- */
46
- collapseHeight?: number;
47
- /**
48
- * 当 reCalcKey 改变时,将重新计算子节点的高度,用于优化动态渲染时的计算
49
- */
50
- reCalcKey?: number | string;
51
- /**
52
- * 动画结束的回调
53
- */
54
- onMotionEnd?: () => void;
55
- /**
56
- * 是否开启淡入淡出
57
- */
58
- fade?: boolean;
59
- }
60
- interface CollapsibleState {
61
- domInRenderTree: boolean;
62
- domHeight: number;
63
- visible: boolean;
64
- isTransitioning: boolean;
65
- cacheIsOpen: boolean;
66
- }
67
- declare class Collapsible extends React.Component<CollapsibleProps, CollapsibleState> {
68
- static defaultProps: {
69
- isOpen: boolean;
70
- duration: number;
71
- motion: boolean;
72
- keepDOM: boolean;
73
- lazyRender: boolean;
74
- collapseHeight: number;
75
- fade: boolean;
76
- };
77
- prefixCls: string;
78
- foundation: any;
79
- private domRef;
80
- private resizeObserver;
81
- private hasBeenRendered;
82
- static displayName: string;
83
- constructor(props: CollapsibleProps);
84
- private handleResize;
85
- private isChildrenInRenderTree;
86
- static getEntryInfo: (entry: ResizeObserverEntry) => {
87
- isShown: boolean;
88
- height: number;
89
- };
90
- private getDataAttr;
91
- componentDidMount(): void;
92
- static getDerivedStateFromProps(props: CollapsibleProps, prevState: CollapsibleState): Partial<CollapsibleState>;
93
- componentDidUpdate(prevProps: Readonly<CollapsibleProps>, prevState: Readonly<CollapsibleState>): void;
94
- componentWillUnmount(): void;
95
- render(): React.JSX.Element;
96
- }
97
- export default Collapsible;
1
+ import React from 'react';
2
+ import './style';
3
+ import type { ConfigConsumerProps } from 'antd/lib/config-provider';
4
+ interface BaseComponentProps {
5
+ /**
6
+ * 类名
7
+ */
8
+ className?: string;
9
+ /**
10
+ * 样式
11
+ */
12
+ style?: React.CSSProperties;
13
+ /**
14
+ * id
15
+ */
16
+ id?: string;
17
+ 'data-*'?: string;
18
+ }
19
+ export interface CollapsibleProps extends BaseComponentProps {
20
+ /**
21
+ * 是否开启动画
22
+ */
23
+ motion?: boolean;
24
+ /**
25
+ * 子元素
26
+ */
27
+ children?: React.ReactNode;
28
+ /**
29
+ * 是否展开内容区域
30
+ */
31
+ isOpen?: boolean;
32
+ /**
33
+ * 动画执行的时间
34
+ */
35
+ duration?: number;
36
+ /**
37
+ * 是否保留隐藏的面板 DOM 树,默认销毁
38
+ */
39
+ keepDOM?: boolean;
40
+ /**
41
+ * 配合 keepDOM 使用,为 true 时挂载时不会渲染组件
42
+ */
43
+ lazyRender?: boolean;
44
+ /**
45
+ * 折叠高度
46
+ */
47
+ collapseHeight?: number;
48
+ /**
49
+ * 当 reCalcKey 改变时,将重新计算子节点的高度,用于优化动态渲染时的计算
50
+ */
51
+ reCalcKey?: number | string;
52
+ /**
53
+ * 动画结束的回调
54
+ */
55
+ onMotionEnd?: () => void;
56
+ /**
57
+ * 是否开启淡入淡出
58
+ */
59
+ fade?: boolean;
60
+ /**
61
+ * 样式前缀
62
+ */
63
+ prefixCls?: string;
64
+ }
65
+ interface CollapsibleState {
66
+ domInRenderTree: boolean;
67
+ domHeight: number;
68
+ visible: boolean;
69
+ isTransitioning: boolean;
70
+ cacheIsOpen: boolean;
71
+ }
72
+ declare class Collapsible extends React.Component<CollapsibleProps, CollapsibleState> {
73
+ static defaultProps: {
74
+ isOpen: boolean;
75
+ duration: number;
76
+ motion: boolean;
77
+ keepDOM: boolean;
78
+ lazyRender: boolean;
79
+ collapseHeight: number;
80
+ fade: boolean;
81
+ };
82
+ static displayName: string;
83
+ foundation: any;
84
+ private domRef;
85
+ private resizeObserver;
86
+ private hasBeenRendered;
87
+ constructor(props: CollapsibleProps);
88
+ static getEntryInfo: (entry: ResizeObserverEntry) => {
89
+ isShown: boolean;
90
+ height: number;
91
+ };
92
+ static getDerivedStateFromProps(props: CollapsibleProps, prevState: CollapsibleState): Partial<CollapsibleState>;
93
+ componentDidMount(): void;
94
+ componentDidUpdate(prevProps: Readonly<CollapsibleProps>, prevState: Readonly<CollapsibleState>): void;
95
+ componentWillUnmount(): void;
96
+ renderCollapsible: ({ getPrefixCls }: ConfigConsumerProps) => React.JSX.Element;
97
+ render(): React.JSX.Element;
98
+ private handleResize;
99
+ private isChildrenInRenderTree;
100
+ private getDataAttr;
101
+ }
102
+ export default Collapsible;