Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGrid Types - Extract types for the visible and disable callbacks in the buttons array (T1270796) #28841

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions packages/devextreme/js/ui/data_grid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,13 @@ export type Toolbar = {
* @deprecated Use Editing instead
*/
export type dxDataGridEditing<TRowData, TKey = any> = Editing<TRowData, TKey>;

/**
* @public
*/
export type EditingOptions<TRowData, TKey> = {
component?: dxDataGrid<TRowData, TKey>;
row?: Row<TRowData, TKey>;
};
/**
* @docid dxDataGridEditing
* @public
Expand All @@ -1928,7 +1934,7 @@ export type Editing<TRowData = any, TKey = any> = EditingBase<TRowData, TKey> &
* @type_function_param1_field row:dxDataGridRowObject
* @public
*/
allowDeleting?: boolean | ((options: { component?: dxDataGrid<TRowData, TKey>; row?: Row<TRowData, TKey> }) => boolean);
allowDeleting?: boolean | ((options: EditingOptions<TRowData, TKey>) => boolean);
/**
* @docid dxDataGridOptions.editing.allowUpdating
* @default false
Expand All @@ -1937,7 +1943,7 @@ export type Editing<TRowData = any, TKey = any> = EditingBase<TRowData, TKey> &
* @type_function_param1_field row:dxDataGridRowObject
* @public
*/
allowUpdating?: boolean | ((options: { component?: dxDataGrid<TRowData, TKey>; row?: Row<TRowData, TKey> }) => boolean);
allowUpdating?: boolean | ((options: EditingOptions<TRowData, TKey>) => boolean);
/**
* @docid dxDataGridOptions.editing.texts
* @public
Expand Down Expand Up @@ -2304,6 +2310,15 @@ export interface dxDataGridColumn<TRowData = any, TKey = any> extends ColumnBase
type?: DataGridCommandColumnType;
}

/**
* @public
*/
export type ColumnButtonOptions<TRowData, TKey> = {
component?: dxDataGrid<TRowData, TKey>;
row?: Row<TRowData, TKey>;
column?: Column<TRowData, TKey>;
};

/**
* @public
*/
Expand Down Expand Up @@ -2339,22 +2354,24 @@ export interface dxDataGridColumnButton<TRowData = any, TKey = any> extends Colu
* @docid dxDataGridColumnButton.visible
* @default true
* @type boolean | function
* @type_function_param1 options: ColumnButtonOptions<TRowData, TKey>
* @type_function_param1_field component:dxDataGrid
* @type_function_param1_field row:dxDataGridRowObject
* @type_function_param1_field column:dxDataGridColumn
* @public
*/
visible?: boolean | ((options: { component?: dxDataGrid<TRowData, TKey>; row?: Row<TRowData, TKey>; column?: Column<TRowData, TKey> }) => boolean);
visible?: boolean | ((options: ColumnButtonOptions<TRowData, TKey>) => boolean);
/**
* @docid dxDataGridColumnButton.disabled
* @default false
* @type boolean | function
* @type_function_param1 options: ColumnButtonOptions<TRowData, TKey>
* @type_function_param1_field component:dxDataGrid
* @type_function_param1_field row:dxDataGridRowObject
* @type_function_param1_field column:dxDataGridColumn
* @public
*/
disabled?: boolean | ((options: { component?: dxDataGrid<TRowData, TKey>; row?: Row<TRowData, TKey>; column?: Column<TRowData, TKey> }) => boolean);
disabled?: boolean | ((options: ColumnButtonOptions<TRowData, TKey>) => boolean);
}

/**
Expand Down
34 changes: 24 additions & 10 deletions packages/devextreme/js/ui/tree_list.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,13 @@ export type dxTreeListOptions<TRowData = any, TKey = any> = Omit<GridBaseOptions
* @deprecated Use Editing instead
*/
export type dxTreeListEditing<TRowData = any, TKey = any> = Editing<TRowData, TKey>;

/**
* @public
*/
export type TreeListEditingOptions<TRowData, TKey> = {
component?: dxTreeList<TRowData, TKey>;
row?: Row<TRowData, TKey>;
};
/**
* @docid dxTreeListEditing
* @public
Expand All @@ -1164,7 +1170,7 @@ export interface Editing<TRowData = any, TKey = any> extends EditingBase<TRowDat
* @type_function_param1_field row:dxTreeListRowObject
* @public
*/
allowAdding?: boolean | ((options: { readonly component: dxTreeList<TRowData, TKey>; readonly row?: Row<TRowData, TKey> }) => boolean);
allowAdding?: boolean | ((options: TreeListEditingOptions<TRowData, TKey>) => boolean);
/**
* @docid dxTreeListOptions.editing.allowDeleting
* @default false
Expand All @@ -1173,7 +1179,7 @@ export interface Editing<TRowData = any, TKey = any> extends EditingBase<TRowDat
* @type_function_param1_field row:dxTreeListRowObject
* @public
*/
allowDeleting?: boolean | ((options: { readonly component: dxTreeList<TRowData, TKey>; readonly row?: Row<TRowData, TKey> }) => boolean);
allowDeleting?: boolean | ((options: TreeListEditingOptions<TRowData, TKey>) => boolean);
/**
* @docid dxTreeListOptions.editing.allowUpdating
* @default false
Expand All @@ -1182,7 +1188,7 @@ export interface Editing<TRowData = any, TKey = any> extends EditingBase<TRowDat
* @type_function_param1_field row:dxTreeListRowObject
* @public
*/
allowUpdating?: boolean | ((options: { readonly component: dxTreeList<TRowData, TKey>; readonly row?: Row<TRowData, TKey> }) => boolean);
allowUpdating?: boolean | ((options: TreeListEditingOptions<TRowData, TKey>) => boolean);
/**
* @docid dxTreeListOptions.editing.texts
* @type object
Expand Down Expand Up @@ -1589,7 +1595,14 @@ export interface dxTreeListColumn<TRowData = any, TKey = any> extends ColumnBase
* @public
*/
export type ColumnButton<TRowData = any, TKey = any> = dxTreeListColumnButton<TRowData, TKey>;

/**
* @public
*/
export type TreeListColumnButtonOptions<TRowData, TKey> = {
component?: dxTreeList<TRowData, TKey>;
row?: Row<TRowData, TKey>;
column?: Column<TRowData, TKey>;
};
/**
* @namespace DevExpress.ui
* @deprecated Use the TreeList's ColumnButton type instead
Expand Down Expand Up @@ -1625,12 +1638,13 @@ export interface dxTreeListColumnButton<TRowData = any, TKey = any> extends Colu
* @docid dxTreeListColumnButton.visible
* @default true
* @type boolean | function
* @type_function_param1_field component:dxTreeList
* @type_function_param1_field row:dxTreeListRowObject
* @type_function_param1_field column:dxTreeListColumn
* @type_function_param1 options: TreeListColumnButtonOptions<TRowData, TKey>
* @type_function_param1_field component: dxTreeList
* @type_function_param1_field row: dxTreeListRowObject
* @type_function_param1_field column: dxTreeListColumn
* @public
*/
visible?: boolean | ((options: { readonly component: dxTreeList<TRowData, TKey>; readonly row?: Row<TRowData, TKey>; readonly column: Column<TRowData, TKey> }) => boolean);
visible?: boolean | ((options: TreeListColumnButtonOptions<TRowData, TKey>) => boolean);
/**
* @docid dxTreeListColumnButton.disabled
* @default false
Expand All @@ -1640,7 +1654,7 @@ export interface dxTreeListColumnButton<TRowData = any, TKey = any> extends Colu
* @type_function_param1_field column:dxTreeListColumn
* @public
*/
disabled?: boolean | ((options: { readonly component: dxTreeList<TRowData, TKey>; readonly row?: Row<TRowData, TKey>; readonly column: Column<TRowData, TKey> }) => boolean);
disabled?: boolean | ((options: TreeListColumnButtonOptions<TRowData, TKey>) => boolean);
}

/**
Expand Down
Loading