Compare commits
11
Commits
Alpha0.0.1
...
a3c7e347ec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a3c7e347ec | ||
|
|
3026c463bd | ||
|
|
cb2501f1f0 | ||
|
|
8cc8819cd3 | ||
|
|
aa8d35e5db | ||
|
|
3b255245f2 | ||
|
|
47d097e94a | ||
|
|
7556ea983e | ||
|
|
d7e15793b9 | ||
|
|
74b2df49ad | ||
|
|
fdeced803b |
@@ -1,11 +1,11 @@
|
||||
import { BehaviorRecorder, IAnyBehaviorRecorder } from "@Model/Behavior";
|
||||
import { Template } from "./Template";
|
||||
import { Dynamics } from "./Dynamics";
|
||||
import { Brownian } from "./Brownian";
|
||||
import { BoundaryConstraint } from "./BoundaryConstraint";
|
||||
import { Template } from "@Behavior/Template";
|
||||
import { Dynamics } from "@Behavior/Dynamics";
|
||||
import { Brownian } from "@Behavior/Brownian";
|
||||
import { BoundaryConstraint } from "@Behavior/BoundaryConstraint";
|
||||
|
||||
const AllBehaviors: IAnyBehaviorRecorder[] = [
|
||||
// new BehaviorRecorder(Template),
|
||||
new BehaviorRecorder(Template),
|
||||
new BehaviorRecorder(Dynamics),
|
||||
new BehaviorRecorder(Brownian),
|
||||
new BehaviorRecorder(BoundaryConstraint),
|
||||
|
||||
@@ -24,38 +24,10 @@ class BoundaryConstraint extends Behavior<IBoundaryConstraintBehaviorParameter,
|
||||
public override category: string = "$Physics";
|
||||
|
||||
public override parameterOption = {
|
||||
range: {
|
||||
type: "LR",
|
||||
name: "$range"
|
||||
},
|
||||
strength: {
|
||||
type: "number",
|
||||
name: "$Strength",
|
||||
defaultValue: 1,
|
||||
numberMin: 0,
|
||||
numberStep: .1
|
||||
}
|
||||
range: { type: "LR", name: "$range" },
|
||||
strength: { type: "number", name: "$Strength", defaultValue: 1, numberMin: 0, numberStep: .1 }
|
||||
};
|
||||
|
||||
public override terms: Record<string, Record<string, string>> = {
|
||||
"$Title": {
|
||||
"ZH_CN": "边界约束",
|
||||
"EN_US": "Boundary constraint"
|
||||
},
|
||||
"$range": {
|
||||
"ZH_CN": "约束范围",
|
||||
"EN_US": "Constraint range"
|
||||
},
|
||||
"$Strength": {
|
||||
"ZH_CN": "约束强度系数",
|
||||
"EN_US": "Restraint strength coefficient"
|
||||
},
|
||||
"$Intro": {
|
||||
"ZH_CN": "个体越出边界后将主动返回",
|
||||
"EN_US": "Individuals will return actively after crossing the border"
|
||||
}
|
||||
};
|
||||
|
||||
public effect(individual: Individual, group: Group, model: Model, t: number): void {
|
||||
let rangeList: Range[] = this.parameter.range.objects;
|
||||
|
||||
@@ -99,6 +71,25 @@ class BoundaryConstraint extends Behavior<IBoundaryConstraintBehaviorParameter,
|
||||
fz * this.parameter.strength
|
||||
);
|
||||
}
|
||||
|
||||
public override terms: Record<string, Record<string, string>> = {
|
||||
"$Title": {
|
||||
"ZH_CN": "边界约束",
|
||||
"EN_US": "Boundary constraint"
|
||||
},
|
||||
"$range": {
|
||||
"ZH_CN": "约束范围",
|
||||
"EN_US": "Constraint range"
|
||||
},
|
||||
"$Strength": {
|
||||
"ZH_CN": "约束强度系数",
|
||||
"EN_US": "Restraint strength coefficient"
|
||||
},
|
||||
"$Intro": {
|
||||
"ZH_CN": "个体越出边界后将主动返回",
|
||||
"EN_US": "Individuals will return actively after crossing the border"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { BoundaryConstraint };
|
||||
+28
-52
@@ -25,37 +25,36 @@ class Brownian extends Behavior<IBrownianBehaviorParameter, IBrownianBehaviorEve
|
||||
public override category: string = "$Physics";
|
||||
|
||||
public override parameterOption = {
|
||||
maxFrequency: {
|
||||
type: "number",
|
||||
name: "$Max.Frequency",
|
||||
defaultValue: 5,
|
||||
numberStep: .1,
|
||||
numberMin: 0
|
||||
},
|
||||
minFrequency: {
|
||||
type: "number",
|
||||
name: "$Min.Frequency",
|
||||
defaultValue: 0,
|
||||
numberStep: .1,
|
||||
numberMin: 0
|
||||
},
|
||||
maxStrength: {
|
||||
type: "number",
|
||||
name: "$Max.Strength",
|
||||
defaultValue: 10,
|
||||
numberStep: .01,
|
||||
numberMin: 0
|
||||
},
|
||||
minStrength: {
|
||||
type: "number",
|
||||
name: "$Min.Strength",
|
||||
defaultValue: 0,
|
||||
numberStep: .01,
|
||||
numberMin: 0
|
||||
}
|
||||
maxFrequency: { type: "number", name: "$Max.Frequency", defaultValue: 5, numberStep: .1, numberMin: 0 },
|
||||
minFrequency: { type: "number", name: "$Min.Frequency", defaultValue: 0, numberStep: .1, numberMin: 0 },
|
||||
maxStrength: { type: "number", name: "$Max.Strength", defaultValue: 10, numberStep: .01, numberMin: 0 },
|
||||
minStrength: { type: "number", name: "$Min.Strength", defaultValue: 0, numberStep: .01, numberMin: 0 }
|
||||
};
|
||||
|
||||
public override terms: Record<string, Record<string, string>> = {
|
||||
public effect(individual: Individual, group: Group, model: Model, t: number): void {
|
||||
|
||||
const {maxFrequency, minFrequency, maxStrength, minStrength} = this.parameter;
|
||||
|
||||
let nextTime = individual.getData("Brownian.nextTime") ??
|
||||
minFrequency + Math.random() * (maxFrequency - minFrequency);
|
||||
let currentTime = individual.getData("Brownian.currentTime") ?? 0;
|
||||
|
||||
currentTime += t;
|
||||
if (currentTime > nextTime) {
|
||||
individual.applyForce(
|
||||
minStrength + (Math.random() * 2 - 1) * (maxStrength - minStrength),
|
||||
minStrength + (Math.random() * 2 - 1) * (maxStrength - minStrength),
|
||||
minStrength + (Math.random() * 2 - 1) * (maxStrength - minStrength)
|
||||
);
|
||||
nextTime = minFrequency + Math.random() * (maxFrequency - minFrequency);
|
||||
currentTime = 0;
|
||||
}
|
||||
|
||||
individual.setData("Brownian.nextTime", nextTime);
|
||||
individual.setData("Brownian.currentTime", currentTime);
|
||||
}
|
||||
|
||||
public override terms: Record<string, Record<string, string>> = {
|
||||
"$Title": {
|
||||
"ZH_CN": "布朗运动",
|
||||
"EN_US": "Brownian motion"
|
||||
@@ -81,29 +80,6 @@ class Brownian extends Behavior<IBrownianBehaviorParameter, IBrownianBehaviorEve
|
||||
"EN_US": "Minimum strength"
|
||||
}
|
||||
};
|
||||
|
||||
public effect(individual: Individual, group: Group, model: Model, t: number): void {
|
||||
|
||||
const {maxFrequency, minFrequency, maxStrength, minStrength} = this.parameter;
|
||||
|
||||
let nextTime = individual.getData("Brownian.nextTime") ??
|
||||
minFrequency + Math.random() * (maxFrequency - minFrequency);
|
||||
let currentTime = individual.getData("Brownian.currentTime") ?? 0;
|
||||
|
||||
currentTime += t;
|
||||
if (currentTime > nextTime) {
|
||||
individual.applyForce(
|
||||
minStrength + (Math.random() * 2 - 1) * (maxStrength - minStrength),
|
||||
minStrength + (Math.random() * 2 - 1) * (maxStrength - minStrength),
|
||||
minStrength + (Math.random() * 2 - 1) * (maxStrength - minStrength)
|
||||
);
|
||||
nextTime = minFrequency + Math.random() * (maxFrequency - minFrequency);
|
||||
currentTime = 0;
|
||||
}
|
||||
|
||||
individual.setData("Brownian.nextTime", nextTime);
|
||||
individual.setData("Brownian.currentTime", currentTime);
|
||||
}
|
||||
}
|
||||
|
||||
export { Brownian };
|
||||
+35
-59
@@ -25,67 +25,12 @@ class Dynamics extends Behavior<IDynamicsBehaviorParameter, IDynamicsBehaviorEve
|
||||
public override category: string = "$Physics";
|
||||
|
||||
public override parameterOption = {
|
||||
mass: {
|
||||
name: "$Mass",
|
||||
type: "number",
|
||||
defaultValue: 1,
|
||||
numberStep: .01,
|
||||
numberMin: .001
|
||||
},
|
||||
maxAcceleration: {
|
||||
name: "$Max.Acceleration",
|
||||
type: "number",
|
||||
defaultValue: 5,
|
||||
numberStep: .1,
|
||||
numberMin: 0
|
||||
},
|
||||
maxVelocity: {
|
||||
name: "$Max.Velocity",
|
||||
type: "number",
|
||||
defaultValue: 10,
|
||||
numberStep: .1,
|
||||
numberMin: 0
|
||||
},
|
||||
resistance: {
|
||||
name: "$Resistance",
|
||||
type: "number",
|
||||
defaultValue: 0.5,
|
||||
numberStep: .1,
|
||||
numberMin: 0
|
||||
}
|
||||
mass: { name: "$Mass", type: "number", defaultValue: 1, numberStep: .01, numberMin: .001 },
|
||||
maxAcceleration: { name: "$Max.Acceleration", type: "number", defaultValue: 5, numberStep: .1, numberMin: 0 },
|
||||
maxVelocity: { name: "$Max.Velocity", type: "number", defaultValue: 10, numberStep: .1, numberMin: 0 },
|
||||
resistance: { name: "$Resistance", type: "number", defaultValue: 0.5, numberStep: .1, numberMin: 0 }
|
||||
};
|
||||
|
||||
public override terms: Record<string, Record<string, string>> = {
|
||||
"$Title": {
|
||||
"ZH_CN": "动力学",
|
||||
"EN_US": "Dynamics"
|
||||
},
|
||||
"$Intro": {
|
||||
"ZH_CN": "一切可以运动物体的必要行为,执行物理法则。",
|
||||
"EN_US": "All necessary behaviors that can move objects and implement the laws of physics."
|
||||
},
|
||||
"$Mass": {
|
||||
"ZH_CN": "质量 (Kg)",
|
||||
"EN_US": "Mass (Kg)"
|
||||
},
|
||||
"$Max.Acceleration": {
|
||||
"ZH_CN": "最大加速度 (m/s²)",
|
||||
"EN_US": "Maximum acceleration (m/s²)"
|
||||
},
|
||||
"$Max.Velocity": {
|
||||
"ZH_CN": "最大速度 (m/s)",
|
||||
"EN_US": "Maximum velocity (m/s)"
|
||||
},
|
||||
"$Resistance": {
|
||||
"ZH_CN": "阻力系数",
|
||||
"EN_US": "Resistance coefficient"
|
||||
},
|
||||
"$Physics": {
|
||||
"ZH_CN": "物理",
|
||||
"EN_US": "Physics"
|
||||
}
|
||||
};
|
||||
|
||||
public override finalEffect(individual: Individual, group: Group, model: Model, t: number): void {
|
||||
|
||||
// 计算当前速度
|
||||
@@ -139,6 +84,37 @@ class Dynamics extends Behavior<IDynamicsBehaviorParameter, IDynamicsBehaviorEve
|
||||
individual.force[1] = 0;
|
||||
individual.force[2] = 0;
|
||||
};
|
||||
|
||||
public override terms: Record<string, Record<string, string>> = {
|
||||
"$Title": {
|
||||
"ZH_CN": "动力学",
|
||||
"EN_US": "Dynamics"
|
||||
},
|
||||
"$Intro": {
|
||||
"ZH_CN": "一切可以运动物体的必要行为,执行物理法则。",
|
||||
"EN_US": "All necessary behaviors that can move objects and implement the laws of physics."
|
||||
},
|
||||
"$Mass": {
|
||||
"ZH_CN": "质量 (Kg)",
|
||||
"EN_US": "Mass (Kg)"
|
||||
},
|
||||
"$Max.Acceleration": {
|
||||
"ZH_CN": "最大加速度 (m/s²)",
|
||||
"EN_US": "Maximum acceleration (m/s²)"
|
||||
},
|
||||
"$Max.Velocity": {
|
||||
"ZH_CN": "最大速度 (m/s)",
|
||||
"EN_US": "Maximum velocity (m/s)"
|
||||
},
|
||||
"$Resistance": {
|
||||
"ZH_CN": "阻力系数",
|
||||
"EN_US": "Resistance coefficient"
|
||||
},
|
||||
"$Physics": {
|
||||
"ZH_CN": "物理",
|
||||
"EN_US": "Physics"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export { Dynamics };
|
||||
+22
-48
@@ -7,6 +7,8 @@ type ITemplateBehaviorParameter = {
|
||||
testNumber: "number";
|
||||
testString: "string";
|
||||
testBoolean: "boolean";
|
||||
testColor: "color";
|
||||
testOption: "option";
|
||||
testR: "R";
|
||||
testG: "G";
|
||||
testLR: "LR";
|
||||
@@ -29,52 +31,24 @@ class Template extends Behavior<ITemplateBehaviorParameter, ITemplateBehaviorEve
|
||||
public override category: string = "$Category";
|
||||
|
||||
public override parameterOption = {
|
||||
testNumber: {
|
||||
name: "$Test",
|
||||
type: "number",
|
||||
defaultValue: 1,
|
||||
numberMax: 10,
|
||||
numberMin: 0,
|
||||
numberStep: 1
|
||||
},
|
||||
testString: {
|
||||
name: "$Test",
|
||||
type: "string",
|
||||
defaultValue: "default",
|
||||
maxLength: 12
|
||||
},
|
||||
testBoolean: {
|
||||
name: "$Test",
|
||||
type: "boolean",
|
||||
defaultValue: false,
|
||||
iconName: "Send"
|
||||
},
|
||||
testR: {
|
||||
name: "$Test",
|
||||
type: "R"
|
||||
},
|
||||
testG: {
|
||||
name: "$Test",
|
||||
type: "G"
|
||||
},
|
||||
testLR: {
|
||||
name: "$Test",
|
||||
type: "LR"
|
||||
},
|
||||
testLG: {
|
||||
name: "$Test",
|
||||
type: "LG"
|
||||
},
|
||||
testVec: {
|
||||
name: "$Test",
|
||||
type: "vec",
|
||||
defaultValue: [1, 2, 3],
|
||||
numberMax: 10,
|
||||
numberMin: 0,
|
||||
numberStep: 1
|
||||
}
|
||||
testNumber: { name: "$Test", type: "number", defaultValue: 1, numberMax: 10, numberMin: 0, numberStep: 1 },
|
||||
testString: { name: "$Test", type: "string", defaultValue: "default", maxLength: 12 },
|
||||
testColor: { name: "$Test", type: "color", defaultValue: [.5, .1, 1], colorNormal: true },
|
||||
testOption: { name: "$Test", type: "option", defaultValue: "T", allOption: [
|
||||
{ key: "P", name: "$Test"}, { key: "T", name: "$Title"}
|
||||
]},
|
||||
testBoolean: { name: "$Test", type: "boolean", defaultValue: false, iconName: "Send" },
|
||||
testR: { name: "$Test", type: "R" },
|
||||
testG: { name: "$Test", type: "G" },
|
||||
testLR: { name: "$Test", type: "LR" },
|
||||
testLG: { name: "$Test", type: "LG" },
|
||||
testVec: { name: "$Test", type: "vec", defaultValue: [1, 2, 3], numberMax: 10, numberMin: 0, numberStep: 1 }
|
||||
};
|
||||
|
||||
public effect(individual: Individual, group: Group, model: Model, t: number): void {
|
||||
|
||||
}
|
||||
|
||||
public override terms: Record<string, Record<string, string>> = {
|
||||
"$Title": {
|
||||
"ZH_CN": "行为",
|
||||
@@ -87,12 +61,12 @@ class Template extends Behavior<ITemplateBehaviorParameter, ITemplateBehaviorEve
|
||||
"$Test": {
|
||||
"ZH_CN": "测试参数",
|
||||
"EN_US": "Test Parameter"
|
||||
},
|
||||
"$Category": {
|
||||
"ZH_CN": "测序模板",
|
||||
"EN_US": "Test template"
|
||||
}
|
||||
};
|
||||
|
||||
public effect(individual: Individual, group: Group, model: Model, t: number): void {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export { Template };
|
||||
@@ -1,11 +1,13 @@
|
||||
import { Theme } from "@Component/Theme/Theme";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { IRenderBehavior, Behavior, BehaviorRecorder } from "@Model/Behavior";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { useSettingWithEvent, IMixinSettingProps } from "@Context/Setting";
|
||||
import { useStatus, IMixinStatusProps } from "@Context/Status";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { IRenderBehavior, Behavior, BehaviorRecorder } from "@Model/Behavior";
|
||||
import { Theme } from "@Component/Theme/Theme";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
|
||||
|
||||
import "./BehaviorList.scss";
|
||||
|
||||
interface IBehaviorListProps {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { Component, ReactNode, Fragment } from "react";
|
||||
import { Popup } from "@Context/Popups";
|
||||
import { useStatus, IMixinStatusProps, randomColor } from "@Context/Status";
|
||||
import { useSettingWithEvent, IMixinSettingProps } from "@Context/Setting";
|
||||
import { Localization } from "@Component/Localization/Localization";
|
||||
import { SearchBox } from "@Component/SearchBox/SearchBox";
|
||||
import { SearchBox } from "@Input/SearchBox/SearchBox";
|
||||
import { ConfirmContent } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { BehaviorList } from "@Component/BehaviorList/BehaviorList";
|
||||
import { AllBehaviorsWithCategory, ICategoryBehavior } from "@Behavior/Behavior";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { IRenderBehavior, BehaviorRecorder } from "@Model/Behavior";
|
||||
import { useStatus, IMixinStatusProps, randomColor } from "@Context/Status";
|
||||
import { useSettingWithEvent, IMixinSettingProps } from "@Context/Setting";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
|
||||
import "./BehaviorPopup.scss";
|
||||
|
||||
interface IBehaviorPopupProps {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { BackgroundLevel, Theme } from "@Component/Theme/Theme";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { DirectionalHint, IconButton } from "@fluentui/react";
|
||||
import { LocalizationTooltipHost } from "../Localization/LocalizationTooltipHost";
|
||||
import { useSetting, IMixinSettingProps } from "@Context/Setting";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { AllI18nKeys } from "../Localization/Localization";
|
||||
import { SettingPopup } from "../SettingPopup/SettingPopup";
|
||||
import { BehaviorPopup } from "../BehaviorPopup/BehaviorPopup";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { BackgroundLevel, Theme } from "@Component/Theme/Theme";
|
||||
import { LocalizationTooltipHost } from "@Component/Localization/LocalizationTooltipHost";
|
||||
import { AllI18nKeys } from "@Component/Localization/Localization";
|
||||
import { SettingPopup } from "@Component/SettingPopup/SettingPopup";
|
||||
import { BehaviorPopup } from "@Component/BehaviorPopup/BehaviorPopup";
|
||||
import { MouseMod } from "@GLRender/ClassicRenderer";
|
||||
import "./CommandBar.scss";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Popup } from "@Context/Popups";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { Popup } from "@Context/Popups";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { Theme } from "@Component/Theme/Theme";
|
||||
import { AllI18nKeys, Localization } from "@Component/Localization/Localization";
|
||||
import "./ConfirmPopup.scss";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Localization } from "@Component/Localization/Localization";
|
||||
import { Theme, BackgroundLevel, FontLevel } from "@Component/Theme/Theme";
|
||||
import { Themes } from "@Context/Setting";
|
||||
import { DirectionalHint } from "@fluentui/react";
|
||||
import { ILayout, LayoutDirection } from "@Context/Layout";
|
||||
import { Component, ReactNode, MouseEvent } from "react";
|
||||
import { getPanelById, getPanelInfoById } from "../../Panel/Panel";
|
||||
import { LocalizationTooltipHost } from "../Localization/LocalizationTooltipHost";
|
||||
import { DirectionalHint } from "@fluentui/react";
|
||||
import { Themes } from "@Context/Setting";
|
||||
import { ILayout, LayoutDirection } from "@Context/Layout";
|
||||
import { Localization } from "@Component/Localization/Localization";
|
||||
import { BackgroundLevel, FontLevel } from "@Component/Theme/Theme";
|
||||
import { getPanelById, getPanelInfoById } from "@Panel/Panel";
|
||||
import { LocalizationTooltipHost } from "@Component/Localization/LocalizationTooltipHost";
|
||||
import "./Container.scss";
|
||||
|
||||
interface IContainerProps extends ILayout {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { BackgroundLevel, FontLevel, Theme } from "../Theme/Theme";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { BackgroundLevel, FontLevel, Theme } from "@Component/Theme/Theme";
|
||||
import "./DetailsList.scss";
|
||||
|
||||
type IItems = Record<string, any> & {key: string, select?: boolean};
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { Icon } from '@fluentui/react/lib/Icon';
|
||||
import { useStatus, IMixinStatusProps } from "@Context/Status";
|
||||
import { useSetting, IMixinSettingProps } from "@Context/Setting";
|
||||
import { Theme, BackgroundLevel, FontLevel } from "@Component/Theme/Theme";
|
||||
import { Icon } from '@fluentui/react/lib/Icon';
|
||||
import { LocalizationTooltipHost } from "../Localization/LocalizationTooltipHost";
|
||||
import { I18N } from "../Localization/Localization";
|
||||
import { LocalizationTooltipHost } from "@Component/Localization/LocalizationTooltipHost";
|
||||
import { I18N } from "@Component/Localization/Localization";
|
||||
import "./HeaderBar.scss";
|
||||
import { Tooltip, TooltipHost } from "@fluentui/react";
|
||||
|
||||
interface IHeaderBarProps {
|
||||
height: number;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, RefObject } from "react";
|
||||
import { Label } from "@Model/Label";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { useSetting, IMixinSettingProps, Themes } from "@Context/Setting";
|
||||
import { Label } from "@Model/Label";
|
||||
import "./LabelList.scss";
|
||||
|
||||
interface ILabelListProps {
|
||||
|
||||
@@ -78,4 +78,4 @@ class Localization extends Component<ILocalizationProps & IMixinSettingProps &
|
||||
}
|
||||
}
|
||||
|
||||
export { Localization, I18N, LanguageDataBase, AllI18nKeys };
|
||||
export { Localization, I18N, LanguageDataBase, AllI18nKeys, ILocalizationProps };
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { IMixinStatusProps, useStatusWithEvent } from "@Context/Status";
|
||||
import { IMixinSettingProps, useSettingWithEvent } from "@Context/Setting";
|
||||
import { BackgroundLevel, FontLevel, getClassList, Theme } from "@Component/Theme/Theme";
|
||||
import { Popup as PopupModel, ResizeDragDirection } from "@Context/Popups";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import "./Popup.scss";
|
||||
|
||||
interface IPopupProps {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useSettingWithEvent, Themes, IMixinSettingProps, Setting } from "@Context/Setting";
|
||||
import { Component, ReactNode, DetailedHTMLProps, HTMLAttributes } from "react";
|
||||
import { useSettingWithEvent, Themes, IMixinSettingProps, Setting } from "@Context/Setting";
|
||||
import "./Theme.scss";
|
||||
|
||||
enum FontLevel {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Emitter, EventType } from "@Model/Emitter";
|
||||
import { Component, FunctionComponent, ReactNode, Consumer } from "react";
|
||||
import { Emitter, EventType } from "@Model/Emitter";
|
||||
|
||||
type RenderComponent = (new (...p: any) => Component<any, any, any>) | FunctionComponent<any>;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createContext } from "react";
|
||||
import { superConnect, superConnectWithEvent } from "./Context";
|
||||
import { superConnect, superConnectWithEvent } from "@Context/Context";
|
||||
import { Emitter } from "@Model/Emitter";
|
||||
import { Layout } from "./Layout";
|
||||
import { Layout } from "@Context/Layout";
|
||||
|
||||
/**
|
||||
* 主题模式
|
||||
|
||||
@@ -7,11 +7,12 @@ import { Group } from "@Model/Group";
|
||||
import { Archive } from "@Model/Archive";
|
||||
import { AbstractRenderer } from "@Model/Renderer";
|
||||
import { ClassicRenderer, MouseMod } from "@GLRender/ClassicRenderer";
|
||||
import { Setting } from "./Setting";
|
||||
import { Setting } from "@Context/Setting";
|
||||
import { I18N } from "@Component/Localization/Localization";
|
||||
import { superConnectWithEvent, superConnect } from "./Context";
|
||||
import { PopupController } from "./Popups";
|
||||
import { Behavior, IBehaviorParameter, IParamValue } from "@Model/Behavior";
|
||||
import { superConnectWithEvent, superConnect } from "@Context/Context";
|
||||
import { PopupController } from "@Context/Popups";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { IParameter, IParamValue } from "@Model/Parameter";
|
||||
import { Actuator } from "@Model/Actuator";
|
||||
|
||||
function randomColor(unNormal: boolean = false) {
|
||||
@@ -208,7 +209,7 @@ class Status extends Emitter<IStatusEvent> {
|
||||
/**
|
||||
* 修改群属性
|
||||
*/
|
||||
public changeBehaviorAttrib<K extends IBehaviorParameter, P extends keyof K | keyof Behavior<K>>
|
||||
public changeBehaviorAttrib<K extends IParameter, P extends keyof K | keyof Behavior<K>>
|
||||
(id: ObjectID, key: P, val: IParamValue<K[P]>, noParameter?: boolean) {
|
||||
const behavior = this.model.getBehaviorById(id);
|
||||
if (behavior) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "../Theme/Theme.scss";
|
||||
@import "../../Component/Theme/Theme.scss";
|
||||
|
||||
$line-min-height: 24px;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { Localization, AllI18nKeys } from "@Component/Localization/Localization";
|
||||
import { AllI18nKeys } from "@Component/Localization/Localization";
|
||||
import { ObjectID } from "@Model/Renderer";
|
||||
import { TextField, ITextFieldProps } from "../TextField/TextField";
|
||||
import { TextField, ITextFieldProps } from "@Input/TextField/TextField";
|
||||
import "./AttrInput.scss";
|
||||
|
||||
interface IAttrInputProps extends ITextFieldProps {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../Theme/Theme.scss";
|
||||
@import "../../Component/Theme/Theme.scss";
|
||||
|
||||
div.behavior-picker-list {
|
||||
width: 100%;
|
||||
+5
-5
@@ -1,11 +1,11 @@
|
||||
import { DetailsList } from "@Component/DetailsList/DetailsList";
|
||||
import { Component, ReactNode, createRef } from "react";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { useSettingWithEvent, IMixinSettingProps } from "@Context/Setting";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { DetailsList } from "@Component/DetailsList/DetailsList";
|
||||
import { Localization } from "@Component/Localization/Localization";
|
||||
import { PickerList } from "@Component/PickerList/PickerList";
|
||||
import { PickerList } from "@Input/PickerList/PickerList";
|
||||
import "./BehaviorPicker.scss";
|
||||
|
||||
interface IBehaviorPickerProps {
|
||||
@@ -145,10 +145,10 @@ class BehaviorPicker extends Component<IBehaviorPickerProps & IMixinSettingProps
|
||||
|
||||
private renderPickerList(): ReactNode {
|
||||
return <PickerList
|
||||
objectList={this.getAllData()}
|
||||
item={this.getAllData()}
|
||||
noData="Behavior.Picker.Add.Nodata"
|
||||
target={this.clickLineRef}
|
||||
clickObjectItems={((item) => {
|
||||
click={((item) => {
|
||||
if (item instanceof Behavior && this.props.add) {
|
||||
this.props.add(item);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, createRef, ReactNode } from "react";
|
||||
import { TextField, ITextFieldProps } from "@Component/TextField/TextField";
|
||||
import { Callout, ColorPicker, DirectionalHint } from "@fluentui/react";
|
||||
import { TextField, ITextFieldProps } from "@Input/TextField/TextField";
|
||||
import "./ColorInput.scss";
|
||||
|
||||
interface IColorInputProps extends ITextFieldProps {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../Theme/Theme.scss";
|
||||
@import "../../Component/Theme/Theme.scss";
|
||||
|
||||
$line-min-height: 24px;
|
||||
|
||||
+8
-10
@@ -1,7 +1,7 @@
|
||||
import { Component, createRef, ReactNode } from "react";
|
||||
import { PickerList, IDisplayItem } from "../PickerList/PickerList";
|
||||
import { TextField, ITextFieldProps } from "../TextField/TextField";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { ComboList, IDisplayItem } from "@Input/ComboList/ComboList";
|
||||
import { TextField, ITextFieldProps } from "@Input/TextField/TextField";
|
||||
import { Localization } from "@Component/Localization/Localization";
|
||||
import "./ComboInput.scss";
|
||||
interface IComboInputProps extends ITextFieldProps {
|
||||
@@ -26,13 +26,11 @@ class ComboInput extends Component<IComboInputProps, IComboInputState> {
|
||||
private pickerTarget = createRef<HTMLDivElement>();
|
||||
|
||||
private renderPicker() {
|
||||
return <PickerList
|
||||
return <ComboList
|
||||
target={this.pickerTarget}
|
||||
displayItems={(this.props.allOption ?? []).map((item) => {
|
||||
return item.key === this.props.value?.key ?
|
||||
{...item, mark: true} : item;
|
||||
})}
|
||||
clickDisplayItems={((item) => {
|
||||
item={this.props.allOption ?? []}
|
||||
focus={this.props.value}
|
||||
click={((item) => {
|
||||
if (this.props.valueChange) {
|
||||
this.props.valueChange(item);
|
||||
}
|
||||
@@ -64,8 +62,8 @@ class ComboInput extends Component<IComboInputProps, IComboInputState> {
|
||||
<div className="value-view">
|
||||
{
|
||||
this.props.value ?
|
||||
<Localization i18nKey={this.props.value.nameKey}/> :
|
||||
null
|
||||
<Localization i18nKey={this.props.value.i18n} options={this.props.value.i18nOption}/> :
|
||||
<Localization i18nKey="Input.Error.Combo"/>
|
||||
}
|
||||
</div>
|
||||
<div className="list-button">
|
||||
@@ -0,0 +1 @@
|
||||
@import "../PickerList/PickerList.scss";
|
||||
@@ -0,0 +1,71 @@
|
||||
import { AllI18nKeys, Localization } from "@Component/Localization/Localization";
|
||||
import { Callout, DirectionalHint, Icon } from "@fluentui/react";
|
||||
import { Component, ReactNode, RefObject } from "react";
|
||||
import "./ComboList.scss";
|
||||
|
||||
interface IDisplayItem {
|
||||
i18nOption?: Record<string, string>;
|
||||
i18n: AllI18nKeys;
|
||||
key: string;
|
||||
}
|
||||
|
||||
interface IComboListProps {
|
||||
target?: RefObject<any>;
|
||||
item: IDisplayItem[];
|
||||
focus?: IDisplayItem;
|
||||
noData?: AllI18nKeys;
|
||||
dismiss?: () => any;
|
||||
click?: (item: IDisplayItem) => any;
|
||||
}
|
||||
|
||||
class ComboList extends Component<IComboListProps> {
|
||||
|
||||
private renderString(item: IDisplayItem) {
|
||||
|
||||
const isFocus = item.key === this.props.focus?.key;
|
||||
|
||||
return <div
|
||||
className="picker-list-item"
|
||||
key={item.key}
|
||||
onClick={() => {
|
||||
if (this.props.click) {
|
||||
this.props.click(item)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="list-item-icon">
|
||||
<Icon
|
||||
iconName="CheckMark"
|
||||
style={{
|
||||
display: isFocus ? "block" : "none"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<div className="list-item-name">
|
||||
<Localization i18nKey={item.i18n} options={item.i18nOption}/>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
return <Callout
|
||||
onDismiss={this.props.dismiss}
|
||||
target={this.props.target}
|
||||
directionalHint={DirectionalHint.topCenter}
|
||||
>
|
||||
<div className="picker-list-root">
|
||||
{ this.props.item.map((item) => this.renderString(item)) }
|
||||
{
|
||||
this.props.item.length <= 0 ?
|
||||
<Localization
|
||||
className="picker-list-nodata"
|
||||
i18nKey={this.props.noData ?? "Common.No.Data"}
|
||||
/>
|
||||
: null
|
||||
}
|
||||
</div>
|
||||
</Callout>
|
||||
}
|
||||
}
|
||||
|
||||
export { ComboList, IDisplayItem }
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../Theme/Theme.scss";
|
||||
@import "../../Component/Theme/Theme.scss";
|
||||
|
||||
$line-min-height: 26px;
|
||||
|
||||
+7
-7
@@ -1,9 +1,9 @@
|
||||
import { PickerList } from "../PickerList/PickerList";
|
||||
import { Label } from "@Model/Label";
|
||||
import { TextField, ITextFieldProps } from "../TextField/TextField";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { Component, ReactNode, createRef } from "react";
|
||||
import { LabelList } from "../LabelList/LabelList";
|
||||
import { Label } from "@Model/Label";
|
||||
import { PickerList } from "@Input/PickerList/PickerList";
|
||||
import { TextField, ITextFieldProps } from "@Input/TextField/TextField";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { LabelList } from "@Component/LabelList/LabelList";
|
||||
import "./LabelPicker.scss"
|
||||
|
||||
interface ILabelPickerProps extends ITextFieldProps {
|
||||
@@ -48,13 +48,13 @@ class LabelPicker extends Component<ILabelPickerProps & IMixinStatusProps, ILabe
|
||||
private renderPicker() {
|
||||
return <PickerList
|
||||
noData="Common.Attr.Key.Label.Picker.Nodata"
|
||||
objectList={this.getOtherLabel()}
|
||||
item={this.getOtherLabel()}
|
||||
dismiss={() => {
|
||||
this.setState({
|
||||
isPickerVisible: false
|
||||
});
|
||||
}}
|
||||
clickObjectItems={(label) => {
|
||||
click={(label) => {
|
||||
if (label instanceof Label && this.props.labelAdd) {
|
||||
this.props.labelAdd(label)
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { FunctionComponent } from "react";
|
||||
import { AllI18nKeys, I18N } from "@Component/Localization/Localization";
|
||||
import { useSettingWithEvent, IMixinSettingProps, Themes, Language } from "@Context/Setting";
|
||||
import { FunctionComponent } from "react";
|
||||
import "./Message.scss";
|
||||
|
||||
interface IMessageProps {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../Theme/Theme.scss";
|
||||
@import "../../Component/Theme/Theme.scss";
|
||||
@import "../PickerList/RainbowBg.scss";
|
||||
|
||||
$line-min-height: 24px;
|
||||
+8
-8
@@ -1,14 +1,14 @@
|
||||
import { Component, createRef, ReactNode } from "react";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { Label } from "@Model/Label";
|
||||
import { Group } from "@Model/Group";
|
||||
import { Range } from "@Model/Range";
|
||||
import { TextField, ITextFieldProps } from "../TextField/TextField";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { PickerList, IDisplayItem, getObjectDisplayInfo, IDisplayInfo } from "../PickerList/PickerList";
|
||||
import { Localization } from "@Component/Localization/Localization";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { CtrlObject } from "@Model/CtrlObject";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { TextField, ITextFieldProps } from "@Input/TextField/TextField";
|
||||
import { PickerList, getObjectDisplayInfo, IDisplayInfo } from "@Input/PickerList/PickerList";
|
||||
import { Localization } from "@Component/Localization/Localization";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import "./ObjectPicker.scss";
|
||||
|
||||
type IObjectType = Label | Group | Range | CtrlObject;
|
||||
@@ -79,8 +79,8 @@ class ObjectPicker extends Component<IObjectPickerProps & IMixinStatusProps, IOb
|
||||
return <PickerList
|
||||
noData="Object.Picker.List.No.Data"
|
||||
target={this.pickerTarget}
|
||||
objectList={this.getAllOption()}
|
||||
clickObjectItems={((item) => {
|
||||
item={this.getAllOption()}
|
||||
click={((item) => {
|
||||
if (item instanceof Behavior) return;
|
||||
if (this.props.valueChange) {
|
||||
this.props.valueChange(item);
|
||||
@@ -166,4 +166,4 @@ class ObjectPicker extends Component<IObjectPickerProps & IMixinStatusProps, IOb
|
||||
}
|
||||
}
|
||||
|
||||
export { ObjectPicker, IDisplayItem };
|
||||
export { ObjectPicker };
|
||||
@@ -0,0 +1,274 @@
|
||||
import { Component, Fragment, ReactNode } from "react";
|
||||
import { useSettingWithEvent, IMixinSettingProps, Language } from "@Context/Setting";
|
||||
import { AttrInput } from "@Input/AttrInput/AttrInput";
|
||||
import { ObjectID } from "@Model/Renderer";
|
||||
import { TogglesInput } from "@Input/TogglesInput/TogglesInput";
|
||||
import { ObjectPicker } from "@Input/ObjectPicker/ObjectPicker";
|
||||
import { AllI18nKeys, I18N } from "@Component/Localization/Localization";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { ColorInput } from "@Input/ColorInput/ColorInput";
|
||||
import { ComboInput, IDisplayItem } from "@Input/ComboInput/ComboInput";
|
||||
import {
|
||||
IParameter, IParameterOption, IParameterOptionItem,
|
||||
IParameterValue, IParamValue, isObjectType, isVectorType
|
||||
} from "@Model/Parameter";
|
||||
import "./Parameter.scss";
|
||||
|
||||
interface IParameterProps<P extends IParameter = {}> {
|
||||
option: IParameterOption<P>;
|
||||
value: IParameterValue<P>;
|
||||
key: ObjectID;
|
||||
change: <K extends keyof P>(key: K, val: IParamValue<P[K]>) => any;
|
||||
i18n?: (key: string, language: Language) => string;
|
||||
title?: AllI18nKeys;
|
||||
titleOption?: Record<string, string>;
|
||||
isFirst?: boolean;
|
||||
}
|
||||
|
||||
@useSettingWithEvent("language")
|
||||
class Parameter<P extends IParameter> extends Component<IParameterProps<P> & IMixinSettingProps> {
|
||||
|
||||
private renderParameter<K extends keyof P>
|
||||
(key: K, option: IParameterOptionItem<P[K]>, value: IParamValue<P[K]>): ReactNode {
|
||||
|
||||
const language = this.props.setting?.language ?? "EN_US";
|
||||
const indexKey = `${this.props.key}-${key}`;
|
||||
const type = option.type;
|
||||
let keyI18n: string, keyI18nOption: Record<string, string> | undefined;
|
||||
|
||||
// Custom I18N
|
||||
if (this.props.i18n) {
|
||||
keyI18n = "Panel.Info.Behavior.Details.Parameter.Key";
|
||||
keyI18nOption = {
|
||||
key: this.props.i18n(option.name, language)
|
||||
};
|
||||
}
|
||||
|
||||
else {
|
||||
keyI18n = option.name;
|
||||
}
|
||||
|
||||
if (type === "number") {
|
||||
return <AttrInput
|
||||
key={indexKey}
|
||||
id={indexKey}
|
||||
keyI18n={keyI18n}
|
||||
keyI18nOption={keyI18nOption}
|
||||
isNumber={true}
|
||||
step={option.numberStep}
|
||||
maxLength={option.maxLength}
|
||||
max={option.numberMax}
|
||||
min={option.numberMin}
|
||||
value={value as IParamValue<"number"> ?? 0}
|
||||
valueChange={(val) => {
|
||||
this.props.change(key, parseFloat(val) as IParamValue<P[K]>);
|
||||
}}
|
||||
/>;
|
||||
}
|
||||
|
||||
else if (type === "string") {
|
||||
return <AttrInput
|
||||
key={indexKey}
|
||||
id={indexKey}
|
||||
keyI18n={keyI18n}
|
||||
keyI18nOption={keyI18nOption}
|
||||
maxLength={option.maxLength}
|
||||
value={value as IParamValue<"string"> ?? ""}
|
||||
valueChange={(val) => {
|
||||
this.props.change(key, val as IParamValue<P[K]>);
|
||||
}}
|
||||
/>;
|
||||
}
|
||||
|
||||
else if (type === "boolean") {
|
||||
return <TogglesInput
|
||||
key={indexKey}
|
||||
keyI18n={keyI18n}
|
||||
keyI18nOption={keyI18nOption}
|
||||
onIconName={option.iconName}
|
||||
red={option.iconRed}
|
||||
value={value as IParamValue<"boolean"> ?? false}
|
||||
valueChange={(val) => {
|
||||
this.props.change(key, val as IParamValue<P[K]>);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
else if (isObjectType(type)) {
|
||||
|
||||
type IObjectParamValue = IParamValue<"G" | "R" | "LG" | "LR">;
|
||||
const typedValue = value as IObjectParamValue;
|
||||
|
||||
return <ObjectPicker
|
||||
key={indexKey}
|
||||
keyI18n={keyI18n}
|
||||
keyI18nOption={keyI18nOption}
|
||||
type={type}
|
||||
value={typedValue.picker}
|
||||
valueChange={(obj) => {
|
||||
typedValue.picker = obj as IObjectParamValue["picker"];
|
||||
this.props.change(key, typedValue as IParamValue<P[K]>);
|
||||
}}
|
||||
cleanValue={() => {
|
||||
typedValue.picker = undefined as IObjectParamValue["picker"];
|
||||
this.props.change(key, typedValue as IParamValue<P[K]>);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
else if (type === "color") {
|
||||
|
||||
return <ColorInput
|
||||
key={indexKey}
|
||||
keyI18n={keyI18n}
|
||||
keyI18nOption={keyI18nOption}
|
||||
normal={option.colorNormal}
|
||||
value={value as IParamValue<"color"> ?? false}
|
||||
valueChange={(val) => {
|
||||
this.props.change(key, val as IParamValue<P[K]>);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
else if (type === "option") {
|
||||
|
||||
let allOption: IDisplayItem[] = [];
|
||||
let focusKey: number = -1;
|
||||
|
||||
if (option.allOption) {
|
||||
for (let i = 0; i < option.allOption.length; i++) {
|
||||
|
||||
if (this.props.i18n) {
|
||||
allOption.push({
|
||||
i18nOption: { key: this.props.i18n(option.allOption[i].name, language) },
|
||||
i18n: "Panel.Info.Behavior.Details.Parameter.Key",
|
||||
key: option.allOption[i].key
|
||||
})
|
||||
}
|
||||
|
||||
else {
|
||||
allOption.push({
|
||||
i18n: option.allOption[i].name,
|
||||
key: option.allOption[i].key
|
||||
})
|
||||
}
|
||||
|
||||
if (option.allOption[i].key === value) {
|
||||
focusKey = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return <ComboInput
|
||||
key={indexKey}
|
||||
keyI18n={keyI18n}
|
||||
keyI18nOption={keyI18nOption}
|
||||
allOption={allOption}
|
||||
value={allOption[focusKey]}
|
||||
valueChange={(val) => {
|
||||
this.props.change(key, val.key as IParamValue<P[K]>);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
else if (type === "vec") {
|
||||
|
||||
type IObjectParamValue = IParamValue<"vec">;
|
||||
const typedValue = value as IObjectParamValue;
|
||||
const i18nVal = I18N(this.props, keyI18n, keyI18nOption);
|
||||
|
||||
return <Fragment key={indexKey}>
|
||||
|
||||
<AttrInput
|
||||
key={`${indexKey}-X`}
|
||||
id={indexKey}
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key.Vec.X"
|
||||
keyI18nOption={{ key: i18nVal }}
|
||||
isNumber={true}
|
||||
step={option.numberStep}
|
||||
maxLength={option.maxLength}
|
||||
max={option.numberMax}
|
||||
min={option.numberMin}
|
||||
value={typedValue[0] ?? 0}
|
||||
valueChange={(val) => {
|
||||
typedValue[0] = parseFloat(val);
|
||||
this.props.change(key, typedValue as IParamValue<P[K]>);
|
||||
}}
|
||||
/>
|
||||
|
||||
<AttrInput
|
||||
key={`${indexKey}-Y`}
|
||||
id={indexKey}
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key.Vec.Y"
|
||||
keyI18nOption={{ key: i18nVal }}
|
||||
isNumber={true}
|
||||
step={option.numberStep}
|
||||
maxLength={option.maxLength}
|
||||
max={option.numberMax}
|
||||
min={option.numberMin}
|
||||
value={typedValue[1] ?? 0}
|
||||
valueChange={(val) => {
|
||||
typedValue[1] = parseFloat(val);
|
||||
this.props.change(key, typedValue as IParamValue<P[K]>);
|
||||
}}
|
||||
/>
|
||||
|
||||
<AttrInput
|
||||
key={`${indexKey}-Z`}
|
||||
id={indexKey}
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key.Vec.Z"
|
||||
keyI18nOption={{ key: i18nVal }}
|
||||
isNumber={true}
|
||||
step={option.numberStep}
|
||||
maxLength={option.maxLength}
|
||||
max={option.numberMax}
|
||||
min={option.numberMin}
|
||||
value={typedValue[2] ?? 0}
|
||||
valueChange={(val) => {
|
||||
typedValue[2] = parseFloat(val);
|
||||
this.props.change(key, typedValue as IParamValue<P[K]>);
|
||||
}}
|
||||
/>
|
||||
|
||||
</Fragment>
|
||||
}
|
||||
|
||||
else {
|
||||
return <Fragment key={indexKey}/>
|
||||
}
|
||||
}
|
||||
|
||||
private renderAllParameter(key: Array<keyof P>) {
|
||||
return key.map((key) => {
|
||||
return this.renderParameter(
|
||||
key,
|
||||
this.props.option[key],
|
||||
this.props.value[key],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
const allOptionKeys: Array<keyof P> = Object.getOwnPropertyNames(this.props.option);
|
||||
|
||||
return <>
|
||||
|
||||
{
|
||||
allOptionKeys.length <= 0 && this.props.title ?
|
||||
<Message
|
||||
isTitle
|
||||
first={this.props.isFirst}
|
||||
i18nKey={this.props.title}
|
||||
options={this.props.titleOption}
|
||||
/> : null
|
||||
}
|
||||
|
||||
{
|
||||
this.renderAllParameter(allOptionKeys)
|
||||
}
|
||||
|
||||
</>
|
||||
}
|
||||
}
|
||||
|
||||
export { Parameter }
|
||||
+9
-45
@@ -17,12 +17,6 @@ interface IDisplayInfo {
|
||||
allLabel: boolean;
|
||||
};
|
||||
|
||||
interface IDisplayItem {
|
||||
nameKey: AllI18nKeys;
|
||||
key: string;
|
||||
mark?: boolean;
|
||||
}
|
||||
|
||||
function getObjectDisplayInfo(item?: IPickerListItem): IDisplayInfo {
|
||||
|
||||
if (!item) {
|
||||
@@ -98,13 +92,11 @@ function getObjectDisplayInfo(item?: IPickerListItem): IDisplayInfo {
|
||||
}
|
||||
|
||||
interface IPickerListProps {
|
||||
displayItems?: IDisplayItem[];
|
||||
objectList?: IPickerListItem[];
|
||||
item: IPickerListItem[];
|
||||
target?: RefObject<any>;
|
||||
noData?: AllI18nKeys;
|
||||
dismiss?: () => any;
|
||||
clickObjectItems?: (item: IPickerListItem) => any;
|
||||
clickDisplayItems?: (item: IDisplayItem) => any;
|
||||
click?: (item: IPickerListItem) => any;
|
||||
}
|
||||
|
||||
class PickerList extends Component<IPickerListProps> {
|
||||
@@ -116,8 +108,8 @@ class PickerList extends Component<IPickerListProps> {
|
||||
className="picker-list-item"
|
||||
key={item.id}
|
||||
onClick={() => {
|
||||
if (this.props.clickObjectItems) {
|
||||
this.props.clickObjectItems(item)
|
||||
if (this.props.click) {
|
||||
this.props.click(item)
|
||||
}
|
||||
}}
|
||||
>
|
||||
@@ -143,27 +135,6 @@ class PickerList extends Component<IPickerListProps> {
|
||||
</div>;
|
||||
}
|
||||
|
||||
private renderString(item: IDisplayItem) {
|
||||
return <div
|
||||
className="picker-list-item"
|
||||
key={item.key}
|
||||
onClick={() => {
|
||||
if (this.props.clickDisplayItems) {
|
||||
this.props.clickDisplayItems(item)
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="list-item-icon">
|
||||
<Icon iconName="CheckMark" style={{
|
||||
display: item.mark ? "block" : "none"
|
||||
}}/>
|
||||
</div>
|
||||
<div className="list-item-name">
|
||||
<Localization i18nKey={item.nameKey}/>
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
return <Callout
|
||||
onDismiss={this.props.dismiss}
|
||||
@@ -171,18 +142,11 @@ class PickerList extends Component<IPickerListProps> {
|
||||
directionalHint={DirectionalHint.topCenter}
|
||||
>
|
||||
<div className="picker-list-root">
|
||||
{this.props.objectList ? this.props.objectList.map((item) => {
|
||||
return this.renderItem(item);
|
||||
}) : null}
|
||||
{this.props.displayItems ? this.props.displayItems.map((item) => {
|
||||
return this.renderString(item);
|
||||
}) : null}
|
||||
{
|
||||
!(this.props.objectList || this.props.displayItems) ||
|
||||
!(
|
||||
this.props.objectList && this.props.objectList.length > 0 ||
|
||||
this.props.displayItems && this.props.displayItems.length > 0
|
||||
) ?
|
||||
this.props.item.map((item) => this.renderItem(item))
|
||||
}
|
||||
{
|
||||
this.props.item.length <= 0 ?
|
||||
<Localization
|
||||
className="picker-list-nodata"
|
||||
i18nKey={this.props.noData ?? "Common.No.Data"}
|
||||
@@ -194,4 +158,4 @@ class PickerList extends Component<IPickerListProps> {
|
||||
}
|
||||
}
|
||||
|
||||
export { PickerList, IDisplayItem, IDisplayInfo, getObjectDisplayInfo }
|
||||
export { PickerList, IDisplayInfo, getObjectDisplayInfo }
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "../Theme/Theme.scss";
|
||||
@import "../../Component/Theme/Theme.scss";
|
||||
|
||||
$search-box-height: 26px;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { AllI18nKeys, I18N } from "@Component/Localization/Localization";
|
||||
import { BackgroundLevel, FontLevel, Theme } from "@Component/Theme/Theme";
|
||||
import { useSettingWithEvent, IMixinSettingProps } from "@Context/Setting";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { Component, ReactNode } from "react";
|
||||
import "./SearchBox.scss";
|
||||
|
||||
interface ISearchBoxProps {
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "../Theme/Theme.scss";
|
||||
@import "../../Component/Theme/Theme.scss";
|
||||
|
||||
$line-min-height: 26px;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "../Theme/Theme.scss";
|
||||
@import "../../Component/Theme/Theme.scss";
|
||||
|
||||
$line-min-height: 26px;
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { TextField, ITextFieldProps } from "../TextField/TextField";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { TextField, ITextFieldProps } from "@Input/TextField/TextField";
|
||||
import "./TogglesInput.scss";
|
||||
|
||||
interface ITogglesInputProps extends ITextFieldProps {
|
||||
@@ -25,6 +25,7 @@ const EN_US = {
|
||||
"Input.Error.Length": "The length of the input content must be less than {num}",
|
||||
"Input.Error.Length.Less": "The length of the input content must be greater than {num}",
|
||||
"Input.Error.Select": "Select object ...",
|
||||
"Input.Error.Combo": "Select options ...",
|
||||
"Object.List.New.Group": "Group object {id}",
|
||||
"Object.List.New.Range": "Range object {id}",
|
||||
"Object.List.New.Label": "Label {id}",
|
||||
|
||||
@@ -25,7 +25,8 @@ const ZH_CN = {
|
||||
"Input.Error.Length": "输入内容长度须小于 {number}",
|
||||
"Input.Error.Length.Less": "输入内容长度须大于 {number}",
|
||||
"Input.Error.Select": "选择对象 ...",
|
||||
"Object.List.New.Group": "组对象 {id}",
|
||||
"Input.Error.Combo": "选择选项 ...",
|
||||
"Object.List.New.Group": "群对象 {id}",
|
||||
"Object.List.New.Range": "范围对象 {id}",
|
||||
"Object.List.New.Label": "标签 {id}",
|
||||
"Object.List.No.Data": "模型中没有任何对象,点击按钮以创建",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Model } from "./Model";
|
||||
import { Emitter } from "./Emitter";
|
||||
import { Model } from "@Model/Model";
|
||||
import { Emitter } from "@Model/Emitter";
|
||||
|
||||
interface IActuatorEvent {
|
||||
startChange: boolean;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Emitter, EventType, EventMixin } from "./Emitter";
|
||||
import { Emitter, EventType } from "@Model/Emitter";
|
||||
|
||||
interface IArchiveEvent {
|
||||
save: Archive;
|
||||
|
||||
+15
-186
@@ -1,136 +1,16 @@
|
||||
import { IAnyObject } from "./Renderer";
|
||||
import { Emitter, EventType } from "./Emitter";
|
||||
import type { Individual } from "./Individual";
|
||||
import type { Group } from "./Group";
|
||||
import type { Model } from "./Model";
|
||||
import type { Range } from "./Range";
|
||||
import type { Label } from "./Label";
|
||||
|
||||
type IObjectParamCacheType<P, Q = P> = {
|
||||
picker: P;
|
||||
objects: Q;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
type IMapBasicParamTypeKeyToType = {
|
||||
"number": number;
|
||||
"string": string;
|
||||
"boolean": boolean;
|
||||
}
|
||||
|
||||
type IMapObjectParamTypeKeyToType = {
|
||||
"R": IObjectParamCacheType<Range | undefined>;
|
||||
"G": IObjectParamCacheType<Group | undefined>;
|
||||
"LR": IObjectParamCacheType<Label | Range | undefined, Range[]>;
|
||||
"LG": IObjectParamCacheType<Label | Group | undefined, Group[]>;
|
||||
}
|
||||
|
||||
type IMapVectorParamTypeKeyToType = {
|
||||
"vec": number[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型映射
|
||||
*/
|
||||
type AllMapType = IMapBasicParamTypeKeyToType & IMapObjectParamTypeKeyToType & IMapVectorParamTypeKeyToType;
|
||||
type IParamType = keyof AllMapType;
|
||||
type IObjectType = keyof IMapObjectParamTypeKeyToType;
|
||||
type IVectorType = keyof IMapVectorParamTypeKeyToType;
|
||||
type IParamValue<K extends IParamType> = AllMapType[K];
|
||||
|
||||
/**
|
||||
* 特殊对象类型判定
|
||||
*/
|
||||
const objectTypeListEnumSet = new Set<IParamType>(["R", "G", "LR", "LG"]);
|
||||
|
||||
/**
|
||||
* 对象断言表达式
|
||||
*/
|
||||
function isObjectType(key: IParamType): key is IVectorType {
|
||||
return objectTypeListEnumSet.has(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向量断言表达式
|
||||
*/
|
||||
function isVectorType(key: IParamType): key is IObjectType {
|
||||
return key === "vec";
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型参数类型
|
||||
*/
|
||||
interface IBehaviorParameterOptionItem<T extends IParamType = IParamType> {
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
type: T | string;
|
||||
|
||||
/**
|
||||
* 参数默认值
|
||||
*/
|
||||
defaultValue?: IParamValue<T>;
|
||||
|
||||
/**
|
||||
* 数值变化回调
|
||||
*/
|
||||
onChange?: (value: IParamValue<T>) => any;
|
||||
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 字符长度
|
||||
*/
|
||||
maxLength?: number;
|
||||
|
||||
/**
|
||||
* 数字步长
|
||||
*/
|
||||
numberStep?: number;
|
||||
|
||||
/**
|
||||
* 最大值最小值
|
||||
*/
|
||||
numberMax?: number;
|
||||
numberMin?: number;
|
||||
|
||||
/**
|
||||
* 图标名字
|
||||
*/
|
||||
iconName?: string;
|
||||
}
|
||||
|
||||
interface IBehaviorParameter {
|
||||
[x: string]: IParamType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型列表
|
||||
*/
|
||||
type IBehaviorParameterOption<P extends IBehaviorParameter> = {
|
||||
[X in keyof P]: IBehaviorParameterOptionItem<P[X]>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型列表映射到参数对象
|
||||
*/
|
||||
type IBehaviorParameterValue<P extends IBehaviorParameter> = {
|
||||
[X in keyof P]: IParamValue<P[X]>
|
||||
}
|
||||
import { Emitter, EventType } from "@Model/Emitter";
|
||||
import type { Individual } from "@Model/Individual";
|
||||
import type { Group } from "@Model/Group";
|
||||
import type { Model } from "@Model/Model";
|
||||
import { getDefaultValue, IParameter, IParameterOption, IParameterValue } from "@Model/Parameter";
|
||||
|
||||
/**
|
||||
* 行为构造函数类型
|
||||
*/
|
||||
type IBehaviorConstructor<
|
||||
P extends IBehaviorParameter = {},
|
||||
P extends IParameter = {},
|
||||
E extends Record<EventType, any> = {}
|
||||
> = new (id: string, parameter: IBehaviorParameterValue<P>) => Behavior<P, E>;
|
||||
> = new (id: string, parameter: IParameterValue<P>) => Behavior<P, E>;
|
||||
|
||||
type IAnyBehavior = Behavior<any, any>;
|
||||
type IAnyBehaviorRecorder = BehaviorRecorder<any, any>;
|
||||
@@ -192,7 +72,7 @@ class BehaviorInfo<E extends Record<EventType, any> = {}> extends Emitter<E> {
|
||||
}
|
||||
|
||||
class BehaviorRecorder<
|
||||
P extends IBehaviorParameter = {},
|
||||
P extends IParameter = {},
|
||||
E extends Record<EventType, any> = {}
|
||||
> extends BehaviorInfo<{}> {
|
||||
|
||||
@@ -221,62 +101,13 @@ class BehaviorRecorder<
|
||||
/**
|
||||
* 对象参数列表
|
||||
*/
|
||||
public parameterOption: IBehaviorParameterOption<P>;
|
||||
|
||||
/**
|
||||
* 获取参数列表的默认值
|
||||
*/
|
||||
public getDefaultValue(): IBehaviorParameterValue<P> {
|
||||
let defaultObj = {} as IBehaviorParameterValue<P>;
|
||||
for (let key in this.parameterOption) {
|
||||
let defaultVal = this.parameterOption[key].defaultValue;
|
||||
|
||||
defaultObj[key] = defaultVal as any;
|
||||
if (defaultObj[key] === undefined) {
|
||||
|
||||
switch (this.parameterOption[key].type) {
|
||||
case "string":
|
||||
defaultObj[key] = "" as any;
|
||||
break;
|
||||
|
||||
case "number":
|
||||
defaultObj[key] = 0 as any;
|
||||
break;
|
||||
|
||||
case "boolean":
|
||||
defaultObj[key] = false as any;
|
||||
break;
|
||||
|
||||
case "vec":
|
||||
defaultObj[key] = [0, 0, 0] as any;
|
||||
break;
|
||||
|
||||
case "G":
|
||||
case "R":
|
||||
defaultObj[key] = {
|
||||
picker: undefined,
|
||||
objects: undefined
|
||||
} as any;
|
||||
break;
|
||||
|
||||
case "LR":
|
||||
case "LG":
|
||||
defaultObj[key] = {
|
||||
picker: undefined,
|
||||
objects: []
|
||||
} as any;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultObj;
|
||||
}
|
||||
public parameterOption: IParameterOption<P>;
|
||||
|
||||
/**
|
||||
* 创建一个新的行为实例
|
||||
*/
|
||||
public new(): Behavior<P, E> {
|
||||
return new this.behavior(this.getNextId(), this.getDefaultValue());
|
||||
return new this.behavior(this.getNextId(), getDefaultValue(this.parameterOption));
|
||||
}
|
||||
|
||||
public constructor(behavior: IBehaviorConstructor<P, E>) {
|
||||
@@ -297,7 +128,7 @@ class BehaviorRecorder<
|
||||
* 群体的某种行为
|
||||
*/
|
||||
class Behavior<
|
||||
P extends IBehaviorParameter = {},
|
||||
P extends IParameter = {},
|
||||
E extends Record<EventType, any> = {}
|
||||
> extends BehaviorInfo<E> {
|
||||
|
||||
@@ -325,14 +156,14 @@ class Behavior<
|
||||
/**
|
||||
* 行为参数
|
||||
*/
|
||||
public parameter: IBehaviorParameterValue<P>;
|
||||
public parameter: IParameterValue<P>;
|
||||
|
||||
/**
|
||||
* 对象参数列表
|
||||
*/
|
||||
public parameterOption: IBehaviorParameterOption<P> = {} as any;
|
||||
public parameterOption: IParameterOption<P> = {} as any;
|
||||
|
||||
public constructor(id: string, parameter: IBehaviorParameterValue<P>) {
|
||||
public constructor(id: string, parameter: IParameterValue<P>) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.parameter = parameter;
|
||||
@@ -416,8 +247,6 @@ class Behavior<
|
||||
type IRenderBehavior = BehaviorInfo | Behavior;
|
||||
|
||||
export {
|
||||
Behavior, BehaviorRecorder, IBehaviorParameterOption, IBehaviorParameterOptionItem, IParamValue,
|
||||
IAnyBehavior, IAnyBehaviorRecorder, BehaviorInfo, IRenderBehavior, IBehaviorParameter,
|
||||
isObjectType, isVectorType
|
||||
Behavior, BehaviorRecorder, IAnyBehavior, IAnyBehaviorRecorder, BehaviorInfo, IRenderBehavior
|
||||
};
|
||||
export default { Behavior };
|
||||
@@ -1,6 +1,6 @@
|
||||
import { LabelObject } from "./Label"
|
||||
import type { Model } from "./Model";
|
||||
import type { ObjectID } from "./Renderer";
|
||||
import { LabelObject } from "@Model/Label"
|
||||
import type { Model } from "@Model/Model";
|
||||
import type { ObjectID } from "@Model/Renderer";
|
||||
|
||||
/**
|
||||
* 可控对象
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Individual } from "./Individual";
|
||||
import { CtrlObject } from "./CtrlObject";
|
||||
import type { Behavior } from "./Behavior";
|
||||
import { Label } from "./Label";
|
||||
import { Range } from "./Range";
|
||||
import { Individual } from "@Model/Individual";
|
||||
import { CtrlObject } from "@Model/CtrlObject";
|
||||
import type { Behavior } from "@Model/Behavior";
|
||||
import { Label } from "@Model/Label";
|
||||
import { Range } from "@Model/Range";
|
||||
|
||||
enum GenMod {
|
||||
Point = "p",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Group } from "./Group";
|
||||
import { ObjectID } from "./Renderer";
|
||||
import type { Group } from "@Model/Group";
|
||||
import { ObjectID } from "@Model/Renderer";
|
||||
|
||||
/**
|
||||
* 群中的个体类型
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Model } from "./Model";
|
||||
import { ObjectID } from "./Renderer";
|
||||
import type { Model } from "@Model/Model";
|
||||
import { ObjectID } from "@Model/Renderer";
|
||||
|
||||
/**
|
||||
* 数据标签
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { Individual } from "./Individual";
|
||||
import { Group } from "./Group";
|
||||
import { Range } from "./Range";
|
||||
import { Emitter, EventType, EventMixin } from "./Emitter";
|
||||
import { CtrlObject } from "./CtrlObject";
|
||||
import { ObjectID, AbstractRenderer } from "./Renderer";
|
||||
import { Label } from "./Label";
|
||||
import { Behavior, IAnyBehavior, IAnyBehaviorRecorder, IParamValue } from "./Behavior";
|
||||
import { Label } from "@Model/Label";
|
||||
import { Group } from "@Model/Group";
|
||||
import { Range } from "@Model/Range";
|
||||
import { IParamValue } from "@Model/Parameter";
|
||||
import { Individual } from "@Model/Individual";
|
||||
import { CtrlObject } from "@Model/CtrlObject";
|
||||
import { Emitter, EventType, EventMixin } from "@Model/Emitter";
|
||||
import { ObjectID, AbstractRenderer } from "@Model/Renderer";
|
||||
import { Behavior, IAnyBehavior, IAnyBehaviorRecorder } from "@Model/Behavior";
|
||||
|
||||
type ModelEvent = {
|
||||
labelChange: Label[];
|
||||
|
||||
@@ -0,0 +1,190 @@
|
||||
import type { Group } from "@Model/Group";
|
||||
import type { Range } from "@Model/Range";
|
||||
import type { Label } from "@Model/Label";
|
||||
|
||||
type IObjectParamCacheType<P, Q = P> = {
|
||||
picker: P;
|
||||
objects: Q;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
type IMapBasicParamTypeKeyToType = {
|
||||
"number": number;
|
||||
"string": string;
|
||||
"boolean": boolean;
|
||||
"option": string;
|
||||
}
|
||||
|
||||
type IMapObjectParamTypeKeyToType = {
|
||||
"R": IObjectParamCacheType<Range | undefined>;
|
||||
"G": IObjectParamCacheType<Group | undefined>;
|
||||
"LR": IObjectParamCacheType<Label | Range | undefined, Range[]>;
|
||||
"LG": IObjectParamCacheType<Label | Group | undefined, Group[]>;
|
||||
}
|
||||
|
||||
type IMapVectorParamTypeKeyToType = {
|
||||
"vec": number[];
|
||||
"color": number[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型映射
|
||||
*/
|
||||
type AllMapType = IMapBasicParamTypeKeyToType & IMapObjectParamTypeKeyToType & IMapVectorParamTypeKeyToType;
|
||||
type IParamType = keyof AllMapType;
|
||||
type IObjectType = keyof IMapObjectParamTypeKeyToType;
|
||||
type IVectorType = keyof IMapVectorParamTypeKeyToType;
|
||||
type IParamValue<K extends IParamType> = AllMapType[K];
|
||||
|
||||
/**
|
||||
* 特殊对象类型判定
|
||||
*/
|
||||
const objectTypeListEnumSet = new Set<string>(["R", "G", "LR", "LG"]);
|
||||
|
||||
/**
|
||||
* 对象断言表达式
|
||||
*/
|
||||
function isObjectType(key: string): key is IVectorType {
|
||||
return objectTypeListEnumSet.has(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 向量断言表达式
|
||||
*/
|
||||
function isVectorType(key: string): key is IObjectType {
|
||||
return key === "vec";
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型参数类型
|
||||
*/
|
||||
interface IParameterOptionItem<T extends IParamType = IParamType> {
|
||||
|
||||
/**
|
||||
* 参数类型
|
||||
*/
|
||||
type: T | string;
|
||||
|
||||
/**
|
||||
* 参数默认值
|
||||
*/
|
||||
defaultValue?: IParamValue<T>;
|
||||
|
||||
/**
|
||||
* 数值变化回调
|
||||
*/
|
||||
onChange?: (value: IParamValue<T>) => any;
|
||||
|
||||
/**
|
||||
* 名字
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 字符长度
|
||||
*/
|
||||
maxLength?: number;
|
||||
|
||||
/**
|
||||
* 数字步长
|
||||
*/
|
||||
numberStep?: number;
|
||||
|
||||
/**
|
||||
* 最大值最小值
|
||||
*/
|
||||
numberMax?: number;
|
||||
numberMin?: number;
|
||||
|
||||
/**
|
||||
* 图标名字
|
||||
*/
|
||||
iconName?: string;
|
||||
|
||||
/**
|
||||
* 图标是否显示为红色
|
||||
*/
|
||||
iconRed?: boolean;
|
||||
|
||||
/**
|
||||
* 颜色是否进行归一化
|
||||
*/
|
||||
colorNormal?: boolean;
|
||||
|
||||
/**
|
||||
* 全部选项
|
||||
*/
|
||||
allOption?: Array<{key: string, name: string}>;
|
||||
}
|
||||
|
||||
interface IParameter {
|
||||
[x: string]: IParamType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型列表
|
||||
*/
|
||||
type IParameterOption<P extends IParameter> = {
|
||||
[X in keyof P]: IParameterOptionItem<P[X]>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数类型列表映射到参数对象
|
||||
*/
|
||||
type IParameterValue<P extends IParameter> = {
|
||||
[X in keyof P]: IParamValue<P[X]>
|
||||
}
|
||||
|
||||
function getDefaultValue<P extends IParameter> (option: IParameterOption<P>): IParameterValue<P> {
|
||||
let defaultObj = {} as IParameterValue<P>;
|
||||
for (let key in option) {
|
||||
let defaultVal = option[key].defaultValue;
|
||||
|
||||
if (defaultVal !== undefined) {
|
||||
defaultObj[key] = defaultVal;
|
||||
} else {
|
||||
|
||||
switch (option[key].type) {
|
||||
case "string":
|
||||
defaultObj[key] = "" as any;
|
||||
break;
|
||||
|
||||
case "number":
|
||||
defaultObj[key] = 0 as any;
|
||||
break;
|
||||
|
||||
case "boolean":
|
||||
defaultObj[key] = false as any;
|
||||
break;
|
||||
|
||||
case "vec":
|
||||
defaultObj[key] = [0, 0, 0] as any;
|
||||
break;
|
||||
|
||||
case "G":
|
||||
case "R":
|
||||
defaultObj[key] = {
|
||||
picker: undefined,
|
||||
objects: undefined
|
||||
} as any;
|
||||
break;
|
||||
|
||||
case "LR":
|
||||
case "LG":
|
||||
defaultObj[key] = {
|
||||
picker: undefined,
|
||||
objects: []
|
||||
} as any;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return defaultObj;
|
||||
}
|
||||
|
||||
export {
|
||||
IParamType, IParamValue, isObjectType, isVectorType, getDefaultValue,
|
||||
IParameterOptionItem, IParameter, IParameterOption, IParameterValue
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CtrlObject } from "./CtrlObject";
|
||||
import { CtrlObject } from "@Model/CtrlObject";
|
||||
|
||||
/**
|
||||
* 范围
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Component, ReactNode, createRef } from "react";
|
||||
import { ClassicRenderer } from "@GLRender/ClassicRenderer";
|
||||
import { Entry } from "../Entry/Entry";
|
||||
import { Model } from "@Model/Model";
|
||||
import { Entry } from "../Entry/Entry";
|
||||
import "./Laboratory.scss";
|
||||
|
||||
class Laboratory extends Component {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { SettingProvider, Setting } from "@Context/Setting";
|
||||
import { HeaderBar } from "@Component/HeaderBar/HeaderBar";
|
||||
import { Theme, BackgroundLevel, FontLevel } from "@Component/Theme/Theme";
|
||||
import { Entry } from "../Entry/Entry";
|
||||
import { StatusProvider, Status } from "@Context/Status";
|
||||
import { ClassicRenderer } from "@GLRender/ClassicRenderer";
|
||||
import { initializeIcons } from '@fluentui/font-icons-mdl2';
|
||||
import { RootContainer } from "@Component/Container/RootContainer";
|
||||
import { LayoutDirection } from "@Context/Layout";
|
||||
import { CommandBar } from "@Component/CommandBar/CommandBar";
|
||||
import { Popup } from "@Component/Popup/Popup";
|
||||
import { AllBehaviors } from "@Behavior/Behavior";
|
||||
import { CommandBar } from "@Component/CommandBar/CommandBar";
|
||||
import { HeaderBar } from "@Component/HeaderBar/HeaderBar";
|
||||
import { Popup } from "@Component/Popup/Popup";
|
||||
import { Entry } from "../Entry/Entry";
|
||||
import "./SimulatorWeb.scss";
|
||||
|
||||
initializeIcons("https://img.mrkbear.com/fabric-cdn-prod_20210407.001/");
|
||||
@@ -55,16 +55,16 @@ class SimulatorWeb extends Component {
|
||||
this.status.model.update(0);
|
||||
this.status.newLabel().name = "New Label";
|
||||
this.status.newLabel().name = "Test Label 01";
|
||||
// let template = this.status.model.addBehavior(AllBehaviors[0]);
|
||||
// template.name = "Template"; template.color = [150, 20, 220];
|
||||
let dynamic = this.status.model.addBehavior(AllBehaviors[0]);
|
||||
let template = this.status.model.addBehavior(AllBehaviors[0]);
|
||||
template.name = "Template"; template.color = [150, 20, 220];
|
||||
let dynamic = this.status.model.addBehavior(AllBehaviors[1]);
|
||||
dynamic.name = "Dynamic"; dynamic.color = [250, 200, 80];
|
||||
let brownian = this.status.model.addBehavior(AllBehaviors[1]);
|
||||
let brownian = this.status.model.addBehavior(AllBehaviors[2]);
|
||||
brownian.name = "Brownian"; brownian.color = [200, 80, 250];
|
||||
let boundary = this.status.model.addBehavior(AllBehaviors[2]);
|
||||
let boundary = this.status.model.addBehavior(AllBehaviors[3]);
|
||||
boundary.name = "Boundary"; boundary.color = [80, 200, 250];
|
||||
// boundary.parameter.range.picker = this.status.model.allRangeLabel;
|
||||
// group.addBehavior(template);
|
||||
boundary.parameter.range.picker = this.status.model.allRangeLabel;
|
||||
group.addBehavior(template);
|
||||
group.addBehavior(dynamic);
|
||||
group.addBehavior(brownian);
|
||||
group.addBehavior(boundary);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Component, Fragment, ReactNode} from "react";
|
||||
import { Component, ReactNode} from "react";
|
||||
import { useSettingWithEvent, IMixinSettingProps } from "@Context/Setting";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { Behavior, IBehaviorParameter, isObjectType, isVectorType } from "@Model/Behavior";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { AttrInput } from "@Component/AttrInput/AttrInput";
|
||||
import { ColorInput } from "@Component/ColorInput/ColorInput";
|
||||
import { TogglesInput } from "@Component/TogglesInput/TogglesInput";
|
||||
import { IAnyBehavior } from "@Model/Behavior";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { AttrInput } from "@Input/AttrInput/AttrInput";
|
||||
import { ColorInput } from "@Input/ColorInput/ColorInput";
|
||||
import { TogglesInput } from "@Input/TogglesInput/TogglesInput";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { ObjectPicker } from "@Component/ObjectPicker/ObjectPicker";
|
||||
import { Parameter } from "@Input/Parameter/Parameter";
|
||||
import "./BehaviorDetails.scss";
|
||||
|
||||
interface IBehaviorDetailsProps {}
|
||||
@@ -16,11 +16,24 @@ interface IBehaviorDetailsProps {}
|
||||
@useStatusWithEvent("focusBehaviorChange", "behaviorAttrChange")
|
||||
class BehaviorDetails extends Component<IBehaviorDetailsProps & IMixinStatusProps & IMixinSettingProps> {
|
||||
|
||||
private renderFrom<T extends IBehaviorParameter>
|
||||
(behavior: Behavior<T, Record<string, any>>): ReactNode {
|
||||
|
||||
const allParameterKeys = Object.getOwnPropertyNames(behavior.parameterOption);
|
||||
private handelDeleteBehavior = (behavior: IAnyBehavior) => {
|
||||
if (this.props.status) {
|
||||
const status = this.props.status;
|
||||
status.popup.showPopup(ConfirmPopup, {
|
||||
infoI18n: "Popup.Delete.Behavior.Confirm",
|
||||
titleI18N: "Popup.Action.Objects.Confirm.Title",
|
||||
yesI18n: "Popup.Action.Objects.Confirm.Delete",
|
||||
red: "yes",
|
||||
yes: () => {
|
||||
status.model.deleteBehavior(behavior);
|
||||
status.setBehaviorObject();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
private renderFrom(behavior: IAnyBehavior): ReactNode {
|
||||
|
||||
return <>
|
||||
|
||||
<Message i18nKey="Common.Attr.Title.Basic" isTitle first/>
|
||||
@@ -44,145 +57,29 @@ class BehaviorDetails extends Component<IBehaviorDetailsProps & IMixinStatusProp
|
||||
keyI18n="Common.Attr.Key.Delete" red
|
||||
onIconName="delete" offIconName="delete"
|
||||
valueChange={() => {
|
||||
if (this.props.status) {
|
||||
const status = this.props.status;
|
||||
status.popup.showPopup(ConfirmPopup, {
|
||||
infoI18n: "Popup.Delete.Behavior.Confirm",
|
||||
titleI18N: "Popup.Action.Objects.Confirm.Title",
|
||||
yesI18n: "Popup.Action.Objects.Confirm.Delete",
|
||||
red: "yes",
|
||||
yes: () => {
|
||||
status.model.deleteBehavior(behavior);
|
||||
status.setBehaviorObject();
|
||||
}
|
||||
})
|
||||
}
|
||||
this.handelDeleteBehavior(behavior)
|
||||
}}
|
||||
/>
|
||||
|
||||
{
|
||||
allParameterKeys.length > 0 ?
|
||||
<Message
|
||||
isTitle
|
||||
i18nKey="Panel.Info.Behavior.Details.Behavior.Props"
|
||||
options={{
|
||||
behavior: behavior.getTerms(behavior.behaviorName, this.props.setting?.language)
|
||||
}}
|
||||
/> : null
|
||||
}
|
||||
|
||||
{
|
||||
allParameterKeys.map((key) => {
|
||||
return this.renderParameter(behavior, key);
|
||||
})
|
||||
}
|
||||
<Parameter
|
||||
key={behavior.id}
|
||||
option={behavior.parameterOption}
|
||||
value={behavior.parameter}
|
||||
i18n={(name, language) => behavior.getTerms(name, language)}
|
||||
title={"Panel.Info.Behavior.Details.Behavior.Props"}
|
||||
titleOption={{
|
||||
behavior: behavior.getTerms(behavior.behaviorName, this.props.setting?.language)
|
||||
}}
|
||||
change={(key, value) => {
|
||||
this.props.status?.changeBehaviorAttrib(
|
||||
behavior.id, key as string, value
|
||||
);
|
||||
}}
|
||||
/>
|
||||
|
||||
</>;
|
||||
}
|
||||
|
||||
private renderParameter<T extends IBehaviorParameter>
|
||||
(behavior: Behavior<T, Record<string, any>>, key: keyof T): ReactNode {
|
||||
const type = behavior.parameterOption[key];
|
||||
const value = behavior.parameter[key];
|
||||
const indexKey = `${behavior.id}-${key}`;
|
||||
|
||||
if (type.type === "number") {
|
||||
return <AttrInput
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key"
|
||||
keyI18nOption={{ key: behavior.getTerms(type.name, this.props.setting?.language) }}
|
||||
key={indexKey} id={indexKey} isNumber={true} step={type.numberStep} maxLength={type.maxLength}
|
||||
max={type.numberMax} min={type.numberMin}
|
||||
value={(value as number) ?? 0}
|
||||
valueChange={(val) => {
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, key as string, (val as any) / 1);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
if (type.type === "string") {
|
||||
return <AttrInput
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key"
|
||||
keyI18nOption={{ key: behavior.getTerms(type.name, this.props.setting?.language) }}
|
||||
key={indexKey} id={indexKey} maxLength={type.maxLength}
|
||||
value={(value as string) ?? ""}
|
||||
valueChange={(val) => {
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, key as string, val);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
if (type.type === "boolean") {
|
||||
return <TogglesInput
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key"
|
||||
keyI18nOption={{ key: behavior.getTerms(type.name, this.props.setting?.language) }}
|
||||
onIconName={type.iconName} key={indexKey} value={(value as boolean) ?? false}
|
||||
valueChange={(val) => {
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, key as string, val);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
if (isObjectType(type.type as any)) {
|
||||
return <ObjectPicker
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key"
|
||||
keyI18nOption={{ key: behavior.getTerms(type.name, this.props.setting?.language) }}
|
||||
type={type.type} value={(value as any).picker} key={indexKey}
|
||||
valueChange={(obj) => {
|
||||
(value as any).picker = obj;
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, key as string, value);
|
||||
}}
|
||||
cleanValue={() => {
|
||||
(value as any).picker = undefined;
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, key as string, value);
|
||||
}}
|
||||
/>
|
||||
}
|
||||
|
||||
if (isVectorType(type.type as any)) {
|
||||
return <Fragment key={indexKey}>
|
||||
|
||||
<AttrInput
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key.Vec.X"
|
||||
keyI18nOption={{ key: behavior.getTerms(type.name, this.props.setting?.language) }}
|
||||
key={`${indexKey}-X`} id={indexKey} isNumber={true} step={type.numberStep} maxLength={type.maxLength}
|
||||
max={type.numberMax} min={type.numberMin}
|
||||
value={(value as number[])[0] ?? 0}
|
||||
valueChange={(val) => {
|
||||
(value as number[])[0] = (val as any) / 1;
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, key as string, value);
|
||||
}}
|
||||
/>
|
||||
|
||||
<AttrInput
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key.Vec.Y"
|
||||
keyI18nOption={{ key: behavior.getTerms(type.name, this.props.setting?.language) }}
|
||||
key={`${indexKey}-Y`} id={indexKey} isNumber={true} step={type.numberStep} maxLength={type.maxLength}
|
||||
max={type.numberMax} min={type.numberMin}
|
||||
value={(value as number[])[1] ?? 0}
|
||||
valueChange={(val) => {
|
||||
(value as number[])[1] = (val as any) / 1;
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, key as string, value);
|
||||
}}
|
||||
/>
|
||||
|
||||
<AttrInput
|
||||
keyI18n="Panel.Info.Behavior.Details.Parameter.Key.Vec.Z"
|
||||
keyI18nOption={{ key: behavior.getTerms(type.name, this.props.setting?.language) }}
|
||||
key={`${indexKey}-Z`} id={indexKey} isNumber={true} step={type.numberStep} maxLength={type.maxLength}
|
||||
max={type.numberMax} min={type.numberMin}
|
||||
value={(value as number[])[2] ?? 0}
|
||||
valueChange={(val) => {
|
||||
(value as number[])[2] = (val as any) / 1;
|
||||
this.props.status?.changeBehaviorAttrib(behavior.id, key as string, value);
|
||||
}}
|
||||
/>
|
||||
|
||||
</Fragment>
|
||||
}
|
||||
|
||||
return <Fragment key={indexKey}/>
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
if (this.props.status && this.props.status.focusBehavior) {
|
||||
return this.renderFrom(this.props.status.focusBehavior);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { BehaviorList as BehaviorListComponent } from "@Component/BehaviorList/BehaviorList";
|
||||
import { Component } from "react";
|
||||
import { BehaviorList as BehaviorListComponent } from "@Component/BehaviorList/BehaviorList";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { useSetting, IMixinSettingProps } from "@Context/Setting";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { BehaviorPopup } from "@Component/BehaviorPopup/BehaviorPopup";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import "./BehaviorList.scss";
|
||||
|
||||
interface IBehaviorListProps {
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { AttrInput } from "@Component/AttrInput/AttrInput";
|
||||
import { AttrInput } from "@Input/AttrInput/AttrInput";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { useSetting, IMixinSettingProps } from "@Context/Setting";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { ComboInput, IDisplayItem } from "@Input/ComboInput/ComboInput";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { ObjectID } from "@Model/Renderer";
|
||||
import { ColorInput } from "@Component/ColorInput/ColorInput";
|
||||
import { TogglesInput } from "@Component/TogglesInput/TogglesInput";
|
||||
import { LabelPicker } from "@Component/LabelPicker/LabelPicker";
|
||||
import { ColorInput } from "@Input/ColorInput/ColorInput";
|
||||
import { TogglesInput } from "@Input/TogglesInput/TogglesInput";
|
||||
import { LabelPicker } from "@Input/LabelPicker/LabelPicker";
|
||||
import { Group, GenMod } from "@Model/Group";
|
||||
import { AllI18nKeys } from "@Component/Localization/Localization";
|
||||
import { ComboInput, IDisplayItem } from "@Component/ComboInput/ComboInput";
|
||||
import { ObjectPicker } from "@Component/ObjectPicker/ObjectPicker";
|
||||
import { ObjectPicker } from "@Input/ObjectPicker/ObjectPicker";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { BehaviorPicker } from "@Component/BehaviorPicker/BehaviorPicker";
|
||||
import { BehaviorPicker } from "@Input/BehaviorPicker/BehaviorPicker";
|
||||
import "./GroupDetails.scss";
|
||||
|
||||
interface IGroupDetailsProps {}
|
||||
@@ -22,8 +22,8 @@ mapGenModToI18nKey.set(GenMod.Point, "Common.Attr.Key.Generation.Mod.Point");
|
||||
mapGenModToI18nKey.set(GenMod.Range, "Common.Attr.Key.Generation.Mod.Range");
|
||||
|
||||
const allOption: IDisplayItem[] = [
|
||||
{nameKey: "Common.Attr.Key.Generation.Mod.Point", key: GenMod.Point},
|
||||
{nameKey: "Common.Attr.Key.Generation.Mod.Range", key: GenMod.Range}
|
||||
{i18n: "Common.Attr.Key.Generation.Mod.Point", key: GenMod.Point},
|
||||
{i18n: "Common.Attr.Key.Generation.Mod.Range", key: GenMod.Range}
|
||||
];
|
||||
|
||||
@useSetting
|
||||
@@ -144,7 +144,7 @@ class GroupDetails extends Component<IGroupDetailsProps & IMixinStatusProps & IM
|
||||
<ComboInput
|
||||
keyI18n="Common.Attr.Key.Generation.Mod"
|
||||
value={{
|
||||
nameKey: mapGenModToI18nKey.get(group.genMethod) ?? "Common.No.Data",
|
||||
i18n: mapGenModToI18nKey.get(group.genMethod) ?? "Common.No.Data",
|
||||
key: group.genMethod
|
||||
}}
|
||||
allOption={allOption}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { AttrInput } from "@Component/AttrInput/AttrInput";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { ColorInput } from "@Component/ColorInput/ColorInput";
|
||||
import { Label } from "@Model/Label";
|
||||
import { TogglesInput } from "@Component/TogglesInput/TogglesInput";
|
||||
import { TogglesInput } from "@Input/TogglesInput/TogglesInput";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { ColorInput } from "@Input/ColorInput/ColorInput";
|
||||
import { AttrInput } from "@Input/AttrInput/AttrInput";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { Label } from "@Model/Label";
|
||||
import "./LabelDetails.scss";
|
||||
|
||||
@useStatusWithEvent("focusLabelChange", "labelAttrChange", "labelChange")
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { LabelList as LabelListComponent } from "@Component/LabelList/LabelList";
|
||||
import { Component } from "react";
|
||||
import { LabelList as LabelListComponent } from "@Component/LabelList/LabelList";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { useSetting, IMixinSettingProps } from "@Context/Setting";
|
||||
import { Label } from "@Model/Label";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { Label } from "@Model/Label";
|
||||
import "./LabelList.scss";
|
||||
|
||||
interface ILabelListProps {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { BackgroundLevel, FontLevel, Theme } from "@Component/Theme/Theme";
|
||||
import { useStatus, IMixinStatusProps } from "../../Context/Status";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import { Component, ReactNode } from "react";
|
||||
import { BackgroundLevel, FontLevel, Theme } from "@Component/Theme/Theme";
|
||||
import { useStatus, IMixinStatusProps } from "@Context/Status";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import { ObjectID } from "@Model/Renderer";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import "./ObjectList.scss";
|
||||
|
||||
@useStatus
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { DetailsList } from "@Component/DetailsList/DetailsList";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { useSetting, IMixinSettingProps } from "@Context/Setting";
|
||||
import { Localization } from "@Component/Localization/Localization";
|
||||
import { DetailsList } from "@Component/DetailsList/DetailsList";
|
||||
import { ObjectID } from "@Model/Renderer";
|
||||
import { Icon } from "@fluentui/react";
|
||||
import "./ObjectList.scss";
|
||||
|
||||
+10
-10
@@ -1,15 +1,15 @@
|
||||
import { ReactNode, Component, FunctionComponent } from "react";
|
||||
import { Theme } from "@Component/Theme/Theme";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { RenderView } from "./RenderView/RenderView";
|
||||
import { ObjectList } from "./ObjectList/ObjectList";
|
||||
import { ObjectCommand } from "./ObjectList/ObjectCommand";
|
||||
import { RangeDetails } from "./RangeDetails/RangeDetails";
|
||||
import { LabelList } from "./LabelList/LabelList";
|
||||
import { LabelDetails } from "./LabelDetails/LabelDetails";
|
||||
import { GroupDetails } from "./GroupDetails/GroupDetails";
|
||||
import { BehaviorList } from "./BehaviorList/BehaviorList";
|
||||
import { BehaviorDetails } from "./BehaviorDetails/BehaviorDetails";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { RenderView } from "@Panel/RenderView/RenderView";
|
||||
import { ObjectList } from "@Panel/ObjectList/ObjectList";
|
||||
import { ObjectCommand } from "@Panel/ObjectList/ObjectCommand";
|
||||
import { RangeDetails } from "@Panel/RangeDetails/RangeDetails";
|
||||
import { LabelList } from "@Panel/LabelList/LabelList";
|
||||
import { LabelDetails } from "@Panel/LabelDetails/LabelDetails";
|
||||
import { GroupDetails } from "@Panel/GroupDetails/GroupDetails";
|
||||
import { BehaviorList } from "@Panel/BehaviorList/BehaviorList";
|
||||
import { BehaviorDetails } from "@Panel/BehaviorDetails/BehaviorDetails";
|
||||
|
||||
interface IPanelInfo {
|
||||
nameKey: string;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Component, ReactNode } from "react";
|
||||
import { AttrInput } from "@Component/AttrInput/AttrInput";
|
||||
import { useStatusWithEvent, IMixinStatusProps, Status } from "@Context/Status";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { AttrInput } from "@Input/AttrInput/AttrInput";
|
||||
import { Message } from "@Input/Message/Message";
|
||||
import { Range } from "@Model/Range";
|
||||
import { ObjectID } from "@Model/Renderer";
|
||||
import { ColorInput } from "@Component/ColorInput/ColorInput";
|
||||
import { TogglesInput } from "@Component/TogglesInput/TogglesInput";
|
||||
import { LabelPicker } from "@Component/LabelPicker/LabelPicker";
|
||||
import { ColorInput } from "@Input/ColorInput/ColorInput";
|
||||
import { TogglesInput } from "@Input/TogglesInput/TogglesInput";
|
||||
import { LabelPicker } from "@Input/LabelPicker/LabelPicker";
|
||||
import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup";
|
||||
import "./RangeDetails.scss";
|
||||
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
"@Component/*": [
|
||||
"./source/Component/*"
|
||||
],
|
||||
"@Input/*": [
|
||||
"./source/Input/*"
|
||||
],
|
||||
"@Localization/*": [
|
||||
"./source/Localization/*"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user