ar-design 0.1.93 → 0.1.95
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/feedback/popover/styles.css +3 -0
- package/dist/assets/css/components/form/date-picker/calendar/calendar.css +5 -1
- package/dist/assets/css/components/form/date-picker/calendar/header.css +32 -50
- 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 +4 -0
- package/dist/components/{layout → data-display}/grid-system/index.d.ts +1 -1
- package/dist/components/{layout → data-display}/grid-system/index.js +1 -1
- package/dist/components/data-display/table/index.js +5 -6
- package/dist/components/data-display/typography/paragraph/Paragraph.js +1 -1
- package/dist/components/feedback/modal/index.js +6 -1
- package/dist/components/feedback/popover/index.js +2 -0
- package/dist/components/form/date-picker/DATE.js +1 -1
- package/dist/components/form/date-picker/index.js +67 -24
- package/dist/components/form/select/index.js +2 -0
- package/dist/components/form/switch/index.js +0 -1
- package/dist/components/icons/Compiler.js +14 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/libs/core/service/Api.js +1 -1
- package/dist/libs/types/index.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/assets/css/components/{layout → data-display}/grid-system/column/large.css +0 -0
- /package/dist/assets/css/components/{layout → data-display}/grid-system/column/medium.css +0 -0
- /package/dist/assets/css/components/{layout → data-display}/grid-system/column/small.css +0 -0
- /package/dist/assets/css/components/{layout → data-display}/grid-system/column/x-large.css +0 -0
- /package/dist/assets/css/components/{layout → data-display}/grid-system/column/x-small.css +0 -0
- /package/dist/assets/css/components/{layout → data-display}/grid-system/row/styles.css +0 -0
- /package/dist/assets/css/components/{layout/grid-system/grid-system.css → data-display/grid-system/styles.css} +0 -0
- /package/dist/components/{layout → data-display}/grid-system/box/Box.d.ts +0 -0
- /package/dist/components/{layout → data-display}/grid-system/box/Box.js +0 -0
- /package/dist/components/{layout → data-display}/grid-system/column/Column.d.ts +0 -0
- /package/dist/components/{layout → data-display}/grid-system/column/Column.js +0 -0
- /package/dist/components/{layout → data-display}/grid-system/column/IProps.d.ts +0 -0
- /package/dist/components/{layout → data-display}/grid-system/column/IProps.js +0 -0
- /package/dist/components/{layout → data-display}/grid-system/row/Row.d.ts +0 -0
- /package/dist/components/{layout → data-display}/grid-system/row/Row.js +0 -0
- /package/dist/components/{layout → data-display}/grid-system/row/Types.d.ts +0 -0
- /package/dist/components/{layout → data-display}/grid-system/row/Types.js +0 -0
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
.ar-popover {
|
|
7
|
+
visibility: hidden;
|
|
8
|
+
opacity: 0;
|
|
7
9
|
position: absolute;
|
|
8
10
|
display: flex;
|
|
9
11
|
flex-direction: column;
|
|
@@ -14,6 +16,7 @@
|
|
|
14
16
|
border-radius: var(--border-radius-sm);
|
|
15
17
|
box-shadow: 0 0 15px -2.5px rgba(var(--black-rgb), 0.1);
|
|
16
18
|
z-index: 1051;
|
|
19
|
+
transition: visibility 250ms, opacity 250ms;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
.ar-popover > .content {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
.ar-date-calendar {
|
|
2
|
+
visibility: hidden;
|
|
3
|
+
opacity: 0;
|
|
2
4
|
position: absolute;
|
|
5
|
+
top: 0;
|
|
6
|
+
left: 0;
|
|
3
7
|
background-color: var(--white);
|
|
4
8
|
width: 20rem;
|
|
5
9
|
border: solid 1px var(--gray-200);
|
|
6
|
-
border-radius: var(--border-radius-
|
|
10
|
+
border-radius: var(--border-radius-sm);
|
|
7
11
|
box-shadow: 0 0 10px -5px rgba(var(--black-rgb), 0.25);
|
|
8
12
|
z-index: 1051;
|
|
9
13
|
transition: visibility 250ms, opacity 250ms ease-in-out;
|
|
@@ -25,80 +25,62 @@
|
|
|
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
|
|
|
32
32
|
/* #region Prev and Next Buttons */
|
|
33
|
-
.ar-date-calendar > .header > .select-field > .prev,
|
|
34
|
-
.ar-date-calendar > .header > .select-field > .next {
|
|
35
|
-
user-select: none;
|
|
36
|
-
}
|
|
37
33
|
.ar-date-calendar > .header > .select-field > .prev > span,
|
|
38
34
|
.ar-date-calendar > .header > .select-field > .next > span {
|
|
39
|
-
|
|
40
|
-
top: 50%;
|
|
41
|
-
transform: translateY(-50%);
|
|
42
|
-
left: 0;
|
|
35
|
+
display: inline-block;
|
|
43
36
|
width: 1rem;
|
|
44
37
|
height: 1rem;
|
|
38
|
+
border: solid 2px transparent;
|
|
39
|
+
transform: rotate(45deg);
|
|
40
|
+
user-select: none;
|
|
45
41
|
cursor: pointer;
|
|
46
42
|
}
|
|
47
|
-
.ar-date-calendar > .header > .select-field > .
|
|
48
|
-
|
|
49
|
-
|
|
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;
|
|
43
|
+
.ar-date-calendar > .header > .select-field > .prev > span::before,
|
|
44
|
+
.ar-date-calendar > .header > .select-field > .next > span::before {
|
|
45
|
+
border: solid 2px transparent;
|
|
56
46
|
}
|
|
57
|
-
|
|
58
|
-
.ar-date-calendar > .header > .select-field > .prev > span:first-child
|
|
59
|
-
position:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
height: 100%;
|
|
63
|
-
border-top: solid 2px var(--gray-600);
|
|
64
|
-
border-left: solid 2px var(--gray-600);
|
|
65
|
-
transform: rotate(-45deg);
|
|
47
|
+
|
|
48
|
+
.ar-date-calendar > .header > .select-field > .prev > span:first-child {
|
|
49
|
+
position: relative;
|
|
50
|
+
border-left-color: var(--primary);
|
|
51
|
+
border-bottom-color: var(--primary);
|
|
66
52
|
}
|
|
67
|
-
.ar-date-calendar > .header > .select-field > .
|
|
68
|
-
.ar-date-calendar > .header > .select-field > .next > span:last-child::after {
|
|
53
|
+
.ar-date-calendar > .header > .select-field > .prev > span:first-child::before {
|
|
69
54
|
position: absolute;
|
|
70
55
|
content: "";
|
|
71
56
|
width: 100%;
|
|
72
57
|
height: 100%;
|
|
73
|
-
border-
|
|
74
|
-
border-
|
|
75
|
-
transform: rotate(135deg);
|
|
58
|
+
border-left-color: rgba(var(--primary-rgb), 0.25);
|
|
59
|
+
border-bottom-color: rgba(var(--primary-rgb), 0.25);
|
|
76
60
|
}
|
|
77
|
-
.ar-date-calendar > .header > .select-field > .prev > span:
|
|
78
|
-
left:
|
|
79
|
-
|
|
61
|
+
.ar-date-calendar > .header > .select-field > .prev > span:last-child {
|
|
62
|
+
border-left-color: var(--gray-500);
|
|
63
|
+
border-bottom-color: var(--gray-500);
|
|
64
|
+
margin-left: 0.3rem;
|
|
80
65
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
|
|
67
|
+
.ar-date-calendar > .header > .select-field > .next > span:first-child {
|
|
68
|
+
border-top-color: var(--gray-500);
|
|
69
|
+
border-right-color: var(--gray-500);
|
|
70
|
+
margin-right: 0.3rem;
|
|
84
71
|
}
|
|
85
|
-
.ar-date-calendar > .header > .select-field > .
|
|
86
|
-
position:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
height: 100%;
|
|
90
|
-
border-top: solid 2px var(--gray-600);
|
|
91
|
-
border-left: solid 2px var(--gray-600);
|
|
92
|
-
transform: rotate(-45deg);
|
|
72
|
+
.ar-date-calendar > .header > .select-field > .next > span:last-child {
|
|
73
|
+
position: relative;
|
|
74
|
+
border-top-color: var(--primary);
|
|
75
|
+
border-right-color: var(--primary);
|
|
93
76
|
}
|
|
94
|
-
.ar-date-calendar > .header > .select-field > .next > span:
|
|
77
|
+
.ar-date-calendar > .header > .select-field > .next > span:last-child::before {
|
|
95
78
|
position: absolute;
|
|
96
79
|
content: "";
|
|
97
80
|
width: 100%;
|
|
98
81
|
height: 100%;
|
|
99
|
-
border-top:
|
|
100
|
-
border-
|
|
101
|
-
transform: rotate(135deg);
|
|
82
|
+
border-top-color: rgba(var(--primary-rgb), 0.25);
|
|
83
|
+
border-right-color: rgba(var(--primary-rgb), 0.25);
|
|
102
84
|
}
|
|
103
85
|
/* #endregion Prev and Next Buttons */
|
|
104
86
|
/* 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
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
.ar-select-options {
|
|
2
|
+
visibility: hidden;
|
|
3
|
+
opacity: 0;
|
|
2
4
|
position: absolute;
|
|
5
|
+
top: 0;
|
|
3
6
|
background-color: var(--white);
|
|
7
|
+
border: solid 1px var(--gray-200);
|
|
4
8
|
border-radius: var(--border-radius-sm);
|
|
5
9
|
box-shadow: 0 0 15px -2.5px rgba(var(--black-rgb), 0.1);
|
|
6
10
|
overflow: hidden;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Box from "./box/Box";
|
|
2
2
|
import Row from "./row/Row";
|
|
3
3
|
import Column from "./column/Column";
|
|
4
|
-
import "../../../assets/css/components/
|
|
4
|
+
import "../../../assets/css/components/data-display/grid-system/styles.css";
|
|
5
5
|
// @@Export
|
|
6
6
|
const Grid = {
|
|
7
7
|
Box,
|
|
@@ -237,7 +237,6 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
237
237
|
}
|
|
238
238
|
setSelectAll(allChecked);
|
|
239
239
|
}, [currentPage]);
|
|
240
|
-
console.log(searchedText);
|
|
241
240
|
return (React.createElement("div", { ref: _tableWrapper, className: _tableClassName.map((c) => c).join(" ") },
|
|
242
241
|
(title || description || actions || React.Children.count(children) > 0) && (React.createElement("div", { className: "header" },
|
|
243
242
|
React.createElement("div", { className: "title" },
|
|
@@ -274,7 +273,7 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
274
273
|
if (c.config?.alignContent) {
|
|
275
274
|
_className.push(`align-content-${c.config.alignContent}`);
|
|
276
275
|
}
|
|
277
|
-
return (React.createElement("th", { key: `column-${cIndex}`, ...(_className.length > 0 && {
|
|
276
|
+
return (React.createElement("th", { key: `column-${cIndex}-${Math.random()}`, ...(_className.length > 0 && {
|
|
278
277
|
className: `${_className.map((c) => c).join(" ")}`,
|
|
279
278
|
}), ...(c.config?.width && {
|
|
280
279
|
style: { minWidth: c.config.width },
|
|
@@ -305,10 +304,10 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
305
304
|
// .filter((x) =>
|
|
306
305
|
// x.text.toLocaleLowerCase().includes(searchedFilters?.toLocaleLowerCase() ?? "")
|
|
307
306
|
// )
|
|
308
|
-
.map((filter,
|
|
307
|
+
.map((filter, fIndex) => {
|
|
309
308
|
const name = typeof c.key !== "object" ? String(c.key) : String(c.key.field);
|
|
310
|
-
return (React.createElement("li", { key:
|
|
311
|
-
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
|
|
312
311
|
? _searchedParams?.[name]?.includes(filter.text)
|
|
313
312
|
: searchedText?.[name]?.includes(filter.text), onChange: handleChecboxFilter })));
|
|
314
313
|
}))) },
|
|
@@ -324,7 +323,7 @@ const TableWithRef = forwardRef(({ children, title, description, data, columns,
|
|
|
324
323
|
} })),
|
|
325
324
|
React.createElement(Button, { variant: "borderless", icon: { element: React.createElement(ARIcon, { icon: "Filter", stroke: "var(--primary)", size: 16 }) } }))))));
|
|
326
325
|
})))),
|
|
327
|
-
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()}` },
|
|
328
327
|
selections && (React.createElement("td", { key: `selection-${index}`, className: "sticky-left", "data-sticky-position": "left" },
|
|
329
328
|
React.createElement(Checkbox, { ref: (element) => (_checkboxItems.current[index] = element), status: "primary", checked: selectionItems.some((selectionItem) => JSON.stringify(selectionItem) === JSON.stringify(item)), onChange: (event) => {
|
|
330
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) {
|
|
@@ -31,6 +31,8 @@ const Popover = ({ children, title, message, content, onConfirm, windowBlur, con
|
|
|
31
31
|
const screenCenter = window.innerHeight / 2;
|
|
32
32
|
const sx = window.scrollX || document.documentElement.scrollLeft;
|
|
33
33
|
const sy = window.scrollY || document.documentElement.scrollTop;
|
|
34
|
+
_arPopover.current.style.visibility = "visible";
|
|
35
|
+
_arPopover.current.style.opacity = "1";
|
|
34
36
|
_arPopover.current.style.top = `${(elementRect.top > screenCenter
|
|
35
37
|
? elementRect.top - popoverRect.height + elementRect.height
|
|
36
38
|
: elementRect.top) + sy}px`;
|
|
@@ -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,
|
|
@@ -24,6 +24,11 @@ const months = [
|
|
|
24
24
|
const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
25
25
|
// refs
|
|
26
26
|
const _arCalendar = useRef(null);
|
|
27
|
+
const _arClock = useRef(null);
|
|
28
|
+
const _calendarHeader = useRef(null);
|
|
29
|
+
const _calendarFooter = useRef(null);
|
|
30
|
+
const _clockHeader = useRef(null);
|
|
31
|
+
const _clockFooter = useRef(null);
|
|
27
32
|
const _currentDate = useRef(new Date()).current;
|
|
28
33
|
const _beginDate = useRef(null);
|
|
29
34
|
// refs -> Geçerli Tarih ve Saat Bilgileri.
|
|
@@ -54,13 +59,17 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
54
59
|
// methods
|
|
55
60
|
const handleClickOutSide = (event) => {
|
|
56
61
|
const target = event.target;
|
|
62
|
+
if (target === _beginDate.current)
|
|
63
|
+
return;
|
|
57
64
|
if (_arCalendar.current && !_arCalendar.current.contains(target))
|
|
58
65
|
closeCalendar();
|
|
59
66
|
};
|
|
60
67
|
const handleKeys = (event) => {
|
|
61
68
|
const key = event.key;
|
|
62
|
-
if (key === "Escape")
|
|
69
|
+
if (key === "Escape") {
|
|
70
|
+
event.stopPropagation();
|
|
63
71
|
closeCalendar();
|
|
72
|
+
}
|
|
64
73
|
};
|
|
65
74
|
const handlePosition = () => {
|
|
66
75
|
if (_arCalendar.current && _beginDate.current) {
|
|
@@ -71,12 +80,38 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
71
80
|
const screenCenterY = window.innerHeight / 2;
|
|
72
81
|
const sx = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
73
82
|
const sy = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
|
|
83
|
+
_arCalendar.current.style.visibility = "visible";
|
|
84
|
+
_arCalendar.current.style.opacity = "1";
|
|
74
85
|
_arCalendar.current.style.top = `${(InpuRect.top > screenCenterY ? InpuRect.top - arCalendarRect.height : InpuRect.top + InpuRect.height) + sy}px`;
|
|
75
86
|
_arCalendar.current.style.left = `${(InpuRect.left > screenCenterX ? InpuRect.right - arCalendarRect.width : InpuRect.left) + sx}px`;
|
|
76
87
|
}
|
|
77
88
|
}
|
|
78
89
|
};
|
|
79
|
-
|
|
90
|
+
const handleHeight = () => {
|
|
91
|
+
if (_arCalendar.current && _arClock.current) {
|
|
92
|
+
const calendar = _arCalendar.current?.getBoundingClientRect()?.height;
|
|
93
|
+
_arClock.current.style.maxHeight = `${calendar}px`;
|
|
94
|
+
}
|
|
95
|
+
if (_calendarHeader.current && _clockHeader.current) {
|
|
96
|
+
const calendarHeaderH = _calendarHeader.current?.getBoundingClientRect()?.height;
|
|
97
|
+
_clockHeader.current.style.minHeight = `${calendarHeaderH}px`;
|
|
98
|
+
}
|
|
99
|
+
if (_calendarFooter && _clockFooter.current) {
|
|
100
|
+
const calendarFooterH = _calendarFooter.current?.getBoundingClientRect()?.height;
|
|
101
|
+
_clockFooter.current.style.minHeight = `${calendarFooterH}px`;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
const handleOk = (isShutdownOn = true) => {
|
|
105
|
+
// Stateler güncelleniyor...
|
|
106
|
+
setSelectedYear(_year.current);
|
|
107
|
+
setSelectedMonth(_month.current);
|
|
108
|
+
setSelectedDay(_day.current);
|
|
109
|
+
setSelectedHours(_hours.current);
|
|
110
|
+
setSelectedMinutes(_minutes.current);
|
|
111
|
+
const inputDate = new Date(Date.UTC(_year.current, _month.current, _day.current, !isClock ? 0 : _hours.current, !isClock ? 0 : _minutes.current, 0));
|
|
112
|
+
onChange(inputDate.toISOString());
|
|
113
|
+
isShutdownOn && setCalendarIsOpen(false);
|
|
114
|
+
};
|
|
80
115
|
const setNowButton = () => {
|
|
81
116
|
const now = new Date();
|
|
82
117
|
// Stateler güncelleniyor...
|
|
@@ -96,19 +131,8 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
96
131
|
const inputDate = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), !isClock ? 0 : now.getHours(), !isClock ? 0 : now.getMinutes(), 0));
|
|
97
132
|
onChange(inputDate.toISOString());
|
|
98
133
|
};
|
|
99
|
-
// Tamam Butonu
|
|
100
134
|
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"));
|
|
135
|
+
return (React.createElement(Button, { variant: "borderless", status: "success", onClick: () => handleOk() }, "Tamam"));
|
|
112
136
|
};
|
|
113
137
|
const closeCalendar = () => {
|
|
114
138
|
const { year, month, day, hours, minutes } = DATE.Parse(String(attributes.value), isClock);
|
|
@@ -122,7 +146,10 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
122
146
|
// useEffects
|
|
123
147
|
useEffect(() => {
|
|
124
148
|
if (calendarIsOpen) {
|
|
125
|
-
setTimeout(() =>
|
|
149
|
+
setTimeout(() => {
|
|
150
|
+
handleHeight();
|
|
151
|
+
handlePosition();
|
|
152
|
+
}, 0);
|
|
126
153
|
const days = [];
|
|
127
154
|
const firstDayOfMonth = new Date(_year.current, _month.current, 1);
|
|
128
155
|
const lastDayOfMonth = new Date(_year.current, _month.current + 1, 0);
|
|
@@ -144,6 +171,7 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
144
171
|
_day.current = i;
|
|
145
172
|
setSelectedDay(i);
|
|
146
173
|
setDateChanged(!dateChanged);
|
|
174
|
+
handleOk(false);
|
|
147
175
|
} },
|
|
148
176
|
React.createElement("span", null, i)));
|
|
149
177
|
}
|
|
@@ -151,12 +179,12 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
151
179
|
days.push(React.createElement("span", { key: `next-${i}`, className: "empty-day" }));
|
|
152
180
|
}
|
|
153
181
|
setCalendarDays(days);
|
|
154
|
-
window.addEventListener("blur", () => closeCalendar());
|
|
182
|
+
// window.addEventListener("blur", () => closeCalendar());
|
|
155
183
|
document.addEventListener("click", handleClickOutSide);
|
|
156
184
|
document.addEventListener("keydown", handleKeys);
|
|
157
185
|
}
|
|
158
186
|
return () => {
|
|
159
|
-
window.removeEventListener("blur", () => closeCalendar());
|
|
187
|
+
// window.removeEventListener("blur", () => closeCalendar());
|
|
160
188
|
document.removeEventListener("click", handleClickOutSide);
|
|
161
189
|
document.removeEventListener("keydown", handleKeys);
|
|
162
190
|
};
|
|
@@ -174,6 +202,7 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
174
202
|
_minutes.current = i;
|
|
175
203
|
setSelectedMinutes(i);
|
|
176
204
|
}
|
|
205
|
+
handleOk(false);
|
|
177
206
|
} },
|
|
178
207
|
React.createElement("span", null,
|
|
179
208
|
React.createElement("span", null, i.toString().padStart(2, "0"))))));
|
|
@@ -184,6 +213,8 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
184
213
|
generateList(60, _minutes.current, setMinutes);
|
|
185
214
|
if (!isClock)
|
|
186
215
|
return;
|
|
216
|
+
if (calendarIsOpen)
|
|
217
|
+
handleHeight();
|
|
187
218
|
// Seçim sonrasında en yukarı getirme işlemi için aşağıda yer alan kodlar yazılmıştır
|
|
188
219
|
const hourLiElement = _hoursLiElements.current[_hours.current];
|
|
189
220
|
const minuteLiElement = _minutesLiElements.current[_minutes.current];
|
|
@@ -213,16 +244,23 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
213
244
|
years.push({ value: i, text: `${i}` });
|
|
214
245
|
}
|
|
215
246
|
setYears(years);
|
|
216
|
-
}, []);
|
|
247
|
+
}, [selectedYear]);
|
|
217
248
|
return (React.createElement("div", { className: "ar-date-picker" },
|
|
218
249
|
attributes.placeholder && attributes.placeholder.length > 0 && (React.createElement("label", null,
|
|
219
250
|
validation ? "* " : "",
|
|
220
251
|
attributes.placeholder)),
|
|
221
|
-
React.createElement(Input, { ref: _beginDate, value: DATE.ParseValue(String(attributes.value), isClock), type: isClock ? "datetime-local" : "date", onKeyDown: (event) =>
|
|
252
|
+
React.createElement(Input, { ref: _beginDate, value: DATE.ParseValue(String(attributes.value), isClock), type: isClock ? "datetime-local" : "date", onKeyDown: (event) => {
|
|
253
|
+
if (event.code === "Space")
|
|
254
|
+
event.preventDefault();
|
|
255
|
+
else if (event.code === "Enter")
|
|
256
|
+
handleOk();
|
|
257
|
+
}, onChange: (event) => {
|
|
222
258
|
// Disabled gelmesi durumunda işlem yapmasına izin verme...
|
|
223
259
|
if (attributes.disabled)
|
|
224
260
|
return;
|
|
225
261
|
(() => {
|
|
262
|
+
if (!calendarIsOpen)
|
|
263
|
+
setCalendarIsOpen(true);
|
|
226
264
|
const value = event.target.value;
|
|
227
265
|
const [date, time] = value.split("T");
|
|
228
266
|
const [year, month, day] = date.split("-").map(Number);
|
|
@@ -235,8 +273,13 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
235
273
|
_hours.current = hours;
|
|
236
274
|
_minutes.current = minutes;
|
|
237
275
|
}
|
|
276
|
+
// Yıl ve Ay'ı anlık yeniler.
|
|
277
|
+
setSelectedYear(_year.current);
|
|
278
|
+
setSelectedMonth(_month.current);
|
|
279
|
+
// Takvimi anlık yeniler.
|
|
238
280
|
setDateChanged((prev) => !prev);
|
|
239
281
|
setTimeChanged((prev) => !prev);
|
|
282
|
+
onChange(value);
|
|
240
283
|
})();
|
|
241
284
|
}, onClick: (event) => {
|
|
242
285
|
event.preventDefault();
|
|
@@ -244,7 +287,7 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
244
287
|
}, autoComplete: "off", validation: validation }),
|
|
245
288
|
calendarIsOpen &&
|
|
246
289
|
ReactDOM.createPortal(React.createElement("div", { ref: _arCalendar, className: "ar-date-calendar" },
|
|
247
|
-
React.createElement("div", { className: "header" },
|
|
290
|
+
React.createElement("div", { ref: _calendarHeader, className: "header" },
|
|
248
291
|
React.createElement("div", { className: "select-field" },
|
|
249
292
|
React.createElement("div", { className: "prev" },
|
|
250
293
|
React.createElement("span", { onClick: () => {
|
|
@@ -286,19 +329,19 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
286
329
|
React.createElement("div", { className: "content" }, !isNaN(_month.current) && !isNaN(_year.current) ? (React.createElement("div", { className: "calendar" },
|
|
287
330
|
React.createElement("div", { className: "weekdays" }, weekdays.map((weekday, index) => (React.createElement("span", { key: index }, weekday)))),
|
|
288
331
|
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" },
|
|
332
|
+
React.createElement("div", { ref: _calendarFooter, className: "footer" },
|
|
290
333
|
React.createElement("div", null,
|
|
291
334
|
React.createElement(Button, { variant: "borderless", onClick: () => setNowButton() }, "\u015Eimdi")),
|
|
292
335
|
React.createElement("div", null, !isClock && okayButton())),
|
|
293
|
-
React.createElement("div", {
|
|
294
|
-
React.createElement("div", { className: "header" },
|
|
336
|
+
isClock && (React.createElement("div", { ref: _arClock, className: "clock" },
|
|
337
|
+
React.createElement("div", { ref: _clockHeader, className: "header" },
|
|
295
338
|
_hours.current.toString().padStart(2, "0"),
|
|
296
339
|
" : ",
|
|
297
340
|
_minutes.current.toString().padStart(2, "0")),
|
|
298
341
|
React.createElement("div", { className: "content" },
|
|
299
342
|
React.createElement("ul", { ref: _hoursListElement }, hours),
|
|
300
343
|
React.createElement("ul", { ref: _minutesListElement }, minutes)),
|
|
301
|
-
|
|
344
|
+
React.createElement("div", { ref: _clockFooter, className: "footer" }, okayButton())))), document.body)));
|
|
302
345
|
};
|
|
303
346
|
DatePicker.displayName = "DatePicker";
|
|
304
347
|
export default DatePicker;
|
|
@@ -74,6 +74,8 @@ const Select = ({ variant = "outlined", status, border = { radius: "sm" }, optio
|
|
|
74
74
|
const screenCenter = window.innerHeight / 2;
|
|
75
75
|
const sx = window.scrollX || document.documentElement.scrollLeft || document.body.scrollLeft;
|
|
76
76
|
const sy = window.scrollY || document.documentElement.scrollTop || document.body.scrollTop;
|
|
77
|
+
_options.current.style.visibility = "visible";
|
|
78
|
+
_options.current.style.opacity = "1";
|
|
77
79
|
_options.current.style.top = `${(InpuRect.top > screenCenter
|
|
78
80
|
? InpuRect.top - optionRect.height - (multiple ? 20 : 0)
|
|
79
81
|
: InpuRect.top + InpuRect.height) + sy}px`;
|
|
@@ -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
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,6 @@ import Tooltip from "./components/feedback/tooltip";
|
|
|
28
28
|
import Breadcrumb from "./components/navigation/breadcrumb";
|
|
29
29
|
import Menu from "./components/navigation/menu";
|
|
30
30
|
import Steps from "./components/navigation/steps";
|
|
31
|
-
import Grid from "./components/
|
|
31
|
+
import Grid from "./components/data-display/grid-system";
|
|
32
32
|
import Layout from "./components/layout";
|
|
33
33
|
export { Button, ButtonAction, ButtonGroup, Checkbox, DatePicker, Input, InputTag, Radio, Select, Switch, TextEditor, Upload, Card, Chip, Divider, DnD, Paper, SyntaxHighlighter, Table, Tabs, Typography, Alert, Modal, Popover, Progress, Tooltip, Breadcrumb, Menu, Steps, Grid, Layout, };
|
package/dist/index.js
CHANGED
|
@@ -33,7 +33,7 @@ import Breadcrumb from "./components/navigation/breadcrumb";
|
|
|
33
33
|
import Menu from "./components/navigation/menu";
|
|
34
34
|
import Steps from "./components/navigation/steps";
|
|
35
35
|
// Layout
|
|
36
|
-
import Grid from "./components/
|
|
36
|
+
import Grid from "./components/data-display/grid-system";
|
|
37
37
|
import Layout from "./components/layout";
|
|
38
38
|
export {
|
|
39
39
|
// Form Elements
|
|
@@ -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;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|