Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work for https://github.com/surveyjs/survey-creator/issues/4780 - Support Vue 3 in SurveyJS Creator - implemented element wrapper #7238

Merged
merged 38 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
59660ae
Work for https://github.com/surveyjs/survey-creator/issues/4780 - Sup…
Oct 26, 2023
8809073
Small refactor
dk981234 Oct 26, 2023
3ed1882
Fix warnings in Toolbox
dk981234 Oct 26, 2023
6a0ac46
Fix composite question
dk981234 Oct 26, 2023
6aed617
Fix question adorner model is created multiple times
dk981234 Oct 26, 2023
516a8e0
Fix matrix detail panel
dk981234 Oct 26, 2023
f2e52e2
Fix action bar warning
dk981234 Oct 27, 2023
0528a8c
Merge branch 'master' into feature/S4780-creator-vue3
Oct 30, 2023
ced70a8
Merge branch 'feature/S4780-creator-vue3' of https://github.com/surve…
Oct 30, 2023
65b56c2
Implement content wrapper + fix potential warnings
dk981234 Oct 31, 2023
0f92253
Implement buttongroup question
dk981234 Oct 31, 2023
04e148e
Implement matrix cell wrapper
dk981234 Nov 3, 2023
2ad9192
Fix panel doesnt render skeleton component
dk981234 Nov 3, 2023
a97390a
Refactor action bar item
dk981234 Nov 6, 2023
f9d9cd2
Merge branch 'master' into feature/S4780-creator-vue3
dk981234 Nov 8, 2023
3dd94bd
Implement wrapper for logo component
dk981234 Nov 8, 2023
36c2a14
small refactor
dk981234 Nov 8, 2023
e4379aa
Implement wrapper for panel inside paneldynamic
dk981234 Nov 8, 2023
5ac04ae
Implement wrapper for row component
dk981234 Nov 8, 2023
fca93c5
Fix matrix cell warnings
dk981234 Nov 8, 2023
9f81ae8
Add watch command
dk981234 Nov 9, 2023
86283fa
Fix panel tries to load all elements if collapsed before mount
dk981234 Nov 9, 2023
01acb16
Fix action bar's handle click is not working
dk981234 Nov 10, 2023
2dbb030
Implement wrapper for detail panel
dk981234 Nov 10, 2023
43bbf4e
Fix d&d for matrix rows
dk981234 Nov 10, 2023
9a0cf8f
Fix panel's focusin doesnt work
dk981234 Nov 10, 2023
8e2092e
Fix d&d is not working from list
dk981234 Nov 10, 2023
e7e7b5b
Fix disableTabStop is not working
dk981234 Nov 10, 2023
a9dfb9f
Implement wrappers for ranking/radiogroup/checkbox/imagepicker items …
dk981234 Nov 13, 2023
26d168f
Fix vue3 responsivity doesnt work when reseting item min/max dimensions
dk981234 Nov 15, 2023
525a908
Implement wrappers for matrix single choice
dk981234 Nov 15, 2023
1f01416
Fix lazy rendering breaks when row changed
dk981234 Nov 15, 2023
d445fbe
Fix warnings
dk981234 Nov 15, 2023
3a7e7c3
Fix vue f test
dk981234 Nov 15, 2023
93f4d55
Fix handleClick is false by default (need true)
dk981234 Nov 15, 2023
e8be209
Fix advanced header component
dk981234 Nov 16, 2023
bce1639
Merge branch 'master' into feature/S4780-creator-vue3
dk981234 Nov 16, 2023
3cd6b41
Fix recursive updates in multipletext
dk981234 Nov 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/survey-vue3-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"dev": "vite",
"preview": "vite preview",
"build-only": "vite build",
"watch": "vite build --watch",
"build": "vite build && npm run build:types",
"build:types": "vue-tsc --project tsconfig.types.json --emitDeclarationOnly",
"type-check": "vue-tsc --project tsconfig.types.json --noEmit",
Expand Down
2 changes: 1 addition & 1 deletion packages/survey-vue3-ui/src/BooleanCheckbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@
</div>
</div>
</template>

<script lang="ts" setup>
import { RendererFactory } from "survey-core";
import type { IBooleanProps } from "./boolean";
import { ref } from "vue";
import { useQuestion } from "./base";
defineOptions({ inheritAttrs: false });
const props = defineProps<IBooleanProps & { css?: any }>();
const root = ref(null);
useQuestion(props, root);
Expand Down
1 change: 1 addition & 0 deletions packages/survey-vue3-ui/src/BooleanRadio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { RendererFactory } from "survey-core";
import { ref } from "vue";
import { useQuestion } from "./base";
import type { IBooleanProps } from "./boolean";
defineOptions({ inheritAttrs: false });
const root = ref(null);
const props = defineProps<IBooleanProps>();
useQuestion(props, root);
Expand Down
1 change: 1 addition & 0 deletions packages/survey-vue3-ui/src/BooleanSwitch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import { useQuestion } from "./base";
import { ref } from "vue";
import type { IBooleanProps } from "./boolean";
defineOptions({ inheritAttrs: false });
const props = defineProps<IBooleanProps>();
const root = ref(null);
useQuestion(props, root);
Expand Down
92 changes: 8 additions & 84 deletions packages/survey-vue3-ui/src/Checkbox.vue
Original file line number Diff line number Diff line change
@@ -1,89 +1,13 @@
<template>
<fieldset
:class="question.getSelectBaseRootCss()"
ref="root"
:role="question.a11y_input_ariaRole"
:aria-required="question.a11y_input_ariaRequired"
:aria-label="question.a11y_input_ariaLabel"
:aria-labelledby="question.a11y_input_ariaLabelledBy"
:aria-invalid="question.a11y_input_ariaInvalid"
:aria-describedby="question.a11y_input_ariaDescribedBy"
>
<legend class="sv-hidden">{{question.locTitle.renderedHtml}}</legend>
<template v-if="question.hasHeadItems">
<survey-checkbox-item
v-for="(item, index) in question.headItems"
:key="item.value"
:class="question.getItemClass(item)"
:question="question"
:item="item"
:index="'' + index"
></survey-checkbox-item>
</template>
<template v-if="!question.hasColumns && !question.blockedRow">
<survey-checkbox-item
v-for="(item, index) in question.bodyItems"
:key="item.value"
:class="question.getItemClass(item)"
:question="question"
:item="item"
:index="index"
></survey-checkbox-item>
</template>
<div :class="question.cssClasses.rootRow" v-if="question.blockedRow">
<template v-if="!question.hasColumns && question.blockedRow">
<survey-checkbox-item
v-for="(item, index) in question.dataChoices"
:key="item.value"
:class="question.getItemClass(item)"
:question="question"
:item="item"
:index="index"
></survey-checkbox-item>
</template>
</div>
<div
v-if="question.hasColumns"
:class="question.cssClasses.rootMultiColumn"
>
<div
v-for="(column, colIndex) in question.columns"
:key="colIndex"
:class="question.getColumnClass()"
role="presentation"
>
<survey-checkbox-item
v-for="(item, index) in column"
:key="item.value"
:class="question.getItemClass(item)"
:question="question"
:item="item"
:index="'' + colIndex + index"
></survey-checkbox-item>
</div>
</div>
<template v-if="question.hasFootItems">
<survey-checkbox-item
v-for="(item, index) in question.footItems"
:key="item.value"
:class="question.getItemClass(item)"
:question="question"
:item="item"
:index="'' + index"
></survey-checkbox-item>
</template>
<survey-other-choice
v-if="question.renderedValue && question.isOtherSelected"
:question="question"
/>
</fieldset>
<SelectBase
:question="question"
:input-type="'checkbox'"
:show-legend="true"
></SelectBase>
</template>

<script lang="ts" setup>
import type { QuestionCheckboxModel } from "survey-core";
import { useQuestion } from "./base";
import { ref } from "vue";
const props = defineProps<{ question: QuestionCheckboxModel }>();
const root = ref(null);
useQuestion(props, root);
import SelectBase from "./SelectBase.vue";
defineOptions({ inheritAttrs: false });
defineProps<{ question: QuestionCheckboxModel }>();
</script>
29 changes: 19 additions & 10 deletions packages/survey-vue3-ui/src/CheckboxItem.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<template>
<div role="presentation">
<label
:class="question.getLabelClass(item)"
>
<div role="presentation" :class="question.getItemClass(item)">
<label :class="question.getLabelClass(item)">
<input
v-if="item == question.selectAllItem"
type="checkbox"
role="option"
:name="question.name+item.value"
role="option"
:name="question.name + item.value"
:value="isAllSelected"
v-model="isAllSelected"
:id="question.getItemId(item)"
Expand All @@ -16,10 +14,10 @@
/><input
v-if="item != question.selectAllItem"
type="checkbox"
role="option"
:name="question.name+item.value"
role="option"
:name="question.name + item.value"
:value="item.value"
v-model="question.renderedValue"
v-model="renderedValue"
:id="question.getItemId(item)"
:disabled="!question.getItemEnabled(item)"
:class="question.cssClasses.itemControl"
Expand All @@ -45,10 +43,11 @@ import type { ItemValue, QuestionCheckboxModel } from "survey-core";
import { useBase } from "./base";
import { computed } from "vue";

defineOptions({ inheritAttrs: false });

const props = defineProps<{
question: QuestionCheckboxModel;
item: ItemValue;
index: string | number;
hideLabel?: boolean;
}>();
const isAllSelected = computed({
Expand All @@ -61,5 +60,15 @@ const isAllSelected = computed({
},
});

useBase(() => props.item);

const renderedValue = computed({
get: () => props.question.renderedValue,
set: (val) => {
const question = props.question;
question.renderedValue = val;
},
});

useBase(() => props.item);
</script>
1 change: 1 addition & 0 deletions packages/survey-vue3-ui/src/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
import type { QuestionCommentModel } from "survey-core";
import { useQuestion } from "./base";
import { ref } from "vue";
defineOptions({ inheritAttrs: false });
const props = defineProps<{
question: QuestionCommentModel;
css?: object;
Expand Down
3 changes: 2 additions & 1 deletion packages/survey-vue3-ui/src/Composite.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<template>
<survey-panel ref="root" :question="contentPanel" :css="css" />
<survey-panel ref="root" :element="contentPanel" :css="css" />
</template>

<script lang="ts" setup>
import { computed, ref } from "vue";
import type { QuestionCompositeModel } from "survey-core";
import { useQuestion } from "./base";
defineOptions({ inheritAttrs: false });
const props = defineProps<{ question: QuestionCompositeModel; css?: object }>();
const root = ref(null);
useQuestion(props, root);
Expand Down
2 changes: 1 addition & 1 deletion packages/survey-vue3-ui/src/Custom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { computed, ref } from "vue";
import type { QuestionCustomModel, Question } from "survey-core";
import { getComponentName as getComponent, useQuestion } from "./base";

defineOptions({ inheritAttrs: false });
const props = defineProps<{ question: QuestionCustomModel; css?: any }>();

const root = ref(null);
Expand Down
1 change: 1 addition & 0 deletions packages/survey-vue3-ui/src/Dropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import type { QuestionDropdownModel } from "survey-core";
import { useQuestion } from "./base";
import { ref } from "vue";
defineOptions({ inheritAttrs: false });
const props = defineProps<{ question: QuestionDropdownModel }>();
const root = ref(null);
useQuestion(props, root);
Expand Down
1 change: 1 addition & 0 deletions packages/survey-vue3-ui/src/DropdownSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import { computed, ref } from "vue";
import { useQuestion } from "./base";
import type { QuestionDropdownModel } from "survey-core";
defineOptions({ inheritAttrs: false });
const props = defineProps<{ question: QuestionDropdownModel }>();
const root = ref(null);
useQuestion(props, root);
Expand Down
Loading