linkmore-design 1.0.53 → 1.0.54
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/Alert/ErrorBoundary.d.ts +22 -0
- package/dist/{Notification → Alert}/demos/basic.d.ts +0 -0
- package/dist/{Notification/demos/button.d.ts → Alert/demos/visible.d.ts} +0 -0
- package/dist/Alert/index.d.ts +41 -0
- package/dist/{Notification → Alert}/style/index.d.ts +0 -0
- package/dist/CardTable/fns/index.d.ts +7 -3
- package/dist/CardTable/{toolbar → pager}/TablePagination.d.ts +0 -0
- package/dist/CardTable/pager/index.d.ts +3 -0
- package/dist/LmFilter/LmFilter.d.ts +3 -0
- package/dist/LmFilter/baseFilter/index.d.ts +3 -0
- package/dist/LmFilter/clearFilter/index.d.ts +3 -0
- package/dist/LmFilter/complexFilter/index.d.ts +2 -0
- package/dist/LmFilter/components/CascaderFilter.d.ts +5 -0
- package/dist/LmFilter/components/CheckboxFilter.d.ts +5 -0
- package/dist/LmFilter/components/DateFilter.d.ts +5 -0
- package/dist/LmFilter/components/DropdownFIlter.d.ts +3 -0
- package/dist/LmFilter/components/EmptyFilter.d.ts +2 -0
- package/dist/LmFilter/components/InputFilter.d.ts +4 -0
- package/dist/LmFilter/components/InputSearchClose.d.ts +3 -0
- package/dist/LmFilter/components/SelectFilter.d.ts +5 -0
- package/dist/LmFilter/components/fuzzySearch.d.ts +4 -0
- package/dist/LmFilter/components/index.d.ts +3 -0
- package/dist/LmFilter/customFilter/index.d.ts +2 -0
- package/dist/LmFilter/demos/basic.d.ts +2 -0
- package/dist/LmFilter/filterFns/index.d.ts +12 -0
- package/dist/LmFilter/hooks/index.d.ts +1 -0
- package/dist/LmFilter/hooks/useDelayedFn.d.ts +2 -0
- package/dist/LmFilter/index.d.ts +2 -0
- package/dist/LmFilter/style/index.d.ts +1 -0
- package/dist/LmFilter/utils.d.ts +8 -0
- package/dist/LmFilter/wrapper/Filter.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterContainer.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterRoot.d.ts +3 -0
- package/dist/LmFilter/wrapper/FilterWrapper.d.ts +3 -0
- package/dist/_util/getDataOrAriaProps.d.ts +1 -0
- package/dist/_util/reactNode.d.ts +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.umd.js +3665 -3297
- package/dist/index.umd.min.js +6 -6
- package/dist/{Notification/demos/icon.d.ts → notification/demos/basic.d.ts} +0 -0
- package/dist/notification/demos/button.d.ts +2 -0
- package/dist/notification/demos/icon.d.ts +2 -0
- package/dist/notification/hooks/useNotification.d.ts +7 -0
- package/dist/notification/index.d.ts +54 -0
- package/dist/notification/style/index.d.ts +1 -0
- package/es/Alert/ErrorBoundary.d.ts +22 -0
- package/es/Alert/ErrorBoundary.js +65 -0
- package/es/Alert/index.d.ts +41 -0
- package/es/Alert/index.js +192 -0
- package/es/{Notification → Alert}/style/index.css +25 -2
- package/es/{Notification → Alert}/style/index.d.ts +0 -0
- package/es/{Notification → Alert}/style/index.js +0 -0
- package/es/CardTable/card/PictureTextColumn.js +8 -6
- package/es/CardTable/card/PictureTextRow.js +1 -1
- package/es/CardTable/fns/index.js +38 -9
- package/es/CardTable/{toolbar → pager}/TablePagination.js +0 -0
- package/es/CardTable/pager/index.js +48 -0
- package/es/CardTable/style/index.css +2 -2
- package/es/CardTable/table/TableRoot.js +20 -18
- package/es/CardTable/table/TableWrapper.js +4 -0
- package/es/CardTable/toolbar/ToolBarBottom.js +8 -27
- package/es/LmFilter/LmFilter.js +27 -0
- package/es/LmFilter/baseFilter/index.js +34 -0
- package/es/LmFilter/clearFilter/index.js +33 -0
- package/es/LmFilter/complexFilter/index.js +17 -0
- package/es/LmFilter/components/CascaderFilter.js +183 -0
- package/es/LmFilter/components/CheckboxFilter.js +197 -0
- package/es/LmFilter/components/DateFilter.js +147 -0
- package/es/LmFilter/components/DropdownFIlter.js +162 -0
- package/es/LmFilter/components/EmptyFilter.js +27 -0
- package/es/LmFilter/components/InputFilter.js +52 -0
- package/es/LmFilter/components/InputSearchClose.js +74 -0
- package/es/LmFilter/components/SelectFilter.js +113 -0
- package/es/LmFilter/components/fuzzySearch.js +37 -0
- package/es/LmFilter/components/index.js +97 -0
- package/es/LmFilter/customFilter/index.js +17 -0
- package/es/LmFilter/filterFns/index.js +54 -0
- package/es/LmFilter/hooks/index.js +18 -0
- package/es/LmFilter/hooks/useDelayedFn.js +27 -0
- package/es/LmFilter/icon_placeholder.png +0 -0
- package/es/LmFilter/index.js +16 -0
- package/es/LmFilter/style/index.js +3 -0
- package/es/LmFilter/style/style.css +189 -0
- package/es/LmFilter/utils.js +55 -0
- package/es/LmFilter/wrapper/Filter.js +33 -0
- package/es/LmFilter/wrapper/FilterContainer.js +29 -0
- package/es/LmFilter/wrapper/FilterRoot.js +114 -0
- package/es/LmFilter/wrapper/FilterWrapper.js +25 -0
- package/es/_util/getDataOrAriaProps.d.ts +1 -0
- package/es/_util/getDataOrAriaProps.js +9 -0
- package/es/_util/reactNode.d.ts +7 -0
- package/es/_util/reactNode.js +10 -0
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/message/style/index.css +1 -0
- package/es/notification/hooks/useNotification.d.ts +7 -0
- package/es/notification/hooks/useNotification.js +54 -0
- package/es/notification/index.d.ts +54 -0
- package/es/notification/index.js +342 -0
- package/es/notification/style/index.css +546 -0
- package/{lib/Notification → es/notification}/style/index.d.ts +0 -0
- package/es/notification/style/index.js +1 -0
- package/lib/Alert/ErrorBoundary.d.ts +22 -0
- package/lib/Alert/ErrorBoundary.js +79 -0
- package/lib/Alert/index.d.ts +41 -0
- package/lib/Alert/index.js +215 -0
- package/lib/{Notification → Alert}/style/index.css +25 -2
- package/lib/Alert/style/index.d.ts +1 -0
- package/lib/{Notification → Alert}/style/index.js +0 -0
- package/lib/CardTable/card/PictureTextColumn.js +8 -6
- package/lib/CardTable/card/PictureTextRow.js +1 -1
- package/lib/CardTable/fns/index.js +38 -9
- package/lib/CardTable/{toolbar → pager}/TablePagination.js +0 -0
- package/lib/CardTable/pager/index.js +48 -0
- package/lib/CardTable/style/index.css +2 -2
- package/lib/CardTable/table/TableRoot.js +20 -18
- package/lib/CardTable/table/TableWrapper.js +4 -0
- package/lib/CardTable/toolbar/ToolBarBottom.js +8 -27
- package/lib/LmFilter/LmFilter.js +27 -0
- package/lib/LmFilter/baseFilter/index.js +34 -0
- package/lib/LmFilter/clearFilter/index.js +33 -0
- package/lib/LmFilter/complexFilter/index.js +17 -0
- package/lib/LmFilter/components/CascaderFilter.js +183 -0
- package/lib/LmFilter/components/CheckboxFilter.js +197 -0
- package/lib/LmFilter/components/DateFilter.js +147 -0
- package/lib/LmFilter/components/DropdownFIlter.js +162 -0
- package/lib/LmFilter/components/EmptyFilter.js +27 -0
- package/lib/LmFilter/components/InputFilter.js +52 -0
- package/lib/LmFilter/components/InputSearchClose.js +74 -0
- package/lib/LmFilter/components/SelectFilter.js +113 -0
- package/lib/LmFilter/components/fuzzySearch.js +37 -0
- package/lib/LmFilter/components/index.js +97 -0
- package/lib/LmFilter/customFilter/index.js +17 -0
- package/lib/LmFilter/filterFns/index.js +54 -0
- package/lib/LmFilter/hooks/index.js +18 -0
- package/lib/LmFilter/hooks/useDelayedFn.js +27 -0
- package/lib/LmFilter/icon_placeholder.png +0 -0
- package/lib/LmFilter/index.js +16 -0
- package/lib/LmFilter/style/index.js +3 -0
- package/lib/LmFilter/style/style.css +189 -0
- package/lib/LmFilter/utils.js +55 -0
- package/lib/LmFilter/wrapper/Filter.js +33 -0
- package/lib/LmFilter/wrapper/FilterContainer.js +29 -0
- package/lib/LmFilter/wrapper/FilterRoot.js +114 -0
- package/lib/LmFilter/wrapper/FilterWrapper.js +25 -0
- package/lib/_util/getDataOrAriaProps.d.ts +1 -0
- package/lib/_util/getDataOrAriaProps.js +16 -0
- package/lib/_util/reactNode.d.ts +7 -0
- package/lib/_util/reactNode.js +24 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/message/style/index.css +1 -0
- package/lib/notification/hooks/useNotification.d.ts +7 -0
- package/lib/notification/hooks/useNotification.js +69 -0
- package/lib/notification/index.d.ts +54 -0
- package/lib/notification/index.js +365 -0
- package/lib/notification/style/index.css +546 -0
- package/lib/notification/style/index.d.ts +1 -0
- package/lib/notification/style/index.js +3 -0
- package/package.json +1 -1
- package/dist/Notification/index.d.ts +0 -7
- package/es/Notification/index.d.ts +0 -7
- package/es/Notification/index.js +0 -10
- package/lib/Notification/index.d.ts +0 -7
- package/lib/Notification/index.js +0 -23
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NoticeContent as RCNoticeContent, NotificationInstance as RCNotificationInstance } from 'rc-notification/lib/Notification';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { ArgsProps, NotificationInstance } from '..';
|
|
4
|
+
export default function createUseNotification(getNotificationInstance: (args: ArgsProps, callback: (info: {
|
|
5
|
+
prefixCls: string;
|
|
6
|
+
instance: RCNotificationInstance;
|
|
7
|
+
}) => void) => void, getRCNoticeProps: (args: ArgsProps, prefixCls: string) => RCNoticeContent): () => [NotificationInstance, React.ReactElement];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { NotificationInstance as RCNotificationInstance } from 'rc-notification/lib/Notification';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare type NotificationPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
4
|
+
export declare type IconType = 'success' | 'info' | 'error' | 'warning';
|
|
5
|
+
export interface ConfigProps {
|
|
6
|
+
top?: number;
|
|
7
|
+
bottom?: number;
|
|
8
|
+
duration?: number;
|
|
9
|
+
prefixCls?: string;
|
|
10
|
+
placement?: NotificationPlacement;
|
|
11
|
+
getContainer?: () => HTMLElement;
|
|
12
|
+
closeIcon?: React.ReactNode;
|
|
13
|
+
rtl?: boolean;
|
|
14
|
+
maxCount?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface ArgsProps {
|
|
17
|
+
message: React.ReactNode;
|
|
18
|
+
description?: React.ReactNode;
|
|
19
|
+
btn?: React.ReactNode;
|
|
20
|
+
key?: string;
|
|
21
|
+
onClose?: () => void;
|
|
22
|
+
duration?: number | null;
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
placement?: NotificationPlacement;
|
|
25
|
+
maxCount?: number;
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
prefixCls?: string;
|
|
28
|
+
className?: string;
|
|
29
|
+
readonly type?: IconType;
|
|
30
|
+
onClick?: () => void;
|
|
31
|
+
top?: number;
|
|
32
|
+
bottom?: number;
|
|
33
|
+
getContainer?: () => HTMLElement;
|
|
34
|
+
closeIcon?: React.ReactNode;
|
|
35
|
+
progress?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface NotificationInstance {
|
|
38
|
+
success(args: ArgsProps): void;
|
|
39
|
+
error(args: ArgsProps): void;
|
|
40
|
+
info(args: ArgsProps): void;
|
|
41
|
+
warning(args: ArgsProps): void;
|
|
42
|
+
open(args: ArgsProps): void;
|
|
43
|
+
}
|
|
44
|
+
export interface NotificationApi extends NotificationInstance {
|
|
45
|
+
warn(args: ArgsProps): void;
|
|
46
|
+
close(key: string): void;
|
|
47
|
+
config(options: ConfigProps): void;
|
|
48
|
+
destroy(): void;
|
|
49
|
+
useNotification: () => [NotificationInstance, React.ReactElement];
|
|
50
|
+
}
|
|
51
|
+
/** @private test Only function. Not work on production */
|
|
52
|
+
export declare const getInstance: (cacheKey: string) => Promise<RCNotificationInstance>;
|
|
53
|
+
declare const _default: NotificationApi;
|
|
54
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.less';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ErrorBoundaryProps {
|
|
3
|
+
message?: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export default class ErrorBoundary extends React.Component<ErrorBoundaryProps, {
|
|
8
|
+
error?: Error | null;
|
|
9
|
+
info: {
|
|
10
|
+
componentStack?: string;
|
|
11
|
+
};
|
|
12
|
+
}> {
|
|
13
|
+
state: {
|
|
14
|
+
error: any;
|
|
15
|
+
info: {
|
|
16
|
+
componentStack: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
componentDidCatch(error: Error | null, info: object): void;
|
|
20
|
+
render(): React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
4
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import Alert from '.';
|
|
7
|
+
|
|
8
|
+
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
9
|
+
_inherits(ErrorBoundary, _React$Component);
|
|
10
|
+
|
|
11
|
+
var _super = _createSuper(ErrorBoundary);
|
|
12
|
+
|
|
13
|
+
function ErrorBoundary() {
|
|
14
|
+
var _this;
|
|
15
|
+
|
|
16
|
+
_classCallCheck(this, ErrorBoundary);
|
|
17
|
+
|
|
18
|
+
_this = _super.apply(this, arguments);
|
|
19
|
+
_this.state = {
|
|
20
|
+
error: undefined,
|
|
21
|
+
info: {
|
|
22
|
+
componentStack: ''
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
return _this;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
_createClass(ErrorBoundary, [{
|
|
29
|
+
key: "componentDidCatch",
|
|
30
|
+
value: function componentDidCatch(error, info) {
|
|
31
|
+
this.setState({
|
|
32
|
+
error: error,
|
|
33
|
+
info: info
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "render",
|
|
38
|
+
value: function render() {
|
|
39
|
+
var _this$props = this.props,
|
|
40
|
+
message = _this$props.message,
|
|
41
|
+
description = _this$props.description,
|
|
42
|
+
children = _this$props.children;
|
|
43
|
+
var _this$state = this.state,
|
|
44
|
+
error = _this$state.error,
|
|
45
|
+
info = _this$state.info;
|
|
46
|
+
var componentStack = info && info.componentStack ? info.componentStack : null;
|
|
47
|
+
var errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;
|
|
48
|
+
var errorDescription = typeof description === 'undefined' ? componentStack : description;
|
|
49
|
+
|
|
50
|
+
if (error) {
|
|
51
|
+
return /*#__PURE__*/React.createElement(Alert, {
|
|
52
|
+
type: "error",
|
|
53
|
+
message: errorMessage,
|
|
54
|
+
description: /*#__PURE__*/React.createElement("pre", null, errorDescription)
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return children;
|
|
59
|
+
}
|
|
60
|
+
}]);
|
|
61
|
+
|
|
62
|
+
return ErrorBoundary;
|
|
63
|
+
}(React.Component);
|
|
64
|
+
|
|
65
|
+
export { ErrorBoundary as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Alert as AntdAlert } from 'antd';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import ErrorBoundary from './ErrorBoundary';
|
|
4
|
+
export interface AlertProps {
|
|
5
|
+
/** Type of Alert styles, options:`success`, `info`, `warning`, `error` */
|
|
6
|
+
type?: 'success' | 'info' | 'warning' | 'error';
|
|
7
|
+
/** Whether Alert can be closed */
|
|
8
|
+
closable?: boolean;
|
|
9
|
+
/** Close text to show */
|
|
10
|
+
closeText?: React.ReactNode;
|
|
11
|
+
/** Content of Alert */
|
|
12
|
+
message?: React.ReactNode;
|
|
13
|
+
/** Additional content of Alert */
|
|
14
|
+
description?: React.ReactNode;
|
|
15
|
+
/** Callback when close Alert */
|
|
16
|
+
onClose?: React.MouseEventHandler<HTMLButtonElement>;
|
|
17
|
+
/** Trigger when animation ending of Alert */
|
|
18
|
+
afterClose?: () => void;
|
|
19
|
+
/** Whether to show icon */
|
|
20
|
+
showIcon?: boolean;
|
|
21
|
+
/** https://www.w3.org/TR/2014/REC-html5-20141028/dom.html#aria-role-attribute */
|
|
22
|
+
role?: string;
|
|
23
|
+
style?: React.CSSProperties;
|
|
24
|
+
prefixCls?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
banner?: boolean;
|
|
27
|
+
icon?: React.ReactNode;
|
|
28
|
+
/** Custome closeIcon */
|
|
29
|
+
closeIcon?: React.ReactNode;
|
|
30
|
+
action?: React.ReactNode;
|
|
31
|
+
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
|
|
32
|
+
onMouseLeave?: React.MouseEventHandler<HTMLDivElement>;
|
|
33
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
34
|
+
duration?: number;
|
|
35
|
+
}
|
|
36
|
+
interface AlertInterface extends React.FC<AlertProps> {
|
|
37
|
+
ErrorBoundary: typeof ErrorBoundary;
|
|
38
|
+
AntdAlert: typeof AntdAlert;
|
|
39
|
+
}
|
|
40
|
+
declare const Alert: AlertInterface;
|
|
41
|
+
export default Alert;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import "antd/es/alert/style";
|
|
2
|
+
import _Alert from "antd/es/alert";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
4
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
5
|
+
|
|
6
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
7
|
+
var t = {};
|
|
8
|
+
|
|
9
|
+
for (var p in s) {
|
|
10
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
14
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
15
|
+
}
|
|
16
|
+
return t;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
import { CheckCircleFilled, CheckCircleOutlined, CloseCircleFilled, CloseCircleOutlined, CloseOutlined, ExclamationCircleFilled, ExclamationCircleOutlined, InfoCircleFilled, InfoCircleOutlined } from '@ant-design/icons';
|
|
20
|
+
import classNames from 'classnames';
|
|
21
|
+
import CSSMotion from 'rc-motion';
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
import { ConfigContext } from 'antd/es/config-provider';
|
|
24
|
+
import getDataOrAriaProps from '../_util/getDataOrAriaProps';
|
|
25
|
+
import { replaceElement } from '../_util/reactNode';
|
|
26
|
+
import ErrorBoundary from './ErrorBoundary';
|
|
27
|
+
var iconMapFilled = {
|
|
28
|
+
success: CheckCircleFilled,
|
|
29
|
+
info: InfoCircleFilled,
|
|
30
|
+
error: CloseCircleFilled,
|
|
31
|
+
warning: ExclamationCircleFilled
|
|
32
|
+
};
|
|
33
|
+
var iconMapOutlined = {
|
|
34
|
+
success: CheckCircleOutlined,
|
|
35
|
+
info: InfoCircleOutlined,
|
|
36
|
+
error: CloseCircleOutlined,
|
|
37
|
+
warning: ExclamationCircleOutlined
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var IconNode = function IconNode(props) {
|
|
41
|
+
var description = props.description,
|
|
42
|
+
icon = props.icon,
|
|
43
|
+
prefixCls = props.prefixCls,
|
|
44
|
+
type = props.type;
|
|
45
|
+
var iconType = (description ? iconMapOutlined : iconMapFilled)[type] || null;
|
|
46
|
+
|
|
47
|
+
if (icon) {
|
|
48
|
+
return replaceElement(icon, /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
className: "".concat(prefixCls, "-icon")
|
|
50
|
+
}, icon), function () {
|
|
51
|
+
return {
|
|
52
|
+
className: classNames("".concat(prefixCls, "-icon"), _defineProperty({}, icon.props.className, icon.props.className))
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return /*#__PURE__*/React.createElement(iconType, {
|
|
58
|
+
className: "".concat(prefixCls, "-icon")
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
var CloseIcon = function CloseIcon(props) {
|
|
63
|
+
var isClosable = props.isClosable,
|
|
64
|
+
closeText = props.closeText,
|
|
65
|
+
prefixCls = props.prefixCls,
|
|
66
|
+
closeIcon = props.closeIcon,
|
|
67
|
+
handleClose = props.handleClose;
|
|
68
|
+
return isClosable ? /*#__PURE__*/React.createElement("button", {
|
|
69
|
+
type: "button",
|
|
70
|
+
onClick: handleClose,
|
|
71
|
+
className: "".concat(prefixCls, "-close-icon"),
|
|
72
|
+
tabIndex: 0
|
|
73
|
+
}, closeText ? /*#__PURE__*/React.createElement("span", {
|
|
74
|
+
className: "".concat(prefixCls, "-close-text")
|
|
75
|
+
}, closeText) : closeIcon) : null;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var Alert = function Alert(_a) {
|
|
79
|
+
var _classNames2;
|
|
80
|
+
|
|
81
|
+
var description = _a.description,
|
|
82
|
+
customizePrefixCls = _a.prefixCls,
|
|
83
|
+
message = _a.message,
|
|
84
|
+
banner = _a.banner,
|
|
85
|
+
_a$className = _a.className,
|
|
86
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
87
|
+
style = _a.style,
|
|
88
|
+
onMouseEnter = _a.onMouseEnter,
|
|
89
|
+
onMouseLeave = _a.onMouseLeave,
|
|
90
|
+
onClick = _a.onClick,
|
|
91
|
+
afterClose = _a.afterClose,
|
|
92
|
+
showIcon = _a.showIcon,
|
|
93
|
+
closable = _a.closable,
|
|
94
|
+
closeText = _a.closeText,
|
|
95
|
+
_a$closeIcon = _a.closeIcon,
|
|
96
|
+
closeIcon = _a$closeIcon === void 0 ? /*#__PURE__*/React.createElement(CloseOutlined, null) : _a$closeIcon,
|
|
97
|
+
action = _a.action,
|
|
98
|
+
duration = _a.duration,
|
|
99
|
+
props = __rest(_a, ["description", "prefixCls", "message", "banner", "className", "style", "onMouseEnter", "onMouseLeave", "onClick", "afterClose", "showIcon", "closable", "closeText", "closeIcon", "action", "duration"]);
|
|
100
|
+
|
|
101
|
+
var _React$useState = React.useState(false),
|
|
102
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
103
|
+
closed = _React$useState2[0],
|
|
104
|
+
setClosed = _React$useState2[1];
|
|
105
|
+
|
|
106
|
+
var ref = React.useRef();
|
|
107
|
+
|
|
108
|
+
var _React$useContext = React.useContext(ConfigContext),
|
|
109
|
+
getPrefixCls = _React$useContext.getPrefixCls,
|
|
110
|
+
direction = _React$useContext.direction;
|
|
111
|
+
|
|
112
|
+
var prefixCls = getPrefixCls('alert', customizePrefixCls);
|
|
113
|
+
|
|
114
|
+
var handleClose = function handleClose(e) {
|
|
115
|
+
var _a;
|
|
116
|
+
|
|
117
|
+
setClosed(true);
|
|
118
|
+
(_a = props.onClose) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
var getType = function getType() {
|
|
122
|
+
var type = props.type;
|
|
123
|
+
|
|
124
|
+
if (type !== undefined) {
|
|
125
|
+
return type;
|
|
126
|
+
} // banner 模式默认为警告
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
return banner ? 'warning' : 'info';
|
|
130
|
+
}; // closeable when closeText is assigned
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
var isClosable = closeText ? true : closable;
|
|
134
|
+
var type = getType(); // banner 模式默认有 Icon
|
|
135
|
+
|
|
136
|
+
var isShowIcon = banner && showIcon === undefined ? true : showIcon;
|
|
137
|
+
var alertCls = classNames(prefixCls, "".concat(prefixCls, "-").concat(type), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-with-description"), !!description), _defineProperty(_classNames2, "".concat(prefixCls, "-no-icon"), !isShowIcon), _defineProperty(_classNames2, "".concat(prefixCls, "-banner"), !!banner), _defineProperty(_classNames2, "".concat(prefixCls, "-rtl"), direction === 'rtl'), _classNames2), className, 'lm_alert');
|
|
138
|
+
var dataOrAriaProps = getDataOrAriaProps(props);
|
|
139
|
+
return /*#__PURE__*/React.createElement(CSSMotion, {
|
|
140
|
+
visible: !closed,
|
|
141
|
+
motionName: "".concat(prefixCls, "-motion"),
|
|
142
|
+
motionAppear: false,
|
|
143
|
+
motionEnter: false,
|
|
144
|
+
onLeaveStart: function onLeaveStart(node) {
|
|
145
|
+
return {
|
|
146
|
+
maxHeight: node.offsetHeight
|
|
147
|
+
};
|
|
148
|
+
},
|
|
149
|
+
onLeaveEnd: afterClose
|
|
150
|
+
}, function (_ref) {
|
|
151
|
+
var motionClassName = _ref.className,
|
|
152
|
+
motionStyle = _ref.style;
|
|
153
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
154
|
+
ref: ref,
|
|
155
|
+
"data-show": !closed,
|
|
156
|
+
className: classNames(alertCls, motionClassName),
|
|
157
|
+
style: Object.assign(Object.assign({}, style), motionStyle),
|
|
158
|
+
onMouseEnter: onMouseEnter,
|
|
159
|
+
onMouseLeave: onMouseLeave,
|
|
160
|
+
onClick: onClick,
|
|
161
|
+
role: "alert"
|
|
162
|
+
}, dataOrAriaProps), isShowIcon ? /*#__PURE__*/React.createElement(IconNode, {
|
|
163
|
+
description: description,
|
|
164
|
+
icon: props.icon,
|
|
165
|
+
prefixCls: prefixCls,
|
|
166
|
+
type: type
|
|
167
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
className: "".concat(prefixCls, "-content")
|
|
169
|
+
}, message ? /*#__PURE__*/React.createElement("div", {
|
|
170
|
+
className: "".concat(prefixCls, "-message")
|
|
171
|
+
}, message) : null, description ? /*#__PURE__*/React.createElement("div", {
|
|
172
|
+
className: "".concat(prefixCls, "-description")
|
|
173
|
+
}, description) : null), action ? /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
className: "".concat(prefixCls, "-action")
|
|
175
|
+
}, action) : null, /*#__PURE__*/React.createElement(CloseIcon, {
|
|
176
|
+
isClosable: !!isClosable,
|
|
177
|
+
closeText: closeText,
|
|
178
|
+
prefixCls: prefixCls,
|
|
179
|
+
closeIcon: closeIcon,
|
|
180
|
+
handleClose: handleClose
|
|
181
|
+
}), duration > 0 && /*#__PURE__*/React.createElement("div", {
|
|
182
|
+
className: 'alert_progress',
|
|
183
|
+
style: {
|
|
184
|
+
animationDuration: "".concat(duration, "s")
|
|
185
|
+
}
|
|
186
|
+
}));
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
Alert.ErrorBoundary = ErrorBoundary;
|
|
191
|
+
Alert.AntdAlert = _Alert;
|
|
192
|
+
export default Alert;
|
|
@@ -503,6 +503,29 @@ html {
|
|
|
503
503
|
.card_cell_content:hover .card_cell_body .card_cell_checkbox {
|
|
504
504
|
opacity: 1;
|
|
505
505
|
}
|
|
506
|
-
.
|
|
507
|
-
|
|
506
|
+
.lm_alert .alert_progress {
|
|
507
|
+
position: absolute;
|
|
508
|
+
width: 100%;
|
|
509
|
+
height: 2px;
|
|
510
|
+
background-color: #52C41A;
|
|
511
|
+
left: 0;
|
|
512
|
+
bottom: 0;
|
|
513
|
+
animation-name: Progress;
|
|
514
|
+
animation-iteration-count: 1;
|
|
515
|
+
animation-fill-mode: forwards;
|
|
516
|
+
transition: width 0.2s;
|
|
517
|
+
animation-timing-function: linear;
|
|
518
|
+
}
|
|
519
|
+
.lm_alert:hover .message_progress {
|
|
520
|
+
width: 100%;
|
|
521
|
+
animation-name: none;
|
|
522
|
+
animation-play-state: paused;
|
|
523
|
+
}
|
|
524
|
+
@keyframes Progress {
|
|
525
|
+
from {
|
|
526
|
+
width: 100%;
|
|
527
|
+
}
|
|
528
|
+
to {
|
|
529
|
+
width: 0;
|
|
530
|
+
}
|
|
508
531
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -33,8 +33,7 @@ var PictureTextColumn = function PictureTextColumn(_ref) {
|
|
|
33
33
|
defaultConfig = table.defaultConfig,
|
|
34
34
|
cellClick = table.cellClick,
|
|
35
35
|
cellDoubleClick = table.cellDoubleClick,
|
|
36
|
-
toggleCheckboxKey = table.toggleCheckboxKey
|
|
37
|
-
checkboxChange = table.checkboxChange;
|
|
36
|
+
toggleCheckboxKey = table.toggleCheckboxKey;
|
|
38
37
|
var trigger = state.checkboxConfig.trigger;
|
|
39
38
|
var clickFlag = (0, _react.useRef)(null);
|
|
40
39
|
var resetDefaultConfig = (0, _objectSpread2.default)({
|
|
@@ -48,9 +47,12 @@ var PictureTextColumn = function PictureTextColumn(_ref) {
|
|
|
48
47
|
extend: null
|
|
49
48
|
}, defaultConfig); // 复选框改变事件, 将复选数据保存到缓存中
|
|
50
49
|
|
|
51
|
-
var onSelectChange = function onSelectChange(val) {
|
|
52
|
-
toggleCheckboxKey(cell[cellKey]
|
|
53
|
-
|
|
50
|
+
var onSelectChange = function onSelectChange(val, trigger) {
|
|
51
|
+
toggleCheckboxKey(cell[cellKey], {
|
|
52
|
+
cell: cell,
|
|
53
|
+
cellIndex: index,
|
|
54
|
+
trigger: trigger
|
|
55
|
+
});
|
|
54
56
|
}; // 单元格单击事件
|
|
55
57
|
|
|
56
58
|
|
|
@@ -61,7 +63,7 @@ var PictureTextColumn = function PictureTextColumn(_ref) {
|
|
|
61
63
|
cellClick === null || cellClick === void 0 ? void 0 : cellClick(cell, index);
|
|
62
64
|
|
|
63
65
|
if (trigger === 'cell') {
|
|
64
|
-
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(!checked);
|
|
66
|
+
onSelectChange === null || onSelectChange === void 0 ? void 0 : onSelectChange(!checked, trigger);
|
|
65
67
|
} // }, 200)
|
|
66
68
|
|
|
67
69
|
}; // 单元格双击事件: 双击时避免单击事件触发自己实现
|
|
@@ -134,7 +134,7 @@ var PictureTextRow = function PictureTextRow(_ref) {
|
|
|
134
134
|
}
|
|
135
135
|
}, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Checkbox, {
|
|
136
136
|
checked: checked,
|
|
137
|
-
onChange: function onChange() {
|
|
137
|
+
onChange: function onChange(e) {
|
|
138
138
|
return onSelctChange(e.target.checked);
|
|
139
139
|
}
|
|
140
140
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -10,15 +10,17 @@ exports.default = void 0;
|
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/toConsumableArray"));
|
|
11
11
|
|
|
12
12
|
// 操作方法集合
|
|
13
|
-
var
|
|
13
|
+
var CoreOptions = function CoreOptions(_ref) {
|
|
14
14
|
var state = _ref.state,
|
|
15
15
|
dispatch = _ref.dispatch,
|
|
16
16
|
props = _ref.props;
|
|
17
17
|
var checkboxConfig = state.checkboxConfig;
|
|
18
18
|
var dataSource = props.dataSource,
|
|
19
|
-
cellKey = props.cellKey
|
|
19
|
+
cellKey = props.cellKey,
|
|
20
|
+
checkboxChange = props.checkboxChange;
|
|
20
21
|
var checkKeys = checkboxConfig.checkKeys,
|
|
21
|
-
checkValues = checkboxConfig.checkValues
|
|
22
|
+
checkValues = checkboxConfig.checkValues,
|
|
23
|
+
checkMethod = checkboxConfig.checkMethod; // 设置选中的值: 第一个参数是数据的键,第二个参数是选中与否, 第三个参数控制是否重置
|
|
22
24
|
// 未做key是否属于数据源校验,用于分页时保存之前的选中状态
|
|
23
25
|
|
|
24
26
|
var setCheckboxKeys = function setCheckboxKeys(keys, checked, reset) {
|
|
@@ -64,16 +66,43 @@ var setOptions = function setOptions(_ref) {
|
|
|
64
66
|
}; // 切换选中状态: 单个切换/批量切换
|
|
65
67
|
|
|
66
68
|
|
|
67
|
-
var toggleCheckboxKey = function toggleCheckboxKey(k) {
|
|
69
|
+
var toggleCheckboxKey = function toggleCheckboxKey(k, _ref2) {
|
|
70
|
+
var _ref2$trigger = _ref2.trigger,
|
|
71
|
+
trigger = _ref2$trigger === void 0 ? 'default' : _ref2$trigger,
|
|
72
|
+
cell = _ref2.cell,
|
|
73
|
+
cellIndex = _ref2.cellIndex;
|
|
68
74
|
var nKeys = [k],
|
|
69
|
-
|
|
75
|
+
isCheck = true,
|
|
70
76
|
reset = false; // 单个切换
|
|
71
77
|
|
|
72
78
|
if (!Array.isArray(k)) {
|
|
73
|
-
|
|
79
|
+
var isCanCheck = checkMethod; // 是否可选中
|
|
80
|
+
|
|
81
|
+
isCheck = !(checkKeys === null || checkKeys === void 0 ? void 0 : checkKeys.some(function (v) {
|
|
74
82
|
return v === k;
|
|
75
83
|
}));
|
|
76
|
-
|
|
84
|
+
var record = cell || ''; // 检测选中前置阻挡事件
|
|
85
|
+
|
|
86
|
+
if (typeof checkMethod === 'function') {
|
|
87
|
+
record = record || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.find(function (v) {
|
|
88
|
+
return v[cellKey] === k;
|
|
89
|
+
}));
|
|
90
|
+
isCanCheck = checkMethod(record, state, trigger);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (!isCanCheck) return; // 触发复选框改变事件: 仅手动触发有效
|
|
94
|
+
|
|
95
|
+
if (typeof checkboxChange === 'function') {
|
|
96
|
+
record = record || (dataSource === null || dataSource === void 0 ? void 0 : dataSource.find(function (v) {
|
|
97
|
+
return v[cellKey] === k;
|
|
98
|
+
}));
|
|
99
|
+
checkboxChange === null || checkboxChange === void 0 ? void 0 : checkboxChange({
|
|
100
|
+
checked: isCheck,
|
|
101
|
+
cell: record,
|
|
102
|
+
cellIndex: cellIndex
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
} // 多个切换 通过重置去除选中项保留切换项
|
|
77
106
|
|
|
78
107
|
|
|
79
108
|
if (Array.isArray(k)) {
|
|
@@ -93,7 +122,7 @@ var setOptions = function setOptions(_ref) {
|
|
|
93
122
|
reset = true;
|
|
94
123
|
}
|
|
95
124
|
|
|
96
|
-
setCheckboxKeys(nKeys,
|
|
125
|
+
setCheckboxKeys(nKeys, isCheck, reset);
|
|
97
126
|
};
|
|
98
127
|
|
|
99
128
|
return {
|
|
@@ -102,5 +131,5 @@ var setOptions = function setOptions(_ref) {
|
|
|
102
131
|
};
|
|
103
132
|
};
|
|
104
133
|
|
|
105
|
-
var _default =
|
|
134
|
+
var _default = CoreOptions;
|
|
106
135
|
exports.default = _default;
|
|
File without changes
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _TablePagination = _interopRequireDefault(require("./TablePagination"));
|
|
13
|
+
|
|
14
|
+
var CardTablePager = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
15
|
+
var table = _ref.table;
|
|
16
|
+
var pagination = table.pagination,
|
|
17
|
+
pagerConfig = table.pagerConfig; // left || right:插槽
|
|
18
|
+
|
|
19
|
+
var left = pagerConfig.left,
|
|
20
|
+
right = pagerConfig.right; // 底部工具栏左侧插槽: 默认空 div 标签占位
|
|
21
|
+
|
|
22
|
+
var LeftSlot = function LeftSlot() {
|
|
23
|
+
if (!left) {
|
|
24
|
+
return /*#__PURE__*/_react.default.createElement("div", null);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
;
|
|
28
|
+
return typeof left === 'function' ? left(table) : left;
|
|
29
|
+
}; // 底部工具栏右侧插槽
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var RighSlot = function RighSlot() {
|
|
33
|
+
if (!right) {
|
|
34
|
+
return pagination ? /*#__PURE__*/_react.default.createElement(_TablePagination.default, {
|
|
35
|
+
table: table
|
|
36
|
+
}) : null;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return typeof right === 'function' ? right(table, _TablePagination.default) : right;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
43
|
+
className: "lm_card_table_pager"
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(LeftSlot, null), /*#__PURE__*/_react.default.createElement(RighSlot, null));
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
var _default = CardTablePager;
|
|
48
|
+
exports.default = _default;
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
.lm_card_table_wrapper .lm_card_table_container .lm_card_table .lm_card_table_body .lm_card_table_body_row .lm_card_table_body_cell.cell_checked {
|
|
25
25
|
border-color: var(--primary-color);
|
|
26
26
|
}
|
|
27
|
-
.lm_card_table_wrapper .
|
|
27
|
+
.lm_card_table_wrapper .lm_card_table_pager {
|
|
28
28
|
display: flex;
|
|
29
29
|
align-items: center;
|
|
30
30
|
justify-content: space-between;
|
|
31
31
|
}
|
|
32
|
-
.lm_card_table_wrapper .
|
|
32
|
+
.lm_card_table_wrapper .lm_card_table_pager .lm_card_table_pagination {
|
|
33
33
|
display: flex;
|
|
34
34
|
align-items: center;
|
|
35
35
|
height: 48px;
|