@ant-design/pro-components 3.1.3-1 → 3.1.5-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/ProCard.js +15 -7
- package/es/card/components/Actions/index.js +1 -4
- package/es/card/components/Card/index.js +60 -28
- package/es/card/components/Card/style.js +46 -9
- 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 +3 -3
- package/es/card/components/StatisticCard/index.js +1 -1
- package/es/card/typing.d.ts +29 -14
- 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.d.ts +2 -0
- package/es/field/AllProField.js +3 -4
- package/es/field/PureProField.d.ts +2 -0
- package/es/field/PureProField.js +2 -5
- package/es/field/components/Cascader/index.js +8 -1
- package/es/field/components/Checkbox/index.js +7 -6
- package/es/field/components/DatePicker/index.d.ts +1 -1
- package/es/field/components/DatePicker/index.js +13 -1
- package/es/field/components/Digit/index.js +20 -3
- package/es/field/components/DigitRange/index.js +1 -0
- package/es/field/components/Money/index.js +51 -3
- package/es/field/components/Options/index.js +0 -3
- package/es/field/components/Password/index.js +12 -11
- package/es/field/components/Percent/util.d.ts +1 -1
- package/es/field/components/Radio/index.js +5 -1
- package/es/field/components/RangePicker/index.d.ts +1 -1
- package/es/field/components/Segmented/index.js +2 -1
- package/es/field/components/Select/SearchSelect/index.js +0 -1
- package/es/field/components/Select/index.d.ts +1 -1
- package/es/field/components/Select/index.js +1 -1
- package/es/field/components/Switch/index.js +10 -3
- package/es/field/components/Text/index.js +11 -2
- package/es/field/components/TextArea/index.js +6 -3
- package/es/field/components/TimePicker/index.js +10 -1
- package/es/field/components/TreeSelect/index.d.ts +2 -12
- package/es/field/components/TreeSelect/index.js +31 -17
- package/es/form/BaseForm/BaseForm.js +4 -6
- package/es/form/BaseForm/LightWrapper/index.d.ts +2 -1
- package/es/form/BaseForm/Submitter/index.d.ts +1 -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/Digit/DigitRange.js +5 -2
- package/es/form/components/Digit/index.js +7 -2
- package/es/form/components/FieldSet/index.js +16 -6
- package/es/form/components/FormItem/FormItemRender/index.d.ts +1 -1
- package/es/form/components/FormItem/FormItemRender/index.js +10 -2
- package/es/form/components/FormItem/Group/index.js +1 -1
- package/es/form/components/FormItem/index.js +9 -7
- package/es/form/components/FormItem/warpField.js +3 -15
- package/es/form/components/List/ListContainer.js +2 -1
- 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 +11 -2
- 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.d.ts +4 -4
- package/es/form/layouts/DrawerForm/index.js +2 -6
- package/es/form/layouts/LightFilter/index.js +5 -6
- package/es/form/layouts/LoginForm/index.js +8 -8
- package/es/form/layouts/LoginFormPage/index.js +15 -15
- package/es/form/layouts/ModalForm/index.d.ts +2 -2
- package/es/form/layouts/ModalForm/index.js +1 -4
- package/es/form/layouts/QueryFilter/Actions.js +2 -1
- package/es/form/layouts/QueryFilter/index.js +40 -24
- package/es/form/layouts/StepsForm/StepForm.js +0 -1
- package/es/form/layouts/StepsForm/index.js +5 -14
- package/es/layout/ProLayout.d.ts +1 -1
- package/es/layout/ProLayout.js +2 -7
- package/es/layout/components/AppsLogoComponents/DefaultContent.js +6 -5
- package/es/layout/components/AppsLogoComponents/SimpleContent.js +6 -5
- package/es/layout/components/AppsLogoComponents/style/index.js +4 -0
- package/es/layout/components/FooterToolbar/index.d.ts +1 -1
- package/es/layout/components/FooterToolbar/index.js +2 -5
- package/es/layout/components/GlobalFooter/index.js +3 -3
- package/es/layout/components/GlobalHeader/ActionsContent.js +6 -7
- package/es/layout/components/GlobalHeader/index.js +1 -1
- package/es/layout/components/GridContent/index.js +1 -1
- package/es/layout/components/Header/index.js +1 -3
- package/es/layout/components/Help/ProHelpPanel.js +11 -10
- package/es/layout/components/PageContainer/index.js +9 -10
- package/es/layout/components/PageContainer/style/index.js +4 -0
- package/es/layout/components/PageHeader/index.js +10 -10
- package/es/layout/components/SettingDrawer/BlockCheckbox.js +2 -3
- package/es/layout/components/SettingDrawer/LayoutChange.js +3 -2
- package/es/layout/components/SettingDrawer/RegionalChange.js +3 -2
- package/es/layout/components/SettingDrawer/ThemeColor.js +3 -2
- package/es/layout/components/SettingDrawer/index.js +5 -5
- package/es/layout/components/SettingDrawer/style/index.js +4 -0
- package/es/layout/components/SiderMenu/BaseMenu.js +5 -9
- package/es/layout/components/SiderMenu/SiderMenu.js +6 -8
- package/es/layout/components/SiderMenu/index.js +0 -1
- package/es/layout/components/TopNavHeader/index.js +4 -5
- package/es/layout/style/index.js +4 -0
- package/es/layout/utils/getBreadcrumbProps.js +1 -1
- package/es/layout/utils/getMenuData.js +0 -1
- package/es/list/Item.d.ts +4 -7
- package/es/list/Item.js +82 -104
- package/es/list/ListView.d.ts +6 -4
- package/es/list/ListView.js +42 -55
- package/es/list/ProListBase.d.ts +74 -0
- package/es/list/ProListBase.js +358 -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 +228 -86
- package/es/provider/index.d.ts +2 -2
- 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 +17 -17
- package/es/table/components/Alert/index.js +6 -5
- package/es/table/components/ColumnSetting/index.js +9 -10
- package/es/table/components/DragSortTable/index.js +8 -4
- package/es/table/components/EditableTable/index.d.ts +1 -1
- package/es/table/components/EditableTable/index.js +6 -8
- package/es/table/components/ListToolBar/HeaderMenu.d.ts +1 -0
- package/es/table/components/ListToolBar/HeaderMenu.js +4 -3
- package/es/table/components/ListToolBar/index.d.ts +1 -1
- package/es/table/components/ListToolBar/index.js +18 -21
- package/es/table/components/ListToolBar/style.js +3 -3
- 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 +4 -4
- package/es/table/utils/cellRenderToFromItem.js +2 -4
- package/es/table/utils/index.js +0 -1
- package/es/table/utils/useDragSort.js +1 -1
- package/es/utils/components/DropdownFooter/index.d.ts +1 -1
- package/es/utils/components/FieldLabel/index.js +1 -1
- package/es/utils/components/FilterDropdown/index.d.ts +1 -1
- package/es/utils/components/FilterDropdown/index.js +1 -1
- package/es/utils/components/InlineErrorFormItem/index.js +5 -4
- package/es/utils/components/LabelIconTip/index.d.ts +3 -4
- package/es/utils/components/LabelIconTip/index.js +2 -2
- 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/hooks/useFetchData/index.js +0 -2
- package/es/utils/index.d.ts +2 -1
- package/es/utils/isDeepEqualReact/index.js +0 -8
- package/es/utils/isUrl/index.js +1 -1
- 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.d.ts +2 -2
- package/es/utils/proFieldParsingText/index.js +3 -5
- 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/components/pro-card.md +5 -4
- package/guidelines/overview-components.md +1 -1
- package/lib/card/ProCard.js +15 -7
- package/lib/card/components/Actions/index.js +1 -4
- package/lib/card/components/Card/index.js +60 -28
- package/lib/card/components/Card/style.js +46 -9
- 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 +3 -3
- package/lib/card/components/StatisticCard/index.js +1 -1
- package/lib/card/typing.d.ts +29 -14
- 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.d.ts +2 -0
- package/lib/field/AllProField.js +3 -4
- package/lib/field/PureProField.d.ts +2 -0
- package/lib/field/PureProField.js +2 -5
- package/lib/field/components/Cascader/index.js +8 -1
- package/lib/field/components/Checkbox/index.js +7 -6
- package/lib/field/components/DatePicker/index.d.ts +1 -1
- package/lib/field/components/DatePicker/index.js +13 -1
- package/lib/field/components/Digit/index.js +20 -3
- package/lib/field/components/DigitRange/index.js +1 -0
- package/lib/field/components/Money/index.js +50 -2
- package/lib/field/components/Options/index.js +0 -3
- package/lib/field/components/Password/index.js +11 -10
- package/lib/field/components/Percent/util.d.ts +1 -1
- package/lib/field/components/Radio/index.js +5 -1
- package/lib/field/components/RangePicker/index.d.ts +1 -1
- package/lib/field/components/Segmented/index.js +2 -1
- package/lib/field/components/Select/SearchSelect/index.js +0 -1
- package/lib/field/components/Select/index.d.ts +1 -1
- package/lib/field/components/Select/index.js +1 -1
- package/lib/field/components/Switch/index.js +10 -3
- package/lib/field/components/Text/index.js +11 -2
- package/lib/field/components/TextArea/index.js +6 -3
- package/lib/field/components/TimePicker/index.js +10 -1
- package/lib/field/components/TreeSelect/index.d.ts +2 -12
- package/lib/field/components/TreeSelect/index.js +30 -16
- package/lib/form/BaseForm/BaseForm.js +4 -7
- package/lib/form/BaseForm/LightWrapper/index.d.ts +2 -1
- package/lib/form/BaseForm/Submitter/index.d.ts +1 -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/Digit/DigitRange.js +5 -2
- package/lib/form/components/Digit/index.js +7 -2
- package/lib/form/components/FieldSet/index.js +16 -6
- package/lib/form/components/FormItem/FormItemRender/index.d.ts +1 -1
- package/lib/form/components/FormItem/FormItemRender/index.js +10 -2
- package/lib/form/components/FormItem/Group/index.js +1 -1
- package/lib/form/components/FormItem/index.js +9 -7
- package/lib/form/components/FormItem/warpField.js +3 -15
- package/lib/form/components/List/ListContainer.js +2 -1
- 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 +11 -2
- 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.d.ts +4 -4
- package/lib/form/layouts/DrawerForm/index.js +2 -6
- package/lib/form/layouts/LightFilter/index.js +5 -6
- package/lib/form/layouts/LoginForm/index.js +8 -8
- package/lib/form/layouts/LoginFormPage/index.js +15 -15
- package/lib/form/layouts/ModalForm/index.d.ts +2 -2
- package/lib/form/layouts/ModalForm/index.js +1 -4
- package/lib/form/layouts/QueryFilter/Actions.js +2 -1
- package/lib/form/layouts/QueryFilter/index.js +39 -24
- package/lib/form/layouts/StepsForm/StepForm.js +0 -1
- package/lib/form/layouts/StepsForm/index.js +5 -14
- package/lib/layout/ProLayout.d.ts +1 -1
- package/lib/layout/ProLayout.js +2 -7
- package/lib/layout/components/AppsLogoComponents/DefaultContent.js +6 -5
- package/lib/layout/components/AppsLogoComponents/SimpleContent.js +6 -5
- package/lib/layout/components/AppsLogoComponents/style/index.js +4 -0
- package/lib/layout/components/FooterToolbar/index.d.ts +1 -1
- package/lib/layout/components/FooterToolbar/index.js +2 -6
- package/lib/layout/components/GlobalFooter/index.js +3 -3
- package/lib/layout/components/GlobalHeader/ActionsContent.js +6 -7
- package/lib/layout/components/GlobalHeader/index.js +1 -1
- package/lib/layout/components/GridContent/index.js +1 -1
- package/lib/layout/components/Header/index.js +1 -3
- package/lib/layout/components/Help/ProHelpPanel.js +11 -10
- package/lib/layout/components/PageContainer/index.js +9 -10
- package/lib/layout/components/PageContainer/style/index.js +4 -0
- package/lib/layout/components/PageHeader/index.js +10 -10
- package/lib/layout/components/SettingDrawer/BlockCheckbox.js +2 -3
- package/lib/layout/components/SettingDrawer/LayoutChange.js +3 -2
- package/lib/layout/components/SettingDrawer/RegionalChange.js +3 -2
- package/lib/layout/components/SettingDrawer/ThemeColor.js +3 -2
- package/lib/layout/components/SettingDrawer/index.js +5 -5
- package/lib/layout/components/SettingDrawer/style/index.js +4 -0
- package/lib/layout/components/SiderMenu/BaseMenu.js +5 -9
- package/lib/layout/components/SiderMenu/SiderMenu.js +6 -8
- package/lib/layout/components/SiderMenu/index.js +0 -1
- package/lib/layout/components/TopNavHeader/index.js +4 -5
- package/lib/layout/style/index.js +4 -0
- package/lib/layout/utils/getBreadcrumbProps.js +1 -1
- package/lib/layout/utils/getMenuData.js +0 -1
- package/lib/list/Item.d.ts +4 -7
- package/lib/list/Item.js +81 -103
- package/lib/list/ListView.d.ts +6 -4
- package/lib/list/ListView.js +41 -54
- package/lib/list/ProListBase.d.ts +74 -0
- package/lib/list/ProListBase.js +365 -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 +227 -86
- package/lib/provider/index.d.ts +2 -2
- 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 +17 -17
- package/lib/table/components/Alert/index.js +6 -5
- package/lib/table/components/ColumnSetting/index.js +9 -10
- package/lib/table/components/DragSortTable/index.js +8 -4
- package/lib/table/components/EditableTable/index.d.ts +1 -1
- package/lib/table/components/EditableTable/index.js +6 -8
- package/lib/table/components/ListToolBar/HeaderMenu.d.ts +1 -0
- package/lib/table/components/ListToolBar/HeaderMenu.js +4 -3
- package/lib/table/components/ListToolBar/index.d.ts +1 -1
- package/lib/table/components/ListToolBar/index.js +18 -21
- package/lib/table/components/ListToolBar/style.js +3 -3
- 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 +4 -4
- package/lib/table/utils/cellRenderToFromItem.js +2 -4
- package/lib/table/utils/index.js +0 -1
- package/lib/table/utils/useDragSort.js +1 -1
- package/lib/utils/components/DropdownFooter/index.d.ts +1 -1
- package/lib/utils/components/FieldLabel/index.js +1 -1
- package/lib/utils/components/FilterDropdown/index.d.ts +1 -1
- package/lib/utils/components/FilterDropdown/index.js +1 -1
- package/lib/utils/components/InlineErrorFormItem/index.js +5 -4
- package/lib/utils/components/LabelIconTip/index.d.ts +3 -4
- package/lib/utils/components/LabelIconTip/index.js +2 -2
- 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/hooks/useFetchData/index.js +0 -2
- package/lib/utils/index.d.ts +2 -1
- package/lib/utils/isDeepEqualReact/index.js +0 -8
- package/lib/utils/isUrl/index.js +1 -1
- 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.d.ts +2 -2
- package/lib/utils/proFieldParsingText/index.js +3 -5
- 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 +32 -32
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(() => {
|
|
@@ -723,21 +716,28 @@ const ProTable = props => {
|
|
|
723
716
|
hideToolbar,
|
|
724
717
|
toolbarDom
|
|
725
718
|
});
|
|
726
|
-
|
|
719
|
+
|
|
720
|
+
/** ProTable:有搜索/工具栏/标题时使用卡片包裹;可编辑表格(name)不包裹 */
|
|
721
|
+
/** ProList:始终使用卡片包裹(除非 cardProps 为 false) */
|
|
722
|
+
const useCard = useMemo(() => {
|
|
723
|
+
const useCardForTable = cardProps !== false && !props.name && !notNeedCardDom;
|
|
724
|
+
const useCardForList = cardProps !== false && type === 'list';
|
|
725
|
+
return useCardForTable || useCardForList;
|
|
726
|
+
}, [cardProps, props.name, type, notNeedCardDom]);
|
|
727
|
+
const resolvedCardProps = cardProps === false ? {} : cardProps ?? {};
|
|
728
|
+
const tableAreaDom = useCard ? /*#__PURE__*/_jsx(ProCard, {
|
|
729
|
+
...resolvedCardProps,
|
|
727
730
|
ghost: ghost,
|
|
728
731
|
variant: isBordered('table', cardBordered) ? 'outlined' : 'borderless',
|
|
729
732
|
styles: {
|
|
730
733
|
body: {
|
|
731
734
|
...cardBodyStyle,
|
|
732
|
-
...(
|
|
735
|
+
...(resolvedCardProps.styles?.body ?? {})
|
|
733
736
|
},
|
|
734
|
-
|
|
735
|
-
header: cardProps.styles?.header || cardProps.headStyle
|
|
736
|
-
} : {})
|
|
737
|
+
header: resolvedCardProps.styles?.header
|
|
737
738
|
},
|
|
738
|
-
...cardProps,
|
|
739
739
|
children: tableContentDom
|
|
740
|
-
});
|
|
740
|
+
}) : tableContentDom;
|
|
741
741
|
const renderTable = () => {
|
|
742
742
|
if (props.tableRender) {
|
|
743
743
|
return props.tableRender(props, tableAreaDom, {
|
|
@@ -787,8 +787,8 @@ const ProviderTableContainer = props => {
|
|
|
787
787
|
columnsState: props.columnsState,
|
|
788
788
|
columns: props.columns,
|
|
789
789
|
onSizeChange: props.onSizeChange,
|
|
790
|
-
size: props.size,
|
|
791
|
-
defaultSize: props.defaultSize
|
|
790
|
+
size: props.size || undefined,
|
|
791
|
+
defaultSize: props.defaultSize || undefined
|
|
792
792
|
},
|
|
793
793
|
children: /*#__PURE__*/_jsx(ProConfigProvider, {
|
|
794
794
|
valueTypeMap: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ConfigProvider, Space } from 'antd';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
2
3
|
import React, { useContext } from 'react';
|
|
3
4
|
import { useIntl } from "../../../provider";
|
|
4
5
|
import { useStyle } from "./style";
|
|
@@ -54,16 +55,16 @@ function TableAlert({
|
|
|
54
55
|
return null;
|
|
55
56
|
}
|
|
56
57
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
57
|
-
className:
|
|
58
|
+
className: clsx(className, hashId),
|
|
58
59
|
children: /*#__PURE__*/_jsx("div", {
|
|
59
|
-
className: `${className}-container
|
|
60
|
+
className: clsx(`${className}-container`, hashId),
|
|
60
61
|
children: /*#__PURE__*/_jsxs("div", {
|
|
61
|
-
className: `${className}-info
|
|
62
|
+
className: clsx(`${className}-info`, hashId),
|
|
62
63
|
children: [/*#__PURE__*/_jsx("div", {
|
|
63
|
-
className: `${className}-info-content
|
|
64
|
+
className: clsx(`${className}-info-content`, hashId),
|
|
64
65
|
children: dom
|
|
65
66
|
}), option ? /*#__PURE__*/_jsx("div", {
|
|
66
|
-
className: `${className}-info-option
|
|
67
|
+
className: clsx(`${className}-info-option`, hashId),
|
|
67
68
|
children: option
|
|
68
69
|
}) : null]
|
|
69
70
|
})
|
|
@@ -58,7 +58,7 @@ const CheckboxListItem = ({
|
|
|
58
58
|
hashId
|
|
59
59
|
} = useContext(ProProvider);
|
|
60
60
|
const dom = /*#__PURE__*/_jsxs("span", {
|
|
61
|
-
className: `${className}-list-item-option
|
|
61
|
+
className: clsx(`${className}-list-item-option`, hashId),
|
|
62
62
|
children: [/*#__PURE__*/_jsx(ToolTipIcon, {
|
|
63
63
|
columnKey: columnKey,
|
|
64
64
|
fixed: "left",
|
|
@@ -80,9 +80,9 @@ const CheckboxListItem = ({
|
|
|
80
80
|
})]
|
|
81
81
|
});
|
|
82
82
|
return /*#__PURE__*/_jsxs("span", {
|
|
83
|
-
className: `${className}-list-item
|
|
83
|
+
className: clsx(`${className}-list-item`, hashId),
|
|
84
84
|
children: [/*#__PURE__*/_jsx("div", {
|
|
85
|
-
className: `${className}-list-item-title
|
|
85
|
+
className: clsx(`${className}-list-item-title`, hashId),
|
|
86
86
|
children: title
|
|
87
87
|
}), showListItemOption && !isLeaf ? dom : null]
|
|
88
88
|
}, columnKey);
|
|
@@ -113,7 +113,7 @@ const CheckboxList = ({
|
|
|
113
113
|
const treeMap = new Map();
|
|
114
114
|
const loopData = (data, parentConfig) => data.map(({
|
|
115
115
|
key,
|
|
116
|
-
dataIndex,
|
|
116
|
+
dataIndex: _dataIndex,
|
|
117
117
|
children,
|
|
118
118
|
...rest
|
|
119
119
|
}) => {
|
|
@@ -261,13 +261,13 @@ const CheckboxList = ({
|
|
|
261
261
|
},
|
|
262
262
|
height: listHeight,
|
|
263
263
|
treeData: treeDataConfig.list?.map(({
|
|
264
|
-
disabled /* 不透传 disabled,使子节点禁用时也可以拖动调整顺序 */,
|
|
264
|
+
disabled: _disabled /* 不透传 disabled,使子节点禁用时也可以拖动调整顺序 */,
|
|
265
265
|
...config
|
|
266
266
|
}) => config)
|
|
267
267
|
});
|
|
268
268
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
269
269
|
children: [showTitle && /*#__PURE__*/_jsx("span", {
|
|
270
|
-
className: `${className}-list-title
|
|
270
|
+
className: clsx(`${className}-list-title`, hashId),
|
|
271
271
|
children: listTitle
|
|
272
272
|
}), listDom]
|
|
273
273
|
});
|
|
@@ -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
|
/**
|
|
@@ -425,7 +424,7 @@ function ColumnSetting(props) {
|
|
|
425
424
|
return wrapSSR( /*#__PURE__*/_jsx(Popover, {
|
|
426
425
|
arrow: false,
|
|
427
426
|
title: /*#__PURE__*/_jsxs("div", {
|
|
428
|
-
className: `${className}-title
|
|
427
|
+
className: clsx(`${className}-title`, hashId),
|
|
429
428
|
children: [props.checkable === false ? /*#__PURE__*/_jsx("div", {}) : /*#__PURE__*/_jsx(Checkbox, {
|
|
430
429
|
indeterminate: indeterminate,
|
|
431
430
|
checked: unCheckedKeys.length === 0 && unCheckedKeys.length !== localColumns.length,
|
|
@@ -435,7 +434,7 @@ function ColumnSetting(props) {
|
|
|
435
434
|
children: intl.getMessage('tableToolBar.columnDisplay', '列展示')
|
|
436
435
|
}), checkedReset ? /*#__PURE__*/_jsx("a", {
|
|
437
436
|
onClick: clearClick,
|
|
438
|
-
className: `${className}-action-rest-button
|
|
437
|
+
className: clsx(`${className}-action-rest-button`, hashId),
|
|
439
438
|
children: intl.getMessage('tableToolBar.reset', '重置')
|
|
440
439
|
}) : null, props?.extra ? /*#__PURE__*/_jsx(Space, {
|
|
441
440
|
size: 12,
|
|
@@ -444,7 +443,7 @@ function ColumnSetting(props) {
|
|
|
444
443
|
}) : null]
|
|
445
444
|
}),
|
|
446
445
|
classNames: {
|
|
447
|
-
root: `${className}-overlay
|
|
446
|
+
root: clsx(`${className}-overlay`, hashId)
|
|
448
447
|
},
|
|
449
448
|
trigger: "click",
|
|
450
449
|
placement: "bottomRight",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HolderOutlined } from '@ant-design/icons';
|
|
2
2
|
import { useControlledState } from '@rc-component/util';
|
|
3
3
|
import { ConfigProvider } from 'antd';
|
|
4
|
+
import { clsx } from 'clsx';
|
|
4
5
|
import React, { useCallback, useContext, useMemo } from 'react';
|
|
5
6
|
import ProTable from "../../Table";
|
|
6
7
|
import { useDragSort } from "../../utils/useDragSort";
|
|
@@ -25,7 +26,10 @@ function DragSortTable(props) {
|
|
|
25
26
|
const setDataSource = useCallback(updater => {
|
|
26
27
|
setDataSourceInner(prev => {
|
|
27
28
|
const next = typeof updater === 'function' ? updater(prev) : updater;
|
|
28
|
-
|
|
29
|
+
// 使用 queueMicrotask 延迟回调,避免在渲染期间更新其他组件状态
|
|
30
|
+
queueMicrotask(() => {
|
|
31
|
+
onDataSourceChange?.(next);
|
|
32
|
+
});
|
|
29
33
|
return next;
|
|
30
34
|
});
|
|
31
35
|
}, [onDataSourceChange]);
|
|
@@ -38,14 +42,14 @@ function DragSortTable(props) {
|
|
|
38
42
|
const DragHandle = useMemo(() => {
|
|
39
43
|
return dragHandleProps => {
|
|
40
44
|
const {
|
|
41
|
-
rowData,
|
|
42
|
-
index,
|
|
45
|
+
rowData: _rowData,
|
|
46
|
+
index: _index,
|
|
43
47
|
className,
|
|
44
48
|
...rest
|
|
45
49
|
} = dragHandleProps;
|
|
46
50
|
const defaultDom = /*#__PURE__*/_jsx(HolderOutlined, {
|
|
47
51
|
...rest,
|
|
48
|
-
className:
|
|
52
|
+
className: clsx(getPrefixCls('pro-table-drag-icon'), className, hashId)
|
|
49
53
|
});
|
|
50
54
|
const handel = dragSortHandlerRender ? dragSortHandlerRender(dragHandleProps?.rowData, dragHandleProps?.index) : defaultDom;
|
|
51
55
|
return /*#__PURE__*/_jsx("div", {
|
|
@@ -86,7 +86,7 @@ export type EditableProTableProps<T, U extends ParamsType, ValueType = 'text'> =
|
|
|
86
86
|
declare function FieldEditableTable<DataType extends Record<string, any>, Params extends ParamsType = ParamsType, ValueType = 'text'>(props: EditableProTableProps<DataType, Params, ValueType>): import("react/jsx-runtime").JSX.Element;
|
|
87
87
|
declare namespace FieldEditableTable {
|
|
88
88
|
var RecordCreator: <T = Record<string, any>>(props: RecordCreatorProps<T> & {
|
|
89
|
-
children: JSX.Element;
|
|
89
|
+
children: React.JSX.Element;
|
|
90
90
|
}) => React.FunctionComponentElement<any>;
|
|
91
91
|
}
|
|
92
92
|
export default FieldEditableTable;
|
|
@@ -71,7 +71,7 @@ function handlePaginationInsert(baseData, defaultValue, pageConfig) {
|
|
|
71
71
|
result.splice(insertIndex, 0, defaultValue);
|
|
72
72
|
return result;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function _useEditableDataSource({
|
|
75
75
|
actionDataSource,
|
|
76
76
|
editableUtils,
|
|
77
77
|
pagination,
|
|
@@ -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) {
|
|
@@ -234,15 +233,15 @@ function EditableTable(props) {
|
|
|
234
233
|
const {
|
|
235
234
|
onTableChange,
|
|
236
235
|
maxLength,
|
|
237
|
-
formItemProps,
|
|
236
|
+
formItemProps: _formItemProps,
|
|
238
237
|
recordCreatorProps,
|
|
239
238
|
rowKey,
|
|
240
|
-
controlled,
|
|
239
|
+
controlled: _controlled,
|
|
241
240
|
defaultValue,
|
|
242
|
-
onChange,
|
|
241
|
+
onChange: _onChange,
|
|
243
242
|
editableFormRef,
|
|
244
243
|
// @ts-ignore
|
|
245
|
-
autoFocus,
|
|
244
|
+
autoFocus: _autoFocus,
|
|
246
245
|
...rest
|
|
247
246
|
} = props;
|
|
248
247
|
const preData = useRef(undefined);
|
|
@@ -534,7 +533,6 @@ function EditableTable(props) {
|
|
|
534
533
|
} = recordCreatorProps || {};
|
|
535
534
|
const isTop = position === 'top';
|
|
536
535
|
const {
|
|
537
|
-
creatorButtonDom,
|
|
538
536
|
buttonRenderProps
|
|
539
537
|
} = useCreatorButton({
|
|
540
538
|
recordCreatorProps,
|
|
@@ -683,7 +681,7 @@ function FieldEditableTable(props) {
|
|
|
683
681
|
const name = [props.name].flat(1);
|
|
684
682
|
try {
|
|
685
683
|
return JSON.stringify(get(prev, name)) !== JSON.stringify(get(next, name));
|
|
686
|
-
} catch (
|
|
684
|
+
} catch (_error) {
|
|
687
685
|
return true;
|
|
688
686
|
}
|
|
689
687
|
},
|
|
@@ -11,6 +11,7 @@ export type ListToolBarHeaderMenuProps = {
|
|
|
11
11
|
items?: ListToolBarMenuItem[];
|
|
12
12
|
onChange?: (activeKey?: React.Key) => void;
|
|
13
13
|
prefixCls?: string;
|
|
14
|
+
hashId?: string;
|
|
14
15
|
};
|
|
15
16
|
declare const HeaderMenu: React.FC<ListToolBarHeaderMenuProps>;
|
|
16
17
|
export default HeaderMenu;
|
|
@@ -8,8 +8,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
8
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
const HeaderMenu = props => {
|
|
10
10
|
const {
|
|
11
|
-
hashId
|
|
11
|
+
hashId: contextHashId
|
|
12
12
|
} = useContext(ProProvider);
|
|
13
|
+
const hashId = props.hashId ?? contextHashId;
|
|
13
14
|
const {
|
|
14
15
|
items = [],
|
|
15
16
|
type = 'inline',
|
|
@@ -54,7 +55,7 @@ const HeaderMenu = props => {
|
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
return /*#__PURE__*/_jsx("div", {
|
|
57
|
-
className: clsx(`${prefixCls}-menu`, `${prefixCls}-dropdownmenu
|
|
58
|
+
className: clsx(`${prefixCls}-menu`, `${prefixCls}-dropdownmenu`, hashId),
|
|
58
59
|
children: /*#__PURE__*/_jsx(Dropdown, {
|
|
59
60
|
trigger: ['click'],
|
|
60
61
|
menu: {
|
|
@@ -69,7 +70,7 @@ const HeaderMenu = props => {
|
|
|
69
70
|
}))
|
|
70
71
|
},
|
|
71
72
|
children: /*#__PURE__*/_jsxs(Space, {
|
|
72
|
-
className: `${prefixCls}-dropdownmenu-label`,
|
|
73
|
+
className: clsx(`${prefixCls}-dropdownmenu-label`, hashId),
|
|
73
74
|
children: [activeItem.label, /*#__PURE__*/_jsx(DownOutlined, {})]
|
|
74
75
|
})
|
|
75
76
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TabPaneProps } from 'antd';
|
|
2
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
3
2
|
import type { SearchProps } from 'antd/lib/input';
|
|
4
3
|
import React from 'react';
|
|
4
|
+
import type { LabelTooltipType } from '../../../utils';
|
|
5
5
|
import type { ListToolBarHeaderMenuProps } from './HeaderMenu';
|
|
6
6
|
export type ListToolBarSetting = {
|
|
7
7
|
icon: React.ReactNode;
|
|
@@ -53,13 +53,14 @@ function getSettingItem(setting) {
|
|
|
53
53
|
}
|
|
54
54
|
const ListToolBarTabBar = ({
|
|
55
55
|
prefixCls,
|
|
56
|
+
hashId,
|
|
56
57
|
tabs,
|
|
57
58
|
multipleLine,
|
|
58
59
|
filtersNode
|
|
59
60
|
}) => {
|
|
60
61
|
if (!multipleLine) return null;
|
|
61
62
|
return /*#__PURE__*/_jsx("div", {
|
|
62
|
-
className: `${prefixCls}-extra-line`,
|
|
63
|
+
className: clsx(`${prefixCls}-extra-line`, hashId),
|
|
63
64
|
children: tabs?.items && tabs?.items.length ? /*#__PURE__*/_jsx(Tabs, {
|
|
64
65
|
style: {
|
|
65
66
|
width: '100%'
|
|
@@ -137,7 +138,7 @@ const ListToolBar = ({
|
|
|
137
138
|
/** 轻量筛选组件 */
|
|
138
139
|
const filtersNode = useMemo(() => {
|
|
139
140
|
if (filter) return /*#__PURE__*/_jsx("div", {
|
|
140
|
-
className: `${prefixCls}-filter
|
|
141
|
+
className: clsx(`${prefixCls}-filter`, hashId),
|
|
141
142
|
children: filter
|
|
142
143
|
});
|
|
143
144
|
return null;
|
|
@@ -162,13 +163,11 @@ const ListToolBar = ({
|
|
|
162
163
|
},
|
|
163
164
|
children: actions.map((action, index) => {
|
|
164
165
|
if (! /*#__PURE__*/React.isValidElement(action)) {
|
|
165
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
166
166
|
return /*#__PURE__*/_jsx(React.Fragment, {
|
|
167
167
|
children: action
|
|
168
168
|
}, index);
|
|
169
169
|
}
|
|
170
170
|
return /*#__PURE__*/React.cloneElement(action, {
|
|
171
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
172
171
|
key: index,
|
|
173
172
|
...action?.props
|
|
174
173
|
});
|
|
@@ -183,16 +182,16 @@ const ListToolBar = ({
|
|
|
183
182
|
// 保留dom是为了占位,不然 right 就变到左边了
|
|
184
183
|
if (!hasLeft && hasRight) {
|
|
185
184
|
return /*#__PURE__*/_jsx("div", {
|
|
186
|
-
className: `${prefixCls}-left
|
|
185
|
+
className: clsx(`${prefixCls}-left`, hashId)
|
|
187
186
|
});
|
|
188
187
|
}
|
|
189
188
|
|
|
190
189
|
// 减少 space 的dom,渲染的时候能节省点性能
|
|
191
190
|
if (!menu && (hasTitle || !searchNode)) {
|
|
192
191
|
return /*#__PURE__*/_jsx("div", {
|
|
193
|
-
className: `${prefixCls}-left
|
|
192
|
+
className: clsx(`${prefixCls}-left`, hashId),
|
|
194
193
|
children: /*#__PURE__*/_jsx("div", {
|
|
195
|
-
className: `${prefixCls}-title
|
|
194
|
+
className: clsx(`${prefixCls}-title`, hashId),
|
|
196
195
|
children: /*#__PURE__*/_jsx(LabelIconTip, {
|
|
197
196
|
tooltip: tooltip,
|
|
198
197
|
label: title,
|
|
@@ -208,7 +207,7 @@ const ListToolBar = ({
|
|
|
208
207
|
[`${prefixCls}-left-has-inline-menu`]: menu?.type === 'inline'
|
|
209
208
|
}),
|
|
210
209
|
children: [hasTitle && !menu && /*#__PURE__*/_jsx("div", {
|
|
211
|
-
className: `${prefixCls}-title
|
|
210
|
+
className: clsx(`${prefixCls}-title`, hashId),
|
|
212
211
|
children: /*#__PURE__*/_jsx(LabelIconTip, {
|
|
213
212
|
tooltip: tooltip,
|
|
214
213
|
label: title,
|
|
@@ -219,9 +218,10 @@ const ListToolBar = ({
|
|
|
219
218
|
// 这里面实现了 tabs 的逻辑
|
|
220
219
|
_jsx(HeaderMenu, {
|
|
221
220
|
...menu,
|
|
222
|
-
prefixCls: prefixCls
|
|
221
|
+
prefixCls: prefixCls,
|
|
222
|
+
hashId: hashId
|
|
223
223
|
}), !hasTitle && searchNode ? /*#__PURE__*/_jsx("div", {
|
|
224
|
-
className: `${prefixCls}-search
|
|
224
|
+
className: clsx(`${prefixCls}-search`, hashId),
|
|
225
225
|
children: searchNode
|
|
226
226
|
}) : null]
|
|
227
227
|
});
|
|
@@ -229,25 +229,21 @@ const ListToolBar = ({
|
|
|
229
229
|
const rightTitleDom = useMemo(() => {
|
|
230
230
|
if (!hasRight) return null;
|
|
231
231
|
return /*#__PURE__*/_jsxs("div", {
|
|
232
|
-
className: `${prefixCls}-right
|
|
232
|
+
className: clsx(`${prefixCls}-right`, hashId),
|
|
233
233
|
style: isMobile ? {} : {
|
|
234
234
|
alignItems: 'center'
|
|
235
235
|
},
|
|
236
236
|
children: [!multipleLine ? filtersNode : null, hasTitle && searchNode ? /*#__PURE__*/_jsx("div", {
|
|
237
|
-
className: `${prefixCls}-search
|
|
237
|
+
className: clsx(`${prefixCls}-search`, hashId),
|
|
238
238
|
children: searchNode
|
|
239
239
|
}) : null, actionDom, settings?.length ? /*#__PURE__*/_jsx("div", {
|
|
240
|
-
className: `${prefixCls}-setting-items
|
|
240
|
+
className: clsx(`${prefixCls}-setting-items`, hashId),
|
|
241
241
|
children: settings.map((setting, index) => {
|
|
242
242
|
const settingItem = getSettingItem(setting);
|
|
243
|
-
return (
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
className: `${prefixCls}-setting-item ${hashId}`.trim(),
|
|
248
|
-
children: settingItem
|
|
249
|
-
}, index)
|
|
250
|
-
);
|
|
243
|
+
return /*#__PURE__*/_jsx("div", {
|
|
244
|
+
className: clsx(`${prefixCls}-setting-item`, hashId),
|
|
245
|
+
children: settingItem
|
|
246
|
+
}, index);
|
|
251
247
|
})
|
|
252
248
|
}) : null]
|
|
253
249
|
});
|
|
@@ -274,6 +270,7 @@ const ListToolBar = ({
|
|
|
274
270
|
className: clsx(prefixCls, hashId, className),
|
|
275
271
|
children: [titleNode, /*#__PURE__*/_jsx(ListToolBarTabBar, {
|
|
276
272
|
filtersNode: filtersNode,
|
|
273
|
+
hashId: hashId,
|
|
277
274
|
prefixCls: prefixCls,
|
|
278
275
|
tabs: tabs,
|
|
279
276
|
multipleLine: multipleLine
|
|
@@ -8,7 +8,7 @@ const genProListStyle = token => {
|
|
|
8
8
|
display: 'flex',
|
|
9
9
|
justifyContent: 'space-between',
|
|
10
10
|
paddingBlock: token.padding,
|
|
11
|
-
paddingInline:
|
|
11
|
+
paddingInline: token.paddingXS,
|
|
12
12
|
'&-mobile': {
|
|
13
13
|
flexDirection: 'column'
|
|
14
14
|
}
|
|
@@ -18,7 +18,7 @@ const genProListStyle = token => {
|
|
|
18
18
|
alignItems: 'center',
|
|
19
19
|
justifyContent: 'flex-start',
|
|
20
20
|
color: token.colorTextHeading,
|
|
21
|
-
fontWeight:
|
|
21
|
+
fontWeight: token.fontWeightStrong,
|
|
22
22
|
fontSize: token.fontSizeLG
|
|
23
23
|
},
|
|
24
24
|
'&-search:not(:last-child)': {
|
|
@@ -101,7 +101,7 @@ const genProListStyle = token => {
|
|
|
101
101
|
},
|
|
102
102
|
[`${token.antCls}-tabs-nav-list`]: {
|
|
103
103
|
marginBlockStart: 0,
|
|
104
|
-
|
|
104
|
+
[`${token.antCls}-tabs-tab`]: {
|
|
105
105
|
paddingBlockStart: 0
|
|
106
106
|
}
|
|
107
107
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TableColumnType } from 'antd';
|
|
2
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import type { LabelTooltipType } from '../../../utils';
|
|
4
4
|
import type { ActionType, OptionSearchProps, ProTableProps } from '../../typing';
|
|
5
5
|
import type { ListToolBarProps } from '../ListToolBar';
|
|
6
6
|
export type SettingOptionType = {
|
package/es/table/style/index.js
CHANGED
|
@@ -20,6 +20,10 @@ export const turn = new Keyframes('turn', {
|
|
|
20
20
|
const genProListStyle = token => {
|
|
21
21
|
return {
|
|
22
22
|
[token.componentCls]: {
|
|
23
|
+
boxSizing: 'border-box',
|
|
24
|
+
'*, *::before, *::after': {
|
|
25
|
+
boxSizing: 'border-box'
|
|
26
|
+
},
|
|
23
27
|
zIndex: 1,
|
|
24
28
|
[`${token.antCls}-table-wrapper ${token.antCls}-table-pagination${token.antCls}-pagination`]: {
|
|
25
29
|
marginBlockEnd: 0
|
package/es/table/typing.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { SpinProps, TableProps } from 'antd';
|
|
2
2
|
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
|
|
3
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
4
3
|
import type { NamePath } from 'antd/lib/form/interface';
|
|
5
4
|
import type { SearchProps } from 'antd/lib/input';
|
|
6
5
|
import type { ColumnFilterItem, ColumnType, CompareFn, SorterResult, SortOrder } from 'antd/lib/table/interface';
|
|
@@ -10,7 +9,7 @@ import type { CSSProperties, Key } from 'react';
|
|
|
10
9
|
import type { ProCardProps } from '../card';
|
|
11
10
|
import type { ProFieldEmptyText } from '../field';
|
|
12
11
|
import type { LightWrapperProps, ProFormProps, QueryFilterProps } from '../form';
|
|
13
|
-
import type { ProCoreActionType, ProSchema, ProSchemaComponentTypes, ProTableEditableFnType, RowEditableConfig, SearchTransformKeyFn } from '../utils';
|
|
12
|
+
import type { LabelTooltipType, ProCoreActionType, ProEllipsis, ProSchema, ProSchemaComponentTypes, ProTableEditableFnType, RowEditableConfig, SearchTransformKeyFn } from '../utils';
|
|
14
13
|
import type { AlertRenderType } from './components/Alert';
|
|
15
14
|
import type { SearchConfig, TableFormItem } from './components/Form/FormRender';
|
|
16
15
|
import type { ListToolBarProps } from './components/ListToolBar';
|
|
@@ -80,7 +79,7 @@ export type ProColumnType<T = unknown, ValueType = 'text'> = ProSchema<T, ExtraP
|
|
|
80
79
|
/** 搜索表单的默认值 */
|
|
81
80
|
initialValue?: any;
|
|
82
81
|
/** @name 是否缩略 */
|
|
83
|
-
ellipsis?:
|
|
82
|
+
ellipsis?: ProEllipsis;
|
|
84
83
|
/** @name 是否拷贝 */
|
|
85
84
|
copyable?: boolean;
|
|
86
85
|
/** 在查询表单中隐藏 */
|
|
@@ -106,8 +105,14 @@ export type ProColumnType<T = unknown, ValueType = 'text'> = ProSchema<T, ExtraP
|
|
|
106
105
|
order?: number;
|
|
107
106
|
/** @name 可编辑表格是否可编辑 */
|
|
108
107
|
editable?: boolean | ProTableEditableFnType<T>;
|
|
109
|
-
/**
|
|
110
|
-
|
|
108
|
+
/**
|
|
109
|
+
* 用于 ProList,指定该列映射到列表项的哪个插槽位置
|
|
110
|
+
*
|
|
111
|
+
* @name 列表项插槽
|
|
112
|
+
* @example listSlot: 'title'
|
|
113
|
+
* @example listSlot: 'avatar'
|
|
114
|
+
*/
|
|
115
|
+
listSlot?: 'title' | 'subTitle' | 'avatar' | 'description' | 'content' | 'actions' | 'aside' | 'type' | (string & {});
|
|
111
116
|
/** @name 只读 */
|
|
112
117
|
readonly?: boolean;
|
|
113
118
|
/** @name 列设置的 disabled */
|
package/es/table/useFetchData.js
CHANGED
|
@@ -51,7 +51,10 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
51
51
|
const setTableDataList = useCallback(updater => {
|
|
52
52
|
setTableDataListInner(prev => {
|
|
53
53
|
const next = typeof updater === 'function' ? updater(prev) : updater;
|
|
54
|
-
|
|
54
|
+
// 使用 queueMicrotask 延迟回调,避免在渲染期间更新其他组件状态
|
|
55
|
+
queueMicrotask(() => {
|
|
56
|
+
options?.onDataSourceChange?.(next);
|
|
57
|
+
});
|
|
55
58
|
return next;
|
|
56
59
|
});
|
|
57
60
|
}, [options?.onDataSourceChange]);
|
|
@@ -264,7 +267,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
264
267
|
return () => {
|
|
265
268
|
clearTimeout(pollingSetTimeRef.current);
|
|
266
269
|
};
|
|
267
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
268
270
|
}, [polling]);
|
|
269
271
|
useEffect(() => {
|
|
270
272
|
umountRef.current = false;
|
|
@@ -297,7 +299,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
297
299
|
abortFetch();
|
|
298
300
|
fetchListDebounce.run(false);
|
|
299
301
|
}
|
|
300
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
301
302
|
}, [pageInfo?.current]);
|
|
302
303
|
|
|
303
304
|
// pageSize 修改后返回第一页
|
|
@@ -307,7 +308,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
307
308
|
}
|
|
308
309
|
abortFetch();
|
|
309
310
|
fetchListDebounce.run(false);
|
|
310
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
311
311
|
}, [pageInfo?.pageSize]);
|
|
312
312
|
|
|
313
313
|
/**
|
|
@@ -60,9 +60,7 @@ const CellRenderFromItem = props => {
|
|
|
60
60
|
name: formItemName,
|
|
61
61
|
...restProps,
|
|
62
62
|
children: children
|
|
63
|
-
}, key),
|
|
64
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
-
[key, formItemName]);
|
|
63
|
+
}, key), [key, formItemName]);
|
|
66
64
|
const generateFormItem = useCallback(() => {
|
|
67
65
|
const formItemProps = {
|
|
68
66
|
...getFieldPropsOrFormItemProps(columnProps?.formItemProps, ...needProps)
|
|
@@ -121,7 +119,7 @@ const CellRenderFromItem = props => {
|
|
|
121
119
|
const shouldName = [rowName].flat(1);
|
|
122
120
|
try {
|
|
123
121
|
return JSON.stringify(get(pre, shouldName)) !== JSON.stringify(get(next, shouldName));
|
|
124
|
-
} catch (
|
|
122
|
+
} catch (_error) {
|
|
125
123
|
return true;
|
|
126
124
|
}
|
|
127
125
|
},
|
package/es/table/utils/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
type LightFilterFooterRender = ((onConfirm?: (e?: React.MouseEvent) => void, onClear?: (e?: React.MouseEvent) => void) => JSX.Element | false) | false;
|
|
2
|
+
type LightFilterFooterRender = ((onConfirm?: (e?: React.MouseEvent) => void, onClear?: (e?: React.MouseEvent) => void) => React.JSX.Element | false) | false;
|
|
3
3
|
type OnClick = (e?: React.MouseEvent) => void;
|
|
4
4
|
export type DropdownFooterProps = {
|
|
5
5
|
onClear?: OnClick;
|
|
@@ -2,7 +2,7 @@ import type { PopoverProps } from 'antd';
|
|
|
2
2
|
import type { TooltipPlacement } from 'antd/lib/tooltip';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import type { DropdownFooterProps } from '../DropdownFooter';
|
|
5
|
-
export type FooterRender = ((onConfirm?: (e?: React.MouseEvent) => void, onClear?: (e?: React.MouseEvent) => void) => JSX.Element | false) | false;
|
|
5
|
+
export type FooterRender = ((onConfirm?: (e?: React.MouseEvent) => void, onClear?: (e?: React.MouseEvent) => void) => React.JSX.Element | false) | false;
|
|
6
6
|
export type DropdownProps = {
|
|
7
7
|
label?: React.ReactNode;
|
|
8
8
|
footer?: DropdownFooterProps;
|