From 59660ae3ef586b219345790e39795ad69e9723f6 Mon Sep 17 00:00:00 2001 From: tsv2013 Date: Thu, 26 Oct 2023 17:17:27 +0300 Subject: [PATCH 01/34] Work for https://github.com/surveyjs/survey-creator/issues/4780 - Support Vue 3 in SurveyJS Creator - implemented element wrapper --- packages/survey-vue3-ui/src/Element.vue | 2 +- packages/survey-vue3-ui/src/Panel.vue | 48 +++++++-------- packages/survey-vue3-ui/src/Row.vue | 58 ++++++++++++++----- .../survey-vue3-ui/src/TemplateRenderer.vue | 23 ++++++++ packages/survey-vue3-ui/src/index.ts | 4 ++ 5 files changed, 94 insertions(+), 41 deletions(-) create mode 100644 packages/survey-vue3-ui/src/TemplateRenderer.vue diff --git a/packages/survey-vue3-ui/src/Element.vue b/packages/survey-vue3-ui/src/Element.vue index 2693b6028f..4fcb957e02 100644 --- a/packages/survey-vue3-ui/src/Element.vue +++ b/packages/survey-vue3-ui/src/Element.vue @@ -1,6 +1,6 @@ @@ -39,30 +39,30 @@ import { ref, computed, onMounted, onUnmounted } from "vue"; import { useBase } from "./base"; const props = defineProps<{ - question: PanelModel; + element: PanelModel; isEditMode?: boolean; css?: any; }>(); const isCollapsedValue = ref(false); const root = ref(null as any); -const rows = computed(() => props.question.rows); -const survey = computed(() => props.question.survey); +const rows = computed(() => props.element.rows); +const survey = computed(() => props.element.survey); const isCollapsed = computed(() => isCollapsedValue.value); -useBase(() => props.question); +useBase(() => props.element); onMounted(() => { - if (props.question.survey) { - props.question.survey.afterRenderPanel(props.question, root.value); + if (props.element.survey) { + props.element.survey.afterRenderPanel(props.element, root.value); } - isCollapsedValue.value = props.question.isCollapsed; - const question = props.question; - question.stateChangedCallback = () => { - isCollapsedValue.value = props.question.isCollapsed; + isCollapsedValue.value = props.element.isCollapsed; + const element = props.element; + element.stateChangedCallback = () => { + isCollapsedValue.value = props.element.isCollapsed; }; }); onUnmounted(() => { - const question = props.question; - question.stateChangedCallback = null as any; + const element = props.element; + element.stateChangedCallback = null as any; }); diff --git a/packages/survey-vue3-ui/src/Row.vue b/packages/survey-vue3-ui/src/Row.vue index c185362435..90ec4fe8df 100644 --- a/packages/survey-vue3-ui/src/Row.vue +++ b/packages/survey-vue3-ui/src/Row.vue @@ -1,23 +1,11 @@ @@ -43,6 +31,44 @@ const elements = computed( ); const root = ref(); +const getElementComponentName = (element: SurveyElement) => { + return element.isPanel ? "survey-panel": "survey-element"; +} +const getComponentName = (element: SurveyElement) => { + const survey = element.survey as SurveyModel; + if(!!survey) { + const name = survey.getElementWrapperComponentName(element as any); + if(!!name) { + return name; + } + } + return getElementComponentName(element); +} +const getRootStyle = (element: SurveyElement) => { + if(!!element.cssClasses) { + return element.rootStyle; + } else { + return {}; + } +} +const getComponentData = (element: SurveyElement) => { + const survey = element.survey as SurveyModel; + let data: any; + if(!!survey) { + data = survey.getElementWrapperComponentData(element as any); + } + return { + componentName: getElementComponentName(element), + componentData: { + element: element, + survey: survey, + row: props.row, + css: element.isPanel ? props.css : element.getRootStyle(), + data: data + } + }; +} + useBase(() => props.row); onMounted(() => { diff --git a/packages/survey-vue3-ui/src/TemplateRenderer.vue b/packages/survey-vue3-ui/src/TemplateRenderer.vue new file mode 100644 index 0000000000..0768e7dbb6 --- /dev/null +++ b/packages/survey-vue3-ui/src/TemplateRenderer.vue @@ -0,0 +1,23 @@ + + + diff --git a/packages/survey-vue3-ui/src/index.ts b/packages/survey-vue3-ui/src/index.ts index 0b311a9533..16fb5d2bee 100644 --- a/packages/survey-vue3-ui/src/index.ts +++ b/packages/survey-vue3-ui/src/index.ts @@ -106,6 +106,8 @@ import Header from "./components/header/Header.vue"; import HeaderCell from "./components/header/HeaderCell.vue"; import HeaderMobile from "./components/header/HeaderMobile.vue"; +import TemplateRenderer from "./TemplateRenderer.vue"; + import { SurveyModel, doKey2ClickBlur, @@ -244,6 +246,8 @@ function registerComponents(app: App) { app.component("sv-header-cell", HeaderCell); app.component("sv-header-mobile", HeaderMobile); + app.component("sv-template-renderer", TemplateRenderer); + app.directive("key2click", { // When the bound element is inserted into the DOM... mounted: function (el: HTMLElement, binding: any) { From 88090730b41fb46cef72be1003b7bb2c1ff1b293 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Thu, 26 Oct 2023 19:34:29 +0400 Subject: [PATCH 02/34] Small refactor --- packages/survey-vue3-ui/src/Panel.vue | 5 ++ packages/survey-vue3-ui/src/PanelDynamic.vue | 2 +- .../src/{Element.vue => Question.vue} | 70 +++++++++---------- packages/survey-vue3-ui/src/Row.vue | 37 +++++----- .../survey-vue3-ui/src/TemplateRenderer.vue | 8 +-- packages/survey-vue3-ui/src/index.ts | 4 +- 6 files changed, 64 insertions(+), 62 deletions(-) rename packages/survey-vue3-ui/src/{Element.vue => Question.vue} (54%) diff --git a/packages/survey-vue3-ui/src/Panel.vue b/packages/survey-vue3-ui/src/Panel.vue index a5abb6c2c7..a51ed832c6 100644 --- a/packages/survey-vue3-ui/src/Panel.vue +++ b/packages/survey-vue3-ui/src/Panel.vue @@ -33,6 +33,11 @@ + + diff --git a/packages/survey-vue3-ui/src/Row.vue b/packages/survey-vue3-ui/src/Row.vue index 9a12719a95..607a252ff1 100644 --- a/packages/survey-vue3-ui/src/Row.vue +++ b/packages/survey-vue3-ui/src/Row.vue @@ -1,15 +1,12 @@ @@ -34,46 +31,6 @@ const elements = computed( ); const root = ref(); -const getElementComponentName = (element: SurveyElement) => { - return element.isPanel ? "survey-panel" : "survey-question"; -}; -const getComponentName = (element: SurveyElement) => { - const survey = element.survey as SurveyModel; - if (survey) { - const name = survey.getElementWrapperComponentName(element as any); - if (name) { - return name; - } - } - return getElementComponentName(element); -}; -const getRootStyle: (element: SurveyElement) => any = ( - element: SurveyElement -) => { - if (element.cssClasses) { - return element.rootStyle; - } else { - return {}; - } -}; -const getComponentData = (element: SurveyElement) => { - const survey = element.survey as SurveyModel; - let data: any; - if (survey) { - data = survey.getElementWrapperComponentData(element as any); - } - return { - componentName: getElementComponentName(element), - componentData: { - element: element, - survey: survey, - row: props.row, - css: element.isPanel ? props.css : element.getRootStyle(), - data: data, - }, - }; -}; - useBase(() => props.row); onMounted(() => { diff --git a/packages/survey-vue3-ui/src/index.ts b/packages/survey-vue3-ui/src/index.ts index 352a79670f..f9f47ae272 100644 --- a/packages/survey-vue3-ui/src/index.ts +++ b/packages/survey-vue3-ui/src/index.ts @@ -106,6 +106,8 @@ import Header from "./components/header/Header.vue"; import HeaderCell from "./components/header/HeaderCell.vue"; import HeaderMobile from "./components/header/HeaderMobile.vue"; +import Element from "./Element.vue"; + import TemplateRenderer from "./TemplateRenderer.vue"; import { @@ -248,6 +250,8 @@ function registerComponents(app: App) { app.component("sv-template-renderer", TemplateRenderer); + app.component("survey-element", Element); + app.directive("key2click", { // When the bound element is inserted into the DOM... mounted: function (el: HTMLElement, binding: any) { From 516a8e0ea4ab8a384b68e45388be5b10317ece5d Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Thu, 26 Oct 2023 21:56:19 +0400 Subject: [PATCH 06/34] Fix matrix detail panel --- packages/survey-vue3-ui/src/Element.vue | 2 +- packages/survey-vue3-ui/src/MatrixCell.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/survey-vue3-ui/src/Element.vue b/packages/survey-vue3-ui/src/Element.vue index e5ecdf360c..3ecc0d38f8 100644 --- a/packages/survey-vue3-ui/src/Element.vue +++ b/packages/survey-vue3-ui/src/Element.vue @@ -10,7 +10,7 @@ import { computed } from "vue"; const props = defineProps<{ element: SurveyElement; row: QuestionRowModel; - css: any; + css?: any; }>(); const getElementComponentName = (element: SurveyElement) => { diff --git a/packages/survey-vue3-ui/src/MatrixCell.vue b/packages/survey-vue3-ui/src/MatrixCell.vue index 318acc0396..e783f72e0a 100644 --- a/packages/survey-vue3-ui/src/MatrixCell.vue +++ b/packages/survey-vue3-ui/src/MatrixCell.vue @@ -21,7 +21,7 @@
Date: Fri, 27 Oct 2023 12:06:22 +0400 Subject: [PATCH 07/34] Fix action bar warning --- .../src/components/action-bar/ActionBar.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/survey-vue3-ui/src/components/action-bar/ActionBar.vue b/packages/survey-vue3-ui/src/components/action-bar/ActionBar.vue index bdac38afe8..53f6400378 100644 --- a/packages/survey-vue3-ui/src/components/action-bar/ActionBar.vue +++ b/packages/survey-vue3-ui/src/components/action-bar/ActionBar.vue @@ -10,7 +10,7 @@ " > @@ -20,7 +20,7 @@ From 0f92253b1db43dd8f1456e8f7632b50a482a01e4 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Tue, 31 Oct 2023 17:33:44 +0400 Subject: [PATCH 09/34] Implement buttongroup question --- .../src/buttongroup/ButtonGroup.vue | 19 ++++++ .../src/buttongroup/ButtonGroupItem.vue | 61 +++++++++++++++++++ packages/survey-vue3-ui/src/index.ts | 5 ++ .../tests/defaultV2/buttongroup.ts | 2 +- 4 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 packages/survey-vue3-ui/src/buttongroup/ButtonGroup.vue create mode 100644 packages/survey-vue3-ui/src/buttongroup/ButtonGroupItem.vue diff --git a/packages/survey-vue3-ui/src/buttongroup/ButtonGroup.vue b/packages/survey-vue3-ui/src/buttongroup/ButtonGroup.vue new file mode 100644 index 0000000000..f0b80fef9d --- /dev/null +++ b/packages/survey-vue3-ui/src/buttongroup/ButtonGroup.vue @@ -0,0 +1,19 @@ + + diff --git a/packages/survey-vue3-ui/src/buttongroup/ButtonGroupItem.vue b/packages/survey-vue3-ui/src/buttongroup/ButtonGroupItem.vue new file mode 100644 index 0000000000..9d2f4bfde5 --- /dev/null +++ b/packages/survey-vue3-ui/src/buttongroup/ButtonGroupItem.vue @@ -0,0 +1,61 @@ + + diff --git a/packages/survey-vue3-ui/src/index.ts b/packages/survey-vue3-ui/src/index.ts index f9f47ae272..4a6ab50ec3 100644 --- a/packages/survey-vue3-ui/src/index.ts +++ b/packages/survey-vue3-ui/src/index.ts @@ -122,6 +122,8 @@ import FileCleanButton from "./FileCleanButton.vue"; import FileVideo from "./FileVideo.vue"; import FileChooseButton from "./components/file/FileChooseButton.vue"; import FilePreview from "./components/file/FilePreview.vue"; +import ButtonGroup from "./buttongroup/ButtonGroup.vue"; +import ButtonGroupItem from "./buttongroup/ButtonGroupItem.vue"; export { useBase, useLocString, useQuestion } from "./base"; SurveyModel.platform = "vue3"; @@ -252,6 +254,9 @@ function registerComponents(app: App) { app.component("survey-element", Element); + app.component("survey-buttongroup", ButtonGroup); + app.component("sv-button-group-item", ButtonGroupItem); + app.directive("key2click", { // When the bound element is inserted into the DOM... mounted: function (el: HTMLElement, binding: any) { diff --git a/visualRegressionTests/tests/defaultV2/buttongroup.ts b/visualRegressionTests/tests/defaultV2/buttongroup.ts index 04ba6bc80c..9e98a92d6e 100644 --- a/visualRegressionTests/tests/defaultV2/buttongroup.ts +++ b/visualRegressionTests/tests/defaultV2/buttongroup.ts @@ -46,7 +46,7 @@ frameworks.forEach(framework => { await wrapVisualTest(t, async (t, comparer) => { await t.resizeWindow(1920, 1080); await registerButtongroup(framework); - if (framework === "vue" || framework === "angular" || framework === "vue3") { + if (framework === "vue" || framework === "angular") { return; } await initSurvey(framework, { From 04e148e3d108dcd5b394c2abf2ccae2f7e2b9ede Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 3 Nov 2023 16:58:15 +0400 Subject: [PATCH 10/34] Implement matrix cell wrapper --- packages/survey-vue3-ui/src/MatrixCell.vue | 80 ++++++++++++------- packages/survey-vue3-ui/src/MatrixTable.vue | 19 +++-- .../survey-vue3-ui/src/TemplateRenderer.vue | 16 ++-- packages/survey-vue3-ui/src/base.ts | 2 +- packages/survey-vue3-ui/vitest.config.js | 34 ++++---- 5 files changed, 88 insertions(+), 63 deletions(-) diff --git a/packages/survey-vue3-ui/src/MatrixCell.vue b/packages/survey-vue3-ui/src/MatrixCell.vue index e783f72e0a..f0305c5b29 100644 --- a/packages/survey-vue3-ui/src/MatrixCell.vue +++ b/packages/survey-vue3-ui/src/MatrixCell.vue @@ -28,47 +28,67 @@ v-if="cell.hasQuestion" :class="question.cssClasses.cellQuestionWrapper" > - + - - +
- - {{ cell.requiredText }} + diff --git a/packages/survey-vue3-ui/src/MatrixTable.vue b/packages/survey-vue3-ui/src/MatrixTable.vue index bbed2054b5..502892a62a 100644 --- a/packages/survey-vue3-ui/src/MatrixTable.vue +++ b/packages/survey-vue3-ui/src/MatrixTable.vue @@ -9,16 +9,21 @@ diff --git a/packages/survey-vue3-ui/src/base.ts b/packages/survey-vue3-ui/src/base.ts index abaebc8911..8a782d21b2 100644 --- a/packages/survey-vue3-ui/src/base.ts +++ b/packages/survey-vue3-ui/src/base.ts @@ -76,7 +76,7 @@ export function useBase( const stopWatch = watch( getModel, (value, oldValue) => { - if (onModelChanged) onModelChanged(value); + if (value && onModelChanged) onModelChanged(value); if (oldValue) { unMakeReactive(oldValue, isModelSubsribed); if (clean) clean(oldValue); diff --git a/packages/survey-vue3-ui/vitest.config.js b/packages/survey-vue3-ui/vitest.config.js index ba52521270..c5e6a49118 100644 --- a/packages/survey-vue3-ui/vitest.config.js +++ b/packages/survey-vue3-ui/vitest.config.js @@ -1,21 +1,23 @@ -import { defineConfig } from 'vite' -import vue from '@vitejs/plugin-vue' +import { defineConfig } from "vite"; +import vue from "@vitejs/plugin-vue"; import { fileURLToPath, URL } from "node:url"; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], - test:{ - setupFiles: ['./vitest.setup.ts'], - environment: 'jsdom', - deps: { - inline: ['vitest-canvas-mock'], - }, - }, - resolve: { - alias: { + plugins: [vue()], + test: { + setupFiles: ["./vitest.setup.ts"], + environment: "jsdom", + deps: { + inline: ["vitest-canvas-mock"], + }, + }, + resolve: { + alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), - "survey-core": fileURLToPath(new URL('../../build/survey-core', import.meta.url)), - }, -}, -}) + "survey-core": fileURLToPath( + new URL("../../build/survey-core", import.meta.url) + ), + }, + }, +}); From 2ad9192d78d861b91d095e29afb5d80b496dec09 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 3 Nov 2023 17:43:23 +0400 Subject: [PATCH 11/34] Fix panel doesnt render skeleton component --- packages/survey-vue3-ui/src/Element.vue | 12 +++++++++++- packages/survey-vue3-ui/src/Question.vue | 11 +---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/survey-vue3-ui/src/Element.vue b/packages/survey-vue3-ui/src/Element.vue index 3ecc0d38f8..7f288c2c24 100644 --- a/packages/survey-vue3-ui/src/Element.vue +++ b/packages/survey-vue3-ui/src/Element.vue @@ -1,6 +1,16 @@ diff --git a/packages/survey-vue3-ui/src/Survey.vue b/packages/survey-vue3-ui/src/Survey.vue index ce69723b59..5084149aee 100644 --- a/packages/survey-vue3-ui/src/Survey.vue +++ b/packages/survey-vue3-ui/src/Survey.vue @@ -14,7 +14,10 @@
- + -
-
-
- +
+
+
+
@@ -14,9 +23,8 @@ diff --git a/packages/survey-vue3-ui/src/index.ts b/packages/survey-vue3-ui/src/index.ts index 4a6ab50ec3..506b9a0f01 100644 --- a/packages/survey-vue3-ui/src/index.ts +++ b/packages/survey-vue3-ui/src/index.ts @@ -124,6 +124,7 @@ import FileChooseButton from "./components/file/FileChooseButton.vue"; import FilePreview from "./components/file/FilePreview.vue"; import ButtonGroup from "./buttongroup/ButtonGroup.vue"; import ButtonGroupItem from "./buttongroup/ButtonGroupItem.vue"; +import Logo from "./Logo.vue"; export { useBase, useLocString, useQuestion } from "./base"; SurveyModel.platform = "vue3"; @@ -135,6 +136,7 @@ function registerComponents(app: App) { app.component("popup-survey", PopupSurvey); app.component("survey-header", HeaderBasic); + app.component("sv-logo-image", Logo); app.component("survey-page", Page); app.component("survey-row", Row); app.component("survey-question", Question); @@ -247,6 +249,7 @@ function registerComponents(app: App) { app.component("sv-loading-indicator", LoadingIndicator); app.component("sv-header", Header); + app.component("sv "); app.component("sv-header-cell", HeaderCell); app.component("sv-header-mobile", HeaderMobile); From 36c2a144922ca7a486b17cbc3f88fc5788588f4b Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Wed, 8 Nov 2023 15:25:40 +0400 Subject: [PATCH 14/34] small refactor --- packages/survey-vue3-ui/src/base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/survey-vue3-ui/src/base.ts b/packages/survey-vue3-ui/src/base.ts index 8a782d21b2..913cc357b8 100644 --- a/packages/survey-vue3-ui/src/base.ts +++ b/packages/survey-vue3-ui/src/base.ts @@ -91,7 +91,7 @@ export function useBase( onBeforeUnmount(() => { const model = getModel(); if (model) { - if (clean) clean(getModel()); + if (clean) clean(model); unMakeReactive(model, isModelSubsribed); stopWatch(); } From e4379aae72d12b38b6df4e583770159f40da92a6 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Wed, 8 Nov 2023 16:05:41 +0400 Subject: [PATCH 15/34] Implement wrapper for panel inside paneldynamic --- packages/survey-vue3-ui/src/PanelDynamic.vue | 36 ++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/packages/survey-vue3-ui/src/PanelDynamic.vue b/packages/survey-vue3-ui/src/PanelDynamic.vue index fe8dae0fb9..e0fa7afd52 100644 --- a/packages/survey-vue3-ui/src/PanelDynamic.vue +++ b/packages/survey-vue3-ui/src/PanelDynamic.vue @@ -29,7 +29,10 @@ /> diff --git a/packages/survey-vue3-ui/src/Panel.vue b/packages/survey-vue3-ui/src/Panel.vue index a51ed832c6..32b1d0aaff 100644 --- a/packages/survey-vue3-ui/src/Panel.vue +++ b/packages/survey-vue3-ui/src/Panel.vue @@ -18,15 +18,16 @@ v-if="!isCollapsed" :class="element.cssClasses.panel.content" > -
@@ -39,10 +40,12 @@ export default { }; From 01acb16459b99c4c5cd9ace0ef8bfe1cc98829ba Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 10 Nov 2023 15:37:10 +0400 Subject: [PATCH 20/34] Fix action bar's handle click is not working --- .../src/components/action-bar/ActionBar.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/survey-vue3-ui/src/components/action-bar/ActionBar.vue b/packages/survey-vue3-ui/src/components/action-bar/ActionBar.vue index 53f6400378..809984e096 100644 --- a/packages/survey-vue3-ui/src/components/action-bar/ActionBar.vue +++ b/packages/survey-vue3-ui/src/components/action-bar/ActionBar.vue @@ -3,11 +3,7 @@ v-if="model.hasActions" ref="root" :class="model.getRootCss()" - v-on:click=" - (event) => { - event.stopPropagation(); - } - " + @click="onClick" > (); const root = ref(null as any as HTMLDivElement); +const onClick = (event: MouseEvent) => { + if (props.handleClick ?? true) { + event.stopPropagation(); + } +}; + useBase(() => props.model); const renderedActions = computed(() => { From 2dbb030bfa757002e30d980e3da79dfcd94554d7 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 10 Nov 2023 17:13:48 +0400 Subject: [PATCH 21/34] Implement wrapper for detail panel --- packages/survey-vue3-ui/src/MatrixCell.vue | 48 +++++++++++++++++++--- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/packages/survey-vue3-ui/src/MatrixCell.vue b/packages/survey-vue3-ui/src/MatrixCell.vue index e3dafedeb0..b67cc29c2f 100644 --- a/packages/survey-vue3-ui/src/MatrixCell.vue +++ b/packages/survey-vue3-ui/src/MatrixCell.vue @@ -20,9 +20,8 @@ >
From 43bbf4ead638d698804d39b7bb21614c34f2e6e3 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 10 Nov 2023 18:30:11 +0400 Subject: [PATCH 22/34] Fix d&d for matrix rows --- packages/survey-vue3-ui/src/MatrixTable.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/survey-vue3-ui/src/MatrixTable.vue b/packages/survey-vue3-ui/src/MatrixTable.vue index 502892a62a..8ae22637c8 100644 --- a/packages/survey-vue3-ui/src/MatrixTable.vue +++ b/packages/survey-vue3-ui/src/MatrixTable.vue @@ -41,6 +41,7 @@ > From 9a0cf8f806bc86c60cd21209d853a48647aecbe0 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 10 Nov 2023 18:52:46 +0400 Subject: [PATCH 23/34] Fix panel's focusin doesnt work --- packages/survey-vue3-ui/src/Panel.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/survey-vue3-ui/src/Panel.vue b/packages/survey-vue3-ui/src/Panel.vue index 0a2d96126a..9b35bddc39 100644 --- a/packages/survey-vue3-ui/src/Panel.vue +++ b/packages/survey-vue3-ui/src/Panel.vue @@ -3,6 +3,7 @@ v-if="element.isVisible" :class="element.getContainerCss()" :id="element.id" + @focusin="element.focusIn()" ref="root" > From 8e2092eddc16ca15039b9d8a3b920c2533848b4b Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 10 Nov 2023 19:10:55 +0400 Subject: [PATCH 24/34] Fix d&d is not working from list --- packages/survey-vue3-ui/src/components/list/ListItem.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/survey-vue3-ui/src/components/list/ListItem.vue b/packages/survey-vue3-ui/src/components/list/ListItem.vue index c75cf52d7c..58e06b55e8 100644 --- a/packages/survey-vue3-ui/src/components/list/ListItem.vue +++ b/packages/survey-vue3-ui/src/components/list/ListItem.vue @@ -6,6 +6,7 @@ v-show="model.isItemVisible(item)" :key="item.id" :id="elementId" + @pointerdown="model.onPointerDown($event, item)" v-bind:class="model.getItemClass(item)" v-on:click="click" v-key2click From e7e7b5bc56695b081e9112e506df7d41c9168b15 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Fri, 10 Nov 2023 20:19:04 +0400 Subject: [PATCH 25/34] Fix disableTabStop is not working --- .../src/components/action-bar/ActionBarItem.vue | 3 +-- .../src/components/action-bar/ActionBarItemDropdown.vue | 2 +- packages/survey-vue3-ui/src/index.ts | 4 ++++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/survey-vue3-ui/src/components/action-bar/ActionBarItem.vue b/packages/survey-vue3-ui/src/components/action-bar/ActionBarItem.vue index d401348461..d510ef00ab 100644 --- a/packages/survey-vue3-ui/src/components/action-bar/ActionBarItem.vue +++ b/packages/survey-vue3-ui/src/components/action-bar/ActionBarItem.vue @@ -17,8 +17,7 @@ v-bind:aria-checked="item.ariaChecked" v-bind:aria-expanded="item.ariaExpanded" v-bind:role="item.ariaRole" - v-bind:tabindex="item.disableTabStop ? -1 : 0" - v-key2click + v-key2click="{ processEsc: false, disableTabStop: item.disableTabStop }" > { evt.preventDefault(); From a9dfb9fcc3c37f01aa04e185734e494676ae4675 Mon Sep 17 00:00:00 2001 From: Dmitry Kuzin Date: Mon, 13 Nov 2023 19:38:35 +0400 Subject: [PATCH 26/34] Implement wrappers for ranking/radiogroup/checkbox/imagepicker items values --- packages/survey-vue3-ui/src/Checkbox.vue | 91 +----------- packages/survey-vue3-ui/src/CheckboxItem.vue | 29 ++-- packages/survey-vue3-ui/src/Imagepicker.vue | 37 +++-- .../survey-vue3-ui/src/ImagepickerItem.vue | 2 +- packages/survey-vue3-ui/src/MatrixCell.vue | 4 - packages/survey-vue3-ui/src/Radiogroup.vue | 86 +---------- .../survey-vue3-ui/src/RadiogroupItem.vue | 21 ++- packages/survey-vue3-ui/src/Ranking.vue | 82 ++++++----- packages/survey-vue3-ui/src/RankingItem.vue | 34 +++-- packages/survey-vue3-ui/src/SelectBase.vue | 138 ++++++++++++++++++ 10 files changed, 277 insertions(+), 247 deletions(-) create mode 100644 packages/survey-vue3-ui/src/SelectBase.vue diff --git a/packages/survey-vue3-ui/src/Checkbox.vue b/packages/survey-vue3-ui/src/Checkbox.vue index 3aa0066ea7..b47d5b97c6 100644 --- a/packages/survey-vue3-ui/src/Checkbox.vue +++ b/packages/survey-vue3-ui/src/Checkbox.vue @@ -1,90 +1,13 @@ - diff --git a/packages/survey-vue3-ui/src/CheckboxItem.vue b/packages/survey-vue3-ui/src/CheckboxItem.vue index 59977f42db..8486515708 100644 --- a/packages/survey-vue3-ui/src/CheckboxItem.vue +++ b/packages/survey-vue3-ui/src/CheckboxItem.vue @@ -1,13 +1,11 @@ diff --git a/packages/survey-vue3-ui/src/ImagepickerItem.vue b/packages/survey-vue3-ui/src/ImagepickerItem.vue index a7f01a6c49..8bdf36a63c 100644 --- a/packages/survey-vue3-ui/src/ImagepickerItem.vue +++ b/packages/survey-vue3-ui/src/ImagepickerItem.vue @@ -114,7 +114,7 @@ diff --git a/packages/survey-vue3-ui/src/RadiogroupItem.vue b/packages/survey-vue3-ui/src/RadiogroupItem.vue index 2f4e2dd96d..5a8efae3da 100644 --- a/packages/survey-vue3-ui/src/RadiogroupItem.vue +++ b/packages/survey-vue3-ui/src/RadiogroupItem.vue @@ -1,16 +1,13 @@