@firedesktop/react-base 1.21.3 → 1.22.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.
@@ -0,0 +1,4 @@
1
+ declare function FileUtils(): {
2
+ b64toBlob: (b64Data: any, contentType?: string, sliceSize?: number) => Blob;
3
+ };
4
+ export default FileUtils;
@@ -0,0 +1,24 @@
1
+ function FileUtils() {
2
+ var b64toBlob = function (b64Data, contentType, sliceSize) {
3
+ if (contentType === void 0) { contentType = ''; }
4
+ if (sliceSize === void 0) { sliceSize = 512; }
5
+ var byteCharacters = atob(b64Data);
6
+ var byteArrays = [];
7
+ for (var offset = 0; offset < byteCharacters.length; offset += sliceSize) {
8
+ var slice = byteCharacters.slice(offset, offset + sliceSize);
9
+ var byteNumbers = new Array(slice.length);
10
+ for (var i = 0; i < slice.length; i++) {
11
+ byteNumbers[i] = slice.charCodeAt(i);
12
+ }
13
+ var byteArray = new Uint8Array(byteNumbers);
14
+ byteArrays.push(byteArray);
15
+ }
16
+ var blob = new Blob(byteArrays, { type: contentType });
17
+ return blob;
18
+ };
19
+ return {
20
+ b64toBlob: b64toBlob
21
+ };
22
+ }
23
+ export default FileUtils;
24
+ //# sourceMappingURL=FileUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUtil.js","sourceRoot":"","sources":["../../src/lib/utils/FileUtil.ts"],"names":[],"mappings":"AAAA,SAAS,SAAS;IACd,IAAM,SAAS,GAAG,UAAC,OAAO,EAAE,WAAgB,EAAE,SAAe;QAAjC,4BAAA,EAAA,gBAAgB;QAAE,0BAAA,EAAA,eAAe;QACzD,IAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;QACrC,IAAM,UAAU,GAAG,EAAE,CAAC;QAEtB,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,MAAM,EAAE,MAAM,IAAI,SAAS,EAAE;YACtE,IAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;YAE/D,IAAM,WAAW,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACnC,WAAW,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;aACxC;YAED,IAAM,SAAS,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;YAC9C,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;SAC9B;QAED,IAAM,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC;IAEF,OAAO;QACH,SAAS,WAAA;KACZ,CAAC;AACN,CAAC;AAED,eAAe,SAAS,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export declare type configurationLoaderParamsType = {
3
3
  updateAppState: (name: string, value: object) => void;
4
- path: string | null;
4
+ path?: string;
5
5
  };
6
6
  declare function ConfigurationLoader({ updateAppState, path }: configurationLoaderParamsType): JSX.Element;
7
7
  export default ConfigurationLoader;
@@ -1,4 +1,5 @@
1
1
  import * as Fetch from './fetch';
2
2
  import * as Configuration from './configuration';
3
+ import FileUtils from './FileUtil';
3
4
  import * as Labels from './labels';
4
- export { Configuration, Fetch, Labels };
5
+ export { Configuration, Fetch, FileUtils, Labels };
@@ -1,5 +1,6 @@
1
1
  import * as Fetch from './fetch';
2
2
  import * as Configuration from './configuration';
3
+ import FileUtils from './FileUtil';
3
4
  import * as Labels from './labels';
4
- export { Configuration, Fetch, Labels };
5
+ export { Configuration, Fetch, FileUtils, Labels };
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,aAAa,MAAM,iBAAiB,CAAC;AACjD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC"}
@@ -2,7 +2,7 @@
2
2
  export declare type languageLoaderParamsType = {
3
3
  updateAppState: (name: string, value: object) => void;
4
4
  language: string;
5
- path: string | null;
5
+ path?: string;
6
6
  };
7
7
  declare function LanguageLoader({ updateAppState, language, path }: languageLoaderParamsType): JSX.Element;
8
8
  export default LanguageLoader;
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
1
  {
2
2
  "name": "@firedesktop/react-base",
3
- "version": "1.21.3",
3
+ "version": "1.22.0",
4
4
  "license": "ISC",
5
5
  "main": "dist/index.js",
6
6
  "description": "This is the FireDesktop base package used to support every React Project in this Company.",
7
7
  "author": "alessandro.gambaro",
8
8
  "repository": "https://firedesktopDevOps@dev.azure.com/firedesktopDevOps/baseFEComponents/_git/baseFEComponents",
9
9
  "dependencies": {
10
- "@syncfusion/ej2-react-notifications": "18.4.39",
11
- "@syncfusion/ej2-popups": "18.4.44"
10
+ "@syncfusion/ej2-react-notifications": "19.1.54",
11
+ "@syncfusion/ej2-popups": "19.1.54"
12
12
  },
13
13
  "devDependencies": {
14
- "@babel/cli": "7.13.10",
15
- "@babel/core": "7.13.10",
14
+ "@babel/cli": "7.13.14",
15
+ "@babel/core": "7.13.14",
16
16
  "@babel/plugin-proposal-class-properties": "7.13.0",
17
17
  "@babel/plugin-transform-arrow-functions": "7.13.0",
18
18
  "@babel/preset-typescript": "7.13.0",
19
- "@testing-library/jest-dom": "5.11.9",
20
- "@testing-library/react": "11.2.5",
21
- "@testing-library/user-event": "12.8.3",
22
- "@types/jest": "26.0.20",
23
- "@types/node": "14.14.33",
19
+ "@testing-library/jest-dom": "5.11.10",
20
+ "@testing-library/react": "11.2.6",
21
+ "@testing-library/user-event": "13.1.1",
22
+ "@types/jest": "26.0.22",
23
+ "@types/node": "14.14.37",
24
24
  "@types/react": "17.0.3",
25
- "@types/react-dom": "17.0.2",
25
+ "@types/react-dom": "17.0.3",
26
26
  "@types/react-redux": "7.1.16",
27
27
  "babel-plugin-minify-builtins": "0.5.0",
28
28
  "babel-preset-minify": "0.5.1",
29
29
  "bootstrap": "4.6.0",
30
30
  "copyfiles": "2.4.1",
31
- "react": "17.0.1",
32
- "react-dom": "17.0.1",
33
- "react-redux": "7.2.2",
31
+ "react": "17.0.2",
32
+ "react-dom": "17.0.2",
33
+ "react-redux": "7.2.3",
34
34
  "react-scripts": "4.0.3",
35
35
  "typescript": "4.2.3",
36
- "web-vitals": "1.1.0"
36
+ "web-vitals": "1.1.1"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "bootstrap": ">=4.5.3",
@@ -64,4 +64,4 @@
64
64
  "last 1 safari version"
65
65
  ]
66
66
  }
67
- }
67
+ }
@@ -0,0 +1,27 @@
1
+ function FileUtils() {
2
+ const b64toBlob = (b64Data, contentType = '', sliceSize = 512) => {
3
+ const byteCharacters = atob(b64Data);
4
+ const byteArrays = [];
5
+
6
+ for (let offset = 0; offset < byteCharacters.length; offset += sliceSize) {
7
+ const slice = byteCharacters.slice(offset, offset + sliceSize);
8
+
9
+ const byteNumbers = new Array(slice.length);
10
+ for (let i = 0; i < slice.length; i++) {
11
+ byteNumbers[i] = slice.charCodeAt(i);
12
+ }
13
+
14
+ const byteArray = new Uint8Array(byteNumbers);
15
+ byteArrays.push(byteArray);
16
+ }
17
+
18
+ const blob = new Blob(byteArrays, { type: contentType });
19
+ return blob;
20
+ };
21
+
22
+ return {
23
+ b64toBlob
24
+ };
25
+ }
26
+
27
+ export default FileUtils;
@@ -5,7 +5,7 @@ import ConfigurationManager from './ConfigurationManager';
5
5
 
6
6
  export type configurationLoaderParamsType = {
7
7
  updateAppState: (name: string, value: object) => void,
8
- path: string | null
8
+ path?: string
9
9
  }
10
10
 
11
11
  function ConfigurationLoader({ updateAppState, path }: configurationLoaderParamsType) {
@@ -1,5 +1,6 @@
1
1
  import * as Fetch from './fetch';
2
2
  import * as Configuration from './configuration';
3
+ import FileUtils from './FileUtil';
3
4
  import * as Labels from './labels';
4
5
 
5
- export { Configuration, Fetch, Labels };
6
+ export { Configuration, Fetch, FileUtils, Labels };
@@ -6,7 +6,7 @@ import LanguageManager from './LanguageManager';
6
6
  export type languageLoaderParamsType = {
7
7
  updateAppState: (name: string, value: object) => void,
8
8
  language: string,
9
- path: string | null,
9
+ path?: string,
10
10
  }
11
11
 
12
12
  function LanguageLoader({ updateAppState, language, path }: languageLoaderParamsType) {