From efeac3258dc2de78b456f90308f1a0a73f64180e Mon Sep 17 00:00:00 2001 From: zaycker Date: Sat, 4 Aug 2018 22:08:24 +0300 Subject: [PATCH 1/2] Added absent rc-select props: to Select: + getInputElement + id + labelInValue + maxTagCount + maxTagPlaceholder + onBlur + onFocus + onInputKeyDown + onPopupScroll + placeholder + showAction + showArrow + tokenSeparators to Option: + title Sorted alph-ly --- types/rc-select/index.d.ts | 60 +++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/types/rc-select/index.d.ts b/types/rc-select/index.d.ts index b78fc03837..a27ee36784 100644 --- a/types/rc-select/index.d.ts +++ b/types/rc-select/index.d.ts @@ -20,41 +20,55 @@ export { declare namespace RcSelect { interface SelectProps { - className?: string; - prefixCls?: string; - animation?: string; - transitionName?: string; - choiceTransitionName?: string; - dropdownMatchSelectWidth?: boolean; - dropdownClassName?: string; - dropdownStyle?: { [key: string]: string }; - dropdownMenuStyle?: { [key: string]: string }; - notFoundContent?: string; - showSearch?: boolean; allowClear?: boolean; - tags?: boolean; - maxTagTextLength?: number; + animation?: string; + choiceTransitionName?: string; + className?: string; combobox?: boolean; - multiple?: boolean; - disabled?: boolean; - filterOption?: boolean; - optionFilterProp?: string; - optionLabelProp?: string; + defaultActiveFirstOption?: boolean; + defaultLabel?: string | Array; defaultValue?: string | Array; - value?: string | Array; + disabled?: boolean; + dropdownClassName?: string; + dropdownMatchSelectWidth?: boolean; + dropdownMenuStyle?: { [key: string]: string }; + dropdownStyle?: { [key: string]: string }; + filterOption?: boolean; + getPopupContainer?: (trigger: Node) => Node; + getInputElement?: () => Node; + id?: string; + labelInValue?: boolean; + maxTagCount?: number; + maxTagPlaceholder?: React.ReactNode | Function; + maxTagTextLength?: number; + multiple?: boolean; + notFoundContent?: string; + onBlur?: Function; onChange?: (value: string, label: string) => void; + onDeselect?: Function; + onFocus?: Function; + onInputKeyDown?: Function; + onPopupScroll?: Function; onSearch?: Function; onSelect?: (value: string, ontion: Option) => void; - onDeselect?: Function; - defaultLabel?: string | Array; - defaultActiveFirstOption?: boolean; - getPopupContainer?: (trigger: Node) => Node; + optionFilterProp?: string; + optionLabelProp?: string; + placeholder?: React.ReactNode; + prefixCls?: string; + showAction?: string[]; + showArrow?: boolean; + showSearch?: boolean; + tags?: boolean; + tokenSeparators?: string[]; + transitionName?: string; + value?: string | Array; } export class Select extends React.Component { } interface OptionProps { className?: string; disabled?: boolean; key?: string; + title?: string; value?: string; } export class Option extends React.Component { } From 3b0f9cd73721229eba9b10f9119da8547b217f48 Mon Sep 17 00:00:00 2001 From: zaycker Date: Thu, 23 Aug 2018 17:59:32 +0300 Subject: [PATCH 2/2] [rc-select] most of Functions replaced by more special definitions --- types/rc-select/index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/types/rc-select/index.d.ts b/types/rc-select/index.d.ts index a27ee36784..30fc16507f 100644 --- a/types/rc-select/index.d.ts +++ b/types/rc-select/index.d.ts @@ -43,13 +43,13 @@ declare namespace RcSelect { maxTagTextLength?: number; multiple?: boolean; notFoundContent?: string; - onBlur?: Function; + onBlur?: () => void; onChange?: (value: string, label: string) => void; - onDeselect?: Function; - onFocus?: Function; - onInputKeyDown?: Function; - onPopupScroll?: Function; - onSearch?: Function; + onDeselect?: (value: string, option: Option) => void; + onFocus?: () => void; + onInputKeyDown?: (e: Event) => void; + onPopupScroll?: () => void; + onSearch?: () => void; onSelect?: (value: string, ontion: Option) => void; optionFilterProp?: string; optionLabelProp?: string;