@mittwald/flow-react-components 0.1.0-alpha.193 → 0.1.0-alpha.195
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/dist/List.js +2 -1
- package/dist/types/components/List/index.d.ts +1 -0
- package/dist/types/components/List/model/loading/IncrementalLoaderState.d.ts +3 -2
- package/dist/types/components/List/model/loading/types.d.ts +3 -3
- package/dist/types/components/List/setupComponents/ListStaticData.d.ts +1 -1
- package/dist/types/components/List/typedList.d.ts +1 -1
- package/package.json +4 -4
package/dist/List.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AsyncResource } from '@mittwald/react-use-promise';
|
|
2
|
+
import { ListData } from './types';
|
|
2
3
|
|
|
3
4
|
type AsyncResourceLoadingState = AsyncResource["state"]["value"];
|
|
4
|
-
type DataBatches<T> = T[]
|
|
5
|
+
type DataBatches<T> = ListData<T>[];
|
|
5
6
|
type BatchesLoadingState = AsyncResourceLoadingState[];
|
|
6
7
|
export declare class IncrementalLoaderState<T> {
|
|
7
8
|
dataBatches: DataBatches<T>;
|
|
@@ -10,7 +11,7 @@ export declare class IncrementalLoaderState<T> {
|
|
|
10
11
|
private constructor();
|
|
11
12
|
static useNew<T>(): IncrementalLoaderState<T>;
|
|
12
13
|
reset(): void;
|
|
13
|
-
setDataBatch(index: number, data: T
|
|
14
|
+
setDataBatch(index: number, data: ListData<T>): void;
|
|
14
15
|
setBatchLoadingState(index: number, state: AsyncResourceLoadingState): void;
|
|
15
16
|
get mergedData(): T[];
|
|
16
17
|
useMergedData(): T[];
|
|
@@ -18,20 +18,20 @@ export interface DataLoaderOptions<T> {
|
|
|
18
18
|
searchString?: SearchValue;
|
|
19
19
|
pagination?: DataLoaderPaginationOptions;
|
|
20
20
|
}
|
|
21
|
+
export type ListData<T> = readonly T[];
|
|
21
22
|
export interface DataLoaderResult<T> {
|
|
22
|
-
data: T
|
|
23
|
+
data: ListData<T>;
|
|
23
24
|
itemTotalCount?: number;
|
|
24
25
|
}
|
|
25
26
|
export type AsyncDataLoader<T> = (options?: DataLoaderOptions<T>) => Promise<DataLoaderResult<T>>;
|
|
26
27
|
type AsyncResourceFactory<T> = (options?: DataLoaderOptions<T>) => AsyncResource<DataLoaderResult<T>>;
|
|
27
|
-
type StaticData<T> = T[] | readonly T[];
|
|
28
28
|
interface DynamicLoaderShape {
|
|
29
29
|
manualSorting?: boolean;
|
|
30
30
|
manualFiltering?: boolean;
|
|
31
31
|
manualPagination?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export interface StaticDataLoaderShape<T> {
|
|
34
|
-
staticData:
|
|
34
|
+
staticData: ListData<T>;
|
|
35
35
|
}
|
|
36
36
|
export type AsyncResourceFactoryDataLoaderShape<T> = {
|
|
37
37
|
asyncResourceFactory: AsyncResourceFactory<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentType } from 'react';
|
|
2
2
|
|
|
3
3
|
type Props<T> = {} & {
|
|
4
|
-
data:
|
|
4
|
+
data: readonly T[];
|
|
5
5
|
};
|
|
6
6
|
export declare const ListStaticData: <T>(ignoredProps: Props<T>) => null;
|
|
7
7
|
export declare const TypedListStaticData: <T>() => ComponentType<Props<T>>;
|
|
@@ -19,7 +19,7 @@ export declare const typedList: <T>() => {
|
|
|
19
19
|
children?: import('react').ReactNode | undefined;
|
|
20
20
|
} & import('../../lib/types/props').PropsWithClassName & import('../../lib/types/props').PropsWithContainerBreakpointSize) => import("react").JSX.Element;
|
|
21
21
|
StaticData: import('react').ComponentType<{
|
|
22
|
-
data:
|
|
22
|
+
data: readonly T[];
|
|
23
23
|
}>;
|
|
24
24
|
LoaderAsync: import('react').ComponentType<Omit<import('./model/loading/types').AsyncDataLoaderShape<T>, "asyncLoader"> & {
|
|
25
25
|
children: import('./model/loading/types').AsyncDataLoader<T>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.195",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
"dependencies": {
|
|
285
285
|
"@chakra-ui/live-region": "^2.1.0",
|
|
286
286
|
"@internationalized/string-compiler": "^3.2.4",
|
|
287
|
-
"@mittwald/react-tunnel": "^0.1.0-alpha.
|
|
287
|
+
"@mittwald/react-tunnel": "^0.1.0-alpha.195",
|
|
288
288
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
289
289
|
"@react-aria/utils": "^3.25.1",
|
|
290
290
|
"@react-types/shared": "^3.24.1",
|
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
},
|
|
311
311
|
"devDependencies": {
|
|
312
312
|
"@faker-js/faker": "^8.4.1",
|
|
313
|
-
"@mittwald/flow-design-tokens": "^0.1.0-alpha.
|
|
313
|
+
"@mittwald/flow-design-tokens": "^0.1.0-alpha.195",
|
|
314
314
|
"@mittwald/react-use-promise": "^2.3.13",
|
|
315
315
|
"@nx/storybook": "^19.5.6",
|
|
316
316
|
"@storybook/addon-a11y": "^8.2.7",
|
|
@@ -388,5 +388,5 @@
|
|
|
388
388
|
"optional": true
|
|
389
389
|
}
|
|
390
390
|
},
|
|
391
|
-
"gitHead": "
|
|
391
|
+
"gitHead": "3161e2c667b7daba79a1aa0e0cd1a8343b4330a3"
|
|
392
392
|
}
|