Skip to content

Commit

Permalink
feat(list-picker, select): support triggerLoading prop (#2065)
Browse files Browse the repository at this point in the history
Co-authored-by: maxin <maxin@growingio.com>
  • Loading branch information
nnmax and maxin committed Jun 9, 2022
1 parent c90349c commit 1273841
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/list-picker/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ export interface ListPickerProps
* 自定义后缀的icon
*/
triggerSuffix?: React.ReactNode;
/**
* InputButton 触发器的 loading prop
*/
triggerLoading?: InputButtonProps['loading'];
maxWidth?: number;
hidePrefix?: boolean;

Expand Down
2 changes: 2 additions & 0 deletions src/list-picker/listPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const ListPicker: React.FC<ListPickerProps> = (props) => {
autoWidth = false,
strategy = 'fixed',
max,
triggerLoading,
...rest
} = props;
const defaultPrefix = usePrefixCls(prefixCls);
Expand Down Expand Up @@ -175,6 +176,7 @@ export const ListPicker: React.FC<ListPickerProps> = (props) => {
visible={visible}
hidePrefix={hidePrefix}
data-testid={isNil(rest['data-testid']) ? `${DEFAULT_DATA_TESTID}-trigger` : `${rest['data-testid']}-trigger`}
loading={triggerLoading}
>
{children}
</Trigger>
Expand Down
2 changes: 2 additions & 0 deletions src/select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const Select: React.FC<SelectProps> & { isSelect?: boolean } = (props) => {
autoWidth = false,
empty,
needEmpty = true,
triggerLoading,
// list props
...rest
} = props;
Expand Down Expand Up @@ -112,6 +113,7 @@ const Select: React.FC<SelectProps> & { isSelect?: boolean } = (props) => {
title={title}
onClick={triggerClick}
data-testid={rest?.['data-testid'] ? rest?.['data-testid'] : 'select'}
loading={triggerLoading}
/>
);
};
Expand Down
4 changes: 4 additions & 0 deletions src/select/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export interface SelectProps extends Omit<ListProps, 'model' | 'onChange' | 'opt
* 自定义后缀的icon
*/
triggerSuffix?: React.ReactNode;
/**
* InputButton 触发器的 loading prop
*/
triggerLoading?: InputButtonProps['loading'];
maxWidth?: number;
hidePrefix?: boolean;
/**
Expand Down

1 comment on commit 1273841

@vercel
Copy link

@vercel vercel bot commented on 1273841 Jun 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

gio-design – ./

gio-design-growingio.vercel.app
gio-design-git-master-growingio.vercel.app
gio-design.vercel.app

Please sign in to comment.