@aloudata/aloudata-design 1.9.7 → 1.9.10
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/AldTable/helper.js +14 -21
- package/dist/AldTable/index.d.ts +2 -2
- package/dist/AldTable/index.js +38 -49
- package/dist/AldTable/style/index.less +4 -0
- package/dist/AldTable/types.d.ts +2 -1
- package/dist/App/index.js +2 -9
- package/dist/Avatar/component/Avatar/avatar.d.ts +2 -2
- package/dist/Avatar/component/Avatar/avatar.js +0 -2
- package/dist/Avatar/component/Avatar/index.d.ts +1 -1
- package/dist/Avatar/component/Avatar/index.js +6 -20
- package/dist/Breadcrumb/index.d.ts +1 -1
- package/dist/Breadcrumb/index.js +6 -16
- package/dist/Button/index.d.ts +4 -4
- package/dist/Button/index.js +21 -41
- package/dist/Checkbox/component/CheckboxGroup/index.d.ts +2 -2
- package/dist/Checkbox/component/CheckboxGroup/index.js +4 -10
- package/dist/Checkbox/index.d.ts +3 -3
- package/dist/Checkbox/index.js +5 -14
- package/dist/Checkbox/type.js +3 -4
- package/dist/ColorPicker/constant.js +2 -1
- package/dist/ColorPicker/index.d.ts +1 -1
- package/dist/ColorPicker/index.js +15 -42
- package/dist/ConfigProvider/defaultRenderEmpty.d.ts +1 -1
- package/dist/ConfigProvider/defaultRenderEmpty.js +0 -5
- package/dist/ConfigProvider/getUserList.d.ts +4 -4
- package/dist/ConfigProvider/getUserList.js +2 -2
- package/dist/ConfigProvider/hooks/useGetUserList.js +2 -5
- package/dist/ConfigProvider/index.js +2 -6
- package/dist/ConfigProvider/sizeContext.d.ts +1 -1
- package/dist/ConfigProvider/sizeContext.js +1 -1
- package/dist/DataPreviewTable/components/Body/Cell.d.ts +1 -1
- package/dist/DataPreviewTable/components/Body/Cell.js +4 -10
- package/dist/DataPreviewTable/components/Body/Error.d.ts +1 -1
- package/dist/DataPreviewTable/components/Body/Error.js +3 -5
- package/dist/DataPreviewTable/components/Body/SkeletonBody.d.ts +1 -1
- package/dist/DataPreviewTable/components/Body/SkeletonBody.js +10 -19
- package/dist/DataPreviewTable/components/Body/index.d.ts +1 -1
- package/dist/DataPreviewTable/components/Body/index.js +10 -19
- package/dist/DataPreviewTable/components/DragBar/index.d.ts +1 -1
- package/dist/DataPreviewTable/components/DragBar/index.js +14 -24
- package/dist/DataPreviewTable/components/Header/index.d.ts +2 -2
- package/dist/DataPreviewTable/components/Header/index.js +7 -15
- package/dist/DataPreviewTable/hooks/useDirection.js +32 -57
- package/dist/DataPreviewTable/index.js +22 -29
- package/dist/DataPreviewTable/interface.d.ts +2 -2
- package/dist/DataPreviewTable/interface.js +6 -9
- package/dist/DataPreviewTable/utils/findRange.js +2 -20
- package/dist/DataPreviewTable/utils/getColumnRange.js +3 -7
- package/dist/DataPreviewTable/utils/getRowRange.js +2 -8
- package/dist/DataPreviewTable/utils/getTableLayout.js +0 -1
- package/dist/DatePicker/index.d.ts +11 -11
- package/dist/DatePicker/index.js +85 -116
- package/dist/Divider/index.d.ts +1 -1
- package/dist/Divider/index.js +0 -3
- package/dist/DoubleCircleIcon/index.d.ts +2 -2
- package/dist/DoubleCircleIcon/index.js +7 -9
- package/dist/Dropdown/Button.d.ts +2 -2
- package/dist/Dropdown/Button.js +7 -11
- package/dist/Dropdown/index.d.ts +4 -4
- package/dist/Dropdown/index.js +11 -21
- package/dist/Dropdown/style/index.less +5 -0
- package/dist/Empty/image/Data.d.ts +2 -2
- package/dist/Empty/image/Data.js +0 -2
- package/dist/Empty/image/Search.d.ts +2 -2
- package/dist/Empty/image/Search.js +0 -2
- package/dist/Empty/image/SearchSmall.d.ts +2 -2
- package/dist/Empty/image/SearchSmall.js +0 -2
- package/dist/Empty/image/User.d.ts +2 -2
- package/dist/Empty/image/User.js +0 -2
- package/dist/Empty/image/WorkBook.d.ts +2 -2
- package/dist/Empty/image/WorkBook.js +0 -2
- package/dist/Empty/index.d.ts +1 -1
- package/dist/Empty/index.js +13 -23
- package/dist/Form/index.d.ts +4 -4
- package/dist/Form/index.js +16 -27
- package/dist/Icon/components/AlertTriangleDuotone.d.ts +1 -1
- package/dist/Icon/components/AlertTriangleDuotone.js +4 -11
- package/dist/Icon/components/CancelCircleDuotone.d.ts +1 -1
- package/dist/Icon/components/CancelCircleDuotone.js +9 -16
- package/dist/Icon/components/CheckCircleDuotone.d.ts +1 -1
- package/dist/Icon/components/CheckCircleDuotone.js +4 -11
- package/dist/Icon/components/Icon.d.ts +1 -1
- package/dist/Icon/components/Icon.js +9 -13
- package/dist/Icon/components/InfoCircleLine.d.ts +1 -1
- package/dist/Icon/components/InfoCircleLine.js +4 -11
- package/dist/Icon/components/createFromScripts.js +2 -8
- package/dist/IconButton/index.js +36 -57
- package/dist/IconButton/style/index.less +4 -0
- package/dist/Input/components/Group/index.d.ts +2 -2
- package/dist/Input/components/Group/index.js +4 -9
- package/dist/Input/components/Input/index.d.ts +2 -2
- package/dist/Input/components/Input/index.js +9 -17
- package/dist/Input/components/Password/index.js +4 -9
- package/dist/Input/components/TextArea/index.js +5 -10
- package/dist/InputNumber/index.d.ts +2 -2
- package/dist/InputNumber/index.js +13 -20
- package/dist/MemberPicker/components/MemberSelection.d.ts +2 -2
- package/dist/MemberPicker/components/MemberSelection.js +12 -20
- package/dist/MemberPicker/components/MultipleOption.d.ts +2 -2
- package/dist/MemberPicker/components/MultipleOption.js +8 -9
- package/dist/MemberPicker/components/NickLabel.js +2 -4
- package/dist/MemberPicker/components/Panel.d.ts +2 -2
- package/dist/MemberPicker/components/Panel.js +14 -25
- package/dist/MemberPicker/components/SelectedMemberTags.d.ts +2 -2
- package/dist/MemberPicker/components/SelectedMemberTags.js +2 -4
- package/dist/MemberPicker/components/SelectorFooter.d.ts +2 -2
- package/dist/MemberPicker/components/SingleOption.d.ts +2 -2
- package/dist/MemberPicker/components/SingleOption.js +9 -10
- package/dist/MemberPicker/index.js +46 -79
- package/dist/MemberPicker/interface.d.ts +2 -2
- package/dist/MemberPicker/utils/getUsersWithUserId.js +0 -1
- package/dist/Menu/Divider.d.ts +3 -3
- package/dist/Menu/MenuItem.d.ts +1 -1
- package/dist/Menu/SubMenu.d.ts +1 -1
- package/dist/Menu/SubMenu.js +1 -6
- package/dist/Menu/index.d.ts +2 -2
- package/dist/Menu/index.js +7 -16
- package/dist/Menu/style/dropdown.less +4 -2
- package/dist/Modal/index.d.ts +4 -4
- package/dist/Modal/index.js +108 -130
- package/dist/Modal/locale.js +4 -6
- package/dist/Navigator/components/Header/index.d.ts +2 -2
- package/dist/Navigator/components/Header/index.js +0 -2
- package/dist/Navigator/components/Menu/index.d.ts +2 -2
- package/dist/Navigator/components/Menu/index.js +8 -19
- package/dist/Navigator/components/MenuItem/index.d.ts +1 -1
- package/dist/Navigator/components/MenuItem/index.js +6 -9
- package/dist/Navigator/index.d.ts +1 -1
- package/dist/Navigator/index.js +5 -7
- package/dist/Pagination/index.d.ts +3 -3
- package/dist/Pagination/index.js +18 -43
- package/dist/Popconfirm/index.d.ts +2 -2
- package/dist/Popconfirm/index.js +19 -27
- package/dist/Popover/index.d.ts +2 -2
- package/dist/Popover/index.js +2 -9
- package/dist/Progress/index.js +21 -33
- package/dist/Radio/components/Group/index.d.ts +1 -1
- package/dist/Radio/components/Group/index.js +27 -36
- package/dist/Radio/components/Radio/index.d.ts +2 -2
- package/dist/Radio/components/Radio/index.js +10 -18
- package/dist/Radio/interface/radioGroup.d.ts +3 -3
- package/dist/Result/index.d.ts +7 -7
- package/dist/Result/index.js +17 -26
- package/dist/Result/noFound.js +0 -3
- package/dist/Result/serverError.js +0 -3
- package/dist/Result/unauthorized.js +1 -4
- package/dist/ScrollArea/index.js +6 -13
- package/dist/Select/components/MultipleOption.d.ts +2 -2
- package/dist/Select/components/MultipleOption.js +4 -8
- package/dist/Select/components/SingleOption.d.ts +2 -2
- package/dist/Select/components/SingleOption.js +5 -9
- package/dist/Select/index.d.ts +2 -2
- package/dist/Select/index.js +66 -134
- package/dist/Spin/CustomIcon/index.d.ts +2 -2
- package/dist/Spin/CustomIcon/index.js +0 -2
- package/dist/Spin/Icon/index.d.ts +2 -2
- package/dist/Spin/index.d.ts +2 -2
- package/dist/Spin/index.js +1 -10
- package/dist/Steps/components/ProcessIcon/index.d.ts +2 -2
- package/dist/Steps/components/ProcessIcon/index.js +0 -2
- package/dist/Steps/components/Step/index.d.ts +3 -3
- package/dist/Steps/components/Step/index.js +2 -8
- package/dist/Steps/index.d.ts +3 -3
- package/dist/Steps/index.js +8 -10
- package/dist/Switch/index.js +17 -30
- package/dist/Table/Table.js +88 -131
- package/dist/Table/components/Empty/index.d.ts +2 -2
- package/dist/Table/components/Empty/index.js +0 -2
- package/dist/Table/components/Loading/index.d.ts +2 -2
- package/dist/Table/components/Loading/index.js +0 -2
- package/dist/Table/components/TableBodyRowList/index.d.ts +2 -2
- package/dist/Table/components/TableBodyRowList/index.js +19 -39
- package/dist/Table/components/TableHead/index.d.ts +1 -1
- package/dist/Table/components/TableHead/index.js +56 -82
- package/dist/Table/hooks/useFrame.d.ts +1 -1
- package/dist/Table/hooks/useFrame.js +9 -24
- package/dist/Table/interface.d.ts +1 -1
- package/dist/Table/utils.js +8 -28
- package/dist/Tabs/TabPane.d.ts +2 -2
- package/dist/Tabs/index.d.ts +2 -2
- package/dist/Tabs/index.js +18 -33
- package/dist/Tooltip/index.d.ts +2 -2
- package/dist/Tooltip/index.js +12 -12
- package/dist/Tree/demo/basic/index.d.ts +2 -2
- package/dist/Tree/index.d.ts +1 -1
- package/dist/Tree/index.js +2 -4
- package/dist/_utils/hooks/useControlledState.js +9 -21
- package/dist/_utils/hooks/useId.js +4 -5
- package/dist/_utils/hooks/usePrefixCls.js +2 -5
- package/dist/index.js +3 -1
- package/dist/locale-provider/context.d.ts +1 -1
- package/dist/locale-provider/index.d.ts +1 -1
- package/dist/locale-provider/index.js +8 -33
- package/dist/message/index.js +3 -7
- package/dist/notification/demo/index.d.ts +2 -2
- package/dist/notification/demo/index.js +0 -1
- package/dist/notification/index.js +23 -32
- package/package.json +1 -1
package/dist/Menu/SubMenu.js
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
var _excluded = ["popupClassName"];
|
|
2
|
-
|
|
3
2
|
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
3
|
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
|
-
|
|
7
4
|
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
|
-
|
|
9
5
|
import { Menu as AntdMenu } from 'antd';
|
|
10
6
|
import classNames from 'classnames';
|
|
11
7
|
import React from 'react';
|
|
12
8
|
var AntdSubMenu = AntdMenu.SubMenu;
|
|
13
9
|
export default function SubMenu(props) {
|
|
14
10
|
var popupClassName = props.popupClassName,
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
17
12
|
var OFFSET_WIDTH = 8;
|
|
18
13
|
var OFFSET_HEIGHT = 0;
|
|
19
14
|
return /*#__PURE__*/React.createElement(AntdSubMenu, _extends({
|
package/dist/Menu/index.d.ts
CHANGED
|
@@ -13,9 +13,9 @@ export interface IMenuProps extends Omit<MenuProps, 'theme'> {
|
|
|
13
13
|
className?: string;
|
|
14
14
|
children?: React.ReactNode | React.ReactNode[];
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type ItemType = antdItemType;
|
|
17
17
|
export declare function addPopupOffset(items?: ItemType[]): antdItemType[] | undefined;
|
|
18
|
-
declare function Menu(props: IMenuProps): JSX.Element;
|
|
18
|
+
declare function Menu(props: IMenuProps): React.JSX.Element;
|
|
19
19
|
declare namespace Menu {
|
|
20
20
|
var Item: typeof MenuItem;
|
|
21
21
|
var Divider: typeof import("./Divider").default;
|
package/dist/Menu/index.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
var _excluded = ["className", "expandIcon", "items"];
|
|
2
|
-
|
|
2
|
+
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); }
|
|
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
4
|
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
|
-
|
|
7
5
|
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
|
-
|
|
9
6
|
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; }
|
|
10
|
-
|
|
11
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; }
|
|
12
|
-
|
|
13
|
-
function
|
|
14
|
-
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
11
|
import { ChevronRightLine } from '@aloudata/icons-react';
|
|
16
12
|
import { Menu as AntdMenu } from 'antd';
|
|
17
13
|
import classNames from 'classnames';
|
|
@@ -20,16 +16,13 @@ import theme from "../style/themes/default/themeColor.module.less";
|
|
|
20
16
|
import Divider from "./Divider";
|
|
21
17
|
import MenuItem from "./MenuItem";
|
|
22
18
|
import SubMenu from "./SubMenu";
|
|
23
|
-
|
|
24
19
|
function isSubMenuType(item) {
|
|
25
20
|
return item.children !== undefined;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
export function addPopupOffset(items) {
|
|
29
23
|
if (typeof items === 'undefined') {
|
|
30
24
|
return;
|
|
31
25
|
}
|
|
32
|
-
|
|
33
26
|
var OFFSET_WIDTH = 1;
|
|
34
27
|
var OFFSET_HEIGHT = 0;
|
|
35
28
|
return items.map(function (item) {
|
|
@@ -40,16 +33,14 @@ export function addPopupOffset(items) {
|
|
|
40
33
|
children: addPopupOffset(item.children)
|
|
41
34
|
});
|
|
42
35
|
}
|
|
43
|
-
|
|
44
36
|
return item;
|
|
45
37
|
}, []);
|
|
46
38
|
}
|
|
47
39
|
export default function Menu(props) {
|
|
48
40
|
var className = props.className,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
expandIcon = props.expandIcon,
|
|
42
|
+
items = props.items,
|
|
43
|
+
otherProps = _objectWithoutProperties(props, _excluded);
|
|
53
44
|
return /*#__PURE__*/React.createElement(AntdMenu, _extends({
|
|
54
45
|
className: classNames(className, 'ald-menu'),
|
|
55
46
|
expandIcon: expandIcon || /*#__PURE__*/React.createElement(ChevronRightLine, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Menu 和子menu的样式
|
|
2
2
|
.dropdown-menu-content {
|
|
3
3
|
background: @BG100;
|
|
4
|
-
border: 1px solid @BG70;
|
|
5
|
-
border-radius:
|
|
4
|
+
// border: 1px solid @BG70;
|
|
5
|
+
border-radius: 0;
|
|
6
6
|
box-shadow: @shadow-L;
|
|
7
7
|
padding: 0;
|
|
8
8
|
|
|
@@ -46,6 +46,8 @@
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
&.ant-dropdown-menu-submenu-popup {
|
|
49
|
+
border: 1px solid #d5d5d5;
|
|
50
|
+
border-radius: 2px;
|
|
49
51
|
min-width: 140px;
|
|
50
52
|
}
|
|
51
53
|
|
package/dist/Modal/index.d.ts
CHANGED
|
@@ -27,13 +27,13 @@ export interface ModalFuncProps extends Omit<AntdModalFuncProps, 'okButtonProps'
|
|
|
27
27
|
icon?: React.ReactElement;
|
|
28
28
|
}
|
|
29
29
|
declare const OriginModal: IModalInterface;
|
|
30
|
-
export
|
|
30
|
+
export type ModalFunc = (props: ModalFuncProps) => {
|
|
31
31
|
destroy: () => void;
|
|
32
32
|
update: (configUpdate: ConfigUpdate) => void;
|
|
33
33
|
};
|
|
34
|
-
|
|
35
|
-
export
|
|
36
|
-
|
|
34
|
+
type ConfigUpdate = AntdModalFuncProps | ((prevConfig: AntdModalFuncProps) => AntdModalFuncProps);
|
|
35
|
+
export type ModalStaticFunctions = Record<NonNullable<ModalFuncProps['type']>, ModalFunc>;
|
|
36
|
+
type TOriginModal = typeof OriginModal & ModalStaticFunctions & {
|
|
37
37
|
destroyAll: () => void;
|
|
38
38
|
config: typeof modalGlobalConfig;
|
|
39
39
|
};
|
package/dist/Modal/index.js
CHANGED
|
@@ -1,23 +1,19 @@
|
|
|
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); }
|
|
1
2
|
var _excluded = ["className", "type", "loading", "size", "disabled", "shape"],
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
_excluded2 = ["className", "children", "okType", "width", "closeIcon", "subTitle", "okButtonProps", "cancelButtonProps", "okText", "cancelText", "icon", "title", "paddingLess", "virtualScrollBar"],
|
|
4
|
+
_excluded3 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
5
|
+
_excluded4 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
6
|
+
_excluded5 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
7
|
+
_excluded6 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "okText", "cancelText", "className"],
|
|
8
|
+
_excluded7 = ["okButtonProps", "cancelButtonProps", "okType", "width", "title", "subTitle", "className", "okText", "cancelText"];
|
|
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
|
-
|
|
11
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; }
|
|
12
|
-
|
|
13
11
|
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; }
|
|
14
|
-
|
|
15
|
-
function
|
|
16
|
-
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
17
15
|
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
|
-
|
|
19
16
|
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
|
-
|
|
21
17
|
import { AlertTriangleDuotone, CheckCircleDuotone, CloseLLine, InfoCircleLine } from '@aloudata/icons-react';
|
|
22
18
|
import { Modal as AntdModal } from 'antd';
|
|
23
19
|
import { modalGlobalConfig } from 'antd/lib/modal/confirm';
|
|
@@ -27,25 +23,23 @@ import React from 'react';
|
|
|
27
23
|
import { btnPrefix, getButtonSizeClass, getButtonType, getDangerStatus, getShape } from "../Button";
|
|
28
24
|
import DoubleCircleIcon from "../DoubleCircleIcon";
|
|
29
25
|
import ScrollArea from "../ScrollArea";
|
|
30
|
-
import theme from "../style/themes/default/themeColor.module.less";
|
|
26
|
+
import theme from "../style/themes/default/themeColor.module.less";
|
|
27
|
+
// export type { ModalProps, ModalFuncProps };
|
|
31
28
|
|
|
32
29
|
export var destroyFns = [];
|
|
33
30
|
var DEFAULT_WIDTH = 552;
|
|
34
|
-
|
|
35
31
|
function getButtonProps(buttonProps, defaultBtnType, okType) {
|
|
36
32
|
var btnType = okType || defaultBtnType;
|
|
37
|
-
|
|
38
33
|
var buttonClassName = buttonProps.className,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
_buttonProps$type = buttonProps.type,
|
|
35
|
+
type = _buttonProps$type === void 0 ? btnType : _buttonProps$type,
|
|
36
|
+
loading = buttonProps.loading,
|
|
37
|
+
_buttonProps$size = buttonProps.size,
|
|
38
|
+
size = _buttonProps$size === void 0 ? 'middle' : _buttonProps$size,
|
|
39
|
+
disabled = buttonProps.disabled,
|
|
40
|
+
_buttonProps$shape = buttonProps.shape,
|
|
41
|
+
shape = _buttonProps$shape === void 0 ? 'default' : _buttonProps$shape,
|
|
42
|
+
restProps = _objectWithoutProperties(buttonProps, _excluded);
|
|
49
43
|
return _objectSpread(_objectSpread({}, restProps), {}, {
|
|
50
44
|
disabled: loading ? true : disabled,
|
|
51
45
|
loading: loading,
|
|
@@ -55,11 +49,10 @@ function getButtonProps(buttonProps, defaultBtnType, okType) {
|
|
|
55
49
|
shape: getShape(shape)
|
|
56
50
|
});
|
|
57
51
|
}
|
|
58
|
-
|
|
59
52
|
var ModalTitle = function ModalTitle(_ref) {
|
|
60
53
|
var icon = _ref.icon,
|
|
61
|
-
|
|
62
|
-
|
|
54
|
+
title = _ref.title,
|
|
55
|
+
subTitle = _ref.subTitle;
|
|
63
56
|
return /*#__PURE__*/React.createElement("div", {
|
|
64
57
|
className: 'ald-modal-title-container'
|
|
65
58
|
}, icon, /*#__PURE__*/React.createElement("div", {
|
|
@@ -70,34 +63,33 @@ var ModalTitle = function ModalTitle(_ref) {
|
|
|
70
63
|
className: 'subTitle'
|
|
71
64
|
}, subTitle)));
|
|
72
65
|
};
|
|
73
|
-
|
|
74
66
|
var OriginModal = function OriginModal(props) {
|
|
75
67
|
var className = props.className,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
68
|
+
children = props.children,
|
|
69
|
+
okType = props.okType,
|
|
70
|
+
width = props.width,
|
|
71
|
+
closeIcon = props.closeIcon,
|
|
72
|
+
subTitle = props.subTitle,
|
|
73
|
+
_props$okButtonProps = props.okButtonProps,
|
|
74
|
+
okButtonProps = _props$okButtonProps === void 0 ? {} : _props$okButtonProps,
|
|
75
|
+
_props$cancelButtonPr = props.cancelButtonProps,
|
|
76
|
+
cancelButtonProps = _props$cancelButtonPr === void 0 ? {} : _props$cancelButtonPr,
|
|
77
|
+
_props$okText = props.okText,
|
|
78
|
+
okText = _props$okText === void 0 ? '确定' : _props$okText,
|
|
79
|
+
_props$cancelText = props.cancelText,
|
|
80
|
+
cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
|
|
81
|
+
icon = props.icon,
|
|
82
|
+
title = props.title,
|
|
83
|
+
paddingLess = props.paddingLess,
|
|
84
|
+
virtualScrollBar = props.virtualScrollBar,
|
|
85
|
+
restProps = _objectWithoutProperties(props, _excluded2);
|
|
95
86
|
return /*#__PURE__*/React.createElement(AntdModal, _extends({}, restProps, {
|
|
96
87
|
title: ModalTitle({
|
|
97
88
|
icon: icon,
|
|
98
89
|
title: title,
|
|
99
90
|
subTitle: subTitle
|
|
100
|
-
})
|
|
91
|
+
})
|
|
92
|
+
// title={
|
|
101
93
|
// <div className={'ald-modal-title-container'}>
|
|
102
94
|
// {icon}
|
|
103
95
|
// <div className={'ald-modal-text-container'}>
|
|
@@ -126,26 +118,23 @@ var OriginModal = function OriginModal(props) {
|
|
|
126
118
|
innerClassName: "ald-modal-body-wrap-inner"
|
|
127
119
|
}, children) : children);
|
|
128
120
|
};
|
|
129
|
-
|
|
130
121
|
OriginModal.useModal = useModal;
|
|
131
122
|
var Modal = OriginModal;
|
|
132
|
-
|
|
133
123
|
Modal.info = function infoFn(props) {
|
|
134
124
|
var _props$okButtonProps2 = props.okButtonProps,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
125
|
+
okButtonProps = _props$okButtonProps2 === void 0 ? {} : _props$okButtonProps2,
|
|
126
|
+
_props$cancelButtonPr2 = props.cancelButtonProps,
|
|
127
|
+
cancelButtonProps = _props$cancelButtonPr2 === void 0 ? {} : _props$cancelButtonPr2,
|
|
128
|
+
okType = props.okType,
|
|
129
|
+
width = props.width,
|
|
130
|
+
title = props.title,
|
|
131
|
+
subTitle = props.subTitle,
|
|
132
|
+
_props$okText2 = props.okText,
|
|
133
|
+
okText = _props$okText2 === void 0 ? '确定' : _props$okText2,
|
|
134
|
+
_props$cancelText2 = props.cancelText,
|
|
135
|
+
cancelText = _props$cancelText2 === void 0 ? '取消' : _props$cancelText2,
|
|
136
|
+
className = props.className,
|
|
137
|
+
restProps = _objectWithoutProperties(props, _excluded3);
|
|
149
138
|
return AntdModal.info(_objectSpread({
|
|
150
139
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
151
140
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -166,23 +155,21 @@ Modal.info = function infoFn(props) {
|
|
|
166
155
|
cancelText: cancelText
|
|
167
156
|
}, restProps));
|
|
168
157
|
};
|
|
169
|
-
|
|
170
158
|
Modal.success = function successFn(props) {
|
|
171
159
|
var _props$okButtonProps3 = props.okButtonProps,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
160
|
+
okButtonProps = _props$okButtonProps3 === void 0 ? {} : _props$okButtonProps3,
|
|
161
|
+
_props$cancelButtonPr3 = props.cancelButtonProps,
|
|
162
|
+
cancelButtonProps = _props$cancelButtonPr3 === void 0 ? {} : _props$cancelButtonPr3,
|
|
163
|
+
okType = props.okType,
|
|
164
|
+
width = props.width,
|
|
165
|
+
title = props.title,
|
|
166
|
+
subTitle = props.subTitle,
|
|
167
|
+
_props$okText3 = props.okText,
|
|
168
|
+
okText = _props$okText3 === void 0 ? '确定' : _props$okText3,
|
|
169
|
+
_props$cancelText3 = props.cancelText,
|
|
170
|
+
cancelText = _props$cancelText3 === void 0 ? '取消' : _props$cancelText3,
|
|
171
|
+
className = props.className,
|
|
172
|
+
restProps = _objectWithoutProperties(props, _excluded4);
|
|
186
173
|
return AntdModal.success(_objectSpread({
|
|
187
174
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
188
175
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -203,23 +190,21 @@ Modal.success = function successFn(props) {
|
|
|
203
190
|
cancelText: cancelText
|
|
204
191
|
}, restProps));
|
|
205
192
|
};
|
|
206
|
-
|
|
207
193
|
Modal.error = function errorFn(props) {
|
|
208
194
|
var _props$okButtonProps4 = props.okButtonProps,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
195
|
+
okButtonProps = _props$okButtonProps4 === void 0 ? {} : _props$okButtonProps4,
|
|
196
|
+
_props$cancelButtonPr4 = props.cancelButtonProps,
|
|
197
|
+
cancelButtonProps = _props$cancelButtonPr4 === void 0 ? {} : _props$cancelButtonPr4,
|
|
198
|
+
okType = props.okType,
|
|
199
|
+
width = props.width,
|
|
200
|
+
title = props.title,
|
|
201
|
+
subTitle = props.subTitle,
|
|
202
|
+
_props$okText4 = props.okText,
|
|
203
|
+
okText = _props$okText4 === void 0 ? '确定' : _props$okText4,
|
|
204
|
+
_props$cancelText4 = props.cancelText,
|
|
205
|
+
cancelText = _props$cancelText4 === void 0 ? '取消' : _props$cancelText4,
|
|
206
|
+
className = props.className,
|
|
207
|
+
restProps = _objectWithoutProperties(props, _excluded5);
|
|
223
208
|
return AntdModal.error(_objectSpread({
|
|
224
209
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
225
210
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -240,23 +225,21 @@ Modal.error = function errorFn(props) {
|
|
|
240
225
|
cancelText: cancelText
|
|
241
226
|
}, restProps));
|
|
242
227
|
};
|
|
243
|
-
|
|
244
228
|
Modal.warning = function modalWarn(props) {
|
|
245
229
|
var _props$okButtonProps5 = props.okButtonProps,
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
230
|
+
okButtonProps = _props$okButtonProps5 === void 0 ? {} : _props$okButtonProps5,
|
|
231
|
+
_props$cancelButtonPr5 = props.cancelButtonProps,
|
|
232
|
+
cancelButtonProps = _props$cancelButtonPr5 === void 0 ? {} : _props$cancelButtonPr5,
|
|
233
|
+
okType = props.okType,
|
|
234
|
+
width = props.width,
|
|
235
|
+
title = props.title,
|
|
236
|
+
subTitle = props.subTitle,
|
|
237
|
+
_props$okText5 = props.okText,
|
|
238
|
+
okText = _props$okText5 === void 0 ? '确定' : _props$okText5,
|
|
239
|
+
_props$cancelText5 = props.cancelText,
|
|
240
|
+
cancelText = _props$cancelText5 === void 0 ? '取消' : _props$cancelText5,
|
|
241
|
+
className = props.className,
|
|
242
|
+
restProps = _objectWithoutProperties(props, _excluded6);
|
|
260
243
|
return AntdModal.warning(_objectSpread({
|
|
261
244
|
okButtonProps: getButtonProps(okButtonProps, 'dangerous', okType),
|
|
262
245
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -278,23 +261,21 @@ Modal.warning = function modalWarn(props) {
|
|
|
278
261
|
cancelText: cancelText
|
|
279
262
|
}, restProps));
|
|
280
263
|
};
|
|
281
|
-
|
|
282
264
|
Modal.confirm = function confirmFn(props) {
|
|
283
265
|
var _props$okButtonProps6 = props.okButtonProps,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
266
|
+
okButtonProps = _props$okButtonProps6 === void 0 ? {} : _props$okButtonProps6,
|
|
267
|
+
_props$cancelButtonPr6 = props.cancelButtonProps,
|
|
268
|
+
cancelButtonProps = _props$cancelButtonPr6 === void 0 ? {} : _props$cancelButtonPr6,
|
|
269
|
+
okType = props.okType,
|
|
270
|
+
width = props.width,
|
|
271
|
+
title = props.title,
|
|
272
|
+
subTitle = props.subTitle,
|
|
273
|
+
className = props.className,
|
|
274
|
+
_props$okText6 = props.okText,
|
|
275
|
+
okText = _props$okText6 === void 0 ? '确定' : _props$okText6,
|
|
276
|
+
_props$cancelText6 = props.cancelText,
|
|
277
|
+
cancelText = _props$cancelText6 === void 0 ? '取消' : _props$cancelText6,
|
|
278
|
+
restProps = _objectWithoutProperties(props, _excluded7);
|
|
298
279
|
return AntdModal.confirm(_objectSpread({
|
|
299
280
|
okButtonProps: getButtonProps(okButtonProps, 'primary', okType),
|
|
300
281
|
cancelButtonProps: getButtonProps(cancelButtonProps, 'secondary', okType),
|
|
@@ -315,16 +296,13 @@ Modal.confirm = function confirmFn(props) {
|
|
|
315
296
|
cancelText: cancelText
|
|
316
297
|
}, restProps));
|
|
317
298
|
};
|
|
318
|
-
|
|
319
299
|
Modal.destroyAll = function destroyAllFn() {
|
|
320
300
|
while (destroyFns.length) {
|
|
321
301
|
var close = destroyFns.pop();
|
|
322
|
-
|
|
323
302
|
if (close) {
|
|
324
303
|
close();
|
|
325
304
|
}
|
|
326
305
|
}
|
|
327
306
|
};
|
|
328
|
-
|
|
329
307
|
Modal.config = modalGlobalConfig;
|
|
330
308
|
export default Modal;
|
package/dist/Modal/locale.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
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); }
|
|
1
2
|
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
|
-
|
|
3
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; }
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import defaultLocale from "../locale/default";
|
|
8
|
-
|
|
9
8
|
var runtimeLocale = _objectSpread({}, defaultLocale.Modal);
|
|
10
|
-
|
|
11
9
|
export function changeConfirmLocale(newLocale) {
|
|
12
10
|
if (newLocale) {
|
|
13
11
|
runtimeLocale = _objectSpread(_objectSpread({}, runtimeLocale), newLocale);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export interface IAppList {
|
|
3
3
|
logoSrc: string;
|
|
4
4
|
}
|
|
5
5
|
interface INavHeaderProps {
|
|
6
6
|
logoSrc: string;
|
|
7
7
|
}
|
|
8
|
-
declare function Header(props: INavHeaderProps): JSX.Element;
|
|
8
|
+
declare function Header(props: INavHeaderProps): React.JSX.Element;
|
|
9
9
|
export default Header;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
2
|
function Header(props) {
|
|
4
3
|
var logoSrc = props.logoSrc;
|
|
5
4
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -14,5 +13,4 @@ function Header(props) {
|
|
|
14
13
|
className: "ald-nav-header-select"
|
|
15
14
|
}));
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
export default Header;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { IMenuItem } from '../MenuItem';
|
|
3
3
|
export type { IMenuItem } from '../MenuItem';
|
|
4
4
|
interface IMenuProps {
|
|
@@ -9,5 +9,5 @@ interface IMenuProps {
|
|
|
9
9
|
path: string;
|
|
10
10
|
}) => void;
|
|
11
11
|
}
|
|
12
|
-
declare function Menu(props: IMenuProps): JSX.Element;
|
|
12
|
+
declare function Menu(props: IMenuProps): React.JSX.Element;
|
|
13
13
|
export default Menu;
|
|
@@ -1,31 +1,21 @@
|
|
|
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
|
-
|
|
3
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
|
|
5
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."); }
|
|
6
|
-
|
|
7
4
|
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); }
|
|
8
|
-
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
5
|
+
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; }
|
|
6
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
7
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
|
|
15
8
|
import React, { useState, useEffect, useCallback } from 'react';
|
|
16
9
|
import MenuItem from "../MenuItem";
|
|
17
|
-
|
|
18
10
|
function Menu(props) {
|
|
19
11
|
var menuList = props.menuList,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
selectedKey = props.selectedKey,
|
|
13
|
+
_props$onMenuSelect = props.onMenuSelect,
|
|
14
|
+
onMenuSelectCallback = _props$onMenuSelect === void 0 ? function () {} : _props$onMenuSelect;
|
|
24
15
|
var _useState = useState(selectedKey),
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
+
currentSelectKey = _useState2[0],
|
|
18
|
+
setCurrentSelectKey = _useState2[1];
|
|
29
19
|
var onMenuSelect = useCallback(function (menuInfo) {
|
|
30
20
|
setCurrentSelectKey(menuInfo.key);
|
|
31
21
|
onMenuSelectCallback(menuInfo);
|
|
@@ -49,5 +39,4 @@ function Menu(props) {
|
|
|
49
39
|
}));
|
|
50
40
|
}));
|
|
51
41
|
}
|
|
52
|
-
|
|
53
42
|
export default Menu;
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import React, { useCallback } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
|
|
4
3
|
function MenuItem(data) {
|
|
5
4
|
var menuIcon = data.menuIcon,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
content = data.content,
|
|
6
|
+
menuItemKey = data.menuItemKey,
|
|
7
|
+
path = data.path,
|
|
8
|
+
selectedKey = data.selectedKey,
|
|
9
|
+
_data$onMenuSelect = data.onMenuSelect,
|
|
10
|
+
onMenuSelect = _data$onMenuSelect === void 0 ? function () {} : _data$onMenuSelect;
|
|
12
11
|
var onMenuItemClick = useCallback(function (menuInfo) {
|
|
13
12
|
if (menuInfo.key === selectedKey) {
|
|
14
13
|
return;
|
|
15
14
|
}
|
|
16
|
-
|
|
17
15
|
onMenuSelect(menuInfo);
|
|
18
16
|
}, [onMenuSelect, selectedKey]);
|
|
19
17
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -35,5 +33,4 @@ function MenuItem(data) {
|
|
|
35
33
|
className: "ald-nav-menu-item-content-text"
|
|
36
34
|
}, content) : content));
|
|
37
35
|
}
|
|
38
|
-
|
|
39
36
|
export default MenuItem;
|