import CellTitle from '../common/table/cellTitle'; import { IConfigStartLoadParams } from '@mjcloud/redux'; import { PageAddress } from '@mjcloud/page/dist/typings'; import { IValidationRuleConfig } from '../common/typings'; import { IComplexTableResult } from '@mjcloud/data-source-helper'; import { IButtonState, IButtonConfig } from '../button/typings'; import { IViewModelCollection, IViewModelObject, IViewModelRow } from '@mjcloud/data-model'; import { IDataControlLoadedParams, IDataControlStartLoadParams } from '@mjcloud/instance/dist/dataInstanceBase'; import { XmlList, IDictionary, ControlConfig, DataStateEnum, ControlDisplayModeEnum, Size } from '@mjcloud/types'; import { ITableBaseState, TableBaseEventType, TableBaseActionType, ITableBaseConfigSet, ITableBaseConfigItem, ITableBaseConfigParent, ITableBaseInitialStateParams } from '../common/table/typings'; export interface IGridEditConfigItem extends ITableBaseConfigItem, IValidationRuleConfig { modifyControl?: string; } export declare type IGridEditConfigItemSet = IGridEditConfigParent | IGridEditConfigItem; export interface IGridEditConfigParent extends ITableBaseConfigParent { items?: IGridEditConfigItemSet[]; } export interface IGridEditConfig extends ITableBaseConfigSet { addRowDisplayMode?: ControlDisplayModeEnum; addRowButton?: IButtonConfig; items: XmlList; buttons?: XmlList; rowHeight?: number; } export interface IGridEditState extends ITableBaseState { aggModel: IViewModelObject; originalColumns: IGridEditConfigItemSet[]; autoGenerateId: boolean; addRowButton: IButtonState; activeCellId: string | null; rowHeight?: number; _dataSource: any[]; cellSize: IDictionary; } export interface IGridEditConfigStartLoadParams extends IConfigStartLoadParams { address: PageAddress; } export interface IGridEditInitialStateParams extends ITableBaseInitialStateParams { refs?: (key: string, instance: CellTitle | null) => void; address: PageAddress; dataModel?: IViewModelCollection; aggModel?: IViewModelObject; } export interface IGridEditStartLoadParams extends IDataControlStartLoadParams { address: PageAddress; } export interface IGridEditLoadedParams extends IDataControlLoadedParams { dataSource: IComplexTableResult; dataState: DataStateEnum; dataModel?: any; aggs?: any; } export declare type GridEditActionType = TableBaseActionType | 'addClickAfter' | 'addClickDone' | 'updateAddBtnLoad' | 'deleteRow' | 'activeCell' | 'batchAddRow' | 'deleteAllRow' | 'updateCellSize' | 'updateModifyMode' | 'updateDataModel'; export declare type GridEditEventType = TableBaseEventType | 'rowChange' | 'aggValueChange' | 'onAddBeforeClick' | 'onAddAfterClick'; export interface IGridEditUpdateCellSizeParams { rowId: number; size: Size; isUpdate: boolean; } export interface IGridEditAddRowParams { record: IDictionary; } export interface IGridEditDeleteRowParams { rowId: number; } export interface IActiveCellParams { cellId: string; rowId: number; }