@gravity-ui/data-source 0.1.2 → 0.2.1
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/core/types/DataSource.d.ts +3 -3
- package/build/cjs/core/types/DataSource.js.map +1 -1
- package/build/cjs/react/components/DataInfiniteLoader/DataInfiniteLoader.d.ts +1 -1
- package/build/cjs/react/components/DataInfiniteLoader/DataInfiniteLoader.js +12 -8
- package/build/cjs/react/components/DataInfiniteLoader/DataInfiniteLoader.js.map +1 -1
- package/build/cjs/react/components/DataInfiniteLoader/types.d.ts +7 -4
- package/build/cjs/react/components/DataInfiniteLoader/types.js.map +1 -1
- package/build/cjs/react/components/DataLoader/DataLoader.d.ts +1 -1
- package/build/cjs/react/components/DataLoader/DataLoader.js +6 -3
- package/build/cjs/react/components/DataLoader/DataLoader.js.map +1 -1
- package/build/cjs/react/components/DataLoader/types.d.ts +5 -3
- package/build/cjs/react/components/DataLoader/types.js.map +1 -1
- package/build/cjs/react-query/impl/infinite/types.d.ts +3 -3
- package/build/cjs/react-query/impl/infinite/types.js.map +1 -1
- package/build/cjs/react-query/impl/infinite/utils.d.ts +1 -1
- package/build/cjs/react-query/impl/infinite/utils.js +6 -11
- package/build/cjs/react-query/impl/infinite/utils.js.map +1 -1
- package/build/esm/core/types/DataSource.d.ts +3 -3
- package/build/esm/core/types/DataSource.js.map +1 -1
- package/build/esm/react/components/DataInfiniteLoader/DataInfiniteLoader.d.ts +1 -1
- package/build/esm/react/components/DataInfiniteLoader/DataInfiniteLoader.js +12 -8
- package/build/esm/react/components/DataInfiniteLoader/DataInfiniteLoader.js.map +1 -1
- package/build/esm/react/components/DataInfiniteLoader/types.d.ts +7 -4
- package/build/esm/react/components/DataInfiniteLoader/types.js.map +1 -1
- package/build/esm/react/components/DataLoader/DataLoader.d.ts +1 -1
- package/build/esm/react/components/DataLoader/DataLoader.js +6 -3
- package/build/esm/react/components/DataLoader/DataLoader.js.map +1 -1
- package/build/esm/react/components/DataLoader/types.d.ts +5 -3
- package/build/esm/react/components/DataLoader/types.js.map +1 -1
- package/build/esm/react-query/impl/infinite/types.d.ts +3 -3
- package/build/esm/react-query/impl/infinite/types.js.map +1 -1
- package/build/esm/react-query/impl/infinite/utils.d.ts +1 -1
- package/build/esm/react-query/impl/infinite/utils.js +6 -11
- package/build/esm/react-query/impl/infinite/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ declare const stateHintSymbol: unique symbol;
|
|
|
6
6
|
export interface DataSource<TContext, TParams, TRequest, TResponse, TData, TError, TOptions, TState, TFetchContext> {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
fetch: (context: TContext, fetchContext: TFetchContext, request: TRequest) => Promise<TResponse> | TResponse;
|
|
9
|
-
tags?: (params: ActualParams<
|
|
9
|
+
tags?: (params: ActualParams<TParams, TRequest>) => DataSourceTag[];
|
|
10
10
|
transformParams?: (params: TParams) => TRequest;
|
|
11
11
|
transformResponse?: (response: TResponse) => TData;
|
|
12
12
|
[errorHintSymbol]?: TError;
|
|
@@ -15,7 +15,7 @@ export interface DataSource<TContext, TParams, TRequest, TResponse, TData, TErro
|
|
|
15
15
|
}
|
|
16
16
|
export type AnyDataSource = DataSource<any, any, any, any, any, any, any, any, any>;
|
|
17
17
|
export type DataSourceContext<TDataSource> = TDataSource extends DataSource<infer TContext, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TContext : never;
|
|
18
|
-
export type DataSourceParams<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer TParams, infer TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? ActualParams<
|
|
18
|
+
export type DataSourceParams<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer TParams, infer TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? ActualParams<TParams, TRequest> : never;
|
|
19
19
|
export type DataSourceRequest<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TRequest : never;
|
|
20
20
|
export type DataSourceResponse<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TResponse : never;
|
|
21
21
|
export type DataSourceData<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer TResponse, infer TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? ActualData<TData, TResponse> : never;
|
|
@@ -23,6 +23,6 @@ export type DataSourceError<TDataSource> = TDataSource extends DataSource<infer
|
|
|
23
23
|
export type DataSourceOptions<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer TOptions, infer _TState, infer _TFetchContext> ? TOptions : never;
|
|
24
24
|
export type DataSourceState<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer TState, infer _TFetchContext> ? TState : never;
|
|
25
25
|
export type DataSourceFetchContext<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer TFetchContext> ? TFetchContext : never;
|
|
26
|
-
export type ActualParams<
|
|
26
|
+
export type ActualParams<TParams, TRequest> = (unknown extends TParams ? TRequest : TParams) | typeof idle;
|
|
27
27
|
export type ActualData<TData, TResponse> = unknown extends TData ? TResponse : TData;
|
|
28
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["DataSource.ts"],"sourcesContent":["import type {idle} from '../constants';\n\nexport type DataSourceKey = readonly unknown[];\nexport type DataSourceTag = string;\n\ndeclare const errorHintSymbol: unique symbol;\ndeclare const stateHintSymbol: unique symbol;\n\nexport interface DataSource<\n TContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n TOptions,\n TState,\n TFetchContext,\n> {\n readonly name: string;\n\n fetch: (\n context: TContext,\n fetchContext: TFetchContext,\n request: TRequest,\n ) => Promise<TResponse> | TResponse;\n tags?: (params: ActualParams<
|
|
1
|
+
{"version":3,"names":[],"sources":["DataSource.ts"],"sourcesContent":["import type {idle} from '../constants';\n\nexport type DataSourceKey = readonly unknown[];\nexport type DataSourceTag = string;\n\ndeclare const errorHintSymbol: unique symbol;\ndeclare const stateHintSymbol: unique symbol;\n\nexport interface DataSource<\n TContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n TOptions,\n TState,\n TFetchContext,\n> {\n readonly name: string;\n\n fetch: (\n context: TContext,\n fetchContext: TFetchContext,\n request: TRequest,\n ) => Promise<TResponse> | TResponse;\n tags?: (params: ActualParams<TParams, TRequest>) => DataSourceTag[];\n\n transformParams?: (params: TParams) => TRequest;\n transformResponse?: (response: TResponse) => TData;\n\n [errorHintSymbol]?: TError;\n\n options?: TOptions;\n [stateHintSymbol]?: TState;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyDataSource = DataSource<any, any, any, any, any, any, any, any, any>;\n\nexport type DataSourceContext<TDataSource> =\n TDataSource extends DataSource<\n infer TContext,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TContext\n : never;\n\nexport type DataSourceParams<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer TParams,\n infer TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? ActualParams<TParams, TRequest>\n : never;\n\nexport type DataSourceRequest<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TRequest\n : never;\n\nexport type DataSourceResponse<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TResponse\n : never;\n\nexport type DataSourceData<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer TResponse,\n infer TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? ActualData<TData, TResponse>\n : never;\n\nexport type DataSourceError<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TError\n : never;\n\nexport type DataSourceOptions<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TOptions\n : never;\n\nexport type DataSourceState<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer TState,\n infer _TFetchContext\n >\n ? TState\n : never;\n\nexport type DataSourceFetchContext<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer TFetchContext\n >\n ? TFetchContext\n : never;\n\nexport type ActualParams<TParams, TRequest> =\n | (unknown extends TParams ? TRequest : TParams)\n | typeof idle;\n\nexport type ActualData<TData, TResponse> = unknown extends TData ? TResponse : TData;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DataInfiniteLoaderProps } from './types';
|
|
3
|
-
export declare const DataInfiniteLoader: <TError>({ status, error, errorAction: errorActionProp, hasNextPage, fetchNextPage, isFetchingNextPage, LoadingView, ErrorView, MoreView, children, }: DataInfiniteLoaderProps<TError>) => React.ReactNode;
|
|
3
|
+
export declare const DataInfiniteLoader: <TError>({ status, error, errorAction: errorActionProp, hasNextPage, fetchNextPage, isFetchingNextPage, LoadingView, ErrorView, MoreView, loadingViewProps, errorViewProps, moreViewProps, children, }: DataInfiniteLoaderProps<TError>) => React.ReactNode;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DataInfiniteLoader = void 0;
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -17,32 +18,35 @@ var DataInfiniteLoader = exports.DataInfiniteLoader = function DataInfiniteLoade
|
|
|
17
18
|
LoadingView = _ref.LoadingView,
|
|
18
19
|
ErrorView = _ref.ErrorView,
|
|
19
20
|
MoreView = _ref.MoreView,
|
|
21
|
+
loadingViewProps = _ref.loadingViewProps,
|
|
22
|
+
errorViewProps = _ref.errorViewProps,
|
|
23
|
+
moreViewProps = _ref.moreViewProps,
|
|
20
24
|
children = _ref.children;
|
|
21
25
|
var errorAction = _react.default.useMemo(function () {
|
|
22
26
|
return typeof errorActionProp === 'function' ? {
|
|
23
27
|
handler: errorActionProp
|
|
24
28
|
} : errorActionProp;
|
|
25
29
|
}, [errorActionProp]);
|
|
26
|
-
var
|
|
30
|
+
var renderContent = function renderContent() {
|
|
27
31
|
if (status === 'loading') {
|
|
28
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingView, {});
|
|
32
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingView, (0, _objectSpread2.default)({}, loadingViewProps));
|
|
29
33
|
}
|
|
30
34
|
if (status === 'error') {
|
|
31
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ErrorView, {
|
|
35
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ErrorView, (0, _objectSpread2.default)({
|
|
32
36
|
error: error,
|
|
33
37
|
action: errorAction
|
|
34
|
-
});
|
|
38
|
+
}, errorViewProps));
|
|
35
39
|
}
|
|
36
40
|
if (status === 'success' && hasNextPage) {
|
|
37
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MoreView, {
|
|
41
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(MoreView, (0, _objectSpread2.default)({
|
|
38
42
|
isLoading: isFetchingNextPage,
|
|
39
43
|
onClick: fetchNextPage
|
|
40
|
-
});
|
|
44
|
+
}, moreViewProps));
|
|
41
45
|
}
|
|
42
46
|
return null;
|
|
43
|
-
}
|
|
47
|
+
};
|
|
44
48
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
45
|
-
children: [status === 'success' ? children : null,
|
|
49
|
+
children: [status === 'success' ? children : null, renderContent()]
|
|
46
50
|
});
|
|
47
51
|
};
|
|
48
52
|
// #sourceMappingURL=DataInfiniteLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","DataInfiniteLoader","exports","_ref","status","error","errorActionProp","errorAction","hasNextPage","fetchNextPage","isFetchingNextPage","LoadingView","ErrorView","MoreView","children","React","useMemo","handler","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","DataInfiniteLoader","exports","_ref","status","error","errorActionProp","errorAction","hasNextPage","fetchNextPage","isFetchingNextPage","LoadingView","ErrorView","MoreView","loadingViewProps","errorViewProps","moreViewProps","children","React","useMemo","handler","renderContent","_jsx","_objectSpread","action","isLoading","onClick","_jsxs","_Fragment"],"sources":["DataInfiniteLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport type {DataInfiniteLoaderProps} from './types';\n\nexport const DataInfiniteLoader = <TError,>({\n status,\n error,\n errorAction: errorActionProp,\n hasNextPage,\n fetchNextPage,\n isFetchingNextPage,\n LoadingView,\n ErrorView,\n MoreView,\n loadingViewProps,\n errorViewProps,\n moreViewProps,\n children,\n}: DataInfiniteLoaderProps<TError>): React.ReactNode => {\n const errorAction = React.useMemo<ErrorViewProps<TError>['action']>(\n () =>\n typeof errorActionProp === 'function' ? {handler: errorActionProp} : errorActionProp,\n [errorActionProp],\n );\n\n const renderContent = () => {\n if (status === 'loading') {\n return <LoadingView {...loadingViewProps} />;\n }\n\n if (status === 'error') {\n return <ErrorView error={error} action={errorAction} {...errorViewProps} />;\n }\n\n if (status === 'success' && hasNextPage) {\n return (\n <MoreView\n isLoading={isFetchingNextPage}\n onClick={fetchNextPage}\n {...moreViewProps}\n />\n );\n }\n\n return null;\n };\n\n return (\n <>\n {status === 'success' ? children : null}\n {renderContent()}\n </>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAMnB,IAAMG,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,SAArBA,kBAAkBA,CAAAE,IAAA,EAcyB;EAAA,IAbpDC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACQC,eAAe,GAAAH,IAAA,CAA5BI,WAAW;IACXC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,kBAAkB,GAAAP,IAAA,CAAlBO,kBAAkB;IAClBC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;IACXC,SAAS,GAAAT,IAAA,CAATS,SAAS;IACTC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;IACRC,gBAAgB,GAAAX,IAAA,CAAhBW,gBAAgB;IAChBC,cAAc,GAAAZ,IAAA,CAAdY,cAAc;IACdC,aAAa,GAAAb,IAAA,CAAba,aAAa;IACbC,QAAQ,GAAAd,IAAA,CAARc,QAAQ;EAER,IAAMV,WAAW,GAAGW,cAAK,CAACC,OAAO,CAC7B;IAAA,OACI,OAAOb,eAAe,KAAK,UAAU,GAAG;MAACc,OAAO,EAAEd;IAAe,CAAC,GAAGA,eAAe;EAAA,GACxF,CAACA,eAAe,CACpB,CAAC;EAED,IAAMe,aAAa,GAAG,SAAhBA,aAAaA,CAAA,EAAS;IACxB,IAAIjB,MAAM,KAAK,SAAS,EAAE;MACtB,oBAAO,IAAAkB,eAAA,EAACX,WAAW,MAAAY,sBAAA,MAAKT,gBAAgB,CAAG,CAAC;IAChD;IAEA,IAAIV,MAAM,KAAK,OAAO,EAAE;MACpB,oBAAO,IAAAkB,eAAA,EAACV,SAAS,MAAAW,sBAAA;QAAClB,KAAK,EAAEA,KAAM;QAACmB,MAAM,EAAEjB;MAAY,GAAKQ,cAAc,CAAG,CAAC;IAC/E;IAEA,IAAIX,MAAM,KAAK,SAAS,IAAII,WAAW,EAAE;MACrC,oBACI,IAAAc,eAAA,EAACT,QAAQ,MAAAU,sBAAA;QACLE,SAAS,EAAEf,kBAAmB;QAC9BgB,OAAO,EAAEjB;MAAc,GACnBO,aAAa,CACpB,CAAC;IAEV;IAEA,OAAO,IAAI;EACf,CAAC;EAED,oBACI,IAAAW,gBAAA,EAAAC,oBAAA;IAAAX,QAAA,GACKb,MAAM,KAAK,SAAS,GAAGa,QAAQ,GAAG,IAAI,EACtCI,aAAa,CAAC,CAAC;EAAA,CAClB,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -5,15 +5,18 @@ export interface MoreViewProps {
|
|
|
5
5
|
isLoading: boolean;
|
|
6
6
|
onClick: () => void;
|
|
7
7
|
}
|
|
8
|
-
export interface DataInfiniteLoaderProps<TError> {
|
|
8
|
+
export interface DataInfiniteLoaderProps<TError, TLoadingViewProps extends {} = {}, TErrorViewProps extends ErrorViewProps<TError> = ErrorViewProps<TError>, TMoreViewProps extends MoreViewProps = MoreViewProps> {
|
|
9
9
|
status: DataLoaderStatus;
|
|
10
10
|
error: TError | null;
|
|
11
11
|
errorAction?: ErrorAction | ErrorAction['handler'];
|
|
12
12
|
hasNextPage: boolean;
|
|
13
13
|
fetchNextPage: () => unknown;
|
|
14
14
|
isFetchingNextPage: boolean;
|
|
15
|
-
LoadingView: ComponentType
|
|
16
|
-
ErrorView: ComponentType<
|
|
17
|
-
MoreView: ComponentType<
|
|
15
|
+
LoadingView: ComponentType<TLoadingViewProps>;
|
|
16
|
+
ErrorView: ComponentType<TErrorViewProps>;
|
|
17
|
+
MoreView: ComponentType<TMoreViewProps>;
|
|
18
|
+
loadingViewProps?: TLoadingViewProps;
|
|
19
|
+
errorViewProps?: Omit<TErrorViewProps, keyof ErrorViewProps<TError>>;
|
|
20
|
+
moreViewProps?: Omit<TMoreViewProps, keyof MoreViewProps>;
|
|
18
21
|
children: ReactNode;
|
|
19
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {DataLoaderStatus} from '../../../core';\nimport type {ErrorAction, ErrorViewProps} from '../types';\n\nexport interface MoreViewProps {\n isLoading: boolean;\n onClick: () => void;\n}\n\nexport interface DataInfiniteLoaderProps<TError> {\n status: DataLoaderStatus;\n error: TError | null;\n errorAction?: ErrorAction | ErrorAction['handler'];\n hasNextPage: boolean;\n fetchNextPage: () => unknown;\n isFetchingNextPage: boolean;\n LoadingView: ComponentType
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {DataLoaderStatus} from '../../../core';\nimport type {ErrorAction, ErrorViewProps} from '../types';\n\nexport interface MoreViewProps {\n isLoading: boolean;\n onClick: () => void;\n}\n\nexport interface DataInfiniteLoaderProps<\n TError,\n TLoadingViewProps extends {} = {},\n TErrorViewProps extends ErrorViewProps<TError> = ErrorViewProps<TError>,\n TMoreViewProps extends MoreViewProps = MoreViewProps,\n> {\n status: DataLoaderStatus;\n error: TError | null;\n errorAction?: ErrorAction | ErrorAction['handler'];\n hasNextPage: boolean;\n fetchNextPage: () => unknown;\n isFetchingNextPage: boolean;\n LoadingView: ComponentType<TLoadingViewProps>;\n ErrorView: ComponentType<TErrorViewProps>;\n MoreView: ComponentType<TMoreViewProps>;\n loadingViewProps?: TLoadingViewProps;\n errorViewProps?: Omit<TErrorViewProps, keyof ErrorViewProps<TError>>;\n moreViewProps?: Omit<TMoreViewProps, keyof MoreViewProps>;\n children: ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DataLoaderProps } from './types';
|
|
3
|
-
export declare const DataLoader: <TError>({ status, error, errorAction: errorActionProp, LoadingView, ErrorView, children, }: DataLoaderProps<TError>) => React.ReactNode;
|
|
3
|
+
export declare const DataLoader: <TError>({ status, error, errorAction: errorActionProp, LoadingView, ErrorView, loadingViewProps, errorViewProps, children, }: DataLoaderProps<TError>) => React.ReactNode;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DataLoader = void 0;
|
|
7
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
7
8
|
var _react = _interopRequireDefault(require("react"));
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -13,6 +14,8 @@ var DataLoader = exports.DataLoader = function DataLoader(_ref) {
|
|
|
13
14
|
errorActionProp = _ref.errorAction,
|
|
14
15
|
LoadingView = _ref.LoadingView,
|
|
15
16
|
ErrorView = _ref.ErrorView,
|
|
17
|
+
loadingViewProps = _ref.loadingViewProps,
|
|
18
|
+
errorViewProps = _ref.errorViewProps,
|
|
16
19
|
children = _ref.children;
|
|
17
20
|
var errorAction = _react.default.useMemo(function () {
|
|
18
21
|
return typeof errorActionProp === 'function' ? {
|
|
@@ -20,13 +23,13 @@ var DataLoader = exports.DataLoader = function DataLoader(_ref) {
|
|
|
20
23
|
} : errorActionProp;
|
|
21
24
|
}, [errorActionProp]);
|
|
22
25
|
if (status === 'loading') {
|
|
23
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingView, {});
|
|
26
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LoadingView, (0, _objectSpread2.default)({}, loadingViewProps));
|
|
24
27
|
}
|
|
25
28
|
if (status === 'error') {
|
|
26
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ErrorView, {
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ErrorView, (0, _objectSpread2.default)({
|
|
27
30
|
error: error,
|
|
28
31
|
action: errorAction
|
|
29
|
-
});
|
|
32
|
+
}, errorViewProps));
|
|
30
33
|
}
|
|
31
34
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
32
35
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","DataLoader","exports","_ref","status","error","errorActionProp","errorAction","LoadingView","ErrorView","children","React","useMemo","handler","_jsx","action","_Fragment"],"sources":["DataLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport type {DataLoaderProps} from './types';\n\nexport const DataLoader = <TError,>({\n status,\n error,\n errorAction: errorActionProp,\n LoadingView,\n ErrorView,\n children,\n}: DataLoaderProps<TError>): React.ReactNode => {\n const errorAction = React.useMemo<ErrorViewProps<TError>['action']>(\n () =>\n typeof errorActionProp === 'function' ? {handler: errorActionProp} : errorActionProp,\n [errorActionProp],\n );\n\n if (status === 'loading') {\n return <LoadingView />;\n }\n\n if (status === 'error') {\n return <ErrorView error={error} action={errorAction} />;\n }\n\n return <>{children}</>;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_jsxRuntime","e","__esModule","default","DataLoader","exports","_ref","status","error","errorActionProp","errorAction","LoadingView","ErrorView","loadingViewProps","errorViewProps","children","React","useMemo","handler","_jsx","_objectSpread","action","_Fragment"],"sources":["DataLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport type {DataLoaderProps} from './types';\n\nexport const DataLoader = <TError,>({\n status,\n error,\n errorAction: errorActionProp,\n LoadingView,\n ErrorView,\n loadingViewProps,\n errorViewProps,\n children,\n}: DataLoaderProps<TError>): React.ReactNode => {\n const errorAction = React.useMemo<ErrorViewProps<TError>['action']>(\n () =>\n typeof errorActionProp === 'function' ? {handler: errorActionProp} : errorActionProp,\n [errorActionProp],\n );\n\n if (status === 'loading') {\n return <LoadingView {...loadingViewProps} />;\n }\n\n if (status === 'error') {\n return <ErrorView error={error} action={errorAction} {...errorViewProps} />;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,IAAAC,WAAA,GAAAD,OAAA;AAAA,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAMnB,IAAMG,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,SAAbA,UAAUA,CAAAE,IAAA,EASyB;EAAA,IAR5CC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACQC,eAAe,GAAAH,IAAA,CAA5BI,WAAW;IACXC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,gBAAgB,GAAAP,IAAA,CAAhBO,gBAAgB;IAChBC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;IACdC,QAAQ,GAAAT,IAAA,CAARS,QAAQ;EAER,IAAML,WAAW,GAAGM,cAAK,CAACC,OAAO,CAC7B;IAAA,OACI,OAAOR,eAAe,KAAK,UAAU,GAAG;MAACS,OAAO,EAAET;IAAe,CAAC,GAAGA,eAAe;EAAA,GACxF,CAACA,eAAe,CACpB,CAAC;EAED,IAAIF,MAAM,KAAK,SAAS,EAAE;IACtB,oBAAO,IAAAY,eAAA,EAACR,WAAW,MAAAS,sBAAA,MAAKP,gBAAgB,CAAG,CAAC;EAChD;EAEA,IAAIN,MAAM,KAAK,OAAO,EAAE;IACpB,oBAAO,IAAAY,eAAA,EAACP,SAAS,MAAAQ,sBAAA;MAACZ,KAAK,EAAEA,KAAM;MAACa,MAAM,EAAEX;IAAY,GAAKI,cAAc,CAAG,CAAC;EAC/E;EAEA,oBAAO,IAAAK,eAAA,EAAAG,oBAAA;IAAAP,QAAA,EAAGA;EAAQ,CAAG,CAAC;AAC1B,CAAC","ignoreList":[]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import type { DataLoaderStatus } from '../../../core';
|
|
3
3
|
import type { ErrorAction, ErrorViewProps } from '../types';
|
|
4
|
-
export interface DataLoaderProps<TError> {
|
|
4
|
+
export interface DataLoaderProps<TError, TLoadingViewProps extends {} = {}, TErrorViewProps extends ErrorViewProps<TError> = ErrorViewProps<TError>> {
|
|
5
5
|
status: DataLoaderStatus;
|
|
6
6
|
error: TError | null;
|
|
7
7
|
errorAction?: ErrorAction | ErrorAction['handler'];
|
|
8
|
-
LoadingView: ComponentType
|
|
9
|
-
ErrorView: ComponentType<
|
|
8
|
+
LoadingView: ComponentType<TLoadingViewProps>;
|
|
9
|
+
ErrorView: ComponentType<TErrorViewProps>;
|
|
10
|
+
loadingViewProps?: TLoadingViewProps;
|
|
11
|
+
errorViewProps?: Omit<TErrorViewProps, keyof ErrorViewProps<TError>>;
|
|
10
12
|
children: ReactNode;
|
|
11
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {DataLoaderStatus} from '../../../core';\nimport type {ErrorAction, ErrorViewProps} from '../types';\n\nexport interface DataLoaderProps<TError> {\n status: DataLoaderStatus;\n error: TError | null;\n errorAction?: ErrorAction | ErrorAction['handler'];\n LoadingView: ComponentType
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {DataLoaderStatus} from '../../../core';\nimport type {ErrorAction, ErrorViewProps} from '../types';\n\nexport interface DataLoaderProps<\n TError,\n TLoadingViewProps extends {} = {},\n TErrorViewProps extends ErrorViewProps<TError> = ErrorViewProps<TError>,\n> {\n status: DataLoaderStatus;\n error: TError | null;\n errorAction?: ErrorAction | ErrorAction['handler'];\n LoadingView: ComponentType<TLoadingViewProps>;\n ErrorView: ComponentType<TErrorViewProps>;\n loadingViewProps?: TLoadingViewProps;\n errorViewProps?: Omit<TErrorViewProps, keyof ErrorViewProps<TError>>;\n children: ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -2,10 +2,10 @@ import type { InfiniteQueryObserverOptions, InfiniteQueryObserverResult, QueryFu
|
|
|
2
2
|
import type { Overwrite } from 'utility-types';
|
|
3
3
|
import type { ActualData, DataLoaderStatus, DataSource, DataSourceKey } from '../../../core';
|
|
4
4
|
import type { QueryDataSourceContext } from '../../types';
|
|
5
|
-
export type InfiniteQueryDataSource<TParams, TRequest, TResponse, TData, TError> = DataSource<QueryDataSourceContext, TParams, TRequest, TResponse, TData, TError, InfiniteQueryObserverOptions<TResponse, TError, ActualData<TData, TResponse>, TResponse>, ResultWrapper<InfiniteQueryObserverResult<ActualData<TData, TResponse>, TError>>, QueryFunctionContext<DataSourceKey,
|
|
5
|
+
export type InfiniteQueryDataSource<TParams, TRequest, TResponse, TData, TError> = DataSource<QueryDataSourceContext, TParams, TRequest, TResponse, TData, TError, InfiniteQueryObserverOptions<TResponse, TError, ActualData<TData, TResponse>, TResponse>, ResultWrapper<InfiniteQueryObserverResult<ActualData<TData, TResponse>, TError>>, QueryFunctionContext<DataSourceKey, Partial<TRequest> | undefined>> & {
|
|
6
6
|
type: 'infinite';
|
|
7
|
-
next: (lastPage: TResponse, allPages: TResponse[]) => Partial<
|
|
8
|
-
prev?: (firstPage: TResponse, allPages: TResponse[]) => Partial<
|
|
7
|
+
next: (lastPage: TResponse, allPages: TResponse[]) => Partial<TRequest> | undefined;
|
|
8
|
+
prev?: (firstPage: TResponse, allPages: TResponse[]) => Partial<TRequest> | undefined;
|
|
9
9
|
};
|
|
10
10
|
export type AnyInfiniteQueryDataSource = InfiniteQueryDataSource<any, any, any, any, any>;
|
|
11
11
|
type ResultWrapper<T> = T extends InfiniteQueryObserverResult<infer TData> ? Overwrite<T, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryFunctionContext,\n} from '@tanstack/react-query';\nimport type {Overwrite} from 'utility-types';\n\nimport type {ActualData, DataLoaderStatus, DataSource, DataSourceKey} from '../../../core';\nimport type {QueryDataSourceContext} from '../../types';\n\nexport type InfiniteQueryDataSource<TParams, TRequest, TResponse, TData, TError> = DataSource<\n QueryDataSourceContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n InfiniteQueryObserverOptions<TResponse, TError, ActualData<TData, TResponse>, TResponse>,\n ResultWrapper<InfiniteQueryObserverResult<ActualData<TData, TResponse>, TError>>,\n QueryFunctionContext<DataSourceKey,
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryFunctionContext,\n} from '@tanstack/react-query';\nimport type {Overwrite} from 'utility-types';\n\nimport type {ActualData, DataLoaderStatus, DataSource, DataSourceKey} from '../../../core';\nimport type {QueryDataSourceContext} from '../../types';\n\nexport type InfiniteQueryDataSource<TParams, TRequest, TResponse, TData, TError> = DataSource<\n QueryDataSourceContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n InfiniteQueryObserverOptions<TResponse, TError, ActualData<TData, TResponse>, TResponse>,\n ResultWrapper<InfiniteQueryObserverResult<ActualData<TData, TResponse>, TError>>,\n QueryFunctionContext<DataSourceKey, Partial<TRequest> | undefined>\n> & {\n type: 'infinite';\n next: (lastPage: TResponse, allPages: TResponse[]) => Partial<TRequest> | undefined;\n prev?: (firstPage: TResponse, allPages: TResponse[]) => Partial<TRequest> | undefined;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyInfiniteQueryDataSource = InfiniteQueryDataSource<any, any, any, any, any>;\n\ntype ResultWrapper<T> =\n T extends InfiniteQueryObserverResult<infer TData>\n ? Overwrite<T, {status: DataLoaderStatus; data: TData}> & {\n originalStatus: T['status'];\n originalData: T['data'];\n }\n : never;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InfiniteQueryObserverOptions, InfiniteQueryObserverResult } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import type { DataSourceContext, DataSourceData, DataSourceError, DataSourceOptions, DataSourceParams, DataSourceResponse, DataSourceState } from '../../../core';
|
|
3
3
|
import type { AnyInfiniteQueryDataSource } from './types';
|
|
4
4
|
export declare const composeOptions: <TDataSource extends AnyInfiniteQueryDataSource>(context: DataSourceContext<TDataSource>, dataSource: TDataSource, params: DataSourceParams<TDataSource>, options?: DataSourceOptions<TDataSource>) => InfiniteQueryObserverOptions<DataSourceResponse<TDataSource>, DataSourceError<TDataSource>, DataSourceData<TDataSource>, DataSourceResponse<TDataSource>>;
|
|
5
5
|
export declare const transformResult: <TDataSource extends AnyInfiniteQueryDataSource>(result: InfiniteQueryObserverResult<DataSourceData<TDataSource>, DataSourceError<TDataSource>>) => DataSourceState<TDataSource>;
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.transformResult = exports.composeOptions = void 0;
|
|
7
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
7
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
8
9
|
var _core = require("../../../core");
|
|
9
10
|
var _normalizeStatus = require("../../utils/normalizeStatus");
|
|
@@ -18,23 +19,17 @@ var composeOptions = exports.composeOptions = function composeOptions(context, d
|
|
|
18
19
|
enabled: params !== _core.idle,
|
|
19
20
|
queryKey: (0, _core.composeFullKey)(dataSource, params),
|
|
20
21
|
queryFn: function queryFn(fetchContext) {
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
return dataSource.fetch(context, fetchContext,
|
|
22
|
+
var actualParams = transformParams ? transformParams(params) : params;
|
|
23
|
+
var request = (0, _typeof2.default)(actualParams) === 'object' ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, actualParams), fetchContext.pageParam) : actualParams;
|
|
24
|
+
return dataSource.fetch(context, fetchContext, request);
|
|
24
25
|
},
|
|
25
26
|
select: transformResponse ? function (data) {
|
|
26
27
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), {}, {
|
|
27
28
|
pages: data.pages.map(transformResponse)
|
|
28
29
|
});
|
|
29
30
|
} : undefined,
|
|
30
|
-
getNextPageParam:
|
|
31
|
-
|
|
32
|
-
return nextParamsPatch ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), nextParamsPatch) : undefined;
|
|
33
|
-
},
|
|
34
|
-
getPreviousPageParam: prev ? function (firstPage, allPages) {
|
|
35
|
-
var prevParamsPatch = prev(firstPage, allPages);
|
|
36
|
-
return prevParamsPatch ? (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), prevParamsPatch) : undefined;
|
|
37
|
-
} : undefined
|
|
31
|
+
getNextPageParam: next,
|
|
32
|
+
getPreviousPageParam: prev
|
|
38
33
|
}, options);
|
|
39
34
|
};
|
|
40
35
|
var transformResult = exports.transformResult = function transformResult(result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_normalizeStatus","_interopRequireDefault","e","__esModule","default","EMPTY_ARRAY","composeOptions","exports","context","dataSource","params","options","transformParams","transformResponse","next","prev","_objectSpread","enabled","idle","queryKey","composeFullKey","queryFn","fetchContext","
|
|
1
|
+
{"version":3,"names":["_core","require","_normalizeStatus","_interopRequireDefault","e","__esModule","default","EMPTY_ARRAY","composeOptions","exports","context","dataSource","params","options","transformParams","transformResponse","next","prev","_objectSpread","enabled","idle","queryKey","composeFullKey","queryFn","fetchContext","actualParams","request","_typeof","pageParam","fetch","select","data","pages","map","undefined","getNextPageParam","getPreviousPageParam","transformResult","result","_result$data$pages$fl","_result$data","status","normalizeStatus","fetchStatus","flat","originalStatus","originalData"],"sources":["utils.ts"],"sourcesContent":["import type {\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryFunctionContext,\n} from '@tanstack/react-query';\n\nimport {composeFullKey, idle} from '../../../core';\nimport type {\n DataSourceContext,\n DataSourceData,\n DataSourceError,\n DataSourceKey,\n DataSourceOptions,\n DataSourceParams,\n DataSourceRequest,\n DataSourceResponse,\n DataSourceState,\n} from '../../../core';\nimport {normalizeStatus} from '../../utils/normalizeStatus';\n\nimport type {AnyInfiniteQueryDataSource} from './types';\n\nconst EMPTY_ARRAY: unknown[] = [];\n\nexport const composeOptions = <TDataSource extends AnyInfiniteQueryDataSource>(\n context: DataSourceContext<TDataSource>,\n dataSource: TDataSource,\n params: DataSourceParams<TDataSource>,\n options?: DataSourceOptions<TDataSource>,\n): InfiniteQueryObserverOptions<\n DataSourceResponse<TDataSource>,\n DataSourceError<TDataSource>,\n DataSourceData<TDataSource>,\n DataSourceResponse<TDataSource>\n> => {\n const {transformParams, transformResponse, next, prev} = dataSource;\n\n return {\n ...dataSource.options,\n enabled: params !== idle,\n queryKey: composeFullKey(dataSource, params),\n queryFn: (\n fetchContext: QueryFunctionContext<\n DataSourceKey,\n Partial<DataSourceRequest<TDataSource>> | undefined\n >,\n ) => {\n const actualParams = transformParams ? transformParams(params) : params;\n const request =\n typeof actualParams === 'object'\n ? {...actualParams, ...fetchContext.pageParam}\n : actualParams;\n\n return dataSource.fetch(context, fetchContext, request);\n },\n select: transformResponse\n ? (data) => ({...data, pages: data.pages.map(transformResponse)})\n : undefined,\n getNextPageParam: next,\n getPreviousPageParam: prev,\n ...options,\n };\n};\n\nexport const transformResult = <TDataSource extends AnyInfiniteQueryDataSource>(\n result: InfiniteQueryObserverResult<DataSourceData<TDataSource>, DataSourceError<TDataSource>>,\n) => {\n return {\n ...result,\n status: normalizeStatus(result.status, result.fetchStatus),\n data: result.data?.pages.flat() ?? EMPTY_ARRAY,\n originalStatus: result.status,\n originalData: result.data,\n } as DataSourceState<TDataSource>;\n};\n"],"mappings":";;;;;;;;AAMA,IAAAA,KAAA,GAAAC,OAAA;AAYA,IAAAC,gBAAA,GAAAD,OAAA;AAA2D,SAAAE,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAI3D,IAAMG,WAAsB,GAAG,EAAE;AAE1B,IAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CACvBE,OAAuC,EACvCC,UAAuB,EACvBC,MAAqC,EACrCC,OAAwC,EAMvC;EACD,IAAOC,eAAe,GAAmCH,UAAU,CAA5DG,eAAe;IAAEC,iBAAiB,GAAgBJ,UAAU,CAA3CI,iBAAiB;IAAEC,IAAI,GAAUL,UAAU,CAAxBK,IAAI;IAAEC,IAAI,GAAIN,UAAU,CAAlBM,IAAI;EAErD,WAAAC,sBAAA,MAAAA,sBAAA,MACOP,UAAU,CAACE,OAAO;IACrBM,OAAO,EAAEP,MAAM,KAAKQ,UAAI;IACxBC,QAAQ,EAAE,IAAAC,oBAAc,EAACX,UAAU,EAAEC,MAAM,CAAC;IAC5CW,OAAO,EAAE,SAATA,OAAOA,CACHC,YAGC,EACA;MACD,IAAMC,YAAY,GAAGX,eAAe,GAAGA,eAAe,CAACF,MAAM,CAAC,GAAGA,MAAM;MACvE,IAAMc,OAAO,GACT,IAAAC,gBAAA,EAAOF,YAAY,MAAK,QAAQ,OAAAP,sBAAA,MAAAA,sBAAA,MACtBO,YAAY,GAAKD,YAAY,CAACI,SAAS,IAC3CH,YAAY;MAEtB,OAAOd,UAAU,CAACkB,KAAK,CAACnB,OAAO,EAAEc,YAAY,EAAEE,OAAO,CAAC;IAC3D,CAAC;IACDI,MAAM,EAAEf,iBAAiB,GACnB,UAACgB,IAAI;MAAA,WAAAb,sBAAA,MAAAA,sBAAA,MAAUa,IAAI;QAAEC,KAAK,EAAED,IAAI,CAACC,KAAK,CAACC,GAAG,CAAClB,iBAAiB;MAAC;IAAA,CAAE,GAC/DmB,SAAS;IACfC,gBAAgB,EAAEnB,IAAI;IACtBoB,oBAAoB,EAAEnB;EAAI,GACvBJ,OAAO;AAElB,CAAC;AAEM,IAAMwB,eAAe,GAAA5B,OAAA,CAAA4B,eAAA,GAAG,SAAlBA,eAAeA,CACxBC,MAA8F,EAC7F;EAAA,IAAAC,qBAAA,EAAAC,YAAA;EACD,WAAAtB,sBAAA,MAAAA,sBAAA,MACOoB,MAAM;IACTG,MAAM,EAAE,IAAAC,gCAAe,EAACJ,MAAM,CAACG,MAAM,EAAEH,MAAM,CAACK,WAAW,CAAC;IAC1DZ,IAAI,GAAAQ,qBAAA,IAAAC,YAAA,GAAEF,MAAM,CAACP,IAAI,cAAAS,YAAA,uBAAXA,YAAA,CAAaR,KAAK,CAACY,IAAI,CAAC,CAAC,cAAAL,qBAAA,cAAAA,qBAAA,GAAIhC,WAAW;IAC9CsC,cAAc,EAAEP,MAAM,CAACG,MAAM;IAC7BK,YAAY,EAAER,MAAM,CAACP;EAAI;AAEjC,CAAC","ignoreList":[]}
|
|
@@ -6,7 +6,7 @@ declare const stateHintSymbol: unique symbol;
|
|
|
6
6
|
export interface DataSource<TContext, TParams, TRequest, TResponse, TData, TError, TOptions, TState, TFetchContext> {
|
|
7
7
|
readonly name: string;
|
|
8
8
|
fetch: (context: TContext, fetchContext: TFetchContext, request: TRequest) => Promise<TResponse> | TResponse;
|
|
9
|
-
tags?: (params: ActualParams<
|
|
9
|
+
tags?: (params: ActualParams<TParams, TRequest>) => DataSourceTag[];
|
|
10
10
|
transformParams?: (params: TParams) => TRequest;
|
|
11
11
|
transformResponse?: (response: TResponse) => TData;
|
|
12
12
|
[errorHintSymbol]?: TError;
|
|
@@ -15,7 +15,7 @@ export interface DataSource<TContext, TParams, TRequest, TResponse, TData, TErro
|
|
|
15
15
|
}
|
|
16
16
|
export type AnyDataSource = DataSource<any, any, any, any, any, any, any, any, any>;
|
|
17
17
|
export type DataSourceContext<TDataSource> = TDataSource extends DataSource<infer TContext, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TContext : never;
|
|
18
|
-
export type DataSourceParams<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer TParams, infer TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? ActualParams<
|
|
18
|
+
export type DataSourceParams<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer TParams, infer TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? ActualParams<TParams, TRequest> : never;
|
|
19
19
|
export type DataSourceRequest<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TRequest : never;
|
|
20
20
|
export type DataSourceResponse<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? TResponse : never;
|
|
21
21
|
export type DataSourceData<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer TResponse, infer TData, infer _TError, infer _TOptions, infer _TState, infer _TFetchContext> ? ActualData<TData, TResponse> : never;
|
|
@@ -23,6 +23,6 @@ export type DataSourceError<TDataSource> = TDataSource extends DataSource<infer
|
|
|
23
23
|
export type DataSourceOptions<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer TOptions, infer _TState, infer _TFetchContext> ? TOptions : never;
|
|
24
24
|
export type DataSourceState<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer TState, infer _TFetchContext> ? TState : never;
|
|
25
25
|
export type DataSourceFetchContext<TDataSource> = TDataSource extends DataSource<infer _TContenxt, infer _TParams, infer _TRequest, infer _TResponse, infer _TData, infer _TError, infer _TOptions, infer _TState, infer TFetchContext> ? TFetchContext : never;
|
|
26
|
-
export type ActualParams<
|
|
26
|
+
export type ActualParams<TParams, TRequest> = (unknown extends TParams ? TRequest : TParams) | typeof idle;
|
|
27
27
|
export type ActualData<TData, TResponse> = unknown extends TData ? TResponse : TData;
|
|
28
28
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["DataSource.ts"],"sourcesContent":["import type {idle} from '../constants';\n\nexport type DataSourceKey = readonly unknown[];\nexport type DataSourceTag = string;\n\ndeclare const errorHintSymbol: unique symbol;\ndeclare const stateHintSymbol: unique symbol;\n\nexport interface DataSource<\n TContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n TOptions,\n TState,\n TFetchContext,\n> {\n readonly name: string;\n\n fetch: (\n context: TContext,\n fetchContext: TFetchContext,\n request: TRequest,\n ) => Promise<TResponse> | TResponse;\n tags?: (params: ActualParams<
|
|
1
|
+
{"version":3,"names":[],"sources":["DataSource.ts"],"sourcesContent":["import type {idle} from '../constants';\n\nexport type DataSourceKey = readonly unknown[];\nexport type DataSourceTag = string;\n\ndeclare const errorHintSymbol: unique symbol;\ndeclare const stateHintSymbol: unique symbol;\n\nexport interface DataSource<\n TContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n TOptions,\n TState,\n TFetchContext,\n> {\n readonly name: string;\n\n fetch: (\n context: TContext,\n fetchContext: TFetchContext,\n request: TRequest,\n ) => Promise<TResponse> | TResponse;\n tags?: (params: ActualParams<TParams, TRequest>) => DataSourceTag[];\n\n transformParams?: (params: TParams) => TRequest;\n transformResponse?: (response: TResponse) => TData;\n\n [errorHintSymbol]?: TError;\n\n options?: TOptions;\n [stateHintSymbol]?: TState;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyDataSource = DataSource<any, any, any, any, any, any, any, any, any>;\n\nexport type DataSourceContext<TDataSource> =\n TDataSource extends DataSource<\n infer TContext,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TContext\n : never;\n\nexport type DataSourceParams<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer TParams,\n infer TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? ActualParams<TParams, TRequest>\n : never;\n\nexport type DataSourceRequest<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TRequest\n : never;\n\nexport type DataSourceResponse<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TResponse\n : never;\n\nexport type DataSourceData<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer TResponse,\n infer TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? ActualData<TData, TResponse>\n : never;\n\nexport type DataSourceError<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer TError,\n infer _TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TError\n : never;\n\nexport type DataSourceOptions<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer TOptions,\n infer _TState,\n infer _TFetchContext\n >\n ? TOptions\n : never;\n\nexport type DataSourceState<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer TState,\n infer _TFetchContext\n >\n ? TState\n : never;\n\nexport type DataSourceFetchContext<TDataSource> =\n TDataSource extends DataSource<\n infer _TContenxt,\n infer _TParams,\n infer _TRequest,\n infer _TResponse,\n infer _TData,\n infer _TError,\n infer _TOptions,\n infer _TState,\n infer TFetchContext\n >\n ? TFetchContext\n : never;\n\nexport type ActualParams<TParams, TRequest> =\n | (unknown extends TParams ? TRequest : TParams)\n | typeof idle;\n\nexport type ActualData<TData, TResponse> = unknown extends TData ? TResponse : TData;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DataInfiniteLoaderProps } from './types';
|
|
3
|
-
export declare const DataInfiniteLoader: <TError>({ status, error, errorAction: errorActionProp, hasNextPage, fetchNextPage, isFetchingNextPage, LoadingView, ErrorView, MoreView, children, }: DataInfiniteLoaderProps<TError>) => React.ReactNode;
|
|
3
|
+
export declare const DataInfiniteLoader: <TError>({ status, error, errorAction: errorActionProp, hasNextPage, fetchNextPage, isFetchingNextPage, LoadingView, ErrorView, MoreView, loadingViewProps, errorViewProps, moreViewProps, children, }: DataInfiniteLoaderProps<TError>) => React.ReactNode;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
4
|
export var DataInfiniteLoader = function DataInfiniteLoader(_ref) {
|
|
@@ -10,32 +11,35 @@ export var DataInfiniteLoader = function DataInfiniteLoader(_ref) {
|
|
|
10
11
|
LoadingView = _ref.LoadingView,
|
|
11
12
|
ErrorView = _ref.ErrorView,
|
|
12
13
|
MoreView = _ref.MoreView,
|
|
14
|
+
loadingViewProps = _ref.loadingViewProps,
|
|
15
|
+
errorViewProps = _ref.errorViewProps,
|
|
16
|
+
moreViewProps = _ref.moreViewProps,
|
|
13
17
|
children = _ref.children;
|
|
14
18
|
var errorAction = React.useMemo(function () {
|
|
15
19
|
return typeof errorActionProp === 'function' ? {
|
|
16
20
|
handler: errorActionProp
|
|
17
21
|
} : errorActionProp;
|
|
18
22
|
}, [errorActionProp]);
|
|
19
|
-
var
|
|
23
|
+
var renderContent = function renderContent() {
|
|
20
24
|
if (status === 'loading') {
|
|
21
|
-
return /*#__PURE__*/_jsx(LoadingView, {});
|
|
25
|
+
return /*#__PURE__*/_jsx(LoadingView, _objectSpread({}, loadingViewProps));
|
|
22
26
|
}
|
|
23
27
|
if (status === 'error') {
|
|
24
|
-
return /*#__PURE__*/_jsx(ErrorView, {
|
|
28
|
+
return /*#__PURE__*/_jsx(ErrorView, _objectSpread({
|
|
25
29
|
error: error,
|
|
26
30
|
action: errorAction
|
|
27
|
-
});
|
|
31
|
+
}, errorViewProps));
|
|
28
32
|
}
|
|
29
33
|
if (status === 'success' && hasNextPage) {
|
|
30
|
-
return /*#__PURE__*/_jsx(MoreView, {
|
|
34
|
+
return /*#__PURE__*/_jsx(MoreView, _objectSpread({
|
|
31
35
|
isLoading: isFetchingNextPage,
|
|
32
36
|
onClick: fetchNextPage
|
|
33
|
-
});
|
|
37
|
+
}, moreViewProps));
|
|
34
38
|
}
|
|
35
39
|
return null;
|
|
36
|
-
}
|
|
40
|
+
};
|
|
37
41
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
38
|
-
children: [status === 'success' ? children : null,
|
|
42
|
+
children: [status === 'success' ? children : null, renderContent()]
|
|
39
43
|
});
|
|
40
44
|
};
|
|
41
45
|
// #sourceMappingURL=DataInfiniteLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DataInfiniteLoader","_ref","status","error","errorActionProp","errorAction","hasNextPage","fetchNextPage","isFetchingNextPage","LoadingView","ErrorView","MoreView","children","useMemo","handler","
|
|
1
|
+
{"version":3,"names":["React","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DataInfiniteLoader","_ref","status","error","errorActionProp","errorAction","hasNextPage","fetchNextPage","isFetchingNextPage","LoadingView","ErrorView","MoreView","loadingViewProps","errorViewProps","moreViewProps","children","useMemo","handler","renderContent","_objectSpread","action","isLoading","onClick"],"sources":["DataInfiniteLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport type {DataInfiniteLoaderProps} from './types';\n\nexport const DataInfiniteLoader = <TError,>({\n status,\n error,\n errorAction: errorActionProp,\n hasNextPage,\n fetchNextPage,\n isFetchingNextPage,\n LoadingView,\n ErrorView,\n MoreView,\n loadingViewProps,\n errorViewProps,\n moreViewProps,\n children,\n}: DataInfiniteLoaderProps<TError>): React.ReactNode => {\n const errorAction = React.useMemo<ErrorViewProps<TError>['action']>(\n () =>\n typeof errorActionProp === 'function' ? {handler: errorActionProp} : errorActionProp,\n [errorActionProp],\n );\n\n const renderContent = () => {\n if (status === 'loading') {\n return <LoadingView {...loadingViewProps} />;\n }\n\n if (status === 'error') {\n return <ErrorView error={error} action={errorAction} {...errorViewProps} />;\n }\n\n if (status === 'success' && hasNextPage) {\n return (\n <MoreView\n isLoading={isFetchingNextPage}\n onClick={fetchNextPage}\n {...moreViewProps}\n />\n );\n }\n\n return null;\n };\n\n return (\n <>\n {status === 'success' ? children : null}\n {renderContent()}\n </>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAM1B,OAAO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAAC,IAAA,EAcyB;EAAA,IAbpDC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACQC,eAAe,GAAAH,IAAA,CAA5BI,WAAW;IACXC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,kBAAkB,GAAAP,IAAA,CAAlBO,kBAAkB;IAClBC,WAAW,GAAAR,IAAA,CAAXQ,WAAW;IACXC,SAAS,GAAAT,IAAA,CAATS,SAAS;IACTC,QAAQ,GAAAV,IAAA,CAARU,QAAQ;IACRC,gBAAgB,GAAAX,IAAA,CAAhBW,gBAAgB;IAChBC,cAAc,GAAAZ,IAAA,CAAdY,cAAc;IACdC,aAAa,GAAAb,IAAA,CAAba,aAAa;IACbC,QAAQ,GAAAd,IAAA,CAARc,QAAQ;EAER,IAAMV,WAAW,GAAGZ,KAAK,CAACuB,OAAO,CAC7B;IAAA,OACI,OAAOZ,eAAe,KAAK,UAAU,GAAG;MAACa,OAAO,EAAEb;IAAe,CAAC,GAAGA,eAAe;EAAA,GACxF,CAACA,eAAe,CACpB,CAAC;EAED,IAAMc,aAAa,GAAG,SAAhBA,aAAaA,CAAA,EAAS;IACxB,IAAIhB,MAAM,KAAK,SAAS,EAAE;MACtB,oBAAOP,IAAA,CAACc,WAAW,EAAAU,aAAA,KAAKP,gBAAgB,CAAG,CAAC;IAChD;IAEA,IAAIV,MAAM,KAAK,OAAO,EAAE;MACpB,oBAAOP,IAAA,CAACe,SAAS,EAAAS,aAAA;QAAChB,KAAK,EAAEA,KAAM;QAACiB,MAAM,EAAEf;MAAY,GAAKQ,cAAc,CAAG,CAAC;IAC/E;IAEA,IAAIX,MAAM,KAAK,SAAS,IAAII,WAAW,EAAE;MACrC,oBACIX,IAAA,CAACgB,QAAQ,EAAAQ,aAAA;QACLE,SAAS,EAAEb,kBAAmB;QAC9Bc,OAAO,EAAEf;MAAc,GACnBO,aAAa,CACpB,CAAC;IAEV;IAEA,OAAO,IAAI;EACf,CAAC;EAED,oBACIf,KAAA,CAAAF,SAAA;IAAAkB,QAAA,GACKb,MAAM,KAAK,SAAS,GAAGa,QAAQ,GAAG,IAAI,EACtCG,aAAa,CAAC,CAAC;EAAA,CAClB,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -5,15 +5,18 @@ export interface MoreViewProps {
|
|
|
5
5
|
isLoading: boolean;
|
|
6
6
|
onClick: () => void;
|
|
7
7
|
}
|
|
8
|
-
export interface DataInfiniteLoaderProps<TError> {
|
|
8
|
+
export interface DataInfiniteLoaderProps<TError, TLoadingViewProps extends {} = {}, TErrorViewProps extends ErrorViewProps<TError> = ErrorViewProps<TError>, TMoreViewProps extends MoreViewProps = MoreViewProps> {
|
|
9
9
|
status: DataLoaderStatus;
|
|
10
10
|
error: TError | null;
|
|
11
11
|
errorAction?: ErrorAction | ErrorAction['handler'];
|
|
12
12
|
hasNextPage: boolean;
|
|
13
13
|
fetchNextPage: () => unknown;
|
|
14
14
|
isFetchingNextPage: boolean;
|
|
15
|
-
LoadingView: ComponentType
|
|
16
|
-
ErrorView: ComponentType<
|
|
17
|
-
MoreView: ComponentType<
|
|
15
|
+
LoadingView: ComponentType<TLoadingViewProps>;
|
|
16
|
+
ErrorView: ComponentType<TErrorViewProps>;
|
|
17
|
+
MoreView: ComponentType<TMoreViewProps>;
|
|
18
|
+
loadingViewProps?: TLoadingViewProps;
|
|
19
|
+
errorViewProps?: Omit<TErrorViewProps, keyof ErrorViewProps<TError>>;
|
|
20
|
+
moreViewProps?: Omit<TMoreViewProps, keyof MoreViewProps>;
|
|
18
21
|
children: ReactNode;
|
|
19
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {DataLoaderStatus} from '../../../core';\nimport type {ErrorAction, ErrorViewProps} from '../types';\n\nexport interface MoreViewProps {\n isLoading: boolean;\n onClick: () => void;\n}\n\nexport interface DataInfiniteLoaderProps<TError> {\n status: DataLoaderStatus;\n error: TError | null;\n errorAction?: ErrorAction | ErrorAction['handler'];\n hasNextPage: boolean;\n fetchNextPage: () => unknown;\n isFetchingNextPage: boolean;\n LoadingView: ComponentType
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {DataLoaderStatus} from '../../../core';\nimport type {ErrorAction, ErrorViewProps} from '../types';\n\nexport interface MoreViewProps {\n isLoading: boolean;\n onClick: () => void;\n}\n\nexport interface DataInfiniteLoaderProps<\n TError,\n TLoadingViewProps extends {} = {},\n TErrorViewProps extends ErrorViewProps<TError> = ErrorViewProps<TError>,\n TMoreViewProps extends MoreViewProps = MoreViewProps,\n> {\n status: DataLoaderStatus;\n error: TError | null;\n errorAction?: ErrorAction | ErrorAction['handler'];\n hasNextPage: boolean;\n fetchNextPage: () => unknown;\n isFetchingNextPage: boolean;\n LoadingView: ComponentType<TLoadingViewProps>;\n ErrorView: ComponentType<TErrorViewProps>;\n MoreView: ComponentType<TMoreViewProps>;\n loadingViewProps?: TLoadingViewProps;\n errorViewProps?: Omit<TErrorViewProps, keyof ErrorViewProps<TError>>;\n moreViewProps?: Omit<TMoreViewProps, keyof MoreViewProps>;\n children: ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DataLoaderProps } from './types';
|
|
3
|
-
export declare const DataLoader: <TError>({ status, error, errorAction: errorActionProp, LoadingView, ErrorView, children, }: DataLoaderProps<TError>) => React.ReactNode;
|
|
3
|
+
export declare const DataLoader: <TError>({ status, error, errorAction: errorActionProp, LoadingView, ErrorView, loadingViewProps, errorViewProps, children, }: DataLoaderProps<TError>) => React.ReactNode;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
4
|
export var DataLoader = function DataLoader(_ref) {
|
|
@@ -6,6 +7,8 @@ export var DataLoader = function DataLoader(_ref) {
|
|
|
6
7
|
errorActionProp = _ref.errorAction,
|
|
7
8
|
LoadingView = _ref.LoadingView,
|
|
8
9
|
ErrorView = _ref.ErrorView,
|
|
10
|
+
loadingViewProps = _ref.loadingViewProps,
|
|
11
|
+
errorViewProps = _ref.errorViewProps,
|
|
9
12
|
children = _ref.children;
|
|
10
13
|
var errorAction = React.useMemo(function () {
|
|
11
14
|
return typeof errorActionProp === 'function' ? {
|
|
@@ -13,13 +16,13 @@ export var DataLoader = function DataLoader(_ref) {
|
|
|
13
16
|
} : errorActionProp;
|
|
14
17
|
}, [errorActionProp]);
|
|
15
18
|
if (status === 'loading') {
|
|
16
|
-
return /*#__PURE__*/_jsx(LoadingView, {});
|
|
19
|
+
return /*#__PURE__*/_jsx(LoadingView, _objectSpread({}, loadingViewProps));
|
|
17
20
|
}
|
|
18
21
|
if (status === 'error') {
|
|
19
|
-
return /*#__PURE__*/_jsx(ErrorView, {
|
|
22
|
+
return /*#__PURE__*/_jsx(ErrorView, _objectSpread({
|
|
20
23
|
error: error,
|
|
21
24
|
action: errorAction
|
|
22
|
-
});
|
|
25
|
+
}, errorViewProps));
|
|
23
26
|
}
|
|
24
27
|
return /*#__PURE__*/_jsx(_Fragment, {
|
|
25
28
|
children: children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","jsx","_jsx","Fragment","_Fragment","DataLoader","_ref","status","error","errorActionProp","errorAction","LoadingView","ErrorView","children","useMemo","handler","action"],"sources":["DataLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport type {DataLoaderProps} from './types';\n\nexport const DataLoader = <TError,>({\n status,\n error,\n errorAction: errorActionProp,\n LoadingView,\n ErrorView,\n children,\n}: DataLoaderProps<TError>): React.ReactNode => {\n const errorAction = React.useMemo<ErrorViewProps<TError>['action']>(\n () =>\n typeof errorActionProp === 'function' ? {handler: errorActionProp} : errorActionProp,\n [errorActionProp],\n );\n\n if (status === 'loading') {\n return <LoadingView />;\n }\n\n if (status === 'error') {\n return <ErrorView error={error} action={errorAction} />;\n }\n\n return <>{children}</>;\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAM1B,OAAO,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,
|
|
1
|
+
{"version":3,"names":["React","jsx","_jsx","Fragment","_Fragment","DataLoader","_ref","status","error","errorActionProp","errorAction","LoadingView","ErrorView","loadingViewProps","errorViewProps","children","useMemo","handler","_objectSpread","action"],"sources":["DataLoader.tsx"],"sourcesContent":["import React from 'react';\n\nimport type {ErrorViewProps} from '../types';\n\nimport type {DataLoaderProps} from './types';\n\nexport const DataLoader = <TError,>({\n status,\n error,\n errorAction: errorActionProp,\n LoadingView,\n ErrorView,\n loadingViewProps,\n errorViewProps,\n children,\n}: DataLoaderProps<TError>): React.ReactNode => {\n const errorAction = React.useMemo<ErrorViewProps<TError>['action']>(\n () =>\n typeof errorActionProp === 'function' ? {handler: errorActionProp} : errorActionProp,\n [errorActionProp],\n );\n\n if (status === 'loading') {\n return <LoadingView {...loadingViewProps} />;\n }\n\n if (status === 'error') {\n return <ErrorView error={error} action={errorAction} {...errorViewProps} />;\n }\n\n return <>{children}</>;\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAM1B,OAAO,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAAC,IAAA,EASyB;EAAA,IAR5CC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACQC,eAAe,GAAAH,IAAA,CAA5BI,WAAW;IACXC,WAAW,GAAAL,IAAA,CAAXK,WAAW;IACXC,SAAS,GAAAN,IAAA,CAATM,SAAS;IACTC,gBAAgB,GAAAP,IAAA,CAAhBO,gBAAgB;IAChBC,cAAc,GAAAR,IAAA,CAAdQ,cAAc;IACdC,QAAQ,GAAAT,IAAA,CAARS,QAAQ;EAER,IAAML,WAAW,GAAGV,KAAK,CAACgB,OAAO,CAC7B;IAAA,OACI,OAAOP,eAAe,KAAK,UAAU,GAAG;MAACQ,OAAO,EAAER;IAAe,CAAC,GAAGA,eAAe;EAAA,GACxF,CAACA,eAAe,CACpB,CAAC;EAED,IAAIF,MAAM,KAAK,SAAS,EAAE;IACtB,oBAAOL,IAAA,CAACS,WAAW,EAAAO,aAAA,KAAKL,gBAAgB,CAAG,CAAC;EAChD;EAEA,IAAIN,MAAM,KAAK,OAAO,EAAE;IACpB,oBAAOL,IAAA,CAACU,SAAS,EAAAM,aAAA;MAACV,KAAK,EAAEA,KAAM;MAACW,MAAM,EAAET;IAAY,GAAKI,cAAc,CAAG,CAAC;EAC/E;EAEA,oBAAOZ,IAAA,CAAAE,SAAA;IAAAW,QAAA,EAAGA;EAAQ,CAAG,CAAC;AAC1B,CAAC","ignoreList":[]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from 'react';
|
|
2
2
|
import type { DataLoaderStatus } from '../../../core';
|
|
3
3
|
import type { ErrorAction, ErrorViewProps } from '../types';
|
|
4
|
-
export interface DataLoaderProps<TError> {
|
|
4
|
+
export interface DataLoaderProps<TError, TLoadingViewProps extends {} = {}, TErrorViewProps extends ErrorViewProps<TError> = ErrorViewProps<TError>> {
|
|
5
5
|
status: DataLoaderStatus;
|
|
6
6
|
error: TError | null;
|
|
7
7
|
errorAction?: ErrorAction | ErrorAction['handler'];
|
|
8
|
-
LoadingView: ComponentType
|
|
9
|
-
ErrorView: ComponentType<
|
|
8
|
+
LoadingView: ComponentType<TLoadingViewProps>;
|
|
9
|
+
ErrorView: ComponentType<TErrorViewProps>;
|
|
10
|
+
loadingViewProps?: TLoadingViewProps;
|
|
11
|
+
errorViewProps?: Omit<TErrorViewProps, keyof ErrorViewProps<TError>>;
|
|
10
12
|
children: ReactNode;
|
|
11
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {DataLoaderStatus} from '../../../core';\nimport type {ErrorAction, ErrorViewProps} from '../types';\n\nexport interface DataLoaderProps<TError> {\n status: DataLoaderStatus;\n error: TError | null;\n errorAction?: ErrorAction | ErrorAction['handler'];\n LoadingView: ComponentType
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {ComponentType, ReactNode} from 'react';\n\nimport type {DataLoaderStatus} from '../../../core';\nimport type {ErrorAction, ErrorViewProps} from '../types';\n\nexport interface DataLoaderProps<\n TError,\n TLoadingViewProps extends {} = {},\n TErrorViewProps extends ErrorViewProps<TError> = ErrorViewProps<TError>,\n> {\n status: DataLoaderStatus;\n error: TError | null;\n errorAction?: ErrorAction | ErrorAction['handler'];\n LoadingView: ComponentType<TLoadingViewProps>;\n ErrorView: ComponentType<TErrorViewProps>;\n loadingViewProps?: TLoadingViewProps;\n errorViewProps?: Omit<TErrorViewProps, keyof ErrorViewProps<TError>>;\n children: ReactNode;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -2,10 +2,10 @@ import type { InfiniteQueryObserverOptions, InfiniteQueryObserverResult, QueryFu
|
|
|
2
2
|
import type { Overwrite } from 'utility-types';
|
|
3
3
|
import type { ActualData, DataLoaderStatus, DataSource, DataSourceKey } from '../../../core';
|
|
4
4
|
import type { QueryDataSourceContext } from '../../types';
|
|
5
|
-
export type InfiniteQueryDataSource<TParams, TRequest, TResponse, TData, TError> = DataSource<QueryDataSourceContext, TParams, TRequest, TResponse, TData, TError, InfiniteQueryObserverOptions<TResponse, TError, ActualData<TData, TResponse>, TResponse>, ResultWrapper<InfiniteQueryObserverResult<ActualData<TData, TResponse>, TError>>, QueryFunctionContext<DataSourceKey,
|
|
5
|
+
export type InfiniteQueryDataSource<TParams, TRequest, TResponse, TData, TError> = DataSource<QueryDataSourceContext, TParams, TRequest, TResponse, TData, TError, InfiniteQueryObserverOptions<TResponse, TError, ActualData<TData, TResponse>, TResponse>, ResultWrapper<InfiniteQueryObserverResult<ActualData<TData, TResponse>, TError>>, QueryFunctionContext<DataSourceKey, Partial<TRequest> | undefined>> & {
|
|
6
6
|
type: 'infinite';
|
|
7
|
-
next: (lastPage: TResponse, allPages: TResponse[]) => Partial<
|
|
8
|
-
prev?: (firstPage: TResponse, allPages: TResponse[]) => Partial<
|
|
7
|
+
next: (lastPage: TResponse, allPages: TResponse[]) => Partial<TRequest> | undefined;
|
|
8
|
+
prev?: (firstPage: TResponse, allPages: TResponse[]) => Partial<TRequest> | undefined;
|
|
9
9
|
};
|
|
10
10
|
export type AnyInfiniteQueryDataSource = InfiniteQueryDataSource<any, any, any, any, any>;
|
|
11
11
|
type ResultWrapper<T> = T extends InfiniteQueryObserverResult<infer TData> ? Overwrite<T, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryFunctionContext,\n} from '@tanstack/react-query';\nimport type {Overwrite} from 'utility-types';\n\nimport type {ActualData, DataLoaderStatus, DataSource, DataSourceKey} from '../../../core';\nimport type {QueryDataSourceContext} from '../../types';\n\nexport type InfiniteQueryDataSource<TParams, TRequest, TResponse, TData, TError> = DataSource<\n QueryDataSourceContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n InfiniteQueryObserverOptions<TResponse, TError, ActualData<TData, TResponse>, TResponse>,\n ResultWrapper<InfiniteQueryObserverResult<ActualData<TData, TResponse>, TError>>,\n QueryFunctionContext<DataSourceKey,
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryFunctionContext,\n} from '@tanstack/react-query';\nimport type {Overwrite} from 'utility-types';\n\nimport type {ActualData, DataLoaderStatus, DataSource, DataSourceKey} from '../../../core';\nimport type {QueryDataSourceContext} from '../../types';\n\nexport type InfiniteQueryDataSource<TParams, TRequest, TResponse, TData, TError> = DataSource<\n QueryDataSourceContext,\n TParams,\n TRequest,\n TResponse,\n TData,\n TError,\n InfiniteQueryObserverOptions<TResponse, TError, ActualData<TData, TResponse>, TResponse>,\n ResultWrapper<InfiniteQueryObserverResult<ActualData<TData, TResponse>, TError>>,\n QueryFunctionContext<DataSourceKey, Partial<TRequest> | undefined>\n> & {\n type: 'infinite';\n next: (lastPage: TResponse, allPages: TResponse[]) => Partial<TRequest> | undefined;\n prev?: (firstPage: TResponse, allPages: TResponse[]) => Partial<TRequest> | undefined;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyInfiniteQueryDataSource = InfiniteQueryDataSource<any, any, any, any, any>;\n\ntype ResultWrapper<T> =\n T extends InfiniteQueryObserverResult<infer TData>\n ? Overwrite<T, {status: DataLoaderStatus; data: TData}> & {\n originalStatus: T['status'];\n originalData: T['data'];\n }\n : never;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InfiniteQueryObserverOptions, InfiniteQueryObserverResult } from '@tanstack/react-query';
|
|
2
|
-
import {
|
|
2
|
+
import type { DataSourceContext, DataSourceData, DataSourceError, DataSourceOptions, DataSourceParams, DataSourceResponse, DataSourceState } from '../../../core';
|
|
3
3
|
import type { AnyInfiniteQueryDataSource } from './types';
|
|
4
4
|
export declare const composeOptions: <TDataSource extends AnyInfiniteQueryDataSource>(context: DataSourceContext<TDataSource>, dataSource: TDataSource, params: DataSourceParams<TDataSource>, options?: DataSourceOptions<TDataSource>) => InfiniteQueryObserverOptions<DataSourceResponse<TDataSource>, DataSourceError<TDataSource>, DataSourceData<TDataSource>, DataSourceResponse<TDataSource>>;
|
|
5
5
|
export declare const transformResult: <TDataSource extends AnyInfiniteQueryDataSource>(result: InfiniteQueryObserverResult<DataSourceData<TDataSource>, DataSourceError<TDataSource>>) => DataSourceState<TDataSource>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _typeof from "@babel/runtime/helpers/typeof";
|
|
1
2
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
3
|
import { composeFullKey, idle } from '../../../core';
|
|
3
4
|
import { normalizeStatus } from '../../utils/normalizeStatus';
|
|
@@ -11,23 +12,17 @@ export var composeOptions = function composeOptions(context, dataSource, params,
|
|
|
11
12
|
enabled: params !== idle,
|
|
12
13
|
queryKey: composeFullKey(dataSource, params),
|
|
13
14
|
queryFn: function queryFn(fetchContext) {
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
return dataSource.fetch(context, fetchContext,
|
|
15
|
+
var actualParams = transformParams ? transformParams(params) : params;
|
|
16
|
+
var request = _typeof(actualParams) === 'object' ? _objectSpread(_objectSpread({}, actualParams), fetchContext.pageParam) : actualParams;
|
|
17
|
+
return dataSource.fetch(context, fetchContext, request);
|
|
17
18
|
},
|
|
18
19
|
select: transformResponse ? function (data) {
|
|
19
20
|
return _objectSpread(_objectSpread({}, data), {}, {
|
|
20
21
|
pages: data.pages.map(transformResponse)
|
|
21
22
|
});
|
|
22
23
|
} : undefined,
|
|
23
|
-
getNextPageParam:
|
|
24
|
-
|
|
25
|
-
return nextParamsPatch ? _objectSpread(_objectSpread({}, params), nextParamsPatch) : undefined;
|
|
26
|
-
},
|
|
27
|
-
getPreviousPageParam: prev ? function (firstPage, allPages) {
|
|
28
|
-
var prevParamsPatch = prev(firstPage, allPages);
|
|
29
|
-
return prevParamsPatch ? _objectSpread(_objectSpread({}, params), prevParamsPatch) : undefined;
|
|
30
|
-
} : undefined
|
|
24
|
+
getNextPageParam: next,
|
|
25
|
+
getPreviousPageParam: prev
|
|
31
26
|
}, options);
|
|
32
27
|
};
|
|
33
28
|
export var transformResult = function transformResult(result) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["composeFullKey","idle","normalizeStatus","EMPTY_ARRAY","composeOptions","context","dataSource","params","options","transformParams","transformResponse","next","prev","_objectSpread","enabled","queryKey","queryFn","fetchContext","
|
|
1
|
+
{"version":3,"names":["composeFullKey","idle","normalizeStatus","EMPTY_ARRAY","composeOptions","context","dataSource","params","options","transformParams","transformResponse","next","prev","_objectSpread","enabled","queryKey","queryFn","fetchContext","actualParams","request","_typeof","pageParam","fetch","select","data","pages","map","undefined","getNextPageParam","getPreviousPageParam","transformResult","result","_result$data$pages$fl","_result$data","status","fetchStatus","flat","originalStatus","originalData"],"sources":["utils.ts"],"sourcesContent":["import type {\n InfiniteQueryObserverOptions,\n InfiniteQueryObserverResult,\n QueryFunctionContext,\n} from '@tanstack/react-query';\n\nimport {composeFullKey, idle} from '../../../core';\nimport type {\n DataSourceContext,\n DataSourceData,\n DataSourceError,\n DataSourceKey,\n DataSourceOptions,\n DataSourceParams,\n DataSourceRequest,\n DataSourceResponse,\n DataSourceState,\n} from '../../../core';\nimport {normalizeStatus} from '../../utils/normalizeStatus';\n\nimport type {AnyInfiniteQueryDataSource} from './types';\n\nconst EMPTY_ARRAY: unknown[] = [];\n\nexport const composeOptions = <TDataSource extends AnyInfiniteQueryDataSource>(\n context: DataSourceContext<TDataSource>,\n dataSource: TDataSource,\n params: DataSourceParams<TDataSource>,\n options?: DataSourceOptions<TDataSource>,\n): InfiniteQueryObserverOptions<\n DataSourceResponse<TDataSource>,\n DataSourceError<TDataSource>,\n DataSourceData<TDataSource>,\n DataSourceResponse<TDataSource>\n> => {\n const {transformParams, transformResponse, next, prev} = dataSource;\n\n return {\n ...dataSource.options,\n enabled: params !== idle,\n queryKey: composeFullKey(dataSource, params),\n queryFn: (\n fetchContext: QueryFunctionContext<\n DataSourceKey,\n Partial<DataSourceRequest<TDataSource>> | undefined\n >,\n ) => {\n const actualParams = transformParams ? transformParams(params) : params;\n const request =\n typeof actualParams === 'object'\n ? {...actualParams, ...fetchContext.pageParam}\n : actualParams;\n\n return dataSource.fetch(context, fetchContext, request);\n },\n select: transformResponse\n ? (data) => ({...data, pages: data.pages.map(transformResponse)})\n : undefined,\n getNextPageParam: next,\n getPreviousPageParam: prev,\n ...options,\n };\n};\n\nexport const transformResult = <TDataSource extends AnyInfiniteQueryDataSource>(\n result: InfiniteQueryObserverResult<DataSourceData<TDataSource>, DataSourceError<TDataSource>>,\n) => {\n return {\n ...result,\n status: normalizeStatus(result.status, result.fetchStatus),\n data: result.data?.pages.flat() ?? EMPTY_ARRAY,\n originalStatus: result.status,\n originalData: result.data,\n } as DataSourceState<TDataSource>;\n};\n"],"mappings":";;AAMA,SAAQA,cAAc,EAAEC,IAAI,QAAO,eAAe;AAYlD,SAAQC,eAAe,QAAO,6BAA6B;AAI3D,IAAMC,WAAsB,GAAG,EAAE;AAEjC,OAAO,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CACvBC,OAAuC,EACvCC,UAAuB,EACvBC,MAAqC,EACrCC,OAAwC,EAMvC;EACD,IAAOC,eAAe,GAAmCH,UAAU,CAA5DG,eAAe;IAAEC,iBAAiB,GAAgBJ,UAAU,CAA3CI,iBAAiB;IAAEC,IAAI,GAAUL,UAAU,CAAxBK,IAAI;IAAEC,IAAI,GAAIN,UAAU,CAAlBM,IAAI;EAErD,OAAAC,aAAA,CAAAA,aAAA,KACOP,UAAU,CAACE,OAAO;IACrBM,OAAO,EAAEP,MAAM,KAAKN,IAAI;IACxBc,QAAQ,EAAEf,cAAc,CAACM,UAAU,EAAEC,MAAM,CAAC;IAC5CS,OAAO,EAAE,SAATA,OAAOA,CACHC,YAGC,EACA;MACD,IAAMC,YAAY,GAAGT,eAAe,GAAGA,eAAe,CAACF,MAAM,CAAC,GAAGA,MAAM;MACvE,IAAMY,OAAO,GACTC,OAAA,CAAOF,YAAY,MAAK,QAAQ,GAAAL,aAAA,CAAAA,aAAA,KACtBK,YAAY,GAAKD,YAAY,CAACI,SAAS,IAC3CH,YAAY;MAEtB,OAAOZ,UAAU,CAACgB,KAAK,CAACjB,OAAO,EAAEY,YAAY,EAAEE,OAAO,CAAC;IAC3D,CAAC;IACDI,MAAM,EAAEb,iBAAiB,GACnB,UAACc,IAAI;MAAA,OAAAX,aAAA,CAAAA,aAAA,KAAUW,IAAI;QAAEC,KAAK,EAAED,IAAI,CAACC,KAAK,CAACC,GAAG,CAAChB,iBAAiB;MAAC;IAAA,CAAE,GAC/DiB,SAAS;IACfC,gBAAgB,EAAEjB,IAAI;IACtBkB,oBAAoB,EAAEjB;EAAI,GACvBJ,OAAO;AAElB,CAAC;AAED,OAAO,IAAMsB,eAAe,GAAG,SAAlBA,eAAeA,CACxBC,MAA8F,EAC7F;EAAA,IAAAC,qBAAA,EAAAC,YAAA;EACD,OAAApB,aAAA,CAAAA,aAAA,KACOkB,MAAM;IACTG,MAAM,EAAEhC,eAAe,CAAC6B,MAAM,CAACG,MAAM,EAAEH,MAAM,CAACI,WAAW,CAAC;IAC1DX,IAAI,GAAAQ,qBAAA,IAAAC,YAAA,GAAEF,MAAM,CAACP,IAAI,cAAAS,YAAA,uBAAXA,YAAA,CAAaR,KAAK,CAACW,IAAI,CAAC,CAAC,cAAAJ,qBAAA,cAAAA,qBAAA,GAAI7B,WAAW;IAC9CkC,cAAc,EAAEN,MAAM,CAACG,MAAM;IAC7BI,YAAY,EAAEP,MAAM,CAACP;EAAI;AAEjC,CAAC","ignoreList":[]}
|