@material/web 1.0.0-pre.14 → 1.0.0-pre.15

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 (258) hide show
  1. package/README.md +5 -5
  2. package/all.d.ts +4 -8
  3. package/all.js +4 -8
  4. package/all.js.map +1 -1
  5. package/button/{_tonal-button.scss → _filled-tonal-button.scss} +1 -1
  6. package/button/{tonal-button.d.ts → filled-tonal-button.d.ts} +3 -3
  7. package/button/{tonal-button.js → filled-tonal-button.js} +9 -9
  8. package/button/filled-tonal-button.js.map +1 -0
  9. package/button/internal/{_tonal-button.scss → _filled-tonal-button.scss} +7 -7
  10. package/button/internal/_shared.scss +12 -7
  11. package/button/internal/_touch-target.scss +5 -1
  12. package/button/internal/button.d.ts +6 -10
  13. package/button/internal/button.js +10 -43
  14. package/button/internal/button.js.map +1 -1
  15. package/button/internal/elevated-styles.css.js +1 -1
  16. package/button/internal/elevated-styles.css.js.map +1 -1
  17. package/button/internal/filled-styles.css.js +1 -1
  18. package/button/internal/filled-styles.css.js.map +1 -1
  19. package/button/internal/{tonal-button.d.ts → filled-tonal-button.d.ts} +2 -2
  20. package/button/internal/{tonal-button.js → filled-tonal-button.js} +3 -3
  21. package/button/internal/filled-tonal-button.js.map +1 -0
  22. package/button/internal/filled-tonal-styles.css.js +9 -0
  23. package/button/internal/filled-tonal-styles.css.js.map +1 -0
  24. package/button/internal/{tonal-styles.scss → filled-tonal-styles.scss} +2 -2
  25. package/button/internal/outlined-styles.css.js +1 -1
  26. package/button/internal/outlined-styles.css.js.map +1 -1
  27. package/button/internal/shared-styles.css.js +1 -1
  28. package/button/internal/shared-styles.css.js.map +1 -1
  29. package/button/internal/text-styles.css.js +1 -1
  30. package/button/internal/text-styles.css.js.map +1 -1
  31. package/checkbox/internal/_checkbox.scss +22 -78
  32. package/checkbox/internal/checkbox-styles.css.js +1 -1
  33. package/checkbox/internal/checkbox-styles.css.js.map +1 -1
  34. package/checkbox/internal/checkbox.d.ts +77 -6
  35. package/checkbox/internal/checkbox.js +123 -14
  36. package/checkbox/internal/checkbox.js.map +1 -1
  37. package/chips/internal/_shared.scss +8 -0
  38. package/chips/internal/chip-set.js +1 -3
  39. package/chips/internal/chip-set.js.map +1 -1
  40. package/chips/internal/chip.js +1 -3
  41. package/chips/internal/chip.js.map +1 -1
  42. package/chips/internal/filter-chip.d.ts +1 -0
  43. package/chips/internal/filter-chip.js +12 -6
  44. package/chips/internal/filter-chip.js.map +1 -1
  45. package/chips/internal/shared-styles.css.js +1 -1
  46. package/chips/internal/shared-styles.css.js.map +1 -1
  47. package/common.d.ts +2 -6
  48. package/common.js +2 -6
  49. package/common.js.map +1 -1
  50. package/dialog/harness.d.ts +1 -6
  51. package/dialog/harness.js +2 -43
  52. package/dialog/harness.js.map +1 -1
  53. package/dialog/internal/_dialog.scss +165 -281
  54. package/dialog/internal/animations.d.ts +47 -0
  55. package/dialog/internal/animations.js +117 -0
  56. package/dialog/internal/animations.js.map +1 -0
  57. package/dialog/internal/dialog-styles.css.js +1 -1
  58. package/dialog/internal/dialog-styles.css.js.map +1 -1
  59. package/dialog/internal/dialog.d.ts +76 -169
  60. package/dialog/internal/dialog.js +251 -475
  61. package/dialog/internal/dialog.js.map +1 -1
  62. package/fab/internal/_fab.scss +4 -0
  63. package/fab/internal/_shared.scss +12 -0
  64. package/fab/internal/fab-styles.css.js +1 -1
  65. package/fab/internal/fab-styles.css.js.map +1 -1
  66. package/fab/internal/shared-styles.css.js +1 -1
  67. package/fab/internal/shared-styles.css.js.map +1 -1
  68. package/fab/internal/shared.d.ts +0 -4
  69. package/fab/internal/shared.js +3 -13
  70. package/fab/internal/shared.js.map +1 -1
  71. package/focus/internal/_focus-ring.scss +52 -48
  72. package/focus/internal/focus-ring-styles.css.js +1 -1
  73. package/focus/internal/focus-ring-styles.css.js.map +1 -1
  74. package/focus/internal/focus-ring.d.ts +2 -1
  75. package/focus/internal/focus-ring.js +10 -0
  76. package/focus/internal/focus-ring.js.map +1 -1
  77. package/icon/internal/_icon.scss +18 -17
  78. package/icon/internal/icon-styles.css.js +1 -1
  79. package/icon/internal/icon-styles.css.js.map +1 -1
  80. package/icon/internal/icon.d.ts +1 -0
  81. package/icon/internal/icon.js +9 -0
  82. package/icon/internal/icon.js.map +1 -1
  83. package/iconbutton/{_standard-icon-button.scss → _icon-button.scss} +1 -1
  84. package/iconbutton/{standard-icon-button.d.ts → icon-button.d.ts} +2 -2
  85. package/iconbutton/{standard-icon-button.js → icon-button.js} +7 -7
  86. package/iconbutton/icon-button.js.map +1 -0
  87. package/iconbutton/internal/_filled-icon-button.scss +8 -6
  88. package/iconbutton/internal/_filled-tonal-icon-button.scss +8 -6
  89. package/iconbutton/internal/{_standard-icon-button.scss → _icon-button.scss} +8 -8
  90. package/iconbutton/internal/_outlined-icon-button.scss +14 -14
  91. package/iconbutton/internal/_shared.scss +6 -9
  92. package/iconbutton/internal/filled-styles.css.js +1 -1
  93. package/iconbutton/internal/filled-styles.css.js.map +1 -1
  94. package/iconbutton/internal/filled-tonal-styles.css.js +1 -1
  95. package/iconbutton/internal/filled-tonal-styles.css.js.map +1 -1
  96. package/iconbutton/internal/icon-button.d.ts +10 -1
  97. package/iconbutton/internal/icon-button.js +17 -2
  98. package/iconbutton/internal/icon-button.js.map +1 -1
  99. package/iconbutton/internal/outlined-styles.css.js +1 -1
  100. package/iconbutton/internal/outlined-styles.css.js.map +1 -1
  101. package/iconbutton/internal/shared-styles.css.js +1 -1
  102. package/iconbutton/internal/shared-styles.css.js.map +1 -1
  103. package/iconbutton/internal/standard-styles.css.js +1 -1
  104. package/iconbutton/internal/standard-styles.css.js.map +1 -1
  105. package/iconbutton/internal/standard-styles.scss +2 -2
  106. package/internal/aria/delegate.d.ts +1 -1
  107. package/internal/aria/delegate.js +1 -1
  108. package/internal/aria/delegate.js.map +1 -1
  109. package/internal/controller/element-internals.d.ts +35 -0
  110. package/internal/controller/element-internals.js +24 -0
  111. package/internal/controller/element-internals.js.map +1 -0
  112. package/internal/controller/form-submitter.d.ts +60 -0
  113. package/internal/controller/form-submitter.js +69 -0
  114. package/internal/controller/form-submitter.js.map +1 -0
  115. package/labs/navigationbar/internal/navigation-bar.js +1 -3
  116. package/labs/navigationbar/internal/navigation-bar.js.map +1 -1
  117. package/labs/navigationdrawer/internal/navigation-drawer-modal.js +1 -3
  118. package/labs/navigationdrawer/internal/navigation-drawer-modal.js.map +1 -1
  119. package/labs/navigationdrawer/internal/navigation-drawer.js +1 -3
  120. package/labs/navigationdrawer/internal/navigation-drawer.js.map +1 -1
  121. package/labs/navigationtab/internal/navigation-tab.js +1 -3
  122. package/labs/navigationtab/internal/navigation-tab.js.map +1 -1
  123. package/labs/segmentedbutton/internal/outlined-styles.css.js +1 -1
  124. package/labs/segmentedbutton/internal/outlined-styles.css.js.map +1 -1
  125. package/labs/segmentedbutton/internal/segmented-button.js +1 -3
  126. package/labs/segmentedbutton/internal/segmented-button.js.map +1 -1
  127. package/labs/segmentedbuttonset/internal/outlined-styles.css.js +1 -1
  128. package/labs/segmentedbuttonset/internal/outlined-styles.css.js.map +1 -1
  129. package/labs/segmentedbuttonset/internal/segmented-button-set.js +1 -3
  130. package/labs/segmentedbuttonset/internal/segmented-button-set.js.map +1 -1
  131. package/list/internal/list.d.ts +2 -2
  132. package/list/internal/list.js +1 -3
  133. package/list/internal/list.js.map +1 -1
  134. package/list/internal/listitem/_list-item.scss +20 -54
  135. package/list/internal/listitem/list-item-styles.css.js +1 -1
  136. package/list/internal/listitem/list-item-styles.css.js.map +1 -1
  137. package/list/internal/listitem/list-item.d.ts +15 -3
  138. package/list/internal/listitem/list-item.js +43 -10
  139. package/list/internal/listitem/list-item.js.map +1 -1
  140. package/menu/internal/menu.js +3 -4
  141. package/menu/internal/menu.js.map +1 -1
  142. package/menu/internal/menuitem/_menu-item.scss +1 -1
  143. package/menu/internal/menuitem/forced-colors-styles.css.js +1 -1
  144. package/menu/internal/menuitem/forced-colors-styles.css.js.map +1 -1
  145. package/menu/internal/menuitem/forced-colors-styles.scss +1 -1
  146. package/menu/internal/menuitem/menu-item-styles.css.js +1 -1
  147. package/menu/internal/menuitem/menu-item-styles.css.js.map +1 -1
  148. package/menu/internal/menuitem/menu-item.d.ts +9 -0
  149. package/menu/internal/menuitem/menu-item.js +18 -4
  150. package/menu/internal/menuitem/menu-item.js.map +1 -1
  151. package/menu/internal/shared.d.ts +45 -38
  152. package/menu/internal/shared.js +29 -40
  153. package/menu/internal/shared.js.map +1 -1
  154. package/menu/internal/submenuitem/sub-menu-item.d.ts +22 -12
  155. package/menu/internal/submenuitem/sub-menu-item.js +39 -24
  156. package/menu/internal/submenuitem/sub-menu-item.js.map +1 -1
  157. package/menu/menu-item.d.ts +1 -1
  158. package/menu/menu-item.js +0 -1
  159. package/menu/menu-item.js.map +1 -1
  160. package/menu/menu.d.ts +1 -1
  161. package/menu/menu.js +0 -1
  162. package/menu/menu.js.map +1 -1
  163. package/menu/sub-menu-item.d.ts +1 -1
  164. package/menu/sub-menu-item.js +0 -1
  165. package/menu/sub-menu-item.js.map +1 -1
  166. package/package.json +1 -3
  167. package/progress/internal/progress.js +1 -3
  168. package/progress/internal/progress.js.map +1 -1
  169. package/radio/internal/_radio.scss +38 -24
  170. package/radio/internal/forced-colors-styles.css.js +1 -1
  171. package/radio/internal/forced-colors-styles.css.js.map +1 -1
  172. package/radio/internal/forced-colors-styles.scss +4 -4
  173. package/radio/internal/radio-styles.css.js +1 -1
  174. package/radio/internal/radio-styles.css.js.map +1 -1
  175. package/radio/internal/radio.js +7 -6
  176. package/radio/internal/radio.js.map +1 -1
  177. package/select/internal/_filled-select.scss +2 -2
  178. package/select/internal/_outlined-select.scss +2 -2
  179. package/select/internal/_shared.scss +30 -0
  180. package/select/internal/filled-select-styles.css.js +1 -1
  181. package/select/internal/filled-select-styles.css.js.map +1 -1
  182. package/select/internal/outlined-select-styles.css.js +1 -1
  183. package/select/internal/outlined-select-styles.css.js.map +1 -1
  184. package/select/internal/select.d.ts +0 -5
  185. package/select/internal/select.js +11 -16
  186. package/select/internal/select.js.map +1 -1
  187. package/select/internal/selectoption/select-option.d.ts +5 -6
  188. package/select/internal/selectoption/select-option.js +8 -9
  189. package/select/internal/selectoption/select-option.js.map +1 -1
  190. package/select/internal/shared-styles.css.js +1 -1
  191. package/select/internal/shared-styles.css.js.map +1 -1
  192. package/select/internal/shared.d.ts +5 -9
  193. package/select/internal/shared.js +13 -11
  194. package/select/internal/shared.js.map +1 -1
  195. package/slider/internal/slider.js +1 -3
  196. package/slider/internal/slider.js.map +1 -1
  197. package/switch/internal/_handle.scss +12 -12
  198. package/switch/internal/_icon.scss +8 -8
  199. package/switch/internal/_track.scss +10 -10
  200. package/switch/internal/forced-colors-styles.css.js +1 -1
  201. package/switch/internal/forced-colors-styles.css.js.map +1 -1
  202. package/switch/internal/forced-colors-styles.scss +12 -12
  203. package/switch/internal/switch-styles.css.js +1 -1
  204. package/switch/internal/switch-styles.css.js.map +1 -1
  205. package/switch/internal/switch.js +1 -3
  206. package/switch/internal/switch.js.map +1 -1
  207. package/tabs/internal/_tab.scss +1 -1
  208. package/tabs/internal/_tabs.scss +1 -0
  209. package/tabs/internal/tab.d.ts +3 -9
  210. package/tabs/internal/tab.js +4 -7
  211. package/tabs/internal/tab.js.map +1 -1
  212. package/tabs/internal/tabs.d.ts +1 -4
  213. package/tabs/internal/tabs.js +5 -10
  214. package/tabs/internal/tabs.js.map +1 -1
  215. package/textfield/harness.js +4 -0
  216. package/textfield/harness.js.map +1 -1
  217. package/textfield/internal/text-field.js +1 -4
  218. package/textfield/internal/text-field.js.map +1 -1
  219. package/tokens/_index.scss +1 -0
  220. package/tokens/_md-comp-checkbox.scss +16 -16
  221. package/tokens/_md-comp-dialog.scss +2 -1
  222. package/tokens/_md-comp-elevated-button.scss +14 -12
  223. package/tokens/_md-comp-filled-button.scss +14 -12
  224. package/tokens/_md-comp-filled-icon-button.scss +23 -8
  225. package/tokens/_md-comp-filled-select.scss +19 -1
  226. package/tokens/_md-comp-filled-tonal-button.scss +14 -12
  227. package/tokens/_md-comp-filled-tonal-icon-button.scss +23 -8
  228. package/tokens/_md-comp-icon-button.scss +24 -11
  229. package/tokens/_md-comp-icon.scss +32 -0
  230. package/tokens/_md-comp-outlined-button.scss +14 -12
  231. package/tokens/_md-comp-outlined-icon-button.scss +26 -12
  232. package/tokens/_md-comp-outlined-segmented-button.scss +2 -2
  233. package/tokens/_md-comp-radio-button.scss +20 -9
  234. package/tokens/_md-comp-switch.scss +66 -32
  235. package/tokens/_md-comp-text-button.scss +14 -12
  236. package/button/internal/tonal-button.js.map +0 -1
  237. package/button/internal/tonal-styles.css.js +0 -9
  238. package/button/internal/tonal-styles.css.js.map +0 -1
  239. package/button/tonal-button.js.map +0 -1
  240. package/dialog/internal/_tokens.scss +0 -66
  241. package/icon/internal/_md-comp-icon.scss +0 -18
  242. package/iconbutton/standard-icon-button.js.map +0 -1
  243. package/list/internal/listitemlink/list-item-link-only.d.ts +0 -23
  244. package/list/internal/listitemlink/list-item-link-only.js +0 -36
  245. package/list/internal/listitemlink/list-item-link-only.js.map +0 -1
  246. package/list/internal/listitemlink/list-item-link.d.ts +0 -18
  247. package/list/internal/listitemlink/list-item-link.js +0 -42
  248. package/list/internal/listitemlink/list-item-link.js.map +0 -1
  249. package/list/list-item-link.d.ts +0 -53
  250. package/list/list-item-link.js +0 -57
  251. package/list/list-item-link.js.map +0 -1
  252. package/menu/internal/menuitemlink/menu-item-link.d.ts +0 -23
  253. package/menu/internal/menuitemlink/menu-item-link.js +0 -49
  254. package/menu/internal/menuitemlink/menu-item-link.js.map +0 -1
  255. package/menu/menu-item-link.d.ts +0 -33
  256. package/menu/menu-item-link.js +0 -38
  257. package/menu/menu-item-link.js.map +0 -1
  258. /package/button/internal/{tonal-styles.css.d.ts → filled-tonal-styles.css.d.ts} +0 -0
@@ -4,559 +4,335 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { __decorate } from "tslib";
7
- import '../../elevation/elevation.js';
8
- import { html, LitElement } from 'lit';
7
+ import '../../divider/divider.js';
8
+ import { html, isServer, LitElement, nothing } from 'lit';
9
9
  import { property, query, state } from 'lit/decorators.js';
10
10
  import { classMap } from 'lit/directives/class-map.js';
11
+ import { requestUpdateOnAriaChange } from '../../internal/aria/delegate.js';
11
12
  import { redispatchEvent } from '../../internal/controller/events.js';
12
- import { createThrottle, msFromTimeCSSValue } from '../../internal/motion/animation.js';
13
- // This is required for decorators.
14
- // tslint:disable:no-new-decorators
15
- /**
16
- * Default close action.
17
- */
18
- export const CLOSE_ACTION = 'close';
19
- const OPENING_TRANSITION_PROP = '--_opening-transition-duration';
20
- const CLOSING_TRANSITION_PROP = '--_closing-transition-duration';
13
+ import { DIALOG_DEFAULT_CLOSE_ANIMATION, DIALOG_DEFAULT_OPEN_ANIMATION } from './animations.js';
21
14
  /**
22
15
  * A dialog component.
23
16
  *
24
- * @fires opening Dispatched when the dialog is opening before any animations.
17
+ * @fires open Dispatched when the dialog is opening before any animations.
25
18
  * @fires opened Dispatched when the dialog has opened after any animations.
26
- * @fires closing Dispatched when the dialog is closing before any animations.
19
+ * @fires close Dispatched when the dialog is closing before any animations.
27
20
  * @fires closed Dispatched when the dialog has closed after any animations.
28
- * @fires cancel The native HTMLDialogElement cancel event.
21
+ * @fires cancel Dispatched when the dialog has been canceled by clicking on the
22
+ * scrim or pressing Escape.
29
23
  */
30
24
  export class Dialog extends LitElement {
25
+ /**
26
+ * Opens the dialog when set to `true` and closes it when set to `false`.
27
+ */
28
+ get open() {
29
+ return this.isOpen;
30
+ }
31
+ set open(open) {
32
+ if (open === this.isOpen) {
33
+ return;
34
+ }
35
+ this.isOpen = open;
36
+ if (open) {
37
+ this.setAttribute('open', '');
38
+ this.show();
39
+ }
40
+ else {
41
+ this.removeAttribute('open');
42
+ this.close();
43
+ }
44
+ }
31
45
  constructor() {
32
- super(...arguments);
33
- /**
34
- * Opens the dialog when set to `true` and closes it when set to `false`.
35
- */
36
- this.open = false;
37
- /**
38
- * Setting fullscreen displays the dialog fullscreen on small screens.
39
- * This can be customized via the `fullscreenBreakpoint` property.
40
- * When showing fullscreen, the header will take up less vertical space, and
41
- * the dialog will have a `showing-fullscreen`attribute, allowing content to
42
- * be styled in this state.
43
- *
44
- * Dialogs can be sized by setting:
45
- *
46
- * * --md-dialog-container-min-block-size
47
- * * --md-dialog-container-max-block-size
48
- * * --md-dialog-container-min-inline-size
49
- * * --md-dialog-container-max-inline-size
50
- *
51
- * These are typically configured via media queries and are independent of the
52
- * fullscreen setting.
53
- */
54
- this.fullscreen = false;
55
- /**
56
- * A media query string specifying the breakpoint at which the dialog
57
- * should be shown fullscreen. Note, this only applies when the `fullscreen`
58
- * property is set.
59
- *
60
- * By default, the dialog is shown fullscreen on screens less than 600px wide
61
- * or 400px tall.
62
- */
63
- this.fullscreenBreakpoint = '(max-width: 600px), (max-height: 400px)';
64
- /**
65
- * Hides the dialog footer, making any content slotted into the footer
66
- * inaccessible.
67
- */
68
- this.footerHidden = false;
69
- /**
70
- * Renders footer content in a vertically stacked alignment rather than the
71
- * normal horizontal alignment.
72
- */
73
- this.stacked = false;
74
- /**
75
- * When the dialog is closed it disptaches `closing` and `closed` events.
76
- * These events have an action property which has a default value of
77
- * the value of this property. Specific actions have explicit values but when
78
- * a value is not specified, the default is used. For example, clicking the
79
- * scrim, pressing escape, or clicking a button with an action attribute set
80
- * produce an explicit action.
81
- *
82
- * Defaults to `close`.
83
- */
84
- this.defaultAction = CLOSE_ACTION;
46
+ super();
85
47
  /**
86
- * The name of an attribute which can be placed on any element slotted into
87
- * the dialog. If an element has an action attribute set, clicking it will
88
- * close the dialog and the `closing` and `closed` events dispatched will
89
- * have their action property set the value of this attribute on the
90
- * clicked element.The default value is `dialog-action`. For example,
48
+ * Gets or sets the dialog's return value, usually to indicate which button
49
+ * a user pressed to close it.
91
50
  *
92
- * <md-dialog>
93
- * Content
94
- * <md-filled-button slot="footer" dialog-action="buy">
95
- * Buy
96
- * </md-filled-button>
97
- * </md-dialog>
98
- */
99
- this.actionAttribute = 'dialog-action';
100
- /**
101
- * When the dialog is opened, it will focus the first element which has
102
- * an attribute name matching this property. The default value is
103
- * `dialogFocus`. For example:
104
- *
105
- * <md-dialog>
106
- * <md-filled-text-field
107
- * label="Enter some text"
108
- * dialog-focus
109
- * >
110
- * </md-filled-text-field>
111
- * </md-dialog>
112
- */
113
- this.focusAttribute = 'dialog-focus';
114
- /**
115
- * Clicking on the scrim surrounding the dialog closes the dialog.
116
- * The `closing` and `closed` events this produces have an `action` property
117
- * which is the value of this property and defaults to `close`.
51
+ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/returnValue
118
52
  */
119
- this.scrimClickAction = CLOSE_ACTION;
53
+ this.returnValue = '';
120
54
  /**
121
- * Pressing the `escape` key while the dialog is open closes the dialog.
122
- * The `closing` and `closed` events this produces have an `action` property
123
- * which is the value of this property and defaults to `close`.
55
+ * Gets the opening animation for a dialog. Set to a new function to customize
56
+ * the animation.
124
57
  */
125
- this.escapeKeyAction = CLOSE_ACTION;
58
+ this.getOpenAnimation = () => DIALOG_DEFAULT_OPEN_ANIMATION;
126
59
  /**
127
- * When opened, the dialog is displayed modeless or non-modal. This
128
- * allows users to interact with content outside the dialog without
129
- * closing the dialog and does not display the scrim around the dialog.
130
- */
131
- this.modeless = false;
132
- /**
133
- * Set to make the dialog position draggable.
134
- */
135
- this.draggable = false;
136
- this.throttle = createThrottle();
137
- /**
138
- * Private properties that reflect for styling manually in `updated`.
139
- */
140
- this.showingFullscreen = false;
141
- this.showingOpen = false;
142
- this.opening = false;
143
- this.closing = false;
144
- /**
145
- * Transition kind. Supported options include: grow, shrink, grow-down,
146
- * grow-up, grow-left, and grow-right.
147
- *
148
- * Defaults to grow-down.
60
+ * Gets the closing animation for a dialog. Set to a new function to customize
61
+ * the animation.
149
62
  */
150
- this.transition = 'grow-down';
151
- this.dragging = false;
152
- this.dragMargin = 8;
153
- this.fullscreenQueryListener = undefined;
154
- }
155
- static setDocumentScrollingDisabled(disabled = false) {
156
- let { preventedScrollingCount, scrollbarTester } = Dialog;
157
- Dialog.preventedScrollingCount = preventedScrollingCount =
158
- Math.max(preventedScrollingCount + (Number(disabled) || -1), 0);
159
- const shouldPrevent = Boolean(preventedScrollingCount);
160
- const { style } = document.body;
161
- if (shouldPrevent && style.overflow === 'hidden') {
162
- return;
63
+ this.getCloseAnimation = () => DIALOG_DEFAULT_CLOSE_ANIMATION;
64
+ this.isOpen = false;
65
+ this.isAtScrollTop = false;
66
+ this.isAtScrollBottom = false;
67
+ this.nextClickIsFromContent = false;
68
+ // Dialogs should not be SSR'd while open, so we can just use runtime checks.
69
+ this.hasHeadline = false;
70
+ this.hasActions = false;
71
+ this.hasIcon = false;
72
+ if (!isServer) {
73
+ this.addEventListener('submit', this.handleSubmit);
163
74
  }
164
- if (scrollbarTester === undefined) {
165
- Dialog.scrollbarTester = scrollbarTester = document.createElement('div');
166
- scrollbarTester.style.cssText =
167
- `position: absolute; height: 0; width: 100%; visibility: hidden; pointer-events: none;`;
168
- }
169
- // Appends an element to see if its offsetWidth changes when overflow is
170
- // altered. If it does, then add end inline padding to restore the width to
171
- // avoid a visible layout shift.
172
- document.body.append(scrollbarTester);
173
- const { offsetWidth } = scrollbarTester;
174
- style.overflow = shouldPrevent ? 'hidden' : '';
175
- const scrollbarWidth = scrollbarTester.offsetWidth - offsetWidth;
176
- scrollbarTester.remove();
177
- style.paddingInlineEnd = shouldPrevent ? `${scrollbarWidth}px` : '';
178
75
  }
179
76
  /**
180
- * Opens and shows the dialog. This is equivalent to setting the `open`
181
- * property to true.
77
+ * Opens the dialog and fires a cancelable `open` event. After a dialog's
78
+ * animation, an `opened` event is fired.
79
+ *
80
+ * Add an `autocomplete` attribute to a child of the dialog that should
81
+ * receive focus after opening.
82
+ *
83
+ * @return A Promise that resolves after the animation is finished and the
84
+ * `opened` event was fired.
182
85
  */
183
- show() {
86
+ async show() {
87
+ const { dialog, container } = this;
88
+ if (!dialog || !container || dialog.open) {
89
+ return;
90
+ }
91
+ const preventOpen = !this.dispatchEvent(new Event('open', { cancelable: true }));
92
+ if (preventOpen) {
93
+ this.open = false;
94
+ return;
95
+ }
96
+ // All Material dialogs are modal.
97
+ dialog.showModal();
184
98
  this.open = true;
99
+ // Reset scroll position if re-opening a dialog with the same content.
100
+ if (this.scroller) {
101
+ this.scroller.scrollTop = 0;
102
+ }
103
+ // Native modal dialogs ignore autofocus and instead force focus to the
104
+ // first focusable child. Override this behavior if there is a child with
105
+ // an autofocus attribute.
106
+ this.querySelector('[autofocus]')?.focus();
107
+ await this.animateDialog(this.getOpenAnimation());
108
+ this.dispatchEvent(new Event('opened'));
185
109
  }
186
110
  /**
187
- * Closes the dialog. This is equivalent to setting the `open`
188
- * property to false.
189
- */
190
- close(action = '') {
191
- this.currentAction = action;
192
- this.open = false;
193
- }
194
- /**
195
- * Opens and shows the dialog if it is closed; otherwise closes it.
111
+ * Closes the dialog and fires a cancelable `close` event. After a dialog's
112
+ * animation, a `closed` event is fired.
113
+ *
114
+ * @param returnValue A return value usually indicating which button was used
115
+ * to close a dialog. If a dialog is canceled by clicking the scrim or
116
+ * pressing Escape, it will not change the return value after closing.
117
+ * @return A Promise that resolves after the animation is finished and the
118
+ * `closed` event was fired.
196
119
  */
197
- toggleShow() {
198
- if (this.open) {
199
- this.close(this.currentAction);
200
- }
201
- else {
202
- this.show();
120
+ async close(returnValue = this.returnValue) {
121
+ const { dialog, container } = this;
122
+ if (!dialog || !container || !dialog.open) {
123
+ return;
203
124
  }
204
- }
205
- getContentScrollInfo() {
206
- if (!this.hasUpdated || !this.contentElement) {
207
- return { isScrollable: false, isAtScrollTop: true, isAtScrollBottom: true };
125
+ const prevReturnValue = this.returnValue;
126
+ this.returnValue = returnValue;
127
+ const preventClose = !this.dispatchEvent(new Event('close', { cancelable: true }));
128
+ if (preventClose) {
129
+ this.returnValue = prevReturnValue;
130
+ return;
208
131
  }
209
- const { scrollTop, scrollHeight, offsetHeight, clientHeight } = this.contentElement;
210
- return {
211
- isScrollable: scrollHeight > offsetHeight,
212
- isAtScrollTop: scrollTop === 0,
213
- isAtScrollBottom: Math.abs(Math.round(scrollHeight - scrollTop) - clientHeight) <= 2
214
- };
132
+ await this.animateDialog(this.getCloseAnimation());
133
+ dialog.close(returnValue);
134
+ this.open = false;
135
+ this.dispatchEvent(new Event('closed'));
215
136
  }
216
137
  render() {
217
- const { isScrollable, isAtScrollTop, isAtScrollBottom } = this.getContentScrollInfo();
138
+ const scrollable = this.open && !(this.isAtScrollTop && this.isAtScrollBottom);
139
+ const classes = {
140
+ 'has-headline': this.hasHeadline,
141
+ 'has-actions': this.hasActions,
142
+ 'has-icon': this.hasIcon,
143
+ 'scrollable': scrollable,
144
+ 'show-top-divider': scrollable && !this.isAtScrollTop,
145
+ 'show-bottom-divider': scrollable && !this.isAtScrollBottom,
146
+ };
147
+ const { ariaLabel } = this;
218
148
  return html `
219
- <dialog
220
- @close=${this.handleDialogDismiss}
221
- @cancel=${this.handleDialogDismiss}
222
- @click=${this.handleDialogClick}
223
- class="dialog ${classMap({
224
- 'stacked': this.stacked,
225
- 'scrollable': isScrollable,
226
- 'scroll-divider-header': !isAtScrollTop,
227
- 'scroll-divider-footer': !isAtScrollBottom,
228
- 'footerHidden': this.footerHidden
229
- })}"
230
- aria-labelledby="header"
231
- aria-describedby="content"
232
- >
233
- <div class="container ${classMap({
234
- 'dragging': this.dragging
235
- })}"
236
- @pointermove=${this.handlePointerMove}
237
- @pointerup=${this.handleDragEnd}
149
+ <div class="scrim"></div>
150
+ <dialog
151
+ class=${classMap(classes)}
152
+ aria-label=${ariaLabel || nothing}
153
+ aria-labelledby=${this.hasHeadline ? 'headline' : nothing}
154
+ role=${this.type === 'alert' ? 'alertdialog' : nothing}
155
+ @cancel=${this.handleCancel}
156
+ @click=${this.handleDialogClick}
157
+ .returnValue=${this.returnValue || nothing}
238
158
  >
239
- <md-elevation></md-elevation>
240
- <header class="header">
241
- <slot name="header">
242
- <slot name="headline-prefix"></slot>
243
- <slot name="headline"></slot>
244
- <slot name="headline-suffix"></slot>
245
- </slot>
246
- </header>
247
- <section class="content" @scroll=${this.handleContentScroll}>
248
- <slot></slot>
249
- </section>
250
- <footer class="footer">
251
- <slot name="footer"></slot>
252
- </footer>
253
- </div>
254
- </dialog>`;
255
- }
256
- willUpdate(changed) {
257
- if (changed.has('open')) {
258
- this.opening = this.open;
259
- // only closing if was opened previously...
260
- this.closing = !this.open && changed.get('open');
261
- }
262
- if (changed.has('fullscreen') || changed.has('fullscreenBreakpoint')) {
263
- this.updateFullscreen();
264
- }
159
+ <div class="container"
160
+ @click=${this.handleContentClick}
161
+ >
162
+ <div class="headline">
163
+ <div class="icon" aria-hidden="true">
164
+ <slot name="icon" @slotchange=${this.handleIconChange}></slot>
165
+ </div>
166
+ <h2 id="headline" aria-hidden=${!this.hasHeadline || nothing}>
167
+ <slot name="headline"
168
+ @slotchange=${this.handleHeadlineChange}></slot>
169
+ </h2>
170
+ <md-divider></md-divider>
171
+ </div>
172
+ <div class="scroller">
173
+ <div class="content">
174
+ <div class="top anchor"></div>
175
+ <slot name="content"></slot>
176
+ <div class="bottom anchor"></div>
177
+ </div>
178
+ </div>
179
+ <div class="actions">
180
+ <md-divider></md-divider>
181
+ <slot name="actions"
182
+ @slotchange=${this.handleActionsChange}></slot>
183
+ </div>
184
+ </div>
185
+ </dialog>
186
+ `;
265
187
  }
266
188
  firstUpdated() {
267
- // Update when content size changes to show/hide scroll dividers.
268
- new ResizeObserver(() => {
269
- if (this.showingOpen) {
270
- this.requestUpdate();
189
+ this.intersectionObserver = new IntersectionObserver(entries => {
190
+ for (const entry of entries) {
191
+ this.handleAnchorIntersection(entry);
271
192
  }
272
- }).observe(this.contentElement);
193
+ }, { root: this.scroller });
194
+ this.intersectionObserver.observe(this.topAnchor);
195
+ this.intersectionObserver.observe(this.bottomAnchor);
273
196
  }
274
- updated(changed) {
275
- if (changed.get('draggable') && !this.draggable) {
276
- this.style.removeProperty('--_container-drag-inline-start');
277
- this.style.removeProperty('--_container-drag-block-start');
278
- }
279
- // Reflect internal state to facilitate styling.
280
- this.reflectStateProp(changed, 'opening', this.opening);
281
- this.reflectStateProp(changed, 'closing', this.closing);
282
- this.reflectStateProp(changed, 'showingFullscreen', this.showingFullscreen, 'showing-fullscreen');
283
- this.reflectStateProp(changed, 'showingOpen', this.showingOpen, 'showing-open');
284
- if (!changed.has('open')) {
197
+ handleDialogClick() {
198
+ if (this.nextClickIsFromContent) {
199
+ // Avoid doing a layout calculation below if we know the click came from
200
+ // content.
201
+ this.nextClickIsFromContent = false;
285
202
  return;
286
203
  }
287
- // prevent body scrolling early only when opening to avoid layout
288
- // shift when closing.
289
- if (!this.modeless && this.open) {
290
- Dialog.setDocumentScrollingDisabled(this.open);
291
- }
292
- if (this.open) {
293
- this.contentElement.scrollTop = 0;
294
- if (this.modeless) {
295
- this.dialogElement.show();
296
- }
297
- else {
298
- // Note, native focus handling fails when focused element is in an
299
- // overflow: auto container.
300
- this.dialogElement.showModal();
301
- }
302
- }
303
- // Avoids dispatching initial state.
304
- const shouldDispatchAction = changed.get('open') !== undefined;
305
- this.performTransition(shouldDispatchAction);
306
- }
307
- /**
308
- * Internal state is reflected here as attributes to effect styling. This
309
- * could be done via internal classes, but it's published on the host
310
- * to facilitate the (currently undocumented) possibility of customizing
311
- * styling of user content based on these states.
312
- * Note, in the future this could be done with `:state(...)` when browser
313
- * support improves.
314
- */
315
- reflectStateProp(changed, key, value, attribute) {
316
- attribute ?? (attribute = key);
317
- if (!changed.has(key)) {
204
+ // Click originated on the backdrop. Native `<dialog>`s will not cancel,
205
+ // but Material dialogs do.
206
+ const preventDefault = !this.dispatchEvent(new Event('cancel', { cancelable: true }));
207
+ if (preventDefault) {
318
208
  return;
319
209
  }
320
- if (value) {
321
- this.setAttribute(attribute, '');
322
- }
323
- else {
324
- this.removeAttribute(attribute);
325
- }
326
- }
327
- async performTransition(shouldDispatchAction) {
328
- // TODO: pause here only to avoid a double update warning.
329
- await this.updateComplete;
330
- // Focus initial element.
331
- if (this.open) {
332
- this.focus();
333
- }
334
- this.showingOpen = this.open;
335
- if (shouldDispatchAction) {
336
- this.dispatchActionEvent(this.open ? 'opening' : 'closing');
337
- }
338
- // Compute desired transition duration.
339
- const duration = msFromTimeCSSValue(getComputedStyle(this).getPropertyValue(this.open ? OPENING_TRANSITION_PROP : CLOSING_TRANSITION_PROP));
340
- let promise = this.updateComplete;
341
- if (duration > 0) {
342
- promise = new Promise((r) => {
343
- setTimeout(r, duration);
344
- });
345
- }
346
- await promise;
347
- this.opening = false;
348
- this.closing = false;
349
- if (!this.open && this.dialogElement?.open) {
350
- // Closing the dialog triggers an asynchronous `close` event.
351
- // It's important to wait for this event to fire since it changes the
352
- // state of `open` to false.
353
- // Without waiting, this element's `closed` event can be called before
354
- // the dialog's `close` event, which is problematic since the user
355
- // can set `open` in the `closed` event.
356
- // The timing of the event appears to vary via browser and does *not*
357
- // seem to resolve by "task" timing; therefore an explicit promise is
358
- // used.
359
- const closedPromise = new Promise(resolve => {
360
- this.dialogClosedResolver = resolve;
361
- });
362
- this.dialogElement?.close(this.currentAction || this.defaultAction);
363
- await closedPromise;
364
- // enable scrolling late to avoid layout shift when closing
365
- if (!this.modeless) {
366
- Dialog.setDocumentScrollingDisabled(this.open);
367
- }
368
- }
369
- if (shouldDispatchAction) {
370
- this.dispatchActionEvent(this.open ? 'opened' : 'closed');
371
- }
372
- this.currentAction = undefined;
210
+ this.close();
373
211
  }
374
- dispatchActionEvent(type) {
375
- const detail = { action: this.open ? 'none' : this.currentAction };
376
- this.dispatchEvent(new CustomEvent(type, { detail, bubbles: true }));
212
+ handleContentClick() {
213
+ this.nextClickIsFromContent = true;
377
214
  }
378
- updateFullscreen() {
379
- if (this.fullscreenQuery !== undefined) {
380
- this.fullscreenQuery.removeEventListener('change', this.fullscreenQueryListener);
381
- this.fullscreenQuery = this.fullscreenQueryListener = undefined;
382
- }
383
- if (!this.fullscreen) {
384
- this.showingFullscreen = false;
215
+ handleSubmit(event) {
216
+ const form = event.target;
217
+ const { submitter } = event;
218
+ if (form.method !== 'dialog' || !submitter) {
385
219
  return;
386
220
  }
387
- this.fullscreenQuery = window.matchMedia(this.fullscreenBreakpoint);
388
- this.fullscreenQuery.addEventListener('change', (this.fullscreenQueryListener = (event) => {
389
- this.showingFullscreen = event.matches;
390
- }));
391
- this.showingFullscreen = this.fullscreenQuery.matches;
221
+ // Close reason is the submitter's value attribute, or the dialog's
222
+ // `returnValue` if there is no attribute.
223
+ this.close(submitter.getAttribute('value') ?? this.returnValue);
392
224
  }
393
- // handles native close/cancel events and we just ensure
394
- // internal state is in sync.
395
- handleDialogDismiss(event) {
396
- if (event.type === 'cancel') {
397
- this.currentAction = this.escapeKeyAction;
398
- // Prevents the <dialog> element from closing when
399
- // `escapeKeyAction` is set to an empty string.
400
- // It also early returns and avoids <md-dialog> internal state
401
- // changes.
402
- if (this.escapeKeyAction === '') {
403
- event.preventDefault();
404
- return;
405
- }
406
- }
407
- this.dialogClosedResolver?.();
408
- this.dialogClosedResolver = undefined;
409
- this.open = false;
410
- this.opening = false;
411
- this.closing = false;
412
- redispatchEvent(this, event);
413
- }
414
- handleDialogClick(event) {
415
- if (!this.open) {
225
+ handleCancel(event) {
226
+ if (event.target !== this.dialog) {
227
+ // Ignore any cancel events dispatched by content.
416
228
  return;
417
229
  }
418
- this.currentAction =
419
- event.target.getAttribute(this.actionAttribute) ??
420
- (!this.modeless && this.containerElement &&
421
- !event.composedPath().includes(this.containerElement) ?
422
- this.scrimClickAction :
423
- '');
424
- if (this.currentAction !== '') {
425
- this.close(this.currentAction);
230
+ const preventDefault = !redispatchEvent(this, event);
231
+ // We always prevent default on the original dialog event since we'll
232
+ // animate closing it before it actually closes.
233
+ event.preventDefault();
234
+ if (preventDefault) {
235
+ return;
426
236
  }
237
+ this.close();
427
238
  }
428
- /* This allows the dividers to dynamically show based on scrolling. */
429
- handleContentScroll() {
430
- this.throttle('scroll', () => {
431
- this.requestUpdate();
432
- });
433
- }
434
- getFocusElement() {
435
- const selector = `[${this.focusAttribute}]`;
436
- const slotted = [this.footerSlot, this.contentSlot].flatMap(slot => slot.assignedElements({ flatten: true }));
437
- for (const el of slotted) {
438
- const focusEl = el.matches(selector) ? el : el.querySelector(selector);
439
- if (focusEl) {
440
- return focusEl;
239
+ async animateDialog(animation) {
240
+ const { dialog, scrim, container, headline, content, actions } = this;
241
+ if (!dialog || !scrim || !container || !headline || !content || !actions) {
242
+ return;
243
+ }
244
+ const { container: containerAnimate, dialog: dialogAnimate, scrim: scrimAnimate, headline: headlineAnimate, content: contentAnimate, actions: actionsAnimate } = animation;
245
+ const elementAndAnimation = [
246
+ [dialog, dialogAnimate ?? []], [scrim, scrimAnimate ?? []],
247
+ [container, containerAnimate ?? []], [headline, headlineAnimate ?? []],
248
+ [content, contentAnimate ?? []], [actions, actionsAnimate ?? []]
249
+ ];
250
+ const animations = [];
251
+ for (const [element, animation] of elementAndAnimation) {
252
+ for (const animateArgs of animation) {
253
+ animations.push(element.animate(...animateArgs));
441
254
  }
442
255
  }
443
- return null;
256
+ await Promise.all(animations.map(animation => animation.finished));
444
257
  }
445
- focus() {
446
- this.getFocusElement()?.focus();
258
+ handleHeadlineChange(event) {
259
+ const slot = event.target;
260
+ this.hasHeadline = slot.assignedElements().length > 0;
447
261
  }
448
- blur() {
449
- this.getFocusElement()?.blur();
262
+ handleActionsChange(event) {
263
+ const slot = event.target;
264
+ this.hasActions = slot.assignedElements().length > 0;
450
265
  }
451
- canStartDrag(event) {
452
- if (this.draggable === false || event.defaultPrevented ||
453
- !(event.buttons & 1) || !this.headerElement ||
454
- !event.composedPath().includes(this.headerElement)) {
455
- return false;
456
- }
457
- return true;
266
+ handleIconChange(event) {
267
+ const slot = event.target;
268
+ this.hasIcon = slot.assignedElements().length > 0;
458
269
  }
459
- handlePointerMove(event) {
460
- if (!this.dragging && !this.canStartDrag(event) || !this.containerElement) {
461
- return;
270
+ handleAnchorIntersection(entry) {
271
+ const { target, isIntersecting } = entry;
272
+ if (target === this.topAnchor) {
273
+ this.isAtScrollTop = isIntersecting;
462
274
  }
463
- const { top, left, height, width } = this.containerElement.getBoundingClientRect();
464
- if (!this.dragging) {
465
- this.containerElement.setPointerCapture(event.pointerId);
466
- this.dragging = true;
467
- const { x, y } = event;
468
- this.dragInfo = [x, y, top, left];
469
- }
470
- const [sx, sy, st, sl] = this.dragInfo ?? [0, 0, 0, 0];
471
- const dx = event.x - sx;
472
- const dy = event.y - sy;
473
- const ml = window.innerWidth - width - this.dragMargin;
474
- const mt = window.innerHeight - height - this.dragMargin;
475
- const l = Math.max(this.dragMargin, Math.min(ml, dx + sl));
476
- const t = Math.max(this.dragMargin, Math.min(mt, dy + st));
477
- this.style.setProperty('--_container-drag-inline-start', `${l}px`);
478
- this.style.setProperty('--_container-drag-block-start', `${t}px`);
479
- }
480
- handleDragEnd(event) {
481
- if (!this.dragging) {
482
- return;
275
+ if (target === this.bottomAnchor) {
276
+ this.isAtScrollBottom = isIntersecting;
483
277
  }
484
- this.containerElement?.releasePointerCapture(event.pointerId);
485
- this.dragging = false;
486
- this.dragInfo = undefined;
487
278
  }
488
279
  }
489
- Dialog.preventedScrollingCount = 0;
280
+ (() => {
281
+ requestUpdateOnAriaChange(Dialog);
282
+ })();
283
+ Dialog.shadowRootOptions = {
284
+ ...LitElement.shadowRootOptions,
285
+ delegatesFocus: true
286
+ };
490
287
  __decorate([
491
288
  property({ type: Boolean })
492
- ], Dialog.prototype, "open", void 0);
289
+ ], Dialog.prototype, "open", null);
493
290
  __decorate([
494
- property({ type: Boolean })
495
- ], Dialog.prototype, "fullscreen", void 0);
496
- __decorate([
497
- property({ attribute: 'fullscreen-breakpoint' })
498
- ], Dialog.prototype, "fullscreenBreakpoint", void 0);
499
- __decorate([
500
- property({ type: Boolean, attribute: 'footer-hidden' })
501
- ], Dialog.prototype, "footerHidden", void 0);
502
- __decorate([
503
- property({ type: Boolean })
504
- ], Dialog.prototype, "stacked", void 0);
505
- __decorate([
506
- property({ attribute: 'default-action' })
507
- ], Dialog.prototype, "defaultAction", void 0);
508
- __decorate([
509
- property({ attribute: 'action-attribute' })
510
- ], Dialog.prototype, "actionAttribute", void 0);
291
+ property({ attribute: false })
292
+ ], Dialog.prototype, "returnValue", void 0);
511
293
  __decorate([
512
- property({ attribute: 'focus-attribute' })
513
- ], Dialog.prototype, "focusAttribute", void 0);
294
+ property()
295
+ ], Dialog.prototype, "type", void 0);
514
296
  __decorate([
515
- property({ attribute: 'scrim-click-action' })
516
- ], Dialog.prototype, "scrimClickAction", void 0);
297
+ query('dialog')
298
+ ], Dialog.prototype, "dialog", void 0);
517
299
  __decorate([
518
- property({ attribute: 'escape-key-action' })
519
- ], Dialog.prototype, "escapeKeyAction", void 0);
300
+ query('.scrim')
301
+ ], Dialog.prototype, "scrim", void 0);
520
302
  __decorate([
521
- property({ type: Boolean, reflect: true })
522
- ], Dialog.prototype, "modeless", void 0);
303
+ query('.container')
304
+ ], Dialog.prototype, "container", void 0);
523
305
  __decorate([
524
- property({ type: Boolean })
525
- ], Dialog.prototype, "draggable", void 0);
306
+ query('.headline')
307
+ ], Dialog.prototype, "headline", void 0);
526
308
  __decorate([
527
- query('.dialog', true)
528
- ], Dialog.prototype, "dialogElement", void 0);
309
+ query('.content')
310
+ ], Dialog.prototype, "content", void 0);
529
311
  __decorate([
530
- query('slot[name=footer]', true)
531
- ], Dialog.prototype, "footerSlot", void 0);
312
+ query('.actions')
313
+ ], Dialog.prototype, "actions", void 0);
532
314
  __decorate([
533
- query('slot:not([name])', true)
534
- ], Dialog.prototype, "contentSlot", void 0);
315
+ state()
316
+ ], Dialog.prototype, "isAtScrollTop", void 0);
535
317
  __decorate([
536
- query(`.content`, true)
537
- ], Dialog.prototype, "contentElement", void 0);
318
+ state()
319
+ ], Dialog.prototype, "isAtScrollBottom", void 0);
538
320
  __decorate([
539
- query(`.container`, true)
540
- ], Dialog.prototype, "containerElement", void 0);
321
+ query('.scroller')
322
+ ], Dialog.prototype, "scroller", void 0);
541
323
  __decorate([
542
- query(`.header`, true)
543
- ], Dialog.prototype, "headerElement", void 0);
324
+ query('.top.anchor')
325
+ ], Dialog.prototype, "topAnchor", void 0);
544
326
  __decorate([
545
- state()
546
- ], Dialog.prototype, "showingFullscreen", void 0);
327
+ query('.bottom.anchor')
328
+ ], Dialog.prototype, "bottomAnchor", void 0);
547
329
  __decorate([
548
330
  state()
549
- ], Dialog.prototype, "showingOpen", void 0);
331
+ ], Dialog.prototype, "hasHeadline", void 0);
550
332
  __decorate([
551
333
  state()
552
- ], Dialog.prototype, "opening", void 0);
553
- __decorate([
554
- state()
555
- ], Dialog.prototype, "closing", void 0);
556
- __decorate([
557
- property({ reflect: true })
558
- ], Dialog.prototype, "transition", void 0);
334
+ ], Dialog.prototype, "hasActions", void 0);
559
335
  __decorate([
560
336
  state()
561
- ], Dialog.prototype, "dragging", void 0);
337
+ ], Dialog.prototype, "hasIcon", void 0);
562
338
  //# sourceMappingURL=dialog.js.map