@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.
Files changed (235) hide show
  1. package/CHANGELOG.md +488 -0
  2. package/README.md +43 -7
  3. package/THIRD_PARTY_NOTICES.md +23 -0
  4. package/dist/ChartImageMenu-sB2QNQzd.js +9673 -0
  5. package/dist/ChartView-BstZkP1g.js +1942 -0
  6. package/dist/{SummaryChart-CxRjK_HU.js → SummaryChart-B5ibDNOZ.js} +11 -10
  7. package/dist/{SummaryImage-Crf1R-3a.js → SummaryImage-CRP7X2Nl.js} +2 -2
  8. package/dist/SummarySeeAll-CtYRGV4G.js +101 -0
  9. package/dist/assets/fileTask.worker-D97s2vRV.js +1 -0
  10. package/dist/columnValue-BOn9NC8X.js +644 -0
  11. package/dist/exportContext-CMzuzRjc.js +274 -0
  12. package/dist/{exportEngine-BFZD6djX.js → exportEngine-CYDN8Ty-.js} +167 -137
  13. package/dist/file-worker.js +1 -1
  14. package/dist/{fileActions-CFNO14Aj.js → fileActions-DkPEWE-t.js} +1 -1
  15. package/dist/{geometry-yZmKN662.js → geometry-CFS5If1N.js} +848 -439
  16. package/dist/index.js +24208 -12603
  17. package/dist/{labels-CnqqTrne.js → labels-mukFhYkc.js} +126 -1
  18. package/dist/{runFileTask-BIZTFnZP.js → runFileTask-DI_39TjR.js} +17 -0
  19. package/dist/scrollArea-B52kugL1.js +291 -0
  20. package/dist/style.css +1 -1
  21. package/dist/{summaryChartData-CARqGRUl.js → summaryChartData-D15kw64n.js} +10 -3
  22. package/dist/types/components/Alert/Alert.d.ts +16 -0
  23. package/dist/types/components/Alert/index.d.ts +2 -0
  24. package/dist/types/components/Card/Card.d.ts +4 -3
  25. package/dist/types/components/Card/index.d.ts +1 -1
  26. package/dist/types/components/Charts/BarList.d.ts +4 -3
  27. package/dist/types/components/Charts/CalendarHeatmap.d.ts +4 -2
  28. package/dist/types/components/Charts/Chart.d.ts +3 -2
  29. package/dist/types/components/Charts/ChartView.d.ts +3 -2
  30. package/dist/types/components/Charts/ColumnChart.d.ts +4 -3
  31. package/dist/types/components/Charts/Donut.d.ts +3 -2
  32. package/dist/types/components/Charts/Funnel.d.ts +4 -2
  33. package/dist/types/components/Charts/Gauge.d.ts +3 -2
  34. package/dist/types/components/Charts/LineChart.d.ts +4 -3
  35. package/dist/types/components/Charts/NumberTrend.d.ts +4 -3
  36. package/dist/types/components/Charts/Progress.d.ts +3 -2
  37. package/dist/types/components/Charts/StackedBar.d.ts +3 -2
  38. package/dist/types/components/Charts/Treemap.d.ts +3 -2
  39. package/dist/types/components/Charts/chartData.d.ts +6 -0
  40. package/dist/types/components/Charts/chartImage.d.ts +3 -0
  41. package/dist/types/components/Charts/geometry.d.ts +3 -0
  42. package/dist/types/components/Charts/index.d.ts +2 -0
  43. package/dist/types/components/Charts/palette.d.ts +1 -0
  44. package/dist/types/components/Charts/parts.d.ts +14 -0
  45. package/dist/types/components/Charts/useChartMotion.d.ts +8 -0
  46. package/dist/types/components/ChipInput/ChipTags.d.ts +3 -0
  47. package/dist/types/components/CommandPalette/CommandPaletteTrigger.d.ts +9 -0
  48. package/dist/types/components/CommandPalette/index.d.ts +2 -0
  49. package/dist/types/components/DataTable/DataTable.d.ts +3 -1
  50. package/dist/types/components/DataTable/DisplayPopover.d.ts +1 -0
  51. package/dist/types/components/DataTable/HeaderMenu.d.ts +1 -0
  52. package/dist/types/components/DataTable/TableColumnModal.d.ts +4 -1
  53. package/dist/types/components/DataTable/TablePagination.d.ts +1 -1
  54. package/dist/types/components/DataTable/TableToolbar.d.ts +21 -1
  55. package/dist/types/components/DataTable/TableView.d.ts +19 -2
  56. package/dist/types/components/DataTable/cards/CardView.d.ts +25 -5
  57. package/dist/types/components/DataTable/cards/cardFields.d.ts +1 -0
  58. package/dist/types/components/DataTable/cards/rowParts.d.ts +1 -0
  59. package/dist/types/components/DataTable/cellSelection/CellRangeBar.d.ts +16 -0
  60. package/dist/types/components/DataTable/cellSelection/cellRangeStore.d.ts +18 -0
  61. package/dist/types/components/DataTable/cellSelection/paintRanges.d.ts +2 -0
  62. package/dist/types/components/DataTable/cellSelection/useCellSelection.d.ts +63 -0
  63. package/dist/types/components/DataTable/data/listDelta.d.ts +27 -0
  64. package/dist/types/components/DataTable/data/rowLineage.d.ts +3 -0
  65. package/dist/types/components/DataTable/data/rowModels.d.ts +9 -0
  66. package/dist/types/components/DataTable/data/rowTransaction.d.ts +9 -0
  67. package/dist/types/components/DataTable/data/useServerData.d.ts +3 -1
  68. package/dist/types/components/DataTable/defaults.d.ts +4 -0
  69. package/dist/types/components/DataTable/export/exportCells.d.ts +5 -2
  70. package/dist/types/components/DataTable/export/exportEngine.d.ts +7 -2
  71. package/dist/types/components/DataTable/export/useTableExport.d.ts +17 -1
  72. package/dist/types/components/DataTable/filters/filterRowModel.d.ts +1 -0
  73. package/dist/types/components/DataTable/grouping/groupModel.d.ts +11 -0
  74. package/dist/types/components/DataTable/index.d.ts +1 -1
  75. package/dist/types/components/DataTable/keyboard/ShortcutsDialog.d.ts +4 -1
  76. package/dist/types/components/DataTable/keyboard/useGridKeyboard.d.ts +8 -0
  77. package/dist/types/components/DataTable/labels.d.ts +130 -0
  78. package/dist/types/components/DataTable/layout/LayoutSwitcher.d.ts +10 -2
  79. package/dist/types/components/DataTable/layout/useFitWidths.d.ts +7 -0
  80. package/dist/types/components/DataTable/menu/RowMenu.d.ts +1 -0
  81. package/dist/types/components/DataTable/menu/buildRowMenu.d.ts +6 -3
  82. package/dist/types/components/DataTable/motion/RowChangeNotice.d.ts +19 -0
  83. package/dist/types/components/DataTable/motion/rowChanges.d.ts +25 -0
  84. package/dist/types/components/DataTable/motion/useNoticeInsets.d.ts +2 -0
  85. package/dist/types/components/DataTable/motion/useRowChangeNotices.d.ts +35 -0
  86. package/dist/types/components/DataTable/motion/useRowMotion.d.ts +29 -3
  87. package/dist/types/components/DataTable/persistence/reconcile.d.ts +4 -0
  88. package/dist/types/components/DataTable/persistence/useColumnPersistence.d.ts +5 -1
  89. package/dist/types/components/DataTable/pivot/PivotPanel.d.ts +11 -0
  90. package/dist/types/components/DataTable/pivot/PivotView.d.ts +22 -0
  91. package/dist/types/components/DataTable/pivot/pivotModel.d.ts +54 -0
  92. package/dist/types/components/DataTable/pivot/usePivot.d.ts +44 -0
  93. package/dist/types/components/DataTable/rows/PressRow.d.ts +1 -0
  94. package/dist/types/components/DataTable/rows/RowLead.d.ts +23 -0
  95. package/dist/types/components/DataTable/rows/rowPress.d.ts +2 -0
  96. package/dist/types/components/DataTable/rows/usePinnedRows.d.ts +34 -0
  97. package/dist/types/components/DataTable/rows/useRowDrag.d.ts +44 -0
  98. package/dist/types/components/DataTable/split/SplitView.d.ts +4 -2
  99. package/dist/types/components/DataTable/summary/SummaryChart.d.ts +2 -1
  100. package/dist/types/components/DataTable/summary/TableSummary.d.ts +2 -1
  101. package/dist/types/components/DataTable/summary/summaryModel.d.ts +28 -6
  102. package/dist/types/components/DataTable/summary/useTableSummary.d.ts +3 -0
  103. package/dist/types/components/DataTable/toolbar/ToolbarMore.d.ts +14 -0
  104. package/dist/types/components/DataTable/toolbar/useToolbarFit.d.ts +10 -0
  105. package/dist/types/components/DataTable/tree/TreeChips.d.ts +5 -0
  106. package/dist/types/components/DataTable/tree/treeExport.d.ts +54 -0
  107. package/dist/types/components/DataTable/tree/treeMove.d.ts +1 -0
  108. package/dist/types/components/DataTable/tree/useTreeChildren.d.ts +15 -0
  109. package/dist/types/components/DataTable/tree/useTreeData.d.ts +60 -0
  110. package/dist/types/components/DataTable/types.d.ts +290 -6
  111. package/dist/types/components/DataTable/ui-local/TableReorderList.d.ts +13 -0
  112. package/dist/types/components/DataTable/ui.d.ts +2 -1
  113. package/dist/types/components/DataTable/useDataChangeTracker.d.ts +11 -4
  114. package/dist/types/components/DataTable/useTable.d.ts +14 -1
  115. package/dist/types/components/DataTable/virtual/useVirtualLines.d.ts +1 -0
  116. package/dist/types/components/DatePicker/PeriodGrid.d.ts +13 -0
  117. package/dist/types/components/DatePicker/PeriodPicker.d.ts +19 -0
  118. package/dist/types/components/DatePicker/index.d.ts +1 -1
  119. package/dist/types/components/Dialog/dialogSlots.d.ts +9 -0
  120. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +8 -0
  121. package/dist/types/components/EventCalendar/EventCalendar.d.ts +46 -0
  122. package/dist/types/components/EventCalendar/eventParts.d.ts +10 -0
  123. package/dist/types/components/EventCalendar/index.d.ts +3 -0
  124. package/dist/types/components/EventCalendar/useCalendarEdit.d.ts +40 -0
  125. package/dist/types/components/FieldWrapper/index.d.ts +1 -1
  126. package/dist/types/components/Fields/index.d.ts +1 -1
  127. package/dist/types/components/Icon/Icon.d.ts +36 -0
  128. package/dist/types/components/Icon/Icon.storyData.d.ts +6 -0
  129. package/dist/types/components/Icon/IconContext.d.ts +7 -0
  130. package/dist/types/components/Icon/icons.d.ts +223 -0
  131. package/dist/types/components/Icon/index.d.ts +7 -0
  132. package/dist/types/components/Icon/useIconDone.d.ts +5 -0
  133. package/dist/types/components/Image/ImageEditor.d.ts +21 -0
  134. package/dist/types/components/Image/ImagePicker.d.ts +10 -1
  135. package/dist/types/components/Image/imageRender.d.ts +33 -0
  136. package/dist/types/components/Image/index.d.ts +3 -1
  137. package/dist/types/components/Image/prepareImage.d.ts +4 -3
  138. package/dist/types/components/Link/Link.d.ts +22 -0
  139. package/dist/types/components/Link/index.d.ts +2 -0
  140. package/dist/types/components/NavList/NavList.d.ts +13 -0
  141. package/dist/types/components/NavList/index.d.ts +2 -0
  142. package/dist/types/components/PageProgress/PageProgress.d.ts +10 -0
  143. package/dist/types/components/PageProgress/index.d.ts +2 -0
  144. package/dist/types/components/Pagination/Pagination.d.ts +19 -0
  145. package/dist/types/components/Pagination/index.d.ts +2 -0
  146. package/dist/types/components/Popover/Popover.d.ts +2 -1
  147. package/dist/types/components/Popover/floatingPosition.d.ts +26 -2
  148. package/dist/types/components/ReorderList/ReorderGroup.d.ts +16 -0
  149. package/dist/types/components/ReorderList/ReorderList.d.ts +56 -0
  150. package/dist/types/components/ReorderList/crossListDrag.d.ts +61 -0
  151. package/dist/types/components/ReorderList/index.d.ts +5 -0
  152. package/dist/types/components/ReorderList/useReorderDrag.d.ts +28 -0
  153. package/dist/types/components/Scroll/ui.d.ts +1 -0
  154. package/dist/types/components/SlidingHighlight/index.d.ts +2 -0
  155. package/dist/types/components/SlidingHighlight/useSlidingHighlight.d.ts +20 -0
  156. package/dist/types/components/Suggest/SuggestionList.d.ts +1 -0
  157. package/dist/types/components/Tooltip/useTooltip.d.ts +4 -0
  158. package/dist/types/components/UIProvider/UILabelsContext.d.ts +120 -0
  159. package/dist/types/components/UIProvider/UIProvider.d.ts +2 -0
  160. package/dist/types/core/hooks/index.d.ts +2 -1
  161. package/dist/types/core/hooks/useMeasuredState.d.ts +1 -0
  162. package/dist/types/core/hooks/usePresence.d.ts +1 -0
  163. package/dist/types/core/icons/actions.icons.d.ts +37 -0
  164. package/dist/types/core/icons/commerce.icons.d.ts +16 -0
  165. package/dist/types/core/icons/communication.icons.d.ts +10 -0
  166. package/dist/types/core/icons/delivery.icons.d.ts +13 -0
  167. package/dist/types/core/icons/devices.icons.d.ts +16 -0
  168. package/dist/types/core/icons/files.icons.d.ts +13 -0
  169. package/dist/types/core/icons/general.icons.d.ts +24 -0
  170. package/dist/types/core/icons/index.d.ts +14 -0
  171. package/dist/types/core/icons/media.icons.d.ts +11 -0
  172. package/dist/types/core/icons/navigation.icons.d.ts +25 -0
  173. package/dist/types/core/icons/people.icons.d.ts +13 -0
  174. package/dist/types/core/icons/registry.d.ts +2 -0
  175. package/dist/types/core/icons/state.icons.d.ts +14 -0
  176. package/dist/types/core/icons/status.icons.d.ts +10 -0
  177. package/dist/types/core/icons/table.icons.d.ts +22 -0
  178. package/dist/types/core/icons/text.icons.d.ts +13 -0
  179. package/dist/types/core/logic/alert.logic.d.ts +3 -0
  180. package/dist/types/core/logic/cellRange.logic.d.ts +66 -0
  181. package/dist/types/core/logic/cellTouch.logic.d.ts +16 -0
  182. package/dist/types/core/logic/columnGroups.logic.d.ts +31 -0
  183. package/dist/types/core/logic/commandPalette.logic.d.ts +2 -0
  184. package/dist/types/core/logic/datePicker.logic.d.ts +12 -0
  185. package/dist/types/core/logic/dropdownSide.logic.d.ts +19 -0
  186. package/dist/types/core/logic/eventCalendar.logic.d.ts +225 -0
  187. package/dist/types/core/logic/fieldWrapper.logic.d.ts +6 -1
  188. package/dist/types/core/logic/fitColumns.logic.d.ts +7 -0
  189. package/dist/types/core/logic/icon.logic.d.ts +24 -0
  190. package/dist/types/core/logic/imageEditor.logic.d.ts +132 -0
  191. package/dist/types/core/logic/imageTransform.logic.d.ts +57 -0
  192. package/dist/types/core/logic/index.d.ts +25 -0
  193. package/dist/types/core/logic/inertProps.d.ts +3 -0
  194. package/dist/types/core/logic/pageProgress.logic.d.ts +3 -0
  195. package/dist/types/core/logic/pagination.logic.d.ts +7 -0
  196. package/dist/types/core/logic/periodPicker.logic.d.ts +86 -0
  197. package/dist/types/core/logic/pivot.logic.d.ts +100 -0
  198. package/dist/types/core/logic/reorder.logic.d.ts +49 -0
  199. package/dist/types/core/logic/rowActions.logic.d.ts +7 -0
  200. package/dist/types/core/logic/rowDrag.logic.d.ts +36 -0
  201. package/dist/types/core/logic/rowPinning.logic.d.ts +12 -0
  202. package/dist/types/core/logic/slidingHighlight.logic.d.ts +20 -0
  203. package/dist/types/core/logic/toolbarOverflow.logic.d.ts +21 -0
  204. package/dist/types/core/logic/treeData.logic.d.ts +44 -0
  205. package/dist/types/core/logic/treeDrag.logic.d.ts +63 -0
  206. package/dist/types/core/logic/tween.logic.d.ts +33 -0
  207. package/dist/types/core/logic/visualViewport.logic.d.ts +13 -0
  208. package/dist/types/core/types/chipinput.types.d.ts +3 -1
  209. package/dist/types/core/types/collapsible.types.d.ts +3 -0
  210. package/dist/types/core/types/datePicker.types.d.ts +7 -0
  211. package/dist/types/core/types/eventCalendar.types.d.ts +18 -0
  212. package/dist/types/core/types/field.types.d.ts +6 -3
  213. package/dist/types/core/types/fieldWrapper.types.d.ts +2 -0
  214. package/dist/types/core/types/fields.types.d.ts +6 -1
  215. package/dist/types/core/types/fileEngine.types.d.ts +6 -0
  216. package/dist/types/core/types/form.types.d.ts +1 -0
  217. package/dist/types/core/types/format.types.d.ts +2 -0
  218. package/dist/types/core/types/icon.types.d.ts +109 -0
  219. package/dist/types/core/types/index.d.ts +2 -0
  220. package/dist/types/core/types/input.types.d.ts +2 -0
  221. package/dist/types/core/types/navigation.types.d.ts +1 -0
  222. package/dist/types/core/types/select.types.d.ts +2 -6
  223. package/dist/types/core/types/suggest.types.d.ts +2 -0
  224. package/dist/types/index.d.ts +31 -6
  225. package/package.json +4 -4
  226. package/dist/ChartImageMenu-DDVNJNc6.js +0 -1499
  227. package/dist/ChartView-CW3m4Z_1.js +0 -1703
  228. package/dist/SummarySeeAll-BRHOMQRA.js +0 -101
  229. package/dist/assets/fileTask.worker--Q3rI3Bn.js +0 -1
  230. package/dist/columnValue-DwUqueZ6.js +0 -610
  231. package/dist/exportContext-BKFnNQ0q.js +0 -166
  232. package/dist/scrollArea-DbYFqbIH.js +0 -269
  233. package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +0 -4
  234. package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +0 -3
  235. package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +0 -70
@@ -0,0 +1,34 @@
1
+ import type { RowPins } from '../../../core/logic';
2
+ import type { DisplayItem } from '../grouping/groupModel';
3
+ import type { DataTableRowTransaction } from '../types';
4
+ export interface FoundPinnedRows<T> {
5
+ rows: readonly T[] | null;
6
+ ids: string;
7
+ map: Map<string, T>;
8
+ }
9
+ export declare const newFoundPinnedRows: <T>() => FoundPinnedRows<T>;
10
+ export declare function findPinnedRows<T>(cache: FoundPinnedRows<T>, rows: readonly T[], ids: ReadonlySet<string>, keyOf: (row: T) => string): Map<string, T>;
11
+ export interface PinnedRowLines<T> {
12
+ top: DisplayItem[];
13
+ bottom: DisplayItem[];
14
+ rowById: Map<string, any>;
15
+ originals: {
16
+ top: T[];
17
+ bottom: T[];
18
+ };
19
+ keep: (id: string, row: T) => void;
20
+ applyTransaction: (tx: DataTableRowTransaction<T>) => void;
21
+ }
22
+ export declare const isAppPinnedRow: (row: unknown) => boolean;
23
+ export declare function usePinnedRows<T>(opts: {
24
+ table: any;
25
+ pins: RowPins;
26
+ rows: readonly T[];
27
+ rowKey?: string;
28
+ serverMode: boolean;
29
+ app?: {
30
+ top?: readonly T[];
31
+ bottom?: readonly T[];
32
+ };
33
+ enabled: boolean;
34
+ }): PinnedRowLines<T>;
@@ -0,0 +1,44 @@
1
+ import React, { type RefObject } from 'react';
2
+ import { type RowDropTarget, type TreeDragLine, type TreeDropPlace, type TreeShape } from '../../../core/logic';
3
+ import type { DataTableLabels } from '../labels';
4
+ export interface RowDragHost {
5
+ on: boolean;
6
+ blocked: string | null;
7
+ areaRef: RefObject<HTMLElement | null>;
8
+ surface?: DragSurface;
9
+ order: () => string[];
10
+ moving: (id: string) => string[];
11
+ titleOf: (id: string) => string;
12
+ drop: (ids: string[], target: RowDropTarget) => void;
13
+ tree?: RowDragTree | null;
14
+ announce: (text: string) => void;
15
+ labels: DataTableLabels;
16
+ number: (n: number) => string;
17
+ onStart?: () => void;
18
+ onEnd?: () => void;
19
+ scrollToKey?: (key: string) => void;
20
+ }
21
+ export type DragSurface = 'table' | 'cards' | 'list';
22
+ export interface RowDragTreeLine extends TreeDragLine {
23
+ closed?: boolean;
24
+ }
25
+ export interface RowDragTree {
26
+ shape: () => TreeShape;
27
+ lines: () => readonly RowDragTreeLine[];
28
+ expand: (id: string) => void;
29
+ drop: (roots: string[], place: TreeDropPlace) => void;
30
+ }
31
+ export declare const TOUCH_HOLD_MS = 400;
32
+ export declare const TREE_OPEN_MS = 700;
33
+ export declare function useRowDrag(host: RowDragHost): {
34
+ handleProps: (id: string) => {
35
+ onPointerDown: (e: React.PointerEvent<HTMLElement>) => void;
36
+ onTouchStart: (e: React.TouchEvent<HTMLElement>) => void;
37
+ onContextMenu: (e: React.MouseEvent) => void;
38
+ onClick: (e: React.MouseEvent) => void;
39
+ };
40
+ onKeyDown: (e: React.KeyboardEvent) => boolean;
41
+ overlay: React.ReactPortal | null;
42
+ dragging: boolean;
43
+ cancel: () => void;
44
+ };
@@ -1,10 +1,11 @@
1
1
  import React, { type ReactNode } from 'react';
2
2
  import type { RowPressHandlers } from '../rows/rowPress';
3
- import type { CardLine, CardRow, MotionOptions } from '../cards/CardView';
3
+ import { type CardLine, type CardRow, type MotionOptions } from '../cards/CardView';
4
4
  import type { ListParts } from '../cards/rowParts';
5
5
  import { type ScrollApi, type VirtualOptions } from '../virtual/useVirtualLines';
6
6
  interface SplitViewProps {
7
7
  rows: CardRow[];
8
+ partsOf: (row: CardRow) => ListParts;
8
9
  lines?: CardLine[];
9
10
  openId: string | null;
10
11
  checkboxes: boolean;
@@ -21,9 +22,10 @@ interface SplitViewProps {
21
22
  scrollApi?: React.MutableRefObject<ScrollApi | null>;
22
23
  listFooter?: ReactNode;
23
24
  motion?: MotionOptions;
25
+ renderLead?: (id: string) => ReactNode;
24
26
  }
25
27
  export declare function SplitItemContent({ parts }: {
26
28
  parts: ListParts;
27
29
  }): React.JSX.Element;
28
- export declare function SplitView({ rows, lines: linesProp, openId, checkboxes, onToggle, press, renderActions, pane, narrowList, focusable, activeKey, placeholder, loading, virtual, scrollApi, listFooter, motion }: SplitViewProps): React.JSX.Element;
30
+ export declare function SplitView({ rows, partsOf, lines: linesProp, openId, checkboxes, onToggle, press, renderActions, pane, narrowList, focusable, activeKey, placeholder, loading, virtual, scrollApi, listFooter, motion, renderLead }: SplitViewProps): React.JSX.Element;
29
31
  export default SplitView;
@@ -7,5 +7,6 @@ export interface SummaryChartProps {
7
7
  locale?: string;
8
8
  labels: Partial<ChartLabels> & Pick<ChartLabels, 'count' | 'rest'>;
9
9
  onLegendCut?: (hidden: number) => void;
10
+ animate?: boolean;
10
11
  }
11
- export default function SummaryChart({ item, onSelect, format, locale, labels, onLegendCut }: SummaryChartProps): import("react").JSX.Element;
12
+ export default function SummaryChart({ item, onSelect, format, locale, labels, onLegendCut, animate }: SummaryChartProps): import("react").JSX.Element;
@@ -25,10 +25,11 @@ interface TableSummaryProps {
25
25
  loadAll: (card: DataTableSummaryBreakdownCard) => Promise<SummaryBucketView[]>;
26
26
  image?: TableSummaryImage;
27
27
  rootRef?: Ref<HTMLElement>;
28
+ animate?: boolean;
28
29
  }
29
30
  type BreakdownItem = Extract<ResolvedSummaryCard, {
30
31
  kind: 'breakdown';
31
32
  }>;
32
33
  export declare function visibleValues(item: BreakdownItem, cut?: number): number;
33
- declare function TableSummary({ strip, cards, open, onToggle, context, status, onSelect, selectable, loadAll, image, rootRef }: TableSummaryProps): React.JSX.Element;
34
+ declare function TableSummary({ strip, cards, open, onToggle, context, status, onSelect, selectable, loadAll, image, rootRef, animate }: TableSummaryProps): React.JSX.Element;
34
35
  export default TableSummary;
@@ -1,5 +1,5 @@
1
1
  import { type GroupLabels, type GroupValue } from '../grouping/groupModel';
2
- import { type DataTableColumn, type DataTableExportSummary, type DataTableFilterCondition, type DataTableFilterGroup, type DataTableSummaryAnyChart, type DataTableSummaryBreakdown, type DataTableSummaryBreakdownCard, type DataTableSummaryBucket, type DataTableSummaryCard, type DataTableSummaryFigure, type DataTableSummaryFunnelCard, type DataTableSummaryPart, type DataTableSummaryPeriod, type DataTableSummaryPeriodCount, type DataTableSummaryRequest, type DataTableSummaryShow, type DataTableSummarySubline, type DataTableSummaryTrendCard, type DataTableSummaryValueCard, type DataTableSummaryWidth } from '../types';
2
+ import { type DataTableColumn, type DataTableExportSummary, type DataTableFilterCondition, type DataTableFilterGroup, type DataTableSummaryAnyChart, type DataTableSummaryBreakdown, type DataTableSummaryBreakdownCard, type DataTableSummaryBucket, type DataTableSummaryCard, type DataTableSummaryCardContext, type DataTableSummaryFigure, type DataTableSummaryFunnelCard, type DataTableSummaryPart, type DataTableSummaryPeriod, type DataTableSummaryPeriodCount, type DataTableSummaryRange, type DataTableSummaryRequest, type DataTableSummaryShow, type DataTableSummarySubline, type DataTableSummarySum, type DataTableSummaryTrendCard, type DataTableSummaryValueCard, type DataTableSummaryValueFigure, type DataTableSummaryRowFilter, type DataTableSummaryWidth } from '../types';
3
3
  import type { ChartSlot } from '../../Charts';
4
4
  export declare const SUMMARY_CONDITION_PREFIX = "summary:";
5
5
  export declare const summaryConditionId: (cardId: string) => string;
@@ -19,10 +19,11 @@ export declare function breakdownPart(card: DataTableSummaryBreakdownCard, partT
19
19
  export declare function partOf(buckets: readonly DataTableSummaryBucket[], part: DataTableSummaryPart): DataTableSummaryBreakdown;
20
20
  export declare const splits: (card: DataTableSummaryTrendCard) => boolean;
21
21
  export declare function summaryCardKey(card: SummaryChartCard | DataTableSummaryValueCard, partTop?: number): string;
22
- export declare function summaryRequest<T>(cards: DataTableSummaryCard<T>[], columns: DataTableColumn<T>[]): DataTableSummaryRequest;
22
+ export declare function summaryRequest<T>(allCards: DataTableSummaryCard<T>[], columns: DataTableColumn<T>[], ctx?: DataTableSummaryCardContext<T>): DataTableSummaryRequest;
23
23
  export declare function ownCondition(group: DataTableFilterGroup, cardId: string): DataTableFilterCondition | undefined;
24
24
  export declare function withoutOwnCondition(group: DataTableFilterGroup, cardId: string): DataTableFilterGroup;
25
- export declare function setSummaryCondition(group: DataTableFilterGroup, cardId: string, condition: DataTableFilterCondition | null): DataTableFilterGroup;
25
+ export declare function setSummaryCondition(group: DataTableFilterGroup, cardId: string, condition: DataTableFilterCondition | null, where?: DataTableSummaryRowFilter['condition']): DataTableFilterGroup;
26
+ export declare function withoutOrphanWhere(group: DataTableFilterGroup): DataTableFilterGroup;
26
27
  export declare function breakdownCondition<T>(card: DataTableSummaryBreakdownCard, col: DataTableColumn<T> | undefined, value: GroupValue): DataTableFilterCondition;
27
28
  export declare function trendCondition(card: DataTableSummaryTrendCard, period: string): DataTableFilterCondition;
28
29
  export declare function funnelCondition(card: DataTableSummaryFunnelCard, stepId: string): DataTableFilterCondition | null;
@@ -30,12 +31,25 @@ export declare const bucketKey: (v: GroupValue) => string;
30
31
  export declare const OTHERS_KEY = "\0others";
31
32
  export declare function selectedKey(card: SummaryChartCard, cond: DataTableFilterCondition | undefined): string | null;
32
33
  export declare function computeFigure<T>(figure: DataTableSummaryFigure<T>, rows: T[]): number;
33
- export declare function countValues<T>(rows: T[], col: DataTableColumn<T>): DataTableSummaryBucket[];
34
- export declare function withChildren<T>(answer: DataTableSummaryBreakdown, rows: T[], col: DataTableColumn<T>, within: DataTableColumn<T>): DataTableSummaryBreakdown;
34
+ export declare const cardRows: <T>(card: {
35
+ where?: DataTableSummaryBreakdownCard<T>["where"];
36
+ }, rows: T[]) => T[];
37
+ export declare function countValues<T>(rows: T[], col: DataTableColumn<T>, sum?: DataTableSummarySum<T>): DataTableSummaryBucket[];
38
+ export declare function withChildren<T>(answer: DataTableSummaryBreakdown, rows: T[], col: DataTableColumn<T>, within: DataTableColumn<T>, sum?: DataTableSummarySum<T>): DataTableSummaryBreakdown;
35
39
  export declare const monthOf: (v: unknown) => string | null;
36
40
  export declare function lastMonths(n: number, now?: Date): string[];
37
41
  export declare function lastDays(n: number, now?: Date): string[];
38
- export declare function countPeriods<T>(rows: T[], col: DataTableColumn<T>, period: DataTableSummaryPeriod, count: number, now?: Date, split?: DataTableColumn<T>): DataTableSummaryPeriodCount[];
42
+ export declare function trendRangeOf(range: DataTableSummaryRange | null | undefined, period: DataTableSummaryPeriod, count: number, now?: Date): {
43
+ from: string;
44
+ to: string;
45
+ count: number;
46
+ } | null;
47
+ export declare function summaryCardFor<T>(card: DataTableSummaryCard<T>, ctx?: DataTableSummaryCardContext<T>, now?: Date): DataTableSummaryCard<T>;
48
+ export declare function countPeriods<T>(rows: T[], col: DataTableColumn<T>, period: DataTableSummaryPeriod, count: number, now?: Date, split?: DataTableColumn<T>, opts?: {
49
+ sum?: DataTableSummarySum<T>;
50
+ range?: Required<DataTableSummaryRange> | null;
51
+ }): DataTableSummaryPeriodCount[];
52
+ export declare const trendPeriods: <T>(card: DataTableSummaryTrendCard<T>, rows: T[], col: DataTableColumn<T>, split?: DataTableColumn<T>, now?: Date) => DataTableSummaryPeriodCount[];
39
53
  export declare function figureSeries<T>(rows: T[], figure: DataTableSummaryFigure<T>, col: DataTableColumn<T>, period: DataTableSummaryPeriod, count: number, now?: Date): {
40
54
  points: Array<{
41
55
  period: string;
@@ -87,6 +101,10 @@ export interface SummaryStepView {
87
101
  slot: ChartSlot;
88
102
  selectable: boolean;
89
103
  }
104
+ export type SummaryFigureView = Pick<DataTableSummaryValueFigure, 'label' | 'text'> & {
105
+ value: number | null;
106
+ };
107
+ export declare const SUMMARY_FIGURES_FIT = 4;
90
108
  export type ResolvedSummaryCard<T = any> = {
91
109
  key: string;
92
110
  width: DataTableSummaryWidth;
@@ -104,6 +122,7 @@ export type ResolvedSummaryCard<T = any> = {
104
122
  points: SummaryPeriodView[];
105
123
  previous: number;
106
124
  } | null;
125
+ figures?: SummaryFigureView[];
107
126
  } | {
108
127
  kind: 'ratio';
109
128
  card: DataTableSummaryCard<T> & {
@@ -140,6 +159,9 @@ export type ResolvedSummaryCard<T = any> = {
140
159
  reason: string;
141
160
  });
142
161
  export declare const drawsChart: (item: ResolvedSummaryCard) => boolean;
162
+ export declare const contentHeight: (item: ResolvedSummaryCard) => boolean;
163
+ export declare const summaryFormat: (item: ResolvedSummaryCard, num: (n: number) => string) => ((n: number) => string);
164
+ export declare const figureText: (f: Pick<DataTableSummaryValueFigure, "text">, n: string) => string;
143
165
  export declare const shareOf: (value: number, total: number) => number;
144
166
  export declare function percentText(p: number): string;
145
167
  export declare function sublineText(line: DataTableSummarySubline, n: string): string;
@@ -13,6 +13,9 @@ export interface TableSummaryInputs<TData> {
13
13
  others: string;
14
14
  };
15
15
  locale?: string;
16
+ selectionKey?: unknown;
16
17
  }
17
18
  export declare function resolveSummaryCards<TData>({ items, columns, serverMode, rowsFor, figures, filterGroup, query, labels, locale }: TableSummaryInputs<TData>): ResolvedSummaryCard<TData>[];
19
+ export declare const SUMMARY_SETTLE_MS = 250;
20
+ export declare const SUMMARY_SLICE_ROWS = 20000;
18
21
  export declare function useTableSummary<TData>(inputs: TableSummaryInputs<TData>): ResolvedSummaryCard<TData>[];
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export interface ToolbarMoreItem {
3
+ id: string;
4
+ label: string;
5
+ icon: React.ReactNode;
6
+ active?: boolean;
7
+ disabled?: boolean;
8
+ }
9
+ interface ToolbarMoreProps {
10
+ items: ToolbarMoreItem[];
11
+ onPick: (id: string) => void;
12
+ }
13
+ export declare function ToolbarMore({ items, onPick }: ToolbarMoreProps): React.JSX.Element;
14
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type RefObject } from 'react';
2
+ export interface ToolbarFitEntry {
3
+ id: string;
4
+ priority: number;
5
+ }
6
+ export interface ToolbarFit {
7
+ overflow: string[];
8
+ compact: boolean;
9
+ }
10
+ export declare function useToolbarFit(toolbarRef: RefObject<HTMLElement | null>, actionsRef: RefObject<HTMLElement | null>, entries: readonly ToolbarFitEntry[], key: string): ToolbarFit;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ export declare function TreeChips({ onExpandAll, onCollapseAll }: {
3
+ onExpandAll: () => void;
4
+ onCollapseAll: () => void;
5
+ }): React.JSX.Element;
@@ -0,0 +1,54 @@
1
+ import { type TreeExtraRows } from '../../../core/logic';
2
+ import { type ColumnTextContext } from '../columnValue';
3
+ import type { DataTableColumn } from '../types';
4
+ export declare const TREE_LEVEL_KEY = "__treeLevel";
5
+ export interface TreeLevels<T> {
6
+ depthOf: (row: T) => number | undefined;
7
+ isParent: (row: T) => boolean;
8
+ }
9
+ export interface TreeLevelLook {
10
+ mode: 'column' | 'indent';
11
+ header: string;
12
+ text: ColumnTextContext;
13
+ }
14
+ export interface TreeExport<T> {
15
+ rows: T[];
16
+ columns: DataTableColumn<T>[];
17
+ keys: string[];
18
+ inTotals?: (row: T) => boolean;
19
+ }
20
+ export declare function treeLevelsOf<T>(ordered: ReadonlyArray<{
21
+ row: T;
22
+ id: string;
23
+ depth: number;
24
+ }>, isParent: (id: string) => boolean): {
25
+ rows: T[];
26
+ levels: TreeLevels<T>;
27
+ };
28
+ export declare function treeLevelColumns<T>(columns: DataTableColumn<T>[], keys: string[], levels: TreeLevels<T>, look: TreeLevelLook): {
29
+ columns: DataTableColumn<T>[];
30
+ keys: string[];
31
+ };
32
+ export declare function treeFileOf<T>(rows: readonly T[], opts: {
33
+ idOf: (row: T) => string;
34
+ children?: (row: T) => T[] | null | undefined;
35
+ parentField?: string;
36
+ extra?: TreeExtraRows<T>;
37
+ }): {
38
+ rows: T[];
39
+ levels: TreeLevels<T>;
40
+ };
41
+ export declare const treeInTotals: <T>(levels: TreeLevels<T>, totals: "leaves" | "all") => ((row: T) => boolean) | undefined;
42
+ export declare function treeExportOf<T>(ordered: Array<{
43
+ row: {
44
+ id: string;
45
+ original: T;
46
+ };
47
+ depth: number;
48
+ }> | null, columns: DataTableColumn<T>[], keys: string[], opts: {
49
+ mode: 'column' | 'indent';
50
+ totals: 'leaves' | 'all';
51
+ isParent: (id: string) => boolean;
52
+ header: string;
53
+ text: ColumnTextContext;
54
+ }): TreeExport<T> | null;
@@ -0,0 +1 @@
1
+ export declare function withNestedValue<T>(row: T, path: string, value: unknown): T;
@@ -0,0 +1,15 @@
1
+ import type { DataTableDataSource, DataTableQuery } from '../types';
2
+ export declare function useTreeChildren<T>(opts: {
3
+ dataSource: DataTableDataSource<T> | undefined;
4
+ active: boolean;
5
+ query: DataTableQuery | null;
6
+ rowKey: string | undefined;
7
+ tick: number;
8
+ }): {
9
+ enabled: boolean;
10
+ rows: T[];
11
+ parents: Map<string, string>;
12
+ status: (id: string) => "error" | "loading" | "done" | undefined;
13
+ load: (id: string, parent: T) => void;
14
+ forget: (id: string) => void;
15
+ };
@@ -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
+ };