Skip to content

Commit

Permalink
Import union types
Browse files Browse the repository at this point in the history
  • Loading branch information
alexslavr committed Nov 5, 2024
1 parent a1599d6 commit ef6f1a3
Show file tree
Hide file tree
Showing 693 changed files with 6,059 additions and 5,454 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { DOCUMENT } from '@angular/common';


import { NativeEventInfo } from 'devextreme/events/index';
import { ButtonStyle, ButtonType } from 'devextreme/common';

import {
NestedOptionHost,
Expand Down Expand Up @@ -61,10 +62,10 @@ export class DxiActionSheetItemComponent extends CollectionNestedOption implemen
}

@Input()
get stylingMode(): "text" | "outlined" | "contained" {
get stylingMode(): ButtonStyle {
return this._getOption('stylingMode');
}
set stylingMode(value: "text" | "outlined" | "contained") {
set stylingMode(value: ButtonStyle) {
this._setOption('stylingMode', value);
}

Expand All @@ -85,10 +86,10 @@ export class DxiActionSheetItemComponent extends CollectionNestedOption implemen
}

@Input()
get type(): "danger" | "default" | "normal" | "success" {
get type(): ButtonType {
return this._getOption('type');
}
set type(value: "danger" | "default" | "normal" | "success") {
set type(value: ButtonType) {
this._setOption('type', value);
}

Expand Down
45 changes: 23 additions & 22 deletions packages/devextreme-angular/src/ui/autocomplete/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import {


import DataSource from 'devextreme/data/data_source';
import { TextEditorButton } from 'devextreme/common';
import { DropDownPredefinedButton } from 'devextreme/ui/drop_down_editor/ui.drop_down_editor';
import { TextEditorButton, LabelMode, SimplifiedSearchMode, EditorStyle, ValidationMessageMode, Mode, Position, ValidationStatus } from 'devextreme/common';
import { CollectionWidgetItem } from 'devextreme/ui/collection/ui.collection_widget.base';
import { DataSourceOptions } from 'devextreme/data/data_source';
import { Store } from 'devextreme/data/store';
Expand Down Expand Up @@ -144,10 +145,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get buttons(): Array<"clear" | "dropDown" | TextEditorButton> {
get buttons(): Array<DropDownPredefinedButton | TextEditorButton> {
return this._getOption('buttons');
}
set buttons(value: Array<"clear" | "dropDown" | TextEditorButton>) {
set buttons(value: Array<DropDownPredefinedButton | TextEditorButton>) {
this._setOption('buttons', value);
}

Expand Down Expand Up @@ -404,10 +405,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get labelMode(): "static" | "floating" | "hidden" | "outside" {
get labelMode(): LabelMode {
return this._getOption('labelMode');
}
set labelMode(value: "static" | "floating" | "hidden" | "outside") {
set labelMode(value: LabelMode) {
this._setOption('labelMode', value);
}

Expand Down Expand Up @@ -547,10 +548,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get searchMode(): "contains" | "startswith" {
get searchMode(): SimplifiedSearchMode {
return this._getOption('searchMode');
}
set searchMode(value: "contains" | "startswith") {
set searchMode(value: SimplifiedSearchMode) {
this._setOption('searchMode', value);
}

Expand Down Expand Up @@ -625,10 +626,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get stylingMode(): "outlined" | "underlined" | "filled" {
get stylingMode(): EditorStyle {
return this._getOption('stylingMode');
}
set stylingMode(value: "outlined" | "underlined" | "filled") {
set stylingMode(value: EditorStyle) {
this._setOption('stylingMode', value);
}

Expand Down Expand Up @@ -703,10 +704,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get validationMessageMode(): "always" | "auto" {
get validationMessageMode(): ValidationMessageMode {
return this._getOption('validationMessageMode');
}
set validationMessageMode(value: "always" | "auto") {
set validationMessageMode(value: ValidationMessageMode) {
this._setOption('validationMessageMode', value);
}

Expand All @@ -716,10 +717,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get validationMessagePosition(): "bottom" | "left" | "right" | "top" | "auto" {
get validationMessagePosition(): Mode | Position {
return this._getOption('validationMessagePosition');
}
set validationMessagePosition(value: "bottom" | "left" | "right" | "top" | "auto") {
set validationMessagePosition(value: Mode | Position) {
this._setOption('validationMessagePosition', value);
}

Expand All @@ -729,10 +730,10 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
*/
@Input()
get validationStatus(): "valid" | "invalid" | "pending" {
get validationStatus(): ValidationStatus {
return this._getOption('validationStatus');
}
set validationStatus(value: "valid" | "invalid" | "pending") {
set validationStatus(value: ValidationStatus) {
this._setOption('validationStatus', value);
}

Expand Down Expand Up @@ -985,7 +986,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() buttonsChange: EventEmitter<Array<"clear" | "dropDown" | TextEditorButton>>;
@Output() buttonsChange: EventEmitter<Array<DropDownPredefinedButton | TextEditorButton>>;

/**
Expand Down Expand Up @@ -1125,7 +1126,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() labelModeChange: EventEmitter<"static" | "floating" | "hidden" | "outside">;
@Output() labelModeChange: EventEmitter<LabelMode>;

/**
Expand Down Expand Up @@ -1202,7 +1203,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() searchModeChange: EventEmitter<"contains" | "startswith">;
@Output() searchModeChange: EventEmitter<SimplifiedSearchMode>;

/**
Expand Down Expand Up @@ -1244,7 +1245,7 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() stylingModeChange: EventEmitter<"outlined" | "underlined" | "filled">;
@Output() stylingModeChange: EventEmitter<EditorStyle>;

/**
Expand Down Expand Up @@ -1286,21 +1287,21 @@ export class DxAutocompleteComponent extends DxComponent implements OnDestroy, C
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() validationMessageModeChange: EventEmitter<"always" | "auto">;
@Output() validationMessageModeChange: EventEmitter<ValidationMessageMode>;

/**
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() validationMessagePositionChange: EventEmitter<"bottom" | "left" | "right" | "top" | "auto">;
@Output() validationMessagePositionChange: EventEmitter<Mode | Position>;

/**
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() validationStatusChange: EventEmitter<"valid" | "invalid" | "pending">;
@Output() validationStatusChange: EventEmitter<ValidationStatus>;

/**
Expand Down
9 changes: 5 additions & 4 deletions packages/devextreme-angular/src/ui/autocomplete/nested/at.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {



import { HorizontalAlignment, VerticalAlignment } from 'devextreme/common';

import {
NestedOptionHost,
Expand All @@ -29,18 +30,18 @@ import { NestedOption } from 'devextreme-angular/core';
})
export class DxoAutocompleteAtComponent extends NestedOption implements OnDestroy, OnInit {
@Input()
get x(): "center" | "left" | "right" {
get x(): HorizontalAlignment {
return this._getOption('x');
}
set x(value: "center" | "left" | "right") {
set x(value: HorizontalAlignment) {
this._setOption('x', value);
}

@Input()
get y(): "bottom" | "center" | "top" {
get y(): VerticalAlignment {
return this._getOption('y');
}
set y(value: "bottom" | "center" | "top") {
set y(value: VerticalAlignment) {
this._setOption('y', value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {



import { TextEditorButtonLocation } from 'devextreme/common';
import { dxButtonOptions } from 'devextreme/ui/button';

import {
Expand All @@ -28,10 +29,10 @@ import { CollectionNestedOption } from 'devextreme-angular/core';
})
export class DxiAutocompleteButtonComponent extends CollectionNestedOption {
@Input()
get location(): "after" | "before" {
get location(): TextEditorButtonLocation {
return this._getOption('location');
}
set location(value: "after" | "before") {
set location(value: TextEditorButtonLocation) {
this._setOption('location', value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {



import { CollisionResolution } from 'devextreme/animation/position';

import {
NestedOptionHost,
Expand All @@ -29,18 +30,18 @@ import { NestedOption } from 'devextreme-angular/core';
})
export class DxoAutocompleteCollisionComponent extends NestedOption implements OnDestroy, OnInit {
@Input()
get x(): "fit" | "flip" | "flipfit" | "none" {
get x(): CollisionResolution {
return this._getOption('x');
}
set x(value: "fit" | "flip" | "flipfit" | "none") {
set x(value: CollisionResolution) {
this._setOption('x', value);
}

@Input()
get y(): "fit" | "flip" | "flipfit" | "none" {
get y(): CollisionResolution {
return this._getOption('y');
}
set y(value: "fit" | "flip" | "flipfit" | "none") {
set y(value: CollisionResolution) {
this._setOption('y', value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import dxPopup from 'devextreme/ui/popup';
import { AnimationConfig } from 'devextreme/animation/fx';
import { event, EventInfo } from 'devextreme/events/index';
import { Component as CoreComponent } from 'devextreme/core/component';
import { PositionAlignment } from 'devextreme/common';
import { PositionConfig } from 'devextreme/animation/position';
import { dxPopupToolbarItem } from 'devextreme/ui/popup';

Expand Down Expand Up @@ -321,10 +322,10 @@ export class DxoAutocompleteDropDownOptionsComponent extends NestedOption implem
}

@Input()
get position(): (() => void) | PositionConfig | "bottom" | "center" | "left" | "left bottom" | "left top" | "right" | "right bottom" | "right top" | "top" {
get position(): (() => void) | PositionAlignment | PositionConfig {
return this._getOption('position');
}
set position(value: (() => void) | PositionConfig | "bottom" | "center" | "left" | "left bottom" | "left top" | "right" | "right bottom" | "right top" | "top") {
set position(value: (() => void) | PositionAlignment | PositionConfig) {
this._setOption('position', value);
}

Expand Down
11 changes: 6 additions & 5 deletions packages/devextreme-angular/src/ui/autocomplete/nested/hide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {



import { AnimationConfig, AnimationState } from 'devextreme/animation/fx';
import { AnimationConfig, AnimationState, AnimationType } from 'devextreme/animation/fx';
import { Direction } from 'devextreme/common';

import {
NestedOptionHost,
Expand Down Expand Up @@ -46,10 +47,10 @@ export class DxoAutocompleteHideComponent extends NestedOption implements OnDest
}

@Input()
get direction(): "bottom" | "left" | "right" | "top" {
get direction(): Direction {
return this._getOption('direction');
}
set direction(value: "bottom" | "left" | "right" | "top") {
set direction(value: Direction) {
this._setOption('direction', value);
}

Expand Down Expand Up @@ -102,10 +103,10 @@ export class DxoAutocompleteHideComponent extends NestedOption implements OnDest
}

@Input()
get type(): "css" | "fade" | "fadeIn" | "fadeOut" | "pop" | "slide" | "slideIn" | "slideOut" {
get type(): AnimationType {
return this._getOption('type');
}
set type(value: "css" | "fade" | "fadeIn" | "fadeOut" | "pop" | "slide" | "slideIn" | "slideOut") {
set type(value: AnimationType) {
this._setOption('type', value);
}

Expand Down
9 changes: 5 additions & 4 deletions packages/devextreme-angular/src/ui/autocomplete/nested/my.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {



import { HorizontalAlignment, VerticalAlignment } from 'devextreme/common';

import {
NestedOptionHost,
Expand All @@ -29,18 +30,18 @@ import { NestedOption } from 'devextreme-angular/core';
})
export class DxoAutocompleteMyComponent extends NestedOption implements OnDestroy, OnInit {
@Input()
get x(): "center" | "left" | "right" {
get x(): HorizontalAlignment {
return this._getOption('x');
}
set x(value: "center" | "left" | "right") {
set x(value: HorizontalAlignment) {
this._setOption('x', value);
}

@Input()
get y(): "bottom" | "center" | "top" {
get y(): VerticalAlignment {
return this._getOption('y');
}
set y(value: "bottom" | "center" | "top") {
set y(value: VerticalAlignment) {
this._setOption('y', value);
}

Expand Down
Loading

0 comments on commit ef6f1a3

Please sign in to comment.