@fluentui/web-components 3.0.0-beta.53 → 3.0.0-beta.55

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/dist/dts/index-rollup.d.ts +1 -0
  3. package/dist/dts/index.d.ts +2 -1
  4. package/dist/dts/rating-display/index.d.ts +1 -1
  5. package/dist/dts/rating-display/rating-display.d.ts +65 -33
  6. package/dist/dts/tablist/define.d.ts +1 -0
  7. package/dist/dts/tablist/index.d.ts +5 -0
  8. package/dist/dts/tablist/tablist.bench.d.ts +3 -0
  9. package/dist/dts/tablist/tablist.d.ts +191 -0
  10. package/dist/dts/tablist/tablist.definition.d.ts +7 -0
  11. package/dist/dts/tablist/tablist.options.d.ts +44 -0
  12. package/dist/dts/tablist/tablist.styles.d.ts +4 -0
  13. package/dist/dts/tablist/tablist.template.d.ts +5 -0
  14. package/dist/dts/utils/focusable-element.d.ts +3 -0
  15. package/dist/esm/index-rollup.js +1 -0
  16. package/dist/esm/index-rollup.js.map +1 -1
  17. package/dist/esm/index.js +2 -1
  18. package/dist/esm/index.js.map +1 -1
  19. package/dist/esm/rating-display/index.js +1 -1
  20. package/dist/esm/rating-display/index.js.map +1 -1
  21. package/dist/esm/rating-display/rating-display.js +91 -46
  22. package/dist/esm/rating-display/rating-display.js.map +1 -1
  23. package/dist/esm/tablist/define.js +4 -0
  24. package/dist/esm/tablist/define.js.map +1 -0
  25. package/dist/esm/tablist/index.js +6 -0
  26. package/dist/esm/tablist/index.js.map +1 -0
  27. package/dist/esm/tablist/tablist.bench.js +21 -0
  28. package/dist/esm/tablist/tablist.bench.js.map +1 -0
  29. package/dist/esm/tablist/tablist.definition.js +15 -0
  30. package/dist/esm/tablist/tablist.definition.js.map +1 -0
  31. package/dist/esm/tablist/tablist.js +407 -0
  32. package/dist/esm/tablist/tablist.js.map +1 -0
  33. package/dist/esm/tablist/tablist.options.js +24 -0
  34. package/dist/esm/tablist/tablist.options.js.map +1 -0
  35. package/dist/esm/tablist/tablist.styles.js +194 -0
  36. package/dist/esm/tablist/tablist.styles.js.map +1 -0
  37. package/dist/esm/tablist/tablist.template.js +10 -0
  38. package/dist/esm/tablist/tablist.template.js.map +1 -0
  39. package/dist/esm/utils/focusable-element.js +10 -0
  40. package/dist/esm/utils/focusable-element.js.map +1 -0
  41. package/dist/web-components.d.ts +335 -45
  42. package/dist/web-components.js +987 -542
  43. package/dist/web-components.min.js +290 -287
  44. package/package.json +7 -5
@@ -1825,6 +1825,71 @@ export declare class BaseProgressBar extends FASTElement {
1825
1825
  constructor();
1826
1826
  }
1827
1827
 
1828
+ /**
1829
+ * The base class used for constructing a fluent-rating-display custom element
1830
+ * @public
1831
+ */
1832
+ export declare class BaseRatingDisplay extends FASTElement {
1833
+ /**
1834
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
1835
+ *
1836
+ * @internal
1837
+ */
1838
+ elementInternals: ElementInternals;
1839
+ /**
1840
+ * The number of ratings.
1841
+ *
1842
+ * @public
1843
+ * @remarks
1844
+ * HTML Attribute: `count`
1845
+ */
1846
+ count?: number;
1847
+ /**
1848
+ * The maximum possible value of the rating.
1849
+ * This attribute determines the number of icons displayed.
1850
+ * Must be a whole number greater than 1.
1851
+ *
1852
+ * @public
1853
+ * @remarks
1854
+ * HTML Attribute: `max`
1855
+ */
1856
+ max?: number;
1857
+ /**
1858
+ * The value of the rating.
1859
+ *
1860
+ * @public
1861
+ * @remarks
1862
+ * HTML Attribute: `value`
1863
+ */
1864
+ value?: number;
1865
+ private intlNumberFormatter;
1866
+ constructor();
1867
+ /**
1868
+ * Returns "count" as string, formatted according to the locale.
1869
+ *
1870
+ * @internal
1871
+ */
1872
+ get formattedCount(): string;
1873
+ /**
1874
+ * Gets the selected value
1875
+ *
1876
+ * @protected
1877
+ */
1878
+ protected getSelectedValue(): number;
1879
+ /**
1880
+ * Gets the maximum icons to render
1881
+ *
1882
+ * @protected
1883
+ */
1884
+ protected getMaxIcons(): number;
1885
+ /**
1886
+ * Generates the icon SVG elements based on the "max" attribute.
1887
+ *
1888
+ * @internal
1889
+ */
1890
+ generateIcons(): string;
1891
+ }
1892
+
1828
1893
  /**
1829
1894
  * The base class used for constructing a fluent-spinner custom element
1830
1895
  * @public
@@ -1839,6 +1904,99 @@ export declare class BaseSpinner extends FASTElement {
1839
1904
  constructor();
1840
1905
  }
1841
1906
 
1907
+ /**
1908
+ * A Tablist element that wraps a collection of tab elements
1909
+ * @public
1910
+ */
1911
+ export declare class BaseTablist extends FASTElement {
1912
+ /**
1913
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
1914
+ *
1915
+ * @internal
1916
+ */
1917
+ elementInternals: ElementInternals;
1918
+ /**
1919
+ * Used for disabling all click and keyboard events for the tabs, child tab elements.
1920
+ * @public
1921
+ * @remarks
1922
+ * HTML Attribute: disabled.
1923
+ */
1924
+ disabled: boolean;
1925
+ /**
1926
+ * Handles disabled changes
1927
+ * @param prev - previous value
1928
+ * @param next - next value
1929
+ *
1930
+ * @internal
1931
+ */
1932
+ protected disabledChanged(prev: boolean, next: boolean): void;
1933
+ /**
1934
+ * The orientation
1935
+ * @public
1936
+ * @remarks
1937
+ * HTML Attribute: orientation
1938
+ */
1939
+ orientation: TablistOrientation;
1940
+ /**
1941
+ * @internal
1942
+ */
1943
+ protected orientationChanged(prev: TablistOrientation, next: TablistOrientation): void;
1944
+ /**
1945
+ * The id of the active tab
1946
+ *
1947
+ * @public
1948
+ * @remarks
1949
+ * HTML Attribute: activeid
1950
+ */
1951
+ activeid: string;
1952
+ /**
1953
+ * @internal
1954
+ */
1955
+ protected activeidChanged(oldValue: string, newValue: string): void;
1956
+ /**
1957
+ * @internal
1958
+ */
1959
+ tabs: HTMLElement[];
1960
+ /**
1961
+ * @internal
1962
+ */
1963
+ protected tabsChanged(): void;
1964
+ /**
1965
+ * A reference to the active tab
1966
+ * @public
1967
+ */
1968
+ activetab: HTMLElement;
1969
+ private prevActiveTabIndex;
1970
+ private activeTabIndex;
1971
+ private tabIds;
1972
+ private change;
1973
+ private getActiveIndex;
1974
+ /**
1975
+ * Function that is invoked whenever the selected tab or the tab collection changes.
1976
+ *
1977
+ * @public
1978
+ */
1979
+ protected setTabs(): void;
1980
+ private getTabIds;
1981
+ private setComponent;
1982
+ private handleTabClick;
1983
+ private isHorizontal;
1984
+ private handleTabKeyDown;
1985
+ /**
1986
+ * The adjust method for FASTTabs
1987
+ * @public
1988
+ * @remarks
1989
+ * This method allows the active index to be adjusted by numerical increments
1990
+ */
1991
+ adjust(adjustment: number): void;
1992
+ private activateTabByIndex;
1993
+ private focusTab;
1994
+ /**
1995
+ * @internal
1996
+ */
1997
+ connectedCallback(): void;
1998
+ }
1999
+
1842
2000
  /**
1843
2001
  * A Tabs component that wraps a collection of tab and tab panel elements.
1844
2002
  *
@@ -7364,16 +7522,12 @@ export declare const RadioStyles: ElementStyles;
7364
7522
  export declare const RadioTemplate: ElementViewTemplate<Radio>;
7365
7523
 
7366
7524
  /**
7367
- * The base class used for constructing a fluent-rating-display custom element
7525
+ * A Rating Dislpay Custom HTML Element.
7526
+ * Based on BaseRatingDisplay and includes style and layout specific attributes
7527
+ *
7368
7528
  * @public
7369
7529
  */
7370
- export declare class RatingDisplay extends FASTElement {
7371
- /**
7372
- * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
7373
- *
7374
- * @internal
7375
- */
7376
- elementInternals: ElementInternals;
7530
+ export declare class RatingDisplay extends BaseRatingDisplay {
7377
7531
  /**
7378
7532
  * The color of the rating display icons.
7379
7533
  *
@@ -7390,32 +7544,6 @@ export declare class RatingDisplay extends FASTElement {
7390
7544
  * @param next - The next state
7391
7545
  */
7392
7546
  colorChanged(prev: RatingDisplayColor | undefined, next: RatingDisplayColor | undefined): void;
7393
- /**
7394
- * Renders a single filled icon with a label next to it.
7395
- *
7396
- * @public
7397
- * @remarks
7398
- * HTML Attribute: `compact`
7399
- */
7400
- compact: boolean;
7401
- /**
7402
- * The number of ratings.
7403
- *
7404
- * @public
7405
- * @remarks
7406
- * HTML Attribute: `count`
7407
- */
7408
- count?: number;
7409
- /**
7410
- * The maximum possible value of the rating.
7411
- * This attribute determines the number of icons displayed.
7412
- * Must be a whole number greater than 1.
7413
- *
7414
- * @public
7415
- * @remarks
7416
- * HTML Attribute: `max`
7417
- */
7418
- max?: number;
7419
7547
  /**
7420
7548
  * The size of the component.
7421
7549
  *
@@ -7433,27 +7561,25 @@ export declare class RatingDisplay extends FASTElement {
7433
7561
  */
7434
7562
  sizeChanged(prev: RatingDisplaySize | undefined, next: RatingDisplaySize | undefined): void;
7435
7563
  /**
7436
- * The value of the rating.
7564
+ * Renders a single filled icon with a label next to it.
7437
7565
  *
7438
7566
  * @public
7439
7567
  * @remarks
7440
- * HTML Attribute: `value`
7568
+ * HTML Attribute: `compact`
7441
7569
  */
7442
- value?: number;
7443
- private intlNumberFormatter;
7444
- constructor();
7570
+ compact: boolean;
7445
7571
  /**
7446
- * Returns "count" as string, formatted according to the locale.
7572
+ * Overrides the selected value and returns 1 if compact is true.
7447
7573
  *
7448
- * @internal
7574
+ * @override
7449
7575
  */
7450
- get formattedCount(): string;
7576
+ protected getSelectedValue(): number;
7451
7577
  /**
7452
- * Generates the icon SVG elements based on the "max" attribute.
7578
+ * Overrides the maximum icons and returns a max of 1 if compact is true.
7453
7579
  *
7454
- * @internal
7580
+ * @override
7455
7581
  */
7456
- generateIcons(): string;
7582
+ protected getMaxIcons(): number;
7457
7583
  }
7458
7584
 
7459
7585
  /**
@@ -8406,6 +8532,170 @@ export declare interface Tab extends StartEnd {
8406
8532
 
8407
8533
  export declare const TabDefinition: FASTElementDefinition<typeof Tab>;
8408
8534
 
8535
+ /**
8536
+ * A BaseTablist component with extra logic for handling the styled active tab indicator.
8537
+ * @public
8538
+ */
8539
+ export declare class Tablist extends BaseTablist {
8540
+ /**
8541
+ * activeTabData
8542
+ * The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
8543
+ */
8544
+ private activeTabData;
8545
+ /**
8546
+ * previousActiveTabData
8547
+ * The positional coordinates and size dimensions of the active tab. Used for calculating the offset and scale of the tab active indicator.
8548
+ */
8549
+ private previousActiveTabData;
8550
+ /**
8551
+ * activeTabOffset
8552
+ * Used to position the active indicator for animations of the active indicator on active tab changes.
8553
+ */
8554
+ private activeTabOffset;
8555
+ /**
8556
+ * activeTabScale
8557
+ * Used to scale the tab active indicator up or down as animations of the active indicator occur.
8558
+ */
8559
+ private activeTabScale;
8560
+ /**
8561
+ * appearance
8562
+ * There are two modes of appearance: transparent and subtle.
8563
+ */
8564
+ appearance?: TablistAppearance;
8565
+ /**
8566
+ * @internal
8567
+ */
8568
+ protected appearanceChanged(prev: TablistAppearance, next: TablistAppearance): void;
8569
+ /**
8570
+ * size
8571
+ * defaults to medium.
8572
+ * Used to set the size of all the tab controls, which effects text size and margins. Three sizes: small, medium and large.
8573
+ */
8574
+ size?: TablistSize;
8575
+ /**
8576
+ * @internal
8577
+ */
8578
+ protected sizeChanged(prev: TablistSize, next: TablistSize): void;
8579
+ /**
8580
+ * calculateAnimationProperties
8581
+ *
8582
+ * Recalculates the active tab offset and scale.
8583
+ * These values will be applied to css variables that control the tab active indicator position animations
8584
+ */
8585
+ private calculateAnimationProperties;
8586
+ /**
8587
+ * getSelectedTabPosition - gets the x or y coordinates of the tab
8588
+ */
8589
+ private getTabPosition;
8590
+ /**
8591
+ * getSelectedTabScale - gets the scale of the tab
8592
+ */
8593
+ private getTabScale;
8594
+ /**
8595
+ * Calculates and applies updated values to CSS variables.
8596
+ *
8597
+ * @param tab - the tab element to apply the updated values to
8598
+ * @internal
8599
+ */
8600
+ private applyUpdatedCSSValues;
8601
+ /**
8602
+ * Runs through all the operations required for setting the tab active indicator to its starting location, ending
8603
+ * location, and applying the animated css class to the tab.
8604
+ *
8605
+ * @param tab - the tab element to apply the updated values to
8606
+ * @internal
8607
+ */
8608
+ private animationLoop;
8609
+ /**
8610
+ * Sets the data from the active tab onto the class. used for making all the animation calculations for the active
8611
+ * tab indicator.
8612
+ *
8613
+ * @internal
8614
+ */
8615
+ private setTabData;
8616
+ /**
8617
+ * Sets the css variables for the active tab indicator.
8618
+ * @internal
8619
+ */
8620
+ private setAnimationVars;
8621
+ /**
8622
+ * Initiates the active tab indicator animation loop when activeid changes.
8623
+ * @param oldValue - the previous tabId
8624
+ * @param newValue - the new tabId
8625
+ */
8626
+ activeidChanged(oldValue: string, newValue: string): void;
8627
+ /**
8628
+ * Initiates the active tab indicator animation loop when tabs change.
8629
+ */
8630
+ tabsChanged(): void;
8631
+ }
8632
+
8633
+ /**
8634
+ * The appearance of the component
8635
+ * @public
8636
+ */
8637
+ export declare const TablistAppearance: {
8638
+ readonly subtle: "subtle";
8639
+ readonly transparent: "transparent";
8640
+ };
8641
+
8642
+ /**
8643
+ * The types for the Tablist appearance
8644
+ * @public
8645
+ */
8646
+ export declare type TablistAppearance = ValuesOf<typeof TablistAppearance>;
8647
+
8648
+ /**
8649
+ * @public
8650
+ * @remarks
8651
+ * HTML Element: \<fluent-tablist\>
8652
+ */
8653
+ export declare const TablistDefinition: FASTElementDefinition<typeof Tablist>;
8654
+
8655
+ /**
8656
+ * The orientation of the component
8657
+ * @public
8658
+ */
8659
+ export declare const TablistOrientation: {
8660
+ readonly horizontal: "horizontal"; /**
8661
+ * The appearance of the component
8662
+ * @public
8663
+ */
8664
+ readonly vertical: "vertical";
8665
+ };
8666
+
8667
+ /**
8668
+ * The types for the Tablist orientation
8669
+ * @public
8670
+ */
8671
+ export declare type TablistOrientation = ValuesOf<typeof TablistOrientation>;
8672
+
8673
+ /**
8674
+ * The size of the component
8675
+ * @public
8676
+ */
8677
+ export declare const TablistSize: {
8678
+ readonly small: "small";
8679
+ readonly medium: "medium";
8680
+ readonly large: "large";
8681
+ };
8682
+
8683
+ /**
8684
+ * The types for the Tablist size
8685
+ * @public
8686
+ */
8687
+ export declare type TablistSize = ValuesOf<typeof TablistSize>;
8688
+
8689
+ /**
8690
+ * @public
8691
+ */
8692
+ export declare const TablistStyles: ElementStyles;
8693
+
8694
+ /**
8695
+ * @public
8696
+ */
8697
+ export declare const TablistTemplate: ViewTemplate<Tablist, any>;
8698
+
8409
8699
  /**
8410
8700
  * Tab configuration options
8411
8701
  * @public