@firedesktop/react-base 2.1.25 → 3.0.1

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 (114) hide show
  1. package/LICENSE +162 -0
  2. package/README.md +174 -94
  3. package/dist/components/AppIcon.d.ts +20 -20
  4. package/dist/components/AppIcon.js +53 -64
  5. package/dist/components/AppIcon.js.map +1 -1
  6. package/dist/components/AppInput.d.ts +20 -20
  7. package/dist/components/AppInput.js +7 -18
  8. package/dist/components/AppInput.js.map +1 -1
  9. package/dist/components/AppPagination.d.ts +11 -11
  10. package/dist/components/AppPagination.js +63 -74
  11. package/dist/components/AppPagination.js.map +1 -1
  12. package/dist/components/Spin.d.ts +6 -6
  13. package/dist/components/Spin.js +21 -17
  14. package/dist/components/Spin.js.map +1 -1
  15. package/dist/components/Toaster/Toaster.d.ts +7 -7
  16. package/dist/components/Toaster/Toaster.js +41 -29
  17. package/dist/components/Toaster/Toaster.js.map +1 -1
  18. package/dist/components/Toaster/Types.d.ts +6 -6
  19. package/dist/components/Toaster/Types.js +1 -1
  20. package/dist/components/index.d.ts +7 -7
  21. package/dist/components/index.js +7 -7
  22. package/dist/index.d.ts +8 -7
  23. package/dist/index.js +8 -7
  24. package/dist/index.js.map +1 -1
  25. package/dist/utils/CurrencyUtiles.d.ts +4 -4
  26. package/dist/utils/CurrencyUtiles.js +35 -30
  27. package/dist/utils/CurrencyUtiles.js.map +1 -1
  28. package/dist/utils/DateUtils.d.ts +7 -7
  29. package/dist/utils/DateUtils.js +111 -100
  30. package/dist/utils/DateUtils.js.map +1 -1
  31. package/dist/utils/FileUtils.d.ts +5 -5
  32. package/dist/utils/FileUtils.js +73 -73
  33. package/dist/utils/FileUtils.js.map +1 -1
  34. package/dist/utils/Logger.d.ts +13 -0
  35. package/dist/utils/Logger.js +44 -0
  36. package/dist/utils/Logger.js.map +1 -0
  37. package/dist/utils/RegExValidation.d.ts +4 -4
  38. package/dist/utils/RegExValidation.js +19 -19
  39. package/dist/utils/UrlUtils.d.ts +4 -4
  40. package/dist/utils/UrlUtils.js +15 -15
  41. package/dist/utils/UrlUtils.js.map +1 -1
  42. package/dist/utils/configuration/ConfigurationLoader.d.ts +6 -6
  43. package/dist/utils/configuration/ConfigurationLoader.js +76 -75
  44. package/dist/utils/configuration/ConfigurationLoader.js.map +1 -1
  45. package/dist/utils/configuration/ConfigurationManager.d.ts +5 -5
  46. package/dist/utils/configuration/ConfigurationManager.js +96 -89
  47. package/dist/utils/configuration/ConfigurationManager.js.map +1 -1
  48. package/dist/utils/configuration/ConfigurationReturner.d.ts +9 -9
  49. package/dist/utils/configuration/ConfigurationReturner.js +70 -69
  50. package/dist/utils/configuration/ConfigurationReturner.js.map +1 -1
  51. package/dist/utils/configuration/index.d.ts +4 -4
  52. package/dist/utils/configuration/index.js +4 -4
  53. package/dist/utils/fetch/Types.d.ts +10 -10
  54. package/dist/utils/fetch/Types.js +1 -1
  55. package/dist/utils/fetch/fetchWrapper.d.ts +14 -14
  56. package/dist/utils/fetch/fetchWrapper.js +268 -233
  57. package/dist/utils/fetch/fetchWrapper.js.map +1 -1
  58. package/dist/utils/fetch/index.d.ts +3 -3
  59. package/dist/utils/fetch/index.js +3 -3
  60. package/dist/utils/index.d.ts +10 -9
  61. package/dist/utils/index.js +10 -9
  62. package/dist/utils/index.js.map +1 -1
  63. package/dist/utils/labels/LanguageLoader.d.ts +7 -7
  64. package/dist/utils/labels/LanguageLoader.js +130 -100
  65. package/dist/utils/labels/LanguageLoader.js.map +1 -1
  66. package/dist/utils/labels/LanguageManager.d.ts +6 -6
  67. package/dist/utils/labels/LanguageManager.js +118 -110
  68. package/dist/utils/labels/LanguageManager.js.map +1 -1
  69. package/dist/utils/labels/LanguageReturner.d.ts +10 -10
  70. package/dist/utils/labels/LanguageReturner.js +70 -69
  71. package/dist/utils/labels/LanguageReturner.js.map +1 -1
  72. package/dist/utils/labels/index.d.ts +4 -4
  73. package/dist/utils/labels/index.js +4 -4
  74. package/docs/APP_ICON.md +82 -0
  75. package/docs/APP_INPUT.md +81 -0
  76. package/docs/APP_PAGINATION.md +61 -0
  77. package/docs/CONFIGURATION.md +105 -0
  78. package/docs/FETCH_WRAPPER.md +163 -0
  79. package/docs/LABELS.md +148 -0
  80. package/docs/LOGGER.md +112 -0
  81. package/docs/SECURITY_AUDIT_2026-02-05.md +468 -0
  82. package/docs/SPIN.md +45 -0
  83. package/docs/TOASTER.md +75 -0
  84. package/docs/UTILITIES.md +177 -0
  85. package/package.json +28 -38
  86. package/src/App.css +0 -12
  87. package/src/lib/components/AppIcon.tsx +0 -784
  88. package/src/lib/components/AppInput.tsx +0 -66
  89. package/src/lib/components/AppPagination.tsx +0 -124
  90. package/src/lib/components/Spin.tsx +0 -31
  91. package/src/lib/components/Toaster/Toaster.tsx +0 -50
  92. package/src/lib/components/Toaster/Types.ts +0 -11
  93. package/src/lib/components/index.ts +0 -8
  94. package/src/lib/index.ts +0 -15
  95. package/src/lib/styles/base.css +0 -392
  96. package/src/lib/styles/syncfusion_bootstrap4.css +0 -10
  97. package/src/lib/styles/toaster.css +0 -50
  98. package/src/lib/utils/CurrencyUtiles.ts +0 -48
  99. package/src/lib/utils/DateUtils.ts +0 -135
  100. package/src/lib/utils/FileUtils.ts +0 -40
  101. package/src/lib/utils/RegExValidation.ts +0 -49
  102. package/src/lib/utils/UrlUtils.ts +0 -17
  103. package/src/lib/utils/configuration/ConfigurationLoader.tsx +0 -43
  104. package/src/lib/utils/configuration/ConfigurationManager.ts +0 -38
  105. package/src/lib/utils/configuration/ConfigurationReturner.tsx +0 -39
  106. package/src/lib/utils/configuration/index.ts +0 -9
  107. package/src/lib/utils/fetch/Types.ts +0 -11
  108. package/src/lib/utils/fetch/fetchWrapper.ts +0 -174
  109. package/src/lib/utils/fetch/index.ts +0 -4
  110. package/src/lib/utils/index.ts +0 -11
  111. package/src/lib/utils/labels/LanguageLoader.tsx +0 -69
  112. package/src/lib/utils/labels/LanguageManager.ts +0 -61
  113. package/src/lib/utils/labels/LanguageReturner.tsx +0 -41
  114. package/src/lib/utils/labels/index.ts +0 -9
@@ -1,11 +0,0 @@
1
- import * as Fetch from './fetch';
2
- import * as Configuration from './configuration';
3
- import CurrencyUtiles from './CurrencyUtiles';
4
- import DateUtils from './DateUtils';
5
- import FileUtils from './FileUtils';
6
- import RegExValidation from './RegExValidation';
7
- import UrlUtils from './UrlUtils';
8
-
9
- import * as Labels from './labels';
10
-
11
- export { Configuration, CurrencyUtiles, DateUtils, Fetch, FileUtils, Labels, RegExValidation, UrlUtils };
@@ -1,69 +0,0 @@
1
- import _ from 'lodash';
2
- import React, { useEffect } from 'react';
3
- import { useDispatch, useSelector } from 'react-redux';
4
-
5
- import LanguageManager from './LanguageManager';
6
-
7
- export type languageLoaderParamsType = {
8
- updateAppState: (name: string, value: object) => any,
9
- language: string,
10
- path?: string,
11
- }
12
-
13
- function LanguageLoader({ updateAppState, language, path }: languageLoaderParamsType) {
14
- const dispatch = useDispatch();
15
- const labels: any = useSelector((state: any) => state.labels);
16
- const { loadLabels } = LanguageManager();
17
-
18
- var avoidCache = new Date().getTime();
19
-
20
- const fileName = `${language}.json`;
21
-
22
- const baseLanguageFullPath = `./labels/${fileName}?${avoidCache}`;
23
-
24
- let fullPath = `./labels/${fileName}?${avoidCache}`;
25
- if (path)
26
- fullPath = `./${path}/${fileName}?${avoidCache}`;
27
-
28
- // Do it on change language
29
- useEffect(() => {
30
- async function justAsync() {
31
- if (!labels || !labels.language || labels.language !== language) {
32
-
33
- console.log(`Loading Base Language Labels for this Site in this path: ${baseLanguageFullPath}`);
34
- let allLabels: any = {};
35
- try {
36
- allLabels = await loadLabels(baseLanguageFullPath);
37
- console.log(`Loaded Base Language Labels for this Site in this path: ${baseLanguageFullPath}`, allLabels);
38
- }
39
- catch (err) {
40
- console.error(`Problem loading Base Site Language Labels in this path: ${baseLanguageFullPath}`);
41
- }
42
-
43
- console.log(`Loading Custom Language Labels for this Site in this path: ${fullPath}`);
44
- loadLabels(fullPath).then((response: any) => {
45
- if (response) {
46
- console.log(`Loaded Custom Language Labels for this Site in this path: ${fullPath}`, response);
47
- const merged = _.merge(allLabels, response);
48
- dispatch(updateAppState('labels', merged));
49
- }
50
- else {
51
- console.warn(`Custom Site Language Labels NOT FOUND in this path: ${fullPath}`);
52
- dispatch(updateAppState('labels', allLabels));
53
- }
54
- }).catch((err: any) => {
55
- console.warn(`Custom Site Language Labels NOT FOUND in this path: ${fullPath}`);
56
- });
57
- }
58
- }
59
- justAsync();
60
- // eslint-disable-next-line react-hooks/exhaustive-deps
61
- }, [language]);
62
-
63
- return (
64
- <>
65
- </>
66
- );
67
- }
68
-
69
- export default LanguageLoader;
@@ -1,61 +0,0 @@
1
- function LanguageManager() {
2
-
3
- async function loadLabels(fullPath: string) {
4
- try {
5
- const res = await fetch(fullPath, {
6
- headers: {
7
- 'Content-Type': 'application/json; charset=utf-8',
8
- 'Cache-Control': 'no-cache, no-store, must-revalidate',
9
- 'Expires': '0',
10
- 'pragma': 'no-cache'
11
- }
12
- });
13
- return await res.json();
14
- }
15
- catch (err) {
16
- console.warn(`Site Labels, Path ${fullPath} NOT FOUND`);
17
- }
18
- };
19
-
20
- async function loadLabelsWithDispatch(dispatch: any, updateAppState: any, labels: any, language: string) {
21
- if (!labels || !labels.language || labels.language !== language) {
22
- var avoidCache = new Date().getTime();
23
- const fullPath = `./labels/${language}.json?${avoidCache}`;
24
- console.log(`Loading Labels for this Language ${language}, from this path: ${fullPath}`);
25
- loadLabels(fullPath).then((response: any) => {
26
- console.log(`Loaded Labels for this Language ${language}`, response);
27
- dispatch(updateAppState('labels', response));
28
- }).catch((err: any) => {
29
- console.warn(`Problem loading the Site Labels, language: ${language}, fullPath: ${fullPath}`);
30
- });
31
- }
32
- }
33
-
34
- function getLabel(labels: any, id: string, defaultValue?: string) {
35
- if (labels === null || labels === undefined)
36
- return defaultValue || '';
37
-
38
- try {
39
- const splits = id.split('.');
40
- let message = labels;
41
- for (let index = 0; index < splits.length; index++) {
42
- const element = splits[index];
43
- message = message[element];
44
- }
45
- if (message !== null && message !== undefined)
46
- return message;
47
-
48
- return defaultValue ? defaultValue : id;
49
- } catch (ex) {
50
- return defaultValue ? defaultValue : id;
51
- }
52
- }
53
-
54
- return {
55
- getLabel,
56
- loadLabels,
57
- loadLabelsWithDispatch
58
- };
59
- }
60
-
61
- export default LanguageManager;
@@ -1,41 +0,0 @@
1
- import React, { useEffect } from 'react';
2
-
3
- import LanguageManager from './LanguageManager';
4
-
5
- export type Labels_Type = {
6
- language: string
7
- }
8
- export type languageLoaderParamsType = {
9
- labels?: Labels_Type
10
- language: string
11
- onLanguageLoad: (language?: Labels_Type) => void
12
- path: string
13
- }
14
-
15
- export default function LanguageReturner({ labels, language, onLanguageLoad, path }: languageLoaderParamsType) {
16
- const { loadLabels } = LanguageManager();
17
-
18
- const fullPath = `${path}/${language}.json`;
19
-
20
- // Do it on change language
21
- useEffect(() => {
22
- async function justAsync() {
23
- if (!labels || !labels.language || labels.language !== language) {
24
- console.log(`Loading Language Labels for this Path: ${path} in this fullpath: ${fullPath}`);
25
- await loadLabels(fullPath).then((response: any) => {
26
- console.log(`Loaded Language Labels for this Path: ${path} in this fullpath: ${fullPath}`, response);
27
- onLanguageLoad(response);
28
- }).catch((err: any) => {
29
- console.error(`Problem loading the Path: ${path} Language Labels in this fullpath: ${fullPath}`);
30
- });
31
- }
32
- }
33
- justAsync();
34
- // eslint-disable-next-line react-hooks/exhaustive-deps
35
- }, [language]);
36
-
37
- return (
38
- <React.Fragment>
39
- </React.Fragment>
40
- );
41
- }
@@ -1,9 +0,0 @@
1
- import LanguageLoader from './LanguageLoader';
2
- import LanguageManager from './LanguageManager';
3
- import LanguageReturner from './LanguageReturner';
4
-
5
- export {
6
- LanguageLoader,
7
- LanguageManager,
8
- LanguageReturner
9
- };