@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/lib/table/Table.js
CHANGED
|
@@ -310,8 +310,6 @@ const ProTable = props => {
|
|
|
310
310
|
...(formSearchRef.current || {}),
|
|
311
311
|
...params
|
|
312
312
|
};
|
|
313
|
-
|
|
314
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
315
313
|
delete actionParams._timestamp;
|
|
316
314
|
const response = await request(actionParams, proSort, proFilter);
|
|
317
315
|
return response;
|
|
@@ -355,7 +353,6 @@ const ProTable = props => {
|
|
|
355
353
|
};
|
|
356
354
|
document.addEventListener('visibilitychange', visibilitychange);
|
|
357
355
|
return () => document.removeEventListener('visibilitychange', visibilitychange);
|
|
358
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
359
356
|
}, []);
|
|
360
357
|
|
|
361
358
|
/** SelectedRowKeys受控处理selectRows */
|
|
@@ -403,7 +400,6 @@ const ProTable = props => {
|
|
|
403
400
|
current: 1
|
|
404
401
|
});
|
|
405
402
|
}
|
|
406
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
407
403
|
}, [params]);
|
|
408
404
|
|
|
409
405
|
// 设置 name 到 store 中,里面用了 ref ,所以不用担心直接 set
|
|
@@ -514,10 +510,7 @@ const ProTable = props => {
|
|
|
514
510
|
columns: propsColumns,
|
|
515
511
|
context: columnContext
|
|
516
512
|
}).sort((0, _columnSort.columnSort)(counter.columnsMap ?? {}));
|
|
517
|
-
|
|
518
|
-
}, [propsColumns, counter?.sortKeyColumns, counter?.columnsMap, columnEmptyText, type,
|
|
519
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
520
|
-
editableUtils.editableKeys && editableUtils.editableKeys.join(','), proFilter, proSort]);
|
|
513
|
+
}, [propsColumns, counter?.sortKeyColumns, counter?.columnsMap, columnEmptyText, type, editableUtils.editableKeys && editableUtils.editableKeys.join(','), proFilter, proSort]);
|
|
521
514
|
|
|
522
515
|
/** Table Column 变化的时候更新一下,这个参数将会用于渲染 */
|
|
523
516
|
(0, _utils.useDeepCompareEffectDebounce)(() => {
|
|
@@ -728,21 +721,28 @@ const ProTable = props => {
|
|
|
728
721
|
hideToolbar,
|
|
729
722
|
toolbarDom
|
|
730
723
|
});
|
|
731
|
-
|
|
724
|
+
|
|
725
|
+
/** ProTable:有搜索/工具栏/标题时使用卡片包裹;可编辑表格(name)不包裹 */
|
|
726
|
+
/** ProList:始终使用卡片包裹(除非 cardProps 为 false) */
|
|
727
|
+
const useCard = (0, _react.useMemo)(() => {
|
|
728
|
+
const useCardForTable = cardProps !== false && !props.name && !notNeedCardDom;
|
|
729
|
+
const useCardForList = cardProps !== false && type === 'list';
|
|
730
|
+
return useCardForTable || useCardForList;
|
|
731
|
+
}, [cardProps, props.name, type, notNeedCardDom]);
|
|
732
|
+
const resolvedCardProps = cardProps === false ? {} : cardProps ?? {};
|
|
733
|
+
const tableAreaDom = useCard ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_card.default, {
|
|
734
|
+
...resolvedCardProps,
|
|
732
735
|
ghost: ghost,
|
|
733
736
|
variant: (0, _utils2.isBordered)('table', cardBordered) ? 'outlined' : 'borderless',
|
|
734
737
|
styles: {
|
|
735
738
|
body: {
|
|
736
739
|
...cardBodyStyle,
|
|
737
|
-
...(
|
|
740
|
+
...(resolvedCardProps.styles?.body ?? {})
|
|
738
741
|
},
|
|
739
|
-
|
|
740
|
-
header: cardProps.styles?.header || cardProps.headStyle
|
|
741
|
-
} : {})
|
|
742
|
+
header: resolvedCardProps.styles?.header
|
|
742
743
|
},
|
|
743
|
-
...cardProps,
|
|
744
744
|
children: tableContentDom
|
|
745
|
-
});
|
|
745
|
+
}) : tableContentDom;
|
|
746
746
|
const renderTable = () => {
|
|
747
747
|
if (props.tableRender) {
|
|
748
748
|
return props.tableRender(props, tableAreaDom, {
|
|
@@ -792,8 +792,8 @@ const ProviderTableContainer = props => {
|
|
|
792
792
|
columnsState: props.columnsState,
|
|
793
793
|
columns: props.columns,
|
|
794
794
|
onSizeChange: props.onSizeChange,
|
|
795
|
-
size: props.size,
|
|
796
|
-
defaultSize: props.defaultSize
|
|
795
|
+
size: props.size || undefined,
|
|
796
|
+
defaultSize: props.defaultSize || undefined
|
|
797
797
|
},
|
|
798
798
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_provider.ProConfigProvider, {
|
|
799
799
|
valueTypeMap: {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _antd = require("antd");
|
|
9
|
+
var _clsx = require("clsx");
|
|
9
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
11
|
var _provider = require("../../../provider");
|
|
11
12
|
var _style = require("./style");
|
|
@@ -60,16 +61,16 @@ function TableAlert({
|
|
|
60
61
|
return null;
|
|
61
62
|
}
|
|
62
63
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
63
|
-
className:
|
|
64
|
+
className: (0, _clsx.clsx)(className, hashId),
|
|
64
65
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
65
|
-
className: `${className}-container
|
|
66
|
+
className: (0, _clsx.clsx)(`${className}-container`, hashId),
|
|
66
67
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
67
|
-
className: `${className}-info
|
|
68
|
+
className: (0, _clsx.clsx)(`${className}-info`, hashId),
|
|
68
69
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
69
|
-
className: `${className}-info-content
|
|
70
|
+
className: (0, _clsx.clsx)(`${className}-info-content`, hashId),
|
|
70
71
|
children: dom
|
|
71
72
|
}), option ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
72
|
-
className: `${className}-info-option
|
|
73
|
+
className: (0, _clsx.clsx)(`${className}-info-option`, hashId),
|
|
73
74
|
children: option
|
|
74
75
|
}) : null]
|
|
75
76
|
})
|
|
@@ -63,7 +63,7 @@ const CheckboxListItem = ({
|
|
|
63
63
|
hashId
|
|
64
64
|
} = (0, _react.useContext)(_provider.ProProvider);
|
|
65
65
|
const dom = /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
66
|
-
className: `${className}-list-item-option
|
|
66
|
+
className: (0, _clsx.clsx)(`${className}-list-item-option`, hashId),
|
|
67
67
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ToolTipIcon, {
|
|
68
68
|
columnKey: columnKey,
|
|
69
69
|
fixed: "left",
|
|
@@ -85,9 +85,9 @@ const CheckboxListItem = ({
|
|
|
85
85
|
})]
|
|
86
86
|
});
|
|
87
87
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
88
|
-
className: `${className}-list-item
|
|
88
|
+
className: (0, _clsx.clsx)(`${className}-list-item`, hashId),
|
|
89
89
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
90
|
-
className: `${className}-list-item-title
|
|
90
|
+
className: (0, _clsx.clsx)(`${className}-list-item-title`, hashId),
|
|
91
91
|
children: title
|
|
92
92
|
}), showListItemOption && !isLeaf ? dom : null]
|
|
93
93
|
}, columnKey);
|
|
@@ -118,7 +118,7 @@ const CheckboxList = ({
|
|
|
118
118
|
const treeMap = new Map();
|
|
119
119
|
const loopData = (data, parentConfig) => data.map(({
|
|
120
120
|
key,
|
|
121
|
-
dataIndex,
|
|
121
|
+
dataIndex: _dataIndex,
|
|
122
122
|
children,
|
|
123
123
|
...rest
|
|
124
124
|
}) => {
|
|
@@ -266,13 +266,13 @@ const CheckboxList = ({
|
|
|
266
266
|
},
|
|
267
267
|
height: listHeight,
|
|
268
268
|
treeData: treeDataConfig.list?.map(({
|
|
269
|
-
disabled /* 不透传 disabled,使子节点禁用时也可以拖动调整顺序 */,
|
|
269
|
+
disabled: _disabled /* 不透传 disabled,使子节点禁用时也可以拖动调整顺序 */,
|
|
270
270
|
...config
|
|
271
271
|
}) => config)
|
|
272
272
|
});
|
|
273
273
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
274
274
|
children: [showTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
275
|
-
className: `${className}-list-title
|
|
275
|
+
className: (0, _clsx.clsx)(`${className}-list-title`, hashId),
|
|
276
276
|
children: listTitle
|
|
277
277
|
}), listDom]
|
|
278
278
|
});
|
|
@@ -361,7 +361,6 @@ function ColumnSetting(props) {
|
|
|
361
361
|
if (counter.propsRef.current?.columnsState?.value) {
|
|
362
362
|
columnRef.current = JSON.parse(JSON.stringify(counter.propsRef.current?.columnsState?.value || {}));
|
|
363
363
|
}
|
|
364
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
365
364
|
}, []);
|
|
366
365
|
|
|
367
366
|
/**
|
|
@@ -430,7 +429,7 @@ function ColumnSetting(props) {
|
|
|
430
429
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Popover, {
|
|
431
430
|
arrow: false,
|
|
432
431
|
title: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
433
|
-
className: `${className}-title
|
|
432
|
+
className: (0, _clsx.clsx)(`${className}-title`, hashId),
|
|
434
433
|
children: [props.checkable === false ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Checkbox, {
|
|
435
434
|
indeterminate: indeterminate,
|
|
436
435
|
checked: unCheckedKeys.length === 0 && unCheckedKeys.length !== localColumns.length,
|
|
@@ -440,7 +439,7 @@ function ColumnSetting(props) {
|
|
|
440
439
|
children: intl.getMessage('tableToolBar.columnDisplay', '列展示')
|
|
441
440
|
}), checkedReset ? /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
442
441
|
onClick: clearClick,
|
|
443
|
-
className: `${className}-action-rest-button
|
|
442
|
+
className: (0, _clsx.clsx)(`${className}-action-rest-button`, hashId),
|
|
444
443
|
children: intl.getMessage('tableToolBar.reset', '重置')
|
|
445
444
|
}) : null, props?.extra ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
446
445
|
size: 12,
|
|
@@ -449,7 +448,7 @@ function ColumnSetting(props) {
|
|
|
449
448
|
}) : null]
|
|
450
449
|
}),
|
|
451
450
|
classNames: {
|
|
452
|
-
root: `${className}-overlay
|
|
451
|
+
root: (0, _clsx.clsx)(`${className}-overlay`, hashId)
|
|
453
452
|
},
|
|
454
453
|
trigger: "click",
|
|
455
454
|
placement: "bottomRight",
|
|
@@ -9,6 +9,7 @@ exports.default = void 0;
|
|
|
9
9
|
var _icons = require("@ant-design/icons");
|
|
10
10
|
var _util = require("@rc-component/util");
|
|
11
11
|
var _antd = require("antd");
|
|
12
|
+
var _clsx = require("clsx");
|
|
12
13
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
14
|
var _Table = _interopRequireDefault(require("../../Table"));
|
|
14
15
|
var _useDragSort = require("../../utils/useDragSort");
|
|
@@ -33,7 +34,10 @@ function DragSortTable(props) {
|
|
|
33
34
|
const setDataSource = (0, _react.useCallback)(updater => {
|
|
34
35
|
setDataSourceInner(prev => {
|
|
35
36
|
const next = typeof updater === 'function' ? updater(prev) : updater;
|
|
36
|
-
|
|
37
|
+
// 使用 queueMicrotask 延迟回调,避免在渲染期间更新其他组件状态
|
|
38
|
+
queueMicrotask(() => {
|
|
39
|
+
onDataSourceChange?.(next);
|
|
40
|
+
});
|
|
37
41
|
return next;
|
|
38
42
|
});
|
|
39
43
|
}, [onDataSourceChange]);
|
|
@@ -46,14 +50,14 @@ function DragSortTable(props) {
|
|
|
46
50
|
const DragHandle = (0, _react.useMemo)(() => {
|
|
47
51
|
return dragHandleProps => {
|
|
48
52
|
const {
|
|
49
|
-
rowData,
|
|
50
|
-
index,
|
|
53
|
+
rowData: _rowData,
|
|
54
|
+
index: _index,
|
|
51
55
|
className,
|
|
52
56
|
...rest
|
|
53
57
|
} = dragHandleProps;
|
|
54
58
|
const defaultDom = /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.HolderOutlined, {
|
|
55
59
|
...rest,
|
|
56
|
-
className:
|
|
60
|
+
className: (0, _clsx.clsx)(getPrefixCls('pro-table-drag-icon'), className, hashId)
|
|
57
61
|
});
|
|
58
62
|
const handel = dragSortHandlerRender ? dragSortHandlerRender(dragHandleProps?.rowData, dragHandleProps?.index) : defaultDom;
|
|
59
63
|
return /*#__PURE__*/(0, _jsxRuntime.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;
|
|
@@ -77,7 +77,7 @@ function handlePaginationInsert(baseData, defaultValue, pageConfig) {
|
|
|
77
77
|
result.splice(insertIndex, 0, defaultValue);
|
|
78
78
|
return result;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function _useEditableDataSource({
|
|
81
81
|
actionDataSource,
|
|
82
82
|
editableUtils,
|
|
83
83
|
pagination,
|
|
@@ -216,7 +216,6 @@ function useCreatorButton({
|
|
|
216
216
|
return false;
|
|
217
217
|
}
|
|
218
218
|
return createButtonDom(recordCreatorProps, value, intl);
|
|
219
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
220
219
|
}, [maxLength, recordCreatorProps, value?.length, intl]);
|
|
221
220
|
const buttonRenderProps = (0, _react.useMemo)(() => {
|
|
222
221
|
if (!creatorButtonDom) {
|
|
@@ -240,15 +239,15 @@ function EditableTable(props) {
|
|
|
240
239
|
const {
|
|
241
240
|
onTableChange,
|
|
242
241
|
maxLength,
|
|
243
|
-
formItemProps,
|
|
242
|
+
formItemProps: _formItemProps,
|
|
244
243
|
recordCreatorProps,
|
|
245
244
|
rowKey,
|
|
246
|
-
controlled,
|
|
245
|
+
controlled: _controlled,
|
|
247
246
|
defaultValue,
|
|
248
|
-
onChange,
|
|
247
|
+
onChange: _onChange,
|
|
249
248
|
editableFormRef,
|
|
250
249
|
// @ts-ignore
|
|
251
|
-
autoFocus,
|
|
250
|
+
autoFocus: _autoFocus,
|
|
252
251
|
...rest
|
|
253
252
|
} = props;
|
|
254
253
|
const preData = (0, _react.useRef)(undefined);
|
|
@@ -540,7 +539,6 @@ function EditableTable(props) {
|
|
|
540
539
|
} = recordCreatorProps || {};
|
|
541
540
|
const isTop = position === 'top';
|
|
542
541
|
const {
|
|
543
|
-
creatorButtonDom,
|
|
544
542
|
buttonRenderProps
|
|
545
543
|
} = useCreatorButton({
|
|
546
544
|
recordCreatorProps,
|
|
@@ -689,7 +687,7 @@ function FieldEditableTable(props) {
|
|
|
689
687
|
const name = [props.name].flat(1);
|
|
690
688
|
try {
|
|
691
689
|
return JSON.stringify((0, _util.get)(prev, name)) !== JSON.stringify((0, _util.get)(next, name));
|
|
692
|
-
} catch (
|
|
690
|
+
} catch (_error) {
|
|
693
691
|
return true;
|
|
694
692
|
}
|
|
695
693
|
},
|
|
@@ -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;
|
|
@@ -14,8 +14,9 @@ var _provider = require("../../../provider");
|
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
const HeaderMenu = props => {
|
|
16
16
|
const {
|
|
17
|
-
hashId
|
|
17
|
+
hashId: contextHashId
|
|
18
18
|
} = (0, _react.useContext)(_provider.ProProvider);
|
|
19
|
+
const hashId = props.hashId ?? contextHashId;
|
|
19
20
|
const {
|
|
20
21
|
items = [],
|
|
21
22
|
type = 'inline',
|
|
@@ -60,7 +61,7 @@ const HeaderMenu = props => {
|
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
63
|
-
className: (0, _clsx.clsx)(`${prefixCls}-menu`, `${prefixCls}-dropdownmenu
|
|
64
|
+
className: (0, _clsx.clsx)(`${prefixCls}-menu`, `${prefixCls}-dropdownmenu`, hashId),
|
|
64
65
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Dropdown, {
|
|
65
66
|
trigger: ['click'],
|
|
66
67
|
menu: {
|
|
@@ -75,7 +76,7 @@ const HeaderMenu = props => {
|
|
|
75
76
|
}))
|
|
76
77
|
},
|
|
77
78
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
78
|
-
className: `${prefixCls}-dropdownmenu-label`,
|
|
79
|
+
className: (0, _clsx.clsx)(`${prefixCls}-dropdownmenu-label`, hashId),
|
|
79
80
|
children: [activeItem.label, /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.DownOutlined, {})]
|
|
80
81
|
})
|
|
81
82
|
})
|
|
@@ -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;
|
|
@@ -60,13 +60,14 @@ function getSettingItem(setting) {
|
|
|
60
60
|
}
|
|
61
61
|
const ListToolBarTabBar = ({
|
|
62
62
|
prefixCls,
|
|
63
|
+
hashId,
|
|
63
64
|
tabs,
|
|
64
65
|
multipleLine,
|
|
65
66
|
filtersNode
|
|
66
67
|
}) => {
|
|
67
68
|
if (!multipleLine) return null;
|
|
68
69
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
69
|
-
className: `${prefixCls}-extra-line`,
|
|
70
|
+
className: (0, _clsx.clsx)(`${prefixCls}-extra-line`, hashId),
|
|
70
71
|
children: tabs?.items && tabs?.items.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Tabs, {
|
|
71
72
|
style: {
|
|
72
73
|
width: '100%'
|
|
@@ -144,7 +145,7 @@ const ListToolBar = ({
|
|
|
144
145
|
/** 轻量筛选组件 */
|
|
145
146
|
const filtersNode = (0, _react.useMemo)(() => {
|
|
146
147
|
if (filter) return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
147
|
-
className: `${prefixCls}-filter
|
|
148
|
+
className: (0, _clsx.clsx)(`${prefixCls}-filter`, hashId),
|
|
148
149
|
children: filter
|
|
149
150
|
});
|
|
150
151
|
return null;
|
|
@@ -169,13 +170,11 @@ const ListToolBar = ({
|
|
|
169
170
|
},
|
|
170
171
|
children: actions.map((action, index) => {
|
|
171
172
|
if (! /*#__PURE__*/_react.default.isValidElement(action)) {
|
|
172
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
173
173
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
174
174
|
children: action
|
|
175
175
|
}, index);
|
|
176
176
|
}
|
|
177
177
|
return /*#__PURE__*/_react.default.cloneElement(action, {
|
|
178
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
179
178
|
key: index,
|
|
180
179
|
...action?.props
|
|
181
180
|
});
|
|
@@ -190,16 +189,16 @@ const ListToolBar = ({
|
|
|
190
189
|
// 保留dom是为了占位,不然 right 就变到左边了
|
|
191
190
|
if (!hasLeft && hasRight) {
|
|
192
191
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
193
|
-
className: `${prefixCls}-left
|
|
192
|
+
className: (0, _clsx.clsx)(`${prefixCls}-left`, hashId)
|
|
194
193
|
});
|
|
195
194
|
}
|
|
196
195
|
|
|
197
196
|
// 减少 space 的dom,渲染的时候能节省点性能
|
|
198
197
|
if (!menu && (hasTitle || !searchNode)) {
|
|
199
198
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
200
|
-
className: `${prefixCls}-left
|
|
199
|
+
className: (0, _clsx.clsx)(`${prefixCls}-left`, hashId),
|
|
201
200
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
202
|
-
className: `${prefixCls}-title
|
|
201
|
+
className: (0, _clsx.clsx)(`${prefixCls}-title`, hashId),
|
|
203
202
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.LabelIconTip, {
|
|
204
203
|
tooltip: tooltip,
|
|
205
204
|
label: title,
|
|
@@ -215,7 +214,7 @@ const ListToolBar = ({
|
|
|
215
214
|
[`${prefixCls}-left-has-inline-menu`]: menu?.type === 'inline'
|
|
216
215
|
}),
|
|
217
216
|
children: [hasTitle && !menu && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
218
|
-
className: `${prefixCls}-title
|
|
217
|
+
className: (0, _clsx.clsx)(`${prefixCls}-title`, hashId),
|
|
219
218
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_utils.LabelIconTip, {
|
|
220
219
|
tooltip: tooltip,
|
|
221
220
|
label: title,
|
|
@@ -226,9 +225,10 @@ const ListToolBar = ({
|
|
|
226
225
|
// 这里面实现了 tabs 的逻辑
|
|
227
226
|
(0, _jsxRuntime.jsx)(_HeaderMenu.default, {
|
|
228
227
|
...menu,
|
|
229
|
-
prefixCls: prefixCls
|
|
228
|
+
prefixCls: prefixCls,
|
|
229
|
+
hashId: hashId
|
|
230
230
|
}), !hasTitle && searchNode ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
231
|
-
className: `${prefixCls}-search
|
|
231
|
+
className: (0, _clsx.clsx)(`${prefixCls}-search`, hashId),
|
|
232
232
|
children: searchNode
|
|
233
233
|
}) : null]
|
|
234
234
|
});
|
|
@@ -236,25 +236,21 @@ const ListToolBar = ({
|
|
|
236
236
|
const rightTitleDom = (0, _react.useMemo)(() => {
|
|
237
237
|
if (!hasRight) return null;
|
|
238
238
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
239
|
-
className: `${prefixCls}-right
|
|
239
|
+
className: (0, _clsx.clsx)(`${prefixCls}-right`, hashId),
|
|
240
240
|
style: isMobile ? {} : {
|
|
241
241
|
alignItems: 'center'
|
|
242
242
|
},
|
|
243
243
|
children: [!multipleLine ? filtersNode : null, hasTitle && searchNode ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
244
|
-
className: `${prefixCls}-search
|
|
244
|
+
className: (0, _clsx.clsx)(`${prefixCls}-search`, hashId),
|
|
245
245
|
children: searchNode
|
|
246
246
|
}) : null, actionDom, settings?.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
247
|
-
className: `${prefixCls}-setting-items
|
|
247
|
+
className: (0, _clsx.clsx)(`${prefixCls}-setting-items`, hashId),
|
|
248
248
|
children: settings.map((setting, index) => {
|
|
249
249
|
const settingItem = getSettingItem(setting);
|
|
250
|
-
return (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
className: `${prefixCls}-setting-item ${hashId}`.trim(),
|
|
255
|
-
children: settingItem
|
|
256
|
-
}, index)
|
|
257
|
-
);
|
|
250
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
251
|
+
className: (0, _clsx.clsx)(`${prefixCls}-setting-item`, hashId),
|
|
252
|
+
children: settingItem
|
|
253
|
+
}, index);
|
|
258
254
|
})
|
|
259
255
|
}) : null]
|
|
260
256
|
});
|
|
@@ -281,6 +277,7 @@ const ListToolBar = ({
|
|
|
281
277
|
className: (0, _clsx.clsx)(prefixCls, hashId, className),
|
|
282
278
|
children: [titleNode, /*#__PURE__*/(0, _jsxRuntime.jsx)(ListToolBarTabBar, {
|
|
283
279
|
filtersNode: filtersNode,
|
|
280
|
+
hashId: hashId,
|
|
284
281
|
prefixCls: prefixCls,
|
|
285
282
|
tabs: tabs,
|
|
286
283
|
multipleLine: multipleLine
|
|
@@ -14,7 +14,7 @@ const genProListStyle = token => {
|
|
|
14
14
|
display: 'flex',
|
|
15
15
|
justifyContent: 'space-between',
|
|
16
16
|
paddingBlock: token.padding,
|
|
17
|
-
paddingInline:
|
|
17
|
+
paddingInline: token.paddingXS,
|
|
18
18
|
'&-mobile': {
|
|
19
19
|
flexDirection: 'column'
|
|
20
20
|
}
|
|
@@ -24,7 +24,7 @@ const genProListStyle = token => {
|
|
|
24
24
|
alignItems: 'center',
|
|
25
25
|
justifyContent: 'flex-start',
|
|
26
26
|
color: token.colorTextHeading,
|
|
27
|
-
fontWeight:
|
|
27
|
+
fontWeight: token.fontWeightStrong,
|
|
28
28
|
fontSize: token.fontSizeLG
|
|
29
29
|
},
|
|
30
30
|
'&-search:not(:last-child)': {
|
|
@@ -107,7 +107,7 @@ const genProListStyle = token => {
|
|
|
107
107
|
},
|
|
108
108
|
[`${token.antCls}-tabs-nav-list`]: {
|
|
109
109
|
marginBlockStart: 0,
|
|
110
|
-
|
|
110
|
+
[`${token.antCls}-tabs-tab`]: {
|
|
111
111
|
paddingBlockStart: 0
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -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/lib/table/style/index.js
CHANGED
|
@@ -27,6 +27,10 @@ const turn = exports.turn = new _cssinjs.Keyframes('turn', {
|
|
|
27
27
|
const genProListStyle = token => {
|
|
28
28
|
return {
|
|
29
29
|
[token.componentCls]: {
|
|
30
|
+
boxSizing: 'border-box',
|
|
31
|
+
'*, *::before, *::after': {
|
|
32
|
+
boxSizing: 'border-box'
|
|
33
|
+
},
|
|
30
34
|
zIndex: 1,
|
|
31
35
|
[`${token.antCls}-table-wrapper ${token.antCls}-table-pagination${token.antCls}-pagination`]: {
|
|
32
36
|
marginBlockEnd: 0
|
package/lib/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 */
|
|
@@ -56,7 +56,10 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
56
56
|
const setTableDataList = (0, _react.useCallback)(updater => {
|
|
57
57
|
setTableDataListInner(prev => {
|
|
58
58
|
const next = typeof updater === 'function' ? updater(prev) : updater;
|
|
59
|
-
|
|
59
|
+
// 使用 queueMicrotask 延迟回调,避免在渲染期间更新其他组件状态
|
|
60
|
+
queueMicrotask(() => {
|
|
61
|
+
options?.onDataSourceChange?.(next);
|
|
62
|
+
});
|
|
60
63
|
return next;
|
|
61
64
|
});
|
|
62
65
|
}, [options?.onDataSourceChange]);
|
|
@@ -269,7 +272,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
269
272
|
return () => {
|
|
270
273
|
clearTimeout(pollingSetTimeRef.current);
|
|
271
274
|
};
|
|
272
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
273
275
|
}, [polling]);
|
|
274
276
|
(0, _react.useEffect)(() => {
|
|
275
277
|
umountRef.current = false;
|
|
@@ -302,7 +304,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
302
304
|
abortFetch();
|
|
303
305
|
fetchListDebounce.run(false);
|
|
304
306
|
}
|
|
305
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
306
307
|
}, [pageInfo?.current]);
|
|
307
308
|
|
|
308
309
|
// pageSize 修改后返回第一页
|
|
@@ -312,7 +313,6 @@ const useFetchData = (getData, defaultData, options) => {
|
|
|
312
313
|
}
|
|
313
314
|
abortFetch();
|
|
314
315
|
fetchListDebounce.run(false);
|
|
315
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
316
316
|
}, [pageInfo?.pageSize]);
|
|
317
317
|
|
|
318
318
|
/**
|
|
@@ -67,9 +67,7 @@ const CellRenderFromItem = props => {
|
|
|
67
67
|
name: formItemName,
|
|
68
68
|
...restProps,
|
|
69
69
|
children: children
|
|
70
|
-
}, key),
|
|
71
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
72
|
-
[key, formItemName]);
|
|
70
|
+
}, key), [key, formItemName]);
|
|
73
71
|
const generateFormItem = (0, _react.useCallback)(() => {
|
|
74
72
|
const formItemProps = {
|
|
75
73
|
...(0, _utils.getFieldPropsOrFormItemProps)(columnProps?.formItemProps, ...needProps)
|
|
@@ -128,7 +126,7 @@ const CellRenderFromItem = props => {
|
|
|
128
126
|
const shouldName = [rowName].flat(1);
|
|
129
127
|
try {
|
|
130
128
|
return JSON.stringify((0, _util.get)(pre, shouldName)) !== JSON.stringify((0, _util.get)(next, shouldName));
|
|
131
|
-
} catch (
|
|
129
|
+
} catch (_error) {
|
|
132
130
|
return true;
|
|
133
131
|
}
|
|
134
132
|
},
|
package/lib/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;
|
|
@@ -78,7 +78,7 @@ const FieldLabelFunction = (props, ref) => {
|
|
|
78
78
|
onClick: () => {
|
|
79
79
|
onLabelClick?.();
|
|
80
80
|
},
|
|
81
|
-
className: `${prefixCls}-text`,
|
|
81
|
+
className: (0, _clsx.clsx)(`${prefixCls}-text`, hashId),
|
|
82
82
|
children: [aLabel, ': ']
|
|
83
83
|
}) : '';
|
|
84
84
|
const str = formatterText(aValue);
|
|
@@ -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;
|