@sectile/vue 0.6.0 → 0.8.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/README.md +4 -2
- package/dist/accordion.d.ts +0 -1
- package/dist/alert-dialog.d.ts +0 -2
- package/dist/alert-dialog.js.map +1 -1
- package/dist/calendar.d.ts +14 -268
- package/dist/calendar.js +15 -15
- package/dist/calendar.js.map +1 -1
- package/dist/carousel.d.ts +22 -1
- package/dist/carousel.js +7 -1
- package/dist/carousel.js.map +1 -1
- package/dist/cascade-list.d.ts +339 -0
- package/dist/cascade-list.js +240 -0
- package/dist/cascade-list.js.map +1 -0
- package/dist/cascade-select.d.ts +11 -42
- package/dist/cascade-select.js +19 -27
- package/dist/cascade-select.js.map +1 -1
- package/dist/checkbox-group.d.ts +9 -1
- package/dist/checkbox-group.js +57 -13
- package/dist/checkbox-group.js.map +1 -1
- package/dist/checkbox.d.ts +0 -1
- package/dist/checkbox.js +15 -8
- package/dist/checkbox.js.map +1 -1
- package/dist/color-picker.d.ts +0 -1
- package/dist/combobox.d.ts +0 -1
- package/dist/combobox.js +46 -6
- package/dist/combobox.js.map +1 -1
- package/dist/data-grid.d.ts +214 -0
- package/dist/data-grid.js +107 -0
- package/dist/data-grid.js.map +1 -0
- package/dist/data-table.d.ts +232 -0
- package/dist/data-table.js +116 -0
- package/dist/data-table.js.map +1 -0
- package/dist/data-tree-grid.d.ts +225 -0
- package/dist/data-tree-grid.js +98 -0
- package/dist/data-tree-grid.js.map +1 -0
- package/dist/date-field.d.ts +2 -3
- package/dist/date-field.js +1 -1
- package/dist/date-field.js.map +1 -1
- package/dist/date-picker.d.ts +35 -427
- package/dist/date-picker.js +15 -13
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-field.d.ts +2 -3
- package/dist/date-range-field.js +24 -6
- package/dist/date-range-field.js.map +1 -1
- package/dist/date-range-picker.d.ts +35 -427
- package/dist/date-range-picker.js +15 -13
- package/dist/date-range-picker.js.map +1 -1
- package/dist/date-time-field.d.ts +2 -3
- package/dist/date-time-field.js +1 -1
- package/dist/date-time-field.js.map +1 -1
- package/dist/date-time-picker.d.ts +36 -428
- package/dist/date-time-picker.js +15 -13
- package/dist/date-time-picker.js.map +1 -1
- package/dist/date-time-range-picker.d.ts +36 -428
- package/dist/date-time-range-picker.js +15 -13
- package/dist/date-time-range-picker.js.map +1 -1
- package/dist/dialog.d.ts +0 -2
- package/dist/dialog.js.map +1 -1
- package/dist/disclosure.d.ts +0 -1
- package/dist/drawer.d.ts +1 -2
- package/dist/editable.d.ts +0 -1
- package/dist/editable.js +25 -6
- package/dist/editable.js.map +1 -1
- package/dist/feed.d.ts +0 -1
- package/dist/form.d.ts +88 -115
- package/dist/form.js +461 -233
- package/dist/form.js.map +1 -1
- package/dist/grid.d.ts +0 -1
- package/dist/grid.js +51 -6
- package/dist/grid.js.map +1 -1
- package/dist/host-provider.d.ts +0 -13
- package/dist/host-provider.js +0 -16
- package/dist/host-provider.js.map +1 -1
- package/dist/index.d.ts +14 -39
- package/dist/index.js +6 -19
- package/dist/index.js.map +1 -1
- package/dist/internal/cascade-choice.d.ts +204 -0
- package/dist/internal/cascade-choice.js +161 -0
- package/dist/internal/cascade-choice.js.map +1 -0
- package/dist/internal/collection.d.ts +3 -8
- package/dist/internal/collection.js +14 -20
- package/dist/internal/collection.js.map +1 -1
- package/dist/internal/controlled-state.d.ts +0 -1
- package/dist/internal/date-picker.d.ts +91 -141
- package/dist/internal/date-picker.js +146 -52
- package/dist/internal/date-picker.js.map +1 -1
- package/dist/internal/decimal-input.d.ts +1 -0
- package/dist/internal/decimal-input.js +24 -0
- package/dist/internal/decimal-input.js.map +1 -0
- package/dist/internal/form-control-inventory.d.ts +4 -1
- package/dist/internal/form-control-inventory.js +1 -0
- package/dist/internal/form-control-inventory.js.map +1 -1
- package/dist/internal/form-control.d.ts +100 -2
- package/dist/internal/form-control.js +103 -1
- package/dist/internal/form-control.js.map +1 -1
- package/dist/internal/native-field.d.ts +7 -8
- package/dist/internal/native-field.js +11 -2
- package/dist/internal/native-field.js.map +1 -1
- package/dist/internal/native-input.d.ts +0 -1
- package/dist/internal/part-contract.d.ts +0 -1
- package/dist/internal/popup.d.ts +5 -27
- package/dist/internal/popup.js +14 -20
- package/dist/internal/popup.js.map +1 -1
- package/dist/internal/presence.d.ts +0 -1
- package/dist/internal/scheduled-task.d.ts +5 -0
- package/dist/internal/scheduled-task.js +28 -0
- package/dist/internal/scheduled-task.js.map +1 -0
- package/dist/internal/tabs-context.d.ts +2 -3
- package/dist/internal/tabular-components.d.ts +27 -0
- package/dist/internal/tabular-components.js +26 -0
- package/dist/internal/tabular-components.js.map +1 -0
- package/dist/internal/tabular-parts.d.ts +57 -0
- package/dist/internal/tabular-parts.js +239 -0
- package/dist/internal/tabular-parts.js.map +1 -0
- package/dist/internal/tabular-profile.d.ts +75 -0
- package/dist/internal/tabular-profile.js +209 -0
- package/dist/internal/tabular-profile.js.map +1 -0
- package/dist/internal/virtual-collection-model.d.ts +42 -0
- package/dist/internal/virtual-collection-model.js +241 -0
- package/dist/internal/virtual-collection-model.js.map +1 -0
- package/dist/internal/virtual-collection.d.ts +38 -0
- package/dist/internal/virtual-collection.js +87 -0
- package/dist/internal/virtual-collection.js.map +1 -0
- package/dist/{virtual.d.ts → internal/virtual-core.d.ts} +14 -9
- package/dist/{virtual.js → internal/virtual-core.js} +18 -13
- package/dist/internal/virtual-core.js.map +1 -0
- package/dist/internal/virtual-list.d.ts +214 -0
- package/dist/internal/virtual-list.js +401 -0
- package/dist/internal/virtual-list.js.map +1 -0
- package/dist/listbox.d.ts +0 -1
- package/dist/listbox.js +52 -6
- package/dist/listbox.js.map +1 -1
- package/dist/menu-button.d.ts +0 -1
- package/dist/menu.d.ts +262 -317
- package/dist/menu.js +29 -23
- package/dist/menu.js.map +1 -1
- package/dist/menubar.d.ts +0 -1
- package/dist/meter-group.d.ts +369 -0
- package/dist/meter-group.js +271 -0
- package/dist/meter-group.js.map +1 -0
- package/dist/meter.d.ts +191 -0
- package/dist/meter.js +133 -0
- package/dist/meter.js.map +1 -0
- package/dist/month-picker.d.ts +29 -259
- package/dist/month-picker.js +8 -6
- package/dist/month-picker.js.map +1 -1
- package/dist/month-range-picker.d.ts +29 -259
- package/dist/month-range-picker.js +8 -6
- package/dist/month-range-picker.js.map +1 -1
- package/dist/multi-thumb-slider.d.ts +0 -1
- package/dist/navigation-menu.d.ts +0 -1
- package/dist/number-field.d.ts +2 -2
- package/dist/number-field.js +1 -1
- package/dist/number-field.js.map +1 -1
- package/dist/pagination.d.ts +23 -2
- package/dist/pagination.js +6 -1
- package/dist/pagination.js.map +1 -1
- package/dist/pin-input.d.ts +0 -1
- package/dist/pin-input.js +1 -1
- package/dist/pin-input.js.map +1 -1
- package/dist/popover.d.ts +0 -2
- package/dist/popover.js.map +1 -1
- package/dist/primitive.d.ts +0 -1
- package/dist/primitive.js +8 -4
- package/dist/primitive.js.map +1 -1
- package/dist/progress.d.ts +148 -0
- package/dist/progress.js +110 -0
- package/dist/progress.js.map +1 -0
- package/dist/quantity-field.d.ts +0 -1
- package/dist/radio-group.d.ts +0 -1
- package/dist/radio-group.js +1 -1
- package/dist/radio-group.js.map +1 -1
- package/dist/range-calendar.d.ts +14 -298
- package/dist/range-calendar.js +7 -7
- package/dist/range-calendar.js.map +1 -1
- package/dist/rating.d.ts +0 -1
- package/dist/rating.js +10 -1
- package/dist/rating.js.map +1 -1
- package/dist/reorder.d.ts +1 -2
- package/dist/select.d.ts +24 -50
- package/dist/select.js +11 -13
- package/dist/select.js.map +1 -1
- package/dist/slider.d.ts +0 -1
- package/dist/spin-button.d.ts +9 -7
- package/dist/spin-button.js +17 -4
- package/dist/spin-button.js.map +1 -1
- package/dist/stepper.d.ts +0 -1
- package/dist/stepper.js +19 -2
- package/dist/stepper.js.map +1 -1
- package/dist/switch.d.ts +0 -1
- package/dist/tabs.d.ts +0 -1
- package/dist/tabs.js +4 -22
- package/dist/tabs.js.map +1 -1
- package/dist/tags-input.d.ts +0 -1
- package/dist/tags-input.js +18 -5
- package/dist/tags-input.js.map +1 -1
- package/dist/temporal-provider.d.ts +21 -0
- package/dist/temporal-provider.js +30 -0
- package/dist/temporal-provider.js.map +1 -0
- package/dist/text.d.ts +0 -1
- package/dist/text.js +18 -4
- package/dist/text.js.map +1 -1
- package/dist/time-field.d.ts +2 -3
- package/dist/time-field.js +1 -1
- package/dist/time-field.js.map +1 -1
- package/dist/time-range-field.d.ts +2 -2
- package/dist/time-range-field.js +6 -4
- package/dist/time-range-field.js.map +1 -1
- package/dist/timer.d.ts +0 -1
- package/dist/toast.d.ts +11 -2
- package/dist/toast.js +22 -9
- package/dist/toast.js.map +1 -1
- package/dist/toggle-button.d.ts +0 -1
- package/dist/toggle-group.d.ts +0 -1
- package/dist/toggle-group.js +1 -1
- package/dist/toggle-group.js.map +1 -1
- package/dist/toolbar.d.ts +0 -1
- package/dist/tooltip.d.ts +1 -3
- package/dist/tooltip.js.map +1 -1
- package/dist/tree-grid.d.ts +0 -1
- package/dist/tree-grid.js +62 -8
- package/dist/tree-grid.js.map +1 -1
- package/dist/tree-view.d.ts +0 -1
- package/dist/tree-view.js +51 -10
- package/dist/tree-view.js.map +1 -1
- package/dist/virtual-core.d.ts +1 -0
- package/dist/virtual-core.js +2 -0
- package/dist/virtual-core.js.map +1 -0
- package/dist/virtual-grid.d.ts +188 -0
- package/dist/virtual-grid.js +306 -0
- package/dist/virtual-grid.js.map +1 -0
- package/dist/virtual-list.d.ts +1 -0
- package/dist/virtual-list.js +2 -0
- package/dist/virtual-list.js.map +1 -0
- package/dist/virtual-masonry.d.ts +198 -0
- package/dist/virtual-masonry.js +221 -0
- package/dist/virtual-masonry.js.map +1 -0
- package/dist/virtual-spatial.d.ts +157 -0
- package/dist/virtual-spatial.js +159 -0
- package/dist/virtual-spatial.js.map +1 -0
- package/dist/window-splitter.d.ts +0 -1
- package/dist/year-picker.d.ts +29 -259
- package/dist/year-picker.js +8 -6
- package/dist/year-picker.js.map +1 -1
- package/dist/year-range-picker.d.ts +29 -259
- package/dist/year-range-picker.js +8 -6
- package/dist/year-range-picker.js.map +1 -1
- package/package.json +174 -87
- package/dist/accordion.d.ts.map +0 -1
- package/dist/alert-dialog.d.ts.map +0 -1
- package/dist/calendar.d.ts.map +0 -1
- package/dist/carousel.d.ts.map +0 -1
- package/dist/cascade-select.d.ts.map +0 -1
- package/dist/checkbox-group.d.ts.map +0 -1
- package/dist/checkbox.d.ts.map +0 -1
- package/dist/color-picker.d.ts.map +0 -1
- package/dist/combobox.d.ts.map +0 -1
- package/dist/date-field.d.ts.map +0 -1
- package/dist/date-picker.d.ts.map +0 -1
- package/dist/date-range-field.d.ts.map +0 -1
- package/dist/date-range-picker.d.ts.map +0 -1
- package/dist/date-time-field.d.ts.map +0 -1
- package/dist/date-time-picker.d.ts.map +0 -1
- package/dist/date-time-range-picker.d.ts.map +0 -1
- package/dist/dialog.d.ts.map +0 -1
- package/dist/disclosure.d.ts.map +0 -1
- package/dist/drawer.d.ts.map +0 -1
- package/dist/editable.d.ts.map +0 -1
- package/dist/feed.d.ts.map +0 -1
- package/dist/form.d.ts.map +0 -1
- package/dist/grid.d.ts.map +0 -1
- package/dist/host-provider.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/internal/collection.d.ts.map +0 -1
- package/dist/internal/controlled-state.d.ts.map +0 -1
- package/dist/internal/date-picker.d.ts.map +0 -1
- package/dist/internal/form-control-inventory.d.ts.map +0 -1
- package/dist/internal/form-control.d.ts.map +0 -1
- package/dist/internal/native-field.d.ts.map +0 -1
- package/dist/internal/native-input.d.ts.map +0 -1
- package/dist/internal/part-contract.d.ts.map +0 -1
- package/dist/internal/popup.d.ts.map +0 -1
- package/dist/internal/presence.d.ts.map +0 -1
- package/dist/internal/tabs-context.d.ts.map +0 -1
- package/dist/listbox.d.ts.map +0 -1
- package/dist/menu-button.d.ts.map +0 -1
- package/dist/menu.d.ts.map +0 -1
- package/dist/menubar.d.ts.map +0 -1
- package/dist/month-picker.d.ts.map +0 -1
- package/dist/month-range-picker.d.ts.map +0 -1
- package/dist/multi-thumb-slider.d.ts.map +0 -1
- package/dist/navigation-menu.d.ts.map +0 -1
- package/dist/number-field.d.ts.map +0 -1
- package/dist/pagination.d.ts.map +0 -1
- package/dist/pin-input.d.ts.map +0 -1
- package/dist/popover.d.ts.map +0 -1
- package/dist/primitive.d.ts.map +0 -1
- package/dist/quantity-field.d.ts.map +0 -1
- package/dist/radio-group.d.ts.map +0 -1
- package/dist/range-calendar.d.ts.map +0 -1
- package/dist/rating.d.ts.map +0 -1
- package/dist/reorder.d.ts.map +0 -1
- package/dist/select.d.ts.map +0 -1
- package/dist/slider.d.ts.map +0 -1
- package/dist/spin-button.d.ts.map +0 -1
- package/dist/stepper.d.ts.map +0 -1
- package/dist/switch.d.ts.map +0 -1
- package/dist/tabs.d.ts.map +0 -1
- package/dist/tags-input.d.ts.map +0 -1
- package/dist/text.d.ts.map +0 -1
- package/dist/time-field.d.ts.map +0 -1
- package/dist/time-range-field.d.ts.map +0 -1
- package/dist/timer.d.ts.map +0 -1
- package/dist/toast.d.ts.map +0 -1
- package/dist/toggle-button.d.ts.map +0 -1
- package/dist/toggle-group.d.ts.map +0 -1
- package/dist/toolbar.d.ts.map +0 -1
- package/dist/tooltip.d.ts.map +0 -1
- package/dist/tree-grid.d.ts.map +0 -1
- package/dist/tree-view.d.ts.map +0 -1
- package/dist/virtual.d.ts.map +0 -1
- package/dist/virtual.js.map +0 -1
- package/dist/window-splitter.d.ts.map +0 -1
- package/dist/year-picker.d.ts.map +0 -1
- package/dist/year-range-picker.d.ts.map +0 -1
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import { type DataTableColumnSizeState as DOMDataTableColumnSizeState, type DataTableDOMCommand as DOMDataTableCommand } from '@sectile/dom/tabular';
|
|
3
|
+
import { type DataTableCommand as SemanticDataTableCommand, type DataTableController as SemanticDataTableController, type DataTableEvent, type DataTableProjection, type DataTableUpdate } from '@sectile/tabular/data-table';
|
|
4
|
+
import type { TabularAcceptedViewState, TabularAccessState, TabularCellRecord, TabularColumnDefinition, TabularColumnState, TabularError, TabularGroupID, TabularHeaderNode, TabularHeaderNodeID, TabularLimits, TabularQuery, TabularRequest, TabularRequestState, TabularResult, TabularRow, TabularRowID, TabularRowSelection, TabularSnapshot, TabularView, TabularViewResponse, TabularWireCells, TabularWireValue } from '@sectile/tabular';
|
|
5
|
+
import type { PrimitiveAs } from './primitive.js';
|
|
6
|
+
import { type HostConnection } from './internal/tabular-parts.js';
|
|
7
|
+
import { type TabularBodyComponent, type TabularComponent } from './internal/tabular-components.js';
|
|
8
|
+
import { type ProfileContext, type SourceReturn, type SourceStatus, type VueProfileController } from './internal/tabular-profile.js';
|
|
9
|
+
export interface DataTableColumn<RecordValue = unknown, ID extends string = string, CellValue extends TabularWireValue = TabularWireValue> extends TabularColumnDefinition {
|
|
10
|
+
readonly id: ID;
|
|
11
|
+
readonly getValue?: (record: RecordValue) => CellValue;
|
|
12
|
+
readonly groupValue?: (record: RecordValue) => TabularWireValue;
|
|
13
|
+
readonly aggregate?: (values: readonly CellValue[]) => TabularWireValue;
|
|
14
|
+
}
|
|
15
|
+
export type DataTableCellsFromColumns<Columns extends readonly DataTableColumn<never>[]> = Readonly<{
|
|
16
|
+
[Column in Columns[number] as Column['id']]: Column extends {
|
|
17
|
+
readonly getValue: (record: never) => infer Value;
|
|
18
|
+
} ? Extract<Value, TabularWireValue> : TabularWireValue;
|
|
19
|
+
}>;
|
|
20
|
+
export type DataTableColumnID<LeafCells extends object, GroupCells extends object = LeafCells> = Extract<keyof LeafCells | keyof GroupCells, string>;
|
|
21
|
+
export type DataTableCellValue<Cells extends object, Column extends string> = Column extends keyof Cells ? TabularWireCells<Cells>[Column] : TabularWireValue;
|
|
22
|
+
export type DataTableReactiveInput<T> = T | Ref<T> | (() => T);
|
|
23
|
+
export interface DataTableWritableRef<T> {
|
|
24
|
+
value: T;
|
|
25
|
+
}
|
|
26
|
+
export type DataTableQuery = TabularQuery;
|
|
27
|
+
export type DataTableViewRow<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = TabularRow<LeafCells, GroupCells>;
|
|
28
|
+
export type DataTableView<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = TabularView<DataTableViewRow<LeafCells, GroupCells>>;
|
|
29
|
+
export type DataTableViewResponse<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = TabularViewResponse<DataTableViewRow<LeafCells, GroupCells>>;
|
|
30
|
+
export type DataTableRowSelection = TabularRowSelection;
|
|
31
|
+
export type DataTableGroupID = TabularGroupID;
|
|
32
|
+
export type DataTableRowID = TabularRowID;
|
|
33
|
+
export type DataTableColumnState = TabularColumnState;
|
|
34
|
+
export type DataTableAccessState = TabularAccessState;
|
|
35
|
+
export type DataTableRequestState = TabularRequestState;
|
|
36
|
+
export type DataTableAcceptedViewState<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = TabularAcceptedViewState<DataTableViewRow<LeafCells, GroupCells>>;
|
|
37
|
+
export type DataTableColumnSizeState = DOMDataTableColumnSizeState;
|
|
38
|
+
export type DataTableSourceStatus = SourceStatus;
|
|
39
|
+
export type DataTableSemanticCommand = SemanticDataTableCommand;
|
|
40
|
+
export type DataTableCommand = DOMDataTableCommand;
|
|
41
|
+
export type DataTableError = TabularError;
|
|
42
|
+
export type DataTableCommandHandler = (command: DataTableCommand) => void;
|
|
43
|
+
export type DataTableErrorHandler = (error: DataTableError) => void;
|
|
44
|
+
export type DataTableSourceErrorHandler = (error: unknown) => void;
|
|
45
|
+
export type DataTableStatusChangeHandler = (status: DataTableSourceStatus) => void;
|
|
46
|
+
export type DataTableQueryChangeHandler = (query: DataTableQuery) => void;
|
|
47
|
+
export type DataTableRowSelectionChangeHandler = (selection: DataTableRowSelection) => void;
|
|
48
|
+
export type DataTableColumnStateChangeHandler = (state: DataTableColumnState) => void;
|
|
49
|
+
export type DataTableAccessStateChangeHandler = (state: DataTableAccessState) => void;
|
|
50
|
+
export type DataTableExpansionChangeHandler = (expansion: readonly DataTableGroupID[]) => void;
|
|
51
|
+
export type DataTableColumnSizeChangeHandler = (state: DataTableColumnSizeState) => void;
|
|
52
|
+
export interface UseDataTableOptions<Columns extends readonly DataTableColumn<never>[] = readonly DataTableColumn<never>[], LeafCells extends object = DataTableCellsFromColumns<Columns>, GroupCells extends object = LeafCells> {
|
|
53
|
+
readonly columns: DataTableReactiveInput<Columns>;
|
|
54
|
+
readonly headers?: DataTableReactiveInput<readonly TabularHeaderNode[]>;
|
|
55
|
+
readonly sourceKey?: DataTableReactiveInput<string>;
|
|
56
|
+
readonly limits?: Partial<TabularLimits>;
|
|
57
|
+
readonly initialView?: DataTableViewResponse<LeafCells, GroupCells>;
|
|
58
|
+
readonly query?: DataTableWritableRef<DataTableQuery>;
|
|
59
|
+
readonly defaultQuery?: DataTableQuery;
|
|
60
|
+
readonly onQueryChange?: DataTableQueryChangeHandler;
|
|
61
|
+
readonly rowSelection?: DataTableWritableRef<DataTableRowSelection>;
|
|
62
|
+
readonly defaultRowSelection?: DataTableRowSelection;
|
|
63
|
+
readonly onRowSelectionChange?: DataTableRowSelectionChangeHandler;
|
|
64
|
+
readonly columnState?: DataTableWritableRef<DataTableColumnState>;
|
|
65
|
+
readonly defaultColumnState?: DataTableColumnState;
|
|
66
|
+
readonly onColumnStateChange?: DataTableColumnStateChangeHandler;
|
|
67
|
+
readonly accessState?: DataTableWritableRef<DataTableAccessState>;
|
|
68
|
+
readonly defaultAccessState?: DataTableAccessState;
|
|
69
|
+
readonly onAccessStateChange?: DataTableAccessStateChangeHandler;
|
|
70
|
+
readonly expansion?: DataTableWritableRef<readonly DataTableGroupID[]>;
|
|
71
|
+
readonly defaultExpansion?: readonly DataTableGroupID[];
|
|
72
|
+
readonly onExpansionChange?: DataTableExpansionChangeHandler;
|
|
73
|
+
readonly columnSizeState?: DataTableWritableRef<Readonly<Record<string, number>>>;
|
|
74
|
+
readonly defaultColumnSizeState?: Readonly<Record<string, number>>;
|
|
75
|
+
readonly onColumnSizeStateChange?: DataTableColumnSizeChangeHandler;
|
|
76
|
+
}
|
|
77
|
+
declare const dataTableSchema: unique symbol;
|
|
78
|
+
export interface DataTableController<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> extends VueProfileController<TabularSnapshot, DataTableEvent, SemanticDataTableCommand> {
|
|
79
|
+
readonly [dataTableSchema]?: {
|
|
80
|
+
readonly leaf: LeafCells;
|
|
81
|
+
readonly group: GroupCells;
|
|
82
|
+
};
|
|
83
|
+
readonly acceptedViewState: ComputedRef<DataTableAcceptedViewState<LeafCells, GroupCells>>;
|
|
84
|
+
getProjection(): DataTableProjection;
|
|
85
|
+
}
|
|
86
|
+
export declare function defineDataTableColumns<const Columns extends readonly DataTableColumn<never>[]>(columns: Columns): Columns;
|
|
87
|
+
export declare function useDataTable<ExplicitLeafCells extends object | undefined = undefined, ExplicitGroupCells extends object | undefined = ExplicitLeafCells, const Columns extends readonly DataTableColumn<never>[] = readonly DataTableColumn<never>[], LeafCells extends object = ExplicitLeafCells extends object ? ExplicitLeafCells : DataTableCellsFromColumns<Columns>, GroupCells extends object = ExplicitGroupCells extends object ? ExplicitGroupCells : LeafCells>(options: UseDataTableOptions<Columns, LeafCells, GroupCells>): DataTableController<LeafCells, GroupCells>;
|
|
88
|
+
export type DataTableSourceResolver<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = (request: TabularRequest, context: {
|
|
89
|
+
readonly signal: AbortSignal;
|
|
90
|
+
}) => DataTableViewResponse<LeafCells, GroupCells> | Promise<DataTableViewResponse<LeafCells, GroupCells>>;
|
|
91
|
+
export interface UseDataTableSourceOptions {
|
|
92
|
+
readonly onError?: DataTableSourceErrorHandler;
|
|
93
|
+
readonly onStatusChange?: DataTableStatusChangeHandler;
|
|
94
|
+
}
|
|
95
|
+
export interface UseDataTableSourceReturn extends SourceReturn {
|
|
96
|
+
}
|
|
97
|
+
export declare function useDataTableSource<LeafCells extends object, GroupCells extends object>(controller: DataTableController<LeafCells, GroupCells>, resolver: DataTableSourceResolver<LeafCells, GroupCells>, options?: UseDataTableSourceOptions): UseDataTableSourceReturn;
|
|
98
|
+
export interface DataTableContextValue extends Omit<ProfileContext<TabularSnapshot, DataTableEvent, SemanticDataTableCommand, HostConnection>, 'connection'> {
|
|
99
|
+
}
|
|
100
|
+
export declare function useDataTableContext(): DataTableContextValue;
|
|
101
|
+
export interface DataTableProviderProps {
|
|
102
|
+
}
|
|
103
|
+
export interface DataTableRootProps {
|
|
104
|
+
readonly onCommand?: DataTableCommandHandler;
|
|
105
|
+
readonly onError?: DataTableErrorHandler;
|
|
106
|
+
readonly as?: PrimitiveAs;
|
|
107
|
+
readonly asChild?: boolean;
|
|
108
|
+
}
|
|
109
|
+
export interface DataTableRootSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> {
|
|
110
|
+
readonly acceptedViewState: DataTableAcceptedViewState<LeafCells, GroupCells>;
|
|
111
|
+
readonly requestState: DataTableRequestState;
|
|
112
|
+
readonly query: DataTableQuery;
|
|
113
|
+
readonly rowSelection: DataTableRowSelection;
|
|
114
|
+
readonly columnState: DataTableColumnState;
|
|
115
|
+
readonly accessState: DataTableAccessState;
|
|
116
|
+
readonly expansion: readonly DataTableGroupID[];
|
|
117
|
+
readonly rows: readonly DataTableViewRow<LeafCells, GroupCells>[];
|
|
118
|
+
}
|
|
119
|
+
export interface DataTableRootExpose<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> {
|
|
120
|
+
readonly controller: DataTableController<LeafCells, GroupCells>;
|
|
121
|
+
refresh(): void;
|
|
122
|
+
}
|
|
123
|
+
export interface DataTablePartProps {
|
|
124
|
+
readonly as?: PrimitiveAs;
|
|
125
|
+
readonly asChild?: boolean;
|
|
126
|
+
}
|
|
127
|
+
export type DataTableHeaderRowProps = DataTablePartProps;
|
|
128
|
+
export type DataTableColumnHeaderProps<Column extends string = string> = DataTablePartProps & ({
|
|
129
|
+
readonly column: Column;
|
|
130
|
+
readonly header?: never;
|
|
131
|
+
} | {
|
|
132
|
+
readonly header: TabularHeaderNodeID;
|
|
133
|
+
readonly column?: never;
|
|
134
|
+
});
|
|
135
|
+
export interface DataTableSortTriggerProps<Column extends string = string> extends DataTablePartProps {
|
|
136
|
+
readonly column: Column;
|
|
137
|
+
readonly comparator?: string;
|
|
138
|
+
}
|
|
139
|
+
export type DataTableFilterControlProps<Column extends string = string> = DataTablePartProps & ({
|
|
140
|
+
readonly scope: 'global';
|
|
141
|
+
readonly id: string;
|
|
142
|
+
readonly predicate: string;
|
|
143
|
+
} | {
|
|
144
|
+
readonly scope: 'column';
|
|
145
|
+
readonly column: Column;
|
|
146
|
+
readonly id: string;
|
|
147
|
+
readonly predicate: string;
|
|
148
|
+
});
|
|
149
|
+
export interface DataTableColumnResizeHandleProps<Column extends string = string> extends DataTablePartProps {
|
|
150
|
+
readonly column: Column;
|
|
151
|
+
readonly minSize?: number;
|
|
152
|
+
readonly maxSize?: number;
|
|
153
|
+
}
|
|
154
|
+
export interface DataTableRowProps extends DataTablePartProps {
|
|
155
|
+
readonly rowID: DataTableRowID | DataTableGroupID;
|
|
156
|
+
}
|
|
157
|
+
export interface DataTableSelectionControlProps extends DataTablePartProps {
|
|
158
|
+
readonly rowID?: DataTableRowID;
|
|
159
|
+
readonly name: string;
|
|
160
|
+
readonly value?: string;
|
|
161
|
+
readonly form?: string;
|
|
162
|
+
readonly disabled?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export interface DataTableBulkSelectionControlProps extends DataTablePartProps {
|
|
165
|
+
readonly target: {
|
|
166
|
+
readonly kind: 'all-matching';
|
|
167
|
+
} | {
|
|
168
|
+
readonly kind: 'group-leaves';
|
|
169
|
+
readonly groupID: DataTableGroupID;
|
|
170
|
+
};
|
|
171
|
+
readonly disabled?: boolean;
|
|
172
|
+
}
|
|
173
|
+
export interface DataTableDisclosureProps extends DataTablePartProps {
|
|
174
|
+
readonly rowID?: DataTableGroupID;
|
|
175
|
+
readonly disabled?: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface DataTableCellProps<Column extends string = string> extends DataTablePartProps {
|
|
178
|
+
readonly rowID?: DataTableRowID | DataTableGroupID;
|
|
179
|
+
readonly column: Column;
|
|
180
|
+
}
|
|
181
|
+
export interface DataTableEditorProps<Column extends string = string> extends DataTableCellProps<Column> {
|
|
182
|
+
readonly parseValue?: (value: string) => TabularResult<TabularWireValue>;
|
|
183
|
+
readonly commitOnChange?: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface DataTablePartSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> extends DataTableRootSlotProps<LeafCells, GroupCells> {
|
|
186
|
+
readonly row?: DataTableViewRow<LeafCells, GroupCells>;
|
|
187
|
+
readonly isGroup?: boolean;
|
|
188
|
+
}
|
|
189
|
+
export interface DataTableBodySlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> extends DataTableRootSlotProps<LeafCells, GroupCells> {
|
|
190
|
+
readonly row: DataTableViewRow<LeafCells, GroupCells>;
|
|
191
|
+
readonly rowIndex: number;
|
|
192
|
+
readonly isGroup: boolean;
|
|
193
|
+
}
|
|
194
|
+
export type DataTableProviderSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
195
|
+
export type DataTableCaptionProps = DataTablePartProps;
|
|
196
|
+
export type DataTableHeaderProps = DataTablePartProps;
|
|
197
|
+
export interface DataTableBodyProps extends DataTablePartProps {
|
|
198
|
+
readonly manual?: boolean;
|
|
199
|
+
}
|
|
200
|
+
export type DataTableCaptionSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
201
|
+
export type DataTableHeaderSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
202
|
+
export type DataTableHeaderRowSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
203
|
+
export type DataTableColumnHeaderSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
204
|
+
export type DataTableSortTriggerSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
205
|
+
export type DataTableFilterControlSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
206
|
+
export type DataTableColumnResizeHandleSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
207
|
+
export type DataTableRowSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
208
|
+
export type DataTableSelectionControlSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTablePartSlotProps<LeafCells, GroupCells>;
|
|
209
|
+
export type DataTableBulkSelectionControlSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTableRootSlotProps<LeafCells, GroupCells>;
|
|
210
|
+
export type DataTableDisclosureSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTablePartSlotProps<LeafCells, GroupCells>;
|
|
211
|
+
export type DataTableCellSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTablePartSlotProps<LeafCells, GroupCells>;
|
|
212
|
+
export type DataTableEditorSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTablePartSlotProps<LeafCells, GroupCells>;
|
|
213
|
+
export interface DataTableComponents<LeafCells extends object, GroupCells extends object = LeafCells> {
|
|
214
|
+
readonly Provider: TabularComponent<DataTableProviderProps, DataTableProviderSlotProps<LeafCells, GroupCells>>;
|
|
215
|
+
readonly Root: TabularComponent<DataTableRootProps, DataTableRootSlotProps<LeafCells, GroupCells>>;
|
|
216
|
+
readonly Caption: TabularComponent<DataTableCaptionProps, DataTableCaptionSlotProps<LeafCells, GroupCells>>;
|
|
217
|
+
readonly Header: TabularComponent<DataTableHeaderProps, DataTableHeaderSlotProps<LeafCells, GroupCells>>;
|
|
218
|
+
readonly HeaderRow: TabularComponent<DataTableHeaderRowProps, DataTableHeaderRowSlotProps<LeafCells, GroupCells>>;
|
|
219
|
+
readonly ColumnHeader: TabularComponent<DataTableColumnHeaderProps<DataTableColumnID<LeafCells, GroupCells>>, DataTableColumnHeaderSlotProps<LeafCells, GroupCells>>;
|
|
220
|
+
readonly SortTrigger: TabularComponent<DataTableSortTriggerProps<DataTableColumnID<LeafCells, GroupCells>>, DataTableSortTriggerSlotProps<LeafCells, GroupCells>>;
|
|
221
|
+
readonly FilterControl: TabularComponent<DataTableFilterControlProps<DataTableColumnID<LeafCells, GroupCells>>, DataTableFilterControlSlotProps<LeafCells, GroupCells>>;
|
|
222
|
+
readonly ColumnResizeHandle: TabularComponent<DataTableColumnResizeHandleProps<DataTableColumnID<LeafCells, GroupCells>>, DataTableColumnResizeHandleSlotProps<LeafCells, GroupCells>>;
|
|
223
|
+
readonly Body: TabularBodyComponent<DataTableBodyProps, DataTableRootSlotProps<LeafCells, GroupCells>, DataTableBodySlotProps<LeafCells, GroupCells>>;
|
|
224
|
+
readonly Row: TabularComponent<DataTableRowProps, DataTableRowSlotProps<LeafCells, GroupCells>>;
|
|
225
|
+
readonly SelectionControl: TabularComponent<DataTableSelectionControlProps, DataTableSelectionControlSlotProps<LeafCells, GroupCells>>;
|
|
226
|
+
readonly BulkSelectionControl: TabularComponent<DataTableBulkSelectionControlProps, DataTableBulkSelectionControlSlotProps<LeafCells, GroupCells>>;
|
|
227
|
+
readonly Disclosure: TabularComponent<DataTableDisclosureProps, DataTableDisclosureSlotProps<LeafCells, GroupCells>>;
|
|
228
|
+
readonly Cell: TabularComponent<DataTableCellProps<DataTableColumnID<LeafCells, GroupCells>>, DataTableCellSlotProps<LeafCells, GroupCells>>;
|
|
229
|
+
readonly Editor: TabularComponent<DataTableEditorProps<DataTableColumnID<LeafCells, GroupCells>>, DataTableEditorSlotProps<LeafCells, GroupCells>>;
|
|
230
|
+
}
|
|
231
|
+
export declare function createDataTableComponents<LeafCells extends object, GroupCells extends object>(controller: DataTableController<LeafCells, GroupCells>): DataTableComponents<LeafCells, GroupCells>;
|
|
232
|
+
export type { DataTableEvent, DataTableProjection, DataTableUpdate, SemanticDataTableController };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { getCurrentScope, onScopeDispose, toValue, watch, } from 'vue';
|
|
2
|
+
import { connectDataTable, } from '@sectile/dom/tabular';
|
|
3
|
+
import { createDataTable, } from '@sectile/tabular/data-table';
|
|
4
|
+
import { createTabularParts } from './internal/tabular-parts.js';
|
|
5
|
+
import { createTabularComponentSuite, } from './internal/tabular-components.js';
|
|
6
|
+
import { controlledValues, aliasVueProfileController, createVueProfileController, semanticController, useProfile, useProfileSource, } from './internal/tabular-profile.js';
|
|
7
|
+
const hosts = new WeakMap();
|
|
8
|
+
export function defineDataTableColumns(columns) { return columns; }
|
|
9
|
+
export function useDataTable(options) {
|
|
10
|
+
assertExclusive(options, 'query');
|
|
11
|
+
assertExclusive(options, 'rowSelection');
|
|
12
|
+
assertExclusive(options, 'columnState');
|
|
13
|
+
assertExclusive(options, 'accessState');
|
|
14
|
+
assertExclusive(options, 'expansion');
|
|
15
|
+
assertExclusive(options, 'columnSizeState');
|
|
16
|
+
const initialValues = Object.freeze({
|
|
17
|
+
...(options.query === undefined && options.defaultQuery === undefined ? {} : { query: options.query?.value ?? options.defaultQuery }),
|
|
18
|
+
...(options.rowSelection === undefined && options.defaultRowSelection === undefined ? {} : { rowSelection: options.rowSelection?.value ?? options.defaultRowSelection }),
|
|
19
|
+
...(options.columnState === undefined && options.defaultColumnState === undefined ? {} : { columnState: options.columnState?.value ?? options.defaultColumnState }),
|
|
20
|
+
...(options.accessState === undefined && options.defaultAccessState === undefined ? {} : { accessState: options.accessState?.value ?? options.defaultAccessState }),
|
|
21
|
+
...(options.expansion === undefined && options.defaultExpansion === undefined ? {} : { expansion: options.expansion?.value ?? options.defaultExpansion }),
|
|
22
|
+
});
|
|
23
|
+
const semanticOptions = {
|
|
24
|
+
columns: stripColumns(toValue(options.columns)),
|
|
25
|
+
...(options.headers === undefined ? {} : { headers: toValue(options.headers) }),
|
|
26
|
+
...(options.limits === undefined ? {} : { limits: options.limits }),
|
|
27
|
+
controlled: {
|
|
28
|
+
query: options.query !== undefined,
|
|
29
|
+
rowSelection: options.rowSelection !== undefined,
|
|
30
|
+
columnState: options.columnState !== undefined,
|
|
31
|
+
accessState: options.accessState !== undefined,
|
|
32
|
+
expansion: options.expansion !== undefined,
|
|
33
|
+
},
|
|
34
|
+
initialValues,
|
|
35
|
+
...(options.onQueryChange === undefined ? {} : { onQueryChange: options.onQueryChange }),
|
|
36
|
+
...(options.onRowSelectionChange === undefined ? {} : { onRowSelectionChange: options.onRowSelectionChange }),
|
|
37
|
+
...(options.onColumnStateChange === undefined ? {} : { onColumnStateChange: options.onColumnStateChange }),
|
|
38
|
+
...(options.onAccessStateChange === undefined ? {} : { onAccessStateChange: options.onAccessStateChange }),
|
|
39
|
+
...(options.onExpansionChange === undefined ? {} : { onExpansionChange: options.onExpansionChange }),
|
|
40
|
+
};
|
|
41
|
+
const semantic = createDataTable(semanticOptions);
|
|
42
|
+
const base = createVueProfileController(semantic);
|
|
43
|
+
const controller = Object.freeze({ ...base, getProjection: () => semantic.getProjection() });
|
|
44
|
+
aliasVueProfileController(controller, base);
|
|
45
|
+
hosts.set(controller, Object.freeze({
|
|
46
|
+
...(options.columnSizeState === undefined ? {} : { columnSizes: options.columnSizeState.value }),
|
|
47
|
+
...(options.defaultColumnSizeState === undefined ? {} : { defaultColumnSizes: options.defaultColumnSizeState }),
|
|
48
|
+
...(options.onColumnSizeStateChange === undefined ? {} : { onColumnSizesChange: options.onColumnSizeStateChange }),
|
|
49
|
+
}));
|
|
50
|
+
if (options.initialView !== undefined)
|
|
51
|
+
unwrapResult(controller.synchronizeView(options.initialView));
|
|
52
|
+
const stops = [];
|
|
53
|
+
const sync = () => { unwrapResult(controller.syncControlledValues(controlledValues(options))); };
|
|
54
|
+
for (const source of [options.query, options.rowSelection, options.columnState, options.accessState, options.expansion])
|
|
55
|
+
if (source !== undefined)
|
|
56
|
+
stops.push(watch(() => source.value, sync, { deep: false }));
|
|
57
|
+
if (options.sourceKey !== undefined)
|
|
58
|
+
stops.push(watch(() => toValue(options.sourceKey), () => { unwrapResult(controller.dispatch({ type: 'replace-source' })); }));
|
|
59
|
+
stops.push(watch(() => toValue(options.columns), () => { unwrapResult(controller.dispatch({ type: 'replace-source' })); }, { deep: false }));
|
|
60
|
+
const dispose = controller.dispose;
|
|
61
|
+
const wrapped = Object.freeze({ ...controller, dispose: () => { for (const stop of stops.splice(0))
|
|
62
|
+
stop(); dispose(); } });
|
|
63
|
+
aliasVueProfileController(wrapped, controller);
|
|
64
|
+
hosts.set(wrapped, hosts.get(controller) ?? {});
|
|
65
|
+
if (getCurrentScope() !== undefined)
|
|
66
|
+
onScopeDispose(wrapped.dispose);
|
|
67
|
+
return wrapped;
|
|
68
|
+
}
|
|
69
|
+
export function useDataTableSource(controller, resolver, options) {
|
|
70
|
+
return useProfileSource(controller, resolver, options);
|
|
71
|
+
}
|
|
72
|
+
const publicKey = Symbol('SectileDataTable');
|
|
73
|
+
const privateKey = Symbol('SectileDataTableHost');
|
|
74
|
+
export function useDataTableContext() { return useProfile(publicKey, 'useDataTableContext'); }
|
|
75
|
+
const parts = createTabularParts({
|
|
76
|
+
profile: 'data-table', prefix: 'DataTable', publicKey, privateKey,
|
|
77
|
+
connect: (element, controller, callbacks) => connectDataTable({
|
|
78
|
+
controller: semanticController(controller),
|
|
79
|
+
table: element,
|
|
80
|
+
...hosts.get(controller),
|
|
81
|
+
...(callbacks.onCommand === undefined ? {} : { onCommand: callbacks.onCommand }),
|
|
82
|
+
onSnapshotChange: callbacks.onSnapshotChange,
|
|
83
|
+
}),
|
|
84
|
+
});
|
|
85
|
+
const componentSuites = new WeakMap();
|
|
86
|
+
export function createDataTableComponents(controller) {
|
|
87
|
+
return createTabularComponentSuite(parts, controller, componentSuites, 'DataTable', {
|
|
88
|
+
Root: 'Root',
|
|
89
|
+
Caption: 'Caption',
|
|
90
|
+
Header: 'Header',
|
|
91
|
+
HeaderRow: 'HeaderRow',
|
|
92
|
+
ColumnHeader: 'ColumnHeader',
|
|
93
|
+
SortTrigger: 'SortTrigger',
|
|
94
|
+
FilterControl: 'FilterControl',
|
|
95
|
+
ColumnResizeHandle: 'ColumnResizeHandle',
|
|
96
|
+
Body: 'Body',
|
|
97
|
+
Row: 'Row',
|
|
98
|
+
SelectionControl: 'SelectionControl',
|
|
99
|
+
BulkSelectionControl: 'BulkSelectionControl',
|
|
100
|
+
Disclosure: 'Disclosure',
|
|
101
|
+
Cell: 'Cell',
|
|
102
|
+
Editor: 'Editor',
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function stripColumns(columns) {
|
|
106
|
+
return columns.map(({ getValue: _getValue, groupValue: _groupValue, aggregate: _aggregate, ...column }) => Object.freeze(column));
|
|
107
|
+
}
|
|
108
|
+
function assertExclusive(options, property) {
|
|
109
|
+
const values = options;
|
|
110
|
+
const fallback = `default${property[0].toUpperCase()}${property.slice(1)}`;
|
|
111
|
+
if (values[property] !== undefined && values[fallback] !== undefined)
|
|
112
|
+
throw new TypeError(`${property} and ${fallback} are mutually exclusive.`);
|
|
113
|
+
}
|
|
114
|
+
function unwrapResult(result) { if (!result.ok)
|
|
115
|
+
throw new TypeError(result.error.message); return result.value; }
|
|
116
|
+
//# sourceMappingURL=data-table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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KAAK;QACV,gBAAgB,EAAE,kBAAkB;QACpC,oBAAoB,EAAE,sBAAsB;QAC5C,UAAU,EAAE,YAAY;QACxB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;KACjB,CAA0D,CAAC;AAC9D,CAAC;AAED,SAAS,YAAY,CAAC,OAA0C;IAC9D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AACpI,CAAC;AACD,SAAS,eAAe,CAAC,OAAe,EAAE,QAAgB;IACxD,MAAM,MAAM,GAAG,OAAkC,CAAC;IAClD,MAAM,QAAQ,GAAG,UAAU,QAAQ,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5E,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAS;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,QAAQ,QAAQ,QAAQ,0BAA0B,CAAC,CAAC;AACnJ,CAAC;AACD,SAAS,YAAY,CAAI,MAAwB,IAAO,IAAI,CAAC,MAAM,CAAC,EAAE;IAAE,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { type ComputedRef } from 'vue';
|
|
2
|
+
import { type DataTreeGridColumnSizeState as DOMDataTreeGridColumnSizeState, type DataTreeGridDOMCommand } from '@sectile/dom/tabular';
|
|
3
|
+
import { type DataTreeGridCommand as SemanticDataTreeGridCommand, type DataTreeGridController as SemanticDataTreeGridController, type DataTreeGridCursorState, type DataTreeGridEditState, type DataTreeGridEvent, type DataTreeGridExpansionState, type DataTreeGridOptions as SemanticDataTreeGridOptions, type DataTreeGridProjection, type DataTreeGridState, type DataTreeGridUpdate } from '@sectile/tabular/data-tree-grid';
|
|
4
|
+
import type { TabularAcceptedViewState, TabularAccessState, TabularCellRecord, TabularColumnState, TabularError, TabularGroupID, TabularHeaderNode, TabularHeaderNodeID, TabularLimits, TabularQuery, TabularRequest, TabularRequestState, TabularResult, TabularRow, TabularRowID, TabularRowSelection, TabularView, TabularViewResponse, TabularWireValue } from '@sectile/tabular';
|
|
5
|
+
import type { PrimitiveAs } from './primitive.js';
|
|
6
|
+
import type { DataTableCellsFromColumns, DataTableColumn, DataTableColumnID, DataTableReactiveInput, DataTableWritableRef } from './data-table.js';
|
|
7
|
+
import { type TabularBodyComponent, type TabularComponent } from './internal/tabular-components.js';
|
|
8
|
+
import { type HostConnection } from './internal/tabular-parts.js';
|
|
9
|
+
import { type ProfileContext, type SourceReturn, type SourceStatus, type VueProfileController } from './internal/tabular-profile.js';
|
|
10
|
+
export type DataTreeGridColumn<RecordValue = unknown, ID extends string = string, CellValue extends TabularWireValue = TabularWireValue> = DataTableColumn<RecordValue, ID, CellValue>;
|
|
11
|
+
export type DataTreeGridQuery = TabularQuery;
|
|
12
|
+
export type DataTreeGridViewRow<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = TabularRow<LeafCells, GroupCells>;
|
|
13
|
+
export type DataTreeGridView<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = TabularView<DataTreeGridViewRow<LeafCells, GroupCells>>;
|
|
14
|
+
export type DataTreeGridViewResponse<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = TabularViewResponse<DataTreeGridViewRow<LeafCells, GroupCells>>;
|
|
15
|
+
export type DataTreeGridRowSelection = TabularRowSelection;
|
|
16
|
+
export type DataTreeGridGroupID = TabularGroupID;
|
|
17
|
+
export type DataTreeGridRowID = TabularRowID;
|
|
18
|
+
export type DataTreeGridColumnState = TabularColumnState;
|
|
19
|
+
export type DataTreeGridAccessState = TabularAccessState;
|
|
20
|
+
export type DataTreeGridRequestState = TabularRequestState;
|
|
21
|
+
export type DataTreeGridAcceptedViewState<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = TabularAcceptedViewState<DataTreeGridViewRow<LeafCells, GroupCells>>;
|
|
22
|
+
export type DataTreeGridColumnSizeState = DOMDataTreeGridColumnSizeState;
|
|
23
|
+
export type DataTreeGridSourceStatus = SourceStatus;
|
|
24
|
+
export type DataTreeGridSemanticCommand = SemanticDataTreeGridCommand;
|
|
25
|
+
export type DataTreeGridCommand = DataTreeGridDOMCommand;
|
|
26
|
+
export type DataTreeGridError = TabularError;
|
|
27
|
+
export type DataTreeGridCommandHandler = (command: DataTreeGridCommand) => void;
|
|
28
|
+
export type DataTreeGridErrorHandler = (error: DataTreeGridError) => void;
|
|
29
|
+
export type DataTreeGridSourceErrorHandler = (error: unknown) => void;
|
|
30
|
+
export type DataTreeGridStatusChangeHandler = (status: DataTreeGridSourceStatus) => void;
|
|
31
|
+
export type DataTreeGridQueryChangeHandler = (value: DataTreeGridQuery) => void;
|
|
32
|
+
export type DataTreeGridRowSelectionChangeHandler = (value: DataTreeGridRowSelection) => void;
|
|
33
|
+
export type DataTreeGridColumnStateChangeHandler = (value: DataTreeGridColumnState) => void;
|
|
34
|
+
export type DataTreeGridAccessStateChangeHandler = (value: DataTreeGridAccessState) => void;
|
|
35
|
+
export type DataTreeGridExpansionChangeHandler = (value: readonly DataTreeGridGroupID[]) => void;
|
|
36
|
+
export type DataTreeGridCursorChangeHandler = (value: DataTreeGridCursorState) => void;
|
|
37
|
+
export type DataTreeGridEditStateChangeHandler = (value: DataTreeGridEditState) => void;
|
|
38
|
+
export type DataTreeGridColumnSizeChangeHandler = (value: DataTreeGridColumnSizeState) => void;
|
|
39
|
+
export interface UseDataTreeGridOptions<Columns extends readonly DataTreeGridColumn<never>[] = readonly DataTreeGridColumn<never>[], LeafCells extends object = DataTableCellsFromColumns<Columns>, GroupCells extends object = LeafCells> {
|
|
40
|
+
readonly columns: DataTableReactiveInput<Columns>;
|
|
41
|
+
readonly headers?: DataTableReactiveInput<readonly TabularHeaderNode[]>;
|
|
42
|
+
readonly sourceKey?: DataTableReactiveInput<string>;
|
|
43
|
+
readonly limits?: Partial<TabularLimits>;
|
|
44
|
+
readonly initialView?: DataTreeGridViewResponse<LeafCells, GroupCells>;
|
|
45
|
+
readonly query?: DataTableWritableRef<DataTreeGridQuery>;
|
|
46
|
+
readonly defaultQuery?: DataTreeGridQuery;
|
|
47
|
+
readonly onQueryChange?: DataTreeGridQueryChangeHandler;
|
|
48
|
+
readonly rowSelection?: DataTableWritableRef<DataTreeGridRowSelection>;
|
|
49
|
+
readonly defaultRowSelection?: DataTreeGridRowSelection;
|
|
50
|
+
readonly onRowSelectionChange?: DataTreeGridRowSelectionChangeHandler;
|
|
51
|
+
readonly columnState?: DataTableWritableRef<DataTreeGridColumnState>;
|
|
52
|
+
readonly defaultColumnState?: DataTreeGridColumnState;
|
|
53
|
+
readonly onColumnStateChange?: DataTreeGridColumnStateChangeHandler;
|
|
54
|
+
readonly accessState?: DataTableWritableRef<DataTreeGridAccessState>;
|
|
55
|
+
readonly defaultAccessState?: DataTreeGridAccessState;
|
|
56
|
+
readonly onAccessStateChange?: DataTreeGridAccessStateChangeHandler;
|
|
57
|
+
readonly expansion?: DataTableWritableRef<readonly DataTreeGridGroupID[]>;
|
|
58
|
+
readonly defaultExpansion?: readonly DataTreeGridGroupID[];
|
|
59
|
+
readonly onExpansionChange?: DataTreeGridExpansionChangeHandler;
|
|
60
|
+
readonly cursor?: DataTableWritableRef<DataTreeGridCursorState>;
|
|
61
|
+
readonly defaultCursor?: DataTreeGridCursorState;
|
|
62
|
+
readonly onCursorChange?: DataTreeGridCursorChangeHandler;
|
|
63
|
+
readonly editState?: DataTableWritableRef<DataTreeGridEditState>;
|
|
64
|
+
readonly defaultEditState?: DataTreeGridEditState;
|
|
65
|
+
readonly onEditStateChange?: DataTreeGridEditStateChangeHandler;
|
|
66
|
+
readonly columnSizeState?: DataTableWritableRef<Readonly<Record<string, number>>>;
|
|
67
|
+
readonly defaultColumnSizeState?: Readonly<Record<string, number>>;
|
|
68
|
+
readonly onColumnSizeStateChange?: DataTreeGridColumnSizeChangeHandler;
|
|
69
|
+
readonly isCellDisabled?: SemanticDataTreeGridOptions['isCellDisabled'];
|
|
70
|
+
}
|
|
71
|
+
declare const dataTreeGridSchema: unique symbol;
|
|
72
|
+
export interface DataTreeGridController<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> extends VueProfileController<DataTreeGridState, DataTreeGridEvent, SemanticDataTreeGridCommand> {
|
|
73
|
+
readonly [dataTreeGridSchema]?: {
|
|
74
|
+
readonly leaf: LeafCells;
|
|
75
|
+
readonly group: GroupCells;
|
|
76
|
+
};
|
|
77
|
+
readonly acceptedViewState: ComputedRef<DataTreeGridAcceptedViewState<LeafCells, GroupCells>>;
|
|
78
|
+
getProjection(): DataTreeGridProjection;
|
|
79
|
+
}
|
|
80
|
+
export declare function defineDataTreeGridColumns<const Columns extends readonly DataTreeGridColumn<never>[]>(columns: Columns): Columns;
|
|
81
|
+
export declare function useDataTreeGrid<ExplicitLeafCells extends object | undefined = undefined, ExplicitGroupCells extends object | undefined = ExplicitLeafCells, const Columns extends readonly DataTreeGridColumn<never>[] = readonly DataTreeGridColumn<never>[], LeafCells extends object = ExplicitLeafCells extends object ? ExplicitLeafCells : DataTableCellsFromColumns<Columns>, GroupCells extends object = ExplicitGroupCells extends object ? ExplicitGroupCells : LeafCells>(options: UseDataTreeGridOptions<Columns, LeafCells, GroupCells>): DataTreeGridController<LeafCells, GroupCells>;
|
|
82
|
+
export type DataTreeGridSourceResolver<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = (request: TabularRequest, context: {
|
|
83
|
+
readonly signal: AbortSignal;
|
|
84
|
+
}) => DataTreeGridViewResponse<LeafCells, GroupCells> | Promise<DataTreeGridViewResponse<LeafCells, GroupCells>>;
|
|
85
|
+
export interface UseDataTreeGridSourceOptions {
|
|
86
|
+
readonly onError?: DataTreeGridSourceErrorHandler;
|
|
87
|
+
readonly onStatusChange?: DataTreeGridStatusChangeHandler;
|
|
88
|
+
}
|
|
89
|
+
export interface UseDataTreeGridSourceReturn extends SourceReturn {
|
|
90
|
+
}
|
|
91
|
+
export declare function useDataTreeGridSource<LeafCells extends object, GroupCells extends object>(controller: DataTreeGridController<LeafCells, GroupCells>, resolver: DataTreeGridSourceResolver<LeafCells, GroupCells>, options?: UseDataTreeGridSourceOptions): UseDataTreeGridSourceReturn;
|
|
92
|
+
export interface DataTreeGridContextValue extends Omit<ProfileContext<DataTreeGridState, DataTreeGridEvent, SemanticDataTreeGridCommand, HostConnection>, 'connection'> {
|
|
93
|
+
}
|
|
94
|
+
export declare function useDataTreeGridContext(): DataTreeGridContextValue;
|
|
95
|
+
export interface DataTreeGridProviderProps {
|
|
96
|
+
}
|
|
97
|
+
export interface DataTreeGridRootProps {
|
|
98
|
+
readonly onCommand?: DataTreeGridCommandHandler;
|
|
99
|
+
readonly onError?: DataTreeGridErrorHandler;
|
|
100
|
+
readonly as?: PrimitiveAs;
|
|
101
|
+
readonly asChild?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface DataTreeGridRootSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> {
|
|
104
|
+
readonly acceptedViewState: DataTreeGridAcceptedViewState<LeafCells, GroupCells>;
|
|
105
|
+
readonly requestState: DataTreeGridRequestState;
|
|
106
|
+
readonly query: DataTreeGridQuery;
|
|
107
|
+
readonly rowSelection: DataTreeGridRowSelection;
|
|
108
|
+
readonly columnState: DataTreeGridColumnState;
|
|
109
|
+
readonly accessState: DataTreeGridAccessState;
|
|
110
|
+
readonly expansion: readonly DataTreeGridGroupID[];
|
|
111
|
+
readonly cursor: DataTreeGridCursorState;
|
|
112
|
+
readonly editState: DataTreeGridEditState;
|
|
113
|
+
readonly rows: readonly DataTreeGridViewRow<LeafCells, GroupCells>[];
|
|
114
|
+
}
|
|
115
|
+
export interface DataTreeGridRootExpose<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> {
|
|
116
|
+
readonly controller: DataTreeGridController<LeafCells, GroupCells>;
|
|
117
|
+
refresh(): void;
|
|
118
|
+
}
|
|
119
|
+
export interface DataTreeGridPartProps {
|
|
120
|
+
readonly as?: PrimitiveAs;
|
|
121
|
+
readonly asChild?: boolean;
|
|
122
|
+
}
|
|
123
|
+
export type DataTreeGridHeaderRowProps = DataTreeGridPartProps;
|
|
124
|
+
export type DataTreeGridColumnHeaderProps<Column extends string = string> = DataTreeGridPartProps & ({
|
|
125
|
+
readonly column: Column;
|
|
126
|
+
readonly header?: never;
|
|
127
|
+
} | {
|
|
128
|
+
readonly header: TabularHeaderNodeID;
|
|
129
|
+
readonly column?: never;
|
|
130
|
+
});
|
|
131
|
+
export interface DataTreeGridSortTriggerProps<Column extends string = string> extends DataTreeGridPartProps {
|
|
132
|
+
readonly column: Column;
|
|
133
|
+
readonly comparator?: string;
|
|
134
|
+
}
|
|
135
|
+
export type DataTreeGridFilterControlProps<Column extends string = string> = DataTreeGridPartProps & ({
|
|
136
|
+
readonly scope: 'global';
|
|
137
|
+
readonly id: string;
|
|
138
|
+
readonly predicate: string;
|
|
139
|
+
} | {
|
|
140
|
+
readonly scope: 'column';
|
|
141
|
+
readonly column: Column;
|
|
142
|
+
readonly id: string;
|
|
143
|
+
readonly predicate: string;
|
|
144
|
+
});
|
|
145
|
+
export interface DataTreeGridColumnResizeHandleProps<Column extends string = string> extends DataTreeGridPartProps {
|
|
146
|
+
readonly column: Column;
|
|
147
|
+
readonly minSize?: number;
|
|
148
|
+
readonly maxSize?: number;
|
|
149
|
+
}
|
|
150
|
+
export interface DataTreeGridRowProps extends DataTreeGridPartProps {
|
|
151
|
+
readonly rowID: DataTreeGridRowID | DataTreeGridGroupID;
|
|
152
|
+
}
|
|
153
|
+
export interface DataTreeGridRowDisclosureProps extends DataTreeGridPartProps {
|
|
154
|
+
readonly rowID?: DataTreeGridGroupID;
|
|
155
|
+
readonly disabled?: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface DataTreeGridRowSelectionControlProps extends DataTreeGridPartProps {
|
|
158
|
+
readonly rowID?: DataTreeGridRowID;
|
|
159
|
+
readonly name: string;
|
|
160
|
+
readonly value?: string;
|
|
161
|
+
readonly form?: string;
|
|
162
|
+
readonly disabled?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export interface DataTreeGridBulkSelectionControlProps extends DataTreeGridPartProps {
|
|
165
|
+
readonly target: {
|
|
166
|
+
readonly kind: 'all-matching';
|
|
167
|
+
} | {
|
|
168
|
+
readonly kind: 'group-leaves';
|
|
169
|
+
readonly groupID: DataTreeGridGroupID;
|
|
170
|
+
};
|
|
171
|
+
readonly disabled?: boolean;
|
|
172
|
+
}
|
|
173
|
+
export interface DataTreeGridCellProps<Column extends string = string> extends DataTreeGridPartProps {
|
|
174
|
+
readonly rowID?: DataTreeGridRowID | DataTreeGridGroupID;
|
|
175
|
+
readonly column: Column;
|
|
176
|
+
}
|
|
177
|
+
export interface DataTreeGridEditorProps<Column extends string = string> extends DataTreeGridCellProps<Column> {
|
|
178
|
+
readonly parseValue?: (value: string) => TabularResult<TabularWireValue>;
|
|
179
|
+
readonly commitOnChange?: boolean;
|
|
180
|
+
}
|
|
181
|
+
export type DataTreeGridHeaderProps = DataTreeGridPartProps;
|
|
182
|
+
export interface DataTreeGridBodyProps extends DataTreeGridPartProps {
|
|
183
|
+
readonly manual?: boolean;
|
|
184
|
+
}
|
|
185
|
+
export interface DataTreeGridPartSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> extends DataTreeGridRootSlotProps<LeafCells, GroupCells> {
|
|
186
|
+
readonly row?: DataTreeGridViewRow<LeafCells, GroupCells>;
|
|
187
|
+
readonly isGroup?: boolean;
|
|
188
|
+
}
|
|
189
|
+
export type DataTreeGridProviderSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
190
|
+
export interface DataTreeGridBodySlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> extends DataTreeGridRootSlotProps<LeafCells, GroupCells> {
|
|
191
|
+
readonly row: DataTreeGridViewRow<LeafCells, GroupCells>;
|
|
192
|
+
readonly rowIndex: number;
|
|
193
|
+
readonly isGroup: boolean;
|
|
194
|
+
}
|
|
195
|
+
export type DataTreeGridHeaderSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
196
|
+
export type DataTreeGridHeaderRowSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
197
|
+
export type DataTreeGridColumnHeaderSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
198
|
+
export type DataTreeGridSortTriggerSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
199
|
+
export type DataTreeGridFilterControlSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
200
|
+
export type DataTreeGridColumnResizeHandleSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
201
|
+
export type DataTreeGridRowSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
202
|
+
export type DataTreeGridRowDisclosureSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridPartSlotProps<LeafCells, GroupCells>;
|
|
203
|
+
export type DataTreeGridRowSelectionControlSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridPartSlotProps<LeafCells, GroupCells>;
|
|
204
|
+
export type DataTreeGridBulkSelectionControlSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridRootSlotProps<LeafCells, GroupCells>;
|
|
205
|
+
export type DataTreeGridCellSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridPartSlotProps<LeafCells, GroupCells>;
|
|
206
|
+
export type DataTreeGridEditorSlotProps<LeafCells extends object = TabularCellRecord, GroupCells extends object = LeafCells> = DataTreeGridPartSlotProps<LeafCells, GroupCells>;
|
|
207
|
+
export interface DataTreeGridComponents<LeafCells extends object, GroupCells extends object = LeafCells> {
|
|
208
|
+
readonly Provider: TabularComponent<DataTreeGridProviderProps, DataTreeGridProviderSlotProps<LeafCells, GroupCells>>;
|
|
209
|
+
readonly Root: TabularComponent<DataTreeGridRootProps, DataTreeGridRootSlotProps<LeafCells, GroupCells>>;
|
|
210
|
+
readonly Header: TabularComponent<DataTreeGridHeaderProps, DataTreeGridHeaderSlotProps<LeafCells, GroupCells>>;
|
|
211
|
+
readonly HeaderRow: TabularComponent<DataTreeGridHeaderRowProps, DataTreeGridHeaderRowSlotProps<LeafCells, GroupCells>>;
|
|
212
|
+
readonly ColumnHeader: TabularComponent<DataTreeGridColumnHeaderProps<DataTableColumnID<LeafCells, GroupCells>>, DataTreeGridColumnHeaderSlotProps<LeafCells, GroupCells>>;
|
|
213
|
+
readonly SortTrigger: TabularComponent<DataTreeGridSortTriggerProps<DataTableColumnID<LeafCells, GroupCells>>, DataTreeGridSortTriggerSlotProps<LeafCells, GroupCells>>;
|
|
214
|
+
readonly FilterControl: TabularComponent<DataTreeGridFilterControlProps<DataTableColumnID<LeafCells, GroupCells>>, DataTreeGridFilterControlSlotProps<LeafCells, GroupCells>>;
|
|
215
|
+
readonly ColumnResizeHandle: TabularComponent<DataTreeGridColumnResizeHandleProps<DataTableColumnID<LeafCells, GroupCells>>, DataTreeGridColumnResizeHandleSlotProps<LeafCells, GroupCells>>;
|
|
216
|
+
readonly Body: TabularBodyComponent<DataTreeGridBodyProps, DataTreeGridRootSlotProps<LeafCells, GroupCells>, DataTreeGridBodySlotProps<LeafCells, GroupCells>>;
|
|
217
|
+
readonly Row: TabularComponent<DataTreeGridRowProps, DataTreeGridRowSlotProps<LeafCells, GroupCells>>;
|
|
218
|
+
readonly RowDisclosure: TabularComponent<DataTreeGridRowDisclosureProps, DataTreeGridRowDisclosureSlotProps<LeafCells, GroupCells>>;
|
|
219
|
+
readonly RowSelectionControl: TabularComponent<DataTreeGridRowSelectionControlProps, DataTreeGridRowSelectionControlSlotProps<LeafCells, GroupCells>>;
|
|
220
|
+
readonly BulkSelectionControl: TabularComponent<DataTreeGridBulkSelectionControlProps, DataTreeGridBulkSelectionControlSlotProps<LeafCells, GroupCells>>;
|
|
221
|
+
readonly Cell: TabularComponent<DataTreeGridCellProps<DataTableColumnID<LeafCells, GroupCells>>, DataTreeGridCellSlotProps<LeafCells, GroupCells>>;
|
|
222
|
+
readonly Editor: TabularComponent<DataTreeGridEditorProps<DataTableColumnID<LeafCells, GroupCells>>, DataTreeGridEditorSlotProps<LeafCells, GroupCells>>;
|
|
223
|
+
}
|
|
224
|
+
export declare function createDataTreeGridComponents<LeafCells extends object, GroupCells extends object>(controller: DataTreeGridController<LeafCells, GroupCells>): DataTreeGridComponents<LeafCells, GroupCells>;
|
|
225
|
+
export type { DataTreeGridCursorState, DataTreeGridEditState, DataTreeGridEvent, DataTreeGridExpansionState, DataTreeGridProjection, DataTreeGridState, DataTreeGridUpdate, SemanticDataTreeGridController };
|