diff --git a/packages/editor-ui/src/components/NodeCreator/CreatorItem.vue b/packages/editor-ui/src/components/NodeCreator/CreatorItem.vue index a024c2ec4d552..9c8597cbd69ec 100644 --- a/packages/editor-ui/src/components/NodeCreator/CreatorItem.vue +++ b/packages/editor-ui/src/components/NodeCreator/CreatorItem.vue @@ -5,8 +5,8 @@ clickable: props.clickable, active: props.active, }" - @click="listeners['click']" - > + @click="listeners.click" + > + @dragstart="listeners.dragstart" + @dragend="listeners.dragend" + /> @@ -54,4 +56,4 @@ export default { } } - \ No newline at end of file + diff --git a/packages/editor-ui/src/components/NodeCreator/ItemIterator.vue b/packages/editor-ui/src/components/NodeCreator/ItemIterator.vue index 39d0437d44405..e07b5fed687ec 100644 --- a/packages/editor-ui/src/components/NodeCreator/ItemIterator.vue +++ b/packages/editor-ui/src/components/NodeCreator/ItemIterator.vue @@ -8,7 +8,12 @@ @before-leave="beforeLeave" @leave="leave" > -
+
@@ -36,12 +43,12 @@ export default Vue.extend({ }, props: ['elements', 'activeIndex', 'disabled', 'transitionsEnabled'], methods: { - selected(element: INodeCreateElement) { + emit(eventName: string, element: INodeCreateElement, event: Event) { if (this.$props.disabled) { return; } - this.$emit('selected', element); + this.$emit(eventName, { element, event }); }, beforeEnter(el: HTMLElement) { el.style.height = '0'; diff --git a/packages/editor-ui/src/components/NodeCreator/MainPanel.vue b/packages/editor-ui/src/components/NodeCreator/MainPanel.vue index dbff0d758471c..1f03e81b4c36b 100644 --- a/packages/editor-ui/src/components/NodeCreator/MainPanel.vue +++ b/packages/editor-ui/src/components/NodeCreator/MainPanel.vue @@ -1,7 +1,18 @@ @@ -56,7 +70,6 @@ import { ALL_NODE_FILTER, CORE_NODES_CATEGORY, REGULAR_NODE_FILTER, TRIGGER_NODE import SlideTransition from '../transitions/SlideTransition.vue'; import { matchesNodeType, matchesSelectType } from './helpers'; - export default mixins(externalHooks).extend({ name: 'NodeCreateList', components: { @@ -235,18 +248,13 @@ export default mixins(externalHooks).extend({ }, selected(element: INodeCreateElement) { if (element.type === 'node') { - const properties = element.properties as INodeItemProps; - - this.nodeTypeSelected(properties.nodeType.name); + this.$emit('nodeTypeSelected', (element.properties as INodeItemProps).nodeType.name); } else if (element.type === 'category') { this.onCategorySelected(element.category); } else if (element.type === 'subcategory') { this.onSubcategorySelected(element); } }, - nodeTypeSelected(nodeTypeName: string) { - this.$emit('nodeTypeSelected', nodeTypeName); - }, onCategorySelected(category: string) { if (this.activeCategory.includes(category)) { this.activeCategory = this.activeCategory.filter( diff --git a/packages/editor-ui/src/components/NodeCreator/NodeCreator.vue b/packages/editor-ui/src/components/NodeCreator/NodeCreator.vue index 9ba458709fff9..b9bb4176374fe 100644 --- a/packages/editor-ui/src/components/NodeCreator/NodeCreator.vue +++ b/packages/editor-ui/src/components/NodeCreator/NodeCreator.vue @@ -1,8 +1,20 @@