Skip to content

Commit f4a6b57

Browse files
authored
CardView: Fix "onSaved" and "onSaving" options (T1314094) (#31791) (#31818)
1 parent 147135b commit f4a6b57

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';
@@ -725,22 +725,6 @@ export class DxCardViewComponent<TCardData = any, TKey = any> extends DxComponen
725725
* [descr:undefined]
726726
727727
728-
*/
729-
@Output() onCardSaved: EventEmitter<CardSavedEvent>;
730-
731-
/**
732-
733-
* [descr:undefined]
734-
735-
736-
*/
737-
@Output() onCardSaving: EventEmitter<CardSavingEvent>;
738-
739-
/**
740-
741-
* [descr:undefined]
742-
743-
744728
*/
745729
@Output() onCardUpdated: EventEmitter<CardUpdatedEvent>;
746730

@@ -893,6 +877,22 @@ export class DxCardViewComponent<TCardData = any, TKey = any> extends DxComponen
893877
* [descr:undefined]
894878
895879
880+
*/
881+
@Output() onSaved: EventEmitter<SavedEvent>;
882+
883+
/**
884+
885+
* [descr:undefined]
886+
887+
888+
*/
889+
@Output() onSaving: EventEmitter<SavingEvent>;
890+
891+
/**
892+
893+
* [descr:undefined]
894+
895+
896896
*/
897897
@Output() onSelectionChanged: EventEmitter<SelectionChangedEvent>;
898898

@@ -1246,8 +1246,6 @@ export class DxCardViewComponent<TCardData = any, TKey = any> extends DxComponen
12461246
{ subscribe: 'cardPrepared', emit: 'onCardPrepared' },
12471247
{ subscribe: 'cardRemoved', emit: 'onCardRemoved' },
12481248
{ subscribe: 'cardRemoving', emit: 'onCardRemoving' },
1249-
{ subscribe: 'cardSaved', emit: 'onCardSaved' },
1250-
{ subscribe: 'cardSaving', emit: 'onCardSaving' },
12511249
{ subscribe: 'cardUpdated', emit: 'onCardUpdated' },
12521250
{ subscribe: 'cardUpdating', emit: 'onCardUpdating' },
12531251
{ subscribe: 'contentReady', emit: 'onContentReady' },
@@ -1267,6 +1265,8 @@ export class DxCardViewComponent<TCardData = any, TKey = any> extends DxComponen
12671265
{ subscribe: 'initialized', emit: 'onInitialized' },
12681266
{ subscribe: 'initNewCard', emit: 'onInitNewCard' },
12691267
{ subscribe: 'optionChanged', emit: 'onOptionChanged' },
1268+
{ subscribe: 'saved', emit: 'onSaved' },
1269+
{ subscribe: 'saving', emit: 'onSaving' },
12701270
{ subscribe: 'selectionChanged', emit: 'onSelectionChanged' },
12711271
{ emit: 'accessKeyChange' },
12721272
{ 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";
@@ -42,8 +42,6 @@ type ICardViewOptionsNarrowedEvents<TCardData = any, TKey = any> = {
4242
onCardPrepared?: ((e: CardPreparedEvent) => void);
4343
onCardRemoved?: ((e: CardRemovedEvent<TCardData, TKey>) => void);
4444
onCardRemoving?: ((e: CardRemovingEvent<TCardData, TKey>) => void);
45-
onCardSaved?: ((e: CardSavedEvent) => void);
46-
onCardSaving?: ((e: CardSavingEvent) => void);
4745
onCardUpdated?: ((e: CardUpdatedEvent<TCardData, TKey>) => void);
4846
onCardUpdating?: ((e: CardUpdatingEvent<TCardData, TKey>) => void);
4947
onContextMenuPreparing?: ((e: ContextMenuPreparingEvent<TCardData>) => void);
@@ -57,6 +55,8 @@ type ICardViewOptionsNarrowedEvents<TCardData = any, TKey = any> = {
5755
onFieldValueDblClick?: ((e: FieldValueDblClickEvent) => void);
5856
onFieldValuePrepared?: ((e: FieldValuePreparedEvent) => void);
5957
onInitNewCard?: ((e: InitNewCardEvent<TCardData>) => void);
58+
onSaved?: ((e: SavedEvent) => void);
59+
onSaving?: ((e: SavingEvent) => void);
6060
}
6161

6262
type ICardViewOptions<TCardData = any, TKey = any> = React.PropsWithChildren<ReplaceFieldTypes<Properties<TCardData, TKey>, ICardViewOptionsNarrowedEvents<TCardData, TKey>> & IHtmlOptions & {
@@ -93,7 +93,7 @@ const CardView = memo(
9393
), []);
9494

9595
const subscribableOptions = useMemo(() => (["filterValue","selectedCardKeys","filterBuilder.value","filterPanel.filterEnabled","editing.form.formData","loadPanel.position","loadPanel.visible","paging.pageIndex","paging.pageSize","searchPanel.text"]), []);
96-
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"]), []);
96+
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"]), []);
9797

9898
const defaults = useMemo(() => ({
9999
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,
@@ -240,8 +240,6 @@ type AccessibleOptions = Pick<Properties,
240240
"onCardPrepared" |
241241
"onCardRemoved" |
242242
"onCardRemoving" |
243-
"onCardSaved" |
244-
"onCardSaving" |
245243
"onCardUpdated" |
246244
"onCardUpdating" |
247245
"onContentReady" |
@@ -261,6 +259,8 @@ type AccessibleOptions = Pick<Properties,
261259
"onInitialized" |
262260
"onInitNewCard" |
263261
"onOptionChanged" |
262+
"onSaved" |
263+
"onSaving" |
264264
"onSelectionChanged" |
265265
"pager" |
266266
"paging" |
@@ -325,8 +325,6 @@ const componentConfig = {
325325
onCardPrepared: Function as PropType<((e: CardPreparedEvent) => void)>,
326326
onCardRemoved: Function as PropType<((e: CardRemovedEvent) => void)>,
327327
onCardRemoving: Function as PropType<((e: CardRemovingEvent) => void)>,
328-
onCardSaved: Function as PropType<((e: CardSavedEvent) => void)>,
329-
onCardSaving: Function as PropType<((e: CardSavingEvent) => void)>,
330328
onCardUpdated: Function as PropType<((e: CardUpdatedEvent) => void)>,
331329
onCardUpdating: Function as PropType<((e: CardUpdatingEvent) => void)>,
332330
onContentReady: Function as PropType<((e: EventInfo<any>) => void)>,
@@ -346,6 +344,8 @@ const componentConfig = {
346344
onInitialized: Function as PropType<((e: { component: Component<any>, element: any }) => void)>,
347345
onInitNewCard: Function as PropType<((e: InitNewCardEvent) => void)>,
348346
onOptionChanged: Function as PropType<((e: { component: DOMComponent, element: any, fullName: string, model: any, name: string, previousValue: any, value: any }) => void)>,
347+
onSaved: Function as PropType<((e: SavedEvent) => void)>,
348+
onSaving: Function as PropType<((e: SavingEvent) => void)>,
349349
onSelectionChanged: Function as PropType<((e: SelectionChangedEvent) => void)>,
350350
pager: Object as PropType<Pager | Record<string, any> | PagerBase>,
351351
paging: Object as PropType<Paging | Record<string, any>>,
@@ -406,8 +406,6 @@ const componentConfig = {
406406
"update:onCardPrepared": null,
407407
"update:onCardRemoved": null,
408408
"update:onCardRemoving": null,
409-
"update:onCardSaved": null,
410-
"update:onCardSaving": null,
411409
"update:onCardUpdated": null,
412410
"update:onCardUpdating": null,
413411
"update:onContentReady": null,
@@ -427,6 +425,8 @@ const componentConfig = {
427425
"update:onInitialized": null,
428426
"update:onInitNewCard": null,
429427
"update:onOptionChanged": null,
428+
"update:onSaved": null,
429+
"update:onSaving": null,
430430
"update:onSelectionChanged": null,
431431
"update:pager": null,
432432
"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
@@ -10207,31 +10207,6 @@ declare module DevExpress.ui {
1020710207
*/
1020810208
key: TKey;
1020910209
};
10210-
/**
10211-
* [descr:_ui_card_view_CardSavedEvent]
10212-
*/
10213-
export type CardSavedEvent =
10214-
DevExpress.common.core.events.EventInfo<dxCardView> & {
10215-
/**
10216-
* [descr:_ui_card_view_CardSavedEvent.changes]
10217-
*/
10218-
changes: DevExpress.common.grids.DataChange[];
10219-
};
10220-
/**
10221-
* [descr:_ui_card_view_CardSavingEvent]
10222-
*/
10223-
export type CardSavingEvent =
10224-
DevExpress.common.core.events.EventInfo<dxCardView> &
10225-
DevExpress.common.core.events.Cancelable & {
10226-
/**
10227-
* [descr:_ui_card_view_CardSavingEvent.promise]
10228-
*/
10229-
promise?: PromiseLike<void>;
10230-
/**
10231-
* [descr:_ui_card_view_CardSavingEvent.changes]
10232-
*/
10233-
changes: DevExpress.common.grids.DataChange[];
10234-
};
1023510210
/**
1023610211
* [descr:CardTemplateData]
1023710212
*/
@@ -10486,6 +10461,31 @@ declare module DevExpress.ui {
1048610461
TCardData = unknown,
1048710462
TKey = unknown
1048810463
> = dxCardViewOptions<TCardData, TKey>;
10464+
/**
10465+
* [descr:_ui_card_view_SavedEvent]
10466+
*/
10467+
export type SavedEvent =
10468+
DevExpress.common.core.events.EventInfo<dxCardView> & {
10469+
/**
10470+
* [descr:_ui_card_view_SavedEvent.changes]
10471+
*/
10472+
changes: DevExpress.common.grids.DataChange[];
10473+
};
10474+
/**
10475+
* [descr:_ui_card_view_SavingEvent]
10476+
*/
10477+
export type SavingEvent =
10478+
DevExpress.common.core.events.EventInfo<dxCardView> &
10479+
DevExpress.common.core.events.Cancelable & {
10480+
/**
10481+
* [descr:_ui_card_view_SavingEvent.promise]
10482+
*/
10483+
promise?: PromiseLike<void>;
10484+
/**
10485+
* [descr:_ui_card_view_SavingEvent.changes]
10486+
*/
10487+
changes: DevExpress.common.grids.DataChange[];
10488+
};
1048910489
/**
1049010490
* [descr:_ui_card_view_SelectionChangedEvent]
1049110491
*/
@@ -10890,13 +10890,13 @@ declare module DevExpress.ui {
1089010890
*/
1089110891
onCardUpdating?: (e: DevExpress.ui.dxCardView.CardUpdatingEvent) => void;
1089210892
/**
10893-
* [descr:dxCardViewOptions.onCardSaved]
10893+
* [descr:dxCardViewOptions.onSaved]
1089410894
*/
10895-
onCardSaved?: (e: DevExpress.ui.dxCardView.CardSavedEvent) => void;
10895+
onSaved?: (e: DevExpress.ui.dxCardView.SavedEvent) => void;
1089610896
/**
10897-
* [descr:dxCardViewOptions.onCardSaving]
10897+
* [descr:dxCardViewOptions.onSaving]
1089810898
*/
10899-
onCardSaving?: (e: DevExpress.ui.dxCardView.CardSavingEvent) => void;
10899+
onSaving?: (e: DevExpress.ui.dxCardView.SavingEvent) => void;
1090010900

1090110901
/**
1090210902
* [descr:dxCardViewOptions.selectedCardKeys]

0 commit comments

Comments
 (0)