@fe-free/core 3.0.33 → 3.0.34
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/CHANGELOG.md +8 -0
- package/package.json +3 -3
- package/src/core_app/index.tsx +11 -1
- package/src/crud/crud.stories.tsx +10 -0
- package/src/crud_of_pure/index.tsx +4 -1
- package/src/style.scss +5 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.34",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
"antd": "^5.27.1",
|
|
47
47
|
"dayjs": "~1.11.10",
|
|
48
48
|
"react": "^19.2.0",
|
|
49
|
-
"@fe-free/icons": "3.0.
|
|
50
|
-
"@fe-free/tool": "3.0.
|
|
49
|
+
"@fe-free/icons": "3.0.34",
|
|
50
|
+
"@fe-free/tool": "3.0.34"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"test": "echo \"Error: no test specified\" && exit 1"
|
package/src/core_app/index.tsx
CHANGED
|
@@ -2,6 +2,7 @@ import { ProConfigProvider } from '@ant-design/pro-components';
|
|
|
2
2
|
import { useTitle } from 'ahooks';
|
|
3
3
|
import { App, ConfigProvider } from 'antd';
|
|
4
4
|
import zhCN from 'antd/locale/zh_CN';
|
|
5
|
+
import classNames from 'classnames';
|
|
5
6
|
import { merge } from 'lodash-es';
|
|
6
7
|
import { useEffect, useMemo } from 'react';
|
|
7
8
|
import { BrowserRouter as Router, useNavigate } from 'react-router-dom';
|
|
@@ -103,6 +104,9 @@ function CoreApp(props: {
|
|
|
103
104
|
appProps?: Omit<React.ComponentProps<typeof App>, 'children'>;
|
|
104
105
|
routerProps?: Omit<Partial<React.ComponentProps<typeof Router>>, 'children'>;
|
|
105
106
|
children: React.ReactNode;
|
|
107
|
+
customConfig?: {
|
|
108
|
+
hiddenFormItemLabelColon?: boolean;
|
|
109
|
+
};
|
|
106
110
|
}) {
|
|
107
111
|
const {
|
|
108
112
|
basename,
|
|
@@ -113,6 +117,7 @@ function CoreApp(props: {
|
|
|
113
117
|
configProviderProps,
|
|
114
118
|
appProps,
|
|
115
119
|
routerProps,
|
|
120
|
+
customConfig,
|
|
116
121
|
} = props;
|
|
117
122
|
|
|
118
123
|
useTitle(name || '');
|
|
@@ -140,7 +145,12 @@ function CoreApp(props: {
|
|
|
140
145
|
locale={configProviderProps?.locale || zhCN}
|
|
141
146
|
theme={theme}
|
|
142
147
|
>
|
|
143
|
-
<App
|
|
148
|
+
<App
|
|
149
|
+
{...appProps}
|
|
150
|
+
className={classNames('fec-app', appProps?.className, {
|
|
151
|
+
'fec-app-hidden-form-item-label-colon': customConfig?.hiddenFormItemLabelColon,
|
|
152
|
+
})}
|
|
153
|
+
>
|
|
144
154
|
<Router {...routerProps} basename={basename}>
|
|
145
155
|
<SetRouteTool basename={basename} />
|
|
146
156
|
{enableCheckUpdate && <CheckUpdate basename={basename} />}
|
|
@@ -171,6 +171,16 @@ export const MoreCustom: Story = {
|
|
|
171
171
|
toolBarRender: () => {
|
|
172
172
|
return [<div key="custom1">自定义1</div>, <div key="custom2">自定义2</div>];
|
|
173
173
|
},
|
|
174
|
+
search: {
|
|
175
|
+
optionRender: (_, __, dom) => {
|
|
176
|
+
return [
|
|
177
|
+
...dom,
|
|
178
|
+
<Button key="1" type="primary" className="ml-2">
|
|
179
|
+
额外的按钮
|
|
180
|
+
</Button>,
|
|
181
|
+
];
|
|
182
|
+
},
|
|
183
|
+
},
|
|
174
184
|
}}
|
|
175
185
|
operateColumnProps={{
|
|
176
186
|
// 自定义宽度
|
|
@@ -13,7 +13,10 @@ interface CRUDOfPureProps<
|
|
|
13
13
|
specialToolbar?: boolean;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function CRUDOfPure
|
|
16
|
+
function CRUDOfPure<
|
|
17
|
+
DataSource extends Record<string, any> = any,
|
|
18
|
+
Key extends string | number = string,
|
|
19
|
+
>(props: CRUDOfPureProps<DataSource, Key>) {
|
|
17
20
|
const newColumns = props.tableProps.columns?.map((column) => {
|
|
18
21
|
if (column.search) {
|
|
19
22
|
return {
|
package/src/style.scss
CHANGED
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
/* stylelint-disable-next-line at-rule-no-unknown */
|
|
15
15
|
@tailwind utilities;
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
.fec-app-hidden-form-item-label-colon {
|
|
18
|
+
// 隐藏 label 的冒号
|
|
19
|
+
.ant-form-item .ant-form-item-label > label::after {
|
|
20
|
+
visibility: hidden;
|
|
21
|
+
}
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
.ant-modal-footer {
|