From a4cc469e9c21c5ed851bfbaafdc6b580e7389272 Mon Sep 17 00:00:00 2001 From: Ghislain B Date: Fri, 24 Nov 2023 14:37:07 -0500 Subject: [PATCH] fix: remove CellRange, SlickRange, SlickGroup, ... unused interfaces (#1219) * fix: remove CellRange, SlickRange, SlickGroup, ... unused interfaces - since we moved SlickGrid inside the project, we can now use the TS classes directly instead of relying on similar interfaces - also remove slick core re-export and replace it by exporting core folder * chore: move CSS Style Declartion to its own interface file --- .../src/examples/example19.ts | 4 +- packages/common/src/core/slickDataview.ts | 7 +- .../common/src/enums/slickPluginList.enum.ts | 3 +- .../slickCellExcelCopyManager.spec.ts | 6 +- .../slickCellExternalCopyManager.ts | 14 ++-- .../src/extensions/slickCellRangeDecorator.ts | 6 +- .../src/extensions/slickCellSelectionModel.ts | 4 +- .../src/extensions/slickRowSelectionModel.ts | 6 +- packages/common/src/index.ts | 12 +-- .../src/interfaces/cellRange.interface.ts | 17 ---- .../interfaces/cssDeclaration.interface.ts | 2 + .../interfaces/dataViewOption.interface.ts | 9 -- .../excelCopyBufferOption.interface.ts | 10 +-- .../externalCopyClipCommand.interface.ts | 7 +- .../src/interfaces/gridOption.interface.ts | 5 +- packages/common/src/interfaces/index.ts | 5 +- .../interfaces/slickEditorLock.interface.ts | 56 ------------- .../src/interfaces/slickGroup.interface.ts | 82 ------------------- .../src/interfaces/slickRange.interface.ts | 26 ------ .../components/slick-vanilla-grid-bundle.ts | 3 +- 20 files changed, 44 insertions(+), 240 deletions(-) create mode 100644 packages/common/src/interfaces/cssDeclaration.interface.ts delete mode 100644 packages/common/src/interfaces/dataViewOption.interface.ts delete mode 100644 packages/common/src/interfaces/slickEditorLock.interface.ts delete mode 100644 packages/common/src/interfaces/slickGroup.interface.ts delete mode 100644 packages/common/src/interfaces/slickRange.interface.ts diff --git a/examples/vite-demo-vanilla-bundle/src/examples/example19.ts b/examples/vite-demo-vanilla-bundle/src/examples/example19.ts index 6e16eac9a..b350b2959 100644 --- a/examples/vite-demo-vanilla-bundle/src/examples/example19.ts +++ b/examples/vite-demo-vanilla-bundle/src/examples/example19.ts @@ -1,4 +1,4 @@ -import { type CellRange, type Column, type GridOption, SlickEventHandler, } from '@slickgrid-universal/common'; +import { type Column, type GridOption, SlickEventHandler, type SlickRange } from '@slickgrid-universal/common'; import { Slicker, SlickVanillaGridBundle } from '@slickgrid-universal/vanilla-bundle'; import { ExampleGridOptions } from './example-grid-options'; import '../salesforce-styles.scss'; @@ -29,7 +29,7 @@ export default class Example19 { // bind any of the grid events const cellSelectionModel = this.sgb.slickGrid!.getSelectionModel(); - this._eventHandler.subscribe(cellSelectionModel!.onSelectedRangesChanged, (_e, args: CellRange[]) => { + this._eventHandler.subscribe(cellSelectionModel!.onSelectedRangesChanged, (_e, args: SlickRange[]) => { const targetRange = document.querySelector('#selectionRange') as HTMLSpanElement; targetRange.textContent = ''; diff --git a/packages/common/src/core/slickDataview.ts b/packages/common/src/core/slickDataview.ts index 7bfffd332..057e0e92f 100644 --- a/packages/common/src/core/slickDataview.ts +++ b/packages/common/src/core/slickDataview.ts @@ -28,8 +28,13 @@ import { import type { SlickGrid } from './slickGrid'; export interface DataViewOption { - groupItemMetadataProvider: SlickGroupItemMetadataProvider | null; + /** Defaults to false, use with great care as this will break built-in filters */ inlineFilters: boolean; + + /** Optionally provide a Group Item Metatadata Provider when using Grouping/DraggableGrouping feature */ + groupItemMetadataProvider: SlickGroupItemMetadataProvider | null; + + /** Defaults to false, should we use CSP Safe filter method? The CSP safe is slighly slower compare to dynamic function default */ useCSPSafeFilter: boolean; } diff --git a/packages/common/src/enums/slickPluginList.enum.ts b/packages/common/src/enums/slickPluginList.enum.ts index 4d52630c4..7b1dcd3a1 100644 --- a/packages/common/src/enums/slickPluginList.enum.ts +++ b/packages/common/src/enums/slickPluginList.enum.ts @@ -1,5 +1,6 @@ import type { ExtensionName } from '../enums/index'; -import type { SlickEditorLock, SlickRowDetailView } from '../interfaces/index'; +import type { SlickEditorLock } from '../core/index'; +import type { SlickRowDetailView } from '../interfaces/index'; import type { SlickAutoTooltip, SlickCellExcelCopyManager, diff --git a/packages/common/src/extensions/__tests__/slickCellExcelCopyManager.spec.ts b/packages/common/src/extensions/__tests__/slickCellExcelCopyManager.spec.ts index f27601a8d..168378106 100644 --- a/packages/common/src/extensions/__tests__/slickCellExcelCopyManager.spec.ts +++ b/packages/common/src/extensions/__tests__/slickCellExcelCopyManager.spec.ts @@ -1,10 +1,10 @@ -import type { CellRange, EditCommand, Formatter, GridOption } from '../../interfaces/index'; +import type { EditCommand, Formatter, GridOption } from '../../interfaces/index'; import { Formatters } from '../../formatters'; import { SharedService } from '../../services/shared.service'; import { SlickCellExcelCopyManager } from '../slickCellExcelCopyManager'; import { SlickCellSelectionModel } from '../slickCellSelectionModel'; import { SlickCellExternalCopyManager } from '../slickCellExternalCopyManager'; -import { SlickEvent, SlickEventData, SlickGrid } from '../../core/index'; +import { SlickEvent, SlickEventData, SlickGrid, SlickRange } from '../../core/index'; jest.mock('flatpickr', () => { }); @@ -57,7 +57,7 @@ jest.mock('../slickCellExternalCopyManager', () => ({ describe('CellExcelCopyManager', () => { let queueCallback: EditCommand; const mockEventCallback = () => { }; - const mockSelectRange = [{ fromCell: 1, fromRow: 1, toCell: 1, toRow: 1 }] as CellRange[]; + const mockSelectRange = [{ fromCell: 1, fromRow: 1, toCell: 1, toRow: 1 }] as SlickRange[]; const mockSelectRangeEvent = { ranges: mockSelectRange }; let plugin: SlickCellExcelCopyManager; diff --git a/packages/common/src/extensions/slickCellExternalCopyManager.ts b/packages/common/src/extensions/slickCellExternalCopyManager.ts index fa61e2d92..153350258 100644 --- a/packages/common/src/extensions/slickCellExternalCopyManager.ts +++ b/packages/common/src/extensions/slickCellExternalCopyManager.ts @@ -1,4 +1,4 @@ -import type { CellRange, Column, ExcelCopyBufferOption, ExternalCopyClipCommand } from '../interfaces/index'; +import type { Column, ExcelCopyBufferOption, ExternalCopyClipCommand } from '../interfaces/index'; import { createDomElement, removeHtmlTags } from '../services/domUtilities'; import { SlickEvent, SlickEventData, SlickEventHandler, type SlickGrid, SlickRange } from '../core/index'; @@ -16,16 +16,16 @@ const CLIPBOARD_PASTE_DELAY = 100; */ export class SlickCellExternalCopyManager { pluginName: 'CellExternalCopyManager' = 'CellExternalCopyManager' as const; - onCopyCells = new SlickEvent<{ ranges: CellRange[]; }>(); - onCopyCancelled = new SlickEvent<{ ranges: CellRange[]; }>(); - onPasteCells = new SlickEvent<{ ranges: CellRange[]; }>(); + onCopyCells = new SlickEvent<{ ranges: SlickRange[]; }>(); + onCopyCancelled = new SlickEvent<{ ranges: SlickRange[]; }>(); + onPasteCells = new SlickEvent<{ ranges: SlickRange[]; }>(); protected _addonOptions!: ExcelCopyBufferOption; protected _bodyElement = document.body; protected _clearCopyTI?: NodeJS.Timeout; protected _copiedCellStyle = 'copied'; protected _copiedCellStyleLayerKey = 'copy-manager'; - protected _copiedRanges: CellRange[] | null = null; + protected _copiedRanges: SlickRange[] | null = null; protected _eventHandler: SlickEventHandler; protected _grid!: SlickGrid; protected _onCopyInit?: () => void; @@ -346,7 +346,7 @@ export class SlickCellExternalCopyManager { protected handleKeyDown(e: any): boolean | void { - let ranges: CellRange[]; + let ranges: SlickRange[]; if (!this._grid.getEditorLock().isActive() || this._grid.getOptions().autoEdit) { if (e.key === 'Escape') { if (this._copiedRanges) { @@ -445,7 +445,7 @@ export class SlickCellExternalCopyManager { } } - protected markCopySelection(ranges: CellRange[]) { + protected markCopySelection(ranges: SlickRange[]) { this.clearCopySelection(); const columns = this._grid.getColumns(); diff --git a/packages/common/src/extensions/slickCellRangeDecorator.ts b/packages/common/src/extensions/slickCellRangeDecorator.ts index 0f5c5dfa3..086c5b8e7 100644 --- a/packages/common/src/extensions/slickCellRangeDecorator.ts +++ b/packages/common/src/extensions/slickCellRangeDecorator.ts @@ -1,8 +1,8 @@ import { deepMerge } from '@slickgrid-universal/utils'; -import type { CellRange, CellRangeDecoratorOption, CSSStyleDeclarationWritable } from '../interfaces/index'; import { createDomElement } from '../services/domUtilities'; -import { type SlickGrid } from '../core/index'; +import type { CellRangeDecoratorOption, CSSStyleDeclarationWritable } from '../interfaces/index'; +import type { SlickGrid, SlickRange } from '../core/index'; /** * Displays an overlay on top of a given cell range. @@ -51,7 +51,7 @@ export class SlickCellRangeDecorator { this._elem = null; } - show(range: CellRange) { + show(range: SlickRange) { if (!this._elem) { this._elem = createDomElement('div', { className: this._options.selectionCssClass }); Object.keys(this._options.selectionCss as CSSStyleDeclaration).forEach((cssStyleKey) => { diff --git a/packages/common/src/extensions/slickCellSelectionModel.ts b/packages/common/src/extensions/slickCellSelectionModel.ts index acbb0be46..4145a4319 100644 --- a/packages/common/src/extensions/slickCellSelectionModel.ts +++ b/packages/common/src/extensions/slickCellSelectionModel.ts @@ -1,7 +1,7 @@ import { type SlickDataView, SlickEvent, SlickEventData, SlickEventHandler, SlickRange, type SlickGrid } from '../core/index'; import type { SelectionModel } from '../enums/index'; -import type { CellRange, OnActiveCellChangedEventArgs } from '../interfaces/index'; +import type { OnActiveCellChangedEventArgs } from '../interfaces/index'; import { SlickCellRangeSelector } from './index'; export interface CellSelectionModelOption { @@ -82,7 +82,7 @@ export class SlickCellSelectionModel implements SelectionModel { return this._ranges; } - rangesAreEqual(range1: CellRange[], range2: CellRange[]) { + rangesAreEqual(range1: SlickRange[], range2: SlickRange[]) { let areDifferent = (range1.length !== range2.length); if (!areDifferent) { for (let i = 0; i < range1.length; i++) { diff --git a/packages/common/src/extensions/slickRowSelectionModel.ts b/packages/common/src/extensions/slickRowSelectionModel.ts index f115488d8..78de80059 100644 --- a/packages/common/src/extensions/slickRowSelectionModel.ts +++ b/packages/common/src/extensions/slickRowSelectionModel.ts @@ -1,5 +1,5 @@ import { type SelectionModel } from '../enums/index'; -import type { CellRange, GridOption, OnActiveCellChangedEventArgs, RowSelectionModelOption, } from '../interfaces/index'; +import type { GridOption, OnActiveCellChangedEventArgs, RowSelectionModelOption, } from '../interfaces/index'; import { SlickCellRangeSelector } from '../extensions/slickCellRangeSelector'; import { SlickEvent, SlickEventData, SlickEventHandler, type SlickGrid, SlickRange } from '../core/index'; @@ -144,7 +144,7 @@ export class SlickRowSelectionModel implements SelectionModel { this._grid.setActiveCell(cell.row, cell.cell); } - protected handleCellRangeSelected(_e: SlickEventData, args: { range: CellRange; }): boolean | void { + protected handleCellRangeSelected(_e: SlickEventData, args: { range: SlickRange; }): boolean | void { if (!this.gridOptions.multiSelect || !this.addonOptions.selectActiveRow) { return false; } @@ -239,7 +239,7 @@ export class SlickRowSelectionModel implements SelectionModel { return /move|selectAndMove/.test(col); } - protected rangesToRows(ranges: CellRange[]): number[] { + protected rangesToRows(ranges: SlickRange[]): number[] { const rows = []; for (let i = 0; i < ranges.length; i++) { for (let j = ranges[i].fromRow; j <= ranges[i].toRow; j++) { diff --git a/packages/common/src/index.ts b/packages/common/src/index.ts index b0e5dbadc..9b00b01bb 100644 --- a/packages/common/src/index.ts +++ b/packages/common/src/index.ts @@ -18,6 +18,7 @@ export { export * from './constants'; export * from './global-grid-options'; +export * from './core/index'; export * from './enums/index'; export * from './interfaces/index'; export * from './aggregators/index'; @@ -45,14 +46,3 @@ export { SlickgridConfig } from './slickgrid-config'; // re-export MultipleSelectOption to avoid breaking previous code implementation export { MultipleSelectOption } from 'multiple-select-vanilla'; - -// re-export SlickGrid core files -export { - SlickDataView, - SlickEvent, - SlickEventData, - SlickEventHandler, - SlickGlobalEditorLock, - SlickGrid, - Utils, -} from './core/index'; \ No newline at end of file diff --git a/packages/common/src/interfaces/cellRange.interface.ts b/packages/common/src/interfaces/cellRange.interface.ts index cceed6d70..9beda2d41 100644 --- a/packages/common/src/interfaces/cellRange.interface.ts +++ b/packages/common/src/interfaces/cellRange.interface.ts @@ -1,19 +1,5 @@ import type { SlickCellRangeDecorator } from '../extensions/slickCellRangeDecorator'; -export interface CellRange { - /** Selection start from which cell? */ - fromCell: number; - - /** Selection start from which row? */ - fromRow: number; - - /** Selection goes to which cell? */ - toCell: number; - - /** Selection goes to which row? */ - toRow: number; -} - export interface CellRangeDecoratorOption { selectionCssClass: string; selectionCss: CSSStyleDeclaration; @@ -39,6 +25,3 @@ export interface CellRangeSelectorOption { /** styling (for example blue background on cell) */ selectionCss: CSSStyleDeclaration; } - -export type CSSStyleDeclarationReadonly = 'length' | 'parentRule' | 'getPropertyPriority' | 'getPropertyValue' | 'item' | 'removeProperty' | 'setProperty'; -export type CSSStyleDeclarationWritable = keyof Omit; diff --git a/packages/common/src/interfaces/cssDeclaration.interface.ts b/packages/common/src/interfaces/cssDeclaration.interface.ts new file mode 100644 index 000000000..3e6c11916 --- /dev/null +++ b/packages/common/src/interfaces/cssDeclaration.interface.ts @@ -0,0 +1,2 @@ +export type CSSStyleDeclarationReadonly = 'length' | 'parentRule' | 'getPropertyPriority' | 'getPropertyValue' | 'item' | 'removeProperty' | 'setProperty'; +export type CSSStyleDeclarationWritable = keyof Omit; diff --git a/packages/common/src/interfaces/dataViewOption.interface.ts b/packages/common/src/interfaces/dataViewOption.interface.ts deleted file mode 100644 index a1504d880..000000000 --- a/packages/common/src/interfaces/dataViewOption.interface.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { SlickGroupItemMetadataProvider } from '../extensions/slickGroupItemMetadataProvider'; - -export interface DataViewOption { - /** Defaults to false, use with great care as this will break built-in filters */ - inlineFilters?: boolean; - - /** Optionally provide a Group Item Metatadata Provider when using Grouping/DraggableGrouping feature */ - groupItemMetadataProvider?: SlickGroupItemMetadataProvider | null; -} diff --git a/packages/common/src/interfaces/excelCopyBufferOption.interface.ts b/packages/common/src/interfaces/excelCopyBufferOption.interface.ts index 0d2a499a4..a4065a0f3 100644 --- a/packages/common/src/interfaces/excelCopyBufferOption.interface.ts +++ b/packages/common/src/interfaces/excelCopyBufferOption.interface.ts @@ -1,7 +1,7 @@ -import type { Column, CellRange, FormatterResultWithHtml, FormatterResultWithText, } from './index'; +import type { Column, FormatterResultWithHtml, FormatterResultWithText, } from './index'; import type { SlickCellExcelCopyManager, } from '../extensions/slickCellExcelCopyManager'; -import type { SlickEventData } from '../core/index'; +import type { SlickEventData, SlickRange } from '../core/index'; export interface ExcelCopyBufferOption { /** defaults to 2000(ms), delay in ms to wait before clearing the selection after a paste action */ @@ -54,11 +54,11 @@ export interface ExcelCopyBufferOption { onExtensionRegistered?: (plugin: SlickCellExcelCopyManager) => void; /** Fired when a copy cell is triggered */ - onCopyCells?: (e: SlickEventData, args: { ranges: CellRange[] }) => void; + onCopyCells?: (e: SlickEventData, args: { ranges: SlickRange[]; }) => void; /** Fired when the command to copy the cells is cancelled */ - onCopyCancelled?: (e: SlickEventData, args: { ranges: CellRange[] }) => void; + onCopyCancelled?: (e: SlickEventData, args: { ranges: SlickRange[]; }) => void; /** Fired when the user paste cells to the grid */ - onPasteCells?: (e: SlickEventData, args: { ranges: CellRange[] }) => void; + onPasteCells?: (e: SlickEventData, args: { ranges: SlickRange[]; }) => void; } diff --git a/packages/common/src/interfaces/externalCopyClipCommand.interface.ts b/packages/common/src/interfaces/externalCopyClipCommand.interface.ts index e57219a69..d0dac9754 100644 --- a/packages/common/src/interfaces/externalCopyClipCommand.interface.ts +++ b/packages/common/src/interfaces/externalCopyClipCommand.interface.ts @@ -1,11 +1,12 @@ import type { SlickCellExternalCopyManager } from '../extensions/slickCellExternalCopyManager'; -import type { CellRange, Column, ExcelCopyBufferOption } from './index'; +import type { Column, ExcelCopyBufferOption } from './index'; +import type { SlickRange } from '../core'; export interface ExternalCopyClipCommand { activeCell: number; activeRow: number; cellExternalCopyManager: SlickCellExternalCopyManager; - clippedRange: CellRange[]; + clippedRange: SlickRange[]; destH: number; destW: number; h: number; @@ -18,7 +19,7 @@ export interface ExternalCopyClipCommand { _options: ExcelCopyBufferOption; execute: () => void; - markCopySelection: (ranges: CellRange[]) => void; + markCopySelection: (ranges: SlickRange[]) => void; setDataItemValueForColumn: (item: any, columnDef: Column, value: any) => any | void; undo: () => void; } \ No newline at end of file diff --git a/packages/common/src/interfaces/gridOption.interface.ts b/packages/common/src/interfaces/gridOption.interface.ts index 857665564..92110368a 100644 --- a/packages/common/src/interfaces/gridOption.interface.ts +++ b/packages/common/src/interfaces/gridOption.interface.ts @@ -12,7 +12,6 @@ import type { ContextMenu, CustomFooterOption, CustomTooltipOption, - DataViewOption, DraggableGrouping, EditCommand, EmptyWarning, @@ -39,7 +38,7 @@ import type { } from './index'; import type { ColumnReorderFunction, OperatorString, OperatorType, } from '../enums/index'; import type { TranslaterService } from '../services/translater.service'; -import type { SlickEditorLock } from '../core/index'; +import type { DataViewOption, SlickEditorLock } from '../core/index'; export interface CellViewportRange { bottom: number; @@ -219,7 +218,7 @@ export interface GridOption { datasetIdPropertyName?: string; /** Some of the SlickGrid DataView options */ - dataView?: DataViewOption & { + dataView?: Partial & { /** * Wires the grid and the DataView together to keep row selection tied to item ids. * This is useful since, without it, the grid only knows about rows, so if the items diff --git a/packages/common/src/interfaces/index.ts b/packages/common/src/interfaces/index.ts index 70f5070b9..23f63832f 100644 --- a/packages/common/src/interfaces/index.ts +++ b/packages/common/src/interfaces/index.ts @@ -30,6 +30,7 @@ export * from './compositeEditorOpenDetailOption.interface'; export * from './compositeEditorOption.interface'; export * from './contextMenu.interface'; export * from './contextMenuOption.interface'; +export * from './cssDeclaration.interface'; export * from './currentColumn.interface'; export * from './currentFilter.interface'; export * from './currentPagination.interface'; @@ -40,7 +41,6 @@ export * from './cursorPageInfo.interface'; export * from './customFooterOption.interface'; export * from './customTooltipOption.interface'; export * from './dataViewEvents.interface'; -export * from './dataViewOption.interface'; export * from './domEvent.interface'; export * from './drag.interface'; export * from './draggableGrouping.interface'; @@ -140,10 +140,7 @@ export * from './selectOption.interface'; export * from './servicePagination.interface'; export * from './singleColumnSort.interface'; export * from './slickCompositeEditor.interface'; -export * from './slickEditorLock.interface'; -export * from './slickGroup.interface'; export * from './slickPlugin.interface'; -export * from './slickRange.interface'; export * from './slickRemoteModel.interface'; export * from './slickResizer.interface'; export * from './slickRowDetailView.interface'; diff --git a/packages/common/src/interfaces/slickEditorLock.interface.ts b/packages/common/src/interfaces/slickEditorLock.interface.ts deleted file mode 100644 index af9d70db9..000000000 --- a/packages/common/src/interfaces/slickEditorLock.interface.ts +++ /dev/null @@ -1,56 +0,0 @@ -import type { Editor } from './editor.interface'; - -/** - * A locking helper to track the active edit controller and ensure that only a single controller - * can be active at a time. This prevents a whole class of state and validation synchronization - * issues. An edit controller (such as SlickGrid) can query if an active edit is in progress - * and attempt a commit or cancel before proceeding. - * @class EditorLock - * @constructor - */ -export interface SlickEditorLock { - - /** - * Returns true if a specified edit controller is active (has the edit lock). - * If the parameter is not specified, returns true if any edit controller is active. - * @method isActive - * @param editController {EditController} - * @return {Boolean} - */ - isActive(editController?: Editor): boolean; - - /** - * Sets the specified edit controller as the active edit controller (acquire edit lock). - * If another edit controller is already active, and exception will be thrown. - * @method activate - * @param editController {EditController} edit controller acquiring the lock - */ - activate(editController: Editor): void; - - /** - * Unsets the specified edit controller as the active edit controller (release edit lock). - * If the specified edit controller is not the active one, an exception will be thrown. - * @method deactivate - * @param editController {EditController} edit controller releasing the lock - */ - deactivate(editController: Editor): void; - - /** - * Attempts to commit the current edit by calling "commitCurrentEdit" method on the active edit - * controller and returns whether the commit attempt was successful (commit may fail due to validation - * errors, etc.). Edit controller's "commitCurrentEdit" must return true if the commit has succeeded - * and false otherwise. If no edit controller is active, returns true. - * @method commitCurrentEdit - * @return {Boolean} - */ - commitCurrentEdit(): boolean; - - /** - * Attempts to cancel the current edit by calling "cancelCurrentEdit" method on the active edit - * controller and returns whether the edit was successfully cancelled. If no edit controller is - * active, returns true. - * @method cancelCurrentEdit - * @return {Boolean} - */ - cancelCurrentEdit(): boolean; -} diff --git a/packages/common/src/interfaces/slickGroup.interface.ts b/packages/common/src/interfaces/slickGroup.interface.ts deleted file mode 100644 index 3f4275a91..000000000 --- a/packages/common/src/interfaces/slickGroup.interface.ts +++ /dev/null @@ -1,82 +0,0 @@ -/** A base class that all specia / non-data rows (like Group and GroupTotals) derive from. */ -export interface SlickNonDataItem { - __nonDataRow: boolean; -} - -export interface SlickGroup extends SlickNonDataItem { - /** - * Grouping level, starting with 0. - * @type {Number} - */ - level?: number; - - /*** - * Number of rows in the group. - * @type {Integer} - */ - count?: number; - - /*** - * Grouping value. - * @type {Object} - */ - value?: any; - - /*** - * Formatted display value of the group. - * @type {String} - */ - title?: string | null; - - /*** - * Whether a group is collapsed. - * @type {Boolean} - */ - collapsed?: boolean; - - /*** - * Whether a group selection checkbox is checked. - * @type {Boolean} - */ - selectChecked?: boolean; - - /*** - * GroupTotals, if any. - * @type {GroupTotals} - */ - totals?: any; - - /** - * Rows that are part of the group. - * @type {Array} - */ - rows?: number[]; - - /** - * Sub-groups that are part of the group. - * @type {Array} - */ - groups?: any[]; - - /** - * A unique key used to identify the group. This key can be used in calls to DataView - * collapseGroup() or expandGroup(). - * @type {Object} - */ - groupingKey?: string | null; -} - -export interface GroupTotals extends SlickNonDataItem { - /** - * Parent Group - * @type {Group} - */ - group: SlickGroup; - - /** - * Whether the totals have been fully initialized / calculated. - * Will be set to false for lazy-calculated group totals. - * @type {Boolean} - */ - initialized: boolean; -} \ No newline at end of file diff --git a/packages/common/src/interfaces/slickRange.interface.ts b/packages/common/src/interfaces/slickRange.interface.ts deleted file mode 100644 index 5a12fe2ce..000000000 --- a/packages/common/src/interfaces/slickRange.interface.ts +++ /dev/null @@ -1,26 +0,0 @@ -import type { CellRange } from './cellRange.interface'; - -export interface SlickRange extends CellRange { - /** - * A structure containing a range of cells. - * @class Range - * @constructor - * @param fromRow {Integer} Starting row. - * @param fromCell {Integer} Starting cell. - * @param toRow {Integer} Optional. Ending row. Defaults to fromRow. - * @param toCell {Integer} Optional. Ending cell. Defaults to fromCell. - */ - constructor: (fromRow: number, fromCell: number, toRow: number, toCell: number) => void; - - /** Returns whether a range represents a single row. */ - isSingleRow?: () => boolean; - - /** Returns whether a range represents a single cell. */ - isSingleCell?: () => boolean; - - /** Returns whether a range contains a given cell. */ - contains?: (row: number, cell: number) => boolean; - - /** Returns a readable representation of a range. */ - toString?: () => string; -} diff --git a/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts b/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts index 906be29df..6ca028d0c 100644 --- a/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts +++ b/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts @@ -6,7 +6,6 @@ import type { Column, ColumnEditor, DataViewOption, - DataViewOption as DataViewOptionCore, ExtensionList, ExternalResource, GridOption, @@ -488,7 +487,7 @@ export class SlickVanillaGridBundle { this.sharedService.groupItemMetadataProvider = this.groupItemMetadataProvider; dataViewOptions = { ...dataViewOptions, groupItemMetadataProvider: this.groupItemMetadataProvider }; } - this.dataView = new SlickDataView(dataViewOptions as Partial); + this.dataView = new SlickDataView(dataViewOptions as Partial); this._eventPubSubService.publish('onDataviewCreated', this.dataView); }