@material/web 2.5.1-nightly.efaa189.0 → 2.5.1-nightly.f13c736.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.
Files changed (159) hide show
  1. package/button/internal/button.d.ts +10 -0
  2. package/button/internal/button.js +21 -1
  3. package/button/internal/button.js.map +1 -1
  4. package/chips/internal/assist-chip.d.ts +10 -0
  5. package/chips/internal/assist-chip.js +18 -0
  6. package/chips/internal/assist-chip.js.map +1 -1
  7. package/chips/internal/chip.js +3 -1
  8. package/chips/internal/chip.js.map +1 -1
  9. package/chips/internal/input-chip.d.ts +10 -0
  10. package/chips/internal/input-chip.js +18 -0
  11. package/chips/internal/input-chip.js.map +1 -1
  12. package/custom-elements.json +1954 -200
  13. package/iconbutton/internal/icon-button.d.ts +10 -0
  14. package/iconbutton/internal/icon-button.js +19 -1
  15. package/iconbutton/internal/icon-button.js.map +1 -1
  16. package/labs/aria/command.d.ts +18 -0
  17. package/labs/aria/command.js +204 -0
  18. package/labs/aria/command.js.map +1 -0
  19. package/labs/aria/menu/md-aria-menuitem.d.ts +11 -0
  20. package/labs/aria/menu/md-aria-menuitem.js +8 -0
  21. package/labs/aria/menu/md-aria-menuitem.js.map +1 -0
  22. package/labs/aria/menu/md-aria-menulist.d.ts +11 -0
  23. package/labs/aria/menu/md-aria-menulist.js +8 -0
  24. package/labs/aria/menu/md-aria-menulist.js.map +1 -0
  25. package/labs/aria/menu/menuitem.d.ts +26 -0
  26. package/labs/aria/menu/menuitem.js +86 -0
  27. package/labs/aria/menu/menuitem.js.map +1 -0
  28. package/labs/aria/menu/menulist.d.ts +25 -0
  29. package/labs/aria/menu/menulist.js +138 -0
  30. package/labs/aria/menu/menulist.js.map +1 -0
  31. package/labs/aria/query-associated.d.ts +23 -0
  32. package/labs/aria/query-associated.js +36 -0
  33. package/labs/aria/query-associated.js.map +1 -0
  34. package/labs/aria/tabs/md-aria-tab.d.ts +11 -0
  35. package/labs/aria/tabs/md-aria-tab.js +8 -0
  36. package/labs/aria/tabs/md-aria-tab.js.map +1 -0
  37. package/labs/aria/tabs/md-aria-tablist.d.ts +11 -0
  38. package/labs/aria/tabs/md-aria-tablist.js +8 -0
  39. package/labs/aria/tabs/md-aria-tablist.js.map +1 -0
  40. package/labs/aria/tabs/md-aria-tabpanel.d.ts +11 -0
  41. package/labs/aria/tabs/md-aria-tabpanel.js +8 -0
  42. package/labs/aria/tabs/md-aria-tabpanel.js.map +1 -0
  43. package/labs/aria/tabs/tab.d.ts +33 -0
  44. package/labs/aria/tabs/tab.js +88 -0
  45. package/labs/aria/tabs/tab.js.map +1 -0
  46. package/labs/aria/tabs/tablist.d.ts +67 -0
  47. package/labs/aria/tabs/tablist.js +271 -0
  48. package/labs/aria/tabs/tablist.js.map +1 -0
  49. package/labs/aria/tabs/tabpanel.d.ts +26 -0
  50. package/labs/aria/tabs/tabpanel.js +53 -0
  51. package/labs/aria/tabs/tabpanel.js.map +1 -0
  52. package/labs/gb/components/appbar/app-bar-element.d.ts +1 -0
  53. package/labs/gb/components/appbar/app-bar-element.js +1 -0
  54. package/labs/gb/components/appbar/app-bar-element.js.map +1 -1
  55. package/labs/gb/components/badge/badge-element.d.ts +1 -0
  56. package/labs/gb/components/badge/badge-element.js +1 -0
  57. package/labs/gb/components/badge/badge-element.js.map +1 -1
  58. package/labs/gb/components/button/_button-tokens.scss +28 -22
  59. package/labs/gb/components/button/button-element.d.ts +18 -5
  60. package/labs/gb/components/button/button-element.js +26 -5
  61. package/labs/gb/components/button/button-element.js.map +1 -1
  62. package/labs/gb/components/button/button.css +1 -1
  63. package/labs/gb/components/button/button.css.map +1 -1
  64. package/labs/gb/components/button/button.cssresult.js +1 -1
  65. package/labs/gb/components/button/button.cssresult.js.map +1 -1
  66. package/labs/gb/components/button/button.js +1 -1
  67. package/labs/gb/components/button/button.js.map +1 -1
  68. package/labs/gb/components/button/button.scss +4 -6
  69. package/labs/gb/components/card/card-element.d.ts +1 -0
  70. package/labs/gb/components/card/card-element.js +1 -0
  71. package/labs/gb/components/card/card-element.js.map +1 -1
  72. package/labs/gb/components/checkbox/checkbox-element.d.ts +1 -0
  73. package/labs/gb/components/checkbox/checkbox-element.js +1 -0
  74. package/labs/gb/components/checkbox/checkbox-element.js.map +1 -1
  75. package/labs/gb/components/chip/chip-element.d.ts +11 -0
  76. package/labs/gb/components/chip/chip-element.js +26 -5
  77. package/labs/gb/components/chip/chip-element.js.map +1 -1
  78. package/labs/gb/components/chip/chip.css +1 -1
  79. package/labs/gb/components/chip/chip.css.map +1 -1
  80. package/labs/gb/components/chip/chip.cssresult.js +1 -1
  81. package/labs/gb/components/chip/chip.cssresult.js.map +1 -1
  82. package/labs/gb/components/chip/chip.js +1 -1
  83. package/labs/gb/components/chip/chip.js.map +1 -1
  84. package/labs/gb/components/chip/chip.scss +2 -0
  85. package/labs/gb/components/divider/divider-element.d.ts +1 -0
  86. package/labs/gb/components/divider/divider-element.js +1 -0
  87. package/labs/gb/components/divider/divider-element.js.map +1 -1
  88. package/labs/gb/components/fab/_fab-tokens.scss +4 -1
  89. package/labs/gb/components/fab/fab-element.d.ts +2 -0
  90. package/labs/gb/components/fab/fab-element.js +2 -0
  91. package/labs/gb/components/fab/fab-element.js.map +1 -1
  92. package/labs/gb/components/fab/fab.css +1 -1
  93. package/labs/gb/components/fab/fab.css.map +1 -1
  94. package/labs/gb/components/fab/fab.cssresult.js +1 -1
  95. package/labs/gb/components/fab/fab.cssresult.js.map +1 -1
  96. package/labs/gb/components/fab/fab.scss +1 -0
  97. package/labs/gb/components/iconbutton/_icon-button-tokens.scss +13 -4
  98. package/labs/gb/components/iconbutton/icon-button-element.d.ts +13 -1
  99. package/labs/gb/components/iconbutton/icon-button-element.js +21 -1
  100. package/labs/gb/components/iconbutton/icon-button-element.js.map +1 -1
  101. package/labs/gb/components/iconbutton/icon-button.css +1 -1
  102. package/labs/gb/components/iconbutton/icon-button.css.map +1 -1
  103. package/labs/gb/components/iconbutton/icon-button.cssresult.js +1 -1
  104. package/labs/gb/components/iconbutton/icon-button.cssresult.js.map +1 -1
  105. package/labs/gb/components/iconbutton/icon-button.js +1 -1
  106. package/labs/gb/components/iconbutton/icon-button.js.map +1 -1
  107. package/labs/gb/components/iconbutton/icon-button.scss +7 -0
  108. package/labs/gb/components/list/_list-tokens.scss +11 -14
  109. package/labs/gb/components/list/list-element.d.ts +1 -0
  110. package/labs/gb/components/list/list-element.js +1 -0
  111. package/labs/gb/components/list/list-element.js.map +1 -1
  112. package/labs/gb/components/list/list-item-element.d.ts +5 -0
  113. package/labs/gb/components/list/list-item-element.js +5 -0
  114. package/labs/gb/components/list/list-item-element.js.map +1 -1
  115. package/labs/gb/components/list/list.css +1 -1
  116. package/labs/gb/components/list/list.css.map +1 -1
  117. package/labs/gb/components/list/list.cssresult.js +1 -1
  118. package/labs/gb/components/list/list.cssresult.js.map +1 -1
  119. package/labs/gb/components/list/list.scss +5 -0
  120. package/labs/gb/components/menu/_menu-tokens.scss +45 -16
  121. package/labs/gb/components/menu/menu-element.d.ts +1 -0
  122. package/labs/gb/components/menu/menu-element.js +1 -0
  123. package/labs/gb/components/menu/menu-element.js.map +1 -1
  124. package/labs/gb/components/menu/menu-group-element.d.ts +1 -0
  125. package/labs/gb/components/menu/menu-group-element.js +1 -0
  126. package/labs/gb/components/menu/menu-group-element.js.map +1 -1
  127. package/labs/gb/components/menu/menu-item-element.d.ts +5 -1
  128. package/labs/gb/components/menu/menu-item-element.js +5 -1
  129. package/labs/gb/components/menu/menu-item-element.js.map +1 -1
  130. package/labs/gb/components/menu/menu.css +1 -1
  131. package/labs/gb/components/menu/menu.css.map +1 -1
  132. package/labs/gb/components/menu/menu.cssresult.js +1 -1
  133. package/labs/gb/components/menu/menu.cssresult.js.map +1 -1
  134. package/labs/gb/components/menu/menu.scss +3 -0
  135. package/labs/gb/components/radio/radio-element.d.ts +1 -0
  136. package/labs/gb/components/radio/radio-element.js +1 -0
  137. package/labs/gb/components/radio/radio-element.js.map +1 -1
  138. package/labs/gb/components/splitbutton/split-button-element.d.ts +1 -0
  139. package/labs/gb/components/splitbutton/split-button-element.js +1 -0
  140. package/labs/gb/components/splitbutton/split-button-element.js.map +1 -1
  141. package/labs/gb/components/switch/switch-element.d.ts +1 -0
  142. package/labs/gb/components/switch/switch-element.js +1 -0
  143. package/labs/gb/components/switch/switch-element.js.map +1 -1
  144. package/labs/gb/components/switch/switch.js +5 -2
  145. package/labs/gb/components/switch/switch.js.map +1 -1
  146. package/labs/gb/styles/icon/icon-element.d.ts +1 -0
  147. package/labs/gb/styles/icon/icon-element.js +1 -0
  148. package/labs/gb/styles/icon/icon-element.js.map +1 -1
  149. package/list/internal/listitem/list-item.d.ts +10 -0
  150. package/list/internal/listitem/list-item.js +18 -0
  151. package/list/internal/listitem/list-item.js.map +1 -1
  152. package/menu/internal/menuitem/menu-item.d.ts +10 -0
  153. package/menu/internal/menuitem/menu-item.js +18 -0
  154. package/menu/internal/menuitem/menu-item.js.map +1 -1
  155. package/package.json +2 -1
  156. package/radio/internal/single-selection-controller.js +4 -1
  157. package/radio/internal/single-selection-controller.js.map +1 -1
  158. package/types/command-event.d.ts +22 -0
  159. package/types/popover.d.ts +22 -0
@@ -37,6 +37,16 @@ export declare abstract class Button extends buttonBaseClass {
37
37
  * include `_blank` to open in a new tab.
38
38
  */
39
39
  target: '_blank' | '_parent' | '_self' | '_top' | '';
40
+ /**
41
+ * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is
42
+ * set.
43
+ */
44
+ rel: string;
45
+ /**
46
+ * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when
47
+ * `href` is set.
48
+ */
49
+ referrerPolicy: string;
40
50
  /**
41
51
  * Whether to render the icon at the inline end of the label rather than the
42
52
  * inline start.
@@ -45,6 +45,16 @@ export class Button extends buttonBaseClass {
45
45
  * include `_blank` to open in a new tab.
46
46
  */
47
47
  this.target = '';
48
+ /**
49
+ * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is
50
+ * set.
51
+ */
52
+ this.rel = '';
53
+ /**
54
+ * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when
55
+ * `href` is set.
56
+ */
57
+ this.referrerPolicy = '';
48
58
  /**
49
59
  * Whether to render the icon at the inline end of the label rather than the
50
60
  * inline start.
@@ -57,7 +67,9 @@ export class Button extends buttonBaseClass {
57
67
  */
58
68
  this.hasIcon = false;
59
69
  if (!isServer) {
60
- this.addEventListener('click', this.handleClick.bind(this));
70
+ this.addEventListener('click', this.handleClick.bind(this), {
71
+ capture: true,
72
+ });
61
73
  }
62
74
  }
63
75
  focus() {
@@ -111,6 +123,8 @@ export class Button extends buttonBaseClass {
111
123
  href=${this.href}
112
124
  download=${this.download || nothing}
113
125
  target=${this.target || nothing}
126
+ rel=${this.rel || nothing}
127
+ referrerpolicy=${this.referrerPolicy || nothing}
114
128
  >${this.renderContent()}
115
129
  </a>`;
116
130
  }
@@ -161,6 +175,12 @@ __decorate([
161
175
  __decorate([
162
176
  property()
163
177
  ], Button.prototype, "target", void 0);
178
+ __decorate([
179
+ property()
180
+ ], Button.prototype, "rel", void 0);
181
+ __decorate([
182
+ property()
183
+ ], Button.prototype, "referrerPolicy", void 0);
164
184
  __decorate([
165
185
  property({ type: Boolean, attribute: 'trailing-icon', reflect: true })
166
186
  ], Button.prototype, "trailingIcon", 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,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,EACL,uBAAuB,EACvB,iBAAiB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AE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;uCACxD;AAE2B;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 dispatchActivationClick,\n isActivationClick,\n} from '../../internal/events/form-label-activation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {mixinFormAssociated} from '../../labs/behaviors/form-associated.js';\nimport {mixinFormSubmitter} from '../../labs/behaviors/form-submitter.js';\n\n// Separate variable needed for closure.\nconst buttonBaseClass = mixinDelegatesAria(\n mixinFormSubmitter(mixinFormAssociated(mixinElementInternals(LitElement))),\n);\n\n/**\n * A button component.\n */\nexport abstract class Button extends buttonBaseClass {\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\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 @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 const isRippleDisabled = 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 aria-disabled=${this.disabled || this.softDisabled || nothing}\n tabindex=\"${this.disabled && !this.softDisabled ? -1 : 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 or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href)) {\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,EACL,uBA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E;wCAAe;AAMd;IAAX,QAAQ,EAAE;sCAA2D;AAM1D;IAAX,QAAQ,EAAE;mCAAU;AAMT;IAAX,QAAQ,EAAE;8CAAqB;AAShC;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;AAE2B;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 dispatchActivationClick,\n isActivationClick,\n} from '../../internal/events/form-label-activation.js';\nimport {mixinElementInternals} from '../../labs/behaviors/element-internals.js';\nimport {mixinFormAssociated} from '../../labs/behaviors/form-associated.js';\nimport {mixinFormSubmitter} from '../../labs/behaviors/form-submitter.js';\n\n// Separate variable needed for closure.\nconst buttonBaseClass = mixinDelegatesAria(\n mixinFormSubmitter(mixinFormAssociated(mixinElementInternals(LitElement))),\n);\n\n/**\n * A button component.\n */\nexport abstract class Button extends buttonBaseClass {\n /** @nocollapse */\n static override shadowRootOptions: ShadowRootInit = {\n mode: 'open',\n delegatesFocus: true,\n };\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 * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is\n * set.\n */\n @property() rel = '';\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when\n * `href` is set.\n */\n @property() referrerPolicy = '';\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 @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 capture: true,\n });\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 const isRippleDisabled = 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 aria-disabled=${this.disabled || this.softDisabled || nothing}\n tabindex=\"${this.disabled && !this.softDisabled ? -1 : nothing}\"\n href=${this.href}\n download=${this.download || nothing}\n target=${this.target || nothing}\n rel=${this.rel || nothing}\n referrerpolicy=${this.referrerPolicy || 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 or a disabled link, we need to explicitly\n // prevent the click from propagating to other event listeners as well as\n // prevent the default action.\n if (this.softDisabled || (this.disabled && this.href)) {\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"]}
@@ -18,6 +18,16 @@ export declare class AssistChip extends Chip {
18
18
  */
19
19
  download: string;
20
20
  target: '_blank' | '_parent' | '_self' | '_top' | '';
21
+ /**
22
+ * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is
23
+ * set.
24
+ */
25
+ rel: string;
26
+ /**
27
+ * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when
28
+ * `href` is set.
29
+ */
30
+ referrerPolicy: string;
21
31
  protected get primaryId(): "link" | "button";
22
32
  protected get rippleDisabled(): boolean;
23
33
  protected getContainerClasses(): {
@@ -23,6 +23,16 @@ export class AssistChip extends Chip {
23
23
  */
24
24
  this.download = '';
25
25
  this.target = '';
26
+ /**
27
+ * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is
28
+ * set.
29
+ */
30
+ this.rel = '';
31
+ /**
32
+ * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when
33
+ * `href` is set.
34
+ */
35
+ this.referrerPolicy = '';
26
36
  }
27
37
  get primaryId() {
28
38
  return this.href ? 'link' : 'button';
@@ -51,6 +61,8 @@ export class AssistChip extends Chip {
51
61
  href=${this.href}
52
62
  download=${this.download || nothing}
53
63
  target=${this.target || nothing}
64
+ rel=${this.rel || nothing}
65
+ referrerpolicy=${this.referrerPolicy || nothing}
54
66
  >${content}</a
55
67
  >
56
68
  `;
@@ -86,4 +98,10 @@ __decorate([
86
98
  __decorate([
87
99
  property()
88
100
  ], AssistChip.prototype, "target", void 0);
101
+ __decorate([
102
+ property()
103
+ ], AssistChip.prototype, "rel", void 0);
104
+ __decorate([
105
+ property()
106
+ ], AssistChip.prototype, "referrerPolicy", void 0);
89
107
  //# sourceMappingURL=assist-chip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assist-chip.js","sour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AC,QAAQ,IAAI,OAAO;mBAC1B,IAAI,CAAC,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"]}
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,GAAG,KAAK,CAAC;QAChC,SAAI,GAAG,EAAE,CAAC;QACtB;;;;WAIG;QACS,aAAQ,GAAG,EAAE,CAAC;QACd,WAAM,GAAiD,EAAE,CAAC;QACtE;;;WAGG;QACS,QAAG,GAAG,EAAE,CAAC;QAErB;;;WAGG;QACS,mBAAc,GAAG,EAAE,CAAC;IA2DlC,CAAC;IAzDC,IAAc,SAAS;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvC,CAAC;IAED,IAAuB,cAAc;QACnC,gCAAgC;QAChC,OAAO,CAAC,IAAI,CAAC,IAAI,IA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X,QAAQ,EAAE;4CAAe;AACd;IAAX,QAAQ,EAAE;0CAA2D;AAK1D;IAAX,QAAQ,EAAE;uCAAU;AAMT;IAAX,QAAQ,EAAE;kDAAqB","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 * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is\n * set.\n */\n @property() rel = '';\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when\n * `href` is set.\n */\n @property() referrerPolicy = '';\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 rel=${this.rel || nothing}\n referrerpolicy=${this.referrerPolicy || 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"]}
@@ -67,7 +67,9 @@ export class Chip extends chipBaseClass {
67
67
  */
68
68
  this.hasIcon = false;
69
69
  if (!isServer) {
70
- this.addEventListener('click', this.handleClick.bind(this));
70
+ this.addEventListener('click', this.handleClick.bind(this), {
71
+ capture: true,
72
+ });
71
73
  }
72
74
  }
73
75
  focus(options) {
@@ -1 +1 @@
1
- {"version":3,"file":"chip.js","sourceRoot":"","sources":["chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAiC,MAAM,KAAK,CAAC;AAC/E,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAEnE,wCAAwC;AACxC,MAAM,aAAa,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAErD;;;;GAIG;AACH,MAAM,OAAgB,IAAK,SAAQ,aAAa;IA4D9C;;;OAGG;IACH,IAAc,cAAc;QAC1B,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC;IAC5C,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QA9DV;;;;WAIG;QACuC,aAAQ,GAAG,KAAK,CAAC;QAE3D;;;;;;;WAOG;QAEH,iBAAY,GAAG,KAAK,CAAC;QAErB;;;;;;;;WAQG;QAEH,oBAAe,GAAG,KAAK,CAAC;QAExB,gDAAgD;QAChD;;;;WAIG;QACS,UAAK,GAAG,EAAE,CAAC;QAEvB;;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QZ;IAAX,QAAQ,EAAE;mCAAY;AAQ0C;IAAhE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAC,CAAC;qCACxD","sourcesContent":["/**\n * @license\n * Copyright 2023 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, PropertyValues, TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {mixinDelegatesAria} from '../../internal/aria/delegate.js';\n\n// Separate variable needed for closure.\nconst chipBaseClass = mixinDelegatesAria(LitElement);\n\n/**\n * A chip component.\n *\n * @fires update-focus {Event} Dispatched when `disabled` is toggled. --bubbles\n */\nexport abstract class Chip extends chipBaseClass {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Whether or not the chip is disabled.\n *\n * Disabled chips are not focusable, unless `always-focusable` is set.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * Whether or not the chip is \"soft-disabled\" (disabled but still\n * focusable).\n *\n * Use this when a chip 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 * When true, allow disabled chips to be focused with arrow keys.\n *\n * Add this when a chip 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 * @deprecated Use `softDisabled` instead of `alwaysFocusable` + `disabled`.\n */\n @property({type: Boolean, attribute: 'always-focusable'})\n alwaysFocusable = false;\n\n // TODO(b/350810013): remove the label property.\n /**\n * The label of the chip.\n *\n * @deprecated Set text as content of the chip instead.\n */\n @property() label = '';\n\n /**\n * Only needed for SSR.\n *\n * Add this attribute when a chip has a `slot=\"icon\"` to avoid a Flash Of\n * Unstyled Content.\n */\n @property({type: Boolean, reflect: true, attribute: 'has-icon'}) hasIcon =\n false;\n\n /**\n * The `id` of the action the primary focus ring and ripple are for.\n * TODO(b/310046938): use the same id for both elements\n */\n protected abstract readonly primaryId: string;\n\n /**\n * Whether or not the primary ripple is disabled (defaults to `disabled`).\n * Some chip actions such as links cannot be disabled.\n */\n protected get rippleDisabled() {\n return this.disabled || this.softDisabled;\n }\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', this.handleClick.bind(this));\n }\n }\n\n override focus(options?: FocusOptions) {\n if (this.disabled && !this.alwaysFocusable) {\n return;\n }\n\n super.focus(options);\n }\n\n protected override render() {\n return html`\n <div class=\"container ${classMap(this.getContainerClasses())}\">\n ${this.renderContainerContent()}\n </div>\n `;\n }\n\n protected override updated(changed: PropertyValues<Chip>) {\n if (changed.has('disabled') && changed.get('disabled') !== undefined) {\n this.dispatchEvent(new Event('update-focus', {bubbles: true}));\n }\n }\n\n protected getContainerClasses(): ClassInfo {\n return {\n 'disabled': this.disabled || this.softDisabled,\n 'has-icon': this.hasIcon,\n };\n }\n\n protected renderContainerContent() {\n return html`\n ${this.renderOutline()}\n <md-focus-ring part=\"focus-ring\" for=${this.primaryId}></md-focus-ring>\n <md-ripple\n for=${this.primaryId}\n ?disabled=${this.rippleDisabled}></md-ripple>\n ${this.renderPrimaryAction(this.renderPrimaryContent())}\n `;\n }\n\n protected renderOutline() {\n return html`<span class=\"outline\"></span>`;\n }\n\n protected renderLeadingIcon(): TemplateResult {\n return html`<slot name=\"icon\" @slotchange=${this.handleIconChange}></slot>`;\n }\n\n protected abstract renderPrimaryAction(content: unknown): unknown;\n\n private renderPrimaryContent() {\n return html`\n <span class=\"leading icon\" aria-hidden=\"true\">\n ${this.renderLeadingIcon()}\n </span>\n <span class=\"label\">\n <span class=\"label-text\" id=\"label\">\n ${this.label ? this.label : html`<slot></slot>`}\n </span>\n </span>\n <span class=\"touch\"></span>\n `;\n }\n\n private handleIconChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasIcon = slot.assignedElements({flatten: true}).length > 0;\n }\n\n private handleClick(event: Event) {\n // If the chip is soft-disabled or disabled + always-focusable, we need to\n // explicitly prevent the click from propagating to other event listeners\n // as well as prevent the default action.\n if (this.softDisabled || (this.disabled && this.alwaysFocusable)) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"chip.js","sourceRoot":"","sources":["chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAiC,MAAM,KAAK,CAAC;AAC/E,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AAEnE,wCAAwC;AACxC,MAAM,aAAa,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC;AAErD;;;;GAIG;AACH,MAAM,OAAgB,IAAK,SAAQ,aAAa;IA4D9C;;;OAGG;IACH,IAAc,cAAc;QAC1B,OAAO,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC;IAC5C,CAAC;IAED;QACE,KAAK,EAAE,CAAC;QA9DV;;;;WAIG;QACuC,aAAQ,GAAG,KAAK,CAAC;QAE3D;;;;;;;WAOG;QAEH,iBAAY,GAAG,KAAK,CAAC;QAErB;;;;;;;;WAQG;QAEH,oBAAe,GAAG,KAAK,CAAC;QAExB,gDAAgD;QAChD;;;;WAIG;QACS,UAAK,GAAG,EAAE,CAAC;QAEvB;;;;;WAKG;QAC8D,YAAO,GACtE,KAAK,CAAC;Q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AX,QAAQ,EAAE;mCAAY;AAQ0C;IAAhE,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAC,CAAC;qCACxD","sourcesContent":["/**\n * @license\n * Copyright 2023 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, PropertyValues, TemplateResult} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {mixinDelegatesAria} from '../../internal/aria/delegate.js';\n\n// Separate variable needed for closure.\nconst chipBaseClass = mixinDelegatesAria(LitElement);\n\n/**\n * A chip component.\n *\n * @fires update-focus {Event} Dispatched when `disabled` is toggled. --bubbles\n */\nexport abstract class Chip extends chipBaseClass {\n /** @nocollapse */\n static override shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n /**\n * Whether or not the chip is disabled.\n *\n * Disabled chips are not focusable, unless `always-focusable` is set.\n */\n @property({type: Boolean, reflect: true}) disabled = false;\n\n /**\n * Whether or not the chip is \"soft-disabled\" (disabled but still\n * focusable).\n *\n * Use this when a chip 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 * When true, allow disabled chips to be focused with arrow keys.\n *\n * Add this when a chip 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 * @deprecated Use `softDisabled` instead of `alwaysFocusable` + `disabled`.\n */\n @property({type: Boolean, attribute: 'always-focusable'})\n alwaysFocusable = false;\n\n // TODO(b/350810013): remove the label property.\n /**\n * The label of the chip.\n *\n * @deprecated Set text as content of the chip instead.\n */\n @property() label = '';\n\n /**\n * Only needed for SSR.\n *\n * Add this attribute when a chip has a `slot=\"icon\"` to avoid a Flash Of\n * Unstyled Content.\n */\n @property({type: Boolean, reflect: true, attribute: 'has-icon'}) hasIcon =\n false;\n\n /**\n * The `id` of the action the primary focus ring and ripple are for.\n * TODO(b/310046938): use the same id for both elements\n */\n protected abstract readonly primaryId: string;\n\n /**\n * Whether or not the primary ripple is disabled (defaults to `disabled`).\n * Some chip actions such as links cannot be disabled.\n */\n protected get rippleDisabled() {\n return this.disabled || this.softDisabled;\n }\n\n constructor() {\n super();\n if (!isServer) {\n this.addEventListener('click', this.handleClick.bind(this), {\n capture: true,\n });\n }\n }\n\n override focus(options?: FocusOptions) {\n if (this.disabled && !this.alwaysFocusable) {\n return;\n }\n\n super.focus(options);\n }\n\n protected override render() {\n return html`\n <div class=\"container ${classMap(this.getContainerClasses())}\">\n ${this.renderContainerContent()}\n </div>\n `;\n }\n\n protected override updated(changed: PropertyValues<Chip>) {\n if (changed.has('disabled') && changed.get('disabled') !== undefined) {\n this.dispatchEvent(new Event('update-focus', {bubbles: true}));\n }\n }\n\n protected getContainerClasses(): ClassInfo {\n return {\n 'disabled': this.disabled || this.softDisabled,\n 'has-icon': this.hasIcon,\n };\n }\n\n protected renderContainerContent() {\n return html`\n ${this.renderOutline()}\n <md-focus-ring part=\"focus-ring\" for=${this.primaryId}></md-focus-ring>\n <md-ripple\n for=${this.primaryId}\n ?disabled=${this.rippleDisabled}></md-ripple>\n ${this.renderPrimaryAction(this.renderPrimaryContent())}\n `;\n }\n\n protected renderOutline() {\n return html`<span class=\"outline\"></span>`;\n }\n\n protected renderLeadingIcon(): TemplateResult {\n return html`<slot name=\"icon\" @slotchange=${this.handleIconChange}></slot>`;\n }\n\n protected abstract renderPrimaryAction(content: unknown): unknown;\n\n private renderPrimaryContent() {\n return html`\n <span class=\"leading icon\" aria-hidden=\"true\">\n ${this.renderLeadingIcon()}\n </span>\n <span class=\"label\">\n <span class=\"label-text\" id=\"label\">\n ${this.label ? this.label : html`<slot></slot>`}\n </span>\n </span>\n <span class=\"touch\"></span>\n `;\n }\n\n private handleIconChange(event: Event) {\n const slot = event.target as HTMLSlotElement;\n this.hasIcon = slot.assignedElements({flatten: true}).length > 0;\n }\n\n private handleClick(event: Event) {\n // If the chip is soft-disabled or disabled + always-focusable, we need to\n // explicitly prevent the click from propagating to other event listeners\n // as well as prevent the default action.\n if (this.softDisabled || (this.disabled && this.alwaysFocusable)) {\n event.stopImmediatePropagation();\n event.preventDefault();\n return;\n }\n }\n}\n"]}
@@ -13,6 +13,16 @@ export declare class InputChip extends MultiActionChip {
13
13
  avatar: boolean;
14
14
  href: string;
15
15
  target: '_blank' | '_parent' | '_self' | '_top' | '';
16
+ /**
17
+ * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is
18
+ * set.
19
+ */
20
+ rel: string;
21
+ /**
22
+ * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when
23
+ * `href` is set.
24
+ */
25
+ referrerPolicy: string;
16
26
  removeOnly: boolean;
17
27
  selected: boolean;
18
28
  protected get primaryId(): "" | "link" | "button";
@@ -19,6 +19,16 @@ export class InputChip extends MultiActionChip {
19
19
  this.avatar = false;
20
20
  this.href = '';
21
21
  this.target = '';
22
+ /**
23
+ * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is
24
+ * set.
25
+ */
26
+ this.rel = '';
27
+ /**
28
+ * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when
29
+ * `href` is set.
30
+ */
31
+ this.referrerPolicy = '';
22
32
  this.removeOnly = false;
23
33
  this.selected = false;
24
34
  }
@@ -64,6 +74,8 @@ export class InputChip extends MultiActionChip {
64
74
  aria-label=${ariaLabel || nothing}
65
75
  href=${this.href}
66
76
  target=${this.target || nothing}
77
+ rel=${this.rel || nothing}
78
+ referrerpolicy=${this.referrerPolicy || nothing}
67
79
  >${content}</a
68
80
  >
69
81
  `;
@@ -105,6 +117,12 @@ __decorate([
105
117
  __decorate([
106
118
  property()
107
119
  ], InputChip.prototype, "target", void 0);
120
+ __decorate([
121
+ property()
122
+ ], InputChip.prototype, "rel", void 0);
123
+ __decorate([
124
+ property()
125
+ ], InputChip.prototype, "referrerPolicy", void 0);
108
126
  __decorate([
109
127
  property({ type: Boolean, attribute: 'remove-only' })
110
128
  ], InputChip.prototype, "removeOnly", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"input-chip.js","sourceRoot":"","sources":["input-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAIlD,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,eAAe;IAA9C;;QAC6B,WAAM,GAAG,KAAK,CAAC;QAC9B,SAAI,GAAG,EAAE,CAAC;QACV,WAAM,GAAiD,EAAE,CAAC;QACjB,eAAU,GAAG,KAAK,CAAC;QAC9B,aAAQ,GAAG,KAAK,CAAC;IAwF7D,CAAC;IAtFC,IAAc,SAAS;QACrB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAuB,cAAc;QACnC,gCAAgC;QAChC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5D,CAAC;IAED,IAAc,aAAa;QACzB,0EAA0E;QAC1E,gCAAgC;QAChC,IAAI,IAAI,CAAC,UAAU,E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AAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,CAAC;YAC5D,QAAQ,EAAE,IAAI,CAAC,UAAU;SAC1B,CAAC,CAAC;IACL,CAAC;CACF;AA5F4B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;yCAAgB;AAC9B;IAAX,QAAQ,EAAE;uCAAW;AACV;IAAX,QAAQ,EAAE;yCAA2D;AACjB;IAApD,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAC,CAAC;6CAAoB;AAC9B;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;2CAAkB;AA8BxC;IADlB,KAAK,CAAC,kBAAkB,CAAC;iDAC6B","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, nothing} from 'lit';\nimport {property, query} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\n\nimport {MultiActionChip} from './multi-action-chip.js';\nimport {renderRemoveButton} from './trailing-icons.js';\n\n/**\n * An input chip component.\n *\n * @fires remove {Event} Dispatched when the remove button is clicked.\n */\nexport class InputChip extends MultiActionChip {\n @property({type: Boolean}) avatar = false;\n @property() href = '';\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n @property({type: Boolean, attribute: 'remove-only'}) removeOnly = false;\n @property({type: Boolean, reflect: true}) selected = false;\n\n protected get primaryId() {\n if (this.href) {\n return 'link';\n }\n\n if (this.removeOnly) {\n return '';\n }\n\n return '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 get primaryAction() {\n // Don't use @query() since a remove-only input chip still has a span that\n // has \"primary action\" classes.\n if (this.removeOnly) {\n return null;\n }\n\n return this.renderRoot.querySelector<HTMLElement>('.primary.action');\n }\n\n @query('.trailing.action')\n protected readonly trailingAction!: HTMLElement | null;\n\n protected override getContainerClasses() {\n return {\n ...super.getContainerClasses(),\n avatar: this.avatar,\n // Link chips cannot be disabled\n disabled: !this.href && (this.disabled || this.softDisabled),\n link: !!this.href,\n selected: this.selected,\n 'has-trailing': true,\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 if (this.removeOnly) {\n return html`\n <span class=\"primary action\" aria-label=${ariaLabel || nothing}>\n ${content}\n </span>\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 renderTrailingAction(focusListener: EventListener) {\n return renderRemoveButton({\n focusListener,\n ariaLabel: this.ariaLabelRemove,\n disabled: !this.href && (this.disabled || this.softDisabled),\n tabbable: this.removeOnly,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"input-chip.js","sourceRoot":"","sources":["input-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAIlD,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,eAAe;IAA9C;;QAC6B,WAAM,GAAG,KAAK,CAAC;QAC9B,SAAI,GAAG,EAAE,CAAC;QACV,WAAM,GAAiD,EAAE,CAAC;QACtE;;;WAGG;QACS,QAAG,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* @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, nothing} from 'lit';\nimport {property, query} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\n\nimport {MultiActionChip} from './multi-action-chip.js';\nimport {renderRemoveButton} from './trailing-icons.js';\n\n/**\n * An input chip component.\n *\n * @fires remove {Event} Dispatched when the remove button is clicked.\n */\nexport class InputChip extends MultiActionChip {\n @property({type: Boolean}) avatar = false;\n @property() href = '';\n @property() target: '_blank' | '_parent' | '_self' | '_top' | '' = '';\n /**\n * Sets the underlying `HTMLAnchorElement`'s `rel` attribute when `href` is\n * set.\n */\n @property() rel = '';\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `referrerpolicy` attribute when\n * `href` is set.\n */\n @property() referrerPolicy = '';\n @property({type: Boolean, attribute: 'remove-only'}) removeOnly = false;\n @property({type: Boolean, reflect: true}) selected = false;\n\n protected get primaryId() {\n if (this.href) {\n return 'link';\n }\n\n if (this.removeOnly) {\n return '';\n }\n\n return '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 get primaryAction() {\n // Don't use @query() since a remove-only input chip still has a span that\n // has \"primary action\" classes.\n if (this.removeOnly) {\n return null;\n }\n\n return this.renderRoot.querySelector<HTMLElement>('.primary.action');\n }\n\n @query('.trailing.action')\n protected readonly trailingAction!: HTMLElement | null;\n\n protected override getContainerClasses() {\n return {\n ...super.getContainerClasses(),\n avatar: this.avatar,\n // Link chips cannot be disabled\n disabled: !this.href && (this.disabled || this.softDisabled),\n link: !!this.href,\n selected: this.selected,\n 'has-trailing': true,\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 rel=${this.rel || nothing}\n referrerpolicy=${this.referrerPolicy || nothing}\n >${content}</a\n >\n `;\n }\n\n if (this.removeOnly) {\n return html`\n <span class=\"primary action\" aria-label=${ariaLabel || nothing}>\n ${content}\n </span>\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 renderTrailingAction(focusListener: EventListener) {\n return renderRemoveButton({\n focusListener,\n ariaLabel: this.ariaLabelRemove,\n disabled: !this.href && (this.disabled || this.softDisabled),\n tabbable: this.removeOnly,\n });\n }\n}\n"]}