From be638eb7ed8d56f30f57ffc39802422e099f6362 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Sun, 13 Mar 2022 23:45:28 -0300 Subject: [PATCH] Change to typescript --- packages/mindplot/src/components/Topic.ts | 9 +++++---- packages/mindplot/src/components/TopicFeature.js | 8 -------- .../src/components/layout/ChildrenSorterStrategy.ts | 4 ++-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/packages/mindplot/src/components/Topic.ts b/packages/mindplot/src/components/Topic.ts index f646ce1d..ce92d7b1 100644 --- a/packages/mindplot/src/components/Topic.ts +++ b/packages/mindplot/src/components/Topic.ts @@ -707,10 +707,11 @@ abstract class Topic extends NodeGraph { // Do some fancy animation .... const elements = this._flatten2DElements(this); elements.forEach((elem) => { - elem.setVisibility(!value, 250); + elem.setVisibility(!value, 250) }); EventBus.instance.fireEvent('childShrinked', model); + } getShrinkConnector(): ShirinkConnector | undefined { @@ -902,6 +903,7 @@ abstract class Topic extends NodeGraph { current.setVisibility(value); } + /** */ setVisibility(value: boolean, fade = 0): void { this._setTopicVisibility(value, fade); @@ -958,9 +960,8 @@ abstract class Topic extends NodeGraph { relationship.setVisibility( value && (targetParent == null || !targetParent.areChildrenShrunken()) - && (sourceParent == null || !sourceParent.areChildrenShrunken()), - fade, - ); + && (sourceParent == null || !sourceParent.areChildrenShrunken()) + , fade); }); } diff --git a/packages/mindplot/src/components/TopicFeature.js b/packages/mindplot/src/components/TopicFeature.js index cf63f48b..96c3e3a6 100644 --- a/packages/mindplot/src/components/TopicFeature.js +++ b/packages/mindplot/src/components/TopicFeature.js @@ -40,14 +40,6 @@ const TopicFeatureFactory = { icon: NoteIcon, }, - /** - * @param {mindplot.Topic} topic - * @param {mindplot.model.FeatureModel} model - * @param {Boolean} readOnly true if the editor is running in read-only mode - * @throws will throw an error if topic is null or undefined - * @throws will throw v an error if model is null or undefined - * @return {mindplot.n,nmn mn4 r be5qnwwddwsz5on} a new instance of the icon subclass matching the topic feature - */ createIcon(topic, model, readOnly) { $assert(topic, 'topic can not be null'); $assert(model, 'model can not be null'); diff --git a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts index fbf2cb25..34419adb 100644 --- a/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts +++ b/packages/mindplot/src/components/layout/ChildrenSorterStrategy.ts @@ -15,9 +15,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import RootedTreeSet from './RootedTreeSet'; +import RootedTreeSet from "./RootedTreeSet"; import Node from './Node'; -import PositionType from '../PositionType'; +import PositionType from "../PositionType"; abstract class ChildrenSorterStrategy { abstract computeChildrenIdByHeights(treeSet: RootedTreeSet, node: Node);