@quansitech/antd-admin 1.0.0 → 1.0.1
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/components/Column/Cascader.tsx +78 -78
- package/components/Column/File.tsx +165 -167
- package/components/Column/Image.tsx +76 -76
- package/components/{Table/Option → Column/Readonly/Action}/Link.tsx +77 -67
- package/components/{Table/Option → Column/Readonly/Action}/types.d.ts +5 -4
- package/components/Column/Readonly/Action.tsx +80 -0
- package/components/Column/Readonly/Cascader.tsx +50 -50
- package/components/Column/Readonly/File.tsx +52 -53
- package/components/Column/Readonly/Image.tsx +38 -77
- package/components/Column/Readonly/Ueditor.tsx +18 -0
- package/components/Column/Readonly/types.d.ts +9 -8
- package/components/Column/Ueditor.tsx +313 -313
- package/components/Column/types.d.ts +29 -28
- package/components/Form/Action/Button.tsx +128 -124
- package/components/Form/Action/types.d.ts +5 -4
- package/components/Form/Actions.tsx +38 -34
- package/components/Form.tsx +179 -170
- package/components/FormContext.ts +8 -7
- package/components/Layout/New.tsx +252 -0
- package/components/Layout.tsx +52 -237
- package/components/LayoutContext.ts +25 -25
- package/components/ModalContext.ts +15 -15
- package/components/Table/Action/Button.tsx +88 -88
- package/components/Table/Action/StartEditable.tsx +58 -58
- package/components/Table/Action/types.d.ts +7 -6
- package/components/Table/ToolbarActions.tsx +43 -38
- package/components/Table.scss +4 -7
- package/components/Table.tsx +283 -279
- package/components/TableContext.ts +14 -13
- package/components/Tabs.tsx +71 -71
- package/lib/container.ts +83 -81
- package/lib/customRule.ts +9 -9
- package/lib/global.ts +10 -10
- package/lib/helpers.tsx +145 -149
- package/lib/http.ts +73 -73
- package/lib/schemaHandler.ts +121 -121
- package/lib/upload.ts +177 -177
- package/package.json +2 -6
- package/readme.md +128 -128
- package/components/Column/Readonly/Option.tsx +0 -58
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export type TableActionProps = {
|
|
2
|
-
type: string,
|
|
3
|
-
title: string,
|
|
4
|
-
props?: Record<string, any>,
|
|
5
|
-
relateSelection?: boolean,
|
|
6
|
-
selectedRows?: any[],
|
|
1
|
+
export type TableActionProps = {
|
|
2
|
+
type: string,
|
|
3
|
+
title: string,
|
|
4
|
+
props?: Record<string, any>,
|
|
5
|
+
relateSelection?: boolean,
|
|
6
|
+
selectedRows?: any[],
|
|
7
|
+
badge?: string | number,
|
|
7
8
|
}
|
|
@@ -1,39 +1,44 @@
|
|
|
1
|
-
import {lazy, useEffect, useState} from "react";
|
|
2
|
-
import container from "../../lib/container";
|
|
3
|
-
import {ReactComponentLike} from "prop-types";
|
|
4
|
-
import {Space} from "antd";
|
|
5
|
-
import {TableActionProps} from "./Action/types";
|
|
6
|
-
import upperFirst from "lodash/upperFirst";
|
|
7
|
-
|
|
8
|
-
export default function ({
|
|
9
|
-
actions,
|
|
10
|
-
selectedRows,
|
|
11
|
-
}: {
|
|
12
|
-
actions: TableActionProps[],
|
|
13
|
-
selectedRows?: any[]
|
|
14
|
-
}) {
|
|
15
|
-
const [components, setComponents] = useState<{
|
|
16
|
-
Component: ReactComponentLike,
|
|
17
|
-
props: TableActionProps,
|
|
18
|
-
}[]>([])
|
|
19
|
-
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
setComponents(actions.map(a => {
|
|
22
|
-
return {
|
|
23
|
-
Component: lazy(container.get('Table.Action.' + upperFirst(a.type))),
|
|
24
|
-
props: {
|
|
25
|
-
...a,
|
|
26
|
-
},
|
|
27
|
-
}
|
|
28
|
-
}))
|
|
29
|
-
|
|
30
|
-
}, []);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import {lazy, useEffect, useState} from "react";
|
|
2
|
+
import container from "../../lib/container";
|
|
3
|
+
import {ReactComponentLike} from "prop-types";
|
|
4
|
+
import {Badge, Space} from "antd";
|
|
5
|
+
import {TableActionProps} from "./Action/types";
|
|
6
|
+
import upperFirst from "lodash/upperFirst";
|
|
7
|
+
|
|
8
|
+
export default function ({
|
|
9
|
+
actions,
|
|
10
|
+
selectedRows,
|
|
11
|
+
}: {
|
|
12
|
+
actions: TableActionProps[],
|
|
13
|
+
selectedRows?: any[]
|
|
14
|
+
}) {
|
|
15
|
+
const [components, setComponents] = useState<{
|
|
16
|
+
Component: ReactComponentLike,
|
|
17
|
+
props: TableActionProps,
|
|
18
|
+
}[]>([])
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
setComponents(actions.map(a => {
|
|
22
|
+
return {
|
|
23
|
+
Component: lazy(container.get('Table.Action.' + upperFirst(a.type))),
|
|
24
|
+
props: {
|
|
25
|
+
...a,
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
}))
|
|
29
|
+
|
|
30
|
+
}, []);
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
return <>
|
|
34
|
+
<Space wrap={true}>
|
|
35
|
+
{components.map(c => (
|
|
36
|
+
c.props.badge ?
|
|
37
|
+
<Badge key={c.props.title} count={c.props.badge} style={{zIndex: 100}}>
|
|
38
|
+
<c.Component {...c.props} selectedRows={selectedRows}></c.Component>
|
|
39
|
+
</Badge> :
|
|
40
|
+
<c.Component key={c.props.title} {...c.props} selectedRows={selectedRows}></c.Component>
|
|
41
|
+
))}
|
|
42
|
+
</Space>
|
|
43
|
+
</>
|
|
39
44
|
}
|
package/components/Table.scss
CHANGED