@fundamental-ngx/core 0.61.2 → 0.62.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/fundamental-ngx-core-action-sheet.mjs +3 -2
- package/fesm2022/fundamental-ngx-core-action-sheet.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-avatar-group.mjs +6 -4
- package/fesm2022/fundamental-ngx-core-avatar-group.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-bar.mjs +36 -11
- package/fesm2022/fundamental-ngx-core-bar.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-breadcrumb.mjs +11 -13
- package/fesm2022/fundamental-ngx-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-busy-indicator.mjs +5 -7
- package/fesm2022/fundamental-ngx-core-busy-indicator.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-calendar.mjs +35 -31
- package/fesm2022/fundamental-ngx-core-calendar.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-carousel.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-carousel.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-combobox.mjs +6 -4
- package/fesm2022/fundamental-ngx-core-combobox.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-date-picker.mjs +3 -3
- package/fesm2022/fundamental-ngx-core-date-picker.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-datetime-picker.mjs +3 -3
- package/fesm2022/fundamental-ngx-core-datetime-picker.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-datetime.mjs +7 -13
- package/fesm2022/fundamental-ngx-core-datetime.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-dialog.mjs +19 -22
- package/fesm2022/fundamental-ngx-core-dialog.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-dynamic-page.mjs +13 -13
- package/fesm2022/fundamental-ngx-core-dynamic-page.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-facets.mjs +1 -1
- package/fesm2022/fundamental-ngx-core-facets.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-feed-list-item.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-feed-list-item.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-grid-list.mjs +4 -4
- package/fesm2022/fundamental-ngx-core-grid-list.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-info-label.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-info-label.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-link.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-link.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-list.mjs +47 -12
- package/fesm2022/fundamental-ngx-core-list.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-menu.mjs +5 -5
- package/fesm2022/fundamental-ngx-core-menu.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-message-box.mjs +10 -10
- package/fesm2022/fundamental-ngx-core-message-box.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-message-strip.mjs +44 -49
- package/fesm2022/fundamental-ngx-core-message-strip.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-multi-combobox.mjs +25 -23
- package/fesm2022/fundamental-ngx-core-multi-combobox.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-multi-input.mjs +6 -8
- package/fesm2022/fundamental-ngx-core-multi-input.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-nested-list.mjs +22 -21
- package/fesm2022/fundamental-ngx-core-nested-list.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-notification.mjs +13 -16
- package/fesm2022/fundamental-ngx-core-notification.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-object-identifier.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-object-identifier.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-object-number.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-object-number.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-object-status.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-object-status.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-overflow-layout.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-overflow-layout.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-pagination.mjs +11 -14
- package/fesm2022/fundamental-ngx-core-pagination.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-popover.mjs +5 -5
- package/fesm2022/fundamental-ngx-core-popover.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-product-switch.mjs +8 -4
- package/fesm2022/fundamental-ngx-core-product-switch.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-quick-view.mjs +3 -3
- package/fesm2022/fundamental-ngx-core-quick-view.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-rating-indicator.mjs +4 -7
- package/fesm2022/fundamental-ngx-core-rating-indicator.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-segmented-button.mjs +10 -11
- package/fesm2022/fundamental-ngx-core-segmented-button.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-select.mjs +15 -8
- package/fesm2022/fundamental-ngx-core-select.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-settings.mjs +1 -1
- package/fesm2022/fundamental-ngx-core-settings.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-shellbar.mjs +44 -27
- package/fesm2022/fundamental-ngx-core-shellbar.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-slider.mjs +6 -6
- package/fesm2022/fundamental-ngx-core-slider.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-split-button.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-split-button.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-step-input.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-step-input.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-switch.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-switch.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-tabs.mjs +2 -2
- package/fesm2022/fundamental-ngx-core-tabs.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-text.mjs +6 -4
- package/fesm2022/fundamental-ngx-core-text.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-time-picker.mjs +4 -29
- package/fesm2022/fundamental-ngx-core-time-picker.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-time.mjs +4 -4
- package/fesm2022/fundamental-ngx-core-time.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-timeline.mjs +1 -1
- package/fesm2022/fundamental-ngx-core-timeline.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-title.mjs +7 -4
- package/fesm2022/fundamental-ngx-core-title.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-token.mjs +12 -15
- package/fesm2022/fundamental-ngx-core-token.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-toolbar.mjs +5 -3
- package/fesm2022/fundamental-ngx-core-toolbar.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-tree.mjs +4 -4
- package/fesm2022/fundamental-ngx-core-tree.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-upload-collection.mjs +5 -5
- package/fesm2022/fundamental-ngx-core-upload-collection.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-user-menu.mjs +6 -4
- package/fesm2022/fundamental-ngx-core-user-menu.mjs.map +1 -1
- package/fesm2022/fundamental-ngx-core-vertical-navigation.mjs +3 -3
- package/fesm2022/fundamental-ngx-core-vertical-navigation.mjs.map +1 -1
- package/package.json +3 -3
- package/types/fundamental-ngx-core-bar.d.ts +14 -4
- package/types/fundamental-ngx-core-breadcrumb.d.ts +5 -5
- package/types/fundamental-ngx-core-busy-indicator.d.ts +3 -3
- package/types/fundamental-ngx-core-combobox.d.ts +4 -2
- package/types/fundamental-ngx-core-datetime.d.ts +1 -5
- package/types/fundamental-ngx-core-dialog.d.ts +4 -2
- package/types/fundamental-ngx-core-dynamic-page.d.ts +1 -2
- package/types/fundamental-ngx-core-list.d.ts +24 -5
- package/types/fundamental-ngx-core-menu.d.ts +2 -0
- package/types/fundamental-ngx-core-message-box.d.ts +1 -1
- package/types/fundamental-ngx-core-message-strip.d.ts +3 -12
- package/types/fundamental-ngx-core-multi-combobox.d.ts +1 -1
- package/types/fundamental-ngx-core-nested-list.d.ts +10 -10
- package/types/fundamental-ngx-core-notification.d.ts +5 -7
- package/types/fundamental-ngx-core-pagination.d.ts +3 -4
- package/types/fundamental-ngx-core-product-switch.d.ts +3 -0
- package/types/fundamental-ngx-core-rating-indicator.d.ts +3 -2
- package/types/fundamental-ngx-core-segmented-button.d.ts +3 -5
- package/types/fundamental-ngx-core-select.d.ts +5 -1
- package/types/fundamental-ngx-core-shared.d.ts +21 -20
- package/types/fundamental-ngx-core-shellbar.d.ts +7 -1
- package/types/fundamental-ngx-core-slider.d.ts +1 -1
- package/types/fundamental-ngx-core-text.d.ts +3 -1
- package/types/fundamental-ngx-core-time-picker.d.ts +1 -17
- package/types/fundamental-ngx-core-title.d.ts +3 -1
- package/types/fundamental-ngx-core-token.d.ts +4 -4
|
@@ -2,11 +2,10 @@ import { coerceNumberProperty } from '@angular/cdk/coercion';
|
|
|
2
2
|
import { NgTemplateOutlet } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { Pipe, input, booleanAttribute, output, inject, ElementRef, computed, signal, effect, forwardRef, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
5
|
-
import { toSignal } from '@angular/core/rxjs-interop';
|
|
6
5
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
6
|
import { registerFormItemControl } from '@fundamental-ngx/core/form';
|
|
8
7
|
import { PopoverTriggerDirective, PopoverComponent } from '@fundamental-ngx/core/popover';
|
|
9
|
-
import { TranslationResolver,
|
|
8
|
+
import { TranslationResolver, FD_LANGUAGE_SIGNAL, FdTranslatePipe } from '@fundamental-ngx/i18n';
|
|
10
9
|
|
|
11
10
|
const INDICATOR_PREFIX = 'fd-rating-indicator';
|
|
12
11
|
const INDICATOR_CLASSES = {
|
|
@@ -143,9 +142,7 @@ class RatingIndicatorComponent {
|
|
|
143
142
|
/** Computed display value - returns the current internal value */
|
|
144
143
|
this.displayValue = computed(() => this.internalValue(), ...(ngDevMode ? [{ debugName: "displayValue" }] : []));
|
|
145
144
|
/** @hidden Current language signal for i18n */
|
|
146
|
-
this.language =
|
|
147
|
-
initialValue: {}
|
|
148
|
-
});
|
|
145
|
+
this.language = inject(FD_LANGUAGE_SIGNAL);
|
|
149
146
|
/** @hidden Internal mutable value for CVA and computed display value */
|
|
150
147
|
this.internalValue = signal(0, ...(ngDevMode ? [{ debugName: "internalValue" }] : []));
|
|
151
148
|
/**
|
|
@@ -350,7 +347,7 @@ class RatingIndicatorComponent {
|
|
|
350
347
|
multi: true
|
|
351
348
|
},
|
|
352
349
|
registerFormItemControl(RatingIndicatorComponent)
|
|
353
|
-
], ngImport: i0, template: "<ng-template #zeroRate let-halves=\"halves\">\n <input\n [attr.aria-label]=\"'coreRatingIndicator.ariaLabelReset' | fdTranslate\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n (change)=\"onSelect(0)\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n name=\"rating-{{ ratingUID }}{{ halves ? '-halves' : '' }}\"\n [attr.checked]=\"displayValue() === 0 ? true : null\"\n value=\"0\"\n />\n <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!-- role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div\n class=\"fd-rating-indicator__container\"\n role=\"application\"\n [attr.aria-roledescription]=\"ariaRoledescription() || ('coreRatingIndicator.ariaRoleDescription' | fdTranslate)\"\n>\n <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n <!-- Available rate values -->\n @for (rate of rates(); track rate.id; let i = $index) {\n <input\n [attr.aria-label]=\"i | ratingStarLabel: rates().length : allowHalves() : language()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n [id]=\"rate.id\"\n name=\"rating-{{ ratingUID }}\"\n [value]=\"rate.value\"\n [attr.checked]=\"displayValue() === rate.value ? true : null\"\n (change)=\"onSelect(rate.value)\"\n />\n <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (showDynamicText()) {\n @if (displayAllRatings() && ratingItems().length) {\n <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n (<span [attr.aria-label]=\"'coreRatingIndicator.ariaLabelTotalRating' | fdTranslate\" fd-link>{{\n computedTotalRatings\n }}</span\n >)\n </span>\n } @else if (computedTotalRatings !== undefined && computedTotalRatings !== null) {\n <span class=\"fd-rating-indicator__dynamic-text\">({{ computedTotalRatings }})</span>\n } @else {\n <span class=\"fd-rating-indicator__dynamic-text\"\n >({{ displayValue() }} {{ dynamicTextIndicator() }} {{ indicatorCapacity() }})</span\n >\n }\n}\n<fd-popover\n #allRatingContent\n [triggers]=\"['mouseenter', 'mouseleave']\"\n [noArrow]=\"false\"\n placement=\"top\"\n additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n @for (rating of ratingItems(); track rating) {\n <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass()\">\n <div class=\"fd-rating-indicator__container\">\n @for (rate of rates(); track rate.id) {\n <span\n [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n class=\"fd-rating-indicator__input\"\n ></span>\n <label class=\"fd-rating-indicator__label\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n </div>\n ({{ rating.votes }})\n </div>\n }\n</fd-popover>\n", styles: [".fd-rating-indicator{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;position:relative}.fd-rating-indicator:after,.fd-rating-indicator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--cozy{--fontSize:1.5rem;--spacingBetweenIcons:.1875rem;margin-block:.8125rem;margin-inline:0}.fd-rating-indicator--compact{margin-block:.5rem;margin-inline:0}.fd-rating-indicator--compact,.fd-rating-indicator--condensed{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--xs{--fontSize:.75rem;--spacingBetweenIcons:1px}.fd-rating-indicator--sm{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--md{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem}.fd-rating-indicator--lg{--fontSize:2rem;--spacingBetweenIcons:.25rem}.fd-rating-indicator__container{border:0;border-radius:var(--fdRating_Indicator_Border_Radius);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-rating-indicator__container:after,.fd-rating-indicator__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__container:focus-within{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdRating_Indicator_Focus_Outline_Offset,0)}.fd-rating-indicator__container:focus-within .fd-rating-indicator__input,.fd-rating-indicator__container:focus-within .fd-rating-indicator__label{outline:none!important}.fd-rating-indicator__input{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fontSize);line-height:normal;margin-block:0;margin-inline:0;opacity:.0001;padding-block:0;padding-inline:0;position:absolute;top:0;width:var(--fontSize);z-index:-1}.fd-rating-indicator__input:after,.fd-rating-indicator__input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__input:checked.is-focus,.fd-rating-indicator__input:checked:focus{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth)}.fd-rating-indicator__input:checked.is-focus+.fd-rating-indicator__label,.fd-rating-indicator__input:checked:focus+.fd-rating-indicator__label{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:0}.fd-rating-indicator__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;float:left;height:var(--fontSize);opacity:1;-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons)}.fd-rating-indicator__label:after,.fd-rating-indicator__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__label:before{color:var(--sapContent_RatedColor);content:\"\\e065\";font-family:SAP-icons;font-size:var(--fontSize)}.fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator__label:hover:before{opacity:var(--fdRating_Indicator_Selected_Hover_Opacity);-webkit-transition:opacity .125s ease-in;transition:opacity .125s ease-in}.fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e0a1\"}.fd-rating-indicator__dynamic-text{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontSmallSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;white-space:nowrap;-webkit-margin-start:.5rem;margin-inline-start:.5rem}.fd-rating-indicator__dynamic-text:after,.fd-rating-indicator__dynamic-text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--hide-dynamic-text>.fd-rating-indicator__dynamic-text{display:none}.fd-rating-indicator[dir=rtl] .fd-rating-indicator__label,[dir=rtl] .fd-rating-indicator .fd-rating-indicator__label{float:right}.fd-rating-indicator.is-disabled,.fd-rating-indicator:disabled,.fd-rating-indicator[aria-disabled=true]{opacity:var(--fdRating_Indicator_Disabled_Control_Opacity);pointer-events:none}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:before{color:var(--fdRating_Indicator_Disabled_Selected_Color);content:\"\\e065\"}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Disabled_Unselected_Color);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--display-mode{--fontSize:1rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label{-webkit-margin-end:.125rem;margin-inline-end:.125rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Display_Only_Selected_Color);content:\"\\e065\";font-size:var(--fontSize)}.fd-rating-indicator--display-mode,.fd-rating-indicator--non-interactive{pointer-events:none}.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--icon .fd-rating-indicator__label{height:var(--fontSize);width:var(--fontSize)}.fd-rating-indicator--icon .fd-rating-indicator__label:after,.fd-rating-indicator--icon .fd-rating-indicator__label:before{content:none!important}.fd-rating-indicator--icon .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{font-size:var(--fontSize);height:100%;line-height:1}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{display:none}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated{display:block}.fd-rating-indicator--half-star .fd-rating-indicator__input{height:var(--fontSize);width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label{-webkit-margin-end:0;margin-inline-end:0;overflow:hidden;width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label:nth-child(4n+6){-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons);-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fd-rating-indicator--half-star .fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator--half-star .fd-rating-indicator--icon .fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before{font-size:var(--fontSize)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before{font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__input--zero-rating,.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__label--zero-rating,.fd-rating-indicator__input--zero-rating,.fd-rating-indicator__label--zero-rating{margin-block:0;margin-inline:0;opacity:.0001;overflow:hidden;padding-block:0;padding-inline:0;width:0}.fd-rating-indicator__popover{padding:.5rem 0!important}.fd-rating-indicator__popover .fd-rating-indicator__sum-row{display:flex;align-items:center;padding:.5rem 1rem;margin:0}.fd-rating-indicator__popover .fd-rating-indicator__sum-row .fd-rating-indicator__container{margin-right:.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/rating-indicator.css:\n (*!\n * Fundamental Library Styles v0.40.1\n * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n *)\n*/\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PopoverTriggerDirective, selector: "[fdPopoverTrigger], [fd-popover-trigger]", inputs: ["fdPopoverTrigger"] }, { kind: "component", type: PopoverComponent, selector: "fd-popover", inputs: ["config", "title", "trigger", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll", "placement", "maxWidth", "fillControlMode", "closeOnOutsideClick", "closeOnEscapeKey", "disabled", "triggers", "focusTrapped", "focusAutoCapture", "restoreFocusOnClose", "noArrow", "disableScrollbar", "appendTo", "placementContainer", "scrollStrategy", "cdkPositions", "applyOverlay", "additionalBodyClass", "additionalTriggerClass", "closeOnNavigation", "fixedPosition", "resizable", "isOpen"], outputs: ["triggerChange", "isOpenChange", "beforeOpen"] }, { kind: "pipe", type: RatingStarLabelPipe, name: "ratingStarLabel" }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
350
|
+
], ngImport: i0, template: "<ng-template #zeroRate let-halves=\"halves\">\n <input\n [attr.aria-label]=\"('coreRatingIndicator.ariaLabelReset' | fdTranslate)()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n (change)=\"onSelect(0)\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n name=\"rating-{{ ratingUID }}{{ halves ? '-halves' : '' }}\"\n [attr.checked]=\"displayValue() === 0 ? true : null\"\n value=\"0\"\n />\n <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!-- role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div\n class=\"fd-rating-indicator__container\"\n role=\"application\"\n [attr.aria-roledescription]=\"ariaRoledescription() || ('coreRatingIndicator.ariaRoleDescription' | fdTranslate)()\"\n>\n <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n <!-- Available rate values -->\n @for (rate of rates(); track rate.id; let i = $index) {\n <input\n [attr.aria-label]=\"i | ratingStarLabel: rates().length : allowHalves() : language()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n [id]=\"rate.id\"\n name=\"rating-{{ ratingUID }}\"\n [value]=\"rate.value\"\n [attr.checked]=\"displayValue() === rate.value ? true : null\"\n (change)=\"onSelect(rate.value)\"\n />\n <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (showDynamicText()) {\n @if (displayAllRatings() && ratingItems().length) {\n <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n (<span [attr.aria-label]=\"('coreRatingIndicator.ariaLabelTotalRating' | fdTranslate)()\" fd-link>{{\n computedTotalRatings\n }}</span\n >)\n </span>\n } @else if (computedTotalRatings !== undefined && computedTotalRatings !== null) {\n <span class=\"fd-rating-indicator__dynamic-text\">({{ computedTotalRatings }})</span>\n } @else {\n <span class=\"fd-rating-indicator__dynamic-text\"\n >({{ displayValue() }} {{ dynamicTextIndicator() }} {{ indicatorCapacity() }})</span\n >\n }\n}\n<fd-popover\n #allRatingContent\n [triggers]=\"['mouseenter', 'mouseleave']\"\n [noArrow]=\"false\"\n placement=\"top\"\n additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n @for (rating of ratingItems(); track rating) {\n <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass()\">\n <div class=\"fd-rating-indicator__container\">\n @for (rate of rates(); track rate.id) {\n <span\n [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n class=\"fd-rating-indicator__input\"\n ></span>\n <label class=\"fd-rating-indicator__label\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n </div>\n ({{ rating.votes }})\n </div>\n }\n</fd-popover>\n", styles: [".fd-rating-indicator{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;position:relative}.fd-rating-indicator:after,.fd-rating-indicator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--cozy{--fontSize:1.5rem;--spacingBetweenIcons:.1875rem;margin-block:.8125rem;margin-inline:0}.fd-rating-indicator--compact{margin-block:.5rem;margin-inline:0}.fd-rating-indicator--compact,.fd-rating-indicator--condensed{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--xs{--fontSize:.75rem;--spacingBetweenIcons:1px}.fd-rating-indicator--sm{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--md{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem}.fd-rating-indicator--lg{--fontSize:2rem;--spacingBetweenIcons:.25rem}.fd-rating-indicator__container{border:0;border-radius:var(--fdRating_Indicator_Border_Radius);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-rating-indicator__container:after,.fd-rating-indicator__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__container:focus-within{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdRating_Indicator_Focus_Outline_Offset,0)}.fd-rating-indicator__container:focus-within .fd-rating-indicator__input,.fd-rating-indicator__container:focus-within .fd-rating-indicator__label{outline:none!important}.fd-rating-indicator__input{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fontSize);line-height:normal;margin-block:0;margin-inline:0;opacity:.0001;padding-block:0;padding-inline:0;position:absolute;top:0;width:var(--fontSize);z-index:-1}.fd-rating-indicator__input:after,.fd-rating-indicator__input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__input:checked.is-focus,.fd-rating-indicator__input:checked:focus{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth)}.fd-rating-indicator__input:checked.is-focus+.fd-rating-indicator__label,.fd-rating-indicator__input:checked:focus+.fd-rating-indicator__label{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:0}.fd-rating-indicator__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;float:left;height:var(--fontSize);opacity:1;-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons)}.fd-rating-indicator__label:after,.fd-rating-indicator__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__label:before{color:var(--sapContent_RatedColor);content:\"\\e065\";font-family:SAP-icons;font-size:var(--fontSize)}.fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator__label:hover:before{opacity:var(--fdRating_Indicator_Selected_Hover_Opacity);-webkit-transition:opacity .125s ease-in;transition:opacity .125s ease-in}.fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e0a1\"}.fd-rating-indicator__dynamic-text{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontSmallSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;white-space:nowrap;-webkit-margin-start:.5rem;margin-inline-start:.5rem}.fd-rating-indicator__dynamic-text:after,.fd-rating-indicator__dynamic-text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--hide-dynamic-text>.fd-rating-indicator__dynamic-text{display:none}.fd-rating-indicator[dir=rtl] .fd-rating-indicator__label,[dir=rtl] .fd-rating-indicator .fd-rating-indicator__label{float:right}.fd-rating-indicator.is-disabled,.fd-rating-indicator:disabled,.fd-rating-indicator[aria-disabled=true]{opacity:var(--fdRating_Indicator_Disabled_Control_Opacity);pointer-events:none}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:before{color:var(--fdRating_Indicator_Disabled_Selected_Color);content:\"\\e065\"}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Disabled_Unselected_Color);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--display-mode{--fontSize:1rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label{-webkit-margin-end:.125rem;margin-inline-end:.125rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Display_Only_Selected_Color);content:\"\\e065\";font-size:var(--fontSize)}.fd-rating-indicator--display-mode,.fd-rating-indicator--non-interactive{pointer-events:none}.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--icon .fd-rating-indicator__label{height:var(--fontSize);width:var(--fontSize)}.fd-rating-indicator--icon .fd-rating-indicator__label:after,.fd-rating-indicator--icon .fd-rating-indicator__label:before{content:none!important}.fd-rating-indicator--icon .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{font-size:var(--fontSize);height:100%;line-height:1}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{display:none}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated{display:block}.fd-rating-indicator--half-star .fd-rating-indicator__input{height:var(--fontSize);width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label{-webkit-margin-end:0;margin-inline-end:0;overflow:hidden;width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label:nth-child(4n+6){-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons);-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fd-rating-indicator--half-star .fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator--half-star .fd-rating-indicator--icon .fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before{font-size:var(--fontSize)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before{font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__input--zero-rating,.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__label--zero-rating,.fd-rating-indicator__input--zero-rating,.fd-rating-indicator__label--zero-rating{margin-block:0;margin-inline:0;opacity:.0001;overflow:hidden;padding-block:0;padding-inline:0;width:0}.fd-rating-indicator__popover{padding:.5rem 0!important}.fd-rating-indicator__popover .fd-rating-indicator__sum-row{display:flex;align-items:center;padding:.5rem 1rem;margin:0}.fd-rating-indicator__popover .fd-rating-indicator__sum-row .fd-rating-indicator__container{margin-right:.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/rating-indicator.css:\n (*!\n * Fundamental Library Styles v0.40.1\n * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n *)\n*/\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PopoverTriggerDirective, selector: "[fdPopoverTrigger], [fd-popover-trigger]", inputs: ["fdPopoverTrigger"] }, { kind: "component", type: PopoverComponent, selector: "fd-popover", inputs: ["config", "title", "trigger", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll", "placement", "maxWidth", "fillControlMode", "closeOnOutsideClick", "closeOnEscapeKey", "disabled", "triggers", "focusTrapped", "focusAutoCapture", "restoreFocusOnClose", "noArrow", "disableScrollbar", "appendTo", "placementContainer", "scrollStrategy", "cdkPositions", "applyOverlay", "additionalBodyClass", "additionalTriggerClass", "closeOnNavigation", "fixedPosition", "resizable", "isOpen"], outputs: ["triggerChange", "isOpenChange", "beforeOpen"] }, { kind: "pipe", type: RatingStarLabelPipe, name: "ratingStarLabel" }, { kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
354
351
|
}
|
|
355
352
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: RatingIndicatorComponent, decorators: [{
|
|
356
353
|
type: Component,
|
|
@@ -366,7 +363,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
366
363
|
'[attr.aria-label]': 'ariaLabel()',
|
|
367
364
|
'[attr.aria-labelledby]': 'ariaLabelledBy()',
|
|
368
365
|
'[attr.disabled]': 'disabled()'
|
|
369
|
-
}, template: "<ng-template #zeroRate let-halves=\"halves\">\n <input\n [attr.aria-label]=\"'coreRatingIndicator.ariaLabelReset' | fdTranslate\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n (change)=\"onSelect(0)\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n name=\"rating-{{ ratingUID }}{{ halves ? '-halves' : '' }}\"\n [attr.checked]=\"displayValue() === 0 ? true : null\"\n value=\"0\"\n />\n <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!-- role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div\n class=\"fd-rating-indicator__container\"\n role=\"application\"\n [attr.aria-roledescription]=\"ariaRoledescription() || ('coreRatingIndicator.ariaRoleDescription' | fdTranslate)\"\n>\n <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n <!-- Available rate values -->\n @for (rate of rates(); track rate.id; let i = $index) {\n <input\n [attr.aria-label]=\"i | ratingStarLabel: rates().length : allowHalves() : language()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n [id]=\"rate.id\"\n name=\"rating-{{ ratingUID }}\"\n [value]=\"rate.value\"\n [attr.checked]=\"displayValue() === rate.value ? true : null\"\n (change)=\"onSelect(rate.value)\"\n />\n <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (showDynamicText()) {\n @if (displayAllRatings() && ratingItems().length) {\n <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n (<span [attr.aria-label]=\"'coreRatingIndicator.ariaLabelTotalRating' | fdTranslate\" fd-link>{{\n computedTotalRatings\n }}</span\n >)\n </span>\n } @else if (computedTotalRatings !== undefined && computedTotalRatings !== null) {\n <span class=\"fd-rating-indicator__dynamic-text\">({{ computedTotalRatings }})</span>\n } @else {\n <span class=\"fd-rating-indicator__dynamic-text\"\n >({{ displayValue() }} {{ dynamicTextIndicator() }} {{ indicatorCapacity() }})</span\n >\n }\n}\n<fd-popover\n #allRatingContent\n [triggers]=\"['mouseenter', 'mouseleave']\"\n [noArrow]=\"false\"\n placement=\"top\"\n additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n @for (rating of ratingItems(); track rating) {\n <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass()\">\n <div class=\"fd-rating-indicator__container\">\n @for (rate of rates(); track rate.id) {\n <span\n [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n class=\"fd-rating-indicator__input\"\n ></span>\n <label class=\"fd-rating-indicator__label\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n </div>\n ({{ rating.votes }})\n </div>\n }\n</fd-popover>\n", styles: [".fd-rating-indicator{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;position:relative}.fd-rating-indicator:after,.fd-rating-indicator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--cozy{--fontSize:1.5rem;--spacingBetweenIcons:.1875rem;margin-block:.8125rem;margin-inline:0}.fd-rating-indicator--compact{margin-block:.5rem;margin-inline:0}.fd-rating-indicator--compact,.fd-rating-indicator--condensed{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--xs{--fontSize:.75rem;--spacingBetweenIcons:1px}.fd-rating-indicator--sm{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--md{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem}.fd-rating-indicator--lg{--fontSize:2rem;--spacingBetweenIcons:.25rem}.fd-rating-indicator__container{border:0;border-radius:var(--fdRating_Indicator_Border_Radius);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-rating-indicator__container:after,.fd-rating-indicator__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__container:focus-within{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdRating_Indicator_Focus_Outline_Offset,0)}.fd-rating-indicator__container:focus-within .fd-rating-indicator__input,.fd-rating-indicator__container:focus-within .fd-rating-indicator__label{outline:none!important}.fd-rating-indicator__input{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fontSize);line-height:normal;margin-block:0;margin-inline:0;opacity:.0001;padding-block:0;padding-inline:0;position:absolute;top:0;width:var(--fontSize);z-index:-1}.fd-rating-indicator__input:after,.fd-rating-indicator__input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__input:checked.is-focus,.fd-rating-indicator__input:checked:focus{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth)}.fd-rating-indicator__input:checked.is-focus+.fd-rating-indicator__label,.fd-rating-indicator__input:checked:focus+.fd-rating-indicator__label{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:0}.fd-rating-indicator__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;float:left;height:var(--fontSize);opacity:1;-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons)}.fd-rating-indicator__label:after,.fd-rating-indicator__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__label:before{color:var(--sapContent_RatedColor);content:\"\\e065\";font-family:SAP-icons;font-size:var(--fontSize)}.fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator__label:hover:before{opacity:var(--fdRating_Indicator_Selected_Hover_Opacity);-webkit-transition:opacity .125s ease-in;transition:opacity .125s ease-in}.fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e0a1\"}.fd-rating-indicator__dynamic-text{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontSmallSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;white-space:nowrap;-webkit-margin-start:.5rem;margin-inline-start:.5rem}.fd-rating-indicator__dynamic-text:after,.fd-rating-indicator__dynamic-text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--hide-dynamic-text>.fd-rating-indicator__dynamic-text{display:none}.fd-rating-indicator[dir=rtl] .fd-rating-indicator__label,[dir=rtl] .fd-rating-indicator .fd-rating-indicator__label{float:right}.fd-rating-indicator.is-disabled,.fd-rating-indicator:disabled,.fd-rating-indicator[aria-disabled=true]{opacity:var(--fdRating_Indicator_Disabled_Control_Opacity);pointer-events:none}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:before{color:var(--fdRating_Indicator_Disabled_Selected_Color);content:\"\\e065\"}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Disabled_Unselected_Color);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--display-mode{--fontSize:1rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label{-webkit-margin-end:.125rem;margin-inline-end:.125rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Display_Only_Selected_Color);content:\"\\e065\";font-size:var(--fontSize)}.fd-rating-indicator--display-mode,.fd-rating-indicator--non-interactive{pointer-events:none}.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--icon .fd-rating-indicator__label{height:var(--fontSize);width:var(--fontSize)}.fd-rating-indicator--icon .fd-rating-indicator__label:after,.fd-rating-indicator--icon .fd-rating-indicator__label:before{content:none!important}.fd-rating-indicator--icon .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{font-size:var(--fontSize);height:100%;line-height:1}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{display:none}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated{display:block}.fd-rating-indicator--half-star .fd-rating-indicator__input{height:var(--fontSize);width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label{-webkit-margin-end:0;margin-inline-end:0;overflow:hidden;width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label:nth-child(4n+6){-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons);-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fd-rating-indicator--half-star .fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator--half-star .fd-rating-indicator--icon .fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before{font-size:var(--fontSize)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before{font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__input--zero-rating,.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__label--zero-rating,.fd-rating-indicator__input--zero-rating,.fd-rating-indicator__label--zero-rating{margin-block:0;margin-inline:0;opacity:.0001;overflow:hidden;padding-block:0;padding-inline:0;width:0}.fd-rating-indicator__popover{padding:.5rem 0!important}.fd-rating-indicator__popover .fd-rating-indicator__sum-row{display:flex;align-items:center;padding:.5rem 1rem;margin:0}.fd-rating-indicator__popover .fd-rating-indicator__sum-row .fd-rating-indicator__container{margin-right:.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/rating-indicator.css:\n (*!\n * Fundamental Library Styles v0.40.1\n * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n *)\n*/\n"] }]
|
|
366
|
+
}, template: "<ng-template #zeroRate let-halves=\"halves\">\n <input\n [attr.aria-label]=\"('coreRatingIndicator.ariaLabelReset' | fdTranslate)()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n (change)=\"onSelect(0)\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n name=\"rating-{{ ratingUID }}{{ halves ? '-halves' : '' }}\"\n [attr.checked]=\"displayValue() === 0 ? true : null\"\n value=\"0\"\n />\n <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!-- role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div\n class=\"fd-rating-indicator__container\"\n role=\"application\"\n [attr.aria-roledescription]=\"ariaRoledescription() || ('coreRatingIndicator.ariaRoleDescription' | fdTranslate)()\"\n>\n <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n <!-- Available rate values -->\n @for (rate of rates(); track rate.id; let i = $index) {\n <input\n [attr.aria-label]=\"i | ratingStarLabel: rates().length : allowHalves() : language()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n [id]=\"rate.id\"\n name=\"rating-{{ ratingUID }}\"\n [value]=\"rate.value\"\n [attr.checked]=\"displayValue() === rate.value ? true : null\"\n (change)=\"onSelect(rate.value)\"\n />\n <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (showDynamicText()) {\n @if (displayAllRatings() && ratingItems().length) {\n <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n (<span [attr.aria-label]=\"('coreRatingIndicator.ariaLabelTotalRating' | fdTranslate)()\" fd-link>{{\n computedTotalRatings\n }}</span\n >)\n </span>\n } @else if (computedTotalRatings !== undefined && computedTotalRatings !== null) {\n <span class=\"fd-rating-indicator__dynamic-text\">({{ computedTotalRatings }})</span>\n } @else {\n <span class=\"fd-rating-indicator__dynamic-text\"\n >({{ displayValue() }} {{ dynamicTextIndicator() }} {{ indicatorCapacity() }})</span\n >\n }\n}\n<fd-popover\n #allRatingContent\n [triggers]=\"['mouseenter', 'mouseleave']\"\n [noArrow]=\"false\"\n placement=\"top\"\n additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n @for (rating of ratingItems(); track rating) {\n <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass()\">\n <div class=\"fd-rating-indicator__container\">\n @for (rate of rates(); track rate.id) {\n <span\n [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n class=\"fd-rating-indicator__input\"\n ></span>\n <label class=\"fd-rating-indicator__label\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n </div>\n ({{ rating.votes }})\n </div>\n }\n</fd-popover>\n", styles: [".fd-rating-indicator{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;position:relative}.fd-rating-indicator:after,.fd-rating-indicator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--cozy{--fontSize:1.5rem;--spacingBetweenIcons:.1875rem;margin-block:.8125rem;margin-inline:0}.fd-rating-indicator--compact{margin-block:.5rem;margin-inline:0}.fd-rating-indicator--compact,.fd-rating-indicator--condensed{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--xs{--fontSize:.75rem;--spacingBetweenIcons:1px}.fd-rating-indicator--sm{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--md{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem}.fd-rating-indicator--lg{--fontSize:2rem;--spacingBetweenIcons:.25rem}.fd-rating-indicator__container{border:0;border-radius:var(--fdRating_Indicator_Border_Radius);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-rating-indicator__container:after,.fd-rating-indicator__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__container:focus-within{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdRating_Indicator_Focus_Outline_Offset,0)}.fd-rating-indicator__container:focus-within .fd-rating-indicator__input,.fd-rating-indicator__container:focus-within .fd-rating-indicator__label{outline:none!important}.fd-rating-indicator__input{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fontSize);line-height:normal;margin-block:0;margin-inline:0;opacity:.0001;padding-block:0;padding-inline:0;position:absolute;top:0;width:var(--fontSize);z-index:-1}.fd-rating-indicator__input:after,.fd-rating-indicator__input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__input:checked.is-focus,.fd-rating-indicator__input:checked:focus{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth)}.fd-rating-indicator__input:checked.is-focus+.fd-rating-indicator__label,.fd-rating-indicator__input:checked:focus+.fd-rating-indicator__label{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:0}.fd-rating-indicator__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;float:left;height:var(--fontSize);opacity:1;-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons)}.fd-rating-indicator__label:after,.fd-rating-indicator__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__label:before{color:var(--sapContent_RatedColor);content:\"\\e065\";font-family:SAP-icons;font-size:var(--fontSize)}.fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator__label:hover:before{opacity:var(--fdRating_Indicator_Selected_Hover_Opacity);-webkit-transition:opacity .125s ease-in;transition:opacity .125s ease-in}.fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e0a1\"}.fd-rating-indicator__dynamic-text{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontSmallSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;white-space:nowrap;-webkit-margin-start:.5rem;margin-inline-start:.5rem}.fd-rating-indicator__dynamic-text:after,.fd-rating-indicator__dynamic-text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--hide-dynamic-text>.fd-rating-indicator__dynamic-text{display:none}.fd-rating-indicator[dir=rtl] .fd-rating-indicator__label,[dir=rtl] .fd-rating-indicator .fd-rating-indicator__label{float:right}.fd-rating-indicator.is-disabled,.fd-rating-indicator:disabled,.fd-rating-indicator[aria-disabled=true]{opacity:var(--fdRating_Indicator_Disabled_Control_Opacity);pointer-events:none}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:before{color:var(--fdRating_Indicator_Disabled_Selected_Color);content:\"\\e065\"}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Disabled_Unselected_Color);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--display-mode{--fontSize:1rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label{-webkit-margin-end:.125rem;margin-inline-end:.125rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Display_Only_Selected_Color);content:\"\\e065\";font-size:var(--fontSize)}.fd-rating-indicator--display-mode,.fd-rating-indicator--non-interactive{pointer-events:none}.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--icon .fd-rating-indicator__label{height:var(--fontSize);width:var(--fontSize)}.fd-rating-indicator--icon .fd-rating-indicator__label:after,.fd-rating-indicator--icon .fd-rating-indicator__label:before{content:none!important}.fd-rating-indicator--icon .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{font-size:var(--fontSize);height:100%;line-height:1}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{display:none}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated{display:block}.fd-rating-indicator--half-star .fd-rating-indicator__input{height:var(--fontSize);width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label{-webkit-margin-end:0;margin-inline-end:0;overflow:hidden;width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label:nth-child(4n+6){-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons);-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fd-rating-indicator--half-star .fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator--half-star .fd-rating-indicator--icon .fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before{font-size:var(--fontSize)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before{font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__input--zero-rating,.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__label--zero-rating,.fd-rating-indicator__input--zero-rating,.fd-rating-indicator__label--zero-rating{margin-block:0;margin-inline:0;opacity:.0001;overflow:hidden;padding-block:0;padding-inline:0;width:0}.fd-rating-indicator__popover{padding:.5rem 0!important}.fd-rating-indicator__popover .fd-rating-indicator__sum-row{display:flex;align-items:center;padding:.5rem 1rem;margin:0}.fd-rating-indicator__popover .fd-rating-indicator__sum-row .fd-rating-indicator__container{margin-right:.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/rating-indicator.css:\n (*!\n * Fundamental Library Styles v0.40.1\n * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n *)\n*/\n"] }]
|
|
370
367
|
}], ctorParameters: () => [], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelledBy", required: false }] }], ariaRoledescription: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaRoledescription", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], displayMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayMode", required: false }] }], nonInteractive: [{ type: i0.Input, args: [{ isSignal: true, alias: "nonInteractive", required: false }] }], indicatorCapacity: [{ type: i0.Input, args: [{ isSignal: true, alias: "indicatorCapacity", required: false }] }], allowHalves: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowHalves", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], totalRatings: [{ type: i0.Input, args: [{ isSignal: true, alias: "totalRatings", required: false }] }], ratingAverage: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratingAverage", required: false }] }], ratings: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratings", required: false }] }], displayAllRatings: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayAllRatings", required: false }] }], ratedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratedIcon", required: false }] }], unratedIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "unratedIcon", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], dynamicTextIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "dynamicTextIndicator", required: false }] }], showDynamicText: [{ type: i0.Input, args: [{ isSignal: true, alias: "showDynamicText", required: false }] }], ratingChanged: [{ type: i0.Output, args: ["ratingChanged"] }] } });
|
|
371
368
|
|
|
372
369
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fundamental-ngx-core-rating-indicator.mjs","sources":["../../../../libs/core/rating-indicator/constants.ts","../../../../libs/core/rating-indicator/pipes/rating-star-label.pipe.ts","../../../../libs/core/rating-indicator/components/rating-indicator.component.ts","../../../../libs/core/rating-indicator/components/rating-indicator.component.html","../../../../libs/core/rating-indicator/rating-indicator.module.ts","../../../../libs/core/rating-indicator/fundamental-ngx-core-rating-indicator.ts"],"sourcesContent":["export const INDICATOR_PREFIX = 'fd-rating-indicator';\n\nexport const INDICATOR_CLASSES = {\n halves: `${INDICATOR_PREFIX}--half-star`,\n icon: `${INDICATOR_PREFIX}--icon`,\n hideDynamicText: `${INDICATOR_PREFIX}--hide-dynamic-text`\n};\nexport const INDICATOR_DEFAULT_CAPACITY = 5;\n\nexport type RatingIndicatorSize = 'xs' | 'sm' | 'md' | 'lg' | 'cozy' | 'compact' | 'condensed';\nexport enum RatingIndicatorSizeEnum {\n 'xs',\n 'sm',\n 'md',\n 'lg',\n 'cozy',\n 'compact',\n 'condensed'\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { FdLanguage, TranslationResolver } from '@fundamental-ngx/i18n';\n\n@Pipe({\n name: 'ratingStarLabel'\n})\nexport class RatingStarLabelPipe implements PipeTransform {\n /** @hidden */\n private readonly _translationResolver = new TranslationResolver();\n\n /** Transforms the value to a rating value string. */\n transform(index: number, controlsCount: number, useHalves: boolean, currentLanguage: FdLanguage): string {\n const ofTranslation = this._translationResolver.resolve(currentLanguage, 'coreRatingIndicator.ariaLabelValue');\n\n if (useHalves) {\n return `${index / 2 + 0.5} ${ofTranslation} ${controlsCount / 2}`;\n }\n return `${index + 1} ${ofTranslation} ${controlsCount}`;\n }\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n output,\n signal\n} from '@angular/core';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { HasElementRef } from '@fundamental-ngx/cdk/utils';\nimport { FormItemControl, registerFormItemControl } from '@fundamental-ngx/core/form';\nimport { PopoverComponent, PopoverTriggerDirective } from '@fundamental-ngx/core/popover';\nimport { FD_LANGUAGE, FdLanguage, FdTranslatePipe } from '@fundamental-ngx/i18n';\nimport { Observable } from 'rxjs';\nimport {\n INDICATOR_CLASSES,\n INDICATOR_DEFAULT_CAPACITY,\n INDICATOR_PREFIX,\n RatingIndicatorSize,\n RatingIndicatorSizeEnum\n} from '../constants';\nimport { RatingStarLabelPipe } from '../pipes/rating-star-label.pipe';\n\nlet ratingUID = 0;\n\ninterface NumberKey<T> {\n [key: number]: T;\n}\n\ninterface RatingViewItem {\n rate: number;\n votes: number;\n}\n\n@Component({\n selector: 'fd-rating-indicator',\n templateUrl: './rating-indicator.component.html',\n styleUrl: './rating-indicator.component.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RatingIndicatorComponent),\n multi: true\n },\n registerFormItemControl(RatingIndicatorComponent)\n ],\n imports: [NgTemplateOutlet, PopoverTriggerDirective, PopoverComponent, RatingStarLabelPipe, FdTranslatePipe],\n host: {\n '[class]': 'cssClass()',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-labelledby]': 'ariaLabelledBy()',\n '[attr.disabled]': 'disabled()'\n }\n})\nexport class RatingIndicatorComponent implements ControlValueAccessor, FormItemControl, HasElementRef {\n /** Sets [name] attribute of input. */\n readonly name = input<string>();\n\n /**\n * Sets the aria-label attribute to the element.\n */\n readonly ariaLabel = input<string | null>();\n\n /**\n * Sets the aria-labelledby attribute to the element.\n */\n readonly ariaLabelledBy = input<string | null | undefined>();\n\n /**\n * Sets the aria-roledescription attribute to the element.\n */\n readonly ariaRoledescription = input<string | null | undefined>();\n\n /**\n * Input for disabled state from parent component.\n * Sets the aria-disabled attribute to the element.\n * Sets the is-disabled class to the element.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Whether the rating indicator is in displayMode\n */\n readonly displayMode = input(false, { transform: booleanAttribute });\n\n /**\n * Whether the rating indicator is in non-interactive state.\n */\n readonly nonInteractive = input(false, { transform: booleanAttribute });\n\n /**\n * Number of rates to display\n */\n readonly indicatorCapacity = input(INDICATOR_DEFAULT_CAPACITY, {\n transform: (value: number) => {\n const val = coerceNumberProperty(value, INDICATOR_DEFAULT_CAPACITY);\n return val < 1 ? INDICATOR_DEFAULT_CAPACITY : val;\n }\n });\n\n /**\n * Whether or not to display half values.\n */\n readonly allowHalves = input(false, { transform: booleanAttribute });\n\n /**\n * User's value number of ratings. If provided, Overrides ratingAverage.\n */\n readonly value = input(0);\n\n /**\n * Total number of ratings. If provided, will display text showing the total number of ratings.\n */\n readonly totalRatings = input<number | undefined | null>(undefined);\n\n /**\n * Rating average\n */\n readonly ratingAverage = input<number | undefined | null>(undefined);\n\n /**\n * Object containing key-value pairs where the key is the rating and the value is the total sum of those ratings.\n * Overrides totalRatings and ratingAverage.\n */\n readonly ratings = input<NumberKey<number> | undefined | null>(undefined);\n\n /**\n * Whether or not to display the popover that shows the sum of each rating. Requires [ratings] object.\n */\n readonly displayAllRatings = input(false, { transform: booleanAttribute });\n\n /**\n * Icon class for rated icon from fundamental-styles lib https://sap.github.io/fundamental-styles/?path=/docs/components-icon--sizes\n */\n readonly ratedIcon = input<string | undefined>(undefined);\n\n /**\n * Icon class for unrated icon from fundamental-styles lib https://sap.github.io/fundamental-styles/?path=/docs/components-icon--sizes\n */\n readonly unratedIcon = input<string | undefined>(undefined);\n\n /**\n * Possible values are 'xs', 'sm', 'md', 'lg', 'cozy', 'compact', 'condensed'\n */\n readonly size = input<RatingIndicatorSize>('md');\n\n /**\n * Text divider label between view value and indicator count.\n */\n readonly dynamicTextIndicator = input('of');\n\n /**\n * Whether to display the dynamic text (rating value and count) after the rating indicator.\n * When false, only the star rating UI is shown without any text.\n */\n readonly showDynamicText = input(true, { transform: booleanAttribute });\n\n /**\n * Fired when the user sets or changes their rating.\n */\n readonly ratingChanged = output<number>();\n\n /** @hidden */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Computed display value - returns the current internal value */\n readonly displayValue = computed(() => this.internalValue());\n\n /** @hidden Current language signal for i18n */\n protected readonly language = toSignal(inject<Observable<FdLanguage>>(FD_LANGUAGE), {\n initialValue: {} as FdLanguage\n });\n\n /** @hidden Internal mutable value for CVA and computed display value */\n protected readonly internalValue = signal(0);\n\n /**\n * Internal mutable disabled state.\n * Allows ControlValueAccessor to modify disabled state independently of input.\n */\n protected readonly internalDisabled = signal(false);\n\n /** @hidden Internal total ratings for computed state */\n protected readonly internalTotalRatings = signal<number | undefined | null>(undefined);\n\n /** @hidden Internal rating average for computed state */\n protected readonly internalRatingAverage = signal<number | undefined | null>(undefined);\n\n /** @hidden Rating items for popover content */\n protected readonly ratingItems = signal<RatingViewItem[]>([]);\n\n /** @hidden Unique ID for this rating indicator instance */\n protected readonly ratingUID = ratingUID++;\n\n /** @hidden Computed size class based on size input */\n protected readonly sizeClass = computed(() => this._getSizeClass(this.size()));\n\n /** @hidden Computed rates array based on capacity and halves setting */\n protected readonly rates = computed(() => this._getRates());\n\n /** @hidden Computed signal to determine if dynamic text should be hidden */\n protected readonly hideDynamicText = computed(() => {\n const value = this.displayValue();\n const totalRatings = this.computedTotalRatings;\n // Only hide if value is 0 AND we don't have total ratings to show\n return !value && (totalRatings === undefined || totalRatings === null);\n });\n\n /** @hidden Computed CSS classes for host binding */\n protected readonly cssClass = computed(() => {\n const classes: string[] = [\n INDICATOR_PREFIX,\n this.sizeClass(),\n this.allowHalves() ? INDICATOR_CLASSES.halves : '',\n this.ratedIcon() && this.unratedIcon() ? INDICATOR_CLASSES.icon : '',\n this.hideDynamicText() ? INDICATOR_CLASSES.hideDynamicText : '',\n this.disabled() || this.internalDisabled() ? 'is-disabled' : '',\n this.displayMode() ? 'fd-rating-indicator--display-mode' : '',\n this.nonInteractive() ? 'fd-rating-indicator--non-interactive' : ''\n ];\n return classes.filter(Boolean).join(' ');\n });\n\n /** @hidden */\n constructor() {\n // Sync ratings input with internal state\n effect(() => {\n const ratingsInput = this.ratings();\n if (ratingsInput) {\n this._generateRatings(ratingsInput);\n }\n });\n\n // Initialize internalValue from inputs once, then let CVA handle updates\n let initialized = false;\n effect(() => {\n // Only run once for initialization\n if (initialized) {\n return;\n }\n\n // Read all potential sources\n const inputValue = this.value();\n const internalAvg = this.internalRatingAverage();\n const avgValue = this.ratingAverage();\n\n // Determine source value with proper priority\n let sourceValue = 0;\n if (inputValue && inputValue !== 0) {\n sourceValue = inputValue;\n } else if (internalAvg !== undefined && internalAvg !== null) {\n sourceValue = internalAvg;\n } else if (avgValue !== undefined && avgValue !== null) {\n sourceValue = avgValue;\n }\n\n const parsedValue = this._parseValue(sourceValue);\n this.internalValue.set(parsedValue);\n initialized = true;\n });\n }\n\n /** @hidden CVA onChange callback */\n onChange: (value: number) => void = () => {};\n\n /** @hidden CVA onTouched callback */\n onTouched = (): void => {};\n\n /**\n * @deprecated Use `displayValue()` signal directly instead\n * @hidden Backward compatibility getter\n */\n get viewValue(): number {\n return this.displayValue();\n }\n\n /**\n * @deprecated Use `ratingUID` property directly instead\n * @hidden Backward compatibility getter\n */\n get viewRatingUID(): number {\n return this.ratingUID;\n }\n\n /**\n * @deprecated Use `indicatorCapacity()` signal directly instead\n * @hidden Backward compatibility getter\n */\n get indicatorCount(): number {\n return this.indicatorCapacity();\n }\n\n /** Public getter for computed rating average value. */\n get computedRatingAverage(): number | undefined | null {\n return this.internalRatingAverage() ?? this.ratingAverage();\n }\n\n /** Public getter for computed total ratings value. */\n get computedTotalRatings(): number | undefined | null {\n return this.internalTotalRatings() ?? this.totalRatings();\n }\n\n /** @hidden CVA writeValue - updates internal value signal */\n writeValue(value: number): void {\n this.internalValue.set(this._parseValue(value));\n }\n\n /** @hidden */\n registerOnChange(fn: (value: number) => void): void {\n this.onChange = fn;\n }\n /** @hidden */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @hidden */\n setDisabledState(isDisabled: boolean): void {\n this.internalDisabled.set(isDisabled);\n }\n\n /** @hidden User selection handler */\n protected onSelect(value: number): void {\n this.internalValue.set(value);\n this.onChange(value);\n this.onTouched();\n this.ratingChanged.emit(value);\n }\n\n /**\n * @hidden\n * Generate rating items for popover content from ratings object\n */\n private _generateRatings(ratingsInput: NumberKey<number>): void {\n const ratings = Object.entries(ratingsInput)\n .filter(([rate, vote]) => {\n const numRate = +rate;\n const numVote = +vote;\n return !isNaN(numRate) && !isNaN(numVote) && numRate > 0;\n })\n .map(([rate, votes]) => ({ rate: +rate, votes }));\n\n if (ratings.length === 0) {\n return;\n }\n\n const { totalVotes, totalRating } = ratings.reduce(\n (acc, rating) => ({\n totalVotes: acc.totalVotes + rating.votes,\n totalRating: acc.totalRating + rating.rate * rating.votes\n }),\n { totalVotes: 0, totalRating: 0 }\n );\n\n this.ratingItems.set(ratings);\n this.internalRatingAverage.set(totalRating / totalVotes);\n this.internalTotalRatings.set(totalVotes);\n }\n\n /**\n * @hidden\n * get converted value from original to view value with depends on halves\n * For example,\n * original value is equal to 2.34, you will get and render 2\n * original value is equal to 3.74, you will get and render 4\n */\n private _parseValue(value: number): number {\n if (!value || value === 0) {\n return 0;\n }\n const integer = Math.floor(value);\n const fractional = value % 1;\n let v = integer;\n\n if (this.allowHalves() && fractional > 0.25 && fractional <= 0.5) {\n v = integer + 0.5;\n } else if (fractional > 0.5) {\n v = integer + 1;\n }\n\n return Math.min(this.indicatorCapacity(), v);\n }\n\n /**\n * @hidden\n * get rating icons array with value and unique id\n */\n private _getRates(): { id: string; value: number }[] {\n const withHalves = this.allowHalves() ? 2 : 1;\n const capacity = this.indicatorCapacity();\n return Array(capacity * withHalves)\n .fill(`rating-${this.ratingUID}`)\n .map((name, index) => ({\n id: `${name}-${index + 1}`,\n value: (index + 1) / withHalves\n }));\n }\n\n /**\n * @hidden\n * Get size class for the rating indicator\n */\n private _getSizeClass(size: RatingIndicatorSize): string {\n return `${INDICATOR_PREFIX}--${size in RatingIndicatorSizeEnum ? size : 'md'}`;\n }\n}\n","<ng-template #zeroRate let-halves=\"halves\">\n <input\n [attr.aria-label]=\"'coreRatingIndicator.ariaLabelReset' | fdTranslate\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n (change)=\"onSelect(0)\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n name=\"rating-{{ ratingUID }}{{ halves ? '-halves' : '' }}\"\n [attr.checked]=\"displayValue() === 0 ? true : null\"\n value=\"0\"\n />\n <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!-- role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div\n class=\"fd-rating-indicator__container\"\n role=\"application\"\n [attr.aria-roledescription]=\"ariaRoledescription() || ('coreRatingIndicator.ariaRoleDescription' | fdTranslate)\"\n>\n <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n <!-- Available rate values -->\n @for (rate of rates(); track rate.id; let i = $index) {\n <input\n [attr.aria-label]=\"i | ratingStarLabel: rates().length : allowHalves() : language()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n [id]=\"rate.id\"\n name=\"rating-{{ ratingUID }}\"\n [value]=\"rate.value\"\n [attr.checked]=\"displayValue() === rate.value ? true : null\"\n (change)=\"onSelect(rate.value)\"\n />\n <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (showDynamicText()) {\n @if (displayAllRatings() && ratingItems().length) {\n <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n (<span [attr.aria-label]=\"'coreRatingIndicator.ariaLabelTotalRating' | fdTranslate\" fd-link>{{\n computedTotalRatings\n }}</span\n >)\n </span>\n } @else if (computedTotalRatings !== undefined && computedTotalRatings !== null) {\n <span class=\"fd-rating-indicator__dynamic-text\">({{ computedTotalRatings }})</span>\n } @else {\n <span class=\"fd-rating-indicator__dynamic-text\"\n >({{ displayValue() }} {{ dynamicTextIndicator() }} {{ indicatorCapacity() }})</span\n >\n }\n}\n<fd-popover\n #allRatingContent\n [triggers]=\"['mouseenter', 'mouseleave']\"\n [noArrow]=\"false\"\n placement=\"top\"\n additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n @for (rating of ratingItems(); track rating) {\n <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass()\">\n <div class=\"fd-rating-indicator__container\">\n @for (rate of rates(); track rate.id) {\n <span\n [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n class=\"fd-rating-indicator__input\"\n ></span>\n <label class=\"fd-rating-indicator__label\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n </div>\n ({{ rating.votes }})\n </div>\n }\n</fd-popover>\n","import { NgModule } from '@angular/core';\n\nimport { RatingIndicatorComponent } from './components/rating-indicator.component';\nimport { RatingStarLabelPipe } from './pipes/rating-star-label.pipe';\n\n/**\n * @deprecated\n * Use direct import of `RatingIndicatorComponent`\n */\n@NgModule({\n imports: [RatingIndicatorComponent, RatingStarLabelPipe],\n exports: [RatingIndicatorComponent, RatingStarLabelPipe]\n})\nexport class RatingIndicatorModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAAO,MAAM,gBAAgB,GAAG;AAEzB,MAAM,iBAAiB,GAAG;IAC7B,MAAM,EAAE,CAAA,EAAG,gBAAgB,CAAA,WAAA,CAAa;IACxC,IAAI,EAAE,CAAA,EAAG,gBAAgB,CAAA,MAAA,CAAQ;IACjC,eAAe,EAAE,CAAA,EAAG,gBAAgB,CAAA,mBAAA;;AAEjC,MAAM,0BAA0B,GAAG;IAG9B;AAAZ,CAAA,UAAY,uBAAuB,EAAA;AAC/B,IAAA,uBAAA,CAAA,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAI;AACJ,IAAA,uBAAA,CAAA,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAI;AACJ,IAAA,uBAAA,CAAA,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAI;AACJ,IAAA,uBAAA,CAAA,uBAAA,CAAA,IAAA,CAAA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,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,wBAAwB,EAAE,mBAAmB,CAAC;AACxD,oBAAA,OAAO,EAAE,CAAC,wBAAwB,EAAE,mBAAmB;AAC1D,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"fundamental-ngx-core-rating-indicator.mjs","sources":["../../../../libs/core/rating-indicator/constants.ts","../../../../libs/core/rating-indicator/pipes/rating-star-label.pipe.ts","../../../../libs/core/rating-indicator/components/rating-indicator.component.ts","../../../../libs/core/rating-indicator/components/rating-indicator.component.html","../../../../libs/core/rating-indicator/rating-indicator.module.ts","../../../../libs/core/rating-indicator/fundamental-ngx-core-rating-indicator.ts"],"sourcesContent":["export const INDICATOR_PREFIX = 'fd-rating-indicator';\n\nexport const INDICATOR_CLASSES = {\n halves: `${INDICATOR_PREFIX}--half-star`,\n icon: `${INDICATOR_PREFIX}--icon`,\n hideDynamicText: `${INDICATOR_PREFIX}--hide-dynamic-text`\n};\nexport const INDICATOR_DEFAULT_CAPACITY = 5;\n\nexport type RatingIndicatorSize = 'xs' | 'sm' | 'md' | 'lg' | 'cozy' | 'compact' | 'condensed';\nexport enum RatingIndicatorSizeEnum {\n 'xs',\n 'sm',\n 'md',\n 'lg',\n 'cozy',\n 'compact',\n 'condensed'\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { FdLanguage, TranslationResolver } from '@fundamental-ngx/i18n';\n\n@Pipe({\n name: 'ratingStarLabel'\n})\nexport class RatingStarLabelPipe implements PipeTransform {\n /** @hidden */\n private readonly _translationResolver = new TranslationResolver();\n\n /** Transforms the value to a rating value string. */\n transform(index: number, controlsCount: number, useHalves: boolean, currentLanguage: FdLanguage): string {\n const ofTranslation = this._translationResolver.resolve(currentLanguage, 'coreRatingIndicator.ariaLabelValue');\n\n if (useHalves) {\n return `${index / 2 + 0.5} ${ofTranslation} ${controlsCount / 2}`;\n }\n return `${index + 1} ${ofTranslation} ${controlsCount}`;\n }\n}\n","import { coerceNumberProperty } from '@angular/cdk/coercion';\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n effect,\n forwardRef,\n inject,\n input,\n output,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { HasElementRef } from '@fundamental-ngx/cdk/utils';\nimport { FormItemControl, registerFormItemControl } from '@fundamental-ngx/core/form';\nimport { PopoverComponent, PopoverTriggerDirective } from '@fundamental-ngx/core/popover';\nimport { FD_LANGUAGE_SIGNAL, FdTranslatePipe } from '@fundamental-ngx/i18n';\nimport {\n INDICATOR_CLASSES,\n INDICATOR_DEFAULT_CAPACITY,\n INDICATOR_PREFIX,\n RatingIndicatorSize,\n RatingIndicatorSizeEnum\n} from '../constants';\nimport { RatingStarLabelPipe } from '../pipes/rating-star-label.pipe';\n\nlet ratingUID = 0;\n\ninterface NumberKey<T> {\n [key: number]: T;\n}\n\ninterface RatingViewItem {\n rate: number;\n votes: number;\n}\n\n@Component({\n selector: 'fd-rating-indicator',\n templateUrl: './rating-indicator.component.html',\n styleUrl: './rating-indicator.component.scss',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RatingIndicatorComponent),\n multi: true\n },\n registerFormItemControl(RatingIndicatorComponent)\n ],\n imports: [NgTemplateOutlet, PopoverTriggerDirective, PopoverComponent, RatingStarLabelPipe, FdTranslatePipe],\n host: {\n '[class]': 'cssClass()',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.aria-labelledby]': 'ariaLabelledBy()',\n '[attr.disabled]': 'disabled()'\n }\n})\nexport class RatingIndicatorComponent implements ControlValueAccessor, FormItemControl, HasElementRef {\n /** Sets [name] attribute of input. */\n readonly name = input<string>();\n\n /**\n * Sets the aria-label attribute to the element.\n */\n readonly ariaLabel = input<string | null>();\n\n /**\n * Sets the aria-labelledby attribute to the element.\n */\n readonly ariaLabelledBy = input<string | null | undefined>();\n\n /**\n * Sets the aria-roledescription attribute to the element.\n */\n readonly ariaRoledescription = input<string | null | undefined>();\n\n /**\n * Input for disabled state from parent component.\n * Sets the aria-disabled attribute to the element.\n * Sets the is-disabled class to the element.\n */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /**\n * Whether the rating indicator is in displayMode\n */\n readonly displayMode = input(false, { transform: booleanAttribute });\n\n /**\n * Whether the rating indicator is in non-interactive state.\n */\n readonly nonInteractive = input(false, { transform: booleanAttribute });\n\n /**\n * Number of rates to display\n */\n readonly indicatorCapacity = input(INDICATOR_DEFAULT_CAPACITY, {\n transform: (value: number) => {\n const val = coerceNumberProperty(value, INDICATOR_DEFAULT_CAPACITY);\n return val < 1 ? INDICATOR_DEFAULT_CAPACITY : val;\n }\n });\n\n /**\n * Whether or not to display half values.\n */\n readonly allowHalves = input(false, { transform: booleanAttribute });\n\n /**\n * User's value number of ratings. If provided, Overrides ratingAverage.\n */\n readonly value = input(0);\n\n /**\n * Total number of ratings. If provided, will display text showing the total number of ratings.\n */\n readonly totalRatings = input<number | undefined | null>(undefined);\n\n /**\n * Rating average\n */\n readonly ratingAverage = input<number | undefined | null>(undefined);\n\n /**\n * Object containing key-value pairs where the key is the rating and the value is the total sum of those ratings.\n * Overrides totalRatings and ratingAverage.\n */\n readonly ratings = input<NumberKey<number> | undefined | null>(undefined);\n\n /**\n * Whether or not to display the popover that shows the sum of each rating. Requires [ratings] object.\n */\n readonly displayAllRatings = input(false, { transform: booleanAttribute });\n\n /**\n * Icon class for rated icon from fundamental-styles lib https://sap.github.io/fundamental-styles/?path=/docs/components-icon--sizes\n */\n readonly ratedIcon = input<string | undefined>(undefined);\n\n /**\n * Icon class for unrated icon from fundamental-styles lib https://sap.github.io/fundamental-styles/?path=/docs/components-icon--sizes\n */\n readonly unratedIcon = input<string | undefined>(undefined);\n\n /**\n * Possible values are 'xs', 'sm', 'md', 'lg', 'cozy', 'compact', 'condensed'\n */\n readonly size = input<RatingIndicatorSize>('md');\n\n /**\n * Text divider label between view value and indicator count.\n */\n readonly dynamicTextIndicator = input('of');\n\n /**\n * Whether to display the dynamic text (rating value and count) after the rating indicator.\n * When false, only the star rating UI is shown without any text.\n */\n readonly showDynamicText = input(true, { transform: booleanAttribute });\n\n /**\n * Fired when the user sets or changes their rating.\n */\n readonly ratingChanged = output<number>();\n\n /** @hidden */\n readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /** Computed display value - returns the current internal value */\n readonly displayValue = computed(() => this.internalValue());\n\n /** @hidden Current language signal for i18n */\n protected readonly language = inject(FD_LANGUAGE_SIGNAL);\n\n /** @hidden Internal mutable value for CVA and computed display value */\n protected readonly internalValue = signal(0);\n\n /**\n * Internal mutable disabled state.\n * Allows ControlValueAccessor to modify disabled state independently of input.\n */\n protected readonly internalDisabled = signal(false);\n\n /** @hidden Internal total ratings for computed state */\n protected readonly internalTotalRatings = signal<number | undefined | null>(undefined);\n\n /** @hidden Internal rating average for computed state */\n protected readonly internalRatingAverage = signal<number | undefined | null>(undefined);\n\n /** @hidden Rating items for popover content */\n protected readonly ratingItems = signal<RatingViewItem[]>([]);\n\n /** @hidden Unique ID for this rating indicator instance */\n protected readonly ratingUID = ratingUID++;\n\n /** @hidden Computed size class based on size input */\n protected readonly sizeClass = computed(() => this._getSizeClass(this.size()));\n\n /** @hidden Computed rates array based on capacity and halves setting */\n protected readonly rates = computed(() => this._getRates());\n\n /** @hidden Computed signal to determine if dynamic text should be hidden */\n protected readonly hideDynamicText = computed(() => {\n const value = this.displayValue();\n const totalRatings = this.computedTotalRatings;\n // Only hide if value is 0 AND we don't have total ratings to show\n return !value && (totalRatings === undefined || totalRatings === null);\n });\n\n /** @hidden Computed CSS classes for host binding */\n protected readonly cssClass = computed(() => {\n const classes: string[] = [\n INDICATOR_PREFIX,\n this.sizeClass(),\n this.allowHalves() ? INDICATOR_CLASSES.halves : '',\n this.ratedIcon() && this.unratedIcon() ? INDICATOR_CLASSES.icon : '',\n this.hideDynamicText() ? INDICATOR_CLASSES.hideDynamicText : '',\n this.disabled() || this.internalDisabled() ? 'is-disabled' : '',\n this.displayMode() ? 'fd-rating-indicator--display-mode' : '',\n this.nonInteractive() ? 'fd-rating-indicator--non-interactive' : ''\n ];\n return classes.filter(Boolean).join(' ');\n });\n\n /** @hidden */\n constructor() {\n // Sync ratings input with internal state\n effect(() => {\n const ratingsInput = this.ratings();\n if (ratingsInput) {\n this._generateRatings(ratingsInput);\n }\n });\n\n // Initialize internalValue from inputs once, then let CVA handle updates\n let initialized = false;\n effect(() => {\n // Only run once for initialization\n if (initialized) {\n return;\n }\n\n // Read all potential sources\n const inputValue = this.value();\n const internalAvg = this.internalRatingAverage();\n const avgValue = this.ratingAverage();\n\n // Determine source value with proper priority\n let sourceValue = 0;\n if (inputValue && inputValue !== 0) {\n sourceValue = inputValue;\n } else if (internalAvg !== undefined && internalAvg !== null) {\n sourceValue = internalAvg;\n } else if (avgValue !== undefined && avgValue !== null) {\n sourceValue = avgValue;\n }\n\n const parsedValue = this._parseValue(sourceValue);\n this.internalValue.set(parsedValue);\n initialized = true;\n });\n }\n\n /** @hidden CVA onChange callback */\n onChange: (value: number) => void = () => {};\n\n /** @hidden CVA onTouched callback */\n onTouched = (): void => {};\n\n /**\n * @deprecated Use `displayValue()` signal directly instead\n * @hidden Backward compatibility getter\n */\n get viewValue(): number {\n return this.displayValue();\n }\n\n /**\n * @deprecated Use `ratingUID` property directly instead\n * @hidden Backward compatibility getter\n */\n get viewRatingUID(): number {\n return this.ratingUID;\n }\n\n /**\n * @deprecated Use `indicatorCapacity()` signal directly instead\n * @hidden Backward compatibility getter\n */\n get indicatorCount(): number {\n return this.indicatorCapacity();\n }\n\n /** Public getter for computed rating average value. */\n get computedRatingAverage(): number | undefined | null {\n return this.internalRatingAverage() ?? this.ratingAverage();\n }\n\n /** Public getter for computed total ratings value. */\n get computedTotalRatings(): number | undefined | null {\n return this.internalTotalRatings() ?? this.totalRatings();\n }\n\n /** @hidden CVA writeValue - updates internal value signal */\n writeValue(value: number): void {\n this.internalValue.set(this._parseValue(value));\n }\n\n /** @hidden */\n registerOnChange(fn: (value: number) => void): void {\n this.onChange = fn;\n }\n /** @hidden */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @hidden */\n setDisabledState(isDisabled: boolean): void {\n this.internalDisabled.set(isDisabled);\n }\n\n /** @hidden User selection handler */\n protected onSelect(value: number): void {\n this.internalValue.set(value);\n this.onChange(value);\n this.onTouched();\n this.ratingChanged.emit(value);\n }\n\n /**\n * @hidden\n * Generate rating items for popover content from ratings object\n */\n private _generateRatings(ratingsInput: NumberKey<number>): void {\n const ratings = Object.entries(ratingsInput)\n .filter(([rate, vote]) => {\n const numRate = +rate;\n const numVote = +vote;\n return !isNaN(numRate) && !isNaN(numVote) && numRate > 0;\n })\n .map(([rate, votes]) => ({ rate: +rate, votes }));\n\n if (ratings.length === 0) {\n return;\n }\n\n const { totalVotes, totalRating } = ratings.reduce(\n (acc, rating) => ({\n totalVotes: acc.totalVotes + rating.votes,\n totalRating: acc.totalRating + rating.rate * rating.votes\n }),\n { totalVotes: 0, totalRating: 0 }\n );\n\n this.ratingItems.set(ratings);\n this.internalRatingAverage.set(totalRating / totalVotes);\n this.internalTotalRatings.set(totalVotes);\n }\n\n /**\n * @hidden\n * get converted value from original to view value with depends on halves\n * For example,\n * original value is equal to 2.34, you will get and render 2\n * original value is equal to 3.74, you will get and render 4\n */\n private _parseValue(value: number): number {\n if (!value || value === 0) {\n return 0;\n }\n const integer = Math.floor(value);\n const fractional = value % 1;\n let v = integer;\n\n if (this.allowHalves() && fractional > 0.25 && fractional <= 0.5) {\n v = integer + 0.5;\n } else if (fractional > 0.5) {\n v = integer + 1;\n }\n\n return Math.min(this.indicatorCapacity(), v);\n }\n\n /**\n * @hidden\n * get rating icons array with value and unique id\n */\n private _getRates(): { id: string; value: number }[] {\n const withHalves = this.allowHalves() ? 2 : 1;\n const capacity = this.indicatorCapacity();\n return Array(capacity * withHalves)\n .fill(`rating-${this.ratingUID}`)\n .map((name, index) => ({\n id: `${name}-${index + 1}`,\n value: (index + 1) / withHalves\n }));\n }\n\n /**\n * @hidden\n * Get size class for the rating indicator\n */\n private _getSizeClass(size: RatingIndicatorSize): string {\n return `${INDICATOR_PREFIX}--${size in RatingIndicatorSizeEnum ? size : 'md'}`;\n }\n}\n","<ng-template #zeroRate let-halves=\"halves\">\n <input\n [attr.aria-label]=\"('coreRatingIndicator.ariaLabelReset' | fdTranslate)()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n (change)=\"onSelect(0)\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n name=\"rating-{{ ratingUID }}{{ halves ? '-halves' : '' }}\"\n [attr.checked]=\"displayValue() === 0 ? true : null\"\n value=\"0\"\n />\n <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!-- role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div\n class=\"fd-rating-indicator__container\"\n role=\"application\"\n [attr.aria-roledescription]=\"ariaRoledescription() || ('coreRatingIndicator.ariaRoleDescription' | fdTranslate)()\"\n>\n <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n <!-- Available rate values -->\n @for (rate of rates(); track rate.id; let i = $index) {\n <input\n [attr.aria-label]=\"i | ratingStarLabel: rates().length : allowHalves() : language()\"\n role=\"button\"\n type=\"radio\"\n class=\"fd-rating-indicator__input\"\n [disabled]=\"disabled() || nonInteractive() || displayMode()\"\n [id]=\"rate.id\"\n name=\"rating-{{ ratingUID }}\"\n [value]=\"rate.value\"\n [attr.checked]=\"displayValue() === rate.value ? true : null\"\n (change)=\"onSelect(rate.value)\"\n />\n <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (showDynamicText()) {\n @if (displayAllRatings() && ratingItems().length) {\n <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n (<span [attr.aria-label]=\"('coreRatingIndicator.ariaLabelTotalRating' | fdTranslate)()\" fd-link>{{\n computedTotalRatings\n }}</span\n >)\n </span>\n } @else if (computedTotalRatings !== undefined && computedTotalRatings !== null) {\n <span class=\"fd-rating-indicator__dynamic-text\">({{ computedTotalRatings }})</span>\n } @else {\n <span class=\"fd-rating-indicator__dynamic-text\"\n >({{ displayValue() }} {{ dynamicTextIndicator() }} {{ indicatorCapacity() }})</span\n >\n }\n}\n<fd-popover\n #allRatingContent\n [triggers]=\"['mouseenter', 'mouseleave']\"\n [noArrow]=\"false\"\n placement=\"top\"\n additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n @for (rating of ratingItems(); track rating) {\n <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass()\">\n <div class=\"fd-rating-indicator__container\">\n @for (rate of rates(); track rate.id) {\n <span\n [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n class=\"fd-rating-indicator__input\"\n ></span>\n <label class=\"fd-rating-indicator__label\">\n @if (ratedIcon()) {\n <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon()\"></i>\n }\n @if (unratedIcon()) {\n <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon()\"></i>\n }\n </label>\n }\n </div>\n ({{ rating.votes }})\n </div>\n }\n</fd-popover>\n","import { NgModule } from '@angular/core';\n\nimport { RatingIndicatorComponent } from './components/rating-indicator.component';\nimport { RatingStarLabelPipe } from './pipes/rating-star-label.pipe';\n\n/**\n * @deprecated\n * Use direct import of `RatingIndicatorComponent`\n */\n@NgModule({\n imports: [RatingIndicatorComponent, RatingStarLabelPipe],\n exports: [RatingIndicatorComponent, RatingStarLabelPipe]\n})\nexport class RatingIndicatorModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAO,MAAM,gBAAgB,GAAG;AAEzB,MAAM,iBAAiB,GAAG;IAC7B,MAAM,EAAE,CAAA,EAAG,gBAAgB,CAAA,WAAA,CAAa;IACxC,IAAI,EAAE,CAAA,EAAG,gBAAgB,CAAA,MAAA,CAAQ;IACjC,eAAe,EAAE,CAAA,EAAG,gBAAgB,CAAA,mBAAA;;AAEjC,MAAM,0BAA0B,GAAG;IAG9B;AAAZ,CAAA,UAAY,uBAAuB,EAAA;AAC/B,IAAA,uBAAA,CAAA,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAI;AACJ,IAAA,uBAAA,CAAA,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAI;AACJ,IAAA,uBAAA,CAAA,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAI;AACJ,IAAA,uBAAA,CAAA,uBAAA,CAAA,IAAA,CAAA,GAAA,CAAA,CAAA,GAAA,IAAI;AACJ,IAAA,uBAAA,CAAA,uBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAM;AACN,IAAA,uBAAA,CAAA,uBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAS;AACT,IAAA,uBAAA,CAAA,uBAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAW;AACf,CAAC,EARW,uBAAuB,KAAvB,uBAAuB,GAAA,EAAA,CAAA,CAAA;;MCJt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,wBAAA,mBAAmB,EAAE,aAAa;AAClC,wBAAA,wBAAwB,EAAE,kBAAkB;AAC5C,wBAAA,iBAAiB,EAAE;AACtB,qBAAA,EAAA,QAAA,EAAA,0tIAAA,EAAA,MAAA,EAAA,CAAA,gldAAA,CAAA,EAAA;;;AExDL;;;AAGG;MAKU,qBAAqB,CAAA;8GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAHpB,wBAAwB,EAAE,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAC7C,wBAAwB,EAAE,mBAAmB,CAAA,EAAA,CAAA,CAAA;AAE9C,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAHpB,wBAAwB,CAAA,EAAA,CAAA,CAAA;;2FAGzB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,wBAAwB,EAAE,mBAAmB,CAAC;AACxD,oBAAA,OAAO,EAAE,CAAC,wBAAwB,EAAE,mBAAmB;AAC1D,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
@@ -6,7 +6,7 @@ import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
6
6
|
import * as i1 from '@fundamental-ngx/cdk/utils';
|
|
7
7
|
import { RtlService, destroyObservable, KeyUtil, FocusableItemDirective, FocusableListDirective } from '@fundamental-ngx/cdk/utils';
|
|
8
8
|
import { FD_BUTTON_COMPONENT } from '@fundamental-ngx/core/button';
|
|
9
|
-
import {
|
|
9
|
+
import { FD_LANGUAGE_SIGNAL, TranslationResolver } from '@fundamental-ngx/i18n';
|
|
10
10
|
import { Subject, merge, EMPTY, asyncScheduler, fromEvent } from 'rxjs';
|
|
11
11
|
import { startWith, observeOn, filter, tap, takeUntil } from 'rxjs/operators';
|
|
12
12
|
|
|
@@ -43,7 +43,7 @@ class SegmentedButtonComponent {
|
|
|
43
43
|
/** An RxJS Subject that will kill the data stream upon queryList changes (for unsubscribing) */
|
|
44
44
|
this._onRefresh$ = new Subject();
|
|
45
45
|
/** @hidden */
|
|
46
|
-
this.
|
|
46
|
+
this._langSignal = inject(FD_LANGUAGE_SIGNAL);
|
|
47
47
|
/** @hidden */
|
|
48
48
|
this._translationResolver = inject(TranslationResolver);
|
|
49
49
|
/** @hidden */
|
|
@@ -62,6 +62,14 @@ class SegmentedButtonComponent {
|
|
|
62
62
|
this._focusedItemId.set(item.id);
|
|
63
63
|
});
|
|
64
64
|
this._destroyRef.onDestroy(() => itemFocusedSubscription.unsubscribe());
|
|
65
|
+
// Effect for language changes
|
|
66
|
+
effect(() => {
|
|
67
|
+
const lang = this._langSignal();
|
|
68
|
+
this._groupRoleDescription = this._translationResolver.resolve(lang, 'segmentedButton.groupRoleDescription');
|
|
69
|
+
this._buttonRoleDescription = this._translationResolver.resolve(lang, 'segmentedButton.buttonRoleDescription');
|
|
70
|
+
this._updateButtonRoleDescriptions();
|
|
71
|
+
this._changeDetRef.markForCheck();
|
|
72
|
+
});
|
|
65
73
|
}
|
|
66
74
|
/** @hidden */
|
|
67
75
|
_click(event) {
|
|
@@ -70,15 +78,6 @@ class SegmentedButtonComponent {
|
|
|
70
78
|
}
|
|
71
79
|
}
|
|
72
80
|
/** @hidden */
|
|
73
|
-
ngOnInit() {
|
|
74
|
-
this._lang$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((lang) => {
|
|
75
|
-
this._groupRoleDescription = this._translationResolver.resolve(lang, 'segmentedButton.groupRoleDescription');
|
|
76
|
-
this._buttonRoleDescription = this._translationResolver.resolve(lang, 'segmentedButton.buttonRoleDescription');
|
|
77
|
-
this._updateButtonRoleDescriptions();
|
|
78
|
-
this._changeDetRef.markForCheck();
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
/** @hidden */
|
|
82
81
|
ngAfterViewInit() {
|
|
83
82
|
this._listenToButtonChanges();
|
|
84
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fundamental-ngx-core-segmented-button.mjs","sources":["../../../../libs/core/segmented-button/segmented-button.component.ts","../../../../libs/core/segmented-button/segmented-button.module.ts","../../../../libs/core/segmented-button/fundamental-ngx-core-segmented-button.ts"],"sourcesContent":["import { ENTER, SPACE } from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n DestroyRef,\n ElementRef,\n Host,\n HostListener,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n OnInit,\n QueryList,\n Renderer2,\n SimpleChanges,\n ViewEncapsulation,\n booleanAttribute,\n effect,\n forwardRef,\n inject,\n signal\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n FocusableItemDirective,\n FocusableListDirective,\n KeyUtil,\n Nullable,\n RtlService,\n destroyObservable\n} from '@fundamental-ngx/cdk/utils';\nimport { ButtonComponent, FD_BUTTON_COMPONENT } from '@fundamental-ngx/core/button';\nimport { FD_LANGUAGE, FdLanguage, TranslationResolver } from '@fundamental-ngx/i18n';\nimport { EMPTY, Subject, asyncScheduler, fromEvent, merge } from 'rxjs';\nimport { filter, observeOn, startWith, takeUntil, tap } from 'rxjs/operators';\n\nexport type SegmentedButtonValue = string | (string | null)[] | null;\n\n/**\n * Container for grouped buttons.\n *\n * ```html\n * <fd-segmented-button [(ngModel)]=\"value\">\n * <button fd-button value=\"first\">Button</button>\n * <button fd-button value=\"second\">Button</button>\n * <button fd-button value=\"third\">Button</button>\n * </fd-segmented-button>\n * ```\n */\n@Component({\n selector: 'fd-segmented-button',\n template: `<ng-content></ng-content>`,\n styleUrl: './segmented-button.component.scss',\n host: {\n role: 'listbox',\n '[class.fd-segmented-button]': 'true',\n '[class.fd-segmented-button--vertical]': 'vertical',\n '[attr.aria-multiselectable]': 'toggle',\n '[attr.aria-orientation]': 'vertical ? \"vertical\" : \"horizontal\"',\n '[attr.aria-roledescription]': '_groupRoleDescription',\n '[attr.aria-activedescendant]': '_focusedItemId()'\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SegmentedButtonComponent),\n multi: true\n }\n ],\n hostDirectives: [FocusableListDirective]\n})\nexport class SegmentedButtonComponent implements OnInit, AfterViewInit, ControlValueAccessor, OnDestroy, OnChanges {\n /** Whether segmented button is on toggle mode, which allows to toggle more than 1 button */\n @Input({ transform: booleanAttribute })\n toggle = false;\n\n /**\n * Whether segmented button is on vertical mode,\n * which allows to display buttons vertically\n **/\n @Input({ transform: booleanAttribute })\n vertical = false;\n\n /** @hidden */\n @ContentChildren(FD_BUTTON_COMPONENT)\n _buttons: QueryList<ButtonComponent>;\n\n /** @hidden */\n @ContentChildren(FocusableItemDirective)\n _focusableItems: QueryList<FocusableItemDirective>;\n\n /** @hidden */\n _groupRoleDescription: string;\n\n /** @hidden */\n _buttonRoleDescription: string;\n\n /** @hidden */\n protected _focusedItemId = signal<string | null | undefined>(null);\n\n /**\n * Value of segmented button can have 2 types:\n * - string, when there is no toggle mode and only 1 value can be chosen.\n * - array of strings, when there is toggle mode and more than 1 value can be chosen.\n */\n private _currentValue: SegmentedButtonValue;\n\n /** @hidden */\n private _isDisabled = false;\n\n /** An RxJS Subject that will kill the data stream upon queryList changes (for unsubscribing) */\n private readonly _onRefresh$: Subject<void> = new Subject<void>();\n\n /** @hidden */\n private readonly _lang$ = inject(FD_LANGUAGE);\n\n /** @hidden */\n private _translationResolver = inject(TranslationResolver);\n\n /** @hidden */\n private renderer = inject(Renderer2);\n\n /** @hidden */\n private readonly _rtlService = inject(RtlService, { optional: true });\n\n /** @hidden */\n constructor(\n private readonly _changeDetRef: ChangeDetectorRef,\n private readonly _elementRef: ElementRef,\n private readonly _destroyRef: DestroyRef,\n private readonly _ngZone: NgZone,\n @Host() private _focusableList: FocusableListDirective\n ) {\n this._focusableList.navigationDirection.set(this.vertical ? 'vertical' : 'horizontal');\n effect(() => {\n this._focusableList.contentDirection.set(this._rtlService?.rtl() ? 'rtl' : 'ltr');\n });\n const itemFocusedSubscription = this._focusableList.itemFocused.subscribe((item) => {\n this._focusedItemId.set(item.id);\n });\n this._destroyRef.onDestroy(() => itemFocusedSubscription.unsubscribe());\n }\n\n /** @hidden */\n @HostListener('click', ['$event'])\n protected _click(event: MouseEvent): void {\n if (!this._elementRef.nativeElement.contains(event.relatedTarget)) {\n this.onTouched();\n }\n }\n\n /** @hidden */\n ngOnInit(): void {\n this._lang$.pipe(takeUntilDestroyed(this._destroyRef)).subscribe((lang: FdLanguage) => {\n this._groupRoleDescription = this._translationResolver.resolve(\n lang,\n 'segmentedButton.groupRoleDescription'\n );\n this._buttonRoleDescription = this._translationResolver.resolve(\n lang,\n 'segmentedButton.buttonRoleDescription'\n );\n this._updateButtonRoleDescriptions();\n this._changeDetRef.markForCheck();\n });\n }\n\n /** @hidden */\n onChange: (value: SegmentedButtonValue) => void = () => {};\n\n /** @hidden */\n onTouched = (): void => {};\n\n /** @hidden */\n ngAfterViewInit(): void {\n this._listenToButtonChanges();\n }\n\n /** @hidden */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes && changes.vertical) {\n this._focusableList.navigationDirection.set(this.vertical ? 'vertical' : 'horizontal');\n }\n }\n\n /** @hidden */\n ngOnDestroy(): void {\n this._onRefresh$.complete();\n this._buttons = null as any;\n this._focusableItems = null as any;\n }\n\n /** @hidden */\n writeValue(values: string[] | string): void {\n this._currentValue = values;\n this._pickButtonsByValues(values);\n }\n\n /**\n * @hidden\n * @param fn User defined function that handles the *onChange* event of the SegmentedButtons.\n */\n registerOnChange(fn: (value: SegmentedButtonValue) => void): void {\n this.onChange = fn;\n }\n\n /**\n * @hidden\n * @param fn User defined function that handles the *onTouch* event of the SegmentedButtons.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * @hidden\n * @param isDisabled Sets the value of the *disabled* property of the SegmentedButtons.\n */\n setDisabledState(isDisabled: boolean): void {\n this._isDisabled = isDisabled;\n this._toggleDisableButtons(isDisabled);\n this._onRefresh$.next();\n\n if (!isDisabled) {\n this._ngZone.run(() => {\n if (this._buttons) {\n this._listenToButtonChanges();\n this._pickButtonsByValues(this._currentValue);\n }\n });\n }\n this._changeDetRef.detectChanges();\n }\n\n /** @hidden */\n private _listenToButtonChanges(): void {\n if (!this._buttons || !this._focusableItems) {\n return;\n }\n\n this._onRefresh$.next();\n\n merge(this._buttons.changes ?? EMPTY, this._focusableItems.changes ?? EMPTY)\n .pipe(startWith(1), observeOn(asyncScheduler), takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (!this._buttons || !this._focusableItems) {\n return;\n }\n\n this._toggleDisableButtons(this._isDisabled);\n this._pickButtonsByValues(this._currentValue);\n this._buttons.forEach((button, index) => {\n this._setButtonAttributes(button, index);\n this._listenToTriggerEvents(button);\n });\n });\n }\n\n /** @hidden */\n private _listenToTriggerEvents(buttonComponent: ButtonComponent): void {\n const htmlElement = buttonComponent.elementRef.nativeElement;\n\n const refresh$ = merge(destroyObservable(this._destroyRef), this._onRefresh$);\n\n const triggerEvents$ = merge(\n fromEvent(htmlElement, 'click'),\n fromEvent<KeyboardEvent>(htmlElement, 'keydown').pipe(\n filter((event) => KeyUtil.isKeyCode(event, [ENTER, SPACE])),\n tap((event) => {\n event.preventDefault();\n this.onTouched();\n })\n )\n );\n\n triggerEvents$.pipe(takeUntil(refresh$)).subscribe(() => this._handleTriggerOnButton(buttonComponent));\n }\n\n /** @hidden */\n private _setButtonAttributes(buttonComponent: ButtonComponent, index: number): void {\n const el = buttonComponent.elementRef.nativeElement;\n this.renderer.setAttribute(el, 'role', 'option');\n this.renderer.setAttribute(el, 'aria-roledescription', this._buttonRoleDescription);\n this.renderer.setAttribute(el, 'aria-posinset', String(index + 1));\n this.renderer.setAttribute(el, 'aria-setsize', String(this._buttons.length));\n }\n\n private _updateButtonRoleDescriptions(): void {\n if (!this._buttons) {\n return;\n }\n this._buttons.forEach((button) => {\n this.renderer.setAttribute(\n button.elementRef.nativeElement,\n 'aria-roledescription',\n this._buttonRoleDescription\n );\n });\n }\n\n /** @hidden */\n private _handleTriggerOnButton(buttonComponent: ButtonComponent): void {\n if (!this._isButtonDisabled(buttonComponent)) {\n if (!this.toggle) {\n this._buttons.forEach((button) => this._deselectButton(button));\n this._selectButton(buttonComponent);\n this._propagateChange();\n this._changeDetRef.markForCheck();\n } else {\n this._toggleButton(buttonComponent);\n this._propagateChange();\n this._changeDetRef.markForCheck();\n }\n }\n }\n\n /** @hidden */\n private _propagateChange(): void {\n const selectedValue = this._getValuesBySelected();\n this.onChange(selectedValue);\n this._currentValue = selectedValue;\n }\n\n /** @hidden */\n private _toggleButton(buttonComponent: ButtonComponent): void {\n if (this._isButtonSelected(buttonComponent)) {\n this._deselectButton(buttonComponent);\n } else {\n this._selectButton(buttonComponent);\n }\n }\n\n /** @hidden */\n private _pickButtonsByValues(values: SegmentedButtonValue): void {\n if (!this._buttons) {\n return;\n }\n this._buttons.forEach((button) => this._deselectButton(button));\n this._getButtonsByValues(values).forEach((button) => this._selectButton(button));\n this._changeDetRef.detectChanges();\n }\n\n /** @hidden */\n private _getButtonsByValues(values: SegmentedButtonValue): ButtonComponent[] {\n if (!values) {\n return [];\n }\n\n if (Array.isArray(values)) {\n return this._buttons.filter((button) => !!values.find((value) => this._getButtonValue(button) === value));\n } else {\n return this._buttons.filter((button) => this._getButtonValue(button) === values);\n }\n }\n\n /** @hidden */\n private _selectButton(buttonComponent: ButtonComponent): void {\n buttonComponent.setSelected(true);\n }\n\n /** @hidden */\n private _deselectButton(buttonComponent: ButtonComponent): void {\n buttonComponent.setSelected(false);\n }\n\n /** @hidden */\n private _isButtonSelected(buttonComponent: ButtonComponent): Nullable<boolean> {\n return !!buttonComponent.isSelected();\n }\n\n /** @hidden */\n private _isButtonDisabled(buttonComponent: ButtonComponent): boolean {\n return buttonComponent.isDisabled() || buttonComponent.ariaDisabled();\n }\n\n /** @hidden */\n private _toggleDisableButtons(disable: boolean): void {\n if (!this._buttons || !this._focusableItems) {\n return;\n }\n\n this._buttons.forEach((button) => button.setDisabled(disable));\n\n this._focusableItems.forEach((focusableItemDirective) => {\n focusableItemDirective.setTabbable(!disable);\n focusableItemDirective.setFocusable(!disable);\n });\n if (disable) {\n this._buttons.forEach((button) => {\n button.elementRef.nativeElement.role = 'option';\n this._listenToTriggerEvents(button);\n });\n }\n\n this._changeDetRef.markForCheck();\n }\n\n /** @hidden */\n private _getButtonValue(buttonComponent: ButtonComponent): string | null {\n const element = buttonComponent.elementRef.nativeElement;\n if (element instanceof HTMLButtonElement) {\n return element.value;\n }\n return element.getAttribute('value');\n }\n\n /** @hidden\n * Returns values depending on selected state of buttons\n */\n private _getValuesBySelected(): SegmentedButtonValue {\n if (!this._buttons) {\n return [];\n }\n\n const resButtons = this._buttons\n .filter((button) => !!this._isButtonSelected(button))\n .map((button) => this._getButtonValue(button));\n if (!this.toggle) {\n return resButtons.length === 1 ? resButtons[0] : null;\n } else {\n return resButtons;\n }\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { SegmentedButtonComponent } from './segmented-button.component';\n\n/**\n * @deprecated\n * Use direct `SegmentedButtonComponent` import instead.\n */\n@NgModule({\n imports: [SegmentedButtonComponent],\n exports: [SegmentedButtonComponent]\n})\nexport class SegmentedButtonModule {}\n","/**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B,CAAA;8GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAArB,qBAAqB,EAAA,OAAA,EAAA,CAHpB,wBAAwB,CAAA,EAAA,OAAA,EAAA,CACxB,wBAAwB,CAAA,EAAA,CAAA,CAAA;+GAEzB,qBAAqB,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACN,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,OAAO,EAAE,CAAC,wBAAwB;AACrC,iBAAA;;;ACXD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"fundamental-ngx-core-segmented-button.mjs","sources":["../../../../libs/core/segmented-button/segmented-button.component.ts","../../../../libs/core/segmented-button/segmented-button.module.ts","../../../../libs/core/segmented-button/fundamental-ngx-core-segmented-button.ts"],"sourcesContent":["import { ENTER, SPACE } from '@angular/cdk/keycodes';\nimport {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n DestroyRef,\n ElementRef,\n Host,\n HostListener,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n QueryList,\n Renderer2,\n SimpleChanges,\n ViewEncapsulation,\n booleanAttribute,\n effect,\n forwardRef,\n inject,\n signal\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n FocusableItemDirective,\n FocusableListDirective,\n KeyUtil,\n Nullable,\n RtlService,\n destroyObservable\n} from '@fundamental-ngx/cdk/utils';\nimport { ButtonComponent, FD_BUTTON_COMPONENT } from '@fundamental-ngx/core/button';\nimport { FD_LANGUAGE_SIGNAL, TranslationResolver } from '@fundamental-ngx/i18n';\nimport { EMPTY, Subject, asyncScheduler, fromEvent, merge } from 'rxjs';\nimport { filter, observeOn, startWith, takeUntil, tap } from 'rxjs/operators';\n\nexport type SegmentedButtonValue = string | (string | null)[] | null;\n\n/**\n * Container for grouped buttons.\n *\n * ```html\n * <fd-segmented-button [(ngModel)]=\"value\">\n * <button fd-button value=\"first\">Button</button>\n * <button fd-button value=\"second\">Button</button>\n * <button fd-button value=\"third\">Button</button>\n * </fd-segmented-button>\n * ```\n */\n@Component({\n selector: 'fd-segmented-button',\n template: `<ng-content></ng-content>`,\n styleUrl: './segmented-button.component.scss',\n host: {\n role: 'listbox',\n '[class.fd-segmented-button]': 'true',\n '[class.fd-segmented-button--vertical]': 'vertical',\n '[attr.aria-multiselectable]': 'toggle',\n '[attr.aria-orientation]': 'vertical ? \"vertical\" : \"horizontal\"',\n '[attr.aria-roledescription]': '_groupRoleDescription',\n '[attr.aria-activedescendant]': '_focusedItemId()'\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SegmentedButtonComponent),\n multi: true\n }\n ],\n hostDirectives: [FocusableListDirective]\n})\nexport class SegmentedButtonComponent implements AfterViewInit, ControlValueAccessor, OnDestroy, OnChanges {\n /** Whether segmented button is on toggle mode, which allows to toggle more than 1 button */\n @Input({ transform: booleanAttribute })\n toggle = false;\n\n /**\n * Whether segmented button is on vertical mode,\n * which allows to display buttons vertically\n **/\n @Input({ transform: booleanAttribute })\n vertical = false;\n\n /** @hidden */\n @ContentChildren(FD_BUTTON_COMPONENT)\n _buttons: QueryList<ButtonComponent>;\n\n /** @hidden */\n @ContentChildren(FocusableItemDirective)\n _focusableItems: QueryList<FocusableItemDirective>;\n\n /** @hidden */\n _groupRoleDescription: string;\n\n /** @hidden */\n _buttonRoleDescription: string;\n\n /** @hidden */\n protected _focusedItemId = signal<string | null | undefined>(null);\n\n /**\n * Value of segmented button can have 2 types:\n * - string, when there is no toggle mode and only 1 value can be chosen.\n * - array of strings, when there is toggle mode and more than 1 value can be chosen.\n */\n private _currentValue: SegmentedButtonValue;\n\n /** @hidden */\n private _isDisabled = false;\n\n /** An RxJS Subject that will kill the data stream upon queryList changes (for unsubscribing) */\n private readonly _onRefresh$: Subject<void> = new Subject<void>();\n\n /** @hidden */\n private readonly _langSignal = inject(FD_LANGUAGE_SIGNAL);\n\n /** @hidden */\n private _translationResolver = inject(TranslationResolver);\n\n /** @hidden */\n private renderer = inject(Renderer2);\n\n /** @hidden */\n private readonly _rtlService = inject(RtlService, { optional: true });\n\n /** @hidden */\n constructor(\n private readonly _changeDetRef: ChangeDetectorRef,\n private readonly _elementRef: ElementRef,\n private readonly _destroyRef: DestroyRef,\n private readonly _ngZone: NgZone,\n @Host() private _focusableList: FocusableListDirective\n ) {\n this._focusableList.navigationDirection.set(this.vertical ? 'vertical' : 'horizontal');\n effect(() => {\n this._focusableList.contentDirection.set(this._rtlService?.rtl() ? 'rtl' : 'ltr');\n });\n const itemFocusedSubscription = this._focusableList.itemFocused.subscribe((item) => {\n this._focusedItemId.set(item.id);\n });\n this._destroyRef.onDestroy(() => itemFocusedSubscription.unsubscribe());\n\n // Effect for language changes\n effect(() => {\n const lang = this._langSignal();\n this._groupRoleDescription = this._translationResolver.resolve(\n lang,\n 'segmentedButton.groupRoleDescription'\n );\n this._buttonRoleDescription = this._translationResolver.resolve(\n lang,\n 'segmentedButton.buttonRoleDescription'\n );\n this._updateButtonRoleDescriptions();\n this._changeDetRef.markForCheck();\n });\n }\n\n /** @hidden */\n @HostListener('click', ['$event'])\n protected _click(event: MouseEvent): void {\n if (!this._elementRef.nativeElement.contains(event.relatedTarget)) {\n this.onTouched();\n }\n }\n\n /** @hidden */\n onChange: (value: SegmentedButtonValue) => void = () => {};\n\n /** @hidden */\n onTouched = (): void => {};\n\n /** @hidden */\n ngAfterViewInit(): void {\n this._listenToButtonChanges();\n }\n\n /** @hidden */\n ngOnChanges(changes: SimpleChanges): void {\n if (changes && changes.vertical) {\n this._focusableList.navigationDirection.set(this.vertical ? 'vertical' : 'horizontal');\n }\n }\n\n /** @hidden */\n ngOnDestroy(): void {\n this._onRefresh$.complete();\n this._buttons = null as any;\n this._focusableItems = null as any;\n }\n\n /** @hidden */\n writeValue(values: string[] | string): void {\n this._currentValue = values;\n this._pickButtonsByValues(values);\n }\n\n /**\n * @hidden\n * @param fn User defined function that handles the *onChange* event of the SegmentedButtons.\n */\n registerOnChange(fn: (value: SegmentedButtonValue) => void): void {\n this.onChange = fn;\n }\n\n /**\n * @hidden\n * @param fn User defined function that handles the *onTouch* event of the SegmentedButtons.\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * @hidden\n * @param isDisabled Sets the value of the *disabled* property of the SegmentedButtons.\n */\n setDisabledState(isDisabled: boolean): void {\n this._isDisabled = isDisabled;\n this._toggleDisableButtons(isDisabled);\n this._onRefresh$.next();\n\n if (!isDisabled) {\n this._ngZone.run(() => {\n if (this._buttons) {\n this._listenToButtonChanges();\n this._pickButtonsByValues(this._currentValue);\n }\n });\n }\n this._changeDetRef.detectChanges();\n }\n\n /** @hidden */\n private _listenToButtonChanges(): void {\n if (!this._buttons || !this._focusableItems) {\n return;\n }\n\n this._onRefresh$.next();\n\n merge(this._buttons.changes ?? EMPTY, this._focusableItems.changes ?? EMPTY)\n .pipe(startWith(1), observeOn(asyncScheduler), takeUntilDestroyed(this._destroyRef))\n .subscribe(() => {\n if (!this._buttons || !this._focusableItems) {\n return;\n }\n\n this._toggleDisableButtons(this._isDisabled);\n this._pickButtonsByValues(this._currentValue);\n this._buttons.forEach((button, index) => {\n this._setButtonAttributes(button, index);\n this._listenToTriggerEvents(button);\n });\n });\n }\n\n /** @hidden */\n private _listenToTriggerEvents(buttonComponent: ButtonComponent): void {\n const htmlElement = buttonComponent.elementRef.nativeElement;\n\n const refresh$ = merge(destroyObservable(this._destroyRef), this._onRefresh$);\n\n const triggerEvents$ = merge(\n fromEvent(htmlElement, 'click'),\n fromEvent<KeyboardEvent>(htmlElement, 'keydown').pipe(\n filter((event) => KeyUtil.isKeyCode(event, [ENTER, SPACE])),\n tap((event) => {\n event.preventDefault();\n this.onTouched();\n })\n )\n );\n\n triggerEvents$.pipe(takeUntil(refresh$)).subscribe(() => this._handleTriggerOnButton(buttonComponent));\n }\n\n /** @hidden */\n private _setButtonAttributes(buttonComponent: ButtonComponent, index: number): void {\n const el = buttonComponent.elementRef.nativeElement;\n this.renderer.setAttribute(el, 'role', 'option');\n this.renderer.setAttribute(el, 'aria-roledescription', this._buttonRoleDescription);\n this.renderer.setAttribute(el, 'aria-posinset', String(index + 1));\n this.renderer.setAttribute(el, 'aria-setsize', String(this._buttons.length));\n }\n\n private _updateButtonRoleDescriptions(): void {\n if (!this._buttons) {\n return;\n }\n this._buttons.forEach((button) => {\n this.renderer.setAttribute(\n button.elementRef.nativeElement,\n 'aria-roledescription',\n this._buttonRoleDescription\n );\n });\n }\n\n /** @hidden */\n private _handleTriggerOnButton(buttonComponent: ButtonComponent): void {\n if (!this._isButtonDisabled(buttonComponent)) {\n if (!this.toggle) {\n this._buttons.forEach((button) => this._deselectButton(button));\n this._selectButton(buttonComponent);\n this._propagateChange();\n this._changeDetRef.markForCheck();\n } else {\n this._toggleButton(buttonComponent);\n this._propagateChange();\n this._changeDetRef.markForCheck();\n }\n }\n }\n\n /** @hidden */\n private _propagateChange(): void {\n const selectedValue = this._getValuesBySelected();\n this.onChange(selectedValue);\n this._currentValue = selectedValue;\n }\n\n /** @hidden */\n private _toggleButton(buttonComponent: ButtonComponent): void {\n if (this._isButtonSelected(buttonComponent)) {\n this._deselectButton(buttonComponent);\n } else {\n this._selectButton(buttonComponent);\n }\n }\n\n /** @hidden */\n private _pickButtonsByValues(values: SegmentedButtonValue): void {\n if (!this._buttons) {\n return;\n }\n this._buttons.forEach((button) => this._deselectButton(button));\n this._getButtonsByValues(values).forEach((button) => this._selectButton(button));\n this._changeDetRef.detectChanges();\n }\n\n /** @hidden */\n private _getButtonsByValues(values: SegmentedButtonValue): ButtonComponent[] {\n if (!values) {\n return [];\n }\n\n if (Array.isArray(values)) {\n return this._buttons.filter((button) => !!values.find((value) => this._getButtonValue(button) === value));\n } else {\n return this._buttons.filter((button) => this._getButtonValue(button) === values);\n }\n }\n\n /** @hidden */\n private _selectButton(buttonComponent: ButtonComponent): void {\n buttonComponent.setSelected(true);\n }\n\n /** @hidden */\n private _deselectButton(buttonComponent: ButtonComponent): void {\n buttonComponent.setSelected(false);\n }\n\n /** @hidden */\n private _isButtonSelected(buttonComponent: ButtonComponent): Nullable<boolean> {\n return !!buttonComponent.isSelected();\n }\n\n /** @hidden */\n private _isButtonDisabled(buttonComponent: ButtonComponent): boolean {\n return buttonComponent.isDisabled() || buttonComponent.ariaDisabled();\n }\n\n /** @hidden */\n private _toggleDisableButtons(disable: boolean): void {\n if (!this._buttons || !this._focusableItems) {\n return;\n }\n\n this._buttons.forEach((button) => button.setDisabled(disable));\n\n this._focusableItems.forEach((focusableItemDirective) => {\n focusableItemDirective.setTabbable(!disable);\n focusableItemDirective.setFocusable(!disable);\n });\n if (disable) {\n this._buttons.forEach((button) => {\n button.elementRef.nativeElement.role = 'option';\n this._listenToTriggerEvents(button);\n });\n }\n\n this._changeDetRef.markForCheck();\n }\n\n /** @hidden */\n private _getButtonValue(buttonComponent: ButtonComponent): string | null {\n const element = buttonComponent.elementRef.nativeElement;\n if (element instanceof HTMLButtonElement) {\n return element.value;\n }\n return element.getAttribute('value');\n }\n\n /** @hidden\n * Returns values depending on selected state of buttons\n */\n private _getValuesBySelected(): SegmentedButtonValue {\n if (!this._buttons) {\n return [];\n }\n\n const resButtons = this._buttons\n .filter((button) => !!this._isButtonSelected(button))\n .map((button) => this._getButtonValue(button));\n if (!this.toggle) {\n return resButtons.length === 1 ? resButtons[0] : null;\n } else {\n return resButtons;\n }\n }\n}\n","import { NgModule } from '@angular/core';\n\nimport { SegmentedButtonComponent } from './segmented-button.component';\n\n/**\n * @deprecated\n * Use direct `SegmentedButtonComponent` import instead.\n */\n@NgModule({\n imports: [SegmentedButtonComponent],\n exports: [SegmentedButtonComponent]\n})\nexport class SegmentedButtonModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA0CA;;;;;;;;;;AAUG;MAyBU,wBAAwB,CAAA;;IAuDjC,WAAA,CACqB,aAAgC,EAChC,WAAuB,EACvB,WAAuB,EACvB,OAAe,EAChB,cAAsC,EAAA;QAJrC,IAAA,CAAA,aAAa,GAAb,aAAa;QACb,IAAA,CAAA,WAAW,GAAX,WAAW;QACX,IAAA,CAAA,WAAW,GAAX,WAAW;QACX,IAAA,CAAA,OAAO,GAAP,OAAO;QACR,IAAA,CAAA,cAAc,GAAd,cAAc;;QAzDlC,IAAA,CAAA,MAAM,GAAG,KAAK;AAEd;;;AAGI;QAEJ,IAAA,CAAA,QAAQ,GAAG,KAAK;;AAiBN,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAA4B,IAAI,0DAAC;;QAU1D,IAAA,CAAA,WAAW,GAAG,KAAK;;AAGV,QAAA,IAAA,CAAA,WAAW,GAAkB,IAAI,OAAO,EAAQ;;AAGhD,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,kBAAkB,CAAC;;AAGjD,QAAA,IAAA,CAAA,oBAAoB,GAAG,MAAM,CAAC,mBAAmB,CAAC;;AAGlD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC;;QAGnB,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;AA4CrE,QAAA,IAAA,CAAA,QAAQ,GAA0C,MAAK,EAAE,CAAC;;AAG1D,QAAA,IAAA,CAAA,SAAS,GAAG,MAAW,EAAE,CAAC;AArCtB,QAAA,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,GAAG,UAAU,GAAG,YAAY,CAA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