@material/web 1.0.0-pre.6 → 1.0.0-pre.7

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 (334) hide show
  1. package/README.md +7 -7
  2. package/aria/aria.d.ts +43 -0
  3. package/aria/aria.js +56 -0
  4. package/aria/aria.js.map +1 -0
  5. package/aria/delegate.d.ts +37 -0
  6. package/aria/delegate.js +53 -0
  7. package/aria/delegate.js.map +1 -0
  8. package/badge/badge.d.ts +0 -1
  9. package/badge/badge.js +0 -1
  10. package/badge/badge.js.map +1 -1
  11. package/badge/lib/badge.d.ts +8 -7
  12. package/badge/lib/badge.js +5 -6
  13. package/badge/lib/badge.js.map +1 -1
  14. package/button/lib/_elevation.scss +13 -3
  15. package/button/lib/button.d.ts +1 -12
  16. package/button/lib/button.js +29 -60
  17. package/button/lib/button.js.map +1 -1
  18. package/button/lib/shared-elevation-styles.css.js +1 -1
  19. package/button/lib/shared-elevation-styles.css.js.map +1 -1
  20. package/checkbox/lib/checkbox.d.ts +0 -1
  21. package/checkbox/lib/checkbox.js +33 -43
  22. package/checkbox/lib/checkbox.js.map +1 -1
  23. package/chips/_filter-chip.scss +6 -0
  24. package/chips/filter-chip.d.ts +20 -0
  25. package/chips/filter-chip.js +24 -0
  26. package/chips/filter-chip.js.map +1 -0
  27. package/chips/lib/_filter-chip.scss +141 -0
  28. package/chips/lib/_shared.scss +18 -14
  29. package/chips/lib/assist-styles.css.js +1 -1
  30. package/chips/lib/assist-styles.css.js.map +1 -1
  31. package/chips/lib/chip.d.ts +8 -3
  32. package/chips/lib/chip.js +29 -30
  33. package/chips/lib/chip.js.map +1 -1
  34. package/chips/lib/filter-chip.d.ts +21 -0
  35. package/chips/lib/filter-chip.js +47 -0
  36. package/chips/lib/filter-chip.js.map +1 -0
  37. package/chips/lib/filter-styles.css.js +9 -0
  38. package/chips/lib/filter-styles.css.js.map +1 -0
  39. package/{fab/lib/fab-extended-styles.scss → chips/lib/filter-styles.scss} +3 -3
  40. package/chips/lib/shared-styles.css.js +1 -1
  41. package/chips/lib/shared-styles.css.js.map +1 -1
  42. package/chips/lib/suggestion-styles.css.js +1 -1
  43. package/chips/lib/suggestion-styles.css.js.map +1 -1
  44. package/circularprogress/harness.d.ts +1 -0
  45. package/circularprogress/harness.js +4 -0
  46. package/circularprogress/harness.js.map +1 -1
  47. package/circularprogress/lib/circular-progress.d.ts +0 -1
  48. package/circularprogress/lib/circular-progress.js +16 -19
  49. package/circularprogress/lib/circular-progress.js.map +1 -1
  50. package/dialog/lib/_dialog.scss +8 -8
  51. package/dialog/lib/dialog-styles.css.js +1 -1
  52. package/dialog/lib/dialog-styles.css.js.map +1 -1
  53. package/dialog/lib/dialog.js +25 -49
  54. package/dialog/lib/dialog.js.map +1 -1
  55. package/divider/lib/divider.js +4 -7
  56. package/divider/lib/divider.js.map +1 -1
  57. package/elevation/lib/_elevation.scss +5 -7
  58. package/elevation/lib/elevation-styles.css.js +1 -1
  59. package/elevation/lib/elevation-styles.css.js.map +1 -1
  60. package/fab/_fab.scss +1 -0
  61. package/fab/branded-fab.d.ts +53 -0
  62. package/fab/branded-fab.js +56 -0
  63. package/fab/branded-fab.js.map +1 -0
  64. package/fab/fab.d.ts +25 -5
  65. package/fab/fab.js +27 -10
  66. package/fab/fab.js.map +1 -1
  67. package/fab/harness.d.ts +1 -2
  68. package/fab/harness.js +1 -1
  69. package/fab/harness.js.map +1 -1
  70. package/fab/lib/_fab-branded.scss +27 -0
  71. package/fab/lib/_fab.scss +144 -16
  72. package/fab/lib/_shared.scss +155 -130
  73. package/fab/lib/fab-branded-styles.css.js +9 -0
  74. package/fab/lib/fab-branded-styles.css.js.map +1 -0
  75. package/fab/lib/fab-branded-styles.scss +10 -0
  76. package/fab/lib/fab-styles.css.js +1 -1
  77. package/fab/lib/fab-styles.css.js.map +1 -1
  78. package/fab/lib/fab.d.ts +14 -10
  79. package/fab/lib/fab.js +19 -12
  80. package/fab/lib/fab.js.map +1 -1
  81. package/fab/lib/forced-colors-styles.css.d.ts +1 -0
  82. package/fab/lib/forced-colors-styles.css.js +9 -0
  83. package/fab/lib/forced-colors-styles.css.js.map +1 -0
  84. package/fab/lib/forced-colors-styles.scss +26 -0
  85. package/fab/lib/shared-styles.css.d.ts +1 -0
  86. package/fab/lib/shared-styles.css.js +9 -0
  87. package/fab/lib/shared-styles.css.js.map +1 -0
  88. package/fab/lib/{fab-shared-styles.scss → shared-styles.scss} +1 -1
  89. package/fab/lib/{fab-shared.d.ts → shared.d.ts} +24 -16
  90. package/fab/lib/shared.js +137 -0
  91. package/fab/lib/shared.js.map +1 -0
  92. package/field/lib/field.js +14 -27
  93. package/field/lib/field.js.map +1 -1
  94. package/focus/focus-ring.d.ts +0 -1
  95. package/focus/focus-ring.js +0 -1
  96. package/focus/focus-ring.js.map +1 -1
  97. package/focus/lib/focus-ring.js +2 -3
  98. package/focus/lib/focus-ring.js.map +1 -1
  99. package/focus/strong-focus.js +5 -0
  100. package/focus/strong-focus.js.map +1 -1
  101. package/icon/icon.d.ts +0 -1
  102. package/icon/icon.js +0 -1
  103. package/icon/icon.js.map +1 -1
  104. package/icon/lib/_icon.scss +2 -0
  105. package/icon/lib/icon-styles.css.js +1 -1
  106. package/icon/lib/icon-styles.css.js.map +1 -1
  107. package/icon/lib/icon.d.ts +5 -4
  108. package/icon/lib/icon.js +3 -2
  109. package/icon/lib/icon.js.map +1 -1
  110. package/iconbutton/lib/icon-button.d.ts +0 -4
  111. package/iconbutton/lib/icon-button.js +28 -48
  112. package/iconbutton/lib/icon-button.js.map +1 -1
  113. package/linearprogress/_linear-progress.scss +6 -0
  114. package/linearprogress/harness.d.ts +13 -0
  115. package/linearprogress/harness.js +18 -0
  116. package/linearprogress/harness.js.map +1 -0
  117. package/linearprogress/lib/_linear-progress.scss +380 -0
  118. package/linearprogress/lib/linear-progress-styles.css.d.ts +1 -0
  119. package/linearprogress/lib/linear-progress-styles.css.js +9 -0
  120. package/linearprogress/lib/linear-progress-styles.css.js.map +1 -0
  121. package/linearprogress/lib/linear-progress-styles.scss +8 -0
  122. package/linearprogress/lib/linear-progress.d.ts +35 -0
  123. package/linearprogress/lib/linear-progress.js +127 -0
  124. package/linearprogress/lib/linear-progress.js.map +1 -0
  125. package/linearprogress/linear-progress.d.ts +23 -0
  126. package/linearprogress/linear-progress.js +26 -0
  127. package/linearprogress/linear-progress.js.map +1 -0
  128. package/list/lib/_list.scss +6 -49
  129. package/list/lib/list-styles.css.js +1 -1
  130. package/list/lib/list-styles.css.js.map +1 -1
  131. package/list/lib/list.d.ts +1 -3
  132. package/list/lib/list.js +18 -34
  133. package/list/lib/list.js.map +1 -1
  134. package/list/lib/listitem/_list-item.scss +10 -69
  135. package/list/lib/listitem/forced-colors-styles.css.js +1 -1
  136. package/list/lib/listitem/forced-colors-styles.css.js.map +1 -1
  137. package/list/lib/listitem/list-item-styles.css.js +1 -1
  138. package/list/lib/listitem/list-item-styles.css.js.map +1 -1
  139. package/list/lib/listitem/list-item.d.ts +2 -4
  140. package/list/lib/listitem/list-item.js +24 -53
  141. package/list/lib/listitem/list-item.js.map +1 -1
  142. package/list/lib/listitemlink/list-item-link.js +4 -6
  143. package/list/lib/listitemlink/list-item-link.js.map +1 -1
  144. package/menu/lib/_menu.scss +6 -28
  145. package/menu/lib/menu-styles.css.js +1 -1
  146. package/menu/lib/menu-styles.css.js.map +1 -1
  147. package/menu/lib/menu.d.ts +1 -2
  148. package/menu/lib/menu.js +38 -63
  149. package/menu/lib/menu.js.map +1 -1
  150. package/menu/lib/menuitem/_menu-item.scss +13 -32
  151. package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
  152. package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
  153. package/menu/lib/menuitem/menu-item.d.ts +1 -1
  154. package/menu/lib/menuitem/menu-item.js +4 -6
  155. package/menu/lib/menuitem/menu-item.js.map +1 -1
  156. package/menu/lib/menuitemlink/menu-item-link.d.ts +0 -2
  157. package/menu/lib/menuitemlink/menu-item-link.js +3 -6
  158. package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
  159. package/menu/lib/shared.d.ts +6 -2
  160. package/menu/lib/shared.js.map +1 -1
  161. package/menu/lib/submenuitem/sub-menu-item.d.ts +0 -2
  162. package/menu/lib/submenuitem/sub-menu-item.js +7 -15
  163. package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
  164. package/navigationbar/lib/_navigation-bar.scss +7 -1
  165. package/navigationbar/lib/navigation-bar-styles.css.js +1 -1
  166. package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -1
  167. package/navigationbar/lib/navigation-bar.d.ts +5 -5
  168. package/navigationbar/lib/navigation-bar.js +17 -18
  169. package/navigationbar/lib/navigation-bar.js.map +1 -1
  170. package/navigationbar/navigation-bar.d.ts +0 -1
  171. package/navigationbar/navigation-bar.js +0 -1
  172. package/navigationbar/navigation-bar.js.map +1 -1
  173. package/navigationdrawer/lib/navigation-drawer-modal.d.ts +5 -10
  174. package/navigationdrawer/lib/navigation-drawer-modal.js +19 -41
  175. package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
  176. package/navigationdrawer/lib/navigation-drawer.d.ts +5 -9
  177. package/navigationdrawer/lib/navigation-drawer.js +17 -38
  178. package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
  179. package/navigationdrawer/navigation-drawer-modal.d.ts +0 -1
  180. package/navigationdrawer/navigation-drawer-modal.js +0 -1
  181. package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
  182. package/navigationdrawer/navigation-drawer.d.ts +0 -1
  183. package/navigationdrawer/navigation-drawer.js +0 -1
  184. package/navigationdrawer/navigation-drawer.js.map +1 -1
  185. package/navigationtab/lib/navigation-tab.d.ts +19 -24
  186. package/navigationtab/lib/navigation-tab.js +48 -68
  187. package/navigationtab/lib/navigation-tab.js.map +1 -1
  188. package/navigationtab/navigation-tab.d.ts +0 -1
  189. package/navigationtab/navigation-tab.js +0 -1
  190. package/navigationtab/navigation-tab.js.map +1 -1
  191. package/package.json +1 -1
  192. package/radio/lib/radio.d.ts +0 -1
  193. package/radio/lib/radio.js +30 -37
  194. package/radio/lib/radio.js.map +1 -1
  195. package/ripple/lib/ripple.js +7 -13
  196. package/ripple/lib/ripple.js.map +1 -1
  197. package/segmentedbutton/lib/outlined-segmented-button.d.ts +16 -7
  198. package/segmentedbutton/lib/outlined-segmented-button.js +3 -3
  199. package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -1
  200. package/segmentedbutton/lib/segmented-button.d.ts +27 -33
  201. package/segmentedbutton/lib/segmented-button.js +42 -75
  202. package/segmentedbutton/lib/segmented-button.js.map +1 -1
  203. package/segmentedbutton/outlined-segmented-button.d.ts +0 -1
  204. package/segmentedbutton/outlined-segmented-button.js +0 -1
  205. package/segmentedbutton/outlined-segmented-button.js.map +1 -1
  206. package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +6 -4
  207. package/segmentedbuttonset/lib/outlined-segmented-button-set.js +3 -2
  208. package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -1
  209. package/segmentedbuttonset/lib/segmented-button-set.d.ts +3 -9
  210. package/segmentedbuttonset/lib/segmented-button-set.js +14 -20
  211. package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
  212. package/segmentedbuttonset/outlined-segmented-button-set.d.ts +0 -1
  213. package/segmentedbuttonset/outlined-segmented-button-set.js +0 -1
  214. package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
  215. package/select/_filled-select.scss +6 -0
  216. package/select/_outlined-select.scss +6 -0
  217. package/select/filled-select.d.ts +41 -0
  218. package/select/filled-select.js +46 -0
  219. package/select/filled-select.js.map +1 -0
  220. package/select/harness.d.ts +24 -0
  221. package/select/harness.js +53 -0
  222. package/select/harness.js.map +1 -0
  223. package/select/lib/_filled-select.scss +163 -0
  224. package/select/lib/_outlined-select.scss +146 -0
  225. package/select/lib/_shared.scss +48 -0
  226. package/select/lib/filled-forced-colors-styles.css.d.ts +1 -0
  227. package/select/lib/filled-forced-colors-styles.css.js +9 -0
  228. package/select/lib/filled-forced-colors-styles.css.js.map +1 -0
  229. package/select/lib/filled-forced-colors-styles.scss +29 -0
  230. package/select/lib/filled-select-styles.css.d.ts +1 -0
  231. package/select/lib/filled-select-styles.css.js +9 -0
  232. package/select/lib/filled-select-styles.css.js.map +1 -0
  233. package/select/lib/filled-select-styles.scss +10 -0
  234. package/select/lib/filled-select.d.ts +10 -0
  235. package/select/lib/filled-select.js +16 -0
  236. package/select/lib/filled-select.js.map +1 -0
  237. package/select/lib/outlined-forced-colors-styles.css.d.ts +1 -0
  238. package/select/lib/outlined-forced-colors-styles.css.js +9 -0
  239. package/select/lib/outlined-forced-colors-styles.css.js.map +1 -0
  240. package/select/lib/outlined-forced-colors-styles.scss +29 -0
  241. package/select/lib/outlined-select-styles.css.d.ts +1 -0
  242. package/select/lib/outlined-select-styles.css.js +9 -0
  243. package/select/lib/outlined-select-styles.css.js.map +1 -0
  244. package/select/lib/outlined-select-styles.scss +10 -0
  245. package/select/lib/outlined-select.d.ts +10 -0
  246. package/select/lib/outlined-select.js +16 -0
  247. package/select/lib/outlined-select.js.map +1 -0
  248. package/select/lib/select.d.ts +218 -0
  249. package/select/lib/select.js +587 -0
  250. package/select/lib/select.js.map +1 -0
  251. package/select/lib/selectoption/harness.d.ts +11 -0
  252. package/select/lib/selectoption/harness.js +12 -0
  253. package/select/lib/selectoption/harness.js.map +1 -0
  254. package/select/lib/selectoption/select-option.d.ts +30 -0
  255. package/select/lib/selectoption/select-option.js +71 -0
  256. package/select/lib/selectoption/select-option.js.map +1 -0
  257. package/select/lib/shared-styles.css.d.ts +1 -0
  258. package/select/lib/shared-styles.css.js +9 -0
  259. package/select/lib/shared-styles.css.js.map +1 -0
  260. package/select/lib/shared-styles.scss +10 -0
  261. package/select/lib/shared.d.ts +52 -0
  262. package/select/lib/shared.js +41 -0
  263. package/select/lib/shared.js.map +1 -0
  264. package/select/outlined-select.d.ts +41 -0
  265. package/select/outlined-select.js +46 -0
  266. package/select/outlined-select.js.map +1 -0
  267. package/select/select-option.d.ts +44 -0
  268. package/select/select-option.js +51 -0
  269. package/select/select-option.js.map +1 -0
  270. package/slider/harness.d.ts +1 -0
  271. package/slider/harness.js +5 -0
  272. package/slider/harness.js.map +1 -1
  273. package/slider/lib/_slider.scss +146 -164
  274. package/slider/lib/forced-colors-styles.css.js +1 -1
  275. package/slider/lib/forced-colors-styles.css.js.map +1 -1
  276. package/slider/lib/forced-colors-styles.scss +2 -2
  277. package/slider/lib/slider-styles.css.js +1 -1
  278. package/slider/lib/slider-styles.css.js.map +1 -1
  279. package/slider/lib/slider.d.ts +2 -7
  280. package/slider/lib/slider.js +64 -118
  281. package/slider/lib/slider.js.map +1 -1
  282. package/switch/lib/switch.d.ts +0 -2
  283. package/switch/lib/switch.js +32 -54
  284. package/switch/lib/switch.js.map +1 -1
  285. package/textfield/lib/text-field.d.ts +0 -10
  286. package/textfield/lib/text-field.js +45 -115
  287. package/textfield/lib/text-field.js.map +1 -1
  288. package/tokens/_index.scss +3 -0
  289. package/tokens/_md-comp-assist-chip.scss +25 -20
  290. package/tokens/_md-comp-elevation.scss +0 -4
  291. package/tokens/_md-comp-fab-branded.scss +109 -1
  292. package/tokens/_md-comp-fab.scss +290 -0
  293. package/tokens/_md-comp-filled-select.scss +150 -1
  294. package/tokens/_md-comp-filter-chip.scss +103 -93
  295. package/tokens/_md-comp-input-chip.scss +77 -85
  296. package/tokens/_md-comp-linear-progress-indicator.scss +14 -1
  297. package/tokens/_md-comp-list-item.scss +201 -0
  298. package/tokens/_md-comp-list.scss +107 -26
  299. package/tokens/_md-comp-menu-item.scss +76 -0
  300. package/tokens/_md-comp-menu.scss +52 -2
  301. package/tokens/_md-comp-outlined-select.scss +150 -1
  302. package/tokens/_md-comp-slider.scss +13 -1
  303. package/tokens/_md-comp-suggestion-chip.scss +29 -21
  304. package/tokens/_values.scss +5 -2
  305. package/types/aria.d.ts +61 -1
  306. package/actionelement/action-element.d.ts +0 -79
  307. package/actionelement/action-element.js +0 -97
  308. package/actionelement/action-element.js.map +0 -1
  309. package/button/lib/state.d.ts +0 -10
  310. package/button/lib/state.js +0 -7
  311. package/button/lib/state.js.map +0 -1
  312. package/controller/action-controller.d.ts +0 -147
  313. package/controller/action-controller.js +0 -286
  314. package/controller/action-controller.js.map +0 -1
  315. package/decorators/aria-property.d.ts +0 -32
  316. package/decorators/aria-property.js +0 -99
  317. package/decorators/aria-property.js.map +0 -1
  318. package/fab/_fab-extended.scss +0 -6
  319. package/fab/fab-extended.d.ts +0 -23
  320. package/fab/fab-extended.js +0 -29
  321. package/fab/fab-extended.js.map +0 -1
  322. package/fab/lib/_fab-extended.scss +0 -73
  323. package/fab/lib/fab-extended-styles.css.js +0 -9
  324. package/fab/lib/fab-extended-styles.css.js.map +0 -1
  325. package/fab/lib/fab-extended.d.ts +0 -19
  326. package/fab/lib/fab-extended.js +0 -28
  327. package/fab/lib/fab-extended.js.map +0 -1
  328. package/fab/lib/fab-shared-styles.css.js +0 -9
  329. package/fab/lib/fab-shared-styles.css.js.map +0 -1
  330. package/fab/lib/fab-shared.js +0 -121
  331. package/fab/lib/fab-shared.js.map +0 -1
  332. package/slider/lib/_tokens.scss +0 -65
  333. /package/{fab/lib/fab-extended-styles.css.d.ts → chips/lib/filter-styles.css.d.ts} +0 -0
  334. /package/fab/lib/{fab-shared-styles.css.d.ts → fab-branded-styles.css.d.ts} +0 -0
@@ -3,24 +3,24 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { __decorate, __metadata } from "tslib";
6
+ var _a;
7
+ import { __decorate } from "tslib";
7
8
  import '../../focus/focus-ring.js';
8
- import { html } from 'lit';
9
- import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
9
+ import '../../ripple/ripple.js';
10
+ import { html, LitElement, nothing } from 'lit';
11
+ import { property, queryAssignedElements, queryAsync, state } from 'lit/decorators.js';
10
12
  import { classMap } from 'lit/directives/class-map.js';
11
- import { ifDefined } from 'lit/directives/if-defined.js';
12
- import { ActionElement } from '../../actionelement/action-element.js';
13
- import { ariaProperty } from '../../decorators/aria-property.js';
13
+ import { when } from 'lit/directives/when.js';
14
+ import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
14
15
  import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js';
15
- import { MdRipple } from '../../ripple/ripple.js';
16
+ import { ripple } from '../../ripple/directive.js';
16
17
  /**
17
18
  * SegmentedButton is a web component implementation of the Material Design
18
19
  * segmented button component. It is intended **only** for use as a child of a
19
20
  * `SementedButtonSet` component. It is **not** intended for use in any other
20
21
  * context.
21
- * @soyCompatible
22
22
  */
23
- export class SegmentedButton extends ActionElement {
23
+ export class SegmentedButton extends LitElement {
24
24
  constructor() {
25
25
  super(...arguments);
26
26
  this.disabled = false;
@@ -30,6 +30,14 @@ export class SegmentedButton extends ActionElement {
30
30
  this.hasIcon = false;
31
31
  this.animState = '';
32
32
  this.showFocusRing = false;
33
+ this.showRipple = false;
34
+ this.getRipple = () => {
35
+ this.showRipple = true;
36
+ return this.ripple;
37
+ };
38
+ this.renderRipple = () => {
39
+ return html `<md-ripple ?disabled="${this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`;
40
+ };
33
41
  }
34
42
  update(props) {
35
43
  this.animState = this.nextAnimationState(props);
@@ -53,58 +61,37 @@ export class SegmentedButton extends ActionElement {
53
61
  }
54
62
  return '';
55
63
  }
56
- beginPress({ positionEvent }) {
57
- // TODO(b/261201805): connect to ripple
58
- }
59
- endPress(options) {
60
- // TODO(b/261201805): connect to ripple
61
- super.endPress(options);
62
- if (!options.cancelled) {
63
- const event = new Event('segmented-button-interaction', { bubbles: true, composed: true });
64
- this.dispatchEvent(event);
65
- }
64
+ handleClick(e) {
65
+ const event = new Event('segmented-button-interaction', { bubbles: true, composed: true });
66
+ this.dispatchEvent(event);
66
67
  }
67
68
  handlePointerDown(e) {
68
- super.handlePointerDown(e);
69
69
  pointerPress();
70
70
  this.showFocusRing = shouldShowStrongFocus();
71
71
  }
72
- handlePointerUp(e) {
73
- super.handlePointerUp(e);
74
- }
75
- handlePointerEnter(e) {
76
- this.ripple.handlePointerenter(e);
77
- }
78
- handlePointerLeave(e) {
79
- super.handlePointerLeave(e);
80
- this.ripple.handlePointerleave(e);
81
- }
82
72
  handleFocus() {
83
73
  this.showFocusRing = shouldShowStrongFocus();
84
74
  }
85
75
  handleBlur() {
86
76
  this.showFocusRing = false;
87
77
  }
88
- /** @soyTemplate */
89
78
  render() {
79
+ // Needed for closure conformance
80
+ const { ariaLabel } = this;
90
81
  return html `
91
82
  <button
92
83
  tabindex="${this.disabled ? '-1' : '0'}"
93
- aria-label="${ifDefined(this.ariaLabel)}"
84
+ aria-label=${ariaLabel || nothing}
94
85
  aria-pressed=${this.selected}
95
86
  ?disabled=${this.disabled}
96
87
  @focus="${this.handleFocus}"
97
88
  @blur="${this.handleBlur}"
98
89
  @pointerdown="${this.handlePointerDown}"
99
- @pointerup="${this.handlePointerUp}"
100
- @pointercancel="${this.handlePointerCancel}"
101
- @pointerleave="${this.handlePointerLeave}"
102
- @pointerenter="${this.handlePointerEnter}"
103
90
  @click="${this.handleClick}"
104
- @contextmenu="${this.handleContextMenu}"
105
- class="md3-segmented-button ${classMap(this.getRenderClasses())}">
91
+ class="md3-segmented-button ${classMap(this.getRenderClasses())}"
92
+ ${ripple(this.getRipple)}>
106
93
  ${this.renderFocusRing()}
107
- ${this.renderRipple()}
94
+ ${when(this.showRipple, this.renderRipple)}
108
95
  ${this.renderOutline()}
109
96
  ${this.renderLeading()}
110
97
  ${this.renderLabel()}
@@ -112,7 +99,6 @@ export class SegmentedButton extends ActionElement {
112
99
  </button>
113
100
  `;
114
101
  }
115
- /** @soyTemplate */
116
102
  getRenderClasses() {
117
103
  return {
118
104
  'md3-segmented-button--selected': this.selected,
@@ -126,24 +112,16 @@ export class SegmentedButton extends ActionElement {
126
112
  'md3-segmented-button--deselecting': this.animState === 'deselecting',
127
113
  };
128
114
  }
129
- /** @soyTemplate */
130
115
  renderFocusRing() {
131
116
  return html `<md-focus-ring .visible="${this.showFocusRing}" class="md3-segmented-button__focus-ring"></md-focus-ring>`;
132
117
  }
133
- /** @soyTemplate */
134
- renderRipple() {
135
- return html `<md-ripple ?disabled="${this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`;
136
- }
137
- /** @soyTemplate */
138
118
  renderOutline() {
139
119
  return html ``;
140
120
  }
141
- /** @soyTemplate */
142
121
  renderLeading() {
143
122
  return this.label === '' ? this.renderLeadingWithoutLabel() :
144
123
  this.renderLeadingWithLabel();
145
124
  }
146
- /** @soyTemplate */
147
125
  renderLeadingWithoutLabel() {
148
126
  return html `
149
127
  <span class="md3-segmented-button__leading" aria-hidden="true">
@@ -158,7 +136,6 @@ export class SegmentedButton extends ActionElement {
158
136
  </span>
159
137
  `;
160
138
  }
161
- /** @soyTemplate */
162
139
  renderLeadingWithLabel() {
163
140
  return html `
164
141
  <span class="md3-segmented-button__leading" aria-hidden="true">
@@ -173,57 +150,47 @@ export class SegmentedButton extends ActionElement {
173
150
  </span>
174
151
  `;
175
152
  }
176
- /** @soyTemplate */
177
153
  renderLabel() {
178
154
  return html `
179
155
  <span class="md3-segmented-button__label-text">${this.label}</span>
180
156
  `;
181
157
  }
182
- /** @soyTemplate */
183
158
  renderTouchTarget() {
184
159
  return html `<span class="md3-segmented-button__touch"></span>`;
185
160
  }
186
161
  }
162
+ _a = SegmentedButton;
163
+ (() => {
164
+ requestUpdateOnAriaChange(_a);
165
+ })();
187
166
  __decorate([
188
- property({ type: Boolean }),
189
- __metadata("design:type", Object)
167
+ property({ type: Boolean })
190
168
  ], SegmentedButton.prototype, "disabled", void 0);
191
169
  __decorate([
192
- property({ type: Boolean }),
193
- __metadata("design:type", Object)
170
+ property({ type: Boolean })
194
171
  ], SegmentedButton.prototype, "selected", void 0);
195
172
  __decorate([
196
- property({ type: String }),
197
- __metadata("design:type", Object)
173
+ property()
198
174
  ], SegmentedButton.prototype, "label", void 0);
199
175
  __decorate([
200
- property({ type: Boolean }),
201
- __metadata("design:type", Object)
176
+ property({ type: Boolean })
202
177
  ], SegmentedButton.prototype, "noCheckmark", void 0);
203
178
  __decorate([
204
- property({ type: Boolean }),
205
- __metadata("design:type", Object)
179
+ property({ type: Boolean })
206
180
  ], SegmentedButton.prototype, "hasIcon", void 0);
207
181
  __decorate([
208
- ariaProperty // tslint:disable-line:no-new-decorators
209
- ,
210
- property({ type: String, attribute: 'aria-label' }),
211
- __metadata("design:type", String)
212
- ], SegmentedButton.prototype, "ariaLabel", void 0);
213
- __decorate([
214
- state(),
215
- __metadata("design:type", String)
182
+ state()
216
183
  ], SegmentedButton.prototype, "animState", void 0);
217
184
  __decorate([
218
- state(),
219
- __metadata("design:type", Object)
185
+ state()
220
186
  ], SegmentedButton.prototype, "showFocusRing", void 0);
221
187
  __decorate([
222
- queryAssignedElements({ slot: 'icon', flatten: true }),
223
- __metadata("design:type", Array)
188
+ state()
189
+ ], SegmentedButton.prototype, "showRipple", void 0);
190
+ __decorate([
191
+ queryAssignedElements({ slot: 'icon', flatten: true })
224
192
  ], SegmentedButton.prototype, "iconElement", void 0);
225
193
  __decorate([
226
- query('md-ripple'),
227
- __metadata("design:type", MdRipple)
194
+ queryAsync('md-ripple')
228
195
  ], SegmentedButton.prototype, "ripple", void 0);
229
196
  //# sourceMappingURL=segmented-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-button.js","sourceRoot":"","sources":["segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,2BAA2B,CAAC;AAEnC,OAAO,EAAC,IAAI,EAAiC,MAAM,KAAK,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AAEvD,OAAO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oDACf;AACtC;IAAC,KAAK,CAAC,WAAW,CAAC;8BAAU,QAAQ;+CAAC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/focus-ring.js';\n\nimport {html, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\nimport {ActionElement, BeginPressConfig, EndPressConfig} from '../../actionelement/action-element.js';\nimport {ariaProperty} from '../../decorators/aria-property.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../focus/strong-focus.js';\nimport {MdRipple} from '../../ripple/ripple.js';\n\n/**\n * SegmentedButton is a web component implementation of the Material Design\n * segmented button component. It is intended **only** for use as a child of a\n * `SementedButtonSet` component. It is **not** intended for use in any other\n * context.\n * @soyCompatible\n */\nexport class SegmentedButton extends ActionElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) selected = false;\n @property({type: String}) label = '';\n @property({type: Boolean}) noCheckmark = false;\n @property({type: Boolean}) hasIcon = false;\n\n /** @soyPrefixAttribute */\n @ariaProperty // tslint:disable-line:no-new-decorators\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel!: string;\n\n @state() protected animState: string = '';\n @state() protected showFocusRing = false;\n @queryAssignedElements({slot: 'icon', flatten: true})\n protected iconElement!: HTMLElement[];\n @query('md-ripple') ripple!: MdRipple;\n\n protected override update(props: PropertyValues<SegmentedButton>) {\n this.animState = this.nextAnimationState(props);\n super.update(props);\n // NOTE: This needs to be set *after* calling super.update() to ensure the\n // appropriate CSS classes are applied.\n this.hasIcon = this.iconElement.length > 0;\n }\n\n private nextAnimationState(changedProps: PropertyValues<SegmentedButton>):\n string {\n const prevSelected = changedProps.get('selected');\n // Early exit for first update.\n if (prevSelected === undefined) return '';\n\n const nextSelected = this.selected;\n const nextHasCheckmark = !this.noCheckmark;\n if (!prevSelected && nextSelected && nextHasCheckmark) {\n return 'selecting';\n }\n if (prevSelected && !nextSelected && nextHasCheckmark) {\n return 'deselecting';\n }\n return '';\n }\n\n override beginPress({positionEvent}: BeginPressConfig) {\n // TODO(b/261201805): connect to ripple\n }\n\n override endPress(options: EndPressConfig) {\n // TODO(b/261201805): connect to ripple\n super.endPress(options);\n if (!options.cancelled) {\n const event = new Event(\n 'segmented-button-interaction', {bubbles: true, composed: true});\n this.dispatchEvent(event);\n }\n }\n\n override handlePointerDown(e: PointerEvent) {\n super.handlePointerDown(e);\n pointerPress();\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n override handlePointerUp(e: PointerEvent) {\n super.handlePointerUp(e);\n }\n\n protected handlePointerEnter(e: PointerEvent) {\n this.ripple.handlePointerenter(e);\n }\n\n override handlePointerLeave(e: PointerEvent) {\n super.handlePointerLeave(e);\n this.ripple.handlePointerleave(e);\n }\n\n protected handleFocus() {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected handleBlur() {\n this.showFocusRing = false;\n }\n\n /** @soyTemplate */\n override render(): TemplateResult {\n return html`\n <button\n tabindex=\"${this.disabled ? '-1' : '0'}\"\n aria-label=\"${ifDefined(this.ariaLabel)}\"\n aria-pressed=${this.selected}\n ?disabled=${this.disabled}\n @focus=\"${this.handleFocus}\"\n @blur=\"${this.handleBlur}\"\n @pointerdown=\"${this.handlePointerDown}\"\n @pointerup=\"${this.handlePointerUp}\"\n @pointercancel=\"${this.handlePointerCancel}\"\n @pointerleave=\"${this.handlePointerLeave}\"\n @pointerenter=\"${this.handlePointerEnter}\"\n @click=\"${this.handleClick}\"\n @contextmenu=\"${this.handleContextMenu}\"\n class=\"md3-segmented-button ${classMap(this.getRenderClasses())}\">\n ${this.renderFocusRing()}\n ${this.renderRipple()}\n ${this.renderOutline()}\n ${this.renderLeading()}\n ${this.renderLabel()}\n ${this.renderTouchTarget()}\n </button>\n `;\n }\n\n /** @soyTemplate */\n protected getRenderClasses(): ClassInfo {\n return {\n 'md3-segmented-button--selected': this.selected,\n 'md3-segmented-button--unselected': !this.selected,\n 'md3-segmented-button--with-label': this.label !== '',\n 'md3-segmented-button--without-label': this.label === '',\n 'md3-segmented-button--with-icon': this.hasIcon,\n 'md3-segmented-button--with-checkmark': !this.noCheckmark,\n 'md3-segmented-button--without-checkmark': this.noCheckmark,\n 'md3-segmented-button--selecting': this.animState === 'selecting',\n 'md3-segmented-button--deselecting': this.animState === 'deselecting',\n };\n }\n\n /** @soyTemplate */\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring .visible=\"${\n this.showFocusRing}\" class=\"md3-segmented-button__focus-ring\"></md-focus-ring>`;\n }\n\n /** @soyTemplate */\n protected renderRipple(): TemplateResult|string {\n return html`<md-ripple ?disabled=\"${\n this.disabled}\" class=\"md3-segmented-button__ripple\"> </md-ripple>`;\n }\n\n /** @soyTemplate */\n protected renderOutline(): TemplateResult {\n return html``;\n }\n\n /** @soyTemplate */\n protected renderLeading(): TemplateResult {\n return this.label === '' ? this.renderLeadingWithoutLabel() :\n this.renderLeadingWithLabel();\n }\n\n /** @soyTemplate */\n protected renderLeadingWithoutLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n </span>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n `;\n }\n\n /** @soyTemplate */\n protected renderLeadingWithLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n </span>\n `;\n }\n\n /** @soyTemplate */\n protected renderLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__label-text\">${this.label}</span>\n `;\n }\n\n /** @soyTemplate */\n protected renderTouchTarget(): TemplateResult {\n return html`<span class=\"md3-segmented-button__touch\"></span>`;\n }\n}\n"]}
1
+ {"version":3,"file":"segmented-button.js","sourceRoot":"","sources":["segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,wBAAwB,CAAC;AAEhC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,qBAAqB,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAE5C,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAC,MAAM,EAAC,MAAM,2BAA2B,CAAC;AAIjD;;;;;GAKG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IAA/C;;QAK6B,aAAQ,GAAG,KAAK,CAAC;QACjB,aAAQ,GAAG,KAAK,CAAC;QAChC,UAAK,GAAG,EAAE,CAAC;QACI,gBAAW,GAAG,KAAK,CAAC;QACpB,YAAO,GAAG,KAAK,CAAC;QAExB,cAAS,GAAG,EAAE,CAAC;QACf,kBAAa,GAAG,KAAK,CAAC;QACtB,eAAU,GAAG,KAAK,CAAC;QA6FnB,cAAS,GAAG,GAAG,EAAE;YAClC,IAAI,CAAC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,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oDACf;AACb;IAAxB,UAAU,CAAC,WAAW,CAAC;+CAA2C","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, queryAssignedElements, queryAsync, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {when} from 'lit/directives/when.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../focus/strong-focus.js';\nimport {ripple} from '../../ripple/directive.js';\nimport {MdRipple} from '../../ripple/ripple.js';\nimport {ARIAMixinStrict} from '../../types/aria.js';\n\n/**\n * SegmentedButton is a web component implementation of the Material Design\n * segmented button component. It is intended **only** for use as a child of a\n * `SementedButtonSet` component. It is **not** intended for use in any other\n * context.\n */\nexport class SegmentedButton extends LitElement {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) selected = false;\n @property() label = '';\n @property({type: Boolean}) noCheckmark = false;\n @property({type: Boolean}) hasIcon = false;\n\n @state() protected animState = '';\n @state() protected showFocusRing = false;\n @state() protected showRipple = false;\n @queryAssignedElements({slot: 'icon', flatten: true})\n protected iconElement!: HTMLElement[];\n @queryAsync('md-ripple') protected ripple!: Promise<MdRipple|null>;\n\n protected override update(props: PropertyValues<SegmentedButton>) {\n this.animState = this.nextAnimationState(props);\n super.update(props);\n // NOTE: This needs to be set *after* calling super.update() to ensure the\n // appropriate CSS classes are applied.\n this.hasIcon = this.iconElement.length > 0;\n }\n\n private nextAnimationState(changedProps: PropertyValues<SegmentedButton>):\n string {\n const prevSelected = changedProps.get('selected');\n // Early exit for first update.\n if (prevSelected === undefined) return '';\n\n const nextSelected = this.selected;\n const nextHasCheckmark = !this.noCheckmark;\n if (!prevSelected && nextSelected && nextHasCheckmark) {\n return 'selecting';\n }\n if (prevSelected && !nextSelected && nextHasCheckmark) {\n return 'deselecting';\n }\n return '';\n }\n\n handleClick(e: MouseEvent) {\n const event = new Event(\n 'segmented-button-interaction', {bubbles: true, composed: true});\n this.dispatchEvent(event);\n }\n\n handlePointerDown(e: PointerEvent) {\n pointerPress();\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected handleFocus() {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected handleBlur() {\n this.showFocusRing = false;\n }\n\n override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <button\n tabindex=\"${this.disabled ? '-1' : '0'}\"\n aria-label=${ariaLabel || nothing}\n aria-pressed=${this.selected}\n ?disabled=${this.disabled}\n @focus=\"${this.handleFocus}\"\n @blur=\"${this.handleBlur}\"\n @pointerdown=\"${this.handlePointerDown}\"\n @click=\"${this.handleClick}\"\n class=\"md3-segmented-button ${classMap(this.getRenderClasses())}\"\n ${ripple(this.getRipple)}>\n ${this.renderFocusRing()}\n ${when(this.showRipple, this.renderRipple)}\n ${this.renderOutline()}\n ${this.renderLeading()}\n ${this.renderLabel()}\n ${this.renderTouchTarget()}\n </button>\n `;\n }\n\n protected getRenderClasses() {\n return {\n 'md3-segmented-button--selected': this.selected,\n 'md3-segmented-button--unselected': !this.selected,\n 'md3-segmented-button--with-label': this.label !== '',\n 'md3-segmented-button--without-label': this.label === '',\n 'md3-segmented-button--with-icon': this.hasIcon,\n 'md3-segmented-button--with-checkmark': !this.noCheckmark,\n 'md3-segmented-button--without-checkmark': this.noCheckmark,\n 'md3-segmented-button--selecting': this.animState === 'selecting',\n 'md3-segmented-button--deselecting': this.animState === 'deselecting',\n };\n }\n\n protected renderFocusRing() {\n return html`<md-focus-ring .visible=\"${\n this.showFocusRing}\" class=\"md3-segmented-button__focus-ring\"></md-focus-ring>`;\n }\n\n protected readonly getRipple = () => {\n this.showRipple = true;\n return this.ripple;\n };\n\n protected renderRipple = () => {\n return html`<md-ripple ?disabled=\"${\n this.disabled}\" class=\"md3-segmented-button__ripple\"> </md-ripple>`;\n };\n\n protected renderOutline() {\n return html``;\n }\n\n protected renderLeading() {\n return this.label === '' ? this.renderLeadingWithoutLabel() :\n this.renderLeadingWithLabel();\n }\n\n protected renderLeadingWithoutLabel() {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n </span>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n `;\n }\n\n protected renderLeadingWithLabel() {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n </span>\n `;\n }\n\n protected renderLabel() {\n return html`\n <span class=\"md3-segmented-button__label-text\">${this.label}</span>\n `;\n }\n\n protected renderTouchTarget() {\n return html`<span class=\"md3-segmented-button__touch\"></span>`;\n }\n}\n"]}
@@ -12,7 +12,6 @@ declare global {
12
12
  /**
13
13
  * MdOutlinedSegmentedButton is the custom element for the Material
14
14
  * Design outlined segmented button component.
15
- * @soyCompatible
16
15
  * @final
17
16
  * @suppress {visibility}
18
17
  */
@@ -11,7 +11,6 @@ import { styles as sharedStyles } from './lib/shared-styles.css.js';
11
11
  /**
12
12
  * MdOutlinedSegmentedButton is the custom element for the Material
13
13
  * Design outlined segmented button component.
14
- * @soyCompatible
15
14
  * @final
16
15
  * @suppress {visibility}
17
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-segmented-button.js","sourceRoot":"","sources":["outlined-segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;;GAMG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,uBAAuB;;AACpD,gCAAM,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAD7C,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAErC;SAFY,yBAAyB","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedSegmentedButton} from './lib/outlined-segmented-button.js';\nimport {styles as outlinedStyles} from './lib/outlined-styles.css.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-segmented-button': MdOutlinedSegmentedButton;\n }\n}\n\n/**\n * MdOutlinedSegmentedButton is the custom element for the Material\n * Design outlined segmented button component.\n * @soyCompatible\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-segmented-button')\nexport class MdOutlinedSegmentedButton extends OutlinedSegmentedButton {\n static override styles = [sharedStyles, outlinedStyles];\n}\n"]}
1
+ {"version":3,"file":"outlined-segmented-button.js","sourceRoot":"","sources":["outlined-segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;GAKG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,uBAAuB;;AACpD,gCAAM,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAD7C,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAErC;SAFY,yBAAyB","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedSegmentedButton} from './lib/outlined-segmented-button.js';\nimport {styles as outlinedStyles} from './lib/outlined-styles.css.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-segmented-button': MdOutlinedSegmentedButton;\n }\n}\n\n/**\n * MdOutlinedSegmentedButton is the custom element for the Material\n * Design outlined segmented button component.\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-segmented-button')\nexport class MdOutlinedSegmentedButton extends OutlinedSegmentedButton {\n static override styles = [sharedStyles, outlinedStyles];\n}\n"]}
@@ -3,10 +3,12 @@
3
3
  * Copyright 2022 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { ClassInfo } from 'lit/directives/class-map.js';
7
6
  import { SegmentedButtonSet } from './segmented-button-set.js';
8
- /** @soyCompatible */
7
+ /**
8
+ * TODO(b/265346443): add docs
9
+ */
9
10
  export declare class OutlinedSegmentedButtonSet extends SegmentedButtonSet {
10
- /** @soyTemplate */
11
- protected getRenderClasses(): ClassInfo;
11
+ protected getRenderClasses(): {
12
+ 'md3-segmented-button-set--outlined': boolean;
13
+ };
12
14
  }
@@ -4,9 +4,10 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { SegmentedButtonSet } from './segmented-button-set.js';
7
- /** @soyCompatible */
7
+ /**
8
+ * TODO(b/265346443): add docs
9
+ */
8
10
  export class OutlinedSegmentedButtonSet extends SegmentedButtonSet {
9
- /** @soyTemplate */
10
11
  getRenderClasses() {
11
12
  return {
12
13
  ...super.getRenderClasses(),
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,qBAAqB;AACrB,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAChE,mBAAmB;IACA,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,oCAAoC,EAAE,IAAI;SAC3C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ClassInfo} from 'lit/directives/class-map.js';\n\nimport {SegmentedButtonSet} from './segmented-button-set.js';\n\n/** @soyCompatible */\nexport class OutlinedSegmentedButtonSet extends SegmentedButtonSet {\n /** @soyTemplate */\n protected override getRenderClasses(): ClassInfo {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button-set--outlined': true,\n };\n }\n}"]}
1
+ {"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAC7C,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,oCAAoC,EAAE,IAAI;SAC3C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {SegmentedButtonSet} from './segmented-button-set.js';\n\n/**\n * TODO(b/265346443): add docs\n */\nexport class OutlinedSegmentedButtonSet extends SegmentedButtonSet {\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button-set--outlined': true,\n };\n }\n}\n"]}
@@ -3,19 +3,15 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { LitElement, TemplateResult } from 'lit';
7
- import { ClassInfo } from 'lit/directives/class-map.js';
6
+ import { LitElement } from 'lit';
8
7
  import { SegmentedButton } from '../../segmentedbutton/lib/segmented-button.js';
9
8
  /**
10
9
  * SegmentedButtonSet is the parent component for two or more
11
10
  * `SegmentedButton` components. **Only** `SegmentedButton` components may be
12
11
  * used as children.
13
- * @soyCompatible
14
12
  */
15
13
  export declare class SegmentedButtonSet extends LitElement {
16
14
  multiselect: boolean;
17
- /** @soyPrefixAttribute */
18
- ariaLabel: string;
19
15
  buttons: SegmentedButton[];
20
16
  getButtonDisabled(index: number): boolean;
21
17
  setButtonDisabled(index: number, disabled: boolean): void;
@@ -25,8 +21,6 @@ export declare class SegmentedButtonSet extends LitElement {
25
21
  private toggleSelection;
26
22
  private indexOutOfBounds;
27
23
  private emitSelectionEvent;
28
- /** @soyTemplate */
29
- render(): TemplateResult;
30
- /** @soyTemplate */
31
- protected getRenderClasses(): ClassInfo;
24
+ render(): import("lit-html").TemplateResult<1>;
25
+ protected getRenderClasses(): {};
32
26
  }
@@ -3,17 +3,15 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { __decorate, __metadata } from "tslib";
7
- import { html, LitElement } from 'lit';
6
+ var _a;
7
+ import { __decorate } from "tslib";
8
+ import { html, LitElement, nothing } from 'lit';
8
9
  import { property, queryAssignedElements } from 'lit/decorators.js';
9
- import { classMap } from 'lit/directives/class-map.js';
10
- import { ifDefined } from 'lit/directives/if-defined.js';
11
- import { ariaProperty } from '../../decorators/aria-property.js';
10
+ import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
12
11
  /**
13
12
  * SegmentedButtonSet is the parent component for two or more
14
13
  * `SegmentedButton` components. **Only** `SegmentedButton` components may be
15
14
  * used as children.
16
- * @soyCompatible
17
15
  */
18
16
  export class SegmentedButtonSet extends LitElement {
19
17
  constructor() {
@@ -82,35 +80,31 @@ export class SegmentedButtonSet extends LitElement {
82
80
  composed: true
83
81
  }));
84
82
  }
85
- /** @soyTemplate */
86
83
  render() {
84
+ // Needed for closure conformance
85
+ const { ariaLabel } = this;
87
86
  return html `
88
87
  <span
89
88
  role="group"
90
89
  @segmented-button-interaction="${this.handleSegmentedButtonInteraction}"
91
- aria-label="${ifDefined(this.ariaLabel)}"
92
- class="md3-segmented-button-set ${classMap(this.getRenderClasses())}">
90
+ aria-label=${ariaLabel || nothing}
91
+ class="md3-segmented-button-set">
93
92
  <slot></slot>
94
93
  </span>
95
94
  `;
96
95
  }
97
- /** @soyTemplate */
98
96
  getRenderClasses() {
99
97
  return {};
100
98
  }
101
99
  }
100
+ _a = SegmentedButtonSet;
101
+ (() => {
102
+ requestUpdateOnAriaChange(_a);
103
+ })();
102
104
  __decorate([
103
- property({ type: Boolean }),
104
- __metadata("design:type", Object)
105
+ property({ type: Boolean })
105
106
  ], SegmentedButtonSet.prototype, "multiselect", void 0);
106
107
  __decorate([
107
- ariaProperty // tslint:disable-line:no-new-decorators
108
- ,
109
- property({ type: String, attribute: 'aria-label' }),
110
- __metadata("design:type", String)
111
- ], SegmentedButtonSet.prototype, "ariaLabel", void 0);
112
- __decorate([
113
- queryAssignedElements({ flatten: true }),
114
- __metadata("design:type", Array)
108
+ queryAssignedElements({ flatten: true })
115
109
  ], SegmentedButtonSet.prototype, "buttons", void 0);
116
110
  //# s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AW,CAAC,gCAAgC,EAAE;YACnE,MAAM,EAAE;gBACN,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC3B,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ;gBACtC,KAAK;aACN;YACD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAC;IACN,CAAC;IAED,mBAAmB;IACV,MAAM;QACb,OAAO,IAAI,CAAA;;;wCAGyB,IAAI,CAAC,gCAAgC;qBACxD,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;yCACL,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;;;MAGpE,CAAC;IACL,CAAC;IAED,mBAAmB;IACT,gBAAgB;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AA3FC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uDAAqB;AAG/C;IAAC,YAAY,CAAE,wCAAwC;;IACtD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAC,CAAC;;qDACtB;AAE5B;IAAC,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;;mDAA6B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, TemplateResult} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\nimport {ariaProperty} from '../../decorators/aria-property.js';\nimport {SegmentedButton} from '../../segmentedbutton/lib/segmented-button.js';\n\n/**\n * SegmentedButtonSet is the parent component for two or more\n * `SegmentedButton` components. **Only** `SegmentedButton` components may be\n * used as children.\n * @soyCompatible\n */\nexport class SegmentedButtonSet extends LitElement {\n @property({type: Boolean}) multiselect = false;\n\n /** @soyPrefixAttribute */\n @ariaProperty // tslint:disable-line:no-new-decorators\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel!: string;\n\n @queryAssignedElements({flatten: true}) buttons!: SegmentedButton[];\n\n getButtonDisabled(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].disabled;\n }\n\n setButtonDisabled(index: number, disabled: boolean) {\n if (this.indexOutOfBounds(index)) return;\n this.buttons[index].disabled = disabled;\n }\n\n getButtonSelected(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].selected;\n }\n\n setButtonSelected(index: number, selected: boolean) {\n // Ignore out-of-index values.\n if (this.indexOutOfBounds(index)) return;\n // Ignore disabled buttons.\n if (this.getButtonDisabled(index)) return;\n\n if (this.multiselect) {\n this.buttons[index].selected = selected;\n this.emitSelectionEvent(index);\n return;\n }\n\n // Single-select segmented buttons are not unselectable.\n if (!selected) return;\n\n this.buttons[index].selected = true;\n this.emitSelectionEvent(index);\n // Deselect all other buttons for single-select.\n for (let i = 0; i < this.buttons.length; i++) {\n if (i === index) continue;\n this.buttons[i].selected = false;\n }\n }\n\n private handleSegmentedButtonInteraction(e: CustomEvent) {\n const index = this.buttons.indexOf(e.target as SegmentedButton);\n this.toggleSelection(index);\n }\n\n private toggleSelection(index: number) {\n if (this.indexOutOfBounds(index)) return;\n this.setButtonSelected(index, !this.buttons[index].selected);\n }\n\n private indexOutOfBounds(index: number): boolean {\n return index < 0 || index >= this.buttons.length;\n }\n\n private emitSelectionEvent(index: number) {\n this.dispatchEvent(new CustomEvent('segmented-button-set-selection', {\n detail: {\n button: this.buttons[index],\n selected: this.buttons[index].selected,\n index,\n },\n bubbles: true,\n composed: true\n }));\n }\n\n /** @soyTemplate */\n override render(): TemplateResult {\n return html`\n <span\n role=\"group\"\n @segmented-button-interaction=\"${this.handleSegmentedButtonInteraction}\"\n aria-label=\"${ifDefined(this.ariaLabel)}\"\n class=\"md3-segmented-button-set ${classMap(this.getRenderClasses())}\">\n <slot></slot>\n </span>\n `;\n }\n\n /** @soyTemplate */\n protected getRenderClasses(): ClassInfo {\n return {};\n }\n}\n"]}
1
+ {"version":3,"file":"segmented-button-set.js","sourceRoot":"","sources":["segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AAIjE;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAAlD;;QAK6B,gBAAW,GAAG,KAAK,CAAC;IAsFjD,CAAC;IAlFC,iBAAiB,CAAC,KAAa;QAC7B,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED,iBAAiB,CAAC,KAAa,EAAE,QAAiB;QAChD,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,OAAO;QACzC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC1C,CAAC;IAED,iBAAiB,CAAC,KAAa;QAC7B,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;IACtC,CAAC;IAED,iBAAiB,CAAC,KAAa,EAAE,QAAiB;QAChD,8BAA8B;QAC9B,IAAI,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC;YAAE,OAAO;QACzC,2BAA2B;QAC3B,IAAI,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC;YAAE,OAAO;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AAE;gBACN,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;gBAC3B,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ;gBACtC,KAAK;aACN;YACD,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAC;IACN,CAAC;IAEQ,MAAM;QACb,iCAAiC;QACjC,MAAM,EAAC,SAAS,EAAC,GAAG,IAAuB,CAAC;QAC5C,OAAO,IAAI,CAAA;;;wCAGyB,IAAI,CAAC,gCAAgC;oBACzD,SAAS,IAAI,OAAO;;;;MAIlC,CAAC;IACL,CAAC;IAES,gBAAgB;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;;AA1FC;IACE,yBAAyB,CAAC,EAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uDAAqB;AAEP;IAAvC,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;mDAA6B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing} from 'lit';\nimport {property, queryAssignedElements} from 'lit/decorators.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {SegmentedButton} from '../../segmentedbutton/lib/segmented-button.js';\nimport {ARIAMixinStrict} from '../../types/aria.js';\n\n/**\n * SegmentedButtonSet is the parent component for two or more\n * `SegmentedButton` components. **Only** `SegmentedButton` components may be\n * used as children.\n */\nexport class SegmentedButtonSet extends LitElement {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n @property({type: Boolean}) multiselect = false;\n\n @queryAssignedElements({flatten: true}) buttons!: SegmentedButton[];\n\n getButtonDisabled(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].disabled;\n }\n\n setButtonDisabled(index: number, disabled: boolean) {\n if (this.indexOutOfBounds(index)) return;\n this.buttons[index].disabled = disabled;\n }\n\n getButtonSelected(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].selected;\n }\n\n setButtonSelected(index: number, selected: boolean) {\n // Ignore out-of-index values.\n if (this.indexOutOfBounds(index)) return;\n // Ignore disabled buttons.\n if (this.getButtonDisabled(index)) return;\n\n if (this.multiselect) {\n this.buttons[index].selected = selected;\n this.emitSelectionEvent(index);\n return;\n }\n\n // Single-select segmented buttons are not unselectable.\n if (!selected) return;\n\n this.buttons[index].selected = true;\n this.emitSelectionEvent(index);\n // Deselect all other buttons for single-select.\n for (let i = 0; i < this.buttons.length; i++) {\n if (i === index) continue;\n this.buttons[i].selected = false;\n }\n }\n\n private handleSegmentedButtonInteraction(e: CustomEvent) {\n const index = this.buttons.indexOf(e.target as SegmentedButton);\n this.toggleSelection(index);\n }\n\n private toggleSelection(index: number) {\n if (this.indexOutOfBounds(index)) return;\n this.setButtonSelected(index, !this.buttons[index].selected);\n }\n\n private indexOutOfBounds(index: number): boolean {\n return index < 0 || index >= this.buttons.length;\n }\n\n private emitSelectionEvent(index: number) {\n this.dispatchEvent(new CustomEvent('segmented-button-set-selection', {\n detail: {\n button: this.buttons[index],\n selected: this.buttons[index].selected,\n index,\n },\n bubbles: true,\n composed: true\n }));\n }\n\n override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <span\n role=\"group\"\n @segmented-button-interaction=\"${this.handleSegmentedButtonInteraction}\"\n aria-label=${ariaLabel || nothing}\n class=\"md3-segmented-button-set\">\n <slot></slot>\n </span>\n `;\n }\n\n protected getRenderClasses() {\n return {};\n }\n}\n"]}
@@ -12,7 +12,6 @@ declare global {
12
12
  /**
13
13
  * MdOutlinedSegmentedButtonSet is the custom element for the Material
14
14
  * Design outlined segmented button set component.
15
- * @soyCompatible
16
15
  * @final
17
16
  * @suppress {visibility}
18
17
  */
@@ -11,7 +11,6 @@ import { styles as sharedStyles } from './lib/shared-styles.css.js';
11
11
  /**
12
12
  * MdOutlinedSegmentedButtonSet is the custom element for the Material
13
13
  * Design outlined segmented button set component.
14
- * @soyCompatible
15
14
  * @final
16
15
  * @suppress {visibility}
17
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,0BAA0B,EAAC,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;;GAMG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,0BAA0B;;AAC1D,mCAAM,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAD7C,4BAA4B;IADxC,aAAa,CAAC,kCAAkC,CAAC;GACrC,4BAA4B,CAExC;SAFY,4BAA4B","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedSegmentedButtonSet} from './lib/outlined-segmented-button-set.js';\nimport {styles as outlinedStyles} from './lib/outlined-styles.css.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-segmented-button-set': MdOutlinedSegmentedButtonSet;\n }\n}\n\n/**\n * MdOutlinedSegmentedButtonSet is the custom element for the Material\n * Design outlined segmented button set component.\n * @soyCompatible\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-segmented-button-set')\nexport class MdOutlinedSegmentedButtonSet extends OutlinedSegmentedButtonSet {\n static override styles = [sharedStyles, outlinedStyles];\n}\n"]}
1
+ {"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,0BAA0B,EAAC,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;GAKG;AAEI,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,0BAA0B;;AAC1D,mCAAM,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAD7C,4BAA4B;IADxC,aAAa,CAAC,kCAAkC,CAAC;GACrC,4BAA4B,CAExC;SAFY,4BAA4B","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedSegmentedButtonSet} from './lib/outlined-segmented-button-set.js';\nimport {styles as outlinedStyles} from './lib/outlined-styles.css.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-segmented-button-set': MdOutlinedSegmentedButtonSet;\n }\n}\n\n/**\n * MdOutlinedSegmentedButtonSet is the custom element for the Material\n * Design outlined segmented button set component.\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-segmented-button-set')\nexport class MdOutlinedSegmentedButtonSet extends OutlinedSegmentedButtonSet {\n static override styles = [sharedStyles, outlinedStyles];\n}\n"]}
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2023 Google LLC
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ //
5
+
6
+ @forward './lib/filled-select' show theme;
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2023 Google LLC
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ //
5
+
6
+ @forward './lib/outlined-select' show theme;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { FilledSelect } from './lib/filled-select.js';
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'md-filled-select': MdFilledSelect;
10
+ }
11
+ }
12
+ /**
13
+ * @summary
14
+ * Select menus display a list of choices on temporary surfaces and display the
15
+ * currently selected menu item above the menu.
16
+ *
17
+ * @description
18
+ * The select component allows users to choose a value from a fixed list of
19
+ * available options. Composed of an interactive anchor button and a menu, it is
20
+ * analogous to the native HTML `<select>` element. This is the "filled"
21
+ * variant.
22
+ *
23
+ * @example
24
+ * ```html
25
+ * <md-filled-select label="fruits">
26
+ * <!-- An empty selected option will give select an "un-filled" state -->
27
+ * <md-select-option selected></md-select-option>
28
+ * <md-select-option value="apple" headline="Apple"></md-select-option>
29
+ * <md-select-option value="banana" headline="Banana"></md-select-option>
30
+ * <md-select-option value="kiwi" headline="Kiwi"></md-select-option>
31
+ * <md-select-option value="orange" headline="Orange"></md-select-option>
32
+ * <md-select-option value="tomato" headline="Tomato"></md-select-option>
33
+ * </md-filled-select>
34
+ * ```
35
+ *
36
+ * @final
37
+ * @suppress {visibility}
38
+ */
39
+ export declare class MdFilledSelect extends FilledSelect {
40
+ static styles: import("lit").CSSResult[];
41
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { __decorate } from "tslib";
7
+ import { customElement } from 'lit/decorators.js';
8
+ import { styles as filledForcedColorsStyles } from './lib/filled-forced-colors-styles.css.js';
9
+ import { FilledSelect } from './lib/filled-select.js';
10
+ import { styles } from './lib/filled-select-styles.css.js';
11
+ import { styles as sharedStyles } from './lib/shared-styles.css.js';
12
+ /**
13
+ * @summary
14
+ * Select menus display a list of choices on temporary surfaces and display the
15
+ * currently selected menu item above the menu.
16
+ *
17
+ * @description
18
+ * The select component allows users to choose a value from a fixed list of
19
+ * available options. Composed of an interactive anchor button and a menu, it is
20
+ * analogous to the native HTML `<select>` element. This is the "filled"
21
+ * variant.
22
+ *
23
+ * @example
24
+ * ```html
25
+ * <md-filled-select label="fruits">
26
+ * <!-- An empty selected option will give select an "un-filled" state -->
27
+ * <md-select-option selected></md-select-option>
28
+ * <md-select-option value="apple" headline="Apple"></md-select-option>
29
+ * <md-select-option value="banana" headline="Banana"></md-select-option>
30
+ * <md-select-option value="kiwi" headline="Kiwi"></md-select-option>
31
+ * <md-select-option value="orange" headline="Orange"></md-select-option>
32
+ * <md-select-option value="tomato" headline="Tomato"></md-select-option>
33
+ * </md-filled-select>
34
+ * ```
35
+ *
36
+ * @final
37
+ * @suppress {visibility}
38
+ */
39
+ let MdFilledSelect = class MdFilledSelect extends FilledSelect {
40
+ };
41
+ MdFilledSelect.styles = [sharedStyles, styles, filledForcedColorsStyles];
42
+ MdFilledSelect = __decorate([
43
+ customElement('md-filled-select')
44
+ ], MdFilledSelect);
45
+ export { MdFilledSelect };
46
+ //# sourceMappingURL=filled-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filled-select.js","sourceRoot":"","sources":["filled-select.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,MAAM,IAAI,wBAAwB,EAAC,MAAM,0CAA0C,CAAC;AAC5F,OAAO,EAAC,YAAY,EAAC,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AACzD,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEI,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,YAAY;;AAC9B,qBAAM,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAD/D,cAAc;IAD1B,aAAa,CAAC,kBAAkB,CAAC;GACrB,cAAc,CAE1B;SAFY,cAAc","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {styles as filledForcedColorsStyles} from './lib/filled-forced-colors-styles.css.js';\nimport {FilledSelect} from './lib/filled-select.js';\nimport {styles} from './lib/filled-select-styles.css.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-filled-select': MdFilledSelect;\n }\n}\n\n/**\n * @summary\n * Select menus display a list of choices on temporary surfaces and display the\n * currently selected menu item above the menu.\n *\n * @description\n * The select component allows users to choose a value from a fixed list of\n * available options. Composed of an interactive anchor button and a menu, it is\n * analogous to the native HTML `<select>` element. This is the \"filled\"\n * variant.\n *\n * @example\n * ```html\n * <md-filled-select label=\"fruits\">\n * <!-- An empty selected option will give select an \"un-filled\" state -->\n * <md-select-option selected></md-select-option>\n * <md-select-option value=\"apple\" headline=\"Apple\"></md-select-option>\n * <md-select-option value=\"banana\" headline=\"Banana\"></md-select-option>\n * <md-select-option value=\"kiwi\" headline=\"Kiwi\"></md-select-option>\n * <md-select-option value=\"orange\" headline=\"Orange\"></md-select-option>\n * <md-select-option value=\"tomato\" headline=\"Tomato\"></md-select-option>\n * </md-filled-select>\n * ```\n *\n * @final\n * @suppress {visibility}\n */\n@customElement('md-filled-select')\nexport class MdFilledSelect extends FilledSelect {\n static override styles = [sharedStyles, styles, filledForcedColorsStyles];\n}\n"]}