@gravity-ui/data-source 0.10.0-alpha.0 → 0.10.0-alpha.10
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/Async/Async.d.ts +3 -0
- package/build/cjs/react/components/Async/Async.js +18 -0
- package/build/cjs/react/components/Async/Async.js.map +1 -0
- package/build/cjs/react/components/Async/index.d.ts +3 -0
- package/build/cjs/react/components/Async/index.js +20 -0
- package/build/cjs/react/components/Async/index.js.map +1 -0
- package/build/cjs/react/components/Async/types.d.ts +9 -0
- package/build/cjs/react/components/Async/types.js +6 -0
- package/build/cjs/react/components/Async/types.js.map +1 -0
- package/build/cjs/react/components/Async/withAsync.d.ts +3 -0
- package/build/cjs/react/components/Async/withAsync.js +26 -0
- package/build/cjs/react/components/Async/withAsync.js.map +1 -0
- package/build/cjs/react/components/AsyncBoundary/AsyncBoundary.js +3 -2
- package/build/cjs/react/components/AsyncBoundary/AsyncBoundary.js.map +1 -1
- package/build/cjs/react/components/AsyncBoundary/types.d.ts +3 -3
- 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/index.d.ts +1 -0
- package/build/cjs/react/index.js +12 -0
- package/build/cjs/react/index.js.map +1 -1
- package/build/cjs/react-query/components/QueryAsyncBoundary/types.d.ts +5 -4
- 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/Async/Async.d.ts +3 -0
- package/build/esm/react/components/Async/Async.js +11 -0
- package/build/esm/react/components/Async/Async.js.map +1 -0
- package/build/esm/react/components/Async/index.d.ts +3 -0
- package/build/esm/react/components/Async/index.js +3 -0
- package/build/esm/react/components/Async/index.js.map +1 -0
- package/build/esm/react/components/Async/types.d.ts +9 -0
- package/build/esm/react/components/Async/types.js +2 -0
- package/build/esm/react/components/Async/types.js.map +1 -0
- package/build/esm/react/components/Async/withAsync.d.ts +3 -0
- package/build/esm/react/components/Async/withAsync.js +19 -0
- package/build/esm/react/components/Async/withAsync.js.map +1 -0
- package/build/esm/react/components/AsyncBoundary/AsyncBoundary.js +3 -2
- package/build/esm/react/components/AsyncBoundary/AsyncBoundary.js.map +1 -1
- package/build/esm/react/components/AsyncBoundary/types.d.ts +3 -3
- 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/index.d.ts +1 -0
- package/build/esm/react/index.js +1 -0
- package/build/esm/react/index.js.map +1 -1
- package/build/esm/react-query/components/QueryAsyncBoundary/types.d.ts +5 -4
- 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/build/plugin/esbuild.cjs +5 -0
- package/build/plugin/esbuild.d.cts +6 -0
- package/build/plugin/esbuild.mjs +1 -1
- package/build/plugin/factory-B49Ym3ij.cjs +696 -0
- package/build/plugin/{factory-2tSt4Rte.mjs → factory-C_-OCKcW.mjs} +197 -56
- package/build/plugin/index-Dv4gZVjD.d.cts +23 -0
- package/build/plugin/index.cjs +12 -0
- package/build/plugin/index.d.cts +7 -0
- package/build/plugin/index.mjs +1 -1
- package/build/plugin/rollup.cjs +5 -0
- package/build/plugin/rollup.d.cts +5 -0
- package/build/plugin/rollup.mjs +1 -1
- package/build/plugin/rspack.cjs +5 -0
- package/build/plugin/rspack.d.cts +6 -0
- package/build/plugin/rspack.mjs +1 -1
- package/build/plugin/typings/client.d.ts +16 -4
- package/build/plugin/vite.cjs +5 -0
- package/build/plugin/vite.d.cts +5 -0
- package/build/plugin/vite.mjs +1 -1
- package/build/plugin/webpack.cjs +5 -0
- package/build/plugin/webpack.d.cts +6 -0
- package/build/plugin/webpack.mjs +1 -1
- package/package.json +13 -10
|
@@ -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
|
-
export interface QueryAsyncBoundaryComponent<TProps extends object> extends React.FC<TProps
|
|
5
|
+
export interface QueryAsyncBoundaryComponent<TProps extends object = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {
|
|
5
6
|
Content: React.ComponentType<TProps>;
|
|
6
|
-
Loading:
|
|
7
|
-
Error:
|
|
7
|
+
Loading: ComponentType<TLoadingProps & Partial<TProps>>;
|
|
8
|
+
Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;
|
|
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
|
|
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<\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n> extends React.FC<TProps & TLoadingProps & Omit<TErrorProps, keyof ErrorViewProps>> {\n Content: React.ComponentType<TProps>;\n Loading: ComponentType<TLoadingProps & Partial<TProps>>;\n Error: ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>;\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 = {}, TLoadingProps extends object = {}, TErrorProps extends object = {}>(Component: React.ComponentType<TProps>, LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>, ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>) => QueryAsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;
|
|
@@ -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 = <\n TProps extends object = {},\n TLoadingProps extends object = {},\n TErrorProps extends object = {},\n>(\n Component: React.ComponentType<TProps>,\n LoadingView: React.ComponentType<TLoadingProps & Partial<TProps>>,\n ErrorView: React.ComponentType<ErrorViewProps & TErrorProps & Partial<TProps>>,\n) => {\n const WrappedComponent = ((props: TProps & TLoadingProps & TErrorProps) => (\n <QueryAsyncBoundary\n LoadingView={() => <LoadingView {...props} />}\n ErrorView={(errorProps) => <ErrorView {...props} {...errorProps} />}\n >\n <Component {...props} />\n </QueryAsyncBoundary>\n )) as QueryAsyncBoundaryComponent<TProps, TLoadingProps, TErrorProps>;\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,CAK/BC,SAAsC,EACtCC,YAAiE,EACjEC,UAA8E,EAC7E;EACD,IAAMC,gBAAgB,GAAI,SAApBA,gBAAgBA,CAAKC,KAA2C;IAAA,oBAClEN,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,CAC4C;EAErED,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":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { r as DataSourceLazyPluginOptions } from "./index-Dv4gZVjD.cjs";
|
|
2
|
+
import * as _$esbuild from "esbuild";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin/esbuild.d.ts
|
|
5
|
+
declare const _default: (options?: DataSourceLazyPluginOptions | undefined) => _$esbuild.Plugin;
|
|
6
|
+
export = _default;
|
package/build/plugin/esbuild.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as dataSourceLazyUnpluginFactory } from "./factory-
|
|
1
|
+
import { n as dataSourceLazyUnpluginFactory } from "./factory-C_-OCKcW.mjs";
|
|
2
2
|
import { createEsbuildPlugin } from "unplugin";
|
|
3
3
|
//#region src/plugin/esbuild.ts
|
|
4
4
|
var esbuild_default = createEsbuildPlugin(dataSourceLazyUnpluginFactory);
|