@firedesktop/react-base 1.50.0 → 1.52.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/package.json +1 -1
- package/src/lib/components/AppIcon.tsx +784 -0
- package/src/lib/components/AppInput.tsx +66 -0
- package/src/lib/components/AppPagination.tsx +124 -0
- package/src/lib/components/Spin.tsx +31 -0
- package/src/lib/components/Toaster/Toaster.tsx +50 -0
- package/src/lib/components/Toaster/Types.ts +11 -0
- package/src/lib/components/index.ts +8 -0
- package/src/lib/index.ts +15 -0
- package/src/lib/styles/base.css +392 -0
- package/src/lib/styles/syncfusion_bootstrap4.css +10 -0
- package/src/lib/styles/toaster.css +50 -0
- package/src/lib/utils/CurrencyUtiles.ts +28 -0
- package/src/lib/utils/DateUtils.ts +135 -0
- package/src/lib/utils/FileUtil.ts +27 -0
- package/src/lib/utils/configuration/ConfigurationLoader.tsx +43 -0
- package/src/lib/utils/configuration/ConfigurationManager.ts +29 -0
- package/src/lib/utils/configuration/ConfigurationReturner.tsx +39 -0
- package/src/lib/utils/configuration/index.ts +9 -0
- package/src/lib/utils/fetch/Types.ts +11 -0
- package/src/lib/utils/fetch/fetchWrapper.ts +144 -0
- package/src/lib/utils/fetch/index.ts +4 -0
- package/src/lib/utils/index.ts +8 -0
- package/src/lib/utils/labels/LanguageLoader.tsx +67 -0
- package/src/lib/utils/labels/LanguageManager.ts +53 -0
- package/src/lib/utils/labels/LanguageReturner.tsx +41 -0
- package/src/lib/utils/labels/index.ts +9 -0
- package/.vscode/settings.json +0 -3
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
package/.vscode/settings.json
DELETED