@sydsoft/base 1.52.0 → 1.53.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/{esm/_lib → _lib}/baseFunctions.js +24 -11
- package/_dist/{esm/_lib → _lib}/inputMask.js +7 -3
- package/_dist/{esm/_lib → _lib}/listFunctions.js +7 -2
- package/_dist/_lib/storage/cookies.js +41 -0
- package/_dist/{esm/_lib → _lib}/storage/encData.js +10 -5
- package/_dist/_lib/storage/localStorage.js +78 -0
- package/_dist/_lib/storage/sessionStorage.js +78 -0
- package/_dist/{esm/_lib → _lib}/useInterval.js +8 -5
- package/_dist/{esm/alert → alert}/index.js +22 -13
- package/_dist/box/Box.js +19 -0
- package/_dist/box/BoxContent.js +11 -0
- package/_dist/box/BoxFooter.js +11 -0
- package/_dist/box/BoxHeader.js +12 -0
- package/_dist/box/index.js +12 -0
- package/_dist/{esm/countDown → countDown}/index.js +17 -12
- package/_dist/{esm/dateTime → dateTime}/index.js +3 -1
- package/_dist/form/Button.js +79 -0
- package/_dist/form/Checkbox.js +28 -0
- package/_dist/form/Dialog.js +44 -0
- package/_dist/form/Form.js +15 -0
- package/_dist/{esm/form → form}/FormOlustur.js +22 -19
- package/_dist/{esm/form → form}/Input.js +49 -45
- package/_dist/form/Label.js +12 -0
- package/_dist/{esm/form → form}/SearchableInput.js +48 -45
- package/_dist/{esm/form → form}/UploadBase.js +21 -16
- package/_dist/form/index.js +12 -0
- package/_dist/grid/index.js +104 -0
- package/_dist/icon/icons.js +26 -0
- package/_dist/icon/index.js +30 -0
- package/_dist/icon/mui.js +2 -0
- package/_dist/index.js +22 -0
- package/_dist/menu/index.js +55 -0
- package/_dist/{esm/modal → modal}/index.js +16 -13
- package/_dist/{esm/popover → popover}/index.js +39 -36
- package/_dist/{esm/tooltip → tooltip}/index.js +9 -6
- package/package.json +6 -7
- package/_dist/esm/_lib/storage/cookies.js +0 -34
- package/_dist/esm/_lib/storage/localStorage.js +0 -69
- package/_dist/esm/_lib/storage/sessionStorage.js +0 -69
- package/_dist/esm/box/Box.js +0 -15
- package/_dist/esm/box/BoxContent.js +0 -7
- package/_dist/esm/box/BoxFooter.js +0 -8
- package/_dist/esm/box/BoxHeader.js +0 -9
- package/_dist/esm/box/index.js +0 -9
- package/_dist/esm/form/Button.js +0 -76
- package/_dist/esm/form/Checkbox.js +0 -23
- package/_dist/esm/form/Dialog.js +0 -40
- package/_dist/esm/form/Form.js +0 -12
- package/_dist/esm/form/Label.js +0 -9
- package/_dist/esm/form/index.js +0 -9
- package/_dist/esm/grid/index.js +0 -97
- package/_dist/esm/icon/icons.js +0 -23
- package/_dist/esm/icon/index.js +0 -26
- package/_dist/esm/icon/mui.js +0 -1
- package/_dist/esm/index.js +0 -19
- package/_dist/esm/menu/index.js +0 -52
- /package/_dist/{esm/_lib → _lib}/baseFunctions.d.ts +0 -0
- /package/_dist/{esm/_lib → _lib}/inputMask.d.ts +0 -0
- /package/_dist/{esm/_lib → _lib}/listFunctions.d.ts +0 -0
- /package/_dist/{esm/_lib → _lib}/storage/cookies.d.ts +0 -0
- /package/_dist/{esm/_lib → _lib}/storage/encData.d.ts +0 -0
- /package/_dist/{esm/_lib → _lib}/storage/localStorage.d.ts +0 -0
- /package/_dist/{esm/_lib → _lib}/storage/sessionStorage.d.ts +0 -0
- /package/_dist/{esm/_lib → _lib}/useInterval.d.ts +0 -0
- /package/_dist/{esm/alert → alert}/index.d.ts +0 -0
- /package/_dist/{esm/alert → alert}/index.module.css +0 -0
- /package/_dist/{esm/box → box}/Box.d.ts +0 -0
- /package/_dist/{esm/box → box}/Box.module.css +0 -0
- /package/_dist/{esm/box → box}/BoxContent.d.ts +0 -0
- /package/_dist/{esm/box → box}/BoxFooter.d.ts +0 -0
- /package/_dist/{esm/box → box}/BoxHeader.d.ts +0 -0
- /package/_dist/{esm/box → box}/index.d.ts +0 -0
- /package/_dist/{esm/countDown → countDown}/index.d.ts +0 -0
- /package/_dist/{esm/dateTime → dateTime}/index.d.ts +0 -0
- /package/_dist/{esm/form → form}/Button.d.ts +0 -0
- /package/_dist/{esm/form → form}/Checkbox.d.ts +0 -0
- /package/_dist/{esm/form → form}/Dialog.d.ts +0 -0
- /package/_dist/{esm/form → form}/Form.d.ts +0 -0
- /package/_dist/{esm/form → form}/FormOlustur.d.ts +0 -0
- /package/_dist/{esm/form → form}/Input.d.ts +0 -0
- /package/_dist/{esm/form → form}/Label.d.ts +0 -0
- /package/_dist/{esm/form → form}/SearchableInput.d.ts +0 -0
- /package/_dist/{esm/form → form}/UploadBase.d.ts +0 -0
- /package/_dist/{esm/form → form}/index.d.ts +0 -0
- /package/_dist/{esm/form → form}/styles/Button.module.css +0 -0
- /package/_dist/{esm/form → form}/styles/Input.module.css +0 -0
- /package/_dist/{esm/form → form}/styles/Label.module.css +0 -0
- /package/_dist/{esm/form → form}/styles/SearchableInput.module.css +0 -0
- /package/_dist/{esm/grid → grid}/index.d.ts +0 -0
- /package/_dist/{esm/grid → grid}/index.module.css +0 -0
- /package/_dist/{esm/icon → icon}/icons.d.ts +0 -0
- /package/_dist/{esm/icon → icon}/index.d.ts +0 -0
- /package/_dist/{esm/icon → icon}/mui.d.ts +0 -0
- /package/_dist/{esm/index.d.ts → index.d.ts} +0 -0
- /package/_dist/{esm/menu → menu}/index.d.ts +0 -0
- /package/_dist/{esm/menu → menu}/index.module.css +0 -0
- /package/_dist/{esm/modal → modal}/index.d.ts +0 -0
- /package/_dist/{esm/modal → modal}/index.module.css +0 -0
- /package/_dist/{esm/popover → popover}/index.d.ts +0 -0
- /package/_dist/{esm/popover → popover}/index.module.css +0 -0
- /package/_dist/{esm/tooltip → tooltip}/index.d.ts +0 -0
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Modal = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
3
6
|
/**
|
|
4
7
|
* Copyright (c) 2023
|
|
5
8
|
* @author: izzetseydaoglu
|
|
6
9
|
* @last-modified: 9.02.2024 06:07
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
var react_1 = require("react");
|
|
12
|
+
var react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
|
13
|
+
var index_module_css_1 = tslib_1.__importDefault(require("./index.module.css"));
|
|
14
|
+
exports.Modal = (0, react_1.memo)(function MemoFunction(_a) {
|
|
12
15
|
var _b = _a.refModal, refModal = _b === void 0 ? null : _b, children = _a.children, _c = _a.open, open = _c === void 0 ? false : _c, close = _a.close, _d = _a.keepMounted, keepMounted = _d === void 0 ? false : _d, _e = _a.fullScreen, fullScreen = _e === void 0 ? false : _e, _f = _a.hideBackdrop, hideBackdrop = _f === void 0 ? true : _f, _g = _a.hideEsc, hideEsc = _g === void 0 ? false : _g, _h = _a.hideCloseButton, hideCloseButton = _h === void 0 ? false : _h, modalStyle = _a.modalStyle, backdropStyle = _a.backdropStyle, _j = _a.vertialAlign, vertialAlign = _j === void 0 ? "center" : _j, _k = _a.horizontalAlign, horizontalAlign = _k === void 0 ? "center" : _k;
|
|
13
|
-
var _l = useState(null), modalDiv = _l[0], setModalDiv = _l[1];
|
|
14
|
-
var ref = useRef(null);
|
|
15
|
-
useEffect(function () {
|
|
16
|
+
var _l = (0, react_1.useState)(null), modalDiv = _l[0], setModalDiv = _l[1];
|
|
17
|
+
var ref = (0, react_1.useRef)(null);
|
|
18
|
+
(0, react_1.useEffect)(function () {
|
|
16
19
|
if (refModal)
|
|
17
20
|
refModal.current = ref.current;
|
|
18
21
|
}, [ref.current]);
|
|
@@ -28,7 +31,7 @@ export var Modal = memo(function MemoFunction(_a) {
|
|
|
28
31
|
if (e.keyCode === 27 || e.key === "Escape" || e.code === "Escape")
|
|
29
32
|
onClose();
|
|
30
33
|
};
|
|
31
|
-
useEffect(function () {
|
|
34
|
+
(0, react_1.useEffect)(function () {
|
|
32
35
|
if (open) {
|
|
33
36
|
if (hideBackdrop)
|
|
34
37
|
window.addEventListener("mousedown", checkHideBackDrop);
|
|
@@ -42,7 +45,7 @@ export var Modal = memo(function MemoFunction(_a) {
|
|
|
42
45
|
window.removeEventListener("keydown", checkESC);
|
|
43
46
|
};
|
|
44
47
|
});
|
|
45
|
-
useEffect(function () {
|
|
48
|
+
(0, react_1.useEffect)(function () {
|
|
46
49
|
if (!modalDiv) {
|
|
47
50
|
var modalDivCheck = document.getElementById("smodal");
|
|
48
51
|
if (modalDivCheck) {
|
|
@@ -61,6 +64,6 @@ export var Modal = memo(function MemoFunction(_a) {
|
|
|
61
64
|
}, []);
|
|
62
65
|
if ((!keepMounted && !open) || typeof window === "undefined")
|
|
63
66
|
return null;
|
|
64
|
-
var Component = (
|
|
65
|
-
return modalDiv ?
|
|
67
|
+
var Component = ((0, jsx_runtime_1.jsx)("div", { className: "".concat(index_module_css_1.default.backdrop, " ").concat(open ? index_module_css_1.default.backdrop_open : ""), style: tslib_1.__assign({ alignItems: vertialAlign, justifyContent: horizontalAlign }, backdropStyle), children: (0, jsx_runtime_1.jsxs)("div", { ref: ref, className: "smodal ".concat(index_module_css_1.default.modal, " ").concat(fullScreen ? index_module_css_1.default.fullscreen : ""), style: modalStyle, children: [!hideCloseButton && ((0, jsx_runtime_1.jsx)("div", { className: "close ".concat(index_module_css_1.default.close_fixed), children: (0, jsx_runtime_1.jsx)("div", { className: index_module_css_1.default.close, onClick: onClose, children: "\u2715" }) })), children] }) }));
|
|
68
|
+
return modalDiv ? react_dom_1.default.createPortal(Component, modalDiv) : null;
|
|
66
69
|
});
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* @author : izzetseydaoglu
|
|
3
4
|
* @copyright : sydSOFT Bilişim Hizmetleri (c) 2026
|
|
4
5
|
* @version : 2026-02-10 16:12:35
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.Popover = void 0;
|
|
9
|
+
var tslib_1 = require("tslib");
|
|
10
|
+
var react_1 = require("react");
|
|
11
|
+
var client_1 = require("react-dom/client");
|
|
12
|
+
var index_module_css_1 = tslib_1.__importDefault(require("./index.module.css"));
|
|
13
|
+
exports.Popover = (0, react_1.memo)(function MemoFunction(_a) {
|
|
14
|
+
var children = _a.children, component = _a.component, _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, _e = _a.removeWhenClickInside, removeWhenClickInside = _e === void 0 ? false : _e, _f = _a.hideBackdrop, hideBackdrop = _f === void 0 ? true : _f, _g = _a.fade, fade = _g === void 0 ? true : _g, _h = _a.arrowColor, arrowColor = _h === void 0 ? 'auto' : _h, _j = _a.hover, hover = _j === void 0 ? false : _j, _k = _a.hoverCloseDelay, hoverCloseDelay = _k === void 0 ? 120 : _k, _l = _a.keepMounted, keepMounted = _l === void 0 ? false : _l, other = tslib_1.__rest(_a, ["children", "component", "position", "arrow", "distance", "removeWhenClickInside", "hideBackdrop", "fade", "arrowColor", "hover", "hoverCloseDelay", "keepMounted"]);
|
|
15
|
+
var refComponent = (0, react_1.useRef)(null);
|
|
16
|
+
var closeTimer = (0, react_1.useRef)(null);
|
|
17
|
+
var hoverCloseTimer = (0, react_1.useRef)(null);
|
|
18
|
+
var popoverRef = (0, react_1.useRef)(null);
|
|
19
|
+
var rootRef = (0, react_1.useRef)(null);
|
|
20
|
+
var zIndexRef = (0, react_1.useRef)(null);
|
|
21
|
+
(0, react_1.useEffect)(function () {
|
|
19
22
|
if (typeof window === 'undefined')
|
|
20
23
|
return;
|
|
21
24
|
return function () {
|
|
@@ -38,13 +41,13 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
38
41
|
if (popoverRef.current && keepMounted) {
|
|
39
42
|
var popover_1 = popoverRef.current;
|
|
40
43
|
var target_1 = e.currentTarget;
|
|
41
|
-
var wasVisible = popover_1.classList.contains(
|
|
44
|
+
var wasVisible = popover_1.classList.contains(index_module_css_1.default.visible);
|
|
42
45
|
(_b = (_a = rootRef.current) === null || _a === void 0 ? void 0 : _a.render) === null || _b === void 0 ? void 0 : _b.call(_a, children);
|
|
43
46
|
applyArrowColor(popover_1);
|
|
44
47
|
popoverPosition({ target: target_1, position: position });
|
|
45
48
|
popover_1.style.zIndex = String(nextPopoverZIndex());
|
|
46
|
-
popover_1.classList.remove(
|
|
47
|
-
popover_1.classList.add(
|
|
49
|
+
popover_1.classList.remove(index_module_css_1.default.closing);
|
|
50
|
+
popover_1.classList.add(index_module_css_1.default.visible);
|
|
48
51
|
if (!wasVisible) {
|
|
49
52
|
if (hideBackdrop) {
|
|
50
53
|
window.addEventListener('mousedown', checkHideBackDrop);
|
|
@@ -62,12 +65,12 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
62
65
|
}
|
|
63
66
|
popoverSil(false);
|
|
64
67
|
var popover = document.createElement('div');
|
|
65
|
-
popover.classList.add('spopover',
|
|
68
|
+
popover.classList.add('spopover', index_module_css_1.default.popover);
|
|
66
69
|
var zIndex = nextPopoverZIndex();
|
|
67
70
|
zIndexRef.current = zIndex;
|
|
68
71
|
document.body.appendChild(popover);
|
|
69
72
|
// ReactDOM.render(children, popover)
|
|
70
|
-
var root = createRoot(popover);
|
|
73
|
+
var root = (0, client_1.createRoot)(popover);
|
|
71
74
|
root.render(children);
|
|
72
75
|
popoverRef.current = popover;
|
|
73
76
|
rootRef.current = root;
|
|
@@ -78,7 +81,7 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
78
81
|
applyArrowColor(popover);
|
|
79
82
|
popoverPosition({ target: target, position: position });
|
|
80
83
|
popover.style.zIndex = String((_a = zIndexRef.current) !== null && _a !== void 0 ? _a : zIndex);
|
|
81
|
-
popover.classList.add(
|
|
84
|
+
popover.classList.add(index_module_css_1.default.visible);
|
|
82
85
|
}, 100);
|
|
83
86
|
if (hideBackdrop) {
|
|
84
87
|
window.addEventListener('mousedown', checkHideBackDrop);
|
|
@@ -96,7 +99,7 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
96
99
|
if (animate === void 0) { animate = true; }
|
|
97
100
|
refComponent.current && refComponent.current.classList.remove('spopover_active');
|
|
98
101
|
var check = popoverRef.current;
|
|
99
|
-
var wasVisible = !!(check === null || check === void 0 ? void 0 : check.classList.contains(
|
|
102
|
+
var wasVisible = !!(check === null || check === void 0 ? void 0 : check.classList.contains(index_module_css_1.default.visible));
|
|
100
103
|
if (check) {
|
|
101
104
|
if (removeWhenClickInside)
|
|
102
105
|
check.removeEventListener('mouseup', popoverGecikmeliSil);
|
|
@@ -120,12 +123,12 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
120
123
|
rootRef.current = null;
|
|
121
124
|
}
|
|
122
125
|
else {
|
|
123
|
-
check.classList.remove(
|
|
124
|
-
check.classList.remove(
|
|
126
|
+
check.classList.remove(index_module_css_1.default.visible);
|
|
127
|
+
check.classList.remove(index_module_css_1.default.closing);
|
|
125
128
|
}
|
|
126
129
|
}
|
|
127
|
-
else if (!check.classList.contains(
|
|
128
|
-
check.classList.add(
|
|
130
|
+
else if (!check.classList.contains(index_module_css_1.default.closing)) {
|
|
131
|
+
check.classList.add(index_module_css_1.default.closing);
|
|
129
132
|
closeTimer.current = window.setTimeout(function () {
|
|
130
133
|
var _a;
|
|
131
134
|
if (!keepMounted) {
|
|
@@ -136,8 +139,8 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
136
139
|
rootRef.current = null;
|
|
137
140
|
}
|
|
138
141
|
else {
|
|
139
|
-
check.classList.remove(
|
|
140
|
-
check.classList.remove(
|
|
142
|
+
check.classList.remove(index_module_css_1.default.visible);
|
|
143
|
+
check.classList.remove(index_module_css_1.default.closing);
|
|
141
144
|
}
|
|
142
145
|
}, FADE_DURATION);
|
|
143
146
|
}
|
|
@@ -197,7 +200,7 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
197
200
|
alignClass = resolvedAlign;
|
|
198
201
|
style.push('top:' + top_1 + 'px');
|
|
199
202
|
}
|
|
200
|
-
var classNames = ['spopover',
|
|
203
|
+
var classNames = ['spopover', index_module_css_1.default.popover, arrow ? index_module_css_1.default.arrow : '', fade ? '' : index_module_css_1.default.noFade, sideClass[side], alignClassMap[alignClass]].filter(Boolean);
|
|
201
204
|
popover.className = classNames.join(' ');
|
|
202
205
|
popover.setAttribute('style', style.join(';'));
|
|
203
206
|
applyArrowColor(popover);
|
|
@@ -248,7 +251,7 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
248
251
|
body.dataset.spopoverZIndex = String(next);
|
|
249
252
|
return next;
|
|
250
253
|
}
|
|
251
|
-
var componentProps = __assign({ ref: refComponent, onClick: function (e) {
|
|
254
|
+
var componentProps = tslib_1.__assign({ ref: refComponent, onClick: function (e) {
|
|
252
255
|
var _a, _b;
|
|
253
256
|
(_b = (_a = component.props) === null || _a === void 0 ? void 0 : _a.onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
254
257
|
popoverEkle(e);
|
|
@@ -266,18 +269,18 @@ export var Popover = memo(function MemoFunction(_a) {
|
|
|
266
269
|
scheduleHoverClose();
|
|
267
270
|
};
|
|
268
271
|
}
|
|
269
|
-
return cloneElement(component, componentProps);
|
|
272
|
+
return (0, react_1.cloneElement)(component, componentProps);
|
|
270
273
|
});
|
|
271
274
|
var sideClass = {
|
|
272
|
-
top:
|
|
273
|
-
bottom:
|
|
274
|
-
left:
|
|
275
|
-
right:
|
|
275
|
+
top: index_module_css_1.default.top,
|
|
276
|
+
bottom: index_module_css_1.default.bottom,
|
|
277
|
+
left: index_module_css_1.default.left,
|
|
278
|
+
right: index_module_css_1.default.right
|
|
276
279
|
};
|
|
277
280
|
var alignClassMap = {
|
|
278
|
-
start:
|
|
279
|
-
center:
|
|
280
|
-
end:
|
|
281
|
+
start: index_module_css_1.default.alignStart,
|
|
282
|
+
center: index_module_css_1.default.alignCenter,
|
|
283
|
+
end: index_module_css_1.default.alignEnd
|
|
281
284
|
};
|
|
282
285
|
var FADE_DURATION = 160;
|
|
283
286
|
var normalizePosition = function (position) {
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Tooltip = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
exports.Tooltip = (0, react_1.memo)(function MemoFunction(_a) {
|
|
7
|
+
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 = tslib_1.__rest(_a, ["children", "title", "position", "arrow", "distance"]);
|
|
8
|
+
(0, react_1.useEffect)(function () {
|
|
6
9
|
if (typeof window === "undefined")
|
|
7
10
|
return null;
|
|
8
11
|
var cssCheck = document.getElementsByClassName("stooltip_css")[0];
|
|
@@ -114,6 +117,6 @@ export var Tooltip = memo(function MemoFunction(_a) {
|
|
|
114
117
|
tooltip.setAttribute("style", style.join(";"));
|
|
115
118
|
}
|
|
116
119
|
};
|
|
117
|
-
return
|
|
120
|
+
return react_1.default.cloneElement(children, tslib_1.__assign({ onMouseEnter: tooltipEkle, onMouseLeave: tooltipSil, onMouseDown: tooltipSil }, other));
|
|
118
121
|
});
|
|
119
122
|
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";
|
package/package.json
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sydsoft/base",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.53.0",
|
|
5
5
|
"description": "",
|
|
6
|
-
"main": "./_dist/
|
|
7
|
-
"
|
|
8
|
-
"types": "./_dist/esm/index.d.ts",
|
|
6
|
+
"main": "./_dist/index.js",
|
|
7
|
+
"types": "./_dist/index.d.ts",
|
|
9
8
|
"files": [
|
|
10
9
|
"./_dist/",
|
|
11
10
|
"README.md"
|
|
12
11
|
],
|
|
13
12
|
"exports": {
|
|
14
13
|
".": {
|
|
15
|
-
"types": "./_dist/
|
|
16
|
-
"default": "./_dist/
|
|
14
|
+
"types": "./_dist/index.d.ts",
|
|
15
|
+
"default": "./_dist/index.js"
|
|
17
16
|
}
|
|
18
17
|
},
|
|
19
18
|
"scripts": {
|
|
20
19
|
"clean": "rm -rf ./_dist",
|
|
21
|
-
"copyFiles": "find . -name \"*.css\" -not -path \"./_dist/*\" -exec sh -c 'for f do mkdir -p \"_dist
|
|
20
|
+
"copyFiles": "find . -name \"*.css\" -not -path \"./_dist/*\" -exec sh -c 'for f do mkdir -p \"_dist/$(dirname \"$f\")\"; cp \"$f\" \"_dist/$f\"; done' sh {} +",
|
|
22
21
|
"build": "npm run clean && tsc && npm run copyFiles",
|
|
23
22
|
"publishNPM": "npm run build && npm version patch && npm version minor && npm publish --dry-run && npm publish --access public && npm run clean"
|
|
24
23
|
},
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import nookies, { destroyCookie, parseCookies, setCookie } from 'nookies';
|
|
3
|
-
import { getDomain } from '../baseFunctions';
|
|
4
|
-
export var cerezOku = function (context, key) {
|
|
5
|
-
if (context === void 0) { context = null; }
|
|
6
|
-
var cookies = context ? nookies.get(context) : parseCookies();
|
|
7
|
-
return cookies[key] || false;
|
|
8
|
-
};
|
|
9
|
-
export var cerezKaydet = function (context, key, value, time) {
|
|
10
|
-
if (context === void 0) { context = null; }
|
|
11
|
-
if (time === void 0) { time = 0; }
|
|
12
|
-
var newConfig = checkDomain(context);
|
|
13
|
-
setCookie(context, key, value, __assign({ maxAge: time > 0 ? time : null }, newConfig));
|
|
14
|
-
};
|
|
15
|
-
export var cerezSil = function (context, key) {
|
|
16
|
-
if (context === void 0) { context = null; }
|
|
17
|
-
var newConfig = checkDomain(context);
|
|
18
|
-
destroyCookie(context, key, newConfig);
|
|
19
|
-
};
|
|
20
|
-
export var cerezTumuSil = function (context) {
|
|
21
|
-
if (context === void 0) { context = null; }
|
|
22
|
-
var cookies = parseCookies(context);
|
|
23
|
-
if (cookies) {
|
|
24
|
-
Object.keys(cookies).forEach(function (key) {
|
|
25
|
-
destroyCookie(context, key);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var checkDomain = function (context, config) {
|
|
30
|
-
if (context === void 0) { context = null; }
|
|
31
|
-
if (config === void 0) { config = {}; }
|
|
32
|
-
var cookieDomain = getDomain(context);
|
|
33
|
-
return __assign(__assign({}, config), { domain: '.' + cookieDomain, path: '/' });
|
|
34
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { decData, encData } from './encData';
|
|
2
|
-
import { isDev } from '../baseFunctions';
|
|
3
|
-
var storageAvailable = typeof Storage === 'undefined' || !window.localStorage ? false : true;
|
|
4
|
-
export var setLocalStorage = function (key, value) {
|
|
5
|
-
if (!storageAvailable)
|
|
6
|
-
return false;
|
|
7
|
-
try {
|
|
8
|
-
localStorage.setItem(key, encData(value));
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
catch (e) {
|
|
12
|
-
isDev && console.log('ERROR => localStorage =>', e);
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
export var getLocalStorage = function (key) {
|
|
17
|
-
if (!storageAvailable)
|
|
18
|
-
return false;
|
|
19
|
-
try {
|
|
20
|
-
var saved = localStorage.getItem(key);
|
|
21
|
-
return saved ? decData(saved) : null;
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
isDev && console.log('ERROR => localStorage =>', e);
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export var removeLocalStorage = function (key) {
|
|
29
|
-
if (!storageAvailable)
|
|
30
|
-
return false;
|
|
31
|
-
try {
|
|
32
|
-
localStorage.removeItem(key);
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
isDev && console.log('ERROR => localStorage =>', e);
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
export var clearLocalStorage = function () {
|
|
41
|
-
if (!storageAvailable)
|
|
42
|
-
return false;
|
|
43
|
-
try {
|
|
44
|
-
localStorage.clear();
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
catch (e) {
|
|
48
|
-
isDev && console.log('ERROR => localStorage =>', e);
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
// Tüm localStorage anahtarlarını getir
|
|
53
|
-
export var getLocalStorageAllKeys = function () {
|
|
54
|
-
if (!storageAvailable)
|
|
55
|
-
return [];
|
|
56
|
-
return Object.keys(localStorage);
|
|
57
|
-
};
|
|
58
|
-
// Tüm localStorage boyutunu getir
|
|
59
|
-
export var getLocalStorageSize = function () {
|
|
60
|
-
if (!storageAvailable)
|
|
61
|
-
return 0;
|
|
62
|
-
var total = 0;
|
|
63
|
-
for (var key in localStorage) {
|
|
64
|
-
if (localStorage.hasOwnProperty(key)) {
|
|
65
|
-
total += localStorage[key].length + key.length;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return total;
|
|
69
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { decData, encData } from "./encData";
|
|
2
|
-
import { isDev } from "../baseFunctions";
|
|
3
|
-
var storageAvailable = typeof Storage === "undefined" || !window.sessionStorage ? false : true;
|
|
4
|
-
export var setSessionStorage = function (key, value) {
|
|
5
|
-
if (!storageAvailable)
|
|
6
|
-
return false;
|
|
7
|
-
try {
|
|
8
|
-
sessionStorage.setItem(key, encData(value));
|
|
9
|
-
return true;
|
|
10
|
-
}
|
|
11
|
-
catch (e) {
|
|
12
|
-
isDev && console.log("ERROR => SessionStorage =>", e);
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
export var getSessionStorage = function (key) {
|
|
17
|
-
if (!storageAvailable)
|
|
18
|
-
return false;
|
|
19
|
-
try {
|
|
20
|
-
var saved = sessionStorage.getItem(key);
|
|
21
|
-
return saved ? decData(saved) : null;
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
isDev && console.log("ERROR => SessionStorage =>", e);
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
export var removeSessionStorage = function (key) {
|
|
29
|
-
if (!storageAvailable)
|
|
30
|
-
return false;
|
|
31
|
-
try {
|
|
32
|
-
sessionStorage.removeItem(key);
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
isDev && console.log("ERROR => SessionStorage =>", e);
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
export var clearSessionStorage = function () {
|
|
41
|
-
if (!storageAvailable)
|
|
42
|
-
return false;
|
|
43
|
-
try {
|
|
44
|
-
sessionStorage.clear();
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
catch (e) {
|
|
48
|
-
isDev && console.log("ERROR => SessionStorage =>", e);
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
// Tüm SessionStorage anahtarlarını getir
|
|
53
|
-
export var getSessionStorageAllKeys = function () {
|
|
54
|
-
if (!storageAvailable)
|
|
55
|
-
return [];
|
|
56
|
-
return Object.keys(sessionStorage);
|
|
57
|
-
};
|
|
58
|
-
// Tüm SessionStorage boyutunu getir
|
|
59
|
-
export var getSessionStorageSize = function () {
|
|
60
|
-
if (!storageAvailable)
|
|
61
|
-
return 0;
|
|
62
|
-
var total = 0;
|
|
63
|
-
for (var key in sessionStorage) {
|
|
64
|
-
if (sessionStorage.hasOwnProperty(key)) {
|
|
65
|
-
total += sessionStorage[key].length + key.length;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return total;
|
|
69
|
-
};
|
package/_dist/esm/box/Box.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useEffect, useRef, useState } from "react";
|
|
3
|
-
import styles from "./Box.module.css";
|
|
4
|
-
export var Box = memo(function MemoFunction(_a) {
|
|
5
|
-
var children = _a.children, className = _a.className, style = _a.style, _b = _a.loading, loading = _b === void 0 ? false : _b;
|
|
6
|
-
var boxRef = useRef(null);
|
|
7
|
-
var _c = useState(false), hasContent = _c[0], setHasContent = _c[1];
|
|
8
|
-
useEffect(function () {
|
|
9
|
-
if (!boxRef.current)
|
|
10
|
-
return;
|
|
11
|
-
var found = boxRef.current.querySelector(".sbox_content");
|
|
12
|
-
setHasContent(!!found);
|
|
13
|
-
}, [children]);
|
|
14
|
-
return (_jsxs("div", { ref: boxRef, className: "sbox ".concat(styles.sbox, " ").concat(className || ""), style: style, children: [(hasContent && children) || _jsx("div", { className: styles.content, children: children }), loading && (_jsx("div", { className: styles.loading, children: _jsx("div", { className: styles.loading_spinner }) }))] }));
|
|
15
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import styles from "./Box.module.css";
|
|
4
|
-
export var BoxContent = function (_a) {
|
|
5
|
-
var className = _a.className, style = _a.style, padding = _a.padding, children = _a.children;
|
|
6
|
-
return (_jsx("div", { className: "".concat(styles.content, " sbox_content ").concat(className || ""), style: __assign(__assign({}, style), { padding: padding }), children: children }));
|
|
7
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { memo } from "react";
|
|
4
|
-
import styles from "./Box.module.css";
|
|
5
|
-
export var BoxFooter = memo(function FunctionMemo(_a) {
|
|
6
|
-
var children = _a.children, className = _a.className, style = _a.style, align = _a.align, marginTop = _a.marginTop;
|
|
7
|
-
return (_jsx("div", { className: "sbox_footer ".concat(styles.footer, " ").concat(className || ""), style: __assign({ marginTop: marginTop, justifyContent: align }, style), children: children }));
|
|
8
|
-
});
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { __assign } from "tslib";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { memo } from 'react';
|
|
4
|
-
import styles from './Box.module.css';
|
|
5
|
-
export var BoxHeader = memo(function FunctionMemo(_a) {
|
|
6
|
-
var children = _a.children, className = _a.className, title = _a.title, icon = _a.icon, menu = _a.menu, mainStyle = _a.mainStyle, iconStyle = _a.iconStyle, titleStyle = _a.titleStyle, menuStyle = _a.menuStyle, marginBottom = _a.marginBottom, _b = _a.component, component = _b === void 0 ? 'div' : _b;
|
|
7
|
-
var Comp = component;
|
|
8
|
-
return (_jsxs("div", { className: "sbox_header ".concat(styles.header, " ").concat(className || ''), style: __assign({ marginBottom: marginBottom }, mainStyle), children: [icon && (_jsx("div", { className: styles.icon, style: iconStyle, children: icon })), _jsx(Comp, { className: "sbox_title ".concat(styles.title), style: titleStyle, children: children || title }), menu && (_jsx("div", { className: styles.menu, style: menuStyle, children: menu }))] }));
|
|
9
|
-
});
|
package/_dist/esm/box/index.js
DELETED
package/_dist/esm/form/Button.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { __assign, __rest } from "tslib";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Dialog } from "./Dialog";
|
|
4
|
-
import { memo, useCallback, useEffect, useState } from "react";
|
|
5
|
-
import { Tooltip } from "../tooltip";
|
|
6
|
-
import Link from "next/link";
|
|
7
|
-
import styles from "./styles/Button.module.css";
|
|
8
|
-
export var Button = memo(function MemoFunction(_a) {
|
|
9
|
-
var children = _a.children, _b = _a.component, component = _b === void 0 ? "button" : _b, className = _a.className, _c = _a.buttonClass, buttonClass = _c === void 0 ? "default" : _c, _d = _a.buttonSize, buttonSize = _d === void 0 ? "medium" : _d, style = _a.style, _e = _a.type, type = _e === void 0 ? "button" : _e, _f = _a.fullWidth, fullWidth = _f === void 0 ? false : _f, onlyIcon = _a.onlyIcon, onClick = _a.onClick, href = _a.href, target = _a.target, tabIndex = _a.tabIndex, title = _a.title, titlePosition = _a.titlePosition, titleArrow = _a.titleArrow, dialog = _a.dialog, autoFocus = _a.autoFocus, other = __rest(_a, ["children", "component", "className", "buttonClass", "buttonSize", "style", "type", "fullWidth", "onlyIcon", "onClick", "href", "target", "tabIndex", "title", "titlePosition", "titleArrow", "dialog", "autoFocus"]);
|
|
10
|
-
var Comp = component;
|
|
11
|
-
var ripple = function (e) {
|
|
12
|
-
var el = e.currentTarget;
|
|
13
|
-
var circle = document.createElement("span");
|
|
14
|
-
var diameter = Math.max(el.clientWidth, el.clientHeight);
|
|
15
|
-
circle.style.width = circle.style.height = "".concat(diameter, "px");
|
|
16
|
-
circle.classList.add(styles.ripple);
|
|
17
|
-
var ripple = el.getElementsByClassName(styles.ripple)[0];
|
|
18
|
-
if (ripple)
|
|
19
|
-
ripple.remove();
|
|
20
|
-
el.appendChild(circle);
|
|
21
|
-
};
|
|
22
|
-
var handleClick = function (e) {
|
|
23
|
-
ripple(e);
|
|
24
|
-
if (dialog) {
|
|
25
|
-
Dialog(dialog).then(function (result) {
|
|
26
|
-
if (result && onClick) {
|
|
27
|
-
onClick(e);
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
if (onClick)
|
|
33
|
-
onClick(e);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var createClassList = useCallback(function () {
|
|
37
|
-
var list = ["sbutton", styles.button];
|
|
38
|
-
if (buttonClass)
|
|
39
|
-
list.push(styles[buttonClass]);
|
|
40
|
-
if (className)
|
|
41
|
-
list.push(className);
|
|
42
|
-
if (onlyIcon)
|
|
43
|
-
list.push(styles.iconbutton);
|
|
44
|
-
if (fullWidth)
|
|
45
|
-
list.push(styles.fullwidth);
|
|
46
|
-
return list.join(" ");
|
|
47
|
-
}, [buttonClass, className, onlyIcon, fullWidth]);
|
|
48
|
-
var _g = useState(function () { return createClassList(); }), classList = _g[0], setClassList = _g[1];
|
|
49
|
-
useEffect(function () {
|
|
50
|
-
var newClassList = createClassList().split(" ").filter(Boolean);
|
|
51
|
-
if (href && typeof window !== "undefined" && window.location.pathname === href) {
|
|
52
|
-
newClassList.push("active");
|
|
53
|
-
}
|
|
54
|
-
setClassList(newClassList.join(" "));
|
|
55
|
-
}, [href, createClassList]);
|
|
56
|
-
var ortakProps = __assign({ className: classList, style: style, onClick: handleClick, tabIndex: tabIndex, autoFocus: autoFocus, "data-button-size": (!onlyIcon) ? buttonSize : null }, other);
|
|
57
|
-
var renderComponent;
|
|
58
|
-
if (href !== undefined) {
|
|
59
|
-
if (other === null || other === void 0 ? void 0 : other.hidden) {
|
|
60
|
-
renderComponent = null;
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
var checkHref = (other === null || other === void 0 ? void 0 : other.disabled) ? "#" : href;
|
|
64
|
-
renderComponent = (_jsx(Link, { href: checkHref, target: (other === null || other === void 0 ? void 0 : other.disabled) ? "_self" : target, children: _jsx(Comp, __assign({}, ortakProps, { children: onlyIcon ? onlyIcon : children })) }));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
renderComponent = (_jsx(Comp, __assign({ type: type }, ortakProps, { children: onlyIcon ? onlyIcon : children })));
|
|
69
|
-
}
|
|
70
|
-
if (title && renderComponent) {
|
|
71
|
-
return (_jsx(Tooltip, { title: title, position: titlePosition, arrow: titleArrow, children: renderComponent }));
|
|
72
|
-
}
|
|
73
|
-
else {
|
|
74
|
-
return renderComponent;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import styles from "./styles/Input.module.css";
|
|
4
|
-
export var Checkbox = function (_a) {
|
|
5
|
-
var ref = _a.ref, children = _a.children, name = _a.name, label = _a.label, checked = _a.checked, className = _a.className, style = _a.style, styleCheckbox = _a.styleCheckbox, styleLabel = _a.styleLabel, onToogle = _a.onToogle, disabled = _a.disabled, tabIndex = _a.tabIndex, _b = _a.required, required = _b === void 0 ? false : _b;
|
|
6
|
-
var refMain = useRef(null);
|
|
7
|
-
// checked değerini boolean hâline getiriyoruz
|
|
8
|
-
var isChecked = checked === "1" || checked === true;
|
|
9
|
-
var handleChange = function (newChecked) {
|
|
10
|
-
if (disabled)
|
|
11
|
-
return;
|
|
12
|
-
onToogle === null || onToogle === void 0 ? void 0 : onToogle({
|
|
13
|
-
target: {
|
|
14
|
-
name: name,
|
|
15
|
-
value: newChecked ? "1" : "0"
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
var toggleCheck = function () {
|
|
20
|
-
handleChange(!isChecked);
|
|
21
|
-
};
|
|
22
|
-
return (_jsxs("div", { ref: refMain, className: "".concat(styles.checkbox, " ").concat(className || ""), style: style, tabIndex: tabIndex, onClick: toggleCheck, children: [_jsx("input", { ref: ref, type: "checkbox", name: name, onChange: function (e) { return handleChange(e.target.checked); }, checked: isChecked, required: required, style: styleCheckbox, disabled: disabled }), label && _jsx("label", { style: styleLabel, children: label }), children && _jsx("div", { children: children })] }));
|
|
23
|
-
};
|