@gravity-ui/data-source 0.10.0-alpha.3 → 0.10.0-alpha.4
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/build/cjs/react/components/AsyncBoundary/types.d.ts +2 -2
- package/build/cjs/react/components/AsyncBoundary/types.js.map +1 -1
- package/build/cjs/react/components/AsyncBoundary/withAsyncBoundary.d.ts +3 -2
- package/build/cjs/react/components/AsyncBoundary/withAsyncBoundary.js +9 -5
- package/build/cjs/react/components/AsyncBoundary/withAsyncBoundary.js.map +1 -1
- package/build/cjs/react-query/components/QueryAsyncBoundary/types.d.ts +4 -3
- package/build/cjs/react-query/components/QueryAsyncBoundary/types.js.map +1 -1
- package/build/cjs/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.d.ts +3 -2
- package/build/cjs/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js +9 -5
- package/build/cjs/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js.map +1 -1
- package/build/esm/react/components/AsyncBoundary/types.d.ts +2 -2
- package/build/esm/react/components/AsyncBoundary/types.js.map +1 -1
- package/build/esm/react/components/AsyncBoundary/withAsyncBoundary.d.ts +3 -2
- package/build/esm/react/components/AsyncBoundary/withAsyncBoundary.js +9 -5
- package/build/esm/react/components/AsyncBoundary/withAsyncBoundary.js.map +1 -1
- package/build/esm/react-query/components/QueryAsyncBoundary/types.d.ts +4 -3
- package/build/esm/react-query/components/QueryAsyncBoundary/types.js.map +1 -1
- package/build/esm/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.d.ts +3 -2
- package/build/esm/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js +9 -5
- package/build/esm/react-query/components/QueryAsyncBoundary/withQueryAsyncBoundary.js.map +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,6 @@ export interface AsyncBoundaryProps {
|
|
|
8
8
|
}
|
|
9
9
|
export interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {
|
|
10
10
|
Content: React.ComponentType<TProps>;
|
|
11
|
-
Loading:
|
|
12
|
-
Error:
|
|
11
|
+
Loading: ComponentType<TProps>;
|
|
12
|
+
Error: ComponentType<TProps & ErrorViewProps>;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading:
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TProps>;\n Error: ComponentType<TProps & ErrorViewProps>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { ErrorViewProps } from '../types';
|
|
3
|
+
import type { AsyncBoundaryComponent } from './types';
|
|
4
|
+
export declare const withAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TProps>, ErrorView: React.ComponentType<TProps & ErrorViewProps>) => AsyncBoundaryComponent<TProps>;
|
|
@@ -9,18 +9,22 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _AsyncBoundary = require("./AsyncBoundary");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
var withAsyncBoundary = exports.withAsyncBoundary = function withAsyncBoundary(Component,
|
|
12
|
+
var withAsyncBoundary = exports.withAsyncBoundary = function withAsyncBoundary(Component, _LoadingView, _ErrorView) {
|
|
13
13
|
var WrappedComponent = function WrappedComponent(props) {
|
|
14
14
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AsyncBoundary.AsyncBoundary, {
|
|
15
|
-
LoadingView: LoadingView
|
|
16
|
-
|
|
15
|
+
LoadingView: function LoadingView() {
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingView, (0, _objectSpread2.default)({}, props));
|
|
17
|
+
},
|
|
18
|
+
ErrorView: function ErrorView(errorProps) {
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ErrorView, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), errorProps));
|
|
20
|
+
},
|
|
17
21
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)({}, props))
|
|
18
22
|
});
|
|
19
23
|
};
|
|
20
24
|
WrappedComponent.displayName = "WithAsyncBoundary(".concat(Component.displayName || Component.name, ")");
|
|
21
25
|
WrappedComponent.Content = Component;
|
|
22
|
-
WrappedComponent.Loading =
|
|
23
|
-
WrappedComponent.Error =
|
|
26
|
+
WrappedComponent.Loading = _LoadingView;
|
|
27
|
+
WrappedComponent.Error = _ErrorView;
|
|
24
28
|
return WrappedComponent;
|
|
25
29
|
};
|
|
26
30
|
// #sourceMappingURL=withAsyncBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_AsyncBoundary","_jsxRuntime","e","__esModule","default","withAsyncBoundary","exports","Component","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_AsyncBoundary","_jsxRuntime","e","__esModule","default","withAsyncBoundary","exports","Component","_LoadingView","_ErrorView","WrappedComponent","props","_jsx","AsyncBoundary","LoadingView","_objectSpread","ErrorView","errorProps","children","displayName","concat","name","Content","Loading","Error"],"sources":["withAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport {AsyncBoundary} from './AsyncBoundary';\nimport type {AsyncBoundaryComponent} from './types';\n\nexport const withAsyncBoundary = <TProps extends object>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TProps>,\n ErrorView: React.ComponentType<TProps & ErrorViewProps>,\n) => {\n const WrappedComponent = ((props: TProps) => (\n <AsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </AsyncBoundary>\n )) as AsyncBoundaryComponent<TProps>;\n\n WrappedComponent.displayName = `WithAsyncBoundary(${Component.displayName || Component.name})`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,cAAA,GAAAD,OAAA;AAA8C,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGvC,IAAMG,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,SAApBA,iBAAiBA,CAC1BE,SAAsC,EACtCC,YAAwC,EACxCC,UAAuD,EACtD;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAAa;IAAA,oBACpC,IAAAC,eAAA,EAACC,4BAAa;MACVC,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQ,IAAAF,eAAA,EAACJ,YAAW,MAAAO,sBAAA,MAAKJ,KAAK,CAAG,CAAC;MAAA,CAAC;MAC9CK,SAAS,EAAE,SAAXA,SAASA,CAAGC,UAAU;QAAA,oBAAK,IAAAL,eAAA,EAACH,UAAS,MAAAM,sBAAA,MAAAA,sBAAA,MAAKJ,KAAK,GAAMM,UAAU,CAAG,CAAC;MAAA,CAAC;MAAAC,QAAA,eAEpE,IAAAN,eAAA,EAACL,SAAS,MAAAQ,sBAAA,MAAKJ,KAAK,CAAG;IAAC,CACb,CAAC;EAAA,CACgB;EAEpCD,gBAAgB,CAACS,WAAW,wBAAAC,MAAA,CAAwBb,SAAS,CAACY,WAAW,IAAIZ,SAAS,CAACc,IAAI,MAAG;EAE9FX,gBAAgB,CAACY,OAAO,GAAGf,SAAS;EACpCG,gBAAgB,CAACa,OAAO,GAAGf,YAAW;EACtCE,gBAAgB,CAACc,KAAK,GAAGf,UAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { AsyncBoundaryProps, ErrorViewProps } from '../../../react';
|
|
2
3
|
export interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {
|
|
3
4
|
}
|
|
4
5
|
export interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {
|
|
5
6
|
Content: React.ComponentType<TProps>;
|
|
6
|
-
Loading:
|
|
7
|
-
Error:
|
|
7
|
+
Loading: ComponentType<TProps>;
|
|
8
|
+
Error: ComponentType<TProps & ErrorViewProps>;
|
|
8
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {AsyncBoundaryProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading:
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType} from 'react';\n\nimport type {AsyncBoundaryProps, ErrorViewProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TProps>;\n Error: ComponentType<TProps & ErrorViewProps>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { ErrorViewProps } from '../../../react';
|
|
3
|
+
import type { QueryAsyncBoundaryComponent } from './types';
|
|
4
|
+
export declare const withQueryAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TProps>, ErrorView: React.ComponentType<TProps & ErrorViewProps>) => QueryAsyncBoundaryComponent<TProps>;
|
|
@@ -9,18 +9,22 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
var _QueryAsyncBoundary = require("./QueryAsyncBoundary");
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
var withQueryAsyncBoundary = exports.withQueryAsyncBoundary = function withQueryAsyncBoundary(Component,
|
|
12
|
+
var withQueryAsyncBoundary = exports.withQueryAsyncBoundary = function withQueryAsyncBoundary(Component, _LoadingView, _ErrorView) {
|
|
13
13
|
var WrappedComponent = function WrappedComponent(props) {
|
|
14
14
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_QueryAsyncBoundary.QueryAsyncBoundary, {
|
|
15
|
-
LoadingView: LoadingView
|
|
16
|
-
|
|
15
|
+
LoadingView: function LoadingView() {
|
|
16
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_LoadingView, (0, _objectSpread2.default)({}, props));
|
|
17
|
+
},
|
|
18
|
+
ErrorView: function ErrorView(errorProps) {
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ErrorView, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, props), errorProps));
|
|
20
|
+
},
|
|
17
21
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Component, (0, _objectSpread2.default)({}, props))
|
|
18
22
|
});
|
|
19
23
|
};
|
|
20
24
|
WrappedComponent.displayName = "WithQueryAsyncBoundary(".concat(Component.displayName || Component.name, ")");
|
|
21
25
|
WrappedComponent.Content = Component;
|
|
22
|
-
WrappedComponent.Loading =
|
|
23
|
-
WrappedComponent.Error =
|
|
26
|
+
WrappedComponent.Loading = _LoadingView;
|
|
27
|
+
WrappedComponent.Error = _ErrorView;
|
|
24
28
|
return WrappedComponent;
|
|
25
29
|
};
|
|
26
30
|
// #sourceMappingURL=withQueryAsyncBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_QueryAsyncBoundary","_jsxRuntime","e","__esModule","default","withQueryAsyncBoundary","exports","Component","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_QueryAsyncBoundary","_jsxRuntime","e","__esModule","default","withQueryAsyncBoundary","exports","Component","_LoadingView","_ErrorView","WrappedComponent","props","_jsx","QueryAsyncBoundary","LoadingView","_objectSpread","ErrorView","errorProps","children","displayName","concat","name","Content","Loading","Error"],"sources":["withQueryAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../../../react';\n\nimport {QueryAsyncBoundary} from './QueryAsyncBoundary';\nimport type {QueryAsyncBoundaryComponent} from './types';\n\nexport const withQueryAsyncBoundary = <TProps extends object>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TProps>,\n ErrorView: React.ComponentType<TProps & ErrorViewProps>,\n) => {\n const WrappedComponent = ((props: TProps) => (\n <QueryAsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </QueryAsyncBoundary>\n )) as QueryAsyncBoundaryComponent<TProps>;\n\n WrappedComponent.displayName = `WithQueryAsyncBoundary(${\n Component.displayName || Component.name\n })`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIA,IAAAC,mBAAA,GAAAD,OAAA;AAAwD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,IAAMG,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,GAAG,SAAzBA,sBAAsBA,CAC/BE,SAAsC,EACtCC,YAAwC,EACxCC,UAAuD,EACtD;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAAa;IAAA,oBACpC,IAAAC,eAAA,EAACC,sCAAkB;MACfC,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQ,IAAAF,eAAA,EAACJ,YAAW,MAAAO,sBAAA,MAAKJ,KAAK,CAAG,CAAC;MAAA,CAAC;MAC9CK,SAAS,EAAE,SAAXA,SAASA,CAAGC,UAAU;QAAA,oBAAK,IAAAL,eAAA,EAACH,UAAS,MAAAM,sBAAA,MAAAA,sBAAA,MAAKJ,KAAK,GAAMM,UAAU,CAAG,CAAC;MAAA,CAAC;MAAAC,QAAA,eAEpE,IAAAN,eAAA,EAACL,SAAS,MAAAQ,sBAAA,MAAKJ,KAAK,CAAG;IAAC,CACR,CAAC;EAAA,CACgB;EAEzCD,gBAAgB,CAACS,WAAW,6BAAAC,MAAA,CACxBb,SAAS,CAACY,WAAW,IAAIZ,SAAS,CAACc,IAAI,MACxC;EAEHX,gBAAgB,CAACY,OAAO,GAAGf,SAAS;EACpCG,gBAAgB,CAACa,OAAO,GAAGf,YAAW;EACtCE,gBAAgB,CAACc,KAAK,GAAGf,UAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -8,6 +8,6 @@ export interface AsyncBoundaryProps {
|
|
|
8
8
|
}
|
|
9
9
|
export interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {
|
|
10
10
|
Content: React.ComponentType<TProps>;
|
|
11
|
-
Loading:
|
|
12
|
-
Error:
|
|
11
|
+
Loading: ComponentType<TProps>;
|
|
12
|
+
Error: ComponentType<TProps & ErrorViewProps>;
|
|
13
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading:
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nexport interface AsyncBoundaryProps {\n LoadingView: ComponentType;\n ErrorView: ComponentType<ErrorViewProps>;\n onReset?: () => void;\n children: ReactNode;\n}\n\nexport interface AsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TProps>;\n Error: ComponentType<TProps & ErrorViewProps>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { ErrorViewProps } from '../types';
|
|
3
|
+
import type { AsyncBoundaryComponent } from './types';
|
|
4
|
+
export declare const withAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TProps>, ErrorView: React.ComponentType<TProps & ErrorViewProps>) => AsyncBoundaryComponent<TProps>;
|
|
@@ -2,18 +2,22 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { AsyncBoundary } from './AsyncBoundary';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
export var withAsyncBoundary = function withAsyncBoundary(Component,
|
|
5
|
+
export var withAsyncBoundary = function withAsyncBoundary(Component, _LoadingView, _ErrorView) {
|
|
6
6
|
var WrappedComponent = function WrappedComponent(props) {
|
|
7
7
|
return /*#__PURE__*/_jsx(AsyncBoundary, {
|
|
8
|
-
LoadingView: LoadingView
|
|
9
|
-
|
|
8
|
+
LoadingView: function LoadingView() {
|
|
9
|
+
return /*#__PURE__*/_jsx(_LoadingView, _objectSpread({}, props));
|
|
10
|
+
},
|
|
11
|
+
ErrorView: function ErrorView(errorProps) {
|
|
12
|
+
return /*#__PURE__*/_jsx(_ErrorView, _objectSpread(_objectSpread({}, props), errorProps));
|
|
13
|
+
},
|
|
10
14
|
children: /*#__PURE__*/_jsx(Component, _objectSpread({}, props))
|
|
11
15
|
});
|
|
12
16
|
};
|
|
13
17
|
WrappedComponent.displayName = "WithAsyncBoundary(".concat(Component.displayName || Component.name, ")");
|
|
14
18
|
WrappedComponent.Content = Component;
|
|
15
|
-
WrappedComponent.Loading =
|
|
16
|
-
WrappedComponent.Error =
|
|
19
|
+
WrappedComponent.Loading = _LoadingView;
|
|
20
|
+
WrappedComponent.Error = _ErrorView;
|
|
17
21
|
return WrappedComponent;
|
|
18
22
|
};
|
|
19
23
|
// #sourceMappingURL=withAsyncBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","AsyncBoundary","jsx","_jsx","withAsyncBoundary","Component","LoadingView","ErrorView","WrappedComponent","props","
|
|
1
|
+
{"version":3,"names":["React","AsyncBoundary","jsx","_jsx","withAsyncBoundary","Component","LoadingView","ErrorView","WrappedComponent","props","_LoadingView","_objectSpread","errorProps","_ErrorView","children","displayName","concat","name","Content","Loading","Error"],"sources":["withAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport {AsyncBoundary} from './AsyncBoundary';\nimport type {AsyncBoundaryComponent} from './types';\n\nexport const withAsyncBoundary = <TProps extends object>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TProps>,\n ErrorView: React.ComponentType<TProps & ErrorViewProps>,\n) => {\n const WrappedComponent = ((props: TProps) => (\n <AsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </AsyncBoundary>\n )) as AsyncBoundaryComponent<TProps>;\n\n WrappedComponent.displayName = `WithAsyncBoundary(${Component.displayName || Component.name})`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,SAAQC,aAAa,QAAO,iBAAiB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG9C,OAAO,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAC1BC,SAAsC,EACtCC,YAAwC,EACxCC,UAAuD,EACtD;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAAa;IAAA,oBACpCN,IAAA,CAACF,aAAa;MACVK,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQH,IAAA,CAACO,YAAW,EAAAC,aAAA,KAAKF,KAAK,CAAG,CAAC;MAAA,CAAC;MAC9CF,SAAS,EAAE,SAAXA,SAASA,CAAGK,UAAU;QAAA,oBAAKT,IAAA,CAACU,UAAS,EAAAF,aAAA,CAAAA,aAAA,KAAKF,KAAK,GAAMG,UAAU,CAAG,CAAC;MAAA,CAAC;MAAAE,QAAA,eAEpEX,IAAA,CAACE,SAAS,EAAAM,aAAA,KAAKF,KAAK,CAAG;IAAC,CACb,CAAC;EAAA,CACgB;EAEpCD,gBAAgB,CAACO,WAAW,wBAAAC,MAAA,CAAwBX,SAAS,CAACU,WAAW,IAAIV,SAAS,CAACY,IAAI,MAAG;EAE9FT,gBAAgB,CAACU,OAAO,GAAGb,SAAS;EACpCG,gBAAgB,CAACW,OAAO,GAAGb,YAAW;EACtCE,gBAAgB,CAACY,KAAK,GAAGb,UAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import type { AsyncBoundaryProps, ErrorViewProps } from '../../../react';
|
|
2
3
|
export interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {
|
|
3
4
|
}
|
|
4
5
|
export interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {
|
|
5
6
|
Content: React.ComponentType<TProps>;
|
|
6
|
-
Loading:
|
|
7
|
-
Error:
|
|
7
|
+
Loading: ComponentType<TProps>;
|
|
8
|
+
Error: ComponentType<TProps & ErrorViewProps>;
|
|
8
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {AsyncBoundaryProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading:
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType} from 'react';\n\nimport type {AsyncBoundaryProps, ErrorViewProps} from '../../../react';\n\nexport interface QueryAsyncBoundaryProps extends AsyncBoundaryProps {}\n\nexport interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TProps>;\n Error: ComponentType<TProps & ErrorViewProps>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type { ErrorViewProps } from '../../../react';
|
|
3
|
+
import type { QueryAsyncBoundaryComponent } from './types';
|
|
4
|
+
export declare const withQueryAsyncBoundary: <TProps extends object>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TProps>, ErrorView: React.ComponentType<TProps & ErrorViewProps>) => QueryAsyncBoundaryComponent<TProps>;
|
|
@@ -2,18 +2,22 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { QueryAsyncBoundary } from './QueryAsyncBoundary';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
export var withQueryAsyncBoundary = function withQueryAsyncBoundary(Component,
|
|
5
|
+
export var withQueryAsyncBoundary = function withQueryAsyncBoundary(Component, _LoadingView, _ErrorView) {
|
|
6
6
|
var WrappedComponent = function WrappedComponent(props) {
|
|
7
7
|
return /*#__PURE__*/_jsx(QueryAsyncBoundary, {
|
|
8
|
-
LoadingView: LoadingView
|
|
9
|
-
|
|
8
|
+
LoadingView: function LoadingView() {
|
|
9
|
+
return /*#__PURE__*/_jsx(_LoadingView, _objectSpread({}, props));
|
|
10
|
+
},
|
|
11
|
+
ErrorView: function ErrorView(errorProps) {
|
|
12
|
+
return /*#__PURE__*/_jsx(_ErrorView, _objectSpread(_objectSpread({}, props), errorProps));
|
|
13
|
+
},
|
|
10
14
|
children: /*#__PURE__*/_jsx(Component, _objectSpread({}, props))
|
|
11
15
|
});
|
|
12
16
|
};
|
|
13
17
|
WrappedComponent.displayName = "WithQueryAsyncBoundary(".concat(Component.displayName || Component.name, ")");
|
|
14
18
|
WrappedComponent.Content = Component;
|
|
15
|
-
WrappedComponent.Loading =
|
|
16
|
-
WrappedComponent.Error =
|
|
19
|
+
WrappedComponent.Loading = _LoadingView;
|
|
20
|
+
WrappedComponent.Error = _ErrorView;
|
|
17
21
|
return WrappedComponent;
|
|
18
22
|
};
|
|
19
23
|
// #sourceMappingURL=withQueryAsyncBoundary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","QueryAsyncBoundary","jsx","_jsx","withQueryAsyncBoundary","Component","LoadingView","ErrorView","WrappedComponent","props","
|
|
1
|
+
{"version":3,"names":["React","QueryAsyncBoundary","jsx","_jsx","withQueryAsyncBoundary","Component","LoadingView","ErrorView","WrappedComponent","props","_LoadingView","_objectSpread","errorProps","_ErrorView","children","displayName","concat","name","Content","Loading","Error"],"sources":["withQueryAsyncBoundary.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../../../react';\n\nimport {QueryAsyncBoundary} from './QueryAsyncBoundary';\nimport type {QueryAsyncBoundaryComponent} from './types';\n\nexport const withQueryAsyncBoundary = <TProps extends object>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TProps>,\n ErrorView: React.ComponentType<TProps & ErrorViewProps>,\n) => {\n const WrappedComponent = ((props: TProps) => (\n <QueryAsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </QueryAsyncBoundary>\n )) as QueryAsyncBoundaryComponent<TProps>;\n\n WrappedComponent.displayName = `WithQueryAsyncBoundary(${\n Component.displayName || Component.name\n })`;\n\n WrappedComponent.Content = Component;\n WrappedComponent.Loading = LoadingView;\n WrappedComponent.Error = ErrorView;\n\n return WrappedComponent;\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAIzB,SAAQC,kBAAkB,QAAO,sBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAGxD,OAAO,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAC/BC,SAAsC,EACtCC,YAAwC,EACxCC,UAAuD,EACtD;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAAa;IAAA,oBACpCN,IAAA,CAACF,kBAAkB;MACfK,WAAW,EAAE,SAAbA,WAAWA,CAAA;QAAA,oBAAQH,IAAA,CAACO,YAAW,EAAAC,aAAA,KAAKF,KAAK,CAAG,CAAC;MAAA,CAAC;MAC9CF,SAAS,EAAE,SAAXA,SAASA,CAAGK,UAAU;QAAA,oBAAKT,IAAA,CAACU,UAAS,EAAAF,aAAA,CAAAA,aAAA,KAAKF,KAAK,GAAMG,UAAU,CAAG,CAAC;MAAA,CAAC;MAAAE,QAAA,eAEpEX,IAAA,CAACE,SAAS,EAAAM,aAAA,KAAKF,KAAK,CAAG;IAAC,CACR,CAAC;EAAA,CACgB;EAEzCD,gBAAgB,CAACO,WAAW,6BAAAC,MAAA,CACxBX,SAAS,CAACU,WAAW,IAAIV,SAAS,CAACY,IAAI,MACxC;EAEHT,gBAAgB,CAACU,OAAO,GAAGb,SAAS;EACpCG,gBAAgB,CAACW,OAAO,GAAGb,YAAW;EACtCE,gBAAgB,CAACY,KAAK,GAAGb,UAAS;EAElC,OAAOC,gBAAgB;AAC3B,CAAC","ignoreList":[]}
|