Add behavior attr panel basic props editer
This commit is contained in:
@@ -2,15 +2,36 @@ import { Component, ReactNode} from "react";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { AttrInput } from "@Component/AttrInput/AttrInput";
|
||||
import { ColorInput } from "@Component/ColorInput/ColorInput";
|
||||
import "./BehaviorDetails.scss";
|
||||
|
||||
interface IBehaviorDetailsProps {}
|
||||
|
||||
@useStatusWithEvent("focusBehaviorChange")
|
||||
@useStatusWithEvent("focusBehaviorChange", "behaviorAttrChange")
|
||||
class BehaviorDetails extends Component<IBehaviorDetailsProps & IMixinStatusProps> {
|
||||
|
||||
private renderFrom(behavior: Behavior): ReactNode {
|
||||
return <></>;
|
||||
return <>
|
||||
|
||||
<Message i18nKey="Common.Attr.Title.Basic" isTitle first/>
|
||||
|
||||
<AttrInput
|
||||
id={behavior.id} keyI18n="Common.Attr.Key.Display.Name" value={behavior.name}
|
||||
valueChange={(val) => {
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, "name", val);
|
||||
}}
|
||||
/>
|
||||
|
||||
<ColorInput
|
||||
keyI18n="Common.Attr.Key.Color"
|
||||
value={behavior.color}
|
||||
valueChange={(color) => {
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, "color", color);
|
||||
}}
|
||||
/>
|
||||
|
||||
</>;
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
|
||||
@@ -13,7 +13,7 @@ interface IBehaviorListProps {
|
||||
}
|
||||
|
||||
@useSetting
|
||||
@useStatusWithEvent("behaviorChange", "focusBehaviorChange")
|
||||
@useStatusWithEvent("behaviorChange", "focusBehaviorChange", "behaviorAttrChange")
|
||||
class BehaviorList extends Component<IBehaviorListProps & IMixinStatusProps & IMixinSettingProps> {
|
||||
|
||||
private labelInnerClick: boolean = false;
|
||||
|
||||
@@ -29,7 +29,8 @@ const allOption: IDisplayItem[] = [
|
||||
@useSetting
|
||||
@useStatusWithEvent(
|
||||
"groupAttrChange", "groupLabelChange", "focusObjectChange",
|
||||
"focusBehaviorChange", "behaviorChange", "groupBehaviorChange"
|
||||
"focusBehaviorChange", "behaviorChange", "groupBehaviorChange",
|
||||
"behaviorAttrChange"
|
||||
)
|
||||
class GroupDetails extends Component<IGroupDetailsProps & IMixinStatusProps & IMixinSettingProps> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user