@fluentui/web-components 3.0.0-beta.121 → 3.0.0-beta.122

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/CHANGELOG.md CHANGED
@@ -1,12 +1,21 @@
1
1
  # Change Log - @fluentui/web-components
2
2
 
3
- This log was last generated on Wed, 03 Sep 2025 04:08:27 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 04 Sep 2025 04:06:55 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [3.0.0-beta.122](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.122)
8
+
9
+ Thu, 04 Sep 2025 04:06:55 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.121..@fluentui/web-components_v3.0.0-beta.122)
11
+
12
+ ### Changes
13
+
14
+ - feat: enable SSR for rating-display ([PR #35126](https://github.com/microsoft/fluentui/pull/35126) by machi@microsoft.com)
15
+
7
16
  ## [3.0.0-beta.121](https://github.com/microsoft/fluentui/tree/@fluentui/web-components_v3.0.0-beta.121)
8
17
 
9
- Wed, 03 Sep 2025 04:08:27 GMT
18
+ Wed, 03 Sep 2025 04:08:39 GMT
10
19
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/web-components_v3.0.0-beta.120..@fluentui/web-components_v3.0.0-beta.121)
11
20
 
12
21
  ### Changes
@@ -19563,6 +19563,18 @@
19563
19563
  "kind": "javascript-module",
19564
19564
  "path": "./dist/esm/rating-display/rating-display.base.js",
19565
19565
  "declarations": [
19566
+ {
19567
+ "kind": "function",
19568
+ "name": "svgToDataURI",
19569
+ "parameters": [
19570
+ {
19571
+ "name": "svg",
19572
+ "type": {
19573
+ "text": "string"
19574
+ }
19575
+ }
19576
+ ]
19577
+ },
19566
19578
  {
19567
19579
  "kind": "class",
19568
19580
  "description": "The base class used for constructing a fluent-rating-display custom element",
@@ -19574,6 +19586,24 @@
19574
19586
  }
19575
19587
  ],
19576
19588
  "members": [
19589
+ {
19590
+ "kind": "field",
19591
+ "name": "numberFormatter",
19592
+ "type": {
19593
+ "text": "Intl.NumberFormat"
19594
+ },
19595
+ "privacy": "private",
19596
+ "default": "new Intl.NumberFormat()"
19597
+ },
19598
+ {
19599
+ "kind": "field",
19600
+ "name": "defaultCustomIconViewBox",
19601
+ "type": {
19602
+ "text": "string"
19603
+ },
19604
+ "privacy": "protected",
19605
+ "default": "'0 0 20 20'"
19606
+ },
19577
19607
  {
19578
19608
  "kind": "field",
19579
19609
  "name": "count",
@@ -19591,7 +19621,7 @@
19591
19621
  },
19592
19622
  "description": "The `viewBox` attribute of the icon <svg> element.",
19593
19623
  "privacy": "public",
19594
- "default": "`0 0 20 20`"
19624
+ "deprecated": "Add `viewBox` attribute on the custom SVG directly."
19595
19625
  },
19596
19626
  {
19597
19627
  "kind": "field",
@@ -19602,6 +19632,11 @@
19602
19632
  "privacy": "public",
19603
19633
  "description": "The maximum possible value of the rating.\nThis attribute determines the number of icons displayed.\nMust be a whole number greater than 1."
19604
19634
  },
19635
+ {
19636
+ "kind": "method",
19637
+ "name": "maxChanged",
19638
+ "privacy": "protected"
19639
+ },
19605
19640
  {
19606
19641
  "kind": "field",
19607
19642
  "name": "value",
@@ -19612,32 +19647,35 @@
19612
19647
  "description": "The value of the rating."
19613
19648
  },
19614
19649
  {
19615
- "kind": "field",
19616
- "name": "intlNumberFormatter",
19617
- "privacy": "private",
19618
- "default": "new Intl.NumberFormat()"
19650
+ "kind": "method",
19651
+ "name": "valueChanged",
19652
+ "privacy": "protected"
19619
19653
  },
19620
19654
  {
19621
19655
  "kind": "method",
19622
- "name": "getSelectedValue",
19656
+ "name": "renderSlottedIcon",
19623
19657
  "privacy": "protected",
19624
- "return": {
19625
- "type": {
19626
- "text": "number"
19658
+ "parameters": [
19659
+ {
19660
+ "name": "svg",
19661
+ "type": {
19662
+ "text": "SVGSVGElement | null"
19663
+ }
19627
19664
  }
19628
- },
19629
- "description": "Gets the selected value"
19665
+ ]
19630
19666
  },
19631
19667
  {
19632
19668
  "kind": "method",
19633
- "name": "getMaxIcons",
19669
+ "name": "setCustomPropertyValue",
19634
19670
  "privacy": "protected",
19635
- "return": {
19636
- "type": {
19637
- "text": "number"
19671
+ "parameters": [
19672
+ {
19673
+ "name": "propertyName",
19674
+ "type": {
19675
+ "text": "PropertyNameForCalculation"
19676
+ }
19638
19677
  }
19639
- },
19640
- "description": "Gets the maximum icons to render"
19678
+ ]
19641
19679
  },
19642
19680
  {
19643
19681
  "kind": "field",
@@ -19662,7 +19700,7 @@
19662
19700
  "text": "string | undefined"
19663
19701
  },
19664
19702
  "description": "The `viewBox` attribute of the icon <svg> element.",
19665
- "default": "`0 0 20 20`",
19703
+ "deprecated": "Add `viewBox` attribute on the custom SVG directly.",
19666
19704
  "fieldName": "iconViewBox"
19667
19705
  },
19668
19706
  {
@@ -19690,6 +19728,14 @@
19690
19728
  }
19691
19729
  ],
19692
19730
  "exports": [
19731
+ {
19732
+ "kind": "js",
19733
+ "name": "svgToDataURI",
19734
+ "declaration": {
19735
+ "name": "svgToDataURI",
19736
+ "module": "src/rating-display/rating-display.base.ts"
19737
+ }
19738
+ },
19693
19739
  {
19694
19740
  "kind": "js",
19695
19741
  "name": "BaseRatingDisplay",
@@ -19740,30 +19786,26 @@
19740
19786
  "description": "Renders a single filled icon with a label next to it."
19741
19787
  },
19742
19788
  {
19743
- "kind": "method",
19744
- "name": "getSelectedValue",
19745
- "privacy": "protected",
19746
- "return": {
19747
- "type": {
19748
- "text": "number"
19749
- }
19789
+ "kind": "field",
19790
+ "name": "numberFormatter",
19791
+ "type": {
19792
+ "text": "Intl.NumberFormat"
19750
19793
  },
19751
- "description": "Overrides the selected value and returns 1 if compact is true.",
19794
+ "privacy": "private",
19795
+ "default": "new Intl.NumberFormat()",
19752
19796
  "inheritedFrom": {
19753
19797
  "name": "BaseRatingDisplay",
19754
19798
  "module": "src/rating-display/rating-display.base.ts"
19755
19799
  }
19756
19800
  },
19757
19801
  {
19758
- "kind": "method",
19759
- "name": "getMaxIcons",
19760
- "privacy": "protected",
19761
- "return": {
19762
- "type": {
19763
- "text": "number"
19764
- }
19802
+ "kind": "field",
19803
+ "name": "defaultCustomIconViewBox",
19804
+ "type": {
19805
+ "text": "string"
19765
19806
  },
19766
- "description": "Overrides the maximum icons and returns a max of 1 if compact is true.",
19807
+ "privacy": "protected",
19808
+ "default": "'0 0 20 20'",
19767
19809
  "inheritedFrom": {
19768
19810
  "name": "BaseRatingDisplay",
19769
19811
  "module": "src/rating-display/rating-display.base.ts"
@@ -19790,7 +19832,7 @@
19790
19832
  },
19791
19833
  "description": "The `viewBox` attribute of the icon <svg> element.",
19792
19834
  "privacy": "public",
19793
- "default": "`0 0 20 20`",
19835
+ "deprecated": "Add `viewBox` attribute on the custom SVG directly.",
19794
19836
  "inheritedFrom": {
19795
19837
  "name": "BaseRatingDisplay",
19796
19838
  "module": "src/rating-display/rating-display.base.ts"
@@ -19809,6 +19851,15 @@
19809
19851
  "module": "src/rating-display/rating-display.base.ts"
19810
19852
  }
19811
19853
  },
19854
+ {
19855
+ "kind": "method",
19856
+ "name": "maxChanged",
19857
+ "privacy": "protected",
19858
+ "inheritedFrom": {
19859
+ "name": "BaseRatingDisplay",
19860
+ "module": "src/rating-display/rating-display.base.ts"
19861
+ }
19862
+ },
19812
19863
  {
19813
19864
  "kind": "field",
19814
19865
  "name": "value",
@@ -19823,10 +19874,43 @@
19823
19874
  }
19824
19875
  },
19825
19876
  {
19826
- "kind": "field",
19827
- "name": "intlNumberFormatter",
19828
- "privacy": "private",
19829
- "default": "new Intl.NumberFormat()",
19877
+ "kind": "method",
19878
+ "name": "valueChanged",
19879
+ "privacy": "protected",
19880
+ "inheritedFrom": {
19881
+ "name": "BaseRatingDisplay",
19882
+ "module": "src/rating-display/rating-display.base.ts"
19883
+ }
19884
+ },
19885
+ {
19886
+ "kind": "method",
19887
+ "name": "renderSlottedIcon",
19888
+ "privacy": "protected",
19889
+ "parameters": [
19890
+ {
19891
+ "name": "svg",
19892
+ "type": {
19893
+ "text": "SVGSVGElement | null"
19894
+ }
19895
+ }
19896
+ ],
19897
+ "inheritedFrom": {
19898
+ "name": "BaseRatingDisplay",
19899
+ "module": "src/rating-display/rating-display.base.ts"
19900
+ }
19901
+ },
19902
+ {
19903
+ "kind": "method",
19904
+ "name": "setCustomPropertyValue",
19905
+ "privacy": "protected",
19906
+ "parameters": [
19907
+ {
19908
+ "name": "propertyName",
19909
+ "type": {
19910
+ "text": "PropertyNameForCalculation"
19911
+ }
19912
+ }
19913
+ ],
19830
19914
  "inheritedFrom": {
19831
19915
  "name": "BaseRatingDisplay",
19832
19916
  "module": "src/rating-display/rating-display.base.ts"
@@ -19864,7 +19948,7 @@
19864
19948
  "text": "string | undefined"
19865
19949
  },
19866
19950
  "description": "The `viewBox` attribute of the icon <svg> element.",
19867
- "default": "`0 0 20 20`",
19951
+ "deprecated": "Add `viewBox` attribute on the custom SVG directly.",
19868
19952
  "fieldName": "iconViewBox",
19869
19953
  "inheritedFrom": {
19870
19954
  "name": "BaseRatingDisplay",
@@ -1,4 +1,6 @@
1
1
  import { FASTElement } from '@microsoft/fast-element';
2
+ type PropertyNameForCalculation = 'max' | 'value';
3
+ export declare function svgToDataURI(svg: string): string;
2
4
  /**
3
5
  * The base class used for constructing a fluent-rating-display custom element
4
6
  *
@@ -7,12 +9,21 @@ import { FASTElement } from '@microsoft/fast-element';
7
9
  * @public
8
10
  */
9
11
  export declare class BaseRatingDisplay extends FASTElement {
12
+ private numberFormatter;
10
13
  /**
11
14
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
12
15
  *
13
16
  * @internal
14
17
  */
15
18
  elementInternals: ElementInternals;
19
+ /** @internal */
20
+ iconSlot: HTMLSlotElement;
21
+ protected defaultCustomIconViewBox: string;
22
+ /**
23
+ * The element that displays the rating icons.
24
+ * @internal
25
+ */
26
+ display: HTMLElement;
16
27
  /**
17
28
  * The number of ratings.
18
29
  *
@@ -25,9 +36,9 @@ export declare class BaseRatingDisplay extends FASTElement {
25
36
  * The `viewBox` attribute of the icon <svg> element.
26
37
  *
27
38
  * @public
28
- * @default `0 0 20 20`
29
39
  * @remarks
30
40
  * HTML Attribute: `icon-view-box`
41
+ * @deprecated Add `viewBox` attribute on the custom SVG directly.
31
42
  */
32
43
  iconViewBox?: string;
33
44
  /**
@@ -40,6 +51,7 @@ export declare class BaseRatingDisplay extends FASTElement {
40
51
  * HTML Attribute: `max`
41
52
  */
42
53
  max?: number;
54
+ protected maxChanged(): void;
43
55
  /**
44
56
  * The value of the rating.
45
57
  *
@@ -48,42 +60,18 @@ export declare class BaseRatingDisplay extends FASTElement {
48
60
  * HTML Attribute: `value`
49
61
  */
50
62
  value?: number;
51
- /**
52
- * @internal
53
- */
54
- slottedIcon: HTMLElement[];
55
- /**
56
- * @internal
57
- */
58
- slottedIconChanged(): void;
59
- /**
60
- * @internal
61
- */
62
- private customIcon?;
63
- private intlNumberFormatter;
63
+ protected valueChanged(): void;
64
64
  constructor();
65
+ connectedCallback(): void;
65
66
  /**
66
67
  * Returns "count" as string, formatted according to the locale.
67
68
  *
68
69
  * @internal
69
70
  */
70
71
  get formattedCount(): string;
71
- /**
72
- * Gets the selected value
73
- *
74
- * @protected
75
- */
76
- protected getSelectedValue(): number;
77
- /**
78
- * Gets the maximum icons to render
79
- *
80
- * @protected
81
- */
82
- protected getMaxIcons(): number;
83
- /**
84
- * Generates the icon SVG elements based on the "max" attribute.
85
- *
86
- * @internal
87
- */
88
- generateIcons(): string;
72
+ /** @internal */
73
+ handleSlotChange(): void;
74
+ protected renderSlottedIcon(svg: SVGSVGElement | null): void;
75
+ protected setCustomPropertyValue(propertyName: PropertyNameForCalculation): void;
89
76
  }
77
+ export {};
@@ -1,5 +1,18 @@
1
1
  import { __decorate } from "tslib";
2
- import { attr, FASTElement, nullableNumberConverter, observable } from '@microsoft/fast-element';
2
+ import { attr, FASTElement, nullableNumberConverter } from '@microsoft/fast-element';
3
+ const SUPPORTS_ATTR_TYPE = CSS.supports('width: attr(value type(<number>))');
4
+ const CUSTOM_PROPERTY_NAME = {
5
+ max: '--_attr-max',
6
+ value: '--_attr-value',
7
+ maskImageFilled: '--_mask-image-filled',
8
+ maskImageOutlined: '--_mask-image-outlined',
9
+ };
10
+ export function svgToDataURI(svg) {
11
+ if (!svg) {
12
+ return '';
13
+ }
14
+ return ['data:image/svg+xml', encodeURIComponent(svg.replace(/\n/g, '').replace(/\s+/g, ' '))].join(',');
15
+ }
3
16
  /**
4
17
  * The base class used for constructing a fluent-rating-display custom element
5
18
  *
@@ -8,13 +21,11 @@ import { attr, FASTElement, nullableNumberConverter, observable } from '@microso
8
21
  * @public
9
22
  */
10
23
  export class BaseRatingDisplay extends FASTElement {
11
- /**
12
- * @internal
13
- */
14
- slottedIconChanged() {
15
- if (this.$fastController.isConnected) {
16
- this.customIcon = this.slottedIcon[0]?.outerHTML;
17
- }
24
+ maxChanged() {
25
+ this.setCustomPropertyValue('max');
26
+ }
27
+ valueChanged() {
28
+ this.setCustomPropertyValue('value');
18
29
  }
19
30
  constructor() {
20
31
  super();
@@ -24,8 +35,14 @@ export class BaseRatingDisplay extends FASTElement {
24
35
  * @internal
25
36
  */
26
37
  this.elementInternals = this.attachInternals();
27
- this.intlNumberFormatter = new Intl.NumberFormat();
38
+ this.defaultCustomIconViewBox = '0 0 20 20';
28
39
  this.elementInternals.role = 'img';
40
+ this.numberFormatter = new Intl.NumberFormat();
41
+ }
42
+ connectedCallback() {
43
+ super.connectedCallback();
44
+ this.setCustomPropertyValue('value');
45
+ this.setCustomPropertyValue('max');
29
46
  }
30
47
  /**
31
48
  * Returns "count" as string, formatted according to the locale.
@@ -33,44 +50,48 @@ export class BaseRatingDisplay extends FASTElement {
33
50
  * @internal
34
51
  */
35
52
  get formattedCount() {
36
- return this.count ? this.intlNumberFormatter.format(this.count) : '';
53
+ return this.count ? this.numberFormatter.format(this.count) : '';
37
54
  }
38
- /**
39
- * Gets the selected value
40
- *
41
- * @protected
42
- */
43
- getSelectedValue() {
44
- return Math.round((this.value ?? 0) * 2) / 2;
55
+ /** @internal */
56
+ handleSlotChange() {
57
+ const icon = this.iconSlot.assignedElements()?.find(el => el.nodeName.toLowerCase() === 'svg');
58
+ this.renderSlottedIcon(icon ?? null);
45
59
  }
46
- /**
47
- * Gets the maximum icons to render
48
- *
49
- * @protected
50
- */
51
- getMaxIcons() {
52
- return (this.max ?? 5) * 2;
60
+ renderSlottedIcon(svg) {
61
+ if (!svg) {
62
+ this.display.style.removeProperty(CUSTOM_PROPERTY_NAME.maskImageFilled);
63
+ this.display.style.removeProperty(CUSTOM_PROPERTY_NAME.maskImageOutlined);
64
+ return;
65
+ }
66
+ const innerSvg = svg.innerHTML;
67
+ const viewBox = svg.getAttribute('viewBox') ?? this.iconViewBox ?? this.defaultCustomIconViewBox;
68
+ const customSvgFilled = `
69
+ <svg
70
+ viewBox="${viewBox}"
71
+ xmlns="http://www.w3.org/2000/svg"
72
+ >${innerSvg}</svg>`;
73
+ const customSvgOutlined = `
74
+ <svg
75
+ viewBox="${viewBox}"
76
+ xmlns="http://www.w3.org/2000/svg"
77
+ fill="none"
78
+ stroke="black"
79
+ stroke-width="2"
80
+ >${innerSvg}</svg>`;
81
+ this.display.style.setProperty(CUSTOM_PROPERTY_NAME.maskImageFilled, `url(${svgToDataURI(customSvgFilled)})`);
82
+ this.display.style.setProperty(CUSTOM_PROPERTY_NAME.maskImageOutlined, `url(${svgToDataURI(customSvgOutlined)})`);
53
83
  }
54
- /**
55
- * Generates the icon SVG elements based on the "max" attribute.
56
- *
57
- * @internal
58
- */
59
- generateIcons() {
60
- let htmlString = '';
61
- let customIcon;
62
- if (this.customIcon) {
63
- // Extract the SVG element content
64
- customIcon = /<svg[^>]*>([\s\S]*?)<\/svg>/.exec(this.customIcon)?.[1] ?? '';
84
+ setCustomPropertyValue(propertyName) {
85
+ if (!this.display || SUPPORTS_ATTR_TYPE) {
86
+ return;
87
+ }
88
+ const propertyValue = this[propertyName];
89
+ if (typeof propertyValue !== 'number' || Number.isNaN(propertyValue)) {
90
+ this.display.style.removeProperty(CUSTOM_PROPERTY_NAME[propertyName]);
65
91
  }
66
- // The value of the selected icon. Based on the "value" attribute, rounded to the nearest half.
67
- const selectedValue = this.getSelectedValue();
68
- // Render the icons based on the "max" attribute. If "max" is not set, render 5 icons.
69
- for (let i = 0; i < this.getMaxIcons(); i++) {
70
- const iconValue = (i + 1) / 2;
71
- htmlString += `<svg aria-hidden="true" viewBox="${this.iconViewBox ?? '0 0 20 20'}" ${iconValue === selectedValue ? 'selected' : ''}>${customIcon ?? '<use href="#star"></use>'}</svg>`;
92
+ else {
93
+ this.display.style.setProperty(CUSTOM_PROPERTY_NAME[propertyName], `${propertyValue}`);
72
94
  }
73
- return htmlString;
74
95
  }
75
96
  }
76
97
  __decorate([
@@ -85,10 +106,4 @@ __decorate([
85
106
  __decorate([
86
107
  attr({ converter: nullableNumberConverter })
87
108
  ], BaseRatingDisplay.prototype, "value", void 0);
88
- __decorate([
89
- observable
90
- ], BaseRatingDisplay.prototype, "slottedIcon", void 0);
91
- __decorate([
92
- observable
93
- ], BaseRatingDisplay.prototype, "customIcon", void 0);
94
109
  //# sourceMappingURL=rating-display.base.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rating-display.base.js","sourceRoot":"","sources":["../../../src/rating-display/rating-display.base.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEjG;;;;;;GAMG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAyDhD;;OAEG;IACI,kBAAkB;QACvB,IAAI,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;YACrC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC;QACnD,CAAC;IACH,CAAC;I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AAoC,IAAI,CAAC,WAAW,IAAI,WAAW,KAC/E,SAAS,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAC7C,IAAI,UAAU,IAAI,0BAA0B,QAAQ,CAAC;QACvD,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAvHQ;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;gDACvB;AAWtB;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;sDAChB;AAYd;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;8CACzB;AAUb;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;gDACvB;AAMf;IADN,UAAU;sDACwB;AAe3B;IADP,UAAU;qDACiB"}
1
+ {"version":3,"file":"rating-display.base.js","sourceRoot":"","sources":["../../../src/rating-display/rating-display.base.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAErF,MAAM,kBAAkB,GAAG,GAAG,CAAC,QAAQ,CAAC,mCAAmC,CAAC,CAAC;AAC7E,MAAM,oBAAoB,GAAG;IAC3B,GAAG,EAAE,aAAa;IAClB,KAAK,EAAE,eAAe;IACtB,eAAe,EAAE,sBAAsB;IACvC,iBAAiB,EAAE,wBAAwB;CAC5C,CAAC;AAGF,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,oBAAoB,EAAE,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3G,CAAC;AAED;;;;;;GAMG;AACH,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AS,EAAE,uBAAuB,EAAE,CAAC;gDACvB;AAWtB;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;sDAChB;AAYd;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;8CACzB;AAab;IADN,IAAI,CAAC,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC;gDACvB"}
@@ -1,5 +1,5 @@
1
1
  import { BaseRatingDisplay } from './rating-display.base.js';
2
- import { RatingDisplayColor, RatingDisplaySize } from './rating-display.options.js';
2
+ import type { RatingDisplayColor, RatingDisplaySize } from './rating-display.options.js';
3
3
  /**
4
4
  * A Rating Display Custom HTML Element.
5
5
  * Based on BaseRatingDisplay and includes style and layout specific attributes
@@ -35,16 +35,4 @@ export declare class RatingDisplay extends BaseRatingDisplay {
35
35
  * HTML Attribute: `compact`
36
36
  */
37
37
  compact: boolean;
38
- /**
39
- * Overrides the selected value and returns 1 if compact is true.
40
- *
41
- * @override
42
- */
43
- protected getSelectedValue(): number;
44
- /**
45
- * Overrides the maximum icons and returns a max of 1 if compact is true.
46
- *
47
- * @override
48
- */
49
- protected getMaxIcons(): number;
50
38
  }
@@ -21,22 +21,6 @@ export class RatingDisplay extends BaseRatingDisplay {
21
21
  */
22
22
  this.compact = false;
23
23
  }
24
- /**
25
- * Overrides the selected value and returns 1 if compact is true.
26
- *
27
- * @override
28
- */
29
- getSelectedValue() {
30
- return Math.round((this.compact ? 1 : this.value ?? 0) * 2) / 2;
31
- }
32
- /**
33
- * Overrides the maximum icons and returns a max of 1 if compact is true.
34
- *
35
- * @override
36
- */
37
- getMaxIcons() {
38
- return (this.compact ? 1 : this.max ?? 5) * 2;
39
- }
40
24
  }
41
25
  __decorate([
42
26
  attr
@@ -1 +1 @@
1
- {"version":3,"file":"rating-display.js","sourceRoot":"","sources":["../../../src/rating-display/rating-display.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D;;;;;;;GAOG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAApD;;QAuBE;;;;;;WAMG;QAEI,YAAO,GAAY,KAAK,CAAC;IAmBlC,CAAC;IAjBC;;;;OAIG;IACgB,gBAAgB;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAClE,CAAC;IAED;;;;OAIG;IACgB,WAAW;QAC5B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;IAChD,CAAC;CACF;AAxCQ;IADN,IAAI;4CAC6B;AAW3B;IADN,IAAI;2CAC2B;AAUzB;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CACM"}
1
+ {"version":3,"file":"rating-display.js","sourceRoot":"","sources":["../../../src/rating-display/rating-display.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D;;;;;;;GAOG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAApD;;QAuBE;;;;;;WAMG;QAEI,YAAO,GAAY,KAAK,CAAC;IAClC,CAAC;CAAA;AAtBQ;IADN,IAAI;4CAC6B;AAW3B;IADN,IAAI;2CAC2B;AAUzB;IADN,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;8CACM"}