@para-ui/core 3.0.108 → 3.0.109-rc.1
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 +5 -9
- package/AutoTips/index.js +5 -12
- package/Breadcrumbs/index.js +7 -11
- package/Button/index.js +8 -12
- package/ButtonGroup/index.js +8 -12
- package/Carousel/index.js +4 -8
- package/Cascader/index.js +7 -11
- package/Checkbox/index.js +4 -8
- package/CheckboxGroup/index.js +4 -8
- package/Collapse/index.js +1 -5
- package/CollapseBox/index.js +4 -8
- package/CollapseLayout/index.js +6 -10
- package/ColorPicker/index.js +0 -2
- package/ComboSelect/index.js +14 -18
- package/Container/index.js +1 -5
- package/DatePicker/index.js +10 -14
- package/Desktop/index.js +10 -14
- package/DragVerify/index.js +6 -10
- package/Drawer/index.js +8 -12
- package/Dropdown/index.js +3 -4
- package/DynamicMultiBox/index.js +15 -19
- package/Empty/index.js +3 -7
- package/Form/index.js +15 -16
- package/FormItem/index.js +15 -16
- package/FunctionModal/index.js +14 -15
- package/GlobalContext/index.js +3 -3
- package/Help/index.js +4 -8
- package/HelperText/index.js +1 -5
- package/InputLang/index.js +11 -15
- package/InputNumber/index.js +4 -8
- package/Label/index.js +4 -8
- package/Loading/index.js +1 -5
- package/Menu/index.js +5 -9
- package/Message/index.js +4 -8
- package/Modal/index.js +10 -17
- package/MultiBox/index.js +10 -14
- package/Notification/index.js +3 -7
- package/OperateBtn/index.js +9 -13
- package/PageHeader/index.js +9 -13
- package/Pagination/index.js +11 -15
- package/ParauiProvider/index.js +3 -7
- package/PasswordRules/index.js +3 -7
- package/PopConfirm/index.js +8 -12
- package/Popover/index.js +5 -9
- package/Progress/index.js +2 -6
- package/Querying/index.js +3 -7
- package/README.md +5 -0
- package/Radio/index.js +4 -8
- package/RadioGroup/index.js +4 -8
- package/Search/index.js +9 -13
- package/Select/index.js +11 -15
- package/SelectInput/index.js +11 -12
- package/Selector/index.js +11 -24
- package/SelectorPicker/index.js +12 -16
- package/SingleBox/index.js +10 -14
- package/Slider/index.js +6 -10
- package/Split/index.js +4 -8
- package/Status/index.js +1 -5
- package/Stepper/index.js +3 -7
- package/Styles/theme/theme-api.scss +75 -0
- package/Styles/theme/theme-default.scss +74 -0
- package/Styles/theme/theme-shrcb.scss +80 -0
- package/Styles/theme.scss +1 -69
- package/Switch/index.js +6 -10
- package/Table/index.js +12 -37
- package/Tabs/index.js +9 -13
- package/Tag/index.js +7 -11
- package/TextEditor/index.js +5 -12
- package/TextField/index.js +8 -12
- package/TimePicker/index.js +10 -11
- package/Timeline/index.js +4 -8
- package/Title/index.js +1 -5
- package/ToggleButton/index.js +9 -13
- package/Tooltip/index.js +4 -8
- package/Transfer/index.js +13 -17
- package/Tree/index.js +12 -13
- package/Upload/index.js +12 -28
- package/_verture/{index-519a9fdf.js → closestPolyfill-af1e3129.js} +8 -15
- package/_verture/closestPolyfill-c45cda78.js +1354 -0
- package/_verture/constant-60484ff1.js +10 -0
- package/_verture/{defineProperty-62acccfc.js → defineProperty-7aa4e7b0.js} +1 -1
- package/_verture/defineProperty-e2de1981.js +34 -0
- package/_verture/{index-77f9e0fb.js → index-0b16a77e.js} +2 -6
- package/_verture/{index-8bad96b3.js → index-76c48610.js} +4 -11
- package/_verture/index-7cb40909.js +757 -0
- package/_verture/index-a63894d0.js +232 -0
- package/_verture/index-c8575171.js +340 -0
- package/_verture/index-ef1e15e8.js +18 -0
- package/_verture/{intl-4a9f1b44.js → intl-4ad778ba.js} +1 -1
- package/_verture/intl-519338cb.js +81 -0
- package/_verture/{modalContext-da105e06.js → modalContext-2256753f.js} +4 -8
- package/_verture/modalContext-fc6309c5.js +197 -0
- package/_verture/{slicedToArray-76060636.js → slicedToArray-545d9fcd.js} +1 -1
- package/_verture/slicedToArray-94962ec5.js +43 -0
- package/_verture/sortable.esm-c0270144.js +3791 -0
- package/_verture/{toConsumableArray-81040c9e.js → toConsumableArray-295100d6.js} +1 -1
- package/_verture/toConsumableArray-a444c3ba.js +19 -0
- package/_verture/tslib.es6-b07fd47a.js +38 -0
- package/_verture/typeof-99c4c2af.js +11 -0
- package/_verture/unsupportedIterableToArray-e9a428c9.js +16 -0
- package/_verture/useFormatMessage-5777ad0a.js +20 -0
- package/_verture/useGlobalProps-fbb58670.js +11 -0
- package/_verture/usePopupContainer-b086ca46.js +68 -0
- package/_verture/util-d56ad080.js +18 -0
- package/_verture/{utils-1ffeadec.js → utils-2e9c05bc.js} +1 -1
- package/_verture/utils-5e4b0846.js +92 -0
- package/index.d.ts +0 -2
- package/index.js +20 -23
- package/package.json +4 -1
- package/theme/theme-shrcb.css +14600 -0
- package/theme/theme.css +14996 -0
- package/umd/AutoTips.js +1 -1
- package/umd/Breadcrumbs.js +1 -1
- package/umd/Button.js +1 -1
- package/umd/ButtonGroup.js +1 -1
- package/umd/Checkbox.js +1 -1
- package/umd/CheckboxGroup.js +1 -1
- package/umd/CollapseLayout.js +3 -3
- package/umd/ComboSelect.js +1 -1
- package/umd/DatePicker.js +1 -1
- package/umd/Desktop.js +1 -1
- package/umd/DragVerify.js +1 -1
- package/umd/Drawer.js +1 -1
- package/umd/DynamicMultiBox.js +1 -1
- package/umd/Empty.js +1 -1
- package/umd/Form.js +1 -1
- package/umd/FormItem.js +1 -1
- package/umd/FunctionModal.js +1 -1
- package/umd/Help.js +1 -1
- package/umd/InputLang.js +1 -1
- package/umd/InputNumber.js +1 -1
- package/umd/Label.js +1 -1
- package/umd/Menu.js +3 -3
- package/umd/Message.js +1 -1
- package/umd/Modal.js +1 -1
- package/umd/MultiBox.js +1 -1
- package/umd/Notification.js +1 -1
- package/umd/OperateBtn.js +1 -1
- package/umd/PageHeader.js +7 -7
- package/umd/Pagination.js +4 -4
- package/umd/PopConfirm.js +1 -1
- package/umd/Progress.js +1 -1
- package/umd/Radio.js +1 -1
- package/umd/RadioGroup.js +1 -1
- package/umd/Search.js +1 -1
- package/umd/Select.js +1 -1
- package/umd/SelectInput.js +1 -1
- package/umd/Selector.js +1 -1
- package/umd/SelectorPicker.js +1 -1
- package/umd/SingleBox.js +1 -1
- package/umd/Slider.js +1 -1
- package/umd/Stepper.js +4 -4
- package/umd/Switch.js +4 -4
- package/umd/Table.js +1 -1
- package/umd/Tabs.js +1 -1
- package/umd/Tag.js +1 -1
- package/umd/TextEditor.js +1 -1
- package/umd/TextField.js +1 -1
- package/umd/TimePicker.js +1 -1
- package/umd/Timeline.js +1 -1
- package/umd/Title.js +1 -1
- package/umd/ToggleButton.js +1 -1
- package/umd/Transfer.js +1 -1
- package/umd/Tree.js +1 -1
- package/umd/Upload.js +1 -1
- package/_verture/index-a369ca3f.js +0 -4
- package/_verture/style-inject.es-300983ab.js +0 -28
- package/locale/en-US.d.ts +0 -165
- package/locale/index.d.ts +0 -331
- package/locale/index.js +0 -336
- package/locale/zh-CN.d.ts +0 -165
- package/umd/locale.js +0 -1
- /package/_verture/{constant-66aa48a1.js → constant-4091d66f.js} +0 -0
- /package/_verture/{index-65bbd1e4.js → index-1fdf8def.js} +0 -0
- /package/_verture/{index-beef914f.js → index-6faec6b4.js} +0 -0
- /package/_verture/{sortable.esm-49896035.js → sortable.esm-2593ef9b.js} +0 -0
- /package/_verture/{tslib.es6-55ed4bd2.js → tslib.es6-24e733a1.js} +0 -0
- /package/_verture/{typeof-498dd2b1.js → typeof-3d6c2390.js} +0 -0
- /package/_verture/{unsupportedIterableToArray-cb478f24.js → unsupportedIterableToArray-2fb1516b.js} +0 -0
- /package/_verture/{useFormatMessage-703f8b20.js → useFormatMessage-45bb2ce2.js} +0 -0
- /package/_verture/{useGlobalProps-1b846a65.js → useGlobalProps-be263385.js} +0 -0
- /package/_verture/{usePopupContainer-87febeb9.js → usePopupContainer-09af2ab3.js} +0 -0
- /package/_verture/{util-7e1fb1e2.js → util-2a5a3b41.js} +0 -0
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { _ as _toConsumableArray } from './toConsumableArray-
|
|
2
|
-
import { _ as _slicedToArray } from './slicedToArray-
|
|
3
|
-
import { r as regenerator } from './index-
|
|
4
|
-
import { a as __awaiter } from './tslib.es6-
|
|
1
|
+
import { _ as _toConsumableArray } from './toConsumableArray-a444c3ba.js';
|
|
2
|
+
import { _ as _slicedToArray } from './slicedToArray-94962ec5.js';
|
|
3
|
+
import { r as regenerator } from './index-c8575171.js';
|
|
4
|
+
import { a as __awaiter } from './tslib.es6-24e733a1.js';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
6
|
import React__default from 'react';
|
|
7
7
|
import { Modal } from '../Modal/index.js';
|
|
8
8
|
import clsx from 'clsx';
|
|
9
|
-
import { s as styleInject } from './style-inject.es-300983ab.js';
|
|
10
|
-
|
|
11
|
-
var css_248z = ".function-modal-default [class*=makeStyles-md] {\n width: 440px;\n height: auto;\n max-height: initial;\n}";
|
|
12
|
-
styleInject(css_248z);
|
|
13
9
|
|
|
14
10
|
var FDialog = function FDialog(props) {
|
|
15
11
|
var open = props.open,
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { _ as _toConsumableArray } from './toConsumableArray-295100d6.js';
|
|
2
|
+
import { _ as _slicedToArray } from './slicedToArray-545d9fcd.js';
|
|
3
|
+
import { r as regenerator } from './index-6faec6b4.js';
|
|
4
|
+
import { a as __awaiter } from './tslib.es6-b07fd47a.js';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
import React__default from 'react';
|
|
7
|
+
import { Modal } from '../Modal/index.js';
|
|
8
|
+
import clsx from 'clsx';
|
|
9
|
+
|
|
10
|
+
var FDialog = function FDialog(props) {
|
|
11
|
+
var open = props.open,
|
|
12
|
+
title = props.title,
|
|
13
|
+
size = props.size,
|
|
14
|
+
context = props.context,
|
|
15
|
+
content = props.content,
|
|
16
|
+
onSubmit = props.onSubmit,
|
|
17
|
+
onClose = props.onClose,
|
|
18
|
+
getClose = props.getClose,
|
|
19
|
+
listIndex = props.listIndex,
|
|
20
|
+
ModalProps = props.ModalProps;
|
|
21
|
+
/**
|
|
22
|
+
* 外部想要单独关闭弹窗传出
|
|
23
|
+
*/
|
|
24
|
+
React__default.useEffect(function () {
|
|
25
|
+
getClose && getClose(function () {
|
|
26
|
+
return onClose(listIndex);
|
|
27
|
+
});
|
|
28
|
+
}, [getClose, listIndex, onClose]);
|
|
29
|
+
return jsx(Modal, Object.assign({}, ModalProps, {
|
|
30
|
+
className: clsx('function-modal', !size && 'function-modal-default'),
|
|
31
|
+
open: open,
|
|
32
|
+
title: title,
|
|
33
|
+
onCancel: function onCancel() {
|
|
34
|
+
return onClose(listIndex);
|
|
35
|
+
},
|
|
36
|
+
onOk: function onOk() {
|
|
37
|
+
return onSubmit(listIndex);
|
|
38
|
+
},
|
|
39
|
+
size: size || 'md',
|
|
40
|
+
children: content || context,
|
|
41
|
+
okButtonProps: {
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
return onSubmit(listIndex);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
cancelButtonProps: {
|
|
47
|
+
onClick: function onClick() {
|
|
48
|
+
return onClose(listIndex);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 创建模态框的上下文
|
|
56
|
+
*/
|
|
57
|
+
var FunctionModalContext = /*#__PURE__*/React__default.createContext(Promise.reject);
|
|
58
|
+
/**
|
|
59
|
+
* 弹出框组件
|
|
60
|
+
* @param context 主体内容
|
|
61
|
+
* @param title 弹出框标题
|
|
62
|
+
* @param hideClose 隐藏右上角关闭图标 boolean 默认 false
|
|
63
|
+
* @param checkFunction 检查方法,返回 boolean 值,true则关闭弹窗,false反之
|
|
64
|
+
**/
|
|
65
|
+
var useModal = function useModal() {
|
|
66
|
+
return React__default.useContext(FunctionModalContext);
|
|
67
|
+
};
|
|
68
|
+
var setState;
|
|
69
|
+
/**
|
|
70
|
+
* 函数弹窗组件Provider
|
|
71
|
+
*/
|
|
72
|
+
var FunctionModalProvider = function FunctionModalProvider(_ref) {
|
|
73
|
+
var children = _ref.children;
|
|
74
|
+
// 模态框组 配置
|
|
75
|
+
var _React$useState = React__default.useState([]),
|
|
76
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
77
|
+
confirmationState = _React$useState2[0],
|
|
78
|
+
setConfirmationState = _React$useState2[1];
|
|
79
|
+
// 传出设置模态框数组hook,用于关闭所有弹窗
|
|
80
|
+
setState = function setState() {
|
|
81
|
+
setConfirmationState([]);
|
|
82
|
+
awaitingPromiseRef.current = [];
|
|
83
|
+
};
|
|
84
|
+
// 存储每个模态框的 promise 方法
|
|
85
|
+
var awaitingPromiseRef = React__default.useRef([]);
|
|
86
|
+
/**
|
|
87
|
+
* 模态框初始化方法
|
|
88
|
+
* @param options 模态框配置
|
|
89
|
+
* @return 返回一个promise 用于外部判断弹窗状态
|
|
90
|
+
*/
|
|
91
|
+
var openConfirmation = function openConfirmation(options) {
|
|
92
|
+
setConfirmationState(function (pre) {
|
|
93
|
+
pre.push(options);
|
|
94
|
+
return _toConsumableArray(pre);
|
|
95
|
+
});
|
|
96
|
+
return new Promise(function (resolve, reject) {
|
|
97
|
+
awaitingPromiseRef.current.push({
|
|
98
|
+
resolve: resolve,
|
|
99
|
+
reject: reject
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* 模态框关闭方法
|
|
105
|
+
* @param idx 模态框在模态框数组里的下标,用于拿到对应的配置 和 promise
|
|
106
|
+
* @description 关闭后会清空相关配置
|
|
107
|
+
*/
|
|
108
|
+
var handleClose = function handleClose(idx) {
|
|
109
|
+
// 是否有禁用取消停止功能的配置
|
|
110
|
+
if (confirmationState[idx] && !confirmationState[idx].disCatchOnCancel && awaitingPromiseRef.current[idx]) {
|
|
111
|
+
awaitingPromiseRef.current[idx].resolve(false);
|
|
112
|
+
} else if (awaitingPromiseRef.current[idx]) {
|
|
113
|
+
awaitingPromiseRef.current[idx].resolve(true);
|
|
114
|
+
}
|
|
115
|
+
hideDialog(idx);
|
|
116
|
+
deleteOption(idx);
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* 模态框确定触发的方法
|
|
120
|
+
* @param idx 模态框在模态框数组里的下标,用于拿到对应的配置 和 promise
|
|
121
|
+
*/
|
|
122
|
+
var handleSubmit = function handleSubmit(idx) {
|
|
123
|
+
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/regenerator.mark(function _callee() {
|
|
124
|
+
var checkFuc, jude, pRef;
|
|
125
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
126
|
+
while (1) switch (_context.prev = _context.next) {
|
|
127
|
+
case 0:
|
|
128
|
+
checkFuc = confirmationState && confirmationState[idx] && confirmationState[idx].checkFunction;
|
|
129
|
+
jude = true; // 判断是否有检查方法,如果有则先执行检查方法
|
|
130
|
+
if (!checkFuc) {
|
|
131
|
+
_context.next = 6;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
_context.next = 5;
|
|
135
|
+
return checkFuc();
|
|
136
|
+
case 5:
|
|
137
|
+
jude = _context.sent;
|
|
138
|
+
case 6:
|
|
139
|
+
if (jude) {
|
|
140
|
+
_context.next = 8;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
return _context.abrupt("return");
|
|
144
|
+
case 8:
|
|
145
|
+
hideDialog(idx);
|
|
146
|
+
pRef = awaitingPromiseRef.current[idx];
|
|
147
|
+
deleteOption(idx, pRef);
|
|
148
|
+
case 11:
|
|
149
|
+
case "end":
|
|
150
|
+
return _context.stop();
|
|
151
|
+
}
|
|
152
|
+
}, _callee);
|
|
153
|
+
}));
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* 删除模态框配置,promise 执行成功操作
|
|
157
|
+
* @param pRef 模态框的promise
|
|
158
|
+
* @param idx 模态框在模态框组里的下标
|
|
159
|
+
*/
|
|
160
|
+
var deleteOption = function deleteOption(idx, pRef) {
|
|
161
|
+
setTimeout(function () {
|
|
162
|
+
pRef && pRef.resolve(true);
|
|
163
|
+
setConfirmationState(function (pre) {
|
|
164
|
+
pre.splice(idx, 1);
|
|
165
|
+
awaitingPromiseRef.current.splice(idx, 1);
|
|
166
|
+
return _toConsumableArray(pre);
|
|
167
|
+
});
|
|
168
|
+
}, 200);
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* 隐藏模态框对应的dom
|
|
172
|
+
* @param idx 模态框在模态框数组里的下标
|
|
173
|
+
* @desc 解决异步导致的闪烁问题
|
|
174
|
+
*/
|
|
175
|
+
var hideDialog = function hideDialog(idx) {
|
|
176
|
+
var dialogEl = document.querySelectorAll('.function-modal .MuiDialog-container')[idx];
|
|
177
|
+
if (dialogEl) dialogEl.style.opacity = '0';
|
|
178
|
+
};
|
|
179
|
+
return jsxs(Fragment, {
|
|
180
|
+
children: [jsx(FunctionModalContext.Provider, {
|
|
181
|
+
value: openConfirmation,
|
|
182
|
+
children: children
|
|
183
|
+
}), confirmationState && confirmationState.map(function (option, idx) {
|
|
184
|
+
return jsx(FDialog, Object.assign({
|
|
185
|
+
listIndex: idx,
|
|
186
|
+
open: Boolean(option),
|
|
187
|
+
onSubmit: handleSubmit,
|
|
188
|
+
onClose: handleClose
|
|
189
|
+
}, option), "modal-item-".concat(idx));
|
|
190
|
+
})]
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
var useClose = function useClose() {
|
|
194
|
+
return setState;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export { FunctionModalProvider as F, useClose as a, useModal as u };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { _ as _unsupportedIterableToArray } from './unsupportedIterableToArray-2fb1516b.js';
|
|
2
|
+
|
|
3
|
+
function _arrayWithHoles(arr) {
|
|
4
|
+
if (Array.isArray(arr)) return arr;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function _iterableToArrayLimit(arr, i) {
|
|
8
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
9
|
+
if (null != _i) {
|
|
10
|
+
var _s,
|
|
11
|
+
_e,
|
|
12
|
+
_x,
|
|
13
|
+
_r,
|
|
14
|
+
_arr = [],
|
|
15
|
+
_n = !0,
|
|
16
|
+
_d = !1;
|
|
17
|
+
try {
|
|
18
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
19
|
+
if (Object(_i) !== _i) return;
|
|
20
|
+
_n = !1;
|
|
21
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
22
|
+
} catch (err) {
|
|
23
|
+
_d = !0, _e = err;
|
|
24
|
+
} finally {
|
|
25
|
+
try {
|
|
26
|
+
if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
|
|
27
|
+
} finally {
|
|
28
|
+
if (_d) throw _e;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return _arr;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function _nonIterableRest() {
|
|
36
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function _slicedToArray(arr, i) {
|
|
40
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { _slicedToArray as _ };
|