@ant-design/pro-components 3.1.4-0 → 3.1.6-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/Card/index.js +43 -19
- package/es/card/components/Card/style.js +12 -1
- package/es/card/components/Statistic/index.js +2 -2
- package/es/card/components/StatisticCard/index.js +1 -1
- package/es/card/typing.d.ts +27 -8
- package/es/field/AllProField.d.ts +2 -0
- package/es/field/AllProField.js +3 -0
- package/es/field/PureProField.d.ts +2 -0
- package/es/field/PureProField.js +2 -0
- package/es/field/components/Cascader/index.js +8 -1
- package/es/field/components/Checkbox/index.js +5 -1
- package/es/field/components/ColorPicker/index.d.ts +1 -1
- 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/Money/index.js +51 -3
- package/es/field/components/Password/index.js +12 -11
- 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 +3 -5
- 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 -2
- package/es/field/components/Text/index.js +7 -1
- 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 -3
- package/es/form/BaseForm/Submitter/index.d.ts +1 -1
- package/es/form/components/Digit/DigitRange.js +5 -2
- package/es/form/components/Digit/index.js +7 -2
- 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 +12 -2
- package/es/form/components/List/ListContainer.js +2 -1
- package/es/form/components/Select/index.js +11 -1
- package/es/form/layouts/DrawerForm/index.d.ts +4 -4
- package/es/form/layouts/DrawerForm/index.js +1 -1
- package/es/form/layouts/LightFilter/index.js +22 -31
- package/es/form/layouts/LoginForm/index.js +10 -9
- package/es/form/layouts/LoginFormPage/index.js +17 -16
- package/es/form/layouts/ModalForm/index.d.ts +2 -2
- package/es/form/layouts/ProForm/index.d.ts +1 -1
- package/es/form/layouts/QueryFilter/Actions.js +2 -1
- package/es/form/layouts/QueryFilter/index.js +40 -23
- package/es/form/layouts/StepsForm/index.js +2 -2
- package/es/layout/ProLayout.d.ts +3 -3
- package/es/layout/ProLayout.js +13 -25
- package/es/layout/components/AppsLogoComponents/DefaultContent.js +6 -5
- package/es/layout/components/AppsLogoComponents/SimpleContent.js +6 -5
- package/es/layout/components/FooterToolbar/index.d.ts +1 -1
- package/es/layout/components/FooterToolbar/index.js +2 -2
- package/es/layout/components/GlobalFooter/index.js +3 -3
- package/es/layout/components/GlobalHeader/ActionsContent.js +6 -6
- package/es/layout/components/GlobalHeader/index.js +1 -1
- package/es/layout/components/GridContent/index.js +1 -1
- package/es/layout/components/Help/ProHelpPanel.js +11 -10
- package/es/layout/components/PageContainer/index.js +9 -9
- package/es/layout/components/PageHeader/index.js +10 -10
- package/es/layout/components/SettingDrawer/BlockCheckbox.js +2 -2
- 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 -4
- package/es/layout/components/SiderMenu/BaseMenu.js +3 -3
- package/es/layout/components/SiderMenu/SiderMenu.js +5 -5
- package/es/layout/components/TopNavHeader/index.js +3 -3
- package/es/layout/utils/getBreadcrumbProps.js +1 -1
- package/es/list/Item.d.ts +3 -3
- package/es/list/Item.js +8 -1
- package/es/list/ListView.js +1 -2
- package/es/list/ProListBase.d.ts +1 -1
- package/es/list/ProListBase.js +43 -37
- package/es/list/style/index.js +13 -0
- package/es/provider/index.d.ts +2 -2
- package/es/table/Table.js +14 -5
- package/es/table/components/Alert/index.js +6 -5
- package/es/table/components/ColumnSetting/index.js +9 -9
- 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 +5 -70
- 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.js +15 -12
- package/es/table/components/ListToolBar/style.js +2 -2
- package/es/table/components/ToolBar/DensityIcon.d.ts +2 -2
- package/es/table/components/ToolBar/DensityIcon.js +6 -3
- package/es/table/components/ToolBar/FullscreenIcon.d.ts +1 -1
- package/es/table/components/ToolBar/FullscreenIcon.js +11 -5
- package/es/table/useFetchData.js +4 -1
- package/es/table/utils/cellRenderToFromItem.js +1 -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.js +2 -2
- package/es/utils/hooks/useFetchData/index.js +0 -2
- package/es/utils/isUrl/index.js +1 -1
- package/es/utils/proFieldParsingText/index.d.ts +2 -2
- package/es/utils/proFieldParsingText/index.js +2 -2
- package/guidelines/components/pro-card.md +5 -4
- package/lib/card/ProCard.js +15 -7
- package/lib/card/components/Card/index.js +43 -19
- package/lib/card/components/Card/style.js +12 -1
- package/lib/card/components/Statistic/index.js +2 -2
- package/lib/card/components/StatisticCard/index.js +1 -1
- package/lib/card/typing.d.ts +27 -8
- package/lib/field/AllProField.d.ts +2 -0
- package/lib/field/AllProField.js +3 -0
- package/lib/field/PureProField.d.ts +2 -0
- package/lib/field/PureProField.js +2 -0
- package/lib/field/components/Cascader/index.js +8 -1
- package/lib/field/components/Checkbox/index.js +5 -1
- package/lib/field/components/ColorPicker/index.d.ts +1 -1
- 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/Money/index.js +50 -2
- 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 +2 -4
- 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 -2
- package/lib/field/components/Text/index.js +7 -1
- 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 -3
- package/lib/form/BaseForm/Submitter/index.d.ts +1 -1
- package/lib/form/components/Digit/DigitRange.js +5 -2
- package/lib/form/components/Digit/index.js +7 -2
- 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 +12 -2
- package/lib/form/components/List/ListContainer.js +2 -1
- package/lib/form/components/Select/index.js +11 -1
- package/lib/form/layouts/DrawerForm/index.d.ts +4 -4
- package/lib/form/layouts/DrawerForm/index.js +1 -1
- package/lib/form/layouts/LightFilter/index.js +21 -30
- package/lib/form/layouts/LoginForm/index.js +10 -9
- package/lib/form/layouts/LoginFormPage/index.js +17 -16
- package/lib/form/layouts/ModalForm/index.d.ts +2 -2
- package/lib/form/layouts/ProForm/index.d.ts +1 -1
- package/lib/form/layouts/QueryFilter/Actions.js +2 -1
- package/lib/form/layouts/QueryFilter/index.js +39 -22
- package/lib/form/layouts/StepsForm/index.js +2 -2
- package/lib/layout/ProLayout.d.ts +3 -3
- package/lib/layout/ProLayout.js +13 -25
- package/lib/layout/components/AppsLogoComponents/DefaultContent.js +6 -5
- package/lib/layout/components/AppsLogoComponents/SimpleContent.js +6 -5
- package/lib/layout/components/FooterToolbar/index.d.ts +1 -1
- package/lib/layout/components/FooterToolbar/index.js +2 -2
- package/lib/layout/components/GlobalFooter/index.js +3 -3
- package/lib/layout/components/GlobalHeader/ActionsContent.js +6 -6
- package/lib/layout/components/GlobalHeader/index.js +1 -1
- package/lib/layout/components/GridContent/index.js +1 -1
- package/lib/layout/components/Help/ProHelpPanel.js +11 -10
- package/lib/layout/components/PageContainer/index.js +9 -9
- package/lib/layout/components/PageHeader/index.js +10 -10
- package/lib/layout/components/SettingDrawer/BlockCheckbox.js +2 -2
- 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 -4
- package/lib/layout/components/SiderMenu/BaseMenu.js +3 -3
- package/lib/layout/components/SiderMenu/SiderMenu.js +5 -5
- package/lib/layout/components/TopNavHeader/index.js +3 -3
- package/lib/layout/utils/getBreadcrumbProps.js +1 -1
- package/lib/list/Item.d.ts +3 -3
- package/lib/list/Item.js +8 -1
- package/lib/list/ListView.js +1 -2
- package/lib/list/ProListBase.d.ts +1 -1
- package/lib/list/ProListBase.js +42 -36
- package/lib/list/style/index.js +13 -0
- package/lib/provider/index.d.ts +2 -2
- package/lib/table/Table.js +14 -5
- package/lib/table/components/Alert/index.js +6 -5
- package/lib/table/components/ColumnSetting/index.js +9 -9
- 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 +5 -70
- 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.js +15 -12
- package/lib/table/components/ListToolBar/style.js +2 -2
- package/lib/table/components/ToolBar/DensityIcon.d.ts +2 -2
- package/lib/table/components/ToolBar/DensityIcon.js +6 -3
- package/lib/table/components/ToolBar/FullscreenIcon.d.ts +1 -1
- package/lib/table/components/ToolBar/FullscreenIcon.js +11 -5
- package/lib/table/useFetchData.js +4 -1
- package/lib/table/utils/cellRenderToFromItem.js +1 -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.js +2 -2
- package/lib/utils/hooks/useFetchData/index.js +0 -2
- package/lib/utils/isUrl/index.js +1 -1
- package/lib/utils/proFieldParsingText/index.d.ts +2 -2
- package/lib/utils/proFieldParsingText/index.js +2 -2
- package/package.json +31 -30
|
@@ -55,14 +55,15 @@ function LoginFormPage(props) {
|
|
|
55
55
|
wrapSSR,
|
|
56
56
|
hashId
|
|
57
57
|
} = (0, _style.useStyle)(baseClassName);
|
|
58
|
-
const getCls = className => `${baseClassName}-${className}
|
|
58
|
+
const getCls = className => `${baseClassName}-${className}`;
|
|
59
59
|
|
|
60
60
|
/** 生成logo 的dom,如果是string 设置为图片 如果是个 dom 就原样保留 */
|
|
61
61
|
const logoDom = (0, _react.useMemo)(() => {
|
|
62
62
|
if (!logo) return null;
|
|
63
63
|
if (typeof logo === 'string') {
|
|
64
64
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
65
|
-
src: logo
|
|
65
|
+
src: logo,
|
|
66
|
+
alt: ""
|
|
66
67
|
});
|
|
67
68
|
}
|
|
68
69
|
return logo;
|
|
@@ -102,43 +103,43 @@ function LoginFormPage(props) {
|
|
|
102
103
|
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
103
104
|
className: (0, _clsx.clsx)(baseClassName, hashId),
|
|
104
105
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
105
|
-
className: getCls('notice'),
|
|
106
|
+
className: (0, _clsx.clsx)(getCls('notice'), hashId),
|
|
106
107
|
children: activityConfig && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
107
|
-
className: getCls('notice-activity'),
|
|
108
|
+
className: (0, _clsx.clsx)(getCls('notice-activity'), hashId),
|
|
108
109
|
style: activityConfig.style,
|
|
109
110
|
children: [activityConfig.title && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
110
|
-
className: getCls('notice-activity-title'),
|
|
111
|
+
className: (0, _clsx.clsx)(getCls('notice-activity-title'), hashId),
|
|
111
112
|
children: activityConfig.title
|
|
112
113
|
}), activityConfig.subTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
113
|
-
className: getCls('notice-activity-subTitle'),
|
|
114
|
+
className: (0, _clsx.clsx)(getCls('notice-activity-subTitle'), hashId),
|
|
114
115
|
children: activityConfig.subTitle
|
|
115
116
|
}), activityConfig.action && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
116
|
-
className: getCls('notice-activity-action'),
|
|
117
|
+
className: (0, _clsx.clsx)(getCls('notice-activity-action'), hashId),
|
|
117
118
|
children: activityConfig.action
|
|
118
119
|
})]
|
|
119
120
|
})
|
|
120
121
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
121
|
-
className: getCls('left'),
|
|
122
|
+
className: (0, _clsx.clsx)(getCls('left'), hashId),
|
|
122
123
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
123
|
-
className: getCls('container'),
|
|
124
|
+
className: (0, _clsx.clsx)(getCls('container'), hashId),
|
|
124
125
|
style: containerStyle,
|
|
125
126
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
126
|
-
className: getCls('top'),
|
|
127
|
+
className: (0, _clsx.clsx)(getCls('top'), hashId),
|
|
127
128
|
children: [title || logoDom ? /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
128
|
-
className: getCls('header'),
|
|
129
|
+
className: (0, _clsx.clsx)(getCls('header'), hashId),
|
|
129
130
|
children: [logoDom ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
130
|
-
className: getCls('logo'),
|
|
131
|
+
className: (0, _clsx.clsx)(getCls('logo'), hashId),
|
|
131
132
|
children: logoDom
|
|
132
133
|
}) : null, title ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
133
|
-
className: getCls('title'),
|
|
134
|
+
className: (0, _clsx.clsx)(getCls('title'), hashId),
|
|
134
135
|
children: title
|
|
135
136
|
}) : null]
|
|
136
137
|
}) : null, subTitle ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
137
|
-
className: getCls('desc'),
|
|
138
|
+
className: (0, _clsx.clsx)(getCls('desc'), hashId),
|
|
138
139
|
children: subTitle
|
|
139
140
|
}) : null]
|
|
140
141
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
141
|
-
className: getCls('main'),
|
|
142
|
+
className: (0, _clsx.clsx)(getCls('main'), hashId),
|
|
142
143
|
style: mainStyle,
|
|
143
144
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_ProForm.ProForm, {
|
|
144
145
|
isKeyPressSubmit: true,
|
|
@@ -146,7 +147,7 @@ function LoginFormPage(props) {
|
|
|
146
147
|
submitter: submitter,
|
|
147
148
|
children: [message, children]
|
|
148
149
|
}), actions ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
149
|
-
className: getCls('other'),
|
|
150
|
+
className: (0, _clsx.clsx)(getCls('other'), hashId),
|
|
150
151
|
style: otherStyle,
|
|
151
152
|
children: actions
|
|
152
153
|
}) : null]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { FormProps, ModalProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import type { CommonFormProps } from '../../BaseForm';
|
|
4
4
|
export type ModalFormProps<T = Record<string, any>, U = Record<string, any>> = Omit<FormProps<T>, 'onFinish' | 'title'> & CommonFormProps<T, U> & {
|
|
5
5
|
/**
|
|
@@ -17,7 +17,7 @@ export type ModalFormProps<T = Record<string, any>, U = Record<string, any>> = O
|
|
|
17
17
|
/** @name 提交数据时,禁用取消按钮的超时时间(毫秒)。 */
|
|
18
18
|
submitTimeout?: number;
|
|
19
19
|
/** @name 用于触发抽屉打开的 dom */
|
|
20
|
-
trigger?: JSX.Element;
|
|
20
|
+
trigger?: React.JSX.Element;
|
|
21
21
|
/** @name 受控的打开关闭 */
|
|
22
22
|
open?: ModalProps['open'];
|
|
23
23
|
/** @name 打开关闭的事件 */
|
|
@@ -9,7 +9,7 @@ declare namespace ProForm {
|
|
|
9
9
|
var Group: React.FC<import("src/form").GroupProps>;
|
|
10
10
|
var useForm: typeof import("antd/es/form/Form").useForm;
|
|
11
11
|
var Item: React.FC<import("src/form/components/FormItem").ProFormItemProps>;
|
|
12
|
-
var useWatch: typeof import("
|
|
12
|
+
var useWatch: typeof import("@rc-component/form").useWatch;
|
|
13
13
|
var ErrorList: React.FC<import("antd/es/form").ErrorListProps>;
|
|
14
14
|
var Provider: React.FC<import("antd/es/form/context").FormProviderProps>;
|
|
15
15
|
var useFormInstance: typeof import("antd/es/form/hooks/useFormInstance").default;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _icons = require("@ant-design/icons");
|
|
9
9
|
var _antd = require("antd");
|
|
10
|
+
var _clsx = require("clsx");
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
12
|
var _provider = require("../../../provider");
|
|
12
13
|
var _utils = require("../../../utils");
|
|
@@ -59,7 +60,7 @@ const Actions = props => {
|
|
|
59
60
|
style: style,
|
|
60
61
|
size: 16,
|
|
61
62
|
children: [submitter, props.collapseRender !== false && /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
62
|
-
className:
|
|
63
|
+
className: (0, _clsx.clsx)(getPrefixCls('pro-query-filter-collapse-button'), hashId),
|
|
63
64
|
onClick: () => setCollapsed(!collapsed),
|
|
64
65
|
children: collapseRender?.(collapsed, props, intl, hiddenNum)
|
|
65
66
|
})]
|
|
@@ -17,20 +17,28 @@ var _BaseForm = require("../../BaseForm");
|
|
|
17
17
|
var _Actions = _interopRequireDefault(require("./Actions"));
|
|
18
18
|
var _style = require("./style");
|
|
19
19
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
/** 从 antd 设计 token 获取断点配置,与 Grid 响应式布局保持一致 */
|
|
21
|
+
const getBreakpointsConfig = token => {
|
|
22
|
+
const defaultToken = _antd.theme.getDesignToken();
|
|
23
|
+
const t = {
|
|
24
|
+
...defaultToken,
|
|
25
|
+
...token
|
|
26
|
+
};
|
|
27
|
+
const bp = {
|
|
28
|
+
xs: t.screenSMMin ?? 576,
|
|
29
|
+
sm: t.screenMDMin ?? 768,
|
|
30
|
+
md: t.screenLGMin ?? 992,
|
|
31
|
+
lg: t.screenXLMin ?? 1200,
|
|
32
|
+
xl: t.screenXXLMin ?? 1600,
|
|
33
|
+
xxl: Infinity
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
configSpanBreakpoints: bp,
|
|
37
|
+
breakpoints: {
|
|
38
|
+
vertical: [[bp.xs, 1, 'vertical'], [bp.md, 2, 'vertical'], [bp.xl, 3, 'vertical'], [Infinity, 4, 'vertical']],
|
|
39
|
+
default: [[bp.xs, 1, 'vertical'], [bp.sm, 2, 'vertical'], [bp.xl, 3, 'horizontal'], [Infinity, 4, 'horizontal']]
|
|
40
|
+
}
|
|
41
|
+
};
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
/**
|
|
@@ -38,16 +46,21 @@ const BREAKPOINTS = {
|
|
|
38
46
|
*
|
|
39
47
|
* @param layout
|
|
40
48
|
* @param width
|
|
49
|
+
* @param breakpointsConfig 从 theme.useToken() 获取,支持 ConfigProvider 主题定制
|
|
41
50
|
*/
|
|
42
|
-
const getSpanConfig = (layout, width, span) => {
|
|
51
|
+
const getSpanConfig = (layout, width, span, breakpointsConfig) => {
|
|
43
52
|
if (span && typeof span === 'number') {
|
|
44
53
|
return {
|
|
45
54
|
span,
|
|
46
55
|
layout
|
|
47
56
|
};
|
|
48
57
|
}
|
|
49
|
-
const
|
|
50
|
-
|
|
58
|
+
const {
|
|
59
|
+
breakpoints,
|
|
60
|
+
configSpanBreakpoints
|
|
61
|
+
} = breakpointsConfig;
|
|
62
|
+
const spanConfig = span ? ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].map(key => [configSpanBreakpoints[key], 24 / span[key], 'horizontal']) : breakpoints[layout || 'default'];
|
|
63
|
+
const breakPoint = (spanConfig || breakpoints.default).find(item => width < item[0] + 16 // 16 = 2 * (ant-row -8px margin)
|
|
51
64
|
);
|
|
52
65
|
if (!breakPoint) {
|
|
53
66
|
return {
|
|
@@ -206,12 +219,12 @@ const QueryFilterContent = props => {
|
|
|
206
219
|
if (split && currentSpan % 24 === 0 && index < itemLength - 1) {
|
|
207
220
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Col, {
|
|
208
221
|
span: colSpan,
|
|
209
|
-
className: `${props.baseClassName}-row-split-line
|
|
222
|
+
className: (0, _clsx.clsx)(`${props.baseClassName}-row-split-line`, `${props.baseClassName}-row-split`, hashId),
|
|
210
223
|
children: itemDom
|
|
211
224
|
}, itemKey);
|
|
212
225
|
}
|
|
213
226
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Col, {
|
|
214
|
-
className: `${props.baseClassName}-row-split
|
|
227
|
+
className: (0, _clsx.clsx)(`${props.baseClassName}-row-split`, hashId),
|
|
215
228
|
span: colSpan,
|
|
216
229
|
children: itemDom
|
|
217
230
|
}, itemKey);
|
|
@@ -250,7 +263,7 @@ const QueryFilterContent = props => {
|
|
|
250
263
|
label: " ",
|
|
251
264
|
colon: false,
|
|
252
265
|
shouldUpdate: false,
|
|
253
|
-
className: `${baseClassName}-actions
|
|
266
|
+
className: (0, _clsx.clsx)(`${baseClassName}-actions`, hashId),
|
|
254
267
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Actions.default, {
|
|
255
268
|
hiddenNum: hiddenNum,
|
|
256
269
|
collapsed: collapsed,
|
|
@@ -293,8 +306,12 @@ function QueryFilter(props) {
|
|
|
293
306
|
wrapSSR,
|
|
294
307
|
hashId
|
|
295
308
|
} = (0, _style.useStyle)(baseClassName);
|
|
309
|
+
const {
|
|
310
|
+
token
|
|
311
|
+
} = _antd.theme.useToken();
|
|
296
312
|
const [width, setWidth] = (0, _react.useState)(() => typeof style?.width === 'number' ? style?.width : defaultWidth);
|
|
297
|
-
const
|
|
313
|
+
const breakpointsConfig = (0, _react.useMemo)(() => getBreakpointsConfig(token), [token.screenSMMin, token.screenMDMin, token.screenLGMin, token.screenXLMin, token.screenXXLMin]);
|
|
314
|
+
const spanSize = (0, _react.useMemo)(() => getSpanConfig(layout, width + 16, span, breakpointsConfig), [layout, width, span, breakpointsConfig]);
|
|
298
315
|
const showLength = (0, _react.useMemo)(() => {
|
|
299
316
|
if (defaultFormItemsNumber !== undefined) {
|
|
300
317
|
return defaultFormItemsNumber;
|
|
@@ -334,7 +351,7 @@ function QueryFilter(props) {
|
|
|
334
351
|
},
|
|
335
352
|
children: ref => /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
336
353
|
ref: ref,
|
|
337
|
-
className: `${baseClassName}-container
|
|
354
|
+
className: (0, _clsx.clsx)(`${baseClassName}-container`, hashId),
|
|
338
355
|
style: props.containerStyle,
|
|
339
356
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_BaseForm.BaseForm, {
|
|
340
357
|
isKeyPressSubmit: true,
|
|
@@ -216,7 +216,7 @@ function StepsForm(props) {
|
|
|
216
216
|
})
|
|
217
217
|
};
|
|
218
218
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
219
|
-
className: `${prefixCls}-steps-container
|
|
219
|
+
className: (0, _clsx.clsx)(`${prefixCls}-steps-container`, hashId),
|
|
220
220
|
style: {
|
|
221
221
|
maxWidth: Math.min(formArray.length * 320, 1160)
|
|
222
222
|
},
|
|
@@ -345,7 +345,7 @@ function StepsForm(props) {
|
|
|
345
345
|
return stepsDom;
|
|
346
346
|
}, [formArray, stepsDom, stepsRender]);
|
|
347
347
|
const formContainer = (0, _react.useMemo)(() => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
348
|
-
className: `${prefixCls}-container
|
|
348
|
+
className: (0, _clsx.clsx)(`${prefixCls}-container`, hashId),
|
|
349
349
|
style: containerStyle,
|
|
350
350
|
children: [formDom, stepsFormRender ? null : /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Space, {
|
|
351
351
|
children: submitterDom
|
|
@@ -46,11 +46,11 @@ export type ProLayoutProps = GlobalTypes & {
|
|
|
46
46
|
* @name logo 的配置,可以配置url,React 组件 和 false
|
|
47
47
|
*
|
|
48
48
|
* @example 设置 logo 为网络地址 logo="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4"
|
|
49
|
-
* @example 设置 logo 为组件 logo={<img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4"/>}
|
|
49
|
+
* @example 设置 logo 为组件 logo={<img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4" alt="" />}
|
|
50
50
|
* @example 设置 logo 为 false 不显示 logo logo={false}
|
|
51
|
-
* @example 设置 logo 为 方法 logo={()=> <img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4"/> }
|
|
51
|
+
* @example 设置 logo 为 方法 logo={()=> <img src="https://avatars1.githubusercontent.com/u/8186664?s=460&v=4" alt="" /> }
|
|
52
52
|
* */
|
|
53
|
-
logo?: React.ReactNode | JSX.Element | WithFalse<() => React.ReactNode | JSX.Element>;
|
|
53
|
+
logo?: React.ReactNode | React.JSX.Element | WithFalse<() => React.ReactNode | React.JSX.Element>;
|
|
54
54
|
/**
|
|
55
55
|
* @name 页面切换的时候触发
|
|
56
56
|
*
|
package/lib/layout/ProLayout.js
CHANGED
|
@@ -169,7 +169,7 @@ const BaseProLayout = props => {
|
|
|
169
169
|
}, [props.layout, propsSiderWidth]);
|
|
170
170
|
const context = (0, _react.useContext)(_antd.ConfigProvider.ConfigContext);
|
|
171
171
|
const prefixCls = props.prefixCls ?? context.getPrefixCls('pro');
|
|
172
|
-
const [
|
|
172
|
+
const [menuLoadingState, _setMenuLoadingInner] = (0, _util.useControlledState)(false, menu?.loading);
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
175
|
* 使用 useRefFunction 包装回调,确保引用稳定
|
|
@@ -178,20 +178,6 @@ const BaseProLayout = props => {
|
|
|
178
178
|
menu?.onLoadingChange?.(loading);
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
-
/**
|
|
182
|
-
* 包装 setMenuLoading,使用 queueMicrotask 延迟回调调用
|
|
183
|
-
* 避免在渲染阶段调用外部回调导致的 React 警告
|
|
184
|
-
*/
|
|
185
|
-
const setMenuLoading = (0, _react.useCallback)(updater => {
|
|
186
|
-
setMenuLoadingInner(prev => {
|
|
187
|
-
const next = typeof updater === 'function' ? updater(prev) : updater;
|
|
188
|
-
queueMicrotask(() => {
|
|
189
|
-
menuOnLoadingChange(next);
|
|
190
|
-
});
|
|
191
|
-
return next;
|
|
192
|
-
});
|
|
193
|
-
}, [menuOnLoadingChange]);
|
|
194
|
-
|
|
195
181
|
// give a default key for swr
|
|
196
182
|
const [defaultId] = (0, _react.useState)(() => {
|
|
197
183
|
layoutIndex += 1;
|
|
@@ -221,20 +207,21 @@ const BaseProLayout = props => {
|
|
|
221
207
|
const {
|
|
222
208
|
data,
|
|
223
209
|
mutate,
|
|
224
|
-
|
|
210
|
+
isValidating
|
|
225
211
|
} = (0, _swr.default)([defaultId, menu?.params], async ([, params]) => {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
212
|
+
menuOnLoadingChange(true);
|
|
213
|
+
try {
|
|
214
|
+
const menuDataItems = await menu?.request?.(params || {}, route?.children || route?.routes || []);
|
|
215
|
+
return menuDataItems;
|
|
216
|
+
} finally {
|
|
217
|
+
menuOnLoadingChange(false);
|
|
218
|
+
}
|
|
230
219
|
}, {
|
|
231
220
|
revalidateOnFocus: false,
|
|
232
221
|
shouldRetryOnError: false,
|
|
233
222
|
revalidateOnReconnect: false
|
|
234
223
|
});
|
|
235
|
-
|
|
236
|
-
setMenuLoading(isLoading);
|
|
237
|
-
}, [isLoading]);
|
|
224
|
+
const menuLoading = menu?.loading ?? (menu?.request ? isValidating : menuLoadingState);
|
|
238
225
|
const {
|
|
239
226
|
cache
|
|
240
227
|
} = (0, _swr.useSWRConfig)();
|
|
@@ -419,11 +406,12 @@ const BaseProLayout = props => {
|
|
|
419
406
|
return bgLayoutImgList?.map((item, index) => {
|
|
420
407
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
421
408
|
src: item.src,
|
|
409
|
+
alt: "",
|
|
422
410
|
style: {
|
|
423
411
|
position: 'absolute',
|
|
424
412
|
...item
|
|
425
413
|
}
|
|
426
|
-
}, index);
|
|
414
|
+
}, item.src ?? `bg-layout-${index}`);
|
|
427
415
|
});
|
|
428
416
|
}
|
|
429
417
|
return null;
|
|
@@ -495,7 +483,7 @@ const BaseProLayout = props => {
|
|
|
495
483
|
children: siderMenuDom
|
|
496
484
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
497
485
|
style: genLayoutStyle,
|
|
498
|
-
className: `${proLayoutClassName}-container
|
|
486
|
+
className: (0, _clsx.clsx)(`${proLayoutClassName}-container`, hashId),
|
|
499
487
|
children: [headerDom, /*#__PURE__*/(0, _jsxRuntime.jsx)(_WrapContent.WrapContent, {
|
|
500
488
|
hasPageContainer: hasPageContainer,
|
|
501
489
|
isChildrenLayout: isChildrenLayout,
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.DefaultContent = void 0;
|
|
8
|
+
var _clsx = require("clsx");
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _index = require("./index");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -16,15 +17,15 @@ const DefaultContent = props => {
|
|
|
16
17
|
itemClick
|
|
17
18
|
} = props;
|
|
18
19
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
19
|
-
className: `${baseClassName}-content
|
|
20
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content`, hashId),
|
|
20
21
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
21
|
-
className: `${baseClassName}-content-list
|
|
22
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content-list`, hashId),
|
|
22
23
|
children: appList?.map((app, index) => {
|
|
23
24
|
if (app?.children?.length) {
|
|
24
25
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
25
|
-
className: `${baseClassName}-content-list-item-group
|
|
26
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content-list-item-group`, hashId),
|
|
26
27
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
27
|
-
className: `${baseClassName}-content-list-item-group-title
|
|
28
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content-list-item-group-title`, hashId),
|
|
28
29
|
children: app.title
|
|
29
30
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(DefaultContent, {
|
|
30
31
|
hashId: hashId,
|
|
@@ -35,7 +36,7 @@ const DefaultContent = props => {
|
|
|
35
36
|
}, index);
|
|
36
37
|
}
|
|
37
38
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
38
|
-
className: `${baseClassName}-content-list-item
|
|
39
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content-list-item`, hashId),
|
|
39
40
|
onClick: e => {
|
|
40
41
|
e.stopPropagation();
|
|
41
42
|
itemClick?.(app);
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.renderLogo = exports.SimpleContent = void 0;
|
|
8
|
+
var _clsx = require("clsx");
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _utils = require("../../../utils");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -49,15 +50,15 @@ const SimpleContent = props => {
|
|
|
49
50
|
itemClick
|
|
50
51
|
} = props;
|
|
51
52
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
52
|
-
className: `${baseClassName}-content
|
|
53
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content`, hashId),
|
|
53
54
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
|
|
54
|
-
className: `${baseClassName}-content-list
|
|
55
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content-list`, hashId),
|
|
55
56
|
children: appList?.map((app, index) => {
|
|
56
57
|
if (app?.children?.length) {
|
|
57
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
58
|
-
className: `${baseClassName}-content-list-item-group
|
|
59
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content-list-item-group`, hashId),
|
|
59
60
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
60
|
-
className: `${baseClassName}-content-list-item-group-title
|
|
61
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content-list-item-group-title`, hashId),
|
|
61
62
|
children: app.title
|
|
62
63
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SimpleContent, {
|
|
63
64
|
hashId: hashId,
|
|
@@ -68,7 +69,7 @@ const SimpleContent = props => {
|
|
|
68
69
|
}, index);
|
|
69
70
|
}
|
|
70
71
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
71
|
-
className: `${baseClassName}-content-list-item
|
|
72
|
+
className: (0, _clsx.clsx)(`${baseClassName}-content-list-item`, hashId),
|
|
72
73
|
onClick: e => {
|
|
73
74
|
e.stopPropagation();
|
|
74
75
|
itemClick?.(app);
|
|
@@ -9,7 +9,7 @@ export type FooterToolbarProps = {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
renderContent?: (props: FooterToolbarProps & RouteContextType & {
|
|
11
11
|
leftWidth?: string;
|
|
12
|
-
}, dom: JSX.Element) => ReactNode;
|
|
12
|
+
}, dom: React.JSX.Element) => ReactNode;
|
|
13
13
|
prefixCls?: string;
|
|
14
14
|
stylish?: GenerateStyle<FooterToolBarToken>;
|
|
15
15
|
children?: React.ReactNode;
|
|
@@ -61,10 +61,10 @@ const FooterToolbar = props => {
|
|
|
61
61
|
});
|
|
62
62
|
const dom = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
63
63
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
64
|
-
className: `${baseClassName}-left
|
|
64
|
+
className: (0, _clsx.clsx)(`${baseClassName}-left`, hashId),
|
|
65
65
|
children: extra
|
|
66
66
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
67
|
-
className: `${baseClassName}-right
|
|
67
|
+
className: (0, _clsx.clsx)(`${baseClassName}-right`, hashId),
|
|
68
68
|
children: children
|
|
69
69
|
})]
|
|
70
70
|
});
|
|
@@ -30,9 +30,9 @@ const GlobalFooter = ({
|
|
|
30
30
|
className: (0, _clsx.clsx)(baseClassName, hashId, className),
|
|
31
31
|
style: style,
|
|
32
32
|
children: [links && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
33
|
-
className: `${baseClassName}-list
|
|
33
|
+
className: (0, _clsx.clsx)(`${baseClassName}-list`, hashId),
|
|
34
34
|
children: links.map(link => /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|
|
35
|
-
className: `${baseClassName}-list-link
|
|
35
|
+
className: (0, _clsx.clsx)(`${baseClassName}-list-link`, hashId),
|
|
36
36
|
title: link.key,
|
|
37
37
|
target: link.blankTarget ? '_blank' : '_self',
|
|
38
38
|
href: link.href,
|
|
@@ -40,7 +40,7 @@ const GlobalFooter = ({
|
|
|
40
40
|
children: link.title
|
|
41
41
|
}, link.key))
|
|
42
42
|
}), copyright && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
43
|
-
className: `${baseClassName}-copyright
|
|
43
|
+
className: (0, _clsx.clsx)(`${baseClassName}-copyright`, hashId),
|
|
44
44
|
children: copyright
|
|
45
45
|
})]
|
|
46
46
|
}));
|
|
@@ -63,14 +63,14 @@ const ActionsContent = ({
|
|
|
63
63
|
const doms = actionsRender && actionsRender?.(restParams);
|
|
64
64
|
if (!doms && !avatarDom) return null;
|
|
65
65
|
if (!Array.isArray(doms)) return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
66
|
-
className: `${prefixCls}-header-actions
|
|
66
|
+
className: (0, _clsx.clsx)(`${prefixCls}-header-actions`, hashId),
|
|
67
67
|
children: [doms, avatarDom && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
68
|
-
className: `${prefixCls}-header-actions-avatar
|
|
68
|
+
className: (0, _clsx.clsx)(`${prefixCls}-header-actions-avatar`, hashId),
|
|
69
69
|
children: avatarDom
|
|
70
70
|
})]
|
|
71
71
|
}));
|
|
72
72
|
return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
73
|
-
className: `${prefixCls}-header-actions
|
|
73
|
+
className: (0, _clsx.clsx)(`${prefixCls}-header-actions`, hashId),
|
|
74
74
|
children: [doms.filter(Boolean).map((dom, index) => {
|
|
75
75
|
let hideHover = false;
|
|
76
76
|
// 如果配置了 hideHover 就不展示 hover 效果了
|
|
@@ -78,13 +78,13 @@ const ActionsContent = ({
|
|
|
78
78
|
hideHover = !!dom?.props?.['aria-hidden'];
|
|
79
79
|
}
|
|
80
80
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
81
|
-
className: (0, _clsx.clsx)(`${prefixCls}-header-actions-item
|
|
81
|
+
className: (0, _clsx.clsx)(`${prefixCls}-header-actions-item`, hashId, {
|
|
82
82
|
[`${prefixCls}-header-actions-hover`]: !hideHover
|
|
83
83
|
}),
|
|
84
84
|
children: dom
|
|
85
85
|
}, index);
|
|
86
86
|
}), avatarDom && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
87
|
-
className: `${prefixCls}-header-actions-avatar
|
|
87
|
+
className: (0, _clsx.clsx)(`${prefixCls}-header-actions-avatar`, hashId),
|
|
88
88
|
children: avatarDom
|
|
89
89
|
})]
|
|
90
90
|
}));
|
|
@@ -95,7 +95,7 @@ const ActionsContent = ({
|
|
|
95
95
|
}, 160);
|
|
96
96
|
const contentRender = rightActionsRender;
|
|
97
97
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
98
|
-
className: `${prefixCls}-right-content
|
|
98
|
+
className: (0, _clsx.clsx)(`${prefixCls}-right-content`, hashId),
|
|
99
99
|
style: {
|
|
100
100
|
minWidth: rightSize,
|
|
101
101
|
height: '100%'
|
|
@@ -82,7 +82,7 @@ const GlobalHeader = props => {
|
|
|
82
82
|
...style
|
|
83
83
|
},
|
|
84
84
|
children: [isMobile && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
85
|
-
className: `${baseClassName}-collapsed-button
|
|
85
|
+
className: (0, _clsx.clsx)(`${baseClassName}-collapsed-button`, hashId),
|
|
86
86
|
onClick: () => {
|
|
87
87
|
onCollapse?.(!collapsed);
|
|
88
88
|
},
|
|
@@ -42,7 +42,7 @@ const GridContent = props => {
|
|
|
42
42
|
}),
|
|
43
43
|
style: style,
|
|
44
44
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
45
|
-
className: `${prefixCls}-grid-content-children
|
|
45
|
+
className: (0, _clsx.clsx)(`${prefixCls}-grid-content-children`, hashId),
|
|
46
46
|
children: children
|
|
47
47
|
})
|
|
48
48
|
}));
|
|
@@ -8,6 +8,7 @@ exports.SelectKeyProvide = exports.ProHelpPanel = void 0;
|
|
|
8
8
|
var _icons = require("@ant-design/icons");
|
|
9
9
|
var _util = require("@rc-component/util");
|
|
10
10
|
var _antd = require("antd");
|
|
11
|
+
var _clsx = require("clsx");
|
|
11
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
13
|
var _provider = require("../../../provider");
|
|
13
14
|
var _HelpProvide = require("./HelpProvide");
|
|
@@ -82,7 +83,7 @@ const ProHelpPanel = ({
|
|
|
82
83
|
const parentKey = (0, _react.useMemo)(() => dataSourceKeyMap.get(selectedKey)?.parentKey, [dataSourceKeyMap, selectedKey]);
|
|
83
84
|
const defaultExtraActions = {
|
|
84
85
|
collapsePanelAction: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
85
|
-
className: `${className}-actions-item
|
|
86
|
+
className: (0, _clsx.clsx)(`${className}-actions-item`, hashId),
|
|
86
87
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ProfileOutlined, {
|
|
87
88
|
title: "collapse panel",
|
|
88
89
|
onClick: () => {
|
|
@@ -91,8 +92,8 @@ const ProHelpPanel = ({
|
|
|
91
92
|
})
|
|
92
93
|
}),
|
|
93
94
|
helpSelectAction: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Search.ProHelpSelect, {
|
|
94
|
-
iconClassName: `${className}-actions-item`,
|
|
95
|
-
className:
|
|
95
|
+
iconClassName: (0, _clsx.clsx)(`${className}-actions-item`, hashId),
|
|
96
|
+
className: (0, _clsx.clsx)(hashId, `${className}-actions-input`),
|
|
96
97
|
value: selectedKey,
|
|
97
98
|
onChange: (value, item) => {
|
|
98
99
|
setSelectedKey(value);
|
|
@@ -100,7 +101,7 @@ const ProHelpPanel = ({
|
|
|
100
101
|
}
|
|
101
102
|
}),
|
|
102
103
|
closeAction: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
103
|
-
className: `${className}-actions-item
|
|
104
|
+
className: (0, _clsx.clsx)(`${className}-actions-item`, hashId),
|
|
104
105
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.CloseOutlined, {
|
|
105
106
|
title: "close panel",
|
|
106
107
|
onClick: () => {
|
|
@@ -111,7 +112,7 @@ const ProHelpPanel = ({
|
|
|
111
112
|
};
|
|
112
113
|
const extraDomList = () => {
|
|
113
114
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
114
|
-
className: `${className}-actions
|
|
115
|
+
className: (0, _clsx.clsx)(`${className}-actions`, hashId),
|
|
115
116
|
children: extraRender ? extraRender(defaultExtraActions.collapsePanelAction, defaultExtraActions.helpSelectAction, defaultExtraActions.closeAction) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
116
117
|
children: [defaultExtraActions.collapsePanelAction, defaultExtraActions.helpSelectAction, onClose ? defaultExtraActions.closeAction : null]
|
|
117
118
|
})
|
|
@@ -137,7 +138,7 @@ const ProHelpPanel = ({
|
|
|
137
138
|
size: "small",
|
|
138
139
|
extra: extraDomList(),
|
|
139
140
|
children: [showLeftPanel ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
140
|
-
className:
|
|
141
|
+
className: (0, _clsx.clsx)(hashId, `${className}-left-panel`),
|
|
141
142
|
style: {
|
|
142
143
|
height
|
|
143
144
|
},
|
|
@@ -167,7 +168,7 @@ const ProHelpPanel = ({
|
|
|
167
168
|
}
|
|
168
169
|
},
|
|
169
170
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_antd.Menu, {
|
|
170
|
-
className:
|
|
171
|
+
className: (0, _clsx.clsx)(hashId, `${className}-left-panel-menu`),
|
|
171
172
|
openKeys: [parentKey, openKey],
|
|
172
173
|
onOpenChange: keys => {
|
|
173
174
|
setOpenKey(keys.at(-1) || '');
|
|
@@ -194,17 +195,17 @@ const ProHelpPanel = ({
|
|
|
194
195
|
})
|
|
195
196
|
})
|
|
196
197
|
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
197
|
-
className:
|
|
198
|
+
className: (0, _clsx.clsx)(hashId, `${className}-content-panel`),
|
|
198
199
|
style: {
|
|
199
200
|
height
|
|
200
201
|
},
|
|
201
202
|
children: [selectedKey ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_ProHelpContentPanel.ProHelpContentPanel, {
|
|
202
203
|
parentItem: dataSourceKeyMap.get(parentKey),
|
|
203
|
-
className: `${className}-content-render`,
|
|
204
|
+
className: (0, _clsx.clsx)(`${className}-content-render`, hashId),
|
|
204
205
|
selectedKey: selectedKey,
|
|
205
206
|
onScroll: key => setSelectedKey(key)
|
|
206
207
|
}) : null, footer ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
207
|
-
className:
|
|
208
|
+
className: (0, _clsx.clsx)(hashId, `${className}-footer`),
|
|
208
209
|
children: footer
|
|
209
210
|
}) : null]
|
|
210
211
|
})]
|