@affino/datagrid-vue-app 0.1.4 → 0.1.6

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.
@@ -1,9 +1,21 @@
1
- import type { CreateClientRowModelOptions, DataGridColumnInput, DataGridComputedFieldDefinition, DataGridFormulaFieldDefinition, DataGridFormulaFunctionRegistry } from "@affino/datagrid-vue";
1
+ import type { VNodeChild } from "vue";
2
+ import type { CreateClientRowModelOptions, DataGridColumnInput, DataGridColumnSnapshot, DataGridComputedFieldDefinition, DataGridFormulaFieldDefinition, DataGridFormulaFunctionRegistry, DataGridRowNode } from "@affino/datagrid-vue";
2
3
  /**
3
4
  * High-level authored column contract for `@affino/datagrid-vue-app`.
4
5
  */
5
- export interface DataGridAppColumnInput extends DataGridColumnInput {
6
+ export interface DataGridAppCellRendererContext<TRow = unknown> {
7
+ row: TRow | undefined;
8
+ rowNode: DataGridRowNode<TRow>;
9
+ rowOffset: number;
10
+ column: DataGridColumnSnapshot;
11
+ columnIndex: number;
12
+ value: string;
13
+ displayValue: string;
14
+ }
15
+ export type DataGridAppCellRenderer<TRow = unknown> = (context: DataGridAppCellRendererContext<TRow>) => VNodeChild;
16
+ export interface DataGridAppColumnInput<TRow = unknown> extends DataGridColumnInput<TRow> {
6
17
  formula?: string | null;
18
+ cellRenderer?: DataGridAppCellRenderer<TRow> | null;
7
19
  }
8
20
  export interface DataGridDeclarativeFormulaOptions<TRow = unknown> {
9
21
  formulas?: readonly DataGridFormulaFieldDefinition[] | null;
@@ -0,0 +1,7 @@
1
+ export type DataGridLayoutMode = "fill" | "auto-height";
2
+ export interface DataGridResolvedLayoutOptions {
3
+ layoutMode: DataGridLayoutMode;
4
+ minRows: number | null;
5
+ maxRows: number | null;
6
+ }
7
+ export declare function resolveDataGridLayoutOptions(layoutMode: DataGridLayoutMode | undefined, minRows?: number | null, maxRows?: number | null): DataGridResolvedLayoutOptions;
package/dist/gantt.js CHANGED
@@ -1,4 +1,4 @@
1
- import { default as t } from "./chunks/DataGridGanttStageEntry-D4NqLvKS.js";
1
+ import { default as t } from "./chunks/DataGridGanttStageEntry-BydDrrtc.js";
2
2
  import { buildDataGridTimelineRenderModels as r, normalizeDataGridGanttOptions as d, resolveDataGridTimelineRange as n } from "@affino/datagrid-gantt";
3
3
  export {
4
4
  t as DataGridGanttStage,
@@ -9,6 +9,7 @@ import type { DataGridColumnLayoutOptions } from "../config/dataGridColumnLayout
9
9
  import { type DataGridColumnMenuOptions } from "../overlays/dataGridColumnMenu";
10
10
  import { type DataGridCellMenuOptions, type DataGridRowIndexMenuOptions } from "../overlays/dataGridContextMenu";
11
11
  import { type DataGridAppViewMode, type DataGridGanttProp } from "../gantt/dataGridGantt";
12
+ import type { DataGridLayoutMode } from "../config/dataGridLayout";
12
13
  import type { DataGridVirtualizationOptions } from "../config/dataGridVirtualization";
13
14
  type DataGridMode = "base" | "tree" | "pivot" | "worker";
14
15
  type DataGridDefaultRendererRuntime = Pick<UseDataGridRuntimeResult<Record<string, unknown>>, "api" | "syncBodyRowsInRange" | "rowPartition" | "virtualWindow" | "columnSnapshot"> & {
@@ -108,6 +109,18 @@ declare const _default: import("vue").DefineComponent<{
108
109
  type: NumberConstructor;
109
110
  default: number;
110
111
  };
112
+ layoutMode: {
113
+ type: PropType<DataGridLayoutMode>;
114
+ default: string;
115
+ };
116
+ minRows: {
117
+ type: PropType<number | null>;
118
+ default: null;
119
+ };
120
+ maxRows: {
121
+ type: PropType<number | null>;
122
+ default: null;
123
+ };
111
124
  rowHover: {
112
125
  type: BooleanConstructor;
113
126
  default: boolean;
@@ -239,6 +252,18 @@ declare const _default: import("vue").DefineComponent<{
239
252
  type: NumberConstructor;
240
253
  default: number;
241
254
  };
255
+ layoutMode: {
256
+ type: PropType<DataGridLayoutMode>;
257
+ default: string;
258
+ };
259
+ minRows: {
260
+ type: PropType<number | null>;
261
+ default: null;
262
+ };
263
+ maxRows: {
264
+ type: PropType<number | null>;
265
+ default: null;
266
+ };
242
267
  rowHover: {
243
268
  type: BooleanConstructor;
244
269
  default: boolean;
@@ -278,6 +303,7 @@ declare const _default: import("vue").DefineComponent<{
278
303
  }>>, {
279
304
  rows: readonly Record<string, unknown>[];
280
305
  rowHeightMode: "fixed" | "auto";
306
+ layoutMode: DataGridLayoutMode;
281
307
  showRowIndex: boolean;
282
308
  rowHover: boolean;
283
309
  stripedRows: boolean;
@@ -291,6 +317,8 @@ declare const _default: import("vue").DefineComponent<{
291
317
  groupBy: DataGridGroupBySpec | null | undefined;
292
318
  pivotModel: DataGridPivotSpec | null | undefined;
293
319
  renderMode: "virtualization" | "pagination";
320
+ minRows: number | null;
321
+ maxRows: number | null;
294
322
  viewMode: DataGridAppViewMode;
295
323
  toolbarModules: readonly DataGridAppToolbarModule[];
296
324
  inspectorPanel: DataGridAppInspectorPanel | null;
@@ -1,6 +1,7 @@
1
1
  import { type PropType, type VNode } from "vue";
2
2
  import type { CreateDataGridCoreOptions, DataGridApiPluginDefinition, DataGridColumnInput, DataGridCoreServiceRegistry, DataGridPaginationInput, DataGridRowModel } from "@affino/datagrid-vue";
3
3
  import { type DataGridThemeProp } from "../theme/dataGridTheme";
4
+ import type { DataGridLayoutMode } from "../config/dataGridLayout";
4
5
  type DataGridRuntimeOverrides = Omit<Partial<DataGridCoreServiceRegistry>, "rowModel" | "columnModel" | "viewport"> & {
5
6
  viewport?: DataGridCoreServiceRegistry["viewport"];
6
7
  };
@@ -21,6 +22,10 @@ declare const _default: import("vue").DefineComponent<{
21
22
  type: PropType<DataGridThemeProp>;
22
23
  default: undefined;
23
24
  };
25
+ layoutMode: {
26
+ type: PropType<DataGridLayoutMode>;
27
+ default: string;
28
+ };
24
29
  plugins: {
25
30
  type: PropType<readonly DataGridApiPluginDefinition<unknown>[]>;
26
31
  default: () => never[];
@@ -62,6 +67,10 @@ declare const _default: import("vue").DefineComponent<{
62
67
  type: PropType<DataGridThemeProp>;
63
68
  default: undefined;
64
69
  };
70
+ layoutMode: {
71
+ type: PropType<DataGridLayoutMode>;
72
+ default: string;
73
+ };
65
74
  plugins: {
66
75
  type: PropType<readonly DataGridApiPluginDefinition<unknown>[]>;
67
76
  default: () => never[];
@@ -92,6 +101,7 @@ declare const _default: import("vue").DefineComponent<{
92
101
  }, {
93
102
  rows: readonly unknown[];
94
103
  columns: readonly DataGridColumnInput<unknown>[];
104
+ layoutMode: DataGridLayoutMode;
95
105
  pagination: DataGridPaginationInput | null;
96
106
  rowModel: DataGridRowModel<unknown> | undefined;
97
107
  renderMode: "virtualization" | "pagination";
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { Component } from "vue";
2
2
  export declare const DataGrid: Component;
3
- export type { DataGridAppColumnInput, DataGridDeclarativeFormulaOptions, } from "./config/dataGridFormulaOptions";
3
+ export type { DataGridAppCellRenderer, DataGridAppCellRendererContext, DataGridAppColumnInput, DataGridDeclarativeFormulaOptions, } from "./config/dataGridFormulaOptions";
4
+ export type { DataGridLayoutMode, DataGridResolvedLayoutOptions, } from "./config/dataGridLayout";
4
5
  export type { DataGridCellEditablePredicate, DataGridCellEditablePredicateContext, } from "./dataGridEditability";
5
6
  export type { DataGridThemePreset, DataGridThemeProp, } from "./theme/dataGridTheme";
6
7
  export type { DataGridAdvancedFilterOptions, DataGridAdvancedFilterProp, } from "./config/dataGridAdvancedFilter";