2019-06-23 03:35:23 -07:00
|
|
|
<template>
|
2021-08-29 04:36:17 -07:00
|
|
|
<el-row class="parameter-wrapper" :class="{'multi-line': isMultiLineParameter}">
|
2019-06-23 03:35:23 -07:00
|
|
|
<el-col :span="isMultiLineParameter ? 24 : 10" class="parameter-name" :class="{'multi-line': isMultiLineParameter}">
|
|
|
|
<span class="title" :title="parameter.displayName">{{parameter.displayName}}</span>:
|
2021-08-29 04:36:17 -07:00
|
|
|
<n8n-tooltip class="parameter-info" placement="top" v-if="parameter.description" >
|
|
|
|
<div slot="content" v-html="parameter.description"></div>
|
2019-06-23 03:35:23 -07:00
|
|
|
<font-awesome-icon icon="question-circle" />
|
2021-08-29 04:36:17 -07:00
|
|
|
</n8n-tooltip>
|
2019-06-23 03:35:23 -07:00
|
|
|
</el-col>
|
|
|
|
<el-col :span="isMultiLineParameter ? 24 : 14" class="parameter-value">
|
2021-08-29 04:36:17 -07:00
|
|
|
<parameter-input :parameter="parameter" :value="value" :displayOptions="displayOptions" :path="path" @valueChanged="valueChanged" inputSize="small" />
|
2019-06-23 03:35:23 -07:00
|
|
|
</el-col>
|
|
|
|
</el-row>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
|
|
|
|
|
|
|
import {
|
|
|
|
IUpdateInformation,
|
|
|
|
} from '@/Interface';
|
|
|
|
|
|
|
|
import ParameterInput from '@/components/ParameterInput.vue';
|
2021-08-26 10:42:38 -07:00
|
|
|
import { addTargetBlank } from './helpers';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
|
|
|
export default Vue
|
|
|
|
.extend({
|
|
|
|
name: 'ParameterInputFull',
|
|
|
|
components: {
|
|
|
|
ParameterInput,
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
isMultiLineParameter () {
|
2020-01-23 16:05:27 -08:00
|
|
|
if (this.level > 4) {
|
|
|
|
return true;
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
const rows = this.getArgument('rows');
|
|
|
|
if (rows !== undefined && rows > 1) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
},
|
2020-01-23 16:05:27 -08:00
|
|
|
level (): number {
|
|
|
|
return this.path.split('.').length;
|
|
|
|
},
|
2019-06-23 03:35:23 -07:00
|
|
|
},
|
|
|
|
props: [
|
|
|
|
'displayOptions',
|
|
|
|
'parameter',
|
|
|
|
'path',
|
|
|
|
'value',
|
|
|
|
],
|
|
|
|
methods: {
|
2021-08-26 10:42:38 -07:00
|
|
|
addTargetBlank,
|
2019-06-23 03:35:23 -07:00
|
|
|
getArgument (argumentName: string): string | number | boolean | undefined {
|
|
|
|
if (this.parameter.typeOptions === undefined) {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.parameter.typeOptions[argumentName] === undefined) {
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.parameter.typeOptions[argumentName];
|
|
|
|
},
|
|
|
|
valueChanged (parameterData: IUpdateInformation) {
|
|
|
|
this.$emit('valueChanged', parameterData);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
.parameter-wrapper {
|
2021-08-29 04:36:17 -07:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
&.multi-line {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
2019-06-23 03:35:23 -07:00
|
|
|
|
|
|
|
.option {
|
|
|
|
margin: 1em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.parameter-info {
|
2019-09-19 14:59:25 -07:00
|
|
|
background-color: #ffffffaa;
|
2019-06-23 03:35:23 -07:00
|
|
|
display: none;
|
2019-09-19 14:59:25 -07:00
|
|
|
position: absolute;
|
2021-08-29 04:36:17 -07:00
|
|
|
right: 2px;
|
|
|
|
top: 1px;
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.parameter-name {
|
2019-09-19 14:59:25 -07:00
|
|
|
position: relative;
|
|
|
|
|
2019-06-23 03:35:23 -07:00
|
|
|
&:hover {
|
|
|
|
.parameter-info {
|
|
|
|
display: inline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.multi-line {
|
|
|
|
line-height: 1.5em;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
|
|
|
font-weight: 400;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|