@sydsoft/base 1.52.0 → 1.54.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 +9 -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,15 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uniqueID = exports.convertForSearch = exports.convertLowerCase = exports.padNumber = exports.sleep = exports.isServerReq = exports.isDev = void 0;
|
|
4
|
+
exports.inputTumuBuyukCevir = inputTumuBuyukCevir;
|
|
5
|
+
exports.inputTumuKucukCevir = inputTumuKucukCevir;
|
|
6
|
+
exports.convertForSEO = convertForSEO;
|
|
7
|
+
exports.getDomain = getDomain;
|
|
8
|
+
exports.isDev = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
|
|
9
|
+
var isServerReq = function (context) { var _a, _b; return !((_b = (_a = context === null || context === void 0 ? void 0 : context.req) === null || _a === void 0 ? void 0 : _a.url) === null || _b === void 0 ? void 0 : _b.startsWith('/_next')); };
|
|
10
|
+
exports.isServerReq = isServerReq;
|
|
11
|
+
var sleep = function (ms) {
|
|
4
12
|
if (ms === void 0) { ms = 1000; }
|
|
5
13
|
return new Promise(function (resolve) { return setTimeout(resolve, ms); });
|
|
6
14
|
};
|
|
7
|
-
|
|
15
|
+
exports.sleep = sleep;
|
|
16
|
+
var padNumber = function (num, padLength, padString) {
|
|
8
17
|
if (padLength === void 0) { padLength = 2; }
|
|
9
18
|
if (padString === void 0) { padString = '0'; }
|
|
10
19
|
return String(num).padStart(padLength, padString);
|
|
11
20
|
};
|
|
12
|
-
|
|
21
|
+
exports.padNumber = padNumber;
|
|
22
|
+
function inputTumuBuyukCevir(e) {
|
|
13
23
|
var _a;
|
|
14
24
|
if ((e === null || e === void 0 ? void 0 : e.target) && ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.setSelectionRange)) {
|
|
15
25
|
var start = e.target.selectionStart;
|
|
@@ -18,7 +28,7 @@ export function inputTumuBuyukCevir(e) {
|
|
|
18
28
|
e.target.setSelectionRange(start, end);
|
|
19
29
|
}
|
|
20
30
|
}
|
|
21
|
-
|
|
31
|
+
function inputTumuKucukCevir(e) {
|
|
22
32
|
var _a;
|
|
23
33
|
if ((e === null || e === void 0 ? void 0 : e.target) && ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.setSelectionRange)) {
|
|
24
34
|
var start = e.target.selectionStart;
|
|
@@ -27,11 +37,12 @@ export function inputTumuKucukCevir(e) {
|
|
|
27
37
|
e.target.setSelectionRange(start, end);
|
|
28
38
|
}
|
|
29
39
|
}
|
|
30
|
-
|
|
40
|
+
var convertLowerCase = function (text) {
|
|
31
41
|
if (text === void 0) { text = ''; }
|
|
32
42
|
return text.toString().toLocaleLowerCase('tr-TR');
|
|
33
43
|
};
|
|
34
|
-
|
|
44
|
+
exports.convertLowerCase = convertLowerCase;
|
|
45
|
+
var convertForSearch = function (value) {
|
|
35
46
|
var data = value === null || value === void 0 ? void 0 : value.toString().toLocaleLowerCase('tr-TR');
|
|
36
47
|
data = data.replace(/ö/g, 'o');
|
|
37
48
|
data = data.replace(/ç/g, 'c');
|
|
@@ -43,7 +54,8 @@ export var convertForSearch = function (value) {
|
|
|
43
54
|
data = data.replace(/^\s+|\s+$/g, '');
|
|
44
55
|
return data;
|
|
45
56
|
};
|
|
46
|
-
|
|
57
|
+
exports.convertForSearch = convertForSearch;
|
|
58
|
+
function convertForSEO(e) {
|
|
47
59
|
var _a;
|
|
48
60
|
if ((e === null || e === void 0 ? void 0 : e.target) && ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.setSelectionRange)) {
|
|
49
61
|
var start = e.target.selectionStart;
|
|
@@ -62,7 +74,7 @@ export function convertForSEO(e) {
|
|
|
62
74
|
e.target.setSelectionRange(start, end);
|
|
63
75
|
}
|
|
64
76
|
}
|
|
65
|
-
|
|
77
|
+
function getDomain(context) {
|
|
66
78
|
if (context === void 0) { context = null; }
|
|
67
79
|
var url = '';
|
|
68
80
|
if (context) {
|
|
@@ -86,7 +98,7 @@ export function getDomain(context) {
|
|
|
86
98
|
}
|
|
87
99
|
return url;
|
|
88
100
|
}
|
|
89
|
-
|
|
101
|
+
var uniqueID = function (key, length) {
|
|
90
102
|
if (key === void 0) { key = ''; }
|
|
91
103
|
if (length === void 0) { length = 16; }
|
|
92
104
|
return (key +
|
|
@@ -95,3 +107,4 @@ export var uniqueID = function (key, length) {
|
|
|
95
107
|
.toString()
|
|
96
108
|
.replace('.', '')));
|
|
97
109
|
};
|
|
110
|
+
exports.uniqueID = uniqueID;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applyInputMask = void 0;
|
|
4
|
+
var baseFunctions_1 = require("./baseFunctions");
|
|
2
5
|
// Mask işleme core fonksiyonları
|
|
3
6
|
var createMaskCore = function () {
|
|
4
7
|
var defaultTranslation = {
|
|
@@ -141,11 +144,11 @@ var createMaskCore = function () {
|
|
|
141
144
|
};
|
|
142
145
|
};
|
|
143
146
|
// Fonksiyonel yaklaşım - herhangi bir input elementine mask uygula
|
|
144
|
-
|
|
147
|
+
var applyInputMask = function (inputElement, mask, options) {
|
|
145
148
|
if (options === void 0) { options = {}; }
|
|
146
149
|
if (!inputElement || !mask)
|
|
147
150
|
return null;
|
|
148
|
-
isDev && console.log("Input mask applied:", { inputElement: inputElement, mask: mask, options: options });
|
|
151
|
+
baseFunctions_1.isDev && console.log("Input mask applied:", { inputElement: inputElement, mask: mask, options: options });
|
|
149
152
|
var translation = options.translation, _a = options.reverse, reverse = _a === void 0 ? false : _a, _b = options.clearIfNotMatch, clearIfNotMatch = _b === void 0 ? true : _b, _c = options.selectOnFocus, selectOnFocus = _c === void 0 ? false : _c, onChange = options.onChange;
|
|
150
153
|
var maskCore = createMaskCore();
|
|
151
154
|
var maskTokens = maskCore.parseMask(mask, translation);
|
|
@@ -227,3 +230,4 @@ export var applyInputMask = function (inputElement, mask, options) {
|
|
|
227
230
|
applyMask: applyMaskToValue
|
|
228
231
|
};
|
|
229
232
|
};
|
|
233
|
+
exports.applyInputMask = applyInputMask;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.onKeyboardSelection = void 0;
|
|
4
|
+
exports.setScrollListPosition = setScrollListPosition;
|
|
5
|
+
var onKeyboardSelection = function (_a) {
|
|
2
6
|
var e = _a.e, targetElement = _a.targetElement, _b = _a.itemClass, itemClass = _b === void 0 ? "item" : _b, _c = _a.selectedClass, selectedClass = _c === void 0 ? "selected" : _c, checkByValue = _a.checkByValue, checkByInput = _a.checkByInput, clear = _a.clear;
|
|
3
7
|
if (!targetElement.current)
|
|
4
8
|
return null;
|
|
@@ -99,7 +103,8 @@ export var onKeyboardSelection = function (_a) {
|
|
|
99
103
|
}
|
|
100
104
|
setScrollListPosition(targetElement);
|
|
101
105
|
};
|
|
102
|
-
|
|
106
|
+
exports.onKeyboardSelection = onKeyboardSelection;
|
|
107
|
+
function setScrollListPosition(targetElement) {
|
|
103
108
|
if (targetElement.current) {
|
|
104
109
|
var position = 0;
|
|
105
110
|
var text = targetElement.current.querySelector(".selected");
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cerezTumuSil = exports.cerezSil = exports.cerezKaydet = exports.cerezOku = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var nookies_1 = tslib_1.__importStar(require("nookies"));
|
|
6
|
+
var baseFunctions_1 = require("../baseFunctions");
|
|
7
|
+
var cerezOku = function (context, key) {
|
|
8
|
+
if (context === void 0) { context = null; }
|
|
9
|
+
var cookies = context ? nookies_1.default.get(context) : (0, nookies_1.parseCookies)();
|
|
10
|
+
return cookies[key] || false;
|
|
11
|
+
};
|
|
12
|
+
exports.cerezOku = cerezOku;
|
|
13
|
+
var cerezKaydet = function (context, key, value, time) {
|
|
14
|
+
if (context === void 0) { context = null; }
|
|
15
|
+
if (time === void 0) { time = 0; }
|
|
16
|
+
var newConfig = checkDomain(context);
|
|
17
|
+
(0, nookies_1.setCookie)(context, key, value, tslib_1.__assign({ maxAge: time > 0 ? time : null }, newConfig));
|
|
18
|
+
};
|
|
19
|
+
exports.cerezKaydet = cerezKaydet;
|
|
20
|
+
var cerezSil = function (context, key) {
|
|
21
|
+
if (context === void 0) { context = null; }
|
|
22
|
+
var newConfig = checkDomain(context);
|
|
23
|
+
(0, nookies_1.destroyCookie)(context, key, newConfig);
|
|
24
|
+
};
|
|
25
|
+
exports.cerezSil = cerezSil;
|
|
26
|
+
var cerezTumuSil = function (context) {
|
|
27
|
+
if (context === void 0) { context = null; }
|
|
28
|
+
var cookies = (0, nookies_1.parseCookies)(context);
|
|
29
|
+
if (cookies) {
|
|
30
|
+
Object.keys(cookies).forEach(function (key) {
|
|
31
|
+
(0, nookies_1.destroyCookie)(context, key);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
exports.cerezTumuSil = cerezTumuSil;
|
|
36
|
+
var checkDomain = function (context, config) {
|
|
37
|
+
if (context === void 0) { context = null; }
|
|
38
|
+
if (config === void 0) { config = {}; }
|
|
39
|
+
var cookieDomain = (0, baseFunctions_1.getDomain)(context);
|
|
40
|
+
return tslib_1.__assign(tslib_1.__assign({}, config), { domain: '.' + cookieDomain, path: '/' });
|
|
41
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decData = exports.encData = void 0;
|
|
4
|
+
var baseFunctions_1 = require("../baseFunctions");
|
|
2
5
|
var encDecDataKeys = [3, 5, 8, 11, 15, 22];
|
|
3
|
-
|
|
6
|
+
var encData = function (data, keys) {
|
|
4
7
|
if (keys === void 0) { keys = encDecDataKeys; }
|
|
5
8
|
try {
|
|
6
9
|
var newJSON = { data: data };
|
|
@@ -13,11 +16,12 @@ export var encData = function (data, keys) {
|
|
|
13
16
|
return newData_1;
|
|
14
17
|
}
|
|
15
18
|
catch (e) {
|
|
16
|
-
isDev && console.log("ERROR => encData =>", e);
|
|
19
|
+
baseFunctions_1.isDev && console.log("ERROR => encData =>", e);
|
|
17
20
|
return "";
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
|
-
|
|
23
|
+
exports.encData = encData;
|
|
24
|
+
var decData = function (data, keys) {
|
|
21
25
|
var _a;
|
|
22
26
|
if (keys === void 0) { keys = encDecDataKeys; }
|
|
23
27
|
try {
|
|
@@ -37,7 +41,8 @@ export var decData = function (data, keys) {
|
|
|
37
41
|
return (_a = parse === null || parse === void 0 ? void 0 : parse.data) !== null && _a !== void 0 ? _a : "";
|
|
38
42
|
}
|
|
39
43
|
catch (e) {
|
|
40
|
-
isDev && console.log("ERROR => decData =>", e);
|
|
44
|
+
baseFunctions_1.isDev && console.log("ERROR => decData =>", e);
|
|
41
45
|
return "";
|
|
42
46
|
}
|
|
43
47
|
};
|
|
48
|
+
exports.decData = decData;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLocalStorageSize = exports.getLocalStorageAllKeys = exports.clearLocalStorage = exports.removeLocalStorage = exports.getLocalStorage = exports.setLocalStorage = void 0;
|
|
4
|
+
var encData_1 = require("./encData");
|
|
5
|
+
var baseFunctions_1 = require("../baseFunctions");
|
|
6
|
+
var storageAvailable = typeof Storage === 'undefined' || !window.localStorage ? false : true;
|
|
7
|
+
var setLocalStorage = function (key, value) {
|
|
8
|
+
if (!storageAvailable)
|
|
9
|
+
return false;
|
|
10
|
+
try {
|
|
11
|
+
localStorage.setItem(key, (0, encData_1.encData)(value));
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
baseFunctions_1.isDev && console.log('ERROR => localStorage =>', e);
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.setLocalStorage = setLocalStorage;
|
|
20
|
+
var getLocalStorage = function (key) {
|
|
21
|
+
if (!storageAvailable)
|
|
22
|
+
return false;
|
|
23
|
+
try {
|
|
24
|
+
var saved = localStorage.getItem(key);
|
|
25
|
+
return saved ? (0, encData_1.decData)(saved) : null;
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
baseFunctions_1.isDev && console.log('ERROR => localStorage =>', e);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.getLocalStorage = getLocalStorage;
|
|
33
|
+
var removeLocalStorage = function (key) {
|
|
34
|
+
if (!storageAvailable)
|
|
35
|
+
return false;
|
|
36
|
+
try {
|
|
37
|
+
localStorage.removeItem(key);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
baseFunctions_1.isDev && console.log('ERROR => localStorage =>', e);
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.removeLocalStorage = removeLocalStorage;
|
|
46
|
+
var clearLocalStorage = function () {
|
|
47
|
+
if (!storageAvailable)
|
|
48
|
+
return false;
|
|
49
|
+
try {
|
|
50
|
+
localStorage.clear();
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
baseFunctions_1.isDev && console.log('ERROR => localStorage =>', e);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.clearLocalStorage = clearLocalStorage;
|
|
59
|
+
// Tüm localStorage anahtarlarını getir
|
|
60
|
+
var getLocalStorageAllKeys = function () {
|
|
61
|
+
if (!storageAvailable)
|
|
62
|
+
return [];
|
|
63
|
+
return Object.keys(localStorage);
|
|
64
|
+
};
|
|
65
|
+
exports.getLocalStorageAllKeys = getLocalStorageAllKeys;
|
|
66
|
+
// Tüm localStorage boyutunu getir
|
|
67
|
+
var getLocalStorageSize = function () {
|
|
68
|
+
if (!storageAvailable)
|
|
69
|
+
return 0;
|
|
70
|
+
var total = 0;
|
|
71
|
+
for (var key in localStorage) {
|
|
72
|
+
if (localStorage.hasOwnProperty(key)) {
|
|
73
|
+
total += localStorage[key].length + key.length;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return total;
|
|
77
|
+
};
|
|
78
|
+
exports.getLocalStorageSize = getLocalStorageSize;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSessionStorageSize = exports.getSessionStorageAllKeys = exports.clearSessionStorage = exports.removeSessionStorage = exports.getSessionStorage = exports.setSessionStorage = void 0;
|
|
4
|
+
var encData_1 = require("./encData");
|
|
5
|
+
var baseFunctions_1 = require("../baseFunctions");
|
|
6
|
+
var storageAvailable = typeof Storage === "undefined" || !window.sessionStorage ? false : true;
|
|
7
|
+
var setSessionStorage = function (key, value) {
|
|
8
|
+
if (!storageAvailable)
|
|
9
|
+
return false;
|
|
10
|
+
try {
|
|
11
|
+
sessionStorage.setItem(key, (0, encData_1.encData)(value));
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
baseFunctions_1.isDev && console.log("ERROR => SessionStorage =>", e);
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.setSessionStorage = setSessionStorage;
|
|
20
|
+
var getSessionStorage = function (key) {
|
|
21
|
+
if (!storageAvailable)
|
|
22
|
+
return false;
|
|
23
|
+
try {
|
|
24
|
+
var saved = sessionStorage.getItem(key);
|
|
25
|
+
return saved ? (0, encData_1.decData)(saved) : null;
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
baseFunctions_1.isDev && console.log("ERROR => SessionStorage =>", e);
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.getSessionStorage = getSessionStorage;
|
|
33
|
+
var removeSessionStorage = function (key) {
|
|
34
|
+
if (!storageAvailable)
|
|
35
|
+
return false;
|
|
36
|
+
try {
|
|
37
|
+
sessionStorage.removeItem(key);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
catch (e) {
|
|
41
|
+
baseFunctions_1.isDev && console.log("ERROR => SessionStorage =>", e);
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.removeSessionStorage = removeSessionStorage;
|
|
46
|
+
var clearSessionStorage = function () {
|
|
47
|
+
if (!storageAvailable)
|
|
48
|
+
return false;
|
|
49
|
+
try {
|
|
50
|
+
sessionStorage.clear();
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
baseFunctions_1.isDev && console.log("ERROR => SessionStorage =>", e);
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.clearSessionStorage = clearSessionStorage;
|
|
59
|
+
// Tüm SessionStorage anahtarlarını getir
|
|
60
|
+
var getSessionStorageAllKeys = function () {
|
|
61
|
+
if (!storageAvailable)
|
|
62
|
+
return [];
|
|
63
|
+
return Object.keys(sessionStorage);
|
|
64
|
+
};
|
|
65
|
+
exports.getSessionStorageAllKeys = getSessionStorageAllKeys;
|
|
66
|
+
// Tüm SessionStorage boyutunu getir
|
|
67
|
+
var getSessionStorageSize = function () {
|
|
68
|
+
if (!storageAvailable)
|
|
69
|
+
return 0;
|
|
70
|
+
var total = 0;
|
|
71
|
+
for (var key in sessionStorage) {
|
|
72
|
+
if (sessionStorage.hasOwnProperty(key)) {
|
|
73
|
+
total += sessionStorage[key].length + key.length;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return total;
|
|
77
|
+
};
|
|
78
|
+
exports.getSessionStorageSize = getSessionStorageSize;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* Copyright (c) 2023
|
|
3
4
|
* @author: izzetseydaoglu
|
|
4
5
|
* @last-modified: 29.01.2024 04:09
|
|
5
6
|
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.useInterval = useInterval;
|
|
6
9
|
// source: https://overreacted.io/making-setinterval-declarative-with-react-hooks/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var savedCallback = useRef(null);
|
|
10
|
+
var react_1 = require("react");
|
|
11
|
+
function useInterval(callback, delay) {
|
|
12
|
+
var savedCallback = (0, react_1.useRef)(null);
|
|
10
13
|
// Remember the latest callback.
|
|
11
|
-
useEffect(function () {
|
|
14
|
+
(0, react_1.useEffect)(function () {
|
|
12
15
|
savedCallback.current = callback;
|
|
13
16
|
}, [callback]);
|
|
14
17
|
// Set up the interval.
|
|
15
|
-
useEffect(function () {
|
|
18
|
+
(0, react_1.useEffect)(function () {
|
|
16
19
|
function tick() {
|
|
17
20
|
savedCallback && savedCallback.current && savedCallback.current();
|
|
18
21
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.alert_clear = exports.alert_remove = exports.alert_add = exports.Alert = void 0;
|
|
4
|
+
exports.alertCheck = alertCheck;
|
|
5
|
+
var tslib_1 = require("tslib");
|
|
6
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
var react_1 = require("react");
|
|
8
|
+
var client_1 = require("react-dom/client");
|
|
9
|
+
var index_module_css_1 = tslib_1.__importDefault(require("./index.module.css"));
|
|
5
10
|
var sAlertTimeout = [];
|
|
6
|
-
|
|
11
|
+
var Alert = function (_a) {
|
|
7
12
|
var _b = _a.defaultTimer, defaultTimer = _b === void 0 ? "5000" : _b, _c = _a.defaultErrorTimer, defaultErrorTimer = _c === void 0 ? "10000" : _c, _d = _a.defaultSuccessTimer, defaultSuccessTimer = _d === void 0 ? "5000" : _d;
|
|
8
|
-
useEffect(function () {
|
|
13
|
+
(0, react_1.useEffect)(function () {
|
|
9
14
|
if (typeof window === "undefined")
|
|
10
15
|
return;
|
|
11
16
|
var divCheck = document.getElementById("salert");
|
|
@@ -34,7 +39,8 @@ export var Alert = function (_a) {
|
|
|
34
39
|
}, []);
|
|
35
40
|
return null;
|
|
36
41
|
};
|
|
37
|
-
|
|
42
|
+
exports.Alert = Alert;
|
|
43
|
+
var alert_add = function (_a) {
|
|
38
44
|
var _b, _c, _d;
|
|
39
45
|
var type = _a.type, message = _a.message, style = _a.style, timer = _a.timer;
|
|
40
46
|
if (typeof window === "undefined")
|
|
@@ -47,8 +53,8 @@ export var alert_add = function (_a) {
|
|
|
47
53
|
if (mainDiv && alert_1 && mainDiv.contains(alert_1))
|
|
48
54
|
mainDiv.removeChild(alert_1);
|
|
49
55
|
};
|
|
50
|
-
var root = createRoot(alert_1);
|
|
51
|
-
var Component = (
|
|
56
|
+
var root = (0, client_1.createRoot)(alert_1);
|
|
57
|
+
var Component = ((0, jsx_runtime_1.jsxs)("div", { className: "".concat(index_module_css_1.default.salert, " ").concat(index_module_css_1.default[type]), style: style, children: [(0, jsx_runtime_1.jsx)("div", { className: index_module_css_1.default.message, dangerouslySetInnerHTML: { __html: message } }), (0, jsx_runtime_1.jsx)("div", { className: index_module_css_1.default.close, onClick: onClose_1, children: "\u2715" })] }));
|
|
52
58
|
root.render(Component);
|
|
53
59
|
var defaultTimer = (_b = mainDiv.getAttribute("defaulttimer")) !== null && _b !== void 0 ? _b : "5000";
|
|
54
60
|
var defaultErrorTimer = (_c = mainDiv.getAttribute("defaulterrortimer")) !== null && _c !== void 0 ? _c : "10000";
|
|
@@ -77,7 +83,8 @@ export var alert_add = function (_a) {
|
|
|
77
83
|
}
|
|
78
84
|
return null;
|
|
79
85
|
};
|
|
80
|
-
|
|
86
|
+
exports.alert_add = alert_add;
|
|
87
|
+
var alert_remove = function (alert) {
|
|
81
88
|
if (typeof window === "undefined" || !alert)
|
|
82
89
|
return;
|
|
83
90
|
var mainDiv = document.getElementById("salert");
|
|
@@ -85,7 +92,8 @@ export var alert_remove = function (alert) {
|
|
|
85
92
|
mainDiv.removeChild(alert);
|
|
86
93
|
return;
|
|
87
94
|
};
|
|
88
|
-
|
|
95
|
+
exports.alert_remove = alert_remove;
|
|
96
|
+
var alert_clear = function () {
|
|
89
97
|
if (typeof window === "undefined")
|
|
90
98
|
return false;
|
|
91
99
|
sAlertTimeout.map(function (id) { return clearTimeout(id); });
|
|
@@ -94,10 +102,11 @@ export var alert_clear = function () {
|
|
|
94
102
|
mainDiv.innerHTML = "";
|
|
95
103
|
return true;
|
|
96
104
|
};
|
|
97
|
-
|
|
105
|
+
exports.alert_clear = alert_clear;
|
|
106
|
+
function alertCheck(response) {
|
|
98
107
|
if (response.data && response.data["alert"]) {
|
|
99
108
|
response.data["alert"].map(function (alert) {
|
|
100
|
-
alert_add({
|
|
109
|
+
(0, exports.alert_add)({
|
|
101
110
|
type: alert.type,
|
|
102
111
|
message: alert.message,
|
|
103
112
|
timer: alert.timer
|
package/_dist/box/Box.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Box = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
|
|
8
|
+
exports.Box = (0, react_1.memo)(function MemoFunction(_a) {
|
|
9
|
+
var children = _a.children, className = _a.className, style = _a.style, _b = _a.loading, loading = _b === void 0 ? false : _b;
|
|
10
|
+
var boxRef = (0, react_1.useRef)(null);
|
|
11
|
+
var _c = (0, react_1.useState)(false), hasContent = _c[0], setHasContent = _c[1];
|
|
12
|
+
(0, react_1.useEffect)(function () {
|
|
13
|
+
if (!boxRef.current)
|
|
14
|
+
return;
|
|
15
|
+
var found = boxRef.current.querySelector(".sbox_content");
|
|
16
|
+
setHasContent(!!found);
|
|
17
|
+
}, [children]);
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", { ref: boxRef, className: "sbox ".concat(Box_module_css_1.default.sbox, " ").concat(className || ""), style: style, children: [(hasContent && children) || (0, jsx_runtime_1.jsx)("div", { className: Box_module_css_1.default.content, children: children }), loading && ((0, jsx_runtime_1.jsx)("div", { className: Box_module_css_1.default.loading, children: (0, jsx_runtime_1.jsx)("div", { className: Box_module_css_1.default.loading_spinner }) }))] }));
|
|
19
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BoxContent = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
|
|
7
|
+
var BoxContent = function (_a) {
|
|
8
|
+
var className = _a.className, style = _a.style, padding = _a.padding, children = _a.children;
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "".concat(Box_module_css_1.default.content, " sbox_content ").concat(className || ""), style: tslib_1.__assign(tslib_1.__assign({}, style), { padding: padding }), children: children }));
|
|
10
|
+
};
|
|
11
|
+
exports.BoxContent = BoxContent;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BoxFooter = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
|
|
8
|
+
exports.BoxFooter = (0, react_1.memo)(function FunctionMemo(_a) {
|
|
9
|
+
var children = _a.children, className = _a.className, style = _a.style, align = _a.align, marginTop = _a.marginTop;
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "sbox_footer ".concat(Box_module_css_1.default.footer, " ").concat(className || ""), style: tslib_1.__assign({ marginTop: marginTop, justifyContent: align }, style), children: children }));
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BoxHeader = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
var react_1 = require("react");
|
|
7
|
+
var Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
|
|
8
|
+
exports.BoxHeader = (0, react_1.memo)(function FunctionMemo(_a) {
|
|
9
|
+
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;
|
|
10
|
+
var Comp = component;
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "sbox_header ".concat(Box_module_css_1.default.header, " ").concat(className || ''), style: tslib_1.__assign({ marginBottom: marginBottom }, mainStyle), children: [icon && ((0, jsx_runtime_1.jsx)("div", { className: Box_module_css_1.default.icon, style: iconStyle, children: icon })), (0, jsx_runtime_1.jsx)(Comp, { className: "sbox_title ".concat(Box_module_css_1.default.title), style: titleStyle, children: children || title }), menu && ((0, jsx_runtime_1.jsx)("div", { className: Box_module_css_1.default.menu, style: menuStyle, children: menu }))] }));
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) 2023
|
|
4
|
+
* @author: izzetseydaoglu
|
|
5
|
+
* @last-modified: 29.01.2024 02:41
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
var tslib_1 = require("tslib");
|
|
9
|
+
tslib_1.__exportStar(require("./Box"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./BoxContent"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./BoxFooter"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./BoxHeader"), exports);
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCountDown = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var react_2 = tslib_1.__importDefault(require("react"));
|
|
7
|
+
var useInterval_1 = require("../_lib/useInterval");
|
|
8
|
+
var useCountDown = function (_a) {
|
|
5
9
|
var _b = _a.autoStart, autoStart = _b === void 0 ? false : _b, onComplete = _a.onComplete, getStatus = _a.getStatus, targetTime = _a.targetTime, _c = _a.timerType, timerType = _c === void 0 ? 'countdown' : _c, _d = _a.countType, countType = _d === void 0 ? 'seconds' : _d, _e = _a.speed, speed = _e === void 0 ? 1000 : _e, hide = _a.hide;
|
|
6
|
-
var refCountDownRender = useRef(null);
|
|
7
|
-
var _f = useState(timerType === 'datetime' || autoStart), enabled = _f[0], setEnabled = _f[1];
|
|
8
|
-
var _g = useState(0), timer = _g[0], setTimer = _g[1];
|
|
9
|
-
var _h = useState(typeof speed === 'number' && speed > 0 ? speed : 1000), timerSpeed = _h[0], setTimerSpeed = _h[1];
|
|
10
|
-
useEffect(function () { return prepareTimer(targetTime); }, [targetTime]);
|
|
11
|
-
useEffect(function () {
|
|
10
|
+
var refCountDownRender = (0, react_1.useRef)(null);
|
|
11
|
+
var _f = (0, react_1.useState)(timerType === 'datetime' || autoStart), enabled = _f[0], setEnabled = _f[1];
|
|
12
|
+
var _g = (0, react_1.useState)(0), timer = _g[0], setTimer = _g[1];
|
|
13
|
+
var _h = (0, react_1.useState)(typeof speed === 'number' && speed > 0 ? speed : 1000), timerSpeed = _h[0], setTimerSpeed = _h[1];
|
|
14
|
+
(0, react_1.useEffect)(function () { return prepareTimer(targetTime); }, [targetTime]);
|
|
15
|
+
(0, react_1.useEffect)(function () {
|
|
12
16
|
if (!hide)
|
|
13
17
|
render();
|
|
14
18
|
}, [timer]);
|
|
15
|
-
useInterval(function () {
|
|
19
|
+
(0, useInterval_1.useInterval)(function () {
|
|
16
20
|
if (enabled) {
|
|
17
21
|
if (timer <= 1) {
|
|
18
22
|
stopCountDown();
|
|
@@ -87,7 +91,7 @@ export var useCountDown = function (_a) {
|
|
|
87
91
|
}
|
|
88
92
|
};
|
|
89
93
|
return {
|
|
90
|
-
ComponentCountDown: function (children) { return (hide ? null :
|
|
94
|
+
ComponentCountDown: function (children) { return (hide ? null : react_2.default.cloneElement(children, { ref: refCountDownRender })); },
|
|
91
95
|
startCountDown: function () { return setEnabled(true); },
|
|
92
96
|
stopCountDown: function () { return setEnabled(false); },
|
|
93
97
|
setTargetTime: function (targetTime) { return prepareTimer(targetTime); },
|
|
@@ -95,3 +99,4 @@ export var useCountDown = function (_a) {
|
|
|
95
99
|
getChildrenRef: function () { return refCountDownRender.current || null; }
|
|
96
100
|
};
|
|
97
101
|
};
|
|
102
|
+
exports.useCountDown = useCountDown;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
3
|
var dateTime = /** @class */ (function () {
|
|
2
4
|
function dateTime(datetime, format) {
|
|
3
5
|
if (datetime === void 0) { datetime = null; }
|
|
@@ -73,4 +75,4 @@ var dateTime = /** @class */ (function () {
|
|
|
73
75
|
};
|
|
74
76
|
return dateTime;
|
|
75
77
|
}());
|
|
76
|
-
|
|
78
|
+
exports.default = dateTime;
|