Skip to content

Commit

Permalink
Box/ResponsiveBox baseSize option - Add string to accepted type (#25920)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderPolosatov authored Nov 1, 2023
1 parent 48a79d4 commit 87cacdd
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 34 deletions.
7 changes: 3 additions & 4 deletions packages/devextreme-angular/src/ui/box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
export { ExplicitTypes } from 'devextreme/ui/box';

import DevExpress from 'devextreme/bundles/dx.all';
import { Mode } from 'devextreme/common';
import { Store } from 'devextreme/data';
import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source';
import { BoxDirection, ContentReadyEvent, CrosswiseDistribution, DisposingEvent, Distribution, dxBoxOptions, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent } from 'devextreme/ui/box';
Expand Down Expand Up @@ -189,10 +188,10 @@ export class DxBoxComponent<TItem = any, TKey = any> extends DxComponent impleme
*/
@Input()
get items(): Array<string | any | { baseSize?: Mode | number, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }> {
get items(): Array<string | any | { baseSize?: number | string, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }> {
return this._getOption('items');
}
set items(value: Array<string | any | { baseSize?: Mode | number, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }>) {
set items(value: Array<string | any | { baseSize?: number | string, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }>) {
this._setOption('items', value);
}

Expand Down Expand Up @@ -380,7 +379,7 @@ export class DxBoxComponent<TItem = any, TKey = any> extends DxComponent impleme
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() itemsChange: EventEmitter<Array<string | any | { baseSize?: Mode | number, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }>>;
@Output() itemsChange: EventEmitter<Array<string | any | { baseSize?: number | string, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }>>;

/**
Expand Down
5 changes: 2 additions & 3 deletions packages/devextreme-angular/src/ui/nested/base/box-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
} from '@angular/core';

import DevExpress from 'devextreme/bundles/dx.all';
import { Mode } from 'devextreme/common';
import { Store } from 'devextreme/data';
import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source';
import { BoxDirection, ContentReadyEvent, CrosswiseDistribution, DisposingEvent, Distribution, dxBoxOptions, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent } from 'devextreme/ui/box';
Expand Down Expand Up @@ -78,10 +77,10 @@ export abstract class DxoBoxOptions extends NestedOption {
this._setOption('itemHoldTimeout', value);
}

get items(): Array<string | any | { baseSize?: Mode | number, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }> {
get items(): Array<string | any | { baseSize?: number | string, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }> {
return this._getOption('items');
}
set items(value: Array<string | any | { baseSize?: Mode | number, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }>) {
set items(value: Array<string | any | { baseSize?: number | string, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }>) {
this._setOption('items', value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@angular/core';

import DevExpress from 'devextreme/bundles/dx.all';
import { ButtonStyle, ButtonType, HorizontalAlignment, Mode, ToolbarItemComponent, ToolbarItemLocation, VerticalAlignment } from 'devextreme/common';
import { ButtonStyle, ButtonType, HorizontalAlignment, ToolbarItemComponent, ToolbarItemLocation, VerticalAlignment } from 'devextreme/common';
import { dxBoxOptions } from 'devextreme/ui/box';
import { dxButtonOptions } from 'devextreme/ui/button';
import { DataGridPredefinedToolbarItem } from 'devextreme/ui/data_grid';
Expand Down Expand Up @@ -101,10 +101,10 @@ export abstract class DxiButtonGroupItem extends CollectionNestedOption {
this._setOption('type', value);
}

get baseSize(): Mode | number {
get baseSize(): number | string {
return this._getOption('baseSize');
}
set baseSize(value: Mode | number) {
set baseSize(value: number | string) {
this._setOption('baseSize', value);
}

Expand Down
3 changes: 1 addition & 2 deletions packages/devextreme-angular/src/ui/nested/box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import {



import { Mode } from 'devextreme/common';
import { dxBoxOptions } from 'devextreme/ui/box';

import {
Expand Down Expand Up @@ -66,7 +65,7 @@ export class DxoBoxComponent extends DxoBoxOptions implements OnDestroy, OnInit
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() itemsChange: EventEmitter<Array<string | any | { baseSize?: Mode | number, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }>>;
@Output() itemsChange: EventEmitter<Array<string | any | { baseSize?: number | string, box?: dxBoxOptions | undefined, disabled?: boolean, html?: string, ratio?: number, shrink?: number, template?: any, text?: string, visible?: boolean }>>;
protected get _optionPath() {
return 'box';
}
Expand Down
5 changes: 2 additions & 3 deletions packages/devextreme-angular/src/ui/nested/col-dxi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {



import { Mode } from 'devextreme/common';

import {
NestedOptionHost,
Expand All @@ -28,10 +27,10 @@ import { CollectionNestedOption } from 'devextreme-angular/core';
})
export class DxiColComponent extends CollectionNestedOption {
@Input()
get baseSize(): Mode | number {
get baseSize(): number | string {
return this._getOption('baseSize');
}
set baseSize(value: Mode | number) {
set baseSize(value: number | string) {
this._setOption('baseSize', value);
}

Expand Down
5 changes: 2 additions & 3 deletions packages/devextreme-angular/src/ui/nested/row-dxi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {



import { Mode } from 'devextreme/common';

import {
NestedOptionHost,
Expand All @@ -28,10 +27,10 @@ import { CollectionNestedOption } from 'devextreme-angular/core';
})
export class DxiRowComponent extends CollectionNestedOption {
@Input()
get baseSize(): Mode | number {
get baseSize(): number | string {
return this._getOption('baseSize');
}
set baseSize(value: Mode | number) {
set baseSize(value: number | string) {
this._setOption('baseSize', value);
}

Expand Down
13 changes: 6 additions & 7 deletions packages/devextreme-angular/src/ui/responsive-box/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
export { ExplicitTypes } from 'devextreme/ui/responsive_box';

import DevExpress from 'devextreme/bundles/dx.all';
import { Mode } from 'devextreme/common';
import { Store } from 'devextreme/data';
import DataSource, { Options as DataSourceOptions } from 'devextreme/data/data_source';
import { ContentReadyEvent, DisposingEvent, InitializedEvent, ItemClickEvent, ItemContextMenuEvent, ItemHoldEvent, ItemRenderedEvent, OptionChangedEvent } from 'devextreme/ui/responsive_box';
Expand Down Expand Up @@ -76,10 +75,10 @@ export class DxResponsiveBoxComponent<TItem = any, TKey = any> extends DxCompone
*/
@Input()
get cols(): Array<any | { baseSize?: Mode | number, ratio?: number, screen?: string | undefined, shrink?: number }> {
get cols(): Array<any | { baseSize?: number | string, ratio?: number, screen?: string | undefined, shrink?: number }> {
return this._getOption('cols');
}
set cols(value: Array<any | { baseSize?: Mode | number, ratio?: number, screen?: string | undefined, shrink?: number }>) {
set cols(value: Array<any | { baseSize?: number | string, ratio?: number, screen?: string | undefined, shrink?: number }>) {
this._setOption('cols', value);
}

Expand Down Expand Up @@ -193,10 +192,10 @@ export class DxResponsiveBoxComponent<TItem = any, TKey = any> extends DxCompone
*/
@Input()
get rows(): Array<any | { baseSize?: Mode | number, ratio?: number, screen?: string | undefined, shrink?: number }> {
get rows(): Array<any | { baseSize?: number | string, ratio?: number, screen?: string | undefined, shrink?: number }> {
return this._getOption('rows');
}
set rows(value: Array<any | { baseSize?: Mode | number, ratio?: number, screen?: string | undefined, shrink?: number }>) {
set rows(value: Array<any | { baseSize?: number | string, ratio?: number, screen?: string | undefined, shrink?: number }>) {
this._setOption('rows', value);
}

Expand Down Expand Up @@ -334,7 +333,7 @@ export class DxResponsiveBoxComponent<TItem = any, TKey = any> extends DxCompone
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() colsChange: EventEmitter<Array<any | { baseSize?: Mode | number, ratio?: number, screen?: string | undefined, shrink?: number }>>;
@Output() colsChange: EventEmitter<Array<any | { baseSize?: number | string, ratio?: number, screen?: string | undefined, shrink?: number }>>;

/**
Expand Down Expand Up @@ -397,7 +396,7 @@ export class DxResponsiveBoxComponent<TItem = any, TKey = any> extends DxCompone
* This member supports the internal infrastructure and is not intended to be used directly from your code.
*/
@Output() rowsChange: EventEmitter<Array<any | { baseSize?: Mode | number, ratio?: number, screen?: string | undefined, shrink?: number }>>;
@Output() rowsChange: EventEmitter<Array<any | { baseSize?: number | string, ratio?: number, screen?: string | undefined, shrink?: number }>>;

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme-react/src/box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class Box<TItem = any, TKey = any> extends BaseComponent<React.PropsWithChildren
// owners:
// Box
type IItemProps = React.PropsWithChildren<{
baseSize?: number | "auto";
baseSize?: number | string;
box?: dxBoxOptions;
disabled?: boolean;
html?: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/devextreme-react/src/responsive-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ResponsiveBox<TItem = any, TKey = any> extends BaseComponent<React.PropsWi
// owners:
// ResponsiveBox
type IColProps = React.PropsWithChildren<{
baseSize?: number | "auto";
baseSize?: number | string;
ratio?: number;
screen?: string;
shrink?: number;
Expand Down Expand Up @@ -160,7 +160,7 @@ class Location extends NestedOption<ILocationProps> {
// owners:
// ResponsiveBox
type IRowProps = React.PropsWithChildren<{
baseSize?: number | "auto";
baseSize?: number | string;
ratio?: number;
screen?: string;
shrink?: number;
Expand Down
2 changes: 1 addition & 1 deletion packages/devextreme/js/ui/box.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export interface dxBoxItem<TKey = any> extends CollectionWidgetItem {
* @default 0
* @public
*/
baseSize?: number | Mode;
baseSize?: number | string;
/**
* @docid
* @default undefined
Expand Down
4 changes: 2 additions & 2 deletions packages/devextreme/js/ui/responsive_box.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export interface dxResponsiveBoxOptions<
* @docid
* @default 0
*/
baseSize?: number | Mode;
baseSize?: number | string;
/**
* @docid
* @default 1
Expand Down Expand Up @@ -152,7 +152,7 @@ export interface dxResponsiveBoxOptions<
* @docid
* @default 0
*/
baseSize?: number | Mode;
baseSize?: number | string;
/**
* @docid
* @default 1
Expand Down
6 changes: 3 additions & 3 deletions packages/devextreme/ts/dx.all.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8954,7 +8954,7 @@ declare module DevExpress.ui {
/**
* [descr:dxBoxItem.baseSize]
*/
baseSize?: number | DevExpress.common.Mode;
baseSize?: number | string;
/**
* [descr:dxBoxItem.box]
*/
Expand Down Expand Up @@ -23366,7 +23366,7 @@ declare module DevExpress.ui {
/**
* [descr:dxResponsiveBoxOptions.cols.baseSize]
*/
baseSize?: number | DevExpress.common.Mode;
baseSize?: number | string;
/**
* [descr:dxResponsiveBoxOptions.cols.ratio]
*/
Expand Down Expand Up @@ -23399,7 +23399,7 @@ declare module DevExpress.ui {
/**
* [descr:dxResponsiveBoxOptions.rows.baseSize]
*/
baseSize?: number | DevExpress.common.Mode;
baseSize?: number | string;
/**
* [descr:dxResponsiveBoxOptions.rows.ratio]
*/
Expand Down

0 comments on commit 87cacdd

Please sign in to comment.