@xleddyl/443-components-vue 0.9.2 → 0.10.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.
@@ -6,6 +6,7 @@ export { default as EmptyCell } from './cells/EmptyCell.vue';
6
6
  export { default as BadgeCell } from './cells/BadgeCell.vue';
7
7
  export { default as ImageCell } from './cells/ImageCell.vue';
8
8
  export { default as LinkCell } from './cells/LinkCell.vue';
9
- export { registerGridEditorModules, registerGridFilterModules, registerGridModules, } from './modules';
9
+ export { registerGridEditorModules, registerGridFilterModules, registerGridModules, registerGridSpreadsheetModules, } from './modules';
10
10
  export { createGridTheme } from './theme';
11
+ export { formatTsv, parseTsv } from './tsv';
11
12
  export type * from './types';
@@ -9,6 +9,8 @@ export { default as LinkCell } from "./cells/LinkCell.vue";
9
9
  export {
10
10
  registerGridEditorModules,
11
11
  registerGridFilterModules,
12
- registerGridModules
12
+ registerGridModules,
13
+ registerGridSpreadsheetModules
13
14
  } from "./modules.mjs";
14
15
  export { createGridTheme } from "./theme.mjs";
16
+ export { formatTsv, parseTsv } from "./tsv.mjs";
@@ -1,3 +1,4 @@
1
1
  export declare function registerGridModules(): void;
2
2
  export declare function registerGridFilterModules(): void;
3
3
  export declare function registerGridEditorModules(): void;
4
+ export declare function registerGridSpreadsheetModules(): void;
@@ -26,6 +26,7 @@ import {
26
26
  RowApiModule,
27
27
  RowAutoHeightModule,
28
28
  RowSelectionModule,
29
+ ScrollApiModule,
29
30
  TextFilterModule,
30
31
  TooltipModule
31
32
  } from "ag-grid-community";
@@ -74,3 +75,10 @@ export function registerGridEditorModules() {
74
75
  UndoRedoEditModule
75
76
  ]);
76
77
  }
78
+ let spreadsheetRegistered = false;
79
+ export function registerGridSpreadsheetModules() {
80
+ registerGridEditorModules();
81
+ if (spreadsheetRegistered) return;
82
+ spreadsheetRegistered = true;
83
+ ModuleRegistry.registerModules([ScrollApiModule]);
84
+ }
@@ -0,0 +1,52 @@
1
+ import type { CellClassRules, GridApi, GridOptions } from 'ag-grid-community';
2
+ import type { GridCellRange, GridCellsChange, GridCellsInvalid, GridDirtyCell, GridRangeInput, GridSelectedCell, GridSetRangeValueOptions, GridSpreadsheetMethods } from './types';
3
+ export type SpreadsheetNotice = 'copied' | 'pasted' | 'filled' | 'cleared' | 'updated' | 'undone' | 'redone';
4
+ export interface SpreadsheetOptions<T> {
5
+ enabled: () => boolean;
6
+ body: () => HTMLElement | null;
7
+ gridOptions: () => GridOptions<T> | undefined;
8
+ onChange: (event: GridCellsChange) => void;
9
+ onInvalid: (event: GridCellsInvalid) => void;
10
+ onDirty: (count: number) => void;
11
+ onRange: (range: GridCellRange | null) => void;
12
+ onCopy: (text: string) => void;
13
+ onSelect: (count: number) => void;
14
+ notify: (kind: SpreadsheetNotice, count: number, invalid: number) => void;
15
+ }
16
+ export declare function createGridSpreadsheet<T>(options: SpreadsheetOptions<T>): {
17
+ classRules: CellClassRules<T, any, any>;
18
+ methods: GridSpreadsheetMethods<T>;
19
+ slotProps: import("vue").ComputedRef<{
20
+ range: GridCellRange | null;
21
+ selectedCellCount: number;
22
+ dirtyCount: number;
23
+ canUndo: boolean;
24
+ canRedo: boolean;
25
+ getRange: () => GridCellRange | null;
26
+ getSelectedCells: () => GridSelectedCell<T>[];
27
+ selectRange: (range: GridRangeInput) => void;
28
+ selectAll: () => void;
29
+ clearRange: () => void;
30
+ setRangeValue: (value: unknown, options?: GridSetRangeValueOptions) => number;
31
+ copyRange: () => Promise<string | null>;
32
+ paste: (text: string) => number;
33
+ fillDown: () => number;
34
+ fillRight: () => number;
35
+ clearCells: () => number;
36
+ undo: () => boolean;
37
+ redo: () => boolean;
38
+ clearHistory: () => void;
39
+ getDirtyCells: () => GridDirtyCell[];
40
+ clearDirty: (rowIds?: string[]) => void;
41
+ }>;
42
+ filling: import("vue").Ref<boolean, boolean>;
43
+ attach: (next: GridApi<T>) => void;
44
+ detach: () => void;
45
+ disable: () => void;
46
+ containsCell: (rowIndex: number | null, colId: string) => boolean;
47
+ copyRange: () => Promise<string | null>;
48
+ onKeyDown: (event: KeyboardEvent) => void;
49
+ onMouseDown: (event: MouseEvent) => void;
50
+ onPointerDown: (event: PointerEvent) => void;
51
+ onPointerOver: (event: PointerEvent) => void;
52
+ };