@ant-design/pro-components 3.1.6-0 → 3.1.8-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/field/components/Cascader/index.d.ts +2 -2
- package/es/field/components/Checkbox/index.d.ts +2 -2
- package/es/field/components/DatePicker/index.d.ts +2 -2
- package/es/field/components/FromNow/index.d.ts +1 -1
- package/es/field/components/Percent/util.d.ts +1 -1
- package/es/field/components/Radio/index.d.ts +1 -1
- package/es/field/components/RangePicker/index.d.ts +2 -2
- package/es/field/components/Segmented/index.d.ts +1 -1
- package/es/field/components/Select/LightSelect/index.d.ts +2 -2
- package/es/field/components/Select/index.d.ts +1 -1
- package/es/field/components/Switch/index.d.ts +1 -1
- package/es/field/components/TimePicker/index.d.ts +2 -2
- package/es/field/components/TreeSelect/index.d.ts +1 -1
- package/es/layout/ProLayout.js +1 -1
- package/es/list/Item.js +10 -14
- package/es/list/ListView.js +7 -11
- package/es/list/ProListBase.d.ts +0 -1
- package/es/list/ProListBase.js +38 -51
- package/es/list/index.js +1 -1
- package/es/list/style/index.js +222 -76
- package/es/table/components/DragSortTable/style.js +15 -3
- package/es/table/components/Form/index.js +50 -16
- package/es/table/utils/columnRender.d.ts +1 -1
- package/es/utils/components/ErrorBoundary/index.d.ts +1 -1
- package/es/utils/genCopyable/index.d.ts +1 -1
- package/lib/field/components/Cascader/index.d.ts +2 -2
- package/lib/field/components/Checkbox/index.d.ts +2 -2
- package/lib/field/components/DatePicker/index.d.ts +2 -2
- package/lib/field/components/FromNow/index.d.ts +1 -1
- package/lib/field/components/Percent/util.d.ts +1 -1
- package/lib/field/components/Radio/index.d.ts +1 -1
- package/lib/field/components/RangePicker/index.d.ts +2 -2
- package/lib/field/components/Segmented/index.d.ts +1 -1
- package/lib/field/components/Select/LightSelect/index.d.ts +2 -2
- package/lib/field/components/Select/index.d.ts +1 -1
- package/lib/field/components/Switch/index.d.ts +1 -1
- package/lib/field/components/TimePicker/index.d.ts +2 -2
- package/lib/field/components/TreeSelect/index.d.ts +1 -1
- package/lib/layout/ProLayout.js +1 -1
- package/lib/list/Item.js +10 -14
- package/lib/list/ListView.js +7 -11
- package/lib/list/ProListBase.d.ts +0 -1
- package/lib/list/ProListBase.js +38 -50
- package/lib/list/index.js +1 -1
- package/lib/list/style/index.js +222 -76
- package/lib/table/components/DragSortTable/style.js +15 -3
- package/lib/table/components/Form/index.js +48 -14
- package/lib/table/utils/columnRender.d.ts +1 -1
- package/lib/utils/components/ErrorBoundary/index.d.ts +1 -1
- package/lib/utils/genCopyable/index.d.ts +1 -1
- package/package.json +1 -1
package/es/list/style/index.js
CHANGED
|
@@ -11,6 +11,54 @@ const genTechUiListActiveKeyframes = token => new Keyframes('techUiListActive',
|
|
|
11
11
|
backgroundColor: 'unset'
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
+
const genProListResponsiveStyle = token => {
|
|
15
|
+
const {
|
|
16
|
+
screenMD,
|
|
17
|
+
screenSM,
|
|
18
|
+
contentWidth
|
|
19
|
+
} = token;
|
|
20
|
+
return {
|
|
21
|
+
[`@media screen and (max-width: ${screenMD}px)`]: {
|
|
22
|
+
[token.componentCls]: {
|
|
23
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
24
|
+
[`${token.proComponentsCls}-list-item-action`]: {
|
|
25
|
+
marginInlineStart: token.marginLG
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
[`&${token.proComponentsCls}-list-vertical`]: {
|
|
29
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
30
|
+
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
31
|
+
marginInlineStart: token.marginLG
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
[`@media screen and (max-width: ${screenSM}px)`]: {
|
|
38
|
+
[token.componentCls]: {
|
|
39
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
40
|
+
flexWrap: 'wrap',
|
|
41
|
+
[`${token.proComponentsCls}-list-item-action`]: {
|
|
42
|
+
marginInlineStart: token.marginSM
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
[`&${token.proComponentsCls}-list-vertical`]: {
|
|
46
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
47
|
+
flexWrap: 'wrap-reverse',
|
|
48
|
+
[`${token.proComponentsCls}-list-item-main`]: {
|
|
49
|
+
minWidth: contentWidth
|
|
50
|
+
},
|
|
51
|
+
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
52
|
+
marginBlockStart: 'auto',
|
|
53
|
+
marginBlockEnd: token.margin,
|
|
54
|
+
marginInline: 'auto'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
};
|
|
14
62
|
const genProListStyle = token => {
|
|
15
63
|
const techUiListActive = genTechUiListActiveKeyframes(token);
|
|
16
64
|
return {
|
|
@@ -33,19 +81,32 @@ const genProListStyle = token => {
|
|
|
33
81
|
[`${token.proComponentsCls}-table-alert`]: {
|
|
34
82
|
marginBlockEnd: token.margin
|
|
35
83
|
},
|
|
84
|
+
[`${token.proComponentsCls}-list-pagination`]: {
|
|
85
|
+
marginBlockStart: token.margin,
|
|
86
|
+
marginBlockEnd: 0,
|
|
87
|
+
marginInline: 0
|
|
88
|
+
},
|
|
36
89
|
[`${token.proComponentsCls}-list-item`]: {
|
|
37
90
|
display: 'flex',
|
|
38
|
-
flexDirection: '
|
|
91
|
+
flexDirection: 'row',
|
|
92
|
+
alignItems: 'flex-start',
|
|
39
93
|
cursor: 'pointer',
|
|
40
94
|
flex: 1,
|
|
41
95
|
minWidth: 0,
|
|
42
96
|
padding: token.paddingXS,
|
|
43
|
-
alignItems: 'flex-start',
|
|
44
97
|
borderRadius: token.borderRadius,
|
|
45
98
|
listStyle: 'none',
|
|
46
99
|
'& > *:first-child': {
|
|
47
100
|
flex: 1,
|
|
48
101
|
minWidth: 0
|
|
102
|
+
},
|
|
103
|
+
[`${token.proComponentsCls}-list-item-action`]: {
|
|
104
|
+
flex: '0 0 auto',
|
|
105
|
+
alignSelf: 'center',
|
|
106
|
+
marginInlineStart: token.marginXXL
|
|
107
|
+
},
|
|
108
|
+
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
109
|
+
alignSelf: 'center'
|
|
49
110
|
}
|
|
50
111
|
},
|
|
51
112
|
'&-filled': {
|
|
@@ -79,7 +140,15 @@ const genProListStyle = token => {
|
|
|
79
140
|
gap: token.marginXS,
|
|
80
141
|
borderBlockEnd: 'none',
|
|
81
142
|
margin: 0,
|
|
82
|
-
minWidth: 0
|
|
143
|
+
minWidth: 0,
|
|
144
|
+
color: token.colorText,
|
|
145
|
+
fontSize: token.fontSize,
|
|
146
|
+
lineHeight: token.lineHeight
|
|
147
|
+
},
|
|
148
|
+
[`${token.proComponentsCls}-list-item-meta-description`]: {
|
|
149
|
+
color: token.colorTextDescription,
|
|
150
|
+
fontSize: token.fontSize,
|
|
151
|
+
lineHeight: token.lineHeight
|
|
83
152
|
},
|
|
84
153
|
'&-split': {
|
|
85
154
|
[`${token.componentCls}-row`]: {
|
|
@@ -89,11 +158,7 @@ const genProListStyle = token => {
|
|
|
89
158
|
}
|
|
90
159
|
},
|
|
91
160
|
[`${token.proComponentsCls}-list-item`]: {
|
|
92
|
-
borderRadius: 0
|
|
93
|
-
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`,
|
|
94
|
-
'&:last-child': {
|
|
95
|
-
borderBlockEnd: 'none'
|
|
96
|
-
}
|
|
161
|
+
borderRadius: 0
|
|
97
162
|
}
|
|
98
163
|
},
|
|
99
164
|
'&-no-split': {
|
|
@@ -104,6 +169,145 @@ const genProListStyle = token => {
|
|
|
104
169
|
borderBlockEnd: 'none'
|
|
105
170
|
}
|
|
106
171
|
},
|
|
172
|
+
'&-grid': {
|
|
173
|
+
[`${token.componentCls}-row`]: {
|
|
174
|
+
borderBlockEnd: 'none'
|
|
175
|
+
},
|
|
176
|
+
[`${token.componentCls}-grid-container`]: {
|
|
177
|
+
display: 'flex',
|
|
178
|
+
flexWrap: 'wrap'
|
|
179
|
+
},
|
|
180
|
+
[`${token.componentCls}-grid-col`]: {
|
|
181
|
+
display: 'flex',
|
|
182
|
+
'> *': {
|
|
183
|
+
flex: 1,
|
|
184
|
+
minWidth: 0
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
188
|
+
display: 'flex',
|
|
189
|
+
flexDirection: 'column',
|
|
190
|
+
flex: 1,
|
|
191
|
+
borderBlockEnd: 'none'
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
// 垂直布局:样式必须在 list 根级别,因 vertical 类在 list 根节点上
|
|
195
|
+
[`&${token.proComponentsCls}-list-vertical`]: {
|
|
196
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
197
|
+
alignItems: 'initial'
|
|
198
|
+
},
|
|
199
|
+
[`${token.proComponentsCls}-list-item-main`]: {
|
|
200
|
+
display: 'block',
|
|
201
|
+
flex: 1,
|
|
202
|
+
[`${token.proComponentsCls}-list-item-meta`]: {
|
|
203
|
+
marginBlockEnd: token.padding,
|
|
204
|
+
[`${token.proComponentsCls}-list-item-meta-title`]: {
|
|
205
|
+
marginBlockStart: 0,
|
|
206
|
+
marginBlockEnd: token.paddingSM,
|
|
207
|
+
color: token.colorText,
|
|
208
|
+
fontSize: token.fontSizeLG,
|
|
209
|
+
lineHeight: token.lineHeightLG
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
[`${token.proComponentsCls}-list-item-action`]: {
|
|
213
|
+
marginBlockStart: token.padding,
|
|
214
|
+
marginInlineStart: 'auto',
|
|
215
|
+
'> *': {
|
|
216
|
+
paddingBlock: 0,
|
|
217
|
+
paddingInline: token.padding,
|
|
218
|
+
'&:first-child': {
|
|
219
|
+
paddingInlineStart: 0
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
[`${token.componentCls}-row`]: {
|
|
225
|
+
marginBlockEnd: token.marginSM,
|
|
226
|
+
'&-header-title': {
|
|
227
|
+
display: 'flex',
|
|
228
|
+
flexDirection: 'column',
|
|
229
|
+
alignItems: 'flex-start',
|
|
230
|
+
justifyContent: 'center'
|
|
231
|
+
},
|
|
232
|
+
'&-content': {
|
|
233
|
+
marginBlock: 0,
|
|
234
|
+
marginInline: 0
|
|
235
|
+
},
|
|
236
|
+
'&-sub-title': {
|
|
237
|
+
marginBlockStart: token.marginXS
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
241
|
+
display: 'flex',
|
|
242
|
+
alignItems: 'center',
|
|
243
|
+
marginInlineStart: token.marginXL,
|
|
244
|
+
[`${token.componentCls}-row-description`]: {
|
|
245
|
+
marginBlockStart: token.margin
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
[`${token.proComponentsCls}-list-bordered ${token.proComponentsCls}-list-item`]: {
|
|
249
|
+
paddingInline: 0
|
|
250
|
+
},
|
|
251
|
+
[`${token.componentCls}-row-show-extra-hover`]: {
|
|
252
|
+
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
253
|
+
display: 'none'
|
|
254
|
+
}
|
|
255
|
+
},
|
|
256
|
+
[`${token.proComponentsCls}-list-list`]: {
|
|
257
|
+
'&-item': {
|
|
258
|
+
cursor: 'pointer',
|
|
259
|
+
paddingBlock: token.paddingSM,
|
|
260
|
+
paddingInline: token.paddingSM
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
[`${token.proComponentsCls}-list-row`]: {
|
|
264
|
+
'&-header': {
|
|
265
|
+
display: 'flex',
|
|
266
|
+
flexDirection: 'column',
|
|
267
|
+
alignItems: 'flex-start',
|
|
268
|
+
paddingBlock: 0,
|
|
269
|
+
paddingInline: 0,
|
|
270
|
+
borderBlockEnd: 'none'
|
|
271
|
+
},
|
|
272
|
+
'&-content': {
|
|
273
|
+
marginBlockStart: token.marginSM,
|
|
274
|
+
marginInlineStart: 0
|
|
275
|
+
},
|
|
276
|
+
[`${token.proComponentsCls}-list-item`]: {
|
|
277
|
+
width: '100%',
|
|
278
|
+
paddingBlock: token.paddingSM,
|
|
279
|
+
paddingInlineStart: token.paddingLG,
|
|
280
|
+
paddingInlineEnd: token.paddingMD,
|
|
281
|
+
[`${token.proComponentsCls}-list-item-meta-avatar`]: {
|
|
282
|
+
display: 'flex',
|
|
283
|
+
alignItems: 'center',
|
|
284
|
+
marginInlineEnd: token.marginXS
|
|
285
|
+
},
|
|
286
|
+
[`${token.proComponentsCls}-list-item-meta-title`]: {
|
|
287
|
+
marginBlockStart: 0,
|
|
288
|
+
marginBlockEnd: token.paddingSM,
|
|
289
|
+
marginInline: 0,
|
|
290
|
+
fontSize: token.fontSizeLG,
|
|
291
|
+
lineHeight: token.lineHeightLG
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
[`${token.proComponentsCls}-list-item-main`]: {
|
|
297
|
+
display: 'flex',
|
|
298
|
+
flexDirection: 'row',
|
|
299
|
+
alignItems: 'center',
|
|
300
|
+
flex: 1,
|
|
301
|
+
minWidth: 0,
|
|
302
|
+
width: '100%',
|
|
303
|
+
'& > *:first-child': {
|
|
304
|
+
flex: 1,
|
|
305
|
+
minWidth: 0
|
|
306
|
+
},
|
|
307
|
+
[`${token.proComponentsCls}-list-item-action`]: {
|
|
308
|
+
alignSelf: 'center'
|
|
309
|
+
}
|
|
310
|
+
},
|
|
107
311
|
[`${token.proComponentsCls}-list-item-action,
|
|
108
312
|
${token.proComponentsCls}-card-extra,
|
|
109
313
|
${token.proComponentsCls}-card-actions`]: {
|
|
@@ -182,7 +386,7 @@ const genProListStyle = token => {
|
|
|
182
386
|
flexShrink: 9,
|
|
183
387
|
marginBlock: 0,
|
|
184
388
|
marginInline: 0,
|
|
185
|
-
lineHeight:
|
|
389
|
+
lineHeight: token.lineHeightLG
|
|
186
390
|
}
|
|
187
391
|
},
|
|
188
392
|
[`&${token.componentCls}-row-editable`]: {
|
|
@@ -255,11 +459,11 @@ const genProListStyle = token => {
|
|
|
255
459
|
display: 'flex',
|
|
256
460
|
alignItems: 'center',
|
|
257
461
|
justifyContent: 'space-between',
|
|
258
|
-
height:
|
|
462
|
+
height: token.controlHeightLG,
|
|
259
463
|
paddingInline: token.paddingLG,
|
|
260
464
|
paddingBlock: 0,
|
|
261
465
|
color: token.colorTextSecondary,
|
|
262
|
-
lineHeight:
|
|
466
|
+
lineHeight: token.controlHeightLG,
|
|
263
467
|
background: setAlpha(token.colorTextBase, 0.02),
|
|
264
468
|
'&-actions': {
|
|
265
469
|
display: 'none'
|
|
@@ -276,14 +480,14 @@ const genProListStyle = token => {
|
|
|
276
480
|
display: 'flex',
|
|
277
481
|
fontSize: token.fontSizeSM,
|
|
278
482
|
cursor: 'pointer',
|
|
279
|
-
height:
|
|
483
|
+
height: token.controlHeightSM,
|
|
280
484
|
color: token.colorTextSecondary,
|
|
281
485
|
'> .anticon > svg': {
|
|
282
486
|
transition: '0.3s'
|
|
283
487
|
}
|
|
284
488
|
},
|
|
285
489
|
'&-expanded': {
|
|
286
|
-
'
|
|
490
|
+
'> .anticon > svg': {
|
|
287
491
|
transform: 'rotate(90deg)'
|
|
288
492
|
}
|
|
289
493
|
},
|
|
@@ -304,9 +508,10 @@ const genProListStyle = token => {
|
|
|
304
508
|
display: 'flex',
|
|
305
509
|
flex: '1',
|
|
306
510
|
flexDirection: 'column',
|
|
307
|
-
marginBlock: 0
|
|
511
|
+
marginBlock: 0,
|
|
512
|
+
marginInlineStart: token.marginXL
|
|
308
513
|
},
|
|
309
|
-
'&-
|
|
514
|
+
'&-sub-title': {
|
|
310
515
|
display: 'inline-flex',
|
|
311
516
|
flexWrap: 'wrap',
|
|
312
517
|
alignItems: 'center',
|
|
@@ -359,74 +564,15 @@ const genProListStyle = token => {
|
|
|
359
564
|
alignItems: 'center'
|
|
360
565
|
},
|
|
361
566
|
'&-checkbox': {
|
|
362
|
-
width:
|
|
567
|
+
width: token.fontSizeLG,
|
|
363
568
|
marginInlineEnd: token.marginSM
|
|
364
569
|
},
|
|
365
|
-
[`${token.proComponentsCls}-list-vertical`]: {
|
|
366
|
-
[`${token.componentCls}-row`]: {
|
|
367
|
-
marginBlockEnd: token.marginSM
|
|
368
|
-
},
|
|
369
|
-
'&-header-title': {
|
|
370
|
-
display: 'flex',
|
|
371
|
-
flexDirection: 'column',
|
|
372
|
-
alignItems: 'flex-start',
|
|
373
|
-
justifyContent: 'center'
|
|
374
|
-
},
|
|
375
|
-
'&-content': {
|
|
376
|
-
marginBlock: 0,
|
|
377
|
-
marginInline: 0
|
|
378
|
-
},
|
|
379
|
-
'&-subTitle': {
|
|
380
|
-
marginBlockStart: token.marginXS
|
|
381
|
-
},
|
|
382
|
-
[`${token.proComponentsCls}-list-item-extra`]: {
|
|
383
|
-
display: 'flex',
|
|
384
|
-
alignItems: 'center',
|
|
385
|
-
[`${token.componentCls}-row-description`]: {
|
|
386
|
-
marginBlockStart: token.margin
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
[`${token.proComponentsCls}-list-bordered ${token.proComponentsCls}-list-item`]: {
|
|
390
|
-
paddingInline: 0
|
|
391
|
-
},
|
|
392
|
-
[`${token.componentCls}-row-show-extra-hover`]: {
|
|
393
|
-
[`${token.proComponentsCls}-list-item-extra `]: {
|
|
394
|
-
display: 'none'
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
[`${token.proComponentsCls}-list-pagination`]: {
|
|
399
|
-
marginBlockStart: token.margin,
|
|
400
|
-
marginBlockEnd: token.margin
|
|
401
|
-
},
|
|
402
570
|
[`${token.proComponentsCls}-list-list`]: {
|
|
403
571
|
'&-item': {
|
|
404
572
|
cursor: 'pointer',
|
|
405
573
|
paddingBlock: token.paddingSM,
|
|
406
574
|
paddingInline: token.paddingSM
|
|
407
575
|
}
|
|
408
|
-
},
|
|
409
|
-
[`${token.proComponentsCls}-list-vertical ${token.proComponentsCls}-list-row`]: {
|
|
410
|
-
'&-header': {
|
|
411
|
-
paddingBlock: 0,
|
|
412
|
-
paddingInline: 0,
|
|
413
|
-
borderBlockEnd: 'none'
|
|
414
|
-
},
|
|
415
|
-
[`${token.proComponentsCls}-list-item`]: {
|
|
416
|
-
width: '100%',
|
|
417
|
-
paddingBlock: token.paddingSM,
|
|
418
|
-
paddingInlineStart: token.paddingLG,
|
|
419
|
-
paddingInlineEnd: token.paddingMD,
|
|
420
|
-
[`${token.proComponentsCls}-list-item-meta-avatar`]: {
|
|
421
|
-
display: 'flex',
|
|
422
|
-
alignItems: 'center',
|
|
423
|
-
marginInlineEnd: token.marginXS
|
|
424
|
-
},
|
|
425
|
-
[`${token.proComponentsCls}-list-item-meta-title`]: {
|
|
426
|
-
marginBlock: 0,
|
|
427
|
-
marginInline: 0
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
576
|
}
|
|
431
577
|
}
|
|
432
578
|
}
|
|
@@ -438,6 +584,6 @@ export function useStyle(prefixCls) {
|
|
|
438
584
|
...token,
|
|
439
585
|
componentCls: `.${prefixCls}`
|
|
440
586
|
};
|
|
441
|
-
return [genProListStyle(proListToken)];
|
|
587
|
+
return [genProListStyle(proListToken), genProListResponsiveStyle(proListToken)];
|
|
442
588
|
});
|
|
443
589
|
}
|
|
@@ -4,15 +4,27 @@ const genProListStyle = token => {
|
|
|
4
4
|
[token.componentCls]: {
|
|
5
5
|
boxSizing: 'border-box',
|
|
6
6
|
'&-icon': {
|
|
7
|
-
|
|
7
|
+
display: 'inline-flex',
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
width: token.controlHeightSM,
|
|
11
|
+
minHeight: token.controlHeightSM,
|
|
12
|
+
marginInlineEnd: token.marginSM,
|
|
8
13
|
color: token.colorTextSecondary,
|
|
9
14
|
cursor: 'grab !important',
|
|
10
|
-
|
|
11
|
-
fontSize: 12,
|
|
15
|
+
fontSize: token.fontSize,
|
|
12
16
|
borderRadius: token.borderRadius,
|
|
17
|
+
transition: `color ${token.motionDurationMid}, background-color ${token.motionDurationMid}`,
|
|
18
|
+
'& .anticon': {
|
|
19
|
+
color: token.colorText,
|
|
20
|
+
fontSize: 'inherit'
|
|
21
|
+
},
|
|
13
22
|
'&:hover': {
|
|
14
23
|
color: token.colorText,
|
|
15
24
|
backgroundColor: token.colorInfoBg
|
|
25
|
+
},
|
|
26
|
+
'&:active': {
|
|
27
|
+
backgroundColor: token.colorInfoBg
|
|
16
28
|
}
|
|
17
29
|
}
|
|
18
30
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { omit } from '@rc-component/util';
|
|
2
|
-
import React, { memo,
|
|
3
|
-
import { isDeepEqualReact, omitUndefined } from "../../../utils";
|
|
2
|
+
import React, { memo, useMemo } from 'react';
|
|
3
|
+
import { isDeepEqualReact, omitUndefined, useRefFunction } from "../../../utils";
|
|
4
4
|
import { isBordered } from "../../utils/index";
|
|
5
5
|
import FormRender from "./FormRender";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -30,7 +30,34 @@ const FormSearch = props => {
|
|
|
30
30
|
current: pagination.current,
|
|
31
31
|
pageSize: pagination.pageSize
|
|
32
32
|
}) : {}, [pagination]);
|
|
33
|
-
const onSubmitHandler =
|
|
33
|
+
const onSubmitHandler = useRefFunction((value, firstLoad) => {
|
|
34
|
+
// 检查是否需要验证
|
|
35
|
+
if (form?.ignoreRules === false && firstLoad) {
|
|
36
|
+
formRef?.current?.validateFields().then(() => {
|
|
37
|
+
const submitParams = {
|
|
38
|
+
...value,
|
|
39
|
+
_timestamp: Date.now(),
|
|
40
|
+
...pageInfo
|
|
41
|
+
};
|
|
42
|
+
const omitParams = omit(beforeSearchSubmit(submitParams), Object.keys(pageInfo));
|
|
43
|
+
onFormSearchSubmit(omitParams);
|
|
44
|
+
if (!firstLoad) {
|
|
45
|
+
// back first page
|
|
46
|
+
action.current?.setPageInfo?.({
|
|
47
|
+
current: 1
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// 不是第一次提交就不触发,第一次提交是 js 触发的
|
|
51
|
+
// 为了解决 https://github.com/ant-design/pro-components/issues/579
|
|
52
|
+
if (onSubmit && !firstLoad) {
|
|
53
|
+
onSubmit?.(value);
|
|
54
|
+
}
|
|
55
|
+
}).catch(e => {
|
|
56
|
+
// 验证失败,不执行后续逻辑
|
|
57
|
+
// console.error(e);
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
34
61
|
const submitParams = {
|
|
35
62
|
...value,
|
|
36
63
|
_timestamp: Date.now(),
|
|
@@ -49,19 +76,26 @@ const FormSearch = props => {
|
|
|
49
76
|
if (onSubmit && !firstLoad) {
|
|
50
77
|
onSubmit?.(value);
|
|
51
78
|
}
|
|
52
|
-
}
|
|
53
|
-
const onResetHandler =
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
current
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
79
|
+
});
|
|
80
|
+
const onResetHandler = useRefFunction(value => {
|
|
81
|
+
const resetLogic = () => {
|
|
82
|
+
const omitParams = omit(beforeSearchSubmit({
|
|
83
|
+
...value,
|
|
84
|
+
...pageInfo
|
|
85
|
+
}), Object.keys(pageInfo));
|
|
86
|
+
onFormSearchSubmit(omitParams);
|
|
87
|
+
// back first page
|
|
88
|
+
action.current?.setPageInfo?.({
|
|
89
|
+
current: 1
|
|
90
|
+
});
|
|
91
|
+
onReset?.();
|
|
92
|
+
};
|
|
93
|
+
if (form?.ignoreRules === false) {
|
|
94
|
+
formRef?.current?.validateFields().then(resetLogic).catch(() => {});
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
resetLogic();
|
|
98
|
+
});
|
|
65
99
|
return /*#__PURE__*/_jsx(FormRender, {
|
|
66
100
|
submitButtonLoading: loading,
|
|
67
101
|
columns: columns,
|
|
@@ -22,7 +22,7 @@ type ColumnRenderInterface<T> = {
|
|
|
22
22
|
*
|
|
23
23
|
* @param item
|
|
24
24
|
*/
|
|
25
|
-
export declare const renderColumnsTitle: (item: ProColumns<any>) => string | number | boolean |
|
|
25
|
+
export declare const renderColumnsTitle: (item: ProColumns<any>) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* 默认的 filter 方法
|
|
28
28
|
*
|
|
@@ -15,6 +15,6 @@ declare class ErrorBoundary extends React.Component<{
|
|
|
15
15
|
errorInfo: string;
|
|
16
16
|
};
|
|
17
17
|
componentDidCatch(error: any, errorInfo: ErrorInfo): void;
|
|
18
|
-
render(): string | number | boolean |
|
|
18
|
+
render(): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
19
19
|
}
|
|
20
20
|
export { ErrorBoundary };
|
|
@@ -12,4 +12,4 @@ export type ProEllipsis = ProEllipsisTooltip | boolean;
|
|
|
12
12
|
* @param item
|
|
13
13
|
* @param text
|
|
14
14
|
*/
|
|
15
|
-
export declare const genCopyable: (dom: React.ReactNode, item: any, text: string) => string | number | boolean |
|
|
15
|
+
export declare const genCopyable: (dom: React.ReactNode, item: any, text: string) => string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<React.ReactNode> | null | undefined;
|
|
@@ -11,7 +11,7 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
11
11
|
options?: (string | number | import("antd").CheckboxOptionType<any>)[] | undefined;
|
|
12
12
|
radioType?: "button" | "radio" | undefined;
|
|
13
13
|
placeholder?: string | undefined;
|
|
14
|
-
variant?: "
|
|
14
|
+
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
15
15
|
} & {
|
|
16
16
|
text: string;
|
|
17
17
|
valueEnum?: import("src/utils/typing").ProFieldValueEnumType | undefined;
|
|
@@ -19,7 +19,7 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
19
19
|
request?: import("src/utils/typing").ProFieldRequestData | undefined;
|
|
20
20
|
params?: any;
|
|
21
21
|
fieldProps?: any;
|
|
22
|
-
variant?: "
|
|
22
|
+
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
23
23
|
id?: string | undefined;
|
|
24
24
|
defaultKeyWords?: string | undefined;
|
|
25
25
|
} & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
|
|
@@ -6,7 +6,7 @@ export type GroupProps = {
|
|
|
6
6
|
options?: CheckboxGroupProps['options'];
|
|
7
7
|
} & FieldSelectProps;
|
|
8
8
|
declare const _default: React.ForwardRefExoticComponent<import("src/provider").BaseProFieldFC & import("src/provider").ProRenderFieldPropsType & {
|
|
9
|
-
layout?: "
|
|
9
|
+
layout?: "vertical" | "horizontal" | undefined;
|
|
10
10
|
options?: (string | number | import("antd/lib/checkbox").CheckboxOptionType<any>)[] | undefined;
|
|
11
11
|
} & {
|
|
12
12
|
text: string;
|
|
@@ -15,7 +15,7 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
|
|
|
15
15
|
request?: import("src/utils/typing").ProFieldRequestData | undefined;
|
|
16
16
|
params?: any;
|
|
17
17
|
fieldProps?: any;
|
|
18
|
-
variant?: "
|
|
18
|
+
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
19
19
|
id?: string | undefined;
|
|
20
20
|
defaultKeyWords?: string | undefined;
|
|
21
21
|
} & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
|
|
@@ -4,7 +4,7 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
4
4
|
text: string | number;
|
|
5
5
|
format?: string | undefined;
|
|
6
6
|
showTime?: boolean | undefined;
|
|
7
|
-
variant?: "
|
|
8
|
-
picker?: "time" | "date" | "
|
|
7
|
+
variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
8
|
+
picker?: "time" | "date" | "year" | "month" | "week" | "quarter" | undefined;
|
|
9
9
|
} & ProFieldLightProps & React.RefAttributes<any>>;
|
|
10
10
|
export default _default;
|
|
@@ -2,6 +2,6 @@ import React from 'react';
|
|
|
2
2
|
declare const _default: React.ForwardRefExoticComponent<import("../../../provider").BaseProFieldFC & import("../../../provider").ProRenderFieldPropsType & {
|
|
3
3
|
text: string;
|
|
4
4
|
format?: string | undefined;
|
|
5
|
-
variant?: "
|
|
5
|
+
variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
6
6
|
} & React.RefAttributes<any>>;
|
|
7
7
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** 获取展示符号 */
|
|
2
2
|
export declare function getSymbolByRealValue(realValue: number): "-" | "+" | null;
|
|
3
3
|
/** 获取颜色 */
|
|
4
|
-
export declare function getColorByRealValue(realValue: number /** ,color: string */): "#
|
|
4
|
+
export declare function getColorByRealValue(realValue: number /** ,color: string */): "#595959" | "#ff4d4f" | "#52c41a";
|
|
5
5
|
/** 获取到最后展示的数字 */
|
|
6
6
|
export declare function getRealTextWithPrecision(realValue: number, precision?: number): string | number;
|
|
7
7
|
/**
|
|
@@ -15,7 +15,7 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
|
|
|
15
15
|
request?: import("src/utils/typing").ProFieldRequestData | undefined;
|
|
16
16
|
params?: any;
|
|
17
17
|
fieldProps?: any;
|
|
18
|
-
variant?: "
|
|
18
|
+
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
19
19
|
id?: string | undefined;
|
|
20
20
|
defaultKeyWords?: string | undefined;
|
|
21
21
|
} & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
|
|
@@ -3,8 +3,8 @@ import type { ProFieldLightProps } from '../../PureProField';
|
|
|
3
3
|
declare const _default: React.ForwardRefExoticComponent<import("../../../provider").BaseProFieldFC & import("../../../provider").ProRenderFieldPropsType & {
|
|
4
4
|
text: string[];
|
|
5
5
|
format?: string | undefined;
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
7
7
|
showTime?: boolean | undefined;
|
|
8
|
-
picker?: "time" | "date" | "
|
|
8
|
+
picker?: "time" | "date" | "year" | "month" | "week" | "quarter" | undefined;
|
|
9
9
|
} & ProFieldLightProps & React.RefAttributes<any>>;
|
|
10
10
|
export default _default;
|
|
@@ -9,7 +9,7 @@ declare const _default: React.ForwardRefExoticComponent<import("src/provider").B
|
|
|
9
9
|
request?: import("src/utils/typing").ProFieldRequestData | undefined;
|
|
10
10
|
params?: any;
|
|
11
11
|
fieldProps?: any;
|
|
12
|
-
variant?: "
|
|
12
|
+
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
13
13
|
id?: string | undefined;
|
|
14
14
|
defaultKeyWords?: string | undefined;
|
|
15
15
|
} & import("../../PureProField").ProFieldLightProps & React.RefAttributes<any>>;
|
|
@@ -31,7 +31,7 @@ declare const _default: React.ForwardRefExoticComponent<SelectProps<any, import(
|
|
|
31
31
|
*/
|
|
32
32
|
fetchDataOnSearch?: boolean | undefined;
|
|
33
33
|
/** 变体类型 */
|
|
34
|
-
variant?: "
|
|
35
|
-
labelVariant?: "
|
|
34
|
+
variant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
35
|
+
labelVariant?: "filled" | "outlined" | "borderless" | "underlined" | undefined;
|
|
36
36
|
} & ProFieldLightProps & SelectProps<any, import("antd/es/select").DefaultOptionType> & React.RefAttributes<any>>;
|
|
37
37
|
export default _default;
|
|
@@ -43,7 +43,7 @@ declare const _default: React.ForwardRefExoticComponent<import("../../../provide
|
|
|
43
43
|
params?: any;
|
|
44
44
|
/** 组件的全局设置 */
|
|
45
45
|
fieldProps?: any;
|
|
46
|
-
variant?: "
|
|
46
|
+
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
47
47
|
id?: string | undefined;
|
|
48
48
|
/** 默认搜素条件 */
|
|
49
49
|
defaultKeyWords?: string | undefined;
|
|
@@ -3,6 +3,6 @@ import React from 'react';
|
|
|
3
3
|
declare const _default: React.ForwardRefExoticComponent<import("../../../provider").BaseProFieldFC & import("../../../provider").ProRenderFieldPropsType & {
|
|
4
4
|
text: boolean;
|
|
5
5
|
fieldProps?: SwitchProps | undefined;
|
|
6
|
-
variant?: "
|
|
6
|
+
variant?: "filled" | "outlined" | "borderless" | undefined;
|
|
7
7
|
} & React.RefAttributes<any>>;
|
|
8
8
|
export default _default;
|