-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: display of readonly rating on android (#81)
- Loading branch information
1 parent
a63d7dd
commit 44be31d
Showing
7 changed files
with
166 additions
and
20 deletions.
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 |
---|---|---|
@@ -1,14 +1,22 @@ | ||
import {AgnosUIAngularModule} from '@agnos-ui/angular'; | ||
import {Component} from '@angular/core'; | ||
import {Component, inject} from '@angular/core'; | ||
import heartFill from '!raw-loader!bootstrap-icons/icons/heart-fill.svg'; | ||
import {DomSanitizer} from '@angular/platform-browser'; | ||
|
||
@Component({ | ||
standalone: true, | ||
imports: [AgnosUIAngularModule], | ||
template: ` | ||
<ng-template auRatingStar #custom let-fill="fill"> | ||
<span class="star" [class.full]="fill === 100"> <span class="half" [style.width.%]="fill">♥</span>♥</span> | ||
<span class="star" [class.full]="fill === 100"> | ||
<span class="half" [style.width.%]="fill" [innerHTML]="sanitizer.bypassSecurityTrustHtml(heartFill)"></span> | ||
<span [innerHTML]="sanitizer.bypassSecurityTrustHtml(heartFill)"></span> | ||
</span> | ||
</ng-template> | ||
<au-rating class="rating-custom" [rating]="3.64" [slotStar]="custom" [readonly]="true" [maxRating]="5" ariaLabel="readonly rating" /> | ||
`, | ||
}) | ||
export default class ReadonlyRatingComponent {} | ||
export default class ReadonlyRatingComponent { | ||
readonly sanitizer = inject(DomSanitizer); | ||
readonly heartFill = heartFill; | ||
} |
File renamed without changes.
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
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
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 |
---|---|---|
@@ -1,9 +1,13 @@ | ||
<script lang="ts"> | ||
import {Rating} from '@agnos-ui/svelte'; | ||
import heartFill from 'bootstrap-icons/icons/heart-fill.svg?raw'; | ||
</script> | ||
|
||
<Rating className="rating-custom" rating={3.64} readonly={true} maxRating={5} ariaLabel="readonly rating"> | ||
<span slot="star" let:fill let:index class="star" class:full={fill === 100}> | ||
<span class="half" style:width={fill + '%'}>♥</span>♥ | ||
<!-- eslint-disable-next-line svelte/no-at-html-tags --> | ||
<span class="half" style:width={fill + '%'}>{@html heartFill}</span> | ||
<!-- eslint-disable-next-line svelte/no-at-html-tags --> | ||
<span>{@html heartFill}</span> | ||
</span> | ||
</Rating> |