@skyux/core 5.5.0-beta.0 → 5.6.1

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 (53) hide show
  1. package/bundles/skyux-core.umd.js +8 -9
  2. package/documentation.json +93 -93
  3. package/esm2015/lib/modules/adapter-service/adapter.service.js +1 -1
  4. package/esm2015/lib/modules/adapter-service/adapter.service.js.map +1 -1
  5. package/esm2015/lib/modules/affix/affix-config.js.map +1 -1
  6. package/esm2015/lib/modules/affix/affix.directive.js.map +1 -1
  7. package/esm2015/lib/modules/affix/affix.module.js.map +1 -1
  8. package/esm2015/lib/modules/affix/affixer.js +1 -1
  9. package/esm2015/lib/modules/affix/affixer.js.map +1 -1
  10. package/esm2015/lib/modules/dock/dock-dom-adapter.service.js +1 -1
  11. package/esm2015/lib/modules/dock/dock-dom-adapter.service.js.map +1 -1
  12. package/esm2015/lib/modules/dock/dock.component.js.map +1 -1
  13. package/esm2015/lib/modules/dock/dock.module.js.map +1 -1
  14. package/esm2015/lib/modules/dock/dock.service.js +3 -3
  15. package/esm2015/lib/modules/dock/dock.service.js.map +1 -1
  16. package/esm2015/lib/modules/dynamic-component/dynamic-component.service.js.map +1 -1
  17. package/esm2015/lib/modules/log/log.service.js +1 -0
  18. package/esm2015/lib/modules/log/log.service.js.map +1 -1
  19. package/esm2015/lib/modules/media-query/media-query.service.js.map +1 -1
  20. package/esm2015/lib/modules/numeric/numeric.module.js.map +1 -1
  21. package/esm2015/lib/modules/numeric/numeric.pipe.js +4 -4
  22. package/esm2015/lib/modules/numeric/numeric.pipe.js.map +1 -1
  23. package/esm2015/lib/modules/numeric/numeric.service.js +5 -4
  24. package/esm2015/lib/modules/numeric/numeric.service.js.map +1 -1
  25. package/esm2015/lib/modules/overlay/overlay-instance.js.map +1 -1
  26. package/esm2015/lib/modules/overlay/overlay.component.js +1 -1
  27. package/esm2015/lib/modules/overlay/overlay.component.js.map +1 -1
  28. package/esm2015/lib/modules/overlay/overlay.module.js.map +1 -1
  29. package/esm2015/lib/modules/overlay/overlay.service.js.map +1 -1
  30. package/esm2015/lib/modules/percent-pipe/percent-pipe.module.js.map +1 -1
  31. package/esm2015/lib/modules/percent-pipe/percent.pipe.js.map +1 -1
  32. package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js +4 -4
  33. package/esm2015/lib/modules/scrollable-host/scrollable-host.service.js.map +1 -1
  34. package/esm2015/lib/modules/shared/number-format/number-format-utility.js.map +1 -1
  35. package/esm2015/lib/modules/shared/sky-core-resources.module.js +1 -1
  36. package/esm2015/lib/modules/shared/sky-core-resources.module.js.map +1 -1
  37. package/esm2015/lib/modules/title/title.service.js.map +1 -1
  38. package/esm2015/lib/modules/viewkeeper/viewkeeper.directive.js +2 -2
  39. package/esm2015/lib/modules/viewkeeper/viewkeeper.directive.js.map +1 -1
  40. package/esm2015/lib/modules/viewkeeper/viewkeeper.js +4 -7
  41. package/esm2015/lib/modules/viewkeeper/viewkeeper.js.map +1 -1
  42. package/esm2015/lib/modules/viewkeeper/viewkeeper.service.js.map +1 -1
  43. package/esm2015/testing/mock-media-query.service.js.map +1 -1
  44. package/esm2015/testing/mock-ui-config.service.js.map +1 -1
  45. package/fesm2015/skyux-core-testing.js.map +1 -1
  46. package/fesm2015/skyux-core.js +58 -59
  47. package/fesm2015/skyux-core.js.map +1 -1
  48. package/lib/modules/affix/affix.directive.d.ts +2 -2
  49. package/lib/modules/affix/affixer.d.ts +1 -1
  50. package/lib/modules/dock/dock.service.d.ts +2 -2
  51. package/lib/modules/numeric/numeric.pipe.d.ts +2 -2
  52. package/lib/modules/overlay/overlay-instance.d.ts +1 -1
  53. package/package.json +11 -10
@@ -144,7 +144,7 @@ export class SkyCoreAdapterService {
144
144
  // In certain scenarios, an element is removed after a click event; by the time the event
145
145
  // bubbles up to other elements, however, the element has been removed and the computed style returns empty.
146
146
  // In this case, we'll need to check the z-index directly, via the style property.
147
- let targetZIndex = getComputedStyle(el).zIndex || el.style.zIndex;
147
+ const targetZIndex = getComputedStyle(el).zIndex || el.style.zIndex;
148
148
  if (targetZIndex !== '' &&
149
149
  targetZIndex !== 'auto' &&
150
150
  +targetZIndex > +zIndex) {
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/adapter-service/adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;;AAIvE,MAAM,qBAAqB,GAAG;IAC5B,SAAS;IACT,YAAY;IACZ,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,0BAA0B;IAC1B,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,yCAAyC;IACzC,6BAA6B;CAC9B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAKb,MAAM,OAAO,qBAAqB;IAGhC,YAAoB,eAAiC;QAAjC,oBAAe,GAAf,eAAe,CAAkB;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;OAMG;IACI,2BAA2B,CAChC,UAAsB,EACtB,UAA+B;QAE/B,MAAM,QAAQ,GAAgB,UAAU,CAAC,aAAa,CAAC;QAEvD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;QACnE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;QACnE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;QACnE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;QAEnE,IAAI,QAAgB,CAAC;QAErB,QAAQ,UAAU,EAAE;YA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,CAAC;aAC3D;YACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACxC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;aAC7C;SACF;IACH,CAAC;IAEO,iBAAiB,CAAC,IAAwB;QAChD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACnB,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,SAAS,CAAC,OAAoB;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,KAAK,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAC;QAC3E,IAAI,QAAQ,EAAE;YACZ,OAAO,KAAK,CAAC;SACd;QAED,MAAM,SAAS,GAAG,CAAC,CAAC,CAClB,OAAO,CAAC,WAAW;YACnB,OAAO,CAAC,YAAY;YACpB,OAAO,CAAC,cAAc,EAAE,CAAC,MAAM,CAChC,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;;mHAjPU,qBAAqB;uHAArB,qBAAqB,cAFpB,MAAM;4FAEP,qBAAqB;kBAHjC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import {\n ElementRef,\n Injectable,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\n\nimport { SkyMediaBreakpoints } from '../media-query/media-breakpoints';\n\nimport { SkyFocusableChildrenOptions } from './focusable-children-options';\n\nconst SKY_TABBABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'input:not([disabled])',\n 'button:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n '*[contenteditable=true]:not([disabled])',\n '*[tabindex]:not([disabled])',\n].join(', ');\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyCoreAdapterService {\n private renderer: Renderer2;\n\n constructor(private rendererFactory: RendererFactory2) {\n this.renderer = this.rendererFactory.createRenderer(undefined, undefined);\n }\n\n /**\n * Set the responsive container CSS class for a given element.\n *\n * @param elementRef - The element that will recieve the new CSS class.\n * @param breakpoint - The SkyMediaBreakpoint will determine which class\n * gets set. For example a SkyMediaBreakpoint of `xs` will set a CSS class of `sky-responsive-container-xs`.\n */\n public setResponsiveContainerClass(\n elementRef: ElementRef,\n breakpoint: SkyMediaBreakpoints\n ): void {\n const nativeEl: HTMLElement = elementRef.nativeElement;\n\n this.renderer.removeClass(nativeEl, 'sky-responsive-container-xs');\n this.renderer.removeClass(nativeEl, 'sky-responsive-container-sm');\n this.renderer.removeClass(nativeEl, 'sky-responsive-container-md');\n this.renderer.removeClass(nativeEl, 'sky-responsive-container-lg');\n\n let newClass: string;\n\n switch (breakpoint) {\n case SkyMediaBreakpoints.xs: {\n newClass = 'sky-responsive-container-xs';\n break;\n }\n case SkyMediaBreakpoints.sm: {\n newClass = 'sky-responsive-container-sm';\n break;\n }\n case SkyMediaBreakpoints.md: {\n newClass = 'sky-responsive-container-md';\n break;\n }\n default: {\n newClass = 'sky-responsive-container-lg';\n break;\n }\n }\n\n this.renderer.addClass(nativeEl, newClass);\n }\n\n /**\n * This method temporarily enables/disables pointer events.\n * This is helpful to prevent iFrames from interfering with drag events.\n *\n * @param enable - Set to `true` to enable pointer events. Set to `false` to disable.\n */\n public toggleIframePointerEvents(enable: boolean): void {\n const iframes = document.querySelectorAll('iframe');\n for (let i = 0; i < iframes.length; i++) {\n // Setting to empty string will allow iframe to fall back to its prior CSS assignment.\n iframes[i].style.pointerEvents = enable ? '' : 'none';\n }\n }\n\n /**\n * Focuses on the first element found with an `autofocus` attribute inside the supplied `elementRef`.\n *\n * @param elementRef - The element to search within.\n * @return Returns `true` if a child element with autofocus is found.\n */\n public applyAutoFocus(elementRef: ElementRef): boolean {\n const elementWithAutoFocus =\n elementRef.nativeElement.querySelector('[autofocus]');\n\n // Child was found with the autofocus property. Set focus and return true.\n if (elementWithAutoFocus) {\n elementWithAutoFocus.focus();\n return true;\n }\n\n // No children were found with autofocus property. Return false.\n return false;\n }\n\n /**\n * Sets focus on the first focusable child of the `elementRef` parameter.\n * If no focusable children are found, and `focusOnContainerIfNoChildrenFound` is `true`,\n * focus will be set on the container element.\n *\n * @param elementRef - The element to search within.\n * @param containerSelector - A CSS selector indicating the container that should\n * recieve focus if no focusable children are found.\n * @param focusOnContainerIfNoChildrenFound - It set to `true`, the container will\n * recieve focus if no focusable children are found.\n */\n public getFocusableChildrenAndApplyFocus(\n elementRef: ElementRef,\n containerSelector: string,\n focusOnContainerIfNoChildrenFound: boolean = false\n ): void {\n const containerElement =\n elementRef.nativeElement.querySelector(containerSelector);\n const focusableChildren = this.getFocusableChildren(containerElement);\n\n // Focus first focusable child if available. Otherwise, set focus on container.\n if (\n !this.focusFirstElement(focusableChildren) &&\n focusOnContainerIfNoChildrenFound\n ) {\n containerElement.focus();\n }\n }\n\n /**\n * Returns an array of all focusable children of provided `element`.\n *\n * @param element - The HTMLElement to search within.\n * @param options - Options for getting focusable children.\n */\n public getFocusableChildren(\n element: HTMLElement,\n options?: SkyFocusableChildrenOptions\n ): HTMLElement[] {\n let elements = Array.prototype.slice.call(\n element.querySelectorAll(SKY_TABBABLE_SELECTOR)\n );\n\n // Unless ignoreTabIndex = true, filter out elements with tabindex = -1.\n if (!options || !options.ignoreTabIndex) {\n elements = elements.filter((el: HTMLElement) => {\n return el.tabIndex !== -1;\n });\n }\n\n // Unless ignoreVisibility = true, filter out elements that are not visible.\n if (!options || !options.ignoreVisibility) {\n elements = elements.filter((el: HTMLElement) => {\n return this.isVisible(el);\n });\n }\n\n return elements;\n }\n\n /**\n * Returns the clientWidth of the provided elementRef.\n * @param elementRef - The element to calculate width from.\n */\n public getWidth(elementRef: ElementRef): number {\n return elementRef.nativeElement.clientWidth;\n }\n\n /**\n * Checks if an event target has a higher z-index than a given element.\n * @param target The event target element.\n * @param element The element to test against. A z-index must be explicitly set for this element.\n */\n public isTargetAboveElement(\n target: EventTarget,\n element: HTMLElement\n ): boolean {\n const zIndex: string = getComputedStyle(element).zIndex;\n\n let el: HTMLElement = target as HTMLElement;\n\n while (el) {\n // Getting the computed style only works for elements that exist in the DOM.\n // In certain scenarios, an element is removed after a click event; by the time the event\n // bubbles up to other elements, however, the element has been removed and the computed style returns empty.\n // In this case, we'll need to check the z-index directly, via the style property.\n let targetZIndex: string = getComputedStyle(el).zIndex || el.style.zIndex;\n if (\n targetZIndex !== '' &&\n targetZIndex !== 'auto' &&\n +targetZIndex > +zIndex\n ) {\n return true;\n }\n\n el = el.parentElement as HTMLElement;\n }\n\n return false;\n }\n\n /**\n * Remove inline height styles from the provided elements.\n * @param elementRef - The element to search within.\n * @param selector - The CSS selector to use when finding elements for removing height.\n */\n public resetHeight(elementRef: ElementRef, selector: string): void {\n const children = elementRef.nativeElement.querySelectorAll(selector);\n /* istanbul ignore else */\n if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n // Setting style attributes with Web API requires null instead of undefined.\n // tslint:disable-next-line: no-null-keyword\n children[i].style.height = null;\n }\n }\n }\n\n /**\n * Sets all element heights to match the height of the tallest element.\n * @param elementRef - The element to search within.\n * @param selector - The CSS selector to use when finding elements for syncing height.\n */\n public syncMaxHeight(elementRef: ElementRef, selector: string): void {\n const children = elementRef.nativeElement.querySelectorAll(selector);\n /* istanbul ignore else */\n if (children.length > 0) {\n let maxHeight = 0;\n for (let i = 0; i < children.length; i++) {\n maxHeight = Math.max(maxHeight, children[i].offsetHeight);\n }\n for (let i = 0; i < children.length; i++) {\n children[i].style.height = maxHeight + 'px';\n }\n }\n }\n\n private focusFirstElement(list: Array<HTMLElement>): boolean {\n if (list.length > 0) {\n list[0].focus();\n return true;\n }\n return false;\n }\n\n private isVisible(element: HTMLElement): boolean {\n const style = window.getComputedStyle(element);\n const isHidden = style.display === 'none' || style.visibility === 'hidden';\n if (isHidden) {\n return false;\n }\n\n const hasBounds = !!(\n element.offsetWidth ||\n element.offsetHeight ||\n element.getClientRects().length\n );\n return hasBounds;\n }\n}\n"]}
1
+ {"version":3,"file":"adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/adapter-service/adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEV,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;;AAIvE,MAAM,qBAAqB,GAAG;IAC5B,SAAS;IACT,YAAY;IACZ,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,0BAA0B;IAC1B,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,yCAAyC;IACzC,6BAA6B;CAC9B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAKb,MAAM,OAAO,qBAAqB;IAGhC,YAAoB,eAAiC;QAAjC,oBAAe,GAAf,eAAe,CAAkB;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;OAMG;IACI,2BAA2B,CAChC,UAAsB,EACtB,UAA+B;QAE/B,MAAM,QAAQ,GAAgB,UAAU,CAAC,aAAa,CAAC;QAEvD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;QACnE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;QACnE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAAC;QACnE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,6BAA6B,CAAC,CAA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,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;aAC3D;YACD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACxC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;aAC7C;SACF;IACH,CAAC;IAEO,iBAAiB,CAAC,IAAwB;QAChD,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;YACnB,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;SACb;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAEO,SAAS,CAAC,OAAoB;QACpC,MAAM,KAAK,GAAG,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,KAAK,CAAC,OAAO,KAAK,MAAM,IAAI,KAAK,CAAC,UAAU,KAAK,QAAQ,CAAC;QAC3E,IAAI,QAAQ,EAAE;YACZ,OAAO,KAAK,CAAC;SACd;QAED,MAAM,SAAS,GAAG,CAAC,CAAC,CAClB,OAAO,CAAC,WAAW;YACnB,OAAO,CAAC,YAAY;YACpB,OAAO,CAAC,cAAc,EAAE,CAAC,MAAM,CAChC,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;;mHAlPU,qBAAqB;uHAArB,qBAAqB,cAFpB,MAAM;4FAEP,qBAAqB;kBAHjC,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import {\n ElementRef,\n Injectable,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\n\nimport { SkyMediaBreakpoints } from '../media-query/media-breakpoints';\n\nimport { SkyFocusableChildrenOptions } from './focusable-children-options';\n\nconst SKY_TABBABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'input:not([disabled])',\n 'button:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n '*[contenteditable=true]:not([disabled])',\n '*[tabindex]:not([disabled])',\n].join(', ');\n\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyCoreAdapterService {\n private renderer: Renderer2;\n\n constructor(private rendererFactory: RendererFactory2) {\n this.renderer = this.rendererFactory.createRenderer(undefined, undefined);\n }\n\n /**\n * Set the responsive container CSS class for a given element.\n *\n * @param elementRef - The element that will recieve the new CSS class.\n * @param breakpoint - The SkyMediaBreakpoint will determine which class\n * gets set. For example a SkyMediaBreakpoint of `xs` will set a CSS class of `sky-responsive-container-xs`.\n */\n public setResponsiveContainerClass(\n elementRef: ElementRef,\n breakpoint: SkyMediaBreakpoints\n ): void {\n const nativeEl: HTMLElement = elementRef.nativeElement;\n\n this.renderer.removeClass(nativeEl, 'sky-responsive-container-xs');\n this.renderer.removeClass(nativeEl, 'sky-responsive-container-sm');\n this.renderer.removeClass(nativeEl, 'sky-responsive-container-md');\n this.renderer.removeClass(nativeEl, 'sky-responsive-container-lg');\n\n let newClass: string;\n\n switch (breakpoint) {\n case SkyMediaBreakpoints.xs: {\n newClass = 'sky-responsive-container-xs';\n break;\n }\n case SkyMediaBreakpoints.sm: {\n newClass = 'sky-responsive-container-sm';\n break;\n }\n case SkyMediaBreakpoints.md: {\n newClass = 'sky-responsive-container-md';\n break;\n }\n default: {\n newClass = 'sky-responsive-container-lg';\n break;\n }\n }\n\n this.renderer.addClass(nativeEl, newClass);\n }\n\n /**\n * This method temporarily enables/disables pointer events.\n * This is helpful to prevent iFrames from interfering with drag events.\n *\n * @param enable - Set to `true` to enable pointer events. Set to `false` to disable.\n */\n public toggleIframePointerEvents(enable: boolean): void {\n const iframes = document.querySelectorAll('iframe');\n for (let i = 0; i < iframes.length; i++) {\n // Setting to empty string will allow iframe to fall back to its prior CSS assignment.\n iframes[i].style.pointerEvents = enable ? '' : 'none';\n }\n }\n\n /**\n * Focuses on the first element found with an `autofocus` attribute inside the supplied `elementRef`.\n *\n * @param elementRef - The element to search within.\n * @return Returns `true` if a child element with autofocus is found.\n */\n public applyAutoFocus(elementRef: ElementRef): boolean {\n const elementWithAutoFocus =\n elementRef.nativeElement.querySelector('[autofocus]');\n\n // Child was found with the autofocus property. Set focus and return true.\n if (elementWithAutoFocus) {\n elementWithAutoFocus.focus();\n return true;\n }\n\n // No children were found with autofocus property. Return false.\n return false;\n }\n\n /**\n * Sets focus on the first focusable child of the `elementRef` parameter.\n * If no focusable children are found, and `focusOnContainerIfNoChildrenFound` is `true`,\n * focus will be set on the container element.\n *\n * @param elementRef - The element to search within.\n * @param containerSelector - A CSS selector indicating the container that should\n * recieve focus if no focusable children are found.\n * @param focusOnContainerIfNoChildrenFound - It set to `true`, the container will\n * recieve focus if no focusable children are found.\n */\n public getFocusableChildrenAndApplyFocus(\n elementRef: ElementRef,\n containerSelector: string,\n focusOnContainerIfNoChildrenFound: boolean = false\n ): void {\n const containerElement =\n elementRef.nativeElement.querySelector(containerSelector);\n const focusableChildren = this.getFocusableChildren(containerElement);\n\n // Focus first focusable child if available. Otherwise, set focus on container.\n if (\n !this.focusFirstElement(focusableChildren) &&\n focusOnContainerIfNoChildrenFound\n ) {\n containerElement.focus();\n }\n }\n\n /**\n * Returns an array of all focusable children of provided `element`.\n *\n * @param element - The HTMLElement to search within.\n * @param options - Options for getting focusable children.\n */\n public getFocusableChildren(\n element: HTMLElement,\n options?: SkyFocusableChildrenOptions\n ): HTMLElement[] {\n let elements = Array.prototype.slice.call(\n element.querySelectorAll(SKY_TABBABLE_SELECTOR)\n );\n\n // Unless ignoreTabIndex = true, filter out elements with tabindex = -1.\n if (!options || !options.ignoreTabIndex) {\n elements = elements.filter((el: HTMLElement) => {\n return el.tabIndex !== -1;\n });\n }\n\n // Unless ignoreVisibility = true, filter out elements that are not visible.\n if (!options || !options.ignoreVisibility) {\n elements = elements.filter((el: HTMLElement) => {\n return this.isVisible(el);\n });\n }\n\n return elements;\n }\n\n /**\n * Returns the clientWidth of the provided elementRef.\n * @param elementRef - The element to calculate width from.\n */\n public getWidth(elementRef: ElementRef): number {\n return elementRef.nativeElement.clientWidth;\n }\n\n /**\n * Checks if an event target has a higher z-index than a given element.\n * @param target The event target element.\n * @param element The element to test against. A z-index must be explicitly set for this element.\n */\n public isTargetAboveElement(\n target: EventTarget,\n element: HTMLElement\n ): boolean {\n const zIndex: string = getComputedStyle(element).zIndex;\n\n let el: HTMLElement = target as HTMLElement;\n\n while (el) {\n // Getting the computed style only works for elements that exist in the DOM.\n // In certain scenarios, an element is removed after a click event; by the time the event\n // bubbles up to other elements, however, the element has been removed and the computed style returns empty.\n // In this case, we'll need to check the z-index directly, via the style property.\n const targetZIndex: string =\n getComputedStyle(el).zIndex || el.style.zIndex;\n if (\n targetZIndex !== '' &&\n targetZIndex !== 'auto' &&\n +targetZIndex > +zIndex\n ) {\n return true;\n }\n\n el = el.parentElement as HTMLElement;\n }\n\n return false;\n }\n\n /**\n * Remove inline height styles from the provided elements.\n * @param elementRef - The element to search within.\n * @param selector - The CSS selector to use when finding elements for removing height.\n */\n public resetHeight(elementRef: ElementRef, selector: string): void {\n const children = elementRef.nativeElement.querySelectorAll(selector);\n /* istanbul ignore else */\n if (children.length > 0) {\n for (let i = 0; i < children.length; i++) {\n // Setting style attributes with Web API requires null instead of undefined.\n // tslint:disable-next-line: no-null-keyword\n children[i].style.height = null;\n }\n }\n }\n\n /**\n * Sets all element heights to match the height of the tallest element.\n * @param elementRef - The element to search within.\n * @param selector - The CSS selector to use when finding elements for syncing height.\n */\n public syncMaxHeight(elementRef: ElementRef, selector: string): void {\n const children = elementRef.nativeElement.querySelectorAll(selector);\n /* istanbul ignore else */\n if (children.length > 0) {\n let maxHeight = 0;\n for (let i = 0; i < children.length; i++) {\n maxHeight = Math.max(maxHeight, children[i].offsetHeight);\n }\n for (let i = 0; i < children.length; i++) {\n children[i].style.height = maxHeight + 'px';\n }\n }\n }\n\n private focusFirstElement(list: Array<HTMLElement>): boolean {\n if (list.length > 0) {\n list[0].focus();\n return true;\n }\n return false;\n }\n\n private isVisible(element: HTMLElement): boolean {\n const style = window.getComputedStyle(element);\n const isHidden = style.display === 'none' || style.visibility === 'hidden';\n if (isHidden) {\n return false;\n }\n\n const hasBounds = !!(\n element.offsetWidth ||\n element.offsetHeight ||\n element.getClientRects().length\n );\n return hasBounds;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"affix-config.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/affix/affix-config.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyAffixAutoFitContext } from './affix-auto-fit-context';\n\nimport { SkyAffixHorizontalAlignment } from './affix-horizontal-alignment';\n\nimport { SkyAffixOffset } from './affix-offset';\n\nimport { SkyAffixPlacement } from './affix-placement';\n\nimport { SkyAffixVerticalAlignment } from './affix-vertical-alignment';\n\nexport interface SkyAffixConfig {\n /**\n * Indicates which parent element is used by the auto-fit functionality.\n */\n autoFitContext?: SkyAffixAutoFitContext;\n\n /**\n * This optional offset is added to (or subtracted from) the [[SkyAffixAutoFitContext]] element's\n * offset during an auto-fit placement calculation. This value is useful if you need to consider\n * another `position: fixed` element on the page (such as a navbar) when the auto-fit\n * functionality attempts to find the best possible placement.\n * (In the case of a navbar, you would add a `top` value equal to the navbar's height in pixels.)\n */\n autoFitOverflowOffset?: SkyAffixOffset;\n\n /**\n * Indicates if the affix service should try and find the best placement for the affixed element\n * if the element would be hidden otherwise. If this setting is disabled, the affix service will\n * force the placement of the affixed element.\n */\n enableAutoFit?: boolean;\n\n /**\n * The horizontal alignment of the affixed element to the base element.\n */\n horizontalAlignment?: SkyAffixHorizontalAlignment;\n\n /**\n * Indicates if the affixed element should remain affixed to the base element when the window is scrolled or resized.\n */\n isSticky?: boolean;\n\n /**\n * The placement of the affixed element around the base element.\n */\n placement?: SkyAffixPlacement;\n\n /**\n * The vertical alignment of the affixed element to the base element.\n */\n verticalAlignment?: SkyAffixVerticalAlignment;\n}\n"]}
1
+ {"version":3,"file":"affix-config.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/affix/affix-config.ts"],"names":[],"mappings":"","sourcesContent":["import { SkyAffixAutoFitContext } from './affix-auto-fit-context';\nimport { SkyAffixHorizontalAlignment } from './affix-horizontal-alignment';\nimport { SkyAffixOffset } from './affix-offset';\nimport { SkyAffixPlacement } from './affix-placement';\nimport { SkyAffixVerticalAlignment } from './affix-vertical-alignment';\n\nexport interface SkyAffixConfig {\n /**\n * Indicates which parent element is used by the auto-fit functionality.\n */\n autoFitContext?: SkyAffixAutoFitContext;\n\n /**\n * This optional offset is added to (or subtracted from) the [[SkyAffixAutoFitContext]] element's\n * offset during an auto-fit placement calculation. This value is useful if you need to consider\n * another `position: fixed` element on the page (such as a navbar) when the auto-fit\n * functionality attempts to find the best possible placement.\n * (In the case of a navbar, you would add a `top` value equal to the navbar's height in pixels.)\n */\n autoFitOverflowOffset?: SkyAffixOffset;\n\n /**\n * Indicates if the affix service should try and find the best placement for the affixed element\n * if the element would be hidden otherwise. If this setting is disabled, the affix service will\n * force the placement of the affixed element.\n */\n enableAutoFit?: boolean;\n\n /**\n * The horizontal alignment of the affixed element to the base element.\n */\n horizontalAlignment?: SkyAffixHorizontalAlignment;\n\n /**\n * Indicates if the affixed element should remain affixed to the base element when the window is scrolled or resized.\n */\n isSticky?: boolean;\n\n /**\n * The placement of the affixed element around the base element.\n */\n placement?: SkyAffixPlacement;\n\n /**\n * The vertical alignment of the affixed element to the base element.\n */\n verticalAlignment?: SkyAffixVerticalAlignment;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"affix.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/affix/affix.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EAGL,MAAM,GAEP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CA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B,KAAK;gBAOC,aAAa;sBADnB,KAAK;gBAOC,cAAc;sBADpB,KAAK;gBAOC,sBAAsB;sBAD5B,KAAK;gBAOC,iBAAiB;sBADvB,MAAM;gBAOA,mBAAmB;sBADzB,MAAM;gBAOA,oBAAoB;sBAD1B,MAAM","sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n} from '@angular/core';\n\nimport { Subject } from 'rxjs';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyAffixAutoFitContext } from './affix-auto-fit-context';\n\nimport { SkyAffixHorizontalAlignment } from './affix-horizontal-alignment';\n\nimport { SkyAffixPlacement } from './affix-placement';\n\nimport { SkyAffixPlacementChange } from './affix-placement-change';\n\nimport { SkyAffixVerticalAlignment } from './affix-vertical-alignment';\n\nimport { SkyAffixService } from './affix.service';\n\nimport { SkyAffixOffsetChange } from './affix-offset-change';\n\nimport { SkyAffixOffset } from './affix-offset';\n\nimport { SkyAffixer } from './affixer';\n\n/**\n * Affixes the host element to a base element.\n */\n@Directive({\n selector: '[skyAffixTo]',\n})\nexport class SkyAffixDirective implements OnChanges, OnDestroy {\n /**\n * The base element to affix the host element.\n */\n @Input()\n public skyAffixTo: HTMLElement;\n\n /**\n * Sets the `autoFitContext` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixAutoFitContext: SkyAffixAutoFitContext;\n\n /**\n * Sets the `autoFitOverflowOffset` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixAutoFitOverflowOffset: SkyAffixOffset;\n\n /**\n * Sets the `enableAutoFit` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixEnableAutoFit: boolean;\n\n /**\n * Sets the `horizontalAlignment` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixHorizontalAlignment: SkyAffixHorizontalAlignment;\n\n /**\n * Sets the `isSticky` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixIsSticky: boolean;\n\n /**\n * Sets the `placement` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixPlacement: SkyAffixPlacement;\n\n /**\n * Sets the `verticalAlignment` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixVerticalAlignment: SkyAffixVerticalAlignment;\n\n /**\n * Fires when the affixed element's offset changes.\n */\n @Output()\n public affixOffsetChange = new EventEmitter<SkyAffixOffsetChange>();\n\n /**\n * Fires when the affixed element's overflow container is scrolled.\n */\n @Output()\n public affixOverflowScroll = new EventEmitter<void>();\n\n /**\n * Fires when the placement value changes.\n */\n @Output()\n public affixPlacementChange = new EventEmitter<SkyAffixPlacementChange>();\n\n private affixer: SkyAffixer;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(elementRef: ElementRef, private affixService: SkyAffixService) {\n this.affixer = this.affixService.createAffixer(elementRef);\n\n this.affixer.offsetChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => this.affixOffsetChange.emit(change));\n\n this.affixer.overflowScroll\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => this.affixOverflowScroll.emit(change));\n\n this.affixer.placementChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => this.affixPlacementChange.emit(change));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (\n changes.affixAutoFitContext ||\n changes.affixAutoFitOverflowOffset ||\n changes.affixEnableAutoFit ||\n changes.affixHorizontalAlignment ||\n changes.affixIsSticky ||\n changes.affixPlacement ||\n changes.affixVerticalAlignment\n ) {\n this.updateAlignment();\n }\n }\n\n public ngOnDestroy(): void {\n this.affixOffsetChange.complete();\n this.affixOverflowScroll.complete();\n this.affixPlacementChange.complete();\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.affixer.destroy();\n }\n\n private updateAlignment(): void {\n this.affixer.affixTo(this.skyAffixTo, {\n autoFitContext: this.affixAutoFitContext,\n autoFitOverflowOffset: this.affixAutoFitOverflowOffset,\n enableAutoFit: this.affixEnableAutoFit,\n horizontalAlignment: this.affixHorizontalAlignment,\n isSticky: this.affixIsSticky,\n placement: this.affixPlacement,\n verticalAlignment: this.affixVerticalAlignment,\n });\n }\n}\n"]}
1
+ {"version":3,"file":"affix.directive.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/affix/affix.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,KAAK,EAGL,MAAM,GAEP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAOlE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;;;AAGlD;;GAEG;AAIH,MAAM,OAAO,iBAAiB;IAuE5B,YAAY,UAAsB,EAAU,YAA6B;QAA7B,iBAAY,GAAZ,YAAY,CAAiB;QAtBzE;;WAEG;QAEI,sBAAiB,GAAG,IAAI,YAAY,EAAwB,CAAC;QAEpE;;WAEG;QAEI,wBAAmB,GAAG,IAAI,YAAY,EAAQ,CAAC;QAEtD;;WAEG;QAEI,yBAAoB,GAAG,IAAI,YAAY,EAA2B,CAAC;QAIlE,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;QAG1C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAE3D,IAAI,CAAC,OAAO,CAAC,YAAY;aACtB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aACnC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAE9D,IAAI,CAAC,OAAO,CAAC,cAAc;aACxB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC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B,SAAS,EAAE,IAAI,CAAC,cAAc;YAC9B,iBAAiB,EAAE,IAAI,CAAC,sBAAsB;SAC/C,CAAC,CAAC;IACL,CAAC;;+GAzHU,iBAAiB;mGAAjB,iBAAiB;4FAAjB,iBAAiB;kBAH7B,SAAS;mBAAC;oBACT,QAAQ,EAAE,cAAc;iBACzB;+HAMQ,UAAU;sBADhB,KAAK;gBAOC,mBAAmB;sBADzB,KAAK;gBAOC,0BAA0B;sBADhC,KAAK;gBAOC,kBAAkB;sBADxB,KAAK;gBAOC,wBAAwB;sBAD9B,KAAK;gBAOC,aAAa;sBADnB,KAAK;gBAOC,cAAc;sBADpB,KAAK;gBAOC,sBAAsB;sBAD5B,KAAK;gBAOC,iBAAiB;sBADvB,MAAM;gBAOA,mBAAmB;sBADzB,MAAM;gBAOA,oBAAoB;sBAD1B,MAAM","sourcesContent":["import {\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n SimpleChanges,\n} from '@angular/core';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { SkyAffixAutoFitContext } from './affix-auto-fit-context';\nimport { SkyAffixHorizontalAlignment } from './affix-horizontal-alignment';\nimport { SkyAffixOffset } from './affix-offset';\nimport { SkyAffixOffsetChange } from './affix-offset-change';\nimport { SkyAffixPlacement } from './affix-placement';\nimport { SkyAffixPlacementChange } from './affix-placement-change';\nimport { SkyAffixVerticalAlignment } from './affix-vertical-alignment';\nimport { SkyAffixService } from './affix.service';\nimport { SkyAffixer } from './affixer';\n\n/**\n * Affixes the host element to a base element.\n */\n@Directive({\n selector: '[skyAffixTo]',\n})\nexport class SkyAffixDirective implements OnChanges, OnDestroy {\n /**\n * The base element to affix the host element.\n */\n @Input()\n public skyAffixTo: HTMLElement;\n\n /**\n * Sets the `autoFitContext` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixAutoFitContext: SkyAffixAutoFitContext;\n\n /**\n * Sets the `autoFitOverflowOffset` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixAutoFitOverflowOffset: SkyAffixOffset;\n\n /**\n * Sets the `enableAutoFit` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixEnableAutoFit: boolean;\n\n /**\n * Sets the `horizontalAlignment` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixHorizontalAlignment: SkyAffixHorizontalAlignment;\n\n /**\n * Sets the `isSticky` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixIsSticky: boolean;\n\n /**\n * Sets the `placement` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixPlacement: SkyAffixPlacement;\n\n /**\n * Sets the `verticalAlignment` property of [[SkyAffixConfig]].\n */\n @Input()\n public affixVerticalAlignment: SkyAffixVerticalAlignment;\n\n /**\n * Fires when the affixed element's offset changes.\n */\n @Output()\n public affixOffsetChange = new EventEmitter<SkyAffixOffsetChange>();\n\n /**\n * Fires when the affixed element's overflow container is scrolled.\n */\n @Output()\n public affixOverflowScroll = new EventEmitter<void>();\n\n /**\n * Fires when the placement value changes.\n */\n @Output()\n public affixPlacementChange = new EventEmitter<SkyAffixPlacementChange>();\n\n private affixer: SkyAffixer;\n\n private ngUnsubscribe = new Subject<void>();\n\n constructor(elementRef: ElementRef, private affixService: SkyAffixService) {\n this.affixer = this.affixService.createAffixer(elementRef);\n\n this.affixer.offsetChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => this.affixOffsetChange.emit(change));\n\n this.affixer.overflowScroll\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => this.affixOverflowScroll.emit(change));\n\n this.affixer.placementChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((change) => this.affixPlacementChange.emit(change));\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n /* istanbul ignore else */\n if (\n changes.affixAutoFitContext ||\n changes.affixAutoFitOverflowOffset ||\n changes.affixEnableAutoFit ||\n changes.affixHorizontalAlignment ||\n changes.affixIsSticky ||\n changes.affixPlacement ||\n changes.affixVerticalAlignment\n ) {\n this.updateAlignment();\n }\n }\n\n public ngOnDestroy(): void {\n this.affixOffsetChange.complete();\n this.affixOverflowScroll.complete();\n this.affixPlacementChange.complete();\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.affixer.destroy();\n }\n\n private updateAlignment(): void {\n this.affixer.affixTo(this.skyAffixTo, {\n autoFitContext: this.affixAutoFitContext,\n autoFitOverflowOffset: this.affixAutoFitOverflowOffset,\n enableAutoFit: this.affixEnableAutoFit,\n horizontalAlignment: this.affixHorizontalAlignment,\n isSticky: this.affixIsSticky,\n placement: this.affixPlacement,\n verticalAlignment: this.affixVerticalAlignment,\n });\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"affix.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/affix/affix.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;AAOtD,MAAM,OAAO,cAAc;;4GAAd,cAAc;6GAAd,cAAc,iBAFV,iBAAiB,aAFtB,YAAY,aACZ,iBAAiB;6GAGhB,cAAc,YAJhB,CAAC,YAAY,CAAC;4FAIZ,cAAc;kBAL1B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;iBAClC","sourcesContent":["import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { SkyAffixDirective } from './affix.directive';\n\n@NgModule({\n imports: [CommonModule],\n exports: [SkyAffixDirective],\n declarations: [SkyAffixDirective],\n})\nexport class SkyAffixModule {}\n"]}
1
+ {"version":3,"file":"affix.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/affix/affix.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;AAOtD,MAAM,OAAO,cAAc;;4GAAd,cAAc;6GAAd,cAAc,iBAFV,iBAAiB,aAFtB,YAAY,aACZ,iBAAiB;6GAGhB,cAAc,YAJhB,CAAC,YAAY,CAAC;4FAIZ,cAAc;kBAL1B,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,OAAO,EAAE,CAAC,iBAAiB,CAAC;oBAC5B,YAAY,EAAE,CAAC,iBAAiB,CAAC;iBAClC","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { SkyAffixDirective } from './affix.directive';\n\n@NgModule({\n imports: [CommonModule],\n exports: [SkyAffixDirective],\n declarations: [SkyAffixDirective],\n})\nexport class SkyAffixModule {}\n"]}
@@ -1,4 +1,4 @@
1
- import { fromEvent, Subject } from 'rxjs';
1
+ import { Subject, fromEvent } from 'rxjs';
2
2
  import { SkyAffixAutoFitContext } from './affix-auto-fit-context';
3
3
  import { getInversePlacement, getNextPlacement } from './affix-utils';
4
4
  import { getElementOffset, getOverflowParents, isOffsetFullyVisibleWithinParent, isOffsetPartiallyVisibleWithinParent, } from './dom-utils';
@@ -1 +1 @@
1
- {"version":3,"file":"affixer.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/affix/affixer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAc,OAAO,EAAgB,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAYlE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EACL,gBAAgB,EAChB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import { fromEvent, Observable, Subject, Subscription } from 'rxjs';\n\nimport { SkyAffixAutoFitContext } from './affix-auto-fit-context';\n\nimport { SkyAffixOffsetChange } from './affix-offset-change';\n\nimport { SkyAffixOffset } from './affix-offset';\n\nimport { SkyAffixConfig } from './affix-config';\n\nimport { SkyAffixPlacement } from './affix-placement';\n\nimport { SkyAffixPlacementChange } from './affix-placement-change';\n\nimport { getInversePlacement, getNextPlacement } from './affix-utils';\n\nimport {\n getElementOffset,\n getOverflowParents,\n isOffsetFullyVisibleWithinParent,\n isOffsetPartiallyVisibleWithinParent,\n} from './dom-utils';\n\nconst DEFAULT_AFFIX_CONFIG: SkyAffixConfig = {\n autoFitContext: SkyAffixAutoFitContext.OverflowParent,\n enableAutoFit: false,\n horizontalAlignment: 'center',\n isSticky: false,\n placement: 'above',\n};\n\nexport class SkyAffixer {\n /**\n * Fires when the affixed element's offset changes.\n */\n public get offsetChange(): Observable<SkyAffixOffsetChange> {\n return this._offsetChange.asObservable();\n }\n\n /**\n * Fires when the base element's nearest overflow parent is scrolling. This is useful if you need\n * to perform an additional action during the scroll event but don't want to generate another\n * event listener.\n */\n public get overflowScroll(): Observable<void> {\n return this._overflowScroll.asObservable();\n }\n\n /**\n * Fires when the placement value changes. A `null` value indicates that a suitable\n * placement could not be found.\n */\n public get placementChange(): Observable<SkyAffixPlacementChange> {\n return this._placementChange.asObservable();\n }\n\n private get config(): SkyAffixConfig {\n return this._config;\n }\n\n private set config(value: SkyAffixConfig) {\n const merged = { ...DEFAULT_AFFIX_CONFIG, ...value };\n\n // Make sure none of the values are undefined.\n Object.keys(merged).forEach((k: keyof SkyAffixConfig) => {\n if (merged[k] === undefined) {\n (merged as any)[k] = DEFAULT_AFFIX_CONFIG[k];\n }\n });\n\n this._config = merged;\n }\n\n private affixedRect: ClientRect;\n\n private baseElement: HTMLElement;\n\n private baseRect: ClientRect;\n\n private currentOffset: SkyAffixOffset;\n\n private currentPlacement: SkyAffixPlacement;\n\n private overflowParents: HTMLElement[];\n\n private resizeListener: Subscription;\n\n private scrollListeners: Function[];\n\n private _config: SkyAffixConfig;\n\n private _offsetChange = new Subject<SkyAffixOffsetChange>();\n\n private _overflowScroll = new Subject<void>();\n\n private _placementChange = new Subject<SkyAffixPlacementChange>();\n\n constructor(\n private affixedElement: HTMLElement,\n private renderer: Renderer2\n ) {}\n\n /**\n * Affixes an element to a base element.\n * @param baseElement The base element.\n * @param config Configuration for the affix action.\n */\n public affixTo(baseElement: HTMLElement, config?: SkyAffixConfig): void {\n this.reset();\n\n this.config = config;\n this.baseElement = baseElement;\n this.overflowParents = getOverflowParents(baseElement);\n\n this.affix();\n\n if (this.config.isSticky) {\n this.addScrollListeners();\n this.addResizeListener();\n }\n }\n\n /**\n * Re-runs the affix calculation.\n */\n public reaffix(): void {\n // Reset current placement to preferred placement.\n this.currentPlacement = this.config.placement;\n this.affix();\n }\n\n /**\n * Destroys the affixer.\n */\n public destroy(): void {\n this.reset();\n this._placementChange.complete();\n this._offsetChange.complete();\n this._overflowScroll.complete();\n\n this._offsetChange =\n this._placementChange =\n this._overflowScroll =\n undefined;\n }\n\n private affix(): void {\n this.baseRect = this.baseElement.getBoundingClientRect();\n this.affixedRect = this.affixedElement.getBoundingClientRect();\n\n const offset = this.getOffset();\n\n if (this.isNewOffset(offset)) {\n this.renderer.setStyle(this.affixedElement, 'top', `${offset.top}px`);\n this.renderer.setStyle(this.affixedElement, 'left', `${offset.left}px`);\n this._offsetChange.next({ offset });\n }\n }\n\n private getOffset(): SkyAffixOffset {\n const parent = this.getAutoFitContextParent();\n\n const maxAttempts = 4;\n let attempts = 0;\n\n let isAffixedElementFullyVisible = false;\n let offset: SkyAffixOffset;\n let placement = this.config.placement;\n\n do {\n offset = this.getPreferredOffset(placement);\n isAffixedElementFullyVisible = isOffsetFullyVisibleWithinParent(\n parent,\n offset,\n this.config.autoFitOverflowOffset\n );\n\n if (!this.config.enableAutoFit) {\n break;\n }\n\n if (!isAffixedElementFullyVisible) {\n placement =\n attempts % 2 === 0\n ? getInversePlacement(placement)\n : getNextPlacement(placement);\n }\n\n attempts++;\n } while (!isAffixedElementFullyVisible && attempts < maxAttempts);\n\n if (isAffixedElementFullyVisible) {\n if (this.isBaseElementVisible()) {\n this.notifyPlacementChange(placement);\n } else {\n /* tslint:disable-next-line:no-null-keyword */\n this.notifyPlacementChange(null);\n }\n\n return offset;\n }\n\n if (this.config.enableAutoFit) {\n /* tslint:disable-next-line:no-null-keyword */\n this.notifyPlacementChange(null);\n }\n\n // No suitable placement was found, so revert to preferred placement.\n return this.getPreferredOffset(this.config.placement);\n }\n\n private getPreferredOffset(placement: SkyAffixPlacement): SkyAffixOffset {\n const affixedRect = this.affixedRect;\n const baseRect = this.baseRect;\n\n const horizontalAlignment = this.config.horizontalAlignment;\n const verticalAlignment = this.config.verticalAlignment;\n const enableAutoFit = this.config.enableAutoFit;\n\n let top: number;\n let left: number;\n\n if (placement === 'above' || placement === 'below') {\n if (placement === 'above') {\n top = baseRect.top - affixedRect.height;\n\n switch (verticalAlignment) {\n case 'top':\n top = top + affixedRect.height;\n break;\n case 'middle':\n top = top + affixedRect.height / 2;\n break;\n case 'bottom':\n default:\n break;\n }\n } else {\n top = baseRect.bottom;\n\n switch (verticalAlignment) {\n case 'top':\n default:\n break;\n case 'middle':\n top = top - affixedRect.height / 2;\n break;\n case 'bottom':\n top = top - affixedRect.height;\n break;\n }\n }\n\n switch (horizontalAlignment) {\n case 'left':\n left = baseRect.left;\n break;\n\n case 'center':\n default:\n left = baseRect.left + baseRect.width / 2 - affixedRect.width / 2;\n break;\n\n case 'right':\n left = baseRect.right - affixedRect.width;\n break;\n }\n } else {\n if (placement === 'left') {\n left = baseRect.left - affixedRect.width;\n } else {\n left = baseRect.right;\n }\n\n switch (verticalAlignment) {\n case 'top':\n top = baseRect.top;\n break;\n\n case 'middle':\n default:\n top = baseRect.top + baseRect.height / 2 - affixedRect.height / 2;\n break;\n\n case 'bottom':\n top = baseRect.bottom - affixedRect.height;\n break;\n }\n }\n\n let offset: SkyAffixOffset = { left, top };\n if (enableAutoFit) {\n offset = this.adjustOffsetToOverflowParent({ ...offset }, placement);\n }\n\n offset.bottom = offset.top + affixedRect.height;\n offset.right = offset.left + affixedRect.width;\n\n return offset;\n }\n\n /**\n * Slightly adjust the offset to fit within the scroll parent's boundaries if\n * the affixed element would otherwise be clipped.\n */\n private adjustOffsetToOverflowParent(\n offset: SkyAffixOffset,\n placement: SkyAffixPlacement\n ): SkyAffixOffset {\n const parent = this.getAutoFitContextParent();\n const parentOffset = getElementOffset(\n parent,\n this.config.autoFitOverflowOffset\n );\n\n const affixedRect = this.affixedRect;\n const baseRect = this.baseRect;\n\n // A pixel value representing the leeway between the edge of the overflow parent and the edge\n // of the base element before it dissapears from view.\n // If the visible portion of the base element is less than this pixel value, the auto-fit\n // functionality attempts to find another placement.\n const defaultPixelTolerance = 40;\n let pixelTolerance: number;\n\n const originalOffsetTop = offset.top;\n const originalOffsetLeft = offset.left;\n\n /* tslint:disable-next-line:switch-default */\n switch (placement) {\n case 'above':\n case 'below':\n // Keep the affixed element within the overflow parent.\n if (offset.left < parentOffset.left) {\n offset.left = parentOffset.left;\n } else if (offset.left + affixedRect.width > parentOffset.right) {\n offset.left = parentOffset.right - affixedRect.width;\n }\n\n // Use a smaller pixel tolerance if the base element width is less than the default.\n pixelTolerance = Math.min(defaultPixelTolerance, baseRect.width);\n\n // Make sure the affixed element never detaches from the base element.\n if (\n offset.left + pixelTolerance > baseRect.right ||\n offset.left + affixedRect.width - pixelTolerance < baseRect.left\n ) {\n offset.left = originalOffsetLeft;\n }\n\n break;\n\n case 'left':\n case 'right':\n // Keep the affixed element within the overflow parent.\n if (offset.top < parentOffset.top) {\n offset.top = parentOffset.top;\n } else if (offset.top + affixedRect.height > parentOffset.bottom) {\n offset.top = parentOffset.bottom - affixedRect.height;\n }\n\n // Use a smaller pixel tolerance if the base element height is less than the default.\n pixelTolerance = Math.min(defaultPixelTolerance, baseRect.height);\n\n // Make sure the affixed element never detaches from the base element.\n if (\n offset.top + pixelTolerance > baseRect.bottom ||\n offset.top + affixedRect.height - pixelTolerance < baseRect.top\n ) {\n offset.top = originalOffsetTop;\n }\n\n break;\n }\n\n return offset;\n }\n\n private getImmediateOverflowParent(): HTMLElement {\n return this.overflowParents[this.overflowParents.length - 1];\n }\n\n private getAutoFitContextParent(): HTMLElement {\n const bodyElement = this.overflowParents[0];\n\n return this.config.autoFitContext === SkyAffixAutoFitContext.OverflowParent\n ? this.getImmediateOverflowParent()\n : bodyElement;\n }\n\n private notifyPlacementChange(placement: SkyAffixPlacement | null): void {\n if (this.currentPlacement !== placement) {\n this.currentPlacement = placement;\n this._placementChange.next({\n placement,\n });\n }\n }\n\n private reset(): void {\n this.removeScrollListeners();\n this.removeResizeListener();\n\n this._config =\n this.affixedRect =\n this.baseElement =\n this.baseRect =\n this.currentPlacement =\n this.currentOffset =\n this.overflowParents =\n undefined;\n }\n\n private isNewOffset(offset: SkyAffixOffset): boolean {\n if (this.currentOffset === undefined) {\n this.currentOffset = offset;\n return true;\n }\n\n if (\n this.currentOffset.top === offset.top &&\n this.currentOffset.left === offset.left\n ) {\n return false;\n }\n\n this.currentOffset = offset;\n\n return true;\n }\n\n private isBaseElementVisible(): boolean {\n return isOffsetPartiallyVisibleWithinParent(\n this.getImmediateOverflowParent(),\n {\n top: this.baseRect.top,\n left: this.baseRect.left,\n right: this.baseRect.right,\n bottom: this.baseRect.bottom,\n },\n this.config.autoFitOverflowOffset\n );\n }\n\n private addScrollListeners(): void {\n this.scrollListeners = this.overflowParents.map((parentElement) => {\n const overflow =\n parentElement === document.body ? 'window' : parentElement;\n return this.renderer.listen(overflow, 'scroll', () => {\n this.affix();\n this._overflowScroll.next();\n });\n });\n }\n\n private addResizeListener(): void {\n this.resizeListener = fromEvent(window, 'resize').subscribe(() =>\n this.affix()\n );\n }\n\n private removeResizeListener(): void {\n if (this.resizeListener) {\n this.resizeListener.unsubscribe();\n this.resizeListener = undefined;\n }\n }\n\n private removeScrollListeners(): void {\n if (this.scrollListeners) {\n // Remove renderer-generated listeners by calling the listener itself.\n // https://github.com/angular/angular/issues/9368#issuecomment-227199778\n this.scrollListeners.forEach((listener) => listener());\n this.scrollListeners = undefined;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"affixer.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/affix/affixer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,OAAO,EAAgB,SAAS,EAAE,MAAM,MAAM,CAAC;AAEpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAMlE,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,gCAAgC,EAChC,oCAAoC,GACrC,MAAM,aAAa,CAAC;AAErB,MAAM,oBAAoB,GAAmB;IAC3C,cAAc,EAAE,sBAAsB,CAAC,cAAc;IACrD,aAAa,EAAE,KAAK;IACpB,mBAAmB,EAAE,QAAQ;IAC7B,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,OAAO;CACnB,CAAC;AAEF,MAAM,OAAO,UAAU;IAkErB,YACU,cAA2B,EAC3B,QAAmB;QADnB,mBAAc,GAAd,cAAc,CAAa;QAC3B,aAAQ,GAAR,QAAQ,CAAW;QARrB,kBAAa,GAAG,IAAI,OAAO,EAAwB,CAAC;QAEpD,oBAAe,GAAG,IAAI,OAAO,EAAQ,CAAC;QAEtC,qBAAgB,GAAG,IAAI,OAAO,EAA2B,CAAC;IAK/D,CAAC;IApEJ;;OAEG;IACH,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED;;;;OAIG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,IAAW,eAAe;QACxB,OAAO,IAAI,CAAC,gBAAgB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b,CAAC;IACJ,CAAC;IAEO,oBAAoB;QAC1B,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;SACjC;IACH,CAAC;IAEO,qBAAqB;QAC3B,IAAI,IAAI,CAAC,eAAe,EAAE;YACxB,sEAAsE;YACtE,wEAAwE;YACxE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;YACvD,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;SAClC;IACH,CAAC;CACF","sourcesContent":["import { Renderer2 } from '@angular/core';\n\nimport { Observable, Subject, Subscription, fromEvent } from 'rxjs';\n\nimport { SkyAffixAutoFitContext } from './affix-auto-fit-context';\nimport { SkyAffixConfig } from './affix-config';\nimport { SkyAffixOffset } from './affix-offset';\nimport { SkyAffixOffsetChange } from './affix-offset-change';\nimport { SkyAffixPlacement } from './affix-placement';\nimport { SkyAffixPlacementChange } from './affix-placement-change';\nimport { getInversePlacement, getNextPlacement } from './affix-utils';\nimport {\n getElementOffset,\n getOverflowParents,\n isOffsetFullyVisibleWithinParent,\n isOffsetPartiallyVisibleWithinParent,\n} from './dom-utils';\n\nconst DEFAULT_AFFIX_CONFIG: SkyAffixConfig = {\n autoFitContext: SkyAffixAutoFitContext.OverflowParent,\n enableAutoFit: false,\n horizontalAlignment: 'center',\n isSticky: false,\n placement: 'above',\n};\n\nexport class SkyAffixer {\n /**\n * Fires when the affixed element's offset changes.\n */\n public get offsetChange(): Observable<SkyAffixOffsetChange> {\n return this._offsetChange.asObservable();\n }\n\n /**\n * Fires when the base element's nearest overflow parent is scrolling. This is useful if you need\n * to perform an additional action during the scroll event but don't want to generate another\n * event listener.\n */\n public get overflowScroll(): Observable<void> {\n return this._overflowScroll.asObservable();\n }\n\n /**\n * Fires when the placement value changes. A `null` value indicates that a suitable\n * placement could not be found.\n */\n public get placementChange(): Observable<SkyAffixPlacementChange> {\n return this._placementChange.asObservable();\n }\n\n private get config(): SkyAffixConfig {\n return this._config;\n }\n\n private set config(value: SkyAffixConfig) {\n const merged = { ...DEFAULT_AFFIX_CONFIG, ...value };\n\n // Make sure none of the values are undefined.\n Object.keys(merged).forEach((k: keyof SkyAffixConfig) => {\n if (merged[k] === undefined) {\n (merged as any)[k] = DEFAULT_AFFIX_CONFIG[k];\n }\n });\n\n this._config = merged;\n }\n\n private affixedRect: ClientRect;\n\n private baseElement: HTMLElement;\n\n private baseRect: ClientRect;\n\n private currentOffset: SkyAffixOffset;\n\n private currentPlacement: SkyAffixPlacement;\n\n private overflowParents: HTMLElement[];\n\n private resizeListener: Subscription;\n\n private scrollListeners: Function[];\n\n private _config: SkyAffixConfig;\n\n private _offsetChange = new Subject<SkyAffixOffsetChange>();\n\n private _overflowScroll = new Subject<void>();\n\n private _placementChange = new Subject<SkyAffixPlacementChange>();\n\n constructor(\n private affixedElement: HTMLElement,\n private renderer: Renderer2\n ) {}\n\n /**\n * Affixes an element to a base element.\n * @param baseElement The base element.\n * @param config Configuration for the affix action.\n */\n public affixTo(baseElement: HTMLElement, config?: SkyAffixConfig): void {\n this.reset();\n\n this.config = config;\n this.baseElement = baseElement;\n this.overflowParents = getOverflowParents(baseElement);\n\n this.affix();\n\n if (this.config.isSticky) {\n this.addScrollListeners();\n this.addResizeListener();\n }\n }\n\n /**\n * Re-runs the affix calculation.\n */\n public reaffix(): void {\n // Reset current placement to preferred placement.\n this.currentPlacement = this.config.placement;\n this.affix();\n }\n\n /**\n * Destroys the affixer.\n */\n public destroy(): void {\n this.reset();\n this._placementChange.complete();\n this._offsetChange.complete();\n this._overflowScroll.complete();\n\n this._offsetChange =\n this._placementChange =\n this._overflowScroll =\n undefined;\n }\n\n private affix(): void {\n this.baseRect = this.baseElement.getBoundingClientRect();\n this.affixedRect = this.affixedElement.getBoundingClientRect();\n\n const offset = this.getOffset();\n\n if (this.isNewOffset(offset)) {\n this.renderer.setStyle(this.affixedElement, 'top', `${offset.top}px`);\n this.renderer.setStyle(this.affixedElement, 'left', `${offset.left}px`);\n this._offsetChange.next({ offset });\n }\n }\n\n private getOffset(): SkyAffixOffset {\n const parent = this.getAutoFitContextParent();\n\n const maxAttempts = 4;\n let attempts = 0;\n\n let isAffixedElementFullyVisible = false;\n let offset: SkyAffixOffset;\n let placement = this.config.placement;\n\n do {\n offset = this.getPreferredOffset(placement);\n isAffixedElementFullyVisible = isOffsetFullyVisibleWithinParent(\n parent,\n offset,\n this.config.autoFitOverflowOffset\n );\n\n if (!this.config.enableAutoFit) {\n break;\n }\n\n if (!isAffixedElementFullyVisible) {\n placement =\n attempts % 2 === 0\n ? getInversePlacement(placement)\n : getNextPlacement(placement);\n }\n\n attempts++;\n } while (!isAffixedElementFullyVisible && attempts < maxAttempts);\n\n if (isAffixedElementFullyVisible) {\n if (this.isBaseElementVisible()) {\n this.notifyPlacementChange(placement);\n } else {\n /* tslint:disable-next-line:no-null-keyword */\n this.notifyPlacementChange(null);\n }\n\n return offset;\n }\n\n if (this.config.enableAutoFit) {\n /* tslint:disable-next-line:no-null-keyword */\n this.notifyPlacementChange(null);\n }\n\n // No suitable placement was found, so revert to preferred placement.\n return this.getPreferredOffset(this.config.placement);\n }\n\n private getPreferredOffset(placement: SkyAffixPlacement): SkyAffixOffset {\n const affixedRect = this.affixedRect;\n const baseRect = this.baseRect;\n\n const horizontalAlignment = this.config.horizontalAlignment;\n const verticalAlignment = this.config.verticalAlignment;\n const enableAutoFit = this.config.enableAutoFit;\n\n let top: number;\n let left: number;\n\n if (placement === 'above' || placement === 'below') {\n if (placement === 'above') {\n top = baseRect.top - affixedRect.height;\n\n switch (verticalAlignment) {\n case 'top':\n top = top + affixedRect.height;\n break;\n case 'middle':\n top = top + affixedRect.height / 2;\n break;\n case 'bottom':\n default:\n break;\n }\n } else {\n top = baseRect.bottom;\n\n switch (verticalAlignment) {\n case 'top':\n default:\n break;\n case 'middle':\n top = top - affixedRect.height / 2;\n break;\n case 'bottom':\n top = top - affixedRect.height;\n break;\n }\n }\n\n switch (horizontalAlignment) {\n case 'left':\n left = baseRect.left;\n break;\n\n case 'center':\n default:\n left = baseRect.left + baseRect.width / 2 - affixedRect.width / 2;\n break;\n\n case 'right':\n left = baseRect.right - affixedRect.width;\n break;\n }\n } else {\n if (placement === 'left') {\n left = baseRect.left - affixedRect.width;\n } else {\n left = baseRect.right;\n }\n\n switch (verticalAlignment) {\n case 'top':\n top = baseRect.top;\n break;\n\n case 'middle':\n default:\n top = baseRect.top + baseRect.height / 2 - affixedRect.height / 2;\n break;\n\n case 'bottom':\n top = baseRect.bottom - affixedRect.height;\n break;\n }\n }\n\n let offset: SkyAffixOffset = { left, top };\n if (enableAutoFit) {\n offset = this.adjustOffsetToOverflowParent({ ...offset }, placement);\n }\n\n offset.bottom = offset.top + affixedRect.height;\n offset.right = offset.left + affixedRect.width;\n\n return offset;\n }\n\n /**\n * Slightly adjust the offset to fit within the scroll parent's boundaries if\n * the affixed element would otherwise be clipped.\n */\n private adjustOffsetToOverflowParent(\n offset: SkyAffixOffset,\n placement: SkyAffixPlacement\n ): SkyAffixOffset {\n const parent = this.getAutoFitContextParent();\n const parentOffset = getElementOffset(\n parent,\n this.config.autoFitOverflowOffset\n );\n\n const affixedRect = this.affixedRect;\n const baseRect = this.baseRect;\n\n // A pixel value representing the leeway between the edge of the overflow parent and the edge\n // of the base element before it dissapears from view.\n // If the visible portion of the base element is less than this pixel value, the auto-fit\n // functionality attempts to find another placement.\n const defaultPixelTolerance = 40;\n let pixelTolerance: number;\n\n const originalOffsetTop = offset.top;\n const originalOffsetLeft = offset.left;\n\n /* tslint:disable-next-line:switch-default */\n switch (placement) {\n case 'above':\n case 'below':\n // Keep the affixed element within the overflow parent.\n if (offset.left < parentOffset.left) {\n offset.left = parentOffset.left;\n } else if (offset.left + affixedRect.width > parentOffset.right) {\n offset.left = parentOffset.right - affixedRect.width;\n }\n\n // Use a smaller pixel tolerance if the base element width is less than the default.\n pixelTolerance = Math.min(defaultPixelTolerance, baseRect.width);\n\n // Make sure the affixed element never detaches from the base element.\n if (\n offset.left + pixelTolerance > baseRect.right ||\n offset.left + affixedRect.width - pixelTolerance < baseRect.left\n ) {\n offset.left = originalOffsetLeft;\n }\n\n break;\n\n case 'left':\n case 'right':\n // Keep the affixed element within the overflow parent.\n if (offset.top < parentOffset.top) {\n offset.top = parentOffset.top;\n } else if (offset.top + affixedRect.height > parentOffset.bottom) {\n offset.top = parentOffset.bottom - affixedRect.height;\n }\n\n // Use a smaller pixel tolerance if the base element height is less than the default.\n pixelTolerance = Math.min(defaultPixelTolerance, baseRect.height);\n\n // Make sure the affixed element never detaches from the base element.\n if (\n offset.top + pixelTolerance > baseRect.bottom ||\n offset.top + affixedRect.height - pixelTolerance < baseRect.top\n ) {\n offset.top = originalOffsetTop;\n }\n\n break;\n }\n\n return offset;\n }\n\n private getImmediateOverflowParent(): HTMLElement {\n return this.overflowParents[this.overflowParents.length - 1];\n }\n\n private getAutoFitContextParent(): HTMLElement {\n const bodyElement = this.overflowParents[0];\n\n return this.config.autoFitContext === SkyAffixAutoFitContext.OverflowParent\n ? this.getImmediateOverflowParent()\n : bodyElement;\n }\n\n private notifyPlacementChange(placement: SkyAffixPlacement | null): void {\n if (this.currentPlacement !== placement) {\n this.currentPlacement = placement;\n this._placementChange.next({\n placement,\n });\n }\n }\n\n private reset(): void {\n this.removeScrollListeners();\n this.removeResizeListener();\n\n this._config =\n this.affixedRect =\n this.baseElement =\n this.baseRect =\n this.currentPlacement =\n this.currentOffset =\n this.overflowParents =\n undefined;\n }\n\n private isNewOffset(offset: SkyAffixOffset): boolean {\n if (this.currentOffset === undefined) {\n this.currentOffset = offset;\n return true;\n }\n\n if (\n this.currentOffset.top === offset.top &&\n this.currentOffset.left === offset.left\n ) {\n return false;\n }\n\n this.currentOffset = offset;\n\n return true;\n }\n\n private isBaseElementVisible(): boolean {\n return isOffsetPartiallyVisibleWithinParent(\n this.getImmediateOverflowParent(),\n {\n top: this.baseRect.top,\n left: this.baseRect.left,\n right: this.baseRect.right,\n bottom: this.baseRect.bottom,\n },\n this.config.autoFitOverflowOffset\n );\n }\n\n private addScrollListeners(): void {\n this.scrollListeners = this.overflowParents.map((parentElement) => {\n const overflow =\n parentElement === document.body ? 'window' : parentElement;\n return this.renderer.listen(overflow, 'scroll', () => {\n this.affix();\n this._overflowScroll.next();\n });\n });\n }\n\n private addResizeListener(): void {\n this.resizeListener = fromEvent(window, 'resize').subscribe(() =>\n this.affix()\n );\n }\n\n private removeResizeListener(): void {\n if (this.resizeListener) {\n this.resizeListener.unsubscribe();\n this.resizeListener = undefined;\n }\n }\n\n private removeScrollListeners(): void {\n if (this.scrollListeners) {\n // Remove renderer-generated listeners by calling the listener itself.\n // https://github.com/angular/angular/issues/9368#issuecomment-227199778\n this.scrollListeners.forEach((listener) => listener());\n this.scrollListeners = undefined;\n }\n }\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Injectable, RendererFactory2, } from '@angular/core';
2
- import { fromEvent as observableFromEvent, Subject } from 'rxjs';
2
+ import { Subject, fromEvent as observableFromEvent } from 'rxjs';
3
3
  import { debounceTime, takeUntil } from 'rxjs/operators';
4
4
  import { MutationObserverService } from '../mutation/mutation-observer-service';
5
5
  import * as i0 from "@angular/core";
@@ -1 +1 @@
1
- {"version":3,"file":"dock-dom-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dock/dock-dom-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAGV,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;;;AAEhF;;GAEG;AAEH,M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,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;;sHAhGU,wBAAwB;0HAAxB,wBAAwB;4FAAxB,wBAAwB;kBADpC,UAAU","sourcesContent":["import {\n ElementRef,\n Injectable,\n OnDestroy,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\n\nimport { fromEvent as observableFromEvent, Subject } from 'rxjs';\n\nimport { debounceTime, takeUntil } from 'rxjs/operators';\n\nimport { MutationObserverService } from '../mutation/mutation-observer-service';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyDockDomAdapterService implements OnDestroy {\n private currentDockHeight: number;\n\n private ngUnsubscribe = new Subject<void>();\n\n private observer: MutationObserver;\n\n private renderer: Renderer2;\n\n private styleElement: HTMLStyleElement;\n\n constructor(\n private mutationService: MutationObserverService,\n rendererFactory: RendererFactory2\n ) {\n this.renderer = rendererFactory.createRenderer(undefined, undefined);\n }\n\n public ngOnDestroy(): void {\n if (this.observer) {\n this.observer.disconnect();\n }\n this.ngUnsubscribe.next();\n\n if (this.styleElement) {\n this.destroyStyleElement();\n }\n\n this.currentDockHeight =\n this.ngUnsubscribe =\n this.observer =\n this.styleElement =\n undefined;\n }\n\n public setSticky(elementRef: ElementRef): void {\n this.renderer.addClass(elementRef.nativeElement, 'sky-dock-sticky');\n }\n\n public setZIndex(zIndex: number, elementRef: ElementRef): void {\n this.renderer.setStyle(elementRef.nativeElement, 'z-index', zIndex);\n }\n\n public unbindDock(elementRef: ElementRef): void {\n this.renderer.addClass(elementRef.nativeElement, 'sky-dock-unbound');\n }\n\n public watchDomChanges(elementRef: ElementRef): void {\n this.observer = this.mutationService.create(() => {\n this.adjustBodyStyles(elementRef);\n });\n\n this.observer.observe(elementRef.nativeElement, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n });\n\n observableFromEvent(window, 'resize')\n .pipe(debounceTime(250), takeUntil(this.ngUnsubscribe))\n .subscribe(() => this.adjustBodyStyles(elementRef));\n }\n\n private adjustBodyStyles(elementRef: ElementRef): void {\n const dockHeight = elementRef.nativeElement.getBoundingClientRect().height;\n if (dockHeight === this.currentDockHeight) {\n return;\n }\n\n // Create a style element to avoid overwriting any existing inline body styles.\n const styleElement = this.renderer.createElement('style');\n const textNode = this.renderer.createText(\n `body { margin-bottom: ${dockHeight}px; }`\n );\n\n // Apply a `data-` attribute to make unit testing easier.\n this.renderer.setAttribute(\n styleElement,\n 'data-test-selector',\n 'sky-layout-dock-bottom-styles'\n );\n\n this.renderer.appendChild(styleElement, textNode);\n this.renderer.appendChild(document.head, styleElement);\n\n if (this.styleElement) {\n this.destroyStyleElement();\n }\n\n this.currentDockHeight = dockHeight;\n this.styleElement = styleElement;\n }\n\n private destroyStyleElement(): void {\n this.renderer.removeChild(document.head, this.styleElement);\n }\n}\n"]}
1
+ {"version":3,"file":"dock-dom-adapter.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dock/dock-dom-adapter.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAGV,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,MAAM,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;;;AAEhF;;GAEG;AAEH,MAAM,OAAO,wBAAwB;IAWnC,YACU,eAAwC,EAChD,eAAiC;QADzB,oBAAe,GAAf,eAAe,CAAyB;QAT1C,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;QAY1C,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;IAEM,WAAW;QAChB,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;SAC5B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C,CAAC,CAAC;IACxD,CAAC;IAEO,gBAAgB,CAAC,UAAsB;QAC7C,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC;QAC3E,IAAI,UAAU,KAAK,IAAI,CAAC,iBAAiB,EAAE;YACzC,OAAO;SACR;QAED,+EAA+E;QAC/E,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,CACvC,yBAAyB,UAAU,OAAO,CAC3C,CAAC;QAEF,yDAAyD;QACzD,IAAI,CAAC,QAAQ,CAAC,YAAY,CACxB,YAAY,EACZ,oBAAoB,EACpB,+BAA+B,CAChC,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;QAEvD,IAAI,IAAI,CAAC,YAAY,EAAE;YACrB,IAAI,CAAC,mBAAmB,EAAE,CAAC;SAC5B;QAED,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC;QACpC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAEO,mBAAmB;QACzB,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9D,CAAC;;sHAhGU,wBAAwB;0HAAxB,wBAAwB;4FAAxB,wBAAwB;kBADpC,UAAU","sourcesContent":["import {\n ElementRef,\n Injectable,\n OnDestroy,\n Renderer2,\n RendererFactory2,\n} from '@angular/core';\n\nimport { Subject, fromEvent as observableFromEvent } from 'rxjs';\nimport { debounceTime, takeUntil } from 'rxjs/operators';\n\nimport { MutationObserverService } from '../mutation/mutation-observer-service';\n\n/**\n * @internal\n */\n@Injectable()\nexport class SkyDockDomAdapterService implements OnDestroy {\n private currentDockHeight: number;\n\n private ngUnsubscribe = new Subject<void>();\n\n private observer: MutationObserver;\n\n private renderer: Renderer2;\n\n private styleElement: HTMLStyleElement;\n\n constructor(\n private mutationService: MutationObserverService,\n rendererFactory: RendererFactory2\n ) {\n this.renderer = rendererFactory.createRenderer(undefined, undefined);\n }\n\n public ngOnDestroy(): void {\n if (this.observer) {\n this.observer.disconnect();\n }\n this.ngUnsubscribe.next();\n\n if (this.styleElement) {\n this.destroyStyleElement();\n }\n\n this.currentDockHeight =\n this.ngUnsubscribe =\n this.observer =\n this.styleElement =\n undefined;\n }\n\n public setSticky(elementRef: ElementRef): void {\n this.renderer.addClass(elementRef.nativeElement, 'sky-dock-sticky');\n }\n\n public setZIndex(zIndex: number, elementRef: ElementRef): void {\n this.renderer.setStyle(elementRef.nativeElement, 'z-index', zIndex);\n }\n\n public unbindDock(elementRef: ElementRef): void {\n this.renderer.addClass(elementRef.nativeElement, 'sky-dock-unbound');\n }\n\n public watchDomChanges(elementRef: ElementRef): void {\n this.observer = this.mutationService.create(() => {\n this.adjustBodyStyles(elementRef);\n });\n\n this.observer.observe(elementRef.nativeElement, {\n attributes: true,\n childList: true,\n characterData: true,\n subtree: true,\n });\n\n observableFromEvent(window, 'resize')\n .pipe(debounceTime(250), takeUntil(this.ngUnsubscribe))\n .subscribe(() => this.adjustBodyStyles(elementRef));\n }\n\n private adjustBodyStyles(elementRef: ElementRef): void {\n const dockHeight = elementRef.nativeElement.getBoundingClientRect().height;\n if (dockHeight === this.currentDockHeight) {\n return;\n }\n\n // Create a style element to avoid overwriting any existing inline body styles.\n const styleElement = this.renderer.createElement('style');\n const textNode = this.renderer.createText(\n `body { margin-bottom: ${dockHeight}px; }`\n );\n\n // Apply a `data-` attribute to make unit testing easier.\n this.renderer.setAttribute(\n styleElement,\n 'data-test-selector',\n 'sky-layout-dock-bottom-styles'\n );\n\n this.renderer.appendChild(styleElement, textNode);\n this.renderer.appendChild(document.head, styleElement);\n\n if (this.styleElement) {\n this.destroyStyleElement();\n }\n\n this.currentDockHeight = dockHeight;\n this.styleElement = styleElement;\n }\n\n private destroyStyleElement(): void {\n this.renderer.removeChild(document.head, this.styleElement);\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dock.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dock/dock.component.ts","../../../../../../../../libs/components/core/src/lib/modules/dock/dock.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,wBAAwB,EACxB,UAAU,EACV,QAAQ,EAER,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAMtE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;;;AAEzD;;GAEG;AAQH,MAAM,OAAO,gBAAgB;IAW3B,YACU,cAAiC,EACjC,QAAkC,EAClC,UAAsB,EACtB,QAAkB,EAClB,UAAoC;QAJpC,mBAAc,GAAd,cAAc,CAAmB;QACjC,aAAQ,GAAR,QAAQ,CAA0B;QAClC,eAAU,GAAV,UAAU,CAAY;QACtB,aAAQ,GAAR,QAAQ,CAAU;QAClB,eAAU,GAAV,UAAU,CAA0B;QAPtC,aAAQ,GAAgC,EAAE,CAAC;IAQhD,CAAC;IAEG,eAAe,CACpB,SAAkB,EAClB,SAAuC,EAAE;QAEzC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC;QACjE,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC;YAC/B,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;YACjC,MAAM,EAAE,IAAI,CAAC,QAAQ;SACtB,CAAC,CAAC;QAEH,MA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AAS;uBAAC,QAAQ,EAAE;wBACnB,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ComponentFactoryResolver,\n ElementRef,\n Injector,\n Type,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { SkyDockDomAdapterService } from './dock-dom-adapter.service';\n\nimport { SkyDockInsertComponentConfig } from './dock-insert-component-config';\n\nimport { SkyDockItemReference } from './dock-item-reference';\n\nimport { SkyDockLocation } from './dock-location';\n\nimport { SkyDockOptions } from './dock-options';\n\nimport { sortByStackOrder } from './sort-by-stack-order';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-dock',\n templateUrl: './dock.component.html',\n styleUrls: ['./dock.component.scss'],\n providers: [SkyDockDomAdapterService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDockComponent {\n private options: SkyDockOptions;\n\n @ViewChild('target', {\n read: ViewContainerRef,\n static: true,\n })\n private target: ViewContainerRef;\n\n private itemRefs: SkyDockItemReference<any>[] = [];\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private resolver: ComponentFactoryResolver,\n private elementRef: ElementRef,\n private injector: Injector,\n private domAdapter: SkyDockDomAdapterService\n ) {}\n\n public insertComponent<T>(\n component: Type<T>,\n config: SkyDockInsertComponentConfig = {}\n ): SkyDockItemReference<T> {\n const factory = this.resolver.resolveComponentFactory(component);\n const injector = Injector.create({\n providers: config.providers || [],\n parent: this.injector,\n });\n\n const componentRef = this.target.createComponent<T>(\n factory,\n undefined,\n injector\n );\n const stackOrder =\n config.stackOrder !== null && config.stackOrder !== undefined\n ? config.stackOrder\n : this.getHighestStackOrder();\n\n this.itemRefs.push({\n componentRef,\n stackOrder,\n });\n\n this.sortItemsByStackOrder();\n\n this.changeDetector.markForCheck();\n\n return {\n componentRef,\n stackOrder,\n };\n }\n\n public removeItem(item: SkyDockItemReference<any>): void {\n const viewRef = item.componentRef.hostView;\n this.target.remove(this.target.indexOf(viewRef));\n\n const found = this.itemRefs.find(\n (i) => i.componentRef.hostView === viewRef\n );\n this.itemRefs.splice(this.itemRefs.indexOf(found), 1);\n }\n\n public setOptions(options: SkyDockOptions): void {\n this.options = options;\n\n switch (this.options?.location) {\n case SkyDockLocation.BeforeElement:\n this.domAdapter.unbindDock(this.elementRef);\n break;\n case SkyDockLocation.ElementBottom:\n this.domAdapter.setSticky(this.elementRef);\n break;\n case SkyDockLocation.BodyBottom:\n default:\n this.domAdapter.watchDomChanges(this.elementRef);\n break;\n }\n\n if (this.options?.zIndex) {\n this.domAdapter.setZIndex(this.options.zIndex, this.elementRef);\n }\n }\n\n private sortItemsByStackOrder(): void {\n this.itemRefs.sort(sortByStackOrder);\n\n // Reassign the correct index for each view.\n this.itemRefs.forEach((item, i) =>\n this.target.move(item.componentRef.hostView, i)\n );\n }\n\n private getHighestStackOrder(): number {\n if (this.itemRefs.length === 0) {\n return 0;\n }\n\n return this.itemRefs[0].stackOrder + 1;\n }\n}\n","<ng-container #target></ng-container>\n"]}
1
+ {"version":3,"file":"dock.component.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dock/dock.component.ts","../../../../../../../../libs/components/core/src/lib/modules/dock/dock.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,wBAAwB,EACxB,UAAU,EACV,QAAQ,EAER,SAAS,EACT,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;;;AAEzD;;GAEG;AAQH,MAAM,OAAO,gBAAgB;IAW3B,YACU,cAAiC,EACjC,QAAkC,EAClC,UAAsB,EACtB,QAAkB,EAClB,UAAoC;QAJpC,mBAAc,GA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AC,MAAM,KAAK,CAAC,EAAE;YAC9B,OAAO,CAAC,CAAC;SACV;QAED,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC;IACzC,CAAC;;8GApGU,gBAAgB;kGAAhB,gBAAgB,mCAHhB,CAAC,wBAAwB,CAAC,uGAO7B,gBAAgB,2CCjC1B,yCACA;4FD4Ba,gBAAgB;kBAP5B,SAAS;mBAAC;oBACT,QAAQ,EAAE,UAAU;oBACpB,WAAW,EAAE,uBAAuB;oBACpC,SAAS,EAAE,CAAC,uBAAuB,CAAC;oBACpC,SAAS,EAAE,CAAC,wBAAwB,CAAC;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;sOAQS,MAAM;sBAJb,SAAS;uBAAC,QAAQ,EAAE;wBACnB,IAAI,EAAE,gBAAgB;wBACtB,MAAM,EAAE,IAAI;qBACb","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ComponentFactoryResolver,\n ElementRef,\n Injector,\n Type,\n ViewChild,\n ViewContainerRef,\n} from '@angular/core';\n\nimport { SkyDockDomAdapterService } from './dock-dom-adapter.service';\nimport { SkyDockInsertComponentConfig } from './dock-insert-component-config';\nimport { SkyDockItemReference } from './dock-item-reference';\nimport { SkyDockLocation } from './dock-location';\nimport { SkyDockOptions } from './dock-options';\nimport { sortByStackOrder } from './sort-by-stack-order';\n\n/**\n * @internal\n */\n@Component({\n selector: 'sky-dock',\n templateUrl: './dock.component.html',\n styleUrls: ['./dock.component.scss'],\n providers: [SkyDockDomAdapterService],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyDockComponent {\n private options: SkyDockOptions;\n\n @ViewChild('target', {\n read: ViewContainerRef,\n static: true,\n })\n private target: ViewContainerRef;\n\n private itemRefs: SkyDockItemReference<any>[] = [];\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n private resolver: ComponentFactoryResolver,\n private elementRef: ElementRef,\n private injector: Injector,\n private domAdapter: SkyDockDomAdapterService\n ) {}\n\n public insertComponent<T>(\n component: Type<T>,\n config: SkyDockInsertComponentConfig = {}\n ): SkyDockItemReference<T> {\n const factory = this.resolver.resolveComponentFactory(component);\n const injector = Injector.create({\n providers: config.providers || [],\n parent: this.injector,\n });\n\n const componentRef = this.target.createComponent<T>(\n factory,\n undefined,\n injector\n );\n const stackOrder =\n config.stackOrder !== null && config.stackOrder !== undefined\n ? config.stackOrder\n : this.getHighestStackOrder();\n\n this.itemRefs.push({\n componentRef,\n stackOrder,\n });\n\n this.sortItemsByStackOrder();\n\n this.changeDetector.markForCheck();\n\n return {\n componentRef,\n stackOrder,\n };\n }\n\n public removeItem(item: SkyDockItemReference<any>): void {\n const viewRef = item.componentRef.hostView;\n this.target.remove(this.target.indexOf(viewRef));\n\n const found = this.itemRefs.find(\n (i) => i.componentRef.hostView === viewRef\n );\n this.itemRefs.splice(this.itemRefs.indexOf(found), 1);\n }\n\n public setOptions(options: SkyDockOptions): void {\n this.options = options;\n\n switch (this.options?.location) {\n case SkyDockLocation.BeforeElement:\n this.domAdapter.unbindDock(this.elementRef);\n break;\n case SkyDockLocation.ElementBottom:\n this.domAdapter.setSticky(this.elementRef);\n break;\n case SkyDockLocation.BodyBottom:\n default:\n this.domAdapter.watchDomChanges(this.elementRef);\n break;\n }\n\n if (this.options?.zIndex) {\n this.domAdapter.setZIndex(this.options.zIndex, this.elementRef);\n }\n }\n\n private sortItemsByStackOrder(): void {\n this.itemRefs.sort(sortByStackOrder);\n\n // Reassign the correct index for each view.\n this.itemRefs.forEach((item, i) =>\n this.target.move(item.componentRef.hostView, i)\n );\n }\n\n private getHighestStackOrder(): number {\n if (this.itemRefs.length === 0) {\n return 0;\n }\n\n return this.itemRefs[0].stackOrder + 1;\n }\n}\n","<ng-container #target></ng-container>\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dock.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dock/dock.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;;AAQpD,MAAM,OAAO,aAAa;;2GAAb,aAAa;4GAAb,aAAa,iBAJT,gBAAgB,aADrB,YAAY;4GAKX,aAAa,aAFb,CAAC,uBAAuB,CAAC,YAH3B,CAAC,YAAY,CAAC;4FAKZ,aAAa;kBANzB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,gBAAgB,CAAC;oBAChC,eAAe,EAAE,CAAC,gBAAgB,CAAC;oBACnC,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC","sourcesContent":["import { CommonModule } from '@angular/common';\n\nimport { NgModule } from '@angular/core';\n\nimport { MutationObserverService } from '../mutation/mutation-observer-service';\n\nimport { SkyDockComponent } from './dock.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [SkyDockComponent],\n entryComponents: [SkyDockComponent],\n providers: [MutationObserverService],\n})\nexport class SkyDockModule {}\n"]}
1
+ {"version":3,"file":"dock.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dock/dock.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;;AAQpD,MAAM,OAAO,aAAa;;2GAAb,aAAa;4GAAb,aAAa,iBAJT,gBAAgB,aADrB,YAAY;4GAKX,aAAa,aAFb,CAAC,uBAAuB,CAAC,YAH3B,CAAC,YAAY,CAAC;4FAKZ,aAAa;kBANzB,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,YAAY,CAAC;oBACvB,YAAY,EAAE,CAAC,gBAAgB,CAAC;oBAChC,eAAe,EAAE,CAAC,gBAAgB,CAAC;oBACnC,SAAS,EAAE,CAAC,uBAAuB,CAAC;iBACrC","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { MutationObserverService } from '../mutation/mutation-observer-service';\n\nimport { SkyDockComponent } from './dock.component';\n\n@NgModule({\n imports: [CommonModule],\n declarations: [SkyDockComponent],\n entryComponents: [SkyDockComponent],\n providers: [MutationObserverService],\n})\nexport class SkyDockModule {}\n"]}
@@ -1,9 +1,9 @@
1
1
  import { Injectable } from '@angular/core';
2
- import { SkyDockItem } from './dock-item';
3
- import { SkyDockComponent } from './dock.component';
4
- import { SkyDockLocation } from './dock-location';
5
2
  import { SkyDynamicComponentLocation } from '../dynamic-component/dynamic-component-location';
6
3
  import { SkyDynamicComponentService } from '../dynamic-component/dynamic-component.service';
4
+ import { SkyDockItem } from './dock-item';
5
+ import { SkyDockLocation } from './dock-location';
6
+ import { SkyDockComponent } from './dock.component';
7
7
  import { sortByStackOrder } from './sort-by-stack-order';
8
8
  import * as i0 from "@angular/core";
9
9
  import * as i1 from "../dynamic-component/dynamic-component.service";
@@ -1 +1 @@
1
- {"version":3,"file":"dock.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dock/dock.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAQ,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAIlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAI9F,OAAO,EAAE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AAuB;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAEO,UAAU;QAChB,IAAI,WAAuC,CAAC;QAE5C,IAAI,IAAI,CAAC,OAAO,EAAE;YAChB,IAAI,eAA4C,CAAC;YACjD,QAAQ,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;gBAC7B,KAAK,eAAe,CAAC,aAAa;oBAChC,eAAe,GAAG,2BAA2B,CAAC,aAAa,CAAC;oBAC5D,MAAM;gBACR,KAAK,eAAe,CAAC,aAAa;oBAChC,eAAe,GAAG,2BAA2B,CAAC,aAAa,CAAC;oBAC5D,MAAM;gBACR;oBACE,eAAe,GAAG,2BAA2B,CAAC,OAAO,CAAC;oBACtD,MAAM;aACT;YAED,WAAW,GAAG;gBACZ,QAAQ,EAAE,eAAe;gBACzB,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW;aACtC,CAAC;SACH;QAED,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,uBAAuB,CAAC,eAAe,CACzD,gBAAgB,EAChB,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3D,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;;4GA7FU,cAAc;gHAAd,cAAc,cAFb,MAAM;4FAEP,cAAc;kBAH1B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { ComponentRef, Injectable, Type } from '@angular/core';\n\nimport { SkyDockItem } from './dock-item';\n\nimport { SkyDockComponent } from './dock.component';\n\nimport { SkyDockInsertComponentConfig } from './dock-insert-component-config';\n\nimport { SkyDockLocation } from './dock-location';\n\nimport { SkyDockOptions } from './dock-options';\n\nimport { SkyDynamicComponentLocation } from '../dynamic-component/dynamic-component-location';\n\nimport { SkyDynamicComponentOptions } from '../dynamic-component/dynamic-component-options';\n\nimport { SkyDynamicComponentService } from '../dynamic-component/dynamic-component.service';\n\nimport { sortByStackOrder } from './sort-by-stack-order';\n\n/**\n * This service docks components to specific areas on the page.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyDockService {\n /**\n * Returns all docked items.\n */\n public get items(): SkyDockItem<any>[] {\n return this._items;\n }\n\n private dockRef: ComponentRef<SkyDockComponent>;\n\n private options: SkyDockOptions;\n\n private _items: SkyDockItem<any>[] = [];\n\n constructor(private dynamicComponentService: SkyDynamicComponentService) {}\n\n /**\n * Docks a component to the bottom of the page.\n * @param component The component to dock.\n * @param config Options that affect the docking action.\n */\n public insertComponent<T>(\n component: Type<T>,\n config?: SkyDockInsertComponentConfig\n ): SkyDockItem<T> {\n if (!this.dockRef) {\n this.createDock();\n }\n\n const itemRef = this.dockRef.instance.insertComponent(component, config);\n const item = new SkyDockItem(\n itemRef.componentRef.instance,\n itemRef.stackOrder\n );\n\n item.destroyed.subscribe(() => {\n this.dockRef.instance.removeItem(itemRef);\n this._items.splice(this._items.indexOf(item), 1);\n if (this._items.length === 0) {\n this.destroyDock();\n }\n });\n\n this._items.push(item);\n this._items.sort(sortByStackOrder);\n\n return item;\n }\n\n /**\n * Sets options for the positioning and styling of the dock component. Since the dock service is a\n * singleton instance, these options will be applied to all components inserted into the dock. In\n * order to create a seperate dock with different options, consumers should provide a different\n * instance of the dock service.\n * @param options The options for positioning and styling\n */\n public setDockOptions(options: SkyDockOptions): void {\n this.options = options;\n }\n\n private createDock(): void {\n let dockOptions: SkyDynamicComponentOptions;\n\n if (this.options) {\n let dynamicLocation: SkyDynamicComponentLocation;\n switch (this.options.location) {\n case SkyDockLocation.BeforeElement:\n dynamicLocation = SkyDynamicComponentLocation.BeforeElement;\n break;\n case SkyDockLocation.ElementBottom:\n dynamicLocation = SkyDynamicComponentLocation.ElementBottom;\n break;\n default:\n dynamicLocation = SkyDynamicComponentLocation.BodyTop;\n break;\n }\n\n dockOptions = {\n location: dynamicLocation,\n referenceEl: this.options.referenceEl,\n };\n }\n\n this.dockRef = this.dynamicComponentService.createComponent(\n SkyDockComponent,\n dockOptions\n );\n this.dockRef.instance.setOptions(this.options);\n }\n\n private destroyDock(): void {\n this.dynamicComponentService.removeComponent(this.dockRef);\n this.dockRef = undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"dock.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dock/dock.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,UAAU,EAAQ,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,iDAAiD,CAAC;AAE9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAG5F,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;;;AAEzD;;GAEG;AAIH,MAAM,OAAO,cAAc;IAczB,YAAoB,uBAAmD;QAAnD,4BAAuB,GAAvB,uBAAuB,CAA4B;QAF/D,WAAM,GAAuB,EAAE,CAAC;IAEkC,CAAC;IAb3E;;OAEG;IACH,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAUD;;;;OAIG;IACI,eAAe,CACpB,SAAkB,EAClB,MAAqC;QAErC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;YACjB,IAAI,CAAC,UAAU,EAAE,CAAC;SACnB;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QACzE,MAAM,IAAI,GAAG,IAAI,WAAW,CAC1B,OA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,IAAI,CAAC,uBAAuB,CAAC,eAAe,CACzD,gBAAgB,EAChB,WAAW,CACZ,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACjD,CAAC;IAEO,WAAW;QACjB,IAAI,CAAC,uBAAuB,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3D,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;;4GA7FU,cAAc;gHAAd,cAAc,cAFb,MAAM;4FAEP,cAAc;kBAH1B,UAAU;mBAAC;oBACV,UAAU,EAAE,MAAM;iBACnB","sourcesContent":["import { ComponentRef, Injectable, Type } from '@angular/core';\n\nimport { SkyDynamicComponentLocation } from '../dynamic-component/dynamic-component-location';\nimport { SkyDynamicComponentOptions } from '../dynamic-component/dynamic-component-options';\nimport { SkyDynamicComponentService } from '../dynamic-component/dynamic-component.service';\n\nimport { SkyDockInsertComponentConfig } from './dock-insert-component-config';\nimport { SkyDockItem } from './dock-item';\nimport { SkyDockLocation } from './dock-location';\nimport { SkyDockOptions } from './dock-options';\nimport { SkyDockComponent } from './dock.component';\nimport { sortByStackOrder } from './sort-by-stack-order';\n\n/**\n * This service docks components to specific areas on the page.\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class SkyDockService {\n /**\n * Returns all docked items.\n */\n public get items(): SkyDockItem<any>[] {\n return this._items;\n }\n\n private dockRef: ComponentRef<SkyDockComponent>;\n\n private options: SkyDockOptions;\n\n private _items: SkyDockItem<any>[] = [];\n\n constructor(private dynamicComponentService: SkyDynamicComponentService) {}\n\n /**\n * Docks a component to the bottom of the page.\n * @param component The component to dock.\n * @param config Options that affect the docking action.\n */\n public insertComponent<T>(\n component: Type<T>,\n config?: SkyDockInsertComponentConfig\n ): SkyDockItem<T> {\n if (!this.dockRef) {\n this.createDock();\n }\n\n const itemRef = this.dockRef.instance.insertComponent(component, config);\n const item = new SkyDockItem(\n itemRef.componentRef.instance,\n itemRef.stackOrder\n );\n\n item.destroyed.subscribe(() => {\n this.dockRef.instance.removeItem(itemRef);\n this._items.splice(this._items.indexOf(item), 1);\n if (this._items.length === 0) {\n this.destroyDock();\n }\n });\n\n this._items.push(item);\n this._items.sort(sortByStackOrder);\n\n return item;\n }\n\n /**\n * Sets options for the positioning and styling of the dock component. Since the dock service is a\n * singleton instance, these options will be applied to all components inserted into the dock. In\n * order to create a seperate dock with different options, consumers should provide a different\n * instance of the dock service.\n * @param options The options for positioning and styling\n */\n public setDockOptions(options: SkyDockOptions): void {\n this.options = options;\n }\n\n private createDock(): void {\n let dockOptions: SkyDynamicComponentOptions;\n\n if (this.options) {\n let dynamicLocation: SkyDynamicComponentLocation;\n switch (this.options.location) {\n case SkyDockLocation.BeforeElement:\n dynamicLocation = SkyDynamicComponentLocation.BeforeElement;\n break;\n case SkyDockLocation.ElementBottom:\n dynamicLocation = SkyDynamicComponentLocation.ElementBottom;\n break;\n default:\n dynamicLocation = SkyDynamicComponentLocation.BodyTop;\n break;\n }\n\n dockOptions = {\n location: dynamicLocation,\n referenceEl: this.options.referenceEl,\n };\n }\n\n this.dockRef = this.dynamicComponentService.createComponent(\n SkyDockComponent,\n dockOptions\n );\n this.dockRef.instance.setOptions(this.options);\n }\n\n private destroyDock(): void {\n this.dynamicComponentService.removeComponent(this.dockRef);\n this.dockRef = undefined;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"dynamic-component.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dynamic-component/dynamic-component.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,wBAAwB,EAGxB,UAAU,EACV,QAAQ,EAER,gBAAgB,GAEjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;;;AAI3E;;GAEG;AAOH,MAAM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CAAC;gBACF,MAAM;YACR,KAAK,2BAA2B,CAAC,aAAa;gBAC5C,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;gBACnD,MAAM;YACR,KAAK,2BAA2B,CAAC,OAAO;gBACtC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;gBAC1D,MAAM;YACR;gBACE,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBACtC,MAAM;SACT;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,eAAe,CAAI,YAA6B;QACrD,IAAI,CAAC,YAAY,EAAE;YACjB,OAAO;SACR;QAED,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACtD,YAAY,CAAC,OAAO,EAAE,CAAC;IACzB,CAAC;IAEO,WAAW,CAAI,YAA6B;QAClD,sEAAsE;QACtE,wDAAwD;QACxD,OAAQ,YAAY,CAAC,QAA+B,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;;wHAtFU,0BAA0B;4HAA1B,0BAA0B,cAFzB,KAAK;4FAEN,0BAA0B;kBANtC,UAAU;mBAAC;oBACV,0FAA0F;oBAC1F,8FAA8F;oBAC9F,0FAA0F;oBAC1F,UAAU,EAAE,KAAK;iBAClB","sourcesContent":["import {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n EmbeddedViewRef,\n Injectable,\n Injector,\n Renderer2,\n RendererFactory2,\n Type,\n} from '@angular/core';\n\nimport { SkyAppWindowRef } from '../window/window-ref';\n\nimport { SkyDynamicComponentLocation } from './dynamic-component-location';\n\nimport { SkyDynamicComponentOptions } from './dynamic-component-options';\n\n/**\n * Angular service for creating and rendering a dynamic component.\n */\n@Injectable({\n // Must be 'any' so that the component is created in the context of its module's injector.\n // If set to 'root', the component's dependency injections would only be derived from the root\n // injector and may loose context if the component is created within a lazy-loaded module.\n providedIn: 'any',\n})\nexport class SkyDynamicComponentService {\n private renderer: Renderer2;\n\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private applicationRef: ApplicationRef,\n private injector: Injector,\n private windowRef: SkyAppWindowRef,\n rendererFactory: RendererFactory2\n ) {\n // Based on suggestions from https://github.com/angular/angular/issues/17824\n // for accessing an instance of Renderer2 in a service since Renderer2 can't\n // be injected into a service. Passing undefined for both parameters results\n // in the default renderer which is what we want here.\n this.renderer = rendererFactory.createRenderer(undefined, undefined);\n }\n\n /**\n * Creates an instance of the specified component and adds it to the specified location\n * on the page.\n * @param options Options for creating the dynamic component.\n */\n public createComponent<T>(\n componentType: Type<T>,\n options?: SkyDynamicComponentOptions\n ): ComponentRef<T> {\n options = options || {\n location: SkyDynamicComponentLocation.BodyBottom,\n };\n\n const componentRef = this.componentFactoryResolver\n .resolveComponentFactory<T>(componentType)\n .create(this.injector);\n\n this.applicationRef.attachView(componentRef.hostView);\n\n const el = this.getRootNode(componentRef);\n\n const bodyEl = this.windowRef.nativeWindow.document.body;\n\n switch (options.location) {\n case SkyDynamicComponentLocation.BeforeElement:\n this.renderer.insertBefore(\n options.referenceEl.parentElement,\n el,\n options.referenceEl\n );\n break;\n case SkyDynamicComponentLocation.ElementTop:\n this.renderer.insertBefore(\n options.referenceEl,\n el,\n options.referenceEl.firstChild\n );\n break;\n case SkyDynamicComponentLocation.ElementBottom:\n this.renderer.appendChild(options.referenceEl, el);\n break;\n case SkyDynamicComponentLocation.BodyTop:\n this.renderer.insertBefore(bodyEl, el, bodyEl.firstChild);\n break;\n default:\n this.renderer.appendChild(bodyEl, el);\n break;\n }\n\n return componentRef;\n }\n\n /**\n * Removes a component ref from the page\n * @param componentRef Component ref for the component being removed\n */\n public removeComponent<T>(componentRef: ComponentRef<T>): void {\n if (!componentRef) {\n return;\n }\n\n this.applicationRef.detachView(componentRef.hostView);\n componentRef.destroy();\n }\n\n private getRootNode<T>(componentRef: ComponentRef<T>): any {\n // Technique for retrieving the component's root node taken from here:\n // https://malcoded.com/posts/angular-dynamic-components\n return (componentRef.hostView as EmbeddedViewRef<T>).rootNodes[0];\n }\n}\n"]}
1
+ {"version":3,"file":"dynamic-component.service.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/dynamic-component/dynamic-component.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,wBAAwB,EAGxB,UAAU,EACV,QAAQ,EAER,gBAAgB,GAEjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;;;AAG3E;;GAEG;AAOH,MAAM,OAAO,0BAA0B;IAGrC,YACU,wBAAkD,EAClD,cAA8B,EAC9B,QAAkB,EAClB,SAA0B,EAClC,eAAiC;QAJzB,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,mBAAc,GAAd,cAAc,CAAgB;QAC9B,aAAQ,GAAR,QAAQ,CAAU;QAClB,cAAS,GAAT,SAAS,CAAiB;QAGlC,4EAA4E;QAC5E,4EAA4E;QAC5E,6EAA6E;QAC7E,sDAAsD;QACtD,IAAI,CAAC,QAAQ,GAAG,eAAe,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;IAED;;;;OAIG;IACI,eAAe,CACpB,aAAsB,EACtB,OAAoC;QAEpC,OAAO,GAAG,OAAO,IAAI;YACnB,QAAQ,EAAE,2BAA2B,CAAC,UAAU;SACjD,CAAC;QAEF,MAAM,YAAY,GAAG,IAAI,CAAC,wBAAwB;aAC/C,uBAAuB,CAAI,aAAa,CAAC;aACzC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEzB,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC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,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACpE,CAAC;;wHAtFU,0BAA0B;4HAA1B,0BAA0B,cAFzB,KAAK;4FAEN,0BAA0B;kBANtC,UAAU;mBAAC;oBACV,0FAA0F;oBAC1F,8FAA8F;oBAC9F,0FAA0F;oBAC1F,UAAU,EAAE,KAAK;iBAClB","sourcesContent":["import {\n ApplicationRef,\n ComponentFactoryResolver,\n ComponentRef,\n EmbeddedViewRef,\n Injectable,\n Injector,\n Renderer2,\n RendererFactory2,\n Type,\n} from '@angular/core';\n\nimport { SkyAppWindowRef } from '../window/window-ref';\n\nimport { SkyDynamicComponentLocation } from './dynamic-component-location';\nimport { SkyDynamicComponentOptions } from './dynamic-component-options';\n\n/**\n * Angular service for creating and rendering a dynamic component.\n */\n@Injectable({\n // Must be 'any' so that the component is created in the context of its module's injector.\n // If set to 'root', the component's dependency injections would only be derived from the root\n // injector and may loose context if the component is created within a lazy-loaded module.\n providedIn: 'any',\n})\nexport class SkyDynamicComponentService {\n private renderer: Renderer2;\n\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private applicationRef: ApplicationRef,\n private injector: Injector,\n private windowRef: SkyAppWindowRef,\n rendererFactory: RendererFactory2\n ) {\n // Based on suggestions from https://github.com/angular/angular/issues/17824\n // for accessing an instance of Renderer2 in a service since Renderer2 can't\n // be injected into a service. Passing undefined for both parameters results\n // in the default renderer which is what we want here.\n this.renderer = rendererFactory.createRenderer(undefined, undefined);\n }\n\n /**\n * Creates an instance of the specified component and adds it to the specified location\n * on the page.\n * @param options Options for creating the dynamic component.\n */\n public createComponent<T>(\n componentType: Type<T>,\n options?: SkyDynamicComponentOptions\n ): ComponentRef<T> {\n options = options || {\n location: SkyDynamicComponentLocation.BodyBottom,\n };\n\n const componentRef = this.componentFactoryResolver\n .resolveComponentFactory<T>(componentType)\n .create(this.injector);\n\n this.applicationRef.attachView(componentRef.hostView);\n\n const el = this.getRootNode(componentRef);\n\n const bodyEl = this.windowRef.nativeWindow.document.body;\n\n switch (options.location) {\n case SkyDynamicComponentLocation.BeforeElement:\n this.renderer.insertBefore(\n options.referenceEl.parentElement,\n el,\n options.referenceEl\n );\n break;\n case SkyDynamicComponentLocation.ElementTop:\n this.renderer.insertBefore(\n options.referenceEl,\n el,\n options.referenceEl.firstChild\n );\n break;\n case SkyDynamicComponentLocation.ElementBottom:\n this.renderer.appendChild(options.referenceEl, el);\n break;\n case SkyDynamicComponentLocation.BodyTop:\n this.renderer.insertBefore(bodyEl, el, bodyEl.firstChild);\n break;\n default:\n this.renderer.appendChild(bodyEl, el);\n break;\n }\n\n return componentRef;\n }\n\n /**\n * Removes a component ref from the page\n * @param componentRef Component ref for the component being removed\n */\n public removeComponent<T>(componentRef: ComponentRef<T>): void {\n if (!componentRef) {\n return;\n }\n\n this.applicationRef.detachView(componentRef.hostView);\n componentRef.destroy();\n }\n\n private getRootNode<T>(componentRef: ComponentRef<T>): any {\n // Technique for retrieving the component's root node taken from here:\n // https://malcoded.com/posts/angular-dynamic-components\n return (componentRef.hostView as EmbeddedViewRef<T>).rootNodes[0];\n }\n}\n"]}
@@ -7,6 +7,7 @@ export class SkyLogService {
7
7
  warn(message, ...optionalParams) {
8
8
  /*istanbul ignore else */
9
9
  if (window.console) {
10
+ // eslint-disable-next-line prefer-spread,prefer-rest-params
10
11
  window.console.warn.apply(window.console, arguments);
11
12
  }
12
13
  }
@@ -1 +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"]}
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,4DAA4D;YAC5D,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;SACtD;IACH,CAAC;;2GAPU,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 // eslint-disable-next-line prefer-spread,prefer-rest-params\n window.console.warn.apply(window.console, arguments);\n }\n }\n}\n"]}
@@ -1 +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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CAAC;;AAnID;;;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"]}
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,OAAO,EAAE,UAAU,EAAE,MAAM,EAAa,MAAM,eAAe,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAgB,MAAM,MAAM,CAAC;A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G;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';\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"]}
@@ -1 +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"]}
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;AACzC,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';\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"]}
@@ -1,9 +1,9 @@
1
- import { Pipe, ChangeDetectorRef, } from '@angular/core';
1
+ import { ChangeDetectorRef, Pipe, } from '@angular/core';
2
2
  import { SkyAppLocaleProvider } from '@skyux/i18n';
3
- import { takeUntil } from 'rxjs/operators';
4
3
  import { Subject } from 'rxjs';
5
- import { SkyNumericService } from './numeric.service';
4
+ import { takeUntil } from 'rxjs/operators';
6
5
  import { NumericOptions } from './numeric.options';
6
+ import { SkyNumericService } from './numeric.service';
7
7
  import * as i0 from "@angular/core";
8
8
  import * as i1 from "@skyux/i18n";
9
9
  import * as i2 from "./numeric.service";
@@ -38,7 +38,7 @@ export class SkyNumericPipe {
38
38
  }
39
39
  transform(value, config) {
40
40
  var _a;
41
- let newCacheKey = (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +
41
+ const newCacheKey = (config ? JSON.stringify(config, Object.keys(config).sort()) : '') +
42
42
  `${value}_${(config === null || config === void 0 ? void 0 : config.locale) || this.providerLocale}`;
43
43
  /* If the value and locale are the same as the last transform then return the previous value
44
44
  instead of reformatting. */
@@ -1 +1 @@
1
- {"version":3,"file":"numeric.pipe.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/numeric/numeric.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAGJ,iBAAiB,GAClB,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AJ1B,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"]}
1
+ {"version":3,"file":"numeric.pipe.js","sourceRoot":"","sources":["../../../../../../../../libs/components/core/src/lib/modules/numeric/numeric.pipe.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAEjB,IAAI,GAEL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;;;;AAEtD;;;;;;;;;GASG;AAKH,MAAM,OAAO,cAAc;IASzB,YACU,cAAoC,EAC3B,cAAiC,EAC1C,cAAiC;QAFjC,mBAAc,GAAd,cAAc,CAAsB;QAC3B,mBAAc,GAAd,cAAc,CAAmB;QAC1C,mBAAc,GAAd,cAAc,CAAmB;QALnC,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;QAO1C,IAAI,CAAC,cAAc;aAChB,aAAa,EAAE;aACf,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;aACnC,SAAS,CAAC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,MAAM,IAAI,MAAM,CAAC,SAAS,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;YACvD,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;SACnC;QAED,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAE/B,+CAA+C;QAC/C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACtB,IAAI,CAAC,mBAAmB,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,mCAAI,IAAI,CAAC,cAAc,CAAC;QACjE,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC;QAE5B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACvE,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;;4GAzEU,cAAc;0GAAd,cAAc;4FAAd,cAAc;kBAJ1B,IAAI;mBAAC;oBACJ,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,KAAK;iBACZ","sourcesContent":["import {\n ChangeDetectorRef,\n OnDestroy,\n Pipe,\n PipeTransform,\n} from '@angular/core';\nimport { SkyAppLocaleProvider } from '@skyux/i18n';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { NumericOptions } from './numeric.options';\nimport { SkyNumericService } from './numeric.service';\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 const 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"]}