@dtjoy/dt-design 1.0.5 → 1.0.7

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 (179) hide show
  1. package/esm/_util/easings.js +9 -0
  2. package/esm/_util/extendsObject.js +17 -0
  3. package/esm/_util/getScroll.js +32 -0
  4. package/esm/_util/hooks/index.js +4 -1
  5. package/esm/_util/hooks/useForceUpdate.js +6 -0
  6. package/esm/_util/hooks/useProxyImperativeHandle.js +31 -0
  7. package/esm/_util/hooks/useSyncState.js +20 -0
  8. package/esm/_util/scrollTo.js +38 -0
  9. package/esm/_util/warning.js +63 -0
  10. package/esm/blockHeader/index.js +10 -8
  11. package/esm/blockHeader/style/index.less +143 -143
  12. package/esm/button/index.js +7 -15
  13. package/esm/button/style/index.less +52 -127
  14. package/esm/button/style/mixin.less +34 -42
  15. package/esm/collapsible/index.js +53 -55
  16. package/esm/collapsibleActionItems/index.js +2 -2
  17. package/esm/flex/index.js +1 -1
  18. package/esm/flex/style/index.less +76 -76
  19. package/esm/flex/utils.js +1 -1
  20. package/esm/formList/index.js +13 -11
  21. package/esm/formList/style/index.less +45 -45
  22. package/esm/index.js +3 -1
  23. package/esm/overflowList/index.js +4 -3
  24. package/esm/resize/index.js +1 -1
  25. package/esm/resizeObserver/index.js +3 -2
  26. package/esm/splitter/Panel.js +3 -3
  27. package/esm/splitter/SplitBar.js +8 -7
  28. package/esm/splitter/Splitter.js +5 -4
  29. package/esm/splitter/hooks/useItems.js +2 -2
  30. package/esm/splitter/hooks/useResize.js +5 -5
  31. package/esm/statusTag/index.js +8 -8
  32. package/esm/style/index.less +1 -1
  33. package/esm/style/themes/index.less +2 -2
  34. package/esm/style/themes/variable.less +4 -0
  35. package/esm/table/InternalTable.js +429 -0
  36. package/esm/table/RcTable/VirtualTable.js +9 -0
  37. package/esm/table/RcTable/index.js +9 -0
  38. package/esm/table/Table.js +28 -0
  39. package/esm/table/TableMeasureRowContext.js +3 -0
  40. package/esm/table/hooks/useContainerWidth.js +14 -0
  41. package/esm/table/index.js +2 -0
  42. package/esm/table/interface.js +4 -0
  43. package/esm/table/style/bordered.less +141 -0
  44. package/esm/table/style/fixed.less +88 -0
  45. package/esm/table/style/index.js +2 -0
  46. package/esm/table/style/index.less +150 -0
  47. package/esm/table/style/selection.less +90 -0
  48. package/esm/table/style/sticky.less +55 -0
  49. package/esm/table/style/virtual.less +65 -0
  50. package/esm/table/util.js +33 -0
  51. package/lib/_util/easings.js +15 -0
  52. package/lib/_util/extendsObject.js +20 -0
  53. package/lib/_util/getScroll.js +39 -0
  54. package/lib/_util/hooks/index.js +33 -0
  55. package/lib/_util/hooks/useForceUpdate.js +12 -0
  56. package/lib/_util/hooks/useProxyImperativeHandle.js +40 -0
  57. package/lib/_util/hooks/useSyncState.js +19 -0
  58. package/lib/_util/scrollTo.js +44 -0
  59. package/lib/_util/warning.js +75 -0
  60. package/lib/blockHeader/index.js +10 -8
  61. package/lib/blockHeader/style/index.less +143 -143
  62. package/lib/button/index.js +6 -14
  63. package/lib/button/style/index.less +52 -127
  64. package/lib/button/style/mixin.less +34 -42
  65. package/lib/collapsible/index.js +49 -49
  66. package/lib/collapsibleActionItems/index.js +2 -2
  67. package/lib/flex/index.js +2 -2
  68. package/lib/flex/style/index.less +76 -76
  69. package/lib/flex/utils.js +2 -2
  70. package/lib/formList/index.js +10 -10
  71. package/lib/formList/style/index.less +45 -45
  72. package/lib/index.js +21 -2
  73. package/lib/overflowList/index.js +4 -3
  74. package/lib/resize/index.js +1 -1
  75. package/lib/resizeObserver/index.js +3 -2
  76. package/lib/splitter/Panel.js +3 -3
  77. package/lib/splitter/SplitBar.js +8 -7
  78. package/lib/splitter/Splitter.js +5 -4
  79. package/lib/splitter/hooks/useItems.js +2 -2
  80. package/lib/splitter/hooks/useResize.js +5 -5
  81. package/lib/statusTag/index.js +8 -8
  82. package/lib/style/index.less +1 -1
  83. package/lib/style/themes/index.less +2 -2
  84. package/lib/style/themes/variable.less +4 -0
  85. package/lib/table/InternalTable.js +395 -0
  86. package/lib/table/RcTable/VirtualTable.js +17 -0
  87. package/lib/table/RcTable/index.js +17 -0
  88. package/lib/table/Table.js +37 -0
  89. package/lib/table/TableMeasureRowContext.js +10 -0
  90. package/lib/table/hooks/useContainerWidth.js +20 -0
  91. package/lib/table/index.js +9 -0
  92. package/lib/table/interface.js +8 -0
  93. package/lib/table/style/bordered.less +141 -0
  94. package/lib/table/style/fixed.less +88 -0
  95. package/lib/table/style/index.js +4 -0
  96. package/lib/table/style/index.less +150 -0
  97. package/lib/table/style/selection.less +90 -0
  98. package/lib/table/style/sticky.less +55 -0
  99. package/lib/table/style/virtual.less +65 -0
  100. package/lib/table/util.js +44 -0
  101. package/package.json +82 -66
  102. package/esm/_util/gapSize.d.ts +0 -3
  103. package/esm/_util/hooks/index.d.ts +0 -1
  104. package/esm/_util/hooks/useOrientation.d.ts +0 -2
  105. package/esm/_util/index.d.ts +0 -3
  106. package/esm/_util/isNonNullable.d.ts +0 -2
  107. package/esm/_util/type.d.ts +0 -52
  108. package/esm/blockHeader/index.d.ts +0 -47
  109. package/esm/blockHeader/style/index.d.ts +0 -2
  110. package/esm/button/index.d.ts +0 -10
  111. package/esm/button/style/index.d.ts +0 -2
  112. package/esm/collapsible/index.d.ts +0 -97
  113. package/esm/collapsible/style/index.d.ts +0 -1
  114. package/esm/collapsibleActionItems/index.d.ts +0 -24
  115. package/esm/collapsibleActionItems/style/index.d.ts +0 -2
  116. package/esm/flex/index.d.ts +0 -7
  117. package/esm/flex/interface.d.ts +0 -16
  118. package/esm/flex/style/index.d.ts +0 -2
  119. package/esm/flex/utils.d.ts +0 -7
  120. package/esm/formList/index.d.ts +0 -77
  121. package/esm/formList/style/index.d.ts +0 -2
  122. package/esm/index.d.ts +0 -14
  123. package/esm/overflowList/index.d.ts +0 -39
  124. package/esm/overflowList/style/index.d.ts +0 -2
  125. package/esm/resize/index.d.ts +0 -8
  126. package/esm/resizeObserver/index.d.ts +0 -45
  127. package/esm/splitter/Panel.d.ts +0 -7
  128. package/esm/splitter/SplitBar.d.ts +0 -24
  129. package/esm/splitter/Splitter.d.ts +0 -5
  130. package/esm/splitter/hooks/sizeUtil.d.ts +0 -3
  131. package/esm/splitter/hooks/useItems.d.ts +0 -14
  132. package/esm/splitter/hooks/useResizable.d.ts +0 -10
  133. package/esm/splitter/hooks/useResize.d.ts +0 -6
  134. package/esm/splitter/hooks/useSizes.d.ts +0 -4
  135. package/esm/splitter/index.d.ts +0 -8
  136. package/esm/splitter/interface.d.ts +0 -69
  137. package/esm/splitter/style/index.d.ts +0 -2
  138. package/esm/statusTag/index.d.ts +0 -28
  139. package/esm/statusTag/style/index.d.ts +0 -2
  140. package/esm/style/index.d.ts +0 -1
  141. package/lib/_util/gapSize.d.ts +0 -3
  142. package/lib/_util/hooks/index.d.ts +0 -1
  143. package/lib/_util/hooks/useOrientation.d.ts +0 -2
  144. package/lib/_util/index.d.ts +0 -3
  145. package/lib/_util/isNonNullable.d.ts +0 -2
  146. package/lib/_util/type.d.ts +0 -52
  147. package/lib/blockHeader/index.d.ts +0 -47
  148. package/lib/blockHeader/style/index.d.ts +0 -2
  149. package/lib/button/index.d.ts +0 -10
  150. package/lib/button/style/index.d.ts +0 -2
  151. package/lib/collapsible/index.d.ts +0 -97
  152. package/lib/collapsible/style/index.d.ts +0 -1
  153. package/lib/collapsibleActionItems/index.d.ts +0 -24
  154. package/lib/collapsibleActionItems/style/index.d.ts +0 -2
  155. package/lib/flex/index.d.ts +0 -7
  156. package/lib/flex/interface.d.ts +0 -16
  157. package/lib/flex/style/index.d.ts +0 -2
  158. package/lib/flex/utils.d.ts +0 -7
  159. package/lib/formList/index.d.ts +0 -77
  160. package/lib/formList/style/index.d.ts +0 -2
  161. package/lib/index.d.ts +0 -14
  162. package/lib/overflowList/index.d.ts +0 -39
  163. package/lib/overflowList/style/index.d.ts +0 -2
  164. package/lib/resize/index.d.ts +0 -8
  165. package/lib/resizeObserver/index.d.ts +0 -45
  166. package/lib/splitter/Panel.d.ts +0 -7
  167. package/lib/splitter/SplitBar.d.ts +0 -24
  168. package/lib/splitter/Splitter.d.ts +0 -5
  169. package/lib/splitter/hooks/sizeUtil.d.ts +0 -3
  170. package/lib/splitter/hooks/useItems.d.ts +0 -14
  171. package/lib/splitter/hooks/useResizable.d.ts +0 -10
  172. package/lib/splitter/hooks/useResize.d.ts +0 -6
  173. package/lib/splitter/hooks/useSizes.d.ts +0 -4
  174. package/lib/splitter/index.d.ts +0 -8
  175. package/lib/splitter/interface.d.ts +0 -69
  176. package/lib/splitter/style/index.d.ts +0 -2
  177. package/lib/statusTag/index.d.ts +0 -28
  178. package/lib/statusTag/style/index.d.ts +0 -2
  179. package/lib/style/index.d.ts +0 -1
@@ -3,132 +3,57 @@
3
3
 
4
4
  @btn-prefix-cls: ~'@{ant-prefix}-btn';
5
5
 
6
- .@{btn-prefix-cls} {
7
- display: inline-flex;
8
- align-items: center;
9
- justify-content: center;
10
-
11
- // 引用中尺寸配置(核心:先调用混入,再取值)
12
- .btn-size-middle();
13
- padding: @padding;
14
-
15
- // 图标样式
16
- &__icon {
17
- display: inline-flex;
18
- align-items: center;
19
- justify-content: center;
20
- font-size: inherit;
21
- line-height: 0;
22
-
23
- .dtstack-icon {
24
- font-size: inherit;
25
- }
26
-
27
- // 小尺寸图标
28
- &--small {
29
- .btn-size-small();
30
- font-size: @icon-font-size;
31
- }
32
- // 中尺寸图标
33
- &--middle {
34
- .btn-size-middle();
35
- font-size: @icon-font-size;
36
- }
37
- // 大尺寸图标
38
- &--large {
39
- .btn-size-large();
40
- font-size: @icon-font-size;
41
- }
42
-
43
- // 图标与文字间距
44
- & + .@{btn-prefix-cls}__text {
45
- &--small {
46
- .btn-size-small();
47
- margin-left: @icon-text-margin;
48
- }
49
- &--middle {
50
- .btn-size-middle();
51
- margin-left: @icon-text-margin;
52
- }
53
- &--large {
54
- .btn-size-large();
55
- margin-left: @icon-text-margin;
56
- }
57
- }
58
- }
59
-
60
- // 文字样式
61
- &__text {
62
- display: inline-block;
63
-
64
- &--small {
65
- .btn-size-small();
66
- font-size: @text-font-size;
67
- }
68
- &--middle {
69
- .btn-size-middle();
70
- font-size: @text-font-size;
71
- }
72
- &--large {
73
- .btn-size-large();
74
- font-size: @text-font-size;
75
- }
76
- }
77
-
78
- // 尺寸变体
79
- &-sm {
80
- .btn-size-small();
81
- padding: @padding;
82
- }
83
- &-lg {
84
- .btn-size-large();
85
- padding: @padding;
86
- }
87
-
88
- // 主要按钮
89
- &-primary {
90
- .btn-disabled-primary();
91
- .generate-btn-disabled(@bg, @color, @border);
92
-
93
- &:hover,
94
- &:focus {
95
- background-color: #225fdb;
96
- }
97
- }
98
-
99
- // 次要按钮
100
- &-secondary {
101
- border-color: @primary-color;
102
- color: @primary-color;
103
-
104
- &:hover,
105
- &:focus {
106
- background-color: fade(@primary-color, 10%);
107
- }
108
-
109
- .btn-disabled-secondary-tertiary();
110
- .generate-btn-disabled(@bg, @color, @border);
111
- }
112
-
113
- // 三级按钮
114
- &-tertiary {
115
- background-color: #f3f3f3;
116
- border-color: @border-color-base;
117
-
118
- &:hover,
119
- &:focus {
120
- background-color: fade(@primary-color, 10%);
121
- border-color: @primary-color;
122
- color: @primary-color;
123
- }
6
+ .ant-btn {
7
+ display: inline-flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
11
+ padding: 0;
12
+
13
+ .apply-btn-size(4px 16px; 14px; 16px; 8px);
14
+
15
+ &-sm {
16
+ .apply-btn-size(2px 12px; 12px; 12px; 2px);
17
+ }
18
+
19
+ &-lg {
20
+ .apply-btn-size(3px 40px; 14px; 18px; 8px);
21
+ }
22
+
23
+ &-circle {
24
+ padding-inline: 0;
25
+ border-radius: 50%;
26
+ }
27
+
28
+
29
+ // 主按钮
30
+ &-primary {
31
+ .btn-hover-variant(#fff; #225fdb; #225fdb);
32
+ .generate-btn-disabled(@disabled-color; #f9f9f9; @disabled-color);
33
+ }
34
+
35
+ // 次按钮
36
+ &-secondary {
37
+ color: @primary-color;
38
+ border-color: @primary-color;
39
+
40
+ .btn-hover-variant(@primary-color; fade(@primary-color, 10%); @primary-color);
41
+ .generate-btn-disabled(@primary-color-disabled; @disabled-color; @border-color-base);
42
+ }
43
+
44
+ // 三级按钮
45
+ &-tertiary {
46
+ background-color: #f3f3f3;
47
+ border-color: @border-color-base;
48
+
49
+ .btn-hover-variant(@primary-color; fade(@primary-color, 10%); @primary-color);
50
+ .generate-btn-disabled(@primary-color-disabled; @disabled-color; @border-color-base);
51
+ }
52
+
53
+ // 默认按钮
54
+ &-default {
55
+ .generate-btn-disabled(transparent; @disabled-color; @border-color-base);
56
+ }
57
+ }
124
58
 
125
- .btn-disabled-secondary-tertiary();
126
- .generate-btn-disabled(@bg, @color, @border);
127
- }
128
59
 
129
- // 默认按钮
130
- &-default {
131
- .btn-disabled-default();
132
- .generate-btn-disabled(@bg, @color, @border);
133
- }
134
- }
@@ -1,47 +1,39 @@
1
- .btn-size-small() {
2
- @padding: 2px 12px;
3
- @icon-font-size: 12px;
4
- @text-font-size: 12px;
5
- @icon-text-margin: 2px;
6
- }
7
- .btn-size-middle() {
8
- @padding: 4px 16px;
9
- @icon-font-size: 16px;
10
- @text-font-size: 14px;
11
- @icon-text-margin: 8px;
12
- }
13
- .btn-size-large() {
14
- @padding: 3px 40px;
15
- @icon-font-size: 18px;
16
- @text-font-size: 14px;
17
- @icon-text-margin: 8px;
18
- }
1
+ // ===================== 按钮尺寸处理 =====================
2
+ .apply-btn-size(@padding; @font-size; @icon-size: 16px; @gap: 8px) {
3
+ padding: @padding;
4
+ font-size: @font-size;
19
5
 
20
- // 禁用状态配置(同样用混入)
21
- .btn-disabled-primary() {
22
- @bg: @disabled-color;
23
- @color: #F9F9F9;
24
- @border: @disabled-color;
25
- }
26
- .btn-disabled-secondary-tertiary() {
27
- @bg: @primary-color-disabled;
28
- @color: @disabled-color;
29
- @border: @border-color-base;
6
+ .anticon {
7
+ font-size: @icon-size;
8
+ + span {
9
+ margin-left: @gap;
10
+ }
11
+ }
30
12
  }
31
- .btn-disabled-default() {
32
- @bg: transparent;
33
- @color: @disabled-color;
34
- @border: @border-color-base;
13
+
14
+ // ===================== 禁用状态生成器 =====================
15
+ // 参数: 背景色, 文字颜色, 边框颜色
16
+ .generate-btn-disabled(@bg; @color; @border) {
17
+ &[disabled],
18
+ &[disabled]:hover,
19
+ &[disabled]:active,
20
+ &[disabled]:focus {
21
+ color: @color;
22
+ background: @bg;
23
+ border-color: @border;
24
+ cursor: not-allowed;
25
+ opacity: 1;
26
+ box-shadow: none;
27
+ text-shadow: none;
28
+ }
35
29
  }
36
30
 
37
- // ===================== 工具混入 =====================
38
- .generate-btn-disabled(@bg, @color, @border) {
39
- &[disabled],
40
- &[disabled]:hover {
41
- background: @bg;
42
- color: @color;
43
- border-color: @border;
44
- cursor: not-allowed;
45
- opacity: 1;
46
- }
31
+ // ===================== 交互状态快捷配置 =====================
32
+ .btn-hover-variant(@color; @bg; @border) {
33
+ &:hover,
34
+ &:focus {
35
+ color: @color;
36
+ background: @bg;
37
+ border-color: @border;
38
+ }
47
39
  }
@@ -16,28 +16,70 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
16
16
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
17
17
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
18
18
  import React from 'react';
19
- import { globalConfig } from 'antd/es/config-provider';
20
- import classNames from 'classnames';
21
19
  import { isEqual, pick } from 'lodash-es';
22
20
  import "./style";
21
+ import { ConfigConsumer } from 'antd/lib/config-provider/context';
22
+ import clsx from 'clsx';
23
23
  var Collapsible = /*#__PURE__*/function (_React$Component) {
24
24
  _inherits(Collapsible, _React$Component);
25
25
  var _super = _createSuper(Collapsible);
26
- // public cssClasses = {
27
- // PREFIX: 'ant-collapsible',
28
- // TRANSITION: 'ant-collapsible-transition',
29
- // WRAPPER: 'ant-collapsible-wrapper',
30
- // };
31
-
32
26
  function Collapsible(_props) {
33
27
  var _this;
34
28
  _classCallCheck(this, Collapsible);
35
29
  _this = _super.call(this, _props);
36
- _defineProperty(_assertThisInitialized(_this), "prefixCls", 'collapsible');
37
30
  _defineProperty(_assertThisInitialized(_this), "foundation", void 0);
38
31
  _defineProperty(_assertThisInitialized(_this), "domRef", /*#__PURE__*/React.createRef());
39
32
  _defineProperty(_assertThisInitialized(_this), "resizeObserver", null);
40
33
  _defineProperty(_assertThisInitialized(_this), "hasBeenRendered", false);
34
+ _defineProperty(_assertThisInitialized(_this), "renderCollapsible", function (_ref) {
35
+ var getPrefixCls = _ref.getPrefixCls;
36
+ var _this$props = _this.props,
37
+ isOpen = _this$props.isOpen,
38
+ collapseHeight = _this$props.collapseHeight,
39
+ fade = _this$props.fade,
40
+ motion = _this$props.motion,
41
+ duration = _this$props.duration,
42
+ style = _this$props.style,
43
+ className = _this$props.className,
44
+ id = _this$props.id,
45
+ keepDOM = _this$props.keepDOM,
46
+ lazyRender = _this$props.lazyRender,
47
+ onMotionEnd = _this$props.onMotionEnd,
48
+ customizePrefixCls = _this$props.prefixCls;
49
+ var _this$state = _this.state,
50
+ domHeight = _this$state.domHeight,
51
+ isTransitioning = _this$state.isTransitioning,
52
+ visible = _this$state.visible;
53
+ var prefixCls = getPrefixCls('splitter', customizePrefixCls);
54
+ var wrapperStyle = _objectSpread({
55
+ overflow: 'hidden',
56
+ height: isOpen ? domHeight : collapseHeight,
57
+ opacity: isOpen || !fade || collapseHeight !== 0 ? 1 : 0,
58
+ transitionDuration: "".concat(motion && isTransitioning ? duration : 0, "ms")
59
+ }, style);
60
+ var wrapperCls = clsx("".concat(prefixCls, "-wrapper"), _defineProperty({}, "".concat(prefixCls, "-transition"), motion && isTransitioning), className);
61
+ var shouldRender = keepDOM && (lazyRender ? _this.hasBeenRendered : true) || collapseHeight !== 0 || visible || isOpen;
62
+ if (shouldRender && !_this.hasBeenRendered) {
63
+ _this.hasBeenRendered = true;
64
+ }
65
+ return /*#__PURE__*/React.createElement("div", _extends({
66
+ className: wrapperCls,
67
+ style: wrapperStyle,
68
+ onTransitionEnd: function onTransitionEnd() {
69
+ if (!isOpen) {
70
+ _this.foundation.updateVisible(false);
71
+ }
72
+ _this.foundation.updateIsTransitioning(false);
73
+ onMotionEnd === null || onMotionEnd === void 0 || onMotionEnd();
74
+ }
75
+ }, _this.getDataAttr(_this.props)), /*#__PURE__*/React.createElement("div", {
76
+ ref: _this.domRef,
77
+ style: {
78
+ overflow: 'hidden'
79
+ },
80
+ id: id
81
+ }, shouldRender && _this.props.children));
82
+ });
41
83
  _defineProperty(_assertThisInitialized(_this), "handleResize", function (entryList) {
42
84
  var entry = entryList[0];
43
85
  if (entry) {
@@ -68,7 +110,6 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
68
110
  isTransitioning: false,
69
111
  cacheIsOpen: _this.props.isOpen || false
70
112
  };
71
- _this.prefixCls = "".concat(globalConfig().getPrefixCls(_this.prefixCls));
72
113
  _this.foundation = {
73
114
  updateDOMInRenderTree: function updateDOMInRenderTree(val) {
74
115
  return _this.setState({
@@ -96,6 +137,7 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
96
137
  _createClass(Collapsible, [{
97
138
  key: "componentDidMount",
98
139
  value: function componentDidMount() {
140
+ // eslint-disable-next-line compat/compat
99
141
  this.resizeObserver = new ResizeObserver(this.handleResize);
100
142
  if (this.domRef.current) {
101
143
  this.resizeObserver.observe(this.domRef.current);
@@ -134,51 +176,7 @@ var Collapsible = /*#__PURE__*/function (_React$Component) {
134
176
  }, {
135
177
  key: "render",
136
178
  value: function render() {
137
- var _this3 = this;
138
- var _this$props = this.props,
139
- isOpen = _this$props.isOpen,
140
- collapseHeight = _this$props.collapseHeight,
141
- fade = _this$props.fade,
142
- motion = _this$props.motion,
143
- duration = _this$props.duration,
144
- style = _this$props.style,
145
- className = _this$props.className,
146
- id = _this$props.id,
147
- keepDOM = _this$props.keepDOM,
148
- lazyRender = _this$props.lazyRender,
149
- onMotionEnd = _this$props.onMotionEnd;
150
- var _this$state = this.state,
151
- domHeight = _this$state.domHeight,
152
- isTransitioning = _this$state.isTransitioning,
153
- visible = _this$state.visible;
154
- var wrapperStyle = _objectSpread({
155
- overflow: 'hidden',
156
- height: isOpen ? domHeight : collapseHeight,
157
- opacity: isOpen || !fade || collapseHeight !== 0 ? 1 : 0,
158
- transitionDuration: "".concat(motion && isTransitioning ? duration : 0, "ms")
159
- }, style);
160
- var wrapperCls = classNames("".concat(this.prefixCls, "-wrapper"), _defineProperty({}, "".concat(this.prefixCls, "-transition"), motion && isTransitioning), className);
161
- var shouldRender = keepDOM && (lazyRender ? this.hasBeenRendered : true) || collapseHeight !== 0 || visible || isOpen;
162
- if (shouldRender && !this.hasBeenRendered) {
163
- this.hasBeenRendered = true;
164
- }
165
- return /*#__PURE__*/React.createElement("div", _extends({
166
- className: wrapperCls,
167
- style: wrapperStyle,
168
- onTransitionEnd: function onTransitionEnd() {
169
- if (!isOpen) {
170
- _this3.foundation.updateVisible(false);
171
- }
172
- _this3.foundation.updateIsTransitioning(false);
173
- onMotionEnd === null || onMotionEnd === void 0 || onMotionEnd();
174
- }
175
- }, this.getDataAttr(this.props)), /*#__PURE__*/React.createElement("div", {
176
- ref: this.domRef,
177
- style: {
178
- overflow: 'hidden'
179
- },
180
- id: id
181
- }, shouldRender && this.props.children));
179
+ return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderCollapsible);
182
180
  }
183
181
  }], [{
184
182
  key: "getDerivedStateFromProps",
@@ -4,8 +4,8 @@ import { EllipsisOutlined } from '@ant-design/icons';
4
4
  import { Button } from "./..";
5
5
  import { Divider, Dropdown, Menu } from 'antd';
6
6
  import { globalConfig } from 'antd/es/config-provider';
7
- import classNames from 'classnames';
8
7
  import "./style";
8
+ import clsx from 'clsx';
9
9
  var CollapsibleActionItems = function CollapsibleActionItems(props) {
10
10
  var actionItems = props.actionItems,
11
11
  _props$maxCount = props.maxCount,
@@ -53,7 +53,7 @@ var CollapsibleActionItems = function CollapsibleActionItems(props) {
53
53
  return getActionItemNode(item, true);
54
54
  })) : null;
55
55
  return /*#__PURE__*/React.createElement("div", {
56
- className: classNames(prefixCls, className),
56
+ className: clsx(prefixCls, className),
57
57
  style: style
58
58
  }, displayAction.map(function (actionItem, index) {
59
59
  var showDivider = index < actionItems.length - 1;
package/esm/flex/index.js CHANGED
@@ -16,7 +16,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
16
16
  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; }
17
17
  import React from 'react';
18
18
  import { ConfigContext, globalConfig } from 'antd/es/config-provider';
19
- import clsx from 'classnames';
19
+ import clsx from 'clsx';
20
20
  import { omit } from 'lodash-es';
21
21
  import "./style";
22
22
  import { isPresetSize } from "../_util/gapSize";
@@ -1,77 +1,77 @@
1
- @import '../../style/themes/index.less';
2
-
3
- @flex-prefix-cls: ~'@{ant-prefix}-flex';
4
-
5
- // 属性与值的映射
6
- @align-items-values: {
7
- stretch: stretch;
8
- flex-start: flex-start;
9
- center: center;
10
- flex-end: flex-end;
11
- baseline: baseline;
12
- };
13
-
14
- @justify-content-values: {
15
- flex-start: flex-start;
16
- center: center;
17
- flex-end: flex-end;
18
- space-between: space-between;
19
- space-around: space-around;
20
- space-evenly: space-evenly;
21
- };
22
-
23
- @flex-wrap-values: {
24
- nowrap: nowrap;
25
- wrap: wrap;
26
- wrap-reverse: wrap-reverse;
27
- };
28
-
29
- .@{flex-prefix-cls} {
30
- display: flex;
31
- margin: 0;
32
- padding: 0;
33
-
34
- // 方向
35
- &-vertical {
36
- flex-direction: column;
37
- }
38
- &-rtl {
39
- direction: rtl;
40
- }
41
- &:empty {
42
- display: none;
43
- }
44
-
45
- // 间距 (Gap)
46
- &-gap-small {
47
- gap: @padding-xs;
48
- }
49
- &-gap-middle {
50
- gap: @padding-md;
51
- }
52
- &-gap-large {
53
- gap: @padding-lg;
54
- }
55
-
56
- // 使用 Loops/Each 抽象重复代码
57
- // flex-wrap
58
- each(@flex-wrap-values, .(@value, @key) {
59
- &-wrap-@{key} {
60
- flex-wrap: @value;
61
- }
62
- });
63
-
64
- // align-items
65
- each(@align-items-values, .(@value, @key) {
66
- &-align-@{key} {
67
- align-items: @value;
68
- }
69
- });
70
-
71
- // justify-content
72
- each(@justify-content-values, .(@value, @key) {
73
- &-justify-@{key} {
74
- justify-content: @value;
75
- }
76
- });
1
+ @import '../../style/themes/index.less';
2
+
3
+ @flex-prefix-cls: ~'@{ant-prefix}-flex';
4
+
5
+ // 属性与值的映射
6
+ @align-items-values: {
7
+ stretch: stretch;
8
+ flex-start: flex-start;
9
+ center: center;
10
+ flex-end: flex-end;
11
+ baseline: baseline;
12
+ };
13
+
14
+ @justify-content-values: {
15
+ flex-start: flex-start;
16
+ center: center;
17
+ flex-end: flex-end;
18
+ space-between: space-between;
19
+ space-around: space-around;
20
+ space-evenly: space-evenly;
21
+ };
22
+
23
+ @flex-wrap-values: {
24
+ nowrap: nowrap;
25
+ wrap: wrap;
26
+ wrap-reverse: wrap-reverse;
27
+ };
28
+
29
+ .@{flex-prefix-cls} {
30
+ display: flex;
31
+ margin: 0;
32
+ padding: 0;
33
+
34
+ // 方向
35
+ &-vertical {
36
+ flex-direction: column;
37
+ }
38
+ &-rtl {
39
+ direction: rtl;
40
+ }
41
+ &:empty {
42
+ display: none;
43
+ }
44
+
45
+ // 间距 (Gap)
46
+ &-gap-small {
47
+ gap: @padding-xs;
48
+ }
49
+ &-gap-middle {
50
+ gap: @padding-md;
51
+ }
52
+ &-gap-large {
53
+ gap: @padding-lg;
54
+ }
55
+
56
+ // 使用 Loops/Each 抽象重复代码
57
+ // flex-wrap
58
+ each(@flex-wrap-values, .(@value, @key) {
59
+ &-wrap-@{key} {
60
+ flex-wrap: @value;
61
+ }
62
+ });
63
+
64
+ // align-items
65
+ each(@align-items-values, .(@value, @key) {
66
+ &-align-@{key} {
67
+ align-items: @value;
68
+ }
69
+ });
70
+
71
+ // justify-content
72
+ each(@justify-content-values, .(@value, @key) {
73
+ &-justify-@{key} {
74
+ justify-content: @value;
75
+ }
76
+ });
77
77
  }
package/esm/flex/utils.js CHANGED
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import clsx from 'classnames';
7
+ import clsx from 'clsx';
8
8
  export var flexWrapValues = ['wrap', 'nowrap', 'wrap-reverse'];
9
9
  export var justifyContentValues = ['flex-start', 'flex-end', 'start', 'end', 'center', 'space-between', 'space-around', 'space-evenly', 'stretch', 'normal', 'left', 'right'];
10
10
  export var alignItemsValues = ['center', 'start', 'end', 'flex-start', 'flex-end', 'self-start', 'self-end', 'baseline', 'normal', 'stretch'];
@@ -14,19 +14,19 @@ import React, { useMemo } from 'react';
14
14
  import { Utils } from '@dtinsight/dt-utils';
15
15
  import { Form, Table } from 'antd';
16
16
  import { globalConfig } from 'antd/es/config-provider';
17
- import classnames from 'classnames';
17
+ import clsx from 'clsx';
18
18
  import "./style";
19
19
 
20
- /**
21
- * Override NamePath parameters type
20
+ /**
21
+ * Override NamePath parameters type
22
22
  */
23
23
 
24
- /**
25
- * Override PanelRender type
24
+ /**
25
+ * Override PanelRender type
26
26
  */
27
27
 
28
- /**
29
- * Form.Table 组件类型
28
+ /**
29
+ * Form.Table 组件类型
30
30
  */
31
31
 
32
32
  export default function InternalTable(_ref) {
@@ -85,9 +85,11 @@ export default function InternalTable(_ref) {
85
85
  return _typeof(rule) === 'object' && rule.required;
86
86
  }));
87
87
  return _objectSpread(_objectSpread({}, cols), {}, {
88
- title: /*#__PURE__*/React.createElement(React.Fragment, null, isRequired && /*#__PURE__*/React.createElement("span", {
89
- className: "dtc-form__table__column--required"
90
- }), cols.title),
88
+ title: function title() {
89
+ return /*#__PURE__*/React.createElement(React.Fragment, null, isRequired && /*#__PURE__*/React.createElement("span", {
90
+ className: "dtc-form__table__column--required"
91
+ }), typeof cols.title === 'function' ? cols.title.apply(cols, arguments) : cols.title);
92
+ },
91
93
  render: function render(_, fieldData) {
92
94
  var currentNamePath = [fieldData.name, cols.dataIndex].filter(Utils.checkExist).flat();
93
95
  var rules = rawRules === null || rawRules === void 0 ? void 0 : rawRules.map(function (rule) {
@@ -124,7 +126,7 @@ export default function InternalTable(_ref) {
124
126
  initialValue: initialValue
125
127
  }, function (fields, ope, meta) {
126
128
  return /*#__PURE__*/React.createElement(Table, _extends({
127
- className: classnames(prefixCls, tableClassName),
129
+ className: clsx(prefixCls, tableClassName),
128
130
  rowKey: "key",
129
131
  dataSource: fields,
130
132
  pagination: false,