@rh-support/utils 2.1.8 → 2.1.10-beta.11
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/index.d.ts +1 -1
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/tncUtil.d.ts +16 -0
- package/lib/cjs/tncUtil.d.ts.map +1 -0
- package/lib/cjs/tncUtil.js +39 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/tncUtil.d.ts +16 -0
- package/lib/esm/tncUtil.d.ts.map +1 -0
- package/lib/esm/tncUtil.js +31 -0
- package/package.json +4 -4
- 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/index.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ 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';
|
|
26
25
|
export * from './outlier';
|
|
27
26
|
export * from './sentry';
|
|
28
27
|
export * from './constants/preferredLanguages';
|
|
28
|
+
export * from './tncUtil';
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
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,10 +31,10 @@ __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);
|
|
38
37
|
__exportStar(require("./outlier"), exports);
|
|
39
38
|
__exportStar(require("./sentry"), exports);
|
|
40
39
|
__exportStar(require("./constants/preferredLanguages"), exports);
|
|
40
|
+
__exportStar(require("./tncUtil"), exports);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const TncConstants: {
|
|
2
|
+
HOSTS: {
|
|
3
|
+
DEV: string;
|
|
4
|
+
QA: string;
|
|
5
|
+
Stage: string;
|
|
6
|
+
PROD: string;
|
|
7
|
+
};
|
|
8
|
+
PARTNER_SHARE_SITE_CODE: string;
|
|
9
|
+
PARTNER_SHARE_EVENT_CODE: string;
|
|
10
|
+
REMOTER_RIDER_EVENT_CODE: string;
|
|
11
|
+
REMOTE_RIDER_SITE_CODE: string;
|
|
12
|
+
PARTNER_SHARE_LINK_ACCOUNT_SITE_CODE: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function getTnCHost(): string;
|
|
15
|
+
export declare function baseTnCUrl(): string;
|
|
16
|
+
//# sourceMappingURL=tncUtil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tncUtil.d.ts","sourceRoot":"","sources":["../../src/tncUtil.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;CAYxB,CAAC;AAEF,wBAAgB,UAAU,WAYzB;AAED,wBAAgB,UAAU,WAGzB"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.baseTnCUrl = exports.getTnCHost = exports.TncConstants = void 0;
|
|
7
|
+
const hydrajs_1 = __importDefault(require("@cee-eng/hydrajs"));
|
|
8
|
+
exports.TncConstants = {
|
|
9
|
+
HOSTS: {
|
|
10
|
+
DEV: 'ams-dev1.devlab.redhat.com',
|
|
11
|
+
QA: 'www.qa.redhat.com',
|
|
12
|
+
Stage: 'www.stage.redhat.com',
|
|
13
|
+
PROD: 'www.redhat.com',
|
|
14
|
+
},
|
|
15
|
+
PARTNER_SHARE_SITE_CODE: 'customerPortal',
|
|
16
|
+
PARTNER_SHARE_EVENT_CODE: 'partnerAuthorization',
|
|
17
|
+
REMOTER_RIDER_EVENT_CODE: 'remoteAccessRider',
|
|
18
|
+
REMOTE_RIDER_SITE_CODE: 'remoteAccessRider',
|
|
19
|
+
PARTNER_SHARE_LINK_ACCOUNT_SITE_CODE: 'customerPortal_linkAccount',
|
|
20
|
+
};
|
|
21
|
+
function getTnCHost() {
|
|
22
|
+
const env = hydrajs_1.default.Env.getEnvName();
|
|
23
|
+
switch (env) {
|
|
24
|
+
case 'QA':
|
|
25
|
+
return exports.TncConstants.HOSTS.QA;
|
|
26
|
+
case 'DEV':
|
|
27
|
+
return exports.TncConstants.HOSTS.DEV;
|
|
28
|
+
case 'Stage':
|
|
29
|
+
return exports.TncConstants.HOSTS.Stage;
|
|
30
|
+
default:
|
|
31
|
+
return exports.TncConstants.HOSTS.PROD;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.getTnCHost = getTnCHost;
|
|
35
|
+
function baseTnCUrl() {
|
|
36
|
+
const wejava_host = getTnCHost();
|
|
37
|
+
return `https://${wejava_host}/wapps/tnc/ackrequired`;
|
|
38
|
+
}
|
|
39
|
+
exports.baseTnCUrl = baseTnCUrl;
|
package/lib/esm/index.d.ts
CHANGED
|
@@ -19,11 +19,11 @@ 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';
|
|
26
25
|
export * from './outlier';
|
|
27
26
|
export * from './sentry';
|
|
28
27
|
export * from './constants/preferredLanguages';
|
|
28
|
+
export * from './tncUtil';
|
|
29
29
|
//# sourceMappingURL=index.d.ts.map
|
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,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/esm/index.js
CHANGED
|
@@ -19,10 +19,10 @@ 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';
|
|
26
25
|
export * from './outlier';
|
|
27
26
|
export * from './sentry';
|
|
28
27
|
export * from './constants/preferredLanguages';
|
|
28
|
+
export * from './tncUtil';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const TncConstants: {
|
|
2
|
+
HOSTS: {
|
|
3
|
+
DEV: string;
|
|
4
|
+
QA: string;
|
|
5
|
+
Stage: string;
|
|
6
|
+
PROD: string;
|
|
7
|
+
};
|
|
8
|
+
PARTNER_SHARE_SITE_CODE: string;
|
|
9
|
+
PARTNER_SHARE_EVENT_CODE: string;
|
|
10
|
+
REMOTER_RIDER_EVENT_CODE: string;
|
|
11
|
+
REMOTE_RIDER_SITE_CODE: string;
|
|
12
|
+
PARTNER_SHARE_LINK_ACCOUNT_SITE_CODE: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function getTnCHost(): string;
|
|
15
|
+
export declare function baseTnCUrl(): string;
|
|
16
|
+
//# sourceMappingURL=tncUtil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tncUtil.d.ts","sourceRoot":"","sources":["../../src/tncUtil.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;;;;;;;;;;;CAYxB,CAAC;AAEF,wBAAgB,UAAU,WAYzB;AAED,wBAAgB,UAAU,WAGzB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import hydrajs from '@cee-eng/hydrajs';
|
|
2
|
+
export const TncConstants = {
|
|
3
|
+
HOSTS: {
|
|
4
|
+
DEV: 'ams-dev1.devlab.redhat.com',
|
|
5
|
+
QA: 'www.qa.redhat.com',
|
|
6
|
+
Stage: 'www.stage.redhat.com',
|
|
7
|
+
PROD: 'www.redhat.com',
|
|
8
|
+
},
|
|
9
|
+
PARTNER_SHARE_SITE_CODE: 'customerPortal',
|
|
10
|
+
PARTNER_SHARE_EVENT_CODE: 'partnerAuthorization',
|
|
11
|
+
REMOTER_RIDER_EVENT_CODE: 'remoteAccessRider',
|
|
12
|
+
REMOTE_RIDER_SITE_CODE: 'remoteAccessRider',
|
|
13
|
+
PARTNER_SHARE_LINK_ACCOUNT_SITE_CODE: 'customerPortal_linkAccount',
|
|
14
|
+
};
|
|
15
|
+
export function getTnCHost() {
|
|
16
|
+
const env = hydrajs.Env.getEnvName();
|
|
17
|
+
switch (env) {
|
|
18
|
+
case 'QA':
|
|
19
|
+
return TncConstants.HOSTS.QA;
|
|
20
|
+
case 'DEV':
|
|
21
|
+
return TncConstants.HOSTS.DEV;
|
|
22
|
+
case 'Stage':
|
|
23
|
+
return TncConstants.HOSTS.Stage;
|
|
24
|
+
default:
|
|
25
|
+
return TncConstants.HOSTS.PROD;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function baseTnCUrl() {
|
|
29
|
+
const wejava_host = getTnCHost();
|
|
30
|
+
return `https://${wejava_host}/wapps/tnc/ackrequired`;
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rh-support/utils",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.10-beta.11",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Vikas Rathee <vrathee@redhat.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"prepublishOnly": "npm run build"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@cee-eng/hydrajs": "4.16.
|
|
48
|
+
"@cee-eng/hydrajs": "4.16.21",
|
|
49
49
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
50
50
|
"dompurify": "^2.2.6",
|
|
51
51
|
"i18next": "^19.0.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"solr-query-builder": "1.0.1"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@cee-eng/hydrajs": "4.16.
|
|
62
|
+
"@cee-eng/hydrajs": "4.16.21",
|
|
63
63
|
"@cee-eng/ui-toolkit": "1.1.6",
|
|
64
64
|
"@rh-support/types": "2.0.2",
|
|
65
65
|
"dompurify": "^2.2.6",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"defaults and supports es6-module",
|
|
89
89
|
"maintained node versions"
|
|
90
90
|
],
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "8e73de8237d47996bd99c8e61d3e06a5f8c5f40c"
|
|
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
|
-
}
|