mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
Initial spike
This commit is contained in:
parent
60562ad0b0
commit
1da5a30e07
3
frontend/src/assets/icons/constraint-equals.svg
Normal file
3
frontend/src/assets/icons/constraint-equals.svg
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<svg width="13" height="5" viewBox="0 0 13 5" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M0.289062 1.88672V0.480469H4.87109V1.88672H0.289062ZM0.289062 4.23047V2.82422H4.87109V4.23047H0.289062ZM7.4375 1.88672V0.480469H12.0195V1.88672H7.4375ZM7.4375 4.23047V2.82422H12.0195V4.23047H7.4375Z" fill="#000"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 324 B |
4
frontend/src/assets/icons/constraint-not-equals.svg
Normal file
4
frontend/src/assets/icons/constraint-not-equals.svg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M9.28906 11.8867V10.4805H13.8711V11.8867H9.28906ZM9.28906 14.2305V12.8242H13.8711V14.2305H9.28906Z" fill="#9F9FA1"/>
|
||||||
|
<rect x="16.4541" y="3.94922" width="1" height="18.3741" rx="0.5" transform="rotate(32.071 16.4541 3.94922)" fill="#6E6E70"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 355 B |
@ -42,6 +42,8 @@ import Delete from '@mui/icons-material/Delete';
|
|||||||
import { ValueList } from './ValueList';
|
import { ValueList } from './ValueList';
|
||||||
import { ReactComponent as CaseSensitiveIcon } from 'assets/icons/case-sensitive.svg';
|
import { ReactComponent as CaseSensitiveIcon } from 'assets/icons/case-sensitive.svg';
|
||||||
import { ReactComponent as CaseInsensitiveIcon } from 'assets/icons/case-insensitive.svg';
|
import { ReactComponent as CaseInsensitiveIcon } from 'assets/icons/case-insensitive.svg';
|
||||||
|
import { ReactComponent as EqualsIcon } from 'assets/icons/constraint-equals.svg';
|
||||||
|
import { ReactComponent as NotEqualsIcon } from 'assets/icons/constraint-not-equals.svg';
|
||||||
import { ScreenReaderOnly } from 'component/common/ScreenReaderOnly/ScreenReaderOnly';
|
import { ScreenReaderOnly } from 'component/common/ScreenReaderOnly/ScreenReaderOnly';
|
||||||
|
|
||||||
const Container = styled('article')(({ theme }) => ({
|
const Container = styled('article')(({ theme }) => ({
|
||||||
@ -112,6 +114,8 @@ const StyledSelect = styled(GeneralSelect)(({ theme }) => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledButton = styled('button')(({ theme }) => ({
|
const StyledButton = styled('button')(({ theme }) => ({
|
||||||
|
display: 'grid',
|
||||||
|
placeItems: 'center',
|
||||||
width: '5ch',
|
width: '5ch',
|
||||||
borderRadius: theme.shape.borderRadius,
|
borderRadius: theme.shape.borderRadius,
|
||||||
padding: theme.spacing(0.25, 0),
|
padding: theme.spacing(0.25, 0),
|
||||||
@ -134,13 +138,24 @@ const StyledCaseInsensitiveIcon = styled(CaseInsensitiveIcon)(({ theme }) => ({
|
|||||||
fill: theme.palette.text.secondary,
|
fill: theme.palette.text.secondary,
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const StyledCaseSensitiveIcon = styled(CaseSensitiveIcon)(({ theme }) => ({
|
const StyledCaseSensitiveIcon = styled(CaseSensitiveIcon)(({ theme }) => ({
|
||||||
fill: 'currentcolor',
|
fill: 'currentcolor',
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const CaseButton = styled(StyledButton)(({ theme }) => ({
|
const StyledEqualsIcon = styled(EqualsIcon)(({ theme }) => ({
|
||||||
display: 'grid',
|
path: {
|
||||||
placeItems: 'center',
|
fill: 'currentcolor',
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
const StyledNotEqualsIcon = styled(NotEqualsIcon)(({ theme }) => ({
|
||||||
|
path: {
|
||||||
|
fill: theme.palette.text.disabled,
|
||||||
|
},
|
||||||
|
rect: {
|
||||||
|
fill: theme.palette.text.secondary,
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
@ -380,7 +395,17 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
type='button'
|
type='button'
|
||||||
onClick={toggleInvertedOperator}
|
onClick={toggleInvertedOperator}
|
||||||
>
|
>
|
||||||
{localConstraint.inverted ? 'aint' : 'is'}
|
{localConstraint.inverted ? (
|
||||||
|
<StyledNotEqualsIcon aria-label='The constraint operator is exclusive.' />
|
||||||
|
) : (
|
||||||
|
<StyledEqualsIcon aria-label='The constraint operator is inclusive.' />
|
||||||
|
)}
|
||||||
|
<ScreenReaderOnly>
|
||||||
|
Make the selected operator
|
||||||
|
{localConstraint.inverted
|
||||||
|
? ' inclusive'
|
||||||
|
: ' exclusive'}
|
||||||
|
</ScreenReaderOnly>
|
||||||
</StyledButton>
|
</StyledButton>
|
||||||
|
|
||||||
<ConstraintOperatorSelect
|
<ConstraintOperatorSelect
|
||||||
@ -391,7 +416,7 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{showCaseSensitiveButton ? (
|
{showCaseSensitiveButton ? (
|
||||||
<CaseButton
|
<StyledButton
|
||||||
type='button'
|
type='button'
|
||||||
onClick={toggleCaseSensitivity}
|
onClick={toggleCaseSensitivity}
|
||||||
>
|
>
|
||||||
@ -407,7 +432,7 @@ export const EditableConstraint: FC<Props> = ({
|
|||||||
: ' not '}
|
: ' not '}
|
||||||
case sensitive
|
case sensitive
|
||||||
</ScreenReaderOnly>
|
</ScreenReaderOnly>
|
||||||
</CaseButton>
|
</StyledButton>
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{!input.includes('LEGAL_VALUES') && (
|
{!input.includes('LEGAL_VALUES') && (
|
||||||
|
Loading…
Reference in New Issue
Block a user