@dcs-tech/ui 0.10.0 → 0.11.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/CHANGELOG.md +362 -0
- package/README.md +3 -2
- package/THIRD_PARTY_NOTICES.md +23 -0
- package/dist/ChartImageMenu-sB2QNQzd.js +9673 -0
- package/dist/ChartView-BstZkP1g.js +1942 -0
- package/dist/{SummaryChart-i6fOdrDM.js → SummaryChart-B5ibDNOZ.js} +11 -10
- package/dist/{SummaryImage-CCt5ozD9.js → SummaryImage-CRP7X2Nl.js} +2 -2
- package/dist/SummarySeeAll-CtYRGV4G.js +101 -0
- package/dist/assets/fileTask.worker-D97s2vRV.js +1 -0
- package/dist/{columnValue-74XDBcVF.js → columnValue-BOn9NC8X.js} +86 -79
- package/dist/exportContext-CMzuzRjc.js +274 -0
- package/dist/{exportEngine-BmDly7iw.js → exportEngine-CYDN8Ty-.js} +167 -137
- package/dist/file-worker.js +1 -1
- package/dist/{fileActions-CFNO14Aj.js → fileActions-DkPEWE-t.js} +1 -1
- package/dist/{geometry-DG134nYI.js → geometry-CFS5If1N.js} +769 -466
- package/dist/index.js +21095 -12669
- package/dist/{labels-BPItSeRU.js → labels-mukFhYkc.js} +124 -1
- package/dist/{runFileTask-BIZTFnZP.js → runFileTask-DI_39TjR.js} +17 -0
- package/dist/scrollArea-B52kugL1.js +291 -0
- package/dist/style.css +1 -1
- package/dist/{summaryChartData-BiQYJbYZ.js → summaryChartData-D15kw64n.js} +6 -5
- package/dist/types/components/Charts/BarList.d.ts +4 -3
- package/dist/types/components/Charts/CalendarHeatmap.d.ts +4 -2
- package/dist/types/components/Charts/Chart.d.ts +3 -2
- package/dist/types/components/Charts/ChartView.d.ts +3 -2
- package/dist/types/components/Charts/ColumnChart.d.ts +4 -3
- package/dist/types/components/Charts/Donut.d.ts +3 -2
- package/dist/types/components/Charts/Funnel.d.ts +3 -2
- package/dist/types/components/Charts/Gauge.d.ts +3 -2
- package/dist/types/components/Charts/LineChart.d.ts +4 -3
- package/dist/types/components/Charts/NumberTrend.d.ts +4 -3
- package/dist/types/components/Charts/Progress.d.ts +3 -2
- package/dist/types/components/Charts/StackedBar.d.ts +3 -2
- package/dist/types/components/Charts/Treemap.d.ts +3 -2
- package/dist/types/components/Charts/chartData.d.ts +6 -0
- package/dist/types/components/Charts/chartImage.d.ts +2 -0
- package/dist/types/components/Charts/geometry.d.ts +3 -0
- package/dist/types/components/Charts/index.d.ts +2 -0
- package/dist/types/components/Charts/palette.d.ts +1 -0
- package/dist/types/components/Charts/parts.d.ts +14 -0
- package/dist/types/components/Charts/useChartMotion.d.ts +8 -0
- package/dist/types/components/DataTable/DataTable.d.ts +3 -1
- package/dist/types/components/DataTable/DisplayPopover.d.ts +1 -0
- package/dist/types/components/DataTable/HeaderMenu.d.ts +1 -0
- package/dist/types/components/DataTable/TableColumnModal.d.ts +4 -1
- package/dist/types/components/DataTable/TableToolbar.d.ts +20 -1
- package/dist/types/components/DataTable/TableView.d.ts +18 -2
- package/dist/types/components/DataTable/cards/CardView.d.ts +25 -5
- package/dist/types/components/DataTable/cards/rowParts.d.ts +1 -0
- package/dist/types/components/DataTable/cellSelection/CellRangeBar.d.ts +16 -0
- package/dist/types/components/DataTable/cellSelection/cellRangeStore.d.ts +18 -0
- package/dist/types/components/DataTable/cellSelection/paintRanges.d.ts +2 -0
- package/dist/types/components/DataTable/cellSelection/useCellSelection.d.ts +63 -0
- package/dist/types/components/DataTable/data/listDelta.d.ts +27 -0
- package/dist/types/components/DataTable/data/rowLineage.d.ts +3 -0
- package/dist/types/components/DataTable/data/rowModels.d.ts +9 -0
- package/dist/types/components/DataTable/data/rowTransaction.d.ts +9 -0
- package/dist/types/components/DataTable/data/useServerData.d.ts +3 -1
- package/dist/types/components/DataTable/export/exportCells.d.ts +5 -2
- package/dist/types/components/DataTable/export/exportEngine.d.ts +7 -2
- package/dist/types/components/DataTable/export/useTableExport.d.ts +17 -1
- package/dist/types/components/DataTable/filters/filterRowModel.d.ts +1 -0
- package/dist/types/components/DataTable/grouping/groupModel.d.ts +11 -0
- package/dist/types/components/DataTable/index.d.ts +1 -1
- package/dist/types/components/DataTable/keyboard/ShortcutsDialog.d.ts +4 -1
- package/dist/types/components/DataTable/keyboard/useGridKeyboard.d.ts +8 -0
- package/dist/types/components/DataTable/labels.d.ts +128 -0
- package/dist/types/components/DataTable/layout/LayoutSwitcher.d.ts +10 -2
- package/dist/types/components/DataTable/layout/useFitWidths.d.ts +7 -0
- package/dist/types/components/DataTable/menu/RowMenu.d.ts +1 -0
- package/dist/types/components/DataTable/menu/buildRowMenu.d.ts +6 -3
- package/dist/types/components/DataTable/motion/RowChangeNotice.d.ts +19 -0
- package/dist/types/components/DataTable/motion/rowChanges.d.ts +25 -0
- package/dist/types/components/DataTable/motion/useNoticeInsets.d.ts +2 -0
- package/dist/types/components/DataTable/motion/useRowChangeNotices.d.ts +35 -0
- package/dist/types/components/DataTable/motion/useRowMotion.d.ts +29 -3
- package/dist/types/components/DataTable/persistence/reconcile.d.ts +4 -0
- package/dist/types/components/DataTable/persistence/useColumnPersistence.d.ts +5 -1
- package/dist/types/components/DataTable/pivot/PivotPanel.d.ts +11 -0
- package/dist/types/components/DataTable/pivot/PivotView.d.ts +22 -0
- package/dist/types/components/DataTable/pivot/pivotModel.d.ts +54 -0
- package/dist/types/components/DataTable/pivot/usePivot.d.ts +44 -0
- package/dist/types/components/DataTable/rows/PressRow.d.ts +1 -0
- package/dist/types/components/DataTable/rows/RowLead.d.ts +23 -0
- package/dist/types/components/DataTable/rows/rowPress.d.ts +2 -0
- package/dist/types/components/DataTable/rows/usePinnedRows.d.ts +34 -0
- package/dist/types/components/DataTable/rows/useRowDrag.d.ts +44 -0
- package/dist/types/components/DataTable/split/SplitView.d.ts +4 -2
- package/dist/types/components/DataTable/summary/SummaryChart.d.ts +2 -1
- package/dist/types/components/DataTable/summary/TableSummary.d.ts +2 -1
- package/dist/types/components/DataTable/summary/summaryModel.d.ts +28 -6
- package/dist/types/components/DataTable/summary/useTableSummary.d.ts +3 -0
- package/dist/types/components/DataTable/toolbar/ToolbarMore.d.ts +14 -0
- package/dist/types/components/DataTable/toolbar/useToolbarFit.d.ts +10 -0
- package/dist/types/components/DataTable/tree/TreeChips.d.ts +5 -0
- package/dist/types/components/DataTable/tree/treeExport.d.ts +54 -0
- package/dist/types/components/DataTable/tree/treeMove.d.ts +1 -0
- package/dist/types/components/DataTable/tree/useTreeChildren.d.ts +15 -0
- package/dist/types/components/DataTable/tree/useTreeData.d.ts +60 -0
- package/dist/types/components/DataTable/types.d.ts +272 -4
- package/dist/types/components/DataTable/useDataChangeTracker.d.ts +11 -4
- package/dist/types/components/DataTable/useTable.d.ts +13 -1
- package/dist/types/components/DataTable/virtual/useVirtualLines.d.ts +1 -0
- package/dist/types/components/EventCalendar/EventCalendar.d.ts +46 -0
- package/dist/types/components/EventCalendar/eventParts.d.ts +10 -0
- package/dist/types/components/EventCalendar/index.d.ts +3 -0
- package/dist/types/components/EventCalendar/useCalendarEdit.d.ts +40 -0
- package/dist/types/components/Icon/Icon.d.ts +36 -0
- package/dist/types/components/Icon/Icon.storyData.d.ts +6 -0
- package/dist/types/components/Icon/IconContext.d.ts +7 -0
- package/dist/types/components/Icon/icons.d.ts +223 -0
- package/dist/types/components/Icon/index.d.ts +7 -0
- package/dist/types/components/Icon/useIconDone.d.ts +5 -0
- package/dist/types/components/Popover/Popover.d.ts +1 -0
- package/dist/types/components/Popover/floatingPosition.d.ts +22 -2
- package/dist/types/components/ReorderList/ReorderList.d.ts +2 -1
- package/dist/types/components/Scroll/ui.d.ts +1 -0
- package/dist/types/components/SlidingHighlight/index.d.ts +2 -0
- package/dist/types/components/SlidingHighlight/useSlidingHighlight.d.ts +20 -0
- package/dist/types/components/Suggest/SuggestionList.d.ts +1 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +34 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +2 -0
- package/dist/types/core/hooks/index.d.ts +1 -1
- package/dist/types/core/hooks/usePresence.d.ts +1 -0
- package/dist/types/core/icons/actions.icons.d.ts +37 -0
- package/dist/types/core/icons/commerce.icons.d.ts +16 -0
- package/dist/types/core/icons/communication.icons.d.ts +10 -0
- package/dist/types/core/icons/delivery.icons.d.ts +13 -0
- package/dist/types/core/icons/devices.icons.d.ts +16 -0
- package/dist/types/core/icons/files.icons.d.ts +13 -0
- package/dist/types/core/icons/general.icons.d.ts +24 -0
- package/dist/types/core/icons/index.d.ts +14 -0
- package/dist/types/core/icons/media.icons.d.ts +11 -0
- package/dist/types/core/icons/navigation.icons.d.ts +25 -0
- package/dist/types/core/icons/people.icons.d.ts +13 -0
- package/dist/types/core/icons/registry.d.ts +2 -0
- package/dist/types/core/icons/state.icons.d.ts +14 -0
- package/dist/types/core/icons/status.icons.d.ts +10 -0
- package/dist/types/core/icons/table.icons.d.ts +22 -0
- package/dist/types/core/icons/text.icons.d.ts +13 -0
- package/dist/types/core/logic/cellRange.logic.d.ts +66 -0
- package/dist/types/core/logic/cellTouch.logic.d.ts +16 -0
- package/dist/types/core/logic/columnGroups.logic.d.ts +31 -0
- package/dist/types/core/logic/dropdownSide.logic.d.ts +19 -0
- package/dist/types/core/logic/eventCalendar.logic.d.ts +225 -0
- package/dist/types/core/logic/fitColumns.logic.d.ts +7 -0
- package/dist/types/core/logic/icon.logic.d.ts +24 -0
- package/dist/types/core/logic/index.d.ts +16 -0
- package/dist/types/core/logic/pivot.logic.d.ts +100 -0
- package/dist/types/core/logic/rowActions.logic.d.ts +7 -0
- package/dist/types/core/logic/rowDrag.logic.d.ts +36 -0
- package/dist/types/core/logic/rowPinning.logic.d.ts +12 -0
- package/dist/types/core/logic/slidingHighlight.logic.d.ts +20 -0
- package/dist/types/core/logic/toolbarOverflow.logic.d.ts +21 -0
- package/dist/types/core/logic/treeData.logic.d.ts +44 -0
- package/dist/types/core/logic/treeDrag.logic.d.ts +63 -0
- package/dist/types/core/logic/tween.logic.d.ts +33 -0
- package/dist/types/core/logic/visualViewport.logic.d.ts +13 -0
- package/dist/types/core/types/eventCalendar.types.d.ts +18 -0
- package/dist/types/core/types/fileEngine.types.d.ts +6 -0
- package/dist/types/core/types/icon.types.d.ts +109 -0
- package/dist/types/core/types/index.d.ts +2 -0
- package/dist/types/index.d.ts +7 -0
- package/package.json +4 -4
- package/dist/ChartImageMenu-3OfqNFyt.js +0 -1510
- package/dist/ChartView-n4G5_2ro.js +0 -1707
- package/dist/SummarySeeAll-BY8knsRe.js +0 -101
- package/dist/assets/fileTask.worker--Q3rI3Bn.js +0 -1
- package/dist/exportContext-C52ZuHd8.js +0 -166
- package/dist/scrollArea-D84Cwm4o.js +0 -310
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type TreeExpansion, type TreeIndex } from '../../../core/logic';
|
|
2
|
+
import { type ColumnTextContext } from '../columnValue';
|
|
3
|
+
import type { DisplayItem } from '../grouping/groupModel';
|
|
4
|
+
import type { DataTableColumn, DataTableFilterGroup, DataTableTreeDataConfig } from '../types';
|
|
5
|
+
export interface TreeConfig<T> {
|
|
6
|
+
getChildren?: (row: T) => T[] | null | undefined;
|
|
7
|
+
parentField?: string;
|
|
8
|
+
defaultExpanded: boolean | number;
|
|
9
|
+
filterMode: 'ancestors' | 'matches';
|
|
10
|
+
totals: 'leaves' | 'all';
|
|
11
|
+
selectChildren: boolean;
|
|
12
|
+
exportLevel: 'column' | 'indent';
|
|
13
|
+
hasChildren?: (row: T) => boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function resolveTreeConfig<T>(cfg: DataTableTreeDataConfig<T> | undefined, rowKey: string | undefined): TreeConfig<T> | null;
|
|
16
|
+
export declare function createTreeRowSearch<T>(columns: DataTableColumn<T>[], ctx: ColumnTextContext): (row: T, value: string) => boolean;
|
|
17
|
+
export interface TreeMoved<T> {
|
|
18
|
+
rows: T[];
|
|
19
|
+
nodes: T[];
|
|
20
|
+
parentOf: ReadonlyMap<string, string | null>;
|
|
21
|
+
}
|
|
22
|
+
export declare function useTreeSource<T>(opts: {
|
|
23
|
+
config: TreeConfig<T> | null;
|
|
24
|
+
rows: T[];
|
|
25
|
+
rowKey: string | undefined;
|
|
26
|
+
serverMode: boolean;
|
|
27
|
+
columns: DataTableColumn<T>[];
|
|
28
|
+
text: ColumnTextContext;
|
|
29
|
+
viewId: string;
|
|
30
|
+
extraParents?: ReadonlyMap<string, string>;
|
|
31
|
+
moved?: TreeMoved<T> | null;
|
|
32
|
+
}): {
|
|
33
|
+
on: boolean;
|
|
34
|
+
index: TreeIndex<T> | null;
|
|
35
|
+
idOf: (r: T) => string;
|
|
36
|
+
nodes: T[];
|
|
37
|
+
treeFilter: ((data: T[], group: DataTableFilterGroup, value: string) => T[]) | undefined;
|
|
38
|
+
openForMatches: () => ReadonlySet<string>;
|
|
39
|
+
flatMatches: () => boolean;
|
|
40
|
+
expansion: TreeExpansion;
|
|
41
|
+
toggle: (id: string, shownOpen: boolean) => void;
|
|
42
|
+
open: (id: string) => void;
|
|
43
|
+
expandAll: () => void;
|
|
44
|
+
collapseAll: () => void;
|
|
45
|
+
reopenMatches: () => void;
|
|
46
|
+
descendants: (id: string) => string[];
|
|
47
|
+
};
|
|
48
|
+
export type TreeSource<T> = ReturnType<typeof useTreeSource<T>>;
|
|
49
|
+
export declare function useTreeLines<R extends {
|
|
50
|
+
id: string;
|
|
51
|
+
}>(tree: TreeSource<any>, rows: R[] | null, opts: {
|
|
52
|
+
status?: (id: string) => 'loading' | 'error' | 'done' | undefined;
|
|
53
|
+
canLoad?: (row: R) => boolean;
|
|
54
|
+
}): {
|
|
55
|
+
lines: DisplayItem[] | null;
|
|
56
|
+
ordered: () => {
|
|
57
|
+
row: R;
|
|
58
|
+
depth: number;
|
|
59
|
+
}[] | null;
|
|
60
|
+
};
|
|
@@ -2,7 +2,17 @@ import { type ComponentType, type ReactNode } from 'react';
|
|
|
2
2
|
import type { ChartProgressColor, ChartSlot, TrendGood } from '../Charts';
|
|
3
3
|
import type { DataTableLabels } from './labels';
|
|
4
4
|
import type { DateDisplayFormat } from '../../core/types';
|
|
5
|
-
export type DataTableFlashColor = 'green' | 'red' | 'amber' | 'blue' | 'purple' | 'teal' | 'orange' | 'pink';
|
|
5
|
+
export type DataTableFlashColor = 'green' | 'red' | 'amber' | 'blue' | 'purple' | 'teal' | 'orange' | 'pink' | (string & {});
|
|
6
|
+
export interface DataTableRowChanges {
|
|
7
|
+
addedColor?: DataTableFlashColor;
|
|
8
|
+
removedColor?: DataTableFlashColor;
|
|
9
|
+
addedDuration?: number;
|
|
10
|
+
removedDuration?: number;
|
|
11
|
+
maxAnimated?: number;
|
|
12
|
+
outOfView?: boolean;
|
|
13
|
+
announce?: boolean;
|
|
14
|
+
pauseControl?: boolean;
|
|
15
|
+
}
|
|
6
16
|
export interface DataTableFlashColors {
|
|
7
17
|
up?: DataTableFlashColor;
|
|
8
18
|
down?: DataTableFlashColor;
|
|
@@ -65,8 +75,14 @@ export interface DataTableColumn<TData = any> {
|
|
|
65
75
|
groupValue?: (value: any, row: TData) => string | number | boolean | null;
|
|
66
76
|
field?: string;
|
|
67
77
|
groupable?: boolean;
|
|
78
|
+
pivotable?: boolean;
|
|
79
|
+
aggregatable?: boolean | string[];
|
|
68
80
|
authorized?: boolean;
|
|
69
81
|
license?: DataTableLicense;
|
|
82
|
+
dataOnly?: boolean;
|
|
83
|
+
flash?: boolean;
|
|
84
|
+
flashDirection?: (next: unknown, previous: unknown, row: TData) => 'up' | 'down' | 'changed' | null;
|
|
85
|
+
flashDuration?: number;
|
|
70
86
|
flashStyle?: DataTableCellFlashStyle;
|
|
71
87
|
flashBadge?: boolean;
|
|
72
88
|
flashColors?: DataTableFlashColors;
|
|
@@ -76,6 +92,140 @@ export interface DataTableColumn<TData = any> {
|
|
|
76
92
|
exportHeader?: string;
|
|
77
93
|
exportable?: boolean;
|
|
78
94
|
}
|
|
95
|
+
export interface DataTableColumnGroup {
|
|
96
|
+
id: string;
|
|
97
|
+
header: string;
|
|
98
|
+
children: Array<string | DataTableColumnGroup>;
|
|
99
|
+
keepTogether?: boolean;
|
|
100
|
+
align?: 'left' | 'center' | 'right';
|
|
101
|
+
exportHeader?: string;
|
|
102
|
+
}
|
|
103
|
+
export type DataTableRowPinSide = 'top' | 'bottom';
|
|
104
|
+
export interface DataTableRowPinningConfig {
|
|
105
|
+
menu?: boolean;
|
|
106
|
+
keepInPlace?: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface DataTableRowPins {
|
|
109
|
+
top: string[];
|
|
110
|
+
bottom: string[];
|
|
111
|
+
}
|
|
112
|
+
export type DataTableCellRangeFigure = 'count' | 'sum' | 'avg' | 'min' | 'max';
|
|
113
|
+
export interface DataTableCellRange {
|
|
114
|
+
startRowId: string;
|
|
115
|
+
endRowId: string;
|
|
116
|
+
startColumn: string;
|
|
117
|
+
endColumn: string;
|
|
118
|
+
columns: string[];
|
|
119
|
+
rowIds: string[];
|
|
120
|
+
}
|
|
121
|
+
export interface DataTableCellPaste<TData = any> {
|
|
122
|
+
rowId: string;
|
|
123
|
+
row: TData;
|
|
124
|
+
columnKey: string;
|
|
125
|
+
value: string;
|
|
126
|
+
}
|
|
127
|
+
export interface DataTableCellSelectionConfig<TData = any> {
|
|
128
|
+
multiRange?: boolean;
|
|
129
|
+
copyHeaders?: boolean;
|
|
130
|
+
statusBar?: boolean | DataTableCellRangeFigure[];
|
|
131
|
+
onCellRangesChange?: (ranges: DataTableCellRange[]) => void;
|
|
132
|
+
onCellsPaste?: (event: {
|
|
133
|
+
cells: DataTableCellPaste<TData>[];
|
|
134
|
+
}) => void;
|
|
135
|
+
}
|
|
136
|
+
export interface DataTableRowDragConfig<TData = any> {
|
|
137
|
+
managed?: boolean;
|
|
138
|
+
canDrag?: (row: TData) => boolean;
|
|
139
|
+
multiple?: boolean;
|
|
140
|
+
}
|
|
141
|
+
export interface DataTableRowOrderChange<TData = any> {
|
|
142
|
+
viewId: string;
|
|
143
|
+
row: TData;
|
|
144
|
+
moved: TData[];
|
|
145
|
+
from: number;
|
|
146
|
+
to: number;
|
|
147
|
+
rows: TData[];
|
|
148
|
+
before: TData | null;
|
|
149
|
+
managed: boolean;
|
|
150
|
+
parent?: TData | null;
|
|
151
|
+
parentKey?: string | null;
|
|
152
|
+
index?: number;
|
|
153
|
+
previousParent?: TData | null;
|
|
154
|
+
previousParentKey?: string | null;
|
|
155
|
+
previousIndex?: number;
|
|
156
|
+
}
|
|
157
|
+
export interface DataTableTreeDataConfig<TData = any> {
|
|
158
|
+
getChildren?: (row: TData) => TData[] | null | undefined;
|
|
159
|
+
parentField?: string;
|
|
160
|
+
defaultExpanded?: boolean | number;
|
|
161
|
+
filterMode?: 'ancestors' | 'matches';
|
|
162
|
+
totals?: 'leaves' | 'all';
|
|
163
|
+
selectChildren?: boolean;
|
|
164
|
+
exportLevel?: 'column' | 'indent';
|
|
165
|
+
hasChildren?: (row: TData) => boolean;
|
|
166
|
+
}
|
|
167
|
+
export type DataTablePivotAggregate = 'sum' | 'count' | 'avg' | 'min' | 'max' | 'first' | 'last';
|
|
168
|
+
export type DataTablePivotAggFn<TData = any> = (values: unknown[], rows: TData[]) => unknown;
|
|
169
|
+
export interface DataTablePivotAggregation<TData = any> {
|
|
170
|
+
label: string;
|
|
171
|
+
fn: DataTablePivotAggFn<TData>;
|
|
172
|
+
}
|
|
173
|
+
export interface DataTablePivotValue<TData = any> {
|
|
174
|
+
column: string;
|
|
175
|
+
agg: DataTablePivotAggregate | (string & {}) | DataTablePivotAggFn<TData>;
|
|
176
|
+
label?: string;
|
|
177
|
+
}
|
|
178
|
+
export interface DataTablePivotTotals {
|
|
179
|
+
rows?: boolean;
|
|
180
|
+
columns?: boolean;
|
|
181
|
+
grand?: boolean;
|
|
182
|
+
}
|
|
183
|
+
export interface DataTablePivotState {
|
|
184
|
+
enabled: boolean;
|
|
185
|
+
rows: string[];
|
|
186
|
+
columns: string[];
|
|
187
|
+
values: Array<{
|
|
188
|
+
column: string;
|
|
189
|
+
agg: string;
|
|
190
|
+
label?: string;
|
|
191
|
+
}>;
|
|
192
|
+
totals?: DataTablePivotTotals;
|
|
193
|
+
}
|
|
194
|
+
export interface DataTablePivotConfig<TData = any> {
|
|
195
|
+
enabled?: boolean;
|
|
196
|
+
rows?: string[];
|
|
197
|
+
columns?: string[];
|
|
198
|
+
values?: DataTablePivotValue<TData>[];
|
|
199
|
+
totals?: DataTablePivotTotals;
|
|
200
|
+
maxColumns?: number;
|
|
201
|
+
aggregations?: Record<string, DataTablePivotAggregation<TData>>;
|
|
202
|
+
panel?: boolean;
|
|
203
|
+
}
|
|
204
|
+
export interface DataTablePivotRequest {
|
|
205
|
+
rows: Array<{
|
|
206
|
+
key: string;
|
|
207
|
+
field: string;
|
|
208
|
+
}>;
|
|
209
|
+
columns: Array<{
|
|
210
|
+
key: string;
|
|
211
|
+
field: string;
|
|
212
|
+
}>;
|
|
213
|
+
values: Array<{
|
|
214
|
+
key: string;
|
|
215
|
+
field: string;
|
|
216
|
+
agg: string;
|
|
217
|
+
}>;
|
|
218
|
+
totals: Required<DataTablePivotTotals>;
|
|
219
|
+
}
|
|
220
|
+
export type DataTablePivotKey = string | number | boolean | null;
|
|
221
|
+
export interface DataTablePivotCell {
|
|
222
|
+
row: DataTablePivotKey[];
|
|
223
|
+
column: DataTablePivotKey[];
|
|
224
|
+
values: unknown[];
|
|
225
|
+
}
|
|
226
|
+
export interface DataTablePivotResult {
|
|
227
|
+
cells: DataTablePivotCell[];
|
|
228
|
+
}
|
|
79
229
|
export interface DataTableFilterCondition {
|
|
80
230
|
id: string;
|
|
81
231
|
column: string;
|
|
@@ -129,6 +279,27 @@ export interface DataTableSummarySubline<TData = any> {
|
|
|
129
279
|
value: DataTableSummaryFigure<TData>;
|
|
130
280
|
text?: (formatted: string) => string;
|
|
131
281
|
}
|
|
282
|
+
export interface DataTableSummaryValueFigure<TData = any> {
|
|
283
|
+
label: string;
|
|
284
|
+
value: DataTableSummaryFigure<TData>;
|
|
285
|
+
text?: (formatted: string) => string;
|
|
286
|
+
}
|
|
287
|
+
export interface DataTableSummarySum<TData = any> {
|
|
288
|
+
id: string;
|
|
289
|
+
label: string;
|
|
290
|
+
value?: (row: TData) => number;
|
|
291
|
+
format?: (n: number) => string;
|
|
292
|
+
}
|
|
293
|
+
export interface DataTableSummaryRowFilter<TData = any> {
|
|
294
|
+
id: string;
|
|
295
|
+
test?: (row: TData) => boolean;
|
|
296
|
+
condition?: Pick<DataTableFilterCondition, 'column' | 'operator' | 'value'>;
|
|
297
|
+
}
|
|
298
|
+
export interface DataTableSummaryRange {
|
|
299
|
+
from?: string;
|
|
300
|
+
to?: string;
|
|
301
|
+
}
|
|
302
|
+
export type DataTableSummaryCardHeight = 'fixed' | 'content';
|
|
132
303
|
export type DataTableSummaryChart = 'donut' | 'pie' | 'bars' | 'stacked' | 'treemap';
|
|
133
304
|
export type DataTableSummaryTrendChart = 'columns' | 'line' | 'area' | 'grouped' | 'stacked' | 'calendar';
|
|
134
305
|
export type DataTableSummaryValueChart = 'number' | 'numberTrend';
|
|
@@ -178,8 +349,10 @@ export interface DataTableSummaryValueCard<TData = any> extends DataTableSummary
|
|
|
178
349
|
kind: 'value';
|
|
179
350
|
value: DataTableSummaryFigure<TData>;
|
|
180
351
|
sub?: DataTableSummarySubline<TData>;
|
|
352
|
+
figures?: DataTableSummaryValueFigure<TData>[];
|
|
181
353
|
chart?: DataTableSummaryValueChart;
|
|
182
354
|
trend?: DataTableSummaryValueTrend;
|
|
355
|
+
height?: DataTableSummaryCardHeight;
|
|
183
356
|
}
|
|
184
357
|
export interface DataTableSummaryRatioCard<TData = any> extends DataTableSummaryCardBase {
|
|
185
358
|
kind: 'ratio';
|
|
@@ -188,16 +361,19 @@ export interface DataTableSummaryRatioCard<TData = any> extends DataTableSummary
|
|
|
188
361
|
color?: ChartProgressColor;
|
|
189
362
|
sub?: DataTableSummarySubline<TData>;
|
|
190
363
|
chart?: DataTableSummaryRatioChart;
|
|
364
|
+
height?: DataTableSummaryCardHeight;
|
|
191
365
|
}
|
|
192
|
-
export interface DataTableSummaryBreakdownCard extends DataTableSummaryCardBase {
|
|
366
|
+
export interface DataTableSummaryBreakdownCard<TData = any> extends DataTableSummaryCardBase {
|
|
193
367
|
kind: 'breakdown';
|
|
194
368
|
column: string;
|
|
195
369
|
chart?: DataTableSummaryChart;
|
|
196
370
|
show?: DataTableSummaryShow;
|
|
197
371
|
slots?: Record<string, ChartSlot>;
|
|
198
372
|
within?: string;
|
|
373
|
+
sum?: DataTableSummarySum<TData>;
|
|
374
|
+
where?: DataTableSummaryRowFilter<TData>;
|
|
199
375
|
}
|
|
200
|
-
export interface DataTableSummaryTrendCard extends DataTableSummaryCardBase {
|
|
376
|
+
export interface DataTableSummaryTrendCard<TData = any> extends DataTableSummaryCardBase {
|
|
201
377
|
kind: 'trend';
|
|
202
378
|
column: string;
|
|
203
379
|
period: DataTableSummaryPeriod;
|
|
@@ -206,6 +382,9 @@ export interface DataTableSummaryTrendCard extends DataTableSummaryCardBase {
|
|
|
206
382
|
chart?: DataTableSummaryTrendChart;
|
|
207
383
|
split?: string;
|
|
208
384
|
slots?: Record<string, ChartSlot>;
|
|
385
|
+
sum?: DataTableSummarySum<TData>;
|
|
386
|
+
where?: DataTableSummaryRowFilter<TData>;
|
|
387
|
+
range?: DataTableSummaryRange | ((ctx: DataTableSummaryCardContext<any>) => DataTableSummaryRange | null | undefined);
|
|
209
388
|
}
|
|
210
389
|
export interface DataTableSummaryFunnelStep<TData = any> {
|
|
211
390
|
id: string;
|
|
@@ -213,6 +392,8 @@ export interface DataTableSummaryFunnelStep<TData = any> {
|
|
|
213
392
|
value: DataTableSummaryFigure<TData>;
|
|
214
393
|
condition?: Pick<DataTableFilterCondition, 'column' | 'operator' | 'value'>;
|
|
215
394
|
slot?: ChartSlot;
|
|
395
|
+
showWhen?: (ctx: DataTableSummaryCardContext<any>) => boolean;
|
|
396
|
+
hideAtZero?: boolean;
|
|
216
397
|
}
|
|
217
398
|
export interface DataTableSummaryFunnelCard<TData = any> extends DataTableSummaryCardBase {
|
|
218
399
|
kind: 'funnel';
|
|
@@ -220,9 +401,10 @@ export interface DataTableSummaryFunnelCard<TData = any> extends DataTableSummar
|
|
|
220
401
|
chart?: 'funnel' | 'bars';
|
|
221
402
|
showChange?: boolean;
|
|
222
403
|
}
|
|
223
|
-
export type DataTableSummaryCard<TData = any> = DataTableSummaryValueCard<TData> | DataTableSummaryRatioCard<TData> | DataTableSummaryBreakdownCard | DataTableSummaryTrendCard | DataTableSummaryFunnelCard<TData>;
|
|
404
|
+
export type DataTableSummaryCard<TData = any> = DataTableSummaryValueCard<TData> | DataTableSummaryRatioCard<TData> | DataTableSummaryBreakdownCard<TData> | DataTableSummaryTrendCard<TData> | DataTableSummaryFunnelCard<TData>;
|
|
224
405
|
export interface DataTableSummaryConfig<TData = any> {
|
|
225
406
|
cards: DataTableSummaryCard<TData>[];
|
|
407
|
+
animate?: boolean;
|
|
226
408
|
}
|
|
227
409
|
export declare const SUMMARY_TREND_COUNTS: {
|
|
228
410
|
readonly month: readonly [3, 6, 12, 24, 36];
|
|
@@ -272,6 +454,8 @@ export type DataTableSummaryCardRequest = {
|
|
|
272
454
|
field: string;
|
|
273
455
|
part: DataTableSummaryPart;
|
|
274
456
|
within?: string;
|
|
457
|
+
sum?: string;
|
|
458
|
+
where?: string;
|
|
275
459
|
} | {
|
|
276
460
|
key: string;
|
|
277
461
|
id: string;
|
|
@@ -280,6 +464,10 @@ export type DataTableSummaryCardRequest = {
|
|
|
280
464
|
period: DataTableSummaryPeriod;
|
|
281
465
|
count: number;
|
|
282
466
|
split?: string;
|
|
467
|
+
sum?: string;
|
|
468
|
+
where?: string;
|
|
469
|
+
from?: string;
|
|
470
|
+
to?: string;
|
|
283
471
|
} | {
|
|
284
472
|
key: string;
|
|
285
473
|
id: string;
|
|
@@ -497,6 +685,7 @@ export interface DataTableToolbarAction {
|
|
|
497
685
|
display?: 'icon' | 'label' | 'icon-label';
|
|
498
686
|
tooltip?: string;
|
|
499
687
|
disabled?: boolean;
|
|
688
|
+
priority?: number;
|
|
500
689
|
authorize?: () => boolean;
|
|
501
690
|
onClick: () => void;
|
|
502
691
|
}
|
|
@@ -646,6 +835,7 @@ export interface DataTableExportMetadata {
|
|
|
646
835
|
selectedRows: number;
|
|
647
836
|
labels?: Partial<DataTableLabels>;
|
|
648
837
|
locale?: string;
|
|
838
|
+
notes?: string[];
|
|
649
839
|
}
|
|
650
840
|
export type DataTableExportFormat = 'csv' | 'xlsx' | 'json' | 'pdf' | 'html' | 'xml';
|
|
651
841
|
export type DataTableExportAction = 'download' | 'share' | 'preview' | 'print';
|
|
@@ -792,6 +982,10 @@ export interface DataTableExportTemplate<TData = any> {
|
|
|
792
982
|
};
|
|
793
983
|
onResult?: (data: TData[], meta: DataTableExportMeta) => DataTableExportResult | undefined;
|
|
794
984
|
license?: DataTableLicense;
|
|
985
|
+
headerGroups?: boolean;
|
|
986
|
+
csvGroupRows?: boolean;
|
|
987
|
+
treeLevel?: boolean;
|
|
988
|
+
pinnedRows?: boolean;
|
|
795
989
|
}
|
|
796
990
|
export type DataTableFileNameAs = 'title' | 'title-date' | 'title-generated' | 'title-date-generated';
|
|
797
991
|
export interface DataTableQuickExport<TData = any> {
|
|
@@ -804,6 +998,8 @@ export interface DataTableQuickExport<TData = any> {
|
|
|
804
998
|
summary?: (rows: TData[]) => Record<string, string | number>;
|
|
805
999
|
xlsx?: DataTableXlsxStyle;
|
|
806
1000
|
pdf?: DataTablePdfConfig;
|
|
1001
|
+
csvGroupRows?: boolean;
|
|
1002
|
+
pinnedRows?: boolean;
|
|
807
1003
|
generate?: Partial<Record<DataTableExportFormat, DataTableExportGenerator<TData>>>;
|
|
808
1004
|
}
|
|
809
1005
|
export interface DataTableExportConfig<TData = any> {
|
|
@@ -887,6 +1083,7 @@ export interface DataTableManagePrefs {
|
|
|
887
1083
|
export interface DataTableView<TData = any> {
|
|
888
1084
|
columns: DataTableColumn<TData>[];
|
|
889
1085
|
resolveColumns?: (data: TData[]) => DataTableColumn<TData>[];
|
|
1086
|
+
columnGroups?: DataTableColumnGroup[];
|
|
890
1087
|
id: string;
|
|
891
1088
|
renamed?: Record<string, string>;
|
|
892
1089
|
label?: string;
|
|
@@ -897,7 +1094,11 @@ export interface DataTableView<TData = any> {
|
|
|
897
1094
|
rowKey?: string;
|
|
898
1095
|
transform?: (data: any[]) => any[];
|
|
899
1096
|
animateRows?: boolean;
|
|
1097
|
+
rowChanges?: DataTableRowChanges;
|
|
1098
|
+
flash?: boolean;
|
|
900
1099
|
flashColors?: DataTableFlashColors;
|
|
1100
|
+
flashStyle?: DataTableCellFlashStyle;
|
|
1101
|
+
flashDuration?: number;
|
|
901
1102
|
HeaderComponent?: ComponentType<DataTableComponentProps<TData> & Record<string, any>>;
|
|
902
1103
|
FooterComponent?: ComponentType<DataTableComponentProps<TData> & Record<string, any>>;
|
|
903
1104
|
headerProps?: Record<string, any>;
|
|
@@ -921,6 +1122,11 @@ export interface DataTableView<TData = any> {
|
|
|
921
1122
|
toolbarActions?: DataTableToolbarAction[];
|
|
922
1123
|
hideBulkActions?: string[];
|
|
923
1124
|
pinning?: DataTablePinningConfig;
|
|
1125
|
+
rowPinning?: boolean | DataTableRowPinningConfig;
|
|
1126
|
+
cellSelection?: boolean | DataTableCellSelectionConfig<TData>;
|
|
1127
|
+
rowDrag?: boolean | DataTableRowDragConfig<TData>;
|
|
1128
|
+
treeData?: DataTableTreeDataConfig<TData>;
|
|
1129
|
+
pivot?: boolean | DataTablePivotConfig<TData>;
|
|
924
1130
|
devTools?: boolean;
|
|
925
1131
|
singleRowView?: DataTableSingleRowView;
|
|
926
1132
|
cardFields?: Partial<DataTableCardFields>;
|
|
@@ -959,6 +1165,10 @@ export interface DataTableProps<TData = any> {
|
|
|
959
1165
|
apiRef?: {
|
|
960
1166
|
current: DataTableApi<TData> | null;
|
|
961
1167
|
};
|
|
1168
|
+
pinnedRows?: {
|
|
1169
|
+
top?: TData[];
|
|
1170
|
+
bottom?: TData[];
|
|
1171
|
+
};
|
|
962
1172
|
bulkActions?: DataTableBulkAction<TData>[];
|
|
963
1173
|
labels?: Partial<DataTableLabels>;
|
|
964
1174
|
locale?: string;
|
|
@@ -966,6 +1176,11 @@ export interface DataTableProps<TData = any> {
|
|
|
966
1176
|
detailBar?: boolean;
|
|
967
1177
|
openRowId?: string | null;
|
|
968
1178
|
onOpenRowChange?: (id: string | null, row: TData | null) => void;
|
|
1179
|
+
onRowOrderChange?: (change: DataTableRowOrderChange<TData>) => void;
|
|
1180
|
+
pivot?: DataTablePivotState;
|
|
1181
|
+
onPivotChange?: (state: DataTablePivotState, ctx: {
|
|
1182
|
+
viewId: string;
|
|
1183
|
+
}) => void;
|
|
969
1184
|
shortcuts?: DataTableShortcut<TData>[];
|
|
970
1185
|
sharing?: DataTableSharing;
|
|
971
1186
|
renamedViews?: Record<string, string>;
|
|
@@ -994,6 +1209,13 @@ export interface DataTableAllRowsResult<TData = any> {
|
|
|
994
1209
|
rows: TData[];
|
|
995
1210
|
total?: number;
|
|
996
1211
|
capped?: boolean;
|
|
1212
|
+
tree?: boolean;
|
|
1213
|
+
}
|
|
1214
|
+
export interface DataTableExportTreeRequest {
|
|
1215
|
+
withChildren: true;
|
|
1216
|
+
rowKey: string;
|
|
1217
|
+
shape: 'nested' | 'flat';
|
|
1218
|
+
parentField?: string;
|
|
997
1219
|
}
|
|
998
1220
|
export interface DataTableCounts {
|
|
999
1221
|
views?: Record<string, number>;
|
|
@@ -1008,6 +1230,7 @@ export interface DataTableDataSource<TData = any> {
|
|
|
1008
1230
|
action: DataTableExportAction;
|
|
1009
1231
|
selection: DataTableSelection<TData>;
|
|
1010
1232
|
params?: Record<string, unknown>;
|
|
1233
|
+
tree?: DataTableExportTreeRequest;
|
|
1011
1234
|
}) => Promise<DataTableAllRowsResult<TData>>;
|
|
1012
1235
|
summaries?: (query: DataTableQuery, ctx: {
|
|
1013
1236
|
selection: DataTableSelection<TData>;
|
|
@@ -1026,6 +1249,14 @@ export interface DataTableDataSource<TData = any> {
|
|
|
1026
1249
|
}, ctx: {
|
|
1027
1250
|
signal: AbortSignal;
|
|
1028
1251
|
}) => Promise<DataTableGroupResult[]>;
|
|
1252
|
+
children?: (parent: TData, ctx: {
|
|
1253
|
+
query: DataTableQuery;
|
|
1254
|
+
signal: AbortSignal;
|
|
1255
|
+
}) => Promise<TData[]>;
|
|
1256
|
+
pivot?: (query: DataTableQuery, ctx: {
|
|
1257
|
+
request: DataTablePivotRequest;
|
|
1258
|
+
signal: AbortSignal;
|
|
1259
|
+
}) => Promise<DataTablePivotResult>;
|
|
1029
1260
|
operators?: readonly string[];
|
|
1030
1261
|
summaryBreakdownFields?: readonly string[];
|
|
1031
1262
|
subscribe?: (refetch: () => void) => () => void;
|
|
@@ -1044,12 +1275,44 @@ export interface DataTableInitialState {
|
|
|
1044
1275
|
pageIndex?: number;
|
|
1045
1276
|
pageSize?: number;
|
|
1046
1277
|
}
|
|
1278
|
+
export interface DataTableRowTransaction<TData = any> {
|
|
1279
|
+
add?: TData[];
|
|
1280
|
+
addAt?: 'start' | 'end';
|
|
1281
|
+
update?: Array<Partial<TData>>;
|
|
1282
|
+
remove?: Array<TData | string | number>;
|
|
1283
|
+
}
|
|
1284
|
+
export interface DataTableTransactionResult {
|
|
1285
|
+
added: string[];
|
|
1286
|
+
updated: string[];
|
|
1287
|
+
removed: string[];
|
|
1288
|
+
}
|
|
1289
|
+
export interface DataTableTransactionOptions {
|
|
1290
|
+
keepPlace?: boolean;
|
|
1291
|
+
}
|
|
1047
1292
|
export interface DataTableApi<TData = any> {
|
|
1293
|
+
applyTransaction: (transaction: DataTableRowTransaction<TData>, options?: DataTableTransactionOptions) => DataTableTransactionResult | null;
|
|
1294
|
+
applyTransactionAsync: (transaction: DataTableRowTransaction<TData>, options?: DataTableTransactionOptions) => void;
|
|
1295
|
+
scrollToRow: (id: string, options?: {
|
|
1296
|
+
flash?: boolean;
|
|
1297
|
+
}) => boolean;
|
|
1298
|
+
getRowPage: (id: string) => number | null;
|
|
1299
|
+
flashRows: (ids: string[]) => void;
|
|
1300
|
+
pauseUpdates: () => void;
|
|
1301
|
+
resumeUpdates: () => void;
|
|
1048
1302
|
refresh: () => void;
|
|
1049
1303
|
clearSelection: () => void;
|
|
1050
1304
|
getQuery: () => DataTableQuery;
|
|
1051
1305
|
getRows: () => TData[];
|
|
1052
1306
|
openRow: (id: string | null) => void;
|
|
1307
|
+
pinRow: (id: string, side: DataTableRowPinSide | null, row?: TData) => boolean;
|
|
1308
|
+
getPinnedRows: () => {
|
|
1309
|
+
top: TData[];
|
|
1310
|
+
bottom: TData[];
|
|
1311
|
+
};
|
|
1312
|
+
getCellRanges: () => DataTableCellRange[];
|
|
1313
|
+
clearCellRanges: () => void;
|
|
1314
|
+
getPivot: () => DataTablePivotState | null;
|
|
1315
|
+
setPivot: (state: DataTablePivotState | null) => void;
|
|
1053
1316
|
}
|
|
1054
1317
|
export interface DataTablePersistence {
|
|
1055
1318
|
load: (key: string) => Promise<Record<string, any> | null>;
|
|
@@ -1088,6 +1351,8 @@ export interface DataTableDisplayPrefs {
|
|
|
1088
1351
|
showActions: boolean;
|
|
1089
1352
|
actionDisplayMode: DataTableActionDisplay;
|
|
1090
1353
|
actionDisplayModeCard: DataTableActionDisplay;
|
|
1354
|
+
maxVisibleActions?: number;
|
|
1355
|
+
maxVisibleActionsCard?: number;
|
|
1091
1356
|
summaryTop: boolean;
|
|
1092
1357
|
summaryBottom: boolean;
|
|
1093
1358
|
}
|
|
@@ -1106,6 +1371,8 @@ export interface DataTableViewPrefs {
|
|
|
1106
1371
|
filterRow?: boolean;
|
|
1107
1372
|
grouping?: string[];
|
|
1108
1373
|
summary?: DataTableSummaryPrefs;
|
|
1374
|
+
pinnedRows?: DataTableRowPins;
|
|
1375
|
+
pivot?: DataTablePivotState;
|
|
1109
1376
|
}
|
|
1110
1377
|
export interface ContextMenuState {
|
|
1111
1378
|
visible: boolean;
|
|
@@ -1127,6 +1394,7 @@ export interface UseTableReturn<TData = any> {
|
|
|
1127
1394
|
clearAllFilters: () => void;
|
|
1128
1395
|
globalFilter: string;
|
|
1129
1396
|
setGlobalFilter: (value: string) => void;
|
|
1397
|
+
searchApplied: string;
|
|
1130
1398
|
sorting: Array<{
|
|
1131
1399
|
id: string;
|
|
1132
1400
|
desc: boolean;
|
|
@@ -2,10 +2,17 @@ import { type DataTableColumn, type DataTableView, type DataTableFlashColor } fr
|
|
|
2
2
|
export interface CellChange {
|
|
3
3
|
direction: 'up' | 'down' | 'changed';
|
|
4
4
|
newValue?: any;
|
|
5
|
+
seq: number;
|
|
6
|
+
duration: number;
|
|
5
7
|
}
|
|
6
|
-
export declare
|
|
8
|
+
export declare function flashCssColors(color: DataTableFlashColor): {
|
|
7
9
|
bg: string;
|
|
8
10
|
text: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function resolveFlashColor(change: CellChange, column: DataTableColumn, config: DataTableView): DataTableFlashColor;
|
|
11
|
-
export declare function
|
|
11
|
+
};
|
|
12
|
+
export declare function resolveFlashColor(change: Pick<CellChange, 'direction' | 'newValue'>, column: DataTableColumn, config: DataTableView): DataTableFlashColor;
|
|
13
|
+
export declare function changeDirection<T>(column: DataTableColumn<T>, next: unknown, previous: unknown, row: T): CellChange['direction'] | null;
|
|
14
|
+
export declare const FLASH_DURATION = 1500;
|
|
15
|
+
export declare function useDataChangeTracker(data: any[], rowKey: string | undefined, columns: DataTableColumn[], opts?: {
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
duration?: number;
|
|
18
|
+
}): ReadonlyMap<string, ReadonlyMap<string, CellChange>>;
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import type { UIFormat } from '../../core/types';
|
|
2
2
|
import { type ColumnTextContext } from './columnValue';
|
|
3
|
-
import { type
|
|
3
|
+
import { type ColumnDef } from '@tanstack/react-table';
|
|
4
|
+
import { type HeldRows } from './data/rowModels';
|
|
5
|
+
import { type DataTableView, type DataTableColumn, type DataTableFilterGroup, type UseTableReturn, type DataTableInitialState } from './types';
|
|
4
6
|
import { type DataTableLabels } from './labels';
|
|
7
|
+
export interface SearchText {
|
|
8
|
+
text: string;
|
|
9
|
+
folded: string;
|
|
10
|
+
ascii?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function searchText(text: string): SearchText;
|
|
13
|
+
export declare function rankText(cell: SearchText | string, value: string): import("@tanstack/match-sorter-utils").RankingInfo;
|
|
5
14
|
export declare function rowMatchesSearch<TData>(row: TData, columns: DataTableColumn<TData>[], search: string, ctx?: ColumnTextContext): boolean;
|
|
15
|
+
export declare function buildColumnDefs<TData>(columns: DataTableColumn<TData>[], ctx: ColumnTextContext, isDesc?: (columnId: string) => boolean): ColumnDef<TData, any>[];
|
|
6
16
|
export interface UseTableOptions {
|
|
7
17
|
serverMode?: boolean;
|
|
8
18
|
rowCount?: number;
|
|
@@ -12,5 +22,7 @@ export interface UseTableOptions {
|
|
|
12
22
|
labels?: DataTableLabels;
|
|
13
23
|
format?: UIFormat;
|
|
14
24
|
customPaging?: boolean;
|
|
25
|
+
heldRows?: HeldRows;
|
|
26
|
+
treeFilter?: (data: any[], filterGroup: DataTableFilterGroup, search: string) => any[];
|
|
15
27
|
}
|
|
16
28
|
export declare function useTable<TData = any>(data: TData[], config: DataTableView<TData>, options?: UseTableOptions): UseTableReturn<TData>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CalendarDateInput, CalendarEvent, CalendarEventChange, CalendarViewType } from '../../core/types';
|
|
3
|
+
import { type IsoDay } from '../../core/logic';
|
|
4
|
+
export interface EventCalendarRenderInfo {
|
|
5
|
+
place: 'grid' | 'time' | 'list';
|
|
6
|
+
allDay: boolean;
|
|
7
|
+
multiDay: boolean;
|
|
8
|
+
timeText: string;
|
|
9
|
+
continuesBefore: boolean;
|
|
10
|
+
continuesAfter: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface EventCalendarProps<T extends CalendarEvent = CalendarEvent> {
|
|
13
|
+
events: readonly T[];
|
|
14
|
+
view?: CalendarViewType;
|
|
15
|
+
defaultView?: CalendarViewType;
|
|
16
|
+
onViewChange?: (view: CalendarViewType) => void;
|
|
17
|
+
views?: readonly CalendarViewType[];
|
|
18
|
+
date?: CalendarDateInput;
|
|
19
|
+
defaultDate?: CalendarDateInput;
|
|
20
|
+
onDateChange?: (date: IsoDay) => void;
|
|
21
|
+
month?: CalendarDateInput;
|
|
22
|
+
defaultMonth?: CalendarDateInput;
|
|
23
|
+
onMonthChange?: (month: IsoDay) => void;
|
|
24
|
+
weekStart?: number;
|
|
25
|
+
maxEventRows?: number;
|
|
26
|
+
maxAllDayRows?: number;
|
|
27
|
+
fixedWeeks?: boolean;
|
|
28
|
+
slotMinutes?: number;
|
|
29
|
+
dayStartHour?: number;
|
|
30
|
+
dayEndHour?: number;
|
|
31
|
+
scrollToHour?: number;
|
|
32
|
+
today?: CalendarDateInput;
|
|
33
|
+
locale?: string;
|
|
34
|
+
onEventClick?: (event: T) => void;
|
|
35
|
+
onDayClick?: (day: IsoDay) => void;
|
|
36
|
+
onSlotClick?: (dateTime: string) => void;
|
|
37
|
+
editable?: boolean;
|
|
38
|
+
onEventChange?: (change: CalendarEventChange<T>) => void;
|
|
39
|
+
canChange?: (event: T, start: string, end: string | undefined, allDay: boolean) => boolean;
|
|
40
|
+
renderEvent?: (event: T, info: EventCalendarRenderInfo) => React.ReactNode;
|
|
41
|
+
className?: string;
|
|
42
|
+
style?: React.CSSProperties;
|
|
43
|
+
'aria-label'?: string;
|
|
44
|
+
}
|
|
45
|
+
declare function EventCalendar<T extends CalendarEvent = CalendarEvent>({ events, view: viewProp, defaultView, onViewChange, views, date: dateProp, defaultDate, onDateChange, month: monthProp, defaultMonth, onMonthChange, weekStart: weekStartProp, maxEventRows, maxAllDayRows, fixedWeeks, slotMinutes: slotProp, dayStartHour, dayEndHour, scrollToHour, today: todayProp, locale: localeProp, onEventClick, onDayClick, onSlotClick, editable: editableProp, onEventChange, canChange, renderEvent, className, style, 'aria-label': ariaLabel, }: EventCalendarProps<T>): React.ReactElement;
|
|
46
|
+
export default EventCalendar;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { CalendarEvent } from '../../core/types';
|
|
3
|
+
import { type EventCalendarText, type PlacedCalendarEvent } from '../../core/logic';
|
|
4
|
+
import type { UILabels } from '../UIProvider/UILabelsContext';
|
|
5
|
+
export declare const PREVIEW_KEY = "\0ec-preview";
|
|
6
|
+
export declare const colorStyle: (event: CalendarEvent) => React.CSSProperties;
|
|
7
|
+
export declare function eventWhen(item: PlacedCalendarEvent<CalendarEvent>, text: EventCalendarText, L: UILabels['eventCalendar']): string;
|
|
8
|
+
export declare function eventName(item: PlacedCalendarEvent<CalendarEvent>, text: EventCalendarText, L: UILabels['eventCalendar']): string;
|
|
9
|
+
export declare function eventTail(item: PlacedCalendarEvent<CalendarEvent>, text: EventCalendarText, L: UILabels['eventCalendar']): string;
|
|
10
|
+
export declare const cx: (...names: Array<string | false | null | undefined>) => string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as EventCalendar } from './EventCalendar';
|
|
2
|
+
export type { EventCalendarProps, EventCalendarRenderInfo } from './EventCalendar';
|
|
3
|
+
export type { CalendarEvent, CalendarEventColor, CalendarDateInput, CalendarViewType, CalendarEventChange } from '../../core/types';
|