@aloudata/aloudata-design 0.4.8-beta.14 → 0.4.8-beta.16
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/Button/style/variables.less +3 -3
- 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 +2 -1
- 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
package/dist/Tabs/index.js
CHANGED
|
@@ -1,54 +1,69 @@
|
|
|
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 = ["size", "className", "popupClassName", "adaptHeight", "style", "monospace", "tabPosition", "padding"];
|
|
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
|
+
|
|
4
5
|
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; }
|
|
6
|
+
|
|
5
7
|
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; }
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
9
11
|
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; }
|
|
12
|
+
|
|
10
13
|
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; }
|
|
11
|
-
|
|
12
|
-
// import AntdTabs, { TabsProps } from 'antd/lib/tabs';
|
|
14
|
+
|
|
15
|
+
import React, { useMemo } from 'react'; // import AntdTabs, { TabsProps } from 'antd/lib/tabs';
|
|
16
|
+
|
|
13
17
|
import { MoreVerticalLine } from '@aloudata/icons-react';
|
|
14
18
|
import { Tabs as AntdTabs } from 'antd';
|
|
15
19
|
import classNames from 'classnames';
|
|
16
20
|
import TabPane from "./TabPane";
|
|
17
21
|
export default function Tabs(props) {
|
|
18
22
|
var size = props.size,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
className = props.className,
|
|
24
|
+
popupClassName = props.popupClassName,
|
|
25
|
+
adaptHeight = props.adaptHeight,
|
|
26
|
+
_props$style = props.style,
|
|
27
|
+
style = _props$style === void 0 ? {} : _props$style,
|
|
28
|
+
monospace = props.monospace,
|
|
29
|
+
_props$tabPosition = props.tabPosition,
|
|
30
|
+
tabPosition = _props$tabPosition === void 0 ? 'top' : _props$tabPosition,
|
|
31
|
+
_props$padding = props.padding,
|
|
32
|
+
padding = _props$padding === void 0 ? false : _props$padding,
|
|
33
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
34
|
+
|
|
30
35
|
var headerBackgroundColor = props.headerBackgroundColor;
|
|
36
|
+
|
|
31
37
|
var tabsProps = _objectSpread({}, otherProps);
|
|
38
|
+
|
|
32
39
|
if (size === 'large') {
|
|
33
40
|
tabsProps.size = size;
|
|
34
41
|
}
|
|
42
|
+
|
|
35
43
|
var _monospace = tabPosition !== 'top' ? false : monospace;
|
|
44
|
+
|
|
36
45
|
var _padding = useMemo(function () {
|
|
37
46
|
if (tabPosition !== 'top') return 0;
|
|
47
|
+
|
|
38
48
|
if (typeof padding === 'number') {
|
|
39
49
|
return padding;
|
|
40
50
|
}
|
|
51
|
+
|
|
41
52
|
if (typeof padding === 'boolean' && padding) {
|
|
42
53
|
return 16;
|
|
43
54
|
}
|
|
55
|
+
|
|
44
56
|
return 0;
|
|
45
57
|
}, [padding, tabPosition]);
|
|
58
|
+
|
|
46
59
|
var getTabBarGutter = function getTabBarGutter() {
|
|
47
60
|
if (tabPosition === 'top' && !_monospace) {
|
|
48
61
|
return 24;
|
|
49
62
|
}
|
|
63
|
+
|
|
50
64
|
return 0;
|
|
51
65
|
};
|
|
66
|
+
|
|
52
67
|
return /*#__PURE__*/React.createElement(AntdTabs, _extends({
|
|
53
68
|
moreIcon: /*#__PURE__*/React.createElement("div", {
|
|
54
69
|
className: "ald-tabs-more-icon"
|
package/dist/Tooltip/index.js
CHANGED
|
@@ -3,18 +3,18 @@ import AntdTooltip from 'antd/lib/tooltip';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
export default function Tooltip(props) {
|
|
5
5
|
var children = props.children,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
title = props.title,
|
|
7
|
+
open = props.open,
|
|
8
|
+
onOpenChange = props.onOpenChange,
|
|
9
|
+
trigger = props.trigger,
|
|
10
|
+
zIndex = props.zIndex,
|
|
11
|
+
placement = props.placement,
|
|
12
|
+
mouseEnterDelay = props.mouseEnterDelay,
|
|
13
|
+
mouseLeaveDelay = props.mouseLeaveDelay,
|
|
14
|
+
getPopupContainer = props.getPopupContainer,
|
|
15
|
+
destroyTooltipOnHide = props.destroyTooltipOnHide,
|
|
16
|
+
getTooltipContainer = props.getTooltipContainer,
|
|
17
|
+
overlayClassName = props.overlayClassName;
|
|
18
18
|
return /*#__PURE__*/React.createElement(AntdTooltip, {
|
|
19
19
|
title: title,
|
|
20
20
|
overlayClassName: classNames('ald-tooltip-overlay', overlayClassName),
|
|
@@ -5,12 +5,18 @@
|
|
|
5
5
|
padding: 6px 12px;
|
|
6
6
|
line-height: 20px;
|
|
7
7
|
background: @BG10;
|
|
8
|
-
border-radius:
|
|
8
|
+
border-radius: 4px;
|
|
9
9
|
box-shadow: none;
|
|
10
10
|
color:@ND0;
|
|
11
11
|
font-size: 13px;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
.ant-tooltip-arrow {
|
|
15
|
+
&::before{
|
|
16
|
+
background-color: @BG10;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
.ant-tooltip-arrow-content {
|
|
15
21
|
background: @BG10;
|
|
16
22
|
}
|
package/dist/Tree/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
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); }
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { ChevronDownLine } from '@aloudata/icons-react';
|
|
4
4
|
import { Tree as AntdTree } from 'antd';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import theme from "../style/themes/default/themeColor.module.less";
|
|
7
|
+
|
|
7
8
|
function Tree(props, ref) {
|
|
8
|
-
var restProps = Object.assign({},
|
|
9
|
+
var restProps = Object.assign({}, props);
|
|
9
10
|
return /*#__PURE__*/React.createElement(AntdTree, _extends({}, restProps, {
|
|
10
11
|
ref: ref,
|
|
11
12
|
switcherIcon: /*#__PURE__*/React.createElement(ChevronDownLine, {
|
|
@@ -14,4 +15,5 @@ function Tree(props, ref) {
|
|
|
14
15
|
}, "\u5C55\u5F00")
|
|
15
16
|
}));
|
|
16
17
|
}
|
|
18
|
+
|
|
17
19
|
export default /*#__PURE__*/React.forwardRef(Tree);
|
|
@@ -1,36 +1,47 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
|
|
2
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
|
|
3
5
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
+
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
+
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
+
|
|
6
11
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
+
|
|
7
13
|
import { useState, useEffect, useRef, useDebugValue } from 'react';
|
|
8
14
|
import { isUndefined } from 'lodash';
|
|
15
|
+
|
|
9
16
|
function format(_ref) {
|
|
10
17
|
var _ref2 = _slicedToArray(_ref, 2),
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
innerState = _ref2[0],
|
|
19
|
+
outerState = _ref2[1];
|
|
20
|
+
|
|
13
21
|
var isControlled = isUndefined(outerState) ? 'uncontrolled' : 'controlled';
|
|
14
22
|
var value = isUndefined(outerState) ? innerState : outerState;
|
|
15
23
|
return "State is ".concat(isControlled, " | Value is ").concat(value);
|
|
16
24
|
}
|
|
25
|
+
|
|
17
26
|
var useControlledState = function useControlledState(outerState, defaultOuterState, callback) {
|
|
18
27
|
// if (outerState === undefined && defaultOuterState === undefined) {
|
|
19
28
|
// throw new TypeError('Either "value" or "defaultValue" variable must be set. Now both are undefined');
|
|
20
29
|
// }
|
|
21
30
|
var _useState = useState(isUndefined(outerState) ? defaultOuterState : outerState),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
innerState = _useState2[0],
|
|
33
|
+
setInnerState = _useState2[1];
|
|
34
|
+
|
|
25
35
|
var setState = useRef(function (state) {
|
|
26
36
|
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
37
|
+
|
|
27
38
|
if (isUndefined(outerState) || force) {
|
|
28
39
|
setInnerState(state);
|
|
29
40
|
}
|
|
41
|
+
|
|
30
42
|
callback === null || callback === void 0 ? void 0 : callback(state);
|
|
31
|
-
}).current;
|
|
43
|
+
}).current; // @ts-ignore
|
|
32
44
|
|
|
33
|
-
// @ts-ignore
|
|
34
45
|
useDebugValue([innerState, outerState], format);
|
|
35
46
|
useEffect(function () {
|
|
36
47
|
if (!isUndefined(outerState)) {
|
|
@@ -39,4 +50,5 @@ var useControlledState = function useControlledState(outerState, defaultOuterSta
|
|
|
39
50
|
}, [outerState]);
|
|
40
51
|
return [innerState, setState];
|
|
41
52
|
};
|
|
53
|
+
|
|
42
54
|
export default useControlledState;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
|
3
3
|
var uuid = 0;
|
|
4
|
-
|
|
5
4
|
/** Is client side and not jsdom */
|
|
6
5
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
7
|
-
export var isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();
|
|
8
6
|
|
|
7
|
+
export var isBrowserClient = process.env.NODE_ENV !== 'test' && canUseDom();
|
|
9
8
|
/** Get unique id for accessibility usage */
|
|
9
|
+
|
|
10
10
|
export function getUUID() {
|
|
11
|
-
var retId;
|
|
11
|
+
var retId; // Test never reach
|
|
12
12
|
|
|
13
|
-
// Test never reach
|
|
14
13
|
/* istanbul ignore if */
|
|
14
|
+
|
|
15
15
|
if (isBrowserClient) {
|
|
16
16
|
retId = uuid;
|
|
17
17
|
uuid += 1;
|
|
18
18
|
} else {
|
|
19
19
|
retId = 'TEST_OR_SSR';
|
|
20
20
|
}
|
|
21
|
+
|
|
21
22
|
return retId;
|
|
22
23
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { ConfigProvider } from 'antd';
|
|
3
3
|
var ConfigContext = ConfigProvider.ConfigContext;
|
|
4
|
+
|
|
4
5
|
var usePrefixCls = function usePrefixCls(subPrefixCls, customRootPrefixCls) {
|
|
5
6
|
var _useContext = useContext(ConfigContext),
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
rootPrefixCls = _useContext.rootPrefixCls,
|
|
8
|
+
getPrefixCls = _useContext.getPrefixCls;
|
|
9
|
+
|
|
8
10
|
return getPrefixCls(subPrefixCls, customRootPrefixCls !== null && customRootPrefixCls !== void 0 ? customRootPrefixCls : rootPrefixCls);
|
|
9
11
|
};
|
|
12
|
+
|
|
10
13
|
export default usePrefixCls;
|
package/dist/index.js
CHANGED
|
@@ -17,8 +17,7 @@ export { default as Upload } from "./Upload";
|
|
|
17
17
|
export { default as ConfigProvider } from "./ConfigProvider";
|
|
18
18
|
export { default as DatePicker } from "./DatePicker";
|
|
19
19
|
export { default as Layout } from "./Layout";
|
|
20
|
-
export { default as message } from "./message";
|
|
21
|
-
// alias, keep API the same as antd
|
|
20
|
+
export { default as message } from "./message"; // alias, keep API the same as antd
|
|
22
21
|
|
|
23
22
|
export { default as notification } from "./notification";
|
|
24
23
|
export { default as Tree } from "./Tree";
|
|
@@ -1,21 +1,35 @@
|
|
|
1
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
|
+
|
|
2
3
|
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; }
|
|
4
|
+
|
|
3
5
|
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; }
|
|
6
|
+
|
|
4
7
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
-
|
|
8
|
+
|
|
9
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
10
|
+
|
|
6
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
12
|
+
|
|
7
13
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
14
|
+
|
|
8
15
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
16
|
+
|
|
9
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
18
|
+
|
|
10
19
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20
|
+
|
|
11
21
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22
|
+
|
|
12
23
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
+
|
|
13
25
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
26
|
+
|
|
27
|
+
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; }
|
|
28
|
+
|
|
17
29
|
/* eslint-disable react/static-property-placement */
|
|
30
|
+
|
|
18
31
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
32
|
+
|
|
19
33
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
20
34
|
import memoizeOne from 'memoize-one';
|
|
21
35
|
import * as React from 'react';
|
|
@@ -23,24 +37,31 @@ import warning from 'antd/es/_util/warning';
|
|
|
23
37
|
import { changeConfirmLocale } from 'antd/es/modal/locale';
|
|
24
38
|
import LocaleContext from "./context";
|
|
25
39
|
export var ANT_MARK = 'internalMark';
|
|
40
|
+
|
|
26
41
|
var LocaleProvider = /*#__PURE__*/function (_React$Component) {
|
|
27
42
|
_inherits(LocaleProvider, _React$Component);
|
|
43
|
+
|
|
28
44
|
var _super = _createSuper(LocaleProvider);
|
|
45
|
+
|
|
29
46
|
function LocaleProvider(props) {
|
|
30
47
|
var _this;
|
|
48
|
+
|
|
31
49
|
_classCallCheck(this, LocaleProvider);
|
|
50
|
+
|
|
32
51
|
_this = _super.call(this, props);
|
|
52
|
+
|
|
33
53
|
_defineProperty(_assertThisInitialized(_this), "getMemoizedContextValue", memoizeOne(function (localeValue) {
|
|
34
54
|
return _objectSpread(_objectSpread({}, localeValue), {}, {
|
|
35
55
|
exist: true
|
|
36
56
|
});
|
|
37
57
|
}));
|
|
58
|
+
|
|
38
59
|
changeConfirmLocale(props.locale && props.locale.Modal);
|
|
39
|
-
warning(
|
|
40
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
60
|
+
warning( // eslint-disable-next-line no-underscore-dangle
|
|
41
61
|
props._ANT_MARK__ === ANT_MARK, 'LocaleProvider', '`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale');
|
|
42
62
|
return _this;
|
|
43
63
|
}
|
|
64
|
+
|
|
44
65
|
_createClass(LocaleProvider, [{
|
|
45
66
|
key: "componentDidMount",
|
|
46
67
|
value: function componentDidMount() {
|
|
@@ -50,6 +71,7 @@ var LocaleProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
50
71
|
key: "componentDidUpdate",
|
|
51
72
|
value: function componentDidUpdate(prevProps) {
|
|
52
73
|
var locale = this.props.locale;
|
|
74
|
+
|
|
53
75
|
if (prevProps.locale !== locale) {
|
|
54
76
|
changeConfirmLocale(locale && locale.Modal);
|
|
55
77
|
}
|
|
@@ -63,18 +85,21 @@ var LocaleProvider = /*#__PURE__*/function (_React$Component) {
|
|
|
63
85
|
key: "render",
|
|
64
86
|
value: function render() {
|
|
65
87
|
var _this$props = this.props,
|
|
66
|
-
|
|
67
|
-
|
|
88
|
+
locale = _this$props.locale,
|
|
89
|
+
children = _this$props.children;
|
|
68
90
|
var contextValue = this.getMemoizedContextValue(locale);
|
|
69
91
|
return /*#__PURE__*/React.createElement(LocaleContext.Provider, {
|
|
70
92
|
value: contextValue
|
|
71
93
|
}, children);
|
|
72
94
|
}
|
|
73
95
|
}]);
|
|
96
|
+
|
|
74
97
|
return LocaleProvider;
|
|
75
98
|
}(React.Component);
|
|
99
|
+
|
|
76
100
|
_defineProperty(LocaleProvider, "defaultProps", {
|
|
77
101
|
// eslint-disable-next-line react/default-props-match-prop-types
|
|
78
102
|
locale: {}
|
|
79
103
|
});
|
|
104
|
+
|
|
80
105
|
export { LocaleProvider as default };
|
package/dist/message/index.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
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; }
|
|
2
|
+
|
|
2
3
|
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; }
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
|
|
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
|
+
|
|
6
7
|
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); }
|
|
8
|
+
|
|
7
9
|
import React from 'react';
|
|
8
10
|
import { message as AntdMessage } from 'antd';
|
|
9
11
|
import { InfoCircleLine, CheckCircleDuotone, AlertTriangleDuotone, LoadingLine } from '@aloudata/icons-react';
|
|
10
12
|
import styles from "../style/themes/default/themeColor.module.less";
|
|
13
|
+
|
|
11
14
|
function isReactNode(value) {
|
|
12
15
|
return typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || _typeof(value) === 'symbol' || value === null || value === undefined || /*#__PURE__*/React.isValidElement(value);
|
|
13
16
|
}
|
|
17
|
+
|
|
14
18
|
var iconMap = {
|
|
15
19
|
info: {
|
|
16
20
|
icon: /*#__PURE__*/React.createElement("div", {
|
|
@@ -7,6 +7,7 @@ export default (function () {
|
|
|
7
7
|
description: 'description,description,description,description,description,description,description,description'
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
|
|
10
11
|
return /*#__PURE__*/React.createElement(Space, {
|
|
11
12
|
direction: "vertical"
|
|
12
13
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
var _excluded = ["icon", "className", "style", "closeIcon"],
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
_excluded2 = ["icon", "className", "style", "closeIcon"],
|
|
3
|
+
_excluded3 = ["icon", "className", "style", "closeIcon"],
|
|
4
|
+
_excluded4 = ["icon", "className", "style", "closeIcon"];
|
|
5
|
+
|
|
6
6
|
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; }
|
|
7
|
+
|
|
7
8
|
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; }
|
|
9
|
+
|
|
8
10
|
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; }
|
|
11
|
+
|
|
9
12
|
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; }
|
|
10
|
-
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
+
|
|
14
|
+
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; }
|
|
15
|
+
|
|
13
16
|
import { AlertTriangleDuotone, CancelCircleDuotone, CheckCircleDuotone, CloseMLine, InfoCircleLine } from '@aloudata/icons-react';
|
|
14
17
|
import { notification as AntdNotification } from 'antd';
|
|
15
18
|
import classnames from 'classnames';
|
|
@@ -40,6 +43,7 @@ var closeX = /*#__PURE__*/React.createElement(CloseMLine, {
|
|
|
40
43
|
size: 20,
|
|
41
44
|
fill: theme.NL40
|
|
42
45
|
});
|
|
46
|
+
|
|
43
47
|
var getSDefaultStyle = function getSDefaultStyle(type) {
|
|
44
48
|
return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
45
49
|
padding: '16px 24px',
|
|
@@ -61,20 +65,22 @@ var getSDefaultStyle = function getSDefaultStyle(type) {
|
|
|
61
65
|
borderColor: theme.B60
|
|
62
66
|
});
|
|
63
67
|
};
|
|
68
|
+
|
|
64
69
|
var notification = {
|
|
65
70
|
open: function open(config) {
|
|
66
71
|
return AntdNotification.open(config);
|
|
67
72
|
},
|
|
68
73
|
success: function success(config) {
|
|
69
74
|
var _config$icon = config.icon,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
icon = _config$icon === void 0 ? iconMap.success : _config$icon,
|
|
76
|
+
_config$className = config.className,
|
|
77
|
+
className = _config$className === void 0 ? classnames('ald-notification-notice', config.className) : _config$className,
|
|
78
|
+
_config$style = config.style,
|
|
79
|
+
style = _config$style === void 0 ? Object.assign(getSDefaultStyle('success'), config.style) : _config$style,
|
|
80
|
+
_config$closeIcon = config.closeIcon,
|
|
81
|
+
closeIcon = _config$closeIcon === void 0 ? closeX : _config$closeIcon,
|
|
82
|
+
rest = _objectWithoutProperties(config, _excluded);
|
|
83
|
+
|
|
78
84
|
return AntdNotification.success(_objectSpread({
|
|
79
85
|
icon: icon,
|
|
80
86
|
style: style,
|
|
@@ -84,14 +90,15 @@ var notification = {
|
|
|
84
90
|
},
|
|
85
91
|
error: function error(config) {
|
|
86
92
|
var _config$icon2 = config.icon,
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
icon = _config$icon2 === void 0 ? iconMap.error : _config$icon2,
|
|
94
|
+
_config$className2 = config.className,
|
|
95
|
+
className = _config$className2 === void 0 ? classnames('ald-notification-notice', config.className) : _config$className2,
|
|
96
|
+
_config$style2 = config.style,
|
|
97
|
+
style = _config$style2 === void 0 ? Object.assign(getSDefaultStyle('error'), config.style) : _config$style2,
|
|
98
|
+
_config$closeIcon2 = config.closeIcon,
|
|
99
|
+
closeIcon = _config$closeIcon2 === void 0 ? closeX : _config$closeIcon2,
|
|
100
|
+
rest = _objectWithoutProperties(config, _excluded2);
|
|
101
|
+
|
|
95
102
|
return AntdNotification.error(_objectSpread({
|
|
96
103
|
icon: icon,
|
|
97
104
|
style: style,
|
|
@@ -101,14 +108,15 @@ var notification = {
|
|
|
101
108
|
},
|
|
102
109
|
warning: function warning(config) {
|
|
103
110
|
var _config$icon3 = config.icon,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
icon = _config$icon3 === void 0 ? iconMap.warning : _config$icon3,
|
|
112
|
+
_config$className3 = config.className,
|
|
113
|
+
className = _config$className3 === void 0 ? classnames('ald-notification-notice', config.className) : _config$className3,
|
|
114
|
+
_config$style3 = config.style,
|
|
115
|
+
style = _config$style3 === void 0 ? Object.assign(getSDefaultStyle('warning'), config.style) : _config$style3,
|
|
116
|
+
_config$closeIcon3 = config.closeIcon,
|
|
117
|
+
closeIcon = _config$closeIcon3 === void 0 ? closeX : _config$closeIcon3,
|
|
118
|
+
rest = _objectWithoutProperties(config, _excluded3);
|
|
119
|
+
|
|
112
120
|
return AntdNotification.warning(_objectSpread({
|
|
113
121
|
icon: icon,
|
|
114
122
|
style: style,
|
|
@@ -118,14 +126,15 @@ var notification = {
|
|
|
118
126
|
},
|
|
119
127
|
info: function info(config) {
|
|
120
128
|
var _config$icon4 = config.icon,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
+
icon = _config$icon4 === void 0 ? iconMap.info : _config$icon4,
|
|
130
|
+
_config$className4 = config.className,
|
|
131
|
+
className = _config$className4 === void 0 ? classnames('ald-notification-notice', config.className) : _config$className4,
|
|
132
|
+
_config$style4 = config.style,
|
|
133
|
+
style = _config$style4 === void 0 ? Object.assign(getSDefaultStyle('info'), config.style) : _config$style4,
|
|
134
|
+
_config$closeIcon4 = config.closeIcon,
|
|
135
|
+
closeIcon = _config$closeIcon4 === void 0 ? closeX : _config$closeIcon4,
|
|
136
|
+
rest = _objectWithoutProperties(config, _excluded4);
|
|
137
|
+
|
|
129
138
|
return AntdNotification.info(_objectSpread({
|
|
130
139
|
icon: icon,
|
|
131
140
|
style: style,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aloudata/aloudata-design",
|
|
3
|
-
"version": "0.4.8-beta.
|
|
3
|
+
"version": "0.4.8-beta.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@aloudata/icons-react": "0.1.7",
|
|
54
54
|
"@aloudata/icons-svg": "0.1.7",
|
|
55
|
-
"antd": "5.
|
|
55
|
+
"antd": "^5.3.1",
|
|
56
56
|
"memoize-one": "^6.0.0",
|
|
57
57
|
"rc-menu": "^9.8.0",
|
|
58
58
|
"react-table": "^7.8.0",
|