From d297d0109bea3f58a5442f10c0bf9033e5532673 Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Tue, 27 Aug 2024 00:31:22 +0400 Subject: [PATCH 1/6] Collection: publish onSelectionChanging method for Tabs, TabPanel, List, SelectBox, AutoComplete, TagBox, SelectBox --- .../src/ui/autocomplete/index.ts | 11 +- .../devextreme-angular/src/ui/list/index.ts | 11 +- .../devextreme-angular/src/ui/lookup/index.ts | 11 +- .../src/ui/nested/base/tab-panel-options.ts | 9 +- .../src/ui/nested/tab-panel-options.ts | 1 + .../src/ui/select-box/index.ts | 11 +- .../src/ui/tab-panel/index.ts | 11 +- .../devextreme-angular/src/ui/tabs/index.ts | 11 +- .../src/ui/tag-box/index.ts | 11 +- packages/devextreme-react/src/autocomplete.ts | 5 +- packages/devextreme-react/src/form.ts | 3 +- packages/devextreme-react/src/list.ts | 5 +- packages/devextreme-react/src/lookup.ts | 5 +- packages/devextreme-react/src/select-box.ts | 5 +- packages/devextreme-react/src/tab-panel.ts | 5 +- packages/devextreme-react/src/tabs.ts | 5 +- packages/devextreme-react/src/tag-box.ts | 5 +- packages/devextreme-vue/src/autocomplete.ts | 3 + packages/devextreme-vue/src/form.ts | 2 + packages/devextreme-vue/src/list.ts | 3 + packages/devextreme-vue/src/lookup.ts | 3 + packages/devextreme-vue/src/select-box.ts | 3 + packages/devextreme-vue/src/tab-panel.ts | 3 + packages/devextreme-vue/src/tabs.ts | 3 + packages/devextreme-vue/src/tag-box.ts | 3 + packages/devextreme/js/ui/accordion.d.ts | 2 +- packages/devextreme/js/ui/accordion.js | 6 + packages/devextreme/js/ui/action_sheet.d.ts | 2 +- packages/devextreme/js/ui/action_sheet.js | 6 + packages/devextreme/js/ui/autocomplete.d.ts | 20 +++ .../devextreme/js/ui/autocomplete_types.d.ts | 1 + packages/devextreme/js/ui/box.d.ts | 2 +- packages/devextreme/js/ui/box.js | 5 + .../collection/ui.collection_widget.base.d.ts | 28 ++++ packages/devextreme/js/ui/context_menu.d.ts | 2 +- packages/devextreme/js/ui/context_menu.js | 5 + .../drop_down_editor/ui.drop_down_list.d.ts | 31 ++++ packages/devextreme/js/ui/gallery.d.ts | 2 +- packages/devextreme/js/ui/gallery.js | 7 + packages/devextreme/js/ui/list.d.ts | 21 +++ packages/devextreme/js/ui/list_types.d.ts | 1 + packages/devextreme/js/ui/lookup.d.ts | 20 +++ packages/devextreme/js/ui/lookup_types.d.ts | 1 + packages/devextreme/js/ui/menu.d.ts | 2 +- packages/devextreme/js/ui/menu.js | 2 +- packages/devextreme/js/ui/multi_view.d.ts | 2 +- packages/devextreme/js/ui/multi_view.js | 6 + packages/devextreme/js/ui/responsive_box.d.ts | 2 +- packages/devextreme/js/ui/responsive_box.js | 6 + packages/devextreme/js/ui/select_box.d.ts | 20 +++ .../devextreme/js/ui/select_box_types.d.ts | 1 + packages/devextreme/js/ui/splitter.d.ts | 2 +- packages/devextreme/js/ui/splitter.js | 6 + packages/devextreme/js/ui/tab_panel.d.ts | 21 +++ .../devextreme/js/ui/tab_panel_types.d.ts | 1 + packages/devextreme/js/ui/tabs.d.ts | 21 +++ packages/devextreme/js/ui/tabs_types.d.ts | 1 + packages/devextreme/js/ui/tag_box.d.ts | 27 +++- packages/devextreme/js/ui/tag_box_types.d.ts | 1 + packages/devextreme/js/ui/tile_view.d.ts | 2 +- packages/devextreme/js/ui/tile_view.js | 6 + packages/devextreme/js/ui/toolbar.d.ts | 2 +- packages/devextreme/js/ui/toolbar.js | 7 + packages/devextreme/js/ui/tree_view.d.ts | 2 +- packages/devextreme/js/ui/tree_view.js | 6 + .../devextreme/js/ui/validation_summary.d.ts | 2 +- .../devextreme/js/ui/validation_summary.js | 6 + packages/devextreme/ts/dx.all.d.ts | 149 +++++++++++++++++- 68 files changed, 573 insertions(+), 40 deletions(-) diff --git a/packages/devextreme-angular/src/ui/autocomplete/index.ts b/packages/devextreme-angular/src/ui/autocomplete/index.ts index bb22a38ccd46..311354cee369 100644 --- a/packages/devextreme-angular/src/ui/autocomplete/index.ts +++ b/packages/devextreme-angular/src/ui/autocomplete/index.ts @@ -27,7 +27,7 @@ import { import { EditorStyle, LabelMode, Mode, Position, SimplifiedSearchMode, TextEditorButton, ValidationMessageMode, ValidationStatus } from 'devextreme/common'; import { Store } from 'devextreme/data'; import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source'; -import { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, OptionChangedEvent, PasteEvent, SelectionChangedEvent, ValueChangedEvent } from 'devextreme/ui/autocomplete'; +import { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, OptionChangedEvent, PasteEvent, SelectionChangedEvent, SelectionChangingEvent, ValueChangedEvent } from 'devextreme/ui/autocomplete'; import { CollectionWidgetItem } from 'devextreme/ui/collection/ui.collection_widget.base'; import { DropDownPredefinedButton } from 'devextreme/ui/drop_down_editor/ui.drop_down_editor'; import { Properties as dxPopupOptions } from 'devextreme/ui/popup'; @@ -940,6 +940,14 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C */ @Output() onSelectionChanged: EventEmitter; + /** + + * [descr:dxAutocompleteOptions.onSelectionChanging] + + + */ + @Output() onSelectionChanging: EventEmitter; + /** * [descr:dxAutocompleteOptions.onValueChanged] @@ -1386,6 +1394,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'paste', emit: 'onPaste' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, + { subscribe: 'selectionChanging', emit: 'onSelectionChanging' }, { subscribe: 'valueChanged', emit: 'onValueChanged' }, { emit: 'accessKeyChange' }, { emit: 'activeStateEnabledChange' }, diff --git a/packages/devextreme-angular/src/ui/list/index.ts b/packages/devextreme-angular/src/ui/list/index.ts index cb53039211c1..c73b775077ce 100644 --- a/packages/devextreme-angular/src/ui/list/index.ts +++ b/packages/devextreme-angular/src/ui/list/index.ts @@ -26,7 +26,7 @@ export { ExplicitTypes } from 'devextreme/ui/list'; import { PageLoadMode, ScrollbarMode, SearchMode, SelectAllMode, SingleMultipleAllOrNone } from 'devextreme/common'; import { Store } from 'devextreme/data'; import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source'; -import { ContentReadyEvent, DisposingEvent, dxListItem, GroupRenderedEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemDeletedEvent, ItemDeleteMode, ItemDeletingEvent, ItemHoldEvent, ItemRenderedEvent, ItemReorderedEvent, ItemSwipeEvent, ListMenuMode, OptionChangedEvent, PageLoadingEvent, PullRefreshEvent, ScrollEvent, SelectAllValueChangedEvent, SelectionChangedEvent } from 'devextreme/ui/list'; +import { ContentReadyEvent, DisposingEvent, dxListItem, GroupRenderedEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemDeletedEvent, ItemDeleteMode, ItemDeletingEvent, ItemHoldEvent, ItemRenderedEvent, ItemReorderedEvent, ItemSwipeEvent, ListMenuMode, OptionChangedEvent, PageLoadingEvent, PullRefreshEvent, ScrollEvent, SelectAllValueChangedEvent, SelectionChangedEvent, SelectionChangingEvent } from 'devextreme/ui/list'; import { Properties as dxSortableOptions } from 'devextreme/ui/sortable'; import { Properties as dxTextBoxOptions } from 'devextreme/ui/text_box'; @@ -931,6 +931,14 @@ export class DxListComponent extends DxComponent implem */ @Output() onSelectionChanged: EventEmitter; + /** + + * [descr:dxListOptions.onSelectionChanging] + + + */ + @Output() onSelectionChanging: EventEmitter; + /** * This member supports the internal infrastructure and is not intended to be used directly from your code. @@ -1366,6 +1374,7 @@ export class DxListComponent extends DxComponent implem { subscribe: 'scroll', emit: 'onScroll' }, { subscribe: 'selectAllValueChanged', emit: 'onSelectAllValueChanged' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, + { subscribe: 'selectionChanging', emit: 'onSelectionChanging' }, { emit: 'accessKeyChange' }, { emit: 'activeStateEnabledChange' }, { emit: 'allowItemDeletingChange' }, diff --git a/packages/devextreme-angular/src/ui/lookup/index.ts b/packages/devextreme-angular/src/ui/lookup/index.ts index 9d205908d5df..3966b99f5250 100644 --- a/packages/devextreme-angular/src/ui/lookup/index.ts +++ b/packages/devextreme-angular/src/ui/lookup/index.ts @@ -28,7 +28,7 @@ import { ApplyValueMode, EditorStyle, LabelMode, Mode, PageLoadMode, Position, S import { Store } from 'devextreme/data'; import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source'; import { CollectionWidgetItem } from 'devextreme/ui/collection/ui.collection_widget.base'; -import { ClosedEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, OpenedEvent, OptionChangedEvent, PageLoadingEvent, PullRefreshEvent, ScrollEvent, SelectionChangedEvent, ValueChangedEvent } from 'devextreme/ui/lookup'; +import { ClosedEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, OpenedEvent, OptionChangedEvent, PageLoadingEvent, PullRefreshEvent, ScrollEvent, SelectionChangedEvent, SelectionChangingEvent, ValueChangedEvent } from 'devextreme/ui/lookup'; import { Properties as dxPopoverOptions } from 'devextreme/ui/popover'; import DxLookup from 'devextreme/ui/lookup'; @@ -1094,6 +1094,14 @@ export class DxLookupComponent extends DxComponent implements OnDestroy, Control */ @Output() onSelectionChanged: EventEmitter; + /** + + * [descr:dxLookupOptions.onSelectionChanging] + + + */ + @Output() onSelectionChanging: EventEmitter; + /** * [descr:dxLookupOptions.onValueChanged] @@ -1637,6 +1645,7 @@ export class DxLookupComponent extends DxComponent implements OnDestroy, Control { subscribe: 'pullRefresh', emit: 'onPullRefresh' }, { subscribe: 'scroll', emit: 'onScroll' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, + { subscribe: 'selectionChanging', emit: 'onSelectionChanging' }, { subscribe: 'valueChanged', emit: 'onValueChanged' }, { emit: 'accessKeyChange' }, { emit: 'activeStateEnabledChange' }, diff --git a/packages/devextreme-angular/src/ui/nested/base/tab-panel-options.ts b/packages/devextreme-angular/src/ui/nested/base/tab-panel-options.ts index 40950dcb0809..b941b65a2472 100644 --- a/packages/devextreme-angular/src/ui/nested/base/tab-panel-options.ts +++ b/packages/devextreme-angular/src/ui/nested/base/tab-panel-options.ts @@ -8,7 +8,7 @@ import { import { Position, TabsIconPosition, TabsStyle } from 'devextreme/common'; import { Store } from 'devextreme/data'; import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source'; -import { ContentReadyEvent, DisposingEvent, dxTabPanelItem, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent, SelectionChangedEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from 'devextreme/ui/tab_panel'; +import { ContentReadyEvent, DisposingEvent, dxTabPanelItem, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent, SelectionChangedEvent, SelectionChangingEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from 'devextreme/ui/tab_panel'; @Component({ template: '' @@ -203,6 +203,13 @@ export abstract class DxoTabPanelOptions extends NestedOption { this._setOption('onSelectionChanged', value); } + get onSelectionChanging(): ((e: SelectionChangingEvent) => void) { + return this._getOption('onSelectionChanging'); + } + set onSelectionChanging(value: ((e: SelectionChangingEvent) => void)) { + this._setOption('onSelectionChanging', value); + } + get onTitleClick(): ((e: TitleClickEvent) => void) { return this._getOption('onTitleClick'); } diff --git a/packages/devextreme-angular/src/ui/nested/tab-panel-options.ts b/packages/devextreme-angular/src/ui/nested/tab-panel-options.ts index ad901b19326e..6a8120be1511 100644 --- a/packages/devextreme-angular/src/ui/nested/tab-panel-options.ts +++ b/packages/devextreme-angular/src/ui/nested/tab-panel-options.ts @@ -60,6 +60,7 @@ import { DxiItemComponent } from './item-dxi'; 'onItemRendered', 'onOptionChanged', 'onSelectionChanged', + 'onSelectionChanging', 'onTitleClick', 'onTitleHold', 'onTitleRendered', diff --git a/packages/devextreme-angular/src/ui/select-box/index.ts b/packages/devextreme-angular/src/ui/select-box/index.ts index 4ea8370fbf29..845949ccea9c 100644 --- a/packages/devextreme-angular/src/ui/select-box/index.ts +++ b/packages/devextreme-angular/src/ui/select-box/index.ts @@ -30,7 +30,7 @@ import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_s import { CollectionWidgetItem } from 'devextreme/ui/collection/ui.collection_widget.base'; import { DropDownPredefinedButton } from 'devextreme/ui/drop_down_editor/ui.drop_down_editor'; import { Properties as dxPopupOptions } from 'devextreme/ui/popup'; -import { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CustomItemCreatingEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, OptionChangedEvent, PasteEvent, SelectionChangedEvent, ValueChangedEvent } from 'devextreme/ui/select_box'; +import { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CustomItemCreatingEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, OptionChangedEvent, PasteEvent, SelectionChangedEvent, SelectionChangingEvent, ValueChangedEvent } from 'devextreme/ui/select_box'; import DxSelectBox from 'devextreme/ui/select_box'; @@ -1041,6 +1041,14 @@ export class DxSelectBoxComponent extends DxComponent implements OnDestroy, Cont */ @Output() onSelectionChanged: EventEmitter; + /** + + * [descr:dxSelectBoxOptions.onSelectionChanging] + + + */ + @Output() onSelectionChanging: EventEmitter; + /** * [descr:dxSelectBoxOptions.onValueChanged] @@ -1537,6 +1545,7 @@ export class DxSelectBoxComponent extends DxComponent implements OnDestroy, Cont { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'paste', emit: 'onPaste' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, + { subscribe: 'selectionChanging', emit: 'onSelectionChanging' }, { subscribe: 'valueChanged', emit: 'onValueChanged' }, { emit: 'acceptCustomValueChange' }, { emit: 'accessKeyChange' }, diff --git a/packages/devextreme-angular/src/ui/tab-panel/index.ts b/packages/devextreme-angular/src/ui/tab-panel/index.ts index c1908d072cc2..d76e3bc850a4 100644 --- a/packages/devextreme-angular/src/ui/tab-panel/index.ts +++ b/packages/devextreme-angular/src/ui/tab-panel/index.ts @@ -26,7 +26,7 @@ export { ExplicitTypes } from 'devextreme/ui/tab_panel'; import { Position, TabsIconPosition, TabsStyle } from 'devextreme/common'; import { Store } from 'devextreme/data'; import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source'; -import { ContentReadyEvent, DisposingEvent, dxTabPanelItem, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent, SelectionChangedEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from 'devextreme/ui/tab_panel'; +import { ContentReadyEvent, DisposingEvent, dxTabPanelItem, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent, SelectionChangedEvent, SelectionChangingEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from 'devextreme/ui/tab_panel'; import DxTabPanel from 'devextreme/ui/tab_panel'; @@ -538,6 +538,14 @@ export class DxTabPanelComponent extends DxComponent im */ @Output() onSelectionChanged: EventEmitter; + /** + + * [descr:dxTabPanelOptions.onSelectionChanging] + + + */ + @Output() onSelectionChanging: EventEmitter; + /** * [descr:dxTabPanelOptions.onTitleClick] @@ -812,6 +820,7 @@ export class DxTabPanelComponent extends DxComponent im { subscribe: 'itemRendered', emit: 'onItemRendered' }, { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, + { subscribe: 'selectionChanging', emit: 'onSelectionChanging' }, { subscribe: 'titleClick', emit: 'onTitleClick' }, { subscribe: 'titleHold', emit: 'onTitleHold' }, { subscribe: 'titleRendered', emit: 'onTitleRendered' }, diff --git a/packages/devextreme-angular/src/ui/tabs/index.ts b/packages/devextreme-angular/src/ui/tabs/index.ts index 98ebde4ef0d6..aaac3c19b380 100644 --- a/packages/devextreme-angular/src/ui/tabs/index.ts +++ b/packages/devextreme-angular/src/ui/tabs/index.ts @@ -26,7 +26,7 @@ export { ExplicitTypes } from 'devextreme/ui/tabs'; import { Orientation, SingleOrMultiple, TabsIconPosition, TabsStyle } from 'devextreme/common'; import { Store } from 'devextreme/data'; import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source'; -import { ContentReadyEvent, DisposingEvent, dxTabsItem, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent, SelectionChangedEvent } from 'devextreme/ui/tabs'; +import { ContentReadyEvent, DisposingEvent, dxTabsItem, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent, SelectionChangedEvent, SelectionChangingEvent } from 'devextreme/ui/tabs'; import DxTabs from 'devextreme/ui/tabs'; @@ -512,6 +512,14 @@ export class DxTabsComponent extends DxComponent implem */ @Output() onSelectionChanged: EventEmitter; + /** + + * [descr:dxTabsOptions.onSelectionChanging] + + + */ + @Output() onSelectionChanging: EventEmitter; + /** * This member supports the internal infrastructure and is not intended to be used directly from your code. @@ -748,6 +756,7 @@ export class DxTabsComponent extends DxComponent implem { subscribe: 'itemRendered', emit: 'onItemRendered' }, { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, + { subscribe: 'selectionChanging', emit: 'onSelectionChanging' }, { emit: 'accessKeyChange' }, { emit: 'dataSourceChange' }, { emit: 'disabledChange' }, diff --git a/packages/devextreme-angular/src/ui/tag-box/index.ts b/packages/devextreme-angular/src/ui/tag-box/index.ts index d129db1e9ef8..3d417ac3fff3 100644 --- a/packages/devextreme-angular/src/ui/tag-box/index.ts +++ b/packages/devextreme-angular/src/ui/tag-box/index.ts @@ -30,7 +30,7 @@ import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_s import { CollectionWidgetItem } from 'devextreme/ui/collection/ui.collection_widget.base'; import { DropDownPredefinedButton } from 'devextreme/ui/drop_down_editor/ui.drop_down_editor'; import { Properties as dxPopupOptions } from 'devextreme/ui/popup'; -import { ChangeEvent, ClosedEvent, ContentReadyEvent, CustomItemCreatingEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, MultiTagPreparingEvent, OpenedEvent, OptionChangedEvent, SelectAllValueChangedEvent, SelectionChangedEvent, ValueChangedEvent } from 'devextreme/ui/tag_box'; +import { ChangeEvent, ClosedEvent, ContentReadyEvent, CustomItemCreatingEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, MultiTagPreparingEvent, OpenedEvent, OptionChangedEvent, SelectAllValueChangedEvent, SelectionChangedEvent, SelectionChangingEvent, ValueChangedEvent } from 'devextreme/ui/tag_box'; import DxTagBox from 'devextreme/ui/tag_box'; @@ -1124,6 +1124,14 @@ export class DxTagBoxComponent extends DxComponent implements OnDestroy, Control */ @Output() onSelectionChanged: EventEmitter; + /** + + * [descr:dxTagBoxOptions.onSelectionChanging] + + + */ + @Output() onSelectionChanging: EventEmitter; + /** * [descr:dxTagBoxOptions.onValueChanged] @@ -1668,6 +1676,7 @@ export class DxTagBoxComponent extends DxComponent implements OnDestroy, Control { subscribe: 'optionChanged', emit: 'onOptionChanged' }, { subscribe: 'selectAllValueChanged', emit: 'onSelectAllValueChanged' }, { subscribe: 'selectionChanged', emit: 'onSelectionChanged' }, + { subscribe: 'selectionChanging', emit: 'onSelectionChanging' }, { subscribe: 'valueChanged', emit: 'onValueChanged' }, { emit: 'acceptCustomValueChange' }, { emit: 'accessKeyChange' }, diff --git a/packages/devextreme-react/src/autocomplete.ts b/packages/devextreme-react/src/autocomplete.ts index 4d7323a6db0c..d72f79a32628 100644 --- a/packages/devextreme-react/src/autocomplete.ts +++ b/packages/devextreme-react/src/autocomplete.ts @@ -8,7 +8,7 @@ import dxAutocomplete, { import { Component as BaseComponent, IHtmlOptions, ComponentRef, IElementDescriptor } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, PasteEvent, ValueChangedEvent } from "devextreme/ui/autocomplete"; +import type { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, PasteEvent, SelectionChangingEvent, ValueChangedEvent } from "devextreme/ui/autocomplete"; import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, ClickEvent, OptionChangedEvent } from "devextreme/ui/button"; import type { AnimationConfig, AnimationState } from "devextreme/animation/fx"; import type { event, EventInfo } from "devextreme/events/index"; @@ -43,6 +43,7 @@ type IAutocompleteOptionsNarrowedEvents = { onKeyUp?: ((e: KeyUpEvent) => void); onOpened?: ((e: OpenedEvent) => void); onPaste?: ((e: PasteEvent) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); onValueChanged?: ((e: ValueChangedEvent) => void); } @@ -77,7 +78,7 @@ const Autocomplete = memo( ), [baseRef.current]); const subscribableOptions = useMemo(() => (["opened","value"]), []); - const independentEvents = useMemo(() => (["onChange","onClosed","onContentReady","onCopy","onCut","onDisposing","onEnterKey","onFocusIn","onFocusOut","onInitialized","onInput","onItemClick","onKeyDown","onKeyUp","onOpened","onPaste","onValueChanged"]), []); + const independentEvents = useMemo(() => (["onChange","onClosed","onContentReady","onCopy","onCut","onDisposing","onEnterKey","onFocusIn","onFocusOut","onInitialized","onInput","onItemClick","onKeyDown","onKeyUp","onOpened","onPaste","onSelectionChanging","onValueChanged"]), []); const defaults = useMemo(() => ({ defaultOpened: "opened", diff --git a/packages/devextreme-react/src/form.ts b/packages/devextreme-react/src/form.ts index 7d3c196f840c..e8dea8d25657 100644 --- a/packages/devextreme-react/src/form.ts +++ b/packages/devextreme-react/src/form.ts @@ -10,7 +10,7 @@ import NestedOption from "./core/nested-option"; import type { ContentReadyEvent, DisposingEvent, EditorEnterKeyEvent, InitializedEvent, dxFormButtonItem, dxFormEmptyItem, dxFormGroupItem, dxFormSimpleItem, dxFormTabbedItem } from "devextreme/ui/form"; import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, ClickEvent, OptionChangedEvent } from "devextreme/ui/button"; -import type { ContentReadyEvent as TabPanelContentReadyEvent, DisposingEvent as TabPanelDisposingEvent, InitializedEvent as TabPanelInitializedEvent, OptionChangedEvent as TabPanelOptionChangedEvent, dxTabPanelOptions, dxTabPanelItem, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, SelectionChangedEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from "devextreme/ui/tab_panel"; +import type { ContentReadyEvent as TabPanelContentReadyEvent, DisposingEvent as TabPanelDisposingEvent, InitializedEvent as TabPanelInitializedEvent, OptionChangedEvent as TabPanelOptionChangedEvent, dxTabPanelOptions, dxTabPanelItem, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, SelectionChangedEvent, SelectionChangingEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from "devextreme/ui/tab_panel"; import type { template } from "devextreme/core/templates/template"; import type { CollectionWidgetItem } from "devextreme/ui/collection/ui.collection_widget.base"; import type { DataSourceOptions } from "devextreme/data/data_source"; @@ -764,6 +764,7 @@ type ITabPanelOptionsProps = React.PropsWithChildren<{ onItemRendered?: ((e: ItemRenderedEvent) => void); onOptionChanged?: ((e: TabPanelOptionChangedEvent) => void); onSelectionChanged?: ((e: SelectionChangedEvent) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); onTitleClick?: ((e: TitleClickEvent) => void); onTitleHold?: ((e: TitleHoldEvent) => void); onTitleRendered?: ((e: TitleRenderedEvent) => void); diff --git a/packages/devextreme-react/src/list.ts b/packages/devextreme-react/src/list.ts index 95bc016f74cf..13efbd6cd6f4 100644 --- a/packages/devextreme-react/src/list.ts +++ b/packages/devextreme-react/src/list.ts @@ -9,7 +9,7 @@ import dxList, { import { Component as BaseComponent, IHtmlOptions, ComponentRef, IElementDescriptor } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { dxListItem, ContentReadyEvent, DisposingEvent, GroupRenderedEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemDeletedEvent, ItemDeletingEvent, ItemHoldEvent, ItemRenderedEvent, ItemReorderedEvent, ItemSwipeEvent, PageLoadingEvent, PullRefreshEvent, ScrollEvent, SelectAllValueChangedEvent } from "devextreme/ui/list"; +import type { dxListItem, ContentReadyEvent, DisposingEvent, GroupRenderedEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemDeletedEvent, ItemDeletingEvent, ItemHoldEvent, ItemRenderedEvent, ItemReorderedEvent, ItemSwipeEvent, PageLoadingEvent, PullRefreshEvent, ScrollEvent, SelectAllValueChangedEvent, SelectionChangingEvent } from "devextreme/ui/list"; import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, OptionChangedEvent as ButtonOptionChangedEvent, ClickEvent } from "devextreme/ui/button"; import type { ContentReadyEvent as TextBoxContentReadyEvent, DisposingEvent as TextBoxDisposingEvent, InitializedEvent as TextBoxInitializedEvent, OptionChangedEvent as TextBoxOptionChangedEvent, ChangeEvent, CopyEvent, CutEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InputEvent, KeyDownEvent, KeyUpEvent, PasteEvent, ValueChangedEvent } from "devextreme/ui/text_box"; import type { DisposingEvent as SortableDisposingEvent, InitializedEvent as SortableInitializedEvent, AddEvent, DragChangeEvent, DragEndEvent, DragMoveEvent, DragStartEvent, OptionChangedEvent, RemoveEvent, ReorderEvent } from "devextreme/ui/sortable"; @@ -38,6 +38,7 @@ type IListOptionsNarrowedEvents = { onPullRefresh?: ((e: PullRefreshEvent) => void); onScroll?: ((e: ScrollEvent) => void); onSelectAllValueChanged?: ((e: SelectAllValueChangedEvent) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); } type IListOptions = React.PropsWithChildren, IListOptionsNarrowedEvents> & IHtmlOptions & { @@ -72,7 +73,7 @@ const List = memo( ), [baseRef.current]); const subscribableOptions = useMemo(() => (["items","selectedItemKeys","selectedItems"]), []); - const independentEvents = useMemo(() => (["onContentReady","onDisposing","onGroupRendered","onInitialized","onItemClick","onItemContextMenu","onItemDeleted","onItemDeleting","onItemHold","onItemRendered","onItemReordered","onItemSwipe","onPageLoading","onPullRefresh","onScroll","onSelectAllValueChanged"]), []); + const independentEvents = useMemo(() => (["onContentReady","onDisposing","onGroupRendered","onInitialized","onItemClick","onItemContextMenu","onItemDeleted","onItemDeleting","onItemHold","onItemRendered","onItemReordered","onItemSwipe","onPageLoading","onPullRefresh","onScroll","onSelectAllValueChanged","onSelectionChanging"]), []); const defaults = useMemo(() => ({ defaultItems: "items", diff --git a/packages/devextreme-react/src/lookup.ts b/packages/devextreme-react/src/lookup.ts index 818ae3e69604..6cc9d9143844 100644 --- a/packages/devextreme-react/src/lookup.ts +++ b/packages/devextreme-react/src/lookup.ts @@ -8,7 +8,7 @@ import dxLookup, { import { Component as BaseComponent, IHtmlOptions, ComponentRef, IElementDescriptor } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { ClosedEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, OpenedEvent, PageLoadingEvent, PullRefreshEvent, ScrollEvent, ValueChangedEvent } from "devextreme/ui/lookup"; +import type { ClosedEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, OpenedEvent, PageLoadingEvent, PullRefreshEvent, ScrollEvent, SelectionChangingEvent, ValueChangedEvent } from "devextreme/ui/lookup"; import type { ContentReadyEvent as PopoverContentReadyEvent, DisposingEvent as PopoverDisposingEvent, InitializedEvent as PopoverInitializedEvent, HiddenEvent, HidingEvent, OptionChangedEvent, ShowingEvent, ShownEvent, TitleRenderedEvent } from "devextreme/ui/popover"; import type { AnimationConfig, AnimationState } from "devextreme/animation/fx"; import type { event } from "devextreme/events/index"; @@ -31,6 +31,7 @@ type ILookupOptionsNarrowedEvents = { onPageLoading?: ((e: PageLoadingEvent) => void); onPullRefresh?: ((e: PullRefreshEvent) => void); onScroll?: ((e: ScrollEvent) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); onValueChanged?: ((e: ValueChangedEvent) => void); } @@ -65,7 +66,7 @@ const Lookup = memo( ), [baseRef.current]); const subscribableOptions = useMemo(() => (["opened","value"]), []); - const independentEvents = useMemo(() => (["onClosed","onContentReady","onDisposing","onInitialized","onItemClick","onOpened","onPageLoading","onPullRefresh","onScroll","onValueChanged"]), []); + const independentEvents = useMemo(() => (["onClosed","onContentReady","onDisposing","onInitialized","onItemClick","onOpened","onPageLoading","onPullRefresh","onScroll","onSelectionChanging","onValueChanged"]), []); const defaults = useMemo(() => ({ defaultOpened: "opened", diff --git a/packages/devextreme-react/src/select-box.ts b/packages/devextreme-react/src/select-box.ts index 424cc5ebf226..296422dbe18c 100644 --- a/packages/devextreme-react/src/select-box.ts +++ b/packages/devextreme-react/src/select-box.ts @@ -8,7 +8,7 @@ import dxSelectBox, { import { Component as BaseComponent, IHtmlOptions, ComponentRef, IElementDescriptor } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CustomItemCreatingEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, PasteEvent, ValueChangedEvent } from "devextreme/ui/select_box"; +import type { ChangeEvent, ClosedEvent, ContentReadyEvent, CopyEvent, CustomItemCreatingEvent, CutEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, OpenedEvent, PasteEvent, SelectionChangingEvent, ValueChangedEvent } from "devextreme/ui/select_box"; import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, ClickEvent, OptionChangedEvent } from "devextreme/ui/button"; import type { AnimationConfig, AnimationState } from "devextreme/animation/fx"; import type { event, EventInfo } from "devextreme/events/index"; @@ -44,6 +44,7 @@ type ISelectBoxOptionsNarrowedEvents = { onKeyUp?: ((e: KeyUpEvent) => void); onOpened?: ((e: OpenedEvent) => void); onPaste?: ((e: PasteEvent) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); onValueChanged?: ((e: ValueChangedEvent) => void); } @@ -80,7 +81,7 @@ const SelectBox = memo( ), [baseRef.current]); const subscribableOptions = useMemo(() => (["opened","value"]), []); - const independentEvents = useMemo(() => (["onChange","onClosed","onContentReady","onCopy","onCustomItemCreating","onCut","onDisposing","onEnterKey","onFocusIn","onFocusOut","onInitialized","onInput","onItemClick","onKeyDown","onKeyUp","onOpened","onPaste","onValueChanged"]), []); + const independentEvents = useMemo(() => (["onChange","onClosed","onContentReady","onCopy","onCustomItemCreating","onCut","onDisposing","onEnterKey","onFocusIn","onFocusOut","onInitialized","onInput","onItemClick","onKeyDown","onKeyUp","onOpened","onPaste","onSelectionChanging","onValueChanged"]), []); const defaults = useMemo(() => ({ defaultOpened: "opened", diff --git a/packages/devextreme-react/src/tab-panel.ts b/packages/devextreme-react/src/tab-panel.ts index d68494f4067c..c78fddb79a6a 100644 --- a/packages/devextreme-react/src/tab-panel.ts +++ b/packages/devextreme-react/src/tab-panel.ts @@ -9,7 +9,7 @@ import dxTabPanel, { import { Component as BaseComponent, IHtmlOptions, ComponentRef, IElementDescriptor } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { dxTabPanelItem, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from "devextreme/ui/tab_panel"; +import type { dxTabPanelItem, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, SelectionChangingEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from "devextreme/ui/tab_panel"; import type { template } from "devextreme/core/templates/template"; import type { CollectionWidgetItem } from "devextreme/ui/collection/ui.collection_widget.base"; @@ -25,6 +25,7 @@ type ITabPanelOptionsNarrowedEvents = { onItemContextMenu?: ((e: ItemContextMenuEvent) => void); onItemHold?: ((e: ItemHoldEvent) => void); onItemRendered?: ((e: ItemRenderedEvent) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); onTitleClick?: ((e: TitleClickEvent) => void); onTitleHold?: ((e: TitleHoldEvent) => void); onTitleRendered?: ((e: TitleRenderedEvent) => void); @@ -62,7 +63,7 @@ const TabPanel = memo( ), [baseRef.current]); const subscribableOptions = useMemo(() => (["items","selectedIndex","selectedItem"]), []); - const independentEvents = useMemo(() => (["onContentReady","onDisposing","onInitialized","onItemClick","onItemContextMenu","onItemHold","onItemRendered","onTitleClick","onTitleHold","onTitleRendered"]), []); + const independentEvents = useMemo(() => (["onContentReady","onDisposing","onInitialized","onItemClick","onItemContextMenu","onItemHold","onItemRendered","onSelectionChanging","onTitleClick","onTitleHold","onTitleRendered"]), []); const defaults = useMemo(() => ({ defaultItems: "items", diff --git a/packages/devextreme-react/src/tabs.ts b/packages/devextreme-react/src/tabs.ts index 08eff1ccde5c..2266296b530e 100644 --- a/packages/devextreme-react/src/tabs.ts +++ b/packages/devextreme-react/src/tabs.ts @@ -9,7 +9,7 @@ import dxTabs, { import { Component as BaseComponent, IHtmlOptions, ComponentRef, IElementDescriptor } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { dxTabsItem, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent } from "devextreme/ui/tabs"; +import type { dxTabsItem, ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, SelectionChangingEvent } from "devextreme/ui/tabs"; import type { CollectionWidgetItem } from "devextreme/ui/collection/ui.collection_widget.base"; import type { template } from "devextreme/core/templates/template"; @@ -25,6 +25,7 @@ type ITabsOptionsNarrowedEvents = { onItemContextMenu?: ((e: ItemContextMenuEvent) => void); onItemHold?: ((e: ItemHoldEvent) => void); onItemRendered?: ((e: ItemRenderedEvent) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); } type ITabsOptions = React.PropsWithChildren, ITabsOptionsNarrowedEvents> & IHtmlOptions & { @@ -61,7 +62,7 @@ const Tabs = memo( ), [baseRef.current]); const subscribableOptions = useMemo(() => (["items","selectedIndex","selectedItem","selectedItemKeys","selectedItems"]), []); - const independentEvents = useMemo(() => (["onContentReady","onDisposing","onInitialized","onItemClick","onItemContextMenu","onItemHold","onItemRendered"]), []); + const independentEvents = useMemo(() => (["onContentReady","onDisposing","onInitialized","onItemClick","onItemContextMenu","onItemHold","onItemRendered","onSelectionChanging"]), []); const defaults = useMemo(() => ({ defaultItems: "items", diff --git a/packages/devextreme-react/src/tag-box.ts b/packages/devextreme-react/src/tag-box.ts index f55e2a8e3b18..4da9d85fbdd6 100644 --- a/packages/devextreme-react/src/tag-box.ts +++ b/packages/devextreme-react/src/tag-box.ts @@ -8,7 +8,7 @@ import dxTagBox, { import { Component as BaseComponent, IHtmlOptions, ComponentRef, IElementDescriptor } from "./core/component"; import NestedOption from "./core/nested-option"; -import type { ChangeEvent, ClosedEvent, ContentReadyEvent, CustomItemCreatingEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, MultiTagPreparingEvent, OpenedEvent, SelectAllValueChangedEvent, ValueChangedEvent } from "devextreme/ui/tag_box"; +import type { ChangeEvent, ClosedEvent, ContentReadyEvent, CustomItemCreatingEvent, DisposingEvent, EnterKeyEvent, FocusInEvent, FocusOutEvent, InitializedEvent, InputEvent, ItemClickEvent, KeyDownEvent, KeyUpEvent, MultiTagPreparingEvent, OpenedEvent, SelectAllValueChangedEvent, SelectionChangingEvent, ValueChangedEvent } from "devextreme/ui/tag_box"; import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, ClickEvent, OptionChangedEvent } from "devextreme/ui/button"; import type { AnimationConfig, AnimationState } from "devextreme/animation/fx"; import type { event, EventInfo } from "devextreme/events/index"; @@ -43,6 +43,7 @@ type ITagBoxOptionsNarrowedEvents = { onMultiTagPreparing?: ((e: MultiTagPreparingEvent) => void); onOpened?: ((e: OpenedEvent) => void); onSelectAllValueChanged?: ((e: SelectAllValueChangedEvent) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); onValueChanged?: ((e: ValueChangedEvent) => void); } @@ -81,7 +82,7 @@ const TagBox = memo( ), [baseRef.current]); const subscribableOptions = useMemo(() => (["opened","value"]), []); - const independentEvents = useMemo(() => (["onChange","onClosed","onContentReady","onCustomItemCreating","onDisposing","onEnterKey","onFocusIn","onFocusOut","onInitialized","onInput","onItemClick","onKeyDown","onKeyUp","onMultiTagPreparing","onOpened","onSelectAllValueChanged","onValueChanged"]), []); + const independentEvents = useMemo(() => (["onChange","onClosed","onContentReady","onCustomItemCreating","onDisposing","onEnterKey","onFocusIn","onFocusOut","onInitialized","onInput","onItemClick","onKeyDown","onKeyUp","onMultiTagPreparing","onOpened","onSelectAllValueChanged","onSelectionChanging","onValueChanged"]), []); const defaults = useMemo(() => ({ defaultOpened: "opened", diff --git a/packages/devextreme-vue/src/autocomplete.ts b/packages/devextreme-vue/src/autocomplete.ts index a49c22d07702..d6e17d190c79 100644 --- a/packages/devextreme-vue/src/autocomplete.ts +++ b/packages/devextreme-vue/src/autocomplete.ts @@ -48,6 +48,7 @@ type AccessibleOptions = Pick = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onItemTitleClick'>; diff --git a/packages/devextreme/js/ui/accordion.js b/packages/devextreme/js/ui/accordion.js index 1bba2e6c0ca0..af89eb476f99 100644 --- a/packages/devextreme/js/ui/accordion.js +++ b/packages/devextreme/js/ui/accordion.js @@ -4,6 +4,12 @@ export default Accordion; // STYLE accordion +/** + * @name dxAccordionOptions.onSelectionChanging + * @hidden + * @action + */ + /** * @name dxAccordionItem * @inherits CollectionWidgetItem diff --git a/packages/devextreme/js/ui/action_sheet.d.ts b/packages/devextreme/js/ui/action_sheet.d.ts index 25e2c519181f..1a3573eaa655 100644 --- a/packages/devextreme/js/ui/action_sheet.d.ts +++ b/packages/devextreme/js/ui/action_sheet.d.ts @@ -286,7 +286,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onCancelClick'>; diff --git a/packages/devextreme/js/ui/action_sheet.js b/packages/devextreme/js/ui/action_sheet.js index 21316c36ad93..41ec7f6766b5 100644 --- a/packages/devextreme/js/ui/action_sheet.js +++ b/packages/devextreme/js/ui/action_sheet.js @@ -25,6 +25,12 @@ export default ActionSheet; * @hidden */ +/** + * @name dxActionSheetOptions.onSelectionChanging + * @action + * @hidden + */ + /** * @name dxActionSheetOptions.onSelectionChanged * @action diff --git a/packages/devextreme/js/ui/autocomplete.d.ts b/packages/devextreme/js/ui/autocomplete.d.ts index b83d05497b9b..c2a02379705f 100644 --- a/packages/devextreme/js/ui/autocomplete.d.ts +++ b/packages/devextreme/js/ui/autocomplete.d.ts @@ -8,6 +8,7 @@ import { import dxDropDownList, { dxDropDownListOptions, + SelectionChangingInfo, SelectionChangedInfo, } from './drop_down_editor/ui.drop_down_list'; @@ -162,6 +163,20 @@ export type OptionChangedEvent = EventInfo & ChangedOptionInfo; */ export type PasteEvent = NativeEventInfo; +/** + * @docid _ui_autocomplete_SelectionChangingEvent + * @public + * @type object + * @inherits EventInfo,_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo + */ +export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { + /** + * @docid _ui_autocomplete_SelectionChangingEvent.cancel + * @type Boolean|Promise + */ + cancel: boolean | PromiseLike; +}; + /** * @docid _ui_autocomplete_SelectionChangedEvent * @public @@ -335,6 +350,11 @@ onOptionChanged?: ((e: OptionChangedEvent) => void); * @type_function_param1 e:{ui/autocomplete:PasteEvent} */ onPaste?: ((e: PasteEvent) => void); +/** + * @docid dxAutocompleteOptions.onSelectionChanging + * @type_function_param1 e:{ui/autocomplete:SelectionChangingEvent} + */ +onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid dxAutocompleteOptions.onSelectionChanged * @type_function_param1 e:{ui/autocomplete:SelectionChangedEvent} diff --git a/packages/devextreme/js/ui/autocomplete_types.d.ts b/packages/devextreme/js/ui/autocomplete_types.d.ts index 989d0fc3572d..0c8b703275bc 100644 --- a/packages/devextreme/js/ui/autocomplete_types.d.ts +++ b/packages/devextreme/js/ui/autocomplete_types.d.ts @@ -17,6 +17,7 @@ export { OpenedEvent, OptionChangedEvent, PasteEvent, + SelectionChangingEvent, SelectionChangedEvent, ValueChangedEvent, DropDownButtonTemplateData, diff --git a/packages/devextreme/js/ui/box.d.ts b/packages/devextreme/js/ui/box.d.ts index ec4ba2fd3ca0..a6bc0ab88821 100644 --- a/packages/devextreme/js/ui/box.d.ts +++ b/packages/devextreme/js/ui/box.d.ts @@ -218,7 +218,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/box.js b/packages/devextreme/js/ui/box.js index 910b9b0e5183..aa36bcb8316c 100644 --- a/packages/devextreme/js/ui/box.js +++ b/packages/devextreme/js/ui/box.js @@ -22,6 +22,11 @@ export default Box; * @name dxBoxOptions.noDataText * @hidden */ +/** + * @name dxBoxOptions.onSelectionChanging + * @action + * @hidden + */ /** * @name dxBoxOptions.onSelectionChanged * @action diff --git a/packages/devextreme/js/ui/collection/ui.collection_widget.base.d.ts b/packages/devextreme/js/ui/collection/ui.collection_widget.base.d.ts index 0737f216bafc..3870abbc6948 100644 --- a/packages/devextreme/js/ui/collection/ui.collection_widget.base.d.ts +++ b/packages/devextreme/js/ui/collection/ui.collection_widget.base.d.ts @@ -21,6 +21,22 @@ import Widget, { export type ItemLike = string | CollectionWidgetItem | any; +/** + * @docid + * @hidden + */ +export interface SelectionChangingInfo { + /** @docid */ + readonly addedItems: Array; + /** @docid */ + readonly removedItems: Array; + /** + * @docid + * @type boolean|Promise + */ + cancel?: boolean | PromiseLike; +} + /** * @docid * @hidden @@ -126,6 +142,18 @@ export interface CollectionWidgetOptions< * @public */ onItemRendered?: ((e: EventInfo & ItemInfo) => void); + /** + * @docid + * @default null + * @type_function_param1 e:object + * @type_function_param1_field addedItems:array + * @type_function_param1_field removedItems:array + * @type_function_param1_field component:this + * @type_function_param1_field cancel:boolean|Promise + * @action + * @public + */ + onSelectionChanging?: ((e: EventInfo & SelectionChangingInfo) => void); /** * @docid * @default null diff --git a/packages/devextreme/js/ui/context_menu.d.ts b/packages/devextreme/js/ui/context_menu.d.ts index 5bd6299bcfa9..bd2e15ecedf6 100644 --- a/packages/devextreme/js/ui/context_menu.d.ts +++ b/packages/devextreme/js/ui/context_menu.d.ts @@ -345,7 +345,7 @@ export type Options = Properties; // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onHidden' | 'onHiding' | 'onPositioning' | 'onShowing' | 'onShown'>; diff --git a/packages/devextreme/js/ui/context_menu.js b/packages/devextreme/js/ui/context_menu.js index 3037c00265ea..ef286e8c3407 100644 --- a/packages/devextreme/js/ui/context_menu.js +++ b/packages/devextreme/js/ui/context_menu.js @@ -20,6 +20,11 @@ export default ContextMenu; * @hidden */ +/** + * @name dxContextMenuOptions.onSelectionChanging + * @hidden + */ + /** * @name dxContextMenuOptions.selectedItems * @hidden diff --git a/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts b/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts index 5f7e8cf0e7ab..beb4e53b965a 100644 --- a/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts +++ b/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts @@ -43,6 +43,32 @@ export interface SelectionChangedInfo { readonly selectedItem: T; } +/** + * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo + * @hidden + */ +export interface SelectionChangingInfo { + /** + * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo.selectedItem + * @type object + */ + readonly selectedItem: T; +} + +/** + * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangingEvent + * @public + * @type object + * @inherits EventInfo,SelectionChangingInfo + */ +export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { + /** + * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangingEvent.cancel + * @type Boolean|Promise + */ + cancel: boolean | PromiseLike; +}; + /** * @namespace DevExpress.ui * @docid @@ -106,6 +132,11 @@ export interface dxDropDownListOptions extends DataExpressionMixinOp * @public */ onSelectionChanged?: ((e: EventInfo & SelectionChangedInfo) => void); + /** + * @docid + * @type_function_param1 e:{ui/drop_down_list:SelectionChangingEvent} + */ + onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid * @default null diff --git a/packages/devextreme/js/ui/gallery.d.ts b/packages/devextreme/js/ui/gallery.d.ts index 931afb72737f..4eeedc5614a6 100644 --- a/packages/devextreme/js/ui/gallery.d.ts +++ b/packages/devextreme/js/ui/gallery.d.ts @@ -289,7 +289,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index 65a6a3d69c4d..8b0f3d23e9ee 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -26,6 +26,13 @@ export default Gallery; * @hidden */ +/** + * @name dxGalleryOptions.onSelectionChanging + * @action + * @hidden + */ + + /** * @name dxGalleryItem.visible * @hidden diff --git a/packages/devextreme/js/ui/list.d.ts b/packages/devextreme/js/ui/list.d.ts index aebc4f000699..6795854735c1 100644 --- a/packages/devextreme/js/ui/list.d.ts +++ b/packages/devextreme/js/ui/list.d.ts @@ -23,6 +23,7 @@ import { import CollectionWidget, { CollectionWidgetItem, CollectionWidgetOptions, + SelectionChangingInfo, SelectionChangedInfo, } from './collection/ui.collection_widget.base'; @@ -253,6 +254,20 @@ export type SelectAllValueChangedEvent readonly value: boolean; }; +/** + * @docid _ui_list_SelectionChangingEvent + * @public + * @type object + * @inherits EventInfo,SelectionChangingInfo + */ +export type SelectionChangingEvent = EventInfo> & SelectionChangingInfo & { + /** + * @docid _ui_list_SelectionChangingEvent.cancel + * @type Boolean|Promise + */ + cancel: boolean | PromiseLike; +}; + /** * @docid _ui_list_SelectionChangedEvent * @public @@ -833,6 +848,7 @@ export type ExplicitTypes< PullRefreshEvent: PullRefreshEvent; ScrollEvent: ScrollEvent; SelectAllValueChangedEvent: SelectAllValueChangedEvent; + SelectionChangingEvent: SelectionChangingEvent; SelectionChangedEvent: SelectionChangedEvent; }; @@ -885,6 +901,11 @@ onItemRendered?: ((e: ItemRenderedEvent) => void); * @type_function_param1 e:{ui/list:OptionChangedEvent} */ onOptionChanged?: ((e: OptionChangedEvent) => void); +/** + * @docid dxListOptions.onSelectionChanging + * @type_function_param1 e:{ui/list:SelectionChangingEvent} + */ +onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid dxListOptions.onSelectionChanged * @type_function_param1 e:{ui/list:SelectionChangedEvent} diff --git a/packages/devextreme/js/ui/list_types.d.ts b/packages/devextreme/js/ui/list_types.d.ts index 532fa4c3af7d..a64867e470a1 100644 --- a/packages/devextreme/js/ui/list_types.d.ts +++ b/packages/devextreme/js/ui/list_types.d.ts @@ -21,6 +21,7 @@ export { PullRefreshEvent, ScrollEvent, SelectAllValueChangedEvent, + SelectionChangingEvent, SelectionChangedEvent, dxListOptions, Item, diff --git a/packages/devextreme/js/ui/lookup.d.ts b/packages/devextreme/js/ui/lookup.d.ts index 0b871411fb1e..dbdaf5f8a14e 100644 --- a/packages/devextreme/js/ui/lookup.d.ts +++ b/packages/devextreme/js/ui/lookup.d.ts @@ -21,6 +21,7 @@ import { import dxDropDownList, { dxDropDownListOptions, + SelectionChangingInfo, SelectionChangedInfo, } from './drop_down_editor/ui.drop_down_list'; @@ -126,6 +127,20 @@ export type PullRefreshEvent = EventInfo; */ export type ScrollEvent = NativeEventInfo & ScrollInfo; +/** + * @docid _ui_lookup_SelectionChangingEvent + * @public + * @type object + * @inherits EventInfo,SelectionChangingInfo + */ +export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { + /** + * @docid _ui_lookup_SelectionChangingEvent.cancel + * @type Boolean|Promise + */ + cancel: boolean | PromiseLike; +}; + /** * @docid _ui_lookup_SelectionChangedEvent * @public @@ -431,6 +446,11 @@ onOpened?: ((e: OpenedEvent) => void); * @type_function_param1 e:{ui/lookup:OptionChangedEvent} */ onOptionChanged?: ((e: OptionChangedEvent) => void); +/** + * @docid dxLookupOptions.onSelectionChanging + * @type_function_param1 e:{ui/lookup:SelectionChangingEvent} + */ +onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid dxLookupOptions.onSelectionChanged * @type_function_param1 e:{ui/lookup:SelectionChangedEvent} diff --git a/packages/devextreme/js/ui/lookup_types.d.ts b/packages/devextreme/js/ui/lookup_types.d.ts index d80346cc96a7..062fe0448b09 100644 --- a/packages/devextreme/js/ui/lookup_types.d.ts +++ b/packages/devextreme/js/ui/lookup_types.d.ts @@ -11,6 +11,7 @@ export { PageLoadingEvent, PullRefreshEvent, ScrollEvent, + SelectionChangingEvent, SelectionChangedEvent, TitleRenderedEvent, ValueChangedEvent, diff --git a/packages/devextreme/js/ui/menu.d.ts b/packages/devextreme/js/ui/menu.d.ts index d486151fa4dc..77dda151181b 100644 --- a/packages/devextreme/js/ui/menu.d.ts +++ b/packages/devextreme/js/ui/menu.d.ts @@ -406,7 +406,7 @@ export type Options = Properties; // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onSubmenuHidden' | 'onSubmenuHiding' | 'onSubmenuShowing' | 'onSubmenuShown'>; diff --git a/packages/devextreme/js/ui/menu.js b/packages/devextreme/js/ui/menu.js index 2299e146a540..b2ca569a683a 100644 --- a/packages/devextreme/js/ui/menu.js +++ b/packages/devextreme/js/ui/menu.js @@ -16,7 +16,7 @@ export default Menu; */ /** - * @name dxMenuOptions.onSelectionChange + * @name dxMenuOptions.onSelectionChanging * @hidden * @action */ diff --git a/packages/devextreme/js/ui/multi_view.d.ts b/packages/devextreme/js/ui/multi_view.d.ts index 72020424b621..b60e5404396a 100644 --- a/packages/devextreme/js/ui/multi_view.d.ts +++ b/packages/devextreme/js/ui/multi_view.d.ts @@ -217,7 +217,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/multi_view.js b/packages/devextreme/js/ui/multi_view.js index f19ef0fdebc4..9168327948b0 100644 --- a/packages/devextreme/js/ui/multi_view.js +++ b/packages/devextreme/js/ui/multi_view.js @@ -19,6 +19,12 @@ export default MultiView; * @hidden */ +/** + * @name dxMultiViewOptions.onSelectionChanging + * @action + * @hidden + */ + /** * @name dxMultiViewItem.visible * @hidden diff --git a/packages/devextreme/js/ui/responsive_box.d.ts b/packages/devextreme/js/ui/responsive_box.d.ts index 97242b6cf4e2..285288a9d9ae 100644 --- a/packages/devextreme/js/ui/responsive_box.d.ts +++ b/packages/devextreme/js/ui/responsive_box.d.ts @@ -273,7 +273,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/responsive_box.js b/packages/devextreme/js/ui/responsive_box.js index d34565f6f3ab..47a6738f9f1a 100644 --- a/packages/devextreme/js/ui/responsive_box.js +++ b/packages/devextreme/js/ui/responsive_box.js @@ -29,6 +29,12 @@ export default ResponsiveBox; * @hidden */ +/** + * @name dxResponsiveBoxOptions.onSelectionChanging + * @action + * @hidden + */ + /** * @name dxResponsiveBoxOptions.onSelectionChanged * @action diff --git a/packages/devextreme/js/ui/select_box.d.ts b/packages/devextreme/js/ui/select_box.d.ts index 3c2745db0b62..13d76144990c 100644 --- a/packages/devextreme/js/ui/select_box.d.ts +++ b/packages/devextreme/js/ui/select_box.d.ts @@ -21,6 +21,7 @@ import { import dxDropDownList, { dxDropDownListOptions, + SelectionChangingInfo, SelectionChangedInfo, } from './drop_down_editor/ui.drop_down_list'; @@ -193,6 +194,20 @@ export type OptionChangedEvent = EventInfo & ChangedOptionInfo; */ export type PasteEvent = NativeEventInfo; +/** + * @docid _ui_select_box_SelectionChangingEvent + * @public + * @type object + * @inherits EventInfo,_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo + */ +export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { + /** + * @docid _ui_select_box_SelectionChangingEvent.cancel + * @type Boolean|Promise + */ + cancel: boolean | PromiseLike; +}; + /** * @docid _ui_select_box_SelectionChangedEvent * @public @@ -398,6 +413,11 @@ onOptionChanged?: ((e: OptionChangedEvent) => void); * @type_function_param1 e:{ui/select_box:PasteEvent} */ onPaste?: ((e: PasteEvent) => void); +/** + * @docid dxSelectBoxOptions.onSelectionChanging + * @type_function_param1 e:{ui/select_box:SelectionChangingEvent} + */ +onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid dxSelectBoxOptions.onSelectionChanged * @type_function_param1 e:{ui/select_box:SelectionChangedEvent} diff --git a/packages/devextreme/js/ui/select_box_types.d.ts b/packages/devextreme/js/ui/select_box_types.d.ts index d4fcbfc9437e..8c926d1d06af 100644 --- a/packages/devextreme/js/ui/select_box_types.d.ts +++ b/packages/devextreme/js/ui/select_box_types.d.ts @@ -18,6 +18,7 @@ export { OpenedEvent, OptionChangedEvent, PasteEvent, + SelectionChangingEvent, SelectionChangedEvent, ValueChangedEvent, DropDownButtonTemplateData, diff --git a/packages/devextreme/js/ui/splitter.d.ts b/packages/devextreme/js/ui/splitter.d.ts index 19c6fa4c2322..4fdd1d4319b1 100644 --- a/packages/devextreme/js/ui/splitter.d.ts +++ b/packages/devextreme/js/ui/splitter.d.ts @@ -316,7 +316,7 @@ export type Properties< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onResize' | 'onResizeEnd' | 'onResizeStart' | 'onItemExpanded' | 'onItemCollapsed'>; diff --git a/packages/devextreme/js/ui/splitter.js b/packages/devextreme/js/ui/splitter.js index 4825a3d338c2..5a8f3b7d17e9 100644 --- a/packages/devextreme/js/ui/splitter.js +++ b/packages/devextreme/js/ui/splitter.js @@ -24,6 +24,12 @@ export default Splitter; * @hidden */ +/** + * @name dxSplitterOptions.onSelectionChanging + * @action + * @hidden + */ + /** * @name dxSplitterOptions.onSelectionChanged * @action diff --git a/packages/devextreme/js/ui/tab_panel.d.ts b/packages/devextreme/js/ui/tab_panel.d.ts index e7f1e85f9c5d..2df6e746ece8 100644 --- a/packages/devextreme/js/ui/tab_panel.d.ts +++ b/packages/devextreme/js/ui/tab_panel.d.ts @@ -23,6 +23,7 @@ import { } from '../common'; import CollectionWidget, { + SelectionChangingInfo, SelectionChangedInfo, } from './collection/ui.collection_widget.base'; @@ -117,6 +118,20 @@ export type ItemRenderedEvent = EventI */ export type OptionChangedEvent = EventInfo> & ChangedOptionInfo; +/** + * @docid _ui_tab_panel_SelectionChangingEvent + * @public + * @type object + * @inherits EventInfo,SelectionChangingInfo + */ +export type SelectionChangingEvent = EventInfo> & SelectionChangingInfo & { + /** + * @docid _ui_tab_panel_SelectionChangingEvent.cancel + * @type Boolean|Promise + */ + cancel: boolean | PromiseLike; +}; + /** * @docid _ui_tab_panel_SelectionChangedEvent * @public @@ -330,6 +345,7 @@ export type ExplicitTypes< ItemHoldEvent: ItemHoldEvent; ItemRenderedEvent: ItemRenderedEvent; OptionChangedEvent: OptionChangedEvent; + SelectionChangingEvent: SelectionChangingEvent; SelectionChangedEvent: SelectionChangedEvent; TitleClickEvent: TitleClickEvent; TitleHoldEvent: TitleHoldEvent; @@ -400,6 +416,11 @@ onItemRendered?: ((e: ItemRenderedEvent) => void); * @type_function_param1 e:{ui/tab_panel:OptionChangedEvent} */ onOptionChanged?: ((e: OptionChangedEvent) => void); +/** + * @docid dxTabPanelOptions.onSelectionChanging + * @type_function_param1 e:{ui/tab_panel:SelectionChangingEvent} + */ +onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid dxTabPanelOptions.onSelectionChanged * @type_function_param1 e:{ui/tab_panel:SelectionChangedEvent} diff --git a/packages/devextreme/js/ui/tab_panel_types.d.ts b/packages/devextreme/js/ui/tab_panel_types.d.ts index 4aee9203d20a..966bc0c4f3be 100644 --- a/packages/devextreme/js/ui/tab_panel_types.d.ts +++ b/packages/devextreme/js/ui/tab_panel_types.d.ts @@ -10,6 +10,7 @@ export { ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent, + SelectionChangingEvent, SelectionChangedEvent, TitleClickEvent, TitleHoldEvent, diff --git a/packages/devextreme/js/ui/tabs.d.ts b/packages/devextreme/js/ui/tabs.d.ts index 0aaa5bf04e34..1dba44e25934 100644 --- a/packages/devextreme/js/ui/tabs.d.ts +++ b/packages/devextreme/js/ui/tabs.d.ts @@ -12,6 +12,7 @@ import CollectionWidget, { CollectionWidgetItem, CollectionWidgetOptions, SelectionChangedInfo, + SelectionChangingInfo, } from './collection/ui.collection_widget.base'; import { @@ -102,6 +103,20 @@ export type OptionChangedEvent = Event */ export type SelectionChangedEvent = EventInfo> & SelectionChangedInfo; +/** + * @docid _ui_tabs_SelectionChangingEvent + * @public + * @type object + * @inherits EventInfo,SelectionChangingInfo + */ +export type SelectionChangingEvent = EventInfo> & SelectionChangingInfo & { + /** + * @docid _ui_tabs_SelectionChangingEvent.cancel + * @type Boolean|Promise + */ + cancel: boolean | PromiseLike; +}; + /** * @deprecated use Properties instead * @namespace DevExpress.ui @@ -254,6 +269,7 @@ export type ExplicitTypes< ItemRenderedEvent: ItemRenderedEvent; OptionChangedEvent: OptionChangedEvent; SelectionChangedEvent: SelectionChangedEvent; + SelectionChangingEvent: SelectionChangingEvent; }; /** @public */ @@ -325,5 +341,10 @@ onOptionChanged?: ((e: OptionChangedEvent) => void); * @type_function_param1 e:{ui/tabs:SelectionChangedEvent} */ onSelectionChanged?: ((e: SelectionChangedEvent) => void); +/** + * @docid dxTabsOptions.onSelectionChanging + * @type_function_param1 e:{ui/tabs:SelectionChangingEvent} + */ +onSelectionChanging?: ((e: SelectionChangingEvent) => void); }; ///#ENDDEBUG diff --git a/packages/devextreme/js/ui/tabs_types.d.ts b/packages/devextreme/js/ui/tabs_types.d.ts index 5e5540da6550..54a0cf722e87 100644 --- a/packages/devextreme/js/ui/tabs_types.d.ts +++ b/packages/devextreme/js/ui/tabs_types.d.ts @@ -12,6 +12,7 @@ export { ItemRenderedEvent, OptionChangedEvent, SelectionChangedEvent, + SelectionChangingEvent, dxTabsOptions, Item, Properties, diff --git a/packages/devextreme/js/ui/tag_box.d.ts b/packages/devextreme/js/ui/tag_box.d.ts index cab414278ff5..b2581c3eef54 100644 --- a/packages/devextreme/js/ui/tag_box.d.ts +++ b/packages/devextreme/js/ui/tag_box.d.ts @@ -17,6 +17,7 @@ import { } from '../events/index'; import { + SelectionChangingInfo, SelectionChangedInfo, } from './collection/ui.collection_widget.base'; @@ -190,6 +191,20 @@ export type SelectAllValueChangedEvent = EventInfo & { readonly value: boolean; }; +/** + * @docid _ui_tag_box_SelectionChangingEvent + * @public + * @type object + * @inherits EventInfo,SelectionChangingInfo + */ +export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { + /** + * @docid _ui_tag_box_SelectionChangingEvent.cancel + * @type Boolean|Promise + */ + cancel: boolean | PromiseLike; +}; + /** * @docid _ui_tag_box_SelectionChangedEvent * @public @@ -214,7 +229,7 @@ export type DropDownButtonTemplateData = DropDownButtonTemplateDataModel; * @namespace DevExpress.ui * @docid */ -export interface dxTagBoxOptions extends Pick, Exclude, 'onSelectionChanged'>> { +export interface dxTagBoxOptions extends Pick, Exclude, 'onSelectionChanged' | 'onSelectionChanging'>> { /** * @docid * @default "instantly" @@ -255,6 +270,14 @@ export interface dxTagBoxOptions extends Pick, Excl * @public */ onSelectAllValueChanged?: ((e: SelectAllValueChangedEvent) => void); + /** + * @docid + * @default null + * @type_function_param1 e:{ui/tag_box:SelectionChangingEvent} + * @action + * @public + */ + onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid * @default null @@ -335,7 +358,7 @@ import { CheckedEvents } from '../core'; type FilterOutHidden = Omit; -type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onMultiTagPreparing' | 'onSelectAllValueChanged' | 'onSelectionChanged'>; +type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onMultiTagPreparing' | 'onSelectAllValueChanged' | 'onSelectionChanged' | 'onSelectionChanging'>; /** * @hidden diff --git a/packages/devextreme/js/ui/tag_box_types.d.ts b/packages/devextreme/js/ui/tag_box_types.d.ts index 8b26bb168b5b..2349f5edfc8c 100644 --- a/packages/devextreme/js/ui/tag_box_types.d.ts +++ b/packages/devextreme/js/ui/tag_box_types.d.ts @@ -17,6 +17,7 @@ export { OpenedEvent, OptionChangedEvent, SelectAllValueChangedEvent, + SelectionChangingEvent, SelectionChangedEvent, ValueChangedEvent, DropDownButtonTemplateData, diff --git a/packages/devextreme/js/ui/tile_view.d.ts b/packages/devextreme/js/ui/tile_view.d.ts index ce51a71c737e..47e3bad5ee1a 100644 --- a/packages/devextreme/js/ui/tile_view.d.ts +++ b/packages/devextreme/js/ui/tile_view.d.ts @@ -245,7 +245,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/tile_view.js b/packages/devextreme/js/ui/tile_view.js index 9eb397302b05..79d432468a5d 100644 --- a/packages/devextreme/js/ui/tile_view.js +++ b/packages/devextreme/js/ui/tile_view.js @@ -29,6 +29,12 @@ export default TagBox; * @hidden */ +/** + * @name dxTileViewOptions.onSelectionChanging + * @action + * @hidden + */ + /** * @name dxTileViewOptions.onSelectionChanged * @action diff --git a/packages/devextreme/js/ui/toolbar.d.ts b/packages/devextreme/js/ui/toolbar.d.ts index a83f06e81958..cf50670e2ee0 100644 --- a/packages/devextreme/js/ui/toolbar.d.ts +++ b/packages/devextreme/js/ui/toolbar.d.ts @@ -237,7 +237,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/toolbar.js b/packages/devextreme/js/ui/toolbar.js index af20910a8cb8..0a3e31f70e7d 100644 --- a/packages/devextreme/js/ui/toolbar.js +++ b/packages/devextreme/js/ui/toolbar.js @@ -62,6 +62,13 @@ export default Toolbar; * @hidden */ +/** + * @name dxToolbarOptions.onSelectionChanging + * @action + * @hidden + */ + + /** * @name dxToolbarOptions.onSelectionChanged * @action diff --git a/packages/devextreme/js/ui/tree_view.d.ts b/packages/devextreme/js/ui/tree_view.d.ts index 2b3d3b43cd11..dc21bb03bd48 100644 --- a/packages/devextreme/js/ui/tree_view.d.ts +++ b/packages/devextreme/js/ui/tree_view.d.ts @@ -716,7 +716,7 @@ export type Options = Properties; // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onItemClick' | 'onItemCollapsed' | 'onItemContextMenu' | 'onItemExpanded' | 'onItemHold' | 'onItemRendered' | 'onItemSelectionChanged' | 'onSelectAllValueChanged' | 'onSelectionChanged'>; diff --git a/packages/devextreme/js/ui/tree_view.js b/packages/devextreme/js/ui/tree_view.js index 4f29996e83d8..0f8ad4635f96 100644 --- a/packages/devextreme/js/ui/tree_view.js +++ b/packages/devextreme/js/ui/tree_view.js @@ -24,3 +24,9 @@ export default TreeView; * @name dxTreeViewOptions.selectedIndex * @hidden */ +/** + * @name dxTreeViewOptions.onSelectionChanging + * @hidden + * @action + */ + diff --git a/packages/devextreme/js/ui/validation_summary.d.ts b/packages/devextreme/js/ui/validation_summary.d.ts index d1a8165c8265..6b4a75021907 100644 --- a/packages/devextreme/js/ui/validation_summary.d.ts +++ b/packages/devextreme/js/ui/validation_summary.d.ts @@ -115,7 +115,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/validation_summary.js b/packages/devextreme/js/ui/validation_summary.js index cc57924f14f6..38f6002881ad 100644 --- a/packages/devextreme/js/ui/validation_summary.js +++ b/packages/devextreme/js/ui/validation_summary.js @@ -100,6 +100,12 @@ export default ValidationSummary; * @action */ +/** + * @name dxValidationSummaryOptions.onSelectionChanging + * @hidden + * @action + */ + /** * @name dxValidationSummaryOptions.onSelectionChanged * @hidden diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index 4ea4f2bae087..bb6c4598fa0c 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -7960,6 +7960,24 @@ declare module DevExpress.ui { */ readonly removedItems: Array; } + /** + * [descr:SelectionChangingInfo] + * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. + */ + export interface SelectionChangingInfo { + /** + * [descr:SelectionChangingInfo.addedItems] + */ + readonly addedItems: Array; + /** + * [descr:SelectionChangingInfo.removedItems] + */ + readonly removedItems: Array; + /** + * [descr:SelectionChangingInfo.cancel] + */ + cancel?: boolean | PromiseLike; + } } /** * [descr:CollectionWidgetItem] @@ -8071,6 +8089,13 @@ declare module DevExpress.ui { e: DevExpress.events.EventInfo & DevExpress.events.ItemInfo ) => void; + /** + * [descr:CollectionWidgetOptions.onSelectionChanging] + */ + onSelectionChanging?: ( + e: DevExpress.events.EventInfo & + DevExpress.ui.CollectionWidget.SelectionChangingInfo + ) => void; /** * [descr:CollectionWidgetOptions.onSelectionChanged] */ @@ -8847,6 +8872,17 @@ declare module DevExpress.ui { export type SelectionChangedEvent = DevExpress.events.EventInfo & DevExpress.ui.dxDropDownList.SelectionChangedInfo; + /** + * [descr:_ui_autocomplete_SelectionChangingEvent] + */ + export type SelectionChangingEvent = + DevExpress.events.EventInfo & + DevExpress.ui.dxDropDownList.SelectionChangingInfo & { + /** + * [descr:_ui_autocomplete_SelectionChangingEvent.cancel] + */ + cancel: boolean | PromiseLike; + }; /** * [descr:_ui_autocomplete_ValueChangedEvent] */ @@ -14830,6 +14866,27 @@ declare module DevExpress.ui { */ readonly selectedItem: T; } + /** + * [descr:_ui_drop_down_editor_ui_drop_down_list_SelectionChangingEvent] + */ + export type SelectionChangingEvent = + DevExpress.events.EventInfo & + SelectionChangingInfo & { + /** + * [descr:_ui_drop_down_editor_ui_drop_down_list_SelectionChangingEvent.cancel] + */ + cancel: boolean | PromiseLike; + }; + /** + * [descr:_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo] + * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. + */ + export interface SelectionChangingInfo { + /** + * [descr:_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo.selectedItem] + */ + readonly selectedItem: T; + } } /** * [descr:dxDropDownListOptions] @@ -14881,6 +14938,12 @@ declare module DevExpress.ui { e: DevExpress.events.EventInfo & DevExpress.ui.dxDropDownList.SelectionChangedInfo ) => void; + /** + * [descr:dxDropDownListOptions.onSelectionChanging] + */ + onSelectionChanging?: ( + e: DevExpress.ui.dxDropDownList.SelectionChangingEvent + ) => void; /** * [descr:dxDropDownListOptions.onValueChanged] */ @@ -19608,6 +19671,7 @@ declare module DevExpress.ui { PullRefreshEvent: PullRefreshEvent; ScrollEvent: ScrollEvent; SelectAllValueChangedEvent: SelectAllValueChangedEvent; + SelectionChangingEvent: SelectionChangingEvent; SelectionChangedEvent: SelectionChangedEvent; }; /** @@ -19841,6 +19905,19 @@ declare module DevExpress.ui { TKey = any > = DevExpress.events.EventInfo> & DevExpress.ui.CollectionWidget.SelectionChangedInfo; + /** + * [descr:_ui_list_SelectionChangingEvent] + */ + export type SelectionChangingEvent< + TItem extends ItemLike = any, + TKey = any + > = DevExpress.events.EventInfo> & + DevExpress.ui.CollectionWidget.SelectionChangingInfo & { + /** + * [descr:_ui_list_SelectionChangingEvent.cancel] + */ + cancel: boolean | PromiseLike; + }; } /** * @deprecated Use Item instead @@ -20311,6 +20388,16 @@ declare module DevExpress.ui { */ export type SelectionChangedEvent = DevExpress.events.EventInfo & DevExpress.ui.dxDropDownList.SelectionChangedInfo; + /** + * [descr:_ui_lookup_SelectionChangingEvent] + */ + export type SelectionChangingEvent = DevExpress.events.EventInfo & + DevExpress.ui.dxDropDownList.SelectionChangingInfo & { + /** + * [descr:_ui_lookup_SelectionChangingEvent.cancel] + */ + cancel: boolean | PromiseLike; + }; export type TitleRenderedEvent = DevExpress.events.EventInfo & DevExpress.ui.dxPopup.TitleRenderedInfo; /** @@ -24883,6 +24970,17 @@ declare module DevExpress.ui { export type SelectionChangedEvent = DevExpress.events.EventInfo & DevExpress.ui.dxDropDownList.SelectionChangedInfo; + /** + * [descr:_ui_select_box_SelectionChangingEvent] + */ + export type SelectionChangingEvent = + DevExpress.events.EventInfo & + DevExpress.ui.dxDropDownList.SelectionChangingInfo & { + /** + * [descr:_ui_select_box_SelectionChangingEvent.cancel] + */ + cancel: boolean | PromiseLike; + }; /** * [descr:_ui_select_box_ValueChangedEvent] */ @@ -25913,6 +26011,7 @@ declare module DevExpress.ui { ItemHoldEvent: ItemHoldEvent; ItemRenderedEvent: ItemRenderedEvent; OptionChangedEvent: OptionChangedEvent; + SelectionChangingEvent: SelectionChangingEvent; SelectionChangedEvent: SelectionChangedEvent; TitleClickEvent: TitleClickEvent; TitleHoldEvent: TitleHoldEvent; @@ -25990,6 +26089,19 @@ declare module DevExpress.ui { TKey = any > = DevExpress.events.EventInfo> & DevExpress.ui.CollectionWidget.SelectionChangedInfo; + /** + * [descr:_ui_tab_panel_SelectionChangingEvent] + */ + export type SelectionChangingEvent< + TItem extends ItemLike = any, + TKey = any + > = DevExpress.events.EventInfo> & + DevExpress.ui.CollectionWidget.SelectionChangingInfo & { + /** + * [descr:_ui_tab_panel_SelectionChangingEvent.cancel] + */ + cancel: boolean | PromiseLike; + }; /** * [descr:TabPanelItemInfo] * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. @@ -26182,6 +26294,7 @@ declare module DevExpress.ui { ItemRenderedEvent: ItemRenderedEvent; OptionChangedEvent: OptionChangedEvent; SelectionChangedEvent: SelectionChangedEvent; + SelectionChangingEvent: SelectionChangingEvent; }; /** * [descr:_ui_tabs_InitializedEvent] @@ -26255,6 +26368,19 @@ declare module DevExpress.ui { TKey = any > = DevExpress.events.EventInfo> & DevExpress.ui.CollectionWidget.SelectionChangedInfo; + /** + * [descr:_ui_tabs_SelectionChangingEvent] + */ + export type SelectionChangingEvent< + TItem extends ItemLike = any, + TKey = any + > = DevExpress.events.EventInfo> & + DevExpress.ui.CollectionWidget.SelectionChangingInfo & { + /** + * [descr:_ui_tabs_SelectionChangingEvent.cancel] + */ + cancel: boolean | PromiseLike; + }; } /** * [descr:dxTabsOptions] @@ -26470,6 +26596,18 @@ declare module DevExpress.ui { DevExpress.ui.CollectionWidget.SelectionChangedInfo< string | number | any >; + /** + * [descr:_ui_tag_box_SelectionChangingEvent] + */ + export type SelectionChangingEvent = DevExpress.events.EventInfo & + DevExpress.ui.CollectionWidget.SelectionChangingInfo< + string | number | any + > & { + /** + * [descr:_ui_tag_box_SelectionChangingEvent.cancel] + */ + cancel: boolean | PromiseLike; + }; /** * [descr:_ui_tag_box_ValueChangedEvent] */ @@ -26487,7 +26625,10 @@ declare module DevExpress.ui { export interface dxTagBoxOptions extends Pick< dxSelectBoxOptions, - Exclude, 'onSelectionChanged'> + Exclude< + keyof dxSelectBoxOptions, + 'onSelectionChanged' | 'onSelectionChanging' + > > { /** * [descr:dxTagBoxOptions.applyValueMode] @@ -26517,6 +26658,12 @@ declare module DevExpress.ui { onSelectAllValueChanged?: ( e: DevExpress.ui.dxTagBox.SelectAllValueChangedEvent ) => void; + /** + * [descr:dxTagBoxOptions.onSelectionChanging] + */ + onSelectionChanging?: ( + e: DevExpress.ui.dxTagBox.SelectionChangingEvent + ) => void; /** * [descr:dxTagBoxOptions.onSelectionChanged] */ From fc2e49f08eed1b87024317a0840cf2239ea54fd6 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:04:23 +0300 Subject: [PATCH 2/6] fix uid --- .../devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts b/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts index beb4e53b965a..6abc418e46d6 100644 --- a/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts +++ b/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts @@ -134,7 +134,7 @@ export interface dxDropDownListOptions extends DataExpressionMixinOp onSelectionChanged?: ((e: EventInfo & SelectionChangedInfo) => void); /** * @docid - * @type_function_param1 e:{ui/drop_down_list:SelectionChangingEvent} + * @type_function_param1 e:{ui/drop_down_editor/ui.drop_down_list:SelectionChangingEvent} */ onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** From ca78c9791306c8ad783754bf6230ebb18e85db4b Mon Sep 17 00:00:00 2001 From: EugeniyKiyashko Date: Wed, 28 Aug 2024 22:49:09 +0400 Subject: [PATCH 3/6] refactor --- .../ui/collection/m_collection_widget.edit.ts | 2 +- packages/devextreme/js/events/index.d.ts | 9 ++ packages/devextreme/js/ui/action_sheet.d.ts | 2 +- packages/devextreme/js/ui/autocomplete.d.ts | 11 +- packages/devextreme/js/ui/box.d.ts | 2 +- .../collection/ui.collection_widget.base.d.ts | 22 ++-- .../drop_down_editor/ui.drop_down_list.d.ts | 44 ++++--- packages/devextreme/js/ui/gallery.js | 1 - packages/devextreme/js/ui/list.d.ts | 11 +- packages/devextreme/js/ui/lookup.d.ts | 11 +- packages/devextreme/js/ui/menu.d.ts | 2 +- packages/devextreme/js/ui/responsive_box.d.ts | 2 +- packages/devextreme/js/ui/select_box.d.ts | 11 +- packages/devextreme/js/ui/splitter.d.ts | 2 +- packages/devextreme/js/ui/tab_panel.d.ts | 11 +- packages/devextreme/js/ui/tabs.d.ts | 29 ++--- packages/devextreme/js/ui/tabs_types.d.ts | 2 +- packages/devextreme/js/ui/tag_box.d.ts | 11 +- packages/devextreme/js/ui/tile_view.d.ts | 2 +- packages/devextreme/js/ui/toolbar.d.ts | 2 +- .../devextreme/js/ui/validation_summary.d.ts | 2 +- packages/devextreme/playground/jquery.html | 103 +++++++++++++++- packages/devextreme/ts/dx.all.d.ts | 113 +++++++----------- 23 files changed, 223 insertions(+), 184 deletions(-) diff --git a/packages/devextreme/js/__internal/ui/collection/m_collection_widget.edit.ts b/packages/devextreme/js/__internal/ui/collection/m_collection_widget.edit.ts index 6548f47f0a2a..6afe3abf47c5 100644 --- a/packages/devextreme/js/__internal/ui/collection/m_collection_widget.edit.ts +++ b/packages/devextreme/js/__internal/ui/collection/m_collection_widget.edit.ts @@ -557,8 +557,8 @@ const CollectionWidget = BaseCollectionWidget.inherit({ case 'selectionRequired': this._normalizeSelectedItems(); break; - case 'onSelectionChanged': case 'onSelectionChanging': + case 'onSelectionChanged': this._initActions(); break; case 'selectByClick': diff --git a/packages/devextreme/js/events/index.d.ts b/packages/devextreme/js/events/index.d.ts index 1e16e4d1e6da..bdbe56b874c5 100644 --- a/packages/devextreme/js/events/index.d.ts +++ b/packages/devextreme/js/events/index.d.ts @@ -109,6 +109,15 @@ export interface Cancelable { cancel?: boolean; } +/** + * @docid + * @public + */ +export interface AsyncCancelable { + /** @docid */ + cancel: boolean | PromiseLike; +} + /** @deprecated EventObject */ export type dxEvent = EventObject; diff --git a/packages/devextreme/js/ui/action_sheet.d.ts b/packages/devextreme/js/ui/action_sheet.d.ts index 1a3573eaa655..f8415c1c7aca 100644 --- a/packages/devextreme/js/ui/action_sheet.d.ts +++ b/packages/devextreme/js/ui/action_sheet.d.ts @@ -286,7 +286,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onCancelClick'>; diff --git a/packages/devextreme/js/ui/autocomplete.d.ts b/packages/devextreme/js/ui/autocomplete.d.ts index c2a02379705f..584cd59db5af 100644 --- a/packages/devextreme/js/ui/autocomplete.d.ts +++ b/packages/devextreme/js/ui/autocomplete.d.ts @@ -4,6 +4,7 @@ import { InitializedEventInfo, ChangedOptionInfo, ItemInfo, + AsyncCancelable, } from '../events/index'; import dxDropDownList, { @@ -167,15 +168,9 @@ export type PasteEvent = NativeEventInfo; * @docid _ui_autocomplete_SelectionChangingEvent * @public * @type object - * @inherits EventInfo,_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo + * @inherits AsyncCancelable,EventInfo,_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo */ -export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { - /** - * @docid _ui_autocomplete_SelectionChangingEvent.cancel - * @type Boolean|Promise - */ - cancel: boolean | PromiseLike; -}; +export type SelectionChangingEvent = AsyncCancelable & EventInfo & SelectionChangingInfo; /** * @docid _ui_autocomplete_SelectionChangedEvent diff --git a/packages/devextreme/js/ui/box.d.ts b/packages/devextreme/js/ui/box.d.ts index a6bc0ab88821..4392472ffd22 100644 --- a/packages/devextreme/js/ui/box.d.ts +++ b/packages/devextreme/js/ui/box.d.ts @@ -218,7 +218,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/collection/ui.collection_widget.base.d.ts b/packages/devextreme/js/ui/collection/ui.collection_widget.base.d.ts index 3870abbc6948..8cd4103c9771 100644 --- a/packages/devextreme/js/ui/collection/ui.collection_widget.base.d.ts +++ b/packages/devextreme/js/ui/collection/ui.collection_widget.base.d.ts @@ -13,6 +13,7 @@ import { EventInfo, NativeEventInfo, ItemInfo, + AsyncCancelable, } from '../../events/index'; import Widget, { @@ -30,13 +31,16 @@ export interface SelectionChangingInfo { readonly addedItems: Array; /** @docid */ readonly removedItems: Array; - /** - * @docid - * @type boolean|Promise - */ - cancel?: boolean | PromiseLike; } +/** + * @docid + * @public + * @type object + * @inherits AsyncCancelable,EventInfo,SelectionChangingInfo + */ +export type SelectionChangingEvent = AsyncCancelable & EventInfo & SelectionChangingInfo; + /** * @docid * @hidden @@ -145,15 +149,11 @@ export interface CollectionWidgetOptions< /** * @docid * @default null - * @type_function_param1 e:object - * @type_function_param1_field addedItems:array - * @type_function_param1_field removedItems:array - * @type_function_param1_field component:this - * @type_function_param1_field cancel:boolean|Promise + * @type_function_param1 e:{ui/collection/ui.collection_widget.base:SelectionChangingEvent} * @action * @public */ - onSelectionChanging?: ((e: EventInfo & SelectionChangingInfo) => void); + onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid * @default null diff --git a/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts b/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts index 6abc418e46d6..ca0ef7657551 100644 --- a/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts +++ b/packages/devextreme/js/ui/drop_down_editor/ui.drop_down_list.d.ts @@ -13,6 +13,7 @@ import { EventInfo, NativeEventInfo, ItemInfo, + AsyncCancelable, } from '../../events/index'; import { @@ -31,18 +32,6 @@ import { SimplifiedSearchMode, } from '../../common'; -/** - * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangedInfo - * @hidden - */ -export interface SelectionChangedInfo { - /** - * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangedInfo.selectedItem - * @type object - */ - readonly selectedItem: T; -} - /** * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo * @hidden @@ -59,15 +48,21 @@ export interface SelectionChangingInfo { * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangingEvent * @public * @type object - * @inherits EventInfo,SelectionChangingInfo + * @inherits AsyncCancelable,EventInfo,SelectionChangingInfo */ -export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { +export type SelectionChangingEvent = AsyncCancelable & EventInfo & SelectionChangingInfo; + +/** + * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangedInfo + * @hidden + */ +export interface SelectionChangedInfo { /** - * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangingEvent.cancel - * @type Boolean|Promise + * @docid _ui_drop_down_editor_ui_drop_down_list_SelectionChangedInfo.selectedItem + * @type object */ - cancel: boolean | PromiseLike; -}; + readonly selectedItem: T; +} /** * @namespace DevExpress.ui @@ -122,6 +117,14 @@ export interface dxDropDownListOptions extends DataExpressionMixinOp * @public */ onItemClick?: ((e: NativeEventInfo & ItemInfo) => void); + /** + * @docid + * @default null + * @type_function_param1 e:{ui/drop_down_editor/ui.drop_down_list:SelectionChangingEvent} + * @action + * @public + */ + onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid * @default null @@ -132,11 +135,6 @@ export interface dxDropDownListOptions extends DataExpressionMixinOp * @public */ onSelectionChanged?: ((e: EventInfo & SelectionChangedInfo) => void); - /** - * @docid - * @type_function_param1 e:{ui/drop_down_editor/ui.drop_down_list:SelectionChangingEvent} - */ - onSelectionChanging?: ((e: SelectionChangingEvent) => void); /** * @docid * @default null diff --git a/packages/devextreme/js/ui/gallery.js b/packages/devextreme/js/ui/gallery.js index 8b0f3d23e9ee..096655d4424a 100644 --- a/packages/devextreme/js/ui/gallery.js +++ b/packages/devextreme/js/ui/gallery.js @@ -32,7 +32,6 @@ export default Gallery; * @hidden */ - /** * @name dxGalleryItem.visible * @hidden diff --git a/packages/devextreme/js/ui/list.d.ts b/packages/devextreme/js/ui/list.d.ts index 6795854735c1..a04cf1d2ac07 100644 --- a/packages/devextreme/js/ui/list.d.ts +++ b/packages/devextreme/js/ui/list.d.ts @@ -18,6 +18,7 @@ import { InitializedEventInfo, ChangedOptionInfo, ItemInfo, + AsyncCancelable, } from '../events/index'; import CollectionWidget, { @@ -258,15 +259,9 @@ export type SelectAllValueChangedEvent * @docid _ui_list_SelectionChangingEvent * @public * @type object - * @inherits EventInfo,SelectionChangingInfo + * @inherits AsyncCancelable,EventInfo,SelectionChangingInfo */ -export type SelectionChangingEvent = EventInfo> & SelectionChangingInfo & { - /** - * @docid _ui_list_SelectionChangingEvent.cancel - * @type Boolean|Promise - */ - cancel: boolean | PromiseLike; -}; +export type SelectionChangingEvent = AsyncCancelable & EventInfo> & SelectionChangingInfo; /** * @docid _ui_list_SelectionChangedEvent diff --git a/packages/devextreme/js/ui/lookup.d.ts b/packages/devextreme/js/ui/lookup.d.ts index dbdaf5f8a14e..c874df66212e 100644 --- a/packages/devextreme/js/ui/lookup.d.ts +++ b/packages/devextreme/js/ui/lookup.d.ts @@ -13,6 +13,7 @@ import { InitializedEventInfo, ChangedOptionInfo, ItemInfo, + AsyncCancelable, } from '../events/index'; import { @@ -131,15 +132,9 @@ export type ScrollEvent = NativeEventInfo & Scroll * @docid _ui_lookup_SelectionChangingEvent * @public * @type object - * @inherits EventInfo,SelectionChangingInfo + * @inherits AsyncCancelable,EventInfo,SelectionChangingInfo */ -export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { - /** - * @docid _ui_lookup_SelectionChangingEvent.cancel - * @type Boolean|Promise - */ - cancel: boolean | PromiseLike; -}; +export type SelectionChangingEvent = AsyncCancelable & EventInfo & SelectionChangingInfo; /** * @docid _ui_lookup_SelectionChangedEvent diff --git a/packages/devextreme/js/ui/menu.d.ts b/packages/devextreme/js/ui/menu.d.ts index 77dda151181b..7b88337ca069 100644 --- a/packages/devextreme/js/ui/menu.d.ts +++ b/packages/devextreme/js/ui/menu.d.ts @@ -406,7 +406,7 @@ export type Options = Properties; // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onSubmenuHidden' | 'onSubmenuHiding' | 'onSubmenuShowing' | 'onSubmenuShown'>; diff --git a/packages/devextreme/js/ui/responsive_box.d.ts b/packages/devextreme/js/ui/responsive_box.d.ts index 285288a9d9ae..ab8ad419ab06 100644 --- a/packages/devextreme/js/ui/responsive_box.d.ts +++ b/packages/devextreme/js/ui/responsive_box.d.ts @@ -273,7 +273,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/select_box.d.ts b/packages/devextreme/js/ui/select_box.d.ts index 13d76144990c..95277a28fe8a 100644 --- a/packages/devextreme/js/ui/select_box.d.ts +++ b/packages/devextreme/js/ui/select_box.d.ts @@ -13,6 +13,7 @@ import { InitializedEventInfo, ChangedOptionInfo, ItemInfo, + AsyncCancelable, } from '../events/index'; import { @@ -198,15 +199,9 @@ export type PasteEvent = NativeEventInfo; * @docid _ui_select_box_SelectionChangingEvent * @public * @type object - * @inherits EventInfo,_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo + * @inherits AsyncCancelable,EventInfo,_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo */ -export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { - /** - * @docid _ui_select_box_SelectionChangingEvent.cancel - * @type Boolean|Promise - */ - cancel: boolean | PromiseLike; -}; +export type SelectionChangingEvent = AsyncCancelable & EventInfo & SelectionChangingInfo; /** * @docid _ui_select_box_SelectionChangedEvent diff --git a/packages/devextreme/js/ui/splitter.d.ts b/packages/devextreme/js/ui/splitter.d.ts index 4fdd1d4319b1..254726b90974 100644 --- a/packages/devextreme/js/ui/splitter.d.ts +++ b/packages/devextreme/js/ui/splitter.d.ts @@ -316,7 +316,7 @@ export type Properties< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onResize' | 'onResizeEnd' | 'onResizeStart' | 'onItemExpanded' | 'onItemCollapsed'>; diff --git a/packages/devextreme/js/ui/tab_panel.d.ts b/packages/devextreme/js/ui/tab_panel.d.ts index 2df6e746ece8..d01a1e036b35 100644 --- a/packages/devextreme/js/ui/tab_panel.d.ts +++ b/packages/devextreme/js/ui/tab_panel.d.ts @@ -14,6 +14,7 @@ import { InitializedEventInfo, ChangedOptionInfo, ItemInfo, + AsyncCancelable, } from '../events/index'; import { @@ -122,15 +123,9 @@ export type OptionChangedEvent = Event * @docid _ui_tab_panel_SelectionChangingEvent * @public * @type object - * @inherits EventInfo,SelectionChangingInfo + * @inherits AsyncCancelable,EventInfo,SelectionChangingInfo */ -export type SelectionChangingEvent = EventInfo> & SelectionChangingInfo & { - /** - * @docid _ui_tab_panel_SelectionChangingEvent.cancel - * @type Boolean|Promise - */ - cancel: boolean | PromiseLike; -}; +export type SelectionChangingEvent = AsyncCancelable & EventInfo> & SelectionChangingInfo; /** * @docid _ui_tab_panel_SelectionChangedEvent diff --git a/packages/devextreme/js/ui/tabs.d.ts b/packages/devextreme/js/ui/tabs.d.ts index 1dba44e25934..da1b4f0a48e5 100644 --- a/packages/devextreme/js/ui/tabs.d.ts +++ b/packages/devextreme/js/ui/tabs.d.ts @@ -6,6 +6,7 @@ import { InitializedEventInfo, ChangedOptionInfo, ItemInfo, + AsyncCancelable, } from '../events/index'; import CollectionWidget, { @@ -96,26 +97,20 @@ export type ItemRenderedEvent = EventI export type OptionChangedEvent = EventInfo> & ChangedOptionInfo; /** - * @docid _ui_tabs_SelectionChangedEvent + * @docid _ui_tabs_SelectionChangingEvent * @public * @type object - * @inherits EventInfo,SelectionChangedInfo + * @inherits AsyncCancelable,EventInfo,SelectionChangingInfo */ -export type SelectionChangedEvent = EventInfo> & SelectionChangedInfo; +export type SelectionChangingEvent = AsyncCancelable & EventInfo> & SelectionChangingInfo; /** - * @docid _ui_tabs_SelectionChangingEvent + * @docid _ui_tabs_SelectionChangedEvent * @public * @type object - * @inherits EventInfo,SelectionChangingInfo + * @inherits EventInfo,SelectionChangedInfo */ -export type SelectionChangingEvent = EventInfo> & SelectionChangingInfo & { - /** - * @docid _ui_tabs_SelectionChangingEvent.cancel - * @type Boolean|Promise - */ - cancel: boolean | PromiseLike; -}; +export type SelectionChangedEvent = EventInfo> & SelectionChangedInfo; /** * @deprecated use Properties instead @@ -336,15 +331,15 @@ onItemRendered?: ((e: ItemRenderedEvent) => void); * @type_function_param1 e:{ui/tabs:OptionChangedEvent} */ onOptionChanged?: ((e: OptionChangedEvent) => void); -/** - * @docid dxTabsOptions.onSelectionChanged - * @type_function_param1 e:{ui/tabs:SelectionChangedEvent} - */ -onSelectionChanged?: ((e: SelectionChangedEvent) => void); /** * @docid dxTabsOptions.onSelectionChanging * @type_function_param1 e:{ui/tabs:SelectionChangingEvent} */ onSelectionChanging?: ((e: SelectionChangingEvent) => void); +/** + * @docid dxTabsOptions.onSelectionChanged + * @type_function_param1 e:{ui/tabs:SelectionChangedEvent} + */ +onSelectionChanged?: ((e: SelectionChangedEvent) => void); }; ///#ENDDEBUG diff --git a/packages/devextreme/js/ui/tabs_types.d.ts b/packages/devextreme/js/ui/tabs_types.d.ts index 54a0cf722e87..6023597e2779 100644 --- a/packages/devextreme/js/ui/tabs_types.d.ts +++ b/packages/devextreme/js/ui/tabs_types.d.ts @@ -11,8 +11,8 @@ export { ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent, - SelectionChangedEvent, SelectionChangingEvent, + SelectionChangedEvent, dxTabsOptions, Item, Properties, diff --git a/packages/devextreme/js/ui/tag_box.d.ts b/packages/devextreme/js/ui/tag_box.d.ts index b2581c3eef54..9e6a06e99fc4 100644 --- a/packages/devextreme/js/ui/tag_box.d.ts +++ b/packages/devextreme/js/ui/tag_box.d.ts @@ -9,6 +9,7 @@ import { import { Cancelable, + AsyncCancelable, EventInfo, NativeEventInfo, InitializedEventInfo, @@ -195,15 +196,9 @@ export type SelectAllValueChangedEvent = EventInfo & { * @docid _ui_tag_box_SelectionChangingEvent * @public * @type object - * @inherits EventInfo,SelectionChangingInfo + * @inherits AsyncCancelable,EventInfo,SelectionChangingInfo */ -export type SelectionChangingEvent = EventInfo & SelectionChangingInfo & { - /** - * @docid _ui_tag_box_SelectionChangingEvent.cancel - * @type Boolean|Promise - */ - cancel: boolean | PromiseLike; -}; +export type SelectionChangingEvent = AsyncCancelable & EventInfo & SelectionChangingInfo; /** * @docid _ui_tag_box_SelectionChangedEvent diff --git a/packages/devextreme/js/ui/tile_view.d.ts b/packages/devextreme/js/ui/tile_view.d.ts index 47e3bad5ee1a..14e6acc8d1c2 100644 --- a/packages/devextreme/js/ui/tile_view.d.ts +++ b/packages/devextreme/js/ui/tile_view.d.ts @@ -245,7 +245,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/toolbar.d.ts b/packages/devextreme/js/ui/toolbar.d.ts index cf50670e2ee0..bd461cb7a2ee 100644 --- a/packages/devextreme/js/ui/toolbar.d.ts +++ b/packages/devextreme/js/ui/toolbar.d.ts @@ -237,7 +237,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/js/ui/validation_summary.d.ts b/packages/devextreme/js/ui/validation_summary.d.ts index 6b4a75021907..6b51ce56c76a 100644 --- a/packages/devextreme/js/ui/validation_summary.d.ts +++ b/packages/devextreme/js/ui/validation_summary.d.ts @@ -115,7 +115,7 @@ export type Options< // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required>; diff --git a/packages/devextreme/playground/jquery.html b/packages/devextreme/playground/jquery.html index fde766f17218..2c85adb315c7 100644 --- a/packages/devextreme/playground/jquery.html +++ b/packages/devextreme/playground/jquery.html @@ -17,6 +17,8 @@ + + @@ -39,6 +41,7 @@ --> + @@ -49,14 +52,102 @@

Te
+ +
+
+
+ +
+
Default
+
Hover
+
+
Focus
+
+
Active
+
+
Disabled
+
+
+ + diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index bb6c4598fa0c..e26512edea2a 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -6700,6 +6700,15 @@ declare module DevExpress.data.utils.odata { export var keyConverters: any; } declare module DevExpress.events { + /** + * [descr:AsyncCancelable] + */ + export interface AsyncCancelable { + /** + * [descr:AsyncCancelable.cancel] + */ + cancel: boolean | PromiseLike; + } /** * [descr:Cancelable] */ @@ -7960,6 +7969,13 @@ declare module DevExpress.ui { */ readonly removedItems: Array; } + /** + * [descr:SelectionChangingEvent] + */ + export type SelectionChangingEvent = + DevExpress.events.AsyncCancelable & + DevExpress.events.EventInfo & + SelectionChangingInfo; /** * [descr:SelectionChangingInfo] * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. @@ -7973,10 +7989,6 @@ declare module DevExpress.ui { * [descr:SelectionChangingInfo.removedItems] */ readonly removedItems: Array; - /** - * [descr:SelectionChangingInfo.cancel] - */ - cancel?: boolean | PromiseLike; } } /** @@ -8093,8 +8105,7 @@ declare module DevExpress.ui { * [descr:CollectionWidgetOptions.onSelectionChanging] */ onSelectionChanging?: ( - e: DevExpress.events.EventInfo & - DevExpress.ui.CollectionWidget.SelectionChangingInfo + e: DevExpress.ui.CollectionWidget.SelectionChangingEvent ) => void; /** * [descr:CollectionWidgetOptions.onSelectionChanged] @@ -8875,14 +8886,9 @@ declare module DevExpress.ui { /** * [descr:_ui_autocomplete_SelectionChangingEvent] */ - export type SelectionChangingEvent = + export type SelectionChangingEvent = DevExpress.events.AsyncCancelable & DevExpress.events.EventInfo & - DevExpress.ui.dxDropDownList.SelectionChangingInfo & { - /** - * [descr:_ui_autocomplete_SelectionChangingEvent.cancel] - */ - cancel: boolean | PromiseLike; - }; + DevExpress.ui.dxDropDownList.SelectionChangingInfo; /** * [descr:_ui_autocomplete_ValueChangedEvent] */ @@ -14870,13 +14876,9 @@ declare module DevExpress.ui { * [descr:_ui_drop_down_editor_ui_drop_down_list_SelectionChangingEvent] */ export type SelectionChangingEvent = - DevExpress.events.EventInfo & - SelectionChangingInfo & { - /** - * [descr:_ui_drop_down_editor_ui_drop_down_list_SelectionChangingEvent.cancel] - */ - cancel: boolean | PromiseLike; - }; + DevExpress.events.AsyncCancelable & + DevExpress.events.EventInfo & + SelectionChangingInfo; /** * [descr:_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo] * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. @@ -14931,6 +14933,12 @@ declare module DevExpress.ui { > & DevExpress.events.ItemInfo ) => void; + /** + * [descr:dxDropDownListOptions.onSelectionChanging] + */ + onSelectionChanging?: ( + e: DevExpress.ui.dxDropDownList.SelectionChangingEvent + ) => void; /** * [descr:dxDropDownListOptions.onSelectionChanged] */ @@ -14938,12 +14946,6 @@ declare module DevExpress.ui { e: DevExpress.events.EventInfo & DevExpress.ui.dxDropDownList.SelectionChangedInfo ) => void; - /** - * [descr:dxDropDownListOptions.onSelectionChanging] - */ - onSelectionChanging?: ( - e: DevExpress.ui.dxDropDownList.SelectionChangingEvent - ) => void; /** * [descr:dxDropDownListOptions.onValueChanged] */ @@ -19911,13 +19913,9 @@ declare module DevExpress.ui { export type SelectionChangingEvent< TItem extends ItemLike = any, TKey = any - > = DevExpress.events.EventInfo> & - DevExpress.ui.CollectionWidget.SelectionChangingInfo & { - /** - * [descr:_ui_list_SelectionChangingEvent.cancel] - */ - cancel: boolean | PromiseLike; - }; + > = DevExpress.events.AsyncCancelable & + DevExpress.events.EventInfo> & + DevExpress.ui.CollectionWidget.SelectionChangingInfo; } /** * @deprecated Use Item instead @@ -20391,13 +20389,9 @@ declare module DevExpress.ui { /** * [descr:_ui_lookup_SelectionChangingEvent] */ - export type SelectionChangingEvent = DevExpress.events.EventInfo & - DevExpress.ui.dxDropDownList.SelectionChangingInfo & { - /** - * [descr:_ui_lookup_SelectionChangingEvent.cancel] - */ - cancel: boolean | PromiseLike; - }; + export type SelectionChangingEvent = DevExpress.events.AsyncCancelable & + DevExpress.events.EventInfo & + DevExpress.ui.dxDropDownList.SelectionChangingInfo; export type TitleRenderedEvent = DevExpress.events.EventInfo & DevExpress.ui.dxPopup.TitleRenderedInfo; /** @@ -24973,14 +24967,9 @@ declare module DevExpress.ui { /** * [descr:_ui_select_box_SelectionChangingEvent] */ - export type SelectionChangingEvent = + export type SelectionChangingEvent = DevExpress.events.AsyncCancelable & DevExpress.events.EventInfo & - DevExpress.ui.dxDropDownList.SelectionChangingInfo & { - /** - * [descr:_ui_select_box_SelectionChangingEvent.cancel] - */ - cancel: boolean | PromiseLike; - }; + DevExpress.ui.dxDropDownList.SelectionChangingInfo; /** * [descr:_ui_select_box_ValueChangedEvent] */ @@ -26095,13 +26084,9 @@ declare module DevExpress.ui { export type SelectionChangingEvent< TItem extends ItemLike = any, TKey = any - > = DevExpress.events.EventInfo> & - DevExpress.ui.CollectionWidget.SelectionChangingInfo & { - /** - * [descr:_ui_tab_panel_SelectionChangingEvent.cancel] - */ - cancel: boolean | PromiseLike; - }; + > = DevExpress.events.AsyncCancelable & + DevExpress.events.EventInfo> & + DevExpress.ui.CollectionWidget.SelectionChangingInfo; /** * [descr:TabPanelItemInfo] * @deprecated Attention! This type is for internal purposes only. If you used it previously, please submit a ticket to our {@link https://supportcenter.devexpress.com/ticket/create Support Center}. We will check if there is an alternative solution. @@ -26374,13 +26359,9 @@ declare module DevExpress.ui { export type SelectionChangingEvent< TItem extends ItemLike = any, TKey = any - > = DevExpress.events.EventInfo> & - DevExpress.ui.CollectionWidget.SelectionChangingInfo & { - /** - * [descr:_ui_tabs_SelectionChangingEvent.cancel] - */ - cancel: boolean | PromiseLike; - }; + > = DevExpress.events.AsyncCancelable & + DevExpress.events.EventInfo> & + DevExpress.ui.CollectionWidget.SelectionChangingInfo; } /** * [descr:dxTabsOptions] @@ -26599,15 +26580,11 @@ declare module DevExpress.ui { /** * [descr:_ui_tag_box_SelectionChangingEvent] */ - export type SelectionChangingEvent = DevExpress.events.EventInfo & + export type SelectionChangingEvent = DevExpress.events.AsyncCancelable & + DevExpress.events.EventInfo & DevExpress.ui.CollectionWidget.SelectionChangingInfo< string | number | any - > & { - /** - * [descr:_ui_tag_box_SelectionChangingEvent.cancel] - */ - cancel: boolean | PromiseLike; - }; + >; /** * [descr:_ui_tag_box_ValueChangedEvent] */ From 1fa8c0c844e04a8a51f1e9873b3a7dff198a0102 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:09:07 +0300 Subject: [PATCH 4/6] fix validate-declarations --- packages/devextreme/js/events/index.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/devextreme/js/events/index.d.ts b/packages/devextreme/js/events/index.d.ts index bdbe56b874c5..7ed6b3618a91 100644 --- a/packages/devextreme/js/events/index.d.ts +++ b/packages/devextreme/js/events/index.d.ts @@ -114,7 +114,10 @@ export interface Cancelable { * @public */ export interface AsyncCancelable { - /** @docid */ + /** + * @docid + * @type boolean|Promise + */ cancel: boolean | PromiseLike; } From 3272e72e3af9d2c91ff66755a3d34a9328a25186 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:53:20 +0300 Subject: [PATCH 5/6] lookup: correct docs inheritance (SelectionChangedInfo from ddl) --- packages/devextreme/js/ui/lookup.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devextreme/js/ui/lookup.d.ts b/packages/devextreme/js/ui/lookup.d.ts index c874df66212e..b86ea9ef44b8 100644 --- a/packages/devextreme/js/ui/lookup.d.ts +++ b/packages/devextreme/js/ui/lookup.d.ts @@ -132,7 +132,7 @@ export type ScrollEvent = NativeEventInfo & Scroll * @docid _ui_lookup_SelectionChangingEvent * @public * @type object - * @inherits AsyncCancelable,EventInfo,SelectionChangingInfo + * @inherits AsyncCancelable,EventInfo,_ui_drop_down_editor_ui_drop_down_list_SelectionChangingInfo */ export type SelectionChangingEvent = AsyncCancelable & EventInfo & SelectionChangingInfo; @@ -140,7 +140,7 @@ export type SelectionChangingEvent = AsyncCancelable & EventInfo & Sel * @docid _ui_lookup_SelectionChangedEvent * @public * @type object - * @inherits EventInfo,SelectionChangedInfo + * @inherits EventInfo,_ui_drop_down_editor_ui_drop_down_list_SelectionChangedInfo */ export type SelectionChangedEvent = EventInfo & SelectionChangedInfo; From 8865f7bbb21260b459f8894da67241bbb4e127e5 Mon Sep 17 00:00:00 2001 From: Mikhail Preyskurantov <5574159+mpreyskurantov@users.noreply.github.com> Date: Fri, 30 Aug 2024 17:58:28 +0300 Subject: [PATCH 6/6] clean up --- packages/devextreme/js/events/index.d.ts | 4 ++-- packages/devextreme/js/ui/menu.d.ts | 2 +- packages/devextreme/js/ui/toolbar.js | 1 - packages/devextreme/ts/dx.all.d.ts | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/devextreme/js/events/index.d.ts b/packages/devextreme/js/events/index.d.ts index 7ed6b3618a91..999a80e69b94 100644 --- a/packages/devextreme/js/events/index.d.ts +++ b/packages/devextreme/js/events/index.d.ts @@ -113,13 +113,13 @@ export interface Cancelable { * @docid * @public */ -export interface AsyncCancelable { +export type AsyncCancelable = { /** * @docid * @type boolean|Promise */ cancel: boolean | PromiseLike; -} +}; /** @deprecated EventObject */ export type dxEvent = EventObject; diff --git a/packages/devextreme/js/ui/menu.d.ts b/packages/devextreme/js/ui/menu.d.ts index 7b88337ca069..259bfd71bee0 100644 --- a/packages/devextreme/js/ui/menu.d.ts +++ b/packages/devextreme/js/ui/menu.d.ts @@ -406,7 +406,7 @@ export type Options = Properties; // eslint-disable-next-line import/first import { CheckedEvents } from '../core'; -type FilterOutHidden = Omit; +type FilterOutHidden = Omit; type EventsIntegrityCheckingHelper = CheckedEvents, Required, 'onSubmenuHidden' | 'onSubmenuHiding' | 'onSubmenuShowing' | 'onSubmenuShown'>; diff --git a/packages/devextreme/js/ui/toolbar.js b/packages/devextreme/js/ui/toolbar.js index 0a3e31f70e7d..e96cebec5f62 100644 --- a/packages/devextreme/js/ui/toolbar.js +++ b/packages/devextreme/js/ui/toolbar.js @@ -68,7 +68,6 @@ export default Toolbar; * @hidden */ - /** * @name dxToolbarOptions.onSelectionChanged * @action diff --git a/packages/devextreme/ts/dx.all.d.ts b/packages/devextreme/ts/dx.all.d.ts index e26512edea2a..b277e626a6e3 100644 --- a/packages/devextreme/ts/dx.all.d.ts +++ b/packages/devextreme/ts/dx.all.d.ts @@ -6703,12 +6703,12 @@ declare module DevExpress.events { /** * [descr:AsyncCancelable] */ - export interface AsyncCancelable { + export type AsyncCancelable = { /** * [descr:AsyncCancelable.cancel] */ cancel: boolean | PromiseLike; - } + }; /** * [descr:Cancelable] */