proje-react-panel 1.0.4 → 1.0.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.
- package/dist/api/crudApi.d.ts +4 -4
- package/dist/index.cjs.js +2 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.js +2 -2
- package/package.json +4 -9
- package/src/api/crudApi.ts +19 -5
- package/src/index.ts +0 -1
- package/dist/bundle.css +0 -128
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "proje-react-panel",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.5",
|
4
4
|
"description": "",
|
5
5
|
"author": "SEFA DEMİR",
|
6
6
|
"license": "ISC",
|
@@ -26,15 +26,10 @@
|
|
26
26
|
"url": "https://github.com/demirsefa/proje-react-panel/issues"
|
27
27
|
},
|
28
28
|
"homepage": "https://github.com/demirsefa/proje-react-panel#readme",
|
29
|
-
"dependencies": {
|
30
|
-
"axios": "^1.8.3",
|
31
|
-
"react-hook-form": "^7.54.2",
|
32
|
-
"rollup-plugin-serve": "^3.0.0"
|
33
|
-
},
|
29
|
+
"dependencies": {},
|
34
30
|
"devDependencies": {
|
35
31
|
"@hookform/resolvers": "^4.1.3",
|
36
32
|
"@rollup/plugin-commonjs": "^28.0.3",
|
37
|
-
"@rollup/plugin-json": "^6.1.0",
|
38
33
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
39
34
|
"@types/react": "^19.0.10",
|
40
35
|
"@types/react-dom": "^19.0.4",
|
@@ -43,13 +38,13 @@
|
|
43
38
|
"class-transformer": "^0.5.1",
|
44
39
|
"class-validator": "^0.14.1",
|
45
40
|
"eslint": "^8.57.1",
|
46
|
-
"node-sass": "^9.0.0",
|
47
41
|
"react": "^19.0.0",
|
42
|
+
"react-hook-form": "^7.54.2",
|
48
43
|
"react-router-dom": "^7.3.0",
|
49
44
|
"reflect-metadata": "^0.2.2",
|
50
45
|
"rollup": "^4.35.0",
|
51
46
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
52
|
-
"rollup-plugin-
|
47
|
+
"rollup-plugin-serve": "^3.0.0",
|
53
48
|
"rollup-plugin-terser": "^7.0.2",
|
54
49
|
"rollup-plugin-typescript2": "^0.36.0",
|
55
50
|
"typescript": "^5.8.2"
|
package/src/api/crudApi.ts
CHANGED
@@ -1,16 +1,30 @@
|
|
1
|
-
import axios from 'axios';
|
2
1
|
|
3
2
|
export const CrudApi = {
|
4
3
|
getList: (api: string, page: number) => {
|
5
|
-
return
|
4
|
+
return fetch(api, {
|
5
|
+
method: "GET",
|
6
|
+
headers: { "Content-Type": "application/json" },
|
7
|
+
body: JSON.stringify({ page }),
|
8
|
+
}).then((res) => res.json());
|
6
9
|
},
|
7
10
|
create: (api: string, data: any) => {
|
8
|
-
return
|
11
|
+
return fetch(api, {
|
12
|
+
method: "POST",
|
13
|
+
headers: { "Content-Type": "application/json" },
|
14
|
+
body: JSON.stringify(data),
|
15
|
+
}).then((res) => res.json());
|
9
16
|
},
|
10
17
|
details(api: string, id: any) {
|
11
|
-
return
|
18
|
+
return fetch(`${api}/${id}`, {
|
19
|
+
method: "GET",
|
20
|
+
headers: { "Content-Type": "application/json" },
|
21
|
+
}).then((res) => res.json());
|
12
22
|
},
|
13
23
|
edit(api: string, data: any) {
|
14
|
-
return
|
24
|
+
return fetch(`${api}/${data.id}`, {
|
25
|
+
method: "PUT",
|
26
|
+
headers: { "Content-Type": "application/json" },
|
27
|
+
body: JSON.stringify(data),
|
28
|
+
}).then((res) => res.json());
|
15
29
|
},
|
16
30
|
};
|
package/src/index.ts
CHANGED
package/dist/bundle.css
DELETED
@@ -1,128 +0,0 @@
|
|
1
|
-
.sidebar {
|
2
|
-
position: relative;
|
3
|
-
background-color: #f5f5f5;
|
4
|
-
height: 100vh;
|
5
|
-
transition: width 0.3s ease;
|
6
|
-
border-right: 1px solid #e0e0e0; }
|
7
|
-
.sidebar.open {
|
8
|
-
width: 250px; }
|
9
|
-
.sidebar.closed {
|
10
|
-
width: 60px; }
|
11
|
-
.sidebar.closed .nav-links a span {
|
12
|
-
display: none; }
|
13
|
-
.sidebar .toggle-button {
|
14
|
-
position: absolute;
|
15
|
-
top: 10px;
|
16
|
-
right: -12px;
|
17
|
-
width: 24px;
|
18
|
-
height: 24px;
|
19
|
-
border-radius: 50%;
|
20
|
-
background-color: #ffffff;
|
21
|
-
border: 1px solid #e0e0e0;
|
22
|
-
display: flex;
|
23
|
-
align-items: center;
|
24
|
-
justify-content: center;
|
25
|
-
cursor: pointer;
|
26
|
-
z-index: 10; }
|
27
|
-
.sidebar .toggle-button:hover {
|
28
|
-
background-color: #f0f0f0; }
|
29
|
-
.sidebar .nav-links {
|
30
|
-
display: flex;
|
31
|
-
flex-direction: column;
|
32
|
-
padding: 2rem 1rem;
|
33
|
-
height: 100%; }
|
34
|
-
.sidebar .nav-links a {
|
35
|
-
padding: 0.75rem 1rem;
|
36
|
-
margin-bottom: 0.5rem;
|
37
|
-
color: #333;
|
38
|
-
text-decoration: none;
|
39
|
-
border-radius: 4px;
|
40
|
-
font-weight: 500; }
|
41
|
-
.sidebar .nav-links a:hover {
|
42
|
-
background-color: rgba(0, 0, 0, 0.05); }
|
43
|
-
.sidebar .nav-links a.active {
|
44
|
-
background-color: rgba(0, 0, 0, 0.1); }
|
45
|
-
.sidebar .nav-links .bottom-link {
|
46
|
-
margin-top: auto; }
|
47
|
-
.sidebar .nav-links .bottom-link a {
|
48
|
-
color: #666;
|
49
|
-
font-weight: 400; }
|
50
|
-
|
51
|
-
.form-wrapper {
|
52
|
-
max-width: 400px;
|
53
|
-
padding: 20px;
|
54
|
-
background-color: #f9f9f9;
|
55
|
-
border-radius: 10px;
|
56
|
-
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
|
57
|
-
.form-wrapper form {
|
58
|
-
display: flex;
|
59
|
-
flex-direction: column; }
|
60
|
-
.form-wrapper .form-field {
|
61
|
-
margin-bottom: 16px; }
|
62
|
-
.form-wrapper .form-field label {
|
63
|
-
font-weight: bold;
|
64
|
-
margin-bottom: 6px;
|
65
|
-
display: block;
|
66
|
-
color: #333; }
|
67
|
-
.form-wrapper .form-field input[type='text'] {
|
68
|
-
padding: 10px;
|
69
|
-
font-size: 16px;
|
70
|
-
border: 1px solid #ccc;
|
71
|
-
border-radius: 5px;
|
72
|
-
width: 100%;
|
73
|
-
transition: border-color 0.2s; }
|
74
|
-
.form-wrapper .form-field input[type='text']:focus {
|
75
|
-
border-color: #007bff;
|
76
|
-
outline: none; }
|
77
|
-
.form-wrapper .form-field .error-message {
|
78
|
-
margin-top: 4px;
|
79
|
-
font-size: 14px;
|
80
|
-
color: #ff4d4f; }
|
81
|
-
.form-wrapper .submit-button {
|
82
|
-
padding: 12px;
|
83
|
-
font-size: 18px;
|
84
|
-
background-color: #007bff;
|
85
|
-
color: white;
|
86
|
-
border: none;
|
87
|
-
border-radius: 5px;
|
88
|
-
cursor: pointer;
|
89
|
-
transition: background-color 0.2s; }
|
90
|
-
.form-wrapper .submit-button:hover {
|
91
|
-
background-color: #0056b3; }
|
92
|
-
|
93
|
-
.layout {
|
94
|
-
display: flex;
|
95
|
-
min-height: 100vh;
|
96
|
-
width: 100%; }
|
97
|
-
.layout .content {
|
98
|
-
flex: 1;
|
99
|
-
padding: 1rem;
|
100
|
-
overflow-y: auto;
|
101
|
-
transition: margin-left 0.3s ease; }
|
102
|
-
|
103
|
-
.list-wrapper {
|
104
|
-
width: 100%;
|
105
|
-
padding: 16px;
|
106
|
-
background-color: #ffffff;
|
107
|
-
border-radius: 8px;
|
108
|
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }
|
109
|
-
.list-wrapper .header {
|
110
|
-
font-size: 24px;
|
111
|
-
font-weight: bold;
|
112
|
-
text-align: center;
|
113
|
-
margin-bottom: 20px; }
|
114
|
-
.list-wrapper .list-table {
|
115
|
-
width: 100%;
|
116
|
-
border-collapse: collapse; }
|
117
|
-
.list-wrapper .list-table th,
|
118
|
-
.list-wrapper .list-table td {
|
119
|
-
padding: 12px 16px;
|
120
|
-
text-align: left;
|
121
|
-
border-bottom: 1px solid #ddd; }
|
122
|
-
.list-wrapper .list-table th {
|
123
|
-
background-color: #007bff;
|
124
|
-
color: white; }
|
125
|
-
.list-wrapper .list-table tr:nth-child(even) {
|
126
|
-
background-color: #f9f9f9; }
|
127
|
-
.list-wrapper .list-table tr:hover {
|
128
|
-
background-color: #e8f4ff; }
|