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(search): fix border radius #208

Merged
merged 5 commits into from
Mar 3, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/pages/search/search.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
t-class-cancel="t-class-cancel"
value="{{item.keyword}}"
placeholder="{{item.placeholder}}"
action-text="{{item.actionText}}"
action="{{item.actionText}}"
data-idx="{{index}}"
bind:blur="blurHandle"
bind:focus="focusHandle"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@
"dependencies": {
"dayjs": "^1.10.7"
}
}
}
4 changes: 4 additions & 0 deletions src/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ export interface KeysType {
value?: string;
label?: string;
}

export interface HTMLElementAttributes {
[css: string]: string;
}
3 changes: 1 addition & 2 deletions src/search/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ Page({
action | String / Slot | '' | 自定义右侧操作按钮文字 | N
center | Boolean | false | 是否居中 | N
disabled | Boolean | false | 是否禁用 | N
external-classes | Array | - | 组件外部样式类名,分别用于设置组件外层类名、组件 input 类名、右侧 cancel 文本类名、左侧图标类名、右侧图标类型。`['t-class','t-class-input','t-class-cancel','t-class-left','t-class-right']` | N
external-classes | Array | - | 组件外部样式类名,分别用于设置组件外层类名、输入框类名、输入框容器类名、右侧 cancel 文本类名、左侧图标类名、右侧图标类型。`['t-class', 't-class-input', 't-class-input-container', 't-class-cancel','t-class-left','t-class-right']` | N
focus | Boolean | false | 是否聚焦 | N
label | String | '' | 左侧文本 | N
left-icon | String / Slot | 'search' | 左侧图标 | N
placeholder | String | '' | 占位符 | N
right-icon | String / Slot | 'close' | 右侧图标 | N
shape | String | 'square' | 搜索框形状。可选项:square/round | N
value | String | '' | 值 | N
defaultValue | String | '' | (非受控)值 | N

### Search Events

Expand Down
7 changes: 1 addition & 6 deletions src/search/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const props: TdSearchProps = {
type: Boolean,
value: false,
},
/** 组件外部样式类名,分别用于设置组件外层类名、组件 input 类名、右侧 cancel 文本类名、左侧图标类名、右侧图标类型 */
/** 组件外部样式类名,分别用于设置组件外层类名、输入框类名、输入框容器类名、右侧 cancel 文本类名、左侧图标类名、右侧图标类型 */
externalClasses: {
type: Array,
},
Expand Down Expand Up @@ -60,11 +60,6 @@ const props: TdSearchProps = {
type: String,
value: '',
},
/** 值 - 非受控 */
defaultValue: {
type: null,
value: undefined,
},
};

export default props;
2 changes: 1 addition & 1 deletion src/search/search.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
@search-input-padding-vertical: 16rpx;
@search-input-padding-horizontal: 24rpx;
@search-input-radius-square: 8rpx;
@search-input-radius-round: @search-input-height / 2;
@search-input-radius-round: 40rpx;
@search-input-font-size: @font-size-m;
@h-space-nest: @spacer;

Expand Down
1 change: 1 addition & 0 deletions src/search/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const name = `${prefix}-search`;
export default class Search extends SuperComponent {
externalClasses = [
`${prefix}-class`,
`${prefix}-class-input-container`,
`${prefix}-class-input`,
`${prefix}-class-cancel`,
`${prefix}-class-left`,
Expand Down
2 changes: 1 addition & 1 deletion src/search/search.wxml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<view class="{{classPrefix}} {{prefix}}-class">
<view
class="{{classPrefix}}__input-box {{prefix}}-{{localValue.focus ? 'is-focused' : 'not-focused'}} {{classPrefix}}__input-box--{{center ? 'center' : ''}} {{classPrefix}}__input-box--{{shape}} "
class="{{classPrefix}}__input-box {{prefix}}-{{localValue.focus ? 'is-focused' : 'not-focused'}} {{classPrefix}}__input-box--{{center ? 'center' : ''}} {{classPrefix}}__input-box--{{shape}} {{prefix}}-class-input-container"
>
<view wx:if="{{label}}" class="{{classPrefix}}__label {{prefix}}-class-label">{{label}}</view>
<slot wx:else name="label" />
Expand Down
20 changes: 9 additions & 11 deletions src/search/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,18 @@ export interface TdSearchProps {
required?: boolean;
};
/**
* 组件外部样式类名,分别用于设置组件外层类名、组件 input 类名、右侧 cancel 文本类名、左侧图标类名、右侧图标类型
* 组件外部样式类名,分别用于设置组件外层类名、输入框类名、输入框容器类名、右侧 cancel 文本类名、左侧图标类名、右侧图标类型
*/
externalClasses?: {
type: ArrayConstructor;
value?: ['t-class', 't-class-input', 't-class-cancel', 't-class-left', 't-class-right'];
value?: [
't-class',
't-class-input',
't-class-input-container',
't-class-cancel',
't-class-left',
't-class-right',
];
required?: boolean;
};
/**
Expand Down Expand Up @@ -103,13 +110,4 @@ export interface TdSearchProps {
value?: string;
required?: boolean;
};
/**
* 值
* @default ''
*/
defaultValue?: {
type: StringConstructor;
value?: string;
required?: boolean;
};
}