@para-ui/core 4.0.0-rc.4 → 4.0.0-rc.6
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.
- package/AutoBox/index.js +72 -85
- package/AutoTips/index.js +72 -95
- package/Badge/index.js +17 -16
- package/Breadcrumbs/index.js +57 -73
- package/Button/index.js +90 -118
- package/ButtonGroup/index.js +30 -33
- package/Carousel/index.js +29 -33
- package/Cascader/index.js +9 -10
- package/Checkbox/index.js +28 -35
- package/CheckboxGroup/index.js +43 -58
- package/Collapse/index.js +52 -49
- package/CollapseBox/index.js +65 -70
- package/CollapseLayout/index.js +106 -101
- package/ColorPicker/index.js +3 -3
- package/ComboSelect/index.js +260 -337
- package/ComboSelect/lang/en_US.d.ts +1 -0
- package/ComboSelect/lang/index.d.ts +2 -0
- package/ComboSelect/lang/zh_CN.d.ts +1 -0
- package/ComboSelect/utils.d.ts +6 -0
- package/Container/index.js +17 -21
- package/CopyText/index.js +50 -83
- package/DatePicker/index.js +24 -27
- package/Descriptions/index.js +50 -59
- package/Desktop/index.js +161 -180
- package/DragVerify/index.js +77 -113
- package/Drawer/index.js +80 -95
- package/Dropdown/index.js +3 -3
- package/DynamicMultiBox/index.js +222 -224
- package/DynamicMultiBox/interface.d.ts +7 -0
- package/Empty/index.js +26 -28
- package/Form/index.js +70 -74
- package/FormItem/index.js +18 -15
- package/FunctionModal/index.js +7 -14
- package/GlobalContext/index.js +17 -20
- package/Help/index.js +9 -12
- package/HelperText/index.js +11 -11
- package/InputLang/index.js +104 -124
- package/InputNumber/index.js +62 -81
- package/Label/index.js +19 -21
- package/Loading/index.js +11 -10
- package/Menu/index.js +302 -371
- package/Message/index.js +104 -113
- package/Modal/index.js +122 -148
- package/MultiBox/index.d.ts +5 -0
- package/MultiBox/index.js +111 -115
- package/Notification/index.js +105 -103
- package/OperateBtn/index.d.ts +3 -0
- package/OperateBtn/index.js +77 -107
- package/PageHeader/index.js +327 -406
- package/Pagination/index.js +107 -137
- package/ParauiProvider/index.js +20 -22
- package/PasswordRules/index.js +36 -40
- package/PopConfirm/index.js +60 -77
- package/Popover/index.js +12 -12
- package/Progress/index.js +72 -74
- package/Querying/index.js +22 -23
- package/README.md +2 -0
- package/Radio/index.js +27 -34
- package/RadioGroup/index.js +38 -52
- package/Search/index.js +34 -43
- package/Select/index.js +281 -345
- package/SelectInput/index.js +8 -13
- package/Selector/index.js +582 -796
- package/SelectorPicker/index.js +113 -134
- package/SingleBox/index.d.ts +5 -0
- package/SingleBox/index.js +92 -88
- package/Slider/index.js +46 -57
- package/Status/index.js +14 -13
- package/Stepper/index.js +24 -25
- package/Styles/theme.scss +9 -9
- package/Switch/index.js +32 -35
- package/Table/index.js +360 -494
- package/Tabs/index.js +100 -100
- package/Tag/index.js +64 -82
- package/TextEditor/index.js +78 -100
- package/TextField/index.js +142 -183
- package/TimePicker/index.js +29 -28
- package/Timeline/index.js +50 -47
- package/Title/index.js +32 -34
- package/ToggleButton/index.js +29 -29
- package/Tooltip/index.js +52 -56
- package/Transfer/index.js +117 -154
- package/Tree/index.js +9 -10
- package/Upload/index.js +125 -143
- package/Upload/interface.d.ts +2 -0
- package/_verture/{constant-0d9802f7.js → constant-5317fc89.js} +2 -2
- package/_verture/{index-5a7e2438.js → index-3cdaba96.js} +967 -934
- package/_verture/{index-b1f80962.js → index-4fafd0a0.js} +6 -8
- package/_verture/{index-024bbc9b.js → index-775ad32d.js} +29 -25
- package/_verture/{index-05f7bf11.js → index-c568f272.js} +2 -2
- package/_verture/{index-232d890b.js → index-d63bd287.js} +1 -1
- package/_verture/index-da9097d3.js +239 -0
- package/_verture/{index-9331b116.js → index-e0f9064d.js} +125 -134
- package/_verture/intl-f2f27722.js +69 -0
- package/_verture/{modalContext-736ff215.js → modalContext-8534f23d.js} +36 -64
- package/_verture/{slicedToArray-a8206399.js → slicedToArray-75fa4188.js} +15 -2
- package/_verture/{toConsumableArray-8f4c9589.js → toConsumableArray-c7a8028f.js} +1 -1
- package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-eb13cf56.js} +5 -4
- package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-1e416658.js} +4 -3
- package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-635f66f4.js} +16 -15
- package/_verture/{util-7e1fb1e2.js → util-82646c4f.js} +5 -4
- package/_verture/utils-c17b5265.js +97 -0
- package/index.js +24 -23
- package/locale/en-US.d.ts +1 -0
- package/locale/index.d.ts +2 -0
- package/locale/index.js +10 -8
- package/locale/zh-CN.d.ts +1 -0
- package/package.json +11 -10
- package/umd/AutoBox.js +9 -8
- package/umd/AutoTips.js +9 -8
- package/umd/Badge.js +1 -1
- package/umd/Breadcrumbs.js +9 -8
- package/umd/Button.js +9 -8
- package/umd/ButtonGroup.js +9 -8
- package/umd/Carousel.js +5 -5
- package/umd/Cascader.js +9 -8
- package/umd/Checkbox.js +9 -8
- package/umd/CheckboxGroup.js +9 -8
- package/umd/Collapse.js +8 -7
- package/umd/CollapseBox.js +1 -1
- package/umd/CollapseLayout.js +4 -4
- package/umd/ColorPicker.js +1 -1
- package/umd/ComboSelect.js +9 -8
- package/umd/Container.js +1 -1
- package/umd/CopyText.js +9 -8
- package/umd/DatePicker.js +9 -8
- package/umd/Descriptions.js +9 -8
- package/umd/Desktop.js +9 -8
- package/umd/DragVerify.js +4 -4
- package/umd/Drawer.js +9 -8
- package/umd/Dropdown.js +6 -5
- package/umd/DynamicMultiBox.js +11 -10
- package/umd/Empty.js +1 -1
- package/umd/Form.js +9 -8
- package/umd/FormItem.js +9 -8
- package/umd/FunctionModal.js +9 -8
- package/umd/GlobalContext.js +1 -1
- package/umd/Help.js +9 -8
- package/umd/HelperText.js +1 -1
- package/umd/InputLang.js +9 -8
- package/umd/InputNumber.js +9 -8
- package/umd/Label.js +9 -8
- package/umd/Loading.js +4 -4
- package/umd/Menu.js +4 -4
- package/umd/Message.js +4 -4
- package/umd/Modal.js +9 -8
- package/umd/MultiBox.js +9 -8
- package/umd/Notification.js +8 -7
- package/umd/OperateBtn.js +9 -8
- package/umd/PageHeader.js +9 -8
- package/umd/Pagination.js +9 -8
- package/umd/ParauiProvider.js +1 -1
- package/umd/PasswordRules.js +4 -4
- package/umd/PopConfirm.js +9 -8
- package/umd/Popover.js +9 -8
- package/umd/Progress.js +5 -5
- package/umd/Querying.js +1 -1
- package/umd/Radio.js +9 -8
- package/umd/RadioGroup.js +9 -8
- package/umd/Search.js +9 -8
- package/umd/Select.js +9 -8
- package/umd/SelectInput.js +9 -8
- package/umd/Selector.js +9 -8
- package/umd/SelectorPicker.js +9 -8
- package/umd/SingleBox.js +9 -8
- package/umd/Slider.js +6 -5
- package/umd/Status.js +4 -4
- package/umd/Stepper.js +9 -8
- package/umd/Switch.js +9 -8
- package/umd/Table.js +9 -8
- package/umd/Tabs.js +9 -8
- package/umd/Tag.js +9 -8
- package/umd/TextEditor.js +22 -21
- package/umd/TextField.js +9 -8
- package/umd/TimePicker.js +9 -8
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +9 -8
- package/umd/ToggleButton.js +9 -8
- package/umd/Tooltip.js +9 -8
- package/umd/Transfer.js +10 -9
- package/umd/Tree.js +9 -8
- package/umd/Upload.js +10 -9
- package/umd/locale.js +1 -1
- package/_verture/index-e9007d6a.js +0 -236
- package/_verture/intl-5c1ec055.js +0 -81
- package/_verture/unsupportedIterableToArray-cb478f24.js +0 -16
- package/_verture/utils-418da0a4.js +0 -73
- /package/_verture/{typeof-c310ee4a.js → typeof-b240b062.js} +0 -0
|
@@ -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
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
};
|
|
72
|
-
var setState;
|
|
66
|
+
const useModal = () => React__default.useContext(FunctionModalContext);
|
|
67
|
+
let setState;
|
|
73
68
|
/**
|
|
74
69
|
* 函数弹窗组件Provider
|
|
75
70
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
const FunctionModalProvider = _ref => {
|
|
72
|
+
let {
|
|
73
|
+
children
|
|
74
|
+
} = _ref;
|
|
78
75
|
// 模态框组 配置
|
|
79
|
-
|
|
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 =
|
|
78
|
+
setState = () => {
|
|
85
79
|
setConfirmationState([]);
|
|
86
80
|
awaitingPromiseRef.current = [];
|
|
87
81
|
};
|
|
88
82
|
// 存储每个模态框的 promise 方法
|
|
89
|
-
|
|
83
|
+
const awaitingPromiseRef = React__default.useRef([]);
|
|
90
84
|
/**
|
|
91
85
|
* 模态框初始化方法
|
|
92
86
|
* @param options 模态框配置
|
|
93
87
|
* @return 返回一个promise 用于外部判断弹窗状态
|
|
94
88
|
*/
|
|
95
|
-
|
|
96
|
-
setConfirmationState(
|
|
89
|
+
const openConfirmation = options => {
|
|
90
|
+
setConfirmationState(pre => {
|
|
97
91
|
pre.push(options);
|
|
98
|
-
return
|
|
92
|
+
return [...pre];
|
|
99
93
|
});
|
|
100
|
-
return new Promise(
|
|
94
|
+
return new Promise((resolve, reject) => {
|
|
101
95
|
awaitingPromiseRef.current.push({
|
|
102
|
-
resolve
|
|
103
|
-
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
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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
|
-
|
|
165
|
-
setTimeout(
|
|
136
|
+
const deleteOption = (idx, pRef) => {
|
|
137
|
+
setTimeout(() => {
|
|
166
138
|
pRef && pRef.resolve(true);
|
|
167
|
-
setConfirmationState(
|
|
139
|
+
setConfirmationState(pre => {
|
|
168
140
|
pre.splice(idx, 1);
|
|
169
141
|
awaitingPromiseRef.current.splice(idx, 1);
|
|
170
|
-
return
|
|
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
|
-
|
|
180
|
-
|
|
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(
|
|
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
|
-
|
|
169
|
+
const useClose = () => {
|
|
198
170
|
return setState;
|
|
199
171
|
};
|
|
200
172
|
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
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,
|
|
56
|
+
export { _slicedToArray as _, _arrayWithHoles as a, _unsupportedIterableToArray as b, _nonIterableRest as c, _arrayLikeToArray as d };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as _arrayLikeToArray, b as _unsupportedIterableToArray } from './slicedToArray-75fa4188.js';
|
|
2
2
|
|
|
3
3
|
function _arrayWithoutHoles(arr) {
|
|
4
4
|
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
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
|
-
|
|
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
|
-
|
|
6
|
-
componentsProps
|
|
7
|
-
|
|
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
|
-
|
|
11
|
-
overflow
|
|
12
|
-
overflowX
|
|
13
|
-
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
|
-
|
|
20
|
-
|
|
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
|
-
|
|
32
|
+
const popupRef = React__default.useRef();
|
|
32
33
|
//浮层渲染容器
|
|
33
|
-
|
|
34
|
+
const getPopupContainer = triggerNode => {
|
|
34
35
|
var _a, _b, _c, _d;
|
|
35
|
-
|
|
36
|
+
let container;
|
|
36
37
|
if (!customizeContainer) {
|
|
37
|
-
|
|
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
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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(
|
|
61
|
-
return
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
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
|
-
|
|
15
|
+
const constant = height / 36;
|
|
15
16
|
return Math.round((4 + 15 * Math.pow(constant, 0.25) + constant / 5) * 10);
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
//获取替换字段
|
|
2
|
+
const getReplaceField = (mode, repl, tableP, treeP) => {
|
|
3
|
+
let t = {};
|
|
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;
|
|
5
|
+
return Object.assign(Object.assign({}, repl), t);
|
|
6
|
+
};
|
|
7
|
+
//to array
|
|
8
|
+
const toArray = list => {
|
|
9
|
+
if (!list) return [];
|
|
10
|
+
return Array.isArray(list) ? list : JSON.stringify(list) === '{}' ? [] : [list];
|
|
11
|
+
};
|
|
12
|
+
const isRemoteLoad = (mode, props) => {
|
|
13
|
+
if (mode === 'table') {
|
|
14
|
+
return !(props && Array.isArray(props.data));
|
|
15
|
+
}
|
|
16
|
+
return !(props && Array.isArray(props.treeData));
|
|
17
|
+
};
|
|
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;
|
|
22
|
+
var _a;
|
|
23
|
+
const screenH = 720;
|
|
24
|
+
const treeOverlay = "".concat(maxHeight || 254, "px");
|
|
25
|
+
const listOverlay = "".concat(maxHeight || 232, "px");
|
|
26
|
+
// let largeScreenH = 880;
|
|
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';
|
|
31
|
+
if (mode === 'tree') {
|
|
32
|
+
//tree
|
|
33
|
+
if (clientH <= screenH) {
|
|
34
|
+
//小屏幕
|
|
35
|
+
return isRemoteLoad ? {
|
|
36
|
+
height: treeOverlay
|
|
37
|
+
} : {
|
|
38
|
+
[fixHeight]: treeOverlay
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
//大屏幕
|
|
42
|
+
return isRemoteLoad ? {
|
|
43
|
+
height: largeTreeOverlayH
|
|
44
|
+
} : {
|
|
45
|
+
[fixHeight]: largeTreeOverlayH
|
|
46
|
+
};
|
|
47
|
+
} else if (mode === 'list') {
|
|
48
|
+
//list
|
|
49
|
+
if (clientH <= screenH) {
|
|
50
|
+
return isRemoteLoad ? {
|
|
51
|
+
[fixHeight]: listOverlay
|
|
52
|
+
} : {
|
|
53
|
+
[fixHeight]: listOverlay
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return isRemoteLoad ? {
|
|
57
|
+
[fixHeight]: largeListOverlayH
|
|
58
|
+
} : {
|
|
59
|
+
[fixHeight]: largeListOverlayH
|
|
60
|
+
};
|
|
61
|
+
} else {
|
|
62
|
+
//table
|
|
63
|
+
return {
|
|
64
|
+
height: "".concat((_a = maxHeight !== null && maxHeight !== void 0 ? maxHeight : height) !== null && _a !== void 0 ? _a : 380, "px")
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
// 实现一个防抖函数,debounce接受一个函数func和delay时间作为参数,返回一个防抖函数。使用泛型T保证返回防抖函数的类型与原func一致
|
|
69
|
+
function debounce(func, delay) {
|
|
70
|
+
let timer;
|
|
71
|
+
return function () {
|
|
72
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
73
|
+
args[_key] = arguments[_key];
|
|
74
|
+
}
|
|
75
|
+
if (timer) clearTimeout(timer);
|
|
76
|
+
timer = setTimeout(() => {
|
|
77
|
+
func.apply(this, args);
|
|
78
|
+
}, delay);
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @description 查询元素是不是在父元素内
|
|
83
|
+
* @param {HTMLElement} el 当前元素
|
|
84
|
+
* @param {any} parent 父元素的匹配器
|
|
85
|
+
*/
|
|
86
|
+
const closest = (el, selector) => {
|
|
87
|
+
const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
|
|
88
|
+
while (el) {
|
|
89
|
+
if (matchesSelector.call(el, selector)) {
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
el = el.parentElement;
|
|
93
|
+
}
|
|
94
|
+
return el;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export { getOverlaySize as a, closest as c, debounce as d, getReplaceField as g, isRemoteLoad as i, toArray as t };
|
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-
|
|
8
|
+
export { C as Cascader } from './_verture/index-3cdaba96.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-
|
|
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-
|
|
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-
|
|
28
|
-
export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-
|
|
27
|
+
export { F as FormItem } from './_verture/index-e0f9064d.js';
|
|
28
|
+
export { u as FunctionModal, F as FunctionModalProvider, a as useClose } from './_verture/modalContext-8534f23d.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,34 +70,33 @@ 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-
|
|
73
|
+
export { T as Tree } from './_verture/index-4fafd0a0.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-
|
|
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-
|
|
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/toConsumableArray-c7a8028f.js';
|
|
95
|
+
import './_verture/slicedToArray-75fa4188.js';
|
|
96
|
+
import './_verture/defineProperty-1d116156.js';
|
|
97
|
+
import './_verture/typeof-adeedc13.js';
|
|
99
98
|
import 'rc-motion';
|
|
100
|
-
import './_verture/typeof-
|
|
99
|
+
import './_verture/typeof-b240b062.js';
|
|
101
100
|
import 'rc-tree/lib/utils/conductUtil';
|
|
102
101
|
import '@para-ui/icons/Right';
|
|
103
102
|
import '@para-ui/icons/CloseCircleF';
|
|
@@ -105,15 +104,14 @@ import 'rc-tree/lib/utils/treeUtil';
|
|
|
105
104
|
import '@para-ui/icons';
|
|
106
105
|
import 'rc-collapse';
|
|
107
106
|
import 'react-transition-group';
|
|
108
|
-
import './_verture/util-
|
|
109
|
-
import '@para-ui/icons/
|
|
110
|
-
import '@para-ui/icons/
|
|
107
|
+
import './_verture/util-82646c4f.js';
|
|
108
|
+
import '@para-ui/icons/LeftTriangleF';
|
|
109
|
+
import '@para-ui/icons/RightTriangleF';
|
|
111
110
|
import 'react-color';
|
|
112
|
-
import './_verture/index-232d890b.js';
|
|
113
111
|
import '@para-ui/icons/Search';
|
|
114
112
|
import '@para-ui/icons/Close';
|
|
115
|
-
import './_verture/utils-
|
|
116
|
-
import './_verture/useGlobalProps-
|
|
113
|
+
import './_verture/utils-c17b5265.js';
|
|
114
|
+
import './_verture/useGlobalProps-1e416658.js';
|
|
117
115
|
import '@para-ui/icons/Copy';
|
|
118
116
|
import '@para-ui/icons/CheckS';
|
|
119
117
|
import 'rc-picker/es/generate/dayjs';
|
|
@@ -124,11 +122,12 @@ import 'rc-picker/lib/locale/en_US';
|
|
|
124
122
|
import 'rc-picker/lib/locale/zh_CN';
|
|
125
123
|
import '@para-ui/icons/SortRight';
|
|
126
124
|
import '@para-ui/icons/Left';
|
|
125
|
+
import '@para-ui/icons/DoubleRight';
|
|
127
126
|
import '@para-ui/icons/Check';
|
|
128
127
|
import '@para-ui/icons/Refresh';
|
|
129
128
|
import 'rc-drawer';
|
|
130
129
|
import 'rc-dropdown';
|
|
131
|
-
import './_verture/usePopupContainer-
|
|
130
|
+
import './_verture/usePopupContainer-635f66f4.js';
|
|
132
131
|
import 'dayjs';
|
|
133
132
|
import '@para-ui/icons/Panel';
|
|
134
133
|
import '@para-ui/icons/PlusCircleF';
|
|
@@ -137,8 +136,8 @@ import '@para-ui/icons/Drag';
|
|
|
137
136
|
import './_verture/sortable.esm-49896035.js';
|
|
138
137
|
import '@para-ui/icons/LinkGroup';
|
|
139
138
|
import '@para-ui/icons/UploadFile';
|
|
140
|
-
import './_verture/intl-
|
|
141
|
-
import './_verture/index-
|
|
139
|
+
import './_verture/intl-f2f27722.js';
|
|
140
|
+
import './_verture/index-c568f272.js';
|
|
142
141
|
import '@para-ui/icons/Help';
|
|
143
142
|
import '@para-ui/icons/Internet';
|
|
144
143
|
import 'rc-input-number';
|
|
@@ -150,8 +149,10 @@ import '@para-ui/icons/CheckCircleF';
|
|
|
150
149
|
import 'rc-dialog';
|
|
151
150
|
import 'rc-notification';
|
|
152
151
|
import 'rc-pagination';
|
|
152
|
+
import '@para-ui/icons/DoubleLeft';
|
|
153
153
|
import '@para-ui/icons/WarningCircle';
|
|
154
154
|
import 'rc-progress';
|
|
155
|
+
import './_verture/index-d63bd287.js';
|
|
155
156
|
import 'rc-slider';
|
|
156
157
|
import './_verture/tinycolor-ece3542d.js';
|
|
157
158
|
import 'rc-steps';
|
package/locale/en-US.d.ts
CHANGED
package/locale/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ declare const _default: {
|
|
|
17
17
|
fullPath: string;
|
|
18
18
|
pleaseSelect: string;
|
|
19
19
|
selected: string;
|
|
20
|
+
searching: string;
|
|
20
21
|
};
|
|
21
22
|
DatePicker: {
|
|
22
23
|
lang: {
|
|
@@ -196,6 +197,7 @@ declare const _default: {
|
|
|
196
197
|
fullPath: string;
|
|
197
198
|
pleaseSelect: string;
|
|
198
199
|
selected: string;
|
|
200
|
+
searching: string;
|
|
199
201
|
};
|
|
200
202
|
DatePicker: {
|
|
201
203
|
lang: {
|
package/locale/index.js
CHANGED
|
@@ -15,7 +15,8 @@ var enUS = {
|
|
|
15
15
|
"ok": "Ok",
|
|
16
16
|
"fullPath": "Full path",
|
|
17
17
|
"pleaseSelect": "Please select",
|
|
18
|
-
"selected": "selected"
|
|
18
|
+
"selected": "selected",
|
|
19
|
+
"searching": "Searching"
|
|
19
20
|
},
|
|
20
21
|
"DatePicker": {
|
|
21
22
|
"lang": {
|
|
@@ -77,8 +78,8 @@ var enUS = {
|
|
|
77
78
|
"FormItem": {
|
|
78
79
|
"choseFile": "Chose File",
|
|
79
80
|
"unEmpty": "{label} Cannot be empty",
|
|
80
|
-
"maxLength": "The maximum length cannot be exceeded{len}",
|
|
81
|
-
"minLength": "The minimum length cannot be exceeded{len}",
|
|
81
|
+
"maxLength": "The maximum length cannot be exceeded {len}",
|
|
82
|
+
"minLength": "The minimum length cannot be exceeded {len}",
|
|
82
83
|
"unRule": "The parameter does not comply with the validation rule {rule}",
|
|
83
84
|
"minValue": "The minimum value is {val}",
|
|
84
85
|
"maxValue": "The maximum value is {val}"
|
|
@@ -195,7 +196,8 @@ var zhCN = {
|
|
|
195
196
|
"ok": "确定",
|
|
196
197
|
"fullPath": "完整路径",
|
|
197
198
|
"pleaseSelect": "请选择",
|
|
198
|
-
"selected": "已选中"
|
|
199
|
+
"selected": "已选中",
|
|
200
|
+
"searching": "搜索中"
|
|
199
201
|
},
|
|
200
202
|
"DatePicker": {
|
|
201
203
|
"lang": {
|
|
@@ -257,8 +259,8 @@ var zhCN = {
|
|
|
257
259
|
"FormItem": {
|
|
258
260
|
"choseFile": "选择文件",
|
|
259
261
|
"unEmpty": "{label}不能为空",
|
|
260
|
-
"maxLength": "最大长度不能超过{len}",
|
|
261
|
-
"minLength": "最小长度为{len}",
|
|
262
|
+
"maxLength": "最大长度不能超过{len}位",
|
|
263
|
+
"minLength": "最小长度为{len}位",
|
|
262
264
|
"unRule": "参数不符合校验规则{rule}",
|
|
263
265
|
"minValue": "最小值为{val}",
|
|
264
266
|
"maxValue": "最大值为{val}"
|
|
@@ -359,8 +361,8 @@ var zhCN = {
|
|
|
359
361
|
};
|
|
360
362
|
|
|
361
363
|
var index = {
|
|
362
|
-
enUS
|
|
363
|
-
zhCN
|
|
364
|
+
enUS,
|
|
365
|
+
zhCN
|
|
364
366
|
};
|
|
365
367
|
|
|
366
368
|
export { index as default };
|