@sydsoft/base 1.47.0 → 1.48.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.
Files changed (43) hide show
  1. package/README.md +8 -1
  2. package/dist/esm/_lib/baseFunctions.js +25 -38
  3. package/dist/esm/_lib/inputMask.js +66 -69
  4. package/dist/esm/_lib/listFunctions.js +12 -13
  5. package/dist/esm/_lib/storage/cookies.js +20 -21
  6. package/dist/esm/_lib/storage/encData.js +18 -20
  7. package/dist/esm/_lib/storage/localStorage.js +10 -10
  8. package/dist/esm/_lib/storage/sessionStorage.js +10 -10
  9. package/dist/esm/_lib/useInterval.js +5 -5
  10. package/dist/esm/alert/index.js +28 -30
  11. package/dist/esm/box/Box.js +6 -7
  12. package/dist/esm/box/BoxContent.js +2 -4
  13. package/dist/esm/box/BoxFooter.js +6 -4
  14. package/dist/esm/box/BoxHeader.js +6 -5
  15. package/dist/esm/countDown/index.js +28 -33
  16. package/dist/esm/dateTime/index.js +25 -31
  17. package/dist/esm/form/Button.js +28 -22
  18. package/dist/esm/form/Checkbox.js +7 -8
  19. package/dist/esm/form/Dialog.js +47 -34
  20. package/dist/esm/form/Form.js +3 -5
  21. package/dist/esm/form/FormOlustur.js +15 -17
  22. package/dist/esm/form/Input.js +57 -56
  23. package/dist/esm/form/Label.js +2 -4
  24. package/dist/esm/form/SearchableInput.js +77 -89
  25. package/dist/esm/form/UploadBase.js +30 -32
  26. package/dist/esm/grid/index.js +40 -41
  27. package/dist/esm/icon/icons.js +1 -1
  28. package/dist/esm/icon/index.js +16 -8
  29. package/dist/esm/menu/index.js +14 -16
  30. package/dist/esm/modal/index.js +14 -16
  31. package/dist/esm/popover/index.js +100 -100
  32. package/dist/esm/tooltip/index.js +117 -34
  33. package/package.json +12 -6
  34. package/dist/esm/alert/index.module.css +0 -119
  35. package/dist/esm/grid/index.module.css +0 -805
  36. package/dist/esm/menu/index.module.css +0 -92
  37. package/dist/esm/modal/index.module.css +0 -77
  38. /package/dist/esm/{box/Box.module.css → Box.module.css} +0 -0
  39. /package/dist/esm/{popover/index.module.css → index.module.css} +0 -0
  40. /package/dist/esm/{form/styles → styles}/Button.module.css +0 -0
  41. /package/dist/esm/{form/styles → styles}/Input.module.css +0 -0
  42. /package/dist/esm/{form/styles → styles}/Label.module.css +0 -0
  43. /package/dist/esm/{form/styles → styles}/SearchableInput.module.css +0 -0
@@ -1,59 +1,56 @@
1
- import { __assign, __rest } from "tslib";
2
1
  import React, { memo, useEffect } from "react";
3
- export var Tooltip = memo(function MemoFunction(_a) {
4
- var children = _a.children, title = _a.title, _b = _a.position, position = _b === void 0 ? "top" : _b, _c = _a.arrow, arrow = _c === void 0 ? false : _c, _d = _a.distance, distance = _d === void 0 ? 5 : _d, other = __rest(_a, ["children", "title", "position", "arrow", "distance"]);
5
- useEffect(function () {
2
+ export const Tooltip = memo(function MemoFunction({ children, title, position = "top", arrow = false, distance = 5, ...other }) {
3
+ useEffect(() => {
6
4
  if (typeof window === "undefined")
7
5
  return null;
8
- var cssCheck = document.getElementsByClassName("stooltip_css")[0];
6
+ const cssCheck = document.getElementsByClassName("stooltip_css")[0];
9
7
  if (!cssCheck) {
10
- var head = document.getElementsByTagName('head')[0];
11
- var s = document.createElement('style');
8
+ const head = document.getElementsByTagName('head')[0];
9
+ const s = document.createElement('style');
12
10
  s.setAttribute('type', 'text/css');
13
11
  s.classList.add("stooltip_css");
14
12
  s.appendChild(document.createTextNode(tooltipCss));
15
13
  head.appendChild(s);
16
14
  }
17
- return function () { return tooltipSil(); };
15
+ return () => tooltipSil();
18
16
  }, []);
19
- var tooltipEkle = function (e) {
17
+ const tooltipEkle = (e) => {
20
18
  tooltipSil();
21
- var tooltip = document.createElement("div");
19
+ const tooltip = document.createElement("div");
22
20
  tooltip.innerHTML = title;
23
21
  tooltip.classList.add("stooltip");
24
22
  document.body.appendChild(tooltip);
25
23
  tooltipPosition({ target: e.currentTarget, position: position });
26
24
  };
27
- var tooltipSil = function () {
28
- var check = document.body.getElementsByClassName("stooltip")[0];
25
+ const tooltipSil = () => {
26
+ const check = document.body.getElementsByClassName("stooltip")[0];
29
27
  if (check)
30
28
  check.remove();
31
29
  };
32
- var tooltipPosition = function (_a) {
33
- var target = _a.target, position = _a.position;
34
- var tooltip = document.body.getElementsByClassName("stooltip")[0];
30
+ const tooltipPosition = ({ target, position }) => {
31
+ const tooltip = document.body.getElementsByClassName("stooltip")[0];
35
32
  if (tooltip) {
36
- var arrowMargin = (arrow) ? 5 : 0;
37
- var margin = distance + arrowMargin;
33
+ const arrowMargin = (arrow) ? 5 : 0;
34
+ const margin = distance + arrowMargin;
38
35
  if (arrow)
39
36
  tooltip.classList.add("arrow");
40
- var targetPosition = target.getBoundingClientRect();
41
- var tooltipPosition_1 = tooltip.getBoundingClientRect();
42
- var style = [];
37
+ const targetPosition = target.getBoundingClientRect();
38
+ const tooltipPosition = tooltip.getBoundingClientRect();
39
+ const style = [];
43
40
  if (position === "top" || position === "bottom") {
44
41
  if (position === "top") {
45
- if ((targetPosition.top - tooltipPosition_1.height - margin) < 0) {
42
+ if ((targetPosition.top - tooltipPosition.height - margin) < 0) {
46
43
  style.push("top:" + (targetPosition.bottom + margin) + "px");
47
44
  tooltip.classList.add("bottom");
48
45
  }
49
46
  else {
50
- style.push("top:" + (targetPosition.top - tooltipPosition_1.height - margin) + "px");
47
+ style.push("top:" + (targetPosition.top - tooltipPosition.height - margin) + "px");
51
48
  tooltip.classList.add("top");
52
49
  }
53
50
  }
54
51
  if (position === "bottom") {
55
- if ((targetPosition.bottom + tooltipPosition_1.height + margin) > window.innerHeight) {
56
- style.push("top:" + (targetPosition.top - tooltipPosition_1.height - margin) + "px");
52
+ if ((targetPosition.bottom + tooltipPosition.height + margin) > window.innerHeight) {
53
+ style.push("top:" + (targetPosition.top - tooltipPosition.height - margin) + "px");
57
54
  tooltip.classList.add("top");
58
55
  }
59
56
  else {
@@ -62,11 +59,11 @@ export var Tooltip = memo(function MemoFunction(_a) {
62
59
  }
63
60
  }
64
61
  // if ((targetPosition.left - tooltipPosition.width) < 0) {
65
- if ((targetPosition.left + (targetPosition.width / 2) - (tooltipPosition_1.width / 2)) < 0) {
62
+ if ((targetPosition.left + (targetPosition.width / 2) - (tooltipPosition.width / 2)) < 0) {
66
63
  style.push("left:2px");
67
64
  tooltip.classList.add("start");
68
65
  }
69
- else if ((targetPosition.left + (targetPosition.width / 2) + tooltipPosition_1.width) > window.innerWidth) {
66
+ else if ((targetPosition.left + (targetPosition.width / 2) + tooltipPosition.width) > window.innerWidth) {
70
67
  style.push("right:2px");
71
68
  tooltip.classList.add("end");
72
69
  }
@@ -78,18 +75,18 @@ export var Tooltip = memo(function MemoFunction(_a) {
78
75
  }
79
76
  if (position === "left" || position === "right") {
80
77
  if (position === "left") {
81
- if ((targetPosition.left - tooltipPosition_1.width - margin) < 0) {
78
+ if ((targetPosition.left - tooltipPosition.width - margin) < 0) {
82
79
  style.push("left:" + (targetPosition.right + margin) + "px");
83
80
  tooltip.classList.add("right");
84
81
  }
85
82
  else {
86
- style.push("left:" + (targetPosition.left - tooltipPosition_1.width - margin) + "px");
83
+ style.push("left:" + (targetPosition.left - tooltipPosition.width - margin) + "px");
87
84
  tooltip.classList.add("left");
88
85
  }
89
86
  }
90
87
  if (position === "right") {
91
- if ((targetPosition.left + (targetPosition.width / 2) + tooltipPosition_1.width + margin) > window.innerWidth) {
92
- style.push("left:" + (targetPosition.left - tooltipPosition_1.width - margin) + "px");
88
+ if ((targetPosition.left + (targetPosition.width / 2) + tooltipPosition.width + margin) > window.innerWidth) {
89
+ style.push("left:" + (targetPosition.left - tooltipPosition.width - margin) + "px");
93
90
  tooltip.classList.add("left");
94
91
  }
95
92
  else {
@@ -97,11 +94,11 @@ export var Tooltip = memo(function MemoFunction(_a) {
97
94
  tooltip.classList.add("right");
98
95
  }
99
96
  }
100
- if ((targetPosition.top + (targetPosition.height / 2) - (tooltipPosition_1.height / 2)) < 0) {
97
+ if ((targetPosition.top + (targetPosition.height / 2) - (tooltipPosition.height / 2)) < 0) {
101
98
  style.push("top:2px");
102
99
  tooltip.classList.add("start");
103
100
  }
104
- else if ((targetPosition.top + (targetPosition.height / 2) + (tooltipPosition_1.height / 2)) > window.innerHeight) {
101
+ else if ((targetPosition.top + (targetPosition.height / 2) + (tooltipPosition.height / 2)) > window.innerHeight) {
105
102
  style.push("bottom:2px");
106
103
  tooltip.classList.add("end");
107
104
  }
@@ -114,6 +111,92 @@ export var Tooltip = memo(function MemoFunction(_a) {
114
111
  tooltip.setAttribute("style", style.join(";"));
115
112
  }
116
113
  };
117
- return React.cloneElement(children, __assign({ onMouseEnter: tooltipEkle, onMouseLeave: tooltipSil, onMouseDown: tooltipSil }, other));
114
+ return React.cloneElement(children, {
115
+ onMouseEnter: tooltipEkle,
116
+ onMouseLeave: tooltipSil,
117
+ onMouseDown: tooltipSil,
118
+ ...other
119
+ });
118
120
  });
119
- var tooltipCss = "\n.stooltip {\n position: fixed;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #1a1a1a;\n color: rgba(255,255,255,0.9);\n text-align: center;\n font-size: 0.9rem;\n font-weight:400;\n padding: 5px 10px;\n border-radius: 8px;\n z-index: 1000000;\n opacity: 0.9;\n pointer-events: none;\n /*transition: all 0.1s;*/\n white-space:pre-line;\n max-width: 300px;\n animation: stooltip_fadein 0.7s;\n}\n\n.stooltip.arrow:after {\n content: \"\";\n position: absolute;\n margin-left: -5px;\n border-width: 5px;\n border-style: solid;\n}\n\n.stooltip.arrow.top:after {\n top: 100%;\n border-color: #1a1a1a transparent transparent transparent;\n}\n\n.stooltip.arrow.top.start:after { left: 15px;}\n\n.stooltip.arrow.top.center:after { left: 50%;}\n\n.stooltip.arrow.top.end:after { right: 15px;}\n\n\n.stooltip.arrow.bottom:after {\n bottom: 100%;\n border-color: transparent transparent #1a1a1a transparent;\n}\n\n.stooltip.arrow.bottom.start:after { left: 15px;}\n\n.stooltip.arrow.bottom.center:after { left: 50%;}\n\n.stooltip.bottom.end:after { right: 15px;}\n\n.stooltip.arrow.left:after {\n margin-left: -1px;\n left: 100%;\n border-color: transparent transparent transparent #1a1a1a;\n}\n\n.stooltip.arrow.left.start:after { top: 5px;}\n\n.stooltip.arrow.left.center:after { top: 50%; margin-top: -5px;}\n\n.stooltip.arrow.left.end:after { bottom: 15px;}\n\n.stooltip.arrow.right:after {\n margin-right: -1px;\n right: 100%;\n border-color: transparent #1a1a1a transparent transparent;\n}\n\n.stooltip.arrow.right.start:after { top: 5px;}\n\n.stooltip.arrow.right.center:after { top: 50%; margin-top: -5px;}\n\n.stooltip.arrow.right.end:after { bottom: 15px;}\n\n@keyframes stooltip_fadein {\n from { opacity: 0; }\n to { opacity: 0.85; }\n}\n";
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
+ `;
package/package.json CHANGED
@@ -1,20 +1,25 @@
1
1
  {
2
2
  "name": "@sydsoft/base",
3
3
  "private": false,
4
- "version": "1.47.0",
4
+ "version": "1.48.0",
5
5
  "description": "",
6
- "main": "./dist/cjs/index.js",
6
+ "main": "./dist/esm/index.js",
7
7
  "module": "./dist/esm/index.js",
8
8
  "types": "./dist/esm/index.d.ts",
9
9
  "files": [
10
10
  "./dist/",
11
11
  "README.md"
12
12
  ],
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/esm/index.d.ts",
16
+ "default": "./dist/esm/index.js"
17
+ }
18
+ },
13
19
  "scripts": {
14
- "test": "rm -rf ../*.tgz && rm -rf ../.next && npm run build && npm pack --pack-destination ../ && cd ../ && npm uninstall @sydsoft/base && npm install *.tgz && npm run dev",
15
- "buildCommonJS": "rm -rf ./dist && tsc && tsc --module commonjs --outDir ./dist/csj",
16
- "copyFiles": "copyfiles -u 2 \"../@base/**/*.css\" dist/esm",
17
- "build": "rm -rf ./dist && tsc && npm run copyFiles",
20
+ "clean": "rm -rf ./dist",
21
+ "copyFiles": "copyfiles -u 1 \"**/*.css\" dist/esm",
22
+ "build": "npm run clean && tsc && npm run copyFiles",
18
23
  "publishNPM": "npm run build && npm version patch && npm version minor && npm publish --dry-run && npm publish --access public && rm -rf ./dist"
19
24
  },
20
25
  "publishConfig": {
@@ -36,6 +41,7 @@
36
41
  "devDependencies": {
37
42
  "@types/react": "^18",
38
43
  "@types/react-dom": "^18",
44
+ "copyfiles": "^2.4.1",
39
45
  "react": "^18",
40
46
  "react-dom": "^18",
41
47
  "typescript": "^5"
@@ -1,119 +0,0 @@
1
- .message {
2
- flex: 1;
3
- }
4
-
5
- .close {
6
- position: absolute;
7
- top: 0;
8
- left: 0;
9
- width: 17px;
10
- height: 17px;
11
- border-radius: 50%;
12
- padding: 3px;
13
- display: flex;
14
- align-items: center;
15
- justify-content: center;
16
- font-size: 9px;
17
- letter-spacing: 0;
18
- transform: translate(-50%, -50%) scale(0);
19
- transition: ease-in-out 0.2s;
20
- border: 1px #97979740 solid;
21
- box-shadow: 1px 1px 4px 0 #000000a6;
22
- cursor: pointer;
23
- background: inherit;
24
- }
25
- .close:hover {
26
- zoom: 1.1;
27
- }
28
- .salert:hover .close {
29
- transform: translate(-50%, -50%) scale(1);
30
- }
31
- .salert {
32
- position: relative;
33
- min-width: 50px;
34
- width: fit-content;
35
- margin: 6px 0 6px auto;
36
- padding: 10px 15px;
37
- border-radius: 5px;
38
- cursor: default;
39
- background: #1f1f1f;
40
- color: rgba(255, 255, 255, 0.93);
41
- border: 1px #97979740 solid;
42
- box-shadow: 1px 1px 4px 0 #000000a6;
43
- display: flex;
44
- flex-direction: row;
45
- align-items: center;
46
- transition: transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms;
47
- animation: show 0.3s;
48
- font-family: inherit;
49
- font-size: 1rem;
50
- line-height: 1.5;
51
- }
52
-
53
- .error {
54
- background: rgb(211, 47, 47);
55
- background: linear-gradient(
56
- 135deg,
57
- rgba(211, 47, 47, 1) 0%,
58
- rgba(211, 47, 47, 0.8) 70%
59
- );
60
- color: rgba(255, 255, 255, 0.93);
61
- }
62
-
63
- .success {
64
- background: rgb(67, 160, 71);
65
- background: linear-gradient(
66
- 135deg,
67
- rgba(67, 160, 71, 1) 0%,
68
- rgba(67, 160, 71, 0.8) 70%
69
- );
70
- color: rgba(255, 255, 255, 0.93);
71
- }
72
-
73
- .info {
74
- background: rgb(13, 141, 189);
75
- background: linear-gradient(
76
- 135deg,
77
- rgba(13, 141, 189, 1) 0%,
78
- rgba(13, 141, 189, 0.8) 70%
79
- );
80
- color: rgba(255, 255, 255, 0.93);
81
- }
82
-
83
- .warning {
84
- background: rgb(217, 142, 4);
85
- background: linear-gradient(
86
- 135deg,
87
- rgba(217, 142, 4, 1) 0%,
88
- rgba(217, 142, 4, 0.8) 70%
89
- );
90
- color: rgba(255, 255, 255, 0.93);
91
- }
92
-
93
- .loading {
94
- background: linear-gradient(
95
- 60deg,
96
- rgb(15 33 34) 0%,
97
- rgba(0, 172, 193, 1) 100%
98
- );
99
- color: rgba(255, 255, 255, 0.93);
100
- animation: waves 50s infinite linear;
101
- }
102
-
103
- @keyframes show {
104
- from {
105
- transform: translateX(200%);
106
- }
107
- to {
108
- transform: translateX(0);
109
- }
110
- }
111
-
112
- @keyframes waves {
113
- from {
114
- background-position: 0;
115
- }
116
- to {
117
- background-position: 100vw 0;
118
- }
119
- }