Skip to content

Commit

Permalink
fix(base-select): [base-select] fix style issues in the old theme (#2535
Browse files Browse the repository at this point in the history
)

* fix(base-select): fix style issues in the old theme

* test(base-select): fix e2e test of size
  • Loading branch information
kagol authored Nov 20, 2024
1 parent 56f2fc3 commit d8d1075
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ const options = ref([
{ value: '选项2', label: '上海' },
{ value: '选项3', label: '天津' },
{ value: '选项4', label: '重庆超长超长超长超长超长超长超长超长超长' },
{ value: '选项5', label: '深圳' }
{ value: '选项5', label: '深圳' },
{ value: '选项6', label: '广州' }
])
const value1 = ref(['选项1', '选项2'])
Expand Down
2 changes: 1 addition & 1 deletion examples/sites/demos/pc/app/base-select/size.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ test('mini 尺寸', async ({ page }) => {

await expect(input).toHaveClass(/tiny-input-mini/)
await expect(tag.nth(0)).toHaveClass(/tiny-tag--mini tiny-tag--light/)
expect(height).toBeCloseTo(28, 1)
expect(height).toBeCloseTo(24, 1)
})
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
return {
...node,
currentLabel: node.label,
value: node.id
value: node.id,
isTree: true
}
})
)
Expand Down
3 changes: 2 additions & 1 deletion examples/sites/demos/pc/app/base-select/slot-panel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
return {
...node,
currentLabel: node.label,
value: node.id
value: node.id,
isTree: true
}
})
)
Expand Down
2 changes: 1 addition & 1 deletion packages/renderless/src/base-select/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ export const mounted =
state.completed = true

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

if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
Expand Down
18 changes: 18 additions & 0 deletions packages/theme/src/base-select/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,24 @@
}
}

& {
.@{tag-prefix-cls} {
height: 20px;
}
}

&--medium {
.@{tag-prefix-cls} {
height: 24px;
}
}

&--small, &--mini {
.@{tag-prefix-cls} {
height: 16px;
}
}

&.is-hover-expand,
&.is-click-expand {
vertical-align: top;
Expand Down
1 change: 0 additions & 1 deletion packages/theme/src/select-dropdown/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
}

.@{input-prefix-cls}__prefix {
display: block;
left: 0;
font-size: 0;

Expand Down

0 comments on commit d8d1075

Please sign in to comment.