@limetech/lime-elements 35.0.0-next.9 → 35.0.1-next.2

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 (299) hide show
  1. package/dist/cjs/{_arrayIncludesWith-36a6fafb.js → _arrayIncludesWith-29083f83.js} +5 -4
  2. package/dist/cjs/{_assignValue-c9fc3712.js → _assignValue-7c18d8d6.js} +1 -1
  3. package/dist/cjs/_defineProperty-8f56146d.js +13 -0
  4. package/dist/cjs/{_defineProperty-8351e789.js → _getNative-60328036.js} +0 -9
  5. package/dist/cjs/checkbox.template-b6c6562c.js +43 -0
  6. package/dist/cjs/{component-f7ef9087.js → component-66df95e7.js} +190 -132
  7. package/dist/cjs/{component-f532119f.js → component-67144c1c.js} +47 -3
  8. package/dist/cjs/{component-ed21410d.js → component-ae3bfacf.js} +367 -235
  9. package/dist/cjs/{component-2faaa141.js → component-cf490570.js} +213 -143
  10. package/dist/cjs/{component-10dbdd60.js → component-dd795ff0.js} +7 -5
  11. package/dist/cjs/{dateFormatter-26eac73a.js → dateFormatter-05d80b12.js} +37 -31
  12. package/dist/cjs/identity-6dc34885.js +44 -0
  13. package/dist/cjs/{index-e63a89d7.js → index-2a28697b.js} +27 -1
  14. package/dist/cjs/{isEqual-e3b9c27c.js → isEqual-d2a13a24.js} +13 -55
  15. package/dist/cjs/lime-elements.cjs.js +3 -3
  16. package/dist/cjs/limel-badge.cjs.entry.js +4 -4
  17. package/dist/cjs/limel-banner.cjs.entry.js +2 -2
  18. package/dist/cjs/limel-button-group.cjs.entry.js +3 -3
  19. package/dist/cjs/limel-button.cjs.entry.js +3 -3
  20. package/dist/cjs/limel-checkbox.cjs.entry.js +136 -90
  21. package/dist/cjs/limel-chip-set.cjs.entry.js +235 -191
  22. package/dist/cjs/limel-circular-progress.cjs.entry.js +3 -3
  23. package/dist/cjs/limel-code-editor.cjs.entry.js +51 -24
  24. package/dist/cjs/limel-collapsible-section.cjs.entry.js +2 -2
  25. package/dist/cjs/limel-color-picker-palette_2.cjs.entry.js +7 -6
  26. package/dist/cjs/limel-color-picker.cjs.entry.js +2 -2
  27. package/dist/cjs/limel-config.cjs.entry.js +2 -2
  28. package/dist/cjs/limel-date-picker.cjs.entry.js +8 -8
  29. package/dist/cjs/limel-dialog.cjs.entry.js +35 -19
  30. package/dist/cjs/limel-file.cjs.entry.js +11 -9
  31. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +987 -669
  32. package/dist/cjs/limel-flex-container.cjs.entry.js +6 -2
  33. package/dist/cjs/limel-form.cjs.entry.js +19985 -20009
  34. package/dist/cjs/limel-grid.cjs.entry.js +2 -2
  35. package/dist/cjs/limel-header.cjs.entry.js +2 -2
  36. package/dist/cjs/limel-icon-button.cjs.entry.js +6 -6
  37. package/dist/cjs/limel-icon.cjs.entry.js +2 -2
  38. package/dist/cjs/limel-input-field.cjs.entry.js +12 -10
  39. package/dist/cjs/limel-linear-progress.cjs.entry.js +4 -4
  40. package/dist/cjs/limel-list_3.cjs.entry.js +154 -91
  41. package/dist/cjs/limel-menu-list.cjs.entry.js +87 -74
  42. package/dist/cjs/limel-menu.cjs.entry.js +6 -5
  43. package/dist/cjs/limel-picker.cjs.entry.js +6 -8
  44. package/dist/cjs/limel-popover-surface.cjs.entry.js +3 -3
  45. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +2 -2
  46. package/dist/cjs/limel-progress-flow.cjs.entry.js +2 -2
  47. package/dist/cjs/limel-select.cjs.entry.js +6 -6
  48. package/dist/cjs/limel-slider.cjs.entry.js +34 -7
  49. package/dist/cjs/limel-snackbar.cjs.entry.js +79 -73
  50. package/dist/cjs/limel-spinner.cjs.entry.js +2 -2
  51. package/dist/cjs/limel-switch.cjs.entry.js +498 -202
  52. package/dist/cjs/limel-tab-bar.cjs.entry.js +269 -190
  53. package/dist/cjs/limel-tab-panel.cjs.entry.js +2 -2
  54. package/dist/cjs/limel-table.cjs.entry.js +79 -17
  55. package/dist/cjs/limel-tooltip_2.cjs.entry.js +3 -3
  56. package/dist/cjs/loader.cjs.js +3 -3
  57. package/dist/cjs/{moment-d287c0ed.js → moment-5cfac5cd.js} +94 -79
  58. package/dist/cjs/{pickBy-88b0430a.js → pickBy-3ef47bf2.js} +6 -5
  59. package/dist/cjs/{zipObject-4050a45f.js → zipObject-93a471fa.js} +1 -1
  60. package/dist/collection/collection-manifest.json +2 -2
  61. package/dist/collection/components/badge/badge.css +9 -15
  62. package/dist/collection/components/badge/badge.js +2 -2
  63. package/dist/collection/components/button/button.css +333 -145
  64. package/dist/collection/components/button-group/button-group.css +30 -5
  65. package/dist/collection/components/checkbox/checkbox.css +71 -20
  66. package/dist/collection/components/checkbox/checkbox.js +5 -4
  67. package/dist/collection/components/checkbox/checkbox.template.js +24 -20
  68. package/dist/collection/components/chip-set/chip-set.css +367 -34
  69. package/dist/collection/components/circular-progress/circular-progress.css +2 -2
  70. package/dist/collection/components/code-editor/code-editor.css +8 -13
  71. package/dist/collection/components/date-picker/flatpickr-adapter/flatpickr-adapter.css +1 -1
  72. package/dist/collection/components/dialog/dialog.css +153 -109
  73. package/dist/collection/components/dialog/dialog.js +36 -11
  74. package/dist/collection/components/file/icon-background-colors.js +2 -1
  75. package/dist/collection/components/file/icon-fill-colors.js +2 -1
  76. package/dist/collection/components/file/icons.js +1 -1
  77. package/dist/collection/components/flex-container/flex-container.js +10 -0
  78. package/dist/collection/components/form/fields/schema-field.js +0 -1
  79. package/dist/collection/components/form/form.css +5 -1
  80. package/dist/collection/components/form/form.js +34 -0
  81. package/dist/collection/components/form/form.types.js +0 -1
  82. package/dist/collection/components/form/templates/common.js +4 -1
  83. package/dist/collection/components/icon-button/icon-button.css +116 -59
  84. package/dist/collection/components/icon-button/icon-button.js +1 -0
  85. package/dist/collection/components/input-field/input-field.css +344 -29
  86. package/dist/collection/components/input-field/input-field.js +5 -3
  87. package/dist/collection/components/linear-progress/linear-progress.css +14 -2
  88. package/dist/collection/components/list/list-renderer.js +1 -4
  89. package/dist/collection/components/list/list.css +938 -93
  90. package/dist/collection/components/list/list.js +13 -6
  91. package/dist/collection/components/menu-list/menu-list-renderer.js +1 -4
  92. package/dist/collection/components/menu-list/menu-list.css +938 -93
  93. package/dist/collection/components/menu-surface/menu-surface.css +31 -7
  94. package/dist/collection/components/picker/picker.js +6 -7
  95. package/dist/collection/components/popover-surface/popover-surface.css +1 -0
  96. package/dist/collection/components/select/select.css +424 -17
  97. package/dist/collection/components/select/select.template.js +1 -1
  98. package/dist/collection/components/slider/slider.css +49 -2
  99. package/dist/collection/components/snackbar/snackbar.css +588 -301
  100. package/dist/collection/components/switch/switch.css +592 -222
  101. package/dist/collection/components/switch/switch.js +18 -12
  102. package/dist/collection/components/tab-bar/tab-bar.css +77 -48
  103. package/dist/collection/components/table/table.css +219 -165
  104. package/dist/collection/components/table/table.js +99 -15
  105. package/dist/collection/components/table/table.types.js +0 -1
  106. package/dist/collection/style/functions.scss +3 -1
  107. package/dist/collection/style/internal/lime-theme.scss +30 -31
  108. package/dist/collection/style/internal/lime-typography.scss +55 -56
  109. package/dist/esm/{_arrayIncludesWith-b5d3fd9e.js → _arrayIncludesWith-969bccda.js} +4 -3
  110. package/dist/esm/{_assignValue-08fe10bc.js → _assignValue-fb2bf80a.js} +1 -1
  111. package/dist/esm/_defineProperty-2105cb48.js +11 -0
  112. package/dist/esm/{_defineProperty-8c869077.js → _getNative-93d6bfe9.js} +1 -9
  113. package/dist/esm/checkbox.template-2f1bbc98.js +41 -0
  114. package/dist/esm/{component-89e0ce26.js → component-19eb6e2b.js} +7 -5
  115. package/dist/esm/{component-2630c3d7.js → component-288691f3.js} +367 -235
  116. package/dist/esm/{component-d682c974.js → component-410aad5a.js} +44 -4
  117. package/dist/esm/{component-429e92ee.js → component-5b4ac85a.js} +213 -143
  118. package/dist/esm/{component-834d85a1.js → component-fffa3419.js} +190 -132
  119. package/dist/esm/{dateFormatter-c9b41548.js → dateFormatter-2cad0292.js} +37 -31
  120. package/dist/esm/identity-87aa3962.js +41 -0
  121. package/dist/esm/{index-2316f345.js → index-11cd0b60.js} +27 -1
  122. package/dist/esm/{isArrayLike-dd37ba9a.js → isArrayLike-385e0f31.js} +1 -1
  123. package/dist/esm/{isEqual-4f22635f.js → isEqual-c5a636a4.js} +3 -43
  124. package/dist/esm/lime-elements.js +3 -3
  125. package/dist/esm/limel-badge.entry.js +4 -4
  126. package/dist/esm/limel-banner.entry.js +2 -2
  127. package/dist/esm/limel-button-group.entry.js +3 -3
  128. package/dist/esm/limel-button.entry.js +3 -3
  129. package/dist/esm/limel-checkbox.entry.js +136 -90
  130. package/dist/esm/limel-chip-set.entry.js +235 -191
  131. package/dist/esm/limel-circular-progress.entry.js +3 -3
  132. package/dist/esm/limel-code-editor.entry.js +51 -24
  133. package/dist/esm/limel-collapsible-section.entry.js +2 -2
  134. package/dist/esm/limel-color-picker-palette_2.entry.js +7 -6
  135. package/dist/esm/limel-color-picker.entry.js +2 -2
  136. package/dist/esm/limel-config.entry.js +2 -2
  137. package/dist/esm/limel-date-picker.entry.js +8 -8
  138. package/dist/esm/limel-dialog.entry.js +35 -19
  139. package/dist/esm/limel-file.entry.js +11 -9
  140. package/dist/esm/limel-flatpickr-adapter.entry.js +988 -670
  141. package/dist/esm/limel-flex-container.entry.js +6 -2
  142. package/dist/esm/limel-form.entry.js +19966 -19990
  143. package/dist/esm/limel-grid.entry.js +2 -2
  144. package/dist/esm/limel-header.entry.js +2 -2
  145. package/dist/esm/limel-icon-button.entry.js +6 -6
  146. package/dist/esm/limel-icon.entry.js +2 -2
  147. package/dist/esm/limel-input-field.entry.js +12 -10
  148. package/dist/esm/limel-linear-progress.entry.js +4 -4
  149. package/dist/esm/limel-list_3.entry.js +154 -91
  150. package/dist/esm/limel-menu-list.entry.js +87 -74
  151. package/dist/esm/limel-menu.entry.js +6 -5
  152. package/dist/esm/limel-picker.entry.js +6 -8
  153. package/dist/esm/limel-popover-surface.entry.js +3 -3
  154. package/dist/esm/limel-progress-flow-item.entry.js +2 -2
  155. package/dist/esm/limel-progress-flow.entry.js +2 -2
  156. package/dist/esm/limel-select.entry.js +6 -6
  157. package/dist/esm/limel-slider.entry.js +34 -7
  158. package/dist/esm/limel-snackbar.entry.js +79 -73
  159. package/dist/esm/limel-spinner.entry.js +2 -2
  160. package/dist/esm/limel-switch.entry.js +498 -202
  161. package/dist/esm/limel-tab-bar.entry.js +269 -190
  162. package/dist/esm/limel-tab-panel.entry.js +2 -2
  163. package/dist/esm/limel-table.entry.js +80 -18
  164. package/dist/esm/limel-tooltip_2.entry.js +3 -3
  165. package/dist/esm/loader.js +3 -3
  166. package/dist/esm/{moment-8dadd938.js → moment-367e51c5.js} +94 -79
  167. package/dist/esm/{pickBy-8a849e46.js → pickBy-d359eb12.js} +4 -3
  168. package/dist/esm/polyfills/css-shim.js +1 -1
  169. package/dist/esm/{zipObject-22e88ce9.js → zipObject-2bb1968e.js} +1 -1
  170. package/dist/lime-elements/lime-elements.esm.js +1 -1
  171. package/dist/lime-elements/p-101af376.entry.js +1 -0
  172. package/dist/lime-elements/p-1a9a961a.entry.js +11 -0
  173. package/dist/lime-elements/p-1c284626.js +73 -0
  174. package/dist/lime-elements/p-1ede893b.js +1 -0
  175. package/dist/lime-elements/p-2639edf9.entry.js +73 -0
  176. package/dist/lime-elements/p-2754e134.entry.js +1 -0
  177. package/dist/lime-elements/p-2da6e2a3.entry.js +1 -0
  178. package/dist/lime-elements/p-36ecbd03.entry.js +1 -0
  179. package/dist/lime-elements/p-3af5f9ad.js +3 -0
  180. package/dist/lime-elements/p-404e1465.entry.js +1 -0
  181. package/dist/lime-elements/p-42b67933.entry.js +1 -0
  182. package/dist/lime-elements/p-440454ed.entry.js +1 -0
  183. package/dist/lime-elements/{p-076bd4dc.js → p-48d4ef20.js} +3 -3
  184. package/dist/lime-elements/p-4c3358cb.js +1 -0
  185. package/dist/lime-elements/p-4d5a874a.entry.js +1 -0
  186. package/dist/lime-elements/p-53e01330.entry.js +1 -0
  187. package/dist/lime-elements/p-5908c21d.entry.js +1 -0
  188. package/dist/lime-elements/p-5fdb83c9.js +1 -0
  189. package/dist/lime-elements/p-63e25a0a.entry.js +1 -0
  190. package/dist/lime-elements/p-669626e5.js +1 -0
  191. package/dist/lime-elements/p-6966b5df.entry.js +1 -0
  192. package/dist/lime-elements/p-6e7809a6.entry.js +1 -0
  193. package/dist/lime-elements/p-705334c1.entry.js +1 -0
  194. package/dist/lime-elements/p-71efe2ca.entry.js +37 -0
  195. package/dist/lime-elements/p-7cda574b.js +1 -0
  196. package/dist/lime-elements/p-83ea517b.entry.js +1 -0
  197. package/dist/lime-elements/p-84f933f7.entry.js +16 -0
  198. package/dist/lime-elements/p-8827628d.entry.js +131 -0
  199. package/dist/lime-elements/{p-8ad5e143.entry.js → p-94899019.entry.js} +1 -1
  200. package/dist/lime-elements/p-95f275ab.entry.js +1 -0
  201. package/dist/lime-elements/p-97d6c4a6.entry.js +1 -0
  202. package/dist/lime-elements/{p-7f43b0c4.js → p-9acf7b5d.js} +1 -1
  203. package/dist/lime-elements/p-a465084b.entry.js +82 -0
  204. package/dist/lime-elements/p-a5af84a7.entry.js +1 -0
  205. package/dist/lime-elements/p-ad8cb388.js +1 -0
  206. package/dist/lime-elements/p-ade76f1d.js +1 -0
  207. package/dist/lime-elements/p-af0ec482.entry.js +16 -0
  208. package/dist/lime-elements/{p-090bc949.js → p-b28128d2.js} +1 -1
  209. package/dist/lime-elements/p-b91dc1ef.entry.js +1 -0
  210. package/dist/lime-elements/p-b95e80c9.entry.js +1 -0
  211. package/dist/lime-elements/p-bd8c9384.entry.js +1 -0
  212. package/dist/lime-elements/p-c7953a05.entry.js +82 -0
  213. package/dist/lime-elements/p-c80acfb2.entry.js +59 -0
  214. package/dist/lime-elements/p-cbc43682.js +81 -0
  215. package/dist/lime-elements/{p-ace9affc.js → p-d0a7de87.js} +2 -2
  216. package/dist/lime-elements/p-d1ee4501.entry.js +37 -0
  217. package/dist/lime-elements/p-d74fa89e.entry.js +1 -0
  218. package/dist/lime-elements/{p-e1928c0e.js → p-d76f896d.js} +1 -1
  219. package/dist/lime-elements/p-dfba92de.js +126 -0
  220. package/dist/lime-elements/p-dfbe015e.entry.js +1 -0
  221. package/dist/lime-elements/p-e80dd2ff.entry.js +1 -0
  222. package/dist/lime-elements/p-e83dddcd.entry.js +126 -0
  223. package/dist/lime-elements/p-e98d76e8.entry.js +59 -0
  224. package/dist/lime-elements/{p-92146da6.js → p-e9a95b8f.js} +1 -1
  225. package/dist/lime-elements/p-ed65468d.entry.js +1 -0
  226. package/dist/lime-elements/p-f0c9dadd.entry.js +1 -0
  227. package/dist/lime-elements/p-f9bfbeb3.entry.js +82 -0
  228. package/dist/lime-elements/p-fa607ed3.js +1 -0
  229. package/dist/lime-elements/style/functions.scss +3 -1
  230. package/dist/lime-elements/style/internal/lime-theme.scss +30 -31
  231. package/dist/lime-elements/style/internal/lime-typography.scss +55 -56
  232. package/dist/types/components/badge/badge.d.ts +1 -1
  233. package/dist/types/components/checkbox/checkbox.d.ts +3 -2
  234. package/dist/types/components/checkbox/checkbox.template.d.ts +1 -0
  235. package/dist/types/components/dialog/dialog.d.ts +11 -5
  236. package/dist/types/components/dialog/dialog.types.d.ts +4 -0
  237. package/dist/types/components/flex-container/flex-container.d.ts +7 -0
  238. package/dist/types/components/form/fields/array-field.d.ts +0 -1
  239. package/dist/types/components/form/fields/object-field.d.ts +2 -2
  240. package/dist/types/components/form/form.d.ts +8 -1
  241. package/dist/types/components/form/form.types.d.ts +6 -0
  242. package/dist/types/components/picker/picker.d.ts +2 -1
  243. package/dist/types/components/switch/switch.d.ts +2 -2
  244. package/dist/types/components/table/table.d.ts +10 -1
  245. package/dist/types/components/table/table.types.d.ts +13 -0
  246. package/dist/types/components.d.ts +23 -7
  247. package/dist/types/stencil-public-runtime.d.ts +6 -4
  248. package/package.json +31 -44
  249. package/dist/cjs/checkbox.template-50eb8b76.js +0 -39
  250. package/dist/esm/checkbox.template-50f7c07b.js +0 -37
  251. package/dist/lime-elements/p-041ae00c.entry.js +0 -1
  252. package/dist/lime-elements/p-0ce9165f.entry.js +0 -1
  253. package/dist/lime-elements/p-0fd208f3.entry.js +0 -82
  254. package/dist/lime-elements/p-143705b1.entry.js +0 -1
  255. package/dist/lime-elements/p-1876a96a.entry.js +0 -1
  256. package/dist/lime-elements/p-1a64b531.js +0 -1
  257. package/dist/lime-elements/p-1fb5340d.entry.js +0 -1
  258. package/dist/lime-elements/p-250f55be.js +0 -1
  259. package/dist/lime-elements/p-29f054cc.entry.js +0 -37
  260. package/dist/lime-elements/p-31fecf5d.entry.js +0 -1
  261. package/dist/lime-elements/p-34c7872e.entry.js +0 -1
  262. package/dist/lime-elements/p-379955f4.js +0 -1
  263. package/dist/lime-elements/p-3ae6bb75.entry.js +0 -82
  264. package/dist/lime-elements/p-3ae6dfba.entry.js +0 -73
  265. package/dist/lime-elements/p-426d11b4.js +0 -1
  266. package/dist/lime-elements/p-440084ea.js +0 -1
  267. package/dist/lime-elements/p-468e940e.entry.js +0 -16
  268. package/dist/lime-elements/p-4932c029.entry.js +0 -1
  269. package/dist/lime-elements/p-4b5af81b.entry.js +0 -1
  270. package/dist/lime-elements/p-510bb5a4.entry.js +0 -1
  271. package/dist/lime-elements/p-58cbe99d.entry.js +0 -1
  272. package/dist/lime-elements/p-597cbe05.entry.js +0 -1
  273. package/dist/lime-elements/p-6003f817.entry.js +0 -1
  274. package/dist/lime-elements/p-668795a7.js +0 -73
  275. package/dist/lime-elements/p-714fde78.entry.js +0 -1
  276. package/dist/lime-elements/p-7476efe0.entry.js +0 -1
  277. package/dist/lime-elements/p-887d5bda.entry.js +0 -1
  278. package/dist/lime-elements/p-8a2c1038.entry.js +0 -16
  279. package/dist/lime-elements/p-902347b9.js +0 -81
  280. package/dist/lime-elements/p-90c6fa15.js +0 -126
  281. package/dist/lime-elements/p-90f3e17c.entry.js +0 -37
  282. package/dist/lime-elements/p-a2cf74c1.entry.js +0 -1
  283. package/dist/lime-elements/p-a397bab7.js +0 -3
  284. package/dist/lime-elements/p-a4c532a7.entry.js +0 -1
  285. package/dist/lime-elements/p-be56ffab.entry.js +0 -1
  286. package/dist/lime-elements/p-c306c953.entry.js +0 -1
  287. package/dist/lime-elements/p-c35874db.entry.js +0 -1
  288. package/dist/lime-elements/p-c8c8a946.entry.js +0 -59
  289. package/dist/lime-elements/p-ca664c9f.entry.js +0 -1
  290. package/dist/lime-elements/p-d2c74396.entry.js +0 -1
  291. package/dist/lime-elements/p-d48ad9f7.entry.js +0 -126
  292. package/dist/lime-elements/p-d93a3b07.entry.js +0 -16
  293. package/dist/lime-elements/p-df8faeb4.entry.js +0 -59
  294. package/dist/lime-elements/p-dfe0a58b.entry.js +0 -1
  295. package/dist/lime-elements/p-e275f502.entry.js +0 -37
  296. package/dist/lime-elements/p-e881e98d.entry.js +0 -1
  297. package/dist/lime-elements/p-f2c706b8.entry.js +0 -131
  298. package/dist/lime-elements/p-f83213b8.js +0 -1
  299. package/dist/lime-elements/p-fc30b8e3.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const component = require('./component-f532119f.js');
3
+ const component = require('./component-67144c1c.js');
4
4
  const ponyfill = require('./ponyfill-98ca4766.js');
5
5
  const keyboard = require('./keyboard-9477d3a8.js');
6
6
  const util = require('./util-b0f5741e.js');
@@ -56,10 +56,23 @@ var numbers$1 = {
56
56
  TRANSITION_OPEN_DURATION: 120,
57
57
  /** Total duration of menu-surface close animation. */
58
58
  TRANSITION_CLOSE_DURATION: 75,
59
- /** Margin left to the edge of the viewport when menu-surface is at maximum possible height. Also used as a viewport margin. */
59
+ /**
60
+ * Margin left to the edge of the viewport when menu-surface is at maximum
61
+ * possible height. Also used as a viewport margin.
62
+ */
60
63
  MARGIN_TO_EDGE: 32,
61
- /** Ratio of anchor width to menu-surface width for switching from corner positioning to center positioning. */
64
+ /**
65
+ * Ratio of anchor width to menu-surface width for switching from corner
66
+ * positioning to center positioning.
67
+ */
62
68
  ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67,
69
+ /**
70
+ * Amount of time to wait before restoring focus when closing the menu
71
+ * surface. This is important because if a touch event triggered the menu
72
+ * close, and the subsequent mouse event occurs after focus is restored, then
73
+ * the restored focus would be lost.
74
+ */
75
+ TOUCH_EVENT_WAIT_MS: 30,
63
76
  };
64
77
  /**
65
78
  * Enum for bits in the {@see Corner) bitmap.
@@ -558,16 +571,16 @@ var MDCListFoundation = /** @class */ (function (_super) {
558
571
  __extends$1(MDCListFoundation, _super);
559
572
  function MDCListFoundation(adapter) {
560
573
  var _this = _super.call(this, __assign$1(__assign$1({}, MDCListFoundation.defaultAdapter), adapter)) || this;
561
- _this.wrapFocus_ = false;
562
- _this.isVertical_ = true;
563
- _this.isSingleSelectionList_ = false;
564
- _this.selectedIndex_ = numbers.UNSET_INDEX;
574
+ _this.wrapFocus = false;
575
+ _this.isVertical = true;
576
+ _this.isSingleSelectionList = false;
577
+ _this.selectedIndex = numbers.UNSET_INDEX;
565
578
  _this.focusedItemIndex = numbers.UNSET_INDEX;
566
- _this.useActivatedClass_ = false;
567
- _this.useSelectedAttr_ = false;
568
- _this.ariaCurrentAttrValue_ = null;
569
- _this.isCheckboxList_ = false;
570
- _this.isRadioList_ = false;
579
+ _this.useActivatedClass = false;
580
+ _this.useSelectedAttr = false;
581
+ _this.ariaCurrentAttrValue = null;
582
+ _this.isCheckboxList = false;
583
+ _this.isRadioList = false;
571
584
  _this.hasTypeahead = false;
572
585
  // Transiently holds current typeahead prefix from user.
573
586
  _this.typeaheadState = initState();
@@ -626,10 +639,10 @@ var MDCListFoundation = /** @class */ (function (_super) {
626
639
  }
627
640
  // TODO(b/172274142): consider all items when determining the list's type.
628
641
  if (this.adapter.hasCheckboxAtIndex(0)) {
629
- this.isCheckboxList_ = true;
642
+ this.isCheckboxList = true;
630
643
  }
631
644
  else if (this.adapter.hasRadioAtIndex(0)) {
632
- this.isRadioList_ = true;
645
+ this.isRadioList = true;
633
646
  }
634
647
  else {
635
648
  this.maybeInitializeSingleSelection();
@@ -638,25 +651,27 @@ var MDCListFoundation = /** @class */ (function (_super) {
638
651
  this.sortedIndexByFirstChar = this.typeaheadInitSortedIndex();
639
652
  }
640
653
  };
641
- /**
642
- * Sets the private wrapFocus_ variable.
643
- */
654
+ /** Returns the index of the item that was last focused. */
655
+ MDCListFoundation.prototype.getFocusedItemIndex = function () {
656
+ return this.focusedItemIndex;
657
+ };
658
+ /** Toggles focus wrapping with keyboard navigation. */
644
659
  MDCListFoundation.prototype.setWrapFocus = function (value) {
645
- this.wrapFocus_ = value;
660
+ this.wrapFocus = value;
646
661
  };
647
662
  /**
648
- * Sets the isVertical_ private variable.
663
+ * Toggles orientation direction for keyboard navigation (true for vertical,
664
+ * false for horizontal).
649
665
  */
650
666
  MDCListFoundation.prototype.setVerticalOrientation = function (value) {
651
- this.isVertical_ = value;
667
+ this.isVertical = value;
652
668
  };
653
- /**
654
- * Sets the isSingleSelectionList_ private variable.
655
- */
669
+ /** Toggles single-selection behavior. */
656
670
  MDCListFoundation.prototype.setSingleSelection = function (value) {
657
- this.isSingleSelectionList_ = value;
671
+ this.isSingleSelectionList = value;
658
672
  if (value) {
659
673
  this.maybeInitializeSingleSelection();
674
+ this.selectedIndex = this.getSelectedIndexFromDOM();
660
675
  }
661
676
  };
662
677
  /**
@@ -664,6 +679,19 @@ var MDCListFoundation = /** @class */ (function (_super) {
664
679
  * initializes the internal state to match the selected item.
665
680
  */
666
681
  MDCListFoundation.prototype.maybeInitializeSingleSelection = function () {
682
+ var selectedItemIndex = this.getSelectedIndexFromDOM();
683
+ if (selectedItemIndex === numbers.UNSET_INDEX)
684
+ return;
685
+ var hasActivatedClass = this.adapter.listItemAtIndexHasClass(selectedItemIndex, cssClasses.LIST_ITEM_ACTIVATED_CLASS);
686
+ if (hasActivatedClass) {
687
+ this.setUseActivatedClass(true);
688
+ }
689
+ this.isSingleSelectionList = true;
690
+ this.selectedIndex = selectedItemIndex;
691
+ };
692
+ /** @return Index of the first selected item based on the DOM state. */
693
+ MDCListFoundation.prototype.getSelectedIndexFromDOM = function () {
694
+ var selectedIndex = numbers.UNSET_INDEX;
667
695
  var listItemsCount = this.adapter.getListItemCount();
668
696
  for (var i = 0; i < listItemsCount; i++) {
669
697
  var hasSelectedClass = this.adapter.listItemAtIndexHasClass(i, cssClasses.LIST_ITEM_SELECTED_CLASS);
@@ -671,13 +699,10 @@ var MDCListFoundation = /** @class */ (function (_super) {
671
699
  if (!(hasSelectedClass || hasActivatedClass)) {
672
700
  continue;
673
701
  }
674
- if (hasActivatedClass) {
675
- this.setUseActivatedClass(true);
676
- }
677
- this.isSingleSelectionList_ = true;
678
- this.selectedIndex_ = i;
679
- return;
702
+ selectedIndex = i;
703
+ break;
680
704
  }
705
+ return selectedIndex;
681
706
  };
682
707
  /**
683
708
  * Sets whether typeahead is enabled on the list.
@@ -696,39 +721,39 @@ var MDCListFoundation = /** @class */ (function (_super) {
696
721
  return this.hasTypeahead &&
697
722
  isTypingInProgress(this.typeaheadState);
698
723
  };
699
- /**
700
- * Sets the useActivatedClass_ private variable.
701
- */
724
+ /** Toggle use of the "activated" CSS class. */
702
725
  MDCListFoundation.prototype.setUseActivatedClass = function (useActivated) {
703
- this.useActivatedClass_ = useActivated;
726
+ this.useActivatedClass = useActivated;
704
727
  };
705
728
  /**
706
- * Sets the useSelectedAttr_ private variable.
729
+ * Toggles use of the selected attribute (true for aria-selected, false for
730
+ * aria-checked).
707
731
  */
708
732
  MDCListFoundation.prototype.setUseSelectedAttribute = function (useSelected) {
709
- this.useSelectedAttr_ = useSelected;
733
+ this.useSelectedAttr = useSelected;
710
734
  };
711
735
  MDCListFoundation.prototype.getSelectedIndex = function () {
712
- return this.selectedIndex_;
736
+ return this.selectedIndex;
713
737
  };
714
- MDCListFoundation.prototype.setSelectedIndex = function (index) {
715
- if (!this.isIndexValid_(index)) {
738
+ MDCListFoundation.prototype.setSelectedIndex = function (index, _a) {
739
+ var _b = _a === void 0 ? {} : _a, forceUpdate = _b.forceUpdate;
740
+ if (!this.isIndexValid(index)) {
716
741
  return;
717
742
  }
718
- if (this.isCheckboxList_) {
719
- this.setCheckboxAtIndex_(index);
743
+ if (this.isCheckboxList) {
744
+ this.setCheckboxAtIndex(index);
720
745
  }
721
- else if (this.isRadioList_) {
722
- this.setRadioAtIndex_(index);
746
+ else if (this.isRadioList) {
747
+ this.setRadioAtIndex(index);
723
748
  }
724
749
  else {
725
- this.setSingleSelectionAtIndex_(index);
750
+ this.setSingleSelectionAtIndex(index, { forceUpdate: forceUpdate });
726
751
  }
727
752
  };
728
753
  /**
729
754
  * Focus in handler for the list items.
730
755
  */
731
- MDCListFoundation.prototype.handleFocusIn = function (_, listItemIndex) {
756
+ MDCListFoundation.prototype.handleFocusIn = function (listItemIndex) {
732
757
  if (listItemIndex >= 0) {
733
758
  this.focusedItemIndex = listItemIndex;
734
759
  this.adapter.setAttributeForElementIndex(listItemIndex, 'tabindex', '0');
@@ -738,7 +763,7 @@ var MDCListFoundation = /** @class */ (function (_super) {
738
763
  /**
739
764
  * Focus out handler for the list items.
740
765
  */
741
- MDCListFoundation.prototype.handleFocusOut = function (_, listItemIndex) {
766
+ MDCListFoundation.prototype.handleFocusOut = function (listItemIndex) {
742
767
  var _this = this;
743
768
  if (listItemIndex >= 0) {
744
769
  this.adapter.setAttributeForElementIndex(listItemIndex, 'tabindex', '-1');
@@ -767,7 +792,8 @@ var MDCListFoundation = /** @class */ (function (_super) {
767
792
  var isEnd = keyboard.normalizeKey(event) === 'End';
768
793
  var isEnter = keyboard.normalizeKey(event) === 'Enter';
769
794
  var isSpace = keyboard.normalizeKey(event) === 'Spacebar';
770
- // Have to check both upper and lower case, because having caps lock on affects the value.
795
+ // Have to check both upper and lower case, because having caps lock on
796
+ // affects the value.
771
797
  var isLetterA = event.key === 'A' || event.key === 'a';
772
798
  if (this.adapter.isRootFocused()) {
773
799
  if (isArrowUp || isEnd) {
@@ -804,12 +830,12 @@ var MDCListFoundation = /** @class */ (function (_super) {
804
830
  return;
805
831
  }
806
832
  }
807
- if ((this.isVertical_ && isArrowDown) ||
808
- (!this.isVertical_ && isArrowRight)) {
833
+ if ((this.isVertical && isArrowDown) ||
834
+ (!this.isVertical && isArrowRight)) {
809
835
  preventDefaultEvent(event);
810
836
  this.focusNextElement(currentIndex);
811
837
  }
812
- else if ((this.isVertical_ && isArrowUp) || (!this.isVertical_ && isArrowLeft)) {
838
+ else if ((this.isVertical && isArrowUp) || (!this.isVertical && isArrowLeft)) {
813
839
  preventDefaultEvent(event);
814
840
  this.focusPrevElement(currentIndex);
815
841
  }
@@ -821,9 +847,11 @@ var MDCListFoundation = /** @class */ (function (_super) {
821
847
  preventDefaultEvent(event);
822
848
  this.focusLastElement();
823
849
  }
824
- else if (isLetterA && event.ctrlKey && this.isCheckboxList_) {
850
+ else if (isLetterA && event.ctrlKey && this.isCheckboxList) {
825
851
  event.preventDefault();
826
- this.toggleAll(this.selectedIndex_ === numbers.UNSET_INDEX ? [] : this.selectedIndex_);
852
+ this.toggleAll(this.selectedIndex === numbers.UNSET_INDEX ?
853
+ [] :
854
+ this.selectedIndex);
827
855
  }
828
856
  else if (isEnter || isSpace) {
829
857
  if (isRootListItem) {
@@ -838,8 +866,8 @@ var MDCListFoundation = /** @class */ (function (_super) {
838
866
  return;
839
867
  }
840
868
  if (!this.isTypeaheadInProgress()) {
841
- if (this.isSelectableList_()) {
842
- this.setSelectedIndexOnAction_(currentIndex);
869
+ if (this.isSelectableList()) {
870
+ this.setSelectedIndexOnAction(currentIndex);
843
871
  }
844
872
  this.adapter.notifyAction(currentIndex);
845
873
  }
@@ -869,8 +897,8 @@ var MDCListFoundation = /** @class */ (function (_super) {
869
897
  if (this.adapter.listItemAtIndexHasClass(index, cssClasses.LIST_ITEM_DISABLED_CLASS)) {
870
898
  return;
871
899
  }
872
- if (this.isSelectableList_()) {
873
- this.setSelectedIndexOnAction_(index, toggleCheckbox);
900
+ if (this.isSelectableList()) {
901
+ this.setSelectedIndexOnAction(index, toggleCheckbox);
874
902
  }
875
903
  this.adapter.notifyAction(index);
876
904
  };
@@ -881,7 +909,7 @@ var MDCListFoundation = /** @class */ (function (_super) {
881
909
  var count = this.adapter.getListItemCount();
882
910
  var nextIndex = index + 1;
883
911
  if (nextIndex >= count) {
884
- if (this.wrapFocus_) {
912
+ if (this.wrapFocus) {
885
913
  nextIndex = 0;
886
914
  }
887
915
  else {
@@ -898,7 +926,7 @@ var MDCListFoundation = /** @class */ (function (_super) {
898
926
  MDCListFoundation.prototype.focusPrevElement = function (index) {
899
927
  var prevIndex = index - 1;
900
928
  if (prevIndex < 0) {
901
- if (this.wrapFocus_) {
929
+ if (this.wrapFocus) {
902
930
  prevIndex = this.adapter.getListItemCount() - 1;
903
931
  }
904
932
  else {
@@ -928,7 +956,7 @@ var MDCListFoundation = /** @class */ (function (_super) {
928
956
  * @param isEnabled Sets the list item to enabled or disabled.
929
957
  */
930
958
  MDCListFoundation.prototype.setEnabled = function (itemIndex, isEnabled) {
931
- if (!this.isIndexValid_(itemIndex)) {
959
+ if (!this.isIndexValid(itemIndex)) {
932
960
  return;
933
961
  }
934
962
  if (isEnabled) {
@@ -940,41 +968,42 @@ var MDCListFoundation = /** @class */ (function (_super) {
940
968
  this.adapter.setAttributeForElementIndex(itemIndex, strings.ARIA_DISABLED, 'true');
941
969
  }
942
970
  };
943
- MDCListFoundation.prototype.setSingleSelectionAtIndex_ = function (index) {
944
- if (this.selectedIndex_ === index) {
971
+ MDCListFoundation.prototype.setSingleSelectionAtIndex = function (index, _a) {
972
+ var _b = _a === void 0 ? {} : _a, forceUpdate = _b.forceUpdate;
973
+ if (this.selectedIndex === index && !forceUpdate) {
945
974
  return;
946
975
  }
947
976
  var selectedClassName = cssClasses.LIST_ITEM_SELECTED_CLASS;
948
- if (this.useActivatedClass_) {
977
+ if (this.useActivatedClass) {
949
978
  selectedClassName = cssClasses.LIST_ITEM_ACTIVATED_CLASS;
950
979
  }
951
- if (this.selectedIndex_ !== numbers.UNSET_INDEX) {
952
- this.adapter.removeClassForElementIndex(this.selectedIndex_, selectedClassName);
980
+ if (this.selectedIndex !== numbers.UNSET_INDEX) {
981
+ this.adapter.removeClassForElementIndex(this.selectedIndex, selectedClassName);
953
982
  }
954
- this.setAriaForSingleSelectionAtIndex_(index);
983
+ this.setAriaForSingleSelectionAtIndex(index);
955
984
  this.setTabindexAtIndex(index);
956
985
  if (index !== numbers.UNSET_INDEX) {
957
986
  this.adapter.addClassForElementIndex(index, selectedClassName);
958
987
  }
959
- this.selectedIndex_ = index;
988
+ this.selectedIndex = index;
960
989
  };
961
990
  /**
962
991
  * Sets aria attribute for single selection at given index.
963
992
  */
964
- MDCListFoundation.prototype.setAriaForSingleSelectionAtIndex_ = function (index) {
993
+ MDCListFoundation.prototype.setAriaForSingleSelectionAtIndex = function (index) {
965
994
  // Detect the presence of aria-current and get the value only during list
966
995
  // initialization when it is in unset state.
967
- if (this.selectedIndex_ === numbers.UNSET_INDEX) {
968
- this.ariaCurrentAttrValue_ =
996
+ if (this.selectedIndex === numbers.UNSET_INDEX) {
997
+ this.ariaCurrentAttrValue =
969
998
  this.adapter.getAttributeForElementIndex(index, strings.ARIA_CURRENT);
970
999
  }
971
- var isAriaCurrent = this.ariaCurrentAttrValue_ !== null;
1000
+ var isAriaCurrent = this.ariaCurrentAttrValue !== null;
972
1001
  var ariaAttribute = isAriaCurrent ? strings.ARIA_CURRENT : strings.ARIA_SELECTED;
973
- if (this.selectedIndex_ !== numbers.UNSET_INDEX) {
974
- this.adapter.setAttributeForElementIndex(this.selectedIndex_, ariaAttribute, 'false');
1002
+ if (this.selectedIndex !== numbers.UNSET_INDEX) {
1003
+ this.adapter.setAttributeForElementIndex(this.selectedIndex, ariaAttribute, 'false');
975
1004
  }
976
1005
  if (index !== numbers.UNSET_INDEX) {
977
- var ariaAttributeValue = isAriaCurrent ? this.ariaCurrentAttrValue_ : 'true';
1006
+ var ariaAttributeValue = isAriaCurrent ? this.ariaCurrentAttrValue : 'true';
978
1007
  this.adapter.setAttributeForElementIndex(index, ariaAttribute, ariaAttributeValue);
979
1008
  }
980
1009
  };
@@ -982,22 +1011,22 @@ var MDCListFoundation = /** @class */ (function (_super) {
982
1011
  * Returns the attribute to use for indicating selection status.
983
1012
  */
984
1013
  MDCListFoundation.prototype.getSelectionAttribute = function () {
985
- return this.useSelectedAttr_ ? strings.ARIA_SELECTED : strings.ARIA_CHECKED;
1014
+ return this.useSelectedAttr ? strings.ARIA_SELECTED : strings.ARIA_CHECKED;
986
1015
  };
987
1016
  /**
988
1017
  * Toggles radio at give index. Radio doesn't change the checked state if it
989
1018
  * is already checked.
990
1019
  */
991
- MDCListFoundation.prototype.setRadioAtIndex_ = function (index) {
1020
+ MDCListFoundation.prototype.setRadioAtIndex = function (index) {
992
1021
  var selectionAttribute = this.getSelectionAttribute();
993
1022
  this.adapter.setCheckedCheckboxOrRadioAtIndex(index, true);
994
- if (this.selectedIndex_ !== numbers.UNSET_INDEX) {
995
- this.adapter.setAttributeForElementIndex(this.selectedIndex_, selectionAttribute, 'false');
1023
+ if (this.selectedIndex !== numbers.UNSET_INDEX) {
1024
+ this.adapter.setAttributeForElementIndex(this.selectedIndex, selectionAttribute, 'false');
996
1025
  }
997
1026
  this.adapter.setAttributeForElementIndex(index, selectionAttribute, 'true');
998
- this.selectedIndex_ = index;
1027
+ this.selectedIndex = index;
999
1028
  };
1000
- MDCListFoundation.prototype.setCheckboxAtIndex_ = function (index) {
1029
+ MDCListFoundation.prototype.setCheckboxAtIndex = function (index) {
1001
1030
  var selectionAttribute = this.getSelectionAttribute();
1002
1031
  for (var i = 0; i < this.adapter.getListItemCount(); i++) {
1003
1032
  var isChecked = false;
@@ -1007,7 +1036,7 @@ var MDCListFoundation = /** @class */ (function (_super) {
1007
1036
  this.adapter.setCheckedCheckboxOrRadioAtIndex(i, isChecked);
1008
1037
  this.adapter.setAttributeForElementIndex(i, selectionAttribute, isChecked ? 'true' : 'false');
1009
1038
  }
1010
- this.selectedIndex_ = index;
1039
+ this.selectedIndex = index;
1011
1040
  };
1012
1041
  MDCListFoundation.prototype.setTabindexAtIndex = function (index) {
1013
1042
  if (this.focusedItemIndex === numbers.UNSET_INDEX && index !== 0) {
@@ -1022,9 +1051,9 @@ var MDCListFoundation = /** @class */ (function (_super) {
1022
1051
  // Set the previous selection's tabindex to -1. We need this because
1023
1052
  // in selection menus that are not visible, programmatically setting an
1024
1053
  // option will not change focus but will change where tabindex should be 0.
1025
- if (!(this.selectedIndex_ instanceof Array) &&
1026
- this.selectedIndex_ !== index) {
1027
- this.adapter.setAttributeForElementIndex(this.selectedIndex_, 'tabindex', '-1');
1054
+ if (!(this.selectedIndex instanceof Array) &&
1055
+ this.selectedIndex !== index) {
1056
+ this.adapter.setAttributeForElementIndex(this.selectedIndex, 'tabindex', '-1');
1028
1057
  }
1029
1058
  if (index !== numbers.UNSET_INDEX) {
1030
1059
  this.adapter.setAttributeForElementIndex(index, 'tabindex', '0');
@@ -1034,53 +1063,56 @@ var MDCListFoundation = /** @class */ (function (_super) {
1034
1063
  * @return Return true if it is single selectin list, checkbox list or radio
1035
1064
  * list.
1036
1065
  */
1037
- MDCListFoundation.prototype.isSelectableList_ = function () {
1038
- return this.isSingleSelectionList_ || this.isCheckboxList_ ||
1039
- this.isRadioList_;
1066
+ MDCListFoundation.prototype.isSelectableList = function () {
1067
+ return this.isSingleSelectionList || this.isCheckboxList ||
1068
+ this.isRadioList;
1040
1069
  };
1041
1070
  MDCListFoundation.prototype.setTabindexToFirstSelectedOrFocusedItem = function () {
1042
1071
  var targetIndex = this.getFirstSelectedOrFocusedItemIndex();
1043
1072
  this.setTabindexAtIndex(targetIndex);
1044
1073
  };
1045
1074
  MDCListFoundation.prototype.getFirstSelectedOrFocusedItemIndex = function () {
1046
- var targetIndex = this.focusedItemIndex >= 0 ? this.focusedItemIndex : 0;
1047
- if (this.isSelectableList_()) {
1048
- if (typeof this.selectedIndex_ === 'number' &&
1049
- this.selectedIndex_ !== numbers.UNSET_INDEX) {
1050
- targetIndex = this.selectedIndex_;
1051
- }
1052
- else if (isNumberArray(this.selectedIndex_) &&
1053
- this.selectedIndex_.length > 0) {
1054
- targetIndex = this.selectedIndex_.reduce(function (currentIndex, minIndex) { return Math.min(currentIndex, minIndex); });
1055
- }
1075
+ // Action lists retain focus on the most recently focused item.
1076
+ if (!this.isSelectableList()) {
1077
+ return Math.max(this.focusedItemIndex, 0);
1056
1078
  }
1057
- return targetIndex;
1079
+ // Single-selection lists focus the selected item.
1080
+ if (typeof this.selectedIndex === 'number' &&
1081
+ this.selectedIndex !== numbers.UNSET_INDEX) {
1082
+ return this.selectedIndex;
1083
+ }
1084
+ // Multiple-selection lists focus the first selected item.
1085
+ if (isNumberArray(this.selectedIndex) && this.selectedIndex.length > 0) {
1086
+ return this.selectedIndex.reduce(function (minIndex, currentIndex) { return Math.min(minIndex, currentIndex); });
1087
+ }
1088
+ // Selection lists without a selection focus the first item.
1089
+ return 0;
1058
1090
  };
1059
- MDCListFoundation.prototype.isIndexValid_ = function (index) {
1091
+ MDCListFoundation.prototype.isIndexValid = function (index) {
1060
1092
  var _this = this;
1061
1093
  if (index instanceof Array) {
1062
- if (!this.isCheckboxList_) {
1094
+ if (!this.isCheckboxList) {
1063
1095
  throw new Error('MDCListFoundation: Array of index is only supported for checkbox based list');
1064
1096
  }
1065
1097
  if (index.length === 0) {
1066
1098
  return true;
1067
1099
  }
1068
1100
  else {
1069
- return index.some(function (i) { return _this.isIndexInRange_(i); });
1101
+ return index.some(function (i) { return _this.isIndexInRange(i); });
1070
1102
  }
1071
1103
  }
1072
1104
  else if (typeof index === 'number') {
1073
- if (this.isCheckboxList_) {
1105
+ if (this.isCheckboxList) {
1074
1106
  throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: " + index);
1075
1107
  }
1076
- return this.isIndexInRange_(index) ||
1077
- this.isSingleSelectionList_ && index === numbers.UNSET_INDEX;
1108
+ return this.isIndexInRange(index) ||
1109
+ this.isSingleSelectionList && index === numbers.UNSET_INDEX;
1078
1110
  }
1079
1111
  else {
1080
1112
  return false;
1081
1113
  }
1082
1114
  };
1083
- MDCListFoundation.prototype.isIndexInRange_ = function (index) {
1115
+ MDCListFoundation.prototype.isIndexInRange = function (index) {
1084
1116
  var listSize = this.adapter.getListItemCount();
1085
1117
  return index >= 0 && index < listSize;
1086
1118
  };
@@ -1089,16 +1121,16 @@ var MDCListFoundation = /** @class */ (function (_super) {
1089
1121
  * toggleCheckbox value. User interaction should not toggle list item(s) when
1090
1122
  * disabled.
1091
1123
  */
1092
- MDCListFoundation.prototype.setSelectedIndexOnAction_ = function (index, toggleCheckbox) {
1124
+ MDCListFoundation.prototype.setSelectedIndexOnAction = function (index, toggleCheckbox) {
1093
1125
  if (toggleCheckbox === void 0) { toggleCheckbox = true; }
1094
- if (this.isCheckboxList_) {
1095
- this.toggleCheckboxAtIndex_(index, toggleCheckbox);
1126
+ if (this.isCheckboxList) {
1127
+ this.toggleCheckboxAtIndex(index, toggleCheckbox);
1096
1128
  }
1097
1129
  else {
1098
1130
  this.setSelectedIndex(index);
1099
1131
  }
1100
1132
  };
1101
- MDCListFoundation.prototype.toggleCheckboxAtIndex_ = function (index, toggleCheckbox) {
1133
+ MDCListFoundation.prototype.toggleCheckboxAtIndex = function (index, toggleCheckbox) {
1102
1134
  var selectionAttribute = this.getSelectionAttribute();
1103
1135
  var isChecked = this.adapter.isCheckboxCheckedAtIndex(index);
1104
1136
  if (toggleCheckbox) {
@@ -1108,16 +1140,16 @@ var MDCListFoundation = /** @class */ (function (_super) {
1108
1140
  this.adapter.setAttributeForElementIndex(index, selectionAttribute, isChecked ? 'true' : 'false');
1109
1141
  // If none of the checkbox items are selected and selectedIndex is not
1110
1142
  // initialized then provide a default value.
1111
- var selectedIndexes = this.selectedIndex_ === numbers.UNSET_INDEX ?
1143
+ var selectedIndexes = this.selectedIndex === numbers.UNSET_INDEX ?
1112
1144
  [] :
1113
- this.selectedIndex_.slice();
1145
+ this.selectedIndex.slice();
1114
1146
  if (isChecked) {
1115
1147
  selectedIndexes.push(index);
1116
1148
  }
1117
1149
  else {
1118
1150
  selectedIndexes = selectedIndexes.filter(function (i) { return i !== index; });
1119
1151
  }
1120
- this.selectedIndex_ = selectedIndexes;
1152
+ this.selectedIndex = selectedIndexes;
1121
1153
  };
1122
1154
  MDCListFoundation.prototype.focusItemAtIndex = function (index) {
1123
1155
  this.adapter.focusItemAtIndex(index);
@@ -1127,7 +1159,7 @@ var MDCListFoundation = /** @class */ (function (_super) {
1127
1159
  var count = this.adapter.getListItemCount();
1128
1160
  // If all items are selected, deselect everything.
1129
1161
  if (currentlySelectedIndexes.length === count) {
1130
- this.setCheckboxAtIndex_([]);
1162
+ this.setCheckboxAtIndex([]);
1131
1163
  }
1132
1164
  else {
1133
1165
  // Otherwise select all enabled options.
@@ -1138,7 +1170,7 @@ var MDCListFoundation = /** @class */ (function (_super) {
1138
1170
  allIndexes.push(i);
1139
1171
  }
1140
1172
  }
1141
- this.setCheckboxAtIndex_(allIndexes);
1173
+ this.setCheckboxAtIndex(allIndexes);
1142
1174
  }
1143
1175
  };
1144
1176
  /**
@@ -1526,7 +1558,7 @@ var MDCList = /** @class */ (function (_super) {
1526
1558
  */
1527
1559
  MDCList.prototype.handleFocusInEvent = function (evt) {
1528
1560
  var index = this.getListItemIndex(evt.target);
1529
- this.foundation.handleFocusIn(evt, index);
1561
+ this.foundation.handleFocusIn(index);
1530
1562
  };
1531
1563
  /**
1532
1564
  * Used to figure out which element was clicked before sending the event to
@@ -1534,7 +1566,7 @@ var MDCList = /** @class */ (function (_super) {
1534
1566
  */
1535
1567
  MDCList.prototype.handleFocusOutEvent = function (evt) {
1536
1568
  var index = this.getListItemIndex(evt.target);
1537
- this.foundation.handleFocusOut(evt, index);
1569
+ this.foundation.handleFocusOut(index);
1538
1570
  };
1539
1571
  /**
1540
1572
  * Used to figure out which element was focused when keydown event occurred
@@ -1746,7 +1778,8 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
1746
1778
  cancelAnimationFrame(this.animationRequestId);
1747
1779
  };
1748
1780
  /**
1749
- * @param corner Default anchor corner alignment of top-left menu surface corner.
1781
+ * @param corner Default anchor corner alignment of top-left menu surface
1782
+ * corner.
1750
1783
  */
1751
1784
  MDCMenuSurfaceFoundation.prototype.setAnchorCorner = function (corner) {
1752
1785
  this.anchorCorner = corner;
@@ -1770,10 +1803,18 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
1770
1803
  MDCMenuSurfaceFoundation.prototype.setIsHoisted = function (isHoisted) {
1771
1804
  this.isHoistedElement = isHoisted;
1772
1805
  };
1773
- /** Used to set the menu-surface calculations based on a fixed position menu. */
1806
+ /**
1807
+ * Used to set the menu-surface calculations based on a fixed position menu.
1808
+ */
1774
1809
  MDCMenuSurfaceFoundation.prototype.setFixedPosition = function (isFixedPosition) {
1775
1810
  this.isFixedPosition = isFixedPosition;
1776
1811
  };
1812
+ /**
1813
+ * @return Returns true if menu is in fixed (`position: fixed`) position.
1814
+ */
1815
+ MDCMenuSurfaceFoundation.prototype.isFixed = function () {
1816
+ return this.isFixedPosition;
1817
+ };
1777
1818
  /** Sets the menu-surface position on the page. */
1778
1819
  MDCMenuSurfaceFoundation.prototype.setAbsolutePosition = function (x, y) {
1779
1820
  this.position.x = this.isFinite(x) ? x : 0;
@@ -1816,9 +1857,9 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
1816
1857
  else {
1817
1858
  this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
1818
1859
  this.animationRequestId = requestAnimationFrame(function () {
1819
- _this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
1820
1860
  _this.dimensions = _this.adapter.getInnerDimensions();
1821
1861
  _this.autoposition();
1862
+ _this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
1822
1863
  _this.openAnimationEndTimerId = setTimeout(function () {
1823
1864
  _this.openAnimationEndTimerId = 0;
1824
1865
  _this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
@@ -1894,11 +1935,14 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
1894
1935
  _a[horizontalAlignment] = horizontalOffset,
1895
1936
  _a[verticalAlignment] = verticalOffset,
1896
1937
  _a);
1897
- // Center align when anchor width is comparable or greater than menu surface, otherwise keep corner.
1898
- if (anchorSize.width / surfaceSize.width > numbers$1.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
1938
+ // Center align when anchor width is comparable or greater than menu
1939
+ // surface, otherwise keep corner.
1940
+ if (anchorSize.width / surfaceSize.width >
1941
+ numbers$1.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
1899
1942
  horizontalAlignment = 'center';
1900
1943
  }
1901
- // If the menu-surface has been hoisted to the body, it's no longer relative to the anchor element
1944
+ // If the menu-surface has been hoisted to the body, it's no longer relative
1945
+ // to the anchor element
1902
1946
  if (this.isHoistedElement || this.isFixedPosition) {
1903
1947
  this.adjustPositionForHoistedElement(position);
1904
1948
  }
@@ -2022,7 +2066,8 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
2022
2066
  };
2023
2067
  /**
2024
2068
  * @param corner Origin corner of the menu surface.
2025
- * @return Maximum height of the menu surface, based on available space. 0 indicates should not be set.
2069
+ * @return Maximum height of the menu surface, based on available space. 0
2070
+ * indicates should not be set.
2026
2071
  */
2027
2072
  MDCMenuSurfaceFoundation.prototype.getMenuSurfaceMaxHeight = function (corner) {
2028
2073
  if (this.maxHeight > 0) {
@@ -2051,7 +2096,8 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
2051
2096
  };
2052
2097
  /**
2053
2098
  * @param corner Origin corner of the menu surface.
2054
- * @return Horizontal offset of menu surface origin corner from corresponding anchor corner.
2099
+ * @return Horizontal offset of menu surface origin corner from corresponding
2100
+ * anchor corner.
2055
2101
  */
2056
2102
  MDCMenuSurfaceFoundation.prototype.getHorizontalOriginOffset = function (corner) {
2057
2103
  var anchorSize = this.measurements.anchorSize;
@@ -2078,7 +2124,8 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
2078
2124
  };
2079
2125
  /**
2080
2126
  * @param corner Origin corner of the menu surface.
2081
- * @return Vertical offset of menu surface origin corner from corresponding anchor corner.
2127
+ * @return Vertical offset of menu surface origin corner from corresponding
2128
+ * anchor corner.
2082
2129
  */
2083
2130
  MDCMenuSurfaceFoundation.prototype.getVerticalOriginOffset = function (corner) {
2084
2131
  var anchorSize = this.measurements.anchorSize;
@@ -2096,7 +2143,10 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
2096
2143
  }
2097
2144
  return y;
2098
2145
  };
2099
- /** Calculates the offsets for positioning the menu-surface when the menu-surface has been hoisted to the body. */
2146
+ /**
2147
+ * Calculates the offsets for positioning the menu-surface when the
2148
+ * menu-surface has been hoisted to the body.
2149
+ */
2100
2150
  MDCMenuSurfaceFoundation.prototype.adjustPositionForHoistedElement = function (position) {
2101
2151
  var e_1, _a;
2102
2152
  var _b = this.measurements, windowScroll = _b.windowScroll, viewportDistance = _b.viewportDistance, surfaceSize = _b.surfaceSize, viewportSize = _b.viewportSize;
@@ -2110,11 +2160,11 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
2110
2160
  position[prop] = (viewportSize.width - surfaceSize.width) / 2;
2111
2161
  continue;
2112
2162
  }
2113
- // Hoisted surfaces need to have the anchor elements location on the page added to the
2114
- // position properties for proper alignment on the body.
2163
+ // Hoisted surfaces need to have the anchor elements location on the page
2164
+ // added to the position properties for proper alignment on the body.
2115
2165
  value += viewportDistance[prop];
2116
- // Surfaces that are absolutely positioned need to have additional calculations for scroll
2117
- // and bottom positioning.
2166
+ // Surfaces that are absolutely positioned need to have additional
2167
+ // calculations for scroll and bottom positioning.
2118
2168
  if (!this.isFixedPosition) {
2119
2169
  if (prop === 'top') {
2120
2170
  value += windowScroll.y;
@@ -2141,15 +2191,23 @@ var MDCMenuSurfaceFoundation = /** @class */ (function (_super) {
2141
2191
  }
2142
2192
  };
2143
2193
  /**
2144
- * The last focused element when the menu surface was opened should regain focus, if the user is
2145
- * focused on or within the menu surface when it is closed.
2194
+ * The last focused element when the menu surface was opened should regain
2195
+ * focus, if the user is focused on or within the menu surface when it is
2196
+ * closed.
2146
2197
  */
2147
2198
  MDCMenuSurfaceFoundation.prototype.maybeRestoreFocus = function () {
2199
+ var _this = this;
2148
2200
  var isRootFocused = this.adapter.isFocused();
2149
2201
  var childHasFocus = document.activeElement &&
2150
2202
  this.adapter.isElementInContainer(document.activeElement);
2151
2203
  if (isRootFocused || childHasFocus) {
2152
- this.adapter.restoreFocus();
2204
+ // Wait before restoring focus when closing the menu surface. This is
2205
+ // important because if a touch event triggered the menu close, and the
2206
+ // subsequent mouse event occurs after focus is restored, then the
2207
+ // restored focus would be lost.
2208
+ setTimeout(function () {
2209
+ _this.adapter.restoreFocus();
2210
+ }, numbers$1.TOUCH_EVENT_WAIT_MS);
2153
2211
  }
2154
2212
  };
2155
2213
  MDCMenuSurfaceFoundation.prototype.hasBit = function (corner, bit) {