Skip to content

Commit c0dae1e

Browse files
committed
chore(html): resolve defaultProps deprecations
1 parent 45cf0c5 commit c0dae1e

File tree

238 files changed

+973
-955
lines changed

Some content is hidden

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

238 files changed

+973
-955
lines changed

packages/html/src/action-buttons/action-buttons.spec.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type KendoActionButtonsProps = {
1111
orientation?: 'horizontal' | 'vertical';
1212
};
1313

14-
const defaultProps = {
14+
const defaultOptions = {
1515
alignment: 'start',
1616
orientation: 'horizontal'
1717
};
@@ -21,8 +21,8 @@ export const ActionButtons = (
2121
React.HTMLAttributes<HTMLDivElement>
2222
) => {
2323
const {
24-
alignment = defaultProps.alignment,
25-
orientation = defaultProps.orientation,
24+
alignment = defaultOptions.alignment,
25+
orientation = defaultOptions.orientation,
2626
...other
2727
} = props;
2828

@@ -45,6 +45,6 @@ export const ActionButtons = (
4545
ActionButtons.states = states;
4646
ActionButtons.options = options;
4747
ActionButtons.className = ACTIONBUTTONS_CLASSNAME;
48-
ActionButtons.defaultProps = defaultProps;
48+
ActionButtons.defaultOptions = defaultOptions;
4949

5050
export default ActionButtons;

packages/html/src/action-sheet/action-sheet.spec.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type KendoActionSheetProps = {
2020
side?: 'top' | 'right' | 'bottom' | 'left';
2121
}
2222

23-
const defaultProps = {
23+
const defaultOptions = {
2424
side: 'bottom',
2525
fullscreen: false,
2626
adaptive: false,
@@ -32,15 +32,15 @@ export const ActionSheet = (
3232
React.HTMLAttributes<HTMLDivElement>
3333
) => {
3434
const {
35+
side = defaultOptions.side,
36+
fullscreen = defaultOptions.fullscreen,
37+
adaptive = defaultOptions.adaptive,
38+
overlay = defaultOptions.overlay,
3539
children,
3640
title,
3741
header,
3842
footer,
3943
actions,
40-
side = defaultProps.side,
41-
fullscreen = defaultProps.fullscreen,
42-
adaptive = defaultProps.adaptive,
43-
overlay = defaultProps.overlay,
4444
...other
4545
} = props;
4646

@@ -115,6 +115,6 @@ export const ActionSheet = (
115115
ActionSheet.states = states;
116116
ActionSheet.options = options;
117117
ActionSheet.className = ACTIONSHEET_CLASSNAME;
118-
ActionSheet.defaultProps = defaultProps;
118+
ActionSheet.defaultOptions = defaultOptions;
119119

120120
export default ActionSheet;

packages/html/src/animation-container/animation-container.spec.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ const states = [];
77
const options = {};
88

99
export type KendoAnimationContainerProps = {
10-
positionMode: "absolute" | "fixed";
10+
positionMode?: "absolute" | "fixed";
1111
offset?: {
1212
top: number | string;
1313
left: number | string;
1414
};
1515
animationStyle?: React.CSSProperties;
1616
};
1717

18-
const defaultProps = {
18+
const defaultOptions = {
1919
positionMode: "absolute"
2020
};
2121

@@ -25,7 +25,7 @@ export const AnimationContainer = (
2525
React.HTMLAttributes<HTMLDivElement>
2626
) => {
2727
const {
28-
positionMode,
28+
positionMode = defaultOptions.positionMode,
2929
animationStyle,
3030
offset,
3131
...other
@@ -54,6 +54,6 @@ export const AnimationContainer = (
5454
AnimationContainer.states = states;
5555
AnimationContainer.options = options;
5656
AnimationContainer.className = ANIMATION_CONTAINER_CLASSNAME;
57-
AnimationContainer.defaultProps = defaultProps;
57+
AnimationContainer.defaultOptions = defaultOptions;
5858

5959
export default AnimationContainer;

packages/html/src/appbar/appbar.spec.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const options = {
2020
ThemeColor.inverse
2121
],
2222
};
23-
const defaultProps = {};
23+
const defaultOptions = {};
2424

2525
export type KendoAppbarOptions = {
2626
themeColor?: (typeof options.themeColor)[number] | null;
@@ -65,6 +65,6 @@ export const Appbar = (
6565
Appbar.states = states;
6666
Appbar.options = options;
6767
Appbar.className = APPBAR_CLASSNAME;
68-
Appbar.defaultProps = defaultProps;
68+
Appbar.defaultOptions = defaultOptions;
6969

7070
export default Appbar;

packages/html/src/autocomplete/autocomplete.spec.tsx

+12-11
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ const options = {
3131
rounded: [ Roundness.small, Roundness.medium, Roundness.large, Roundness.full ],
3232
fillMode: [ FillMode.solid, FillMode.flat, FillMode.outline ],
3333
};
34-
const defaultProps = {
35-
size: Input.defaultProps.size,
36-
rounded: Input.defaultProps.rounded,
37-
fillMode: Input.defaultProps.fillMode,
38-
separators: true
39-
};
4034

4135
export type KendoAutocompleteOptions = {
4236
size?: (typeof options.size)[number] | null;
@@ -58,20 +52,27 @@ export type KendoAutocompleteProps = KendoAutocompleteOptions & {
5852

5953
export type KendoAutocompleteState = { [K in (typeof states)[number]]?: boolean };
6054

55+
const defaultOptions = {
56+
size: Input.defaultOptions.size,
57+
rounded: Input.defaultOptions.rounded,
58+
fillMode: Input.defaultOptions.fillMode,
59+
separators: true
60+
};
61+
6162
export const Autocomplete = (
6263
props: KendoAutocompleteProps &
6364
KendoAutocompleteState &
6465
React.HTMLAttributes<HTMLSpanElement>
6566
) => {
6667
const {
68+
size = defaultOptions.size,
69+
rounded = defaultOptions.rounded,
70+
fillMode = defaultOptions.fillMode,
71+
separators = defaultOptions.separators,
6772
prefix,
6873
suffix,
69-
separators = defaultProps.separators,
7074
value,
7175
placeholder,
72-
size,
73-
rounded,
74-
fillMode,
7576
hover,
7677
focus,
7778
valid,
@@ -160,6 +161,6 @@ export const Autocomplete = (
160161
Autocomplete.states = states;
161162
Autocomplete.options = options;
162163
Autocomplete.className = AUTOCOMPLETE_CLASSNAME;
163-
Autocomplete.defaultProps = defaultProps;
164+
Autocomplete.defaultOptions = defaultOptions;
164165

165166
export default Autocomplete;

packages/html/src/avatar/avatar.spec.tsx

+8-8
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export type KendoAvatarProps = KendoAvatarOptions & {
4949

5050
export type KendoAvatarState = { [K in (typeof states)[number]]?: boolean };
5151

52-
const defaultProps = {
52+
const defaultOptions = {
5353
type: avatarType.TEXT,
5454
size: Size.medium,
5555
rounded: Roundness.full,
@@ -64,12 +64,12 @@ export const Avatar = (
6464
React.HTMLAttributes<HTMLDivElement>
6565
) => {
6666
const {
67-
size = defaultProps.size,
68-
rounded = defaultProps.rounded,
69-
fillMode = defaultProps.fillMode,
70-
themeColor = defaultProps.themeColor,
71-
type = defaultProps.type,
72-
border = defaultProps.border,
67+
size = defaultOptions.size,
68+
rounded = defaultOptions.rounded,
69+
fillMode = defaultOptions.fillMode,
70+
themeColor = defaultOptions.themeColor,
71+
type = defaultOptions.type,
72+
border = defaultOptions.border,
7373
...other
7474
} = props;
7575

@@ -100,6 +100,6 @@ export const Avatar = (
100100
Avatar.states = states;
101101
Avatar.options = options;
102102
Avatar.className = AVATAR_CLASSNAME;
103-
Avatar.defaultProps = defaultProps;
103+
Avatar.defaultOptions = defaultOptions;
104104

105105
export default Avatar;

packages/html/src/badge/badge.spec.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export type KendoBadgeProps = KendoBadgeOptions & {
3636
align?: null | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
3737
};
3838

39-
const defaultProps = {
39+
const defaultOptions = {
4040
size: Size.medium,
4141
fillMode: FillMode.solid,
4242
themeColor: ThemeColor.primary,
@@ -48,11 +48,11 @@ export const Badge = (
4848
React.HTMLAttributes<HTMLSpanElement>
4949
) => {
5050
const {
51-
size = defaultProps.size,
51+
size = defaultOptions.size,
52+
fillMode = defaultOptions.fillMode,
53+
themeColor = defaultOptions.themeColor,
54+
cutoutBorder = defaultOptions.cutoutBorder,
5255
rounded,
53-
fillMode = defaultProps.fillMode,
54-
themeColor = defaultProps.themeColor,
55-
cutoutBorder = defaultProps.cutoutBorder,
5656
position,
5757
align,
5858
...other
@@ -85,6 +85,6 @@ export const Badge = (
8585
Badge.states = states;
8686
Badge.options = options;
8787
Badge.className = BADGE_CLASSNAME;
88-
Badge.defaultProps = defaultProps;
88+
Badge.defaultOptions = defaultOptions;
8989

9090
export default Badge;

packages/html/src/bottom-nav/bottom-nav-item.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type KendoBottomNavItemProps = {
2020

2121
export type KendoBottomNavItemState = { [K in (typeof states)[number]]?: boolean };
2222

23-
const defaultProps = {};
23+
const defaultOptions = {};
2424

2525
export const BottomNavItem = (
2626
props: KendoBottomNavItemProps &
@@ -57,6 +57,6 @@ export const BottomNavItem = (
5757
BottomNavItem.states = states;
5858
BottomNavItem.options = options;
5959
BottomNavItem.className = BOTTOM_NAV_ITEM_CLASSNAME;
60-
BottomNavItem.defaultProps = defaultProps;
60+
BottomNavItem.defaultOptions = defaultOptions;
6161

6262
export default BottomNavItem;

packages/html/src/bottom-nav/bottom-nav.spec.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export type KendoBottomNavProps = KendoBottomNavOptions & {
3636

3737
export type KendoBottomNavState = { [K in (typeof states)[number]]?: boolean };
3838

39-
const defaultProps = {
39+
const defaultOptions = {
4040
fillMode: FillMode.flat,
4141
themeColor: ThemeColor.primary,
4242
flow: 'horizontal',
@@ -50,10 +50,10 @@ export const BottomNav = (
5050
) => {
5151
const {
5252
disabled,
53-
fillMode = defaultProps.fillMode,
54-
themeColor = defaultProps.themeColor,
55-
flow = defaultProps.flow,
56-
border = defaultProps.border,
53+
fillMode = defaultOptions.fillMode,
54+
themeColor = defaultOptions.themeColor,
55+
flow = defaultOptions.flow,
56+
border = defaultOptions.border,
5757
positionMode,
5858
dir
5959
} = props;
@@ -83,6 +83,6 @@ export const BottomNav = (
8383
BottomNav.states = states;
8484
BottomNav.options = options;
8585
BottomNav.className = BOTTOM_NAV_CLASSNAME;
86-
BottomNav.defaultProps = defaultProps;
86+
BottomNav.defaultOptions = defaultOptions;
8787

8888
export default BottomNav;

packages/html/src/breadcrumb/breadcrumb-container.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type KendoBreadcrumbContainerProps = {
66
collapsing?: null | 'auto' | 'none' | 'wrap';
77
};
88

9-
const defaultProps = {
9+
const defaultOptions = {
1010
collapsing: 'auto'
1111
};
1212

@@ -15,7 +15,7 @@ export const BreadcrumbContainer = (
1515
React.HTMLAttributes<HTMLElement>
1616
) => {
1717
const {
18-
collapsing = defaultProps.collapsing,
18+
collapsing = defaultOptions.collapsing,
1919
...other
2020
} = props;
2121

packages/html/src/breadcrumb/breadcrumb.spec.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export type KendoBreadcrumbProps = {
1717

1818
export type KendoBreadcrumbState = { [K in (typeof states)[number]]?: boolean };
1919

20-
const defaultProps = {
20+
const defaultOptions = {
2121
collapsing: 'auto',
2222
size: Size.medium
2323
};
@@ -28,8 +28,8 @@ export const Breadcrumb = (
2828
React.HTMLAttributes<HTMLElement>
2929
) => {
3030
const {
31-
size = defaultProps.size,
32-
collapsing = defaultProps.collapsing,
31+
size = defaultOptions.size,
32+
collapsing = defaultOptions.collapsing,
3333
focus,
3434
...other
3535
} = props;
@@ -58,6 +58,6 @@ export const Breadcrumb = (
5858
Breadcrumb.states = states;
5959
Breadcrumb.options = options;
6060
Breadcrumb.className = BREADCRUMB_CLASSNAME;
61-
Breadcrumb.defaultProps = defaultProps;
61+
Breadcrumb.defaultOptions = defaultOptions;
6262

6363
export default Breadcrumb;

packages/html/src/button-group/button-group.spec.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type KendoButtonGroupProps = KendoButtonGroupOptions & {
2020

2121
export type KendoButtonGroupState = { [K in (typeof states)[number]]?: boolean };
2222

23-
const defaultProps = {
23+
const defaultOptions = {
2424
fillMode: FillMode.solid
2525
};
2626

@@ -30,7 +30,7 @@ export const ButtonGroup = (
3030
React.HTMLAttributes<HTMLDivElement>
3131
) => {
3232
const {
33-
fillMode = defaultProps.fillMode,
33+
fillMode = defaultOptions.fillMode,
3434
disabled,
3535
stretched,
3636
...other
@@ -61,6 +61,6 @@ export const ButtonGroup = (
6161
ButtonGroup.states = states;
6262
ButtonGroup.options = options;
6363
ButtonGroup.className = BUTTONGROUP_CLASSNAME;
64-
ButtonGroup.defaultProps = defaultProps;
64+
ButtonGroup.defaultOptions = defaultOptions;
6565

6666
export default ButtonGroup;

0 commit comments

Comments
 (0)