@affino/datagrid-vue-app 0.4.5 → 0.5.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 (31) hide show
  1. package/dist/DataGrid.d.ts +5 -4
  2. package/dist/chunks/DataGridGanttStageEntry-B7apnhQj.js +13614 -0
  3. package/dist/chunks/useDataGridAppRowModel-B8MCx0Ep.js +5503 -0
  4. package/dist/config/dataGridRowSelection.d.ts +12 -0
  5. package/dist/gantt/dataGridGanttWheel.d.ts +7 -0
  6. package/dist/gantt.js +1 -1
  7. package/dist/host/DataGridDefaultRenderer.d.ts +9 -0
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +607 -573
  10. package/dist/internal.js +2 -2
  11. package/dist/overlays/DataGridAdvancedFilterPopover.vue.d.ts +1 -1
  12. package/dist/overlays/DataGridColumnMenu.vue.d.ts +11 -11
  13. package/dist/overlays/DataGridMenuOverlay.vue.d.ts +85 -0
  14. package/dist/overlays/dataGridMenuOverlay.d.ts +7 -0
  15. package/dist/stage/DataGridCellContentRenderer.d.ts +7 -15
  16. package/dist/stage/DataGridTableStageCenterPane.vue.d.ts +41 -2
  17. package/dist/stage/DataGridTableStageChromeLayer.vue.d.ts +15 -0
  18. package/dist/stage/DataGridTableStageHeader.vue.d.ts +2 -2
  19. package/dist/stage/dataGridTableStage.types.d.ts +9 -2
  20. package/dist/stage/dataGridTableStageBody.types.d.ts +2 -0
  21. package/dist/stage/useDataGridStageChromeCanvas.d.ts +6 -3
  22. package/dist/stage/useDataGridStageChromeModel.d.ts +2 -1
  23. package/dist/stage/useDataGridStageOverlays.d.ts +1 -0
  24. package/dist/stage/useDataGridStageRowState.d.ts +1 -0
  25. package/dist/stage/useDataGridStageViewportRuntime.d.ts +10 -5
  26. package/dist/stage/useDataGridTableStageColumns.d.ts +1 -0
  27. package/dist/stage/useDataGridTableStageRuntime.d.ts +5 -1
  28. package/dist/stage/useDataGridTableStageScrollSync.d.ts +0 -4
  29. package/package.json +4 -4
  30. package/dist/chunks/DataGridGanttStageEntry-BlGuno5g.js +0 -12528
  31. package/dist/chunks/useDataGridAppRowModel-PWQ72nCy.js +0 -5659
package/dist/internal.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { d as t, r } from "./chunks/dataGridOverlayThemeVars-vzY74EIz.js";
2
2
  import { buildDataGridChromePaneModel as i, buildDataGridChromeRenderModel as d } from "@affino/datagrid-chrome";
3
- import { D as l, a as n, r as G, b as D, c as S, d as u, u as g, e as b, f as T } from "./chunks/useDataGridAppRowModel-PWQ72nCy.js";
4
- import { _ as p, a as c, c as R, b as x, d as C, p as f, u as v, e as M, f as h, g as w, h as y, i as F, j as P, k as A, l as O, m as _, n as E, o as H } from "./chunks/DataGridGanttStageEntry-BlGuno5g.js";
3
+ import { D as l, a as n, r as G, b as D, c as S, d as u, u as g, e as b, f as T } from "./chunks/useDataGridAppRowModel-B8MCx0Ep.js";
4
+ import { _ as p, a as c, c as R, b as x, d as C, p as f, u as v, e as M, f as h, g as w, h as y, i as F, j as P, k as A, l as O, m as _, n as E, o as H } from "./chunks/DataGridGanttStageEntry-B7apnhQj.js";
5
5
  import { _ as V } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-AVmOe3Bv.js";
6
6
  import { _ as k } from "./chunks/DataGridFindReplacePopover.vue_vue_type_script_setup_true_lang-BEVRKG31.js";
7
7
  import { buildDataGridTimelineRenderModels as B, normalizeDataGridGanttOptions as I, resolveDataGridTimelineRange as L } from "@affino/datagrid-gantt";
@@ -20,8 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_WithDefaults<__V
20
20
  }>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
21
21
  cancel: () => void;
22
22
  add: () => void;
23
- open: () => void;
24
23
  remove: (clauseId: number) => void;
24
+ open: () => void;
25
25
  apply: () => void;
26
26
  "reset-all": () => void;
27
27
  "update-clause": (payload: DataGridAppAdvancedFilterClausePatch) => void;
@@ -1,6 +1,8 @@
1
1
  import type { DataGridColumnHistogramEntry } from "@affino/datagrid-vue";
2
2
  import type { DataGridColumnMenuActionOptions, DataGridColumnMenuCustomItem, DataGridColumnMenuDisabledReasons, DataGridColumnMenuItemKey, DataGridColumnMenuItemLabels, DataGridColumnMenuTriggerMode } from "./dataGridColumnMenu";
3
+ import type { DataGridMenuOverlayOpenReason } from "./dataGridMenuOverlay";
3
4
  type DataGridColumnPin = "left" | "right" | "none";
5
+ type DataGridColumnMenuOpenReason = DataGridMenuOverlayOpenReason;
4
6
  type DataGridColumnMenuValueEntriesResult = readonly DataGridColumnHistogramEntry[] | Promise<readonly DataGridColumnHistogramEntry[]>;
5
7
  type __VLS_Props = {
6
8
  rowCount: number;
@@ -28,29 +30,27 @@ type __VLS_Props = {
28
30
  filterActive: boolean;
29
31
  selectedFilterTokens: readonly string[];
30
32
  maxFilterValues: number;
33
+ anchorElement?: HTMLElement | null;
34
+ openReason?: DataGridColumnMenuOpenReason;
31
35
  };
32
- declare function toggleMenuFromElement(element: HTMLElement | null): void;
33
- declare var __VLS_15: {
36
+ declare var __VLS_13: {
34
37
  open: boolean;
35
- toggleMenuFromElement: typeof toggleMenuFromElement;
36
- }, __VLS_17: {
37
- open: boolean;
38
- toggleMenuFromElement: typeof toggleMenuFromElement;
38
+ toggleMenuFromElement: (element: HTMLElement | null, reason?: DataGridMenuOverlayOpenReason) => void;
39
39
  };
40
40
  type __VLS_Slots = {} & {
41
- default?: (props: typeof __VLS_15) => any;
42
- } & {
43
- default?: (props: typeof __VLS_17) => any;
41
+ default?: (props: typeof __VLS_13) => any;
44
42
  };
45
43
  declare const __VLS_base: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
46
- sort: (direction: "desc" | "asc" | null) => void;
44
+ sort: (direction: "asc" | "desc" | null) => void;
47
45
  pin: (pin: DataGridColumnPin) => void;
48
46
  group: (grouped: boolean) => void;
49
47
  "apply-filter": (tokens: readonly string[]) => void;
50
48
  "clear-filter": () => void;
51
49
  "update-text-filter": (value: string) => void;
50
+ close: () => void;
52
51
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & {
53
- onSort?: ((direction: "desc" | "asc" | null) => any) | undefined;
52
+ onClose?: (() => any) | undefined;
53
+ onSort?: ((direction: "asc" | "desc" | null) => any) | undefined;
54
54
  onGroup?: ((grouped: boolean) => any) | undefined;
55
55
  onPin?: ((pin: DataGridColumnPin) => any) | undefined;
56
56
  "onApply-filter"?: ((tokens: readonly string[]) => any) | undefined;
@@ -0,0 +1,85 @@
1
+ import { type CSSProperties } from "vue";
2
+ import { type MenuOptions } from "@affino/menu-vue";
3
+ import type { DataGridMenuOverlayOpenReason } from "./dataGridMenuOverlay";
4
+ type DataGridMenuContentAlign = "start" | "center" | "end";
5
+ type __VLS_Props = {
6
+ contextMenuEnabled?: boolean;
7
+ options: MenuOptions;
8
+ contentClassName: string;
9
+ align?: DataGridMenuContentAlign;
10
+ gutter?: number;
11
+ contentStyle?: CSSProperties | Record<string, string>;
12
+ contentAttrs?: Record<string, string | boolean | number | undefined>;
13
+ };
14
+ declare function closeMenu(): void;
15
+ declare function openMenuFromElement(element: HTMLElement | null, reason?: DataGridMenuOverlayOpenReason): void;
16
+ declare function toggleMenuFromElement(element: HTMLElement | null, reason?: DataGridMenuOverlayOpenReason): void;
17
+ declare var __VLS_15: {
18
+ open: boolean;
19
+ toggleMenuFromElement: typeof toggleMenuFromElement;
20
+ }, __VLS_17: {
21
+ open: boolean;
22
+ toggleMenuFromElement: typeof toggleMenuFromElement;
23
+ }, __VLS_25: {
24
+ open: boolean;
25
+ closeMenu: typeof closeMenu;
26
+ };
27
+ type __VLS_Slots = {} & {
28
+ trigger?: (props: typeof __VLS_15) => any;
29
+ } & {
30
+ trigger?: (props: typeof __VLS_17) => any;
31
+ } & {
32
+ content?: (props: typeof __VLS_25) => any;
33
+ };
34
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
35
+ contextMenuEnabled: boolean;
36
+ align: string;
37
+ gutter: number;
38
+ contentAttrs: () => {};
39
+ }>, {
40
+ closeMenu: typeof closeMenu;
41
+ openMenuFromElement: typeof openMenuFromElement;
42
+ toggleMenuFromElement: typeof toggleMenuFromElement;
43
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
44
+ close: () => void;
45
+ open: () => void;
46
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
47
+ contextMenuEnabled: boolean;
48
+ align: string;
49
+ gutter: number;
50
+ contentAttrs: () => {};
51
+ }>>> & {
52
+ onClose?: (() => any) | undefined;
53
+ onOpen?: (() => any) | undefined;
54
+ }, {
55
+ contextMenuEnabled: boolean;
56
+ align: DataGridMenuContentAlign;
57
+ gutter: number;
58
+ contentAttrs: Record<string, string | boolean | number | undefined>;
59
+ }, {}>;
60
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
61
+ declare const _default: typeof __VLS_export;
62
+ export default _default;
63
+ type __VLS_TypePropsToOption<T> = {
64
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
65
+ type: import('vue').PropType<Required<T>[K]>;
66
+ } : {
67
+ type: import('vue').PropType<T[K]>;
68
+ required: true;
69
+ };
70
+ };
71
+ type __VLS_WithDefaults<P, D> = {
72
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_PrettifyLocal<P[K] & {
73
+ default: D[K];
74
+ }> : P[K];
75
+ };
76
+ type __VLS_WithSlots<T, S> = T & {
77
+ new (): {
78
+ $slots: S;
79
+ };
80
+ };
81
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
82
+ [K in keyof T]: T[K];
83
+ } : {
84
+ [K in keyof T as K]: T[K];
85
+ }) & {};
@@ -0,0 +1,7 @@
1
+ export type DataGridMenuOverlayOpenReason = "button" | "contextmenu" | "keyboard";
2
+ export type DataGridMenuOverlayControllerOpenReason = "pointer" | "keyboard" | "programmatic";
3
+ export interface DataGridMenuOverlayController {
4
+ closeMenu: () => void;
5
+ openMenuFromElement: (element: HTMLElement | null, reason?: DataGridMenuOverlayOpenReason) => void;
6
+ toggleMenuFromElement: (element: HTMLElement | null, reason?: DataGridMenuOverlayOpenReason) => void;
7
+ }
@@ -1,15 +1,7 @@
1
- import { type PropType, type VNodeChild } from "vue";
2
- declare const _default: import("vue").DefineComponent<{
3
- content: {
4
- type: PropType<VNodeChild>;
5
- default: null;
6
- };
7
- }, () => VNodeChild, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
8
- content: {
9
- type: PropType<VNodeChild>;
10
- default: null;
11
- };
12
- }>>, {
13
- content: VNodeChild;
14
- }, {}>;
15
- export default _default;
1
+ import { type FunctionalComponent, type VNodeChild } from "vue";
2
+ interface DataGridCellContentRendererProps {
3
+ content?: VNodeChild;
4
+ contentKey?: string;
5
+ }
6
+ declare const DataGridCellContentRenderer: FunctionalComponent<DataGridCellContentRendererProps>;
7
+ export default DataGridCellContentRenderer;
@@ -1,11 +1,21 @@
1
1
  import { type PropType } from "vue";
2
- import type { DataGridTableStageBodyRow, DataGridTableStageCenterPaneRenderApi, DataGridTableStageOverlayLane, DataGridTableStageOverlaySegment } from "./dataGridTableStageBody.types";
2
+ import type { DataGridTableStageBodyRow, DataGridTableStageBodyRowKeyMode, DataGridTableStageCenterPaneRenderApi, DataGridTableStageOverlayLane, DataGridTableStageOverlaySegment } from "./dataGridTableStageBody.types";
3
3
  import type { DataGridElementRefHandler, DataGridTableStageCenterPaneDiagnostics } from "./dataGridTableStage.types";
4
- declare const __VLS_export: import("vue").DefineComponent<{
4
+ declare var __VLS_1: {}, __VLS_3: {};
5
+ type __VLS_Slots = {} & {
6
+ chrome?: (props: typeof __VLS_1) => any;
7
+ } & {
8
+ 'content-chrome'?: (props: typeof __VLS_3) => any;
9
+ };
10
+ declare const __VLS_base: import("vue").DefineComponent<{
5
11
  viewportRef: {
6
12
  type: PropType<DataGridElementRefHandler>;
7
13
  default: undefined;
8
14
  };
15
+ contentRef: {
16
+ type: PropType<DataGridElementRefHandler>;
17
+ default: undefined;
18
+ };
9
19
  displayRows: {
10
20
  type: PropType<readonly DataGridTableStageBodyRow[]>;
11
21
  required: true;
@@ -18,6 +28,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
18
28
  type: PropType<string | number | null>;
19
29
  default: null;
20
30
  };
31
+ rowKeyMode: {
32
+ type: PropType<DataGridTableStageBodyRowKeyMode>;
33
+ default: string;
34
+ };
21
35
  topSpacerHeight: {
22
36
  type: NumberConstructor;
23
37
  default: undefined;
@@ -34,6 +48,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
34
48
  type: NumberConstructor;
35
49
  default: number;
36
50
  };
51
+ innerHorizontalScrollport: {
52
+ type: BooleanConstructor;
53
+ default: boolean;
54
+ };
37
55
  handleScroll: {
38
56
  type: PropType<(event: Event) => void>;
39
57
  default: undefined;
@@ -91,6 +109,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
91
109
  type: PropType<DataGridElementRefHandler>;
92
110
  default: undefined;
93
111
  };
112
+ contentRef: {
113
+ type: PropType<DataGridElementRefHandler>;
114
+ default: undefined;
115
+ };
94
116
  displayRows: {
95
117
  type: PropType<readonly DataGridTableStageBodyRow[]>;
96
118
  required: true;
@@ -103,6 +125,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
103
125
  type: PropType<string | number | null>;
104
126
  default: null;
105
127
  };
128
+ rowKeyMode: {
129
+ type: PropType<DataGridTableStageBodyRowKeyMode>;
130
+ default: string;
131
+ };
106
132
  topSpacerHeight: {
107
133
  type: NumberConstructor;
108
134
  default: undefined;
@@ -119,6 +145,10 @@ declare const __VLS_export: import("vue").DefineComponent<{
119
145
  type: NumberConstructor;
120
146
  default: number;
121
147
  };
148
+ innerHorizontalScrollport: {
149
+ type: BooleanConstructor;
150
+ default: boolean;
151
+ };
122
152
  handleScroll: {
123
153
  type: PropType<(event: Event) => void>;
124
154
  default: undefined;
@@ -180,14 +210,23 @@ declare const __VLS_export: import("vue").DefineComponent<{
180
210
  reportFillPlumbingDetail: ((layer: string, value: string) => void) | undefined;
181
211
  handleKeydown: (event: KeyboardEvent) => void;
182
212
  viewportRef: DataGridElementRefHandler;
213
+ contentRef: DataGridElementRefHandler;
183
214
  bodyRowsRevision: string | number | null;
215
+ rowKeyMode: DataGridTableStageBodyRowKeyMode;
184
216
  viewportClass: string;
185
217
  viewportTabIndex: number;
218
+ innerHorizontalScrollport: boolean;
186
219
  handleScroll: (event: Event) => void;
187
220
  handleWheel: (event: WheelEvent) => void;
188
221
  handleContextMenu: (event: MouseEvent) => void;
189
222
  overlayLanes: readonly DataGridTableStageOverlayLane[];
190
223
  perfTraceEnabled: boolean;
191
224
  }, {}>;
225
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
192
226
  declare const _default: typeof __VLS_export;
193
227
  export default _default;
228
+ type __VLS_WithSlots<T, S> = T & {
229
+ new (): {
230
+ $slots: S;
231
+ };
232
+ };
@@ -0,0 +1,15 @@
1
+ import type { DataGridChromePaneModel } from "@affino/datagrid-chrome";
2
+ type __VLS_Props = {
3
+ model: DataGridChromePaneModel;
4
+ };
5
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}, {}>;
6
+ declare const _default: typeof __VLS_export;
7
+ export default _default;
8
+ type __VLS_TypePropsToOption<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<Required<T>[K]>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
@@ -1,11 +1,11 @@
1
1
  import { type CSSProperties, type PropType } from "vue";
2
- declare var __VLS_1: {}, __VLS_3: {}, __VLS_31: {};
2
+ declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
3
3
  type __VLS_Slots = {} & {
4
4
  'center-chrome'?: (props: typeof __VLS_1) => any;
5
5
  } & {
6
6
  'left-chrome'?: (props: typeof __VLS_3) => any;
7
7
  } & {
8
- 'right-chrome'?: (props: typeof __VLS_31) => any;
8
+ 'right-chrome'?: (props: typeof __VLS_5) => any;
9
9
  };
10
10
  declare const __VLS_base: import("vue").DefineComponent<{
11
11
  paneLayoutStyle: {
@@ -4,6 +4,7 @@ import type { DataGridFillBehavior } from "@affino/datagrid-vue/advanced";
4
4
  import type { DataGridLayoutMode } from "../config/dataGridLayout";
5
5
  import type { DataGridColumnMenuActionOptions, DataGridColumnMenuCustomItem, DataGridColumnMenuDisabledReasons, DataGridColumnMenuItemKey, DataGridColumnMenuItemLabels, DataGridColumnMenuTriggerMode } from "../overlays/dataGridColumnMenu";
6
6
  export type DataGridTableMode = "base" | "tree" | "pivot" | "worker";
7
+ export type DataGridColumnMenuOpenReason = "button" | "contextmenu" | "keyboard";
7
8
  export type DataGridColumnMenuValueEntriesResult = readonly DataGridColumnHistogramEntry[] | Promise<readonly DataGridColumnHistogramEntry[]>;
8
9
  export type DataGridPendingEdge = "top" | "right" | "bottom" | "left";
9
10
  export type DataGridTableRow<TRow extends Record<string, unknown>> = DataGridRowNode<TRow>;
@@ -21,6 +22,11 @@ export interface DataGridTableStageCustomOverlay {
21
22
  hideSingleCell?: boolean;
22
23
  zIndex?: number;
23
24
  }
25
+ export interface DataGridActiveColumnMenuState {
26
+ columnId: string;
27
+ anchorEl: HTMLElement;
28
+ reason: DataGridColumnMenuOpenReason;
29
+ }
24
30
  export interface DataGridTableStageCenterPaneDiagnostics {
25
31
  mounted?: boolean;
26
32
  debugJson?: string;
@@ -58,8 +64,6 @@ export interface DataGridTableStageViewportSection {
58
64
  rightColumnSpacerWidth: number;
59
65
  headerViewportRef: DataGridElementRefHandler;
60
66
  bodyViewportRef: DataGridElementRefHandler;
61
- handleHeaderWheel: (event: WheelEvent) => void;
62
- handleHeaderScroll: (event: Event) => void;
63
67
  handleViewportScroll: (event: Event) => void;
64
68
  handleViewportKeydown: (event: KeyboardEvent) => void;
65
69
  }
@@ -101,6 +105,9 @@ export interface DataGridTableStageColumnsSection {
101
105
  applyColumnMenuGroupBy?: (columnKey: string, grouped: boolean) => void;
102
106
  applyColumnMenuFilter?: (columnKey: string, tokens: readonly string[]) => void;
103
107
  clearColumnMenuFilter?: (columnKey: string) => void;
108
+ activeColumnMenu?: DataGridActiveColumnMenuState | null;
109
+ openColumnMenu?: (columnKey: string, anchorEl: HTMLElement, reason: DataGridColumnMenuOpenReason) => void;
110
+ closeColumnMenu?: () => void;
104
111
  startResize: (event: MouseEvent, columnKey: string) => void;
105
112
  handleResizeDoubleClick: (event: MouseEvent, columnKey: string) => void;
106
113
  }
@@ -4,6 +4,7 @@ import type { DataGridAppCellRenderer, DataGridAppGroupCellRenderer } from "../c
4
4
  import type { DataGridFilterableComboboxOption } from "../overlays/dataGridFilterableCombobox";
5
5
  import type { DataGridTableRow } from "./dataGridTableStage.types";
6
6
  export type DataGridTableStageBodyRow = DataGridTableRow<Record<string, unknown>>;
7
+ export type DataGridTableStageBodyRowKeyMode = "row" | "recycled";
7
8
  export type DataGridTableStageBodyColumn = DataGridColumnSnapshot & {
8
9
  column: DataGridColumnSnapshot["column"] & {
9
10
  cellRenderer?: DataGridAppCellRenderer<Record<string, unknown>> | null;
@@ -112,6 +113,7 @@ export interface DataGridTableStageCenterPaneRenderApi extends DataGridTableStag
112
113
  }
113
114
  export interface DataGridTableStagePinnedPaneProps {
114
115
  side: "left" | "right";
116
+ rowKeyMode?: DataGridTableStageBodyRowKeyMode;
115
117
  width: number;
116
118
  style: CSSProperties;
117
119
  contentStyle: CSSProperties;
@@ -1,10 +1,12 @@
1
1
  import { type ComputedRef, type Ref } from "vue";
2
2
  import type { DataGridChromeRenderModel } from "@affino/datagrid-chrome";
3
- type GridChromeRedrawMode = "full" | "center-scroll";
3
+ type GridChromeRedrawMode = "full" | "center-scroll" | "body-scroll";
4
+ type GridChromeRedrawSource = string;
4
5
  export interface UseDataGridStageChromeCanvasOptions {
5
6
  stageRootEl: Ref<HTMLElement | null>;
6
7
  bodyShellRef: Ref<HTMLElement | null>;
7
8
  bodyViewportEl: Ref<HTMLElement | null>;
9
+ verticalBodyViewportEl: Ref<HTMLElement | null>;
8
10
  bottomViewportEl: Ref<HTMLElement | null>;
9
11
  leftHeaderChromeCanvasEl: Ref<HTMLCanvasElement | null>;
10
12
  centerHeaderChromeCanvasEl: Ref<HTMLCanvasElement | null>;
@@ -19,6 +21,7 @@ export interface UseDataGridStageChromeCanvasOptions {
19
21
  bodyViewportScrollLeft: Ref<number>;
20
22
  bodyViewportClientWidth: Ref<number>;
21
23
  bodyViewportClientHeight: Ref<number>;
24
+ bodyViewportShellClientWidth: Ref<number>;
22
25
  pinnedBottomViewportClientHeight: Ref<number>;
23
26
  bodyViewportTopOffset: Ref<number>;
24
27
  headerShellHeight: Ref<number>;
@@ -33,8 +36,8 @@ export interface UseDataGridStageChromeCanvasResult {
33
36
  syncBodyViewportMetrics: () => void;
34
37
  syncPinnedBottomViewportMetrics: () => void;
35
38
  syncPinnedBottomViewportScrollLeft: () => void;
36
- scheduleGridChromeRedraw: (mode?: GridChromeRedrawMode) => void;
37
- flushGridChromeRedraw: (mode?: GridChromeRedrawMode) => void;
39
+ scheduleGridChromeRedraw: (mode?: GridChromeRedrawMode, source?: GridChromeRedrawSource) => void;
40
+ flushGridChromeRedraw: (mode?: GridChromeRedrawMode, source?: GridChromeRedrawSource) => void;
38
41
  connectGridChromeResizeObserver: () => void;
39
42
  disconnectGridChromeResizeObserver: () => void;
40
43
  }
@@ -1,5 +1,5 @@
1
1
  import { type ComputedRef, type Ref } from "vue";
2
- import { type DataGridChromeRenderModel } from "@affino/datagrid-chrome";
2
+ import { type DataGridChromePaneModel, type DataGridChromeRenderModel } from "@affino/datagrid-chrome";
3
3
  import type { DataGridTableStageBodyColumn, DataGridTableStageBodyRow } from "./dataGridTableStageBody.types";
4
4
  import type { DataGridTableStageLayoutSection, DataGridTableStageRowsSection, DataGridTableStageViewportSection } from "./dataGridTableStage.types";
5
5
  interface DataGridPivotHeaderMeta {
@@ -42,6 +42,7 @@ export interface UseDataGridStageChromeModelResult {
42
42
  chromeRenderModel: ComputedRef<DataGridChromeRenderModel>;
43
43
  headerChromeRenderModel: ComputedRef<DataGridChromeRenderModel>;
44
44
  pinnedBottomChromeRenderModel: ComputedRef<DataGridChromeRenderModel>;
45
+ bodyCenterChromeLayerModel: ComputedRef<DataGridChromePaneModel>;
45
46
  hasPivotHeaderGroups: ComputedRef<boolean>;
46
47
  rowMetrics: ComputedRef<readonly {
47
48
  top: number;
@@ -7,6 +7,7 @@ export interface UseDataGridStageOverlaysOptions {
7
7
  overlayGeometryContext: ComputedRef<DataGridStageOverlayGeometryContext>;
8
8
  bodyViewportClientHeight: Ref<number>;
9
9
  bodyViewportScrollTop: Ref<number>;
10
+ bodyOverlayRowOrigin?: Ref<number>;
10
11
  bottomViewportClientHeight: Ref<number>;
11
12
  visibleColumns: ComputedRef<readonly DataGridTableStageBodyColumn[]>;
12
13
  displayRows: ComputedRef<readonly unknown[]>;
@@ -45,6 +45,7 @@ export interface UseDataGridStageRowStateOptions {
45
45
  startInlineEditIfAllowed: (row: DataGridTableStageBodyRow, column: DataGridTableStageBodyColumn, rowOffset: number) => void;
46
46
  handleCellClick: (row: DataGridTableStageBodyRow, rowOffset: number, column: DataGridTableStageBodyColumn, columnIndex: number) => void;
47
47
  hasExplicitGroupCellRenderer: Readonly<Ref<boolean>>;
48
+ useCanvasChrome?: Readonly<Ref<boolean>>;
48
49
  cells: Readonly<Ref<{
49
50
  isSelectionAnchorCell?: (rowOffset: number, columnIndex: number) => boolean;
50
51
  isCellInFillPreview?: (rowOffset: number, columnIndex: number) => boolean;
@@ -1,12 +1,13 @@
1
1
  import { type ComponentPublicInstance, type Ref } from "vue";
2
2
  import type { DataGridTableStageViewportSection } from "./dataGridTableStage.types";
3
- type GridChromeRedrawMode = "full" | "center-scroll";
3
+ type GridChromeRedrawMode = "full" | "center-scroll" | "body-scroll";
4
+ type GridChromeRedrawSource = string;
4
5
  export interface UseDataGridStageViewportRuntimeSyncers {
5
6
  syncBodyViewportMetrics: () => void;
6
7
  syncPinnedBottomViewportMetrics: () => void;
7
8
  syncPinnedBottomViewportScrollLeft: () => void;
8
- scheduleGridChromeRedraw: (mode?: GridChromeRedrawMode) => void;
9
- flushGridChromeRedraw: (mode?: GridChromeRedrawMode) => void;
9
+ scheduleGridChromeRedraw: (mode?: GridChromeRedrawMode, source?: GridChromeRedrawSource) => void;
10
+ flushGridChromeRedraw: (mode?: GridChromeRedrawMode, source?: GridChromeRedrawSource) => void;
10
11
  connectGridChromeResizeObserver: () => void;
11
12
  disconnectGridChromeResizeObserver: () => void;
12
13
  }
@@ -14,18 +15,20 @@ export interface UseDataGridStageViewportRuntimeOptions {
14
15
  stageRootEl: Readonly<Ref<HTMLElement | null>>;
15
16
  viewport: Readonly<Ref<DataGridTableStageViewportSection>>;
16
17
  gridChromeSyncers: Readonly<Ref<UseDataGridStageViewportRuntimeSyncers>>;
17
- leftPaneContentRef: Readonly<Ref<HTMLElement | null>>;
18
- rightPaneContentRef: Readonly<Ref<HTMLElement | null>>;
19
18
  perfTraceEnabled?: boolean;
20
19
  }
21
20
  export interface UseDataGridStageViewportRuntimeResult {
22
21
  bodyViewportEl: Ref<HTMLElement | null>;
22
+ verticalBodyViewportEl: Ref<HTMLElement | null>;
23
+ centerHorizontalViewportEl: Ref<HTMLElement | null>;
24
+ sharedVerticalViewportEl: Ref<HTMLElement | null>;
23
25
  topViewportEl: Ref<HTMLElement | null>;
24
26
  bottomViewportEl: Ref<HTMLElement | null>;
25
27
  bodyViewportScrollTop: Ref<number>;
26
28
  bodyViewportScrollLeft: Ref<number>;
27
29
  bodyViewportClientWidth: Ref<number>;
28
30
  bodyViewportClientHeight: Ref<number>;
31
+ bodyViewportShellClientWidth: Ref<number>;
29
32
  pinnedTopViewportClientHeight: Ref<number>;
30
33
  pinnedBottomViewportClientHeight: Ref<number>;
31
34
  bodyViewportTopOffset: Ref<number>;
@@ -35,9 +38,11 @@ export interface UseDataGridStageViewportRuntimeResult {
35
38
  isBodyViewportScrollIdle: Ref<boolean>;
36
39
  runWhenBodyViewportScrollIdle: (callback: () => void) => void;
37
40
  captureBodyViewportRef: (value: Element | ComponentPublicInstance | null) => void;
41
+ captureSharedVerticalViewportRef: (value: Element | ComponentPublicInstance | null) => void;
38
42
  capturePinnedTopViewportRef: (value: Element | ComponentPublicInstance | null) => void;
39
43
  capturePinnedBottomViewportRef: (value: Element | ComponentPublicInstance | null) => void;
40
44
  handleCenterViewportScroll: (event: Event) => void;
45
+ handleSharedVerticalViewportScroll: (event: Event) => void;
41
46
  handlePinnedTopViewportScroll: (event: Event) => void;
42
47
  handlePinnedBottomViewportScroll: (event: Event) => void;
43
48
  handleLinkedViewportWheel: (event: WheelEvent) => void;
@@ -6,6 +6,7 @@ export interface UseDataGridTableStageColumnsOptions<TRow extends Record<string,
6
6
  runtime: Pick<import("@affino/datagrid-vue").UseDataGridRuntimeResult<TRow>, "api">;
7
7
  visibleColumns: Ref<readonly DataGridColumnSnapshot[]>;
8
8
  showRowSelection?: Ref<boolean>;
9
+ rowSelectionColumnWidth?: Ref<number>;
9
10
  isCellEditable?: DataGridCellEditablePredicate<TRow>;
10
11
  }
11
12
  export interface UseDataGridTableStageColumnsResult<TRow extends Record<string, unknown>> {
@@ -10,7 +10,7 @@ import type { DataGridPlaceholderRowsOptions } from "../config/dataGridPlacehold
10
10
  import type { DataGridVirtualizationOptions } from "../config/dataGridVirtualization";
11
11
  import type { DataGridTableStageContext } from "./dataGridTableStageContext";
12
12
  import type { DataGridTableStageHistoryAdapter } from "./useDataGridTableStageHistory";
13
- import type { DataGridColumnMenuValueEntriesResult, DataGridTableRow, DataGridTableStageCellClass, DataGridTableStageCenterPaneDiagnostics, DataGridTableStageProps } from "./dataGridTableStage.types";
13
+ import type { DataGridActiveColumnMenuState, DataGridColumnMenuOpenReason, DataGridColumnMenuValueEntriesResult, DataGridTableRow, DataGridTableStageCellClass, DataGridTableStageCenterPaneDiagnostics, DataGridTableStageProps } from "./dataGridTableStage.types";
14
14
  export type { DataGridTableStageHistoryAdapter } from "./useDataGridTableStageHistory";
15
15
  interface DataGridAppFillProjectionContext {
16
16
  sortModel: readonly DataGridSortState[];
@@ -224,6 +224,7 @@ export interface UseDataGridTableStageRuntimeOptions<TRow extends Record<string,
224
224
  chromeSignature?: Ref<string | undefined>;
225
225
  showRowIndex?: Ref<boolean>;
226
226
  showRowSelection?: Ref<boolean>;
227
+ rowSelectionColumnWidth?: Ref<number>;
227
228
  isRowInPendingClipboardCut?: (row: import("@affino/datagrid-vue").DataGridRowNode<TRow>) => boolean;
228
229
  syncRowSelectionSnapshotFromRuntime?: () => void;
229
230
  flushRowSelectionSnapshotUpdates?: () => void;
@@ -264,6 +265,9 @@ export interface UseDataGridTableStageRuntimeOptions<TRow extends Record<string,
264
265
  applyColumnMenuGroupBy?: (columnKey: string, grouped: boolean) => void;
265
266
  applyColumnMenuFilter?: (columnKey: string, tokens: readonly string[]) => void;
266
267
  clearColumnMenuFilter?: (columnKey: string) => void;
268
+ activeColumnMenu?: Ref<DataGridActiveColumnMenuState | null>;
269
+ openColumnMenu?: (columnKey: string, anchorEl: HTMLElement, reason: DataGridColumnMenuOpenReason) => void;
270
+ closeColumnMenu?: () => void;
267
271
  onCellEdit?: (payload: {
268
272
  rowId: string | number;
269
273
  columnKey: string;
@@ -1,6 +1,5 @@
1
1
  import type { Ref } from "vue";
2
2
  export interface UseDataGridTableStageScrollSyncOptions {
3
- bodyViewportRef: Ref<HTMLElement | null>;
4
3
  isColumnResizing: Ref<boolean>;
5
4
  applyColumnResizeFromPointer: (clientX: number) => void;
6
5
  stopColumnResize: () => void;
@@ -10,7 +9,6 @@ export interface UseDataGridTableStageScrollSyncOptions {
10
9
  handleInteractionWindowPointerCancel: () => void;
11
10
  handleInteractionWindowBlur: () => void;
12
11
  handleInteractionWindowContextMenuCapture: (event: MouseEvent) => boolean;
13
- syncViewport: (event: Event) => void;
14
12
  }
15
13
  export interface UseDataGridTableStageScrollSyncResult {
16
14
  handleWindowMouseMove: (event: MouseEvent) => void;
@@ -18,8 +16,6 @@ export interface UseDataGridTableStageScrollSyncResult {
18
16
  handleWindowPointerCancel: (event: PointerEvent) => void;
19
17
  handleWindowBlur: () => void;
20
18
  handleWindowContextMenuCapture: (event: MouseEvent) => boolean;
21
- handleHeaderWheel: (event: WheelEvent) => void;
22
- handleHeaderScroll: (event: Event) => void;
23
19
  handleWindowMouseUp: () => void;
24
20
  }
25
21
  export declare function useDataGridTableStageScrollSync(options: UseDataGridTableStageScrollSyncOptions): UseDataGridTableStageScrollSyncResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@affino/datagrid-vue-app",
3
- "version": "0.4.5",
3
+ "version": "0.5.0",
4
4
  "description": "Declarative Vue DataGrid component for Affino",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,10 +45,10 @@
45
45
  "dependencies": {
46
46
  "@affino/menu-vue": "^2.1.1",
47
47
  "@affino/popover-vue": "^1.1.0",
48
- "@affino/datagrid-theme": "0.2.4",
49
- "@affino/datagrid-vue": "0.4.1",
48
+ "@affino/datagrid-gantt": "0.1.2",
49
+ "@affino/datagrid-vue": "0.5.0",
50
50
  "@affino/datagrid-chrome": "0.1.1",
51
- "@affino/datagrid-gantt": "0.1.2"
51
+ "@affino/datagrid-theme": "0.2.4"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "vue": "^3.3.0"