@rh-support/utils 2.1.14 → 2.1.16
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/lib/cjs/csvUtils.d.ts +1 -1
- package/lib/cjs/csvUtils.d.ts.map +1 -1
- package/lib/cjs/csvUtils.js +9 -16
- package/lib/cjs/index.d.ts +0 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +0 -1
- package/lib/esm/csvUtils.d.ts +1 -1
- package/lib/esm/csvUtils.d.ts.map +1 -1
- package/lib/esm/csvUtils.js +9 -16
- package/lib/esm/index.d.ts +0 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +0 -1
- package/package.json +2 -2
- package/lib/cjs/customElementUtils.d.ts +0 -20
- package/lib/cjs/customElementUtils.d.ts.map +0 -1
- package/lib/cjs/customElementUtils.js +0 -23
- package/lib/esm/customElementUtils.d.ts +0 -20
- package/lib/esm/customElementUtils.d.ts.map +0 -1
- package/lib/esm/customElementUtils.js +0 -19
package/lib/cjs/csvUtils.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ export declare const jsons2csv: (data: any[], headers: any, separator: any, encl
|
|
|
20
20
|
export declare const string2csv: (data: string, headers: any, separator?: string, enclosingCharacter?: string) => string;
|
|
21
21
|
export declare const toCSV: (data: string | any[] | any[][], headers: any, separator?: string, enclosingCharacter?: string) => any;
|
|
22
22
|
export declare const buildURI: (data: string | any[] | any[][], headers: any, uFEFF?: boolean, separator?: string, enclosingCharacter?: string) => string;
|
|
23
|
-
export declare const downloadCSV: (data: string | any[] | any[][], headers: ICSVHeader[], fileName?: string
|
|
23
|
+
export declare const downloadCSV: (data: string | any[] | any[][], headers: ICSVHeader[], fileName?: string) => void;
|
|
24
24
|
//# sourceMappingURL=csvUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csvUtils.d.ts","sourceRoot":"","sources":["../../src/csvUtils.ts"],"names":[],"mappings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AiF,CAAC;AAGjH,eAAO,MAAM,OAAO,yBACgF,CAAC;AAErG,eAAO,MAAM,QAAQ,yBAA8E,CAAC;AAEpG,eAAO,MAAM,YAAY,2BACyE,CAAC;AAEnG,eAAO,MAAM,YAAY,qCAexB,CAAC;AAEF,eAAO,MAAM,cAAc,oEAkB1B,CAAC;AAEF,eAAO,MAAM,cAAc,uBAAyD,CAAC;AAErF,eAAO,MAAM,MAAM,qEAUlB,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,GAAG,EAAE,EAAE,+DACsC,CAAC;AAE/E,eAAO,MAAM,SAAS,SAAU,GAAG,EAAE,+DACiC,CAAC;AAEvE,eAAO,MAAM,UAAU,SAAU,MAAM,0EACmB,CAAC;AAE3D,eAAO,MAAM,KAAK,SAAU,MAAM,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE,uEAKnD,CAAC;AAEF,eAAO,MAAM,QAAQ,SACX,MAAM,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE,2FAcjC,CAAC;AAEF,eAAO,MAAM,WAAW,SAAU,MAAM,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,EAAE,WAAW,UAAU,EAAE,4BAShF,CAAC"}
|
package/lib/cjs/csvUtils.js
CHANGED
|
@@ -89,21 +89,14 @@ const buildURI = (data, headers, uFEFF = true, separator = ',', enclosingCharact
|
|
|
89
89
|
return typeof URL.createObjectURL === 'undefined' ? dataURI : URL.createObjectURL(blob);
|
|
90
90
|
};
|
|
91
91
|
exports.buildURI = buildURI;
|
|
92
|
-
const downloadCSV = (data, headers, fileName = 'csvGenerator'
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
element.setAttribute('href', uri);
|
|
102
|
-
element.setAttribute('target', '_self');
|
|
103
|
-
element.setAttribute('download', fileName);
|
|
104
|
-
document.body.appendChild(element);
|
|
105
|
-
element.click();
|
|
106
|
-
document.body.removeChild(element);
|
|
107
|
-
}
|
|
92
|
+
const downloadCSV = (data, headers, fileName = 'csvGenerator') => {
|
|
93
|
+
const uri = exports.buildURI(data, headers);
|
|
94
|
+
const element = document.createElement('a');
|
|
95
|
+
element.setAttribute('href', uri);
|
|
96
|
+
element.setAttribute('target', '_self');
|
|
97
|
+
element.setAttribute('download', fileName);
|
|
98
|
+
document.body.appendChild(element);
|
|
99
|
+
element.click();
|
|
100
|
+
document.body.removeChild(element);
|
|
108
101
|
};
|
|
109
102
|
exports.downloadCSV = downloadCSV;
|
package/lib/cjs/index.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ export * from './searchApiUtils';
|
|
|
19
19
|
export * from './scrollUtils';
|
|
20
20
|
export * from './urlUtils';
|
|
21
21
|
export * from './validatorUtils';
|
|
22
|
-
export * from './customElementUtils';
|
|
23
22
|
export * from './userUtils';
|
|
24
23
|
export * from './styleUtils';
|
|
25
24
|
export * from './translation-helper';
|
package/lib/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -31,7 +31,6 @@ __exportStar(require("./searchApiUtils"), exports);
|
|
|
31
31
|
__exportStar(require("./scrollUtils"), exports);
|
|
32
32
|
__exportStar(require("./urlUtils"), exports);
|
|
33
33
|
__exportStar(require("./validatorUtils"), exports);
|
|
34
|
-
__exportStar(require("./customElementUtils"), exports);
|
|
35
34
|
__exportStar(require("./userUtils"), exports);
|
|
36
35
|
__exportStar(require("./styleUtils"), exports);
|
|
37
36
|
__exportStar(require("./translation-helper"), exports);
|
package/lib/esm/csvUtils.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ export declare const jsons2csv: (data: any[], headers: any, separator: any, encl
|
|
|
20
20
|
export declare const string2csv: (data: string, headers: any, separator?: string, enclosingCharacter?: string) => string;
|
|
21
21
|
export declare const toCSV: (data: string | any[] | any[][], headers: any, separator?: string, enclosingCharacter?: string) => any;
|
|
22
22
|
export declare const buildURI: (data: string | any[] | any[][], headers: any, uFEFF?: boolean, separator?: string, enclosingCharacter?: string) => string;
|
|
23
|
-
export declare const downloadCSV: (data: string | any[] | any[][], headers: ICSVHeader[], fileName?: string
|
|
23
|
+
export declare const downloadCSV: (data: string | any[] | any[][], headers: ICSVHeader[], fileName?: string) => void;
|
|
24
24
|
//# sourceMappingURL=csvUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csvUtils.d.ts","sourceRoot":"","sources":["../../src/csvUtils.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,CAAC,IAAI,KAAA,KAAK,MAAM,GAAG,MAAM,CAAC;CACzC;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,eAAmE,CAAC;AAEzF,eAAO,MAAM,kBAAkB,oBAAiF,CAAC;AAGjH,eAAO,MAAM,OAAO,yBACgF,CAAC;AAErG,eAAO,MAAM,QAAQ,yBAA8E,CAAC;AAEpG,eAAO,MAAM,YAAY,2BACyE,CAAC;AAEnG,eAAO,MAAM,YAAY,qCAexB,CAAC;AAEF,eAAO,MAAM,cAAc,oEAkB1B,CAAC;AAEF,eAAO,MAAM,cAAc,uBAAyD,CAAC;AAErF,eAAO,MAAM,MAAM,qEAUlB,CAAC;AAEF,eAAO,MAAM,UAAU,SAAU,GAAG,EAAE,EAAE,+DACsC,CAAC;AAE/E,eAAO,MAAM,SAAS,SAAU,GAAG,EAAE,+DACiC,CAAC;AAEvE,eAAO,MAAM,UAAU,SAAU,MAAM,0EACmB,CAAC;AAE3D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G,EAAE,EAAE,WAAW,UAAU,EAAE,4BAShF,CAAC"}
|
package/lib/esm/csvUtils.js
CHANGED
|
@@ -72,20 +72,13 @@ export const buildURI = (data, headers, uFEFF = true, separator = ',', enclosing
|
|
|
72
72
|
const URL = window.URL || window.webkitURL;
|
|
73
73
|
return typeof URL.createObjectURL === 'undefined' ? dataURI : URL.createObjectURL(blob);
|
|
74
74
|
};
|
|
75
|
-
export const downloadCSV = (data, headers, fileName = 'csvGenerator'
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
element.setAttribute('href', uri);
|
|
85
|
-
element.setAttribute('target', '_self');
|
|
86
|
-
element.setAttribute('download', fileName);
|
|
87
|
-
document.body.appendChild(element);
|
|
88
|
-
element.click();
|
|
89
|
-
document.body.removeChild(element);
|
|
90
|
-
}
|
|
75
|
+
export const downloadCSV = (data, headers, fileName = 'csvGenerator') => {
|
|
76
|
+
const uri = buildURI(data, headers);
|
|
77
|
+
const element = document.createElement('a');
|
|
78
|
+
element.setAttribute('href', uri);
|
|
79
|
+
element.setAttribute('target', '_self');
|
|
80
|
+
element.setAttribute('download', fileName);
|
|
81
|
+
document.body.appendChild(element);
|
|
82
|
+
element.click();
|
|
83
|
+
document.body.removeChild(element);
|
|
91
84
|
};
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ export * from './searchApiUtils';
|
|
|
19
19
|
export * from './scrollUtils';
|
|
20
20
|
export * from './urlUtils';
|
|
21
21
|
export * from './validatorUtils';
|
|
22
|
-
export * from './customElementUtils';
|
|
23
22
|
export * from './userUtils';
|
|
24
23
|
export * from './styleUtils';
|
|
25
24
|
export * from './translation-helper';
|
package/lib/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAA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CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gCAAgC,CAAC;AAC/C,cAAc,WAAW,CAAC"}
|
package/lib/esm/index.js
CHANGED
|
@@ -19,7 +19,6 @@ export * from './searchApiUtils';
|
|
|
19
19
|
export * from './scrollUtils';
|
|
20
20
|
export * from './urlUtils';
|
|
21
21
|
export * from './validatorUtils';
|
|
22
|
-
export * from './customElementUtils';
|
|
23
22
|
export * from './userUtils';
|
|
24
23
|
export * from './styleUtils';
|
|
25
24
|
export * from './translation-helper';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/utils",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.16",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"defaults and supports es6-module",
|
|
89
89
|
"maintained node versions"
|
|
90
90
|
],
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "6f4a93926c86b6af2df3f900f199261c5c3656f5"
|
|
92
92
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare enum CustomElements {
|
|
2
|
-
pfeTabs = "pfe-tabs",
|
|
3
|
-
pfeCollapse = "pfe-collapse"
|
|
4
|
-
}
|
|
5
|
-
interface RequireCustomElementObject {
|
|
6
|
-
/** The custom element you want to check if it has been defined */
|
|
7
|
-
element: CustomElements;
|
|
8
|
-
/** cb that will be called if the custom element has yet to be defined */
|
|
9
|
-
requireCb: () => void;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* This function is to check if custom elements exist and require them if they do not.
|
|
13
|
-
* The check is needed because of how the packages are split and that patternfly elements
|
|
14
|
-
* use window.customElements.define without checking if it is already defined, which throws an
|
|
15
|
-
* error. Since our packages are split up and lazy loaded this check is necessary to make sure that
|
|
16
|
-
* the pfelement does not get defined twice.
|
|
17
|
-
*/
|
|
18
|
-
export declare function requireCustomElement(elements: RequireCustomElementObject[]): void;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=customElementUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customElementUtils.d.ts","sourceRoot":"","sources":["../../src/customElementUtils.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACtB,OAAO,aAAa;IACpB,WAAW,iBAAiB;CAC/B;AAED,UAAU,0BAA0B;IAChC,kEAAkE;IAClE,OAAO,EAAE,cAAc,CAAC;IAExB,yEAAyE;IACzE,SAAS,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,0BAA0B,EAAE,QAM1E"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.requireCustomElement = exports.CustomElements = void 0;
|
|
4
|
-
var CustomElements;
|
|
5
|
-
(function (CustomElements) {
|
|
6
|
-
CustomElements["pfeTabs"] = "pfe-tabs";
|
|
7
|
-
CustomElements["pfeCollapse"] = "pfe-collapse";
|
|
8
|
-
})(CustomElements = exports.CustomElements || (exports.CustomElements = {}));
|
|
9
|
-
/**
|
|
10
|
-
* This function is to check if custom elements exist and require them if they do not.
|
|
11
|
-
* The check is needed because of how the packages are split and that patternfly elements
|
|
12
|
-
* use window.customElements.define without checking if it is already defined, which throws an
|
|
13
|
-
* error. Since our packages are split up and lazy loaded this check is necessary to make sure that
|
|
14
|
-
* the pfelement does not get defined twice.
|
|
15
|
-
*/
|
|
16
|
-
function requireCustomElement(elements) {
|
|
17
|
-
elements.forEach((elementObj) => {
|
|
18
|
-
if (window.customElements.get(elementObj.element) === undefined) {
|
|
19
|
-
elementObj.requireCb();
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
exports.requireCustomElement = requireCustomElement;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare enum CustomElements {
|
|
2
|
-
pfeTabs = "pfe-tabs",
|
|
3
|
-
pfeCollapse = "pfe-collapse"
|
|
4
|
-
}
|
|
5
|
-
interface RequireCustomElementObject {
|
|
6
|
-
/** The custom element you want to check if it has been defined */
|
|
7
|
-
element: CustomElements;
|
|
8
|
-
/** cb that will be called if the custom element has yet to be defined */
|
|
9
|
-
requireCb: () => void;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* This function is to check if custom elements exist and require them if they do not.
|
|
13
|
-
* The check is needed because of how the packages are split and that patternfly elements
|
|
14
|
-
* use window.customElements.define without checking if it is already defined, which throws an
|
|
15
|
-
* error. Since our packages are split up and lazy loaded this check is necessary to make sure that
|
|
16
|
-
* the pfelement does not get defined twice.
|
|
17
|
-
*/
|
|
18
|
-
export declare function requireCustomElement(elements: RequireCustomElementObject[]): void;
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=customElementUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"customElementUtils.d.ts","sourceRoot":"","sources":["../../src/customElementUtils.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACtB,OAAO,aAAa;IACpB,WAAW,iBAAiB;CAC/B;AAED,UAAU,0BAA0B;IAChC,kEAAkE;IAClE,OAAO,EAAE,cAAc,CAAC;IAExB,yEAAyE;IACzE,SAAS,EAAE,MAAM,IAAI,CAAC;CACzB;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,0BAA0B,EAAE,QAM1E"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export var CustomElements;
|
|
2
|
-
(function (CustomElements) {
|
|
3
|
-
CustomElements["pfeTabs"] = "pfe-tabs";
|
|
4
|
-
CustomElements["pfeCollapse"] = "pfe-collapse";
|
|
5
|
-
})(CustomElements || (CustomElements = {}));
|
|
6
|
-
/**
|
|
7
|
-
* This function is to check if custom elements exist and require them if they do not.
|
|
8
|
-
* The check is needed because of how the packages are split and that patternfly elements
|
|
9
|
-
* use window.customElements.define without checking if it is already defined, which throws an
|
|
10
|
-
* error. Since our packages are split up and lazy loaded this check is necessary to make sure that
|
|
11
|
-
* the pfelement does not get defined twice.
|
|
12
|
-
*/
|
|
13
|
-
export function requireCustomElement(elements) {
|
|
14
|
-
elements.forEach((elementObj) => {
|
|
15
|
-
if (window.customElements.get(elementObj.element) === undefined) {
|
|
16
|
-
elementObj.requireCb();
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|