@fluentui/web-components 3.1.3 → 3.1.4
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 +19 -2
- package/custom-elements.json +45 -55
- package/dist/esm/divider/divider.styles.css +21 -13
- package/dist/esm/divider/divider.styles.js +21 -13
- package/dist/esm/divider/divider.styles.js.map +1 -1
- package/dist/esm/dropdown/dropdown.base.d.ts +7 -9
- package/dist/esm/dropdown/dropdown.base.js +8 -13
- package/dist/esm/dropdown/dropdown.base.js.map +1 -1
- package/dist/esm/dropdown/dropdown.styles.css +37 -6
- package/dist/esm/dropdown/dropdown.styles.d.ts +4 -0
- package/dist/esm/dropdown/dropdown.styles.js +41 -6
- package/dist/esm/dropdown/dropdown.styles.js.map +1 -1
- package/dist/esm/dropdown/dropdown.template.d.ts +2 -0
- package/dist/esm/dropdown/dropdown.template.js +4 -2
- package/dist/esm/dropdown/dropdown.template.js.map +1 -1
- package/dist/esm/field/field.base.d.ts +1 -0
- package/dist/esm/field/field.base.js +32 -9
- package/dist/esm/field/field.base.js.map +1 -1
- package/dist/esm/field/field.options.d.ts +4 -0
- package/dist/esm/field/field.options.js.map +1 -1
- package/dist/esm/menu-list/menu-list.base.js +19 -1
- package/dist/esm/menu-list/menu-list.base.js.map +1 -1
- package/dist/esm/switch/switch.styles.css +2 -2
- package/dist/esm/switch/switch.styles.js +2 -2
- package/dist/esm/text-input/text-input.base.d.ts +18 -0
- package/dist/esm/text-input/text-input.base.js +59 -5
- package/dist/esm/text-input/text-input.base.js.map +1 -1
- package/dist/esm/tooltip/tooltip.options.d.ts +13 -13
- package/dist/esm/tooltip/tooltip.options.js +13 -13
- package/dist/esm/tooltip/tooltip.options.js.map +1 -1
- package/dist/esm/tooltip/tooltip.styles.js +12 -13
- package/dist/esm/tooltip/tooltip.styles.js.map +1 -1
- package/dist/esm/utils/get-initials.js +1 -2
- package/dist/esm/utils/get-initials.js.map +1 -1
- package/dist/web-components-all.js +107 -38
- package/dist/web-components-all.min.js +13 -13
- package/dist/web-components.d.ts +49 -22
- package/dist/web-components.js +95 -40
- package/dist/web-components.min.js +13 -13
- package/package.json +1 -1
package/dist/web-components.d.ts
CHANGED
|
@@ -1732,6 +1732,13 @@ export declare class BaseDropdown extends FASTElement {
|
|
|
1732
1732
|
* @internal
|
|
1733
1733
|
*/
|
|
1734
1734
|
private static AnchorPositionFallbackObserver;
|
|
1735
|
+
/**
|
|
1736
|
+
* The element identity. This static property should NOT be overridden by subclasses. It’s designed to provide an
|
|
1737
|
+
* unambiguous name for the custom element and its subclass custom elements, regardless of their tag names.
|
|
1738
|
+
* @readonly
|
|
1739
|
+
* @internal
|
|
1740
|
+
*/
|
|
1741
|
+
static readonly elementIdentity = "dropdown";
|
|
1735
1742
|
/**
|
|
1736
1743
|
* The ID of the current active descendant.
|
|
1737
1744
|
*
|
|
@@ -1915,15 +1922,6 @@ export declare class BaseDropdown extends FASTElement {
|
|
|
1915
1922
|
* @internal
|
|
1916
1923
|
*/
|
|
1917
1924
|
typeChanged(prev: DropdownType | undefined, next: DropdownType | undefined): void;
|
|
1918
|
-
/**
|
|
1919
|
-
* The initial value of the control. When the control is a combobox, this value is used to set the value of the
|
|
1920
|
-
* control when the dropdown is initialized.
|
|
1921
|
-
*
|
|
1922
|
-
* @public
|
|
1923
|
-
* @remarks
|
|
1924
|
-
* HTML Attribute: `value`
|
|
1925
|
-
*/
|
|
1926
|
-
valueAttribute: string;
|
|
1927
1925
|
/**
|
|
1928
1926
|
* The slot element for the control.
|
|
1929
1927
|
* @internal
|
|
@@ -2354,6 +2352,7 @@ export declare class BaseField extends FASTElement {
|
|
|
2354
2352
|
* @internal
|
|
2355
2353
|
*/
|
|
2356
2354
|
private setLabelProperties;
|
|
2355
|
+
private getLabelableInput;
|
|
2357
2356
|
/**
|
|
2358
2357
|
* Toggles the field's states based on the slotted input.
|
|
2359
2358
|
*
|
|
@@ -3556,6 +3555,18 @@ export declare class BaseTextInput extends FASTElement {
|
|
|
3556
3555
|
* @internal
|
|
3557
3556
|
*/
|
|
3558
3557
|
private dirtyValue;
|
|
3558
|
+
/**
|
|
3559
|
+
* The value as of the last `change` event or programmatic update.
|
|
3560
|
+
*
|
|
3561
|
+
* @internal
|
|
3562
|
+
*/
|
|
3563
|
+
private committedValue;
|
|
3564
|
+
/**
|
|
3565
|
+
* Indicates that `value` is being updated from the internal control's `input` event.
|
|
3566
|
+
*
|
|
3567
|
+
* @internal
|
|
3568
|
+
*/
|
|
3569
|
+
private isUserInput;
|
|
3559
3570
|
/**
|
|
3560
3571
|
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
3561
3572
|
*
|
|
@@ -3616,6 +3627,12 @@ export declare class BaseTextInput extends FASTElement {
|
|
|
3616
3627
|
* proxies the change event, emitting a `change` event whenever the internal control emits a `change` event.
|
|
3617
3628
|
*/
|
|
3618
3629
|
changeHandler(e: InputEvent): boolean | void;
|
|
3630
|
+
/**
|
|
3631
|
+
* Validates, records the committed value, and emits `change` on the host.
|
|
3632
|
+
*
|
|
3633
|
+
* @internal
|
|
3634
|
+
*/
|
|
3635
|
+
private emitChange;
|
|
3619
3636
|
/**
|
|
3620
3637
|
* Checks the validity of the element and returns the result.
|
|
3621
3638
|
*
|
|
@@ -7327,6 +7344,8 @@ export declare const DropdownDefinition: PartialFASTElementDefinition;
|
|
|
7327
7344
|
|
|
7328
7345
|
/**
|
|
7329
7346
|
* The template partial for the dropdown input element. This template is used when the `type` property is set to "combobox".
|
|
7347
|
+
* The `size` attribute is set to the smallest valid value (`1`) so the input’s intrinsic width is minimal and its
|
|
7348
|
+
* width is controlled in CSS.
|
|
7330
7349
|
*
|
|
7331
7350
|
* @public
|
|
7332
7351
|
* @remarks
|
|
@@ -7653,6 +7672,10 @@ export declare type DropdownSize = ValuesOf<typeof DropdownSize>;
|
|
|
7653
7672
|
/**
|
|
7654
7673
|
* Styles for the {@link (Dropdown:class)} component.
|
|
7655
7674
|
*
|
|
7675
|
+
* NOTE: The `--_initial-display` CSS variable and the `initial-display`
|
|
7676
|
+
* attribute are used to show the server defined display text in SSR context,
|
|
7677
|
+
* before the custom element is defined and upgraded.
|
|
7678
|
+
*
|
|
7656
7679
|
* @public
|
|
7657
7680
|
*/
|
|
7658
7681
|
export declare const DropdownStyles: ElementStyles;
|
|
@@ -10013,6 +10036,10 @@ export declare type SlottableInput = HTMLElement & ElementInternals & {
|
|
|
10013
10036
|
readOnly: boolean;
|
|
10014
10037
|
checked?: boolean;
|
|
10015
10038
|
value?: string;
|
|
10039
|
+
control?: HTMLButtonElement | HTMLInputElement;
|
|
10040
|
+
constructor: {
|
|
10041
|
+
elementIdentity?: string;
|
|
10042
|
+
};
|
|
10016
10043
|
};
|
|
10017
10044
|
|
|
10018
10045
|
/**
|
|
@@ -11145,22 +11172,22 @@ export declare class Tooltip extends FASTElement {
|
|
|
11145
11172
|
export declare const TooltipDefinition: PartialFASTElementDefinition;
|
|
11146
11173
|
|
|
11147
11174
|
/**
|
|
11148
|
-
* The TooltipPositioning options
|
|
11175
|
+
* The TooltipPositioning options
|
|
11149
11176
|
* @public
|
|
11150
11177
|
*/
|
|
11151
11178
|
export declare const TooltipPositioningOption: {
|
|
11152
|
-
readonly 'above-start': "
|
|
11153
|
-
readonly above: "
|
|
11154
|
-
readonly 'above-end': "
|
|
11155
|
-
readonly 'below-start': "
|
|
11156
|
-
readonly below: "
|
|
11157
|
-
readonly 'below-end': "
|
|
11158
|
-
readonly 'before-top': "
|
|
11159
|
-
readonly before: "
|
|
11160
|
-
readonly 'before-bottom': "
|
|
11161
|
-
readonly 'after-top': "
|
|
11162
|
-
readonly after: "
|
|
11163
|
-
readonly 'after-bottom': "
|
|
11179
|
+
readonly 'above-start': "above-start";
|
|
11180
|
+
readonly above: "above";
|
|
11181
|
+
readonly 'above-end': "above-end";
|
|
11182
|
+
readonly 'below-start': "below-start";
|
|
11183
|
+
readonly below: "below";
|
|
11184
|
+
readonly 'below-end': "below-end";
|
|
11185
|
+
readonly 'before-top': "before-top";
|
|
11186
|
+
readonly before: "before";
|
|
11187
|
+
readonly 'before-bottom': "before-bottom";
|
|
11188
|
+
readonly 'after-top': "after-top";
|
|
11189
|
+
readonly after: "after";
|
|
11190
|
+
readonly 'after-bottom': "after-bottom";
|
|
11164
11191
|
};
|
|
11165
11192
|
|
|
11166
11193
|
/**
|
package/dist/web-components.js
CHANGED
|
@@ -5581,7 +5581,7 @@ const definition$C = {
|
|
|
5581
5581
|
|
|
5582
5582
|
const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
|
|
5583
5583
|
const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
|
|
5584
|
-
const PHONENUMBER_REGEX =
|
|
5584
|
+
const PHONENUMBER_REGEX = /^(?:\d[\d\s]*\d|\d[\d\s]*(?:ext|x)\s*\d+)$/i;
|
|
5585
5585
|
const MULTIPLE_WHITESPACES_REGEX = /\s+/g;
|
|
5586
5586
|
const UNSUPPORTED_TEXT_REGEX = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;
|
|
5587
5587
|
function getInitialsLatin(displayName, isRtl, firstInitialOnly) {
|
|
@@ -7076,7 +7076,7 @@ const DividerRole = {
|
|
|
7076
7076
|
const DividerOrientation = Orientation;
|
|
7077
7077
|
const tagName$u = `${FluentDesignSystem.prefix}-divider`;
|
|
7078
7078
|
|
|
7079
|
-
const styles$u = css`${display("flex")} :host{contain:content}:host::after,:host::before{align-self:center;background:${colorNeutralStroke2};box-sizing:border-box;content:'';display:flex;flex-grow:1;height:${strokeWidthThin}}:host([inset]){padding:0 12px}:host ::slotted(*){color:${colorNeutralForeground2};font-family:${fontFamilyBase};font-size:${fontSizeBase200};font-weight:${fontWeightRegular};margin:0;padding:0 12px}:host([align-content='start'])::before,:host([align-content='end'])::after{flex-basis:12px;flex-grow:0;flex-shrink:0}:host([orientation='vertical']){align-items:center;flex-direction:column;height:100
|
|
7079
|
+
const styles$u = css`${display("flex")} :host{--_vertical-min-height:10px;contain:content}:host::after,:host::before{align-self:center;background:${colorNeutralStroke2};box-sizing:border-box;content:'';display:flex;flex-grow:1;height:${strokeWidthThin}}:host([inset]){padding:0 12px}:host ::slotted(*){color:${colorNeutralForeground2};font-family:${fontFamilyBase};font-size:${fontSizeBase200};font-weight:${fontWeightRegular};margin:0;padding:0 12px}:host([align-content='start'])::before,:host([align-content='end'])::after{flex-basis:12px;flex-grow:0;flex-shrink:0}:host([orientation='vertical']){align-items:center;flex-direction:column;height:100%}:host([orientation='vertical'][inset])::before{margin-top:12px}:host([orientation='vertical'][inset])::after{margin-bottom:12px}:host([orientation='vertical'])::before,:host([orientation='vertical'])::after{width:${strokeWidthThin};min-height:var(--_vertical-min-height);height:100%}@supports not selector(:host(:has(*))){@scope{:scope:has(*){--_vertical-min-height:20px}}}:host(:has(*)){--_vertical-min-height:20px}:host([orientation='vertical']) ::slotted(*){display:flex;flex-direction:column;padding:12px 0;line-height:20px}:host([orientation='vertical'][align-content='start'])::before{min-height:8px}:host([orientation='vertical'][align-content='end'])::after{min-height:8px}:host([appearance='strong'])::before,:host([appearance='strong'])::after{background:${colorNeutralStroke1}}:host([appearance='strong']) ::slotted(*){color:${colorNeutralForeground1}}:host([appearance='brand'])::before,:host([appearance='brand'])::after{background:${colorBrandStroke1}}:host([appearance='brand']) ::slotted(*){color:${colorBrandForeground1}}:host([appearance='subtle'])::before,:host([appearance='subtle'])::after{background:${colorNeutralStroke3}}:host([appearance='subtle']) ::slotted(*){color:${colorNeutralForeground3}}@media (forced-colors:active){:host([appearance='strong'])::before,:host([appearance='strong'])::after,:host([appearance='brand'])::before,:host([appearance='brand'])::after,:host([appearance='subtle'])::before,:host([appearance='subtle'])::after,:host::after,:host::before{background:WindowText;color:WindowText}}`;
|
|
7080
7080
|
|
|
7081
7081
|
function dividerTemplate() {
|
|
7082
7082
|
return html`<slot></slot>`;
|
|
@@ -7432,10 +7432,10 @@ const DropdownType = {
|
|
|
7432
7432
|
};
|
|
7433
7433
|
const tagName$r = `${FluentDesignSystem.prefix}-dropdown`;
|
|
7434
7434
|
|
|
7435
|
-
const styles$r = css`${display("inline-flex")} :host{box-sizing:border-box;color:${colorNeutralForeground1};cursor:pointer}:host(${placeholderShownState}){color
|
|
7435
|
+
const styles$r = css`${display("inline-flex")} :host{--_indicator-size:20px;--_placeholder-color:${colorNeutralForeground4};--_initial-display:attr(initial-display raw-string,attr(placeholder raw-string,none));box-sizing:border-box;color:${colorNeutralForeground1};cursor:pointer}:host(${placeholderShownState}){color:var(--_placeholder-color)}.control{appearance:none;background-color:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:${strokeWidthThin} solid ${colorTransparentStroke};box-shadow:inset 0 0 0 ${strokeWidthThin} var(--control-border-color);box-sizing:border-box;color:inherit;column-gap:${spacingHorizontalXXS};display:inline-grid;grid-template-columns:1fr var(--_indicator-size);justify-content:space-between;min-width:160px;overflow:hidden;padding:${spacingVerticalSNudge} ${spacingHorizontalMNudge};white-space:normal;position:relative;text-align:start;width:100%;z-index:1;${typographyBody1Styles}}:host([size='small']) .control{column-gap:${spacingHorizontalXXS};padding:${spacingVerticalXS} ${spacingHorizontalSNudge};${typographyCaption1Styles}}:host([size='large']) .control{column-gap:${spacingHorizontalS};padding:${spacingVerticalS} ${spacingHorizontalM};${typographyBody2Styles}}:host(:not(:has([slot='control']))) slot[name='control']::before{content:var(--_initial-display)}@scope{:scope:not(:has([slot='control'])) slot[name='control']::before{content:var(--_initial-display)}}:host(:is(:not([value]),[value=''])) slot[name='control']::before{color:var(--_placeholder-color)}::slotted(:is(input,button)){all:unset}slot[name='control']::before,::slotted(:is(input,button)){grid-area:1/1}::slotted(button){cursor:pointer}::slotted(input){cursor:text;min-width:0;width:100%}::slotted(input)::placeholder{color:var(--_placeholder-color)}:where(slot[name='indicator']>*,::slotted([slot='indicator'])){all:unset;align-items:center;appearance:none;aspect-ratio:1;color:${colorNeutralForeground3};display:inline-flex;grid-area:1/2;justify-content:center;width:var(--_indicator-size)}:host([size='small']) :where(slot[name='indicator']>*,::slotted([slot='indicator'])){--_indicator-size:16px}:host([size='large']) :where(slot[name='indicator']>*,::slotted([slot='indicator'])){--_indicator-size:24px}.control::after,.control::before{content:''/'';inset:auto 0 0;pointer-events:none;position:absolute}.control::before{height:${strokeWidthThin}}.control::after{background-color:${colorCompoundBrandStroke};height:${strokeWidthThick};scale:0 1;transition:scale ${durationUltraFast} ${curveDecelerateMid}}:host(:where(:focus-within)) .control{border-radius:${borderRadiusMedium};box-shadow:inset 0 0 0 1px ${colorStrokeFocus1};outline:${strokeWidthThick} solid ${colorStrokeFocus2}}:host(:where(${openState},:focus-within)) .control::after{scale:1 1;transition-duration:${durationNormal};transition-timing-function:${curveAccelerateMid}}:host(:where([appearance='outline'],[appearance='transparent'])) .control::before{background-color:${colorNeutralStrokeAccessible}}:host([appearance='transparent']) .control{--control-border-color:${colorTransparentStrokeInteractive};background-color:${colorTransparentBackground};border-radius:${borderRadiusNone}}:host([appearance='outline']) .control{--control-border-color:${colorNeutralStroke1}}:host([appearance='outline']) .control:hover{--control-border-color:${colorNeutralStroke1Hover}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:hover::before{background-color:${colorNeutralStrokeAccessibleHover}}:host([appearance='outline']) .control:hover::after{background-color:${colorCompoundBrandBackgroundHover}}:host([appearance='outline']) .control:active{--control-border-color:${colorNeutralStroke1Pressed}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:active::before{background-color:${colorNeutralStrokeAccessiblePressed}}:host(:where([appearance='outline'],[appearance='transparent'])) .control:active::after{background-color:${colorCompoundBrandBackgroundPressed}}:host([appearance='filled-darker']) .control{background-color:${colorNeutralBackground3}}:host(:where([appearance='filled-lighter'],[appearance='filled-darker'])) .control{--control-border-color:${colorTransparentStroke}}:host(${nativeDisabledState}),:host(${nativeDisabledState}) ::slotted(:where(button,input)){cursor:not-allowed}:host(${nativeDisabledState}) .control::before,:host(${nativeDisabledState}) .control::after{content:none}:host(${nativeDisabledState}) .control:is(*,:active,:hover),:host(${nativeDisabledState}) :where(slot[name='indicator']>*,::slotted([slot='indicator'])){--control-border-color:${colorNeutralStrokeDisabled};background-color:${colorNeutralBackgroundDisabled};color:${colorNeutralForegroundDisabled}}::slotted(:not([slot]):not([popover])),::slotted([popover]:not(:popover-open)){display:none}@supports not (anchor-name:--anchor){:host{--listbox-max-height:50vh;--margin-offset:calc(${lineHeightBase300} + (${spacingVerticalSNudge} * 2) + ${strokeWidthThin})}:host([size='small']){--margin-offset:calc(${lineHeightBase200} + (${spacingVerticalXS} * 2) + ${strokeWidthThin})}:host([size='large']){--margin-offset:calc(${lineHeightBase400} + (${spacingVerticalS} * 2) + ${strokeWidthThin})}}@media (forced-colors:active){:host(${nativeDisabledState}) .control{border-color:GrayText}:host(${nativeDisabledState}) :where(slot[name='indicator']>*,::slotted([slot='indicator'])){color:GrayText}}`;
|
|
7436
7436
|
|
|
7437
7437
|
const dropdownIndicatorTemplate = html`<svg class=chevron-down-20-regular aria-hidden=true slot=indicator viewBox="0 0 20 20" ${ref("indicator")}><path d="M15.85 7.65a.5.5 0 0 1 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16a.5.5 0 0 1 .7 0" fill=currentColor /></svg>`;
|
|
7438
|
-
const dropdownInputTemplate = html`<input @input=${(x, c) => x.inputHandler(c.event)} @change=${(x, c) => x.changeHandler(c.event)} aria-activedescendant=${(x) => x.activeDescendant} aria-controls=${(x) => x.listbox?.id ?? null} aria-labelledby=${(x) => x.ariaLabelledBy} aria-expanded=${(x) => x.open} aria-haspopup=listbox placeholder=${(x) => x.placeholder} role=combobox ?disabled=${(x) => x.disabled}
|
|
7438
|
+
const dropdownInputTemplate = html`<input @input=${(x, c) => x.inputHandler(c.event)} @change=${(x, c) => x.changeHandler(c.event)} aria-activedescendant=${(x) => x.activeDescendant} aria-controls=${(x) => x.listbox?.id ?? null} aria-labelledby=${(x) => x.ariaLabelledBy} aria-expanded=${(x) => x.open} aria-haspopup=listbox size=1 placeholder=${(x) => x.placeholder} role=combobox ?disabled=${(x) => x.disabled} value=${(x) => x.initialValue} slot=control ${ref("control")}>`;
|
|
7439
7439
|
const dropdownButtonTemplate = html`<button aria-activedescendant=${(x) => x.activeDescendant} aria-controls=${(x) => x.listbox?.id ?? null} aria-expanded=${(x) => x.open} aria-haspopup=listbox role=combobox ?disabled=${(x) => x.disabled} type=button slot=control ${ref("control")}>${(x) => x.displayValue}</button>`;
|
|
7440
7440
|
function dropdownTemplate(options = {}) {
|
|
7441
7441
|
return html`<template @click=${(x, c) => x.clickHandler(c.event)} @focusout=${(x, c) => x.focusoutHandler(c.event)} @keydown=${(x, c) => x.keydownHandler(c.event)} @mousedown=${(x, c) => x.mousedownHandler(c.event)}><div class=control><slot name=control ${ref("controlSlot")}></slot><slot name=indicator ${ref("indicatorSlot")}>${staticallyCompose(options.indicator)}</slot></div><slot @slotchange=${(x, c) => x.slotchangeHandler(c.event)}></slot></template>`;
|
|
@@ -7502,7 +7502,6 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7502
7502
|
this.id = uniqueId("dropdown-");
|
|
7503
7503
|
this.required = false;
|
|
7504
7504
|
this.type = DropdownType.dropdown;
|
|
7505
|
-
this.valueAttribute = "";
|
|
7506
7505
|
/**
|
|
7507
7506
|
* Repositions the listbox to align with the control element. Used when the browser does not support CSS anchor
|
|
7508
7507
|
* positioning.
|
|
@@ -7652,7 +7651,7 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
7652
7651
|
this.setValidity();
|
|
7653
7652
|
});
|
|
7654
7653
|
if (AnchorPositioningCSSSupported) {
|
|
7655
|
-
const anchorName = uniqueId("--dropdown-anchor-");
|
|
7654
|
+
const anchorName = this.style.getPropertyValue("anchor-name") || uniqueId("--dropdown-anchor-");
|
|
7656
7655
|
this.style.setProperty("anchor-name", anchorName);
|
|
7657
7656
|
this.listbox.style.setProperty("position-anchor", anchorName);
|
|
7658
7657
|
}
|
|
@@ -8266,6 +8265,13 @@ const _BaseDropdown = class _BaseDropdown extends FASTElement {
|
|
|
8266
8265
|
}
|
|
8267
8266
|
}
|
|
8268
8267
|
};
|
|
8268
|
+
/**
|
|
8269
|
+
* The element identity. This static property should NOT be overridden by subclasses. It’s designed to provide an
|
|
8270
|
+
* unambiguous name for the custom element and its subclass custom elements, regardless of their tag names.
|
|
8271
|
+
* @readonly
|
|
8272
|
+
* @internal
|
|
8273
|
+
*/
|
|
8274
|
+
_BaseDropdown.elementIdentity = "dropdown";
|
|
8269
8275
|
/**
|
|
8270
8276
|
* The form-associated flag.
|
|
8271
8277
|
* @see {@link https://html.spec.whatwg.org/multipage/custom-elements.html#custom-elements-face-example | Form-associated custom elements}
|
|
@@ -8324,9 +8330,6 @@ __decorateClass$x([
|
|
|
8324
8330
|
__decorateClass$x([
|
|
8325
8331
|
attr
|
|
8326
8332
|
], _BaseDropdown.prototype, "type", 2);
|
|
8327
|
-
__decorateClass$x([
|
|
8328
|
-
attr({ attribute: "value" })
|
|
8329
|
-
], _BaseDropdown.prototype, "valueAttribute", 2);
|
|
8330
8333
|
let BaseDropdown = _BaseDropdown;
|
|
8331
8334
|
|
|
8332
8335
|
var __defProp$w = Object.defineProperty;
|
|
@@ -8544,17 +8547,40 @@ class BaseField extends FASTElement {
|
|
|
8544
8547
|
*
|
|
8545
8548
|
* @internal
|
|
8546
8549
|
*/
|
|
8547
|
-
setLabelProperties() {
|
|
8548
|
-
|
|
8549
|
-
|
|
8550
|
-
|
|
8551
|
-
|
|
8552
|
-
|
|
8553
|
-
|
|
8554
|
-
|
|
8550
|
+
async setLabelProperties() {
|
|
8551
|
+
const input = await this.getLabelableInput();
|
|
8552
|
+
if (!input) {
|
|
8553
|
+
return;
|
|
8554
|
+
}
|
|
8555
|
+
input.id || (input.id = uniqueId("input"));
|
|
8556
|
+
this.labelSlot?.forEach((label) => {
|
|
8557
|
+
if (label instanceof HTMLLabelElement) {
|
|
8558
|
+
label.htmlFor || (label.htmlFor = input.id);
|
|
8559
|
+
label.id || (label.id = `${input.id}--label`);
|
|
8560
|
+
input.setAttribute("aria-labelledby", label.id);
|
|
8561
|
+
}
|
|
8562
|
+
});
|
|
8563
|
+
}
|
|
8564
|
+
getLabelableInput() {
|
|
8565
|
+
return new Promise((resolve) => {
|
|
8566
|
+
if (!this.input) {
|
|
8567
|
+
return resolve(null);
|
|
8568
|
+
}
|
|
8569
|
+
if (this.input.constructor.elementIdentity !== "dropdown") {
|
|
8570
|
+
return resolve(this.input);
|
|
8571
|
+
}
|
|
8572
|
+
if (this.input.control) {
|
|
8573
|
+
return resolve(this.input.control);
|
|
8574
|
+
}
|
|
8575
|
+
new MutationObserver((_, observer) => {
|
|
8576
|
+
if (this.input.control) {
|
|
8577
|
+
resolve(this.input.control);
|
|
8578
|
+
observer.disconnect();
|
|
8555
8579
|
}
|
|
8580
|
+
}).observe(this.input, {
|
|
8581
|
+
childList: true
|
|
8556
8582
|
});
|
|
8557
|
-
}
|
|
8583
|
+
});
|
|
8558
8584
|
}
|
|
8559
8585
|
/**
|
|
8560
8586
|
* Toggles the field's states based on the slotted input.
|
|
@@ -9832,7 +9858,9 @@ const _BaseMenuList = class _BaseMenuList extends FASTElement {
|
|
|
9832
9858
|
* @public
|
|
9833
9859
|
*/
|
|
9834
9860
|
focus() {
|
|
9835
|
-
|
|
9861
|
+
Updates.enqueue(() => {
|
|
9862
|
+
this.menuItems?.find((item) => !item.disabled)?.focus();
|
|
9863
|
+
});
|
|
9836
9864
|
}
|
|
9837
9865
|
setItems() {
|
|
9838
9866
|
const children = Array.from(this.children);
|
|
@@ -12160,7 +12188,7 @@ Spinner.define(definition$a);
|
|
|
12160
12188
|
|
|
12161
12189
|
const tagName$9 = `${FluentDesignSystem.prefix}-switch`;
|
|
12162
12190
|
|
|
12163
|
-
const styles$9 = css`${display("inline-flex")} :host{box-sizing:border-box;align-items:center;flex-direction:row;outline:none;user-select:none;contain:content;padding:0 ${spacingHorizontalXXS};width:40px;height:20px;background-color:${colorTransparentBackground};border:1px solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular}}:host(:enabled){cursor:pointer}:host(:hover){background:none;border-color:${colorNeutralStrokeAccessibleHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(${nativeDisabledState}),:host([readonly]){border:1px solid ${colorNeutralStrokeDisabled};background-color:none;pointer:default}:host(${checkedState}){background:${colorCompoundBrandBackground};border-color:${colorCompoundBrandBackground}}:host(${checkedState}:hover){background:${colorCompoundBrandBackgroundHover};border-color:${colorCompoundBrandBackgroundHover}}:host(${checkedState}:active){background:${colorCompoundBrandBackgroundPressed};border-color:${colorCompoundBrandBackgroundPressed}}:host(${checkedState}${nativeDisabledState}){background:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}.checked-indicator{height:14px;width:14px;border-radius:50%;margin-inline-start:0;background-color:${colorNeutralForeground3};transition-duration:${durationNormal};transition-timing-function:${curveEasyEase};transition-property:margin-inline-start}:host(${checkedState}) .checked-indicator{background-color:${colorNeutralForegroundInverted};margin-inline-start:calc(100% - 14px)}:host(${checkedState}:hover) .checked-indicator{background:${colorNeutralForegroundInvertedHover}}:host(${checkedState}:active) .checked-indicator{background:${colorNeutralForegroundInvertedPressed}}:host(:hover) .checked-indicator{background-color:${colorNeutralForeground3Hover}}:host(:active) .checked-indicator{background-color:${colorNeutralForeground3Pressed}}:host(${nativeDisabledState}) .checked-indicator,:host([readonly]) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(${checkedState}${nativeDisabledState}) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(:focus-visible){outline:none}:host(:not([slot='input']):focus-visible){border-color:${colorTransparentStroke};outline:${strokeWidthThick} solid ${colorTransparentStroke};outline-offset:1px;box-shadow:${shadow4},0 0 0 2px ${colorStrokeFocus2}}@media (forced-colors:active){:host{border-color:InactiveBorder}:host(${checkedState}),:host(${checkedState}:active),:host(${checkedState}:hover){background:Highlight;border-color:Highlight}.checked-indicator,:host(:hover) .checked-indicator,:host(:active) .checked-indicator{background-color:
|
|
12191
|
+
const styles$9 = css`${display("inline-flex")} :host{box-sizing:border-box;align-items:center;flex-direction:row;outline:none;user-select:none;contain:content;padding:0 ${spacingHorizontalXXS};width:40px;height:20px;background-color:${colorTransparentBackground};border:1px solid ${colorNeutralStrokeAccessible};border-radius:${borderRadiusCircular}}:host(:enabled){cursor:pointer}:host(:hover){background:none;border-color:${colorNeutralStrokeAccessibleHover}}:host(:active){border-color:${colorNeutralStrokeAccessiblePressed}}:host(${nativeDisabledState}),:host([readonly]){border:1px solid ${colorNeutralStrokeDisabled};background-color:none;pointer:default}:host(${checkedState}){background:${colorCompoundBrandBackground};border-color:${colorCompoundBrandBackground}}:host(${checkedState}:hover){background:${colorCompoundBrandBackgroundHover};border-color:${colorCompoundBrandBackgroundHover}}:host(${checkedState}:active){background:${colorCompoundBrandBackgroundPressed};border-color:${colorCompoundBrandBackgroundPressed}}:host(${checkedState}${nativeDisabledState}){background:${colorNeutralBackgroundDisabled};border-color:${colorNeutralStrokeDisabled}}.checked-indicator{height:14px;width:14px;border-radius:50%;margin-inline-start:0;background-color:${colorNeutralForeground3};transition-duration:${durationNormal};transition-timing-function:${curveEasyEase};transition-property:margin-inline-start}:host(${checkedState}) .checked-indicator{background-color:${colorNeutralForegroundInverted};margin-inline-start:calc(100% - 14px)}:host(${checkedState}:hover) .checked-indicator{background:${colorNeutralForegroundInvertedHover}}:host(${checkedState}:active) .checked-indicator{background:${colorNeutralForegroundInvertedPressed}}:host(:hover) .checked-indicator{background-color:${colorNeutralForeground3Hover}}:host(:active) .checked-indicator{background-color:${colorNeutralForeground3Pressed}}:host(${nativeDisabledState}) .checked-indicator,:host([readonly]) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(${checkedState}${nativeDisabledState}) .checked-indicator{background:${colorNeutralForegroundDisabled}}:host(:focus-visible){outline:none}:host(:not([slot='input']):focus-visible){border-color:${colorTransparentStroke};outline:${strokeWidthThick} solid ${colorTransparentStroke};outline-offset:1px;box-shadow:${shadow4},0 0 0 2px ${colorStrokeFocus2}}@media (forced-colors:active){:host{border-color:InactiveBorder}:host(${checkedState}),:host(${checkedState}:active),:host(${checkedState}:hover){background:Highlight;border-color:Highlight}.checked-indicator,:host(:hover) .checked-indicator,:host(:active) .checked-indicator{background-color:CanvasText}:host(${checkedState}) .checked-indicator,:host(${checkedState}:hover) .checked-indicator,:host(${checkedState}:active) .checked-indicator{background-color:HighlightText}:host(${nativeDisabledState}) .checked-indicator,:host(${checkedState}${nativeDisabledState}) .checked-indicator{background-color:GrayText}}`;
|
|
12164
12192
|
|
|
12165
12193
|
function switchTemplate(options = {}) {
|
|
12166
12194
|
return html`<template @click=${(x, c) => x.clickHandler(c.event)} @input=${(x, c) => x.inputHandler(c.event)} @keydown=${(x, c) => x.keydownHandler(c.event)} @keyup=${(x, c) => x.keyupHandler(c.event)}><slot name=switch>${staticallyCompose(options.switch)}</slot></template>`;
|
|
@@ -13089,6 +13117,18 @@ class BaseTextInput extends FASTElement {
|
|
|
13089
13117
|
* @internal
|
|
13090
13118
|
*/
|
|
13091
13119
|
this.dirtyValue = false;
|
|
13120
|
+
/**
|
|
13121
|
+
* The value as of the last `change` event or programmatic update.
|
|
13122
|
+
*
|
|
13123
|
+
* @internal
|
|
13124
|
+
*/
|
|
13125
|
+
this.committedValue = "";
|
|
13126
|
+
/**
|
|
13127
|
+
* Indicates that `value` is being updated from the internal control's `input` event.
|
|
13128
|
+
*
|
|
13129
|
+
* @internal
|
|
13130
|
+
*/
|
|
13131
|
+
this.isUserInput = false;
|
|
13092
13132
|
/**
|
|
13093
13133
|
* The internal {@link https://developer.mozilla.org/docs/Web/API/ElementInternals | `ElementInternals`} instance for the component.
|
|
13094
13134
|
*
|
|
@@ -13199,6 +13239,9 @@ class BaseTextInput extends FASTElement {
|
|
|
13199
13239
|
}
|
|
13200
13240
|
set value(value) {
|
|
13201
13241
|
this.currentValue = value;
|
|
13242
|
+
if (!this.isUserInput) {
|
|
13243
|
+
this.committedValue = value ?? "";
|
|
13244
|
+
}
|
|
13202
13245
|
if (this.elementInternals && this.control) {
|
|
13203
13246
|
this.control.value = value ?? "";
|
|
13204
13247
|
this.setFormValue(value);
|
|
@@ -13235,12 +13278,23 @@ class BaseTextInput extends FASTElement {
|
|
|
13235
13278
|
* proxies the change event, emitting a `change` event whenever the internal control emits a `change` event.
|
|
13236
13279
|
*/
|
|
13237
13280
|
changeHandler(e) {
|
|
13281
|
+
if (this.control.value !== this.committedValue) {
|
|
13282
|
+
this.emitChange(e);
|
|
13283
|
+
}
|
|
13284
|
+
return true;
|
|
13285
|
+
}
|
|
13286
|
+
/**
|
|
13287
|
+
* Validates, records the committed value, and emits `change` on the host.
|
|
13288
|
+
*
|
|
13289
|
+
* @internal
|
|
13290
|
+
*/
|
|
13291
|
+
emitChange(detail) {
|
|
13292
|
+
this.committedValue = this.control.value;
|
|
13238
13293
|
this.setValidity();
|
|
13239
|
-
this.$emit("change",
|
|
13294
|
+
this.$emit("change", detail, {
|
|
13240
13295
|
bubbles: true,
|
|
13241
13296
|
composed: true
|
|
13242
13297
|
});
|
|
13243
|
-
return true;
|
|
13244
13298
|
}
|
|
13245
13299
|
/**
|
|
13246
13300
|
* Checks the validity of the element and returns the result.
|
|
@@ -13312,7 +13366,12 @@ class BaseTextInput extends FASTElement {
|
|
|
13312
13366
|
*/
|
|
13313
13367
|
inputHandler(e) {
|
|
13314
13368
|
this.dirtyValue = true;
|
|
13315
|
-
this.
|
|
13369
|
+
this.isUserInput = true;
|
|
13370
|
+
try {
|
|
13371
|
+
this.value = this.control.value;
|
|
13372
|
+
} finally {
|
|
13373
|
+
this.isUserInput = false;
|
|
13374
|
+
}
|
|
13316
13375
|
return true;
|
|
13317
13376
|
}
|
|
13318
13377
|
/**
|
|
@@ -13322,9 +13381,19 @@ class BaseTextInput extends FASTElement {
|
|
|
13322
13381
|
* @internal
|
|
13323
13382
|
*/
|
|
13324
13383
|
keydownHandler(e) {
|
|
13325
|
-
if (e.key
|
|
13326
|
-
|
|
13384
|
+
if (e.key !== "Enter") {
|
|
13385
|
+
return true;
|
|
13327
13386
|
}
|
|
13387
|
+
if (e.isComposing || e.keyCode === 229) {
|
|
13388
|
+
return true;
|
|
13389
|
+
}
|
|
13390
|
+
if (e.composedPath()[0] !== this.control) {
|
|
13391
|
+
return true;
|
|
13392
|
+
}
|
|
13393
|
+
if (this.control.value !== this.committedValue) {
|
|
13394
|
+
this.emitChange();
|
|
13395
|
+
}
|
|
13396
|
+
this.implicitSubmit();
|
|
13328
13397
|
return true;
|
|
13329
13398
|
}
|
|
13330
13399
|
/**
|
|
@@ -13637,23 +13706,9 @@ __decorateClass$5([
|
|
|
13637
13706
|
|
|
13638
13707
|
ToggleButton.define(definition$3);
|
|
13639
13708
|
|
|
13640
|
-
const TooltipPositioningOption = {
|
|
13641
|
-
"above-start": "block-start span-inline-end",
|
|
13642
|
-
above: "block-start",
|
|
13643
|
-
"above-end": "block-start span-inline-start",
|
|
13644
|
-
"below-start": "block-end span-inline-end",
|
|
13645
|
-
below: "block-end",
|
|
13646
|
-
"below-end": "block-end span-inline-start",
|
|
13647
|
-
"before-top": "inline-start span-block-end",
|
|
13648
|
-
before: "inline-start",
|
|
13649
|
-
"before-bottom": "inline-start span-block-start",
|
|
13650
|
-
"after-top": "inline-end span-block-end",
|
|
13651
|
-
after: "inline-end",
|
|
13652
|
-
"after-bottom": "inline-end span-block-start"
|
|
13653
|
-
};
|
|
13654
13709
|
const tagName$2 = `${FluentDesignSystem.prefix}-tooltip`;
|
|
13655
13710
|
|
|
13656
|
-
const styles$2 = css`${display("inline-flex")} :host(:not(:popover-open)){display:none}:host{--position-area:block-start;--position-try-options:flip-block;--block-offset:${spacingVerticalXS};--inline-offset:${spacingHorizontalXS};background:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:1px solid ${colorTransparentStroke};box-sizing:border-box;color:${colorNeutralForeground1};display:inline-flex;filter:drop-shadow(0 0 2px ${colorNeutralShadowAmbient}) drop-shadow(0 4px 8px ${colorNeutralShadowKey});font-family:${fontFamilyBase};font-size:${fontSizeBase200};inset:unset;line-height:${lineHeightBase200};margin:unset;max-width:240px;overflow:visible;padding:4px ${spacingHorizontalMNudge} 6px;position:absolute;position-area:var(--position-area);position-try-fallbacks:var(--position-try-options);width:auto;z-index:1}@supports (inset-area:block-start){:host{inset-area:var(--position-area);position-try-fallbacks:var(--position-try-options)}}:host(:is([positioning^='above'],[positioning^='below'],:not([positioning]))){margin-block:var(--block-offset)}:host(:is([positioning^='before'],[positioning^='after'])){margin-inline:var(--inline-offset);--position-try-options:flip-inline}:host([positioning='above-start']){--position-area
|
|
13711
|
+
const styles$2 = css`${display("inline-flex")} :host(:not(:popover-open)){display:none}:host{--position-area:block-start;--position-try-options:flip-block;--block-offset:${spacingVerticalXS};--inline-offset:${spacingHorizontalXS};background:${colorNeutralBackground1};border-radius:${borderRadiusMedium};border:1px solid ${colorTransparentStroke};box-sizing:border-box;color:${colorNeutralForeground1};display:inline-flex;filter:drop-shadow(0 0 2px ${colorNeutralShadowAmbient}) drop-shadow(0 4px 8px ${colorNeutralShadowKey});font-family:${fontFamilyBase};font-size:${fontSizeBase200};inset:unset;line-height:${lineHeightBase200};margin:unset;max-width:240px;overflow:visible;padding:4px ${spacingHorizontalMNudge} 6px;position:absolute;position-area:var(--position-area);position-try-fallbacks:var(--position-try-options);width:auto;z-index:1}@supports (inset-area:block-start){:host{inset-area:var(--position-area);position-try-fallbacks:var(--position-try-options)}}:host(:is([positioning^='above'],[positioning^='below'],:not([positioning]))){margin-block:var(--block-offset)}:host(:is([positioning^='before'],[positioning^='after'])){margin-inline:var(--inline-offset);--position-try-options:flip-inline}:host([positioning='above-start']){--position-area:block-start span-inline-end}:host([positioning='above']){--position-area:block-start}:host([positioning='above-end']){--position-area:block-start span-inline-start}:host([positioning='below-start']){--position-area:block-end span-inline-end}:host([positioning='below']){--position-area:block-end}:host([positioning='below-end']){--position-area:block-end span-inline-start}:host([positioning='before-top']){--position-area:inline-start span-block-end}:host([positioning='before']){--position-area:inline-start}:host([positioning='before-bottom']){--position-area:inline-start span-block-start}:host([positioning='after-top']){--position-area:inline-end span-block-end}:host([positioning='after']){--position-area:inline-end}:host([positioning='after-bottom']){--position-area:inline-end span-block-start}`;
|
|
13657
13712
|
|
|
13658
13713
|
const template$2 = html`<template popover aria-hidden=true><slot></slot></template>`;
|
|
13659
13714
|
|