@fluentui/web-components 3.0.0-beta.24 → 3.0.0-beta.26
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 +23 -2
- package/dist/dts/checkbox/checkbox.d.ts +258 -32
- package/dist/dts/checkbox/checkbox.options.d.ts +13 -10
- package/dist/dts/checkbox/checkbox.template.d.ts +3 -2
- package/dist/dts/checkbox/index.d.ts +2 -2
- package/dist/dts/field/define.d.ts +1 -0
- package/dist/dts/field/field.bench.d.ts +3 -0
- package/dist/dts/field/field.d.ts +99 -0
- package/dist/dts/field/field.definition.d.ts +9 -0
- package/dist/dts/field/field.options.d.ts +41 -0
- package/dist/dts/field/field.styles.d.ts +6 -0
- package/dist/dts/field/field.template.d.ts +6 -0
- package/dist/dts/field/index.d.ts +6 -0
- package/dist/dts/index-rollup.d.ts +1 -0
- package/dist/dts/index.d.ts +2 -0
- package/dist/dts/switch/switch.d.ts +2 -39
- package/dist/dts/text-input/text-input.d.ts +50 -8
- package/dist/dts/utils/element-internals.d.ts +20 -0
- package/dist/esm/checkbox/checkbox.definition.js +1 -1
- package/dist/esm/checkbox/checkbox.definition.js.map +1 -1
- package/dist/esm/checkbox/checkbox.js +346 -41
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/checkbox/checkbox.options.js +0 -8
- package/dist/esm/checkbox/checkbox.options.js.map +1 -1
- package/dist/esm/checkbox/checkbox.styles.js +145 -123
- package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
- package/dist/esm/checkbox/checkbox.template.js +23 -34
- package/dist/esm/checkbox/checkbox.template.js.map +1 -1
- package/dist/esm/checkbox/index.js +1 -1
- package/dist/esm/checkbox/index.js.map +1 -1
- package/dist/esm/dialog/dialog.styles.js +9 -2
- package/dist/esm/dialog/dialog.styles.js.map +1 -1
- package/dist/esm/field/define.js +4 -0
- package/dist/esm/field/define.js.map +1 -0
- package/dist/esm/field/field.bench.js +10 -0
- package/dist/esm/field/field.bench.js.map +1 -0
- package/dist/esm/field/field.definition.js +20 -0
- package/dist/esm/field/field.definition.js.map +1 -0
- package/dist/esm/field/field.js +139 -0
- package/dist/esm/field/field.js.map +1 -0
- package/dist/esm/field/field.options.js +27 -0
- package/dist/esm/field/field.options.js.map +1 -0
- package/dist/esm/field/field.styles.js +186 -0
- package/dist/esm/field/field.styles.js.map +1 -0
- package/dist/esm/field/field.template.js +26 -0
- package/dist/esm/field/field.template.js.map +1 -0
- package/dist/esm/field/index.js +6 -0
- package/dist/esm/field/index.js.map +1 -0
- package/dist/esm/index-rollup.js +1 -0
- package/dist/esm/index-rollup.js.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/label/label.styles.js +12 -5
- package/dist/esm/label/label.styles.js.map +1 -1
- package/dist/esm/switch/switch.js +2 -52
- package/dist/esm/switch/switch.js.map +1 -1
- package/dist/esm/switch/switch.styles.js +34 -55
- package/dist/esm/switch/switch.styles.js.map +1 -1
- package/dist/esm/switch/switch.template.js +6 -16
- package/dist/esm/switch/switch.template.js.map +1 -1
- package/dist/esm/text/text.styles.js +48 -24
- package/dist/esm/text/text.styles.js.map +1 -1
- package/dist/esm/text-input/text-input.definition.js +3 -0
- package/dist/esm/text-input/text-input.definition.js.map +1 -1
- package/dist/esm/text-input/text-input.js +78 -20
- package/dist/esm/text-input/text-input.js.map +1 -1
- package/dist/esm/text-input/text-input.styles.js +14 -9
- package/dist/esm/text-input/text-input.styles.js.map +1 -1
- package/dist/esm/text-input/text-input.template.js +39 -33
- package/dist/esm/text-input/text-input.template.js.map +1 -1
- package/dist/esm/theme/set-theme.js +10 -5
- package/dist/esm/theme/set-theme.js.map +1 -1
- package/dist/esm/utils/element-internals.js +32 -0
- package/dist/esm/utils/element-internals.js.map +1 -0
- package/dist/web-components.d.ts +506 -138
- package/dist/web-components.js +2264 -1692
- package/dist/web-components.min.js +243 -238
- package/package.json +1 -1
- package/dist/dts/checkbox/checkbox.form-associated.d.ts +0 -14
- package/dist/esm/checkbox/checkbox.form-associated.js +0 -14
- package/dist/esm/checkbox/checkbox.form-associated.js.map +0 -1
package/dist/web-components.d.ts
CHANGED
|
@@ -1064,6 +1064,288 @@ export declare const BadgeStyles: ElementStyles;
|
|
|
1064
1064
|
|
|
1065
1065
|
export declare const BadgeTemplate: ElementViewTemplate<Badge>;
|
|
1066
1066
|
|
|
1067
|
+
/**
|
|
1068
|
+
* A Checkbox Custom HTML Element.
|
|
1069
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
|
|
1070
|
+
*
|
|
1071
|
+
* @slot checked-indicator - The checked indicator
|
|
1072
|
+
* @slot indeterminate-indicator - The indeterminate indicator
|
|
1073
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
1074
|
+
* @fires input - Emits a custom input event when the checked state changes
|
|
1075
|
+
*
|
|
1076
|
+
* @public
|
|
1077
|
+
*/
|
|
1078
|
+
declare class BaseCheckbox extends FASTElement {
|
|
1079
|
+
/**
|
|
1080
|
+
* Indicates that the element should get focus after the page finishes loading.
|
|
1081
|
+
* @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#autofocus | `autofocus`} attribute
|
|
1082
|
+
*
|
|
1083
|
+
* @public
|
|
1084
|
+
* @remarks
|
|
1085
|
+
* HTML Attribute: `autofocus`
|
|
1086
|
+
*/
|
|
1087
|
+
autofocus: boolean;
|
|
1088
|
+
/**
|
|
1089
|
+
* The element's current checked state.
|
|
1090
|
+
*
|
|
1091
|
+
* @public
|
|
1092
|
+
*/
|
|
1093
|
+
get checked(): boolean;
|
|
1094
|
+
set checked(state: boolean);
|
|
1095
|
+
/**
|
|
1096
|
+
* The element's disabled state.
|
|
1097
|
+
* @public
|
|
1098
|
+
* @remarks
|
|
1099
|
+
* HTML Attribute: `disabled`
|
|
1100
|
+
*/
|
|
1101
|
+
disabled: boolean;
|
|
1102
|
+
/**
|
|
1103
|
+
* The id of a form to associate the element to.
|
|
1104
|
+
* @see The {@link https://developer.mozilla.org/docs/Web/HTML/Element/input#form | `form`} attribute
|
|
1105
|
+
*
|
|
1106
|
+
* @public
|
|
1107
|
+
* @remarks
|
|
1108
|
+
* HTML Attribute: `form`
|
|
1109
|
+
*/
|
|
1110
|
+
formAttribute?: string;
|
|
1111
|
+
/**
|
|
1112
|
+
* Indicates that the element is in an indeterminate or mixed state.
|
|
1113
|
+
*
|
|
1114
|
+
* @public
|
|
1115
|
+
*/
|
|
1116
|
+
indeterminate?: boolean;
|
|
1117
|
+
/**
|
|
1118
|
+
* Synchronizes the element's indeterminate state with the internal ElementInternals state.
|
|
1119
|
+
*
|
|
1120
|
+
* @internal
|
|
1121
|
+
*/
|
|
1122
|
+
indeterminateChanged(prev: boolean, next: boolean): void;
|
|
1123
|
+
/**
|
|
1124
|
+
* The element's checked state.
|
|
1125
|
+
*
|
|
1126
|
+
* @public
|
|
1127
|
+
* @remarks
|
|
1128
|
+
* HTML Attribute: `checked`
|
|
1129
|
+
*/
|
|
1130
|
+
initialChecked?: boolean;
|
|
1131
|
+
/**
|
|
1132
|
+
* Updates the form value when the checked state changes.
|
|
1133
|
+
*
|
|
1134
|
+
* @internal
|
|
1135
|
+
*/
|
|
1136
|
+
initialCheckedChanged(prev: boolean | undefined, next: boolean): void;
|
|
1137
|
+
/**
|
|
1138
|
+
* The initial value of the input.
|
|
1139
|
+
*
|
|
1140
|
+
* @public
|
|
1141
|
+
* @remarks
|
|
1142
|
+
* HTML Attribute: `value`
|
|
1143
|
+
*/
|
|
1144
|
+
initialValue: string;
|
|
1145
|
+
/**
|
|
1146
|
+
* Sets the value of the input when the value attribute changes.
|
|
1147
|
+
*
|
|
1148
|
+
* @param prev - The previous value
|
|
1149
|
+
* @param next - The current value
|
|
1150
|
+
* @internal
|
|
1151
|
+
*/
|
|
1152
|
+
initialValueChanged(prev: string, next: string): void;
|
|
1153
|
+
/**
|
|
1154
|
+
* The name of the element. This element's value will be surfaced during form submission under the provided name.
|
|
1155
|
+
*
|
|
1156
|
+
* @public
|
|
1157
|
+
* @remarks
|
|
1158
|
+
* HTML Attribute: `name`
|
|
1159
|
+
*/
|
|
1160
|
+
name: string;
|
|
1161
|
+
/**
|
|
1162
|
+
* The element's required state.
|
|
1163
|
+
*
|
|
1164
|
+
* @public
|
|
1165
|
+
* @remarks
|
|
1166
|
+
* HTML Attribute: `required`
|
|
1167
|
+
*/
|
|
1168
|
+
required: boolean;
|
|
1169
|
+
/**
|
|
1170
|
+
* Sets the validity of the control when the required state changes.
|
|
1171
|
+
*
|
|
1172
|
+
* @param prev - The previous required state
|
|
1173
|
+
* @param next - The current required state
|
|
1174
|
+
* @internal
|
|
1175
|
+
*/
|
|
1176
|
+
requiredChanged(prev: boolean, next: boolean): void;
|
|
1177
|
+
/**
|
|
1178
|
+
* The internal checked state of the control.
|
|
1179
|
+
*
|
|
1180
|
+
* @internal
|
|
1181
|
+
*/
|
|
1182
|
+
private _checked;
|
|
1183
|
+
/**
|
|
1184
|
+
* Indicates that the checked state has been changed by the user.
|
|
1185
|
+
*
|
|
1186
|
+
* @internal
|
|
1187
|
+
*/
|
|
1188
|
+
private dirtyChecked;
|
|
1189
|
+
/**
|
|
1190
|
+
* The associated `<form>` element.
|
|
1191
|
+
*
|
|
1192
|
+
* @public
|
|
1193
|
+
* @remarks
|
|
1194
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/form | `ElementInternals.form`} property.
|
|
1195
|
+
*/
|
|
1196
|
+
get form(): HTMLFormElement | null;
|
|
1197
|
+
/**
|
|
1198
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
1199
|
+
*
|
|
1200
|
+
* @internal
|
|
1201
|
+
*/
|
|
1202
|
+
elementInternals: ElementInternals;
|
|
1203
|
+
/**
|
|
1204
|
+
* The form-associated flag.
|
|
1205
|
+
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
|
|
1206
|
+
*
|
|
1207
|
+
* @public
|
|
1208
|
+
*/
|
|
1209
|
+
static formAssociated: boolean;
|
|
1210
|
+
/**
|
|
1211
|
+
* A reference to all associated `<label>` elements.
|
|
1212
|
+
*
|
|
1213
|
+
* @public
|
|
1214
|
+
*/
|
|
1215
|
+
get labels(): ReadonlyArray<Node>;
|
|
1216
|
+
/**
|
|
1217
|
+
* The fallback validation message, taken from a native checkbox `<input>` element.
|
|
1218
|
+
*
|
|
1219
|
+
* @internal
|
|
1220
|
+
*/
|
|
1221
|
+
private _validationFallbackMessage;
|
|
1222
|
+
/**
|
|
1223
|
+
* The validation message. Uses the browser's default validation message for native checkboxes if not otherwise
|
|
1224
|
+
* specified (e.g., via `setCustomValidity`).
|
|
1225
|
+
*
|
|
1226
|
+
* @public
|
|
1227
|
+
* @remarks
|
|
1228
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validationMessage | `ElementInternals.validationMessage`} property.
|
|
1229
|
+
*/
|
|
1230
|
+
get validationMessage(): string;
|
|
1231
|
+
/**
|
|
1232
|
+
* The element's validity state.
|
|
1233
|
+
*
|
|
1234
|
+
* @public
|
|
1235
|
+
* @remarks
|
|
1236
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validity | `ElementInternals.validity`} property.
|
|
1237
|
+
*/
|
|
1238
|
+
get validity(): ValidityState;
|
|
1239
|
+
/**
|
|
1240
|
+
* The internal value of the input.
|
|
1241
|
+
*
|
|
1242
|
+
* @internal
|
|
1243
|
+
*/
|
|
1244
|
+
private _value;
|
|
1245
|
+
/**
|
|
1246
|
+
* The current value of the input.
|
|
1247
|
+
*
|
|
1248
|
+
* @public
|
|
1249
|
+
*/
|
|
1250
|
+
get value(): string;
|
|
1251
|
+
set value(value: string);
|
|
1252
|
+
/**
|
|
1253
|
+
* Determines if the control can be submitted for constraint validation.
|
|
1254
|
+
*
|
|
1255
|
+
* @public
|
|
1256
|
+
* @remarks
|
|
1257
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/willValidate | `ElementInternals.willValidate`} property.
|
|
1258
|
+
*/
|
|
1259
|
+
get willValidate(): boolean;
|
|
1260
|
+
/**
|
|
1261
|
+
* Sets the `elementInternals.ariaChecked` value based on the checked state.
|
|
1262
|
+
*
|
|
1263
|
+
* @internal
|
|
1264
|
+
*/
|
|
1265
|
+
private setAriaChecked;
|
|
1266
|
+
/**
|
|
1267
|
+
* Checks the validity of the element and returns the result.
|
|
1268
|
+
*
|
|
1269
|
+
* @public
|
|
1270
|
+
* @remarks
|
|
1271
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
|
|
1272
|
+
*/
|
|
1273
|
+
checkValidity(): boolean;
|
|
1274
|
+
/**
|
|
1275
|
+
* Toggles the checked state when the user clicks the element.
|
|
1276
|
+
*
|
|
1277
|
+
* @param e - the event object
|
|
1278
|
+
* @internal
|
|
1279
|
+
*/
|
|
1280
|
+
clickHandler(e: MouseEvent): boolean | void;
|
|
1281
|
+
connectedCallback(): void;
|
|
1282
|
+
constructor();
|
|
1283
|
+
/**
|
|
1284
|
+
* Updates the form value when a user changes the `checked` state.
|
|
1285
|
+
*
|
|
1286
|
+
* @param e - the event object
|
|
1287
|
+
* @internal
|
|
1288
|
+
*/
|
|
1289
|
+
inputHandler(e: Event): boolean | void;
|
|
1290
|
+
/**
|
|
1291
|
+
* Prevents scrolling when the user presses the space key.
|
|
1292
|
+
*
|
|
1293
|
+
* @param e - the event object
|
|
1294
|
+
* @internal
|
|
1295
|
+
*/
|
|
1296
|
+
keydownHandler(e: KeyboardEvent): boolean | void;
|
|
1297
|
+
/**
|
|
1298
|
+
* Toggles the checked state when the user releases the space key.
|
|
1299
|
+
*
|
|
1300
|
+
* @param e - the event object
|
|
1301
|
+
* @internal
|
|
1302
|
+
*/
|
|
1303
|
+
keyupHandler(e: KeyboardEvent): boolean | void;
|
|
1304
|
+
/**
|
|
1305
|
+
* Resets the form value to its initial value when the form is reset.
|
|
1306
|
+
*
|
|
1307
|
+
* @internal
|
|
1308
|
+
*/
|
|
1309
|
+
formResetCallback(): void;
|
|
1310
|
+
/**
|
|
1311
|
+
* Reports the validity of the element.
|
|
1312
|
+
*
|
|
1313
|
+
* @public
|
|
1314
|
+
* @remarks
|
|
1315
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
|
|
1316
|
+
*/
|
|
1317
|
+
reportValidity(): boolean;
|
|
1318
|
+
/**
|
|
1319
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
|
|
1320
|
+
*
|
|
1321
|
+
* @internal
|
|
1322
|
+
*/
|
|
1323
|
+
setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
|
|
1324
|
+
/**
|
|
1325
|
+
* Sets a custom validity message.
|
|
1326
|
+
*
|
|
1327
|
+
* @param message - The message to set
|
|
1328
|
+
* @public
|
|
1329
|
+
*/
|
|
1330
|
+
setCustomValidity(message: string): void;
|
|
1331
|
+
/**
|
|
1332
|
+
* Sets the validity of the control.
|
|
1333
|
+
*
|
|
1334
|
+
* @param flags - Validity flags to set.
|
|
1335
|
+
* @param message - Optional message to supply. If not provided, the control's `validationMessage` will be used.
|
|
1336
|
+
* @param anchor - Optional anchor to use for the validation message.
|
|
1337
|
+
*
|
|
1338
|
+
* @internal
|
|
1339
|
+
*/
|
|
1340
|
+
setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
|
|
1341
|
+
/**
|
|
1342
|
+
* Toggles the checked state of the control.
|
|
1343
|
+
*
|
|
1344
|
+
* @public
|
|
1345
|
+
*/
|
|
1346
|
+
private toggleChecked;
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1067
1349
|
/**
|
|
1068
1350
|
* A base class for progress components.
|
|
1069
1351
|
* @public
|
|
@@ -1635,75 +1917,23 @@ declare interface CheckableFormAssociated extends FormAssociated {
|
|
|
1635
1917
|
checkedChanged(oldValue: boolean | undefined, newValue: boolean): void;
|
|
1636
1918
|
}
|
|
1637
1919
|
|
|
1638
|
-
|
|
1639
|
-
* A Checkbox Custom HTML Element.
|
|
1640
|
-
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#checkbox | ARIA checkbox }.
|
|
1641
|
-
*
|
|
1642
|
-
* @slot checked-indicator - The checked indicator
|
|
1643
|
-
* @slot indeterminate-indicator - The indeterminate indicator
|
|
1644
|
-
* @slot - The default slot for the label
|
|
1645
|
-
* @csspart control - The element representing the visual checkbox control
|
|
1646
|
-
* @csspart label - The label
|
|
1647
|
-
* @fires change - Emits a custom change event when the checked state changes
|
|
1648
|
-
*
|
|
1649
|
-
* @public
|
|
1650
|
-
*/
|
|
1651
|
-
export declare class Checkbox extends FormAssociatedCheckbox {
|
|
1920
|
+
export declare class Checkbox extends BaseCheckbox {
|
|
1652
1921
|
/**
|
|
1653
|
-
*
|
|
1922
|
+
* Indicates the shape of the checkbox.
|
|
1654
1923
|
*
|
|
1655
1924
|
* @public
|
|
1656
1925
|
* @remarks
|
|
1657
|
-
* HTML Attribute: shape
|
|
1926
|
+
* HTML Attribute: `shape`
|
|
1658
1927
|
*/
|
|
1659
|
-
shape
|
|
1928
|
+
shape: CheckboxShape;
|
|
1660
1929
|
/**
|
|
1661
|
-
*
|
|
1930
|
+
* Indicates the size of the checkbox.
|
|
1662
1931
|
*
|
|
1663
1932
|
* @public
|
|
1664
1933
|
* @remarks
|
|
1665
|
-
* HTML Attribute: size
|
|
1934
|
+
* HTML Attribute: `size`
|
|
1666
1935
|
*/
|
|
1667
1936
|
size?: CheckboxSize;
|
|
1668
|
-
/**
|
|
1669
|
-
* Sets position of the label relative to the input
|
|
1670
|
-
*
|
|
1671
|
-
* @public
|
|
1672
|
-
* @remarks
|
|
1673
|
-
* HTML Attribute: label-position
|
|
1674
|
-
*/
|
|
1675
|
-
labelPosition?: CheckboxLabelPosition;
|
|
1676
|
-
/**
|
|
1677
|
-
* The element's value to be included in form submission when checked.
|
|
1678
|
-
* Default to "on" to reach parity with input[type="checkbox"]
|
|
1679
|
-
*
|
|
1680
|
-
* @internal
|
|
1681
|
-
*/
|
|
1682
|
-
initialValue: string;
|
|
1683
|
-
/**
|
|
1684
|
-
* @internal
|
|
1685
|
-
*/
|
|
1686
|
-
defaultSlottedNodes: Node[];
|
|
1687
|
-
/**
|
|
1688
|
-
* The indeterminate state of the control
|
|
1689
|
-
*/
|
|
1690
|
-
indeterminate: boolean;
|
|
1691
|
-
constructor();
|
|
1692
|
-
private toggleChecked;
|
|
1693
|
-
/**
|
|
1694
|
-
* @internal
|
|
1695
|
-
*/
|
|
1696
|
-
keypressHandler: (e: KeyboardEvent) => void;
|
|
1697
|
-
/**
|
|
1698
|
-
* @internal
|
|
1699
|
-
*/
|
|
1700
|
-
clickHandler: (e: MouseEvent) => void;
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
declare class _Checkbox extends FASTElement {
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
declare interface _Checkbox extends CheckableFormAssociated {
|
|
1707
1937
|
}
|
|
1708
1938
|
|
|
1709
1939
|
/**
|
|
@@ -1715,17 +1945,6 @@ declare interface _Checkbox extends CheckableFormAssociated {
|
|
|
1715
1945
|
*/
|
|
1716
1946
|
export declare const CheckboxDefinition: FASTElementDefinition<typeof Checkbox>;
|
|
1717
1947
|
|
|
1718
|
-
/**
|
|
1719
|
-
* Checkbox label position
|
|
1720
|
-
* @public
|
|
1721
|
-
*/
|
|
1722
|
-
declare const CheckboxLabelPosition: {
|
|
1723
|
-
readonly before: "before";
|
|
1724
|
-
readonly after: "after";
|
|
1725
|
-
};
|
|
1726
|
-
|
|
1727
|
-
declare type CheckboxLabelPosition = ValuesOf<typeof CheckboxLabelPosition>;
|
|
1728
|
-
|
|
1729
1948
|
/**
|
|
1730
1949
|
* Checkbox configuration options
|
|
1731
1950
|
* @public
|
|
@@ -1744,6 +1963,7 @@ export declare const CheckboxShape: {
|
|
|
1744
1963
|
readonly square: "square";
|
|
1745
1964
|
};
|
|
1746
1965
|
|
|
1966
|
+
/** @public */
|
|
1747
1967
|
export declare type CheckboxShape = ValuesOf<typeof CheckboxShape>;
|
|
1748
1968
|
|
|
1749
1969
|
/**
|
|
@@ -1755,6 +1975,7 @@ export declare const CheckboxSize: {
|
|
|
1755
1975
|
readonly large: "large";
|
|
1756
1976
|
};
|
|
1757
1977
|
|
|
1978
|
+
/** @public */
|
|
1758
1979
|
export declare type CheckboxSize = ValuesOf<typeof CheckboxSize>;
|
|
1759
1980
|
|
|
1760
1981
|
/** Checkbox styles
|
|
@@ -4529,6 +4750,139 @@ declare type EndOptions<TSource = any, TParent = any> = {
|
|
|
4529
4750
|
end?: StaticallyComposableHTML<TSource, TParent>;
|
|
4530
4751
|
};
|
|
4531
4752
|
|
|
4753
|
+
/**
|
|
4754
|
+
* A Field Custom HTML Element.
|
|
4755
|
+
*
|
|
4756
|
+
* @public
|
|
4757
|
+
*/
|
|
4758
|
+
export declare class Field extends FASTElement {
|
|
4759
|
+
/**
|
|
4760
|
+
* The position of the label relative to the input.
|
|
4761
|
+
*
|
|
4762
|
+
* @public
|
|
4763
|
+
* @remarks
|
|
4764
|
+
* HTML Attribute: `label-position`
|
|
4765
|
+
*/
|
|
4766
|
+
labelPosition: FieldLabelPosition;
|
|
4767
|
+
/**
|
|
4768
|
+
* The slotted message elements. Filtered to only include elements with a `flag` attribute.
|
|
4769
|
+
*
|
|
4770
|
+
* @internal
|
|
4771
|
+
*/
|
|
4772
|
+
messageSlot: Element[];
|
|
4773
|
+
/**
|
|
4774
|
+
* Adds or removes the `invalid` event listener based on the presence of slotted message elements.
|
|
4775
|
+
*
|
|
4776
|
+
* @param prev - the previous list of slotted message elements
|
|
4777
|
+
* @param next - the current list of slotted message elements
|
|
4778
|
+
* @internal
|
|
4779
|
+
*/
|
|
4780
|
+
messageSlotChanged(prev: Element[], next: Element[]): void;
|
|
4781
|
+
/**
|
|
4782
|
+
* The slotted inputs.
|
|
4783
|
+
*
|
|
4784
|
+
* @internal
|
|
4785
|
+
* @privateRemarks
|
|
4786
|
+
* This field is populated with the `children` directive in the template rather than `slotted`.
|
|
4787
|
+
*/
|
|
4788
|
+
slottedInputs: SlottableInput[];
|
|
4789
|
+
/**
|
|
4790
|
+
* Sets the `input` property to the first slotted input.
|
|
4791
|
+
*
|
|
4792
|
+
* @param prev - The previous collection of inputs.
|
|
4793
|
+
* @param next - The current collection of inputs.
|
|
4794
|
+
* @internal
|
|
4795
|
+
*/
|
|
4796
|
+
slottedInputsChanged(prev: SlottableInput[] | undefined, next: SlottableInput[] | undefined): void;
|
|
4797
|
+
/**
|
|
4798
|
+
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
4799
|
+
*
|
|
4800
|
+
* @internal
|
|
4801
|
+
*/
|
|
4802
|
+
elementInternals: ElementInternals;
|
|
4803
|
+
/**
|
|
4804
|
+
* Reference to the first slotted input.
|
|
4805
|
+
*
|
|
4806
|
+
* @public
|
|
4807
|
+
*/
|
|
4808
|
+
input: SlottableInput;
|
|
4809
|
+
/**
|
|
4810
|
+
* Calls the `setStates` method when a `change` event is emitted from the slotted input.
|
|
4811
|
+
*
|
|
4812
|
+
* @param e - the event object
|
|
4813
|
+
* @internal
|
|
4814
|
+
*/
|
|
4815
|
+
changeHandler(e: Event): void;
|
|
4816
|
+
/**
|
|
4817
|
+
* Redirects `click` events to the slotted input.
|
|
4818
|
+
*
|
|
4819
|
+
* @internal
|
|
4820
|
+
*/
|
|
4821
|
+
clickHandler(e: MouseEvent): boolean | void;
|
|
4822
|
+
/**
|
|
4823
|
+
* Applies the `focus-visible` state to the element when the slotted input receives visible focus.
|
|
4824
|
+
*
|
|
4825
|
+
* @param e - the focus event
|
|
4826
|
+
* @internal
|
|
4827
|
+
*/
|
|
4828
|
+
focusinHandler(e: FocusEvent): boolean | void;
|
|
4829
|
+
/**
|
|
4830
|
+
* Removes the `focus-visible` state from the field when a slotted input loses focus.
|
|
4831
|
+
*
|
|
4832
|
+
* @param e - the focus event
|
|
4833
|
+
* @internal
|
|
4834
|
+
*/
|
|
4835
|
+
focusoutHandler(e: FocusEvent): boolean | void;
|
|
4836
|
+
/**
|
|
4837
|
+
* Toggles validity state flags on the element when the slotted input emits an `invalid` event (if slotted validation messages are present).
|
|
4838
|
+
*
|
|
4839
|
+
* @param e - the event object
|
|
4840
|
+
* @internal
|
|
4841
|
+
*/
|
|
4842
|
+
invalidHandler(e: Event): boolean | void;
|
|
4843
|
+
/**
|
|
4844
|
+
* Toggles the field's states based on the slotted input.
|
|
4845
|
+
*
|
|
4846
|
+
* @internal
|
|
4847
|
+
*/
|
|
4848
|
+
setStates(): void;
|
|
4849
|
+
}
|
|
4850
|
+
|
|
4851
|
+
/**
|
|
4852
|
+
* The Fluent Field Element
|
|
4853
|
+
*
|
|
4854
|
+
* @public
|
|
4855
|
+
* @remarks
|
|
4856
|
+
* HTML Element: `<fluent-field>`
|
|
4857
|
+
*/
|
|
4858
|
+
export declare const FieldDefinition: FASTElementDefinition<typeof Field>;
|
|
4859
|
+
|
|
4860
|
+
/**
|
|
4861
|
+
* Label position values
|
|
4862
|
+
* @public
|
|
4863
|
+
*/
|
|
4864
|
+
export declare const FieldLabelPosition: {
|
|
4865
|
+
readonly above: "above";
|
|
4866
|
+
readonly after: "after";
|
|
4867
|
+
readonly before: "before";
|
|
4868
|
+
};
|
|
4869
|
+
|
|
4870
|
+
/** @public */
|
|
4871
|
+
export declare type FieldLabelPosition = ValuesOf<typeof FieldLabelPosition>;
|
|
4872
|
+
|
|
4873
|
+
/**
|
|
4874
|
+
* The styles for the {@link Field} component.
|
|
4875
|
+
*
|
|
4876
|
+
* @public
|
|
4877
|
+
*/
|
|
4878
|
+
export declare const FieldStyles: ElementStyles;
|
|
4879
|
+
|
|
4880
|
+
/**
|
|
4881
|
+
* Template for the Field component
|
|
4882
|
+
* @public
|
|
4883
|
+
*/
|
|
4884
|
+
export declare const FieldTemplate: ElementViewTemplate;
|
|
4885
|
+
|
|
4532
4886
|
export declare const FluentDesignSystem: Readonly<{
|
|
4533
4887
|
prefix: "fluent";
|
|
4534
4888
|
shadowRootMode: "open";
|
|
@@ -4685,15 +5039,6 @@ declare interface FormAssociated extends Omit<ElementInternals, 'labels'> {
|
|
|
4685
5039
|
valueChanged(previous: string, next: string): void;
|
|
4686
5040
|
}
|
|
4687
5041
|
|
|
4688
|
-
/**
|
|
4689
|
-
* @beta
|
|
4690
|
-
*/
|
|
4691
|
-
declare class FormAssociatedCheckbox extends FormAssociatedCheckbox_base {
|
|
4692
|
-
proxy: HTMLInputElement;
|
|
4693
|
-
}
|
|
4694
|
-
|
|
4695
|
-
declare const FormAssociatedCheckbox_base: typeof _Checkbox;
|
|
4696
|
-
|
|
4697
5042
|
/**
|
|
4698
5043
|
* @beta
|
|
4699
5044
|
*/
|
|
@@ -4712,15 +5057,6 @@ declare class FormAssociatedSlider extends FormAssociatedSlider_base {
|
|
|
4712
5057
|
|
|
4713
5058
|
declare const FormAssociatedSlider_base: typeof _Slider;
|
|
4714
5059
|
|
|
4715
|
-
/**
|
|
4716
|
-
* @beta
|
|
4717
|
-
*/
|
|
4718
|
-
declare class FormAssociatedSwitch extends FormAssociatedSwitch_base {
|
|
4719
|
-
proxy: HTMLInputElement;
|
|
4720
|
-
}
|
|
4721
|
-
|
|
4722
|
-
declare const FormAssociatedSwitch_base: typeof _Switch;
|
|
4723
|
-
|
|
4724
5060
|
/**
|
|
4725
5061
|
* Determines the current localization direction of an element.
|
|
4726
5062
|
*
|
|
@@ -6381,6 +6717,17 @@ export declare const SliderStyles: ElementStyles;
|
|
|
6381
6717
|
|
|
6382
6718
|
export declare const SliderTemplate: ElementViewTemplate<Slider>;
|
|
6383
6719
|
|
|
6720
|
+
/**
|
|
6721
|
+
* Synthetic type for slotted input elements
|
|
6722
|
+
* @public
|
|
6723
|
+
*/
|
|
6724
|
+
export declare type SlottableInput = HTMLElement & ElementInternals & {
|
|
6725
|
+
elementInternals?: ElementInternals;
|
|
6726
|
+
required: boolean;
|
|
6727
|
+
disabled: boolean;
|
|
6728
|
+
readOnly: boolean;
|
|
6729
|
+
};
|
|
6730
|
+
|
|
6384
6731
|
/**
|
|
6385
6732
|
* CSS custom property value for the {@link @fluentui/tokens#spacingHorizontalL | `spacingHorizontalL`} design token.
|
|
6386
6733
|
* @public
|
|
@@ -6655,49 +7002,7 @@ declare const styles: ElementStyles;
|
|
|
6655
7002
|
export { styles as ButtonStyles }
|
|
6656
7003
|
export { styles as MenuButtonStyles }
|
|
6657
7004
|
|
|
6658
|
-
export declare class Switch extends
|
|
6659
|
-
/**
|
|
6660
|
-
* The label position of the switch
|
|
6661
|
-
*
|
|
6662
|
-
* @public
|
|
6663
|
-
* @remarks
|
|
6664
|
-
* HTML Attribute: labelposition
|
|
6665
|
-
*/
|
|
6666
|
-
labelPosition: SwitchLabelPosition | undefined;
|
|
6667
|
-
/**
|
|
6668
|
-
* When true, the control will be immutable by user interaction. See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute} for more information.
|
|
6669
|
-
* @public
|
|
6670
|
-
* @remarks
|
|
6671
|
-
* HTML Attribute: readonly
|
|
6672
|
-
*/
|
|
6673
|
-
readOnly: boolean;
|
|
6674
|
-
protected readOnlyChanged(): void;
|
|
6675
|
-
/**
|
|
6676
|
-
* The element's value to be included in form submission when checked.
|
|
6677
|
-
* Default to "on" to reach parity with input[type="checkbox"]
|
|
6678
|
-
*
|
|
6679
|
-
* @internal
|
|
6680
|
-
*/
|
|
6681
|
-
initialValue: string;
|
|
6682
|
-
/**
|
|
6683
|
-
* @internal
|
|
6684
|
-
*/
|
|
6685
|
-
defaultSlottedNodes: Node[];
|
|
6686
|
-
constructor();
|
|
6687
|
-
/**
|
|
6688
|
-
* @internal
|
|
6689
|
-
*/
|
|
6690
|
-
keypressHandler: (e: KeyboardEvent) => void;
|
|
6691
|
-
/**
|
|
6692
|
-
* @internal
|
|
6693
|
-
*/
|
|
6694
|
-
clickHandler: (e: MouseEvent) => void;
|
|
6695
|
-
}
|
|
6696
|
-
|
|
6697
|
-
declare class _Switch extends FASTElement {
|
|
6698
|
-
}
|
|
6699
|
-
|
|
6700
|
-
declare interface _Switch extends CheckableFormAssociated {
|
|
7005
|
+
export declare class Switch extends BaseCheckbox {
|
|
6701
7006
|
}
|
|
6702
7007
|
|
|
6703
7008
|
/**
|
|
@@ -7205,13 +7510,13 @@ export declare class TextInput extends FASTElement {
|
|
|
7205
7510
|
* @remarks
|
|
7206
7511
|
* HTML Attribute: `readonly`
|
|
7207
7512
|
*/
|
|
7208
|
-
|
|
7513
|
+
readOnly?: boolean;
|
|
7209
7514
|
/**
|
|
7210
7515
|
* Syncs the `ElementInternals.ariaReadOnly` property when the `readonly` property changes.
|
|
7211
7516
|
*
|
|
7212
7517
|
* @internal
|
|
7213
7518
|
*/
|
|
7214
|
-
|
|
7519
|
+
readOnlyChanged(): void;
|
|
7215
7520
|
/**
|
|
7216
7521
|
* The element's required attribute.
|
|
7217
7522
|
*
|
|
@@ -7283,7 +7588,7 @@ export declare class TextInput extends FASTElement {
|
|
|
7283
7588
|
*
|
|
7284
7589
|
* @internal
|
|
7285
7590
|
*/
|
|
7286
|
-
|
|
7591
|
+
elementInternals: ElementInternals;
|
|
7287
7592
|
/**
|
|
7288
7593
|
* The form-associated flag.
|
|
7289
7594
|
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
|
|
@@ -7329,6 +7634,12 @@ export declare class TextInput extends FASTElement {
|
|
|
7329
7634
|
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/form | `ElementInternals.form`} property.
|
|
7330
7635
|
*/
|
|
7331
7636
|
get form(): HTMLFormElement | null;
|
|
7637
|
+
/**
|
|
7638
|
+
* Handles the internal control's `keypress` event.
|
|
7639
|
+
*
|
|
7640
|
+
* @internal
|
|
7641
|
+
*/
|
|
7642
|
+
beforeinputHandler(e: InputEvent): boolean | void;
|
|
7332
7643
|
/**
|
|
7333
7644
|
* Change event handler for inner control.
|
|
7334
7645
|
*
|
|
@@ -7337,9 +7648,29 @@ export declare class TextInput extends FASTElement {
|
|
|
7337
7648
|
* "Change" events are not `composable` so they will not permeate the shadow DOM boundary. This function effectively
|
|
7338
7649
|
* proxies the change event, emitting a `change` event whenever the internal control emits a `change` event.
|
|
7339
7650
|
*/
|
|
7340
|
-
changeHandler(e: InputEvent): void;
|
|
7651
|
+
changeHandler(e: InputEvent): boolean | void;
|
|
7652
|
+
/**
|
|
7653
|
+
* Checks the validity of the element and returns the result.
|
|
7654
|
+
*
|
|
7655
|
+
* @public
|
|
7656
|
+
* @remarks
|
|
7657
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
|
|
7658
|
+
*/
|
|
7659
|
+
checkValidity(): boolean;
|
|
7660
|
+
/**
|
|
7661
|
+
* Clicks the inner control when the component is clicked.
|
|
7662
|
+
*
|
|
7663
|
+
* @param e - the event object
|
|
7664
|
+
*/
|
|
7665
|
+
clickHandler(e: MouseEvent): boolean | void;
|
|
7341
7666
|
connectedCallback(): void;
|
|
7342
|
-
|
|
7667
|
+
/**
|
|
7668
|
+
* Focuses the inner control when the component is focused.
|
|
7669
|
+
*
|
|
7670
|
+
* @param e - the event object
|
|
7671
|
+
* @public
|
|
7672
|
+
*/
|
|
7673
|
+
focusinHandler(e: FocusEvent): boolean | void;
|
|
7343
7674
|
/**
|
|
7344
7675
|
* Resets the value to its initial value when the form is reset.
|
|
7345
7676
|
*
|
|
@@ -7359,11 +7690,12 @@ export declare class TextInput extends FASTElement {
|
|
|
7359
7690
|
*/
|
|
7360
7691
|
inputHandler(e: InputEvent): boolean | void;
|
|
7361
7692
|
/**
|
|
7362
|
-
* Handles the internal control's `
|
|
7693
|
+
* Handles the internal control's `keydown` event.
|
|
7363
7694
|
*
|
|
7695
|
+
* @param e - the event object
|
|
7364
7696
|
* @internal
|
|
7365
7697
|
*/
|
|
7366
|
-
|
|
7698
|
+
keydownHandler(e: KeyboardEvent): boolean | void;
|
|
7367
7699
|
/**
|
|
7368
7700
|
* Selects all the text in the text field.
|
|
7369
7701
|
*
|
|
@@ -7374,6 +7706,21 @@ export declare class TextInput extends FASTElement {
|
|
|
7374
7706
|
*
|
|
7375
7707
|
*/
|
|
7376
7708
|
select(): void;
|
|
7709
|
+
/**
|
|
7710
|
+
* Sets the custom validity message.
|
|
7711
|
+
* @param message - The message to set
|
|
7712
|
+
*
|
|
7713
|
+
* @public
|
|
7714
|
+
*/
|
|
7715
|
+
setCustomValidity(message: string): void;
|
|
7716
|
+
/**
|
|
7717
|
+
* Reports the validity of the element.
|
|
7718
|
+
*
|
|
7719
|
+
* @public
|
|
7720
|
+
* @remarks
|
|
7721
|
+
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
|
|
7722
|
+
*/
|
|
7723
|
+
reportValidity(): boolean;
|
|
7377
7724
|
/**
|
|
7378
7725
|
* Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
|
|
7379
7726
|
*
|
|
@@ -7389,7 +7736,7 @@ export declare class TextInput extends FASTElement {
|
|
|
7389
7736
|
*
|
|
7390
7737
|
* @internal
|
|
7391
7738
|
*/
|
|
7392
|
-
setValidity(flags?:
|
|
7739
|
+
setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
|
|
7393
7740
|
}
|
|
7394
7741
|
|
|
7395
7742
|
/**
|
|
@@ -7681,6 +8028,27 @@ export declare const typographyTitle2Styles: CSSDirective;
|
|
|
7681
8028
|
|
|
7682
8029
|
export declare const typographyTitle3Styles: CSSDirective;
|
|
7683
8030
|
|
|
8031
|
+
/**
|
|
8032
|
+
* Synthetic type for slotted message elements
|
|
8033
|
+
* @public
|
|
8034
|
+
*/
|
|
8035
|
+
export declare const ValidationFlags: {
|
|
8036
|
+
readonly badInput: "bad-input";
|
|
8037
|
+
readonly customError: "custom-error";
|
|
8038
|
+
readonly patternMismatch: "pattern-mismatch";
|
|
8039
|
+
readonly rangeOverflow: "range-overflow";
|
|
8040
|
+
readonly rangeUnderflow: "range-underflow";
|
|
8041
|
+
readonly stepMismatch: "step-mismatch";
|
|
8042
|
+
readonly tooLong: "too-long";
|
|
8043
|
+
readonly tooShort: "too-short";
|
|
8044
|
+
readonly typeMismatch: "type-mismatch";
|
|
8045
|
+
readonly valueMissing: "value-missing";
|
|
8046
|
+
readonly valid: "valid";
|
|
8047
|
+
};
|
|
8048
|
+
|
|
8049
|
+
/** @public */
|
|
8050
|
+
export declare type ValidationFlags = ValuesOf<typeof ValidationFlags>;
|
|
8051
|
+
|
|
7684
8052
|
/**
|
|
7685
8053
|
* Helper for enumerating a type from a const object
|
|
7686
8054
|
* Example: export type Foo = ValuesOf\<typeof Foo\>
|