@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/card/ProCard.js
CHANGED
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import Card from "./components/Card";
|
|
2
2
|
import Divider from "./components/Divider";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
const Group = props =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const Group = props => {
|
|
5
|
+
const {
|
|
6
|
+
styles,
|
|
7
|
+
...rest
|
|
8
|
+
} = props;
|
|
9
|
+
return /*#__PURE__*/_jsx(Card, {
|
|
10
|
+
...rest,
|
|
11
|
+
styles: {
|
|
12
|
+
...styles,
|
|
13
|
+
body: {
|
|
14
|
+
...styles?.body,
|
|
15
|
+
padding: 0
|
|
16
|
+
}
|
|
8
17
|
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
});
|
|
18
|
+
});
|
|
19
|
+
};
|
|
12
20
|
|
|
13
21
|
// 当前不对底层 Card 做封装,仅挂载子组件,直接导出
|
|
14
22
|
const ProCard = Card;
|
|
@@ -14,10 +14,7 @@ const ProCardActions = props => {
|
|
|
14
14
|
if (Array.isArray(actions) && actions?.length) {
|
|
15
15
|
return wrapSSR( /*#__PURE__*/_jsx("ul", {
|
|
16
16
|
className: clsx(`${prefixCls}-actions`, hashId),
|
|
17
|
-
children: actions.map((action, index) =>
|
|
18
|
-
/*#__PURE__*/
|
|
19
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
20
|
-
_jsx("li", {
|
|
17
|
+
children: actions.map((action, index) => /*#__PURE__*/_jsx("li", {
|
|
21
18
|
style: {
|
|
22
19
|
width: `${100 / actions.length}%`,
|
|
23
20
|
padding: 0,
|
|
@@ -15,9 +15,8 @@ const {
|
|
|
15
15
|
const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
16
16
|
const {
|
|
17
17
|
className,
|
|
18
|
+
rootClassName,
|
|
18
19
|
style,
|
|
19
|
-
bodyStyle,
|
|
20
|
-
headStyle,
|
|
21
20
|
styles,
|
|
22
21
|
title,
|
|
23
22
|
subTitle,
|
|
@@ -29,7 +28,9 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
29
28
|
tooltip,
|
|
30
29
|
split,
|
|
31
30
|
headerBordered = false,
|
|
32
|
-
variant
|
|
31
|
+
variant: customVariant,
|
|
32
|
+
cover,
|
|
33
|
+
classNames,
|
|
33
34
|
boxShadow = false,
|
|
34
35
|
children,
|
|
35
36
|
size,
|
|
@@ -49,6 +50,16 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
49
50
|
type,
|
|
50
51
|
...rest
|
|
51
52
|
} = props;
|
|
53
|
+
const variant = customVariant ?? 'outlined';
|
|
54
|
+
const mergedStyles = {
|
|
55
|
+
header: styles?.header,
|
|
56
|
+
body: styles?.body,
|
|
57
|
+
root: styles?.root,
|
|
58
|
+
extra: styles?.extra,
|
|
59
|
+
title: styles?.title,
|
|
60
|
+
actions: styles?.actions,
|
|
61
|
+
cover: styles?.cover
|
|
62
|
+
};
|
|
52
63
|
const {
|
|
53
64
|
getPrefixCls
|
|
54
65
|
} = useContext(ConfigProvider.ConfigContext);
|
|
@@ -194,7 +205,7 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
194
205
|
}
|
|
195
206
|
return element;
|
|
196
207
|
});
|
|
197
|
-
const cardCls = clsx(`${prefixCls}`, className, hashId, {
|
|
208
|
+
const cardCls = clsx(`${prefixCls}`, className, rootClassName, hashId, classNames?.root, {
|
|
198
209
|
[`${prefixCls}-border`]: variant === 'outlined',
|
|
199
210
|
[`${prefixCls}-box-shadow`]: boxShadow,
|
|
200
211
|
[`${prefixCls}-contain-card`]: containProCard,
|
|
@@ -207,34 +218,53 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
207
218
|
[`${prefixCls}-collapse`]: collapsed,
|
|
208
219
|
[`${prefixCls}-checked`]: checked
|
|
209
220
|
});
|
|
210
|
-
const bodyCls = clsx(`${prefixCls}-body`, hashId, {
|
|
221
|
+
const bodyCls = clsx(`${prefixCls}-body`, hashId, classNames?.body, {
|
|
211
222
|
[`${prefixCls}-body-center`]: layout === 'center',
|
|
212
223
|
[`${prefixCls}-body-direction-column`]: split === 'horizontal' || direction === 'column',
|
|
213
224
|
[`${prefixCls}-body-wrap`]: wrap && containProCard
|
|
214
225
|
});
|
|
215
|
-
|
|
216
|
-
// 支持新的 styles API,同时保持向后兼容
|
|
217
|
-
const cardBodyStyle = styles?.body || bodyStyle;
|
|
218
|
-
const cardHeadStyle = styles?.header || headStyle;
|
|
226
|
+
const bodyStylePadding = mergedStyles.body?.padding;
|
|
219
227
|
const loadingDOM = /*#__PURE__*/React.isValidElement(loading) ? loading : /*#__PURE__*/_jsx(Loading, {
|
|
220
228
|
prefix: prefixCls,
|
|
221
|
-
style:
|
|
229
|
+
style: bodyStylePadding === 0 || bodyStylePadding === '0px' ? {
|
|
222
230
|
padding: 24
|
|
223
231
|
} : undefined
|
|
224
232
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
233
|
+
const handleCollapsibleIconClick = useCallback(() => {
|
|
234
|
+
if (collapsible === 'icon') setCollapsed(prev => !prev);
|
|
235
|
+
}, [collapsible, setCollapsed]);
|
|
236
|
+
const collapsibleButton = collapsible && (collapsibleIconRender ? /*#__PURE__*/_jsx("span", {
|
|
237
|
+
role: "button",
|
|
238
|
+
tabIndex: collapsible === 'icon' ? 0 : undefined,
|
|
239
|
+
className: clsx(`${prefixCls}-collapsible-icon`, hashId),
|
|
240
|
+
onClick: collapsible === 'icon' ? handleCollapsibleIconClick : undefined,
|
|
241
|
+
onKeyDown: collapsible === 'icon' ? e => {
|
|
242
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
243
|
+
e.preventDefault();
|
|
244
|
+
handleCollapsibleIconClick();
|
|
245
|
+
}
|
|
246
|
+
} : undefined,
|
|
247
|
+
children: collapsibleIconRender({
|
|
248
|
+
collapsed
|
|
249
|
+
})
|
|
228
250
|
}) : /*#__PURE__*/_jsx(RightOutlined, {
|
|
229
|
-
onClick:
|
|
230
|
-
if (collapsible === 'icon') setCollapsed(!collapsed);
|
|
231
|
-
},
|
|
251
|
+
onClick: handleCollapsibleIconClick,
|
|
232
252
|
rotate: !collapsed ? 90 : undefined,
|
|
233
|
-
className: `${prefixCls}-collapsible-icon
|
|
253
|
+
className: clsx(`${prefixCls}-collapsible-icon`, hashId)
|
|
234
254
|
}));
|
|
255
|
+
const headerCls = clsx(`${prefixCls}-header`, hashId, classNames?.header, {
|
|
256
|
+
[`${prefixCls}-header-border`]: headerBordered || type === 'inner',
|
|
257
|
+
[`${prefixCls}-header-collapsible`]: collapsibleButton
|
|
258
|
+
});
|
|
259
|
+
const titleCls = clsx(`${prefixCls}-title`, hashId, classNames?.title);
|
|
260
|
+
const extraCls = clsx(`${prefixCls}-extra`, hashId, classNames?.extra);
|
|
261
|
+
const rootStyle = {
|
|
262
|
+
...mergedStyles.root,
|
|
263
|
+
...style
|
|
264
|
+
};
|
|
235
265
|
return wrapSSR( /*#__PURE__*/_jsxs("div", {
|
|
236
266
|
className: cardCls,
|
|
237
|
-
style:
|
|
267
|
+
style: rootStyle,
|
|
238
268
|
ref: ref,
|
|
239
269
|
onClick: e => {
|
|
240
270
|
onChecked?.(e);
|
|
@@ -242,38 +272,40 @@ const Card = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
242
272
|
},
|
|
243
273
|
...omit(rest, ['prefixCls', 'colSpan']),
|
|
244
274
|
children: [(title || extra || collapsibleButton) && /*#__PURE__*/_jsxs("div", {
|
|
245
|
-
className:
|
|
246
|
-
|
|
247
|
-
[`${prefixCls}-header-collapsible`]: collapsibleButton
|
|
248
|
-
}),
|
|
249
|
-
style: cardHeadStyle,
|
|
275
|
+
className: headerCls,
|
|
276
|
+
style: mergedStyles.header,
|
|
250
277
|
onClick: () => {
|
|
251
278
|
if (collapsible === 'header' || collapsible === true) setCollapsed(!collapsed);
|
|
252
279
|
},
|
|
253
280
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
254
|
-
className:
|
|
281
|
+
className: titleCls,
|
|
282
|
+
style: mergedStyles.title,
|
|
255
283
|
children: [collapsibleButton, /*#__PURE__*/_jsx(LabelIconTip, {
|
|
256
284
|
label: title,
|
|
257
285
|
tooltip: tooltip,
|
|
258
286
|
subTitle: subTitle
|
|
259
287
|
})]
|
|
260
288
|
}), extra && /*#__PURE__*/_jsx("div", {
|
|
261
|
-
className:
|
|
289
|
+
className: extraCls,
|
|
290
|
+
style: mergedStyles.extra,
|
|
262
291
|
onClick: e => e.stopPropagation(),
|
|
263
292
|
children: extra
|
|
264
293
|
})]
|
|
294
|
+
}), cover && !collapsed && /*#__PURE__*/_jsx("div", {
|
|
295
|
+
className: clsx(`${prefixCls}-cover`, hashId, classNames?.cover),
|
|
296
|
+
style: mergedStyles.cover,
|
|
297
|
+
children: cover
|
|
265
298
|
}), tabs ? /*#__PURE__*/_jsx("div", {
|
|
266
|
-
className: `${prefixCls}-tabs
|
|
299
|
+
className: clsx(`${prefixCls}-tabs`, hashId),
|
|
267
300
|
children: /*#__PURE__*/_jsx(Tabs, {
|
|
268
301
|
onChange: tabs.onChange,
|
|
269
302
|
...omit(tabs, ['cardProps']),
|
|
270
|
-
// @ts-ignore
|
|
271
303
|
items: ModifyTabItemsContent,
|
|
272
304
|
children: loading ? loadingDOM : children
|
|
273
305
|
})
|
|
274
306
|
}) : /*#__PURE__*/_jsx("div", {
|
|
275
307
|
className: bodyCls,
|
|
276
|
-
style:
|
|
308
|
+
style: mergedStyles.body,
|
|
277
309
|
children: loading ? loadingDOM : childrenModified
|
|
278
310
|
}), actions ? /*#__PURE__*/_jsx(Actions, {
|
|
279
311
|
actions: actions,
|
|
@@ -13,6 +13,9 @@ const genProCardStyle = token => {
|
|
|
13
13
|
display: 'flex',
|
|
14
14
|
flexDirection: 'column',
|
|
15
15
|
boxSizing: 'border-box',
|
|
16
|
+
'*, *::before, *::after': {
|
|
17
|
+
boxSizing: 'border-box'
|
|
18
|
+
},
|
|
16
19
|
width: '100%',
|
|
17
20
|
marginBlock: 0,
|
|
18
21
|
marginInline: 0,
|
|
@@ -29,6 +32,29 @@ const genProCardStyle = token => {
|
|
|
29
32
|
'&-col': {
|
|
30
33
|
width: '100%'
|
|
31
34
|
},
|
|
35
|
+
// 分割线样式:col 之间的分割线
|
|
36
|
+
[` ${componentCls}-col${componentCls}-split-vertical`]: {
|
|
37
|
+
borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
38
|
+
},
|
|
39
|
+
[` ${componentCls}-col${componentCls}-split-horizontal`]: {
|
|
40
|
+
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
41
|
+
},
|
|
42
|
+
// Divider 分割线组件样式
|
|
43
|
+
[`${componentCls}-divider`]: {
|
|
44
|
+
flex: 'none',
|
|
45
|
+
alignSelf: 'stretch',
|
|
46
|
+
width: token.lineWidth,
|
|
47
|
+
marginInline: token.marginXS,
|
|
48
|
+
marginBlock: token.marginLG,
|
|
49
|
+
backgroundColor: token.colorSplit,
|
|
50
|
+
[`&${componentCls}-divider-horizontal`]: {
|
|
51
|
+
width: 'auto',
|
|
52
|
+
alignSelf: 'auto',
|
|
53
|
+
height: token.lineWidth,
|
|
54
|
+
marginInline: token.marginLG,
|
|
55
|
+
marginBlock: token.marginXS
|
|
56
|
+
}
|
|
57
|
+
},
|
|
32
58
|
'&-border': {
|
|
33
59
|
border: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
34
60
|
},
|
|
@@ -121,7 +147,7 @@ const genProCardStyle = token => {
|
|
|
121
147
|
},
|
|
122
148
|
[`${componentCls}-title`]: {
|
|
123
149
|
color: token.colorText,
|
|
124
|
-
fontWeight:
|
|
150
|
+
fontWeight: token.fontWeightStrong,
|
|
125
151
|
fontSize: token.fontSizeLG,
|
|
126
152
|
lineHeight: token.lineHeight
|
|
127
153
|
},
|
|
@@ -143,6 +169,17 @@ const genProCardStyle = token => {
|
|
|
143
169
|
transition: `transform ${token.motionDurationMid}`
|
|
144
170
|
}
|
|
145
171
|
},
|
|
172
|
+
[`${componentCls}-cover`]: {
|
|
173
|
+
overflow: 'hidden',
|
|
174
|
+
borderRadius: `${token.borderRadius}px ${token.borderRadius}px 0 0`,
|
|
175
|
+
'& > *': {
|
|
176
|
+
width: '100%',
|
|
177
|
+
display: 'block'
|
|
178
|
+
},
|
|
179
|
+
'& img': {
|
|
180
|
+
verticalAlign: 'middle'
|
|
181
|
+
}
|
|
182
|
+
},
|
|
146
183
|
[`${componentCls}-body`]: {
|
|
147
184
|
display: 'block',
|
|
148
185
|
boxSizing: 'border-box',
|
|
@@ -173,19 +210,19 @@ const genProCardStyle = token => {
|
|
|
173
210
|
paddingBlock: token.paddingSM
|
|
174
211
|
}
|
|
175
212
|
},
|
|
213
|
+
[` ${componentCls}-divider`]: {
|
|
214
|
+
marginBlock: token.marginLG,
|
|
215
|
+
marginInline: token.marginXS,
|
|
216
|
+
[`&${componentCls}-divider-horizontal`]: {
|
|
217
|
+
marginBlock: token.marginXS,
|
|
218
|
+
marginInline: token.marginLG
|
|
219
|
+
}
|
|
220
|
+
},
|
|
176
221
|
[`${componentCls}-header${componentCls}-header-collapsible`]: {
|
|
177
222
|
paddingBlock: token.paddingXS
|
|
178
223
|
}
|
|
179
224
|
}
|
|
180
225
|
},
|
|
181
|
-
[`${componentCls}-col`]: {
|
|
182
|
-
[`&${componentCls}-split-vertical`]: {
|
|
183
|
-
borderInlineEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
184
|
-
},
|
|
185
|
-
[`&${componentCls}-split-horizontal`]: {
|
|
186
|
-
borderBlockEnd: `${token.lineWidth}px ${token.lineType} ${token.colorSplit}`
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
226
|
[`${componentCls}-tabs`]: {
|
|
190
227
|
[`${token.antCls}-tabs-top > ${token.antCls}-tabs-nav`]: {
|
|
191
228
|
marginBlockEnd: 0,
|
|
@@ -160,9 +160,7 @@ const CheckCardGroup = props => {
|
|
|
160
160
|
};
|
|
161
161
|
const children = useMemo(() => {
|
|
162
162
|
if (loading) {
|
|
163
|
-
return new Array(options.length || React.Children.toArray(props.children).length || 1).fill(0)
|
|
164
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
165
|
-
.map((_, index) => /*#__PURE__*/_jsx(CheckCard, {
|
|
163
|
+
return new Array(options.length || React.Children.toArray(props.children).length || 1).fill(0).map((_, index) => /*#__PURE__*/_jsx(CheckCard, {
|
|
166
164
|
loading: true
|
|
167
165
|
}, index));
|
|
168
166
|
}
|
|
@@ -42,7 +42,6 @@ const CheckCard = props => {
|
|
|
42
42
|
useEffect(() => {
|
|
43
43
|
checkCardGroup?.registerValue?.(props.value);
|
|
44
44
|
return () => checkCardGroup?.cancelValue?.(props.value);
|
|
45
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
45
|
}, [props.value]);
|
|
47
46
|
const {
|
|
48
47
|
prefixCls: customizePrefixCls,
|
|
@@ -16,10 +16,10 @@ const ProCardDivider = props => {
|
|
|
16
16
|
const {
|
|
17
17
|
className,
|
|
18
18
|
style = {},
|
|
19
|
-
|
|
19
|
+
orientation = 'vertical'
|
|
20
20
|
} = props;
|
|
21
21
|
const classString = clsx(prefixCls, className, hashId, {
|
|
22
|
-
[`${prefixCls}-${
|
|
22
|
+
[`${prefixCls}-${orientation}`]: orientation
|
|
23
23
|
});
|
|
24
24
|
return wrapSSR( /*#__PURE__*/_jsx("div", {
|
|
25
25
|
className: classString,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Divider 样式已合并至 ProCard style.ts,此 hook 仅用于获取 hashId 和 wrapSSR
|
|
4
|
+
*/
|
|
5
|
+
export default function useStyle(_prefixCls: string): {
|
|
3
6
|
wrapSSR: (node: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
4
7
|
hashId: string;
|
|
5
8
|
};
|
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
import { useStyle as useAntdStyle } from "../../../provider";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
boxSizing: 'border-box',
|
|
9
|
-
'&-divider': {
|
|
10
|
-
flex: 'none',
|
|
11
|
-
width: token.lineWidth,
|
|
12
|
-
marginInline: token.marginXS,
|
|
13
|
-
marginBlock: token.marginLG,
|
|
14
|
-
backgroundColor: token.colorSplit,
|
|
15
|
-
'&-horizontal': {
|
|
16
|
-
width: 'initial',
|
|
17
|
-
height: token.lineWidth,
|
|
18
|
-
marginInline: token.marginLG,
|
|
19
|
-
marginBlock: token.marginXS
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
'&&-size-small &-divider': {
|
|
23
|
-
marginBlock: token.marginLG,
|
|
24
|
-
marginInline: token.marginXS,
|
|
25
|
-
'&-horizontal': {
|
|
26
|
-
marginBlock: token.marginXS,
|
|
27
|
-
marginInline: token.marginLG
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
export default function useStyle(prefixCls) {
|
|
34
|
-
return useAntdStyle('ProCardDivider', token => {
|
|
35
|
-
const proCardDividerToken = {
|
|
36
|
-
...token,
|
|
37
|
-
componentCls: `.${prefixCls}`
|
|
38
|
-
};
|
|
39
|
-
return [genDividerStyle(proCardDividerToken)];
|
|
40
|
-
});
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Divider 样式已合并至 ProCard style.ts,此 hook 仅用于获取 hashId 和 wrapSSR
|
|
5
|
+
*/
|
|
6
|
+
export default function useStyle(_prefixCls) {
|
|
7
|
+
return useAntdStyle('ProCardDivider', () => ({}));
|
|
41
8
|
}
|
|
@@ -12,7 +12,7 @@ const Statistic = props => {
|
|
|
12
12
|
layout = 'inline',
|
|
13
13
|
style,
|
|
14
14
|
description,
|
|
15
|
-
children,
|
|
15
|
+
children: _children,
|
|
16
16
|
title,
|
|
17
17
|
tip,
|
|
18
18
|
status,
|
|
@@ -41,7 +41,7 @@ const Statistic = props => {
|
|
|
41
41
|
const tipDom = tip && /*#__PURE__*/_jsx(Tooltip, {
|
|
42
42
|
title: tip,
|
|
43
43
|
children: /*#__PURE__*/_jsx(QuestionCircleOutlined, {
|
|
44
|
-
className: `${prefixCls}-tip
|
|
44
|
+
className: clsx(`${prefixCls}-tip`, hashId)
|
|
45
45
|
})
|
|
46
46
|
});
|
|
47
47
|
const trendIconClassName = clsx(`${prefixCls}-trend-icon`, hashId, {
|
|
@@ -78,7 +78,7 @@ const Statistic = props => {
|
|
|
78
78
|
className: statisticClassName,
|
|
79
79
|
...others
|
|
80
80
|
}), description && /*#__PURE__*/_jsx("div", {
|
|
81
|
-
className: `${prefixCls}-description
|
|
81
|
+
className: clsx(`${prefixCls}-description`, hashId),
|
|
82
82
|
children: description
|
|
83
83
|
})]
|
|
84
84
|
})]
|
|
@@ -54,7 +54,7 @@ const StatisticCard = props => {
|
|
|
54
54
|
children: [statisticDom, chartDom]
|
|
55
55
|
}));
|
|
56
56
|
const footerDom = footer && /*#__PURE__*/_jsx("div", {
|
|
57
|
-
className: `${prefixCls}-footer
|
|
57
|
+
className: clsx(`${prefixCls}-footer`, hashId),
|
|
58
58
|
children: footer
|
|
59
59
|
});
|
|
60
60
|
return wrapSSR( /*#__PURE__*/_jsxs(Card, {
|
package/es/card/typing.d.ts
CHANGED
|
@@ -1,20 +1,36 @@
|
|
|
1
|
-
import type { TabPaneProps, TabsProps } from 'antd';
|
|
2
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
1
|
+
import type { CardProps as AntdCardProps, TabPaneProps, TabsProps } from 'antd';
|
|
3
2
|
import type { ReactNode } from 'react';
|
|
3
|
+
import type { LabelTooltipType } from '../utils';
|
|
4
|
+
export type { LabelTooltipType };
|
|
4
5
|
export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
|
|
5
6
|
export type Gutter = number | Partial<Record<Breakpoint, number>>;
|
|
6
7
|
export type ColSpanType = number | string;
|
|
7
8
|
type CollapsibleType = 'icon' | 'header' | boolean;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
/** 与 antd Card 一致的 styles 结构 */
|
|
10
|
+
export interface ProCardStyles {
|
|
11
|
+
root?: React.CSSProperties;
|
|
12
|
+
header?: React.CSSProperties;
|
|
13
|
+
body?: React.CSSProperties;
|
|
14
|
+
extra?: React.CSSProperties;
|
|
15
|
+
title?: React.CSSProperties;
|
|
16
|
+
actions?: React.CSSProperties;
|
|
17
|
+
cover?: React.CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
/** 与 antd Card 一致的 classNames 结构 */
|
|
20
|
+
export interface ProCardClassNames {
|
|
21
|
+
root?: string;
|
|
22
|
+
header?: string;
|
|
23
|
+
body?: string;
|
|
24
|
+
extra?: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
actions?: string;
|
|
27
|
+
cover?: string;
|
|
28
|
+
}
|
|
29
|
+
type CardPropsBase = Pick<AntdCardProps, 'rootClassName' | 'cover'> & {
|
|
30
|
+
/** 样式配置,与 antd Card styles 结构一致 */
|
|
31
|
+
styles?: ProCardStyles;
|
|
32
|
+
/** 语义化 classNames,与 antd Card classNames 结构一致 */
|
|
33
|
+
classNames?: ProCardClassNames;
|
|
18
34
|
/** 页头是否有分割线 */
|
|
19
35
|
headerBordered?: boolean;
|
|
20
36
|
/** 卡片标题 */
|
|
@@ -46,7 +62,7 @@ type CardPropsBase = {
|
|
|
46
62
|
actions?: React.ReactNode[] | React.ReactNode;
|
|
47
63
|
/** 拆分卡片方式 */
|
|
48
64
|
split?: 'vertical' | 'horizontal';
|
|
49
|
-
/** Card
|
|
65
|
+
/** 卡片变体,与 antd Card variant 一致 */
|
|
50
66
|
variant?: 'outlined' | 'borderless';
|
|
51
67
|
/**
|
|
52
68
|
* 鼠标移过时可浮起
|
|
@@ -93,4 +109,3 @@ export type ProCardTabPaneProps = {
|
|
|
93
109
|
cardProps?: CardProps;
|
|
94
110
|
} & TabPaneProps;
|
|
95
111
|
export type CardType = React.ForwardRefExoticComponent<CardProps>;
|
|
96
|
-
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DescriptionsProps, FormProps } from 'antd';
|
|
2
|
-
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import type { ProFieldFCMode } from '../provider';
|
|
5
|
-
import type { ProCoreActionType, ProFieldValueType, ProSchema, ProSchemaComponentTypes, RowEditableConfig, UseEditableMapUtilType } from '../utils';
|
|
4
|
+
import type { ProCoreActionType, ProEllipsis, ProFieldValueType, ProSchema, ProSchemaComponentTypes, RowEditableConfig, UseEditableMapUtilType } from '../utils';
|
|
5
|
+
import { LabelTooltipType } from '../utils';
|
|
6
6
|
import type { RequestData } from './useFetchData';
|
|
7
7
|
export interface DescriptionsItemProps {
|
|
8
8
|
prefixCls?: string;
|
|
@@ -31,9 +31,7 @@ export type ProDescriptionsItemProps<T = Record<string, any>, ValueType = 'text'
|
|
|
31
31
|
hide?: boolean;
|
|
32
32
|
plain?: boolean;
|
|
33
33
|
copyable?: boolean;
|
|
34
|
-
ellipsis?:
|
|
35
|
-
showTitle?: boolean;
|
|
36
|
-
};
|
|
34
|
+
ellipsis?: ProEllipsis;
|
|
37
35
|
mode?: ProFieldFCMode;
|
|
38
36
|
children?: React.ReactNode;
|
|
39
37
|
/**
|
package/es/descriptions/index.js
CHANGED
|
@@ -187,14 +187,14 @@ const schemaToDescriptionsItem = (items, entity, action, editableUtils, emptyTex
|
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
const {
|
|
190
|
-
valueEnum,
|
|
191
|
-
render,
|
|
190
|
+
valueEnum: _valueEnum,
|
|
191
|
+
render: _render,
|
|
192
192
|
renderText,
|
|
193
193
|
mode,
|
|
194
|
-
plain,
|
|
194
|
+
plain: _plain,
|
|
195
195
|
dataIndex,
|
|
196
|
-
request,
|
|
197
|
-
params,
|
|
196
|
+
request: _request,
|
|
197
|
+
params: _params,
|
|
198
198
|
editable,
|
|
199
199
|
...restItem
|
|
200
200
|
} = item;
|
|
@@ -294,7 +294,7 @@ const ProDescriptions = props => {
|
|
|
294
294
|
onLoadingChange,
|
|
295
295
|
actionRef,
|
|
296
296
|
onRequestError,
|
|
297
|
-
emptyText,
|
|
297
|
+
emptyText: _emptyText,
|
|
298
298
|
...rest
|
|
299
299
|
} = props;
|
|
300
300
|
const proContext = useContext(ProConfigContext);
|
|
@@ -27,6 +27,8 @@ type RenderProps = Omit<ProFieldFCRenderProps, 'text' | 'placeholder'> & ProRend
|
|
|
27
27
|
*
|
|
28
28
|
* @param dataValue
|
|
29
29
|
* @param valueType
|
|
30
|
+
* @param props
|
|
31
|
+
* @param valueTypeMap
|
|
30
32
|
*/
|
|
31
33
|
export declare const defaultRenderText: (dataValue: ProFieldTextType, valueType: ProFieldValueType | ProFieldValueObjectType, props: RenderProps, valueTypeMap: Record<string, ProRenderFieldPropsType>) => React.ReactNode;
|
|
32
34
|
export declare const ProField: React.ForwardRefRenderFunction<any, ProFieldPropsType>;
|
package/es/field/AllProField.js
CHANGED
|
@@ -55,6 +55,7 @@ dayjs.extend(weekday);
|
|
|
55
55
|
*
|
|
56
56
|
* @param text String | number
|
|
57
57
|
* @param valueType ProColumnsValueObjectType
|
|
58
|
+
* @param props
|
|
58
59
|
*/
|
|
59
60
|
const defaultRenderTextByObject = (text, valueType, props) => {
|
|
60
61
|
const pickFormItemProps = pickProProps(props.fieldProps);
|
|
@@ -102,6 +103,8 @@ const defaultRenderTextByObject = (text, valueType, props) => {
|
|
|
102
103
|
*
|
|
103
104
|
* @param dataValue
|
|
104
105
|
* @param valueType
|
|
106
|
+
* @param props
|
|
107
|
+
* @param valueTypeMap
|
|
105
108
|
*/
|
|
106
109
|
export const defaultRenderText = (dataValue, valueType, props, valueTypeMap) => {
|
|
107
110
|
const {
|
|
@@ -127,15 +130,12 @@ export const defaultRenderText = (dataValue, valueType, props, valueTypeMap) =>
|
|
|
127
130
|
});
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
|
-
|
|
131
|
-
// eslint-disable-next-line no-param-reassign
|
|
132
133
|
delete props.emptyText;
|
|
133
134
|
if (typeof valueType === 'object') {
|
|
134
135
|
return defaultRenderTextByObject(dataValue, valueType, props);
|
|
135
136
|
}
|
|
136
137
|
const customValueTypeConfig = valueTypeMap && valueTypeMap[valueType];
|
|
137
138
|
if (customValueTypeConfig) {
|
|
138
|
-
// eslint-disable-next-line no-param-reassign
|
|
139
139
|
delete props.ref;
|
|
140
140
|
if (mode === 'read') {
|
|
141
141
|
return customValueTypeConfig.render?.(dataValue, {
|
|
@@ -561,7 +561,6 @@ const ProFieldComponent = ({
|
|
|
561
561
|
...omitUndefined(restFieldProps),
|
|
562
562
|
onChange: onChangeCallBack
|
|
563
563
|
};
|
|
564
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
565
564
|
}, [value, restFieldProps, onChangeCallBack]);
|
|
566
565
|
const renderedDom = defaultRenderText(mode === 'edit' ? fieldProps?.value ?? text ?? '' : text ?? fieldProps?.value ?? '', valueType || 'text', omitUndefined({
|
|
567
566
|
ref,
|
|
@@ -29,6 +29,8 @@ type RenderProps = Omit<ProFieldFCRenderProps, 'text' | 'placeholder'> & ProRend
|
|
|
29
29
|
*
|
|
30
30
|
* @param dataValue
|
|
31
31
|
* @param valueType
|
|
32
|
+
* @param props
|
|
33
|
+
* @param valueTypeMap
|
|
32
34
|
*/
|
|
33
35
|
export declare const pureRenderText: (dataValue: ProFieldTextType, valueType: ProFieldValueType | ProFieldValueObjectType, props: RenderProps, valueTypeMap: Record<string, ProRenderFieldPropsType>) => React.ReactNode;
|
|
34
36
|
/** ProField 的类型 */
|
package/es/field/PureProField.js
CHANGED
|
@@ -27,6 +27,8 @@ dayjs.extend(weekday);
|
|
|
27
27
|
*
|
|
28
28
|
* @param dataValue
|
|
29
29
|
* @param valueType
|
|
30
|
+
* @param props
|
|
31
|
+
* @param valueTypeMap
|
|
30
32
|
*/
|
|
31
33
|
export const pureRenderText = (dataValue, valueType, props, valueTypeMap) => {
|
|
32
34
|
const {
|
|
@@ -52,11 +54,8 @@ export const pureRenderText = (dataValue, valueType, props, valueTypeMap) => {
|
|
|
52
54
|
});
|
|
53
55
|
}
|
|
54
56
|
}
|
|
55
|
-
|
|
56
|
-
// eslint-disable-next-line no-param-reassign
|
|
57
57
|
delete props.emptyText;
|
|
58
58
|
if (typeof valueType === 'object') {
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
|
60
59
|
return pureRenderText(dataValue, valueType.type, {
|
|
61
60
|
...valueType,
|
|
62
61
|
...props
|
|
@@ -64,7 +63,6 @@ export const pureRenderText = (dataValue, valueType, props, valueTypeMap) => {
|
|
|
64
63
|
}
|
|
65
64
|
const customValueTypeConfig = valueTypeMap && valueTypeMap[valueType];
|
|
66
65
|
if (customValueTypeConfig) {
|
|
67
|
-
// eslint-disable-next-line no-param-reassign
|
|
68
66
|
delete props.ref;
|
|
69
67
|
if (mode === 'read') {
|
|
70
68
|
const readDom = customValueTypeConfig.render?.(dataValue, {
|
|
@@ -129,7 +127,6 @@ const ProFieldComponent = ({
|
|
|
129
127
|
...omitUndefined(restFieldProps),
|
|
130
128
|
onChange: onChangeCallBack
|
|
131
129
|
};
|
|
132
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
133
130
|
}, [value, restFieldProps, onChangeCallBack]);
|
|
134
131
|
const renderedDom = pureRenderText(mode === 'edit' ? fieldProps?.value ?? text ?? '' : text ?? fieldProps?.value ?? '', valueType || 'text', omitUndefined({
|
|
135
132
|
ref,
|