Line data Source code
1 : // @ts-check 2 : 3 : import { get } from "lodash"; 4 : import Vue from "vue"; 5 : import { mapState } from "vuex"; 6 : import TimeLine from "./Control/TimeLine.vue"; 7 : import { getAttribute } from "../utils/element"; 8 : import InfoAlert from "./InfoAlert.vue"; 9 : 10 : export default /** @type {V.Constructor<any, any>} */ (Vue).extend({ 11 : name: "SSVGControl", 12 : components: { TimeLine, InfoAlert }, 13 3 : data() { return { showInfo: false }; }, 14 : /** 15 : * @type {{ 16 : * property(): Element|null, relation(): Element|null, state(): any, 17 : * propertyName(): string, value(): any 18 : * }} 19 : */ 20 : computed: { 21 : ...mapState("selection", [ "property", "relation" ]), 22 0 : ...mapState("engine", { state: (/** @type {AppStore.SSVGEngine} */state) => get(state, [ "state" ]) }), 23 : /** 24 : * @returns {string} 25 : */ 26 : propertyName() { 27 0 : return getAttribute(this.property, "name"); 28 : }, 29 : value() { 30 0 : return get(this.state, this.propertyName); 31 : } 32 : } 33 : });