@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.
Files changed (40) 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 +179 -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 +283 -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/package.json +2 -6
  39. package/readme.md +128 -128
  40. package/components/Column/Readonly/Option.tsx +0 -58
@@ -1,58 +0,0 @@
1
- import {Component, lazy, useEffect, useState} from "react";
2
- import {ReactComponentLike} from "prop-types";
3
- import container from "../../../lib/container";
4
- import {Flex} from "antd";
5
- import {ColumnReadonlyProps} from "./types";
6
- import {asyncFilter, handleRules} from "../../../lib/helpers";
7
- import {Rules} from "@rc-component/async-validator/lib/interface";
8
- import upperFirst from "lodash/upperFirst";
9
-
10
- type ComponentType = {
11
- component: ReactComponentLike,
12
- props: any,
13
- }
14
-
15
- export default ({options, record}: ColumnReadonlyProps & {
16
- options?: {
17
- type: string,
18
- title: string,
19
- showRules?: Rules,
20
- }[],
21
- }) => {
22
-
23
- const [Components, setComponents] = useState<ComponentType[]>([]);
24
-
25
- useEffect(() => {
26
- if (options) {
27
- asyncFilter(options, async (Component) => {
28
- if (!Component.showRules) {
29
- return true
30
- }
31
- return await handleRules(Component.showRules, record)
32
- }).then((Components: { type: string }[]) => setComponents(Components.map(a => {
33
- const c = `Table.Option.${upperFirst(a.type)}`
34
- return {
35
- props: {
36
- ...a,
37
- record,
38
- },
39
- component: lazy(container.get(c)),
40
- }
41
- })))
42
- }
43
- }, []);
44
-
45
-
46
- return <>
47
- {
48
- <Flex wrap={true}>
49
- {
50
- Components.map(Component => {
51
- return <Component.component
52
- key={Component.props.title} {...Component.props}></Component.component>
53
- })
54
- }
55
- </Flex>
56
- }
57
- </>
58
- }