@sydsoft/base 1.44.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 (48) 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 -68
  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 +19 -21
  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.d.ts +7 -6
  20. package/dist/esm/form/Dialog.js +51 -38
  21. package/dist/esm/form/Form.js +3 -5
  22. package/dist/esm/form/FormOlustur.js +15 -17
  23. package/dist/esm/form/Input.d.ts +12 -7
  24. package/dist/esm/form/Input.js +68 -77
  25. package/dist/esm/form/Label.d.ts +1 -1
  26. package/dist/esm/form/Label.js +5 -10
  27. package/dist/esm/form/SearchableInput.js +77 -89
  28. package/dist/esm/form/UploadBase.js +30 -32
  29. package/dist/esm/grid/index.js +40 -41
  30. package/dist/esm/icon/icons.js +1 -1
  31. package/dist/esm/icon/index.js +21 -10
  32. package/dist/esm/index.module.css +89 -0
  33. package/dist/esm/menu/index.d.ts +30 -4
  34. package/dist/esm/menu/index.js +32 -14
  35. package/dist/esm/modal/index.js +14 -16
  36. package/dist/esm/popover/index.d.ts +21 -7
  37. package/dist/esm/popover/index.js +320 -119
  38. package/dist/esm/tooltip/index.js +117 -34
  39. package/package.json +12 -6
  40. package/dist/esm/alert/index.module.css +0 -119
  41. package/dist/esm/grid/index.module.css +0 -805
  42. package/dist/esm/menu/index.module.css +0 -67
  43. package/dist/esm/modal/index.module.css +0 -76
  44. /package/dist/esm/{box/Box.module.css → Box.module.css} +0 -0
  45. /package/dist/esm/{form/styles → styles}/Button.module.css +0 -0
  46. /package/dist/esm/{form/styles → styles}/Input.module.css +0 -0
  47. /package/dist/esm/{form/styles → styles}/Label.module.css +0 -0
  48. /package/dist/esm/{form/styles → styles}/SearchableInput.module.css +0 -0
package/README.md CHANGED
@@ -13,4 +13,11 @@ global.css içinde .sbox, .sbox_header ve .sbox_footer ile müdahale edilebilir.
13
13
 
14
14
 
15
15
  # Grid
16
- <DevelopGridComponent>
16
+ <DevelopGridComponent>
17
+
18
+
19
+
20
+
21
+
22
+ # Test
23
+ 123
@@ -1,19 +1,12 @@
1
- export var isDev = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
2
- export 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')); };
3
- export var sleep = function (ms) {
4
- if (ms === void 0) { ms = 1000; }
5
- return new Promise(function (resolve) { return setTimeout(resolve, ms); });
6
- };
7
- export var padNumber = function (num, padLength, padString) {
8
- if (padLength === void 0) { padLength = 2; }
9
- if (padString === void 0) { padString = '0'; }
10
- return String(num).padStart(padLength, padString);
11
- };
1
+ export const isDev = !process.env.NODE_ENV || process.env.NODE_ENV === 'development';
2
+ export const isServerReq = (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')); };
3
+ export const sleep = (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));
4
+ export const padNumber = (num, padLength = 2, padString = '0') => String(num).padStart(padLength, padString);
12
5
  export function inputTumuBuyukCevir(e) {
13
6
  var _a;
14
7
  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
- var start = e.target.selectionStart;
16
- var end = e.target.selectionEnd;
8
+ const start = e.target.selectionStart;
9
+ const end = e.target.selectionEnd;
17
10
  e.target.value = e.target.value.toString().toLocaleUpperCase('tr-TR');
18
11
  e.target.setSelectionRange(start, end);
19
12
  }
@@ -21,18 +14,15 @@ export function inputTumuBuyukCevir(e) {
21
14
  export function inputTumuKucukCevir(e) {
22
15
  var _a;
23
16
  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
- var start = e.target.selectionStart;
25
- var end = e.target.selectionEnd;
17
+ const start = e.target.selectionStart;
18
+ const end = e.target.selectionEnd;
26
19
  e.target.value = e.target.value.toString().toLocaleLowerCase('tr-TR');
27
20
  e.target.setSelectionRange(start, end);
28
21
  }
29
22
  }
30
- export var convertLowerCase = function (text) {
31
- if (text === void 0) { text = ''; }
32
- return text.toString().toLocaleLowerCase('tr-TR');
33
- };
34
- export var convertForSearch = function (value) {
35
- var data = value === null || value === void 0 ? void 0 : value.toString().toLocaleLowerCase('tr-TR');
23
+ export const convertLowerCase = (text = '') => text.toString().toLocaleLowerCase('tr-TR');
24
+ export const convertForSearch = (value) => {
25
+ let data = value === null || value === void 0 ? void 0 : value.toString().toLocaleLowerCase('tr-TR');
36
26
  data = data.replace(/ö/g, 'o');
37
27
  data = data.replace(/ç/g, 'c');
38
28
  data = data.replace(/ş/g, 's');
@@ -46,12 +36,12 @@ export var convertForSearch = function (value) {
46
36
  export function convertForSEO(e) {
47
37
  var _a;
48
38
  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
- var start = e.target.selectionStart;
50
- var end = e.target.selectionEnd;
51
- var string = e.target.value.toString().toLocaleLowerCase('tr');
52
- var turkce = [' ', '-', 'ş', 'Ş', 'ı', 'ü', 'Ü', 'ö', 'Ö', 'ç', 'Ç', 'ş', 'Ş', 'ı', 'ğ', 'Ğ', 'İ', 'ö', 'Ö', 'Ç', 'ç', 'ü', 'Ü', 'â', 'ê', 'Â', '“', '”'];
53
- var duzgun = ['-', '-', 's', 'S', 'i', 'u', 'U', 'o', 'O', 'c', 'C', 's', 'S', 'i', 'g', 'G', 'I', 'o', 'O', 'C', 'c', 'u', 'U', 'a', 'ê', 'a', '', ''];
54
- for (var i = 0; i < turkce.length; i++) {
39
+ const start = e.target.selectionStart;
40
+ const end = e.target.selectionEnd;
41
+ let string = e.target.value.toString().toLocaleLowerCase('tr');
42
+ const turkce = [' ', '-', 'ş', 'Ş', 'ı', 'ü', 'Ü', 'ö', 'Ö', 'ç', 'Ç', 'ş', 'Ş', 'ı', 'ğ', 'Ğ', 'İ', 'ö', 'Ö', 'Ç', 'ç', 'ü', 'Ü', 'â', 'ê', 'Â', '“', '”'];
43
+ const duzgun = ['-', '-', 's', 'S', 'i', 'u', 'U', 'o', 'O', 'c', 'C', 's', 'S', 'i', 'g', 'G', 'I', 'o', 'O', 'C', 'c', 'u', 'U', 'a', 'ê', 'a', '', ''];
44
+ for (let i = 0; i < turkce.length; i++) {
55
45
  string = string.split(turkce[i]).join(duzgun[i]);
56
46
  }
57
47
  string = string.replace(/[^a-z0-9\-_şıüğçİŞĞÜÇ]+/gi, '_');
@@ -62,9 +52,8 @@ export function convertForSEO(e) {
62
52
  e.target.setSelectionRange(start, end);
63
53
  }
64
54
  }
65
- export function getDomain(context) {
66
- if (context === void 0) { context = null; }
67
- var url = '';
55
+ export function getDomain(context = null) {
56
+ let url = '';
68
57
  if (context) {
69
58
  url = context.req.headers.host;
70
59
  }
@@ -72,23 +61,21 @@ export function getDomain(context) {
72
61
  url = window.location.hostname;
73
62
  }
74
63
  if (url.length) {
75
- var parts = url.split('.').reverse();
76
- var cnt = parts.length;
64
+ const parts = url.split('.').reverse();
65
+ const cnt = parts.length;
77
66
  if (cnt >= 3) {
78
67
  // see if the second level domain is a common SLD.
79
68
  if (parts[1].match(/^(com|edu|gov|net|mil|org|nom|co|name|info|biz)$/i)) {
80
- var domain_1 = parts[2] + '.' + parts[1] + '.' + parts[0];
81
- return domain_1.split(':')[0];
69
+ const domain = parts[2] + '.' + parts[1] + '.' + parts[0];
70
+ return domain.split(':')[0];
82
71
  }
83
72
  }
84
- var domain = parts[1] + '.' + parts[0];
73
+ const domain = parts[1] + '.' + parts[0];
85
74
  return domain.split(':')[0];
86
75
  }
87
76
  return url;
88
77
  }
89
- export var uniqueID = function (key, length) {
90
- if (key === void 0) { key = ''; }
91
- if (length === void 0) { length = 16; }
78
+ export const uniqueID = (key = '', length = 16) => {
92
79
  return (key +
93
80
  parseInt(Math.ceil(Math.random() * Date.now())
94
81
  .toPrecision(length)
@@ -1,22 +1,21 @@
1
1
  import { isDev } from "./baseFunctions";
2
2
  // Mask işleme core fonksiyonları
3
- var createMaskCore = function () {
4
- var defaultTranslation = {
3
+ const createMaskCore = () => {
4
+ const defaultTranslation = {
5
5
  "0": { pattern: /\d/ },
6
6
  "9": { pattern: /\d/, optional: true },
7
7
  "#": { pattern: /\d/, recursive: true },
8
8
  A: { pattern: /[a-zA-Z0-9]/ },
9
9
  S: { pattern: /[a-zA-Z]/ },
10
- U: { pattern: /[a-zA-Z]/, transform: function (char) { return char.toUpperCase(); } },
11
- L: { pattern: /[a-zA-Z]/, transform: function (char) { return char.toLowerCase(); } },
10
+ U: { pattern: /[a-zA-Z]/, transform: (char) => char.toUpperCase() },
11
+ L: { pattern: /[a-zA-Z]/, transform: (char) => char.toLowerCase() },
12
12
  X: { pattern: /[0-9a-fA-F]/ }
13
13
  };
14
- var parseMask = function (maskString, translation) {
15
- if (translation === void 0) { translation = defaultTranslation; }
16
- var tokens = [];
17
- var i = 0;
14
+ const parseMask = (maskString, translation = defaultTranslation) => {
15
+ const tokens = [];
16
+ let i = 0;
18
17
  while (i < maskString.length) {
19
- var char = maskString[i];
18
+ const char = maskString[i];
20
19
  if (translation[char]) {
21
20
  tokens.push({
22
21
  type: "input",
@@ -36,27 +35,27 @@ var createMaskCore = function () {
36
35
  }
37
36
  return tokens;
38
37
  };
39
- var applyMask = function (inputValue, maskTokens, reverse) {
40
- if (reverse === void 0) { reverse = false; }
38
+ const applyMask = (inputValue, maskTokens, reverse = false) => {
41
39
  if (!maskTokens.length)
42
40
  return inputValue;
43
- var cleanValue = inputValue.replace(/[^\w\s]/g, "");
41
+ const normalizedValue = inputValue == null ? "" : String(inputValue);
42
+ const cleanValue = normalizedValue.replace(/[^\w\s]/g, "");
44
43
  if (reverse) {
45
44
  return applyReverseMask(cleanValue, maskTokens);
46
45
  }
47
- var result = "";
48
- var valueIndex = 0;
49
- var maskIndex = 0;
46
+ let result = "";
47
+ let valueIndex = 0;
48
+ let maskIndex = 0;
50
49
  while (maskIndex < maskTokens.length && valueIndex < cleanValue.length) {
51
- var token = maskTokens[maskIndex];
50
+ const token = maskTokens[maskIndex];
52
51
  if (token.type === "literal") {
53
52
  result += token.char;
54
53
  maskIndex++;
55
54
  }
56
55
  else {
57
- var char = cleanValue[valueIndex];
56
+ const char = cleanValue[valueIndex];
58
57
  if (token.pattern.test(char)) {
59
- var transformedChar = token.transform ? token.transform(char) : char;
58
+ const transformedChar = token.transform ? token.transform(char) : char;
60
59
  result += transformedChar;
61
60
  valueIndex++;
62
61
  maskIndex++;
@@ -70,7 +69,7 @@ var createMaskCore = function () {
70
69
  }
71
70
  }
72
71
  while (maskIndex < maskTokens.length) {
73
- var token = maskTokens[maskIndex];
72
+ const token = maskTokens[maskIndex];
74
73
  if (token.type === "literal") {
75
74
  result += token.char;
76
75
  }
@@ -81,22 +80,22 @@ var createMaskCore = function () {
81
80
  }
82
81
  return result;
83
82
  };
84
- var applyReverseMask = function (inputValue, maskTokens) {
85
- var reversedMask = maskTokens.slice().reverse();
86
- var reversedValue = inputValue.split("").reverse().join("");
87
- var result = "";
88
- var valueIndex = 0;
89
- var maskIndex = 0;
83
+ const applyReverseMask = (inputValue, maskTokens) => {
84
+ const reversedMask = maskTokens.slice().reverse();
85
+ const reversedValue = inputValue.split("").reverse().join("");
86
+ let result = "";
87
+ let valueIndex = 0;
88
+ let maskIndex = 0;
90
89
  while (maskIndex < reversedMask.length && valueIndex < reversedValue.length) {
91
- var token = reversedMask[maskIndex];
90
+ const token = reversedMask[maskIndex];
92
91
  if (token.type === "literal") {
93
92
  result = token.char + result;
94
93
  maskIndex++;
95
94
  }
96
95
  else {
97
- var char = reversedValue[valueIndex];
96
+ const char = reversedValue[valueIndex];
98
97
  if (token.pattern.test(char)) {
99
- var transformedChar = token.transform ? token.transform(char) : char;
98
+ const transformedChar = token.transform ? token.transform(char) : char;
100
99
  result = transformedChar + result;
101
100
  valueIndex++;
102
101
  maskIndex++;
@@ -111,14 +110,14 @@ var createMaskCore = function () {
111
110
  }
112
111
  return result;
113
112
  };
114
- var getCleanValue = function (maskedValue, maskTokens) {
113
+ const getCleanValue = (maskedValue, maskTokens) => {
115
114
  if (!maskTokens.length)
116
115
  return maskedValue;
117
- var clean = "";
118
- var valueIndex = 0;
119
- var maskIndex = 0;
116
+ let clean = "";
117
+ let valueIndex = 0;
118
+ let maskIndex = 0;
120
119
  while (maskIndex < maskTokens.length && valueIndex < maskedValue.length) {
121
- var token = maskTokens[maskIndex];
120
+ const token = maskTokens[maskIndex];
122
121
  if (token.type === "literal") {
123
122
  if (maskedValue[valueIndex] === token.char) {
124
123
  valueIndex++;
@@ -134,36 +133,35 @@ var createMaskCore = function () {
134
133
  return clean;
135
134
  };
136
135
  return {
137
- parseMask: parseMask,
138
- applyMask: applyMask,
139
- getCleanValue: getCleanValue
136
+ parseMask,
137
+ applyMask,
138
+ getCleanValue
140
139
  };
141
140
  };
142
141
  // Fonksiyonel yaklaşım - herhangi bir input elementine mask uygula
143
- export var applyInputMask = function (inputElement, mask, options) {
144
- if (options === void 0) { options = {}; }
142
+ export const applyInputMask = (inputElement, mask, options = {}) => {
145
143
  if (!inputElement || !mask)
146
144
  return null;
147
- isDev && console.log("Input mask applied:", { inputElement: inputElement, mask: mask, options: options });
148
- 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;
149
- var maskCore = createMaskCore();
150
- var maskTokens = maskCore.parseMask(mask, translation);
151
- var applyMaskToValue = function (inputValue) { return maskCore.applyMask(inputValue, maskTokens, reverse); };
152
- var getCleanValue = function (maskedValue) { return maskCore.getCleanValue(maskedValue, maskTokens); };
153
- var handleInputChange = function (e) {
154
- var inputValue = e.target.value;
155
- var maskedValue = applyMaskToValue(inputValue);
156
- var cleanValue = getCleanValue(maskedValue);
145
+ isDev && console.log("Input mask applied:", { inputElement, mask, options });
146
+ const { translation, reverse = false, clearIfNotMatch = true, selectOnFocus = false, onChange } = options;
147
+ const maskCore = createMaskCore();
148
+ const maskTokens = maskCore.parseMask(mask, translation);
149
+ const applyMaskToValue = (inputValue) => maskCore.applyMask(inputValue, maskTokens, reverse);
150
+ const getCleanValue = (maskedValue) => maskCore.getCleanValue(maskedValue, maskTokens);
151
+ const handleInputChange = (e) => {
152
+ const inputValue = e.target.value;
153
+ const maskedValue = applyMaskToValue(inputValue);
154
+ const cleanValue = getCleanValue(maskedValue);
157
155
  e.target.value = maskedValue;
158
156
  onChange === null || onChange === void 0 ? void 0 : onChange(maskedValue, cleanValue, e);
159
157
  };
160
- var handleKeyDown = function (e) {
161
- var key = e.key, target = e.target;
162
- var cursorStart = target.selectionStart;
163
- var cursorEnd = target.selectionEnd;
158
+ const handleKeyDown = (e) => {
159
+ const { key, target } = e;
160
+ const cursorStart = target.selectionStart;
161
+ const cursorEnd = target.selectionEnd;
164
162
  if (key === "Backspace" || key === "Delete") {
165
163
  e.preventDefault();
166
- var newValue = target.value;
164
+ let newValue = target.value;
167
165
  if (cursorStart !== cursorEnd) {
168
166
  newValue = newValue.substring(0, cursorStart) + newValue.substring(cursorEnd);
169
167
  }
@@ -173,27 +171,27 @@ export var applyInputMask = function (inputElement, mask, options) {
173
171
  else if (key === "Delete" && cursorStart < newValue.length) {
174
172
  newValue = newValue.substring(0, cursorStart) + newValue.substring(cursorStart + 1);
175
173
  }
176
- var maskedValue = applyMaskToValue(newValue);
174
+ const maskedValue = applyMaskToValue(newValue);
177
175
  target.value = maskedValue;
178
- var cleanValue = getCleanValue(maskedValue);
176
+ const cleanValue = getCleanValue(maskedValue);
179
177
  onChange === null || onChange === void 0 ? void 0 : onChange(maskedValue, cleanValue, e);
180
- setTimeout(function () {
181
- var newPos = key === "Backspace" ? Math.max(0, cursorStart - 1) : cursorStart;
178
+ setTimeout(() => {
179
+ const newPos = key === "Backspace" ? Math.max(0, cursorStart - 1) : cursorStart;
182
180
  target.setSelectionRange(newPos, newPos);
183
181
  }, 0);
184
182
  }
185
183
  };
186
- var handleFocus = function (e) {
184
+ const handleFocus = (e) => {
187
185
  if (selectOnFocus) {
188
- setTimeout(function () {
186
+ setTimeout(() => {
189
187
  e.target.select();
190
188
  }, 0);
191
189
  }
192
190
  };
193
- var handleBlur = function (e) {
191
+ const handleBlur = (e) => {
194
192
  if (clearIfNotMatch) {
195
- var cleanValue = getCleanValue(e.target.value);
196
- var expectedLength = maskTokens.filter(function (t) { return t.type === "input" && !t.optional; }).length;
193
+ const cleanValue = getCleanValue(e.target.value);
194
+ const expectedLength = maskTokens.filter((t) => t.type === "input" && !t.optional).length;
197
195
  if (cleanValue.length < expectedLength) {
198
196
  e.target.value = "";
199
197
  onChange === null || onChange === void 0 ? void 0 : onChange("", "", e);
@@ -206,7 +204,7 @@ export var applyInputMask = function (inputElement, mask, options) {
206
204
  inputElement.addEventListener("focus", handleFocus);
207
205
  inputElement.addEventListener("blur", handleBlur);
208
206
  // Cleanup fonksiyonu
209
- var destroy = function () {
207
+ const destroy = () => {
210
208
  inputElement.removeEventListener("input", handleInputChange);
211
209
  inputElement.removeEventListener("keydown", handleKeyDown);
212
210
  inputElement.removeEventListener("focus", handleFocus);
@@ -214,15 +212,15 @@ export var applyInputMask = function (inputElement, mask, options) {
214
212
  };
215
213
  // Utility fonksiyonları
216
214
  return {
217
- destroy: destroy,
218
- setValue: function (value) {
215
+ destroy,
216
+ setValue: (value) => {
219
217
  if (!value)
220
218
  return;
221
- var maskedValue = applyMaskToValue(value || "");
219
+ const maskedValue = applyMaskToValue(value || "");
222
220
  inputElement.value = maskedValue;
223
221
  },
224
- getValue: function () { return inputElement.value; },
225
- getCleanValue: function () { return getCleanValue(inputElement.value); },
222
+ getValue: () => inputElement.value,
223
+ getCleanValue: () => getCleanValue(inputElement.value),
226
224
  applyMask: applyMaskToValue
227
225
  };
228
226
  };
@@ -1,8 +1,7 @@
1
- export var onKeyboardSelection = function (_a) {
2
- 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;
1
+ export const onKeyboardSelection = ({ e, targetElement, itemClass = `item`, selectedClass = "selected", checkByValue, checkByInput, clear }) => {
3
2
  if (!targetElement.current)
4
3
  return null;
5
- var config = {
4
+ const config = {
6
5
  e: e,
7
6
  itemClass: itemClass,
8
7
  selectedClass: selectedClass,
@@ -10,12 +9,12 @@ export var onKeyboardSelection = function (_a) {
10
9
  function selectEnter() {
11
10
  if (!targetElement.current)
12
11
  return null;
13
- var text = targetElement.current.querySelector("".concat(config.itemClass, ".").concat(config.selectedClass));
12
+ const text = targetElement.current.querySelector(`${config.itemClass}.${config.selectedClass}`);
14
13
  if (text) {
15
14
  checkByValue(text.dataset.value);
16
15
  }
17
- else if (targetElement.current.querySelectorAll("".concat(config.itemClass)).length > 0) {
18
- var target = targetElement.current.querySelectorAll("".concat(config.itemClass, ".").concat(config.selectedClass))[0];
16
+ else if (targetElement.current.querySelectorAll(`${config.itemClass}`).length > 0) {
17
+ const target = targetElement.current.querySelectorAll(`${config.itemClass}.${config.selectedClass}`)[0];
19
18
  checkByValue(target.dataset.value);
20
19
  }
21
20
  else {
@@ -25,7 +24,7 @@ export var onKeyboardSelection = function (_a) {
25
24
  function selectFirst() {
26
25
  if (!targetElement.current)
27
26
  return null;
28
- var showList = targetElement.current.querySelectorAll("".concat(config.itemClass));
27
+ const showList = targetElement.current.querySelectorAll(`${config.itemClass}`);
29
28
  if (showList.length > 0) {
30
29
  showList[0].classList.add(config.selectedClass);
31
30
  }
@@ -33,14 +32,14 @@ export var onKeyboardSelection = function (_a) {
33
32
  function selectLast() {
34
33
  if (!targetElement.current)
35
34
  return null;
36
- var showList = targetElement.current.querySelectorAll("".concat(config.itemClass));
35
+ const showList = targetElement.current.querySelectorAll(`${config.itemClass}`);
37
36
  if (showList.length > 0) {
38
37
  showList[showList.length - 1].classList.add(config.selectedClass);
39
38
  }
40
39
  }
41
40
  function selectNext(element) {
42
41
  element.classList.remove(config.selectedClass);
43
- var next = element.nextElementSibling;
42
+ const next = element.nextElementSibling;
44
43
  if (next && next.nodeType !== -1) {
45
44
  if (next.classList.contains("item")) {
46
45
  next.classList.add(config.selectedClass);
@@ -55,7 +54,7 @@ export var onKeyboardSelection = function (_a) {
55
54
  }
56
55
  function selectPrev(element) {
57
56
  element.classList.remove(config.selectedClass);
58
- var next = element.previousElementSibling;
57
+ const next = element.previousElementSibling;
59
58
  if (next && next.nodeType !== -1) {
60
59
  if (next.classList.contains("item")) {
61
60
  next.classList.add(config.selectedClass);
@@ -68,7 +67,7 @@ export var onKeyboardSelection = function (_a) {
68
67
  selectLast();
69
68
  }
70
69
  }
71
- var selected = targetElement.current.querySelector("".concat(config.itemClass, ".").concat(config.selectedClass));
70
+ const selected = targetElement.current.querySelector(`${config.itemClass}.${config.selectedClass}`);
72
71
  if (e.which == 40) {
73
72
  if (selected) {
74
73
  selectNext(selected);
@@ -101,8 +100,8 @@ export var onKeyboardSelection = function (_a) {
101
100
  };
102
101
  export function setScrollListPosition(targetElement) {
103
102
  if (targetElement.current) {
104
- var position = 0;
105
- var text = targetElement.current.querySelector(".selected");
103
+ let position = 0;
104
+ const text = targetElement.current.querySelector(".selected");
106
105
  if (text) {
107
106
  position = text.offsetTop - 35;
108
107
  }
@@ -1,34 +1,33 @@
1
- import { __assign } from "tslib";
2
1
  import nookies, { destroyCookie, parseCookies, setCookie } from 'nookies';
3
2
  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();
3
+ export const cerezOku = (context = null, key) => {
4
+ const cookies = context ? nookies.get(context) : parseCookies();
7
5
  return cookies[key] || false;
8
6
  };
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));
7
+ export const cerezKaydet = (context = null, key, value, time = 0) => {
8
+ const newConfig = checkDomain(context);
9
+ setCookie(context, key, value, {
10
+ maxAge: time > 0 ? time : null,
11
+ ...newConfig
12
+ });
14
13
  };
15
- export var cerezSil = function (context, key) {
16
- if (context === void 0) { context = null; }
17
- var newConfig = checkDomain(context);
14
+ export const cerezSil = (context = null, key) => {
15
+ const newConfig = checkDomain(context);
18
16
  destroyCookie(context, key, newConfig);
19
17
  };
20
- export var cerezTumuSil = function (context) {
21
- if (context === void 0) { context = null; }
22
- var cookies = parseCookies(context);
18
+ export const cerezTumuSil = (context = null) => {
19
+ const cookies = parseCookies(context);
23
20
  if (cookies) {
24
- Object.keys(cookies).forEach(function (key) {
21
+ Object.keys(cookies).forEach((key) => {
25
22
  destroyCookie(context, key);
26
23
  });
27
24
  }
28
25
  };
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: '/' });
26
+ const checkDomain = (context = null, config = {}) => {
27
+ let cookieDomain = getDomain(context);
28
+ return {
29
+ ...config,
30
+ domain: '.' + cookieDomain,
31
+ path: '/'
32
+ };
34
33
  };
@@ -1,39 +1,37 @@
1
- import { isDev } from "@sydsoft/base";
2
- var encDecDataKeys = [3, 5, 8, 11, 15, 22];
3
- export var encData = function (data, keys) {
4
- if (keys === void 0) { keys = encDecDataKeys; }
1
+ import { isDev } from "../baseFunctions";
2
+ const encDecDataKeys = [3, 5, 8, 11, 15, 22];
3
+ export const encData = (data, keys = encDecDataKeys) => {
5
4
  try {
6
- var newJSON = { data: data };
7
- var utf8Data = unescape(encodeURIComponent(JSON.stringify(newJSON))); // Dizeyi UTF-8'e dönüştür
8
- var newData_1 = btoa(utf8Data);
9
- keys.map(function (value) {
10
- var randomChar = String.fromCharCode(Math.floor(Math.random() * (122 - 97 + 1)) + 97);
11
- newData_1 = newData_1.slice(0, value) + randomChar + newData_1.slice(value);
5
+ const newJSON = { data: data };
6
+ const utf8Data = unescape(encodeURIComponent(JSON.stringify(newJSON))); // Dizeyi UTF-8'e dönüştür
7
+ let newData = btoa(utf8Data);
8
+ keys.map((value) => {
9
+ const randomChar = String.fromCharCode(Math.floor(Math.random() * (122 - 97 + 1)) + 97);
10
+ newData = newData.slice(0, value) + randomChar + newData.slice(value);
12
11
  });
13
- return newData_1;
12
+ return newData;
14
13
  }
15
14
  catch (e) {
16
15
  isDev && console.log("ERROR => encData =>", e);
17
16
  return "";
18
17
  }
19
18
  };
20
- export var decData = function (data, keys) {
19
+ export const decData = (data, keys = encDecDataKeys) => {
21
20
  var _a;
22
- if (keys === void 0) { keys = encDecDataKeys; }
23
21
  try {
24
- var decode_1 = data;
25
- keys.map(function (value, index) {
26
- var prevValue = keys[index - 1];
22
+ let decode = data;
23
+ keys.map((value, index) => {
24
+ const prevValue = keys[index - 1];
27
25
  if (!prevValue) {
28
- decode_1 = decode_1.slice(0, value) + decode_1.slice(value + 1);
26
+ decode = decode.slice(0, value) + decode.slice(value + 1);
29
27
  }
30
28
  else {
31
- decode_1 = decode_1.slice(0, value - index) + decode_1.slice(value - index + 1);
29
+ decode = decode.slice(0, value - index) + decode.slice(value - index + 1);
32
30
  }
33
31
  });
34
- var decodedString = atob(decode_1);
35
- var utf8DecodedString = decodeURIComponent(escape(decodedString));
36
- var parse = JSON.parse(utf8DecodedString);
32
+ const decodedString = atob(decode);
33
+ const utf8DecodedString = decodeURIComponent(escape(decodedString));
34
+ const parse = JSON.parse(utf8DecodedString);
37
35
  return (_a = parse === null || parse === void 0 ? void 0 : parse.data) !== null && _a !== void 0 ? _a : "";
38
36
  }
39
37
  catch (e) {
@@ -1,7 +1,7 @@
1
1
  import { decData, encData } from './encData';
2
2
  import { isDev } from '../baseFunctions';
3
- var storageAvailable = typeof Storage === 'undefined' || !window.localStorage ? false : true;
4
- export var setLocalStorage = function (key, value) {
3
+ const storageAvailable = typeof Storage === 'undefined' || !window.localStorage ? false : true;
4
+ export const setLocalStorage = (key, value) => {
5
5
  if (!storageAvailable)
6
6
  return false;
7
7
  try {
@@ -13,11 +13,11 @@ export var setLocalStorage = function (key, value) {
13
13
  return false;
14
14
  }
15
15
  };
16
- export var getLocalStorage = function (key) {
16
+ export const getLocalStorage = (key) => {
17
17
  if (!storageAvailable)
18
18
  return false;
19
19
  try {
20
- var saved = localStorage.getItem(key);
20
+ const saved = localStorage.getItem(key);
21
21
  return saved ? decData(saved) : null;
22
22
  }
23
23
  catch (e) {
@@ -25,7 +25,7 @@ export var getLocalStorage = function (key) {
25
25
  return null;
26
26
  }
27
27
  };
28
- export var removeLocalStorage = function (key) {
28
+ export const removeLocalStorage = (key) => {
29
29
  if (!storageAvailable)
30
30
  return false;
31
31
  try {
@@ -37,7 +37,7 @@ export var removeLocalStorage = function (key) {
37
37
  return false;
38
38
  }
39
39
  };
40
- export var clearLocalStorage = function () {
40
+ export const clearLocalStorage = () => {
41
41
  if (!storageAvailable)
42
42
  return false;
43
43
  try {
@@ -50,17 +50,17 @@ export var clearLocalStorage = function () {
50
50
  }
51
51
  };
52
52
  // Tüm localStorage anahtarlarını getir
53
- export var getLocalStorageAllKeys = function () {
53
+ export const getLocalStorageAllKeys = () => {
54
54
  if (!storageAvailable)
55
55
  return [];
56
56
  return Object.keys(localStorage);
57
57
  };
58
58
  // Tüm localStorage boyutunu getir
59
- export var getLocalStorageSize = function () {
59
+ export const getLocalStorageSize = () => {
60
60
  if (!storageAvailable)
61
61
  return 0;
62
- var total = 0;
63
- for (var key in localStorage) {
62
+ let total = 0;
63
+ for (const key in localStorage) {
64
64
  if (localStorage.hasOwnProperty(key)) {
65
65
  total += localStorage[key].length + key.length;
66
66
  }