@angular/cdk-experimental 13.0.0-next.7 → 13.0.0-rc.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 (329) hide show
  1. package/column-resize/column-resize-directives/column-resize-flex.d.ts +3 -0
  2. package/column-resize/column-resize-directives/column-resize.d.ts +3 -0
  3. package/column-resize/column-resize-directives/default-enabled-column-resize-flex.d.ts +3 -0
  4. package/column-resize/column-resize-directives/default-enabled-column-resize.d.ts +3 -0
  5. package/column-resize/column-resize-module.d.ts +11 -7
  6. package/column-resize/column-resize-notifier.d.ts +5 -7
  7. package/column-resize/column-resize.d.ts +3 -0
  8. package/column-resize/column-resize_public_index.d.ts +4 -0
  9. package/column-resize/column-size-store.d.ts +3 -7
  10. package/column-resize/event-dispatcher.d.ts +3 -0
  11. package/column-resize/index.d.ts +5 -2
  12. package/column-resize/overlay-handle.d.ts +3 -0
  13. package/column-resize/package.json +6 -6
  14. package/column-resize/resizable.d.ts +3 -0
  15. package/column-resize/resize-strategy.d.ts +7 -0
  16. package/combobox/combobox-module.d.ts +8 -7
  17. package/combobox/combobox-panel.d.ts +5 -2
  18. package/combobox/combobox-popup.d.ts +3 -0
  19. package/combobox/combobox.d.ts +8 -5
  20. package/combobox/combobox_public_index.d.ts +4 -0
  21. package/combobox/index.d.ts +5 -1
  22. package/combobox/package.json +6 -6
  23. package/dialog/dialog-container.d.ts +4 -1
  24. package/dialog/dialog-module.d.ts +8 -7
  25. package/dialog/dialog.d.ts +3 -0
  26. package/dialog/dialog_public_index.d.ts +4 -0
  27. package/dialog/index.d.ts +5 -1
  28. package/dialog/package.json +6 -6
  29. package/esm2020/column-resize/column-resize-directives/column-resize-flex.mjs +42 -0
  30. package/esm2020/column-resize/column-resize-directives/column-resize.mjs +42 -0
  31. package/{esm2015/column-resize/column-resize-directives/constants.js → esm2020/column-resize/column-resize-directives/constants.mjs} +0 -0
  32. package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize-flex.mjs +48 -0
  33. package/esm2020/column-resize/column-resize-directives/default-enabled-column-resize.mjs +48 -0
  34. package/esm2020/column-resize/column-resize-module.mjs +46 -0
  35. package/esm2020/column-resize/column-resize-notifier.mjs +52 -0
  36. package/esm2020/column-resize/column-resize.mjs +82 -0
  37. package/esm2020/column-resize/column-resize_public_index.mjs +5 -0
  38. package/esm2020/column-resize/column-size-store.mjs +20 -0
  39. package/esm2020/column-resize/event-dispatcher.mjs +70 -0
  40. package/esm2020/column-resize/index.mjs +9 -0
  41. package/esm2020/column-resize/overlay-handle.mjs +146 -0
  42. package/{esm2015/column-resize/public-api.js → esm2020/column-resize/public-api.mjs} +0 -0
  43. package/esm2020/column-resize/resizable.mjs +195 -0
  44. package/{esm2015/column-resize/resize-ref.js → esm2020/column-resize/resize-ref.mjs} +1 -1
  45. package/esm2020/column-resize/resize-strategy.mjs +230 -0
  46. package/{esm2015/column-resize/selectors.js → esm2020/column-resize/selectors.mjs} +0 -0
  47. package/esm2020/combobox/combobox-module.mjs +28 -0
  48. package/esm2020/combobox/combobox-panel.mjs +48 -0
  49. package/esm2020/combobox/combobox-popup.mjs +83 -0
  50. package/esm2020/combobox/combobox.mjs +261 -0
  51. package/esm2020/combobox/combobox_public_index.mjs +5 -0
  52. package/esm2020/combobox/index.mjs +9 -0
  53. package/{esm2015/combobox/public-api.js → esm2020/combobox/public-api.mjs} +0 -0
  54. package/{esm2015/dialog/dialog-config.js → esm2020/dialog/dialog-config.mjs} +0 -0
  55. package/esm2020/dialog/dialog-container.mjs +310 -0
  56. package/esm2020/dialog/dialog-injectors.mjs +30 -0
  57. package/esm2020/dialog/dialog-module.mjs +57 -0
  58. package/esm2020/dialog/dialog-ref.mjs +116 -0
  59. package/esm2020/dialog/dialog.mjs +252 -0
  60. package/esm2020/dialog/dialog_public_index.mjs +5 -0
  61. package/esm2020/dialog/index.mjs +9 -0
  62. package/{esm2015/dialog/public-api.js → esm2020/dialog/public-api.mjs} +0 -0
  63. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  64. package/esm2020/listbox/index.mjs +9 -0
  65. package/esm2020/listbox/listbox-module.mjs +24 -0
  66. package/esm2020/listbox/listbox.mjs +499 -0
  67. package/esm2020/listbox/listbox_public_index.mjs +5 -0
  68. package/{esm2015/listbox/public-api.js → esm2020/listbox/public-api.mjs} +0 -0
  69. package/esm2020/menu/context-menu.mjs +287 -0
  70. package/esm2020/menu/index.mjs +9 -0
  71. package/esm2020/menu/menu-aim.mjs +199 -0
  72. package/esm2020/menu/menu-bar.mjs +272 -0
  73. package/{esm2015/menu/menu-errors.js → esm2020/menu/menu-errors.mjs} +1 -1
  74. package/esm2020/menu/menu-group.mjs +68 -0
  75. package/{esm2015/menu/menu-interface.js → esm2020/menu/menu-interface.mjs} +0 -0
  76. package/esm2020/menu/menu-item-checkbox.mjs +48 -0
  77. package/esm2020/menu/menu-item-radio.mjs +90 -0
  78. package/esm2020/menu/menu-item-selectable.mjs +57 -0
  79. package/esm2020/menu/menu-item-trigger.mjs +361 -0
  80. package/esm2020/menu/menu-item.mjs +291 -0
  81. package/esm2020/menu/menu-module.mjs +64 -0
  82. package/esm2020/menu/menu-panel.mjs +37 -0
  83. package/{esm2015/menu/menu-stack.js → esm2020/menu/menu-stack.mjs} +0 -0
  84. package/esm2020/menu/menu.mjs +316 -0
  85. package/esm2020/menu/menu_public_index.mjs +5 -0
  86. package/{esm2015/menu/pointer-focus-tracker.js → esm2020/menu/pointer-focus-tracker.mjs} +1 -1
  87. package/{esm2015/menu/public-api.js → esm2020/menu/public-api.mjs} +0 -0
  88. package/{esm2015/popover-edit/constants.js → esm2020/popover-edit/constants.mjs} +0 -0
  89. package/esm2020/popover-edit/edit-event-dispatcher.mjs +215 -0
  90. package/esm2020/popover-edit/edit-ref.mjs +84 -0
  91. package/esm2020/popover-edit/edit-services.mjs +48 -0
  92. package/esm2020/popover-edit/focus-dispatcher.mjs +82 -0
  93. package/esm2020/popover-edit/focus-escape-notifier.mjs +63 -0
  94. package/{esm2015/popover-edit/form-value-container.js → esm2020/popover-edit/form-value-container.mjs} +0 -0
  95. package/esm2020/popover-edit/index.mjs +9 -0
  96. package/esm2020/popover-edit/lens-directives.mjs +210 -0
  97. package/esm2020/popover-edit/polyfill.mjs +37 -0
  98. package/esm2020/popover-edit/popover-edit-module.mjs +62 -0
  99. package/esm2020/popover-edit/popover-edit-position-strategy-factory.mjs +76 -0
  100. package/esm2020/popover-edit/popover-edit_public_index.mjs +5 -0
  101. package/{esm2015/popover-edit/public-api.js → esm2020/popover-edit/public-api.mjs} +0 -0
  102. package/esm2020/popover-edit/table-directives.mjs +400 -0
  103. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  104. package/esm2020/scrolling/auto-size-virtual-scroll.mjs +421 -0
  105. package/esm2020/scrolling/index.mjs +9 -0
  106. package/{esm2015/scrolling/public-api.js → esm2020/scrolling/public-api.mjs} +0 -0
  107. package/esm2020/scrolling/scrolling-module.mjs +23 -0
  108. package/esm2020/scrolling/scrolling_public_index.mjs +5 -0
  109. package/esm2020/selection/index.mjs +9 -0
  110. package/{esm2015/selection/public-api.js → esm2020/selection/public-api.mjs} +0 -0
  111. package/esm2020/selection/row-selection.mjs +49 -0
  112. package/esm2020/selection/select-all.mjs +109 -0
  113. package/esm2020/selection/selection-column.mjs +134 -0
  114. package/esm2020/selection/selection-module.mjs +40 -0
  115. package/{esm2015/selection/selection-set.js → esm2020/selection/selection-set.mjs} +1 -1
  116. package/esm2020/selection/selection-toggle.mjs +101 -0
  117. package/esm2020/selection/selection.mjs +186 -0
  118. package/esm2020/selection/selection_public_index.mjs +5 -0
  119. package/esm2020/table-scroll-container/index.mjs +9 -0
  120. package/{esm2015/table-scroll-container/public-api.js → esm2020/table-scroll-container/public-api.mjs} +0 -0
  121. package/esm2020/table-scroll-container/table-scroll-container-module.mjs +23 -0
  122. package/esm2020/table-scroll-container/table-scroll-container.mjs +131 -0
  123. package/esm2020/table-scroll-container/table-scroll-container_public_index.mjs +5 -0
  124. package/{esm2015/version.js → esm2020/version.mjs} +1 -1
  125. package/fesm2015/{cdk-experimental.js → cdk-experimental.mjs} +2 -2
  126. package/fesm2015/cdk-experimental.mjs.map +1 -0
  127. package/fesm2015/{column-resize.js → column-resize.mjs} +213 -175
  128. package/fesm2015/column-resize.mjs.map +1 -0
  129. package/fesm2015/{combobox.js → combobox.mjs} +134 -102
  130. package/fesm2015/combobox.mjs.map +1 -0
  131. package/fesm2015/dialog.mjs +813 -0
  132. package/fesm2015/dialog.mjs.map +1 -0
  133. package/fesm2015/{listbox.js → listbox.mjs} +128 -91
  134. package/fesm2015/listbox.mjs.map +1 -0
  135. package/fesm2015/{menu.js → menu.mjs} +576 -397
  136. package/fesm2015/menu.mjs.map +1 -0
  137. package/fesm2015/{popover-edit.js → popover-edit.mjs} +257 -230
  138. package/fesm2015/popover-edit.mjs.map +1 -0
  139. package/fesm2015/{scrolling.js → scrolling.mjs} +66 -36
  140. package/fesm2015/scrolling.mjs.map +1 -0
  141. package/fesm2015/selection.mjs +693 -0
  142. package/fesm2015/selection.mjs.map +1 -0
  143. package/fesm2015/{table-scroll-container.js → table-scroll-container.mjs} +43 -30
  144. package/fesm2015/table-scroll-container.mjs.map +1 -0
  145. package/fesm2020/cdk-experimental.mjs +30 -0
  146. package/fesm2020/cdk-experimental.mjs.map +1 -0
  147. package/fesm2020/column-resize.mjs +1016 -0
  148. package/fesm2020/column-resize.mjs.map +1 -0
  149. package/fesm2020/combobox.mjs +430 -0
  150. package/fesm2020/combobox.mjs.map +1 -0
  151. package/{fesm2015/dialog.js → fesm2020/dialog.mjs} +156 -104
  152. package/fesm2020/dialog.mjs.map +1 -0
  153. package/fesm2020/listbox.mjs +541 -0
  154. package/fesm2020/listbox.mjs.map +1 -0
  155. package/fesm2020/menu.mjs +2202 -0
  156. package/fesm2020/menu.mjs.map +1 -0
  157. package/fesm2020/popover-edit.mjs +1289 -0
  158. package/fesm2020/popover-edit.mjs.map +1 -0
  159. package/fesm2020/scrolling.mjs +464 -0
  160. package/fesm2020/scrolling.mjs.map +1 -0
  161. package/{fesm2015/selection.js → fesm2020/selection.mjs} +195 -107
  162. package/fesm2020/selection.mjs.map +1 -0
  163. package/fesm2020/table-scroll-container.mjs +173 -0
  164. package/fesm2020/table-scroll-container.mjs.map +1 -0
  165. package/listbox/index.d.ts +5 -1
  166. package/listbox/listbox-module.d.ts +5 -7
  167. package/listbox/listbox.d.ts +5 -0
  168. package/listbox/listbox_public_index.d.ts +4 -0
  169. package/listbox/package.json +6 -6
  170. package/menu/context-menu.d.ts +5 -0
  171. package/menu/index.d.ts +5 -3
  172. package/menu/menu-aim.d.ts +5 -0
  173. package/menu/menu-bar.d.ts +3 -0
  174. package/menu/menu-group.d.ts +3 -0
  175. package/menu/menu-item-checkbox.d.ts +3 -7
  176. package/menu/menu-item-radio.d.ts +3 -0
  177. package/menu/menu-item-selectable.d.ts +3 -0
  178. package/menu/menu-item-trigger.d.ts +3 -0
  179. package/menu/menu-item.d.ts +3 -0
  180. package/menu/menu-module.d.ts +15 -7
  181. package/menu/menu-panel.d.ts +3 -0
  182. package/menu/menu.d.ts +3 -0
  183. package/menu/menu_public_index.d.ts +4 -0
  184. package/menu/package.json +6 -6
  185. package/package.json +94 -8
  186. package/popover-edit/edit-event-dispatcher.d.ts +3 -0
  187. package/popover-edit/edit-ref.d.ts +3 -0
  188. package/popover-edit/edit-services.d.ts +3 -0
  189. package/popover-edit/focus-dispatcher.d.ts +3 -0
  190. package/popover-edit/focus-escape-notifier.d.ts +3 -0
  191. package/popover-edit/index.d.ts +5 -3
  192. package/popover-edit/lens-directives.d.ts +7 -0
  193. package/popover-edit/package.json +6 -6
  194. package/popover-edit/popover-edit-module.d.ts +7 -7
  195. package/popover-edit/popover-edit-position-strategy-factory.d.ts +5 -0
  196. package/popover-edit/popover-edit_public_index.d.ts +4 -0
  197. package/popover-edit/table-directives.d.ts +11 -0
  198. package/scrolling/auto-size-virtual-scroll.d.ts +3 -0
  199. package/scrolling/index.d.ts +5 -1
  200. package/scrolling/package.json +6 -6
  201. package/scrolling/scrolling-module.d.ts +5 -7
  202. package/scrolling/scrolling_public_index.d.ts +4 -0
  203. package/selection/index.d.ts +5 -1
  204. package/selection/package.json +6 -6
  205. package/selection/row-selection.d.ts +3 -0
  206. package/selection/select-all.d.ts +3 -0
  207. package/selection/selection-column.d.ts +3 -0
  208. package/selection/selection-module.d.ts +11 -7
  209. package/selection/selection-toggle.d.ts +3 -0
  210. package/selection/selection.d.ts +3 -0
  211. package/selection/selection_public_index.d.ts +4 -0
  212. package/table-scroll-container/index.d.ts +5 -1
  213. package/table-scroll-container/package.json +6 -6
  214. package/table-scroll-container/table-scroll-container-module.d.ts +5 -7
  215. package/table-scroll-container/table-scroll-container.d.ts +3 -0
  216. package/table-scroll-container/table-scroll-container_public_index.d.ts +4 -0
  217. package/bundles/cdk-experimental-column-resize.umd.js +0 -1324
  218. package/bundles/cdk-experimental-column-resize.umd.js.map +0 -1
  219. package/bundles/cdk-experimental-combobox.umd.js +0 -443
  220. package/bundles/cdk-experimental-combobox.umd.js.map +0 -1
  221. package/bundles/cdk-experimental-dialog.umd.js +0 -1113
  222. package/bundles/cdk-experimental-dialog.umd.js.map +0 -1
  223. package/bundles/cdk-experimental-listbox.umd.js +0 -935
  224. package/bundles/cdk-experimental-listbox.umd.js.map +0 -1
  225. package/bundles/cdk-experimental-menu.umd.js +0 -2461
  226. package/bundles/cdk-experimental-menu.umd.js.map +0 -1
  227. package/bundles/cdk-experimental-popover-edit.umd.js +0 -1679
  228. package/bundles/cdk-experimental-popover-edit.umd.js.map +0 -1
  229. package/bundles/cdk-experimental-scrolling.umd.js +0 -459
  230. package/bundles/cdk-experimental-scrolling.umd.js.map +0 -1
  231. package/bundles/cdk-experimental-selection.umd.js +0 -961
  232. package/bundles/cdk-experimental-selection.umd.js.map +0 -1
  233. package/bundles/cdk-experimental-table-scroll-container.umd.js +0 -499
  234. package/bundles/cdk-experimental-table-scroll-container.umd.js.map +0 -1
  235. package/bundles/cdk-experimental.umd.js +0 -38
  236. package/bundles/cdk-experimental.umd.js.map +0 -1
  237. package/column-resize/index.metadata.json +0 -1
  238. package/combobox/index.metadata.json +0 -1
  239. package/dialog/index.metadata.json +0 -1
  240. package/esm2015/cdk-experimental.externs.js +0 -0
  241. package/esm2015/column-resize/column-resize-directives/column-resize-flex.js +0 -46
  242. package/esm2015/column-resize/column-resize-directives/column-resize.js +0 -46
  243. package/esm2015/column-resize/column-resize-directives/default-enabled-column-resize-flex.js +0 -46
  244. package/esm2015/column-resize/column-resize-directives/default-enabled-column-resize.js +0 -46
  245. package/esm2015/column-resize/column-resize-module.js +0 -37
  246. package/esm2015/column-resize/column-resize-notifier.js +0 -45
  247. package/esm2015/column-resize/column-resize.externs.js +0 -6
  248. package/esm2015/column-resize/column-resize.js +0 -71
  249. package/esm2015/column-resize/column-size-store.js +0 -17
  250. package/esm2015/column-resize/event-dispatcher.js +0 -70
  251. package/esm2015/column-resize/index.js +0 -6
  252. package/esm2015/column-resize/overlay-handle.js +0 -139
  253. package/esm2015/column-resize/resizable.js +0 -185
  254. package/esm2015/column-resize/resize-strategy.js +0 -227
  255. package/esm2015/combobox/combobox-module.js +0 -23
  256. package/esm2015/combobox/combobox-panel.js +0 -55
  257. package/esm2015/combobox/combobox-popup.js +0 -74
  258. package/esm2015/combobox/combobox.externs.js +0 -6
  259. package/esm2015/combobox/combobox.js +0 -248
  260. package/esm2015/combobox/index.js +0 -5
  261. package/esm2015/dialog/dialog-container.js +0 -289
  262. package/esm2015/dialog/dialog-injectors.js +0 -30
  263. package/esm2015/dialog/dialog-module.js +0 -47
  264. package/esm2015/dialog/dialog-ref.js +0 -115
  265. package/esm2015/dialog/dialog.externs.js +0 -6
  266. package/esm2015/dialog/dialog.js +0 -238
  267. package/esm2015/dialog/index.js +0 -5
  268. package/esm2015/listbox/index.js +0 -5
  269. package/esm2015/listbox/listbox-module.js +0 -19
  270. package/esm2015/listbox/listbox.externs.js +0 -6
  271. package/esm2015/listbox/listbox.js +0 -481
  272. package/esm2015/menu/context-menu.js +0 -280
  273. package/esm2015/menu/index.js +0 -6
  274. package/esm2015/menu/menu-aim.js +0 -195
  275. package/esm2015/menu/menu-bar.js +0 -252
  276. package/esm2015/menu/menu-group.js +0 -63
  277. package/esm2015/menu/menu-item-checkbox.js +0 -41
  278. package/esm2015/menu/menu-item-radio.js +0 -73
  279. package/esm2015/menu/menu-item-selectable.js +0 -51
  280. package/esm2015/menu/menu-item-trigger.js +0 -354
  281. package/esm2015/menu/menu-item.js +0 -253
  282. package/esm2015/menu/menu-module.js +0 -41
  283. package/esm2015/menu/menu-panel.js +0 -37
  284. package/esm2015/menu/menu.externs.js +0 -6
  285. package/esm2015/menu/menu.js +0 -293
  286. package/esm2015/popover-edit/edit-event-dispatcher.js +0 -215
  287. package/esm2015/popover-edit/edit-ref.js +0 -82
  288. package/esm2015/popover-edit/edit-services.js +0 -49
  289. package/esm2015/popover-edit/focus-dispatcher.js +0 -83
  290. package/esm2015/popover-edit/focus-escape-notifier.js +0 -64
  291. package/esm2015/popover-edit/index.js +0 -7
  292. package/esm2015/popover-edit/lens-directives.js +0 -199
  293. package/esm2015/popover-edit/polyfill.js +0 -35
  294. package/esm2015/popover-edit/popover-edit-module.js +0 -38
  295. package/esm2015/popover-edit/popover-edit-position-strategy-factory.js +0 -70
  296. package/esm2015/popover-edit/popover-edit.externs.js +0 -6
  297. package/esm2015/popover-edit/table-directives.js +0 -390
  298. package/esm2015/scrolling/auto-size-virtual-scroll.js +0 -403
  299. package/esm2015/scrolling/index.js +0 -5
  300. package/esm2015/scrolling/scrolling-module.js +0 -18
  301. package/esm2015/scrolling/scrolling.externs.js +0 -6
  302. package/esm2015/selection/index.js +0 -5
  303. package/esm2015/selection/row-selection.js +0 -41
  304. package/esm2015/selection/select-all.js +0 -96
  305. package/esm2015/selection/selection-column.js +0 -93
  306. package/esm2015/selection/selection-module.js +0 -40
  307. package/esm2015/selection/selection-toggle.js +0 -82
  308. package/esm2015/selection/selection.externs.js +0 -6
  309. package/esm2015/selection/selection.js +0 -176
  310. package/esm2015/table-scroll-container/index.js +0 -5
  311. package/esm2015/table-scroll-container/table-scroll-container-module.js +0 -18
  312. package/esm2015/table-scroll-container/table-scroll-container.externs.js +0 -6
  313. package/esm2015/table-scroll-container/table-scroll-container.js +0 -133
  314. package/fesm2015/cdk-experimental.js.map +0 -1
  315. package/fesm2015/column-resize.js.map +0 -1
  316. package/fesm2015/combobox.js.map +0 -1
  317. package/fesm2015/dialog.js.map +0 -1
  318. package/fesm2015/listbox.js.map +0 -1
  319. package/fesm2015/menu.js.map +0 -1
  320. package/fesm2015/popover-edit.js.map +0 -1
  321. package/fesm2015/scrolling.js.map +0 -1
  322. package/fesm2015/selection.js.map +0 -1
  323. package/fesm2015/table-scroll-container.js.map +0 -1
  324. package/listbox/index.metadata.json +0 -1
  325. package/menu/index.metadata.json +0 -1
  326. package/popover-edit/index.metadata.json +0 -1
  327. package/scrolling/index.metadata.json +0 -1
  328. package/selection/index.metadata.json +0 -1
  329. package/table-scroll-container/index.metadata.json +0 -1
@@ -1,935 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/cdk/a11y'), require('@angular/cdk/keycodes'), require('@angular/cdk/coercion'), require('@angular/cdk/collections'), require('rxjs'), require('rxjs/operators'), require('@angular/forms'), require('@angular/cdk-experimental/combobox'), require('@angular/cdk/bidi')) :
3
- typeof define === 'function' && define.amd ? define('@angular/cdk-experimental/listbox', ['exports', '@angular/core', '@angular/cdk/a11y', '@angular/cdk/keycodes', '@angular/cdk/coercion', '@angular/cdk/collections', 'rxjs', 'rxjs/operators', '@angular/forms', '@angular/cdk-experimental/combobox', '@angular/cdk/bidi'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ng = global.ng || {}, global.ng.cdkExperimental = global.ng.cdkExperimental || {}, global.ng.cdkExperimental.listbox = {}), global.ng.core, global.ng.cdk.a11y, global.ng.cdk.keycodes, global.ng.cdk.coercion, global.ng.cdk.collections, global.rxjs, global.rxjs.operators, global.ng.forms, global.ng.cdkExperimental.combobox, global.ng.cdk.bidi));
5
- }(this, (function (exports, core, a11y, keycodes, coercion, collections, rxjs, operators, forms, combobox, bidi) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (Object.prototype.hasOwnProperty.call(b, p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- if (typeof b !== "function" && b !== null)
32
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
- var __assign = function () {
38
- __assign = Object.assign || function __assign(t) {
39
- for (var s, i = 1, n = arguments.length; i < n; i++) {
40
- s = arguments[i];
41
- for (var p in s)
42
- if (Object.prototype.hasOwnProperty.call(s, p))
43
- t[p] = s[p];
44
- }
45
- return t;
46
- };
47
- return __assign.apply(this, arguments);
48
- };
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s)
52
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53
- t[p] = s[p];
54
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
55
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57
- t[p[i]] = s[p[i]];
58
- }
59
- return t;
60
- }
61
- function __decorate(decorators, target, key, desc) {
62
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
64
- r = Reflect.decorate(decorators, target, key, desc);
65
- else
66
- for (var i = decorators.length - 1; i >= 0; i--)
67
- if (d = decorators[i])
68
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
69
- return c > 3 && r && Object.defineProperty(target, key, r), r;
70
- }
71
- function __param(paramIndex, decorator) {
72
- return function (target, key) { decorator(target, key, paramIndex); };
73
- }
74
- function __metadata(metadataKey, metadataValue) {
75
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
76
- return Reflect.metadata(metadataKey, metadataValue);
77
- }
78
- function __awaiter(thisArg, _arguments, P, generator) {
79
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
80
- return new (P || (P = Promise))(function (resolve, reject) {
81
- function fulfilled(value) { try {
82
- step(generator.next(value));
83
- }
84
- catch (e) {
85
- reject(e);
86
- } }
87
- function rejected(value) { try {
88
- step(generator["throw"](value));
89
- }
90
- catch (e) {
91
- reject(e);
92
- } }
93
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
94
- step((generator = generator.apply(thisArg, _arguments || [])).next());
95
- });
96
- }
97
- function __generator(thisArg, body) {
98
- var _ = { label: 0, sent: function () { if (t[0] & 1)
99
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
100
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
101
- function verb(n) { return function (v) { return step([n, v]); }; }
102
- function step(op) {
103
- if (f)
104
- throw new TypeError("Generator is already executing.");
105
- while (_)
106
- try {
107
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
108
- return t;
109
- if (y = 0, t)
110
- op = [op[0] & 2, t.value];
111
- switch (op[0]) {
112
- case 0:
113
- case 1:
114
- t = op;
115
- break;
116
- case 4:
117
- _.label++;
118
- return { value: op[1], done: false };
119
- case 5:
120
- _.label++;
121
- y = op[1];
122
- op = [0];
123
- continue;
124
- case 7:
125
- op = _.ops.pop();
126
- _.trys.pop();
127
- continue;
128
- default:
129
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
130
- _ = 0;
131
- continue;
132
- }
133
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
134
- _.label = op[1];
135
- break;
136
- }
137
- if (op[0] === 6 && _.label < t[1]) {
138
- _.label = t[1];
139
- t = op;
140
- break;
141
- }
142
- if (t && _.label < t[2]) {
143
- _.label = t[2];
144
- _.ops.push(op);
145
- break;
146
- }
147
- if (t[2])
148
- _.ops.pop();
149
- _.trys.pop();
150
- continue;
151
- }
152
- op = body.call(thisArg, _);
153
- }
154
- catch (e) {
155
- op = [6, e];
156
- y = 0;
157
- }
158
- finally {
159
- f = t = 0;
160
- }
161
- if (op[0] & 5)
162
- throw op[1];
163
- return { value: op[0] ? op[1] : void 0, done: true };
164
- }
165
- }
166
- var __createBinding = Object.create ? (function (o, m, k, k2) {
167
- if (k2 === undefined)
168
- k2 = k;
169
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
170
- }) : (function (o, m, k, k2) {
171
- if (k2 === undefined)
172
- k2 = k;
173
- o[k2] = m[k];
174
- });
175
- function __exportStar(m, o) {
176
- for (var p in m)
177
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
178
- __createBinding(o, m, p);
179
- }
180
- function __values(o) {
181
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
182
- if (m)
183
- return m.call(o);
184
- if (o && typeof o.length === "number")
185
- return {
186
- next: function () {
187
- if (o && i >= o.length)
188
- o = void 0;
189
- return { value: o && o[i++], done: !o };
190
- }
191
- };
192
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
193
- }
194
- function __read(o, n) {
195
- var m = typeof Symbol === "function" && o[Symbol.iterator];
196
- if (!m)
197
- return o;
198
- var i = m.call(o), r, ar = [], e;
199
- try {
200
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
201
- ar.push(r.value);
202
- }
203
- catch (error) {
204
- e = { error: error };
205
- }
206
- finally {
207
- try {
208
- if (r && !r.done && (m = i["return"]))
209
- m.call(i);
210
- }
211
- finally {
212
- if (e)
213
- throw e.error;
214
- }
215
- }
216
- return ar;
217
- }
218
- /** @deprecated */
219
- function __spread() {
220
- for (var ar = [], i = 0; i < arguments.length; i++)
221
- ar = ar.concat(__read(arguments[i]));
222
- return ar;
223
- }
224
- /** @deprecated */
225
- function __spreadArrays() {
226
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
227
- s += arguments[i].length;
228
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
229
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
230
- r[k] = a[j];
231
- return r;
232
- }
233
- function __spreadArray(to, from, pack) {
234
- if (pack || arguments.length === 2)
235
- for (var i = 0, l = from.length, ar; i < l; i++) {
236
- if (ar || !(i in from)) {
237
- if (!ar)
238
- ar = Array.prototype.slice.call(from, 0, i);
239
- ar[i] = from[i];
240
- }
241
- }
242
- return to.concat(ar || Array.prototype.slice.call(from));
243
- }
244
- function __await(v) {
245
- return this instanceof __await ? (this.v = v, this) : new __await(v);
246
- }
247
- function __asyncGenerator(thisArg, _arguments, generator) {
248
- if (!Symbol.asyncIterator)
249
- throw new TypeError("Symbol.asyncIterator is not defined.");
250
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
251
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
252
- function verb(n) { if (g[n])
253
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
254
- function resume(n, v) { try {
255
- step(g[n](v));
256
- }
257
- catch (e) {
258
- settle(q[0][3], e);
259
- } }
260
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
261
- function fulfill(value) { resume("next", value); }
262
- function reject(value) { resume("throw", value); }
263
- function settle(f, v) { if (f(v), q.shift(), q.length)
264
- resume(q[0][0], q[0][1]); }
265
- }
266
- function __asyncDelegator(o) {
267
- var i, p;
268
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
269
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
270
- }
271
- function __asyncValues(o) {
272
- if (!Symbol.asyncIterator)
273
- throw new TypeError("Symbol.asyncIterator is not defined.");
274
- var m = o[Symbol.asyncIterator], i;
275
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
276
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
277
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
278
- }
279
- function __makeTemplateObject(cooked, raw) {
280
- if (Object.defineProperty) {
281
- Object.defineProperty(cooked, "raw", { value: raw });
282
- }
283
- else {
284
- cooked.raw = raw;
285
- }
286
- return cooked;
287
- }
288
- ;
289
- var __setModuleDefault = Object.create ? (function (o, v) {
290
- Object.defineProperty(o, "default", { enumerable: true, value: v });
291
- }) : function (o, v) {
292
- o["default"] = v;
293
- };
294
- function __importStar(mod) {
295
- if (mod && mod.__esModule)
296
- return mod;
297
- var result = {};
298
- if (mod != null)
299
- for (var k in mod)
300
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
301
- __createBinding(result, mod, k);
302
- __setModuleDefault(result, mod);
303
- return result;
304
- }
305
- function __importDefault(mod) {
306
- return (mod && mod.__esModule) ? mod : { default: mod };
307
- }
308
- function __classPrivateFieldGet(receiver, state, kind, f) {
309
- if (kind === "a" && !f)
310
- throw new TypeError("Private accessor was defined without a getter");
311
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
312
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
313
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
314
- }
315
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
316
- if (kind === "m")
317
- throw new TypeError("Private method is not writable");
318
- if (kind === "a" && !f)
319
- throw new TypeError("Private accessor was defined without a setter");
320
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
321
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
322
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
323
- }
324
-
325
- var nextId = 0;
326
- var listboxId = 0;
327
- var CDK_LISTBOX_VALUE_ACCESSOR = {
328
- provide: forms.NG_VALUE_ACCESSOR,
329
- useExisting: core.forwardRef(function () { return CdkListbox; }),
330
- multi: true
331
- };
332
- var PANEL = new core.InjectionToken('CdkComboboxPanel');
333
- var CdkOption = /** @class */ (function () {
334
- function CdkOption(_elementRef, listbox) {
335
- this._elementRef = _elementRef;
336
- this.listbox = listbox;
337
- this._selected = false;
338
- this._disabled = false;
339
- this._active = false;
340
- /** The id of the option, set to a uniqueid if the user does not provide one. */
341
- this.id = "cdk-option-" + nextId++;
342
- this.selectionChange = new core.EventEmitter();
343
- }
344
- Object.defineProperty(CdkOption.prototype, "selected", {
345
- get: function () {
346
- return this._selected;
347
- },
348
- set: function (value) {
349
- if (!this._disabled) {
350
- this._selected = coercion.coerceBooleanProperty(value);
351
- }
352
- },
353
- enumerable: false,
354
- configurable: true
355
- });
356
- Object.defineProperty(CdkOption.prototype, "disabled", {
357
- get: function () {
358
- return this._disabled;
359
- },
360
- set: function (value) {
361
- this._disabled = coercion.coerceBooleanProperty(value);
362
- },
363
- enumerable: false,
364
- configurable: true
365
- });
366
- Object.defineProperty(CdkOption.prototype, "value", {
367
- /** The form value of the option. */
368
- get: function () {
369
- return this._value;
370
- },
371
- set: function (value) {
372
- if (this.selected && value !== this._value) {
373
- this.deselect();
374
- }
375
- this._value = value;
376
- },
377
- enumerable: false,
378
- configurable: true
379
- });
380
- /** Toggles the selected state, emits a change event through the injected listbox. */
381
- CdkOption.prototype.toggle = function () {
382
- if (!this._isInteractionDisabled()) {
383
- this.selected = !this.selected;
384
- this._emitSelectionChange(true);
385
- }
386
- };
387
- /** Sets the active property true if the option and listbox aren't disabled. */
388
- CdkOption.prototype.activate = function () {
389
- if (!this._isInteractionDisabled()) {
390
- this._active = true;
391
- }
392
- };
393
- /** Sets the active property false. */
394
- CdkOption.prototype.deactivate = function () {
395
- if (!this._isInteractionDisabled()) {
396
- this._active = false;
397
- }
398
- };
399
- /** Sets the selected property true if it was false. */
400
- CdkOption.prototype.select = function () {
401
- if (!this.selected) {
402
- this.selected = true;
403
- this._emitSelectionChange();
404
- }
405
- };
406
- /** Sets the selected property false if it was true. */
407
- CdkOption.prototype.deselect = function () {
408
- if (this.selected) {
409
- this.selected = false;
410
- this._emitSelectionChange();
411
- }
412
- };
413
- /** Applies focus to the option. */
414
- CdkOption.prototype.focus = function () {
415
- this._elementRef.nativeElement.focus();
416
- };
417
- /** Returns true if the option or listbox are disabled, and false otherwise. */
418
- CdkOption.prototype._isInteractionDisabled = function () {
419
- return (this.listbox.disabled || this._disabled);
420
- };
421
- /** Emits a change event extending the Option Selection Change Event interface. */
422
- CdkOption.prototype._emitSelectionChange = function (isUserInput) {
423
- if (isUserInput === void 0) { isUserInput = false; }
424
- this.selectionChange.emit({
425
- source: this,
426
- isUserInput: isUserInput
427
- });
428
- };
429
- /** Returns the tab index which depends on the disabled property. */
430
- CdkOption.prototype._getTabIndex = function () {
431
- return this._isInteractionDisabled() ? null : '-1';
432
- };
433
- /** Get the label for this element which is required by the FocusableOption interface. */
434
- CdkOption.prototype.getLabel = function () {
435
- var _a;
436
- // we know that the current node is an element type
437
- var clone = this._elementRef.nativeElement.cloneNode(true);
438
- this._removeIcons(clone);
439
- return ((_a = clone.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '';
440
- };
441
- /** Remove any child from the given element which can be identified as an icon. */
442
- CdkOption.prototype._removeIcons = function (element) {
443
- var e_1, _c;
444
- var _a;
445
- try {
446
- // TODO: make this a configurable function that can removed any desired type of node.
447
- for (var _d = __values(Array.from(element.querySelectorAll('mat-icon, .material-icons'))), _e = _d.next(); !_e.done; _e = _d.next()) {
448
- var icon = _e.value;
449
- (_a = icon.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(icon);
450
- }
451
- }
452
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
453
- finally {
454
- try {
455
- if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
456
- }
457
- finally { if (e_1) throw e_1.error; }
458
- }
459
- };
460
- CdkOption.prototype.getElementRef = function () {
461
- return this._elementRef;
462
- };
463
- /** Sets the active property to true to enable the active css class. */
464
- CdkOption.prototype.setActiveStyles = function () {
465
- this._active = true;
466
- };
467
- /** Sets the active property to false to disable the active css class. */
468
- CdkOption.prototype.setInactiveStyles = function () {
469
- this._active = false;
470
- };
471
- return CdkOption;
472
- }());
473
- CdkOption.decorators = [
474
- { type: core.Directive, args: [{
475
- selector: '[cdkOption]',
476
- exportAs: 'cdkOption',
477
- host: {
478
- 'role': 'option',
479
- 'class': 'cdk-option',
480
- '(click)': 'toggle()',
481
- '(focus)': 'activate()',
482
- '(blur)': 'deactivate()',
483
- '[id]': 'id',
484
- '[attr.aria-selected]': 'selected || null',
485
- '[attr.tabindex]': '_getTabIndex()',
486
- '[attr.aria-disabled]': '_isInteractionDisabled()',
487
- '[class.cdk-option-disabled]': '_isInteractionDisabled()',
488
- '[class.cdk-option-active]': '_active',
489
- '[class.cdk-option-selected]': 'selected'
490
- }
491
- },] }
492
- ];
493
- CdkOption.ctorParameters = function () { return [
494
- { type: core.ElementRef },
495
- { type: CdkListbox, decorators: [{ type: core.Inject, args: [core.forwardRef(function () { return CdkListbox; }),] }] }
496
- ]; };
497
- CdkOption.propDecorators = {
498
- id: [{ type: core.Input }],
499
- selected: [{ type: core.Input }],
500
- disabled: [{ type: core.Input }],
501
- value: [{ type: core.Input }],
502
- selectionChange: [{ type: core.Output }]
503
- };
504
- var CdkListbox = /** @class */ (function () {
505
- function CdkListbox(_parentPanel, _dir) {
506
- var _this = this;
507
- this._parentPanel = _parentPanel;
508
- this._dir = _dir;
509
- this._tabIndex = 0;
510
- /** `View -> model callback called when select has been touched` */
511
- this._onTouched = function () { };
512
- /** `View -> model callback called when value changes` */
513
- this._onChange = function () { };
514
- this.optionSelectionChanges = rxjs.defer(function () {
515
- var options = _this._options;
516
- return options.changes.pipe(operators.startWith(options), operators.switchMap(function () { return rxjs.merge.apply(void 0, __spreadArray([], __read(options.map(function (option) { return option.selectionChange; })))); }));
517
- });
518
- this._disabled = false;
519
- this._multiple = false;
520
- this._useActiveDescendant = false;
521
- this._autoFocus = true;
522
- this._destroyed = new rxjs.Subject();
523
- this.selectionChange = new core.EventEmitter();
524
- this.id = "cdk-listbox-" + listboxId++;
525
- /** Determines the orientation for the list key manager. Affects keyboard interaction. */
526
- this.orientation = 'vertical';
527
- this.compareWith = function (a1, a2) { return a1 === a2; };
528
- }
529
- Object.defineProperty(CdkListbox.prototype, "multiple", {
530
- /**
531
- * Whether the listbox allows multiple options to be selected.
532
- * If `multiple` switches from `true` to `false`, all options are deselected.
533
- */
534
- get: function () {
535
- return this._multiple;
536
- },
537
- set: function (value) {
538
- this._updateSelectionOnMultiSelectionChange(value);
539
- this._multiple = coercion.coerceBooleanProperty(value);
540
- },
541
- enumerable: false,
542
- configurable: true
543
- });
544
- Object.defineProperty(CdkListbox.prototype, "disabled", {
545
- get: function () {
546
- return this._disabled;
547
- },
548
- set: function (value) {
549
- this._disabled = coercion.coerceBooleanProperty(value);
550
- },
551
- enumerable: false,
552
- configurable: true
553
- });
554
- Object.defineProperty(CdkListbox.prototype, "useActiveDescendant", {
555
- /** Whether the listbox will use active descendant or will move focus onto the options. */
556
- get: function () {
557
- return this._useActiveDescendant;
558
- },
559
- set: function (shouldUseActiveDescendant) {
560
- this._useActiveDescendant = coercion.coerceBooleanProperty(shouldUseActiveDescendant);
561
- },
562
- enumerable: false,
563
- configurable: true
564
- });
565
- Object.defineProperty(CdkListbox.prototype, "autoFocus", {
566
- /** Whether on focus the listbox will focus its active option, default to true. */
567
- get: function () {
568
- return this._autoFocus;
569
- },
570
- set: function (shouldAutoFocus) {
571
- this._autoFocus = coercion.coerceBooleanProperty(shouldAutoFocus);
572
- },
573
- enumerable: false,
574
- configurable: true
575
- });
576
- CdkListbox.prototype.ngOnInit = function () {
577
- this._selectionModel = new collections.SelectionModel(this.multiple);
578
- };
579
- CdkListbox.prototype.ngAfterContentInit = function () {
580
- var _this = this;
581
- this._initKeyManager();
582
- this._initSelectionModel();
583
- this._registerWithPanel();
584
- this.optionSelectionChanges.subscribe(function (event) {
585
- _this._emitChangeEvent(event.source);
586
- _this._updateSelectionModel(event.source);
587
- _this.setActiveOption(event.source);
588
- _this._updatePanelForSelection(event.source);
589
- });
590
- };
591
- CdkListbox.prototype.ngOnDestroy = function () {
592
- this._listKeyManager.change.complete();
593
- this._destroyed.next();
594
- this._destroyed.complete();
595
- };
596
- CdkListbox.prototype._registerWithPanel = function () {
597
- var panel = this._parentPanel || this._explicitPanel;
598
- panel === null || panel === void 0 ? void 0 : panel._registerContent(this.id, 'listbox');
599
- };
600
- CdkListbox.prototype._initKeyManager = function () {
601
- var _this = this;
602
- var _a;
603
- this._listKeyManager = new a11y.ActiveDescendantKeyManager(this._options)
604
- .withWrap()
605
- .withTypeAhead()
606
- .withHomeAndEnd()
607
- .withAllowedModifierKeys(['shiftKey']);
608
- if (this.orientation === 'vertical') {
609
- this._listKeyManager.withVerticalOrientation();
610
- }
611
- else {
612
- this._listKeyManager.withHorizontalOrientation(((_a = this._dir) === null || _a === void 0 ? void 0 : _a.value) || 'ltr');
613
- }
614
- this._listKeyManager.change.pipe(operators.takeUntil(this._destroyed)).subscribe(function () {
615
- _this._updateActiveOption();
616
- });
617
- };
618
- CdkListbox.prototype._initSelectionModel = function () {
619
- this._selectionModel.changed.pipe(operators.takeUntil(this._destroyed))
620
- .subscribe(function (event) {
621
- var e_2, _c, e_3, _d;
622
- try {
623
- for (var _e = __values(event.added), _f = _e.next(); !_f.done; _f = _e.next()) {
624
- var option = _f.value;
625
- option.selected = true;
626
- }
627
- }
628
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
629
- finally {
630
- try {
631
- if (_f && !_f.done && (_c = _e.return)) _c.call(_e);
632
- }
633
- finally { if (e_2) throw e_2.error; }
634
- }
635
- try {
636
- for (var _g = __values(event.removed), _h = _g.next(); !_h.done; _h = _g.next()) {
637
- var option = _h.value;
638
- option.selected = false;
639
- }
640
- }
641
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
642
- finally {
643
- try {
644
- if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
645
- }
646
- finally { if (e_3) throw e_3.error; }
647
- }
648
- });
649
- };
650
- CdkListbox.prototype._keydown = function (event) {
651
- if (this._disabled) {
652
- return;
653
- }
654
- var manager = this._listKeyManager;
655
- var keyCode = event.keyCode;
656
- var previousActiveIndex = manager.activeItemIndex;
657
- if (keyCode === keycodes.SPACE || keyCode === keycodes.ENTER) {
658
- if (manager.activeItem && !manager.isTyping()) {
659
- this._toggleActiveOption();
660
- }
661
- event.preventDefault();
662
- }
663
- else {
664
- manager.onKeydown(event);
665
- }
666
- /** Will select an option if shift was pressed while navigating to the option */
667
- var isArrow = (keyCode === keycodes.UP_ARROW
668
- || keyCode === keycodes.DOWN_ARROW
669
- || keyCode === keycodes.LEFT_ARROW
670
- || keyCode === keycodes.RIGHT_ARROW);
671
- if (isArrow && event.shiftKey && previousActiveIndex !== this._listKeyManager.activeItemIndex) {
672
- this._toggleActiveOption();
673
- }
674
- };
675
- /** Emits a selection change event, called when an option has its selected state changed. */
676
- CdkListbox.prototype._emitChangeEvent = function (option) {
677
- this.selectionChange.emit({
678
- source: this,
679
- option: option
680
- });
681
- };
682
- /** Updates the selection model after a toggle. */
683
- CdkListbox.prototype._updateSelectionModel = function (option) {
684
- if (!this.multiple && this._selectionModel.selected.length !== 0) {
685
- var previouslySelected = this._selectionModel.selected[0];
686
- this.deselect(previouslySelected);
687
- }
688
- option.selected ? this._selectionModel.select(option) :
689
- this._selectionModel.deselect(option);
690
- };
691
- CdkListbox.prototype._updatePanelForSelection = function (option) {
692
- var panel = this._parentPanel || this._explicitPanel;
693
- if (!this.multiple) {
694
- option.selected ? panel === null || panel === void 0 ? void 0 : panel.closePanel(option.value) : panel === null || panel === void 0 ? void 0 : panel.closePanel();
695
- }
696
- else {
697
- panel === null || panel === void 0 ? void 0 : panel.closePanel(this.getSelectedValues());
698
- }
699
- };
700
- /** Toggles the selected state of the active option if not disabled. */
701
- CdkListbox.prototype._toggleActiveOption = function () {
702
- var activeOption = this._listKeyManager.activeItem;
703
- if (activeOption && !activeOption.disabled) {
704
- activeOption.toggle();
705
- }
706
- };
707
- /** Returns the id of the active option if active descendant is being used. */
708
- CdkListbox.prototype._getAriaActiveDescendant = function () {
709
- var _a, _b;
710
- return this._useActiveDescendant ? (_b = (_a = this._listKeyManager) === null || _a === void 0 ? void 0 : _a.activeItem) === null || _b === void 0 ? void 0 : _b.id : null;
711
- };
712
- /** Updates the activeOption and the active and focus properties of the option. */
713
- CdkListbox.prototype._updateActiveOption = function () {
714
- var _a;
715
- if (!this._listKeyManager.activeItem) {
716
- return;
717
- }
718
- (_a = this._activeOption) === null || _a === void 0 ? void 0 : _a.deactivate();
719
- this._activeOption = this._listKeyManager.activeItem;
720
- this._activeOption.activate();
721
- if (!this.useActiveDescendant) {
722
- this._activeOption.focus();
723
- }
724
- };
725
- /** Updates selection states of options when the 'multiple' property changes. */
726
- CdkListbox.prototype._updateSelectionOnMultiSelectionChange = function (value) {
727
- var _a;
728
- if (this.multiple && !value) {
729
- // Deselect all options instead of arbitrarily keeping one of the selected options.
730
- this.setAllSelected(false);
731
- }
732
- else if (!this.multiple && value) {
733
- this._selectionModel =
734
- new collections.SelectionModel(value, (_a = this._selectionModel) === null || _a === void 0 ? void 0 : _a.selected);
735
- }
736
- };
737
- CdkListbox.prototype._focusActiveOption = function () {
738
- if (!this.autoFocus) {
739
- return;
740
- }
741
- if (this._listKeyManager.activeItem) {
742
- this.setActiveOption(this._listKeyManager.activeItem);
743
- }
744
- else if (this._options.first) {
745
- this.setActiveOption(this._options.first);
746
- }
747
- };
748
- /** Selects the given option if the option and listbox aren't disabled. */
749
- CdkListbox.prototype.select = function (option) {
750
- if (!this.disabled && !option.disabled) {
751
- option.select();
752
- }
753
- };
754
- /** Deselects the given option if the option and listbox aren't disabled. */
755
- CdkListbox.prototype.deselect = function (option) {
756
- if (!this.disabled && !option.disabled) {
757
- option.deselect();
758
- }
759
- };
760
- /** Sets the selected state of all options to be the given value. */
761
- CdkListbox.prototype.setAllSelected = function (isSelected) {
762
- var e_4, _c;
763
- try {
764
- for (var _d = __values(this._options.toArray()), _e = _d.next(); !_e.done; _e = _d.next()) {
765
- var option = _e.value;
766
- isSelected ? this.select(option) : this.deselect(option);
767
- }
768
- }
769
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
770
- finally {
771
- try {
772
- if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
773
- }
774
- finally { if (e_4) throw e_4.error; }
775
- }
776
- };
777
- /** Updates the key manager's active item to the given option. */
778
- CdkListbox.prototype.setActiveOption = function (option) {
779
- this._listKeyManager.updateActiveItem(option);
780
- this._updateActiveOption();
781
- };
782
- /**
783
- * Saves a callback function to be invoked when the select's value
784
- * changes from user input. Required to implement ControlValueAccessor.
785
- */
786
- CdkListbox.prototype.registerOnChange = function (fn) {
787
- this._onChange = fn;
788
- };
789
- /**
790
- * Saves a callback function to be invoked when the select is blurred
791
- * by the user. Required to implement ControlValueAccessor.
792
- */
793
- CdkListbox.prototype.registerOnTouched = function (fn) {
794
- this._onTouched = fn;
795
- };
796
- /** Sets the select's value. Required to implement ControlValueAccessor. */
797
- CdkListbox.prototype.writeValue = function (values) {
798
- if (this._options) {
799
- this._setSelectionByValue(values);
800
- }
801
- };
802
- /** Disables the select. Required to implement ControlValueAccessor. */
803
- CdkListbox.prototype.setDisabledState = function (isDisabled) {
804
- this.disabled = isDisabled;
805
- };
806
- /** Returns the values of the currently selected options. */
807
- CdkListbox.prototype.getSelectedValues = function () {
808
- return this._options.filter(function (option) { return option.selected; }).map(function (option) { return option.value; });
809
- };
810
- /** Selects an option that has the corresponding given value. */
811
- CdkListbox.prototype._setSelectionByValue = function (values) {
812
- var e_5, _c, e_6, _d;
813
- var _this = this;
814
- try {
815
- for (var _e = __values(this._options.toArray()), _f = _e.next(); !_f.done; _f = _e.next()) {
816
- var option = _f.value;
817
- this.deselect(option);
818
- }
819
- }
820
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
821
- finally {
822
- try {
823
- if (_f && !_f.done && (_c = _e.return)) _c.call(_e);
824
- }
825
- finally { if (e_5) throw e_5.error; }
826
- }
827
- var valuesArray = coercion.coerceArray(values);
828
- var _loop_1 = function (value) {
829
- var correspondingOption = this_1._options.find(function (option) {
830
- return option.value != null && _this.compareWith(option.value, value);
831
- });
832
- if (correspondingOption) {
833
- this_1.select(correspondingOption);
834
- if (!this_1.multiple) {
835
- return { value: void 0 };
836
- }
837
- }
838
- };
839
- var this_1 = this;
840
- try {
841
- for (var valuesArray_1 = __values(valuesArray), valuesArray_1_1 = valuesArray_1.next(); !valuesArray_1_1.done; valuesArray_1_1 = valuesArray_1.next()) {
842
- var value = valuesArray_1_1.value;
843
- var state_1 = _loop_1(value);
844
- if (typeof state_1 === "object")
845
- return state_1.value;
846
- }
847
- }
848
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
849
- finally {
850
- try {
851
- if (valuesArray_1_1 && !valuesArray_1_1.done && (_d = valuesArray_1.return)) _d.call(valuesArray_1);
852
- }
853
- finally { if (e_6) throw e_6.error; }
854
- }
855
- };
856
- return CdkListbox;
857
- }());
858
- CdkListbox.decorators = [
859
- { type: core.Directive, args: [{
860
- selector: '[cdkListbox]',
861
- exportAs: 'cdkListbox',
862
- host: {
863
- 'role': 'listbox',
864
- 'class': 'cdk-listbox',
865
- '[id]': 'id',
866
- '(focus)': '_focusActiveOption()',
867
- '(keydown)': '_keydown($event)',
868
- '[attr.tabindex]': '_tabIndex',
869
- '[attr.aria-disabled]': 'disabled',
870
- '[attr.aria-multiselectable]': 'multiple',
871
- '[attr.aria-activedescendant]': '_getAriaActiveDescendant()',
872
- '[attr.aria-orientation]': 'orientation'
873
- },
874
- providers: [CDK_LISTBOX_VALUE_ACCESSOR]
875
- },] }
876
- ];
877
- CdkListbox.ctorParameters = function () { return [
878
- { type: combobox.CdkComboboxPanel, decorators: [{ type: core.Optional }, { type: core.Inject, args: [PANEL,] }] },
879
- { type: bidi.Directionality, decorators: [{ type: core.Optional }] }
880
- ]; };
881
- CdkListbox.propDecorators = {
882
- _options: [{ type: core.ContentChildren, args: [CdkOption, { descendants: true },] }],
883
- selectionChange: [{ type: core.Output }],
884
- id: [{ type: core.Input }],
885
- multiple: [{ type: core.Input }],
886
- disabled: [{ type: core.Input }],
887
- useActiveDescendant: [{ type: core.Input }],
888
- autoFocus: [{ type: core.Input }],
889
- orientation: [{ type: core.Input, args: ['listboxOrientation',] }],
890
- compareWith: [{ type: core.Input }],
891
- _explicitPanel: [{ type: core.Input, args: ['parentPanel',] }]
892
- };
893
-
894
- /**
895
- * @license
896
- * Copyright Google LLC All Rights Reserved.
897
- *
898
- * Use of this source code is governed by an MIT-style license that can be
899
- * found in the LICENSE file at https://angular.io/license
900
- */
901
- var EXPORTED_DECLARATIONS = [CdkListbox, CdkOption];
902
- var CdkListboxModule = /** @class */ (function () {
903
- function CdkListboxModule() {
904
- }
905
- return CdkListboxModule;
906
- }());
907
- CdkListboxModule.decorators = [
908
- { type: core.NgModule, args: [{
909
- exports: EXPORTED_DECLARATIONS,
910
- declarations: EXPORTED_DECLARATIONS,
911
- },] }
912
- ];
913
-
914
- /**
915
- * @license
916
- * Copyright Google LLC All Rights Reserved.
917
- *
918
- * Use of this source code is governed by an MIT-style license that can be
919
- * found in the LICENSE file at https://angular.io/license
920
- */
921
-
922
- /**
923
- * Generated bundle index. Do not edit.
924
- */
925
-
926
- exports.CDK_LISTBOX_VALUE_ACCESSOR = CDK_LISTBOX_VALUE_ACCESSOR;
927
- exports.CdkListbox = CdkListbox;
928
- exports.CdkListboxModule = CdkListboxModule;
929
- exports.CdkOption = CdkOption;
930
- exports.PANEL = PANEL;
931
-
932
- Object.defineProperty(exports, '__esModule', { value: true });
933
-
934
- })));
935
- //# sourceMappingURL=cdk-experimental-listbox.umd.js.map