12345678910111213141516171819202122232425262728293031 |
- import { ModuleControl } from "queenjs";
- import { EditorModule } from "../../module";
- import { RxValue } from "../ReactCtrl/rxValue";
- import { history } from "../../objects/DesignTemp/factory";
- export class PropsCtrl extends ModuleControl<EditorModule> {
- state = RxValue.create({
- propId: "",
- isMultiSel: false,
- }, history);
- getCurrComp() {
- return this.controls.pageCtrl.compMap[this.state.propId];
- }
-
- initEvents() {
- const gizmo = this.controls.selectCtrl.gizmo;
- gizmo.state.onTransformChanged((t)=>{
- this.state.isMultiSel = t.selected.length > 1;
- })
- gizmo.state.onLastIdChanged((id)=>{
- this.state.propId = id;
- })
- }
- showProp(id:string) {
- this.state.setPropId(id);
- this.state.setIsMultiSel(false);
- }
- }
|