Skip to content

Commit d8d1075

Browse files
authored
fix(base-select): [base-select] fix style issues in the old theme (#2535)
* fix(base-select): fix style issues in the old theme * test(base-select): fix e2e test of size
1 parent 56f2fc3 commit d8d1075

File tree

7 files changed

+26
-6
lines changed

7 files changed

+26
-6
lines changed

examples/sites/demos/pc/app/base-select/collapse-tags-composition-api.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ const options = ref([
3333
{ value: '选项2', label: '上海' },
3434
{ value: '选项3', label: '天津' },
3535
{ value: '选项4', label: '重庆超长超长超长超长超长超长超长超长超长' },
36-
{ value: '选项5', label: '深圳' }
36+
{ value: '选项5', label: '深圳' },
37+
{ value: '选项6', label: '广州' }
3738
])
3839
3940
const value1 = ref(['选项1', '选项2'])

examples/sites/demos/pc/app/base-select/size.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ test('mini 尺寸', async ({ page }) => {
5454

5555
await expect(input).toHaveClass(/tiny-input-mini/)
5656
await expect(tag.nth(0)).toHaveClass(/tiny-tag--mini tiny-tag--light/)
57-
expect(height).toBeCloseTo(28, 1)
57+
expect(height).toBeCloseTo(24, 1)
5858
})

examples/sites/demos/pc/app/base-select/slot-panel-composition-api.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
return {
4141
...node,
4242
currentLabel: node.label,
43-
value: node.id
43+
value: node.id,
44+
isTree: true
4445
}
4546
})
4647
)

examples/sites/demos/pc/app/base-select/slot-panel.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
return {
4141
...node,
4242
currentLabel: node.label,
43-
value: node.id
43+
value: node.id,
44+
isTree: true
4445
}
4546
})
4647
)

packages/renderless/src/base-select/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1602,7 +1602,7 @@ export const mounted =
16021602
state.completed = true
16031603

16041604
// tiny 新增: sizeMap适配不同主题
1605-
const defaultSizeMap = { default: 32, mini: 24, small: 36, medium: 40 }
1605+
const defaultSizeMap = { medium: 40, default: 32, small: 28, mini: 24 }
16061606
const sizeMap = designConfig?.state?.sizeMap || defaultSizeMap
16071607

16081608
if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,24 @@
203203
}
204204
}
205205

206+
& {
207+
.@{tag-prefix-cls} {
208+
height: 20px;
209+
}
210+
}
211+
212+
&--medium {
213+
.@{tag-prefix-cls} {
214+
height: 24px;
215+
}
216+
}
217+
218+
&--small, &--mini {
219+
.@{tag-prefix-cls} {
220+
height: 16px;
221+
}
222+
}
223+
206224
&.is-hover-expand,
207225
&.is-click-expand {
208226
vertical-align: top;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
}
9191

9292
.@{input-prefix-cls}__prefix {
93-
display: block;
9493
left: 0;
9594
font-size: 0;
9695

0 commit comments

Comments
 (0)