@skyux/core 5.2.3 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/README.md +6 -4
  2. package/bundles/skyux-core-testing.umd.js +6 -6
  3. package/bundles/skyux-core.umd.js +131 -127
  4. package/documentation.json +293 -24
  5. package/esm2015/index.js +60 -0
  6. package/esm2015/index.js.map +1 -0
  7. package/esm2015/lib/modules/adapter-service/adapter.module.js +16 -0
  8. package/esm2015/lib/modules/adapter-service/adapter.module.js.map +1 -0
  9. package/esm2015/lib/modules/adapter-service/adapter.service.js +218 -0
  10. package/esm2015/lib/modules/adapter-service/adapter.service.js.map +1 -0
  11. package/esm2015/lib/modules/adapter-service/focusable-children-options.js +2 -0
  12. package/esm2015/lib/modules/adapter-service/focusable-children-options.js.map +1 -0
  13. package/esm2015/lib/modules/affix/affix-auto-fit-context.js +12 -0
  14. package/esm2015/lib/modules/affix/affix-auto-fit-context.js.map +1 -0
  15. package/esm2015/lib/modules/affix/affix-config.js +2 -0
  16. package/esm2015/lib/modules/affix/affix-config.js.map +1 -0
  17. package/esm2015/lib/modules/affix/affix-horizontal-alignment.js +2 -0
  18. package/esm2015/lib/modules/affix/affix-horizontal-alignment.js.map +1 -0
  19. package/esm2015/lib/modules/affix/affix-offset-change.js +2 -0
  20. package/esm2015/lib/modules/affix/affix-offset-change.js.map +1 -0
  21. package/esm2015/lib/modules/affix/affix-offset.js +2 -0
  22. package/esm2015/lib/modules/affix/affix-offset.js.map +1 -0
  23. package/esm2015/lib/modules/affix/affix-placement-change.js +2 -0
  24. package/esm2015/lib/modules/affix/affix-placement-change.js.map +1 -0
  25. package/esm2015/lib/modules/affix/affix-placement.js +2 -0
  26. package/esm2015/lib/modules/affix/affix-placement.js.map +1 -0
  27. package/esm2015/lib/modules/affix/affix-utils.js +18 -0
  28. package/esm2015/lib/modules/affix/affix-utils.js.map +1 -0
  29. package/esm2015/lib/modules/affix/affix-vertical-alignment.js +2 -0
  30. package/esm2015/lib/modules/affix/affix-vertical-alignment.js.map +1 -0
  31. package/esm2015/lib/modules/affix/affix.directive.js +100 -0
  32. package/esm2015/lib/modules/affix/affix.directive.js.map +1 -0
  33. package/esm2015/lib/modules/affix/affix.module.js +18 -0
  34. package/esm2015/lib/modules/affix/affix.module.js.map +1 -0
  35. package/esm2015/lib/modules/affix/affix.service.js +24 -0
  36. package/esm2015/lib/modules/affix/affix.service.js.map +1 -0
  37. package/esm2015/lib/modules/affix/affixer.js +349 -0
  38. package/esm2015/lib/modules/affix/affixer.js.map +1 -0
  39. package/esm2015/lib/modules/affix/dom-utils.js +77 -0
  40. package/esm2015/lib/modules/affix/dom-utils.js.map +1 -0
  41. package/esm2015/lib/modules/dock/dock-dom-adapter.service.js +80 -0
  42. package/esm2015/lib/modules/dock/dock-dom-adapter.service.js.map +1 -0
  43. package/esm2015/lib/modules/dock/dock-insert-component-config.js +2 -0
  44. package/esm2015/lib/modules/dock/dock-insert-component-config.js.map +1 -0
  45. package/esm2015/lib/modules/dock/dock-item-config.js +2 -0
  46. package/esm2015/lib/modules/dock/dock-item-config.js.map +1 -0
  47. package/esm2015/lib/modules/dock/dock-item-reference.js +2 -0
  48. package/esm2015/lib/modules/dock/dock-item-reference.js.map +1 -0
  49. package/esm2015/lib/modules/dock/dock-item.js +29 -0
  50. package/esm2015/lib/modules/dock/dock-item.js.map +1 -0
  51. package/esm2015/lib/modules/dock/dock-location.js +19 -0
  52. package/esm2015/lib/modules/dock/dock-location.js.map +1 -0
  53. package/esm2015/lib/modules/dock/dock-options.js +2 -0
  54. package/esm2015/lib/modules/dock/dock-options.js.map +1 -0
  55. package/esm2015/lib/modules/dock/dock.component.js +95 -0
  56. package/esm2015/lib/modules/dock/dock.component.js.map +1 -0
  57. package/esm2015/lib/modules/dock/dock.module.js +20 -0
  58. package/esm2015/lib/modules/dock/dock.module.js.map +1 -0
  59. package/esm2015/lib/modules/dock/dock.service.js +92 -0
  60. package/esm2015/lib/modules/dock/dock.service.js.map +1 -0
  61. package/esm2015/lib/modules/dock/sort-by-stack-order.js +13 -0
  62. package/esm2015/lib/modules/dock/sort-by-stack-order.js.map +1 -0
  63. package/esm2015/lib/modules/dynamic-component/dynamic-component-location.js +27 -0
  64. package/esm2015/lib/modules/dynamic-component/dynamic-component-location.js.map +1 -0
  65. package/esm2015/lib/modules/dynamic-component/dynamic-component-options.js +2 -0
  66. package/esm2015/lib/modules/dynamic-component/dynamic-component-options.js.map +1 -0
  67. package/esm2015/lib/modules/dynamic-component/dynamic-component.module.js +17 -0
  68. package/esm2015/lib/modules/dynamic-component/dynamic-component.module.js.map +1 -0
  69. package/esm2015/lib/modules/dynamic-component/dynamic-component.service.js +83 -0
  70. package/esm2015/lib/modules/dynamic-component/dynamic-component.service.js.map +1 -0
  71. package/esm2015/lib/modules/format/app-format.js +18 -0
  72. package/esm2015/lib/modules/format/app-format.js.map +1 -0
  73. package/esm2015/lib/modules/id/id.directive.js +34 -0
  74. package/esm2015/lib/modules/id/id.directive.js.map +1 -0
  75. package/esm2015/lib/modules/id/id.module.js +16 -0
  76. package/esm2015/lib/modules/id/id.module.js.map +1 -0
  77. package/esm2015/lib/modules/log/log.module.js +16 -0
  78. package/esm2015/lib/modules/log/log.module.js.map +1 -0
  79. package/esm2015/lib/modules/log/log.service.js +22 -0
  80. package/esm2015/lib/modules/log/log.service.js.map +1 -0
  81. package/esm2015/lib/modules/media-query/media-breakpoints.js +20 -0
  82. package/esm2015/lib/modules/media-query/media-breakpoints.js.map +1 -0
  83. package/esm2015/lib/modules/media-query/media-query-listener.js +2 -0
  84. package/esm2015/lib/modules/media-query/media-query-listener.js.map +1 -0
  85. package/esm2015/lib/modules/media-query/media-query.module.js +16 -0
  86. package/esm2015/lib/modules/media-query/media-query.module.js.map +1 -0
  87. package/esm2015/lib/modules/media-query/media-query.service.js +121 -0
  88. package/esm2015/lib/modules/media-query/media-query.service.js.map +1 -0
  89. package/esm2015/lib/modules/mutation/mutation-observer-service.js +16 -0
  90. package/esm2015/lib/modules/mutation/mutation-observer-service.js.map +1 -0
  91. package/esm2015/lib/modules/numeric/numeric-symbol.js +2 -0
  92. package/esm2015/lib/modules/numeric/numeric-symbol.js.map +1 -0
  93. package/esm2015/lib/modules/numeric/numeric.module.js +20 -0
  94. package/esm2015/lib/modules/numeric/numeric.module.js.map +1 -0
  95. package/esm2015/lib/modules/numeric/numeric.options.js +41 -0
  96. package/esm2015/lib/modules/numeric/numeric.options.js.map +1 -0
  97. package/esm2015/lib/modules/numeric/numeric.pipe.js +83 -0
  98. package/esm2015/lib/modules/numeric/numeric.pipe.js.map +1 -0
  99. package/esm2015/lib/modules/numeric/numeric.service.js +188 -0
  100. package/esm2015/lib/modules/numeric/numeric.service.js.map +1 -0
  101. package/esm2015/lib/modules/overlay/overlay-adapter.service.js +41 -0
  102. package/esm2015/lib/modules/overlay/overlay-adapter.service.js.map +1 -0
  103. package/esm2015/lib/modules/overlay/overlay-config.js +2 -0
  104. package/esm2015/lib/modules/overlay/overlay-config.js.map +1 -0
  105. package/esm2015/lib/modules/overlay/overlay-context.js +10 -0
  106. package/esm2015/lib/modules/overlay/overlay-context.js.map +1 -0
  107. package/esm2015/lib/modules/overlay/overlay-instance.js +55 -0
  108. package/esm2015/lib/modules/overlay/overlay-instance.js.map +1 -0
  109. package/esm2015/lib/modules/overlay/overlay.component.js +154 -0
  110. package/esm2015/lib/modules/overlay/overlay.component.js.map +1 -0
  111. package/esm2015/lib/modules/overlay/overlay.module.js +18 -0
  112. package/esm2015/lib/modules/overlay/overlay.module.js.map +1 -0
  113. package/esm2015/lib/modules/overlay/overlay.service.js +120 -0
  114. package/esm2015/lib/modules/overlay/overlay.service.js.map +1 -0
  115. package/esm2015/lib/modules/percent-pipe/percent-pipe.module.js +20 -0
  116. package/esm2015/lib/modules/percent-pipe/percent-pipe.module.js.map +1 -0
  117. package/esm2015/lib/modules/percent-pipe/percent.pipe.js +48 -0
  118. package/esm2015/lib/modules/percent-pipe/percent.pipe.js.map +1 -0
  119. package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js +163 -0
  120. package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js.map +1 -0
  121. package/esm2015/lib/modules/shared/number-format/number-format-utility.js +74 -0
  122. package/esm2015/lib/modules/shared/number-format/number-format-utility.js.map +1 -0
  123. package/esm2015/lib/modules/shared/sky-core-resources.module.js +50 -0
  124. package/esm2015/lib/modules/shared/sky-core-resources.module.js.map +1 -0
  125. package/esm2015/lib/modules/title/set-title-args.js +2 -0
  126. package/esm2015/lib/modules/title/set-title-args.js.map +1 -0
  127. package/esm2015/lib/modules/title/title.service.js +31 -0
  128. package/esm2015/lib/modules/title/title.service.js.map +1 -0
  129. package/esm2015/lib/modules/ui-config/ui-config.service.js +21 -0
  130. package/esm2015/lib/modules/ui-config/ui-config.service.js.map +1 -0
  131. package/esm2015/lib/modules/viewkeeper/viewkeeper-boundary-info.js +2 -0
  132. package/esm2015/lib/modules/viewkeeper/viewkeeper-boundary-info.js.map +1 -0
  133. package/esm2015/lib/modules/viewkeeper/viewkeeper-fixed-styles.js +2 -0
  134. package/esm2015/lib/modules/viewkeeper/viewkeeper-fixed-styles.js.map +1 -0
  135. package/esm2015/lib/modules/viewkeeper/viewkeeper-host-options.js +10 -0
  136. package/esm2015/lib/modules/viewkeeper/viewkeeper-host-options.js.map +1 -0
  137. package/esm2015/lib/modules/viewkeeper/viewkeeper-offset.js +2 -0
  138. package/esm2015/lib/modules/viewkeeper/viewkeeper-offset.js.map +1 -0
  139. package/esm2015/lib/modules/viewkeeper/viewkeeper-options.js +2 -0
  140. package/esm2015/lib/modules/viewkeeper/viewkeeper-options.js.map +1 -0
  141. package/esm2015/lib/modules/viewkeeper/viewkeeper.directive.js +116 -0
  142. package/esm2015/lib/modules/viewkeeper/viewkeeper.directive.js.map +1 -0
  143. package/esm2015/lib/modules/viewkeeper/viewkeeper.js +254 -0
  144. package/esm2015/lib/modules/viewkeeper/viewkeeper.js.map +1 -0
  145. package/esm2015/lib/modules/viewkeeper/viewkeeper.module.js +16 -0
  146. package/esm2015/lib/modules/viewkeeper/viewkeeper.module.js.map +1 -0
  147. package/esm2015/lib/modules/viewkeeper/viewkeeper.service.js +39 -0
  148. package/esm2015/lib/modules/viewkeeper/viewkeeper.service.js.map +1 -0
  149. package/esm2015/lib/modules/window/window-ref.js +30 -0
  150. package/esm2015/lib/modules/window/window-ref.js.map +1 -0
  151. package/esm2015/skyux-core.js +2 -2
  152. package/esm2015/skyux-core.js.map +1 -0
  153. package/esm2015/testing/mock-media-query.service.js +4 -4
  154. package/esm2015/testing/mock-media-query.service.js.map +1 -0
  155. package/esm2015/testing/mock-ui-config.service.js +4 -4
  156. package/esm2015/testing/mock-ui-config.service.js.map +1 -0
  157. package/esm2015/testing/public-api.js +1 -1
  158. package/esm2015/testing/public-api.js.map +1 -0
  159. package/esm2015/testing/skyux-core-testing.js +1 -1
  160. package/esm2015/testing/skyux-core-testing.js.map +1 -0
  161. package/fesm2015/skyux-core-testing.js +6 -6
  162. package/fesm2015/skyux-core-testing.js.map +1 -1
  163. package/fesm2015/skyux-core.js +170 -166
  164. package/fesm2015/skyux-core.js.map +1 -1
  165. package/index.d.ts +57 -0
  166. package/{modules → lib/modules}/adapter-service/adapter.module.d.ts +0 -0
  167. package/{modules → lib/modules}/adapter-service/adapter.service.d.ts +0 -0
  168. package/{modules → lib/modules}/adapter-service/focusable-children-options.d.ts +0 -0
  169. package/{modules → lib/modules}/affix/affix-auto-fit-context.d.ts +0 -0
  170. package/{modules → lib/modules}/affix/affix-config.d.ts +0 -0
  171. package/{modules → lib/modules}/affix/affix-horizontal-alignment.d.ts +0 -0
  172. package/{modules → lib/modules}/affix/affix-offset-change.d.ts +0 -0
  173. package/{modules → lib/modules}/affix/affix-offset.d.ts +0 -0
  174. package/{modules → lib/modules}/affix/affix-placement-change.d.ts +0 -0
  175. package/{modules → lib/modules}/affix/affix-placement.d.ts +0 -0
  176. package/{modules → lib/modules}/affix/affix-utils.d.ts +0 -0
  177. package/{modules → lib/modules}/affix/affix-vertical-alignment.d.ts +0 -0
  178. package/{modules → lib/modules}/affix/affix.directive.d.ts +0 -0
  179. package/{modules → lib/modules}/affix/affix.module.d.ts +0 -0
  180. package/{modules → lib/modules}/affix/affix.service.d.ts +0 -0
  181. package/{modules → lib/modules}/affix/affixer.d.ts +0 -0
  182. package/{modules → lib/modules}/affix/dom-utils.d.ts +0 -0
  183. package/{modules → lib/modules}/dock/dock-dom-adapter.service.d.ts +0 -0
  184. package/{modules → lib/modules}/dock/dock-insert-component-config.d.ts +0 -0
  185. package/{modules → lib/modules}/dock/dock-item-config.d.ts +0 -0
  186. package/{modules → lib/modules}/dock/dock-item-reference.d.ts +0 -0
  187. package/{modules → lib/modules}/dock/dock-item.d.ts +0 -0
  188. package/{modules → lib/modules}/dock/dock-location.d.ts +0 -0
  189. package/{modules → lib/modules}/dock/dock-options.d.ts +0 -0
  190. package/{modules → lib/modules}/dock/dock.component.d.ts +0 -0
  191. package/{modules → lib/modules}/dock/dock.module.d.ts +0 -0
  192. package/{modules → lib/modules}/dock/dock.service.d.ts +0 -0
  193. package/{modules → lib/modules}/dock/sort-by-stack-order.d.ts +0 -0
  194. package/{modules → lib/modules}/dynamic-component/dynamic-component-location.d.ts +0 -0
  195. package/{modules → lib/modules}/dynamic-component/dynamic-component-options.d.ts +0 -0
  196. package/{modules → lib/modules}/dynamic-component/dynamic-component.module.d.ts +0 -0
  197. package/{modules → lib/modules}/dynamic-component/dynamic-component.service.d.ts +0 -0
  198. package/{modules → lib/modules}/format/app-format.d.ts +0 -0
  199. package/{modules → lib/modules}/id/id.directive.d.ts +0 -0
  200. package/{modules → lib/modules}/id/id.module.d.ts +0 -0
  201. package/{modules → lib/modules}/log/log.module.d.ts +0 -0
  202. package/{modules → lib/modules}/log/log.service.d.ts +0 -0
  203. package/{modules → lib/modules}/media-query/media-breakpoints.d.ts +0 -0
  204. package/{modules → lib/modules}/media-query/media-query-listener.d.ts +0 -0
  205. package/{modules → lib/modules}/media-query/media-query.module.d.ts +0 -0
  206. package/{modules → lib/modules}/media-query/media-query.service.d.ts +4 -0
  207. package/{modules → lib/modules}/mutation/mutation-observer-service.d.ts +0 -0
  208. package/{modules → lib/modules}/numeric/numeric-symbol.d.ts +0 -0
  209. package/{modules → lib/modules}/numeric/numeric.module.d.ts +0 -0
  210. package/{modules → lib/modules}/numeric/numeric.options.d.ts +2 -2
  211. package/{modules → lib/modules}/numeric/numeric.pipe.d.ts +2 -2
  212. package/{modules → lib/modules}/numeric/numeric.service.d.ts +0 -0
  213. package/{modules → lib/modules}/overlay/overlay-adapter.service.d.ts +0 -0
  214. package/{modules → lib/modules}/overlay/overlay-config.d.ts +0 -0
  215. package/{modules → lib/modules}/overlay/overlay-context.d.ts +0 -0
  216. package/{modules → lib/modules}/overlay/overlay-instance.d.ts +0 -0
  217. package/{modules → lib/modules}/overlay/overlay.component.d.ts +0 -0
  218. package/{modules → lib/modules}/overlay/overlay.module.d.ts +0 -0
  219. package/{modules → lib/modules}/overlay/overlay.service.d.ts +0 -0
  220. package/{modules → lib/modules}/percent-pipe/percent-pipe.module.d.ts +0 -0
  221. package/{modules → lib/modules}/percent-pipe/percent.pipe.d.ts +0 -0
  222. package/{modules → lib/modules}/scrollable-host/scrollable-host.service.d.ts +0 -0
  223. package/{modules → lib/modules}/shared/number-format/number-format-utility.d.ts +0 -0
  224. package/{modules → lib/modules}/shared/sky-core-resources.module.d.ts +0 -0
  225. package/{modules → lib/modules}/title/set-title-args.d.ts +0 -0
  226. package/{modules → lib/modules}/title/title.service.d.ts +0 -0
  227. package/{modules → lib/modules}/ui-config/ui-config.service.d.ts +0 -0
  228. package/{modules → lib/modules}/viewkeeper/viewkeeper-boundary-info.d.ts +0 -0
  229. package/{modules → lib/modules}/viewkeeper/viewkeeper-fixed-styles.d.ts +0 -0
  230. package/{modules → lib/modules}/viewkeeper/viewkeeper-host-options.d.ts +0 -0
  231. package/{modules → lib/modules}/viewkeeper/viewkeeper-offset.d.ts +0 -0
  232. package/{modules → lib/modules}/viewkeeper/viewkeeper-options.d.ts +0 -0
  233. package/{modules → lib/modules}/viewkeeper/viewkeeper.d.ts +0 -0
  234. package/{modules → lib/modules}/viewkeeper/viewkeeper.directive.d.ts +0 -0
  235. package/{modules → lib/modules}/viewkeeper/viewkeeper.module.d.ts +0 -0
  236. package/{modules → lib/modules}/viewkeeper/viewkeeper.service.d.ts +0 -0
  237. package/{modules → lib/modules}/window/window-ref.d.ts +0 -0
  238. package/package.json +19 -5
  239. package/skyux-core.d.ts +1 -1
  240. package/LICENSE +0 -21
  241. package/bundles/skyux-core-testing.umd.js.map +0 -1
  242. package/bundles/skyux-core.umd.js.map +0 -1
  243. package/esm2015/modules/adapter-service/adapter.module.js +0 -16
  244. package/esm2015/modules/adapter-service/adapter.service.js +0 -218
  245. package/esm2015/modules/adapter-service/focusable-children-options.js +0 -2
  246. package/esm2015/modules/affix/affix-auto-fit-context.js +0 -12
  247. package/esm2015/modules/affix/affix-config.js +0 -2
  248. package/esm2015/modules/affix/affix-horizontal-alignment.js +0 -2
  249. package/esm2015/modules/affix/affix-offset-change.js +0 -2
  250. package/esm2015/modules/affix/affix-offset.js +0 -2
  251. package/esm2015/modules/affix/affix-placement-change.js +0 -2
  252. package/esm2015/modules/affix/affix-placement.js +0 -2
  253. package/esm2015/modules/affix/affix-utils.js +0 -18
  254. package/esm2015/modules/affix/affix-vertical-alignment.js +0 -2
  255. package/esm2015/modules/affix/affix.directive.js +0 -98
  256. package/esm2015/modules/affix/affix.module.js +0 -18
  257. package/esm2015/modules/affix/affix.service.js +0 -24
  258. package/esm2015/modules/affix/affixer.js +0 -349
  259. package/esm2015/modules/affix/dom-utils.js +0 -77
  260. package/esm2015/modules/dock/dock-dom-adapter.service.js +0 -79
  261. package/esm2015/modules/dock/dock-insert-component-config.js +0 -2
  262. package/esm2015/modules/dock/dock-item-config.js +0 -2
  263. package/esm2015/modules/dock/dock-item-reference.js +0 -2
  264. package/esm2015/modules/dock/dock-item.js +0 -29
  265. package/esm2015/modules/dock/dock-location.js +0 -19
  266. package/esm2015/modules/dock/dock-options.js +0 -2
  267. package/esm2015/modules/dock/dock.component.js +0 -95
  268. package/esm2015/modules/dock/dock.module.js +0 -20
  269. package/esm2015/modules/dock/dock.service.js +0 -91
  270. package/esm2015/modules/dock/sort-by-stack-order.js +0 -13
  271. package/esm2015/modules/dynamic-component/dynamic-component-location.js +0 -27
  272. package/esm2015/modules/dynamic-component/dynamic-component-options.js +0 -2
  273. package/esm2015/modules/dynamic-component/dynamic-component.module.js +0 -17
  274. package/esm2015/modules/dynamic-component/dynamic-component.service.js +0 -82
  275. package/esm2015/modules/format/app-format.js +0 -18
  276. package/esm2015/modules/id/id.directive.js +0 -34
  277. package/esm2015/modules/id/id.module.js +0 -16
  278. package/esm2015/modules/log/log.module.js +0 -16
  279. package/esm2015/modules/log/log.service.js +0 -22
  280. package/esm2015/modules/media-query/media-breakpoints.js +0 -20
  281. package/esm2015/modules/media-query/media-query-listener.js +0 -2
  282. package/esm2015/modules/media-query/media-query.module.js +0 -16
  283. package/esm2015/modules/media-query/media-query.service.js +0 -117
  284. package/esm2015/modules/mutation/mutation-observer-service.js +0 -16
  285. package/esm2015/modules/numeric/numeric-symbol.js +0 -2
  286. package/esm2015/modules/numeric/numeric.module.js +0 -20
  287. package/esm2015/modules/numeric/numeric.options.js +0 -41
  288. package/esm2015/modules/numeric/numeric.pipe.js +0 -81
  289. package/esm2015/modules/numeric/numeric.service.js +0 -188
  290. package/esm2015/modules/overlay/overlay-adapter.service.js +0 -41
  291. package/esm2015/modules/overlay/overlay-config.js +0 -2
  292. package/esm2015/modules/overlay/overlay-context.js +0 -10
  293. package/esm2015/modules/overlay/overlay-instance.js +0 -55
  294. package/esm2015/modules/overlay/overlay.component.js +0 -152
  295. package/esm2015/modules/overlay/overlay.module.js +0 -18
  296. package/esm2015/modules/overlay/overlay.service.js +0 -119
  297. package/esm2015/modules/percent-pipe/percent-pipe.module.js +0 -20
  298. package/esm2015/modules/percent-pipe/percent.pipe.js +0 -48
  299. package/esm2015/modules/scrollable-host/scrollable-host.service.js +0 -161
  300. package/esm2015/modules/shared/number-format/number-format-utility.js +0 -74
  301. package/esm2015/modules/shared/sky-core-resources.module.js +0 -50
  302. package/esm2015/modules/title/set-title-args.js +0 -2
  303. package/esm2015/modules/title/title.service.js +0 -30
  304. package/esm2015/modules/ui-config/ui-config.service.js +0 -21
  305. package/esm2015/modules/viewkeeper/viewkeeper-boundary-info.js +0 -2
  306. package/esm2015/modules/viewkeeper/viewkeeper-fixed-styles.js +0 -2
  307. package/esm2015/modules/viewkeeper/viewkeeper-host-options.js +0 -10
  308. package/esm2015/modules/viewkeeper/viewkeeper-offset.js +0 -2
  309. package/esm2015/modules/viewkeeper/viewkeeper-options.js +0 -2
  310. package/esm2015/modules/viewkeeper/viewkeeper.directive.js +0 -113
  311. package/esm2015/modules/viewkeeper/viewkeeper.js +0 -254
  312. package/esm2015/modules/viewkeeper/viewkeeper.module.js +0 -16
  313. package/esm2015/modules/viewkeeper/viewkeeper.service.js +0 -38
  314. package/esm2015/modules/window/window-ref.js +0 -30
  315. package/esm2015/public-api.js +0 -60
  316. package/public-api.d.ts +0 -57
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/numeric/numeric.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;;;AASvF,MAAM,OAAO,iBAAiB;IA2B5B,YAAoB,gBAAwC;QAAxC,qBAAgB,GAAhB,gBAAgB,CAAwB;QATpD,gBAAW,GAAuB;YACxC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,gCAAgC,CAAC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C,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;QACnD,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACnD,CAAC;IAED;;;;;;OAMG;IACK,oBAAoB,CAAC,KAAa;QACxC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;QACzC,MAAM,MAAM,GACV,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAEpE,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,SAAS,CAAC,GAAW;QAC3B,6EAA6E;QAC7E,OAAO,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5E,CAAC;;+GAzOU,iBAAiB;mHAAjB,iBAAiB,cAFhB,KAAK;4FAEN,iBAAiB;kBAH7B,UAAU;mBAAC;oBACV,UAAU,EAAE,KAAK;iBAClB","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { SkyIntlNumberFormatStyle, SkyLibResourcesService } from '@skyux/i18n';\n\nimport { SkyNumberFormatUtility } from '../shared/number-format/number-format-utility';\n\nimport { NumericOptions } from './numeric.options';\n\nimport { SkyNumericSymbol } from './numeric-symbol';\n\n@Injectable({\n providedIn: 'any',\n})\nexport class SkyNumericService {\n /**\n * The browser's current locale.\n * @internal\n */\n public set currentLocale(value: string) {\n this._locale = value;\n }\n\n public get currentLocale(): string {\n return this._locale || 'en-US';\n }\n\n /**\n * @internal\n */\n public shortSymbol: string;\n\n private symbolIndex: SkyNumericSymbol[] = [\n { value: 1e12, label: this.getSymbol('skyux_numeric_trillions_symbol') },\n { value: 1e9, label: this.getSymbol('skyux_numeric_billions_symbol') },\n { value: 1e6, label: this.getSymbol('skyux_numeric_millions_symbol') },\n { value: 1e3, label: this.getSymbol('skyux_numeric_thousands_symbol') },\n ];\n\n private _locale: string;\n\n constructor(private resourcesService: SkyLibResourcesService) {}\n\n /**\n * Shortens with or without symbol (K/M/B/T) depending on value of number.\n * @param value The number to format.\n * @param options Format options.\n */\n public formatNumber(value: number, options: NumericOptions): string {\n /* tslint:disable-next-line:no-null-keyword */\n if (isNaN(value) || value === null) {\n return '';\n }\n\n const decimalPlaceRegExp = /\\.0+$|(\\.[0-9]*[1-9])0+$/;\n\n // Get the symbol for the number after rounding, since rounding could push the number\n // into a different symbol range.\n let roundedNumber = this.roundNumber(value, options.digits);\n let roundedNumberAbs = Math.abs(roundedNumber);\n\n let suffix = '';\n\n for (let i = 0; i < this.symbolIndex.length; i++) {\n let symbol = this.symbolIndex[i];\n\n if (\n options.truncate &&\n roundedNumberAbs >= options.truncateAfter &&\n roundedNumberAbs >= symbol.value\n ) {\n roundedNumber = this.roundNumber(value / symbol.value, options.digits);\n\n if (Math.abs(roundedNumber) === 1000 && i > 0) {\n // Rounding caused the number to cross into the range of the next symbol.\n symbol = this.symbolIndex[i - 1];\n roundedNumber /= 1000;\n }\n\n suffix = symbol.label;\n\n break;\n }\n }\n\n let output =\n roundedNumber.toString().replace(decimalPlaceRegExp, '$1') + suffix;\n\n this.storeShortenSymbol(output);\n\n const locale = options.locale || this.currentLocale;\n\n let digits: string;\n // Checks the string entered for format. Using toLowerCase to ignore case.\n switch (options.format?.toLowerCase()) {\n // In a case where a decimal value was not shortened and\n // the digit input is 2 or higher, it forces 2 digits.\n // For example, this prevents a value like $15.50 from displaying as $15.5.\n // Note: This will need to be reviewed if we support currencies with\n // three decimal digits.\n case 'currency':\n const isDecimal = value % 1 !== 0;\n\n if (options.minDigits) {\n digits = `1.${options.minDigits}-${options.digits}`;\n } else if (isDecimal && options.digits >= 2) {\n digits = `1.2-${options.digits}`;\n } else {\n digits = `1.0-${options.digits}`;\n }\n\n // Angular 5+ needs a string for this parameter, but Angular 4 needs a boolean.\n // To support both versions we can supply 'symbol' which will evaluate truthy for Angular 4\n // and the appropriate string value for Angular 5+.\n // See: https://angular.io/api/common/CurrencyPipe#parameters\n const symbolDisplay: any = 'symbol';\n\n output = SkyNumberFormatUtility.formatNumber(\n locale,\n parseFloat(output),\n SkyIntlNumberFormatStyle.Currency,\n digits,\n options.iso,\n symbolDisplay,\n options.currencySign\n );\n break;\n\n // The following is a catch-all to ensure that if\n // anything but currency (or a future option) are entered,\n // it will be treated like a number.\n default:\n // Ensures localization of the number to ensure comma and\n // decimal separator\n if (options.minDigits) {\n digits = `1.${options.minDigits}-${options.digits}`;\n } else if (options.truncate) {\n digits = `1.0-${options.digits}`;\n } else {\n digits = `1.${options.digits}-${options.digits}`;\n }\n\n output = SkyNumberFormatUtility.formatNumber(\n locale,\n parseFloat(output),\n SkyIntlNumberFormatStyle.Decimal,\n digits\n );\n break;\n }\n\n if (options.truncate) {\n output = this.replaceShortenSymbol(output);\n }\n\n return output;\n }\n\n /**\n * Rounds a given number\n *\n * JS's limitation - numbers bigger than Number.MIN_SAFE_INTEGER or Number.MAX_SAFE_INTEGER\n * are not guaranteed to be represented or rounded correctly\n * @param value - value to round\n * @param precision - what precision to round with, defaults to 0 decimal places\n */\n private roundNumber(value: number, precision: number = 0): number {\n if (precision < 0) {\n throw new Error('SkyInvalidArgument: precision must be >= 0');\n }\n\n /* tslint:disable-next-line:no-null-keyword */\n /* Sanity check - ignoring coverage but should not ignore if we make this method public */\n /* istanbul ignore next */\n if (isNaN(value) || value === null) {\n return 0;\n }\n\n const scaledValue: number = this.scaleNumberByPowerOfTen(\n value,\n precision,\n true\n );\n const scaledRoundedValue: number = Math.round(scaledValue);\n const unscaledRoundedValue: number = this.scaleNumberByPowerOfTen(\n scaledRoundedValue,\n precision,\n false\n );\n\n return unscaledRoundedValue;\n }\n\n /**\n * Scales a given number by a power of 10\n * @param value - value to scale\n * @param scalar - 10^scalar\n * @param scaleUp - whether to increase or decrease the value\n */\n private scaleNumberByPowerOfTen(\n value: number,\n scalar: number,\n scaleUp: boolean\n ): number {\n const valueStr: string = value.toString().toLowerCase();\n const isExponentFormat: boolean = valueStr.includes('e');\n\n if (isExponentFormat) {\n const [base, exp] = valueStr.split('e');\n const newExp = scaleUp ? Number(exp) + scalar : Number(exp) - scalar;\n return Number(`${base}e${newExp}`);\n } else {\n const e = scaleUp ? 'e' : 'e-';\n return Number(`${value}${e}${scalar}`);\n }\n }\n\n /**\n * Stores the symbol added from shortening to reapply later.\n * @param value The string to derive the shorten symbol from.\n */\n private storeShortenSymbol(value: string): void {\n const symbols: string[] = this.symbolIndex.map((s) => s.label);\n const regexp = new RegExp(symbols.join('|'), 'ig');\n const match = value.match(regexp);\n this.shortSymbol = match ? match.toString() : '';\n }\n\n /**\n * Must have previously called storeShortenSymbol to have something to replace.\n * Finds the last number in the formatted number, gets the index of the position\n * after that character and re-inserts the symbol.\n * Works regardless of currency symbol position.\n * @param value The string to modify.\n */\n private replaceShortenSymbol(value: string): string {\n const result = /(\\d)(?!.*\\d)/g.exec(value);\n const pos = result.index + result.length;\n const output =\n value.substring(0, pos) + this.shortSymbol + value.substring(pos);\n\n return output;\n }\n\n private getSymbol(key: string): string {\n // TODO: Need to implement the async `getString` method in a breaking change.\n return this.resourcesService.getStringForLocale({ locale: 'en_US' }, key);\n }\n}\n"]}
@@ -0,0 +1,41 @@
1
+ import { Injectable, RendererFactory2 } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * @internal
5
+ */
6
+ export class SkyOverlayAdapterService {
7
+ constructor(rendererFactory) {
8
+ this.renderer = rendererFactory.createRenderer(undefined, undefined);
9
+ }
10
+ restrictBodyScroll() {
11
+ // Create a style element to avoid overwriting any existing inline body styles.
12
+ const styleElement = this.renderer.createElement('style');
13
+ const textNode = this.renderer.createText('body { overflow: hidden }');
14
+ // Apply a `data-` attribute to make unit testing easier.
15
+ this.renderer.setAttribute(styleElement, 'data-test-selector', 'sky-overlay-restrict-scroll-styles');
16
+ this.renderer.appendChild(styleElement, textNode);
17
+ this.renderer.appendChild(document.head, styleElement);
18
+ if (this.styleElement) {
19
+ this.destroyStyleElement();
20
+ }
21
+ this.styleElement = styleElement;
22
+ }
23
+ releaseBodyScroll() {
24
+ this.destroyStyleElement();
25
+ }
26
+ destroyStyleElement() {
27
+ /* istanbul ignore else */
28
+ if (this.styleElement.parentElement === document.head) {
29
+ this.renderer.removeChild(document.head, this.styleElement);
30
+ }
31
+ }
32
+ }
33
+ SkyOverlayAdapterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayAdapterService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
34
+ SkyOverlayAdapterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayAdapterService, providedIn: 'root' });
35
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayAdapterService, decorators: [{
36
+ type: Injectable,
37
+ args: [{
38
+ providedIn: 'root',
39
+ }]
40
+ }], ctorParameters: function () { return [{ type: i0.RendererFactory2 }]; } });
41
+ //# sourceMappingURL=overlay-adapter.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/overlay/overlay-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,gBAAgB,EAAE,MAAM,eAAe,CAAC;;AAExE;;GAEG;AAIH,MAAM,OAAO,wBAAwB;IAKnC,YAAY,eAAiC;QAC3C,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;IAEM,kBAAkB;QACvB,+EAA+E;QAC/E,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,2BAA2B,CAAC,CAAC;QAEvE,yDAAyD;QACzD,IAAI,CAAC,QAAQ,CAAC,YAAY,CACxB,YAAY,EACZ,oBAAoB,EACpB,oCAAoC,CACrC,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,mBAAmB,EAAE,CAAC;SAC5B;QAED,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAEM,iBAAiB;QACtB,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC7B,CAAC;IAEO,mBAAmB;QACzB,0BAA0B;QAC1B,IAAI,IAAI,CAAC,YAAY,CAAC,aAAa,KAAK,QAAQ,CAAC,IAAI,EAAE;YACrD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;SAC7D;IACH,CAAC;;sHAxCU,wBAAwB;0HAAxB,wBAAwB,cAFvB,MAAM;4FAEP,wBAAwB;kBAHpC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable, Renderer2, RendererFactory2 } from '@angular/core';\n\n/**\n * @internal\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyOverlayAdapterService {\n private renderer: Renderer2;\n\n private styleElement: HTMLStyleElement;\n\n constructor(rendererFactory: RendererFactory2) {\n this.renderer = rendererFactory.createRenderer(undefined, undefined);\n }\n\n public restrictBodyScroll(): void {\n // Create a style element to avoid overwriting any existing inline body styles.\n const styleElement = this.renderer.createElement('style');\n const textNode = this.renderer.createText('body { overflow: hidden }');\n\n // Apply a `data-` attribute to make unit testing easier.\n this.renderer.setAttribute(\n styleElement,\n 'data-test-selector',\n 'sky-overlay-restrict-scroll-styles'\n );\n\n this.renderer.appendChild(styleElement, textNode);\n this.renderer.appendChild(document.head, styleElement);\n\n if (this.styleElement) {\n this.destroyStyleElement();\n }\n\n this.styleElement = styleElement;\n }\n\n public releaseBodyScroll(): void {\n this.destroyStyleElement();\n }\n\n private destroyStyleElement(): void {\n /* istanbul ignore else */\n if (this.styleElement.parentElement === document.head) {\n this.renderer.removeChild(document.head, this.styleElement);\n }\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=overlay-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-config.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/overlay/overlay-config.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkyOverlayConfig {\n /**\n * Specifies if the overlay should be closed after a navigation change.\n */\n closeOnNavigation?: boolean;\n\n /**\n * Specifies if the overlay should be closed when a user clicks outside the overlay's content.\n */\n enableClose?: boolean;\n\n /**\n * Specifies if mouse interactions should be allowed below the backdrop.\n */\n enablePointerEvents?: boolean;\n\n /**\n * Specifies if window scrolling should be enabled when the overlay is opened.\n */\n enableScroll?: boolean;\n\n /**\n * Specifies if the overlay's backdrop should be visible.\n */\n showBackdrop?: boolean;\n\n /**\n * Specifies extra CSS classes to be added to the overlay's wrapper element.\n */\n wrapperClass?: string;\n}\n"]}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Provides contextual information to each overlay created.
3
+ * @internal
4
+ */
5
+ export class SkyOverlayContext {
6
+ constructor(config) {
7
+ this.config = config;
8
+ }
9
+ }
10
+ //# sourceMappingURL=overlay-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-context.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/overlay/overlay-context.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,iBAAiB;IAC5B,YAA4B,MAAwB;QAAxB,WAAM,GAAN,MAAM,CAAkB;IAAG,CAAC;CACzD","sourcesContent":["import { SkyOverlayConfig } from './overlay-config';\n\n/**\n * Provides contextual information to each overlay created.\n * @internal\n */\nexport class SkyOverlayContext {\n constructor(public readonly config: SkyOverlayConfig) {}\n}\n"]}
@@ -0,0 +1,55 @@
1
+ import { Subject } from 'rxjs';
2
+ /**
3
+ * Represents a new overlay instance. It is used to manage the "closed" state of the overlay,
4
+ * and access any public members on the appended content component instance.
5
+ */
6
+ export class SkyOverlayInstance {
7
+ constructor(
8
+ /**
9
+ * The configuration for the overlay.
10
+ */
11
+ config, componentRef) {
12
+ this.config = config;
13
+ this.componentRef = componentRef;
14
+ this._backdropClick = new Subject();
15
+ this._closed = new Subject();
16
+ this.componentRef.instance.closed.subscribe(() => {
17
+ this._closed.next();
18
+ this._closed.complete();
19
+ this._backdropClick.complete();
20
+ });
21
+ this.componentRef.instance.backdropClick.subscribe(() => {
22
+ this._backdropClick.next();
23
+ });
24
+ }
25
+ /**
26
+ * Emits when the overlay is clicked (but not its content).
27
+ */
28
+ get backdropClick() {
29
+ return this._backdropClick.asObservable();
30
+ }
31
+ /**
32
+ * Emits after the overlay is closed.
33
+ */
34
+ get closed() {
35
+ return this._closed.asObservable();
36
+ }
37
+ /**
38
+ * Creates and attaches a component to the overlay.
39
+ * @param component The component to attach.
40
+ * @param providers Custom providers to apply to the component.
41
+ */
42
+ attachComponent(component, providers) {
43
+ const componentRef = this.componentRef.instance.attachComponent(component, providers);
44
+ return componentRef.instance;
45
+ }
46
+ /**
47
+ * Attaches a `TemplateRef` to the overlay.
48
+ * @param templateRef The `TemplateRef` to attach.
49
+ * @param context The context to provide to the template.
50
+ */
51
+ attachTemplate(templateRef, context) {
52
+ this.componentRef.instance.attachTemplate(templateRef, context);
53
+ }
54
+ }
55
+ //# sourceMappingURL=overlay-instance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-instance.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/overlay/overlay-instance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,OAAO,EAAE,MAAM,MAAM,CAAC;AAM3C;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IAmB7B;IACE;;OAEG;IACa,MAAwB,EACxB,YAA+C;QAD/C,WAAM,GAAN,MAAM,CAAkB;QACxB,iBAAY,GAAZ,YAAY,CAAmC;QATzD,mBAAc,GAAG,IAAI,OAAO,EAAQ,CAAC;QAErC,YAAO,GAAG,IAAI,OAAO,EAAQ,CAAC;QASpC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE;YAC/C,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;YACxB,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACjC,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG,EAAE;YACtD,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC;IAlCD;;OAEG;IACH,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IAC5C,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAwBD;;;;OAIG;IACI,eAAe,CACpB,SAAkB,EAClB,SAA4B;QAE5B,MAAM,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,eAAe,CAC7D,SAAS,EACT,SAAS,CACV,CAAC;QACF,OAAO,YAAY,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACI,cAAc,CAAI,WAA2B,EAAE,OAAW;QAC/D,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC;CACF","sourcesContent":["import { ComponentRef, StaticProvider, TemplateRef, Type } from '@angular/core';\n\nimport { Observable, Subject } from 'rxjs';\n\nimport { SkyOverlayComponent } from './overlay.component';\n\nimport { SkyOverlayConfig } from './overlay-config';\n\n/**\n * Represents a new overlay instance. It is used to manage the \"closed\" state of the overlay,\n * and access any public members on the appended content component instance.\n */\nexport class SkyOverlayInstance {\n /**\n * Emits when the overlay is clicked (but not its content).\n */\n public get backdropClick(): Observable<void> {\n return this._backdropClick.asObservable();\n }\n\n /**\n * Emits after the overlay is closed.\n */\n public get closed(): Observable<void> {\n return this._closed.asObservable();\n }\n\n private _backdropClick = new Subject<void>();\n\n private _closed = new Subject<void>();\n\n constructor(\n /**\n * The configuration for the overlay.\n */\n public readonly config: SkyOverlayConfig,\n public readonly componentRef: ComponentRef<SkyOverlayComponent>\n ) {\n this.componentRef.instance.closed.subscribe(() => {\n this._closed.next();\n this._closed.complete();\n this._backdropClick.complete();\n });\n\n this.componentRef.instance.backdropClick.subscribe(() => {\n this._backdropClick.next();\n });\n }\n\n /**\n * Creates and attaches a component to the overlay.\n * @param component The component to attach.\n * @param providers Custom providers to apply to the component.\n */\n public attachComponent<C>(\n component: Type<C>,\n providers?: StaticProvider[]\n ): C {\n const componentRef = this.componentRef.instance.attachComponent(\n component,\n providers\n );\n return componentRef.instance;\n }\n\n /**\n * Attaches a `TemplateRef` to the overlay.\n * @param templateRef The `TemplateRef` to attach.\n * @param context The context to provide to the template.\n */\n public attachTemplate<T>(templateRef: TemplateRef<T>, context?: T): void {\n this.componentRef.instance.attachTemplate(templateRef, context);\n }\n}\n"]}
@@ -0,0 +1,154 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ComponentFactoryResolver, ElementRef, Injector, Optional, ViewChild, ViewContainerRef, } from '@angular/core';
2
+ import { NavigationStart, Router } from '@angular/router';
3
+ import { fromEvent, Subject } from 'rxjs';
4
+ import { takeUntil } from 'rxjs/operators';
5
+ import { SkyCoreAdapterService } from '../adapter-service/adapter.service';
6
+ import { SkyOverlayContext } from './overlay-context';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "../adapter-service/adapter.service";
9
+ import * as i2 from "./overlay-context";
10
+ import * as i3 from "@angular/router";
11
+ import * as i4 from "@angular/common";
12
+ /**
13
+ * Omnibar is 1000.
14
+ * See: https://github.com/blackbaud/auth-client/blob/master/src/omnibar/omnibar.ts#L139
15
+ * ---
16
+ * Modals start their z-indexes at 1040. However, each modal's z-index is a multiple of 10, so it
17
+ * will be difficult to reliably predict a z-index that will always appear above all other
18
+ * layers. Starting the z-index for overlays at a number much greater than modals will accommodate
19
+ * the most reasonable of scenarios.
20
+ * See: https://github.com/blackbaud/skyux-modals/blob/master/src/app/public/modules/modal/modal-host.service.ts#L22
21
+ * (NOTE: It should be noted that modals do not use the overlay service, which is something we
22
+ * should do in the near future to make sure z-indexes are predictable across all component
23
+ * libraries.)
24
+ */
25
+ let uniqueZIndex = 5000;
26
+ /**
27
+ * @internal
28
+ */
29
+ export class SkyOverlayComponent {
30
+ constructor(changeDetector, resolver, injector, coreAdapter, context, router) {
31
+ this.changeDetector = changeDetector;
32
+ this.resolver = resolver;
33
+ this.injector = injector;
34
+ this.coreAdapter = coreAdapter;
35
+ this.context = context;
36
+ this.router = router;
37
+ this.wrapperClass = '';
38
+ this.enablePointerEvents = false;
39
+ this.showBackdrop = false;
40
+ this.zIndex = `${++uniqueZIndex}`;
41
+ this.ngUnsubscribe = new Subject();
42
+ this._backdropClick = new Subject();
43
+ this._closed = new Subject();
44
+ }
45
+ get backdropClick() {
46
+ return this._backdropClick.asObservable();
47
+ }
48
+ get closed() {
49
+ return this._closed.asObservable();
50
+ }
51
+ ngOnInit() {
52
+ this.applyConfig(this.context.config);
53
+ setTimeout(() => {
54
+ this.addBackdropClickListener();
55
+ });
56
+ if (this.context.config.closeOnNavigation) {
57
+ this.addRouteListener();
58
+ }
59
+ }
60
+ ngOnDestroy() {
61
+ this.removeRouteListener();
62
+ this.ngUnsubscribe.next();
63
+ this.ngUnsubscribe.complete();
64
+ this._backdropClick.complete();
65
+ this._closed.next();
66
+ this._closed.complete();
67
+ }
68
+ attachComponent(component, providers = []) {
69
+ this.targetRef.clear();
70
+ const factory = this.resolver.resolveComponentFactory(component);
71
+ const injector = Injector.create({
72
+ providers,
73
+ parent: this.injector,
74
+ });
75
+ const componentRef = this.targetRef.createComponent(factory, undefined, injector);
76
+ // Run an initial change detection cycle after the component has been created.
77
+ componentRef.changeDetectorRef.detectChanges();
78
+ return componentRef;
79
+ }
80
+ attachTemplate(templateRef, context) {
81
+ this.targetRef.clear();
82
+ return this.targetRef.createEmbeddedView(templateRef, context);
83
+ }
84
+ applyConfig(config) {
85
+ this.wrapperClass = config.wrapperClass || '';
86
+ this.showBackdrop = config.showBackdrop;
87
+ this.enablePointerEvents = config.enablePointerEvents;
88
+ this.changeDetector.markForCheck();
89
+ }
90
+ addBackdropClickListener() {
91
+ fromEvent(window.document, 'click')
92
+ .pipe(takeUntil(this.ngUnsubscribe))
93
+ .subscribe((event) => {
94
+ const isChild = this.overlayContentRef.nativeElement.contains(event.target);
95
+ const isAbove = this.coreAdapter.isTargetAboveElement(event.target, this.overlayRef.nativeElement);
96
+ /* istanbul ignore else */
97
+ if (!isChild && !isAbove) {
98
+ this._backdropClick.next();
99
+ if (this.context.config.enableClose) {
100
+ this._closed.next();
101
+ }
102
+ }
103
+ });
104
+ }
105
+ addRouteListener() {
106
+ /*istanbul ignore else*/
107
+ if (this.router) {
108
+ this.routerSubscription = this.router.events.subscribe((event) => {
109
+ /* istanbul ignore else */
110
+ if (event instanceof NavigationStart) {
111
+ this._closed.next();
112
+ }
113
+ });
114
+ }
115
+ }
116
+ removeRouteListener() {
117
+ if (this.routerSubscription) {
118
+ this.routerSubscription.unsubscribe();
119
+ this.routerSubscription = undefined;
120
+ }
121
+ }
122
+ }
123
+ SkyOverlayComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i1.SkyCoreAdapterService }, { token: i2.SkyOverlayContext }, { token: i3.Router, optional: true }], target: i0.ɵɵFactoryTarget.Component });
124
+ SkyOverlayComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: SkyOverlayComponent, selector: "sky-overlay", viewQueries: [{ propertyName: "overlayContentRef", first: true, predicate: ["overlayContentRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "overlayRef", first: true, predicate: ["overlayRef"], descendants: true, read: ElementRef, static: true }, { propertyName: "targetRef", first: true, predicate: ["target"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: "<div\n [class]=\"wrapperClass\"\n [style.zIndex]=\"zIndex\"\n [ngClass]=\"{\n 'enable-pointer-events-pass-through': enablePointerEvents,\n 'sky-overlay': true\n }\"\n #overlayRef\n>\n <div class=\"sky-overlay-content\" #overlayContentRef>\n <ng-template #target> </ng-template>\n </div>\n <div *ngIf=\"showBackdrop\" class=\"sky-overlay-backdrop\"></div>\n</div>\n", styles: [".sky-overlay{position:fixed;top:0;right:0;left:0;bottom:0;width:100%;height:100%;display:flex;pointer-events:auto}.sky-overlay-content{position:relative;z-index:1;display:inline-flex;align-self:start;pointer-events:auto}.sky-overlay-backdrop{background:rgba(0,0,0,.5);top:0;right:0;left:0;bottom:0;width:100%;height:100%;position:absolute}.enable-pointer-events-pass-through{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-backdrop{pointer-events:none}.enable-pointer-events-pass-through .sky-overlay-content{pointer-events:auto}\n"], directives: [{ type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
125
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayComponent, decorators: [{
126
+ type: Component,
127
+ args: [{
128
+ selector: 'sky-overlay',
129
+ templateUrl: './overlay.component.html',
130
+ styleUrls: ['./overlay.component.scss'],
131
+ changeDetection: ChangeDetectionStrategy.OnPush,
132
+ }]
133
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }, { type: i1.SkyCoreAdapterService }, { type: i2.SkyOverlayContext }, { type: i3.Router, decorators: [{
134
+ type: Optional
135
+ }] }]; }, propDecorators: { overlayContentRef: [{
136
+ type: ViewChild,
137
+ args: ['overlayContentRef', {
138
+ read: ElementRef,
139
+ static: true,
140
+ }]
141
+ }], overlayRef: [{
142
+ type: ViewChild,
143
+ args: ['overlayRef', {
144
+ read: ElementRef,
145
+ static: true,
146
+ }]
147
+ }], targetRef: [{
148
+ type: ViewChild,
149
+ args: ['target', {
150
+ read: ViewContainerRef,
151
+ static: true,
152
+ }]
153
+ }] } });
154
+ //# sourceMappingURL=overlay.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/overlay/overlay.component.ts","../../../../../../../../libs/components/core/src/lib/modules/overlay/overlay.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,wBAAwB,EAExB,UAAU,EAEV,QAAQ,EAGR,QAAQ,EAIR,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CA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AEO,mBAAmB;QACzB,IAAI,IAAI,CAAC,kBAAkB,EAAE;YAC3B,IAAI,CAAC,kBAAkB,CAAC,WAAW,EAAE,CAAC;YACtC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;SACrC;IACH,CAAC;;iHA1JU,mBAAmB;qGAAnB,mBAAmB,sJAkBtB,UAAU,iHAMV,UAAU,4GAMV,gBAAgB,2CCrF1B,+XAcA;4FDyCa,mBAAmB;kBAN/B,SAAS;mBAAC;oBACT,QAAQ,EAAE,aAAa;oBACvB,WAAW,EAAE,0BAA0B;oBACvC,SAAS,EAAE,CAAC,0BAA0B,CAAC;oBACvC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;0BAkDI,QAAQ;4CA5BH,iBAAiB;sBAJxB,SAAS;uBAAC,mBAAmB,EAAE;wBAC9B,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBAOO,UAAU;sBAJjB,SAAS;uBAAC,YAAY,EAAE;wBACvB,IAAI,EAAE,UAAU;wBAChB,MAAM,EAAE,IAAI;qBACb;gBAOO,SAAS;sBAJhB,SAAS;uBAAC,QAAQ,EAAE;wBACnB,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ComponentFactoryResolver,\n ComponentRef,\n ElementRef,\n EmbeddedViewRef,\n Injector,\n OnDestroy,\n OnInit,\n Optional,\n StaticProvider,\n TemplateRef,\n Type,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { NavigationStart, Router } from '@angular/router';\n\nimport { fromEvent, Observable, Subject, Subscription } from 'rxjs';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyCoreAdapterService } from '../adapter-service/adapter.service';\n\nimport { SkyOverlayConfig } from './overlay-config';\n\nimport { SkyOverlayContext } from './overlay-context';\n\n/**\n * Omnibar is 1000.\n * See: https://github.com/blackbaud/auth-client/blob/master/src/omnibar/omnibar.ts#L139\n * ---\n * Modals start their z-indexes at 1040. However, each modal's z-index is a multiple of 10, so it\n * will be difficult to reliably predict a z-index that will always appear above all other\n * layers. Starting the z-index for overlays at a number much greater than modals will accommodate\n * the most reasonable of scenarios.\n * See: https://github.com/blackbaud/skyux-modals/blob/master/src/app/public/modules/modal/modal-host.service.ts#L22\n * (NOTE: It should be noted that modals do not use the overlay service, which is something we\n * should do in the near future to make sure z-indexes are predictable across all component\n * libraries.)\n */\nlet uniqueZIndex = 5000;\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-overlay',\n templateUrl: './overlay.component.html',\n styleUrls: ['./overlay.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyOverlayComponent implements OnInit, OnDestroy {\n public wrapperClass = '';\n\n public get backdropClick(): Observable<void> {\n return this._backdropClick.asObservable();\n }\n\n public get closed(): Observable<void> {\n return this._closed.asObservable();\n }\n\n public enablePointerEvents = false;\n\n public showBackdrop = false;\n\n public zIndex: string = `${++uniqueZIndex}`;\n\n @ViewChild('overlayContentRef', {\n read: ElementRef,\n static: true,\n })\n private overlayContentRef: ElementRef;\n\n @ViewChild('overlayRef', {\n read: ElementRef,\n static: true,\n })\n private overlayRef: ElementRef;\n\n @ViewChild('target', {\n read: ViewContainerRef,\n static: true,\n })\n private targetRef: ViewContainerRef;\n\n private ngUnsubscribe = new Subject<void>();\n\n private routerSubscription: Subscription;\n\n private _backdropClick = new Subject<void>();\n\n private _closed = new Subject<void>();\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private resolver: ComponentFactoryResolver,\n private injector: Injector,\n private coreAdapter: SkyCoreAdapterService,\n private context: SkyOverlayContext,\n @Optional() private router?: Router\n ) {}\n\n public ngOnInit(): void {\n this.applyConfig(this.context.config);\n\n setTimeout(() => {\n this.addBackdropClickListener();\n });\n\n if (this.context.config.closeOnNavigation) {\n this.addRouteListener();\n }\n }\n\n public ngOnDestroy(): void {\n this.removeRouteListener();\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n\n this._backdropClick.complete();\n\n this._closed.next();\n this._closed.complete();\n }\n\n public attachComponent<C>(\n component: Type<C>,\n providers: StaticProvider[] = []\n ): ComponentRef<C> {\n this.targetRef.clear();\n\n const factory = this.resolver.resolveComponentFactory(component);\n const injector = Injector.create({\n providers,\n parent: this.injector,\n });\n\n const componentRef = this.targetRef.createComponent<C>(\n factory,\n undefined,\n injector\n );\n\n // Run an initial change detection cycle after the component has been created.\n componentRef.changeDetectorRef.detectChanges();\n\n return componentRef;\n }\n\n public attachTemplate<T>(\n templateRef: TemplateRef<T>,\n context: T\n ): EmbeddedViewRef<T> {\n this.targetRef.clear();\n\n return this.targetRef.createEmbeddedView(templateRef, context);\n }\n\n private applyConfig(config: SkyOverlayConfig): void {\n this.wrapperClass = config.wrapperClass || '';\n this.showBackdrop = config.showBackdrop;\n this.enablePointerEvents = config.enablePointerEvents;\n this.changeDetector.markForCheck();\n }\n\n private addBackdropClickListener(): void {\n fromEvent(window.document, 'click')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((event: MouseEvent) => {\n const isChild = this.overlayContentRef.nativeElement.contains(\n event.target\n );\n const isAbove = this.coreAdapter.isTargetAboveElement(\n event.target,\n this.overlayRef.nativeElement\n );\n\n /* istanbul ignore else */\n if (!isChild && !isAbove) {\n this._backdropClick.next();\n if (this.context.config.enableClose) {\n this._closed.next();\n }\n }\n });\n }\n\n private addRouteListener(): void {\n /*istanbul ignore else*/\n if (this.router) {\n this.routerSubscription = this.router.events.subscribe((event) => {\n /* istanbul ignore else */\n if (event instanceof NavigationStart) {\n this._closed.next();\n }\n });\n }\n }\n\n private removeRouteListener(): void {\n if (this.routerSubscription) {\n this.routerSubscription.unsubscribe();\n this.routerSubscription = undefined;\n }\n }\n}\n","<div\n [class]=\"wrapperClass\"\n [style.zIndex]=\"zIndex\"\n [ngClass]=\"{\n 'enable-pointer-events-pass-through': enablePointerEvents,\n 'sky-overlay': true\n }\"\n #overlayRef\n>\n <div class=\"sky-overlay-content\" #overlayContentRef>\n <ng-template #target> </ng-template>\n </div>\n <div *ngIf=\"showBackdrop\" class=\"sky-overlay-backdrop\"></div>\n</div>\n"]}
@@ -0,0 +1,18 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { SkyOverlayComponent } from './overlay.component';
4
+ import * as i0 from "@angular/core";
5
+ export class SkyOverlayModule {
6
+ }
7
+ SkyOverlayModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
8
+ SkyOverlayModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayModule, declarations: [SkyOverlayComponent], imports: [CommonModule] });
9
+ SkyOverlayModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayModule, imports: [[CommonModule]] });
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayModule, decorators: [{
11
+ type: NgModule,
12
+ args: [{
13
+ imports: [CommonModule],
14
+ declarations: [SkyOverlayComponent],
15
+ entryComponents: [SkyOverlayComponent],
16
+ }]
17
+ }] });
18
+ //# sourceMappingURL=overlay.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/overlay/overlay.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;;AAO1D,MAAM,OAAO,gBAAgB;;8GAAhB,gBAAgB;+GAAhB,gBAAgB,iBAHZ,mBAAmB,aADxB,YAAY;+GAIX,gBAAgB,YAJlB,CAAC,YAAY,CAAC;4FAIZ,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,mBAAmB,CAAC;oBACnC,eAAe,EAAE,CAAC,mBAAmB,CAAC;iBACvC","sourcesContent":["import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { SkyOverlayComponent } from './overlay.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [SkyOverlayComponent],\n entryComponents: [SkyOverlayComponent],\n})\nexport class SkyOverlayModule {}\n"]}
@@ -0,0 +1,120 @@
1
+ import { ApplicationRef, ComponentFactoryResolver, Injectable, Injector, } from '@angular/core';
2
+ import { SkyOverlayAdapterService } from './overlay-adapter.service';
3
+ import { SkyOverlayContext } from './overlay-context';
4
+ import { SkyOverlayInstance } from './overlay-instance';
5
+ import { SkyOverlayComponent } from './overlay.component';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "./overlay-adapter.service";
8
+ /**
9
+ * This service is used to create new overlays.
10
+ * @dynamic
11
+ */
12
+ export class SkyOverlayService {
13
+ constructor(applicationRef, componentFactoryResolver, injector, adapter) {
14
+ this.applicationRef = applicationRef;
15
+ this.componentFactoryResolver = componentFactoryResolver;
16
+ this.injector = injector;
17
+ this.adapter = adapter;
18
+ }
19
+ /**
20
+ * Creates an empty overlay. Use the returned `SkyOverlayInstance` to append content.
21
+ * @param config Configuration for the overlay.
22
+ */
23
+ create(config) {
24
+ const settings = this.prepareConfig(config);
25
+ if (settings.enableScroll === false) {
26
+ this.adapter.restrictBodyScroll();
27
+ }
28
+ const componentRef = this.createOverlay(settings);
29
+ const instance = new SkyOverlayInstance(settings, componentRef);
30
+ instance.closed.subscribe(() => {
31
+ // Only execute the service's close method if the instance still exists.
32
+ // This is needed to address a race condition if the deprecated instance.close method is used instead.
33
+ if (SkyOverlayService.overlays.indexOf(instance) > -1) {
34
+ this.close(instance);
35
+ }
36
+ });
37
+ SkyOverlayService.overlays.push(instance);
38
+ return instance;
39
+ }
40
+ /**
41
+ * Closes (and destroys) an overlay instance.
42
+ * @param instance The instance to close.
43
+ */
44
+ close(instance) {
45
+ this.destroyOverlay(instance);
46
+ this.applicationRef.detachView(instance.componentRef.hostView);
47
+ instance.componentRef.destroy();
48
+ // In some cases, Angular keeps dynamically-generated component's nodes in the DOM during
49
+ // unit tests. This can make querying difficult because the older DOM nodes still exist and
50
+ // produce inconsistent results.
51
+ // Angular Material's overlay appears to do the same thing:
52
+ // https://github.com/angular/components/blob/master/src/cdk/portal/dom-portal-outlet.ts#L143-L145
53
+ // (Ignoring coverage since this branch will only be hit by consumer unit tests.)
54
+ const componentElement = instance.componentRef.location.nativeElement;
55
+ /* istanbul ignore if */
56
+ if (componentElement.parentNode !== null) {
57
+ componentElement.parentNode.removeChild(componentElement);
58
+ }
59
+ }
60
+ /**
61
+ * Closes all overlay instances.
62
+ */
63
+ closeAll() {
64
+ // The `close` event handler for each instance alters the array's length asynchronously,
65
+ // so the only "safe" index to call is zero.
66
+ while (SkyOverlayService.overlays.length > 0) {
67
+ this.close(SkyOverlayService.overlays[0]);
68
+ }
69
+ }
70
+ createOverlay(config) {
71
+ const injector = Injector.create({
72
+ parent: this.injector,
73
+ providers: [
74
+ {
75
+ provide: SkyOverlayContext,
76
+ useValue: new SkyOverlayContext(config),
77
+ },
78
+ ],
79
+ });
80
+ const componentRef = this.componentFactoryResolver
81
+ .resolveComponentFactory(SkyOverlayComponent)
82
+ .create(injector);
83
+ this.applicationRef.attachView(componentRef.hostView);
84
+ const domElem = componentRef.hostView
85
+ .rootNodes[0];
86
+ document.body.appendChild(domElem);
87
+ return componentRef;
88
+ }
89
+ prepareConfig(config) {
90
+ const defaults = {
91
+ closeOnNavigation: true,
92
+ enableClose: false,
93
+ enablePointerEvents: false,
94
+ enableScroll: true,
95
+ showBackdrop: false,
96
+ wrapperClass: '',
97
+ };
98
+ return Object.assign(Object.assign({}, defaults), config);
99
+ }
100
+ destroyOverlay(instance) {
101
+ SkyOverlayService.overlays.splice(SkyOverlayService.overlays.indexOf(instance), 1);
102
+ if (instance.config.enableScroll === false) {
103
+ // Only release the body scroll if no other overlay wishes it to be disabled.
104
+ const anotherOverlayDisablesScroll = SkyOverlayService.overlays.some((o) => !o.config.enableScroll);
105
+ if (!anotherOverlayDisablesScroll) {
106
+ this.adapter.releaseBodyScroll();
107
+ }
108
+ }
109
+ }
110
+ }
111
+ SkyOverlayService.overlays = [];
112
+ SkyOverlayService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayService, deps: [{ token: i0.ApplicationRef }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i1.SkyOverlayAdapterService }], target: i0.ɵɵFactoryTarget.Injectable });
113
+ SkyOverlayService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayService, providedIn: 'root' });
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyOverlayService, decorators: [{
115
+ type: Injectable,
116
+ args: [{
117
+ providedIn: 'root',
118
+ }]
119
+ }], ctorParameters: function () { return [{ type: i0.ApplicationRef }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }, { type: i1.SkyOverlayAdapterService }]; } });
120
+ //# sourceMappingURL=overlay.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/overlay/overlay.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,wBAAwB,EAGxB,UAAU,EACV,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAIrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CA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IAEO,aAAa,CAAC,MAAwB;QAC5C,MAAM,QAAQ,GAAqB;YACjC,iBAAiB,EAAE,IAAI;YACvB,WAAW,EAAE,KAAK;YAClB,mBAAmB,EAAE,KAAK;YAC1B,YAAY,EAAE,IAAI;YAClB,YAAY,EAAE,KAAK;YACnB,YAAY,EAAE,EAAE;SACjB,CAAC;QAEF,uCAAY,QAAQ,GAAK,MAAM,EAAG;IACpC,CAAC;IAEO,cAAc,CAAC,QAA4B;QACjD,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAC/B,iBAAiB,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,EAC5C,CAAC,CACF,CAAC;QAEF,IAAI,QAAQ,CAAC,MAAM,CAAC,YAAY,KAAK,KAAK,EAAE;YAC1C,6EAA6E;YAC7E,MAAM,4BAA4B,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAClE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAC9B,CAAC;YACF,IAAI,CAAC,4BAA4B,EAAE;gBACjC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC;aAClC;SACF;IACH,CAAC;;AA5Hc,0BAAQ,GAAyB,EAAE,CAAC;+GADxC,iBAAiB;mHAAjB,iBAAiB,cAFhB,MAAM;4FAEP,iBAAiB;kBAH7B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n EmbeddedViewRef,\n Injectable,\n Injector,\n} from '@angular/core';\n\nimport { SkyOverlayAdapterService } from './overlay-adapter.service';\n\nimport { SkyOverlayConfig } from './overlay-config';\n\nimport { SkyOverlayContext } from './overlay-context';\n\nimport { SkyOverlayInstance } from './overlay-instance';\n\nimport { SkyOverlayComponent } from './overlay.component';\n\n/**\n * This service is used to create new overlays.\n * @dynamic\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyOverlayService {\n private static overlays: SkyOverlayInstance[] = [];\n\n constructor(\n private applicationRef: ApplicationRef,\n private componentFactoryResolver: ComponentFactoryResolver,\n private injector: Injector,\n private adapter: SkyOverlayAdapterService\n ) {}\n\n /**\n * Creates an empty overlay. Use the returned `SkyOverlayInstance` to append content.\n * @param config Configuration for the overlay.\n */\n public create(config?: SkyOverlayConfig): SkyOverlayInstance {\n const settings = this.prepareConfig(config);\n\n if (settings.enableScroll === false) {\n this.adapter.restrictBodyScroll();\n }\n\n const componentRef = this.createOverlay(settings);\n const instance = new SkyOverlayInstance(settings, componentRef);\n\n instance.closed.subscribe(() => {\n // Only execute the service's close method if the instance still exists.\n // This is needed to address a race condition if the deprecated instance.close method is used instead.\n if (SkyOverlayService.overlays.indexOf(instance) > -1) {\n this.close(instance);\n }\n });\n\n SkyOverlayService.overlays.push(instance);\n\n return instance;\n }\n\n /**\n * Closes (and destroys) an overlay instance.\n * @param instance The instance to close.\n */\n public close(instance: SkyOverlayInstance): void {\n this.destroyOverlay(instance);\n this.applicationRef.detachView(instance.componentRef.hostView);\n instance.componentRef.destroy();\n\n // In some cases, Angular keeps dynamically-generated component's nodes in the DOM during\n // unit tests. This can make querying difficult because the older DOM nodes still exist and\n // produce inconsistent results.\n // Angular Material's overlay appears to do the same thing:\n // https://github.com/angular/components/blob/master/src/cdk/portal/dom-portal-outlet.ts#L143-L145\n // (Ignoring coverage since this branch will only be hit by consumer unit tests.)\n const componentElement = instance.componentRef.location.nativeElement;\n /* istanbul ignore if */\n if (componentElement.parentNode !== null) {\n componentElement.parentNode.removeChild(componentElement);\n }\n }\n\n /**\n * Closes all overlay instances.\n */\n public closeAll(): void {\n // The `close` event handler for each instance alters the array's length asynchronously,\n // so the only \"safe\" index to call is zero.\n while (SkyOverlayService.overlays.length > 0) {\n this.close(SkyOverlayService.overlays[0]);\n }\n }\n\n private createOverlay(\n config?: SkyOverlayConfig\n ): ComponentRef<SkyOverlayComponent> {\n const injector = Injector.create({\n parent: this.injector,\n providers: [\n {\n provide: SkyOverlayContext,\n useValue: new SkyOverlayContext(config),\n },\n ],\n });\n\n const componentRef = this.componentFactoryResolver\n .resolveComponentFactory(SkyOverlayComponent)\n .create(injector);\n\n this.applicationRef.attachView(componentRef.hostView);\n\n const domElem = (componentRef.hostView as EmbeddedViewRef<any>)\n .rootNodes[0] as HTMLElement;\n\n document.body.appendChild(domElem);\n\n return componentRef;\n }\n\n private prepareConfig(config: SkyOverlayConfig): SkyOverlayConfig {\n const defaults: SkyOverlayConfig = {\n closeOnNavigation: true,\n enableClose: false,\n enablePointerEvents: false,\n enableScroll: true,\n showBackdrop: false,\n wrapperClass: '',\n };\n\n return { ...defaults, ...config };\n }\n\n private destroyOverlay(instance: SkyOverlayInstance): void {\n SkyOverlayService.overlays.splice(\n SkyOverlayService.overlays.indexOf(instance),\n 1\n );\n\n if (instance.config.enableScroll === false) {\n // Only release the body scroll if no other overlay wishes it to be disabled.\n const anotherOverlayDisablesScroll = SkyOverlayService.overlays.some(\n (o) => !o.config.enableScroll\n );\n if (!anotherOverlayDisablesScroll) {\n this.adapter.releaseBodyScroll();\n }\n }\n }\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { NgModule } from '@angular/core';
3
+ import { SkyCoreResourcesModule } from '../shared/sky-core-resources.module';
4
+ import { SkyPercentPipe } from './percent.pipe';
5
+ import * as i0 from "@angular/core";
6
+ export class SkyPercentPipeModule {
7
+ }
8
+ SkyPercentPipeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPercentPipeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
9
+ SkyPercentPipeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPercentPipeModule, declarations: [SkyPercentPipe], imports: [CommonModule, SkyCoreResourcesModule], exports: [SkyPercentPipe] });
10
+ SkyPercentPipeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPercentPipeModule, providers: [SkyPercentPipe], imports: [[CommonModule, SkyCoreResourcesModule]] });
11
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPercentPipeModule, decorators: [{
12
+ type: NgModule,
13
+ args: [{
14
+ declarations: [SkyPercentPipe],
15
+ providers: [SkyPercentPipe],
16
+ imports: [CommonModule, SkyCoreResourcesModule],
17
+ exports: [SkyPercentPipe],
18
+ }]
19
+ }] });
20
+ //# sourceMappingURL=percent-pipe.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"percent-pipe.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/percent-pipe/percent-pipe.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;;AAQhD,MAAM,OAAO,oBAAoB;;kHAApB,oBAAoB;mHAApB,oBAAoB,iBALhB,cAAc,aAEnB,YAAY,EAAE,sBAAsB,aACpC,cAAc;mHAEb,oBAAoB,aAJpB,CAAC,cAAc,CAAC,YAClB,CAAC,YAAY,EAAE,sBAAsB,CAAC;4FAGpC,oBAAoB;kBANhC,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,cAAc,CAAC;oBAC9B,SAAS,EAAE,CAAC,cAAc,CAAC;oBAC3B,OAAO,EAAE,CAAC,YAAY,EAAE,sBAAsB,CAAC;oBAC/C,OAAO,EAAE,CAAC,cAAc,CAAC;iBAC1B","sourcesContent":["import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { SkyCoreResourcesModule } from '../shared/sky-core-resources.module';\n\nimport { SkyPercentPipe } from './percent.pipe';\n\n@NgModule({\n declarations: [SkyPercentPipe],\n providers: [SkyPercentPipe],\n imports: [CommonModule, SkyCoreResourcesModule],\n exports: [SkyPercentPipe],\n})\nexport class SkyPercentPipeModule {}\n"]}
@@ -0,0 +1,48 @@
1
+ import { Pipe } from '@angular/core';
2
+ import { SkyAppLocaleProvider, SkyIntlNumberFormatStyle } from '@skyux/i18n';
3
+ import { Subject } from 'rxjs';
4
+ import { takeUntil } from 'rxjs/operators';
5
+ import { SkyNumberFormatUtility } from '../shared/number-format/number-format-utility';
6
+ import * as i0 from "@angular/core";
7
+ import * as i1 from "@skyux/i18n";
8
+ export class SkyPercentPipe {
9
+ constructor(localeProvider) {
10
+ this.localeProvider = localeProvider;
11
+ this.defaultFormat = '1.0-2';
12
+ this.defaultLocale = 'en-US';
13
+ this.ngUnsubscribe = new Subject();
14
+ this.localeProvider
15
+ .getLocaleInfo()
16
+ .pipe(takeUntil(this.ngUnsubscribe))
17
+ .subscribe((localeInfo) => {
18
+ this.defaultLocale = localeInfo.locale;
19
+ this.updateFormattedValue();
20
+ });
21
+ }
22
+ ngOnDestroy() {
23
+ this.ngUnsubscribe.next();
24
+ this.ngUnsubscribe.complete();
25
+ }
26
+ transform(value, format, locale) {
27
+ this.value = value;
28
+ this.format = format;
29
+ this.locale = locale;
30
+ this.updateFormattedValue();
31
+ return this.formattedValue;
32
+ }
33
+ updateFormattedValue() {
34
+ const locale = this.locale || this.defaultLocale;
35
+ const format = this.format || this.defaultFormat;
36
+ this.formattedValue = SkyNumberFormatUtility.formatNumber(locale, this.value, SkyIntlNumberFormatStyle.Percent, format);
37
+ }
38
+ }
39
+ SkyPercentPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPercentPipe, deps: [{ token: i1.SkyAppLocaleProvider }], target: i0.ɵɵFactoryTarget.Pipe });
40
+ SkyPercentPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPercentPipe, name: "skyPercent", pure: false });
41
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyPercentPipe, decorators: [{
42
+ type: Pipe,
43
+ args: [{
44
+ name: 'skyPercent',
45
+ pure: false,
46
+ }]
47
+ }], ctorParameters: function () { return [{ type: i1.SkyAppLocaleProvider }]; } });
48
+ //# sourceMappingURL=percent.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"percent.pipe.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/percent-pipe/percent.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,IAAI,EAAiB,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE7E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;;;AAMvF,MAAM,OAAO,cAAc;IAezB,YAAoB,cAAoC;QAApC,mBAAc,GAAd,cAAc,CAAsB;QAdhD,kBAAa,GAAG,OAAO,CAAC;QAIxB,kBAAa,GAAG,OAAO,CAAC;QAQxB,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;QAG1C,IAAI,CAAC,cAAc;aAChB,aAAa,EAAE;aACf,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aACnC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE;YACxB,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC;YACvC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC9B,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,WAAW;QAChB,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;IAEM,SAAS,CAAC,KAAa,EAAE,MAAe,EAAE,MAAe;QAC9D,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAE5B,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAEO,oBAAoB;QAC1B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,aAAa,CAAC;QAEjD,IAAI,CAAC,cAAc,GAAG,sBAAsB,CAAC,YAAY,CACvD,MAAM,EACN,IAAI,CAAC,KAAK,EACV,wBAAwB,CAAC,OAAO,EAChC,MAAM,CACP,CAAC;IACJ,CAAC;;4GAlDU,cAAc;0GAAd,cAAc;4FAAd,cAAc;kBAJ1B,IAAI;mBAAC;oBACJ,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,KAAK;iBACZ","sourcesContent":["import { OnDestroy, Pipe, PipeTransform } from '@angular/core';\n\nimport { SkyAppLocaleProvider, SkyIntlNumberFormatStyle } from '@skyux/i18n';\n\nimport { Subject } from 'rxjs';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyNumberFormatUtility } from '../shared/number-format/number-format-utility';\n\n@Pipe({\n name: 'skyPercent',\n pure: false,\n})\nexport class SkyPercentPipe implements OnDestroy, PipeTransform {\n private defaultFormat = '1.0-2';\n\n private format: string;\n\n private defaultLocale = 'en-US';\n\n private locale: string;\n\n private value: string;\n\n private formattedValue: string;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(private localeProvider: SkyAppLocaleProvider) {\n this.localeProvider\n .getLocaleInfo()\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((localeInfo) => {\n this.defaultLocale = localeInfo.locale;\n this.updateFormattedValue();\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public transform(value: string, format?: string, locale?: string): string {\n this.value = value;\n this.format = format;\n this.locale = locale;\n\n this.updateFormattedValue();\n\n return this.formattedValue;\n }\n\n private updateFormattedValue(): void {\n const locale = this.locale || this.defaultLocale;\n const format = this.format || this.defaultFormat;\n\n this.formattedValue = SkyNumberFormatUtility.formatNumber(\n locale,\n this.value,\n SkyIntlNumberFormatStyle.Percent,\n format\n );\n }\n}\n"]}