caplink-saas-ui-shared-component-library 1.108.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.
@@ -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
+ };