Skip to content

Commit 7e2c016

Browse files
authored
Propagate type undefined to devextreme-react (#28362)
1 parent 181aa23 commit 7e2c016

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2032
-2028
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"axe-core": "4.10.0",
4545
"cheerio": "1.0.0-rc.10",
4646
"codelyzer": "6.0.2",
47-
"devextreme-internal-tools": "16.0.0-beta.10",
47+
"devextreme-internal-tools": "16.0.0-beta.12",
4848
"http-server": "14.1.1",
4949
"husky": "8.0.3",
5050
"jest": "29.7.0",

packages/devextreme-react/src/autocomplete.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ const BoundaryOffset = Object.assign<typeof _componentBoundaryOffset, NestedComp
192192
// Autocomplete
193193
type IButtonProps = React.PropsWithChildren<{
194194
location?: TextEditorButtonLocation;
195-
name?: string;
196-
options?: dxButtonOptions;
195+
name?: string | undefined;
196+
options?: dxButtonOptions | undefined;
197197
}>
198198
const _componentButton = (props: IButtonProps) => {
199199
return React.createElement(NestedOption<IButtonProps>, {
@@ -234,18 +234,18 @@ const Collision = Object.assign<typeof _componentCollision, NestedComponentMeta>
234234
// owners:
235235
// Autocomplete
236236
type IDropDownOptionsProps = React.PropsWithChildren<{
237-
accessKey?: string;
237+
accessKey?: string | undefined;
238238
animation?: Record<string, any> | {
239239
hide?: AnimationConfig;
240240
show?: AnimationConfig;
241241
};
242242
bindingOptions?: Record<string, any>;
243243
closeOnOutsideClick?: boolean | ((event: event) => boolean);
244-
container?: any | string;
244+
container?: any | string | undefined;
245245
contentTemplate?: ((contentElement: any) => string | any) | template;
246246
deferRendering?: boolean;
247247
disabled?: boolean;
248-
dragAndResizeArea?: any | string;
248+
dragAndResizeArea?: any | string | undefined;
249249
dragEnabled?: boolean;
250250
dragOutsideBoundary?: boolean;
251251
enableBodyScroll?: boolean;
@@ -254,7 +254,7 @@ type IDropDownOptionsProps = React.PropsWithChildren<{
254254
height?: (() => number | string) | number | string;
255255
hideOnOutsideClick?: boolean | ((event: event) => boolean);
256256
hideOnParentScroll?: boolean;
257-
hint?: string;
257+
hint?: string | undefined;
258258
hoverStateEnabled?: boolean;
259259
maxHeight?: (() => number | string) | number | string;
260260
maxWidth?: (() => number | string) | number | string;
@@ -363,11 +363,11 @@ const From = Object.assign<typeof _componentFrom, NestedComponentMeta>(_componen
363363
type IHideProps = React.PropsWithChildren<{
364364
complete?: (($element: any, config: AnimationConfig) => void);
365365
delay?: number;
366-
direction?: Direction;
366+
direction?: Direction | undefined;
367367
duration?: number;
368368
easing?: string;
369369
from?: AnimationState;
370-
staggerDelay?: number;
370+
staggerDelay?: number | undefined;
371371
start?: (($element: any, config: AnimationConfig) => void);
372372
to?: AnimationState;
373373
type?: AnimationType;
@@ -460,14 +460,14 @@ const Offset = Object.assign<typeof _componentOffset, NestedComponentMeta>(_comp
460460
// owners:
461461
// Button
462462
type IOptionsProps = React.PropsWithChildren<{
463-
accessKey?: string;
463+
accessKey?: string | undefined;
464464
activeStateEnabled?: boolean;
465465
bindingOptions?: Record<string, any>;
466466
disabled?: boolean;
467467
elementAttr?: Record<string, any>;
468468
focusStateEnabled?: boolean;
469-
height?: (() => number | string) | number | string;
470-
hint?: string;
469+
height?: (() => number | string) | number | string | undefined;
470+
hint?: string | undefined;
471471
hoverStateEnabled?: boolean;
472472
icon?: string;
473473
onClick?: ((e: ClickEvent) => void);
@@ -482,9 +482,9 @@ type IOptionsProps = React.PropsWithChildren<{
482482
text?: string;
483483
type?: ButtonType | string;
484484
useSubmitBehavior?: boolean;
485-
validationGroup?: string;
485+
validationGroup?: string | undefined;
486486
visible?: boolean;
487-
width?: (() => number | string) | number | string;
487+
width?: (() => number | string) | number | string | undefined;
488488
render?: (...params: any) => React.ReactNode;
489489
component?: React.ComponentType<any>;
490490
}>
@@ -551,11 +551,11 @@ const Position = Object.assign<typeof _componentPosition, NestedComponentMeta>(_
551551
type IShowProps = React.PropsWithChildren<{
552552
complete?: (($element: any, config: AnimationConfig) => void);
553553
delay?: number;
554-
direction?: Direction;
554+
direction?: Direction | undefined;
555555
duration?: number;
556556
easing?: string;
557557
from?: AnimationState;
558-
staggerDelay?: number;
558+
staggerDelay?: number | undefined;
559559
start?: (($element: any, config: AnimationConfig) => void);
560560
to?: AnimationState;
561561
type?: AnimationType;
@@ -598,7 +598,7 @@ const To = Object.assign<typeof _componentTo, NestedComponentMeta>(_componentTo,
598598
// owners:
599599
// DropDownOptions
600600
type IToolbarItemProps = React.PropsWithChildren<{
601-
cssClass?: string;
601+
cssClass?: string | undefined;
602602
disabled?: boolean;
603603
html?: string;
604604
locateInMenu?: LocateInMenuMode;

packages/devextreme-react/src/bar-gauge.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ type IBarGaugeTitleProps = React.PropsWithChildren<{
134134
right?: number;
135135
top?: number;
136136
};
137-
placeholderSize?: number;
137+
placeholderSize?: number | undefined;
138138
subtitle?: Record<string, any> | string | {
139139
font?: ChartsFont;
140140
offset?: number;
@@ -198,7 +198,7 @@ type IBorderProps = React.PropsWithChildren<{
198198
color?: string;
199199
cornerRadius?: number;
200200
dashStyle?: DashStyle;
201-
opacity?: number;
201+
opacity?: number | undefined;
202202
visible?: boolean;
203203
width?: number;
204204
}>
@@ -224,7 +224,7 @@ type IExportProps = React.PropsWithChildren<{
224224
formats?: Array<ExportFormat>;
225225
margin?: number;
226226
printingEnabled?: boolean;
227-
svgToCanvas?: ((svg: any, canvas: any) => any);
227+
svgToCanvas?: ((svg: any, canvas: any) => any) | undefined;
228228
}>
229229
const _componentExport = (props: IExportProps) => {
230230
return React.createElement(NestedOption<IExportProps>, {
@@ -337,11 +337,11 @@ const ItemTextFormat = Object.assign<typeof _componentItemTextFormat, NestedComp
337337
// owners:
338338
// BarGauge
339339
type ILabelProps = React.PropsWithChildren<{
340-
connectorColor?: string;
340+
connectorColor?: string | undefined;
341341
connectorWidth?: number;
342342
customizeText?: ((barValue: { value: number, valueText: string }) => string);
343343
font?: ChartsFont;
344-
format?: LocalizationFormat;
344+
format?: LocalizationFormat | undefined;
345345
indent?: number;
346346
visible?: boolean;
347347
}>
@@ -365,12 +365,12 @@ const Label = Object.assign<typeof _componentLabel, NestedComponentMeta>(_compon
365365
// owners:
366366
// BarGauge
367367
type ILegendProps = React.PropsWithChildren<{
368-
backgroundColor?: string;
368+
backgroundColor?: string | undefined;
369369
border?: Record<string, any> | {
370370
color?: string;
371371
cornerRadius?: number;
372372
dashStyle?: DashStyle;
373-
opacity?: number;
373+
opacity?: number | undefined;
374374
visible?: boolean;
375375
width?: number;
376376
};
@@ -381,32 +381,32 @@ type ILegendProps = React.PropsWithChildren<{
381381
customizeText?: ((arg: { item: BarGaugeBarInfo, text: string }) => string);
382382
font?: ChartsFont;
383383
horizontalAlignment?: HorizontalAlignment;
384-
itemsAlignment?: HorizontalAlignment;
385-
itemTextFormat?: LocalizationFormat;
386-
itemTextPosition?: Position;
384+
itemsAlignment?: HorizontalAlignment | undefined;
385+
itemTextFormat?: LocalizationFormat | undefined;
386+
itemTextPosition?: Position | undefined;
387387
margin?: number | Record<string, any> | {
388388
bottom?: number;
389389
left?: number;
390390
right?: number;
391391
top?: number;
392392
};
393393
markerSize?: number;
394-
markerTemplate?: ((legendItem: BarGaugeLegendItem, element: any) => string | any) | template;
395-
orientation?: Orientation;
394+
markerTemplate?: ((legendItem: BarGaugeLegendItem, element: any) => string | any) | template | undefined;
395+
orientation?: Orientation | undefined;
396396
paddingLeftRight?: number;
397397
paddingTopBottom?: number;
398398
rowCount?: number;
399399
rowItemSpacing?: number;
400400
title?: Record<string, any> | string | {
401401
font?: ChartsFont;
402-
horizontalAlignment?: HorizontalAlignment;
402+
horizontalAlignment?: HorizontalAlignment | undefined;
403403
margin?: Record<string, any> | {
404404
bottom?: number;
405405
left?: number;
406406
right?: number;
407407
top?: number;
408408
};
409-
placeholderSize?: number;
409+
placeholderSize?: number | undefined;
410410
subtitle?: Record<string, any> | string | {
411411
font?: ChartsFont;
412412
offset?: number;
@@ -453,7 +453,7 @@ type ILegendBorderProps = React.PropsWithChildren<{
453453
color?: string;
454454
cornerRadius?: number;
455455
dashStyle?: DashStyle;
456-
opacity?: number;
456+
opacity?: number | undefined;
457457
visible?: boolean;
458458
width?: number;
459459
}>
@@ -474,14 +474,14 @@ const LegendBorder = Object.assign<typeof _componentLegendBorder, NestedComponen
474474
// Legend
475475
type ILegendTitleProps = React.PropsWithChildren<{
476476
font?: ChartsFont;
477-
horizontalAlignment?: HorizontalAlignment;
477+
horizontalAlignment?: HorizontalAlignment | undefined;
478478
margin?: Record<string, any> | {
479479
bottom?: number;
480480
left?: number;
481481
right?: number;
482482
top?: number;
483483
};
484-
placeholderSize?: number;
484+
placeholderSize?: number | undefined;
485485
subtitle?: Record<string, any> | string | {
486486
font?: ChartsFont;
487487
offset?: number;
@@ -610,8 +610,8 @@ const Shadow = Object.assign<typeof _componentShadow, NestedComponentMeta>(_comp
610610
// owners:
611611
// BarGauge
612612
type ISizeProps = React.PropsWithChildren<{
613-
height?: number;
614-
width?: number;
613+
height?: number | undefined;
614+
width?: number | undefined;
615615
}>
616616
const _componentSize = (props: ISizeProps) => {
617617
return React.createElement(NestedOption<ISizeProps>, {
@@ -654,14 +654,14 @@ const Subtitle = Object.assign<typeof _componentSubtitle, NestedComponentMeta>(_
654654
// BarGauge
655655
type ITitleProps = React.PropsWithChildren<{
656656
font?: ChartsFont;
657-
horizontalAlignment?: HorizontalAlignment;
657+
horizontalAlignment?: HorizontalAlignment | undefined;
658658
margin?: Record<string, any> | number | {
659659
bottom?: number;
660660
left?: number;
661661
right?: number;
662662
top?: number;
663663
};
664-
placeholderSize?: number;
664+
placeholderSize?: number | undefined;
665665
subtitle?: Record<string, any> | string | {
666666
font?: ChartsFont;
667667
offset?: number;
@@ -694,20 +694,20 @@ type ITooltipProps = React.PropsWithChildren<{
694694
border?: Record<string, any> | {
695695
color?: string;
696696
dashStyle?: DashStyle;
697-
opacity?: number;
697+
opacity?: number | undefined;
698698
visible?: boolean;
699699
width?: number;
700700
};
701701
color?: string;
702-
container?: any | string;
703-
contentTemplate?: ((scaleValue: { index: number, value: number, valueText: string }, element: any) => string | any) | template;
702+
container?: any | string | undefined;
703+
contentTemplate?: ((scaleValue: { index: number, value: number, valueText: string }, element: any) => string | any) | template | undefined;
704704
cornerRadius?: number;
705-
customizeTooltip?: ((scaleValue: { index: number, value: number, valueText: string }) => Record<string, any>);
705+
customizeTooltip?: ((scaleValue: { index: number, value: number, valueText: string }) => Record<string, any>) | undefined;
706706
enabled?: boolean;
707707
font?: ChartsFont;
708-
format?: LocalizationFormat;
708+
format?: LocalizationFormat | undefined;
709709
interactive?: boolean;
710-
opacity?: number;
710+
opacity?: number | undefined;
711711
paddingLeftRight?: number;
712712
paddingTopBottom?: number;
713713
shadow?: Record<string, any> | {
@@ -717,7 +717,7 @@ type ITooltipProps = React.PropsWithChildren<{
717717
offsetY?: number;
718718
opacity?: number;
719719
};
720-
zIndex?: number;
720+
zIndex?: number | undefined;
721721
contentRender?: (...params: any) => React.ReactNode;
722722
contentComponent?: React.ComponentType<any>;
723723
}>
@@ -751,7 +751,7 @@ const Tooltip = Object.assign<typeof _componentTooltip, NestedComponentMeta>(_co
751751
type ITooltipBorderProps = React.PropsWithChildren<{
752752
color?: string;
753753
dashStyle?: DashStyle;
754-
opacity?: number;
754+
opacity?: number | undefined;
755755
visible?: boolean;
756756
width?: number;
757757
}>

packages/devextreme-react/src/box.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const Box = memo(
9292
// Box
9393
type IItemProps = React.PropsWithChildren<{
9494
baseSize?: number | string;
95-
box?: dxBoxOptions;
95+
box?: dxBoxOptions | undefined;
9696
disabled?: boolean;
9797
html?: string;
9898
ratio?: number;

packages/devextreme-react/src/bullet.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const Bullet = memo(
7676
type IBorderProps = React.PropsWithChildren<{
7777
color?: string;
7878
dashStyle?: DashStyle;
79-
opacity?: number;
79+
opacity?: number | undefined;
8080
visible?: boolean;
8181
width?: number;
8282
}>
@@ -184,8 +184,8 @@ const Shadow = Object.assign<typeof _componentShadow, NestedComponentMeta>(_comp
184184
// owners:
185185
// Bullet
186186
type ISizeProps = React.PropsWithChildren<{
187-
height?: number;
188-
width?: number;
187+
height?: number | undefined;
188+
width?: number | undefined;
189189
}>
190190
const _componentSize = (props: ISizeProps) => {
191191
return React.createElement(NestedOption<ISizeProps>, {
@@ -207,20 +207,20 @@ type ITooltipProps = React.PropsWithChildren<{
207207
border?: Record<string, any> | {
208208
color?: string;
209209
dashStyle?: DashStyle;
210-
opacity?: number;
210+
opacity?: number | undefined;
211211
visible?: boolean;
212212
width?: number;
213213
};
214214
color?: string;
215-
container?: any | string;
216-
contentTemplate?: ((pointsInfo: any, element: any) => string | any) | template;
215+
container?: any | string | undefined;
216+
contentTemplate?: ((pointsInfo: any, element: any) => string | any) | template | undefined;
217217
cornerRadius?: number;
218-
customizeTooltip?: ((pointsInfo: any) => Record<string, any>);
218+
customizeTooltip?: ((pointsInfo: any) => Record<string, any>) | undefined;
219219
enabled?: boolean;
220220
font?: ChartsFont;
221-
format?: LocalizationFormat;
221+
format?: LocalizationFormat | undefined;
222222
interactive?: boolean;
223-
opacity?: number;
223+
opacity?: number | undefined;
224224
paddingLeftRight?: number;
225225
paddingTopBottom?: number;
226226
shadow?: Record<string, any> | {
@@ -230,7 +230,7 @@ type ITooltipProps = React.PropsWithChildren<{
230230
offsetY?: number;
231231
opacity?: number;
232232
};
233-
zIndex?: number;
233+
zIndex?: number | undefined;
234234
contentRender?: (...params: any) => React.ReactNode;
235235
contentComponent?: React.ComponentType<any>;
236236
}>

0 commit comments

Comments
 (0)