@material/web 2.2.0 → 2.2.1-nightly.045fe94.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 (190) hide show
  1. package/button/elevated-button.js +2 -1
  2. package/button/elevated-button.js.map +1 -1
  3. package/button/filled-button.js +2 -1
  4. package/button/filled-button.js.map +1 -1
  5. package/button/filled-tonal-button.js +2 -1
  6. package/button/filled-tonal-button.js.map +1 -1
  7. package/button/internal/button.js.map +1 -1
  8. package/button/outlined-button.js +2 -1
  9. package/button/outlined-button.js.map +1 -1
  10. package/button/text-button.js +2 -1
  11. package/button/text-button.js.map +1 -1
  12. package/checkbox/checkbox.js +2 -1
  13. package/checkbox/checkbox.js.map +1 -1
  14. package/checkbox/internal/checkbox.d.ts +1 -0
  15. package/checkbox/internal/checkbox.js.map +1 -1
  16. package/chips/assist-chip.js +2 -1
  17. package/chips/assist-chip.js.map +1 -1
  18. package/chips/chip-set.js +2 -1
  19. package/chips/chip-set.js.map +1 -1
  20. package/chips/filter-chip.js +2 -1
  21. package/chips/filter-chip.js.map +1 -1
  22. package/chips/harness.js.map +1 -1
  23. package/chips/input-chip.js +2 -1
  24. package/chips/input-chip.js.map +1 -1
  25. package/chips/internal/assist-chip.js.map +1 -1
  26. package/chips/internal/chip-set.js.map +1 -1
  27. package/chips/internal/chip.d.ts +1 -0
  28. package/chips/internal/chip.js.map +1 -1
  29. package/chips/internal/filter-chip.js.map +1 -1
  30. package/chips/internal/input-chip.js.map +1 -1
  31. package/chips/internal/multi-action-chip.js.map +1 -1
  32. package/chips/internal/trailing-icons.js.map +1 -1
  33. package/chips/suggestion-chip.js +2 -1
  34. package/chips/suggestion-chip.js.map +1 -1
  35. package/dialog/dialog.js +2 -1
  36. package/dialog/dialog.js.map +1 -1
  37. package/dialog/internal/dialog.js.map +1 -1
  38. package/divider/divider.js +2 -1
  39. package/divider/divider.js.map +1 -1
  40. package/elevation/elevation.js +2 -1
  41. package/elevation/elevation.js.map +1 -1
  42. package/fab/branded-fab.js +2 -1
  43. package/fab/branded-fab.js.map +1 -1
  44. package/fab/fab.js +2 -1
  45. package/fab/fab.js.map +1 -1
  46. package/field/filled-field.js +2 -1
  47. package/field/filled-field.js.map +1 -1
  48. package/field/internal/field.js.map +1 -1
  49. package/field/outlined-field.js +2 -1
  50. package/field/outlined-field.js.map +1 -1
  51. package/focus/internal/focus-ring.js.map +1 -1
  52. package/focus/md-focus-ring.js +2 -1
  53. package/focus/md-focus-ring.js.map +1 -1
  54. package/icon/icon.js +2 -1
  55. package/icon/icon.js.map +1 -1
  56. package/icon/internal/icon.js.map +1 -1
  57. package/iconbutton/filled-icon-button.js +2 -1
  58. package/iconbutton/filled-icon-button.js.map +1 -1
  59. package/iconbutton/filled-tonal-icon-button.js +2 -1
  60. package/iconbutton/filled-tonal-icon-button.js.map +1 -1
  61. package/iconbutton/harness.js.map +1 -1
  62. package/iconbutton/icon-button.js +2 -1
  63. package/iconbutton/icon-button.js.map +1 -1
  64. package/iconbutton/internal/icon-button.js.map +1 -1
  65. package/iconbutton/outlined-icon-button.js +2 -1
  66. package/iconbutton/outlined-icon-button.js.map +1 -1
  67. package/internal/aria/aria.d.ts +1 -1
  68. package/internal/aria/delegate.js.map +1 -1
  69. package/internal/controller/attachable-controller.js.map +1 -1
  70. package/internal/controller/form-submitter.js.map +1 -1
  71. package/internal/events/dispatch-hooks.js.map +1 -1
  72. package/internal/events/form-label-activation.js.map +1 -1
  73. package/internal/events/redispatch-event.js.map +1 -1
  74. package/internal/motion/animation.js.map +1 -1
  75. package/labs/badge/badge.js +2 -1
  76. package/labs/badge/badge.js.map +1 -1
  77. package/labs/behaviors/constraint-validation.js.map +1 -1
  78. package/labs/behaviors/custom-state-set.d.ts +107 -0
  79. package/labs/behaviors/custom-state-set.js +121 -0
  80. package/labs/behaviors/custom-state-set.js.map +1 -0
  81. package/labs/behaviors/element-internals.js.map +1 -1
  82. package/labs/behaviors/focusable.js.map +1 -1
  83. package/labs/behaviors/form-associated.js.map +1 -1
  84. package/labs/behaviors/on-report-validity.js.map +1 -1
  85. package/labs/behaviors/validators/checkbox-validator.js.map +1 -1
  86. package/labs/behaviors/validators/radio-validator.js.map +1 -1
  87. package/labs/behaviors/validators/select-validator.js.map +1 -1
  88. package/labs/behaviors/validators/text-field-validator.js.map +1 -1
  89. package/labs/behaviors/validators/validator.js.map +1 -1
  90. package/labs/card/elevated-card.js +2 -1
  91. package/labs/card/elevated-card.js.map +1 -1
  92. package/labs/card/filled-card.js +2 -1
  93. package/labs/card/filled-card.js.map +1 -1
  94. package/labs/card/outlined-card.js +2 -1
  95. package/labs/card/outlined-card.js.map +1 -1
  96. package/labs/item/internal/item.js.map +1 -1
  97. package/labs/item/item.js +2 -1
  98. package/labs/item/item.js.map +1 -1
  99. package/labs/navigationbar/internal/navigation-bar.js.map +1 -1
  100. package/labs/navigationbar/navigation-bar.js +2 -1
  101. package/labs/navigationbar/navigation-bar.js.map +1 -1
  102. package/labs/navigationdrawer/internal/navigation-drawer-modal.js.map +1 -1
  103. package/labs/navigationdrawer/internal/navigation-drawer.js.map +1 -1
  104. package/labs/navigationdrawer/navigation-drawer-modal.js +2 -1
  105. package/labs/navigationdrawer/navigation-drawer-modal.js.map +1 -1
  106. package/labs/navigationdrawer/navigation-drawer.js +2 -1
  107. package/labs/navigationdrawer/navigation-drawer.js.map +1 -1
  108. package/labs/navigationtab/internal/navigation-tab.js.map +1 -1
  109. package/labs/navigationtab/navigation-tab.js +2 -1
  110. package/labs/navigationtab/navigation-tab.js.map +1 -1
  111. package/labs/segmentedbutton/internal/segmented-button.js.map +1 -1
  112. package/labs/segmentedbutton/outlined-segmented-button.js +2 -1
  113. package/labs/segmentedbutton/outlined-segmented-button.js.map +1 -1
  114. package/labs/segmentedbuttonset/internal/segmented-button-set.js.map +1 -1
  115. package/labs/segmentedbuttonset/outlined-segmented-button-set.js +2 -1
  116. package/labs/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
  117. package/list/internal/list-controller.js.map +1 -1
  118. package/list/internal/list-navigation-helpers.js.map +1 -1
  119. package/list/internal/list.js.map +1 -1
  120. package/list/internal/listitem/list-item.d.ts +1 -0
  121. package/list/internal/listitem/list-item.js.map +1 -1
  122. package/list/list-item.js +2 -1
  123. package/list/list-item.js.map +1 -1
  124. package/list/list.js +2 -1
  125. package/list/list.js.map +1 -1
  126. package/menu/harness.js.map +1 -1
  127. package/menu/internal/controllers/menuItemController.js.map +1 -1
  128. package/menu/internal/controllers/surfacePositionController.js.map +1 -1
  129. package/menu/internal/controllers/typeaheadController.js.map +1 -1
  130. package/menu/internal/menu.js.map +1 -1
  131. package/menu/internal/menuitem/menu-item.d.ts +1 -0
  132. package/menu/internal/menuitem/menu-item.js.map +1 -1
  133. package/menu/internal/submenu/sub-menu.js.map +1 -1
  134. package/menu/menu-item.js +2 -1
  135. package/menu/menu-item.js.map +1 -1
  136. package/menu/menu.js +2 -1
  137. package/menu/menu.js.map +1 -1
  138. package/menu/sub-menu.js +2 -1
  139. package/menu/sub-menu.js.map +1 -1
  140. package/migrations/v2/query-selector-aria.js.map +1 -1
  141. package/package.json +5 -3
  142. package/progress/circular-progress.js +2 -1
  143. package/progress/circular-progress.js.map +1 -1
  144. package/progress/internal/circular-progress.js.map +1 -1
  145. package/progress/linear-progress.js +2 -1
  146. package/progress/linear-progress.js.map +1 -1
  147. package/radio/internal/radio.js.map +1 -1
  148. package/radio/internal/single-selection-controller.js.map +1 -1
  149. package/radio/radio.js +2 -1
  150. package/radio/radio.js.map +1 -1
  151. package/ripple/internal/ripple.js.map +1 -1
  152. package/ripple/ripple.js +2 -1
  153. package/ripple/ripple.js.map +1 -1
  154. package/select/filled-select.js +2 -1
  155. package/select/filled-select.js.map +1 -1
  156. package/select/harness.js.map +1 -1
  157. package/select/internal/select.d.ts +1 -0
  158. package/select/internal/select.js +2 -1
  159. package/select/internal/select.js.map +1 -1
  160. package/select/internal/selectoption/select-option.d.ts +1 -0
  161. package/select/internal/selectoption/selectOptionController.js.map +1 -1
  162. package/select/internal/shared.js.map +1 -1
  163. package/select/outlined-select.js +2 -1
  164. package/select/outlined-select.js.map +1 -1
  165. package/select/select-option.js +2 -1
  166. package/select/select-option.js.map +1 -1
  167. package/slider/harness.js.map +1 -1
  168. package/slider/internal/slider.js.map +1 -1
  169. package/slider/slider.js +2 -1
  170. package/slider/slider.js.map +1 -1
  171. package/switch/internal/switch.js.map +1 -1
  172. package/switch/switch.js +2 -1
  173. package/switch/switch.js.map +1 -1
  174. package/tabs/harness.js.map +1 -1
  175. package/tabs/internal/tab.js.map +1 -1
  176. package/tabs/internal/tabs.js.map +1 -1
  177. package/tabs/primary-tab.js +2 -1
  178. package/tabs/primary-tab.js.map +1 -1
  179. package/tabs/secondary-tab.js +2 -1
  180. package/tabs/secondary-tab.js.map +1 -1
  181. package/tabs/tabs.js +2 -1
  182. package/tabs/tabs.js.map +1 -1
  183. package/testing/harness.js.map +1 -1
  184. package/testing/transform-pseudo-classes.js.map +1 -1
  185. package/textfield/filled-text-field.js +2 -1
  186. package/textfield/filled-text-field.js.map +1 -1
  187. package/textfield/harness.js.map +1 -1
  188. package/textfield/internal/text-field.js.map +1 -1
  189. package/textfield/outlined-text-field.js +2 -1
  190. package/textfield/outlined-text-field.js.map +1 -1
@@ -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,CA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O;;OAEb,CAAC;SACH;QAED,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,OAAO,IAAI,CAAA;kDACiC,SAAS,IAAI,OAAO;YAC1D,OAAO;;OAEZ,CAAC;SACH;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,oBAAoB,CAAC,aAA4B;QAClE,OAAO,kBAAkB,CAAC;YACxB,aAAa;YACb,SAAS,EAAE,IAAI,CAAC,eAAe;YAC/B,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,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
+ {"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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 +1 @@
1
- {"version":3,"file":"multi-action-chip.js","sourceRoot":"","sources":["multi-action-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,KAAK,CAAC;AAInC,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAgB,eAAgB,SAAQ,IAAI;IAChD,IAAI,eAAe;QACjB,IAAI,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE;YACxC,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAE,CAAC;SAC9C;QAED,MAAM,EAAC,SAAS,EAAC,GAAG,IAAuB,CAAC;QAE5C,yEAAyE;QACzE,IAAI,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE;YAC3B,OAAO,UAAU,SAAS,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;SAC5C;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,eAAe,CAAC,SAAwB;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC;QAClC,IAAI,S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ACF","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, isServer} from 'lit';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\n\nimport {Chip} from './chip.js';\n\nconst ARIA_LABEL_REMOVE = 'aria-label-remove';\n\n/**\n * A chip component with multiple actions.\n */\nexport abstract class MultiActionChip extends Chip {\n get ariaLabelRemove(): string | null {\n if (this.hasAttribute(ARIA_LABEL_REMOVE)) {\n return this.getAttribute(ARIA_LABEL_REMOVE)!;\n }\n\n const {ariaLabel} = this as ARIAMixinStrict;\n\n // TODO(b/350810013): remove `this.label` when label property is removed.\n if (ariaLabel || this.label) {\n return `Remove ${ariaLabel || this.label}`;\n }\n\n return null;\n }\n\n set ariaLabelRemove(ariaLabel: string | null) {\n const prev = this.ariaLabelRemove;\n if (ariaLabel === prev) {\n return;\n }\n\n if (ariaLabel === null) {\n this.removeAttribute(ARIA_LABEL_REMOVE);\n } else {\n this.setAttribute(ARIA_LABEL_REMOVE, ariaLabel);\n }\n\n this.requestUpdate();\n }\n\n protected abstract readonly primaryAction: HTMLElement | null;\n protected abstract readonly trailingAction: HTMLElement | null;\n\n constructor() {\n super();\n this.handleTrailingActionFocus = this.handleTrailingActionFocus.bind(this);\n if (!isServer) {\n this.addEventListener('keydown', this.handleKeyDown.bind(this));\n }\n }\n\n override focus(options?: FocusOptions & {trailing?: boolean}) {\n const isFocusable = this.alwaysFocusable || !this.disabled;\n if (isFocusable && options?.trailing && this.trailingAction) {\n this.trailingAction.focus(options);\n return;\n }\n\n super.focus(options as FocusOptions);\n }\n\n protected override renderContainerContent() {\n return html`\n ${super.renderContainerContent()}\n ${this.renderTrailingAction(this.handleTrailingActionFocus)}\n `;\n }\n\n protected abstract renderTrailingAction(\n focusListener: EventListener,\n ): unknown;\n\n private handleKeyDown(event: KeyboardEvent) {\n const isLeft = event.key === 'ArrowLeft';\n const isRight = event.key === 'ArrowRight';\n // Ignore non-navigation keys.\n if (!isLeft && !isRight) {\n return;\n }\n\n if (!this.primaryAction || !this.trailingAction) {\n // Does not have multiple actions.\n return;\n }\n\n // Check if moving forwards or backwards\n const isRtl = getComputedStyle(this).direction === 'rtl';\n const forwards = isRtl ? isLeft : isRight;\n const isPrimaryFocused = this.primaryAction?.matches(':focus-within');\n const isTrailingFocused = this.trailingAction?.matches(':focus-within');\n\n if ((forwards && isTrailingFocused) || (!forwards && isPrimaryFocused)) {\n // Moving outside of the chip, it will be handled by the chip set.\n return;\n }\n\n // Prevent default interactions, such as scrolling.\n event.preventDefault();\n // Don't let the chip set handle this navigation event.\n event.stopPropagation();\n const actionToFocus = forwards ? this.trailingAction : this.primaryAction;\n actionToFocus.focus();\n }\n\n private handleTrailingActionFocus() {\n const {primaryAction, trailingAction} = this;\n if (!primaryAction || !trailingAction) {\n return;\n }\n\n // Temporarily turn off the primary action's focusability. This allows\n // shift+tab from the trailing action to move to the previous chip rather\n // than the primary action in the same chip.\n primaryAction.tabIndex = -1;\n trailingAction.addEventListener(\n 'focusout',\n () => {\n primaryAction.tabIndex = 0;\n },\n {once: true},\n );\n }\n}\n"]}
1
+ {"version":3,"file":"multi-action-chip.js","sourceRoot":"","sources":["multi-action-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,MAAM,KAAK,CAAC;AAInC,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AAE9C;;GAEG;AACH,MAAM,OAAgB,eAAgB,SAAQ,IAAI;IAChD,IAAI,eAAe;QACjB,IAAI,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACzC,OAAO,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAE,CAAC;QAC/C,CAAC;QAED,MAAM,EAAC,SAAS,EAAC,GAAG,IAAuB,CAAC;QAE5C,yEAAyE;QACzE,IAAI,SAAS,IAAI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C7C,IAAI,CAAC,aAAa,IAAI,CAAC,cAAc,EAAE,CAAC;YACtC,OAAO;QACT,CAAC;QAED,sEAAsE;QACtE,yEAAyE;QACzE,4CAA4C;QAC5C,aAAa,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;QAC5B,cAAc,CAAC,gBAAgB,CAC7B,UAAU,EACV,GAAG,EAAE;YACH,aAAa,CAAC,QAAQ,GAAG,CAAC,CAAC;QAC7B,CAAC,EACD,EAAC,IAAI,EAAE,IAAI,EAAC,CACb,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, isServer} from 'lit';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\n\nimport {Chip} from './chip.js';\n\nconst ARIA_LABEL_REMOVE = 'aria-label-remove';\n\n/**\n * A chip component with multiple actions.\n */\nexport abstract class MultiActionChip extends Chip {\n get ariaLabelRemove(): string | null {\n if (this.hasAttribute(ARIA_LABEL_REMOVE)) {\n return this.getAttribute(ARIA_LABEL_REMOVE)!;\n }\n\n const {ariaLabel} = this as ARIAMixinStrict;\n\n // TODO(b/350810013): remove `this.label` when label property is removed.\n if (ariaLabel || this.label) {\n return `Remove ${ariaLabel || this.label}`;\n }\n\n return null;\n }\n\n set ariaLabelRemove(ariaLabel: string | null) {\n const prev = this.ariaLabelRemove;\n if (ariaLabel === prev) {\n return;\n }\n\n if (ariaLabel === null) {\n this.removeAttribute(ARIA_LABEL_REMOVE);\n } else {\n this.setAttribute(ARIA_LABEL_REMOVE, ariaLabel);\n }\n\n this.requestUpdate();\n }\n\n protected abstract readonly primaryAction: HTMLElement | null;\n protected abstract readonly trailingAction: HTMLElement | null;\n\n constructor() {\n super();\n this.handleTrailingActionFocus = this.handleTrailingActionFocus.bind(this);\n if (!isServer) {\n this.addEventListener('keydown', this.handleKeyDown.bind(this));\n }\n }\n\n override focus(options?: FocusOptions & {trailing?: boolean}) {\n const isFocusable = this.alwaysFocusable || !this.disabled;\n if (isFocusable && options?.trailing && this.trailingAction) {\n this.trailingAction.focus(options);\n return;\n }\n\n super.focus(options as FocusOptions);\n }\n\n protected override renderContainerContent() {\n return html`\n ${super.renderContainerContent()}\n ${this.renderTrailingAction(this.handleTrailingActionFocus)}\n `;\n }\n\n protected abstract renderTrailingAction(\n focusListener: EventListener,\n ): unknown;\n\n private handleKeyDown(event: KeyboardEvent) {\n const isLeft = event.key === 'ArrowLeft';\n const isRight = event.key === 'ArrowRight';\n // Ignore non-navigation keys.\n if (!isLeft && !isRight) {\n return;\n }\n\n if (!this.primaryAction || !this.trailingAction) {\n // Does not have multiple actions.\n return;\n }\n\n // Check if moving forwards or backwards\n const isRtl = getComputedStyle(this).direction === 'rtl';\n const forwards = isRtl ? isLeft : isRight;\n const isPrimaryFocused = this.primaryAction?.matches(':focus-within');\n const isTrailingFocused = this.trailingAction?.matches(':focus-within');\n\n if ((forwards && isTrailingFocused) || (!forwards && isPrimaryFocused)) {\n // Moving outside of the chip, it will be handled by the chip set.\n return;\n }\n\n // Prevent default interactions, such as scrolling.\n event.preventDefault();\n // Don't let the chip set handle this navigation event.\n event.stopPropagation();\n const actionToFocus = forwards ? this.trailingAction : this.primaryAction;\n actionToFocus.focus();\n }\n\n private handleTrailingActionFocus() {\n const {primaryAction, trailingAction} = this;\n if (!primaryAction || !trailingAction) {\n return;\n }\n\n // Temporarily turn off the primary action's focusability. This allows\n // shift+tab from the trailing action to move to the previous chip rather\n // than the primary action in the same chip.\n primaryAction.tabIndex = -1;\n trailingAction.addEventListener(\n 'focusout',\n () => {\n primaryAction.tabIndex = 0;\n },\n {once: true},\n );\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"trailing-icons.js","sourceRoot":"","sources":["trailing-icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAWlC,iBAAiB;AACjB,MAAM,UAAU,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,aAAa,EACb,QAAQ,GAAG,KAAK,GACO;IACvB,4EAA4E;IAC5E,8EAA8E;IAC9E,yEAAyE;IACzE,OAAO,IAAI,CAAA;;;;mBAIM,SAAS,IAAI,OAAO;wBACf,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO;iBAClD,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO;eAC1B,iBAAiB;eACjB,aAAa;;6BAEC,QAAQ;;;;;;;;;;;GAWlC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAa,KAAY;IACjD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE;QACtC,OAAO;KACR;IAED,KAAK,CAAC,eAAe,EAAE,CAAC;IACxB,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,aAAa,CACxC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAC,UAAU,EAAE,IAAI,EAAC,CAAC,CACxC,CAAC;IACF,IAAI,cAAc,EAAE;QAClB,OAAO;KACR;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAChB,CAAC","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, nothing} from 'lit';\n\nimport {Chip} from './chip.js';\n\ninterface RemoveButtonProperties {\n ariaLabel: string | null;\n disabled: boolean;\n focusListener: EventListener;\n tabbable?: boolean;\n}\n\n/** @protected */\nexport function renderRemoveButton({\n ariaLabel,\n disabled,\n focusListener,\n tabbable = false,\n}: RemoveButtonProperties) {\n // When an aria-label is not provided, we use two spans with aria-labelledby\n // to create the \"Remove <textContent>\" label for the remove button. The first\n // is this #remove-label span, the second is the chip's #label slot span.\n return html`\n <span id=\"remove-label\" hidden aria-hidden=\"true\">Remove</span>\n <button\n class=\"trailing action\"\n aria-label=${ariaLabel || nothing}\n aria-labelledby=${!ariaLabel ? 'remove-label label' : nothing}\n tabindex=${!tabbable ? -1 : nothing}\n @click=${handleRemoveClick}\n @focus=${focusListener}>\n <md-focus-ring part=\"trailing-focus-ring\"></md-focus-ring>\n <md-ripple ?disabled=${disabled}></md-ripple>\n <span class=\"trailing icon\" aria-hidden=\"true\">\n <slot name=\"remove-trailing-icon\">\n <svg viewBox=\"0 96 960 960\">\n <path\n d=\"m249 849-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z\" />\n </svg>\n </slot>\n </span>\n <span class=\"touch\"></span>\n </button>\n `;\n}\n\nfunction handleRemoveClick(this: Chip, event: Event) {\n if (this.disabled || this.softDisabled) {\n return;\n }\n\n event.stopPropagation();\n const preventDefault = !this.dispatchEvent(\n new Event('remove', {cancelable: true}),\n );\n if (preventDefault) {\n return;\n }\n\n this.remove();\n}\n"]}
1
+ {"version":3,"file":"trailing-icons.js","sourceRoot":"","sources":["trailing-icons.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,8BAA8B,CAAC;AACtC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAWlC,iBAAiB;AACjB,MAAM,UAAU,kBAAkB,CAAC,EACjC,SAAS,EACT,QAAQ,EACR,aAAa,EACb,QAAQ,GAAG,KAAK,GACO;IACvB,4EAA4E;IAC5E,8EAA8E;IAC9E,yEAAyE;IACzE,OAAO,IAAI,CAAA;;;;mBAIM,SAAS,IAAI,OAAO;wBACf,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO;iBAClD,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO;eAC1B,iBAAiB;eACjB,aAAa;;6BAEC,QAAQ;;;;;;;;;;;GAWlC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAa,KAAY;IACjD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;QACvC,OAAO;IACT,CAAC;IAED,KAAK,CAAC,eAAe,EAAE,CAAC;IACxB,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,aAAa,CACxC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAC,UAAU,EAAE,IAAI,EAAC,CAAC,CACxC,CAAC;IACF,IAAI,cAAc,EAAE,CAAC;QACnB,OAAO;IACT,CAAC;IAED,IAAI,CAAC,MAAM,EAAE,CAAC;AAChB,CAAC","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, nothing} from 'lit';\n\nimport {Chip} from './chip.js';\n\ninterface RemoveButtonProperties {\n ariaLabel: string | null;\n disabled: boolean;\n focusListener: EventListener;\n tabbable?: boolean;\n}\n\n/** @protected */\nexport function renderRemoveButton({\n ariaLabel,\n disabled,\n focusListener,\n tabbable = false,\n}: RemoveButtonProperties) {\n // When an aria-label is not provided, we use two spans with aria-labelledby\n // to create the \"Remove <textContent>\" label for the remove button. The first\n // is this #remove-label span, the second is the chip's #label slot span.\n return html`\n <span id=\"remove-label\" hidden aria-hidden=\"true\">Remove</span>\n <button\n class=\"trailing action\"\n aria-label=${ariaLabel || nothing}\n aria-labelledby=${!ariaLabel ? 'remove-label label' : nothing}\n tabindex=${!tabbable ? -1 : nothing}\n @click=${handleRemoveClick}\n @focus=${focusListener}>\n <md-focus-ring part=\"trailing-focus-ring\"></md-focus-ring>\n <md-ripple ?disabled=${disabled}></md-ripple>\n <span class=\"trailing icon\" aria-hidden=\"true\">\n <slot name=\"remove-trailing-icon\">\n <svg viewBox=\"0 96 960 960\">\n <path\n d=\"m249 849-42-42 231-231-231-231 42-42 231 231 231-231 42 42-231 231 231 231-42 42-231-231-231 231Z\" />\n </svg>\n </slot>\n </span>\n <span class=\"touch\"></span>\n </button>\n `;\n}\n\nfunction handleRemoveClick(this: Chip, event: Event) {\n if (this.disabled || this.softDisabled) {\n return;\n }\n\n event.stopPropagation();\n const preventDefault = !this.dispatchEvent(\n new Event('remove', {cancelable: true}),\n );\n if (preventDefault) {\n return;\n }\n\n this.remove();\n}\n"]}
@@ -15,10 +15,11 @@ import { styles } from './internal/suggestion-styles.js';
15
15
  * @final
16
16
  * @suppress {visibility}
17
17
  */
18
- export let MdSuggestionChip = class MdSuggestionChip extends SuggestionChip {
18
+ let MdSuggestionChip = class MdSuggestionChip extends SuggestionChip {
19
19
  };
20
20
  MdSuggestionChip.styles = [sharedStyles, elevatedStyles, styles];
21
21
  MdSuggestionChip = __decorate([
22
22
  customElement('md-suggestion-chip')
23
23
  ], MdSuggestionChip);
24
+ export { MdSuggestionChip };
24
25
  //# sourceMappingURL=suggestion-chip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"suggestion-chip.js","sourceRoot":"","sources":["suggestion-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAC,MAAM,EAAC,MAAM,iCAAiC,CAAC;AAQvD;;;;;GAKG;AAEI,WAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,cAAc;;AAClC,uBAAM,GAAwB,CAAC,YAAY,EAAE,cAAc,EAAE,MAAM,CAAC,AAA9D,CAA+D;AAD1E,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAE5B","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {styles as elevatedStyles} from './internal/elevated-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\nimport {SuggestionChip} from './internal/suggestion-chip.js';\nimport {styles} from './internal/suggestion-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-suggestion-chip': MdSuggestionChip;\n }\n}\n\n/**\n * TODO(b/243982145): add docs\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-suggestion-chip')\nexport class MdSuggestionChip extends SuggestionChip {\n static override styles: CSSResultOrNative[] = [sharedStyles, elevatedStyles, styles];\n}\n"]}
1
+ {"version":3,"file":"suggestion-chip.js","sourceRoot":"","sources":["suggestion-chip.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAC,MAAM,EAAC,MAAM,iCAAiC,CAAC;AAQvD;;;;;GAKG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,cAAc;;AAClC,uBAAM,GAAwB,CAAC,YAAY,EAAE,cAAc,EAAE,MAAM,CAAC,AAA9D,CAA+D;AAD1E,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAE5B","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {styles as elevatedStyles} from './internal/elevated-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\nimport {SuggestionChip} from './internal/suggestion-chip.js';\nimport {styles} from './internal/suggestion-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-suggestion-chip': MdSuggestionChip;\n }\n}\n\n/**\n * TODO(b/243982145): add docs\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-suggestion-chip')\nexport class MdSuggestionChip extends SuggestionChip {\n static override styles: CSSResultOrNative[] = [sharedStyles, elevatedStyles, styles];\n}\n"]}
package/dialog/dialog.js CHANGED
@@ -34,10 +34,11 @@ import { styles } from './internal/dialog-styles.js';
34
34
  * @final
35
35
  * @suppress {visibility}
36
36
  */
37
- export let MdDialog = class MdDialog extends Dialog {
37
+ let MdDialog = class MdDialog extends Dialog {
38
38
  };
39
39
  MdDialog.styles = [styles];
40
40
  MdDialog = __decorate([
41
41
  customElement('md-dialog')
42
42
  ], MdDialog);
43
+ export { MdDialog };
43
44
  //# sourceMappingURL=dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sourceRoot":"","sources":["dialog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AAQnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,WAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,MAAM;;AAClB,eAAM,GAAwB,CAAC,MAAM,CAAC,AAAhC,CAAiC;AAD5C,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAEpB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Dialog} from './internal/dialog.js';\nimport {styles} from './internal/dialog-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-dialog': MdDialog;\n }\n}\n\n/**\n * @summary Dialogs can require an action, communicate information, or help\n * users accomplish a task. There are two types of dialogs: basic and\n * full-screen.\n *\n * @description\n * A dialog is a modal window that appears in front of app content to provide\n * critical information or ask for a decision. Dialogs disable all app\n * functionality when they appear, and remain on screen until confirmed,\n * dismissed, or a required action has been taken.\n *\n * Dialogs are purposefully interruptive, so they should be used sparingly.\n * A less disruptive alternative is to use a menu, which provides options\n * without interrupting a user’s experience.\n *\n * On mobile devices only, complex dialogs should be displayed fullscreen.\n *\n * __Example usages:__\n * - Common use cases for basic dialogs include alerts, quick selection, and\n * confirmation.\n * - More complex dialogs may contain actions that require a series of tasks\n * to complete. One example is creating a calendar entry with the event title,\n * date, location, and time.\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-dialog')\nexport class MdDialog extends Dialog {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
1
+ {"version":3,"file":"dialog.js","sourceRoot":"","sources":["dialog.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAC,MAAM,6BAA6B,CAAC;AAQnD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,MAAM;;AAClB,eAAM,GAAwB,CAAC,MAAM,CAAC,AAAhC,CAAiC;AAD5C,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CAEpB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Dialog} from './internal/dialog.js';\nimport {styles} from './internal/dialog-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-dialog': MdDialog;\n }\n}\n\n/**\n * @summary Dialogs can require an action, communicate information, or help\n * users accomplish a task. There are two types of dialogs: basic and\n * full-screen.\n *\n * @description\n * A dialog is a modal window that appears in front of app content to provide\n * critical information or ask for a decision. Dialogs disable all app\n * functionality when they appear, and remain on screen until confirmed,\n * dismissed, or a required action has been taken.\n *\n * Dialogs are purposefully interruptive, so they should be used sparingly.\n * A less disruptive alternative is to use a menu, which provides options\n * without interrupting a user’s experience.\n *\n * On mobile devices only, complex dialogs should be displayed fullscreen.\n *\n * __Example usages:__\n * - Common use cases for basic dialogs include alerts, quick selection, and\n * confirmation.\n * - More complex dialogs may contain actions that require a series of tasks\n * to complete. One example is creating a calendar entry with the event title,\n * date, location, and time.\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-dialog')\nexport class MdDialog extends Dialog {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
@@ -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;;;;;;;;;GASG;AACH,MAAM,OAAO,MA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IACxD,IAAI,CAAC,eAAe,EAAE;QACpB,OAAO,KAAK,CAAC;KACd;IAED,0EAA0E;IAC1E,2EAA2E;IAC3E,iDAAiD;IACjD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QACjC,OAAO,KAAK,CAAC;KACd;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,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;;;;;;;;;GASG;AACH,MAAM,OAAO,MAAO,SAAQ,eAAe;IACzC,kEAAkE;IAClE,kBAAkB;IAClB,mEAAmE;IAE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C7C,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"]}
@@ -17,10 +17,11 @@ import { styles } from './internal/divider-styles.js';
17
17
  * @final
18
18
  * @suppress {visibility}
19
19
  */
20
- export let MdDivider = class MdDivider extends Divider {
20
+ let MdDivider = class MdDivider extends Divider {
21
21
  };
22
22
  MdDivider.styles = [styles];
23
23
  MdDivider = __decorate([
24
24
  customElement('md-divider')
25
25
  ], MdDivider);
26
+ export { MdDivider };
26
27
  //# sourceMappingURL=divider.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"divider.js","sourceRoot":"","sources":["divider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAQpD;;;;;;;;;GASG;AAEI,WAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,OAAO;;AACpB,gBAAM,GAAwB,CAAC,MAAM,CAAC,AAAhC,CAAiC;AAD5C,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAErB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Divider} from './internal/divider.js';\nimport {styles} from './internal/divider-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-divider': MdDivider;\n }\n}\n\n/**\n * @summary A divider is a thin line that groups content in lists and\n * containers.\n *\n * @description Dividers can reinforce tapability, such as when used to separate\n * list items or define tappable regions in an accordion.\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-divider')\nexport class MdDivider extends Divider {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
1
+ {"version":3,"file":"divider.js","sourceRoot":"","sources":["divider.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAQpD;;;;;;;;;GASG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,OAAO;;AACpB,gBAAM,GAAwB,CAAC,MAAM,CAAC,AAAhC,CAAiC;AAD5C,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAErB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Divider} from './internal/divider.js';\nimport {styles} from './internal/divider-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-divider': MdDivider;\n }\n}\n\n/**\n * @summary A divider is a thin line that groups content in lists and\n * containers.\n *\n * @description Dividers can reinforce tapability, such as when used to separate\n * list items or define tappable regions in an accordion.\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-divider')\nexport class MdDivider extends Divider {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
@@ -15,10 +15,11 @@ import { styles } from './internal/elevation-styles.js';
15
15
  * @final
16
16
  * @suppress {visibility}
17
17
  */
18
- export let MdElevation = class MdElevation extends Elevation {
18
+ let MdElevation = class MdElevation extends Elevation {
19
19
  };
20
20
  MdElevation.styles = [styles];
21
21
  MdElevation = __decorate([
22
22
  customElement('md-elevation')
23
23
  ], MdElevation);
24
+ export { MdElevation };
24
25
  //# sourceMappingURL=elevation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"elevation.js","sourceRoot":"","sources":["elevation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,gCAAgC,CAAC;AAQtD;;;;;;;GAOG;AAEI,WAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,SAAS;;AACxB,kBAAM,GAAwB,CAAC,MAAM,CAAC,AAAhC,CAAiC;AAD5C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAEvB","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 {Elevation} from './internal/elevation.js';\nimport {styles} from './internal/elevation-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-elevation': MdElevation;\n }\n}\n\n/**\n * The `<md-elevation>` custom element with default styles.\n *\n * Elevation is the relative distance between two surfaces along the z-axis.\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-elevation')\nexport class MdElevation extends Elevation {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
1
+ {"version":3,"file":"elevation.js","sourceRoot":"","sources":["elevation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,SAAS,EAAC,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,gCAAgC,CAAC;AAQtD;;;;;;;GAOG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,SAAS;;AACxB,kBAAM,GAAwB,CAAC,MAAM,CAAC,AAAhC,CAAiC;AAD5C,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAEvB","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 {Elevation} from './internal/elevation.js';\nimport {styles} from './internal/elevation-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-elevation': MdElevation;\n }\n}\n\n/**\n * The `<md-elevation>` custom element with default styles.\n *\n * Elevation is the relative distance between two surfaces along the z-axis.\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-elevation')\nexport class MdElevation extends Elevation {\n static override styles: CSSResultOrNative[] = [styles];\n}\n"]}
@@ -37,7 +37,7 @@ import { styles as sharedStyles } from './internal/shared-styles.js';
37
37
  * @final
38
38
  * @suppress {visibility}
39
39
  */
40
- export let MdBrandedFab = class MdBrandedFab extends Fab {
40
+ let MdBrandedFab = class MdBrandedFab extends Fab {
41
41
  getRenderClasses() {
42
42
  return {
43
43
  ...super.getRenderClasses(),
@@ -56,4 +56,5 @@ MdBrandedFab.styles = [
56
56
  MdBrandedFab = __decorate([
57
57
  customElement('md-branded-fab')
58
58
  ], MdBrandedFab);
59
+ export { MdBrandedFab };
59
60
  //# sourceMappingURL=branded-fab.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"branded-fab.js","sourceRoot":"","sources":["branded-fab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,GAAG,EAAa,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEI,WAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,GAAG;IAM1B,gBAAgB;QACvB,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;;AACe,mBAAM,GAAwB;IAC5C,YAAY;IACZ,MAAM;IACN,YAAY;CACb,AAJqB,CAIpB;AAnBS,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAoBxB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Fab, FabVariant} from './internal/fab.js';\nimport {styles} from './internal/fab-branded-styles.js';\nimport {styles as forcedColors} from './internal/forced-colors-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\nexport {type FabSize} from './internal/shared.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-branded-fab': MdBrandedFab;\n }\n}\n\n/**\n * @summary Floating action buttons (FABs) help people take primary actions.\n * They’re used to represent the most important action on a screen, such as\n * Create or Reply.\n *\n * @description\n * __Emphasis:__ High emphasis – For the primary, most important, or most common\n * action on a screen\n *\n * __Rationale:__ The FAB remains the default component for a screen’s primary\n * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended\n * FAB’s wider format and text label give it more visual prominence than a FAB.\n * It’s often used on larger screens where a FAB would seem too small. Branded\n * FABs are used to specifically call attention to branded logo icons.\n *\n * __Example usages:__\n * - FAB\n * - Create\n * - Compose\n * - Extended FAB\n * - Create\n * - Compose\n * - New Thread\n * - New File\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-branded-fab')\nexport class MdBrandedFab extends Fab {\n /**\n * Branded FABs have no variants\n */\n declare variant: FabVariant;\n\n override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'primary': false,\n 'secondary': false,\n 'tertiary': false,\n 'small': false,\n };\n }\n static override styles: CSSResultOrNative[] = [\n sharedStyles,\n styles,\n forcedColors,\n ];\n}\n"]}
1
+ {"version":3,"file":"branded-fab.js","sourceRoot":"","sources":["branded-fab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,GAAG,EAAa,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,kCAAkC,CAAC;AACxD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAUnE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,GAAG;IAM1B,gBAAgB;QACvB,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,KAAK;YAClB,UAAU,EAAE,KAAK;YACjB,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;;AACe,mBAAM,GAAwB;IAC5C,YAAY;IACZ,MAAM;IACN,YAAY;CACb,AAJqB,CAIpB;AAnBS,YAAY;IADxB,aAAa,CAAC,gBAAgB,CAAC;GACnB,YAAY,CAoBxB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {Fab, FabVariant} from './internal/fab.js';\nimport {styles} from './internal/fab-branded-styles.js';\nimport {styles as forcedColors} from './internal/forced-colors-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\nexport {type FabSize} from './internal/shared.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-branded-fab': MdBrandedFab;\n }\n}\n\n/**\n * @summary Floating action buttons (FABs) help people take primary actions.\n * They’re used to represent the most important action on a screen, such as\n * Create or Reply.\n *\n * @description\n * __Emphasis:__ High emphasis – For the primary, most important, or most common\n * action on a screen\n *\n * __Rationale:__ The FAB remains the default component for a screen’s primary\n * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended\n * FAB’s wider format and text label give it more visual prominence than a FAB.\n * It’s often used on larger screens where a FAB would seem too small. Branded\n * FABs are used to specifically call attention to branded logo icons.\n *\n * __Example usages:__\n * - FAB\n * - Create\n * - Compose\n * - Extended FAB\n * - Create\n * - Compose\n * - New Thread\n * - New File\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-branded-fab')\nexport class MdBrandedFab extends Fab {\n /**\n * Branded FABs have no variants\n */\n declare variant: FabVariant;\n\n override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'primary': false,\n 'secondary': false,\n 'tertiary': false,\n 'small': false,\n };\n }\n static override styles: CSSResultOrNative[] = [\n sharedStyles,\n styles,\n forcedColors,\n ];\n}\n"]}
package/fab/fab.js CHANGED
@@ -36,10 +36,11 @@ import { styles as sharedStyles } from './internal/shared-styles.js';
36
36
  * @final
37
37
  * @suppress {visibility}
38
38
  */
39
- export let MdFab = class MdFab extends Fab {
39
+ let MdFab = class MdFab extends Fab {
40
40
  };
41
41
  MdFab.styles = [sharedStyles, styles, forcedColors];
42
42
  MdFab = __decorate([
43
43
  customElement('md-fab')
44
44
  ], MdFab);
45
+ export { MdFab };
45
46
  //# sourceMappingURL=fab.js.map
package/fab/fab.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"fab.js","sourceRoot":"","sources":["fab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,GAAG,EAAC,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAWnE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,WAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,GAAG;;AACZ,YAAM,GAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,AAA5D,CAA6D;AADxE,KAAK;IADjB,aAAa,CAAC,QAAQ,CAAC;GACX,KAAK,CAEjB","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 {Fab} from './internal/fab.js';\nimport {styles} from './internal/fab-styles.js';\nimport {styles as forcedColors} from './internal/forced-colors-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\nexport {type FabVariant} from './internal/fab.js';\nexport {type FabSize} from './internal/shared.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-fab': MdFab;\n }\n}\n\n/**\n * @summary Floating action buttons (FABs) help people take primary actions.\n * They’re used to represent the most important action on a screen, such as\n * Create or Reply.\n *\n * @description\n * __Emphasis:__ High emphasis – For the primary, most important, or most common\n * action on a screen\n *\n * __Rationale:__ The FAB remains the default component for a screen’s primary\n * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended\n * FAB’s wider format and text label give it more visual prominence than a FAB.\n * It’s often used on larger screens where a FAB would seem too small.\n *\n * __Example usages:__\n * - FAB\n * - Create\n * - Compose\n * - Extended FAB\n * - Create\n * - Compose\n * - New Thread\n * - New File\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-fab')\nexport class MdFab extends Fab {\n static override styles: CSSResultOrNative[] = [sharedStyles, styles, forcedColors];\n}\n"]}
1
+ {"version":3,"file":"fab.js","sourceRoot":"","sources":["fab.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,GAAG,EAAC,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAWnE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,IAAM,KAAK,GAAX,MAAM,KAAM,SAAQ,GAAG;;AACZ,YAAM,GAAwB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,CAAC,AAA5D,CAA6D;AADxE,KAAK;IADjB,aAAa,CAAC,QAAQ,CAAC;GACX,KAAK,CAEjB","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 {Fab} from './internal/fab.js';\nimport {styles} from './internal/fab-styles.js';\nimport {styles as forcedColors} from './internal/forced-colors-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\nexport {type FabVariant} from './internal/fab.js';\nexport {type FabSize} from './internal/shared.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-fab': MdFab;\n }\n}\n\n/**\n * @summary Floating action buttons (FABs) help people take primary actions.\n * They’re used to represent the most important action on a screen, such as\n * Create or Reply.\n *\n * @description\n * __Emphasis:__ High emphasis – For the primary, most important, or most common\n * action on a screen\n *\n * __Rationale:__ The FAB remains the default component for a screen’s primary\n * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended\n * FAB’s wider format and text label give it more visual prominence than a FAB.\n * It’s often used on larger screens where a FAB would seem too small.\n *\n * __Example usages:__\n * - FAB\n * - Create\n * - Compose\n * - Extended FAB\n * - Create\n * - Compose\n * - New Thread\n * - New File\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-fab')\nexport class MdFab extends Fab {\n static override styles: CSSResultOrNative[] = [sharedStyles, styles, forcedColors];\n}\n"]}
@@ -13,10 +13,11 @@ import { styles as sharedStyles } from './internal/shared-styles.js';
13
13
  * @final
14
14
  * @suppress {visibility}
15
15
  */
16
- export let MdFilledField = class MdFilledField extends FilledField {
16
+ let MdFilledField = class MdFilledField extends FilledField {
17
17
  };
18
18
  MdFilledField.styles = [sharedStyles, filledStyles];
19
19
  MdFilledField = __decorate([
20
20
  customElement('md-filled-field')
21
21
  ], MdFilledField);
22
+ export { MdFilledField };
22
23
  //# sourceMappingURL=filled-field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"filled-field.js","sourceRoot":"","sources":["filled-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAQnE;;;;GAIG;AAEI,WAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAW;;AAC5B,oBAAM,GAAwB,CAAC,YAAY,EAAE,YAAY,CAAC,AAApD,CAAqD;AADhE,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAEzB","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {FilledField} from './internal/filled-field.js';\nimport {styles as filledStyles} from './internal/filled-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-filled-field': MdFilledField;\n }\n}\n\n/**\n * TODO(b/228525797): add docs\n * @final\n * @suppress {visibility}\n */\n@customElement('md-filled-field')\nexport class MdFilledField extends FilledField {\n static override styles: CSSResultOrNative[] = [sharedStyles, filledStyles];\n}\n"]}
1
+ {"version":3,"file":"filled-field.js","sourceRoot":"","sources":["filled-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,WAAW,EAAC,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAQnE;;;;GAIG;AAEI,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAW;;AAC5B,oBAAM,GAAwB,CAAC,YAAY,EAAE,YAAY,CAAC,AAApD,CAAqD;AADhE,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CAEzB","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {FilledField} from './internal/filled-field.js';\nimport {styles as filledStyles} from './internal/filled-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-filled-field': MdFilledField;\n }\n}\n\n/**\n * TODO(b/228525797): add docs\n * @final\n * @suppress {visibility}\n */\n@customElement('md-filled-field')\nexport class MdFilledField extends FilledField {\n static override styles: CSSResultOrNative[] = [sharedStyles, filledStyles];\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACL,IAAI,EACJ,UAAU,EACV,OAAO,EAEP,MAAM,GAEP,MAAM,KAAK,CAAC;AACb,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,MAAM,EAAC,MAAM,oCAAoC,CAAC;AAE1D;;GAEG;AACH,MAAM,OAAO,KAAM,SAAQ,UAAU;IAArC;;QAC6B,aAAQ,GAAG,KAAK,CAAC;QACjB,UAAK,GAAG,KAAK,CAAC;QACd,YAAO,GAAG,KAAK,CAAC;QAC/B,UAAK,GAAG,EAAE,CAAC;QAC8B,eAAU,GAAG,KAAK,CAAC;QAC7C,cAAS,GAAG,KAAK,CAAC;QAClB,aAAQ,GAAG,KAAK,CAAC;QACjB,cAAS,GAAG,KAAK,CAAC;QACH,mBAAc,GAAG,EAAE,CAAC;QACzB,cAAS,GAAG,EAAE,CAAC;Q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CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAC,CAAC;qCAAgB;AAG/C;IADhB,qBAAqB,CAAC,EAAC,IAAI,EAAE,kBAAkB,EAAC,CAAC;qDACM;AAmBvC;IAAhB,KAAK,EAAE;0CAA6B;AAOpB;IAAhB,KAAK,EAAE;gDAAmC;AAC1B;IAAhB,KAAK,EAAE;iDAAoC;AAE3B;IADhB,KAAK,CAAC,iBAAiB,CAAC;8CAC6B;AACZ;IAAzC,KAAK,CAAC,gBAAgB,CAAC;6CAAsD;AACxC;IAArC,KAAK,CAAC,YAAY,CAAC;0CAAmD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n html,\n LitElement,\n nothing,\n PropertyValues,\n render,\n TemplateResult,\n} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {EASING} from '../../internal/motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property() label = '';\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) required = false;\n @property({type: Boolean}) resizable = false;\n @property({attribute: 'supporting-text'}) supportingText = '';\n @property({attribute: 'error-text'}) errorText = '';\n @property({type: Number}) count = -1;\n @property({type: Number}) max = -1;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean, attribute: 'has-start'}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean, attribute: 'has-end'}) hasEnd = false;\n\n @queryAssignedElements({slot: 'aria-describedby'})\n private readonly slottedAriaDescribedBy!: HTMLElement[];\n\n private get counterText() {\n // Count and max are typed as number, but can be set to null when Lit removes\n // their attributes. These getters coerce back to a number for calculations.\n const countAsNumber = this.count ?? -1;\n const maxAsNumber = this.max ?? -1;\n // Counter does not show if count is negative, or max is negative or 0.\n if (countAsNumber < 0 || maxAsNumber <= 0) {\n return '';\n }\n\n return `${countAsNumber} / ${maxAsNumber}`;\n }\n\n private get supportingOrErrorText() {\n return this.error && this.errorText ? this.errorText : this.supportingText;\n }\n\n @state() private isAnimating = false;\n private labelAnimation?: Animation;\n /**\n * When set to true, the error text's `role=\"alert\"` will be removed, then\n * re-added after an animation frame. This will re-announce an error message\n * to screen readers.\n */\n @state() private refreshErrorAlert = false;\n @state() private disableTransitions = false;\n @query('.label.floating')\n private readonly floatingLabelEl!: HTMLElement | null;\n @query('.label.resting') private readonly restingLabelEl!: HTMLElement | null;\n @query('.container') private readonly containerEl!: HTMLElement | null;\n\n /**\n * Re-announces the field's error supporting text to screen readers.\n *\n * Error text announces to screen readers anytime it is visible and changes.\n * Use the method to re-announce the message when the text has not changed,\n * but announcement is still needed (such as for `reportValidity()`).\n */\n reannounceError() {\n this.refreshErrorAlert = true;\n }\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n const isDisabledChanging =\n props.has('disabled') && props.get('disabled') !== undefined;\n if (isDisabledChanging) {\n this.disableTransitions = true;\n }\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated'),\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'disable-transitions': this.disableTransitions,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'resizable': this.resizable,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container-overflow\">\n ${this.renderBackground?.()}\n <slot name=\"container\"></slot>\n ${this.renderStateLayer?.()} ${this.renderIndicator?.()} ${outline}\n <div class=\"container\">\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n <div class=\"label-wrapper\">\n ${restingLabel} ${outline ? nothing : floatingLabel}\n </div>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n </div>\n ${this.renderSupportingText()}\n </div>\n `;\n }\n\n protected override updated(changed: PropertyValues<Field>) {\n if (\n changed.has('supportingText') ||\n changed.has('errorText') ||\n changed.has('count') ||\n changed.has('max')\n ) {\n this.updateSlottedAriaDescribedBy();\n }\n\n if (this.refreshErrorAlert) {\n // The past render cycle removed the role=\"alert\" from the error message.\n // Re-add it after an animation frame to re-announce the error.\n requestAnimationFrame(() => {\n this.refreshErrorAlert = false;\n });\n }\n\n if (this.disableTransitions) {\n requestAnimationFrame(() => {\n this.disableTransitions = false;\n });\n }\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderStateLayer?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: unknown): TemplateResult;\n\n private renderSupportingText() {\n const {supportingOrErrorText, counterText} = this;\n if (!supportingOrErrorText && !counterText) {\n return nothing;\n }\n\n // Always render the supporting text span so that our `space-around`\n // container puts the counter at the end.\n const start = html`<span>${supportingOrErrorText}</span>`;\n // Conditionally render counter so we don't render the extra `gap`.\n // TODO(b/244473435): add aria-label and announcements\n const end = counterText\n ? html`<span class=\"counter\">${counterText}</span>`\n : nothing;\n\n // Announce if there is an error and error text visible.\n // If refreshErrorAlert is true, do not announce. This will remove the\n // role=\"alert\" attribute. Another render cycle will happen after an\n // animation frame to re-add the role.\n const shouldErrorAnnounce =\n this.error && this.errorText && !this.refreshErrorAlert;\n const role = shouldErrorAnnounce ? 'alert' : nothing;\n return html`\n <div class=\"supporting-text\" role=${role}>${start}${end}</div>\n <slot\n name=\"aria-describedby\"\n @slotchange=${this.updateSlottedAriaDescribedBy}></slot>\n `;\n }\n\n private updateSlottedAriaDescribedBy() {\n for (const element of this.slottedAriaDescribedBy) {\n render(html`${this.supportingOrErrorText} ${this.counterText}`, element);\n element.setAttribute('hidden', '');\n }\n }\n\n private renderLabel(isFloating: boolean) {\n if (!this.label) {\n return nothing;\n }\n\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated or when animating.\n visible = this.focused || this.populated || this.isAnimating;\n } else {\n // Resting label is visible when unfocused. It is never visible while\n // animating.\n visible = !this.focused && !this.populated && !this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n // Add '*' if a label is present and the field is required\n const labelText = `${this.label}${\n this.required && !this.noAsterisk ? '*' : ''\n }`;\n\n return html`\n <span class=\"label ${classMap(classes)}\" aria-hidden=${!visible}\n >${labelText}</span\n >\n `;\n }\n\n private animateLabelIfNeeded({\n wasFocused,\n wasPopulated,\n }: {\n wasFocused?: boolean;\n wasPopulated?: boolean;\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n this.labelAnimation?.cancel();\n\n // Only one label is visible at a time for clearer text rendering.\n // The floating label is visible and used during animation. At the end of\n // the animation, it will either remain visible (if floating) or hide and\n // the resting label will be shown.\n //\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n this.labelAnimation = this.floatingLabelEl?.animate(\n this.getLabelKeyframes(),\n {duration: 150, easing: EASING.STANDARD},\n );\n\n this.labelAnimation?.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n });\n }\n\n private getLabelKeyframes() {\n const {floatingLabelEl, restingLabelEl} = this;\n if (!floatingLabelEl || !restingLabelEl) {\n return [];\n }\n\n const {\n x: floatingX,\n y: floatingY,\n height: floatingHeight,\n } = floatingLabelEl.getBoundingClientRect();\n const {\n x: restingX,\n y: restingY,\n height: restingHeight,\n } = restingLabelEl.getBoundingClientRect();\n const floatingScrollWidth = floatingLabelEl.scrollWidth;\n const restingScrollWidth = restingLabelEl.scrollWidth;\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking and overflow.\n // (use scrollWidth instead of width to account for clipped labels)\n const scale = restingScrollWidth / floatingScrollWidth;\n const xDelta = restingX - floatingX;\n // The line-height of the resting and floating label are different. When\n // we move the floating label down to the resting label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled floating label's height will be.\n const yDelta =\n restingY -\n floatingY +\n Math.round((restingHeight - floatingHeight * scale) / 2);\n\n // Create the two transforms: floating to resting (using the calculations\n // above), and resting to floating (re-setting the transform to initial\n // values).\n const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;\n const floatTransform = `translateX(0) translateY(0) scale(1)`;\n\n // Constrain the floating labels width to a scaled percentage of the\n // resting label's width. This will prevent long clipped labels from\n // overflowing the container.\n const restingClientWidth = restingLabelEl.clientWidth;\n const isRestingClipped = restingScrollWidth > restingClientWidth;\n const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';\n if (this.focused || this.populated) {\n return [\n {transform: restTransform, width},\n {transform: floatTransform, width},\n ];\n }\n\n return [\n {transform: floatTransform, width},\n {transform: restTransform, width},\n ];\n }\n\n getSurfacePositionClientRect() {\n return this.containerEl!.getBoundingClientRect();\n }\n}\n"]}
1
+ {"version":3,"file":"field.js","sourceRoot":"","sources":["field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EACL,IAAI,EACJ,UAA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License-Identifier: Apache-2.0\n */\n\nimport {\n html,\n LitElement,\n nothing,\n PropertyValues,\n render,\n TemplateResult,\n} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {EASING} from '../../internal/motion/animation.js';\n\n/**\n * A field component.\n */\nexport class Field extends LitElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) error = false;\n @property({type: Boolean}) focused = false;\n @property() label = '';\n @property({type: Boolean, attribute: 'no-asterisk'}) noAsterisk = false;\n @property({type: Boolean}) populated = false;\n @property({type: Boolean}) required = false;\n @property({type: Boolean}) resizable = false;\n @property({attribute: 'supporting-text'}) supportingText = '';\n @property({attribute: 'error-text'}) errorText = '';\n @property({type: Number}) count = -1;\n @property({type: Number}) max = -1;\n\n /**\n * Whether or not the field has leading content.\n */\n @property({type: Boolean, attribute: 'has-start'}) hasStart = false;\n\n /**\n * Whether or not the field has trailing content.\n */\n @property({type: Boolean, attribute: 'has-end'}) hasEnd = false;\n\n @queryAssignedElements({slot: 'aria-describedby'})\n private readonly slottedAriaDescribedBy!: HTMLElement[];\n\n private get counterText() {\n // Count and max are typed as number, but can be set to null when Lit removes\n // their attributes. These getters coerce back to a number for calculations.\n const countAsNumber = this.count ?? -1;\n const maxAsNumber = this.max ?? -1;\n // Counter does not show if count is negative, or max is negative or 0.\n if (countAsNumber < 0 || maxAsNumber <= 0) {\n return '';\n }\n\n return `${countAsNumber} / ${maxAsNumber}`;\n }\n\n private get supportingOrErrorText() {\n return this.error && this.errorText ? this.errorText : this.supportingText;\n }\n\n @state() private isAnimating = false;\n private labelAnimation?: Animation;\n /**\n * When set to true, the error text's `role=\"alert\"` will be removed, then\n * re-added after an animation frame. This will re-announce an error message\n * to screen readers.\n */\n @state() private refreshErrorAlert = false;\n @state() private disableTransitions = false;\n @query('.label.floating')\n private readonly floatingLabelEl!: HTMLElement | null;\n @query('.label.resting') private readonly restingLabelEl!: HTMLElement | null;\n @query('.container') private readonly containerEl!: HTMLElement | null;\n\n /**\n * Re-announces the field's error supporting text to screen readers.\n *\n * Error text announces to screen readers anytime it is visible and changes.\n * Use the method to re-announce the message when the text has not changed,\n * but announcement is still needed (such as for `reportValidity()`).\n */\n reannounceError() {\n this.refreshErrorAlert = true;\n }\n\n protected override update(props: PropertyValues<Field>) {\n // Client-side property updates\n const isDisabledChanging =\n props.has('disabled') && props.get('disabled') !== undefined;\n if (isDisabledChanging) {\n this.disableTransitions = true;\n }\n\n // When disabling, remove focus styles if focused.\n if (this.disabled && this.focused) {\n props.set('focused', true);\n this.focused = false;\n }\n\n // Animate if focused or populated change.\n this.animateLabelIfNeeded({\n wasFocused: props.get('focused'),\n wasPopulated: props.get('populated'),\n });\n\n super.update(props);\n }\n\n protected override render() {\n const floatingLabel = this.renderLabel(/*isFloating*/ true);\n const restingLabel = this.renderLabel(/*isFloating*/ false);\n const outline = this.renderOutline?.(floatingLabel);\n const classes = {\n 'disabled': this.disabled,\n 'disable-transitions': this.disableTransitions,\n 'error': this.error && !this.disabled,\n 'focused': this.focused,\n 'with-start': this.hasStart,\n 'with-end': this.hasEnd,\n 'populated': this.populated,\n 'resizable': this.resizable,\n 'required': this.required,\n 'no-label': !this.label,\n };\n\n return html`\n <div class=\"field ${classMap(classes)}\">\n <div class=\"container-overflow\">\n ${this.renderBackground?.()}\n <slot name=\"container\"></slot>\n ${this.renderStateLayer?.()} ${this.renderIndicator?.()} ${outline}\n <div class=\"container\">\n <div class=\"start\">\n <slot name=\"start\"></slot>\n </div>\n <div class=\"middle\">\n <div class=\"label-wrapper\">\n ${restingLabel} ${outline ? nothing : floatingLabel}\n </div>\n <div class=\"content\">\n <slot></slot>\n </div>\n </div>\n <div class=\"end\">\n <slot name=\"end\"></slot>\n </div>\n </div>\n </div>\n ${this.renderSupportingText()}\n </div>\n `;\n }\n\n protected override updated(changed: PropertyValues<Field>) {\n if (\n changed.has('supportingText') ||\n changed.has('errorText') ||\n changed.has('count') ||\n changed.has('max')\n ) {\n this.updateSlottedAriaDescribedBy();\n }\n\n if (this.refreshErrorAlert) {\n // The past render cycle removed the role=\"alert\" from the error message.\n // Re-add it after an animation frame to re-announce the error.\n requestAnimationFrame(() => {\n this.refreshErrorAlert = false;\n });\n }\n\n if (this.disableTransitions) {\n requestAnimationFrame(() => {\n this.disableTransitions = false;\n });\n }\n }\n\n protected renderBackground?(): TemplateResult;\n protected renderStateLayer?(): TemplateResult;\n protected renderIndicator?(): TemplateResult;\n protected renderOutline?(floatingLabel: unknown): TemplateResult;\n\n private renderSupportingText() {\n const {supportingOrErrorText, counterText} = this;\n if (!supportingOrErrorText && !counterText) {\n return nothing;\n }\n\n // Always render the supporting text span so that our `space-around`\n // container puts the counter at the end.\n const start = html`<span>${supportingOrErrorText}</span>`;\n // Conditionally render counter so we don't render the extra `gap`.\n // TODO(b/244473435): add aria-label and announcements\n const end = counterText\n ? html`<span class=\"counter\">${counterText}</span>`\n : nothing;\n\n // Announce if there is an error and error text visible.\n // If refreshErrorAlert is true, do not announce. This will remove the\n // role=\"alert\" attribute. Another render cycle will happen after an\n // animation frame to re-add the role.\n const shouldErrorAnnounce =\n this.error && this.errorText && !this.refreshErrorAlert;\n const role = shouldErrorAnnounce ? 'alert' : nothing;\n return html`\n <div class=\"supporting-text\" role=${role}>${start}${end}</div>\n <slot\n name=\"aria-describedby\"\n @slotchange=${this.updateSlottedAriaDescribedBy}></slot>\n `;\n }\n\n private updateSlottedAriaDescribedBy() {\n for (const element of this.slottedAriaDescribedBy) {\n render(html`${this.supportingOrErrorText} ${this.counterText}`, element);\n element.setAttribute('hidden', '');\n }\n }\n\n private renderLabel(isFloating: boolean) {\n if (!this.label) {\n return nothing;\n }\n\n let visible: boolean;\n if (isFloating) {\n // Floating label is visible when focused/populated or when animating.\n visible = this.focused || this.populated || this.isAnimating;\n } else {\n // Resting label is visible when unfocused. It is never visible while\n // animating.\n visible = !this.focused && !this.populated && !this.isAnimating;\n }\n\n const classes = {\n 'hidden': !visible,\n 'floating': isFloating,\n 'resting': !isFloating,\n };\n\n // Add '*' if a label is present and the field is required\n const labelText = `${this.label}${\n this.required && !this.noAsterisk ? '*' : ''\n }`;\n\n return html`\n <span class=\"label ${classMap(classes)}\" aria-hidden=${!visible}\n >${labelText}</span\n >\n `;\n }\n\n private animateLabelIfNeeded({\n wasFocused,\n wasPopulated,\n }: {\n wasFocused?: boolean;\n wasPopulated?: boolean;\n }) {\n if (!this.label) {\n return;\n }\n\n wasFocused ??= this.focused;\n wasPopulated ??= this.populated;\n const wasFloating = wasFocused || wasPopulated;\n const shouldBeFloating = this.focused || this.populated;\n if (wasFloating === shouldBeFloating) {\n return;\n }\n\n this.isAnimating = true;\n this.labelAnimation?.cancel();\n\n // Only one label is visible at a time for clearer text rendering.\n // The floating label is visible and used during animation. At the end of\n // the animation, it will either remain visible (if floating) or hide and\n // the resting label will be shown.\n //\n // We don't use forward filling because if the dimensions of the text field\n // change (leading icon removed, density changes, etc), then the animation\n // will be inaccurate.\n //\n // Re-calculating the animation each time will prevent any visual glitches\n // from appearing.\n // TODO(b/241113345): use animation tokens\n this.labelAnimation = this.floatingLabelEl?.animate(\n this.getLabelKeyframes(),\n {duration: 150, easing: EASING.STANDARD},\n );\n\n this.labelAnimation?.addEventListener('finish', () => {\n // At the end of the animation, update the visible label.\n this.isAnimating = false;\n });\n }\n\n private getLabelKeyframes() {\n const {floatingLabelEl, restingLabelEl} = this;\n if (!floatingLabelEl || !restingLabelEl) {\n return [];\n }\n\n const {\n x: floatingX,\n y: floatingY,\n height: floatingHeight,\n } = floatingLabelEl.getBoundingClientRect();\n const {\n x: restingX,\n y: restingY,\n height: restingHeight,\n } = restingLabelEl.getBoundingClientRect();\n const floatingScrollWidth = floatingLabelEl.scrollWidth;\n const restingScrollWidth = restingLabelEl.scrollWidth;\n // Scale by width ratio instead of font size since letter-spacing will scale\n // incorrectly. Using the width we can better approximate the adjusted\n // scale and compensate for tracking and overflow.\n // (use scrollWidth instead of width to account for clipped labels)\n const scale = restingScrollWidth / floatingScrollWidth;\n const xDelta = restingX - floatingX;\n // The line-height of the resting and floating label are different. When\n // we move the floating label down to the resting label's position, it won't\n // exactly match because of this. We need to adjust by half of what the\n // final scaled floating label's height will be.\n const yDelta =\n restingY -\n floatingY +\n Math.round((restingHeight - floatingHeight * scale) / 2);\n\n // Create the two transforms: floating to resting (using the calculations\n // above), and resting to floating (re-setting the transform to initial\n // values).\n const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`;\n const floatTransform = `translateX(0) translateY(0) scale(1)`;\n\n // Constrain the floating labels width to a scaled percentage of the\n // resting label's width. This will prevent long clipped labels from\n // overflowing the container.\n const restingClientWidth = restingLabelEl.clientWidth;\n const isRestingClipped = restingScrollWidth > restingClientWidth;\n const width = isRestingClipped ? `${restingClientWidth / scale}px` : '';\n if (this.focused || this.populated) {\n return [\n {transform: restTransform, width},\n {transform: floatTransform, width},\n ];\n }\n\n return [\n {transform: floatTransform, width},\n {transform: restTransform, width},\n ];\n }\n\n getSurfacePositionClientRect() {\n return this.containerEl!.getBoundingClientRect();\n }\n}\n"]}
@@ -13,10 +13,11 @@ import { styles as sharedStyles } from './internal/shared-styles.js';
13
13
  * @final
14
14
  * @suppress {visibility}
15
15
  */
16
- export let MdOutlinedField = class MdOutlinedField extends OutlinedField {
16
+ let MdOutlinedField = class MdOutlinedField extends OutlinedField {
17
17
  };
18
18
  MdOutlinedField.styles = [sharedStyles, outlinedStyles];
19
19
  MdOutlinedField = __decorate([
20
20
  customElement('md-outlined-field')
21
21
  ], MdOutlinedField);
22
+ export { MdOutlinedField };
22
23
  //# sourceMappingURL=outlined-field.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-field.js","sourceRoot":"","sources":["outlined-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAQnE;;;;GAIG;AAEI,WAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,aAAa;;AAChC,sBAAM,GAAwB,CAAC,YAAY,EAAE,cAAc,CAAC,AAAtD,CAAuD;AADlE,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAE3B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedField} from './internal/outlined-field.js';\nimport {styles as outlinedStyles} from './internal/outlined-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-field': MdOutlinedField;\n }\n}\n\n/**\n * TODO(b/228525797): add docs\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-field')\nexport class MdOutlinedField extends OutlinedField {\n static override styles: CSSResultOrNative[] = [sharedStyles, outlinedStyles];\n}\n"]}
1
+ {"version":3,"file":"outlined-field.js","sourceRoot":"","sources":["outlined-field.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAGH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,6BAA6B,CAAC;AAQnE;;;;GAIG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,aAAa;;AAChC,sBAAM,GAAwB,CAAC,YAAY,EAAE,cAAc,CAAC,AAAtD,CAAuD;AADlE,eAAe;IAD3B,aAAa,CAAC,mBAAmB,CAAC;GACtB,eAAe,CAE3B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {CSSResultOrNative} from 'lit';\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedField} from './internal/outlined-field.js';\nimport {styles as outlinedStyles} from './internal/outlined-styles.js';\nimport {styles as sharedStyles} from './internal/shared-styles.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-field': MdOutlinedField;\n }\n}\n\n/**\n * TODO(b/228525797): add docs\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-field')\nexport class MdOutlinedField extends OutlinedField {\n static override styles: CSSResultOrNative[] = [sharedStyles, outlinedStyles];\n}\n"]}