@quansitech/antd-admin 1.0.0 → 1.1.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.
Files changed (41) hide show
  1. package/components/Column/Cascader.tsx +78 -78
  2. package/components/Column/File.tsx +165 -167
  3. package/components/Column/Image.tsx +76 -76
  4. package/components/{Table/Option → Column/Readonly/Action}/Link.tsx +77 -67
  5. package/components/{Table/Option → Column/Readonly/Action}/types.d.ts +5 -4
  6. package/components/Column/Readonly/Action.tsx +80 -0
  7. package/components/Column/Readonly/Cascader.tsx +50 -50
  8. package/components/Column/Readonly/File.tsx +52 -53
  9. package/components/Column/Readonly/Image.tsx +38 -77
  10. package/components/Column/Readonly/Ueditor.tsx +18 -0
  11. package/components/Column/Readonly/types.d.ts +9 -8
  12. package/components/Column/Ueditor.tsx +313 -313
  13. package/components/Column/types.d.ts +29 -28
  14. package/components/Form/Action/Button.tsx +128 -124
  15. package/components/Form/Action/types.d.ts +5 -4
  16. package/components/Form/Actions.tsx +38 -34
  17. package/components/Form.tsx +176 -170
  18. package/components/FormContext.ts +8 -7
  19. package/components/Layout/New.tsx +252 -0
  20. package/components/Layout.tsx +52 -237
  21. package/components/LayoutContext.ts +25 -25
  22. package/components/ModalContext.ts +15 -15
  23. package/components/Table/Action/Button.tsx +88 -88
  24. package/components/Table/Action/StartEditable.tsx +58 -58
  25. package/components/Table/Action/types.d.ts +7 -6
  26. package/components/Table/ToolbarActions.tsx +43 -38
  27. package/components/Table.scss +4 -7
  28. package/components/Table.tsx +280 -279
  29. package/components/TableContext.ts +14 -13
  30. package/components/Tabs.tsx +71 -71
  31. package/lib/container.ts +83 -81
  32. package/lib/customRule.ts +9 -9
  33. package/lib/global.ts +10 -10
  34. package/lib/helpers.tsx +145 -149
  35. package/lib/http.ts +73 -73
  36. package/lib/schemaHandler.ts +121 -121
  37. package/lib/upload.ts +177 -177
  38. package/lib/writeExtra.js +31 -0
  39. package/package.json +2 -6
  40. package/readme.md +151 -128
  41. 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
- return <>
33
- <Space wrap={true}>
34
- {components.map(c => (
35
- <c.Component key={c.props.title} {...c.props} selectedRows={selectedRows}></c.Component>
36
- ))}
37
- </Space>
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";
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
  }
@@ -1,7 +1,4 @@
1
- //.qs-antd-table {
2
- // table thead {
3
- // position: sticky;
4
- // top: 50px;
5
- // z-index: 1;
6
- // }
7
- //}
1
+ .ant-table-tbody > tr > td {
2
+ word-wrap: break-word;
3
+ word-break: break-all;
4
+ }