Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Align cascader loading style & update doc #17550

Merged
merged 1 commit into from Jul 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 14 additions & 3 deletions components/cascader/index.en-US.md
Expand Up @@ -14,8 +14,8 @@ Cascade selection box.

## API

```html
<Cascader options="{options}" onChange="{onChange}" />
```jsx
<Cascader options={options} onChange={onChange} />
```

| Property | Description | Type | Default |
Expand All @@ -32,7 +32,7 @@ Cascade selection box.
| getPopupContainer | Parent Node which the selector should be rendered to. Default to `body`. When position issues happen, try to modify it into scrollable content and position it relative.[example](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body |
| loadData | To load option lazily, and it cannot work with `showSearch` | `(selectedOptions) => void` | - |
| notFoundContent | Specify content to show when no result matches. | string | 'Not Found' |
| options | data options of cascade | object | - |
| options | data options of cascade | [Option](#Option)[] | - |
| placeholder | input placeholder | string | 'Please select' |
| popupClassName | additional className of popup overlay | string | - |
| popupPlacement | use preset popup align config from builtinPlacements:`bottomLeft` `bottomRight` `topLeft` `topRight` | string | `bottomLeft` |
Expand All @@ -55,6 +55,17 @@ Fields in `showSearch`:
| render | Used to render filtered options. | `function(inputValue, path): ReactNode` | |
| sort | Used to sort filtered options. | `function(a, b, inputValue)` | |

### Option

```typescript
interface Option {
value: string;
label?: React.ReactNode;
disabled?: boolean;
children?: Option[];
}
```

## Methods

| Name | Description |
Expand Down
17 changes: 14 additions & 3 deletions components/cascader/index.zh-CN.md
Expand Up @@ -15,8 +15,8 @@ subtitle: 级联选择

## API

```html
<Cascader options="{options}" onChange="{onChange}" />
```jsx
<Cascader options={options} onChange={onChange} />
```

| 参数 | 说明 | 类型 | 默认值 |
Expand All @@ -33,7 +33,7 @@ subtitle: 级联选择
| getPopupContainer | 菜单渲染父节点。默认渲染到 body 上,如果你遇到菜单滚动定位问题,试试修改为滚动的区域,并相对其定位。[示例](https://codepen.io/afc163/pen/zEjNOy?editors=0010) | Function(triggerNode) | () => document.body |
| loadData | 用于动态加载选项,无法与 `showSearch` 一起使用 | `(selectedOptions) => void` | - |
| notFoundContent | 当下拉列表为空时显示的内容 | string | 'Not Found' |
| options | 可选项数据源 | object | - |
| options | 可选项数据源 | [Option](#Option)[] | - |
| placeholder | 输入框占位文本 | string | '请选择' |
| popupClassName | 自定义浮层类名 | string | - |
| popupPlacement | 浮层预设位置:`bottomLeft` `bottomRight` `topLeft` `topRight` | Enum | `bottomLeft` |
Expand All @@ -56,6 +56,17 @@ subtitle: 级联选择
| render | 用于渲染 filter 后的选项 | `function(inputValue, path): ReactNode` | |
| sort | 用于排序 filter 后的选项 | `function(a, b, inputValue)` | |

### Option

```typescript
interface Option {
value: string;
label?: React.ReactNode;
disabled?: boolean;
children?: Option[];
}
```

## 方法

| 名称 | 描述 |
Expand Down
2 changes: 1 addition & 1 deletion components/cascader/style/index.less
Expand Up @@ -211,7 +211,7 @@
}

&-expand &-expand-icon,
&-expand &-loading-icon {
&-loading-icon {
.iconfont-size-under-12px(10px);

position: absolute;
Expand Down