xmirror-components 1.0.29 → 1.0.30-alpha.2

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.
Files changed (46) hide show
  1. package/build/dist/index.cjs +212 -16
  2. package/build/dist/index.mjs +2418 -2058
  3. package/build/es/components/SearchArea/Item/index.d.ts +10 -0
  4. package/build/es/components/SearchArea/Item/index.js +49 -0
  5. package/build/es/components/SearchArea/ToggleButton/index.d.ts +14 -0
  6. package/build/es/components/SearchArea/ToggleButton/index.js +25 -0
  7. package/build/es/components/SearchArea/index.d.ts +25 -0
  8. package/build/es/components/SearchArea/index.js +120 -0
  9. package/build/es/components/Table/Footer/index.d.ts +0 -1
  10. package/build/es/components/Table/Footer/index.js +20 -17
  11. package/build/es/components/Table/Footer/styles.d.ts +25 -0
  12. package/build/es/components/Table/Footer/styles.js +25 -0
  13. package/build/es/components/Table/PopoverSetColumns/index.d.ts +0 -1
  14. package/build/es/components/Table/PopoverSetColumns/index.js +2 -2
  15. package/build/es/components/Table/PopoverSetColumns/styles.d.ts +8 -0
  16. package/build/es/components/Table/PopoverSetColumns/styles.js +11 -0
  17. package/build/es/components/Table/index.d.ts +0 -1
  18. package/build/es/components/Table/index.js +2 -2
  19. package/build/es/components/Table/styles.d.ts +4 -0
  20. package/build/es/components/Table/styles.js +7 -0
  21. package/build/es/index.d.ts +1 -0
  22. package/build/es/index.js +1 -0
  23. package/build/lib/components/SearchArea/Item/index.js +54 -0
  24. package/build/lib/components/SearchArea/ToggleButton/index.js +30 -0
  25. package/build/lib/components/SearchArea/index.js +158 -0
  26. package/build/lib/components/Table/Footer/index.js +19 -16
  27. package/build/lib/components/Table/Footer/styles.js +31 -0
  28. package/build/lib/components/Table/PopoverSetColumns/index.js +2 -2
  29. package/build/lib/components/Table/PopoverSetColumns/styles.js +17 -0
  30. package/build/lib/components/Table/index.js +2 -2
  31. package/build/lib/components/Table/styles.js +13 -0
  32. package/build/lib/index.d.ts +49 -0
  33. package/build/lib/index.js +3 -1
  34. package/build/package.json +1 -1
  35. package/build/types/components/SearchArea/Item/index.d.ts +10 -0
  36. package/build/types/components/SearchArea/ToggleButton/index.d.ts +14 -0
  37. package/build/types/components/SearchArea/index.d.ts +25 -0
  38. package/build/types/components/Table/Footer/index.d.ts +0 -1
  39. package/build/types/components/Table/Footer/styles.d.ts +25 -0
  40. package/build/types/components/Table/PopoverSetColumns/index.d.ts +0 -1
  41. package/build/types/components/Table/PopoverSetColumns/styles.d.ts +8 -0
  42. package/build/types/components/Table/index.d.ts +0 -1
  43. package/build/types/components/Table/styles.d.ts +4 -0
  44. package/build/types/index.d.ts +1 -0
  45. package/package.json +1 -1
  46. package/build/dist/index.css +0 -1
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { type FormItemProps } from 'antd';
3
+ /**
4
+ * 筛选项
5
+ * @param props
6
+ * @return {JSX.Element}
7
+ * @constructor
8
+ */
9
+ declare function Index({ children, ...props }: FormItemProps): React.JSX.Element;
10
+ export default Index;
@@ -0,0 +1,49 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __rest = (this && this.__rest) || function (s, e) {
17
+ var t = {};
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
+ t[p] = s[p];
20
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
+ t[p[i]] = s[p[i]];
24
+ }
25
+ return t;
26
+ };
27
+ import React from 'react';
28
+ import { Form } from 'antd';
29
+ import styled from '@emotion/styled';
30
+ var StyledFormItem = styled(Form.Item)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n text-align: left;\n vertical-align: middle;\n\n & + & {\n margin-left: 20px;\n }\n\n .search-item__label {\n position: relative;\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n height: 32px;\n font-size: 14px;\n color: rgba(0, 0, 0, 85%);\n\n &::after {\n position: relative;\n top: -0.5px;\n margin: 0 8px 0 2px;\n content: ':';\n }\n }\n\n .search-item__content {\n flex: 1;\n }\n"], ["\n display: inline-flex;\n text-align: left;\n vertical-align: middle;\n\n & + & {\n margin-left: 20px;\n }\n\n .search-item__label {\n position: relative;\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n height: 32px;\n font-size: 14px;\n color: rgba(0, 0, 0, 85%);\n\n &::after {\n position: relative;\n top: -0.5px;\n margin: 0 8px 0 2px;\n content: ':';\n }\n }\n\n .search-item__content {\n flex: 1;\n }\n"
31
+ /**
32
+ * 筛选项
33
+ * @param props
34
+ * @return {JSX.Element}
35
+ * @constructor
36
+ */
37
+ ])));
38
+ /**
39
+ * 筛选项
40
+ * @param props
41
+ * @return {JSX.Element}
42
+ * @constructor
43
+ */
44
+ function Index(_a) {
45
+ var children = _a.children, props = __rest(_a, ["children"]);
46
+ return (React.createElement(StyledFormItem, __assign({}, props), children));
47
+ }
48
+ export default Index;
49
+ var templateObject_1;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ interface ToggleButtonProps {
3
+ panel: {
4
+ show: boolean;
5
+ toggle: () => void;
6
+ };
7
+ }
8
+ /**
9
+ * 高级筛选触发按钮
10
+ * @return {JSX.Element}
11
+ * @constructor
12
+ */
13
+ declare function ToggleButton({ panel }: ToggleButtonProps): React.JSX.Element;
14
+ export default ToggleButton;
@@ -0,0 +1,25 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import React from 'react';
6
+ import { Button } from 'antd';
7
+ import { CaretUpOutlined } from '@ant-design/icons';
8
+ import styled from '@emotion/styled';
9
+ var AnimatedIcon = styled(CaretUpOutlined, {
10
+ shouldForwardProp: function (prop) { return prop !== 'show'; },
11
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transition: transform 0.3s ease-in-out;\n transform: rotate(", ");\n"], ["\n transition: transform 0.3s ease-in-out;\n transform: rotate(", ");\n"])), function (props) { return props.show ? '0deg' : '180deg'; });
12
+ /**
13
+ * 高级筛选触发按钮
14
+ * @return {JSX.Element}
15
+ * @constructor
16
+ */
17
+ function ToggleButton(_a) {
18
+ var panel = _a.panel;
19
+ var show = panel.show, toggle = panel.toggle;
20
+ return (React.createElement(Button, { type: "link", style: { paddingLeft: 0, paddingRight: 0 }, onClick: toggle },
21
+ "\u9AD8\u7EA7\u641C\u7D22",
22
+ React.createElement(AnimatedIcon, { show: show })));
23
+ }
24
+ export default ToggleButton;
25
+ var templateObject_1;
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import { type FormProps, type ColProps, type RowProps } from 'antd';
3
+ import Item from './Item';
4
+ import ToggleButton from './ToggleButton';
5
+ interface SearchAreaRef {
6
+ show: boolean;
7
+ toggle: () => void;
8
+ }
9
+ interface InternalSearchAreaProps extends FormProps<any> {
10
+ loading?: boolean;
11
+ onSearch?: (data: any) => void;
12
+ children?: React.ReactNode;
13
+ col?: ColProps;
14
+ row?: RowProps;
15
+ ref: SearchAreaRef;
16
+ }
17
+ declare const SearchArea: React.ForwardRefExoticComponent<InternalSearchAreaProps> & {
18
+ Item: typeof Item;
19
+ ToggleButton: typeof ToggleButton;
20
+ useSearchArea: () => {
21
+ show: boolean;
22
+ toggle: () => void;
23
+ };
24
+ };
25
+ export default SearchArea;
@@ -0,0 +1,120 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ var __assign = (this && this.__assign) || function () {
6
+ __assign = Object.assign || function(t) {
7
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
8
+ s = arguments[i];
9
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
10
+ t[p] = s[p];
11
+ }
12
+ return t;
13
+ };
14
+ return __assign.apply(this, arguments);
15
+ };
16
+ var __rest = (this && this.__rest) || function (s, e) {
17
+ var t = {};
18
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
19
+ t[p] = s[p];
20
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
21
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
22
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23
+ t[p[i]] = s[p[i]];
24
+ }
25
+ return t;
26
+ };
27
+ import React, { useState } from 'react';
28
+ import { Form, Row, Col, Button } from 'antd';
29
+ import { UpOutlined } from '@ant-design/icons';
30
+ import styled from '@emotion/styled';
31
+ import Item from './Item';
32
+ import ToggleButton from './ToggleButton';
33
+ var AnimatedContainer = styled('div', {
34
+ shouldForwardProp: function (prop) { return prop !== 'show'; },
35
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n overflow: hidden;\n transition: max-height 0.4s ease-in-out;\n max-height: ", ";\n"], ["\n overflow: hidden;\n transition: max-height 0.4s ease-in-out;\n max-height: ", ";\n"])), function (props) { return props.show ? '450px' : '0'; });
36
+ var StyledForm = styled(Form)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 20px;\n padding-bottom: 0;\n margin-bottom: 20px;\n background: #F7FAFB;\n border: 1px solid #F3F3F4;\n\n .ant-form-item {\n margin-bottom: 20px;\n }\n"], ["\n padding: 20px;\n padding-bottom: 0;\n margin-bottom: 20px;\n background: #F7FAFB;\n border: 1px solid #F3F3F4;\n\n .ant-form-item {\n margin-bottom: 20px;\n }\n"])));
37
+ var SearchAreaHandle = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n gap: 10px;\n display: flex;\n justify-content: flex-end;\n margin-bottom: 20px;\n"], ["\n gap: 10px;\n display: flex;\n justify-content: flex-end;\n margin-bottom: 20px;\n"])));
38
+ /**
39
+ * 高级筛选
40
+ * @param children 子元素
41
+ * @param onSearch {function} 接收函数,点筛选时执行,返回筛选数据
42
+ * @param col 与 Col 的配置相同,控制筛选项排版
43
+ * @param row Row 的配置相同,控制筛选项排版
44
+ * @param loading {boolean} 筛选加载状态
45
+ * @param props 多余参数,绑定至 Form 上
46
+ * @param ref
47
+ * @return {JSX.Element}
48
+ * @constructor
49
+ */
50
+ function InternalSearchArea(_a) {
51
+ var children = _a.children, onSearch = _a.onSearch, _b = _a.col, col = _b === void 0 ? {} : _b, _c = _a.row, row = _c === void 0 ? {} : _c, _d = _a.loading, loading = _d === void 0 ? false : _d, ref = _a.ref, props = __rest(_a, ["children", "onSearch", "col", "row", "loading", "ref"]);
52
+ var form = Form.useForm()[0];
53
+ var show, toggle;
54
+ if (ref && typeof ref === 'object') {
55
+ show = ref.show;
56
+ toggle = ref.toggle;
57
+ }
58
+ else {
59
+ var _e = useState(false), _show = _e[0], _setShow_1 = _e[1];
60
+ show = _show;
61
+ toggle = function () { _setShow_1(function (v) { return !v; }); };
62
+ }
63
+ /**
64
+ * 提交搜索
65
+ */
66
+ var submit = function () {
67
+ var data = form.getFieldsValue();
68
+ onSearch === null || onSearch === void 0 ? void 0 : onSearch(data);
69
+ };
70
+ /**
71
+ * 重置
72
+ */
73
+ var reset = function () {
74
+ form.resetFields();
75
+ submit();
76
+ };
77
+ /**
78
+ * 重置
79
+ */
80
+ var close = function () {
81
+ toggle();
82
+ };
83
+ return (React.createElement(AnimatedContainer, { show: show },
84
+ React.createElement(StyledForm, __assign({ form: form, labelCol: { flex: '70px' }, wrapperCol: { flex: '1', style: { maxWidth: '280px' } } }, props),
85
+ React.createElement(Row, __assign({ gutter: 10, justify: "space-between" }, row),
86
+ Array.isArray(children)
87
+ ? children.map(function (item) {
88
+ return (React.createElement(Col, __assign({ span: 6, xxl: 6,
89
+ xl: 8,
90
+ lg: 12,
91
+ xs: 24, key: item.props.name || item.key || item.props.label }, col), item));
92
+ })
93
+ : children,
94
+ React.createElement(Col, { flex: 1 },
95
+ React.createElement(SearchAreaHandle, null,
96
+ React.createElement(Button, { loading: loading, type: "primary", onClick: submit }, "\u7B5B\u9009"),
97
+ React.createElement(Button, { loading: loading, onClick: reset }, "\u91CD\u7F6E"),
98
+ React.createElement(Button, { type: "link", style: {
99
+ paddingLeft: 0,
100
+ paddingRight: 0
101
+ }, onClick: close },
102
+ "\u6536\u8D77",
103
+ React.createElement(UpOutlined, null))))))));
104
+ }
105
+ var SearchArea = InternalSearchArea;
106
+ function useSearchArea() {
107
+ var _a = useState(false), show = _a[0], setShow = _a[1];
108
+ var toggle = function () {
109
+ setShow(function (value) { return !value; });
110
+ };
111
+ return {
112
+ show: show,
113
+ toggle: toggle
114
+ };
115
+ }
116
+ SearchArea.useSearchArea = useSearchArea;
117
+ SearchArea.Item = Item;
118
+ SearchArea.ToggleButton = ToggleButton;
119
+ export default SearchArea;
120
+ var templateObject_1, templateObject_2, templateObject_3;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import './index.less';
3
2
  import type { TableComponentProps } from '../types.ts';
4
3
  declare function Index(props: TableComponentProps): React.JSX.Element;
5
4
  export default Index;
@@ -1,9 +1,10 @@
1
1
  import React, { useMemo, useRef } from 'react';
2
2
  import { FormattedMessage } from 'react-intl';
3
- import { Checkbox, Row, Col } from 'antd';
3
+ import { Checkbox, Col } from 'antd';
4
4
  import { CSSTransition } from 'react-transition-group';
5
5
  import { CloseOutlined } from '@ant-design/icons';
6
- import './index.less';
6
+ import { Global } from '@emotion/react';
7
+ import { TableFooterWrapper, TableFooterTotal, StyledRow, CloseButton, zoomStyles, globalStyles } from './styles';
7
8
  function Index(props) {
8
9
  var _a;
9
10
  var transitionNodeRef = useRef(null);
@@ -67,20 +68,22 @@ function Index(props) {
67
68
  var selectedRowKeys = (_a = rowSelection.selectedRowKeys) !== null && _a !== void 0 ? _a : [];
68
69
  return !!(selectedRowKeys.length > 0 && selectedRowKeys.length === optionalNum);
69
70
  }, [rowSelection.selectedRowKeys, optionalNum]);
70
- return (React.createElement("div", { className: "table-footer" },
71
- React.createElement(CSSTransition, { in: Boolean(props.rowSelection && props.selectionPopover && (checked || indeterminate)), nodeRef: transitionNodeRef, classNames: "zoom", unmountOnExit: true, timeout: 300 }, function () {
72
- var _a, _b;
73
- return (React.createElement(Row, { ref: transitionNodeRef, className: "table-batch-dialog", justify: "space-between" },
74
- React.createElement(Col, { style: { display: 'flex', alignItems: 'center' } },
75
- React.createElement(Checkbox, { checked: checked, indeterminate: indeterminate, onChange: changeCheckAll },
76
- React.createElement(FormattedMessage, { id: "component.table.selected", defaultMessage: '已选{length}条', values: {
77
- length: (_b = (_a = rowSelection.selectedRowKeys) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0
78
- } }))),
79
- React.createElement(Col, { style: { display: 'flex', alignItems: 'center' } },
80
- selectionPopover,
81
- React.createElement("span", { className: "btn-close", onClick: function () { changeCheckAll({ target: { checked: false } }); } },
82
- React.createElement(CloseOutlined, null)))));
83
- }),
84
- pagination && (React.createElement("span", { className: "table-footer-total" }, pagination.showTotal ? pagination.showTotal((_a = pagination.total) !== null && _a !== void 0 ? _a : 0, [0, 0]) : null))));
71
+ return (React.createElement(React.Fragment, null,
72
+ React.createElement(Global, { styles: globalStyles }),
73
+ React.createElement(TableFooterWrapper, null,
74
+ React.createElement(CSSTransition, { in: Boolean(props.rowSelection && props.selectionPopover && (checked || indeterminate)), nodeRef: transitionNodeRef, classNames: zoomStyles, unmountOnExit: true, timeout: 300 }, function () {
75
+ var _a, _b;
76
+ return (React.createElement(StyledRow, { ref: transitionNodeRef, justify: "space-between" },
77
+ React.createElement(Col, { style: { display: 'flex', alignItems: 'center' } },
78
+ React.createElement(Checkbox, { checked: checked, indeterminate: indeterminate, onChange: changeCheckAll },
79
+ React.createElement(FormattedMessage, { id: "component.table.selected", defaultMessage: '已选{length}条', values: {
80
+ length: (_b = (_a = rowSelection.selectedRowKeys) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0
81
+ } }))),
82
+ React.createElement(Col, { style: { display: 'flex', alignItems: 'center' } },
83
+ selectionPopover,
84
+ React.createElement(CloseButton, { onClick: function () { changeCheckAll({ target: { checked: false } }); } },
85
+ React.createElement(CloseOutlined, null)))));
86
+ }),
87
+ pagination && (React.createElement(TableFooterTotal, null, pagination.showTotal ? pagination.showTotal((_a = pagination.total) !== null && _a !== void 0 ? _a : 0, [0, 0]) : null)))));
85
88
  }
86
89
  export default Index;
@@ -0,0 +1,25 @@
1
+ export declare const TableFooterWrapper: import("@emotion/styled").StyledComponent<{
2
+ theme?: import("@emotion/react").Theme;
3
+ as?: React.ElementType;
4
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const TableFooterTotal: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme;
7
+ as?: React.ElementType;
8
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
9
+ export declare const TableBatchDialog: import("@emotion/styled").StyledComponent<{
10
+ theme?: import("@emotion/react").Theme;
11
+ as?: React.ElementType;
12
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
13
+ export declare const StyledRow: import("@emotion/styled").StyledComponent<import("antd").RowProps & import("react").RefAttributes<HTMLDivElement> & {
14
+ theme?: import("@emotion/react").Theme;
15
+ }, {}, {}>;
16
+ export declare const CloseButton: import("@emotion/styled").StyledComponent<{
17
+ theme?: import("@emotion/react").Theme;
18
+ as?: React.ElementType;
19
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
20
+ export declare const zoomStyles: {
21
+ enter: string;
22
+ enterActive: string;
23
+ leaveActive: string;
24
+ };
25
+ export declare const globalStyles = "\n .zoom-enter {\n transform: scale(0);\n }\n\n .zoom-enter-active {\n transform: scale(1);\n }\n\n .zoom-leave-active {\n transform: scale(0);\n }\n";
@@ -0,0 +1,25 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import styled from '@emotion/styled';
6
+ import { Row } from 'antd';
7
+ export var TableFooterWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: absolute;\n left: 8px;\n"], ["\n position: absolute;\n left: 8px;\n"])));
8
+ export var TableFooterTotal = styled.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font-size: 14px;\n color: #666;\n"], ["\n font-size: 14px;\n color: #666;\n"])));
9
+ export var TableBatchDialog = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n position: fixed;\n right: 0;\n bottom: 30px;\n left: 0;\n z-index: 9;\n width: 600px;\n padding: 15px 20px;\n margin: auto;\n color: #fff;\n background-color: #666;\n border-radius: 5px;\n transition: all 0.5s;\n\n .ant-checkbox-wrapper {\n margin-right: 10px;\n color: #fff;\n\n .ant-checkbox-indeterminate .ant-checkbox-inner {\n background-color: transparent;\n border-color: #d9d9d9;\n }\n }\n"], ["\n position: fixed;\n right: 0;\n bottom: 30px;\n left: 0;\n z-index: 9;\n width: 600px;\n padding: 15px 20px;\n margin: auto;\n color: #fff;\n background-color: #666;\n border-radius: 5px;\n transition: all 0.5s;\n\n .ant-checkbox-wrapper {\n margin-right: 10px;\n color: #fff;\n\n .ant-checkbox-indeterminate .ant-checkbox-inner {\n background-color: transparent;\n border-color: #d9d9d9;\n }\n }\n"
10
+ // 包装 Row 组件的样式
11
+ ])));
12
+ // 包装 Row 组件的样式
13
+ export var StyledRow = styled(Row)(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: fixed;\n right: 0;\n bottom: 30px;\n left: 0;\n z-index: 9;\n width: 600px;\n padding: 15px 20px;\n margin: auto;\n color: #fff;\n background-color: #666;\n border-radius: 5px;\n transition: all 0.5s;\n\n .ant-checkbox-wrapper {\n margin-right: 10px;\n color: #fff;\n\n .ant-checkbox-indeterminate .ant-checkbox-inner {\n background-color: transparent;\n border-color: #d9d9d9;\n }\n }\n"], ["\n position: fixed;\n right: 0;\n bottom: 30px;\n left: 0;\n z-index: 9;\n width: 600px;\n padding: 15px 20px;\n margin: auto;\n color: #fff;\n background-color: #666;\n border-radius: 5px;\n transition: all 0.5s;\n\n .ant-checkbox-wrapper {\n margin-right: 10px;\n color: #fff;\n\n .ant-checkbox-indeterminate .ant-checkbox-inner {\n background-color: transparent;\n border-color: #d9d9d9;\n }\n }\n"])));
14
+ export var CloseButton = styled.span(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n margin-left: 20px;\n cursor: pointer;\n opacity: 0.5;\n transition: all 0.5s;\n\n &:hover {\n opacity: 1;\n }\n"], ["\n margin-left: 20px;\n cursor: pointer;\n opacity: 0.5;\n transition: all 0.5s;\n\n &:hover {\n opacity: 1;\n }\n"
15
+ // 动画样式 - 使用 CSS 类名
16
+ ])));
17
+ // 动画样式 - 使用 CSS 类名
18
+ export var zoomStyles = {
19
+ enter: 'zoom-enter',
20
+ enterActive: 'zoom-enter-active',
21
+ leaveActive: 'zoom-leave-active'
22
+ };
23
+ // 全局样式注入
24
+ export var globalStyles = "\n .zoom-enter {\n transform: scale(0);\n }\n\n .zoom-enter-active {\n transform: scale(1);\n }\n\n .zoom-leave-active {\n transform: scale(0);\n }\n";
25
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { type TableComponentProps } from '../types';
3
- import './index.less';
4
3
  interface PopoverSetColumnsProps {
5
4
  order: string[];
6
5
  visibleItems: string[];
@@ -14,7 +14,7 @@ import { HolderOutlined } from '@ant-design/icons';
14
14
  // import { message, IconFont } from 'xmirror-components'
15
15
  import { message } from '../../AntdApp';
16
16
  import IconFont from '../../IconFont';
17
- import './index.less';
17
+ import { ColumnsSettingWrapper } from './styles';
18
18
  function PopoverSetColumns(_a) {
19
19
  var order = _a.order, visibleItems = _a.visibleItems, _b = _a.columns, columns = _b === void 0 ? [] : _b, onChangeOrder = _a.onChangeOrder, columnsVisible = _a.columnsVisible, columnsSort = _a.columnsSort, onChangeVisible = _a.onChangeVisible;
20
20
  var dragged = useRef(null);
@@ -160,7 +160,7 @@ function PopoverSetColumns(_a) {
160
160
  : null;
161
161
  });
162
162
  }, [order, visibleItems, columns, columnsSort, columnsVisible]);
163
- return (React.createElement(Popover, { overlayClassName: "table-columns-setting-popover", content: React.createElement("ul", { onDragOver: dragOver, className: "table-columns-setting-wrapper" }, renderList), trigger: "click", align: {
163
+ return (React.createElement(Popover, { overlayClassName: "table-columns-setting-popover", content: React.createElement(ColumnsSettingWrapper, { onDragOver: dragOver }, renderList), trigger: "click", align: {
164
164
  offset: [-60, -14]
165
165
  } },
166
166
  React.createElement(IconFont, { type: "icon-setting", style: {
@@ -0,0 +1,8 @@
1
+ export declare const PopoverWrapper: import("@emotion/styled").StyledComponent<{
2
+ theme?: import("@emotion/react").Theme;
3
+ as?: React.ElementType;
4
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const ColumnsSettingWrapper: import("@emotion/styled").StyledComponent<{
6
+ theme?: import("@emotion/react").Theme;
7
+ as?: React.ElementType;
8
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, {}>;
@@ -0,0 +1,11 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import styled from '@emotion/styled';
6
+ import { keyframes } from '@emotion/react';
7
+ var dragUpAnimation = keyframes(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n from {\n margin-top: 0;\n }\n to {\n margin-top: 32px;\n }\n"], ["\n from {\n margin-top: 0;\n }\n to {\n margin-top: 32px;\n }\n"])));
8
+ var dragDownAnimation = keyframes(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n from {\n margin-top: 32px;\n margin-bottom: 0;\n }\n to {\n margin-top: 0;\n margin-bottom: 32px;\n }\n"], ["\n from {\n margin-top: 32px;\n margin-bottom: 0;\n }\n to {\n margin-top: 0;\n margin-bottom: 32px;\n }\n"])));
9
+ export var PopoverWrapper = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n .ant-popover-inner-content {\n max-height: 360px;\n padding: 0;\n overflow-y: auto;\n }\n"], ["\n .ant-popover-inner-content {\n max-height: 360px;\n padding: 0;\n overflow-y: auto;\n }\n"])));
10
+ export var ColumnsSettingWrapper = styled.ul(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n padding: 10px 0;\n\n .drag-up {\n border: solid 2px #ccc;\n animation: ", " ease 0.2s 1;\n animation-fill-mode: forwards;\n }\n\n .drag-down {\n border: solid 2px #ccc;\n animation: ", " ease 0.2s 1;\n animation-fill-mode: forwards;\n }\n\n li {\n width: 150px;\n padding: 5px 12px;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: keep-all;\n white-space: nowrap;\n user-select: none;\n transition: background-color 0.5s;\n\n .icon-drag {\n margin-right: 10px;\n color: #999;\n cursor: move;\n }\n\n &[draggable=\"false\"] {\n .icon-drag {\n cursor: no-drop;\n opacity: 0.2;\n }\n }\n\n &:hover {\n background-color: #f0f0f0;\n }\n }\n"], ["\n padding: 10px 0;\n\n .drag-up {\n border: solid 2px #ccc;\n animation: ", " ease 0.2s 1;\n animation-fill-mode: forwards;\n }\n\n .drag-down {\n border: solid 2px #ccc;\n animation: ", " ease 0.2s 1;\n animation-fill-mode: forwards;\n }\n\n li {\n width: 150px;\n padding: 5px 12px;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: keep-all;\n white-space: nowrap;\n user-select: none;\n transition: background-color 0.5s;\n\n .icon-drag {\n margin-right: 10px;\n color: #999;\n cursor: move;\n }\n\n &[draggable=\"false\"] {\n .icon-drag {\n cursor: no-drop;\n opacity: 0.2;\n }\n }\n\n &:hover {\n background-color: #f0f0f0;\n }\n }\n"])), dragUpAnimation, dragDownAnimation);
11
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { AnyObject, TableComponentProps } from './types';
3
- import './index.less';
4
3
  declare const _default: React.ForwardRefExoticComponent<TableComponentProps<AnyObject> & React.RefAttributes<HTMLDivElement>>;
5
4
  export default _default;
@@ -15,7 +15,7 @@ import { useLocalStorageState } from 'ahooks';
15
15
  import { DownOutlined } from '@ant-design/icons';
16
16
  import PopoverSetColumns from './PopoverSetColumns';
17
17
  import Footer from './Footer';
18
- import './index.less';
18
+ import { TableWrapper } from './styles';
19
19
  function Index(props, ref) {
20
20
  var _a = props.columns, columns = _a === void 0 ? [] : _a, columnsSort = props.columnsSort, columnsVisible = props.columnsVisible, _b = props.tableId, tableId = _b === void 0 ? '' : _b, pagination = props.pagination, dataSource = props.dataSource;
21
21
  var pathname = location.pathname;
@@ -181,7 +181,7 @@ function Index(props, ref) {
181
181
  useEffect(function () {
182
182
  initColumnsSort();
183
183
  }, []);
184
- return (React.createElement("div", { className: "table-wrapper", style: { position: 'relative' }, ref: ref },
184
+ return (React.createElement(TableWrapper, { ref: ref },
185
185
  React.createElement(Table, __assign({ ref: tableRef, scroll: {
186
186
  x: 900
187
187
  } }, props, { pagination: paginationProps, columns: renderColumns }))));
@@ -0,0 +1,4 @@
1
+ export declare const TableWrapper: import("@emotion/styled").StyledComponent<{
2
+ theme?: import("@emotion/react").Theme;
3
+ as?: React.ElementType;
4
+ }, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -0,0 +1,7 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import styled from '@emotion/styled';
6
+ export var TableWrapper = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: relative;\n\n .ant-pagination-options {\n .ant-select {\n width: auto !important;\n }\n }\n"], ["\n position: relative;\n\n .ant-pagination-options {\n .ant-select {\n width: auto !important;\n }\n }\n"])));
7
+ var templateObject_1;
@@ -6,4 +6,5 @@ export { default as IconButton } from './components/IconButton';
6
6
  export { default as GlobalLoading, setGlobalLoading } from './components/GlobalLoading';
7
7
  export { default as ConfigProvider, ConfigContext } from './components/ConfigProvider';
8
8
  export { default as Table } from './components/Table';
9
+ export { default as SearchArea } from './components/SearchArea';
9
10
  export { default as useRequest } from './hooks/useRequest';
package/build/es/index.js CHANGED
@@ -6,4 +6,5 @@ export { default as IconButton } from './components/IconButton';
6
6
  export { default as GlobalLoading, setGlobalLoading } from './components/GlobalLoading';
7
7
  export { default as ConfigProvider, ConfigContext } from './components/ConfigProvider';
8
8
  export { default as Table } from './components/Table';
9
+ export { default as SearchArea } from './components/SearchArea';
9
10
  export { default as useRequest } from './hooks/useRequest';
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __assign = (this && this.__assign) || function () {
7
+ __assign = Object.assign || function(t) {
8
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
9
+ s = arguments[i];
10
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
11
+ t[p] = s[p];
12
+ }
13
+ return t;
14
+ };
15
+ return __assign.apply(this, arguments);
16
+ };
17
+ var __rest = (this && this.__rest) || function (s, e) {
18
+ var t = {};
19
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
20
+ t[p] = s[p];
21
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
22
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
24
+ t[p[i]] = s[p[i]];
25
+ }
26
+ return t;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ var react_1 = __importDefault(require("react"));
33
+ var antd_1 = require("antd");
34
+ var styled_1 = __importDefault(require("@emotion/styled"));
35
+ var StyledFormItem = (0, styled_1.default)(antd_1.Form.Item)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-flex;\n text-align: left;\n vertical-align: middle;\n\n & + & {\n margin-left: 20px;\n }\n\n .search-item__label {\n position: relative;\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n height: 32px;\n font-size: 14px;\n color: rgba(0, 0, 0, 85%);\n\n &::after {\n position: relative;\n top: -0.5px;\n margin: 0 8px 0 2px;\n content: ':';\n }\n }\n\n .search-item__content {\n flex: 1;\n }\n"], ["\n display: inline-flex;\n text-align: left;\n vertical-align: middle;\n\n & + & {\n margin-left: 20px;\n }\n\n .search-item__label {\n position: relative;\n display: inline-flex;\n align-items: center;\n max-width: 100%;\n height: 32px;\n font-size: 14px;\n color: rgba(0, 0, 0, 85%);\n\n &::after {\n position: relative;\n top: -0.5px;\n margin: 0 8px 0 2px;\n content: ':';\n }\n }\n\n .search-item__content {\n flex: 1;\n }\n"
36
+ /**
37
+ * 筛选项
38
+ * @param props
39
+ * @return {JSX.Element}
40
+ * @constructor
41
+ */
42
+ ])));
43
+ /**
44
+ * 筛选项
45
+ * @param props
46
+ * @return {JSX.Element}
47
+ * @constructor
48
+ */
49
+ function Index(_a) {
50
+ var children = _a.children, props = __rest(_a, ["children"]);
51
+ return (react_1.default.createElement(StyledFormItem, __assign({}, props), children));
52
+ }
53
+ exports.default = Index;
54
+ var templateObject_1;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __importDefault = (this && this.__importDefault) || function (mod) {
7
+ return (mod && mod.__esModule) ? mod : { "default": mod };
8
+ };
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ var react_1 = __importDefault(require("react"));
11
+ var antd_1 = require("antd");
12
+ var icons_1 = require("@ant-design/icons");
13
+ var styled_1 = __importDefault(require("@emotion/styled"));
14
+ var AnimatedIcon = (0, styled_1.default)(icons_1.CaretUpOutlined, {
15
+ shouldForwardProp: function (prop) { return prop !== 'show'; },
16
+ })(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n transition: transform 0.3s ease-in-out;\n transform: rotate(", ");\n"], ["\n transition: transform 0.3s ease-in-out;\n transform: rotate(", ");\n"])), function (props) { return props.show ? '0deg' : '180deg'; });
17
+ /**
18
+ * 高级筛选触发按钮
19
+ * @return {JSX.Element}
20
+ * @constructor
21
+ */
22
+ function ToggleButton(_a) {
23
+ var panel = _a.panel;
24
+ var show = panel.show, toggle = panel.toggle;
25
+ return (react_1.default.createElement(antd_1.Button, { type: "link", style: { paddingLeft: 0, paddingRight: 0 }, onClick: toggle },
26
+ "\u9AD8\u7EA7\u641C\u7D22",
27
+ react_1.default.createElement(AnimatedIcon, { show: show })));
28
+ }
29
+ exports.default = ToggleButton;
30
+ var templateObject_1;