-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e1c98d8
commit 8d3ebdc
Showing
11 changed files
with
298 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div :class="question.cssClasses.root"> | ||
<div v-if="question.getShowNoEntriesPlaceholder()" :class="question.cssClasses.noEntriesPlaceholder"> | ||
<span> | ||
<survey-string :locString="question.locNoEntriesText"></survey-string> | ||
</span> | ||
<sv-paneldynamic-add-btn :data="{ question }" /> | ||
</div> | ||
<div :class="question.cssClasses.progress" v-if="!getShowLegacyNavigation() && question.isProgressTopShowing && question.isRangeShowing"> | ||
<div | ||
:class="question.cssClasses.progressBar" | ||
:style="{ width: question.progress }" | ||
role="progressbar" | ||
></div> | ||
</div> | ||
<survey-paneldynamicprogress | ||
v-if="getShowLegacyNavigation() && question.isProgressTopShowing" | ||
:question="question" | ||
/> | ||
<template v-for="(panel, index) in getRenderedPanels()" :key="panel.id"> | ||
<div :class="question.getPanelWrapperCss()"> | ||
<survey-panel :question="panel" :css="css" /> | ||
<sv-paneldynamic-remove-btn v-if="question.panelRemoveButtonLocation === 'right' && question.canRemovePanel && panel.state !== 'collapsed'" :data="{ question, panel }" /> | ||
</div> | ||
<hr :class="question.cssClasses.separator" v-if="question.isRenderModeList && index < question.visiblePanelCount - 1" :key="'separator' + panel.id" /> | ||
</template> | ||
<survey-paneldynamicprogress | ||
v-if="getShowLegacyNavigation() && question.isProgressBottomShowing" | ||
:question="question" | ||
/> | ||
<sv-paneldynamic-add-btn v-if="getShowLegacyNavigation() && question.isRenderModeList" :data="{ question }" /> | ||
<survey-paneldynamicprogress-v2 v-if="question.showNavigation" :question="question" /> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { PanelModel, QuestionPanelDynamicModel } from "survey-core"; | ||
import { QuestionVue } from "./base"; | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
// eslint-disable-next-line | ||
mixins: [QuestionVue], | ||
name: "survey-paneldynamic", | ||
props: { | ||
question: QuestionPanelDynamicModel, | ||
}, | ||
data: (vm: any) => { | ||
return { | ||
getRenderedPanels(): PanelModel[] { | ||
if (vm.question.isRenderModeList) return vm.question.panels; | ||
const panels = []; | ||
if (vm.question.currentPanel) { | ||
panels.push(vm.question.currentPanel); | ||
} | ||
return panels; | ||
}, | ||
getShowLegacyNavigation() { | ||
return vm.question["showLegacyNavigation"]; | ||
}, | ||
}; | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<div :class="this.getСssClass()"> | ||
<div style="clear: both" :class="this.getСssClass()"> | ||
<div :class="question.cssClasses.progressContainer"> | ||
<sv-paneldynamic-prev-btn :data="{ question: question }" /> | ||
<div :class="question.cssClasses.progress" v-if="question.isRangeShowing"> | ||
<div | ||
:class="question.cssClasses.progressBar" | ||
:style="{ width: question.progress }" | ||
role="progressbar" | ||
></div> | ||
</div> | ||
<sv-paneldynamic-next-btn :data="{ question: question }" /> | ||
</div> | ||
<sv-paneldynamic-add-btn :data="{ question: question }" /> | ||
<sv-paneldynamic-progress-text :data="{ question: question }" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { QuestionPanelDynamicModel } from "survey-core"; | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
// eslint-disable-next-line | ||
name: "survey-paneldynamicprogress", | ||
props: { | ||
question: QuestionPanelDynamicModel, | ||
}, | ||
data: (vm: any) => { | ||
return { | ||
getСssClass() { | ||
return vm.question.isProgressTopShowing | ||
? vm.question.cssClasses.progressTop | ||
: vm.question.cssClasses.progressBottom; | ||
}, | ||
}; | ||
}, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<div :class="question.cssClasses.footer" v-if="!!question.cssClasses.footer"> | ||
<hr :class="question.cssClasses.separator"/> | ||
<div :class="question.cssClasses.progress" v-if="question.isRangeShowing && question.isProgressBottomShowing"> | ||
<div | ||
:class="question.cssClasses.progressBar" | ||
:style="{ width: question.progress }" | ||
role="progressbar" | ||
></div> | ||
</div> | ||
<div :class="question.cssClasses.footerButtonsContainer" v-if="question.footerToolbar.visibleActions.length"> | ||
<sv-action-bar :model="question.footerToolbar"/> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { QuestionPanelDynamicModel } from "survey-core"; | ||
import { defineComponent } from "vue"; | ||
import PanelDynamicProgress from "./PanelDynamicProgress.vue"; | ||
export default defineComponent({ | ||
// eslint-disable-next-line | ||
name: "survey-paneldynamicprogress-v2", | ||
props: { | ||
question: QuestionPanelDynamicModel, | ||
}, | ||
mixins: [PanelDynamicProgress], | ||
}); | ||
</script> |
30 changes: 30 additions & 0 deletions
30
packages/survey-vue-ui/src/components/paneldynamic-actions/PaneldynamicAddBtn.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<template> | ||
<button | ||
type="button" | ||
v-if="question.canAddPanel" | ||
:class="question.getAddButtonCss()" | ||
@click="addPanelClick" | ||
> | ||
<span :class="question.cssClasses.buttonAddText"> | ||
{{ question.panelAddText }} | ||
</span> | ||
</button> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { PaneldynamicActionMixin } from "./action"; | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
// eslint-disable-next-line | ||
mixins: [PaneldynamicActionMixin], | ||
name: "sv-paneldynamic-add-btn", | ||
data: (vm: any) => { | ||
return { | ||
addPanelClick() { | ||
vm.question.addPanelUI(); | ||
}, | ||
}; | ||
}, | ||
}); | ||
</script> |
23 changes: 23 additions & 0 deletions
23
packages/survey-vue-ui/src/components/paneldynamic-actions/PaneldynamicNextBtn.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<div :title="question.panelNextText" @click="nextPanelClick" :class="question.getNextButtonCss()"> | ||
<sv-svg-icon :iconName="question.cssClasses.progressBtnIcon" :size="'auto'"></sv-svg-icon> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { PaneldynamicActionMixin } from "./action"; | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
// eslint-disable-next-line | ||
mixins: [PaneldynamicActionMixin], | ||
name: "sv-paneldynamic-next-btn", | ||
data: (vm: any) => { | ||
return { | ||
nextPanelClick() { | ||
vm.question.goToNextPanel(); | ||
}, | ||
}; | ||
}, | ||
}); | ||
</script> |
23 changes: 23 additions & 0 deletions
23
packages/survey-vue-ui/src/components/paneldynamic-actions/PaneldynamicPrevBtn.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<template> | ||
<div :title="question.panelPrevText" @click="prevPanelClick" :class="question.getPrevButtonCss()"> | ||
<sv-svg-icon :iconName="question.cssClasses.progressBtnIcon" :size="'auto'"></sv-svg-icon> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { PaneldynamicActionMixin } from "./action"; | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
// eslint-disable-next-line | ||
mixins: [PaneldynamicActionMixin], | ||
name: "sv-paneldynamic-prev-btn", | ||
data: (vm: any) => { | ||
return { | ||
prevPanelClick() { | ||
vm.question.goToPrevPanel(); | ||
}, | ||
}; | ||
}, | ||
}); | ||
</script> |
14 changes: 14 additions & 0 deletions
14
packages/survey-vue-ui/src/components/paneldynamic-actions/PaneldynamicProgressText.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<template> | ||
<div :class="question.cssClasses.progressText">{{ question.progressText }}</div> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { PaneldynamicActionMixin } from "./action"; | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
// eslint-disable-next-line | ||
mixins: [PaneldynamicActionMixin], | ||
name: "sv-paneldynamic-progress-text", | ||
}); | ||
</script> |
38 changes: 38 additions & 0 deletions
38
packages/survey-vue-ui/src/components/paneldynamic-actions/PaneldynamicRemoveBtn.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<template> | ||
<button | ||
type="button" | ||
:class="question.getPanelRemoveButtonCss()" | ||
@click="removePanelClick(panel)" | ||
> | ||
<span :class="question.cssClasses.buttonRemoveText">{{ | ||
question.panelRemoveText | ||
}}</span> | ||
<span :class="question.cssClasses.iconRemove"></span> | ||
</button> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { PaneldynamicActionMixin } from "./action"; | ||
import { defineComponent } from "vue"; | ||
export default defineComponent({ | ||
// eslint-disable-next-line | ||
mixins: [PaneldynamicActionMixin], | ||
name: "sv-paneldynamic-remove-btn", | ||
data: (vm: any) => { | ||
return { | ||
removePanelClick(panel: any) { | ||
if (!vm.question.isInputReadOnly) { | ||
vm.question.removePanelUI(panel); | ||
} | ||
}, | ||
}; | ||
}, | ||
computed: { | ||
// readonly | ||
panel(vm: any): any { | ||
return (vm.item && vm.item.data.panel) || vm.data.panel; | ||
}, | ||
}, | ||
}); | ||
</script> |
15 changes: 15 additions & 0 deletions
15
packages/survey-vue-ui/src/components/paneldynamic-actions/action.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { ComponentOptions } from "vue"; | ||
import { Action, QuestionPanelDynamicModel } from "survey-core"; | ||
|
||
export const PaneldynamicActionMixin: ComponentOptions = { | ||
props: { | ||
data: Object, | ||
item: Action, | ||
}, | ||
computed: { | ||
// readonly | ||
question(vm: any): QuestionPanelDynamicModel { | ||
return (vm.item && vm.item.data.question) || vm.data.question; | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters