@sydsoft/base 1.50.0 → 1.52.0
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/{_lib → esm/_lib}/baseFunctions.js +38 -25
- package/_dist/{_lib → esm/_lib}/inputMask.js +69 -66
- package/_dist/{_lib → esm/_lib}/listFunctions.js +13 -12
- package/_dist/esm/_lib/storage/cookies.js +34 -0
- package/_dist/esm/_lib/storage/encData.js +43 -0
- package/_dist/{_lib → esm/_lib}/storage/localStorage.js +10 -10
- package/_dist/{_lib → esm/_lib}/storage/sessionStorage.js +10 -10
- package/_dist/{_lib → esm/_lib}/useInterval.js +5 -5
- package/_dist/{alert → esm/alert}/index.js +30 -28
- package/_dist/esm/box/Box.js +15 -0
- package/_dist/esm/box/BoxContent.js +7 -0
- package/_dist/esm/box/BoxFooter.js +8 -0
- package/_dist/esm/box/BoxHeader.js +9 -0
- package/_dist/esm/countDown/index.js +97 -0
- package/_dist/{dateTime → esm/dateTime}/index.js +31 -25
- package/_dist/esm/form/Button.js +76 -0
- package/_dist/esm/form/Checkbox.js +23 -0
- package/_dist/esm/form/Dialog.js +40 -0
- package/_dist/esm/form/Form.js +12 -0
- package/_dist/esm/form/FormOlustur.js +52 -0
- package/_dist/{form → esm/form}/Input.js +56 -57
- package/_dist/esm/form/Label.js +9 -0
- package/_dist/esm/form/SearchableInput.js +272 -0
- package/_dist/esm/form/UploadBase.js +86 -0
- package/_dist/esm/grid/index.js +97 -0
- package/_dist/{icon → esm/icon}/icons.js +1 -1
- package/_dist/esm/icon/index.js +26 -0
- package/_dist/esm/menu/index.js +52 -0
- package/_dist/esm/modal/index.js +66 -0
- package/_dist/{popover → esm/popover}/index.js +100 -100
- package/_dist/esm/tooltip/index.js +119 -0
- package/package.json +8 -9
- package/_dist/_lib/storage/cookies.js +0 -33
- package/_dist/_lib/storage/encData.js +0 -41
- package/_dist/box/Box.js +0 -14
- package/_dist/box/BoxContent.js +0 -5
- package/_dist/box/BoxFooter.js +0 -10
- package/_dist/box/BoxHeader.js +0 -10
- package/_dist/countDown/index.js +0 -92
- package/_dist/form/Button.js +0 -82
- package/_dist/form/Checkbox.js +0 -22
- package/_dist/form/Dialog.js +0 -53
- package/_dist/form/Form.js +0 -10
- package/_dist/form/FormOlustur.js +0 -50
- package/_dist/form/Label.js +0 -7
- package/_dist/form/SearchableInput.js +0 -260
- package/_dist/form/UploadBase.js +0 -84
- package/_dist/grid/index.js +0 -96
- package/_dist/icon/index.js +0 -34
- package/_dist/menu/index.js +0 -50
- package/_dist/modal/index.js +0 -64
- package/_dist/tooltip/index.js +0 -202
- /package/_dist/{_lib → esm/_lib}/baseFunctions.d.ts +0 -0
- /package/_dist/{_lib → esm/_lib}/inputMask.d.ts +0 -0
- /package/_dist/{_lib → esm/_lib}/listFunctions.d.ts +0 -0
- /package/_dist/{_lib → esm/_lib}/storage/cookies.d.ts +0 -0
- /package/_dist/{_lib → esm/_lib}/storage/encData.d.ts +0 -0
- /package/_dist/{_lib → esm/_lib}/storage/localStorage.d.ts +0 -0
- /package/_dist/{_lib → esm/_lib}/storage/sessionStorage.d.ts +0 -0
- /package/_dist/{_lib → esm/_lib}/useInterval.d.ts +0 -0
- /package/_dist/{alert → esm/alert}/index.d.ts +0 -0
- /package/_dist/{alert → esm/alert}/index.module.css +0 -0
- /package/_dist/{box → esm/box}/Box.d.ts +0 -0
- /package/_dist/{box → esm/box}/Box.module.css +0 -0
- /package/_dist/{box → esm/box}/BoxContent.d.ts +0 -0
- /package/_dist/{box → esm/box}/BoxFooter.d.ts +0 -0
- /package/_dist/{box → esm/box}/BoxHeader.d.ts +0 -0
- /package/_dist/{box → esm/box}/index.d.ts +0 -0
- /package/_dist/{box → esm/box}/index.js +0 -0
- /package/_dist/{countDown → esm/countDown}/index.d.ts +0 -0
- /package/_dist/{dateTime → esm/dateTime}/index.d.ts +0 -0
- /package/_dist/{form → esm/form}/Button.d.ts +0 -0
- /package/_dist/{form → esm/form}/Checkbox.d.ts +0 -0
- /package/_dist/{form → esm/form}/Dialog.d.ts +0 -0
- /package/_dist/{form → esm/form}/Form.d.ts +0 -0
- /package/_dist/{form → esm/form}/FormOlustur.d.ts +0 -0
- /package/_dist/{form → esm/form}/Input.d.ts +0 -0
- /package/_dist/{form → esm/form}/Label.d.ts +0 -0
- /package/_dist/{form → esm/form}/SearchableInput.d.ts +0 -0
- /package/_dist/{form → esm/form}/UploadBase.d.ts +0 -0
- /package/_dist/{form → esm/form}/index.d.ts +0 -0
- /package/_dist/{form → esm/form}/index.js +0 -0
- /package/_dist/{form → esm/form}/styles/Button.module.css +0 -0
- /package/_dist/{form → esm/form}/styles/Input.module.css +0 -0
- /package/_dist/{form → esm/form}/styles/Label.module.css +0 -0
- /package/_dist/{form → esm/form}/styles/SearchableInput.module.css +0 -0
- /package/_dist/{grid → esm/grid}/index.d.ts +0 -0
- /package/_dist/{grid → esm/grid}/index.module.css +0 -0
- /package/_dist/{icon → esm/icon}/icons.d.ts +0 -0
- /package/_dist/{icon → esm/icon}/index.d.ts +0 -0
- /package/_dist/{icon → esm/icon}/mui.d.ts +0 -0
- /package/_dist/{icon → esm/icon}/mui.js +0 -0
- /package/_dist/{index.d.ts → esm/index.d.ts} +0 -0
- /package/_dist/{index.js → esm/index.js} +0 -0
- /package/_dist/{menu → esm/menu}/index.d.ts +0 -0
- /package/_dist/{menu → esm/menu}/index.module.css +0 -0
- /package/_dist/{modal → esm/modal}/index.d.ts +0 -0
- /package/_dist/{modal → esm/modal}/index.module.css +0 -0
- /package/_dist/{popover → esm/popover}/index.d.ts +0 -0
- /package/_dist/{popover → esm/popover}/index.module.css +0 -0
- /package/_dist/{tooltip → esm/tooltip}/index.d.ts +0 -0
package/_dist/tooltip/index.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import React, { memo, useEffect } from "react";
|
|
2
|
-
export const Tooltip = memo(function MemoFunction({ children, title, position = "top", arrow = false, distance = 5, ...other }) {
|
|
3
|
-
useEffect(() => {
|
|
4
|
-
if (typeof window === "undefined")
|
|
5
|
-
return null;
|
|
6
|
-
const cssCheck = document.getElementsByClassName("stooltip_css")[0];
|
|
7
|
-
if (!cssCheck) {
|
|
8
|
-
const head = document.getElementsByTagName('head')[0];
|
|
9
|
-
const s = document.createElement('style');
|
|
10
|
-
s.setAttribute('type', 'text/css');
|
|
11
|
-
s.classList.add("stooltip_css");
|
|
12
|
-
s.appendChild(document.createTextNode(tooltipCss));
|
|
13
|
-
head.appendChild(s);
|
|
14
|
-
}
|
|
15
|
-
return () => tooltipSil();
|
|
16
|
-
}, []);
|
|
17
|
-
const tooltipEkle = (e) => {
|
|
18
|
-
tooltipSil();
|
|
19
|
-
const tooltip = document.createElement("div");
|
|
20
|
-
tooltip.innerHTML = title;
|
|
21
|
-
tooltip.classList.add("stooltip");
|
|
22
|
-
document.body.appendChild(tooltip);
|
|
23
|
-
tooltipPosition({ target: e.currentTarget, position: position });
|
|
24
|
-
};
|
|
25
|
-
const tooltipSil = () => {
|
|
26
|
-
const check = document.body.getElementsByClassName("stooltip")[0];
|
|
27
|
-
if (check)
|
|
28
|
-
check.remove();
|
|
29
|
-
};
|
|
30
|
-
const tooltipPosition = ({ target, position }) => {
|
|
31
|
-
const tooltip = document.body.getElementsByClassName("stooltip")[0];
|
|
32
|
-
if (tooltip) {
|
|
33
|
-
const arrowMargin = (arrow) ? 5 : 0;
|
|
34
|
-
const margin = distance + arrowMargin;
|
|
35
|
-
if (arrow)
|
|
36
|
-
tooltip.classList.add("arrow");
|
|
37
|
-
const targetPosition = target.getBoundingClientRect();
|
|
38
|
-
const tooltipPosition = tooltip.getBoundingClientRect();
|
|
39
|
-
const style = [];
|
|
40
|
-
if (position === "top" || position === "bottom") {
|
|
41
|
-
if (position === "top") {
|
|
42
|
-
if ((targetPosition.top - tooltipPosition.height - margin) < 0) {
|
|
43
|
-
style.push("top:" + (targetPosition.bottom + margin) + "px");
|
|
44
|
-
tooltip.classList.add("bottom");
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
style.push("top:" + (targetPosition.top - tooltipPosition.height - margin) + "px");
|
|
48
|
-
tooltip.classList.add("top");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (position === "bottom") {
|
|
52
|
-
if ((targetPosition.bottom + tooltipPosition.height + margin) > window.innerHeight) {
|
|
53
|
-
style.push("top:" + (targetPosition.top - tooltipPosition.height - margin) + "px");
|
|
54
|
-
tooltip.classList.add("top");
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
style.push("top:" + (targetPosition.bottom + margin) + "px");
|
|
58
|
-
tooltip.classList.add("bottom");
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
// if ((targetPosition.left - tooltipPosition.width) < 0) {
|
|
62
|
-
if ((targetPosition.left + (targetPosition.width / 2) - (tooltipPosition.width / 2)) < 0) {
|
|
63
|
-
style.push("left:2px");
|
|
64
|
-
tooltip.classList.add("start");
|
|
65
|
-
}
|
|
66
|
-
else if ((targetPosition.left + (targetPosition.width / 2) + tooltipPosition.width) > window.innerWidth) {
|
|
67
|
-
style.push("right:2px");
|
|
68
|
-
tooltip.classList.add("end");
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
style.push("left:" + (targetPosition.left + (targetPosition.width / 2)) + "px");
|
|
72
|
-
style.push("transform:translate(-50%,0)");
|
|
73
|
-
tooltip.classList.add("center");
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (position === "left" || position === "right") {
|
|
77
|
-
if (position === "left") {
|
|
78
|
-
if ((targetPosition.left - tooltipPosition.width - margin) < 0) {
|
|
79
|
-
style.push("left:" + (targetPosition.right + margin) + "px");
|
|
80
|
-
tooltip.classList.add("right");
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
style.push("left:" + (targetPosition.left - tooltipPosition.width - margin) + "px");
|
|
84
|
-
tooltip.classList.add("left");
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (position === "right") {
|
|
88
|
-
if ((targetPosition.left + (targetPosition.width / 2) + tooltipPosition.width + margin) > window.innerWidth) {
|
|
89
|
-
style.push("left:" + (targetPosition.left - tooltipPosition.width - margin) + "px");
|
|
90
|
-
tooltip.classList.add("left");
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
style.push("left:" + (targetPosition.right + margin) + "px");
|
|
94
|
-
tooltip.classList.add("right");
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if ((targetPosition.top + (targetPosition.height / 2) - (tooltipPosition.height / 2)) < 0) {
|
|
98
|
-
style.push("top:2px");
|
|
99
|
-
tooltip.classList.add("start");
|
|
100
|
-
}
|
|
101
|
-
else if ((targetPosition.top + (targetPosition.height / 2) + (tooltipPosition.height / 2)) > window.innerHeight) {
|
|
102
|
-
style.push("bottom:2px");
|
|
103
|
-
tooltip.classList.add("end");
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
style.push("top:" + (targetPosition.top + (targetPosition.height / 2)) + "px");
|
|
107
|
-
style.push("transform:translate(0,-50%)");
|
|
108
|
-
tooltip.classList.add("center");
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
tooltip.setAttribute("style", style.join(";"));
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
return React.cloneElement(children, {
|
|
115
|
-
onMouseEnter: tooltipEkle,
|
|
116
|
-
onMouseLeave: tooltipSil,
|
|
117
|
-
onMouseDown: tooltipSil,
|
|
118
|
-
...other
|
|
119
|
-
});
|
|
120
|
-
});
|
|
121
|
-
const tooltipCss = `
|
|
122
|
-
.stooltip {
|
|
123
|
-
position: fixed;
|
|
124
|
-
display: flex;
|
|
125
|
-
align-items: center;
|
|
126
|
-
justify-content: center;
|
|
127
|
-
background-color: #1a1a1a;
|
|
128
|
-
color: rgba(255,255,255,0.9);
|
|
129
|
-
text-align: center;
|
|
130
|
-
font-size: 0.9rem;
|
|
131
|
-
font-weight:400;
|
|
132
|
-
padding: 5px 10px;
|
|
133
|
-
border-radius: 8px;
|
|
134
|
-
z-index: 1000000;
|
|
135
|
-
opacity: 0.9;
|
|
136
|
-
pointer-events: none;
|
|
137
|
-
/*transition: all 0.1s;*/
|
|
138
|
-
white-space:pre-line;
|
|
139
|
-
max-width: 300px;
|
|
140
|
-
animation: stooltip_fadein 0.7s;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
.stooltip.arrow:after {
|
|
144
|
-
content: "";
|
|
145
|
-
position: absolute;
|
|
146
|
-
margin-left: -5px;
|
|
147
|
-
border-width: 5px;
|
|
148
|
-
border-style: solid;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.stooltip.arrow.top:after {
|
|
152
|
-
top: 100%;
|
|
153
|
-
border-color: #1a1a1a transparent transparent transparent;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.stooltip.arrow.top.start:after { left: 15px;}
|
|
157
|
-
|
|
158
|
-
.stooltip.arrow.top.center:after { left: 50%;}
|
|
159
|
-
|
|
160
|
-
.stooltip.arrow.top.end:after { right: 15px;}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
.stooltip.arrow.bottom:after {
|
|
164
|
-
bottom: 100%;
|
|
165
|
-
border-color: transparent transparent #1a1a1a transparent;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
.stooltip.arrow.bottom.start:after { left: 15px;}
|
|
169
|
-
|
|
170
|
-
.stooltip.arrow.bottom.center:after { left: 50%;}
|
|
171
|
-
|
|
172
|
-
.stooltip.bottom.end:after { right: 15px;}
|
|
173
|
-
|
|
174
|
-
.stooltip.arrow.left:after {
|
|
175
|
-
margin-left: -1px;
|
|
176
|
-
left: 100%;
|
|
177
|
-
border-color: transparent transparent transparent #1a1a1a;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
.stooltip.arrow.left.start:after { top: 5px;}
|
|
181
|
-
|
|
182
|
-
.stooltip.arrow.left.center:after { top: 50%; margin-top: -5px;}
|
|
183
|
-
|
|
184
|
-
.stooltip.arrow.left.end:after { bottom: 15px;}
|
|
185
|
-
|
|
186
|
-
.stooltip.arrow.right:after {
|
|
187
|
-
margin-right: -1px;
|
|
188
|
-
right: 100%;
|
|
189
|
-
border-color: transparent #1a1a1a transparent transparent;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
.stooltip.arrow.right.start:after { top: 5px;}
|
|
193
|
-
|
|
194
|
-
.stooltip.arrow.right.center:after { top: 50%; margin-top: -5px;}
|
|
195
|
-
|
|
196
|
-
.stooltip.arrow.right.end:after { bottom: 15px;}
|
|
197
|
-
|
|
198
|
-
@keyframes stooltip_fadein {
|
|
199
|
-
from { opacity: 0; }
|
|
200
|
-
to { opacity: 0.85; }
|
|
201
|
-
}
|
|
202
|
-
`;
|
|
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
|
|
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
|
|
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
|