@ifsworld/granite-components 4.5.0 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/README.md +7 -7
  2. package/esm2020/ifsworld-granite-components.mjs +5 -0
  3. package/esm2020/index.mjs +48 -0
  4. package/esm2020/lib/arrange-grid/arrange-grid-item.component.mjs +44 -0
  5. package/esm2020/lib/arrange-grid/arrange-grid.component.mjs +125 -0
  6. package/esm2020/lib/arrange-grid/arrange-grid.module.mjs +19 -0
  7. package/esm2020/lib/badge/badge.component.mjs +39 -0
  8. package/esm2020/lib/badge/badge.module.mjs +18 -0
  9. package/esm2020/lib/badge/testing/badge.harness.mjs +25 -0
  10. package/esm2020/lib/button/button.component.mjs +89 -0
  11. package/esm2020/lib/button/button.module.mjs +16 -0
  12. package/esm2020/lib/checkbox/checkbox-group.component.mjs +17 -0
  13. package/esm2020/lib/checkbox/checkbox.component.mjs +96 -0
  14. package/esm2020/lib/checkbox/checkbox.module.mjs +17 -0
  15. package/esm2020/lib/core/animation.mjs +34 -0
  16. package/esm2020/lib/core/client-environment.mjs +20 -0
  17. package/esm2020/lib/core/common-behaviors/disabled.mjs +27 -0
  18. package/esm2020/lib/core/core.module.mjs +36 -0
  19. package/esm2020/lib/core/devices/client-input-desktop.directive.mjs +29 -0
  20. package/esm2020/lib/core/devices/client-input-touch.directive.mjs +29 -0
  21. package/esm2020/lib/core/devices/client-output-desktop.directive.mjs +29 -0
  22. package/esm2020/lib/core/devices/client-output-touch.directive.mjs +29 -0
  23. package/esm2020/lib/core/pipes/pure-pipes.module.mjs +16 -0
  24. package/esm2020/lib/core/pipes/title.pipe.mjs +21 -0
  25. package/esm2020/lib/core/radio-checkbox-base.mjs +19 -0
  26. package/esm2020/lib/core/theme.library.mjs +59 -0
  27. package/esm2020/lib/core/types.mjs +2 -0
  28. package/esm2020/lib/grid/grid.component.mjs +128 -0
  29. package/esm2020/lib/grid/grid.module.mjs +18 -0
  30. package/esm2020/lib/icon/icon.component.mjs +43 -0
  31. package/esm2020/lib/icon/icon.module.mjs +16 -0
  32. package/esm2020/lib/input-field/input-field.component.mjs +160 -0
  33. package/esm2020/lib/input-field/input-field.module.mjs +20 -0
  34. package/esm2020/lib/menu/divider.directive.mjs +23 -0
  35. package/esm2020/lib/menu/menu-base.mjs +347 -0
  36. package/esm2020/lib/menu/menu-desktop-animations.mjs +23 -0
  37. package/esm2020/lib/menu/menu-errors.mjs +37 -0
  38. package/esm2020/lib/menu/menu-item.component.mjs +91 -0
  39. package/esm2020/lib/menu/menu-panel.mjs +7 -0
  40. package/esm2020/lib/menu/menu-positions.mjs +9 -0
  41. package/esm2020/lib/menu/menu-touch-animations.mjs +137 -0
  42. package/esm2020/lib/menu/menu-touch-close.component.mjs +13 -0
  43. package/esm2020/lib/menu/menu-touch-title.component.mjs +59 -0
  44. package/esm2020/lib/menu/menu-trigger-for.directive.mjs +702 -0
  45. package/esm2020/lib/menu/menu.component.mjs +30 -0
  46. package/esm2020/lib/menu/menu.module.mjs +55 -0
  47. package/esm2020/lib/menu/testing/menu.harness.mjs +109 -0
  48. package/esm2020/lib/menu/title.directive.mjs +17 -0
  49. package/esm2020/lib/radio-button/radio-button.component.mjs +118 -0
  50. package/esm2020/lib/radio-button/radio-button.module.mjs +17 -0
  51. package/esm2020/lib/radio-button/radio-group.component.mjs +17 -0
  52. package/esm2020/lib/table/cell/cell.mjs +15 -0
  53. package/esm2020/lib/table/cell/table-data-cell.component.mjs +26 -0
  54. package/esm2020/lib/table/cell/table-header-cell.component.mjs +12 -0
  55. package/esm2020/lib/table/column/table-column.directive.mjs +23 -0
  56. package/esm2020/lib/table/table-constants.library.mjs +4 -0
  57. package/esm2020/lib/table/table.component.mjs +36 -0
  58. package/esm2020/lib/table/table.module.mjs +32 -0
  59. package/esm2020/lib/toggle-switch/toggle-switch.component.mjs +96 -0
  60. package/esm2020/lib/toggle-switch/toggle-switch.module.mjs +16 -0
  61. package/fesm2015/ifsworld-granite-components.mjs +3145 -0
  62. package/fesm2015/ifsworld-granite-components.mjs.map +1 -0
  63. package/fesm2020/ifsworld-granite-components.mjs +3103 -0
  64. package/fesm2020/ifsworld-granite-components.mjs.map +1 -0
  65. package/ifsworld-granite-components.d.ts +1 -8
  66. package/lib/arrange-grid/arrange-grid-item.component.d.ts +3 -0
  67. package/lib/arrange-grid/arrange-grid.component.d.ts +3 -0
  68. package/lib/arrange-grid/arrange-grid.module.d.ts +7 -0
  69. package/lib/badge/badge.component.d.ts +3 -0
  70. package/lib/badge/badge.module.d.ts +6 -0
  71. package/lib/button/button.component.d.ts +5 -0
  72. package/lib/button/button.module.d.ts +5 -0
  73. package/lib/checkbox/checkbox-group.component.d.ts +3 -0
  74. package/lib/checkbox/checkbox.component.d.ts +3 -0
  75. package/lib/checkbox/checkbox.module.d.ts +6 -0
  76. package/lib/core/core.module.d.ts +8 -0
  77. package/lib/core/devices/client-input-desktop.directive.d.ts +3 -0
  78. package/lib/core/devices/client-input-touch.directive.d.ts +3 -0
  79. package/lib/core/devices/client-output-desktop.directive.d.ts +3 -0
  80. package/lib/core/devices/client-output-touch.directive.d.ts +3 -0
  81. package/lib/core/pipes/pure-pipes.module.d.ts +5 -0
  82. package/lib/core/pipes/title.pipe.d.ts +3 -0
  83. package/lib/core/radio-checkbox-base.d.ts +3 -0
  84. package/lib/grid/grid.component.d.ts +5 -0
  85. package/lib/grid/grid.module.d.ts +6 -0
  86. package/lib/icon/icon.component.d.ts +3 -0
  87. package/lib/icon/icon.module.d.ts +5 -0
  88. package/lib/input-field/input-field.component.d.ts +3 -0
  89. package/lib/input-field/input-field.module.d.ts +8 -0
  90. package/lib/menu/divider.directive.d.ts +3 -0
  91. package/lib/menu/menu-base.d.ts +190 -0
  92. package/lib/menu/menu-item.component.d.ts +3 -0
  93. package/lib/menu/menu-touch-close.component.d.ts +3 -0
  94. package/lib/menu/menu-touch-title.component.d.ts +4 -1
  95. package/lib/menu/menu-trigger-for.directive.d.ts +4 -1
  96. package/lib/menu/menu.component.d.ts +4 -187
  97. package/lib/menu/menu.module.d.ts +15 -0
  98. package/lib/menu/title.directive.d.ts +3 -0
  99. package/lib/radio-button/radio-button.component.d.ts +3 -0
  100. package/lib/radio-button/radio-button.module.d.ts +6 -0
  101. package/lib/radio-button/radio-group.component.d.ts +3 -0
  102. package/lib/table/cell/cell.d.ts +3 -0
  103. package/lib/table/cell/table-data-cell.component.d.ts +3 -0
  104. package/lib/table/cell/table-header-cell.component.d.ts +3 -0
  105. package/lib/table/column/table-column.directive.d.ts +3 -0
  106. package/lib/table/table.component.d.ts +3 -0
  107. package/lib/table/table.module.d.ts +12 -0
  108. package/lib/toggle-switch/toggle-switch.component.d.ts +3 -0
  109. package/lib/toggle-switch/toggle-switch.module.d.ts +5 -0
  110. package/package.json +30 -17
  111. package/bundles/ifsworld-granite-components.umd.js +0 -3648
  112. package/bundles/ifsworld-granite-components.umd.js.map +0 -1
  113. package/bundles/ifsworld-granite-components.umd.min.js +0 -10
  114. package/bundles/ifsworld-granite-components.umd.min.js.map +0 -1
  115. package/esm2015/ifsworld-granite-components.js +0 -13
  116. package/esm2015/ifsworld-granite-components.js.map +0 -1
  117. package/esm2015/ifsworld-granite-components.metadata.json +0 -1
  118. package/esm2015/index.js +0 -48
  119. package/esm2015/index.js.map +0 -1
  120. package/esm2015/index.metadata.json +0 -1
  121. package/esm2015/lib/arrange-grid/arrange-grid-item.component.js +0 -48
  122. package/esm2015/lib/arrange-grid/arrange-grid-item.component.js.map +0 -1
  123. package/esm2015/lib/arrange-grid/arrange-grid-item.component.metadata.json +0 -1
  124. package/esm2015/lib/arrange-grid/arrange-grid.component.js +0 -123
  125. package/esm2015/lib/arrange-grid/arrange-grid.component.js.map +0 -1
  126. package/esm2015/lib/arrange-grid/arrange-grid.component.metadata.json +0 -1
  127. package/esm2015/lib/arrange-grid/arrange-grid.module.js +0 -14
  128. package/esm2015/lib/arrange-grid/arrange-grid.module.js.map +0 -1
  129. package/esm2015/lib/arrange-grid/arrange-grid.module.metadata.json +0 -1
  130. package/esm2015/lib/badge/badge.component.js +0 -44
  131. package/esm2015/lib/badge/badge.component.js.map +0 -1
  132. package/esm2015/lib/badge/badge.component.metadata.json +0 -1
  133. package/esm2015/lib/badge/badge.module.js +0 -13
  134. package/esm2015/lib/badge/badge.module.js.map +0 -1
  135. package/esm2015/lib/badge/badge.module.metadata.json +0 -1
  136. package/esm2015/lib/badge/testing/badge.harness.js +0 -30
  137. package/esm2015/lib/badge/testing/badge.harness.js.map +0 -1
  138. package/esm2015/lib/badge/testing/badge.harness.metadata.json +0 -1
  139. package/esm2015/lib/button/button.component.js +0 -108
  140. package/esm2015/lib/button/button.component.js.map +0 -1
  141. package/esm2015/lib/button/button.component.metadata.json +0 -1
  142. package/esm2015/lib/button/button.module.js +0 -11
  143. package/esm2015/lib/button/button.module.js.map +0 -1
  144. package/esm2015/lib/button/button.module.metadata.json +0 -1
  145. package/esm2015/lib/checkbox/checkbox-group.component.js +0 -19
  146. package/esm2015/lib/checkbox/checkbox-group.component.js.map +0 -1
  147. package/esm2015/lib/checkbox/checkbox-group.component.metadata.json +0 -1
  148. package/esm2015/lib/checkbox/checkbox.component.js +0 -89
  149. package/esm2015/lib/checkbox/checkbox.component.js.map +0 -1
  150. package/esm2015/lib/checkbox/checkbox.component.metadata.json +0 -1
  151. package/esm2015/lib/checkbox/checkbox.module.js +0 -12
  152. package/esm2015/lib/checkbox/checkbox.module.js.map +0 -1
  153. package/esm2015/lib/checkbox/checkbox.module.metadata.json +0 -1
  154. package/esm2015/lib/core/animation.js +0 -34
  155. package/esm2015/lib/core/animation.js.map +0 -1
  156. package/esm2015/lib/core/animation.metadata.json +0 -1
  157. package/esm2015/lib/core/client-environment.js +0 -20
  158. package/esm2015/lib/core/client-environment.js.map +0 -1
  159. package/esm2015/lib/core/client-environment.metadata.json +0 -1
  160. package/esm2015/lib/core/common-behaviors/disabled.js +0 -25
  161. package/esm2015/lib/core/common-behaviors/disabled.js.map +0 -1
  162. package/esm2015/lib/core/common-behaviors/disabled.metadata.json +0 -1
  163. package/esm2015/lib/core/core.module.js +0 -25
  164. package/esm2015/lib/core/core.module.js.map +0 -1
  165. package/esm2015/lib/core/core.module.metadata.json +0 -1
  166. package/esm2015/lib/core/devices/client-input-desktop.directive.js +0 -22
  167. package/esm2015/lib/core/devices/client-input-desktop.directive.js.map +0 -1
  168. package/esm2015/lib/core/devices/client-input-desktop.directive.metadata.json +0 -1
  169. package/esm2015/lib/core/devices/client-input-touch.directive.js +0 -22
  170. package/esm2015/lib/core/devices/client-input-touch.directive.js.map +0 -1
  171. package/esm2015/lib/core/devices/client-input-touch.directive.metadata.json +0 -1
  172. package/esm2015/lib/core/devices/client-output-desktop.directive.js +0 -22
  173. package/esm2015/lib/core/devices/client-output-desktop.directive.js.map +0 -1
  174. package/esm2015/lib/core/devices/client-output-desktop.directive.metadata.json +0 -1
  175. package/esm2015/lib/core/devices/client-output-touch.directive.js +0 -22
  176. package/esm2015/lib/core/devices/client-output-touch.directive.js.map +0 -1
  177. package/esm2015/lib/core/devices/client-output-touch.directive.metadata.json +0 -1
  178. package/esm2015/lib/core/pipes/pure-pipes.module.js +0 -11
  179. package/esm2015/lib/core/pipes/pure-pipes.module.js.map +0 -1
  180. package/esm2015/lib/core/pipes/pure-pipes.module.metadata.json +0 -1
  181. package/esm2015/lib/core/pipes/title.pipe.js +0 -17
  182. package/esm2015/lib/core/pipes/title.pipe.js.map +0 -1
  183. package/esm2015/lib/core/pipes/title.pipe.metadata.json +0 -1
  184. package/esm2015/lib/core/radio-checkbox-base.js +0 -15
  185. package/esm2015/lib/core/radio-checkbox-base.js.map +0 -1
  186. package/esm2015/lib/core/radio-checkbox-base.metadata.json +0 -1
  187. package/esm2015/lib/core/theme.library.js +0 -59
  188. package/esm2015/lib/core/theme.library.js.map +0 -1
  189. package/esm2015/lib/core/theme.library.metadata.json +0 -1
  190. package/esm2015/lib/core/types.js +0 -2
  191. package/esm2015/lib/core/types.js.map +0 -1
  192. package/esm2015/lib/core/types.metadata.json +0 -1
  193. package/esm2015/lib/grid/grid.component.js +0 -131
  194. package/esm2015/lib/grid/grid.component.js.map +0 -1
  195. package/esm2015/lib/grid/grid.component.metadata.json +0 -1
  196. package/esm2015/lib/grid/grid.module.js +0 -13
  197. package/esm2015/lib/grid/grid.module.js.map +0 -1
  198. package/esm2015/lib/grid/grid.module.metadata.json +0 -1
  199. package/esm2015/lib/icon/icon.component.js +0 -48
  200. package/esm2015/lib/icon/icon.component.js.map +0 -1
  201. package/esm2015/lib/icon/icon.component.metadata.json +0 -1
  202. package/esm2015/lib/icon/icon.module.js +0 -11
  203. package/esm2015/lib/icon/icon.module.js.map +0 -1
  204. package/esm2015/lib/icon/icon.module.metadata.json +0 -1
  205. package/esm2015/lib/input-field/input-field.component.js +0 -144
  206. package/esm2015/lib/input-field/input-field.component.js.map +0 -1
  207. package/esm2015/lib/input-field/input-field.component.metadata.json +0 -1
  208. package/esm2015/lib/input-field/input-field.module.js +0 -15
  209. package/esm2015/lib/input-field/input-field.module.js.map +0 -1
  210. package/esm2015/lib/input-field/input-field.module.metadata.json +0 -1
  211. package/esm2015/lib/menu/divider.directive.js +0 -20
  212. package/esm2015/lib/menu/divider.directive.js.map +0 -1
  213. package/esm2015/lib/menu/divider.directive.metadata.json +0 -1
  214. package/esm2015/lib/menu/menu-desktop-animations.js +0 -23
  215. package/esm2015/lib/menu/menu-desktop-animations.js.map +0 -1
  216. package/esm2015/lib/menu/menu-desktop-animations.metadata.json +0 -1
  217. package/esm2015/lib/menu/menu-errors.js +0 -37
  218. package/esm2015/lib/menu/menu-errors.js.map +0 -1
  219. package/esm2015/lib/menu/menu-errors.metadata.json +0 -1
  220. package/esm2015/lib/menu/menu-item.component.js +0 -82
  221. package/esm2015/lib/menu/menu-item.component.js.map +0 -1
  222. package/esm2015/lib/menu/menu-item.component.metadata.json +0 -1
  223. package/esm2015/lib/menu/menu-panel.js +0 -7
  224. package/esm2015/lib/menu/menu-panel.js.map +0 -1
  225. package/esm2015/lib/menu/menu-panel.metadata.json +0 -1
  226. package/esm2015/lib/menu/menu-positions.js +0 -9
  227. package/esm2015/lib/menu/menu-positions.js.map +0 -1
  228. package/esm2015/lib/menu/menu-positions.metadata.json +0 -1
  229. package/esm2015/lib/menu/menu-touch-animations.js +0 -137
  230. package/esm2015/lib/menu/menu-touch-animations.js.map +0 -1
  231. package/esm2015/lib/menu/menu-touch-animations.metadata.json +0 -1
  232. package/esm2015/lib/menu/menu-touch-close.component.js +0 -16
  233. package/esm2015/lib/menu/menu-touch-close.component.js.map +0 -1
  234. package/esm2015/lib/menu/menu-touch-close.component.metadata.json +0 -1
  235. package/esm2015/lib/menu/menu-touch-title.component.js +0 -45
  236. package/esm2015/lib/menu/menu-touch-title.component.js.map +0 -1
  237. package/esm2015/lib/menu/menu-touch-title.component.metadata.json +0 -1
  238. package/esm2015/lib/menu/menu-trigger-for.directive.js +0 -684
  239. package/esm2015/lib/menu/menu-trigger-for.directive.js.map +0 -1
  240. package/esm2015/lib/menu/menu-trigger-for.directive.metadata.json +0 -1
  241. package/esm2015/lib/menu/menu.component.js +0 -362
  242. package/esm2015/lib/menu/menu.component.js.map +0 -1
  243. package/esm2015/lib/menu/menu.component.metadata.json +0 -1
  244. package/esm2015/lib/menu/menu.module.js +0 -38
  245. package/esm2015/lib/menu/menu.module.js.map +0 -1
  246. package/esm2015/lib/menu/menu.module.metadata.json +0 -1
  247. package/esm2015/lib/menu/testing/menu.harness.js +0 -133
  248. package/esm2015/lib/menu/testing/menu.harness.js.map +0 -1
  249. package/esm2015/lib/menu/testing/menu.harness.metadata.json +0 -1
  250. package/esm2015/lib/menu/title.directive.js +0 -13
  251. package/esm2015/lib/menu/title.directive.js.map +0 -1
  252. package/esm2015/lib/menu/title.directive.metadata.json +0 -1
  253. package/esm2015/lib/radio-button/radio-button.component.js +0 -109
  254. package/esm2015/lib/radio-button/radio-button.component.js.map +0 -1
  255. package/esm2015/lib/radio-button/radio-button.component.metadata.json +0 -1
  256. package/esm2015/lib/radio-button/radio-button.module.js +0 -12
  257. package/esm2015/lib/radio-button/radio-button.module.js.map +0 -1
  258. package/esm2015/lib/radio-button/radio-button.module.metadata.json +0 -1
  259. package/esm2015/lib/radio-button/radio-group.component.js +0 -19
  260. package/esm2015/lib/radio-button/radio-group.component.js.map +0 -1
  261. package/esm2015/lib/radio-button/radio-group.component.metadata.json +0 -1
  262. package/esm2015/lib/table/cell/cell.js +0 -12
  263. package/esm2015/lib/table/cell/cell.js.map +0 -1
  264. package/esm2015/lib/table/cell/cell.metadata.json +0 -1
  265. package/esm2015/lib/table/cell/table-data-cell.component.js +0 -21
  266. package/esm2015/lib/table/cell/table-data-cell.component.js.map +0 -1
  267. package/esm2015/lib/table/cell/table-data-cell.component.metadata.json +0 -1
  268. package/esm2015/lib/table/cell/table-header-cell.component.js +0 -13
  269. package/esm2015/lib/table/cell/table-header-cell.component.js.map +0 -1
  270. package/esm2015/lib/table/cell/table-header-cell.component.metadata.json +0 -1
  271. package/esm2015/lib/table/column/table-column.directive.js +0 -16
  272. package/esm2015/lib/table/column/table-column.directive.js.map +0 -1
  273. package/esm2015/lib/table/column/table-column.directive.metadata.json +0 -1
  274. package/esm2015/lib/table/table-constants.library.js +0 -4
  275. package/esm2015/lib/table/table-constants.library.js.map +0 -1
  276. package/esm2015/lib/table/table-constants.library.metadata.json +0 -1
  277. package/esm2015/lib/table/table.component.js +0 -28
  278. package/esm2015/lib/table/table.component.js.map +0 -1
  279. package/esm2015/lib/table/table.component.metadata.json +0 -1
  280. package/esm2015/lib/table/table.module.js +0 -24
  281. package/esm2015/lib/table/table.module.js.map +0 -1
  282. package/esm2015/lib/table/table.module.metadata.json +0 -1
  283. package/esm2015/lib/toggle-switch/toggle-switch.component.js +0 -89
  284. package/esm2015/lib/toggle-switch/toggle-switch.component.js.map +0 -1
  285. package/esm2015/lib/toggle-switch/toggle-switch.component.metadata.json +0 -1
  286. package/esm2015/lib/toggle-switch/toggle-switch.module.js +0 -11
  287. package/esm2015/lib/toggle-switch/toggle-switch.module.js.map +0 -1
  288. package/esm2015/lib/toggle-switch/toggle-switch.module.metadata.json +0 -1
  289. package/fesm2015/ifsworld-granite-components.js +0 -2991
  290. package/fesm2015/ifsworld-granite-components.js.map +0 -1
  291. package/ifsworld-granite-components.metadata.json +0 -1
@@ -0,0 +1,3103 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Component, ChangeDetectionStrategy, Input, HostBinding, ContentChildren, NgModule, InjectionToken, Attribute, Inject, Optional, EventEmitter, QueryList, TemplateRef, Directive, ViewChild, Output, Self, HostListener, ContentChild, Pipe } from '@angular/core';
3
+ import * as i2 from '@angular/common';
4
+ import { CommonModule, DOCUMENT } from '@angular/common';
5
+ import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
6
+ import { Subject, BehaviorSubject, combineLatest, Subscription, merge, of, asapScheduler, fromEvent } from 'rxjs';
7
+ import { takeUntil, filter, map, startWith, switchMap, take, delay } from 'rxjs/operators';
8
+ import { ComponentHarness, HarnessPredicate, TestKey } from '@angular/cdk/testing';
9
+ import * as i1$1 from '@angular/cdk/overlay';
10
+ import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
11
+ import { TemplatePortal, PortalModule } from '@angular/cdk/portal';
12
+ import { trigger, state, style, transition, group, query, animate, sequence } from '@angular/animations';
13
+ import * as i1 from '@angular/cdk/a11y';
14
+ import { FocusKeyManager, isFakeMousedownFromScreenReader } from '@angular/cdk/a11y';
15
+ import { hasModifierKey } from '@angular/cdk/keycodes';
16
+ import * as i3 from '@angular/cdk/bidi';
17
+ import { normalizePassiveListenerOptions } from '@angular/cdk/platform';
18
+ import * as i2$1 from '@angular/cdk/collections';
19
+ import * as i1$2 from '@angular/cdk/table';
20
+ import { CdkTableModule } from '@angular/cdk/table';
21
+
22
+ class GraniteArrangeGridItemComponent {
23
+ constructor(element) {
24
+ this.element = element;
25
+ /**
26
+ * Column span to render.
27
+ * For use in template only. Do not use outside of this component.
28
+ * @ignore
29
+ */
30
+ this._columnSpan = null;
31
+ /* no-op */
32
+ }
33
+ /**
34
+ * Number of cells the item would span. Used by arrange grid in column
35
+ * orientation to fill any unused space caused by wrapped items.
36
+ */
37
+ set columnSpan(value) {
38
+ this._columnSpan = value;
39
+ this.updateStyles();
40
+ }
41
+ /**
42
+ * Update element styles
43
+ */
44
+ updateStyles() {
45
+ this.setCssProperty('--columnSpan', this._columnSpan ? this._columnSpan.toString() : null);
46
+ }
47
+ /**
48
+ * Set CSS variable value or remove it if a null value is given.
49
+ * Would of course rather have used property binding but that is not
50
+ * supported until (perhaps) Angular 9.
51
+ * See: https://github.com/angular/angular/issues/9343
52
+ */
53
+ setCssProperty(variable, value) {
54
+ this.element.nativeElement.style.setProperty(variable, value);
55
+ }
56
+ }
57
+ GraniteArrangeGridItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteArrangeGridItemComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
58
+ GraniteArrangeGridItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteArrangeGridItemComponent, selector: "granite-arrange-grid-item", ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{--columnSpan: $default-column-span;display:grid;grid-column:span var(--columnSpan, 1)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteArrangeGridItemComponent, decorators: [{
60
+ type: Component,
61
+ args: [{ selector: 'granite-arrange-grid-item', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--columnSpan: $default-column-span;display:grid;grid-column:span var(--columnSpan, 1)}\n"] }]
62
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } });
63
+
64
+ var GraniteArrangeGridOrientation;
65
+ (function (GraniteArrangeGridOrientation) {
66
+ GraniteArrangeGridOrientation["columns"] = "columns";
67
+ GraniteArrangeGridOrientation["rows"] = "rows";
68
+ })(GraniteArrangeGridOrientation || (GraniteArrangeGridOrientation = {}));
69
+ class GraniteArrangeGridComponent {
70
+ constructor(element) {
71
+ this.element = element;
72
+ /** How to present grid items; `columns` (default) or `rows` */
73
+ this.orientation = GraniteArrangeGridOrientation.columns;
74
+ /** Exposes column orientation to template */
75
+ this.classColumnOrientation = false;
76
+ /** Exposes row orientation to template */
77
+ this.classRowOrientation = false;
78
+ /** Number of columns to render */
79
+ this._cols = GraniteArrangeGridComponent.defaultCols;
80
+ /** Nexted on component destruction to complete other observables. */
81
+ this.destroy$ = new Subject();
82
+ /* no-op */
83
+ }
84
+ /**
85
+ * Number of grid columns to use when orientation is set to `column`. The
86
+ * default is two columns.
87
+ */
88
+ set cols(value) {
89
+ this._cols = Math.max(1, Math.round(coerceNumberProperty(value)));
90
+ }
91
+ get cols() {
92
+ return this._cols;
93
+ }
94
+ set rows(value) {
95
+ // Prevent pointless usage
96
+ throw Error('Explicitly setting rows value for arrange grid is unsupported');
97
+ }
98
+ get rows() {
99
+ return this._rows;
100
+ }
101
+ ngAfterContentInit() {
102
+ // Update style whenever grid item components change in content
103
+ this.arrangeGridItemComponents.changes
104
+ .pipe(takeUntil(this.destroy$))
105
+ .subscribe(() => this.updateStyles());
106
+ this.updateStyles();
107
+ }
108
+ ngOnChanges(changes) {
109
+ if ((changes.orientation && !changes.orientation.isFirstChange()) ||
110
+ (changes.cols && !changes.cols.isFirstChange())) {
111
+ this.updateStyles();
112
+ }
113
+ }
114
+ ngOnDestroy() {
115
+ this.destroy$.next();
116
+ }
117
+ /**
118
+ * Update grid row template style.
119
+ *
120
+ * Use content height of all but last row and let the last grow
121
+ * to take up any remaining space.
122
+ */
123
+ updateStyles() {
124
+ const children = (this.arrangeGridItemComponents || []).length;
125
+ if (this.orientation === GraniteArrangeGridOrientation.columns) {
126
+ // If too many items was placed into too few colums, there would
127
+ // be some wrapping. Take that into account when calculating the
128
+ // number of rows.
129
+ this._rows = Math.trunc((children - 1) / (this._cols || 1)) + 1;
130
+ this.classColumnOrientation = true;
131
+ this.classRowOrientation = false;
132
+ if (children > 0) {
133
+ // Fill any unused space caused by wrapped items by making the
134
+ // last item also span over remaining cells.
135
+ this.arrangeGridItemComponents.forEach((c) => (c.columnSpan = null));
136
+ this.arrangeGridItemComponents.last.columnSpan =
137
+ this._rows * this._cols - children + 1;
138
+ }
139
+ }
140
+ else {
141
+ this._cols = 1; // In row orientation, there is just a single column
142
+ this._rows = children;
143
+ this.classColumnOrientation = false;
144
+ this.classRowOrientation = true;
145
+ }
146
+ this.setCssProperty('--cols', this._cols.toString());
147
+ this.setCssProperty('--rows', this._rows.toString());
148
+ }
149
+ /**
150
+ * Set CSS variable value or remove it if a null value is given.
151
+ * Would of course rather have used property binding but that is not
152
+ * supported until (perhaps) Angular 9.
153
+ * See: https://github.com/angular/angular/issues/9343
154
+ *
155
+ * TODO: Replace with property binding with Angular 9 upgrade
156
+ */
157
+ setCssProperty(variable, value) {
158
+ this.element.nativeElement.style.setProperty(variable, value);
159
+ }
160
+ }
161
+ /** Default number of columns to use in column orientation */
162
+ GraniteArrangeGridComponent.defaultCols = 2;
163
+ GraniteArrangeGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteArrangeGridComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
164
+ GraniteArrangeGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteArrangeGridComponent, selector: "granite-arrange-grid", inputs: { orientation: "orientation", cols: "cols" }, host: { properties: { "class.column-orientation": "this.classColumnOrientation", "class.row-orientation": "this.classRowOrientation" } }, queries: [{ propertyName: "arrangeGridItemComponents", predicate: GraniteArrangeGridItemComponent }], usesOnChanges: true, ngImport: i0, template: "<ng-content select=\"granite-arrange-grid-item\"></ng-content>\n", styles: ["@media only screen and (min-width: 960px){:host{--cols: 1;--rows: 1;display:grid;grid-template-columns:repeat(var(--cols, 1),1fr);grid-column-gap:.5rem;column-gap:.5rem;grid-row-gap:.5rem;row-gap:.5rem}:host.row-orientation{grid-template-columns:auto;grid-template-rows:repeat(calc(var(--rows, 1) - 1),max-content)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
165
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteArrangeGridComponent, decorators: [{
166
+ type: Component,
167
+ args: [{ selector: 'granite-arrange-grid', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content select=\"granite-arrange-grid-item\"></ng-content>\n", styles: ["@media only screen and (min-width: 960px){:host{--cols: 1;--rows: 1;display:grid;grid-template-columns:repeat(var(--cols, 1),1fr);grid-column-gap:.5rem;column-gap:.5rem;grid-row-gap:.5rem;row-gap:.5rem}:host.row-orientation{grid-template-columns:auto;grid-template-rows:repeat(calc(var(--rows, 1) - 1),max-content)}}\n"] }]
168
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { orientation: [{
169
+ type: Input
170
+ }], classColumnOrientation: [{
171
+ type: HostBinding,
172
+ args: ['class.column-orientation']
173
+ }], classRowOrientation: [{
174
+ type: HostBinding,
175
+ args: ['class.row-orientation']
176
+ }], arrangeGridItemComponents: [{
177
+ type: ContentChildren,
178
+ args: [GraniteArrangeGridItemComponent]
179
+ }], cols: [{
180
+ type: Input
181
+ }] } });
182
+
183
+ class GraniteArrangeGridModule {
184
+ }
185
+ GraniteArrangeGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteArrangeGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
186
+ GraniteArrangeGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteArrangeGridModule, declarations: [GraniteArrangeGridComponent, GraniteArrangeGridItemComponent], imports: [CommonModule], exports: [GraniteArrangeGridComponent, GraniteArrangeGridItemComponent] });
187
+ GraniteArrangeGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteArrangeGridModule, imports: [[CommonModule]] });
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteArrangeGridModule, decorators: [{
189
+ type: NgModule,
190
+ args: [{
191
+ declarations: [GraniteArrangeGridComponent, GraniteArrangeGridItemComponent],
192
+ imports: [CommonModule],
193
+ exports: [GraniteArrangeGridComponent, GraniteArrangeGridItemComponent],
194
+ }]
195
+ }] });
196
+
197
+ /**
198
+ * Grid item component
199
+ *
200
+ * Merely a wrapper for CSS Grid items, accepting item style as input parameters.
201
+ */
202
+ class GraniteGridItemComponent {
203
+ constructor(element, renderer) {
204
+ this.element = element;
205
+ this.renderer = renderer;
206
+ }
207
+ ngOnChanges() {
208
+ this.updateStyles();
209
+ }
210
+ /**
211
+ * Update element styles
212
+ */
213
+ updateStyles() {
214
+ this.setStyle('gridColumnStart', this.columnStart);
215
+ this.setStyle('gridColumnEnd', this.columnEnd);
216
+ this.setStyle('gridRowStart', this.rowStart);
217
+ this.setStyle('gridRowEnd', this.rowEnd);
218
+ }
219
+ /**
220
+ * Sets the element style. Needs to be set manually to avoid "Changed after
221
+ * checked" errors that would occur with HostBinding.
222
+ */
223
+ setStyle(property, value) {
224
+ this.renderer.setStyle(this.element.nativeElement, property, value || '');
225
+ }
226
+ }
227
+ GraniteGridItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteGridItemComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
228
+ GraniteGridItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteGridItemComponent, selector: "granite-grid-item", inputs: { columnStart: "columnStart", columnEnd: "columnEnd", rowStart: "rowStart", rowEnd: "rowEnd" }, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
229
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteGridItemComponent, decorators: [{
230
+ type: Component,
231
+ args: [{
232
+ selector: 'granite-grid-item',
233
+ template: '<ng-content></ng-content>',
234
+ changeDetection: ChangeDetectionStrategy.OnPush,
235
+ }]
236
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { columnStart: [{
237
+ type: Input
238
+ }], columnEnd: [{
239
+ type: Input
240
+ }], rowStart: [{
241
+ type: Input
242
+ }], rowEnd: [{
243
+ type: Input
244
+ }] } });
245
+ /**
246
+ * Grid
247
+ *
248
+ * A wrapper around a native CSS Grid. Anything can be used for grid items, but
249
+ * `GridItemComponent` is recommended for common cases.
250
+ */
251
+ class GraniteGridComponent {
252
+ constructor(element) {
253
+ this.element = element;
254
+ }
255
+ /**
256
+ * Number of grid columns, unless set via styling (grid-template-columns)
257
+ *
258
+ * Setting this value will produce equally sized columns
259
+ */
260
+ set cols(value) {
261
+ this._cols = Math.max(1, Math.round(coerceNumberProperty(value)));
262
+ }
263
+ get cols() {
264
+ return this._cols;
265
+ }
266
+ /**
267
+ * Number of grid rows, unless set via styling (grid-template-rows)
268
+ *
269
+ * Setting this value will produce equally sized rows
270
+ */
271
+ set rows(value) {
272
+ this._rows = Math.max(1, Math.round(coerceNumberProperty(value)));
273
+ }
274
+ get rows() {
275
+ return this._rows;
276
+ }
277
+ ngAfterContentInit() {
278
+ this.updateStyles();
279
+ }
280
+ ngOnChanges(changes) {
281
+ if ((changes.cols && !changes.cols.isFirstChange()) ||
282
+ (changes.rows && !changes.rows.isFirstChange())) {
283
+ this.updateStyles();
284
+ }
285
+ }
286
+ /** Update element styles */
287
+ updateStyles() {
288
+ this.updateColumnStyles();
289
+ this.updateRowStyles();
290
+ }
291
+ /**
292
+ * Set CSS variable value or remove it if a null value is given.
293
+ * Would of course rather have used property binding but that is not
294
+ * supported until (perhaps) Angular 9.
295
+ * See: https://github.com/angular/angular/issues/9343
296
+ *
297
+ * TODO: Replace with property binding with Angular 9 upgrade
298
+ */
299
+ setCssProperty(variable, value) {
300
+ this.element.nativeElement.style.setProperty(variable, value);
301
+ }
302
+ /** Update grid column template style */
303
+ updateColumnStyles() {
304
+ this.setCssProperty('--cols', (this._cols && this._cols.toString()) || null);
305
+ }
306
+ /** Update grid row template style */
307
+ updateRowStyles() {
308
+ this.setCssProperty('--rows', (this._rows && this._rows.toString()) || null);
309
+ }
310
+ }
311
+ GraniteGridComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteGridComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
312
+ GraniteGridComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteGridComponent, selector: "granite-grid", inputs: { cols: "cols", rows: "rows" }, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{--cols: 1;--rows: 1;display:grid;grid-template-columns:repeat(var(--cols, 1),1fr);grid-template-rows:repeat(var(--rows, 1),1fr)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
313
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteGridComponent, decorators: [{
314
+ type: Component,
315
+ args: [{ selector: 'granite-grid', template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--cols: 1;--rows: 1;display:grid;grid-template-columns:repeat(var(--cols, 1),1fr);grid-template-rows:repeat(var(--rows, 1),1fr)}\n"] }]
316
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { cols: [{
317
+ type: Input
318
+ }], rows: [{
319
+ type: Input
320
+ }] } });
321
+
322
+ class GraniteGridModule {
323
+ }
324
+ GraniteGridModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteGridModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
325
+ GraniteGridModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteGridModule, declarations: [GraniteGridComponent, GraniteGridItemComponent], imports: [CommonModule], exports: [GraniteGridComponent, GraniteGridItemComponent] });
326
+ GraniteGridModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteGridModule, imports: [[CommonModule]] });
327
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteGridModule, decorators: [{
328
+ type: NgModule,
329
+ args: [{
330
+ declarations: [GraniteGridComponent, GraniteGridItemComponent],
331
+ imports: [CommonModule],
332
+ exports: [GraniteGridComponent, GraniteGridItemComponent],
333
+ }]
334
+ }] });
335
+
336
+ const TOKEN_PREFIX = 'granite-';
337
+ const TOKEN_PREFIX_OLD = 'fnd-'; // TODO: Remove this when all tokens have 'granite-' as the prefix
338
+ /**
339
+ * Get the theme that corresponds to a given ID
340
+ */
341
+ function getThemeById(themes, id) {
342
+ const theme = id !== undefined ? themes.find((t) => t.id === id) : undefined;
343
+ return theme;
344
+ }
345
+ /**
346
+ * Apply a theme to a DOM element by iterating though all tokens,
347
+ * setting a CSS variable for each one.
348
+ *
349
+ * @param theme Theme to set
350
+ * @param element Target element
351
+ */
352
+ function applyTheme(theme, element) {
353
+ applyTokens(theme.tokens, element);
354
+ }
355
+ /**
356
+ * Set a CSS variable for each token on the specified element.
357
+ *
358
+ * @param theme Theme to set
359
+ * @param element Target element
360
+ */
361
+ function applyTokens(tokens, element) {
362
+ for (const token of Object.keys(tokens)) {
363
+ element.style.setProperty(token, tokens[token]);
364
+ }
365
+ }
366
+ /**
367
+ * Remove theme token CSS variables from an element using the specified keys
368
+ *
369
+ * @param theme Theme with tokens to clear
370
+ * @param element Target element
371
+ */
372
+ function clearTheme(theme, element) {
373
+ clearTokens(Object.keys(theme.tokens), element);
374
+ }
375
+ /**
376
+ * Remove token CSS variables from an element using the specified keys.
377
+ *
378
+ * @param keys Token keys
379
+ * @param element Target element
380
+ */
381
+ function clearTokens(keys, element) {
382
+ for (const token of keys) {
383
+ element.style.removeProperty(token);
384
+ }
385
+ }
386
+ function isValidToken(key) {
387
+ return (key && (key.startsWith(TOKEN_PREFIX) || key.startsWith(TOKEN_PREFIX_OLD)));
388
+ }
389
+ function setPropertyValue(name, value, element) {
390
+ if (element && element.style && value != null) {
391
+ element.style.setProperty(name, isValidToken(value) ? `var(--${value})` : value);
392
+ }
393
+ }
394
+
395
+ class GraniteBadgeComponent {
396
+ constructor(elementRef) {
397
+ this.elementRef = elementRef;
398
+ /** Pill style badge */
399
+ this.pill = false;
400
+ }
401
+ ngOnChanges(changes) {
402
+ if (changes.backgroundColor) {
403
+ if (changes.backgroundColor.previousValue !==
404
+ changes.backgroundColor.currentValue) {
405
+ setPropertyValue('background-color', changes.backgroundColor.currentValue, this.elementRef.nativeElement);
406
+ }
407
+ }
408
+ if (changes.color) {
409
+ if (changes.color.previousValue !== changes.color.currentValue) {
410
+ setPropertyValue('color', changes.color.currentValue, this.elementRef.nativeElement);
411
+ }
412
+ }
413
+ }
414
+ }
415
+ GraniteBadgeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteBadgeComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
416
+ GraniteBadgeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteBadgeComponent, selector: "granite-badge", inputs: { backgroundColor: "backgroundColor", color: "color", pill: "pill" }, host: { properties: { "class.granite-badge-pill": "pill" }, classAttribute: "granite-badge" }, exportAs: ["graniteBadge"], usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:-moz-inline-flex;display:inline-flex;flex-direction:row;flex-wrap:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;align-items:center;background-color:var(--granite-color-signal-neutral);color:var(--granite-color-text-static-light);padding:calc(var(--granite-spacing-m) * .3125);border-radius:.3125rem;padding-inline-start:calc(var(--granite-spacing-m) * .625);padding-inline-end:calc(var(--granite-spacing-m) * .625)}:host(.granite-badge-pill){border-radius:1.5625rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteBadgeComponent, decorators: [{
418
+ type: Component,
419
+ args: [{ selector: 'granite-badge', exportAs: 'graniteBadge', host: {
420
+ class: 'granite-badge',
421
+ '[class.granite-badge-pill]': 'pill',
422
+ }, template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:-moz-inline-flex;display:inline-flex;flex-direction:row;flex-wrap:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap;align-items:center;background-color:var(--granite-color-signal-neutral);color:var(--granite-color-text-static-light);padding:calc(var(--granite-spacing-m) * .3125);border-radius:.3125rem;padding-inline-start:calc(var(--granite-spacing-m) * .625);padding-inline-end:calc(var(--granite-spacing-m) * .625)}:host(.granite-badge-pill){border-radius:1.5625rem}\n"] }]
423
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { backgroundColor: [{
424
+ type: Input
425
+ }], color: [{
426
+ type: Input
427
+ }], pill: [{
428
+ type: Input
429
+ }] } });
430
+
431
+ class GraniteBadgeModule {
432
+ }
433
+ GraniteBadgeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteBadgeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
434
+ GraniteBadgeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteBadgeModule, declarations: [GraniteBadgeComponent], imports: [CommonModule], exports: [GraniteBadgeComponent] });
435
+ GraniteBadgeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteBadgeModule, imports: [[CommonModule]] });
436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteBadgeModule, decorators: [{
437
+ type: NgModule,
438
+ args: [{
439
+ declarations: [GraniteBadgeComponent],
440
+ imports: [CommonModule],
441
+ exports: [GraniteBadgeComponent],
442
+ }]
443
+ }] });
444
+
445
+ class GraniteBadgeHarness extends ComponentHarness {
446
+ /**
447
+ * Gets a `HarnessPredicate` that can be used to search for a `GraniteBadgeHarness` that meets
448
+ * certain criteria.
449
+ * @param options Options for filtering which badge instances are considered a match.
450
+ * @return a `HarnessPredicate` configured with the given options.
451
+ */
452
+ static with(options = {}) {
453
+ const predicate = new HarnessPredicate(GraniteBadgeHarness, options);
454
+ predicate.addOption('text', options.text, (harness, label) => HarnessPredicate.stringMatches(harness.getText(), label));
455
+ predicate.addOption('pill', options.pill, async (harness, pill) => (await harness.isPill()) === pill);
456
+ return predicate;
457
+ }
458
+ /** Gets the Badge text. */
459
+ async getText() {
460
+ return (await this.host()).text();
461
+ }
462
+ /** Whether it's a Pill type badge. */
463
+ async isPill() {
464
+ return (await this.host()).hasClass('granite-badge-pill');
465
+ }
466
+ }
467
+ GraniteBadgeHarness.hostSelector = 'granite-badge';
468
+
469
+ /**
470
+ * Returns an ease-out CSS animation string with a slightly steeper curve
471
+ * than usual.
472
+ *
473
+ * @param duration Duration in milliseconds
474
+ * @param delay Delay in milliseconds
475
+ */
476
+ function getEaseOutSteep(duration, delay) {
477
+ return (`${duration}ms ` +
478
+ (delay !== undefined ? ` ${delay}ms ` : '') +
479
+ 'cubic-bezier(0, 0, 0.2, 1)');
480
+ }
481
+ /**
482
+ * Returns an ease-out-back CSS animation string with a slightly steeper
483
+ * curve than usual.
484
+ *
485
+ * @param duration Duration in milliseconds
486
+ * @param delay Delay in milliseconds
487
+ */
488
+ function getEaseOutSteepBack(duration, delay) {
489
+ return (`${duration}ms ` +
490
+ (delay !== undefined ? ` ${delay}ms ` : '') +
491
+ 'cubic-bezier(.37,1.3,.77,1)');
492
+ }
493
+ /**
494
+ * Returns a linear CSS animation string
495
+ *
496
+ * @param duration Duration in milliseconds
497
+ * @param delay Delay in milliseconds
498
+ */
499
+ function getEaseLinear(duration, delay) {
500
+ return (`${duration}ms ` + (delay !== undefined ? ` ${delay}ms ` : '') + 'linear');
501
+ }
502
+
503
+ const easeOut120 = getEaseOutSteep(120);
504
+ /**
505
+ * Animations used by the `granite-menu` component, showing the desktop interface.
506
+ * @docs-private
507
+ */
508
+ const graniteMenuDesktopAnimations = {
509
+ transformMenuDesktop: trigger('transformMenuDesktop', [
510
+ state('void', style({
511
+ opacity: 0,
512
+ transform: 'scale(0.9)',
513
+ })),
514
+ transition('void => enter', group([
515
+ query('.granite-menu-content', animate(getEaseLinear(100), style({
516
+ opacity: 1,
517
+ }))),
518
+ animate(easeOut120, style({ transform: 'scale(1)' })),
519
+ ])),
520
+ transition('* => void', animate(getEaseLinear(100, 25), style({ opacity: 0 }))),
521
+ ]),
522
+ };
523
+
524
+ const defaultDuration = 300;
525
+ const defaultDelay = 200;
526
+ const easeOut = getEaseOutSteep(defaultDuration);
527
+ const linear = getEaseLinear(defaultDuration);
528
+ const linearDelayed = getEaseLinear(defaultDuration, defaultDelay);
529
+ /**
530
+ * Insanely fast travel somewhere on or off the stage,
531
+ * to set a great starting position.
532
+ *
533
+ * For some reason this has to be animated with > 0ms time.
534
+ * Setting style directly gets ignored.
535
+ */
536
+ const teleport = '1ms linear';
537
+ /**
538
+ * Style used by our menu stars to make grand entrée et sortie from/to below
539
+ * the viewport stage.
540
+ */
541
+ const inTheOrchestraPit = style({
542
+ transform: 'translateX(0) translateY(100%)',
543
+ opacity: 0,
544
+ });
545
+ /** Style for a menu at the center of attention, on the viewport stage */
546
+ const onStage = style({
547
+ opacity: 1,
548
+ transform: 'translateX(0) translateY(0)',
549
+ });
550
+ /**
551
+ * Style for a (sub) menu starting position at the side of the stage, waiting
552
+ * to make an entrance by sliding into view, pushing the previous (parent)
553
+ * menu off.
554
+ */
555
+ const awaitingCue = style({
556
+ opacity: 0,
557
+ transform: 'translateX(100vw) translateY(0)',
558
+ });
559
+ /**
560
+ * Style for a (parent) menu that has been pushed aside by a debutant
561
+ * (sub) menu and therefore, although maybe temporarily, left the spotlight.
562
+ *
563
+ * @param translateY Where to place on Y axis
564
+ */
565
+ const retired = style({
566
+ opacity: 1,
567
+ transform: `translateX(-100vw) translateY(0)`,
568
+ });
569
+ /**
570
+ * Style for an active (sub) menu that dances across the stage, along with its
571
+ * parent menu, as a result of the user panning. Requires an `xOffset`
572
+ * parameter for the distance.
573
+ */
574
+ const futsalShuffle = style({
575
+ transform: 'translateX({{ xOffset }}px)',
576
+ });
577
+ /**
578
+ * Style for a parent menu sweeping across the stage, right beside the
579
+ * starlet sub menu, either off the stage or back onto it (for a great comeback).
580
+ * Requires an `xOffset` parameter for the distance.
581
+ */
582
+ const moonwalk = style({
583
+ transform: 'translateX(calc(-100vw + {{ xOffset }}px))',
584
+ });
585
+ const onStageHidden = style({
586
+ opacity: 0,
587
+ transform: 'translateX(0) translateY(0)',
588
+ });
589
+ /**
590
+ * Animations used by the `granite-menu` component, showing the touch interface.
591
+ * @docs-private
592
+ */
593
+ const graniteMenuTouchAnimations = {
594
+ transformMenuTouch: trigger('transformMenuTouch', [
595
+ // Set up cast positions
596
+ state('void', awaitingCue),
597
+ state('enter, enter-from-below', onStage),
598
+ state('pan-hidden', moonwalk, { params: { xOffset: 0 } }),
599
+ state('pan', futsalShuffle, { params: { xOffset: 0 } }),
600
+ state('below-with-delay', inTheOrchestraPit),
601
+ state('hide', retired),
602
+ // General movement across the stage. Transitions to 'pan' and 'pan-hidden'
603
+ // states are intentionally left out as we want the menu position to update
604
+ // instantly as the user moves their finger.
605
+ transition('pan => enter, ' +
606
+ 'pan => enter-from-below, ' +
607
+ 'pan => void, ' +
608
+ 'enter <=> hide, ' +
609
+ 'enter-from-below <=> hide, ' +
610
+ 'pan-hidden => hide, ' +
611
+ 'pan-hidden => enter', animate(easeOut)),
612
+ transition(
613
+ // Jump straight onto the stage, from the orchestra pit.
614
+ // Excitement fills the air. Spotlight. Showtime.
615
+ 'void => enter-from-below', sequence([
616
+ animate(teleport, inTheOrchestraPit),
617
+ animate(easeOut, onStage),
618
+ ])),
619
+ transition(
620
+ // Go stand in the curtains, then make a grand entrance from the side
621
+ 'void => enter', sequence([animate(teleport, awaitingCue), animate(easeOut, onStage)])),
622
+ transition(
623
+ // Get off the stage, back into the curtains on the side
624
+ 'enter => void', animate(easeOut, awaitingCue)),
625
+ transition(
626
+ // Take the side stairs down from the stage
627
+ 'hide => below', animate(linear, retired)),
628
+ transition(
629
+ // Wait for a bit, then take the side stairs down from the stage
630
+ 'hide => below-with-delay', sequence([animate(teleport, retired), animate(linearDelayed, retired)])),
631
+ transition(
632
+ // Stage dive into the orchestra pit
633
+ 'enter => below, enter-from-below => below', sequence([animate(teleport, onStage), animate(linear, inTheOrchestraPit)])),
634
+ transition(
635
+ // Receive the standing ovations, then stage dive into the orchestra pit
636
+ 'enter => below-with-delay, enter-from-below => below-with-delay', sequence([
637
+ animate(teleport, onStage),
638
+ animate(linearDelayed, inTheOrchestraPit),
639
+ ])),
640
+ ]),
641
+ transformCloseButton: trigger('transformCloseButton', [
642
+ state('void, below, below-with-delay', onStageHidden),
643
+ state('enter, enter-from-below, pan-hidden, pan, hide', onStage),
644
+ transition('void => enter-from-below', sequence([
645
+ animate(teleport, onStageHidden),
646
+ animate(getEaseLinear(50, defaultDuration / 2), onStage),
647
+ ])),
648
+ transition('enter => below, enter-from-below => below', sequence([
649
+ animate(teleport, onStage),
650
+ animate(getEaseLinear(25), onStageHidden),
651
+ ])),
652
+ transition('enter => below-with-delay, enter-from-below => below-with-delay', sequence([
653
+ animate(teleport, onStage),
654
+ animate(getEaseLinear(50, defaultDelay), onStageHidden),
655
+ ])),
656
+ ]),
657
+ };
658
+
659
+ /**
660
+ * Injection token used to provide the parent menu to menu-specific components.
661
+ * @docs-private
662
+ */
663
+ const GRANITE_MENU_PANEL = new InjectionToken('GRANITE_MENU_PANEL');
664
+
665
+ /**
666
+ * @license
667
+ * Copyright Google LLC All Rights Reserved.
668
+ *
669
+ * Use of this source code is governed by an MIT-style license that can be
670
+ * found in the LICENSE file at https://angular.io/license
671
+ */
672
+ /**
673
+ * Throws an exception for the case when menu trigger doesn't have a valid granite-menu instance
674
+ * @docs-private
675
+ */
676
+ function throwGraniteMenuMissingError() {
677
+ throw Error(`graniteMenuTriggerFor: must pass in an granite-menu instance.
678
+
679
+ Example:
680
+ <granite-menu #menu="graniteMenu"></granite-menu>
681
+ <button [graniteMenuTriggerFor]="menu"></button>`);
682
+ }
683
+ /**
684
+ * Throws an exception for the case when menu's x-position value isn't valid.
685
+ * In other words, it doesn't match 'before' or 'after'.
686
+ * @docs-private
687
+ */
688
+ function throwGraniteMenuInvalidPositionX() {
689
+ throw Error(`xPosition value must be either 'before' or after'.
690
+ Example: <granite-menu xPosition="before" #menu="graniteMenu"></granite-menu>`);
691
+ }
692
+ /**
693
+ * Throws an exception for the case when menu's y-position value isn't valid.
694
+ * In other words, it doesn't match 'above' or 'below'.
695
+ * @docs-private
696
+ */
697
+ function throwGraniteMenuInvalidPositionY() {
698
+ throw Error(`yPosition value must be either 'above' or below'.
699
+ Example: <granite-menu yPosition="above" #menu="graniteMenu"></granite-menu>`);
700
+ }
701
+
702
+ class GraniteIconComponent {
703
+ constructor(_elementRef, renderer, ariaHidden) {
704
+ this._elementRef = _elementRef;
705
+ this.renderer = renderer;
706
+ // aria-hidden will be set to true by default, unless it's overridden by the developer
707
+ if (!ariaHidden) {
708
+ this.renderer.setAttribute(_elementRef.nativeElement, 'aria-hidden', 'true');
709
+ }
710
+ }
711
+ ngOnChanges(changes) {
712
+ if (changes.fontIcon) {
713
+ this._updateFontIcon();
714
+ }
715
+ }
716
+ _updateFontIcon() {
717
+ if (this.fontIcon !== this._previousFontIconClass) {
718
+ if (this._previousFontIconClass) {
719
+ this.renderer.removeClass(this._elementRef.nativeElement, this._previousFontIconClass);
720
+ }
721
+ if (this.fontIcon) {
722
+ this.renderer.addClass(this._elementRef.nativeElement, this.fontIcon);
723
+ }
724
+ this._previousFontIconClass = this.fontIcon;
725
+ }
726
+ }
727
+ }
728
+ GraniteIconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteIconComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: 'aria-hidden', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
729
+ GraniteIconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteIconComponent, selector: "granite-icon", inputs: { fontIcon: "fontIcon" }, host: { attributes: { "role": "img" }, classAttribute: "granite-icon" }, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host.granite-icon{background-repeat:no-repeat;display:inline-block;padding:0 calc(var(--granite-spacing-xs) / 2);font-size:1em;line-height:1em;position:relative;top:.1em}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
730
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteIconComponent, decorators: [{
731
+ type: Component,
732
+ args: [{ selector: 'granite-icon', template: '<ng-content></ng-content>', host: {
733
+ role: 'img',
734
+ class: 'granite-icon',
735
+ }, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host.granite-icon{background-repeat:no-repeat;display:inline-block;padding:0 calc(var(--granite-spacing-xs) / 2);font-size:1em;line-height:1em;position:relative;top:.1em}\n"] }]
736
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: undefined, decorators: [{
737
+ type: Attribute,
738
+ args: ['aria-hidden']
739
+ }] }]; }, propDecorators: { fontIcon: [{
740
+ type: Input
741
+ }] } });
742
+
743
+ class GraniteMenuItemComponent {
744
+ constructor(_elementRef, _focusMonitor, _parentMenu) {
745
+ this._elementRef = _elementRef;
746
+ this._focusMonitor = _focusMonitor;
747
+ this._parentMenu = _parentMenu;
748
+ /** ARIA role for the menu item. */
749
+ this.role = 'menuitem';
750
+ /** Stream that emits when the menu item is hovered. */
751
+ // eslint-disable-next-line rxjs/no-exposed-subjects
752
+ this._hovered = new Subject();
753
+ /** Stream that emits when the menu item is focused. */
754
+ // eslint-disable-next-line rxjs/no-exposed-subjects
755
+ this._focused = new Subject();
756
+ /** Whether the menu item acts as a trigger for a sub-menu (used for styling) */
757
+ this._triggersSubmenu = false;
758
+ /**
759
+ * Whether the menu item is highlighted, e.g. in the "breadcrumb" parent chain
760
+ * of sub menu trigger items
761
+ */
762
+ this._highlighted = false;
763
+ // Start monitoring the element so it gets the appropriate focused classes. We want
764
+ // to show the focus style for menu items only when the focus was not caused by a
765
+ // mouse or touch interaction.
766
+ _focusMonitor.monitor(this._elementRef, false);
767
+ }
768
+ ngOnDestroy() {
769
+ this._focusMonitor.stopMonitoring(this._elementRef);
770
+ this._hovered.complete();
771
+ this._focused.complete();
772
+ }
773
+ /** Focuses the menu item. */
774
+ focus(origin = 'program', options) {
775
+ this._focusMonitor.focusVia(this._getHostElement(), origin, options);
776
+ this._focused.next(this);
777
+ }
778
+ /** Returns the host DOM element. */
779
+ _getHostElement() {
780
+ return this._elementRef.nativeElement;
781
+ }
782
+ }
783
+ GraniteMenuItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuItemComponent, deps: [{ token: i0.ElementRef }, { token: i1.FocusMonitor }, { token: GRANITE_MENU_PANEL, optional: true }], target: i0.ɵɵFactoryTarget.Component });
784
+ GraniteMenuItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteMenuItemComponent, selector: "[graniteMenuItem]", inputs: { role: "role" }, host: { listeners: { "mouseenter": "_hovered.next(this)" }, properties: { "attr.role": "role", "class.granite-menu-item": "true", "class.granite-menu-item-highlighted": "_highlighted", "class.granite-menu-item-submenu-trigger": "_triggersSubmenu", "class.granite-device-output-touch": "_clientOutput?.device === \"touch\"" } }, exportAs: ["graniteMenuItem"], ngImport: i0, template: `<ng-content></ng-content>
785
+ <ng-container *ngIf="_triggersSubmenu">
786
+ <granite-icon
787
+ class="caret-left"
788
+ [fontIcon]="'icon-caret-left'"
789
+ ></granite-icon>
790
+ <granite-icon
791
+ class="caret-right"
792
+ [fontIcon]="'icon-caret-right'"
793
+ ></granite-icon>
794
+ </ng-container>`, isInline: true, styles: [":host{display:block;position:relative;line-height:2rem;padding:0 var(--granite-spacing-s);width:100%;max-width:100%;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start;text-decoration:none;background-color:var(--granite-color-background-variant);color:var(--granite-color-text);font-size:var(--granite-font-size-body-small);font-family:inherit}@media (hover: hover) and (pointer: fine){:host:hover:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}@media (hover: none) and (pointer: coarse){:host:active:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}:host.granite-title{-webkit-user-select:none;user-select:none;display:flex;align-items:center;line-height:1.5rem;width:100%;outline:none;border:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;color:var(--granite-color-text);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-bold);cursor:default}:host.cdk-mouse-focused,:host.cdk-program-focused,:host.cdk-keyboard-focused,:host.granite-menu-item-highlighted{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}:host granite-icon{position:absolute;font-size:var(--granite-font-size-body-small);color:inherit;top:50%;transform:translateY(-50%)}:host.granite-menu-item-submenu-trigger{padding-inline-end:var(--granite-spacing-l)}html[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon.caret-right{display:none}[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon.caret-left{display:none}:host.granite-divider-top{border-top:.0625rem solid var(--granite-color-border-soft)}:host.granite-divider-bottom{border-bottom:.0625rem solid var(--granite-color-border-soft)}:host.granite-device-output-touch{line-height:3rem;font-size:var(--granite-font-size-body-small);text-align:center;padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-title{padding:0;justify-content:center;line-height:1.5rem;font-size:var(--granite-font-size-micro)}:host.granite-device-output-touch.granite-menu-item-back-trigger,:host.granite-device-output-touch.granite-menu-item-submenu-trigger{padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-menu-item-title{line-height:3rem;height:3rem;font-size:var(--granite-font-size-micro);color:var(--granite-color-text-weak)}@media (hover: none) and (pointer: coarse){:host.granite-device-output-touch.granite-menu-item-title:active{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}html[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-left{display:none}[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-right{display:none}:host:disabled:not(.granite-menu-item-title){opacity:.4;cursor:default}\n"], components: [{ type: GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
795
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuItemComponent, decorators: [{
796
+ type: Component,
797
+ args: [{ selector: '[graniteMenuItem]', template: `<ng-content></ng-content>
798
+ <ng-container *ngIf="_triggersSubmenu">
799
+ <granite-icon
800
+ class="caret-left"
801
+ [fontIcon]="'icon-caret-left'"
802
+ ></granite-icon>
803
+ <granite-icon
804
+ class="caret-right"
805
+ [fontIcon]="'icon-caret-right'"
806
+ ></granite-icon>
807
+ </ng-container>`, exportAs: 'graniteMenuItem', host: {
808
+ '[attr.role]': 'role',
809
+ '[class.granite-menu-item]': 'true',
810
+ '[class.granite-menu-item-highlighted]': '_highlighted',
811
+ '[class.granite-menu-item-submenu-trigger]': '_triggersSubmenu',
812
+ //#region --- Touch device customizations ---
813
+ '[class.granite-device-output-touch]': '_clientOutput?.device === "touch"',
814
+ //#endregion --- Touch device customizations ---
815
+ '(mouseenter)': '_hovered.next(this)',
816
+ }, styles: [":host{display:block;position:relative;line-height:2rem;padding:0 var(--granite-spacing-s);width:100%;max-width:100%;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start;text-decoration:none;background-color:var(--granite-color-background-variant);color:var(--granite-color-text);font-size:var(--granite-font-size-body-small);font-family:inherit}@media (hover: hover) and (pointer: fine){:host:hover:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}@media (hover: none) and (pointer: coarse){:host:active:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}:host.granite-title{-webkit-user-select:none;user-select:none;display:flex;align-items:center;line-height:1.5rem;width:100%;outline:none;border:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;color:var(--granite-color-text);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-bold);cursor:default}:host.cdk-mouse-focused,:host.cdk-program-focused,:host.cdk-keyboard-focused,:host.granite-menu-item-highlighted{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}:host granite-icon{position:absolute;font-size:var(--granite-font-size-body-small);color:inherit;top:50%;transform:translateY(-50%)}:host.granite-menu-item-submenu-trigger{padding-inline-end:var(--granite-spacing-l)}html[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon.caret-right{display:none}[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon.caret-left{display:none}:host.granite-divider-top{border-top:.0625rem solid var(--granite-color-border-soft)}:host.granite-divider-bottom{border-bottom:.0625rem solid var(--granite-color-border-soft)}:host.granite-device-output-touch{line-height:3rem;font-size:var(--granite-font-size-body-small);text-align:center;padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-title{padding:0;justify-content:center;line-height:1.5rem;font-size:var(--granite-font-size-micro)}:host.granite-device-output-touch.granite-menu-item-back-trigger,:host.granite-device-output-touch.granite-menu-item-submenu-trigger{padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-menu-item-title{line-height:3rem;height:3rem;font-size:var(--granite-font-size-micro);color:var(--granite-color-text-weak)}@media (hover: none) and (pointer: coarse){:host.granite-device-output-touch.granite-menu-item-title:active{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}html[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-left{display:none}[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-right{display:none}:host:disabled:not(.granite-menu-item-title){opacity:.4;cursor:default}\n"] }]
817
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.FocusMonitor }, { type: undefined, decorators: [{
818
+ type: Inject,
819
+ args: [GRANITE_MENU_PANEL]
820
+ }, {
821
+ type: Optional
822
+ }] }]; }, propDecorators: { role: [{
823
+ type: Input
824
+ }] } });
825
+
826
+ /** Counter for panel ID generation */
827
+ let menuPanelUid = 0;
828
+ /** Menu panel animation default transform values */
829
+ const transformMenuDefault = {
830
+ value: 'void',
831
+ params: {
832
+ xOffset: 0,
833
+ },
834
+ };
835
+ /** Base class with all of the menu functionality. */
836
+ // eslint-disable-next-line @angular-eslint/directive-class-suffix
837
+ class _MenuBaseComponent {
838
+ constructor(_changeDetectorRef) {
839
+ this._changeDetectorRef = _changeDetectorRef;
840
+ this.openOnHover = true;
841
+ /**
842
+ * Event emitted when the menu is closed
843
+ */
844
+ this.closed = new EventEmitter();
845
+ /**
846
+ * Used for locating the panel in tests and setting the aria-control attribute
847
+ * for the menu trigger.
848
+ */
849
+ this.panelId = `granite-menu-panel-${menuPanelUid++}`;
850
+ /** Whether to show back button in touch menu title bar */
851
+ this.showBackButton = false;
852
+ /** Whether to show touch menu title bar */
853
+ this.showTitle = false;
854
+ /** Whether to add a close button below the menu */
855
+ this.showCloseButton = false;
856
+ /** Observable current state of the panel animation. */
857
+ // eslint-disable-next-line rxjs/no-exposed-subjects
858
+ this._transformMenu = new BehaviorSubject(transformMenuDefault);
859
+ /** Emits whenever an animation on the menu completes. */
860
+ // eslint-disable-next-line rxjs/no-exposed-subjects
861
+ this._animationDone = new Subject();
862
+ this._menuEmpty$ = new BehaviorSubject(false);
863
+ // eslint-disable-next-line @typescript-eslint/member-ordering
864
+ this._isMenuEmpty$ = combineLatest([
865
+ this._menuEmpty$,
866
+ this._animationDone,
867
+ ]).pipe(filter(([m, a]) => m && a != null), map(() => true));
868
+ /** Only the direct descendant menu items. */
869
+ this._directDescendantItems = new QueryList();
870
+ /** Subscription to tab events on the menu panel */
871
+ this._tabSubscription = Subscription.EMPTY;
872
+ this._xPosition = 'after';
873
+ this._yPosition = 'below';
874
+ /**
875
+ * Current horizontal offset. Used with `pan` and `pan-hidden`
876
+ * animation states.
877
+ */
878
+ this.xOffset = 0;
879
+ }
880
+ /** Position of the menu in the X axis. */
881
+ get xPosition() {
882
+ return this._xPosition;
883
+ }
884
+ set xPosition(value) {
885
+ if (value !== 'before' && value !== 'after') {
886
+ throwGraniteMenuInvalidPositionX();
887
+ }
888
+ this._xPosition = value;
889
+ }
890
+ /** Position of the menu in the Y axis. */
891
+ get yPosition() {
892
+ return this._yPosition;
893
+ }
894
+ set yPosition(value) {
895
+ if (value !== 'above' && value !== 'below') {
896
+ throwGraniteMenuInvalidPositionY();
897
+ }
898
+ this._yPosition = value;
899
+ }
900
+ /** Current state of the panel animation. */
901
+ set _panelAnimationState(state) {
902
+ this._transformMenu.next({
903
+ value: state,
904
+ params: { xOffset: this.xOffset },
905
+ });
906
+ }
907
+ ngAfterContentChecked() {
908
+ this._menuEmpty$.next(this._allItems.length < 1 ? true : false);
909
+ }
910
+ ngAfterContentInit() {
911
+ this._updateDirectDescendants();
912
+ this._keyManager = new FocusKeyManager(this._directDescendantItems)
913
+ .withWrap()
914
+ .skipPredicate((menuItem) => {
915
+ const hostElement = menuItem._getHostElement();
916
+ return hostElement instanceof HTMLButtonElement
917
+ ? hostElement.disabled
918
+ : hostElement.hasAttribute('graniteTitle');
919
+ });
920
+ this._tabSubscription = this._keyManager.tabOut.subscribe(() => {
921
+ this.closed.emit('tab');
922
+ });
923
+ // If a user manually (programatically) focuses a menu item, we need to reflect that focus
924
+ // change back to the key manager. Note that we don't need to unsubscribe here because _focused
925
+ // is internal and we know that it gets completed on destroy.
926
+ this._directDescendantItems.changes
927
+ .pipe(startWith(this._directDescendantItems), switchMap((items) => merge(...items.map((item) => item._focused))))
928
+ .subscribe((focusedItem) => this._keyManager.updateActiveItem(focusedItem));
929
+ }
930
+ ngOnDestroy() {
931
+ this._directDescendantItems.destroy();
932
+ this._tabSubscription.unsubscribe();
933
+ this.closed.complete();
934
+ }
935
+ /**
936
+ * Stream that combines the `_hovered` observables of all the menu's items
937
+ * into a single observable. Emits whenever the hovered menu item changes.
938
+ */
939
+ _hovered() {
940
+ // Coerce the `changes` property because Angular types it as `Observable<any>`
941
+ const itemChanges = this._directDescendantItems.changes;
942
+ return itemChanges.pipe(startWith(this._directDescendantItems),
943
+ // Hovering is not applicable when producing touch output
944
+ filter(() => {
945
+ return this._clientOutput?.device !== 'touch';
946
+ }), switchMap((items) => merge(...items.map((item) => item._hovered))));
947
+ }
948
+ /** Handle a keyboard event from the menu, delegating to the appropriate action. */
949
+ _handleKeydown(event) {
950
+ const key = event.key;
951
+ const manager = this._keyManager;
952
+ switch (key) {
953
+ case 'Escape':
954
+ if (!hasModifierKey(event)) {
955
+ event.preventDefault();
956
+ this.closed.emit('keydown');
957
+ }
958
+ break;
959
+ case 'ArrowLeft':
960
+ if (this.parentMenu && this.direction === 'ltr') {
961
+ this.closed.emit('keydown');
962
+ }
963
+ break;
964
+ case 'ArrowRight':
965
+ if (this.parentMenu && this.direction === 'rtl') {
966
+ this.closed.emit('keydown');
967
+ }
968
+ break;
969
+ case 'Home':
970
+ case 'End':
971
+ if (!hasModifierKey(event)) {
972
+ key === 'Home'
973
+ ? manager.setFirstItemActive()
974
+ : manager.setLastItemActive();
975
+ event.preventDefault();
976
+ }
977
+ break;
978
+ default:
979
+ if (key === 'ArrowUp' || key === 'ArrowDown') {
980
+ manager.setFocusOrigin('keyboard');
981
+ }
982
+ manager.onKeydown(event);
983
+ }
984
+ }
985
+ /**
986
+ * Focus the first item in the menu.
987
+ * @param origin Action from which the focus originated. Used to set the correct styling.
988
+ */
989
+ focusFirstItem(origin = 'program') {
990
+ this._keyManager.setFocusOrigin(origin).setFirstItemActive();
991
+ }
992
+ /** Updates the `showTitle` property for touch device UI */
993
+ _updateShowTitle() {
994
+ this.showTitle = !!this.title || this.showBackButton;
995
+ }
996
+ /** Starts the enter animation */
997
+ _startAnimation() {
998
+ this._panelAnimationState = 'enter';
999
+ }
1000
+ /** Resets the panel animation to its initial state. */
1001
+ _resetAnimation() {
1002
+ this._panelAnimationState = 'void';
1003
+ }
1004
+ /**
1005
+ * Starts the 'below' animation, moving a menu down, out of view below the
1006
+ * viewport. Used to close the whole menu, for example when clicking
1007
+ * the backdrop.
1008
+ */
1009
+ _startTouchCloseDownAnimation() {
1010
+ this._panelAnimationState = 'below';
1011
+ }
1012
+ /**
1013
+ * Starts the 'below-with-delay' animation, moving a menu down, out of view below the
1014
+ * viewport. Used to close the whole menu as a response to the user tapping
1015
+ * a menu item. There is a short delay before the animation starts, to that
1016
+ * the user gets a visual feedback on what item was selected.
1017
+ */
1018
+ _startTouchCloseDownAnimationWithDelay() {
1019
+ this._panelAnimationState = 'below-with-delay';
1020
+ }
1021
+ /**
1022
+ * Starts the 'void' animation, moving a (sub) menu out of view to the side
1023
+ * of the viewport. Used when going "back" from a sub menu.
1024
+ */
1025
+ _startTouchCloseSideAnimation() {
1026
+ this._resetAnimation();
1027
+ }
1028
+ /**
1029
+ * Starts the enter-from-below animation, moving a (root) menu into view,
1030
+ * Animates upwards from a starting position below the viewport.
1031
+ */
1032
+ _startTouchRootEnterAnimation() {
1033
+ this._panelAnimationState = 'enter-from-below';
1034
+ this.xOffset = 0;
1035
+ }
1036
+ /** Starts the enter animation, moving a (sub) menu into view. */
1037
+ _startTouchSubmenuEnterAnimation() {
1038
+ this._panelAnimationState = 'enter';
1039
+ this.xOffset = 0;
1040
+ }
1041
+ /**
1042
+ * Starts the pan animation, to position a submenu in a response
1043
+ * to user dragging sideways (panning).
1044
+ */
1045
+ _startTouchPanAnimation(xOffset) {
1046
+ this._panelAnimationState = 'pan';
1047
+ this.xOffset = xOffset;
1048
+ }
1049
+ /**
1050
+ * Starts the pan-hidden animation, to position a parent menu next to an
1051
+ * active submenu that the user is dragging sideways (panning).
1052
+ */
1053
+ _startTouchHidePanAnimation(xOffset) {
1054
+ this._panelAnimationState = 'pan-hidden';
1055
+ this.xOffset = xOffset;
1056
+ }
1057
+ /**
1058
+ * Starts the hide animation, to make a parent menu slide out to leave
1059
+ * space for a submenu.
1060
+ */
1061
+ _startTouchHideAnimation() {
1062
+ this._panelAnimationState = 'hide';
1063
+ this.xOffset = 0;
1064
+ }
1065
+ /** Callback that is invoked when the panel animation completes. */
1066
+ _onAnimationDone(event) {
1067
+ this._animationDone.next(event);
1068
+ this._isAnimating = false;
1069
+ }
1070
+ _onAnimationStart(event) {
1071
+ this._isAnimating = true;
1072
+ // Scroll the content element to the top as soon as the animation starts. This is necessary,
1073
+ // because we move focus to the first item while it's still being animated, which can throw
1074
+ // the browser off when it determines the scroll position. Alternatively we can move focus
1075
+ // when the animation is done, however moving focus asynchronously will interrupt screen
1076
+ // readers which are in the process of reading out the menu already. We take the `element`
1077
+ // from the `event` since we can't use a `ViewChild` to access the pane.
1078
+ if ((event.toState === 'enter' || event.toState === 'enter-from-below') &&
1079
+ this._keyManager.activeItemIndex === 0) {
1080
+ event.element.scrollTop = 0;
1081
+ }
1082
+ }
1083
+ /**
1084
+ * Handle click on the menu by emitting on the `closed` emitter
1085
+ * with a `click` reason
1086
+ */
1087
+ _handleClick() {
1088
+ this.closed.emit('click');
1089
+ }
1090
+ /**
1091
+ * Handle click on the close button by emitting on the `closed` emitter
1092
+ * without any particular reason
1093
+ */
1094
+ _handleCloseClick() {
1095
+ this.closed.emit();
1096
+ }
1097
+ /**
1098
+ * Handle click on the back icon by emitting on the `clicked` emitter
1099
+ */
1100
+ _handleBackClick(e) {
1101
+ if (this.showBackButton) {
1102
+ // Close submenu keydown-style: close only this menu and leave parents open
1103
+ this.closed.emit('keydown');
1104
+ }
1105
+ e.stopPropagation();
1106
+ }
1107
+ /**
1108
+ * Update client device information for the menu and its menu items.
1109
+ */
1110
+ _setDevice(clientInput, clientOutput) {
1111
+ this._clientInput = clientInput;
1112
+ this._clientOutput = clientOutput;
1113
+ this._directDescendantItems.forEach((item) => {
1114
+ item._clientInput = clientInput;
1115
+ item._clientOutput = clientOutput;
1116
+ });
1117
+ this._changeDetectorRef.markForCheck();
1118
+ }
1119
+ /**
1120
+ * Resets the active item in the menu. This is used when the menu is opened, allowing
1121
+ * the user to start from the first option when pressing the down arrow.
1122
+ */
1123
+ resetActiveItem() {
1124
+ this._keyManager.setActiveItem(-1);
1125
+ }
1126
+ /**
1127
+ * Sets up a stream that will keep track of any newly-added menu items and will update the list
1128
+ * of direct descendants. We collect the descendants this way, because `_allItems` can include
1129
+ * items that are part of child menus, and using a custom way of registering items is unreliable
1130
+ * when it comes to maintaining the item order.
1131
+ */
1132
+ _updateDirectDescendants() {
1133
+ this._allItems.changes
1134
+ .pipe(startWith(this._allItems))
1135
+ .subscribe((items) => {
1136
+ this._directDescendantItems.reset(items.filter((item) => item._parentMenu === this));
1137
+ this._directDescendantItems.notifyOnChanges();
1138
+ });
1139
+ }
1140
+ }
1141
+ _MenuBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: _MenuBaseComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
1142
+ _MenuBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: _MenuBaseComponent, inputs: { xPosition: "xPosition", yPosition: "yPosition", title: "title", closeLabel: "closeLabel", openOnHover: "openOnHover" }, outputs: { closed: "closed" }, queries: [{ propertyName: "_allItems", predicate: GraniteMenuItemComponent, descendants: true }], viewQueries: [{ propertyName: "templateRef", first: true, predicate: TemplateRef, descendants: true }], ngImport: i0 });
1143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: _MenuBaseComponent, decorators: [{
1144
+ type: Directive
1145
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { xPosition: [{
1146
+ type: Input
1147
+ }], yPosition: [{
1148
+ type: Input
1149
+ }], title: [{
1150
+ type: Input
1151
+ }], closeLabel: [{
1152
+ type: Input
1153
+ }], openOnHover: [{
1154
+ type: Input
1155
+ }], templateRef: [{
1156
+ type: ViewChild,
1157
+ args: [TemplateRef]
1158
+ }], _allItems: [{
1159
+ type: ContentChildren,
1160
+ args: [GraniteMenuItemComponent, { descendants: true }]
1161
+ }], closed: [{
1162
+ type: Output
1163
+ }] } });
1164
+
1165
+ class GraniteMenuTouchTitleItemComponent {
1166
+ constructor(
1167
+ /** If this is an item on a _submenu_, its parent menu will have a parent */
1168
+ _parentMenu) {
1169
+ /**
1170
+ * Whether the menu item acts as a trigger to return to a parent menu
1171
+ * (used for styling)
1172
+ */
1173
+ this._triggersBack = false;
1174
+ this._triggersBack = !!_parentMenu.parentMenu;
1175
+ }
1176
+ }
1177
+ GraniteMenuTouchTitleItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuTouchTitleItemComponent, deps: [{ token: GRANITE_MENU_PANEL, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1178
+ GraniteMenuTouchTitleItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteMenuTouchTitleItemComponent, selector: "[graniteMenuTouchTitleItem]", host: { properties: { "class.granite-menu-item-title": "true", "class.granite-menu-item-back-trigger": "_triggersBack", "class.granite-device-output-touch": "true" } }, exportAs: ["graniteMenuTouchTitleItem"], ngImport: i0, template: `
1179
+ <ng-container *ngIf="_triggersBack">
1180
+ <granite-icon
1181
+ class="caret-left"
1182
+ [fontIcon]="'icon-caret-left'"
1183
+ ></granite-icon>
1184
+ <granite-icon
1185
+ class="caret-right"
1186
+ [fontIcon]="'icon-caret-right'"
1187
+ ></granite-icon>
1188
+ </ng-container>
1189
+ <ng-content></ng-content>
1190
+ `, isInline: true, styles: [":host{display:block;position:relative;line-height:2rem;padding:0 var(--granite-spacing-s);width:100%;max-width:100%;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start;text-decoration:none;background-color:var(--granite-color-background-variant);color:var(--granite-color-text);font-size:var(--granite-font-size-body-small);font-family:inherit}@media (hover: hover) and (pointer: fine){:host:hover:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}@media (hover: none) and (pointer: coarse){:host:active:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}:host.granite-title{-webkit-user-select:none;user-select:none;display:flex;align-items:center;line-height:1.5rem;width:100%;outline:none;border:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;color:var(--granite-color-text);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-bold);cursor:default}:host.cdk-mouse-focused,:host.cdk-program-focused,:host.cdk-keyboard-focused,:host.granite-menu-item-highlighted{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}:host granite-icon{position:absolute;font-size:var(--granite-font-size-body-small);color:inherit;top:50%;transform:translateY(-50%)}:host.granite-menu-item-submenu-trigger{padding-inline-end:var(--granite-spacing-l)}html[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon.caret-right{display:none}[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon.caret-left{display:none}:host.granite-divider-top{border-top:.0625rem solid var(--granite-color-border-soft)}:host.granite-divider-bottom{border-bottom:.0625rem solid var(--granite-color-border-soft)}:host.granite-device-output-touch{line-height:3rem;font-size:var(--granite-font-size-body-small);text-align:center;padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-title{padding:0;justify-content:center;line-height:1.5rem;font-size:var(--granite-font-size-micro)}:host.granite-device-output-touch.granite-menu-item-back-trigger,:host.granite-device-output-touch.granite-menu-item-submenu-trigger{padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-menu-item-title{line-height:3rem;height:3rem;font-size:var(--granite-font-size-micro);color:var(--granite-color-text-weak)}@media (hover: none) and (pointer: coarse){:host.granite-device-output-touch.granite-menu-item-title:active{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}html[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-left{display:none}[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-right{display:none}:host:disabled:not(.granite-menu-item-title){opacity:.4;cursor:default}\n"], components: [{ type: GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
1191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuTouchTitleItemComponent, decorators: [{
1192
+ type: Component,
1193
+ args: [{ selector: '[graniteMenuTouchTitleItem]', template: `
1194
+ <ng-container *ngIf="_triggersBack">
1195
+ <granite-icon
1196
+ class="caret-left"
1197
+ [fontIcon]="'icon-caret-left'"
1198
+ ></granite-icon>
1199
+ <granite-icon
1200
+ class="caret-right"
1201
+ [fontIcon]="'icon-caret-right'"
1202
+ ></granite-icon>
1203
+ </ng-container>
1204
+ <ng-content></ng-content>
1205
+ `, exportAs: 'graniteMenuTouchTitleItem', host: {
1206
+ '[class.granite-menu-item-title]': 'true',
1207
+ '[class.granite-menu-item-back-trigger]': '_triggersBack',
1208
+ '[class.granite-device-output-touch]': 'true',
1209
+ }, styles: [":host{display:block;position:relative;line-height:2rem;padding:0 var(--granite-spacing-s);width:100%;max-width:100%;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start;text-decoration:none;background-color:var(--granite-color-background-variant);color:var(--granite-color-text);font-size:var(--granite-font-size-body-small);font-family:inherit}@media (hover: hover) and (pointer: fine){:host:hover:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}@media (hover: none) and (pointer: coarse){:host:active:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}:host.granite-title{-webkit-user-select:none;user-select:none;display:flex;align-items:center;line-height:1.5rem;width:100%;outline:none;border:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;color:var(--granite-color-text);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-bold);cursor:default}:host.cdk-mouse-focused,:host.cdk-program-focused,:host.cdk-keyboard-focused,:host.granite-menu-item-highlighted{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}:host granite-icon{position:absolute;font-size:var(--granite-font-size-body-small);color:inherit;top:50%;transform:translateY(-50%)}:host.granite-menu-item-submenu-trigger{padding-inline-end:var(--granite-spacing-l)}html[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon.caret-right{display:none}[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon.caret-left{display:none}:host.granite-divider-top{border-top:.0625rem solid var(--granite-color-border-soft)}:host.granite-divider-bottom{border-bottom:.0625rem solid var(--granite-color-border-soft)}:host.granite-device-output-touch{line-height:3rem;font-size:var(--granite-font-size-body-small);text-align:center;padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-title{padding:0;justify-content:center;line-height:1.5rem;font-size:var(--granite-font-size-micro)}:host.granite-device-output-touch.granite-menu-item-back-trigger,:host.granite-device-output-touch.granite-menu-item-submenu-trigger{padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-menu-item-title{line-height:3rem;height:3rem;font-size:var(--granite-font-size-micro);color:var(--granite-color-text-weak)}@media (hover: none) and (pointer: coarse){:host.granite-device-output-touch.granite-menu-item-title:active{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}html[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-left{display:none}[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-right{display:none}:host:disabled:not(.granite-menu-item-title){opacity:.4;cursor:default}\n"] }]
1210
+ }], ctorParameters: function () { return [{ type: _MenuBaseComponent, decorators: [{
1211
+ type: Inject,
1212
+ args: [GRANITE_MENU_PANEL]
1213
+ }, {
1214
+ type: Optional
1215
+ }] }]; } });
1216
+
1217
+ class GraniteMenuTouchCloseComponent {
1218
+ }
1219
+ GraniteMenuTouchCloseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuTouchCloseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1220
+ GraniteMenuTouchCloseComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteMenuTouchCloseComponent, selector: "[graniteMenuTouchCloseItem]", host: { properties: { "class.granite-device-output-touch": "true" } }, exportAs: ["graniteMenuTouchCloseItem"], ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{display:block;position:relative;line-height:2rem;padding:0 var(--granite-spacing-s);width:100%;max-width:100%;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start;text-decoration:none;background-color:var(--granite-color-background-variant);color:var(--granite-color-text);font-size:var(--granite-font-size-body-small);font-family:inherit}@media (hover: hover) and (pointer: fine){:host:hover:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}@media (hover: none) and (pointer: coarse){:host:active:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}:host.granite-title{-webkit-user-select:none;user-select:none;display:flex;align-items:center;line-height:1.5rem;width:100%;outline:none;border:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;color:var(--granite-color-text);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-bold);cursor:default}:host.cdk-mouse-focused,:host.cdk-program-focused,:host.cdk-keyboard-focused,:host.granite-menu-item-highlighted{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}:host granite-icon{position:absolute;font-size:var(--granite-font-size-body-small);color:inherit;top:50%;transform:translateY(-50%)}:host.granite-menu-item-submenu-trigger{padding-inline-end:var(--granite-spacing-l)}html[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon.caret-right{display:none}[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon.caret-left{display:none}:host.granite-divider-top{border-top:.0625rem solid var(--granite-color-border-soft)}:host.granite-divider-bottom{border-bottom:.0625rem solid var(--granite-color-border-soft)}:host.granite-device-output-touch{line-height:3rem;font-size:var(--granite-font-size-body-small);text-align:center;padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-title{padding:0;justify-content:center;line-height:1.5rem;font-size:var(--granite-font-size-micro)}:host.granite-device-output-touch.granite-menu-item-back-trigger,:host.granite-device-output-touch.granite-menu-item-submenu-trigger{padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-menu-item-title{line-height:3rem;height:3rem;font-size:var(--granite-font-size-micro);color:var(--granite-color-text-weak)}@media (hover: none) and (pointer: coarse){:host.granite-device-output-touch.granite-menu-item-title:active{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}html[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-left{display:none}[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-right{display:none}:host:disabled:not(.granite-menu-item-title){opacity:.4;cursor:default}\n"] });
1221
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuTouchCloseComponent, decorators: [{
1222
+ type: Component,
1223
+ args: [{ selector: '[graniteMenuTouchCloseItem]', template: '<ng-content></ng-content>', exportAs: 'graniteMenuTouchCloseItem', host: {
1224
+ '[class.granite-device-output-touch]': 'true',
1225
+ }, styles: [":host{display:block;position:relative;line-height:2rem;padding:0 var(--granite-spacing-s);width:100%;max-width:100%;-webkit-user-select:none;user-select:none;cursor:pointer;outline:none;border:none;-webkit-tap-highlight-color:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start;text-decoration:none;background-color:var(--granite-color-background-variant);color:var(--granite-color-text);font-size:var(--granite-font-size-body-small);font-family:inherit}@media (hover: hover) and (pointer: fine){:host:hover:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}@media (hover: none) and (pointer: coarse){:host:active:not(.granite-title):not([disabled]){background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}:host.granite-title{-webkit-user-select:none;user-select:none;display:flex;align-items:center;line-height:1.5rem;width:100%;outline:none;border:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;color:var(--granite-color-text);font-size:var(--granite-font-size-micro);font-weight:var(--granite-font-weight-bold);cursor:default}:host.cdk-mouse-focused,:host.cdk-program-focused,:host.cdk-keyboard-focused,:host.granite-menu-item-highlighted{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}:host granite-icon{position:absolute;font-size:var(--granite-font-size-body-small);color:inherit;top:50%;transform:translateY(-50%)}:host.granite-menu-item-submenu-trigger{padding-inline-end:var(--granite-spacing-l)}html[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-menu-item-submenu-trigger granite-icon{right:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-menu-item-submenu-trigger granite-icon{left:var(--granite-spacing-xs)}[dir=rtl] :host.granite-menu-item-submenu-trigger granite-icon.caret-right{display:none}[dir=ltr] :host.granite-menu-item-submenu-trigger granite-icon.caret-left{display:none}:host.granite-divider-top{border-top:.0625rem solid var(--granite-color-border-soft)}:host.granite-divider-bottom{border-bottom:.0625rem solid var(--granite-color-border-soft)}:host.granite-device-output-touch{line-height:3rem;font-size:var(--granite-font-size-body-small);text-align:center;padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-title{padding:0;justify-content:center;line-height:1.5rem;font-size:var(--granite-font-size-micro)}:host.granite-device-output-touch.granite-menu-item-back-trigger,:host.granite-device-output-touch.granite-menu-item-submenu-trigger{padding:0 var(--granite-spacing-l)}:host.granite-device-output-touch.granite-menu-item-title{line-height:3rem;height:3rem;font-size:var(--granite-font-size-micro);color:var(--granite-color-text-weak)}@media (hover: none) and (pointer: coarse){:host.granite-device-output-touch.granite-menu-item-title:active{background:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active)}}html[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}:host-context([dir=ltr]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{left:var(--granite-spacing-xs)}html[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}:host-context([dir=rtl]) :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon{right:var(--granite-spacing-xs)}[dir=rtl] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-left{display:none}[dir=ltr] :host.granite-device-output-touch.granite-menu-item-back-trigger granite-icon.caret-right{display:none}:host:disabled:not(.granite-menu-item-title){opacity:.4;cursor:default}\n"] }]
1226
+ }] });
1227
+
1228
+ class GraniteMenuComponent extends _MenuBaseComponent {
1229
+ }
1230
+ GraniteMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
1231
+ GraniteMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteMenuComponent, selector: "granite-menu", providers: [
1232
+ { provide: GRANITE_MENU_PANEL, useExisting: GraniteMenuComponent },
1233
+ ], exportAs: ["graniteMenu"], usesInheritance: true, ngImport: i0, 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;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;user-select:none;filter:drop-shadow(var(--granite-shadow-l));border-radius:.25rem}.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{margin-inline-start:var(--granite-spacing-xs);margin-inline-end:var(--granite-spacing-xs);margin-block-end:var(--granite-spacing-xs)}.granite-menu.granite-device-output-touch .header-container{position:sticky;top:0;background-color:var(--granite-color-background-variant);z-index:1}.granite-menu.granite-device-output-touch .footer-container{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;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{margin-inline-start:var(--granite-spacing-xs);margin-inline-end:var(--granite-spacing-xs);margin-block-end:var(--granite-spacing-xs)}\n"], components: [{ type: GraniteMenuTouchTitleItemComponent, selector: "[graniteMenuTouchTitleItem]", exportAs: ["graniteMenuTouchTitleItem"] }, { type: GraniteMenuTouchCloseComponent, selector: "[graniteMenuTouchCloseItem]", exportAs: ["graniteMenuTouchCloseItem"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i2.AsyncPipe }, animations: [
1234
+ graniteMenuDesktopAnimations.transformMenuDesktop,
1235
+ graniteMenuTouchAnimations.transformMenuTouch,
1236
+ graniteMenuTouchAnimations.transformCloseButton,
1237
+ ], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1238
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuComponent, decorators: [{
1239
+ type: Component,
1240
+ args: [{ selector: 'granite-menu', changeDetection: ChangeDetectionStrategy.OnPush, exportAs: 'graniteMenu', animations: [
1241
+ graniteMenuDesktopAnimations.transformMenuDesktop,
1242
+ graniteMenuTouchAnimations.transformMenuTouch,
1243
+ graniteMenuTouchAnimations.transformCloseButton,
1244
+ ], providers: [
1245
+ { provide: GRANITE_MENU_PANEL, useExisting: GraniteMenuComponent },
1246
+ ], 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;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;user-select:none;filter:drop-shadow(var(--granite-shadow-l));border-radius:.25rem}.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{margin-inline-start:var(--granite-spacing-xs);margin-inline-end:var(--granite-spacing-xs);margin-block-end:var(--granite-spacing-xs)}.granite-menu.granite-device-output-touch .header-container{position:sticky;top:0;background-color:var(--granite-color-background-variant);z-index:1}.granite-menu.granite-device-output-touch .footer-container{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;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{margin-inline-start:var(--granite-spacing-xs);margin-inline-end:var(--granite-spacing-xs);margin-block-end:var(--granite-spacing-xs)}\n"] }]
1247
+ }] });
1248
+
1249
+ /**
1250
+ * Injection token used to provide components knowledge of what device types
1251
+ * are being used for input.
1252
+ */
1253
+ const GRANITE_CLIENT_INPUT = new InjectionToken('GRANITE_CLIENT_INPUT');
1254
+ /**
1255
+ * Injection token used to provide components knowledge of what device type
1256
+ * is being used for output.
1257
+ */
1258
+ const GRANITE_CLIENT_OUTPUT = new InjectionToken('GRANITE_CLIENT_OUTPUT');
1259
+ const deviceDesktop = {
1260
+ input: { devices: ['mouse', 'keyboard'] },
1261
+ output: { device: 'desktop' },
1262
+ };
1263
+ const deviceTouch = {
1264
+ input: { devices: ['touch', 'onscreen-keyboard'] },
1265
+ output: { device: 'touch' },
1266
+ };
1267
+
1268
+ /** Options for binding a passive event listener. */
1269
+ const passiveEventListenerOptions = normalizePassiveListenerOptions({
1270
+ passive: true,
1271
+ });
1272
+ //#endregion --- Touch device customizations ---
1273
+ /**
1274
+ * Directive used to turn a button element into a (popup) menu trigger
1275
+ *
1276
+ * Stripped-down version of Angular Material's menu trigger directive (.../menu/menu-trigger.ts)
1277
+ */
1278
+ class GraniteMenuTriggerForDirective {
1279
+ constructor(_overlay, _element, _viewContainerRef,
1280
+ /** If this is a _submenu_ trigger, it will have a parent menu */
1281
+ _parentMenu,
1282
+ //#region --- Touch device customizations ---
1283
+ /** Client input device information */
1284
+ _clientInput,
1285
+ /** Client output device information */
1286
+ _clientOutput,
1287
+ //#endregion --- Touch device customizations ---
1288
+ /**
1289
+ * If this is a _submenu_ trigger, there should be a corresponding menu
1290
+ * item directive present as well:
1291
+ *
1292
+ * <button graniteMenuItem [graniteMenuTriggerFor]="...">
1293
+ * ^-- This one
1294
+ */
1295
+ _menuItemInstance, _dir, _focusMonitor,
1296
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1297
+ document) {
1298
+ this._overlay = _overlay;
1299
+ this._element = _element;
1300
+ this._viewContainerRef = _viewContainerRef;
1301
+ this._parentMenu = _parentMenu;
1302
+ this._clientInput = _clientInput;
1303
+ this._clientOutput = _clientOutput;
1304
+ this._menuItemInstance = _menuItemInstance;
1305
+ this._dir = _dir;
1306
+ this._focusMonitor = _focusMonitor;
1307
+ /** Whether the associated menu is open */
1308
+ this._isMenuOpen = false;
1309
+ // Tracking input type is necessary so it's possible to only auto-focus
1310
+ // the first item of the list when the menu is opened via the keyboard
1311
+ this._openedBy = null;
1312
+ this._hoverSubscription = Subscription.EMPTY;
1313
+ this._menuCloseSubscription = Subscription.EMPTY;
1314
+ this._closingActionsSubscription = Subscription.EMPTY;
1315
+ this._portal = null;
1316
+ this._overlayRef = null;
1317
+ this._touchTouchingElement = false;
1318
+ /**
1319
+ * Handles touch start events on the trigger.
1320
+ * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.
1321
+ */
1322
+ this._handleTouchStart = () => {
1323
+ this._openedBy = 'touch';
1324
+ };
1325
+ // ----------------------------------------- //
1326
+ // --- Here be poor man's touch gestures --- //
1327
+ // ----------------------------------------- //
1328
+ // TODO: Replace with Hammer or other gesture library
1329
+ /**
1330
+ * Handles touch start events on the overlay host element (wrapper).
1331
+ * Needs to be an arrow function so we can easily use addEventListener and removeEventListener.
1332
+ */
1333
+ this._handleOverlayTouchStart = (event) => {
1334
+ if (this.menu._isAnimating) {
1335
+ return;
1336
+ }
1337
+ this._touchStartTime = new Date().getTime();
1338
+ this._touchStartX = event.changedTouches[0].clientX;
1339
+ this._touchStartY = event.changedTouches[0].clientY;
1340
+ this._touchCurrentX = this._touchStartX;
1341
+ this._touchCurrentY = this._touchStartY;
1342
+ this._touchTranslateX = 0;
1343
+ this._touchMaxX =
1344
+ this._overlayRef.hostElement.getBoundingClientRect().width;
1345
+ this._touchLockedX = null;
1346
+ this._touchTouchingElement = true;
1347
+ };
1348
+ this._handleOverlayTouchMove = (event) => {
1349
+ if (!this._touchTouchingElement || this.menu._isAnimating) {
1350
+ return;
1351
+ }
1352
+ if (this._touchLockedX) {
1353
+ return;
1354
+ }
1355
+ this._touchCurrentX = event.changedTouches[0].clientX;
1356
+ this._touchCurrentY = event.changedTouches[0].clientY;
1357
+ // Lock X-axis pan if initiating pan on Y-axis
1358
+ if (this._touchLockedX === null) {
1359
+ const dy = Math.abs(this._touchCurrentY - this._touchStartY);
1360
+ const dx = Math.abs(this._touchCurrentX - this._touchStartX);
1361
+ if (dx > 10 || dy > 10) {
1362
+ this._touchLockedX = dy > dx;
1363
+ return;
1364
+ }
1365
+ }
1366
+ // Restrict to right pan/swipe and make menu movement extremely slow when
1367
+ // moved past allowed limits.
1368
+ const menuMargin = 16;
1369
+ this._touchTranslateX = this._touchCurrentX - this._touchStartX;
1370
+ if (this._touchTranslateX < 0) {
1371
+ this._touchTranslateX = this.easeOutExpo(this._touchTranslateX, 0, -menuMargin / 2, this._touchMaxX * -4);
1372
+ }
1373
+ else if (!this._parentMenu) {
1374
+ this._touchTranslateX = this.easeOutExpo(this._touchTranslateX, 0, menuMargin / 2, this._touchMaxX * 4);
1375
+ }
1376
+ else if (this._touchTranslateX > this._touchMaxX) {
1377
+ this._touchTranslateX = this.easeOutExpo(this._touchTranslateX - this._touchMaxX, this._touchMaxX, menuMargin / 2, this._touchMaxX * 4);
1378
+ }
1379
+ // Set new sub menu position and tell any parent to follow;
1380
+ this.animateSetMenuPosition(this._touchTranslateX);
1381
+ };
1382
+ this._handleOverlayTouchEnd = () => {
1383
+ if (!this._touchTouchingElement || this.menu._isAnimating) {
1384
+ return;
1385
+ }
1386
+ this._touchTranslateX = this._touchCurrentX - this._touchStartX;
1387
+ if (this._touchTranslateX === 0) {
1388
+ return;
1389
+ }
1390
+ this._touchTouchingElement = false;
1391
+ this._touchTimeTaken = new Date().getTime() - this._touchStartTime;
1392
+ const swipeMinDistance = 10;
1393
+ const swipeMinTime = 50;
1394
+ const swipeMaxTime = 300;
1395
+ const pannedHalfwayRight = this._touchTranslateX > this._touchMaxX / 2;
1396
+ const swipedRight = this._touchTranslateX > this._touchMaxX / swipeMinDistance &&
1397
+ this._touchTimeTaken > swipeMinTime &&
1398
+ this._touchTimeTaken < swipeMaxTime;
1399
+ if (!!this._parentMenu && (swipedRight || pannedHalfwayRight)) {
1400
+ // Close submenu keydown-style: close only this menu and leave parents open
1401
+ this.menu.closed.emit('keydown');
1402
+ }
1403
+ else {
1404
+ // Pan ended but the menu was not moved far enough. Reset menus to
1405
+ // where they were before panning stared.
1406
+ this.animateOpenMenu();
1407
+ }
1408
+ };
1409
+ _element.nativeElement.addEventListener('touchstart', this._handleTouchStart, passiveEventListenerOptions);
1410
+ if (_menuItemInstance) {
1411
+ _menuItemInstance._triggersSubmenu = this.triggersSubmenu();
1412
+ }
1413
+ this._document = document;
1414
+ }
1415
+ ngOnChanges(changes) {
1416
+ if (changes.menu) {
1417
+ this._handleMenuChange();
1418
+ }
1419
+ }
1420
+ ngAfterContentInit() {
1421
+ // removed checkMenu here to avoid errors in dynamically genarated menus
1422
+ // menu is checked when opening the menu
1423
+ // this._checkMenu();
1424
+ this._handleHover();
1425
+ }
1426
+ ngOnDestroy() {
1427
+ if (this._overlayRef) {
1428
+ //#region --- Touch device customizations ---
1429
+ this.removeOverlayListeners();
1430
+ //#endregion --- Touch device customizations ---
1431
+ this._overlayRef.dispose();
1432
+ this._overlayRef = null;
1433
+ }
1434
+ this._element.nativeElement.removeEventListener('touchstart', this._handleTouchStart, passiveEventListenerOptions);
1435
+ this._hoverSubscription.unsubscribe();
1436
+ this._menuCloseSubscription.unsubscribe();
1437
+ this._closingActionsSubscription.unsubscribe();
1438
+ }
1439
+ /** Handles change of associated menu */
1440
+ _handleMenuChange() {
1441
+ this._menuCloseSubscription.unsubscribe();
1442
+ // Close the menu overlay when the menu itself says it wants to be closed
1443
+ if (this.menu) {
1444
+ const closed = this.menu.closed;
1445
+ this._menuCloseSubscription = closed.subscribe((reason) => {
1446
+ //#region --- Touch device customizations ---
1447
+ if (this.menu._isClosing) {
1448
+ return;
1449
+ }
1450
+ this.menu._isClosing = true;
1451
+ // Get rid of the menu and tell any parent to restore its position
1452
+ if (this._clientOutput.device === 'touch') {
1453
+ // First we wait for any running animation to complete
1454
+ const runningAnimationDone = this.menu._isAnimating
1455
+ ? this.menu._animationDone
1456
+ : of([null]);
1457
+ runningAnimationDone
1458
+ .pipe(take(1), delay(0, asapScheduler))
1459
+ // eslint-disable-next-line rxjs/no-nested-subscribe
1460
+ .subscribe(() => {
1461
+ this.animateCloseMenu(reason !== 'keydown', reason === 'click');
1462
+ this.menu._animationDone
1463
+ .pipe(take(1), delay(0, asapScheduler))
1464
+ // eslint-disable-next-line rxjs/no-nested-subscribe
1465
+ .subscribe(() => this._destroyMenu());
1466
+ });
1467
+ }
1468
+ else {
1469
+ //#endregion --- Touch device customizations ---
1470
+ this._destroyMenu();
1471
+ }
1472
+ // If a click closed the menu, we should close the entire chain of nested menus.
1473
+ if ((reason === 'click' || reason === 'tab') && this._parentMenu) {
1474
+ this._parentMenu.closed.emit(reason);
1475
+ }
1476
+ });
1477
+ }
1478
+ }
1479
+ isOpen() {
1480
+ return this._isMenuOpen;
1481
+ }
1482
+ /** Open the associated menu */
1483
+ openMenu() {
1484
+ if (this._isMenuOpen) {
1485
+ return;
1486
+ }
1487
+ this._checkMenu();
1488
+ this.menu.parentMenu = this.triggersSubmenu()
1489
+ ? this._parentMenu
1490
+ : undefined;
1491
+ this.menu.direction = this._dir.value === 'rtl' ? 'rtl' : 'ltr';
1492
+ if (this._parentMenu) {
1493
+ // Menu triggers inherit target device types from their parent.
1494
+ // Ultimately it is the root trigger that determines device types for
1495
+ // the whole menu hierarchy.
1496
+ this._clientInput = this._parentMenu._clientInput;
1497
+ this._clientOutput = this._parentMenu._clientOutput;
1498
+ }
1499
+ //#region --- Touch device customizations ---
1500
+ // Make the menu we're about to open use the same devices as the trigger
1501
+ this.menu._setDevice(this._clientInput, this._clientOutput);
1502
+ if (this._clientOutput.device === 'touch') {
1503
+ this.menu.showBackButton = !!this._parentMenu;
1504
+ this.menu._updateShowTitle();
1505
+ if (!this.menu.closeLabel) {
1506
+ this.menu.closeLabel = this._parentMenu?.closeLabel;
1507
+ }
1508
+ this.menu.showCloseButton = !!this.menu.closeLabel;
1509
+ }
1510
+ this.menu._isClosing = false;
1511
+ const panelClass = [];
1512
+ if (this._clientOutput.device === 'touch') {
1513
+ panelClass.push('granite-overlay-pane-fill-width-bottom');
1514
+ }
1515
+ const scrollStrategy = this._clientOutput.device !== 'touch'
1516
+ ? this._overlay.scrollStrategies.reposition()
1517
+ : undefined;
1518
+ const hasBackdrop = this._clientOutput.device === 'touch' && !this.triggersSubmenu();
1519
+ //#endregion --- Touch device customizations ---
1520
+ // Create an overlay to stuff the menu (portal) into below
1521
+ if (!this._overlayRef) {
1522
+ const config = new OverlayConfig({
1523
+ positionStrategy: this._positionStrategy(),
1524
+ backdropClass: 'granite-overlay-dark-glass-backdrop',
1525
+ scrollStrategy,
1526
+ direction: this._dir,
1527
+ panelClass,
1528
+ hasBackdrop,
1529
+ });
1530
+ this._overlayRef = this._overlay.create(config);
1531
+ //#region --- Touch device customizations ---
1532
+ // Add touch listener for submenu back pan/swipe
1533
+ if (this._clientOutput.device === 'touch') {
1534
+ this.addOverlayListeners();
1535
+ }
1536
+ //#endregion --- Touch device customizations ---
1537
+ }
1538
+ else {
1539
+ // Reset animation state for reused overlays
1540
+ if (this._clientOutput.device === 'touch') {
1541
+ this.menu._panelAnimationState = 'void';
1542
+ }
1543
+ }
1544
+ // Create portal from associated menu's template
1545
+ if (!this._portal || this._portal.templateRef !== this.menu.templateRef) {
1546
+ this._portal = new TemplatePortal(this.menu.templateRef, this._viewContainerRef);
1547
+ }
1548
+ // Attach menu portal to overlay ref (which is a portal outlet)
1549
+ this._overlayRef.attach(this._portal);
1550
+ // Subscribe to stream that emits whenever an action that should close the menu occurs
1551
+ this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this.closeMenu());
1552
+ this.animateOpenMenu();
1553
+ this._setIsMenuOpen(true);
1554
+ this.menu.focusFirstItem(this._openedBy || 'program');
1555
+ }
1556
+ /** Whether the menu triggers a sub-menu or a top-level one. */
1557
+ triggersSubmenu() {
1558
+ return !!(this._menuItemInstance && this._parentMenu);
1559
+ }
1560
+ /** Toggles the menu between the open and closed states. */
1561
+ toggleMenu() {
1562
+ if (this._isMenuOpen) {
1563
+ this.closeMenu();
1564
+ }
1565
+ else {
1566
+ this.openMenu();
1567
+ }
1568
+ }
1569
+ /** Close the associated menu */
1570
+ closeMenu() {
1571
+ this.menu.closed.emit();
1572
+ }
1573
+ /**
1574
+ * Focuses the menu trigger.
1575
+ * @param origin Source of the menu trigger's focus.
1576
+ */
1577
+ focus(origin = 'program', options) {
1578
+ if (this._focusMonitor) {
1579
+ this._focusMonitor.focusVia(this._element, origin, options);
1580
+ }
1581
+ else {
1582
+ this._element.nativeElement.focus(options);
1583
+ }
1584
+ }
1585
+ /** Detach menu portal from overlay and update open state */
1586
+ _destroyMenu() {
1587
+ if (!this._overlayRef || !this._isMenuOpen) {
1588
+ return;
1589
+ }
1590
+ this._closingActionsSubscription.unsubscribe();
1591
+ this._overlayRef.detach();
1592
+ this._restoreFocus();
1593
+ this.menu._resetAnimation();
1594
+ this._setIsMenuOpen(false);
1595
+ }
1596
+ /** Handles mouse presses on the trigger. */
1597
+ _handleMousedown(event) {
1598
+ if (!isFakeMousedownFromScreenReader(event)) {
1599
+ if (this._openedBy !== 'touch') {
1600
+ // Since right or middle button clicks won't trigger the `click` event,
1601
+ // we shouldn't consider the menu as opened by mouse in those cases.
1602
+ this._openedBy = event.button === 0 ? 'mouse' : null;
1603
+ }
1604
+ // Since clicking on the trigger won't close the menu if it opens a sub-menu,
1605
+ // we should prevent focus from moving onto it via click to avoid the
1606
+ // highlight from lingering on the menu item.
1607
+ if (this.triggersSubmenu() && !this._toggleOnSubmenuClick()) {
1608
+ event.preventDefault();
1609
+ }
1610
+ }
1611
+ }
1612
+ /** Handles key presses on the trigger. */
1613
+ _handleKeydown(event) {
1614
+ const key = event.key;
1615
+ if (this.triggersSubmenu() &&
1616
+ ((key === 'ArrowRight' && this._dir.value === 'ltr') ||
1617
+ (key === 'ArrowLeft' && this._dir.value === 'rtl'))) {
1618
+ this.openMenu();
1619
+ }
1620
+ }
1621
+ /** Handles click events on the trigger. */
1622
+ _handleClick(event) {
1623
+ if (this.triggersSubmenu()) {
1624
+ // Stop event propagation to avoid closing the parent menu.
1625
+ event.stopPropagation();
1626
+ this._toggleOnSubmenuClick() ? this.toggleMenu() : this.openMenu();
1627
+ }
1628
+ else {
1629
+ this.toggleMenu();
1630
+ }
1631
+ }
1632
+ /** Handles the cases where the user hovers over the trigger. */
1633
+ _handleHover() {
1634
+ // Subscribe to changes in the hovered item in order to toggle the panel.
1635
+ if (!this.triggersSubmenu() || !this._parentMenu) {
1636
+ return;
1637
+ }
1638
+ this._hoverSubscription = this._parentMenu
1639
+ ._hovered()
1640
+ .pipe(filter(() => this._openOnHover()),
1641
+ // Since we might have multiple competing triggers for the same menu (e.g. a sub-menu
1642
+ // with different data and triggers), we have to delay it by a tick to ensure that
1643
+ // it won't be closed immediately after it is opened.
1644
+ filter((active) => active === this._menuItemInstance /*&& !active.disabled*/), delay(0, asapScheduler))
1645
+ .subscribe(() => {
1646
+ this._openedBy = 'mouse';
1647
+ // If the same menu is used between multiple triggers, it might still be animating
1648
+ // while the new trigger tries to re-open it. Wait for the animation to finish
1649
+ // before doing so. Also interrupt if the user moves to another item.
1650
+ if (this.menu instanceof _MenuBaseComponent && this.menu._isAnimating) {
1651
+ // We need the `delay(0)` here in order to avoid
1652
+ // 'changed after checked' errors in some cases. See Angular Material #12194.
1653
+ this.menu._animationDone
1654
+ .pipe(take(1), delay(0, asapScheduler), takeUntil(this._parentMenu._hovered()))
1655
+ // eslint-disable-next-line rxjs/no-nested-subscribe
1656
+ .subscribe(() => this.openMenu());
1657
+ }
1658
+ else {
1659
+ this.openMenu();
1660
+ }
1661
+ });
1662
+ }
1663
+ /**
1664
+ * Restores focus to the element that was focused before the menu was open.
1665
+ * Could be the root trigger button or a submenu trigger item
1666
+ */
1667
+ _restoreFocus() {
1668
+ // We should reset focus if the user is navigating using a keyboard or
1669
+ // if we have a top-level trigger which might cause focus to be lost
1670
+ // when clicking outside of the menu.
1671
+ if (!this._openedBy) {
1672
+ // Note that the focus style will show up both for `program` and
1673
+ // `keyboard` so we don't have to specify which one it is.
1674
+ this.focus();
1675
+ }
1676
+ else if (!this.triggersSubmenu()) {
1677
+ this.focus(this._openedBy);
1678
+ }
1679
+ this._openedBy = null;
1680
+ }
1681
+ // Set state rather than toggle to support triggers sharing a menu
1682
+ _setIsMenuOpen(isOpen) {
1683
+ this._isMenuOpen = isOpen;
1684
+ if (this.triggersSubmenu()) {
1685
+ this._menuItemInstance._highlighted =
1686
+ isOpen && this._clientOutput.device !== 'touch';
1687
+ }
1688
+ }
1689
+ /**
1690
+ * This method checks that a valid instance of MenuComponent has been passed into
1691
+ * graniteMenuTriggerFor. If not, an exception is thrown.
1692
+ */
1693
+ _checkMenu() {
1694
+ if (!this.menu) {
1695
+ throwGraniteMenuMissingError();
1696
+ }
1697
+ }
1698
+ /**
1699
+ * Returns strategy for positioning the overlay for desktop devices:
1700
+ * Place adjacent to the trigger button (preferably immediately below)
1701
+ * in order to show as much of the menu as possible.
1702
+ */
1703
+ _desktopPositionStrategy() {
1704
+ const positionStrategy = this._overlay
1705
+ .position()
1706
+ .flexibleConnectedTo(this._element)
1707
+ .withLockedPosition()
1708
+ .withTransformOriginOn('.granite-menu')
1709
+ .withPush(false);
1710
+ this._setPosition(positionStrategy);
1711
+ return positionStrategy;
1712
+ }
1713
+ /**
1714
+ * Sets the appropriate positions on a position strategy
1715
+ * so the overlay connects with the trigger correctly.
1716
+ * @param positionStrategy Strategy whose position to update.
1717
+ */
1718
+ _setPosition(positionStrategy) {
1719
+ const MENU_PANEL_TOP_PADDING = 0;
1720
+ let [originX, originFallbackX] = this.menu.xPosition === 'before' ? ['end', 'start'] : ['start', 'end'];
1721
+ const [overlayY, overlayFallbackY] = this.menu.yPosition === 'above' ? ['bottom', 'top'] : ['top', 'bottom'];
1722
+ let [originY, originFallbackY] = [overlayY, overlayFallbackY];
1723
+ let [overlayX, overlayFallbackX] = [originX, originFallbackX];
1724
+ let offsetY = 0;
1725
+ if (this.triggersSubmenu()) {
1726
+ // When the menu is a sub-menu, it should always align itself
1727
+ // to the edges of the trigger, instead of overlapping it.
1728
+ overlayFallbackX = originX =
1729
+ this.menu.xPosition === 'before' ? 'start' : 'end';
1730
+ originFallbackX = overlayX = originX === 'end' ? 'start' : 'end';
1731
+ offsetY =
1732
+ overlayY === 'bottom'
1733
+ ? MENU_PANEL_TOP_PADDING
1734
+ : -MENU_PANEL_TOP_PADDING;
1735
+ }
1736
+ else {
1737
+ originY = overlayY === 'top' ? 'bottom' : 'top';
1738
+ originFallbackY = overlayFallbackY === 'top' ? 'bottom' : 'top';
1739
+ }
1740
+ positionStrategy.withPositions([
1741
+ { originX, originY, overlayX, overlayY, offsetY },
1742
+ {
1743
+ originX: originFallbackX,
1744
+ originY,
1745
+ overlayX: overlayFallbackX,
1746
+ overlayY,
1747
+ offsetY,
1748
+ },
1749
+ {
1750
+ originX,
1751
+ originY: originFallbackY,
1752
+ overlayX,
1753
+ overlayY: overlayFallbackY,
1754
+ offsetY: -offsetY,
1755
+ },
1756
+ {
1757
+ originX: originFallbackX,
1758
+ originY: originFallbackY,
1759
+ overlayX: overlayFallbackX,
1760
+ overlayY: overlayFallbackY,
1761
+ offsetY: -offsetY,
1762
+ },
1763
+ ]);
1764
+ }
1765
+ /** Returns a stream that emits whenever an action that should close the menu occurs. */
1766
+ _menuClosingActions() {
1767
+ const detachments = this._overlayRef?.detachments();
1768
+ const parentClose = this._parentMenu
1769
+ ? this._parentMenu.closed
1770
+ : of();
1771
+ const hover = this._clientOutput.device === 'desktop' && this._parentMenu
1772
+ ? this._parentMenu._hovered().pipe(filter((item) => item !== this._menuItemInstance), filter(() => this._isMenuOpen))
1773
+ : of();
1774
+ // Note: Quick fix. Feature reportedly exists in CDK for Angular 10
1775
+ // Filter to prevent closing when animating added though. Applied to
1776
+ // root menu only.
1777
+ const outsideClick = !this._parentMenu
1778
+ ? fromEvent(this._document, 'click').pipe(filter((e) => e.target !== this._element.nativeElement &&
1779
+ e.target.closest('.granite-menu') === null), filter(() => !this.menu._isAnimating))
1780
+ : of();
1781
+ return merge(detachments, hover, parentClose, outsideClick);
1782
+ }
1783
+ /**
1784
+ * Whether to automatically open submenus on hover. This is true when showing
1785
+ * desktop menus and having mouse support.
1786
+ */
1787
+ _openOnHover() {
1788
+ return ((this.triggersSubmenu()
1789
+ ? this._parentMenu.openOnHover
1790
+ : this.menu.openOnHover) &&
1791
+ this._parentMenu._clientOutput?.device === 'desktop' &&
1792
+ this._parentMenu._clientInput?.devices.includes('mouse'));
1793
+ }
1794
+ /**
1795
+ * Whether to toggle submenus on click. This is true when showing desktop menus
1796
+ * without mouse support. Which, by the way, is not a great idea to begin with.
1797
+ */
1798
+ _toggleOnSubmenuClick() {
1799
+ return (!(this.triggersSubmenu()
1800
+ ? this._parentMenu.openOnHover
1801
+ : this.menu.openOnHover) ||
1802
+ (this._parentMenu._clientOutput?.device === 'desktop' &&
1803
+ !this._parentMenu._clientInput?.devices.includes('mouse')));
1804
+ }
1805
+ // ------------------------------------------- //
1806
+ // --- Here be touch device customizations --- //
1807
+ // ------------------------------------------- //
1808
+ /** Set animation state to bring a newly opened menu into view */
1809
+ animateOpenMenu() {
1810
+ this._clientOutput.device === 'touch'
1811
+ ? this.animateTouchOpenMenu()
1812
+ : this.menu._startAnimation();
1813
+ }
1814
+ animateTouchOpenMenu() {
1815
+ if (this.triggersSubmenu()) {
1816
+ // Slide newly opened sub menu into view from the side,
1817
+ // pushing any parent menu out of view on the other side
1818
+ this.menu._startTouchSubmenuEnterAnimation();
1819
+ this._parentMenu._startTouchHideAnimation();
1820
+ }
1821
+ else {
1822
+ // Slide root menu into view from below
1823
+ this.menu._startTouchRootEnterAnimation();
1824
+ }
1825
+ }
1826
+ /** Set animation state to close the active menu */
1827
+ animateCloseMenu(toBelow, withDelay) {
1828
+ this._clientOutput.device === 'touch'
1829
+ ? this._animateTouchCloseMenu(toBelow, withDelay)
1830
+ : this._parentMenu._resetAnimation();
1831
+ }
1832
+ _animateTouchCloseMenu(toBelow, withDelay) {
1833
+ if (toBelow) {
1834
+ // Slide menu out of view below the viewport
1835
+ withDelay
1836
+ ? this.menu._startTouchCloseDownAnimationWithDelay()
1837
+ : this.menu._startTouchCloseDownAnimation();
1838
+ }
1839
+ else {
1840
+ // Slide the closed menu out of view to the side
1841
+ // and slide any parent menu back into view
1842
+ this.menu._startTouchCloseSideAnimation();
1843
+ this._parentMenu?._startTouchSubmenuEnterAnimation();
1844
+ }
1845
+ }
1846
+ /**
1847
+ * Set animation state to place the menu and any parent at the given
1848
+ * horizontal position, i.e. following touch pan movement.
1849
+ *
1850
+ * @param xOffset Horizontal offset
1851
+ */
1852
+ animateSetMenuPosition(xOffset) {
1853
+ this.menu._startTouchPanAnimation(xOffset);
1854
+ if (this._parentMenu) {
1855
+ this._parentMenu._startTouchHidePanAnimation(xOffset);
1856
+ }
1857
+ }
1858
+ /**
1859
+ * Returns strategy for positioning the overlay depending on what type of
1860
+ * device the menu is being shown on
1861
+ */
1862
+ _positionStrategy() {
1863
+ return this._clientOutput.device === 'touch'
1864
+ ? this._touchPositionStrategy()
1865
+ : this._desktopPositionStrategy();
1866
+ }
1867
+ /**
1868
+ * Returns strategy for positioning the overlay for touch devices:
1869
+ * Place centered at the bottom of the screen.
1870
+ */
1871
+ _touchPositionStrategy() {
1872
+ return this._overlay.position().global();
1873
+ }
1874
+ /**
1875
+ * Remove touch device pan/swipe listeners from overlay host element
1876
+ */
1877
+ addOverlayListeners() {
1878
+ this._overlayRef.hostElement.addEventListener('touchstart', this._handleOverlayTouchStart, passiveEventListenerOptions);
1879
+ this._overlayRef.hostElement.addEventListener('touchmove', this._handleOverlayTouchMove, passiveEventListenerOptions);
1880
+ this._overlayRef.hostElement.addEventListener('touchend', this._handleOverlayTouchEnd, passiveEventListenerOptions);
1881
+ }
1882
+ /**
1883
+ * Remove touch device pan/swipe listeners from overlay host element
1884
+ */
1885
+ removeOverlayListeners() {
1886
+ this._overlayRef.hostElement.removeEventListener('touchstart', this._handleOverlayTouchStart, passiveEventListenerOptions);
1887
+ this._overlayRef.hostElement.removeEventListener('touchmove', this._handleOverlayTouchMove, passiveEventListenerOptions);
1888
+ this._overlayRef.hostElement.removeEventListener('touchend', this._handleOverlayTouchEnd, passiveEventListenerOptions);
1889
+ }
1890
+ /**
1891
+ * Standard exponential ease out function
1892
+ *
1893
+ * @param current Current value
1894
+ * @param offset Offset value, to which calculated value will be added
1895
+ * @param target The target value
1896
+ * @param end Value to which current value is compared
1897
+ */
1898
+ easeOutExpo(current, offset, target, end) {
1899
+ return current === end
1900
+ ? offset + target
1901
+ : target * (-Math.pow(2, (-10 * current) / end) + 1) + offset;
1902
+ }
1903
+ }
1904
+ GraniteMenuTriggerForDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuTriggerForDirective, deps: [{ token: i1$1.Overlay }, { token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: GRANITE_MENU_PANEL, optional: true }, { token: GRANITE_CLIENT_INPUT, optional: true }, { token: GRANITE_CLIENT_OUTPUT, optional: true }, { token: GraniteMenuItemComponent, optional: true, self: true }, { token: i3.Directionality, optional: true }, { token: i1.FocusMonitor }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
1905
+ GraniteMenuTriggerForDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: GraniteMenuTriggerForDirective, selector: "[graniteMenuTriggerFor]", inputs: { menu: ["graniteMenuTriggerFor", "menu"] }, host: { attributes: { "aria-haspopup": "true" }, listeners: { "mousedown": "_handleMousedown($event)", "keydown": "_handleKeydown($event)", "click": "_handleClick($event)" }, properties: { "attr.aria-expanded": "_isMenuOpen || null", "attr.aria-controls": "_isMenuOpen ? menu.panelId : null" }, classAttribute: "granite-menu-trigger" }, usesOnChanges: true, ngImport: i0 });
1906
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuTriggerForDirective, decorators: [{
1907
+ type: Directive,
1908
+ args: [{
1909
+ selector: `[graniteMenuTriggerFor]`,
1910
+ host: {
1911
+ class: 'granite-menu-trigger',
1912
+ 'aria-haspopup': 'true',
1913
+ '[attr.aria-expanded]': '_isMenuOpen || null',
1914
+ '[attr.aria-controls]': '_isMenuOpen ? menu.panelId : null',
1915
+ '(mousedown)': '_handleMousedown($event)',
1916
+ '(keydown)': '_handleKeydown($event)',
1917
+ '(click)': '_handleClick($event)',
1918
+ },
1919
+ }]
1920
+ }], ctorParameters: function () { return [{ type: i1$1.Overlay }, { type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: _MenuBaseComponent, decorators: [{
1921
+ type: Inject,
1922
+ args: [GRANITE_MENU_PANEL]
1923
+ }, {
1924
+ type: Optional
1925
+ }] }, { type: undefined, decorators: [{
1926
+ type: Inject,
1927
+ args: [GRANITE_CLIENT_INPUT]
1928
+ }, {
1929
+ type: Optional
1930
+ }] }, { type: undefined, decorators: [{
1931
+ type: Inject,
1932
+ args: [GRANITE_CLIENT_OUTPUT]
1933
+ }, {
1934
+ type: Optional
1935
+ }] }, { type: GraniteMenuItemComponent, decorators: [{
1936
+ type: Optional
1937
+ }, {
1938
+ type: Self
1939
+ }] }, { type: i3.Directionality, decorators: [{
1940
+ type: Optional
1941
+ }] }, { type: i1.FocusMonitor }, { type: undefined, decorators: [{
1942
+ type: Inject,
1943
+ args: [DOCUMENT]
1944
+ }] }]; }, propDecorators: { menu: [{
1945
+ type: Input,
1946
+ args: ['graniteMenuTriggerFor']
1947
+ }] } });
1948
+
1949
+ class GraniteDividerDirective {
1950
+ constructor() {
1951
+ this.dividerDirection = 'top';
1952
+ }
1953
+ }
1954
+ GraniteDividerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteDividerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1955
+ GraniteDividerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: GraniteDividerDirective, selector: "[graniteDivider]", inputs: { dividerDirection: "dividerDirection" }, host: { properties: { "class.granite-divider-top": "dividerDirection === \"top\"", "class.granite-divider-bottom": "dividerDirection === \"bottom\"" } }, exportAs: ["graniteDivider"], ngImport: i0 });
1956
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteDividerDirective, decorators: [{
1957
+ type: Directive,
1958
+ args: [{
1959
+ selector: '[graniteDivider]',
1960
+ exportAs: 'graniteDivider',
1961
+ host: {
1962
+ '[class.granite-divider-top]': 'dividerDirection === "top"',
1963
+ '[class.granite-divider-bottom]': 'dividerDirection === "bottom"',
1964
+ },
1965
+ }]
1966
+ }], propDecorators: { dividerDirection: [{
1967
+ type: Input
1968
+ }] } });
1969
+
1970
+ class GraniteIconModule {
1971
+ }
1972
+ GraniteIconModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteIconModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1973
+ GraniteIconModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteIconModule, declarations: [GraniteIconComponent], exports: [GraniteIconComponent] });
1974
+ GraniteIconModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteIconModule });
1975
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteIconModule, decorators: [{
1976
+ type: NgModule,
1977
+ args: [{
1978
+ declarations: [GraniteIconComponent],
1979
+ exports: [GraniteIconComponent],
1980
+ }]
1981
+ }] });
1982
+
1983
+ class GraniteTitleDirective {
1984
+ }
1985
+ GraniteTitleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1986
+ GraniteTitleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: GraniteTitleDirective, selector: "[graniteTitle]", host: { properties: { "class.granite-title": "true" } }, exportAs: ["graniteTitle"], ngImport: i0 });
1987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTitleDirective, decorators: [{
1988
+ type: Directive,
1989
+ args: [{
1990
+ selector: '[graniteTitle]',
1991
+ exportAs: 'graniteTitle',
1992
+ host: {
1993
+ '[class.granite-title]': 'true',
1994
+ },
1995
+ }]
1996
+ }] });
1997
+
1998
+ class GraniteMenuModule {
1999
+ }
2000
+ GraniteMenuModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2001
+ GraniteMenuModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuModule, declarations: [GraniteMenuComponent,
2002
+ GraniteMenuItemComponent,
2003
+ GraniteMenuTriggerForDirective,
2004
+ GraniteMenuTouchCloseComponent,
2005
+ GraniteMenuTouchTitleItemComponent,
2006
+ GraniteDividerDirective,
2007
+ GraniteTitleDirective], imports: [CommonModule, OverlayModule, PortalModule, GraniteIconModule], exports: [GraniteMenuComponent,
2008
+ GraniteMenuItemComponent,
2009
+ GraniteMenuTriggerForDirective,
2010
+ GraniteMenuTouchCloseComponent,
2011
+ GraniteMenuTouchTitleItemComponent,
2012
+ GraniteDividerDirective,
2013
+ GraniteTitleDirective] });
2014
+ GraniteMenuModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuModule, imports: [[CommonModule, OverlayModule, PortalModule, GraniteIconModule]] });
2015
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteMenuModule, decorators: [{
2016
+ type: NgModule,
2017
+ args: [{
2018
+ declarations: [
2019
+ GraniteMenuComponent,
2020
+ GraniteMenuItemComponent,
2021
+ GraniteMenuTriggerForDirective,
2022
+ GraniteMenuTouchCloseComponent,
2023
+ GraniteMenuTouchTitleItemComponent,
2024
+ GraniteDividerDirective,
2025
+ GraniteTitleDirective,
2026
+ ],
2027
+ imports: [CommonModule, OverlayModule, PortalModule, GraniteIconModule],
2028
+ exports: [
2029
+ GraniteMenuComponent,
2030
+ GraniteMenuItemComponent,
2031
+ GraniteMenuTriggerForDirective,
2032
+ GraniteMenuTouchCloseComponent,
2033
+ GraniteMenuTouchTitleItemComponent,
2034
+ GraniteDividerDirective,
2035
+ GraniteTitleDirective,
2036
+ ],
2037
+ }]
2038
+ }] });
2039
+
2040
+ /**
2041
+ * Test harness for menu component
2042
+ *
2043
+ * Stripped-down version of the Angular Material menu test harness (.../menu/menu-harness.ts)
2044
+ * just to get things going.
2045
+ */
2046
+ class GraniteMenuHarness extends ComponentHarness {
2047
+ constructor() {
2048
+ super(...arguments);
2049
+ this._documentRootLocator = this.documentRootLocatorFactory();
2050
+ }
2051
+ /**
2052
+ * Gets a `HarnessPredicate` that can be used to search for a `MenuHarness` that meets
2053
+ * certain criteria.
2054
+ * @param options Options for filtering which menu item instances are considered a match.
2055
+ * @return a `HarnessPredicate` configured with the given options.
2056
+ */
2057
+ static with(options = {}) {
2058
+ return new HarnessPredicate(GraniteMenuHarness, options).addOption('text', options.text,
2059
+ /* @dynamic */ (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
2060
+ }
2061
+ /** Gets the text of the menu trigger */
2062
+ async getText() {
2063
+ return (await this.host()).text();
2064
+ }
2065
+ /** Opens the menu, unless already open */
2066
+ async open() {
2067
+ if (!(await this.isOpen())) {
2068
+ await (await this.host()).click();
2069
+ // This is necessary so that we wait for the opening animation to finish.
2070
+ return this.forceStabilize();
2071
+ }
2072
+ }
2073
+ /** Closes the menu, unless already closed */
2074
+ async close() {
2075
+ await (await this._getMenuPanel())?.sendKeys(TestKey.ESCAPE);
2076
+ // This is necessary so that we wait for the closing animation to finish.
2077
+ return this.forceStabilize();
2078
+ }
2079
+ /** Whether the menu is open */
2080
+ async isOpen() {
2081
+ return !!(await this._getMenuPanel());
2082
+ }
2083
+ /**
2084
+ * Gets a list of `GraniteMenuItemHarness` representing the items in the menu.
2085
+ * @param filters Optionally filters which menu items are included.
2086
+ */
2087
+ async getItems(filters = {}) {
2088
+ const panelId = await this._getPanelId();
2089
+ if (panelId) {
2090
+ return this._documentRootLocator.locatorForAll(GraniteMenuItemHarness.with({ ...filters, ancestor: `#${panelId}` }))();
2091
+ }
2092
+ return [];
2093
+ }
2094
+ /** Gets the menu panel (popup) associated with the menu */
2095
+ async _getMenuPanel() {
2096
+ const panelId = await this._getPanelId();
2097
+ return panelId
2098
+ ? this._documentRootLocator.locatorForOptional(`#${panelId}`)()
2099
+ : null;
2100
+ }
2101
+ /** Gets the id of the menu panel (popup) associated with this menu */
2102
+ async _getPanelId() {
2103
+ const panelId = await (await this.host()).getAttribute('aria-controls');
2104
+ return panelId || null;
2105
+ }
2106
+ }
2107
+ /**
2108
+ * The selector for the host element of a `MenuComponent` instance,
2109
+ * i.e. the button element used to open the menu.
2110
+ */
2111
+ GraniteMenuHarness.hostSelector = '.granite-menu-trigger';
2112
+ class GraniteMenuItemHarness extends ComponentHarness {
2113
+ /**
2114
+ * Gets a `HarnessPredicate` that can be used to search for a `GraniteMenuItemHarness` that meets
2115
+ * certain criteria.
2116
+ * @param options Options for filtering which menu item instances are considered a match.
2117
+ * @return a `HarnessPredicate` configured with the given options.
2118
+ */
2119
+ static with(options = {}) {
2120
+ return new HarnessPredicate(GraniteMenuItemHarness, options).addOption('text', options.text,
2121
+ /* @dynamic */ (harness, text) => HarnessPredicate.stringMatches(harness.getText(), text));
2122
+ }
2123
+ /** Gets the text of the menu item. */
2124
+ async getText() {
2125
+ return (await this.host()).text();
2126
+ }
2127
+ /** Whether this item has a submenu. */
2128
+ async hasSubmenu() {
2129
+ return (await this.host()).matchesSelector(GraniteMenuHarness.hostSelector);
2130
+ }
2131
+ /** Gets the submenu associated with this menu item, or null if none. */
2132
+ async getSubmenu() {
2133
+ if (await this.hasSubmenu()) {
2134
+ return new GraniteMenuHarness(this.locatorFactory);
2135
+ }
2136
+ return null;
2137
+ }
2138
+ /** Clicks the menu item. */
2139
+ async click() {
2140
+ await (await this.host()).click();
2141
+ // This is necessary so that we wait for the opening animation to finish. (i.e. if it opens another menu)
2142
+ return this.forceStabilize();
2143
+ }
2144
+ }
2145
+ /** The selector for the host element of a `MenuItemComponent` instance. */
2146
+ GraniteMenuItemHarness.hostSelector = '.granite-menu-item';
2147
+
2148
+ class GraniteToggleSwitchComponent {
2149
+ constructor(_focusMonitor) {
2150
+ this._focusMonitor = _focusMonitor;
2151
+ this.id = null;
2152
+ this.checked = false;
2153
+ this.disabled = false;
2154
+ this.readonly = false;
2155
+ this.labelPosition = 'after';
2156
+ this.ariaLabel = null;
2157
+ this.ariaLabelledby = null;
2158
+ this.valueChange = new EventEmitter();
2159
+ this.toggleChange = new EventEmitter();
2160
+ this.toggleBlur = new EventEmitter();
2161
+ this._positionBefore = false;
2162
+ this._toggleSwitchDisabled = false;
2163
+ }
2164
+ ngOnChanges(changes) {
2165
+ if (changes.checked) {
2166
+ this.checked = coerceBooleanProperty(changes.checked.currentValue);
2167
+ }
2168
+ if (changes.disabled) {
2169
+ this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
2170
+ }
2171
+ if (changes.readonly) {
2172
+ this.readonly = coerceBooleanProperty(changes.readonly.currentValue);
2173
+ }
2174
+ if (changes.labelPosition != null) {
2175
+ this._positionBefore =
2176
+ changes.labelPosition.currentValue != null &&
2177
+ changes.labelPosition.currentValue === 'before';
2178
+ }
2179
+ if ((changes.disabled || changes.readonly) &&
2180
+ (this.disabled || this.readonly)) {
2181
+ this._toggleSwitchDisabled = true;
2182
+ }
2183
+ }
2184
+ focus(origin = 'program', options) {
2185
+ this._focusMonitor.focusVia(this._getInputElement(), origin, options);
2186
+ }
2187
+ _onBlur() {
2188
+ this.toggleBlur.emit();
2189
+ }
2190
+ _toggleSwitchChange() {
2191
+ this.checked = this._getInputElement().checked;
2192
+ this.valueChange.emit(this.checked);
2193
+ }
2194
+ _toggleSwitchClick() {
2195
+ this.toggleChange.emit();
2196
+ }
2197
+ _getInputElement() {
2198
+ return this._inputElement.nativeElement;
2199
+ }
2200
+ }
2201
+ GraniteToggleSwitchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteToggleSwitchComponent, deps: [{ token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
2202
+ GraniteToggleSwitchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteToggleSwitchComponent, selector: "granite-toggle-switch", inputs: { id: "id", checked: "checked", disabled: "disabled", readonly: "readonly", labelPosition: "labelPosition", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"] }, outputs: { valueChange: "valueChange", toggleChange: "toggleChange", toggleBlur: "toggleBlur" }, host: { properties: { "class.granite-toggle-switch-checked": "checked", "class.granite-toggle-switch-disabled": "disabled", "class.granite-toggle-switch-readonly": "readonly", "class.granite-toggle-switch-label-before": "_positionBefore" }, classAttribute: "granite-toggle-switch" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true }], exportAs: ["graniteToggleSwitch"], usesOnChanges: true, ngImport: i0, template: "<label [attr.for]=\"id\" class=\"granite-toggle-switch-label\">\n <div class=\"granite-toggle-switch-bar\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-toggle-switch-input cdk-visually-hidden\"\n role=\"switch\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_toggleSwitchDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_toggleSwitchClick()\"\n (change)=\"_toggleSwitchChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-toggle-switch-thumb\"></div>\n </div>\n <span class=\"granite-toggle-switch-text\"><ng-content></ng-content></span>\n</label>\n", styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}:host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit;cursor:pointer}:host(.granite-toggle-switch){color:var(--granite-color-text)}:host(.granite-toggle-switch-checked) .granite-toggle-switch-bar{background-color:var(--granite-color-background-active)}:host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{border:.0625rem solid var(--granite-color-background-active)}html[dir=ltr] :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:right}:host-context([dir=ltr]) :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:right}html[dir=rtl] :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:left}:host-context([dir=rtl]) :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:left}:host(.granite-toggle-switch-disabled) .granite-toggle-switch-label{opacity:.6}:host(.granite-toggle-switch-disabled) *{cursor:default}:host(.granite-toggle-switch-readonly) *{cursor:default}:host(.granite-toggle-switch-label-before) .granite-toggle-switch-label{flex-direction:row-reverse}:host(.granite-toggle-switch-label-before) .granite-toggle-switch-text{padding-inline-start:0;padding-inline-end:var(--granite-spacing-s)}.granite-toggle-switch-label{display:flex;align-items:center;width:max-content}.granite-toggle-switch-bar{width:2rem;height:1rem;border-radius:.5rem;background-color:var(--granite-color-background-inactive);transition:background-color .1s linear;position:relative}.granite-toggle-switch-bar:focus-within{box-shadow:0 0 0 .0625rem var(--granite-color-focus)}.granite-toggle-switch-thumb{width:1rem;height:1rem;border-radius:1rem;background-color:var(--granite-color-text-static-light);border:.0625rem solid var(--granite-color-background-inactive);transition:float .1s linear}html[dir=ltr] .granite-toggle-switch-thumb{float:left}:host-context([dir=ltr]) .granite-toggle-switch-thumb{float:left}html[dir=rtl] .granite-toggle-switch-thumb{float:right}:host-context([dir=rtl]) .granite-toggle-switch-thumb{float:right}.granite-toggle-switch-text{padding-inline-start:var(--granite-spacing-s)}.granite-toggle-switch-text:empty{display:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2203
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteToggleSwitchComponent, decorators: [{
2204
+ type: Component,
2205
+ args: [{ selector: 'granite-toggle-switch', exportAs: 'graniteToggleSwitch', host: {
2206
+ class: 'granite-toggle-switch',
2207
+ '[class.granite-toggle-switch-checked]': 'checked',
2208
+ '[class.granite-toggle-switch-disabled]': 'disabled',
2209
+ '[class.granite-toggle-switch-readonly]': 'readonly',
2210
+ '[class.granite-toggle-switch-label-before]': '_positionBefore',
2211
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [attr.for]=\"id\" class=\"granite-toggle-switch-label\">\n <div class=\"granite-toggle-switch-bar\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-toggle-switch-input cdk-visually-hidden\"\n role=\"switch\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_toggleSwitchDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_toggleSwitchClick()\"\n (change)=\"_toggleSwitchChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-toggle-switch-thumb\"></div>\n </div>\n <span class=\"granite-toggle-switch-text\"><ng-content></ng-content></span>\n</label>\n", styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}:host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit;cursor:pointer}:host(.granite-toggle-switch){color:var(--granite-color-text)}:host(.granite-toggle-switch-checked) .granite-toggle-switch-bar{background-color:var(--granite-color-background-active)}:host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{border:.0625rem solid var(--granite-color-background-active)}html[dir=ltr] :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:right}:host-context([dir=ltr]) :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:right}html[dir=rtl] :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:left}:host-context([dir=rtl]) :host(.granite-toggle-switch-checked) .granite-toggle-switch-thumb{float:left}:host(.granite-toggle-switch-disabled) .granite-toggle-switch-label{opacity:.6}:host(.granite-toggle-switch-disabled) *{cursor:default}:host(.granite-toggle-switch-readonly) *{cursor:default}:host(.granite-toggle-switch-label-before) .granite-toggle-switch-label{flex-direction:row-reverse}:host(.granite-toggle-switch-label-before) .granite-toggle-switch-text{padding-inline-start:0;padding-inline-end:var(--granite-spacing-s)}.granite-toggle-switch-label{display:flex;align-items:center;width:max-content}.granite-toggle-switch-bar{width:2rem;height:1rem;border-radius:.5rem;background-color:var(--granite-color-background-inactive);transition:background-color .1s linear;position:relative}.granite-toggle-switch-bar:focus-within{box-shadow:0 0 0 .0625rem var(--granite-color-focus)}.granite-toggle-switch-thumb{width:1rem;height:1rem;border-radius:1rem;background-color:var(--granite-color-text-static-light);border:.0625rem solid var(--granite-color-background-inactive);transition:float .1s linear}html[dir=ltr] .granite-toggle-switch-thumb{float:left}:host-context([dir=ltr]) .granite-toggle-switch-thumb{float:left}html[dir=rtl] .granite-toggle-switch-thumb{float:right}:host-context([dir=rtl]) .granite-toggle-switch-thumb{float:right}.granite-toggle-switch-text{padding-inline-start:var(--granite-spacing-s)}.granite-toggle-switch-text:empty{display:none}\n"] }]
2212
+ }], ctorParameters: function () { return [{ type: i1.FocusMonitor }]; }, propDecorators: { id: [{
2213
+ type: Input
2214
+ }], checked: [{
2215
+ type: Input
2216
+ }], disabled: [{
2217
+ type: Input
2218
+ }], readonly: [{
2219
+ type: Input
2220
+ }], labelPosition: [{
2221
+ type: Input
2222
+ }], ariaLabel: [{
2223
+ type: Input,
2224
+ args: ['aria-label']
2225
+ }], ariaLabelledby: [{
2226
+ type: Input,
2227
+ args: ['aria-labelledby']
2228
+ }], valueChange: [{
2229
+ type: Output
2230
+ }], toggleChange: [{
2231
+ type: Output
2232
+ }], toggleBlur: [{
2233
+ type: Output
2234
+ }], _inputElement: [{
2235
+ type: ViewChild,
2236
+ args: ['input']
2237
+ }] } });
2238
+
2239
+ class GraniteToggleSwitchModule {
2240
+ }
2241
+ GraniteToggleSwitchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteToggleSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2242
+ GraniteToggleSwitchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteToggleSwitchModule, declarations: [GraniteToggleSwitchComponent], exports: [GraniteToggleSwitchComponent] });
2243
+ GraniteToggleSwitchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteToggleSwitchModule });
2244
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteToggleSwitchModule, decorators: [{
2245
+ type: NgModule,
2246
+ args: [{
2247
+ declarations: [GraniteToggleSwitchComponent],
2248
+ exports: [GraniteToggleSwitchComponent],
2249
+ }]
2250
+ }] });
2251
+
2252
+ class GraniteRadioButtonComponent {
2253
+ constructor(_focusMonitor, _radioDispatcher) {
2254
+ this._focusMonitor = _focusMonitor;
2255
+ this._radioDispatcher = _radioDispatcher;
2256
+ this.id = null;
2257
+ this.checked = false;
2258
+ this.required = false;
2259
+ this.disabled = false;
2260
+ this.readonly = false;
2261
+ this.labelPosition = 'after';
2262
+ this.ariaLabel = null;
2263
+ this.ariaLabelledby = null;
2264
+ this.radioChange = new EventEmitter();
2265
+ this.radioBlur = new EventEmitter();
2266
+ this._positionBefore = false;
2267
+ this._radioDisabled = false;
2268
+ this._removeUniqueSelectionListenerFn = _radioDispatcher.listen((id, name) => {
2269
+ if (id !== this.id && name === this.name) {
2270
+ this.checked = false;
2271
+ }
2272
+ });
2273
+ }
2274
+ ngOnChanges(changes) {
2275
+ if (changes.checked) {
2276
+ this.checked = coerceBooleanProperty(changes.checked.currentValue);
2277
+ }
2278
+ if (changes.required) {
2279
+ this.required = coerceBooleanProperty(changes.required.currentValue);
2280
+ }
2281
+ if (changes.readonly) {
2282
+ this.readonly = coerceBooleanProperty(changes.readonly.currentValue);
2283
+ }
2284
+ if (changes.disabled) {
2285
+ this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
2286
+ }
2287
+ if (changes.labelPosition != null) {
2288
+ this._positionBefore =
2289
+ changes.labelPosition.currentValue != null &&
2290
+ changes.labelPosition.currentValue === 'before';
2291
+ }
2292
+ if ((changes.disabled || changes.readonly) &&
2293
+ (this.disabled || this.readonly)) {
2294
+ this._radioDisabled = true;
2295
+ }
2296
+ }
2297
+ ngOnDestroy() {
2298
+ if (this._removeUniqueSelectionListenerFn instanceof Function) {
2299
+ this._removeUniqueSelectionListenerFn();
2300
+ }
2301
+ }
2302
+ // Focuses the radio button.
2303
+ focus(origin = 'program', options) {
2304
+ this._focusMonitor.focusVia(this._getInputElement(), origin, options);
2305
+ }
2306
+ _radioClick(element) {
2307
+ this.radioChange.emit(element?.value);
2308
+ }
2309
+ _radioChange() {
2310
+ this.checked = this._getInputElement().checked;
2311
+ // Notify all radio buttons with the same name to un-check
2312
+ this._radioDispatcher.notify(this.id, this.name);
2313
+ }
2314
+ _onBlur() {
2315
+ this.radioBlur.emit();
2316
+ }
2317
+ _getInputElement() {
2318
+ return this._inputElement.nativeElement;
2319
+ }
2320
+ }
2321
+ GraniteRadioButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioButtonComponent, deps: [{ token: i1.FocusMonitor }, { token: i2$1.UniqueSelectionDispatcher }], target: i0.ɵɵFactoryTarget.Component });
2322
+ GraniteRadioButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteRadioButtonComponent, selector: "granite-radio-button", inputs: { value: "value", id: "id", name: "name", checked: "checked", required: "required", disabled: "disabled", readonly: "readonly", labelPosition: "labelPosition", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"] }, outputs: { radioChange: "radioChange", radioBlur: "radioBlur" }, host: { properties: { "class.granite-radio-button-disabled": "disabled", "class.granite-radio-button-label-before": "_positionBefore", "class.granite-radio-button-checked": "checked", "class.granite-radio-button-readonly": "readonly" }, classAttribute: "granite-radio-button" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true }], exportAs: ["graniteRadioButton"], usesOnChanges: true, ngImport: i0, template: "<label class=\"granite-radio-button-label\">\n <div class=\"granite-radio-button-outer-circle\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-radio-button-input cdk-visually-hidden\"\n type=\"radio\"\n [attr.name]=\"name\"\n [disabled]=\"_radioDisabled\"\n [checked]=\"checked\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-checked]=\"checked.toString()\"\n [value]=\"value\"\n (click)=\"_radioClick($event.target)\"\n (change)=\"_radioChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-radio-button-inner-circle\"></div>\n </div>\n <span class=\"granite-radio-button-text\">\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-label:hover{cursor:pointer}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-label:hover .granite-radio-button-outer-circle{border-color:var(--granite-color-background-active-hover)}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-label:hover .granite-radio-button-inner-circle{background-color:var(--granite-color-background-active-hover)}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle:focus-within{border:.0625rem solid var(--granite-color-focus)}:host(.granite-radio-button-label-before) .granite-radio-button-label{flex-direction:row-reverse}:host(.granite-radio-button-label-before) .granite-radio-button-text{padding-inline-start:0;padding-inline-end:var(--granite-spacing-s)}:host(.granite-radio-button-checked) .granite-radio-button-inner-circle{visibility:visible;animation:growAnimation .1s}:host(.granite-radio-button-checked) .granite-radio-button-outer-circle{border-color:var(--granite-color-background-active)}:host(.granite-radio-button-checked).granite-radio-button-disabled .granite-radio-button-inner-circle{background-color:var(--granite-color-text)}:host(.granite-radio-button-checked).granite-radio-button-disabled .granite-radio-button-outer-circle{border:.0625rem solid var(--granite-color-text);background-color:transparent}:host(.granite-radio-button-checked).granite-radio-button-readonly .granite-radio-button-inner-circle{background-color:var(--granite-color-text)}:host(.granite-radio-button-checked).granite-radio-button-readonly .granite-radio-button-outer-circle{border:.0625rem solid var(--granite-color-text)}.granite-radio-button-text{padding-inline-start:var(--granite-spacing-s);color:var(--granite-color-text)}.granite-radio-button-text:empty{display:none}.granite-radio-button-label{display:flex;align-items:center;width:max-content;margin-inline-end:var(--granite-spacing-xl)}:host(.granite-radio-button-disabled) .granite-radio-button-text{opacity:.6}:host(.granite-radio-button-disabled) .granite-radio-button-outer-circle{opacity:.3;background-color:var(--granite-color-border-soft)}.granite-radio-button-outer-circle{height:1rem;width:1rem;border-radius:50%;box-sizing:border-box;border:.0625rem solid var(--granite-color-border-hard);display:flex;justify-content:center;position:relative;align-items:center}.granite-radio-button-inner-circle{width:.625rem;height:.625rem;visibility:hidden;position:absolute;border-radius:50%;background-color:var(--granite-color-background-active);margin:auto}@keyframes growAnimation{0%{transform:scale(0)}to{transform:scale(1)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2323
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioButtonComponent, decorators: [{
2324
+ type: Component,
2325
+ args: [{ selector: 'granite-radio-button', exportAs: 'graniteRadioButton', host: {
2326
+ class: 'granite-radio-button',
2327
+ '[class.granite-radio-button-disabled]': 'disabled',
2328
+ '[class.granite-radio-button-label-before]': '_positionBefore',
2329
+ '[class.granite-radio-button-checked]': 'checked',
2330
+ '[class.granite-radio-button-readonly]': 'readonly',
2331
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label class=\"granite-radio-button-label\">\n <div class=\"granite-radio-button-outer-circle\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-radio-button-input cdk-visually-hidden\"\n type=\"radio\"\n [attr.name]=\"name\"\n [disabled]=\"_radioDisabled\"\n [checked]=\"checked\"\n [readonly]=\"readonly\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-checked]=\"checked.toString()\"\n [value]=\"value\"\n (click)=\"_radioClick($event.target)\"\n (change)=\"_radioChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-radio-button-inner-circle\"></div>\n </div>\n <span class=\"granite-radio-button-text\">\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-label:hover{cursor:pointer}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-label:hover .granite-radio-button-outer-circle{border-color:var(--granite-color-background-active-hover)}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-label:hover .granite-radio-button-inner-circle{background-color:var(--granite-color-background-active-hover)}:host(.granite-radio-button):not(.granite-radio-button-readonly):not(.granite-radio-button-disabled) .granite-radio-button-outer-circle:focus-within{border:.0625rem solid var(--granite-color-focus)}:host(.granite-radio-button-label-before) .granite-radio-button-label{flex-direction:row-reverse}:host(.granite-radio-button-label-before) .granite-radio-button-text{padding-inline-start:0;padding-inline-end:var(--granite-spacing-s)}:host(.granite-radio-button-checked) .granite-radio-button-inner-circle{visibility:visible;animation:growAnimation .1s}:host(.granite-radio-button-checked) .granite-radio-button-outer-circle{border-color:var(--granite-color-background-active)}:host(.granite-radio-button-checked).granite-radio-button-disabled .granite-radio-button-inner-circle{background-color:var(--granite-color-text)}:host(.granite-radio-button-checked).granite-radio-button-disabled .granite-radio-button-outer-circle{border:.0625rem solid var(--granite-color-text);background-color:transparent}:host(.granite-radio-button-checked).granite-radio-button-readonly .granite-radio-button-inner-circle{background-color:var(--granite-color-text)}:host(.granite-radio-button-checked).granite-radio-button-readonly .granite-radio-button-outer-circle{border:.0625rem solid var(--granite-color-text)}.granite-radio-button-text{padding-inline-start:var(--granite-spacing-s);color:var(--granite-color-text)}.granite-radio-button-text:empty{display:none}.granite-radio-button-label{display:flex;align-items:center;width:max-content;margin-inline-end:var(--granite-spacing-xl)}:host(.granite-radio-button-disabled) .granite-radio-button-text{opacity:.6}:host(.granite-radio-button-disabled) .granite-radio-button-outer-circle{opacity:.3;background-color:var(--granite-color-border-soft)}.granite-radio-button-outer-circle{height:1rem;width:1rem;border-radius:50%;box-sizing:border-box;border:.0625rem solid var(--granite-color-border-hard);display:flex;justify-content:center;position:relative;align-items:center}.granite-radio-button-inner-circle{width:.625rem;height:.625rem;visibility:hidden;position:absolute;border-radius:50%;background-color:var(--granite-color-background-active);margin:auto}@keyframes growAnimation{0%{transform:scale(0)}to{transform:scale(1)}}\n"] }]
2332
+ }], ctorParameters: function () { return [{ type: i1.FocusMonitor }, { type: i2$1.UniqueSelectionDispatcher }]; }, propDecorators: { value: [{
2333
+ type: Input
2334
+ }], id: [{
2335
+ type: Input
2336
+ }], name: [{
2337
+ type: Input
2338
+ }], checked: [{
2339
+ type: Input
2340
+ }], required: [{
2341
+ type: Input
2342
+ }], disabled: [{
2343
+ type: Input
2344
+ }], readonly: [{
2345
+ type: Input
2346
+ }], labelPosition: [{
2347
+ type: Input
2348
+ }], ariaLabel: [{
2349
+ type: Input,
2350
+ args: ['aria-label']
2351
+ }], ariaLabelledby: [{
2352
+ type: Input,
2353
+ args: ['aria-labelledby']
2354
+ }], radioChange: [{
2355
+ type: Output
2356
+ }], radioBlur: [{
2357
+ type: Output
2358
+ }], _inputElement: [{
2359
+ type: ViewChild,
2360
+ args: ['input']
2361
+ }] } });
2362
+
2363
+ class GraniteRadioCheckboxBase {
2364
+ constructor() {
2365
+ this.layout = 'horizontal';
2366
+ this.ariaLabelledby = null;
2367
+ }
2368
+ }
2369
+ GraniteRadioCheckboxBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioCheckboxBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2370
+ GraniteRadioCheckboxBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: GraniteRadioCheckboxBase, inputs: { layout: "layout", ariaLabelledby: ["aria-labelledby", "ariaLabelledby"] }, ngImport: i0 });
2371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioCheckboxBase, decorators: [{
2372
+ type: Directive
2373
+ }], propDecorators: { layout: [{
2374
+ type: Input
2375
+ }], ariaLabelledby: [{
2376
+ type: Input,
2377
+ args: ['aria-labelledby']
2378
+ }] } });
2379
+
2380
+ class GraniteRadioGroupComponent extends GraniteRadioCheckboxBase {
2381
+ }
2382
+ GraniteRadioGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2383
+ GraniteRadioGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteRadioGroupComponent, selector: "granite-radio-group", host: { properties: { "attr.role": "\"radiogroup\"", "attr.aria-labelledby": "ariaLabelledby", "class.granite-radio-checkbox-base-layout-horizontal": "layout === \"horizontal\"" }, classAttribute: "granite-radio-group" }, usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host(.granite-radio-checkbox-base-layout-horizontal){display:flex;align-items:flex-start}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioGroupComponent, decorators: [{
2385
+ type: Component,
2386
+ args: [{ selector: 'granite-radio-group', host: {
2387
+ class: 'granite-radio-group',
2388
+ '[attr.role]': '"radiogroup"',
2389
+ '[attr.aria-labelledby]': 'ariaLabelledby',
2390
+ '[class.granite-radio-checkbox-base-layout-horizontal]': 'layout === "horizontal"',
2391
+ }, template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host(.granite-radio-checkbox-base-layout-horizontal){display:flex;align-items:flex-start}\n"] }]
2392
+ }] });
2393
+
2394
+ class GraniteRadioButtonModule {
2395
+ }
2396
+ GraniteRadioButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2397
+ GraniteRadioButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioButtonModule, declarations: [GraniteRadioButtonComponent, GraniteRadioGroupComponent], exports: [GraniteRadioButtonComponent, GraniteRadioGroupComponent] });
2398
+ GraniteRadioButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioButtonModule });
2399
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteRadioButtonModule, decorators: [{
2400
+ type: NgModule,
2401
+ args: [{
2402
+ declarations: [GraniteRadioButtonComponent, GraniteRadioGroupComponent],
2403
+ exports: [GraniteRadioButtonComponent, GraniteRadioGroupComponent],
2404
+ }]
2405
+ }] });
2406
+
2407
+ class GraniteCheckboxComponent {
2408
+ constructor(_focusMonitor) {
2409
+ this._focusMonitor = _focusMonitor;
2410
+ this.id = null;
2411
+ this.checked = false;
2412
+ this.disabled = false;
2413
+ this.readonly = false;
2414
+ this.labelPosition = 'after';
2415
+ this.ariaLabel = null;
2416
+ this.ariaLabelledby = null;
2417
+ this.valueChange = new EventEmitter();
2418
+ this.checkboxChange = new EventEmitter();
2419
+ this.checkboxBlur = new EventEmitter();
2420
+ this._positionBefore = false;
2421
+ this._checkboxDisabled = false;
2422
+ }
2423
+ ngOnChanges(changes) {
2424
+ if (changes.checked) {
2425
+ this.checked = coerceBooleanProperty(changes.checked.currentValue);
2426
+ }
2427
+ if (changes.disabled) {
2428
+ this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
2429
+ }
2430
+ if (changes.readonly) {
2431
+ this.readonly = coerceBooleanProperty(changes.readonly.currentValue);
2432
+ }
2433
+ if (changes.labelPosition != null) {
2434
+ this._positionBefore =
2435
+ changes.labelPosition.currentValue != null &&
2436
+ changes.labelPosition.currentValue === 'before';
2437
+ }
2438
+ if ((changes.disabled || changes.readonly) &&
2439
+ (this.disabled || this.readonly)) {
2440
+ this._checkboxDisabled = true;
2441
+ }
2442
+ }
2443
+ focus(origin = 'program', options) {
2444
+ this._focusMonitor.focusVia(this._getInputElement(), origin, options);
2445
+ }
2446
+ _onBlur() {
2447
+ this.checkboxBlur.emit();
2448
+ }
2449
+ _checkboxChange() {
2450
+ this.checked = this._getInputElement().checked;
2451
+ this.valueChange.emit(this.checked);
2452
+ }
2453
+ _checkboxClick() {
2454
+ this.checkboxChange.emit();
2455
+ }
2456
+ _getInputElement() {
2457
+ return this._inputElement.nativeElement;
2458
+ }
2459
+ }
2460
+ GraniteCheckboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCheckboxComponent, deps: [{ token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
2461
+ GraniteCheckboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteCheckboxComponent, selector: "granite-checkbox", inputs: { id: "id", checked: "checked", disabled: "disabled", readonly: "readonly", labelPosition: "labelPosition", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"] }, outputs: { valueChange: "valueChange", checkboxChange: "checkboxChange", checkboxBlur: "checkboxBlur" }, host: { properties: { "class.granite-checkbox-checked": "checked", "class.granite-checkbox-disabled": "disabled", "class.granite-checkbox-readonly": "readonly", "class.granite-checkbox-label-before": "_positionBefore" }, classAttribute: "granite-checkbox" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true }], exportAs: ["graniteCheckbox"], usesOnChanges: true, ngImport: i0, template: "<label [attr.for]=\"id\" class=\"granite-checkbox-label\">\n <div class=\"granite-checkbox-box\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-checkbox-input cdk-visually-hidden\"\n role=\"checkbox\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_checkboxDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_checkboxClick()\"\n (change)=\"_checkboxChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-checkbox-check\"></div>\n </div>\n <span class=\"granite-checkbox-text\"><ng-content></ng-content></span>\n</label>\n", styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}:host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit;cursor:pointer}:host(.granite-checkbox){color:var(--granite-color-text)}:host(.granite-checkbox):not(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{border-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{background-color:var(--granite-color-background-active-hover);border-color:var(--granite-color-background-active-hover)}:host(.granite-checkbox-checked) .granite-checkbox-box{border-color:var(--granite-color-background-active);background-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked) .granite-checkbox-box:focus-within{border-color:var(--granite-color-focus)}:host(.granite-checkbox-checked) .granite-checkbox-check{display:flex}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-box{animation:fadeInAnimation .2s;animation-iteration-count:1}:host(:not(.granite-checkbox-checked)) .granite-checkbox-box{animation:fadeOutAnimation .2s;animation-iteration-count:1}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box{background-color:var(--granite-color-text);border-color:var(--granite-color-text)}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box .granite-checkbox-check{border-color:var(--granite-color-background)}:host(.granite-checkbox-disabled) .granite-checkbox-box{opacity:.3;background-color:var(--granite-color-border-soft)}:host(.granite-checkbox-disabled) .granite-checkbox-label{opacity:.6}:host(.granite-checkbox-disabled) *{cursor:default}:host(.granite-checkbox-readonly) *{cursor:default}:host(.granite-checkbox-label-before) .granite-checkbox-label{flex-direction:row-reverse}:host(.granite-checkbox-label-before) .granite-checkbox-text{padding-inline-start:0;padding-inline-end:var(--granite-spacing-s)}.granite-checkbox-label{display:flex;align-items:center;width:max-content;margin-inline-end:var(--granite-spacing-xl)}.granite-checkbox-box{width:1rem;height:1rem;border:solid var(--granite-color-background-inactive);border-width:.0625rem;border-radius:.25rem;display:flex;justify-content:center;position:relative}.granite-checkbox-box:focus-within{border:.0625rem solid var(--granite-color-focus)}.granite-checkbox-check{position:relative;display:none;width:.5625rem;height:.3125rem;background-color:transparent;border:solid var(--granite-color-text-static-light);transform:rotate(-45deg);margin-top:var(--granite-spacing-xs);border-width:0 0 .125rem .125rem}.granite-checkbox-text{padding-inline-start:var(--granite-spacing-s)}.granite-checkbox-text:empty{display:none}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCheckboxComponent, decorators: [{
2463
+ type: Component,
2464
+ args: [{ selector: 'granite-checkbox', exportAs: 'graniteCheckbox', host: {
2465
+ class: 'granite-checkbox',
2466
+ '[class.granite-checkbox-checked]': 'checked',
2467
+ '[class.granite-checkbox-disabled]': 'disabled',
2468
+ '[class.granite-checkbox-readonly]': 'readonly',
2469
+ '[class.granite-checkbox-label-before]': '_positionBefore',
2470
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [attr.for]=\"id\" class=\"granite-checkbox-label\">\n <div class=\"granite-checkbox-box\">\n <input\n #input\n [id]=\"id\"\n class=\"granite-checkbox-input cdk-visually-hidden\"\n role=\"checkbox\"\n type=\"checkbox\"\n [attr.aria-checked]=\"checked.toString()\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [checked]=\"checked\"\n [disabled]=\"_checkboxDisabled\"\n [readonly]=\"readonly\"\n (click)=\"_checkboxClick()\"\n (change)=\"_checkboxChange()\"\n (blur)=\"_onBlur()\"\n />\n <div class=\"granite-checkbox-check\"></div>\n </div>\n <span class=\"granite-checkbox-text\"><ng-content></ng-content></span>\n</label>\n", styles: [".cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}:host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit;cursor:pointer}:host(.granite-checkbox){color:var(--granite-color-text)}:host(.granite-checkbox):not(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{border-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-label:hover .granite-checkbox-box{background-color:var(--granite-color-background-active-hover);border-color:var(--granite-color-background-active-hover)}:host(.granite-checkbox-checked) .granite-checkbox-box{border-color:var(--granite-color-background-active);background-color:var(--granite-color-background-active)}:host(.granite-checkbox-checked) .granite-checkbox-box:focus-within{border-color:var(--granite-color-focus)}:host(.granite-checkbox-checked) .granite-checkbox-check{display:flex}:host(.granite-checkbox-checked):not(.granite-checkbox-readonly):not(.granite-checkbox-disabled) .granite-checkbox-box{animation:fadeInAnimation .2s;animation-iteration-count:1}:host(:not(.granite-checkbox-checked)) .granite-checkbox-box{animation:fadeOutAnimation .2s;animation-iteration-count:1}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box{background-color:var(--granite-color-text);border-color:var(--granite-color-text)}:host(.granite-checkbox-readonly.granite-checkbox-checked) .granite-checkbox-box .granite-checkbox-check{border-color:var(--granite-color-background)}:host(.granite-checkbox-disabled) .granite-checkbox-box{opacity:.3;background-color:var(--granite-color-border-soft)}:host(.granite-checkbox-disabled) .granite-checkbox-label{opacity:.6}:host(.granite-checkbox-disabled) *{cursor:default}:host(.granite-checkbox-readonly) *{cursor:default}:host(.granite-checkbox-label-before) .granite-checkbox-label{flex-direction:row-reverse}:host(.granite-checkbox-label-before) .granite-checkbox-text{padding-inline-start:0;padding-inline-end:var(--granite-spacing-s)}.granite-checkbox-label{display:flex;align-items:center;width:max-content;margin-inline-end:var(--granite-spacing-xl)}.granite-checkbox-box{width:1rem;height:1rem;border:solid var(--granite-color-background-inactive);border-width:.0625rem;border-radius:.25rem;display:flex;justify-content:center;position:relative}.granite-checkbox-box:focus-within{border:.0625rem solid var(--granite-color-focus)}.granite-checkbox-check{position:relative;display:none;width:.5625rem;height:.3125rem;background-color:transparent;border:solid var(--granite-color-text-static-light);transform:rotate(-45deg);margin-top:var(--granite-spacing-xs);border-width:0 0 .125rem .125rem}.granite-checkbox-text{padding-inline-start:var(--granite-spacing-s)}.granite-checkbox-text:empty{display:none}@keyframes fadeInAnimation{0%{opacity:0}to{opacity:1}}@keyframes fadeOutAnimation{0%{opacity:1}to{opacity:0}}\n"] }]
2471
+ }], ctorParameters: function () { return [{ type: i1.FocusMonitor }]; }, propDecorators: { id: [{
2472
+ type: Input
2473
+ }], checked: [{
2474
+ type: Input
2475
+ }], disabled: [{
2476
+ type: Input
2477
+ }], readonly: [{
2478
+ type: Input
2479
+ }], labelPosition: [{
2480
+ type: Input
2481
+ }], ariaLabel: [{
2482
+ type: Input,
2483
+ args: ['aria-label']
2484
+ }], ariaLabelledby: [{
2485
+ type: Input,
2486
+ args: ['aria-labelledby']
2487
+ }], valueChange: [{
2488
+ type: Output
2489
+ }], checkboxChange: [{
2490
+ type: Output
2491
+ }], checkboxBlur: [{
2492
+ type: Output
2493
+ }], _inputElement: [{
2494
+ type: ViewChild,
2495
+ args: ['input']
2496
+ }] } });
2497
+
2498
+ class GraniteCheckboxGroupComponent extends GraniteRadioCheckboxBase {
2499
+ }
2500
+ GraniteCheckboxGroupComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCheckboxGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2501
+ GraniteCheckboxGroupComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteCheckboxGroupComponent, selector: "granite-checkbox-group", host: { properties: { "attr.role": "\"group\"", "attr.aria-labelledby": "ariaLabelledby", "class.granite-radio-checkbox-base-layout-horizontal": "layout === \"horizontal\"" }, classAttribute: "granite-checkbox-group" }, usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host(.granite-radio-checkbox-base-layout-horizontal){display:flex;align-items:flex-start}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCheckboxGroupComponent, decorators: [{
2503
+ type: Component,
2504
+ args: [{ selector: 'granite-checkbox-group', host: {
2505
+ class: 'granite-checkbox-group',
2506
+ '[attr.role]': '"group"',
2507
+ '[attr.aria-labelledby]': 'ariaLabelledby',
2508
+ '[class.granite-radio-checkbox-base-layout-horizontal]': 'layout === "horizontal"',
2509
+ }, template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host(.granite-radio-checkbox-base-layout-horizontal){display:flex;align-items:flex-start}\n"] }]
2510
+ }] });
2511
+
2512
+ class GraniteCheckboxModule {
2513
+ }
2514
+ GraniteCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2515
+ GraniteCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCheckboxModule, declarations: [GraniteCheckboxComponent, GraniteCheckboxGroupComponent], exports: [GraniteCheckboxComponent, GraniteCheckboxGroupComponent] });
2516
+ GraniteCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCheckboxModule });
2517
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCheckboxModule, decorators: [{
2518
+ type: NgModule,
2519
+ args: [{
2520
+ declarations: [GraniteCheckboxComponent, GraniteCheckboxGroupComponent],
2521
+ exports: [GraniteCheckboxComponent, GraniteCheckboxGroupComponent],
2522
+ }]
2523
+ }] });
2524
+
2525
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2526
+ const disabledMixin = (Base = class {
2527
+ }) => {
2528
+ class Derived extends Base {
2529
+ constructor() {
2530
+ super(...arguments);
2531
+ this.disabled = false;
2532
+ }
2533
+ ngOnChanges(changes) {
2534
+ if (changes.disabled) {
2535
+ this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
2536
+ }
2537
+ }
2538
+ }
2539
+ Derived.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: Derived, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2540
+ Derived.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: Derived, inputs: { disabled: "disabled" }, usesInheritance: true, usesOnChanges: true, ngImport: i0 });
2541
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: Derived, decorators: [{
2542
+ type: Directive
2543
+ }], propDecorators: { disabled: [{
2544
+ type: Input
2545
+ }] } });
2546
+ return Derived;
2547
+ };
2548
+
2549
+ var ButtonSelectors;
2550
+ (function (ButtonSelectors) {
2551
+ ButtonSelectors["graniteButton"] = "granite-button";
2552
+ ButtonSelectors["granitePrimaryButton"] = "granite-primary-button";
2553
+ ButtonSelectors["graniteFlatButton"] = "granite-flat-button";
2554
+ ButtonSelectors["graniteToolbarButton"] = "granite-toolbar-button";
2555
+ })(ButtonSelectors || (ButtonSelectors = {}));
2556
+ const ButtonComponentMixin = disabledMixin();
2557
+ class GraniteButtonComponent extends ButtonComponentMixin {
2558
+ constructor(_focusMonitor, _elementRef) {
2559
+ super();
2560
+ this._focusMonitor = _focusMonitor;
2561
+ this._elementRef = _elementRef;
2562
+ this.toggled = false;
2563
+ this._buttonToggled = false;
2564
+ for (const selector of Object.keys(ButtonSelectors)) {
2565
+ if (this._getHostElement().hasAttribute(selector)) {
2566
+ this._getHostElement().classList.add(ButtonSelectors[selector]);
2567
+ }
2568
+ }
2569
+ }
2570
+ ngOnChanges(changes) {
2571
+ super.ngOnChanges(changes);
2572
+ if (changes.toggled &&
2573
+ (this._getHostElement().classList.contains(ButtonSelectors.graniteFlatButton) ||
2574
+ this._getHostElement().classList.contains(ButtonSelectors.graniteToolbarButton))) {
2575
+ this._buttonToggled = coerceBooleanProperty(changes.toggled.currentValue);
2576
+ }
2577
+ }
2578
+ focus(origin = 'program', options) {
2579
+ this._focusMonitor.focusVia(this._getHostElement(), origin, options);
2580
+ }
2581
+ _getHostElement() {
2582
+ return this._elementRef.nativeElement;
2583
+ }
2584
+ }
2585
+ GraniteButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteButtonComponent, deps: [{ token: i1.FocusMonitor }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2586
+ GraniteButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteButtonComponent, selector: "button[graniteButton],\n button[granitePrimaryButton],\n button[graniteFlatButton],\n button[graniteToolbarButton]\n ", inputs: { disabled: "disabled", toggled: "toggled" }, host: { properties: { "class.granite-button-disabled": "disabled", "class.granite-button-toggled": "_buttonToggled", "attr.disabled": "disabled || null" }, classAttribute: "granite-button-base" }, exportAs: ["graniteButton"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit;cursor:pointer}button:host{background-color:inherit;-webkit-appearance:none;appearance:none;outline:none;border:none;font:inherit;border-radius:inherit;height:inherit;font-weight:inherit;line-height:inherit;color:inherit;margin:inherit;cursor:pointer;padding:inherit}a:host{outline:none}:host.granite-button-base{border-radius:.25rem;font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);padding:var(--granite-spacing-s) var(--granite-spacing-s);position:relative;line-height:var(--granite-font-size-body);display:flex;justify-content:center;align-items:center;width:-moz-fit-content;width:fit-content}:host:focus:not(.granite-button-disabled):not(:active){outline-offset:-2px;outline-width:.125rem;outline-color:var(--granite-color-focus);outline-style:solid}button:host.granite-button{background-color:var(--granite-color-background-variant);color:var(--granite-color-text);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}button:host.granite-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-button.granite-button-toggled{background-color:none;color:none;outline:none}button:host.granite-primary-button{background-color:var(--granite-color-background-active);color:var(--granite-color-text-on-active);outline:none;outline-offset:-1px}button:host.granite-primary-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:none;outline:none}button:host.granite-primary-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:none;outline:none}button:host.granite-primary-button.granite-button-toggled{background-color:none;color:none;outline:none}button:host.granite-flat-button{background-color:transparent;color:var(--granite-color-text);outline:none;outline-offset:-1px}button:host.granite-flat-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-flat-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-flat-button.granite-button-toggled{background-color:var(--granite-color-background-selected);color:var(--granite-color-focus);outline:none}button:host.granite-toolbar-button{background-color:var(--granite-color-background);color:var(--granite-color-text);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}button:host.granite-toolbar-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-toolbar-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-toolbar-button.granite-button-toggled{background-color:var(--granite-color-background-selected);color:var(--granite-color-focus);outline:none}button:host.granite-button-disabled,button:host.granite-button-disabled:active,button:host.granite-button-disabled:focus,button:host.granite-button-disabled:hover{opacity:.4;cursor:default}a:host.granite-button{background-color:var(--granite-color-background);color:var(--granite-color-text-link);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}a:host.granite-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}a:host.granite-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}a:host.granite-button.granite-button-toggled{background-color:none;color:none;outline:none}a:host.granite-flat-button{background-color:transparent;color:var(--granite-color-text-link);outline:none;outline-offset:-1px}a:host.granite-flat-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}a:host.granite-flat-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}a:host.granite-flat-button.granite-button-toggled{background-color:none;color:none;outline:none}a:host.granite-button-disabled,a:host.granite-button-disabled:active,a:host.granite-button-disabled:focus,a:host.granite-button-disabled:hover{opacity:.4;text-decoration:none;cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2587
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteButtonComponent, decorators: [{
2588
+ type: Component,
2589
+ args: [{ selector: `button[graniteButton],
2590
+ button[granitePrimaryButton],
2591
+ button[graniteFlatButton],
2592
+ button[graniteToolbarButton]
2593
+ `, host: {
2594
+ class: 'granite-button-base',
2595
+ '[class.granite-button-disabled]': 'disabled',
2596
+ '[class.granite-button-toggled]': '_buttonToggled',
2597
+ '[attr.disabled]': 'disabled || null',
2598
+ }, exportAs: 'graniteButton', template: '<ng-content></ng-content>', inputs: ['disabled'], changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit;cursor:pointer}button:host{background-color:inherit;-webkit-appearance:none;appearance:none;outline:none;border:none;font:inherit;border-radius:inherit;height:inherit;font-weight:inherit;line-height:inherit;color:inherit;margin:inherit;cursor:pointer;padding:inherit}a:host{outline:none}:host.granite-button-base{border-radius:.25rem;font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);padding:var(--granite-spacing-s) var(--granite-spacing-s);position:relative;line-height:var(--granite-font-size-body);display:flex;justify-content:center;align-items:center;width:-moz-fit-content;width:fit-content}:host:focus:not(.granite-button-disabled):not(:active){outline-offset:-2px;outline-width:.125rem;outline-color:var(--granite-color-focus);outline-style:solid}button:host.granite-button{background-color:var(--granite-color-background-variant);color:var(--granite-color-text);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}button:host.granite-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-button.granite-button-toggled{background-color:none;color:none;outline:none}button:host.granite-primary-button{background-color:var(--granite-color-background-active);color:var(--granite-color-text-on-active);outline:none;outline-offset:-1px}button:host.granite-primary-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:none;outline:none}button:host.granite-primary-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:none;outline:none}button:host.granite-primary-button.granite-button-toggled{background-color:none;color:none;outline:none}button:host.granite-flat-button{background-color:transparent;color:var(--granite-color-text);outline:none;outline-offset:-1px}button:host.granite-flat-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-flat-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-flat-button.granite-button-toggled{background-color:var(--granite-color-background-selected);color:var(--granite-color-focus);outline:none}button:host.granite-toolbar-button{background-color:var(--granite-color-background);color:var(--granite-color-text);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}button:host.granite-toolbar-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-toolbar-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-toolbar-button.granite-button-toggled{background-color:var(--granite-color-background-selected);color:var(--granite-color-focus);outline:none}button:host.granite-button-disabled,button:host.granite-button-disabled:active,button:host.granite-button-disabled:focus,button:host.granite-button-disabled:hover{opacity:.4;cursor:default}a:host.granite-button{background-color:var(--granite-color-background);color:var(--granite-color-text-link);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}a:host.granite-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}a:host.granite-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}a:host.granite-button.granite-button-toggled{background-color:none;color:none;outline:none}a:host.granite-flat-button{background-color:transparent;color:var(--granite-color-text-link);outline:none;outline-offset:-1px}a:host.granite-flat-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}a:host.granite-flat-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}a:host.granite-flat-button.granite-button-toggled{background-color:none;color:none;outline:none}a:host.granite-button-disabled,a:host.granite-button-disabled:active,a:host.granite-button-disabled:focus,a:host.granite-button-disabled:hover{opacity:.4;text-decoration:none;cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }]
2599
+ }], ctorParameters: function () { return [{ type: i1.FocusMonitor }, { type: i0.ElementRef }]; }, propDecorators: { toggled: [{
2600
+ type: Input
2601
+ }] } });
2602
+ class GraniteAnchorComponent extends GraniteButtonComponent {
2603
+ constructor(_focusMonitor, _elementRef) {
2604
+ super(_focusMonitor, _elementRef);
2605
+ this._focusMonitor = _focusMonitor;
2606
+ this._elementRef = _elementRef;
2607
+ }
2608
+ _anchorClick(event) {
2609
+ if (this.disabled) {
2610
+ event.preventDefault();
2611
+ }
2612
+ }
2613
+ ngOnChanges(changes) {
2614
+ super.ngOnChanges(changes);
2615
+ }
2616
+ }
2617
+ GraniteAnchorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteAnchorComponent, deps: [{ token: i1.FocusMonitor }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
2618
+ GraniteAnchorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteAnchorComponent, selector: "a[graniteButton],\n a[graniteFlatButton]", inputs: { disabled: "disabled" }, host: { listeners: { "click": "_anchorClick($event)" }, properties: { "attr.tabindex": "disabled ? -1 : 0", "class.granite-button-disabled": "disabled" }, classAttribute: "granite-button-base" }, exportAs: ["graniteAnchor"], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit;cursor:pointer}button:host{background-color:inherit;-webkit-appearance:none;appearance:none;outline:none;border:none;font:inherit;border-radius:inherit;height:inherit;font-weight:inherit;line-height:inherit;color:inherit;margin:inherit;cursor:pointer;padding:inherit}a:host{outline:none}:host.granite-button-base{border-radius:.25rem;font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);padding:var(--granite-spacing-s) var(--granite-spacing-s);position:relative;line-height:var(--granite-font-size-body);display:flex;justify-content:center;align-items:center;width:-moz-fit-content;width:fit-content}:host:focus:not(.granite-button-disabled):not(:active){outline-offset:-2px;outline-width:.125rem;outline-color:var(--granite-color-focus);outline-style:solid}button:host.granite-button{background-color:var(--granite-color-background-variant);color:var(--granite-color-text);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}button:host.granite-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-button.granite-button-toggled{background-color:none;color:none;outline:none}button:host.granite-primary-button{background-color:var(--granite-color-background-active);color:var(--granite-color-text-on-active);outline:none;outline-offset:-1px}button:host.granite-primary-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:none;outline:none}button:host.granite-primary-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:none;outline:none}button:host.granite-primary-button.granite-button-toggled{background-color:none;color:none;outline:none}button:host.granite-flat-button{background-color:transparent;color:var(--granite-color-text);outline:none;outline-offset:-1px}button:host.granite-flat-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-flat-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-flat-button.granite-button-toggled{background-color:var(--granite-color-background-selected);color:var(--granite-color-focus);outline:none}button:host.granite-toolbar-button{background-color:var(--granite-color-background);color:var(--granite-color-text);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}button:host.granite-toolbar-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-toolbar-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-toolbar-button.granite-button-toggled{background-color:var(--granite-color-background-selected);color:var(--granite-color-focus);outline:none}button:host.granite-button-disabled,button:host.granite-button-disabled:active,button:host.granite-button-disabled:focus,button:host.granite-button-disabled:hover{opacity:.4;cursor:default}a:host.granite-button{background-color:var(--granite-color-background);color:var(--granite-color-text-link);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}a:host.granite-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}a:host.granite-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}a:host.granite-button.granite-button-toggled{background-color:none;color:none;outline:none}a:host.granite-flat-button{background-color:transparent;color:var(--granite-color-text-link);outline:none;outline-offset:-1px}a:host.granite-flat-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}a:host.granite-flat-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}a:host.granite-flat-button.granite-button-toggled{background-color:none;color:none;outline:none}a:host.granite-button-disabled,a:host.granite-button-disabled:active,a:host.granite-button-disabled:focus,a:host.granite-button-disabled:hover{opacity:.4;text-decoration:none;cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2619
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteAnchorComponent, decorators: [{
2620
+ type: Component,
2621
+ args: [{ selector: `a[graniteButton],
2622
+ a[graniteFlatButton]`, host: {
2623
+ class: 'granite-button-base',
2624
+ '[attr.tabindex]': 'disabled ? -1 : 0',
2625
+ '[class.granite-button-disabled]': 'disabled',
2626
+ }, exportAs: 'graniteAnchor', template: '<ng-content></ng-content>', inputs: ['disabled'], changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit;cursor:pointer}button:host{background-color:inherit;-webkit-appearance:none;appearance:none;outline:none;border:none;font:inherit;border-radius:inherit;height:inherit;font-weight:inherit;line-height:inherit;color:inherit;margin:inherit;cursor:pointer;padding:inherit}a:host{outline:none}:host.granite-button-base{border-radius:.25rem;font-size:var(--granite-font-size-body-small);font-weight:var(--granite-font-weight-regular);padding:var(--granite-spacing-s) var(--granite-spacing-s);position:relative;line-height:var(--granite-font-size-body);display:flex;justify-content:center;align-items:center;width:-moz-fit-content;width:fit-content}:host:focus:not(.granite-button-disabled):not(:active){outline-offset:-2px;outline-width:.125rem;outline-color:var(--granite-color-focus);outline-style:solid}button:host.granite-button{background-color:var(--granite-color-background-variant);color:var(--granite-color-text);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}button:host.granite-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-button.granite-button-toggled{background-color:none;color:none;outline:none}button:host.granite-primary-button{background-color:var(--granite-color-background-active);color:var(--granite-color-text-on-active);outline:none;outline-offset:-1px}button:host.granite-primary-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:none;outline:none}button:host.granite-primary-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:none;outline:none}button:host.granite-primary-button.granite-button-toggled{background-color:none;color:none;outline:none}button:host.granite-flat-button{background-color:transparent;color:var(--granite-color-text);outline:none;outline-offset:-1px}button:host.granite-flat-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-flat-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-flat-button.granite-button-toggled{background-color:var(--granite-color-background-selected);color:var(--granite-color-focus);outline:none}button:host.granite-toolbar-button{background-color:var(--granite-color-background);color:var(--granite-color-text);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}button:host.granite-toolbar-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}button:host.granite-toolbar-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}button:host.granite-toolbar-button.granite-button-toggled{background-color:var(--granite-color-background-selected);color:var(--granite-color-focus);outline:none}button:host.granite-button-disabled,button:host.granite-button-disabled:active,button:host.granite-button-disabled:focus,button:host.granite-button-disabled:hover{opacity:.4;cursor:default}a:host.granite-button{background-color:var(--granite-color-background);color:var(--granite-color-text-link);outline:.0625rem solid var(--granite-color-border-soft);outline-offset:-1px}a:host.granite-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}a:host.granite-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}a:host.granite-button.granite-button-toggled{background-color:none;color:none;outline:none}a:host.granite-flat-button{background-color:transparent;color:var(--granite-color-text-link);outline:none;outline-offset:-1px}a:host.granite-flat-button:hover:not(.granite-button-disabled){background-color:var(--granite-color-background-active-hover);color:var(--granite-color-text-on-active);outline:none}a:host.granite-flat-button:active:not(.granite-button-disabled){background-color:var(--granite-color-background-active-pressed);color:var(--granite-color-text-on-active);outline:none}a:host.granite-flat-button.granite-button-toggled{background-color:none;color:none;outline:none}a:host.granite-button-disabled,a:host.granite-button-disabled:active,a:host.granite-button-disabled:focus,a:host.granite-button-disabled:hover{opacity:.4;text-decoration:none;cursor:default;pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }]
2627
+ }], ctorParameters: function () { return [{ type: i1.FocusMonitor }, { type: i0.ElementRef }]; }, propDecorators: { _anchorClick: [{
2628
+ type: HostListener,
2629
+ args: ['click', ['$event']]
2630
+ }] } });
2631
+
2632
+ class GraniteButtonModule {
2633
+ }
2634
+ GraniteButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2635
+ GraniteButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteButtonModule, declarations: [GraniteButtonComponent, GraniteAnchorComponent], exports: [GraniteButtonComponent, GraniteAnchorComponent] });
2636
+ GraniteButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteButtonModule });
2637
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteButtonModule, decorators: [{
2638
+ type: NgModule,
2639
+ args: [{
2640
+ declarations: [GraniteButtonComponent, GraniteAnchorComponent],
2641
+ exports: [GraniteButtonComponent, GraniteAnchorComponent],
2642
+ }]
2643
+ }] });
2644
+
2645
+ class GraniteTableColumnDirective {
2646
+ }
2647
+ GraniteTableColumnDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableColumnDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2648
+ GraniteTableColumnDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: GraniteTableColumnDirective, selector: "granite-table-column", inputs: { name: "name", title: "title", staticType: "staticType" }, queries: [{ propertyName: "tableCellTemplateRef", first: true, predicate: ["graniteTableCellTemplate"], descendants: true }], ngImport: i0 });
2649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableColumnDirective, decorators: [{
2650
+ type: Directive,
2651
+ args: [{
2652
+ // eslint-disable-next-line @angular-eslint/directive-selector
2653
+ selector: 'granite-table-column',
2654
+ }]
2655
+ }], propDecorators: { name: [{
2656
+ type: Input
2657
+ }], title: [{
2658
+ type: Input
2659
+ }], staticType: [{
2660
+ type: Input
2661
+ }], tableCellTemplateRef: [{
2662
+ type: ContentChild,
2663
+ args: ['graniteTableCellTemplate', { static: false }]
2664
+ }] } });
2665
+
2666
+ class TableConstants {
2667
+ }
2668
+ TableConstants.CELL_ID_PREFIX = 'granite-cell';
2669
+
2670
+ class GraniteCell {
2671
+ }
2672
+ GraniteCell.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCell, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2673
+ GraniteCell.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: GraniteCell, inputs: { id: "id", column: "column" }, ngImport: i0 });
2674
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCell, decorators: [{
2675
+ type: Directive
2676
+ }], propDecorators: { id: [{
2677
+ type: Input
2678
+ }], column: [{
2679
+ type: Input
2680
+ }] } });
2681
+
2682
+ class GraniteTableHeaderCellComponent extends GraniteCell {
2683
+ }
2684
+ GraniteTableHeaderCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableHeaderCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2685
+ GraniteTableHeaderCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteTableHeaderCellComponent, selector: "cdk-header-cell[graniteTableHeaderCell]", usesInheritance: true, ngImport: i0, template: "<span class=\"granite-table-header-cell-title\">\n <ng-content></ng-content>\n</span>\n", styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.granite-table-header-cell-title{padding:var(--granite-spacing-s);height:inherit;font-size:var(--granite-font-size-micro);line-height:var(--granite-line-height-flowing);letter-spacing:.015em;font-weight:400;display:flex;justify-content:center;align-items:center;color:var(--granite-color-text-weak)}\n"] });
2686
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableHeaderCellComponent, decorators: [{
2687
+ type: Component,
2688
+ args: [{ selector: 'cdk-header-cell[graniteTableHeaderCell]', template: "<span class=\"granite-table-header-cell-title\">\n <ng-content></ng-content>\n</span>\n", styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.granite-table-header-cell-title{padding:var(--granite-spacing-s);height:inherit;font-size:var(--granite-font-size-micro);line-height:var(--granite-line-height-flowing);letter-spacing:.015em;font-weight:400;display:flex;justify-content:center;align-items:center;color:var(--granite-color-text-weak)}\n"] }]
2689
+ }] });
2690
+
2691
+ class GraniteTableDataCellComponent extends GraniteCell {
2692
+ }
2693
+ GraniteTableDataCellComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableDataCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
2694
+ GraniteTableDataCellComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteTableDataCellComponent, selector: "cdk-cell[graniteTableDataCell]", inputs: { value: "value", staticType: "staticType", rowIndex: "rowIndex", columnIndex: "columnIndex", tableCellTemplateRef: "tableCellTemplateRef", row: "row" }, usesInheritance: true, ngImport: i0, template: "<span class=\"granite-table-data-cell-static-container\">\n <ng-template\n [ngTemplateOutlet]=\"tableCellTemplateRef || defaultTableCellTemplate\"\n [ngTemplateOutletContext]=\"{\n data: value,\n rowIndex: rowIndex,\n columnIndex: columnIndex,\n column: column,\n row: row\n }\"\n ></ng-template>\n</span>\n\n<ng-template #defaultTableCellTemplate>\n <ng-container [ngSwitch]=\"staticType\">\n <ng-container *ngSwitchCase=\"'badge'\">\n <granite-badge>{{ value }}</granite-badge>\n </ng-container>\n <ng-container *ngSwitchDefault>{{ value }}</ng-container>\n </ng-container>\n</ng-template>\n", styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.granite-table-data-cell-static-container{padding:var(--granite-spacing-s);height:inherit;font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);display:flex;justify-content:center;align-items:center;color:var(--granite-color-text)}\n"], components: [{ type: GraniteBadgeComponent, selector: "granite-badge", inputs: ["backgroundColor", "color", "pill"], exportAs: ["graniteBadge"] }], directives: [{ type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i2.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i2.NgSwitchDefault, selector: "[ngSwitchDefault]" }] });
2695
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableDataCellComponent, decorators: [{
2696
+ type: Component,
2697
+ args: [{ selector: 'cdk-cell[graniteTableDataCell]', template: "<span class=\"granite-table-data-cell-static-container\">\n <ng-template\n [ngTemplateOutlet]=\"tableCellTemplateRef || defaultTableCellTemplate\"\n [ngTemplateOutletContext]=\"{\n data: value,\n rowIndex: rowIndex,\n columnIndex: columnIndex,\n column: column,\n row: row\n }\"\n ></ng-template>\n</span>\n\n<ng-template #defaultTableCellTemplate>\n <ng-container [ngSwitch]=\"staticType\">\n <ng-container *ngSwitchCase=\"'badge'\">\n <granite-badge>{{ value }}</granite-badge>\n </ng-container>\n <ng-container *ngSwitchDefault>{{ value }}</ng-container>\n </ng-container>\n</ng-template>\n", styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.granite-table-data-cell-static-container{padding:var(--granite-spacing-s);height:inherit;font-size:var(--granite-font-size-body-small);line-height:var(--granite-line-height-regular);display:flex;justify-content:center;align-items:center;color:var(--granite-color-text)}\n"] }]
2698
+ }], propDecorators: { value: [{
2699
+ type: Input
2700
+ }], staticType: [{
2701
+ type: Input
2702
+ }], rowIndex: [{
2703
+ type: Input
2704
+ }], columnIndex: [{
2705
+ type: Input
2706
+ }], tableCellTemplateRef: [{
2707
+ type: Input
2708
+ }], row: [{
2709
+ type: Input
2710
+ }] } });
2711
+
2712
+ class GraniteTitlePipe {
2713
+ transform(value) {
2714
+ const words = value.split(/(?=[A-Z ])/);
2715
+ return words
2716
+ .map((word) => word.trim())
2717
+ .filter(Boolean)
2718
+ .map((word) => word.charAt(0).toLocaleUpperCase() + word.slice(1))
2719
+ .join(' ');
2720
+ }
2721
+ }
2722
+ GraniteTitlePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTitlePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
2723
+ GraniteTitlePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTitlePipe, name: "graniteTitle" });
2724
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTitlePipe, decorators: [{
2725
+ type: Pipe,
2726
+ args: [{
2727
+ name: 'graniteTitle',
2728
+ }]
2729
+ }] });
2730
+
2731
+ class GraniteTableComponent {
2732
+ constructor() {
2733
+ this.ariaLabel = null;
2734
+ this.cellIdPrefix = TableConstants.CELL_ID_PREFIX;
2735
+ }
2736
+ ngAfterContentInit() {
2737
+ this.columns = this.tableColumnsComponent.toArray();
2738
+ this.renderedColumns = this.columns.map((column) => column.name);
2739
+ }
2740
+ }
2741
+ GraniteTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2742
+ GraniteTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteTableComponent, selector: "granite-table", inputs: { dataSource: "dataSource", trackBy: "trackBy", ariaLabel: ["aria-label", "ariaLabel"] }, queries: [{ propertyName: "tableColumnsComponent", predicate: GraniteTableColumnDirective }], ngImport: i0, template: "<cdk-table\n [dataSource]=\"dataSource\"\n multiTemplateDataRows\n [trackBy]=\"trackBy\"\n [attr.aria-label]=\"ariaLabel\"\n>\n <ng-container\n *ngFor=\"let column of columns; index as columnI\"\n [cdkColumnDef]=\"column.name\"\n >\n <!-- Cell Header -->\n <cdk-header-cell *cdkHeaderCellDef graniteTableHeaderCell>\n {{ (column.title ? column.title : column.name) | graniteTitle }}\n </cdk-header-cell>\n\n <!-- Cell Data -->\n <cdk-cell\n graniteTableDataCell\n *cdkCellDef=\"let row; let rowI = dataIndex\"\n [id]=\"cellIdPrefix + '-' + rowI + '-' + columnI\"\n [value]=\"row[column.name]\"\n [rowIndex]=\"rowI\"\n [columnIndex]=\"columnI\"\n [staticType]=\"column.staticType\"\n [column]=\"column\"\n [tableCellTemplateRef]=\"column.tableCellTemplateRef\"\n [row]=\"row\"\n ></cdk-cell>\n </ng-container>\n\n <cdk-header-row *cdkHeaderRowDef=\"renderedColumns\"></cdk-header-row>\n <cdk-row\n *cdkRowDef=\"let row; let rowI = dataIndex; columns: renderedColumns\"\n [attr.aria-rowindex]=\"rowI + 1\"\n ></cdk-row>\n</cdk-table>\n", styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}cdk-table{display:flex;flex-direction:column;background-color:var(--granite-color-background-variant)}cdk-header-row,cdk-row{display:flex}cdk-header-cell,cdk-cell{flex:1}cdk-header-cell,cdk-cell{height:2.5rem}cdk-cell{border-top:1px solid var(--granite-color-border-soft)}\n"], components: [{ type: i1$2.CdkTable, selector: "cdk-table, table[cdk-table]", inputs: ["trackBy", "dataSource", "multiTemplateDataRows", "fixedLayout"], outputs: ["contentChanged"], exportAs: ["cdkTable"] }, { type: GraniteTableHeaderCellComponent, selector: "cdk-header-cell[graniteTableHeaderCell]" }, { type: GraniteTableDataCellComponent, selector: "cdk-cell[graniteTableDataCell]", inputs: ["value", "staticType", "rowIndex", "columnIndex", "tableCellTemplateRef", "row"] }, { type: i1$2.CdkHeaderRow, selector: "cdk-header-row, tr[cdk-header-row]" }, { type: i1$2.CdkRow, selector: "cdk-row, tr[cdk-row]" }], directives: [{ type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$2.CdkColumnDef, selector: "[cdkColumnDef]", inputs: ["sticky", "cdkColumnDef", "stickyEnd"] }, { type: i1$2.CdkHeaderCellDef, selector: "[cdkHeaderCellDef]" }, { type: i1$2.CdkHeaderCell, selector: "cdk-header-cell, th[cdk-header-cell]" }, { type: i1$2.CdkCellDef, selector: "[cdkCellDef]" }, { type: i1$2.CdkCell, selector: "cdk-cell, td[cdk-cell]" }, { type: i1$2.CdkHeaderRowDef, selector: "[cdkHeaderRowDef]", inputs: ["cdkHeaderRowDef", "cdkHeaderRowDefSticky"] }, { type: i1$2.CdkRowDef, selector: "[cdkRowDef]", inputs: ["cdkRowDefColumns", "cdkRowDefWhen"] }], pipes: { "graniteTitle": GraniteTitlePipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
2743
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableComponent, decorators: [{
2744
+ type: Component,
2745
+ args: [{ selector: 'granite-table', changeDetection: ChangeDetectionStrategy.OnPush, template: "<cdk-table\n [dataSource]=\"dataSource\"\n multiTemplateDataRows\n [trackBy]=\"trackBy\"\n [attr.aria-label]=\"ariaLabel\"\n>\n <ng-container\n *ngFor=\"let column of columns; index as columnI\"\n [cdkColumnDef]=\"column.name\"\n >\n <!-- Cell Header -->\n <cdk-header-cell *cdkHeaderCellDef graniteTableHeaderCell>\n {{ (column.title ? column.title : column.name) | graniteTitle }}\n </cdk-header-cell>\n\n <!-- Cell Data -->\n <cdk-cell\n graniteTableDataCell\n *cdkCellDef=\"let row; let rowI = dataIndex\"\n [id]=\"cellIdPrefix + '-' + rowI + '-' + columnI\"\n [value]=\"row[column.name]\"\n [rowIndex]=\"rowI\"\n [columnIndex]=\"columnI\"\n [staticType]=\"column.staticType\"\n [column]=\"column\"\n [tableCellTemplateRef]=\"column.tableCellTemplateRef\"\n [row]=\"row\"\n ></cdk-cell>\n </ng-container>\n\n <cdk-header-row *cdkHeaderRowDef=\"renderedColumns\"></cdk-header-row>\n <cdk-row\n *cdkRowDef=\"let row; let rowI = dataIndex; columns: renderedColumns\"\n [attr.aria-rowindex]=\"rowI + 1\"\n ></cdk-row>\n</cdk-table>\n", styles: [":host{box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}cdk-table{display:flex;flex-direction:column;background-color:var(--granite-color-background-variant)}cdk-header-row,cdk-row{display:flex}cdk-header-cell,cdk-cell{flex:1}cdk-header-cell,cdk-cell{height:2.5rem}cdk-cell{border-top:1px solid var(--granite-color-border-soft)}\n"] }]
2746
+ }], propDecorators: { dataSource: [{
2747
+ type: Input
2748
+ }], trackBy: [{
2749
+ type: Input
2750
+ }], ariaLabel: [{
2751
+ type: Input,
2752
+ args: ['aria-label']
2753
+ }], tableColumnsComponent: [{
2754
+ type: ContentChildren,
2755
+ args: [GraniteTableColumnDirective]
2756
+ }] } });
2757
+
2758
+ class PurePipesModule {
2759
+ }
2760
+ PurePipesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2761
+ PurePipesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurePipesModule, declarations: [GraniteTitlePipe], exports: [GraniteTitlePipe] });
2762
+ PurePipesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurePipesModule });
2763
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: PurePipesModule, decorators: [{
2764
+ type: NgModule,
2765
+ args: [{
2766
+ exports: [GraniteTitlePipe],
2767
+ declarations: [GraniteTitlePipe],
2768
+ }]
2769
+ }] });
2770
+
2771
+ class GraniteTableModule {
2772
+ }
2773
+ GraniteTableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2774
+ GraniteTableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableModule, declarations: [GraniteTableComponent,
2775
+ GraniteTableDataCellComponent,
2776
+ GraniteTableHeaderCellComponent,
2777
+ GraniteTableColumnDirective], imports: [CommonModule, CdkTableModule, GraniteBadgeModule, PurePipesModule], exports: [GraniteTableComponent, GraniteTableColumnDirective] });
2778
+ GraniteTableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableModule, imports: [[CommonModule, CdkTableModule, GraniteBadgeModule, PurePipesModule]] });
2779
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteTableModule, decorators: [{
2780
+ type: NgModule,
2781
+ args: [{
2782
+ declarations: [
2783
+ GraniteTableComponent,
2784
+ GraniteTableDataCellComponent,
2785
+ GraniteTableHeaderCellComponent,
2786
+ GraniteTableColumnDirective,
2787
+ ],
2788
+ imports: [CommonModule, CdkTableModule, GraniteBadgeModule, PurePipesModule],
2789
+ exports: [GraniteTableComponent, GraniteTableColumnDirective],
2790
+ }]
2791
+ }] });
2792
+
2793
+ const GRANITE_INPUT_INCLUDES = ['text', 'number', 'password', 'textarea'];
2794
+ class GraniteInputFieldComponent {
2795
+ constructor(_focusMonitor) {
2796
+ this._focusMonitor = _focusMonitor;
2797
+ this.id = null;
2798
+ this.name = null;
2799
+ this.type = 'text';
2800
+ this.value = '';
2801
+ this.required = false;
2802
+ this.readonly = false;
2803
+ this.invalid = false;
2804
+ this.disabled = false;
2805
+ this.placeholder = '';
2806
+ this.maxlength = 255;
2807
+ this.countcharacters = false;
2808
+ this.ariaLabel = null;
2809
+ this.ariaLabelledby = null;
2810
+ this.valueChange = new EventEmitter();
2811
+ this._supported = true;
2812
+ this._empty = false;
2813
+ this._passwordFieldIcon = 'view';
2814
+ this._passwordField = false;
2815
+ this._currentCharCount = 0;
2816
+ this._passwordToggled = false;
2817
+ }
2818
+ ngOnInit() {
2819
+ this._validateType();
2820
+ this._passwordField = this.type == 'password';
2821
+ this._empty = this.value == null || this.value === '';
2822
+ }
2823
+ ngOnChanges(changes) {
2824
+ if (changes.required) {
2825
+ this.required = coerceBooleanProperty(changes.required.currentValue);
2826
+ }
2827
+ if (changes.readonly) {
2828
+ this.readonly = coerceBooleanProperty(changes.readonly.currentValue);
2829
+ }
2830
+ if (changes.invalid) {
2831
+ this.invalid = coerceBooleanProperty(changes.invalid.currentValue);
2832
+ }
2833
+ if (changes.disabled) {
2834
+ this.disabled = coerceBooleanProperty(changes.disabled.currentValue);
2835
+ }
2836
+ if (changes.countcharacters) {
2837
+ this.countcharacters = coerceBooleanProperty(changes.countcharacters.currentValue);
2838
+ }
2839
+ if (changes.value) {
2840
+ this._empty = this.value == null || this.value === '';
2841
+ }
2842
+ if (changes.type) {
2843
+ this._validateType();
2844
+ }
2845
+ }
2846
+ focus(origin = 'program', options) {
2847
+ if (this.type === 'text') {
2848
+ this._focusMonitor.focusVia(this._getInputElement(), origin, options);
2849
+ }
2850
+ else if (this.type === 'textarea') {
2851
+ this._focusMonitor.focusVia(this._getTextareaElement(), origin, options);
2852
+ }
2853
+ }
2854
+ _togglePassword() {
2855
+ if (this._passwordToggled) {
2856
+ this._passwordToggled = false;
2857
+ this.type = 'password';
2858
+ this._passwordFieldIcon = 'view';
2859
+ }
2860
+ else {
2861
+ this._passwordToggled = true;
2862
+ this.type = 'text';
2863
+ this._passwordFieldIcon = 'view-disabled';
2864
+ }
2865
+ }
2866
+ _onKeyUp(event) {
2867
+ const inputEvent = event.target;
2868
+ this._applyCharacterCount(inputEvent.value);
2869
+ this._empty = inputEvent.value == null || inputEvent.value === '';
2870
+ this.valueChange.emit(inputEvent.value);
2871
+ }
2872
+ _onInput(event) {
2873
+ const inputEvent = event.target;
2874
+ this._empty = inputEvent.value == null || inputEvent.value === '';
2875
+ this.valueChange.emit(inputEvent.value);
2876
+ }
2877
+ _validateType() {
2878
+ if (GRANITE_INPUT_INCLUDES.indexOf(this.type) < 0) {
2879
+ this._supported = false;
2880
+ throw Error(`Input type "${this.type}" isn't supported by graniteInputField.`);
2881
+ }
2882
+ }
2883
+ _applyCharacterCount(inputString) {
2884
+ if (this.countcharacters) {
2885
+ this._currentCharCount = inputString.length;
2886
+ if (this._currentCharCount > this.maxlength) {
2887
+ inputString = inputString.slice(0, this.maxlength);
2888
+ this._currentCharCount = this.maxlength;
2889
+ }
2890
+ }
2891
+ }
2892
+ _getInputElement() {
2893
+ return this._inputElement.nativeElement;
2894
+ }
2895
+ _getTextareaElement() {
2896
+ return this._textareaElement.nativeElement;
2897
+ }
2898
+ }
2899
+ GraniteInputFieldComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteInputFieldComponent, deps: [{ token: i1.FocusMonitor }], target: i0.ɵɵFactoryTarget.Component });
2900
+ GraniteInputFieldComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: GraniteInputFieldComponent, selector: "granite-input-field", inputs: { id: "id", name: "name", type: "type", value: "value", required: "required", readonly: "readonly", invalid: "invalid", disabled: "disabled", placeholder: "placeholder", prefixicon: "prefixicon", maxlength: "maxlength", countcharacters: "countcharacters", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"] }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "granite-input-field" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true }, { propertyName: "_textareaElement", first: true, predicate: ["textarea"], descendants: true }], exportAs: ["graniteInputField"], usesOnChanges: true, ngImport: i0, template: "<div\n *ngIf=\"_supported\"\n class=\"granite-input-container\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n>\n <div\n class=\"granite-input-top-row\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n >\n <div\n *ngIf=\"prefixicon\"\n class=\"granite-input-prepend\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n >\n <granite-icon class=\"granite-input-prepend-icon\">\n {{ prefixicon }}\n </granite-icon>\n </div>\n\n <ng-container\n *ngIf=\"type !== 'textarea'; then inputElement; else textareaElement\"\n ></ng-container>\n\n <ng-template #inputElement>\n <input\n #input\n [id]=\"id\"\n class=\"granite-input-base\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [attr.maxlength]=\"maxlength\"\n [value]=\"value\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-invalid]=\"invalid\"\n (keyup)=\"_onKeyUp($event)\"\n (input)=\"_onInput($event)\"\n />\n </ng-template>\n\n <button\n *ngIf=\"_passwordField\"\n class=\"granite-input-append\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n (click)=\"_togglePassword()\"\n >\n <granite-icon class=\"granite-input-password-toggle-icon\">\n {{ _passwordFieldIcon }}\n </granite-icon>\n </button>\n\n <ng-template #textareaElement>\n <textarea\n #textarea\n [id]=\"id\"\n class=\"granite-input-base granite-text-area\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n rows=\"1\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [value]=\"value\"\n [attr.maxlength]=\"maxlength\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n (keyup)=\"_onKeyUp($event)\"\n (input)=\"_onInput($event)\"\n ></textarea>\n </ng-template>\n\n <div\n class=\"granite-input-hover-bar\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n ></div>\n </div>\n\n <div *ngIf=\"countcharacters\" class=\"granite-input-bottom-row\">\n <div class=\"granite-input-char-count\">\n {{ _currentCharCount }}/{{ maxlength }}\n </div>\n </div>\n</div>\n", styles: [":host{transition:all .2s ease-out;width:14.5rem;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.granite-input-container{width:inherit;font-size:var(--granite-font-size-body-small)}.granite-input-container .granite-input-top-row{display:inline-flex;width:inherit;position:relative;background:var(--granite-color-background)}.granite-input-container .granite-input-top-row:hover .granite-input-hover-bar{height:.125rem}.granite-input-container .granite-input-top-row:hover .granite-input-hover-bar.granite-input-invalid.granite-input-empty{background-color:var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-text-area{min-width:14.5rem;min-height:2rem}.granite-input-container .granite-input-top-row.granite-input-disabled,.granite-input-container .granite-input-top-row.granite-input-readonly{background-color:transparent;box-shadow:none}.granite-input-container .granite-input-top-row.granite-input-disabled .granite-input-hover-bar,.granite-input-container .granite-input-top-row.granite-input-readonly .granite-input-hover-bar{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base{-webkit-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);padding:var(--granite-spacing-s);width:inherit;color:var(--granite-color-text);font:inherit;font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-regular)}.granite-input-container .granite-input-top-row .granite-input-base:required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-top-row .granite-input-base:required::placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:read-only{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:disabled{opacity:.3}.granite-input-container .granite-input-top-row .granite-input-base::placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base:hover::placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:focus{box-shadow:inset 0 .125rem var(--granite-color-focus),inset .125rem 0 var(--granite-color-focus),inset -.125rem 0 var(--granite-color-focus),inset 0 -.125rem var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus.granite-input-invalid{box-shadow:inset 0 -.125rem var(--granite-color-signal-failure),inset 0 .125rem var(--granite-color-focus),inset .125rem 0 var(--granite-color-focus),inset -.125rem 0 var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus::placeholder{color:transparent}.granite-input-container .granite-input-top-row .granite-input-hover-bar{height:.0625rem;background-color:var(--granite-color-border-hard);position:absolute;width:inherit;bottom:0px}.granite-input-container .granite-input-top-row .granite-input-hover-bar.granite-input-invalid{background-color:var(--granite-color-signal-failure)}.granite-input-container .granite-input-top-row:focus-within .granite-input-hover-bar{background-color:transparent}.granite-input-container .granite-input-prepend{display:flex;align-items:center;padding:0 var(--granite-spacing-s);background:var(--granite-color-background-input)}.granite-input-container .granite-input-prepend .granite-input-prepend-icon{width:1rem;height:1rem;color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-prepend.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-append{-webkit-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);position:relative}.granite-input-container .granite-input-append:focus{box-shadow:inset 0 .125rem var(--granite-color-focus),inset .125rem 0 var(--granite-color-focus),inset -.125rem 0 var(--granite-color-focus),inset 0 -.125rem var(--granite-color-focus)}.granite-input-container .granite-input-append .granite-input-password-toggle-icon{width:max-content;height:max-content;color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-append.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-bottom-row{box-shadow:none}.granite-input-container .granite-input-char-count{background:var(--granite-color-background-warning);border-radius:0 0 .25rem .25rem;padding:var(--granite-spacing-s);background-size:contain;width:-moz-fit-content;width:fit-content;box-shadow:none}.granite-input-container.granite-input-disabled,.granite-input-container.granite-input-readonly{background-color:transparent}\n"], components: [{ type: GraniteIconComponent, selector: "granite-icon", inputs: ["fontIcon"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2901
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteInputFieldComponent, decorators: [{
2902
+ type: Component,
2903
+ args: [{ selector: 'granite-input-field', exportAs: 'graniteInputField', host: {
2904
+ class: 'granite-input-field',
2905
+ }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"_supported\"\n class=\"granite-input-container\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n>\n <div\n class=\"granite-input-top-row\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n [class.granite-input-disabled]=\"disabled\"\n [class.granite-input-readonly]=\"readonly\"\n >\n <div\n *ngIf=\"prefixicon\"\n class=\"granite-input-prepend\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n >\n <granite-icon class=\"granite-input-prepend-icon\">\n {{ prefixicon }}\n </granite-icon>\n </div>\n\n <ng-container\n *ngIf=\"type !== 'textarea'; then inputElement; else textareaElement\"\n ></ng-container>\n\n <ng-template #inputElement>\n <input\n #input\n [id]=\"id\"\n class=\"granite-input-base\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [attr.maxlength]=\"maxlength\"\n [value]=\"value\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-invalid]=\"invalid\"\n (keyup)=\"_onKeyUp($event)\"\n (input)=\"_onInput($event)\"\n />\n </ng-template>\n\n <button\n *ngIf=\"_passwordField\"\n class=\"granite-input-append\"\n [class.granite-input-required]=\"required\"\n [class.granite-input-empty]=\"_empty\"\n (click)=\"_togglePassword()\"\n >\n <granite-icon class=\"granite-input-password-toggle-icon\">\n {{ _passwordFieldIcon }}\n </granite-icon>\n </button>\n\n <ng-template #textareaElement>\n <textarea\n #textarea\n [id]=\"id\"\n class=\"granite-input-base granite-text-area\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n rows=\"1\"\n [name]=\"name\"\n [attr.type]=\"type\"\n [required]=\"required\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [value]=\"value\"\n [attr.maxlength]=\"maxlength\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-required]=\"required\"\n [attr.aria-invalid]=\"invalid\"\n (keyup)=\"_onKeyUp($event)\"\n (input)=\"_onInput($event)\"\n ></textarea>\n </ng-template>\n\n <div\n class=\"granite-input-hover-bar\"\n [class.granite-input-invalid]=\"invalid\"\n [class.granite-input-empty]=\"_empty\"\n ></div>\n </div>\n\n <div *ngIf=\"countcharacters\" class=\"granite-input-bottom-row\">\n <div class=\"granite-input-char-count\">\n {{ _currentCharCount }}/{{ maxlength }}\n </div>\n </div>\n</div>\n", styles: [":host{transition:all .2s ease-out;width:14.5rem;box-sizing:border-box}:host *,:host *:before,:host *:after{box-sizing:inherit}.granite-input-container{width:inherit;font-size:var(--granite-font-size-body-small)}.granite-input-container .granite-input-top-row{display:inline-flex;width:inherit;position:relative;background:var(--granite-color-background)}.granite-input-container .granite-input-top-row:hover .granite-input-hover-bar{height:.125rem}.granite-input-container .granite-input-top-row:hover .granite-input-hover-bar.granite-input-invalid.granite-input-empty{background-color:var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-text-area{min-width:14.5rem;min-height:2rem}.granite-input-container .granite-input-top-row.granite-input-disabled,.granite-input-container .granite-input-top-row.granite-input-readonly{background-color:transparent;box-shadow:none}.granite-input-container .granite-input-top-row.granite-input-disabled .granite-input-hover-bar,.granite-input-container .granite-input-top-row.granite-input-readonly .granite-input-hover-bar{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base{-webkit-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);padding:var(--granite-spacing-s);width:inherit;color:var(--granite-color-text);font:inherit;font-weight:var(--granite-font-weight-regular);line-height:var(--granite-line-height-regular)}.granite-input-container .granite-input-top-row .granite-input-base:required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-top-row .granite-input-base:required::placeholder{color:var(--granite-color-text-weak)}.granite-input-container .granite-input-top-row .granite-input-base:read-only{background-color:transparent}.granite-input-container .granite-input-top-row .granite-input-base:disabled{opacity:.3}.granite-input-container .granite-input-top-row .granite-input-base::placeholder{color:var(--granite-color-text-hint)}.granite-input-container .granite-input-top-row .granite-input-base:hover::placeholder{color:var(--granite-color-text)}.granite-input-container .granite-input-top-row .granite-input-base:focus{box-shadow:inset 0 .125rem var(--granite-color-focus),inset .125rem 0 var(--granite-color-focus),inset -.125rem 0 var(--granite-color-focus),inset 0 -.125rem var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus.granite-input-invalid{box-shadow:inset 0 -.125rem var(--granite-color-signal-failure),inset 0 .125rem var(--granite-color-focus),inset .125rem 0 var(--granite-color-focus),inset -.125rem 0 var(--granite-color-focus)}.granite-input-container .granite-input-top-row .granite-input-base:focus::placeholder{color:transparent}.granite-input-container .granite-input-top-row .granite-input-hover-bar{height:.0625rem;background-color:var(--granite-color-border-hard);position:absolute;width:inherit;bottom:0px}.granite-input-container .granite-input-top-row .granite-input-hover-bar.granite-input-invalid{background-color:var(--granite-color-signal-failure)}.granite-input-container .granite-input-top-row:focus-within .granite-input-hover-bar{background-color:transparent}.granite-input-container .granite-input-prepend{display:flex;align-items:center;padding:0 var(--granite-spacing-s);background:var(--granite-color-background-input)}.granite-input-container .granite-input-prepend .granite-input-prepend-icon{width:1rem;height:1rem;color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-prepend.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-append{-webkit-appearance:none;appearance:none;outline:none;border:none;background-color:var(--granite-color-background-input);position:relative}.granite-input-container .granite-input-append:focus{box-shadow:inset 0 .125rem var(--granite-color-focus),inset .125rem 0 var(--granite-color-focus),inset -.125rem 0 var(--granite-color-focus),inset 0 -.125rem var(--granite-color-focus)}.granite-input-container .granite-input-append .granite-input-password-toggle-icon{width:max-content;height:max-content;color:var(--granite-color-text);box-shadow:none}.granite-input-container .granite-input-append.granite-input-required.granite-input-empty{background-color:var(--granite-color-background-failure)}.granite-input-container .granite-input-bottom-row{box-shadow:none}.granite-input-container .granite-input-char-count{background:var(--granite-color-background-warning);border-radius:0 0 .25rem .25rem;padding:var(--granite-spacing-s);background-size:contain;width:-moz-fit-content;width:fit-content;box-shadow:none}.granite-input-container.granite-input-disabled,.granite-input-container.granite-input-readonly{background-color:transparent}\n"] }]
2906
+ }], ctorParameters: function () { return [{ type: i1.FocusMonitor }]; }, propDecorators: { id: [{
2907
+ type: Input
2908
+ }], name: [{
2909
+ type: Input
2910
+ }], type: [{
2911
+ type: Input
2912
+ }], value: [{
2913
+ type: Input
2914
+ }], required: [{
2915
+ type: Input
2916
+ }], readonly: [{
2917
+ type: Input
2918
+ }], invalid: [{
2919
+ type: Input
2920
+ }], disabled: [{
2921
+ type: Input
2922
+ }], placeholder: [{
2923
+ type: Input
2924
+ }], prefixicon: [{
2925
+ type: Input
2926
+ }], maxlength: [{
2927
+ type: Input
2928
+ }], countcharacters: [{
2929
+ type: Input
2930
+ }], ariaLabel: [{
2931
+ type: Input,
2932
+ args: ['aria-label']
2933
+ }], ariaLabelledby: [{
2934
+ type: Input,
2935
+ args: ['aria-labelledby']
2936
+ }], valueChange: [{
2937
+ type: Output
2938
+ }], _inputElement: [{
2939
+ type: ViewChild,
2940
+ args: ['input']
2941
+ }], _textareaElement: [{
2942
+ type: ViewChild,
2943
+ args: ['textarea']
2944
+ }] } });
2945
+
2946
+ class GraniteInputFieldModule {
2947
+ }
2948
+ GraniteInputFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteInputFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2949
+ GraniteInputFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteInputFieldModule, declarations: [GraniteInputFieldComponent], imports: [CommonModule, GraniteIconModule, GraniteButtonModule], exports: [GraniteInputFieldComponent] });
2950
+ GraniteInputFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteInputFieldModule, imports: [[CommonModule, GraniteIconModule, GraniteButtonModule]] });
2951
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteInputFieldModule, decorators: [{
2952
+ type: NgModule,
2953
+ args: [{
2954
+ imports: [CommonModule, GraniteIconModule, GraniteButtonModule],
2955
+ declarations: [GraniteInputFieldComponent],
2956
+ exports: [GraniteInputFieldComponent],
2957
+ }]
2958
+ }] });
2959
+
2960
+ /**
2961
+ * Directive used to tell components and their sub components that client output
2962
+ * should be adapted for desktop devices like personal computers.
2963
+ */
2964
+ class ClientOutputDesktopDirective {
2965
+ }
2966
+ ClientOutputDesktopDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClientOutputDesktopDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2967
+ ClientOutputDesktopDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ClientOutputDesktopDirective, selector: "[graniteClientOutputDesktop]", providers: [
2968
+ {
2969
+ provide: GRANITE_CLIENT_OUTPUT,
2970
+ useValue: deviceDesktop.output,
2971
+ },
2972
+ ], ngImport: i0 });
2973
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClientOutputDesktopDirective, decorators: [{
2974
+ type: Directive,
2975
+ args: [{
2976
+ selector: `[graniteClientOutputDesktop]`,
2977
+ providers: [
2978
+ {
2979
+ provide: GRANITE_CLIENT_OUTPUT,
2980
+ useValue: deviceDesktop.output,
2981
+ },
2982
+ ],
2983
+ }]
2984
+ }] });
2985
+
2986
+ /**
2987
+ * Directive used to tell components and their sub components that client output
2988
+ * should be adapted for touch devices like mobiles and tablets.
2989
+ */
2990
+ class ClientOutputTouchDirective {
2991
+ }
2992
+ ClientOutputTouchDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClientOutputTouchDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
2993
+ ClientOutputTouchDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ClientOutputTouchDirective, selector: "[graniteClientOutputTouch]", providers: [
2994
+ {
2995
+ provide: GRANITE_CLIENT_OUTPUT,
2996
+ useValue: deviceTouch.output,
2997
+ },
2998
+ ], ngImport: i0 });
2999
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClientOutputTouchDirective, decorators: [{
3000
+ type: Directive,
3001
+ args: [{
3002
+ selector: `[graniteClientOutputTouch]`,
3003
+ providers: [
3004
+ {
3005
+ provide: GRANITE_CLIENT_OUTPUT,
3006
+ useValue: deviceTouch.output,
3007
+ },
3008
+ ],
3009
+ }]
3010
+ }] });
3011
+
3012
+ /**
3013
+ * Directive used to tell components and their sub components that client input
3014
+ * should be adapted for desktop devices, like personal computers.
3015
+ */
3016
+ class ClientInputDesktopDirective {
3017
+ }
3018
+ ClientInputDesktopDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClientInputDesktopDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3019
+ ClientInputDesktopDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ClientInputDesktopDirective, selector: "[graniteClientInputDesktop]", providers: [
3020
+ {
3021
+ provide: GRANITE_CLIENT_INPUT,
3022
+ useValue: deviceDesktop.input,
3023
+ },
3024
+ ], ngImport: i0 });
3025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClientInputDesktopDirective, decorators: [{
3026
+ type: Directive,
3027
+ args: [{
3028
+ selector: `[graniteClientInputDesktop]`,
3029
+ providers: [
3030
+ {
3031
+ provide: GRANITE_CLIENT_INPUT,
3032
+ useValue: deviceDesktop.input,
3033
+ },
3034
+ ],
3035
+ }]
3036
+ }] });
3037
+
3038
+ /**
3039
+ * Directive used to tell components and their sub components that client input
3040
+ * should be adapted for touch devices, like mobiles and tablets.
3041
+ */
3042
+ class ClientInputTouchDirective {
3043
+ }
3044
+ ClientInputTouchDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClientInputTouchDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
3045
+ ClientInputTouchDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: ClientInputTouchDirective, selector: "[graniteClientInputTouch]", providers: [
3046
+ {
3047
+ provide: GRANITE_CLIENT_INPUT,
3048
+ useValue: deviceTouch.input,
3049
+ },
3050
+ ], ngImport: i0 });
3051
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClientInputTouchDirective, decorators: [{
3052
+ type: Directive,
3053
+ args: [{
3054
+ selector: `[graniteClientInputTouch]`,
3055
+ providers: [
3056
+ {
3057
+ provide: GRANITE_CLIENT_INPUT,
3058
+ useValue: deviceTouch.input,
3059
+ },
3060
+ ],
3061
+ }]
3062
+ }] });
3063
+
3064
+ // TODO: Move client devices into a separate module
3065
+ class GraniteCoreModule {
3066
+ }
3067
+ GraniteCoreModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3068
+ GraniteCoreModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCoreModule, declarations: [ClientOutputDesktopDirective,
3069
+ ClientOutputTouchDirective,
3070
+ ClientInputDesktopDirective,
3071
+ ClientInputTouchDirective], exports: [ClientOutputDesktopDirective,
3072
+ ClientOutputTouchDirective,
3073
+ ClientInputDesktopDirective,
3074
+ ClientInputTouchDirective] });
3075
+ GraniteCoreModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCoreModule });
3076
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: GraniteCoreModule, decorators: [{
3077
+ type: NgModule,
3078
+ args: [{
3079
+ declarations: [
3080
+ ClientOutputDesktopDirective,
3081
+ ClientOutputTouchDirective,
3082
+ ClientInputDesktopDirective,
3083
+ ClientInputTouchDirective,
3084
+ ],
3085
+ exports: [
3086
+ ClientOutputDesktopDirective,
3087
+ ClientOutputTouchDirective,
3088
+ ClientInputDesktopDirective,
3089
+ ClientInputTouchDirective,
3090
+ ],
3091
+ }]
3092
+ }] });
3093
+
3094
+ /*
3095
+ * Public API Surface of ui
3096
+ */
3097
+
3098
+ /**
3099
+ * Generated bundle index. Do not edit.
3100
+ */
3101
+
3102
+ export { ButtonSelectors, ClientInputDesktopDirective, ClientInputTouchDirective, ClientOutputDesktopDirective, ClientOutputTouchDirective, GRANITE_CLIENT_INPUT, GRANITE_CLIENT_OUTPUT, GraniteAnchorComponent, GraniteArrangeGridComponent, GraniteArrangeGridItemComponent, GraniteArrangeGridModule, GraniteArrangeGridOrientation, GraniteBadgeComponent, GraniteBadgeHarness, GraniteBadgeModule, GraniteButtonComponent, GraniteButtonModule, GraniteCheckboxComponent, GraniteCheckboxGroupComponent, GraniteCheckboxModule, GraniteCoreModule, GraniteDividerDirective, GraniteGridComponent, GraniteGridItemComponent, GraniteGridModule, GraniteIconComponent, GraniteIconModule, GraniteInputFieldComponent, GraniteInputFieldModule, GraniteMenuComponent, GraniteMenuHarness, GraniteMenuItemComponent, GraniteMenuItemHarness, GraniteMenuModule, GraniteMenuTouchCloseComponent, GraniteMenuTouchTitleItemComponent, GraniteMenuTriggerForDirective, GraniteRadioButtonComponent, GraniteRadioButtonModule, GraniteRadioGroupComponent, GraniteTableColumnDirective, GraniteTableComponent, GraniteTableModule, GraniteTitleDirective, GraniteToggleSwitchComponent, GraniteToggleSwitchModule, deviceDesktop, deviceTouch, disabledMixin, graniteMenuDesktopAnimations, graniteMenuTouchAnimations };
3103
+ //# sourceMappingURL=ifsworld-granite-components.mjs.map