ar-design 0.2.87 → 0.2.89
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/table/styles.css +3 -3
- package/dist/assets/css/components/data-display/tabs/tabs.css +1 -1
- package/dist/assets/css/components/form/input/core/addon.css +1 -1
- package/dist/assets/css/components/form/input/input.css +1 -1
- package/dist/assets/css/components/form/select/styles.css +1 -1
- package/dist/assets/css/components/form/text-editor/styles.css +1 -1
- package/dist/assets/css/components/navigation/pagination/pagination.css +2 -7
- package/dist/assets/css/core/variants/outlined.css +2 -2
- package/dist/components/data-display/table/index.js +1 -1
- package/dist/components/feedback/tooltip/index.js +42 -47
- package/dist/components/form/button-action/IProps.d.ts +2 -0
- package/dist/components/form/button-action/index.js +2 -2
- package/dist/components/form/date-picker/index.js +1 -1
- package/package.json +1 -1
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
flex-direction: column;
|
|
24
24
|
row-gap: 0.5rem;
|
|
25
25
|
}
|
|
26
|
-
.ar-table > .header > .title >
|
|
26
|
+
.ar-table > .header > .title > h4 {
|
|
27
27
|
color: var(--gray-700);
|
|
28
|
-
/* -webkit-text-stroke: 0.25px var(--gray-700); */
|
|
29
28
|
}
|
|
30
29
|
.ar-table > .header > .title > h5 {
|
|
31
|
-
color: var(--gray-
|
|
30
|
+
color: var(--gray-400);
|
|
31
|
+
font-weight: normal !important;
|
|
32
32
|
}
|
|
33
33
|
.ar-table > .header > .actions {
|
|
34
34
|
display: flex;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
.ar-pagination {
|
|
2
|
-
}
|
|
3
1
|
.ar-pagination > ul {
|
|
4
2
|
display: flex;
|
|
5
3
|
flex-direction: row;
|
|
@@ -17,7 +15,7 @@
|
|
|
17
15
|
box-shadow: 0 0 0 0 rgba(var(--primary-rgb), 0.1);
|
|
18
16
|
transform: scale(1);
|
|
19
17
|
color: var(--gray-700);
|
|
20
|
-
font-weight:
|
|
18
|
+
font-weight: 400;
|
|
21
19
|
cursor: pointer;
|
|
22
20
|
user-select: none;
|
|
23
21
|
}
|
|
@@ -45,10 +43,7 @@
|
|
|
45
43
|
.ar-pagination > ul > li:is(:nth-last-child(2)) {
|
|
46
44
|
margin-left: 1rem;
|
|
47
45
|
}
|
|
48
|
-
.ar-pagination
|
|
49
|
-
> ul
|
|
50
|
-
> li:is(:nth-child(1), :nth-child(2), :nth-last-child(1), :nth-last-child(2))
|
|
51
|
-
> span {
|
|
46
|
+
.ar-pagination > ul > li:is(:nth-child(1), :nth-child(2), :nth-last-child(1), :nth-last-child(2)) > span {
|
|
52
47
|
position: relative;
|
|
53
48
|
top: -2px;
|
|
54
49
|
font-size: 1.5rem;
|
|
@@ -493,7 +493,7 @@ const Table = forwardRef(({ children, title, description, data, columns, actions
|
|
|
493
493
|
return (React.createElement("div", { ref: _tableWrapper, className: _tableClassName.map((c) => c).join(" ") },
|
|
494
494
|
(title || description || actions || React.Children.count(children) > 0) && (React.createElement("div", { className: "header" },
|
|
495
495
|
React.createElement("div", { className: "title" },
|
|
496
|
-
React.createElement("
|
|
496
|
+
React.createElement("h4", null, title),
|
|
497
497
|
description && React.createElement("h5", null, description)),
|
|
498
498
|
React.createElement("div", { className: "actions" }, actions && (React.createElement(React.Fragment, null,
|
|
499
499
|
actions.import && (React.createElement(Popover, { title: "\u0130\u00E7eri Aktar", message: "Se\u00E7ti\u011Finiz dosyalar\u0131 uygulamaya y\u00FCkleyebilirsiniz. Bu i\u015Flem, dosyalardaki verileri sistemimize aktar\u0131r ve verilerle i\u015Flem yapman\u0131za olanak tan\u0131r.", content: React.createElement(React.Fragment, null,
|
|
@@ -8,56 +8,51 @@ const Tooltip = ({ children, text, direction = "top" }) => {
|
|
|
8
8
|
const _children = useRef(null);
|
|
9
9
|
// states
|
|
10
10
|
const [mouseEnter, setMouseEnter] = useState(false);
|
|
11
|
+
const [_direction, setDirection] = useState(direction);
|
|
11
12
|
// methods
|
|
12
13
|
const handlePosition = useCallback(() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let top = 0;
|
|
28
|
-
let left = 0;
|
|
29
|
-
switch (direction) {
|
|
30
|
-
case "top":
|
|
31
|
-
{
|
|
32
|
-
top = childRect.top - tooltipRect.height - margin;
|
|
33
|
-
left = childRect.left + childRect.width / 2 - tooltipRect.width / 2;
|
|
34
|
-
setTooltipPosition(top, left);
|
|
35
|
-
}
|
|
36
|
-
break;
|
|
37
|
-
case "right":
|
|
38
|
-
{
|
|
39
|
-
top = childRect.top + childRect.height / 2 - tooltipRect.height / 2;
|
|
40
|
-
left = childRect.right + margin;
|
|
41
|
-
setTooltipPosition(top, left);
|
|
42
|
-
}
|
|
43
|
-
break;
|
|
44
|
-
case "bottom":
|
|
45
|
-
{
|
|
46
|
-
top = childRect.bottom + margin;
|
|
47
|
-
left = childRect.left + childRect.width / 2 - tooltipRect.width / 2;
|
|
48
|
-
setTooltipPosition(top, left);
|
|
49
|
-
}
|
|
50
|
-
break;
|
|
51
|
-
case "left":
|
|
52
|
-
{
|
|
53
|
-
top = childRect.top + childRect.height / 2 - tooltipRect.height / 2;
|
|
54
|
-
left = childRect.left - tooltipRect.width - margin;
|
|
55
|
-
setTooltipPosition(top, left);
|
|
56
|
-
}
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
14
|
+
const child = _children.current;
|
|
15
|
+
const tooltip = _arTooltip.current;
|
|
16
|
+
if (!child || !tooltip)
|
|
17
|
+
return;
|
|
18
|
+
const margin = 17.5;
|
|
19
|
+
const windowWidth = window.innerWidth;
|
|
20
|
+
const screenCenterX = windowWidth / 2;
|
|
21
|
+
const childRect = child.getBoundingClientRect();
|
|
22
|
+
const tooltipRect = tooltip.getBoundingClientRect();
|
|
23
|
+
const isOnRight = childRect.left > screenCenterX;
|
|
24
|
+
const coordinate = isOnRight ? childRect.right + tooltipRect.width / 2 : childRect.left + tooltipRect.width;
|
|
25
|
+
if (direction === "top" || direction === "bottom") {
|
|
26
|
+
if (isOnRight && coordinate > windowWidth) {
|
|
27
|
+
direction = "left";
|
|
59
28
|
}
|
|
29
|
+
else if (!isOnRight && coordinate < windowWidth) {
|
|
30
|
+
direction = "right";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
let top = 0;
|
|
34
|
+
let left = 0;
|
|
35
|
+
switch (direction) {
|
|
36
|
+
case "top":
|
|
37
|
+
top = childRect.top - tooltipRect.height - margin;
|
|
38
|
+
left = childRect.left + childRect.width / 2 - tooltipRect.width / 2;
|
|
39
|
+
break;
|
|
40
|
+
case "right":
|
|
41
|
+
top = childRect.top + childRect.height / 2 - tooltipRect.height / 2;
|
|
42
|
+
left = childRect.right + margin;
|
|
43
|
+
break;
|
|
44
|
+
case "bottom":
|
|
45
|
+
top = childRect.bottom + margin;
|
|
46
|
+
left = childRect.left + childRect.width / 2 - tooltipRect.width / 2;
|
|
47
|
+
break;
|
|
48
|
+
case "left":
|
|
49
|
+
top = childRect.top + childRect.height / 2 - tooltipRect.height / 2;
|
|
50
|
+
left = childRect.left - tooltipRect.width - margin;
|
|
51
|
+
break;
|
|
60
52
|
}
|
|
53
|
+
tooltip.style.top = `${top}px`;
|
|
54
|
+
tooltip.style.left = `${left}px`;
|
|
55
|
+
setDirection(direction);
|
|
61
56
|
}, []);
|
|
62
57
|
//useEffects
|
|
63
58
|
useEffect(() => {
|
|
@@ -67,7 +62,7 @@ const Tooltip = ({ children, text, direction = "top" }) => {
|
|
|
67
62
|
return (React.createElement("div", { className: "ar-tooltip-wrapper" },
|
|
68
63
|
React.createElement("div", { ref: _children, onMouseEnter: () => setMouseEnter(true), onMouseLeave: () => setMouseEnter(false) }, children),
|
|
69
64
|
mouseEnter &&
|
|
70
|
-
ReactDOM.createPortal(React.createElement("div", { ref: _arTooltip, className: `ar-tooltip ${
|
|
65
|
+
ReactDOM.createPortal(React.createElement("div", { ref: _arTooltip, className: `ar-tooltip ${_direction}` }, Array.isArray(text) ? (text.map((t) => (React.createElement("span", { className: "text" },
|
|
71
66
|
React.createElement("span", { className: "bullet" }, "\u2022"),
|
|
72
67
|
React.createElement("span", null, t))))) : (React.createElement("span", { className: "text" }, text))), document.body)));
|
|
73
68
|
};
|
|
@@ -60,9 +60,9 @@ const ButtonAction = ({ buttons }) => {
|
|
|
60
60
|
}, [open]);
|
|
61
61
|
return (React.createElement("div", { ref: _wrapper, className: "ar-button-action" },
|
|
62
62
|
React.createElement("span", { ref: _button },
|
|
63
|
-
React.createElement(Button, { variant: "
|
|
63
|
+
React.createElement(Button, { variant: "surface", color: "gray", icon: { element: React.createElement("span", { className: "dotted" }) }, onClick: () => setOpen((prev) => !prev) })),
|
|
64
64
|
open &&
|
|
65
|
-
ReactDOM.createPortal(React.createElement("span", { ref: _list, className: "ar-action-buttons" }, buttons.map((button) => (React.createElement(Button, { variant: "borderless", onClick: button.onClick }, button.text)))), document.body)));
|
|
65
|
+
ReactDOM.createPortal(React.createElement("span", { ref: _list, className: "ar-action-buttons" }, buttons.map((button) => (React.createElement(Button, { variant: "borderless", color: button.color ?? "blue", onClick: button.onClick }, button.text)))), document.body)));
|
|
66
66
|
};
|
|
67
67
|
ButtonAction.displayName = "ButtonAction";
|
|
68
68
|
export default ButtonAction;
|
|
@@ -249,7 +249,7 @@ const DatePicker = ({ onChange, isClock, validation, ...attributes }) => {
|
|
|
249
249
|
attributes.placeholder && attributes.placeholder.length > 0 && (React.createElement("label", null,
|
|
250
250
|
validation ? "* " : "",
|
|
251
251
|
attributes.placeholder)),
|
|
252
|
-
React.createElement(Input, { ref: _beginDate, value: DATE.ParseValue(String(attributes.value), isClock), type: isClock ? "datetime-local" : "date",
|
|
252
|
+
React.createElement(Input, { ref: _beginDate, ...attributes, value: DATE.ParseValue(String(attributes.value), isClock), type: isClock ? "datetime-local" : "date", onKeyDown: (event) => {
|
|
253
253
|
if (event.code === "Space")
|
|
254
254
|
event.preventDefault();
|
|
255
255
|
else if (event.code === "Enter")
|