@contember/bindx-react 0.1.0
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/batching/QueryBatcher.d.ts +31 -0
- package/dist/batching/QueryBatcher.d.ts.map +1 -0
- package/dist/batching/index.d.ts +2 -0
- package/dist/batching/index.d.ts.map +1 -0
- package/dist/components/EntityScope.d.ts +28 -0
- package/dist/components/EntityScope.d.ts.map +1 -0
- package/dist/dataview/DataGrid.d.ts +45 -0
- package/dist/dataview/DataGrid.d.ts.map +1 -0
- package/dist/dataview/DataGridPagination.d.ts +24 -0
- package/dist/dataview/DataGridPagination.d.ts.map +1 -0
- package/dist/dataview/DataGridToolbar.d.ts +16 -0
- package/dist/dataview/DataGridToolbar.d.ts.map +1 -0
- package/dist/dataview/DataViewContext.d.ts +32 -0
- package/dist/dataview/DataViewContext.d.ts.map +1 -0
- package/dist/dataview/columns.d.ts +115 -0
- package/dist/dataview/columns.d.ts.map +1 -0
- package/dist/dataview/contextHooks.d.ts +48 -0
- package/dist/dataview/contextHooks.d.ts.map +1 -0
- package/dist/dataview/dataAttribute.d.ts +6 -0
- package/dist/dataview/dataAttribute.d.ts.map +1 -0
- package/dist/dataview/export.d.ts +46 -0
- package/dist/dataview/export.d.ts.map +1 -0
- package/dist/dataview/filterComponents.d.ts +127 -0
- package/dist/dataview/filterComponents.d.ts.map +1 -0
- package/dist/dataview/filterContext.d.ts +10 -0
- package/dist/dataview/filterContext.d.ts.map +1 -0
- package/dist/dataview/filterHooks.d.ts +74 -0
- package/dist/dataview/filterHooks.d.ts.map +1 -0
- package/dist/dataview/filterScope.d.ts +54 -0
- package/dist/dataview/filterScope.d.ts.map +1 -0
- package/dist/dataview/filterWrappers.d.ts +65 -0
- package/dist/dataview/filterWrappers.d.ts.map +1 -0
- package/dist/dataview/index.d.ts +21 -0
- package/dist/dataview/index.d.ts.map +1 -0
- package/dist/dataview/infiniteLoad.d.ts +32 -0
- package/dist/dataview/infiniteLoad.d.ts.map +1 -0
- package/dist/dataview/loaderComponents.d.ts +80 -0
- package/dist/dataview/loaderComponents.d.ts.map +1 -0
- package/dist/dataview/pagingComponents.d.ts +50 -0
- package/dist/dataview/pagingComponents.d.ts.map +1 -0
- package/dist/dataview/renderCellValue.d.ts +9 -0
- package/dist/dataview/renderCellValue.d.ts.map +1 -0
- package/dist/dataview/selectionComponents.d.ts +62 -0
- package/dist/dataview/selectionComponents.d.ts.map +1 -0
- package/dist/dataview/sortingComponents.d.ts +39 -0
- package/dist/dataview/sortingComponents.d.ts.map +1 -0
- package/dist/dataview/stateStorage.d.ts +19 -0
- package/dist/dataview/stateStorage.d.ts.map +1 -0
- package/dist/dataview/useDataView.d.ts +58 -0
- package/dist/dataview/useDataView.d.ts.map +1 -0
- package/dist/dataview/useDataViewState.d.ts +89 -0
- package/dist/dataview/useDataViewState.d.ts.map +1 -0
- package/dist/hooks/BackendAdapterContext.d.ts +110 -0
- package/dist/hooks/BackendAdapterContext.d.ts.map +1 -0
- package/dist/hooks/ContemberBindxProvider.d.ts +67 -0
- package/dist/hooks/ContemberBindxProvider.d.ts.map +1 -0
- package/dist/hooks/createBindx.d.ts +39 -0
- package/dist/hooks/createBindx.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +10 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useBindxEvents.d.ts +83 -0
- package/dist/hooks/useBindxEvents.d.ts.map +1 -0
- package/dist/hooks/useEntity.d.ts +123 -0
- package/dist/hooks/useEntity.d.ts.map +1 -0
- package/dist/hooks/useEntityBeforePersist.d.ts +22 -0
- package/dist/hooks/useEntityBeforePersist.d.ts.map +1 -0
- package/dist/hooks/useEntityCore.d.ts +52 -0
- package/dist/hooks/useEntityCore.d.ts.map +1 -0
- package/dist/hooks/useEntityImpl.d.ts +105 -0
- package/dist/hooks/useEntityImpl.d.ts.map +1 -0
- package/dist/hooks/useEntityList.d.ts +102 -0
- package/dist/hooks/useEntityList.d.ts.map +1 -0
- package/dist/hooks/useEntityListCore.d.ts +49 -0
- package/dist/hooks/useEntityListCore.d.ts.map +1 -0
- package/dist/hooks/useEntityListImpl.d.ts +70 -0
- package/dist/hooks/useEntityListImpl.d.ts.map +1 -0
- package/dist/hooks/useErrors.d.ts +72 -0
- package/dist/hooks/useErrors.d.ts.map +1 -0
- package/dist/hooks/usePersist.d.ts +115 -0
- package/dist/hooks/usePersist.d.ts.map +1 -0
- package/dist/hooks/useSelectionCollection.d.ts +41 -0
- package/dist/hooks/useSelectionCollection.d.ts.map +1 -0
- package/dist/hooks/useSelectionCollectionForList.d.ts +40 -0
- package/dist/hooks/useSelectionCollectionForList.d.ts.map +1 -0
- package/dist/hooks/useStableSelectionMeta.d.ts +11 -0
- package/dist/hooks/useStableSelectionMeta.d.ts.map +1 -0
- package/dist/hooks/useStoreSubscription.d.ts +19 -0
- package/dist/hooks/useStoreSubscription.d.ts.map +1 -0
- package/dist/hooks/useUndo.d.ts +45 -0
- package/dist/hooks/useUndo.d.ts.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/jsx/SelectionMeta.d.ts +2 -0
- package/dist/jsx/SelectionMeta.d.ts.map +1 -0
- package/dist/jsx/analyzer.d.ts +22 -0
- package/dist/jsx/analyzer.d.ts.map +1 -0
- package/dist/jsx/collectorProxy.d.ts +14 -0
- package/dist/jsx/collectorProxy.d.ts.map +1 -0
- package/dist/jsx/componentBuilder.d.ts +51 -0
- package/dist/jsx/componentBuilder.d.ts.map +1 -0
- package/dist/jsx/componentBuilder.types.d.ts +268 -0
- package/dist/jsx/componentBuilder.types.d.ts.map +1 -0
- package/dist/jsx/componentBuilderCompat.d.ts +17 -0
- package/dist/jsx/componentBuilderCompat.d.ts.map +1 -0
- package/dist/jsx/componentFactory.d.ts +39 -0
- package/dist/jsx/componentFactory.d.ts.map +1 -0
- package/dist/jsx/components/Entity.d.ts +82 -0
- package/dist/jsx/components/Entity.d.ts.map +1 -0
- package/dist/jsx/components/EntityList.d.ts +48 -0
- package/dist/jsx/components/EntityList.d.ts.map +1 -0
- package/dist/jsx/components/Field.d.ts +27 -0
- package/dist/jsx/components/Field.d.ts.map +1 -0
- package/dist/jsx/components/HasMany.d.ts +34 -0
- package/dist/jsx/components/HasMany.d.ts.map +1 -0
- package/dist/jsx/components/HasOne.d.ts +25 -0
- package/dist/jsx/components/HasOne.d.ts.map +1 -0
- package/dist/jsx/components/HasRole.d.ts +51 -0
- package/dist/jsx/components/HasRole.d.ts.map +1 -0
- package/dist/jsx/components/If.d.ts +51 -0
- package/dist/jsx/components/If.d.ts.map +1 -0
- package/dist/jsx/components/Show.d.ts +33 -0
- package/dist/jsx/components/Show.d.ts.map +1 -0
- package/dist/jsx/components/index.d.ts +8 -0
- package/dist/jsx/components/index.d.ts.map +1 -0
- package/dist/jsx/conditions.d.ts +310 -0
- package/dist/jsx/conditions.d.ts.map +1 -0
- package/dist/jsx/createComponent.d.ts +44 -0
- package/dist/jsx/createComponent.d.ts.map +1 -0
- package/dist/jsx/index.d.ts +19 -0
- package/dist/jsx/index.d.ts.map +1 -0
- package/dist/jsx/inlineProxy.d.ts +14 -0
- package/dist/jsx/inlineProxy.d.ts.map +1 -0
- package/dist/jsx/legacyTypes.d.ts +26 -0
- package/dist/jsx/legacyTypes.d.ts.map +1 -0
- package/dist/jsx/proxy.d.ts +2 -0
- package/dist/jsx/proxy.d.ts.map +1 -0
- package/dist/jsx/proxyShared.d.ts +14 -0
- package/dist/jsx/proxyShared.d.ts.map +1 -0
- package/dist/jsx/runtimeProxy.d.ts +11 -0
- package/dist/jsx/runtimeProxy.d.ts.map +1 -0
- package/dist/jsx/standaloneCreateComponent.d.ts +30 -0
- package/dist/jsx/standaloneCreateComponent.d.ts.map +1 -0
- package/dist/jsx/types.d.ts +109 -0
- package/dist/jsx/types.d.ts.map +1 -0
- package/dist/jsx/withCollector.d.ts +39 -0
- package/dist/jsx/withCollector.d.ts.map +1 -0
- package/dist/roles/RoleContext.d.ts +31 -0
- package/dist/roles/RoleContext.d.ts.map +1 -0
- package/dist/roles/index.d.ts +2 -0
- package/dist/roles/index.d.ts.map +1 -0
- package/package.json +34 -0
- package/src/batching/QueryBatcher.ts +114 -0
- package/src/batching/index.ts +1 -0
- package/src/components/EntityScope.tsx +43 -0
- package/src/hooks/BackendAdapterContext.tsx +214 -0
- package/src/hooks/ContemberBindxProvider.tsx +158 -0
- package/src/hooks/index.ts +61 -0
- package/src/hooks/useBindxEvents.ts +229 -0
- package/src/hooks/useEntity.ts +489 -0
- package/src/hooks/useEntityBeforePersist.ts +32 -0
- package/src/hooks/useEntityList.ts +444 -0
- package/src/hooks/useErrors.ts +150 -0
- package/src/hooks/usePersist.ts +377 -0
- package/src/hooks/useSelectionCollection.ts +122 -0
- package/src/hooks/useStoreSubscription.ts +51 -0
- package/src/hooks/useUndo.ts +83 -0
- package/src/index.ts +357 -0
- package/src/jsx/SelectionMeta.ts +2 -0
- package/src/jsx/analyzer.ts +261 -0
- package/src/jsx/collectorProxy.ts +282 -0
- package/src/jsx/componentBuilder.ts +180 -0
- package/src/jsx/componentBuilder.types.ts +463 -0
- package/src/jsx/componentBuilderCompat.ts +39 -0
- package/src/jsx/componentFactory.ts +400 -0
- package/src/jsx/components/Entity.tsx +383 -0
- package/src/jsx/components/EntityList.tsx +147 -0
- package/src/jsx/components/Field.tsx +79 -0
- package/src/jsx/components/HasMany.tsx +109 -0
- package/src/jsx/components/HasOne.tsx +78 -0
- package/src/jsx/components/HasRole.tsx +95 -0
- package/src/jsx/components/If.tsx +127 -0
- package/src/jsx/components/Show.tsx +56 -0
- package/src/jsx/components/index.ts +20 -0
- package/src/jsx/conditions.ts +472 -0
- package/src/jsx/createComponent.ts +175 -0
- package/src/jsx/index.ts +135 -0
- package/src/jsx/legacyTypes.ts +30 -0
- package/src/jsx/proxy.ts +1 -0
- package/src/jsx/proxyShared.ts +42 -0
- package/src/jsx/standaloneCreateComponent.ts +47 -0
- package/src/jsx/types.ts +192 -0
- package/src/jsx/withCollector.ts +45 -0
- package/src/roles/RoleContext.tsx +57 -0
- package/src/roles/index.ts +1 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter hooks — typed state access and action hooks for filter components.
|
|
3
|
+
*
|
|
4
|
+
* These hooks match the Contember react-dataview API:
|
|
5
|
+
* - useDataViewFilter: generic [state, setFilter, meta] tuple
|
|
6
|
+
* - useDataViewBooleanFilter: [current, set] with action types
|
|
7
|
+
* - useDataViewEnumFilter: [current, set] with include/exclude/toggle actions
|
|
8
|
+
* - useDataViewRelationFilter: [current, set] with include/exclude/toggle actions
|
|
9
|
+
* - useDataViewTextFilterInput: { value, onChange } with debounce
|
|
10
|
+
* - useDataViewTextFilterMatchMode: [isCurrent, set]
|
|
11
|
+
* - useDataViewNullFilter: [state, set] with include/exclude/toggle actions
|
|
12
|
+
*/
|
|
13
|
+
import { type ChangeEvent, type SetStateAction } from 'react';
|
|
14
|
+
import type { FilterArtifact, TextFilterArtifact } from '@contember/bindx';
|
|
15
|
+
export type UseDataViewFilterResult<T extends FilterArtifact> = [
|
|
16
|
+
state: T | undefined,
|
|
17
|
+
setFilter: (filter: SetStateAction<T | undefined>) => void,
|
|
18
|
+
meta: {
|
|
19
|
+
isEmpty?: boolean;
|
|
20
|
+
}
|
|
21
|
+
];
|
|
22
|
+
export declare function useDataViewFilter<T extends FilterArtifact>(key: string): UseDataViewFilterResult<T>;
|
|
23
|
+
export type DataViewSetBooleanFilterAction = 'include' | 'unset' | 'toggle';
|
|
24
|
+
export type DataViewBooleanFilterCurrent = 'include' | 'none';
|
|
25
|
+
export type UseDataViewBooleanFilterResult = [
|
|
26
|
+
current: DataViewBooleanFilterCurrent,
|
|
27
|
+
set: (action: DataViewSetBooleanFilterAction) => void
|
|
28
|
+
];
|
|
29
|
+
export declare function useDataViewBooleanFilter(name: string, value: boolean): UseDataViewBooleanFilterResult;
|
|
30
|
+
export declare function useDataViewBooleanFilterFactory(name: string): (value: boolean) => UseDataViewBooleanFilterResult;
|
|
31
|
+
export type DataViewSetEnumFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude';
|
|
32
|
+
export type DataViewEnumFilterCurrent = 'include' | 'exclude' | 'none';
|
|
33
|
+
export type UseDataViewEnumFilterResult = [
|
|
34
|
+
current: DataViewEnumFilterCurrent,
|
|
35
|
+
set: (action: DataViewSetEnumFilterAction) => void
|
|
36
|
+
];
|
|
37
|
+
export declare function useDataViewEnumFilter(name: string, value: string): UseDataViewEnumFilterResult;
|
|
38
|
+
export declare function useDataViewEnumFilterFactory(name: string): (value: string) => UseDataViewEnumFilterResult;
|
|
39
|
+
export type DataViewSetRelationFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude';
|
|
40
|
+
export type DataViewRelationFilterCurrent = 'include' | 'exclude' | 'none';
|
|
41
|
+
export type UseDataViewRelationFilterResult = [
|
|
42
|
+
current: DataViewRelationFilterCurrent,
|
|
43
|
+
set: (action: DataViewSetRelationFilterAction) => void
|
|
44
|
+
];
|
|
45
|
+
export declare function useDataViewRelationFilter(name: string, entityId: string): UseDataViewRelationFilterResult;
|
|
46
|
+
export declare function useDataViewRelationFilterFactory(name: string): (id: string) => UseDataViewRelationFilterResult;
|
|
47
|
+
export interface UseDataViewTextFilterInputResult {
|
|
48
|
+
value: string;
|
|
49
|
+
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
50
|
+
}
|
|
51
|
+
export declare function useDataViewTextFilterInput({ name, debounceMs }: {
|
|
52
|
+
name: string;
|
|
53
|
+
debounceMs?: number;
|
|
54
|
+
}): UseDataViewTextFilterInputResult;
|
|
55
|
+
export type UseDataViewTextFilterMatchModeResult = [isCurrent: boolean, set: () => void];
|
|
56
|
+
export declare function useDataViewTextFilterMatchMode(name: string, mode: TextFilterArtifact['mode']): UseDataViewTextFilterMatchModeResult;
|
|
57
|
+
export interface UseDataViewNumberFilterInputResult {
|
|
58
|
+
value: string;
|
|
59
|
+
onChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
60
|
+
}
|
|
61
|
+
export interface UseDataViewNumberFilterInputProps {
|
|
62
|
+
name: string;
|
|
63
|
+
type: 'from' | 'to';
|
|
64
|
+
allowFloat?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export declare function useDataViewNumberFilterInput({ name, type, allowFloat }: UseDataViewNumberFilterInputProps): UseDataViewNumberFilterInputResult;
|
|
67
|
+
export type DataViewSetNullFilterAction = 'include' | 'exclude' | 'unset' | 'toggleInclude' | 'toggleExclude';
|
|
68
|
+
export type DataViewNullFilterState = 'include' | 'exclude' | 'none';
|
|
69
|
+
export type UseDataViewNullFilterResult = [
|
|
70
|
+
state: DataViewNullFilterState,
|
|
71
|
+
set: (action: DataViewSetNullFilterAction) => void
|
|
72
|
+
];
|
|
73
|
+
export declare function useDataViewNullFilter(name: string): UseDataViewNullFilterResult;
|
|
74
|
+
//# sourceMappingURL=filterHooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterHooks.d.ts","sourceRoot":"","sources":["../../src/dataview/filterHooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAqD,MAAM,OAAO,CAAA;AAEhH,OAAO,KAAK,EACX,cAAc,EACd,kBAAkB,EAKlB,MAAM,kBAAkB,CAAA;AAMzB,MAAM,MAAM,uBAAuB,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/D,KAAK,EAAE,CAAC,GAAG,SAAS;IACpB,SAAS,EAAE,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,GAAG,SAAS,CAAC,KAAK,IAAI;IAC1D,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;CAC3B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,GAAG,EAAE,MAAM,GAAG,uBAAuB,CAAC,CAAC,CAAC,CA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AS,GAAG,MAAM,CAAA;AACpE,MAAM,MAAM,2BAA2B,GAAG;IACzC,KAAK,EAAE,uBAAuB;IAC9B,GAAG,EAAE,CAAC,MAAM,EAAE,2BAA2B,KAAK,IAAI;CAClD,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,2BAA2B,CA8B/E"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter scope components — declarative filter registration and name scoping.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <DataViewFilterScope name="title">
|
|
7
|
+
* <DataViewTextFilterInput />
|
|
8
|
+
* </DataViewFilterScope>
|
|
9
|
+
*
|
|
10
|
+
* <DataViewFilter name="title" filterHandler={createTextFilterHandler('title')}>
|
|
11
|
+
* <DataViewTextFilterInput />
|
|
12
|
+
* </DataViewFilter>
|
|
13
|
+
*
|
|
14
|
+
* <DataViewTextFilter field="title">
|
|
15
|
+
* <DataViewTextFilterInput />
|
|
16
|
+
* </DataViewTextFilter>
|
|
17
|
+
*
|
|
18
|
+
* <DataViewHasFilterType name="title">
|
|
19
|
+
* <span>Title filter is available</span>
|
|
20
|
+
* </DataViewHasFilterType>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import React, { type ReactElement } from 'react';
|
|
24
|
+
import type { FilterHandler, FilterArtifact } from '@contember/bindx';
|
|
25
|
+
export interface DataViewFilterScopeProps {
|
|
26
|
+
name: string;
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sets the filter name context for all children.
|
|
31
|
+
* Child filter triggers will infer their filter name from this scope.
|
|
32
|
+
*/
|
|
33
|
+
export declare function DataViewFilterScope({ name, children }: DataViewFilterScopeProps): ReactElement;
|
|
34
|
+
export interface DataViewFilterProps {
|
|
35
|
+
name: string;
|
|
36
|
+
filterHandler: FilterHandler<FilterArtifact>;
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Registers a filter handler and sets the filter name context.
|
|
41
|
+
*
|
|
42
|
+
* Note: When used inside a DataGrid, filters are already registered
|
|
43
|
+
* from column definitions. This component then just provides the name scope.
|
|
44
|
+
*/
|
|
45
|
+
export declare function DataViewFilter({ name, children }: DataViewFilterProps): ReactElement;
|
|
46
|
+
export interface DataViewHasFilterTypeProps {
|
|
47
|
+
name: string;
|
|
48
|
+
children: React.ReactNode;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Renders children only if a filter with the given name is registered.
|
|
52
|
+
*/
|
|
53
|
+
export declare function DataViewHasFilterType({ name, children }: DataViewHasFilterTypeProps): ReactElement | null;
|
|
54
|
+
//# sourceMappingURL=filterScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filterScope.d.ts","sourceRoot":"","sources":["../../src/dataview/filterScope.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAGhD,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAMrE,MAAM,WAAW,wBAAwB;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAM9F;AAMD,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,aAAa,CAAC,cAAc,CAAC,CAAA;IAC5C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,mBAAmB,GAAG,YAAY,CAMpF;AAMD,MAAM,WAAW,0BAA0B;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,0BAA0B,GAAG,YAAY,GAAG,IAAI,CAGzG"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed filter wrapper components — provide filter name scope for specific filter types.
|
|
3
|
+
*
|
|
4
|
+
* Each wrapper sets the filter name context so child trigger components
|
|
5
|
+
* can infer their filter name automatically.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <DataViewTextFilter field="title">
|
|
10
|
+
* <DataViewTextFilterInput />
|
|
11
|
+
* <DataViewTextFilterMatchModeTrigger mode="contains">
|
|
12
|
+
* <button>Contains</button>
|
|
13
|
+
* </DataViewTextFilterMatchModeTrigger>
|
|
14
|
+
* </DataViewTextFilter>
|
|
15
|
+
*
|
|
16
|
+
* <DataViewBooleanFilter field="published">
|
|
17
|
+
* <DataViewBooleanFilterTrigger value={true} action="toggle">
|
|
18
|
+
* <button>Published</button>
|
|
19
|
+
* </DataViewBooleanFilterTrigger>
|
|
20
|
+
* </DataViewBooleanFilter>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import React, { type ReactElement } from 'react';
|
|
24
|
+
interface FilterWrapperProps {
|
|
25
|
+
field: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export interface DataViewTextFilterProps extends FilterWrapperProps {
|
|
30
|
+
}
|
|
31
|
+
export declare function DataViewTextFilter({ field, name, children }: DataViewTextFilterProps): ReactElement;
|
|
32
|
+
export interface DataViewBooleanFilterProps extends FilterWrapperProps {
|
|
33
|
+
}
|
|
34
|
+
export declare function DataViewBooleanFilter({ field, name, children }: DataViewBooleanFilterProps): ReactElement;
|
|
35
|
+
export interface DataViewNumberFilterProps extends FilterWrapperProps {
|
|
36
|
+
}
|
|
37
|
+
export declare function DataViewNumberFilter({ field, name, children }: DataViewNumberFilterProps): ReactElement;
|
|
38
|
+
export interface DataViewDateFilterProps extends FilterWrapperProps {
|
|
39
|
+
}
|
|
40
|
+
export declare function DataViewDateFilter({ field, name, children }: DataViewDateFilterProps): ReactElement;
|
|
41
|
+
export interface DataViewEnumFilterProps extends FilterWrapperProps {
|
|
42
|
+
}
|
|
43
|
+
export declare function DataViewEnumFilter({ field, name, children }: DataViewEnumFilterProps): ReactElement;
|
|
44
|
+
export interface DataViewEnumListFilterProps extends FilterWrapperProps {
|
|
45
|
+
}
|
|
46
|
+
export declare function DataViewEnumListFilter({ field, name, children }: DataViewEnumListFilterProps): ReactElement;
|
|
47
|
+
export interface DataViewHasOneFilterProps extends FilterWrapperProps {
|
|
48
|
+
}
|
|
49
|
+
export declare function DataViewHasOneFilter({ field, name, children }: DataViewHasOneFilterProps): ReactElement;
|
|
50
|
+
export interface DataViewHasManyFilterProps extends FilterWrapperProps {
|
|
51
|
+
}
|
|
52
|
+
export declare function DataViewHasManyFilter({ field, name, children }: DataViewHasManyFilterProps): ReactElement;
|
|
53
|
+
export interface DataViewIsDefinedFilterProps extends FilterWrapperProps {
|
|
54
|
+
}
|
|
55
|
+
export declare function DataViewIsDefinedFilter({ field, name, children }: DataViewIsDefinedFilterProps): ReactElement;
|
|
56
|
+
export interface DataViewUnionTextFilterProps {
|
|
57
|
+
/** Single field or array of fields to search across */
|
|
58
|
+
fields: string | string[];
|
|
59
|
+
/** Required unique filter name */
|
|
60
|
+
name: string;
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
}
|
|
63
|
+
export declare function DataViewUnionTextFilter({ name, children }: DataViewUnionTextFilterProps): ReactElement;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=filterWrappers.d.ts.map
|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AAE,QAAQ,EAAE,EAAE,2BAA2B,GAAG,YAAY,CAM3G;AAMD,MAAM,WAAW,yBAA0B,SAAQ,kBAAkB;CAAG;AAExE,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,YAAY,CAMvG;AAMD,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;CAAG;AAEzE,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,0BAA0B,GAAG,YAAY,CAMzG;AAMD,MAAM,WAAW,4BAA6B,SAAQ,kBAAkB;CAAG;AAE3E,wBAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,4BAA4B,GAAG,YAAY,CAM7G;AAMD,MAAM,WAAW,4BAA4B;IAC5C,uDAAuD;IACvD,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACzB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,uBAAuB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,4BAA4B,GAAG,YAAY,CAMtG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { DataGrid, type DataGridProps, QUERY_FILTER_NAME } from './DataGrid.js';
|
|
2
|
+
export { renderCellValue } from './renderCellValue.js';
|
|
3
|
+
export { DataGridTextColumn, DataGridNumberColumn, DataGridDateColumn, DataGridDateTimeColumn, DataGridBooleanColumn, DataGridEnumColumn, DataGridEnumListColumn, DataGridUuidColumn, DataGridIsDefinedColumn, DataGridHasOneColumn, DataGridHasManyColumn, DataGridActionColumn, DataGridColumn, type DataGridTextColumnProps, type DataGridNumberColumnProps, type DataGridDateColumnProps, type DataGridDateTimeColumnProps, type DataGridBooleanColumnProps, type DataGridEnumColumnProps, type DataGridEnumListColumnProps, type DataGridUuidColumnProps, type DataGridIsDefinedColumnProps, type DataGridHasOneColumnProps, type DataGridHasManyColumnProps, type DataGridActionColumnProps, type DataGridColumnProps, type ColumnMeta, extractColumns, extractFieldName, COLUMN_META, } from './columns.js';
|
|
4
|
+
export { useFilteringState, useSortingState, usePagingState, useSelectionState, type FilteringState, type RegisteredFilter, type UseFilteringOptions, type UseSortingOptions, type SortingStateResult, type UsePagingOptions, type PagingStateResult, type UseSelectionOptions, type SelectionStateResult, } from './useDataViewState.js';
|
|
5
|
+
export { useDataViewContext, useOptionalDataViewContext, DataViewProvider, type DataViewContextValue, type DataViewItem, type DataViewLoaderState as DataViewLoaderStateType, } from './DataViewContext.js';
|
|
6
|
+
export { useDataView, type UseDataViewOptions, type DataViewResult } from './useDataView.js';
|
|
7
|
+
export { dataAttribute } from './dataAttribute.js';
|
|
8
|
+
export { useDataViewFilterName, useOptionalDataViewFilterName, DataViewFilterNameProvider, } from './filterContext.js';
|
|
9
|
+
export { DataViewFilterScope, type DataViewFilterScopeProps, DataViewFilter, type DataViewFilterProps, DataViewHasFilterType, type DataViewHasFilterTypeProps, } from './filterScope.js';
|
|
10
|
+
export { DataViewTextFilter, type DataViewTextFilterProps, DataViewBooleanFilter, type DataViewBooleanFilterProps, DataViewNumberFilter, type DataViewNumberFilterProps, DataViewDateFilter, type DataViewDateFilterProps, DataViewEnumFilter, type DataViewEnumFilterProps, DataViewEnumListFilter, type DataViewEnumListFilterProps, DataViewHasOneFilter, type DataViewHasOneFilterProps, DataViewHasManyFilter, type DataViewHasManyFilterProps, DataViewIsDefinedFilter, type DataViewIsDefinedFilterProps, DataViewUnionTextFilter, type DataViewUnionTextFilterProps, } from './filterWrappers.js';
|
|
11
|
+
export { useDataViewFilter, type UseDataViewFilterResult, useDataViewBooleanFilter, useDataViewBooleanFilterFactory, type DataViewSetBooleanFilterAction, type DataViewBooleanFilterCurrent, type UseDataViewBooleanFilterResult, useDataViewEnumFilter, useDataViewEnumFilterFactory, type DataViewSetEnumFilterAction, type DataViewEnumFilterCurrent, type UseDataViewEnumFilterResult, useDataViewRelationFilter, useDataViewRelationFilterFactory, type DataViewSetRelationFilterAction, type DataViewRelationFilterCurrent, type UseDataViewRelationFilterResult, useDataViewTextFilterInput, type UseDataViewTextFilterInputResult, useDataViewTextFilterMatchMode, type UseDataViewTextFilterMatchModeResult, useDataViewNumberFilterInput, type UseDataViewNumberFilterInputResult, type UseDataViewNumberFilterInputProps, useDataViewNullFilter, type DataViewSetNullFilterAction, type DataViewNullFilterState, type UseDataViewNullFilterResult, } from './filterHooks.js';
|
|
12
|
+
export { type DataViewFilterState, DataViewTextFilterInput, type DataViewTextFilterInputProps, DataViewTextFilterMatchModeTrigger, type DataViewTextFilterMatchModeTriggerProps, DataViewTextFilterMatchModeLabel, type DataViewTextFilterMatchModeLabelProps, DataViewTextFilterResetTrigger, type DataViewTextFilterResetTriggerProps, DataViewNumberFilterInput, type DataViewNumberFilterInputProps, DataViewDateFilterInput, type DataViewDateFilterInputProps, DataViewBooleanFilterTrigger, type DataViewBooleanFilterTriggerProps, DataViewEnumFilterTrigger, type DataViewEnumFilterTriggerProps, DataViewEnumFilterState, type DataViewEnumFilterStateProps, DataViewRelationFilterTrigger, type DataViewRelationFilterTriggerProps, DataViewRelationFilterState, type DataViewRelationFilterStateProps, DataViewNullFilterTrigger, type DataViewNullFilterTriggerProps, DataViewFilterResetTrigger, type DataViewFilterResetTriggerProps, DataViewDateFilterResetTrigger, type DataViewDateFilterResetTriggerProps, DataViewNumberFilterResetTrigger, type DataViewNumberFilterResetTriggerProps, } from './filterComponents.js';
|
|
13
|
+
export { DataViewSortingTrigger, type DataViewSortingTriggerProps, DataViewSortingSwitch, type DataViewSortingSwitchProps, } from './sortingComponents.js';
|
|
14
|
+
export { DataViewChangePageTrigger, type DataViewChangePageTriggerProps, DataViewSetItemsPerPageTrigger, type DataViewSetItemsPerPageTriggerProps, DataViewPagingStateView, type DataViewPagingStateViewProps, DataViewPagingInfo, type DataViewPagingInfoProps, } from './pagingComponents.js';
|
|
15
|
+
export { DataViewVisibilityTrigger, type DataViewVisibilityTriggerProps, DataViewElement, DataViewIsVisible, type DataViewElementProps, DataViewLayout, type DataViewLayoutProps, DataViewLayoutTrigger, type DataViewLayoutTriggerProps, } from './selectionComponents.js';
|
|
16
|
+
export { DataViewExportTrigger, type DataViewExportTriggerProps, CsvExportFactory, type ExportFactory, type ExportResult, type ExportFactoryArgs, useDataViewFetchAllData, type FetchAllDataResult, } from './export.js';
|
|
17
|
+
export { DataViewInfiniteLoadProvider, type DataViewInfiniteLoadProviderProps, DataViewInfiniteLoadTrigger, type DataViewInfiniteLoadTriggerProps, DataViewInfiniteLoadScrollObserver, type DataViewInfiniteLoadScrollObserverProps, useDataViewInfiniteLoadTrigger, } from './infiniteLoad.js';
|
|
18
|
+
export { DataViewReloadTrigger, type DataViewReloadTriggerProps, DataViewLoaderState, type DataViewLoaderStateProps, DataViewLoaderStateSwitch, type DataViewLoaderStateSwitchProps, useDataViewLoaderState, useDataViewReload, useDataViewHighlightIndex, DataViewEmpty, type DataViewEmptyProps, DataViewNonEmpty, type DataViewNonEmptyProps, DataViewEachRow, type DataViewEachRowProps, DataViewHighlightRow, type DataViewHighlightRowProps, DataViewKeyboardEventHandler, type DataViewKeyboardEventHandlerProps, } from './loaderComponents.js';
|
|
19
|
+
export { useDataViewSortingState, useDataViewSortingMethods, useDataViewSortingDirection, type DataViewSortingMethods, useDataViewPagingState, useDataViewPagingInfo, useDataViewPagingMethods, type DataViewPagingMethods, useDataViewFilteringState, useDataViewFilteringMethods, useDataViewFilterHandlerRegistry, type DataViewFilteringMethods, useDataViewSelectionState, useDataViewSelectionMethods, type DataViewSelectionState, type DataViewSelectionMethods, useDataViewElements, type DataViewElementData, } from './contextHooks.js';
|
|
20
|
+
export { type StateStorage, type StateStorageOrName, useStoredState, buildDataViewKey, } from './stateStorage.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
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AAuB,EACvB,KAAK,kBAAkB,GACvB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACN,4BAA4B,EAC5B,KAAK,iCAAiC,EACtC,2BAA2B,EAC3B,KAAK,gCAAgC,EACrC,kCAAkC,EAClC,KAAK,uCAAuC,EAC5C,8BAA8B,GAC9B,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACN,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,KAAK,8BAA8B,EACnC,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,eAAe,EACf,KAAK,oBAAoB,EACzB,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,4BAA4B,EAC5B,KAAK,iCAAiC,GACtC,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EACN,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,KAAK,sBAAsB,EAC3B,sBAAsB,EACtB,qBAAqB,EACrB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,gCAAgC,EAChC,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,2BAA2B,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,mBAAmB,EACnB,KAAK,mBAAmB,GACxB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,cAAc,EACd,gBAAgB,GAChB,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Infinite scroll / load-more components using Radix Slot.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <DataViewInfiniteLoadProvider>
|
|
7
|
+
* <DataViewEachRow>
|
|
8
|
+
* {(item) => <div>{item.title}</div>}
|
|
9
|
+
* </DataViewEachRow>
|
|
10
|
+
* <DataViewInfiniteLoadTrigger>
|
|
11
|
+
* <button>Load More</button>
|
|
12
|
+
* </DataViewInfiniteLoadTrigger>
|
|
13
|
+
* <DataViewInfiniteLoadScrollObserver />
|
|
14
|
+
* </DataViewInfiniteLoadProvider>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import React, { type ReactElement } from 'react';
|
|
18
|
+
export interface DataViewInfiniteLoadProviderProps {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export declare function DataViewInfiniteLoadProvider({ children, }: DataViewInfiniteLoadProviderProps): ReactElement;
|
|
22
|
+
export interface DataViewInfiniteLoadTriggerProps {
|
|
23
|
+
children: ReactElement;
|
|
24
|
+
}
|
|
25
|
+
export declare const DataViewInfiniteLoadTrigger: React.ForwardRefExoticComponent<DataViewInfiniteLoadTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
export interface DataViewInfiniteLoadScrollObserverProps {
|
|
27
|
+
/** Root margin for IntersectionObserver. Default: '200px' */
|
|
28
|
+
rootMargin?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function DataViewInfiniteLoadScrollObserver({ rootMargin, }?: DataViewInfiniteLoadScrollObserverProps): ReactElement;
|
|
31
|
+
export declare function useDataViewInfiniteLoadTrigger(): (() => void) | undefined;
|
|
32
|
+
//# sourceMappingURL=infiniteLoad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infiniteLoad.d.ts","sourceRoot":"","sources":["../../src/dataview/infiniteLoad.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAA4F,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAiC1I,MAAM,WAAW,iCAAiC;IACjD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,4BAA4B,CAAC,EAC5C,QAAQ,GACR,EAAE,iCAAiC,GAAG,YAAY,CA2DlD;AAMD,MAAM,WAAW,gCAAgC;IAChD,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,2BAA2B,4GAkBvC,CAAA;AAOD,MAAM,WAAW,uCAAuC;IACvD,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,kCAAkC,CAAC,EAClD,UAAoB,GACpB,GAAE,uCAA4C,GAAG,YAAY,CAsB7D;AAMD,wBAAgB,8BAA8B,IAAI,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAEzE"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loader state, reload trigger, and conditional rendering components using Radix Slot.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <DataViewReloadTrigger>
|
|
7
|
+
* <button>Refresh</button>
|
|
8
|
+
* </DataViewReloadTrigger>
|
|
9
|
+
*
|
|
10
|
+
* <DataViewLoaderState loaded={<Table />} refreshing={<Table />} initial={<Loading />} failed={<Error />} />
|
|
11
|
+
*
|
|
12
|
+
* <DataViewEmpty>No results found</DataViewEmpty>
|
|
13
|
+
* <DataViewNonEmpty><Table /></DataViewNonEmpty>
|
|
14
|
+
*
|
|
15
|
+
* <DataViewKeyboardEventHandler>
|
|
16
|
+
* <div tabIndex={0}>...</div>
|
|
17
|
+
* </DataViewKeyboardEventHandler>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
import React, { type ReactElement } from 'react';
|
|
21
|
+
import type { DataViewLoaderState as DataViewLoaderStateType } from './DataViewContext.js';
|
|
22
|
+
export interface DataViewReloadTriggerProps {
|
|
23
|
+
children: ReactElement;
|
|
24
|
+
}
|
|
25
|
+
export declare const DataViewReloadTrigger: React.ForwardRefExoticComponent<DataViewReloadTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
export interface DataViewLoaderStateProps {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
/** Render children when data is loaded */
|
|
29
|
+
loaded?: boolean;
|
|
30
|
+
/** Render children when refreshing (after initial load) */
|
|
31
|
+
refreshing?: boolean;
|
|
32
|
+
/** Render children during initial load */
|
|
33
|
+
initial?: boolean;
|
|
34
|
+
/** Render children on failure */
|
|
35
|
+
failed?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function DataViewLoaderState({ children, ...props }: DataViewLoaderStateProps): ReactElement | null;
|
|
38
|
+
export interface DataViewLoaderStateSwitchProps {
|
|
39
|
+
/** Render when data is loaded */
|
|
40
|
+
loaded?: React.ReactNode;
|
|
41
|
+
/** Render when refreshing (after initial load) */
|
|
42
|
+
refreshing?: React.ReactNode;
|
|
43
|
+
/** Render during initial load */
|
|
44
|
+
initial?: React.ReactNode;
|
|
45
|
+
/** Render on failure */
|
|
46
|
+
failed?: React.ReactNode;
|
|
47
|
+
}
|
|
48
|
+
export declare function DataViewLoaderStateSwitch({ loaded, refreshing, initial, failed, }: DataViewLoaderStateSwitchProps): ReactElement;
|
|
49
|
+
export declare function useDataViewLoaderState(): DataViewLoaderStateType;
|
|
50
|
+
export declare function useDataViewReload(): () => void;
|
|
51
|
+
export declare function useDataViewHighlightIndex(): number | null;
|
|
52
|
+
export interface DataViewEmptyProps {
|
|
53
|
+
children: React.ReactNode;
|
|
54
|
+
}
|
|
55
|
+
export declare function DataViewEmpty({ children }: DataViewEmptyProps): ReactElement;
|
|
56
|
+
export interface DataViewNonEmptyProps {
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
}
|
|
59
|
+
export declare function DataViewNonEmpty({ children }: DataViewNonEmptyProps): ReactElement;
|
|
60
|
+
export interface DataViewEachRowProps {
|
|
61
|
+
children: (item: {
|
|
62
|
+
id: string;
|
|
63
|
+
data: Record<string, unknown>;
|
|
64
|
+
}, index: number) => React.ReactNode;
|
|
65
|
+
}
|
|
66
|
+
export declare function DataViewEachRow({ children }: DataViewEachRowProps): ReactElement;
|
|
67
|
+
export interface DataViewHighlightRowProps {
|
|
68
|
+
index: number;
|
|
69
|
+
children: ReactElement;
|
|
70
|
+
}
|
|
71
|
+
export declare const DataViewHighlightRow: React.ForwardRefExoticComponent<DataViewHighlightRowProps & React.RefAttributes<HTMLElement>>;
|
|
72
|
+
export interface DataViewKeyboardEventHandlerProps {
|
|
73
|
+
children: ReactElement;
|
|
74
|
+
onSelectHighlighted?: (item: {
|
|
75
|
+
id: string;
|
|
76
|
+
data: Record<string, unknown>;
|
|
77
|
+
}) => void;
|
|
78
|
+
}
|
|
79
|
+
export declare const DataViewKeyboardEventHandler: React.ForwardRefExoticComponent<DataViewKeyboardEventHandlerProps & React.RefAttributes<HTMLElement>>;
|
|
80
|
+
//# sourceMappingURL=loaderComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loaderComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/loaderComponents.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,YAAY,EAAe,MAAM,OAAO,CAAA;AAIzE,OAAO,KAAK,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAM1F,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,qBAAqB,sGAcjC,CAAA;AAUD,MAAM,WAAW,wBAAwB;IACxC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,iCAAiC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,wBAAgB,mBAAmB,CAAC,EACnC,QA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WAAW,yBAAyB;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,oBAAoB,+FAoBhC,CAAA;AAOD,MAAM,WAAW,iCAAiC;IACjD,QAAQ,EAAE,YAAY,CAAA;IACtB,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KAAK,IAAI,CAAA;CACnF;AAED,eAAO,MAAM,4BAA4B,uGA+BxC,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composable paging UI components using Radix Slot pattern.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <DataViewChangePageTrigger page="previous">
|
|
7
|
+
* <button>Previous</button>
|
|
8
|
+
* </DataViewChangePageTrigger>
|
|
9
|
+
*
|
|
10
|
+
* <DataViewChangePageTrigger page="next">
|
|
11
|
+
* <button>Next</button>
|
|
12
|
+
* </DataViewChangePageTrigger>
|
|
13
|
+
*
|
|
14
|
+
* <DataViewSetItemsPerPageTrigger value={25}>
|
|
15
|
+
* <button>25 per page</button>
|
|
16
|
+
* </DataViewSetItemsPerPageTrigger>
|
|
17
|
+
*
|
|
18
|
+
* <DataViewPagingStateView>
|
|
19
|
+
* {({ pageIndex, totalPages }) => <span>Page {pageIndex + 1} of {totalPages}</span>}
|
|
20
|
+
* </DataViewPagingStateView>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import React, { type ReactElement, type ReactNode } from 'react';
|
|
24
|
+
export interface DataViewChangePageTriggerProps {
|
|
25
|
+
/** Target page: named shortcut or zero-based page index */
|
|
26
|
+
page: 'first' | 'last' | 'next' | 'previous' | number;
|
|
27
|
+
/** Button element */
|
|
28
|
+
children: ReactElement;
|
|
29
|
+
}
|
|
30
|
+
export declare const DataViewChangePageTrigger: React.ForwardRefExoticComponent<DataViewChangePageTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
export interface DataViewSetItemsPerPageTriggerProps {
|
|
32
|
+
/** Items per page to set. null = show all. */
|
|
33
|
+
value: number | null;
|
|
34
|
+
/** Button element */
|
|
35
|
+
children: ReactElement;
|
|
36
|
+
}
|
|
37
|
+
export declare const DataViewSetItemsPerPageTrigger: React.ForwardRefExoticComponent<DataViewSetItemsPerPageTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
38
|
+
export interface DataViewPagingInfoProps {
|
|
39
|
+
children: (info: {
|
|
40
|
+
pageIndex: number;
|
|
41
|
+
totalPages: number | null;
|
|
42
|
+
totalCount: number | null;
|
|
43
|
+
itemsPerPage: number;
|
|
44
|
+
}) => ReactNode;
|
|
45
|
+
}
|
|
46
|
+
export declare function DataViewPagingStateView({ children, }: DataViewPagingInfoProps): ReactElement;
|
|
47
|
+
/** Alias for DataViewPagingStateView */
|
|
48
|
+
export declare const DataViewPagingInfo: typeof DataViewPagingStateView;
|
|
49
|
+
export type DataViewPagingStateViewProps = DataViewPagingInfoProps;
|
|
50
|
+
//# sourceMappingURL=pagingComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagingComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/pagingComponents.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,YAAY,EAAE,KAAK,SAAS,EAAe,MAAM,OAAO,CAAA;AAUzF,MAAM,WAAW,8BAA8B;IAC9C,2DAA2D;IAC3D,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAA;IACrD,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,yBAAyB,0GA4BrC,CAAA;AAoBD,MAAM,WAAW,mCAAmC;IACnD,8CAA8C;IAC9C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,8BAA8B,+GAqB1C,CAAA;AAOD,MAAM,WAAW,uBAAuB;IACvC,QAAQ,EAAE,CAAC,IAAI,EAAE;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;QACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;QACzB,YAAY,EAAE,MAAM,CAAA;KACpB,KAAK,SAAS,CAAA;CACf;AAED,wBAAgB,uBAAuB,CAAC,EACvC,QAAQ,GACR,EAAE,uBAAuB,GAAG,YAAY,CASxC;AAED,wCAAwC;AACxC,eAAO,MAAM,kBAAkB,gCAA0B,CAAA;AAEzD,MAAM,MAAM,4BAA4B,GAAG,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility for rendering cell values from column metadata and entity accessor.
|
|
3
|
+
* Extracted from DataGrid to be usable by any table rendering component.
|
|
4
|
+
*/
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { ColumnMeta } from './columns.js';
|
|
7
|
+
import type { EntityAccessor } from '../jsx/types.js';
|
|
8
|
+
export declare function renderCellValue(col: ColumnMeta, accessor: EntityAccessor<unknown>): React.ReactNode;
|
|
9
|
+
//# sourceMappingURL=renderCellValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderCellValue.d.ts","sourceRoot":"","sources":["../../src/dataview/renderCellValue.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,wBAAgB,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,SAAS,CAqEnG"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selection components — column visibility + layout switching using Radix Slot.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <DataViewVisibilityTrigger name="description">
|
|
7
|
+
* <button>Toggle Description</button>
|
|
8
|
+
* </DataViewVisibilityTrigger>
|
|
9
|
+
*
|
|
10
|
+
* <DataViewElement name="description">
|
|
11
|
+
* <DescriptionColumn />
|
|
12
|
+
* </DataViewElement>
|
|
13
|
+
*
|
|
14
|
+
* <DataViewLayout name="table">
|
|
15
|
+
* <TableView />
|
|
16
|
+
* </DataViewLayout>
|
|
17
|
+
*
|
|
18
|
+
* <DataViewLayoutTrigger name="table">
|
|
19
|
+
* <button>Table View</button>
|
|
20
|
+
* </DataViewLayoutTrigger>
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
import React, { type ReactElement } from 'react';
|
|
24
|
+
export interface DataViewVisibilityTriggerProps {
|
|
25
|
+
/** Element name to toggle */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Value to set. Can be boolean or function. Default: toggle */
|
|
28
|
+
value?: boolean | ((current: boolean) => boolean);
|
|
29
|
+
/** Fallback visibility when not explicitly set. Default: true */
|
|
30
|
+
fallbackValue?: boolean;
|
|
31
|
+
/** Button element */
|
|
32
|
+
children: ReactElement;
|
|
33
|
+
}
|
|
34
|
+
export declare const DataViewVisibilityTrigger: React.ForwardRefExoticComponent<DataViewVisibilityTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
35
|
+
export interface DataViewElementProps {
|
|
36
|
+
/** Element name (used for visibility toggle) */
|
|
37
|
+
name: string;
|
|
38
|
+
/** Label for the element (for UI display) */
|
|
39
|
+
label?: React.ReactNode;
|
|
40
|
+
/** Default visibility when not explicitly set. Default: true */
|
|
41
|
+
fallback?: boolean;
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export declare function DataViewElement({ name, fallback, children, }: DataViewElementProps): ReactElement | null;
|
|
45
|
+
/** @deprecated Use DataViewElement instead */
|
|
46
|
+
export declare const DataViewIsVisible: typeof DataViewElement;
|
|
47
|
+
export interface DataViewLayoutProps {
|
|
48
|
+
/** Layout name */
|
|
49
|
+
name: string;
|
|
50
|
+
/** Label for the layout */
|
|
51
|
+
label?: React.ReactNode;
|
|
52
|
+
children: React.ReactNode;
|
|
53
|
+
}
|
|
54
|
+
export declare function DataViewLayout({ name, children, }: DataViewLayoutProps): ReactElement | null;
|
|
55
|
+
export interface DataViewLayoutTriggerProps {
|
|
56
|
+
/** Layout name to switch to */
|
|
57
|
+
name: string;
|
|
58
|
+
/** Button element */
|
|
59
|
+
children: ReactElement;
|
|
60
|
+
}
|
|
61
|
+
export declare const DataViewLayoutTrigger: React.ForwardRefExoticComponent<DataViewLayoutTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
62
|
+
//# sourceMappingURL=selectionComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectionComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/selectionComponents.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,YAAY,EAAe,MAAM,OAAO,CAAA;AAUzE,MAAM,WAAW,8BAA8B;IAC9C,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,gEAAgE;IAChE,KAAK,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,CAAA;IACjD,iEAAiE;IACjE,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,yBAAyB,0GA2BrC,CAAA;AAOD,MAAM,WAAW,oBAAoB;IACpC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,eAAe,CAAC,EAC/B,IAAI,EACJ,QAAe,EACf,QAAQ,GACR,EAAE,oBAAoB,GAAG,YAAY,GAAG,IAAI,CAM5C;AAED,8CAA8C;AAC9C,eAAO,MAAM,iBAAiB,wBAAkB,CAAA;AAMhD,MAAM,WAAW,mBAAmB;IACnC,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,2BAA2B;IAC3B,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACzB;AAED,wBAAgB,cAAc,CAAC,EAC9B,IAAI,EACJ,QAAQ,GACR,EAAE,mBAAmB,GAAG,YAAY,GAAG,IAAI,CAQ3C;AAED,MAAM,WAAW,0BAA0B;IAC1C,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,qBAAqB;IACrB,QAAQ,EAAE,YAAY,CAAA;CACtB;AAED,eAAO,MAAM,qBAAqB,sGAuBjC,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composable sorting UI components using Radix Slot pattern.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* ```tsx
|
|
6
|
+
* <DataViewSortingTrigger field="title">
|
|
7
|
+
* <button>Sort by Title</button>
|
|
8
|
+
* </DataViewSortingTrigger>
|
|
9
|
+
*
|
|
10
|
+
* <DataViewSortingSwitch field="title"
|
|
11
|
+
* asc={<span>↑</span>}
|
|
12
|
+
* desc={<span>↓</span>}
|
|
13
|
+
* none={<span>↕</span>}
|
|
14
|
+
* />
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
import React, { type ReactElement } from 'react';
|
|
18
|
+
import type { SortingDirectionAction } from '@contember/bindx';
|
|
19
|
+
export interface DataViewSortingTriggerProps {
|
|
20
|
+
/** Field name to sort by */
|
|
21
|
+
field: string;
|
|
22
|
+
/** Sorting action. Default: 'next' (cycles asc → desc → none) */
|
|
23
|
+
action?: SortingDirectionAction;
|
|
24
|
+
/** Button element to render */
|
|
25
|
+
children: ReactElement;
|
|
26
|
+
}
|
|
27
|
+
export declare const DataViewSortingTrigger: React.ForwardRefExoticComponent<DataViewSortingTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
export interface DataViewSortingSwitchProps {
|
|
29
|
+
/** Field name */
|
|
30
|
+
field: string;
|
|
31
|
+
/** Render when sorted ascending */
|
|
32
|
+
asc?: React.ReactNode;
|
|
33
|
+
/** Render when sorted descending */
|
|
34
|
+
desc?: React.ReactNode;
|
|
35
|
+
/** Render when not sorted */
|
|
36
|
+
none?: React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
export declare function DataViewSortingSwitch({ field, asc, desc, none, }: DataViewSortingSwitchProps): ReactElement;
|
|
39
|
+
//# sourceMappingURL=sortingComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sortingComponents.d.ts","sourceRoot":"","sources":["../../src/dataview/sortingComponents.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,EAAc,KAAK,YAAY,EAAe,MAAM,OAAO,CAAA;AAKzE,OAAO,KAAK,EAAE,sBAAsB,EAAkB,MAAM,kBAAkB,CAAA;AAM9E,MAAM,WAAW,2BAA2B;IAC3C,4BAA4B;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,iEAAiE;IACjE,MAAM,CAAC,EAAE,sBAAsB,CAAA;IAC/B,+BAA+B;IAC/B,QAAQ,EAAE,YAAY,CAAA;CACtB;AASD,eAAO,MAAM,sBAAsB,uGA6BlC,CAAA;AAOD,MAAM,WAAW,0BAA0B;IAC1C,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,mCAAmC;IACnC,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACrB,oCAAoC;IACpC,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CACtB;AAED,wBAAgB,qBAAqB,CAAC,EACrC,KAAK,EACL,GAAG,EACH,IAAI,EACJ,IAAI,GACJ,EAAE,0BAA0B,GAAG,YAAY,CAO3C"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State storage abstraction for DataView state persistence.
|
|
3
|
+
*
|
|
4
|
+
* Supports URL params, sessionStorage, localStorage, or custom backends.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const [value, setValue] = useStoredState('url', ['myGrid', 'sorting'], initialValue)
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export interface StateStorage {
|
|
12
|
+
get<T>(key: string): T | undefined;
|
|
13
|
+
set<T>(key: string, value: T): void;
|
|
14
|
+
remove(key: string): void;
|
|
15
|
+
}
|
|
16
|
+
export type StateStorageOrName = 'url' | 'session' | 'local' | 'null' | StateStorage;
|
|
17
|
+
export declare function useStoredState<T>(storageOrName: StateStorageOrName, key: readonly string[], initializer: (storedValue: T | undefined) => T): [T, (value: T) => void];
|
|
18
|
+
export declare function buildDataViewKey(parts: readonly string[]): string;
|
|
19
|
+
//# sourceMappingURL=stateStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stateStorage.d.ts","sourceRoot":"","sources":["../../src/dataview/stateStorage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAQH,MAAM,WAAW,YAAY;IAC5B,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAA;IAClC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IACnC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAA;AAuGpF,wBAAgB,cAAc,CAAC,CAAC,EAC/B,aAAa,EAAE,kBAAkB,EACjC,GAAG,EAAE,SAAS,MAAM,EAAE,EACtB,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC,GAAG,SAAS,KAAK,CAAC,GAC5C,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,CAezB;AAMD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAEjE"}
|