Mentions légales du service

Skip to content
Snippets Groups Projects

Resolve "add statements to all questions type & put them in html mode"

6 files
+ 136
63
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -43,26 +43,20 @@ const inputId = computed(() => {
@@ -43,26 +43,20 @@ const inputId = computed(() => {
//? This is a workaround to focus the WYSIWYG editor when clicking on the label
//? This is a workaround to focus the WYSIWYG editor when clicking on the label
const htmlInput = ref(null);
const htmlInput = ref(null);
function onLabelClick(inputType: string) {
function onLabelClick(inputType: string) {
if(inputType !== 'html') return;
if (inputType !== 'html') return;
htmlInput.value.focusEditor();
htmlInput.value.focusEditor();
}
}
function showLabel(inputType: string) {
function showLabel(inputType: string) {
return inputType !== 'checkbox' && inputType !== 'repeat'
return inputType !== 'checkbox' && inputType !== 'repeat';
}
}
</script>
</script>
<template>
<template>
<div class="input-group">
<div class="input-group">
<div
<div v-if="input.label && showLabel(input.type)" class="input-label">
v-if="input.label && showLabel(input.type)"
<label :for="inputId" @click="onLabelClick(input.type)">
class="input-label"
>
<label
:for="inputId"
@click="onLabelClick(input.type)"
>
{{ input.label }}
{{ input.label }}
</label>
</label>
<i
<i
@@ -90,14 +84,14 @@ function showLabel(inputType: string) {
@@ -90,14 +84,14 @@ function showLabel(inputType: string) {
@save-given-state="emit('saveGivenState', $event)"
@save-given-state="emit('saveGivenState', $event)"
/>
/>
<HtmlInput
<HtmlInput
v-if="input.type === 'html' || input.type === 'html-text'"
v-if="input.type === 'html' || input.type === 'html-text' || input.type === 'html-inline'"
:id="inputId"
:id="inputId"
ref="htmlInput"
ref="htmlInput"
:label="input.label"
:label="input.label"
:placeholder="input.placeholder"
:placeholder="input.placeholder"
:input-value="inputValue as string"
:input-value="inputValue as string"
:inside-card="insideCard"
:inside-card="insideCard"
:text-only="input.type === 'html-text'"
:type="input.type"
@input="emit('input', $event)"
@input="emit('input', $event)"
@save-given-state="emit('saveGivenState', $event)"
@save-given-state="emit('saveGivenState', $event)"
/>
/>
@@ -181,10 +175,9 @@ function showLabel(inputType: string) {
@@ -181,10 +175,9 @@ function showLabel(inputType: string) {
</div>
</div>
</template>
</template>
<style lang="scss" scoped >
<style lang="scss" scoped>
.input-group {
.input-group {
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
}
}
</style>
</style>
\ No newline at end of file
Loading