ar-design 0.1.22 → 0.1.24
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/assets/css/components/data-display/chip/chip.css +1 -0
- package/dist/assets/css/components/data-display/table/table.css +2 -2
- package/dist/assets/css/components/feedback/notification/notification.css +162 -0
- package/dist/assets/css/components/layout/header.css +6 -1
- package/dist/assets/css/components/layout/layout.css +5 -5
- package/dist/assets/css/components/navigation/menu/core/open-or-close.css +13 -1
- package/dist/assets/css/components/navigation/menu/menu.css +9 -41
- package/dist/assets/css/core/variants/filled/filled.css +8 -8
- package/dist/components/data-display/chip/index.js +5 -11
- package/dist/components/data-display/paper/index.js +2 -2
- package/dist/components/data-display/table/index.js +40 -16
- package/dist/components/feedback/modal/index.js +1 -0
- package/dist/components/feedback/notification/IProps.d.ts +9 -0
- package/dist/components/feedback/notification/IProps.js +1 -0
- package/dist/components/feedback/notification/index.d.ts +5 -0
- package/dist/components/feedback/notification/index.js +40 -0
- package/dist/components/form/button-group/index.js +5 -6
- package/dist/components/form/select/index.js +5 -2
- package/dist/components/layout/Header.js +5 -4
- package/dist/components/layout/IProps.d.ts +6 -3
- package/dist/components/navigation/menu/index.js +23 -66
- package/dist/libs/core/application/contexts/Config.d.ts +1 -1
- package/dist/libs/core/application/contexts/Config.js +1 -1
- package/dist/libs/core/application/contexts/Notification.d.ts +16 -0
- package/dist/libs/core/application/contexts/Notification.js +19 -0
- package/dist/libs/core/application/contexts/index.d.ts +3 -0
- package/dist/libs/core/application/contexts/index.js +3 -0
- package/dist/libs/core/application/hooks/index.d.ts +8 -0
- package/dist/libs/core/application/hooks/index.js +13 -0
- package/dist/libs/core/service/Api.d.ts +8 -8
- package/dist/libs/core/service/Api.js +8 -8
- package/dist/libs/core/service/index.d.ts +13 -8
- package/dist/libs/core/service/index.js +78 -30
- package/dist/libs/types/index.d.ts +5 -2
- package/package.json +2 -2
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
.ar-table > .content > table > thead > tr > th {
|
|
38
38
|
background-color: var(--gray-100);
|
|
39
|
-
padding:
|
|
39
|
+
padding: 1rem 0.5rem;
|
|
40
40
|
color: var(--gray-700);
|
|
41
41
|
box-shadow: 0 2px 0 0 var(--gray-200);
|
|
42
42
|
text-align: left;
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
box-shadow: 0 0 2px 2px var(--gray-200);
|
|
64
64
|
}
|
|
65
65
|
.ar-table > .content > table > tbody > tr {
|
|
66
|
-
border-bottom: solid
|
|
66
|
+
border-bottom: solid 2px var(--gray-100);
|
|
67
67
|
}
|
|
68
68
|
.ar-table > .content > table > tbody > tr > td {
|
|
69
69
|
background-color: var(--white);
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
.notification {
|
|
2
|
+
position: fixed;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column-reverse;
|
|
5
|
+
gap: 1.25rem 0;
|
|
6
|
+
user-select: none;
|
|
7
|
+
z-index: 1051;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.notification.top-left {
|
|
11
|
+
top: 1rem;
|
|
12
|
+
left: 1rem;
|
|
13
|
+
}
|
|
14
|
+
.notification.top-right {
|
|
15
|
+
top: 1rem;
|
|
16
|
+
right: 1rem;
|
|
17
|
+
}
|
|
18
|
+
.notification.bottom-left {
|
|
19
|
+
bottom: 1rem;
|
|
20
|
+
left: 1rem;
|
|
21
|
+
}
|
|
22
|
+
.notification.bottom-right {
|
|
23
|
+
bottom: 1rem;
|
|
24
|
+
right: 1rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.notification > .item {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: row;
|
|
30
|
+
gap: 0 0.5rem;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 5rem;
|
|
33
|
+
border-radius: var(--border-radius-xl);
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
/* Sırasıyla; Ad, Süre, Hız, Gecikme Süresi, Tekrar Sayısı, Yön, Bitiş Süreci */
|
|
36
|
+
animation: openSnackbar ease-in-out 500ms 0s 1 normal both;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.notification > .item.success {
|
|
40
|
+
background-color: var(--success);
|
|
41
|
+
}
|
|
42
|
+
.notification > .item.warning {
|
|
43
|
+
background-color: var(--warning);
|
|
44
|
+
}
|
|
45
|
+
.notification > .item.information {
|
|
46
|
+
background-color: var(--info);
|
|
47
|
+
}
|
|
48
|
+
.notification > .item.error {
|
|
49
|
+
background-color: var(--danger);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.notification > .item > .icon {
|
|
53
|
+
position: relative;
|
|
54
|
+
min-width: 3rem;
|
|
55
|
+
border-top-left-radius: var(--border-radius-xl);
|
|
56
|
+
border-bottom-left-radius: var(--border-radius-xl);
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
}
|
|
59
|
+
.notification > .item > .icon > span {
|
|
60
|
+
position: absolute;
|
|
61
|
+
border-radius: var(--border-radius-pill);
|
|
62
|
+
}
|
|
63
|
+
/* .notification > .item > .icon > span:nth-child(1) {
|
|
64
|
+
top: 0.5rem;
|
|
65
|
+
left: 0.5rem;
|
|
66
|
+
width: 0.25rem;
|
|
67
|
+
height: 0.25rem;
|
|
68
|
+
}
|
|
69
|
+
.notification > .item > .icon > span:nth-child(2) {
|
|
70
|
+
top: 1.5rem;
|
|
71
|
+
left: 0.5rem;
|
|
72
|
+
width: 0.5rem;
|
|
73
|
+
height: 0.5rem;
|
|
74
|
+
}
|
|
75
|
+
.notification > .item > .icon > span:nth-child(3) {
|
|
76
|
+
top: 2rem;
|
|
77
|
+
left: 1.75rem;
|
|
78
|
+
width: 1rem;
|
|
79
|
+
height: 1rem;
|
|
80
|
+
}
|
|
81
|
+
.notification > .item > .icon > span:nth-child(4) {
|
|
82
|
+
bottom: -1.5rem;
|
|
83
|
+
left: -0.5rem;
|
|
84
|
+
width: 3rem;
|
|
85
|
+
height: 3rem;
|
|
86
|
+
}
|
|
87
|
+
.notification > .item > .icon > span:nth-child(5) {
|
|
88
|
+
bottom: 1.15rem;
|
|
89
|
+
left: 1rem;
|
|
90
|
+
width: 0.55rem;
|
|
91
|
+
height: 0.55rem;
|
|
92
|
+
} */
|
|
93
|
+
.notification > .item > .icon > span.success {
|
|
94
|
+
background-color: var(--success);
|
|
95
|
+
}
|
|
96
|
+
.notification > .item > .icon > span.warning {
|
|
97
|
+
background-color: var(--warning);
|
|
98
|
+
}
|
|
99
|
+
.notification > .item > .icon > span.information {
|
|
100
|
+
background-color: var(--info);
|
|
101
|
+
}
|
|
102
|
+
.notification > .item > .icon > span.error {
|
|
103
|
+
background-color: var(--danger);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.notification > .item > .content {
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
gap: 0.25rem 0;
|
|
111
|
+
width: 100%;
|
|
112
|
+
padding: 0 1rem;
|
|
113
|
+
color: var(--white);
|
|
114
|
+
}
|
|
115
|
+
.notification > .item > .content > .title {
|
|
116
|
+
font-size: 1.25rem;
|
|
117
|
+
}
|
|
118
|
+
.notification > .item > .content > .message {
|
|
119
|
+
font-size: 0.8rem;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.notification > .item > .close {
|
|
123
|
+
display: flex;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
align-items: center;
|
|
126
|
+
min-width: 2.5rem;
|
|
127
|
+
background-color: rgba(var(--black-rgb), 0.1);
|
|
128
|
+
color: rgba(var(--white-rgb), 0.75);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
@media only screen and (max-width: 480px) {
|
|
132
|
+
.notification.top-left {
|
|
133
|
+
inset: 1rem 1rem auto 1rem;
|
|
134
|
+
}
|
|
135
|
+
.notification.top-right {
|
|
136
|
+
inset: 1rem 1rem auto 1rem;
|
|
137
|
+
}
|
|
138
|
+
.notification.bottom-left {
|
|
139
|
+
inset: auto 1rem 1rem 1rem;
|
|
140
|
+
}
|
|
141
|
+
.notification.bottom-right {
|
|
142
|
+
inset: auto 1rem 1rem 1rem;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
@keyframes openSnackbar {
|
|
147
|
+
0% {
|
|
148
|
+
transform: translateX(-500px);
|
|
149
|
+
}
|
|
150
|
+
100% {
|
|
151
|
+
transform: translateX(0);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@keyframes removeSnackbar {
|
|
156
|
+
0% {
|
|
157
|
+
transform: translateX(0);
|
|
158
|
+
}
|
|
159
|
+
100% {
|
|
160
|
+
transform: translateX(-500px);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
top: 0;
|
|
4
4
|
background-color: rgba(var(--white-rgb), 0.5);
|
|
5
5
|
backdrop-filter: blur(5px);
|
|
6
|
-
height:
|
|
6
|
+
height: 5rem;
|
|
7
7
|
border-bottom: solid 1px var(--gray-200);
|
|
8
8
|
box-shadow: 0 10px 10px -15px rgba(var(--black-rgb), 0.25);
|
|
9
9
|
z-index: 10;
|
|
@@ -17,3 +17,8 @@
|
|
|
17
17
|
height: 100%;
|
|
18
18
|
margin: 0 auto;
|
|
19
19
|
}
|
|
20
|
+
.ar-layout > header > .ar-header-with-wrap > .logo-wrapper {
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row;
|
|
23
|
+
gap: 0 1rem;
|
|
24
|
+
}
|
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|
.ar-layout > main {
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: row;
|
|
8
|
-
gap: 0 2.5%;
|
|
9
8
|
width: 1280px;
|
|
10
|
-
margin: 0 auto;
|
|
9
|
+
margin: 2.5rem auto 0 auto;
|
|
11
10
|
}
|
|
12
11
|
.ar-layout > main > aside.ar-aside {
|
|
13
12
|
position: sticky;
|
|
14
|
-
top:
|
|
13
|
+
top: 5rem;
|
|
15
14
|
height: 100%;
|
|
16
|
-
margin: 2rem 0;
|
|
17
15
|
}
|
|
18
16
|
.ar-layout > main > aside.ar-aside.left {
|
|
19
17
|
min-width: 20%;
|
|
18
|
+
min-height: calc(100vh - 7.5rem);
|
|
19
|
+
border-right: solid 1px var(--gray-200);
|
|
20
20
|
}
|
|
21
21
|
.ar-layout > main > aside.ar-aside.right {
|
|
22
22
|
min-width: 20%;
|
|
23
23
|
}
|
|
24
24
|
.ar-layout > main > section {
|
|
25
25
|
height: fit-content;
|
|
26
|
-
|
|
26
|
+
padding: 0 2rem;
|
|
27
27
|
border-radius: var(--border-radius-lg);
|
|
28
28
|
}
|
|
29
29
|
.ar-layout > main:not(:has(> .ar-aside)) > section {
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
.ar-menu ul li ul {
|
|
2
|
+
opacity: 0;
|
|
3
|
+
max-height: 0;
|
|
4
|
+
overflow: hidden;
|
|
5
|
+
transition: max-height 250ms, opacity 250ms ease-in-out;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.ar-menu ul li ul.opened {
|
|
9
|
+
opacity: 1;
|
|
10
|
+
max-height: 100rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* .ar-menu ul li ul {
|
|
2
14
|
opacity: 0;
|
|
3
15
|
max-height: 0;
|
|
4
16
|
overflow: hidden;
|
|
@@ -38,4 +50,4 @@
|
|
|
38
50
|
.ar-menu .ar-menu-list-item-group-item-title.ar-angle-up::after {
|
|
39
51
|
top: -1px;
|
|
40
52
|
transform: rotate(585deg);
|
|
41
|
-
}
|
|
53
|
+
} */
|
|
@@ -7,53 +7,21 @@
|
|
|
7
7
|
padding: 0;
|
|
8
8
|
list-style: none;
|
|
9
9
|
}
|
|
10
|
-
.ar-menu ul li
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
.ar-menu ul li ul {
|
|
14
|
-
margin-left: 0.5rem;
|
|
15
|
-
padding-left: 0.5rem;
|
|
16
|
-
}
|
|
17
|
-
.ar-menu > .ar-menu-list {
|
|
18
|
-
display: flex;
|
|
19
|
-
}
|
|
20
|
-
.ar-menu .ar-menu-list-item-group-item-title {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
height: 2.5rem;
|
|
24
|
-
user-select: none;
|
|
25
|
-
}
|
|
26
|
-
.ar-menu .ar-menu-list-item-group-item-title a {
|
|
27
|
-
color: var(--black);
|
|
10
|
+
.ar-menu ul li a {
|
|
11
|
+
color: inherit;
|
|
28
12
|
text-decoration: none;
|
|
13
|
+
letter-spacing: 1px;
|
|
29
14
|
}
|
|
30
|
-
.ar-menu
|
|
31
|
-
|
|
32
|
-
align-items: center;
|
|
33
|
-
width: 100%;
|
|
34
|
-
height: 100%;
|
|
35
|
-
padding: 0 1rem;
|
|
36
|
-
}
|
|
37
|
-
.ar-menu .ar-menu-list-item-group-item-title:not(.group):hover {
|
|
38
|
-
background-color: var(--gray-200);
|
|
39
|
-
border-radius: var(--border-radius-lg);
|
|
40
|
-
}
|
|
41
|
-
.ar-menu .ar-menu-list-item-group-item-title.selection-item {
|
|
42
|
-
background-color: red;
|
|
15
|
+
.ar-menu ul li ul {
|
|
16
|
+
margin-left: 1rem;
|
|
43
17
|
}
|
|
44
|
-
.ar-menu .
|
|
45
|
-
|
|
46
|
-
/* margin-left: 1rem; */
|
|
47
|
-
padding-left: 0;
|
|
48
|
-
border-radius: 0;
|
|
49
|
-
border-bottom: solid 1px var(--gray-100);
|
|
50
|
-
color: var(--gray-500);
|
|
51
|
-
font-size: 0.85rem;
|
|
18
|
+
.ar-menu ul li.selected {
|
|
19
|
+
color: var(--primary);
|
|
52
20
|
}
|
|
53
21
|
|
|
54
22
|
/* Core Css */
|
|
55
|
-
@import url("./core/selected.css");
|
|
23
|
+
/* @import url("./core/selected.css"); */
|
|
56
24
|
@import url("./core/open-or-close.css");
|
|
57
25
|
|
|
58
26
|
/* Variant Css */
|
|
59
|
-
@import url("./variant/vertical.css");
|
|
27
|
+
/* @import url("./variant/vertical.css"); */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* #region PRIMARY */
|
|
2
2
|
.filled:not(.disabled).primary {
|
|
3
3
|
background-color: var(--primary);
|
|
4
|
-
color: var(--
|
|
4
|
+
color: var(--white)
|
|
5
5
|
}
|
|
6
6
|
input.filled:not(.disabled).primary:hover {
|
|
7
7
|
background-color: var(--primary-active);
|
|
@@ -30,7 +30,7 @@ button.filled:not(.disabled).primary:focus {
|
|
|
30
30
|
/* #region SECONDARY */
|
|
31
31
|
.filled:not(.disabled).secondary {
|
|
32
32
|
background-color: var(--secondary);
|
|
33
|
-
color: var(--
|
|
33
|
+
color: var(--white)
|
|
34
34
|
}
|
|
35
35
|
input.filled:not(.disabled).secondary:hover {
|
|
36
36
|
background-color: var(--secondary-active);
|
|
@@ -59,7 +59,7 @@ button.filled:not(.disabled).secondary:focus {
|
|
|
59
59
|
/* #region SUCCESS */
|
|
60
60
|
.filled:not(.disabled).success {
|
|
61
61
|
background-color: var(--success);
|
|
62
|
-
color: var(--
|
|
62
|
+
color: var(--white)
|
|
63
63
|
}
|
|
64
64
|
input.filled:not(.disabled).success:hover {
|
|
65
65
|
background-color: var(--success-active);
|
|
@@ -88,7 +88,7 @@ button.filled:not(.disabled).success:focus {
|
|
|
88
88
|
/* #region WARNING */
|
|
89
89
|
.filled:not(.disabled).warning {
|
|
90
90
|
background-color: var(--warning);
|
|
91
|
-
color: var(--
|
|
91
|
+
color: var(--dark)
|
|
92
92
|
}
|
|
93
93
|
input.filled:not(.disabled).warning:hover {
|
|
94
94
|
background-color: var(--warning-active);
|
|
@@ -117,7 +117,7 @@ button.filled:not(.disabled).warning:focus {
|
|
|
117
117
|
/* #region DANGER */
|
|
118
118
|
.filled:not(.disabled).danger {
|
|
119
119
|
background-color: var(--danger);
|
|
120
|
-
color: var(--
|
|
120
|
+
color: var(--white)
|
|
121
121
|
}
|
|
122
122
|
input.filled:not(.disabled).danger:hover {
|
|
123
123
|
background-color: var(--danger-active);
|
|
@@ -146,7 +146,7 @@ button.filled:not(.disabled).danger:focus {
|
|
|
146
146
|
/* #region INFORMATION */
|
|
147
147
|
.filled:not(.disabled).information {
|
|
148
148
|
background-color: var(--information);
|
|
149
|
-
color: var(--
|
|
149
|
+
color: var(--white)
|
|
150
150
|
}
|
|
151
151
|
input.filled:not(.disabled).information:hover {
|
|
152
152
|
background-color: var(--information-active);
|
|
@@ -175,7 +175,7 @@ button.filled:not(.disabled).information:focus {
|
|
|
175
175
|
/* #region DARK */
|
|
176
176
|
.filled:not(.disabled).dark {
|
|
177
177
|
background-color: var(--dark);
|
|
178
|
-
color: var(--
|
|
178
|
+
color: var(--white)
|
|
179
179
|
}
|
|
180
180
|
input.filled:not(.disabled).dark:hover {
|
|
181
181
|
background-color: var(--dark-active);
|
|
@@ -204,7 +204,7 @@ button.filled:not(.disabled).dark:focus {
|
|
|
204
204
|
/* #region LIGHT */
|
|
205
205
|
.filled:not(.disabled).light {
|
|
206
206
|
background-color: var(--light);
|
|
207
|
-
color: var(--
|
|
207
|
+
color: var(--dark)
|
|
208
208
|
}
|
|
209
209
|
input.filled:not(.disabled).light:hover {
|
|
210
210
|
background-color: var(--light-active);
|
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import React
|
|
2
|
+
import React from "react";
|
|
3
3
|
import "../../../assets/css/components/data-display/chip/chip.css";
|
|
4
|
+
import Utils from "../../../libs/infrastructure/shared/Utils";
|
|
4
5
|
const Chip = ({ variant = "outlined", status = "primary", border = { radius: "sm" }, text, }) => {
|
|
5
|
-
let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
_className += ` ${variant}`;
|
|
9
|
-
if (status)
|
|
10
|
-
_className += ` ${status}`;
|
|
11
|
-
// border
|
|
12
|
-
_className += ` border-style-solid`;
|
|
13
|
-
_className += ` border-radius-${border.radius}`;
|
|
14
|
-
return React.createElement("span", { className: _className }, text);
|
|
6
|
+
let _chipClassName = ["ar-chip"];
|
|
7
|
+
_chipClassName.push(...Utils.GetClassName(variant, status, border, undefined, undefined, undefined));
|
|
8
|
+
return React.createElement("span", { className: _chipClassName.map((c) => c).join(" ") }, text);
|
|
15
9
|
};
|
|
16
10
|
export default Chip;
|
|
@@ -4,9 +4,9 @@ import "../../../assets/css/components/data-display/paper/paper.css";
|
|
|
4
4
|
const { Title } = Typography;
|
|
5
5
|
const Paper = ({ children, title, action, }) => {
|
|
6
6
|
return (React.createElement("div", { className: "ar-paper" },
|
|
7
|
-
React.createElement("div", { className: "header" },
|
|
7
|
+
(title || action) && (React.createElement("div", { className: "header" },
|
|
8
8
|
title && (React.createElement(Title, { Level: "h3", upperCase: true }, title)),
|
|
9
|
-
action && React.createElement("div", { className: "actions-field" }, action)),
|
|
9
|
+
action && React.createElement("div", { className: "actions-field" }, action))),
|
|
10
10
|
React.createElement("div", { className: "content" }, children)));
|
|
11
11
|
};
|
|
12
12
|
export default Paper;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
2
3
|
import "../../../assets/css/components/data-display/table/table.css";
|
|
3
4
|
import Checkbox from "../../form/checkbox";
|
|
@@ -90,6 +91,21 @@ const Table = function ({ children, data, columns, selections, config, }) {
|
|
|
90
91
|
updateStickyPositions(tbodyElements);
|
|
91
92
|
});
|
|
92
93
|
};
|
|
94
|
+
// Derinlemesine arama yapmak için özyinelemeli bir fonksiyon tanımlayalım.
|
|
95
|
+
const deepSearch = (value, searchedTexts) => {
|
|
96
|
+
if (value === null || value === undefined)
|
|
97
|
+
return false;
|
|
98
|
+
// Eğer değer bir sayı veya string ise, aranan metinle eşleşip eşleşmediğini kontrol ediyoruz.
|
|
99
|
+
if (typeof value === "number" || typeof value === "string") {
|
|
100
|
+
return searchedTexts.some((_searchedText) => value.toString().toLowerCase().includes(_searchedText));
|
|
101
|
+
}
|
|
102
|
+
// Eğer değer bir nesne veya dizi ise, içindeki her bir değeri yine deepSearch fonksiyonuyla kontrol ediyoruz.
|
|
103
|
+
if (typeof value === "object") {
|
|
104
|
+
return Object.values(value).some((innerValue) => deepSearch(innerValue, searchedTexts));
|
|
105
|
+
}
|
|
106
|
+
// Diğer türlerdeki değerleri atla.
|
|
107
|
+
return false;
|
|
108
|
+
};
|
|
93
109
|
const getData = useCallback(() => {
|
|
94
110
|
let _data = [...data];
|
|
95
111
|
_dataLength.current = data.length;
|
|
@@ -99,19 +115,7 @@ const Table = function ({ children, data, columns, selections, config, }) {
|
|
|
99
115
|
return searchedText
|
|
100
116
|
? _data.filter((item) => {
|
|
101
117
|
// `some` kullanarak herhangi bir girişin arama koşulunu karşılayıp karşılamadığını kontrol ediyoruz.
|
|
102
|
-
return Object.entries(item).some(([_key, _value]) =>
|
|
103
|
-
if (typeof _value === "number" || typeof _value === "string") {
|
|
104
|
-
// Değeri string'e dönüştürüp, aranan metni içerip içermediğini kontrol ediyoruz (büyük-küçük harf duyarsız).
|
|
105
|
-
return _value.toString().toLowerCase().includes(searchedText.toLowerCase());
|
|
106
|
-
}
|
|
107
|
-
// Eğer değer bir nesne ise (bu mantığı ihtiyaçlarınıza göre özelleştirebilirsiniz).
|
|
108
|
-
if (typeof _value === "object" && _value !== null) {
|
|
109
|
-
// Örnek: Eğer nesne ise, bu alanı atla veya farklı şekilde ele al.
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
// Diğer türlerdeki (boolean, undefined vs.) değerleri atla.
|
|
113
|
-
return false;
|
|
114
|
-
});
|
|
118
|
+
return Object.entries(item).some(([_key, _value]) => deepSearch(_value, searchedText.split(",").map((text) => text.trim().toLowerCase())));
|
|
115
119
|
})
|
|
116
120
|
: _data;
|
|
117
121
|
}, [data, searchedText, currentPage]);
|
|
@@ -122,7 +126,10 @@ const Table = function ({ children, data, columns, selections, config, }) {
|
|
|
122
126
|
selections(selectionItems);
|
|
123
127
|
}, [selectionItems]);
|
|
124
128
|
useEffect(() => {
|
|
125
|
-
|
|
129
|
+
let allChecked = false;
|
|
130
|
+
if (_checkboxItems.current.length > 0) {
|
|
131
|
+
allChecked = _checkboxItems.current.every((item) => item?.checked === true);
|
|
132
|
+
}
|
|
126
133
|
setSelectAll(allChecked);
|
|
127
134
|
}, [currentPage]);
|
|
128
135
|
return (React.createElement("div", { ref: _tableWrapper, className: _tableClassName.map((c) => c).join(" ") },
|
|
@@ -169,11 +176,28 @@ const Table = function ({ children, data, columns, selections, config, }) {
|
|
|
169
176
|
} }))),
|
|
170
177
|
columns.map((c, cIndex) => {
|
|
171
178
|
let _className = [];
|
|
172
|
-
|
|
179
|
+
let render; // TODO: Generic yapmak için çalışma yap. (Daha Sonra)
|
|
180
|
+
// `c.key` bir string ise
|
|
181
|
+
if (typeof c.key !== "object") {
|
|
182
|
+
render = c.render ? c.render(item) : item[c.key];
|
|
183
|
+
}
|
|
184
|
+
// `c.key` bir nesne ise ve `nestedKey` mevcutsa
|
|
185
|
+
else if (typeof c.key === "object") {
|
|
186
|
+
const _item = item[c.key.field];
|
|
187
|
+
if (_item && typeof _item === "object") {
|
|
188
|
+
render = c.render
|
|
189
|
+
? c.render(item)
|
|
190
|
+
: _item[c.key.nestedKey];
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// Diğer durumlarda `null` döndür
|
|
194
|
+
else {
|
|
195
|
+
render = null;
|
|
196
|
+
}
|
|
173
197
|
// const isTypeOfNumber = typeof render === "number" ? "type-of-number" : "";
|
|
198
|
+
// if (isTypeOfNumber) _className.push(isTypeOfNumber);
|
|
174
199
|
if (c.config?.sticky)
|
|
175
200
|
_className.push(`sticky-${c.config.sticky}`);
|
|
176
|
-
// if (isTypeOfNumber) _className.push(isTypeOfNumber);
|
|
177
201
|
if (c.config?.alignContent) {
|
|
178
202
|
_className.push(`align-content-${c.config.alignContent}`);
|
|
179
203
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import IProps from "./IProps";
|
|
3
|
+
import "../../../assets/css/components/feedback/notification/notification.css";
|
|
4
|
+
declare const Notification: ({ title, message, status, direction, trigger }: IProps) => React.JSX.Element;
|
|
5
|
+
export default Notification;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import "../../../assets/css/components/feedback/notification/notification.css";
|
|
5
|
+
const Notification = ({ title, message, status, direction = "bottom-left", trigger }) => {
|
|
6
|
+
// useRefs
|
|
7
|
+
const _firstLoad = useRef(false);
|
|
8
|
+
const _index = useRef(0);
|
|
9
|
+
const _interval = useRef();
|
|
10
|
+
// useStates
|
|
11
|
+
const [items, setItems] = useState([]);
|
|
12
|
+
// useEffects
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!_firstLoad.current) {
|
|
15
|
+
_firstLoad.current = true;
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
_index.current += 1;
|
|
19
|
+
const createItem = (React.createElement("div", { className: `item ${status}` },
|
|
20
|
+
React.createElement("div", { className: "content" },
|
|
21
|
+
React.createElement("span", { className: `title ${status}` }, title),
|
|
22
|
+
React.createElement("span", { className: "message" }, message)),
|
|
23
|
+
React.createElement("div", { className: "close", "data-index": _index.current, onClick: (event) => {
|
|
24
|
+
const target = event.currentTarget;
|
|
25
|
+
setItems((item) => item.filter((x) => x.index !== Number(target.dataset.index)));
|
|
26
|
+
} }, "x")));
|
|
27
|
+
setItems((items) => [...items, { index: _index.current, element: createItem }]);
|
|
28
|
+
}, [trigger]);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (items.length === 0)
|
|
31
|
+
return;
|
|
32
|
+
// Ekleme işlemi bittikten bir süre sonra tekrar kaldırma işlemi yapılmaktadır.
|
|
33
|
+
_interval.current = setTimeout(() => {
|
|
34
|
+
setItems((items) => items.slice(0, -1));
|
|
35
|
+
clearTimeout(_interval.current);
|
|
36
|
+
}, 2500);
|
|
37
|
+
}, [items]);
|
|
38
|
+
return (React.createElement("div", { className: `notification ${direction}` }, items.map((item, index) => (React.createElement(React.Fragment, { key: index }, item.element)))));
|
|
39
|
+
};
|
|
40
|
+
export default Notification;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React, { useEffect, useState } from "react";
|
|
3
3
|
import "../../../assets/css/components/form/button-group/button-group.css";
|
|
4
|
-
import Button from "../button";
|
|
5
4
|
import Alert from "../../feedback/alert";
|
|
6
5
|
const ButtonGroup = ({ children }) => {
|
|
7
6
|
// states
|
|
@@ -9,11 +8,11 @@ const ButtonGroup = ({ children }) => {
|
|
|
9
8
|
useEffect(() => {
|
|
10
9
|
try {
|
|
11
10
|
// Çocuk elemanların sadece `Button` bileşenleri olduğundan emin olun
|
|
12
|
-
React.Children.forEach(children, (child) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
});
|
|
11
|
+
// React.Children.forEach(children, (child) => {
|
|
12
|
+
// if (!React.isValidElement(child) || child.type !== Button) {
|
|
13
|
+
// throw new Error("ButtonGroup can only have Button elements as children.");
|
|
14
|
+
// }
|
|
15
|
+
// });
|
|
17
16
|
// Hata yoksa, error'u temizle
|
|
18
17
|
setError(null);
|
|
19
18
|
}
|
|
@@ -236,8 +236,11 @@ const Select = ({ variant = "outlined", status, border = { radius: "sm" }, optio
|
|
|
236
236
|
onChange(undefined);
|
|
237
237
|
}
|
|
238
238
|
} })),
|
|
239
|
-
React.createElement("span", { className: `angel-down ${optionsOpen ? "opened" : "closed"}`, onClick: () =>
|
|
240
|
-
|
|
239
|
+
React.createElement("span", { className: `angel-down ${optionsOpen ? "opened" : "closed"}`, onClick: (event) => {
|
|
240
|
+
event.stopPropagation();
|
|
241
|
+
setOptionsOpen((x) => !x);
|
|
242
|
+
} })),
|
|
243
|
+
React.createElement("div", { ref: _options, className: optionsClassName.map((c) => c).join(" ") },
|
|
241
244
|
multiple && (React.createElement("div", { className: "search-field" },
|
|
242
245
|
React.createElement(Input, { ref: _searchField, variant: "outlined", status: "light", placeholder: "Search...", onKeyUp: (event) => {
|
|
243
246
|
// Arama yapmak için kullanılan state bu kısımda dolduruluyor.
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React from "react";
|
|
3
|
-
|
|
4
|
-
const Header = ({ logo, menu }) => {
|
|
3
|
+
const Header = ({ logoWrapper, actions }) => {
|
|
5
4
|
return (React.createElement("header", null,
|
|
6
5
|
React.createElement("div", { className: "ar-header-with-wrap" },
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
React.createElement("div", { className: "logo-wrapper" },
|
|
7
|
+
logoWrapper?.image && logoWrapper.image,
|
|
8
|
+
logoWrapper?.text && React.createElement("h1", null, logoWrapper.text)),
|
|
9
|
+
actions && actions)));
|
|
9
10
|
};
|
|
10
11
|
Header.displayName = "Layout.Header";
|
|
11
12
|
export default Header;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { IGlobalProps } from "../../libs/types/IGlobalProps";
|
|
3
3
|
interface ILayoutProps extends Omit<IGlobalProps, "variant" | "status" | "icon" | "border" | "size" | "upperCase"> {
|
|
4
4
|
}
|
|
5
5
|
interface IHeaderProps {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
logoWrapper?: {
|
|
7
|
+
image?: React.ReactElement<SVGElement | HTMLImageElement>;
|
|
8
|
+
text?: string | React.JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
actions?: React.ReactNode[];
|
|
8
11
|
}
|
|
9
12
|
interface IMainProps extends Omit<IGlobalProps, "variant" | "status" | "icon" | "border" | "size" | "upperCase"> {
|
|
10
13
|
}
|
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useState } from "react";
|
|
3
3
|
import "../../../assets/css/components/navigation/menu/menu.css";
|
|
4
4
|
import Divider from "../../data-display/divider";
|
|
5
|
-
const handleOnClick = (event
|
|
5
|
+
const handleOnClick = (event) => {
|
|
6
6
|
event.stopPropagation();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (_current && item.submenu && item.submenu.length > 0) {
|
|
12
|
-
_current.classList.toggle("ar-angle-down");
|
|
13
|
-
_current.classList.toggle("ar-angle-up");
|
|
14
|
-
}
|
|
15
|
-
if (ulElement)
|
|
16
|
-
ulElement.classList.toggle("opened");
|
|
17
|
-
// Birden fazla menü açılmışsa...
|
|
18
|
-
if (setSelectedMenu)
|
|
19
|
-
setSelectedMenu((prevSelectedMenu) => [...prevSelectedMenu, item]);
|
|
7
|
+
const target = event.currentTarget;
|
|
8
|
+
const ul = Array.from(target.childNodes).filter((child) => child instanceof HTMLUListElement);
|
|
9
|
+
if (ul.length > 0)
|
|
10
|
+
ul[0].classList.toggle("opened");
|
|
20
11
|
else {
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
const selectedItems = document.querySelectorAll(".selected");
|
|
13
|
+
selectedItems.forEach((item) => item.classList.remove("selected"));
|
|
14
|
+
target.classList.add("selected");
|
|
23
15
|
}
|
|
24
16
|
};
|
|
25
17
|
/**
|
|
@@ -32,68 +24,33 @@ const handleOnClick = (event, item, variant, setSelectedItem, setSelectedMenu) =
|
|
|
32
24
|
const SubMenu = ({ items, variant, type, setSelectedMenu, selectedMenu, setSelectedItem, selectedItem }) => {
|
|
33
25
|
if (!items)
|
|
34
26
|
return null;
|
|
35
|
-
|
|
36
|
-
let _className_ul = useRef("ar-menu-list-item-groups").current;
|
|
27
|
+
let className = ["list"];
|
|
37
28
|
if (variant === "vertical" && type === "group")
|
|
38
|
-
|
|
39
|
-
return (React.createElement("ul", { className:
|
|
40
|
-
|
|
41
|
-
let _className_li = useRef("ar-menu-list-item-group-item").current;
|
|
42
|
-
let _className_groupTitle = useRef("ar-menu-list-item-group-item-title").current;
|
|
43
|
-
if (variant === "vertical" && item.type === "group")
|
|
44
|
-
_className_groupTitle += " group";
|
|
29
|
+
className.push("opened");
|
|
30
|
+
return (React.createElement("ul", { className: className.map((c) => c).join(" ") }, items.map((item, index) => {
|
|
31
|
+
let className_li = ["item"];
|
|
45
32
|
if (item.submenu && item.submenu.length > 0) {
|
|
46
33
|
if (variant === "horizontal" || item.type !== "group")
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
34
|
+
if (selectedMenu.length > 0 && selectedMenu.includes(item) && item.type !== "group") {
|
|
35
|
+
// Eğer seçili olan menüyse "selected" sınıfını ekler.
|
|
36
|
+
className_li.push("selected");
|
|
37
|
+
}
|
|
52
38
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
return (React.createElement("li", { key: index, className: _className_li, onClick: (event) => {
|
|
56
|
-
if (item.submenu && item.submenu.length > 0)
|
|
57
|
-
handleOnClick(event, item, variant, null, setSelectedMenu);
|
|
58
|
-
else
|
|
59
|
-
handleOnClick(event, item, variant, setSelectedItem, null);
|
|
60
|
-
} },
|
|
61
|
-
React.createElement("div", { className: _className_groupTitle }, item.render),
|
|
39
|
+
return (React.createElement("li", { key: index, className: className_li.map((c) => c).join(" "), onClick: handleOnClick },
|
|
40
|
+
item.render,
|
|
62
41
|
item.submenu && (React.createElement(SubMenu, { items: item.submenu, variant: variant, type: item.type, setSelectedMenu: setSelectedMenu, selectedMenu: selectedMenu, setSelectedItem: setSelectedItem, selectedItem: selectedItem }))));
|
|
63
42
|
})));
|
|
64
43
|
};
|
|
65
44
|
const Menu = ({ data, variant = "vertical", ...attributes }) => {
|
|
66
45
|
// refs
|
|
67
|
-
let _className_li =
|
|
46
|
+
let _className_li = ["item"];
|
|
68
47
|
// states
|
|
69
48
|
const [selectedMenu, setSelectedMenu] = useState([]);
|
|
70
49
|
const [selectedItem, setSelectedItem] = useState(null);
|
|
71
|
-
const handleClassName = () => {
|
|
72
|
-
let className = "ar-menu-list";
|
|
73
|
-
if (variant)
|
|
74
|
-
className += ` ${variant}`;
|
|
75
|
-
return className;
|
|
76
|
-
};
|
|
77
50
|
return (React.createElement("nav", { className: "ar-menu", ...attributes },
|
|
78
|
-
React.createElement("ul", { className:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (variant === "vertical" && item.type === "group")
|
|
82
|
-
_className_groupTitle += " group";
|
|
83
|
-
if (item.submenu && item.submenu.length > 0) {
|
|
84
|
-
if (variant === "horizontal" || item.type !== "group")
|
|
85
|
-
_className_groupTitle += " ar-angle-down";
|
|
86
|
-
}
|
|
87
|
-
// Eğer seçili olan menüyse "selected" sınıfını ekler.
|
|
88
|
-
// if (
|
|
89
|
-
// selectedMenu.length > 0 &&
|
|
90
|
-
// selectedMenu.includes(item) &&
|
|
91
|
-
// item.type !== "group" &&
|
|
92
|
-
// variant !== "horizontal"
|
|
93
|
-
// )
|
|
94
|
-
// _className_li += " selected";
|
|
95
|
-
return (React.createElement("li", { key: index, className: _className_li, onClick: (event) => handleOnClick(event, item, variant, null, setSelectedMenu) },
|
|
96
|
-
item.type === "divider" ? (React.createElement(Divider, null)) : (React.createElement("div", { className: _className_groupTitle }, item.render)),
|
|
51
|
+
React.createElement("ul", { className: "list" }, data.map((item, index) => {
|
|
52
|
+
return (React.createElement("li", { key: index, className: _className_li.map((c) => c).join(" "), onClick: handleOnClick },
|
|
53
|
+
item.type === "divider" ? React.createElement(Divider, null) : item.render,
|
|
97
54
|
item.submenu && (React.createElement(SubMenu, { items: item.submenu, variant: variant, type: item.type, setSelectedMenu: setSelectedMenu, selectedMenu: selectedMenu, setSelectedItem: setSelectedItem, selectedItem: selectedItem }))));
|
|
98
55
|
}))));
|
|
99
56
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export type Status = "success" | "warning" | "information" | "error";
|
|
3
|
+
export type Direction = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
4
|
+
type Props = {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
direction: Direction;
|
|
7
|
+
};
|
|
8
|
+
type NotificationContextProps = {
|
|
9
|
+
setTitle: React.Dispatch<React.SetStateAction<string>>;
|
|
10
|
+
setMessage: React.Dispatch<React.SetStateAction<string>>;
|
|
11
|
+
setStatus: React.Dispatch<React.SetStateAction<Status>>;
|
|
12
|
+
setTrigger: React.Dispatch<React.SetStateAction<boolean>>;
|
|
13
|
+
};
|
|
14
|
+
declare const NotificationContext: React.Context<Partial<NotificationContextProps>>;
|
|
15
|
+
declare const NotificationProvider: ({ children, direction }: Props) => React.JSX.Element;
|
|
16
|
+
export { NotificationContext, NotificationProvider };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import React, { createContext, useState } from "react";
|
|
3
|
+
import Notification from "../../../../components/feedback/notification";
|
|
4
|
+
const NotificationContext = createContext({});
|
|
5
|
+
const NotificationProvider = ({ children, direction }) => {
|
|
6
|
+
const [title, setTitle] = useState("Example");
|
|
7
|
+
const [message, setMessage] = useState("Lorem Ipsum, dizgi ve baskı endüstrisinde kullanılan mıgır metinlerdir.");
|
|
8
|
+
const [status, setStatus] = useState("success");
|
|
9
|
+
const [trigger, setTrigger] = useState(false);
|
|
10
|
+
return (React.createElement(NotificationContext.Provider, { value: {
|
|
11
|
+
setTitle,
|
|
12
|
+
setMessage,
|
|
13
|
+
setStatus,
|
|
14
|
+
setTrigger,
|
|
15
|
+
} },
|
|
16
|
+
children,
|
|
17
|
+
React.createElement(Notification, { title: title, message: message, status: status, direction: direction, trigger: trigger })));
|
|
18
|
+
};
|
|
19
|
+
export { NotificationContext, NotificationProvider };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Status } from "../contexts/Notification";
|
|
1
2
|
export declare const useLayout: () => {
|
|
2
3
|
config: {
|
|
3
4
|
layout: {
|
|
@@ -30,3 +31,10 @@ export declare const useLayout: () => {
|
|
|
30
31
|
perPage: number;
|
|
31
32
|
}>>;
|
|
32
33
|
};
|
|
34
|
+
export declare const useNotification: () => {
|
|
35
|
+
notification: ({ title, message, status, }: {
|
|
36
|
+
title: string;
|
|
37
|
+
message?: string;
|
|
38
|
+
status: Status;
|
|
39
|
+
}) => void;
|
|
40
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
2
|
import { ConfigContext } from "../contexts/Config";
|
|
3
|
+
import { NotificationContext } from "../contexts/Notification";
|
|
3
4
|
export const useLayout = () => {
|
|
4
5
|
const context = useContext(ConfigContext);
|
|
5
6
|
if (!context) {
|
|
@@ -7,3 +8,15 @@ export const useLayout = () => {
|
|
|
7
8
|
}
|
|
8
9
|
return context;
|
|
9
10
|
};
|
|
11
|
+
export const useNotification = () => {
|
|
12
|
+
// contexts
|
|
13
|
+
const { setTitle, setMessage, setStatus, setTrigger } = useContext(NotificationContext);
|
|
14
|
+
// methods
|
|
15
|
+
const notification = ({ title, message, status, }) => {
|
|
16
|
+
setTitle && setTitle(title);
|
|
17
|
+
setMessage && setMessage(message ?? "");
|
|
18
|
+
setStatus && setStatus(status);
|
|
19
|
+
setTrigger && setTrigger((trigger) => !trigger);
|
|
20
|
+
};
|
|
21
|
+
return { notification };
|
|
22
|
+
};
|
|
@@ -5,24 +5,24 @@ declare class Api {
|
|
|
5
5
|
host?: string;
|
|
6
6
|
core?: string;
|
|
7
7
|
});
|
|
8
|
-
Get
|
|
8
|
+
Get(values: {
|
|
9
9
|
input?: RequestInfo | undefined;
|
|
10
10
|
headers?: HeadersInit;
|
|
11
|
-
}): Promise<
|
|
12
|
-
Post
|
|
11
|
+
}): Promise<Response>;
|
|
12
|
+
Post(values: {
|
|
13
13
|
input?: RequestInfo;
|
|
14
14
|
data: any;
|
|
15
15
|
headers?: HeadersInit;
|
|
16
|
-
}): Promise<
|
|
17
|
-
Put
|
|
16
|
+
}): Promise<Response>;
|
|
17
|
+
Put(values: {
|
|
18
18
|
input?: RequestInfo;
|
|
19
19
|
data?: any;
|
|
20
20
|
headers?: HeadersInit;
|
|
21
|
-
}): Promise<
|
|
22
|
-
Delete
|
|
21
|
+
}): Promise<Response>;
|
|
22
|
+
Delete(values: {
|
|
23
23
|
input?: RequestInfo;
|
|
24
24
|
headers?: HeadersInit;
|
|
25
|
-
}): Promise<
|
|
25
|
+
}): Promise<Response>;
|
|
26
26
|
/**
|
|
27
27
|
* Burada bir fetch işlemi gerçekleştirilmekte fakat farklı olarak burayı `interceptor` olarak kullanmaktayız.
|
|
28
28
|
* @param input
|
|
@@ -6,25 +6,25 @@ class Api {
|
|
|
6
6
|
this._core = values.core || "";
|
|
7
7
|
}
|
|
8
8
|
async Get(values) {
|
|
9
|
-
const
|
|
9
|
+
const response = await this.CustomFetch(`${this._host}/${this._core ? this._core + "/" : ""}${values.input}`, {
|
|
10
10
|
headers: {
|
|
11
11
|
...this.HeaderProperties,
|
|
12
12
|
...values.headers,
|
|
13
13
|
},
|
|
14
14
|
method: "GET",
|
|
15
15
|
});
|
|
16
|
-
return
|
|
16
|
+
return response;
|
|
17
17
|
}
|
|
18
18
|
async Post(values) {
|
|
19
|
-
const
|
|
19
|
+
const response = await this.CustomFetch(`${this._host}/${this._core ? this._core + "/" : ""}${values.input}`, {
|
|
20
20
|
headers: { ...this.HeaderProperties, ...values.headers },
|
|
21
21
|
method: "POST",
|
|
22
22
|
body: JSON.stringify(values.data),
|
|
23
23
|
});
|
|
24
|
-
return
|
|
24
|
+
return response;
|
|
25
25
|
}
|
|
26
26
|
async Put(values) {
|
|
27
|
-
const
|
|
27
|
+
const response = await this.CustomFetch(`${this._host}/${this._core ? this._core + "/" : ""}${values.input}`, {
|
|
28
28
|
headers: {
|
|
29
29
|
...this.HeaderProperties,
|
|
30
30
|
...values.headers,
|
|
@@ -32,17 +32,17 @@ class Api {
|
|
|
32
32
|
method: "PUT",
|
|
33
33
|
body: JSON.stringify(values.data),
|
|
34
34
|
});
|
|
35
|
-
return
|
|
35
|
+
return response;
|
|
36
36
|
}
|
|
37
37
|
async Delete(values) {
|
|
38
|
-
const
|
|
38
|
+
const response = await this.CustomFetch(`${this._host}/${this._core ? this._core + "/" : ""}${values.input}`, {
|
|
39
39
|
headers: {
|
|
40
40
|
...this.HeaderProperties,
|
|
41
41
|
...values.headers,
|
|
42
42
|
},
|
|
43
43
|
method: "DELETE",
|
|
44
44
|
});
|
|
45
|
-
return
|
|
45
|
+
return response;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Burada bir fetch işlemi gerçekleştirilmekte fakat farklı olarak burayı `interceptor` olarak kullanmaktayız.
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
type Result = {
|
|
2
|
+
__ok__: boolean;
|
|
3
|
+
__statusCode__: number;
|
|
4
|
+
__statusText__: string;
|
|
5
|
+
};
|
|
1
6
|
declare class Service {
|
|
2
7
|
private _api;
|
|
3
8
|
private _endPoint;
|
|
@@ -6,23 +11,23 @@ declare class Service {
|
|
|
6
11
|
core?: string;
|
|
7
12
|
endPoint: string;
|
|
8
13
|
});
|
|
9
|
-
Get<
|
|
14
|
+
Get<TResponse>(values?: {
|
|
10
15
|
input?: string;
|
|
11
16
|
headers?: HeadersInit | undefined;
|
|
12
|
-
}): Promise<
|
|
13
|
-
Post<
|
|
17
|
+
}): Promise<TResponse & Result>;
|
|
18
|
+
Post<TResponse, TData>(values?: {
|
|
14
19
|
input?: RequestInfo;
|
|
15
20
|
data: TData;
|
|
16
21
|
headers?: HeadersInit;
|
|
17
|
-
}): Promise<
|
|
18
|
-
Put<
|
|
22
|
+
}): Promise<TResponse & Result>;
|
|
23
|
+
Put<TResponse, TData>(values?: {
|
|
19
24
|
input?: RequestInfo;
|
|
20
25
|
data?: TData;
|
|
21
26
|
headers?: HeadersInit;
|
|
22
|
-
}): Promise<
|
|
23
|
-
Delete<
|
|
27
|
+
}): Promise<TResponse & Result>;
|
|
28
|
+
Delete<TResponse>(values?: {
|
|
24
29
|
input?: RequestInfo;
|
|
25
30
|
headers?: HeadersInit;
|
|
26
|
-
}): Promise<
|
|
31
|
+
}): Promise<TResponse & Result>;
|
|
27
32
|
}
|
|
28
33
|
export default Service;
|
|
@@ -7,42 +7,90 @@ class Service {
|
|
|
7
7
|
this._endPoint = values.endPoint;
|
|
8
8
|
}
|
|
9
9
|
async Get(values) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
try {
|
|
11
|
+
let endPoint = `${this._endPoint}`;
|
|
12
|
+
if (values?.input)
|
|
13
|
+
endPoint += `/${values.input}`;
|
|
14
|
+
const response = await this._api.Get({
|
|
15
|
+
input: endPoint,
|
|
16
|
+
headers: values?.headers,
|
|
17
|
+
});
|
|
18
|
+
const text = (await response.text()).trim();
|
|
19
|
+
return {
|
|
20
|
+
...(text.length > 0 ? await response.json() : {}),
|
|
21
|
+
__ok__: response.ok,
|
|
22
|
+
__statusCode__: response.status,
|
|
23
|
+
__statusText__: response.statusText,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
throw new Error(error instanceof Error ? error.message : "Beklenmeyen bir hata oluştu.");
|
|
28
|
+
}
|
|
17
29
|
}
|
|
18
30
|
async Post(values) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
try {
|
|
32
|
+
let endPoint = `${this._endPoint}`;
|
|
33
|
+
if (values?.input)
|
|
34
|
+
endPoint += `/${values.input}`;
|
|
35
|
+
const response = await this._api.Post({
|
|
36
|
+
input: endPoint,
|
|
37
|
+
data: values?.data,
|
|
38
|
+
headers: values?.headers,
|
|
39
|
+
});
|
|
40
|
+
const text = (await response.text()).trim();
|
|
41
|
+
return {
|
|
42
|
+
...(text.length > 0 ? await response.json() : {}),
|
|
43
|
+
__ok__: response.ok,
|
|
44
|
+
__statusCode__: response.status,
|
|
45
|
+
__statusText__: response.statusText,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
throw new Error(error instanceof Error ? error.message : "Beklenmeyen bir hata oluştu.");
|
|
50
|
+
}
|
|
27
51
|
}
|
|
28
52
|
async Put(values) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
53
|
+
try {
|
|
54
|
+
let endPoint = `${this._endPoint}`;
|
|
55
|
+
if (values?.input)
|
|
56
|
+
endPoint += `/${values.input}`;
|
|
57
|
+
const response = await this._api.Put({
|
|
58
|
+
input: endPoint,
|
|
59
|
+
data: values?.data,
|
|
60
|
+
headers: values?.headers,
|
|
61
|
+
});
|
|
62
|
+
const text = (await response.text()).trim();
|
|
63
|
+
return {
|
|
64
|
+
...(text.length > 0 ? await response.json() : {}),
|
|
65
|
+
__ok__: response.ok,
|
|
66
|
+
__statusCode__: response.status,
|
|
67
|
+
__statusText__: response.statusText,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
throw new Error(error instanceof Error ? error.message : "Beklenmeyen bir hata oluştu.");
|
|
72
|
+
}
|
|
37
73
|
}
|
|
38
74
|
async Delete(values) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
75
|
+
try {
|
|
76
|
+
let endPoint = `${this._endPoint}`;
|
|
77
|
+
if (values?.input)
|
|
78
|
+
endPoint += `/${values.input}`;
|
|
79
|
+
const response = await this._api.Delete({
|
|
80
|
+
input: endPoint,
|
|
81
|
+
headers: values?.headers,
|
|
82
|
+
});
|
|
83
|
+
const text = (await response.text()).trim();
|
|
84
|
+
return {
|
|
85
|
+
...(text.length > 0 ? await response.json() : {}),
|
|
86
|
+
__ok__: response.ok,
|
|
87
|
+
__statusCode__: response.status,
|
|
88
|
+
__statusText__: response.statusText,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
throw new Error(error instanceof Error ? error.message : "Beklenmeyen bir hata oluştu.");
|
|
93
|
+
}
|
|
46
94
|
}
|
|
47
95
|
}
|
|
48
96
|
export default Service;
|
|
@@ -25,10 +25,13 @@ export type MenuItemVariants = "vertical" | "horizontal";
|
|
|
25
25
|
export type MenuItemType = "group" | "divider";
|
|
26
26
|
export type TableColumnType<T> = {
|
|
27
27
|
title: string;
|
|
28
|
-
key?: keyof T
|
|
28
|
+
key?: keyof T | {
|
|
29
|
+
field: keyof T;
|
|
30
|
+
nestedKey: string;
|
|
31
|
+
};
|
|
29
32
|
render?: (item: T) => React.ReactNode;
|
|
30
33
|
config?: {
|
|
31
|
-
alignContent
|
|
34
|
+
alignContent?: "left" | "center" | "right";
|
|
32
35
|
sticky?: "left" | "right";
|
|
33
36
|
};
|
|
34
37
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ar-design",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
9
|
"./@service": "./dist/libs/core/service/index.js",
|
|
10
|
-
"./@config": "./dist/libs/core/application/contexts/
|
|
10
|
+
"./@config": "./dist/libs/core/application/contexts/index.js",
|
|
11
11
|
"./@hooks": "./dist/libs/core/application/hooks/index.js",
|
|
12
12
|
"./@types": "./dist/libs/types/index.js",
|
|
13
13
|
"./@styles": "./dist/assets/css/core/ar-core.css"
|