mirror of https://github.com/vizality/vizality
rename Checkbox settings component to CheckboxItem
parent
df0a4dcf2b
commit
c7c47f0342
@ -1,38 +0,0 @@
|
||||
import React, { memo } from 'react';
|
||||
|
||||
import { getModuleByDisplayName, getModule } from '@vizality/webpack';
|
||||
|
||||
import AsyncComponent from '../AsyncComponent';
|
||||
import { Divider } from '..';
|
||||
|
||||
const Checkbox = AsyncComponent.fromDisplayName('Checkbox');
|
||||
|
||||
export default memo(props => {
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { align, color, disabled, onChange, readOnly, reverse, shape, size, type, value } = props;
|
||||
|
||||
const Flex = getModuleByDisplayName('Flex');
|
||||
const { marginBottom20 } = getModule('marginBottom20');
|
||||
|
||||
return (
|
||||
<Flex className={marginBottom20} direction={Flex.Direction.VERTICAL}>
|
||||
<Checkbox {...props}/>
|
||||
<Divider/>
|
||||
</Flex>
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* AVAILABLE PROPS
|
||||
*
|
||||
* align={ 'alignCenter-MrlN6q' }
|
||||
* color={ '#7289da' }
|
||||
* disabled={ false }
|
||||
* onChange={ '' }
|
||||
* readOnly={ false }
|
||||
* reverse={ false }
|
||||
* shape={ 'box-mmYMsp' }
|
||||
* size={ 24 }
|
||||
* type={ 'inverted' }
|
||||
* value={ true }
|
||||
*/
|
@ -0,0 +1,58 @@
|
||||
import { joinClassNames } from '@vizality/util/dom';
|
||||
import React, { memo } from 'react';
|
||||
|
||||
import { Divider, Checkbox } from '..';
|
||||
|
||||
export default memo(({ align, color, divider, disabled, onChange, readOnly, reverse, shape, size = '24', type = 'inverted', value, children, className, ...other }) => {
|
||||
return (
|
||||
<>
|
||||
<Checkbox
|
||||
className={joinClassNames('vz-settings-checkbox-item', className)}
|
||||
align={align}
|
||||
color={color}
|
||||
disabled={disabled}
|
||||
onChange={onChange}
|
||||
readOnly={readOnly}
|
||||
reverse={reverse}
|
||||
shape={shape}
|
||||
size={size}
|
||||
type={type}
|
||||
value={value}
|
||||
{...other}
|
||||
>
|
||||
{children}
|
||||
</Checkbox>
|
||||
{divider && (
|
||||
<Divider/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* AVAILABLE PROPS
|
||||
*
|
||||
* align={ 'alignCenter-MrlN6q' }
|
||||
* color={ "hsl(227, calc(var(--saturation-factor, 1) * 58.4%), 65.1%)" }
|
||||
* disabled={ false }
|
||||
* onChange={ }
|
||||
* readOnly={ false }
|
||||
* reverse={ false }
|
||||
* shape={ 'box-mmYMsp' }
|
||||
* size={ 24 }
|
||||
* type={ 'inverted' }
|
||||
* value={ true }
|
||||
*/
|
||||
|
||||
|
||||
// align: "alignCenter-MrlN6q"
|
||||
// color: "hsl(227, calc(var(--saturation-factor, 1) * 58.4%), 65.1%)"
|
||||
// disabled: false
|
||||
// displayOnly: false
|
||||
// onChange: ƒ ()
|
||||
// readOnly: false
|
||||
// reverse: false
|
||||
// shape: "box-mmYMsp"
|
||||
// size: 24
|
||||
// type: "default"
|
||||
// value: false
|
Loading…
Reference in new issue