@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
@@ -0,0 +1,177 @@
1
+ # Utilities
2
+
3
+ Standalone utility functions for dates, currency, files, URLs, and input validation.
4
+
5
+ All utilities use the factory pattern: import the function, call it to get an object of methods.
6
+
7
+ ## Import
8
+
9
+ ```javascript
10
+ import { Utils } from '@firedesktop/react-base';
11
+
12
+ const { dateToString, dateToString_Italian, isoStringToDate, removeTime, zuluTimeUTC_to_yourTimeZone } = Utils.DateUtils();
13
+ const { numberToCurrencyString, numberToCurrencyStringNoSymbol } = Utils.CurrencyUtiles();
14
+ const { b64toBlob, fileReadAsync } = Utils.FileUtils();
15
+ const { validate: validateUrl } = Utils.UrlUtils();
16
+ const { isAValid_CSharpName, isAValid_EmailAddress } = Utils.RegExValidation();
17
+ ```
18
+
19
+ ---
20
+
21
+ ## DateUtils
22
+
23
+ ### `dateToString(date, locale?)`
24
+
25
+ Format a date using `Intl.DateTimeFormat`.
26
+
27
+ | Parameter | Type | Default | Description |
28
+ |-----------|------|---------|-------------|
29
+ | `date` | `string \| Date` | -- | Date to format |
30
+ | `locale` | `string` | `'IT'` | Locale code for formatting |
31
+
32
+ ```javascript
33
+ dateToString(new Date()); // "05/02/2026"
34
+ dateToString('2026-02-05', 'en-US'); // "2/5/2026"
35
+ ```
36
+
37
+ ### `dateToString_Italian(date, separator, time?)`
38
+
39
+ Format as Italian-style string with configurable separator and optional time.
40
+
41
+ | Parameter | Type | Description |
42
+ |-----------|------|-------------|
43
+ | `date` | `string \| Date \| undefined` | Date to format |
44
+ | `separator` | `string` | Date separator (e.g., `'/'`, `'-'`, `'.'`) |
45
+ | `time` | `'HH:mm' \| 'HH:mm:ss' \| undefined` | Optional time format |
46
+
47
+ ```javascript
48
+ dateToString_Italian(new Date(), '/', 'HH:mm'); // "05/02/2026 14:30"
49
+ dateToString_Italian(new Date(), '-', 'HH:mm:ss'); // "05-02-2026 14:30:45"
50
+ dateToString_Italian(new Date(), '/'); // "05/02/2026"
51
+ ```
52
+
53
+ ### `isoStringToDate(value)`
54
+
55
+ Parse an ISO date string to a `Date` object. Returns `undefined` if invalid.
56
+
57
+ ```javascript
58
+ isoStringToDate('2026-02-05T14:00:00.000Z'); // Date object
59
+ isoStringToDate(undefined); // undefined
60
+ ```
61
+
62
+ ### `removeTime(date)`
63
+
64
+ Return a new `Date` at midnight (00:00:00) on the same day.
65
+
66
+ ```javascript
67
+ removeTime(new Date('2026-02-05T14:30:00')); // Date at 2026-02-05T00:00:00
68
+ ```
69
+
70
+ ### `zuluTimeUTC_to_yourTimeZone(isoString)`
71
+
72
+ Convert a Z-formatted UTC string to local timezone in `YYYY-MM-DDTHH:mm:ss` format (no `Z` suffix). Returns the input unchanged if it doesn't end with `Z`.
73
+
74
+ ```javascript
75
+ zuluTimeUTC_to_yourTimeZone('2026-02-05T14:00:00.000Z'); // "2026-02-05T15:00:00" (CET)
76
+ ```
77
+
78
+ ---
79
+
80
+ ## CurrencyUtiles
81
+
82
+ ### `numberToCurrencyString(value, locale?, currency?)`
83
+
84
+ Format a number as a currency string using `Intl.NumberFormat`.
85
+
86
+ | Parameter | Type | Default | Description |
87
+ |-----------|------|---------|-------------|
88
+ | `value` | `string \| number \| undefined` | -- | Value to format |
89
+ | `locale` | `string` | `'IT'` | Locale for formatting |
90
+ | `currency` | `string` | `'EUR'` | ISO 4217 currency code |
91
+
92
+ ```javascript
93
+ numberToCurrencyString(1234.5); // "1.234,50 €"
94
+ numberToCurrencyString(1234.5, 'en-US', 'USD'); // "$1,234.50"
95
+ ```
96
+
97
+ ### `numberToCurrencyStringNoSymbol(value, locale?, minimumFractionDigits?)`
98
+
99
+ Format a number without a currency symbol.
100
+
101
+ | Parameter | Type | Default | Description |
102
+ |-----------|------|---------|-------------|
103
+ | `value` | `string \| number \| undefined` | -- | Value to format |
104
+ | `locale` | `string` | `'IT'` | Locale for formatting |
105
+ | `minimumFractionDigits` | `number` | `2` | Minimum decimal places |
106
+
107
+ ```javascript
108
+ numberToCurrencyStringNoSymbol(1234.5); // "1.234,50"
109
+ numberToCurrencyStringNoSymbol(1234.5, 'en-US'); // "1,234.50"
110
+ ```
111
+
112
+ ---
113
+
114
+ ## FileUtils
115
+
116
+ ### `b64toBlob(b64Data, contentType?, sliceSize?)`
117
+
118
+ Convert a base64 string to a `Blob`.
119
+
120
+ | Parameter | Type | Default | Description |
121
+ |-----------|------|---------|-------------|
122
+ | `b64Data` | `string` | -- | Base64-encoded data |
123
+ | `contentType` | `string` | `''` | MIME type |
124
+ | `sliceSize` | `number` | `512` | Byte processing chunk size |
125
+
126
+ ```javascript
127
+ const blob = b64toBlob(pdfBase64, 'application/pdf');
128
+ const url = URL.createObjectURL(blob);
129
+ ```
130
+
131
+ ### `fileReadAsync(file)`
132
+
133
+ Read a `File` object as text asynchronously.
134
+
135
+ ```javascript
136
+ const text = await fileReadAsync(inputElement.files[0]);
137
+ ```
138
+
139
+ ---
140
+
141
+ ## UrlUtils
142
+
143
+ ### `validate(url?)`
144
+
145
+ Validate a URL string (supports HTTP/HTTPS, domain names, IPs, ports, paths, query strings, fragments).
146
+
147
+ ```javascript
148
+ validateUrl('https://example.com'); // true
149
+ validateUrl('http://192.168.1.1:8080'); // true
150
+ validateUrl('not a url'); // false
151
+ validateUrl(undefined); // false
152
+ ```
153
+
154
+ ---
155
+
156
+ ## RegExValidation
157
+
158
+ ### `isAValid_CSharpName(value?)`
159
+
160
+ Validate that a string is a valid C# identifier: starts with a letter, contains only letters, digits, and underscores.
161
+
162
+ ```javascript
163
+ isAValid_CSharpName('MyClass'); // true
164
+ isAValid_CSharpName('my_var_1'); // true
165
+ isAValid_CSharpName('1invalid'); // false
166
+ isAValid_CSharpName('has space'); // false
167
+ ```
168
+
169
+ ### `isAValid_EmailAddress(value?)`
170
+
171
+ Validate email format.
172
+
173
+ ```javascript
174
+ isAValid_EmailAddress('user@example.com'); // true
175
+ isAValid_EmailAddress('invalid'); // false
176
+ isAValid_EmailAddress(undefined); // false
177
+ ```
package/package.json CHANGED
@@ -1,8 +1,15 @@
1
1
  {
2
2
  "name": "@firedesktop/react-base",
3
- "version": "2.1.25",
4
- "license": "ISC",
3
+ "version": "3.0.1",
4
+ "license": "SEE LICENSE IN LICENSE",
5
5
  "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist/",
9
+ "docs/",
10
+ "LICENSE",
11
+ "README.md"
12
+ ],
6
13
  "description": "This is the FireDesktop base package used to support every React Project in this Company.",
7
14
  "author": "Firedesktop",
8
15
  "repository": "https://firedesktopDevOps@dev.azure.com/firedesktopDevOps/baseFEComponents/_git/baseFEComponents",
@@ -11,30 +18,30 @@
11
18
  "@syncfusion/ej2-react-notifications": "32.1.24"
12
19
  },
13
20
  "devDependencies": {
14
- "@babel/cli": "7.28.6",
15
- "@babel/core": "7.28.6",
16
- "@babel/plugin-proposal-class-properties": "7.18.6",
17
- "@babel/plugin-transform-arrow-functions": "7.27.1",
18
- "@babel/preset-typescript": "7.28.5",
19
21
  "@testing-library/jest-dom": "6.9.1",
20
22
  "@testing-library/react": "16.3.2",
21
23
  "@testing-library/user-event": "14.6.1",
22
- "@types/jest": "30.0.0",
23
- "@types/node": "25.0.9",
24
- "@types/react": "19.2.9",
24
+ "@types/node": "25.2.1",
25
+ "@types/react": "19.2.13",
25
26
  "@types/react-dom": "19.2.3",
26
27
  "@types/react-redux": "7.1.34",
27
- "babel-plugin-minify-builtins": "0.5.0",
28
- "babel-preset-minify": "0.5.2",
28
+ "@typescript-eslint/eslint-plugin": "^8.54.0",
29
+ "@typescript-eslint/parser": "^8.54.0",
30
+ "@vitejs/plugin-react": "^5.1.3",
29
31
  "bootstrap": "5.3.8",
30
32
  "copyfiles": "2.4.1",
31
- "lodash": "4.17.21",
32
- "react": "18.3.1",
33
- "react-dom": "18.3.1",
33
+ "eslint": "^9.39.2",
34
+ "eslint-plugin-react": "^7.37.5",
35
+ "eslint-plugin-react-hooks": "^7.0.1",
36
+ "jsdom": "^28.0.0",
37
+ "lodash": "4.17.23",
38
+ "react": "19.2.4",
39
+ "react-dom": "19.2.4",
34
40
  "react-redux": "9.2.0",
35
- "react-scripts": "^0.0.0",
36
- "typescript": "4.9.5",
37
- "web-vitals": "5.1.0"
41
+ "redux": "^5.0.1",
42
+ "typescript": "5.9.3",
43
+ "vite": "^7.3.1",
44
+ "vitest": "^4.0.18"
38
45
  },
39
46
  "peerDependencies": {
40
47
  "bootstrap": ">=4.5.3",
@@ -44,25 +51,8 @@
44
51
  },
45
52
  "scripts": {
46
53
  "distribute": "rmdir /s /q dist & mkdir dist\\styles && tsc && copyfiles -f src/lib/styles/* dist/styles",
47
- "start": "react-scripts start",
48
- "test": "react-scripts test"
49
- },
50
- "eslintConfig": {
51
- "extends": [
52
- "react-app",
53
- "react-app/jest"
54
- ]
55
- },
56
- "browserslist": {
57
- "production": [
58
- ">0.2%",
59
- "not dead",
60
- "not op_mini all"
61
- ],
62
- "development": [
63
- "last 1 chrome version",
64
- "last 1 firefox version",
65
- "last 1 safari version"
66
- ]
54
+ "start": "vite",
55
+ "test": "vitest run",
56
+ "test:watch": "vitest"
67
57
  }
68
58
  }
package/src/App.css DELETED
@@ -1,12 +0,0 @@
1
- .login_form_svg {
2
- left: 7px;
3
- top: 5px;
4
- }
5
-
6
- .item_clickable {
7
- cursor: pointer;
8
- }
9
-
10
- .appInput_form_for_icon {
11
- padding: 8px 0 8px 40px !important;
12
- }