caplink-saas-ui-shared-component-library 1.107.0 → 1.109.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.
@@ -16,6 +16,7 @@ export declare function paste(event: ClipboardEventType, params: {
16
16
  isStaticRows: boolean;
17
17
  maxColumns: number;
18
18
  enableCyclicRepeat?: boolean;
19
+ visibleRowIndices?: ReadonlySet<number>;
19
20
  }): PasteOperationResult;
20
21
  /**
21
22
  * Copies a single cell to clipboard
@@ -1,2 +1,6 @@
1
1
  import { CopyOperationConfig, CopyOperationResult } from '../types';
2
+ /**
3
+ * Handles copying multiple cell ranges to clipboard
4
+ * Formats data as tab-separated values (TSV) compatible with Excel/Sheets
5
+ */
2
6
  export declare function copyRange(config: CopyOperationConfig): CopyOperationResult;
@@ -2,5 +2,6 @@ import { PasteOperationConfig, PasteOperationResult } from '../types';
2
2
  /**
3
3
  * Handles pasting data by overlaying it on the matrix
4
4
  * This may expand the matrix if needed (unless staticRows is true)
5
+ * Rows hidden by filters (not in visibleRowIndices) are skipped and keep their values
5
6
  */
6
7
  export declare function pasteWithOverlay(config: PasteOperationConfig): PasteOperationResult;
@@ -4,6 +4,7 @@ import type * as Matrix from '../../../model/matrix';
4
4
  * Selects the appropriate paste strategy
5
5
  * @param parsedData - The clipboard data to paste
6
6
  * @param selectedRanges - Currently selected cell ranges
7
+ * @param visibleRowIndices - Rows visible under the active filters (all rows when omitted)
7
8
  * @returns The strategy to use for pasting
8
9
  */
9
- export declare function selectPasteStrategy(parsedData: ParsedClipboardData, selectedRanges: Matrix.PointRange[]): PasteStrategy;
10
+ export declare function selectPasteStrategy(parsedData: ParsedClipboardData, selectedRanges: Matrix.PointRange[], visibleRowIndices?: ReadonlySet<number>): PasteStrategy;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Returns the row indices between startRow and endRow (inclusive) that are visible.
3
+ * When visibleRowIndices is not provided, every row is considered visible.
4
+ */
5
+ export declare function getRowIndicesInRange(startRow: number, endRow: number, visibleRowIndices?: ReadonlySet<number>): number[];
6
+ /**
7
+ * Returns the matrix rows that should receive pasted data, starting at startRow and
8
+ * skipping rows hidden by filters. Rows past the end of the matrix are new (and therefore
9
+ * never hidden); they are only used when the spreadsheet is allowed to grow.
10
+ */
11
+ export declare function getPasteTargetRows(params: {
12
+ startRow: number;
13
+ count: number;
14
+ matrixLength: number;
15
+ isStaticRows: boolean;
16
+ visibleRowIndices?: ReadonlySet<number>;
17
+ }): number[];
@@ -30,6 +30,8 @@ export interface PasteOperationConfig {
30
30
  maxColumns: number;
31
31
  /** Enable cyclic repetition when pasting (default: true) */
32
32
  enableCyclicRepeat?: boolean;
33
+ /** When set, rows not in this set (hidden by filters) are skipped and never receive pasted data */
34
+ visibleRowIndices?: ReadonlySet<number>;
33
35
  }
34
36
  /**
35
37
  * Result of a paste operation
@@ -0,0 +1,15 @@
1
+ import { MatrixValue } from '../model/matrix-value';
2
+ import { Column } from '../model/spreadsheet';
3
+ import type * as Matrix from '../model/matrix';
4
+ export declare const CELL_CONTENT_WIDTH_BUFFER = 12;
5
+ export declare const CELL_ICON_WIDTH_BUFFER: number;
6
+ export type AutoColumnWidths = Map<string, number>;
7
+ type ComputeAutoColumnWidthsOptions = {
8
+ measureText?: (text: string) => number;
9
+ sampleRows?: number;
10
+ maxWidth?: number;
11
+ };
12
+ export declare function hasMatrixContent(matrix: Matrix.Matrix<MatrixValue>, sampleRows?: number): boolean;
13
+ export declare function computeAutoColumnWidths(columns: Column[], matrix: Matrix.Matrix<MatrixValue>, options?: ComputeAutoColumnWidthsOptions): AutoColumnWidths;
14
+ export declare function applyAutoColumnWidths(columns: Column[], widths: AutoColumnWidths | null): Column[];
15
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Column } from '../model/spreadsheet';
2
+ type DisplayColumn = Pick<Column, 'dataEditorType' | 'settings'>;
3
+ export declare function getCellDisplayText(column: DisplayColumn, value: unknown): string;
4
+ export {};
@@ -1 +1,3 @@
1
+ export declare const DEFAULT_TEXT_WIDTH_FONT = "600 12px Arial, Helvetica, sans-serif";
1
2
  export declare function getTextWidthByFont(text: string, font?: string): number;
3
+ export declare function createTextWidthMeasurer(font?: string): (text: string) => number;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import * as Spreadsheet from './spreadsheet';
3
3
  export declare const SpreadsheetContext: import('react').Context<Spreadsheet.Context | null>;
4
- export declare function SpreadsheetContextProvider({ children, startingColumns, matrix: legacyMatrix, matrixObject, staticRows, onMatrixChange, onExportData, onImportData, onOpenFullScreen, fullScreen, conditionalFormatting, enableCyclicPasteRepeat, }: Spreadsheet.ContextProvider): import("react/jsx-runtime").JSX.Element;
4
+ export declare function SpreadsheetContextProvider({ children, startingColumns, matrix: legacyMatrix, matrixObject, staticRows, onMatrixChange: onMatrixChangeProp, onExportData, onImportData, onOpenFullScreen, fullScreen, conditionalFormatting, enableCyclicPasteRepeat, }: Spreadsheet.ContextProvider): import("react/jsx-runtime").JSX.Element;
@@ -14,6 +14,10 @@ export declare const COLUMN_INITIAL_WIDTH: number;
14
14
  export declare const COLUMN_MAX_WIDTH: number;
15
15
  /** Spreadsheet column min width */
16
16
  export declare const COLUMN_MIN_WIDTH: number;
17
+ /** Max width in px applied by the initial content-based column width calculation (manual resize is not limited by it) */
18
+ export declare const MAX_AUTO_COLUMN_WIDTH = 200;
19
+ /** Max number of rows sampled by the initial content-based column width calculation */
20
+ export declare const AUTO_COLUMN_WIDTH_SAMPLE_ROWS = 1000;
17
21
  /** Spreadsheet column title single char length */
18
22
  export declare const COLUMN_TITLE_CHAR_LENGTH = 12;
19
23
  /** Spreadsheet column title height */
@@ -0,0 +1,8 @@
1
+ import { MatrixValue } from './matrix-value';
2
+ import { Column } from './spreadsheet';
3
+ import type * as Matrix from './matrix';
4
+ export declare function useAutoColumnWidths(): {
5
+ computeAutoWidthsOnce: (columns: Column[], matrix: Matrix.Matrix<MatrixValue>) => boolean;
6
+ applyAutoWidths: (columns: Column[]) => Column[];
7
+ lockAutoWidths: () => void;
8
+ };