@skyux/core 5.2.2 → 5.5.0-beta.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.
- package/README.md +6 -4
- package/bundles/skyux-core-testing.umd.js +6 -6
- package/bundles/skyux-core.umd.js +140 -129
- package/documentation.json +293 -24
- package/esm2015/index.js +60 -0
- package/esm2015/index.js.map +1 -0
- package/esm2015/lib/modules/adapter-service/adapter.module.js +16 -0
- package/esm2015/lib/modules/adapter-service/adapter.module.js.map +1 -0
- package/esm2015/lib/modules/adapter-service/adapter.service.js +218 -0
- package/esm2015/lib/modules/adapter-service/adapter.service.js.map +1 -0
- package/esm2015/lib/modules/adapter-service/focusable-children-options.js +2 -0
- package/esm2015/lib/modules/adapter-service/focusable-children-options.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-auto-fit-context.js +12 -0
- package/esm2015/lib/modules/affix/affix-auto-fit-context.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-config.js +2 -0
- package/esm2015/lib/modules/affix/affix-config.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-horizontal-alignment.js +2 -0
- package/esm2015/lib/modules/affix/affix-horizontal-alignment.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-offset-change.js +2 -0
- package/esm2015/lib/modules/affix/affix-offset-change.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-offset.js +2 -0
- package/esm2015/lib/modules/affix/affix-offset.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-placement-change.js +2 -0
- package/esm2015/lib/modules/affix/affix-placement-change.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-placement.js +2 -0
- package/esm2015/lib/modules/affix/affix-placement.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-utils.js +18 -0
- package/esm2015/lib/modules/affix/affix-utils.js.map +1 -0
- package/esm2015/lib/modules/affix/affix-vertical-alignment.js +2 -0
- package/esm2015/lib/modules/affix/affix-vertical-alignment.js.map +1 -0
- package/esm2015/lib/modules/affix/affix.directive.js +100 -0
- package/esm2015/lib/modules/affix/affix.directive.js.map +1 -0
- package/esm2015/lib/modules/affix/affix.module.js +18 -0
- package/esm2015/lib/modules/affix/affix.module.js.map +1 -0
- package/esm2015/lib/modules/affix/affix.service.js +24 -0
- package/esm2015/lib/modules/affix/affix.service.js.map +1 -0
- package/esm2015/lib/modules/affix/affixer.js +349 -0
- package/esm2015/lib/modules/affix/affixer.js.map +1 -0
- package/esm2015/lib/modules/affix/dom-utils.js +77 -0
- package/esm2015/lib/modules/affix/dom-utils.js.map +1 -0
- package/esm2015/lib/modules/dock/dock-dom-adapter.service.js +80 -0
- package/esm2015/lib/modules/dock/dock-dom-adapter.service.js.map +1 -0
- package/esm2015/lib/modules/dock/dock-insert-component-config.js +2 -0
- package/esm2015/lib/modules/dock/dock-insert-component-config.js.map +1 -0
- package/esm2015/lib/modules/dock/dock-item-config.js +2 -0
- package/esm2015/lib/modules/dock/dock-item-config.js.map +1 -0
- package/esm2015/lib/modules/dock/dock-item-reference.js +2 -0
- package/esm2015/lib/modules/dock/dock-item-reference.js.map +1 -0
- package/esm2015/lib/modules/dock/dock-item.js +29 -0
- package/esm2015/lib/modules/dock/dock-item.js.map +1 -0
- package/esm2015/lib/modules/dock/dock-location.js +19 -0
- package/esm2015/lib/modules/dock/dock-location.js.map +1 -0
- package/esm2015/lib/modules/dock/dock-options.js +2 -0
- package/esm2015/lib/modules/dock/dock-options.js.map +1 -0
- package/esm2015/lib/modules/dock/dock.component.js +95 -0
- package/esm2015/lib/modules/dock/dock.component.js.map +1 -0
- package/esm2015/lib/modules/dock/dock.module.js +20 -0
- package/esm2015/lib/modules/dock/dock.module.js.map +1 -0
- package/esm2015/lib/modules/dock/dock.service.js +92 -0
- package/esm2015/lib/modules/dock/dock.service.js.map +1 -0
- package/esm2015/lib/modules/dock/sort-by-stack-order.js +13 -0
- package/esm2015/lib/modules/dock/sort-by-stack-order.js.map +1 -0
- package/esm2015/lib/modules/dynamic-component/dynamic-component-location.js +27 -0
- package/esm2015/lib/modules/dynamic-component/dynamic-component-location.js.map +1 -0
- package/esm2015/lib/modules/dynamic-component/dynamic-component-options.js +2 -0
- package/esm2015/lib/modules/dynamic-component/dynamic-component-options.js.map +1 -0
- package/esm2015/lib/modules/dynamic-component/dynamic-component.module.js +17 -0
- package/esm2015/lib/modules/dynamic-component/dynamic-component.module.js.map +1 -0
- package/esm2015/lib/modules/dynamic-component/dynamic-component.service.js +83 -0
- package/esm2015/lib/modules/dynamic-component/dynamic-component.service.js.map +1 -0
- package/esm2015/lib/modules/format/app-format.js +18 -0
- package/esm2015/lib/modules/format/app-format.js.map +1 -0
- package/esm2015/lib/modules/id/id.directive.js +34 -0
- package/esm2015/lib/modules/id/id.directive.js.map +1 -0
- package/esm2015/lib/modules/id/id.module.js +16 -0
- package/esm2015/lib/modules/id/id.module.js.map +1 -0
- package/esm2015/lib/modules/log/log.module.js +16 -0
- package/esm2015/lib/modules/log/log.module.js.map +1 -0
- package/esm2015/lib/modules/log/log.service.js +22 -0
- package/esm2015/lib/modules/log/log.service.js.map +1 -0
- package/esm2015/lib/modules/media-query/media-breakpoints.js +20 -0
- package/esm2015/lib/modules/media-query/media-breakpoints.js.map +1 -0
- package/esm2015/lib/modules/media-query/media-query-listener.js +2 -0
- package/esm2015/lib/modules/media-query/media-query-listener.js.map +1 -0
- package/esm2015/lib/modules/media-query/media-query.module.js +16 -0
- package/esm2015/lib/modules/media-query/media-query.module.js.map +1 -0
- package/esm2015/lib/modules/media-query/media-query.service.js +121 -0
- package/esm2015/lib/modules/media-query/media-query.service.js.map +1 -0
- package/esm2015/lib/modules/mutation/mutation-observer-service.js +16 -0
- package/esm2015/lib/modules/mutation/mutation-observer-service.js.map +1 -0
- package/esm2015/lib/modules/numeric/numeric-symbol.js +2 -0
- package/esm2015/lib/modules/numeric/numeric-symbol.js.map +1 -0
- package/esm2015/lib/modules/numeric/numeric.module.js +20 -0
- package/esm2015/lib/modules/numeric/numeric.module.js.map +1 -0
- package/esm2015/lib/modules/numeric/numeric.options.js +41 -0
- package/esm2015/lib/modules/numeric/numeric.options.js.map +1 -0
- package/esm2015/lib/modules/numeric/numeric.pipe.js +83 -0
- package/esm2015/lib/modules/numeric/numeric.pipe.js.map +1 -0
- package/esm2015/lib/modules/numeric/numeric.service.js +188 -0
- package/esm2015/lib/modules/numeric/numeric.service.js.map +1 -0
- package/esm2015/lib/modules/overlay/overlay-adapter.service.js +41 -0
- package/esm2015/lib/modules/overlay/overlay-adapter.service.js.map +1 -0
- package/esm2015/lib/modules/overlay/overlay-config.js +2 -0
- package/esm2015/lib/modules/overlay/overlay-config.js.map +1 -0
- package/esm2015/lib/modules/overlay/overlay-context.js +10 -0
- package/esm2015/lib/modules/overlay/overlay-context.js.map +1 -0
- package/esm2015/lib/modules/overlay/overlay-instance.js +55 -0
- package/esm2015/lib/modules/overlay/overlay-instance.js.map +1 -0
- package/esm2015/lib/modules/overlay/overlay.component.js +154 -0
- package/esm2015/lib/modules/overlay/overlay.component.js.map +1 -0
- package/esm2015/lib/modules/overlay/overlay.module.js +18 -0
- package/esm2015/lib/modules/overlay/overlay.module.js.map +1 -0
- package/esm2015/lib/modules/overlay/overlay.service.js +120 -0
- package/esm2015/lib/modules/overlay/overlay.service.js.map +1 -0
- package/esm2015/lib/modules/percent-pipe/percent-pipe.module.js +20 -0
- package/esm2015/lib/modules/percent-pipe/percent-pipe.module.js.map +1 -0
- package/esm2015/lib/modules/percent-pipe/percent.pipe.js +48 -0
- package/esm2015/lib/modules/percent-pipe/percent.pipe.js.map +1 -0
- package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js +163 -0
- package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js.map +1 -0
- package/esm2015/lib/modules/shared/number-format/number-format-utility.js +74 -0
- package/esm2015/lib/modules/shared/number-format/number-format-utility.js.map +1 -0
- package/esm2015/lib/modules/shared/sky-core-resources.module.js +50 -0
- package/esm2015/lib/modules/shared/sky-core-resources.module.js.map +1 -0
- package/esm2015/lib/modules/title/set-title-args.js +2 -0
- package/esm2015/lib/modules/title/set-title-args.js.map +1 -0
- package/esm2015/lib/modules/title/title.service.js +31 -0
- package/esm2015/lib/modules/title/title.service.js.map +1 -0
- package/esm2015/lib/modules/ui-config/ui-config.service.js +21 -0
- package/esm2015/lib/modules/ui-config/ui-config.service.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-boundary-info.js +2 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-boundary-info.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-fixed-styles.js +2 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-fixed-styles.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-host-options.js +10 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-host-options.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-offset.js +2 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-offset.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-options.js +2 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper-options.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper.directive.js +116 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper.directive.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper.js +254 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper.module.js +16 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper.module.js.map +1 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper.service.js +39 -0
- package/esm2015/lib/modules/viewkeeper/viewkeeper.service.js.map +1 -0
- package/esm2015/lib/modules/window/window-ref.js +30 -0
- package/esm2015/lib/modules/window/window-ref.js.map +1 -0
- package/esm2015/skyux-core.js +2 -2
- package/esm2015/skyux-core.js.map +1 -0
- package/esm2015/testing/mock-media-query.service.js +4 -4
- package/esm2015/testing/mock-media-query.service.js.map +1 -0
- package/esm2015/testing/mock-ui-config.service.js +4 -4
- package/esm2015/testing/mock-ui-config.service.js.map +1 -0
- package/esm2015/testing/public-api.js +1 -1
- package/esm2015/testing/public-api.js.map +1 -0
- package/esm2015/testing/skyux-core-testing.js +1 -1
- package/esm2015/testing/skyux-core-testing.js.map +1 -0
- package/fesm2015/skyux-core-testing.js +6 -6
- package/fesm2015/skyux-core-testing.js.map +1 -1
- package/fesm2015/skyux-core.js +179 -168
- package/fesm2015/skyux-core.js.map +1 -1
- package/index.d.ts +57 -0
- package/{modules → lib/modules}/adapter-service/adapter.module.d.ts +0 -0
- package/{modules → lib/modules}/adapter-service/adapter.service.d.ts +0 -0
- package/{modules → lib/modules}/adapter-service/focusable-children-options.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-auto-fit-context.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-config.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-horizontal-alignment.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-offset-change.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-offset.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-placement-change.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-placement.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-utils.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix-vertical-alignment.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix.directive.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix.module.d.ts +0 -0
- package/{modules → lib/modules}/affix/affix.service.d.ts +0 -0
- package/{modules → lib/modules}/affix/affixer.d.ts +0 -0
- package/{modules → lib/modules}/affix/dom-utils.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock-dom-adapter.service.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock-insert-component-config.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock-item-config.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock-item-reference.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock-item.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock-location.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock-options.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock.component.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock.module.d.ts +0 -0
- package/{modules → lib/modules}/dock/dock.service.d.ts +0 -0
- package/{modules → lib/modules}/dock/sort-by-stack-order.d.ts +0 -0
- package/{modules → lib/modules}/dynamic-component/dynamic-component-location.d.ts +0 -0
- package/{modules → lib/modules}/dynamic-component/dynamic-component-options.d.ts +0 -0
- package/{modules → lib/modules}/dynamic-component/dynamic-component.module.d.ts +0 -0
- package/{modules → lib/modules}/dynamic-component/dynamic-component.service.d.ts +0 -0
- package/{modules → lib/modules}/format/app-format.d.ts +0 -0
- package/{modules → lib/modules}/id/id.directive.d.ts +0 -0
- package/{modules → lib/modules}/id/id.module.d.ts +0 -0
- package/{modules → lib/modules}/log/log.module.d.ts +0 -0
- package/{modules → lib/modules}/log/log.service.d.ts +0 -0
- package/{modules → lib/modules}/media-query/media-breakpoints.d.ts +0 -0
- package/{modules → lib/modules}/media-query/media-query-listener.d.ts +0 -0
- package/{modules → lib/modules}/media-query/media-query.module.d.ts +0 -0
- package/{modules → lib/modules}/media-query/media-query.service.d.ts +4 -0
- package/{modules → lib/modules}/mutation/mutation-observer-service.d.ts +0 -0
- package/{modules → lib/modules}/numeric/numeric-symbol.d.ts +0 -0
- package/{modules → lib/modules}/numeric/numeric.module.d.ts +0 -0
- package/{modules → lib/modules}/numeric/numeric.options.d.ts +2 -2
- package/{modules → lib/modules}/numeric/numeric.pipe.d.ts +2 -2
- package/{modules → lib/modules}/numeric/numeric.service.d.ts +0 -0
- package/{modules → lib/modules}/overlay/overlay-adapter.service.d.ts +0 -0
- package/{modules → lib/modules}/overlay/overlay-config.d.ts +0 -0
- package/{modules → lib/modules}/overlay/overlay-context.d.ts +0 -0
- package/{modules → lib/modules}/overlay/overlay-instance.d.ts +0 -0
- package/{modules → lib/modules}/overlay/overlay.component.d.ts +0 -0
- package/{modules → lib/modules}/overlay/overlay.module.d.ts +0 -0
- package/{modules → lib/modules}/overlay/overlay.service.d.ts +0 -0
- package/{modules → lib/modules}/percent-pipe/percent-pipe.module.d.ts +0 -0
- package/{modules → lib/modules}/percent-pipe/percent.pipe.d.ts +0 -0
- package/{modules → lib/modules}/scrollable-host/scrollable-host.service.d.ts +0 -0
- package/{modules → lib/modules}/shared/number-format/number-format-utility.d.ts +0 -0
- package/{modules → lib/modules}/shared/sky-core-resources.module.d.ts +0 -0
- package/{modules → lib/modules}/title/set-title-args.d.ts +0 -0
- package/{modules → lib/modules}/title/title.service.d.ts +0 -0
- package/{modules → lib/modules}/ui-config/ui-config.service.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper-boundary-info.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper-fixed-styles.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper-host-options.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper-offset.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper-options.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper.directive.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper.module.d.ts +0 -0
- package/{modules → lib/modules}/viewkeeper/viewkeeper.service.d.ts +0 -0
- package/{modules → lib/modules}/window/window-ref.d.ts +0 -0
- package/package.json +19 -5
- package/skyux-core.d.ts +1 -1
- package/LICENSE +0 -21
- package/bundles/skyux-core-testing.umd.js.map +0 -1
- package/bundles/skyux-core.umd.js.map +0 -1
- package/esm2015/modules/adapter-service/adapter.module.js +0 -16
- package/esm2015/modules/adapter-service/adapter.service.js +0 -218
- package/esm2015/modules/adapter-service/focusable-children-options.js +0 -2
- package/esm2015/modules/affix/affix-auto-fit-context.js +0 -12
- package/esm2015/modules/affix/affix-config.js +0 -2
- package/esm2015/modules/affix/affix-horizontal-alignment.js +0 -2
- package/esm2015/modules/affix/affix-offset-change.js +0 -2
- package/esm2015/modules/affix/affix-offset.js +0 -2
- package/esm2015/modules/affix/affix-placement-change.js +0 -2
- package/esm2015/modules/affix/affix-placement.js +0 -2
- package/esm2015/modules/affix/affix-utils.js +0 -18
- package/esm2015/modules/affix/affix-vertical-alignment.js +0 -2
- package/esm2015/modules/affix/affix.directive.js +0 -98
- package/esm2015/modules/affix/affix.module.js +0 -18
- package/esm2015/modules/affix/affix.service.js +0 -24
- package/esm2015/modules/affix/affixer.js +0 -349
- package/esm2015/modules/affix/dom-utils.js +0 -77
- package/esm2015/modules/dock/dock-dom-adapter.service.js +0 -79
- package/esm2015/modules/dock/dock-insert-component-config.js +0 -2
- package/esm2015/modules/dock/dock-item-config.js +0 -2
- package/esm2015/modules/dock/dock-item-reference.js +0 -2
- package/esm2015/modules/dock/dock-item.js +0 -29
- package/esm2015/modules/dock/dock-location.js +0 -19
- package/esm2015/modules/dock/dock-options.js +0 -2
- package/esm2015/modules/dock/dock.component.js +0 -95
- package/esm2015/modules/dock/dock.module.js +0 -20
- package/esm2015/modules/dock/dock.service.js +0 -91
- package/esm2015/modules/dock/sort-by-stack-order.js +0 -13
- package/esm2015/modules/dynamic-component/dynamic-component-location.js +0 -27
- package/esm2015/modules/dynamic-component/dynamic-component-options.js +0 -2
- package/esm2015/modules/dynamic-component/dynamic-component.module.js +0 -17
- package/esm2015/modules/dynamic-component/dynamic-component.service.js +0 -82
- package/esm2015/modules/format/app-format.js +0 -18
- package/esm2015/modules/id/id.directive.js +0 -34
- package/esm2015/modules/id/id.module.js +0 -16
- package/esm2015/modules/log/log.module.js +0 -16
- package/esm2015/modules/log/log.service.js +0 -22
- package/esm2015/modules/media-query/media-breakpoints.js +0 -20
- package/esm2015/modules/media-query/media-query-listener.js +0 -2
- package/esm2015/modules/media-query/media-query.module.js +0 -16
- package/esm2015/modules/media-query/media-query.service.js +0 -117
- package/esm2015/modules/mutation/mutation-observer-service.js +0 -16
- package/esm2015/modules/numeric/numeric-symbol.js +0 -2
- package/esm2015/modules/numeric/numeric.module.js +0 -20
- package/esm2015/modules/numeric/numeric.options.js +0 -41
- package/esm2015/modules/numeric/numeric.pipe.js +0 -81
- package/esm2015/modules/numeric/numeric.service.js +0 -188
- package/esm2015/modules/overlay/overlay-adapter.service.js +0 -41
- package/esm2015/modules/overlay/overlay-config.js +0 -2
- package/esm2015/modules/overlay/overlay-context.js +0 -10
- package/esm2015/modules/overlay/overlay-instance.js +0 -55
- package/esm2015/modules/overlay/overlay.component.js +0 -152
- package/esm2015/modules/overlay/overlay.module.js +0 -18
- package/esm2015/modules/overlay/overlay.service.js +0 -119
- package/esm2015/modules/percent-pipe/percent-pipe.module.js +0 -20
- package/esm2015/modules/percent-pipe/percent.pipe.js +0 -48
- package/esm2015/modules/scrollable-host/scrollable-host.service.js +0 -154
- package/esm2015/modules/shared/number-format/number-format-utility.js +0 -74
- package/esm2015/modules/shared/sky-core-resources.module.js +0 -50
- package/esm2015/modules/title/set-title-args.js +0 -2
- package/esm2015/modules/title/title.service.js +0 -30
- package/esm2015/modules/ui-config/ui-config.service.js +0 -21
- package/esm2015/modules/viewkeeper/viewkeeper-boundary-info.js +0 -2
- package/esm2015/modules/viewkeeper/viewkeeper-fixed-styles.js +0 -2
- package/esm2015/modules/viewkeeper/viewkeeper-host-options.js +0 -10
- package/esm2015/modules/viewkeeper/viewkeeper-offset.js +0 -2
- package/esm2015/modules/viewkeeper/viewkeeper-options.js +0 -2
- package/esm2015/modules/viewkeeper/viewkeeper.directive.js +0 -113
- package/esm2015/modules/viewkeeper/viewkeeper.js +0 -254
- package/esm2015/modules/viewkeeper/viewkeeper.module.js +0 -16
- package/esm2015/modules/viewkeeper/viewkeeper.service.js +0 -38
- package/esm2015/modules/window/window-ref.js +0 -30
- package/esm2015/public-api.js +0 -60
- package/public-api.d.ts +0 -57
@@ -0,0 +1,163 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import { fromEvent, Observable, Subject } from 'rxjs';
|
3
|
+
import { takeUntil } from 'rxjs/operators';
|
4
|
+
import { MutationObserverService } from '../mutation/mutation-observer-service';
|
5
|
+
import { SkyAppWindowRef } from '../window/window-ref';
|
6
|
+
import * as i0 from "@angular/core";
|
7
|
+
import * as i1 from "../mutation/mutation-observer-service";
|
8
|
+
import * as i2 from "../window/window-ref";
|
9
|
+
function notifySubscribers(subscribers, item) {
|
10
|
+
for (const subscriber of subscribers) {
|
11
|
+
subscriber.next(item);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
export class SkyScrollableHostService {
|
15
|
+
constructor(mutationObserverSvc, windowRef) {
|
16
|
+
this.mutationObserverSvc = mutationObserverSvc;
|
17
|
+
this.windowRef = windowRef;
|
18
|
+
}
|
19
|
+
/**
|
20
|
+
* Returns the given element's current scrollable host
|
21
|
+
* @param elementRef The element whose scrollable host is being requested
|
22
|
+
* @returns The current scrollable host
|
23
|
+
*/
|
24
|
+
getScrollableHost(elementRef) {
|
25
|
+
return this.findScrollableHost(elementRef.nativeElement);
|
26
|
+
}
|
27
|
+
/**
|
28
|
+
* Returns an observable which emits the given element's current scrollable host
|
29
|
+
* @param elementRef The element whose scrollable host is being requested
|
30
|
+
* @param completionObservable An observable which alerts the internal observers that they should complete
|
31
|
+
* @returns An observable which emits the current scrollable host
|
32
|
+
* @internal
|
33
|
+
*/
|
34
|
+
watchScrollableHost(elementRef) {
|
35
|
+
let subscribers = [];
|
36
|
+
let mutationObserver;
|
37
|
+
return new Observable((subscriber) => {
|
38
|
+
subscribers.push(subscriber);
|
39
|
+
let scrollableHost = this.findScrollableHost(elementRef.nativeElement);
|
40
|
+
if (subscribers.length === 1) {
|
41
|
+
mutationObserver = this.mutationObserverSvc.create(() => {
|
42
|
+
let newScrollableHost = this.findScrollableHost(elementRef.nativeElement);
|
43
|
+
if (newScrollableHost !== scrollableHost) {
|
44
|
+
scrollableHost = newScrollableHost;
|
45
|
+
this.observeForScrollableHostChanges(scrollableHost, mutationObserver);
|
46
|
+
notifySubscribers(subscribers, scrollableHost);
|
47
|
+
}
|
48
|
+
});
|
49
|
+
this.observeForScrollableHostChanges(scrollableHost, mutationObserver);
|
50
|
+
}
|
51
|
+
subscriber.next(scrollableHost);
|
52
|
+
subscriber.add(() => {
|
53
|
+
const subIndex = subscribers.indexOf(subscriber);
|
54
|
+
/* sanity check */
|
55
|
+
/* istanbul ignore else */
|
56
|
+
if (subIndex >= 0) {
|
57
|
+
subscribers.splice(subIndex, 1);
|
58
|
+
}
|
59
|
+
if (subscribers.length === 0) {
|
60
|
+
mutationObserver.disconnect();
|
61
|
+
}
|
62
|
+
});
|
63
|
+
});
|
64
|
+
}
|
65
|
+
/**
|
66
|
+
* Returns an observable which emits whenever the element's scrollable host emits a scroll event. The observable will always emit the scroll events from the elements current scrollable host and will update based on any scrollable host changes. The observable will also emit once whenever the scrollable host changes.
|
67
|
+
* @param elementRef The element whose scrollable host scroll events are being requested
|
68
|
+
* @param completionObservable An observable which alerts the internal observers that they should complete
|
69
|
+
* @returns An observable which emits the scroll events from the given element's scrollable host
|
70
|
+
*/
|
71
|
+
watchScrollableHostScrollEvents(elementRef) {
|
72
|
+
let subscribers = [];
|
73
|
+
let scrollableHost;
|
74
|
+
let newScrollableHostObservable = new Subject();
|
75
|
+
let scrollableHostSubscription;
|
76
|
+
let scrollEventSubscription;
|
77
|
+
return new Observable((subscriber) => {
|
78
|
+
subscribers.push(subscriber);
|
79
|
+
if (subscribers.length === 1) {
|
80
|
+
scrollableHostSubscription = this.watchScrollableHost(elementRef).subscribe((newScrollableHost) => {
|
81
|
+
newScrollableHostObservable.next();
|
82
|
+
newScrollableHostObservable.complete();
|
83
|
+
if (scrollableHost && scrollableHost !== newScrollableHost) {
|
84
|
+
notifySubscribers(subscribers);
|
85
|
+
}
|
86
|
+
scrollableHost = newScrollableHost;
|
87
|
+
newScrollableHostObservable = new Subject();
|
88
|
+
scrollEventSubscription = fromEvent(newScrollableHost, 'scroll')
|
89
|
+
.pipe(takeUntil(newScrollableHostObservable))
|
90
|
+
.subscribe(() => {
|
91
|
+
notifySubscribers(subscribers);
|
92
|
+
});
|
93
|
+
});
|
94
|
+
}
|
95
|
+
subscriber.add(() => {
|
96
|
+
const subIndex = subscribers.indexOf(subscriber);
|
97
|
+
/* sanity check */
|
98
|
+
/* istanbul ignore else */
|
99
|
+
if (subIndex >= 0) {
|
100
|
+
subscribers.splice(subIndex, 1);
|
101
|
+
}
|
102
|
+
if (subscribers.length === 0) {
|
103
|
+
scrollableHostSubscription.unsubscribe();
|
104
|
+
scrollEventSubscription.unsubscribe();
|
105
|
+
newScrollableHostObservable.complete();
|
106
|
+
}
|
107
|
+
});
|
108
|
+
});
|
109
|
+
}
|
110
|
+
findScrollableHost(element) {
|
111
|
+
const regex = /(auto|scroll)/;
|
112
|
+
const windowObj = this.windowRef.nativeWindow;
|
113
|
+
const bodyObj = windowObj.document.body;
|
114
|
+
/* Sanity check */
|
115
|
+
if (!element) {
|
116
|
+
return windowObj;
|
117
|
+
}
|
118
|
+
let style = windowObj.getComputedStyle(element);
|
119
|
+
let parent = element;
|
120
|
+
do {
|
121
|
+
parent = parent.parentNode;
|
122
|
+
/* Sanity check for if this function is called for an element which has been removed from the DOM */
|
123
|
+
if (!(parent instanceof HTMLElement)) {
|
124
|
+
return windowObj;
|
125
|
+
}
|
126
|
+
style = windowObj.getComputedStyle(parent);
|
127
|
+
} while (!regex.test(style.overflow) &&
|
128
|
+
!regex.test(style.overflowY) &&
|
129
|
+
parent !== bodyObj);
|
130
|
+
if (parent === bodyObj) {
|
131
|
+
return windowObj;
|
132
|
+
}
|
133
|
+
return parent;
|
134
|
+
}
|
135
|
+
observeForScrollableHostChanges(element, mutationObserver) {
|
136
|
+
mutationObserver.disconnect();
|
137
|
+
if (element instanceof HTMLElement) {
|
138
|
+
mutationObserver.observe(element, {
|
139
|
+
attributes: true,
|
140
|
+
attributeFilter: ['class', 'style.overflow', 'style.overflow-y'],
|
141
|
+
childList: true,
|
142
|
+
subtree: true,
|
143
|
+
});
|
144
|
+
}
|
145
|
+
else {
|
146
|
+
mutationObserver.observe(document.documentElement, {
|
147
|
+
attributes: true,
|
148
|
+
attributeFilter: ['class', 'style.overflow', 'style.overflow-y'],
|
149
|
+
childList: true,
|
150
|
+
subtree: true,
|
151
|
+
});
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}
|
155
|
+
SkyScrollableHostService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyScrollableHostService, deps: [{ token: i1.MutationObserverService }, { token: i2.SkyAppWindowRef }], target: i0.ɵɵFactoryTarget.Injectable });
|
156
|
+
SkyScrollableHostService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyScrollableHostService, providedIn: 'root' });
|
157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyScrollableHostService, decorators: [{
|
158
|
+
type: Injectable,
|
159
|
+
args: [{
|
160
|
+
providedIn: 'root',
|
161
|
+
}]
|
162
|
+
}], ctorParameters: function () { return [{ type: i1.MutationObserverService }, { type: i2.SkyAppWindowRef }]; } });
|
163
|
+
//# sourceMappingURL=scrollable-host.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scrollable-host.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/scrollable-host/scrollable-host.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAA4B,MAAM,MAAM,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,eAAe,E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AAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;SAC5C,QACC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC3B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;YAC5B,MAAM,KAAK,OAAO,EAClB;QAEF,IAAI,MAAM,KAAK,OAAO,EAAE;YACtB,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,+BAA+B,CACrC,OAA6B,EAC7B,gBAAkC;QAElC,gBAAgB,CAAC,UAAU,EAAE,CAAC;QAC9B,IAAI,OAAO,YAAY,WAAW,EAAE;YAClC,gBAAgB,CAAC,OAAO,CAAC,OAAO,EAAE;gBAChC,UAAU,EAAE,IAAI;gBAChB,eAAe,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,CAAC;gBAChE,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;SACJ;aAAM;YACL,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,EAAE;gBACjD,UAAU,EAAE,IAAI;gBAChB,eAAe,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,CAAC;gBAChE,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,IAAI;aACd,CAAC,CAAC;SACJ;IACH,CAAC;;sHAlLU,wBAAwB;0HAAxB,wBAAwB,cAFvB,MAAM;4FAEP,wBAAwB;kBAHpC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { ElementRef, Injectable } from '@angular/core';\nimport { fromEvent, Observable, Subject, Subscriber, Subscription } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\nimport { MutationObserverService } from '../mutation/mutation-observer-service';\nimport { SkyAppWindowRef } from '../window/window-ref';\n\nfunction notifySubscribers(subscribers: Subscriber<unknown>[], item?: unknown) {\n for (const subscriber of subscribers) {\n subscriber.next(item);\n }\n}\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyScrollableHostService {\n constructor(\n private mutationObserverSvc: MutationObserverService,\n private windowRef: SkyAppWindowRef\n ) {}\n\n /**\n * Returns the given element's current scrollable host\n * @param elementRef The element whose scrollable host is being requested\n * @returns The current scrollable host\n */\n public getScrollableHost(elementRef: ElementRef): HTMLElement | Window {\n return this.findScrollableHost(elementRef.nativeElement);\n }\n\n /**\n * Returns an observable which emits the given element's current scrollable host\n * @param elementRef The element whose scrollable host is being requested\n * @param completionObservable An observable which alerts the internal observers that they should complete\n * @returns An observable which emits the current scrollable host\n * @internal\n */\n public watchScrollableHost(\n elementRef: ElementRef\n ): Observable<HTMLElement | Window> {\n let subscribers: Subscriber<HTMLElement | Window>[] = [];\n let mutationObserver: MutationObserver;\n\n return new Observable((subscriber) => {\n subscribers.push(subscriber);\n\n let scrollableHost = this.findScrollableHost(elementRef.nativeElement);\n if (subscribers.length === 1) {\n mutationObserver = this.mutationObserverSvc.create(() => {\n let newScrollableHost = this.findScrollableHost(\n elementRef.nativeElement\n );\n\n if (newScrollableHost !== scrollableHost) {\n scrollableHost = newScrollableHost;\n this.observeForScrollableHostChanges(\n scrollableHost,\n mutationObserver\n );\n\n notifySubscribers(subscribers, scrollableHost);\n }\n });\n this.observeForScrollableHostChanges(scrollableHost, mutationObserver);\n }\n subscriber.next(scrollableHost);\n\n subscriber.add(() => {\n const subIndex = subscribers.indexOf(subscriber);\n\n /* sanity check */\n /* istanbul ignore else */\n if (subIndex >= 0) {\n subscribers.splice(subIndex, 1);\n }\n\n if (subscribers.length === 0) {\n mutationObserver.disconnect();\n }\n });\n });\n }\n\n /**\n * Returns an observable which emits whenever the element's scrollable host emits a scroll event. The observable will always emit the scroll events from the elements current scrollable host and will update based on any scrollable host changes. The observable will also emit once whenever the scrollable host changes.\n * @param elementRef The element whose scrollable host scroll events are being requested\n * @param completionObservable An observable which alerts the internal observers that they should complete\n * @returns An observable which emits the scroll events from the given element's scrollable host\n */\n public watchScrollableHostScrollEvents(\n elementRef: ElementRef\n ): Observable<void> {\n let subscribers: Subscriber<void>[] = [];\n let scrollableHost: HTMLElement | Window;\n\n let newScrollableHostObservable = new Subject();\n let scrollableHostSubscription: Subscription;\n let scrollEventSubscription: Subscription;\n return new Observable((subscriber) => {\n subscribers.push(subscriber);\n\n if (subscribers.length === 1) {\n scrollableHostSubscription = this.watchScrollableHost(\n elementRef\n ).subscribe((newScrollableHost) => {\n newScrollableHostObservable.next();\n newScrollableHostObservable.complete();\n if (scrollableHost && scrollableHost !== newScrollableHost) {\n notifySubscribers(subscribers);\n }\n scrollableHost = newScrollableHost;\n newScrollableHostObservable = new Subject();\n scrollEventSubscription = fromEvent(newScrollableHost, 'scroll')\n .pipe(takeUntil(newScrollableHostObservable))\n .subscribe(() => {\n notifySubscribers(subscribers);\n });\n });\n }\n\n subscriber.add(() => {\n const subIndex = subscribers.indexOf(subscriber);\n\n /* sanity check */\n /* istanbul ignore else */\n if (subIndex >= 0) {\n subscribers.splice(subIndex, 1);\n }\n\n if (subscribers.length === 0) {\n scrollableHostSubscription.unsubscribe();\n scrollEventSubscription.unsubscribe();\n newScrollableHostObservable.complete();\n }\n });\n });\n }\n\n private findScrollableHost(element: HTMLElement): HTMLElement | Window {\n const regex = /(auto|scroll)/;\n const windowObj = this.windowRef.nativeWindow;\n const bodyObj = windowObj.document.body;\n\n /* Sanity check */\n if (!element) {\n return windowObj;\n }\n\n let style = windowObj.getComputedStyle(element);\n let parent: HTMLElement = element;\n\n do {\n parent = <HTMLElement>parent.parentNode;\n\n /* Sanity check for if this function is called for an element which has been removed from the DOM */\n if (!(parent instanceof HTMLElement)) {\n return windowObj;\n }\n\n style = windowObj.getComputedStyle(parent);\n } while (\n !regex.test(style.overflow) &&\n !regex.test(style.overflowY) &&\n parent !== bodyObj\n );\n\n if (parent === bodyObj) {\n return windowObj;\n }\n\n return parent;\n }\n\n private observeForScrollableHostChanges(\n element: HTMLElement | Window,\n mutationObserver: MutationObserver\n ) {\n mutationObserver.disconnect();\n if (element instanceof HTMLElement) {\n mutationObserver.observe(element, {\n attributes: true,\n attributeFilter: ['class', 'style.overflow', 'style.overflow-y'],\n childList: true,\n subtree: true,\n });\n } else {\n mutationObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: ['class', 'style.overflow', 'style.overflow-y'],\n childList: true,\n subtree: true,\n });\n }\n }\n}\n"]}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
/* tslint:disable:no-null-keyword */
|
2
|
+
// This file is mostly ported from the Angular 4.x NumberPipe in order to maintain the old
|
3
|
+
// behavior of using the `Intl` API for formatting numbers rather than having to register every
|
4
|
+
// supported locale.
|
5
|
+
// https://github.com/angular/angular/blob/4.4.x/packages/common/src/pipes/number_pipe.ts
|
6
|
+
import { SkyIntlNumberFormatStyle, SkyIntlNumberFormatter } from '@skyux/i18n';
|
7
|
+
function isNumeric(value) {
|
8
|
+
return !isNaN(value - parseFloat(value));
|
9
|
+
}
|
10
|
+
function parseIntAutoRadix(text) {
|
11
|
+
const result = parseInt(text, 10);
|
12
|
+
/* istanbul ignore next */
|
13
|
+
if (isNaN(result)) {
|
14
|
+
throw new Error('Invalid integer literal when parsing ' + text);
|
15
|
+
}
|
16
|
+
return result;
|
17
|
+
}
|
18
|
+
// Need to add the following to classes which contain static methods.
|
19
|
+
// See: https://github.com/ng-packagr/ng-packagr/issues/641
|
20
|
+
// @dynamic
|
21
|
+
export class SkyNumberFormatUtility {
|
22
|
+
/* istanbul ignore next */
|
23
|
+
constructor() { }
|
24
|
+
static formatNumber(locale, value, style, digits, currency = null, currencyAsSymbol = false, currencySign) {
|
25
|
+
if (value == null) {
|
26
|
+
return null;
|
27
|
+
}
|
28
|
+
// Convert strings to numbers
|
29
|
+
value = typeof value === 'string' && isNumeric(value) ? +value : value;
|
30
|
+
if (typeof value !== 'number') {
|
31
|
+
throw Error(`SkyInvalidPipeArgument: '${value}'`);
|
32
|
+
}
|
33
|
+
let minInt = undefined;
|
34
|
+
let minFraction = undefined;
|
35
|
+
let maxFraction = undefined;
|
36
|
+
if (style !== SkyIntlNumberFormatStyle.Currency) {
|
37
|
+
// rely on Intl default for currency
|
38
|
+
minInt = 1;
|
39
|
+
minFraction = 0;
|
40
|
+
maxFraction = 3;
|
41
|
+
}
|
42
|
+
if (digits) {
|
43
|
+
const parts = digits.match(this._NUMBER_FORMAT_REGEXP);
|
44
|
+
if (parts === null) {
|
45
|
+
throw new Error(`${digits} is not a valid digit info for number pipes`);
|
46
|
+
}
|
47
|
+
/* istanbul ignore else */
|
48
|
+
if (parts[1] != null) {
|
49
|
+
// min integer digits
|
50
|
+
minInt = parseIntAutoRadix(parts[1]);
|
51
|
+
}
|
52
|
+
/* istanbul ignore else */
|
53
|
+
if (parts[3] != null) {
|
54
|
+
// min fraction digits
|
55
|
+
minFraction = parseIntAutoRadix(parts[3]);
|
56
|
+
}
|
57
|
+
/* istanbul ignore else */
|
58
|
+
if (parts[5] != null) {
|
59
|
+
// max fraction digits
|
60
|
+
maxFraction = parseIntAutoRadix(parts[5]);
|
61
|
+
}
|
62
|
+
}
|
63
|
+
return SkyIntlNumberFormatter.format(value, locale, style, {
|
64
|
+
minimumIntegerDigits: minInt,
|
65
|
+
minimumFractionDigits: minFraction,
|
66
|
+
maximumFractionDigits: maxFraction,
|
67
|
+
currency: currency,
|
68
|
+
currencyAsSymbol: currencyAsSymbol,
|
69
|
+
currencySign: currencySign,
|
70
|
+
});
|
71
|
+
}
|
72
|
+
}
|
73
|
+
SkyNumberFormatUtility._NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
|
74
|
+
//# sourceMappingURL=number-format-utility.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"number-format-utility.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/core/src/lib/modules/shared/number-format/number-format-utility.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAEpC,0FAA0F;AAC1F,+FAA+F;AAC/F,oBAA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X,WAAW,GAAG,CAAC,CAAC;YAChB,WAAW,GAAG,CAAC,CAAC;SACjB;QAED,IAAI,MAAM,EAAE;YACV,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;YAEvD,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,6CAA6C,CAAC,CAAC;aACzE;YAED,0BAA0B;YAC1B,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;gBACpB,qBAAqB;gBACrB,MAAM,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aACtC;YAED,0BAA0B;YAC1B,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;gBACpB,sBAAsB;gBACtB,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aAC3C;YAED,0BAA0B;YAC1B,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE;gBACpB,sBAAsB;gBACtB,WAAW,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;aAC3C;SACF;QAED,OAAO,sBAAsB,CAAC,MAAM,CAAC,KAAe,EAAE,MAAM,EAAE,KAAK,EAAE;YACnE,oBAAoB,EAAE,MAAM;YAC5B,qBAAqB,EAAE,WAAW;YAClC,qBAAqB,EAAE,WAAW;YAClC,QAAQ,EAAE,QAAQ;YAClB,gBAAgB,EAAE,gBAAgB;YAClC,YAAY,EAAE,YAAY;SAC3B,CAAC,CAAC;IACL,CAAC;;AApEc,4CAAqB,GAAW,6BAA6B,CAAC","sourcesContent":["/* tslint:disable:no-null-keyword */\n\n// This file is mostly ported from the Angular 4.x NumberPipe in order to maintain the old\n// behavior of using the `Intl` API for formatting numbers rather than having to register every\n// supported locale.\n// https://github.com/angular/angular/blob/4.4.x/packages/common/src/pipes/number_pipe.ts\n\nimport { SkyIntlNumberFormatStyle, SkyIntlNumberFormatter } from '@skyux/i18n';\n\nfunction isNumeric(value: any): boolean {\n return !isNaN(value - parseFloat(value));\n}\n\nfunction parseIntAutoRadix(text: string): number {\n const result: number = parseInt(text, 10);\n\n /* istanbul ignore next */\n if (isNaN(result)) {\n throw new Error('Invalid integer literal when parsing ' + text);\n }\n\n return result;\n}\n\n// Need to add the following to classes which contain static methods.\n// See: https://github.com/ng-packagr/ng-packagr/issues/641\n// @dynamic\nexport class SkyNumberFormatUtility {\n private static _NUMBER_FORMAT_REGEXP: RegExp = /^(\\d+)?\\.((\\d+)(-(\\d+))?)?$/;\n\n /* istanbul ignore next */\n constructor() {}\n\n public static formatNumber(\n locale: string,\n value: number | string,\n style: SkyIntlNumberFormatStyle,\n digits?: string | null,\n currency: string | null = null,\n currencyAsSymbol: boolean = false,\n currencySign?: 'accounting' | 'standard'\n ): string | null {\n if (value == null) {\n return null;\n }\n\n // Convert strings to numbers\n value = typeof value === 'string' && isNumeric(value) ? +value : value;\n if (typeof value !== 'number') {\n throw Error(`SkyInvalidPipeArgument: '${value}'`);\n }\n\n let minInt: number | undefined = undefined;\n let minFraction: number | undefined = undefined;\n let maxFraction: number | undefined = undefined;\n if (style !== SkyIntlNumberFormatStyle.Currency) {\n // rely on Intl default for currency\n minInt = 1;\n minFraction = 0;\n maxFraction = 3;\n }\n\n if (digits) {\n const parts = digits.match(this._NUMBER_FORMAT_REGEXP);\n\n if (parts === null) {\n throw new Error(`${digits} is not a valid digit info for number pipes`);\n }\n\n /* istanbul ignore else */\n if (parts[1] != null) {\n // min integer digits\n minInt = parseIntAutoRadix(parts[1]);\n }\n\n /* istanbul ignore else */\n if (parts[3] != null) {\n // min fraction digits\n minFraction = parseIntAutoRadix(parts[3]);\n }\n\n /* istanbul ignore else */\n if (parts[5] != null) {\n // max fraction digits\n maxFraction = parseIntAutoRadix(parts[5]);\n }\n }\n\n return SkyIntlNumberFormatter.format(value as number, locale, style, {\n minimumIntegerDigits: minInt,\n minimumFractionDigits: minFraction,\n maximumFractionDigits: maxFraction,\n currency: currency,\n currencyAsSymbol: currencyAsSymbol,\n currencySign: currencySign,\n });\n }\n}\n"]}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/**
|
2
|
+
* NOTICE: DO NOT MODIFY THIS FILE!
|
3
|
+
* The contents of this file were automatically generated by
|
4
|
+
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-core' schematic.
|
5
|
+
* To update this file, simply rerun the command.
|
6
|
+
*/
|
7
|
+
import { NgModule } from '@angular/core';
|
8
|
+
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS, } from '@skyux/i18n';
|
9
|
+
import * as i0 from "@angular/core";
|
10
|
+
const RESOURCES = {
|
11
|
+
'EN-US': {
|
12
|
+
skyux_numeric_billions_symbol: { message: 'B' },
|
13
|
+
skyux_numeric_millions_symbol: { message: 'M' },
|
14
|
+
skyux_numeric_thousands_symbol: { message: 'K' },
|
15
|
+
skyux_numeric_trillions_symbol: { message: 'T' },
|
16
|
+
},
|
17
|
+
};
|
18
|
+
export class SkyCoreResourcesProvider {
|
19
|
+
getString(localeInfo, name) {
|
20
|
+
return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
21
|
+
}
|
22
|
+
}
|
23
|
+
/**
|
24
|
+
* Import into any component library module that needs to use resource strings.
|
25
|
+
*/
|
26
|
+
export class SkyCoreResourcesModule {
|
27
|
+
}
|
28
|
+
SkyCoreResourcesModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCoreResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
29
|
+
SkyCoreResourcesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCoreResourcesModule, exports: [SkyI18nModule] });
|
30
|
+
SkyCoreResourcesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCoreResourcesModule, providers: [
|
31
|
+
{
|
32
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
33
|
+
useClass: SkyCoreResourcesProvider,
|
34
|
+
multi: true,
|
35
|
+
},
|
36
|
+
], imports: [SkyI18nModule] });
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyCoreResourcesModule, decorators: [{
|
38
|
+
type: NgModule,
|
39
|
+
args: [{
|
40
|
+
exports: [SkyI18nModule],
|
41
|
+
providers: [
|
42
|
+
{
|
43
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
44
|
+
useClass: SkyCoreResourcesProvider,
|
45
|
+
multi: true,
|
46
|
+
},
|
47
|
+
],
|
48
|
+
}]
|
49
|
+
}] });
|
50
|
+
//# sourceMappingURL=sky-core-resources.module.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"sky-core-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/shared/sky-core-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,qBAAqB,EAErB,aAAa,EAGb,2BAA2B,GAC5B,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,6BAA6B,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QAC/C,6BAA6B,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QAC/C,8BAA8B,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QAChD,8BAA8B,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;KACjD;CACF,CAAC;AAEF,MAAM,OAAO,wBAAwB;IAC5B,SAAS,CAAC,UAA4B,EAAE,IAAY;QACzD,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AAED;;GAEG;AAWH,MAAM,OAAO,sBAAsB;;oHAAtB,sBAAsB;qHAAtB,sBAAsB,YATvB,aAAa;qHASZ,sBAAsB,aARtB;QACT;YACE,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,wBAAwB;YAClC,KAAK,EAAE,IAAI;SACZ;KACF,YAPS,aAAa;4FASZ,sBAAsB;kBAVlC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,wBAAwB;4BAClC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF","sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-core' schematic.\n * To update this file, simply rerun the command.\n */\n\nimport { NgModule } from '@angular/core';\nimport {\n getLibStringForLocale,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n SKY_LIB_RESOURCES_PROVIDERS,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_numeric_billions_symbol: { message: 'B' },\n skyux_numeric_millions_symbol: { message: 'M' },\n skyux_numeric_thousands_symbol: { message: 'K' },\n skyux_numeric_trillions_symbol: { message: 'T' },\n },\n};\n\nexport class SkyCoreResourcesProvider implements SkyLibResourcesProvider {\n public getString(localeInfo: SkyAppLocaleInfo, name: string): string {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyCoreResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyCoreResourcesModule {}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"set-title-args.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/title/set-title-args.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkyAppSetTitleArgs {\n titleParts: string[];\n}\n"]}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import { Title } from '@angular/platform-browser';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
import * as i1 from "@angular/platform-browser";
|
5
|
+
/**
|
6
|
+
* Provides a method for setting a formatted title on the current window.
|
7
|
+
*/
|
8
|
+
export class SkyAppTitleService {
|
9
|
+
constructor(title) {
|
10
|
+
this.title = title;
|
11
|
+
}
|
12
|
+
/**
|
13
|
+
* Sets the title on the current window.
|
14
|
+
* @param args An array of title parts. The parts will be concatenated with a hyphen between
|
15
|
+
* each part.
|
16
|
+
*/
|
17
|
+
setTitle(args) {
|
18
|
+
if (args && args.titleParts) {
|
19
|
+
this.title.setTitle(args.titleParts.join(' - '));
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
SkyAppTitleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppTitleService, deps: [{ token: i1.Title }], target: i0.ɵɵFactoryTarget.Injectable });
|
24
|
+
SkyAppTitleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppTitleService, providedIn: 'root' });
|
25
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyAppTitleService, decorators: [{
|
26
|
+
type: Injectable,
|
27
|
+
args: [{
|
28
|
+
providedIn: 'root',
|
29
|
+
}]
|
30
|
+
}], ctorParameters: function () { return [{ type: i1.Title }]; } });
|
31
|
+
//# sourceMappingURL=title.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"title.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/title/title.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;;;AAIlD;;GAEG;AAIH,MAAM,OAAO,kBAAkB;IAC7B,YAAoB,KAAY;QAAZ,UAAK,GAAL,KAAK,CAAO;IAAG,CAAC;IAEpC;;;;OAIG;IACI,QAAQ,CAAC,IAAwB;QACtC,IAAI,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;YAC3B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;SAClD;IACH,CAAC;;gHAZU,kBAAkB;oHAAlB,kBAAkB,cAFjB,MAAM;4FAEP,kBAAkB;kBAH9B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Title } from '@angular/platform-browser';\n\nimport { SkyAppSetTitleArgs } from './set-title-args';\n\n/**\n * Provides a method for setting a formatted title on the current window.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyAppTitleService {\n constructor(private title: Title) {}\n\n /**\n * Sets the title on the current window.\n * @param args An array of title parts. The parts will be concatenated with a hyphen between\n * each part.\n */\n public setTitle(args: SkyAppSetTitleArgs): void {\n if (args && args.titleParts) {\n this.title.setTitle(args.titleParts.join(' - '));\n }\n }\n}\n"]}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import { of as observableOf } from 'rxjs';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export class SkyUIConfigService {
|
5
|
+
getConfig(key, defaultConfig) {
|
6
|
+
return observableOf(defaultConfig);
|
7
|
+
}
|
8
|
+
/* istanbul ignore next */
|
9
|
+
setConfig(key, value) {
|
10
|
+
return observableOf({});
|
11
|
+
}
|
12
|
+
}
|
13
|
+
SkyUIConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyUIConfigService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
14
|
+
SkyUIConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyUIConfigService, providedIn: 'root' });
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyUIConfigService, decorators: [{
|
16
|
+
type: Injectable,
|
17
|
+
args: [{
|
18
|
+
providedIn: 'root',
|
19
|
+
}]
|
20
|
+
}] });
|
21
|
+
//# sourceMappingURL=ui-config.service.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ui-config.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/ui-config/ui-config.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAc,EAAE,IAAI,YAAY,EAAE,MAAM,MAAM,CAAC;;AAKtD,MAAM,OAAO,kBAAkB;IACtB,SAAS,CAAC,GAAW,EAAE,aAAmB;QAC/C,OAAO,YAAY,CAAC,aAAa,CAAC,CAAC;IACrC,CAAC;IAED,0BAA0B;IACnB,SAAS,CAAC,GAAW,EAAE,KAAU;QACtC,OAAO,YAAY,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;;gHARU,kBAAkB;oHAAlB,kBAAkB,cAFjB,MAAM;4FAEP,kBAAkB;kBAH9B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { Observable, of as observableOf } from 'rxjs';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyUIConfigService {\n public getConfig(key: string, defaultConfig?: any): Observable<any> {\n return observableOf(defaultConfig);\n }\n\n /* istanbul ignore next */\n public setConfig(key: string, value: any): Observable<any> {\n return observableOf({});\n }\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"viewkeeper-boundary-info.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/viewkeeper/viewkeeper-boundary-info.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyViewkeeperOffset } from './viewkeeper-offset';\n\nexport interface SkyViewkeeperBoundaryInfo {\n elHeight: number;\n\n spacerEl: HTMLElement;\n\n spacerId: string;\n\n boundaryBottom: number;\n\n boundaryOffset: SkyViewkeeperOffset;\n\n boundaryEl: HTMLElement;\n\n scrollLeft: number;\n\n scrollTop: number;\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"viewkeeper-fixed-styles.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/viewkeeper/viewkeeper-fixed-styles.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkyViewkeeperFixedStyles {\n elFixedLeft: number;\n\n elFixedTop: number;\n\n elFixedWidth: number;\n}\n"]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Injectable } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export class SkyViewkeeperHostOptions {
|
4
|
+
}
|
5
|
+
SkyViewkeeperHostOptions.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyViewkeeperHostOptions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
6
|
+
SkyViewkeeperHostOptions.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyViewkeeperHostOptions });
|
7
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyViewkeeperHostOptions, decorators: [{
|
8
|
+
type: Injectable
|
9
|
+
}] });
|
10
|
+
//# sourceMappingURL=viewkeeper-host-options.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"viewkeeper-host-options.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/viewkeeper/viewkeeper-host-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;AAK3C,MAAM,OAAO,wBAAwB;;sHAAxB,wBAAwB;0HAAxB,wBAAwB;4FAAxB,wBAAwB;kBADpC,UAAU","sourcesContent":["import { Injectable } from '@angular/core';\n\nimport { SkyViewkeeperOptions } from './viewkeeper-options';\n\n@Injectable()\nexport class SkyViewkeeperHostOptions implements SkyViewkeeperOptions {\n public boundaryEl?: HTMLElement;\n\n public el?: HTMLElement;\n\n public scrollableHost?: HTMLElement;\n\n public setWidth?: boolean;\n\n public verticalOffset?: number;\n\n public verticalOffsetEl?: HTMLElement;\n\n public viewportMarginTop?: number;\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"viewkeeper-offset.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/viewkeeper/viewkeeper-offset.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkyViewkeeperOffset {\n top: number;\n\n left: number;\n}\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"viewkeeper-options.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/viewkeeper/viewkeeper-options.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Options for creating a viewkeeper instance.\n */\nexport interface SkyViewkeeperOptions {\n /**\n * The element that defines the bounds in which to keep the element in view. When the\n * boundary element is scrolled out of view, the viewkeeper element will be scrolled\n * out of view.\n */\n boundaryEl?: HTMLElement;\n\n /**\n * The element to keep in view.\n */\n el?: HTMLElement;\n\n /**\n * Specifies a scrollable parent which the viewkeeper resides in and should listen to and be\n * positioned within.\n */\n scrollableHost?: HTMLElement;\n\n /**\n * Specifies whether to set the width of the viewkeeper element to the width of its\n * host element. Otherwise, if the element does not have an explicit width specified,\n * the element would collapse horizontally as a result of fixing the element to the top\n * of the viewport.\n */\n setWidth?: boolean;\n\n /**\n * Reserved space in pixels above the viewkeeper element.\n */\n verticalOffset?: number;\n\n /**\n * The element under which the viewkeeper element should be fixed. Typically this is\n * another viewkeeper element that is above the current viewkeeper element in the same\n * boundary element.\n */\n verticalOffsetEl?: HTMLElement;\n\n /**\n * Reserved space in pixels at the top of the viewport.\n */\n viewportMarginTop?: number;\n}\n"]}
|
@@ -0,0 +1,116 @@
|
|
1
|
+
import { Directive, ElementRef, Input, Optional, } from '@angular/core';
|
2
|
+
import { Subject } from 'rxjs';
|
3
|
+
import { takeUntil } from 'rxjs/operators';
|
4
|
+
import { MutationObserverService } from '../mutation/mutation-observer-service';
|
5
|
+
import { SkyScrollableHostService } from '../scrollable-host/scrollable-host.service';
|
6
|
+
import { SkyViewkeeperService } from './viewkeeper.service';
|
7
|
+
import * as i0 from "@angular/core";
|
8
|
+
import * as i1 from "../mutation/mutation-observer-service";
|
9
|
+
import * as i2 from "./viewkeeper.service";
|
10
|
+
import * as i3 from "../scrollable-host/scrollable-host.service";
|
11
|
+
export class SkyViewkeeperDirective {
|
12
|
+
constructor(el, mutationObserverSvc, viewkeeperSvc, scrollableHostService) {
|
13
|
+
this.el = el;
|
14
|
+
this.mutationObserverSvc = mutationObserverSvc;
|
15
|
+
this.viewkeeperSvc = viewkeeperSvc;
|
16
|
+
this.scrollableHostService = scrollableHostService;
|
17
|
+
this.viewkeepers = [];
|
18
|
+
this.scrollableHostWatchUnsubscribe = undefined;
|
19
|
+
}
|
20
|
+
set skyViewkeeper(value) {
|
21
|
+
this._skyViewkeeper = value;
|
22
|
+
this.detectElements();
|
23
|
+
}
|
24
|
+
get skyViewkeeper() {
|
25
|
+
return this._skyViewkeeper;
|
26
|
+
}
|
27
|
+
ngOnInit() {
|
28
|
+
this.observer = this.mutationObserverSvc.create(() => this.detectElements());
|
29
|
+
this.observer.observe(this.el.nativeElement, {
|
30
|
+
childList: true,
|
31
|
+
subtree: true,
|
32
|
+
});
|
33
|
+
}
|
34
|
+
ngOnDestroy() {
|
35
|
+
this.observer.disconnect();
|
36
|
+
this.destroyViewkeepers();
|
37
|
+
}
|
38
|
+
destroyViewkeepers() {
|
39
|
+
for (const viewkeeper of this.viewkeepers) {
|
40
|
+
this.viewkeeperSvc.destroy(viewkeeper);
|
41
|
+
}
|
42
|
+
this.viewkeepers = [];
|
43
|
+
}
|
44
|
+
getViewkeeperEls() {
|
45
|
+
let viewkeeperEls;
|
46
|
+
if (this.skyViewkeeper) {
|
47
|
+
viewkeeperEls = [];
|
48
|
+
for (const item of this.skyViewkeeper) {
|
49
|
+
let matchingEls = Array.from(this.el.nativeElement.querySelectorAll(item));
|
50
|
+
viewkeeperEls = [...viewkeeperEls, ...matchingEls];
|
51
|
+
}
|
52
|
+
}
|
53
|
+
return viewkeeperEls;
|
54
|
+
}
|
55
|
+
viewkeeperElsChanged(viewkeeperEls) {
|
56
|
+
if (!viewkeeperEls !== !this.currentViewkeeperEls) {
|
57
|
+
return true;
|
58
|
+
}
|
59
|
+
if (viewkeeperEls && this.currentViewkeeperEls) {
|
60
|
+
if (viewkeeperEls.length !== this.currentViewkeeperEls.length) {
|
61
|
+
return true;
|
62
|
+
}
|
63
|
+
for (let i = 0, n = viewkeeperEls.length; i < n; i++) {
|
64
|
+
if (viewkeeperEls[i] !== this.currentViewkeeperEls[i]) {
|
65
|
+
return true;
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
return false;
|
70
|
+
}
|
71
|
+
detectElements() {
|
72
|
+
let viewkeeperEls = this.getViewkeeperEls();
|
73
|
+
if (this.viewkeeperElsChanged(viewkeeperEls)) {
|
74
|
+
if (this.scrollableHostWatchUnsubscribe) {
|
75
|
+
this.scrollableHostWatchUnsubscribe.next();
|
76
|
+
this.scrollableHostWatchUnsubscribe = new Subject();
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
this.scrollableHostWatchUnsubscribe = new Subject();
|
80
|
+
}
|
81
|
+
this.scrollableHostService
|
82
|
+
.watchScrollableHost(this.el)
|
83
|
+
.pipe(takeUntil(this.scrollableHostWatchUnsubscribe))
|
84
|
+
.subscribe((scrollableHost) => {
|
85
|
+
this.destroyViewkeepers();
|
86
|
+
let previousViewkeeperEl;
|
87
|
+
for (const viewkeeperEl of viewkeeperEls) {
|
88
|
+
this.viewkeepers.push(this.viewkeeperSvc.create({
|
89
|
+
boundaryEl: this.el.nativeElement,
|
90
|
+
scrollableHost: scrollableHost instanceof HTMLElement
|
91
|
+
? scrollableHost
|
92
|
+
: undefined,
|
93
|
+
el: viewkeeperEl,
|
94
|
+
setWidth: true,
|
95
|
+
verticalOffsetEl: previousViewkeeperEl,
|
96
|
+
}));
|
97
|
+
previousViewkeeperEl = viewkeeperEl;
|
98
|
+
}
|
99
|
+
});
|
100
|
+
this.currentViewkeeperEls = viewkeeperEls;
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
SkyViewkeeperDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyViewkeeperDirective, deps: [{ token: i0.ElementRef }, { token: i1.MutationObserverService }, { token: i2.SkyViewkeeperService }, { token: i3.SkyScrollableHostService, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
105
|
+
SkyViewkeeperDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: SkyViewkeeperDirective, selector: "[skyViewkeeper]", inputs: { skyViewkeeper: "skyViewkeeper" }, ngImport: i0 });
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyViewkeeperDirective, decorators: [{
|
107
|
+
type: Directive,
|
108
|
+
args: [{
|
109
|
+
selector: '[skyViewkeeper]',
|
110
|
+
}]
|
111
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1.MutationObserverService }, { type: i2.SkyViewkeeperService }, { type: i3.SkyScrollableHostService, decorators: [{
|
112
|
+
type: Optional
|
113
|
+
}] }]; }, propDecorators: { skyViewkeeper: [{
|
114
|
+
type: Input
|
115
|
+
}] } });
|
116
|
+
//# sourceMappingURL=viewkeeper.directive.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"viewkeeper.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/viewkeeper/viewkeeper.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,KAAK,EAGL,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAItF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;;;;;AAK5D,MAAM,OAAO,sBAAsB;IAsBjC,YACU,EAAc,EACd,mBAA4C,EAC5C,aAAmC,EACvB,qBAA+C;QAH3D,OAAE,GAAF,EAAE,CAAY;QACd,wBAAmB,GAAnB,mBAAmB,CAAyB;QAC5C,kBAAa,GAAb,aAAa,CAAsB;QACvB,0BAAqB,GAArB,qBAAqB,CAA0B;QAZ7D,gBAAW,GAAoB,EAAE,CAAC;QAMlC,mCAA8B,GAA8B,SAAS,CAAC;IAO3E,CAAC;IA1BJ,IACW,aAAa,CAAC,KAAe;QACtC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAE5B,IAAI,CAAC,cAAc,EAAE,CAAC;IACxB,CAAC;IAED,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IAmBM,QAAQ;QACb,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,GAAG,EAAE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rC;YACH,CAAC,CAAC,CAAC;YAEL,IAAI,CAAC,oBAAoB,GAAG,aAAa,CAAC;SAC3C;IACH,CAAC;;oHAnIU,sBAAsB;wGAAtB,sBAAsB;4FAAtB,sBAAsB;kBAHlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,iBAAiB;iBAC5B;;0BA2BI,QAAQ;4CAxBA,aAAa;sBADvB,KAAK","sourcesContent":["import {\n Directive,\n ElementRef,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { MutationObserverService } from '../mutation/mutation-observer-service';\nimport { SkyScrollableHostService } from '../scrollable-host/scrollable-host.service';\n\nimport { SkyViewkeeper } from './viewkeeper';\n\nimport { SkyViewkeeperService } from './viewkeeper.service';\n\n@Directive({\n selector: '[skyViewkeeper]',\n})\nexport class SkyViewkeeperDirective implements OnInit, OnDestroy {\n @Input()\n public set skyViewkeeper(value: string[]) {\n this._skyViewkeeper = value;\n\n this.detectElements();\n }\n\n public get skyViewkeeper(): string[] {\n return this._skyViewkeeper;\n }\n\n private _skyViewkeeper: string[];\n\n private viewkeepers: SkyViewkeeper[] = [];\n\n private observer: MutationObserver;\n\n private currentViewkeeperEls: HTMLElement[];\n\n private scrollableHostWatchUnsubscribe: Subject<void> | undefined = undefined;\n\n constructor(\n private el: ElementRef,\n private mutationObserverSvc: MutationObserverService,\n private viewkeeperSvc: SkyViewkeeperService,\n @Optional() private scrollableHostService: SkyScrollableHostService\n ) {}\n\n public ngOnInit(): void {\n this.observer = this.mutationObserverSvc.create(() =>\n this.detectElements()\n );\n\n this.observer.observe(this.el.nativeElement, {\n childList: true,\n subtree: true,\n });\n }\n\n public ngOnDestroy(): void {\n this.observer.disconnect();\n\n this.destroyViewkeepers();\n }\n\n private destroyViewkeepers(): void {\n for (const viewkeeper of this.viewkeepers) {\n this.viewkeeperSvc.destroy(viewkeeper);\n }\n\n this.viewkeepers = [];\n }\n\n private getViewkeeperEls(): HTMLElement[] {\n let viewkeeperEls: HTMLElement[];\n\n if (this.skyViewkeeper) {\n viewkeeperEls = [];\n\n for (const item of this.skyViewkeeper) {\n let matchingEls = Array.from(\n (this.el.nativeElement as HTMLElement).querySelectorAll(item)\n ) as HTMLElement[];\n\n viewkeeperEls = [...viewkeeperEls, ...matchingEls];\n }\n }\n\n return viewkeeperEls;\n }\n\n private viewkeeperElsChanged(viewkeeperEls: HTMLElement[]): boolean {\n if (!viewkeeperEls !== !this.currentViewkeeperEls) {\n return true;\n }\n\n if (viewkeeperEls && this.currentViewkeeperEls) {\n if (viewkeeperEls.length !== this.currentViewkeeperEls.length) {\n return true;\n }\n\n for (let i = 0, n = viewkeeperEls.length; i < n; i++) {\n if (viewkeeperEls[i] !== this.currentViewkeeperEls[i]) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n private detectElements(): void {\n let viewkeeperEls = this.getViewkeeperEls();\n\n if (this.viewkeeperElsChanged(viewkeeperEls)) {\n if (this.scrollableHostWatchUnsubscribe) {\n this.scrollableHostWatchUnsubscribe.next();\n this.scrollableHostWatchUnsubscribe = new Subject();\n } else {\n this.scrollableHostWatchUnsubscribe = new Subject();\n }\n\n this.scrollableHostService\n .watchScrollableHost(this.el)\n .pipe(takeUntil(this.scrollableHostWatchUnsubscribe))\n .subscribe((scrollableHost) => {\n this.destroyViewkeepers();\n\n let previousViewkeeperEl: HTMLElement;\n\n for (const viewkeeperEl of viewkeeperEls) {\n this.viewkeepers.push(\n this.viewkeeperSvc.create({\n boundaryEl: this.el.nativeElement,\n scrollableHost:\n scrollableHost instanceof HTMLElement\n ? scrollableHost\n : undefined,\n el: viewkeeperEl,\n setWidth: true,\n verticalOffsetEl: previousViewkeeperEl,\n })\n );\n\n previousViewkeeperEl = viewkeeperEl;\n }\n });\n\n this.currentViewkeeperEls = viewkeeperEls;\n }\n }\n}\n"]}
|