Skip to content

Commit

Permalink
fix: 样式问题处理
Browse files Browse the repository at this point in the history
  • Loading branch information
yxh01132861 committed Sep 15, 2023
1 parent b3116cf commit 2bdaab0
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
@prefix-select-cls: ~'@{prefix}-vis-type-select';

.@{prefix-select-cls} {
.ant-select-selection-item {
height: 30px;
}

&__drop-down {
display: flex;
flex-wrap: wrap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { genStyleHook } from '@formily/antd-v5/esm/__builtins__';

export default genStyleHook('color-range-selector', (token) => {
const { componentCls, antCls } = token;

const { componentCls, antCls, controlHeight, lineWidth } = token;
const selectHeightWithoutBorder = controlHeight - lineWidth * 2;
return {
[componentCls]: {
maxWidth: 260,

[`${antCls}-select-selection-item`]: {
height: selectHeightWithoutBorder,
},

[`${componentCls}__selection-item`]: {
display: 'flex',
alignItems: 'center',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const PositionSelect: React.FC<SelectProps> = (props) => {
const [wrapSSR, hashId] = useStyle(prefixCls);

return wrapSSR(
<Select {...prop} popupClassName={cls(`${prefixCls}`, hashId)}>
<Select {...prop} className={cls(`${prefixCls}-select`, hashId)} popupClassName={cls(`${prefixCls}`, hashId)}>
{(options ?? POSITION).map((item, index) => {
return (
<Select.Option value={item.value} key={index}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { genStyleHook } from '@formily/antd-v5/esm/__builtins__';

export default genStyleHook('field-select', (token) => {
const { componentCls } = token;
const { antCls, componentCls, controlHeight, lineWidth } = token;
const selectHeightWithoutBorder = controlHeight - lineWidth * 2;

return {
[`${componentCls}-select`]: {
[`${antCls}-select-selection-item`]: {
height: selectHeightWithoutBorder,
},
},

[componentCls]: {
[`${componentCls}-item`]: {
lineHeight: '30px',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const InternalSelect: React.FC<SelectProps<string, FieldSelectOptionType>> = (pr
return wrapSSR(
<Select
{...prop}
className={cls(`${prefixCls}-select`, hashId)}
popupClassName={cls(`${prefixCls}`, hashId)}
open={open}
onDropdownVisibleChange={(visible) => setOpen(visible)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import { genStyleHook } from '@formily/antd-v5/esm/__builtins__';

export default genStyleHook('field-select', (token) => {
const { componentCls, controlItemBgActive, controlItemBgHover, colorTextDescription } = token;
const { antCls, componentCls, controlItemBgActive, controlItemBgHover, controlHeight, lineWidth } = token;
const selectHeightWithoutBorder = controlHeight - lineWidth * 2;

return {
[`${componentCls}-select`]: {
[`${antCls}-select-selection-item`]: {
height: selectHeightWithoutBorder,
},
},

[componentCls]: {
[`${componentCls}-dropdown`]: {
maxHeight: 256,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { genStyleHook } from '@formily/antd-v5/esm/__builtins__';

export default genStyleHook('ribbon-select', (token) => {
const { componentCls } = token;
const { componentCls, antCls, controlHeight, lineWidth } = token;
const selectHeightWithoutBorder = controlHeight - lineWidth * 2;

return {
[componentCls]: {
[`${antCls}-select-selection-item`]: {
height: selectHeightWithoutBorder,
},

[`${componentCls}__selection-item`]: {
display: 'flex',
alignItems: 'center',
Expand Down

0 comments on commit 2bdaab0

Please sign in to comment.