@zat-design/sisyphus-react 4.0.0-beta.3 → 4.0.0-beta.4
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/babel.config.js +7 -30
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/regExp/index.d.ts +19 -0
- package/dist/esm/regExp/index.js +73 -0
- package/dist/esm/tools/calc/index.d.ts +4 -0
- package/dist/esm/tools/calc/index.js +67 -0
- package/dist/esm/tools/dateUtils.d.ts +7 -0
- package/dist/esm/tools/dateUtils.js +23 -0
- package/dist/esm/tools/disableDate/index.d.ts +9 -0
- package/dist/esm/tools/disableDate/index.js +43 -0
- package/dist/esm/tools/disableTimeRange/index.d.ts +9 -0
- package/dist/esm/tools/disableTimeRange/index.js +121 -0
- package/dist/esm/tools/formatAmount/index.d.ts +7 -0
- package/dist/esm/tools/formatAmount/index.js +14 -0
- package/dist/esm/tools/formatPerMill/index.d.ts +7 -0
- package/dist/esm/tools/formatPerMill/index.js +11 -0
- package/dist/esm/tools/formatPercent/index.d.ts +7 -0
- package/dist/esm/tools/formatPercent/index.js +11 -0
- package/dist/esm/tools/getDataByIdCard/index.d.ts +16 -0
- package/dist/esm/tools/getDataByIdCard/index.js +65 -0
- package/dist/esm/tools/index.d.ts +12 -0
- package/dist/esm/tools/index.js +14 -0
- package/dist/esm/tools/sumAmount/index.d.ts +16 -0
- package/dist/esm/tools/sumAmount/index.js +40 -0
- package/dist/esm/tools/toChineseNum/index.d.ts +7 -0
- package/dist/esm/tools/toChineseNum/index.js +103 -0
- package/dist/esm/tools/toFixed/index.d.ts +2 -0
- package/dist/esm/tools/toFixed/index.js +5 -0
- package/dist/esm/tools/transformDataName/index.d.ts +12 -0
- package/dist/esm/tools/transformDataName/index.js +37 -0
- package/dist/esm/transforms/dateTransformer/index.d.ts +24 -0
- package/dist/esm/transforms/dateTransformer/index.js +67 -0
- package/dist/esm/transforms/index.d.ts +6 -0
- package/dist/esm/transforms/index.js +6 -0
- package/dist/esm/transforms/propTypes.d.ts +7 -0
- package/dist/esm/transforms/propTypes.js +1 -0
- package/dist/esm/transforms/transformDate/index.d.ts +21 -0
- package/dist/esm/transforms/transformDate/index.js +141 -0
- package/dist/esm/transforms/transformDatePicker/index.d.ts +12 -0
- package/dist/esm/transforms/transformDatePicker/index.js +24 -0
- package/dist/esm/transforms/transformRangePicker/index.d.ts +29 -0
- package/dist/esm/transforms/transformRangePicker/index.js +61 -0
- package/dist/esm/transforms/transformSwitch/index.d.ts +13 -0
- package/dist/esm/transforms/transformSwitch/index.js +35 -0
- package/dist/esm/transforms/utils.d.ts +2 -0
- package/dist/esm/transforms/utils.js +8 -0
- package/dist/esm/validate/index.d.ts +107 -0
- package/dist/esm/validate/index.js +284 -0
- package/es/ProAction/index.less +0 -2
- package/es/ProConfigProvider/index.d.ts +1 -0
- package/es/ProConfigProvider/index.js +4 -5
- package/es/ProDownload/style/index.less +0 -2
- package/es/ProDrawerForm/index.js +33 -29
- package/es/ProDrawerForm/style/index.less +0 -2
- package/es/ProEditLabel/style/index.less +0 -2
- package/es/ProEditTable/components/RcTable/DraggableTable.js +1 -1
- package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +14 -2
- package/es/ProEditTable/propsType.d.ts +1 -1
- package/es/ProEditTable/style/index.less +2 -4
- package/es/ProEditTable/utils/diffOriginal.d.ts +1 -0
- package/es/ProEditTable/utils/diffOriginal.js +68 -1
- package/es/ProEnum/hooks/useEnum.js +5 -0
- package/es/ProEnum/style/index.less +0 -2
- package/es/ProForm/components/FormFooter/index.js +6 -6
- package/es/ProForm/components/base/DatePicker/index.js +19 -34
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/es/ProForm/components/base/TextArea/index.less +0 -2
- package/es/ProForm/components/base/TimePicker/style/index.less +0 -2
- package/es/ProForm/components/combination/Container/style/index.less +0 -2
- package/es/ProForm/components/combination/FormList/style/index.less +0 -2
- package/es/ProForm/components/combination/Group/component/ComRender.js +9 -8
- package/es/ProForm/components/combination/Group/hooks/index.js +17 -4
- package/es/ProForm/components/combination/Group/index.d.ts +8 -2
- package/es/ProForm/components/combination/Group/index.js +10 -16
- package/es/ProForm/components/combination/ProCascader/index.js +106 -52
- package/es/ProForm/components/combination/ProCascader/propsType.d.ts +12 -4
- package/es/ProForm/components/combination/ProCascader/style/index.less +1 -3
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -4
- package/es/ProForm/components/combination/ProModalSelect/index.js +38 -64
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -4
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +4 -3
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +0 -2
- package/es/ProForm/components/render/ChangedWrapper.js +2 -2
- package/es/ProForm/components/render/Render.js +17 -5
- package/es/ProForm/components/render/RenderFields.d.ts +1 -0
- package/es/ProForm/components/render/RenderFields.js +4 -2
- package/es/ProForm/components/render/propsType.d.ts +1 -0
- package/es/ProForm/index.d.ts +2 -2
- package/es/ProForm/index.js +5 -2
- package/es/ProForm/propsType.d.ts +2 -0
- package/es/ProForm/style/index.less +0 -2
- package/es/ProForm/utils/diffOriginal.d.ts +1 -0
- package/es/ProForm/utils/diffOriginal.js +66 -1
- package/es/ProForm/utils/index.js +1 -1
- package/es/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/es/ProForm/utils/useShouldUpdate.js +89 -3
- package/es/ProIcon/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +60 -8
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +25 -3
- package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +3 -1
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Menu/index.js +4 -1
- package/es/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/es/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +8 -3
- package/es/ProLayout/components/ProCollapse/index.js +27 -3
- package/es/ProLayout/components/ProCollapse/style/index.less +148 -4
- package/es/ProLayout/components/ProFooter/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -2
- package/es/ProLayout/components/ProHeader/style/index.less +0 -2
- package/es/ProLayout/index.d.ts +0 -11
- package/es/ProLayout/index.js +60 -32
- package/es/ProLayout/propTypes.d.ts +9 -0
- package/es/ProLayout/style/index.less +0 -2
- package/es/ProLayout/utils/index.d.ts +7 -0
- package/es/ProLayout/utils/index.js +30 -0
- package/es/ProSelect/index.less +0 -2
- package/es/ProSelect/utils/index.js +62 -1
- package/es/ProStep/components/Item/index.js +1 -2
- package/es/ProStep/style/index.less +0 -2
- package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +1 -1
- package/es/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/es/ProTable/hooks/useAntdTable.js +92 -64
- package/es/ProTable/index.d.ts +3 -7
- package/es/ProTable/index.js +14 -14
- package/es/ProTable/propsType.d.ts +3 -2
- package/es/ProTable/style/index.less +4 -6
- package/es/ProTabs/style/index.less +0 -2
- package/es/ProThemeTools/index.d.ts +0 -7
- package/es/ProThemeTools/index.js +10 -12
- package/es/ProThemeTools/style/index.less +0 -2
- package/es/ProTooltip/style/index.less +0 -2
- package/es/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/es/ProTree/style/index.less +0 -2
- package/es/ProTreeModal/style/index.less +0 -2
- package/es/ProUpload/style/index.less +0 -2
- package/es/ProViewer/style/index.less +0 -2
- package/es/style/theme/antd.less +0 -2
- package/jest.config.js +46 -4
- package/lib/ProAction/index.less +0 -2
- package/lib/ProConfigProvider/index.d.ts +1 -0
- package/lib/ProConfigProvider/index.js +4 -3
- package/lib/ProDownload/style/index.less +0 -2
- package/lib/ProDrawerForm/index.js +25 -28
- package/lib/ProDrawerForm/style/index.less +0 -2
- package/lib/ProEditLabel/style/index.less +0 -2
- package/lib/ProEditTable/components/RcTable/DraggableTable.js +1 -1
- package/lib/ProEditTable/components/RenderField/ListChangedWrapper.js +10 -2
- package/lib/ProEditTable/propsType.d.ts +1 -1
- package/lib/ProEditTable/style/index.less +2 -4
- package/lib/ProEditTable/utils/diffOriginal.d.ts +1 -0
- package/lib/ProEditTable/utils/diffOriginal.js +48 -1
- package/lib/ProEnum/hooks/useEnum.js +3 -0
- package/lib/ProEnum/style/index.less +0 -2
- package/lib/ProForm/components/FormFooter/index.js +6 -5
- package/lib/ProForm/components/base/DatePicker/index.js +21 -33
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +0 -2
- package/lib/ProForm/components/base/TextArea/index.less +0 -2
- package/lib/ProForm/components/base/TimePicker/style/index.less +0 -2
- package/lib/ProForm/components/combination/Container/style/index.less +0 -2
- package/lib/ProForm/components/combination/FormList/style/index.less +0 -2
- package/lib/ProForm/components/combination/Group/component/ComRender.js +8 -7
- package/lib/ProForm/components/combination/Group/hooks/index.js +8 -2
- package/lib/ProForm/components/combination/Group/index.d.ts +8 -2
- package/lib/ProForm/components/combination/Group/index.js +8 -13
- package/lib/ProForm/components/combination/ProCascader/index.js +73 -16
- package/lib/ProForm/components/combination/ProCascader/propsType.d.ts +12 -4
- package/lib/ProForm/components/combination/ProCascader/style/index.less +1 -3
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +26 -52
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +7 -3
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -4
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +4 -3
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +0 -2
- package/lib/ProForm/components/render/ChangedWrapper.js +2 -2
- package/lib/ProForm/components/render/Render.js +11 -3
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
- package/lib/ProForm/components/render/RenderFields.js +4 -2
- package/lib/ProForm/components/render/propsType.d.ts +1 -0
- package/lib/ProForm/index.d.ts +2 -2
- package/lib/ProForm/index.js +3 -1
- package/lib/ProForm/propsType.d.ts +2 -0
- package/lib/ProForm/style/index.less +0 -2
- package/lib/ProForm/utils/diffOriginal.d.ts +1 -0
- package/lib/ProForm/utils/diffOriginal.js +48 -1
- package/lib/ProForm/utils/index.js +1 -1
- package/lib/ProForm/utils/useShouldUpdate.d.ts +1 -0
- package/lib/ProForm/utils/useShouldUpdate.js +50 -1
- package/lib/ProIcon/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/index.js +33 -4
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +7 -2
- package/lib/ProLayout/components/Layout/Menu/SideMenu/index.js +2 -1
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Menu/index.js +4 -1
- package/lib/ProLayout/components/Layout/Menu/style/index.less +0 -2
- package/lib/ProLayout/components/Layout/Notice/style/index.less +0 -2
- package/lib/ProLayout/components/ProCollapse/PropTypes.d.ts +8 -3
- package/lib/ProLayout/components/ProCollapse/index.js +27 -3
- package/lib/ProLayout/components/ProCollapse/style/index.less +148 -4
- package/lib/ProLayout/components/ProFooter/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +0 -2
- package/lib/ProLayout/components/ProHeader/style/index.less +0 -2
- package/lib/ProLayout/index.d.ts +0 -11
- package/lib/ProLayout/index.js +51 -32
- package/lib/ProLayout/propTypes.d.ts +9 -0
- package/lib/ProLayout/style/index.less +0 -2
- package/lib/ProLayout/utils/index.d.ts +7 -0
- package/lib/ProLayout/utils/index.js +15 -0
- package/lib/ProSelect/index.less +0 -2
- package/lib/ProSelect/utils/index.js +34 -5
- package/lib/ProStep/components/Item/index.js +1 -2
- package/lib/ProStep/style/index.less +0 -2
- package/lib/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +1 -1
- package/lib/ProTable/hooks/useAntdTable.d.ts +3 -0
- package/lib/ProTable/hooks/useAntdTable.js +71 -36
- package/lib/ProTable/index.d.ts +3 -7
- package/lib/ProTable/index.js +8 -13
- package/lib/ProTable/propsType.d.ts +3 -2
- package/lib/ProTable/style/index.less +4 -6
- package/lib/ProTabs/style/index.less +0 -2
- package/lib/ProThemeTools/index.d.ts +0 -7
- package/lib/ProThemeTools/index.js +5 -12
- package/lib/ProThemeTools/style/index.less +0 -2
- package/lib/ProTooltip/style/index.less +0 -2
- package/lib/ProTree/components/ProTreeSelect/style/index.less +0 -2
- package/lib/ProTree/style/index.less +0 -2
- package/lib/ProTreeModal/style/index.less +0 -2
- package/lib/ProUpload/style/index.less +0 -2
- package/lib/ProViewer/style/index.less +0 -2
- package/lib/style/theme/antd.less +0 -2
- package/package.json +7 -6
- package/tests/__mocks__/fileMock.js +1 -0
- package/tests/__mocks__/zatUtils.js +27 -0
- package/tests/setup.ts +484 -0
- package/tests/test-utils.tsx +81 -0
- package/dist/index.esm.css +0 -6445
- package/dist/index.esm.js +0 -3
- package/dist/less.esm.css +0 -5871
- package/dist/less.esm.js +0 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
2
2
|
import { CollapseProps, CollapsePanelProps } from 'antd/es/collapse';
|
3
|
-
export type levelType = '1' | '2';
|
3
|
+
export type levelType = '1' | '2' | '3';
|
4
4
|
export interface TitleListType {
|
5
5
|
/**
|
6
6
|
* @description 描述的标题
|
@@ -28,12 +28,12 @@ export interface ProCollapseType {
|
|
28
28
|
* @description 自动适应窗口大小
|
29
29
|
* @default -
|
30
30
|
*/
|
31
|
-
autoHeight?:
|
31
|
+
autoHeight?: boolean;
|
32
32
|
/**
|
33
33
|
* @description 标题前图标
|
34
34
|
* @default -
|
35
35
|
*/
|
36
|
-
icon?: React.ReactNode |
|
36
|
+
icon?: React.ReactNode | boolean;
|
37
37
|
/**
|
38
38
|
* @description 折叠头部多个标题
|
39
39
|
* @default []
|
@@ -59,6 +59,11 @@ export interface ProCollapseType {
|
|
59
59
|
* @default false
|
60
60
|
*/
|
61
61
|
towCollapse?: boolean;
|
62
|
+
/**
|
63
|
+
* @description 三级折叠是否带收起
|
64
|
+
* @default false
|
65
|
+
*/
|
66
|
+
threeCollapse?: boolean;
|
62
67
|
/**
|
63
68
|
* @description 标题右侧扩展信息
|
64
69
|
* @default -
|
@@ -4,7 +4,6 @@ import { useLayoutEffect } from 'react';
|
|
4
4
|
import { Collapse, Descriptions, Space } from 'antd';
|
5
5
|
import { CaretRightOutlined } from '@ant-design/icons';
|
6
6
|
import classNames from 'classnames';
|
7
|
-
import { isBoolean } from 'lodash';
|
8
7
|
import foldSvg from "../../../assets/fold.svg";
|
9
8
|
import ProIcon from "../../../ProIcon/index";
|
10
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -19,6 +18,8 @@ var ProCollapse = function ProCollapse(props) {
|
|
19
18
|
level = _props$level === void 0 ? '1' : _props$level,
|
20
19
|
_props$towCollapse = props.towCollapse,
|
21
20
|
towCollapse = _props$towCollapse === void 0 ? false : _props$towCollapse,
|
21
|
+
_props$threeCollapse = props.threeCollapse,
|
22
|
+
threeCollapse = _props$threeCollapse === void 0 ? false : _props$threeCollapse,
|
22
23
|
titleList = props.titleList,
|
23
24
|
extra = props.extra,
|
24
25
|
_props$column = props.column,
|
@@ -45,9 +46,10 @@ var ProCollapse = function ProCollapse(props) {
|
|
45
46
|
var cls = classNames(_defineProperty({
|
46
47
|
'pro-collapse': true,
|
47
48
|
'pro-collapse-level2': level === '2',
|
49
|
+
'pro-collapse-level3': level === '3',
|
48
50
|
'pro-collapse-list': titleList === null || titleList === void 0 ? void 0 : titleList.length,
|
49
51
|
'pro-collapse-no-title': !title,
|
50
|
-
'pro-collapse-no-level1-title': !title && level !== '2'
|
52
|
+
'pro-collapse-no-level1-title': !title && level !== '2' && level !== '3'
|
51
53
|
}, "".concat(className), className));
|
52
54
|
var content = /*#__PURE__*/_jsx("div", {
|
53
55
|
className: "pro-collapse-content",
|
@@ -70,13 +72,35 @@ var ProCollapse = function ProCollapse(props) {
|
|
70
72
|
panelProps.collapsible = 'disabled';
|
71
73
|
}
|
72
74
|
}
|
75
|
+
if (level === '3') {
|
76
|
+
var level3Panel = classNames({
|
77
|
+
'pro-collapse-level3-collapse': threeCollapse,
|
78
|
+
'pro-collapse-level3-no-collapse': !threeCollapse,
|
79
|
+
'pro-collapse-panel': true
|
80
|
+
});
|
81
|
+
var hasCollapse = {};
|
82
|
+
if (!threeCollapse) {
|
83
|
+
hasCollapse.collapsible = 'disabled';
|
84
|
+
}
|
85
|
+
return [_objectSpread(_objectSpread({
|
86
|
+
key: '1',
|
87
|
+
label: _title,
|
88
|
+
children: content,
|
89
|
+
extra: /*#__PURE__*/_jsx("div", {
|
90
|
+
className: "extra-info",
|
91
|
+
children: extra
|
92
|
+
}),
|
93
|
+
className: level3Panel,
|
94
|
+
forceRender: true
|
95
|
+
}, hasCollapse), collapsePanelProps)];
|
96
|
+
}
|
73
97
|
if (icon) {
|
74
98
|
_title = /*#__PURE__*/_jsxs(Space, {
|
75
99
|
size: 8,
|
76
100
|
align: "center",
|
77
101
|
children: [/*#__PURE__*/_jsx("div", {
|
78
102
|
className: "pro-collapse-icon",
|
79
|
-
children:
|
103
|
+
children: typeof icon === 'boolean' ? /*#__PURE__*/_jsx(ProIcon, {
|
80
104
|
src: foldSvg,
|
81
105
|
actionMap: {
|
82
106
|
fill: []
|
@@ -1,5 +1,3 @@
|
|
1
|
-
/* @root-entry-name: 'default'; */
|
2
|
-
/* @import (reference) '~antd/es/style/themes/index.less'; */
|
3
1
|
|
4
2
|
.pro-collapse {
|
5
3
|
.pro-collapse-icon{
|
@@ -33,7 +31,8 @@
|
|
33
31
|
.@{ant-prefix}-collapse-header {
|
34
32
|
align-items: center !important;
|
35
33
|
padding: 10px var(--zaui-space-size-md, 16px) !important;
|
36
|
-
background:
|
34
|
+
background: #e4f2fe;
|
35
|
+
border-radius: 8px !important;
|
37
36
|
}
|
38
37
|
|
39
38
|
.@{ant-prefix}-collapse-header-text {
|
@@ -99,7 +98,7 @@
|
|
99
98
|
}
|
100
99
|
|
101
100
|
.pro-collapse-content {
|
102
|
-
padding: var(--zaui-space-size-
|
101
|
+
padding: var(--zaui-space-size-md, 16px) !important;
|
103
102
|
}
|
104
103
|
|
105
104
|
.pro-collapse-level2-collapse {
|
@@ -111,6 +110,7 @@
|
|
111
110
|
padding: 0 8px 6px !important;
|
112
111
|
border-bottom: 1px solid #dee0e3;
|
113
112
|
margin: 0 -8px;
|
113
|
+
border-radius: 0 !important;
|
114
114
|
.@{ant-prefix}-collapse-arrow{
|
115
115
|
right: 8px;
|
116
116
|
}
|
@@ -150,6 +150,9 @@
|
|
150
150
|
.@{ant-prefix}-collapse-expand-icon {
|
151
151
|
display: none;
|
152
152
|
}
|
153
|
+
.pro-collapse-content{
|
154
|
+
padding: var(--zaui-space-size-sm, 8px) 0 !important;
|
155
|
+
}
|
153
156
|
}
|
154
157
|
}
|
155
158
|
|
@@ -201,4 +204,145 @@
|
|
201
204
|
}
|
202
205
|
|
203
206
|
}
|
207
|
+
|
208
|
+
&.pro-collapse-level3 {
|
209
|
+
margin-bottom: var(--zaui-space-size-md, 16px);
|
210
|
+
|
211
|
+
.pro-collapse-level2{
|
212
|
+
margin-top: 8px !important;
|
213
|
+
.pro-collapse-panel {
|
214
|
+
border: none !important;
|
215
|
+
}
|
216
|
+
.@{ant-prefix}-collapse-header {
|
217
|
+
height: auto !important;
|
218
|
+
background: #fff !important;
|
219
|
+
&:hover{
|
220
|
+
background: #fff !important;
|
221
|
+
}
|
222
|
+
.@{ant-prefix}-collapse-header-text {
|
223
|
+
&:before{
|
224
|
+
display: block;
|
225
|
+
}
|
226
|
+
}
|
227
|
+
|
228
|
+
.@{ant-prefix}-collapse-extra {
|
229
|
+
.extra-info {
|
230
|
+
font-size: var(--zaui-font-size, 14px);
|
231
|
+
color: var(--zaui-text, #343434);
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|
235
|
+
.@{ant-prefix}-collapse-content{
|
236
|
+
.@{ant-prefix}-collapse-content-box{
|
237
|
+
.pro-collapse-content{
|
238
|
+
padding: var(--zaui-space-size-sm, 8px) 0 !important;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
}
|
244
|
+
|
245
|
+
.@{ant-prefix}-collapse-item-active{
|
246
|
+
margin-bottom: 0 !important;
|
247
|
+
}
|
248
|
+
.pro-collapse-panel {
|
249
|
+
border: 1px solid #d9d9d9;
|
250
|
+
margin-bottom: var(--zaui-space-size-md, 16px);
|
251
|
+
overflow: hidden;
|
252
|
+
border-radius: 8px !important;
|
253
|
+
|
254
|
+
&:last-child {
|
255
|
+
margin-bottom: 0;
|
256
|
+
border-bottom: 1px solid #d9d9d9;
|
257
|
+
}
|
258
|
+
}
|
259
|
+
|
260
|
+
.pro-collapse-level3-no-collapse{
|
261
|
+
.@{ant-prefix}-collapse-header{
|
262
|
+
padding: 0 !important;
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
.@{ant-prefix}-collapse-header {
|
267
|
+
height: 48px !important;
|
268
|
+
padding: 0 var(--zaui-space-size-md, 16px) !important;
|
269
|
+
background: #F8F8F8 !important;
|
270
|
+
border-radius: 8px;
|
271
|
+
align-items: center !important;
|
272
|
+
justify-content: center !important;
|
273
|
+
display: flex !important;
|
274
|
+
margin: 0 !important;
|
275
|
+
border-bottom: none !important;
|
276
|
+
|
277
|
+
.@{ant-prefix}-collapse-header-text {
|
278
|
+
font-size: var(--zaui-font-size, 14px);
|
279
|
+
font-weight: 500;
|
280
|
+
color: var(--zaui-text, #343434);
|
281
|
+
padding-left: 16px !important;
|
282
|
+
&:before{
|
283
|
+
display: none;
|
284
|
+
}
|
285
|
+
}
|
286
|
+
|
287
|
+
.@{ant-prefix}-collapse-extra {
|
288
|
+
.extra-info {
|
289
|
+
font-size: var(--zaui-font-size, 14px);
|
290
|
+
color: var(--zaui-text, #343434);
|
291
|
+
}
|
292
|
+
}
|
293
|
+
}
|
294
|
+
|
295
|
+
.@{ant-prefix}-collapse-content {
|
296
|
+
.@{ant-prefix}-collapse-content-box {
|
297
|
+
.pro-collapse-content {
|
298
|
+
padding: var(--zaui-space-size-md, 16px) !important;
|
299
|
+
background: var(--zaui-base-bg, #ffffff);
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}
|
303
|
+
|
304
|
+
// 可折叠样式
|
305
|
+
.pro-collapse-level3-collapse {
|
306
|
+
.@{ant-prefix}-collapse-expand-icon {
|
307
|
+
display: block !important;
|
308
|
+
color: #999;
|
309
|
+
margin-right: 8px;
|
310
|
+
}
|
311
|
+
|
312
|
+
.@{ant-prefix}-collapse-header {
|
313
|
+
cursor: pointer;
|
314
|
+
padding: 0 !important;
|
315
|
+
&:hover {
|
316
|
+
background: #f0f0f0;
|
317
|
+
}
|
318
|
+
}
|
319
|
+
}
|
320
|
+
|
321
|
+
// 不可折叠样式
|
322
|
+
.pro-collapse-level3-no-collapse {
|
323
|
+
.@{ant-prefix}-collapse-expand-icon {
|
324
|
+
display: none !important;
|
325
|
+
}
|
326
|
+
|
327
|
+
.@{ant-prefix}-collapse-header {
|
328
|
+
cursor: default;
|
329
|
+
}
|
330
|
+
}
|
331
|
+
|
332
|
+
// 禁用折叠时的样式
|
333
|
+
&.@{ant-prefix}-collapse .@{ant-prefix}-collapse-item-disabled > .@{ant-prefix}-collapse-header,
|
334
|
+
.@{ant-prefix}-collapse
|
335
|
+
.@{ant-prefix}-collapse-item-disabled
|
336
|
+
> .@{ant-prefix}-collapse-header
|
337
|
+
> .arrow {
|
338
|
+
color: var(--zaui-text, #343434);
|
339
|
+
cursor: default;
|
340
|
+
background: #F8F8F8 !important;
|
341
|
+
}
|
342
|
+
}
|
343
|
+
// 当pro-collapse-content直接包含level3且不包含level2时,添加padding
|
344
|
+
.pro-collapse-level2 .pro-collapse-content:has(.pro-collapse-level3) {
|
345
|
+
padding: var(--zaui-space-size-md, 16px) !important;
|
346
|
+
padding-right: 0 !important;
|
347
|
+
}
|
204
348
|
}
|
package/es/ProLayout/index.d.ts
CHANGED
@@ -7,17 +7,6 @@ export declare const LayoutContext: import("react").Context<{
|
|
7
7
|
}>;
|
8
8
|
declare const ProLayout: {
|
9
9
|
(props: ProLayoutType): import("react/jsx-runtime").JSX.Element;
|
10
|
-
defaultProps: {
|
11
|
-
menus: any[];
|
12
|
-
iconfontUrl: string;
|
13
|
-
title: string;
|
14
|
-
collapsed: boolean;
|
15
|
-
routerMatch: string;
|
16
|
-
pure: boolean;
|
17
|
-
theme: string;
|
18
|
-
headerHeight: number;
|
19
|
-
contentStyle: {};
|
20
|
-
};
|
21
10
|
ProCollapse: (props: import("./components/ProCollapse/PropTypes").ProCollapseType) => import("react/jsx-runtime").JSX.Element;
|
22
11
|
ProFooter: import("react").MemoExoticComponent<(props: import("./components/ProFooter/PropTypes").ProFooterType) => import("react/jsx-runtime").JSX.Element>;
|
23
12
|
ProHeader: import("react").MemoExoticComponent<(props: import("./components/ProHeader/PropTypes").ProHeaderType) => import("react/jsx-runtime").JSX.Element>;
|
package/es/ProLayout/index.js
CHANGED
@@ -21,8 +21,10 @@ var ProLayout = function ProLayout(props) {
|
|
21
21
|
className = _props$className === void 0 ? '' : _props$className,
|
22
22
|
_props$pure = props.pure,
|
23
23
|
pure = _props$pure === void 0 ? false : _props$pure,
|
24
|
-
headerHeight = props.headerHeight,
|
25
|
-
|
24
|
+
_props$headerHeight = props.headerHeight,
|
25
|
+
headerHeight = _props$headerHeight === void 0 ? 48 : _props$headerHeight,
|
26
|
+
_props$contentStyle = props.contentStyle,
|
27
|
+
contentStyle = _props$contentStyle === void 0 ? {} : _props$contentStyle,
|
26
28
|
_props$waterMarkProps = props.waterMarkProps,
|
27
29
|
waterMarkProps = _props$waterMarkProps === void 0 ? {} : _props$waterMarkProps,
|
28
30
|
headerNotice = props.headerNotice,
|
@@ -30,9 +32,21 @@ var ProLayout = function ProLayout(props) {
|
|
30
32
|
dataSource = props.dataSource,
|
31
33
|
_props$pathPrefix = props.pathPrefix,
|
32
34
|
pathPrefix = _props$pathPrefix === void 0 ? '' : _props$pathPrefix,
|
33
|
-
theme = props.theme,
|
35
|
+
_props$theme = props.theme,
|
36
|
+
theme = _props$theme === void 0 ? 'dark' : _props$theme,
|
34
37
|
target = props.target,
|
35
|
-
onCollapsedChange = props.onCollapsedChange
|
38
|
+
onCollapsedChange = props.onCollapsedChange,
|
39
|
+
_props$collapsed = props.collapsed,
|
40
|
+
propsCollapsed = _props$collapsed === void 0 ? false : _props$collapsed,
|
41
|
+
onMenuClick = props.onMenuClick,
|
42
|
+
headerTitleRender = props.headerTitleRender,
|
43
|
+
headerContentRender = props.headerContentRender,
|
44
|
+
rightContentRender = props.rightContentRender,
|
45
|
+
title = props.title,
|
46
|
+
logo = props.logo,
|
47
|
+
iconfontUrl = props.iconfontUrl,
|
48
|
+
sideMenuFooterRender = props.sideMenuFooterRender,
|
49
|
+
sideMenuHeaderRender = props.sideMenuHeaderRender;
|
36
50
|
var _useSetState = useSetState({
|
37
51
|
notice: headerNotice || noticeIn,
|
38
52
|
menus: [],
|
@@ -51,8 +65,8 @@ var ProLayout = function ProLayout(props) {
|
|
51
65
|
toggle = _useToggle2$.toggle,
|
52
66
|
set = _useToggle2$.set;
|
53
67
|
useDeepCompareEffect(function () {
|
54
|
-
set(
|
55
|
-
}, [
|
68
|
+
set(propsCollapsed || false);
|
69
|
+
}, [propsCollapsed]);
|
56
70
|
useDeepCompareEffect(function () {
|
57
71
|
if (Array.isArray(dataSource) && !dataSource.length) {
|
58
72
|
return message.warning('Warning: Missing menu data source, or menu data source is not an array');
|
@@ -81,28 +95,53 @@ var ProLayout = function ProLayout(props) {
|
|
81
95
|
'pro-layout-row-left-pure': typeof pure !== 'boolean' && (pure === null || pure === void 0 ? void 0 : pure.leftMenu)
|
82
96
|
});
|
83
97
|
var noticeHeight = notice ? 32 : 0;
|
98
|
+
|
99
|
+
// 为Header组件创建专门的props对象
|
100
|
+
var headerProps = {
|
101
|
+
headerHeight: headerHeight,
|
102
|
+
pure: pure,
|
103
|
+
headerTitleRender: headerTitleRender,
|
104
|
+
headerContentRender: headerContentRender,
|
105
|
+
rightContentRender: rightContentRender,
|
106
|
+
title: title,
|
107
|
+
logo: logo
|
108
|
+
};
|
109
|
+
|
110
|
+
// 为Notice组件创建专门的props对象
|
111
|
+
var noticeProps = {
|
112
|
+
headerHeight: headerHeight,
|
113
|
+
notice: notice,
|
114
|
+
onCancel: onCancelNotice
|
115
|
+
};
|
116
|
+
|
117
|
+
// 为Menu组件创建专门的props对象
|
118
|
+
var menuProps = {
|
119
|
+
headerHeight: headerHeight,
|
120
|
+
dataSource: Array.isArray(menus) ? {
|
121
|
+
menus: menus
|
122
|
+
} : menus,
|
123
|
+
iconfontUrl: iconfontUrl,
|
124
|
+
collapsed: collapsed,
|
125
|
+
notice: notice,
|
126
|
+
onToggle: function onToggle() {
|
127
|
+
toggle();
|
128
|
+
onCollapsedChange && onCollapsedChange(!collapsed);
|
129
|
+
},
|
130
|
+
pure: pure,
|
131
|
+
theme: theme,
|
132
|
+
sideMenuFooterRender: sideMenuFooterRender,
|
133
|
+
sideMenuHeaderRender: sideMenuHeaderRender,
|
134
|
+
onMenuClick: onMenuClick
|
135
|
+
};
|
84
136
|
var layoutDom = /*#__PURE__*/_jsxs("div", {
|
85
137
|
className: classNames(_defineProperty({
|
86
138
|
'pro-layout': true,
|
87
139
|
'pro-layout-dark': theme === 'dark',
|
88
140
|
'pro-layout-light': theme === 'light'
|
89
141
|
}, "".concat(className), className)),
|
90
|
-
children: [/*#__PURE__*/_jsx(Header, _objectSpread({},
|
91
|
-
notice: notice,
|
92
|
-
onCancel: onCancelNotice
|
93
|
-
})), /*#__PURE__*/_jsxs("div", {
|
142
|
+
children: [/*#__PURE__*/_jsx(Header, _objectSpread({}, headerProps)), /*#__PURE__*/_jsx(Notice, _objectSpread({}, noticeProps)), /*#__PURE__*/_jsxs("div", {
|
94
143
|
className: contentCls,
|
95
|
-
children: [/*#__PURE__*/_jsx(Menu, _objectSpread(
|
96
|
-
dataSource: Array.isArray(menus) ? {
|
97
|
-
menus: menus
|
98
|
-
} : menus,
|
99
|
-
notice: notice,
|
100
|
-
collapsed: collapsed,
|
101
|
-
onToggle: function onToggle() {
|
102
|
-
toggle();
|
103
|
-
onCollapsedChange && onCollapsedChange(!collapsed);
|
104
|
-
}
|
105
|
-
})), /*#__PURE__*/_jsx("div", {
|
144
|
+
children: [/*#__PURE__*/_jsx(Menu, _objectSpread({}, menuProps)), /*#__PURE__*/_jsx("div", {
|
106
145
|
className: "pro-layout-content",
|
107
146
|
style: _objectSpread(_objectSpread({}, contentStyle), {}, {
|
108
147
|
marginTop: headerHeight + noticeHeight
|
@@ -124,17 +163,6 @@ var ProLayout = function ProLayout(props) {
|
|
124
163
|
}))
|
125
164
|
});
|
126
165
|
};
|
127
|
-
ProLayout.defaultProps = {
|
128
|
-
menus: [],
|
129
|
-
iconfontUrl: '',
|
130
|
-
title: '',
|
131
|
-
collapsed: false,
|
132
|
-
routerMatch: 'id',
|
133
|
-
pure: false,
|
134
|
-
theme: 'dark',
|
135
|
-
headerHeight: 48,
|
136
|
-
contentStyle: {}
|
137
|
-
};
|
138
166
|
|
139
167
|
// 下一版本会移除
|
140
168
|
ProLayout.ProCollapse = ProCollapse;
|
@@ -180,6 +180,15 @@ export interface ProLayoutType {
|
|
180
180
|
* @default -
|
181
181
|
*/
|
182
182
|
onCollapsedChange?: (collapsed: boolean) => void;
|
183
|
+
/**
|
184
|
+
* @description 菜单点击回调事件,返回命中的菜单项数据和完整路径
|
185
|
+
* @default -
|
186
|
+
*/
|
187
|
+
onMenuClick?: (params: {
|
188
|
+
item: MenusType | null;
|
189
|
+
key: string;
|
190
|
+
keyPath: string[];
|
191
|
+
}) => void;
|
183
192
|
/**
|
184
193
|
* @description 规定在何处打开被链接文档
|
185
194
|
* @default "_self"
|
@@ -34,3 +34,10 @@ export declare const getPathNameKey: ({ menus, pathName, }: {
|
|
34
34
|
menus: any[];
|
35
35
|
pathName: string;
|
36
36
|
}) => any;
|
37
|
+
/**
|
38
|
+
* 根据key查找完整的菜单项数据
|
39
|
+
* @param menus 菜单数据数组
|
40
|
+
* @param key 要查找的菜单项key
|
41
|
+
* @returns 找到的菜单项数据或null
|
42
|
+
*/
|
43
|
+
export declare const findMenuItemByKey: (menus: any[], key: string) => any;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
1
2
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
3
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
3
4
|
/* eslint-disable prefer-destructuring */
|
@@ -162,4 +163,33 @@ export var getPathNameKey = function getPathNameKey(_ref) {
|
|
162
163
|
};
|
163
164
|
menuDeep(menus);
|
164
165
|
return result;
|
166
|
+
};
|
167
|
+
|
168
|
+
/**
|
169
|
+
* 根据key查找完整的菜单项数据
|
170
|
+
* @param menus 菜单数据数组
|
171
|
+
* @param key 要查找的菜单项key
|
172
|
+
* @returns 找到的菜单项数据或null
|
173
|
+
*/
|
174
|
+
export var findMenuItemByKey = function findMenuItemByKey(menus, key) {
|
175
|
+
// eslint-disable-next-line no-restricted-syntax
|
176
|
+
var _iterator = _createForOfIteratorHelper(menus),
|
177
|
+
_step;
|
178
|
+
try {
|
179
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
180
|
+
var item = _step.value;
|
181
|
+
if (String(item.id) === key) {
|
182
|
+
return item;
|
183
|
+
}
|
184
|
+
if (Array.isArray(item.children) && item.children.length) {
|
185
|
+
var found = findMenuItemByKey(item.children, key);
|
186
|
+
if (found) return found;
|
187
|
+
}
|
188
|
+
}
|
189
|
+
} catch (err) {
|
190
|
+
_iterator.e(err);
|
191
|
+
} finally {
|
192
|
+
_iterator.f();
|
193
|
+
}
|
194
|
+
return null;
|
165
195
|
};
|
package/es/ProSelect/index.less
CHANGED
@@ -48,9 +48,70 @@ var findSelectNameValues = function findSelectNameValues(_ref) {
|
|
48
48
|
}
|
49
49
|
});
|
50
50
|
var diffList = _.difference(selectValues, mode === 'multiple' ? value : [value]);
|
51
|
-
|
51
|
+
var result = dataSource.filter(function (item) {
|
52
52
|
return !diffList.includes(labelInValue ? item : item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] || (item === null || item === void 0 ? void 0 : item.value));
|
53
53
|
});
|
54
|
+
var isSingle = list === null || list === void 0 ? void 0 : list.find(function (item) {
|
55
|
+
return item === null || item === void 0 ? void 0 : item._isEditing;
|
56
|
+
});
|
57
|
+
|
58
|
+
// 修复单行编辑模式下,选择器无法过滤的问题
|
59
|
+
if (mode === 'multiple' && isSingle) {
|
60
|
+
// 找到当前编辑行
|
61
|
+
var editingRow = list.find(function (item) {
|
62
|
+
return item === null || item === void 0 ? void 0 : item._isEditing;
|
63
|
+
});
|
64
|
+
|
65
|
+
// 收集其他行的已选择值
|
66
|
+
var otherRowsValues = [];
|
67
|
+
list.forEach(function (item) {
|
68
|
+
if (item !== editingRow) {
|
69
|
+
// 排除当前编辑行
|
70
|
+
var _result = item;
|
71
|
+
var _iterator2 = _createForOfIteratorHelper(selectName),
|
72
|
+
_step2;
|
73
|
+
try {
|
74
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
75
|
+
var key = _step2.value;
|
76
|
+
_result = _result[key];
|
77
|
+
}
|
78
|
+
} catch (err) {
|
79
|
+
_iterator2.e(err);
|
80
|
+
} finally {
|
81
|
+
_iterator2.f();
|
82
|
+
}
|
83
|
+
if (_result) {
|
84
|
+
otherRowsValues.push.apply(otherRowsValues, _toConsumableArray(Array.isArray(_result) ? _result : [_result]));
|
85
|
+
}
|
86
|
+
}
|
87
|
+
});
|
88
|
+
|
89
|
+
// 获取当前编辑行的已选择值
|
90
|
+
var currentRowValues = [];
|
91
|
+
if (editingRow) {
|
92
|
+
var _result2 = editingRow;
|
93
|
+
var _iterator3 = _createForOfIteratorHelper(selectName),
|
94
|
+
_step3;
|
95
|
+
try {
|
96
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
97
|
+
var key = _step3.value;
|
98
|
+
_result2 = _result2[key];
|
99
|
+
}
|
100
|
+
} catch (err) {
|
101
|
+
_iterator3.e(err);
|
102
|
+
} finally {
|
103
|
+
_iterator3.f();
|
104
|
+
}
|
105
|
+
currentRowValues = Array.isArray(_result2) ? _result2 : _result2 ? [_result2] : [];
|
106
|
+
}
|
107
|
+
|
108
|
+
// 从dataSource中过滤掉其他行的值,但保留当前行的值
|
109
|
+
var _diffList = _.difference(otherRowsValues, currentRowValues);
|
110
|
+
return dataSource.filter(function (item) {
|
111
|
+
return !_diffList.includes(labelInValue ? item : item[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value] || (item === null || item === void 0 ? void 0 : item.value));
|
112
|
+
});
|
113
|
+
}
|
114
|
+
return result;
|
54
115
|
};
|
55
116
|
|
56
117
|
/**
|
@@ -47,8 +47,7 @@ var ProStepItem = function ProStepItem(_ref) {
|
|
47
47
|
var renderChildren = function renderChildren() {
|
48
48
|
if (lazyLoad) {
|
49
49
|
var lazyLoadProps = isBoolean(lazyLoad) ? defaultLazyLoadConfig : lazyLoad;
|
50
|
-
|
51
|
-
return /*#__PURE__*/_jsx(LazyLoadComponent, _objectSpread(_objectSpread({}, lazyLoadProps), {}, {
|
50
|
+
return /*#__PURE__*/_jsx(LazyLoad, _objectSpread(_objectSpread({}, lazyLoadProps), {}, {
|
52
51
|
classNamePrefix: id,
|
53
52
|
children: children
|
54
53
|
}));
|
package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js
CHANGED
@@ -50,7 +50,7 @@ export var Row = function Row(props) {
|
|
50
50
|
return /*#__PURE__*/React.cloneElement(child, {
|
51
51
|
children: /*#__PURE__*/_jsxs(_Fragment, {
|
52
52
|
children: [/*#__PURE__*/_jsx("span", {
|
53
|
-
className: "drag-wrapper".concat(props['data-hide'] ? ' no-check' : ''),
|
53
|
+
className: "pro-table-drag-wrapper".concat(props['data-hide'] ? ' no-check' : ''),
|
54
54
|
children: /*#__PURE__*/_jsx(ProIcon, _objectSpread({
|
55
55
|
className: "drag-icon",
|
56
56
|
style: {
|
@@ -1,4 +1,7 @@
|
|
1
1
|
import { useRequest } from 'ahooks';
|
2
2
|
import type { ProTableRequestOptionsType, ProTableServiceType } from '../propsType';
|
3
|
+
export declare const SELECTION_ALL = "SELECTION_ALL";
|
4
|
+
export declare const CURRENT_PAGE = "CURRENT_PAGE";
|
5
|
+
export declare const UNCHECK_ALL = "UNCHECK_ALL";
|
3
6
|
declare function useAntdTable<I, R extends Record<string, any>, S extends ProTableServiceType<I, R>>(service: S, options?: ProTableRequestOptionsType<I, R>, useRequestOptions?: Parameters<typeof useRequest>[1]): any;
|
4
7
|
export default useAntdTable;
|