@redhat-cloud-services/frontend-components 3.6.2 → 3.6.3
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.
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AsyncComponentProps {
|
|
3
|
+
appName: string;
|
|
4
|
+
module: string;
|
|
5
|
+
scope?: string;
|
|
6
|
+
fallback: React.ReactNode;
|
|
7
|
+
className: string;
|
|
8
|
+
component: keyof JSX.IntrinsicElements;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
}
|
|
11
|
+
declare const AsynComponent: React.ForwardRefExoticComponent<Pick<AsyncComponentProps, keyof AsyncComponentProps> & React.RefAttributes<HTMLElement>>;
|
|
1
12
|
export default AsynComponent;
|
|
2
|
-
declare const AsynComponent: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
|
-
import React from "react";
|
package/AsyncComponent/index.js
CHANGED
|
@@ -26,28 +26,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
};
|
|
27
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
28
|
var react_1 = __importDefault(require("react"));
|
|
29
|
-
var prop_types_1 = __importDefault(require("prop-types"));
|
|
30
29
|
var react_core_1 = require("@scalprum/react-core");
|
|
31
30
|
var react_core_2 = require("@patternfly/react-core");
|
|
32
31
|
var classnames_1 = __importDefault(require("classnames"));
|
|
33
32
|
var BaseAsyncComponent = function (_a) {
|
|
34
|
-
var appName = _a.appName, scope = _a.scope, module = _a.module,
|
|
33
|
+
var appName = _a.appName, scope = _a.scope, module = _a.module, _b = _a.fallback, fallback = _b === void 0 ? (react_1.default.createElement(react_core_2.Bullseye, null,
|
|
34
|
+
react_1.default.createElement(react_core_2.Spinner, { size: "xl" }))) : _b, innerRef = _a.innerRef, className = _a.className, _c = _a.component, Cmp = _c === void 0 ? 'section' : _c, props = __rest(_a, ["appName", "scope", "module", "fallback", "innerRef", "className", "component"]);
|
|
35
35
|
return (react_1.default.createElement(Cmp, { className: (0, classnames_1.default)(className, appName) },
|
|
36
|
-
react_1.default.createElement(react_core_1.ScalprumComponent, __assign({ className: className, appName: appName, module: module, scope: scope
|
|
36
|
+
react_1.default.createElement(react_core_1.ScalprumComponent, __assign({ className: className, appName: appName, module: module, scope: scope !== null && scope !== void 0 ? scope : appName, ErrorComponent: fallback, ref: innerRef, fallback: fallback }, props))));
|
|
37
37
|
};
|
|
38
38
|
var AsynComponent = react_1.default.forwardRef(function (props, ref) { return react_1.default.createElement(BaseAsyncComponent, __assign({ innerRef: ref }, props)); });
|
|
39
|
-
AsynComponent.propTypes = {
|
|
40
|
-
fallback: prop_types_1.default.node,
|
|
41
|
-
appName: prop_types_1.default.string.isRequired,
|
|
42
|
-
module: prop_types_1.default.string.isRequired,
|
|
43
|
-
scope: prop_types_1.default.string,
|
|
44
|
-
component: prop_types_1.default.string,
|
|
45
|
-
};
|
|
46
|
-
AsynComponent.defaultProps = {
|
|
47
|
-
fallback: (react_1.default.createElement(react_core_2.Bullseye, null,
|
|
48
|
-
react_1.default.createElement(react_core_2.Spinner, { size: "xl" }))),
|
|
49
|
-
component: 'section',
|
|
50
|
-
};
|
|
51
|
-
BaseAsyncComponent.propTypes = __assign(__assign({}, AsynComponent.propTypes), { innerRef: prop_types_1.default.any });
|
|
52
39
|
exports.default = AsynComponent;
|
|
53
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/AsyncComponent/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/AsyncComponent/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,mDAAyD;AACzD,qDAA2D;AAC3D,0DAAoC;AAuBpC,IAAM,kBAAkB,GAAqD,UAAC,EAa7E;IAZC,IAAA,OAAO,aAAA,EACP,KAAK,WAAA,EACL,MAAM,YAAA,EACN,gBAIC,EAJD,QAAQ,mBAAG,CACT,8BAAC,qBAAQ;QACP,8BAAC,oBAAO,IAAC,IAAI,EAAC,IAAI,GAAG,CACZ,CACZ,KAAA,EACD,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,iBAA0B,EAAf,GAAG,mBAAG,SAAS,KAAA,EACvB,KAAK,cAZoE,gFAa7E,CADS;IAER,OAAO,CACL,8BAAC,GAAG,IAAC,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,OAAO,CAAC;QAC5C,8BAAC,8BAAiB,aAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,OAAO,EACvB,cAAc,EAAE,QAAQ,EACxB,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,QAAQ,IACd,KAAK,EACT,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAQF,IAAM,aAAa,GAAG,eAAK,CAAC,UAAU,CAAmC,UAAC,KAAK,EAAE,GAAG,IAAK,OAAA,8BAAC,kBAAkB,aAAC,QAAQ,EAAE,GAAG,IAAM,KAAK,EAAI,EAAhD,CAAgD,CAAC,CAAC;AAE3I,kBAAe,aAAa,CAAC"}
|
|
@@ -21,28 +21,15 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
23
|
import React from 'react';
|
|
24
|
-
import PropTypes from 'prop-types';
|
|
25
24
|
import { ScalprumComponent } from '@scalprum/react-core';
|
|
26
25
|
import { Bullseye, Spinner } from '@patternfly/react-core';
|
|
27
26
|
import classNames from 'classnames';
|
|
28
27
|
var BaseAsyncComponent = function (_a) {
|
|
29
|
-
var appName = _a.appName, scope = _a.scope, module = _a.module,
|
|
28
|
+
var appName = _a.appName, scope = _a.scope, module = _a.module, _b = _a.fallback, fallback = _b === void 0 ? (React.createElement(Bullseye, null,
|
|
29
|
+
React.createElement(Spinner, { size: "xl" }))) : _b, innerRef = _a.innerRef, className = _a.className, _c = _a.component, Cmp = _c === void 0 ? 'section' : _c, props = __rest(_a, ["appName", "scope", "module", "fallback", "innerRef", "className", "component"]);
|
|
30
30
|
return (React.createElement(Cmp, { className: classNames(className, appName) },
|
|
31
|
-
React.createElement(ScalprumComponent, __assign({ className: className, appName: appName, module: module, scope: scope
|
|
31
|
+
React.createElement(ScalprumComponent, __assign({ className: className, appName: appName, module: module, scope: scope !== null && scope !== void 0 ? scope : appName, ErrorComponent: fallback, ref: innerRef, fallback: fallback }, props))));
|
|
32
32
|
};
|
|
33
33
|
var AsynComponent = React.forwardRef(function (props, ref) { return React.createElement(BaseAsyncComponent, __assign({ innerRef: ref }, props)); });
|
|
34
|
-
AsynComponent.propTypes = {
|
|
35
|
-
fallback: PropTypes.node,
|
|
36
|
-
appName: PropTypes.string.isRequired,
|
|
37
|
-
module: PropTypes.string.isRequired,
|
|
38
|
-
scope: PropTypes.string,
|
|
39
|
-
component: PropTypes.string,
|
|
40
|
-
};
|
|
41
|
-
AsynComponent.defaultProps = {
|
|
42
|
-
fallback: (React.createElement(Bullseye, null,
|
|
43
|
-
React.createElement(Spinner, { size: "xl" }))),
|
|
44
|
-
component: 'section',
|
|
45
|
-
};
|
|
46
|
-
BaseAsyncComponent.propTypes = __assign(__assign({}, AsynComponent.propTypes), { innerRef: PropTypes.any });
|
|
47
34
|
export default AsynComponent;
|
|
48
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AsyncComponent/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/AsyncComponent/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,UAAU,MAAM,YAAY,CAAC;AAuBpC,IAAM,kBAAkB,GAAqD,UAAC,EAa7E;IAZC,IAAA,OAAO,aAAA,EACP,KAAK,WAAA,EACL,MAAM,YAAA,EACN,gBAIC,EAJD,QAAQ,mBAAG,CACT,oBAAC,QAAQ;QACP,oBAAC,OAAO,IAAC,IAAI,EAAC,IAAI,GAAG,CACZ,CACZ,KAAA,EACD,QAAQ,cAAA,EACR,SAAS,eAAA,EACT,iBAA0B,EAAf,GAAG,mBAAG,SAAS,KAAA,EACvB,KAAK,cAZoE,gFAa7E,CADS;IAER,OAAO,CACL,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,OAAO,CAAC;QAC5C,oBAAC,iBAAiB,aAChB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,OAAO,EACvB,cAAc,EAAE,QAAQ,EACxB,GAAG,EAAE,QAAQ,EACb,QAAQ,EAAE,QAAQ,IACd,KAAK,EACT,CACE,CACP,CAAC;AACJ,CAAC,CAAC;AAQF,IAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAAmC,UAAC,KAAK,EAAE,GAAG,IAAK,OAAA,oBAAC,kBAAkB,aAAC,QAAQ,EAAE,GAAG,IAAM,KAAK,EAAI,EAAhD,CAAgD,CAAC,CAAC;AAE3I,eAAe,aAAa,CAAC"}
|