@aloudata/aloudata-design 0.4.8-beta.14 → 0.4.8-beta.15
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/dist/Avatar/component/Avatar/index.js +16 -5
- package/dist/Breadcrumb/index.js +16 -6
- package/dist/Button/index.js +32 -15
- package/dist/Checkbox/component/CheckboxGroup/index.js +10 -4
- package/dist/Checkbox/index.js +8 -1
- package/dist/Checkbox/type.js +1 -0
- package/dist/ConfigProvider/defaultRenderEmpty.js +5 -0
- package/dist/ConfigProvider/sizeContext.js +1 -1
- package/dist/Divider/index.js +3 -0
- package/dist/DoubleCircleIcon/index.js +9 -7
- package/dist/Dropdown/Button.js +11 -7
- package/dist/Dropdown/index.js +9 -3
- package/dist/Dropdown/style/index.less +4 -0
- package/dist/Empty/image/Data.js +2 -0
- package/dist/Empty/image/Search.js +2 -0
- package/dist/Empty/image/SearchSmall.js +2 -0
- package/dist/Empty/image/User.js +2 -0
- package/dist/Empty/image/WorkBook.js +2 -0
- package/dist/Empty/index.js +23 -13
- package/dist/Icon/components/Icon.js +13 -9
- package/dist/Icon/components/createFromScripts.js +8 -2
- package/dist/Input/components/Group/index.js +9 -4
- package/dist/Input/components/Input/index.js +9 -3
- package/dist/Input/components/Password/index.js +10 -5
- package/dist/Input/components/TextArea/index.js +11 -6
- package/dist/Input/style/index.less +1 -1
- package/dist/InputNumber/index.js +12 -7
- package/dist/Menu/SubMenu.js +6 -1
- package/dist/Menu/index.js +7 -2
- package/dist/Menu/style/index.less +5 -0
- package/dist/Modal/index.js +129 -107
- package/dist/Modal/locale.js +6 -4
- package/dist/Modal/style/index.less +1 -0
- package/dist/Navigator/components/Header/index.js +2 -0
- package/dist/Navigator/components/Menu/index.js +19 -8
- package/dist/Navigator/components/MenuItem/index.js +9 -6
- package/dist/Navigator/index.js +7 -5
- package/dist/Popconfirm/index.js +27 -19
- package/dist/Popover/index.js +9 -2
- package/dist/Radio/components/Group/index.js +34 -26
- package/dist/Radio/components/Radio/index.js +18 -10
- package/dist/Select/components/MultipleOption.js +6 -4
- package/dist/Select/components/SingleOption.js +7 -5
- package/dist/Select/index.js +94 -44
- package/dist/Select/style/index.less +1 -0
- package/dist/Spin/CustomIcon/index.js +2 -0
- package/dist/Spin/index.js +10 -1
- package/dist/Steps/components/ProcessIcon/index.js +2 -0
- package/dist/Steps/components/Step/index.js +8 -2
- package/dist/Steps/index.js +10 -8
- package/dist/Switch/index.js +30 -18
- package/dist/Table/Table.js +129 -86
- package/dist/Table/components/Empty/index.js +2 -0
- package/dist/Table/components/Loading/index.js +2 -0
- package/dist/Table/components/TableBodyRowList/index.js +39 -19
- package/dist/Table/components/TableHead/index.js +86 -55
- package/dist/Table/hooks/useFrame.js +24 -9
- package/dist/Table/style/index.less +1 -1
- package/dist/Table/utils.js +27 -8
- package/dist/Tabs/index.js +32 -17
- package/dist/Tooltip/index.js +12 -12
- package/dist/Tooltip/style/index.less +7 -1
- package/dist/Tree/index.js +4 -2
- package/dist/_utils/hooks/useControlledState.js +21 -9
- package/dist/_utils/hooks/useId.js +5 -4
- package/dist/_utils/hooks/usePrefixCls.js +5 -2
- package/dist/index.js +1 -2
- package/dist/locale-provider/index.js +33 -8
- package/dist/message/index.js +7 -3
- package/dist/notification/demo/index.js +1 -0
- package/dist/notification/index.js +48 -39
- package/package.json +2 -2
|
@@ -1,26 +1,32 @@
|
|
|
1
1
|
var FIRST_INDEX = 0;
|
|
2
2
|
var customCache = new Set();
|
|
3
|
+
|
|
3
4
|
function isValidCustomScriptUrl(scriptUrl) {
|
|
4
5
|
return Boolean(typeof scriptUrl === 'string' && scriptUrl.length && !customCache.has(scriptUrl));
|
|
5
6
|
}
|
|
7
|
+
|
|
6
8
|
export function createFromScripts(scriptUrl) {
|
|
7
9
|
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : FIRST_INDEX;
|
|
8
|
-
var scriptUrls = Array.isArray(scriptUrl) ? scriptUrl : [scriptUrl];
|
|
9
|
-
|
|
10
|
+
var scriptUrls = Array.isArray(scriptUrl) ? scriptUrl : [scriptUrl]; // index 表示即将创建的脚本的索引,当所有的脚本链接都创建之后,函数不再往下执行
|
|
11
|
+
|
|
10
12
|
if (index >= scriptUrls.length) {
|
|
11
13
|
return;
|
|
12
14
|
}
|
|
15
|
+
|
|
13
16
|
var currentScriptUrl = scriptUrls[index];
|
|
17
|
+
|
|
14
18
|
if (isValidCustomScriptUrl(currentScriptUrl)) {
|
|
15
19
|
var script = document.createElement('script');
|
|
16
20
|
script.setAttribute('src', currentScriptUrl);
|
|
17
21
|
script.setAttribute('data-namespace', currentScriptUrl);
|
|
18
22
|
customCache.add(currentScriptUrl);
|
|
19
23
|
document.body.appendChild(script);
|
|
24
|
+
|
|
20
25
|
if (scriptUrls.length > index + 1) {
|
|
21
26
|
script.onload = function () {
|
|
22
27
|
createFromScripts(scriptUrls, index + 1);
|
|
23
28
|
};
|
|
29
|
+
|
|
24
30
|
script.onerror = function () {
|
|
25
31
|
createFromScripts(scriptUrls, index + 1);
|
|
26
32
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
var _excluded = ["size", "className"];
|
|
2
|
+
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
3
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
4
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
5
9
|
import React from 'react';
|
|
6
10
|
import AntdInput from 'antd/lib/input';
|
|
7
11
|
import { getSizeType } from "../Input";
|
|
@@ -9,10 +13,11 @@ import classnames from 'classnames';
|
|
|
9
13
|
var AntdGroup = AntdInput.Group;
|
|
10
14
|
export default function Group(props) {
|
|
11
15
|
var _props$size = props.size,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
17
|
+
_props$className = props.className,
|
|
18
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
19
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
20
|
+
|
|
16
21
|
return /*#__PURE__*/React.createElement(AntdGroup, _extends({
|
|
17
22
|
className: classnames("ald-input-group-".concat(getSizeType(size)), className)
|
|
18
23
|
}, rest));
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
var _excluded = ["size", "className"];
|
|
2
|
+
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
3
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
4
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
5
9
|
import React from 'react';
|
|
6
10
|
import AntdInput from 'antd/lib/input/Input';
|
|
7
11
|
import classnames from 'classnames';
|
|
@@ -9,13 +13,15 @@ export function getSizeType(sizeType) {
|
|
|
9
13
|
if (['small', 'middle', 'large'].includes(sizeType)) {
|
|
10
14
|
return sizeType;
|
|
11
15
|
}
|
|
16
|
+
|
|
12
17
|
return 'middle';
|
|
13
18
|
}
|
|
14
19
|
var Input = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
15
20
|
var _props$size = props.size,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
21
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
22
|
+
className = props.className,
|
|
23
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
24
|
+
|
|
19
25
|
return /*#__PURE__*/React.createElement(AntdInput, _extends({}, rest, {
|
|
20
26
|
ref: ref,
|
|
21
27
|
bordered: true,
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
var _excluded = ["size", "className"];
|
|
2
|
+
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
3
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
4
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
5
9
|
import React from 'react';
|
|
6
10
|
import { EyeOffLine, EyeOnLine } from '@aloudata/icons-react';
|
|
7
11
|
import AntdPassword from 'antd/lib/input/Password';
|
|
8
12
|
import { getSizeType } from "../Input";
|
|
9
|
-
import classnames from 'classnames';
|
|
10
|
-
|
|
13
|
+
import classnames from 'classnames'; // 不同的size对应的不同的icon
|
|
14
|
+
|
|
11
15
|
export var iconSizeMap = {
|
|
12
16
|
small: 16,
|
|
13
17
|
middle: 20,
|
|
@@ -16,9 +20,10 @@ export var iconSizeMap = {
|
|
|
16
20
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
21
|
export default /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
18
22
|
var _props$size = props.size,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
24
|
+
className = props.className,
|
|
25
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
26
|
+
|
|
22
27
|
return /*#__PURE__*/React.createElement(AntdPassword, _extends({}, restProps, {
|
|
23
28
|
ref: ref,
|
|
24
29
|
className: classnames('ald-input', "ald-input-".concat(getSizeType(size)), className),
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
var _excluded = ["bordered", "size", "className"];
|
|
2
|
+
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
3
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
4
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
5
9
|
import React from 'react';
|
|
6
10
|
import AntdTextArea from 'antd/lib/input/TextArea';
|
|
7
11
|
import classnames from 'classnames';
|
|
8
12
|
import { getSizeType } from "../Input";
|
|
9
13
|
export default /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
10
14
|
var _props$bordered = props.bordered,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
bordered = _props$bordered === void 0 ? true : _props$bordered,
|
|
16
|
+
_props$size = props.size,
|
|
17
|
+
size = _props$size === void 0 ? 'middle' : _props$size,
|
|
18
|
+
_props$className = props.className,
|
|
19
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
20
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
21
|
+
|
|
17
22
|
return /*#__PURE__*/React.createElement(AntdTextArea, _extends({}, rest, {
|
|
18
23
|
className: classnames('ald-input-textarea', "ald-input-textarea-".concat(getSizeType(size)), className),
|
|
19
24
|
ref: ref,
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
1
|
var _excluded = ["className", "disabled", "size"];
|
|
2
|
+
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
|
|
7
7
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
|
+
|
|
8
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
|
+
|
|
9
11
|
import React from 'react';
|
|
10
12
|
import { InputNumber as AntInputNumber } from 'antd';
|
|
11
13
|
import classnames from 'classnames';
|
|
12
14
|
export default function InputNumber(props) {
|
|
13
15
|
var className = props.className,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
disabled = props.disabled,
|
|
17
|
+
size = props.size,
|
|
18
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
19
|
+
|
|
17
20
|
var getClassName = function getClassName() {
|
|
18
21
|
var _classnames;
|
|
22
|
+
|
|
19
23
|
return classnames(className, 'ald-inputNumber', (_classnames = {
|
|
20
24
|
'ald-inputNumber-disabled': disabled
|
|
21
25
|
}, _defineProperty(_classnames, "ald-inputNumber-large", size === 'large'), _defineProperty(_classnames, "ald-inputNumber-small", size === 'small'), _defineProperty(_classnames, "ald-inputNumber-middle", size !== 'large' && size !== 'small'), _classnames));
|
|
22
26
|
};
|
|
27
|
+
|
|
23
28
|
return /*#__PURE__*/React.createElement(AntInputNumber, _extends({}, rest, {
|
|
24
29
|
disabled: disabled,
|
|
25
30
|
size: size,
|
package/dist/Menu/SubMenu.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
var _excluded = ["popupClassName"];
|
|
2
|
+
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
3
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
4
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
5
9
|
import classNames from 'classnames';
|
|
6
10
|
import React from 'react';
|
|
7
11
|
import { Menu as AntdMenu } from 'antd';
|
|
8
12
|
var AntdSubMenu = AntdMenu.SubMenu;
|
|
9
13
|
export default function SubMenu(props) {
|
|
10
14
|
var popupClassName = props.popupClassName,
|
|
11
|
-
|
|
15
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
16
|
+
|
|
12
17
|
var OFFSET_WIDTH = 8;
|
|
13
18
|
var OFFSET_HEIGHT = 0;
|
|
14
19
|
return /*#__PURE__*/React.createElement(AntdSubMenu, _extends({
|
package/dist/Menu/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
var _excluded = ["className", "expandIcon"];
|
|
2
|
+
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
|
|
3
5
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
|
+
|
|
4
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8
|
+
|
|
5
9
|
import { ChevronRightLine } from '@aloudata/icons-react';
|
|
6
10
|
import { Menu as AntdMenu } from 'antd';
|
|
7
11
|
import classNames from 'classnames';
|
|
@@ -12,8 +16,9 @@ import MenuItem from "./MenuItem";
|
|
|
12
16
|
import SubMenu from "./SubMenu";
|
|
13
17
|
export default function Menu(props) {
|
|
14
18
|
var className = props.className,
|
|
15
|
-
|
|
16
|
-
|
|
19
|
+
expandIcon = props.expandIcon,
|
|
20
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
21
|
+
|
|
17
22
|
return /*#__PURE__*/React.createElement(AntdMenu, _extends({
|
|
18
23
|
className: classNames(className, 'ald-menu'),
|
|
19
24
|
expandIcon: expandIcon || /*#__PURE__*/React.createElement(ChevronRightLine, {
|
package/dist/Modal/index.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
1
|
var _excluded = ["className", "type", "loading", "size", "disabled", "shape"],
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
_excluded2 = ["className", "children", "okType", "width", "closeIcon", "subTitle", "okButtonProps", "cancelButtonProps", "okText", "cancelText", "icon", "title", "paddingLess"],
|
|
3
|
+
_excluded3 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
4
|
+
_excluded4 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
5
|
+
_excluded5 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
6
|
+
_excluded6 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
7
|
+
_excluded7 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "className", "okText", "cancelText"];
|
|
8
|
+
|
|
9
9
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
|
+
|
|
10
11
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
|
|
11
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
|
|
15
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
18
|
+
|
|
16
19
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
20
|
+
|
|
17
21
|
import { AlertTriangleDuotone, CheckCircleDuotone, CloseLLine, InfoCircleLine } from '@aloudata/icons-react';
|
|
18
22
|
import { Modal as AntdModal } from 'antd';
|
|
19
23
|
import { modalGlobalConfig } from 'antd/lib/modal/confirm';
|
|
@@ -22,23 +26,25 @@ import classNames from 'classnames';
|
|
|
22
26
|
import React from 'react';
|
|
23
27
|
import { btnPrefix, getButtonSizeClass, getButtonType, getDangerStatus, getShape } from "../Button";
|
|
24
28
|
import DoubleCircleIcon from "../DoubleCircleIcon";
|
|
25
|
-
import theme from "../style/themes/default/themeColor.module.less";
|
|
26
|
-
// export type { ModalProps, ModalFuncProps };
|
|
29
|
+
import theme from "../style/themes/default/themeColor.module.less"; // export type { ModalProps, ModalFuncProps };
|
|
27
30
|
|
|
28
31
|
export var destroyFns = [];
|
|
29
32
|
var DEFAULT_WIDTH = 552;
|
|
33
|
+
|
|
30
34
|
function getButtonProps(buttonProps, defaultBtnType, okType) {
|
|
31
35
|
var btnType = okType || defaultBtnType;
|
|
36
|
+
|
|
32
37
|
var buttonClassName = buttonProps.className,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
_buttonProps$type = buttonProps.type,
|
|
39
|
+
type = _buttonProps$type === void 0 ? btnType : _buttonProps$type,
|
|
40
|
+
loading = buttonProps.loading,
|
|
41
|
+
_buttonProps$size = buttonProps.size,
|
|
42
|
+
size = _buttonProps$size === void 0 ? 'middle' : _buttonProps$size,
|
|
43
|
+
disabled = buttonProps.disabled,
|
|
44
|
+
_buttonProps$shape = buttonProps.shape,
|
|
45
|
+
shape = _buttonProps$shape === void 0 ? 'default' : _buttonProps$shape,
|
|
46
|
+
restProps = _objectWithoutProperties(buttonProps, _excluded);
|
|
47
|
+
|
|
42
48
|
return _objectSpread(_objectSpread({}, restProps), {}, {
|
|
43
49
|
disabled: loading ? true : disabled,
|
|
44
50
|
loading: loading,
|
|
@@ -48,10 +54,11 @@ function getButtonProps(buttonProps, defaultBtnType, okType) {
|
|
|
48
54
|
shape: getShape(shape)
|
|
49
55
|
});
|
|
50
56
|
}
|
|
57
|
+
|
|
51
58
|
var ModalTitle = function ModalTitle(_ref) {
|
|
52
59
|
var icon = _ref.icon,
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
title = _ref.title,
|
|
61
|
+
subTitle = _ref.subTitle;
|
|
55
62
|
return /*#__PURE__*/React.createElement("div", {
|
|
56
63
|
className: 'ald-modal-title-container'
|
|
57
64
|
}, icon, /*#__PURE__*/React.createElement("div", {
|
|
@@ -62,32 +69,33 @@ var ModalTitle = function ModalTitle(_ref) {
|
|
|
62
69
|
className: 'subTitle'
|
|
63
70
|
}, subTitle)));
|
|
64
71
|
};
|
|
72
|
+
|
|
65
73
|
var OriginModal = function OriginModal(props) {
|
|
66
74
|
var className = props.className,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
children = props.children,
|
|
76
|
+
okType = props.okType,
|
|
77
|
+
width = props.width,
|
|
78
|
+
closeIcon = props.closeIcon,
|
|
79
|
+
subTitle = props.subTitle,
|
|
80
|
+
_props$okButtonProps = props.okButtonProps,
|
|
81
|
+
okButtonProps = _props$okButtonProps === void 0 ? {} : _props$okButtonProps,
|
|
82
|
+
_props$cancelButtonPr = props.cancelButtonProps,
|
|
83
|
+
cancelButtonProps = _props$cancelButtonPr === void 0 ? {} : _props$cancelButtonPr,
|
|
84
|
+
_props$okText = props.okText,
|
|
85
|
+
okText = _props$okText === void 0 ? '确定' : _props$okText,
|
|
86
|
+
_props$cancelText = props.cancelText,
|
|
87
|
+
cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
|
|
88
|
+
icon = props.icon,
|
|
89
|
+
title = props.title,
|
|
90
|
+
paddingLess = props.paddingLess,
|
|
91
|
+
restProps = _objectWithoutProperties(props, _excluded2);
|
|
92
|
+
|
|
84
93
|
return /*#__PURE__*/React.createElement(AntdModal, _extends({}, restProps, {
|
|
85
94
|
title: ModalTitle({
|
|
86
95
|
icon: icon,
|
|
87
96
|
title: title,
|
|
88
97
|
subTitle: subTitle
|
|
89
|
-
})
|
|
90
|
-
// title={
|
|
98
|
+
}) // title={
|
|
91
99
|
// <div className={'ald-modal-title-container'}>
|
|
92
100
|
// {icon}
|
|
93
101
|
// <div className={'ald-modal-text-container'}>
|
|
@@ -112,23 +120,26 @@ var OriginModal = function OriginModal(props) {
|
|
|
112
120
|
})
|
|
113
121
|
}), children);
|
|
114
122
|
};
|
|
123
|
+
|
|
115
124
|
OriginModal.useModal = useModal;
|
|
116
125
|
var Modal = OriginModal;
|
|
126
|
+
|
|
117
127
|
Modal.info = function infoFn(props) {
|
|
118
128
|
var _props$okButtonProps2 = props.okButtonProps,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
okButtonProps = _props$okButtonProps2 === void 0 ? {} : _props$okButtonProps2,
|
|
130
|
+
_props$cancelButtonPr2 = props.cancelButtonProps,
|
|
131
|
+
cancelButtonProps = _props$cancelButtonPr2 === void 0 ? {} : _props$cancelButtonPr2,
|
|
132
|
+
okType = props.okType,
|
|
133
|
+
width = props.width,
|
|
134
|
+
title = props.title,
|
|
135
|
+
subTitle = props.subTitle,
|
|
136
|
+
_props$okText2 = props.okText,
|
|
137
|
+
okText = _props$okText2 === void 0 ? '确定' : _props$okText2,
|
|
138
|
+
_props$cancelText2 = props.cancelText,
|
|
139
|
+
cancelText = _props$cancelText2 === void 0 ? '取消' : _props$cancelText2,
|
|
140
|
+
className = props.className,
|
|
141
|
+
restProps = _objectWithoutProperties(props, _excluded3);
|
|
142
|
+
|
|
132
143
|
return AntdModal.info(_objectSpread({
|
|
133
144
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
134
145
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -149,21 +160,23 @@ Modal.info = function infoFn(props) {
|
|
|
149
160
|
cancelText: cancelText
|
|
150
161
|
}, restProps));
|
|
151
162
|
};
|
|
163
|
+
|
|
152
164
|
Modal.success = function successFn(props) {
|
|
153
165
|
var _props$okButtonProps3 = props.okButtonProps,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
okButtonProps = _props$okButtonProps3 === void 0 ? {} : _props$okButtonProps3,
|
|
167
|
+
_props$cancelButtonPr3 = props.cancelButtonProps,
|
|
168
|
+
cancelButtonProps = _props$cancelButtonPr3 === void 0 ? {} : _props$cancelButtonPr3,
|
|
169
|
+
okType = props.okType,
|
|
170
|
+
width = props.width,
|
|
171
|
+
title = props.title,
|
|
172
|
+
subTitle = props.subTitle,
|
|
173
|
+
_props$okText3 = props.okText,
|
|
174
|
+
okText = _props$okText3 === void 0 ? '确定' : _props$okText3,
|
|
175
|
+
_props$cancelText3 = props.cancelText,
|
|
176
|
+
cancelText = _props$cancelText3 === void 0 ? '取消' : _props$cancelText3,
|
|
177
|
+
className = props.className,
|
|
178
|
+
restProps = _objectWithoutProperties(props, _excluded4);
|
|
179
|
+
|
|
167
180
|
return AntdModal.success(_objectSpread({
|
|
168
181
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
169
182
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -184,21 +197,23 @@ Modal.success = function successFn(props) {
|
|
|
184
197
|
cancelText: cancelText
|
|
185
198
|
}, restProps));
|
|
186
199
|
};
|
|
200
|
+
|
|
187
201
|
Modal.error = function errorFn(props) {
|
|
188
202
|
var _props$okButtonProps4 = props.okButtonProps,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
okButtonProps = _props$okButtonProps4 === void 0 ? {} : _props$okButtonProps4,
|
|
204
|
+
_props$cancelButtonPr4 = props.cancelButtonProps,
|
|
205
|
+
cancelButtonProps = _props$cancelButtonPr4 === void 0 ? {} : _props$cancelButtonPr4,
|
|
206
|
+
okType = props.okType,
|
|
207
|
+
width = props.width,
|
|
208
|
+
title = props.title,
|
|
209
|
+
subTitle = props.subTitle,
|
|
210
|
+
_props$okText4 = props.okText,
|
|
211
|
+
okText = _props$okText4 === void 0 ? '确定' : _props$okText4,
|
|
212
|
+
_props$cancelText4 = props.cancelText,
|
|
213
|
+
cancelText = _props$cancelText4 === void 0 ? '取消' : _props$cancelText4,
|
|
214
|
+
className = props.className,
|
|
215
|
+
restProps = _objectWithoutProperties(props, _excluded5);
|
|
216
|
+
|
|
202
217
|
return AntdModal.error(_objectSpread({
|
|
203
218
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
204
219
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -219,21 +234,23 @@ Modal.error = function errorFn(props) {
|
|
|
219
234
|
cancelText: cancelText
|
|
220
235
|
}, restProps));
|
|
221
236
|
};
|
|
237
|
+
|
|
222
238
|
Modal.warning = function modalWarn(props) {
|
|
223
239
|
var _props$okButtonProps5 = props.okButtonProps,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
240
|
+
okButtonProps = _props$okButtonProps5 === void 0 ? {} : _props$okButtonProps5,
|
|
241
|
+
_props$cancelButtonPr5 = props.cancelButtonProps,
|
|
242
|
+
cancelButtonProps = _props$cancelButtonPr5 === void 0 ? {} : _props$cancelButtonPr5,
|
|
243
|
+
okType = props.okType,
|
|
244
|
+
width = props.width,
|
|
245
|
+
title = props.title,
|
|
246
|
+
subTitle = props.subTitle,
|
|
247
|
+
_props$okText5 = props.okText,
|
|
248
|
+
okText = _props$okText5 === void 0 ? '确定' : _props$okText5,
|
|
249
|
+
_props$cancelText5 = props.cancelText,
|
|
250
|
+
cancelText = _props$cancelText5 === void 0 ? '取消' : _props$cancelText5,
|
|
251
|
+
className = props.className,
|
|
252
|
+
restProps = _objectWithoutProperties(props, _excluded6);
|
|
253
|
+
|
|
237
254
|
return AntdModal.warning(_objectSpread({
|
|
238
255
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
239
256
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -255,21 +272,23 @@ Modal.warning = function modalWarn(props) {
|
|
|
255
272
|
cancelText: cancelText
|
|
256
273
|
}, restProps));
|
|
257
274
|
};
|
|
275
|
+
|
|
258
276
|
Modal.confirm = function confirmFn(props) {
|
|
259
277
|
var _props$okButtonProps6 = props.okButtonProps,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
278
|
+
okButtonProps = _props$okButtonProps6 === void 0 ? {} : _props$okButtonProps6,
|
|
279
|
+
_props$cancelButtonPr6 = props.cancelButtonProps,
|
|
280
|
+
cancelButtonProps = _props$cancelButtonPr6 === void 0 ? {} : _props$cancelButtonPr6,
|
|
281
|
+
okType = props.okType,
|
|
282
|
+
width = props.width,
|
|
283
|
+
title = props.title,
|
|
284
|
+
subTitle = props.subTitle,
|
|
285
|
+
className = props.className,
|
|
286
|
+
_props$okText6 = props.okText,
|
|
287
|
+
okText = _props$okText6 === void 0 ? '确定' : _props$okText6,
|
|
288
|
+
_props$cancelText6 = props.cancelText,
|
|
289
|
+
cancelText = _props$cancelText6 === void 0 ? '取消' : _props$cancelText6,
|
|
290
|
+
restProps = _objectWithoutProperties(props, _excluded7);
|
|
291
|
+
|
|
273
292
|
return AntdModal.confirm(_objectSpread({
|
|
274
293
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
275
294
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -290,13 +309,16 @@ Modal.confirm = function confirmFn(props) {
|
|
|
290
309
|
cancelText: cancelText
|
|
291
310
|
}, restProps));
|
|
292
311
|
};
|
|
312
|
+
|
|
293
313
|
Modal.destroyAll = function destroyAllFn() {
|
|
294
314
|
while (destroyFns.length) {
|
|
295
315
|
var close = destroyFns.pop();
|
|
316
|
+
|
|
296
317
|
if (close) {
|
|
297
318
|
close();
|
|
298
319
|
}
|
|
299
320
|
}
|
|
300
321
|
};
|
|
322
|
+
|
|
301
323
|
Modal.config = modalGlobalConfig;
|
|
302
324
|
export default Modal;
|