proje-react-panel 1.1.3 → 1.1.5

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 (68) hide show
  1. package/.cursor/rules.md +21 -95
  2. package/.vscode/settings.json +6 -1
  3. package/PTD.md +124 -24
  4. package/dist/components/DetailsPage.d.ts +2 -2
  5. package/dist/components/ErrorComponent.d.ts +3 -2
  6. package/dist/components/LoadingScreen.d.ts +3 -1
  7. package/dist/components/Login.d.ts +2 -2
  8. package/dist/components/Panel.d.ts +2 -2
  9. package/dist/components/form/FormField.d.ts +1 -5
  10. package/dist/components/form/FormHeader.d.ts +10 -0
  11. package/dist/components/form/FormPage.d.ts +12 -1
  12. package/dist/components/form/Select.d.ts +1 -1
  13. package/dist/components/form/SelectStyles.d.ts +3 -3
  14. package/dist/components/list/CellField.d.ts +2 -3
  15. package/dist/components/list/EmptyList.d.ts +1 -1
  16. package/dist/decorators/details/Details.d.ts +1 -2
  17. package/dist/decorators/form/Form.d.ts +6 -4
  18. package/dist/decorators/form/Input.d.ts +10 -2
  19. package/dist/decorators/form/inputs/SelectInput.d.ts +8 -7
  20. package/dist/decorators/list/Cell.d.ts +3 -3
  21. package/dist/decorators/list/List.d.ts +3 -4
  22. package/dist/decorators/list/getListPageMeta.d.ts +2 -2
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.esm.js +1 -1
  25. package/dist/store/store.d.ts +1 -0
  26. package/dist/utils/decerators.d.ts +3 -3
  27. package/eslint.config.mjs +60 -0
  28. package/package.json +7 -3
  29. package/src/api/CrudApi.ts +59 -53
  30. package/src/components/DetailsPage.tsx +12 -9
  31. package/src/components/ErrorComponent.tsx +36 -33
  32. package/src/components/LoadingScreen.tsx +4 -3
  33. package/src/components/Login.tsx +11 -4
  34. package/src/components/Panel.tsx +10 -6
  35. package/src/components/form/Checkbox.tsx +1 -1
  36. package/src/components/form/FormField.tsx +13 -9
  37. package/src/components/form/FormHeader.tsx +18 -0
  38. package/src/components/form/FormPage.tsx +146 -5
  39. package/src/components/form/InnerForm.tsx +24 -8
  40. package/src/components/form/Select.tsx +14 -12
  41. package/src/components/form/SelectStyles.ts +4 -4
  42. package/src/components/layout/Layout.tsx +1 -7
  43. package/src/components/layout/SideBar.tsx +1 -2
  44. package/src/components/list/CellField.tsx +2 -5
  45. package/src/components/list/Datagrid.tsx +0 -1
  46. package/src/components/list/EmptyList.tsx +2 -2
  47. package/src/components/list/FilterPopup.tsx +4 -2
  48. package/src/components/list/ListPage.tsx +11 -8
  49. package/src/components/list/cells/DefaultCell.tsx +2 -0
  50. package/src/decorators/details/Details.ts +2 -2
  51. package/src/decorators/details/DetailsItem.ts +2 -0
  52. package/src/decorators/form/Form.ts +13 -10
  53. package/src/decorators/form/Input.ts +18 -9
  54. package/src/decorators/form/inputs/SelectInput.ts +8 -7
  55. package/src/decorators/list/Cell.ts +6 -4
  56. package/src/decorators/list/ExtendedCell.ts +1 -9
  57. package/src/decorators/list/List.ts +8 -4
  58. package/src/decorators/list/cells/ImageCell.ts +1 -1
  59. package/src/decorators/list/getListPageMeta.ts +4 -3
  60. package/src/store/store.ts +3 -1
  61. package/src/styles/components/form-header.scss +75 -0
  62. package/src/styles/index.scss +1 -0
  63. package/src/types/AnyClass.ts +3 -0
  64. package/src/utils/decerators.ts +3 -2
  65. package/.eslintrc.js +0 -23
  66. package/.eslintrc.json +0 -26
  67. package/src/initPanel.ts +0 -3
  68. package/src/types/initPanelOptions.ts +0 -1
@@ -0,0 +1,75 @@
1
+ .form-header {
2
+ display: flex;
3
+ justify-content: space-between;
4
+ align-items: center;
5
+ padding: 1rem;
6
+ margin-bottom: 1.5rem;
7
+ background-color: #333333;
8
+ border-radius: 8px 0 0 8px;
9
+
10
+ .form-title {
11
+ margin: 0;
12
+ font-size: 1.5rem;
13
+ font-weight: 600;
14
+ color: #cccccc;
15
+ }
16
+
17
+ .form-actions {
18
+ display: flex;
19
+ gap: 0.5rem;
20
+ align-items: center;
21
+
22
+ //keep this even its not used in project (it can be used in other projects)
23
+ .export-button,
24
+ .import-button {
25
+ padding: 0.5rem 1rem;
26
+ border: 1px solid #444444;
27
+ border-radius: 4px;
28
+ background-color: #222222;
29
+ color: #cccccc;
30
+ font-size: 0.875rem;
31
+ cursor: pointer;
32
+ transition: all 0.2s ease;
33
+
34
+ &:hover {
35
+ background-color: #444444;
36
+ border-color: #555555;
37
+ }
38
+ }
39
+ }
40
+
41
+ &.dark-theme {
42
+ background-color: black;
43
+ box-shadow: none;
44
+
45
+ .form-title {
46
+ color: white;
47
+ }
48
+
49
+ .form-actions {
50
+ .export-button {
51
+ background-color: black;
52
+ border-color: black;
53
+ color: white;
54
+
55
+ &:hover {
56
+ background-color: black;
57
+ border-color: black;
58
+ }
59
+ }
60
+
61
+ .import-button {
62
+ .import-label {
63
+ background-color: black;
64
+ border-color: black;
65
+ color: white;
66
+
67
+ &:hover {
68
+ background-color: black;
69
+ border-color: black;
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
@@ -10,6 +10,7 @@
10
10
  @import './filter-popup';
11
11
  @import './components/uploader.scss';
12
12
  @import './components/checkbox';
13
+ @import './components/form-header';
13
14
  @import './details';
14
15
 
15
16
  //TODO: import deprecated
@@ -1,2 +1,5 @@
1
+ //TODO: any?
2
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
1
3
  export type AnyClass = Record<string, any>;
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2
5
  export type AnyClassConstructor<T extends AnyClass> = new (...args: any[]) => T;
@@ -1,9 +1,10 @@
1
1
  export type DecoratorMap<T, K> = (
2
- { target, propertyKey }: { target: Object; propertyKey: string | symbol },
2
+ prop: { target: object; propertyKey: string | symbol },
3
3
  options: T
4
4
  ) => K;
5
+
5
6
  export function createDecorator<T extends { name?: string }, K>(
6
- key: Symbol,
7
+ key: symbol,
7
8
  options?: T,
8
9
  map?: DecoratorMap<T, K>
9
10
  ): PropertyDecorator {
package/.eslintrc.js DELETED
@@ -1,23 +0,0 @@
1
- module.exports = {
2
- root: true,
3
- extends: ["eslint:recommended", "plugin:react/recommended"],
4
- parser: "@typescript-eslint/parser",
5
- plugins: ["@typescript-eslint"],
6
- settings: {
7
- react: {
8
- version: "detect"
9
- }
10
- },
11
- overrides: [
12
- {
13
- files: ["*.ts", "*.tsx"],
14
- rules: {
15
- semi: 0,
16
- "@typescript-eslint/no-shadow": ["error"],
17
- "no-shadow": "off",
18
- "no-undef": "off",
19
- "no-unused-vars": "off",
20
- },
21
- },
22
- ],
23
- };
package/.eslintrc.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "extends": [
3
- "eslint:recommended",
4
- "plugin:react/recommended",
5
- "plugin:react-hooks/recommended"
6
- ],
7
- "plugins": ["react", "react-hooks"],
8
- "rules": {
9
- "react/function-component-definition": [
10
- "error",
11
- {
12
- "namedComponents": "function-declaration",
13
- "unnamedComponents": "function-declaration"
14
- }
15
- ],
16
- "import/prefer-default-export": "off",
17
- "react/prefer-stateless-function": "error",
18
- "react/no-this-in-sfc": "error",
19
- "react-hooks/exhaustive-deps": "warn"
20
- },
21
- "settings": {
22
- "react": {
23
- "version": "detect"
24
- }
25
- }
26
- }
package/src/initPanel.ts DELETED
@@ -1,3 +0,0 @@
1
- import { InitPanelOptions } from './types/initPanelOptions';
2
-
3
- export function initPanel({}: InitPanelOptions) {}
@@ -1 +0,0 @@
1
- export interface InitPanelOptions {}