forked from p15670423/monkey
ui: remove disabled/readonly from AdvancedMultiSelect
This commit is contained in:
parent
9f12702c3e
commit
09a8415aec
|
@ -11,7 +11,6 @@ import {getFullDefinitionByKey} from './JsonSchemaHelpers';
|
|||
function AdvancedMultiSelectHeader(props) {
|
||||
const {
|
||||
title,
|
||||
disabled,
|
||||
onCheckboxClick,
|
||||
checkboxState,
|
||||
hideReset,
|
||||
|
@ -20,7 +19,7 @@ function AdvancedMultiSelectHeader(props) {
|
|||
|
||||
return (
|
||||
<Card.Header className="d-flex justify-content-between">
|
||||
<MasterCheckbox title={title} disabled={disabled} onClick={onCheckboxClick} checkboxState={checkboxState}/>
|
||||
<MasterCheckbox title={title} onClick={onCheckboxClick} checkboxState={checkboxState}/>
|
||||
<Button className={'reset-safe-defaults'} type={'reset'} variant={'warning'}
|
||||
hidden={hideReset} onClick={onResetClick}>
|
||||
Reset to safe defaults
|
||||
|
@ -165,8 +164,6 @@ class AdvancedMultiSelect extends React.Component {
|
|||
schema,
|
||||
id,
|
||||
required,
|
||||
disabled,
|
||||
readonly,
|
||||
multiple,
|
||||
autofocus
|
||||
} = this.props;
|
||||
|
@ -174,12 +171,12 @@ class AdvancedMultiSelect extends React.Component {
|
|||
return (
|
||||
<div className={'advanced-multi-select'}>
|
||||
<AdvancedMultiSelectHeader title={schema.title}
|
||||
disabled={disabled} onCheckboxClick={this.onMasterCheckboxClick}
|
||||
onCheckboxClick={this.onMasterCheckboxClick}
|
||||
checkboxState={this.state.masterCheckboxState}
|
||||
hideReset={this.state.hideReset} onResetClick={this.onResetClick}/>
|
||||
|
||||
<ChildCheckboxContainer id={id} multiple={multiple} required={required}
|
||||
disabled={disabled || readonly} autoFocus={autofocus} isSafe={this.isSafe}
|
||||
autoFocus={autofocus} isSafe={this.isSafe}
|
||||
onPaneClick={this.setPaneInfo} onCheckboxClick={this.onChildCheckboxClick}
|
||||
selectedValues={this.props.value} enumOptions={this.enumOptions}/>
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ function ChildCheckboxContainer(props) {
|
|||
id,
|
||||
multiple,
|
||||
required,
|
||||
disabled,
|
||||
autofocus,
|
||||
onPaneClick,
|
||||
onCheckboxClick,
|
||||
|
@ -26,13 +25,13 @@ function ChildCheckboxContainer(props) {
|
|||
<Form.Group
|
||||
style={{height: `${getComponentHeight(enumOptions.length)}px`}}
|
||||
id={id} multiple={multiple} className='choice-block form-control'
|
||||
required={required} disabled={disabled} autoFocus={autofocus}>
|
||||
required={required} autoFocus={autofocus}>
|
||||
{
|
||||
enumOptions.map(({value, label}, i) => {
|
||||
return (
|
||||
<ChildCheckbox key={i} onPaneClick={onPaneClick}
|
||||
onClick={onCheckboxClick} value={value}
|
||||
disabled={disabled} label={label} checkboxState={selectedValues.includes(value)}
|
||||
label={label} checkboxState={selectedValues.includes(value)}
|
||||
safe={isSafe(value)}/>
|
||||
);
|
||||
}
|
||||
|
@ -46,7 +45,6 @@ function ChildCheckbox(props) {
|
|||
onPaneClick,
|
||||
onClick,
|
||||
value,
|
||||
disabled,
|
||||
label,
|
||||
checkboxState,
|
||||
safe
|
||||
|
@ -54,7 +52,7 @@ function ChildCheckbox(props) {
|
|||
|
||||
return (
|
||||
<Form.Group onClick={() => onPaneClick(value)}>
|
||||
<Button value={value} variant={'link'} disabled={disabled} onClick={() => onClick(value)}>
|
||||
<Button value={value} variant={'link'} onClick={() => onClick(value)}>
|
||||
<FontAwesomeIcon icon={checkboxState ? faCheckSquare : faSquare}/>
|
||||
</Button>
|
||||
<span key={'label'} className={'option-text'}>{label}</span>
|
||||
|
|
|
@ -15,7 +15,6 @@ const MasterCheckboxState = {
|
|||
function MasterCheckbox(props) {
|
||||
const {
|
||||
title,
|
||||
disabled,
|
||||
onClick,
|
||||
checkboxState
|
||||
} = props;
|
||||
|
@ -30,7 +29,7 @@ function MasterCheckbox(props) {
|
|||
|
||||
return (
|
||||
<div className={'master-checkbox'}>
|
||||
<Button key={`${title}-button`} variant={'link'} disabled={disabled} onClick={onClick}>
|
||||
<Button key={`${title}-button`} variant={'link'} onClick={onClick}>
|
||||
<FontAwesomeIcon icon={newCheckboxIcon}/>
|
||||
</Button>
|
||||
<span className={'header-title'}>{title}</span>
|
||||
|
|
Loading…
Reference in New Issue