Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… for the #8209
  • Loading branch information
dmitry-kurmanov committed May 30, 2024
1 parent 22d4c52 commit 368100d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="sv-ranking-item__text" style="display: flex; align-items: center; gap: 8px;">
<svg [iconName]="'icon-next_16x16'" [size]="'16'" sv-ng-svg-icon></svg>
<sv-ng-string [model]="text"></sv-ng-string>
<sv-ng-string [model]="item.locText"></sv-ng-string>
</div>
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component, Input } from "@angular/core";
import { AngularComponentFactory } from "survey-angular-ui";
import { LocalizableString } from "survey-core";
import { ItemValue } from "survey-core";

@Component({
selector: "sv-new-item-content",
templateUrl: "./itemContentTemplateComponent.html"
})
export class AngularItemContentTemplateComponent {
@Input() text!: LocalizableString;
@Input() item!: ItemValue;
@Input() cssClasses: any;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div [class]="cssClasses.controlLabel">
<sv-ng-string [model]="text"></sv-ng-string>
<sv-ng-string [model]="item.locText"></sv-ng-string>
</div>
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { Component, Input } from "@angular/core";
import { BaseAngular } from "../base-angular";
import { ItemValue, LocalizableString, QuestionRankingModel } from "survey-core";
import { ItemValue } from "survey-core";
import { AngularComponentFactory } from "../component-factory";

@Component({
selector: "sv-ng-ranking-item-content",
templateUrl: "./ranking-item-content.component.html"
})
export class RankingItemContentComponent {
@Input() text!: LocalizableString;
@Input() item!: ItemValue;
@Input() cssClasses: any;
}
AngularComponentFactory.Instance.registerComponent("sv-ng-ranking-item-content", RankingItemContentComponent);
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</svg>
</div></ng-template>

<ng-template [component]="{ name: question.itemContentComponent, data: { text: model.locText, cssClasses: question.cssClasses } }"></ng-template>
<ng-template [component]="{ name: question.itemContentComponent, data: { item: model, cssClasses: question.cssClasses } }"></ng-template>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<template>
<div class="sv-ranking-item__text" :style="{display: 'flex', alignItems: 'center', gap: '8px'}">
<sv-svg-icon iconName="icon-next_16x16" size = "16"></sv-svg-icon>
<survey-string :locString="text" />
<survey-string :locString="item.locText" />
</div>
</template>
<script lang="ts" setup>
defineProps<{ text: any, cssClasses: any }>()
import type { ItemValue } from 'survey-core';
defineProps<{ item: ItemValue, cssClasses: any }>()
</script>
2 changes: 1 addition & 1 deletion packages/survey-vue3-ui/src/RankingItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<use :xlink:href="question.dashSvgIcon"></use>
</svg>
</div>
<component :is="question.itemContentComponent" :text="item.locText" :cssClasses="question.cssClasses"></component>
<component :is="question.itemContentComponent" :item="item" :cssClasses="question.cssClasses"></component>
</div>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions packages/survey-vue3-ui/src/RankingItemContent.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<div :class="cssClasses.controlLabel">
<survey-string :locString="text" />
<survey-string :locString="item.locText" />
</div>
</template>

<script lang="ts" setup>
import type { LocalizableString } from "survey-core";
import type { ItemValue } from "survey-core";
defineOptions({ inheritAttrs: false });
const props = defineProps<{
text: LocalizableString;
item: ItemValue;
cssClasses: any;
}>();
</script>

0 comments on commit 368100d

Please sign in to comment.