@material/web 1.5.1-nightly.dc2ba2a.0 → 1.5.1
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/README.md +3 -0
- package/button/internal/button.d.ts +1 -1
- package/button/internal/button.js +5 -2
- package/button/internal/button.js.map +1 -1
- package/checkbox/internal/_checkbox.scss +1 -1
- package/dialog/internal/_dialog.scss +1 -0
- package/dialog/internal/dialog-styles.css +1 -1
- package/dialog/internal/dialog-styles.css.map +1 -1
- package/dialog/internal/dialog-styles.js +1 -1
- package/dialog/internal/dialog-styles.js.map +1 -1
- package/iconbutton/internal/icon-button.d.ts +1 -1
- package/iconbutton/internal/icon-button.js +1 -1
- package/iconbutton/internal/icon-button.js.map +1 -1
- package/menu/internal/menu.js +3 -5
- package/menu/internal/menu.js.map +1 -1
- package/package.json +4 -4
- package/select/internal/select.d.ts +1 -1
- package/select/internal/select.js +1 -1
- package/select/internal/select.js.map +1 -1
- package/switch/internal/switch.js +22 -6
- package/switch/internal/switch.js.map +1 -1
package/README.md
CHANGED
|
@@ -17,6 +17,9 @@ that helps build beautiful and accessible web applications. It uses
|
|
|
17
17
|
[Material 3](https://m3.material.io/)<!-- {.external} -->, the latest version of Google's
|
|
18
18
|
open-source design system.
|
|
19
19
|
|
|
20
|
+
**Note:
|
|
21
|
+
[MWC is in maintenance mode pending new maintainers](https://github.com/material-components/material-web/discussions/5642).**
|
|
22
|
+
|
|
20
23
|
## Resources
|
|
21
24
|
|
|
22
25
|
- [Introduction](./docs/intro.md)
|
|
@@ -41,7 +41,7 @@ export declare abstract class Button extends buttonBaseClass implements FormSubm
|
|
|
41
41
|
*/
|
|
42
42
|
hasIcon: boolean;
|
|
43
43
|
/**
|
|
44
|
-
* The default behavior of the button. May be "
|
|
44
|
+
* The default behavior of the button. May be "button", "reset", or "submit"
|
|
45
45
|
* (default).
|
|
46
46
|
*/
|
|
47
47
|
type: FormSubmitterType;
|
|
@@ -57,7 +57,7 @@ export class Button extends buttonBaseClass {
|
|
|
57
57
|
*/
|
|
58
58
|
this.hasIcon = false;
|
|
59
59
|
/**
|
|
60
|
-
* The default behavior of the button. May be "
|
|
60
|
+
* The default behavior of the button. May be "button", "reset", or "submit"
|
|
61
61
|
* (default).
|
|
62
62
|
*/
|
|
63
63
|
this.type = 'submit';
|
|
@@ -94,7 +94,10 @@ export class Button extends buttonBaseClass {
|
|
|
94
94
|
${this.renderElevationOrOutline?.()}
|
|
95
95
|
<div class="background"></div>
|
|
96
96
|
<md-focus-ring part="focus-ring" for=${buttonId}></md-focus-ring>
|
|
97
|
-
<md-ripple
|
|
97
|
+
<md-ripple
|
|
98
|
+
part="ripple"
|
|
99
|
+
for=${buttonId}
|
|
100
|
+
?disabled="${isDisabled}"></md-ripple>
|
|
98
101
|
${buttonOrLink}
|
|
99
102
|
`;
|
|
100
103
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAGzE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAEL,kBAAkB,GAEnB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,SAAS,EACT,qBAAqB,GACtB,MAAM,2CAA2C,CAAC;AAEnD,wCAAwC;AACxC,MAAM,eAAe,GAAG,qBAAqB,CAAC,UAAU,CAAC,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAgB,MAAO,SAAQ,eAAe;IA0DlD,IA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\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement, nothing} from 'lit';\nimport {property, query, queryAssignedElements} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n FormSubmitter,\n setupFormSubmitter,\n type FormSubmitterType,\n} from '../../internal/controller/form-submitter.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '../../internal/events/form-label-activation.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../labs/behaviors/element-internals.js';\n\n// Separate variable needed for closure.\nconst buttonBaseClass = mixinElementInternals(LitElement);\n\n/**\n * A button component.\n */\nexport abstract class Button extends buttonBaseClass implements FormSubmitter {\n static {\n requestUpdateOnAriaChange(Button);\n setupFormSubmitter(Button);\n }\n\n /** @nocollapse */\n static readonly formAssociated = true;\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Whether or not the button is disabled.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * The URL that the link button points to.\n */\n @property() href = '';\n\n /**\n * Where to display the linked `href` URL for a link button. Common options\n * include `_blank` to open in a new tab.\n */\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n\n /**\n * Whether to render the icon at the inline end of the label rather than the\n * inline start.\n *\n * _Note:_ Link buttons cannot have trailing icons.\n */\n @property({type: Boolean, attribute: 'trailing-icon', reflect: true})\n trailingIcon = false;\n\n /**\n * Whether to display the icon or not.\n */\n @property({type: Boolean, attribute: 'has-icon', reflect: true}) hasIcon =\n false;\n\n /**\n * The default behavior of the button. May be \"button\", \"reset\", or \"submit\"\n * (default).\n */\n @property() type: FormSubmitterType = 'submit';\n\n /**\n * The value added to a form with the button's name when the button submits a\n * form.\n */\n @property({reflect: true}) value = '';\n\n get name() {\n return this.getAttribute('name') ?? '';\n }\n set name(name: string) {\n this.setAttribute('name', name);\n }\n\n /**\n * The associated form element with which this element's value will submit.\n */\n get form() {\n return this[internals].form;\n }\n\n @query('.button') private readonly buttonElement!: HTMLElement | null;\n\n @queryAssignedElements({slot: 'icon', flatten: true})\n private readonly assignedIcons!: HTMLElement[];\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', this.handleActivationClick);\n }\n }\n\n override focus() {\n this.buttonElement?.focus();\n }\n\n override blur() {\n this.buttonElement?.blur();\n }\n\n protected override render() {\n // Link buttons may not be disabled\n const isDisabled = this.disabled && !this.href;\n const buttonOrLink = this.href ? this.renderLink() : this.renderButton();\n // TODO(b/310046938): due to a limitation in focus ring/ripple, we can't use\n // the same ID for different elements, so we change the ID instead.\n const buttonId = this.href ? 'link' : 'button';\n return html`\n ${this.renderElevationOrOutline?.()}\n <div class=\"background\"></div>\n <md-focus-ring part=\"focus-ring\" for=${buttonId}></md-focus-ring>\n <md-ripple\n part=\"ripple\"\n for=${buttonId}\n ?disabled=\"${isDisabled}\"></md-ripple>\n ${buttonOrLink}\n `;\n }\n\n // Buttons can override this to add elevation or an outline. Use this and\n // return `<md-elevation>` (for elevated, filled, and tonal buttons)\n // or `<div class=\"outline\">` (for outlined buttons).\n // Text buttons that have neither do not need to implement this.\n protected renderElevationOrOutline?(): unknown;\n\n private renderButton() {\n // Needed for closure conformance\n const {ariaLabel, ariaHasPopup, ariaExpanded} = this as ARIAMixinStrict;\n return html`<button\n id=\"button\"\n class=\"button\"\n ?disabled=${this.disabled}\n aria-label=\"${ariaLabel || nothing}\"\n aria-haspopup=\"${ariaHasPopup || nothing}\"\n aria-expanded=\"${ariaExpanded || nothing}\">\n ${this.renderContent()}\n </button>`;\n }\n\n private renderLink() {\n // Needed for closure conformance\n const {ariaLabel, ariaHasPopup, ariaExpanded} = this as ARIAMixinStrict;\n return html`<a\n id=\"link\"\n class=\"button\"\n aria-label=\"${ariaLabel || nothing}\"\n aria-haspopup=\"${ariaHasPopup || nothing}\"\n aria-expanded=\"${ariaExpanded || nothing}\"\n href=${this.href}\n target=${this.target || nothing}\n >${this.renderContent()}\n </a>`;\n }\n\n private renderContent() {\n const icon = html`<slot\n name=\"icon\"\n @slotchange=\"${this.handleSlotChange}\"></slot>`;\n\n return html`\n <span class=\"touch\"></span>\n ${this.trailingIcon ? nothing : icon}\n <span class=\"label\"><slot></slot></span>\n ${this.trailingIcon ? icon : nothing}\n `;\n }\n\n private readonly handleActivationClick = (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.buttonElement) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.buttonElement);\n };\n\n private handleSlotChange() {\n this.hasIcon = this.assignedIcons.length > 0;\n }\n}\n"]}
|
|
@@ -25,7 +25,7 @@ $_indeterminate-bottom-left: 4px, -10px;
|
|
|
25
25
|
$_checkmark-bottom-left: 7px, -14px;
|
|
26
26
|
|
|
27
27
|
@mixin theme($tokens) {
|
|
28
|
-
$supported-tokens:
|
|
28
|
+
$supported-tokens: tokens.$md-comp-checkbox-supported-tokens;
|
|
29
29
|
@each $token, $value in $tokens {
|
|
30
30
|
@if list.index($supported-tokens, $token) == null {
|
|
31
31
|
@error 'Token `#{$token}` is not a supported token.';
|
|
@@ -183,6 +183,7 @@
|
|
|
183
183
|
font-family: map.get($tokens, 'supporting-text-font');
|
|
184
184
|
font-size: map.get($tokens, 'supporting-text-size');
|
|
185
185
|
line-height: map.get($tokens, 'supporting-text-line-height');
|
|
186
|
+
flex: 1;
|
|
186
187
|
font-weight: map.get($tokens, 'supporting-text-weight');
|
|
187
188
|
height: min-content; // Needed for Safari
|
|
188
189
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}/*# sourceMappingURL=dialog-styles.css.map */
|
|
1
|
+
:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));flex:1;font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}/*# sourceMappingURL=dialog-styles.css.map */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sourceRoot":"","sources":["_dialog.scss"],"names":[],"mappings":"AAiCE,MACE,uJACA,mJACA,+IACA,mJACA,iBACA,YACA,kCACA,iCACA,iBACA,gBACA,eACA,mBACA,kBAGF,OACE,yBACA,YACA,sBACA,sBACA,eACA,eACA,mBACA,kBACA,mBACA,kBACA,aACA,iBACA,UACA,cAGF,aACE,aAGF,WAEE,gBAGF,OACE,2CACA,aACA,QACA,YACA,oBACA,eACA,UAGF,qBACE,aAGF,GACE,UACA,mBAGF,UACE,mBACA,+EACA,aACA,sBACA,8HACA,8FACA,4GACA,wIACA,kBAGF,gCACE,mBACA,mBACA,sBACA,aACA,QACA,oBAGF,MACE,aAGF,4BACE,0EACA,kBACA,2CACA,gBACA,wCACA,uCAGF,0CACE,uBACA,iBAGF,4CACE,oBAGF,wDACE,gBAGF,WACE,sBACA,aACA,sBAGA,YACA,gBACA,kBACA,qBAGF,mBACE,iGACA,sBACA,WACA,QACA,kBAGF,UACE,aACA,OACA,sBACA,gBAIA,UAGF,sBAKE,kBAGF,SACE,8FACA,kIACA,oGACA,mHACA,4IACA,mBACA,kBAGF,+BACE,sBACA,aAKF,QACE,kBAGF,YACE,MAGF,eACE,SAGF,SACE,kBAGF,+BACE,sBACA,aACA,QACA,yBACA,uBAGF,4CACE,mBAGF,WACE,aACA,kBAGF,yGAEE,aAGF,qBACE,SAGF,oBACE,MAGF,8BACE,OACE","file":"dialog-styles.css"}
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["_dialog.scss"],"names":[],"mappings":"AAiCE,MACE,uJACA,mJACA,+IACA,mJACA,iBACA,YACA,kCACA,iCACA,iBACA,gBACA,eACA,mBACA,kBAGF,OACE,yBACA,YACA,sBACA,sBACA,eACA,eACA,mBACA,kBACA,mBACA,kBACA,aACA,iBACA,UACA,cAGF,aACE,aAGF,WAEE,gBAGF,OACE,2CACA,aACA,QACA,YACA,oBACA,eACA,UAGF,qBACE,aAGF,GACE,UACA,mBAGF,UACE,mBACA,+EACA,aACA,sBACA,8HACA,8FACA,4GACA,wIACA,kBAGF,gCACE,mBACA,mBACA,sBACA,aACA,QACA,oBAGF,MACE,aAGF,4BACE,0EACA,kBACA,2CACA,gBACA,wCACA,uCAGF,0CACE,uBACA,iBAGF,4CACE,oBAGF,wDACE,gBAGF,WACE,sBACA,aACA,sBAGA,YACA,gBACA,kBACA,qBAGF,mBACE,iGACA,sBACA,WACA,QACA,kBAGF,UACE,aACA,OACA,sBACA,gBAIA,UAGF,sBAKE,kBAGF,SACE,8FACA,kIACA,oGACA,mHACA,OACA,4IACA,mBACA,kBAGF,+BACE,sBACA,aAKF,QACE,kBAGF,YACE,MAGF,eACE,SAGF,SACE,kBAGF,+BACE,sBACA,aACA,QACA,yBACA,uBAGF,4CACE,mBAGF,WACE,aACA,kBAGF,yGAEE,aAGF,qBACE,SAGF,oBACE,MAGF,8BACE,OACE","file":"dialog-styles.css"}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
// Generated stylesheet for ./dialog/internal/dialog-styles.css.
|
|
7
7
|
import { css } from 'lit';
|
|
8
|
-
export const styles = css `:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}
|
|
8
|
+
export const styles = css `:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:"";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));flex:1;font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}
|
|
9
9
|
`;
|
|
10
10
|
//# sourceMappingURL=dialog-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog-styles.js","sourceRoot":"","sources":["dialog-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,gEAAgE;AAChE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./dialog/internal/dialog-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:\"\";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}\n`;\n"]}
|
|
1
|
+
{"version":3,"file":"dialog-styles.js","sourceRoot":"","sources":["dialog-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,gEAAgE;AAChE,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACxB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2024 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n// Generated stylesheet for ./dialog/internal/dialog-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{border-start-start-radius:var(--md-dialog-container-shape-start-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-start-end-radius:var(--md-dialog-container-shape-start-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-end-radius:var(--md-dialog-container-shape-end-end, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));border-end-start-radius:var(--md-dialog-container-shape-end-start, var(--md-dialog-container-shape, var(--md-sys-shape-corner-extra-large, 28px)));display:contents;margin:auto;max-height:min(560px,100% - 48px);max-width:min(560px,100% - 48px);min-height:140px;min-width:280px;position:fixed;height:fit-content;width:fit-content}dialog{background:rgba(0,0,0,0);border:none;border-radius:inherit;flex-direction:column;height:inherit;margin:inherit;max-height:inherit;max-width:inherit;min-height:inherit;min-width:inherit;outline:none;overflow:visible;padding:0;width:inherit}dialog[open]{display:flex}::backdrop{background:none}.scrim{background:var(--md-sys-color-scrim, #000);display:none;inset:0;opacity:32%;pointer-events:none;position:fixed;z-index:1}:host([open]) .scrim{display:flex}h2{all:unset;align-self:stretch}.headline{align-items:center;color:var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));display:flex;flex-direction:column;font-family:var(--md-dialog-headline-font, var(--md-sys-typescale-headline-small-font, var(--md-ref-typeface-brand, Roboto)));font-size:var(--md-dialog-headline-size, var(--md-sys-typescale-headline-small-size, 1.5rem));line-height:var(--md-dialog-headline-line-height, var(--md-sys-typescale-headline-small-line-height, 2rem));font-weight:var(--md-dialog-headline-weight, var(--md-sys-typescale-headline-small-weight, var(--md-ref-typeface-weight-regular, 400)));position:relative}slot[name=headline]::slotted(*){align-items:center;align-self:stretch;box-sizing:border-box;display:flex;gap:8px;padding:24px 24px 0}.icon{display:flex}slot[name=icon]::slotted(*){color:var(--md-dialog-icon-color, var(--md-sys-color-secondary, #625b71));fill:currentColor;font-size:var(--md-dialog-icon-size, 24px);margin-top:24px;height:var(--md-dialog-icon-size, 24px);width:var(--md-dialog-icon-size, 24px)}.has-icon slot[name=headline]::slotted(*){justify-content:center;padding-top:16px}.scrollable slot[name=headline]::slotted(*){padding-bottom:16px}.scrollable.has-headline slot[name=content]::slotted(*){padding-top:8px}.container{border-radius:inherit;display:flex;flex-direction:column;flex-grow:1;overflow:hidden;position:relative;transform-origin:top}.container::before{background:var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));border-radius:inherit;content:\"\";inset:0;position:absolute}.scroller{display:flex;flex:1;flex-direction:column;overflow:hidden;z-index:1}.scrollable .scroller{overflow-y:scroll}.content{color:var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));font-family:var(--md-dialog-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));font-size:var(--md-dialog-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));line-height:var(--md-dialog-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));flex:1;font-weight:var(--md-dialog-supporting-text-weight, var(--md-sys-typescale-body-medium-weight, var(--md-ref-typeface-weight-regular, 400)));height:min-content;position:relative}slot[name=content]::slotted(*){box-sizing:border-box;padding:24px}.anchor{position:absolute}.top.anchor{top:0}.bottom.anchor{bottom:0}.actions{position:relative}slot[name=actions]::slotted(*){box-sizing:border-box;display:flex;gap:8px;justify-content:flex-end;padding:16px 24px 24px}.has-actions slot[name=content]::slotted(*){padding-bottom:8px}md-divider{display:none;position:absolute}.has-headline.show-top-divider .headline md-divider,.has-actions.show-bottom-divider .actions md-divider{display:flex}.headline md-divider{bottom:0}.actions md-divider{top:0}@media(forced-colors: active){dialog{outline:2px solid WindowText}}\n`;\n"]}
|
|
@@ -53,7 +53,7 @@ export declare class IconButton extends iconButtonBaseClass implements FormSubmi
|
|
|
53
53
|
*/
|
|
54
54
|
selected: boolean;
|
|
55
55
|
/**
|
|
56
|
-
* The default behavior of the button. May be "
|
|
56
|
+
* The default behavior of the button. May be "button", "reset", or "submit"
|
|
57
57
|
* (default).
|
|
58
58
|
*/
|
|
59
59
|
type: FormSubmitterType;
|
|
@@ -58,7 +58,7 @@ export class IconButton extends iconButtonBaseClass {
|
|
|
58
58
|
*/
|
|
59
59
|
this.selected = false;
|
|
60
60
|
/**
|
|
61
|
-
* The default behavior of the button. May be "
|
|
61
|
+
* The default behavior of the button. May be "button", "reset", or "submit"
|
|
62
62
|
* (default).
|
|
63
63
|
*/
|
|
64
64
|
this.type = 'submit';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-button.js","sourceRoot":"","sources":["icon-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,OAAO,EAAE,IAAI,IAAI,UAAU,EAAC,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAEL,kBAAkB,GAEnB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAC,KAAK,EAAC,MAAM,qCAAqC,CAAC;AAC1D,OAAO,E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,EAAE;wCAAoC;AAMpB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAY;AAuBrB;IAAhB,KAAK,EAAE;4CAAoD","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, LitElement, nothing} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {literal, html as staticHtml} from 'lit/static-html.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n FormSubmitter,\n setupFormSubmitter,\n type FormSubmitterType,\n} from '../../internal/controller/form-submitter.js';\nimport {isRtl} from '../../internal/controller/is-rtl.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../labs/behaviors/element-internals.js';\n\ntype LinkTarget = '_blank' | '_parent' | '_self' | '_top';\n\n// Separate variable needed for closure.\nconst iconButtonBaseClass = mixinElementInternals(LitElement);\n\n/**\n * A button for rendering icons.\n *\n * @fires input {InputEvent} Dispatched when a toggle button toggles --bubbles\n * --composed\n * @fires change {Event} Dispatched when a toggle button toggles --bubbles\n */\nexport class IconButton extends iconButtonBaseClass implements FormSubmitter {\n static {\n requestUpdateOnAriaChange(IconButton);\n setupFormSubmitter(IconButton);\n }\n\n /** @nocollapse */\n static readonly formAssociated = true;\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Disables the icon button and makes it non-interactive.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * Flips the icon if it is in an RTL context at startup.\n */\n @property({type: Boolean, attribute: 'flip-icon-in-rtl'})\n flipIconInRtl = false;\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.\n */\n @property() href = '';\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `target` attribute.\n */\n @property() target: LinkTarget | '' = '';\n\n /**\n * The `aria-label` of the button when the button is toggleable and selected.\n */\n @property({attribute: 'aria-label-selected'}) ariaLabelSelected = '';\n\n /**\n * When true, the button will toggle between selected and unselected\n * states\n */\n @property({type: Boolean}) toggle = false;\n\n /**\n * Sets the selected state. When false, displays the default icon. When true,\n * displays the selected icon, or the default icon If no `slot=\"selected\"`\n * icon is provided.\n */\n @property({type: Boolean, reflect: true}) selected = false;\n\n /**\n * The default behavior of the button. May be \"text\", \"reset\", or \"submit\"\n * (default).\n */\n @property() type: FormSubmitterType = 'submit';\n\n /**\n * The value added to a form with the button's name when the button submits a\n * form.\n */\n @property({reflect: true}) value = '';\n\n get name() {\n return this.getAttribute('name') ?? '';\n }\n set name(name: string) {\n this.setAttribute('name', name);\n }\n\n /**\n * The associated form element with which this element's value will submit.\n */\n get form() {\n return this[internals].form;\n }\n\n /**\n * The labels this element is associated with.\n */\n get labels() {\n return this[internals].labels;\n }\n\n @state() private flipIcon = isRtl(this, this.flipIconInRtl);\n\n /**\n * Link buttons cannot be disabled.\n */\n protected override willUpdate() {\n if (this.href) {\n this.disabled = false;\n }\n }\n\n protected override render() {\n const tag = this.href ? literal`div` : literal`button`;\n // Needed for closure conformance\n const {ariaLabel, ariaHasPopup, ariaExpanded} = this as ARIAMixinStrict;\n const hasToggledAriaLabel = ariaLabel && this.ariaLabelSelected;\n const ariaPressedValue = !this.toggle ? nothing : this.selected;\n let ariaLabelValue: string | null | typeof nothing = nothing;\n if (!this.href) {\n ariaLabelValue =\n hasToggledAriaLabel && this.selected\n ? this.ariaLabelSelected\n : ariaLabel;\n }\n return staticHtml`<${tag}\n class=\"icon-button ${classMap(this.getRenderClasses())}\"\n id=\"button\"\n aria-label=\"${ariaLabelValue || nothing}\"\n aria-haspopup=\"${(!this.href && ariaHasPopup) || nothing}\"\n aria-expanded=\"${(!this.href && ariaExpanded) || nothing}\"\n aria-pressed=\"${ariaPressedValue}\"\n ?disabled=\"${!this.href && this.disabled}\"\n @click=\"${this.handleClick}\">\n ${this.renderFocusRing()}\n ${this.renderRipple()}\n ${!this.selected ? this.renderIcon() : nothing}\n ${this.selected ? this.renderSelectedIcon() : nothing}\n ${this.renderTouchTarget()}\n ${this.href && this.renderLink()}\n </${tag}>`;\n }\n\n private renderLink() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <a\n class=\"link\"\n id=\"link\"\n href=\"${this.href}\"\n target=\"${this.target || nothing}\"\n aria-label=\"${ariaLabel || nothing}\"></a>\n `;\n }\n\n protected getRenderClasses() {\n return {\n 'flip-icon': this.flipIcon,\n 'selected': this.toggle && this.selected,\n };\n }\n\n private renderIcon() {\n return html`<span class=\"icon\"><slot></slot></span>`;\n }\n\n private renderSelectedIcon() {\n // Use default slot as fallback to not require specifying multiple icons\n return html`<span class=\"icon icon--selected\"\n ><slot name=\"selected\"><slot></slot></slot\n ></span>`;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"touch\"></span>`;\n }\n\n private renderFocusRing() {\n // TODO(b/310046938): use the same id for both elements\n return html`<md-focus-ring\n part=\"focus-ring\"\n for=${this.href ? 'link' : 'button'}></md-focus-ring>`;\n }\n\n private renderRipple() {\n // TODO(b/310046938): use the same id for both elements\n return html`<md-ripple\n for=${this.href ? 'link' : nothing}\n ?disabled=\"${!this.href && this.disabled}\"></md-ripple>`;\n }\n\n override connectedCallback() {\n this.flipIcon = isRtl(this, this.flipIconInRtl);\n super.connectedCallback();\n }\n\n private async handleClick(event: Event) {\n // Allow the event to propagate\n await 0;\n if (!this.toggle || this.disabled || event.defaultPrevented) {\n return;\n }\n\n this.selected = !this.selected;\n this.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n // Bubbles but does not compose to mimic native browser <input> & <select>\n // Additionally, native change event is not an InputEvent.\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"icon-button.js","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AAE,IAAI;CACrB,AAHgC,CAG/B;AAKwC;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAkB;AAM3D;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAC,CAAC;iDACnC;AAKV;IAAX,QAAQ,EAAE;wCAAW;AAKV;IAAX,QAAQ,EAAE;0CAA8B;AAKK;IAA7C,QAAQ,CAAC,EAAC,SAAS,EAAE,qBAAqB,EAAC,CAAC;qDAAwB;AAM1C;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;0CAAgB;AAOA;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAkB;AAM/C;IAAX,QAAQ,EAAE;wCAAoC;AAMpB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;yCAAY;AAuBrB;IAAhB,KAAK,EAAE;4CAAoD","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, LitElement, nothing} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {literal, html as staticHtml} from 'lit/static-html.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n FormSubmitter,\n setupFormSubmitter,\n type FormSubmitterType,\n} from '../../internal/controller/form-submitter.js';\nimport {isRtl} from '../../internal/controller/is-rtl.js';\nimport {\n internals,\n mixinElementInternals,\n} from '../../labs/behaviors/element-internals.js';\n\ntype LinkTarget = '_blank' | '_parent' | '_self' | '_top';\n\n// Separate variable needed for closure.\nconst iconButtonBaseClass = mixinElementInternals(LitElement);\n\n/**\n * A button for rendering icons.\n *\n * @fires input {InputEvent} Dispatched when a toggle button toggles --bubbles\n * --composed\n * @fires change {Event} Dispatched when a toggle button toggles --bubbles\n */\nexport class IconButton extends iconButtonBaseClass implements FormSubmitter {\n static {\n requestUpdateOnAriaChange(IconButton);\n setupFormSubmitter(IconButton);\n }\n\n /** @nocollapse */\n static readonly formAssociated = true;\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Disables the icon button and makes it non-interactive.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * Flips the icon if it is in an RTL context at startup.\n */\n @property({type: Boolean, attribute: 'flip-icon-in-rtl'})\n flipIconInRtl = false;\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.\n */\n @property() href = '';\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `target` attribute.\n */\n @property() target: LinkTarget | '' = '';\n\n /**\n * The `aria-label` of the button when the button is toggleable and selected.\n */\n @property({attribute: 'aria-label-selected'}) ariaLabelSelected = '';\n\n /**\n * When true, the button will toggle between selected and unselected\n * states\n */\n @property({type: Boolean}) toggle = false;\n\n /**\n * Sets the selected state. When false, displays the default icon. When true,\n * displays the selected icon, or the default icon If no `slot=\"selected\"`\n * icon is provided.\n */\n @property({type: Boolean, reflect: true}) selected = false;\n\n /**\n * The default behavior of the button. May be \"button\", \"reset\", or \"submit\"\n * (default).\n */\n @property() type: FormSubmitterType = 'submit';\n\n /**\n * The value added to a form with the button's name when the button submits a\n * form.\n */\n @property({reflect: true}) value = '';\n\n get name() {\n return this.getAttribute('name') ?? '';\n }\n set name(name: string) {\n this.setAttribute('name', name);\n }\n\n /**\n * The associated form element with which this element's value will submit.\n */\n get form() {\n return this[internals].form;\n }\n\n /**\n * The labels this element is associated with.\n */\n get labels() {\n return this[internals].labels;\n }\n\n @state() private flipIcon = isRtl(this, this.flipIconInRtl);\n\n /**\n * Link buttons cannot be disabled.\n */\n protected override willUpdate() {\n if (this.href) {\n this.disabled = false;\n }\n }\n\n protected override render() {\n const tag = this.href ? literal`div` : literal`button`;\n // Needed for closure conformance\n const {ariaLabel, ariaHasPopup, ariaExpanded} = this as ARIAMixinStrict;\n const hasToggledAriaLabel = ariaLabel && this.ariaLabelSelected;\n const ariaPressedValue = !this.toggle ? nothing : this.selected;\n let ariaLabelValue: string | null | typeof nothing = nothing;\n if (!this.href) {\n ariaLabelValue =\n hasToggledAriaLabel && this.selected\n ? this.ariaLabelSelected\n : ariaLabel;\n }\n return staticHtml`<${tag}\n class=\"icon-button ${classMap(this.getRenderClasses())}\"\n id=\"button\"\n aria-label=\"${ariaLabelValue || nothing}\"\n aria-haspopup=\"${(!this.href && ariaHasPopup) || nothing}\"\n aria-expanded=\"${(!this.href && ariaExpanded) || nothing}\"\n aria-pressed=\"${ariaPressedValue}\"\n ?disabled=\"${!this.href && this.disabled}\"\n @click=\"${this.handleClick}\">\n ${this.renderFocusRing()}\n ${this.renderRipple()}\n ${!this.selected ? this.renderIcon() : nothing}\n ${this.selected ? this.renderSelectedIcon() : nothing}\n ${this.renderTouchTarget()}\n ${this.href && this.renderLink()}\n </${tag}>`;\n }\n\n private renderLink() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <a\n class=\"link\"\n id=\"link\"\n href=\"${this.href}\"\n target=\"${this.target || nothing}\"\n aria-label=\"${ariaLabel || nothing}\"></a>\n `;\n }\n\n protected getRenderClasses() {\n return {\n 'flip-icon': this.flipIcon,\n 'selected': this.toggle && this.selected,\n };\n }\n\n private renderIcon() {\n return html`<span class=\"icon\"><slot></slot></span>`;\n }\n\n private renderSelectedIcon() {\n // Use default slot as fallback to not require specifying multiple icons\n return html`<span class=\"icon icon--selected\"\n ><slot name=\"selected\"><slot></slot></slot\n ></span>`;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"touch\"></span>`;\n }\n\n private renderFocusRing() {\n // TODO(b/310046938): use the same id for both elements\n return html`<md-focus-ring\n part=\"focus-ring\"\n for=${this.href ? 'link' : 'button'}></md-focus-ring>`;\n }\n\n private renderRipple() {\n // TODO(b/310046938): use the same id for both elements\n return html`<md-ripple\n for=${this.href ? 'link' : nothing}\n ?disabled=\"${!this.href && this.disabled}\"></md-ripple>`;\n }\n\n override connectedCallback() {\n this.flipIcon = isRtl(this, this.flipIconInRtl);\n super.connectedCallback();\n }\n\n private async handleClick(event: Event) {\n // Allow the event to propagate\n await 0;\n if (!this.toggle || this.disabled || event.defaultPrevented) {\n return;\n }\n\n this.selected = !this.selected;\n this.dispatchEvent(\n new InputEvent('input', {bubbles: true, composed: true}),\n );\n // Bubbles but does not compose to mimic native browser <input> & <select>\n // Additionally, native change event is not an InputEvent.\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n}\n"]}
|
package/menu/internal/menu.js
CHANGED
|
@@ -653,17 +653,15 @@ export class Menu extends LitElement {
|
|
|
653
653
|
*/
|
|
654
654
|
animateClose() {
|
|
655
655
|
let resolve;
|
|
656
|
-
let reject;
|
|
657
656
|
// This promise blocks the surface position controller from setting
|
|
658
657
|
// display: none on the surface which will interfere with this animation.
|
|
659
|
-
const animationEnded = new Promise((res
|
|
658
|
+
const animationEnded = new Promise((res) => {
|
|
660
659
|
resolve = res;
|
|
661
|
-
reject = rej;
|
|
662
660
|
});
|
|
663
661
|
const surfaceEl = this.surfaceEl;
|
|
664
662
|
const slotEl = this.slotEl;
|
|
665
663
|
if (!surfaceEl || !slotEl) {
|
|
666
|
-
|
|
664
|
+
resolve(false);
|
|
667
665
|
return animationEnded;
|
|
668
666
|
}
|
|
669
667
|
const openDirection = this.openDirection;
|
|
@@ -731,7 +729,7 @@ export class Menu extends LitElement {
|
|
|
731
729
|
animation.cancel();
|
|
732
730
|
child.classList.toggle('md-menu-hidden', false);
|
|
733
731
|
});
|
|
734
|
-
|
|
732
|
+
resolve(false);
|
|
735
733
|
});
|
|
736
734
|
surfaceHeightAnimation.addEventListener('finish', () => {
|
|
737
735
|
surfaceEl.classList.toggle('animating', false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,UAAU,EAAkB,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,MAAM,EAAE,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AACjF,OAAO,EACL,cAAc,EACd,aAAa,GACd,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,EAGL,UAAU,EACV,aAAa,EACb,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,MAAM,EACN,yBAAyB,GAE1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAC,MAAM,EAAC,MAAM,4CAA4C,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAEjD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS;IACrC,aAAa,CAAC,SAAS;IACvB,aAAa,CAAC,OAAO;IACrB,aAAa,CAAC,IAAI;IAClB,aAAa,CAAC,GAAG;CAClB,CAAC,CAAC;AAEH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS;IAClC,aAAa,CAAC,SAAS;IACvB,aAAa,CAAC,U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AQ9E;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAC,CAAC;oDACpC;AAQ/B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAC,CAAC;gDACnC;AAM3B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAC,CAAC;8CAClC;AASzB;IADC,QAAQ,CAAC,EAAC,SAAS,EAAE,eAAe,EAAC,CAAC;0CACU;AAQjD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAC,CAAC;8CAClC;AAEyB;IAAjD,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAAqC;AAC3D;IAAhB,KAAK,EAAE;6CAAgC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../elevation/elevation.js';\nimport '../../focus/md-focus-ring.js';\n\nimport {LitElement, PropertyValues, html, isServer, nothing} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\n\nimport {EASING, createAnimationSignal} from '../../internal/motion/animation.js';\nimport {\n ListController,\n NavigableKeys,\n} from '../../list/internal/list-controller.js';\nimport {\n getActiveItem,\n getFirstActivatableItem,\n getLastActivatableItem,\n} from '../../list/internal/list-navigation-helpers.js';\n\nimport {MenuItem} from './controllers/menuItemController.js';\nimport {\n ActivateTypeaheadEvent,\n DeactivateTypeaheadEvent,\n FocusState,\n isClosableKey,\n isElementInSubtree,\n} from './controllers/shared.js';\nimport {\n Corner,\n SurfacePositionController,\n SurfacePositionTarget,\n} from './controllers/surfacePositionController.js';\nimport {TypeaheadController} from './controllers/typeaheadController.js';\n\nexport {Corner} from './controllers/surfacePositionController.js';\n\n/**\n * The default value for the typeahead buffer time in Milliseconds.\n */\nexport const DEFAULT_TYPEAHEAD_BUFFER_TIME = 200;\n\nconst submenuNavKeys = new Set<string>([\n NavigableKeys.ArrowDown,\n NavigableKeys.ArrowUp,\n NavigableKeys.Home,\n NavigableKeys.End,\n]);\n\nconst menuNavKeys = new Set<string>([\n NavigableKeys.ArrowLeft,\n NavigableKeys.ArrowRight,\n ...submenuNavKeys,\n]);\n\n/**\n * Gets the currently focused element on the page.\n *\n * @param activeDoc The document or shadowroot from which to start the search.\n * Defaults to `window.document`\n * @return Returns the currently deeply focused element or `null` if none.\n */\nfunction getFocusedElement(\n activeDoc: Document | ShadowRoot = document,\n): HTMLElement | null {\n let activeEl = activeDoc.activeElement as HTMLElement | null;\n\n // Check for activeElement in the case that an element with a shadow root host\n // is currently focused.\n while (activeEl && activeEl?.shadowRoot?.activeElement) {\n activeEl = activeEl.shadowRoot.activeElement as HTMLElement | null;\n }\n\n return activeEl;\n}\n\n/**\n * @fires opening {Event} Fired before the opening animation begins\n * @fires opened {Event} Fired once the menu is open, after any animations\n * @fires closing {Event} Fired before the closing animation begins\n * @fires closed {Event} Fired once the menu is closed, after any animations\n */\nexport abstract class Menu extends LitElement {\n @query('.menu') private readonly surfaceEl!: HTMLElement | null;\n @query('slot') private readonly slotEl!: HTMLSlotElement | null;\n\n /**\n * The ID of the element in the same root node in which the menu should align\n * to. Overrides setting `anchorElement = elementReference`.\n *\n * __NOTE__: anchor or anchorElement must either be an HTMLElement or resolve\n * to an HTMLElement in order for menu to open.\n */\n @property() anchor = '';\n /**\n * Whether the positioning algorithm should calculate relative to the parent\n * of the anchor element (`absolute`), relative to the window (`fixed`), or\n * relative to the document (`document`). `popover` will use the popover API\n * to render the menu in the top-layer. If your browser does not support the\n * popover API, it will fall back to `fixed`.\n *\n * __Examples for `position = 'fixed'`:__\n *\n * - If there is no `position:relative` in the given parent tree and the\n * surface is `position:absolute`\n * - If the surface is `position:fixed`\n * - If the surface is in the \"top layer\"\n * - The anchor and the surface do not share a common `position:relative`\n * ancestor\n *\n * When using `positioning=fixed`, in most cases, the menu should position\n * itself above most other `position:absolute` or `position:fixed` elements\n * when placed inside of them. e.g. using a menu inside of an `md-dialog`.\n *\n * __NOTE__: Fixed menus will not scroll with the page and will be fixed to\n * the window instead.\n *\n * __Examples for `position = 'document'`:__\n *\n * - There is no parent that creates a relative positioning context e.g.\n * `position: relative`, `position: absolute`, `transform: translate(x, y)`,\n * etc.\n * - You put the effort into hoisting the menu to the top of the DOM like the\n * end of the `<body>` to render over everything or in a top-layer.\n * - You are reusing a single `md-menu` element that dynamically renders\n * content.\n *\n * __Examples for `position = 'popover'`:__\n *\n * - Your browser supports `popover`.\n * - Most cases. Once popover is in browsers, this will become the default.\n */\n @property() positioning: 'absolute' | 'fixed' | 'document' | 'popover' =\n 'absolute';\n /**\n * Skips the opening and closing animations.\n */\n @property({type: Boolean}) quick = false;\n /**\n * Displays overflow content like a submenu. Not required in most cases when\n * using `positioning=\"popover\"`.\n *\n * __NOTE__: This may cause adverse effects if you set\n * `md-menu {max-height:...}`\n * and have items overflowing items in the \"y\" direction.\n */\n @property({type: Boolean, attribute: 'has-overflow'}) hasOverflow = false;\n /**\n * Opens the menu and makes it visible. Alternative to the `.show()` and\n * `.close()` methods\n */\n @property({type: Boolean, reflect: true}) open = false;\n /**\n * Offsets the menu's inline alignment from the anchor by the given number in\n * pixels. This value is direction aware and will follow the LTR / RTL\n * direction.\n *\n * e.g. LTR: positive -> right, negative -> left\n * RTL: positive -> left, negative -> right\n */\n @property({type: Number, attribute: 'x-offset'}) xOffset = 0;\n /**\n * Offsets the menu's block alignment from the anchor by the given number in\n * pixels.\n *\n * e.g. positive -> down, negative -> up\n */\n @property({type: Number, attribute: 'y-offset'}) yOffset = 0;\n /**\n * The max time between the keystrokes of the typeahead menu behavior before\n * it clears the typeahead buffer.\n */\n @property({type: Number, attribute: 'typeahead-delay'})\n typeaheadDelay = DEFAULT_TYPEAHEAD_BUFFER_TIME;\n /**\n * The corner of the anchor which to align the menu in the standard logical\n * property style of <block>-<inline> e.g. `'end-start'`.\n *\n * NOTE: This value may not be respected by the menu positioning algorithm\n * if the menu would render outisde the viewport.\n */\n @property({attribute: 'anchor-corner'})\n anchorCorner: Corner = Corner.END_START;\n /**\n * The corner of the menu which to align the anchor in the standard logical\n * property style of <block>-<inline> e.g. `'start-start'`.\n *\n * NOTE: This value may not be respected by the menu positioning algorithm\n * if the menu would render outisde the viewport.\n */\n @property({attribute: 'menu-corner'}) menuCorner: Corner = Corner.START_START;\n /**\n * Keeps the user clicks outside the menu.\n *\n * NOTE: clicking outside may still cause focusout to close the menu so see\n * `stayOpenOnFocusout`.\n */\n @property({type: Boolean, attribute: 'stay-open-on-outside-click'})\n stayOpenOnOutsideClick = false;\n /**\n * Keeps the menu open when focus leaves the menu's composed subtree.\n *\n * NOTE: Focusout behavior will stop propagation of the focusout event. Set\n * this property to true to opt-out of menu's focusout handling altogether.\n */\n @property({type: Boolean, attribute: 'stay-open-on-focusout'})\n stayOpenOnFocusout = false;\n /**\n * After closing, does not restore focus to the last focused element before\n * the menu was opened.\n */\n @property({type: Boolean, attribute: 'skip-restore-focus'})\n skipRestoreFocus = false;\n /**\n * The element that should be focused by default once opened.\n *\n * NOTE: When setting default focus to 'LIST_ROOT', remember to change\n * `tabindex` to `0` and change md-menu's display to something other than\n * `display: contents` when necessary.\n */\n @property({attribute: 'default-focus'})\n defaultFocus: FocusState = FocusState.FIRST_ITEM;\n\n /**\n * Turns off navigation wrapping. By default, navigating past the end of the\n * menu items will wrap focus back to the beginning and vice versa. Use this\n * for ARIA patterns that do not wrap focus, like combobox.\n */\n @property({type: Boolean, attribute: 'no-navigation-wrap'})\n noNavigationWrap = false;\n\n @queryAssignedElements({flatten: true}) protected slotItems!: HTMLElement[];\n @state() private typeaheadActive = true;\n\n /**\n * Whether or not the current menu is a submenu and should not handle specific\n * navigation keys.\n *\n * @export\n */\n isSubmenu = false;\n\n /**\n * The event path of the last window pointerdown event.\n */\n private pointerPath: EventTarget[] = [];\n\n /**\n * Whether or not the menu is repositoining due to window / document resize\n */\n private isRepositioning = false;\n private readonly openCloseAnimationSignal = createAnimationSignal();\n\n private readonly listController = new ListController<MenuItem>({\n isItem: (maybeItem: HTMLElement): maybeItem is MenuItem => {\n return maybeItem.hasAttribute('md-menu-item');\n },\n getPossibleItems: () => this.slotItems,\n isRtl: () => getComputedStyle(this).direction === 'rtl',\n deactivateItem: (item: MenuItem) => {\n item.selected = false;\n item.tabIndex = -1;\n },\n activateItem: (item: MenuItem) => {\n item.selected = true;\n item.tabIndex = 0;\n },\n isNavigableKey: (key: string) => {\n if (!this.isSubmenu) {\n return menuNavKeys.has(key);\n }\n\n const isRtl = getComputedStyle(this).direction === 'rtl';\n // we want md-submenu to handle the submenu's left/right arrow exit\n // key so it can close the menu instead of navigate the list.\n // Therefore we need to include all keys but left/right arrow close\n // key\n const arrowOpen = isRtl\n ? NavigableKeys.ArrowLeft\n : NavigableKeys.ArrowRight;\n\n if (key === arrowOpen) {\n return true;\n }\n\n return submenuNavKeys.has(key);\n },\n wrapNavigation: () => !this.noNavigationWrap,\n });\n\n /**\n * Whether the menu is animating upwards or downwards when opening. This is\n * helpful for calculating some animation calculations.\n */\n private get openDirection(): 'UP' | 'DOWN' {\n const menuCornerBlock = this.menuCorner.split('-')[0];\n return menuCornerBlock === 'start' ? 'DOWN' : 'UP';\n }\n\n /**\n * The element that was focused before the menu opened.\n */\n private lastFocusedElement: HTMLElement | null = null;\n\n /**\n * Handles typeahead navigation through the menu.\n */\n typeaheadController = new TypeaheadController(() => {\n return {\n getItems: () => this.items,\n typeaheadBufferTime: this.typeaheadDelay,\n active: this.typeaheadActive,\n };\n });\n\n private currentAnchorElement: HTMLElement | null = null;\n\n /**\n * The element which the menu should align to. If `anchor` is set to a\n * non-empty idref string, then `anchorEl` will resolve to the element with\n * the given id in the same root node. Otherwise, `null`.\n */\n get anchorElement(): (HTMLElement & Partial<SurfacePositionTarget>) | null {\n if (this.anchor) {\n return (this.getRootNode() as Document | ShadowRoot).querySelector(\n `#${this.anchor}`,\n );\n }\n\n return this.currentAnchorElement;\n }\n\n set anchorElement(\n element: (HTMLElement & Partial<SurfacePositionTarget>) | null,\n ) {\n this.currentAnchorElement = element;\n this.requestUpdate('anchorElement');\n }\n\n private readonly internals =\n // Cast needed for closure\n (this as HTMLElement).attachInternals();\n\n constructor() {\n super();\n if (!isServer) {\n this.internals.role = 'menu';\n this.addEventListener('keydown', this.handleKeydown);\n // Capture so that we can grab the event before it reaches the menu item\n // istelf. Specifically useful for the case where typeahead encounters a\n // space and we don't want the menu item to close the menu.\n this.addEventListener('keydown', this.captureKeydown, {capture: true});\n this.addEventListener('focusout', this.handleFocusout);\n }\n }\n\n /**\n * Handles positioning the surface and aligning it to the anchor as well as\n * keeping it in the viewport.\n */\n private readonly menuPositionController = new SurfacePositionController(\n this,\n () => {\n return {\n anchorCorner: this.anchorCorner,\n surfaceCorner: this.menuCorner,\n surfaceEl: this.surfaceEl,\n anchorEl: this.anchorElement,\n positioning:\n this.positioning === 'popover' ? 'document' : this.positioning,\n isOpen: this.open,\n xOffset: this.xOffset,\n yOffset: this.yOffset,\n onOpen: this.onOpened,\n beforeClose: this.beforeClose,\n onClose: this.onClosed,\n // We can't resize components that have overflow like menus with\n // submenus because the overflow-y will show menu items / content\n // outside the bounds of the menu. Popover API fixes this because each\n // submenu is hoisted to the top-layer and are not considered overflow\n // content.\n repositionStrategy:\n this.hasOverflow && this.positioning !== 'popover'\n ? 'move'\n : 'resize',\n };\n },\n );\n\n /**\n * The menu items associated with this menu. The items must be `MenuItem`s and\n * have both the `md-menu-item` and `md-list-item` attributes.\n */\n get items(): MenuItem[] {\n return this.listController.items;\n }\n\n protected override willUpdate(changed: PropertyValues<Menu>) {\n if (!changed.has('open')) {\n return;\n }\n\n if (this.open) {\n this.removeAttribute('aria-hidden');\n return;\n }\n\n this.setAttribute('aria-hidden', 'true');\n }\n\n override update(changed: PropertyValues<Menu>) {\n if (changed.has('open')) {\n if (this.open) {\n this.setUpGlobalEventListeners();\n } else {\n this.cleanUpGlobalEventListeners();\n }\n }\n\n // Firefox does not support popover. Fall-back to using fixed.\n if (\n changed.has('positioning') &&\n this.positioning === 'popover' &&\n // type required for Google JS conformance\n !(this as unknown as {showPopover?: () => void}).showPopover\n ) {\n this.positioning = 'fixed';\n }\n\n super.update(changed);\n }\n\n private readonly onWindowResize = () => {\n if (\n this.isRepositioning ||\n (this.positioning !== 'document' &&\n this.positioning !== 'fixed' &&\n this.positioning !== 'popover')\n ) {\n return;\n }\n this.isRepositioning = true;\n this.reposition();\n this.isRepositioning = false;\n };\n\n override connectedCallback() {\n super.connectedCallback();\n if (this.open) {\n this.setUpGlobalEventListeners();\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanUpGlobalEventListeners();\n }\n\n override getBoundingClientRect() {\n if (!this.surfaceEl) {\n return super.getBoundingClientRect();\n }\n return this.surfaceEl.getBoundingClientRect();\n }\n\n override getClientRects() {\n if (!this.surfaceEl) {\n return super.getClientRects();\n }\n return this.surfaceEl.getClientRects();\n }\n\n protected override render() {\n return this.renderSurface();\n }\n\n /**\n * Renders the positionable surface element and its contents.\n */\n private renderSurface() {\n return html`\n <div\n class=\"menu ${classMap(this.getSurfaceClasses())}\"\n style=${styleMap(this.menuPositionController.surfaceStyles)}\n popover=${this.positioning === 'popover' ? 'manual' : nothing}>\n ${this.renderElevation()}\n <div class=\"items\">\n <div class=\"item-padding\"> ${this.renderMenuItems()} </div>\n </div>\n </div>\n `;\n }\n\n /**\n * Renders the menu items' slot\n */\n private renderMenuItems() {\n return html`<slot\n @close-menu=${this.onCloseMenu}\n @deactivate-items=${this.onDeactivateItems}\n @request-activation=${this.onRequestActivation}\n @deactivate-typeahead=${this.handleDeactivateTypeahead}\n @activate-typeahead=${this.handleActivateTypeahead}\n @stay-open-on-focusout=${this.handleStayOpenOnFocusout}\n @close-on-focusout=${this.handleCloseOnFocusout}\n @slotchange=${this.listController.onSlotchange}></slot>`;\n }\n\n /**\n * Renders the elevation component.\n */\n private renderElevation() {\n return html`<md-elevation part=\"elevation\"></md-elevation>`;\n }\n\n private getSurfaceClasses(): ClassInfo {\n return {\n open: this.open,\n fixed: this.positioning === 'fixed',\n 'has-overflow': this.hasOverflow,\n };\n }\n\n private readonly handleFocusout = async (event: FocusEvent) => {\n const anchorEl = this.anchorElement!;\n // Do not close if we focused out by clicking on the anchor element. We\n // can't assume anchor buttons can be the related target because of iOS does\n // not focus buttons.\n if (\n this.stayOpenOnFocusout ||\n !this.open ||\n this.pointerPath.includes(anchorEl)\n ) {\n return;\n }\n\n if (event.relatedTarget) {\n // Don't close the menu if we are switching focus between menu,\n // md-menu-item, and md-list or if the anchor was click focused, but check\n // if length of pointerPath is 0 because that means something was at least\n // clicked (shift+tab case).\n if (\n isElementInSubtree(event.relatedTarget, this) ||\n (this.pointerPath.length !== 0 &&\n isElementInSubtree(event.relatedTarget, anchorEl))\n ) {\n return;\n }\n } else if (this.pointerPath.includes(this)) {\n // If menu tabindex == -1 and the user clicks on the menu or a divider, we\n // want to keep the menu open.\n return;\n }\n\n const oldRestoreFocus = this.skipRestoreFocus;\n // allow focus to continue to the next focused object rather than returning\n this.skipRestoreFocus = true;\n this.close();\n // await for close\n await this.updateComplete;\n // return to previous behavior\n this.skipRestoreFocus = oldRestoreFocus;\n };\n\n private captureKeydown(event: KeyboardEvent) {\n if (\n event.target === this &&\n !event.defaultPrevented &&\n isClosableKey(event.code)\n ) {\n event.preventDefault();\n this.close();\n }\n\n this.typeaheadController.onKeydown(event);\n }\n\n /**\n * Saves the last focused element focuses the new element based on\n * `defaultFocus`, and animates open.\n */\n private readonly onOpened = async () => {\n this.lastFocusedElement = getFocusedElement();\n\n const items = this.items;\n const activeItemRecord = getActiveItem(items);\n\n if (activeItemRecord && this.defaultFocus !== FocusState.NONE) {\n activeItemRecord.item.tabIndex = -1;\n }\n\n let animationAborted = !this.quick;\n\n if (this.quick) {\n this.dispatchEvent(new Event('opening'));\n } else {\n animationAborted = !!(await this.animateOpen());\n }\n\n // This must come after the opening animation or else it may focus one of\n // the items before the animation has begun and causes the list to slide\n // (block-padding-of-the-menu)px at the end of the animation\n switch (this.defaultFocus) {\n case FocusState.FIRST_ITEM:\n const first = getFirstActivatableItem(items);\n if (first) {\n first.tabIndex = 0;\n first.focus();\n await (first as LitElement & MenuItem).updateComplete;\n }\n break;\n case FocusState.LAST_ITEM:\n const last = getLastActivatableItem(items);\n if (last) {\n last.tabIndex = 0;\n last.focus();\n await (last as LitElement & MenuItem).updateComplete;\n }\n break;\n case FocusState.LIST_ROOT:\n this.focus();\n break;\n default:\n case FocusState.NONE:\n // Do nothing.\n break;\n }\n\n if (!animationAborted) {\n this.dispatchEvent(new Event('opened'));\n }\n };\n\n /**\n * Animates closed.\n */\n private readonly beforeClose = async () => {\n this.open = false;\n\n if (!this.skipRestoreFocus) {\n this.lastFocusedElement?.focus?.();\n }\n\n if (!this.quick) {\n await this.animateClose();\n }\n };\n\n /**\n * Focuses the last focused element.\n */\n private readonly onClosed = () => {\n if (this.quick) {\n this.dispatchEvent(new Event('closing'));\n this.dispatchEvent(new Event('closed'));\n }\n };\n\n /**\n * Performs the opening animation:\n *\n * https://direct.googleplex.com/#/spec/295000003+271060003\n *\n * @return A promise that resolve to `true` if the animation was aborted,\n * `false` if it was not aborted.\n */\n private async animateOpen() {\n const surfaceEl = this.surfaceEl;\n const slotEl = this.slotEl;\n\n if (!surfaceEl || !slotEl) return true;\n\n const openDirection = this.openDirection;\n this.dispatchEvent(new Event('opening'));\n // needs to be imperative because we don't want to mix animation and Lit\n // render timing\n surfaceEl.classList.toggle('animating', true);\n\n const signal = this.openCloseAnimationSignal.start();\n const height = surfaceEl.offsetHeight;\n const openingUpwards = openDirection === 'UP';\n const children = this.items;\n const FULL_DURATION = 500;\n const SURFACE_OPACITY_DURATION = 50;\n const ITEM_OPACITY_DURATION = 250;\n // We want to fit every child fade-in animation within the full duration of\n // the animation.\n const DELAY_BETWEEN_ITEMS =\n (FULL_DURATION - ITEM_OPACITY_DURATION) / children.length;\n\n const surfaceHeightAnimation = surfaceEl.animate(\n [{height: '0px'}, {height: `${height}px`}],\n {\n duration: FULL_DURATION,\n easing: EASING.EMPHASIZED,\n },\n );\n // When we are opening upwards, we want to make sure the last item is always\n // in view, so we need to translate it upwards the opposite direction of the\n // height animation\n const upPositionCorrectionAnimation = slotEl.animate(\n [\n {transform: openingUpwards ? `translateY(-${height}px)` : ''},\n {transform: ''},\n ],\n {duration: FULL_DURATION, easing: EASING.EMPHASIZED},\n );\n\n const surfaceOpacityAnimation = surfaceEl.animate(\n [{opacity: 0}, {opacity: 1}],\n SURFACE_OPACITY_DURATION,\n );\n\n const childrenAnimations: Array<[HTMLElement, Animation]> = [];\n\n for (let i = 0; i < children.length; i++) {\n // If we are animating upwards, then reverse the children list.\n const directionalIndex = openingUpwards ? children.length - 1 - i : i;\n const child = children[directionalIndex];\n const animation = child.animate([{opacity: 0}, {opacity: 1}], {\n duration: ITEM_OPACITY_DURATION,\n delay: DELAY_BETWEEN_ITEMS * i,\n });\n\n // Make them all initially hidden and then clean up at the end of each\n // animation.\n child.classList.toggle('md-menu-hidden', true);\n animation.addEventListener('finish', () => {\n child.classList.toggle('md-menu-hidden', false);\n });\n\n childrenAnimations.push([child, animation]);\n }\n\n let resolveAnimation = (value: boolean) => {};\n const animationFinished = new Promise<boolean>((resolve) => {\n resolveAnimation = resolve;\n });\n\n signal.addEventListener('abort', () => {\n surfaceHeightAnimation.cancel();\n upPositionCorrectionAnimation.cancel();\n surfaceOpacityAnimation.cancel();\n childrenAnimations.forEach(([child, animation]) => {\n child.classList.toggle('md-menu-hidden', false);\n animation.cancel();\n });\n\n resolveAnimation(true);\n });\n\n surfaceHeightAnimation.addEventListener('finish', () => {\n surfaceEl.classList.toggle('animating', false);\n this.openCloseAnimationSignal.finish();\n resolveAnimation(false);\n });\n\n return await animationFinished;\n }\n\n /**\n * Performs the closing animation:\n *\n * https://direct.googleplex.com/#/spec/295000003+271060003\n */\n private animateClose() {\n let resolve!: (value: unknown) => void;\n let reject!: () => void;\n\n // This promise blocks the surface position controller from setting\n // display: none on the surface which will interfere with this animation.\n const animationEnded = new Promise((res, rej) => {\n resolve = res;\n reject = rej;\n });\n\n const surfaceEl = this.surfaceEl;\n const slotEl = this.slotEl;\n\n if (!surfaceEl || !slotEl) {\n reject();\n return animationEnded;\n }\n\n const openDirection = this.openDirection;\n const closingDownwards = openDirection === 'UP';\n this.dispatchEvent(new Event('closing'));\n // needs to be imperative because we don't want to mix animation and Lit\n // render timing\n surfaceEl.classList.toggle('animating', true);\n const signal = this.openCloseAnimationSignal.start();\n const height = surfaceEl.offsetHeight;\n const children = this.items;\n const FULL_DURATION = 150;\n const SURFACE_OPACITY_DURATION = 50;\n // The surface fades away at the very end\n const SURFACE_OPACITY_DELAY = FULL_DURATION - SURFACE_OPACITY_DURATION;\n const ITEM_OPACITY_DURATION = 50;\n const ITEM_OPACITY_INITIAL_DELAY = 50;\n const END_HEIGHT_PERCENTAGE = 0.35;\n\n // We want to fit every child fade-out animation within the full duration of\n // the animation.\n const DELAY_BETWEEN_ITEMS =\n (FULL_DURATION - ITEM_OPACITY_INITIAL_DELAY - ITEM_OPACITY_DURATION) /\n children.length;\n\n // The mock has the animation shrink to 35%\n const surfaceHeightAnimation = surfaceEl.animate(\n [\n {height: `${height}px`},\n {height: `${height * END_HEIGHT_PERCENTAGE}px`},\n ],\n {\n duration: FULL_DURATION,\n easing: EASING.EMPHASIZED_ACCELERATE,\n },\n );\n\n // When we are closing downwards, we want to make sure the last item is\n // always in view, so we need to translate it upwards the opposite direction\n // of the height animation\n const downPositionCorrectionAnimation = slotEl.animate(\n [\n {transform: ''},\n {\n transform: closingDownwards\n ? `translateY(-${height * (1 - END_HEIGHT_PERCENTAGE)}px)`\n : '',\n },\n ],\n {duration: FULL_DURATION, easing: EASING.EMPHASIZED_ACCELERATE},\n );\n\n const surfaceOpacityAnimation = surfaceEl.animate(\n [{opacity: 1}, {opacity: 0}],\n {duration: SURFACE_OPACITY_DURATION, delay: SURFACE_OPACITY_DELAY},\n );\n\n const childrenAnimations: Array<[HTMLElement, Animation]> = [];\n\n for (let i = 0; i < children.length; i++) {\n // If the animation is closing upwards, then reverse the list of\n // children so that we animate in the opposite direction.\n const directionalIndex = closingDownwards ? i : children.length - 1 - i;\n const child = children[directionalIndex];\n const animation = child.animate([{opacity: 1}, {opacity: 0}], {\n duration: ITEM_OPACITY_DURATION,\n delay: ITEM_OPACITY_INITIAL_DELAY + DELAY_BETWEEN_ITEMS * i,\n });\n\n // Make sure the items stay hidden at the end of each child animation.\n // We clean this up at the end of the overall animation.\n animation.addEventListener('finish', () => {\n child.classList.toggle('md-menu-hidden', true);\n });\n childrenAnimations.push([child, animation]);\n }\n\n signal.addEventListener('abort', () => {\n surfaceHeightAnimation.cancel();\n downPositionCorrectionAnimation.cancel();\n surfaceOpacityAnimation.cancel();\n childrenAnimations.forEach(([child, animation]) => {\n animation.cancel();\n child.classList.toggle('md-menu-hidden', false);\n });\n reject();\n });\n\n surfaceHeightAnimation.addEventListener('finish', () => {\n surfaceEl.classList.toggle('animating', false);\n childrenAnimations.forEach(([child]) => {\n child.classList.toggle('md-menu-hidden', false);\n });\n this.openCloseAnimationSignal.finish();\n this.dispatchEvent(new Event('closed'));\n resolve(true);\n });\n\n return animationEnded;\n }\n\n private handleKeydown(event: KeyboardEvent) {\n // At any key event, the pointer interaction is done so we need to clear our\n // cached pointerpath. This handles the case where the user clicks on the\n // anchor, and then hits shift+tab\n this.pointerPath = [];\n this.listController.handleKeydown(event);\n }\n\n private setUpGlobalEventListeners() {\n document.addEventListener('click', this.onDocumentClick, {capture: true});\n window.addEventListener('pointerdown', this.onWindowPointerdown);\n document.addEventListener('resize', this.onWindowResize, {passive: true});\n window.addEventListener('resize', this.onWindowResize, {passive: true});\n }\n\n private cleanUpGlobalEventListeners() {\n document.removeEventListener('click', this.onDocumentClick, {\n capture: true,\n });\n window.removeEventListener('pointerdown', this.onWindowPointerdown);\n document.removeEventListener('resize', this.onWindowResize);\n window.removeEventListener('resize', this.onWindowResize);\n }\n\n private readonly onWindowPointerdown = (event: PointerEvent) => {\n this.pointerPath = event.composedPath();\n };\n\n /**\n * We cannot listen to window click because Safari on iOS will not bubble a\n * click event on window if the item clicked is not a \"clickable\" item such as\n * <body>\n */\n private readonly onDocumentClick = (event: Event) => {\n if (!this.open) {\n return;\n }\n\n const path = event.composedPath();\n\n if (\n !this.stayOpenOnOutsideClick &&\n !path.includes(this) &&\n !path.includes(this.anchorElement!)\n ) {\n this.open = false;\n }\n };\n\n private onCloseMenu() {\n this.close();\n }\n\n private onDeactivateItems(event: Event) {\n event.stopPropagation();\n this.listController.onDeactivateItems();\n }\n\n private onRequestActivation(event: Event) {\n event.stopPropagation();\n this.listController.onRequestActivation(event);\n }\n\n private handleDeactivateTypeahead(event: DeactivateTypeaheadEvent) {\n // stopPropagation so that this does not deactivate any typeaheads in menus\n // nested above it e.g. md-sub-menu\n event.stopPropagation();\n this.typeaheadActive = false;\n }\n\n private handleActivateTypeahead(event: ActivateTypeaheadEvent) {\n // stopPropagation so that this does not activate any typeaheads in menus\n // nested above it e.g. md-sub-menu\n event.stopPropagation();\n this.typeaheadActive = true;\n }\n\n private handleStayOpenOnFocusout(event: Event) {\n event.stopPropagation();\n this.stayOpenOnFocusout = true;\n }\n\n private handleCloseOnFocusout(event: Event) {\n event.stopPropagation();\n this.stayOpenOnFocusout = false;\n }\n\n close() {\n this.open = false;\n const maybeSubmenu = this.slotItems as Array<\n HTMLElement & {close?: () => void}\n >;\n maybeSubmenu.forEach((item) => {\n item.close?.();\n });\n }\n\n show() {\n this.open = true;\n }\n\n /**\n * Activates the next item in the menu. If at the end of the menu, the first\n * item will be activated.\n *\n * @return The activated menu item or `null` if there are no items.\n */\n activateNextItem() {\n return this.listController.activateNextItem() ?? null;\n }\n\n /**\n * Activates the previous item in the menu. If at the start of the menu, the\n * last item will be activated.\n *\n * @return The activated menu item or `null` if there are no items.\n */\n activatePreviousItem() {\n return this.listController.activatePreviousItem() ?? null;\n }\n\n /**\n * Repositions the menu if it is open.\n *\n * Useful for the case where document or window-positioned menus have their\n * anchors moved while open.\n */\n reposition() {\n if (this.open) {\n this.menuPositionController.position();\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,UAAU,EAAkB,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,MAAM,EAAE,qBAAqB,EAAC,MAAM,oCAAoC,CAAC;AACjF,OAAO,EACL,cAAc,EACd,aAAa,GACd,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,aAAa,EACb,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,gDAAgD,CAAC;AAGxD,OAAO,EAGL,UAAU,EACV,aAAa,EACb,kBAAkB,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,MAAM,EACN,yBAAyB,GAE1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAAC,mBAAmB,EAAC,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAC,MAAM,EAAC,MAAM,4CAA4C,CAAC;AAElE;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAC;AAEjD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS;IACrC,aAAa,CAAC,SAAS;IACvB,aAAa,CAAC,OAAO;IACrB,aAAa,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AE,eAAe,EAAC,CAAC;0CACC;AAQF;IAArC,QAAQ,CAAC,EAAC,SAAS,EAAE,aAAa,EAAC,CAAC;wCAAyC;AAQ9E;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,4BAA4B,EAAC,CAAC;oDACpC;AAQ/B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,uBAAuB,EAAC,CAAC;gDACnC;AAM3B;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAC,CAAC;8CAClC;AASzB;IADC,QAAQ,CAAC,EAAC,SAAS,EAAE,eAAe,EAAC,CAAC;0CACU;AAQjD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAC,CAAC;8CAClC;AAEyB;IAAjD,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;uCAAqC;AAC3D;IAAhB,KAAK,EAAE;6CAAgC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../elevation/elevation.js';\nimport '../../focus/md-focus-ring.js';\n\nimport {LitElement, PropertyValues, html, isServer, nothing} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\n\nimport {EASING, createAnimationSignal} from '../../internal/motion/animation.js';\nimport {\n ListController,\n NavigableKeys,\n} from '../../list/internal/list-controller.js';\nimport {\n getActiveItem,\n getFirstActivatableItem,\n getLastActivatableItem,\n} from '../../list/internal/list-navigation-helpers.js';\n\nimport {MenuItem} from './controllers/menuItemController.js';\nimport {\n ActivateTypeaheadEvent,\n DeactivateTypeaheadEvent,\n FocusState,\n isClosableKey,\n isElementInSubtree,\n} from './controllers/shared.js';\nimport {\n Corner,\n SurfacePositionController,\n SurfacePositionTarget,\n} from './controllers/surfacePositionController.js';\nimport {TypeaheadController} from './controllers/typeaheadController.js';\n\nexport {Corner} from './controllers/surfacePositionController.js';\n\n/**\n * The default value for the typeahead buffer time in Milliseconds.\n */\nexport const DEFAULT_TYPEAHEAD_BUFFER_TIME = 200;\n\nconst submenuNavKeys = new Set<string>([\n NavigableKeys.ArrowDown,\n NavigableKeys.ArrowUp,\n NavigableKeys.Home,\n NavigableKeys.End,\n]);\n\nconst menuNavKeys = new Set<string>([\n NavigableKeys.ArrowLeft,\n NavigableKeys.ArrowRight,\n ...submenuNavKeys,\n]);\n\n/**\n * Gets the currently focused element on the page.\n *\n * @param activeDoc The document or shadowroot from which to start the search.\n * Defaults to `window.document`\n * @return Returns the currently deeply focused element or `null` if none.\n */\nfunction getFocusedElement(\n activeDoc: Document | ShadowRoot = document,\n): HTMLElement | null {\n let activeEl = activeDoc.activeElement as HTMLElement | null;\n\n // Check for activeElement in the case that an element with a shadow root host\n // is currently focused.\n while (activeEl && activeEl?.shadowRoot?.activeElement) {\n activeEl = activeEl.shadowRoot.activeElement as HTMLElement | null;\n }\n\n return activeEl;\n}\n\n/**\n * @fires opening {Event} Fired before the opening animation begins\n * @fires opened {Event} Fired once the menu is open, after any animations\n * @fires closing {Event} Fired before the closing animation begins\n * @fires closed {Event} Fired once the menu is closed, after any animations\n */\nexport abstract class Menu extends LitElement {\n @query('.menu') private readonly surfaceEl!: HTMLElement | null;\n @query('slot') private readonly slotEl!: HTMLSlotElement | null;\n\n /**\n * The ID of the element in the same root node in which the menu should align\n * to. Overrides setting `anchorElement = elementReference`.\n *\n * __NOTE__: anchor or anchorElement must either be an HTMLElement or resolve\n * to an HTMLElement in order for menu to open.\n */\n @property() anchor = '';\n /**\n * Whether the positioning algorithm should calculate relative to the parent\n * of the anchor element (`absolute`), relative to the window (`fixed`), or\n * relative to the document (`document`). `popover` will use the popover API\n * to render the menu in the top-layer. If your browser does not support the\n * popover API, it will fall back to `fixed`.\n *\n * __Examples for `position = 'fixed'`:__\n *\n * - If there is no `position:relative` in the given parent tree and the\n * surface is `position:absolute`\n * - If the surface is `position:fixed`\n * - If the surface is in the \"top layer\"\n * - The anchor and the surface do not share a common `position:relative`\n * ancestor\n *\n * When using `positioning=fixed`, in most cases, the menu should position\n * itself above most other `position:absolute` or `position:fixed` elements\n * when placed inside of them. e.g. using a menu inside of an `md-dialog`.\n *\n * __NOTE__: Fixed menus will not scroll with the page and will be fixed to\n * the window instead.\n *\n * __Examples for `position = 'document'`:__\n *\n * - There is no parent that creates a relative positioning context e.g.\n * `position: relative`, `position: absolute`, `transform: translate(x, y)`,\n * etc.\n * - You put the effort into hoisting the menu to the top of the DOM like the\n * end of the `<body>` to render over everything or in a top-layer.\n * - You are reusing a single `md-menu` element that dynamically renders\n * content.\n *\n * __Examples for `position = 'popover'`:__\n *\n * - Your browser supports `popover`.\n * - Most cases. Once popover is in browsers, this will become the default.\n */\n @property() positioning: 'absolute' | 'fixed' | 'document' | 'popover' =\n 'absolute';\n /**\n * Skips the opening and closing animations.\n */\n @property({type: Boolean}) quick = false;\n /**\n * Displays overflow content like a submenu. Not required in most cases when\n * using `positioning=\"popover\"`.\n *\n * __NOTE__: This may cause adverse effects if you set\n * `md-menu {max-height:...}`\n * and have items overflowing items in the \"y\" direction.\n */\n @property({type: Boolean, attribute: 'has-overflow'}) hasOverflow = false;\n /**\n * Opens the menu and makes it visible. Alternative to the `.show()` and\n * `.close()` methods\n */\n @property({type: Boolean, reflect: true}) open = false;\n /**\n * Offsets the menu's inline alignment from the anchor by the given number in\n * pixels. This value is direction aware and will follow the LTR / RTL\n * direction.\n *\n * e.g. LTR: positive -> right, negative -> left\n * RTL: positive -> left, negative -> right\n */\n @property({type: Number, attribute: 'x-offset'}) xOffset = 0;\n /**\n * Offsets the menu's block alignment from the anchor by the given number in\n * pixels.\n *\n * e.g. positive -> down, negative -> up\n */\n @property({type: Number, attribute: 'y-offset'}) yOffset = 0;\n /**\n * The max time between the keystrokes of the typeahead menu behavior before\n * it clears the typeahead buffer.\n */\n @property({type: Number, attribute: 'typeahead-delay'})\n typeaheadDelay = DEFAULT_TYPEAHEAD_BUFFER_TIME;\n /**\n * The corner of the anchor which to align the menu in the standard logical\n * property style of <block>-<inline> e.g. `'end-start'`.\n *\n * NOTE: This value may not be respected by the menu positioning algorithm\n * if the menu would render outisde the viewport.\n */\n @property({attribute: 'anchor-corner'})\n anchorCorner: Corner = Corner.END_START;\n /**\n * The corner of the menu which to align the anchor in the standard logical\n * property style of <block>-<inline> e.g. `'start-start'`.\n *\n * NOTE: This value may not be respected by the menu positioning algorithm\n * if the menu would render outisde the viewport.\n */\n @property({attribute: 'menu-corner'}) menuCorner: Corner = Corner.START_START;\n /**\n * Keeps the user clicks outside the menu.\n *\n * NOTE: clicking outside may still cause focusout to close the menu so see\n * `stayOpenOnFocusout`.\n */\n @property({type: Boolean, attribute: 'stay-open-on-outside-click'})\n stayOpenOnOutsideClick = false;\n /**\n * Keeps the menu open when focus leaves the menu's composed subtree.\n *\n * NOTE: Focusout behavior will stop propagation of the focusout event. Set\n * this property to true to opt-out of menu's focusout handling altogether.\n */\n @property({type: Boolean, attribute: 'stay-open-on-focusout'})\n stayOpenOnFocusout = false;\n /**\n * After closing, does not restore focus to the last focused element before\n * the menu was opened.\n */\n @property({type: Boolean, attribute: 'skip-restore-focus'})\n skipRestoreFocus = false;\n /**\n * The element that should be focused by default once opened.\n *\n * NOTE: When setting default focus to 'LIST_ROOT', remember to change\n * `tabindex` to `0` and change md-menu's display to something other than\n * `display: contents` when necessary.\n */\n @property({attribute: 'default-focus'})\n defaultFocus: FocusState = FocusState.FIRST_ITEM;\n\n /**\n * Turns off navigation wrapping. By default, navigating past the end of the\n * menu items will wrap focus back to the beginning and vice versa. Use this\n * for ARIA patterns that do not wrap focus, like combobox.\n */\n @property({type: Boolean, attribute: 'no-navigation-wrap'})\n noNavigationWrap = false;\n\n @queryAssignedElements({flatten: true}) protected slotItems!: HTMLElement[];\n @state() private typeaheadActive = true;\n\n /**\n * Whether or not the current menu is a submenu and should not handle specific\n * navigation keys.\n *\n * @export\n */\n isSubmenu = false;\n\n /**\n * The event path of the last window pointerdown event.\n */\n private pointerPath: EventTarget[] = [];\n\n /**\n * Whether or not the menu is repositoining due to window / document resize\n */\n private isRepositioning = false;\n private readonly openCloseAnimationSignal = createAnimationSignal();\n\n private readonly listController = new ListController<MenuItem>({\n isItem: (maybeItem: HTMLElement): maybeItem is MenuItem => {\n return maybeItem.hasAttribute('md-menu-item');\n },\n getPossibleItems: () => this.slotItems,\n isRtl: () => getComputedStyle(this).direction === 'rtl',\n deactivateItem: (item: MenuItem) => {\n item.selected = false;\n item.tabIndex = -1;\n },\n activateItem: (item: MenuItem) => {\n item.selected = true;\n item.tabIndex = 0;\n },\n isNavigableKey: (key: string) => {\n if (!this.isSubmenu) {\n return menuNavKeys.has(key);\n }\n\n const isRtl = getComputedStyle(this).direction === 'rtl';\n // we want md-submenu to handle the submenu's left/right arrow exit\n // key so it can close the menu instead of navigate the list.\n // Therefore we need to include all keys but left/right arrow close\n // key\n const arrowOpen = isRtl\n ? NavigableKeys.ArrowLeft\n : NavigableKeys.ArrowRight;\n\n if (key === arrowOpen) {\n return true;\n }\n\n return submenuNavKeys.has(key);\n },\n wrapNavigation: () => !this.noNavigationWrap,\n });\n\n /**\n * Whether the menu is animating upwards or downwards when opening. This is\n * helpful for calculating some animation calculations.\n */\n private get openDirection(): 'UP' | 'DOWN' {\n const menuCornerBlock = this.menuCorner.split('-')[0];\n return menuCornerBlock === 'start' ? 'DOWN' : 'UP';\n }\n\n /**\n * The element that was focused before the menu opened.\n */\n private lastFocusedElement: HTMLElement | null = null;\n\n /**\n * Handles typeahead navigation through the menu.\n */\n typeaheadController = new TypeaheadController(() => {\n return {\n getItems: () => this.items,\n typeaheadBufferTime: this.typeaheadDelay,\n active: this.typeaheadActive,\n };\n });\n\n private currentAnchorElement: HTMLElement | null = null;\n\n /**\n * The element which the menu should align to. If `anchor` is set to a\n * non-empty idref string, then `anchorEl` will resolve to the element with\n * the given id in the same root node. Otherwise, `null`.\n */\n get anchorElement(): (HTMLElement & Partial<SurfacePositionTarget>) | null {\n if (this.anchor) {\n return (this.getRootNode() as Document | ShadowRoot).querySelector(\n `#${this.anchor}`,\n );\n }\n\n return this.currentAnchorElement;\n }\n\n set anchorElement(\n element: (HTMLElement & Partial<SurfacePositionTarget>) | null,\n ) {\n this.currentAnchorElement = element;\n this.requestUpdate('anchorElement');\n }\n\n private readonly internals =\n // Cast needed for closure\n (this as HTMLElement).attachInternals();\n\n constructor() {\n super();\n if (!isServer) {\n this.internals.role = 'menu';\n this.addEventListener('keydown', this.handleKeydown);\n // Capture so that we can grab the event before it reaches the menu item\n // istelf. Specifically useful for the case where typeahead encounters a\n // space and we don't want the menu item to close the menu.\n this.addEventListener('keydown', this.captureKeydown, {capture: true});\n this.addEventListener('focusout', this.handleFocusout);\n }\n }\n\n /**\n * Handles positioning the surface and aligning it to the anchor as well as\n * keeping it in the viewport.\n */\n private readonly menuPositionController = new SurfacePositionController(\n this,\n () => {\n return {\n anchorCorner: this.anchorCorner,\n surfaceCorner: this.menuCorner,\n surfaceEl: this.surfaceEl,\n anchorEl: this.anchorElement,\n positioning:\n this.positioning === 'popover' ? 'document' : this.positioning,\n isOpen: this.open,\n xOffset: this.xOffset,\n yOffset: this.yOffset,\n onOpen: this.onOpened,\n beforeClose: this.beforeClose,\n onClose: this.onClosed,\n // We can't resize components that have overflow like menus with\n // submenus because the overflow-y will show menu items / content\n // outside the bounds of the menu. Popover API fixes this because each\n // submenu is hoisted to the top-layer and are not considered overflow\n // content.\n repositionStrategy:\n this.hasOverflow && this.positioning !== 'popover'\n ? 'move'\n : 'resize',\n };\n },\n );\n\n /**\n * The menu items associated with this menu. The items must be `MenuItem`s and\n * have both the `md-menu-item` and `md-list-item` attributes.\n */\n get items(): MenuItem[] {\n return this.listController.items;\n }\n\n protected override willUpdate(changed: PropertyValues<Menu>) {\n if (!changed.has('open')) {\n return;\n }\n\n if (this.open) {\n this.removeAttribute('aria-hidden');\n return;\n }\n\n this.setAttribute('aria-hidden', 'true');\n }\n\n override update(changed: PropertyValues<Menu>) {\n if (changed.has('open')) {\n if (this.open) {\n this.setUpGlobalEventListeners();\n } else {\n this.cleanUpGlobalEventListeners();\n }\n }\n\n // Firefox does not support popover. Fall-back to using fixed.\n if (\n changed.has('positioning') &&\n this.positioning === 'popover' &&\n // type required for Google JS conformance\n !(this as unknown as {showPopover?: () => void}).showPopover\n ) {\n this.positioning = 'fixed';\n }\n\n super.update(changed);\n }\n\n private readonly onWindowResize = () => {\n if (\n this.isRepositioning ||\n (this.positioning !== 'document' &&\n this.positioning !== 'fixed' &&\n this.positioning !== 'popover')\n ) {\n return;\n }\n this.isRepositioning = true;\n this.reposition();\n this.isRepositioning = false;\n };\n\n override connectedCallback() {\n super.connectedCallback();\n if (this.open) {\n this.setUpGlobalEventListeners();\n }\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.cleanUpGlobalEventListeners();\n }\n\n override getBoundingClientRect() {\n if (!this.surfaceEl) {\n return super.getBoundingClientRect();\n }\n return this.surfaceEl.getBoundingClientRect();\n }\n\n override getClientRects() {\n if (!this.surfaceEl) {\n return super.getClientRects();\n }\n return this.surfaceEl.getClientRects();\n }\n\n protected override render() {\n return this.renderSurface();\n }\n\n /**\n * Renders the positionable surface element and its contents.\n */\n private renderSurface() {\n return html`\n <div\n class=\"menu ${classMap(this.getSurfaceClasses())}\"\n style=${styleMap(this.menuPositionController.surfaceStyles)}\n popover=${this.positioning === 'popover' ? 'manual' : nothing}>\n ${this.renderElevation()}\n <div class=\"items\">\n <div class=\"item-padding\"> ${this.renderMenuItems()} </div>\n </div>\n </div>\n `;\n }\n\n /**\n * Renders the menu items' slot\n */\n private renderMenuItems() {\n return html`<slot\n @close-menu=${this.onCloseMenu}\n @deactivate-items=${this.onDeactivateItems}\n @request-activation=${this.onRequestActivation}\n @deactivate-typeahead=${this.handleDeactivateTypeahead}\n @activate-typeahead=${this.handleActivateTypeahead}\n @stay-open-on-focusout=${this.handleStayOpenOnFocusout}\n @close-on-focusout=${this.handleCloseOnFocusout}\n @slotchange=${this.listController.onSlotchange}></slot>`;\n }\n\n /**\n * Renders the elevation component.\n */\n private renderElevation() {\n return html`<md-elevation part=\"elevation\"></md-elevation>`;\n }\n\n private getSurfaceClasses(): ClassInfo {\n return {\n open: this.open,\n fixed: this.positioning === 'fixed',\n 'has-overflow': this.hasOverflow,\n };\n }\n\n private readonly handleFocusout = async (event: FocusEvent) => {\n const anchorEl = this.anchorElement!;\n // Do not close if we focused out by clicking on the anchor element. We\n // can't assume anchor buttons can be the related target because of iOS does\n // not focus buttons.\n if (\n this.stayOpenOnFocusout ||\n !this.open ||\n this.pointerPath.includes(anchorEl)\n ) {\n return;\n }\n\n if (event.relatedTarget) {\n // Don't close the menu if we are switching focus between menu,\n // md-menu-item, and md-list or if the anchor was click focused, but check\n // if length of pointerPath is 0 because that means something was at least\n // clicked (shift+tab case).\n if (\n isElementInSubtree(event.relatedTarget, this) ||\n (this.pointerPath.length !== 0 &&\n isElementInSubtree(event.relatedTarget, anchorEl))\n ) {\n return;\n }\n } else if (this.pointerPath.includes(this)) {\n // If menu tabindex == -1 and the user clicks on the menu or a divider, we\n // want to keep the menu open.\n return;\n }\n\n const oldRestoreFocus = this.skipRestoreFocus;\n // allow focus to continue to the next focused object rather than returning\n this.skipRestoreFocus = true;\n this.close();\n // await for close\n await this.updateComplete;\n // return to previous behavior\n this.skipRestoreFocus = oldRestoreFocus;\n };\n\n private captureKeydown(event: KeyboardEvent) {\n if (\n event.target === this &&\n !event.defaultPrevented &&\n isClosableKey(event.code)\n ) {\n event.preventDefault();\n this.close();\n }\n\n this.typeaheadController.onKeydown(event);\n }\n\n /**\n * Saves the last focused element focuses the new element based on\n * `defaultFocus`, and animates open.\n */\n private readonly onOpened = async () => {\n this.lastFocusedElement = getFocusedElement();\n\n const items = this.items;\n const activeItemRecord = getActiveItem(items);\n\n if (activeItemRecord && this.defaultFocus !== FocusState.NONE) {\n activeItemRecord.item.tabIndex = -1;\n }\n\n let animationAborted = !this.quick;\n\n if (this.quick) {\n this.dispatchEvent(new Event('opening'));\n } else {\n animationAborted = !!(await this.animateOpen());\n }\n\n // This must come after the opening animation or else it may focus one of\n // the items before the animation has begun and causes the list to slide\n // (block-padding-of-the-menu)px at the end of the animation\n switch (this.defaultFocus) {\n case FocusState.FIRST_ITEM:\n const first = getFirstActivatableItem(items);\n if (first) {\n first.tabIndex = 0;\n first.focus();\n await (first as LitElement & MenuItem).updateComplete;\n }\n break;\n case FocusState.LAST_ITEM:\n const last = getLastActivatableItem(items);\n if (last) {\n last.tabIndex = 0;\n last.focus();\n await (last as LitElement & MenuItem).updateComplete;\n }\n break;\n case FocusState.LIST_ROOT:\n this.focus();\n break;\n default:\n case FocusState.NONE:\n // Do nothing.\n break;\n }\n\n if (!animationAborted) {\n this.dispatchEvent(new Event('opened'));\n }\n };\n\n /**\n * Animates closed.\n */\n private readonly beforeClose = async () => {\n this.open = false;\n\n if (!this.skipRestoreFocus) {\n this.lastFocusedElement?.focus?.();\n }\n\n if (!this.quick) {\n await this.animateClose();\n }\n };\n\n /**\n * Focuses the last focused element.\n */\n private readonly onClosed = () => {\n if (this.quick) {\n this.dispatchEvent(new Event('closing'));\n this.dispatchEvent(new Event('closed'));\n }\n };\n\n /**\n * Performs the opening animation:\n *\n * https://direct.googleplex.com/#/spec/295000003+271060003\n *\n * @return A promise that resolve to `true` if the animation was aborted,\n * `false` if it was not aborted.\n */\n private async animateOpen() {\n const surfaceEl = this.surfaceEl;\n const slotEl = this.slotEl;\n\n if (!surfaceEl || !slotEl) return true;\n\n const openDirection = this.openDirection;\n this.dispatchEvent(new Event('opening'));\n // needs to be imperative because we don't want to mix animation and Lit\n // render timing\n surfaceEl.classList.toggle('animating', true);\n\n const signal = this.openCloseAnimationSignal.start();\n const height = surfaceEl.offsetHeight;\n const openingUpwards = openDirection === 'UP';\n const children = this.items;\n const FULL_DURATION = 500;\n const SURFACE_OPACITY_DURATION = 50;\n const ITEM_OPACITY_DURATION = 250;\n // We want to fit every child fade-in animation within the full duration of\n // the animation.\n const DELAY_BETWEEN_ITEMS =\n (FULL_DURATION - ITEM_OPACITY_DURATION) / children.length;\n\n const surfaceHeightAnimation = surfaceEl.animate(\n [{height: '0px'}, {height: `${height}px`}],\n {\n duration: FULL_DURATION,\n easing: EASING.EMPHASIZED,\n },\n );\n // When we are opening upwards, we want to make sure the last item is always\n // in view, so we need to translate it upwards the opposite direction of the\n // height animation\n const upPositionCorrectionAnimation = slotEl.animate(\n [\n {transform: openingUpwards ? `translateY(-${height}px)` : ''},\n {transform: ''},\n ],\n {duration: FULL_DURATION, easing: EASING.EMPHASIZED},\n );\n\n const surfaceOpacityAnimation = surfaceEl.animate(\n [{opacity: 0}, {opacity: 1}],\n SURFACE_OPACITY_DURATION,\n );\n\n const childrenAnimations: Array<[HTMLElement, Animation]> = [];\n\n for (let i = 0; i < children.length; i++) {\n // If we are animating upwards, then reverse the children list.\n const directionalIndex = openingUpwards ? children.length - 1 - i : i;\n const child = children[directionalIndex];\n const animation = child.animate([{opacity: 0}, {opacity: 1}], {\n duration: ITEM_OPACITY_DURATION,\n delay: DELAY_BETWEEN_ITEMS * i,\n });\n\n // Make them all initially hidden and then clean up at the end of each\n // animation.\n child.classList.toggle('md-menu-hidden', true);\n animation.addEventListener('finish', () => {\n child.classList.toggle('md-menu-hidden', false);\n });\n\n childrenAnimations.push([child, animation]);\n }\n\n let resolveAnimation = (value: boolean) => {};\n const animationFinished = new Promise<boolean>((resolve) => {\n resolveAnimation = resolve;\n });\n\n signal.addEventListener('abort', () => {\n surfaceHeightAnimation.cancel();\n upPositionCorrectionAnimation.cancel();\n surfaceOpacityAnimation.cancel();\n childrenAnimations.forEach(([child, animation]) => {\n child.classList.toggle('md-menu-hidden', false);\n animation.cancel();\n });\n\n resolveAnimation(true);\n });\n\n surfaceHeightAnimation.addEventListener('finish', () => {\n surfaceEl.classList.toggle('animating', false);\n this.openCloseAnimationSignal.finish();\n resolveAnimation(false);\n });\n\n return await animationFinished;\n }\n\n /**\n * Performs the closing animation:\n *\n * https://direct.googleplex.com/#/spec/295000003+271060003\n */\n private animateClose() {\n let resolve!: (value: unknown) => void;\n\n // This promise blocks the surface position controller from setting\n // display: none on the surface which will interfere with this animation.\n const animationEnded = new Promise((res) => {\n resolve = res;\n });\n\n const surfaceEl = this.surfaceEl;\n const slotEl = this.slotEl;\n\n if (!surfaceEl || !slotEl) {\n resolve(false);\n return animationEnded;\n }\n\n const openDirection = this.openDirection;\n const closingDownwards = openDirection === 'UP';\n this.dispatchEvent(new Event('closing'));\n // needs to be imperative because we don't want to mix animation and Lit\n // render timing\n surfaceEl.classList.toggle('animating', true);\n const signal = this.openCloseAnimationSignal.start();\n const height = surfaceEl.offsetHeight;\n const children = this.items;\n const FULL_DURATION = 150;\n const SURFACE_OPACITY_DURATION = 50;\n // The surface fades away at the very end\n const SURFACE_OPACITY_DELAY = FULL_DURATION - SURFACE_OPACITY_DURATION;\n const ITEM_OPACITY_DURATION = 50;\n const ITEM_OPACITY_INITIAL_DELAY = 50;\n const END_HEIGHT_PERCENTAGE = 0.35;\n\n // We want to fit every child fade-out animation within the full duration of\n // the animation.\n const DELAY_BETWEEN_ITEMS =\n (FULL_DURATION - ITEM_OPACITY_INITIAL_DELAY - ITEM_OPACITY_DURATION) /\n children.length;\n\n // The mock has the animation shrink to 35%\n const surfaceHeightAnimation = surfaceEl.animate(\n [\n {height: `${height}px`},\n {height: `${height * END_HEIGHT_PERCENTAGE}px`},\n ],\n {\n duration: FULL_DURATION,\n easing: EASING.EMPHASIZED_ACCELERATE,\n },\n );\n\n // When we are closing downwards, we want to make sure the last item is\n // always in view, so we need to translate it upwards the opposite direction\n // of the height animation\n const downPositionCorrectionAnimation = slotEl.animate(\n [\n {transform: ''},\n {\n transform: closingDownwards\n ? `translateY(-${height * (1 - END_HEIGHT_PERCENTAGE)}px)`\n : '',\n },\n ],\n {duration: FULL_DURATION, easing: EASING.EMPHASIZED_ACCELERATE},\n );\n\n const surfaceOpacityAnimation = surfaceEl.animate(\n [{opacity: 1}, {opacity: 0}],\n {duration: SURFACE_OPACITY_DURATION, delay: SURFACE_OPACITY_DELAY},\n );\n\n const childrenAnimations: Array<[HTMLElement, Animation]> = [];\n\n for (let i = 0; i < children.length; i++) {\n // If the animation is closing upwards, then reverse the list of\n // children so that we animate in the opposite direction.\n const directionalIndex = closingDownwards ? i : children.length - 1 - i;\n const child = children[directionalIndex];\n const animation = child.animate([{opacity: 1}, {opacity: 0}], {\n duration: ITEM_OPACITY_DURATION,\n delay: ITEM_OPACITY_INITIAL_DELAY + DELAY_BETWEEN_ITEMS * i,\n });\n\n // Make sure the items stay hidden at the end of each child animation.\n // We clean this up at the end of the overall animation.\n animation.addEventListener('finish', () => {\n child.classList.toggle('md-menu-hidden', true);\n });\n childrenAnimations.push([child, animation]);\n }\n\n signal.addEventListener('abort', () => {\n surfaceHeightAnimation.cancel();\n downPositionCorrectionAnimation.cancel();\n surfaceOpacityAnimation.cancel();\n childrenAnimations.forEach(([child, animation]) => {\n animation.cancel();\n child.classList.toggle('md-menu-hidden', false);\n });\n resolve(false);\n });\n\n surfaceHeightAnimation.addEventListener('finish', () => {\n surfaceEl.classList.toggle('animating', false);\n childrenAnimations.forEach(([child]) => {\n child.classList.toggle('md-menu-hidden', false);\n });\n this.openCloseAnimationSignal.finish();\n this.dispatchEvent(new Event('closed'));\n resolve(true);\n });\n\n return animationEnded;\n }\n\n private handleKeydown(event: KeyboardEvent) {\n // At any key event, the pointer interaction is done so we need to clear our\n // cached pointerpath. This handles the case where the user clicks on the\n // anchor, and then hits shift+tab\n this.pointerPath = [];\n this.listController.handleKeydown(event);\n }\n\n private setUpGlobalEventListeners() {\n document.addEventListener('click', this.onDocumentClick, {capture: true});\n window.addEventListener('pointerdown', this.onWindowPointerdown);\n document.addEventListener('resize', this.onWindowResize, {passive: true});\n window.addEventListener('resize', this.onWindowResize, {passive: true});\n }\n\n private cleanUpGlobalEventListeners() {\n document.removeEventListener('click', this.onDocumentClick, {\n capture: true,\n });\n window.removeEventListener('pointerdown', this.onWindowPointerdown);\n document.removeEventListener('resize', this.onWindowResize);\n window.removeEventListener('resize', this.onWindowResize);\n }\n\n private readonly onWindowPointerdown = (event: PointerEvent) => {\n this.pointerPath = event.composedPath();\n };\n\n /**\n * We cannot listen to window click because Safari on iOS will not bubble a\n * click event on window if the item clicked is not a \"clickable\" item such as\n * <body>\n */\n private readonly onDocumentClick = (event: Event) => {\n if (!this.open) {\n return;\n }\n\n const path = event.composedPath();\n\n if (\n !this.stayOpenOnOutsideClick &&\n !path.includes(this) &&\n !path.includes(this.anchorElement!)\n ) {\n this.open = false;\n }\n };\n\n private onCloseMenu() {\n this.close();\n }\n\n private onDeactivateItems(event: Event) {\n event.stopPropagation();\n this.listController.onDeactivateItems();\n }\n\n private onRequestActivation(event: Event) {\n event.stopPropagation();\n this.listController.onRequestActivation(event);\n }\n\n private handleDeactivateTypeahead(event: DeactivateTypeaheadEvent) {\n // stopPropagation so that this does not deactivate any typeaheads in menus\n // nested above it e.g. md-sub-menu\n event.stopPropagation();\n this.typeaheadActive = false;\n }\n\n private handleActivateTypeahead(event: ActivateTypeaheadEvent) {\n // stopPropagation so that this does not activate any typeaheads in menus\n // nested above it e.g. md-sub-menu\n event.stopPropagation();\n this.typeaheadActive = true;\n }\n\n private handleStayOpenOnFocusout(event: Event) {\n event.stopPropagation();\n this.stayOpenOnFocusout = true;\n }\n\n private handleCloseOnFocusout(event: Event) {\n event.stopPropagation();\n this.stayOpenOnFocusout = false;\n }\n\n close() {\n this.open = false;\n const maybeSubmenu = this.slotItems as Array<\n HTMLElement & {close?: () => void}\n >;\n maybeSubmenu.forEach((item) => {\n item.close?.();\n });\n }\n\n show() {\n this.open = true;\n }\n\n /**\n * Activates the next item in the menu. If at the end of the menu, the first\n * item will be activated.\n *\n * @return The activated menu item or `null` if there are no items.\n */\n activateNextItem() {\n return this.listController.activateNextItem() ?? null;\n }\n\n /**\n * Activates the previous item in the menu. If at the start of the menu, the\n * last item will be activated.\n *\n * @return The activated menu item or `null` if there are no items.\n */\n activatePreviousItem() {\n return this.listController.activatePreviousItem() ?? null;\n }\n\n /**\n * Repositions the menu if it is open.\n *\n * Useful for the case where document or window-positioned menus have their\n * anchors moved while open.\n */\n reposition() {\n if (this.open) {\n this.menuPositionController.position();\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@material/web",
|
|
3
|
-
"version": "1.5.1
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -60,19 +60,19 @@
|
|
|
60
60
|
"tslib": "^2.4.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@lit-labs/analyzer": "^0.
|
|
63
|
+
"@lit-labs/analyzer": "^0.12.1",
|
|
64
64
|
"@rollup/plugin-multi-entry": "^6.0.1",
|
|
65
65
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
66
66
|
"@rollup/plugin-terser": "^0.4.4",
|
|
67
67
|
"@types/jasmine": "^4.0.3",
|
|
68
|
-
"@web/test-runner": "^0.
|
|
68
|
+
"@web/test-runner": "^0.18.2",
|
|
69
69
|
"@web/test-runner-playwright": "^0.9.0",
|
|
70
70
|
"jasmine": "^4.5.0",
|
|
71
71
|
"rollup": "^2.79.1",
|
|
72
72
|
"sass": "^1.52.3",
|
|
73
73
|
"sass-true": "^6.1.0",
|
|
74
74
|
"typescript": "5.1.6",
|
|
75
|
-
"web-test-runner-jasmine": "^0.0.
|
|
75
|
+
"web-test-runner-jasmine": "^0.0.6",
|
|
76
76
|
"wireit": "^0.13.0"
|
|
77
77
|
},
|
|
78
78
|
"wireit": {
|
|
@@ -125,7 +125,7 @@ export declare abstract class Select extends selectBaseClass {
|
|
|
125
125
|
/**
|
|
126
126
|
* Returns an array of selected options.
|
|
127
127
|
*
|
|
128
|
-
* NOTE: md-select only
|
|
128
|
+
* NOTE: md-select only supports single selection.
|
|
129
129
|
*/
|
|
130
130
|
get selectedOptions(): SelectOption[];
|
|
131
131
|
protected abstract readonly fieldTag: StaticValue;
|
|
@@ -79,7 +79,7 @@ export class Select extends selectBaseClass {
|
|
|
79
79
|
/**
|
|
80
80
|
* Returns an array of selected options.
|
|
81
81
|
*
|
|
82
|
-
* NOTE: md-select only
|
|
82
|
+
* NOTE: md-select only supports single selection.
|
|
83
83
|
*/
|
|
84
84
|
get selectedOptions() {
|
|
85
85
|
return (this.getSelectedOptions() ?? []).map(([option]) => option);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["select.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,IAAI,UAAU,EAAc,MAAM,oBAAoB,CAAC;AAInE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAC,eAAe,EAAC,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAC,qBAAqB,EAAC,MAAM,2CAA2C,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,qBA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AI,EAAC,CAAC;qCAAe;AAUxD;IADC,QAAQ,CAAC,EAAC,SAAS,EAAE,kBAAkB,EAAC,CAAC;+CACoB;AAM9D;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAC,CAAC;8CAClC;AAOvB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAC,CAAC;8CACR;AAM/C;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAC,CAAC;8CAClC;AAKgB;IAAtC,QAAQ,CAAC,EAAC,SAAS,EAAE,cAAc,EAAC,CAAC;2CAAkB;AAMnB;IAApC,QAAQ,CAAC,EAAC,SAAS,EAAE,YAAY,EAAC,CAAC;yCAAsC;AAS1E;IADC,QAAQ,EAAE;mCAGV;AAuBD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAC,CAAC;2CAKrD;AAwCgB;IAAhB,KAAK,EAAE;2CAA6B;AAMpB;IAAhB,KAAK,EAAE;+CAA8B;AAKrB;IAAhB,KAAK,EAAE;uCAAyB;AAChB;IAAhB,KAAK,EAAE;oCAAsB;AACb;IAAhB,KAAK,EAAE;4CAAoD;AAC1B;IAAjC,KAAK,CAAC,QAAQ,CAAC;qCAAuC;AACpB;IAAlC,KAAK,CAAC,SAAS,CAAC;oCAAqC;AACpB;IAAjC,KAAK,CAAC,QAAQ,CAAC;uCAAwC;AAEvC;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CACnB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../menu/menu.js';\n\nimport {html, isServer, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {html as staticHtml, StaticValue} from 'lit/static-html.js';\n\nimport {Field} from '../../field/internal/field.js';\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {\n mixinOnReportValidity,\n onReportValidity,\n} from '../../labs/behaviors/on-report-validity.js';\nimport {SelectValidator} from '../../labs/behaviors/validators/select-validator.js';\nimport {getActiveItem} from '../../list/internal/list-navigation-helpers.js';\nimport {\n CloseMenuEvent,\n FocusState,\n isElementInSubtree,\n isSelectableKey,\n} from '../../menu/internal/controllers/shared.js';\nimport {TYPEAHEAD_RECORD} from '../../menu/internal/controllers/typeaheadController.js';\nimport {DEFAULT_TYPEAHEAD_BUFFER_TIME, Menu} from '../../menu/internal/menu.js';\nimport {SelectOption} from './selectoption/select-option.js';\nimport {\n createRequestDeselectionEvent,\n createRequestSelectionEvent,\n} from './selectoption/selectOptionController.js';\nimport {getSelectedItems, SelectOptionRecord} from './shared.js';\n\nconst VALUE = Symbol('value');\n\n// Separate variable needed for closure.\nconst selectBaseClass = mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n);\n\n/**\n * @fires change {Event} The native `change` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)\n * --bubbles\n * @fires input {InputEvent} The native `input` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)\n * --bubbles --composed\n * @fires opening {Event} Fired when the select's menu is about to open.\n * @fires opened {Event} Fired when the select's menu has finished animations\n * and opened.\n * @fires closing {Event} Fired when the select's menu is about to close.\n * @fires closed {Event} Fired when the select's menu has finished animations\n * and closed.\n */\nexport abstract class Select extends selectBaseClass {\n static {\n requestUpdateOnAriaChange(Select);\n }\n\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Opens the menu synchronously with no animation.\n */\n @property({type: Boolean}) quick = false;\n\n /**\n * Whether or not the select is required.\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * This error message overrides the error message displayed by\n * `reportValidity()`.\n */\n @property({type: String, attribute: 'error-text'}) errorText = '';\n\n /**\n * The floating label for the field.\n */\n @property() label = '';\n\n /**\n * Disables the asterisk on the floating label, when the select is\n * required.\n */\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n\n /**\n * Conveys additional information below the select, such as how it should\n * be used.\n */\n @property({type: String, attribute: 'supporting-text'}) supportingText = '';\n\n /**\n * Gets or sets whether or not the select is in a visually invalid state.\n *\n * This error state overrides the error state controlled by\n * `reportValidity()`.\n */\n @property({type: Boolean, reflect: true}) error = false;\n\n /**\n * Whether or not the underlying md-menu should be position: fixed to display\n * in a top-level manner, or position: absolute.\n *\n * position:fixed is useful for cases where select is inside of another\n * element with stacking context and hidden overflows such as `md-dialog`.\n */\n @property({attribute: 'menu-positioning'})\n menuPositioning: 'absolute' | 'fixed' | 'popover' = 'popover';\n\n /**\n * Clamps the menu-width to the width of the select.\n */\n @property({type: Boolean, attribute: 'clamp-menu-width'})\n clampMenuWidth = false;\n\n /**\n * The max time between the keystrokes of the typeahead select / menu behavior\n * before it clears the typeahead buffer.\n */\n @property({type: Number, attribute: 'typeahead-delay'})\n typeaheadDelay = DEFAULT_TYPEAHEAD_BUFFER_TIME;\n\n /**\n * Whether or not the text field has a leading icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-leading-icon'})\n hasLeadingIcon = false;\n\n /**\n * Text to display in the field. Only set for SSR.\n */\n @property({attribute: 'display-text'}) displayText = '';\n\n /**\n * Whether the menu should be aligned to the start or the end of the select's\n * textbox.\n */\n @property({attribute: 'menu-align'}) menuAlign: 'start' | 'end' = 'start';\n\n /**\n * The value of the currently selected option.\n *\n * Note: For SSR, set `[selected]` on the requested option and `displayText`\n * rather than setting `value` setting `value` will incur a DOM query.\n */\n @property()\n get value(): string {\n return this[VALUE];\n }\n\n set value(value: string) {\n if (isServer) return;\n this.lastUserSetValue = value;\n this.select(value);\n }\n\n [VALUE] = '';\n\n get options() {\n // NOTE: this does a DOM query.\n return (this.menu?.items ?? []) as SelectOption[];\n }\n\n /**\n * The index of the currently selected option.\n *\n * Note: For SSR, set `[selected]` on the requested option and `displayText`\n * rather than setting `selectedIndex` setting `selectedIndex` will incur a\n * DOM query.\n */\n @property({type: Number, attribute: 'selected-index'})\n get selectedIndex(): number {\n // tslint:disable-next-line:enforce-name-casing\n const [_option, index] = (this.getSelectedOptions() ?? [])[0] ?? [];\n return index ?? -1;\n }\n\n set selectedIndex(index: number) {\n this.lastUserSetSelectedIndex = index;\n this.selectIndex(index);\n }\n\n /**\n * Returns an array of selected options.\n *\n * NOTE: md-select only suppoprts single selection.\n */\n get selectedOptions() {\n return (this.getSelectedOptions() ?? []).map(([option]) => option);\n }\n\n protected abstract readonly fieldTag: StaticValue;\n\n /**\n * Used for initializing select when the user sets the `value` directly.\n */\n private lastUserSetValue: string | null = null;\n\n /**\n * Used for initializing select when the user sets the `selectedIndex`\n * directly.\n */\n private lastUserSetSelectedIndex: number | null = null;\n\n /**\n * Used for `input` and `change` event change detection.\n */\n private lastSelectedOption: SelectOption | null = null;\n\n // tslint:disable-next-line:enforce-name-casing\n private lastSelectedOptionRecords: SelectOptionRecord[] = [];\n\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n private get hasError() {\n return this.error || this.nativeError;\n }\n\n @state() private focused = false;\n @state() private open = false;\n @state() private defaultFocus: FocusState = FocusState.NONE;\n @query('.field') private readonly field!: Field | null;\n @query('md-menu') private readonly menu!: Menu | null;\n @query('#label') private readonly labelEl!: HTMLElement;\n @queryAssignedElements({slot: 'leading-icon', flatten: true})\n private readonly leadingIcons!: Element[];\n // Have to keep track of previous open because it's state and private and thus\n // cannot be tracked in PropertyValues<this> map.\n private prevOpen = this.open;\n private selectWidth = 0;\n\n constructor() {\n super();\n if (isServer) {\n return;\n }\n\n this.addEventListener('focus', this.handleFocus.bind(this));\n this.addEventListener('blur', this.handleBlur.bind(this));\n }\n\n /**\n * Selects an option given the value of the option, and updates MdSelect's\n * value.\n */\n select(value: string) {\n const optionToSelect = this.options.find(\n (option) => option.value === value,\n );\n if (optionToSelect) {\n this.selectItem(optionToSelect);\n }\n }\n\n /**\n * Selects an option given the index of the option, and updates MdSelect's\n * value.\n */\n selectIndex(index: number) {\n const optionToSelect = this.options[index];\n if (optionToSelect) {\n this.selectItem(optionToSelect);\n }\n }\n\n /**\n * Reset the select to its default value.\n */\n reset() {\n for (const option of this.options) {\n option.selected = option.hasAttribute('selected');\n }\n\n this.updateValueAndDisplayText();\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n [onReportValidity](invalidEvent: Event | null) {\n // Prevent default pop-up behavior.\n invalidEvent?.preventDefault();\n\n const prevMessage = this.getErrorText();\n this.nativeError = !!invalidEvent;\n this.nativeErrorText = this.validationMessage;\n\n if (prevMessage === this.getErrorText()) {\n this.field?.reannounceError();\n }\n }\n\n protected override update(changed: PropertyValues<Select>) {\n // In SSR the options will be ready to query, so try to figure out what\n // the value and display text should be.\n if (!this.hasUpdated) {\n this.initUserSelection();\n }\n\n // We have just opened the menu.\n // We are only able to check for the select's rect in `update()` instead of\n // having to wait for `updated()` because the menu can never be open on\n // first render since it is not settable and Lit SSR does not support click\n // events which would open the menu.\n if (this.prevOpen !== this.open && this.open) {\n const selectRect = this.getBoundingClientRect();\n this.selectWidth = selectRect.width;\n }\n\n this.prevOpen = this.open;\n super.update(changed);\n }\n\n protected override render() {\n return html`\n <span\n class=\"select ${classMap(this.getRenderClasses())}\"\n @focusout=${this.handleFocusout}>\n ${this.renderField()} ${this.renderMenu()}\n </span>\n `;\n }\n\n protected override async firstUpdated(changed: PropertyValues<Select>) {\n await this.menu?.updateComplete;\n // If this has been handled on update already due to SSR, try again.\n if (!this.lastSelectedOptionRecords.length) {\n this.initUserSelection();\n }\n\n // Case for when the DOM is streaming, there are no children, and a child\n // has [selected] set on it, we need to wait for DOM to render something.\n if (\n !this.lastSelectedOptionRecords.length &&\n !isServer &&\n !this.options.length\n ) {\n setTimeout(() => {\n this.updateValueAndDisplayText();\n });\n }\n\n super.firstUpdated(changed);\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'disabled': this.disabled,\n 'error': this.error,\n 'open': this.open,\n };\n }\n\n private renderField() {\n return staticHtml`\n <${this.fieldTag}\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n part=\"field\"\n id=\"field\"\n tabindex=${this.disabled ? '-1' : '0'}\n aria-label=${(this as ARIAMixinStrict).ariaLabel || nothing}\n aria-describedby=\"description\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-controls=\"listbox\"\n class=\"field\"\n label=${this.label}\n ?no-asterisk=${this.noAsterisk}\n .focused=${this.focused || this.open}\n .populated=${!!this.displayText}\n .disabled=${this.disabled}\n .required=${this.required}\n .error=${this.hasError}\n ?has-start=${this.hasLeadingIcon}\n has-end\n supporting-text=${this.supportingText}\n error-text=${this.getErrorText()}\n @keydown=${this.handleKeydown}\n @click=${this.handleClick}>\n ${this.renderFieldContent()}\n <div id=\"description\" slot=\"aria-describedby\"></div>\n </${this.fieldTag}>`;\n }\n\n private renderFieldContent() {\n return [\n this.renderLeadingIcon(),\n this.renderLabel(),\n this.renderTrailingIcon(),\n ];\n }\n\n private renderLeadingIcon() {\n return html`\n <span class=\"icon leading\" slot=\"start\">\n <slot name=\"leading-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderTrailingIcon() {\n return html`\n <span class=\"icon trailing\" slot=\"end\">\n <slot name=\"trailing-icon\" @slotchange=${this.handleIconChange}>\n <svg height=\"5\" viewBox=\"7 10 10 5\" focusable=\"false\">\n <polygon\n class=\"down\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 10 12 15 17 10\"></polygon>\n <polygon\n class=\"up\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 15 12 10 17 15\"></polygon>\n </svg>\n </slot>\n </span>\n `;\n }\n\n private renderLabel() {\n // need to render so that line-height can apply and give it a\n // non-zero height\n return html`<div id=\"label\">${this.displayText || html` `}</div>`;\n }\n\n private renderMenu() {\n const ariaLabel = this.label || (this as ARIAMixinStrict).ariaLabel;\n return html`<div class=\"menu-wrapper\">\n <md-menu\n id=\"listbox\"\n .defaultFocus=${this.defaultFocus}\n role=\"listbox\"\n tabindex=\"-1\"\n aria-label=${ariaLabel || nothing}\n stay-open-on-focusout\n part=\"menu\"\n exportparts=\"focus-ring: menu-focus-ring\"\n anchor=\"field\"\n style=${styleMap({\n '--__menu-min-width': `${this.selectWidth}px`,\n '--__menu-max-width': this.clampMenuWidth\n ? `${this.selectWidth}px`\n : undefined,\n })}\n no-navigation-wrap\n .open=${this.open}\n .quick=${this.quick}\n .positioning=${this.menuPositioning}\n .typeaheadDelay=${this.typeaheadDelay}\n .anchorCorner=${this.menuAlign === 'start' ? 'end-start' : 'end-end'}\n .menuCorner=${this.menuAlign === 'start' ? 'start-start' : 'start-end'}\n @opening=${this.handleOpening}\n @opened=${this.redispatchEvent}\n @closing=${this.redispatchEvent}\n @closed=${this.handleClosed}\n @close-menu=${this.handleCloseMenu}\n @request-selection=${this.handleRequestSelection}\n @request-deselection=${this.handleRequestDeselection}>\n ${this.renderMenuContent()}\n </md-menu>\n </div>`;\n }\n\n private renderMenuContent() {\n return html`<slot></slot>`;\n }\n\n /**\n * Handles opening the select on keydown and typahead selection when the menu\n * is closed.\n */\n private handleKeydown(event: KeyboardEvent) {\n if (this.open || this.disabled || !this.menu) {\n return;\n }\n\n const typeaheadController = this.menu.typeaheadController;\n const isOpenKey =\n event.code === 'Space' ||\n event.code === 'ArrowDown' ||\n event.code === 'ArrowUp' ||\n event.code === 'End' ||\n event.code === 'Home' ||\n event.code === 'Enter';\n\n // Do not open if currently typing ahead because the user may be typing the\n // spacebar to match a word with a space\n if (!typeaheadController.isTypingAhead && isOpenKey) {\n event.preventDefault();\n this.open = true;\n\n // https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/#kbd_label\n switch (event.code) {\n case 'Space':\n case 'ArrowDown':\n case 'Enter':\n // We will handle focusing last selected item in this.handleOpening()\n this.defaultFocus = FocusState.NONE;\n break;\n case 'End':\n this.defaultFocus = FocusState.LAST_ITEM;\n break;\n case 'ArrowUp':\n case 'Home':\n this.defaultFocus = FocusState.FIRST_ITEM;\n break;\n default:\n break;\n }\n return;\n }\n\n const isPrintableKey = event.key.length === 1;\n\n // Handles typing ahead when the menu is closed by delegating the event to\n // the underlying menu's typeaheadController\n if (isPrintableKey) {\n typeaheadController.onKeydown(event);\n event.preventDefault();\n\n const {lastActiveRecord} = typeaheadController;\n\n if (!lastActiveRecord) {\n return;\n }\n\n this.labelEl?.setAttribute?.('aria-live', 'polite');\n const hasChanged = this.selectItem(\n lastActiveRecord[TYPEAHEAD_RECORD.ITEM] as SelectOption,\n );\n\n if (hasChanged) {\n this.dispatchInteractionEvents();\n }\n }\n }\n\n private handleClick() {\n this.open = !this.open;\n }\n\n private handleFocus() {\n this.focused = true;\n }\n\n private handleBlur() {\n this.focused = false;\n }\n\n /**\n * Handles closing the menu when the focus leaves the select's subtree.\n */\n private handleFocusout(event: FocusEvent) {\n // Don't close the menu if we are switching focus between menu,\n // select-option, and field\n if (event.relatedTarget && isElementInSubtree(event.relatedTarget, this)) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Gets a list of all selected select options as a list item record array.\n *\n * @return An array of selected list option records.\n */\n private getSelectedOptions() {\n if (!this.menu) {\n this.lastSelectedOptionRecords = [];\n return null;\n }\n\n const items = this.menu.items as SelectOption[];\n this.lastSelectedOptionRecords = getSelectedItems(items);\n return this.lastSelectedOptionRecords;\n }\n\n override async getUpdateComplete() {\n await this.menu?.updateComplete;\n return super.getUpdateComplete();\n }\n\n /**\n * Gets the selected options from the DOM, and updates the value and display\n * text to the first selected option's value and headline respectively.\n *\n * @return Whether or not the selected option has changed since last update.\n */\n private updateValueAndDisplayText() {\n const selectedOptions = this.getSelectedOptions() ?? [];\n // Used to determine whether or not we need to fire an input / change event\n // which fire whenever the option element changes (value or selectedIndex)\n // on user interaction.\n let hasSelectedOptionChanged = false;\n\n if (selectedOptions.length) {\n const [firstSelectedOption] = selectedOptions[0];\n hasSelectedOptionChanged =\n this.lastSelectedOption !== firstSelectedOption;\n this.lastSelectedOption = firstSelectedOption;\n this[VALUE] = firstSelectedOption.value;\n this.displayText = firstSelectedOption.displayText;\n } else {\n hasSelectedOptionChanged = this.lastSelectedOption !== null;\n this.lastSelectedOption = null;\n this[VALUE] = '';\n this.displayText = '';\n }\n\n return hasSelectedOptionChanged;\n }\n\n /**\n * Focuses and activates the last selected item upon opening, and resets other\n * active items.\n */\n private async handleOpening(e: Event) {\n this.labelEl?.removeAttribute?.('aria-live');\n this.redispatchEvent(e);\n\n // FocusState.NONE means we want to handle focus ourselves and focus the\n // last selected item.\n if (this.defaultFocus !== FocusState.NONE) {\n return;\n }\n\n const items = this.menu!.items as SelectOption[];\n const activeItem = getActiveItem(items)?.item;\n let [selectedItem] = this.lastSelectedOptionRecords[0] ?? [null];\n\n // This is true if the user keys through the list but clicks out of the menu\n // thus no close-menu event is fired by an item and we can't clean up in\n // handleCloseMenu.\n if (activeItem && activeItem !== selectedItem) {\n activeItem.tabIndex = -1;\n }\n\n // in the case that nothing is selected, focus the first item\n selectedItem = selectedItem ?? items[0];\n\n if (selectedItem) {\n selectedItem.tabIndex = 0;\n selectedItem.focus();\n }\n }\n\n private redispatchEvent(e: Event) {\n redispatchEvent(this, e);\n }\n\n private handleClosed(e: Event) {\n this.open = false;\n this.redispatchEvent(e);\n }\n\n /**\n * Determines the reason for closing, and updates the UI accordingly.\n */\n private handleCloseMenu(event: CloseMenuEvent) {\n const reason = event.detail.reason;\n const item = event.detail.itemPath[0] as SelectOption;\n this.open = false;\n let hasChanged = false;\n\n if (reason.kind === 'click-selection') {\n hasChanged = this.selectItem(item);\n } else if (reason.kind === 'keydown' && isSelectableKey(reason.key)) {\n hasChanged = this.selectItem(item);\n } else {\n // This can happen on ESC being pressed\n item.tabIndex = -1;\n item.blur();\n }\n\n // Dispatch interaction events since selection has been made via keyboard\n // or mouse.\n if (hasChanged) {\n this.dispatchInteractionEvents();\n }\n }\n\n /**\n * Selects a given option, deselects other options, and updates the UI.\n *\n * @return Whether the last selected option has changed.\n */\n private selectItem(item: SelectOption) {\n const selectedOptions = this.getSelectedOptions() ?? [];\n selectedOptions.forEach(([option]) => {\n if (item !== option) {\n option.selected = false;\n }\n });\n item.selected = true;\n\n return this.updateValueAndDisplayText();\n }\n\n /**\n * Handles updating selection when an option element requests selection via\n * property / attribute change.\n */\n private handleRequestSelection(\n event: ReturnType<typeof createRequestSelectionEvent>,\n ) {\n const requestingOptionEl = event.target as SelectOption & HTMLElement;\n\n // No-op if this item is already selected.\n if (\n this.lastSelectedOptionRecords.some(\n ([option]) => option === requestingOptionEl,\n )\n ) {\n return;\n }\n\n this.selectItem(requestingOptionEl);\n }\n\n /**\n * Handles updating selection when an option element requests deselection via\n * property / attribute change.\n */\n private handleRequestDeselection(\n event: ReturnType<typeof createRequestDeselectionEvent>,\n ) {\n const requestingOptionEl = event.target as SelectOption & HTMLElement;\n\n // No-op if this item is not even in the list of tracked selected items.\n if (\n !this.lastSelectedOptionRecords.some(\n ([option]) => option === requestingOptionEl,\n )\n ) {\n return;\n }\n\n this.updateValueAndDisplayText();\n }\n\n /**\n * Attempts to initialize the selected option from user-settable values like\n * SSR, setting `value`, or `selectedIndex` at startup.\n */\n private initUserSelection() {\n // User has set `.value` directly, but internals have not yet booted up.\n if (this.lastUserSetValue && !this.lastSelectedOptionRecords.length) {\n this.select(this.lastUserSetValue);\n\n // User has set `.selectedIndex` directly, but internals have not yet\n // booted up.\n } else if (\n this.lastUserSetSelectedIndex !== null &&\n !this.lastSelectedOptionRecords.length\n ) {\n this.selectIndex(this.lastUserSetSelectedIndex);\n\n // Regular boot up!\n } else {\n this.updateValueAndDisplayText();\n }\n }\n\n private handleIconChange() {\n this.hasLeadingIcon = this.leadingIcons.length > 0;\n }\n\n /**\n * Dispatches the `input` and `change` events.\n */\n private dispatchInteractionEvents() {\n this.dispatchEvent(new Event('input', {bubbles: true, composed: true}));\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.value;\n }\n\n override formResetCallback() {\n this.reset();\n }\n\n override formStateRestoreCallback(state: string) {\n this.value = state;\n }\n\n override click() {\n this.field?.click();\n }\n\n [createValidator]() {\n return new SelectValidator(() => this);\n }\n\n [getValidityAnchor]() {\n return this.field;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"select.js","sourceRoot":"","sources":["select.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE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KAAK,EAAE;4CAAoD;AAC1B;IAAjC,KAAK,CAAC,QAAQ,CAAC;qCAAuC;AACpB;IAAlC,KAAK,CAAC,SAAS,CAAC;oCAAqC;AACpB;IAAjC,KAAK,CAAC,QAAQ,CAAC;uCAAwC;AAEvC;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CACnB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../menu/menu.js';\n\nimport {html, isServer, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {html as staticHtml, StaticValue} from 'lit/static-html.js';\n\nimport {Field} from '../../field/internal/field.js';\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {\n mixinOnReportValidity,\n onReportValidity,\n} from '../../labs/behaviors/on-report-validity.js';\nimport {SelectValidator} from '../../labs/behaviors/validators/select-validator.js';\nimport {getActiveItem} from '../../list/internal/list-navigation-helpers.js';\nimport {\n CloseMenuEvent,\n FocusState,\n isElementInSubtree,\n isSelectableKey,\n} from '../../menu/internal/controllers/shared.js';\nimport {TYPEAHEAD_RECORD} from '../../menu/internal/controllers/typeaheadController.js';\nimport {DEFAULT_TYPEAHEAD_BUFFER_TIME, Menu} from '../../menu/internal/menu.js';\nimport {SelectOption} from './selectoption/select-option.js';\nimport {\n createRequestDeselectionEvent,\n createRequestSelectionEvent,\n} from './selectoption/selectOptionController.js';\nimport {getSelectedItems, SelectOptionRecord} from './shared.js';\n\nconst VALUE = Symbol('value');\n\n// Separate variable needed for closure.\nconst selectBaseClass = mixinOnReportValidity(\n mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n ),\n);\n\n/**\n * @fires change {Event} The native `change` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)\n * --bubbles\n * @fires input {InputEvent} The native `input` event on\n * [`<input>`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event)\n * --bubbles --composed\n * @fires opening {Event} Fired when the select's menu is about to open.\n * @fires opened {Event} Fired when the select's menu has finished animations\n * and opened.\n * @fires closing {Event} Fired when the select's menu is about to close.\n * @fires closed {Event} Fired when the select's menu has finished animations\n * and closed.\n */\nexport abstract class Select extends selectBaseClass {\n static {\n requestUpdateOnAriaChange(Select);\n }\n\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Opens the menu synchronously with no animation.\n */\n @property({type: Boolean}) quick = false;\n\n /**\n * Whether or not the select is required.\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The error message that replaces supporting text when `error` is true. If\n * `errorText` is an empty string, then the supporting text will continue to\n * show.\n *\n * This error message overrides the error message displayed by\n * `reportValidity()`.\n */\n @property({type: String, attribute: 'error-text'}) errorText = '';\n\n /**\n * The floating label for the field.\n */\n @property() label = '';\n\n /**\n * Disables the asterisk on the floating label, when the select is\n * required.\n */\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n\n /**\n * Conveys additional information below the select, such as how it should\n * be used.\n */\n @property({type: String, attribute: 'supporting-text'}) supportingText = '';\n\n /**\n * Gets or sets whether or not the select is in a visually invalid state.\n *\n * This error state overrides the error state controlled by\n * `reportValidity()`.\n */\n @property({type: Boolean, reflect: true}) error = false;\n\n /**\n * Whether or not the underlying md-menu should be position: fixed to display\n * in a top-level manner, or position: absolute.\n *\n * position:fixed is useful for cases where select is inside of another\n * element with stacking context and hidden overflows such as `md-dialog`.\n */\n @property({attribute: 'menu-positioning'})\n menuPositioning: 'absolute' | 'fixed' | 'popover' = 'popover';\n\n /**\n * Clamps the menu-width to the width of the select.\n */\n @property({type: Boolean, attribute: 'clamp-menu-width'})\n clampMenuWidth = false;\n\n /**\n * The max time between the keystrokes of the typeahead select / menu behavior\n * before it clears the typeahead buffer.\n */\n @property({type: Number, attribute: 'typeahead-delay'})\n typeaheadDelay = DEFAULT_TYPEAHEAD_BUFFER_TIME;\n\n /**\n * Whether or not the text field has a leading icon. Used for SSR.\n */\n @property({type: Boolean, attribute: 'has-leading-icon'})\n hasLeadingIcon = false;\n\n /**\n * Text to display in the field. Only set for SSR.\n */\n @property({attribute: 'display-text'}) displayText = '';\n\n /**\n * Whether the menu should be aligned to the start or the end of the select's\n * textbox.\n */\n @property({attribute: 'menu-align'}) menuAlign: 'start' | 'end' = 'start';\n\n /**\n * The value of the currently selected option.\n *\n * Note: For SSR, set `[selected]` on the requested option and `displayText`\n * rather than setting `value` setting `value` will incur a DOM query.\n */\n @property()\n get value(): string {\n return this[VALUE];\n }\n\n set value(value: string) {\n if (isServer) return;\n this.lastUserSetValue = value;\n this.select(value);\n }\n\n [VALUE] = '';\n\n get options() {\n // NOTE: this does a DOM query.\n return (this.menu?.items ?? []) as SelectOption[];\n }\n\n /**\n * The index of the currently selected option.\n *\n * Note: For SSR, set `[selected]` on the requested option and `displayText`\n * rather than setting `selectedIndex` setting `selectedIndex` will incur a\n * DOM query.\n */\n @property({type: Number, attribute: 'selected-index'})\n get selectedIndex(): number {\n // tslint:disable-next-line:enforce-name-casing\n const [_option, index] = (this.getSelectedOptions() ?? [])[0] ?? [];\n return index ?? -1;\n }\n\n set selectedIndex(index: number) {\n this.lastUserSetSelectedIndex = index;\n this.selectIndex(index);\n }\n\n /**\n * Returns an array of selected options.\n *\n * NOTE: md-select only supports single selection.\n */\n get selectedOptions() {\n return (this.getSelectedOptions() ?? []).map(([option]) => option);\n }\n\n protected abstract readonly fieldTag: StaticValue;\n\n /**\n * Used for initializing select when the user sets the `value` directly.\n */\n private lastUserSetValue: string | null = null;\n\n /**\n * Used for initializing select when the user sets the `selectedIndex`\n * directly.\n */\n private lastUserSetSelectedIndex: number | null = null;\n\n /**\n * Used for `input` and `change` event change detection.\n */\n private lastSelectedOption: SelectOption | null = null;\n\n // tslint:disable-next-line:enforce-name-casing\n private lastSelectedOptionRecords: SelectOptionRecord[] = [];\n\n /**\n * Whether or not a native error has been reported via `reportValidity()`.\n */\n @state() private nativeError = false;\n\n /**\n * The validation message displayed from a native error via\n * `reportValidity()`.\n */\n @state() private nativeErrorText = '';\n private get hasError() {\n return this.error || this.nativeError;\n }\n\n @state() private focused = false;\n @state() private open = false;\n @state() private defaultFocus: FocusState = FocusState.NONE;\n @query('.field') private readonly field!: Field | null;\n @query('md-menu') private readonly menu!: Menu | null;\n @query('#label') private readonly labelEl!: HTMLElement;\n @queryAssignedElements({slot: 'leading-icon', flatten: true})\n private readonly leadingIcons!: Element[];\n // Have to keep track of previous open because it's state and private and thus\n // cannot be tracked in PropertyValues<this> map.\n private prevOpen = this.open;\n private selectWidth = 0;\n\n constructor() {\n super();\n if (isServer) {\n return;\n }\n\n this.addEventListener('focus', this.handleFocus.bind(this));\n this.addEventListener('blur', this.handleBlur.bind(this));\n }\n\n /**\n * Selects an option given the value of the option, and updates MdSelect's\n * value.\n */\n select(value: string) {\n const optionToSelect = this.options.find(\n (option) => option.value === value,\n );\n if (optionToSelect) {\n this.selectItem(optionToSelect);\n }\n }\n\n /**\n * Selects an option given the index of the option, and updates MdSelect's\n * value.\n */\n selectIndex(index: number) {\n const optionToSelect = this.options[index];\n if (optionToSelect) {\n this.selectItem(optionToSelect);\n }\n }\n\n /**\n * Reset the select to its default value.\n */\n reset() {\n for (const option of this.options) {\n option.selected = option.hasAttribute('selected');\n }\n\n this.updateValueAndDisplayText();\n this.nativeError = false;\n this.nativeErrorText = '';\n }\n\n [onReportValidity](invalidEvent: Event | null) {\n // Prevent default pop-up behavior.\n invalidEvent?.preventDefault();\n\n const prevMessage = this.getErrorText();\n this.nativeError = !!invalidEvent;\n this.nativeErrorText = this.validationMessage;\n\n if (prevMessage === this.getErrorText()) {\n this.field?.reannounceError();\n }\n }\n\n protected override update(changed: PropertyValues<Select>) {\n // In SSR the options will be ready to query, so try to figure out what\n // the value and display text should be.\n if (!this.hasUpdated) {\n this.initUserSelection();\n }\n\n // We have just opened the menu.\n // We are only able to check for the select's rect in `update()` instead of\n // having to wait for `updated()` because the menu can never be open on\n // first render since it is not settable and Lit SSR does not support click\n // events which would open the menu.\n if (this.prevOpen !== this.open && this.open) {\n const selectRect = this.getBoundingClientRect();\n this.selectWidth = selectRect.width;\n }\n\n this.prevOpen = this.open;\n super.update(changed);\n }\n\n protected override render() {\n return html`\n <span\n class=\"select ${classMap(this.getRenderClasses())}\"\n @focusout=${this.handleFocusout}>\n ${this.renderField()} ${this.renderMenu()}\n </span>\n `;\n }\n\n protected override async firstUpdated(changed: PropertyValues<Select>) {\n await this.menu?.updateComplete;\n // If this has been handled on update already due to SSR, try again.\n if (!this.lastSelectedOptionRecords.length) {\n this.initUserSelection();\n }\n\n // Case for when the DOM is streaming, there are no children, and a child\n // has [selected] set on it, we need to wait for DOM to render something.\n if (\n !this.lastSelectedOptionRecords.length &&\n !isServer &&\n !this.options.length\n ) {\n setTimeout(() => {\n this.updateValueAndDisplayText();\n });\n }\n\n super.firstUpdated(changed);\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'disabled': this.disabled,\n 'error': this.error,\n 'open': this.open,\n };\n }\n\n private renderField() {\n return staticHtml`\n <${this.fieldTag}\n aria-haspopup=\"listbox\"\n role=\"combobox\"\n part=\"field\"\n id=\"field\"\n tabindex=${this.disabled ? '-1' : '0'}\n aria-label=${(this as ARIAMixinStrict).ariaLabel || nothing}\n aria-describedby=\"description\"\n aria-expanded=${this.open ? 'true' : 'false'}\n aria-controls=\"listbox\"\n class=\"field\"\n label=${this.label}\n ?no-asterisk=${this.noAsterisk}\n .focused=${this.focused || this.open}\n .populated=${!!this.displayText}\n .disabled=${this.disabled}\n .required=${this.required}\n .error=${this.hasError}\n ?has-start=${this.hasLeadingIcon}\n has-end\n supporting-text=${this.supportingText}\n error-text=${this.getErrorText()}\n @keydown=${this.handleKeydown}\n @click=${this.handleClick}>\n ${this.renderFieldContent()}\n <div id=\"description\" slot=\"aria-describedby\"></div>\n </${this.fieldTag}>`;\n }\n\n private renderFieldContent() {\n return [\n this.renderLeadingIcon(),\n this.renderLabel(),\n this.renderTrailingIcon(),\n ];\n }\n\n private renderLeadingIcon() {\n return html`\n <span class=\"icon leading\" slot=\"start\">\n <slot name=\"leading-icon\" @slotchange=${this.handleIconChange}></slot>\n </span>\n `;\n }\n\n private renderTrailingIcon() {\n return html`\n <span class=\"icon trailing\" slot=\"end\">\n <slot name=\"trailing-icon\" @slotchange=${this.handleIconChange}>\n <svg height=\"5\" viewBox=\"7 10 10 5\" focusable=\"false\">\n <polygon\n class=\"down\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 10 12 15 17 10\"></polygon>\n <polygon\n class=\"up\"\n stroke=\"none\"\n fill-rule=\"evenodd\"\n points=\"7 15 12 10 17 15\"></polygon>\n </svg>\n </slot>\n </span>\n `;\n }\n\n private renderLabel() {\n // need to render so that line-height can apply and give it a\n // non-zero height\n return html`<div id=\"label\">${this.displayText || html` `}</div>`;\n }\n\n private renderMenu() {\n const ariaLabel = this.label || (this as ARIAMixinStrict).ariaLabel;\n return html`<div class=\"menu-wrapper\">\n <md-menu\n id=\"listbox\"\n .defaultFocus=${this.defaultFocus}\n role=\"listbox\"\n tabindex=\"-1\"\n aria-label=${ariaLabel || nothing}\n stay-open-on-focusout\n part=\"menu\"\n exportparts=\"focus-ring: menu-focus-ring\"\n anchor=\"field\"\n style=${styleMap({\n '--__menu-min-width': `${this.selectWidth}px`,\n '--__menu-max-width': this.clampMenuWidth\n ? `${this.selectWidth}px`\n : undefined,\n })}\n no-navigation-wrap\n .open=${this.open}\n .quick=${this.quick}\n .positioning=${this.menuPositioning}\n .typeaheadDelay=${this.typeaheadDelay}\n .anchorCorner=${this.menuAlign === 'start' ? 'end-start' : 'end-end'}\n .menuCorner=${this.menuAlign === 'start' ? 'start-start' : 'start-end'}\n @opening=${this.handleOpening}\n @opened=${this.redispatchEvent}\n @closing=${this.redispatchEvent}\n @closed=${this.handleClosed}\n @close-menu=${this.handleCloseMenu}\n @request-selection=${this.handleRequestSelection}\n @request-deselection=${this.handleRequestDeselection}>\n ${this.renderMenuContent()}\n </md-menu>\n </div>`;\n }\n\n private renderMenuContent() {\n return html`<slot></slot>`;\n }\n\n /**\n * Handles opening the select on keydown and typahead selection when the menu\n * is closed.\n */\n private handleKeydown(event: KeyboardEvent) {\n if (this.open || this.disabled || !this.menu) {\n return;\n }\n\n const typeaheadController = this.menu.typeaheadController;\n const isOpenKey =\n event.code === 'Space' ||\n event.code === 'ArrowDown' ||\n event.code === 'ArrowUp' ||\n event.code === 'End' ||\n event.code === 'Home' ||\n event.code === 'Enter';\n\n // Do not open if currently typing ahead because the user may be typing the\n // spacebar to match a word with a space\n if (!typeaheadController.isTypingAhead && isOpenKey) {\n event.preventDefault();\n this.open = true;\n\n // https://www.w3.org/WAI/ARIA/apg/patterns/combobox/examples/combobox-select-only/#kbd_label\n switch (event.code) {\n case 'Space':\n case 'ArrowDown':\n case 'Enter':\n // We will handle focusing last selected item in this.handleOpening()\n this.defaultFocus = FocusState.NONE;\n break;\n case 'End':\n this.defaultFocus = FocusState.LAST_ITEM;\n break;\n case 'ArrowUp':\n case 'Home':\n this.defaultFocus = FocusState.FIRST_ITEM;\n break;\n default:\n break;\n }\n return;\n }\n\n const isPrintableKey = event.key.length === 1;\n\n // Handles typing ahead when the menu is closed by delegating the event to\n // the underlying menu's typeaheadController\n if (isPrintableKey) {\n typeaheadController.onKeydown(event);\n event.preventDefault();\n\n const {lastActiveRecord} = typeaheadController;\n\n if (!lastActiveRecord) {\n return;\n }\n\n this.labelEl?.setAttribute?.('aria-live', 'polite');\n const hasChanged = this.selectItem(\n lastActiveRecord[TYPEAHEAD_RECORD.ITEM] as SelectOption,\n );\n\n if (hasChanged) {\n this.dispatchInteractionEvents();\n }\n }\n }\n\n private handleClick() {\n this.open = !this.open;\n }\n\n private handleFocus() {\n this.focused = true;\n }\n\n private handleBlur() {\n this.focused = false;\n }\n\n /**\n * Handles closing the menu when the focus leaves the select's subtree.\n */\n private handleFocusout(event: FocusEvent) {\n // Don't close the menu if we are switching focus between menu,\n // select-option, and field\n if (event.relatedTarget && isElementInSubtree(event.relatedTarget, this)) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Gets a list of all selected select options as a list item record array.\n *\n * @return An array of selected list option records.\n */\n private getSelectedOptions() {\n if (!this.menu) {\n this.lastSelectedOptionRecords = [];\n return null;\n }\n\n const items = this.menu.items as SelectOption[];\n this.lastSelectedOptionRecords = getSelectedItems(items);\n return this.lastSelectedOptionRecords;\n }\n\n override async getUpdateComplete() {\n await this.menu?.updateComplete;\n return super.getUpdateComplete();\n }\n\n /**\n * Gets the selected options from the DOM, and updates the value and display\n * text to the first selected option's value and headline respectively.\n *\n * @return Whether or not the selected option has changed since last update.\n */\n private updateValueAndDisplayText() {\n const selectedOptions = this.getSelectedOptions() ?? [];\n // Used to determine whether or not we need to fire an input / change event\n // which fire whenever the option element changes (value or selectedIndex)\n // on user interaction.\n let hasSelectedOptionChanged = false;\n\n if (selectedOptions.length) {\n const [firstSelectedOption] = selectedOptions[0];\n hasSelectedOptionChanged =\n this.lastSelectedOption !== firstSelectedOption;\n this.lastSelectedOption = firstSelectedOption;\n this[VALUE] = firstSelectedOption.value;\n this.displayText = firstSelectedOption.displayText;\n } else {\n hasSelectedOptionChanged = this.lastSelectedOption !== null;\n this.lastSelectedOption = null;\n this[VALUE] = '';\n this.displayText = '';\n }\n\n return hasSelectedOptionChanged;\n }\n\n /**\n * Focuses and activates the last selected item upon opening, and resets other\n * active items.\n */\n private async handleOpening(e: Event) {\n this.labelEl?.removeAttribute?.('aria-live');\n this.redispatchEvent(e);\n\n // FocusState.NONE means we want to handle focus ourselves and focus the\n // last selected item.\n if (this.defaultFocus !== FocusState.NONE) {\n return;\n }\n\n const items = this.menu!.items as SelectOption[];\n const activeItem = getActiveItem(items)?.item;\n let [selectedItem] = this.lastSelectedOptionRecords[0] ?? [null];\n\n // This is true if the user keys through the list but clicks out of the menu\n // thus no close-menu event is fired by an item and we can't clean up in\n // handleCloseMenu.\n if (activeItem && activeItem !== selectedItem) {\n activeItem.tabIndex = -1;\n }\n\n // in the case that nothing is selected, focus the first item\n selectedItem = selectedItem ?? items[0];\n\n if (selectedItem) {\n selectedItem.tabIndex = 0;\n selectedItem.focus();\n }\n }\n\n private redispatchEvent(e: Event) {\n redispatchEvent(this, e);\n }\n\n private handleClosed(e: Event) {\n this.open = false;\n this.redispatchEvent(e);\n }\n\n /**\n * Determines the reason for closing, and updates the UI accordingly.\n */\n private handleCloseMenu(event: CloseMenuEvent) {\n const reason = event.detail.reason;\n const item = event.detail.itemPath[0] as SelectOption;\n this.open = false;\n let hasChanged = false;\n\n if (reason.kind === 'click-selection') {\n hasChanged = this.selectItem(item);\n } else if (reason.kind === 'keydown' && isSelectableKey(reason.key)) {\n hasChanged = this.selectItem(item);\n } else {\n // This can happen on ESC being pressed\n item.tabIndex = -1;\n item.blur();\n }\n\n // Dispatch interaction events since selection has been made via keyboard\n // or mouse.\n if (hasChanged) {\n this.dispatchInteractionEvents();\n }\n }\n\n /**\n * Selects a given option, deselects other options, and updates the UI.\n *\n * @return Whether the last selected option has changed.\n */\n private selectItem(item: SelectOption) {\n const selectedOptions = this.getSelectedOptions() ?? [];\n selectedOptions.forEach(([option]) => {\n if (item !== option) {\n option.selected = false;\n }\n });\n item.selected = true;\n\n return this.updateValueAndDisplayText();\n }\n\n /**\n * Handles updating selection when an option element requests selection via\n * property / attribute change.\n */\n private handleRequestSelection(\n event: ReturnType<typeof createRequestSelectionEvent>,\n ) {\n const requestingOptionEl = event.target as SelectOption & HTMLElement;\n\n // No-op if this item is already selected.\n if (\n this.lastSelectedOptionRecords.some(\n ([option]) => option === requestingOptionEl,\n )\n ) {\n return;\n }\n\n this.selectItem(requestingOptionEl);\n }\n\n /**\n * Handles updating selection when an option element requests deselection via\n * property / attribute change.\n */\n private handleRequestDeselection(\n event: ReturnType<typeof createRequestDeselectionEvent>,\n ) {\n const requestingOptionEl = event.target as SelectOption & HTMLElement;\n\n // No-op if this item is not even in the list of tracked selected items.\n if (\n !this.lastSelectedOptionRecords.some(\n ([option]) => option === requestingOptionEl,\n )\n ) {\n return;\n }\n\n this.updateValueAndDisplayText();\n }\n\n /**\n * Attempts to initialize the selected option from user-settable values like\n * SSR, setting `value`, or `selectedIndex` at startup.\n */\n private initUserSelection() {\n // User has set `.value` directly, but internals have not yet booted up.\n if (this.lastUserSetValue && !this.lastSelectedOptionRecords.length) {\n this.select(this.lastUserSetValue);\n\n // User has set `.selectedIndex` directly, but internals have not yet\n // booted up.\n } else if (\n this.lastUserSetSelectedIndex !== null &&\n !this.lastSelectedOptionRecords.length\n ) {\n this.selectIndex(this.lastUserSetSelectedIndex);\n\n // Regular boot up!\n } else {\n this.updateValueAndDisplayText();\n }\n }\n\n private handleIconChange() {\n this.hasLeadingIcon = this.leadingIcons.length > 0;\n }\n\n /**\n * Dispatches the `input` and `change` events.\n */\n private dispatchInteractionEvents() {\n this.dispatchEvent(new Event('input', {bubbles: true, composed: true}));\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n\n private getErrorText() {\n return this.error ? this.errorText : this.nativeErrorText;\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.value;\n }\n\n override formResetCallback() {\n this.reset();\n }\n\n override formStateRestoreCallback(state: string) {\n this.value = state;\n }\n\n override click() {\n this.field?.click();\n }\n\n [createValidator]() {\n return new SelectValidator(() => this);\n }\n\n [getValidityAnchor]() {\n return this.field;\n }\n}\n"]}
|
|
@@ -10,6 +10,7 @@ import { html, isServer, LitElement, nothing } from 'lit';
|
|
|
10
10
|
import { property, query } from 'lit/decorators.js';
|
|
11
11
|
import { classMap } from 'lit/directives/class-map.js';
|
|
12
12
|
import { requestUpdateOnAriaChange } from '../../internal/aria/delegate.js';
|
|
13
|
+
import { afterDispatch, setupDispatchHooks, } from '../../internal/events/dispatch-hooks.js';
|
|
13
14
|
import { dispatchActivationClick, isActivationClick, } from '../../internal/events/form-label-activation.js';
|
|
14
15
|
import { redispatchEvent } from '../../internal/events/redispatch-event.js';
|
|
15
16
|
import { createValidator, getValidityAnchor, mixinConstraintValidation, } from '../../labs/behaviors/constraint-validation.js';
|
|
@@ -53,15 +54,30 @@ export class Switch extends switchBaseClass {
|
|
|
53
54
|
* submitted when `selected` is `false`.
|
|
54
55
|
*/
|
|
55
56
|
this.value = 'on';
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
if (isServer) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
// This click listener does not currently need dispatch hooks since it does
|
|
61
|
+
// not check `event.defaultPrevented`.
|
|
62
|
+
this.addEventListener('click', (event) => {
|
|
63
|
+
if (!isActivationClick(event) || !this.input) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.focus();
|
|
67
|
+
dispatchActivationClick(this.input);
|
|
68
|
+
});
|
|
69
|
+
// Add the aria keyboard interaction pattern for switch and the Enter key.
|
|
70
|
+
// See https://www.w3.org/WAI/ARIA/apg/patterns/switch/.
|
|
71
|
+
setupDispatchHooks(this, 'keydown');
|
|
72
|
+
this.addEventListener('keydown', (event) => {
|
|
73
|
+
afterDispatch(event, () => {
|
|
74
|
+
const ignoreEvent = event.defaultPrevented || event.key !== 'Enter';
|
|
75
|
+
if (ignoreEvent || this.disabled || !this.input) {
|
|
59
76
|
return;
|
|
60
77
|
}
|
|
61
|
-
this.
|
|
62
|
-
dispatchActivationClick(this.input);
|
|
78
|
+
this.input.click();
|
|
63
79
|
});
|
|
64
|
-
}
|
|
80
|
+
});
|
|
65
81
|
}
|
|
66
82
|
render() {
|
|
67
83
|
return html `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switch.js","sourceRoot":"","sources":["switch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAC,eAAe,EAAC,MAAM,2CAA2C,CAAC;AAC1E,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAC,qBAAqB,EAAC,MAAM,2CAA2C,CAAC;AAChF,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAC,iBAAiB,EAAC,MAAM,uDAAuD,CAAC;AAExF,wCAAwC;AACxC,MAAM,eAAe,GAAG,yBAAyB,CAC/C,mBAAmB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CACvD,CAAC;AAEF;;;;;GAKG;AACH,MAAM,OAAO,MAAO,SAAQ,eAAe;IA6CzC;QACE,KAAK,EAAE,CAAC;QAnCV;;;WAGG;QACwB,aAAQ,GAAG,KAAK,CAAC;QAE5C;;WAEG;QACw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QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC;IAEQ,wBAAwB,CAAC,KAAa;QAC7C,IAAI,CAAC,QAAQ,GAAG,KAAK,KAAK,MAAM,CAAC;IACnC,CAAC;IAED,CAAC,eAAe,CAAC;QACf,OAAO,IAAI,iBAAiB,CAAC,GAAG,EAAE,CAAC,CAAC;YAClC,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC,CAAC;IACN,CAAC;IAED,CAAC,iBAAiB,CAAC;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;;AA5LD;IACE,yBAAyB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,GAAA,CAAA;AAED,kBAAkB;AACF,wBAAiB,GAAmB;IAClD,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAMyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAKjB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qCAAe;AAOzC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAC,CAAC;oDACnC;AAQF;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAMhC;IAAX,QAAQ,EAAE;qCAAc;AAEQ;IAAhC,KAAK,CAAC,OAAO,CAAC;qCAAkD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement, nothing, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '../../internal/events/form-label-activation.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {CheckboxValidator} from '../../labs/behaviors/validators/checkbox-validator.js';\n\n// Separate variable needed for closure.\nconst switchBaseClass = mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n);\n\n/**\n * @fires input {InputEvent} Fired whenever `selected` changes due to user\n * interaction (bubbles and composed).\n * @fires change {Event} Fired whenever `selected` changes due to user\n * interaction (bubbles).\n */\nexport class Switch extends switchBaseClass {\n static {\n requestUpdateOnAriaChange(Switch);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Puts the switch in the selected state and sets the form submission value to\n * the `value` property.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * Shows both the selected and deselected icons.\n */\n @property({type: Boolean}) icons = false;\n\n /**\n * Shows only the selected icon, and not the deselected icon. If `true`,\n * overrides the behavior of the `icons` property.\n */\n @property({type: Boolean, attribute: 'show-only-selected-icon'})\n showOnlySelectedIcon = false;\n\n /**\n * When true, require the switch to be selected when participating in\n * form submission.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The value associated with this switch on form submission. `null` is\n * submitted when `selected` is `false`.\n */\n @property() value = 'on';\n\n @query('input') private readonly input!: HTMLInputElement | null;\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.input) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.input);\n });\n }\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"switch ${classMap(this.getRenderClasses())}\">\n <input\n id=\"switch\"\n class=\"touch\"\n type=\"checkbox\"\n role=\"switch\"\n aria-label=${(this as ARIAMixin).ariaLabel || nothing}\n ?checked=${this.selected}\n ?disabled=${this.disabled}\n ?required=${this.required}\n @input=${this.handleInput}\n @change=${this.handleChange} />\n\n <md-focus-ring part=\"focus-ring\" for=\"switch\"></md-focus-ring>\n <span class=\"track\"> ${this.renderHandle()} </span>\n </div>\n `;\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'selected': this.selected,\n 'unselected': !this.selected,\n 'disabled': this.disabled,\n };\n }\n\n private renderHandle() {\n const classes = {\n 'with-icon': this.showOnlySelectedIcon ? this.selected : this.icons,\n };\n return html`\n ${this.renderTouchTarget()}\n <span class=\"handle-container\">\n <md-ripple for=\"switch\" ?disabled=\"${this.disabled}\"></md-ripple>\n <span class=\"handle ${classMap(classes)}\">\n ${this.shouldShowIcons() ? this.renderIcons() : html``}\n </span>\n </span>\n `;\n }\n\n private renderIcons() {\n return html`\n <div class=\"icons\">\n ${this.renderOnIcon()}\n ${this.showOnlySelectedIcon ? html`` : this.renderOffIcon()}\n </div>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOnIcon() {\n return html`\n <slot class=\"icon icon--on\" name=\"on-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z\" />\n </svg>\n </slot>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aclose%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOffIcon() {\n return html`\n <slot class=\"icon icon--off\" name=\"off-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z\" />\n </svg>\n </slot>\n `;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"touch\"></span>`;\n }\n\n private shouldShowIcons(): boolean {\n return this.icons || this.showOnlySelectedIcon;\n }\n\n private handleInput(event: Event) {\n const target = event.target as HTMLInputElement;\n this.selected = target.checked;\n // <input> 'input' event bubbles and is composed, don't re-dispatch it.\n }\n\n private handleChange(event: Event) {\n // <input> 'change' event is not composed, re-dispatch it.\n redispatchEvent(this, event);\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.selected ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.selected);\n }\n\n override formResetCallback() {\n // The selected property does not reflect, so the original attribute set by\n // the user is used to determine the default value.\n this.selected = this.hasAttribute('selected');\n }\n\n override formStateRestoreCallback(state: string) {\n this.selected = state === 'true';\n }\n\n [createValidator]() {\n return new CheckboxValidator(() => ({\n checked: this.selected,\n required: this.required,\n }));\n }\n\n [getValidityAnchor]() {\n return this.input;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"switch.js","sourceRoot":"","sources":["switch.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AACxE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EACL,aAAa,EACb,kBAAkB,GACnB,MAAM,yCAAyC,CAAC;AACj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KAAa;QAC7C,IAAI,CAAC,QAAQ,GAAG,KAAK,KAAK,MAAM,CAAC;IACnC,CAAC;IAED,CAAC,eAAe,CAAC;QACf,OAAO,IAAI,iBAAiB,CAAC,GAAG,EAAE,CAAC,CAAC;YAClC,OAAO,EAAE,IAAI,CAAC,QAAQ;YACtB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC,CAAC,CAAC;IACN,CAAC;IAED,CAAC,iBAAiB,CAAC;QACjB,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;;AA9MD;IACE,yBAAyB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,GAAA,CAAA;AAED,kBAAkB;AACF,wBAAiB,GAAmB;IAClD,IAAI,EAAE,MAAM;IACZ,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAMyB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAKjB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qCAAe;AAOzC;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,yBAAyB,EAAC,CAAC;oDACnC;AAQF;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;wCAAkB;AAMhC;IAAX,QAAQ,EAAE;qCAAc;AAEQ;IAAhC,KAAK,CAAC,OAAO,CAAC;qCAAkD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/md-focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, isServer, LitElement, nothing, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\nimport {\n afterDispatch,\n setupDispatchHooks,\n} from '../../internal/events/dispatch-hooks.js';\nimport {\n dispatchActivationClick,\n isActivationClick,\n} from '../../internal/events/form-label-activation.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.js';\nimport {\n createValidator,\n getValidityAnchor,\n mixinConstraintValidation,\n} from '../../labs/behaviors/constraint-validation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {\n getFormState,\n getFormValue,\n mixinFormAssociated,\n} from '../../labs/behaviors/form-associated.js';\nimport {CheckboxValidator} from '../../labs/behaviors/validators/checkbox-validator.js';\n\n// Separate variable needed for closure.\nconst switchBaseClass = mixinConstraintValidation(\n mixinFormAssociated(mixinElementInternals(LitElement)),\n);\n\n/**\n * @fires input {InputEvent} Fired whenever `selected` changes due to user\n * interaction (bubbles and composed).\n * @fires change {Event} Fired whenever `selected` changes due to user\n * interaction (bubbles).\n */\nexport class Switch extends switchBaseClass {\n static {\n requestUpdateOnAriaChange(Switch);\n }\n\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\n\n /**\n * Puts the switch in the selected state and sets the form submission value to\n * the `value` property.\n */\n @property({type: Boolean}) selected = false;\n\n /**\n * Shows both the selected and deselected icons.\n */\n @property({type: Boolean}) icons = false;\n\n /**\n * Shows only the selected icon, and not the deselected icon. If `true`,\n * overrides the behavior of the `icons` property.\n */\n @property({type: Boolean, attribute: 'show-only-selected-icon'})\n showOnlySelectedIcon = false;\n\n /**\n * When true, require the switch to be selected when participating in\n * form submission.\n *\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#validation\n */\n @property({type: Boolean}) required = false;\n\n /**\n * The value associated with this switch on form submission. `null` is\n * submitted when `selected` is `false`.\n */\n @property() value = 'on';\n\n @query('input') private readonly input!: HTMLInputElement | null;\n\n constructor() {\n super();\n if (isServer) {\n return;\n }\n\n // This click listener does not currently need dispatch hooks since it does\n // not check `event.defaultPrevented`.\n this.addEventListener('click', (event: MouseEvent) => {\n if (!isActivationClick(event) || !this.input) {\n return;\n }\n this.focus();\n dispatchActivationClick(this.input);\n });\n\n // Add the aria keyboard interaction pattern for switch and the Enter key.\n // See https://www.w3.org/WAI/ARIA/apg/patterns/switch/.\n setupDispatchHooks(this, 'keydown');\n this.addEventListener('keydown', (event: KeyboardEvent) => {\n afterDispatch(event, () => {\n const ignoreEvent = event.defaultPrevented || event.key !== 'Enter';\n if (ignoreEvent || this.disabled || !this.input) {\n return;\n }\n\n this.input.click();\n });\n });\n }\n\n protected override render(): TemplateResult {\n return html`\n <div class=\"switch ${classMap(this.getRenderClasses())}\">\n <input\n id=\"switch\"\n class=\"touch\"\n type=\"checkbox\"\n role=\"switch\"\n aria-label=${(this as ARIAMixin).ariaLabel || nothing}\n ?checked=${this.selected}\n ?disabled=${this.disabled}\n ?required=${this.required}\n @input=${this.handleInput}\n @change=${this.handleChange} />\n\n <md-focus-ring part=\"focus-ring\" for=\"switch\"></md-focus-ring>\n <span class=\"track\"> ${this.renderHandle()} </span>\n </div>\n `;\n }\n\n private getRenderClasses(): ClassInfo {\n return {\n 'selected': this.selected,\n 'unselected': !this.selected,\n 'disabled': this.disabled,\n };\n }\n\n private renderHandle() {\n const classes = {\n 'with-icon': this.showOnlySelectedIcon ? this.selected : this.icons,\n };\n return html`\n ${this.renderTouchTarget()}\n <span class=\"handle-container\">\n <md-ripple for=\"switch\" ?disabled=\"${this.disabled}\"></md-ripple>\n <span class=\"handle ${classMap(classes)}\">\n ${this.shouldShowIcons() ? this.renderIcons() : html``}\n </span>\n </span>\n `;\n }\n\n private renderIcons() {\n return html`\n <div class=\"icons\">\n ${this.renderOnIcon()}\n ${this.showOnlySelectedIcon ? html`` : this.renderOffIcon()}\n </div>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Acheck%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOnIcon() {\n return html`\n <slot class=\"icon icon--on\" name=\"on-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M9.55 18.2 3.65 12.3 5.275 10.675 9.55 14.95 18.725 5.775 20.35 7.4Z\" />\n </svg>\n </slot>\n `;\n }\n\n /**\n * https://fonts.google.com/icons?selected=Material%20Symbols%20Outlined%3Aclose%3AFILL%400%3Bwght%40500%3BGRAD%400%3Bopsz%4024\n */\n private renderOffIcon() {\n return html`\n <slot class=\"icon icon--off\" name=\"off-icon\">\n <svg viewBox=\"0 0 24 24\">\n <path\n d=\"M6.4 19.2 4.8 17.6 10.4 12 4.8 6.4 6.4 4.8 12 10.4 17.6 4.8 19.2 6.4 13.6 12 19.2 17.6 17.6 19.2 12 13.6Z\" />\n </svg>\n </slot>\n `;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"touch\"></span>`;\n }\n\n private shouldShowIcons(): boolean {\n return this.icons || this.showOnlySelectedIcon;\n }\n\n private handleInput(event: Event) {\n const target = event.target as HTMLInputElement;\n this.selected = target.checked;\n // <input> 'input' event bubbles and is composed, don't re-dispatch it.\n }\n\n private handleChange(event: Event) {\n // <input> 'change' event is not composed, re-dispatch it.\n redispatchEvent(this, event);\n }\n\n // Writable mixin properties for lit-html binding, needed for lit-analyzer\n declare disabled: boolean;\n declare name: string;\n\n override [getFormValue]() {\n return this.selected ? this.value : null;\n }\n\n override [getFormState]() {\n return String(this.selected);\n }\n\n override formResetCallback() {\n // The selected property does not reflect, so the original attribute set by\n // the user is used to determine the default value.\n this.selected = this.hasAttribute('selected');\n }\n\n override formStateRestoreCallback(state: string) {\n this.selected = state === 'true';\n }\n\n [createValidator]() {\n return new CheckboxValidator(() => ({\n checked: this.selected,\n required: this.required,\n }));\n }\n\n [getValidityAnchor]() {\n return this.input;\n }\n}\n"]}
|