@fluentui/web-components 3.0.0-rc.10 → 3.0.0-rc.11

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 (85) hide show
  1. package/CHANGELOG.md +11 -2
  2. package/custom-elements.json +125 -140
  3. package/dist/esm/anchor-button/anchor-button.base.js +1 -0
  4. package/dist/esm/anchor-button/anchor-button.base.js.map +1 -1
  5. package/dist/esm/avatar/avatar.base.d.ts +64 -10
  6. package/dist/esm/avatar/avatar.base.js +100 -27
  7. package/dist/esm/avatar/avatar.base.js.map +1 -1
  8. package/dist/esm/avatar/avatar.styles.js +20 -3
  9. package/dist/esm/avatar/avatar.styles.js.map +1 -1
  10. package/dist/esm/avatar/avatar.template.js +4 -3
  11. package/dist/esm/avatar/avatar.template.js.map +1 -1
  12. package/dist/esm/button/button.base.d.ts +15 -1
  13. package/dist/esm/button/button.base.js +27 -24
  14. package/dist/esm/button/button.base.js.map +1 -1
  15. package/dist/esm/button/button.template.d.ts +3 -3
  16. package/dist/esm/button/button.template.js.map +1 -1
  17. package/dist/esm/dialog/dialog.d.ts +8 -3
  18. package/dist/esm/dialog/dialog.js +26 -20
  19. package/dist/esm/dialog/dialog.js.map +1 -1
  20. package/dist/esm/drawer/drawer.js +0 -1
  21. package/dist/esm/drawer/drawer.js.map +1 -1
  22. package/dist/esm/dropdown/dropdown.base.d.ts +1 -0
  23. package/dist/esm/dropdown/dropdown.base.js +24 -15
  24. package/dist/esm/dropdown/dropdown.base.js.map +1 -1
  25. package/dist/esm/listbox/listbox.d.ts +12 -7
  26. package/dist/esm/listbox/listbox.js +27 -17
  27. package/dist/esm/listbox/listbox.js.map +1 -1
  28. package/dist/esm/listbox/listbox.template.js +2 -3
  29. package/dist/esm/listbox/listbox.template.js.map +1 -1
  30. package/dist/esm/menu/menu.d.ts +7 -0
  31. package/dist/esm/menu/menu.js +22 -17
  32. package/dist/esm/menu/menu.js.map +1 -1
  33. package/dist/esm/option/option.js +1 -1
  34. package/dist/esm/option/option.js.map +1 -1
  35. package/dist/esm/progress-bar/progress-bar.base.d.ts +19 -4
  36. package/dist/esm/progress-bar/progress-bar.base.js +37 -19
  37. package/dist/esm/progress-bar/progress-bar.base.js.map +1 -1
  38. package/dist/esm/radio/radio.options.d.ts +9 -0
  39. package/dist/esm/radio/radio.options.js +12 -1
  40. package/dist/esm/radio/radio.options.js.map +1 -1
  41. package/dist/esm/radio-group/radio-group.d.ts +13 -7
  42. package/dist/esm/radio-group/radio-group.js +14 -21
  43. package/dist/esm/radio-group/radio-group.js.map +1 -1
  44. package/dist/esm/radio-group/radio-group.template.js +2 -2
  45. package/dist/esm/radio-group/radio-group.template.js.map +1 -1
  46. package/dist/esm/rating-display/rating-display.base.d.ts +11 -1
  47. package/dist/esm/rating-display/rating-display.base.js +24 -11
  48. package/dist/esm/rating-display/rating-display.base.js.map +1 -1
  49. package/dist/esm/slider/slider.d.ts +7 -3
  50. package/dist/esm/slider/slider.js +46 -28
  51. package/dist/esm/slider/slider.js.map +1 -1
  52. package/dist/esm/tab/tab.d.ts +13 -1
  53. package/dist/esm/tab/tab.js +16 -2
  54. package/dist/esm/tab/tab.js.map +1 -1
  55. package/dist/esm/tablist/tablist.base.d.ts +2 -1
  56. package/dist/esm/tablist/tablist.base.js +109 -95
  57. package/dist/esm/tablist/tablist.base.js.map +1 -1
  58. package/dist/esm/tablist/tablist.d.ts +2 -1
  59. package/dist/esm/tablist/tablist.js +2 -2
  60. package/dist/esm/tablist/tablist.js.map +1 -1
  61. package/dist/esm/text-input/text-input.base.js +12 -5
  62. package/dist/esm/text-input/text-input.base.js.map +1 -1
  63. package/dist/esm/text-input/text-input.template.d.ts +1 -1
  64. package/dist/esm/text-input/text-input.template.js +2 -8
  65. package/dist/esm/text-input/text-input.template.js.map +1 -1
  66. package/dist/esm/textarea/textarea.base.d.ts +7 -3
  67. package/dist/esm/textarea/textarea.base.js +38 -23
  68. package/dist/esm/textarea/textarea.base.js.map +1 -1
  69. package/dist/esm/tree/tree.base.d.ts +8 -0
  70. package/dist/esm/tree/tree.base.js +16 -2
  71. package/dist/esm/tree/tree.base.js.map +1 -1
  72. package/dist/esm/tree-item/tree-item.base.d.ts +7 -0
  73. package/dist/esm/tree-item/tree-item.base.js +14 -12
  74. package/dist/esm/tree-item/tree-item.base.js.map +1 -1
  75. package/dist/esm/utils/focusable-element.js +2 -1
  76. package/dist/esm/utils/focusable-element.js.map +1 -1
  77. package/dist/esm/utils/request-idle-callback.js +4 -9
  78. package/dist/esm/utils/request-idle-callback.js.map +1 -1
  79. package/dist/esm/utils/typings.d.ts +8 -0
  80. package/dist/esm/utils/typings.js +15 -1
  81. package/dist/esm/utils/typings.js.map +1 -1
  82. package/dist/web-components.d.ts +196 -43
  83. package/dist/web-components.js +537 -314
  84. package/dist/web-components.min.js +212 -212
  85. package/package.json +1 -1
@@ -980,16 +980,50 @@ export declare class BaseAnchor extends FASTElement {
980
980
  */
981
981
  export declare class BaseAvatar extends FASTElement {
982
982
  /**
983
- * Signal to remove event listeners when the component is disconnected.
983
+ * Reference to the default slot element.
984
984
  *
985
985
  * @internal
986
986
  */
987
- private abortSignal?;
987
+ defaultSlot: HTMLSlotElement;
988
988
  /**
989
- * Reference to the default slot element.
989
+ * Handles changes to the default slot element reference.
990
+ *
991
+ * Toggles the `has-slotted` class on the slot element for browsers that do not
992
+ * support the `:has-slotted` CSS selector. Defers cleanup using
993
+ * `Updates.enqueue` to avoid DOM mutations during hydration that could
994
+ * corrupt binding markers.
995
+ *
990
996
  * @internal
991
997
  */
992
- defaultSlot: HTMLSlotElement;
998
+ defaultSlotChanged(): void;
999
+ /**
1000
+ * Reference to the monogram element that displays generated initials.
1001
+ *
1002
+ * @internal
1003
+ */
1004
+ monogram: HTMLElement;
1005
+ /**
1006
+ * Updates the monogram text content when the ref is captured.
1007
+ *
1008
+ * @internal
1009
+ */
1010
+ protected monogramChanged(): void;
1011
+ /**
1012
+ * The slotted content nodes assigned to the default slot.
1013
+ *
1014
+ * @internal
1015
+ */
1016
+ slottedDefaults: Node[];
1017
+ /**
1018
+ * Handles changes to the slotted default content.
1019
+ *
1020
+ * Normalizes the DOM, toggles the `has-slotted` class on the default slot element
1021
+ * for browsers that do not support the `:has-slotted` CSS selector, and removes
1022
+ * empty text nodes from the default slot to keep the DOM clean.
1023
+ *
1024
+ * @internal
1025
+ */
1026
+ protected slottedDefaultsChanged(): void;
993
1027
  /**
994
1028
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
995
1029
  *
@@ -1004,24 +1038,44 @@ export declare class BaseAvatar extends FASTElement {
1004
1038
  * HTML Attribute: name
1005
1039
  */
1006
1040
  name?: string | undefined;
1041
+ /**
1042
+ * Handles changes to the name attribute.
1043
+ * @internal
1044
+ */
1045
+ protected nameChanged(): void;
1007
1046
  /**
1008
1047
  * Provide custom initials rather than one generated via the name
1009
1048
  *
1010
1049
  * @public
1011
1050
  * @remarks
1012
- * HTML Attribute: name
1051
+ * HTML Attribute: initials
1013
1052
  */
1014
1053
  initials?: string | undefined;
1015
- connectedCallback(): void;
1054
+ /**
1055
+ * Handles changes to the initials attribute.
1056
+ * @internal
1057
+ */
1058
+ protected initialsChanged(): void;
1016
1059
  constructor();
1017
- disconnectedCallback(): void;
1018
1060
  /**
1019
- * Removes any empty text nodes from the default slot when the slotted content changes.
1061
+ * Generates and sets the initials for the template.
1062
+ * Subclasses should override this to provide custom initials logic.
1063
+ *
1064
+ * @internal
1065
+ */
1066
+ generateInitials(): string | void;
1067
+ /**
1068
+ * Updates the monogram element's text content with the generated initials.
1020
1069
  *
1021
- * @param e - The event object
1022
1070
  * @internal
1023
1071
  */
1024
- slotchangeHandler(): void;
1072
+ protected updateMonogram(): void;
1073
+ /**
1074
+ * Normalizes the DOM and removes empty text nodes from the default slot.
1075
+ *
1076
+ * @internal
1077
+ */
1078
+ protected cleanupSlottedContent(): void;
1025
1079
  }
1026
1080
 
1027
1081
  /**
@@ -1060,7 +1114,15 @@ export declare class BaseButton extends FASTElement {
1060
1114
  * HTML Attribute: `disabled`
1061
1115
  */
1062
1116
  disabled: boolean;
1063
- protected disabledChanged(): void;
1117
+ /**
1118
+ * Handles changes to the disabled attribute. If the button is disabled, it
1119
+ * should not be focusable.
1120
+ *
1121
+ * @param previous - the previous disabled value
1122
+ * @param next - the new disabled value
1123
+ * @internal
1124
+ */
1125
+ disabledChanged(): void;
1064
1126
  /**
1065
1127
  * Indicates that the button is focusable while disabled.
1066
1128
  *
@@ -1250,6 +1312,12 @@ export declare class BaseButton extends FASTElement {
1250
1312
  * @public
1251
1313
  */
1252
1314
  resetForm(): void;
1315
+ /**
1316
+ * Sets the `tabindex` attribute based on the disabled state of the button.
1317
+ *
1318
+ * @internal
1319
+ */
1320
+ protected setTabIndex(): void;
1253
1321
  /**
1254
1322
  * Submits the associated form.
1255
1323
  *
@@ -2083,6 +2151,7 @@ export declare class BaseDropdown extends FASTElement {
2083
2151
  * @internal
2084
2152
  */
2085
2153
  protected updateFreeformOption(value?: string): void;
2154
+ connectedCallback(): void;
2086
2155
  disconnectedCallback(): void;
2087
2156
  /**
2088
2157
  * When anchor positioning isn't supported, an intersection observer is used to flip the listbox when it hits the
@@ -2222,8 +2291,17 @@ export declare class BaseField extends FASTElement {
2222
2291
  * @public
2223
2292
  */
2224
2293
  export declare class BaseProgressBar extends FASTElement {
2225
- /** @internal */
2226
- indicator: HTMLElement;
2294
+ /**
2295
+ * Reference to the indicator element which visually represents the progress.
2296
+ *
2297
+ * @internal
2298
+ */
2299
+ indicator?: HTMLElement;
2300
+ /**
2301
+ * Updates the indicator width after the element is connected to the DOM via the template.
2302
+ * @internal
2303
+ */
2304
+ protected indicatorChanged(): void;
2227
2305
  /**
2228
2306
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2229
2307
  *
@@ -2294,8 +2372,14 @@ export declare class BaseProgressBar extends FASTElement {
2294
2372
  */
2295
2373
  protected maxChanged(prev: number | undefined, next: number | undefined): void;
2296
2374
  constructor();
2297
- connectedCallback(): void;
2298
- private setIndicatorWidth;
2375
+ /**
2376
+ * Sets the width of the indicator element based on the value, min, and max
2377
+ * properties. If the browser supports `width: attr(value)`, this method does
2378
+ * nothing and allows CSS to handle the width.
2379
+ *
2380
+ * @internal
2381
+ */
2382
+ protected setIndicatorWidth(): void;
2299
2383
  }
2300
2384
 
2301
2385
  /**
@@ -2313,8 +2397,18 @@ export declare class BaseRatingDisplay extends FASTElement {
2313
2397
  * @internal
2314
2398
  */
2315
2399
  elementInternals: ElementInternals;
2316
- /** @internal */
2400
+ /**
2401
+ * Reference to the slot element used for the rating icon.
2402
+ *
2403
+ * @internal
2404
+ */
2317
2405
  iconSlot: HTMLSlotElement;
2406
+ /**
2407
+ * Updates the icon when the referenced slot is bound in the template.
2408
+ *
2409
+ * @internal
2410
+ */
2411
+ iconSlotChanged(): void;
2318
2412
  protected defaultCustomIconViewBox: string;
2319
2413
  /**
2320
2414
  * The element that displays the rating icons.
@@ -2452,7 +2546,7 @@ export declare class BaseTablist extends FASTElement {
2452
2546
  /**
2453
2547
  * @internal
2454
2548
  */
2455
- protected tabsChanged(): void;
2549
+ protected tabsChanged(prev: Tab[] | undefined, next: Tab[] | undefined): void;
2456
2550
  /**
2457
2551
  * A reference to the active tab
2458
2552
  * @public
@@ -2484,6 +2578,7 @@ export declare class BaseTablist extends FASTElement {
2484
2578
  adjust(adjustment: number): void;
2485
2579
  private activateTabByIndex;
2486
2580
  private focusTab;
2581
+ constructor();
2487
2582
  /**
2488
2583
  * @internal
2489
2584
  */
@@ -2533,6 +2628,13 @@ export declare class BaseTextArea extends FASTElement {
2533
2628
  * @internal
2534
2629
  */
2535
2630
  controlEl: HTMLTextAreaElement;
2631
+ /**
2632
+ * Sets up a mutation observer to watch for changes to the control element's
2633
+ * attributes that could affect validity, and binds an input event listener to detect user interaction.
2634
+ *
2635
+ * @internal
2636
+ */
2637
+ protected controlElChanged(): void;
2536
2638
  /**
2537
2639
  * @internal
2538
2640
  */
@@ -2817,13 +2919,10 @@ export declare class BaseTextArea extends FASTElement {
2817
2919
  * @public
2818
2920
  */
2819
2921
  select(): void;
2820
- private setDefaultValue;
2821
- private bindEvents;
2822
2922
  /**
2823
2923
  * Gets the content inside the light DOM, if any HTML element is present, use its `outerHTML` value.
2824
2924
  */
2825
2925
  private getContent;
2826
- private observeControlElAttrs;
2827
2926
  private setDisabledSideEffect;
2828
2927
  private toggleUserValidityState;
2829
2928
  private maybeCreateAutoSizerEl;
@@ -3262,7 +3361,15 @@ export declare class BaseTree extends FASTElement {
3262
3361
  elementInternals: ElementInternals;
3263
3362
  /** @internal */
3264
3363
  defaultSlot: HTMLSlotElement;
3364
+ /**
3365
+ * Calls the slot change handler when the `defaultSlot` reference is updated
3366
+ * by the template binding.
3367
+ *
3368
+ * @internal
3369
+ */
3370
+ defaultSlotChanged(): void;
3265
3371
  constructor();
3372
+ connectedCallback(): void;
3266
3373
  /** @internal */
3267
3374
  childTreeItems: BaseTreeItem[];
3268
3375
  /** @internal */
@@ -3324,6 +3431,13 @@ declare class BaseTreeItem extends FASTElement {
3324
3431
  elementInternals: ElementInternals;
3325
3432
  /** @internal */
3326
3433
  itemSlot: HTMLSlotElement;
3434
+ /**
3435
+ * Calls the slot change handler when the `itemSlot` reference is updated
3436
+ * by the template binding.
3437
+ *
3438
+ * @internal
3439
+ */
3440
+ itemSlotChanged(): void;
3327
3441
  constructor();
3328
3442
  /**
3329
3443
  * When true, the control will be appear expanded by user interaction.
@@ -3616,7 +3730,7 @@ export declare type ButtonSize = ValuesOf<typeof ButtonSize>;
3616
3730
  *
3617
3731
  * @public
3618
3732
  */
3619
- export declare const ButtonTemplate: ElementViewTemplate<Button>;
3733
+ export declare const ButtonTemplate: ElementViewTemplate<BaseButton>;
3620
3734
 
3621
3735
  /**
3622
3736
  * Button type values.
@@ -6288,6 +6402,7 @@ export declare class Dialog extends FASTElement {
6288
6402
  * @public
6289
6403
  */
6290
6404
  dialog: HTMLDialogElement;
6405
+ protected dialogChanged(): void;
6291
6406
  /**
6292
6407
  * The ID of the element that describes the dialog
6293
6408
  *
@@ -6312,9 +6427,7 @@ export declare class Dialog extends FASTElement {
6312
6427
  * @public
6313
6428
  */
6314
6429
  type: DialogType;
6315
- protected typeChanged(prev: DialogType | undefined, next: DialogType | undefined): void;
6316
- /** @internal */
6317
- connectedCallback(): void;
6430
+ protected typeChanged(prev: DialogType | undefined, next: DialogType): void;
6318
6431
  /**
6319
6432
  * Method to emit an event before the dialog's open state changes
6320
6433
  * HTML spec proposal: https://github.com/whatwg/html/issues/9733
@@ -6349,6 +6462,12 @@ export declare class Dialog extends FASTElement {
6349
6462
  * @returns boolean
6350
6463
  */
6351
6464
  clickHandler(event: Event): boolean;
6465
+ /**
6466
+ * Updates the internal dialog element's attributes based on its type.
6467
+ *
6468
+ * @internal
6469
+ */
6470
+ protected updateDialogAttributes(): void;
6352
6471
  }
6353
6472
 
6354
6473
  /**
@@ -7846,14 +7965,18 @@ export declare const LinkTemplate: ElementViewTemplate<Link>;
7846
7965
  */
7847
7966
  export declare class Listbox extends FASTElement {
7848
7967
  /**
7849
- * Sets the listbox ID to a unique value if one is not provided.
7968
+ * A reference to the default slot element.
7850
7969
  *
7851
- * @override
7852
- * @public
7853
- * @remarks
7854
- * HTML Attribute: `id`
7970
+ * @internal
7855
7971
  */
7856
- id: string;
7972
+ defaultSlot: HTMLSlotElement;
7973
+ /**
7974
+ * Calls the `slotchangeHandler` when the `defaultSlot` element is assigned
7975
+ * via the `ref` directive in the template.
7976
+ *
7977
+ * @internal
7978
+ */
7979
+ protected defaultSlotChanged(): void;
7857
7980
  /**
7858
7981
  * Indicates whether the listbox allows multiple selection.
7859
7982
  *
@@ -7926,6 +8049,7 @@ export declare class Listbox extends FASTElement {
7926
8049
  */
7927
8050
  clickHandler(e: PointerEvent): boolean | void;
7928
8051
  constructor();
8052
+ connectedCallback(): void;
7929
8053
  /**
7930
8054
  * Handles observable subscriptions for the listbox.
7931
8055
  *
@@ -7949,7 +8073,7 @@ export declare class Listbox extends FASTElement {
7949
8073
  * @param e - The slotchange event
7950
8074
  * @public
7951
8075
  */
7952
- slotchangeHandler(e: Event): void;
8076
+ slotchangeHandler(e?: Event): void;
7953
8077
  }
7954
8078
 
7955
8079
  /**
@@ -8170,6 +8294,13 @@ export declare class Menu extends FASTElement {
8170
8294
  * @public
8171
8295
  */
8172
8296
  slottedMenuList: MenuList[];
8297
+ /**
8298
+ * Sets up the component when the slotted menu list changes.
8299
+ * @param prev - The previous items in the slotted menu list.
8300
+ * @param next - The new items in the slotted menu list.
8301
+ * @internal
8302
+ */
8303
+ slottedMenuListChanged(prev: MenuList[] | undefined, next: MenuList[] | undefined): void;
8173
8304
  /**
8174
8305
  * Holds the slotted triggers.
8175
8306
  * @public
@@ -9083,6 +9214,19 @@ export declare class RadioGroup extends FASTElement {
9083
9214
  * @param next - the current required value
9084
9215
  */
9085
9216
  requiredChanged(prev: boolean, next: boolean): void;
9217
+ /**
9218
+ * The collection of radios that are slotted into the default slot.
9219
+ *
9220
+ * @internal
9221
+ */
9222
+ slottedRadios: Radio[];
9223
+ /**
9224
+ * Updates the radios collection when the slotted radios change.
9225
+ *
9226
+ * @param prev - the previous slotted radios
9227
+ * @param next - the current slotted radios
9228
+ */
9229
+ slottedRadiosChanged(prev: Radio[] | undefined, next: Radio[]): void;
9086
9230
  /**
9087
9231
  * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
9088
9232
  *
@@ -9238,13 +9382,6 @@ export declare class RadioGroup extends FASTElement {
9238
9382
  * - This allows form submission to proceed
9239
9383
  */
9240
9384
  setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
9241
- /**
9242
- * Updates the collection of child radios when the slot changes.
9243
- *
9244
- * @param e - the slot change event
9245
- * @internal
9246
- */
9247
- slotchangeHandler(e: Event): void;
9248
9385
  }
9249
9386
 
9250
9387
  /**
@@ -9715,6 +9852,13 @@ export declare class Slider extends FASTElement implements SliderConfiguration {
9715
9852
  */
9716
9853
  disabled: boolean;
9717
9854
  protected disabledChanged(): void;
9855
+ /**
9856
+ * Returns true if the component is disabled, taking into account the `disabled`
9857
+ * attribute, `aria-disabled` attribute, and the `:disabled` pseudo-class.
9858
+ *
9859
+ * @internal
9860
+ */
9861
+ protected get isDisabled(): boolean;
9718
9862
  /**
9719
9863
  * The minimum allowed value.
9720
9864
  *
@@ -9785,9 +9929,6 @@ export declare class Slider extends FASTElement implements SliderConfiguration {
9785
9929
  */
9786
9930
  mode: SliderMode;
9787
9931
  constructor();
9788
- /**
9789
- * @internal
9790
- */
9791
9932
  connectedCallback(): void;
9792
9933
  /**
9793
9934
  * @internal
@@ -10288,7 +10429,19 @@ export declare class Tab extends FASTElement {
10288
10429
  * HTML Attribute: disabled
10289
10430
  */
10290
10431
  disabled: boolean;
10291
- private styles;
10432
+ /**
10433
+ * Internal text content stylesheet, used to set the content of the `::after`
10434
+ * pseudo element to prevent layout shift when the font weight changes on selection.
10435
+ * @internal
10436
+ */
10437
+ private styles?;
10438
+ /**
10439
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
10440
+ *
10441
+ * @internal
10442
+ */
10443
+ elementInternals: ElementInternals;
10444
+ constructor();
10292
10445
  connectedCallback(): void;
10293
10446
  }
10294
10447
 
@@ -10387,7 +10540,7 @@ export declare class Tablist extends BaseTablist {
10387
10540
  /**
10388
10541
  * Initiates the active tab indicator animation loop when tabs change.
10389
10542
  */
10390
- tabsChanged(): void;
10543
+ tabsChanged(prev: Tab[] | undefined, next: Tab[] | undefined): void;
10391
10544
  }
10392
10545
 
10393
10546
  /**