@sydsoft/base 1.49.0 → 1.51.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 (84) hide show
  1. package/_dist/_lib/baseFunctions.js +24 -11
  2. package/_dist/_lib/inputMask.js +7 -3
  3. package/_dist/_lib/listFunctions.js +7 -2
  4. package/_dist/_lib/storage/cookies.js +20 -12
  5. package/_dist/_lib/storage/encData.js +10 -5
  6. package/_dist/_lib/storage/localStorage.js +23 -14
  7. package/_dist/_lib/storage/sessionStorage.js +23 -14
  8. package/_dist/_lib/useInterval.js +8 -5
  9. package/_dist/alert/index.js +22 -13
  10. package/_dist/box/Box.js +12 -8
  11. package/_dist/box/BoxContent.js +9 -4
  12. package/_dist/box/BoxFooter.js +9 -5
  13. package/_dist/box/BoxHeader.js +10 -6
  14. package/_dist/box/index.js +7 -4
  15. package/_dist/countDown/index.js +17 -12
  16. package/_dist/dateTime/index.js +4 -1
  17. package/_dist/form/Button.js +24 -20
  18. package/_dist/form/Checkbox.js +11 -6
  19. package/_dist/form/Dialog.js +12 -8
  20. package/_dist/form/Form.js +7 -4
  21. package/_dist/form/FormOlustur.js +16 -12
  22. package/_dist/form/Input.js +49 -44
  23. package/_dist/form/Label.js +10 -6
  24. package/_dist/form/SearchableInput.js +47 -43
  25. package/_dist/form/UploadBase.js +16 -11
  26. package/_dist/form/index.js +12 -9
  27. package/_dist/grid/index.js +38 -30
  28. package/_dist/icon/icons.js +10 -7
  29. package/_dist/icon/index.js +13 -9
  30. package/_dist/icon/mui.js +2 -1
  31. package/_dist/index.js +22 -19
  32. package/_dist/menu/index.js +20 -16
  33. package/_dist/modal/index.js +16 -12
  34. package/_dist/popover/index.js +37 -33
  35. package/_dist/tooltip/index.js +8 -4
  36. package/package.json +3 -5
  37. package/_lib/baseFunctions.ts +0 -94
  38. package/_lib/inputMask.ts +0 -257
  39. package/_lib/listFunctions.ts +0 -106
  40. package/_lib/storage/cookies.ts +0 -39
  41. package/_lib/storage/encData.ts +0 -41
  42. package/_lib/storage/localStorage.ts +0 -67
  43. package/_lib/storage/sessionStorage.ts +0 -67
  44. package/_lib/useInterval.ts +0 -30
  45. package/alert/index.module.css +0 -119
  46. package/alert/index.tsx +0 -131
  47. package/box/Box.module.css +0 -153
  48. package/box/Box.tsx +0 -33
  49. package/box/BoxContent.tsx +0 -18
  50. package/box/BoxFooter.tsx +0 -25
  51. package/box/BoxHeader.tsx +0 -46
  52. package/box/index.ts +0 -10
  53. package/countDown/index.tsx +0 -116
  54. package/dateTime/index.ts +0 -79
  55. package/form/Button.tsx +0 -143
  56. package/form/Checkbox.tsx +0 -48
  57. package/form/Dialog.tsx +0 -109
  58. package/form/Form.tsx +0 -19
  59. package/form/FormOlustur.tsx +0 -105
  60. package/form/Input.tsx +0 -364
  61. package/form/Label.tsx +0 -20
  62. package/form/SearchableInput.tsx +0 -406
  63. package/form/UploadBase.tsx +0 -133
  64. package/form/index.ts +0 -10
  65. package/form/styles/Button.module.css +0 -145
  66. package/form/styles/Input.module.css +0 -221
  67. package/form/styles/Label.module.css +0 -31
  68. package/form/styles/SearchableInput.module.css +0 -80
  69. package/global.d.ts +0 -9
  70. package/grid/index.module.css +0 -805
  71. package/grid/index.tsx +0 -171
  72. package/icon/icons.tsx +0 -33
  73. package/icon/index.tsx +0 -95
  74. package/icon/mui.tsx +0 -5932
  75. package/index.ts +0 -21
  76. package/menu/index.module.css +0 -92
  77. package/menu/index.tsx +0 -143
  78. package/modal/index.module.css +0 -77
  79. package/modal/index.tsx +0 -106
  80. package/npm_recovery_codes.txt +0 -5
  81. package/popover/index.module.css +0 -89
  82. package/popover/index.tsx +0 -392
  83. package/tooltip/index.tsx +0 -216
  84. package/tsconfig.json +0 -24
@@ -1,8 +1,18 @@
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);
5
- export function inputTumuBuyukCevir(e) {
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
+ 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')); };
10
+ exports.isServerReq = isServerReq;
11
+ const sleep = (ms = 1000) => new Promise((resolve) => setTimeout(resolve, ms));
12
+ exports.sleep = sleep;
13
+ const padNumber = (num, padLength = 2, padString = '0') => String(num).padStart(padLength, padString);
14
+ exports.padNumber = padNumber;
15
+ function inputTumuBuyukCevir(e) {
6
16
  var _a;
7
17
  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)) {
8
18
  const start = e.target.selectionStart;
@@ -11,7 +21,7 @@ export function inputTumuBuyukCevir(e) {
11
21
  e.target.setSelectionRange(start, end);
12
22
  }
13
23
  }
14
- export function inputTumuKucukCevir(e) {
24
+ function inputTumuKucukCevir(e) {
15
25
  var _a;
16
26
  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)) {
17
27
  const start = e.target.selectionStart;
@@ -20,8 +30,9 @@ export function inputTumuKucukCevir(e) {
20
30
  e.target.setSelectionRange(start, end);
21
31
  }
22
32
  }
23
- export const convertLowerCase = (text = '') => text.toString().toLocaleLowerCase('tr-TR');
24
- export const convertForSearch = (value) => {
33
+ const convertLowerCase = (text = '') => text.toString().toLocaleLowerCase('tr-TR');
34
+ exports.convertLowerCase = convertLowerCase;
35
+ const convertForSearch = (value) => {
25
36
  let data = value === null || value === void 0 ? void 0 : value.toString().toLocaleLowerCase('tr-TR');
26
37
  data = data.replace(/ö/g, 'o');
27
38
  data = data.replace(/ç/g, 'c');
@@ -33,7 +44,8 @@ export const convertForSearch = (value) => {
33
44
  data = data.replace(/^\s+|\s+$/g, '');
34
45
  return data;
35
46
  };
36
- export function convertForSEO(e) {
47
+ exports.convertForSearch = convertForSearch;
48
+ function convertForSEO(e) {
37
49
  var _a;
38
50
  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)) {
39
51
  const start = e.target.selectionStart;
@@ -52,7 +64,7 @@ export function convertForSEO(e) {
52
64
  e.target.setSelectionRange(start, end);
53
65
  }
54
66
  }
55
- export function getDomain(context = null) {
67
+ function getDomain(context = null) {
56
68
  let url = '';
57
69
  if (context) {
58
70
  url = context.req.headers.host;
@@ -75,10 +87,11 @@ export function getDomain(context = null) {
75
87
  }
76
88
  return url;
77
89
  }
78
- export const uniqueID = (key = '', length = 16) => {
90
+ const uniqueID = (key = '', length = 16) => {
79
91
  return (key +
80
92
  parseInt(Math.ceil(Math.random() * Date.now())
81
93
  .toPrecision(length)
82
94
  .toString()
83
95
  .replace('.', '')));
84
96
  };
97
+ exports.uniqueID = uniqueID;
@@ -1,4 +1,7 @@
1
- import { isDev } from "./baseFunctions";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyInputMask = void 0;
4
+ const baseFunctions_1 = require("./baseFunctions");
2
5
  // Mask işleme core fonksiyonları
3
6
  const createMaskCore = () => {
4
7
  const defaultTranslation = {
@@ -139,10 +142,10 @@ const createMaskCore = () => {
139
142
  };
140
143
  };
141
144
  // Fonksiyonel yaklaşım - herhangi bir input elementine mask uygula
142
- export const applyInputMask = (inputElement, mask, options = {}) => {
145
+ const applyInputMask = (inputElement, mask, options = {}) => {
143
146
  if (!inputElement || !mask)
144
147
  return null;
145
- isDev && console.log("Input mask applied:", { inputElement, mask, options });
148
+ baseFunctions_1.isDev && console.log("Input mask applied:", { inputElement, mask, options });
146
149
  const { translation, reverse = false, clearIfNotMatch = true, selectOnFocus = false, onChange } = options;
147
150
  const maskCore = createMaskCore();
148
151
  const maskTokens = maskCore.parseMask(mask, translation);
@@ -224,3 +227,4 @@ export const applyInputMask = (inputElement, mask, options = {}) => {
224
227
  applyMask: applyMaskToValue
225
228
  };
226
229
  };
230
+ exports.applyInputMask = applyInputMask;
@@ -1,4 +1,8 @@
1
- export const onKeyboardSelection = ({ e, targetElement, itemClass = `item`, selectedClass = "selected", checkByValue, checkByInput, clear }) => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.onKeyboardSelection = void 0;
4
+ exports.setScrollListPosition = setScrollListPosition;
5
+ const onKeyboardSelection = ({ e, targetElement, itemClass = `item`, selectedClass = "selected", checkByValue, checkByInput, clear }) => {
2
6
  if (!targetElement.current)
3
7
  return null;
4
8
  const config = {
@@ -98,7 +102,8 @@ export const onKeyboardSelection = ({ e, targetElement, itemClass = `item`, sele
98
102
  }
99
103
  setScrollListPosition(targetElement);
100
104
  };
101
- export function setScrollListPosition(targetElement) {
105
+ exports.onKeyboardSelection = onKeyboardSelection;
106
+ function setScrollListPosition(targetElement) {
102
107
  if (targetElement.current) {
103
108
  let position = 0;
104
109
  const text = targetElement.current.querySelector(".selected");
@@ -1,30 +1,38 @@
1
- import nookies, { destroyCookie, parseCookies, setCookie } from 'nookies';
2
- import { getDomain } from '../baseFunctions';
3
- export const cerezOku = (context = null, key) => {
4
- const cookies = context ? nookies.get(context) : parseCookies();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cerezTumuSil = exports.cerezSil = exports.cerezKaydet = exports.cerezOku = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const nookies_1 = tslib_1.__importStar(require("nookies"));
6
+ const baseFunctions_1 = require("../baseFunctions");
7
+ const cerezOku = (context = null, key) => {
8
+ const cookies = context ? nookies_1.default.get(context) : (0, nookies_1.parseCookies)();
5
9
  return cookies[key] || false;
6
10
  };
7
- export const cerezKaydet = (context = null, key, value, time = 0) => {
11
+ exports.cerezOku = cerezOku;
12
+ const cerezKaydet = (context = null, key, value, time = 0) => {
8
13
  const newConfig = checkDomain(context);
9
- setCookie(context, key, value, {
14
+ (0, nookies_1.setCookie)(context, key, value, {
10
15
  maxAge: time > 0 ? time : null,
11
16
  ...newConfig
12
17
  });
13
18
  };
14
- export const cerezSil = (context = null, key) => {
19
+ exports.cerezKaydet = cerezKaydet;
20
+ const cerezSil = (context = null, key) => {
15
21
  const newConfig = checkDomain(context);
16
- destroyCookie(context, key, newConfig);
22
+ (0, nookies_1.destroyCookie)(context, key, newConfig);
17
23
  };
18
- export const cerezTumuSil = (context = null) => {
19
- const cookies = parseCookies(context);
24
+ exports.cerezSil = cerezSil;
25
+ const cerezTumuSil = (context = null) => {
26
+ const cookies = (0, nookies_1.parseCookies)(context);
20
27
  if (cookies) {
21
28
  Object.keys(cookies).forEach((key) => {
22
- destroyCookie(context, key);
29
+ (0, nookies_1.destroyCookie)(context, key);
23
30
  });
24
31
  }
25
32
  };
33
+ exports.cerezTumuSil = cerezTumuSil;
26
34
  const checkDomain = (context = null, config = {}) => {
27
- let cookieDomain = getDomain(context);
35
+ let cookieDomain = (0, baseFunctions_1.getDomain)(context);
28
36
  return {
29
37
  ...config,
30
38
  domain: '.' + cookieDomain,
@@ -1,6 +1,9 @@
1
- import { isDev } from "../baseFunctions";
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decData = exports.encData = void 0;
4
+ const baseFunctions_1 = require("../baseFunctions");
2
5
  const encDecDataKeys = [3, 5, 8, 11, 15, 22];
3
- export const encData = (data, keys = encDecDataKeys) => {
6
+ const encData = (data, keys = encDecDataKeys) => {
4
7
  try {
5
8
  const newJSON = { data: data };
6
9
  const utf8Data = unescape(encodeURIComponent(JSON.stringify(newJSON))); // Dizeyi UTF-8'e dönüştür
@@ -12,11 +15,12 @@ export const encData = (data, keys = encDecDataKeys) => {
12
15
  return newData;
13
16
  }
14
17
  catch (e) {
15
- isDev && console.log("ERROR => encData =>", e);
18
+ baseFunctions_1.isDev && console.log("ERROR => encData =>", e);
16
19
  return "";
17
20
  }
18
21
  };
19
- export const decData = (data, keys = encDecDataKeys) => {
22
+ exports.encData = encData;
23
+ const decData = (data, keys = encDecDataKeys) => {
20
24
  var _a;
21
25
  try {
22
26
  let decode = data;
@@ -35,7 +39,8 @@ export const decData = (data, keys = encDecDataKeys) => {
35
39
  return (_a = parse === null || parse === void 0 ? void 0 : parse.data) !== null && _a !== void 0 ? _a : "";
36
40
  }
37
41
  catch (e) {
38
- isDev && console.log("ERROR => decData =>", e);
42
+ baseFunctions_1.isDev && console.log("ERROR => decData =>", e);
39
43
  return "";
40
44
  }
41
45
  };
46
+ exports.decData = decData;
@@ -1,31 +1,36 @@
1
- import { decData, encData } from './encData';
2
- import { isDev } from '../baseFunctions';
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
+ const encData_1 = require("./encData");
5
+ const baseFunctions_1 = require("../baseFunctions");
3
6
  const storageAvailable = typeof Storage === 'undefined' || !window.localStorage ? false : true;
4
- export const setLocalStorage = (key, value) => {
7
+ const setLocalStorage = (key, value) => {
5
8
  if (!storageAvailable)
6
9
  return false;
7
10
  try {
8
- localStorage.setItem(key, encData(value));
11
+ localStorage.setItem(key, (0, encData_1.encData)(value));
9
12
  return true;
10
13
  }
11
14
  catch (e) {
12
- isDev && console.log('ERROR => localStorage =>', e);
15
+ baseFunctions_1.isDev && console.log('ERROR => localStorage =>', e);
13
16
  return false;
14
17
  }
15
18
  };
16
- export const getLocalStorage = (key) => {
19
+ exports.setLocalStorage = setLocalStorage;
20
+ const getLocalStorage = (key) => {
17
21
  if (!storageAvailable)
18
22
  return false;
19
23
  try {
20
24
  const saved = localStorage.getItem(key);
21
- return saved ? decData(saved) : null;
25
+ return saved ? (0, encData_1.decData)(saved) : null;
22
26
  }
23
27
  catch (e) {
24
- isDev && console.log('ERROR => localStorage =>', e);
28
+ baseFunctions_1.isDev && console.log('ERROR => localStorage =>', e);
25
29
  return null;
26
30
  }
27
31
  };
28
- export const removeLocalStorage = (key) => {
32
+ exports.getLocalStorage = getLocalStorage;
33
+ const removeLocalStorage = (key) => {
29
34
  if (!storageAvailable)
30
35
  return false;
31
36
  try {
@@ -33,11 +38,12 @@ export const removeLocalStorage = (key) => {
33
38
  return true;
34
39
  }
35
40
  catch (e) {
36
- isDev && console.log('ERROR => localStorage =>', e);
41
+ baseFunctions_1.isDev && console.log('ERROR => localStorage =>', e);
37
42
  return false;
38
43
  }
39
44
  };
40
- export const clearLocalStorage = () => {
45
+ exports.removeLocalStorage = removeLocalStorage;
46
+ const clearLocalStorage = () => {
41
47
  if (!storageAvailable)
42
48
  return false;
43
49
  try {
@@ -45,18 +51,20 @@ export const clearLocalStorage = () => {
45
51
  return true;
46
52
  }
47
53
  catch (e) {
48
- isDev && console.log('ERROR => localStorage =>', e);
54
+ baseFunctions_1.isDev && console.log('ERROR => localStorage =>', e);
49
55
  return false;
50
56
  }
51
57
  };
58
+ exports.clearLocalStorage = clearLocalStorage;
52
59
  // Tüm localStorage anahtarlarını getir
53
- export const getLocalStorageAllKeys = () => {
60
+ const getLocalStorageAllKeys = () => {
54
61
  if (!storageAvailable)
55
62
  return [];
56
63
  return Object.keys(localStorage);
57
64
  };
65
+ exports.getLocalStorageAllKeys = getLocalStorageAllKeys;
58
66
  // Tüm localStorage boyutunu getir
59
- export const getLocalStorageSize = () => {
67
+ const getLocalStorageSize = () => {
60
68
  if (!storageAvailable)
61
69
  return 0;
62
70
  let total = 0;
@@ -67,3 +75,4 @@ export const getLocalStorageSize = () => {
67
75
  }
68
76
  return total;
69
77
  };
78
+ exports.getLocalStorageSize = getLocalStorageSize;
@@ -1,31 +1,36 @@
1
- import { decData, encData } from "./encData";
2
- import { isDev } from "../baseFunctions";
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
+ const encData_1 = require("./encData");
5
+ const baseFunctions_1 = require("../baseFunctions");
3
6
  const storageAvailable = typeof Storage === "undefined" || !window.sessionStorage ? false : true;
4
- export const setSessionStorage = (key, value) => {
7
+ const setSessionStorage = (key, value) => {
5
8
  if (!storageAvailable)
6
9
  return false;
7
10
  try {
8
- sessionStorage.setItem(key, encData(value));
11
+ sessionStorage.setItem(key, (0, encData_1.encData)(value));
9
12
  return true;
10
13
  }
11
14
  catch (e) {
12
- isDev && console.log("ERROR => SessionStorage =>", e);
15
+ baseFunctions_1.isDev && console.log("ERROR => SessionStorage =>", e);
13
16
  return false;
14
17
  }
15
18
  };
16
- export const getSessionStorage = (key) => {
19
+ exports.setSessionStorage = setSessionStorage;
20
+ const getSessionStorage = (key) => {
17
21
  if (!storageAvailable)
18
22
  return false;
19
23
  try {
20
24
  const saved = sessionStorage.getItem(key);
21
- return saved ? decData(saved) : null;
25
+ return saved ? (0, encData_1.decData)(saved) : null;
22
26
  }
23
27
  catch (e) {
24
- isDev && console.log("ERROR => SessionStorage =>", e);
28
+ baseFunctions_1.isDev && console.log("ERROR => SessionStorage =>", e);
25
29
  return null;
26
30
  }
27
31
  };
28
- export const removeSessionStorage = (key) => {
32
+ exports.getSessionStorage = getSessionStorage;
33
+ const removeSessionStorage = (key) => {
29
34
  if (!storageAvailable)
30
35
  return false;
31
36
  try {
@@ -33,11 +38,12 @@ export const removeSessionStorage = (key) => {
33
38
  return true;
34
39
  }
35
40
  catch (e) {
36
- isDev && console.log("ERROR => SessionStorage =>", e);
41
+ baseFunctions_1.isDev && console.log("ERROR => SessionStorage =>", e);
37
42
  return false;
38
43
  }
39
44
  };
40
- export const clearSessionStorage = () => {
45
+ exports.removeSessionStorage = removeSessionStorage;
46
+ const clearSessionStorage = () => {
41
47
  if (!storageAvailable)
42
48
  return false;
43
49
  try {
@@ -45,18 +51,20 @@ export const clearSessionStorage = () => {
45
51
  return true;
46
52
  }
47
53
  catch (e) {
48
- isDev && console.log("ERROR => SessionStorage =>", e);
54
+ baseFunctions_1.isDev && console.log("ERROR => SessionStorage =>", e);
49
55
  return false;
50
56
  }
51
57
  };
58
+ exports.clearSessionStorage = clearSessionStorage;
52
59
  // Tüm SessionStorage anahtarlarını getir
53
- export const getSessionStorageAllKeys = () => {
60
+ const getSessionStorageAllKeys = () => {
54
61
  if (!storageAvailable)
55
62
  return [];
56
63
  return Object.keys(sessionStorage);
57
64
  };
65
+ exports.getSessionStorageAllKeys = getSessionStorageAllKeys;
58
66
  // Tüm SessionStorage boyutunu getir
59
- export const getSessionStorageSize = () => {
67
+ const getSessionStorageSize = () => {
60
68
  if (!storageAvailable)
61
69
  return 0;
62
70
  let total = 0;
@@ -67,3 +75,4 @@ export const getSessionStorageSize = () => {
67
75
  }
68
76
  return total;
69
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
- import { useEffect, useRef } from "react";
8
- export function useInterval(callback, delay) {
9
- const savedCallback = useRef(null);
10
+ const react_1 = require("react");
11
+ function useInterval(callback, delay) {
12
+ const savedCallback = (0, react_1.useRef)(null);
10
13
  // Remember the latest callback.
11
- useEffect(() => {
14
+ (0, react_1.useEffect)(() => {
12
15
  savedCallback.current = callback;
13
16
  }, [callback]);
14
17
  // Set up the interval.
15
- useEffect(() => {
18
+ (0, react_1.useEffect)(() => {
16
19
  function tick() {
17
20
  savedCallback && savedCallback.current && savedCallback.current();
18
21
  }
@@ -1,10 +1,15 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect } from "react";
3
- import { createRoot } from "react-dom/client";
4
- import styles from "./index.module.css";
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
+ const tslib_1 = require("tslib");
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const client_1 = require("react-dom/client");
9
+ const index_module_css_1 = tslib_1.__importDefault(require("./index.module.css"));
5
10
  const sAlertTimeout = [];
6
- export const Alert = ({ defaultTimer = "5000", defaultErrorTimer = "10000", defaultSuccessTimer = "5000" }) => {
7
- useEffect(() => {
11
+ const Alert = ({ defaultTimer = "5000", defaultErrorTimer = "10000", defaultSuccessTimer = "5000" }) => {
12
+ (0, react_1.useEffect)(() => {
8
13
  if (typeof window === "undefined")
9
14
  return;
10
15
  const divCheck = document.getElementById("salert");
@@ -33,7 +38,8 @@ export const Alert = ({ defaultTimer = "5000", defaultErrorTimer = "10000", defa
33
38
  }, []);
34
39
  return null;
35
40
  };
36
- export const alert_add = ({ type, message, style, timer }) => {
41
+ exports.Alert = Alert;
42
+ const alert_add = ({ type, message, style, timer }) => {
37
43
  var _a, _b, _c;
38
44
  if (typeof window === "undefined")
39
45
  return false;
@@ -45,8 +51,8 @@ export const alert_add = ({ type, message, style, timer }) => {
45
51
  if (mainDiv && alert && mainDiv.contains(alert))
46
52
  mainDiv.removeChild(alert);
47
53
  };
48
- const root = createRoot(alert);
49
- const Component = (_jsxs("div", { className: `${styles.salert} ${styles[type]}`, style: style, children: [_jsx("div", { className: styles.message, dangerouslySetInnerHTML: { __html: message } }), _jsx("div", { className: styles.close, onClick: onClose, children: "\u2715" })] }));
54
+ const root = (0, client_1.createRoot)(alert);
55
+ const Component = ((0, jsx_runtime_1.jsxs)("div", { className: `${index_module_css_1.default.salert} ${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, children: "\u2715" })] }));
50
56
  root.render(Component);
51
57
  const defaultTimer = (_a = mainDiv.getAttribute("defaulttimer")) !== null && _a !== void 0 ? _a : "5000";
52
58
  const defaultErrorTimer = (_b = mainDiv.getAttribute("defaulterrortimer")) !== null && _b !== void 0 ? _b : "10000";
@@ -75,7 +81,8 @@ export const alert_add = ({ type, message, style, timer }) => {
75
81
  }
76
82
  return null;
77
83
  };
78
- export const alert_remove = (alert) => {
84
+ exports.alert_add = alert_add;
85
+ const alert_remove = (alert) => {
79
86
  if (typeof window === "undefined" || !alert)
80
87
  return;
81
88
  const mainDiv = document.getElementById("salert");
@@ -83,7 +90,8 @@ export const alert_remove = (alert) => {
83
90
  mainDiv.removeChild(alert);
84
91
  return;
85
92
  };
86
- export const alert_clear = () => {
93
+ exports.alert_remove = alert_remove;
94
+ const alert_clear = () => {
87
95
  if (typeof window === "undefined")
88
96
  return false;
89
97
  sAlertTimeout.map((id) => clearTimeout(id));
@@ -92,10 +100,11 @@ export const alert_clear = () => {
92
100
  mainDiv.innerHTML = "";
93
101
  return true;
94
102
  };
95
- export function alertCheck(response) {
103
+ exports.alert_clear = alert_clear;
104
+ function alertCheck(response) {
96
105
  if (response.data && response.data["alert"]) {
97
106
  response.data["alert"].map(function (alert) {
98
- alert_add({
107
+ (0, exports.alert_add)({
99
108
  type: alert.type,
100
109
  message: alert.message,
101
110
  timer: alert.timer
package/_dist/box/Box.js CHANGED
@@ -1,14 +1,18 @@
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 const Box = memo(function MemoFunction({ children, className, style, loading = false }) {
5
- const boxRef = useRef(null);
6
- const [hasContent, setHasContent] = useState(false);
7
- useEffect(() => {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Box = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
8
+ exports.Box = (0, react_1.memo)(function MemoFunction({ children, className, style, loading = false }) {
9
+ const boxRef = (0, react_1.useRef)(null);
10
+ const [hasContent, setHasContent] = (0, react_1.useState)(false);
11
+ (0, react_1.useEffect)(() => {
8
12
  if (!boxRef.current)
9
13
  return;
10
14
  const found = boxRef.current.querySelector(".sbox_content");
11
15
  setHasContent(!!found);
12
16
  }, [children]);
13
- return (_jsxs("div", { ref: boxRef, className: `sbox ${styles.sbox} ${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 }) }))] }));
17
+ return ((0, jsx_runtime_1.jsxs)("div", { ref: boxRef, className: `sbox ${Box_module_css_1.default.sbox} ${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 }) }))] }));
14
18
  });
@@ -1,5 +1,10 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import styles from "./Box.module.css";
3
- export const BoxContent = ({ className, style, padding, children }) => {
4
- return (_jsx("div", { className: `${styles.content} sbox_content ${className || ""}`, style: { ...style, padding }, children: children }));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BoxContent = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
7
+ const BoxContent = ({ className, style, padding, children }) => {
8
+ return ((0, jsx_runtime_1.jsx)("div", { className: `${Box_module_css_1.default.content} sbox_content ${className || ""}`, style: { ...style, padding }, children: children }));
5
9
  };
10
+ exports.BoxContent = BoxContent;
@@ -1,8 +1,12 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { memo } from "react";
3
- import styles from "./Box.module.css";
4
- export const BoxFooter = memo(function FunctionMemo({ children, className, style, align, marginTop }) {
5
- return (_jsx("div", { className: `sbox_footer ${styles.footer} ${className || ""}`, style: {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BoxFooter = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
8
+ exports.BoxFooter = (0, react_1.memo)(function FunctionMemo({ children, className, style, align, marginTop }) {
9
+ return ((0, jsx_runtime_1.jsx)("div", { className: `sbox_footer ${Box_module_css_1.default.footer} ${className || ""}`, style: {
6
10
  marginTop,
7
11
  justifyContent: align,
8
12
  ...style
@@ -1,10 +1,14 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { memo } from 'react';
3
- import styles from './Box.module.css';
4
- export const BoxHeader = memo(function FunctionMemo({ children, className, title, icon, menu, mainStyle, iconStyle, titleStyle, menuStyle, marginBottom, component = 'div' }) {
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BoxHeader = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const Box_module_css_1 = tslib_1.__importDefault(require("./Box.module.css"));
8
+ exports.BoxHeader = (0, react_1.memo)(function FunctionMemo({ children, className, title, icon, menu, mainStyle, iconStyle, titleStyle, menuStyle, marginBottom, component = 'div' }) {
5
9
  const Comp = component;
6
- return (_jsxs("div", { className: `sbox_header ${styles.header} ${className || ''}`, style: {
10
+ return ((0, jsx_runtime_1.jsxs)("div", { className: `sbox_header ${Box_module_css_1.default.header} ${className || ''}`, style: {
7
11
  marginBottom,
8
12
  ...mainStyle
9
- }, children: [icon && (_jsx("div", { className: styles.icon, style: iconStyle, children: icon })), _jsx(Comp, { className: `sbox_title ${styles.title}`, style: titleStyle, children: children || title }), menu && (_jsx("div", { className: styles.menu, style: menuStyle, children: menu }))] }));
13
+ }, 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 ${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 }))] }));
10
14
  });
@@ -1,9 +1,12 @@
1
+ "use strict";
1
2
  /**
2
3
  * Copyright (c) 2023
3
4
  * @author: izzetseydaoglu
4
5
  * @last-modified: 29.01.2024 02:41
5
6
  */
6
- export * from "./Box";
7
- export * from './BoxContent';
8
- export * from './BoxFooter';
9
- export * from './BoxHeader';
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ const 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);