Skip to content

Commit 1c6773a

Browse files
committed
feat(select): [select] Additional features xdesign theme adaptation
1 parent f01b660 commit 1c6773a

File tree

12 files changed

+95
-48
lines changed

12 files changed

+95
-48
lines changed

examples/sites/demos/pc/app/select/copy-multi-composition-api.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,35 @@
55
<tiny-select ref="selectTagSelectable" v-model="value1" multiple tag-selectable>
66
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
77
</tiny-select>
8-
<br /><br />
8+
<br />
9+
<br />
910
<p>场景2:多选一键复制所有标签</p>
1011
<br />
1112
<tiny-select ref="selectCopyable" v-model="value2" multiple copyable>
1213
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
1314
</tiny-select>
14-
<br /><br />
15+
<br />
16+
<br />
1517
<p>场景3:多选设置复制文本分隔符</p>
1618
<br />
1719
<tiny-select ref="selectCopyable" v-model="value2" multiple copyable text-split="/">
1820
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
1921
</tiny-select>
20-
<br /><br />
22+
<br />
23+
<br />
24+
<tiny-select
25+
ref="selectCopyable"
26+
v-model="value2"
27+
multiple
28+
copyable
29+
text-split="/"
30+
:multiple-limit="2"
31+
show-limit-text
32+
>
33+
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
34+
</tiny-select>
35+
<br />
36+
<br />
2137
<p>复制到此处:</p>
2238
<tiny-input v-model="copyValue" class="copy-value" type="text"></tiny-input>
2339
</div>

examples/sites/demos/pc/app/select/copy-multi.vue

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,35 @@
55
<tiny-select ref="selectTagSelectable" v-model="value1" multiple tag-selectable>
66
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
77
</tiny-select>
8-
<br /><br />
8+
<br />
9+
<br />
910
<p>场景2:多选一键复制所有标签</p>
1011
<br />
1112
<tiny-select ref="selectCopyable" v-model="value2" multiple copyable>
1213
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
1314
</tiny-select>
14-
<br /><br />
15+
<br />
16+
<br />
1517
<p>场景3:多选设置复制文本分隔符</p>
1618
<br />
1719
<tiny-select ref="selectCopyable" v-model="value2" multiple copyable text-split="/">
1820
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
1921
</tiny-select>
20-
<br /><br />
22+
<br />
23+
<br />
24+
<tiny-select
25+
ref="selectCopyable"
26+
v-model="value2"
27+
multiple
28+
copyable
29+
text-split="/"
30+
:multiple-limit="2"
31+
show-limit-text
32+
>
33+
<tiny-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </tiny-option>
34+
</tiny-select>
35+
<br />
36+
<br />
2137
<p>复制到此处:</p>
2238
<br />
2339
<tiny-input v-model="copyValue" class="copy-value" type="text"></tiny-input>
Lines changed: 3 additions & 0 deletions
Loading

packages/design/saas/src/select/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { iconChevronDown } from '@opentiny/vue-icon'
1+
import { iconChevronDown, iconPlus } from '@opentiny/vue-icon'
2+
import loadingIcon from './icon-loading.svg'
23

34
export default {
45
// 虚拟滚动的默认options不一致
56
baseOpts: { optionHeight: 34, limit: 20 },
67
icons: {
7-
dropdownIcon: iconChevronDown()
8+
dropdownIcon: iconChevronDown(),
9+
addIcon: iconPlus(),
10+
loadingIcon
811
},
912
state: {
1013
sizeMap: {

packages/renderless/src/select/vue.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,8 @@ const initState = ({ reactive, computed, props, api, emitter, parent, constants,
240240
return designConfig.state.autoHideDownIcon
241241
}
242242
return true // tiny 默认为true
243-
})()
243+
})(),
244+
designConfig
244245
})
245246

246247
return state

packages/theme-saas/src/select-dropdown/index.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
}
6060
// tiny 新增
6161
.@{select-dropdown-prefix-cls}__empty-images {
62-
background-image: url('../images/select-nodata.png');
62+
background-image: url('../images/empty-nodata.png');
6363
@apply w-16;
6464
@apply h-16;
6565
@apply mb-2;
@@ -105,7 +105,7 @@
105105
@apply inline-block;
106106
@apply align-top;
107107

108-
.path {
108+
circle{
109109
animation: loading-dash 1.5s ease-in-out infinite;
110110
stroke-dasharray: 90, 150;
111111
stroke-dashoffset: 0;

packages/theme/src/filter-box/index.less

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
height: inherit;
5555
line-height: var(--ti-filter-box-btn-title-line-height);
5656
font-size: var(--ti-filter-box-btn-font-size);
57+
/* TODO: title 这个类名不符合组件类名规范,被公共样式污染,故在此处重置间距为 0.计划优化这个类名 */
58+
margin-right: 0px;
5759

5860
label {
5961
display: inline-block;
@@ -62,7 +64,8 @@
6264
text-overflow: ellipsis;
6365
white-space: nowrap;
6466
color: var(--ti-filter-box-btn-text-color);
65-
margin-right: 4px;
67+
margin-right: 8px;
68+
margin-top: 3px;
6669
}
6770

6871
&.active label {
@@ -112,6 +115,12 @@
112115
}
113116
}
114117

118+
&:hover {
119+
.filter-box-icon {
120+
fill: var(--ti-filter-box-expand-btn-icon-color-hover);
121+
}
122+
}
123+
115124
.filter-icon-close {
116125
width: 16px;
117126
height: 16px;

packages/theme/src/filter-box/vars.less

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
// 按钮水平内边距
2020
--ti-filter-box-btn-padding-horizontal: var(--ti-common-space-2x);
2121
// 按钮文本色
22-
--ti-filter-box-btn-text-color: var(--ti-common-color-text-primary);
22+
--ti-filter-box-btn-text-color: var(--ti-common-color-text-weaken);
2323
// 按钮悬浮文本色和图标色
2424
--ti-filter-box-btn-hover-text-color: var(--ti-common-color-text-primary);
2525
// 按钮文本字号
26-
--ti-filter-box-btn-font-size: var(--ti-common-font-size-base, 12px);
26+
--ti-filter-box-btn-font-size: var(--ti-common-font-size-0, 12px);
2727
// 按钮文本行高
2828
--ti-filter-box-btn-title-line-height: var(--ti-common-line-height-number);
2929
// 按钮问号图标色
@@ -33,7 +33,9 @@
3333
// 按钮问号top定位(hide)
3434
--ti-filter-box-help-btn-position-top: var(--ti-common-space-base);
3535
// 按钮展开图标色
36-
--ti-filter-box-expand-btn-icon-color: var(--ti-common-color-info-active);
36+
--ti-filter-box-expand-btn-icon-color: var(--ti-common-color-icon-normal);
37+
// 按钮展开图标悬浮色
38+
--ti-filter-box-expand-btn-icon-color-hover: var(--ti-common-color-icon-hover);
3739
// 按钮展开图标尺寸
3840
--ti-filter-box-expand-btn-icon-size: var(--ti-common-font-size-2);
3941
}

packages/theme/src/select-dropdown/index.less

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
border-top-color: var(--ti-select-dropdown-search-border-color-top);
8383
border-left-color: var(--ti-select-dropdown-search-border-color-left);
8484
border-right-color: var(--ti-select-dropdown-search-border-color-right);
85-
border-bottom-color:var(--ti-select-dropdown-search-border-color-bottom) ;
85+
border-bottom-color: var(--ti-select-dropdown-search-border-color-bottom);
8686
}
8787

8888
.@{input-prefix-cls}__suffix {
@@ -172,7 +172,7 @@
172172
}
173173
// tiny 新增
174174
&__empty-images {
175-
background-image: url('../images/select-nodata.png');
175+
background-image: url('../images/empty-nodata.png');
176176
width: var(--ti-select-dropdown-empty-image-width);
177177
height: var(--ti-select-dropdown-empty-image-height);
178178
margin-bottom: var(--ti-select-dropdown-empty-image-margin-bottom);
@@ -223,38 +223,30 @@
223223
}
224224

225225
& &__loading {
226-
text-align: center;
227-
padding: 10px 0;
228-
229226
> .circular {
230227
fill: var(--ti-common-color-line-hover);
231-
height: 16px;
232-
width: 16px;
233-
animation: loading-rotate 2s linear infinite;
234-
235-
.path {
236-
animation: loading-dash 1.5s ease-in-out infinite;
237-
stroke-dasharray: 90, 150;
238-
stroke-dashoffset: 0;
239-
stroke-width: 2;
240-
stroke: var(--ti-common-color-line-hover);
241-
stroke-linecap: round;
242-
}
228+
font-size: 16px;
229+
}
230+
231+
&.show-loading-icon {
232+
text-align: left;
233+
padding-left: 16px;
234+
height: 32px;
243235
}
244236
}
245237

246238
.@{select-prefix-cls}__top-create {
247239
margin: 0 8px 4px;
240+
height: 32px;
248241
border-bottom: var(--ti-select-dropdown-top-create-border-weight-bottom)
249242
var(--ti-select-dropdown-top-create-border-style-bottom) var(--ti-select-dropdown-top-create-border-color-bottom);
250243

251244
> div {
252245
width: fit-content;
253-
height: 32px;
246+
height: 100%;
254247
display: flex;
255248
align-items: center;
256249
font-size: 12px;
257-
line-height: 20px;
258250
color: var(--ti-select-dropdown-top-create-text-color);
259251
cursor: pointer;
260252

packages/theme/src/select-dropdown/vars.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
// 下拉面板搜索框右侧外边距
7676
--ti-select-dropdown-search-margin-right: var(--ti-common-space-4x);
7777
// 下拉面板搜索框的宽度
78-
--ti-select-dropdown-search-width: calc(100% - var(--ti-common-space-4x)*2);
78+
--ti-select-dropdown-search-width: calc(100% - var(--ti-common-space-4x) * 2);
7979
// 下拉面板搜索框的边框宽度
8080
--ti-select-dropdown-search-border-width: var(--ti-common-border-weight-normal);
8181
// 下拉面板搜索框的边框圆角
@@ -109,7 +109,7 @@
109109
// 下拉面板图标颜色
110110
--ti-select-dropdown-icon-color: var(--ti-common-color-icon-normal);
111111
// 下拉面板新增按钮的文本色
112-
--ti-select-dropdown-top-create-text-color: var(--ti-common-color-text-link);
112+
--ti-select-dropdown-top-create-text-color: var(--ti-common-color-text-primary);
113113
// 下拉面板新增按钮的文本悬浮色
114114
--ti-select-dropdown-top-create-text-color-hover: var(--ti-common-color-text-link-hover);
115115
// 下拉面板新增按钮图标色

0 commit comments

Comments
 (0)