proje-react-panel 1.0.14 → 1.0.16

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 (168) hide show
  1. package/.cursor/rules.md +122 -0
  2. package/.cursor/settings.json +57 -0
  3. package/.eslintrc.js +5 -0
  4. package/.eslintrc.json +26 -0
  5. package/.prettierrc +10 -0
  6. package/.vscode/launch.json +27 -0
  7. package/.vscode/settings.json +8 -0
  8. package/PTD.md +234 -0
  9. package/README.md +62 -28
  10. package/dist/api/CrudApi.d.ts +12 -0
  11. package/dist/components/Panel.d.ts +2 -2
  12. package/dist/components/components/Checkbox.d.ts +6 -0
  13. package/dist/components/components/Counter.d.ts +9 -0
  14. package/dist/components/components/FormField.d.ts +13 -0
  15. package/dist/components/components/ImageUploader.d.ts +15 -0
  16. package/dist/components/components/InnerForm.d.ts +12 -0
  17. package/dist/components/components/LoadingScreen.d.ts +2 -0
  18. package/dist/components/components/index.d.ts +8 -0
  19. package/dist/components/components/list/Datagrid.d.ts +13 -0
  20. package/dist/components/components/list/EmptyList.d.ts +2 -0
  21. package/dist/components/components/list/FilterPopup.d.ts +11 -0
  22. package/dist/components/components/list/ListPage.d.ts +22 -0
  23. package/dist/components/components/list/Pagination.d.ts +11 -0
  24. package/dist/components/components/list/index.d.ts +0 -0
  25. package/dist/components/layout/Layout.d.ts +2 -1
  26. package/dist/components/layout/SideBar.d.ts +4 -3
  27. package/dist/components/layout/index.d.ts +2 -0
  28. package/dist/components/list/Datagrid.d.ts +12 -0
  29. package/dist/components/list/EmptyList.d.ts +2 -0
  30. package/dist/components/list/FilterPopup.d.ts +10 -0
  31. package/dist/components/list/Pagination.d.ts +11 -0
  32. package/dist/components/list/index.d.ts +0 -0
  33. package/dist/{src/screens → components/pages}/ControllerDetails.d.ts +1 -1
  34. package/dist/components/pages/FormPage.d.ts +12 -0
  35. package/dist/components/pages/ListPage.d.ts +18 -0
  36. package/dist/components/pages/Login.d.ts +13 -0
  37. package/dist/decorators/form/Form.d.ts +6 -0
  38. package/dist/decorators/form/FormOptions.d.ts +7 -0
  39. package/dist/decorators/form/Input.d.ts +17 -0
  40. package/dist/decorators/form/getFormFields.d.ts +3 -0
  41. package/dist/decorators/list/Cell.d.ts +21 -0
  42. package/dist/decorators/list/GetCellFields.d.ts +2 -0
  43. package/dist/decorators/list/ImageCell.d.ts +6 -0
  44. package/dist/decorators/list/List.d.ts +28 -0
  45. package/dist/decorators/list/ListData.d.ts +6 -0
  46. package/dist/decorators/list/getListFields.d.ts +2 -0
  47. package/dist/index.cjs.js +1 -1
  48. package/dist/index.d.ts +20 -10
  49. package/dist/index.esm.js +1 -1
  50. package/dist/initPanel.d.ts +2 -2
  51. package/dist/store/store.d.ts +1 -5
  52. package/dist/types/AnyClass.d.ts +1 -0
  53. package/dist/types/ScreenCreatorData.d.ts +5 -3
  54. package/dist/types/initPanelOptions.d.ts +0 -6
  55. package/dist/utils/format.d.ts +1 -0
  56. package/dist/utils/getFields.d.ts +2 -1
  57. package/package.json +13 -6
  58. package/src/api/CrudApi.ts +30 -11
  59. package/src/assets/icons/svg/create.svg +9 -0
  60. package/src/assets/icons/svg/filter.svg +3 -0
  61. package/src/assets/icons/svg/pencil.svg +8 -0
  62. package/src/assets/icons/svg/search.svg +8 -0
  63. package/src/assets/icons/svg/trash.svg +8 -0
  64. package/src/components/Panel.tsx +11 -11
  65. package/src/components/components/Checkbox.tsx +9 -0
  66. package/src/components/components/Counter.tsx +51 -0
  67. package/src/components/components/FormField.tsx +94 -0
  68. package/src/components/components/ImageUploader.tsx +301 -0
  69. package/src/components/components/InnerForm.tsx +74 -0
  70. package/src/components/components/LoadingScreen.tsx +12 -0
  71. package/src/components/components/index.ts +8 -0
  72. package/src/components/components/list/Datagrid.tsx +121 -0
  73. package/src/components/components/list/EmptyList.tsx +26 -0
  74. package/src/components/components/list/FilterPopup.tsx +202 -0
  75. package/src/components/components/list/ListPage.tsx +178 -0
  76. package/src/components/components/list/Pagination.tsx +110 -0
  77. package/src/components/components/list/index.ts +1 -0
  78. package/src/components/layout/Layout.tsx +8 -1
  79. package/src/components/layout/SideBar.tsx +103 -31
  80. package/src/components/layout/index.ts +2 -0
  81. package/src/components/pages/ControllerDetails.tsx +37 -0
  82. package/src/components/pages/FormPage.tsx +34 -0
  83. package/src/components/pages/Login.tsx +79 -0
  84. package/src/decorators/form/Form.ts +18 -0
  85. package/src/decorators/form/FormOptions.ts +8 -0
  86. package/src/decorators/form/Input.ts +53 -0
  87. package/src/decorators/form/getFormFields.ts +13 -0
  88. package/src/decorators/list/Cell.ts +32 -0
  89. package/src/decorators/list/GetCellFields.ts +13 -0
  90. package/src/decorators/list/ImageCell.ts +13 -0
  91. package/src/decorators/list/List.ts +31 -0
  92. package/src/decorators/list/ListData.ts +7 -0
  93. package/src/decorators/list/getListFields.ts +10 -0
  94. package/src/index.ts +28 -10
  95. package/src/initPanel.ts +4 -12
  96. package/src/store/store.ts +23 -28
  97. package/src/styles/counter.scss +42 -0
  98. package/src/styles/filter-popup.scss +134 -0
  99. package/src/styles/image-uploader.scss +94 -0
  100. package/src/styles/index.scss +26 -7
  101. package/src/styles/layout.scss +1 -6
  102. package/src/styles/list.scss +175 -7
  103. package/src/styles/loading-screen.scss +42 -0
  104. package/src/styles/pagination.scss +66 -0
  105. package/src/styles/sidebar.scss +64 -0
  106. package/src/styles/utils/scrollbar.scss +19 -0
  107. package/src/types/AnyClass.ts +1 -0
  108. package/src/types/ScreenCreatorData.ts +5 -3
  109. package/src/types/initPanelOptions.ts +1 -7
  110. package/src/types/svg.d.ts +5 -0
  111. package/src/utils/format.ts +7 -0
  112. package/src/utils/getFields.ts +11 -9
  113. package/dist/api/crudApi.d.ts +0 -17
  114. package/dist/components/Form.d.ts +0 -6
  115. package/dist/components/FormField.d.ts +0 -13
  116. package/dist/components/list/List.d.ts +0 -10
  117. package/dist/components/screens/ControllerCreate.d.ts +0 -5
  118. package/dist/components/screens/ControllerDetails.d.ts +0 -5
  119. package/dist/components/screens/ControllerEdit.d.ts +0 -5
  120. package/dist/components/screens/ControllerList.d.ts +0 -5
  121. package/dist/components/screens/Login.d.ts +0 -2
  122. package/dist/decorators/Cell.d.ts +0 -9
  123. package/dist/decorators/Input.d.ts +0 -13
  124. package/dist/hooks/useScreens.d.ts +0 -2
  125. package/dist/initPanelOptions.d.ts +0 -8
  126. package/dist/screens/ControllerCreate.d.ts +0 -5
  127. package/dist/screens/ControllerDetails.d.ts +0 -5
  128. package/dist/screens/ControllerEdit.d.ts +0 -5
  129. package/dist/screens/ControllerList.d.ts +0 -5
  130. package/dist/screens/Form.d.ts +0 -6
  131. package/dist/src/api/crudApi.d.ts +0 -6
  132. package/dist/src/components/Panel.d.ts +0 -9
  133. package/dist/src/components/layout/Layout.d.ts +0 -11
  134. package/dist/src/components/layout/SideBar.d.ts +0 -10
  135. package/dist/src/components/list/List.d.ts +0 -10
  136. package/dist/src/decorators/Cell.d.ts +0 -10
  137. package/dist/src/decorators/Crud.d.ts +0 -6
  138. package/dist/src/index.d.ts +0 -8
  139. package/dist/src/screens/ControllerCreate.d.ts +0 -5
  140. package/dist/src/screens/ControllerEdit.d.ts +0 -5
  141. package/dist/src/screens/ControllerList.d.ts +0 -5
  142. package/dist/src/screens/Form.d.ts +0 -6
  143. package/dist/src/store/store.d.ts +0 -19
  144. package/dist/src/types/Screen.d.ts +0 -4
  145. package/dist/src/types/ScreenCreatorData.d.ts +0 -8
  146. package/dist/src/utils/createScreens.d.ts +0 -1
  147. package/dist/src/utils/getFields.d.ts +0 -2
  148. package/dist/src/utils/getScreens.d.ts +0 -2
  149. package/dist/utils/crudScreens.d.ts +0 -2
  150. package/dist/utils/getScreens.d.ts +0 -2
  151. package/src/api/AuthApi.ts +0 -14
  152. package/src/components/Form.tsx +0 -70
  153. package/src/components/FormField.tsx +0 -60
  154. package/src/components/list/List.tsx +0 -81
  155. package/src/components/screens/ControllerCreate.tsx +0 -7
  156. package/src/components/screens/ControllerDetails.tsx +0 -40
  157. package/src/components/screens/ControllerEdit.tsx +0 -35
  158. package/src/components/screens/ControllerList.tsx +0 -45
  159. package/src/components/screens/Login.tsx +0 -68
  160. package/src/decorators/Cell.ts +0 -34
  161. package/src/decorators/Input.ts +0 -50
  162. package/src/hooks/useScreens.tsx +0 -36
  163. /package/dist/components/{ErrorBoundary.d.ts → components/ErrorBoundary.d.ts} +0 -0
  164. /package/dist/components/{ErrorComponent.d.ts → components/ErrorComponent.d.ts} +0 -0
  165. /package/dist/components/{Label.d.ts → components/Label.d.ts} +0 -0
  166. /package/src/components/{ErrorBoundary.tsx → components/ErrorBoundary.tsx} +0 -0
  167. /package/src/components/{ErrorComponent.tsx → components/ErrorComponent.tsx} +0 -0
  168. /package/src/components/{Label.tsx → components/Label.tsx} +0 -0
@@ -0,0 +1,94 @@
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,11 +1,24 @@
1
- @import './sidebar';
2
- @import './form';
3
- @import './layout';
4
- @import './list';
5
- @import './login';
6
- @import './error-boundary';
1
+ @use './layout';
2
+ // Imported styles will be scoped under .layout
3
+ @use './sidebar';
4
+ @use './form';
5
+ @use './list';
6
+ @use './login';
7
+ @use './error-boundary';
8
+ @use './image-uploader';
9
+ @use './counter';
10
+ @use './loading-screen';
11
+ @use './pagination';
12
+ @use './filter-popup';
7
13
 
8
- .layout{
14
+ .layout {
15
+ display: flex;
16
+ max-height: 100vh;
17
+ height: 100vh;
18
+ min-height: 100vh;
19
+ width: 100%;
20
+ padding: 0;
21
+ overflow: hidden !important;
9
22
  a {
10
23
  color: white;
11
24
 
@@ -21,3 +34,9 @@
21
34
  box-sizing: border-box;
22
35
  }
23
36
  }
37
+ .icon {
38
+ width: 14px;
39
+ height: 14px;
40
+ stroke: currentColor;
41
+ fill: currentColor;
42
+ }
@@ -1,12 +1,7 @@
1
-
2
1
  .layout {
3
- display: flex;
4
- min-height: 100vh;
5
- width: 100%;
6
-
7
2
  .content {
8
3
  flex: 1;
9
- padding: 1rem;
4
+ padding: 0 0 0 1rem;
10
5
  overflow-y: auto;
11
6
  transition: margin-left 0.3s ease;
12
7
  }
@@ -1,20 +1,85 @@
1
- .list-wrapper {
1
+ @import 'utils/scrollbar';
2
+ $header-height: 60px;
3
+ $footer-height: 60px;
4
+ $datagrid-height: calc(100vh - ($header-height + $footer-height));
5
+ .list {
2
6
  width: 100%;
3
- padding: 16px;
4
- border-radius: 8px;
5
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
6
7
  background-color: #2b2b2b;
7
8
  color: #e0e0e0;
9
+ max-height: 100vh;
10
+ height: 100vh;
11
+ min-height: 100vh;
12
+ overflow: hidden !important;
8
13
 
9
- .header {
14
+ .list-header {
15
+ height: $header-height;
16
+ display: flex;
17
+ align-items: center;
18
+ justify-content: space-between;
19
+ padding: 0 24px;
20
+ background: linear-gradient(90deg, #2b2b2b 0%, #3c3c3c 100%);
21
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
22
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
23
+
24
+ .header-title {
25
+ font-size: 20px;
26
+ font-weight: 600;
27
+ color: #ffffff;
28
+ text-transform: uppercase;
29
+ letter-spacing: 0.5px;
30
+ }
31
+
32
+ .header-actions {
33
+ display: flex;
34
+ gap: 16px;
35
+ align-items: center;
36
+
37
+ .create-button {
38
+ padding: 8px 16px;
39
+ background-color: #4caf50;
40
+ color: white;
41
+ border-radius: 4px;
42
+ text-decoration: none;
43
+ font-size: 14px;
44
+ font-weight: 500;
45
+ transition: background-color 0.2s ease;
46
+
47
+ &:hover {
48
+ background-color: #45a049;
49
+ }
50
+ .icon-create {
51
+ fill: currentColor;
52
+ stroke: none;
53
+ position: relative;
54
+ top: 2px;
55
+ right: 2px;
56
+ }
57
+ }
58
+ }
59
+ }
60
+
61
+ .list-footer {
62
+ display: flex;
63
+ justify-content: space-between;
64
+ align-items: center;
65
+ height: $footer-height;
10
66
  font-size: 24px;
11
67
  font-weight: bold;
12
68
  text-align: center;
13
- margin-bottom: 20px;
14
69
  color: #ffffff;
15
70
  }
71
+ .datagrid {
72
+ padding: 0 0 0 8px;
73
+ height: $datagrid-height;
74
+ min-height: $datagrid-height;
75
+ max-height: $datagrid-height;
76
+ width: 100%;
77
+ overflow: auto;
16
78
 
17
- .list-table {
79
+ @include custom-scrollbar;
80
+ }
81
+
82
+ .datagrid-table {
18
83
  width: 100%;
19
84
  border-collapse: collapse;
20
85
 
@@ -38,4 +103,107 @@
38
103
  background-color: #444444;
39
104
  }
40
105
  }
106
+
107
+ .empty-list {
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ height: 100%;
112
+ width: 100%;
113
+ padding: 2rem;
114
+
115
+ .empty-list-content {
116
+ text-align: center;
117
+ color: #888;
118
+
119
+ svg {
120
+ margin-bottom: 1rem;
121
+ color: #666;
122
+ }
123
+
124
+ h3 {
125
+ font-size: 1.5rem;
126
+ margin-bottom: 0.5rem;
127
+ font-weight: 500;
128
+ color: #fff;
129
+ }
130
+
131
+ p {
132
+ font-size: 1rem;
133
+ color: #888;
134
+ }
135
+ }
136
+ }
137
+ }
138
+
139
+ .util-cell-link {
140
+ display: flex;
141
+ align-items: center;
142
+ gap: 8px;
143
+ color: #666;
144
+ text-decoration: none;
145
+ transition: color 0.2s ease;
146
+
147
+ &:hover {
148
+ color: #333;
149
+ }
150
+
151
+ .icon {
152
+ width: 16px;
153
+ height: 16px;
154
+ stroke: none;
155
+ &.icon-trash {
156
+ fill: #ff0000;
157
+ stroke: none;
158
+ }
159
+ }
160
+
161
+ .util-cell-label {
162
+ font-size: 14px;
163
+ }
164
+ }
165
+
166
+ .filter-button {
167
+ background-color: #4caf50;
168
+ color: white;
169
+ border: none;
170
+ padding: 8px 16px;
171
+ border-radius: 4px;
172
+ cursor: pointer;
173
+ transition: background-color 0.2s ease;
174
+
175
+ &:hover {
176
+ background-color: #45a049;
177
+ }
178
+ .icon-filter {
179
+ position: relative;
180
+ top: 2px;
181
+ right: 2px;
182
+ width: 15px;
183
+ height: 15px;
184
+ stroke: currentColor;
185
+ stroke-width: 2;
186
+ fill: none;
187
+ &.active {
188
+ fill: currentColor;
189
+ }
190
+ }
191
+ }
192
+ .header-custom {
193
+ display: flex;
194
+ flex: 1;
195
+ align-items: center;
196
+ justify-content: flex-start;
197
+ padding: 0 24px;
198
+ gap: 16px;
199
+ a {
200
+ padding: 8px 16px;
201
+ background-color: #4caf50;
202
+ color: white;
203
+ border-radius: 4px;
204
+ text-decoration: none;
205
+ font-size: 14px;
206
+ font-weight: 500;
207
+ transition: background-color 0.2s ease;
208
+ }
41
209
  }
@@ -0,0 +1,42 @@
1
+ .loading-screen {
2
+ width: 100%;
3
+ height: 100%;
4
+ background-color: #1a1a1a;
5
+ display: flex;
6
+ justify-content: center;
7
+ align-items: center;
8
+ z-index: 9999;
9
+
10
+ .loading-container {
11
+ display: flex;
12
+ flex-direction: column;
13
+ align-items: center;
14
+ gap: 1.5rem;
15
+ }
16
+
17
+ .loading-spinner {
18
+ width: 50px;
19
+ height: 50px;
20
+ border: 3px solid #2a2a2a;
21
+ border-top: 3px solid #3498db;
22
+ border-radius: 50%;
23
+ animation: spin 1s linear infinite;
24
+ }
25
+
26
+ .loading-text {
27
+ color: #ffffff;
28
+ font-size: 1.2rem;
29
+ font-weight: 500;
30
+ letter-spacing: 1px;
31
+ opacity: 0.8;
32
+ }
33
+ }
34
+
35
+ @keyframes spin {
36
+ 0% {
37
+ transform: rotate(0deg);
38
+ }
39
+ 100% {
40
+ transform: rotate(360deg);
41
+ }
42
+ }
@@ -0,0 +1,66 @@
1
+ $footer-height2: 60px;
2
+
3
+ .pagination {
4
+ display: flex;
5
+ justify-content: center;
6
+ align-items: center;
7
+ gap: 12px;
8
+ font-family:
9
+ -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
10
+
11
+ &-item {
12
+ min-width: 40px;
13
+ height: 40px;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ border: 1px solid var(--border-color, #e2e8f0);
18
+ border-radius: 8px;
19
+ text-decoration: none;
20
+ color: var(--text-color, #2d3748);
21
+ background-color: var(--bg-color, #ffffff);
22
+ font-weight: 500;
23
+ font-size: 14px;
24
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
25
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
26
+ cursor: pointer;
27
+
28
+ &:hover:not(.disabled) {
29
+ background-color: var(--hover-bg-color, #f7fafc);
30
+ transform: translateY(-1px);
31
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
32
+ border-color: var(--primary-color, #007bff);
33
+ }
34
+
35
+ &.active {
36
+ background-color: var(--primary-color, #007bff);
37
+ color: var(--active-text-color, white);
38
+ border-color: var(--primary-color, #007bff);
39
+ box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2);
40
+ font-weight: 600;
41
+
42
+ &:hover {
43
+ transform: translateY(-1px);
44
+ box-shadow: 0 6px 8px rgba(0, 123, 255, 0.3);
45
+ }
46
+ }
47
+
48
+ &.disabled {
49
+ opacity: 0.5;
50
+ cursor: not-allowed;
51
+ pointer-events: none;
52
+ background-color: var(--disabled-bg-color, #f1f5f9);
53
+ }
54
+ }
55
+ }
56
+
57
+ // Dark theme variables
58
+ [data-theme='dark'] {
59
+ --border-color: #2d3748;
60
+ --text-color: #f7fafc;
61
+ --bg-color: #1a202c;
62
+ --hover-bg-color: #2d3748;
63
+ --primary-color: #4299e1;
64
+ --active-text-color: #ffffff;
65
+ --disabled-bg-color: #2d3748;
66
+ }
@@ -11,6 +11,17 @@
11
11
  &.closed {
12
12
  width: 60px;
13
13
 
14
+ .nav-links a.active {
15
+ border-radius: 0;
16
+ &::before {
17
+
18
+ background-color: #9b1a1a;
19
+ }
20
+
21
+ }
22
+ .nav-links a:hover {
23
+ transform: none !important;
24
+ }
14
25
  }
15
26
 
16
27
  .toggle-button {
@@ -48,8 +59,29 @@
48
59
  text-decoration: none;
49
60
  border-radius: 4px;
50
61
  font-weight: 500;
62
+ transition: all 0.2s ease;
63
+ position: relative;
64
+ overflow: hidden;
65
+
66
+ &:hover {
67
+ background-color: rgba(233, 236, 239, 0.1);
68
+ transform: translateX(2px);
69
+ }
70
+
51
71
  &.active {
52
72
  background-color: rgba(233, 236, 239, 0.2);
73
+ color: #fff;
74
+ font-weight: 600;
75
+
76
+ &::before {
77
+ content: '';
78
+ position: absolute;
79
+ left: 0;
80
+ top: 0;
81
+ height: 100%;
82
+ width: 4px;
83
+ background-color: #fff;
84
+ }
53
85
  }
54
86
 
55
87
  .nav-links-icon {
@@ -68,4 +100,36 @@
68
100
  }
69
101
  }
70
102
  }
103
+
104
+ .sidebar-footer {
105
+ position: absolute;
106
+ bottom: 0;
107
+ width: 100%;
108
+ padding: 1rem 0;
109
+ border-top: 1px solid #454d55;
110
+
111
+ .logout-button {
112
+ display: flex;
113
+ align-items: center;
114
+ width: 100%;
115
+ padding: 0.75rem 0;
116
+ color: #adb5bd;
117
+ background: none;
118
+ border: none;
119
+ cursor: pointer;
120
+ font-weight: 500;
121
+ transition: all 0.2s ease;
122
+
123
+ &:hover {
124
+ color: #fff;
125
+ background-color: rgba(233, 236, 239, 0.1);
126
+ }
127
+
128
+ .nav-links-icon {
129
+ display: inline-block;
130
+ width: 60px;
131
+ text-align: center;
132
+ }
133
+ }
134
+ }
71
135
  }
@@ -0,0 +1,19 @@
1
+ @mixin custom-scrollbar {
2
+ &::-webkit-scrollbar {
3
+ width: 8px;
4
+ height: 8px;
5
+ }
6
+
7
+ &::-webkit-scrollbar-track {
8
+ background: #2b2b2b;
9
+ }
10
+
11
+ &::-webkit-scrollbar-thumb {
12
+ background: #666666;
13
+ border-radius: 4px;
14
+
15
+ &:hover {
16
+ background: #777777;
17
+ }
18
+ }
19
+ }
@@ -0,0 +1 @@
1
+ export type AnyClass = abstract new (...args: any[]) => any;
@@ -1,12 +1,14 @@
1
- import { CellOptions } from "../decorators/Cell";
1
+ import { CellOptions } from "../decorators/list/Cell";
2
2
  import { CrudOptions } from "../decorators/Crud";
3
- import { InputOptions } from "../decorators/Input";
3
+ import { InputOptions } from "../decorators/form/Input";
4
+ import { ListOptions } from "../decorators/list/List";
4
5
 
5
6
  export interface ScreenCreatorData {
6
7
  resolver: any;
7
8
  fields: string[];
8
- cells: CellOptions[];
9
9
  inputs: InputOptions[];
10
10
  crud?: CrudOptions;
11
11
  path: string;
12
+ list?: ListOptions;
13
+ cells: CellOptions[];
12
14
  }
@@ -1,9 +1,3 @@
1
- type AnyClass = abstract new (...args: any[]) => any;
2
-
3
1
  export interface InitPanelOptions {
4
- crud: Record<string, AnyClass>;
5
- fetch: {
6
- baseURL: string;
7
- };
8
- screenPaths: Record<string, string>;
2
+ screenPaths: Record<string, string>;
9
3
  }
@@ -0,0 +1,5 @@
1
+ declare module '*.svg' {
2
+ import React from 'react';
3
+ const SVGComponent: React.FC<React.SVGProps<SVGSVGElement>>;
4
+ export default SVGComponent;
5
+ }
@@ -0,0 +1,7 @@
1
+ export const bytesToSize = (bytes: number): string => {
2
+ if (bytes === 0) return '0 Bytes';
3
+ const k = 1024;
4
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
5
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
6
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
7
+ };
@@ -1,20 +1,22 @@
1
1
  import { getMetadataStorage } from "class-validator";
2
- import { getClassCrudData } from "../decorators/Crud";
3
2
  import { classValidatorResolver } from "@hookform/resolvers/class-validator";
4
- import { getCellFields } from "../decorators/Cell";
5
3
  import { ScreenCreatorData } from "../types/ScreenCreatorData";
6
- import { getInputFields } from "../decorators/Input";
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";
7
8
 
8
- export function getFields<T>(key: string, entityClass: T): ScreenCreatorData {
9
+ export function getFields<T extends AnyClass>(key: string, entityClass: T): ScreenCreatorData {
9
10
  const metadataStorage = getMetadataStorage();
10
11
  const targetMetadata = metadataStorage.getTargetValidationMetadatas(entityClass as any, "", false, false);
11
- const crud = getClassCrudData(entityClass);
12
+ const listData = getClassListData(entityClass);
12
13
  return {
13
14
  resolver: classValidatorResolver(entityClass as any),
14
- fields: Array.from(new Set(targetMetadata.map((meta) => meta.propertyName))),
15
- inputs: getInputFields(entityClass),
16
15
  cells: getCellFields(entityClass),
17
- crud: crud,
18
- path: "/" + (crud?.controller ?? key),
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,
19
21
  };
20
22
  }
@@ -1,17 +0,0 @@
1
- interface FetchOptions {
2
- token: string;
3
- baseUrl: string;
4
- }
5
- export declare const CrudApi: {
6
- getList: (options: FetchOptions, api: string) => Promise<any>;
7
- create: (fetchSettings: {
8
- baseUrl: string;
9
- }, api: string, data: any) => Promise<any>;
10
- details: (fetchSettings: {
11
- baseUrl: string;
12
- }, api: string, id: any) => Promise<any>;
13
- edit: (fetchSettings: {
14
- baseUrl: string;
15
- }, api: string, data: any) => Promise<any>;
16
- };
17
- export {};
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- import { Screen } from "../types/Screen";
3
- export declare function Form({ data, screen }: {
4
- data?: any;
5
- screen: Screen;
6
- }): React.JSX.Element;
@@ -1,13 +0,0 @@
1
- import React from "react";
2
- import { InputOptions } from "../decorators/Input";
3
- import { UseFormRegister } from "react-hook-form";
4
- interface FormFieldProps {
5
- input: InputOptions;
6
- register: UseFormRegister<any>;
7
- isEditForm: boolean;
8
- error?: {
9
- message?: string;
10
- };
11
- }
12
- export declare function FormField({ input, register, isEditForm, error }: FormFieldProps): React.JSX.Element;
13
- export {};
@@ -1,10 +0,0 @@
1
- import React from "react";
2
- import { CellOptions } from "../../decorators/Cell";
3
- import { Screen } from "../../types/Screen";
4
- interface ListProps<T> {
5
- data: T[];
6
- cells: CellOptions[];
7
- screen: Screen;
8
- }
9
- export declare function List<T>({ data, cells }: ListProps<T>): React.JSX.Element;
10
- export {};
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- import { Screen } from "../../types/Screen";
3
- export declare function ControllerCreate({ screen }: {
4
- screen: Screen;
5
- }): React.JSX.Element;