import CellTitle from '../common/table/cellTitle'; import { IConfigStartLoadParams } from '@mjcloud/redux'; import { PageAddress } from '@mjcloud/page/dist/typings'; import { IValidationRuleConfig } from '../common/typings'; import { ITreeDataSourceItem } from '@mjcloud/data-source-helper'; import { IComplexTableResult } from '@mjcloud/data-source-helper'; import { IButtonState, IButtonConfig } from '../button/typings'; import { Key, DataEntity } from '../../components/VirtualizedTable/interface'; import { TableRowSelection } from '../../components/VirtualizedTable/interface'; import { IViewModelCollection, IViewModelRow } from '@mjcloud/data-model'; import { IDataControlLoadedParams, IDataControlStartLoadParams } from '@mjcloud/instance/dist/dataInstanceBase'; import { XmlList, IDictionary, ControlConfig, DataStateEnum, IArrayDictionary, ControlDisplayModeEnum, Size } from '@mjcloud/types'; import { ITableBaseState, TableBaseEventType, TableBaseActionType, ITableBaseConfigSet, ITableBaseConfigItem, ITableBaseConfigParent, ITableBaseInitialStateParams } from '../common/table/typings'; export interface ITreeEditConfigItem extends ITableBaseConfigItem, IValidationRuleConfig { modifyControl?: string; } export declare type ITreeEditConfigItemSet = ITreeEditConfigParent | ITreeEditConfigItem; export interface ITreeEditConfigParent extends ITableBaseConfigParent { items?: ITreeEditConfigItemSet[]; } export interface ITreeEditConfig extends ITableBaseConfigSet { selectionStrictly?: boolean; addRowDisplayMode?: ControlDisplayModeEnum; addRowButton?: IButtonConfig; items: XmlList; buttons?: XmlList; } export interface ITreeEditState extends ITableBaseState { originalColumns: ITreeEditConfigItemSet[]; addRowButton: IButtonState; activeCellId: string | null; cellSize: IDictionary; autoGenerateId: boolean; disabledControl?: string; _dataSource: IViewModelRow[]; sourceDataSource: ITreeDataSourceItem[]; expandLevel: number; defaultExpandLevel: number; originalDataSource: IViewModelRow[]; expandedRowKeys: string[] | number[]; expandLevel2Keys: IArrayDictionary; keyEntities: Record; selectedRows: IViewModelRow[] | undefined; halfSelectedRows: IViewModelRow[] | undefined; rowSelection: TableRowSelection | undefined; } export interface ITreeEditConfigStartLoadParams extends IConfigStartLoadParams { address: PageAddress; } export interface ITreeEditInitialStateParams extends ITableBaseInitialStateParams { refs?: (key: string, instance: CellTitle | null) => void; address: PageAddress; dataModel?: IViewModelCollection; } export interface ITreeEditStartLoadParams extends IDataControlStartLoadParams { } export interface ITreeEditLoadedParams extends IDataControlLoadedParams { dataSource: IComplexTableResult; dataState: DataStateEnum; dataModel?: any; disabledFn?: (row: IDictionary) => boolean; } export declare type TreeEditActionType = TableBaseActionType | 'addClickAfter' | 'addClickDone' | 'updateAddBtnLoad' | 'deleteRow' | 'activeCell' | 'batchAddRow' | 'deleteAllRow' | 'updateCellSize' | 'updateModifyMode' | 'updateSelectedRows' | 'updateExpandedRowKeys'; export interface ITreeEditUpdateSelectedRowsParams { row?: IViewModelRow; checked?: boolean; selectedRowKeys: Key[]; halfSelectedKeys: Key[]; actionSourceSign?: any; } export interface ITreeEditUpdateExpandedRowKeysParams { expandLevel: number; expandedRowKeys: string[] | number[]; } export declare type TreeEditEventType = TableBaseEventType | 'rowChange' | 'aggValueChange' | 'selectedChange' | 'onAddBeforeClick' | 'onAddAfterClick'; export interface ITreeEditUpdateCellSizeParams { rowId: number; size: Size; isUpdate: boolean; } export interface ITreeEditAddRowParams { record: IDictionary; } export interface ITreeEditDeleteRowParams { rowId: number; } export interface IActiveCellParams { cellId: string; rowId: number; }