Skip to content

Commit eb2351c

Browse files
TreeList - Column button does not accept ColumnButtonClickEvent as the onClick event type (T1319919) (DevExpress#32404)
1 parent c306663 commit eb2351c

File tree

7 files changed

+41
-23
lines changed

7 files changed

+41
-23
lines changed

packages/devextreme-angular/src/ui/tree-list/nested/button-dxi.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import { DOCUMENT } from '@angular/common';
1717

1818

1919
import dxTreeList from 'devextreme/ui/tree_list';
20-
import { dxTreeListColumn, dxTreeListRowObject, TreeListPredefinedColumnButton } from 'devextreme/ui/tree_list';
21-
import { event } from 'devextreme/events/events.types';
20+
import { dxTreeListColumn, dxTreeListRowObject, TreeListPredefinedColumnButton, ColumnButtonClickEvent } from 'devextreme/ui/tree_list';
2221
import { TextEditorButtonLocation } from 'devextreme/common';
2322
import { dxButtonOptions } from 'devextreme/ui/button';
2423

@@ -92,10 +91,10 @@ export class DxiTreeListButtonComponent extends CollectionNestedOption implement
9291
}
9392

9493
@Input()
95-
get onClick(): ((e: { column: dxTreeListColumn, component: dxTreeList, element: any, event: event, model: any, row: dxTreeListRowObject }) => void) {
94+
get onClick(): ((e: ColumnButtonClickEvent) => void) {
9695
return this._getOption('onClick');
9796
}
98-
set onClick(value: ((e: { column: dxTreeListColumn, component: dxTreeList, element: any, event: event, model: any, row: dxTreeListRowObject }) => void)) {
97+
set onClick(value: ((e: ColumnButtonClickEvent) => void)) {
9998
this._setOption('onClick', value);
10099
}
101100

packages/devextreme-angular/src/ui/tree-list/nested/column-button-dxi.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import { DOCUMENT } from '@angular/common';
1717

1818

1919
import dxTreeList from 'devextreme/ui/tree_list';
20-
import { dxTreeListColumn, dxTreeListRowObject, TreeListPredefinedColumnButton } from 'devextreme/ui/tree_list';
21-
import { event } from 'devextreme/events/events.types';
20+
import { dxTreeListColumn, dxTreeListRowObject, TreeListPredefinedColumnButton, ColumnButtonClickEvent } from 'devextreme/ui/tree_list';
2221

2322
import {
2423
DxIntegrationModule,
@@ -90,10 +89,10 @@ export class DxiTreeListColumnButtonComponent extends CollectionNestedOption imp
9089
}
9190

9291
@Input()
93-
get onClick(): ((e: { column: dxTreeListColumn, component: dxTreeList, element: any, event: event, model: any, row: dxTreeListRowObject }) => void) {
92+
get onClick(): ((e: ColumnButtonClickEvent) => void) {
9493
return this._getOption('onClick');
9594
}
96-
set onClick(value: ((e: { column: dxTreeListColumn, component: dxTreeList, element: any, event: event, model: any, row: dxTreeListRowObject }) => void)) {
95+
set onClick(value: ((e: ColumnButtonClickEvent) => void)) {
9796
this._setOption('onClick', value);
9897
}
9998

packages/devextreme-metadata/make-angular-metadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Ng.makeMetadata({
6363
removeMembers(/\/scheduler:dxSchedulerOptions\.resources\.icon/),
6464
removeMembers(/\/stepper:/),
6565
removeMembers(/\/speech_to_text:/),
66+
removeMembers(/\/tree_list:dxTreeListColumnButton.onClick/),
6667
],
6768
variables: {
6869
CollectionItems: [...commonSmdCollectionItems],

packages/devextreme-react/src/tree-list.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import dxTreeList, {
99
import { Component as BaseComponent, IHtmlOptions, ComponentRef, NestedComponentMeta } from "./core/component";
1010
import NestedOption from "./core/nested-option";
1111

12-
import type { dxTreeListColumn, AdaptiveDetailRowPreparingEvent, AIColumnRequestCreatingEvent, CellClickEvent, CellDblClickEvent, CellPreparedEvent, ContentReadyEvent, ContextMenuPreparingEvent, DataErrorOccurredEvent, DisposingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, EditorPreparedEvent, EditorPreparingEvent, FocusedCellChangingEvent, FocusedRowChangingEvent, InitializedEvent, InitNewRowEvent, KeyDownEvent, NodesInitializedEvent, RowClickEvent, RowCollapsedEvent, RowCollapsingEvent, RowDblClickEvent, RowExpandedEvent, RowExpandingEvent, RowInsertedEvent, RowInsertingEvent, RowPreparedEvent, RowRemovedEvent, RowRemovingEvent, RowUpdatedEvent, RowUpdatingEvent, RowValidatingEvent, SavedEvent, SavingEvent, ToolbarPreparingEvent, dxTreeListRowObject, TreeListPredefinedColumnButton, dxTreeListColumnButton, TreeListCommandColumnType, TreeListPredefinedToolbarItem, dxTreeListToolbarItem } from "devextreme/ui/tree_list";
12+
import type { dxTreeListColumn, AdaptiveDetailRowPreparingEvent, AIColumnRequestCreatingEvent, CellClickEvent, CellDblClickEvent, CellPreparedEvent, ContentReadyEvent, ContextMenuPreparingEvent, DataErrorOccurredEvent, DisposingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, EditorPreparedEvent, EditorPreparingEvent, FocusedCellChangingEvent, FocusedRowChangingEvent, InitializedEvent, InitNewRowEvent, KeyDownEvent, NodesInitializedEvent, RowClickEvent, RowCollapsedEvent, RowCollapsingEvent, RowDblClickEvent, RowExpandedEvent, RowExpandingEvent, RowInsertedEvent, RowInsertingEvent, RowPreparedEvent, RowRemovedEvent, RowRemovingEvent, RowUpdatedEvent, RowUpdatingEvent, RowValidatingEvent, SavedEvent, SavingEvent, ToolbarPreparingEvent, dxTreeListRowObject, TreeListPredefinedColumnButton, ColumnButtonClickEvent, dxTreeListColumnButton, TreeListCommandColumnType, TreeListPredefinedToolbarItem, dxTreeListToolbarItem } from "devextreme/ui/tree_list";
1313
import type { DataChange, AIColumnMode, DataChangeType, ColumnAIOptions, FilterOperation, FilterType, FixedPosition, ColumnHeaderFilter as GridsColumnHeaderFilter, SelectedFilterOperation, ColumnChooserMode, ColumnChooserSearchConfig, ColumnChooserSelectionConfig, HeaderFilterGroupInterval, ColumnHeaderFilterSearchConfig, GridsEditMode, GridsEditRefreshMode, StartEditAction, FilterPanel as GridsFilterPanel, FilterPanelTexts as GridsFilterPanelTexts, ApplyFilterMode, HeaderFilterSearchConfig, HeaderFilterTexts, EnterKeyAction, EnterKeyDirection, PagerPageSize, GridBase, DataRenderMode, StateStoreType } from "devextreme/common/grids";
1414
import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, ClickEvent, OptionChangedEvent } from "devextreme/ui/button";
1515
import type { ContentReadyEvent as TextBoxContentReadyEvent, DisposingEvent as TextBoxDisposingEvent, InitializedEvent as TextBoxInitializedEvent, KeyDownEvent as TextBoxKeyDownEvent, dxTextBoxOptions, OptionChangedEvent as TextBoxOptionChangedEvent, TextBoxType, ChangeEvent, CopyEvent, CutEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InputEvent, KeyUpEvent, PasteEvent, ValueChangedEvent } from "devextreme/ui/text_box";
@@ -19,11 +19,11 @@ import type { ContentReadyEvent as TabPanelContentReadyEvent, DisposingEvent as
1919
import type { AIIntegration } from "devextreme/common/ai-integration";
2020
import type { AnimationConfig, CollisionResolution, PositionConfig, AnimationState, AnimationType, CollisionResolutionCombination } from "devextreme/common/core/animation";
2121
import type { ValidationRuleType, HorizontalAlignment, VerticalAlignment, template, TextEditorButtonLocation, ButtonStyle, ButtonType, DataType, Format as CommonFormat, SortOrder, SearchMode, ComparisonOperator, TextBoxPredefinedButton, TextEditorButton, LabelMode, MaskMode, EditorStyle, ValidationMessageMode, Position as CommonPosition, ValidationStatus, PositionAlignment, Mode, Direction, ToolbarItemLocation, ToolbarItemComponent, DisplayMode, DragDirection, DragHighlight, ScrollMode, ScrollbarMode, SingleMultipleOrNone, TabsIconPosition, TabsStyle } from "devextreme/common";
22-
import type { event } from "devextreme/events/events.types";
2322
import type { Format as LocalizationFormat } from "devextreme/common/core/localization";
2423
import type { DataSourceOptions } from "devextreme/data/data_source";
2524
import type { Store } from "devextreme/data/store";
2625
import type { dxPopupOptions, dxPopupToolbarItem, ToolbarLocation } from "devextreme/ui/popup";
26+
import type { event } from "devextreme/events/events.types";
2727
import type { EventInfo } from "devextreme/common/core/events";
2828
import type { Component } from "devextreme/core/component";
2929
import type { LoadingAnimationType } from "devextreme/ui/load_indicator";
@@ -328,7 +328,7 @@ type IButtonProps = React.PropsWithChildren<{
328328
hint?: string;
329329
icon?: string;
330330
name?: string | TreeListPredefinedColumnButton | undefined;
331-
onClick?: ((e: { column: dxTreeListColumn, component: dxTreeList, element: any, event: event, model: any, row: dxTreeListRowObject }) => void);
331+
onClick?: ((e: ColumnButtonClickEvent) => void);
332332
template?: ((cellElement: any, cellInfo: { column: dxTreeListColumn, columnIndex: number, component: dxTreeList, data: Record<string, any>, key: any, row: dxTreeListRowObject, rowIndex: number, rowType: string }) => string | any) | template;
333333
text?: string;
334334
visible?: boolean | ((options: { column: dxTreeListColumn, component: dxTreeList, row: dxTreeListRowObject }) => boolean);
@@ -657,7 +657,7 @@ type IColumnButtonProps = React.PropsWithChildren<{
657657
hint?: string;
658658
icon?: string;
659659
name?: string | TreeListPredefinedColumnButton;
660-
onClick?: ((e: { column: dxTreeListColumn, component: dxTreeList, element: any, event: event, model: any, row: dxTreeListRowObject }) => void);
660+
onClick?: ((e: ColumnButtonClickEvent) => void);
661661
template?: ((cellElement: any, cellInfo: { column: dxTreeListColumn, columnIndex: number, component: dxTreeList, data: Record<string, any>, key: any, row: dxTreeListRowObject, rowIndex: number, rowType: string }) => string | any) | template;
662662
text?: string;
663663
visible?: boolean | ((options: { column: dxTreeListColumn, component: dxTreeList, row: dxTreeListRowObject }) => boolean);

packages/devextreme-vue/src/tree-list.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ import {
9797
dxTreeListToolbar,
9898
dxTreeListRowObject,
9999
TreeListPredefinedColumnButton,
100+
ColumnButtonClickEvent,
100101
dxTreeListColumnButton,
101102
TreeListCommandColumnType,
102103
TreeListPredefinedToolbarItem,
@@ -193,9 +194,6 @@ import {
193194
AnimationType,
194195
CollisionResolutionCombination,
195196
} from "devextreme/common/core/animation";
196-
import {
197-
event,
198-
} from "devextreme/events/events.types";
199197
import {
200198
dxButtonOptions,
201199
ClickEvent,
@@ -228,6 +226,9 @@ import {
228226
import {
229227
Format,
230228
} from "devextreme/common/core/localization";
229+
import {
230+
event,
231+
} from "devextreme/events/events.types";
231232
import {
232233
EventInfo,
233234
} from "devextreme/common/core/events";
@@ -839,7 +840,7 @@ const DxButtonConfig = {
839840
icon: String,
840841
location: String as PropType<TextEditorButtonLocation>,
841842
name: String as PropType<string | TreeListPredefinedColumnButton>,
842-
onClick: Function as PropType<((e: { column: dxTreeListColumn, component: dxTreeList, element: any, event: event, model: any, row: dxTreeListRowObject }) => void)>,
843+
onClick: Function as PropType<((e: ColumnButtonClickEvent) => void)>,
843844
options: Object as PropType<dxButtonOptions | Record<string, any>>,
844845
template: {},
845846
text: String,
@@ -1197,7 +1198,7 @@ const DxColumnButtonConfig = {
11971198
hint: String,
11981199
icon: String,
11991200
name: String as PropType<string | TreeListPredefinedColumnButton>,
1200-
onClick: Function as PropType<((e: { column: dxTreeListColumn, component: dxTreeList, element: any, event: event, model: any, row: dxTreeListRowObject }) => void)>,
1201+
onClick: Function as PropType<((e: ColumnButtonClickEvent) => void)>,
12011202
template: {},
12021203
text: String,
12031204
visible: [Boolean, Function] as PropType<boolean | (((options: { column: dxTreeListColumn, component: dxTreeList, row: dxTreeListRowObject }) => boolean))>

packages/devextreme/js/ui/tree_list.d.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -826,9 +826,22 @@ export type RowDraggingRemoveEvent<TRowData = any, TKey = any> = ReducedNativeEv
826826
/** @public */
827827
export type RowDraggingReorderEvent<TRowData = any, TKey = any> = ReducedNativeEventInfo<dxTreeList<TRowData, TKey>> & RowDraggingEventInfo<TRowData> & DragReorderInfo;
828828

829-
/** @public */
829+
/**
830+
* @docid _ui_tree_list_ColumnButtonClickEvent
831+
* @public
832+
* @type object
833+
* @inherits NativeEventInfo
834+
*/
830835
export type ColumnButtonClickEvent<TRowData = any, TKey = any> = NativeEventInfo<dxTreeList<TRowData, TKey>, PointerEvent | MouseEvent> & {
836+
/**
837+
* @docid _ui_tree_list_ColumnButtonClickEvent.row
838+
* @type dxTreeListRowObject
839+
*/
831840
row?: Row<TRowData, TKey>;
841+
/**
842+
* @docid _ui_tree_list_ColumnButtonClickEvent.column
843+
* @type dxTreeListColumn
844+
*/
832845
column?: Column<TRowData, TKey>;
833846
};
834847

@@ -1628,11 +1641,7 @@ export interface dxTreeListColumnButton<TRowData = any, TKey = any> extends Colu
16281641
name?: TreeListPredefinedColumnButton | string;
16291642
/**
16301643
* @docid dxTreeListColumnButton.onClick
1631-
* @type_function_param1 e:object
1632-
* @type_function_param1_field component:dxTreeList
1633-
* @type_function_param1_field event:event
1634-
* @type_function_param1_field row:dxTreeListRowObject
1635-
* @type_function_param1_field column:dxTreeListColumn
1644+
* @type_function_param1 e:{ui/tree_list:ColumnButtonClickEvent}
16361645
* @public
16371646
*/
16381647
onClick?: ((e: ColumnButtonClickEvent<TRowData, TKey>) => void);

packages/devextreme/ts/dx.all.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30724,14 +30724,23 @@ declare module DevExpress.ui {
3072430724
TRowData = any,
3072530725
TKey = any
3072630726
> = dxTreeListColumnButton<TRowData, TKey>;
30727+
/**
30728+
* [descr:_ui_tree_list_ColumnButtonClickEvent]
30729+
*/
3072730730
export type ColumnButtonClickEvent<
3072830731
TRowData = any,
3072930732
TKey = any
3073030733
> = DevExpress.common.core.events.NativeEventInfo<
3073130734
dxTreeList<TRowData, TKey>,
3073230735
PointerEvent | MouseEvent
3073330736
> & {
30737+
/**
30738+
* [descr:_ui_tree_list_ColumnButtonClickEvent.row]
30739+
*/
3073430740
row?: Row<TRowData, TKey>;
30741+
/**
30742+
* [descr:_ui_tree_list_ColumnButtonClickEvent.column]
30743+
*/
3073530744
column?: Column<TRowData, TKey>;
3073630745
};
3073730746
export type ColumnButtonTemplateData<TRowData = any, TKey = any> = {

0 commit comments

Comments
 (0)