Skip to content

Commit 00909a4

Browse files
authored
CardView: Fix "onSaved" and "onSaving" options (T1314094) (#31791)
1 parent 6cb7ff1 commit 00909a4

File tree

6 files changed

+73
-73
lines changed

6 files changed

+73
-73
lines changed

packages/devextreme-angular/src/ui/card-view/index.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
export { ExplicitTypes } from 'devextreme/ui/card_view';
2525

2626
import DataSource from 'devextreme/data/data_source';
27-
import { CardCover, CardHeader, ColumnProperties, dxCardViewEditing, HeaderPanel, CardClickEvent, CardDblClickEvent, CardHoverChangedEvent, CardInsertedEvent, CardInsertingEvent, CardPreparedEvent, CardRemovedEvent, CardRemovingEvent, CardSavedEvent, CardSavingEvent, CardUpdatedEvent, CardUpdatingEvent, ContextMenuPreparingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, FieldCaptionClickEvent, FieldCaptionDblClickEvent, FieldCaptionPreparedEvent, FieldValueClickEvent, FieldValueDblClickEvent, FieldValuePreparedEvent, FocusedCardChanged, InitNewCardEvent, SelectionChangedEvent, Paging, RemoteOperations, SelectionConfiguration, dxCardViewToolbar } from 'devextreme/ui/card_view';
27+
import { CardCover, CardHeader, ColumnProperties, dxCardViewEditing, HeaderPanel, CardClickEvent, CardDblClickEvent, CardHoverChangedEvent, CardInsertedEvent, CardInsertingEvent, CardPreparedEvent, CardRemovedEvent, CardRemovingEvent, CardUpdatedEvent, CardUpdatingEvent, ContextMenuPreparingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, FieldCaptionClickEvent, FieldCaptionDblClickEvent, FieldCaptionPreparedEvent, FieldValueClickEvent, FieldValueDblClickEvent, FieldValuePreparedEvent, FocusedCardChanged, InitNewCardEvent, SavedEvent, SavingEvent, SelectionChangedEvent, Paging, RemoteOperations, SelectionConfiguration, dxCardViewToolbar } from 'devextreme/ui/card_view';
2828
import { Mode, ScrollbarMode } from 'devextreme/common';
2929
import { ColumnChooser, FilterPanel, HeaderFilter, Pager, SearchPanel, Sorting } from 'devextreme/common/grids';
3030
import { DataSourceOptions } from 'devextreme/data/data_source';
@@ -727,22 +727,6 @@ export class DxCardViewComponent<TCardData = any, TKey = any> extends DxComponen
727727
* [descr:undefined]
728728
729729
730-
*/
731-
@Output() onCardSaved: EventEmitter<CardSavedEvent>;
732-
733-
/**
734-
735-
* [descr:undefined]
736-
737-
738-
*/
739-
@Output() onCardSaving: EventEmitter<CardSavingEvent>;
740-
741-
/**
742-
743-
* [descr:undefined]
744-
745-
746730
*/
747731
@Output() onCardUpdated: EventEmitter<CardUpdatedEvent>;
748732

@@ -895,6 +879,22 @@ export class DxCardViewComponent<TCardData = any, TKey = any> extends DxComponen
895879
* [descr:undefined]
896880
897881
882+
*/
883+
@Output() onSaved: EventEmitter<SavedEvent>;
884+
885+
/**
886+
887+
* [descr:undefined]
888+
889+
890+
*/
891+
@Output() onSaving: EventEmitter<SavingEvent>;
892+
893+
/**
894+
895+
* [descr:undefined]
896+
897+
898898
*/
899899
@Output() onSelectionChanged: EventEmitter<SelectionChangedEvent>;
900900

@@ -1248,8 +1248,6 @@ export class DxCardViewComponent<TCardData = any, TKey = any> extends DxComponen
12481248
{ subscribe: 'cardPrepared', emit: 'onCardPrepared' },
12491249
{ subscribe: 'cardRemoved', emit: 'onCardRemoved' },
12501250
{ subscribe: 'cardRemoving', emit: 'onCardRemoving' },
1251-
{ subscribe: 'cardSaved', emit: 'onCardSaved' },
1252-
{ subscribe: 'cardSaving', emit: 'onCardSaving' },
12531251
{ subscribe: 'cardUpdated', emit: 'onCardUpdated' },
12541252
{ subscribe: 'cardUpdating', emit: 'onCardUpdating' },
12551253
{ subscribe: 'contentReady', emit: 'onContentReady' },
@@ -1269,6 +1267,8 @@ export class DxCardViewComponent<TCardData = any, TKey = any> extends DxComponen
12691267
{ subscribe: 'initialized', emit: 'onInitialized' },
12701268
{ subscribe: 'initNewCard', emit: 'onInitNewCard' },
12711269
{ subscribe: 'optionChanged', emit: 'onOptionChanged' },
1270+
{ subscribe: 'saved', emit: 'onSaved' },
1271+
{ subscribe: 'saving', emit: 'onSaving' },
12721272
{ subscribe: 'selectionChanged', emit: 'onSelectionChanged' },
12731273
{ emit: 'accessKeyChange' },
12741274
{ emit: 'activeStateEnabledChange' },

packages/devextreme-react/src/card-view.ts

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

12-
import type { CardClickEvent, CardDblClickEvent, CardInsertedEvent, CardInsertingEvent, CardPreparedEvent, CardRemovedEvent, CardRemovingEvent, CardSavedEvent, CardSavingEvent, CardUpdatedEvent, CardUpdatingEvent, ContextMenuPreparingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, FieldCaptionClickEvent, FieldCaptionDblClickEvent, FieldCaptionPreparedEvent, FieldValueClickEvent, FieldValueDblClickEvent, FieldValuePreparedEvent, InitNewCardEvent, CardTemplateData, CardHeaderItem as CardViewCardHeaderItem, CardHeaderPredefinedItem, FieldTemplateData, ColumnTemplateData, EditingTexts as CardViewEditingTexts, PredefinedToolbarItem, dxCardViewToolbarItem } from "devextreme/ui/card_view";
12+
import type { CardClickEvent, CardDblClickEvent, CardInsertedEvent, CardInsertingEvent, CardPreparedEvent, CardRemovedEvent, CardRemovingEvent, CardUpdatedEvent, CardUpdatingEvent, ContextMenuPreparingEvent, EditCanceledEvent, EditCancelingEvent, EditingStartEvent, FieldCaptionClickEvent, FieldCaptionDblClickEvent, FieldCaptionPreparedEvent, FieldValueClickEvent, FieldValueDblClickEvent, FieldValuePreparedEvent, InitNewCardEvent, SavedEvent, SavingEvent, CardTemplateData, CardHeaderItem as CardViewCardHeaderItem, CardHeaderPredefinedItem, FieldTemplateData, ColumnTemplateData, EditingTexts as CardViewEditingTexts, PredefinedToolbarItem, dxCardViewToolbarItem } from "devextreme/ui/card_view";
1313
import type { AnimationConfig, CollisionResolution, PositionConfig, AnimationState, AnimationType, CollisionResolutionCombination } from "devextreme/common/core/animation";
1414
import type { ValidationRuleType, HorizontalAlignment, VerticalAlignment, ButtonStyle, template, ButtonType, ToolbarItemLocation, ToolbarItemComponent, SearchMode, SingleMultipleOrNone, SelectAllMode, DataType, Format as CommonFormat, SortOrder, ComparisonOperator, DragHighlight, Mode, Direction, PositionAlignment, DisplayMode, ScrollbarMode, TabsIconPosition, TabsStyle, Position as CommonPosition } from "devextreme/common";
1515
import type { dxButtonOptions, ClickEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, OptionChangedEvent } from "devextreme/ui/button";
@@ -44,8 +44,6 @@ type ICardViewOptionsNarrowedEvents<TCardData = any, TKey = any> = {
4444
onCardPrepared?: ((e: CardPreparedEvent) => void);
4545
onCardRemoved?: ((e: CardRemovedEvent<TCardData, TKey>) => void);
4646
onCardRemoving?: ((e: CardRemovingEvent<TCardData, TKey>) => void);
47-
onCardSaved?: ((e: CardSavedEvent) => void);
48-
onCardSaving?: ((e: CardSavingEvent) => void);
4947
onCardUpdated?: ((e: CardUpdatedEvent<TCardData, TKey>) => void);
5048
onCardUpdating?: ((e: CardUpdatingEvent<TCardData, TKey>) => void);
5149
onContextMenuPreparing?: ((e: ContextMenuPreparingEvent<TCardData>) => void);
@@ -59,6 +57,8 @@ type ICardViewOptionsNarrowedEvents<TCardData = any, TKey = any> = {
5957
onFieldValueDblClick?: ((e: FieldValueDblClickEvent) => void);
6058
onFieldValuePrepared?: ((e: FieldValuePreparedEvent) => void);
6159
onInitNewCard?: ((e: InitNewCardEvent<TCardData>) => void);
60+
onSaved?: ((e: SavedEvent) => void);
61+
onSaving?: ((e: SavingEvent) => void);
6262
}
6363

6464
type ICardViewOptions<TCardData = any, TKey = any> = React.PropsWithChildren<ReplaceFieldTypes<Properties<TCardData, TKey>, ICardViewOptionsNarrowedEvents<TCardData, TKey>> & IHtmlOptions & {
@@ -95,7 +95,7 @@ const CardView = memo(
9595
), []);
9696

9797
const subscribableOptions = useMemo(() => (["filterValue","selectedCardKeys","filterBuilder.value","filterPanel.filterEnabled","editing.form.formData","loadPanel.position","loadPanel.visible","paging.pageIndex","paging.pageSize","searchPanel.text"]), []);
98-
const independentEvents = useMemo(() => (["onCardClick","onCardDblClick","onCardInserted","onCardInserting","onCardPrepared","onCardRemoved","onCardRemoving","onCardSaved","onCardSaving","onCardUpdated","onCardUpdating","onContentReady","onContextMenuPreparing","onDataErrorOccurred","onDisposing","onEditCanceled","onEditCanceling","onEditingStart","onFieldCaptionClick","onFieldCaptionDblClick","onFieldCaptionPrepared","onFieldValueClick","onFieldValueDblClick","onFieldValuePrepared","onInitialized","onInitNewCard"]), []);
98+
const independentEvents = useMemo(() => (["onCardClick","onCardDblClick","onCardInserted","onCardInserting","onCardPrepared","onCardRemoved","onCardRemoving","onCardUpdated","onCardUpdating","onContentReady","onContextMenuPreparing","onDataErrorOccurred","onDisposing","onEditCanceled","onEditCanceling","onEditingStart","onFieldCaptionClick","onFieldCaptionDblClick","onFieldCaptionPrepared","onFieldValueClick","onFieldValueDblClick","onFieldValuePrepared","onInitialized","onInitNewCard","onSaved","onSaving"]), []);
9999

100100
const defaults = useMemo(() => ({
101101
defaultFilterValue: "filterValue",

packages/devextreme-vue/src/card-view.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ import {
1919
CardPreparedEvent,
2020
CardRemovedEvent,
2121
CardRemovingEvent,
22-
CardSavedEvent,
23-
CardSavingEvent,
2422
CardUpdatedEvent,
2523
CardUpdatingEvent,
2624
ContextMenuPreparingEvent,
@@ -35,6 +33,8 @@ import {
3533
FieldValuePreparedEvent,
3634
FocusedCardChanged,
3735
InitNewCardEvent,
36+
SavedEvent,
37+
SavingEvent,
3838
SelectionChangedEvent,
3939
Paging,
4040
RemoteOperations,
@@ -250,8 +250,6 @@ type AccessibleOptions = Pick<Properties,
250250
"onCardPrepared" |
251251
"onCardRemoved" |
252252
"onCardRemoving" |
253-
"onCardSaved" |
254-
"onCardSaving" |
255253
"onCardUpdated" |
256254
"onCardUpdating" |
257255
"onContentReady" |
@@ -271,6 +269,8 @@ type AccessibleOptions = Pick<Properties,
271269
"onInitialized" |
272270
"onInitNewCard" |
273271
"onOptionChanged" |
272+
"onSaved" |
273+
"onSaving" |
274274
"onSelectionChanged" |
275275
"pager" |
276276
"paging" |
@@ -335,8 +335,6 @@ const componentConfig = {
335335
onCardPrepared: Function as PropType<((e: CardPreparedEvent) => void)>,
336336
onCardRemoved: Function as PropType<((e: CardRemovedEvent) => void)>,
337337
onCardRemoving: Function as PropType<((e: CardRemovingEvent) => void)>,
338-
onCardSaved: Function as PropType<((e: CardSavedEvent) => void)>,
339-
onCardSaving: Function as PropType<((e: CardSavingEvent) => void)>,
340338
onCardUpdated: Function as PropType<((e: CardUpdatedEvent) => void)>,
341339
onCardUpdating: Function as PropType<((e: CardUpdatingEvent) => void)>,
342340
onContentReady: Function as PropType<((e: EventInfo<any>) => void)>,
@@ -356,6 +354,8 @@ const componentConfig = {
356354
onInitialized: Function as PropType<((e: { component: Component<any>, element: any }) => void)>,
357355
onInitNewCard: Function as PropType<((e: InitNewCardEvent) => void)>,
358356
onOptionChanged: Function as PropType<((e: { component: DOMComponent, element: any, fullName: string, model: any, name: string, previousValue: any, value: any }) => void)>,
357+
onSaved: Function as PropType<((e: SavedEvent) => void)>,
358+
onSaving: Function as PropType<((e: SavingEvent) => void)>,
359359
onSelectionChanged: Function as PropType<((e: SelectionChangedEvent) => void)>,
360360
pager: Object as PropType<Pager | Record<string, any> | PagerBase>,
361361
paging: Object as PropType<Paging | Record<string, any>>,
@@ -416,8 +416,6 @@ const componentConfig = {
416416
"update:onCardPrepared": null,
417417
"update:onCardRemoved": null,
418418
"update:onCardRemoving": null,
419-
"update:onCardSaved": null,
420-
"update:onCardSaving": null,
421419
"update:onCardUpdated": null,
422420
"update:onCardUpdating": null,
423421
"update:onContentReady": null,
@@ -437,6 +435,8 @@ const componentConfig = {
437435
"update:onInitialized": null,
438436
"update:onInitNewCard": null,
439437
"update:onOptionChanged": null,
438+
"update:onSaved": null,
439+
"update:onSaving": null,
440440
"update:onSelectionChanged": null,
441441
"update:pager": null,
442442
"update:paging": null,

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,34 +1126,34 @@ export type CardUpdatingEvent<TCardData = unknown, TKey = unknown> = EventInfo<d
11261126
};
11271127

11281128
/**
1129-
* @docid _ui_card_view_CardSavedEvent
1129+
* @docid _ui_card_view_SavedEvent
11301130
* @public
11311131
* @type object
11321132
* @inherits EventInfo
11331133
*/
1134-
export type CardSavedEvent = EventInfo<dxCardView> & {
1134+
export type SavedEvent = EventInfo<dxCardView> & {
11351135
/**
1136-
* @docid _ui_card_view_CardSavedEvent.changes
1136+
* @docid _ui_card_view_SavedEvent.changes
11371137
* @public
11381138
*/
11391139
changes: DataChange[];
11401140
};
11411141

11421142
/**
1143-
* @docid _ui_card_view_CardSavingEvent
1143+
* @docid _ui_card_view_SavingEvent
11441144
* @public
11451145
* @type object
11461146
* @inherits EventInfo,Cancelable
11471147
*/
1148-
export type CardSavingEvent = EventInfo<dxCardView> & Cancelable & {
1148+
export type SavingEvent = EventInfo<dxCardView> & Cancelable & {
11491149
/**
1150-
* @docid _ui_card_view_CardSavingEvent.promise
1150+
* @docid _ui_card_view_SavingEvent.promise
11511151
* @type Promise<void>
11521152
* @public
11531153
*/
11541154
promise?: PromiseLike<void>;
11551155
/**
1156-
* @docid _ui_card_view_CardSavingEvent.changes
1156+
* @docid _ui_card_view_SavingEvent.changes
11571157
* @public
11581158
*/
11591159
changes: DataChange[];
@@ -1689,17 +1689,17 @@ export interface dxCardViewOptions<TCardData = unknown, TKey = unknown> extends
16891689
/**
16901690
* @docid
16911691
* @public
1692-
* @type_function_param1 e:{ui/card_view:CardSavedEvent}
1692+
* @type_function_param1 e:{ui/card_view:SavedEvent}
16931693
* @action
16941694
*/
1695-
onCardSaved?: (e: CardSavedEvent) => void;
1695+
onSaved?: (e: SavedEvent) => void;
16961696
/**
16971697
* @docid
16981698
* @public
1699-
* @type_function_param1 e:{ui/card_view:CardSavingEvent}
1699+
* @type_function_param1 e:{ui/card_view:SavingEvent}
17001700
* @action
17011701
*/
1702-
onCardSaving?: (e: CardSavingEvent) => void;
1702+
onSaving?: (e: SavingEvent) => void;
17031703

17041704
// #endregion
17051705

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export {
3838
CardRemovingEvent,
3939
CardUpdatedEvent,
4040
CardUpdatingEvent,
41-
CardSavedEvent,
42-
CardSavingEvent,
41+
SavedEvent,
42+
SavingEvent,
4343
SelectionConfiguration,
4444
SelectionChangedEvent,
4545
ContextMenuTarget,

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

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10399,31 +10399,6 @@ declare module DevExpress.ui {
1039910399
*/
1040010400
key: TKey;
1040110401
};
10402-
/**
10403-
* [descr:_ui_card_view_CardSavedEvent]
10404-
*/
10405-
export type CardSavedEvent =
10406-
DevExpress.common.core.events.EventInfo<dxCardView> & {
10407-
/**
10408-
* [descr:_ui_card_view_CardSavedEvent.changes]
10409-
*/
10410-
changes: DevExpress.common.grids.DataChange[];
10411-
};
10412-
/**
10413-
* [descr:_ui_card_view_CardSavingEvent]
10414-
*/
10415-
export type CardSavingEvent =
10416-
DevExpress.common.core.events.EventInfo<dxCardView> &
10417-
DevExpress.common.core.events.Cancelable & {
10418-
/**
10419-
* [descr:_ui_card_view_CardSavingEvent.promise]
10420-
*/
10421-
promise?: PromiseLike<void>;
10422-
/**
10423-
* [descr:_ui_card_view_CardSavingEvent.changes]
10424-
*/
10425-
changes: DevExpress.common.grids.DataChange[];
10426-
};
1042710402
/**
1042810403
* [descr:CardTemplateData]
1042910404
*/
@@ -10678,6 +10653,31 @@ declare module DevExpress.ui {
1067810653
TCardData = unknown,
1067910654
TKey = unknown
1068010655
> = dxCardViewOptions<TCardData, TKey>;
10656+
/**
10657+
* [descr:_ui_card_view_SavedEvent]
10658+
*/
10659+
export type SavedEvent =
10660+
DevExpress.common.core.events.EventInfo<dxCardView> & {
10661+
/**
10662+
* [descr:_ui_card_view_SavedEvent.changes]
10663+
*/
10664+
changes: DevExpress.common.grids.DataChange[];
10665+
};
10666+
/**
10667+
* [descr:_ui_card_view_SavingEvent]
10668+
*/
10669+
export type SavingEvent =
10670+
DevExpress.common.core.events.EventInfo<dxCardView> &
10671+
DevExpress.common.core.events.Cancelable & {
10672+
/**
10673+
* [descr:_ui_card_view_SavingEvent.promise]
10674+
*/
10675+
promise?: PromiseLike<void>;
10676+
/**
10677+
* [descr:_ui_card_view_SavingEvent.changes]
10678+
*/
10679+
changes: DevExpress.common.grids.DataChange[];
10680+
};
1068110681
/**
1068210682
* [descr:_ui_card_view_SelectionChangedEvent]
1068310683
*/
@@ -11082,13 +11082,13 @@ declare module DevExpress.ui {
1108211082
*/
1108311083
onCardUpdating?: (e: DevExpress.ui.dxCardView.CardUpdatingEvent) => void;
1108411084
/**
11085-
* [descr:dxCardViewOptions.onCardSaved]
11085+
* [descr:dxCardViewOptions.onSaved]
1108611086
*/
11087-
onCardSaved?: (e: DevExpress.ui.dxCardView.CardSavedEvent) => void;
11087+
onSaved?: (e: DevExpress.ui.dxCardView.SavedEvent) => void;
1108811088
/**
11089-
* [descr:dxCardViewOptions.onCardSaving]
11089+
* [descr:dxCardViewOptions.onSaving]
1109011090
*/
11091-
onCardSaving?: (e: DevExpress.ui.dxCardView.CardSavingEvent) => void;
11091+
onSaving?: (e: DevExpress.ui.dxCardView.SavingEvent) => void;
1109211092

1109311093
/**
1109411094
* [descr:dxCardViewOptions.selectedCardKeys]

0 commit comments

Comments
 (0)