@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
@@ -0,0 +1,69 @@
1
+ // 实现 get 方法
2
+ // 支持对象和数组/支持默认值/支持路径/支持字符串模版变量/支持jsx/支持.运算符和[]运算符
3
+ const get = (obj, path, defaultValue) => {
4
+ const pathArr = path.replace(/\[(\d+)\]/g, '.$1').split('.');
5
+ let result = obj;
6
+ for (const p of pathArr) {
7
+ result = Object(result)[p];
8
+ if (result === undefined) {
9
+ return defaultValue;
10
+ }
11
+ }
12
+ return result;
13
+ };
14
+ /**
15
+ * 替换字符串模版变量
16
+ * @param str
17
+ * @param vars
18
+ */
19
+ const replaceStrTemplateVars = (str, vars) => {
20
+ if (!vars) return str;
21
+ str = str.replace(/\"/g, '\\"');
22
+ // 模版字符串正则
23
+ const strTemplateReg = /({[^{}]+})/g;
24
+ const parts = str.split(strTemplateReg);
25
+ return parts.map(part => {
26
+ if (part.match(strTemplateReg)) {
27
+ const key = part.replace(/({|})/g, '');
28
+ const val = get(vars, key);
29
+ return val === undefined ? key : val;
30
+ }
31
+ return part;
32
+ });
33
+ };
34
+ /**
35
+ * 国际化获取方法
36
+ * @param ops 国际化取值key参数
37
+ * @param i18nData 国际化数据对象
38
+ * @param params 国际化字符变量对象
39
+ * @param lang 指定国际化语言
40
+ * @param defI18nData 默认国际化数据对象
41
+ */
42
+ const i18nIntl = props => {
43
+ var _a, _b;
44
+ const {
45
+ ops,
46
+ i18nData,
47
+ lang,
48
+ params,
49
+ defI18nData
50
+ } = props;
51
+ let text, key;
52
+ if (typeof ops === 'string') {
53
+ key = ops;
54
+ } else if (typeof ops === 'object') {
55
+ if (typeof ops.id !== 'string') return 'i18n intl object "id" is missing';
56
+ key = ops.id;
57
+ }
58
+ if (key !== undefined) {
59
+ text = (_a = i18nData[lang]) === null || _a === void 0 ? void 0 : _a[key];
60
+ if (text === undefined && defI18nData) {
61
+ // 尝试从默认国际化数据获取
62
+ text = (_b = defI18nData[lang]) === null || _b === void 0 ? void 0 : _b[key];
63
+ }
64
+ }
65
+ if (typeof text !== 'string') return "{".concat(key, "}");
66
+ return replaceStrTemplateVars(text, params);
67
+ };
68
+
69
+ export { i18nIntl as i };
@@ -1,6 +1,3 @@
1
- import { _ as _toConsumableArray } from './toConsumableArray-8f4c9589.js';
2
- import { _ as _slicedToArray } from './slicedToArray-a8206399.js';
3
- import { r as regenerator } from './index-232d890b.js';
4
1
  import { a as __awaiter } from './tslib.es6-55ed4bd2.js';
5
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
6
3
  import React__default from 'react';
@@ -58,7 +55,7 @@ var FDialog = function FDialog(props) {
58
55
  /**
59
56
  * 创建模态框的上下文
60
57
  */
61
- var FunctionModalContext = /*#__PURE__*/React__default.createContext(Promise.reject);
58
+ const FunctionModalContext = /*#__PURE__*/React__default.createContext(Promise.reject);
62
59
  /**
63
60
  * 弹出框组件
64
61
  * @param context 主体内容
@@ -66,41 +63,38 @@ var FunctionModalContext = /*#__PURE__*/React__default.createContext(Promise.rej
66
63
  * @param hideClose 隐藏右上角关闭图标 boolean 默认 false
67
64
  * @param checkFunction 检查方法,返回 boolean 值,true则关闭弹窗,false反之
68
65
  **/
69
- var useModal = function useModal() {
70
- return React__default.useContext(FunctionModalContext);
71
- };
72
- var setState;
66
+ const useModal = () => React__default.useContext(FunctionModalContext);
67
+ let setState;
73
68
  /**
74
69
  * 函数弹窗组件Provider
75
70
  */
76
- var FunctionModalProvider = function FunctionModalProvider(_ref) {
77
- var children = _ref.children;
71
+ const FunctionModalProvider = _ref => {
72
+ let {
73
+ children
74
+ } = _ref;
78
75
  // 模态框组 配置
79
- var _React$useState = React__default.useState([]),
80
- _React$useState2 = _slicedToArray(_React$useState, 2),
81
- confirmationState = _React$useState2[0],
82
- setConfirmationState = _React$useState2[1];
76
+ const [confirmationState, setConfirmationState] = React__default.useState([]);
83
77
  // 传出设置模态框数组hook,用于关闭所有弹窗
84
- setState = function setState() {
78
+ setState = () => {
85
79
  setConfirmationState([]);
86
80
  awaitingPromiseRef.current = [];
87
81
  };
88
82
  // 存储每个模态框的 promise 方法
89
- var awaitingPromiseRef = React__default.useRef([]);
83
+ const awaitingPromiseRef = React__default.useRef([]);
90
84
  /**
91
85
  * 模态框初始化方法
92
86
  * @param options 模态框配置
93
87
  * @return 返回一个promise 用于外部判断弹窗状态
94
88
  */
95
- var openConfirmation = function openConfirmation(options) {
96
- setConfirmationState(function (pre) {
89
+ const openConfirmation = options => {
90
+ setConfirmationState(pre => {
97
91
  pre.push(options);
98
- return _toConsumableArray(pre);
92
+ return [...pre];
99
93
  });
100
- return new Promise(function (resolve, reject) {
94
+ return new Promise((resolve, reject) => {
101
95
  awaitingPromiseRef.current.push({
102
- resolve: resolve,
103
- reject: reject
96
+ resolve,
97
+ reject
104
98
  });
105
99
  });
106
100
  };
@@ -109,7 +103,7 @@ var FunctionModalProvider = function FunctionModalProvider(_ref) {
109
103
  * @param idx 模态框在模态框数组里的下标,用于拿到对应的配置 和 promise
110
104
  * @description 关闭后会清空相关配置
111
105
  */
112
- var handleClose = function handleClose(idx) {
106
+ const handleClose = idx => {
113
107
  // 是否有禁用取消停止功能的配置
114
108
  if (confirmationState[idx] && !confirmationState[idx].disCatchOnCancel && awaitingPromiseRef.current[idx]) {
115
109
  awaitingPromiseRef.current[idx].resolve(false);
@@ -123,51 +117,29 @@ var FunctionModalProvider = function FunctionModalProvider(_ref) {
123
117
  * 模态框确定触发的方法
124
118
  * @param idx 模态框在模态框数组里的下标,用于拿到对应的配置 和 promise
125
119
  */
126
- var handleSubmit = function handleSubmit(idx) {
127
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
128
- var checkFuc, jude, pRef;
129
- return regenerator.wrap(function _callee$(_context) {
130
- while (1) switch (_context.prev = _context.next) {
131
- case 0:
132
- checkFuc = confirmationState && confirmationState[idx] && confirmationState[idx].checkFunction;
133
- jude = true; // 判断是否有检查方法,如果有则先执行检查方法
134
- if (!checkFuc) {
135
- _context.next = 6;
136
- break;
137
- }
138
- _context.next = 5;
139
- return checkFuc();
140
- case 5:
141
- jude = _context.sent;
142
- case 6:
143
- if (jude) {
144
- _context.next = 8;
145
- break;
146
- }
147
- return _context.abrupt("return");
148
- case 8:
149
- hideDialog(idx);
150
- pRef = awaitingPromiseRef.current[idx];
151
- deleteOption(idx, pRef);
152
- case 11:
153
- case "end":
154
- return _context.stop();
155
- }
156
- }, _callee);
157
- }));
158
- };
120
+ const handleSubmit = idx => __awaiter(void 0, void 0, void 0, function* () {
121
+ const checkFuc = confirmationState && confirmationState[idx] && confirmationState[idx].checkFunction;
122
+ let jude = true;
123
+ // 判断是否有检查方法,如果有则先执行检查方法
124
+ if (checkFuc) jude = yield checkFuc();
125
+ //根据是否有检查方法 或 检查方法的返回值判断是否关闭弹窗
126
+ if (!jude) return;
127
+ hideDialog(idx);
128
+ const pRef = awaitingPromiseRef.current[idx];
129
+ deleteOption(idx, pRef);
130
+ });
159
131
  /**
160
132
  * 删除模态框配置,promise 执行成功操作
161
133
  * @param pRef 模态框的promise
162
134
  * @param idx 模态框在模态框组里的下标
163
135
  */
164
- var deleteOption = function deleteOption(idx, pRef) {
165
- setTimeout(function () {
136
+ const deleteOption = (idx, pRef) => {
137
+ setTimeout(() => {
166
138
  pRef && pRef.resolve(true);
167
- setConfirmationState(function (pre) {
139
+ setConfirmationState(pre => {
168
140
  pre.splice(idx, 1);
169
141
  awaitingPromiseRef.current.splice(idx, 1);
170
- return _toConsumableArray(pre);
142
+ return [...pre];
171
143
  });
172
144
  }, 200);
173
145
  };
@@ -176,15 +148,15 @@ var FunctionModalProvider = function FunctionModalProvider(_ref) {
176
148
  * @param idx 模态框在模态框数组里的下标
177
149
  * @desc 解决异步导致的闪烁问题
178
150
  */
179
- var hideDialog = function hideDialog(idx) {
180
- var dialogEl = document.querySelectorAll('.function-modal .MuiDialog-container')[idx];
151
+ const hideDialog = idx => {
152
+ const dialogEl = document.querySelectorAll('.function-modal .MuiDialog-container')[idx];
181
153
  if (dialogEl) dialogEl.style.opacity = '0';
182
154
  };
183
155
  return jsxs(Fragment, {
184
156
  children: [jsx(FunctionModalContext.Provider, {
185
157
  value: openConfirmation,
186
158
  children: children
187
- }), confirmationState && confirmationState.map(function (option, idx) {
159
+ }), confirmationState && confirmationState.map((option, idx) => {
188
160
  return jsx(FDialog, Object.assign({
189
161
  listIndex: idx,
190
162
  open: Boolean(option),
@@ -194,7 +166,7 @@ var FunctionModalProvider = function FunctionModalProvider(_ref) {
194
166
  })]
195
167
  });
196
168
  };
197
- var useClose = function useClose() {
169
+ const useClose = () => {
198
170
  return setState;
199
171
  };
200
172
 
@@ -1,4 +1,17 @@
1
- import { _ as _unsupportedIterableToArray } from './unsupportedIterableToArray-cb478f24.js';
1
+ function _arrayLikeToArray(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+
7
+ function _unsupportedIterableToArray(o, minLen) {
8
+ if (!o) return;
9
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
10
+ var n = Object.prototype.toString.call(o).slice(8, -1);
11
+ if (n === "Object" && o.constructor) n = o.constructor.name;
12
+ if (n === "Map" || n === "Set") return Array.from(o);
13
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
14
+ }
2
15
 
3
16
  function _arrayWithHoles(arr) {
4
17
  if (Array.isArray(arr)) return arr;
@@ -40,4 +53,4 @@ function _slicedToArray(arr, i) {
40
53
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
41
54
  }
42
55
 
43
- export { _slicedToArray as _, _arrayWithHoles as a, _nonIterableRest as b };
56
+ export { _arrayLikeToArray as _, _unsupportedIterableToArray as a, _slicedToArray as b, _arrayWithHoles as c, _nonIterableRest as d };
@@ -6,14 +6,15 @@ import GlobalContext from '@para-ui/core/GlobalContext';
6
6
  * @date 2022/3/15 4:03 PM
7
7
  * @description 国际化钩子
8
8
  */
9
- var useFormatMessage = function useFormatMessage(comName, defI18nData) {
10
- var _React$useContext = React__default.useContext(GlobalContext),
11
- intlFormat = _React$useContext.intlFormat;
9
+ const useFormatMessage = (comName, defI18nData) => {
10
+ const {
11
+ intlFormat
12
+ } = React__default.useContext(GlobalContext);
12
13
  defI18nData.zh_CN = defI18nData.zh;
13
14
  defI18nData['zh-CN'] = defI18nData.zh;
14
15
  defI18nData.en_US = defI18nData.en;
15
16
  defI18nData['en-US'] = defI18nData.en;
16
- var intl = intlFormat && intlFormat(comName, defI18nData);
17
+ const intl = intlFormat && intlFormat(comName, defI18nData);
17
18
  return intl;
18
19
  };
19
20
 
@@ -2,9 +2,10 @@ import React__default from 'react';
2
2
  import GlobalContext from '@para-ui/core/GlobalContext';
3
3
 
4
4
  function useGlobalProps(comProps, comName) {
5
- var _React$useContext = React__default.useContext(GlobalContext),
6
- componentsProps = _React$useContext.componentsProps;
7
- var globalProps = componentsProps && componentsProps[comName];
5
+ const {
6
+ componentsProps
7
+ } = React__default.useContext(GlobalContext);
8
+ const globalProps = componentsProps && componentsProps[comName];
8
9
  return Object.assign(Object.assign({}, globalProps), comProps);
9
10
  }
10
11
 
@@ -7,17 +7,18 @@ import React__default from 'react';
7
7
  */
8
8
  //判断是否滚动元素
9
9
  function isOverflowElement(element) {
10
- var _window$getComputedSt = window.getComputedStyle(element),
11
- overflow = _window$getComputedSt.overflow,
12
- overflowX = _window$getComputedSt.overflowX,
13
- overflowY = _window$getComputedSt.overflowY;
10
+ const {
11
+ overflow,
12
+ overflowX,
13
+ overflowY
14
+ } = window.getComputedStyle(element);
14
15
  return /auto|scroll|overlay/.test(overflow + overflowY + overflowX);
15
16
  }
16
17
  //最近的祖先滚动元素
17
18
  function getNearestOverflowAncestor(node) {
18
19
  var _a, _b;
19
- var parentNode = node.parentNode || node.ownerDocument;
20
- var nodeName = ((_a = parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '';
20
+ const parentNode = node.parentNode || node.ownerDocument;
21
+ const nodeName = ((_a = parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeName) === null || _a === void 0 ? void 0 : _a.toLowerCase()) || '';
21
22
  if (['html', 'body', '#document'].includes(nodeName)) {
22
23
  return (_b = node === null || node === void 0 ? void 0 : node.ownerDocument) === null || _b === void 0 ? void 0 : _b.body;
23
24
  }
@@ -28,24 +29,24 @@ function getNearestOverflowAncestor(node) {
28
29
  }
29
30
  //渲染容器
30
31
  function usePopupContainer(wrapRef, customizeContainer) {
31
- var popupRef = React__default.useRef();
32
+ const popupRef = React__default.useRef();
32
33
  //浮层渲染容器
33
- var getPopupContainer = function getPopupContainer(triggerNode) {
34
+ const getPopupContainer = triggerNode => {
34
35
  var _a, _b, _c, _d;
35
- var container;
36
+ let container;
36
37
  if (!customizeContainer) {
37
- var rootNode = (_b = (_a = wrapRef.current) === null || _a === void 0 ? void 0 : _a.getRootDomNode) === null || _b === void 0 ? void 0 : _b.call(_a);
38
+ const rootNode = (_b = (_a = wrapRef.current) === null || _a === void 0 ? void 0 : _a.getRootDomNode) === null || _b === void 0 ? void 0 : _b.call(_a);
38
39
  if (rootNode) {
39
40
  container = getNearestOverflowAncestor(rootNode);
40
- var scrollHeight = container.scrollHeight;
41
- var clientHeight = container.clientHeight;
41
+ const scrollHeight = container.scrollHeight;
42
+ const clientHeight = container.clientHeight;
42
43
  if (scrollHeight <= clientHeight) {
43
44
  container = document.body;
44
45
  }
45
46
  } else {
46
47
  container = document.body;
47
48
  }
48
- var nodeName = (_c = container.nodeName) === null || _c === void 0 ? void 0 : _c.toLowerCase();
49
+ const nodeName = (_c = container.nodeName) === null || _c === void 0 ? void 0 : _c.toLowerCase();
49
50
  if (nodeName !== 'body') {
50
51
  if (((_d = window.getComputedStyle(container)) === null || _d === void 0 ? void 0 : _d.position) === 'static') {
51
52
  container.style.position = 'relative';
@@ -57,8 +58,8 @@ function usePopupContainer(wrapRef, customizeContainer) {
57
58
  }
58
59
  return container;
59
60
  };
60
- React__default.useEffect(function () {
61
- return function () {
61
+ React__default.useEffect(() => {
62
+ return () => {
62
63
  if (popupRef.current) popupRef.current.style.position = '';
63
64
  };
64
65
  }, []);
@@ -1,7 +1,8 @@
1
1
  function getTransitionProps(props, options) {
2
- var timeout = props.timeout,
3
- _props$style = props.style,
4
- style = _props$style === void 0 ? {} : _props$style;
2
+ const {
3
+ timeout,
4
+ style = {}
5
+ } = props;
5
6
  return {
6
7
  duration: style.transitionDuration || typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,
7
8
  delay: style.transitionDelay
@@ -11,7 +12,7 @@ function getAutoHeightDuration(height) {
11
12
  if (!height) {
12
13
  return 0;
13
14
  }
14
- var constant = height / 36;
15
+ const constant = height / 36;
15
16
  return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);
16
17
  }
17
18
 
@@ -1,53 +1,63 @@
1
- import { _ as _defineProperty } from './defineProperty-1d116156.js';
2
-
3
1
  //获取替换字段
4
- var getReplaceField = function getReplaceField(mode, repl, tableP, treeP) {
5
- var t = {};
2
+ const getReplaceField = (mode, repl, tableP, treeP) => {
3
+ let t = {};
6
4
  if (mode === 'tree') t = treeP === null || treeP === void 0 ? void 0 : treeP.replaceFields;else t = tableP === null || tableP === void 0 ? void 0 : tableP.replaceFields;
7
5
  return Object.assign(Object.assign({}, repl), t);
8
6
  };
9
7
  //to array
10
- var toArray = function toArray(list) {
8
+ const toArray = list => {
11
9
  if (!list) return [];
12
10
  return Array.isArray(list) ? list : JSON.stringify(list) === '{}' ? [] : [list];
13
11
  };
14
- var isRemoteLoad = function isRemoteLoad(mode, props) {
12
+ const isRemoteLoad = (mode, props) => {
15
13
  if (mode === 'table') {
16
14
  return !(props && Array.isArray(props.data));
17
15
  }
18
16
  return !(props && Array.isArray(props.treeData));
19
17
  };
20
- var getOverlaySize = function getOverlaySize(mode) {
21
- var isRemoteLoad = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
22
- var maxHeight = arguments.length > 2 ? arguments[2] : undefined;
23
- var height = arguments.length > 3 ? arguments[3] : undefined;
18
+ const getOverlaySize = function (mode) {
19
+ let isRemoteLoad = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
20
+ let maxHeight = arguments.length > 2 ? arguments[2] : undefined;
21
+ let height = arguments.length > 3 ? arguments[3] : undefined;
24
22
  var _a;
25
- var screenH = 720;
26
- var treeOverlay = "".concat(maxHeight || 254, "px");
27
- var listOverlay = "".concat(maxHeight || 232, "px");
23
+ const screenH = 720;
24
+ const treeOverlay = "".concat(maxHeight || 254, "px");
25
+ const listOverlay = "".concat(maxHeight || 232, "px");
28
26
  // let largeScreenH = 880;
29
- var largeTreeOverlayH = "".concat(maxHeight || 338, "px");
30
- var largeListOverlayH = "".concat(maxHeight || 304, "px");
31
- var clientH = document.documentElement.clientHeight;
32
- var fixHeight = height !== undefined ? 'height' : 'maxHeight';
27
+ const largeTreeOverlayH = "".concat(maxHeight || 338, "px");
28
+ const largeListOverlayH = "".concat(maxHeight || 304, "px");
29
+ const clientH = document.documentElement.clientHeight;
30
+ const fixHeight = height !== undefined ? 'height' : 'maxHeight';
33
31
  if (mode === 'tree') {
34
32
  //tree
35
33
  if (clientH <= screenH) {
36
34
  //小屏幕
37
35
  return isRemoteLoad ? {
38
36
  height: treeOverlay
39
- } : _defineProperty({}, fixHeight, treeOverlay);
37
+ } : {
38
+ [fixHeight]: treeOverlay
39
+ };
40
40
  }
41
41
  //大屏幕
42
42
  return isRemoteLoad ? {
43
43
  height: largeTreeOverlayH
44
- } : _defineProperty({}, fixHeight, largeTreeOverlayH);
44
+ } : {
45
+ [fixHeight]: largeTreeOverlayH
46
+ };
45
47
  } else if (mode === 'list') {
46
48
  //list
47
49
  if (clientH <= screenH) {
48
- return isRemoteLoad ? _defineProperty({}, fixHeight, listOverlay) : _defineProperty({}, fixHeight, listOverlay);
50
+ return isRemoteLoad ? {
51
+ [fixHeight]: listOverlay
52
+ } : {
53
+ [fixHeight]: listOverlay
54
+ };
49
55
  }
50
- return isRemoteLoad ? _defineProperty({}, fixHeight, largeListOverlayH) : _defineProperty({}, fixHeight, largeListOverlayH);
56
+ return isRemoteLoad ? {
57
+ [fixHeight]: largeListOverlayH
58
+ } : {
59
+ [fixHeight]: largeListOverlayH
60
+ };
51
61
  } else {
52
62
  //table
53
63
  return {
@@ -57,15 +67,14 @@ var getOverlaySize = function getOverlaySize(mode) {
57
67
  };
58
68
  // 实现一个防抖函数,debounce接受一个函数func和delay时间作为参数,返回一个防抖函数。使用泛型T保证返回防抖函数的类型与原func一致
59
69
  function debounce(func, delay) {
60
- var timer;
70
+ let timer;
61
71
  return function () {
62
- var _this = this;
63
72
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
64
73
  args[_key] = arguments[_key];
65
74
  }
66
75
  if (timer) clearTimeout(timer);
67
- timer = setTimeout(function () {
68
- func.apply(_this, args);
76
+ timer = setTimeout(() => {
77
+ func.apply(this, args);
69
78
  }, delay);
70
79
  };
71
80
  }
package/index.js CHANGED
@@ -5,13 +5,13 @@ export { Breadcrumbs } from './Breadcrumbs/index.js';
5
5
  export { Button } from './Button/index.js';
6
6
  export { ButtonGroup } from './ButtonGroup/index.js';
7
7
  export { Carousel } from './Carousel/index.js';
8
- export { C as Cascader } from './_verture/index-5a7e2438.js';
8
+ export { C as Cascader } from './_verture/index-0ced30f7.js';
9
9
  export { Checkbox } from './Checkbox/index.js';
10
10
  export { CheckboxGroup } from './CheckboxGroup/index.js';
11
11
  export { Collapse } from './Collapse/index.js';
12
12
  export { default as CollapseBox } from './CollapseBox/index.js';
13
13
  export { default as CollapseLayout } from './CollapseLayout/index.js';
14
- export { C as ChromePicker, S as ColorPicker, a as CompactPicker, b as SwatchesPicker } from './_verture/index-024bbc9b.js';
14
+ export { C as ChromePicker, S as ColorPicker, a as CompactPicker, b as SwatchesPicker } from './_verture/index-775ad32d.js';
15
15
  export { ComboSelect } from './ComboSelect/index.js';
16
16
  export { Container } from './Container/index.js';
17
17
  export { default as CopyText } from './CopyText/index.js';
@@ -20,12 +20,12 @@ export { default as Descriptions } from './Descriptions/index.js';
20
20
  export { Desktop } from './Desktop/index.js';
21
21
  export { DragVerify } from './DragVerify/index.js';
22
22
  export { Drawer } from './Drawer/index.js';
23
- export { D as Dropdown } from './_verture/index-e9007d6a.js';
23
+ export { D as Dropdown } from './_verture/index-da9097d3.js';
24
24
  export { default as DynamicMultiBox } from './DynamicMultiBox/index.js';
25
25
  export { default as Empty } from './Empty/index.js';
26
26
  export { default as Form } from './Form/index.js';
27
- export { F as FormItem } from './_verture/index-9331b116.js';
28
- export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-736ff215.js';
27
+ export { F as FormItem } from './_verture/index-ef1235fb.js';
28
+ export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-5df08980.js';
29
29
  export { default as GlobalContext, changeConfirmLocale, getConfirmLocale } from './GlobalContext/index.js';
30
30
  export { default as Help } from './Help/index.js';
31
31
  export { default as HelperText } from './HelperText/index.js';
@@ -70,32 +70,30 @@ export { Title } from './Title/index.js';
70
70
  export { ToggleButton, ToggleButtonGroup } from './ToggleButton/index.js';
71
71
  export { Tooltip } from './Tooltip/index.js';
72
72
  export { SSortablejs, Transfer } from './Transfer/index.js';
73
- export { T as Tree } from './_verture/index-b1f80962.js';
73
+ export { T as Tree } from './_verture/index-f186b5e8.js';
74
74
  export { default as Upload } from './Upload/index.js';
75
75
  export { default as locale } from './locale/index.js';
76
- import './_verture/slicedToArray-a8206399.js';
77
- import './_verture/unsupportedIterableToArray-cb478f24.js';
78
76
  import 'react/jsx-runtime';
79
77
  import 'react';
80
78
  import 'react-dom';
81
79
  import '@paraview/lib';
82
- import './_verture/constant-0d9802f7.js';
80
+ import './_verture/constant-5317fc89.js';
83
81
  import '@para-ui/icons/More';
84
82
  import './_verture/style-inject.es-300983ab.js';
85
- import './_verture/typeof-adeedc13.js';
86
83
  import 'clsx';
87
- import './_verture/toConsumableArray-8f4c9589.js';
88
84
  import '@para-ui/icons/Return';
89
- import './_verture/useFormatMessage-703f8b20.js';
85
+ import './_verture/useFormatMessage-eb13cf56.js';
90
86
  import '@para-ui/core/GlobalContext';
91
87
  import './_verture/tslib.es6-55ed4bd2.js';
92
88
  import '@para-ui/icons/LoadingF';
93
89
  import '@para-ui/icons/Down';
94
90
  import '@para-ui/icons/Forbid';
95
- import './_verture/defineProperty-1d116156.js';
96
91
  import 'react-slick';
97
92
  import '@para-ui/icons/RightCircleF';
98
93
  import '@para-ui/icons/LeftCircleF';
94
+ import './_verture/slicedToArray-8223a2ef.js';
95
+ import './_verture/defineProperty-1d116156.js';
96
+ import './_verture/typeof-adeedc13.js';
99
97
  import 'rc-motion';
100
98
  import './_verture/typeof-c310ee4a.js';
101
99
  import 'rc-tree/lib/utils/conductUtil';
@@ -105,15 +103,14 @@ import 'rc-tree/lib/utils/treeUtil';
105
103
  import '@para-ui/icons';
106
104
  import 'rc-collapse';
107
105
  import 'react-transition-group';
108
- import './_verture/util-7e1fb1e2.js';
109
- import '@para-ui/icons/DoubleLeft';
110
- import '@para-ui/icons/DoubleRight';
106
+ import './_verture/util-82646c4f.js';
107
+ import '@para-ui/icons/LeftTriangleF';
108
+ import '@para-ui/icons/RightTriangleF';
111
109
  import 'react-color';
112
- import './_verture/index-232d890b.js';
113
110
  import '@para-ui/icons/Search';
114
111
  import '@para-ui/icons/Close';
115
- import './_verture/utils-418da0a4.js';
116
- import './_verture/useGlobalProps-1b846a65.js';
112
+ import './_verture/utils-46e99c9a.js';
113
+ import './_verture/useGlobalProps-1e416658.js';
117
114
  import '@para-ui/icons/Copy';
118
115
  import '@para-ui/icons/CheckS';
119
116
  import 'rc-picker/es/generate/dayjs';
@@ -124,11 +121,12 @@ import 'rc-picker/lib/locale/en_US';
124
121
  import 'rc-picker/lib/locale/zh_CN';
125
122
  import '@para-ui/icons/SortRight';
126
123
  import '@para-ui/icons/Left';
124
+ import '@para-ui/icons/DoubleRight';
127
125
  import '@para-ui/icons/Check';
128
126
  import '@para-ui/icons/Refresh';
129
127
  import 'rc-drawer';
130
128
  import 'rc-dropdown';
131
- import './_verture/usePopupContainer-87febeb9.js';
129
+ import './_verture/usePopupContainer-635f66f4.js';
132
130
  import 'dayjs';
133
131
  import '@para-ui/icons/Panel';
134
132
  import '@para-ui/icons/PlusCircleF';
@@ -137,8 +135,8 @@ import '@para-ui/icons/Drag';
137
135
  import './_verture/sortable.esm-49896035.js';
138
136
  import '@para-ui/icons/LinkGroup';
139
137
  import '@para-ui/icons/UploadFile';
140
- import './_verture/intl-5c1ec055.js';
141
- import './_verture/index-05f7bf11.js';
138
+ import './_verture/intl-f2f27722.js';
139
+ import './_verture/index-c568f272.js';
142
140
  import '@para-ui/icons/Help';
143
141
  import '@para-ui/icons/Internet';
144
142
  import 'rc-input-number';
@@ -150,6 +148,7 @@ import '@para-ui/icons/CheckCircleF';
150
148
  import 'rc-dialog';
151
149
  import 'rc-notification';
152
150
  import 'rc-pagination';
151
+ import '@para-ui/icons/DoubleLeft';
153
152
  import '@para-ui/icons/WarningCircle';
154
153
  import 'rc-progress';
155
154
  import 'rc-slider';
package/locale/index.js CHANGED
@@ -77,8 +77,8 @@ var enUS = {
77
77
  "FormItem": {
78
78
  "choseFile": "Chose File",
79
79
  "unEmpty": "{label} Cannot be empty",
80
- "maxLength": "The maximum length cannot be exceeded{len}",
81
- "minLength": "The minimum length cannot be exceeded{len}",
80
+ "maxLength": "The maximum length cannot be exceeded {len}",
81
+ "minLength": "The minimum length cannot be exceeded {len}",
82
82
  "unRule": "The parameter does not comply with the validation rule {rule}",
83
83
  "minValue": "The minimum value is {val}",
84
84
  "maxValue": "The maximum value is {val}"
@@ -257,8 +257,8 @@ var zhCN = {
257
257
  "FormItem": {
258
258
  "choseFile": "选择文件",
259
259
  "unEmpty": "{label}不能为空",
260
- "maxLength": "最大长度不能超过{len}",
261
- "minLength": "最小长度为{len}",
260
+ "maxLength": "最大长度不能超过{len}",
261
+ "minLength": "最小长度为{len}",
262
262
  "unRule": "参数不符合校验规则{rule}",
263
263
  "minValue": "最小值为{val}",
264
264
  "maxValue": "最大值为{val}"
@@ -359,8 +359,8 @@ var zhCN = {
359
359
  };
360
360
 
361
361
  var index = {
362
- enUS: enUS,
363
- zhCN: zhCN
362
+ enUS,
363
+ zhCN
364
364
  };
365
365
 
366
366
  export { index as default };