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

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 (46) hide show
  1. package/CHANGELOG.md +12 -2
  2. package/dist/dts/anchor-button/index.d.ts +1 -1
  3. package/dist/dts/helpers.tests.d.ts +22 -0
  4. package/dist/dts/index-rollup.d.ts +1 -0
  5. package/dist/dts/index.d.ts +2 -1
  6. package/dist/dts/slider/slider.d.ts +1 -1
  7. package/dist/dts/styles/states/index.d.ts +36 -0
  8. package/dist/dts/textarea/define.d.ts +1 -0
  9. package/dist/dts/textarea/index.d.ts +5 -0
  10. package/dist/dts/textarea/textarea.bench.d.ts +3 -0
  11. package/dist/dts/textarea/textarea.d.ts +390 -0
  12. package/dist/dts/textarea/textarea.definition.d.ts +9 -0
  13. package/dist/dts/textarea/textarea.options.d.ts +47 -0
  14. package/dist/dts/textarea/textarea.styles.d.ts +7 -0
  15. package/dist/dts/textarea/textarea.template.d.ts +12 -0
  16. package/dist/esm/anchor-button/index.js +1 -1
  17. package/dist/esm/anchor-button/index.js.map +1 -1
  18. package/dist/esm/helpers.tests.js +44 -0
  19. package/dist/esm/helpers.tests.js.map +1 -1
  20. package/dist/esm/index-rollup.js +1 -0
  21. package/dist/esm/index-rollup.js.map +1 -1
  22. package/dist/esm/index.js +2 -1
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/esm/slider/slider.js +1 -1
  25. package/dist/esm/styles/states/index.js +40 -0
  26. package/dist/esm/styles/states/index.js.map +1 -1
  27. package/dist/esm/textarea/define.js +4 -0
  28. package/dist/esm/textarea/define.js.map +1 -0
  29. package/dist/esm/textarea/index.js +6 -0
  30. package/dist/esm/textarea/index.js.map +1 -0
  31. package/dist/esm/textarea/textarea.bench.js +10 -0
  32. package/dist/esm/textarea/textarea.bench.js.map +1 -0
  33. package/dist/esm/textarea/textarea.definition.js +20 -0
  34. package/dist/esm/textarea/textarea.definition.js.map +1 -0
  35. package/dist/esm/textarea/textarea.js +605 -0
  36. package/dist/esm/textarea/textarea.js.map +1 -0
  37. package/dist/esm/textarea/textarea.options.js +56 -0
  38. package/dist/esm/textarea/textarea.options.js.map +1 -0
  39. package/dist/esm/textarea/textarea.styles.js +268 -0
  40. package/dist/esm/textarea/textarea.styles.js.map +1 -0
  41. package/dist/esm/textarea/textarea.template.js +54 -0
  42. package/dist/esm/textarea/textarea.template.js.map +1 -0
  43. package/dist/web-components.d.ts +462 -2
  44. package/dist/web-components.js +1090 -538
  45. package/dist/web-components.min.js +284 -280
  46. package/package.json +6 -1
@@ -885,7 +885,7 @@ export declare class BaseAccordionItem extends FASTElement {
885
885
  *
886
886
  * @public
887
887
  */
888
- declare class BaseAnchor extends FASTElement {
888
+ export declare class BaseAnchor extends FASTElement {
889
889
  /**
890
890
  * Holds a reference to the platform to manage ctrl+click on Windows and cmd+click on Mac
891
891
  * @internal
@@ -2086,6 +2086,351 @@ declare class BaseTabs extends FASTElement {
2086
2086
  connectedCallback(): void;
2087
2087
  }
2088
2088
 
2089
+ /**
2090
+ * A Text Area Custom HTML Element.
2091
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea | `<textarea>`} element.
2092
+ *
2093
+ * @slot - The default content/value of the component.
2094
+ * @slot label - The content for the `<label>`, it should be a `<fluent-label>` element.
2095
+ * @csspart label - The `<label>` element.
2096
+ * @csspart root - The container element of the `<textarea>` element.
2097
+ * @csspart control - The internal `<textarea>` element.
2098
+ * @fires change - Fires after the control loses focus, if the content has changed.
2099
+ * @fires select - Fires when the `select()` method is called.
2100
+ *
2101
+ * @public
2102
+ */
2103
+ export declare class BaseTextArea extends FASTElement {
2104
+ /**
2105
+ * The form-associated flag.
2106
+ * @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
2107
+ *
2108
+ * @public
2109
+ */
2110
+ static readonly formAssociated = true;
2111
+ /**
2112
+ * The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
2113
+ *
2114
+ * @internal
2115
+ */
2116
+ elementInternals: ElementInternals;
2117
+ /**
2118
+ * The `<label>` element.
2119
+ * @internal
2120
+ */
2121
+ labelEl: HTMLLabelElement;
2122
+ /**
2123
+ * The `<textarea>` element.
2124
+ * @internal
2125
+ */
2126
+ controlEl: HTMLTextAreaElement;
2127
+ /**
2128
+ * @internal
2129
+ */
2130
+ autoSizerEl?: HTMLDivElement;
2131
+ /**
2132
+ * The list of nodes that are assigned to the default slot.
2133
+ * @internal
2134
+ */
2135
+ defaultSlottedNodes: Node[];
2136
+ protected defaultSlottedNodesChanged(): void;
2137
+ /**
2138
+ * The list of nodes that are assigned to the `label` slot.
2139
+ * @internal
2140
+ */
2141
+ labelSlottedNodes: Label[];
2142
+ protected labelSlottedNodesChanged(): void;
2143
+ private userInteracted;
2144
+ private autoSizerObserver?;
2145
+ private controlElAttrObserver;
2146
+ private preConnectControlEl;
2147
+ /**
2148
+ * Indicates the element's autocomplete state.
2149
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/autocomplete | `autocomplete`} attribute
2150
+ *
2151
+ * @public
2152
+ * @remarks
2153
+ * HTML Attribute: `autocomplete`
2154
+ */
2155
+ autocomplete?: TextAreaAutocomplete;
2156
+ /**
2157
+ * Indicates whether the element’s block size (height) should be automatically changed based on the content.
2158
+ * Note: When this property’s value is set to be `true`, the element should not have a fixed block-size
2159
+ * defined in CSS. Instead, use `min-height` or `min-block-size`.
2160
+ *
2161
+ * @public
2162
+ * @remarks
2163
+ * HTML Attribute: `auto-resize`
2164
+ */
2165
+ autoResize: boolean;
2166
+ protected autoResizeChanged(): void;
2167
+ /**
2168
+ * Sets the name of the value directionality to be submitted with form data.
2169
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/dirname | `dirname`} attribute
2170
+ *
2171
+ * @public
2172
+ * @remarks
2173
+ * HTML Attribute: `dirname`
2174
+ */
2175
+ dirName?: string;
2176
+ /**
2177
+ * Sets the element's disabled state.
2178
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/disabled | `disabled`} attribute
2179
+ *
2180
+ * @public
2181
+ * @remarks
2182
+ * HTML Attribute: `disabled`
2183
+ */
2184
+ disabled: boolean;
2185
+ protected disabledChanged(): void;
2186
+ /**
2187
+ * Indicates whether the element displays a box shadow. This only has effect when `appearance` is set to be `filled-darker` or `filled-lighter`.
2188
+ *
2189
+ * @public
2190
+ * @remarks
2191
+ * HTML Attribute: `display-shadow`
2192
+ */
2193
+ displayShadow: boolean;
2194
+ /**
2195
+ * The id of a form to associate the element to.
2196
+ *
2197
+ * @public
2198
+ * @remarks
2199
+ * HTML Attribute: `form`
2200
+ */
2201
+ initialForm?: string;
2202
+ /**
2203
+ * The form element that’s associated to the element, or `null` if no form is associated.
2204
+ *
2205
+ * @public
2206
+ */
2207
+ get form(): HTMLFormElement | null;
2208
+ /**
2209
+ * A `NodeList` of `<label>` element associated with the element.
2210
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/labels | `labels`} property
2211
+ *
2212
+ * @public
2213
+ */
2214
+ get labels(): NodeList;
2215
+ /**
2216
+ * The maximum number of characters a user can enter.
2217
+ *
2218
+ * @public
2219
+ * @remarks
2220
+ * HTML Attribute: `maxlength`
2221
+ */
2222
+ maxLength?: number;
2223
+ /**
2224
+ * The minimum number of characters a user can enter.
2225
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/minlength | `minlength`} attribute
2226
+ *
2227
+ * @public
2228
+ * @remarks
2229
+ * HTML Attribute: `minlength`
2230
+ */
2231
+ minLength?: number;
2232
+ /**
2233
+ * The name of the element. This element's value will be surfaced during form submission under the provided name.
2234
+ *
2235
+ * @public
2236
+ * @remarks
2237
+ * HTML Attribute: `name`
2238
+ */
2239
+ name: string;
2240
+ /**
2241
+ * Sets the placeholder value of the element, generally used to provide a hint to the user.
2242
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/placeholder | `placeholder`} attribute
2243
+ *
2244
+ * @public
2245
+ * @remarks
2246
+ * HTML Attribute: `placeholder`
2247
+ * This attribute is not a valid substitute for a label.
2248
+ */
2249
+ placeholder?: string;
2250
+ /**
2251
+ * When true, the control will be immutable by user interaction.
2252
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Attributes/readonly | `readonly`} attribute
2253
+ *
2254
+ * @public
2255
+ * @remarks
2256
+ * HTML Attribute: `readonly`
2257
+ */
2258
+ readOnly: boolean;
2259
+ protected readOnlyChanged(): void;
2260
+ /**
2261
+ * The element's required attribute.
2262
+ *
2263
+ * @public
2264
+ * @remarks
2265
+ * HTML Attribute: `required`
2266
+ */
2267
+ required: boolean;
2268
+ protected requiredChanged(): void;
2269
+ /**
2270
+ * Indicates whether the element can be resized by end users.
2271
+ *
2272
+ * @public
2273
+ * @remarks
2274
+ * HTML Attribute: `resize`
2275
+ */
2276
+ resize: TextAreaResize;
2277
+ protected resizeChanged(prev: TextAreaResize | undefined, next: TextAreaResize | undefined): void;
2278
+ /**
2279
+ * Controls whether or not to enable spell checking for the input field, or if the default spell checking configuration should be used.
2280
+ * @see The {@link https://developer.mozilla.org/docs/Web/HTML/Global_attributes/spellcheck | `spellcheck`} attribute
2281
+ *
2282
+ * @public
2283
+ * @remarks
2284
+ * HTML Attribute: `spellcheck`
2285
+ */
2286
+ spellcheck: boolean;
2287
+ /**
2288
+ * The length of the current value.
2289
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#textLength | 'textLength'} property
2290
+ *
2291
+ * @public
2292
+ */
2293
+ get textLength(): number;
2294
+ /**
2295
+ * The type of the element, which is always "textarea".
2296
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/type | `type`} property
2297
+ *
2298
+ * @public
2299
+ */
2300
+ get type(): 'textarea';
2301
+ /**
2302
+ * The element's validity state.
2303
+ *
2304
+ * @public
2305
+ * @remarks
2306
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validity | `ElementInternals.validity`} property.
2307
+ */
2308
+ get validity(): ValidityState;
2309
+ /**
2310
+ * The validation message.
2311
+ *
2312
+ * @public
2313
+ * @remarks
2314
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/validationMessage | `ElementInternals.validationMessage`} property.
2315
+ */
2316
+ get validationMessage(): string;
2317
+ /**
2318
+ * Determines if the control can be submitted for constraint validation.
2319
+ *
2320
+ * @public
2321
+ * @remarks
2322
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/willValidate | `ElementInternals.willValidate`} property.
2323
+ */
2324
+ get willValidate(): boolean;
2325
+ /**
2326
+ * The text content of the element before user interaction.
2327
+ * @see The {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement#defaultvalue | `defaultValue`} property
2328
+ *
2329
+ * @public
2330
+ * @remarks
2331
+ * In order to set the initial/default value, an author should either add the default value in the HTML as the children
2332
+ * of the component, or setting this property in JavaScript. Setting `innerHTML`, `innerText`, or `textContent` on this
2333
+ * component will not change the default value or the content displayed inside the component.
2334
+ */
2335
+ get defaultValue(): string;
2336
+ set defaultValue(next: string);
2337
+ /**
2338
+ * The value of the element.
2339
+ *
2340
+ * @public
2341
+ * @remarks
2342
+ * Reflects the `value` property.
2343
+ */
2344
+ get value(): string;
2345
+ set value(next: string);
2346
+ constructor();
2347
+ /**
2348
+ * @internal
2349
+ */
2350
+ connectedCallback(): void;
2351
+ /**
2352
+ * @internal
2353
+ */
2354
+ disconnectedCallback(): void;
2355
+ /**
2356
+ * Resets the value to its initial value when the form is reset.
2357
+ *
2358
+ * @internal
2359
+ */
2360
+ formResetCallback(): void;
2361
+ /**
2362
+ * @internal
2363
+ */
2364
+ formDisabledCallback(disabled: boolean): void;
2365
+ /**
2366
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/setFormValue | `ElementInternals.setFormValue()`} method.
2367
+ *
2368
+ * @internal
2369
+ */
2370
+ setFormValue(value: File | string | FormData | null, state?: File | string | FormData | null): void;
2371
+ /**
2372
+ * Checks the validity of the element and returns the result.
2373
+ *
2374
+ * @public
2375
+ * @remarks
2376
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/checkValidity | `HTMLInputElement.checkValidity()`} method.
2377
+ */
2378
+ checkValidity(): boolean;
2379
+ /**
2380
+ * Reports the validity of the element.
2381
+ *
2382
+ * @public
2383
+ * @remarks
2384
+ * Reflects the {@link https://developer.mozilla.org/docs/Web/API/ElementInternals/reportValidity | `HTMLInputElement.reportValidity()`} method.
2385
+ */
2386
+ reportValidity(): boolean;
2387
+ /**
2388
+ * Sets the custom validity message.
2389
+ * @param message - The message to set
2390
+ *
2391
+ * @public
2392
+ */
2393
+ setCustomValidity(message: string | null): void;
2394
+ /**
2395
+ * Sets the validity of the control.
2396
+ *
2397
+ * @param flags - Validity flags. If not provided, the control's `validity` will be used.
2398
+ * @param message - Optional message to supply. If not provided, the control's `validationMessage` will be used. If the control does not have a `validationMessage`, the message will be empty.
2399
+ * @param anchor - Optional anchor to use for the validation message. If not provided, the control will be used.
2400
+ *
2401
+ * @internal
2402
+ */
2403
+ setValidity(flags?: Partial<ValidityState>, message?: string, anchor?: HTMLElement): void;
2404
+ /**
2405
+ * Selects the content in the element.
2406
+ *
2407
+ * @public
2408
+ */
2409
+ select(): void;
2410
+ private setDefaultValue;
2411
+ private bindEvents;
2412
+ /**
2413
+ * Gets the content inside the light DOM, if any HTML element is present, use its `outerHTML` value.
2414
+ */
2415
+ private getContent;
2416
+ private observeControlElAttrs;
2417
+ private setDisabledSideEffect;
2418
+ private toggleUserValidityState;
2419
+ private maybeCreateAutoSizerEl;
2420
+ /**
2421
+ * @internal
2422
+ */
2423
+ handleControlInput(): void;
2424
+ /**
2425
+ * @internal
2426
+ */
2427
+ handleControlChange(): void;
2428
+ /**
2429
+ * @internal
2430
+ */
2431
+ handleControlSelect(): void;
2432
+ }
2433
+
2089
2434
  /**
2090
2435
  * A Text Input Custom HTML Element.
2091
2436
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input | `<input>`} element.
@@ -7744,7 +8089,7 @@ export declare const shadow8Brand = "var(--shadow8Brand)";
7744
8089
  * @slot thumb - The slot for a custom thumb element.
7745
8090
  * @csspart thumb-container - The container element of the thumb.
7746
8091
  * @csspart track-container - The container element of the track.
7747
- * @fire change - Fires a custom 'change' event when the value changes.
8092
+ * @fires change - Fires a custom 'change' event when the value changes.
7748
8093
  *
7749
8094
  * @public
7750
8095
  */
@@ -8992,6 +9337,121 @@ export declare const TextAlign: {
8992
9337
  */
8993
9338
  export declare type TextAlign = ValuesOf<typeof TextAlign>;
8994
9339
 
9340
+ export declare class TextArea extends BaseTextArea {
9341
+ protected labelSlottedNodesChanged(): void;
9342
+ /**
9343
+ * Indicates the visual appearance of the element.
9344
+ *
9345
+ * @public
9346
+ * @remarks
9347
+ * HTML Attribute: `appearance`
9348
+ */
9349
+ appearance: TextAreaAppearance;
9350
+ protected appearanceChanged(prev: TextAreaAppearance | undefined, next: TextAreaAppearance | undefined): void;
9351
+ /**
9352
+ * Indicates whether the textarea should be a block-level element.
9353
+ *
9354
+ * @public
9355
+ * @remarks
9356
+ * HTML Attribute: `block`
9357
+ */
9358
+ block: boolean;
9359
+ protected blockChanged(): void;
9360
+ /**
9361
+ * Sets the size of the control.
9362
+ *
9363
+ * @public
9364
+ * @remarks
9365
+ * HTML Attribute: `size`
9366
+ */
9367
+ size?: TextAreaSize;
9368
+ protected sizeChanged(prev: TextAreaSize | undefined, next: TextAreaSize | undefined): void;
9369
+ /**
9370
+ * @internal
9371
+ */
9372
+ handleChange(_: any, propertyName: string): void;
9373
+ /**
9374
+ * @internal
9375
+ */
9376
+ connectedCallback(): void;
9377
+ /**
9378
+ * @internal
9379
+ */
9380
+ disconnectedCallback(): void;
9381
+ private maybeDisplayShadow;
9382
+ }
9383
+
9384
+ /**
9385
+ * Values for the `appearance` attribute on TextArea elements.
9386
+ *
9387
+ * @public
9388
+ */
9389
+ export declare const TextAreaAppearance: {
9390
+ readonly outline: "outline";
9391
+ readonly filledLighter: "filled-lighter";
9392
+ readonly filledDarker: "filled-darker";
9393
+ };
9394
+
9395
+ export declare type TextAreaAppearance = ValuesOf<typeof TextAreaAppearance>;
9396
+
9397
+ /**
9398
+ * Values for the `autocomplete` attribute on TextArea elements.
9399
+ *
9400
+ * @public
9401
+ */
9402
+ export declare const TextAreaAutocomplete: {
9403
+ readonly on: "on";
9404
+ readonly off: "off";
9405
+ };
9406
+
9407
+ export declare type TextAreaAutocomplete = ValuesOf<typeof TextAreaAutocomplete>;
9408
+
9409
+ /**
9410
+ * The Fluent Textarea Element definition.
9411
+ *
9412
+ * @public
9413
+ * @remarks
9414
+ * HTML Element: `<fluent-textarea>`
9415
+ */
9416
+ export declare const TextAreaDefinition: FASTElementDefinition<typeof TextArea>;
9417
+
9418
+ /**
9419
+ * Values for the `resize` attribute on TextArea elements.
9420
+ */
9421
+ export declare const TextAreaResize: {
9422
+ readonly none: "none";
9423
+ readonly both: "both";
9424
+ readonly horizontal: "horizontal";
9425
+ readonly vertical: "vertical";
9426
+ };
9427
+
9428
+ export declare type TextAreaResize = ValuesOf<typeof TextAreaResize>;
9429
+
9430
+ /**
9431
+ * Values for the `size` attribute on TextArea elements.
9432
+ *
9433
+ * @public
9434
+ */
9435
+ export declare const TextAreaSize: {
9436
+ readonly small: "small";
9437
+ readonly medium: "medium";
9438
+ readonly large: "large";
9439
+ };
9440
+
9441
+ export declare type TextAreaSize = ValuesOf<typeof TextAreaSize>;
9442
+
9443
+ /**
9444
+ * Styles for the TextArea component.
9445
+ *
9446
+ * @public
9447
+ */
9448
+ export declare const TextAreaStyles: ElementStyles;
9449
+
9450
+ /**
9451
+ * @internal
9452
+ */
9453
+ export declare const TextAreaTemplate: ElementViewTemplate<TextArea>;
9454
+
8995
9455
  /**
8996
9456
  * The Fluent Text Element.
8997
9457
  *