@dcs-tech/ui 0.9.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 +488 -0
- package/README.md +43 -7
- package/THIRD_PARTY_NOTICES.md +23 -0
- package/dist/ChartImageMenu-sB2QNQzd.js +9673 -0
- package/dist/ChartView-BstZkP1g.js +1942 -0
- package/dist/{SummaryChart-CxRjK_HU.js → SummaryChart-B5ibDNOZ.js} +11 -10
- package/dist/{SummaryImage-Crf1R-3a.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-BOn9NC8X.js +644 -0
- package/dist/exportContext-CMzuzRjc.js +274 -0
- package/dist/{exportEngine-BFZD6djX.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-yZmKN662.js → geometry-CFS5If1N.js} +848 -439
- package/dist/index.js +24208 -12603
- package/dist/{labels-CnqqTrne.js → labels-mukFhYkc.js} +126 -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-CARqGRUl.js → summaryChartData-D15kw64n.js} +10 -3
- package/dist/types/components/Alert/Alert.d.ts +16 -0
- package/dist/types/components/Alert/index.d.ts +2 -0
- package/dist/types/components/Card/Card.d.ts +4 -3
- package/dist/types/components/Card/index.d.ts +1 -1
- 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 +4 -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 +3 -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/ChipInput/ChipTags.d.ts +3 -0
- package/dist/types/components/CommandPalette/CommandPaletteTrigger.d.ts +9 -0
- package/dist/types/components/CommandPalette/index.d.ts +2 -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/TablePagination.d.ts +1 -1
- package/dist/types/components/DataTable/TableToolbar.d.ts +21 -1
- package/dist/types/components/DataTable/TableView.d.ts +19 -2
- package/dist/types/components/DataTable/cards/CardView.d.ts +25 -5
- package/dist/types/components/DataTable/cards/cardFields.d.ts +1 -0
- 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/defaults.d.ts +4 -0
- 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 +130 -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 +290 -6
- package/dist/types/components/DataTable/ui-local/TableReorderList.d.ts +13 -0
- package/dist/types/components/DataTable/ui.d.ts +2 -1
- package/dist/types/components/DataTable/useDataChangeTracker.d.ts +11 -4
- package/dist/types/components/DataTable/useTable.d.ts +14 -1
- package/dist/types/components/DataTable/virtual/useVirtualLines.d.ts +1 -0
- package/dist/types/components/DatePicker/PeriodGrid.d.ts +13 -0
- package/dist/types/components/DatePicker/PeriodPicker.d.ts +19 -0
- package/dist/types/components/DatePicker/index.d.ts +1 -1
- package/dist/types/components/Dialog/dialogSlots.d.ts +9 -0
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +8 -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/FieldWrapper/index.d.ts +1 -1
- package/dist/types/components/Fields/index.d.ts +1 -1
- 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/Image/ImageEditor.d.ts +21 -0
- package/dist/types/components/Image/ImagePicker.d.ts +10 -1
- package/dist/types/components/Image/imageRender.d.ts +33 -0
- package/dist/types/components/Image/index.d.ts +3 -1
- package/dist/types/components/Image/prepareImage.d.ts +4 -3
- package/dist/types/components/Link/Link.d.ts +22 -0
- package/dist/types/components/Link/index.d.ts +2 -0
- package/dist/types/components/NavList/NavList.d.ts +13 -0
- package/dist/types/components/NavList/index.d.ts +2 -0
- package/dist/types/components/PageProgress/PageProgress.d.ts +10 -0
- package/dist/types/components/PageProgress/index.d.ts +2 -0
- package/dist/types/components/Pagination/Pagination.d.ts +19 -0
- package/dist/types/components/Pagination/index.d.ts +2 -0
- package/dist/types/components/Popover/Popover.d.ts +2 -1
- package/dist/types/components/Popover/floatingPosition.d.ts +26 -2
- package/dist/types/components/ReorderList/ReorderGroup.d.ts +16 -0
- package/dist/types/components/ReorderList/ReorderList.d.ts +56 -0
- package/dist/types/components/ReorderList/crossListDrag.d.ts +61 -0
- package/dist/types/components/ReorderList/index.d.ts +5 -0
- package/dist/types/components/ReorderList/useReorderDrag.d.ts +28 -0
- 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/Tooltip/useTooltip.d.ts +4 -0
- package/dist/types/components/UIProvider/UILabelsContext.d.ts +120 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +2 -0
- package/dist/types/core/hooks/index.d.ts +2 -1
- package/dist/types/core/hooks/useMeasuredState.d.ts +1 -0
- 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/alert.logic.d.ts +3 -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/commandPalette.logic.d.ts +2 -0
- package/dist/types/core/logic/datePicker.logic.d.ts +12 -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/fieldWrapper.logic.d.ts +6 -1
- 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/imageEditor.logic.d.ts +132 -0
- package/dist/types/core/logic/imageTransform.logic.d.ts +57 -0
- package/dist/types/core/logic/index.d.ts +25 -0
- package/dist/types/core/logic/inertProps.d.ts +3 -0
- package/dist/types/core/logic/pageProgress.logic.d.ts +3 -0
- package/dist/types/core/logic/pagination.logic.d.ts +7 -0
- package/dist/types/core/logic/periodPicker.logic.d.ts +86 -0
- package/dist/types/core/logic/pivot.logic.d.ts +100 -0
- package/dist/types/core/logic/reorder.logic.d.ts +49 -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/chipinput.types.d.ts +3 -1
- package/dist/types/core/types/collapsible.types.d.ts +3 -0
- package/dist/types/core/types/datePicker.types.d.ts +7 -0
- package/dist/types/core/types/eventCalendar.types.d.ts +18 -0
- package/dist/types/core/types/field.types.d.ts +6 -3
- package/dist/types/core/types/fieldWrapper.types.d.ts +2 -0
- package/dist/types/core/types/fields.types.d.ts +6 -1
- package/dist/types/core/types/fileEngine.types.d.ts +6 -0
- package/dist/types/core/types/form.types.d.ts +1 -0
- package/dist/types/core/types/format.types.d.ts +2 -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/core/types/input.types.d.ts +2 -0
- package/dist/types/core/types/navigation.types.d.ts +1 -0
- package/dist/types/core/types/select.types.d.ts +2 -6
- package/dist/types/core/types/suggest.types.d.ts +2 -0
- package/dist/types/index.d.ts +31 -6
- package/package.json +4 -4
- package/dist/ChartImageMenu-DDVNJNc6.js +0 -1499
- package/dist/ChartView-CW3m4Z_1.js +0 -1703
- package/dist/SummarySeeAll-BRHOMQRA.js +0 -101
- package/dist/assets/fileTask.worker--Q3rI3Bn.js +0 -1
- package/dist/columnValue-DwUqueZ6.js +0 -610
- package/dist/exportContext-BKFnNQ0q.js +0 -166
- package/dist/scrollArea-DbYFqbIH.js +0 -269
- package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +0 -4
- package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +0 -3
- package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +0 -70
|
@@ -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';
|
|
@@ -139,7 +310,7 @@ export declare const SUMMARY_KIND_CHARTS: {
|
|
|
139
310
|
readonly ratio: readonly ["bar", "gauge", "ring", "donut", "pie"];
|
|
140
311
|
readonly breakdown: readonly ["donut", "pie", "bars", "stacked", "treemap"];
|
|
141
312
|
readonly trend: readonly ["columns", "line", "area", "grouped", "stacked", "calendar"];
|
|
142
|
-
readonly funnel: readonly ["funnel"];
|
|
313
|
+
readonly funnel: readonly ["funnel", "bars"];
|
|
143
314
|
};
|
|
144
315
|
export type DataTableSummaryWidth = 'auto' | 'quarter' | 'half' | 'full';
|
|
145
316
|
export declare const SUMMARY_WIDTHS: readonly DataTableSummaryWidth[];
|
|
@@ -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,14 +392,19 @@ 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';
|
|
219
400
|
steps: DataTableSummaryFunnelStep<TData>[];
|
|
401
|
+
chart?: 'funnel' | 'bars';
|
|
402
|
+
showChange?: boolean;
|
|
220
403
|
}
|
|
221
|
-
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>;
|
|
222
405
|
export interface DataTableSummaryConfig<TData = any> {
|
|
223
406
|
cards: DataTableSummaryCard<TData>[];
|
|
407
|
+
animate?: boolean;
|
|
224
408
|
}
|
|
225
409
|
export declare const SUMMARY_TREND_COUNTS: {
|
|
226
410
|
readonly month: readonly [3, 6, 12, 24, 36];
|
|
@@ -270,6 +454,8 @@ export type DataTableSummaryCardRequest = {
|
|
|
270
454
|
field: string;
|
|
271
455
|
part: DataTableSummaryPart;
|
|
272
456
|
within?: string;
|
|
457
|
+
sum?: string;
|
|
458
|
+
where?: string;
|
|
273
459
|
} | {
|
|
274
460
|
key: string;
|
|
275
461
|
id: string;
|
|
@@ -278,6 +464,10 @@ export type DataTableSummaryCardRequest = {
|
|
|
278
464
|
period: DataTableSummaryPeriod;
|
|
279
465
|
count: number;
|
|
280
466
|
split?: string;
|
|
467
|
+
sum?: string;
|
|
468
|
+
where?: string;
|
|
469
|
+
from?: string;
|
|
470
|
+
to?: string;
|
|
281
471
|
} | {
|
|
282
472
|
key: string;
|
|
283
473
|
id: string;
|
|
@@ -331,6 +521,7 @@ export interface DataTableRowAction<TData = any> {
|
|
|
331
521
|
showWhen?: (row: TData) => boolean;
|
|
332
522
|
disabledWhen?: (row: TData) => boolean;
|
|
333
523
|
tooltip?: string | ((row: TData) => string);
|
|
524
|
+
disableTextTransform?: boolean;
|
|
334
525
|
primary?: boolean | ((row: TData) => boolean);
|
|
335
526
|
shortcut?: string;
|
|
336
527
|
}
|
|
@@ -486,6 +677,18 @@ export interface DataTableBulkAction<TData = any> {
|
|
|
486
677
|
undoTimeoutMs?: number;
|
|
487
678
|
onRun: (ctx: DataTableBulkActionContext<TData>) => Promise<DataTableBulkActionResult | void> | DataTableBulkActionResult | void;
|
|
488
679
|
}
|
|
680
|
+
export interface DataTableToolbarAction {
|
|
681
|
+
id: string;
|
|
682
|
+
label: string;
|
|
683
|
+
icon?: ReactNode;
|
|
684
|
+
variant?: ActionVariant;
|
|
685
|
+
display?: 'icon' | 'label' | 'icon-label';
|
|
686
|
+
tooltip?: string;
|
|
687
|
+
disabled?: boolean;
|
|
688
|
+
priority?: number;
|
|
689
|
+
authorize?: () => boolean;
|
|
690
|
+
onClick: () => void;
|
|
691
|
+
}
|
|
489
692
|
export interface DataTableColumnPinning {
|
|
490
693
|
left: string[];
|
|
491
694
|
right: string[];
|
|
@@ -632,6 +835,7 @@ export interface DataTableExportMetadata {
|
|
|
632
835
|
selectedRows: number;
|
|
633
836
|
labels?: Partial<DataTableLabels>;
|
|
634
837
|
locale?: string;
|
|
838
|
+
notes?: string[];
|
|
635
839
|
}
|
|
636
840
|
export type DataTableExportFormat = 'csv' | 'xlsx' | 'json' | 'pdf' | 'html' | 'xml';
|
|
637
841
|
export type DataTableExportAction = 'download' | 'share' | 'preview' | 'print';
|
|
@@ -778,6 +982,10 @@ export interface DataTableExportTemplate<TData = any> {
|
|
|
778
982
|
};
|
|
779
983
|
onResult?: (data: TData[], meta: DataTableExportMeta) => DataTableExportResult | undefined;
|
|
780
984
|
license?: DataTableLicense;
|
|
985
|
+
headerGroups?: boolean;
|
|
986
|
+
csvGroupRows?: boolean;
|
|
987
|
+
treeLevel?: boolean;
|
|
988
|
+
pinnedRows?: boolean;
|
|
781
989
|
}
|
|
782
990
|
export type DataTableFileNameAs = 'title' | 'title-date' | 'title-generated' | 'title-date-generated';
|
|
783
991
|
export interface DataTableQuickExport<TData = any> {
|
|
@@ -790,6 +998,8 @@ export interface DataTableQuickExport<TData = any> {
|
|
|
790
998
|
summary?: (rows: TData[]) => Record<string, string | number>;
|
|
791
999
|
xlsx?: DataTableXlsxStyle;
|
|
792
1000
|
pdf?: DataTablePdfConfig;
|
|
1001
|
+
csvGroupRows?: boolean;
|
|
1002
|
+
pinnedRows?: boolean;
|
|
793
1003
|
generate?: Partial<Record<DataTableExportFormat, DataTableExportGenerator<TData>>>;
|
|
794
1004
|
}
|
|
795
1005
|
export interface DataTableExportConfig<TData = any> {
|
|
@@ -873,6 +1083,7 @@ export interface DataTableManagePrefs {
|
|
|
873
1083
|
export interface DataTableView<TData = any> {
|
|
874
1084
|
columns: DataTableColumn<TData>[];
|
|
875
1085
|
resolveColumns?: (data: TData[]) => DataTableColumn<TData>[];
|
|
1086
|
+
columnGroups?: DataTableColumnGroup[];
|
|
876
1087
|
id: string;
|
|
877
1088
|
renamed?: Record<string, string>;
|
|
878
1089
|
label?: string;
|
|
@@ -883,7 +1094,11 @@ export interface DataTableView<TData = any> {
|
|
|
883
1094
|
rowKey?: string;
|
|
884
1095
|
transform?: (data: any[]) => any[];
|
|
885
1096
|
animateRows?: boolean;
|
|
1097
|
+
rowChanges?: DataTableRowChanges;
|
|
1098
|
+
flash?: boolean;
|
|
886
1099
|
flashColors?: DataTableFlashColors;
|
|
1100
|
+
flashStyle?: DataTableCellFlashStyle;
|
|
1101
|
+
flashDuration?: number;
|
|
887
1102
|
HeaderComponent?: ComponentType<DataTableComponentProps<TData> & Record<string, any>>;
|
|
888
1103
|
FooterComponent?: ComponentType<DataTableComponentProps<TData> & Record<string, any>>;
|
|
889
1104
|
headerProps?: Record<string, any>;
|
|
@@ -904,8 +1119,14 @@ export interface DataTableView<TData = any> {
|
|
|
904
1119
|
inlineActions?: number;
|
|
905
1120
|
actionsHeader?: boolean;
|
|
906
1121
|
bulkActions?: DataTableBulkAction<TData>[];
|
|
1122
|
+
toolbarActions?: DataTableToolbarAction[];
|
|
907
1123
|
hideBulkActions?: string[];
|
|
908
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>;
|
|
909
1130
|
devTools?: boolean;
|
|
910
1131
|
singleRowView?: DataTableSingleRowView;
|
|
911
1132
|
cardFields?: Partial<DataTableCardFields>;
|
|
@@ -924,6 +1145,7 @@ export interface DataTableView<TData = any> {
|
|
|
924
1145
|
bordered?: boolean;
|
|
925
1146
|
stickyHeader?: boolean;
|
|
926
1147
|
emptyMessage?: string;
|
|
1148
|
+
noResultsMessage?: string;
|
|
927
1149
|
loadingMessage?: string;
|
|
928
1150
|
loading?: boolean;
|
|
929
1151
|
}
|
|
@@ -943,6 +1165,10 @@ export interface DataTableProps<TData = any> {
|
|
|
943
1165
|
apiRef?: {
|
|
944
1166
|
current: DataTableApi<TData> | null;
|
|
945
1167
|
};
|
|
1168
|
+
pinnedRows?: {
|
|
1169
|
+
top?: TData[];
|
|
1170
|
+
bottom?: TData[];
|
|
1171
|
+
};
|
|
946
1172
|
bulkActions?: DataTableBulkAction<TData>[];
|
|
947
1173
|
labels?: Partial<DataTableLabels>;
|
|
948
1174
|
locale?: string;
|
|
@@ -950,6 +1176,11 @@ export interface DataTableProps<TData = any> {
|
|
|
950
1176
|
detailBar?: boolean;
|
|
951
1177
|
openRowId?: string | null;
|
|
952
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;
|
|
953
1184
|
shortcuts?: DataTableShortcut<TData>[];
|
|
954
1185
|
sharing?: DataTableSharing;
|
|
955
1186
|
renamedViews?: Record<string, string>;
|
|
@@ -978,6 +1209,13 @@ export interface DataTableAllRowsResult<TData = any> {
|
|
|
978
1209
|
rows: TData[];
|
|
979
1210
|
total?: number;
|
|
980
1211
|
capped?: boolean;
|
|
1212
|
+
tree?: boolean;
|
|
1213
|
+
}
|
|
1214
|
+
export interface DataTableExportTreeRequest {
|
|
1215
|
+
withChildren: true;
|
|
1216
|
+
rowKey: string;
|
|
1217
|
+
shape: 'nested' | 'flat';
|
|
1218
|
+
parentField?: string;
|
|
981
1219
|
}
|
|
982
1220
|
export interface DataTableCounts {
|
|
983
1221
|
views?: Record<string, number>;
|
|
@@ -992,6 +1230,7 @@ export interface DataTableDataSource<TData = any> {
|
|
|
992
1230
|
action: DataTableExportAction;
|
|
993
1231
|
selection: DataTableSelection<TData>;
|
|
994
1232
|
params?: Record<string, unknown>;
|
|
1233
|
+
tree?: DataTableExportTreeRequest;
|
|
995
1234
|
}) => Promise<DataTableAllRowsResult<TData>>;
|
|
996
1235
|
summaries?: (query: DataTableQuery, ctx: {
|
|
997
1236
|
selection: DataTableSelection<TData>;
|
|
@@ -1010,6 +1249,14 @@ export interface DataTableDataSource<TData = any> {
|
|
|
1010
1249
|
}, ctx: {
|
|
1011
1250
|
signal: AbortSignal;
|
|
1012
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>;
|
|
1013
1260
|
operators?: readonly string[];
|
|
1014
1261
|
summaryBreakdownFields?: readonly string[];
|
|
1015
1262
|
subscribe?: (refetch: () => void) => () => void;
|
|
@@ -1028,12 +1275,44 @@ export interface DataTableInitialState {
|
|
|
1028
1275
|
pageIndex?: number;
|
|
1029
1276
|
pageSize?: number;
|
|
1030
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
|
+
}
|
|
1031
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;
|
|
1032
1302
|
refresh: () => void;
|
|
1033
1303
|
clearSelection: () => void;
|
|
1034
1304
|
getQuery: () => DataTableQuery;
|
|
1035
1305
|
getRows: () => TData[];
|
|
1036
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;
|
|
1037
1316
|
}
|
|
1038
1317
|
export interface DataTablePersistence {
|
|
1039
1318
|
load: (key: string) => Promise<Record<string, any> | null>;
|
|
@@ -1041,7 +1320,7 @@ export interface DataTablePersistence {
|
|
|
1041
1320
|
list?: (prefix: string) => Promise<string[]>;
|
|
1042
1321
|
remove?: (key: string) => Promise<void>;
|
|
1043
1322
|
}
|
|
1044
|
-
export type DataTableGate = 'export' | 'export.format' | 'export.template' | 'manage' | 'selection' | 'columns' | 'cardFields' | 'savedFilters' | 'devTools' | 'license' | 'bulkAction' | 'copy' | 'layout' | 'grouping' | 'shareView' | 'rows';
|
|
1323
|
+
export type DataTableGate = 'export' | 'export.format' | 'export.template' | 'manage' | 'selection' | 'columns' | 'cardFields' | 'savedFilters' | 'devTools' | 'license' | 'bulkAction' | 'toolbarAction' | 'copy' | 'layout' | 'grouping' | 'shareView' | 'rows';
|
|
1045
1324
|
export type DataTableAuthorize = (gate: DataTableGate, subject?: unknown) => boolean;
|
|
1046
1325
|
export interface DataTablePdfFonts {
|
|
1047
1326
|
fonts?: Record<string, {
|
|
@@ -1072,6 +1351,8 @@ export interface DataTableDisplayPrefs {
|
|
|
1072
1351
|
showActions: boolean;
|
|
1073
1352
|
actionDisplayMode: DataTableActionDisplay;
|
|
1074
1353
|
actionDisplayModeCard: DataTableActionDisplay;
|
|
1354
|
+
maxVisibleActions?: number;
|
|
1355
|
+
maxVisibleActionsCard?: number;
|
|
1075
1356
|
summaryTop: boolean;
|
|
1076
1357
|
summaryBottom: boolean;
|
|
1077
1358
|
}
|
|
@@ -1090,6 +1371,8 @@ export interface DataTableViewPrefs {
|
|
|
1090
1371
|
filterRow?: boolean;
|
|
1091
1372
|
grouping?: string[];
|
|
1092
1373
|
summary?: DataTableSummaryPrefs;
|
|
1374
|
+
pinnedRows?: DataTableRowPins;
|
|
1375
|
+
pivot?: DataTablePivotState;
|
|
1093
1376
|
}
|
|
1094
1377
|
export interface ContextMenuState {
|
|
1095
1378
|
visible: boolean;
|
|
@@ -1111,6 +1394,7 @@ export interface UseTableReturn<TData = any> {
|
|
|
1111
1394
|
clearAllFilters: () => void;
|
|
1112
1395
|
globalFilter: string;
|
|
1113
1396
|
setGlobalFilter: (value: string) => void;
|
|
1397
|
+
searchApplied: string;
|
|
1114
1398
|
sorting: Array<{
|
|
1115
1399
|
id: string;
|
|
1116
1400
|
desc: boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './ui-local.css';
|
|
3
|
+
interface TableReorderListProps<T> {
|
|
4
|
+
items: readonly T[];
|
|
5
|
+
getKey: (item: T) => string;
|
|
6
|
+
getItemLabel: (item: T) => string;
|
|
7
|
+
onReorder?: (items: T[]) => void;
|
|
8
|
+
renderItem: (item: T, dragHandle: React.ReactNode) => React.ReactNode;
|
|
9
|
+
maxHeight?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function TableReorderList<T>({ items, getKey, getItemLabel, onReorder, renderItem, maxHeight, className }: TableReorderListProps<T>): React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -7,7 +7,8 @@ export { Tabs as SmartTabs } from '../Tabs';
|
|
|
7
7
|
export { DropdownMenu as SmartDropdownMenu } from '../DropdownMenu';
|
|
8
8
|
export { Dialog as SmartDialog } from '../Dialog';
|
|
9
9
|
export { Badge as SmartBadge } from '../Badge';
|
|
10
|
+
export { ReorderList } from '../ReorderList';
|
|
10
11
|
export { ReactModal } from './ui-local/ReactModal';
|
|
11
|
-
export {
|
|
12
|
+
export { TableReorderList } from './ui-local/TableReorderList';
|
|
12
13
|
export { AutoHeight } from './ui-local/AutoHeight';
|
|
13
14
|
export { DateRangePicker } from './ui-local/DateRangePicker';
|
|
@@ -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,15 +1,28 @@
|
|
|
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;
|
|
9
19
|
initialState?: DataTableInitialState;
|
|
10
20
|
defaultPageSize?: number;
|
|
21
|
+
pageSizeOptions?: number[];
|
|
11
22
|
labels?: DataTableLabels;
|
|
12
23
|
format?: UIFormat;
|
|
13
24
|
customPaging?: boolean;
|
|
25
|
+
heldRows?: HeldRows;
|
|
26
|
+
treeFilter?: (data: any[], filterGroup: DataTableFilterGroup, search: string) => any[];
|
|
14
27
|
}
|
|
15
28
|
export declare function useTable<TData = any>(data: TData[], config: DataTableView<TData>, options?: UseTableOptions): UseTableReturn<TData>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { IsoPeriod, PeriodGridView } from '../../core/logic';
|
|
3
|
+
export interface PeriodGridProps {
|
|
4
|
+
view: PeriodGridView;
|
|
5
|
+
label: string;
|
|
6
|
+
multi?: boolean;
|
|
7
|
+
cellId: (period: IsoPeriod) => string;
|
|
8
|
+
cellText: (period: IsoPeriod) => string;
|
|
9
|
+
cellLabel: (period: IsoPeriod) => string;
|
|
10
|
+
onPick: (period: IsoPeriod) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const PeriodGrid: React.FC<PeriodGridProps>;
|
|
13
|
+
export default PeriodGrid;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { DatePickerBaseProps, DateRangeValue, FieldChangeEvent, FieldHandle, FieldKeyboardConfig } from '../../core/types';
|
|
3
|
+
import { type PeriodMode } from '../../core/logic';
|
|
4
|
+
export declare const BOX_KEYBOARD: FieldKeyboardConfig;
|
|
5
|
+
export type PeriodPickerProps = DatePickerBaseProps & {
|
|
6
|
+
mode: PeriodMode;
|
|
7
|
+
range?: boolean;
|
|
8
|
+
value?: string | DateRangeValue;
|
|
9
|
+
onChange?: (event: FieldChangeEvent<string | DateRangeValue>) => void;
|
|
10
|
+
onApply?: (value: string | DateRangeValue) => void;
|
|
11
|
+
};
|
|
12
|
+
declare const PeriodPicker: React.ForwardRefExoticComponent<DatePickerBaseProps & {
|
|
13
|
+
mode: PeriodMode;
|
|
14
|
+
range?: boolean;
|
|
15
|
+
value?: string | DateRangeValue;
|
|
16
|
+
onChange?: (event: FieldChangeEvent<string | DateRangeValue>) => void;
|
|
17
|
+
onApply?: (value: string | DateRangeValue) => void;
|
|
18
|
+
} & React.RefAttributes<FieldHandle>>;
|
|
19
|
+
export default PeriodPicker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as DatePicker } from './DatePicker';
|
|
2
2
|
export { default as Calendar } from './Calendar';
|
|
3
3
|
export type { CalendarProps } from './Calendar';
|
|
4
|
-
export type { DatePickerProps, DatePickerBaseProps, DatePickerSingleProps, DatePickerRangeProps, DateRangeValue, DateDisplayFormat, DateTextOrder, } from '../../core/types';
|
|
4
|
+
export type { DatePickerProps, DatePickerBaseProps, DatePickerSingleProps, DatePickerRangeProps, DateRangeValue, DatePickerMode, DateDisplayFormat, DateTextOrder, } from '../../core/types';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type DialogSlotName = 'header' | 'footer';
|
|
2
|
+
export interface DialogSlots {
|
|
3
|
+
headerEl: HTMLElement | null;
|
|
4
|
+
footerEl: HTMLElement | null;
|
|
5
|
+
claim: (slot: DialogSlotName) => () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const DialogSlotsContext: import("react").Context<DialogSlots | null>;
|
|
8
|
+
export declare const useDialogSlots: () => DialogSlots | null;
|
|
9
|
+
export declare function useDialogSlotClaim(slots: DialogSlots | null, slot: DialogSlotName, active: boolean): void;
|