ar-design 0.1.92 → 0.1.94
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/form/date-picker/calendar/calendar.css +3 -1
- package/dist/assets/css/components/form/date-picker/calendar/header.css +1 -67
- package/dist/assets/css/components/form/date-picker/clock/clock.css +3 -18
- package/dist/assets/css/components/form/date-picker/clock/content.css +2 -3
- package/dist/assets/css/components/form/date-picker/clock/footer.css +0 -1
- package/dist/assets/css/components/form/date-picker/clock/header.css +4 -2
- package/dist/assets/css/components/form/select/options.css +2 -0
- package/dist/components/data-display/table/index.js +7 -7
- package/dist/components/data-display/typography/paragraph/Paragraph.js +1 -1
- package/dist/components/feedback/modal/index.js +6 -1
- package/dist/components/form/date-picker/DATE.js +1 -1
- package/dist/components/form/date-picker/index.js +73 -27
- package/dist/components/form/switch/index.js +0 -1
- package/dist/components/icons/Compiler.js +14 -0
- package/dist/libs/core/service/Api.js +1 -1
- package/dist/libs/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
.ar-date-calendar {
|
|
2
2
|
position: absolute;
|
|
3
|
+
top: 0;
|
|
4
|
+
left: 0;
|
|
3
5
|
background-color: var(--white);
|
|
4
6
|
width: 20rem;
|
|
5
7
|
border: solid 1px var(--gray-200);
|
|
6
|
-
border-radius: var(--border-radius-
|
|
8
|
+
border-radius: var(--border-radius-sm);
|
|
7
9
|
box-shadow: 0 0 10px -5px rgba(var(--black-rgb), 0.25);
|
|
8
10
|
z-index: 1051;
|
|
9
11
|
transition: visibility 250ms, opacity 250ms ease-in-out;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
height: var(--input-height);
|
|
26
26
|
}
|
|
27
27
|
.ar-date-calendar > .header > .select-field > .selects > div > span {
|
|
28
|
-
|
|
28
|
+
-webkit-text-stroke: 1px var(--black);
|
|
29
29
|
user-select: none;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -34,71 +34,5 @@
|
|
|
34
34
|
.ar-date-calendar > .header > .select-field > .next {
|
|
35
35
|
user-select: none;
|
|
36
36
|
}
|
|
37
|
-
.ar-date-calendar > .header > .select-field > .prev > span,
|
|
38
|
-
.ar-date-calendar > .header > .select-field > .next > span {
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 50%;
|
|
41
|
-
transform: translateY(-50%);
|
|
42
|
-
left: 0;
|
|
43
|
-
width: 1rem;
|
|
44
|
-
height: 1rem;
|
|
45
|
-
cursor: pointer;
|
|
46
|
-
}
|
|
47
|
-
.ar-date-calendar > .header > .select-field > .next > span {
|
|
48
|
-
left: auto;
|
|
49
|
-
right: 0;
|
|
50
|
-
}
|
|
51
|
-
.ar-date-calendar > .header > .select-field > .prev > span:last-child {
|
|
52
|
-
left: 1.5rem;
|
|
53
|
-
}
|
|
54
|
-
.ar-date-calendar > .header > .select-field > .next > span:first-child {
|
|
55
|
-
right: 1.5rem;
|
|
56
|
-
}
|
|
57
|
-
.ar-date-calendar > .header > .select-field > .prev > span:first-child::before,
|
|
58
|
-
.ar-date-calendar > .header > .select-field > .prev > span:first-child::after {
|
|
59
|
-
position: absolute;
|
|
60
|
-
content: "";
|
|
61
|
-
width: 100%;
|
|
62
|
-
height: 100%;
|
|
63
|
-
border-top: solid 2px var(--gray-600);
|
|
64
|
-
border-left: solid 2px var(--gray-600);
|
|
65
|
-
transform: rotate(-45deg);
|
|
66
|
-
}
|
|
67
|
-
.ar-date-calendar > .header > .select-field > .next > span:last-child::before,
|
|
68
|
-
.ar-date-calendar > .header > .select-field > .next > span:last-child::after {
|
|
69
|
-
position: absolute;
|
|
70
|
-
content: "";
|
|
71
|
-
width: 100%;
|
|
72
|
-
height: 100%;
|
|
73
|
-
border-top: solid 2px var(--gray-600);
|
|
74
|
-
border-left: solid 2px var(--gray-600);
|
|
75
|
-
transform: rotate(135deg);
|
|
76
|
-
}
|
|
77
|
-
.ar-date-calendar > .header > .select-field > .prev > span:first-child::after {
|
|
78
|
-
left: 0.35rem;
|
|
79
|
-
opacity: 0.25;
|
|
80
|
-
}
|
|
81
|
-
.ar-date-calendar > .header > .select-field > .next > span:last-child::after {
|
|
82
|
-
left: 0.35rem;
|
|
83
|
-
opacity: 0.25;
|
|
84
|
-
}
|
|
85
|
-
.ar-date-calendar > .header > .select-field > .prev > span:last-child::before {
|
|
86
|
-
position: absolute;
|
|
87
|
-
content: "";
|
|
88
|
-
width: 100%;
|
|
89
|
-
height: 100%;
|
|
90
|
-
border-top: solid 2px var(--gray-600);
|
|
91
|
-
border-left: solid 2px var(--gray-600);
|
|
92
|
-
transform: rotate(-45deg);
|
|
93
|
-
}
|
|
94
|
-
.ar-date-calendar > .header > .select-field > .next > span:first-child::before {
|
|
95
|
-
position: absolute;
|
|
96
|
-
content: "";
|
|
97
|
-
width: 100%;
|
|
98
|
-
height: 100%;
|
|
99
|
-
border-top: solid 2px var(--gray-600);
|
|
100
|
-
border-left: solid 2px var(--gray-600);
|
|
101
|
-
transform: rotate(135deg);
|
|
102
|
-
}
|
|
103
37
|
/* #endregion Prev and Next Buttons */
|
|
104
38
|
/* Prev and Next Buttons */
|
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
.ar-date-calendar > .clock {
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: -1px;
|
|
4
|
+
right: -8rem;
|
|
4
5
|
display: flex;
|
|
5
6
|
flex-direction: column;
|
|
6
|
-
background-color:
|
|
7
|
-
backdrop-filter: blur(10px);
|
|
7
|
+
background-color: var(--white);
|
|
8
8
|
width: 7.5rem;
|
|
9
|
-
height: 100.5%;
|
|
10
9
|
border: solid 1px var(--gray-200);
|
|
11
|
-
border-radius: var(--border-radius-
|
|
10
|
+
border-radius: var(--border-radius-sm);
|
|
12
11
|
box-shadow: 0 0 10px -5px rgba(var(--black-rgb), 0.25);
|
|
13
12
|
z-index: 1051;
|
|
14
13
|
user-select: none;
|
|
15
14
|
}
|
|
16
|
-
.ar-date-calendar > .clock.active {
|
|
17
|
-
visibility: visible;
|
|
18
|
-
opacity: 1;
|
|
19
|
-
right: -8rem;
|
|
20
|
-
transform: scale(1);
|
|
21
|
-
transition: visibility 250ms, opacity 250ms, right 250ms, transform 150ms 300ms ease-in-out;
|
|
22
|
-
}
|
|
23
|
-
.ar-date-calendar > .clock.passive {
|
|
24
|
-
visibility: hidden;
|
|
25
|
-
opacity: 0;
|
|
26
|
-
right: -5rem;
|
|
27
|
-
transform: scale(0.8);
|
|
28
|
-
transition: visibility 250ms 200ms, opacity 250ms 200ms, right 250ms 200ms, transform 150ms ease-in-out;
|
|
29
|
-
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
.ar-date-calendar > .clock > .content {
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
|
-
|
|
4
|
+
overflow: hidden;
|
|
5
5
|
}
|
|
6
6
|
.ar-date-calendar > .clock > .content > ul {
|
|
7
7
|
width: 50%;
|
|
8
|
-
padding-bottom: calc(var(--input-height) * 6.5);
|
|
9
8
|
overflow-y: auto;
|
|
10
9
|
scrollbar-width: none;
|
|
11
10
|
}
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
display: flex;
|
|
20
19
|
align-items: center;
|
|
21
20
|
justify-content: center;
|
|
22
|
-
min-height:
|
|
21
|
+
min-height: 2rem;
|
|
23
22
|
cursor: pointer;
|
|
24
23
|
}
|
|
25
24
|
.ar-date-calendar > .clock > .content > ul > li > span {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
.ar-date-calendar > .clock > .header {
|
|
2
|
-
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: center;
|
|
4
|
+
align-items: center;
|
|
3
5
|
border-bottom: solid 1px var(--gray-200);
|
|
4
6
|
text-align: center;
|
|
5
|
-
|
|
7
|
+
-webkit-text-stroke: 1px var(--black);
|
|
6
8
|
}
|
|
@@ -172,7 +172,6 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
172
172
|
// Eğer değer bir sayı veya string ise, aranan metinle eşleşip eşleşmediğini kontrol ediyoruz.
|
|
173
173
|
return Object.entries(searchedText).every(([key, value]) => {
|
|
174
174
|
const _itemValue = item[key];
|
|
175
|
-
debugger;
|
|
176
175
|
if (typeof _itemValue === "number" || typeof _itemValue === "string") {
|
|
177
176
|
if (Array.isArray(value)) {
|
|
178
177
|
if (value.length === 0)
|
|
@@ -238,7 +237,6 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
238
237
|
}
|
|
239
238
|
setSelectAll(allChecked);
|
|
240
239
|
}, [currentPage]);
|
|
241
|
-
console.log(searchedText);
|
|
242
240
|
return (React.createElement("div", { ref: _tableWrapper, className: _tableClassName.map((c) => c).join(" ") },
|
|
243
241
|
(title || description || actions || React.Children.count(children) > 0) && (React.createElement("div", { className: "header" },
|
|
244
242
|
React.createElement("div", { className: "title" },
|
|
@@ -275,7 +273,7 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
275
273
|
if (c.config?.alignContent) {
|
|
276
274
|
_className.push(`align-content-${c.config.alignContent}`);
|
|
277
275
|
}
|
|
278
|
-
return (React.createElement("th", { key: `column-${cIndex}`, ...(_className.length > 0 && {
|
|
276
|
+
return (React.createElement("th", { key: `column-${cIndex}-${Math.random()}`, ...(_className.length > 0 && {
|
|
279
277
|
className: `${_className.map((c) => c).join(" ")}`,
|
|
280
278
|
}), ...(c.config?.width && {
|
|
281
279
|
style: { minWidth: c.config.width },
|
|
@@ -286,6 +284,8 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
286
284
|
config?.isSearchable && (React.createElement("tr", { key: "isSearchable" },
|
|
287
285
|
selections && (React.createElement("th", { key: `column-selections`, className: "selection-col sticky-left", "data-sticky-position": "left" })),
|
|
288
286
|
columns.map((c, cIndex) => {
|
|
287
|
+
if (!c.key)
|
|
288
|
+
return React.createElement("th", null);
|
|
289
289
|
let _className = [];
|
|
290
290
|
if (c.config?.sticky)
|
|
291
291
|
_className.push(`sticky-${c.config.sticky}`);
|
|
@@ -304,10 +304,10 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
304
304
|
// .filter((x) =>
|
|
305
305
|
// x.text.toLocaleLowerCase().includes(searchedFilters?.toLocaleLowerCase() ?? "")
|
|
306
306
|
// )
|
|
307
|
-
.map((filter,
|
|
307
|
+
.map((filter, fIndex) => {
|
|
308
308
|
const name = typeof c.key !== "object" ? String(c.key) : String(c.key.field);
|
|
309
|
-
return (React.createElement("li", { key:
|
|
310
|
-
React.createElement(Checkbox, { ref: (element) => (_filterCheckboxItems.current[
|
|
309
|
+
return (React.createElement("li", { key: `filters-${fIndex}-${Math.random()}` },
|
|
310
|
+
React.createElement(Checkbox, { ref: (element) => (_filterCheckboxItems.current[fIndex] = element), label: filter.text, name: name, status: "success", value: filter.text, checked: config.isServerSide
|
|
311
311
|
? _searchedParams?.[name]?.includes(filter.text)
|
|
312
312
|
: searchedText?.[name]?.includes(filter.text), onChange: handleChecboxFilter })));
|
|
313
313
|
}))) },
|
|
@@ -323,7 +323,7 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
323
323
|
} })),
|
|
324
324
|
React.createElement(Button, { variant: "borderless", icon: { element: React.createElement(ARIcon, { icon: "Filter", stroke: "var(--primary)", size: 16 }) } }))))));
|
|
325
325
|
})))),
|
|
326
|
-
React.createElement("tbody", null, getData().length > 0 ? (getData().map((item, index) => (React.createElement("tr", { key: `row-${index}` },
|
|
326
|
+
React.createElement("tbody", null, getData().length > 0 ? (getData().map((item, index) => (React.createElement("tr", { key: `row-${index}-${Math.random()}` },
|
|
327
327
|
selections && (React.createElement("td", { key: `selection-${index}`, className: "sticky-left", "data-sticky-position": "left" },
|
|
328
328
|
React.createElement(Checkbox, { ref: (element) => (_checkboxItems.current[index] = element), status: "primary", checked: selectionItems.some((selectionItem) => JSON.stringify(selectionItem) === JSON.stringify(item)), onChange: (event) => {
|
|
329
329
|
if (event.target.checked)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import React from "react";
|
|
3
|
-
const Paragraph = ({ children, color, align = "left", size, upperCase = false
|
|
3
|
+
const Paragraph = ({ children, color, align = "left", size, upperCase = false }) => {
|
|
4
4
|
let _className = ["ar-typography-paragraph"];
|
|
5
5
|
if (align)
|
|
6
6
|
_className.push(align);
|
|
@@ -15,8 +15,13 @@ const Modal = ({ children, open, title, size = "normal", footer }) => {
|
|
|
15
15
|
// methods
|
|
16
16
|
const handleKeys = (event) => {
|
|
17
17
|
const key = event.key;
|
|
18
|
-
|
|
18
|
+
const isArSelectOptions = document.getElementsByClassName("ar-select-options").length === 0;
|
|
19
|
+
const isArCalendar = document.getElementsByClassName("ar-date-calendar").length === 0;
|
|
20
|
+
const isArPopover = document.getElementsByClassName("ar-popover").length === 0;
|
|
21
|
+
if (key === "Escape" && isArCalendar && isArSelectOptions && isArPopover) {
|
|
22
|
+
event.stopPropagation();
|
|
19
23
|
open.set(false);
|
|
24
|
+
}
|
|
20
25
|
};
|
|
21
26
|
const handlePosition = () => {
|
|
22
27
|
if (_arModal.current) {
|
|
@@ -4,7 +4,7 @@ class DATE {
|
|
|
4
4
|
const [sd, st] = value.split("T");
|
|
5
5
|
const [y, m, d] = sd.split("-").map(Number);
|
|
6
6
|
// Zaman Bilgileri
|
|
7
|
-
const [c, _] = isCloack ? st.split(".") : "00:00";
|
|
7
|
+
const [c, _] = isCloack && st ? st.split(".") : "00:00";
|
|
8
8
|
const [hh, mm] = isCloack ? c.split(":").map(Number) : [0, 0];
|
|
9
9
|
return {
|
|
10
10
|
year: y,
|
|
@@ -6,6 +6,7 @@ import Button from "../button";
|
|
|
6
6
|
import Alert from "../../feedback/alert";
|
|
7
7
|
import ReactDOM from "react-dom";
|
|
8
8
|
import DATE from "./DATE";
|
|
9
|
+
import { ARIcon } from "../../icons";
|
|
9
10
|
const weekdays = ["Pzt", "Sal", "Çar", "Per", "Cum", "Cmt", "Paz"];
|
|
10
11
|
const months = [
|
|
11
12
|
{ value: 0, text: "Ocak" },
|
|
@@ -24,6 +25,11 @@ const months = [
|
|
|
24
25
|
const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
25
26
|
// refs
|
|
26
27
|
const _arCalendar = useRef(null);
|
|
28
|
+
const _arClock = useRef(null);
|
|
29
|
+
const _calendarHeader = useRef(null);
|
|
30
|
+
const _calendarFooter = useRef(null);
|
|
31
|
+
const _clockHeader = useRef(null);
|
|
32
|
+
const _clockFooter = useRef(null);
|
|
27
33
|
const _currentDate = useRef(new Date()).current;
|
|
28
34
|
const _beginDate = useRef(null);
|
|
29
35
|
// refs -> Geçerli Tarih ve Saat Bilgileri.
|
|
@@ -54,13 +60,17 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
54
60
|
// methods
|
|
55
61
|
const handleClickOutSide = (event) => {
|
|
56
62
|
const target = event.target;
|
|
63
|
+
if (target === _beginDate.current)
|
|
64
|
+
return;
|
|
57
65
|
if (_arCalendar.current && !_arCalendar.current.contains(target))
|
|
58
66
|
closeCalendar();
|
|
59
67
|
};
|
|
60
68
|
const handleKeys = (event) => {
|
|
61
69
|
const key = event.key;
|
|
62
|
-
if (key === "Escape")
|
|
70
|
+
if (key === "Escape") {
|
|
71
|
+
event.stopPropagation();
|
|
63
72
|
closeCalendar();
|
|
73
|
+
}
|
|
64
74
|
};
|
|
65
75
|
const handlePosition = () => {
|
|
66
76
|
if (_arCalendar.current && _beginDate.current) {
|
|
@@ -76,7 +86,31 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
76
86
|
}
|
|
77
87
|
}
|
|
78
88
|
};
|
|
79
|
-
|
|
89
|
+
const handleHeight = () => {
|
|
90
|
+
if (_arCalendar.current && _arClock.current) {
|
|
91
|
+
const calendar = _arCalendar.current?.getBoundingClientRect()?.height;
|
|
92
|
+
_arClock.current.style.maxHeight = `${calendar}px`;
|
|
93
|
+
}
|
|
94
|
+
if (_calendarHeader.current && _clockHeader.current) {
|
|
95
|
+
const calendarHeaderH = _calendarHeader.current?.getBoundingClientRect()?.height;
|
|
96
|
+
_clockHeader.current.style.minHeight = `${calendarHeaderH}px`;
|
|
97
|
+
}
|
|
98
|
+
if (_calendarFooter && _clockFooter.current) {
|
|
99
|
+
const calendarFooterH = _calendarFooter.current?.getBoundingClientRect()?.height;
|
|
100
|
+
_clockFooter.current.style.minHeight = `${calendarFooterH}px`;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const handleOk = (isShutdownOn = true) => {
|
|
104
|
+
// Stateler güncelleniyor...
|
|
105
|
+
setSelectedYear(_year.current);
|
|
106
|
+
setSelectedMonth(_month.current);
|
|
107
|
+
setSelectedDay(_day.current);
|
|
108
|
+
setSelectedHours(_hours.current);
|
|
109
|
+
setSelectedMinutes(_minutes.current);
|
|
110
|
+
const inputDate = new Date(Date.UTC(_year.current, _month.current, _day.current, !isClock ? 0 : _hours.current, !isClock ? 0 : _minutes.current, 0));
|
|
111
|
+
onChange(inputDate.toISOString());
|
|
112
|
+
isShutdownOn && setCalendarIsOpen(false);
|
|
113
|
+
};
|
|
80
114
|
const setNowButton = () => {
|
|
81
115
|
const now = new Date();
|
|
82
116
|
// Stateler güncelleniyor...
|
|
@@ -96,19 +130,8 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
96
130
|
const inputDate = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), !isClock ? 0 : now.getHours(), !isClock ? 0 : now.getMinutes(), 0));
|
|
97
131
|
onChange(inputDate.toISOString());
|
|
98
132
|
};
|
|
99
|
-
// Tamam Butonu
|
|
100
133
|
const okayButton = () => {
|
|
101
|
-
return (React.createElement(Button, { variant: "borderless", status: "success", onClick: () =>
|
|
102
|
-
// Stateler güncelleniyor...
|
|
103
|
-
setSelectedYear(_year.current);
|
|
104
|
-
setSelectedMonth(_month.current);
|
|
105
|
-
setSelectedDay(_day.current);
|
|
106
|
-
setSelectedHours(_hours.current);
|
|
107
|
-
setSelectedMinutes(_minutes.current);
|
|
108
|
-
const inputDate = new Date(Date.UTC(_year.current, _month.current, _day.current, !isClock ? 0 : _hours.current, !isClock ? 0 : _minutes.current, 0));
|
|
109
|
-
onChange(inputDate.toISOString());
|
|
110
|
-
setCalendarIsOpen(false);
|
|
111
|
-
} }, "Tamam"));
|
|
134
|
+
return (React.createElement(Button, { variant: "borderless", status: "success", onClick: () => handleOk() }, "Tamam"));
|
|
112
135
|
};
|
|
113
136
|
const closeCalendar = () => {
|
|
114
137
|
const { year, month, day, hours, minutes } = DATE.Parse(String(attributes.value), isClock);
|
|
@@ -122,7 +145,10 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
122
145
|
// useEffects
|
|
123
146
|
useEffect(() => {
|
|
124
147
|
if (calendarIsOpen) {
|
|
125
|
-
setTimeout(() =>
|
|
148
|
+
setTimeout(() => {
|
|
149
|
+
handleHeight();
|
|
150
|
+
handlePosition();
|
|
151
|
+
}, 0);
|
|
126
152
|
const days = [];
|
|
127
153
|
const firstDayOfMonth = new Date(_year.current, _month.current, 1);
|
|
128
154
|
const lastDayOfMonth = new Date(_year.current, _month.current + 1, 0);
|
|
@@ -144,6 +170,7 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
144
170
|
_day.current = i;
|
|
145
171
|
setSelectedDay(i);
|
|
146
172
|
setDateChanged(!dateChanged);
|
|
173
|
+
handleOk(false);
|
|
147
174
|
} },
|
|
148
175
|
React.createElement("span", null, i)));
|
|
149
176
|
}
|
|
@@ -151,12 +178,12 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
151
178
|
days.push(React.createElement("span", { key: `next-${i}`, className: "empty-day" }));
|
|
152
179
|
}
|
|
153
180
|
setCalendarDays(days);
|
|
154
|
-
window.addEventListener("blur", () => closeCalendar());
|
|
181
|
+
// window.addEventListener("blur", () => closeCalendar());
|
|
155
182
|
document.addEventListener("click", handleClickOutSide);
|
|
156
183
|
document.addEventListener("keydown", handleKeys);
|
|
157
184
|
}
|
|
158
185
|
return () => {
|
|
159
|
-
window.removeEventListener("blur", () => closeCalendar());
|
|
186
|
+
// window.removeEventListener("blur", () => closeCalendar());
|
|
160
187
|
document.removeEventListener("click", handleClickOutSide);
|
|
161
188
|
document.removeEventListener("keydown", handleKeys);
|
|
162
189
|
};
|
|
@@ -174,6 +201,7 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
174
201
|
_minutes.current = i;
|
|
175
202
|
setSelectedMinutes(i);
|
|
176
203
|
}
|
|
204
|
+
handleOk(false);
|
|
177
205
|
} },
|
|
178
206
|
React.createElement("span", null,
|
|
179
207
|
React.createElement("span", null, i.toString().padStart(2, "0"))))));
|
|
@@ -184,6 +212,8 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
184
212
|
generateList(60, _minutes.current, setMinutes);
|
|
185
213
|
if (!isClock)
|
|
186
214
|
return;
|
|
215
|
+
if (calendarIsOpen)
|
|
216
|
+
handleHeight();
|
|
187
217
|
// Seçim sonrasında en yukarı getirme işlemi için aşağıda yer alan kodlar yazılmıştır
|
|
188
218
|
const hourLiElement = _hoursLiElements.current[_hours.current];
|
|
189
219
|
const minuteLiElement = _minutesLiElements.current[_minutes.current];
|
|
@@ -218,11 +248,18 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
218
248
|
attributes.placeholder && attributes.placeholder.length > 0 && (React.createElement("label", null,
|
|
219
249
|
validation ? "* " : "",
|
|
220
250
|
attributes.placeholder)),
|
|
221
|
-
React.createElement(Input, { ref: _beginDate, value: DATE.ParseValue(String(attributes.value), isClock), type: isClock ? "datetime-local" : "date", onKeyDown: (event) =>
|
|
251
|
+
React.createElement(Input, { ref: _beginDate, value: DATE.ParseValue(String(attributes.value), isClock), type: isClock ? "datetime-local" : "date", onKeyDown: (event) => {
|
|
252
|
+
if (event.code === "Space")
|
|
253
|
+
event.preventDefault();
|
|
254
|
+
else if (event.code === "Enter")
|
|
255
|
+
handleOk();
|
|
256
|
+
}, onChange: (event) => {
|
|
222
257
|
// Disabled gelmesi durumunda işlem yapmasına izin verme...
|
|
223
258
|
if (attributes.disabled)
|
|
224
259
|
return;
|
|
225
260
|
(() => {
|
|
261
|
+
if (!calendarIsOpen)
|
|
262
|
+
setCalendarIsOpen(true);
|
|
226
263
|
const value = event.target.value;
|
|
227
264
|
const [date, time] = value.split("T");
|
|
228
265
|
const [year, month, day] = date.split("-").map(Number);
|
|
@@ -235,8 +272,13 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
235
272
|
_hours.current = hours;
|
|
236
273
|
_minutes.current = minutes;
|
|
237
274
|
}
|
|
275
|
+
// Yıl ve Ay'ı anlık yeniler.
|
|
276
|
+
setSelectedYear(_year.current);
|
|
277
|
+
setSelectedMonth(_month.current);
|
|
278
|
+
// Takvimi anlık yeniler.
|
|
238
279
|
setDateChanged((prev) => !prev);
|
|
239
280
|
setTimeChanged((prev) => !prev);
|
|
281
|
+
onChange(value);
|
|
240
282
|
})();
|
|
241
283
|
}, onClick: (event) => {
|
|
242
284
|
event.preventDefault();
|
|
@@ -244,14 +286,15 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
244
286
|
}, autoComplete: "off", validation: validation }),
|
|
245
287
|
calendarIsOpen &&
|
|
246
288
|
ReactDOM.createPortal(React.createElement("div", { ref: _arCalendar, className: "ar-date-calendar" },
|
|
247
|
-
React.createElement("div", { className: "header" },
|
|
289
|
+
React.createElement("div", { ref: _calendarHeader, className: "header" },
|
|
248
290
|
React.createElement("div", { className: "select-field" },
|
|
249
291
|
React.createElement("div", { className: "prev" },
|
|
250
292
|
React.createElement("span", { onClick: () => {
|
|
251
293
|
_year.current -= 1;
|
|
252
294
|
setSelectedYear(_year.current);
|
|
253
295
|
setDateChanged((prev) => !prev);
|
|
254
|
-
} }
|
|
296
|
+
} },
|
|
297
|
+
React.createElement(ARIcon, { stroke: "var(--primary)", icon: "ArrowLeft", size: 24 })),
|
|
255
298
|
React.createElement("span", { onClick: () => {
|
|
256
299
|
if (_month.current <= 0) {
|
|
257
300
|
_year.current -= 1;
|
|
@@ -261,7 +304,8 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
261
304
|
setSelectedYear(_year.current);
|
|
262
305
|
setSelectedMonth(_month.current);
|
|
263
306
|
setDateChanged((prev) => !prev);
|
|
264
|
-
} }
|
|
307
|
+
} },
|
|
308
|
+
React.createElement(ARIcon, { icon: "ArrowLeft", size: 24 }))),
|
|
265
309
|
React.createElement("div", { className: "selects" },
|
|
266
310
|
React.createElement("div", null,
|
|
267
311
|
React.createElement("span", null, months.find((month) => month.value === selectedMonth)?.text)),
|
|
@@ -277,28 +321,30 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
277
321
|
setSelectedYear(_year.current);
|
|
278
322
|
setSelectedMonth(_month.current);
|
|
279
323
|
setDateChanged((prev) => !prev);
|
|
280
|
-
} }
|
|
324
|
+
} },
|
|
325
|
+
React.createElement(ARIcon, { icon: "ArrowRight", size: 24 })),
|
|
281
326
|
React.createElement("span", { onClick: () => {
|
|
282
327
|
_year.current += 1;
|
|
283
328
|
setSelectedYear(_year.current);
|
|
284
329
|
setDateChanged((prev) => !prev);
|
|
285
|
-
} }
|
|
330
|
+
} },
|
|
331
|
+
React.createElement(ARIcon, { stroke: "var(--primary)", icon: "ArrowRight", size: 24 }))))),
|
|
286
332
|
React.createElement("div", { className: "content" }, !isNaN(_month.current) && !isNaN(_year.current) ? (React.createElement("div", { className: "calendar" },
|
|
287
333
|
React.createElement("div", { className: "weekdays" }, weekdays.map((weekday, index) => (React.createElement("span", { key: index }, weekday)))),
|
|
288
334
|
React.createElement("div", { className: "days" }, calendarDays))) : (React.createElement(Alert, { status: "warning" }, "Ay veya y\u0131l se\u00E7imi yapman\u0131z gerekmektedir."))),
|
|
289
|
-
React.createElement("div", { className: "footer" },
|
|
335
|
+
React.createElement("div", { ref: _calendarFooter, className: "footer" },
|
|
290
336
|
React.createElement("div", null,
|
|
291
337
|
React.createElement(Button, { variant: "borderless", onClick: () => setNowButton() }, "\u015Eimdi")),
|
|
292
338
|
React.createElement("div", null, !isClock && okayButton())),
|
|
293
|
-
React.createElement("div", {
|
|
294
|
-
React.createElement("div", { className: "header" },
|
|
339
|
+
isClock && (React.createElement("div", { ref: _arClock, className: "clock" },
|
|
340
|
+
React.createElement("div", { ref: _clockHeader, className: "header" },
|
|
295
341
|
_hours.current.toString().padStart(2, "0"),
|
|
296
342
|
" : ",
|
|
297
343
|
_minutes.current.toString().padStart(2, "0")),
|
|
298
344
|
React.createElement("div", { className: "content" },
|
|
299
345
|
React.createElement("ul", { ref: _hoursListElement }, hours),
|
|
300
346
|
React.createElement("ul", { ref: _minutesListElement }, minutes)),
|
|
301
|
-
|
|
347
|
+
React.createElement("div", { ref: _clockFooter, className: "footer" }, okayButton())))), document.body)));
|
|
302
348
|
};
|
|
303
349
|
DatePicker.displayName = "DatePicker";
|
|
304
350
|
export default DatePicker;
|
|
@@ -14,7 +14,6 @@ const Switch = ({ label, status = "primary", border = { radius: "pill" }, ...att
|
|
|
14
14
|
React.createElement("input", { type: "checkbox", ...attributes, checked: checked, size: 0, onChange: (event) => {
|
|
15
15
|
event.stopPropagation();
|
|
16
16
|
(() => {
|
|
17
|
-
console.log(event.target.checked);
|
|
18
17
|
setChecked(event.target.checked);
|
|
19
18
|
})();
|
|
20
19
|
(() => attributes.onChange && attributes.onChange(event))();
|
|
@@ -19,12 +19,22 @@ class Icon {
|
|
|
19
19
|
return (React.createElement(React.Fragment, null,
|
|
20
20
|
React.createElement("line", { fill: this._fill, stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", x1: "12", x2: "12", y1: "19", y2: "5" }),
|
|
21
21
|
React.createElement("line", { fill: this._fill, stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", x1: "5", x2: "19", y1: "12", y2: "12" })));
|
|
22
|
+
case "ArrowLeft":
|
|
23
|
+
return (React.createElement("path", { d: "M15 19.92L8.48 13.4c-.77-.77-.77-2.03 0-2.8L15 4.08", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
24
|
+
case "ArrowRight":
|
|
25
|
+
return (React.createElement("path", { d: "M8.91 19.92l6.52-6.52c.77-.77.77-2.03 0-2.8L8.91 4.08", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
22
26
|
case "CloseSquare":
|
|
23
27
|
return (React.createElement("path", { d: "m9.17 14.83 5.66-5.66M14.83 14.83 9.17 9.17M9 22h6c5 0 7-2 7-7V9c0-5-2-7-7-7H9C4 2 2 4 2 9v6c0 5 2 7 7 7Z", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
28
|
+
case "CloseCircle":
|
|
29
|
+
return (React.createElement("path", { d: "M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10ZM9.17 14.83l5.66-5.66M14.83 14.83 9.17 9.17", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }));
|
|
24
30
|
case "Import":
|
|
25
31
|
return (React.createElement(React.Fragment, null,
|
|
26
32
|
React.createElement("path", { d: "M3 15C3 17.8284 3 19.2426 3.87868 20.1213C4.75736 21 6.17157 21 9 21H15C17.8284 21 19.2426 21 20.1213 20.1213C21 19.2426 21 17.8284 21 15", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
27
33
|
React.createElement("path", { d: "M12 3V16M12 16L16 11.625M12 16L8 11.625", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
34
|
+
case "Document":
|
|
35
|
+
return (React.createElement(React.Fragment, null,
|
|
36
|
+
React.createElement("path", { d: "M22 10v5c0 5-2 7-7 7H9c-5 0-7-2-7-7V9c0-5 2-7 7-7h5", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
37
|
+
React.createElement("path", { d: "M22 10h-4c-3 0-4-1-4-4V2l8 8Z", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
28
38
|
case "Bold":
|
|
29
39
|
return (React.createElement(React.Fragment, null,
|
|
30
40
|
React.createElement("path", { d: "M6 4h8a4 4 0 0 1 0 8H6z", stroke: this._stroke, strokeWidth: Number(this._strokeWidth) + 1.5, strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -77,6 +87,10 @@ class Icon {
|
|
|
77
87
|
case "Filter":
|
|
78
88
|
return (React.createElement(React.Fragment, null,
|
|
79
89
|
React.createElement("path", { d: "M5.4 2.1h13.2c1.1 0 2 .9 2 2v2.2c0 .8-.5 1.8-1 2.3l-4.3 3.8c-.6.5-1 1.5-1 2.3V19c0 .6-.4 1.4-.9 1.7l-1.4.9c-1.3.8-3.1-.1-3.1-1.7v-5.3c0-.7-.4-1.6-.8-2.1l-3.8-4c-.5-.5-.9-1.4-.9-2V4.2c0-1.2.9-2.1 2-2.1ZM10.93 2.1 6 10", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
90
|
+
case "TickCircle":
|
|
91
|
+
return (React.createElement(React.Fragment, null,
|
|
92
|
+
React.createElement("path", { d: "M12 22c5.5 0 10-4.5 10-10S17.5 2 12 2 2 6.5 2 12s4.5 10 10 10Z", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
93
|
+
React.createElement("path", { d: "m7.75 12 2.83 2.83 5.67-5.66", stroke: this._stroke, strokeWidth: this._strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })));
|
|
80
94
|
default:
|
|
81
95
|
return null;
|
|
82
96
|
}
|
|
@@ -35,7 +35,7 @@ class Api {
|
|
|
35
35
|
async PostWithFormData(values) {
|
|
36
36
|
const response = await this.CustomFetch(`${this._url}${values.input}`, {
|
|
37
37
|
method: "POST",
|
|
38
|
-
headers: { ...values.headers },
|
|
38
|
+
headers: { ...this.HeaderProperties(), ...values.headers },
|
|
39
39
|
body: values.data,
|
|
40
40
|
...values.init,
|
|
41
41
|
});
|
|
@@ -66,7 +66,7 @@ export type Errors<TData> = Partial<{
|
|
|
66
66
|
}>;
|
|
67
67
|
export type AllowedTypes = "image/jpeg" | "image/png" | "image/gif" | "image/webp" | "image/svg+xml" | "image/bmp" | "image/tiff" | "application/pdf" | "application/msword" | "application/vnd.openxmlformats-officedocument.wordprocessingml.document" | "application/vnd.ms-excel" | "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" | "application/vnd.openxmlformats-officedocument.presentationml.presentation" | "application/zip" | "application/x-rar-compressed" | "application/x-7z-compressed" | "application/gzip" | "application/json" | "application/xml" | "text/plain" | "text/csv" | "text/html" | "video/mp4" | "video/quicktime" | "video/x-msvideo" | "video/x-matroska" | "video/webm" | "video/x-flv" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "audio/aac" | "audio/flac" | "application/octet-stream";
|
|
68
68
|
export type IconVariants = "linear" | "bulk";
|
|
69
|
-
export type Icons = "Add" | "CloseSquare" | "Drive" | "Folder" | "Trash" | "Upload" | "Image" | "Import" | "Bold" | "Italic" | "Underline" | "Strikethrough" | "BulletList" | "NumberList" | "TextAlingLeft" | "TextAlingCenter" | "TextAlingRight" | "Filter";
|
|
69
|
+
export type Icons = "Add" | "ArrowLeft" | "ArrowRight" | "CloseCircle" | "CloseSquare" | "Drive" | "Document" | "Folder" | "Trash" | "Upload" | "Image" | "Import" | "Bold" | "Italic" | "Underline" | "Strikethrough" | "BulletList" | "NumberList" | "TextAlingLeft" | "TextAlingCenter" | "TextAlingRight" | "Filter" | "TickCircle" | "File";
|
|
70
70
|
export type PieChartDataType = {
|
|
71
71
|
value: number;
|
|
72
72
|
text: string;
|