1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-27 03:01:26 +00:00
seahub/frontend/src/components/common/select/seahub-select-style.js

97 lines
2.1 KiB
JavaScript
Raw Normal View History

const MenuSelectStyle = {
option: (provided, state) => {
const { isDisabled, isSelected, isFocused } = state;
return ({
...provided,
cursor: isDisabled ? 'default' : 'pointer',
backgroundColor: isSelected ? '#20a0ff' : (isFocused ? '#f5f5f5' : '#fff'),
'.header-icon .dtable-font': {
color: isSelected ? '#fff' : '#aaa',
},
});
},
control: (provided) => ({
...provided,
fontSize: '14px',
cursor: 'pointer',
lineHeight: '1.5',
}),
2024-07-18 03:58:42 +00:00
menuPortal: base => ({ ...base, zIndex: 9999 }),
indicatorSeparator: () => {},
};
const UserSelectStyle = {
option: (provided, state) => {
const { isDisabled, isFocused } = state;
return ({
...provided,
cursor: isDisabled ? 'default' : 'pointer',
backgroundColor: isFocused ? '#f5f5f5' : '#fff',
});
},
control: (provided) => ({
...provided,
fontSize: '14px',
cursor: 'pointer',
lineHeight: '1.5',
}),
indicatorSeparator: () => ({
display: 'none',
}),
dropdownIndicator: () => ({
display: 'none',
}),
clearIndicator: () => ({
display: 'none',
}),
// multi select style
multiValue: (provided) => {
return {
...provided,
display: 'inline-flex',
alignItems: 'center',
background: '#eaeaea',
borderRadius: '10px',
margin: '0 10px 0 0',
padding: '0 0 0 2px',
};
},
multiValueLabel: (provided) => {
return {
...provided,
padding: '0px',
};
},
multiValueRemove: (provided) => {
return {
...provided,
color: '#666',
':hover': {
backgroundColor: 'transparent',
2024-08-29 08:41:16 +00:00
color: '#666666',
}
};
},
// single select style
singleValue: (provided) => {
return {
...provided,
display: 'inline-flex',
alignItems: 'center',
background: '#eaeaea',
borderRadius: '10px',
margin: '0',
padding: '0 2px',
width: 'fit-content',
};
},
};
const NoOptionsStyle = {
margin: '6px 10px',
textAlign: 'center',
color: 'hsl(0, 0%, 50%)',
};
export { MenuSelectStyle, UserSelectStyle, NoOptionsStyle };