Skip to content

Commit de0028d

Browse files
committed
fix(suir): Merge exported component prop types into single type.
1 parent e0b8af4 commit de0028d

File tree

9 files changed

+36
-18
lines changed

9 files changed

+36
-18
lines changed

packages/suir-component-mapper/src/files/checkbox.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ export interface CheckboxOption extends AnyObject {
99
value?: any;
1010
}
1111

12-
export interface CheckboxProps extends SuirCheckboxProps {
12+
interface InternalCheckboxProps extends SuirCheckboxProps {
1313
options?: CheckboxOption[];
1414
/** Sub components customization API */
1515
FormFieldProps?: FormFieldProps;
1616
HeaderProps?: HeaderProps;
1717
OptionsListProps?: React.HTMLProps<HTMLDivElement>;
1818
}
1919

20-
declare const Checkbox: React.ComponentType<CheckboxProps & CommonFieldProps & UseFieldApiComponentConfig>;
20+
export type CheckboxProps = InternalCheckboxProps & CommonFieldProps & UseFieldApiComponentConfig;
21+
22+
declare const Checkbox: React.ComponentType<CheckboxProps>;
2123

2224
export default Checkbox;
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer";
22
import { CommonFieldProps } from "./common-field-props";
33

4-
export interface DatePickerProps {}
4+
interface InternalDatePickerProps extends React.HTMLProps<HTMLInputElement> {}
55

6-
declare const DatePicker: React.ComponentType<DatePickerProps & CommonFieldProps & UseFieldApiComponentConfig>;
6+
export type DatePickerProps = InternalDatePickerProps & CommonFieldProps & UseFieldApiComponentConfig;
7+
8+
declare const DatePicker: React.ComponentType<DatePickerProps>;
79

810
export default DatePicker;

packages/suir-component-mapper/src/files/dual-list-select.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface DualListSelectOptionProps extends React.HTMLProps<HTMLDivElemen
1212
selectedClassName?: string;
1313
}
1414

15-
export interface DualListSelectProps {
15+
interface InternalDualListSelectProps {
1616
leftTitle?: ReactNode;
1717
rightTitle?: ReactNode;
1818
moveLeftTitle?: ReactNode;
@@ -43,6 +43,8 @@ export interface DualListSelectProps {
4343
ValuesHeaderProps?: HeaderProps;
4444
}
4545

46-
declare const DualListSelect: React.ComponentType<DualListSelectProps & CommonFieldProps & UseFieldApiComponentConfig>;
46+
export type DualListSelectProps = InternalDualListSelectProps & CommonFieldProps & UseFieldApiComponentConfig;
47+
48+
declare const DualListSelect: React.ComponentType<DualListSelectProps>;
4749

4850
export default DualListSelect;

packages/suir-component-mapper/src/files/radio.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ export interface RadioOption {
88
value?: any;
99
}
1010

11-
export interface RadioProps extends FormRadioProps {
11+
interface InternalRadioProps extends FormRadioProps {
1212
options?: RadioOption;
1313
FormFieldProps?: FormFieldProps;
1414
}
1515

16-
declare const Radio: React.ComponentType<RadioProps & CommonFieldProps & UseFieldApiComponentConfig>;
16+
export type RadioProps = InternalRadioProps & CommonFieldProps & UseFieldApiComponentConfig;
17+
18+
declare const Radio: React.ComponentType<RadioProps>;
1719

1820
export default Radio;

packages/suir-component-mapper/src/files/select.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface SelectOption extends AnyObject {
88
value?: any;
99
}
1010

11-
export interface SelectProps extends StrictDropdownProps {
11+
interface InternalSelectProps extends StrictDropdownProps {
1212
[key: string]: any;
1313
options?: SelectOption[];
1414
isSearchable?: boolean;
@@ -20,6 +20,8 @@ export interface SelectProps extends StrictDropdownProps {
2020
closeMenuOnSelect?: boolean;
2121
}
2222

23-
declare const Select: React.ComponentType<SelectProps & CommonFieldProps & UseFieldApiComponentConfig>;
23+
export type SelectProps = InternalSelectProps & CommonFieldProps & UseFieldApiComponentConfig;
24+
25+
declare const Select: React.ComponentType<SelectProps>;
2426

2527
export default Select;

packages/suir-component-mapper/src/files/switch.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-render
33
import { FormFieldProps } from "semantic-ui-react";
44
import { ReactNode } from "react";
55

6-
export interface SwitchProps extends FormFieldProps {
6+
interface InternalSwitchProps extends FormFieldProps {
77
onText?: ReactNode;
88
offText?: ReactNode;
99
}
1010

11-
declare const Switch: React.ComponentType<SwitchProps & CommonFieldProps & UseFieldApiComponentConfig>;
11+
export type SwitchProps = InternalSwitchProps & CommonFieldProps & UseFieldApiComponentConfig;
12+
13+
declare const Switch: React.ComponentType<SwitchProps>;
1214

1315
export default Switch;

packages/suir-component-mapper/src/files/text-field.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ import { CommonFieldProps } from "./common-field-props";
22
import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer";
33
import { InputProps } from "semantic-ui-react";
44

5-
export interface TextFieldProps extends InputProps {
5+
interface InternalTextFieldProps extends InputProps {
66
placeholder?: string;
77
}
88

9-
declare const TextField: React.ComponentType<TextFieldProps & CommonFieldProps & UseFieldApiComponentConfig>;
9+
export type TextFieldProps = InternalTextFieldProps & CommonFieldProps & UseFieldApiComponentConfig;
10+
11+
declare const TextField: React.ComponentType<TextFieldProps>;
1012

1113
export default TextField;

packages/suir-component-mapper/src/files/textarea.d.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ import { CommonFieldProps } from "./common-field-props";
22
import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer";
33
import { FormTextAreaProps } from "semantic-ui-react";
44

5-
export interface TextareaProps extends FormTextAreaProps {}
5+
interface InternalTextareaProps extends FormTextAreaProps {}
66

7-
declare const Textarea: React.ComponentType<TextareaProps & CommonFieldProps & UseFieldApiComponentConfig>;
7+
export type TextareaProps = InternalTextareaProps & CommonFieldProps & UseFieldApiComponentConfig;
8+
9+
declare const Textarea: React.ComponentType<TextareaProps>;
810

911
export default Textarea;
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { UseFieldApiComponentConfig } from "@data-driven-forms/react-form-renderer";
22
import { CommonFieldProps } from "./common-field-props";
33

4-
export interface DatePickerProps {}
4+
interface InternalDatePickerProps {}
55

6-
declare const DatePicker: React.ComponentType<DatePickerProps & CommonFieldProps & UseFieldApiComponentConfig>;
6+
export type DatePickerProps = InternalDatePickerProps & CommonFieldProps & UseFieldApiComponentConfig;
7+
8+
declare const DatePicker: React.ComponentType<DatePickerProps>;
79

810
export default DatePicker;

0 commit comments

Comments
 (0)