Skip to content

Commit e526de9

Browse files
authored
Scheduler - editing.form.showIcons & resources.icon d.ts (DevExpress#31347)
1 parent fd8290c commit e526de9

File tree

10 files changed

+65
-11
lines changed

10 files changed

+65
-11
lines changed

packages/devextreme-angular/src/ui/scheduler/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import dxScheduler from 'devextreme/ui/scheduler';
2626
import dxSortable from 'devextreme/ui/sortable';
2727
import dxDraggable from 'devextreme/ui/draggable';
2828
import DataSource from 'devextreme/data/data_source';
29-
import { AllDayPanelMode, ViewType, dxSchedulerAppointment, CellAppointmentsLimit, AppointmentAddedEvent, AppointmentAddingEvent, AppointmentClickEvent, AppointmentContextMenuEvent, AppointmentDblClickEvent, AppointmentDeletedEvent, AppointmentDeletingEvent, AppointmentFormOpeningEvent, AppointmentRenderedEvent, AppointmentTooltipShowingEvent, AppointmentUpdatedEvent, AppointmentUpdatingEvent, CellClickEvent, CellContextMenuEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, OptionChangedEvent, RecurrenceEditMode, dxSchedulerScrolling, dxSchedulerToolbar } from 'devextreme/ui/scheduler';
29+
import { AllDayPanelMode, ViewType, dxSchedulerAppointment, SchedulerAppointmentFormIconDisplay, CellAppointmentsLimit, AppointmentAddedEvent, AppointmentAddingEvent, AppointmentClickEvent, AppointmentContextMenuEvent, AppointmentDblClickEvent, AppointmentDeletedEvent, AppointmentDeletingEvent, AppointmentFormOpeningEvent, AppointmentRenderedEvent, AppointmentTooltipShowingEvent, AppointmentUpdatedEvent, AppointmentUpdatingEvent, CellClickEvent, CellContextMenuEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, OptionChangedEvent, RecurrenceEditMode, dxSchedulerScrolling, dxSchedulerToolbar } from 'devextreme/ui/scheduler';
3030
import { event } from 'devextreme/events/events.types';
3131
import { DataSourceOptions } from 'devextreme/data/data_source';
3232
import { Store } from 'devextreme/data/store';
@@ -393,10 +393,10 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
393393
394394
*/
395395
@Input()
396-
get editing(): boolean | { allowAdding?: boolean, allowDeleting?: boolean, allowDragging?: boolean, allowResizing?: boolean, allowTimeZoneEditing?: boolean, allowUpdating?: boolean, form?: undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void) } } {
396+
get editing(): boolean | { allowAdding?: boolean, allowDeleting?: boolean, allowDragging?: boolean, allowResizing?: boolean, allowTimeZoneEditing?: boolean, allowUpdating?: boolean, form?: undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void), showIcons?: SchedulerAppointmentFormIconDisplay } } {
397397
return this._getOption('editing');
398398
}
399-
set editing(value: boolean | { allowAdding?: boolean, allowDeleting?: boolean, allowDragging?: boolean, allowResizing?: boolean, allowTimeZoneEditing?: boolean, allowUpdating?: boolean, form?: undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void) } }) {
399+
set editing(value: boolean | { allowAdding?: boolean, allowDeleting?: boolean, allowDragging?: boolean, allowResizing?: boolean, allowTimeZoneEditing?: boolean, allowUpdating?: boolean, form?: undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void), showIcons?: SchedulerAppointmentFormIconDisplay } }) {
400400
this._setOption('editing', value);
401401
}
402402

@@ -679,10 +679,10 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
679679
680680
*/
681681
@Input()
682-
get resources(): { allowMultiple?: boolean, colorExpr?: string, dataSource?: Array<any> | DataSource | DataSourceOptions | null | Store | string, displayExpr?: ((resource: any) => string) | string, fieldExpr?: string, label?: string, useColorAsDefault?: boolean, valueExpr?: Function | string }[] {
682+
get resources(): { allowMultiple?: boolean, colorExpr?: string, dataSource?: Array<any> | DataSource | DataSourceOptions | null | Store | string, displayExpr?: ((resource: any) => string) | string, fieldExpr?: string, icon?: string, label?: string, useColorAsDefault?: boolean, valueExpr?: Function | string }[] {
683683
return this._getOption('resources');
684684
}
685-
set resources(value: { allowMultiple?: boolean, colorExpr?: string, dataSource?: Array<any> | DataSource | DataSourceOptions | null | Store | string, displayExpr?: ((resource: any) => string) | string, fieldExpr?: string, label?: string, useColorAsDefault?: boolean, valueExpr?: Function | string }[]) {
685+
set resources(value: { allowMultiple?: boolean, colorExpr?: string, dataSource?: Array<any> | DataSource | DataSourceOptions | null | Store | string, displayExpr?: ((resource: any) => string) | string, fieldExpr?: string, icon?: string, label?: string, useColorAsDefault?: boolean, valueExpr?: Function | string }[]) {
686686
this._setOption('resources', value);
687687
}
688688

@@ -1202,7 +1202,7 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
12021202
* This member supports the internal infrastructure and is not intended to be used directly from your code.
12031203
12041204
*/
1205-
@Output() editingChange: EventEmitter<boolean | { allowAdding?: boolean, allowDeleting?: boolean, allowDragging?: boolean, allowResizing?: boolean, allowTimeZoneEditing?: boolean, allowUpdating?: boolean, form?: undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void) } }>;
1205+
@Output() editingChange: EventEmitter<boolean | { allowAdding?: boolean, allowDeleting?: boolean, allowDragging?: boolean, allowResizing?: boolean, allowTimeZoneEditing?: boolean, allowUpdating?: boolean, form?: undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void), showIcons?: SchedulerAppointmentFormIconDisplay } }>;
12061206

12071207
/**
12081208
@@ -1356,7 +1356,7 @@ export class DxSchedulerComponent extends DxComponent implements OnDestroy, OnCh
13561356
* This member supports the internal infrastructure and is not intended to be used directly from your code.
13571357
13581358
*/
1359-
@Output() resourcesChange: EventEmitter<{ allowMultiple?: boolean, colorExpr?: string, dataSource?: Array<any> | DataSource | DataSourceOptions | null | Store | string, displayExpr?: ((resource: any) => string) | string, fieldExpr?: string, label?: string, useColorAsDefault?: boolean, valueExpr?: Function | string }[]>;
1359+
@Output() resourcesChange: EventEmitter<{ allowMultiple?: boolean, colorExpr?: string, dataSource?: Array<any> | DataSource | DataSourceOptions | null | Store | string, displayExpr?: ((resource: any) => string) | string, fieldExpr?: string, icon?: string, label?: string, useColorAsDefault?: boolean, valueExpr?: Function | string }[]>;
13601360

13611361
/**
13621362

packages/devextreme-angular/src/ui/scheduler/nested/editing.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515

1616

1717
import { dxFormButtonItem, dxFormEmptyItem, dxFormGroupItem, dxFormSimpleItem, dxFormTabbedItem } from 'devextreme/ui/form';
18+
import { SchedulerAppointmentFormIconDisplay } from 'devextreme/ui/scheduler';
1819

1920
import {
2021
DxIntegrationModule,
@@ -81,10 +82,10 @@ export class DxoSchedulerEditingComponent extends NestedOption implements OnDest
8182
}
8283

8384
@Input()
84-
get form(): undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void) } {
85+
get form(): undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void), showIcons?: SchedulerAppointmentFormIconDisplay } {
8586
return this._getOption('form');
8687
}
87-
set form(value: undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void) }) {
88+
set form(value: undefined | { items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>, onCanceled?: ((formData: any) => void), onSaved?: ((formData: any) => void), showIcons?: SchedulerAppointmentFormIconDisplay }) {
8889
this._setOption('form', value);
8990
}
9091

packages/devextreme-angular/src/ui/scheduler/nested/form.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717

1818

1919
import { dxFormButtonItem, dxFormEmptyItem, dxFormGroupItem, dxFormSimpleItem, dxFormTabbedItem } from 'devextreme/ui/form';
20+
import { SchedulerAppointmentFormIconDisplay } from 'devextreme/ui/scheduler';
2021

2122
import {
2223
DxIntegrationModule,
@@ -67,6 +68,14 @@ export class DxoSchedulerFormComponent extends NestedOption implements OnDestroy
6768
this._setOption('onSaved', value);
6869
}
6970

71+
@Input()
72+
get showIcons(): SchedulerAppointmentFormIconDisplay {
73+
return this._getOption('showIcons');
74+
}
75+
set showIcons(value: SchedulerAppointmentFormIconDisplay) {
76+
this._setOption('showIcons', value);
77+
}
78+
7079

7180
protected get _optionPath() {
7281
return 'form';

packages/devextreme-angular/src/ui/scheduler/nested/resource-dxi.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ export class DxiSchedulerResourceComponent extends CollectionNestedOption {
7979
this._setOption('fieldExpr', value);
8080
}
8181

82+
@Input()
83+
get icon(): string {
84+
return this._getOption('icon');
85+
}
86+
set icon(value: string) {
87+
this._setOption('icon', value);
88+
}
89+
8290
@Input()
8391
get label(): string {
8492
return this._getOption('label');

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Ng.makeMetadata({
2121
removeMembers(/\/grids:LoadPanel.indicatorOptions/),
2222
removeMembers(/\/scheduler:Toolbar/),
2323
removeMembers(/\/scheduler:dxSchedulerOptions\.editing\.form/),
24+
removeMembers(/\/scheduler:dxSchedulerOptions\.resources\.icon/),
2425
removeMembers(/\/stepper:/),
2526
removeMembers(/\/speech_to_text:/),
2627
],

packages/devextreme-react/src/scheduler.ts

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

11-
import type { ViewType, AppointmentAddedEvent, AppointmentAddingEvent, AppointmentClickEvent, AppointmentContextMenuEvent, AppointmentDblClickEvent, AppointmentDeletedEvent, AppointmentDeletingEvent, AppointmentFormOpeningEvent, AppointmentRenderedEvent, AppointmentTooltipShowingEvent, AppointmentUpdatedEvent, AppointmentUpdatingEvent, CellClickEvent, CellContextMenuEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, SchedulerPredefinedToolbarItem, DateNavigatorItemProperties, SchedulerPredefinedDateNavigatorItem, dxSchedulerToolbarItem, AllDayPanelMode, AppointmentCollectorTemplateData, AppointmentTemplateData, AppointmentTooltipTemplateData, CellAppointmentsLimit, dxSchedulerScrolling } from "devextreme/ui/scheduler";
11+
import type { ViewType, AppointmentAddedEvent, AppointmentAddingEvent, AppointmentClickEvent, AppointmentContextMenuEvent, AppointmentDblClickEvent, AppointmentDeletedEvent, AppointmentDeletingEvent, AppointmentFormOpeningEvent, AppointmentRenderedEvent, AppointmentTooltipShowingEvent, AppointmentUpdatedEvent, AppointmentUpdatingEvent, CellClickEvent, CellContextMenuEvent, ContentReadyEvent, DisposingEvent, InitializedEvent, SchedulerAppointmentFormIconDisplay, SchedulerPredefinedToolbarItem, DateNavigatorItemProperties, SchedulerPredefinedDateNavigatorItem, dxSchedulerToolbarItem, AllDayPanelMode, AppointmentCollectorTemplateData, AppointmentTemplateData, AppointmentTooltipTemplateData, CellAppointmentsLimit, dxSchedulerScrolling } from "devextreme/ui/scheduler";
1212
import type { ContentReadyEvent as ButtonContentReadyEvent, DisposingEvent as ButtonDisposingEvent, InitializedEvent as ButtonInitializedEvent, dxButtonOptions, ClickEvent, OptionChangedEvent } from "devextreme/ui/button";
1313
import type { ContentReadyEvent as ButtonGroupContentReadyEvent, DisposingEvent as ButtonGroupDisposingEvent, InitializedEvent as ButtonGroupInitializedEvent, OptionChangedEvent as ButtonGroupOptionChangedEvent, dxButtonGroupItem, ItemClickEvent, SelectionChangedEvent } from "devextreme/ui/button_group";
1414
import type { ContentReadyEvent as TabPanelContentReadyEvent, DisposingEvent as TabPanelDisposingEvent, InitializedEvent as TabPanelInitializedEvent, OptionChangedEvent as TabPanelOptionChangedEvent, dxTabPanelOptions, ItemClickEvent as TabPanelItemClickEvent, SelectionChangedEvent as TabPanelSelectionChangedEvent, dxTabPanelItem, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, SelectionChangingEvent, TitleClickEvent, TitleHoldEvent, TitleRenderedEvent } from "devextreme/ui/tab_panel";
@@ -401,6 +401,7 @@ type IEditingProps = React.PropsWithChildren<{
401401
items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>;
402402
onCanceled?: ((formData: any) => void);
403403
onSaved?: ((formData: any) => void);
404+
showIcons?: SchedulerAppointmentFormIconDisplay;
404405
};
405406
}>
406407
const _componentEditing = (props: IEditingProps) => {
@@ -476,6 +477,7 @@ type IFormProps = React.PropsWithChildren<{
476477
items?: Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>;
477478
onCanceled?: ((formData: any) => void);
478479
onSaved?: ((formData: any) => void);
480+
showIcons?: SchedulerAppointmentFormIconDisplay;
479481
}>
480482
const _componentForm = (props: IFormProps) => {
481483
return React.createElement(NestedOption<IFormProps>, {
@@ -923,6 +925,7 @@ type IResourceProps = React.PropsWithChildren<{
923925
dataSource?: Array<any> | DataSource | DataSourceOptions | null | Store | string;
924926
displayExpr?: ((resource: any) => string) | string;
925927
fieldExpr?: string;
928+
icon?: string;
926929
label?: string;
927930
useColorAsDefault?: boolean;
928931
valueExpr?: (() => void) | string;

packages/devextreme-vue/src/scheduler.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
RecurrenceEditMode,
3333
dxSchedulerScrolling,
3434
dxSchedulerToolbar,
35+
SchedulerAppointmentFormIconDisplay,
3536
SchedulerPredefinedToolbarItem,
3637
DateNavigatorItemProperties,
3738
SchedulerPredefinedDateNavigatorItem,
@@ -750,11 +751,13 @@ const DxFormConfig = {
750751
"update:items": null,
751752
"update:onCanceled": null,
752753
"update:onSaved": null,
754+
"update:showIcons": null,
753755
},
754756
props: {
755757
items: Array as PropType<Array<dxFormButtonItem | dxFormEmptyItem | dxFormGroupItem | dxFormSimpleItem | dxFormTabbedItem>>,
756758
onCanceled: Function as PropType<((formData: any) => void)>,
757-
onSaved: Function as PropType<((formData: any) => void)>
759+
onSaved: Function as PropType<((formData: any) => void)>,
760+
showIcons: String as PropType<SchedulerAppointmentFormIconDisplay>
758761
}
759762
};
760763

@@ -1184,6 +1187,7 @@ const DxResourceConfig = {
11841187
"update:dataSource": null,
11851188
"update:displayExpr": null,
11861189
"update:fieldExpr": null,
1190+
"update:icon": null,
11871191
"update:label": null,
11881192
"update:useColorAsDefault": null,
11891193
"update:valueExpr": null,
@@ -1194,6 +1198,7 @@ const DxResourceConfig = {
11941198
dataSource: [Array, Object, String] as PropType<Array<any> | DataSource | DataSourceOptions | null | Store | string | Record<string, any>>,
11951199
displayExpr: [Function, String] as PropType<(((resource: any) => string)) | string>,
11961200
fieldExpr: String,
1201+
icon: String,
11971202
label: String,
11981203
useColorAsDefault: Boolean,
11991204
valueExpr: [Function, String] as PropType<((() => void)) | string>

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ export type CellAppointmentsLimit = 'auto' | 'unlimited';
7878
/** @public */
7979
export type RecurrenceEditMode = 'dialog' | 'occurrence' | 'series';
8080
/** @public */
81+
export type SchedulerAppointmentFormIconDisplay = 'both' | 'main' | 'recurrence' | 'none';
82+
/** @public */
8183
export type ViewType = 'agenda' | 'day' | 'month' | 'timelineDay' | 'timelineMonth' | 'timelineWeek' | 'timelineWorkWeek' | 'week' | 'workWeek';
8284
/** @public */
8385
export type SchedulerPredefinedToolbarItem = 'today' | 'dateNavigator' | 'viewSwitcher';
@@ -656,6 +658,12 @@ export interface dxSchedulerOptions extends WidgetOptions<dxScheduler> {
656658
* @public
657659
*/
658660
onCanceled?: ((formData: any) => void);
661+
/**
662+
* @docid
663+
* @default "main"
664+
* @public
665+
*/
666+
showIcons?: SchedulerAppointmentFormIconDisplay;
659667
} | undefined;
660668
};
661669
/**
@@ -912,6 +920,11 @@ export interface dxSchedulerOptions extends WidgetOptions<dxScheduler> {
912920
* @default ""
913921
*/
914922
fieldExpr?: string;
923+
/**
924+
* @docid
925+
* @default ""
926+
*/
927+
icon?: string;
915928
/**
916929
* @docid
917930
* @default ""

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export {
55
AllDayPanelMode,
66
CellAppointmentsLimit,
77
RecurrenceEditMode,
8+
SchedulerAppointmentFormIconDisplay,
89
ViewType,
910
SchedulerPredefinedToolbarItem,
1011
SchedulerPredefinedDateNavigatorItem,

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26174,6 +26174,11 @@ declare module DevExpress.ui {
2617426174
DevExpress.common.core.events.ChangedOptionInfo;
2617526175
export type Properties = dxSchedulerOptions;
2617626176
export type RecurrenceEditMode = 'dialog' | 'occurrence' | 'series';
26177+
export type SchedulerAppointmentFormIconDisplay =
26178+
| 'both'
26179+
| 'main'
26180+
| 'recurrence'
26181+
| 'none';
2617726182
export type SchedulerPredefinedDateNavigatorItem =
2617826183
| 'prev'
2617926184
| 'next'
@@ -26464,6 +26469,10 @@ declare module DevExpress.ui {
2646426469
* [descr:dxSchedulerOptions.editing.form.onCanceled]
2646526470
*/
2646626471
onCanceled?: (formData: any) => void;
26472+
/**
26473+
* [descr:dxSchedulerOptions.editing.form.showIcons]
26474+
*/
26475+
showIcons?: DevExpress.ui.dxScheduler.SchedulerAppointmentFormIconDisplay;
2646726476
}
2646826477
| undefined;
2646926478
};
@@ -26652,6 +26661,10 @@ declare module DevExpress.ui {
2665226661
* [descr:dxSchedulerOptions.resources.fieldExpr]
2665326662
*/
2665426663
fieldExpr?: string;
26664+
/**
26665+
* [descr:dxSchedulerOptions.resources.icon]
26666+
*/
26667+
icon?: string;
2665526668
/**
2665626669
* [descr:dxSchedulerOptions.resources.label]
2665726670
*/

0 commit comments

Comments
 (0)