caplink-saas-ui-shared-component-library 1.90.0 → 1.91.2

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 (48) hide show
  1. package/README.md +4 -0
  2. package/dist/features/spreadsheet/core/clipboard/clipboard-manager.d.ts +4 -3
  3. package/dist/features/spreadsheet/core/clipboard/operations/copy-single-cell.d.ts +2 -1
  4. package/dist/features/spreadsheet/core/clipboard/services/clipboard-data-extractor.d.ts +2 -1
  5. package/dist/features/spreadsheet/core/clipboard/types/index.d.ts +7 -13
  6. package/dist/features/spreadsheet/lib/insert-new-row.d.ts +3 -2
  7. package/dist/features/spreadsheet/lib/show-row-by-condition/index.d.ts +2 -1
  8. package/dist/features/spreadsheet/lib/sort-column.d.ts +3 -2
  9. package/dist/features/spreadsheet/lib/spreadsheet-filters/apply-spreadsheet-filters.d.ts +3 -2
  10. package/dist/features/spreadsheet/lib/spreadsheet-filters/cell-inner.d.ts +3 -0
  11. package/dist/features/spreadsheet/lib/spreadsheet-filters/common/apply-common-filters.d.ts +3 -2
  12. package/dist/features/spreadsheet/lib/spreadsheet-filters/common/is-empty.d.ts +3 -2
  13. package/dist/features/spreadsheet/lib/spreadsheet-filters/common/is-not-empty.d.ts +3 -2
  14. package/dist/features/spreadsheet/lib/spreadsheet-filters/date/apply-date-filters.d.ts +3 -2
  15. package/dist/features/spreadsheet/lib/spreadsheet-filters/date/date-is-after.d.ts +3 -2
  16. package/dist/features/spreadsheet/lib/spreadsheet-filters/date/date-is-before.d.ts +3 -2
  17. package/dist/features/spreadsheet/lib/spreadsheet-filters/date/date-is-equals-to.d.ts +3 -2
  18. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/apply-numeric-filters.d.ts +3 -2
  19. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/number-is-between.d.ts +3 -2
  20. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/number-is-equals-to.d.ts +3 -2
  21. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/number-is-greater-or-equals.d.ts +3 -2
  22. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/number-is-greater-than.d.ts +3 -2
  23. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/number-is-less-or-equals.d.ts +3 -2
  24. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/number-is-less-than.d.ts +3 -2
  25. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/number-is-not-between.d.ts +3 -2
  26. package/dist/features/spreadsheet/lib/spreadsheet-filters/numeric/number-is-not-equals-to.d.ts +3 -2
  27. package/dist/features/spreadsheet/lib/spreadsheet-filters/text/apply-text-filters.d.ts +3 -2
  28. package/dist/features/spreadsheet/lib/spreadsheet-filters/text/text-contains.d.ts +3 -2
  29. package/dist/features/spreadsheet/lib/spreadsheet-filters/text/text-ends-with.d.ts +3 -2
  30. package/dist/features/spreadsheet/lib/spreadsheet-filters/text/text-is-equals-to.d.ts +3 -2
  31. package/dist/features/spreadsheet/lib/spreadsheet-filters/text/text-not-contains.d.ts +3 -2
  32. package/dist/features/spreadsheet/lib/spreadsheet-filters/text/text-starts-with.d.ts +3 -2
  33. package/dist/features/spreadsheet/model/context.d.ts +1 -1
  34. package/dist/features/spreadsheet/model/history-context.d.ts +2 -1
  35. package/dist/features/spreadsheet/model/matrix-value.d.ts +21 -0
  36. package/dist/features/spreadsheet/model/matrix.d.ts +5 -4
  37. package/dist/features/spreadsheet/model/spreadsheet.d.ts +12 -11
  38. package/dist/features/spreadsheet/ui/cell.d.ts +1 -1
  39. package/dist/features/spreadsheet/ui/columns.d.ts +3 -3
  40. package/dist/features/spreadsheet/ui/row.d.ts +2 -2
  41. package/dist/features/spreadsheet/ui/spreadsheet.d.ts +11 -2
  42. package/dist/features/spreadsheet/ui/workbook.d.ts +1 -1
  43. package/dist/index.es.js +14632 -14522
  44. package/dist/index.es.js.map +1 -1
  45. package/dist/index.umd.js +68 -68
  46. package/dist/index.umd.js.map +1 -1
  47. package/dist/package.json +1 -1
  48. package/package.json +1 -1
package/README.md CHANGED
@@ -76,3 +76,7 @@ This is a project for the Caplink SaaS UI team. If you are a member of the team,
76
76
  4. Create a pull request
77
77
 
78
78
  Developing components with tests is a requirement for contributing to this project.
79
+
80
+ ## Release
81
+
82
+ After merging the pull request the publish process will begin and a new version of the library will be created and then published to the NPM repository. To use the new version, update the projects to the recently published version and create a new pull request to send the updated version to the live environments.
@@ -1,3 +1,4 @@
1
+ import { MatrixValue } from '../../model/matrix-value';
1
2
  import { ClipboardEventType, CopyOperationResult, PasteOperationResult } from './types';
2
3
  import type * as Matrix from '../../model/matrix';
3
4
  import type * as Spreadsheet from '../../model/spreadsheet';
@@ -9,7 +10,7 @@ import type * as Spreadsheet from '../../model/spreadsheet';
9
10
  */
10
11
  export declare function paste(event: ClipboardEventType, params: {
11
12
  targetPoint: Matrix.Point;
12
- currentMatrix: Matrix.Matrix<unknown>;
13
+ currentMatrix: Matrix.Matrix<MatrixValue>;
13
14
  columns: Spreadsheet.Column[];
14
15
  selectedRanges: Matrix.PointRange[];
15
16
  isStaticRows: boolean;
@@ -22,14 +23,14 @@ export declare function paste(event: ClipboardEventType, params: {
22
23
  * @param currentMatrix - Current matrix state
23
24
  * @returns Result with clipboard text and success status
24
25
  */
25
- export declare function copySingleCellToClipboard(point: Matrix.Point, currentMatrix: Matrix.Matrix<unknown>): CopyOperationResult;
26
+ export declare function copySingleCellToClipboard(point: Matrix.Point, currentMatrix: Matrix.Matrix<MatrixValue>): CopyOperationResult;
26
27
  /**
27
28
  * Copies multiple ranges to clipboard
28
29
  * @param ranges - The ranges to copy
29
30
  * @param currentMatrix - Current matrix state
30
31
  * @returns Result with clipboard text and success status
31
32
  */
32
- export declare function copyRangesToClipboard(ranges: Matrix.PointRange[], currentMatrix: Matrix.Matrix<unknown>): CopyOperationResult;
33
+ export declare function copyRangesToClipboard(ranges: Matrix.PointRange[], currentMatrix: Matrix.Matrix<MatrixValue>): CopyOperationResult;
33
34
  /**
34
35
  * Writes text to system clipboard
35
36
  * @param text - The text to write
@@ -1,6 +1,7 @@
1
+ import { MatrixValue } from '../../../model/matrix-value';
1
2
  import { CopyOperationResult } from '../types';
2
3
  import type * as Matrix from '../../../model/matrix';
3
4
  /**
4
5
  * Handles copying a single cell value to clipboard
5
6
  */
6
- export declare function copySingleCell(point: Matrix.Point, currentMatrix: Matrix.Matrix<unknown>): CopyOperationResult;
7
+ export declare function copySingleCell(point: Matrix.Point, currentMatrix: Matrix.Matrix<MatrixValue>): CopyOperationResult;
@@ -1,3 +1,4 @@
1
+ import { MatrixValue } from '../../../model/matrix-value';
1
2
  import { ClipboardEventType, ParsedClipboardData } from '../types';
2
3
  import * as Matrix from '../../../model/matrix';
3
4
  /**
@@ -12,7 +13,7 @@ export declare function extractAndParseClipboardData(event: ClipboardEventType):
12
13
  * @param data - Matrix data to format
13
14
  * @returns Formatted string ready for clipboard
14
15
  */
15
- export declare function formatMatrixForClipboard(data: Matrix.Matrix<unknown>): string;
16
+ export declare function formatMatrixForClipboard(data: Matrix.Matrix<MatrixValue>): string;
16
17
  /**
17
18
  * Checks if parsed data represents a single cell
18
19
  * @param data - Parsed clipboard data
@@ -1,10 +1,11 @@
1
1
  import { ClipboardEvent } from 'react';
2
+ import { MatrixCellChange, MatrixValue } from '../../../model/matrix-value';
2
3
  import type * as Matrix from '../../../model/matrix';
3
4
  import type * as Spreadsheet from '../../../model/spreadsheet';
4
5
  /**
5
6
  * Represents the result of parsing clipboard data into a matrix format
6
7
  */
7
- export type ParsedClipboardData = Matrix.Matrix<unknown>;
8
+ export type ParsedClipboardData = Matrix.Matrix<MatrixValue>;
8
9
  /**
9
10
  * Unified type for clipboard events from both browser and React
10
11
  */
@@ -18,7 +19,7 @@ export interface PasteOperationConfig {
18
19
  /** The data to be pasted (already parsed into matrix format) */
19
20
  parsedData: ParsedClipboardData;
20
21
  /** Current matrix state */
21
- currentMatrix: Matrix.Matrix<unknown>;
22
+ currentMatrix: Matrix.Matrix<MatrixValue>;
22
23
  /** Column definitions with metadata */
23
24
  columns: Spreadsheet.Column[];
24
25
  /** Currently selected ranges */
@@ -35,23 +36,16 @@ export interface PasteOperationConfig {
35
36
  */
36
37
  export interface PasteOperationResult {
37
38
  /** The updated matrix after paste */
38
- updatedMatrix: Matrix.Matrix<unknown>;
39
+ updatedMatrix: Matrix.Matrix<MatrixValue>;
39
40
  /** History entries to track changes for undo */
40
41
  historyEntries: HistoryEntry[];
41
42
  }
42
43
  /**
43
44
  * Represents a single change in the spreadsheet for undo/redo
44
45
  */
45
- export interface HistoryEntry {
46
- /** The cell position that changed */
47
- point: Matrix.Point;
48
- /** The value before the change */
49
- oldValue: unknown;
50
- /** The value after the change */
51
- newValue: unknown;
52
- /** Unique identifier to group related changes (e.g., all cells from one paste) */
46
+ export type HistoryEntry = MatrixCellChange & {
53
47
  pastedId: string;
54
- }
48
+ };
55
49
  /**
56
50
  * Determines which paste strategy to use
57
51
  */
@@ -70,7 +64,7 @@ export interface CopyOperationConfig {
70
64
  /** The ranges to copy from */
71
65
  sourceRanges: Matrix.PointRange[];
72
66
  /** Current matrix state */
73
- currentMatrix: Matrix.Matrix<unknown>;
67
+ currentMatrix: Matrix.Matrix<MatrixValue>;
74
68
  }
75
69
  /**
76
70
  * Result of a copy operation
@@ -1,9 +1,10 @@
1
+ import { MatrixValue } from '../model/matrix-value';
1
2
  import type * as Matrix from '../model/matrix';
2
3
  import * as Spreadsheet from '../model/spreadsheet';
3
4
  type InsertNewRowArgs = {
4
- matrix: Matrix.Matrix<unknown>;
5
+ matrix: Matrix.Matrix<MatrixValue>;
5
6
  columnsCount: number;
6
7
  columns: Spreadsheet.Column[];
7
8
  };
8
- export declare function insertNewRow({ columnsCount, matrix, columns, }: InsertNewRowArgs): Matrix.Matrix<unknown>;
9
+ export declare function insertNewRow({ columnsCount, matrix, columns, }: InsertNewRowArgs): Matrix.Matrix<MatrixValue>;
9
10
  export {};
@@ -1,6 +1,7 @@
1
+ import { MatrixValue } from '../../model/matrix-value';
1
2
  import { Column } from '../../model/spreadsheet';
2
3
  type ShowRowByConditionArgs = {
3
- row: unknown[];
4
+ row: (MatrixValue | undefined)[];
4
5
  columns: Column[];
5
6
  };
6
7
  export declare function showRowByCondition({ columns, row }: ShowRowByConditionArgs): boolean;
@@ -1,11 +1,12 @@
1
1
  import { Matrix } from '../model/matrix';
2
+ import { MatrixValue } from '../model/matrix-value';
2
3
  import { DataEditorType } from '../model/spreadsheet';
3
4
  import { ColumnOrderEnum } from './spreadsheet-filters';
4
5
  type SortMatrixByColumnArgs = {
5
6
  columnOrder: ColumnOrderEnum;
6
7
  columnIndex: number;
7
- matrix: Matrix<unknown>;
8
+ matrix: Matrix<MatrixValue>;
8
9
  dataEditorType: DataEditorType;
9
10
  };
10
- export declare function sortMatrixByColumn({ columnIndex, columnOrder, dataEditorType, matrix, }: SortMatrixByColumnArgs): Matrix<unknown>;
11
+ export declare function sortMatrixByColumn({ columnIndex, columnOrder, dataEditorType, matrix, }: SortMatrixByColumnArgs): Matrix<MatrixValue>;
11
12
  export {};
@@ -1,11 +1,12 @@
1
1
  import { CommonFiltersEnum, DateFiltersEnum, NumericFiltersEnum, TextFiltersEnum } from '.';
2
2
  import { Matrix } from '../../model/matrix';
3
+ import { MatrixValue } from '../../model/matrix-value';
3
4
  type ApplySpreadsheetFiltersArgs = {
4
5
  filterType: CommonFiltersEnum & TextFiltersEnum & NumericFiltersEnum & DateFiltersEnum;
5
6
  valueA: string;
6
7
  valueB?: string;
7
8
  columnIndex: number;
8
- matrix: Matrix<unknown>;
9
+ matrix: Matrix<MatrixValue>;
9
10
  };
10
- export declare function applySpreadsheetFilters({ filterType, valueA, valueB, columnIndex, matrix, }: ApplySpreadsheetFiltersArgs): Matrix<unknown>;
11
+ export declare function applySpreadsheetFilters({ filterType, valueA, valueB, columnIndex, matrix, }: ApplySpreadsheetFiltersArgs): Matrix<MatrixValue>;
11
12
  export {};
@@ -0,0 +1,3 @@
1
+ import { MatrixValue } from '../../model/matrix-value';
2
+ export declare function cellInnerAt(row: (MatrixValue | undefined)[], columnIndex: number): unknown;
3
+ export declare function numberCellAt(row: (MatrixValue | undefined)[], columnIndex: number): number;
@@ -1,9 +1,10 @@
1
1
  import { CommonFiltersEnum } from '..';
2
2
  import { Matrix } from '../../../model/matrix';
3
+ import { MatrixValue } from '../../../model/matrix-value';
3
4
  type ApplyCommonFilters = {
4
5
  columnIndex: number;
5
6
  filterType: CommonFiltersEnum;
6
- matrix: Matrix<unknown>;
7
+ matrix: Matrix<MatrixValue>;
7
8
  };
8
- export declare function applyCommonFilters({ filterType, matrix, columnIndex }: ApplyCommonFilters): Matrix<unknown>;
9
+ export declare function applyCommonFilters({ filterType, matrix, columnIndex }: ApplyCommonFilters): Matrix<MatrixValue>;
9
10
  export {};
@@ -1,7 +1,8 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type IsEmptyArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  };
6
- export declare function isEmpty({ columnIndex, matrix }: IsEmptyArgs): unknown[][];
7
+ export declare function isEmpty({ columnIndex, matrix }: IsEmptyArgs): (MatrixValue | undefined)[][];
7
8
  export {};
@@ -1,7 +1,8 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type IsNotEmptyArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  };
6
- export declare function isNotEmpty({ columnIndex, matrix }: IsNotEmptyArgs): unknown[][];
7
+ export declare function isNotEmpty({ columnIndex, matrix }: IsNotEmptyArgs): (MatrixValue | undefined)[][];
7
8
  export {};
@@ -1,10 +1,11 @@
1
1
  import { DateFiltersEnum } from '..';
2
2
  import { Matrix } from '../../../model/matrix';
3
+ import { MatrixValue } from '../../../model/matrix-value';
3
4
  type ApplyDateFiltersArgs = {
4
5
  dateValue: string;
5
- matrix: Matrix<unknown>;
6
+ matrix: Matrix<MatrixValue>;
6
7
  columnIndex: number;
7
8
  filterType: DateFiltersEnum;
8
9
  };
9
- export declare function applyDateFilters({ columnIndex, dateValue, matrix, filterType, }: ApplyDateFiltersArgs): Matrix<unknown>;
10
+ export declare function applyDateFilters({ columnIndex, dateValue, matrix, filterType, }: ApplyDateFiltersArgs): Matrix<MatrixValue>;
10
11
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type DateIsBeforeArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  dateValue: string;
6
7
  };
7
- export declare function dateIsAfter({ columnIndex, matrix, dateValue }: DateIsBeforeArgs): unknown[][];
8
+ export declare function dateIsAfter({ columnIndex, matrix, dateValue }: DateIsBeforeArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type DateIsBeforeArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  dateValue: string;
6
7
  };
7
- export declare function dateIsBefore({ columnIndex, matrix, dateValue }: DateIsBeforeArgs): unknown[][];
8
+ export declare function dateIsBefore({ columnIndex, matrix, dateValue }: DateIsBeforeArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type DateIsEqualsToArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  dateValue: string;
6
7
  };
7
- export declare function dateIsEqualsTo({ columnIndex, matrix, dateValue }: DateIsEqualsToArgs): unknown[][];
8
+ export declare function dateIsEqualsTo({ columnIndex, matrix, dateValue }: DateIsEqualsToArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,11 +1,12 @@
1
1
  import { NumericFiltersEnum } from '..';
2
2
  import { Matrix } from '../../../model/matrix';
3
+ import { MatrixValue } from '../../../model/matrix-value';
3
4
  type ApplyDateFiltersArgs = {
4
5
  numberValueA: string;
5
6
  numberValueB?: string;
6
- matrix: Matrix<unknown>;
7
+ matrix: Matrix<MatrixValue>;
7
8
  columnIndex: number;
8
9
  filterType: NumericFiltersEnum;
9
10
  };
10
- export declare function applyNumericFilters({ columnIndex, numberValueA, numberValueB, matrix, filterType, }: ApplyDateFiltersArgs): Matrix<unknown>;
11
+ export declare function applyNumericFilters({ columnIndex, numberValueA, numberValueB, matrix, filterType, }: ApplyDateFiltersArgs): Matrix<MatrixValue>;
11
12
  export {};
@@ -1,9 +1,10 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type NumberIsBetweenArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  numberA: number;
6
7
  numberB: number;
7
8
  };
8
- export declare function numberIsBetween({ columnIndex, matrix, numberA, numberB }: NumberIsBetweenArgs): unknown[][];
9
+ export declare function numberIsBetween({ columnIndex, matrix, numberA, numberB }: NumberIsBetweenArgs): (MatrixValue | undefined)[][];
9
10
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type NumberIsEqualsToArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  numberValue: number;
6
7
  };
7
- export declare function numberIsEqualsTo({ columnIndex, matrix, numberValue }: NumberIsEqualsToArgs): unknown[][];
8
+ export declare function numberIsEqualsTo({ columnIndex, matrix, numberValue }: NumberIsEqualsToArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type NumberIsGreaterOrEqualsArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  numberValue: number;
6
7
  };
7
- export declare function numberIsGreaterOrEquals({ columnIndex, matrix, numberValue, }: NumberIsGreaterOrEqualsArgs): unknown[][];
8
+ export declare function numberIsGreaterOrEquals({ columnIndex, matrix, numberValue, }: NumberIsGreaterOrEqualsArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type NumberIsGreaterThanArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  numberValue: number;
6
7
  };
7
- export declare function numberIsGreaterThan({ columnIndex, matrix, numberValue }: NumberIsGreaterThanArgs): unknown[][];
8
+ export declare function numberIsGreaterThan({ columnIndex, matrix, numberValue }: NumberIsGreaterThanArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type NumberIsLessOrEqualsArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  numberValue: number;
6
7
  };
7
- export declare function numberIsLessOrEquals({ columnIndex, matrix, numberValue, }: NumberIsLessOrEqualsArgs): unknown[][];
8
+ export declare function numberIsLessOrEquals({ columnIndex, matrix, numberValue, }: NumberIsLessOrEqualsArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type NumberIsLessThanArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  numberValue: number;
6
7
  };
7
- export declare function numberIsLessThan({ columnIndex, matrix, numberValue }: NumberIsLessThanArgs): unknown[][];
8
+ export declare function numberIsLessThan({ columnIndex, matrix, numberValue }: NumberIsLessThanArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,9 +1,10 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type NumberIsNotBetweenArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  numberA: number;
6
7
  numberB: number;
7
8
  };
8
- export declare function numberIsNotBetween({ columnIndex, matrix, numberA, numberB, }: NumberIsNotBetweenArgs): unknown[][];
9
+ export declare function numberIsNotBetween({ columnIndex, matrix, numberA, numberB, }: NumberIsNotBetweenArgs): (MatrixValue | undefined)[][];
9
10
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type NumberNotIsEqualsToArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  numberValue: number;
6
7
  };
7
- export declare function numberIsNotEqualsTo({ columnIndex, matrix, numberValue }: NumberNotIsEqualsToArgs): unknown[][];
8
+ export declare function numberIsNotEqualsTo({ columnIndex, matrix, numberValue }: NumberNotIsEqualsToArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,10 +1,11 @@
1
1
  import { TextFiltersEnum } from '..';
2
2
  import { Matrix } from '../../../model/matrix';
3
+ import { MatrixValue } from '../../../model/matrix-value';
3
4
  type ApplyDateFiltersArgs = {
4
5
  textValue: string;
5
- matrix: Matrix<unknown>;
6
+ matrix: Matrix<MatrixValue>;
6
7
  columnIndex: number;
7
8
  filterType: TextFiltersEnum;
8
9
  };
9
- export declare function applyTextFilters({ columnIndex, textValue, matrix, filterType, }: ApplyDateFiltersArgs): Matrix<unknown>;
10
+ export declare function applyTextFilters({ columnIndex, textValue, matrix, filterType, }: ApplyDateFiltersArgs): Matrix<MatrixValue>;
10
11
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type TextContainsArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  textValue: string;
6
7
  };
7
- export declare function textContains({ columnIndex, matrix, textValue }: TextContainsArgs): unknown[][];
8
+ export declare function textContains({ columnIndex, matrix, textValue }: TextContainsArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type TextEndsWithArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  textValue: string;
6
7
  };
7
- export declare function textEndsWith({ columnIndex, matrix, textValue }: TextEndsWithArgs): unknown[][];
8
+ export declare function textEndsWith({ columnIndex, matrix, textValue }: TextEndsWithArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type TextContainsArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  textValue: string;
6
7
  };
7
- export declare function textIsEqualsTo({ columnIndex, matrix, textValue }: TextContainsArgs): unknown[][];
8
+ export declare function textIsEqualsTo({ columnIndex, matrix, textValue }: TextContainsArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type TextNotContainsArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  textValue: string;
6
7
  };
7
- export declare function textNotContains({ columnIndex, matrix, textValue }: TextNotContainsArgs): unknown[][];
8
+ export declare function textNotContains({ columnIndex, matrix, textValue }: TextNotContainsArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -1,8 +1,9 @@
1
1
  import { Matrix } from '../../../model/matrix';
2
+ import { MatrixValue } from '../../../model/matrix-value';
2
3
  type TextStartsWithArgs = {
3
- matrix: Matrix<unknown>;
4
+ matrix: Matrix<MatrixValue>;
4
5
  columnIndex: number;
5
6
  textValue: string;
6
7
  };
7
- export declare function textStartsWith({ columnIndex, matrix, textValue }: TextStartsWithArgs): unknown[][];
8
+ export declare function textStartsWith({ columnIndex, matrix, textValue }: TextStartsWithArgs): (MatrixValue | undefined)[][];
8
9
  export {};
@@ -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: startingMatrix, 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, onExportData, onImportData, onOpenFullScreen, fullScreen, conditionalFormatting, enableCyclicPasteRepeat, }: Spreadsheet.ContextProvider): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,9 @@
1
+ import { MatrixValue } from './matrix-value';
1
2
  /// <reference types="react" />
2
3
  import type * as Matrix from './matrix';
3
4
  import type * as Spreadsheet from './spreadsheet';
4
5
  export declare const HistoryContext: import('react').Context<Spreadsheet.HistoryContext | null>;
5
6
  export declare function HistoryContextProvider({ children, onMatrixChange, }: {
6
7
  children: React.ReactNode;
7
- onMatrixChange?: (matrix: Matrix.Matrix<unknown>) => void;
8
+ onMatrixChange?: (matrix: Matrix.Matrix<MatrixValue>) => void;
8
9
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { Matrix, Point } from './matrix';
2
+ export type LegacyMatrix = Array<Array<unknown | undefined>>;
3
+ export type MatrixValue = {
4
+ value: unknown;
5
+ settings?: {
6
+ readonly?: boolean;
7
+ };
8
+ };
9
+ export type MatrixCellChange = {
10
+ point: Point;
11
+ oldCell: MatrixValue | undefined;
12
+ newCell: MatrixValue | undefined;
13
+ pastedId?: string;
14
+ };
15
+ export declare function normalizeToMatrixCell(raw: unknown): MatrixValue | undefined;
16
+ export declare function getMatrixCellInner(cell: MatrixValue | undefined): unknown;
17
+ export declare function mergeMatrixCell(prev: MatrixValue | undefined, nextInner: unknown): MatrixValue;
18
+ export declare function isMatrixCellEmpty(inner: unknown): boolean;
19
+ export declare function matrixFromLegacy(rows: LegacyMatrix): Matrix<MatrixValue>;
20
+ export declare function normalizeMatrixInput(matrix?: LegacyMatrix, matrixObject?: Matrix<MatrixValue>): Matrix<MatrixValue>;
21
+ export declare function toLegacyMatrix(m: Matrix<MatrixValue>): LegacyMatrix;
@@ -1,3 +1,4 @@
1
+ import { MatrixValue } from './matrix-value';
1
2
  /** A cell cordinates in matrix */
2
3
  export type Point = {
3
4
  row: number;
@@ -47,13 +48,13 @@ export declare function hasEntireRows(params: {
47
48
  row: number;
48
49
  }): boolean;
49
50
  /** Converts string value into an matrix */
50
- export declare function parseString(value: string): Matrix<unknown>;
51
+ export declare function parseString(value: string): Matrix<MatrixValue>;
51
52
  /**
52
53
  * Overlaps a given Matrix B (mB) starting in a specific point into a given Matrix A (mA)
53
54
  * Matrix B (mB) always has priority when replacing cell values
54
55
  */
55
56
  export declare function overlap(params: {
56
- mA: Matrix<unknown>;
57
- mB: Matrix<unknown>;
57
+ mA: Matrix<MatrixValue>;
58
+ mB: Matrix<MatrixValue>;
58
59
  point: Point;
59
- }): Matrix<unknown>;
60
+ }): Matrix<MatrixValue>;
@@ -1,6 +1,7 @@
1
1
  import { CSSProperties, ClipboardEvent, Dispatch, MouseEvent, PropsWithChildren, SetStateAction } from 'react';
2
2
  import { ConditionalFormattingRule } from '../lib/conditional-formatting';
3
3
  import { SpreadsheetProps } from '../ui/spreadsheet';
4
+ import { MatrixCellChange, MatrixValue } from './matrix-value';
4
5
  import { ColumnCounterEnum, ColumnOrderEnum, CommonFiltersEnum, DateFiltersEnum, NumericFiltersEnum, TextFiltersEnum } from '../lib/spreadsheet-filters';
5
6
  import type * as Matrix from './matrix';
6
7
  export declare const COLUMN_STRING_LIMIT = 1200;
@@ -138,6 +139,8 @@ export declare enum SpreadsheetDisplayModeEnum {
138
139
  export type Cell = {
139
140
  /** The cell value */
140
141
  value?: unknown;
142
+ /** Cell-level readonly (matrix `settings.readonly`) */
143
+ cellReadonly?: boolean;
141
144
  /** Point coordinates of the cell */
142
145
  coordinates: Matrix.Point;
143
146
  width: number;
@@ -148,25 +151,20 @@ export type TemporaryValue = {
148
151
  point: Matrix.Point;
149
152
  value: unknown;
150
153
  };
151
- export type SpreadsheetHistory = {
152
- point: Matrix.Point;
153
- oldValue: unknown;
154
- newValue: unknown;
155
- pastedId?: string;
156
- };
154
+ export type SpreadsheetHistory = MatrixCellChange;
157
155
  export type HistoryContext = {
158
156
  history: SpreadsheetHistory[];
159
157
  addToHistory: (historyItem: SpreadsheetHistory) => void;
160
- undo: (matrix: Matrix.Matrix<unknown>, setMatrix: (matrix: Matrix.Matrix<unknown>) => void) => void;
158
+ undo: (matrix: Matrix.Matrix<MatrixValue>, setMatrix: (matrix: Matrix.Matrix<MatrixValue>) => void) => void;
161
159
  };
162
160
  export type RowFiltered = {
163
161
  originalIndex: number;
164
- value: unknown[];
162
+ value: (MatrixValue | undefined)[];
165
163
  };
166
164
  export type Context = {
167
165
  size: Matrix.Size;
168
- setMatrix: Dispatch<SetStateAction<Matrix.Matrix<unknown>>>;
169
- matrix: Matrix.Matrix<unknown>;
166
+ setMatrix: Dispatch<SetStateAction<Matrix.Matrix<MatrixValue>>>;
167
+ matrix: Matrix.Matrix<MatrixValue>;
170
168
  temporaryValues: TemporaryValue[];
171
169
  columns: Column[];
172
170
  emptySize: boolean;
@@ -235,4 +233,7 @@ export type Context = {
235
233
  conditionalFormatting?: ConditionalFormattingRule[];
236
234
  filteredMatrix: RowFiltered[];
237
235
  };
238
- export type ContextProvider = Omit<PropsWithChildren<SpreadsheetProps>, 'className'>;
236
+ /** Props for {@link SpreadsheetContextProvider}; `onMatrixChange` is the typed-matrix emit wired by {@link Spreadsheet}. */
237
+ export type ContextProvider = Omit<PropsWithChildren<SpreadsheetProps>, 'className' | 'onMatrixChange' | 'onMatrixObjectChange'> & {
238
+ onMatrixChange?: (matrix: Matrix.Matrix<MatrixValue>) => void;
239
+ };
@@ -1,2 +1,2 @@
1
1
  import * as Spreadsheet from '../model/spreadsheet';
2
- export declare function Cell({ value, width, coordinates, className, style }: Spreadsheet.Cell): import("react/jsx-runtime").JSX.Element;
2
+ export declare function Cell({ value, cellReadonly, width, coordinates, className, style, }: Spreadsheet.Cell): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
- declare function ColumnsComponent({ rowValue, rowIndex }: {
3
- rowValue: Array<unknown>;
1
+ import { MatrixValue } from '../model/matrix-value';
2
+ declare function ColumnsComponent({ rowValue, rowIndex, }: {
3
+ rowValue: Array<MatrixValue | undefined>;
4
4
  rowIndex: number;
5
5
  }): import("react/jsx-runtime").JSX.Element[];
6
6
  export declare const Columns: import('react').MemoExoticComponent<typeof ColumnsComponent>;