@revolist/revogrid 4.14.3 → 4.14.4

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 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AAgY4D,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport type {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\nimport type {\n Cell,\n EditorCtr,\n FocusedCells,\n OldNewRangeMapping,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils';\nimport type { JSXBase } from '@stencil/core/internal';\n\nexport type Nullable<T> = {\n [P in keyof T]: T[P] | null;\n};\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport interface ColumnDataSchemaModel {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data value\n * Mapped from model through column property like model['prop']\n */\n value?: any;\n}\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport interface ColumnGrouping<T = any> {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping<T> | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat<T>;\n}\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n\n /**\n * Represents the cell value parse function for custom parsing.\n * Currently only used for filtering.\n */\n cellParser?: (model: DataType, column: ColumnRegular) => any;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n *\n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: any;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n}\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat<T = any> = T;\n\n/**\n * Additional properties applied to the cell.\n * Contains properties for custom cell rendering.\n */\nexport type CellProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n className?: JSXBase.HTMLAttributes<HTMLDivElement>['class'];\n // Additional properties for custom cell rendering\n [attr: string]: string | number | object | boolean | undefined;\n};\n\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport type VNodeResponse = (VNode | string | number) | (VNode | string | number)[] | null | undefined;\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n\n/**\n * `ExtraNodeFuncConfig` is a configuration object for `External nodes rendered in grid in HTMLRevogrExtraElement`.\n */\nexport interface ExtraNodeFuncConfig { refresh: () => void };\n\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: CellTemplateProp,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType<D = any> = {\n [T in ColumnProp]: DataFormat<D>;\n};\n\nexport type DataLookup<T = any> = {\n [rowIndex: number]: DataType<T>;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n providers: Providers<DimensionCols | 'rowHeaders'>;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n\n /**\n * The client size of the viewport.\n * Usually it's same as virtual size.\n * Until virtualization is not disabled.\n */\n clientSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n /**\n * List of indices for visible items in the grid\n */\n items: number[];\n /**\n * List of indices for visible items in the grid, even if they are trimmed\n * Update this collection if you want to change items order\n */\n proxyItems: number[];\n /**\n * Actual data array\n */\n source: T[];\n /**\n * Grouping information\n */\n groupingDepth: number;\n groups: Record<any, any>;\n /**\n * Dimension type, can be rows or columns depending on context\n */\n type: ST;\n /**\n * Info for trimming or filtering the data, to hide entities from visible data source\n */\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: { [index: number]: number} | null;\n\n /**\n * Object containing size for each visible item.\n * provider stores only changed sizes, not all of them\n * same as indexes but for sizes and positions\n * virtual item index to size\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n rowDimension: DimensionSettingsState;\n\n colDimension: DimensionSettingsState;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n\nexport interface FocusAfterRenderEvent extends AllDimensionType {\n model?: any;\n column?: ColumnRegular;\n /**\n * Index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Index of the column in the viewport\n */\n colIndex: number;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n\n/** Range paste. */\nexport interface RangeClipboardPasteEvent extends AllDimensionType {\n data: DataLookup;\n models: Partial<DataLookup>;\n range: RangeArea | null;\n}\n\n/** Range copy. */\nexport interface RangeClipboardCopyEventProps<T = any> extends AllDimensionType {\n data: DataFormat<T>[][];\n range: RangeArea;\n mapping: OldNewRangeMapping;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/types/interfaces.ts"],"names":[],"mappings":"AAgY4D,CAAC","sourcesContent":["import type { VNode } from '@stencil/core';\n\nimport type {\n DimensionCols,\n DimensionRows,\n DimensionColPin,\n DimensionType,\n MultiDimensionType,\n} from './dimension';\nimport type {\n Cell,\n EditorCtr,\n FocusedCells,\n OldNewRangeMapping,\n RangeArea,\n SelectionStoreState,\n} from './selection';\nimport type { Observable } from '../utils';\nimport type { JSXBase } from '@stencil/core/internal';\n\nexport type Nullable<T> = {\n [P in keyof T]: T[P] | null;\n};\n\n/**\n * Advanced column data schema model.\n * Used for transpassing data to cell renderer and editor.\n */\nexport interface ColumnDataSchemaModel {\n /**\n * Column prop used for mapping value to cell from data source model/row\n */\n prop: ColumnProp;\n /**\n * Row data object\n */\n model: DataType;\n /**\n * Column data object\n */\n column: ColumnRegular;\n /**\n * Virtual index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Virtual index of the column in the viewport\n */\n colIndex: number;\n /**\n * Column type based on viewport\n */\n colType: DimensionCols;\n /**\n * Row type based on viewport\n */\n type: DimensionRows;\n /**\n * Row models based on viewport\n */\n data: DataType[];\n /**\n * Current cell data value\n * Mapped from model through column property like model['prop']\n */\n value?: any;\n}\n/**\n * Template property for each cell, extends the column data schema model.\n * Additionally, it provides access to the providers injected into the template.\n */\nexport interface CellTemplateProp extends ColumnDataSchemaModel {\n /**\n * Providers injected into the template\n */\n providers: Providers;\n}\n/**\n * The ReadOnlyFormat type is a boolean value or a function that takes ColumnDataSchemaModel\n * as a parameter and returns a boolean value.\n *\n * If it is a boolean value, it represents whether the cell in question is read-only.\n * If it is a function, it returns whether the cell in question is read-only based on the provided\n * ColumnDataSchemaModel.\n */\nexport type ReadOnlyFormat =\n | boolean\n | ((params: ColumnDataSchemaModel) => boolean);\nexport type RowDrag =\n | boolean\n | {\n (params: ColumnDataSchemaModel): boolean;\n };\n/**\n * `ColumnGrouping` type is used to define a grouping in a column.\n */\nexport interface ColumnGrouping<T = any> {\n /**\n * An array of objects that represent the children of the grouping.\n */\n children: (ColumnGrouping<T> | ColumnRegular)[];\n /**\n * A `DataFormat` object that represents the name of the grouping.\n */\n name: DataFormat<T>;\n}\n/**\n * Configuration for header inner template properties\n */\nexport interface ColumnProperties {\n /**\n * Header inner template\n * Function/component to render custom header content\n */\n columnTemplate?: ColumnTemplateFunc;\n /**\n * Header Cell properties\n * Custom function/component to render header properties\n */\n columnProperties?: ColPropertiesFunc;\n}\n/**\n * Type that represents a collection of column types.\n * The keys are the names of the column types and the values are the corresponding column type objects.\n */\nexport type ColumnTypes = {\n /**\n * The name of the column type.\n */\n [name: string]: ColumnType;\n};\n\n/**\n * Interface for custom cell renderer.\n */\nexport interface CellTemplate {\n // TODO: Add Promise support for template and all custom function so user will be able to use async render on the light speed\n (\n createElement: HyperFunc<VNode>,\n props: CellTemplateProp,\n additionalData?: any,\n ): any;\n}\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnType extends ColumnProperties {\n /**\n * Represents whether the column or cell is read-only.\n * Can be a boolean or a function that returns a boolean.\n * The function receives column data as a parameter.\n */\n readonly?: ReadOnlyFormat;\n /**\n * Represents the default column size.\n */\n size?: number;\n /**\n * Represents the minimal column size.\n * This property cannot be less than cell padding\n * in order to keep performance on top and minimize DOM elements number.\n */\n minSize?: number;\n /**\n * Represents the maximum column size.\n */\n maxSize?: number;\n /**\n * Represents a custom editor defined in editors property.\n * Can be a string or an editor constructor function.\n */\n editor?: string | EditorCtr;\n /**\n * Represents cell properties for custom styling, classes, and events.\n */\n cellProperties?: PropertiesFunc;\n /**\n * Represents the cell template for custom rendering.\n */\n cellTemplate?: CellTemplate;\n /**\n * Represents the cell compare function for custom sorting.\n */\n cellCompare?: CellCompareFunc;\n\n /**\n * Represents the cell value parse function for custom parsing.\n * Currently only used for filtering.\n */\n cellParser?: (model: DataType, column: ColumnRegular) => any;\n}\nexport type Order = 'asc' | 'desc' | undefined;\n/**\n * Interface for regular column definition.\n * Regular column can be any column that is not a grouping column.\n *\n */\n/**\n * ColumnRegular interface represents regular column definition.\n * Regular column can be any column that is not a grouping column.\n */\nexport interface ColumnRegular extends ColumnType {\n /**\n * Column prop used for mapping value to cell from data source model/row, used for indexing.\n */\n prop: ColumnProp;\n /**\n * Column pin 'colPinStart'|'colPinEnd'.\n */\n pin?: DimensionColPin;\n /**\n * Column header text.\n */\n name?: any;\n /**\n * Column size would be changed based on space left.\n */\n autoSize?: boolean;\n /**\n * Filter. Require filter plugin to be installed and activated through grid config filter.\n */\n filter?: boolean | string | string[];\n /**\n * Is column can be sorted, check cellCompare function for custom sorting.\n */\n sortable?: boolean;\n /**\n * Sort order.\n */\n order?: Order;\n /**\n * Is cell in column or individual can be dragged.\n */\n rowDrag?: RowDrag;\n /**\n * Represents type defined in columnTypes property through grid config.\n */\n columnType?: string;\n /**\n * Function called before column applied to the store.\n */\n beforeSetup?(rgCol: ColumnRegular): void;\n /**\n * Additional properties can be added to the column definition.\n */\n [key: string]: any;\n}\n\nexport type ColumnData = (ColumnGrouping | ColumnRegular)[];\n/**\n * Column template property.\n * Contains extended properties for column.\n */\nexport interface ColumnTemplateProp extends ColumnRegular {\n /**\n * Providers injected into the template.\n */\n providers: Providers<DimensionCols | 'rowHeaders'>;\n /**\n * Index of the column, used for mapping value to cell from data source model/row.\n */\n index: number;\n}\n\nexport type ColumnPropProp = ColumnGrouping | ColumnTemplateProp;\n// Column prop used for mapping value to cell from data source model/row, used for indexing.\nexport type ColumnProp = string | number;\n\nexport type DataFormat<T = any> = T;\n\n/**\n * Additional properties applied to the cell.\n * Contains properties for custom cell rendering.\n */\nexport type CellProps = JSXBase.HTMLAttributes<HTMLDivElement> & {\n className?: JSXBase.HTMLAttributes<HTMLDivElement>['class'];\n // Additional properties for custom cell rendering\n [attr: string]: string | number | object | boolean | undefined;\n};\n\n\n/**\n * Providers for grid which are going to be injected into each cell template\n */\nexport type Providers<T = DimensionRows> = {\n /**\n * Dimension type (e.g. row or column)\n */\n type: T;\n /**\n * Flag indicating if grid is in readonly mode\n */\n readonly: boolean;\n /**\n * Data source store\n */\n data: Observable<DataSourceState<any, any>> | ColumnRegular[];\n /**\n * Viewport store\n */\n viewport: Observable<ViewportState>;\n /**\n * Dimension store\n */\n dimension: Observable<DimensionSettingsState>;\n /**\n * Selection store\n */\n selection: Observable<SelectionStoreState>;\n};\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n // (tag: any): T;\n (tag: any): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport type VNodeResponse = (VNode | string | number) | (VNode | string | number)[] | null | undefined;\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, data: any): T;\n}\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (tag: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, text: string): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: Array<T | undefined | null>): T;\n}\n\n/**\n * `HyperFunc` is a function that takes an HTML tag or component, and returns a\n * JSX element. This function is used to create JSX elements in a context where\n * JSX is not valid.\n */\nexport interface HyperFunc<T> {\n (sel: any, data: any, children: T): T;\n}\n\n/**\n * `ExtraNodeFuncConfig` is a configuration object for `External nodes rendered in grid in HTMLRevogrExtraElement`.\n */\nexport interface ExtraNodeFuncConfig { refresh: () => void };\n\n/**\n * `FocusTemplateFunc` is a function that takes an HTML tag or component, and\n * returns a JSX element. This function is used to create JSX elements in a\n * context where JSX is not valid.\n */\nexport type FocusTemplateFunc = (\n createElement: HyperFunc<VNode>,\n detail: FocusRenderEvent,\n) => any;\n\n/**\n * `CellCompareFunc` is a function that takes the column property to compare,\n * the data of the first cell, and the data of the second cell. It returns a\n * number indicating the relative order of the two cells.\n */\nexport type CellCompareFunc = (\n // The column property to compare.\n prop: ColumnProp,\n // The data of the first cell.\n a: DataType,\n // The data of the second cell.\n b: DataType,\n) => number;\nexport type ColumnTemplateFunc = (\n createElement: HyperFunc<VNode>,\n props: ColumnTemplateProp,\n additionalData?: any,\n) => any;\nexport type PropertiesFunc = (\n props: CellTemplateProp,\n) => CellProps | void | undefined;\nexport type ColPropertiesFunc = (\n props: ColumnPropProp,\n) => CellProps | void | undefined;\nexport type DataType<D = any> = {\n [T in ColumnProp]: DataFormat<D>;\n};\n\nexport type DataLookup<T = any> = {\n [rowIndex: number]: DataType<T>;\n};\n/**\n * `RowDefinition` is a type that represents a row definition in the\n * viewport.\n */\nexport type RowDefinition = {\n /**\n * The type of the row.\n */\n type: DimensionRows;\n /**\n * The size of the row.\n */\n size: number;\n /**\n * The index of the row.\n */\n index: number;\n};\nexport interface RowHeaders extends ColumnRegular {}\n/**\n * `ViewPortResizeEvent` is an object that contains information about a resize\n * event in the viewport.\n */\nexport type ViewPortResizeEvent = {\n /* The dimension of the viewport being resized. */\n dimension: DimensionType;\n /* The new size of the viewport. */\n size: number;\n /* Indicates whether the resize event is for a row header. */\n rowHeader?: boolean;\n};\n\n/**\n * `ViewPortScrollEvent` is an object that contains information about a scroll\n * event in the viewport.\n */\nexport type ViewPortScrollEvent = {\n /**\n * The dimension of the viewport being scrolled.\n */\n dimension: DimensionType;\n /**\n * The coordinate of the scroll event.\n */\n coordinate: number;\n /**\n * The change in coordinate between scroll events.\n */\n delta?: number;\n /**\n * Indicates whether the scroll event occurred outside the viewport.\n */\n outside?: boolean;\n};\n\n/**\n * `InitialHeaderClick` represents the information needed to handle a click\n * event on the initial column header.\n */\nexport type InitialHeaderClick = {\n /**\n * The index of the column header that was clicked.\n */\n index: number;\n /**\n * The original mouse event that triggered the click.\n */\n originalEvent: MouseEvent;\n /**\n * The column that was clicked.\n */\n column: ColumnRegular;\n providers: Providers<DimensionCols | 'rowHeaders'>;\n};\n\n/**\n * `Range` is an object that represents a range of values.\n */\nexport type Range = {\n /**\n * The start of the range.\n */\n start: number;\n /**\n * The end of the range.\n */\n end: number;\n};\n\n/**\n * `ViewportStateItems` is an object that represents the items in a viewport\n * along with their corresponding range.\n */\nexport type ViewportStateItems = {\n /**\n * The items in the viewport.\n */\n items: VirtualPositionItem[];\n} & Range;\n\n/**\n * `ViewportState` is an object that represents the state of a viewport.\n */\nexport interface ViewportState extends ViewportStateItems {\n /**\n * The number of real items in the viewport.\n */\n realCount: number;\n /**\n * The virtual size of the viewport.\n */\n virtualSize: number;\n\n /**\n * The client size of the viewport.\n * Usually it's same as virtual size.\n * Until virtualization is not disabled.\n */\n clientSize: number;\n}\n\n/**\n * `ViewSettingSizeProp` is a record that maps column or row indexes to their\n * corresponding sizes.\n */\nexport type ViewSettingSizeProp = Record<string, number>;\n\n/**\n * `VirtualPositionItem` is an object that represents a virtual position item\n * in the viewport.\n */\nexport interface VirtualPositionItem extends PositionItem {\n /**\n * The size of the virtual position item.\n */\n size: number;\n}\nexport type DataSourceState<\n T extends DataType | ColumnRegular,\n ST extends DimensionRows | DimensionCols,\n> = {\n /**\n * List of indices for visible items in the grid\n */\n items: number[];\n /**\n * List of indices for visible items in the grid, even if they are trimmed\n * Update this collection if you want to change items order\n */\n proxyItems: number[];\n /**\n * Actual data array\n */\n source: T[];\n /**\n * Grouping information\n */\n groupingDepth: number;\n groups: Record<any, any>;\n /**\n * Dimension type, can be rows or columns depending on context\n */\n type: ST;\n /**\n * Info for trimming or filtering the data, to hide entities from visible data source\n */\n trimmed: Record<any, any>;\n};\nexport interface PositionItem {\n itemIndex: number;\n start: number;\n end: number;\n}\n/**\n * Object containing information about calculated dimensions.\n * Used for both columns and rows.\n */\nexport interface DimensionCalc {\n /**\n * Array of indexes of visible items.\n */\n indexes: number[];\n\n /**\n * Count of visible items.\n */\n count: number;\n\n /**\n * Array of indexes of visible items.\n * Used for mapping items to their position in DOM.\n */\n positionIndexes: number[];\n\n /**\n * Mapping of position to item.\n * Used for mapping position in DOM to item.\n */\n positionIndexToItem: {\n /**\n * Position in DOM.\n */\n [position: number]: PositionItem;\n };\n\n /**\n * Mapping of index to item.\n * Used for mapping index in data source to item.\n */\n indexToItem: {\n /**\n * Index in data source.\n */\n [index: number]: PositionItem;\n };\n\n /**\n * Object containing information about trimmed data.\n * Used for hiding entities from visible data source.\n */\n trimmed: { [index: number]: number} | null;\n\n /**\n * Object containing size for each visible item.\n * provider stores only changed sizes, not all of them\n * same as indexes but for sizes and positions\n * virtual item index to size\n */\n sizes: ViewSettingSizeProp;\n}\n/**\n * Represents the settings state of a dimension.\n * It extends the calculation properties of a dimension.\n * It also includes the real size and origin item size of the dimension.\n */\nexport interface DimensionSettingsState extends DimensionCalc {\n /**\n * Represents the real size of the dimension.\n */\n realSize: number;\n\n /**\n * Represents the origin item size of the dimension.\n */\n originItemSize: number;\n}\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores.\n */\nexport type DimensionStores = {\n [T in MultiDimensionType]: Observable<DimensionSettingsState>;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding observable stores for the viewport.\n */\nexport type ViewportStores = {\n [T in MultiDimensionType]: Observable<ViewportState>;\n};\n\n/**\n * Represents the event object that is emitted when the drag operation starts.\n */\nexport interface DragStartEvent {\n /**\n * Represents the original mouse event that triggered the drag operation.\n */\n originalEvent: MouseEvent;\n\n /**\n * Represents the model of the column being dragged.\n */\n model: ColumnDataSchemaModel;\n}\n\n/**\n * Represents the event object that is emitted before cell rendering.\n * It includes information about the dimension type, column, row, and model.\n */\nexport interface BeforeCellRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the column being rendered.\n */\n column: VirtualPositionItem;\n\n /**\n * Represents the row being rendered.\n */\n row: VirtualPositionItem;\n\n /**\n * Represents the model being rendered.\n */\n model: T;\n}\n\n/**\n * Represents the event object that is emitted before row rendering.\n * It includes information about the dimension type, data item, item, and node.\n */\nexport interface BeforeRowRenderEvent<T = any> extends AllDimensionType {\n /**\n * Represents the data item being rendered.\n */\n model: T;\n\n /**\n * Represents the item being rendered.\n */\n item: VirtualPositionItem;\n\n /**\n * Represents the node being rendered.\n */\n node: VNode;\n}\n\n/**\n * Represents the event object that is emitted after rendering.\n * It includes information about the dimension type.\n */\nexport type AfterRendererEvent = {\n /**\n * Represents the type of dimension being rendered.\n */\n type: DimensionType;\n};\n\n/**\n * Represents the mapping of dimension types to their corresponding dimension types.\n */\nexport interface AllDimensionType {\n /**\n * Represents the dimension type for rows.\n */\n rowType: DimensionRows;\n\n /**\n * Represents the dimension type for columns.\n */\n colType: DimensionCols;\n}\n\n/**\n * Represents the event object that is emitted when applying focus.\n * It includes information about the dimension type and focused cells.\n */\nexport interface ApplyFocusEvent extends AllDimensionType, FocusedCells {}\n\n/**\n * Represents the event object that is emitted before focus rendering.\n * It includes information about the dimension type and range area.\n */\nexport interface FocusRenderEvent extends AllDimensionType {\n /**\n * Represents the range area of the focus.\n */\n range: RangeArea;\n\n rowDimension: DimensionSettingsState;\n\n colDimension: DimensionSettingsState;\n\n /**\n * Changes for the next cell to focus. @example { y: -1 }\n */\n next?: Partial<Cell>;\n}\n\nexport interface FocusAfterRenderEvent extends AllDimensionType {\n model?: any;\n column?: ColumnRegular;\n /**\n * Virtual index of the row in the viewport\n */\n rowIndex: number;\n /**\n * Virtual index of the column in the viewport\n */\n colIndex: number;\n}\n/**\n * Represents the event object that is emitted when scrolling occurs.\n * The `type` property indicates the type of dimension (row or column) being scrolled.\n * The `coordinate` property represents the current scroll position in that dimension.\n */\nexport type ScrollCoordinateEvent = {\n /**\n * Represents the type of dimension being scrolled.\n * Possible values are 'rgRow' and 'rgCol'.\n */\n type: DimensionType;\n\n /**\n * Represents the current scroll position in the specified dimension.\n * The value is a number representing the coordinate in pixels.\n */\n coordinate: number;\n};\n\n/** Range paste. */\nexport interface RangeClipboardPasteEvent extends AllDimensionType {\n data: DataLookup;\n models: Partial<DataLookup>;\n range: RangeArea | null;\n}\n\n/** Range copy. */\nexport interface RangeClipboardCopyEventProps<T = any> extends AllDimensionType {\n data: DataFormat<T>[][];\n range: RangeArea;\n mapping: OldNewRangeMapping;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/types/selection.ts"],"names":[],"mappings":"","sourcesContent":["import { type VNode } from '@stencil/core';\nimport type { DimensionRows, DimensionCols } from './dimension';\nimport type {\n ColumnProp,\n DataType,\n DataLookup,\n HyperFunc,\n ColumnDataSchemaModel,\n PositionItem,\n} from './interfaces';\n\nexport type RowIndex = number;\nexport type ColIndex = number;\n\n/**\n * Represents the state of the selection store.\n * It contains information about the selection range, temporary range,\n * focused cell, editing cell, last focused cell, and next cell to focus.\n */\nexport type SelectionStoreState = {\n range: RangeArea | null;\n /**\n * Temporary range selection area\n */\n tempRange: RangeArea | null;\n /**\n * Type of the temporary range selection\n */\n tempRangeType: string | null;\n /**\n * Focused cell coordinate\n */\n focus: Cell | null;\n /**\n * Editing cell store\n */\n edit: EditCellStore | null;\n /**\n * Last cell which was focused\n */\n lastCell: Cell | null;\n /**\n * Next cell to focus\n */\n nextFocus: Cell | null;\n};\nexport type RangeArea = {\n x: ColIndex;\n y: RowIndex;\n x1: ColIndex;\n y1: RowIndex;\n};\nexport type TempRange = {\n type: string;\n area: RangeArea;\n};\nexport type OldNewRangeMapping = {\n [newRowIndex: number]: {\n [T in ColumnProp]: { // new column prop\n rowIndex: number; // original row\n colIndex: number; // original col\n colProp: ColumnProp; // original column prop\n };\n };\n};\nexport type ChangedRange = {\n type: DimensionRows;\n colType: DimensionCols;\n newRange: RangeArea; // new range to apply\n oldRange: RangeArea; // range to copy from\n mapping: OldNewRangeMapping;\n newData: {\n [newRowIndex: number]: DataType;\n };\n};\n\n/**\n * Cell coordinates\n */\nexport interface Cell {\n x: ColIndex;\n y: RowIndex;\n}\nexport type FocusedCells = {\n focus: Cell;\n end: Cell;\n};\nexport type RangeAreaCss = {\n left: string;\n top: string;\n width: string;\n height: string;\n};\n\nexport type SaveDataDetails = {\n rgRow: RowIndex;\n rgCol: ColIndex;\n type: DimensionRows;\n prop: ColumnProp;\n val: any;\n preventFocus?: boolean;\n};\n\nexport type BeforeEdit = BeforeSaveDataDetails;\n\nexport type RowDragStartDetails = {\n cell: Cell;\n text: string;\n pos: PositionItem;\n event: MouseEvent;\n rowType: DimensionRows;\n model: any;\n};\n\nexport interface BeforeSaveDataDetails extends ColumnDataSchemaModel {\n /**\n * Value from editor to save, not part of the model value yet\n */\n val?: any;\n}\n\nexport type BeforeRangeSaveDataDetails = {\n data: DataLookup;\n models: Partial<DataLookup>;\n type: DimensionRows;\n newRange: RangeArea | null;\n oldRange: RangeArea | null;\n};\n\nexport type AfterEditEvent = BeforeRangeSaveDataDetails | BeforeSaveDataDetails;\n\n/**\n * Edit cell info for store\n */\nexport interface EditCellStore extends Cell {\n val?: any;\n}\n/**\n * Edit cell info for editor\n */\nexport type EditCell = EditCellStore & BeforeSaveDataDetails;\n\n/**\n * Available editors in grid\n */\nexport type Editors = {\n [name: string]: EditorCtr;\n};\n\n/**\n * Editor component\n */\nexport type EditorCtr = EditorCtrCallable | EditorCtrConstructible;\n\n\n/**\n * Editor component callable function\n */\nexport type EditorCtrCallable = {\n (\n column: ColumnDataSchemaModel,\n save: (value?: any, preventFocus?: boolean) => void,\n close: (focusNext?: boolean) => void,\n ): EditorBase;\n}\n/**\n * Editor component constructible class\n */\nexport interface EditorCtrConstructible {\n new (\n column: ColumnDataSchemaModel,\n save: (value: any, preventFocus?: boolean) => void,\n close: (focusNext?: boolean) => void,\n ): EditorBase;\n}\n\n/**\n * Editor interface\n */\nexport interface EditorBase {\n element?: Element | null;\n editCell?: EditCell;\n /**\n * Autosave usage when you want to return value for models.\n */\n getValue?(): any;\n /**\n * For Editor plugin internal usage.\n * Prevents Editor save. Manual save usage required.\n */\n beforeAutoSave?(val?: any): boolean;\n beforeUpdate?(): void;\n /**\n * Before editor got disconnected.\n * Can be triggered multiple times before actual disconnect.\n */\n beforeDisconnect?(): void;\n componentDidRender?(): void;\n disconnectedCallback?(): void;\n render(\n createElement: HyperFunc<VNode>,\n additionalData?: any,\n ): VNode | VNode[] | string | void;\n}\n"]}
1
+ {"version":3,"file":"selection.js","sourceRoot":"","sources":["../../src/types/selection.ts"],"names":[],"mappings":"","sourcesContent":["import { type VNode } from '@stencil/core';\nimport type { DimensionRows, DimensionCols } from './dimension';\nimport type {\n ColumnProp,\n DataType,\n DataLookup,\n HyperFunc,\n ColumnDataSchemaModel,\n PositionItem,\n} from './interfaces';\n\n// Virtual index of row\nexport type RowIndex = number;\n// Virtual index of row\nexport type ColIndex = number;\n\n/**\n * Represents the state of the selection store.\n * It contains information about the selection range, temporary range,\n * focused cell, editing cell, last focused cell, and next cell to focus.\n */\nexport type SelectionStoreState = {\n range: RangeArea | null;\n /**\n * Temporary range selection area\n */\n tempRange: RangeArea | null;\n /**\n * Type of the temporary range selection\n */\n tempRangeType: string | null;\n /**\n * Focused cell coordinate\n */\n focus: Cell | null;\n /**\n * Editing cell store\n */\n edit: EditCellStore | null;\n /**\n * Last cell which was focused\n */\n lastCell: Cell | null;\n /**\n * Next cell to focus\n */\n nextFocus: Cell | null;\n};\n\n// Virtual index of row (y) and column (x)\nexport type RangeArea = {\n x: ColIndex;\n y: RowIndex;\n x1: ColIndex;\n y1: RowIndex;\n};\nexport type TempRange = {\n type: string;\n area: RangeArea;\n};\nexport type OldNewRangeMapping = {\n [newRowIndex: number]: {\n [T in ColumnProp]: { // new column prop\n rowIndex: number; // Virtual index of original row\n colIndex: number; // Virtual index of original col\n colProp: ColumnProp; // original column prop\n };\n };\n};\nexport type ChangedRange = {\n type: DimensionRows;\n colType: DimensionCols;\n newRange: RangeArea; // new range to apply\n oldRange: RangeArea; // range to copy from\n mapping: OldNewRangeMapping;\n newData: {\n [newRowIndex: number]: DataType;\n };\n};\n\n/**\n * Cell coordinates\n */\nexport interface Cell {\n x: ColIndex; // Virtual index of column\n y: RowIndex; // Virtual index of row\n}\nexport type FocusedCells = {\n focus: Cell;\n end: Cell;\n};\nexport type RangeAreaCss = {\n left: string;\n top: string;\n width: string;\n height: string;\n};\n\nexport type SaveDataDetails = {\n rgRow: RowIndex; // Virtual index of row\n rgCol: ColIndex; // Virtual index of column\n type: DimensionRows;\n prop: ColumnProp;\n val: any;\n preventFocus?: boolean;\n};\n\nexport type BeforeEdit = BeforeSaveDataDetails;\n\nexport type RowDragStartDetails = {\n cell: Cell;\n text: string;\n pos: PositionItem;\n event: MouseEvent;\n rowType: DimensionRows;\n model: any;\n};\n\nexport interface BeforeSaveDataDetails extends ColumnDataSchemaModel {\n /**\n * Value from editor to save, not part of the model value yet\n */\n val?: any;\n}\n\nexport type BeforeRangeSaveDataDetails = {\n data: DataLookup;\n models: Partial<DataLookup>;\n type: DimensionRows;\n newRange: RangeArea | null;\n oldRange: RangeArea | null;\n};\n\nexport type AfterEditEvent = BeforeRangeSaveDataDetails | BeforeSaveDataDetails;\n\n/**\n * Edit cell info for store\n */\nexport interface EditCellStore extends Cell {\n val?: any;\n}\n/**\n * Edit cell info for editor\n */\nexport type EditCell = EditCellStore & BeforeSaveDataDetails;\n\n/**\n * Available editors in grid\n */\nexport type Editors = {\n [name: string]: EditorCtr;\n};\n\n/**\n * Editor component\n */\nexport type EditorCtr = EditorCtrCallable | EditorCtrConstructible;\n\n\n/**\n * Editor component callable function\n */\nexport type EditorCtrCallable = {\n (\n column: ColumnDataSchemaModel,\n save: (value?: any, preventFocus?: boolean) => void,\n close: (focusNext?: boolean) => void,\n ): EditorBase;\n}\n/**\n * Editor component constructible class\n */\nexport interface EditorCtrConstructible {\n new (\n column: ColumnDataSchemaModel,\n save: (value: any, preventFocus?: boolean) => void,\n close: (focusNext?: boolean) => void,\n ): EditorBase;\n}\n\n/**\n * Editor interface\n */\nexport interface EditorBase {\n element?: Element | null;\n editCell?: EditCell;\n /**\n * Autosave usage when you want to return value for models.\n */\n getValue?(): any;\n /**\n * For Editor plugin internal usage.\n * Prevents Editor save. Manual save usage required.\n */\n beforeAutoSave?(val?: any): boolean;\n beforeUpdate?(): void;\n /**\n * Before editor got disconnected.\n * Can be triggered multiple times before actual disconnect.\n */\n beforeDisconnect?(): void;\n componentDidRender?(): void;\n disconnectedCallback?(): void;\n render(\n createElement: HyperFunc<VNode>,\n additionalData?: any,\n ): VNode | VNode[] | string | void;\n}\n"]}
@@ -24,11 +24,11 @@ export interface ColumnDataSchemaModel {
24
24
  */
25
25
  column: ColumnRegular;
26
26
  /**
27
- * Index of the row in the viewport
27
+ * Virtual index of the row in the viewport
28
28
  */
29
29
  rowIndex: number;
30
30
  /**
31
- * Index of the column in the viewport
31
+ * Virtual index of the column in the viewport
32
32
  */
33
33
  colIndex: number;
34
34
  /**
@@ -701,11 +701,11 @@ export interface FocusAfterRenderEvent extends AllDimensionType {
701
701
  model?: any;
702
702
  column?: ColumnRegular;
703
703
  /**
704
- * Index of the row in the viewport
704
+ * Virtual index of the row in the viewport
705
705
  */
706
706
  rowIndex: number;
707
707
  /**
708
- * Index of the column in the viewport
708
+ * Virtual index of the column in the viewport
709
709
  */
710
710
  colIndex: number;
711
711
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@revolist/revogrid",
3
- "version": "4.14.3",
3
+ "version": "4.14.4",
4
4
  "type": "module",
5
5
  "description": "Virtual reactive data grid spreadsheet component - RevoGrid.",
6
6
  "license": "MIT",