@material/web 2.2.1-nightly.d69f2f2.0 → 2.2.1-nightly.ff9ab97.0

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.
@@ -33,6 +33,12 @@ export declare abstract class Button extends buttonBaseClass implements FormSubm
33
33
  * The URL that the link button points to.
34
34
  */
35
35
  href: string;
36
+ /**
37
+ * The filename to use when downloading the linked resource.
38
+ * If not specified, the browser will determine a filename.
39
+ * This is only applicable when the button is used as a link (`href` is set).
40
+ */
41
+ download: string;
36
42
  /**
37
43
  * Where to display the linked `href` URL for a link button. Common options
38
44
  * include `_blank` to open in a new tab.
@@ -49,6 +49,12 @@ export class Button extends buttonBaseClass {
49
49
  * The URL that the link button points to.
50
50
  */
51
51
  this.href = '';
52
+ /**
53
+ * The filename to use when downloading the linked resource.
54
+ * If not specified, the browser will determine a filename.
55
+ * This is only applicable when the button is used as a link (`href` is set).
56
+ */
57
+ this.download = '';
52
58
  /**
53
59
  * Where to display the linked `href` URL for a link button. Common options
54
60
  * include `_blank` to open in a new tab.
@@ -127,6 +133,7 @@ export class Button extends buttonBaseClass {
127
133
  aria-haspopup="${ariaHasPopup || nothing}"
128
134
  aria-expanded="${ariaExpanded || nothing}"
129
135
  href=${this.href}
136
+ download=${this.download || nothing}
130
137
  target=${this.target || nothing}
131
138
  >${this.renderContent()}
132
139
  </a>`;
@@ -180,6 +187,9 @@ __decorate([
180
187
  __decorate([
181
188
  property()
182
189
  ], Button.prototype, "href", void 0);
190
+ __decorate([
191
+ property()
192
+ ], Button.prototype, "download", void 0);
183
193
  __decorate([
184
194
  property()
185
195
  ], Button.prototype, "target", void 0);
@@ -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,OA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Z,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAKwC;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;wCAAkB;AAW3D;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAChD;AAKT;IAAX,QAAQ,EAAE;oCAAW;AAMV;IAAX,QAAQ,EAAE;sCAA2D;AAStE;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAChD;AAK4C;IAAhE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCACxD;AAMI;IAAX,QAAQ,EAAE;oCAAoC;AAMpB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;qCAAY;AAgBH;IAAlC,KAAK,CAAC,SAAS,CAAC;6CAAqD;AAGrD;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACN","sourcesContent":["/**\n * @license\n * Copyright 2019 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} from 'lit';\nimport {property, query, queryAssignedElements} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {mixinDelegatesAria} 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 = mixinDelegatesAria(mixinElementInternals(LitElement));\n\n/**\n * A button component.\n */\nexport abstract class Button extends buttonBaseClass implements FormSubmitter {\n static {\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 * Whether or not the button is \"soft-disabled\" (disabled but still\n * focusable).\n *\n * Use this when a button needs increased visibility when disabled. See\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls\n * for more guidance on when this is needed.\n */\n @property({type: Boolean, attribute: 'soft-disabled', reflect: true})\n softDisabled = 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.handleClick.bind(this));\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 isRippleDisabled = !this.href && (this.disabled || this.softDisabled);\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=\"${isRippleDisabled}\"></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-disabled=${this.softDisabled || nothing}\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 handleClick(event: MouseEvent) {\n // If the button is soft-disabled, we need to explicitly prevent the click\n // from propagating to other event listeners as well as prevent the default\n // action.\n if (!this.href && this.softDisabled) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\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"]}
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,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,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,kBAAkB,CAAC,qBAAqB,CAAC,UAAU,CAAC,CAAC,CAAC;AAE9E;;GAEG;AACH,MAAM,OAAgB,MAAO,SAAQ,eAAe;IA2ElD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACzC,CAAC;IACD,IAAI,IAAI,CAAC,IAAY;QACnB,IAAI,CAAC,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EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCACxD;AAMI;IAAX,QAAQ,EAAE;oCAAoC;AAMpB;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;qCAAY;AAgBH;IAAlC,KAAK,CAAC,SAAS,CAAC;6CAAqD;AAGrD;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;6CACN","sourcesContent":["/**\n * @license\n * Copyright 2019 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} from 'lit';\nimport {property, query, queryAssignedElements} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {mixinDelegatesAria} 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 = mixinDelegatesAria(mixinElementInternals(LitElement));\n\n/**\n * A button component.\n */\nexport abstract class Button extends buttonBaseClass implements FormSubmitter {\n static {\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 * Whether or not the button is \"soft-disabled\" (disabled but still\n * focusable).\n *\n * Use this when a button needs increased visibility when disabled. See\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls\n * for more guidance on when this is needed.\n */\n @property({type: Boolean, attribute: 'soft-disabled', reflect: true})\n softDisabled = false;\n\n /**\n * The URL that the link button points to.\n */\n @property() href = '';\n\n /**\n * The filename to use when downloading the linked resource.\n * If not specified, the browser will determine a filename.\n * This is only applicable when the button is used as a link (`href` is set).\n */\n @property() download = '';\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.handleClick.bind(this));\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 isRippleDisabled = !this.href && (this.disabled || this.softDisabled);\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=\"${isRippleDisabled}\"></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-disabled=${this.softDisabled || nothing}\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 download=${this.download || nothing}\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 handleClick(event: MouseEvent) {\n // If the button is soft-disabled, we need to explicitly prevent the click\n // from propagating to other event listeners as well as prevent the default\n // action.\n if (!this.href && this.softDisabled) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n\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"]}
@@ -11,6 +11,12 @@ import { Chip } from './chip.js';
11
11
  export declare class AssistChip extends Chip {
12
12
  elevated: boolean;
13
13
  href: string;
14
+ /**
15
+ * The filename to use when downloading the linked resource.
16
+ * If not specified, the browser will determine a filename.
17
+ * This is only applicable when the chip is used as a link (`href` is set).
18
+ */
19
+ download: string;
14
20
  target: '_blank' | '_parent' | '_self' | '_top' | '';
15
21
  protected get primaryId(): "link" | "button";
16
22
  protected get rippleDisabled(): boolean;
@@ -16,6 +16,12 @@ export class AssistChip extends Chip {
16
16
  super(...arguments);
17
17
  this.elevated = false;
18
18
  this.href = '';
19
+ /**
20
+ * The filename to use when downloading the linked resource.
21
+ * If not specified, the browser will determine a filename.
22
+ * This is only applicable when the chip is used as a link (`href` is set).
23
+ */
24
+ this.download = '';
19
25
  this.target = '';
20
26
  }
21
27
  get primaryId() {
@@ -43,6 +49,7 @@ export class AssistChip extends Chip {
43
49
  id="link"
44
50
  aria-label=${ariaLabel || nothing}
45
51
  href=${this.href}
52
+ download=${this.download || nothing}
46
53
  target=${this.target || nothing}
47
54
  >${content}</a
48
55
  >
@@ -73,6 +80,9 @@ __decorate([
73
80
  __decorate([
74
81
  property()
75
82
  ], AssistChip.prototype, "href", void 0);
83
+ __decorate([
84
+ property()
85
+ ], AssistChip.prototype, "download", void 0);
76
86
  __decorate([
77
87
  property()
78
88
  ], AssistChip.prototype, "target", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"assist-chip.js","sourceRoot":"","sources":["assist-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAI3C,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,IAAI;IAApC;;QAC6B,aAAQ,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AO,KAAK,CAAC,aAAa,EAAE,CAAC;IAC/B,CAAC;CACF;AA1D4B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAkB;AAChC;IAAX,QAAQ,EAAE;wCAAW;AACV;IAAX,QAAQ,EAAE;0CAA2D","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../elevation/elevation.js';\n\nimport {html, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\n\nimport {Chip} from './chip.js';\n\n/**\n * An assist chip component.\n */\nexport class AssistChip extends Chip {\n @property({type: Boolean}) elevated = false;\n @property() href = '';\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n\n protected get primaryId() {\n return this.href ? 'link' : 'button';\n }\n\n protected override get rippleDisabled() {\n // Link chips cannot be disabled\n return !this.href && (this.disabled || this.softDisabled);\n }\n\n protected override getContainerClasses() {\n return {\n ...super.getContainerClasses(),\n // Link chips cannot be disabled\n disabled: !this.href && (this.disabled || this.softDisabled),\n elevated: this.elevated,\n link: !!this.href,\n };\n }\n\n protected override renderPrimaryAction(content: unknown) {\n const {ariaLabel} = this as ARIAMixinStrict;\n if (this.href) {\n return html`\n <a\n class=\"primary action\"\n id=\"link\"\n aria-label=${ariaLabel || nothing}\n href=${this.href}\n target=${this.target || nothing}\n >${content}</a\n >\n `;\n }\n\n return html`\n <button\n class=\"primary action\"\n id=\"button\"\n aria-label=${ariaLabel || nothing}\n aria-disabled=${this.softDisabled || nothing}\n ?disabled=${this.disabled && !this.alwaysFocusable}\n type=\"button\"\n >${content}</button\n >\n `;\n }\n\n protected override renderOutline() {\n if (this.elevated) {\n return html`<md-elevation part=\"elevation\"></md-elevation>`;\n }\n\n return super.renderOutline();\n }\n}\n"]}
1
+ {"version":3,"file":"assist-chip.js","sourceRoot":"","sources":["assist-chip.ts"],"names":[],"mappings":"AA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C,MAAM,IAAI,OAAO;aAC5B,OAAO;;OAEb,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAA;;;;qBAIM,SAAS,IAAI,OAAO;wBACjB,IAAI,CAAC,YAAY,IAAI,OAAO;oBAChC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,eAAe;;WAE/C,OAAO;;KAEb,CAAC;IACJ,CAAC;IAEkB,aAAa;QAC9B,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,OAAO,IAAI,CAAA,gDAAgD,CAAC;QAC9D,CAAC;QAED,OAAO,KAAK,CAAC,aAAa,EAAE,CAAC;IAC/B,CAAC;CACF;AAjE4B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAkB;AAChC;IAAX,QAAQ,EAAE;wCAAW;AAMV;IAAX,QAAQ,EAAE;4CAAe;AACd;IAAX,QAAQ,EAAE;0CAA2D","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../elevation/elevation.js';\n\nimport {html, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\n\nimport {Chip} from './chip.js';\n\n/**\n * An assist chip component.\n */\nexport class AssistChip extends Chip {\n @property({type: Boolean}) elevated = false;\n @property() href = '';\n /**\n * The filename to use when downloading the linked resource.\n * If not specified, the browser will determine a filename.\n * This is only applicable when the chip is used as a link (`href` is set).\n */\n @property() download = '';\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n\n protected get primaryId() {\n return this.href ? 'link' : 'button';\n }\n\n protected override get rippleDisabled() {\n // Link chips cannot be disabled\n return !this.href && (this.disabled || this.softDisabled);\n }\n\n protected override getContainerClasses() {\n return {\n ...super.getContainerClasses(),\n // Link chips cannot be disabled\n disabled: !this.href && (this.disabled || this.softDisabled),\n elevated: this.elevated,\n link: !!this.href,\n };\n }\n\n protected override renderPrimaryAction(content: unknown) {\n const {ariaLabel} = this as ARIAMixinStrict;\n if (this.href) {\n return html`\n <a\n class=\"primary action\"\n id=\"link\"\n aria-label=${ariaLabel || nothing}\n href=${this.href}\n download=${this.download || nothing}\n target=${this.target || nothing}\n >${content}</a\n >\n `;\n }\n\n return html`\n <button\n class=\"primary action\"\n id=\"button\"\n aria-label=${ariaLabel || nothing}\n aria-disabled=${this.softDisabled || nothing}\n ?disabled=${this.disabled && !this.alwaysFocusable}\n type=\"button\"\n >${content}</button\n >\n `;\n }\n\n protected override renderOutline() {\n if (this.elevated) {\n return html`<md-elevation part=\"elevation\"></md-elevation>`;\n }\n\n return super.renderOutline();\n }\n}\n"]}
@@ -297,7 +297,7 @@ export class Dialog extends dialogBaseClass {
297
297
  handleSubmit(event) {
298
298
  const form = event.target;
299
299
  const { submitter } = event;
300
- if (form.method !== 'dialog' || !submitter) {
300
+ if (form.getAttribute('method') !== 'dialog' || !submitter) {
301
301
  return;
302
302
  }
303
303
  // Close reason is the submitter's value attribute, or the dialog's
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sourceRoot":"","sources":["dialog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAGrD,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAC,eAAe,EAAC,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,GAG9B,MAAM,iBAAiB,CAAC;AAEzB,wCAAwC;AACxC,MAAM,eAAe,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAEvD;;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WAAW,CAAC,OAAgB;IACnC,8DAA8D;IAC9D,2CAA2C;IAC3C,yCAAyC;IACzC,gCAAgC;IAChC,6CAA6C;IAC7C,MAAM,sBAAsB,GAC1B,8FAA8F,CAAC;IACjG,MAAM,WAAW,GAAG,4BAA4B,CAAC;IACjD,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;IACpD,IACE,OAAO,CAAC,OAAO,CAAC,sBAAsB,GAAG,WAAW,GAAG,mBAAmB,CAAC,EAC3E,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0EAA0E;IAC1E,2EAA2E;IAC3E,iDAAiD;IACjD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,EAAE,cAAc,IAAI,KAAK,CAAC;AACrD,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../divider/divider.js';\n\nimport {html, isServer, LitElement, nothing} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {mixinDelegatesAria} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.js';\n\nimport {\n DIALOG_DEFAULT_CLOSE_ANIMATION,\n DIALOG_DEFAULT_OPEN_ANIMATION,\n DialogAnimation,\n DialogAnimationArgs,\n} from './animations.js';\n\n// Separate variable needed for closure.\nconst dialogBaseClass = mixinDelegatesAria(LitElement);\n\n/**\n * A dialog component.\n *\n * @fires open {Event} Dispatched when the dialog is opening before any animations.\n * @fires opened {Event} Dispatched when the dialog has opened after any animations.\n * @fires close {Event} Dispatched when the dialog is closing before any animations.\n * @fires closed {Event} Dispatched when the dialog has closed after any animations.\n * @fires cancel {Event} Dispatched when the dialog has been canceled by clicking\n * on the scrim or pressing Escape.\n */\nexport class Dialog extends dialogBaseClass {\n // We do not use `delegatesFocus: true` due to a Chromium bug with\n // selecting text.\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=950357\n\n /**\n * Opens the dialog when set to `true` and closes it when set to `false`.\n */\n @property({type: Boolean})\n get open() {\n return this.isOpen;\n }\n\n set open(open: boolean) {\n if (open === this.isOpen) {\n return;\n }\n\n this.isOpen = open;\n if (open) {\n this.setAttribute('open', '');\n this.show();\n } else {\n this.removeAttribute('open');\n this.close();\n }\n }\n\n /**\n * Skips the opening and closing animations.\n */\n @property({type: Boolean}) quick = false;\n\n /**\n * Gets or sets the dialog's return value, usually to indicate which button\n * a user pressed to close it.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/returnValue\n */\n @property({attribute: false}) returnValue = '';\n\n /**\n * The type of dialog for accessibility. Set this to `alert` to announce a\n * dialog as an alert dialog.\n */\n @property() type?: 'alert';\n\n /**\n * Disables focus trapping, which by default keeps keyboard Tab navigation\n * within the dialog.\n *\n * When disabled, after focusing the last element of a dialog, pressing Tab\n * again will release focus from the window back to the browser (such as the\n * URL bar).\n *\n * Focus trapping is recommended for accessibility, and should not typically\n * be disabled. Only turn this off if the use case of a dialog is more\n * accessible without focus trapping.\n */\n @property({type: Boolean, attribute: 'no-focus-trap'})\n noFocusTrap = false;\n\n /**\n * Gets the opening animation for a dialog. Set to a new function to customize\n * the animation.\n */\n getOpenAnimation = () => DIALOG_DEFAULT_OPEN_ANIMATION;\n\n /**\n * Gets the closing animation for a dialog. Set to a new function to customize\n * the animation.\n */\n getCloseAnimation = () => DIALOG_DEFAULT_CLOSE_ANIMATION;\n\n private isOpen = false;\n private isOpening = false;\n // getIsConnectedPromise() immediately sets the resolve property.\n private isConnectedPromiseResolve!: () => void;\n private isConnectedPromise = this.getIsConnectedPromise();\n @query('dialog') private readonly dialog!: HTMLDialogElement | null;\n @query('.scrim') private readonly scrim!: HTMLDialogElement | null;\n @query('.container') private readonly container!: HTMLDialogElement | null;\n @query('.headline') private readonly headline!: HTMLDialogElement | null;\n @query('.content') private readonly content!: HTMLDialogElement | null;\n @query('.actions') private readonly actions!: HTMLDialogElement | null;\n @state() private isAtScrollTop = false;\n @state() private isAtScrollBottom = false;\n @query('.scroller') private readonly scroller!: HTMLElement | null;\n @query('.top.anchor') private readonly topAnchor!: HTMLElement | null;\n @query('.bottom.anchor') private readonly bottomAnchor!: HTMLElement | null;\n @query('.focus-trap')\n private readonly firstFocusTrap!: HTMLElement | null;\n private nextClickIsFromContent = false;\n private intersectionObserver?: IntersectionObserver;\n // Dialogs should not be SSR'd while open, so we can just use runtime checks.\n @state() private hasHeadline = false;\n @state() private hasActions = false;\n @state() private hasIcon = false;\n private cancelAnimations?: AbortController;\n\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=1512224\n // Chrome v120 has a bug where escape keys do not trigger cancels. If we get\n // a dialog \"close\" event that is triggered without a \"cancel\" after an escape\n // keydown, then we need to manually trigger our closing logic.\n //\n // This bug occurs when pressing escape to close a dialog without first\n // interacting with the dialog's content.\n //\n // Cleanup tracking:\n // https://github.com/material-components/material-web/issues/5330\n // This can be removed when full CloseWatcher support added and the above bug\n // in Chromium is fixed to fire 'cancel' with one escape press and close with\n // multiple.\n private escapePressedWithoutCancel = false;\n // This TreeWalker is used to walk through a dialog's children to find\n // focusable elements. TreeWalker is faster than `querySelectorAll('*')`.\n // We check for isServer because there isn't a \"document\" during an SSR\n // run.\n private readonly treewalker = isServer\n ? null\n : document.createTreeWalker(this, NodeFilter.SHOW_ELEMENT);\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('submit', this.handleSubmit);\n }\n }\n\n /**\n * Opens the dialog and fires a cancelable `open` event. After a dialog's\n * animation, an `opened` event is fired.\n *\n * Add an `autofocus` attribute to a child of the dialog that should\n * receive focus after opening.\n *\n * @return A Promise that resolves after the animation is finished and the\n * `opened` event was fired.\n */\n async show() {\n this.isOpening = true;\n // Dialogs can be opened before being attached to the DOM, so we need to\n // wait until we're connected before calling `showModal()`.\n await this.isConnectedPromise;\n await this.updateComplete;\n const dialog = this.dialog!;\n // Check if already opened or if `dialog.close()` was called while awaiting.\n if (dialog.open || !this.isOpening) {\n this.isOpening = false;\n return;\n }\n\n const preventOpen = !this.dispatchEvent(\n new Event('open', {cancelable: true}),\n );\n if (preventOpen) {\n this.open = false;\n this.isOpening = false;\n return;\n }\n\n // All Material dialogs are modal.\n dialog.showModal();\n this.open = true;\n // Reset scroll position if re-opening a dialog with the same content.\n if (this.scroller) {\n this.scroller.scrollTop = 0;\n }\n // Native modal dialogs ignore autofocus and instead force focus to the\n // first focusable child. Override this behavior if there is a child with\n // an autofocus attribute.\n this.querySelector<HTMLElement>('[autofocus]')?.focus();\n\n await this.animateDialog(this.getOpenAnimation());\n this.dispatchEvent(new Event('opened'));\n this.isOpening = false;\n }\n\n /**\n * Closes the dialog and fires a cancelable `close` event. After a dialog's\n * animation, a `closed` event is fired.\n *\n * @param returnValue A return value usually indicating which button was used\n * to close a dialog. If a dialog is canceled by clicking the scrim or\n * pressing Escape, it will not change the return value after closing.\n * @return A Promise that resolves after the animation is finished and the\n * `closed` event was fired.\n */\n async close(returnValue = this.returnValue) {\n this.isOpening = false;\n if (!this.isConnected) {\n // Disconnected dialogs do not fire close events or animate.\n this.open = false;\n return;\n }\n\n await this.updateComplete;\n const dialog = this.dialog!;\n // Check if already closed or if `dialog.show()` was called while awaiting.\n if (!dialog.open || this.isOpening) {\n this.open = false;\n return;\n }\n\n const prevReturnValue = this.returnValue;\n this.returnValue = returnValue;\n const preventClose = !this.dispatchEvent(\n new Event('close', {cancelable: true}),\n );\n if (preventClose) {\n this.returnValue = prevReturnValue;\n return;\n }\n\n await this.animateDialog(this.getCloseAnimation());\n dialog.close(returnValue);\n this.open = false;\n this.dispatchEvent(new Event('closed'));\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.isConnectedPromiseResolve();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.isConnectedPromise = this.getIsConnectedPromise();\n }\n\n protected override render() {\n const scrollable =\n this.open && !(this.isAtScrollTop && this.isAtScrollBottom);\n const classes = {\n 'has-headline': this.hasHeadline,\n 'has-actions': this.hasActions,\n 'has-icon': this.hasIcon,\n 'scrollable': scrollable,\n 'show-top-divider': scrollable && !this.isAtScrollTop,\n 'show-bottom-divider': scrollable && !this.isAtScrollBottom,\n };\n\n // The focus trap sentinels are only added after the dialog opens, since\n // dialog.showModal() will try to autofocus them, even with tabindex=\"-1\".\n const showFocusTrap = this.open && !this.noFocusTrap;\n const focusTrap = html`\n <div\n class=\"focus-trap\"\n tabindex=\"0\"\n aria-hidden=\"true\"\n @focus=${this.handleFocusTrapFocus}></div>\n `;\n\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <div class=\"scrim\"></div>\n <dialog\n class=${classMap(classes)}\n aria-label=${ariaLabel || nothing}\n aria-labelledby=${this.hasHeadline ? 'headline' : nothing}\n role=${this.type === 'alert' ? 'alertdialog' : nothing}\n @cancel=${this.handleCancel}\n @click=${this.handleDialogClick}\n @close=${this.handleClose}\n @keydown=${this.handleKeydown}\n .returnValue=${this.returnValue || nothing}>\n ${showFocusTrap ? focusTrap : nothing}\n <div class=\"container\" @click=${this.handleContentClick}>\n <div class=\"headline\">\n <div class=\"icon\" aria-hidden=\"true\">\n <slot name=\"icon\" @slotchange=${this.handleIconChange}></slot>\n </div>\n <h2 id=\"headline\" aria-hidden=${!this.hasHeadline || nothing}>\n <slot\n name=\"headline\"\n @slotchange=${this.handleHeadlineChange}></slot>\n </h2>\n <md-divider></md-divider>\n </div>\n <div class=\"scroller\">\n <div class=\"content\">\n <div class=\"top anchor\"></div>\n <slot name=\"content\"></slot>\n <div class=\"bottom anchor\"></div>\n </div>\n </div>\n <div class=\"actions\">\n <md-divider></md-divider>\n <slot name=\"actions\" @slotchange=${this.handleActionsChange}></slot>\n </div>\n </div>\n ${showFocusTrap ? focusTrap : nothing}\n </dialog>\n `;\n }\n\n protected override firstUpdated() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n this.handleAnchorIntersection(entry);\n }\n },\n {root: this.scroller!},\n );\n\n this.intersectionObserver.observe(this.topAnchor!);\n this.intersectionObserver.observe(this.bottomAnchor!);\n }\n\n private handleDialogClick() {\n if (this.nextClickIsFromContent) {\n // Avoid doing a layout calculation below if we know the click came from\n // content.\n this.nextClickIsFromContent = false;\n return;\n }\n\n // Click originated on the backdrop. Native `<dialog>`s will not cancel,\n // but Material dialogs do.\n const preventDefault = !this.dispatchEvent(\n new Event('cancel', {cancelable: true}),\n );\n if (preventDefault) {\n return;\n }\n\n this.close();\n }\n\n private handleContentClick() {\n this.nextClickIsFromContent = true;\n }\n\n private handleSubmit(event: SubmitEvent) {\n const form = event.target as HTMLFormElement;\n const {submitter} = event;\n if (form.method !== 'dialog' || !submitter) {\n return;\n }\n\n // Close reason is the submitter's value attribute, or the dialog's\n // `returnValue` if there is no attribute.\n this.close(submitter.getAttribute('value') ?? this.returnValue);\n }\n\n private handleCancel(event: Event) {\n if (event.target !== this.dialog) {\n // Ignore any cancel events dispatched by content.\n return;\n }\n\n this.escapePressedWithoutCancel = false;\n const preventDefault = !redispatchEvent(this, event);\n // We always prevent default on the original dialog event since we'll\n // animate closing it before it actually closes.\n event.preventDefault();\n if (preventDefault) {\n return;\n }\n\n this.close();\n }\n\n private handleClose() {\n if (!this.escapePressedWithoutCancel) {\n return;\n }\n\n this.escapePressedWithoutCancel = false;\n this.dialog?.dispatchEvent(new Event('cancel', {cancelable: true}));\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (event.key !== 'Escape') {\n return;\n }\n\n // An escape key was pressed. If a \"close\" event fires next without a\n // \"cancel\" event first, then we know we're in the Chrome v120 bug.\n this.escapePressedWithoutCancel = true;\n // Wait a full task for the cancel/close event listeners to fire, then\n // reset the flag.\n setTimeout(() => {\n this.escapePressedWithoutCancel = false;\n });\n }\n\n private async animateDialog(animation: DialogAnimation) {\n // Always cancel the previous animations. Animations can include `fill`\n // modes that need to be cleared when `quick` is toggled. If not, content\n // that faded out will remain hidden when a `quick` dialog re-opens after\n // previously opening and closing without `quick`.\n this.cancelAnimations?.abort();\n this.cancelAnimations = new AbortController();\n if (this.quick) {\n return;\n }\n\n const {dialog, scrim, container, headline, content, actions} = this;\n if (!dialog || !scrim || !container || !headline || !content || !actions) {\n return;\n }\n\n const {\n container: containerAnimate,\n dialog: dialogAnimate,\n scrim: scrimAnimate,\n headline: headlineAnimate,\n content: contentAnimate,\n actions: actionsAnimate,\n } = animation;\n\n const elementAndAnimation: Array<[Element, DialogAnimationArgs[]]> = [\n [dialog, dialogAnimate ?? []],\n [scrim, scrimAnimate ?? []],\n [container, containerAnimate ?? []],\n [headline, headlineAnimate ?? []],\n [content, contentAnimate ?? []],\n [actions, actionsAnimate ?? []],\n ];\n\n const animations: Animation[] = [];\n for (const [element, animation] of elementAndAnimation) {\n for (const animateArgs of animation) {\n const animation = element.animate(...animateArgs);\n this.cancelAnimations.signal.addEventListener('abort', () => {\n animation.cancel();\n });\n\n animations.push(animation);\n }\n }\n\n await Promise.all(\n animations.map((animation) =>\n animation.finished.catch(() => {\n // Ignore intentional AbortErrors when calling `animation.cancel()`.\n }),\n ),\n );\n }\n\n private handleHeadlineChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasHeadline = slot.assignedElements().length > 0;\n }\n\n private handleActionsChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasActions = slot.assignedElements().length > 0;\n }\n\n private handleIconChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasIcon = slot.assignedElements().length > 0;\n }\n\n private handleAnchorIntersection(entry: IntersectionObserverEntry) {\n const {target, isIntersecting} = entry;\n if (target === this.topAnchor) {\n this.isAtScrollTop = isIntersecting;\n }\n\n if (target === this.bottomAnchor) {\n this.isAtScrollBottom = isIntersecting;\n }\n }\n\n private getIsConnectedPromise() {\n return new Promise<void>((resolve) => {\n this.isConnectedPromiseResolve = resolve;\n });\n }\n\n private handleFocusTrapFocus(event: FocusEvent) {\n const [firstFocusableChild, lastFocusableChild] =\n this.getFirstAndLastFocusableChildren();\n if (!firstFocusableChild || !lastFocusableChild) {\n // When a dialog does not have focusable children, the dialog itself\n // receives focus.\n this.dialog?.focus();\n return;\n }\n\n // To determine which child to focus, we need to know which focus trap\n // received focus...\n const isFirstFocusTrap = event.target === this.firstFocusTrap;\n const isLastFocusTrap = !isFirstFocusTrap;\n // ...and where the focus came from (what was previously focused).\n const focusCameFromFirstChild = event.relatedTarget === firstFocusableChild;\n const focusCameFromLastChild = event.relatedTarget === lastFocusableChild;\n // Although this is a focus trap, focus can come from outside the trap.\n // This can happen when elements are programmatically `focus()`'d. It also\n // happens when focus leaves and returns to the window, such as clicking on\n // the browser's URL bar and pressing Tab, or switching focus between\n // iframes.\n const focusCameFromOutsideDialog =\n !focusCameFromFirstChild && !focusCameFromLastChild;\n\n // Focus the dialog's first child when we reach the end of the dialog and\n // focus is moving forward. Or, when focus is moving forwards into the\n // dialog from outside of the window.\n const shouldFocusFirstChild =\n (isLastFocusTrap && focusCameFromLastChild) ||\n (isFirstFocusTrap && focusCameFromOutsideDialog);\n if (shouldFocusFirstChild) {\n firstFocusableChild.focus();\n return;\n }\n\n // Focus the dialog's last child when we reach the beginning of the dialog\n // and focus is moving backward. Or, when focus is moving backwards into the\n // dialog from outside of the window.\n const shouldFocusLastChild =\n (isFirstFocusTrap && focusCameFromFirstChild) ||\n (isLastFocusTrap && focusCameFromOutsideDialog);\n if (shouldFocusLastChild) {\n lastFocusableChild.focus();\n return;\n }\n\n // The booleans above are verbose for readability, but code executation\n // won't actually reach here.\n }\n\n private getFirstAndLastFocusableChildren():\n | [HTMLElement, HTMLElement]\n | [null, null] {\n if (!this.treewalker) {\n return [null, null];\n }\n\n let firstFocusableChild: HTMLElement | null = null;\n let lastFocusableChild: HTMLElement | null = null;\n\n // Reset the current node back to the root host element.\n this.treewalker.currentNode = this.treewalker.root;\n while (this.treewalker.nextNode()) {\n // Cast as Element since the TreeWalker filter only accepts Elements.\n const nextChild = this.treewalker.currentNode as Element;\n if (!isFocusable(nextChild)) {\n continue;\n }\n\n if (!firstFocusableChild) {\n firstFocusableChild = nextChild;\n }\n\n lastFocusableChild = nextChild;\n }\n\n // We set lastFocusableChild immediately after finding a\n // firstFocusableChild, which means the pair is either both null or both\n // non-null. Cast since TypeScript does not recognize this.\n return [firstFocusableChild, lastFocusableChild] as\n | [HTMLElement, HTMLElement]\n | [null, null];\n }\n}\n\nfunction isFocusable(element: Element): element is HTMLElement {\n // Check if the element is a known built-in focusable element:\n // - <a> and <area> with `href` attributes.\n // - Form controls that are not disabled.\n // - `contenteditable` elements.\n // - Anything with a non-negative `tabindex`.\n const knownFocusableElements =\n ':is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true])';\n const notDisabled = ':not(:disabled,[disabled])';\n const notNegativeTabIndex = ':not([tabindex^=\"-\"])';\n if (\n element.matches(knownFocusableElements + notDisabled + notNegativeTabIndex)\n ) {\n return true;\n }\n\n const isCustomElement = element.localName.includes('-');\n if (!isCustomElement) {\n return false;\n }\n\n // If a custom element does not have a tabindex, it may still be focusable\n // if it delegates focus with a shadow root. We also need to check again if\n // the custom element is a disabled form control.\n if (!element.matches(notDisabled)) {\n return false;\n }\n\n return element.shadowRoot?.delegatesFocus ?? false;\n}\n"]}
1
+ {"version":3,"file":"dialog.js","sourceRoot":"","sources":["dialog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,0BAA0B,CAAC;AAElC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AACxD,OAAO,EAAC,QAAQ,EAAE,KAAK,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D;IAAhB,KAAK,EAAE;6CAA+B;AACtB;IAAhB,KAAK,EAAE;gDAAkC;AACL;IAApC,KAAK,CAAC,WAAW,CAAC;wCAAgD;AAC5B;IAAtC,KAAK,CAAC,aAAa,CAAC;yCAAiD;AAC5B;IAAzC,KAAK,CAAC,gBAAgB,CAAC;4CAAoD;AAE3D;IADhB,KAAK,CAAC,aAAa,CAAC;8CACgC;AAIpC;IAAhB,KAAK,EAAE;2CAA6B;AACpB;IAAhB,KAAK,EAAE;0CAA4B;AACnB;IAAhB,KAAK,EAAE;uCAAyB;AAgdnC,SAAS,WAAW,CAAC,OAAgB;IACnC,8DAA8D;IAC9D,2CAA2C;IAC3C,yCAAyC;IACzC,gCAAgC;IAChC,6CAA6C;IAC7C,MAAM,sBAAsB,GAC1B,8FAA8F,CAAC;IACjG,MAAM,WAAW,GAAG,4BAA4B,CAAC;IACjD,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;IACpD,IACE,OAAO,CAAC,OAAO,CAAC,sBAAsB,GAAG,WAAW,GAAG,mBAAmB,CAAC,EAC3E,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACxD,IAAI,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,0EAA0E;IAC1E,2EAA2E;IAC3E,iDAAiD;IACjD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,EAAE,cAAc,IAAI,KAAK,CAAC;AACrD,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../divider/divider.js';\n\nimport {html, isServer, LitElement, nothing} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {mixinDelegatesAria} from '../../internal/aria/delegate.js';\nimport {redispatchEvent} from '../../internal/events/redispatch-event.js';\n\nimport {\n DIALOG_DEFAULT_CLOSE_ANIMATION,\n DIALOG_DEFAULT_OPEN_ANIMATION,\n DialogAnimation,\n DialogAnimationArgs,\n} from './animations.js';\n\n// Separate variable needed for closure.\nconst dialogBaseClass = mixinDelegatesAria(LitElement);\n\n/**\n * A dialog component.\n *\n * @fires open {Event} Dispatched when the dialog is opening before any animations.\n * @fires opened {Event} Dispatched when the dialog has opened after any animations.\n * @fires close {Event} Dispatched when the dialog is closing before any animations.\n * @fires closed {Event} Dispatched when the dialog has closed after any animations.\n * @fires cancel {Event} Dispatched when the dialog has been canceled by clicking\n * on the scrim or pressing Escape.\n */\nexport class Dialog extends dialogBaseClass {\n // We do not use `delegatesFocus: true` due to a Chromium bug with\n // selecting text.\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=950357\n\n /**\n * Opens the dialog when set to `true` and closes it when set to `false`.\n */\n @property({type: Boolean})\n get open() {\n return this.isOpen;\n }\n\n set open(open: boolean) {\n if (open === this.isOpen) {\n return;\n }\n\n this.isOpen = open;\n if (open) {\n this.setAttribute('open', '');\n this.show();\n } else {\n this.removeAttribute('open');\n this.close();\n }\n }\n\n /**\n * Skips the opening and closing animations.\n */\n @property({type: Boolean}) quick = false;\n\n /**\n * Gets or sets the dialog's return value, usually to indicate which button\n * a user pressed to close it.\n *\n * https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/returnValue\n */\n @property({attribute: false}) returnValue = '';\n\n /**\n * The type of dialog for accessibility. Set this to `alert` to announce a\n * dialog as an alert dialog.\n */\n @property() type?: 'alert';\n\n /**\n * Disables focus trapping, which by default keeps keyboard Tab navigation\n * within the dialog.\n *\n * When disabled, after focusing the last element of a dialog, pressing Tab\n * again will release focus from the window back to the browser (such as the\n * URL bar).\n *\n * Focus trapping is recommended for accessibility, and should not typically\n * be disabled. Only turn this off if the use case of a dialog is more\n * accessible without focus trapping.\n */\n @property({type: Boolean, attribute: 'no-focus-trap'})\n noFocusTrap = false;\n\n /**\n * Gets the opening animation for a dialog. Set to a new function to customize\n * the animation.\n */\n getOpenAnimation = () => DIALOG_DEFAULT_OPEN_ANIMATION;\n\n /**\n * Gets the closing animation for a dialog. Set to a new function to customize\n * the animation.\n */\n getCloseAnimation = () => DIALOG_DEFAULT_CLOSE_ANIMATION;\n\n private isOpen = false;\n private isOpening = false;\n // getIsConnectedPromise() immediately sets the resolve property.\n private isConnectedPromiseResolve!: () => void;\n private isConnectedPromise = this.getIsConnectedPromise();\n @query('dialog') private readonly dialog!: HTMLDialogElement | null;\n @query('.scrim') private readonly scrim!: HTMLDialogElement | null;\n @query('.container') private readonly container!: HTMLDialogElement | null;\n @query('.headline') private readonly headline!: HTMLDialogElement | null;\n @query('.content') private readonly content!: HTMLDialogElement | null;\n @query('.actions') private readonly actions!: HTMLDialogElement | null;\n @state() private isAtScrollTop = false;\n @state() private isAtScrollBottom = false;\n @query('.scroller') private readonly scroller!: HTMLElement | null;\n @query('.top.anchor') private readonly topAnchor!: HTMLElement | null;\n @query('.bottom.anchor') private readonly bottomAnchor!: HTMLElement | null;\n @query('.focus-trap')\n private readonly firstFocusTrap!: HTMLElement | null;\n private nextClickIsFromContent = false;\n private intersectionObserver?: IntersectionObserver;\n // Dialogs should not be SSR'd while open, so we can just use runtime checks.\n @state() private hasHeadline = false;\n @state() private hasActions = false;\n @state() private hasIcon = false;\n private cancelAnimations?: AbortController;\n\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=1512224\n // Chrome v120 has a bug where escape keys do not trigger cancels. If we get\n // a dialog \"close\" event that is triggered without a \"cancel\" after an escape\n // keydown, then we need to manually trigger our closing logic.\n //\n // This bug occurs when pressing escape to close a dialog without first\n // interacting with the dialog's content.\n //\n // Cleanup tracking:\n // https://github.com/material-components/material-web/issues/5330\n // This can be removed when full CloseWatcher support added and the above bug\n // in Chromium is fixed to fire 'cancel' with one escape press and close with\n // multiple.\n private escapePressedWithoutCancel = false;\n // This TreeWalker is used to walk through a dialog's children to find\n // focusable elements. TreeWalker is faster than `querySelectorAll('*')`.\n // We check for isServer because there isn't a \"document\" during an SSR\n // run.\n private readonly treewalker = isServer\n ? null\n : document.createTreeWalker(this, NodeFilter.SHOW_ELEMENT);\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('submit', this.handleSubmit);\n }\n }\n\n /**\n * Opens the dialog and fires a cancelable `open` event. After a dialog's\n * animation, an `opened` event is fired.\n *\n * Add an `autofocus` attribute to a child of the dialog that should\n * receive focus after opening.\n *\n * @return A Promise that resolves after the animation is finished and the\n * `opened` event was fired.\n */\n async show() {\n this.isOpening = true;\n // Dialogs can be opened before being attached to the DOM, so we need to\n // wait until we're connected before calling `showModal()`.\n await this.isConnectedPromise;\n await this.updateComplete;\n const dialog = this.dialog!;\n // Check if already opened or if `dialog.close()` was called while awaiting.\n if (dialog.open || !this.isOpening) {\n this.isOpening = false;\n return;\n }\n\n const preventOpen = !this.dispatchEvent(\n new Event('open', {cancelable: true}),\n );\n if (preventOpen) {\n this.open = false;\n this.isOpening = false;\n return;\n }\n\n // All Material dialogs are modal.\n dialog.showModal();\n this.open = true;\n // Reset scroll position if re-opening a dialog with the same content.\n if (this.scroller) {\n this.scroller.scrollTop = 0;\n }\n // Native modal dialogs ignore autofocus and instead force focus to the\n // first focusable child. Override this behavior if there is a child with\n // an autofocus attribute.\n this.querySelector<HTMLElement>('[autofocus]')?.focus();\n\n await this.animateDialog(this.getOpenAnimation());\n this.dispatchEvent(new Event('opened'));\n this.isOpening = false;\n }\n\n /**\n * Closes the dialog and fires a cancelable `close` event. After a dialog's\n * animation, a `closed` event is fired.\n *\n * @param returnValue A return value usually indicating which button was used\n * to close a dialog. If a dialog is canceled by clicking the scrim or\n * pressing Escape, it will not change the return value after closing.\n * @return A Promise that resolves after the animation is finished and the\n * `closed` event was fired.\n */\n async close(returnValue = this.returnValue) {\n this.isOpening = false;\n if (!this.isConnected) {\n // Disconnected dialogs do not fire close events or animate.\n this.open = false;\n return;\n }\n\n await this.updateComplete;\n const dialog = this.dialog!;\n // Check if already closed or if `dialog.show()` was called while awaiting.\n if (!dialog.open || this.isOpening) {\n this.open = false;\n return;\n }\n\n const prevReturnValue = this.returnValue;\n this.returnValue = returnValue;\n const preventClose = !this.dispatchEvent(\n new Event('close', {cancelable: true}),\n );\n if (preventClose) {\n this.returnValue = prevReturnValue;\n return;\n }\n\n await this.animateDialog(this.getCloseAnimation());\n dialog.close(returnValue);\n this.open = false;\n this.dispatchEvent(new Event('closed'));\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.isConnectedPromiseResolve();\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.isConnectedPromise = this.getIsConnectedPromise();\n }\n\n protected override render() {\n const scrollable =\n this.open && !(this.isAtScrollTop && this.isAtScrollBottom);\n const classes = {\n 'has-headline': this.hasHeadline,\n 'has-actions': this.hasActions,\n 'has-icon': this.hasIcon,\n 'scrollable': scrollable,\n 'show-top-divider': scrollable && !this.isAtScrollTop,\n 'show-bottom-divider': scrollable && !this.isAtScrollBottom,\n };\n\n // The focus trap sentinels are only added after the dialog opens, since\n // dialog.showModal() will try to autofocus them, even with tabindex=\"-1\".\n const showFocusTrap = this.open && !this.noFocusTrap;\n const focusTrap = html`\n <div\n class=\"focus-trap\"\n tabindex=\"0\"\n aria-hidden=\"true\"\n @focus=${this.handleFocusTrapFocus}></div>\n `;\n\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <div class=\"scrim\"></div>\n <dialog\n class=${classMap(classes)}\n aria-label=${ariaLabel || nothing}\n aria-labelledby=${this.hasHeadline ? 'headline' : nothing}\n role=${this.type === 'alert' ? 'alertdialog' : nothing}\n @cancel=${this.handleCancel}\n @click=${this.handleDialogClick}\n @close=${this.handleClose}\n @keydown=${this.handleKeydown}\n .returnValue=${this.returnValue || nothing}>\n ${showFocusTrap ? focusTrap : nothing}\n <div class=\"container\" @click=${this.handleContentClick}>\n <div class=\"headline\">\n <div class=\"icon\" aria-hidden=\"true\">\n <slot name=\"icon\" @slotchange=${this.handleIconChange}></slot>\n </div>\n <h2 id=\"headline\" aria-hidden=${!this.hasHeadline || nothing}>\n <slot\n name=\"headline\"\n @slotchange=${this.handleHeadlineChange}></slot>\n </h2>\n <md-divider></md-divider>\n </div>\n <div class=\"scroller\">\n <div class=\"content\">\n <div class=\"top anchor\"></div>\n <slot name=\"content\"></slot>\n <div class=\"bottom anchor\"></div>\n </div>\n </div>\n <div class=\"actions\">\n <md-divider></md-divider>\n <slot name=\"actions\" @slotchange=${this.handleActionsChange}></slot>\n </div>\n </div>\n ${showFocusTrap ? focusTrap : nothing}\n </dialog>\n `;\n }\n\n protected override firstUpdated() {\n this.intersectionObserver = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n this.handleAnchorIntersection(entry);\n }\n },\n {root: this.scroller!},\n );\n\n this.intersectionObserver.observe(this.topAnchor!);\n this.intersectionObserver.observe(this.bottomAnchor!);\n }\n\n private handleDialogClick() {\n if (this.nextClickIsFromContent) {\n // Avoid doing a layout calculation below if we know the click came from\n // content.\n this.nextClickIsFromContent = false;\n return;\n }\n\n // Click originated on the backdrop. Native `<dialog>`s will not cancel,\n // but Material dialogs do.\n const preventDefault = !this.dispatchEvent(\n new Event('cancel', {cancelable: true}),\n );\n if (preventDefault) {\n return;\n }\n\n this.close();\n }\n\n private handleContentClick() {\n this.nextClickIsFromContent = true;\n }\n\n private handleSubmit(event: SubmitEvent) {\n const form = event.target as HTMLFormElement;\n const {submitter} = event;\n if (form.getAttribute('method') !== 'dialog' || !submitter) {\n return;\n }\n\n // Close reason is the submitter's value attribute, or the dialog's\n // `returnValue` if there is no attribute.\n this.close(submitter.getAttribute('value') ?? this.returnValue);\n }\n\n private handleCancel(event: Event) {\n if (event.target !== this.dialog) {\n // Ignore any cancel events dispatched by content.\n return;\n }\n\n this.escapePressedWithoutCancel = false;\n const preventDefault = !redispatchEvent(this, event);\n // We always prevent default on the original dialog event since we'll\n // animate closing it before it actually closes.\n event.preventDefault();\n if (preventDefault) {\n return;\n }\n\n this.close();\n }\n\n private handleClose() {\n if (!this.escapePressedWithoutCancel) {\n return;\n }\n\n this.escapePressedWithoutCancel = false;\n this.dialog?.dispatchEvent(new Event('cancel', {cancelable: true}));\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (event.key !== 'Escape') {\n return;\n }\n\n // An escape key was pressed. If a \"close\" event fires next without a\n // \"cancel\" event first, then we know we're in the Chrome v120 bug.\n this.escapePressedWithoutCancel = true;\n // Wait a full task for the cancel/close event listeners to fire, then\n // reset the flag.\n setTimeout(() => {\n this.escapePressedWithoutCancel = false;\n });\n }\n\n private async animateDialog(animation: DialogAnimation) {\n // Always cancel the previous animations. Animations can include `fill`\n // modes that need to be cleared when `quick` is toggled. If not, content\n // that faded out will remain hidden when a `quick` dialog re-opens after\n // previously opening and closing without `quick`.\n this.cancelAnimations?.abort();\n this.cancelAnimations = new AbortController();\n if (this.quick) {\n return;\n }\n\n const {dialog, scrim, container, headline, content, actions} = this;\n if (!dialog || !scrim || !container || !headline || !content || !actions) {\n return;\n }\n\n const {\n container: containerAnimate,\n dialog: dialogAnimate,\n scrim: scrimAnimate,\n headline: headlineAnimate,\n content: contentAnimate,\n actions: actionsAnimate,\n } = animation;\n\n const elementAndAnimation: Array<[Element, DialogAnimationArgs[]]> = [\n [dialog, dialogAnimate ?? []],\n [scrim, scrimAnimate ?? []],\n [container, containerAnimate ?? []],\n [headline, headlineAnimate ?? []],\n [content, contentAnimate ?? []],\n [actions, actionsAnimate ?? []],\n ];\n\n const animations: Animation[] = [];\n for (const [element, animation] of elementAndAnimation) {\n for (const animateArgs of animation) {\n const animation = element.animate(...animateArgs);\n this.cancelAnimations.signal.addEventListener('abort', () => {\n animation.cancel();\n });\n\n animations.push(animation);\n }\n }\n\n await Promise.all(\n animations.map((animation) =>\n animation.finished.catch(() => {\n // Ignore intentional AbortErrors when calling `animation.cancel()`.\n }),\n ),\n );\n }\n\n private handleHeadlineChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasHeadline = slot.assignedElements().length > 0;\n }\n\n private handleActionsChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasActions = slot.assignedElements().length > 0;\n }\n\n private handleIconChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasIcon = slot.assignedElements().length > 0;\n }\n\n private handleAnchorIntersection(entry: IntersectionObserverEntry) {\n const {target, isIntersecting} = entry;\n if (target === this.topAnchor) {\n this.isAtScrollTop = isIntersecting;\n }\n\n if (target === this.bottomAnchor) {\n this.isAtScrollBottom = isIntersecting;\n }\n }\n\n private getIsConnectedPromise() {\n return new Promise<void>((resolve) => {\n this.isConnectedPromiseResolve = resolve;\n });\n }\n\n private handleFocusTrapFocus(event: FocusEvent) {\n const [firstFocusableChild, lastFocusableChild] =\n this.getFirstAndLastFocusableChildren();\n if (!firstFocusableChild || !lastFocusableChild) {\n // When a dialog does not have focusable children, the dialog itself\n // receives focus.\n this.dialog?.focus();\n return;\n }\n\n // To determine which child to focus, we need to know which focus trap\n // received focus...\n const isFirstFocusTrap = event.target === this.firstFocusTrap;\n const isLastFocusTrap = !isFirstFocusTrap;\n // ...and where the focus came from (what was previously focused).\n const focusCameFromFirstChild = event.relatedTarget === firstFocusableChild;\n const focusCameFromLastChild = event.relatedTarget === lastFocusableChild;\n // Although this is a focus trap, focus can come from outside the trap.\n // This can happen when elements are programmatically `focus()`'d. It also\n // happens when focus leaves and returns to the window, such as clicking on\n // the browser's URL bar and pressing Tab, or switching focus between\n // iframes.\n const focusCameFromOutsideDialog =\n !focusCameFromFirstChild && !focusCameFromLastChild;\n\n // Focus the dialog's first child when we reach the end of the dialog and\n // focus is moving forward. Or, when focus is moving forwards into the\n // dialog from outside of the window.\n const shouldFocusFirstChild =\n (isLastFocusTrap && focusCameFromLastChild) ||\n (isFirstFocusTrap && focusCameFromOutsideDialog);\n if (shouldFocusFirstChild) {\n firstFocusableChild.focus();\n return;\n }\n\n // Focus the dialog's last child when we reach the beginning of the dialog\n // and focus is moving backward. Or, when focus is moving backwards into the\n // dialog from outside of the window.\n const shouldFocusLastChild =\n (isFirstFocusTrap && focusCameFromFirstChild) ||\n (isLastFocusTrap && focusCameFromOutsideDialog);\n if (shouldFocusLastChild) {\n lastFocusableChild.focus();\n return;\n }\n\n // The booleans above are verbose for readability, but code executation\n // won't actually reach here.\n }\n\n private getFirstAndLastFocusableChildren():\n | [HTMLElement, HTMLElement]\n | [null, null] {\n if (!this.treewalker) {\n return [null, null];\n }\n\n let firstFocusableChild: HTMLElement | null = null;\n let lastFocusableChild: HTMLElement | null = null;\n\n // Reset the current node back to the root host element.\n this.treewalker.currentNode = this.treewalker.root;\n while (this.treewalker.nextNode()) {\n // Cast as Element since the TreeWalker filter only accepts Elements.\n const nextChild = this.treewalker.currentNode as Element;\n if (!isFocusable(nextChild)) {\n continue;\n }\n\n if (!firstFocusableChild) {\n firstFocusableChild = nextChild;\n }\n\n lastFocusableChild = nextChild;\n }\n\n // We set lastFocusableChild immediately after finding a\n // firstFocusableChild, which means the pair is either both null or both\n // non-null. Cast since TypeScript does not recognize this.\n return [firstFocusableChild, lastFocusableChild] as\n | [HTMLElement, HTMLElement]\n | [null, null];\n }\n}\n\nfunction isFocusable(element: Element): element is HTMLElement {\n // Check if the element is a known built-in focusable element:\n // - <a> and <area> with `href` attributes.\n // - Form controls that are not disabled.\n // - `contenteditable` elements.\n // - Anything with a non-negative `tabindex`.\n const knownFocusableElements =\n ':is(button,input,select,textarea,object,:is(a,area)[href],[tabindex],[contenteditable=true])';\n const notDisabled = ':not(:disabled,[disabled])';\n const notNegativeTabIndex = ':not([tabindex^=\"-\"])';\n if (\n element.matches(knownFocusableElements + notDisabled + notNegativeTabIndex)\n ) {\n return true;\n }\n\n const isCustomElement = element.localName.includes('-');\n if (!isCustomElement) {\n return false;\n }\n\n // If a custom element does not have a tabindex, it may still be focusable\n // if it delegates focus with a shadow root. We also need to check again if\n // the custom element is a disabled form control.\n if (!element.matches(notDisabled)) {\n return false;\n }\n\n return element.shadowRoot?.delegatesFocus ?? false;\n}\n"]}
@@ -41,6 +41,12 @@ export declare class IconButton extends iconButtonBaseClass implements FormSubmi
41
41
  * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.
42
42
  */
43
43
  href: string;
44
+ /**
45
+ * The filename to use when downloading the linked resource.
46
+ * If not specified, the browser will determine a filename.
47
+ * This is only applicable when the icon button is used as a link (`href` is set).
48
+ */
49
+ download: string;
44
50
  /**
45
51
  * Sets the underlying `HTMLAnchorElement`'s `target` attribute.
46
52
  */
@@ -64,6 +64,12 @@ export class IconButton extends iconButtonBaseClass {
64
64
  * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.
65
65
  */
66
66
  this.href = '';
67
+ /**
68
+ * The filename to use when downloading the linked resource.
69
+ * If not specified, the browser will determine a filename.
70
+ * This is only applicable when the icon button is used as a link (`href` is set).
71
+ */
72
+ this.download = '';
67
73
  /**
68
74
  * Sets the underlying `HTMLAnchorElement`'s `target` attribute.
69
75
  */
@@ -143,6 +149,7 @@ export class IconButton extends iconButtonBaseClass {
143
149
  class="link"
144
150
  id="link"
145
151
  href="${this.href}"
152
+ download="${this.download || nothing}"
146
153
  target="${this.target || nothing}"
147
154
  aria-label="${ariaLabel || nothing}">
148
155
  ${this.renderTouchTarget()}
@@ -237,6 +244,9 @@ __decorate([
237
244
  __decorate([
238
245
  property()
239
246
  ], IconButton.prototype, "href", void 0);
247
+ __decorate([
248
+ property()
249
+ ], IconButton.prototype, "download", void 0);
240
250
  __decorate([
241
251
  property()
242
252
  ], IconButton.prototype, "target", void 0);
@@ -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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O,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, isServer, 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 {mixinDelegatesAria} 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 = mixinDelegatesAria(\n mixinElementInternals(LitElement),\n);\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 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 * \"Soft-disables\" the icon button (disabled but still focusable).\n *\n * Use this when an icon button needs increased visibility when disabled. See\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls\n * for more guidance on when this is needed.\n */\n @property({type: Boolean, attribute: 'soft-disabled', reflect: true})\n softDisabled = 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 constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', this.handleClick.bind(this));\n }\n }\n\n protected override willUpdate() {\n // Link buttons cannot be disabled or soft-disabled.\n if (this.href) {\n this.disabled = false;\n this.softDisabled = 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 aria-disabled=${(!this.href && this.softDisabled) || nothing}\n ?disabled=\"${!this.href && this.disabled}\"\n @click=\"${this.handleClickOnChild}\">\n ${this.renderFocusRing()}\n ${this.renderRipple()}\n ${!this.selected ? this.renderIcon() : nothing}\n ${this.selected ? this.renderSelectedIcon() : nothing}\n ${this.href ? this.renderLink() : this.renderTouchTarget()}\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}\">\n ${this.renderTouchTarget()}\n </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 const isRippleDisabled = !this.href && (this.disabled || this.softDisabled);\n // TODO(b/310046938): use the same id for both elements\n return html`<md-ripple\n for=${this.href ? 'link' : nothing}\n ?disabled=\"${isRippleDisabled}\"></md-ripple>`;\n }\n\n override connectedCallback() {\n this.flipIcon = isRtl(this, this.flipIconInRtl);\n super.connectedCallback();\n }\n\n /** Handles a click on this element. */\n private handleClick(event: MouseEvent) {\n // If the icon button is soft-disabled, we need to explicitly prevent the\n // click from propagating to other event listeners as well as prevent the\n // default action.\n if (!this.href && this.softDisabled) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n }\n\n /**\n * Handles a click on the child <div> or <button> element within this\n * element's shadow DOM.\n */\n private async handleClickOnChild(event: Event) {\n // Allow the event to propagate\n await 0;\n if (\n !this.toggle ||\n this.disabled ||\n this.softDisabled ||\n event.defaultPrevented\n ) {\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","sourceRoot":"","sources":["icon-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,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,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAEL,kBAAkB,GAEnB,MAAM,6CAA6C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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, isServer, 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 {mixinDelegatesAria} 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 = mixinDelegatesAria(\n mixinElementInternals(LitElement),\n);\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 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 * \"Soft-disables\" the icon button (disabled but still focusable).\n *\n * Use this when an icon button needs increased visibility when disabled. See\n * https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_disabled_controls\n * for more guidance on when this is needed.\n */\n @property({type: Boolean, attribute: 'soft-disabled', reflect: true})\n softDisabled = 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 * The filename to use when downloading the linked resource.\n * If not specified, the browser will determine a filename.\n * This is only applicable when the icon button is used as a link (`href` is set).\n */\n @property() download = '';\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 constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', this.handleClick.bind(this));\n }\n }\n\n protected override willUpdate() {\n // Link buttons cannot be disabled or soft-disabled.\n if (this.href) {\n this.disabled = false;\n this.softDisabled = 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 aria-disabled=${(!this.href && this.softDisabled) || nothing}\n ?disabled=\"${!this.href && this.disabled}\"\n @click=\"${this.handleClickOnChild}\">\n ${this.renderFocusRing()}\n ${this.renderRipple()}\n ${!this.selected ? this.renderIcon() : nothing}\n ${this.selected ? this.renderSelectedIcon() : nothing}\n ${this.href ? this.renderLink() : this.renderTouchTarget()}\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 download=\"${this.download || nothing}\"\n target=\"${this.target || nothing}\"\n aria-label=\"${ariaLabel || nothing}\">\n ${this.renderTouchTarget()}\n </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 const isRippleDisabled = !this.href && (this.disabled || this.softDisabled);\n // TODO(b/310046938): use the same id for both elements\n return html`<md-ripple\n for=${this.href ? 'link' : nothing}\n ?disabled=\"${isRippleDisabled}\"></md-ripple>`;\n }\n\n override connectedCallback() {\n this.flipIcon = isRtl(this, this.flipIconInRtl);\n super.connectedCallback();\n }\n\n /** Handles a click on this element. */\n private handleClick(event: MouseEvent) {\n // If the icon button is soft-disabled, we need to explicitly prevent the\n // click from propagating to other event listeners as well as prevent the\n // default action.\n if (!this.href && this.softDisabled) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n }\n\n /**\n * Handles a click on the child <div> or <button> element within this\n * element's shadow DOM.\n */\n private async handleClickOnChild(event: Event) {\n // Allow the event to propagate\n await 0;\n if (\n !this.toggle ||\n this.disabled ||\n this.softDisabled ||\n event.defaultPrevented\n ) {\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"]}
@@ -77,5 +77,6 @@ export declare class ListItemEl extends listItemBaseClass implements ListItem {
77
77
  protected renderBody(): TemplateResult<1>;
78
78
  protected onFocus(): void;
79
79
  focus(): void;
80
+ click(): void;
80
81
  }
81
82
  export {};
@@ -165,6 +165,16 @@ export class ListItemEl extends listItemBaseClass {
165
165
  // work programmatically like in FF and select-option
166
166
  this.listItemRoot?.focus();
167
167
  }
168
+ click() {
169
+ if (!this.listItemRoot) {
170
+ // If the element has not finished rendering, call super to ensure click
171
+ // events are dispatched.
172
+ super.click();
173
+ return;
174
+ }
175
+ // Forward click to the element to ensure link <a>.click() works correctly.
176
+ this.listItemRoot.click();
177
+ }
168
178
  }
169
179
  /** @nocollapse */
170
180
  ListItemEl.shadowRootOptions = {
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.js","sourceRoot":"","sources":["list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,iCAAiC,CAAC;AACzC,OAAO,4BAA4B,CAAC;AACpC,OAAO,2BAA2B,CAAC;AAEnC,OAAO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9B;IAAvC,KAAK,CAAC,YAAY,CAAC;gDAAsD","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../focus/md-focus-ring.js';\nimport '../../../labs/item/item.js';\nimport '../../../ripple/ripple.js';\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {literal, html as staticHtml, StaticValue} from 'lit/static-html.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {mixinDelegatesAria} from '../../../internal/aria/delegate.js';\nimport {\n createRequestActivationEvent,\n ListItem,\n} from '../list-navigation-helpers.js';\n\n/**\n * Supported behaviors for a list item.\n */\nexport type ListItemType = 'text' | 'button' | 'link';\n\n// Separate variable needed for closure.\nconst listItemBaseClass = mixinDelegatesAria(LitElement);\n\n/**\n * @fires request-activation {Event} Requests the list to set `tabindex=0` on\n * the item and focus it. --bubbles --composed\n */\nexport class ListItemEl extends listItemBaseClass implements ListItem {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Disables the item and makes it non-selectable and non-interactive.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * Sets the behavior of the list item, defaults to \"text\". Change to \"link\" or\n * \"button\" for interactive items.\n */\n @property({reflect: true}) type: ListItemType = 'text';\n\n /**\n * READONLY. Sets the `md-list-item` attribute on the element.\n */\n @property({type: Boolean, attribute: 'md-list-item', reflect: true})\n isListItem = true;\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 when `href` is\n * set.\n */\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n\n @query('.list-item') protected readonly listItemRoot!: HTMLElement | null;\n\n private get isDisabled() {\n return this.disabled && this.type !== 'link';\n }\n\n protected override willUpdate(changed: PropertyValues<ListItemEl>) {\n if (this.href) {\n this.type = 'link';\n }\n\n super.willUpdate(changed);\n }\n\n protected override render() {\n return this.renderListItem(html`\n <md-item>\n <div slot=\"container\">\n ${this.renderRipple()} ${this.renderFocusRing()}\n </div>\n <slot name=\"start\" slot=\"start\"></slot>\n <slot name=\"end\" slot=\"end\"></slot>\n ${this.renderBody()}\n </md-item>\n `);\n }\n\n /**\n * Renders the root list item.\n *\n * @param content the child content of the list item.\n */\n protected renderListItem(content: unknown) {\n const isAnchor = this.type === 'link';\n let tag: StaticValue;\n switch (this.type) {\n case 'link':\n tag = literal`a`;\n break;\n case 'button':\n tag = literal`button`;\n break;\n default:\n case 'text':\n tag = literal`li`;\n break;\n }\n\n const isInteractive = this.type !== 'text';\n // TODO(b/265339866): announce \"button\"/\"link\" inside of a list item. Until\n // then all are \"listitem\" roles for correct announcement.\n const target = isAnchor && !!this.target ? this.target : nothing;\n return staticHtml`\n <${tag}\n id=\"item\"\n tabindex=\"${this.isDisabled || !isInteractive ? -1 : 0}\"\n ?disabled=${this.isDisabled}\n role=\"listitem\"\n aria-selected=${(this as ARIAMixinStrict).ariaSelected || nothing}\n aria-checked=${(this as ARIAMixinStrict).ariaChecked || nothing}\n aria-expanded=${(this as ARIAMixinStrict).ariaExpanded || nothing}\n aria-haspopup=${(this as ARIAMixinStrict).ariaHasPopup || nothing}\n class=\"list-item ${classMap(this.getRenderClasses())}\"\n href=${this.href || nothing}\n target=${target}\n @focus=${this.onFocus}\n >${content}</${tag}>\n `;\n }\n\n /**\n * Handles rendering of the ripple element.\n */\n protected renderRipple(): TemplateResult | typeof nothing {\n if (this.type === 'text') {\n return nothing;\n }\n\n return html` <md-ripple\n part=\"ripple\"\n for=\"item\"\n ?disabled=${this.isDisabled}></md-ripple>`;\n }\n\n /**\n * Handles rendering of the focus ring.\n */\n protected renderFocusRing(): TemplateResult | typeof nothing {\n if (this.type === 'text') {\n return nothing;\n }\n\n return html` <md-focus-ring\n @visibility-changed=${this.onFocusRingVisibilityChanged}\n part=\"focus-ring\"\n for=\"item\"\n inward></md-focus-ring>`;\n }\n\n protected onFocusRingVisibilityChanged(e: Event) {}\n\n /**\n * Classes applied to the list item root.\n */\n protected getRenderClasses(): ClassInfo {\n return {'disabled': this.isDisabled};\n }\n\n /**\n * Handles rendering the headline and supporting text.\n */\n protected renderBody() {\n return html`\n <slot></slot>\n <slot name=\"overline\" slot=\"overline\"></slot>\n <slot name=\"headline\" slot=\"headline\"></slot>\n <slot name=\"supporting-text\" slot=\"supporting-text\"></slot>\n <slot\n name=\"trailing-supporting-text\"\n slot=\"trailing-supporting-text\"></slot>\n `;\n }\n\n protected onFocus() {\n if (this.tabIndex !== -1) {\n return;\n }\n // Handles the case where the user clicks on the element and then tabs.\n this.dispatchEvent(createRequestActivationEvent());\n }\n\n override focus() {\n // TODO(b/300334509): needed for some cases where delegatesFocus doesn't\n // work programmatically like in FF and select-option\n this.listItemRoot?.focus();\n }\n}\n"]}
1
+ {"version":3,"file":"list-item.js","sourceRoot":"","sources":["list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,iCAAiC,CAAC;AACzC,OAAO,4BAA4B,CAAC;AACpC,OAAO,2BAA2B,CAAC;AAEnC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,OAAO,EAAE,IAAI,IAAI,UAAU,EAAc,MAAM,oBAAoB,CAAC;AAG5E,OAAO,EAAC,kBAAkB,EAAC,MAAM,oCAAoC,CAAC;AACtE,OAAO,EACL,4BAA4B,GAE7B,MAAM,+BAA+B,CAAC;AAOvC,wCAAwC;AACxC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,UAAU,CAAC,C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B,OAAO,IAAI,CAAA;;;;;;;;KAQV,CAAC;IACJ,CAAC;IAES,OAAO;QACf,IAAI,IAAI,CAAC,QAAQ,KAAK,CAAC,CAAC,EAAE,CAAC;YACzB,OAAO;QACT,CAAC;QACD,uEAAuE;QACvE,IAAI,CAAC,aAAa,CAAC,4BAA4B,EAAE,CAAC,CAAC;IACrD,CAAC;IAEQ,KAAK;QACZ,wEAAwE;QACxE,qDAAqD;QACrD,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEQ,KAAK;QACZ,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,wEAAwE;YACxE,yBAAyB;YACzB,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,OAAO;QACT,CAAC;QAED,2EAA2E;QAC3E,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;;AArLD,kBAAkB;AACF,4BAAiB,GAAG;IAClC,GAAG,UAAU,CAAC,iBAAiB;IAC/B,cAAc,EAAE,IAAI;CACrB,AAHgC,CAG/B;AAKwC;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;4CAAkB;AAMhC;IAA1B,QAAQ,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;wCAA6B;AAMvD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAClD;AAKN;IAAX,QAAQ,EAAE;wCAAW;AAMV;IAAX,QAAQ,EAAE;0CAA2D;AAE9B;IAAvC,KAAK,CAAC,YAAY,CAAC;gDAAsD","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../focus/md-focus-ring.js';\nimport '../../../labs/item/item.js';\nimport '../../../ripple/ripple.js';\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {literal, html as staticHtml, StaticValue} from 'lit/static-html.js';\n\nimport {ARIAMixinStrict} from '../../../internal/aria/aria.js';\nimport {mixinDelegatesAria} from '../../../internal/aria/delegate.js';\nimport {\n createRequestActivationEvent,\n ListItem,\n} from '../list-navigation-helpers.js';\n\n/**\n * Supported behaviors for a list item.\n */\nexport type ListItemType = 'text' | 'button' | 'link';\n\n// Separate variable needed for closure.\nconst listItemBaseClass = mixinDelegatesAria(LitElement);\n\n/**\n * @fires request-activation {Event} Requests the list to set `tabindex=0` on\n * the item and focus it. --bubbles --composed\n */\nexport class ListItemEl extends listItemBaseClass implements ListItem {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Disables the item and makes it non-selectable and non-interactive.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * Sets the behavior of the list item, defaults to \"text\". Change to \"link\" or\n * \"button\" for interactive items.\n */\n @property({reflect: true}) type: ListItemType = 'text';\n\n /**\n * READONLY. Sets the `md-list-item` attribute on the element.\n */\n @property({type: Boolean, attribute: 'md-list-item', reflect: true})\n isListItem = true;\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 when `href` is\n * set.\n */\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n\n @query('.list-item') protected readonly listItemRoot!: HTMLElement | null;\n\n private get isDisabled() {\n return this.disabled && this.type !== 'link';\n }\n\n protected override willUpdate(changed: PropertyValues<ListItemEl>) {\n if (this.href) {\n this.type = 'link';\n }\n\n super.willUpdate(changed);\n }\n\n protected override render() {\n return this.renderListItem(html`\n <md-item>\n <div slot=\"container\">\n ${this.renderRipple()} ${this.renderFocusRing()}\n </div>\n <slot name=\"start\" slot=\"start\"></slot>\n <slot name=\"end\" slot=\"end\"></slot>\n ${this.renderBody()}\n </md-item>\n `);\n }\n\n /**\n * Renders the root list item.\n *\n * @param content the child content of the list item.\n */\n protected renderListItem(content: unknown) {\n const isAnchor = this.type === 'link';\n let tag: StaticValue;\n switch (this.type) {\n case 'link':\n tag = literal`a`;\n break;\n case 'button':\n tag = literal`button`;\n break;\n default:\n case 'text':\n tag = literal`li`;\n break;\n }\n\n const isInteractive = this.type !== 'text';\n // TODO(b/265339866): announce \"button\"/\"link\" inside of a list item. Until\n // then all are \"listitem\" roles for correct announcement.\n const target = isAnchor && !!this.target ? this.target : nothing;\n return staticHtml`\n <${tag}\n id=\"item\"\n tabindex=\"${this.isDisabled || !isInteractive ? -1 : 0}\"\n ?disabled=${this.isDisabled}\n role=\"listitem\"\n aria-selected=${(this as ARIAMixinStrict).ariaSelected || nothing}\n aria-checked=${(this as ARIAMixinStrict).ariaChecked || nothing}\n aria-expanded=${(this as ARIAMixinStrict).ariaExpanded || nothing}\n aria-haspopup=${(this as ARIAMixinStrict).ariaHasPopup || nothing}\n class=\"list-item ${classMap(this.getRenderClasses())}\"\n href=${this.href || nothing}\n target=${target}\n @focus=${this.onFocus}\n >${content}</${tag}>\n `;\n }\n\n /**\n * Handles rendering of the ripple element.\n */\n protected renderRipple(): TemplateResult | typeof nothing {\n if (this.type === 'text') {\n return nothing;\n }\n\n return html` <md-ripple\n part=\"ripple\"\n for=\"item\"\n ?disabled=${this.isDisabled}></md-ripple>`;\n }\n\n /**\n * Handles rendering of the focus ring.\n */\n protected renderFocusRing(): TemplateResult | typeof nothing {\n if (this.type === 'text') {\n return nothing;\n }\n\n return html` <md-focus-ring\n @visibility-changed=${this.onFocusRingVisibilityChanged}\n part=\"focus-ring\"\n for=\"item\"\n inward></md-focus-ring>`;\n }\n\n protected onFocusRingVisibilityChanged(e: Event) {}\n\n /**\n * Classes applied to the list item root.\n */\n protected getRenderClasses(): ClassInfo {\n return {'disabled': this.isDisabled};\n }\n\n /**\n * Handles rendering the headline and supporting text.\n */\n protected renderBody() {\n return html`\n <slot></slot>\n <slot name=\"overline\" slot=\"overline\"></slot>\n <slot name=\"headline\" slot=\"headline\"></slot>\n <slot name=\"supporting-text\" slot=\"supporting-text\"></slot>\n <slot\n name=\"trailing-supporting-text\"\n slot=\"trailing-supporting-text\"></slot>\n `;\n }\n\n protected onFocus() {\n if (this.tabIndex !== -1) {\n return;\n }\n // Handles the case where the user clicks on the element and then tabs.\n this.dispatchEvent(createRequestActivationEvent());\n }\n\n override focus() {\n // TODO(b/300334509): needed for some cases where delegatesFocus doesn't\n // work programmatically like in FF and select-option\n this.listItemRoot?.focus();\n }\n\n override click() {\n if (!this.listItemRoot) {\n // If the element has not finished rendering, call super to ensure click\n // events are dispatched.\n super.click();\n return;\n }\n\n // Forward click to the element to ensure link <a>.click() works correctly.\n this.listItemRoot.click();\n }\n}\n"]}
@@ -100,7 +100,8 @@
100
100
  }
101
101
 
102
102
  .item-padding {
103
- padding-block: 8px;
103
+ padding-block: map.get($tokens, 'top-space')
104
+ map.get($tokens, 'bottom-space');
104
105
  }
105
106
 
106
107
  .has-overflow:not([popover]) .items {
@@ -1 +1 @@
1
- :host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=menu-styles.css.map */
1
+ :host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:var(--md-menu-top-space, 8px) var(--md-menu-bottom-space, 8px)}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=menu-styles.css.map */
@@ -1 +1 @@
1
- {"version":3,"sourceRoot":"","sources":["_menu.scss","../../elevation/internal/_elevation.scss","../../focus/internal/_focus-ring.scss"],"names":[],"mappings":"AAmCE,MCbI,iKDqBF,gBACA,YACA,iBAGF,cEzBI,mGFiCJ,MACE,0FACA,aACA,WACA,YACA,YACA,iBAEA,+BACA,cACA,UACA,WACA,kBACA,iBACA,mBACA,eACA,kBACA,kBACA,wBAGF,gBACE,aAGF,OACE,eAGF,OACE,cACA,qBACA,SACA,aACA,sBACA,gGACA,eACA,mBACA,cACA,kBACA,kBACA,sBACA,wBAGF,cACE,kBAGF,oCACE,iBAGF,iDAEE,gBAGF,+BAIE,oBAGF,sCACE,UAGF,KACE,cACA,eACA,mBAGF,4CACE,aAGF,8BACE,MACE,mBACA,wBACA","file":"menu-styles.css"}
1
+ {"version":3,"sourceRoot":"","sources":["_menu.scss","../../elevation/internal/_elevation.scss","../../focus/internal/_focus-ring.scss"],"names":[],"mappings":"AAmCE,MCbI,iKDqBF,gBACA,YACA,iBAGF,cEzBI,mGFiCJ,MACE,0FACA,aACA,WACA,YACA,YACA,iBAEA,+BACA,cACA,UACA,WACA,kBACA,iBACA,mBACA,eACA,kBACA,kBACA,wBAGF,gBACE,aAGF,OACE,eAGF,OACE,cACA,qBACA,SACA,aACA,sBACA,gGACA,eACA,mBACA,cACA,kBACA,kBACA,sBACA,wBAGF,cACE,6EAIF,oCACE,iBAGF,iDAEE,gBAGF,+BAIE,oBAGF,sCACE,UAGF,KACE,cACA,eACA,mBAGF,4CACE,aAGF,8BACE,MACE,mBACA,wBACA","file":"menu-styles.css"}
@@ -5,6 +5,6 @@
5
5
  */
6
6
  // Generated stylesheet for ./menu/internal/menu-styles.css.
7
7
  import { css } from 'lit';
8
- export const styles = css `:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}
8
+ export const styles = css `:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:var(--md-menu-top-space, 8px) var(--md-menu-bottom-space, 8px)}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}
9
9
  `;
10
10
  //# sourceMappingURL=menu-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-styles.js","sourceRoot":"","sources":["menu-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,4DAA4D;AAC5D,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 ./menu/internal/menu-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:8px}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}\n`;\n"]}
1
+ {"version":3,"file":"menu-styles.js","sourceRoot":"","sources":["menu-styles.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,4DAA4D;AAC5D,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 ./menu/internal/menu-styles.css.\nimport {css} from 'lit';\nexport const styles = css`:host{--md-elevation-level: var(--md-menu-container-elevation, 2);--md-elevation-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));min-width:112px;color:unset;display:contents}md-focus-ring{--md-focus-ring-shape: var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px))}.menu{border-radius:var(--md-menu-container-shape, var(--md-sys-shape-corner-extra-small, 4px));display:none;inset:auto;border:none;padding:0px;overflow:visible;background-color:rgba(0,0,0,0);color:inherit;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit;max-width:inherit;scrollbar-width:inherit}.menu::backdrop{display:none}.fixed{position:fixed}.items{display:block;list-style-type:none;margin:0;outline:none;box-sizing:border-box;background-color:var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));height:inherit;max-height:inherit;overflow:auto;min-width:inherit;max-width:inherit;border-radius:inherit;scrollbar-width:inherit}.item-padding{padding-block:var(--md-menu-top-space, 8px) var(--md-menu-bottom-space, 8px)}.has-overflow:not([popover]) .items{overflow:visible}.has-overflow.animating .items,.animating .items{overflow:hidden}.has-overflow.animating .items{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}::slotted(:is(md-divider,[role=separator])){margin:8px 0}@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}\n`;\n"]}
package/menu/menu.d.ts CHANGED
@@ -7,7 +7,7 @@ import { CSSResultOrNative } from 'lit';
7
7
  import { Menu } from './internal/menu.js';
8
8
  export { type ListItem } from '../list/internal/list-navigation-helpers.js';
9
9
  export { type MenuItem } from './internal/controllers/menuItemController.js';
10
- export { FocusState, type CloseMenuEvent, type Menu, } from './internal/controllers/shared.js';
10
+ export { CloseReason, FocusState, type CloseMenuEvent, type Menu, } from './internal/controllers/shared.js';
11
11
  export { Corner } from './internal/menu.js';
12
12
  declare global {
13
13
  interface HTMLElementTagNameMap {
package/menu/menu.js CHANGED
@@ -7,7 +7,7 @@ import { __decorate } from "tslib";
7
7
  import { customElement } from 'lit/decorators.js';
8
8
  import { Menu } from './internal/menu.js';
9
9
  import { styles } from './internal/menu-styles.js';
10
- export { FocusState, } from './internal/controllers/shared.js';
10
+ export { CloseReason, FocusState, } from './internal/controllers/shared.js';
11
11
  export { Corner } from './internal/menu.js';
12
12
  /**
13
13
  * @summary Menus display a list of choices on a temporary surface.
package/menu/menu.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAIjD,OAAO,EACL,UAAU,GAGX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,IAAI;;AACd,aAAM,GAAwB,CAAC,MAAM,CAAC,AAAhC,CAAiC;AAD5C,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAElB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Menu} from './internal/menu.js';\nimport {styles} from './internal/menu-styles.js';\n\nexport {type ListItem} from '../list/internal/list-navigation-helpers.js';\nexport {type MenuItem} from './internal/controllers/menuItemController.js';\nexport {\n FocusState,\n type CloseMenuEvent,\n type Menu,\n} from './internal/controllers/shared.js';\nexport {Corner} from './internal/menu.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-menu': MdMenu;\n }\n}\n\n/**\n * @summary Menus display a list of choices on a temporary surface.\n *\n * @description\n * Menus appear when users interact with a button, action, or other control.\n *\n * They can be opened from a variety of elements, most commonly icon buttons,\n * buttons, and text fields.\n *\n * md-menu listens for the `close-menu` and `deselect-items` events.\n *\n * - `close-menu` closes the menu when dispatched from a child element.\n * - `deselect-items` deselects all of its immediate menu-item children.\n *\n * @example\n * ```html\n * <div style=\"position:relative;\">\n * <button\n * id=\"anchor\"\n * @click=${() => this.menuRef.value.show()}>\n * Click to open menu\n * </button>\n * <!--\n * `has-overflow` is required when using a submenu which overflows the\n * menu's contents.\n *\n * Additionally, `anchor` ingests an idref which do not pass through shadow\n * roots. You can also set `.anchorElement` to an element reference if\n * necessary.\n * -->\n * <md-menu anchor=\"anchor\" has-overflow ${ref(menuRef)}>\n * <md-menu-item headline=\"This is a headline\"></md-menu-item>\n * <md-sub-menu>\n * <md-menu-item\n * slot=\"item\"\n * headline=\"this is a submenu item\">\n * </md-menu-item>\n * <md-menu slot=\"menu\">\n * <md-menu-item headline=\"This is an item inside a submenu\">\n * </md-menu-item>\n * </md-menu>\n * </md-sub-menu>\n * </md-menu>\n * </div>\n * ```\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-menu')\nexport class MdMenu extends Menu {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
1
+ {"version":3,"file":"menu.js","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAIjD,OAAO,EACL,WAAW,EACX,UAAU,GAGX,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAQ1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,IAAI;;AACd,aAAM,GAAwB,CAAC,MAAM,CAAC,AAAhC,CAAiC;AAD5C,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CAElB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Menu} from './internal/menu.js';\nimport {styles} from './internal/menu-styles.js';\n\nexport {type ListItem} from '../list/internal/list-navigation-helpers.js';\nexport {type MenuItem} from './internal/controllers/menuItemController.js';\nexport {\n CloseReason,\n FocusState,\n type CloseMenuEvent,\n type Menu,\n} from './internal/controllers/shared.js';\nexport {Corner} from './internal/menu.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-menu': MdMenu;\n }\n}\n\n/**\n * @summary Menus display a list of choices on a temporary surface.\n *\n * @description\n * Menus appear when users interact with a button, action, or other control.\n *\n * They can be opened from a variety of elements, most commonly icon buttons,\n * buttons, and text fields.\n *\n * md-menu listens for the `close-menu` and `deselect-items` events.\n *\n * - `close-menu` closes the menu when dispatched from a child element.\n * - `deselect-items` deselects all of its immediate menu-item children.\n *\n * @example\n * ```html\n * <div style=\"position:relative;\">\n * <button\n * id=\"anchor\"\n * @click=${() => this.menuRef.value.show()}>\n * Click to open menu\n * </button>\n * <!--\n * `has-overflow` is required when using a submenu which overflows the\n * menu's contents.\n *\n * Additionally, `anchor` ingests an idref which do not pass through shadow\n * roots. You can also set `.anchorElement` to an element reference if\n * necessary.\n * -->\n * <md-menu anchor=\"anchor\" has-overflow ${ref(menuRef)}>\n * <md-menu-item headline=\"This is a headline\"></md-menu-item>\n * <md-sub-menu>\n * <md-menu-item\n * slot=\"item\"\n * headline=\"this is a submenu item\">\n * </md-menu-item>\n * <md-menu slot=\"menu\">\n * <md-menu-item headline=\"This is an item inside a submenu\">\n * </md-menu-item>\n * </md-menu>\n * </md-sub-menu>\n * </md-menu>\n * </div>\n * ```\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-menu')\nexport class MdMenu extends Menu {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@material/web",
3
- "version": "2.2.1-nightly.d69f2f2.0",
3
+ "version": "2.2.1-nightly.ff9ab97.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -56,7 +56,7 @@
56
56
  "catalog"
57
57
  ],
58
58
  "dependencies": {
59
- "lit": "^2.7.4 || ^3.0.0",
59
+ "lit": "^2.8.0 || ^3.0.0",
60
60
  "tslib": "^2.4.0"
61
61
  },
62
62
  "devDependencies": {
@@ -16,10 +16,12 @@
16
16
 
17
17
  $supported-tokens: (
18
18
  // go/keep-sorted start
19
+ 'bottom-space',
19
20
  'container-color',
20
21
  'container-elevation',
21
22
  'container-shadow-color',
22
23
  'container-shape',
24
+ 'top-space',
23
25
  // go/keep-sorted end
24
26
  );
25
27
 
@@ -46,7 +48,11 @@ $_default: (
46
48
  $tokens: validate.values(
47
49
  md-comp-menu.values($deps),
48
50
  $supported-tokens: $supported-tokens,
49
- $unsupported-tokens: $unsupported-tokens
51
+ $unsupported-tokens: $unsupported-tokens,
52
+ $new-tokens: (
53
+ 'top-space': if($exclude-hardcoded-values, null, 8px),
54
+ 'bottom-space': if($exclude-hardcoded-values, null, 8px),
55
+ )
50
56
  );
51
57
 
52
58
  @if not $exclude-custom-properties {