Add label list edit panel
This commit is contained in:
@@ -12,6 +12,7 @@ interface IAttrInputProps {
|
||||
value?: number | string;
|
||||
isNumber?: boolean;
|
||||
maxLength?: number;
|
||||
minLength?: number;
|
||||
max?: number;
|
||||
min?: number;
|
||||
step?: number;
|
||||
@@ -40,6 +41,11 @@ class AttrInput extends Component<IAttrInputProps> {
|
||||
return <Localization i18nKey="Input.Error.Length" options={{ num: maxLength.toString() }} />
|
||||
}
|
||||
|
||||
const minLength = this.props.minLength ?? 1;
|
||||
if (value.length < minLength) {
|
||||
return <Localization i18nKey="Input.Error.Length.Less" options={{ num: minLength.toString() }} />
|
||||
}
|
||||
|
||||
if (this.props.isNumber) {
|
||||
const praseNumber = (value as any) / 1;
|
||||
|
||||
|
||||
@@ -63,14 +63,22 @@ div.light.label {
|
||||
}
|
||||
}
|
||||
|
||||
div.dark.label:hover,
|
||||
div.dark.label.focus {
|
||||
div.dark.label:hover {
|
||||
color: $lt-font-color-lvl2-dark;
|
||||
background-color: $lt-bg-color-lvl2-dark;
|
||||
}
|
||||
|
||||
div.light.label:hover,
|
||||
div.light.label.focus {
|
||||
div.dark.label.focus {
|
||||
color: $lt-font-color-lvl1-dark;
|
||||
background-color: $lt-bg-color-lvl1-dark;
|
||||
}
|
||||
|
||||
div.light.label:hover {
|
||||
color: $lt-font-color-lvl2-light;
|
||||
background-color: $lt-bg-color-lvl2-light;
|
||||
}
|
||||
|
||||
div.light.label.focus {
|
||||
color: $lt-font-color-lvl1-light;
|
||||
background-color: $lt-bg-color-lvl1-light;
|
||||
}
|
||||
@@ -38,9 +38,6 @@ class LabelList extends Component<ILabelListProps & IMixinSettingProps> {
|
||||
}
|
||||
this.isDeleteClick = false;
|
||||
}}
|
||||
style={{
|
||||
borderColor: isFocus ? colorCss : undefined
|
||||
}}
|
||||
>
|
||||
<div className="label-color" style={{
|
||||
backgroundColor: colorCss,
|
||||
|
||||
@@ -9,7 +9,9 @@ interface ITogglesInputProps {
|
||||
infoI18n?: AllI18nKeys;
|
||||
value?: boolean;
|
||||
disable?: boolean;
|
||||
valueChange?: (color: boolean) => any;
|
||||
onIconName?: string;
|
||||
offIconName?: string;
|
||||
valueChange?: (value: boolean) => any;
|
||||
}
|
||||
|
||||
class TogglesInput extends Component<ITogglesInputProps> {
|
||||
@@ -33,9 +35,17 @@ class TogglesInput extends Component<ITogglesInputProps> {
|
||||
}
|
||||
})}
|
||||
>
|
||||
<Icon iconName="CheckMark" style={{
|
||||
display: this.props.value ? "inline-block" : "none"
|
||||
}}></Icon>
|
||||
<Icon
|
||||
iconName={
|
||||
this.props.value ?
|
||||
this.props.onIconName ?? "CheckMark" :
|
||||
this.props.offIconName ?? undefined
|
||||
}
|
||||
style={{
|
||||
display: this.props.value ? "inline-block" :
|
||||
this.props.offIconName ? "inline-block" : "none"
|
||||
}}
|
||||
></Icon>
|
||||
</div>
|
||||
</div>
|
||||
</Theme>
|
||||
|
||||
Reference in New Issue
Block a user