@ant-design/pro-components 3.1.3-1 → 3.1.4-0
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/pro-components.min.js +1 -1
- package/es/card/components/Actions/index.js +1 -4
- package/es/card/components/Card/index.js +23 -15
- package/es/card/components/Card/style.js +34 -8
- package/es/card/components/CheckCard/Group.js +1 -3
- package/es/card/components/CheckCard/index.js +0 -1
- package/es/card/components/Divider/index.d.ts +1 -1
- package/es/card/components/Divider/index.js +2 -2
- package/es/card/components/Divider/style.d.ts +4 -1
- package/es/card/components/Divider/style.js +6 -39
- package/es/card/components/Statistic/index.js +1 -1
- package/es/card/typing.d.ts +2 -6
- package/es/descriptions/index.d.ts +3 -5
- package/es/descriptions/index.js +6 -6
- package/es/descriptions/useFetchData.js +0 -1
- package/es/field/AllProField.js +0 -4
- package/es/field/PureProField.js +0 -5
- package/es/field/components/Checkbox/index.js +2 -5
- package/es/field/components/DatePicker/index.d.ts +1 -1
- package/es/field/components/DigitRange/index.js +1 -0
- package/es/field/components/Options/index.js +0 -3
- package/es/field/components/Percent/util.d.ts +1 -1
- package/es/field/components/RangePicker/index.d.ts +1 -1
- package/es/field/components/Select/SearchSelect/index.js +0 -1
- package/es/field/components/Switch/index.js +0 -1
- package/es/field/components/Text/index.js +4 -1
- package/es/form/BaseForm/BaseForm.js +0 -3
- package/es/form/BaseForm/LightWrapper/index.d.ts +2 -1
- package/es/form/components/Captcha/index.js +0 -3
- package/es/form/components/Checkbox/index.js +5 -1
- package/es/form/components/DatePicker/index.js +0 -2
- package/es/form/components/FieldSet/index.js +16 -6
- package/es/form/components/FormItem/index.js +9 -7
- package/es/form/components/FormItem/warpField.js +3 -15
- package/es/form/components/List/index.d.ts +1 -1
- package/es/form/components/List/index.js +0 -2
- package/es/form/components/Radio/index.js +5 -4
- package/es/form/components/SchemaForm/index.js +0 -1
- package/es/form/components/SchemaForm/layoutType/StepsForm.js +0 -1
- package/es/form/components/Select/index.js +0 -1
- package/es/form/components/Text/index.js +0 -3
- package/es/form/components/UploadButton/index.js +4 -2
- package/es/form/components/UploadDragger/index.js +0 -1
- package/es/form/helpers/grid.js +1 -5
- package/es/form/layouts/DrawerForm/index.js +1 -5
- package/es/form/layouts/LightFilter/index.js +0 -1
- package/es/form/layouts/ModalForm/index.js +1 -4
- package/es/form/layouts/ProForm/index.d.ts +1 -1
- package/es/form/layouts/QueryFilter/index.js +0 -1
- package/es/form/layouts/StepsForm/StepForm.js +0 -1
- package/es/form/layouts/StepsForm/index.js +3 -12
- package/es/layout/ProLayout.js +1 -6
- package/es/layout/components/AppsLogoComponents/style/index.js +4 -0
- package/es/layout/components/FooterToolbar/index.js +0 -3
- package/es/layout/components/GlobalHeader/ActionsContent.js +0 -1
- package/es/layout/components/Header/index.js +1 -3
- package/es/layout/components/PageContainer/index.js +0 -1
- package/es/layout/components/PageContainer/style/index.js +4 -0
- package/es/layout/components/SettingDrawer/BlockCheckbox.js +0 -1
- package/es/layout/components/SettingDrawer/index.js +0 -1
- package/es/layout/components/SettingDrawer/style/index.js +4 -0
- package/es/layout/components/SiderMenu/BaseMenu.js +2 -6
- package/es/layout/components/SiderMenu/SiderMenu.js +1 -3
- package/es/layout/components/SiderMenu/index.js +0 -1
- package/es/layout/components/TopNavHeader/index.js +1 -2
- package/es/layout/style/index.js +4 -0
- package/es/layout/utils/getMenuData.js +0 -1
- package/es/list/Item.d.ts +1 -4
- package/es/list/Item.js +75 -104
- package/es/list/ListView.d.ts +6 -4
- package/es/list/ListView.js +41 -53
- package/es/list/ProListBase.d.ts +74 -0
- package/es/list/ProListBase.js +350 -0
- package/es/list/constants.d.ts +2 -2
- package/es/list/constants.js +2 -5
- package/es/list/index.d.ts +23 -13
- package/es/list/index.js +78 -41
- package/es/list/style/index.d.ts +0 -1
- package/es/list/style/index.js +215 -86
- package/es/provider/index.js +0 -3
- package/es/provider/useStyle/index.d.ts +1 -21
- package/es/provider/useStyle/index.js +6 -3
- package/es/skeleton/components/Descriptions/index.js +1 -4
- package/es/skeleton/components/List/index.js +1 -4
- package/es/table/Store/Provide.js +0 -2
- package/es/table/Table.js +5 -14
- package/es/table/components/ColumnSetting/index.js +0 -1
- package/es/table/components/EditableTable/index.js +0 -1
- package/es/table/components/ListToolBar/index.d.ts +1 -1
- package/es/table/components/ListToolBar/index.js +4 -10
- package/es/table/components/ListToolBar/style.js +1 -1
- package/es/table/components/ToolBar/index.d.ts +1 -1
- package/es/table/style/index.js +4 -0
- package/es/table/typing.d.ts +10 -5
- package/es/table/useFetchData.js +0 -3
- package/es/table/utils/cellRenderToFromItem.js +1 -3
- package/es/table/utils/index.js +0 -1
- package/es/utils/components/LabelIconTip/index.d.ts +3 -4
- package/es/utils/genCopyable/index.d.ts +6 -0
- package/es/utils/genCopyable/index.js +28 -8
- package/es/utils/hooks/useDebounceValue/index.js +1 -3
- package/es/utils/hooks/useDeepCompareEffect/index.js +0 -2
- package/es/utils/index.d.ts +2 -1
- package/es/utils/isDeepEqualReact/index.js +0 -8
- package/es/utils/merge/index.js +0 -3
- package/es/utils/nanoid/index.d.ts +1 -3
- package/es/utils/nanoid/index.js +2 -10
- package/es/utils/proFieldParsingText/index.js +1 -3
- package/es/utils/typing.d.ts +2 -1
- package/es/utils/useEditableArray/index.js +1 -1
- package/es/utils/useEditableMap/index.js +1 -1
- package/guidelines/overview-components.md +1 -1
- package/lib/card/components/Actions/index.js +1 -4
- package/lib/card/components/Card/index.js +23 -15
- package/lib/card/components/Card/style.js +34 -8
- package/lib/card/components/CheckCard/Group.js +1 -3
- package/lib/card/components/CheckCard/index.js +0 -1
- package/lib/card/components/Divider/index.d.ts +1 -1
- package/lib/card/components/Divider/index.js +2 -2
- package/lib/card/components/Divider/style.d.ts +4 -1
- package/lib/card/components/Divider/style.js +5 -39
- package/lib/card/components/Statistic/index.js +1 -1
- package/lib/card/typing.d.ts +2 -6
- package/lib/descriptions/index.d.ts +3 -5
- package/lib/descriptions/index.js +6 -6
- package/lib/descriptions/useFetchData.js +0 -1
- package/lib/field/AllProField.js +0 -4
- package/lib/field/PureProField.js +0 -5
- package/lib/field/components/Checkbox/index.js +2 -5
- package/lib/field/components/DatePicker/index.d.ts +1 -1
- package/lib/field/components/DigitRange/index.js +1 -0
- package/lib/field/components/Options/index.js +0 -3
- package/lib/field/components/Percent/util.d.ts +1 -1
- package/lib/field/components/RangePicker/index.d.ts +1 -1
- package/lib/field/components/Select/SearchSelect/index.js +0 -1
- package/lib/field/components/Switch/index.js +0 -1
- package/lib/field/components/Text/index.js +4 -1
- package/lib/form/BaseForm/BaseForm.js +0 -4
- package/lib/form/BaseForm/LightWrapper/index.d.ts +2 -1
- package/lib/form/components/Captcha/index.js +0 -3
- package/lib/form/components/Checkbox/index.js +5 -1
- package/lib/form/components/DatePicker/index.js +0 -2
- package/lib/form/components/FieldSet/index.js +16 -6
- package/lib/form/components/FormItem/index.js +9 -7
- package/lib/form/components/FormItem/warpField.js +3 -15
- package/lib/form/components/List/index.d.ts +1 -1
- package/lib/form/components/List/index.js +0 -2
- package/lib/form/components/Radio/index.js +5 -4
- package/lib/form/components/SchemaForm/index.js +0 -1
- package/lib/form/components/SchemaForm/layoutType/StepsForm.js +0 -1
- package/lib/form/components/Select/index.js +0 -1
- package/lib/form/components/Text/index.js +0 -3
- package/lib/form/components/UploadButton/index.js +4 -2
- package/lib/form/components/UploadDragger/index.js +0 -1
- package/lib/form/helpers/grid.js +1 -5
- package/lib/form/layouts/DrawerForm/index.js +1 -5
- package/lib/form/layouts/LightFilter/index.js +0 -1
- package/lib/form/layouts/ModalForm/index.js +1 -4
- package/lib/form/layouts/ProForm/index.d.ts +1 -1
- package/lib/form/layouts/QueryFilter/index.js +0 -2
- package/lib/form/layouts/StepsForm/StepForm.js +0 -1
- package/lib/form/layouts/StepsForm/index.js +3 -12
- package/lib/layout/ProLayout.js +1 -6
- package/lib/layout/components/AppsLogoComponents/style/index.js +4 -0
- package/lib/layout/components/FooterToolbar/index.js +0 -4
- package/lib/layout/components/GlobalHeader/ActionsContent.js +0 -1
- package/lib/layout/components/Header/index.js +1 -3
- package/lib/layout/components/PageContainer/index.js +0 -1
- package/lib/layout/components/PageContainer/style/index.js +4 -0
- package/lib/layout/components/SettingDrawer/BlockCheckbox.js +0 -1
- package/lib/layout/components/SettingDrawer/index.js +0 -1
- package/lib/layout/components/SettingDrawer/style/index.js +4 -0
- package/lib/layout/components/SiderMenu/BaseMenu.js +2 -6
- package/lib/layout/components/SiderMenu/SiderMenu.js +1 -3
- package/lib/layout/components/SiderMenu/index.js +0 -1
- package/lib/layout/components/TopNavHeader/index.js +1 -2
- package/lib/layout/style/index.js +4 -0
- package/lib/layout/utils/getMenuData.js +0 -1
- package/lib/list/Item.d.ts +1 -4
- package/lib/list/Item.js +74 -103
- package/lib/list/ListView.d.ts +6 -4
- package/lib/list/ListView.js +40 -52
- package/lib/list/ProListBase.d.ts +74 -0
- package/lib/list/ProListBase.js +357 -0
- package/lib/list/constants.d.ts +2 -2
- package/lib/list/constants.js +2 -5
- package/lib/list/index.d.ts +23 -13
- package/lib/list/index.js +77 -40
- package/lib/list/style/index.d.ts +0 -1
- package/lib/list/style/index.js +214 -86
- package/lib/provider/index.js +0 -3
- package/lib/provider/useStyle/index.d.ts +1 -21
- package/lib/provider/useStyle/index.js +6 -3
- package/lib/skeleton/components/Descriptions/index.js +1 -4
- package/lib/skeleton/components/List/index.js +1 -4
- package/lib/table/Store/Provide.js +0 -2
- package/lib/table/Table.js +5 -14
- package/lib/table/components/ColumnSetting/index.js +0 -1
- package/lib/table/components/EditableTable/index.js +0 -1
- package/lib/table/components/ListToolBar/index.d.ts +1 -1
- package/lib/table/components/ListToolBar/index.js +4 -10
- package/lib/table/components/ListToolBar/style.js +1 -1
- package/lib/table/components/ToolBar/index.d.ts +1 -1
- package/lib/table/style/index.js +4 -0
- package/lib/table/typing.d.ts +10 -5
- package/lib/table/useFetchData.js +0 -3
- package/lib/table/utils/cellRenderToFromItem.js +1 -3
- package/lib/table/utils/index.js +0 -1
- package/lib/utils/components/LabelIconTip/index.d.ts +3 -4
- package/lib/utils/genCopyable/index.d.ts +6 -0
- package/lib/utils/genCopyable/index.js +28 -8
- package/lib/utils/hooks/useDebounceValue/index.js +1 -3
- package/lib/utils/hooks/useDeepCompareEffect/index.js +0 -2
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/isDeepEqualReact/index.js +0 -8
- package/lib/utils/merge/index.js +0 -3
- package/lib/utils/nanoid/index.d.ts +1 -3
- package/lib/utils/nanoid/index.js +2 -10
- package/lib/utils/proFieldParsingText/index.js +1 -3
- package/lib/utils/typing.d.ts +2 -1
- package/lib/utils/useEditableArray/index.js +0 -2
- package/lib/utils/useEditableMap/index.js +0 -2
- package/package.json +4 -5
package/es/list/style/index.js
CHANGED
|
@@ -1,71 +1,185 @@
|
|
|
1
1
|
import { Keyframes } from '@ant-design/cssinjs';
|
|
2
|
-
import { useStyle as useAntdStyle } from "../../provider";
|
|
3
|
-
|
|
2
|
+
import { setAlpha, useStyle as useAntdStyle } from "../../provider";
|
|
3
|
+
const genTechUiListActiveKeyframes = token => new Keyframes('techUiListActive', {
|
|
4
4
|
'0%': {
|
|
5
5
|
backgroundColor: 'unset'
|
|
6
6
|
},
|
|
7
7
|
'30%': {
|
|
8
|
-
background:
|
|
8
|
+
background: token.colorWarningBg ?? setAlpha(token.colorWarning, 0.15)
|
|
9
9
|
},
|
|
10
10
|
'100%': {
|
|
11
11
|
backgroundColor: 'unset'
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
const genProListStyle = token => {
|
|
15
|
+
const techUiListActive = genTechUiListActiveKeyframes(token);
|
|
15
16
|
return {
|
|
16
17
|
[token.componentCls]: {
|
|
18
|
+
boxSizing: 'border-box',
|
|
19
|
+
'*, *::before, *::after': {
|
|
20
|
+
boxSizing: 'border-box'
|
|
21
|
+
},
|
|
17
22
|
backgroundColor: 'transparent',
|
|
18
23
|
[`${token.proComponentsCls}-table-alert`]: {
|
|
19
|
-
marginBlockEnd:
|
|
24
|
+
marginBlockEnd: token.margin
|
|
25
|
+
},
|
|
26
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
flex: 1,
|
|
31
|
+
minWidth: 0,
|
|
32
|
+
padding: token.paddingXS,
|
|
33
|
+
alignItems: 'flex-start',
|
|
34
|
+
borderRadius: token.borderRadius,
|
|
35
|
+
listStyle: 'none',
|
|
36
|
+
'& > *:first-child': {
|
|
37
|
+
flex: 1,
|
|
38
|
+
minWidth: 0
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
'&-filled': {
|
|
42
|
+
backgroundColor: token.colorFillQuaternary,
|
|
43
|
+
borderRadius: token.borderRadius,
|
|
44
|
+
[`${token.componentCls}-toolbar`]: {
|
|
45
|
+
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
'&-outlined': {
|
|
49
|
+
border: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
|
|
50
|
+
borderRadius: token.borderRadius
|
|
51
|
+
},
|
|
52
|
+
'&-borderless': {
|
|
53
|
+
[`${token.componentCls}-toolbar`]: {
|
|
54
|
+
borderBlockEnd: 'none'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
[`${token.proComponentsCls}-list-item-meta`]: {
|
|
58
|
+
display: 'flex',
|
|
59
|
+
flex: 1,
|
|
60
|
+
flexDirection: 'row',
|
|
61
|
+
alignItems: 'flex-start',
|
|
62
|
+
minWidth: 0,
|
|
63
|
+
gap: token.marginXS
|
|
64
|
+
},
|
|
65
|
+
[`${token.proComponentsCls}-list-item-meta-title`]: {
|
|
66
|
+
display: 'flex',
|
|
67
|
+
flexWrap: 'wrap',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
gap: token.marginXS,
|
|
70
|
+
borderBlockEnd: 'none',
|
|
71
|
+
margin: 0,
|
|
72
|
+
minWidth: 0
|
|
73
|
+
},
|
|
74
|
+
'&-split': {
|
|
75
|
+
[`${token.componentCls}-row`]: {
|
|
76
|
+
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
|
|
77
|
+
'&:last-child': {
|
|
78
|
+
borderBlockEnd: 'none'
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
82
|
+
borderRadius: 0,
|
|
83
|
+
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
|
|
84
|
+
'&:last-child': {
|
|
85
|
+
borderBlockEnd: 'none'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
'&-no-split': {
|
|
90
|
+
[`${token.componentCls}-row`]: {
|
|
91
|
+
borderBlockEnd: 'none'
|
|
92
|
+
},
|
|
93
|
+
[`${token.proComponentsCls}-list ${token.proComponentsCls}-list-item`]: {
|
|
94
|
+
borderBlockEnd: 'none'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
[`${token.proComponentsCls}-list-item-action,
|
|
98
|
+
${token.proComponentsCls}-card-extra,
|
|
99
|
+
${token.proComponentsCls}-card-actions`]: {
|
|
100
|
+
display: 'flex',
|
|
101
|
+
alignItems: 'center',
|
|
102
|
+
gap: token.marginSM,
|
|
103
|
+
flexShrink: 0
|
|
20
104
|
},
|
|
21
105
|
'&-row': {
|
|
22
|
-
|
|
23
|
-
|
|
106
|
+
[`${token.proComponentsCls}-list-item-meta`]: {
|
|
107
|
+
display: 'flex',
|
|
108
|
+
flex: '1',
|
|
109
|
+
flexDirection: 'row',
|
|
110
|
+
alignItems: 'flex-start',
|
|
111
|
+
minWidth: 0
|
|
112
|
+
},
|
|
113
|
+
[`${token.proComponentsCls}-list-item-meta-content`]: {
|
|
114
|
+
flex: '1',
|
|
115
|
+
minWidth: 0,
|
|
116
|
+
display: 'flex',
|
|
117
|
+
flexDirection: 'column',
|
|
118
|
+
gap: token.marginXXS
|
|
119
|
+
},
|
|
120
|
+
[`${token.proComponentsCls}-list-item-meta-title`]: {
|
|
121
|
+
display: 'flex',
|
|
122
|
+
flexWrap: 'wrap',
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
gap: token.marginXS,
|
|
24
125
|
borderBlockEnd: 'none',
|
|
25
126
|
margin: 0
|
|
26
127
|
},
|
|
27
128
|
'&:last-child': {
|
|
28
129
|
borderBlockEnd: 'none',
|
|
29
|
-
[`${token.
|
|
130
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
30
131
|
borderBlockEnd: 'none'
|
|
31
132
|
}
|
|
32
133
|
},
|
|
33
134
|
'&:hover': {
|
|
34
|
-
backgroundColor:
|
|
135
|
+
backgroundColor: setAlpha(token.colorTextBase, 0.02),
|
|
35
136
|
transition: 'background-color 0.3s',
|
|
36
|
-
[`${token.
|
|
37
|
-
display: '
|
|
137
|
+
[`${token.proComponentsCls}-list-item-action`]: {
|
|
138
|
+
display: 'flex',
|
|
139
|
+
alignItems: 'center',
|
|
140
|
+
gap: token.marginSM,
|
|
141
|
+
flexShrink: 0
|
|
38
142
|
},
|
|
39
|
-
[`${token.
|
|
143
|
+
[`${token.proComponentsCls}-list-item-action-item`]: {
|
|
144
|
+
display: 'inline-flex',
|
|
145
|
+
alignItems: 'center'
|
|
146
|
+
},
|
|
147
|
+
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
40
148
|
display: 'flex'
|
|
41
149
|
},
|
|
42
150
|
[`${token.componentCls}-row-extra`]: {
|
|
43
|
-
display: '
|
|
151
|
+
display: 'flex'
|
|
44
152
|
},
|
|
45
153
|
[`${token.componentCls}-row-subheader-actions`]: {
|
|
46
|
-
display: '
|
|
154
|
+
display: 'flex'
|
|
47
155
|
}
|
|
48
156
|
},
|
|
49
|
-
|
|
50
|
-
marginBlock:
|
|
157
|
+
[`&-card`]: {
|
|
158
|
+
marginBlock: 0,
|
|
51
159
|
marginInline: 0,
|
|
52
160
|
paddingBlock: 0,
|
|
53
|
-
paddingInline:
|
|
161
|
+
paddingInline: 0
|
|
162
|
+
},
|
|
163
|
+
'&-card-container': {
|
|
164
|
+
marginBlock: 0,
|
|
165
|
+
marginInline: 0,
|
|
166
|
+
paddingBlock: 0,
|
|
167
|
+
paddingInline: 0,
|
|
54
168
|
'&:hover': {
|
|
55
169
|
backgroundColor: 'transparent'
|
|
56
170
|
},
|
|
57
|
-
[`${token.
|
|
171
|
+
[`${token.proComponentsCls}-list-item-meta-title`]: {
|
|
58
172
|
flexShrink: 9,
|
|
59
173
|
marginBlock: 0,
|
|
60
174
|
marginInline: 0,
|
|
61
|
-
lineHeight:
|
|
175
|
+
lineHeight: 22
|
|
62
176
|
}
|
|
63
177
|
},
|
|
64
178
|
[`&${token.componentCls}-row-editable`]: {
|
|
65
|
-
[`${token.
|
|
179
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
66
180
|
'&-meta': {
|
|
67
181
|
'&-avatar,&-description,&-title': {
|
|
68
|
-
paddingBlock:
|
|
182
|
+
paddingBlock: token.paddingSM,
|
|
69
183
|
paddingInline: 0,
|
|
70
184
|
'&-editable': {
|
|
71
185
|
paddingBlock: 0
|
|
@@ -73,7 +187,12 @@ const genProListStyle = token => {
|
|
|
73
187
|
}
|
|
74
188
|
},
|
|
75
189
|
'&-action': {
|
|
76
|
-
display: '
|
|
190
|
+
display: 'flex',
|
|
191
|
+
alignItems: 'center',
|
|
192
|
+
gap: token.marginSM,
|
|
193
|
+
listStyle: 'none',
|
|
194
|
+
padding: 0,
|
|
195
|
+
margin: 0
|
|
77
196
|
}
|
|
78
197
|
}
|
|
79
198
|
},
|
|
@@ -95,18 +214,27 @@ const genProListStyle = token => {
|
|
|
95
214
|
[`&${token.componentCls}-row-type-top`]: {
|
|
96
215
|
backgroundImage: "url('https://gw.alipayobjects.com/zos/antfincdn/DehQfMbOJb/icon.svg')",
|
|
97
216
|
backgroundRepeat: 'no-repeat',
|
|
98
|
-
backgroundPosition: '
|
|
99
|
-
backgroundSize:
|
|
217
|
+
backgroundPosition: '0 0',
|
|
218
|
+
backgroundSize: `${token.fontSizeSM}px ${token.fontSizeSM}px`
|
|
100
219
|
},
|
|
101
220
|
'&-show-action-hover': {
|
|
102
|
-
[`${token.
|
|
221
|
+
[`${token.proComponentsCls}-list-item-action,
|
|
103
222
|
${token.proComponentsCls}-card-extra,
|
|
104
223
|
${token.proComponentsCls}-card-actions`]: {
|
|
105
|
-
display: '
|
|
224
|
+
display: 'none'
|
|
225
|
+
},
|
|
226
|
+
'&:hover': {
|
|
227
|
+
[`${token.proComponentsCls}-list-item-action,
|
|
228
|
+
${token.proComponentsCls}-card-extra,
|
|
229
|
+
${token.proComponentsCls}-card-actions`]: {
|
|
230
|
+
display: 'flex',
|
|
231
|
+
alignItems: 'center',
|
|
232
|
+
gap: token.marginSM
|
|
233
|
+
}
|
|
106
234
|
}
|
|
107
235
|
},
|
|
108
236
|
'&-show-extra-hover': {
|
|
109
|
-
[`${token.
|
|
237
|
+
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
110
238
|
display: 'none'
|
|
111
239
|
}
|
|
112
240
|
},
|
|
@@ -117,29 +245,28 @@ const genProListStyle = token => {
|
|
|
117
245
|
display: 'flex',
|
|
118
246
|
alignItems: 'center',
|
|
119
247
|
justifyContent: 'space-between',
|
|
120
|
-
height:
|
|
121
|
-
paddingInline:
|
|
248
|
+
height: 44,
|
|
249
|
+
paddingInline: token.paddingLG,
|
|
122
250
|
paddingBlock: 0,
|
|
123
251
|
color: token.colorTextSecondary,
|
|
124
|
-
lineHeight:
|
|
125
|
-
background:
|
|
252
|
+
lineHeight: 44,
|
|
253
|
+
background: setAlpha(token.colorTextBase, 0.02),
|
|
126
254
|
'&-actions': {
|
|
127
255
|
display: 'none'
|
|
128
256
|
},
|
|
129
257
|
'&-actions *': {
|
|
130
|
-
marginInlineEnd:
|
|
258
|
+
marginInlineEnd: token.marginXS,
|
|
131
259
|
'&:last-child': {
|
|
132
260
|
marginInlineEnd: 0
|
|
133
261
|
}
|
|
134
262
|
}
|
|
135
263
|
},
|
|
136
264
|
'&-expand-icon': {
|
|
137
|
-
marginInlineEnd:
|
|
265
|
+
marginInlineEnd: token.marginXS,
|
|
138
266
|
display: 'flex',
|
|
139
|
-
fontSize:
|
|
267
|
+
fontSize: token.fontSizeSM,
|
|
140
268
|
cursor: 'pointer',
|
|
141
|
-
height:
|
|
142
|
-
marginRight: 4,
|
|
269
|
+
height: 24,
|
|
143
270
|
color: token.colorTextSecondary,
|
|
144
271
|
'> .anticon > svg': {
|
|
145
272
|
transition: '0.3s'
|
|
@@ -151,11 +278,12 @@ const genProListStyle = token => {
|
|
|
151
278
|
}
|
|
152
279
|
},
|
|
153
280
|
'&-title': {
|
|
154
|
-
|
|
155
|
-
|
|
281
|
+
flexShrink: 0,
|
|
282
|
+
marginInlineEnd: 0,
|
|
283
|
+
wordBreak: 'break-word',
|
|
156
284
|
cursor: 'pointer',
|
|
157
285
|
'&-editable': {
|
|
158
|
-
paddingBlock:
|
|
286
|
+
paddingBlock: token.paddingSM
|
|
159
287
|
},
|
|
160
288
|
'&:hover': {
|
|
161
289
|
color: token.colorPrimary
|
|
@@ -166,59 +294,64 @@ const genProListStyle = token => {
|
|
|
166
294
|
display: 'flex',
|
|
167
295
|
flex: '1',
|
|
168
296
|
flexDirection: 'column',
|
|
169
|
-
marginBlock: 0
|
|
170
|
-
marginInline: 32
|
|
297
|
+
marginBlock: 0
|
|
171
298
|
},
|
|
172
299
|
'&-subTitle': {
|
|
173
|
-
|
|
300
|
+
display: 'inline-flex',
|
|
301
|
+
flexWrap: 'wrap',
|
|
302
|
+
alignItems: 'center',
|
|
303
|
+
gap: token.marginXXS,
|
|
304
|
+
color: token.colorTextSecondary,
|
|
174
305
|
'&-editable': {
|
|
175
|
-
paddingBlock:
|
|
306
|
+
paddingBlock: token.paddingSM
|
|
176
307
|
}
|
|
177
308
|
},
|
|
178
309
|
'&-description': {
|
|
179
|
-
marginBlockStart:
|
|
180
|
-
wordBreak: 'break-all'
|
|
310
|
+
marginBlockStart: token.marginXXS,
|
|
311
|
+
wordBreak: 'break-all',
|
|
312
|
+
flexShrink: 0
|
|
181
313
|
},
|
|
182
314
|
'&-avatar': {
|
|
183
|
-
display: 'flex'
|
|
315
|
+
display: 'flex',
|
|
316
|
+
flexShrink: 0,
|
|
317
|
+
alignItems: 'flex-start'
|
|
184
318
|
},
|
|
185
319
|
'&-header': {
|
|
186
320
|
display: 'flex',
|
|
187
321
|
flex: '1',
|
|
322
|
+
alignItems: 'flex-start',
|
|
188
323
|
justifyContent: 'flex-start',
|
|
324
|
+
width: '100%',
|
|
325
|
+
minWidth: 0,
|
|
189
326
|
h4: {
|
|
190
327
|
margin: 0,
|
|
191
|
-
padding: 0
|
|
328
|
+
padding: 0,
|
|
329
|
+
display: 'flex',
|
|
330
|
+
flex: '1',
|
|
331
|
+
minWidth: 0
|
|
192
332
|
}
|
|
193
333
|
},
|
|
194
334
|
'&-header-container': {
|
|
195
335
|
display: 'flex',
|
|
336
|
+
flexDirection: 'row',
|
|
337
|
+
flexWrap: 'wrap',
|
|
196
338
|
alignItems: 'center',
|
|
197
|
-
|
|
339
|
+
gap: token.marginXS,
|
|
340
|
+
flex: '1',
|
|
341
|
+
minWidth: 0
|
|
198
342
|
},
|
|
199
343
|
'&-header-option': {
|
|
200
|
-
display: 'flex'
|
|
344
|
+
display: 'flex',
|
|
345
|
+
flexShrink: 0,
|
|
346
|
+
alignItems: 'center'
|
|
201
347
|
},
|
|
202
348
|
'&-checkbox': {
|
|
203
|
-
width:
|
|
204
|
-
marginInlineEnd:
|
|
349
|
+
width: 16,
|
|
350
|
+
marginInlineEnd: token.marginSM
|
|
205
351
|
},
|
|
206
|
-
|
|
352
|
+
[`${token.proComponentsCls}-list-vertical`]: {
|
|
207
353
|
[`${token.componentCls}-row`]: {
|
|
208
|
-
|
|
209
|
-
},
|
|
210
|
-
[`${token.antCls}-list ${token.antCls}-list-item`]: {
|
|
211
|
-
borderBlockEnd: 'none'
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
'&-bordered': {
|
|
215
|
-
[`${token.componentCls}-toolbar`]: {
|
|
216
|
-
borderBlockEnd: `1px solid ${token.colorSplit}`
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
[`${token.antCls}-list-vertical`]: {
|
|
220
|
-
[`${token.componentCls}-row`]: {
|
|
221
|
-
borderBlockEnd: '12px 18px 12px 24px'
|
|
354
|
+
marginBlockEnd: token.marginSM
|
|
222
355
|
},
|
|
223
356
|
'&-header-title': {
|
|
224
357
|
display: 'flex',
|
|
@@ -231,56 +364,52 @@ const genProListStyle = token => {
|
|
|
231
364
|
marginInline: 0
|
|
232
365
|
},
|
|
233
366
|
'&-subTitle': {
|
|
234
|
-
marginBlockStart:
|
|
367
|
+
marginBlockStart: token.marginXS
|
|
235
368
|
},
|
|
236
|
-
[`${token.
|
|
369
|
+
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
237
370
|
display: 'flex',
|
|
238
371
|
alignItems: 'center',
|
|
239
|
-
marginInlineStart: '32px',
|
|
240
372
|
[`${token.componentCls}-row-description`]: {
|
|
241
|
-
marginBlockStart:
|
|
373
|
+
marginBlockStart: token.margin
|
|
242
374
|
}
|
|
243
375
|
},
|
|
244
|
-
[`${token.
|
|
376
|
+
[`${token.proComponentsCls}-list-bordered ${token.proComponentsCls}-list-item`]: {
|
|
245
377
|
paddingInline: 0
|
|
246
378
|
},
|
|
247
379
|
[`${token.componentCls}-row-show-extra-hover`]: {
|
|
248
|
-
[`${token.
|
|
380
|
+
[`${token.proComponentsCls}-list-item-extra `]: {
|
|
249
381
|
display: 'none'
|
|
250
382
|
}
|
|
251
383
|
}
|
|
252
384
|
},
|
|
253
|
-
[`${token.
|
|
385
|
+
[`${token.proComponentsCls}-list-pagination`]: {
|
|
254
386
|
marginBlockStart: token.margin,
|
|
255
387
|
marginBlockEnd: token.margin
|
|
256
388
|
},
|
|
257
|
-
[`${token.
|
|
389
|
+
[`${token.proComponentsCls}-list-list`]: {
|
|
258
390
|
'&-item': {
|
|
259
391
|
cursor: 'pointer',
|
|
260
|
-
paddingBlock:
|
|
261
|
-
paddingInline:
|
|
392
|
+
paddingBlock: token.paddingSM,
|
|
393
|
+
paddingInline: token.paddingSM
|
|
262
394
|
}
|
|
263
395
|
},
|
|
264
|
-
[`${token.
|
|
396
|
+
[`${token.proComponentsCls}-list-vertical ${token.proComponentsCls}-list-row`]: {
|
|
265
397
|
'&-header': {
|
|
266
398
|
paddingBlock: 0,
|
|
267
399
|
paddingInline: 0,
|
|
268
400
|
borderBlockEnd: 'none'
|
|
269
401
|
},
|
|
270
|
-
[`${token.
|
|
402
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
271
403
|
width: '100%',
|
|
272
|
-
paddingBlock:
|
|
273
|
-
paddingInlineStart:
|
|
274
|
-
paddingInlineEnd:
|
|
275
|
-
[`${token.
|
|
404
|
+
paddingBlock: token.paddingSM,
|
|
405
|
+
paddingInlineStart: token.paddingLG,
|
|
406
|
+
paddingInlineEnd: token.paddingMD,
|
|
407
|
+
[`${token.proComponentsCls}-list-item-meta-avatar`]: {
|
|
276
408
|
display: 'flex',
|
|
277
409
|
alignItems: 'center',
|
|
278
|
-
marginInlineEnd:
|
|
279
|
-
},
|
|
280
|
-
[`${token.antCls}-list-item-action-split`]: {
|
|
281
|
-
display: 'none'
|
|
410
|
+
marginInlineEnd: token.marginXS
|
|
282
411
|
},
|
|
283
|
-
[`${token.
|
|
412
|
+
[`${token.proComponentsCls}-list-item-meta-title`]: {
|
|
284
413
|
marginBlock: 0,
|
|
285
414
|
marginInline: 0
|
|
286
415
|
}
|
package/es/provider/index.js
CHANGED
|
@@ -99,7 +99,6 @@ const CacheClean = () => {
|
|
|
99
99
|
// @ts-ignore
|
|
100
100
|
cache.clear();
|
|
101
101
|
};
|
|
102
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
102
|
}, []);
|
|
104
103
|
return null;
|
|
105
104
|
};
|
|
@@ -224,8 +223,6 @@ const ConfigProviderContainer = props => {
|
|
|
224
223
|
})
|
|
225
224
|
})
|
|
226
225
|
});
|
|
227
|
-
|
|
228
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
229
226
|
}, [restConfig, themeConfig, proConfigContextValue, autoClearCache, children]);
|
|
230
227
|
if (!autoClearCache) return configProviderDom;
|
|
231
228
|
return /*#__PURE__*/_jsx(SWRConfig, {
|
|
@@ -19,27 +19,7 @@ export declare const setAlpha: (baseColor: string, alpha: number) => string;
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const lighten: (baseColor: string, brightness: number) => string;
|
|
21
21
|
export type GenerateStyle<ComponentToken extends object = GlobalToken, ReturnType = CSSInterpolation> = (token: ComponentToken, ...rest: any[]) => ReturnType;
|
|
22
|
-
export declare const proTheme:
|
|
23
|
-
defaultSeed: import("antd/es/theme/internal").SeedToken;
|
|
24
|
-
useToken: () => {
|
|
25
|
-
theme: import("@ant-design/cssinjs").Theme<import("antd/es/theme/internal").SeedToken, import("antd/es/theme/internal").AliasToken>;
|
|
26
|
-
token: import("antd").GlobalToken;
|
|
27
|
-
hashId: string;
|
|
28
|
-
cssVar: import("antd").GlobalToken;
|
|
29
|
-
};
|
|
30
|
-
defaultAlgorithm: typeof import("antd/es/theme/themes/default").default;
|
|
31
|
-
darkAlgorithm: import("@ant-design/cssinjs").DerivativeFunc<import("antd/es/theme/internal").SeedToken, import("antd/es/theme/interface").MapToken>;
|
|
32
|
-
compactAlgorithm: import("@ant-design/cssinjs").DerivativeFunc<import("antd/es/theme/internal").SeedToken, import("antd/es/theme/interface").MapToken>;
|
|
33
|
-
getDesignToken: (config?: import("antd").ThemeConfig | undefined) => import("antd/es/theme/internal").AliasToken;
|
|
34
|
-
defaultConfig: {
|
|
35
|
-
token: import("antd/es/theme/internal").SeedToken;
|
|
36
|
-
override: {
|
|
37
|
-
override: import("antd/es/theme/internal").SeedToken;
|
|
38
|
-
};
|
|
39
|
-
hashed: boolean;
|
|
40
|
-
};
|
|
41
|
-
_internalContext: React.Context<import("antd/es/theme/context").DesignTokenProviderProps>;
|
|
42
|
-
};
|
|
22
|
+
export declare const proTheme: any;
|
|
43
23
|
export type UseStyleResult = {
|
|
44
24
|
wrapSSR: (node: React.ReactElement) => React.ReactElement;
|
|
45
25
|
hashId: string;
|
|
@@ -23,6 +23,7 @@ export const lighten = (baseColor, brightness) => {
|
|
|
23
23
|
const instance = new TinyColor(baseColor);
|
|
24
24
|
return instance.lighten(brightness).toHexString();
|
|
25
25
|
};
|
|
26
|
+
// 为了兼容 antd 类型,这里使用 any
|
|
26
27
|
export const proTheme = antdTheme;
|
|
27
28
|
export const resetComponent = token => ({
|
|
28
29
|
boxSizing: 'border-box',
|
|
@@ -31,7 +32,10 @@ export const resetComponent = token => ({
|
|
|
31
32
|
color: token.colorText,
|
|
32
33
|
fontSize: token.fontSize,
|
|
33
34
|
lineHeight: token.lineHeight,
|
|
34
|
-
listStyle: 'none'
|
|
35
|
+
listStyle: 'none',
|
|
36
|
+
'*, *::before, *::after': {
|
|
37
|
+
boxSizing: 'border-box'
|
|
38
|
+
}
|
|
35
39
|
});
|
|
36
40
|
export const operationUnit = token => ({
|
|
37
41
|
// FIXME: This use link but is a operation unit. Seems should be a colorPrimary.
|
|
@@ -55,7 +59,6 @@ export const operationUnit = token => ({
|
|
|
55
59
|
* @returns UseStyleResult
|
|
56
60
|
*/
|
|
57
61
|
export function useStyle(componentName, styleFn) {
|
|
58
|
-
// eslint-disable-next-line prefer-const
|
|
59
62
|
let {
|
|
60
63
|
token = {},
|
|
61
64
|
hashed
|
|
@@ -81,7 +84,7 @@ export function useStyle(componentName, styleFn) {
|
|
|
81
84
|
|
|
82
85
|
// Register styles (side effect only in v2)
|
|
83
86
|
useStyleRegister({
|
|
84
|
-
theme,
|
|
87
|
+
theme: theme,
|
|
85
88
|
token,
|
|
86
89
|
path: [componentName],
|
|
87
90
|
nonce: csp?.nonce,
|
|
@@ -240,10 +240,7 @@ export const TableSkeleton = ({
|
|
|
240
240
|
}), /*#__PURE__*/_jsx(TableItemSkeleton, {
|
|
241
241
|
header: true,
|
|
242
242
|
active: active
|
|
243
|
-
}), new Array(size).fill(null).map((_, index) =>
|
|
244
|
-
/*#__PURE__*/
|
|
245
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
246
|
-
_jsx(TableItemSkeleton, {
|
|
243
|
+
}), new Array(size).fill(null).map((_, index) => /*#__PURE__*/_jsx(TableItemSkeleton, {
|
|
247
244
|
active: active
|
|
248
245
|
}, index)), /*#__PURE__*/_jsx("div", {
|
|
249
246
|
style: {
|
|
@@ -155,10 +155,7 @@ export const ListSkeleton = ({
|
|
|
155
155
|
padding: 0
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
|
-
children: [new Array(size).fill(null).map((_, index) =>
|
|
159
|
-
/*#__PURE__*/
|
|
160
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
161
|
-
_jsx(ListSkeletonItem, {
|
|
158
|
+
children: [new Array(size).fill(null).map((_, index) => /*#__PURE__*/_jsx(ListSkeletonItem, {
|
|
162
159
|
active: !!active
|
|
163
160
|
}, index)), actionButton !== false && /*#__PURE__*/_jsx(Card, {
|
|
164
161
|
variant: "borderless",
|
|
@@ -102,7 +102,6 @@ function useContainer(props = {}) {
|
|
|
102
102
|
console.warn(error);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
106
105
|
}, [props.columnsState?.persistenceKey, props.columnsState?.persistenceType, defaultColumnKeyMap]);
|
|
107
106
|
|
|
108
107
|
/** 清空一下当前的 key */
|
|
@@ -138,7 +137,6 @@ function useContainer(props = {}) {
|
|
|
138
137
|
console.warn(error);
|
|
139
138
|
clearPersistenceStorage();
|
|
140
139
|
}
|
|
141
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
142
140
|
}, [props.columnsState?.persistenceKey, columnsMap, props.columnsState?.persistenceType]);
|
|
143
141
|
const renderValue = {
|
|
144
142
|
action: actionRef.current,
|
package/es/table/Table.js
CHANGED
|
@@ -305,8 +305,6 @@ const ProTable = props => {
|
|
|
305
305
|
...(formSearchRef.current || {}),
|
|
306
306
|
...params
|
|
307
307
|
};
|
|
308
|
-
|
|
309
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
310
308
|
delete actionParams._timestamp;
|
|
311
309
|
const response = await request(actionParams, proSort, proFilter);
|
|
312
310
|
return response;
|
|
@@ -350,7 +348,6 @@ const ProTable = props => {
|
|
|
350
348
|
};
|
|
351
349
|
document.addEventListener('visibilitychange', visibilitychange);
|
|
352
350
|
return () => document.removeEventListener('visibilitychange', visibilitychange);
|
|
353
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
354
351
|
}, []);
|
|
355
352
|
|
|
356
353
|
/** SelectedRowKeys受控处理selectRows */
|
|
@@ -398,7 +395,6 @@ const ProTable = props => {
|
|
|
398
395
|
current: 1
|
|
399
396
|
});
|
|
400
397
|
}
|
|
401
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
402
398
|
}, [params]);
|
|
403
399
|
|
|
404
400
|
// 设置 name 到 store 中,里面用了 ref ,所以不用担心直接 set
|
|
@@ -509,10 +505,7 @@ const ProTable = props => {
|
|
|
509
505
|
columns: propsColumns,
|
|
510
506
|
context: columnContext
|
|
511
507
|
}).sort(columnSort(counter.columnsMap ?? {}));
|
|
512
|
-
|
|
513
|
-
}, [propsColumns, counter?.sortKeyColumns, counter?.columnsMap, columnEmptyText, type,
|
|
514
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
515
|
-
editableUtils.editableKeys && editableUtils.editableKeys.join(','), proFilter, proSort]);
|
|
508
|
+
}, [propsColumns, counter?.sortKeyColumns, counter?.columnsMap, columnEmptyText, type, editableUtils.editableKeys && editableUtils.editableKeys.join(','), proFilter, proSort]);
|
|
516
509
|
|
|
517
510
|
/** Table Column 变化的时候更新一下,这个参数将会用于渲染 */
|
|
518
511
|
useDeepCompareEffectDebounce(() => {
|
|
@@ -729,11 +722,9 @@ const ProTable = props => {
|
|
|
729
722
|
styles: {
|
|
730
723
|
body: {
|
|
731
724
|
...cardBodyStyle,
|
|
732
|
-
...(cardProps
|
|
725
|
+
...(cardProps?.styles?.body ?? {})
|
|
733
726
|
},
|
|
734
|
-
|
|
735
|
-
header: cardProps.styles?.header || cardProps.headStyle
|
|
736
|
-
} : {})
|
|
727
|
+
header: cardProps?.styles?.header
|
|
737
728
|
},
|
|
738
729
|
...cardProps,
|
|
739
730
|
children: tableContentDom
|
|
@@ -787,8 +778,8 @@ const ProviderTableContainer = props => {
|
|
|
787
778
|
columnsState: props.columnsState,
|
|
788
779
|
columns: props.columns,
|
|
789
780
|
onSizeChange: props.onSizeChange,
|
|
790
|
-
size: props.size,
|
|
791
|
-
defaultSize: props.defaultSize
|
|
781
|
+
size: props.size || undefined,
|
|
782
|
+
defaultSize: props.defaultSize || undefined
|
|
792
783
|
},
|
|
793
784
|
children: /*#__PURE__*/_jsx(ProConfigProvider, {
|
|
794
785
|
valueTypeMap: {
|
|
@@ -356,7 +356,6 @@ function ColumnSetting(props) {
|
|
|
356
356
|
if (counter.propsRef.current?.columnsState?.value) {
|
|
357
357
|
columnRef.current = JSON.parse(JSON.stringify(counter.propsRef.current?.columnsState?.value || {}));
|
|
358
358
|
}
|
|
359
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
360
359
|
}, []);
|
|
361
360
|
|
|
362
361
|
/**
|
|
@@ -210,7 +210,6 @@ function useCreatorButton({
|
|
|
210
210
|
return false;
|
|
211
211
|
}
|
|
212
212
|
return createButtonDom(recordCreatorProps, value, intl);
|
|
213
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
214
213
|
}, [maxLength, recordCreatorProps, value?.length, intl]);
|
|
215
214
|
const buttonRenderProps = useMemo(() => {
|
|
216
215
|
if (!creatorButtonDom) {
|