mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
80 lines
1.3 KiB
Vue
80 lines
1.3 KiB
Vue
|
<template>
|
||
|
<div class="node-item clickable" :class="{active: active}" @click="nodeTypeSelected(nodeType)">
|
||
|
<NodeIcon class="node-icon" :nodeType="nodeType"/>
|
||
|
<div class="name">
|
||
|
{{nodeType.displayName}}
|
||
|
</div>
|
||
|
<div class="description">
|
||
|
{{nodeType.description}}
|
||
|
</div>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
|
||
|
import Vue from 'vue';
|
||
|
import { INodeTypeDescription } from 'n8n-workflow';
|
||
|
|
||
|
import NodeIcon from '@/components/NodeIcon.vue';
|
||
|
|
||
|
export default Vue.extend({
|
||
|
name: 'NodeCreateItem',
|
||
|
components: {
|
||
|
NodeIcon,
|
||
|
},
|
||
|
props: [
|
||
|
'active',
|
||
|
'filter',
|
||
|
'nodeType',
|
||
|
],
|
||
|
data () {
|
||
|
return {
|
||
|
};
|
||
|
},
|
||
|
methods: {
|
||
|
nodeTypeSelected (nodeType: INodeTypeDescription) {
|
||
|
this.$emit('nodeTypeSelected', nodeType.name);
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
</script>
|
||
|
|
||
|
<style scoped lang="scss">
|
||
|
|
||
|
.node-item {
|
||
|
position: relative;
|
||
|
border-bottom: 1px solid #eee;
|
||
|
background-color: #fff;
|
||
|
padding: 6px;
|
||
|
border-left: 3px solid #fff;
|
||
|
|
||
|
&:hover {
|
||
|
border-left: 3px solid #ccc;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.active {
|
||
|
border-left: 3px solid $--color-primary;
|
||
|
}
|
||
|
|
||
|
.node-icon {
|
||
|
display: inline-block;
|
||
|
position: absolute;
|
||
|
left: 12px;
|
||
|
top: calc(50% - 15px);
|
||
|
}
|
||
|
|
||
|
.name {
|
||
|
font-weight: bold;
|
||
|
font-size: 0.9em;
|
||
|
padding-left: 50px;
|
||
|
}
|
||
|
|
||
|
.description {
|
||
|
margin-top: 3px;
|
||
|
line-height: 1.7em;
|
||
|
font-size: 0.8em;
|
||
|
padding-left: 50px;
|
||
|
}
|
||
|
</style>
|