@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,22 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * @deprecated The `SkyLogService` will be removed in the next major version of `@skyux/core`.
5
+ */
6
+ export class SkyLogService {
7
+ warn(message, ...optionalParams) {
8
+ /*istanbul ignore else */
9
+ if (window.console) {
10
+ window.console.warn.apply(window.console, arguments);
11
+ }
12
+ }
13
+ }
14
+ SkyLogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyLogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
15
+ SkyLogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyLogService, providedIn: 'root' });
16
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyLogService, decorators: [{
17
+ type: Injectable,
18
+ args: [{
19
+ providedIn: 'root',
20
+ }]
21
+ }] });
22
+ //# sourceMappingURL=log.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/log/log.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAE3C;;GAEG;AAIH,MAAM,OAAO,aAAa;IACjB,IAAI,CAAC,OAAa,EAAE,GAAG,cAAqB;QACjD,yBAAyB;QACzB,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;SACtD;IACH,CAAC;;2GANU,aAAa;+GAAb,aAAa,cAFZ,MAAM;4FAEP,aAAa;kBAHzB,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable } from '@angular/core';\n\n/**\n * @deprecated The `SkyLogService` will be removed in the next major version of `@skyux/core`.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyLogService {\n public warn(message?: any, ...optionalParams: any[]): void {\n /*istanbul ignore else */\n if (window.console) {\n window.console.warn.apply(window.console, arguments);\n }\n }\n}\n"]}
@@ -0,0 +1,20 @@
1
+ export var SkyMediaBreakpoints;
2
+ (function (SkyMediaBreakpoints) {
3
+ /**
4
+ * Indicates screen widths of 767px or less.
5
+ */
6
+ SkyMediaBreakpoints[SkyMediaBreakpoints["xs"] = 1] = "xs";
7
+ /**
8
+ * Indicates screen widths of 768px to 991px.
9
+ */
10
+ SkyMediaBreakpoints[SkyMediaBreakpoints["sm"] = 2] = "sm";
11
+ /**
12
+ * Indicates screen widths of 992px to 1199px.
13
+ */
14
+ SkyMediaBreakpoints[SkyMediaBreakpoints["md"] = 3] = "md";
15
+ /**
16
+ * Indicates screen widths of 1200px or greater.
17
+ */
18
+ SkyMediaBreakpoints[SkyMediaBreakpoints["lg"] = 4] = "lg";
19
+ })(SkyMediaBreakpoints || (SkyMediaBreakpoints = {}));
20
+ //# sourceMappingURL=media-breakpoints.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-breakpoints.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/media-query/media-breakpoints.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mBAoBX;AApBD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,yDAAM,CAAA;IAEN;;OAEG;IACH,yDAAE,CAAA;IAEF;;OAEG;IACH,yDAAE,CAAA;IAEF;;OAEG;IACH,yDAAE,CAAA;AACJ,CAAC,EApBW,mBAAmB,KAAnB,mBAAmB,QAoB9B","sourcesContent":["export enum SkyMediaBreakpoints {\n /**\n * Indicates screen widths of 767px or less.\n */\n xs = 1,\n\n /**\n * Indicates screen widths of 768px to 991px.\n */\n sm,\n\n /**\n * Indicates screen widths of 992px to 1199px.\n */\n md,\n\n /**\n * Indicates screen widths of 1200px or greater.\n */\n lg,\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=media-query-listener.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-query-listener.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/media-query/media-query-listener.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyMediaBreakpoints } from './media-breakpoints';\n\n/**\n * Specifies a funciton that is called when the breakpoints change. It is called\n * with a `SkyMediaBreakpoints` argument, which is an enum that represents the new breakpoint.\n */\nexport type SkyMediaQueryListener = (args: SkyMediaBreakpoints) => void;\n"]}
@@ -0,0 +1,16 @@
1
+ import { NgModule } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ /**
4
+ * @deprecated The `SkyMediaQueryService` no longer needs the `SkyMediaQueryModule`.
5
+ * The `SkyMediaQueryModule` can be removed from your project.
6
+ */
7
+ export class SkyMediaQueryModule {
8
+ }
9
+ SkyMediaQueryModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyMediaQueryModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
+ SkyMediaQueryModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyMediaQueryModule });
11
+ SkyMediaQueryModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyMediaQueryModule });
12
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyMediaQueryModule, decorators: [{
13
+ type: NgModule,
14
+ args: [{}]
15
+ }] });
16
+ //# sourceMappingURL=media-query.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-query.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/media-query/media-query.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;;AAEzC;;;GAGG;AAEH,MAAM,OAAO,mBAAmB;;iHAAnB,mBAAmB;kHAAnB,mBAAmB;kHAAnB,mBAAmB;4FAAnB,mBAAmB;kBAD/B,QAAQ;mBAAC,EAAE","sourcesContent":["import { NgModule } from '@angular/core';\n\n/**\n * @deprecated The `SkyMediaQueryService` no longer needs the `SkyMediaQueryModule`.\n * The `SkyMediaQueryModule` can be removed from your project.\n */\n@NgModule({})\nexport class SkyMediaQueryModule {}\n"]}
@@ -0,0 +1,121 @@
1
+ import { Injectable, NgZone } from '@angular/core';
2
+ import { BehaviorSubject } from 'rxjs';
3
+ import { SkyMediaBreakpoints } from './media-breakpoints';
4
+ import * as i0 from "@angular/core";
5
+ export class SkyMediaQueryService {
6
+ constructor(zone) {
7
+ this.zone = zone;
8
+ this.currentSubject = new BehaviorSubject(this.current);
9
+ this._current = SkyMediaBreakpoints.md;
10
+ this.breakpoints = [
11
+ {
12
+ mediaQueryString: SkyMediaQueryService.xs,
13
+ name: SkyMediaBreakpoints.xs,
14
+ },
15
+ {
16
+ mediaQueryString: SkyMediaQueryService.sm,
17
+ name: SkyMediaBreakpoints.sm,
18
+ },
19
+ {
20
+ mediaQueryString: SkyMediaQueryService.md,
21
+ name: SkyMediaBreakpoints.md,
22
+ },
23
+ {
24
+ mediaQueryString: SkyMediaQueryService.lg,
25
+ name: SkyMediaBreakpoints.lg,
26
+ },
27
+ ];
28
+ this.mediaQueries = [];
29
+ this.addListeners();
30
+ }
31
+ /**
32
+ * Returns the current breakpoint.
33
+ */
34
+ get current() {
35
+ return this._current;
36
+ }
37
+ ngOnDestroy() {
38
+ this.removeListeners();
39
+ this.currentSubject.complete();
40
+ }
41
+ /**
42
+ * Suscribes to screen size changes.
43
+ * @param listener Specifies a function that is called when breakpoints change.
44
+ */
45
+ subscribe(listener) {
46
+ return this.currentSubject.subscribe({
47
+ next: (breakpoints) => {
48
+ listener(breakpoints);
49
+ },
50
+ });
51
+ }
52
+ /**
53
+ * @internal
54
+ */
55
+ destroy() {
56
+ this.removeListeners();
57
+ this.currentSubject.complete();
58
+ }
59
+ addListeners() {
60
+ this.mediaQueries = this.breakpoints.map((breakpoint) => {
61
+ const mq = matchMedia(breakpoint.mediaQueryString);
62
+ const listener = (event) => {
63
+ // Run the check outside of Angular's change detection since Angular
64
+ // does not wrap matchMedia listeners in NgZone.
65
+ // See: https://blog.assaf.co/angular-2-change-detection-zones-and-an-example/
66
+ this.zone.run(() => {
67
+ if (event.matches) {
68
+ this.notifyBreakpointChange(breakpoint.name);
69
+ }
70
+ });
71
+ };
72
+ mq.addListener(listener);
73
+ if (mq.matches) {
74
+ this.notifyBreakpointChange(breakpoint.name);
75
+ }
76
+ return {
77
+ mediaQueryList: mq,
78
+ listener,
79
+ };
80
+ });
81
+ }
82
+ removeListeners() {
83
+ this.mediaQueries.forEach((mediaQuery) => {
84
+ mediaQuery.mediaQueryList.removeListener(mediaQuery.listener);
85
+ });
86
+ this.mediaQueries = [];
87
+ }
88
+ notifyBreakpointChange(breakpoint) {
89
+ this._current = breakpoint;
90
+ this.currentSubject.next(breakpoint);
91
+ }
92
+ }
93
+ /**
94
+ * The size for the `xs` breakpoint.
95
+ * @default "(max-width: 767px)"
96
+ */
97
+ SkyMediaQueryService.xs = '(max-width: 767px)';
98
+ /**
99
+ * The size for the `sm` breakpoint.
100
+ * @default "(min-width: 768px) and (max-width: 991px)"
101
+ */
102
+ SkyMediaQueryService.sm = '(min-width: 768px) and (max-width: 991px)';
103
+ /**
104
+ * The size for the `md` breakpoint.
105
+ * @default "(min-width: 992px) and (max-width: 1199px)"
106
+ */
107
+ SkyMediaQueryService.md = '(min-width: 992px) and (max-width: 1199px)';
108
+ /**
109
+ * The size for the `lg` breakpoint.
110
+ * @default "(min-width: 1200px)"
111
+ */
112
+ SkyMediaQueryService.lg = '(min-width: 1200px)';
113
+ SkyMediaQueryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyMediaQueryService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
114
+ SkyMediaQueryService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyMediaQueryService, providedIn: 'root' });
115
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyMediaQueryService, decorators: [{
116
+ type: Injectable,
117
+ args: [{
118
+ providedIn: 'root',
119
+ }]
120
+ }], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
121
+ //# sourceMappingURL=media-query.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media-query.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/media-query/media-query.service.ts"],"names":[],"mappings":"AAAA,OA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ID;;;GAGG;AACW,uBAAE,GAAG,oBAAoB,CAAC;AAExC;;;GAGG;AACW,uBAAE,GAAG,2CAA2C,CAAC;AAE/D;;;GAGG;AACW,uBAAE,GAAG,4CAA4C,CAAC;AAEhE;;;GAGG;AACW,uBAAE,GAAG,qBAAqB,CAAC;kHAvB9B,oBAAoB;sHAApB,oBAAoB,cAFnB,MAAM;4FAEP,oBAAoB;kBAHhC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable, NgZone, OnDestroy } from '@angular/core';\n\nimport { BehaviorSubject, Subscription } from 'rxjs';\n\nimport { SkyMediaBreakpoints } from './media-breakpoints';\n\nimport { SkyMediaQueryListener } from './media-query-listener';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyMediaQueryService implements OnDestroy {\n /**\n * The size for the `xs` breakpoint.\n * @default \"(max-width: 767px)\"\n */\n public static xs = '(max-width: 767px)';\n\n /**\n * The size for the `sm` breakpoint.\n * @default \"(min-width: 768px) and (max-width: 991px)\"\n */\n public static sm = '(min-width: 768px) and (max-width: 991px)';\n\n /**\n * The size for the `md` breakpoint.\n * @default \"(min-width: 992px) and (max-width: 1199px)\"\n */\n public static md = '(min-width: 992px) and (max-width: 1199px)';\n\n /**\n * The size for the `lg` breakpoint.\n * @default \"(min-width: 1200px)\"\n */\n public static lg = '(min-width: 1200px)';\n\n /**\n * Returns the current breakpoint.\n */\n public get current(): SkyMediaBreakpoints {\n return this._current;\n }\n\n private currentSubject = new BehaviorSubject<SkyMediaBreakpoints>(\n this.current\n );\n\n private _current = SkyMediaBreakpoints.md;\n\n private breakpoints: {\n mediaQueryString: string;\n name: SkyMediaBreakpoints;\n }[] = [\n {\n mediaQueryString: SkyMediaQueryService.xs,\n name: SkyMediaBreakpoints.xs,\n },\n {\n mediaQueryString: SkyMediaQueryService.sm,\n name: SkyMediaBreakpoints.sm,\n },\n {\n mediaQueryString: SkyMediaQueryService.md,\n name: SkyMediaBreakpoints.md,\n },\n {\n mediaQueryString: SkyMediaQueryService.lg,\n name: SkyMediaBreakpoints.lg,\n },\n ];\n\n private mediaQueries: {\n mediaQueryList: MediaQueryList;\n listener: (event: any) => void;\n }[] = [];\n\n constructor(private zone: NgZone) {\n this.addListeners();\n }\n\n public ngOnDestroy(): void {\n this.removeListeners();\n this.currentSubject.complete();\n }\n\n /**\n * Suscribes to screen size changes.\n * @param listener Specifies a function that is called when breakpoints change.\n */\n public subscribe(listener: SkyMediaQueryListener): Subscription {\n return this.currentSubject.subscribe({\n next: (breakpoints: SkyMediaBreakpoints) => {\n listener(breakpoints);\n },\n });\n }\n\n /**\n * @internal\n */\n public destroy(): void {\n this.removeListeners();\n this.currentSubject.complete();\n }\n\n private addListeners(): void {\n this.mediaQueries = this.breakpoints.map((breakpoint: any) => {\n const mq = matchMedia(breakpoint.mediaQueryString);\n\n const listener = (event: any) => {\n // Run the check outside of Angular's change detection since Angular\n // does not wrap matchMedia listeners in NgZone.\n // See: https://blog.assaf.co/angular-2-change-detection-zones-and-an-example/\n this.zone.run(() => {\n if (event.matches) {\n this.notifyBreakpointChange(breakpoint.name);\n }\n });\n };\n\n mq.addListener(listener);\n\n if (mq.matches) {\n this.notifyBreakpointChange(breakpoint.name);\n }\n\n return {\n mediaQueryList: mq,\n listener,\n };\n });\n }\n\n private removeListeners(): void {\n this.mediaQueries.forEach((mediaQuery) => {\n mediaQuery.mediaQueryList.removeListener(mediaQuery.listener);\n });\n this.mediaQueries = [];\n }\n\n private notifyBreakpointChange(breakpoint: SkyMediaBreakpoints): void {\n this._current = breakpoint;\n this.currentSubject.next(breakpoint);\n }\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export class MutationObserverService {
4
+ create(callback) {
5
+ return new MutationObserver(callback);
6
+ }
7
+ }
8
+ MutationObserverService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MutationObserverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
9
+ MutationObserverService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MutationObserverService, providedIn: 'root' });
10
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: MutationObserverService, decorators: [{
11
+ type: Injectable,
12
+ args: [{
13
+ providedIn: 'root',
14
+ }]
15
+ }] });
16
+ //# sourceMappingURL=mutation-observer-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutation-observer-service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/mutation/mutation-observer-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAK3C,MAAM,OAAO,uBAAuB;IAC3B,MAAM,CAAC,QAAa;QACzB,OAAO,IAAI,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IACxC,CAAC;;qHAHU,uBAAuB;yHAAvB,uBAAuB,cAFtB,MAAM;4FAEP,uBAAuB;kBAHnC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class MutationObserverService {\n public create(callback: any): MutationObserver {\n return new MutationObserver(callback);\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=numeric-symbol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric-symbol.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/numeric/numeric-symbol.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * @internal\n */\nexport interface SkyNumericSymbol {\n value: number;\n label: string;\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { SkyI18nModule } from '@skyux/i18n';
3
+ import { SkyCoreResourcesModule } from '../shared/sky-core-resources.module';
4
+ import { SkyNumericPipe } from './numeric.pipe';
5
+ import * as i0 from "@angular/core";
6
+ export class SkyNumericModule {
7
+ }
8
+ SkyNumericModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
9
+ SkyNumericModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericModule, declarations: [SkyNumericPipe], imports: [SkyI18nModule, SkyCoreResourcesModule], exports: [SkyNumericPipe] });
10
+ SkyNumericModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericModule, providers: [SkyNumericPipe], imports: [[SkyI18nModule, SkyCoreResourcesModule]] });
11
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericModule, decorators: [{
12
+ type: NgModule,
13
+ args: [{
14
+ declarations: [SkyNumericPipe],
15
+ providers: [SkyNumericPipe],
16
+ imports: [SkyI18nModule, SkyCoreResourcesModule],
17
+ exports: [SkyNumericPipe],
18
+ }]
19
+ }] });
20
+ //# sourceMappingURL=numeric.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/numeric/numeric.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;;AAQhD,MAAM,OAAO,gBAAgB;;8GAAhB,gBAAgB;+GAAhB,gBAAgB,iBALZ,cAAc,aAEnB,aAAa,EAAE,sBAAsB,aACrC,cAAc;+GAEb,gBAAgB,aAJhB,CAAC,cAAc,CAAC,YAClB,CAAC,aAAa,EAAE,sBAAsB,CAAC;4FAGrC,gBAAgB;kBAN5B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,cAAc,CAAC;oBAC9B,SAAS,EAAE,CAAC,cAAc,CAAC;oBAC3B,OAAO,EAAE,CAAC,aAAa,EAAE,sBAAsB,CAAC;oBAChD,OAAO,EAAE,CAAC,cAAc,CAAC;iBAC1B","sourcesContent":["import { NgModule } from '@angular/core';\n\nimport { SkyI18nModule } from '@skyux/i18n';\n\nimport { SkyCoreResourcesModule } from '../shared/sky-core-resources.module';\n\nimport { SkyNumericPipe } from './numeric.pipe';\n\n@NgModule({\n declarations: [SkyNumericPipe],\n providers: [SkyNumericPipe],\n imports: [SkyI18nModule, SkyCoreResourcesModule],\n exports: [SkyNumericPipe],\n})\nexport class SkyNumericModule {}\n"]}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Provides arguments for the number to format.
3
+ */
4
+ export class NumericOptions {
5
+ constructor() {
6
+ /**
7
+ * Specifies the maximum number of digits after the decimal separator.
8
+ * @default 1
9
+ */
10
+ this.digits = 1;
11
+ /**
12
+ * Specifies how to format the number. Options are `currency` or `number`.
13
+ * @default "number"
14
+ */
15
+ this.format = 'number';
16
+ /**
17
+ * Specifies the format of the currency.
18
+ * @default "standard"
19
+ */
20
+ this.currencySign = 'standard';
21
+ /**
22
+ * Specifies the ISO4217 currency code to use for currency formatting. If you do not specify a
23
+ * currency code, the component uses the browser's culture to determine the currency unless your
24
+ * SPA provides a different culture with `SkyAppLocaleProvider`.
25
+ * @default "USD"
26
+ */
27
+ this.iso = 'USD';
28
+ /**
29
+ * Indicates whether to shorten numbers to rounded numbers and abbreviation characters
30
+ * such as K for thousands, M for millions, B for billions, and T for trillion.
31
+ */
32
+ this.truncate = true;
33
+ /**
34
+ * Specifies the starting point after which numbers are shortened to rounded numbers
35
+ * and abbreviation characters.
36
+ * @default 0
37
+ */
38
+ this.truncateAfter = 0;
39
+ }
40
+ }
41
+ //# sourceMappingURL=numeric.options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric.options.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/numeric/numeric.options.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,OAAO,cAAc;IAA3B;QACE;;;WAGG;QACI,WAAM,GAAY,CAAC,CAAC;QAE3B;;;WAGG;QACI,WAAM,GAAY,QAAQ,CAAC;QAElC;;;WAGG;QACI,iBAAY,GAA+B,UAAU,CAAC;QAE7D;;;;;WAKG;QACI,QAAG,GAAY,KAAK,CAAC;QAc5B;;;WAGG;QACI,aAAQ,GAAa,IAAI,CAAC;QAEjC;;;;WAIG;QACI,kBAAa,GAAY,CAAC,CAAC;IACpC,CAAC;CAAA","sourcesContent":["/**\n * Provides arguments for the number to format.\n */\nexport class NumericOptions {\n /**\n * Specifies the maximum number of digits after the decimal separator.\n * @default 1\n */\n public digits?: number = 1;\n\n /**\n * Specifies how to format the number. Options are `currency` or `number`.\n * @default \"number\"\n */\n public format?: string = 'number';\n\n /**\n * Specifies the format of the currency.\n * @default \"standard\"\n */\n public currencySign?: 'accounting' | 'standard' = 'standard';\n\n /**\n * Specifies the ISO4217 currency code to use for currency formatting. If you do not specify a\n * currency code, the component uses the browser's culture to determine the currency unless your\n * SPA provides a different culture with `SkyAppLocaleProvider`.\n * @default \"USD\"\n */\n public iso?: string = 'USD';\n\n /**\n * Specifies the locale code to use when formatting.\n */\n public locale?: string;\n\n /**\n * Specifies the minimum number of digits after the decimal separator. This property only applies\n * when the `truncate` property is set to `false`. If `digits` specifies a maximum number of\n * digits, then `minDigits` must be less than that value.\n */\n public minDigits?: number;\n\n /**\n * Indicates whether to shorten numbers to rounded numbers and abbreviation characters\n * such as K for thousands, M for millions, B for billions, and T for trillion.\n */\n public truncate?: boolean = true;\n\n /**\n * Specifies the starting point after which numbers are shortened to rounded numbers\n * and abbreviation characters.\n * @default 0\n */\n public truncateAfter?: number = 0;\n}\n"]}
@@ -0,0 +1,83 @@
1
+ import { Pipe, ChangeDetectorRef, } from '@angular/core';
2
+ import { SkyAppLocaleProvider } from '@skyux/i18n';
3
+ import { takeUntil } from 'rxjs/operators';
4
+ import { Subject } from 'rxjs';
5
+ import { SkyNumericService } from './numeric.service';
6
+ import { NumericOptions } from './numeric.options';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "@skyux/i18n";
9
+ import * as i2 from "./numeric.service";
10
+ /**
11
+ * Shortens numbers to rounded numbers and abbreviation characters such as K for thousands,
12
+ * M for millions, B for billions, and T for trillions. The pipe also formats for currency.
13
+ * Be sure you have a space after the two curly brackets opening the pipe and
14
+ * a space before the two curly brackets closing the pipe or it will not work.
15
+ * Usage:
16
+ * ```
17
+ * {{ value | skyNumeric(config) }}
18
+ * ```
19
+ */
20
+ export class SkyNumericPipe {
21
+ constructor(localeProvider, numericService, changeDetector) {
22
+ this.localeProvider = localeProvider;
23
+ this.numericService = numericService;
24
+ this.changeDetector = changeDetector;
25
+ this.ngUnsubscribe = new Subject();
26
+ this.localeProvider
27
+ .getLocaleInfo()
28
+ .pipe(takeUntil(this.ngUnsubscribe))
29
+ .subscribe((localeInfo) => {
30
+ this.providerLocale = localeInfo.locale;
31
+ numericService.currentLocale = this.providerLocale;
32
+ this.changeDetector.markForCheck();
33
+ });
34
+ }
35
+ ngOnDestroy() {
36
+ this.ngUnsubscribe.next();
37
+ this.ngUnsubscribe.complete();
38
+ }
39
+ transform(value, config) {
40
+ var _a;
41
+ let newCacheKey = (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +
42
+ `${value}_${(config === null || config === void 0 ? void 0 : config.locale) || this.providerLocale}`;
43
+ /* If the value and locale are the same as the last transform then return the previous value
44
+ instead of reformatting. */
45
+ if (this.formattedValue && this.cacheKey === newCacheKey) {
46
+ return this.formattedValue;
47
+ }
48
+ const options = new NumericOptions();
49
+ // The default number of digits is `1`. When truncate is disabled, set digits
50
+ // to `0` to avoid the unnecessary addition of `.0` at the end of the formatted number.
51
+ if (config && config.truncate === false && config.digits === undefined) {
52
+ options.digits = 0;
53
+ }
54
+ // If the minimum digits is less than the set maximum digits then throw an error
55
+ if (config &&
56
+ config.minDigits &&
57
+ config.digits &&
58
+ config.minDigits > config.digits) {
59
+ throw new Error('The `digits` property must be greater than or equal to the `minDigits` property');
60
+ // If there is a minimum digits given but not a maximum then default the maximum to the minimum
61
+ }
62
+ else if (config && config.minDigits && !config.digits) {
63
+ options.digits = config.minDigits;
64
+ }
65
+ Object.assign(options, config);
66
+ // Assign properties for proper result caching.
67
+ this.rawValue = value;
68
+ this.lastTransformLocale = (_a = config === null || config === void 0 ? void 0 : config.locale) !== null && _a !== void 0 ? _a : this.providerLocale;
69
+ this.cacheKey = newCacheKey;
70
+ this.formattedValue = this.numericService.formatNumber(value, options);
71
+ return this.formattedValue;
72
+ }
73
+ }
74
+ SkyNumericPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericPipe, deps: [{ token: i1.SkyAppLocaleProvider }, { token: i2.SkyNumericService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
75
+ SkyNumericPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericPipe, name: "skyNumeric", pure: false });
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericPipe, decorators: [{
77
+ type: Pipe,
78
+ args: [{
79
+ name: 'skyNumeric',
80
+ pure: false,
81
+ }]
82
+ }], ctorParameters: function () { return [{ type: i1.SkyAppLocaleProvider }, { type: i2.SkyNumericService }, { type: i0.ChangeDetectorRef }]; } });
83
+ //# sourceMappingURL=numeric.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"numeric.pipe.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/numeric/numeric.pipe.ts"],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IAC7B,CAAC;;4GAzEU,cAAc;0GAAd,cAAc;4FAAd,cAAc;kBAJ1B,IAAI;mBAAC;oBACJ,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,KAAK;iBACZ","sourcesContent":["import {\n Pipe,\n PipeTransform,\n OnDestroy,\n ChangeDetectorRef,\n} from '@angular/core';\n\nimport { SkyAppLocaleProvider } from '@skyux/i18n';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { Subject } from 'rxjs';\n\nimport { SkyNumericService } from './numeric.service';\n\nimport { NumericOptions } from './numeric.options';\n\n/**\n * Shortens numbers to rounded numbers and abbreviation characters such as K for thousands,\n * M for millions, B for billions, and T for trillions. The pipe also formats for currency.\n * Be sure you have a space after the two curly brackets opening the pipe and\n * a space before the two curly brackets closing the pipe or it will not work.\n * Usage:\n * ```\n * {{ value | skyNumeric(config) }}\n * ```\n */\n@Pipe({\n name: 'skyNumeric',\n pure: false,\n})\nexport class SkyNumericPipe implements PipeTransform, OnDestroy {\n private cacheKey: string;\n private formattedValue: string;\n private lastTransformLocale: string;\n private rawValue: number;\n private providerLocale: string;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(\n private localeProvider: SkyAppLocaleProvider,\n private readonly numericService: SkyNumericService,\n private changeDetector: ChangeDetectorRef\n ) {\n this.localeProvider\n .getLocaleInfo()\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((localeInfo) => {\n this.providerLocale = localeInfo.locale;\n numericService.currentLocale = this.providerLocale;\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public transform(value: number, config?: NumericOptions): string {\n let newCacheKey =\n (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +\n `${value}_${config?.locale || this.providerLocale}`;\n\n /* If the value and locale are the same as the last transform then return the previous value\n instead of reformatting. */\n if (this.formattedValue && this.cacheKey === newCacheKey) {\n return this.formattedValue;\n }\n\n const options = new NumericOptions();\n\n // The default number of digits is `1`. When truncate is disabled, set digits\n // to `0` to avoid the unnecessary addition of `.0` at the end of the formatted number.\n if (config && config.truncate === false && config.digits === undefined) {\n options.digits = 0;\n }\n\n // If the minimum digits is less than the set maximum digits then throw an error\n if (\n config &&\n config.minDigits &&\n config.digits &&\n config.minDigits > config.digits\n ) {\n throw new Error(\n 'The `digits` property must be greater than or equal to the `minDigits` property'\n );\n\n // If there is a minimum digits given but not a maximum then default the maximum to the minimum\n } else if (config && config.minDigits && !config.digits) {\n options.digits = config.minDigits;\n }\n\n Object.assign(options, config);\n\n // Assign properties for proper result caching.\n this.rawValue = value;\n this.lastTransformLocale = config?.locale ?? this.providerLocale;\n this.cacheKey = newCacheKey;\n\n this.formattedValue = this.numericService.formatNumber(value, options);\n return this.formattedValue;\n }\n}\n"]}
@@ -0,0 +1,188 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { SkyIntlNumberFormatStyle, SkyLibResourcesService } from '@skyux/i18n';
3
+ import { SkyNumberFormatUtility } from '../shared/number-format/number-format-utility';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@skyux/i18n";
6
+ export class SkyNumericService {
7
+ constructor(resourcesService) {
8
+ this.resourcesService = resourcesService;
9
+ this.symbolIndex = [
10
+ { value: 1e12, label: this.getSymbol('skyux_numeric_trillions_symbol') },
11
+ { value: 1e9, label: this.getSymbol('skyux_numeric_billions_symbol') },
12
+ { value: 1e6, label: this.getSymbol('skyux_numeric_millions_symbol') },
13
+ { value: 1e3, label: this.getSymbol('skyux_numeric_thousands_symbol') },
14
+ ];
15
+ }
16
+ /**
17
+ * The browser's current locale.
18
+ * @internal
19
+ */
20
+ set currentLocale(value) {
21
+ this._locale = value;
22
+ }
23
+ get currentLocale() {
24
+ return this._locale || 'en-US';
25
+ }
26
+ /**
27
+ * Shortens with or without symbol (K/M/B/T) depending on value of number.
28
+ * @param value The number to format.
29
+ * @param options Format options.
30
+ */
31
+ formatNumber(value, options) {
32
+ var _a;
33
+ /* tslint:disable-next-line:no-null-keyword */
34
+ if (isNaN(value) || value === null) {
35
+ return '';
36
+ }
37
+ const decimalPlaceRegExp = /\.0+$|(\.[0-9]*[1-9])0+$/;
38
+ // Get the symbol for the number after rounding, since rounding could push the number
39
+ // into a different symbol range.
40
+ let roundedNumber = this.roundNumber(value, options.digits);
41
+ let roundedNumberAbs = Math.abs(roundedNumber);
42
+ let suffix = '';
43
+ for (let i = 0; i < this.symbolIndex.length; i++) {
44
+ let symbol = this.symbolIndex[i];
45
+ if (options.truncate &&
46
+ roundedNumberAbs >= options.truncateAfter &&
47
+ roundedNumberAbs >= symbol.value) {
48
+ roundedNumber = this.roundNumber(value / symbol.value, options.digits);
49
+ if (Math.abs(roundedNumber) === 1000 && i > 0) {
50
+ // Rounding caused the number to cross into the range of the next symbol.
51
+ symbol = this.symbolIndex[i - 1];
52
+ roundedNumber /= 1000;
53
+ }
54
+ suffix = symbol.label;
55
+ break;
56
+ }
57
+ }
58
+ let output = roundedNumber.toString().replace(decimalPlaceRegExp, '$1') + suffix;
59
+ this.storeShortenSymbol(output);
60
+ const locale = options.locale || this.currentLocale;
61
+ let digits;
62
+ // Checks the string entered for format. Using toLowerCase to ignore case.
63
+ switch ((_a = options.format) === null || _a === void 0 ? void 0 : _a.toLowerCase()) {
64
+ // In a case where a decimal value was not shortened and
65
+ // the digit input is 2 or higher, it forces 2 digits.
66
+ // For example, this prevents a value like $15.50 from displaying as $15.5.
67
+ // Note: This will need to be reviewed if we support currencies with
68
+ // three decimal digits.
69
+ case 'currency':
70
+ const isDecimal = value % 1 !== 0;
71
+ if (options.minDigits) {
72
+ digits = `1.${options.minDigits}-${options.digits}`;
73
+ }
74
+ else if (isDecimal && options.digits >= 2) {
75
+ digits = `1.2-${options.digits}`;
76
+ }
77
+ else {
78
+ digits = `1.0-${options.digits}`;
79
+ }
80
+ // Angular 5+ needs a string for this parameter, but Angular 4 needs a boolean.
81
+ // To support both versions we can supply 'symbol' which will evaluate truthy for Angular 4
82
+ // and the appropriate string value for Angular 5+.
83
+ // See: https://angular.io/api/common/CurrencyPipe#parameters
84
+ const symbolDisplay = 'symbol';
85
+ output = SkyNumberFormatUtility.formatNumber(locale, parseFloat(output), SkyIntlNumberFormatStyle.Currency, digits, options.iso, symbolDisplay, options.currencySign);
86
+ break;
87
+ // The following is a catch-all to ensure that if
88
+ // anything but currency (or a future option) are entered,
89
+ // it will be treated like a number.
90
+ default:
91
+ // Ensures localization of the number to ensure comma and
92
+ // decimal separator
93
+ if (options.minDigits) {
94
+ digits = `1.${options.minDigits}-${options.digits}`;
95
+ }
96
+ else if (options.truncate) {
97
+ digits = `1.0-${options.digits}`;
98
+ }
99
+ else {
100
+ digits = `1.${options.digits}-${options.digits}`;
101
+ }
102
+ output = SkyNumberFormatUtility.formatNumber(locale, parseFloat(output), SkyIntlNumberFormatStyle.Decimal, digits);
103
+ break;
104
+ }
105
+ if (options.truncate) {
106
+ output = this.replaceShortenSymbol(output);
107
+ }
108
+ return output;
109
+ }
110
+ /**
111
+ * Rounds a given number
112
+ *
113
+ * JS's limitation - numbers bigger than Number.MIN_SAFE_INTEGER or Number.MAX_SAFE_INTEGER
114
+ * are not guaranteed to be represented or rounded correctly
115
+ * @param value - value to round
116
+ * @param precision - what precision to round with, defaults to 0 decimal places
117
+ */
118
+ roundNumber(value, precision = 0) {
119
+ if (precision < 0) {
120
+ throw new Error('SkyInvalidArgument: precision must be >= 0');
121
+ }
122
+ /* tslint:disable-next-line:no-null-keyword */
123
+ /* Sanity check - ignoring coverage but should not ignore if we make this method public */
124
+ /* istanbul ignore next */
125
+ if (isNaN(value) || value === null) {
126
+ return 0;
127
+ }
128
+ const scaledValue = this.scaleNumberByPowerOfTen(value, precision, true);
129
+ const scaledRoundedValue = Math.round(scaledValue);
130
+ const unscaledRoundedValue = this.scaleNumberByPowerOfTen(scaledRoundedValue, precision, false);
131
+ return unscaledRoundedValue;
132
+ }
133
+ /**
134
+ * Scales a given number by a power of 10
135
+ * @param value - value to scale
136
+ * @param scalar - 10^scalar
137
+ * @param scaleUp - whether to increase or decrease the value
138
+ */
139
+ scaleNumberByPowerOfTen(value, scalar, scaleUp) {
140
+ const valueStr = value.toString().toLowerCase();
141
+ const isExponentFormat = valueStr.includes('e');
142
+ if (isExponentFormat) {
143
+ const [base, exp] = valueStr.split('e');
144
+ const newExp = scaleUp ? Number(exp) + scalar : Number(exp) - scalar;
145
+ return Number(`${base}e${newExp}`);
146
+ }
147
+ else {
148
+ const e = scaleUp ? 'e' : 'e-';
149
+ return Number(`${value}${e}${scalar}`);
150
+ }
151
+ }
152
+ /**
153
+ * Stores the symbol added from shortening to reapply later.
154
+ * @param value The string to derive the shorten symbol from.
155
+ */
156
+ storeShortenSymbol(value) {
157
+ const symbols = this.symbolIndex.map((s) => s.label);
158
+ const regexp = new RegExp(symbols.join('|'), 'ig');
159
+ const match = value.match(regexp);
160
+ this.shortSymbol = match ? match.toString() : '';
161
+ }
162
+ /**
163
+ * Must have previously called storeShortenSymbol to have something to replace.
164
+ * Finds the last number in the formatted number, gets the index of the position
165
+ * after that character and re-inserts the symbol.
166
+ * Works regardless of currency symbol position.
167
+ * @param value The string to modify.
168
+ */
169
+ replaceShortenSymbol(value) {
170
+ const result = /(\d)(?!.*\d)/g.exec(value);
171
+ const pos = result.index + result.length;
172
+ const output = value.substring(0, pos) + this.shortSymbol + value.substring(pos);
173
+ return output;
174
+ }
175
+ getSymbol(key) {
176
+ // TODO: Need to implement the async `getString` method in a breaking change.
177
+ return this.resourcesService.getStringForLocale({ locale: 'en_US' }, key);
178
+ }
179
+ }
180
+ SkyNumericService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericService, deps: [{ token: i1.SkyLibResourcesService }], target: i0.ɵɵFactoryTarget.Injectable });
181
+ SkyNumericService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericService, providedIn: 'any' });
182
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyNumericService, decorators: [{
183
+ type: Injectable,
184
+ args: [{
185
+ providedIn: 'any',
186
+ }]
187
+ }], ctorParameters: function () { return [{ type: i1.SkyLibResourcesService }]; } });
188
+ //# sourceMappingURL=numeric.service.js.map