@ifsworld/granite-components 4.5.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) hide show
  1. package/esm2020/ifsworld-granite-components.mjs +5 -0
  2. package/esm2020/index.mjs +48 -0
  3. package/esm2020/lib/arrange-grid/arrange-grid-item.component.mjs +44 -0
  4. package/esm2020/lib/arrange-grid/arrange-grid.component.mjs +125 -0
  5. package/esm2020/lib/arrange-grid/arrange-grid.module.mjs +19 -0
  6. package/esm2020/lib/badge/badge.component.mjs +39 -0
  7. package/esm2020/lib/badge/badge.module.mjs +18 -0
  8. package/esm2020/lib/badge/testing/badge.harness.mjs +25 -0
  9. package/esm2020/lib/button/button.component.mjs +89 -0
  10. package/esm2020/lib/button/button.module.mjs +16 -0
  11. package/esm2020/lib/checkbox/checkbox-group.component.mjs +17 -0
  12. package/esm2020/lib/checkbox/checkbox.component.mjs +96 -0
  13. package/esm2020/lib/checkbox/checkbox.module.mjs +17 -0
  14. package/esm2020/lib/core/animation.mjs +34 -0
  15. package/esm2020/lib/core/client-environment.mjs +20 -0
  16. package/esm2020/lib/core/common-behaviors/disabled.mjs +27 -0
  17. package/esm2020/lib/core/core.module.mjs +36 -0
  18. package/esm2020/lib/core/devices/client-input-desktop.directive.mjs +29 -0
  19. package/esm2020/lib/core/devices/client-input-touch.directive.mjs +29 -0
  20. package/esm2020/lib/core/devices/client-output-desktop.directive.mjs +29 -0
  21. package/esm2020/lib/core/devices/client-output-touch.directive.mjs +29 -0
  22. package/esm2020/lib/core/pipes/pure-pipes.module.mjs +16 -0
  23. package/esm2020/lib/core/pipes/title.pipe.mjs +21 -0
  24. package/esm2020/lib/core/radio-checkbox-base.mjs +19 -0
  25. package/esm2020/lib/core/theme.library.mjs +59 -0
  26. package/esm2020/lib/core/types.mjs +2 -0
  27. package/esm2020/lib/grid/grid.component.mjs +128 -0
  28. package/esm2020/lib/grid/grid.module.mjs +18 -0
  29. package/esm2020/lib/icon/icon.component.mjs +43 -0
  30. package/esm2020/lib/icon/icon.module.mjs +16 -0
  31. package/esm2020/lib/input-field/input-field.component.mjs +160 -0
  32. package/esm2020/lib/input-field/input-field.module.mjs +20 -0
  33. package/esm2020/lib/menu/divider.directive.mjs +23 -0
  34. package/esm2020/lib/menu/menu-base.mjs +347 -0
  35. package/esm2020/lib/menu/menu-desktop-animations.mjs +23 -0
  36. package/esm2020/lib/menu/menu-errors.mjs +37 -0
  37. package/esm2020/lib/menu/menu-item.component.mjs +91 -0
  38. package/esm2020/lib/menu/menu-panel.mjs +7 -0
  39. package/esm2020/lib/menu/menu-positions.mjs +9 -0
  40. package/esm2020/lib/menu/menu-touch-animations.mjs +137 -0
  41. package/esm2020/lib/menu/menu-touch-close.component.mjs +13 -0
  42. package/esm2020/lib/menu/menu-touch-title.component.mjs +59 -0
  43. package/esm2020/lib/menu/menu-trigger-for.directive.mjs +702 -0
  44. package/esm2020/lib/menu/menu.component.mjs +30 -0
  45. package/esm2020/lib/menu/menu.module.mjs +55 -0
  46. package/esm2020/lib/menu/testing/menu.harness.mjs +109 -0
  47. package/esm2020/lib/menu/title.directive.mjs +17 -0
  48. package/esm2020/lib/radio-button/radio-button.component.mjs +118 -0
  49. package/esm2020/lib/radio-button/radio-button.module.mjs +17 -0
  50. package/esm2020/lib/radio-button/radio-group.component.mjs +17 -0
  51. package/esm2020/lib/table/cell/cell.mjs +15 -0
  52. package/esm2020/lib/table/cell/table-data-cell.component.mjs +26 -0
  53. package/esm2020/lib/table/cell/table-header-cell.component.mjs +12 -0
  54. package/esm2020/lib/table/column/table-column.directive.mjs +23 -0
  55. package/esm2020/lib/table/table-constants.library.mjs +4 -0
  56. package/esm2020/lib/table/table.component.mjs +36 -0
  57. package/esm2020/lib/table/table.module.mjs +32 -0
  58. package/esm2020/lib/toggle-switch/toggle-switch.component.mjs +96 -0
  59. package/esm2020/lib/toggle-switch/toggle-switch.module.mjs +16 -0
  60. package/fesm2015/ifsworld-granite-components.mjs +3145 -0
  61. package/fesm2015/ifsworld-granite-components.mjs.map +1 -0
  62. package/fesm2020/ifsworld-granite-components.mjs +3103 -0
  63. package/fesm2020/ifsworld-granite-components.mjs.map +1 -0
  64. package/ifsworld-granite-components.d.ts +1 -8
  65. package/lib/arrange-grid/arrange-grid-item.component.d.ts +3 -0
  66. package/lib/arrange-grid/arrange-grid.component.d.ts +3 -0
  67. package/lib/arrange-grid/arrange-grid.module.d.ts +7 -0
  68. package/lib/badge/badge.component.d.ts +3 -0
  69. package/lib/badge/badge.module.d.ts +6 -0
  70. package/lib/button/button.component.d.ts +5 -0
  71. package/lib/button/button.module.d.ts +5 -0
  72. package/lib/checkbox/checkbox-group.component.d.ts +3 -0
  73. package/lib/checkbox/checkbox.component.d.ts +3 -0
  74. package/lib/checkbox/checkbox.module.d.ts +6 -0
  75. package/lib/core/core.module.d.ts +8 -0
  76. package/lib/core/devices/client-input-desktop.directive.d.ts +3 -0
  77. package/lib/core/devices/client-input-touch.directive.d.ts +3 -0
  78. package/lib/core/devices/client-output-desktop.directive.d.ts +3 -0
  79. package/lib/core/devices/client-output-touch.directive.d.ts +3 -0
  80. package/lib/core/pipes/pure-pipes.module.d.ts +5 -0
  81. package/lib/core/pipes/title.pipe.d.ts +3 -0
  82. package/lib/core/radio-checkbox-base.d.ts +3 -0
  83. package/lib/grid/grid.component.d.ts +5 -0
  84. package/lib/grid/grid.module.d.ts +6 -0
  85. package/lib/icon/icon.component.d.ts +3 -0
  86. package/lib/icon/icon.module.d.ts +5 -0
  87. package/lib/input-field/input-field.component.d.ts +3 -0
  88. package/lib/input-field/input-field.module.d.ts +8 -0
  89. package/lib/menu/divider.directive.d.ts +3 -0
  90. package/lib/menu/menu-base.d.ts +190 -0
  91. package/lib/menu/menu-item.component.d.ts +3 -0
  92. package/lib/menu/menu-touch-close.component.d.ts +3 -0
  93. package/lib/menu/menu-touch-title.component.d.ts +4 -1
  94. package/lib/menu/menu-trigger-for.directive.d.ts +4 -1
  95. package/lib/menu/menu.component.d.ts +4 -187
  96. package/lib/menu/menu.module.d.ts +15 -0
  97. package/lib/menu/title.directive.d.ts +3 -0
  98. package/lib/radio-button/radio-button.component.d.ts +3 -0
  99. package/lib/radio-button/radio-button.module.d.ts +6 -0
  100. package/lib/radio-button/radio-group.component.d.ts +3 -0
  101. package/lib/table/cell/cell.d.ts +3 -0
  102. package/lib/table/cell/table-data-cell.component.d.ts +3 -0
  103. package/lib/table/cell/table-header-cell.component.d.ts +3 -0
  104. package/lib/table/column/table-column.directive.d.ts +3 -0
  105. package/lib/table/table.component.d.ts +3 -0
  106. package/lib/table/table.module.d.ts +12 -0
  107. package/lib/toggle-switch/toggle-switch.component.d.ts +3 -0
  108. package/lib/toggle-switch/toggle-switch.module.d.ts +5 -0
  109. package/package.json +25 -12
  110. package/bundles/ifsworld-granite-components.umd.js +0 -3648
  111. package/bundles/ifsworld-granite-components.umd.js.map +0 -1
  112. package/bundles/ifsworld-granite-components.umd.min.js +0 -10
  113. package/bundles/ifsworld-granite-components.umd.min.js.map +0 -1
  114. package/esm2015/ifsworld-granite-components.js +0 -13
  115. package/esm2015/ifsworld-granite-components.js.map +0 -1
  116. package/esm2015/ifsworld-granite-components.metadata.json +0 -1
  117. package/esm2015/index.js +0 -48
  118. package/esm2015/index.js.map +0 -1
  119. package/esm2015/index.metadata.json +0 -1
  120. package/esm2015/lib/arrange-grid/arrange-grid-item.component.js +0 -48
  121. package/esm2015/lib/arrange-grid/arrange-grid-item.component.js.map +0 -1
  122. package/esm2015/lib/arrange-grid/arrange-grid-item.component.metadata.json +0 -1
  123. package/esm2015/lib/arrange-grid/arrange-grid.component.js +0 -123
  124. package/esm2015/lib/arrange-grid/arrange-grid.component.js.map +0 -1
  125. package/esm2015/lib/arrange-grid/arrange-grid.component.metadata.json +0 -1
  126. package/esm2015/lib/arrange-grid/arrange-grid.module.js +0 -14
  127. package/esm2015/lib/arrange-grid/arrange-grid.module.js.map +0 -1
  128. package/esm2015/lib/arrange-grid/arrange-grid.module.metadata.json +0 -1
  129. package/esm2015/lib/badge/badge.component.js +0 -44
  130. package/esm2015/lib/badge/badge.component.js.map +0 -1
  131. package/esm2015/lib/badge/badge.component.metadata.json +0 -1
  132. package/esm2015/lib/badge/badge.module.js +0 -13
  133. package/esm2015/lib/badge/badge.module.js.map +0 -1
  134. package/esm2015/lib/badge/badge.module.metadata.json +0 -1
  135. package/esm2015/lib/badge/testing/badge.harness.js +0 -30
  136. package/esm2015/lib/badge/testing/badge.harness.js.map +0 -1
  137. package/esm2015/lib/badge/testing/badge.harness.metadata.json +0 -1
  138. package/esm2015/lib/button/button.component.js +0 -108
  139. package/esm2015/lib/button/button.component.js.map +0 -1
  140. package/esm2015/lib/button/button.component.metadata.json +0 -1
  141. package/esm2015/lib/button/button.module.js +0 -11
  142. package/esm2015/lib/button/button.module.js.map +0 -1
  143. package/esm2015/lib/button/button.module.metadata.json +0 -1
  144. package/esm2015/lib/checkbox/checkbox-group.component.js +0 -19
  145. package/esm2015/lib/checkbox/checkbox-group.component.js.map +0 -1
  146. package/esm2015/lib/checkbox/checkbox-group.component.metadata.json +0 -1
  147. package/esm2015/lib/checkbox/checkbox.component.js +0 -89
  148. package/esm2015/lib/checkbox/checkbox.component.js.map +0 -1
  149. package/esm2015/lib/checkbox/checkbox.component.metadata.json +0 -1
  150. package/esm2015/lib/checkbox/checkbox.module.js +0 -12
  151. package/esm2015/lib/checkbox/checkbox.module.js.map +0 -1
  152. package/esm2015/lib/checkbox/checkbox.module.metadata.json +0 -1
  153. package/esm2015/lib/core/animation.js +0 -34
  154. package/esm2015/lib/core/animation.js.map +0 -1
  155. package/esm2015/lib/core/animation.metadata.json +0 -1
  156. package/esm2015/lib/core/client-environment.js +0 -20
  157. package/esm2015/lib/core/client-environment.js.map +0 -1
  158. package/esm2015/lib/core/client-environment.metadata.json +0 -1
  159. package/esm2015/lib/core/common-behaviors/disabled.js +0 -25
  160. package/esm2015/lib/core/common-behaviors/disabled.js.map +0 -1
  161. package/esm2015/lib/core/common-behaviors/disabled.metadata.json +0 -1
  162. package/esm2015/lib/core/core.module.js +0 -25
  163. package/esm2015/lib/core/core.module.js.map +0 -1
  164. package/esm2015/lib/core/core.module.metadata.json +0 -1
  165. package/esm2015/lib/core/devices/client-input-desktop.directive.js +0 -22
  166. package/esm2015/lib/core/devices/client-input-desktop.directive.js.map +0 -1
  167. package/esm2015/lib/core/devices/client-input-desktop.directive.metadata.json +0 -1
  168. package/esm2015/lib/core/devices/client-input-touch.directive.js +0 -22
  169. package/esm2015/lib/core/devices/client-input-touch.directive.js.map +0 -1
  170. package/esm2015/lib/core/devices/client-input-touch.directive.metadata.json +0 -1
  171. package/esm2015/lib/core/devices/client-output-desktop.directive.js +0 -22
  172. package/esm2015/lib/core/devices/client-output-desktop.directive.js.map +0 -1
  173. package/esm2015/lib/core/devices/client-output-desktop.directive.metadata.json +0 -1
  174. package/esm2015/lib/core/devices/client-output-touch.directive.js +0 -22
  175. package/esm2015/lib/core/devices/client-output-touch.directive.js.map +0 -1
  176. package/esm2015/lib/core/devices/client-output-touch.directive.metadata.json +0 -1
  177. package/esm2015/lib/core/pipes/pure-pipes.module.js +0 -11
  178. package/esm2015/lib/core/pipes/pure-pipes.module.js.map +0 -1
  179. package/esm2015/lib/core/pipes/pure-pipes.module.metadata.json +0 -1
  180. package/esm2015/lib/core/pipes/title.pipe.js +0 -17
  181. package/esm2015/lib/core/pipes/title.pipe.js.map +0 -1
  182. package/esm2015/lib/core/pipes/title.pipe.metadata.json +0 -1
  183. package/esm2015/lib/core/radio-checkbox-base.js +0 -15
  184. package/esm2015/lib/core/radio-checkbox-base.js.map +0 -1
  185. package/esm2015/lib/core/radio-checkbox-base.metadata.json +0 -1
  186. package/esm2015/lib/core/theme.library.js +0 -59
  187. package/esm2015/lib/core/theme.library.js.map +0 -1
  188. package/esm2015/lib/core/theme.library.metadata.json +0 -1
  189. package/esm2015/lib/core/types.js +0 -2
  190. package/esm2015/lib/core/types.js.map +0 -1
  191. package/esm2015/lib/core/types.metadata.json +0 -1
  192. package/esm2015/lib/grid/grid.component.js +0 -131
  193. package/esm2015/lib/grid/grid.component.js.map +0 -1
  194. package/esm2015/lib/grid/grid.component.metadata.json +0 -1
  195. package/esm2015/lib/grid/grid.module.js +0 -13
  196. package/esm2015/lib/grid/grid.module.js.map +0 -1
  197. package/esm2015/lib/grid/grid.module.metadata.json +0 -1
  198. package/esm2015/lib/icon/icon.component.js +0 -48
  199. package/esm2015/lib/icon/icon.component.js.map +0 -1
  200. package/esm2015/lib/icon/icon.component.metadata.json +0 -1
  201. package/esm2015/lib/icon/icon.module.js +0 -11
  202. package/esm2015/lib/icon/icon.module.js.map +0 -1
  203. package/esm2015/lib/icon/icon.module.metadata.json +0 -1
  204. package/esm2015/lib/input-field/input-field.component.js +0 -144
  205. package/esm2015/lib/input-field/input-field.component.js.map +0 -1
  206. package/esm2015/lib/input-field/input-field.component.metadata.json +0 -1
  207. package/esm2015/lib/input-field/input-field.module.js +0 -15
  208. package/esm2015/lib/input-field/input-field.module.js.map +0 -1
  209. package/esm2015/lib/input-field/input-field.module.metadata.json +0 -1
  210. package/esm2015/lib/menu/divider.directive.js +0 -20
  211. package/esm2015/lib/menu/divider.directive.js.map +0 -1
  212. package/esm2015/lib/menu/divider.directive.metadata.json +0 -1
  213. package/esm2015/lib/menu/menu-desktop-animations.js +0 -23
  214. package/esm2015/lib/menu/menu-desktop-animations.js.map +0 -1
  215. package/esm2015/lib/menu/menu-desktop-animations.metadata.json +0 -1
  216. package/esm2015/lib/menu/menu-errors.js +0 -37
  217. package/esm2015/lib/menu/menu-errors.js.map +0 -1
  218. package/esm2015/lib/menu/menu-errors.metadata.json +0 -1
  219. package/esm2015/lib/menu/menu-item.component.js +0 -82
  220. package/esm2015/lib/menu/menu-item.component.js.map +0 -1
  221. package/esm2015/lib/menu/menu-item.component.metadata.json +0 -1
  222. package/esm2015/lib/menu/menu-panel.js +0 -7
  223. package/esm2015/lib/menu/menu-panel.js.map +0 -1
  224. package/esm2015/lib/menu/menu-panel.metadata.json +0 -1
  225. package/esm2015/lib/menu/menu-positions.js +0 -9
  226. package/esm2015/lib/menu/menu-positions.js.map +0 -1
  227. package/esm2015/lib/menu/menu-positions.metadata.json +0 -1
  228. package/esm2015/lib/menu/menu-touch-animations.js +0 -137
  229. package/esm2015/lib/menu/menu-touch-animations.js.map +0 -1
  230. package/esm2015/lib/menu/menu-touch-animations.metadata.json +0 -1
  231. package/esm2015/lib/menu/menu-touch-close.component.js +0 -16
  232. package/esm2015/lib/menu/menu-touch-close.component.js.map +0 -1
  233. package/esm2015/lib/menu/menu-touch-close.component.metadata.json +0 -1
  234. package/esm2015/lib/menu/menu-touch-title.component.js +0 -45
  235. package/esm2015/lib/menu/menu-touch-title.component.js.map +0 -1
  236. package/esm2015/lib/menu/menu-touch-title.component.metadata.json +0 -1
  237. package/esm2015/lib/menu/menu-trigger-for.directive.js +0 -684
  238. package/esm2015/lib/menu/menu-trigger-for.directive.js.map +0 -1
  239. package/esm2015/lib/menu/menu-trigger-for.directive.metadata.json +0 -1
  240. package/esm2015/lib/menu/menu.component.js +0 -362
  241. package/esm2015/lib/menu/menu.component.js.map +0 -1
  242. package/esm2015/lib/menu/menu.component.metadata.json +0 -1
  243. package/esm2015/lib/menu/menu.module.js +0 -38
  244. package/esm2015/lib/menu/menu.module.js.map +0 -1
  245. package/esm2015/lib/menu/menu.module.metadata.json +0 -1
  246. package/esm2015/lib/menu/testing/menu.harness.js +0 -133
  247. package/esm2015/lib/menu/testing/menu.harness.js.map +0 -1
  248. package/esm2015/lib/menu/testing/menu.harness.metadata.json +0 -1
  249. package/esm2015/lib/menu/title.directive.js +0 -13
  250. package/esm2015/lib/menu/title.directive.js.map +0 -1
  251. package/esm2015/lib/menu/title.directive.metadata.json +0 -1
  252. package/esm2015/lib/radio-button/radio-button.component.js +0 -109
  253. package/esm2015/lib/radio-button/radio-button.component.js.map +0 -1
  254. package/esm2015/lib/radio-button/radio-button.component.metadata.json +0 -1
  255. package/esm2015/lib/radio-button/radio-button.module.js +0 -12
  256. package/esm2015/lib/radio-button/radio-button.module.js.map +0 -1
  257. package/esm2015/lib/radio-button/radio-button.module.metadata.json +0 -1
  258. package/esm2015/lib/radio-button/radio-group.component.js +0 -19
  259. package/esm2015/lib/radio-button/radio-group.component.js.map +0 -1
  260. package/esm2015/lib/radio-button/radio-group.component.metadata.json +0 -1
  261. package/esm2015/lib/table/cell/cell.js +0 -12
  262. package/esm2015/lib/table/cell/cell.js.map +0 -1
  263. package/esm2015/lib/table/cell/cell.metadata.json +0 -1
  264. package/esm2015/lib/table/cell/table-data-cell.component.js +0 -21
  265. package/esm2015/lib/table/cell/table-data-cell.component.js.map +0 -1
  266. package/esm2015/lib/table/cell/table-data-cell.component.metadata.json +0 -1
  267. package/esm2015/lib/table/cell/table-header-cell.component.js +0 -13
  268. package/esm2015/lib/table/cell/table-header-cell.component.js.map +0 -1
  269. package/esm2015/lib/table/cell/table-header-cell.component.metadata.json +0 -1
  270. package/esm2015/lib/table/column/table-column.directive.js +0 -16
  271. package/esm2015/lib/table/column/table-column.directive.js.map +0 -1
  272. package/esm2015/lib/table/column/table-column.directive.metadata.json +0 -1
  273. package/esm2015/lib/table/table-constants.library.js +0 -4
  274. package/esm2015/lib/table/table-constants.library.js.map +0 -1
  275. package/esm2015/lib/table/table-constants.library.metadata.json +0 -1
  276. package/esm2015/lib/table/table.component.js +0 -28
  277. package/esm2015/lib/table/table.component.js.map +0 -1
  278. package/esm2015/lib/table/table.component.metadata.json +0 -1
  279. package/esm2015/lib/table/table.module.js +0 -24
  280. package/esm2015/lib/table/table.module.js.map +0 -1
  281. package/esm2015/lib/table/table.module.metadata.json +0 -1
  282. package/esm2015/lib/toggle-switch/toggle-switch.component.js +0 -89
  283. package/esm2015/lib/toggle-switch/toggle-switch.component.js.map +0 -1
  284. package/esm2015/lib/toggle-switch/toggle-switch.component.metadata.json +0 -1
  285. package/esm2015/lib/toggle-switch/toggle-switch.module.js +0 -11
  286. package/esm2015/lib/toggle-switch/toggle-switch.module.js.map +0 -1
  287. package/esm2015/lib/toggle-switch/toggle-switch.module.metadata.json +0 -1
  288. package/fesm2015/ifsworld-granite-components.js +0 -2991
  289. package/fesm2015/ifsworld-granite-components.js.map +0 -1
  290. package/ifsworld-granite-components.metadata.json +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu-trigger-for.directive.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/menu/menu-trigger-for.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,MAAM,EACN,KAAK,EAGL,QAAQ,EACR,IAAI,EAEJ,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EACL,YAAY,EAEZ,+BAA+B,GAChC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAGL,OAAO,EACP,aAAa,GAId,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EACL,aAAa,EACb,SAAS,EACT,KAAK,EAEL,EAAE,IAAI,YAAY,EAClB,YAAY,GACb,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAmB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEnE,6CAA6C;AAC7C,OAAO,EAGL,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,4BAA4B,EAAE,MAAM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AAC,EAAE,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;IAClE,CAAC;;;YA90BF,SAAS,SAAC;gBACT,QAAQ,EAAE,yBAAyB;gBACnC,IAAI,EAAE;oBACJ,KAAK,EAAE,sBAAsB;oBAC7B,eAAe,EAAE,MAAM;oBACvB,sBAAsB,EAAE,qBAAqB;oBAC7C,sBAAsB,EAAE,mCAAmC;oBAC3D,aAAa,EAAE,0BAA0B;oBACzC,WAAW,EAAE,wBAAwB;oBACrC,SAAS,EAAE,sBAAsB;iBAClC;aACF;;;YArDC,OAAO;YAtBP,UAAU;YAQV,gBAAgB;YAgCT,kBAAkB,uBAiFtB,MAAM,SAAC,kBAAkB,cACzB,QAAQ;4CAKR,MAAM,SAAC,oBAAoB,cAC3B,QAAQ;4CAIR,MAAM,SAAC,qBAAqB,cAC5B,QAAQ;YA5FJ,wBAAwB,uBAuG5B,QAAQ,YAAI,IAAI;YA/HZ,cAAc,uBAiIlB,QAAQ;YArIX,YAAY;4CAwIT,MAAM,SAAC,QAAQ;;;mBArEjB,KAAK,SAAC,uBAAuB","sourcesContent":["import {\n AfterContentInit,\n Directive,\n ElementRef,\n Inject,\n Input,\n OnChanges,\n OnDestroy,\n Optional,\n Self,\n SimpleChanges,\n ViewContainerRef,\n} from '@angular/core';\nimport { DOCUMENT } from '@angular/common';\n\nimport {\n FocusMonitor,\n FocusOrigin,\n isFakeMousedownFromScreenReader,\n} from '@angular/cdk/a11y';\nimport { Directionality } from '@angular/cdk/bidi';\nimport { normalizePassiveListenerOptions } from '@angular/cdk/platform';\nimport {\n FlexibleConnectedPositionStrategy,\n HorizontalConnectionPos,\n Overlay,\n OverlayConfig,\n OverlayRef,\n PositionStrategy,\n VerticalConnectionPos,\n} from '@angular/cdk/overlay';\nimport { TemplatePortal } from '@angular/cdk/portal';\n\nimport {\n asapScheduler,\n fromEvent,\n merge,\n Observable,\n of as observableOf,\n Subscription,\n} from 'rxjs';\nimport { delay, filter, take, takeUntil } from 'rxjs/operators';\n\nimport { _MenuBaseComponent } from './menu.component';\nimport { GraniteMenuItemComponent } from './menu-item.component';\nimport { ClosedEventType, GRANITE_MENU_PANEL } from './menu-panel';\n\n//#region --- Touch device customizations ---\nimport {\n ClientInputInterface,\n ClientOutputInterface,\n GRANITE_CLIENT_INPUT,\n GRANITE_CLIENT_OUTPUT,\n} from '../core/client-environment';\nimport { throwGraniteMenuMissingError } from './menu-errors';\n\n/** Options for binding a passive event listener. */\nconst passiveEventListenerOptions = normalizePassiveListenerOptions({\n passive: true,\n});\n//#endregion --- Touch device customizations ---\n\n/**\n * Directive used to turn a button element into a (popup) menu trigger\n *\n * Stripped-down version of Angular Material's menu trigger directive (.../menu/menu-trigger.ts)\n */\n@Directive({\n selector: `[graniteMenuTriggerFor]`,\n host: {\n class: 'granite-menu-trigger', // Required for test harness host selector\n 'aria-haspopup': 'true',\n '[attr.aria-expanded]': '_isMenuOpen || null',\n '[attr.aria-controls]': '_isMenuOpen ? menu.panelId : null',\n '(mousedown)': '_handleMousedown($event)',\n '(keydown)': '_handleKeydown($event)',\n '(click)': '_handleClick($event)',\n },\n})\nexport class GraniteMenuTriggerForDirective\n implements AfterContentInit, OnDestroy, OnChanges {\n /** References the menu instance that the trigger is associated with. */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n @Input('graniteMenuTriggerFor')\n menu: _MenuBaseComponent;\n\n /** Whether the associated menu is open */\n _isMenuOpen: boolean = false;\n\n // Tracking input type is necessary so it's possible to only auto-focus\n // the first item of the list when the menu is opened via the keyboard\n _openedBy: 'mouse' | 'touch' | null = null;\n\n private _hoverSubscription = Subscription.EMPTY;\n private _menuCloseSubscription = Subscription.EMPTY;\n private _closingActionsSubscription = Subscription.EMPTY;\n\n private _portal: TemplatePortal | null = null;\n private _overlayRef: OverlayRef | null = null;\n private _document?: Document;\n\n // ----------------------------------------- //\n // --- Here be poor man's touch gestures --- //\n // ----------------------------------------- //\n\n // TODO: Replace with Hammer or other gesture library\n\n private _touchStartTime: number;\n private _touchTimeTaken: number;\n private _touchStartX: number;\n private _touchStartY: number;\n private _touchCurrentX: number;\n private _touchCurrentY: number;\n private _touchTranslateX: number;\n private _touchLockedX: boolean | null;\n private _touchMaxX: number;\n private _touchTouchingElement: boolean = false;\n\n constructor(\n private _overlay: Overlay,\n private _element: ElementRef<HTMLElement>,\n private _viewContainerRef: ViewContainerRef,\n\n /** If this is a _submenu_ trigger, it will have a parent menu */\n @Inject(GRANITE_MENU_PANEL)\n @Optional()\n private _parentMenu: _MenuBaseComponent,\n\n //#region --- Touch device customizations ---\n /** Client input device information */\n @Inject(GRANITE_CLIENT_INPUT)\n @Optional()\n public _clientInput: ClientInputInterface,\n\n /** Client output device information */\n @Inject(GRANITE_CLIENT_OUTPUT)\n @Optional()\n public _clientOutput: ClientOutputInterface,\n //#endregion --- Touch device customizations ---\n\n /**\n * If this is a _submenu_ trigger, there should be a corresponding menu\n * item directive present as well:\n *\n * <button graniteMenuItem [graniteMenuTriggerFor]=\"...\">\n * ^-- This one\n */\n @Optional() @Self() private _menuItemInstance: GraniteMenuItemComponent,\n\n @Optional() private _dir: Directionality,\n private _focusMonitor: FocusMonitor,\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n @Inject(DOCUMENT) document?: any\n ) {\n _element.nativeElement.addEventListener(\n 'touchstart',\n this._handleTouchStart,\n passiveEventListenerOptions\n );\n\n if (_menuItemInstance) {\n _menuItemInstance._triggersSubmenu = this.triggersSubmenu();\n }\n\n this._document = document as Document;\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.menu) {\n this._handleMenuChange();\n }\n }\n\n ngAfterContentInit(): void {\n // removed checkMenu here to avoid errors in dynamically genarated menus\n // menu is checked when opening the menu\n // this._checkMenu();\n this._handleHover();\n }\n\n ngOnDestroy(): void {\n if (this._overlayRef) {\n //#region --- Touch device customizations ---\n this.removeOverlayListeners();\n //#endregion --- Touch device customizations ---\n this._overlayRef.dispose();\n this._overlayRef = null;\n }\n\n this._element.nativeElement.removeEventListener(\n 'touchstart',\n this._handleTouchStart,\n passiveEventListenerOptions\n );\n\n this._hoverSubscription.unsubscribe();\n this._menuCloseSubscription.unsubscribe();\n this._closingActionsSubscription.unsubscribe();\n }\n\n /** Handles change of associated menu */\n _handleMenuChange(): void {\n this._menuCloseSubscription.unsubscribe();\n\n // Close the menu overlay when the menu itself says it wants to be closed\n if (this.menu) {\n const closed = this.menu.closed as Observable<ClosedEventType>;\n\n this._menuCloseSubscription = closed.subscribe((reason) => {\n //#region --- Touch device customizations ---\n if (this.menu._isClosing) {\n return;\n }\n this.menu._isClosing = true;\n\n // Get rid of the menu and tell any parent to restore its position\n if (this._clientOutput.device === 'touch') {\n // First we wait for any running animation to complete\n const runningAnimationDone: Observable<any> = this.menu._isAnimating\n ? this.menu._animationDone\n : observableOf([null]);\n\n runningAnimationDone\n .pipe(take(1), delay(0, asapScheduler))\n // eslint-disable-next-line rxjs/no-nested-subscribe\n .subscribe(() => {\n this.animateCloseMenu(reason !== 'keydown', reason === 'click');\n this.menu._animationDone\n .pipe(take(1), delay(0, asapScheduler))\n // eslint-disable-next-line rxjs/no-nested-subscribe\n .subscribe(() => this._destroyMenu());\n });\n } else {\n //#endregion --- Touch device customizations ---\n this._destroyMenu();\n }\n\n // If a click closed the menu, we should close the entire chain of nested menus.\n if ((reason === 'click' || reason === 'tab') && this._parentMenu) {\n this._parentMenu.closed.emit(reason);\n }\n });\n }\n }\n\n isOpen(): boolean {\n return this._isMenuOpen;\n }\n\n /** Open the associated menu */\n openMenu(): void {\n if (this._isMenuOpen) {\n return;\n }\n\n this._checkMenu();\n\n this.menu.parentMenu = this.triggersSubmenu()\n ? this._parentMenu\n : undefined;\n this.menu.direction = this._dir.value === 'rtl' ? 'rtl' : 'ltr';\n\n if (this._parentMenu) {\n // Menu triggers inherit target device types from their parent.\n // Ultimately it is the root trigger that determines device types for\n // the whole menu hierarchy.\n this._clientInput = this._parentMenu._clientInput;\n this._clientOutput = this._parentMenu._clientOutput;\n }\n\n //#region --- Touch device customizations ---\n // Make the menu we're about to open use the same devices as the trigger\n this.menu._setDevice(this._clientInput, this._clientOutput);\n\n if (this._clientOutput.device === 'touch') {\n this.menu.showBackButton = !!this._parentMenu;\n this.menu._updateShowTitle();\n\n if (!this.menu.closeLabel) {\n this.menu.closeLabel = this._parentMenu?.closeLabel;\n }\n\n this.menu.showCloseButton = !!this.menu.closeLabel;\n }\n this.menu._isClosing = false;\n\n const panelClass: string[] = [];\n if (this._clientOutput.device === 'touch') {\n panelClass.push('granite-overlay-pane-fill-width-bottom');\n }\n\n const scrollStrategy =\n this._clientOutput.device !== 'touch'\n ? this._overlay.scrollStrategies.reposition()\n : undefined;\n\n const hasBackdrop =\n this._clientOutput.device === 'touch' && !this.triggersSubmenu();\n //#endregion --- Touch device customizations ---\n\n // Create an overlay to stuff the menu (portal) into below\n if (!this._overlayRef) {\n const config = new OverlayConfig({\n positionStrategy: this._positionStrategy(),\n backdropClass: 'granite-overlay-dark-glass-backdrop',\n scrollStrategy,\n direction: this._dir,\n panelClass,\n hasBackdrop,\n });\n\n this._overlayRef = this._overlay.create(config);\n\n //#region --- Touch device customizations ---\n // Add touch listener for submenu back pan/swipe\n if (this._clientOutput.device === 'touch') {\n this.addOverlayListeners();\n }\n //#endregion --- Touch device customizations ---\n } else {\n // Reset animation state for reused overlays\n if (this._clientOutput.device === 'touch') {\n this.menu._panelAnimationState = 'void';\n }\n }\n\n // Create portal from associated menu's template\n if (!this._portal || this._portal.templateRef !== this.menu.templateRef) {\n this._portal = new TemplatePortal(\n this.menu.templateRef,\n this._viewContainerRef\n );\n }\n\n // Attach menu portal to overlay ref (which is a portal outlet)\n this._overlayRef.attach(this._portal);\n\n // Subscribe to stream that emits whenever an action that should close the menu occurs\n this._closingActionsSubscription = this._menuClosingActions().subscribe(\n () => this.closeMenu()\n );\n\n this.animateOpenMenu();\n\n this._setIsMenuOpen(true);\n this.menu.focusFirstItem(this._openedBy || 'program');\n }\n\n /** Whether the menu triggers a sub-menu or a top-level one. */\n triggersSubmenu(): boolean {\n return !!(this._menuItemInstance && this._parentMenu);\n }\n\n /** Toggles the menu between the open and closed states. */\n toggleMenu(): void {\n if (this._isMenuOpen) {\n this.closeMenu();\n } else {\n this.openMenu();\n }\n }\n\n /** Close the associated menu */\n closeMenu(): void {\n this.menu.closed.emit();\n }\n\n /**\n * Focuses the menu trigger.\n * @param origin Source of the menu trigger's focus.\n */\n focus(origin: FocusOrigin = 'program', options?: FocusOptions): void {\n if (this._focusMonitor) {\n this._focusMonitor.focusVia(this._element, origin, options);\n } else {\n this._element.nativeElement.focus(options);\n }\n }\n\n /** Detach menu portal from overlay and update open state */\n _destroyMenu(): void {\n if (!this._overlayRef || !this._isMenuOpen) {\n return;\n }\n\n this._closingActionsSubscription.unsubscribe();\n this._overlayRef.detach();\n this._restoreFocus();\n this.menu._resetAnimation();\n\n this._setIsMenuOpen(false);\n }\n\n /** Handles mouse presses on the trigger. */\n _handleMousedown(event: MouseEvent): void {\n if (!isFakeMousedownFromScreenReader(event)) {\n if (this._openedBy !== 'touch') {\n // Since right or middle button clicks won't trigger the `click` event,\n // we shouldn't consider the menu as opened by mouse in those cases.\n this._openedBy = event.button === 0 ? 'mouse' : null;\n }\n\n // Since clicking on the trigger won't close the menu if it opens a sub-menu,\n // we should prevent focus from moving onto it via click to avoid the\n // highlight from lingering on the menu item.\n if (this.triggersSubmenu() && !this._toggleOnSubmenuClick()) {\n event.preventDefault();\n }\n }\n }\n\n /** Handles key presses on the trigger. */\n _handleKeydown(event: KeyboardEvent): void {\n const key = event.key;\n\n if (\n this.triggersSubmenu() &&\n ((key === 'ArrowRight' && this._dir.value === 'ltr') ||\n (key === 'ArrowLeft' && this._dir.value === 'rtl'))\n ) {\n this.openMenu();\n }\n }\n\n /** Handles click events on the trigger. */\n _handleClick(event: MouseEvent): void {\n if (this.triggersSubmenu()) {\n // Stop event propagation to avoid closing the parent menu.\n event.stopPropagation();\n\n this._toggleOnSubmenuClick() ? this.toggleMenu() : this.openMenu();\n } else {\n this.toggleMenu();\n }\n }\n\n /**\n * Handles touch start events on the trigger.\n * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.\n */\n private _handleTouchStart = () => {\n this._openedBy = 'touch';\n };\n\n /** Handles the cases where the user hovers over the trigger. */\n private _handleHover() {\n // Subscribe to changes in the hovered item in order to toggle the panel.\n if (!this.triggersSubmenu() || !this._parentMenu) {\n return;\n }\n\n this._hoverSubscription = this._parentMenu\n ._hovered()\n .pipe(\n filter(() => this._openOnHover()),\n // Since we might have multiple competing triggers for the same menu (e.g. a sub-menu\n // with different data and triggers), we have to delay it by a tick to ensure that\n // it won't be closed immediately after it is opened.\n filter(\n (active) => active === this._menuItemInstance /*&& !active.disabled*/\n ),\n delay(0, asapScheduler)\n )\n .subscribe(() => {\n this._openedBy = 'mouse';\n\n // If the same menu is used between multiple triggers, it might still be animating\n // while the new trigger tries to re-open it. Wait for the animation to finish\n // before doing so. Also interrupt if the user moves to another item.\n if (this.menu instanceof _MenuBaseComponent && this.menu._isAnimating) {\n // We need the `delay(0)` here in order to avoid\n // 'changed after checked' errors in some cases. See Angular Material #12194.\n this.menu._animationDone\n .pipe(\n take(1),\n delay(0, asapScheduler),\n takeUntil(this._parentMenu._hovered())\n )\n // eslint-disable-next-line rxjs/no-nested-subscribe\n .subscribe(() => this.openMenu());\n } else {\n this.openMenu();\n }\n });\n }\n\n /**\n * Restores focus to the element that was focused before the menu was open.\n * Could be the root trigger button or a submenu trigger item\n */\n private _restoreFocus() {\n // We should reset focus if the user is navigating using a keyboard or\n // if we have a top-level trigger which might cause focus to be lost\n // when clicking outside of the menu.\n if (!this._openedBy) {\n // Note that the focus style will show up both for `program` and\n // `keyboard` so we don't have to specify which one it is.\n this.focus();\n } else if (!this.triggersSubmenu()) {\n this.focus(this._openedBy);\n }\n\n this._openedBy = null;\n }\n\n // Set state rather than toggle to support triggers sharing a menu\n private _setIsMenuOpen(isOpen: boolean): void {\n this._isMenuOpen = isOpen;\n\n if (this.triggersSubmenu()) {\n this._menuItemInstance._highlighted =\n isOpen && this._clientOutput.device !== 'touch';\n }\n }\n\n /**\n * This method checks that a valid instance of MenuComponent has been passed into\n * graniteMenuTriggerFor. If not, an exception is thrown.\n */\n private _checkMenu() {\n if (!this.menu) {\n throwGraniteMenuMissingError();\n }\n }\n\n /**\n * Returns strategy for positioning the overlay for desktop devices:\n * Place adjacent to the trigger button (preferably immediately below)\n * in order to show as much of the menu as possible.\n */\n private _desktopPositionStrategy(): PositionStrategy {\n const positionStrategy: FlexibleConnectedPositionStrategy = this._overlay\n .position()\n .flexibleConnectedTo(this._element)\n .withLockedPosition()\n .withTransformOriginOn('.granite-menu')\n .withPush(false);\n\n this._setPosition(positionStrategy);\n return positionStrategy;\n }\n\n /**\n * Sets the appropriate positions on a position strategy\n * so the overlay connects with the trigger correctly.\n * @param positionStrategy Strategy whose position to update.\n */\n private _setPosition(positionStrategy: FlexibleConnectedPositionStrategy) {\n const MENU_PANEL_TOP_PADDING = 0;\n\n let [originX, originFallbackX]: HorizontalConnectionPos[] =\n this.menu.xPosition === 'before' ? ['end', 'start'] : ['start', 'end'];\n\n const [overlayY, overlayFallbackY]: VerticalConnectionPos[] =\n this.menu.yPosition === 'above' ? ['bottom', 'top'] : ['top', 'bottom'];\n\n let [originY, originFallbackY] = [overlayY, overlayFallbackY];\n let [overlayX, overlayFallbackX] = [originX, originFallbackX];\n let offsetY = 0;\n\n if (this.triggersSubmenu()) {\n // When the menu is a sub-menu, it should always align itself\n // to the edges of the trigger, instead of overlapping it.\n overlayFallbackX = originX =\n this.menu.xPosition === 'before' ? 'start' : 'end';\n originFallbackX = overlayX = originX === 'end' ? 'start' : 'end';\n offsetY =\n overlayY === 'bottom'\n ? MENU_PANEL_TOP_PADDING\n : -MENU_PANEL_TOP_PADDING;\n } else {\n originY = overlayY === 'top' ? 'bottom' : 'top';\n originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';\n }\n\n positionStrategy.withPositions([\n { originX, originY, overlayX, overlayY, offsetY },\n {\n originX: originFallbackX,\n originY,\n overlayX: overlayFallbackX,\n overlayY,\n offsetY,\n },\n {\n originX,\n originY: originFallbackY,\n overlayX,\n overlayY: overlayFallbackY,\n offsetY: -offsetY,\n },\n {\n originX: originFallbackX,\n originY: originFallbackY,\n overlayX: overlayFallbackX,\n overlayY: overlayFallbackY,\n offsetY: -offsetY,\n },\n ]);\n }\n\n /** Returns a stream that emits whenever an action that should close the menu occurs. */\n private _menuClosingActions() {\n const detachments = this._overlayRef?.detachments();\n const parentClose = this._parentMenu\n ? this._parentMenu.closed\n : observableOf();\n\n const hover =\n this._clientOutput.device === 'desktop' && this._parentMenu\n ? this._parentMenu._hovered().pipe(\n filter((item) => item !== this._menuItemInstance),\n filter(() => this._isMenuOpen)\n )\n : observableOf();\n\n // Note: Quick fix. Feature reportedly exists in CDK for Angular 10\n // Filter to prevent closing when animating added though. Applied to\n // root menu only.\n const outsideClick = !this._parentMenu\n ? fromEvent<MouseEvent>(this._document, 'click').pipe(\n filter(\n (e: MouseEvent) =>\n (e.target as HTMLElement) !== this._element.nativeElement &&\n (e.target as HTMLElement).closest('.granite-menu') === null\n ),\n filter(() => !this.menu._isAnimating)\n )\n : observableOf();\n\n return merge(detachments, hover, parentClose, outsideClick);\n }\n\n /**\n * Whether to automatically open submenus on hover. This is true when showing\n * desktop menus and having mouse support.\n */\n private _openOnHover(): boolean {\n return (\n (this.triggersSubmenu()\n ? this._parentMenu.openOnHover\n : this.menu.openOnHover) &&\n this._parentMenu._clientOutput?.device === 'desktop' &&\n this._parentMenu._clientInput?.devices.includes('mouse')\n );\n }\n\n /**\n * Whether to toggle submenus on click. This is true when showing desktop menus\n * without mouse support. Which, by the way, is not a great idea to begin with.\n */\n private _toggleOnSubmenuClick(): boolean {\n return (\n !(this.triggersSubmenu()\n ? this._parentMenu.openOnHover\n : this.menu.openOnHover) ||\n (this._parentMenu._clientOutput?.device === 'desktop' &&\n !this._parentMenu._clientInput?.devices.includes('mouse'))\n );\n }\n\n // ------------------------------------------- //\n // --- Here be touch device customizations --- //\n // ------------------------------------------- //\n\n /** Set animation state to bring a newly opened menu into view */\n private animateOpenMenu() {\n this._clientOutput.device === 'touch'\n ? this.animateTouchOpenMenu()\n : this.menu._startAnimation();\n }\n\n private animateTouchOpenMenu() {\n if (this.triggersSubmenu()) {\n // Slide newly opened sub menu into view from the side,\n // pushing any parent menu out of view on the other side\n this.menu._startTouchSubmenuEnterAnimation();\n this._parentMenu._startTouchHideAnimation();\n } else {\n // Slide root menu into view from below\n this.menu._startTouchRootEnterAnimation();\n }\n }\n\n /** Set animation state to close the active menu */\n private animateCloseMenu(toBelow: boolean, withDelay: boolean) {\n this._clientOutput.device === 'touch'\n ? this._animateTouchCloseMenu(toBelow, withDelay)\n : this._parentMenu._resetAnimation();\n }\n\n private _animateTouchCloseMenu(toBelow: boolean, withDelay: boolean) {\n if (toBelow) {\n // Slide menu out of view below the viewport\n withDelay\n ? this.menu._startTouchCloseDownAnimationWithDelay()\n : this.menu._startTouchCloseDownAnimation();\n } else {\n // Slide the closed menu out of view to the side\n // and slide any parent menu back into view\n this.menu._startTouchCloseSideAnimation();\n this._parentMenu?._startTouchSubmenuEnterAnimation();\n }\n }\n\n /**\n * Set animation state to place the menu and any parent at the given\n * horizontal position, i.e. following touch pan movement.\n *\n * @param xOffset Horizontal offset\n */\n private animateSetMenuPosition(xOffset: number) {\n this.menu._startTouchPanAnimation(xOffset);\n if (this._parentMenu) {\n this._parentMenu._startTouchHidePanAnimation(xOffset);\n }\n }\n\n /**\n * Returns strategy for positioning the overlay depending on what type of\n * device the menu is being shown on\n */\n private _positionStrategy(): PositionStrategy {\n return this._clientOutput.device === 'touch'\n ? this._touchPositionStrategy()\n : this._desktopPositionStrategy();\n }\n\n /**\n * Returns strategy for positioning the overlay for touch devices:\n * Place centered at the bottom of the screen.\n */\n private _touchPositionStrategy(): PositionStrategy {\n return this._overlay.position().global();\n }\n\n // ----------------------------------------- //\n // --- Here be poor man's touch gestures --- //\n // ----------------------------------------- //\n\n // TODO: Replace with Hammer or other gesture library\n\n /**\n * Handles touch start events on the overlay host element (wrapper).\n * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.\n */\n private _handleOverlayTouchStart = (event: TouchEvent) => {\n if (this.menu._isAnimating) {\n return;\n }\n\n this._touchStartTime = new Date().getTime();\n\n this._touchStartX = event.changedTouches[0].clientX;\n this._touchStartY = event.changedTouches[0].clientY;\n this._touchCurrentX = this._touchStartX;\n this._touchCurrentY = this._touchStartY;\n this._touchTranslateX = 0;\n this._touchMaxX = this._overlayRef.hostElement.getBoundingClientRect().width;\n this._touchLockedX = null;\n this._touchTouchingElement = true;\n };\n\n private _handleOverlayTouchMove = (event: TouchEvent) => {\n if (!this._touchTouchingElement || this.menu._isAnimating) {\n return;\n }\n\n if (this._touchLockedX) {\n return;\n }\n\n this._touchCurrentX = event.changedTouches[0].clientX;\n this._touchCurrentY = event.changedTouches[0].clientY;\n\n // Lock X-axis pan if initiating pan on Y-axis\n if (this._touchLockedX === null) {\n const dy = Math.abs(this._touchCurrentY - this._touchStartY);\n const dx = Math.abs(this._touchCurrentX - this._touchStartX);\n if (dx > 10 || dy > 10) {\n this._touchLockedX = dy > dx;\n return;\n }\n }\n\n // Restrict to right pan/swipe and make menu movement extremely slow when\n // moved past allowed limits.\n const menuMargin = 16;\n this._touchTranslateX = this._touchCurrentX - this._touchStartX;\n\n if (this._touchTranslateX < 0) {\n this._touchTranslateX = this.easeOutExpo(\n this._touchTranslateX,\n 0,\n -menuMargin / 2,\n this._touchMaxX * -4\n );\n } else if (!this._parentMenu) {\n this._touchTranslateX = this.easeOutExpo(\n this._touchTranslateX,\n 0,\n menuMargin / 2,\n this._touchMaxX * 4\n );\n } else if (this._touchTranslateX > this._touchMaxX) {\n this._touchTranslateX = this.easeOutExpo(\n this._touchTranslateX - this._touchMaxX,\n this._touchMaxX,\n menuMargin / 2,\n this._touchMaxX * 4\n );\n }\n\n // Set new sub menu position and tell any parent to follow;\n this.animateSetMenuPosition(this._touchTranslateX);\n };\n\n private _handleOverlayTouchEnd = () => {\n if (!this._touchTouchingElement || this.menu._isAnimating) {\n return;\n }\n\n this._touchTranslateX = this._touchCurrentX - this._touchStartX;\n if (this._touchTranslateX === 0) {\n return;\n }\n\n this._touchTouchingElement = false;\n this._touchTimeTaken = new Date().getTime() - this._touchStartTime;\n\n const swipeMinDistance = 10;\n const swipeMinTime = 50;\n const swipeMaxTime = 300;\n\n const pannedHalfwayRight = this._touchTranslateX > this._touchMaxX / 2;\n const swipedRight =\n this._touchTranslateX > this._touchMaxX / swipeMinDistance &&\n this._touchTimeTaken > swipeMinTime &&\n this._touchTimeTaken < swipeMaxTime;\n\n if (!!this._parentMenu && (swipedRight || pannedHalfwayRight)) {\n // Close submenu keydown-style: close only this menu and leave parents open\n this.menu.closed.emit('keydown');\n } else {\n // Pan ended but the menu was not moved far enough. Reset menus to\n // where they were before panning stared.\n this.animateOpenMenu();\n }\n };\n\n /**\n * Remove touch device pan/swipe listeners from overlay host element\n */\n private addOverlayListeners() {\n this._overlayRef.hostElement.addEventListener(\n 'touchstart',\n this._handleOverlayTouchStart,\n passiveEventListenerOptions\n );\n\n this._overlayRef.hostElement.addEventListener(\n 'touchmove',\n this._handleOverlayTouchMove,\n passiveEventListenerOptions\n );\n\n this._overlayRef.hostElement.addEventListener(\n 'touchend',\n this._handleOverlayTouchEnd,\n passiveEventListenerOptions\n );\n }\n\n /**\n * Remove touch device pan/swipe listeners from overlay host element\n */\n private removeOverlayListeners() {\n this._overlayRef.hostElement.removeEventListener(\n 'touchstart',\n this._handleOverlayTouchStart,\n passiveEventListenerOptions\n );\n\n this._overlayRef.hostElement.removeEventListener(\n 'touchmove',\n this._handleOverlayTouchMove,\n passiveEventListenerOptions\n );\n\n this._overlayRef.hostElement.removeEventListener(\n 'touchend',\n this._handleOverlayTouchEnd,\n passiveEventListenerOptions\n );\n }\n\n /**\n * Standard exponential ease out function\n *\n * @param current Current value\n * @param offset Offset value, to which calculated value will be added\n * @param target The target value\n * @param end Value to which current value is compared\n */\n private easeOutExpo(\n current: number,\n offset: number,\n target: number,\n end: number\n ): number {\n return current === end\n ? offset + target\n : target * (-Math.pow(2, (-10 * current) / end) + 1) + offset;\n }\n}\n"]}
@@ -1 +0,0 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"GraniteMenuTriggerForDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":67,"character":1},"arguments":[{"selector":"[graniteMenuTriggerFor]","host":{"class":"granite-menu-trigger","aria-haspopup":"true","[attr.aria-expanded]":"_isMenuOpen || null","[attr.aria-controls]":"_isMenuOpen ? menu.panelId : null","(mousedown)":"_handleMousedown($event)","(keydown)":"_handleKeydown($event)","(click)":"_handleClick($event)","$quoted$":["aria-haspopup","[attr.aria-expanded]","[attr.aria-controls]","(mousedown)","(keydown)","(click)"]}}]}],"members":{"menu":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":83,"character":3},"arguments":["graniteMenuTriggerFor"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":124,"character":5},"arguments":[{"__symbolic":"reference","module":"./menu-panel","name":"GRANITE_MENU_PANEL","line":124,"character":12}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":125,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":130,"character":5},"arguments":[{"__symbolic":"reference","module":"../core/client-environment","name":"GRANITE_CLIENT_INPUT","line":130,"character":12}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":131,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":135,"character":5},"arguments":[{"__symbolic":"reference","module":"../core/client-environment","name":"GRANITE_CLIENT_OUTPUT","line":135,"character":12}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":136,"character":5}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":147,"character":5}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Self","line":147,"character":17}}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":149,"character":5}}],null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":152,"character":5},"arguments":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":152,"character":12}]}]],"parameters":[{"__symbolic":"reference","module":"@angular/cdk/overlay","name":"Overlay","line":119,"character":22},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":120,"character":22,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":120,"character":33,"context":{"typeName":"HTMLElement"}}]},{"__symbolic":"reference","module":"@angular/core","name":"ViewContainerRef","line":121,"character":31},{"__symbolic":"reference","module":"./menu.component","name":"_MenuBaseComponent","line":126,"character":25},{"__symbolic":"reference","module":"../core/client-environment","name":"ClientInputInterface","line":132,"character":25},{"__symbolic":"reference","module":"../core/client-environment","name":"ClientOutputInterface","line":137,"character":26},{"__symbolic":"reference","module":"./menu-item.component","name":"GraniteMenuItemComponent","line":147,"character":51},{"__symbolic":"reference","module":"@angular/cdk/bidi","name":"Directionality","line":149,"character":30},{"__symbolic":"reference","module":"@angular/cdk/a11y","name":"FocusMonitor","line":150,"character":27},{"__symbolic":"reference","name":"any"}]}],"ngOnChanges":[{"__symbolic":"method"}],"ngAfterContentInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"_handleMenuChange":[{"__symbolic":"method"}],"isOpen":[{"__symbolic":"method"}],"openMenu":[{"__symbolic":"method"}],"triggersSubmenu":[{"__symbolic":"method"}],"toggleMenu":[{"__symbolic":"method"}],"closeMenu":[{"__symbolic":"method"}],"focus":[{"__symbolic":"method"}],"_destroyMenu":[{"__symbolic":"method"}],"_handleMousedown":[{"__symbolic":"method"}],"_handleKeydown":[{"__symbolic":"method"}],"_handleClick":[{"__symbolic":"method"}],"_handleHover":[{"__symbolic":"method"}],"_restoreFocus":[{"__symbolic":"method"}],"_setIsMenuOpen":[{"__symbolic":"method"}],"_checkMenu":[{"__symbolic":"method"}],"_desktopPositionStrategy":[{"__symbolic":"method"}],"_setPosition":[{"__symbolic":"method"}],"_menuClosingActions":[{"__symbolic":"method"}],"_openOnHover":[{"__symbolic":"method"}],"_toggleOnSubmenuClick":[{"__symbolic":"method"}],"animateOpenMenu":[{"__symbolic":"method"}],"animateTouchOpenMenu":[{"__symbolic":"method"}],"animateCloseMenu":[{"__symbolic":"method"}],"_animateTouchCloseMenu":[{"__symbolic":"method"}],"animateSetMenuPosition":[{"__symbolic":"method"}],"_positionStrategy":[{"__symbolic":"method"}],"_touchPositionStrategy":[{"__symbolic":"method"}],"addOverlayListeners":[{"__symbolic":"method"}],"removeOverlayListeners":[{"__symbolic":"method"}],"easeOutExpo":[{"__symbolic":"method"}]}}}}]
@@ -1,362 +0,0 @@
1
- import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChildren, Directive, EventEmitter, Input, Output, QueryList, TemplateRef, ViewChild, } from '@angular/core';
2
- import { FocusKeyManager } from '@angular/cdk/a11y';
3
- import { hasModifierKey } from '@angular/cdk/keycodes';
4
- import { BehaviorSubject, combineLatest, merge, Subject, Subscription, } from 'rxjs';
5
- import { filter, map, startWith, switchMap } from 'rxjs/operators';
6
- import { GraniteMenuItemComponent } from './menu-item.component';
7
- import { GRANITE_MENU_PANEL, } from './menu-panel';
8
- import { graniteMenuDesktopAnimations } from './menu-desktop-animations';
9
- import { graniteMenuTouchAnimations } from './menu-touch-animations';
10
- import { throwGraniteMenuInvalidPositionX, throwGraniteMenuInvalidPositionY, } from './menu-errors';
11
- /** Counter for panel ID generation */
12
- let menuPanelUid = 0;
13
- /** Menu panel animation default transform values */
14
- const transformMenuDefault = {
15
- value: 'void',
16
- params: {
17
- xOffset: 0,
18
- },
19
- };
20
- /** Base class with all of the menu functionality. */
21
- // eslint-disable-next-line @angular-eslint/directive-class-suffix
22
- export class _MenuBaseComponent {
23
- constructor(_changeDetectorRef) {
24
- this._changeDetectorRef = _changeDetectorRef;
25
- this.openOnHover = true;
26
- /**
27
- * Event emitted when the menu is closed
28
- */
29
- this.closed = new EventEmitter();
30
- /**
31
- * Used for locating the panel in tests and setting the aria-control attribute
32
- * for the menu trigger.
33
- */
34
- this.panelId = `granite-menu-panel-${menuPanelUid++}`;
35
- /** Whether to show back button in touch menu title bar */
36
- this.showBackButton = false;
37
- /** Whether to show touch menu title bar */
38
- this.showTitle = false;
39
- /** Whether to add a close button below the menu */
40
- this.showCloseButton = false;
41
- /** Observable current state of the panel animation. */
42
- // eslint-disable-next-line rxjs/no-exposed-subjects
43
- this._transformMenu = new BehaviorSubject(transformMenuDefault);
44
- /** Emits whenever an animation on the menu completes. */
45
- // eslint-disable-next-line rxjs/no-exposed-subjects
46
- this._animationDone = new Subject();
47
- this._menuEmpty$ = new BehaviorSubject(false);
48
- // eslint-disable-next-line @typescript-eslint/member-ordering
49
- this._isMenuEmpty$ = combineLatest([
50
- this._menuEmpty$,
51
- this._animationDone,
52
- ]).pipe(filter(([m, a]) => m && a != null), map(() => true));
53
- /** Only the direct descendant menu items. */
54
- this._directDescendantItems = new QueryList();
55
- /** Subscription to tab events on the menu panel */
56
- this._tabSubscription = Subscription.EMPTY;
57
- this._xPosition = 'after';
58
- this._yPosition = 'below';
59
- /**
60
- * Current horizontal offset. Used with `pan` and `pan-hidden`
61
- * animation states.
62
- */
63
- this.xOffset = 0;
64
- }
65
- /** Position of the menu in the X axis. */
66
- get xPosition() {
67
- return this._xPosition;
68
- }
69
- set xPosition(value) {
70
- if (value !== 'before' && value !== 'after') {
71
- throwGraniteMenuInvalidPositionX();
72
- }
73
- this._xPosition = value;
74
- }
75
- /** Position of the menu in the Y axis. */
76
- get yPosition() {
77
- return this._yPosition;
78
- }
79
- set yPosition(value) {
80
- if (value !== 'above' && value !== 'below') {
81
- throwGraniteMenuInvalidPositionY();
82
- }
83
- this._yPosition = value;
84
- }
85
- /** Current state of the panel animation. */
86
- set _panelAnimationState(state) {
87
- this._transformMenu.next({
88
- value: state,
89
- params: { xOffset: this.xOffset },
90
- });
91
- }
92
- ngAfterContentChecked() {
93
- this._menuEmpty$.next(this._allItems.length < 1 ? true : false);
94
- }
95
- ngAfterContentInit() {
96
- this._updateDirectDescendants();
97
- this._keyManager = new FocusKeyManager(this._directDescendantItems)
98
- .withWrap()
99
- .skipPredicate((menuItem) => {
100
- const hostElement = menuItem._getHostElement();
101
- return hostElement instanceof HTMLButtonElement
102
- ? hostElement.disabled
103
- : hostElement.hasAttribute('graniteTitle');
104
- });
105
- this._tabSubscription = this._keyManager.tabOut.subscribe(() => {
106
- this.closed.emit('tab');
107
- });
108
- // If a user manually (programatically) focuses a menu item, we need to reflect that focus
109
- // change back to the key manager. Note that we don't need to unsubscribe here because _focused
110
- // is internal and we know that it gets completed on destroy.
111
- this._directDescendantItems.changes
112
- .pipe(startWith(this._directDescendantItems), switchMap((items) => merge(...items.map((item) => item._focused))))
113
- .subscribe((focusedItem) => this._keyManager.updateActiveItem(focusedItem));
114
- }
115
- ngOnDestroy() {
116
- this._directDescendantItems.destroy();
117
- this._tabSubscription.unsubscribe();
118
- this.closed.complete();
119
- }
120
- /**
121
- * Stream that combines the `_hovered` observables of all the menu's items
122
- * into a single observable. Emits whenever the hovered menu item changes.
123
- */
124
- _hovered() {
125
- // Coerce the `changes` property because Angular types it as `Observable<any>`
126
- const itemChanges = this._directDescendantItems.changes;
127
- return itemChanges.pipe(startWith(this._directDescendantItems),
128
- // Hovering is not applicable when producing touch output
129
- filter(() => {
130
- var _a;
131
- return ((_a = this._clientOutput) === null || _a === void 0 ? void 0 : _a.device) !== 'touch';
132
- }), switchMap((items) => merge(...items.map((item) => item._hovered))));
133
- }
134
- /** Handle a keyboard event from the menu, delegating to the appropriate action. */
135
- _handleKeydown(event) {
136
- const key = event.key;
137
- const manager = this._keyManager;
138
- switch (key) {
139
- case 'Escape':
140
- if (!hasModifierKey(event)) {
141
- event.preventDefault();
142
- this.closed.emit('keydown');
143
- }
144
- break;
145
- case 'ArrowLeft':
146
- if (this.parentMenu && this.direction === 'ltr') {
147
- this.closed.emit('keydown');
148
- }
149
- break;
150
- case 'ArrowRight':
151
- if (this.parentMenu && this.direction === 'rtl') {
152
- this.closed.emit('keydown');
153
- }
154
- break;
155
- case 'Home':
156
- case 'End':
157
- if (!hasModifierKey(event)) {
158
- key === 'Home'
159
- ? manager.setFirstItemActive()
160
- : manager.setLastItemActive();
161
- event.preventDefault();
162
- }
163
- break;
164
- default:
165
- if (key === 'ArrowUp' || key === 'ArrowDown') {
166
- manager.setFocusOrigin('keyboard');
167
- }
168
- manager.onKeydown(event);
169
- }
170
- }
171
- /**
172
- * Focus the first item in the menu.
173
- * @param origin Action from which the focus originated. Used to set the correct styling.
174
- */
175
- focusFirstItem(origin = 'program') {
176
- this._keyManager.setFocusOrigin(origin).setFirstItemActive();
177
- }
178
- /** Updates the `showTitle` property for touch device UI */
179
- _updateShowTitle() {
180
- this.showTitle = !!this.title || this.showBackButton;
181
- }
182
- /** Starts the enter animation */
183
- _startAnimation() {
184
- this._panelAnimationState = 'enter';
185
- }
186
- /** Resets the panel animation to its initial state. */
187
- _resetAnimation() {
188
- this._panelAnimationState = 'void';
189
- }
190
- /**
191
- * Starts the 'below' animation, moving a menu down, out of view below the
192
- * viewport. Used to close the whole menu, for example when clicking
193
- * the backdrop.
194
- */
195
- _startTouchCloseDownAnimation() {
196
- this._panelAnimationState = 'below';
197
- }
198
- /**
199
- * Starts the 'below-with-delay' animation, moving a menu down, out of view below the
200
- * viewport. Used to close the whole menu as a response to the user tapping
201
- * a menu item. There is a short delay before the animation starts, to that
202
- * the user gets a visual feedback on what item was selected.
203
- */
204
- _startTouchCloseDownAnimationWithDelay() {
205
- this._panelAnimationState = 'below-with-delay';
206
- }
207
- /**
208
- * Starts the 'void' animation, moving a (sub) menu out of view to the side
209
- * of the viewport. Used when going "back" from a sub menu.
210
- */
211
- _startTouchCloseSideAnimation() {
212
- this._resetAnimation();
213
- }
214
- /**
215
- * Starts the enter-from-below animation, moving a (root) menu into view,
216
- * Animates upwards from a starting position below the viewport.
217
- */
218
- _startTouchRootEnterAnimation() {
219
- this._panelAnimationState = 'enter-from-below';
220
- this.xOffset = 0;
221
- }
222
- /** Starts the enter animation, moving a (sub) menu into view. */
223
- _startTouchSubmenuEnterAnimation() {
224
- this._panelAnimationState = 'enter';
225
- this.xOffset = 0;
226
- }
227
- /**
228
- * Starts the pan animation, to position a submenu in a response
229
- * to user dragging sideways (panning).
230
- */
231
- _startTouchPanAnimation(xOffset) {
232
- this._panelAnimationState = 'pan';
233
- this.xOffset = xOffset;
234
- }
235
- /**
236
- * Starts the pan-hidden animation, to position a parent menu next to an
237
- * active submenu that the user is dragging sideways (panning).
238
- */
239
- _startTouchHidePanAnimation(xOffset) {
240
- this._panelAnimationState = 'pan-hidden';
241
- this.xOffset = xOffset;
242
- }
243
- /**
244
- * Starts the hide animation, to make a parent menu slide out to leave
245
- * space for a submenu.
246
- */
247
- _startTouchHideAnimation() {
248
- this._panelAnimationState = 'hide';
249
- this.xOffset = 0;
250
- }
251
- /** Callback that is invoked when the panel animation completes. */
252
- _onAnimationDone(event) {
253
- this._animationDone.next(event);
254
- this._isAnimating = false;
255
- }
256
- _onAnimationStart(event) {
257
- this._isAnimating = true;
258
- // Scroll the content element to the top as soon as the animation starts. This is necessary,
259
- // because we move focus to the first item while it's still being animated, which can throw
260
- // the browser off when it determines the scroll position. Alternatively we can move focus
261
- // when the animation is done, however moving focus asynchronously will interrupt screen
262
- // readers which are in the process of reading out the menu already. We take the `element`
263
- // from the `event` since we can't use a `ViewChild` to access the pane.
264
- if ((event.toState === 'enter' || event.toState === 'enter-from-below') &&
265
- this._keyManager.activeItemIndex === 0) {
266
- event.element.scrollTop = 0;
267
- }
268
- }
269
- /**
270
- * Handle click on the menu by emitting on the `closed` emitter
271
- * with a `click` reason
272
- */
273
- _handleClick() {
274
- this.closed.emit('click');
275
- }
276
- /**
277
- * Handle click on the close button by emitting on the `closed` emitter
278
- * without any particular reason
279
- */
280
- _handleCloseClick() {
281
- this.closed.emit();
282
- }
283
- /**
284
- * Handle click on the back icon by emitting on the `clicked` emitter
285
- */
286
- _handleBackClick(e) {
287
- if (this.showBackButton) {
288
- // Close submenu keydown-style: close only this menu and leave parents open
289
- this.closed.emit('keydown');
290
- }
291
- e.stopPropagation();
292
- }
293
- /**
294
- * Update client device information for the menu and its menu items.
295
- */
296
- _setDevice(clientInput, clientOutput) {
297
- this._clientInput = clientInput;
298
- this._clientOutput = clientOutput;
299
- this._directDescendantItems.forEach((item) => {
300
- item._clientInput = clientInput;
301
- item._clientOutput = clientOutput;
302
- });
303
- this._changeDetectorRef.markForCheck();
304
- }
305
- /**
306
- * Resets the active item in the menu. This is used when the menu is opened, allowing
307
- * the user to start from the first option when pressing the down arrow.
308
- */
309
- resetActiveItem() {
310
- this._keyManager.setActiveItem(-1);
311
- }
312
- /**
313
- * Sets up a stream that will keep track of any newly-added menu items and will update the list
314
- * of direct descendants. We collect the descendants this way, because `_allItems` can include
315
- * items that are part of child menus, and using a custom way of registering items is unreliable
316
- * when it comes to maintaining the item order.
317
- */
318
- _updateDirectDescendants() {
319
- this._allItems.changes
320
- .pipe(startWith(this._allItems))
321
- .subscribe((items) => {
322
- this._directDescendantItems.reset(items.filter((item) => item._parentMenu === this));
323
- this._directDescendantItems.notifyOnChanges();
324
- });
325
- }
326
- }
327
- _MenuBaseComponent.decorators = [
328
- { type: Directive }
329
- ];
330
- _MenuBaseComponent.ctorParameters = () => [
331
- { type: ChangeDetectorRef }
332
- ];
333
- _MenuBaseComponent.propDecorators = {
334
- xPosition: [{ type: Input }],
335
- yPosition: [{ type: Input }],
336
- title: [{ type: Input }],
337
- closeLabel: [{ type: Input }],
338
- openOnHover: [{ type: Input }],
339
- templateRef: [{ type: ViewChild, args: [TemplateRef,] }],
340
- _allItems: [{ type: ContentChildren, args: [GraniteMenuItemComponent, { descendants: true },] }],
341
- closed: [{ type: Output }]
342
- };
343
- export class GraniteMenuComponent extends _MenuBaseComponent {
344
- }
345
- GraniteMenuComponent.decorators = [
346
- { type: Component, args: [{
347
- selector: 'granite-menu',
348
- template: "<!--\n Using separate template part for desktop and touch output, because of\n animation triggers and slightly different content.\n-->\n<ng-template>\n <!-- Desktop -->\n <ng-container *ngIf=\"_clientOutput.device === 'desktop'\">\n <div\n #menu\n class=\"granite-menu\"\n [class.is-menu-empty]=\"_isMenuEmpty$ | async\"\n tabindex=\"-1\"\n [id]=\"panelId\"\n [@transformMenuDesktop]=\"_transformMenu | async\"\n (@transformMenuDesktop.start)=\"_onAnimationStart($event)\"\n (@transformMenuDesktop.done)=\"_onAnimationDone($event)\"\n (click)=\"_handleClick()\"\n (keydown)=\"_handleKeydown($event)\"\n >\n <div class=\"granite-menu-content\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <!-- Touch -->\n <ng-container *ngIf=\"_clientOutput?.device === 'touch'\">\n <div\n #menu\n class=\"granite-menu granite-device-output-touch\"\n tabindex=\"-1\"\n [id]=\"panelId\"\n [@transformMenuTouch]=\"_transformMenu | async\"\n (@transformMenuTouch.start)=\"_onAnimationStart($event)\"\n (@transformMenuTouch.done)=\"_onAnimationDone($event)\"\n (click)=\"_handleClick()\"\n (keydown)=\"_handleKeydown($event)\"\n >\n <div class=\"granite-menu-content\">\n <div *ngIf=\"showTitle\" class=\"header-container\">\n <button\n [disabled]=\"!showBackButton\"\n graniteMenuTouchTitleItem\n (click)=\"_handleBackClick($event)\"\n >\n {{ title }}\n </button>\n </div>\n\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n\n <div class=\"footer-container\"></div>\n </div>\n </div>\n\n <!-- Close button -->\n <div class=\"close\" [@transformCloseButton]=\"_transformMenu | async\">\n <button\n *ngIf=\"showCloseButton\"\n graniteMenuTouchCloseItem\n (click)=\"_handleCloseClick()\"\n >\n {{ closeLabel }}\n </button>\n </div>\n </ng-container>\n\n <!--\n Content template shared between desktop and touch parts, as <ng-content>\n can't be used in two places in the same template\n -->\n <ng-template #content>\n <ng-content></ng-content>\n </ng-template>\n</ng-template>\n",
349
- changeDetection: ChangeDetectionStrategy.OnPush,
350
- exportAs: 'graniteMenu',
351
- animations: [
352
- graniteMenuDesktopAnimations.transformMenuDesktop,
353
- graniteMenuTouchAnimations.transformMenuTouch,
354
- graniteMenuTouchAnimations.transformCloseButton,
355
- ],
356
- providers: [
357
- { provide: GRANITE_MENU_PANEL, useExisting: GraniteMenuComponent },
358
- ],
359
- styles: [".granite-menu:not(.granite-device-output-touch){background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 2rem);outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;filter:drop-shadow(var(--granite-shadow-l));min-width:7rem;overflow-x:hidden;overflow-y:hidden}.granite-menu:not(.granite-device-output-touch).ng-animating{pointer-events:none}.granite-menu:not(.granite-device-output-touch):not(.is-menu-empty){min-height:2rem}.granite-menu:not(.granite-device-output-touch):hover{overflow-y:auto}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar{width:var(--granite-spacing-xs)}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar-thumb{background-color:var(--granite-color-border-hard);border-radius:calc(var(--granite-spacing-m) * .125)}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar-track{background-color:var(--granite-color-background-hover)}.granite-menu.granite-device-output-touch{background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 2rem);outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;filter:drop-shadow(var(--granite-shadow-l));border-radius:.25rem;max-height:calc(100% - ($granite-base-rem * 7))}.granite-menu.granite-device-output-touch.ng-animating{pointer-events:none}.granite-menu.granite-device-output-touch:not(.is-menu-empty){min-height:3rem}.granite-menu.granite-device-output-touch:not(.close){margin:var(--granite-spacing-xs)}.granite-menu.granite-device-output-touch.close{-webkit-margin-start:var(--granite-spacing-xs);margin-inline-start:var(--granite-spacing-xs);-webkit-margin-end:var(--granite-spacing-xs);margin-inline-end:var(--granite-spacing-xs);-webkit-margin-after:var(--granite-spacing-xs);margin-block-end:var(--granite-spacing-xs)}.granite-menu.granite-device-output-touch .header-container{position:-webkit-sticky;position:sticky;top:0;background-color:var(--granite-color-background-variant);z-index:1}.granite-menu.granite-device-output-touch .footer-container{position:-webkit-sticky;position:sticky;bottom:0;height:0}.close:not(:empty){background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 2rem);outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;filter:drop-shadow(var(--granite-shadow-l));border-radius:.25rem}.close:not(:empty).ng-animating{pointer-events:none}.close:not(:empty):not(.is-menu-empty){min-height:3rem}.close:not(:empty):not(.close){margin:var(--granite-spacing-xs)}.close:not(:empty).close{-webkit-margin-start:var(--granite-spacing-xs);margin-inline-start:var(--granite-spacing-xs);-webkit-margin-end:var(--granite-spacing-xs);margin-inline-end:var(--granite-spacing-xs);-webkit-margin-after:var(--granite-spacing-xs);margin-block-end:var(--granite-spacing-xs)}"]
360
- },] }
361
- ];
362
- //# sourceMappingURL=menu.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"menu.component.js","sourceRoot":"","sources":["../../../../../../libs/granite-components/src/lib/menu/menu.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,eAAe,EACf,SAAS,EACT,YAAY,EACZ,KAAK,EAEL,MAAM,EACN,SAAS,EACT,WA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C,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,CAClD,CAAC;YACF,IAAI,CAAC,sBAAsB,CAAC,eAAe,EAAE,CAAC;QAChD,CAAC,CAAC,CAAC;IACP,CAAC;;;YAvaF,SAAS;;;YAlFR,iBAAiB;;;wBA2FhB,KAAK;wBAYL,KAAK;oBAYL,KAAK;yBAOL,KAAK;0BAGL,KAAK;0BAGL,SAAS,SAAC,WAAW;wBAGrB,eAAe,SAAC,wBAAwB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;qBAM/D,MAAM;;AAkYT,MAAM,OAAO,oBAAqB,SAAQ,kBAAkB;;;YAf3D,SAAS,SAAC;gBACT,QAAQ,EAAE,cAAc;gBACxB,izEAAkC;gBAElC,eAAe,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,QAAQ,EAAE,aAAa;gBACvB,UAAU,EAAE;oBACV,4BAA4B,CAAC,oBAAoB;oBACjD,0BAA0B,CAAC,kBAAkB;oBAC7C,0BAA0B,CAAC,oBAAoB;iBAChD;gBACD,SAAS,EAAE;oBACT,EAAE,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE;iBACnE;;aACF","sourcesContent":["import {\n AfterContentChecked,\n AfterContentInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport { FocusKeyManager, FocusOrigin } from '@angular/cdk/a11y';\nimport { Direction } from '@angular/cdk/bidi';\nimport { hasModifierKey } from '@angular/cdk/keycodes';\nimport { AnimationEvent } from '@angular/animations';\n\nimport {\n BehaviorSubject,\n combineLatest,\n merge,\n Observable,\n Subject,\n Subscription,\n} from 'rxjs';\nimport { filter, map, startWith, switchMap } from 'rxjs/operators';\n\nimport { GraniteMenuItemComponent } from './menu-item.component';\nimport {\n ClosedEventType,\n GRANITE_MENU_PANEL,\n GraniteMenuPanelInterface,\n} from './menu-panel';\nimport { graniteMenuDesktopAnimations } from './menu-desktop-animations';\nimport { graniteMenuTouchAnimations } from './menu-touch-animations';\nimport {\n ClientOutputInterface,\n ClientInputInterface,\n} from '../core/client-environment';\nimport { MenuPositionX, MenuPositionY } from './menu-positions';\nimport {\n throwGraniteMenuInvalidPositionX,\n throwGraniteMenuInvalidPositionY,\n} from './menu-errors';\n\n/** Counter for panel ID generation */\nlet menuPanelUid = 0;\n\n/** Menu panel animation states */\ntype TransformMenuStates =\n // Touch device\n | 'void'\n | 'enter'\n | 'enter-from-below'\n | 'below-with-delay'\n | 'below'\n | 'pan'\n | 'hide'\n | 'pan-hidden';\n\n/**\n * Menu panel animation transform/state object. Has to be an object as we supply\n * the `xOffset` parameter and not just the state name.\n */\ntype TransformMenu = {\n /** Current animation state name */\n value: TransformMenuStates;\n params: {\n /** How far the menu has been panned/swiped by the user */\n xOffset: number;\n };\n};\n\n/** Menu panel animation default transform values */\nconst transformMenuDefault: TransformMenu = {\n value: 'void',\n params: {\n xOffset: 0,\n },\n};\n\n/** Base class with all of the menu functionality. */\n@Directive()\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\nexport class _MenuBaseComponent\n implements\n AfterContentInit,\n OnDestroy,\n AfterContentChecked,\n GraniteMenuPanelInterface {\n /** Position of the menu in the X axis. */\n @Input()\n get xPosition(): MenuPositionX {\n return this._xPosition;\n }\n set xPosition(value: MenuPositionX) {\n if (value !== 'before' && value !== 'after') {\n throwGraniteMenuInvalidPositionX();\n }\n this._xPosition = value;\n }\n\n /** Position of the menu in the Y axis. */\n @Input()\n get yPosition(): MenuPositionY {\n return this._yPosition;\n }\n set yPosition(value: MenuPositionY) {\n if (value !== 'above' && value !== 'below') {\n throwGraniteMenuInvalidPositionY();\n }\n this._yPosition = value;\n }\n\n /** Optional touch menu panel title */\n @Input()\n title: string;\n\n /**\n * Touch menu close button label. If not set, any label set by parent will\n * be used.\n */\n @Input()\n closeLabel: string;\n\n @Input()\n openOnHover: boolean = true;\n\n @ViewChild(TemplateRef) templateRef: TemplateRef<any>;\n\n /** All items inside the menu. Includes items nested inside another menu. */\n @ContentChildren(GraniteMenuItemComponent, { descendants: true })\n _allItems: QueryList<GraniteMenuItemComponent>;\n\n /**\n * Event emitted when the menu is closed\n */\n @Output() readonly closed: EventEmitter<ClosedEventType> = new EventEmitter();\n\n /**\n * Used for locating the panel in tests and setting the aria-control attribute\n * for the menu trigger.\n */\n readonly panelId = `granite-menu-panel-${menuPanelUid++}`;\n\n /** Parent menu of the current menu panel. */\n parentMenu: GraniteMenuPanelInterface | undefined;\n\n /** Layout direction of the menu. */\n direction: Direction;\n\n /** Whether to show back button in touch menu title bar */\n showBackButton: boolean = false;\n\n /** Whether to show touch menu title bar */\n showTitle: boolean = false;\n\n /** Whether to add a close button below the menu */\n showCloseButton: boolean = false;\n\n /** Observable current state of the panel animation. */\n // eslint-disable-next-line rxjs/no-exposed-subjects\n _transformMenu: BehaviorSubject<TransformMenu> = new BehaviorSubject(\n transformMenuDefault\n );\n\n /** Emits whenever an animation on the menu completes. */\n // eslint-disable-next-line rxjs/no-exposed-subjects\n _animationDone = new Subject<AnimationEvent>();\n\n /** Whether the menu is animating. */\n _isAnimating: boolean;\n\n /** Whether the menu is about to be destroyed. */\n _isClosing: boolean;\n\n /** Client input device information */\n _clientInput: ClientInputInterface;\n\n /** Client output device information */\n _clientOutput: ClientOutputInterface;\n\n private _menuEmpty$: BehaviorSubject<boolean> = new BehaviorSubject(false);\n // eslint-disable-next-line @typescript-eslint/member-ordering\n _isMenuEmpty$: Observable<boolean> = combineLatest([\n this._menuEmpty$,\n this._animationDone,\n ]).pipe(\n filter(([m, a]) => m && a != null),\n map(() => true)\n );\n\n /** Only the direct descendant menu items. */\n private _directDescendantItems = new QueryList<GraniteMenuItemComponent>();\n\n private _keyManager: FocusKeyManager<GraniteMenuItemComponent>;\n\n /** Subscription to tab events on the menu panel */\n private _tabSubscription = Subscription.EMPTY;\n\n private _xPosition: MenuPositionX = 'after';\n private _yPosition: MenuPositionY = 'below';\n\n /** Current state of the panel animation. */\n set _panelAnimationState(state: TransformMenuStates) {\n this._transformMenu.next({\n value: state,\n params: { xOffset: this.xOffset },\n });\n }\n\n /**\n * Current horizontal offset. Used with `pan` and `pan-hidden`\n * animation states.\n */\n private xOffset: number = 0;\n\n constructor(private _changeDetectorRef: ChangeDetectorRef) {}\n\n ngAfterContentChecked(): void {\n this._menuEmpty$.next(this._allItems.length < 1 ? true : false);\n }\n\n ngAfterContentInit(): void {\n this._updateDirectDescendants();\n this._keyManager = new FocusKeyManager(this._directDescendantItems)\n .withWrap()\n .skipPredicate((menuItem) => {\n const hostElement: HTMLElement = menuItem._getHostElement();\n return hostElement instanceof HTMLButtonElement\n ? hostElement.disabled\n : hostElement.hasAttribute('graniteTitle');\n });\n this._tabSubscription = this._keyManager.tabOut.subscribe(() => {\n this.closed.emit('tab');\n });\n\n // If a user manually (programatically) focuses a menu item, we need to reflect that focus\n // change back to the key manager. Note that we don't need to unsubscribe here because _focused\n // is internal and we know that it gets completed on destroy.\n this._directDescendantItems.changes\n .pipe(\n startWith(this._directDescendantItems),\n switchMap((items) =>\n merge<GraniteMenuItemComponent>(\n ...items.map((item: GraniteMenuItemComponent) => item._focused)\n )\n )\n )\n .subscribe((focusedItem) =>\n this._keyManager.updateActiveItem(focusedItem)\n );\n }\n\n ngOnDestroy(): void {\n this._directDescendantItems.destroy();\n this._tabSubscription.unsubscribe();\n this.closed.complete();\n }\n\n /**\n * Stream that combines the `_hovered` observables of all the menu's items\n * into a single observable. Emits whenever the hovered menu item changes.\n */\n _hovered(): Observable<GraniteMenuItemComponent> {\n // Coerce the `changes` property because Angular types it as `Observable<any>`\n const itemChanges = this._directDescendantItems.changes as Observable<\n QueryList<GraniteMenuItemComponent>\n >;\n\n return itemChanges.pipe(\n startWith(this._directDescendantItems),\n // Hovering is not applicable when producing touch output\n filter(() => {\n return this._clientOutput?.device !== 'touch';\n }),\n switchMap((items) =>\n merge(...items.map((item: GraniteMenuItemComponent) => item._hovered))\n )\n ) as Observable<GraniteMenuItemComponent>;\n }\n\n /** Handle a keyboard event from the menu, delegating to the appropriate action. */\n _handleKeydown(event: KeyboardEvent): void {\n const key = event.key;\n const manager = this._keyManager;\n\n switch (key) {\n case 'Escape':\n if (!hasModifierKey(event)) {\n event.preventDefault();\n this.closed.emit('keydown');\n }\n break;\n case 'ArrowLeft':\n if (this.parentMenu && this.direction === 'ltr') {\n this.closed.emit('keydown');\n }\n break;\n case 'ArrowRight':\n if (this.parentMenu && this.direction === 'rtl') {\n this.closed.emit('keydown');\n }\n break;\n case 'Home':\n case 'End':\n if (!hasModifierKey(event)) {\n key === 'Home'\n ? manager.setFirstItemActive()\n : manager.setLastItemActive();\n event.preventDefault();\n }\n break;\n default:\n if (key === 'ArrowUp' || key === 'ArrowDown') {\n manager.setFocusOrigin('keyboard');\n }\n\n manager.onKeydown(event);\n }\n }\n\n /**\n * Focus the first item in the menu.\n * @param origin Action from which the focus originated. Used to set the correct styling.\n */\n focusFirstItem(origin: FocusOrigin = 'program'): void {\n this._keyManager.setFocusOrigin(origin).setFirstItemActive();\n }\n\n /** Updates the `showTitle` property for touch device UI */\n _updateShowTitle(): void {\n this.showTitle = !!this.title || this.showBackButton;\n }\n\n /** Starts the enter animation */\n _startAnimation(): void {\n this._panelAnimationState = 'enter';\n }\n\n /** Resets the panel animation to its initial state. */\n _resetAnimation(): void {\n this._panelAnimationState = 'void';\n }\n\n /**\n * Starts the 'below' animation, moving a menu down, out of view below the\n * viewport. Used to close the whole menu, for example when clicking\n * the backdrop.\n */\n _startTouchCloseDownAnimation(): void {\n this._panelAnimationState = 'below';\n }\n\n /**\n * Starts the 'below-with-delay' animation, moving a menu down, out of view below the\n * viewport. Used to close the whole menu as a response to the user tapping\n * a menu item. There is a short delay before the animation starts, to that\n * the user gets a visual feedback on what item was selected.\n */\n _startTouchCloseDownAnimationWithDelay(): void {\n this._panelAnimationState = 'below-with-delay';\n }\n\n /**\n * Starts the 'void' animation, moving a (sub) menu out of view to the side\n * of the viewport. Used when going \"back\" from a sub menu.\n */\n _startTouchCloseSideAnimation(): void {\n this._resetAnimation();\n }\n\n /**\n * Starts the enter-from-below animation, moving a (root) menu into view,\n * Animates upwards from a starting position below the viewport.\n */\n _startTouchRootEnterAnimation(): void {\n this._panelAnimationState = 'enter-from-below';\n this.xOffset = 0;\n }\n\n /** Starts the enter animation, moving a (sub) menu into view. */\n _startTouchSubmenuEnterAnimation(): void {\n this._panelAnimationState = 'enter';\n this.xOffset = 0;\n }\n\n /**\n * Starts the pan animation, to position a submenu in a response\n * to user dragging sideways (panning).\n */\n _startTouchPanAnimation(xOffset: number): void {\n this._panelAnimationState = 'pan';\n this.xOffset = xOffset;\n }\n\n /**\n * Starts the pan-hidden animation, to position a parent menu next to an\n * active submenu that the user is dragging sideways (panning).\n */\n _startTouchHidePanAnimation(xOffset: number): void {\n this._panelAnimationState = 'pan-hidden';\n this.xOffset = xOffset;\n }\n\n /**\n * Starts the hide animation, to make a parent menu slide out to leave\n * space for a submenu.\n */\n _startTouchHideAnimation(): void {\n this._panelAnimationState = 'hide';\n this.xOffset = 0;\n }\n\n /** Callback that is invoked when the panel animation completes. */\n _onAnimationDone(event: AnimationEvent): void {\n this._animationDone.next(event);\n this._isAnimating = false;\n }\n\n _onAnimationStart(event: AnimationEvent): void {\n this._isAnimating = true;\n\n // Scroll the content element to the top as soon as the animation starts. This is necessary,\n // because we move focus to the first item while it's still being animated, which can throw\n // the browser off when it determines the scroll position. Alternatively we can move focus\n // when the animation is done, however moving focus asynchronously will interrupt screen\n // readers which are in the process of reading out the menu already. We take the `element`\n // from the `event` since we can't use a `ViewChild` to access the pane.\n if (\n (event.toState === 'enter' || event.toState === 'enter-from-below') &&\n this._keyManager.activeItemIndex === 0\n ) {\n event.element.scrollTop = 0;\n }\n }\n\n /**\n * Handle click on the menu by emitting on the `closed` emitter\n * with a `click` reason\n */\n _handleClick(): void {\n this.closed.emit('click');\n }\n\n /**\n * Handle click on the close button by emitting on the `closed` emitter\n * without any particular reason\n */\n _handleCloseClick(): void {\n this.closed.emit();\n }\n\n /**\n * Handle click on the back icon by emitting on the `clicked` emitter\n */\n _handleBackClick(e: MouseEvent): void {\n if (this.showBackButton) {\n // Close submenu keydown-style: close only this menu and leave parents open\n this.closed.emit('keydown');\n }\n e.stopPropagation();\n }\n\n /**\n * Update client device information for the menu and its menu items.\n */\n _setDevice(\n clientInput: ClientInputInterface,\n clientOutput: ClientOutputInterface\n ): void {\n this._clientInput = clientInput;\n this._clientOutput = clientOutput;\n\n this._directDescendantItems.forEach((item) => {\n item._clientInput = clientInput;\n item._clientOutput = clientOutput;\n });\n\n this._changeDetectorRef.markForCheck();\n }\n\n /**\n * Resets the active item in the menu. This is used when the menu is opened, allowing\n * the user to start from the first option when pressing the down arrow.\n */\n resetActiveItem(): void {\n this._keyManager.setActiveItem(-1);\n }\n\n /**\n * Sets up a stream that will keep track of any newly-added menu items and will update the list\n * of direct descendants. We collect the descendants this way, because `_allItems` can include\n * items that are part of child menus, and using a custom way of registering items is unreliable\n * when it comes to maintaining the item order.\n */\n private _updateDirectDescendants() {\n this._allItems.changes\n .pipe(startWith(this._allItems))\n .subscribe((items: QueryList<GraniteMenuItemComponent>) => {\n this._directDescendantItems.reset(\n items.filter((item) => item._parentMenu === this)\n );\n this._directDescendantItems.notifyOnChanges();\n });\n }\n}\n\n@Component({\n selector: 'granite-menu',\n templateUrl: 'menu.component.html',\n styleUrls: ['menu.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n exportAs: 'graniteMenu',\n animations: [\n graniteMenuDesktopAnimations.transformMenuDesktop,\n graniteMenuTouchAnimations.transformMenuTouch,\n graniteMenuTouchAnimations.transformCloseButton,\n ],\n providers: [\n { provide: GRANITE_MENU_PANEL, useExisting: GraniteMenuComponent },\n ],\n})\nexport class GraniteMenuComponent extends _MenuBaseComponent {}\n"]}
@@ -1 +0,0 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"_MenuBaseComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":86,"character":1}}],"members":{"xPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":95,"character":3}}]}],"yPosition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":107,"character":3}}]}],"title":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":119,"character":3}}]}],"closeLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":126,"character":3}}]}],"openOnHover":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":129,"character":3}}]}],"templateRef":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":132,"character":3},"arguments":[{"__symbolic":"reference","module":"@angular/core","name":"TemplateRef","line":132,"character":13}]}]}],"_allItems":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChildren","line":135,"character":3},"arguments":[{"__symbolic":"reference","module":"./menu-item.component","name":"GraniteMenuItemComponent","line":135,"character":19},{"descendants":true}]}]}],"closed":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":141,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":221,"character":42}]}],"ngAfterContentChecked":[{"__symbolic":"method"}],"ngAfterContentInit":[{"__symbolic":"method"}],"ngOnDestroy":[{"__symbolic":"method"}],"_hovered":[{"__symbolic":"method"}],"_handleKeydown":[{"__symbolic":"method"}],"focusFirstItem":[{"__symbolic":"method"}],"_updateShowTitle":[{"__symbolic":"method"}],"_startAnimation":[{"__symbolic":"method"}],"_resetAnimation":[{"__symbolic":"method"}],"_startTouchCloseDownAnimation":[{"__symbolic":"method"}],"_startTouchCloseDownAnimationWithDelay":[{"__symbolic":"method"}],"_startTouchCloseSideAnimation":[{"__symbolic":"method"}],"_startTouchRootEnterAnimation":[{"__symbolic":"method"}],"_startTouchSubmenuEnterAnimation":[{"__symbolic":"method"}],"_startTouchPanAnimation":[{"__symbolic":"method"}],"_startTouchHidePanAnimation":[{"__symbolic":"method"}],"_startTouchHideAnimation":[{"__symbolic":"method"}],"_onAnimationDone":[{"__symbolic":"method"}],"_onAnimationStart":[{"__symbolic":"method"}],"_handleClick":[{"__symbolic":"method"}],"_handleCloseClick":[{"__symbolic":"method"}],"_handleBackClick":[{"__symbolic":"method"}],"_setDevice":[{"__symbolic":"method"}],"resetActiveItem":[{"__symbolic":"method"}],"_updateDirectDescendants":[{"__symbolic":"method"}]}},"GraniteMenuComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"_MenuBaseComponent"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":512,"character":1},"arguments":[{"selector":"granite-menu","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":516,"character":19},"member":"OnPush"},"exportAs":"graniteMenu","animations":[{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./menu-desktop-animations","name":"graniteMenuDesktopAnimations","line":519,"character":4},"member":"transformMenuDesktop"},{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./menu-touch-animations","name":"graniteMenuTouchAnimations","line":520,"character":4},"member":"transformMenuTouch"},{"__symbolic":"select","expression":{"__symbolic":"reference","module":"./menu-touch-animations","name":"graniteMenuTouchAnimations","line":521,"character":4},"member":"transformCloseButton"}],"providers":[{"provide":{"__symbolic":"reference","module":"./menu-panel","name":"GRANITE_MENU_PANEL","line":524,"character":15},"useExisting":{"__symbolic":"reference","name":"GraniteMenuComponent"}}],"template":"<!--\n Using separate template part for desktop and touch output, because of\n animation triggers and slightly different content.\n-->\n<ng-template>\n <!-- Desktop -->\n <ng-container *ngIf=\"_clientOutput.device === 'desktop'\">\n <div\n #menu\n class=\"granite-menu\"\n [class.is-menu-empty]=\"_isMenuEmpty$ | async\"\n tabindex=\"-1\"\n [id]=\"panelId\"\n [@transformMenuDesktop]=\"_transformMenu | async\"\n (@transformMenuDesktop.start)=\"_onAnimationStart($event)\"\n (@transformMenuDesktop.done)=\"_onAnimationDone($event)\"\n (click)=\"_handleClick()\"\n (keydown)=\"_handleKeydown($event)\"\n >\n <div class=\"granite-menu-content\">\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n </div>\n </div>\n </ng-container>\n\n <!-- Touch -->\n <ng-container *ngIf=\"_clientOutput?.device === 'touch'\">\n <div\n #menu\n class=\"granite-menu granite-device-output-touch\"\n tabindex=\"-1\"\n [id]=\"panelId\"\n [@transformMenuTouch]=\"_transformMenu | async\"\n (@transformMenuTouch.start)=\"_onAnimationStart($event)\"\n (@transformMenuTouch.done)=\"_onAnimationDone($event)\"\n (click)=\"_handleClick()\"\n (keydown)=\"_handleKeydown($event)\"\n >\n <div class=\"granite-menu-content\">\n <div *ngIf=\"showTitle\" class=\"header-container\">\n <button\n [disabled]=\"!showBackButton\"\n graniteMenuTouchTitleItem\n (click)=\"_handleBackClick($event)\"\n >\n {{ title }}\n </button>\n </div>\n\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n\n <div class=\"footer-container\"></div>\n </div>\n </div>\n\n <!-- Close button -->\n <div class=\"close\" [@transformCloseButton]=\"_transformMenu | async\">\n <button\n *ngIf=\"showCloseButton\"\n graniteMenuTouchCloseItem\n (click)=\"_handleCloseClick()\"\n >\n {{ closeLabel }}\n </button>\n </div>\n </ng-container>\n\n <!--\n Content template shared between desktop and touch parts, as <ng-content>\n can't be used in two places in the same template\n -->\n <ng-template #content>\n <ng-content></ng-content>\n </ng-template>\n</ng-template>\n","styles":[".granite-menu:not(.granite-device-output-touch){background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 2rem);outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;filter:drop-shadow(var(--granite-shadow-l));min-width:7rem;overflow-x:hidden;overflow-y:hidden}.granite-menu:not(.granite-device-output-touch).ng-animating{pointer-events:none}.granite-menu:not(.granite-device-output-touch):not(.is-menu-empty){min-height:2rem}.granite-menu:not(.granite-device-output-touch):hover{overflow-y:auto}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar{width:var(--granite-spacing-xs)}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar-thumb{background-color:var(--granite-color-border-hard);border-radius:calc(var(--granite-spacing-m) * .125)}.granite-menu:not(.granite-device-output-touch)::-webkit-scrollbar-track{background-color:var(--granite-color-background-hover)}.granite-menu.granite-device-output-touch{background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 2rem);outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;filter:drop-shadow(var(--granite-shadow-l));border-radius:.25rem;max-height:calc(100% - ($granite-base-rem * 7))}.granite-menu.granite-device-output-touch.ng-animating{pointer-events:none}.granite-menu.granite-device-output-touch:not(.is-menu-empty){min-height:3rem}.granite-menu.granite-device-output-touch:not(.close){margin:var(--granite-spacing-xs)}.granite-menu.granite-device-output-touch.close{-webkit-margin-start:var(--granite-spacing-xs);margin-inline-start:var(--granite-spacing-xs);-webkit-margin-end:var(--granite-spacing-xs);margin-inline-end:var(--granite-spacing-xs);-webkit-margin-after:var(--granite-spacing-xs);margin-block-end:var(--granite-spacing-xs)}.granite-menu.granite-device-output-touch .header-container{position:-webkit-sticky;position:sticky;top:0;background-color:var(--granite-color-background-variant);z-index:1}.granite-menu.granite-device-output-touch .footer-container{position:-webkit-sticky;position:sticky;bottom:0;height:0}.close:not(:empty){background-color:var(--granite-color-background-variant);color:var(--granite-color-text);overflow:auto;-webkit-overflow-scrolling:touch;max-height:calc(100vh - 2rem);outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;filter:drop-shadow(var(--granite-shadow-l));border-radius:.25rem}.close:not(:empty).ng-animating{pointer-events:none}.close:not(:empty):not(.is-menu-empty){min-height:3rem}.close:not(:empty):not(.close){margin:var(--granite-spacing-xs)}.close:not(:empty).close{-webkit-margin-start:var(--granite-spacing-xs);margin-inline-start:var(--granite-spacing-xs);-webkit-margin-end:var(--granite-spacing-xs);margin-inline-end:var(--granite-spacing-xs);-webkit-margin-after:var(--granite-spacing-xs);margin-block-end:var(--granite-spacing-xs)}"]}]}]}}}]