@fluentui/web-components 3.0.0-beta.44 → 3.0.0-beta.46

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.
@@ -290,6 +290,12 @@ export declare const accordionStyles: ElementStyles;
290
290
 
291
291
  export declare const accordionTemplate: ElementViewTemplate<Accordion>;
292
292
 
293
+ /**
294
+ * An Anchor Custom HTML Element.
295
+ * Based on BaseAnchor and includes style and layout specific attributes
296
+ *
297
+ * @public
298
+ */
293
299
  export declare class AnchorButton extends BaseAnchor {
294
300
  /**
295
301
  * The appearance the anchor button should have.
@@ -1033,6 +1039,247 @@ declare class BaseAnchor extends FASTElement {
1033
1039
  private createProxyElement;
1034
1040
  }
1035
1041
 
1042
+ /**
1043
+ * A Button Custom HTML Element.
1044
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | `<button>`} element.
1045
+ *
1046
+ * @slot start - Content which can be provided before the button content
1047
+ * @slot end - Content which can be provided after the button content
1048
+ * @slot - The default slot for button content
1049
+ * @csspart content - The button content container
1050
+ *
1051
+ * @public
1052
+ */
1053
+ declare class BaseButton extends FASTElement {
1054
+ /**
1055
+ * Indicates the button should be focused when the page is loaded.
1056
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#autofocus | `autofocus`} attribute
1057
+ *
1058
+ * @public
1059
+ * @remarks
1060
+ * HTML Attribute: `autofocus`
1061
+ */
1062
+ autofocus: boolean;
1063
+ /**
1064
+ * Default slotted content.
1065
+ *
1066
+ * @public
1067
+ */
1068
+ defaultSlottedContent: HTMLElement[];
1069
+ /**
1070
+ * Sets the element's disabled state.
1071
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled | `disabled`} attribute
1072
+ *
1073
+ * @public
1074
+ * @remarks
1075
+ * HTML Attribute: `disabled`
1076
+ */
1077
+ disabled?: boolean;
1078
+ /**
1079
+ * Indicates that the button is focusable while disabled.
1080
+ *
1081
+ * @public
1082
+ * @remarks
1083
+ * HTML Attribute: `disabled-focusable`
1084
+ */
1085
+ disabledFocusable: boolean;
1086
+ /**
1087
+ * Sets that the button tabindex attribute
1088
+ *
1089
+ * @public
1090
+ * @remarks
1091
+ * HTML Attribute: `tabindex`
1092
+ */
1093
+ tabIndex: number;
1094
+ /**
1095
+ * Sets the element's internal disabled state when the element is focusable while disabled.
1096
+ *
1097
+ * @param previous - the previous disabledFocusable value
1098
+ * @param next - the current disabledFocusable value
1099
+ * @internal
1100
+ */
1101
+ disabledFocusableChanged(previous: boolean, next: boolean): void;
1102
+ /**
1103
+ * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
1104
+ *
1105
+ * @internal
1106
+ */
1107
+ elementInternals: ElementInternals;
1108
+ /**
1109
+ * The associated form element.
1110
+ *
1111
+ * @public
1112
+ */
1113
+ get form(): HTMLFormElement | null;
1114
+ /**
1115
+ * The URL that processes the form submission.
1116
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formaction | `formaction`} attribute
1117
+ *
1118
+ * @public
1119
+ * @remarks
1120
+ * HTML Attribute: `formaction`
1121
+ */
1122
+ formAction?: string;
1123
+ /**
1124
+ * The form-associated flag.
1125
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
1126
+ *
1127
+ * @public
1128
+ */
1129
+ static readonly formAssociated = true;
1130
+ /**
1131
+ * The id of a form to associate the element to.
1132
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form | `form`} attribute
1133
+ *
1134
+ * @public
1135
+ * @remarks
1136
+ * HTML Attribute: `form`
1137
+ */
1138
+ formAttribute?: string;
1139
+ /**
1140
+ * The encoding type for the form submission.
1141
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formenctype | `formenctype`} attribute
1142
+ *
1143
+ * @public
1144
+ * @remarks
1145
+ * HTML Attribute: `formenctype`
1146
+ */
1147
+ formEnctype?: string;
1148
+ /**
1149
+ * The HTTP method that the browser uses to submit the form.
1150
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formmethod | `formmethod`} attribute
1151
+ *
1152
+ * @public
1153
+ * @remarks
1154
+ * HTML Attribute: `formmethod`
1155
+ */
1156
+ formMethod?: string;
1157
+ /**
1158
+ * Indicates that the form will not be validated when submitted.
1159
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formnovalidate | `formnovalidate`} attribute
1160
+ *
1161
+ * @public
1162
+ * @remarks
1163
+ * HTML Attribute: `formnovalidate`
1164
+ */
1165
+ formNoValidate?: boolean;
1166
+ /**
1167
+ * The internal form submission fallback control.
1168
+ *
1169
+ * @internal
1170
+ */
1171
+ private formSubmissionFallbackControl?;
1172
+ /**
1173
+ * The internal slot for the form submission fallback control.
1174
+ *
1175
+ * @internal
1176
+ */
1177
+ private formSubmissionFallbackControlSlot?;
1178
+ /**
1179
+ * The target frame or window to open the form submission in.
1180
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formtarget | `formtarget`} attribute
1181
+ *
1182
+ * @public
1183
+ * @remarks
1184
+ * HTML Attribute: `formtarget`
1185
+ */
1186
+ formTarget?: ButtonFormTarget;
1187
+ /**
1188
+ * A reference to all associated label elements.
1189
+ *
1190
+ * @public
1191
+ */
1192
+ get labels(): ReadonlyArray<Node>;
1193
+ /**
1194
+ * The name of the element. This element's value will be surfaced during form submission under the provided name.
1195
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#name | `name`} attribute
1196
+ *
1197
+ * @public
1198
+ * @remarks
1199
+ * HTML Attribute: `name`
1200
+ */
1201
+ name?: string;
1202
+ /**
1203
+ * The button type.
1204
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type | `type`} attribute
1205
+ *
1206
+ * @public
1207
+ * @remarks
1208
+ * HTML Attribute: `type`
1209
+ */
1210
+ type: ButtonType;
1211
+ /**
1212
+ * Removes the form submission fallback control when the type changes.
1213
+ *
1214
+ * @param previous - the previous type value
1215
+ * @param next - the new type value
1216
+ * @internal
1217
+ */
1218
+ typeChanged(previous: ButtonType, next: ButtonType): void;
1219
+ /**
1220
+ * The value attribute.
1221
+ *
1222
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#value | `value`} attribute
1223
+ *
1224
+ * @public
1225
+ * @remarks
1226
+ * HTML Attribute: `value`
1227
+ */
1228
+ value?: string;
1229
+ /**
1230
+ * Handles the button click event.
1231
+ *
1232
+ * @param e - The event object
1233
+ * @internal
1234
+ */
1235
+ clickHandler(e: Event): boolean | void;
1236
+ connectedCallback(): void;
1237
+ constructor();
1238
+ /**
1239
+ * This fallback creates a new slot, then creates a submit button to mirror the custom element's
1240
+ * properties. The submit button is then appended to the slot and the form is submitted.
1241
+ *
1242
+ * @internal
1243
+ * @privateRemarks
1244
+ * This is a workaround until {@link https://github.com/WICG/webcomponents/issues/814 | WICG/webcomponents/issues/814} is resolved.
1245
+ */
1246
+ private createAndInsertFormSubmissionFallbackControl;
1247
+ /**
1248
+ * Invoked when a connected component's form or fieldset has its disabled state changed.
1249
+ *
1250
+ * @param disabled - the disabled value of the form / fieldset
1251
+ *
1252
+ * @internal
1253
+ */
1254
+ formDisabledCallback(disabled: boolean): void;
1255
+ /**
1256
+ * Handles keypress events for the button.
1257
+ *
1258
+ * @param e - the keyboard event
1259
+ * @returns - the return value of the click handler
1260
+ * @public
1261
+ */
1262
+ keypressHandler(e: KeyboardEvent): boolean | void;
1263
+ /**
1264
+ * Presses the button.
1265
+ *
1266
+ * @public
1267
+ */
1268
+ protected press(): void;
1269
+ /**
1270
+ * Resets the associated form.
1271
+ *
1272
+ * @public
1273
+ */
1274
+ resetForm(): void;
1275
+ /**
1276
+ * Submits the associated form.
1277
+ *
1278
+ * @internal
1279
+ */
1280
+ private submitForm;
1281
+ }
1282
+
1036
1283
  /**
1037
1284
  * The base class for a component with a toggleable checked state.
1038
1285
  *
@@ -1448,16 +1695,11 @@ export declare const borderRadiusXLarge = "var(--borderRadiusXLarge)";
1448
1695
 
1449
1696
  /**
1450
1697
  * A Button Custom HTML Element.
1451
- * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | `<button>`} element.
1452
- *
1453
- * @slot start - Content which can be provided before the button content
1454
- * @slot end - Content which can be provided after the button content
1455
- * @slot - The default slot for button content
1456
- * @csspart content - The button content container
1698
+ * Based on BaseButton and includes style and layout specific attributes
1457
1699
  *
1458
1700
  * @public
1459
1701
  */
1460
- export declare class Button extends FASTElement {
1702
+ export declare class Button extends BaseButton {
1461
1703
  /**
1462
1704
  * Indicates the styled appearance of the button.
1463
1705
  *
@@ -1472,168 +1714,6 @@ export declare class Button extends FASTElement {
1472
1714
  * @param next - the next state
1473
1715
  */
1474
1716
  appearanceChanged(prev: ButtonAppearance | undefined, next: ButtonAppearance | undefined): void;
1475
- /**
1476
- * Indicates the button should be focused when the page is loaded.
1477
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#autofocus | `autofocus`} attribute
1478
- *
1479
- * @public
1480
- * @remarks
1481
- * HTML Attribute: `autofocus`
1482
- */
1483
- autofocus: boolean;
1484
- /**
1485
- * Default slotted content.
1486
- *
1487
- * @public
1488
- */
1489
- defaultSlottedContent: HTMLElement[];
1490
- /**
1491
- * Sets the element's disabled state.
1492
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#disabled | `disabled`} attribute
1493
- *
1494
- * @public
1495
- * @remarks
1496
- * HTML Attribute: `disabled`
1497
- */
1498
- disabled?: boolean;
1499
- /**
1500
- * Indicates that the button is focusable while disabled.
1501
- *
1502
- * @public
1503
- * @remarks
1504
- * HTML Attribute: `disabled-focusable`
1505
- */
1506
- disabledFocusable: boolean;
1507
- /**
1508
- * Sets that the button tabindex attribute
1509
- *
1510
- * @public
1511
- * @remarks
1512
- * HTML Attribute: `tabindex`
1513
- */
1514
- tabIndex: number;
1515
- /**
1516
- * Sets the element's internal disabled state when the element is focusable while disabled.
1517
- *
1518
- * @param previous - the previous disabledFocusable value
1519
- * @param next - the current disabledFocusable value
1520
- * @internal
1521
- */
1522
- disabledFocusableChanged(previous: boolean, next: boolean): void;
1523
- /**
1524
- * The internal {@link https://developer.mozilla.org/en-US/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
1525
- *
1526
- * @internal
1527
- */
1528
- elementInternals: ElementInternals;
1529
- /**
1530
- * The associated form element.
1531
- *
1532
- * @public
1533
- */
1534
- get form(): HTMLFormElement | null;
1535
- /**
1536
- * The URL that processes the form submission.
1537
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formaction | `formaction`} attribute
1538
- *
1539
- * @public
1540
- * @remarks
1541
- * HTML Attribute: `formaction`
1542
- */
1543
- formAction?: string;
1544
- /**
1545
- * The form-associated flag.
1546
- * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
1547
- *
1548
- * @public
1549
- */
1550
- static readonly formAssociated = true;
1551
- /**
1552
- * The id of a form to associate the element to.
1553
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#form | `form`} attribute
1554
- *
1555
- * @public
1556
- * @remarks
1557
- * HTML Attribute: `form`
1558
- */
1559
- formAttribute?: string;
1560
- /**
1561
- * The encoding type for the form submission.
1562
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formenctype | `formenctype`} attribute
1563
- *
1564
- * @public
1565
- * @remarks
1566
- * HTML Attribute: `formenctype`
1567
- */
1568
- formEnctype?: string;
1569
- /**
1570
- * The HTTP method that the browser uses to submit the form.
1571
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formmethod | `formmethod`} attribute
1572
- *
1573
- * @public
1574
- * @remarks
1575
- * HTML Attribute: `formmethod`
1576
- */
1577
- formMethod?: string;
1578
- /**
1579
- * Indicates that the form will not be validated when submitted.
1580
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formnovalidate | `formnovalidate`} attribute
1581
- *
1582
- * @public
1583
- * @remarks
1584
- * HTML Attribute: `formnovalidate`
1585
- */
1586
- formNoValidate?: boolean;
1587
- /**
1588
- * The internal form submission fallback control.
1589
- *
1590
- * @internal
1591
- */
1592
- private formSubmissionFallbackControl?;
1593
- /**
1594
- * The internal slot for the form submission fallback control.
1595
- *
1596
- * @internal
1597
- */
1598
- private formSubmissionFallbackControlSlot?;
1599
- /**
1600
- * The target frame or window to open the form submission in.
1601
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#formtarget | `formtarget`} attribute
1602
- *
1603
- * @public
1604
- * @remarks
1605
- * HTML Attribute: `formtarget`
1606
- */
1607
- formTarget?: ButtonFormTarget;
1608
- /**
1609
- * Indicates that the button should only display as an icon with no text content.
1610
- *
1611
- * @public
1612
- * @remarks
1613
- * HTML Attribute: `icon-only`
1614
- */
1615
- iconOnly: boolean;
1616
- /**
1617
- * Handles changes to icon only custom states
1618
- * @param prev - the previous state
1619
- * @param next - the next state
1620
- */
1621
- iconOnlyChanged(prev: boolean, next: boolean): void;
1622
- /**
1623
- * A reference to all associated label elements.
1624
- *
1625
- * @public
1626
- */
1627
- get labels(): ReadonlyArray<Node>;
1628
- /**
1629
- * The name of the element. This element's value will be surfaced during form submission under the provided name.
1630
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#name | `name`} attribute
1631
- *
1632
- * @public
1633
- * @remarks
1634
- * HTML Attribute: `name`
1635
- */
1636
- name?: string;
1637
1717
  /**
1638
1718
  * The shape of the button.
1639
1719
  *
@@ -1663,84 +1743,19 @@ export declare class Button extends FASTElement {
1663
1743
  */
1664
1744
  sizeChanged(prev: ButtonSize | undefined, next: ButtonSize | undefined): void;
1665
1745
  /**
1666
- * The button type.
1667
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type | `type`} attribute
1668
- *
1669
- * @public
1670
- * @remarks
1671
- * HTML Attribute: `type`
1672
- */
1673
- type: ButtonType;
1674
- /**
1675
- * Removes the form submission fallback control when the type changes.
1676
- *
1677
- * @param previous - the previous type value
1678
- * @param next - the new type value
1679
- * @internal
1680
- */
1681
- typeChanged(previous: ButtonType, next: ButtonType): void;
1682
- /**
1683
- * The value attribute.
1684
- *
1685
- * @see The {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#value | `value`} attribute
1746
+ * Indicates that the button should only display as an icon with no text content.
1686
1747
  *
1687
1748
  * @public
1688
1749
  * @remarks
1689
- * HTML Attribute: `value`
1690
- */
1691
- value?: string;
1692
- /**
1693
- * Handles the button click event.
1694
- *
1695
- * @param e - The event object
1696
- * @internal
1697
- */
1698
- clickHandler(e: Event): boolean | void;
1699
- connectedCallback(): void;
1700
- constructor();
1701
- /**
1702
- * This fallback creates a new slot, then creates a submit button to mirror the custom element's
1703
- * properties. The submit button is then appended to the slot and the form is submitted.
1704
- *
1705
- * @internal
1706
- * @privateRemarks
1707
- * This is a workaround until {@link https://github.com/WICG/webcomponents/issues/814 | WICG/webcomponents/issues/814} is resolved.
1708
- */
1709
- private createAndInsertFormSubmissionFallbackControl;
1710
- /**
1711
- * Invoked when a connected component's form or fieldset has its disabled state changed.
1712
- *
1713
- * @param disabled - the disabled value of the form / fieldset
1714
- *
1715
- * @internal
1716
- */
1717
- formDisabledCallback(disabled: boolean): void;
1718
- /**
1719
- * Handles keypress events for the button.
1720
- *
1721
- * @param e - the keyboard event
1722
- * @returns - the return value of the click handler
1723
- * @public
1724
- */
1725
- keypressHandler(e: KeyboardEvent): boolean | void;
1726
- /**
1727
- * Presses the button.
1728
- *
1729
- * @public
1730
- */
1731
- protected press(): void;
1732
- /**
1733
- * Resets the associated form.
1734
- *
1735
- * @public
1750
+ * HTML Attribute: `icon-only`
1736
1751
  */
1737
- resetForm(): void;
1752
+ iconOnly: boolean;
1738
1753
  /**
1739
- * Submits the associated form.
1740
- *
1741
- * @internal
1754
+ * Handles changes to icon only custom states
1755
+ * @param prev - the previous state
1756
+ * @param next - the next state
1742
1757
  */
1743
- private submitForm;
1758
+ iconOnlyChanged(prev: boolean, next: boolean): void;
1744
1759
  }
1745
1760
 
1746
1761
  /**