proje-react-panel 1.0.17 → 1.1.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 (119) hide show
  1. package/dist/components/Counter.d.ts +9 -0
  2. package/dist/components/DetailsPage.d.ts +7 -0
  3. package/dist/components/ErrorBoundary.d.ts +16 -0
  4. package/dist/components/ErrorComponent.d.ts +4 -0
  5. package/dist/components/LoadingScreen.d.ts +2 -0
  6. package/dist/components/Login.d.ts +13 -0
  7. package/dist/components/Panel.d.ts +1 -3
  8. package/dist/components/components/Checkbox.d.ts +3 -2
  9. package/dist/components/components/FormField.d.ts +5 -1
  10. package/dist/components/components/InnerForm.d.ts +8 -3
  11. package/dist/components/components/Label.d.ts +3 -2
  12. package/dist/components/components/Uploader.d.ts +8 -0
  13. package/dist/components/components/index.d.ts +1 -1
  14. package/dist/components/components/list/ListPage.d.ts +1 -1
  15. package/dist/components/form/Checkbox.d.ts +7 -0
  16. package/dist/components/form/FormField.d.ts +17 -0
  17. package/dist/components/form/FormPage.d.ts +6 -0
  18. package/dist/components/form/InnerForm.d.ts +10 -0
  19. package/dist/components/form/Label.d.ts +9 -0
  20. package/dist/components/form/Select.d.ts +8 -0
  21. package/dist/components/form/SelectStyles.d.ts +7 -0
  22. package/dist/components/form/Uploader.d.ts +8 -0
  23. package/dist/components/layout/Layout.d.ts +3 -4
  24. package/dist/components/layout/SideBar.d.ts +2 -3
  25. package/dist/components/list/CellField.d.ts +9 -0
  26. package/dist/components/list/Datagrid.d.ts +6 -8
  27. package/dist/components/list/FilterPopup.d.ts +7 -5
  28. package/dist/components/list/ListHeader.d.ts +11 -0
  29. package/dist/components/list/ListPage.d.ts +6 -0
  30. package/dist/components/pages/FormPage.d.ts +8 -2
  31. package/dist/decorators/details/Details.d.ts +11 -0
  32. package/dist/decorators/details/DetailsItem.d.ts +11 -0
  33. package/dist/decorators/details/getDetailsPageMeta.d.ts +8 -0
  34. package/dist/decorators/form/Form.d.ts +16 -5
  35. package/dist/decorators/form/Input.d.ts +14 -9
  36. package/dist/decorators/form/getFormPageMeta.d.ts +10 -0
  37. package/dist/decorators/form/inputs/SelectInput.d.ts +23 -0
  38. package/dist/decorators/list/Cell.d.ts +13 -1
  39. package/dist/decorators/list/List.d.ts +18 -1
  40. package/dist/decorators/list/cells/ImageCell.d.ts +9 -0
  41. package/dist/decorators/list/getListPageMeta.d.ts +8 -0
  42. package/dist/index.cjs.js +1 -1
  43. package/dist/index.d.ts +13 -17
  44. package/dist/index.esm.js +1 -1
  45. package/dist/initPanel.d.ts +1 -1
  46. package/dist/store/store.d.ts +0 -3
  47. package/dist/types/AnyClass.d.ts +2 -1
  48. package/dist/types/getDetailsData.d.ts +1 -0
  49. package/dist/types/initPanelOptions.d.ts +0 -1
  50. package/package.json +1 -1
  51. package/src/assets/icons/svg/check.svg +4 -0
  52. package/src/assets/icons/svg/cross.svg +4 -0
  53. package/src/components/DetailsPage.tsx +55 -0
  54. package/src/components/{components/ErrorComponent.tsx → ErrorComponent.tsx} +1 -1
  55. package/src/components/{pages/Login.tsx → Login.tsx} +2 -2
  56. package/src/components/Panel.tsx +4 -5
  57. package/src/components/form/Checkbox.tsx +21 -0
  58. package/src/components/{components → form}/FormField.tsx +22 -30
  59. package/src/components/form/FormPage.tsx +32 -0
  60. package/src/components/form/InnerForm.tsx +84 -0
  61. package/src/components/form/Label.tsx +21 -0
  62. package/src/components/form/Select.tsx +51 -0
  63. package/src/components/form/SelectStyles.ts +73 -0
  64. package/src/components/form/Uploader.tsx +66 -0
  65. package/src/components/layout/Layout.tsx +29 -32
  66. package/src/components/layout/SideBar.tsx +4 -13
  67. package/src/components/list/CellField.tsx +63 -0
  68. package/src/components/list/Datagrid.tsx +106 -0
  69. package/src/components/{components/list → list}/FilterPopup.tsx +13 -9
  70. package/src/components/list/ListHeader.tsx +47 -0
  71. package/src/components/{components/list → list}/ListPage.tsx +20 -82
  72. package/src/decorators/details/Details.ts +31 -0
  73. package/src/decorators/details/DetailsItem.ts +40 -0
  74. package/src/decorators/details/getDetailsPageMeta.ts +15 -0
  75. package/src/decorators/form/Form.ts +38 -12
  76. package/src/decorators/form/Input.ts +31 -9
  77. package/src/decorators/form/getFormPageMeta.ts +21 -0
  78. package/src/decorators/form/inputs/SelectInput.ts +19 -0
  79. package/src/decorators/list/Cell.ts +41 -1
  80. package/src/decorators/list/List.ts +30 -6
  81. package/src/decorators/list/cells/ImageCell.ts +17 -0
  82. package/src/decorators/list/getListPageMeta.ts +16 -0
  83. package/src/index.ts +33 -24
  84. package/src/initPanel.ts +1 -4
  85. package/src/store/store.ts +0 -5
  86. package/src/styles/components/checkbox.scss +42 -0
  87. package/src/styles/components/uploader.scss +86 -0
  88. package/src/styles/details.scss +62 -0
  89. package/src/styles/form.scss +9 -11
  90. package/src/styles/index.scss +26 -12
  91. package/src/styles/list.scss +3 -1
  92. package/src/types/AnyClass.ts +2 -1
  93. package/src/types/initPanelOptions.ts +1 -3
  94. package/src/components/components/Checkbox.tsx +0 -9
  95. package/src/components/components/ImageUploader.tsx +0 -301
  96. package/src/components/components/InnerForm.tsx +0 -74
  97. package/src/components/components/Label.tsx +0 -15
  98. package/src/components/components/index.ts +0 -8
  99. package/src/components/components/list/Datagrid.tsx +0 -127
  100. package/src/components/pages/ControllerDetails.tsx +0 -37
  101. package/src/components/pages/FormPage.tsx +0 -34
  102. package/src/decorators/Crud.ts +0 -20
  103. package/src/decorators/form/FormOptions.ts +0 -8
  104. package/src/decorators/form/getFormFields.ts +0 -13
  105. package/src/decorators/list/GetCellFields.ts +0 -13
  106. package/src/decorators/list/ImageCell.ts +0 -13
  107. package/src/decorators/list/ListData.ts +0 -7
  108. package/src/decorators/list/getListFields.ts +0 -10
  109. package/src/styles/image-uploader.scss +0 -94
  110. package/src/types/Screen.ts +0 -4
  111. package/src/types/ScreenCreatorData.ts +0 -14
  112. package/src/utils/createScreens.ts +0 -5
  113. package/src/utils/getFields.ts +0 -22
  114. /package/src/components/{components/Counter.tsx → Counter.tsx} +0 -0
  115. /package/src/components/{components/ErrorBoundary.tsx → ErrorBoundary.tsx} +0 -0
  116. /package/src/components/{components/LoadingScreen.tsx → LoadingScreen.tsx} +0 -0
  117. /package/src/components/{components/list → list}/EmptyList.tsx +0 -0
  118. /package/src/components/{components/list → list}/Pagination.tsx +0 -0
  119. /package/src/components/{components/list → list}/index.ts +0 -0
@@ -1,94 +0,0 @@
1
- .multi-image {
2
-
3
- &.hover {
4
- .container {
5
- border: 2px solid rgb(160,160,160);
6
- background-color: rgb(250,250,250);
7
-
8
- .plus {
9
- background-color: rgb(240,240,240);
10
- }
11
- }
12
- }
13
-
14
- &.after {
15
- .container {
16
- button.trash {display:block;
17
- }
18
- }
19
- }
20
-
21
- .container {
22
- width: 100%;
23
- display: grid;
24
- grid-column-gap: 50px;
25
- grid-template-columns: 1fr 1fr 1fr;
26
- align-items: center;
27
- border: 2px dashed rgb(160,160,160);
28
- background-color: white;
29
- min-height: 200px;
30
- padding: 10px;
31
- position:relative;
32
-
33
- button.trash {
34
- display:none;
35
- position: absolute;
36
- z-index: 1000;
37
- right: 0;
38
- top: 0;
39
- background: none;
40
- border: none;
41
- cursor: pointer;
42
- color: rgb(50,50,50);
43
- }
44
-
45
- > div {
46
- text-align: center;
47
- }
48
-
49
- .image-container {
50
- border: 1px solid rgb(245,245,255);
51
- padding: 5px;
52
- background-color: white;
53
- position: relative;
54
-
55
- .image.removed {
56
- opacity: 0.3;
57
- }
58
-
59
- button {
60
- position: absolute;
61
- right: 0;
62
- top: 0;
63
- background: none;
64
- border: none;
65
- cursor: pointer;
66
-
67
- &.remove {
68
- color: red;
69
- }
70
- }
71
- }
72
-
73
- .plus {
74
- background-color: rgb(245,245,245);
75
- position: relative;
76
- height: 180px;
77
- width: 200px;
78
-
79
- span {
80
- display: block;
81
- position: absolute;
82
- top: 50%;
83
- left: 50%;
84
- transform: translate(-50%,-50%);
85
-
86
- > * {
87
- display: block;
88
- margin: 0 auto;
89
- text-align: center;
90
- }
91
- }
92
- }
93
- }
94
- }
@@ -1,4 +0,0 @@
1
- export interface Screen {
2
- key: string,
3
- controller: string,
4
- }
@@ -1,14 +0,0 @@
1
- import { CellOptions } from '../decorators/list/Cell';
2
- import { CrudOptions } from '../decorators/Crud';
3
- import { InputOptions } from '../decorators/form/Input';
4
- import { ListOptions } from '../decorators/list/List';
5
- //TODO: remove
6
- export interface ScreenCreatorData {
7
- resolver: any;
8
- fields: string[];
9
- inputs: InputOptions[];
10
- crud?: CrudOptions;
11
- path: string;
12
- list?: ListOptions<any>;
13
- cells: CellOptions[];
14
- }
@@ -1,5 +0,0 @@
1
- import { useAppStore } from "../store/store";
2
-
3
- export function createScreens(screens: Record<string, any>) {
4
- useAppStore.setState({ screens });
5
- }
@@ -1,22 +0,0 @@
1
- import { getMetadataStorage } from "class-validator";
2
- import { classValidatorResolver } from "@hookform/resolvers/class-validator";
3
- import { ScreenCreatorData } from "../types/ScreenCreatorData";
4
- import { getInputFields } from "../decorators/form/Input";
5
- import { getClassListData } from "../decorators/list/List";
6
- import { getCellFields } from "../decorators/list/GetCellFields";
7
- import { AnyClass } from "../types/AnyClass";
8
-
9
- export function getFields<T extends AnyClass>(key: string, entityClass: T): ScreenCreatorData {
10
- const metadataStorage = getMetadataStorage();
11
- const targetMetadata = metadataStorage.getTargetValidationMetadatas(entityClass as any, "", false, false);
12
- const listData = getClassListData(entityClass);
13
- return {
14
- resolver: classValidatorResolver(entityClass as any),
15
- cells: getCellFields(entityClass),
16
- list: listData,
17
- fields: Array.from(new Set(targetMetadata.map((meta) => meta.propertyName))),
18
- inputs: getInputFields<T>(entityClass),
19
- crud: { controller: "" },
20
- path: "/" + key,
21
- };
22
- }