@fluentui/web-components 3.0.0-beta.50 → 3.0.0-beta.52
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 +22 -2
- package/dist/dts/avatar/avatar.d.ts +42 -42
- package/dist/dts/field/field.d.ts +17 -9
- package/dist/dts/field/index.d.ts +1 -1
- package/dist/dts/index.d.ts +3 -1
- package/dist/esm/accordion/accordion.js +5 -5
- package/dist/esm/accordion/accordion.js.map +1 -1
- package/dist/esm/avatar/avatar.js +48 -48
- package/dist/esm/avatar/avatar.js.map +1 -1
- package/dist/esm/field/field.js +27 -16
- package/dist/esm/field/field.js.map +1 -1
- package/dist/esm/field/index.js +1 -1
- package/dist/esm/field/index.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/web-components.d.ts +201 -175
- package/dist/web-components.js +48 -41
- package/dist/web-components.min.js +166 -166
- package/package.json +1 -1
package/dist/web-components.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="web" />
|
|
2
2
|
|
|
3
|
+
import { CaptureType } from '@microsoft/fast-element';
|
|
3
4
|
import { CSSDirective } from '@microsoft/fast-element';
|
|
4
5
|
import { Direction } from '@microsoft/fast-web-utilities';
|
|
5
6
|
import { ElementStyles } from '@microsoft/fast-element';
|
|
@@ -405,6 +406,65 @@ export declare class Avatar extends BaseAvatar {
|
|
|
405
406
|
* HTML Attribute: appearance
|
|
406
407
|
*/
|
|
407
408
|
appearance?: AvatarAppearance | undefined;
|
|
409
|
+
/**
|
|
410
|
+
* Size of the avatar in pixels.
|
|
411
|
+
*
|
|
412
|
+
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
413
|
+
* based on design guidelines for the Avatar control.
|
|
414
|
+
*
|
|
415
|
+
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
416
|
+
* to override the rendered size.
|
|
417
|
+
*
|
|
418
|
+
* @public
|
|
419
|
+
* @remarks
|
|
420
|
+
* HTML Attribute: size
|
|
421
|
+
*
|
|
422
|
+
*/
|
|
423
|
+
size?: AvatarSize | undefined;
|
|
424
|
+
/**
|
|
425
|
+
* The color when displaying either an icon or initials.
|
|
426
|
+
* * neutral (default): gray
|
|
427
|
+
* * brand: color from the brand palette
|
|
428
|
+
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or colorId if provided)
|
|
429
|
+
* * [AvatarNamedColor]: a specific color from the theme
|
|
430
|
+
*
|
|
431
|
+
* @public
|
|
432
|
+
* @remarks
|
|
433
|
+
* HTML Attribute: color
|
|
434
|
+
*/
|
|
435
|
+
color?: AvatarColor | undefined;
|
|
436
|
+
/**
|
|
437
|
+
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
438
|
+
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
439
|
+
*/
|
|
440
|
+
colorId?: AvatarNamedColor | undefined;
|
|
441
|
+
/**
|
|
442
|
+
* Holds the current color state
|
|
443
|
+
*/
|
|
444
|
+
private currentColor;
|
|
445
|
+
/**
|
|
446
|
+
* Handles changes to observable properties
|
|
447
|
+
* @internal
|
|
448
|
+
* @param source - the source of the change
|
|
449
|
+
* @param propertyName - the property name being changed
|
|
450
|
+
*/
|
|
451
|
+
handleChange(source: any, propertyName: string): void;
|
|
452
|
+
/**
|
|
453
|
+
* Generates and sets the initials for the template
|
|
454
|
+
* @internal
|
|
455
|
+
*/
|
|
456
|
+
generateInitials(): string | void;
|
|
457
|
+
/**
|
|
458
|
+
* Sets the data-color attribute used for the visual presentation
|
|
459
|
+
* @internal
|
|
460
|
+
*/
|
|
461
|
+
generateColor(): void;
|
|
462
|
+
/**
|
|
463
|
+
* An array of the available Avatar named colors
|
|
464
|
+
*/
|
|
465
|
+
static colors: ("anchor" | "dark-red" | "cranberry" | "red" | "pumpkin" | "peach" | "marigold" | "gold" | "brass" | "brown" | "forest" | "seafoam" | "dark-green" | "light-teal" | "teal" | "steel" | "blue" | "royal-blue" | "cornflower" | "navy" | "lavender" | "purple" | "grape" | "lilac" | "pink" | "magenta" | "plum" | "beige" | "mink" | "platinum")[];
|
|
466
|
+
connectedCallback(): void;
|
|
467
|
+
disconnectedCallback(): void;
|
|
408
468
|
}
|
|
409
469
|
|
|
410
470
|
/**
|
|
@@ -983,21 +1043,6 @@ export declare class BaseAvatar extends FASTElement {
|
|
|
983
1043
|
* HTML Attribute: name
|
|
984
1044
|
*/
|
|
985
1045
|
initials?: string | undefined;
|
|
986
|
-
/**
|
|
987
|
-
* Size of the avatar in pixels.
|
|
988
|
-
*
|
|
989
|
-
* Size is restricted to a limited set of supported values recommended for most uses (see `AvatarSizeValue`) and
|
|
990
|
-
* based on design guidelines for the Avatar control.
|
|
991
|
-
*
|
|
992
|
-
* If a non-supported size is neeeded, set `size` to the next-smaller supported size, and set `width` and `height`
|
|
993
|
-
* to override the rendered size.
|
|
994
|
-
*
|
|
995
|
-
* @public
|
|
996
|
-
* @remarks
|
|
997
|
-
* HTML Attribute: size
|
|
998
|
-
*
|
|
999
|
-
*/
|
|
1000
|
-
size?: AvatarSize | undefined;
|
|
1001
1046
|
/**
|
|
1002
1047
|
* Optional activity indicator
|
|
1003
1048
|
* * active: the avatar will be decorated according to activeAppearance
|
|
@@ -1009,51 +1054,7 @@ export declare class BaseAvatar extends FASTElement {
|
|
|
1009
1054
|
* HTML Attribute: active
|
|
1010
1055
|
*/
|
|
1011
1056
|
active?: AvatarActive | undefined;
|
|
1012
|
-
/**
|
|
1013
|
-
* The color when displaying either an icon or initials.
|
|
1014
|
-
* * neutral (default): gray
|
|
1015
|
-
* * brand: color from the brand palette
|
|
1016
|
-
* * colorful: picks a color from a set of pre-defined colors, based on a hash of the name (or colorId if provided)
|
|
1017
|
-
* * [AvatarNamedColor]: a specific color from the theme
|
|
1018
|
-
*
|
|
1019
|
-
* @public
|
|
1020
|
-
* @remarks
|
|
1021
|
-
* HTML Attribute: color
|
|
1022
|
-
*/
|
|
1023
|
-
color?: AvatarColor | undefined;
|
|
1024
|
-
/**
|
|
1025
|
-
* Specify a string to be used instead of the name, to determine which color to use when color="colorful".
|
|
1026
|
-
* Use this when a name is not available, but there is another unique identifier that can be used instead.
|
|
1027
|
-
*/
|
|
1028
|
-
colorId?: AvatarNamedColor | undefined;
|
|
1029
|
-
/**
|
|
1030
|
-
* Holds the current color state
|
|
1031
|
-
*/
|
|
1032
|
-
private currentColor;
|
|
1033
1057
|
constructor();
|
|
1034
|
-
connectedCallback(): void;
|
|
1035
|
-
disconnectedCallback(): void;
|
|
1036
|
-
/**
|
|
1037
|
-
* Handles changes to observable properties
|
|
1038
|
-
* @internal
|
|
1039
|
-
* @param source - the source of the change
|
|
1040
|
-
* @param propertyName - the property name being changed
|
|
1041
|
-
*/
|
|
1042
|
-
handleChange(source: any, propertyName: string): void;
|
|
1043
|
-
/**
|
|
1044
|
-
* Sets the data-color attribute used for the visual presentation
|
|
1045
|
-
* @internal
|
|
1046
|
-
*/
|
|
1047
|
-
generateColor(): void;
|
|
1048
|
-
/**
|
|
1049
|
-
* Generates and sets the initials for the template
|
|
1050
|
-
* @internal
|
|
1051
|
-
*/
|
|
1052
|
-
generateInitials(): string | void;
|
|
1053
|
-
/**
|
|
1054
|
-
* An array of the available Avatar named colors
|
|
1055
|
-
*/
|
|
1056
|
-
static colors: ("anchor" | "dark-red" | "cranberry" | "red" | "pumpkin" | "peach" | "marigold" | "gold" | "brass" | "brown" | "forest" | "seafoam" | "dark-green" | "light-teal" | "teal" | "steel" | "blue" | "royal-blue" | "cornflower" | "navy" | "lavender" | "purple" | "grape" | "lilac" | "pink" | "magenta" | "plum" | "beige" | "mink" | "platinum")[];
|
|
1057
1058
|
}
|
|
1058
1059
|
|
|
1059
1060
|
/**
|
|
@@ -1633,6 +1634,125 @@ export declare class BaseDivider extends FASTElement {
|
|
|
1633
1634
|
orientationChanged(previous: string | null, next: string | null): void;
|
|
1634
1635
|
}
|
|
1635
1636
|
|
|
1637
|
+
/**
|
|
1638
|
+
* A Field Custom HTML Element.
|
|
1639
|
+
*
|
|
1640
|
+
* @public
|
|
1641
|
+
*/
|
|
1642
|
+
export declare class BaseField extends FASTElement {
|
|
1643
|
+
/**
|
|
1644
|
+
* The slotted label elements.
|
|
1645
|
+
*
|
|
1646
|
+
* @internal
|
|
1647
|
+
*/
|
|
1648
|
+
labelSlot: Node[];
|
|
1649
|
+
/**
|
|
1650
|
+
* Updates attributes on the slotted label elements.
|
|
1651
|
+
*
|
|
1652
|
+
* @param prev - the previous list of slotted label elements
|
|
1653
|
+
* @param next - the current list of slotted label elements
|
|
1654
|
+
*/
|
|
1655
|
+
protected labelSlotChanged(prev: Node[], next: Node[]): void;
|
|
1656
|
+
/**
|
|
1657
|
+
* The slotted message elements. Filtered to only include elements with a `flag` attribute.
|
|
1658
|
+
*
|
|
1659
|
+
* @internal
|
|
1660
|
+
*/
|
|
1661
|
+
messageSlot: Element[];
|
|
1662
|
+
/**
|
|
1663
|
+
* Adds or removes the `invalid` event listener based on the presence of slotted message elements.
|
|
1664
|
+
*
|
|
1665
|
+
* @param prev - the previous list of slotted message elements
|
|
1666
|
+
* @param next - the current list of slotted message elements
|
|
1667
|
+
* @internal
|
|
1668
|
+
*/
|
|
1669
|
+
messageSlotChanged(prev: Element[], next: Element[]): void;
|
|
1670
|
+
/**
|
|
1671
|
+
* The slotted inputs.
|
|
1672
|
+
*
|
|
1673
|
+
* @internal
|
|
1674
|
+
* @privateRemarks
|
|
1675
|
+
* This field is populated with the `children` directive in the template rather than `slotted`.
|
|
1676
|
+
*/
|
|
1677
|
+
slottedInputs: SlottableInput[];
|
|
1678
|
+
/**
|
|
1679
|
+
* Sets the `input` property to the first slotted input.
|
|
1680
|
+
*
|
|
1681
|
+
* @param prev - The previous collection of inputs.
|
|
1682
|
+
* @param next - The current collection of inputs.
|
|
1683
|
+
* @internal
|
|
1684
|
+
*/
|
|
1685
|
+
slottedInputsChanged(prev: SlottableInput[] | undefined, next: SlottableInput[] | undefined): void;
|
|
1686
|
+
/**
|
|
1687
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
1688
|
+
*
|
|
1689
|
+
* @internal
|
|
1690
|
+
*/
|
|
1691
|
+
elementInternals: ElementInternals;
|
|
1692
|
+
/**
|
|
1693
|
+
* Reference to the first slotted input.
|
|
1694
|
+
*
|
|
1695
|
+
* @public
|
|
1696
|
+
*/
|
|
1697
|
+
input: SlottableInput;
|
|
1698
|
+
/**
|
|
1699
|
+
* Updates the field's states and label properties when the assigned input changes.
|
|
1700
|
+
*
|
|
1701
|
+
* @param prev - the previous input
|
|
1702
|
+
* @param next - the current input
|
|
1703
|
+
*/
|
|
1704
|
+
inputChanged(prev: SlottableInput | undefined, next: SlottableInput | undefined): void;
|
|
1705
|
+
/**
|
|
1706
|
+
* Calls the `setStates` method when a `change` event is emitted from the slotted input.
|
|
1707
|
+
*
|
|
1708
|
+
* @param e - the event object
|
|
1709
|
+
* @internal
|
|
1710
|
+
*/
|
|
1711
|
+
changeHandler(e: Event): boolean | void;
|
|
1712
|
+
/**
|
|
1713
|
+
* Redirects `click` events to the slotted input.
|
|
1714
|
+
*
|
|
1715
|
+
* @param e - the event object
|
|
1716
|
+
* @internal
|
|
1717
|
+
*/
|
|
1718
|
+
clickHandler(e: MouseEvent): boolean | void;
|
|
1719
|
+
constructor();
|
|
1720
|
+
/**
|
|
1721
|
+
* Applies the `focus-visible` state to the element when the slotted input receives visible focus.
|
|
1722
|
+
*
|
|
1723
|
+
* @param e - the focus event
|
|
1724
|
+
* @internal
|
|
1725
|
+
*/
|
|
1726
|
+
focusinHandler(e: FocusEvent): boolean | void;
|
|
1727
|
+
/**
|
|
1728
|
+
* Removes the `focus-visible` state from the field when a slotted input loses focus.
|
|
1729
|
+
*
|
|
1730
|
+
* @param e - the focus event
|
|
1731
|
+
* @internal
|
|
1732
|
+
*/
|
|
1733
|
+
focusoutHandler(e: FocusEvent): boolean | void;
|
|
1734
|
+
/**
|
|
1735
|
+
* Toggles validity state flags on the element when the slotted input emits an `invalid` event (if slotted validation messages are present).
|
|
1736
|
+
*
|
|
1737
|
+
* @param e - the event object
|
|
1738
|
+
* @internal
|
|
1739
|
+
*/
|
|
1740
|
+
invalidHandler(e: Event): boolean | void;
|
|
1741
|
+
/**
|
|
1742
|
+
* Sets ARIA and form-related attributes on slotted label elements.
|
|
1743
|
+
*
|
|
1744
|
+
* @internal
|
|
1745
|
+
*/
|
|
1746
|
+
private setLabelProperties;
|
|
1747
|
+
/**
|
|
1748
|
+
* Toggles the field's states based on the slotted input.
|
|
1749
|
+
*
|
|
1750
|
+
* @internal
|
|
1751
|
+
*/
|
|
1752
|
+
setStates(): void;
|
|
1753
|
+
setValidationStates(): void;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1636
1756
|
/**
|
|
1637
1757
|
* A Progress HTML Element.
|
|
1638
1758
|
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
|
|
@@ -5483,16 +5603,25 @@ export declare const durationUltraSlow = "var(--durationUltraSlow)";
|
|
|
5483
5603
|
* End configuration options
|
|
5484
5604
|
* @public
|
|
5485
5605
|
*/
|
|
5486
|
-
declare type EndOptions<TSource = any, TParent = any> = {
|
|
5606
|
+
export declare type EndOptions<TSource = any, TParent = any> = {
|
|
5487
5607
|
end?: StaticallyComposableHTML<TSource, TParent>;
|
|
5488
5608
|
};
|
|
5489
5609
|
|
|
5610
|
+
/**
|
|
5611
|
+
* The template for the end slot.
|
|
5612
|
+
* For use with {@link StartEnd}
|
|
5613
|
+
*
|
|
5614
|
+
* @public
|
|
5615
|
+
*/
|
|
5616
|
+
export declare function endSlotTemplate<TSource extends StartEnd = StartEnd, TParent = any>(options: EndOptions<TSource, TParent>): CaptureType<TSource, TParent>;
|
|
5617
|
+
|
|
5490
5618
|
/**
|
|
5491
5619
|
* A Field Custom HTML Element.
|
|
5620
|
+
* Based on BaseField and includes style and layout specific attributes
|
|
5492
5621
|
*
|
|
5493
5622
|
* @public
|
|
5494
5623
|
*/
|
|
5495
|
-
export declare class Field extends
|
|
5624
|
+
export declare class Field extends BaseField {
|
|
5496
5625
|
/**
|
|
5497
5626
|
* The position of the label relative to the input.
|
|
5498
5627
|
*
|
|
@@ -5501,117 +5630,6 @@ export declare class Field extends FASTElement {
|
|
|
5501
5630
|
* HTML Attribute: `label-position`
|
|
5502
5631
|
*/
|
|
5503
5632
|
labelPosition: FieldLabelPosition;
|
|
5504
|
-
/**
|
|
5505
|
-
* The slotted label elements.
|
|
5506
|
-
*
|
|
5507
|
-
* @internal
|
|
5508
|
-
*/
|
|
5509
|
-
labelSlot: Node[];
|
|
5510
|
-
/**
|
|
5511
|
-
* Updates attributes on the slotted label elements.
|
|
5512
|
-
*
|
|
5513
|
-
* @param prev - the previous list of slotted label elements
|
|
5514
|
-
* @param next - the current list of slotted label elements
|
|
5515
|
-
*/
|
|
5516
|
-
protected labelSlotChanged(prev: Node[], next: Node[]): void;
|
|
5517
|
-
/**
|
|
5518
|
-
* The slotted message elements. Filtered to only include elements with a `flag` attribute.
|
|
5519
|
-
*
|
|
5520
|
-
* @internal
|
|
5521
|
-
*/
|
|
5522
|
-
messageSlot: Element[];
|
|
5523
|
-
/**
|
|
5524
|
-
* Adds or removes the `invalid` event listener based on the presence of slotted message elements.
|
|
5525
|
-
*
|
|
5526
|
-
* @param prev - the previous list of slotted message elements
|
|
5527
|
-
* @param next - the current list of slotted message elements
|
|
5528
|
-
* @internal
|
|
5529
|
-
*/
|
|
5530
|
-
messageSlotChanged(prev: Element[], next: Element[]): void;
|
|
5531
|
-
/**
|
|
5532
|
-
* The slotted inputs.
|
|
5533
|
-
*
|
|
5534
|
-
* @internal
|
|
5535
|
-
* @privateRemarks
|
|
5536
|
-
* This field is populated with the `children` directive in the template rather than `slotted`.
|
|
5537
|
-
*/
|
|
5538
|
-
slottedInputs: SlottableInput[];
|
|
5539
|
-
/**
|
|
5540
|
-
* Sets the `input` property to the first slotted input.
|
|
5541
|
-
*
|
|
5542
|
-
* @param prev - The previous collection of inputs.
|
|
5543
|
-
* @param next - The current collection of inputs.
|
|
5544
|
-
* @internal
|
|
5545
|
-
*/
|
|
5546
|
-
slottedInputsChanged(prev: SlottableInput[] | undefined, next: SlottableInput[] | undefined): void;
|
|
5547
|
-
/**
|
|
5548
|
-
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
5549
|
-
*
|
|
5550
|
-
* @internal
|
|
5551
|
-
*/
|
|
5552
|
-
elementInternals: ElementInternals;
|
|
5553
|
-
/**
|
|
5554
|
-
* Reference to the first slotted input.
|
|
5555
|
-
*
|
|
5556
|
-
* @public
|
|
5557
|
-
*/
|
|
5558
|
-
input: SlottableInput;
|
|
5559
|
-
/**
|
|
5560
|
-
* Updates the field's states and label properties when the assigned input changes.
|
|
5561
|
-
*
|
|
5562
|
-
* @param prev - the previous input
|
|
5563
|
-
* @param next - the current input
|
|
5564
|
-
*/
|
|
5565
|
-
inputChanged(prev: SlottableInput | undefined, next: SlottableInput | undefined): void;
|
|
5566
|
-
/**
|
|
5567
|
-
* Calls the `setStates` method when a `change` event is emitted from the slotted input.
|
|
5568
|
-
*
|
|
5569
|
-
* @param e - the event object
|
|
5570
|
-
* @internal
|
|
5571
|
-
*/
|
|
5572
|
-
changeHandler(e: Event): boolean | void;
|
|
5573
|
-
/**
|
|
5574
|
-
* Redirects `click` events to the slotted input.
|
|
5575
|
-
*
|
|
5576
|
-
* @param e - the event object
|
|
5577
|
-
* @internal
|
|
5578
|
-
*/
|
|
5579
|
-
clickHandler(e: MouseEvent): boolean | void;
|
|
5580
|
-
constructor();
|
|
5581
|
-
/**
|
|
5582
|
-
* Applies the `focus-visible` state to the element when the slotted input receives visible focus.
|
|
5583
|
-
*
|
|
5584
|
-
* @param e - the focus event
|
|
5585
|
-
* @internal
|
|
5586
|
-
*/
|
|
5587
|
-
focusinHandler(e: FocusEvent): boolean | void;
|
|
5588
|
-
/**
|
|
5589
|
-
* Removes the `focus-visible` state from the field when a slotted input loses focus.
|
|
5590
|
-
*
|
|
5591
|
-
* @param e - the focus event
|
|
5592
|
-
* @internal
|
|
5593
|
-
*/
|
|
5594
|
-
focusoutHandler(e: FocusEvent): boolean | void;
|
|
5595
|
-
/**
|
|
5596
|
-
* Toggles validity state flags on the element when the slotted input emits an `invalid` event (if slotted validation messages are present).
|
|
5597
|
-
*
|
|
5598
|
-
* @param e - the event object
|
|
5599
|
-
* @internal
|
|
5600
|
-
*/
|
|
5601
|
-
invalidHandler(e: Event): boolean | void;
|
|
5602
|
-
/**
|
|
5603
|
-
* Sets ARIA and form-related attributes on slotted label elements.
|
|
5604
|
-
*
|
|
5605
|
-
* @internal
|
|
5606
|
-
*/
|
|
5607
|
-
private setLabelProperties;
|
|
5608
|
-
/**
|
|
5609
|
-
* Toggles the field's states based on the slotted input.
|
|
5610
|
-
*
|
|
5611
|
-
* @internal
|
|
5612
|
-
*/
|
|
5613
|
-
setStates(): void;
|
|
5614
|
-
setValidationStates(): void;
|
|
5615
5633
|
}
|
|
5616
5634
|
|
|
5617
5635
|
/**
|
|
@@ -8251,7 +8269,7 @@ export declare const SpinnerTemplate: ViewTemplate<Spinner, any>;
|
|
|
8251
8269
|
* These are generally used to decorate text elements with icons or other visual indicators.
|
|
8252
8270
|
* @public
|
|
8253
8271
|
*/
|
|
8254
|
-
declare class StartEnd {
|
|
8272
|
+
export declare class StartEnd {
|
|
8255
8273
|
start: HTMLSlotElement;
|
|
8256
8274
|
end: HTMLSlotElement;
|
|
8257
8275
|
}
|
|
@@ -8260,16 +8278,24 @@ declare class StartEnd {
|
|
|
8260
8278
|
* Start/End configuration options
|
|
8261
8279
|
* @public
|
|
8262
8280
|
*/
|
|
8263
|
-
declare type StartEndOptions<TSource = any, TParent = any> = StartOptions<TSource, TParent> & EndOptions<TSource, TParent>;
|
|
8281
|
+
export declare type StartEndOptions<TSource = any, TParent = any> = StartOptions<TSource, TParent> & EndOptions<TSource, TParent>;
|
|
8264
8282
|
|
|
8265
8283
|
/**
|
|
8266
8284
|
* Start configuration options
|
|
8267
8285
|
* @public
|
|
8268
8286
|
*/
|
|
8269
|
-
declare type StartOptions<TSource = any, TParent = any> = {
|
|
8287
|
+
export declare type StartOptions<TSource = any, TParent = any> = {
|
|
8270
8288
|
start?: StaticallyComposableHTML<TSource, TParent>;
|
|
8271
8289
|
};
|
|
8272
8290
|
|
|
8291
|
+
/**
|
|
8292
|
+
* The template for the start slots.
|
|
8293
|
+
* For use with {@link StartEnd}
|
|
8294
|
+
*
|
|
8295
|
+
* @public
|
|
8296
|
+
*/
|
|
8297
|
+
export declare function startSlotTemplate<TSource extends StartEnd = StartEnd, TParent = any>(options: StartOptions<TSource, TParent>): CaptureType<TSource, TParent>;
|
|
8298
|
+
|
|
8273
8299
|
/**
|
|
8274
8300
|
* A value that can be statically composed into a
|
|
8275
8301
|
* foundation template.
|
package/dist/web-components.js
CHANGED
|
@@ -4104,7 +4104,7 @@ class Accordion extends FASTElement {
|
|
|
4104
4104
|
children.forEach(child => Observable.getNotifier(child).subscribe(this, "disabled"));
|
|
4105
4105
|
this.accordionItems = children.filter(child => !child.hasAttribute("disabled"));
|
|
4106
4106
|
this.accordionItems.forEach((item, index) => {
|
|
4107
|
-
if (item instanceof
|
|
4107
|
+
if (item instanceof BaseAccordionItem) {
|
|
4108
4108
|
item.addEventListener("click", this.expandedChangedHandler);
|
|
4109
4109
|
Observable.getNotifier(item).subscribe(this, "expanded");
|
|
4110
4110
|
}
|
|
@@ -4132,7 +4132,7 @@ class Accordion extends FASTElement {
|
|
|
4132
4132
|
*/
|
|
4133
4133
|
this.expandedChangedHandler = evt => {
|
|
4134
4134
|
const item = evt.target;
|
|
4135
|
-
if (item instanceof
|
|
4135
|
+
if (item instanceof BaseAccordionItem) {
|
|
4136
4136
|
if (!this.isSingleExpandMode()) {
|
|
4137
4137
|
item.expanded = !item.expanded;
|
|
4138
4138
|
this.activeItemIndex = this.accordionItems.indexOf(item);
|
|
@@ -4186,7 +4186,7 @@ class Accordion extends FASTElement {
|
|
|
4186
4186
|
if (this.accordionItems.length === 0) {
|
|
4187
4187
|
return null;
|
|
4188
4188
|
}
|
|
4189
|
-
return this.accordionItems.find(item => item instanceof
|
|
4189
|
+
return this.accordionItems.find(item => item instanceof BaseAccordionItem && item.expanded) ?? this.accordionItems[0];
|
|
4190
4190
|
}
|
|
4191
4191
|
/**
|
|
4192
4192
|
* Checks if the accordion is in single expand mode
|
|
@@ -4207,7 +4207,7 @@ class Accordion extends FASTElement {
|
|
|
4207
4207
|
const currentItems = Array.from(this.accordionItems);
|
|
4208
4208
|
this.activeItemIndex = currentItems.indexOf(expandedItem);
|
|
4209
4209
|
currentItems.forEach((item, index) => {
|
|
4210
|
-
if (item instanceof
|
|
4210
|
+
if (item instanceof BaseAccordionItem) {
|
|
4211
4211
|
if (this.activeItemIndex === index) {
|
|
4212
4212
|
item.expanded = true;
|
|
4213
4213
|
item.expandbutton.setAttribute("aria-disabled", "true");
|
|
@@ -4575,15 +4575,11 @@ class BaseAvatar extends FASTElement {
|
|
|
4575
4575
|
this.elementInternals = this.attachInternals();
|
|
4576
4576
|
this.elementInternals.role = "img";
|
|
4577
4577
|
}
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
disconnectedCallback() {
|
|
4584
|
-
super.disconnectedCallback();
|
|
4585
|
-
Observable.getNotifier(this).unsubscribe(this);
|
|
4586
|
-
}
|
|
4578
|
+
}
|
|
4579
|
+
__decorateClass$q([attr], BaseAvatar.prototype, "name", 2);
|
|
4580
|
+
__decorateClass$q([attr], BaseAvatar.prototype, "initials", 2);
|
|
4581
|
+
__decorateClass$q([attr], BaseAvatar.prototype, "active", 2);
|
|
4582
|
+
const _Avatar = class _Avatar extends BaseAvatar {
|
|
4587
4583
|
/**
|
|
4588
4584
|
* Handles changes to observable properties
|
|
4589
4585
|
* @internal
|
|
@@ -4598,17 +4594,6 @@ class BaseAvatar extends FASTElement {
|
|
|
4598
4594
|
break;
|
|
4599
4595
|
}
|
|
4600
4596
|
}
|
|
4601
|
-
/**
|
|
4602
|
-
* Sets the data-color attribute used for the visual presentation
|
|
4603
|
-
* @internal
|
|
4604
|
-
*/
|
|
4605
|
-
generateColor() {
|
|
4606
|
-
const colorful = this.color === AvatarColor.colorful;
|
|
4607
|
-
const prev = this.currentColor;
|
|
4608
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
4609
|
-
this.currentColor = colorful && this.colorId ? this.colorId : colorful ? Avatar.colors[getHashCode(this.name ?? "") % Avatar.colors.length] : this.color ?? AvatarColor.neutral;
|
|
4610
|
-
toggleState(this.elementInternals, `${this.currentColor}`, true);
|
|
4611
|
-
}
|
|
4612
4597
|
/**
|
|
4613
4598
|
* Generates and sets the initials for the template
|
|
4614
4599
|
* @internal
|
|
@@ -4622,24 +4607,41 @@ class BaseAvatar extends FASTElement {
|
|
|
4622
4607
|
firstInitialOnly: size <= 16
|
|
4623
4608
|
});
|
|
4624
4609
|
}
|
|
4625
|
-
|
|
4610
|
+
/**
|
|
4611
|
+
* Sets the data-color attribute used for the visual presentation
|
|
4612
|
+
* @internal
|
|
4613
|
+
*/
|
|
4614
|
+
generateColor() {
|
|
4615
|
+
const colorful = this.color === AvatarColor.colorful;
|
|
4616
|
+
const prev = this.currentColor;
|
|
4617
|
+
toggleState(this.elementInternals, `${prev}`, false);
|
|
4618
|
+
this.currentColor = colorful && this.colorId ? this.colorId : colorful ? _Avatar.colors[getHashCode(this.name ?? "") % _Avatar.colors.length] : this.color ?? AvatarColor.neutral;
|
|
4619
|
+
toggleState(this.elementInternals, `${this.currentColor}`, true);
|
|
4620
|
+
}
|
|
4621
|
+
connectedCallback() {
|
|
4622
|
+
super.connectedCallback();
|
|
4623
|
+
Observable.getNotifier(this).subscribe(this);
|
|
4624
|
+
this.generateColor();
|
|
4625
|
+
}
|
|
4626
|
+
disconnectedCallback() {
|
|
4627
|
+
super.disconnectedCallback();
|
|
4628
|
+
Observable.getNotifier(this).unsubscribe(this);
|
|
4629
|
+
}
|
|
4630
|
+
};
|
|
4626
4631
|
/**
|
|
4627
4632
|
* An array of the available Avatar named colors
|
|
4628
4633
|
*/
|
|
4629
|
-
|
|
4630
|
-
__decorateClass$q([attr],
|
|
4631
|
-
__decorateClass$q([attr],
|
|
4634
|
+
_Avatar.colors = Object.values(AvatarNamedColor);
|
|
4635
|
+
__decorateClass$q([attr], _Avatar.prototype, "shape", 2);
|
|
4636
|
+
__decorateClass$q([attr], _Avatar.prototype, "appearance", 2);
|
|
4632
4637
|
__decorateClass$q([attr({
|
|
4633
4638
|
converter: nullableNumberConverter
|
|
4634
|
-
})],
|
|
4635
|
-
__decorateClass$q([attr],
|
|
4636
|
-
__decorateClass$q([attr], BaseAvatar.prototype, "color", 2);
|
|
4639
|
+
})], _Avatar.prototype, "size", 2);
|
|
4640
|
+
__decorateClass$q([attr], _Avatar.prototype, "color", 2);
|
|
4637
4641
|
__decorateClass$q([attr({
|
|
4638
4642
|
attribute: "color-id"
|
|
4639
|
-
})],
|
|
4640
|
-
|
|
4641
|
-
__decorateClass$q([attr], Avatar.prototype, "shape", 2);
|
|
4642
|
-
__decorateClass$q([attr], Avatar.prototype, "appearance", 2);
|
|
4643
|
+
})], _Avatar.prototype, "colorId", 2);
|
|
4644
|
+
let Avatar = _Avatar;
|
|
4643
4645
|
const getHashCode = str => {
|
|
4644
4646
|
let hashCode = 0;
|
|
4645
4647
|
for (let len = str.length - 1; len >= 0; len--) {
|
|
@@ -6569,10 +6571,9 @@ var __decorateClass$h = (decorators, target, key, kind) => {
|
|
|
6569
6571
|
if (kind && result) __defProp$h(target, key, result);
|
|
6570
6572
|
return result;
|
|
6571
6573
|
};
|
|
6572
|
-
class
|
|
6574
|
+
class BaseField extends FASTElement {
|
|
6573
6575
|
constructor() {
|
|
6574
6576
|
super();
|
|
6575
|
-
this.labelPosition = LabelPosition.above;
|
|
6576
6577
|
this.labelSlot = [];
|
|
6577
6578
|
/**
|
|
6578
6579
|
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
@@ -6735,13 +6736,19 @@ class Field extends FASTElement {
|
|
|
6735
6736
|
}
|
|
6736
6737
|
}
|
|
6737
6738
|
}
|
|
6739
|
+
__decorateClass$h([observable], BaseField.prototype, "labelSlot", 2);
|
|
6740
|
+
__decorateClass$h([observable], BaseField.prototype, "messageSlot", 2);
|
|
6741
|
+
__decorateClass$h([observable], BaseField.prototype, "slottedInputs", 2);
|
|
6742
|
+
__decorateClass$h([observable], BaseField.prototype, "input", 2);
|
|
6743
|
+
class Field extends BaseField {
|
|
6744
|
+
constructor() {
|
|
6745
|
+
super(...arguments);
|
|
6746
|
+
this.labelPosition = LabelPosition.above;
|
|
6747
|
+
}
|
|
6748
|
+
}
|
|
6738
6749
|
__decorateClass$h([attr({
|
|
6739
6750
|
attribute: "label-position"
|
|
6740
6751
|
})], Field.prototype, "labelPosition", 2);
|
|
6741
|
-
__decorateClass$h([observable], Field.prototype, "labelSlot", 2);
|
|
6742
|
-
__decorateClass$h([observable], Field.prototype, "messageSlot", 2);
|
|
6743
|
-
__decorateClass$h([observable], Field.prototype, "slottedInputs", 2);
|
|
6744
|
-
__decorateClass$h([observable], Field.prototype, "input", 2);
|
|
6745
6752
|
|
|
6746
6753
|
const focusVisibleState = css.partial`:is([state--focus-visible], :state(focus-visible))`;
|
|
6747
6754
|
const badInputState = css.partial`:is([state--${ValidationFlags.badInput}], :state(${ValidationFlags.badInput}))`;
|