@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/AutoBox/index.js +72 -85
  2. package/AutoTips/index.js +72 -95
  3. package/Badge/index.js +17 -16
  4. package/Breadcrumbs/index.js +57 -73
  5. package/Button/index.js +89 -117
  6. package/ButtonGroup/index.js +30 -33
  7. package/Carousel/index.js +29 -33
  8. package/Cascader/index.js +7 -9
  9. package/Checkbox/index.js +28 -35
  10. package/CheckboxGroup/index.js +43 -58
  11. package/Collapse/index.js +52 -49
  12. package/CollapseBox/index.js +65 -70
  13. package/CollapseLayout/index.js +106 -101
  14. package/ColorPicker/index.js +3 -3
  15. package/ComboSelect/index.js +242 -330
  16. package/Container/index.js +17 -21
  17. package/CopyText/index.js +50 -83
  18. package/DatePicker/index.js +22 -27
  19. package/Descriptions/index.js +50 -59
  20. package/Desktop/index.js +161 -180
  21. package/DragVerify/index.js +77 -113
  22. package/Drawer/index.js +80 -95
  23. package/Dropdown/index.js +3 -3
  24. package/DynamicMultiBox/index.js +219 -224
  25. package/DynamicMultiBox/interface.d.ts +7 -0
  26. package/Empty/index.js +26 -28
  27. package/Form/index.js +66 -74
  28. package/FormItem/index.js +14 -15
  29. package/FunctionModal/index.js +7 -14
  30. package/GlobalContext/index.js +17 -20
  31. package/Help/index.js +9 -12
  32. package/HelperText/index.js +11 -11
  33. package/InputLang/index.js +104 -124
  34. package/InputNumber/index.js +62 -81
  35. package/Label/index.js +19 -21
  36. package/Loading/index.js +11 -10
  37. package/Menu/index.js +302 -371
  38. package/Message/index.js +104 -113
  39. package/Modal/index.js +122 -148
  40. package/MultiBox/index.d.ts +5 -0
  41. package/MultiBox/index.js +111 -115
  42. package/Notification/index.js +105 -103
  43. package/OperateBtn/index.d.ts +3 -0
  44. package/OperateBtn/index.js +77 -107
  45. package/PageHeader/index.js +327 -406
  46. package/Pagination/index.js +107 -137
  47. package/ParauiProvider/index.js +20 -22
  48. package/PasswordRules/index.js +36 -40
  49. package/PopConfirm/index.js +60 -77
  50. package/Popover/index.js +12 -12
  51. package/Progress/index.js +72 -74
  52. package/Querying/index.js +22 -23
  53. package/README.md +2 -0
  54. package/Radio/index.js +27 -34
  55. package/RadioGroup/index.js +38 -52
  56. package/Search/index.js +34 -43
  57. package/Select/index.js +281 -345
  58. package/SelectInput/index.js +8 -13
  59. package/Selector/index.js +905 -796
  60. package/SelectorPicker/index.js +111 -133
  61. package/SingleBox/index.d.ts +5 -0
  62. package/SingleBox/index.js +92 -88
  63. package/Slider/index.js +46 -57
  64. package/Status/index.js +14 -13
  65. package/Stepper/index.js +25 -26
  66. package/Styles/theme.scss +9 -9
  67. package/Switch/index.js +32 -35
  68. package/Table/index.js +767 -963
  69. package/Tabs/index.js +102 -102
  70. package/Tag/index.js +115 -162
  71. package/TextEditor/index.js +81 -103
  72. package/TextField/index.js +142 -183
  73. package/TimePicker/index.js +27 -28
  74. package/Timeline/index.js +67 -58
  75. package/Title/index.js +32 -34
  76. package/ToggleButton/index.js +53 -52
  77. package/Tooltip/index.js +79 -82
  78. package/Transfer/index.js +159 -201
  79. package/Tree/index.js +7 -12
  80. package/Upload/index.js +523 -758
  81. package/Upload/interface.d.ts +2 -0
  82. package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
  83. package/_verture/{index-5a7e2438.js → index-0ced30f7.js} +1127 -1079
  84. package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
  85. package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
  86. package/_verture/index-da9097d3.js +239 -0
  87. package/_verture/{index-9331b116.js → index-ef1235fb.js} +125 -134
  88. package/_verture/{index-b1f80962.js → index-f186b5e8.js} +314 -398
  89. package/_verture/intl-f2f27722.js +69 -0
  90. package/_verture/{modalContext-736ff215.js → modalContext-5df08980.js} +36 -64
  91. package/_verture/{slicedToArray-a8206399.js → slicedToArray-8223a2ef.js} +15 -2
  92. package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
  93. package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
  94. package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
  95. package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
  96. package/_verture/{utils-418da0a4.js → utils-46e99c9a.js} +34 -25
  97. package/index.js +21 -22
  98. package/locale/index.js +6 -6
  99. package/package.json +1 -1
  100. package/umd/AutoBox.js +9 -8
  101. package/umd/AutoTips.js +9 -8
  102. package/umd/Badge.js +1 -1
  103. package/umd/Breadcrumbs.js +9 -8
  104. package/umd/Button.js +9 -8
  105. package/umd/ButtonGroup.js +9 -8
  106. package/umd/Carousel.js +5 -5
  107. package/umd/Cascader.js +9 -8
  108. package/umd/Checkbox.js +9 -8
  109. package/umd/CheckboxGroup.js +9 -8
  110. package/umd/Collapse.js +8 -7
  111. package/umd/CollapseBox.js +1 -1
  112. package/umd/CollapseLayout.js +4 -4
  113. package/umd/ColorPicker.js +1 -1
  114. package/umd/ComboSelect.js +9 -8
  115. package/umd/Container.js +1 -1
  116. package/umd/CopyText.js +9 -8
  117. package/umd/DatePicker.js +9 -8
  118. package/umd/Descriptions.js +9 -8
  119. package/umd/Desktop.js +9 -8
  120. package/umd/DragVerify.js +4 -4
  121. package/umd/Drawer.js +9 -8
  122. package/umd/Dropdown.js +6 -5
  123. package/umd/DynamicMultiBox.js +11 -10
  124. package/umd/Empty.js +1 -1
  125. package/umd/Form.js +9 -8
  126. package/umd/FormItem.js +9 -8
  127. package/umd/FunctionModal.js +9 -8
  128. package/umd/GlobalContext.js +1 -1
  129. package/umd/Help.js +9 -8
  130. package/umd/HelperText.js +1 -1
  131. package/umd/InputLang.js +9 -8
  132. package/umd/InputNumber.js +9 -8
  133. package/umd/Label.js +9 -8
  134. package/umd/Loading.js +4 -4
  135. package/umd/Menu.js +4 -4
  136. package/umd/Message.js +4 -4
  137. package/umd/Modal.js +9 -8
  138. package/umd/MultiBox.js +9 -8
  139. package/umd/Notification.js +8 -7
  140. package/umd/OperateBtn.js +9 -8
  141. package/umd/PageHeader.js +9 -8
  142. package/umd/Pagination.js +9 -8
  143. package/umd/ParauiProvider.js +1 -1
  144. package/umd/PasswordRules.js +4 -4
  145. package/umd/PopConfirm.js +9 -8
  146. package/umd/Popover.js +9 -8
  147. package/umd/Progress.js +5 -5
  148. package/umd/Querying.js +1 -1
  149. package/umd/Radio.js +9 -8
  150. package/umd/RadioGroup.js +9 -8
  151. package/umd/Search.js +9 -8
  152. package/umd/Select.js +9 -8
  153. package/umd/SelectInput.js +9 -8
  154. package/umd/Selector.js +9 -8
  155. package/umd/SelectorPicker.js +9 -8
  156. package/umd/SingleBox.js +9 -8
  157. package/umd/Slider.js +6 -5
  158. package/umd/Status.js +4 -4
  159. package/umd/Stepper.js +9 -8
  160. package/umd/Switch.js +9 -8
  161. package/umd/Table.js +9 -8
  162. package/umd/Tabs.js +9 -8
  163. package/umd/Tag.js +9 -8
  164. package/umd/TextEditor.js +22 -21
  165. package/umd/TextField.js +9 -8
  166. package/umd/TimePicker.js +9 -8
  167. package/umd/Timeline.js +1 -1
  168. package/umd/Title.js +9 -8
  169. package/umd/ToggleButton.js +9 -8
  170. package/umd/Tooltip.js +9 -8
  171. package/umd/Transfer.js +10 -9
  172. package/umd/Tree.js +9 -8
  173. package/umd/Upload.js +10 -9
  174. package/umd/locale.js +1 -1
  175. package/_verture/index-232d890b.js +0 -327
  176. package/_verture/index-e9007d6a.js +0 -236
  177. package/_verture/intl-5c1ec055.js +0 -81
  178. package/_verture/toConsumableArray-8f4c9589.js +0 -19
  179. package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
package/Collapse/index.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import RcCollapse from 'rc-collapse';
3
- import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
3
+ import { a as $rcPrefixCls, $ as $prefixCls } from '../_verture/constant-5317fc89.js';
4
4
  import * as React from 'react';
5
5
  import Right from '@para-ui/icons/Right';
6
6
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
7
7
 
8
- var CollapsePanelProps = function CollapsePanelProps(props) {
9
- var _props$className = props.className,
10
- className = _props$className === void 0 ? '' : _props$className,
11
- _props$showArrow = props.showArrow,
12
- showArrow = _props$showArrow === void 0 ? true : _props$showArrow;
8
+ const CollapsePanelProps = props => {
9
+ const {
10
+ className = '',
11
+ showArrow = true
12
+ } = props;
13
13
  /** 处理className */
14
- var handClass = function handClass() {
15
- var str = '';
14
+ const handClass = () => {
15
+ let str = '';
16
16
  if (className) str += className;
17
17
  if (!showArrow) str += ' collapse-panel-no-arrow';
18
18
  return str;
@@ -23,7 +23,9 @@ var CollapsePanelProps = function CollapsePanelProps(props) {
23
23
  }));
24
24
  };
25
25
 
26
- var isValidElement = React.isValidElement;
26
+ const {
27
+ isValidElement
28
+ } = React;
27
29
  function replaceElement(element, replacement, props) {
28
30
  if (!isValidElement(element)) return replacement;
29
31
  return /*#__PURE__*/React.cloneElement(element, typeof props === 'function' ? props(element.props || {}) : props);
@@ -40,9 +42,9 @@ function toArray(list) {
40
42
  }
41
43
  /** omit */
42
44
  function omit(obj, fields) {
43
- var clone = Object.assign({}, obj);
45
+ const clone = Object.assign({}, obj);
44
46
  if (Array.isArray(fields)) {
45
- fields.forEach(function (key) {
47
+ fields.forEach(key => {
46
48
  delete clone[key];
47
49
  });
48
50
  }
@@ -50,28 +52,24 @@ function omit(obj, fields) {
50
52
  }
51
53
 
52
54
  // ================== Collapse Motion ==================
53
- var getCollapsedHeight = function getCollapsedHeight() {
54
- return {
55
- height: 0,
56
- opacity: 0
57
- };
58
- };
59
- var getRealHeight = function getRealHeight(node) {
60
- var scrollHeight = node.scrollHeight;
55
+ const getCollapsedHeight = () => ({
56
+ height: 0,
57
+ opacity: 0
58
+ });
59
+ const getRealHeight = node => {
60
+ const {
61
+ scrollHeight
62
+ } = node;
61
63
  return {
62
64
  height: scrollHeight,
63
65
  opacity: 1
64
66
  };
65
67
  };
66
- var getCurrentHeight = function getCurrentHeight(node) {
67
- return {
68
- height: node ? node.offsetHeight : 0
69
- };
70
- };
71
- var skipOpacityTransition = function skipOpacityTransition(_, event) {
72
- return (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
73
- };
74
- var collapseMotion = {
68
+ const getCurrentHeight = node => ({
69
+ height: node ? node.offsetHeight : 0
70
+ });
71
+ const skipOpacityTransition = (_, event) => (event === null || event === void 0 ? void 0 : event.deadline) === true || event.propertyName === 'height';
72
+ const collapseMotion = {
75
73
  motionName: 'collapse-motion-collapse',
76
74
  onAppearStart: getCollapsedHeight,
77
75
  onEnterStart: getCollapsedHeight,
@@ -88,23 +86,26 @@ var collapseMotion = {
88
86
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-collapse {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n background-color: white;\n border-bottom: 1px solid rgb(234, 236, 241);\n}\n.paraui-v4-collapse .collapse-motion-collapse {\n overflow: hidden;\n transition: height 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), opacity 0.2s cubic-bezier(0.645, 0.045, 0.355, 1) !important;\n}\n.paraui-v4-collapse > .component-collapse-item {\n border-top: 1px solid rgb(234, 236, 241);\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-header {\n display: flex;\n align-items: center;\n padding: 10px 20px;\n color: rgb(29, 33, 38);\n cursor: pointer;\n font-weight: 700;\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-header > .collapse-svg-box {\n line-height: 0;\n margin-right: 8px;\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-header > .collapse-svg-box svg {\n color: rgb(92, 101, 115);\n font-size: 18px;\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-header > .collapse-svg-box svg:hover {\n color: rgb(46, 101, 230);\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-header > .collapse-svg-box .collapse-expand-svg {\n transition: all 0.3s, visibility 0s;\n color: rgb(92, 101, 115);\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-header > .component-collapse-extra {\n line-height: 0;\n margin-left: auto;\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-header > .component-collapse-extra svg {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-content.collapse-content-hidden {\n display: none;\n}\n.paraui-v4-collapse > .component-collapse-item > .component-collapse-content > .component-collapse-content-box {\n padding: 0 20px 10px;\n color: rgb(29, 33, 38);\n font-size: 14px;\n}\n.paraui-v4-collapse > .component-collapse-item.component-collapse-item-active > .component-collapse-header > .collapse-svg-box .collapse-expand-svg {\n transform: rotate(90deg);\n}\n.paraui-v4-collapse.paraui-v4-collapse-svg-right > .component-collapse-item > .component-collapse-header {\n padding-right: 40px;\n position: relative;\n}\n.paraui-v4-collapse.paraui-v4-collapse-svg-right > .component-collapse-item > .component-collapse-header > .collapse-svg-box {\n position: absolute;\n right: 20px;\n display: flex;\n align-items: center;\n margin-right: 0;\n}\n.paraui-v4-collapse > .component-collapse-item-disabled > .component-collapse-header {\n color: rgb(29, 33, 38);\n cursor: not-allowed;\n background-color: rgb(247, 248, 250);\n}\n.paraui-v4-collapse > .component-collapse-item-disabled > .component-collapse-header > .collapse-svg-box svg {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-collapse > .component-collapse-item-disabled > .component-collapse-header > .collapse-svg-box svg:hover {\n color: rgb(29, 33, 38);\n}\n.paraui-v4-collapse > .component-collapse-item-disabled > .component-collapse-header > .collapse-svg-box .collapse-expand-svg {\n color: rgb(92, 101, 115);\n}\n.paraui-v4-collapse > .component-collapse-item-disabled > .component-collapse-header > .component-collapse-extra svg {\n color: rgb(29, 33, 38);\n}";
89
87
  styleInject(css_248z);
90
88
 
91
- var Collapse = function Collapse(props) {
92
- var _props$className = props.className,
93
- className = _props$className === void 0 ? '' : _props$className,
94
- _props$expandIconPosi = props.expandIconPosition,
95
- expandIconPosition = _props$expandIconPosi === void 0 ? 'left' : _props$expandIconPosi;
89
+ const Collapse = props => {
90
+ const {
91
+ className = '',
92
+ expandIconPosition = 'left'
93
+ } = props;
96
94
  /** 处理字内容 */
97
- var getItems = function getItems() {
98
- var children = props.children;
99
- return toArray(children).map(function (child, index) {
95
+ const getItems = () => {
96
+ const {
97
+ children
98
+ } = props;
99
+ return toArray(children).map((child, index) => {
100
100
  var _a;
101
101
  if ((_a = child.props) === null || _a === void 0 ? void 0 : _a.disabled) {
102
- var key = child.key || String(index);
103
- var _child$props = child.props,
104
- disabled = _child$props.disabled,
105
- collapsible = _child$props.collapsible;
106
- var childProps = Object.assign(Object.assign({}, omit(child.props, ['disabled'])), {
107
- key: key,
102
+ const key = child.key || String(index);
103
+ const {
104
+ disabled,
105
+ collapsible
106
+ } = child.props;
107
+ const childProps = Object.assign(Object.assign({}, omit(child.props, ['disabled'])), {
108
+ key,
108
109
  collapsible: collapsible !== null && collapsible !== void 0 ? collapsible : disabled ? 'disabled' : undefined
109
110
  });
110
111
  return cloneElement(child, childProps);
@@ -113,10 +114,12 @@ var Collapse = function Collapse(props) {
113
114
  });
114
115
  };
115
116
  /** 处理展开图标 */
116
- var renderExpandIcon = function renderExpandIcon() {
117
- var panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
118
- var expandIcon = props.expandIcon;
119
- var icon = expandIcon ? expandIcon(panelProps) : jsx(Right, {
117
+ const renderExpandIcon = function () {
118
+ let panelProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
119
+ const {
120
+ expandIcon
121
+ } = props;
122
+ const icon = expandIcon ? expandIcon(panelProps) : jsx(Right, {
120
123
  className: "collapse-expand-svg"
121
124
  });
122
125
  return jsx("div", Object.assign({
@@ -126,14 +129,14 @@ var Collapse = function Collapse(props) {
126
129
  }));
127
130
  };
128
131
  /** 处理className */
129
- var handClass = function handClass() {
130
- var str = "".concat($prefixCls, "-collapse");
132
+ const handClass = () => {
133
+ let str = "".concat($prefixCls, "-collapse");
131
134
  if (className) str += " ".concat(className);
132
135
  if (expandIconPosition) str += " ".concat($prefixCls, "-collapse-svg-").concat(expandIconPosition);
133
136
  return str;
134
137
  };
135
138
  /** 处理过度动画 */
136
- var openMotion = Object.assign(Object.assign({}, collapseMotion), {
139
+ const openMotion = Object.assign(Object.assign({}, collapseMotion), {
137
140
  motionAppear: false,
138
141
  leavedClassName: "collapse-content-hidden"
139
142
  });
@@ -1,62 +1,58 @@
1
- import { _ as _slicedToArray } from '../_verture/slicedToArray-a8206399.js';
2
1
  import { jsx } from 'react/jsx-runtime';
3
2
  import { useRef, useState, useEffect } from 'react';
4
3
  import { Transition } from 'react-transition-group';
5
- import { g as getTransitionProps, a as getAutoHeightDuration } from '../_verture/util-7e1fb1e2.js';
6
- import { $ as $prefixCls } from '../_verture/constant-0d9802f7.js';
4
+ import { g as getTransitionProps, a as getAutoHeightDuration } from '../_verture/util-82646c4f.js';
5
+ import { $ as $prefixCls } from '../_verture/constant-5317fc89.js';
7
6
  import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
8
- import '../_verture/unsupportedIterableToArray-cb478f24.js';
9
7
 
10
8
  var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2023/4/11 14:16\n* @description 最新色卡\n*/\n.paraui-v4-collapse-box {\n transition: height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;\n width: 100%;\n overflow: hidden;\n height: 0;\n}\n.paraui-v4-collapse-box > .collapse-box-wrapper {\n display: flex;\n width: 100%;\n}\n.paraui-v4-collapse-box > .collapse-box-wrapper > .collapse-box-wrapper-inner {\n width: 100%;\n}\n.paraui-v4-collapse-box.paraui-v4-collapse-box-entered {\n overflow: visible;\n}\n.paraui-v4-collapse-box.paraui-v4-collapse-box-hidden {\n visibility: hidden;\n}";
11
9
  styleInject(css_248z);
12
10
 
13
- var CollapseBox = function CollapseBox(props) {
14
- var className = props.className,
15
- style = props.style,
16
- open = props.in,
17
- _props$collapsedHeigh = props.collapsedHeight,
18
- collapsedHeightProp = _props$collapsedHeigh === void 0 ? '0px' : _props$collapsedHeigh,
19
- _props$timeout = props.timeout,
20
- timeout = _props$timeout === void 0 ? 'auto' : _props$timeout,
21
- unmountOnExit = props.unmountOnExit,
22
- _children = props.children;
11
+ const CollapseBox = props => {
12
+ const {
13
+ className,
14
+ style,
15
+ in: open,
16
+ collapsedHeight: collapsedHeightProp = '0px',
17
+ timeout = 'auto',
18
+ unmountOnExit,
19
+ children
20
+ } = props;
23
21
  // timer
24
- var timer = useRef(null);
22
+ const timer = useRef(null);
25
23
  // 动画节点
26
- var nodeRef = useRef(null);
24
+ const nodeRef = useRef(null);
27
25
  // 内置容器
28
- var wrapperRef = useRef(null);
26
+ const wrapperRef = useRef(null);
29
27
  // 存储动画时间变量
30
- var autoTransitionDuration = useRef(null);
28
+ const autoTransitionDuration = useRef(null);
31
29
  // 下拉收起的高度
32
- var collapsedHeight = typeof collapsedHeightProp === 'number' ? "".concat(collapsedHeightProp, "px") : collapsedHeightProp;
33
- var _useState = useState(false),
34
- _useState2 = _slicedToArray(_useState, 2),
35
- inProp = _useState2[0],
36
- setInProp = _useState2[1];
37
- useEffect(function () {
38
- return function () {
30
+ const collapsedHeight = typeof collapsedHeightProp === 'number' ? "".concat(collapsedHeightProp, "px") : collapsedHeightProp;
31
+ const [inProp, setInProp] = useState(false);
32
+ useEffect(() => {
33
+ return () => {
39
34
  clearTimeout(timer.current);
40
35
  };
41
36
  }, []);
42
- useEffect(function () {
37
+ useEffect(() => {
43
38
  setInProp(open);
44
39
  }, [open]);
45
40
  // 下拉
46
- var handleEnter = function handleEnter(node) {
41
+ const handleEnter = node => {
47
42
  node.style.height = collapsedHeight;
48
43
  };
49
- var handleEntering = function handleEntering(node) {
50
- var wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
51
- var _getTransitionProps = getTransitionProps({
52
- style: style,
53
- timeout: timeout
54
- }, {
55
- mode: 'enter'
56
- }),
57
- transitionDuration = _getTransitionProps.duration;
44
+ const handleEntering = node => {
45
+ const wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
46
+ const {
47
+ duration: transitionDuration
48
+ } = getTransitionProps({
49
+ style,
50
+ timeout
51
+ }, {
52
+ mode: 'enter'
53
+ });
58
54
  if (timeout === 'auto') {
59
- var duration2 = getAutoHeightDuration(wrapperHeight);
55
+ const duration2 = getAutoHeightDuration(wrapperHeight);
60
56
  node.style.transitionDuration = "".concat(duration2, "ms");
61
57
  autoTransitionDuration.current = duration2;
62
58
  } else {
@@ -64,25 +60,26 @@ var CollapseBox = function CollapseBox(props) {
64
60
  }
65
61
  node.style.height = "".concat(wrapperHeight, "px");
66
62
  };
67
- var handleEntered = function handleEntered(node) {
63
+ const handleEntered = node => {
68
64
  node.style.height = 'auto';
69
65
  };
70
66
  // 收起
71
- var handleExit = function handleExit(node) {
72
- var wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
67
+ const handleExit = node => {
68
+ const wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
73
69
  node.style.height = "".concat(wrapperHeight, "px");
74
70
  };
75
- var handleExiting = function handleExiting(node) {
76
- var wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
77
- var _getTransitionProps2 = getTransitionProps({
78
- style: style,
79
- timeout: timeout
80
- }, {
81
- mode: 'exit'
82
- }),
83
- transitionDuration = _getTransitionProps2.duration;
71
+ const handleExiting = node => {
72
+ const wrapperHeight = wrapperRef.current ? wrapperRef.current.clientHeight : 0;
73
+ const {
74
+ duration: transitionDuration
75
+ } = getTransitionProps({
76
+ style,
77
+ timeout
78
+ }, {
79
+ mode: 'exit'
80
+ });
84
81
  if (timeout === 'auto') {
85
- var duration2 = getAutoHeightDuration(wrapperHeight);
82
+ const duration2 = getAutoHeightDuration(wrapperHeight);
86
83
  node.style.transitionDuration = "".concat(duration2, "ms");
87
84
  autoTransitionDuration.current = duration2;
88
85
  } else {
@@ -91,12 +88,12 @@ var CollapseBox = function CollapseBox(props) {
91
88
  node.style.height = collapsedHeight;
92
89
  };
93
90
  // 完成下拉/收起回调
94
- var addEndListener = function addEndListener(nodeOrNext, maybeNext) {
91
+ const addEndListener = (nodeOrNext, maybeNext) => {
95
92
  timer.current = setTimeout(maybeNext, autoTransitionDuration.current || 0);
96
93
  };
97
94
  // 处理className
98
- var handClass = function handClass(state) {
99
- var str = "".concat($prefixCls, "-collapse-box");
95
+ const handClass = state => {
96
+ let str = "".concat($prefixCls, "-collapse-box");
100
97
  if (className) str += " ".concat(className);
101
98
  if (state === 'entered') str += " ".concat($prefixCls, "-collapse-box-entered");
102
99
  if (state === 'exited' && !inProp && collapsedHeight === '0px') str += " ".concat($prefixCls, "-collapse-box-hidden");
@@ -114,26 +111,24 @@ var CollapseBox = function CollapseBox(props) {
114
111
  timeout: timeout === 'auto' ? undefined : timeout,
115
112
  addEndListener: addEndListener
116
113
  }, {
117
- children: function children(state, childProps) {
118
- return jsx("div", Object.assign({
119
- className: handClass(state),
120
- style: Object.assign({
121
- minHeight: collapsedHeight
122
- }, style),
123
- ref: nodeRef
124
- }, childProps, {
114
+ children: (state, childProps) => jsx("div", Object.assign({
115
+ className: handClass(state),
116
+ style: Object.assign({
117
+ minHeight: collapsedHeight
118
+ }, style),
119
+ ref: nodeRef
120
+ }, childProps, {
121
+ children: jsx("div", Object.assign({
122
+ className: 'collapse-box-wrapper',
123
+ ref: wrapperRef
124
+ }, {
125
125
  children: jsx("div", Object.assign({
126
- className: 'collapse-box-wrapper',
127
- ref: wrapperRef
126
+ className: 'collapse-box-wrapper-inner'
128
127
  }, {
129
- children: jsx("div", Object.assign({
130
- className: 'collapse-box-wrapper-inner'
131
- }, {
132
- children: _children
133
- }))
128
+ children: children
134
129
  }))
135
- }));
136
- }
130
+ }))
131
+ }))
137
132
  }));
138
133
  };
139
134