Merge
Bumps [sass-loader](https://github.com/webpack-contrib/sass-loader) from 9.0.1 to 9.0.2. - [Release notes](https://github.com/webpack-contrib/sass-loader/releases) - [Changelog](https://github.com/webpack-contrib/sass-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/webpack-contrib/sass-loader/compare/v9.0.1...v9.0.2) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Bump @nextcloud/vue from 2.2.0 to 2.2.1 Bumps [@nextcloud/vue](https://github.com/nextcloud/nextcloud-vue) from 2.2.0 to 2.2.1. - [Release notes](https://github.com/nextcloud/nextcloud-vue/releases) - [Commits](https://github.com/nextcloud/nextcloud-vue/compare/v2.2.0...v2.2.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Bump vuedraggable from 2.23.2 to 2.24.0 Bumps [vuedraggable](https://github.com/SortableJS/Vue.Draggable) from 2.23.2 to 2.24.0. - [Release notes](https://github.com/SortableJS/Vue.Draggable/releases) - [Commits](https://github.com/SortableJS/Vue.Draggable/compare/v2.23.2...v2.24.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Bump @nextcloud/axios from 1.3.2 to 1.3.3 Bumps [@nextcloud/axios](https://github.com/nextcloud/nextcloud-axios) from 1.3.2 to 1.3.3. - [Release notes](https://github.com/nextcloud/nextcloud-axios/releases) - [Changelog](https://github.com/nextcloud/nextcloud-axios/blob/master/CHANGELOG.md) - [Commits](https://github.com/nextcloud/nextcloud-axios/compare/v1.3.2...v1.3.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> [tx-robot] updated from transifex Move to webpack vue global config & clean routes Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Lint fix Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> @nextcloud/webpack-vue-config@1.0.3 Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> [tx-robot] updated from transifex [tx-robot] updated from transifex Bump @nextcloud/webpack-vue-config from 1.0.3 to 1.1.0 Bumps [@nextcloud/webpack-vue-config](https://github.com/nextcloud/webpack-vue-config) from 1.0.3 to 1.1.0. - [Release notes](https://github.com/nextcloud/webpack-vue-config/releases) - [Commits](https://github.com/nextcloud/webpack-vue-config/compare/v1.0.3...v1.1.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Bump @babel/core from 7.10.4 to 7.10.5 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.10.4 to 7.10.5. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.10.5/packages/babel-core) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> [tx-robot] updated from transifex Add screenshot of response visualization, adjust readme Signed-off-by: Jan C. Borchardt <hey@jancborchardt.net> [tx-robot] updated from transifex [tx-robot] updated from transifex Revert "Allow navigation through edit via Tab-Key" v2.0.0-rc.1 Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> [tx-robot] updated from transifex Bump webpack from 4.43.0 to 4.44.0 Bumps [webpack](https://github.com/webpack/webpack) from 4.43.0 to 4.44.0. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v4.43.0...v4.44.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> [tx-robot] updated from transifex Update stylelint config Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> Fix actions Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com> [tx-robot] updated from transifex Fix dropdown submission insert Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> 2.0.0 Force enable for master Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> [tx-robot] updated from transifex Fix substring utf8 Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com> 2.0.1 [Security] Bump elliptic from 6.5.0 to 6.5.3 Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.0 to 6.5.3. **This update includes a security fix.** - [Release notes](https://github.com/indutny/elliptic/releases) - [Commits](https://github.com/indutny/elliptic/compare/v6.5.0...v6.5.3) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> [tx-robot] updated from transifex Increase description length Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com> 2.0.2 Bump webpack from 4.44.0 to 4.44.1 Bumps [webpack](https://github.com/webpack/webpack) from 4.44.0 to 4.44.1. - [Release notes](https://github.com/webpack/webpack/releases) - [Commits](https://github.com/webpack/webpack/compare/v4.44.0...v4.44.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Bump @babel/core from 7.10.5 to 7.11.0 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.10.5 to 7.11.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.11.0/packages/babel-core) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Bump @babel/preset-env from 7.10.4 to 7.11.0 Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.10.4 to 7.11.0. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.11.0/packages/babel-preset-env) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> [tx-robot] updated from transifex [tx-robot] updated from transifex
This commit is contained in:
parent
e3002ea31f
commit
e2959be243
68 changed files with 1490 additions and 1280 deletions
|
|
@ -25,9 +25,7 @@
|
|||
:class="{ 'question--edit': edit }"
|
||||
:aria-label="t('forms', 'Question number {index}', {index})"
|
||||
class="question"
|
||||
@click="enableEdit"
|
||||
@focusin="onFocusIn"
|
||||
@focusout="onFocusOut">
|
||||
@click="enableEdit">
|
||||
<!-- Drag handle -->
|
||||
<!-- TODO: implement arrow key mapping to reorder question -->
|
||||
<div v-if="!readOnly"
|
||||
|
|
@ -38,7 +36,6 @@
|
|||
<!-- Header -->
|
||||
<div class="question__header">
|
||||
<input v-if="edit || !text"
|
||||
ref="titleInput"
|
||||
:placeholder="titlePlaceholder"
|
||||
:aria-label="t('forms', 'Title of question number {index}', {index})"
|
||||
:value="text"
|
||||
|
|
@ -48,11 +45,7 @@
|
|||
:maxlength="maxQuestionLength"
|
||||
required
|
||||
@input="onTitleChange">
|
||||
<h3 v-else
|
||||
class="question__header-title"
|
||||
:tabindex="computedTitleTabIndex"
|
||||
@focus="onTitleFocus"
|
||||
v-text="computedText" />
|
||||
<h3 v-else class="question__header-title" v-text="computedText" />
|
||||
<div v-if="!edit && !questionValid"
|
||||
v-tooltip.auto="warningInvalid"
|
||||
class="question__header-warning icon-error-color"
|
||||
|
|
@ -154,17 +147,6 @@ export default {
|
|||
questionValid() {
|
||||
return this.text && this.contentValid
|
||||
},
|
||||
|
||||
/**
|
||||
* Only allow tabbing the title when necessary for edit.
|
||||
* @returns {Number}
|
||||
*/
|
||||
computedTitleTabIndex() {
|
||||
if (!this.readOnly) {
|
||||
return 0
|
||||
}
|
||||
return -1
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
@ -176,34 +158,6 @@ export default {
|
|||
this.$emit('update:mandatory', mandatory)
|
||||
},
|
||||
|
||||
/**
|
||||
* Allow edit-navigation through Tab-Key
|
||||
*/
|
||||
onTitleFocus() {
|
||||
if (!this.readOnly) {
|
||||
this.enableEdit()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.titleInput.focus()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable & disable resp. edit, if focus jumps to next question (e.g. by tab-navigation)
|
||||
* @param {Object} event The triggered focusIn/focusOut event
|
||||
*/
|
||||
onFocusIn(event) {
|
||||
if (event.target.closest('.question') !== event.relatedTarget?.closest('.question')) {
|
||||
this.enableEdit()
|
||||
}
|
||||
},
|
||||
|
||||
onFocusOut(event) {
|
||||
if (event.target.closest('.question') !== event.relatedTarget?.closest('.question')) {
|
||||
this.disableEdit()
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Enable the edit mode
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,13 +40,15 @@
|
|||
:name="text"
|
||||
:multiple="isMultiple"
|
||||
:required="mandatory"
|
||||
class="question__content">
|
||||
class="question__content"
|
||||
@change="onChange">
|
||||
<option value="">
|
||||
{{ selectOptionPlaceholder }}
|
||||
</option>
|
||||
<option v-for="answer in options"
|
||||
:key="answer.id"
|
||||
:value="answer.id">
|
||||
:value="answer.id"
|
||||
:selected="isChecked(answer.id)">
|
||||
{{ answer.text }}
|
||||
</option>
|
||||
</select>
|
||||
|
|
@ -152,25 +154,20 @@ export default {
|
|||
},
|
||||
|
||||
methods: {
|
||||
onChange(event, answerId) {
|
||||
const isChecked = event.target.checked === true
|
||||
let values = this.values.slice()
|
||||
onChange(event) {
|
||||
// Get all selected options
|
||||
const answerIds = [...event.target.options]
|
||||
.filter(option => option.selected)
|
||||
.map(option => parseInt(option.value, 10))
|
||||
|
||||
// Simple select
|
||||
if (!this.isMultiple) {
|
||||
this.$emit('update:values', [answerId])
|
||||
this.$emit('update:values', [answerIds[0]])
|
||||
return
|
||||
}
|
||||
|
||||
// Select with multiple
|
||||
if (isChecked) {
|
||||
values.push(answerId)
|
||||
} else {
|
||||
values = values.filter(id => id !== answerId)
|
||||
}
|
||||
|
||||
// Emit values and remove duplicates
|
||||
this.$emit('update:values', [...new Set(values)])
|
||||
this.$emit('update:values', [...new Set(answerIds)])
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -37,10 +37,7 @@
|
|||
@delete="onDelete">
|
||||
<ul class="question__content">
|
||||
<template v-for="(answer, index) in options">
|
||||
<li v-if="!edit"
|
||||
:key="answer.id"
|
||||
class="question__item"
|
||||
:class="{'question__item--last': (index === options.length-1),}">
|
||||
<li v-if="!edit" :key="answer.id" class="question__item">
|
||||
<!-- Answer radio/checkbox + label -->
|
||||
<!-- TODO: migrate to radio/checkbox component once available -->
|
||||
<input :id="`${id}-answer-${answer.id}`"
|
||||
|
|
@ -78,7 +75,7 @@
|
|||
|
||||
<li v-if="(edit && !isLastEmpty) || hasNoAnswer" class="question__item">
|
||||
<div class="question__item__pseudoInput" :class="{'question__item__pseudoInput--unique':isUnique}" />
|
||||
<input ref="inputNewAnswer"
|
||||
<input
|
||||
:aria-label="t('forms', 'Add a new answer')"
|
||||
:placeholder="t('forms', 'Add a new answer')"
|
||||
class="question__input"
|
||||
|
|
@ -154,15 +151,6 @@ export default {
|
|||
|
||||
// update parent
|
||||
this.updateOptions(options)
|
||||
} else {
|
||||
// If edit becomes true by tabbing to last element, focus newAnswer-input
|
||||
if (document.activeElement?.parentNode?.classList.contains('question__item--last')) {
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.inputNewAnswer) {
|
||||
this.$refs.inputNewAnswer.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ export default {
|
|||
const squashedAnswers = answers.map(answer => answer.text).join('; ')
|
||||
|
||||
answeredQuestionsArray.push({
|
||||
'id': question.id,
|
||||
'text': question.text,
|
||||
'squashedAnswers': squashedAnswers,
|
||||
id: question.id,
|
||||
text: question.text,
|
||||
squashedAnswers,
|
||||
})
|
||||
})
|
||||
return answeredQuestionsArray
|
||||
|
|
|
|||
|
|
@ -109,9 +109,9 @@ export default {
|
|||
const optionsStatIndex = questionOptionsStats.findIndex(option => option.text === answer.text)
|
||||
if (optionsStatIndex < 0) {
|
||||
questionOptionsStats.push({
|
||||
'text': answer.text,
|
||||
'count': 1,
|
||||
'percentage': 0,
|
||||
text: answer.text,
|
||||
count: 1,
|
||||
percentage: 0,
|
||||
})
|
||||
} else {
|
||||
questionOptionsStats[optionsStatIndex].count++
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ export default {
|
|||
},
|
||||
|
||||
// Update Window-Title on title change
|
||||
'form.title': function() {
|
||||
'form.title'() {
|
||||
SetWindowTitle(this.formTitle)
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ export default {
|
|||
onKeydownEnter(event) {
|
||||
const formInputs = Array.from(this.$refs.form)
|
||||
const sourceInputIndex = formInputs.findIndex(input => input === event.originalTarget)
|
||||
|
||||
// Focus next form element
|
||||
formInputs[sourceInputIndex + 1].focus()
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue