@taiga-ui/cdk 3.36.0 → 3.36.1-dev.main-a90e3e6

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 (31) hide show
  1. package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
  2. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js +6 -11
  4. package/bundles/taiga-ui-cdk-directives-auto-focus.umd.js.map +1 -1
  5. package/bundles/taiga-ui-cdk-services.umd.js +1 -1
  6. package/bundles/taiga-ui-cdk-services.umd.js.map +1 -1
  7. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js +20 -4
  8. package/bundles/taiga-ui-cdk-utils-miscellaneous.umd.js.map +1 -1
  9. package/constants/version.d.ts +1 -1
  10. package/constants/version.js +1 -1
  11. package/directives/auto-focus/autofocus.options.d.ts +2 -2
  12. package/esm2015/constants/version.js +2 -2
  13. package/esm2015/directives/auto-focus/autofocus.options.js +4 -8
  14. package/esm2015/services/scroll.service.js +3 -3
  15. package/esm2015/utils/miscellaneous/create-options.js +7 -0
  16. package/esm2015/utils/miscellaneous/index.js +3 -1
  17. package/esm2015/utils/miscellaneous/provide-options.js +9 -0
  18. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  19. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  20. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js +3 -7
  21. package/fesm2015/taiga-ui-cdk-directives-auto-focus.js.map +1 -1
  22. package/fesm2015/taiga-ui-cdk-services.js +2 -2
  23. package/fesm2015/taiga-ui-cdk-services.js.map +1 -1
  24. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js +16 -1
  25. package/fesm2015/taiga-ui-cdk-utils-miscellaneous.js.map +1 -1
  26. package/package.json +1 -1
  27. package/schematics/ng-update/v3-35/constants/icons.js +41 -73
  28. package/services/scroll.service.d.ts +1 -1
  29. package/utils/miscellaneous/create-options.d.ts +2 -0
  30. package/utils/miscellaneous/index.d.ts +2 -0
  31. package/utils/miscellaneous/provide-options.d.ts +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-directives-auto-focus.js","sources":["../../../projects/cdk/directives/auto-focus/handlers/abstract.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/default.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/ios.handler.ts","../../../projects/cdk/directives/auto-focus/autofocus.options.ts","../../../projects/cdk/directives/auto-focus/autofocus.directive.ts","../../../projects/cdk/directives/auto-focus/autofocus.module.ts","../../../projects/cdk/directives/auto-focus/handlers/sync.handler.ts","../../../projects/cdk/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.ts"],"sourcesContent":["import {Directive, ElementRef} from '@angular/core';\nimport {\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk/interfaces';\n\nimport type {TuiAutofocusHandler} from '../autofocus.options';\n\n@Directive()\nexport abstract class AbstractTuiAutofocusHandler implements TuiAutofocusHandler {\n protected constructor(\n protected readonly focusable: TuiFocusableElementAccessor | null,\n protected readonly el: ElementRef<HTMLElement>,\n ) {}\n\n protected get element(): TuiNativeFocusableElement {\n return this.focusable?.nativeFocusableElement || this.el.nativeElement;\n }\n\n protected get isTextFieldElement(): boolean {\n return this.element.matches(`input, textarea, [contenteditable]`);\n }\n\n abstract setFocus(): void;\n}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {Observable, race, timer} from 'rxjs';\nimport {map, skipWhile, take, throttleTime} from 'rxjs/operators';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TIMEOUT = 1000;\nconst NG_ANIMATION_SELECTOR = `.ng-animating`;\n\n@Directive()\nexport class TuiDefaultAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(ANIMATION_FRAME) private readonly animationFrame$: Observable<number>,\n ) {\n super(focusable, el);\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n race(\n timer(TIMEOUT),\n this.animationFrame$.pipe(\n throttleTime(POLLING_TIME),\n map(() => this.element.closest(NG_ANIMATION_SELECTOR)),\n skipWhile(Boolean),\n take(1),\n ),\n ).subscribe(() => this.element.focus());\n } else {\n this.element.focus();\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n Inject,\n NgZone,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {tuiIsPresent, tuiPx} from '@taiga-ui/cdk/utils';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TEXTFIELD_ATTRS = [\n `type`,\n `inputMode`,\n `autocomplete`,\n `accept`,\n `min`,\n `max`,\n `step`,\n `pattern`,\n `size`,\n `maxlength`,\n] as const;\n\n@Directive()\nexport class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(NgZone) private readonly ngZone: NgZone,\n @Inject(WINDOW) private readonly win: Window,\n ) {\n super(focusable, el);\n this.patchCssStyles();\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n this.ngZone.runOutsideAngular(() => this.iosWebkitAutofocus());\n } else {\n this.element.focus();\n }\n }\n\n private iosWebkitAutofocus(): void {\n const fakeInput: HTMLInputElement = this.makeFakeInput();\n const duration = this.getDurationTimeBeforeFocus();\n let fakeFocusTimeoutId = 0;\n let elementFocusTimeoutId = 0;\n\n const blurHandler = (): void => fakeInput.focus({preventScroll: true});\n const focusHandler = (): void => {\n clearTimeout(fakeFocusTimeoutId);\n\n fakeFocusTimeoutId = this.win.setTimeout(() => {\n clearTimeout(elementFocusTimeoutId);\n\n fakeInput.removeEventListener(`blur`, blurHandler);\n fakeInput.removeEventListener(`focus`, focusHandler);\n\n elementFocusTimeoutId = this.win.setTimeout(() => {\n this.element.focus({preventScroll: false});\n fakeInput.remove();\n }, duration);\n });\n };\n\n fakeInput.addEventListener(`blur`, blurHandler, {once: true});\n fakeInput.addEventListener(`focus`, focusHandler);\n\n if (this.insideDialog()) {\n this.win.document.body.appendChild(fakeInput);\n } else {\n this.element.parentElement?.appendChild(fakeInput);\n }\n\n fakeInput.focus({preventScroll: true});\n }\n\n /**\n * @note:\n * emulate textfield position in layout with cursor\n * before focus to real textfield element\n *\n * required note:\n * [fakeInput.readOnly = true] ~\n * don't use {readOnly: true} value, it's doesn't work for emulate autofill\n *\n * [fakeInput.style.opacity = 0] ~\n * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input\n *\n * [fakeInput.style.fontSize = 16px] ~\n * disable possible auto zoom\n *\n * [fakeInput.style.top/left] ~\n * emulate position cursor before focus to real textfield element\n */\n private makeFakeInput(): HTMLInputElement {\n const fakeInput: HTMLInputElement = this.renderer.createElement(`input`);\n const rect: DOMRect = this.element.getBoundingClientRect();\n\n this.patchFakeInputFromFocusableElement(fakeInput);\n\n fakeInput.style.height = tuiPx(rect.height);\n fakeInput.style.width = tuiPx(rect.width / 2);\n fakeInput.style.position = `fixed`;\n fakeInput.style.zIndex = `-99999999`;\n fakeInput.style.caretColor = `transparent`;\n fakeInput.style.border = `none`;\n fakeInput.style.outline = `none`;\n fakeInput.style.color = `transparent`;\n fakeInput.style.background = `transparent`;\n fakeInput.style.cursor = `none`;\n fakeInput.style.fontSize = tuiPx(16);\n fakeInput.style.top = tuiPx(rect.top);\n fakeInput.style.left = tuiPx(rect.left);\n\n return fakeInput;\n }\n\n private getDurationTimeBeforeFocus(): number {\n return (\n parseFloat(\n this.win\n .getComputedStyle(this.element)\n .getPropertyValue(`--tui-duration`),\n ) || 0\n );\n }\n\n /**\n * @note:\n * unfortunately, in older versions of iOS\n * there is a bug that the fake input cursor\n * will move along with the dialog animation\n * and then that dialog will be shaking\n */\n private insideDialog(): boolean {\n return !!this.element.closest(`tui-dialog`);\n }\n\n /**\n * @note:\n * This is necessary so that the viewport isn't recalculated\n * and then the dialogs don't shake.\n *\n * Also, we need to fixed height viewport,\n * so that when focusing the dialogs don't shake\n */\n private patchCssStyles(): void {\n const doc = this.win.document;\n\n for (const element of [doc.documentElement, doc.body]) {\n element.style.setProperty(`overflow`, `auto`);\n element.style.setProperty(`height`, `100%`);\n }\n }\n\n /**\n * @note:\n * inherit basic attributes values from real input\n * for help iOS detect what do you want see on keyboard,\n * for example [inputMode=numeric, autocomplete=cc-number]\n */\n private patchFakeInputFromFocusableElement(fakeInput: HTMLInputElement): void {\n TEXTFIELD_ATTRS.forEach(attr => {\n const value = this.element.getAttribute(attr);\n\n if (tuiIsPresent(value)) {\n fakeInput.setAttribute(attr, value);\n }\n });\n }\n}\n","import {\n ElementRef,\n InjectionToken,\n NgZone,\n Optional,\n Renderer2,\n Self,\n ValueProvider,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {Observable} from 'rxjs';\n\nimport {TuiDefaultAutofocusHandler} from './handlers/default.handler';\n// eslint-disable-next-line import/no-cycle\nimport {TuiIosAutofocusHandler} from './handlers/ios.handler';\n\nexport interface TuiAutofocusHandler {\n setFocus(): void;\n}\n\nexport interface TuiAutofocusOptions {\n readonly delay: number;\n}\n\nexport const TUI_AUTOFOCUS_DEFAULT_OPTIONS: TuiAutofocusOptions = {\n delay: NaN, // NaN = no delay/sync\n};\n\nexport const TUI_AUTOFOCUS_OPTIONS = new InjectionToken<TuiAutofocusOptions>(\n `[TUI_AUTOFOCUS_OPTIONS]`,\n {\n factory: () => TUI_AUTOFOCUS_DEFAULT_OPTIONS,\n },\n);\n\nexport function tuiAutoFocusOptionsProvider(\n options: Partial<TuiAutofocusOptions>,\n): ValueProvider {\n return {\n provide: TUI_AUTOFOCUS_OPTIONS,\n useValue: {...TUI_AUTOFOCUS_DEFAULT_OPTIONS, ...options},\n };\n}\n\nexport const TUI_AUTOFOCUS_HANDLER = new InjectionToken<TuiAutofocusHandler>(\n `[TUI_AUTOFOCUS_HANDLER]`,\n);\n\nexport const TUI_AUTOFOCUS_PROVIDERS = [\n {\n provide: TUI_AUTOFOCUS_HANDLER,\n useFactory: (\n focusable: TuiFocusableElementAccessor | null,\n el: ElementRef<HTMLElement>,\n animationFrame$: Observable<number>,\n renderer: Renderer2,\n ngZone: NgZone,\n win: Window,\n isIos: boolean,\n ) =>\n isIos\n ? new TuiIosAutofocusHandler(focusable, el, renderer, ngZone, win)\n : new TuiDefaultAutofocusHandler(focusable, el, animationFrame$),\n deps: [\n [new Optional(), new Self(), TUI_FOCUSABLE_ITEM_ACCESSOR],\n ElementRef,\n ANIMATION_FRAME,\n Renderer2,\n NgZone,\n WINDOW,\n TUI_IS_IOS,\n ],\n },\n TuiDestroyService,\n];\n","import {AfterViewInit, Directive, Inject, Input, Self} from '@angular/core';\nimport {tuiCoerceBooleanProperty} from '@taiga-ui/cdk/coercion';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {timer} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {\n TUI_AUTOFOCUS_HANDLER,\n TUI_AUTOFOCUS_OPTIONS,\n TUI_AUTOFOCUS_PROVIDERS,\n TuiAutofocusHandler,\n TuiAutofocusOptions,\n} from './autofocus.options';\n\n@Directive({\n selector: '[tuiAutoFocus]',\n providers: TUI_AUTOFOCUS_PROVIDERS,\n})\nexport class TuiAutoFocusDirective implements AfterViewInit {\n @Input('tuiAutoFocus')\n autoFocus: boolean | '' = true;\n\n constructor(\n @Inject(TUI_AUTOFOCUS_HANDLER)\n private readonly handler: TuiAutofocusHandler,\n @Inject(TUI_AUTOFOCUS_OPTIONS)\n private readonly options: TuiAutofocusOptions,\n @Self()\n @Inject(TuiDestroyService)\n private readonly destroy$: TuiDestroyService,\n ) {}\n\n ngAfterViewInit(): void {\n if (tuiCoerceBooleanProperty(this.autoFocus)) {\n this.focus();\n }\n }\n\n focus(): void {\n if (Number.isNaN(this.options.delay)) {\n void Promise.resolve().then(() => this.handler.setFocus());\n } else {\n timer(this.options.delay)\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.handler.setFocus());\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiAutoFocusDirective} from './autofocus.directive';\n\n@NgModule({\n declarations: [TuiAutoFocusDirective],\n exports: [TuiAutoFocusDirective],\n})\nexport class TuiAutoFocusModule {}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\n@Directive()\nexport class TuiSynchronousAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n ) {\n super(focusable, el);\n }\n\n set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CAAA,EAAA,KAAA,EAI3B,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,EAAA,EAAA,EAAA,KAAA,EAE3B,UAAU,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;gHANb,8BAA8B,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAA9B,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,SAAS;;0BAGD,QAAQ;;0BACR,IAAI;;0BACJ,MAAM;2BAAC,2BAA2B,CAAA;;0BAElC,MAAM;2BAAC,UAAU,CAAA;;;ACb1B;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-directives-auto-focus.js","sources":["../../../projects/cdk/directives/auto-focus/handlers/abstract.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/default.handler.ts","../../../projects/cdk/directives/auto-focus/handlers/ios.handler.ts","../../../projects/cdk/directives/auto-focus/autofocus.options.ts","../../../projects/cdk/directives/auto-focus/autofocus.directive.ts","../../../projects/cdk/directives/auto-focus/autofocus.module.ts","../../../projects/cdk/directives/auto-focus/handlers/sync.handler.ts","../../../projects/cdk/directives/auto-focus/taiga-ui-cdk-directives-auto-focus.ts"],"sourcesContent":["import {Directive, ElementRef} from '@angular/core';\nimport {\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk/interfaces';\n\nimport type {TuiAutofocusHandler} from '../autofocus.options';\n\n@Directive()\nexport abstract class AbstractTuiAutofocusHandler implements TuiAutofocusHandler {\n protected constructor(\n protected readonly focusable: TuiFocusableElementAccessor | null,\n protected readonly el: ElementRef<HTMLElement>,\n ) {}\n\n protected get element(): TuiNativeFocusableElement {\n return this.focusable?.nativeFocusableElement || this.el.nativeElement;\n }\n\n protected get isTextFieldElement(): boolean {\n return this.element.matches(`input, textarea, [contenteditable]`);\n }\n\n abstract setFocus(): void;\n}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {Observable, race, timer} from 'rxjs';\nimport {map, skipWhile, take, throttleTime} from 'rxjs/operators';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TIMEOUT = 1000;\nconst NG_ANIMATION_SELECTOR = `.ng-animating`;\n\n@Directive()\nexport class TuiDefaultAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(ANIMATION_FRAME) private readonly animationFrame$: Observable<number>,\n ) {\n super(focusable, el);\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n race(\n timer(TIMEOUT),\n this.animationFrame$.pipe(\n throttleTime(POLLING_TIME),\n map(() => this.element.closest(NG_ANIMATION_SELECTOR)),\n skipWhile(Boolean),\n take(1),\n ),\n ).subscribe(() => this.element.focus());\n } else {\n this.element.focus();\n }\n }\n}\n","import {\n Directive,\n ElementRef,\n Inject,\n NgZone,\n Optional,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\nimport {tuiIsPresent, tuiPx} from '@taiga-ui/cdk/utils';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\nconst TEXTFIELD_ATTRS = [\n `type`,\n `inputMode`,\n `autocomplete`,\n `accept`,\n `min`,\n `max`,\n `step`,\n `pattern`,\n `size`,\n `maxlength`,\n] as const;\n\n@Directive()\nexport class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(Renderer2) private readonly renderer: Renderer2,\n @Inject(NgZone) private readonly ngZone: NgZone,\n @Inject(WINDOW) private readonly win: Window,\n ) {\n super(focusable, el);\n this.patchCssStyles();\n }\n\n setFocus(): void {\n if (this.isTextFieldElement) {\n this.ngZone.runOutsideAngular(() => this.iosWebkitAutofocus());\n } else {\n this.element.focus();\n }\n }\n\n private iosWebkitAutofocus(): void {\n const fakeInput: HTMLInputElement = this.makeFakeInput();\n const duration = this.getDurationTimeBeforeFocus();\n let fakeFocusTimeoutId = 0;\n let elementFocusTimeoutId = 0;\n\n const blurHandler = (): void => fakeInput.focus({preventScroll: true});\n const focusHandler = (): void => {\n clearTimeout(fakeFocusTimeoutId);\n\n fakeFocusTimeoutId = this.win.setTimeout(() => {\n clearTimeout(elementFocusTimeoutId);\n\n fakeInput.removeEventListener(`blur`, blurHandler);\n fakeInput.removeEventListener(`focus`, focusHandler);\n\n elementFocusTimeoutId = this.win.setTimeout(() => {\n this.element.focus({preventScroll: false});\n fakeInput.remove();\n }, duration);\n });\n };\n\n fakeInput.addEventListener(`blur`, blurHandler, {once: true});\n fakeInput.addEventListener(`focus`, focusHandler);\n\n if (this.insideDialog()) {\n this.win.document.body.appendChild(fakeInput);\n } else {\n this.element.parentElement?.appendChild(fakeInput);\n }\n\n fakeInput.focus({preventScroll: true});\n }\n\n /**\n * @note:\n * emulate textfield position in layout with cursor\n * before focus to real textfield element\n *\n * required note:\n * [fakeInput.readOnly = true] ~\n * don't use {readOnly: true} value, it's doesn't work for emulate autofill\n *\n * [fakeInput.style.opacity = 0] ~\n * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input\n *\n * [fakeInput.style.fontSize = 16px] ~\n * disable possible auto zoom\n *\n * [fakeInput.style.top/left] ~\n * emulate position cursor before focus to real textfield element\n */\n private makeFakeInput(): HTMLInputElement {\n const fakeInput: HTMLInputElement = this.renderer.createElement(`input`);\n const rect: DOMRect = this.element.getBoundingClientRect();\n\n this.patchFakeInputFromFocusableElement(fakeInput);\n\n fakeInput.style.height = tuiPx(rect.height);\n fakeInput.style.width = tuiPx(rect.width / 2);\n fakeInput.style.position = `fixed`;\n fakeInput.style.zIndex = `-99999999`;\n fakeInput.style.caretColor = `transparent`;\n fakeInput.style.border = `none`;\n fakeInput.style.outline = `none`;\n fakeInput.style.color = `transparent`;\n fakeInput.style.background = `transparent`;\n fakeInput.style.cursor = `none`;\n fakeInput.style.fontSize = tuiPx(16);\n fakeInput.style.top = tuiPx(rect.top);\n fakeInput.style.left = tuiPx(rect.left);\n\n return fakeInput;\n }\n\n private getDurationTimeBeforeFocus(): number {\n return (\n parseFloat(\n this.win\n .getComputedStyle(this.element)\n .getPropertyValue(`--tui-duration`),\n ) || 0\n );\n }\n\n /**\n * @note:\n * unfortunately, in older versions of iOS\n * there is a bug that the fake input cursor\n * will move along with the dialog animation\n * and then that dialog will be shaking\n */\n private insideDialog(): boolean {\n return !!this.element.closest(`tui-dialog`);\n }\n\n /**\n * @note:\n * This is necessary so that the viewport isn't recalculated\n * and then the dialogs don't shake.\n *\n * Also, we need to fixed height viewport,\n * so that when focusing the dialogs don't shake\n */\n private patchCssStyles(): void {\n const doc = this.win.document;\n\n for (const element of [doc.documentElement, doc.body]) {\n element.style.setProperty(`overflow`, `auto`);\n element.style.setProperty(`height`, `100%`);\n }\n }\n\n /**\n * @note:\n * inherit basic attributes values from real input\n * for help iOS detect what do you want see on keyboard,\n * for example [inputMode=numeric, autocomplete=cc-number]\n */\n private patchFakeInputFromFocusableElement(fakeInput: HTMLInputElement): void {\n TEXTFIELD_ATTRS.forEach(attr => {\n const value = this.element.getAttribute(attr);\n\n if (tuiIsPresent(value)) {\n fakeInput.setAttribute(attr, value);\n }\n });\n }\n}\n","import {\n ElementRef,\n InjectionToken,\n NgZone,\n Optional,\n Provider,\n Renderer2,\n Self,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR, TUI_IS_IOS} from '@taiga-ui/cdk/tokens';\nimport {tuiCreateOptions, tuiProvideOptions} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {Observable} from 'rxjs';\n\nimport {TuiDefaultAutofocusHandler} from './handlers/default.handler';\n// eslint-disable-next-line import/no-cycle\nimport {TuiIosAutofocusHandler} from './handlers/ios.handler';\n\nexport interface TuiAutofocusHandler {\n setFocus(): void;\n}\n\nexport interface TuiAutofocusOptions {\n readonly delay: number;\n}\n\nexport const TUI_AUTOFOCUS_DEFAULT_OPTIONS: TuiAutofocusOptions = {\n delay: NaN, // NaN = no delay/sync\n};\n\nexport const TUI_AUTOFOCUS_OPTIONS = tuiCreateOptions(TUI_AUTOFOCUS_DEFAULT_OPTIONS);\n\nexport function tuiAutoFocusOptionsProvider(\n options: Partial<TuiAutofocusOptions>,\n): Provider {\n return tuiProvideOptions(\n TUI_AUTOFOCUS_OPTIONS,\n options,\n TUI_AUTOFOCUS_DEFAULT_OPTIONS,\n );\n}\n\nexport const TUI_AUTOFOCUS_HANDLER = new InjectionToken<TuiAutofocusHandler>(\n `[TUI_AUTOFOCUS_HANDLER]`,\n);\n\nexport const TUI_AUTOFOCUS_PROVIDERS = [\n {\n provide: TUI_AUTOFOCUS_HANDLER,\n useFactory: (\n focusable: TuiFocusableElementAccessor | null,\n el: ElementRef<HTMLElement>,\n animationFrame$: Observable<number>,\n renderer: Renderer2,\n ngZone: NgZone,\n win: Window,\n isIos: boolean,\n ) =>\n isIos\n ? new TuiIosAutofocusHandler(focusable, el, renderer, ngZone, win)\n : new TuiDefaultAutofocusHandler(focusable, el, animationFrame$),\n deps: [\n [new Optional(), new Self(), TUI_FOCUSABLE_ITEM_ACCESSOR],\n ElementRef,\n ANIMATION_FRAME,\n Renderer2,\n NgZone,\n WINDOW,\n TUI_IS_IOS,\n ],\n },\n TuiDestroyService,\n];\n","import {AfterViewInit, Directive, Inject, Input, Self} from '@angular/core';\nimport {tuiCoerceBooleanProperty} from '@taiga-ui/cdk/coercion';\nimport {TuiDestroyService} from '@taiga-ui/cdk/services';\nimport {timer} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {\n TUI_AUTOFOCUS_HANDLER,\n TUI_AUTOFOCUS_OPTIONS,\n TUI_AUTOFOCUS_PROVIDERS,\n TuiAutofocusHandler,\n TuiAutofocusOptions,\n} from './autofocus.options';\n\n@Directive({\n selector: '[tuiAutoFocus]',\n providers: TUI_AUTOFOCUS_PROVIDERS,\n})\nexport class TuiAutoFocusDirective implements AfterViewInit {\n @Input('tuiAutoFocus')\n autoFocus: boolean | '' = true;\n\n constructor(\n @Inject(TUI_AUTOFOCUS_HANDLER)\n private readonly handler: TuiAutofocusHandler,\n @Inject(TUI_AUTOFOCUS_OPTIONS)\n private readonly options: TuiAutofocusOptions,\n @Self()\n @Inject(TuiDestroyService)\n private readonly destroy$: TuiDestroyService,\n ) {}\n\n ngAfterViewInit(): void {\n if (tuiCoerceBooleanProperty(this.autoFocus)) {\n this.focus();\n }\n }\n\n focus(): void {\n if (Number.isNaN(this.options.delay)) {\n void Promise.resolve().then(() => this.handler.setFocus());\n } else {\n timer(this.options.delay)\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.handler.setFocus());\n }\n }\n}\n","import {NgModule} from '@angular/core';\n\nimport {TuiAutoFocusDirective} from './autofocus.directive';\n\n@NgModule({\n declarations: [TuiAutoFocusDirective],\n exports: [TuiAutoFocusDirective],\n})\nexport class TuiAutoFocusModule {}\n","import {Directive, ElementRef, Inject, Optional, Self} from '@angular/core';\nimport {TuiFocusableElementAccessor} from '@taiga-ui/cdk/interfaces';\nimport {TUI_FOCUSABLE_ITEM_ACCESSOR} from '@taiga-ui/cdk/tokens';\n\nimport {AbstractTuiAutofocusHandler} from './abstract.handler';\n\n@Directive()\nexport class TuiSynchronousAutofocusHandler extends AbstractTuiAutofocusHandler {\n constructor(\n @Optional()\n @Self()\n @Inject(TUI_FOCUSABLE_ITEM_ACCESSOR)\n focusable: TuiFocusableElementAccessor | null,\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n ) {\n super(focusable, el);\n }\n\n setFocus(): void {\n this.element.focus();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MASsB,2BAA2B,CAAA;IAC7C,WACuB,CAAA,SAA6C,EAC7C,EAA2B,EAAA;QAD3B,IAAS,CAAA,SAAA,GAAT,SAAS,CAAoC;QAC7C,IAAE,CAAA,EAAA,GAAF,EAAE,CAAyB;KAC9C;AAEJ,IAAA,IAAc,OAAO,GAAA;;AACjB,QAAA,OAAO,CAAA,CAAA,EAAA,GAAA,IAAI,CAAC,SAAS,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAE,sBAAsB,KAAI,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;KAC1E;AAED,IAAA,IAAc,kBAAkB,GAAA;QAC5B,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA,kCAAA,CAAoC,CAAC,CAAC;KACrE;;yHAZiB,2BAA2B,EAAA,IAAA,EAAA,SAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;6GAA3B,2BAA2B,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADhD,SAAS;;;ACEV,MAAM,OAAO,GAAG,IAAI,CAAC;AACrB,MAAM,qBA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EAAA;AAE/C,QAAA,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;KACxB;IAED,QAAQ,GAAA;AACJ,QAAA,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;KACxB;;4HAbQ,8BAA8B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAI3B,2BAA2B,EAAA,QAAA,EAAA,IAAA,EAAA,IAAA,EAAA,IAAA,EAAA,EAAA,EAAA,KAAA,EAE3B,UAAU,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;gHANb,8BAA8B,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;4FAA9B,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAD1C,SAAS;;0BAGD,QAAQ;;0BACR,IAAI;;0BACJ,MAAM;2BAAC,2BAA2B,CAAA;;0BAElC,MAAM;2BAAC,UAAU,CAAA;;;ACb1B;;AAEG;;;;"}
@@ -3,7 +3,7 @@ import { Injectable, ComponentFactoryResolver, INJECTOR, Inject, ElementRef, Cha
3
3
  import * as i1 from 'rxjs';
4
4
  import { ReplaySubject, Observable, defer, merge, fromEvent, of, timer, from } from 'rxjs';
5
5
  import { tuiFocusVisibleObservable, tuiWatch, tuiTypedFromEvent, tuiZoneOptimized, tuiZonefree, tuiPreventDefault } from '@taiga-ui/cdk/observables';
6
- import { takeUntil, delay, throttleTime, map, startWith, distinctUntilChanged, switchMap, filter, pairwise, repeat, catchError, debounceTime, share, tap, shareReplay, scan } from 'rxjs/operators';
6
+ import { takeUntil, delay, throttleTime, map, startWith, distinctUntilChanged, switchMap, filter, pairwise, repeat, catchError, debounceTime, share, endWith, tap, shareReplay, scan } from 'rxjs/operators';
7
7
  import { WINDOW, ANIMATION_FRAME, PERFORMANCE } from '@ng-web-apis/common';
8
8
  import { POLLING_TIME, EMPTY_ARRAY } from '@taiga-ui/cdk/constants';
9
9
  import { tuiGetElementObscures } from '@taiga-ui/cdk/utils/dom';
@@ -275,7 +275,7 @@ class TuiScrollService {
275
275
  : defer(() => of(this.performanceRef.now())).pipe(switchMap(start => this.animationFrame$.pipe(map(now => now - start))), map(elapsed => tuiEaseInOutQuad(tuiClamp(elapsed / duration, 0, 1))), map(percent => [
276
276
  initialTop + deltaTop * percent,
277
277
  initialLeft + deltaLeft * percent,
278
- ]), takeUntil(timer(duration)));
278
+ ]), endWith([scrollTop, scrollLeft]), takeUntil(timer(duration)));
279
279
  return observable.pipe(tap(([scrollTop, scrollLeft]) => {
280
280
  var _a;
281
281
  (_a = elementOrWindow.scrollTo) === null || _a === void 0 ? void 0 : _a.call(elementOrWindow, scrollLeft, scrollTop);
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-services.js","sources":["../../../projects/cdk/services/destroy.service.ts","../../../projects/cdk/services/directive-styles.service.ts","../../../projects/cdk/services/focus-visible.service.ts","../../../projects/cdk/services/id.service.ts","../../../projects/cdk/services/parents-scroll.service.ts","../../../projects/cdk/services/obscured.service.ts","../../../projects/cdk/services/pan.service.ts","../../../projects/cdk/services/resize.service.ts","../../../projects/cdk/services/scroll.service.ts","../../../projects/cdk/services/static-request.service.ts","../../../projects/cdk/services/swipe.service.ts","../../../projects/cdk/services/zoom.service.ts","../../../projects/cdk/services/taiga-ui-cdk-services.ts"],"sourcesContent":["import {Injectable, OnDestroy} from '@angular/core';\nimport {ReplaySubject} from 'rxjs';\n\n/**\n * @note:\n * Observable abstraction over ngOnDestroy to use with takeUntil\n *\n * Why we use `ReplaySubject` instead of `Subject`?\n * Well, we’ll use ReplaySubject to emit the last message in case\n * the subscription is ended after the component is destroyed.\n */\n@Injectable()\nexport class TuiDestroyService extends ReplaySubject<void> implements OnDestroy {\n constructor() {\n super(1);\n }\n\n ngOnDestroy(): void {\n this.next();\n this.complete();\n }\n}\n","import {\n ComponentFactoryResolver,\n Inject,\n Injectable,\n INJECTOR,\n Injector,\n Type,\n} from '@angular/core';\n\n/**\n * Service to use styles with directives\n */\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiDirectiveStylesService {\n private readonly map = new Map<Type<unknown>, unknown>();\n\n constructor(\n @Inject(ComponentFactoryResolver)\n private readonly resolver: ComponentFactoryResolver,\n @Inject(INJECTOR) private readonly injector: Injector,\n ) {}\n\n addComponent(component: Type<unknown>): void {\n if (!this.map.has(component)) {\n this.map.set(\n component,\n this.resolver.resolveComponentFactory(component).create(this.injector),\n );\n }\n }\n}\n","import {ChangeDetectorRef, ElementRef, Inject, Injectable, Self} from '@angular/core';\nimport {tuiFocusVisibleObservable, tuiWatch} from '@taiga-ui/cdk/observables';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {TuiDestroyService} from './destroy.service';\n\n/**\n * Service to imitate :focus-visible\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)\n * in browsers that do not support it\n */\n@Injectable()\nexport class TuiFocusVisibleService extends Observable<boolean> {\n private readonly focusVisible$: Observable<boolean>;\n\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<Element>,\n @Inject(ChangeDetectorRef) cdr: ChangeDetectorRef,\n @Self() @Inject(TuiDestroyService) destroy$: Observable<void>,\n ) {\n super(subscriber => this.focusVisible$.subscribe(subscriber));\n\n this.focusVisible$ = tuiFocusVisibleObservable(nativeElement).pipe(\n tuiWatch(cdr),\n takeUntil(destroy$),\n );\n }\n}\n","import {Injectable} from '@angular/core';\n\nconst TUI = `tui_`;\n\n/**\n * Generates unique ids\n */\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiIdService {\n private static autoId = 0;\n\n generate(): string {\n return `${TUI}${TuiIdService.autoId++}${Date.now()}`;\n }\n}\n","import {ElementRef, Inject, Injectable} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {defer, merge, Observable} from 'rxjs';\n\n/**\n * Service that subscribes to scroll events of all parent elements\n */\n@Injectable()\nexport class TuiParentsScrollService extends Observable<Event> {\n private readonly callback$: Observable<Event>;\n\n constructor(\n // Destructuring here causes memory leak\n @Inject(ElementRef) el: ElementRef<Element>,\n @Inject(WINDOW) win: Window,\n ) {\n super(subscriber => this.callback$.subscribe(subscriber));\n\n this.callback$ = defer(() => {\n let {nativeElement} = el;\n const eventTargets: Array<Element | Window> = [win, nativeElement];\n\n while (nativeElement.parentElement) {\n nativeElement = nativeElement.parentElement;\n eventTargets.push(nativeElement);\n }\n\n return merge(\n ...eventTargets.map<Observable<Event>>(element =>\n tuiTypedFromEvent(element, `scroll`),\n ),\n );\n });\n }\n}\n","import {ElementRef, Inject, Injectable, NgZone, Self} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiGetElementObscures} from '@taiga-ui/cdk/utils/dom';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {\n delay,\n distinctUntilChanged,\n map,\n startWith,\n takeUntil,\n throttleTime,\n} from 'rxjs/operators';\n\nimport {TuiDestroyService} from './destroy.service';\nimport {TuiParentsScrollService} from './parents-scroll.service';\n\n// @bad TODO: Consider Intersection Observer with fallback to current implementation\n/**\n * Service that monitors element visibility by subscribing to scrolls\n * and polling with set interval, returns either null or an array\n * of elements that overlap given element edges\n */\n@Injectable()\nexport class TuiObscuredService extends Observable<readonly Element[] | null> {\n private readonly obscured$: Observable<readonly Element[] | null>;\n\n constructor(\n @Inject(TuiParentsScrollService)\n @Self()\n parentsScroll$: TuiParentsScrollService,\n @Inject(ElementRef) {nativeElement}: ElementRef<Element>,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(WINDOW) win: Window,\n @Self() @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n super(subscriber => this.obscured$.subscribe(subscriber));\n\n this.obscured$ = merge(\n // delay is added so it will not interfere with other listeners\n merge(parentsScroll$, fromEvent(win, `resize`)).pipe(delay(0)),\n animationFrame$.pipe(throttleTime(POLLING_TIME)),\n ).pipe(\n map(() => tuiGetElementObscures(nativeElement)),\n startWith(null),\n distinctUntilChanged(),\n tuiZoneOptimized(ngZone),\n takeUntil(destroy$),\n );\n }\n}\n","import {DOCUMENT} from '@angular/common';\nimport {ElementRef, Inject, Injectable} from '@angular/core';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {merge, Observable} from 'rxjs';\nimport {filter, map, pairwise, repeat, switchMap, takeUntil} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiPanService extends Observable<readonly [number, number]> {\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<Element>,\n @Inject(DOCUMENT) doc: Document,\n ) {\n super(subscriber => {\n merge(\n tuiTypedFromEvent(nativeElement, `touchstart`, {passive: true}),\n tuiTypedFromEvent(nativeElement, `mousedown`),\n )\n .pipe(\n switchMap(() =>\n merge(\n tuiTypedFromEvent(doc, `touchmove`, {\n passive: true,\n }).pipe(\n filter(({touches}) => touches.length < 2),\n map(({touches}) => touches[0]),\n ),\n tuiTypedFromEvent(doc, `mousemove`),\n ),\n ),\n pairwise(),\n map(([first, second]) => {\n const deltaX = second.clientX - first.clientX;\n const deltaY = second.clientY - first.clientY;\n\n return [deltaX, deltaY] as [number, number];\n }),\n // eslint-disable-next-line rxjs/no-unsafe-takeuntil\n takeUntil(\n merge(\n tuiTypedFromEvent(doc, `touchend`),\n tuiTypedFromEvent(doc, `mouseup`),\n ),\n ),\n repeat(),\n )\n .subscribe(subscriber);\n });\n }\n}\n","import {ElementRef, Inject, Injectable, NgZone, Self} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {\n RESIZE_OBSERVER_SUPPORT,\n RESIZE_OPTION_BOX,\n ResizeObserverService,\n} from '@ng-web-apis/resize-observer';\nimport {EMPTY_ARRAY, POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {Observable} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n map,\n share,\n takeUntil,\n throttleTime,\n} from 'rxjs/operators';\n\nimport {TuiDestroyService} from './destroy.service';\n\n@Injectable()\nexport class TuiResizeService extends ResizeObserverService {\n constructor(\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(NgZone) ngZone: NgZone,\n @Self() @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(RESIZE_OBSERVER_SUPPORT) support: boolean,\n @Inject(RESIZE_OPTION_BOX) box: ResizeObserverBoxOptions,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n super(el, ngZone, support, box);\n\n return this.pipe(\n catchError(() =>\n /**\n * @note: if not supported ResizeObserver\n * remove `catchError` after supports modern browsers\n */\n animationFrame$.pipe(\n throttleTime(POLLING_TIME),\n map(\n () =>\n `${el.nativeElement.clientWidth} ${el.nativeElement.clientHeight}`,\n ),\n distinctUntilChanged(),\n map(() => EMPTY_ARRAY),\n ),\n ),\n debounceTime(0),\n tuiZonefree(ngZone),\n share(),\n takeUntil(destroy$),\n );\n }\n}\n","import {Inject, Injectable} from '@angular/core';\nimport {ANIMATION_FRAME, PERFORMANCE} from '@ng-web-apis/common';\nimport {tuiAssert} from '@taiga-ui/cdk/classes';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {tuiEaseInOutQuad} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {defer, Observable, of, timer} from 'rxjs';\nimport {map, switchMap, takeUntil, tap} from 'rxjs/operators';\n\nconst SCROLL_TIME = 300;\n\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiScrollService {\n constructor(\n @Inject(PERFORMANCE) private readonly performanceRef: Performance,\n @Inject(ANIMATION_FRAME) private readonly animationFrame$: Observable<number>,\n ) {}\n\n scroll$(\n elementOrWindow: Element | Window,\n scrollTop: number,\n scrollLeft: number = getX(elementOrWindow),\n duration: number = SCROLL_TIME,\n ): Observable<[number, number]> {\n ngDevMode && tuiAssert.assert(duration >= 0, `Duration cannot be negative`);\n ngDevMode && tuiAssert.assert(scrollTop >= 0, `scrollTop cannot be negative`);\n ngDevMode && tuiAssert.assert(scrollLeft >= 0, `scrollLeft cannot be negative`);\n\n const initialTop = getY(elementOrWindow);\n const initialLeft = getX(elementOrWindow);\n const deltaTop = scrollTop - initialTop;\n const deltaLeft = scrollLeft - initialLeft;\n const observable = !duration\n ? of([scrollTop, scrollLeft] as [number, number])\n : defer(() => of(this.performanceRef.now())).pipe(\n switchMap(start => this.animationFrame$.pipe(map(now => now - start))),\n map(elapsed => tuiEaseInOutQuad(tuiClamp(elapsed / duration, 0, 1))),\n map(\n percent =>\n [\n initialTop + deltaTop * percent,\n initialLeft + deltaLeft * percent,\n ] as [number, number],\n ),\n takeUntil(timer(duration)),\n );\n\n return observable.pipe(\n tap(([scrollTop, scrollLeft]) => {\n elementOrWindow.scrollTo?.(scrollLeft, scrollTop);\n }),\n );\n }\n}\n\nfunction getX(elementOrWindow: Element | Window): number {\n return `scrollX` in elementOrWindow\n ? elementOrWindow.scrollX\n : elementOrWindow.scrollLeft;\n}\n\nfunction getY(elementOrWindow: Element | Window): number {\n return `scrollY` in elementOrWindow\n ? elementOrWindow.scrollY\n : elementOrWindow.scrollTop;\n}\n","import {isPlatformServer} from '@angular/common';\nimport {Inject, Injectable, PLATFORM_ID} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {defer, from, Observable} from 'rxjs';\nimport {fromFetch} from 'rxjs/fetch';\nimport {shareReplay, switchMap} from 'rxjs/operators';\n\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiStaticRequestService {\n private readonly cache = new Map<string, Observable<string>>();\n\n constructor(\n @Inject(WINDOW) private readonly win: Window,\n @Inject(PLATFORM_ID) private readonly platformId: Record<string, unknown>,\n ) {}\n\n request(url: string): Observable<string> {\n const cache = this.cache.get(url);\n\n if (cache) {\n return cache;\n }\n\n const response$ =\n `AbortController` in this.win || isPlatformServer(this.platformId)\n ? fromFetch(url)\n : /**\n * Fallback for Firefox 55 and 56\n * TODO: drop after browser support bump\n */\n defer(() => from(fetch(url)));\n\n const piped = response$.pipe(\n switchMap(async response => {\n if (response.ok) {\n return response.text();\n }\n\n throw new Error(`Failed to load ${url} (${response.statusText})`);\n }),\n shareReplay({bufferSize: 1, refCount: false}),\n );\n\n this.cache.set(url, piped);\n\n return piped;\n }\n}\n","import {DOCUMENT} from '@angular/common';\nimport {ElementRef, Inject, Injectable} from '@angular/core';\nimport {TuiSwipe, TuiSwipeOptions} from '@taiga-ui/cdk/interfaces';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TUI_SWIPE_OPTIONS} from '@taiga-ui/cdk/tokens';\nimport {tuiGetSwipeDirection, tuiIsPresent} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {merge, Observable} from 'rxjs';\nimport {filter, map, pairwise} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiSwipeService extends Observable<TuiSwipe> {\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<Element>,\n @Inject(TUI_SWIPE_OPTIONS) {timeout, threshold}: TuiSwipeOptions,\n @Inject(DOCUMENT) doc: Document,\n ) {\n super(subscriber => {\n merge(\n tuiTypedFromEvent(nativeElement, `touchstart`, {passive: true}),\n tuiTypedFromEvent(doc, `touchend`),\n )\n .pipe(\n pairwise(),\n filter(\n ([first, second]) =>\n !!first.touches.length &&\n first.touches[0].identifier ===\n second.changedTouches[0].identifier,\n ),\n map(([start, end]) => {\n const startX = start.touches[0].clientX;\n const startY = start.touches[0].clientY;\n const endX = end.changedTouches[0].clientX;\n const endY = end.changedTouches[0].clientY;\n\n const distanceX = startX - endX;\n const distanceY = startY - endY;\n const duration = end.timeStamp - start.timeStamp;\n\n if (\n (Math.abs(distanceX) > threshold ||\n Math.abs(distanceY) > threshold) &&\n duration < timeout\n ) {\n return {\n direction: tuiGetSwipeDirection(distanceX, distanceY),\n events: [start, end] as [TouchEvent, TouchEvent],\n };\n }\n\n return null;\n }),\n filter(tuiIsPresent),\n )\n .subscribe(subscriber);\n });\n }\n}\n","import {ElementRef, Inject, Injectable} from '@angular/core';\nimport {TuiZoom, TuiZoomOptions} from '@taiga-ui/cdk/interfaces';\nimport {tuiPreventDefault, tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TUI_ZOOM_OPTIONS} from '@taiga-ui/cdk/tokens';\nimport {tuiDistanceBetweenTouches} from '@taiga-ui/cdk/utils';\nimport {merge, Observable} from 'rxjs';\nimport {filter, map, scan, switchMap, takeUntil} from 'rxjs/operators';\n\nconst TOUCH_SENSITIVITY = 0.01;\n\n@Injectable()\nexport class TuiZoomService extends Observable<TuiZoom> {\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TUI_ZOOM_OPTIONS) {wheelSensitivity}: TuiZoomOptions,\n ) {\n super(subscriber => {\n merge(\n tuiTypedFromEvent(nativeElement, `touchstart`, {passive: true}).pipe(\n filter(({touches}) => touches.length > 1),\n switchMap(startEvent =>\n tuiTypedFromEvent(nativeElement, `touchmove`, {\n passive: true,\n }).pipe(\n tuiPreventDefault(),\n scan(\n (prev, event) => {\n const distance = tuiDistanceBetweenTouches(event);\n\n return {\n event,\n distance,\n delta:\n (distance - prev.distance) *\n TOUCH_SENSITIVITY,\n };\n },\n {\n event: startEvent,\n distance: tuiDistanceBetweenTouches(startEvent),\n delta: 0,\n },\n ),\n map(({event, delta}) => {\n const clientX =\n (event.touches[0].clientX +\n event.touches[1].clientX) /\n 2;\n const clientY =\n (event.touches[0].clientY +\n event.touches[1].clientY) /\n 2;\n\n return {clientX, clientY, delta, event};\n }),\n takeUntil(tuiTypedFromEvent(nativeElement, `touchend`)),\n ),\n ),\n ),\n tuiTypedFromEvent(nativeElement, `wheel`, {passive: false}).pipe(\n tuiPreventDefault(),\n map(wheel => ({\n clientX: wheel.clientX,\n clientY: wheel.clientY,\n delta: -wheel.deltaY * wheelSensitivity,\n event: wheel,\n })),\n ),\n ).subscribe(subscriber);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAGA;;;;;;;AAOG;AAEG,MAAO,iBAAkB,SAAQ,aAAmB,CAAA;AACtD,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,CAAC,CAAC,CAAC;KACZ;IAED,WAAW,GAAA;QACP,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,QAAQ,EAAE,CAAC;KACnB;;+GARQ,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAAjB,iBAAiB,EAAA,CAAA,CAAA;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,UAAU;;;ACFX;;AAEG;MAIU,yBAAyB,CAAA;IAGlC,WAEqB,CAAA,QAAkC,EAChB,QAAkB,EAAA;QADpC,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAA0B;QAChB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;AALxC,QAAA,IAAA,CAAA,GAAG,GAAG,IAAI,GAAG,EAA0B,CAAC;KAMrD;AAEJ,IAAA,YAAY,CAAC,SAAwB,EAAA;QACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YAC1B,IAAI,CAAC,GAAG,CAAC,GAAG,CACR,SAAS,EACT,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CACzE,CAAC;AACL,SAAA;KACJ;;uHAhBQ,yBAAyB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAItB,wBAAwB,EAAA,EAAA,EAAA,K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EACnB,GAAG,CAAC,KAAK,KAAK;gBACV,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE,KAAK,CAAC,OAAO;AACtB,gBAAA,KAAK,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,gBAAgB;AACvC,gBAAA,KAAK,EAAE,KAAK;aACf,CAAC,CAAC,CACN,CACJ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC5B,SAAC,CAAC,CAAC;KACN;;4GA3DQ,cAAc,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAEX,UAAU,EAAA,EAAA,EAAA,KAAA,EACV,gBAAgB,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;gHAHnB,cAAc,EAAA,CAAA,CAAA;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;;0BAGF,MAAM;2BAAC,UAAU,CAAA;;0BACjB,MAAM;2BAAC,gBAAgB,CAAA;;;ACdhC;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-services.js","sources":["../../../projects/cdk/services/destroy.service.ts","../../../projects/cdk/services/directive-styles.service.ts","../../../projects/cdk/services/focus-visible.service.ts","../../../projects/cdk/services/id.service.ts","../../../projects/cdk/services/parents-scroll.service.ts","../../../projects/cdk/services/obscured.service.ts","../../../projects/cdk/services/pan.service.ts","../../../projects/cdk/services/resize.service.ts","../../../projects/cdk/services/scroll.service.ts","../../../projects/cdk/services/static-request.service.ts","../../../projects/cdk/services/swipe.service.ts","../../../projects/cdk/services/zoom.service.ts","../../../projects/cdk/services/taiga-ui-cdk-services.ts"],"sourcesContent":["import {Injectable, OnDestroy} from '@angular/core';\nimport {ReplaySubject} from 'rxjs';\n\n/**\n * @note:\n * Observable abstraction over ngOnDestroy to use with takeUntil\n *\n * Why we use `ReplaySubject` instead of `Subject`?\n * Well, we’ll use ReplaySubject to emit the last message in case\n * the subscription is ended after the component is destroyed.\n */\n@Injectable()\nexport class TuiDestroyService extends ReplaySubject<void> implements OnDestroy {\n constructor() {\n super(1);\n }\n\n ngOnDestroy(): void {\n this.next();\n this.complete();\n }\n}\n","import {\n ComponentFactoryResolver,\n Inject,\n Injectable,\n INJECTOR,\n Injector,\n Type,\n} from '@angular/core';\n\n/**\n * Service to use styles with directives\n */\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiDirectiveStylesService {\n private readonly map = new Map<Type<unknown>, unknown>();\n\n constructor(\n @Inject(ComponentFactoryResolver)\n private readonly resolver: ComponentFactoryResolver,\n @Inject(INJECTOR) private readonly injector: Injector,\n ) {}\n\n addComponent(component: Type<unknown>): void {\n if (!this.map.has(component)) {\n this.map.set(\n component,\n this.resolver.resolveComponentFactory(component).create(this.injector),\n );\n }\n }\n}\n","import {ChangeDetectorRef, ElementRef, Inject, Injectable, Self} from '@angular/core';\nimport {tuiFocusVisibleObservable, tuiWatch} from '@taiga-ui/cdk/observables';\nimport {Observable} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\n\nimport {TuiDestroyService} from './destroy.service';\n\n/**\n * Service to imitate :focus-visible\n * (https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)\n * in browsers that do not support it\n */\n@Injectable()\nexport class TuiFocusVisibleService extends Observable<boolean> {\n private readonly focusVisible$: Observable<boolean>;\n\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<Element>,\n @Inject(ChangeDetectorRef) cdr: ChangeDetectorRef,\n @Self() @Inject(TuiDestroyService) destroy$: Observable<void>,\n ) {\n super(subscriber => this.focusVisible$.subscribe(subscriber));\n\n this.focusVisible$ = tuiFocusVisibleObservable(nativeElement).pipe(\n tuiWatch(cdr),\n takeUntil(destroy$),\n );\n }\n}\n","import {Injectable} from '@angular/core';\n\nconst TUI = `tui_`;\n\n/**\n * Generates unique ids\n */\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiIdService {\n private static autoId = 0;\n\n generate(): string {\n return `${TUI}${TuiIdService.autoId++}${Date.now()}`;\n }\n}\n","import {ElementRef, Inject, Injectable} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {defer, merge, Observable} from 'rxjs';\n\n/**\n * Service that subscribes to scroll events of all parent elements\n */\n@Injectable()\nexport class TuiParentsScrollService extends Observable<Event> {\n private readonly callback$: Observable<Event>;\n\n constructor(\n // Destructuring here causes memory leak\n @Inject(ElementRef) el: ElementRef<Element>,\n @Inject(WINDOW) win: Window,\n ) {\n super(subscriber => this.callback$.subscribe(subscriber));\n\n this.callback$ = defer(() => {\n let {nativeElement} = el;\n const eventTargets: Array<Element | Window> = [win, nativeElement];\n\n while (nativeElement.parentElement) {\n nativeElement = nativeElement.parentElement;\n eventTargets.push(nativeElement);\n }\n\n return merge(\n ...eventTargets.map<Observable<Event>>(element =>\n tuiTypedFromEvent(element, `scroll`),\n ),\n );\n });\n }\n}\n","import {ElementRef, Inject, Injectable, NgZone, Self} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiGetElementObscures} from '@taiga-ui/cdk/utils/dom';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {\n delay,\n distinctUntilChanged,\n map,\n startWith,\n takeUntil,\n throttleTime,\n} from 'rxjs/operators';\n\nimport {TuiDestroyService} from './destroy.service';\nimport {TuiParentsScrollService} from './parents-scroll.service';\n\n// @bad TODO: Consider Intersection Observer with fallback to current implementation\n/**\n * Service that monitors element visibility by subscribing to scrolls\n * and polling with set interval, returns either null or an array\n * of elements that overlap given element edges\n */\n@Injectable()\nexport class TuiObscuredService extends Observable<readonly Element[] | null> {\n private readonly obscured$: Observable<readonly Element[] | null>;\n\n constructor(\n @Inject(TuiParentsScrollService)\n @Self()\n parentsScroll$: TuiParentsScrollService,\n @Inject(ElementRef) {nativeElement}: ElementRef<Element>,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(WINDOW) win: Window,\n @Self() @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n super(subscriber => this.obscured$.subscribe(subscriber));\n\n this.obscured$ = merge(\n // delay is added so it will not interfere with other listeners\n merge(parentsScroll$, fromEvent(win, `resize`)).pipe(delay(0)),\n animationFrame$.pipe(throttleTime(POLLING_TIME)),\n ).pipe(\n map(() => tuiGetElementObscures(nativeElement)),\n startWith(null),\n distinctUntilChanged(),\n tuiZoneOptimized(ngZone),\n takeUntil(destroy$),\n );\n }\n}\n","import {DOCUMENT} from '@angular/common';\nimport {ElementRef, Inject, Injectable} from '@angular/core';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {merge, Observable} from 'rxjs';\nimport {filter, map, pairwise, repeat, switchMap, takeUntil} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiPanService extends Observable<readonly [number, number]> {\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<Element>,\n @Inject(DOCUMENT) doc: Document,\n ) {\n super(subscriber => {\n merge(\n tuiTypedFromEvent(nativeElement, `touchstart`, {passive: true}),\n tuiTypedFromEvent(nativeElement, `mousedown`),\n )\n .pipe(\n switchMap(() =>\n merge(\n tuiTypedFromEvent(doc, `touchmove`, {\n passive: true,\n }).pipe(\n filter(({touches}) => touches.length < 2),\n map(({touches}) => touches[0]),\n ),\n tuiTypedFromEvent(doc, `mousemove`),\n ),\n ),\n pairwise(),\n map(([first, second]) => {\n const deltaX = second.clientX - first.clientX;\n const deltaY = second.clientY - first.clientY;\n\n return [deltaX, deltaY] as [number, number];\n }),\n // eslint-disable-next-line rxjs/no-unsafe-takeuntil\n takeUntil(\n merge(\n tuiTypedFromEvent(doc, `touchend`),\n tuiTypedFromEvent(doc, `mouseup`),\n ),\n ),\n repeat(),\n )\n .subscribe(subscriber);\n });\n }\n}\n","import {ElementRef, Inject, Injectable, NgZone, Self} from '@angular/core';\nimport {ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {\n RESIZE_OBSERVER_SUPPORT,\n RESIZE_OPTION_BOX,\n ResizeObserverService,\n} from '@ng-web-apis/resize-observer';\nimport {EMPTY_ARRAY, POLLING_TIME} from '@taiga-ui/cdk/constants';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {Observable} from 'rxjs';\nimport {\n catchError,\n debounceTime,\n distinctUntilChanged,\n map,\n share,\n takeUntil,\n throttleTime,\n} from 'rxjs/operators';\n\nimport {TuiDestroyService} from './destroy.service';\n\n@Injectable()\nexport class TuiResizeService extends ResizeObserverService {\n constructor(\n @Inject(ElementRef) el: ElementRef<HTMLElement>,\n @Inject(NgZone) ngZone: NgZone,\n @Self() @Inject(TuiDestroyService) destroy$: Observable<void>,\n @Inject(RESIZE_OBSERVER_SUPPORT) support: boolean,\n @Inject(RESIZE_OPTION_BOX) box: ResizeObserverBoxOptions,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n super(el, ngZone, support, box);\n\n return this.pipe(\n catchError(() =>\n /**\n * @note: if not supported ResizeObserver\n * remove `catchError` after supports modern browsers\n */\n animationFrame$.pipe(\n throttleTime(POLLING_TIME),\n map(\n () =>\n `${el.nativeElement.clientWidth} ${el.nativeElement.clientHeight}`,\n ),\n distinctUntilChanged(),\n map(() => EMPTY_ARRAY),\n ),\n ),\n debounceTime(0),\n tuiZonefree(ngZone),\n share(),\n takeUntil(destroy$),\n );\n }\n}\n","import {Inject, Injectable} from '@angular/core';\nimport {ANIMATION_FRAME, PERFORMANCE} from '@ng-web-apis/common';\nimport {tuiAssert} from '@taiga-ui/cdk/classes';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\nimport {tuiEaseInOutQuad} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {defer, Observable, of, timer} from 'rxjs';\nimport {endWith, map, switchMap, takeUntil, tap} from 'rxjs/operators';\n\nconst SCROLL_TIME = 300;\n\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiScrollService {\n constructor(\n @Inject(PERFORMANCE) private readonly performanceRef: Performance,\n @Inject(ANIMATION_FRAME) private readonly animationFrame$: Observable<number>,\n ) {}\n\n scroll$(\n elementOrWindow: Element | Window,\n scrollTop: number,\n scrollLeft: number = getX(elementOrWindow),\n duration: number = SCROLL_TIME,\n ): Observable<readonly [number, number]> {\n ngDevMode && tuiAssert.assert(duration >= 0, `Duration cannot be negative`);\n ngDevMode && tuiAssert.assert(scrollTop >= 0, `scrollTop cannot be negative`);\n ngDevMode && tuiAssert.assert(scrollLeft >= 0, `scrollLeft cannot be negative`);\n\n const initialTop = getY(elementOrWindow);\n const initialLeft = getX(elementOrWindow);\n const deltaTop = scrollTop - initialTop;\n const deltaLeft = scrollLeft - initialLeft;\n const observable = !duration\n ? of([scrollTop, scrollLeft] as [number, number])\n : defer(() => of(this.performanceRef.now())).pipe(\n switchMap(start => this.animationFrame$.pipe(map(now => now - start))),\n map(elapsed => tuiEaseInOutQuad(tuiClamp(elapsed / duration, 0, 1))),\n map(\n percent =>\n [\n initialTop + deltaTop * percent,\n initialLeft + deltaLeft * percent,\n ] as const,\n ),\n endWith([scrollTop, scrollLeft] as const),\n takeUntil(timer(duration)),\n );\n\n return observable.pipe(\n tap(([scrollTop, scrollLeft]) => {\n elementOrWindow.scrollTo?.(scrollLeft, scrollTop);\n }),\n );\n }\n}\n\nfunction getX(elementOrWindow: Element | Window): number {\n return `scrollX` in elementOrWindow\n ? elementOrWindow.scrollX\n : elementOrWindow.scrollLeft;\n}\n\nfunction getY(elementOrWindow: Element | Window): number {\n return `scrollY` in elementOrWindow\n ? elementOrWindow.scrollY\n : elementOrWindow.scrollTop;\n}\n","import {isPlatformServer} from '@angular/common';\nimport {Inject, Injectable, PLATFORM_ID} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {defer, from, Observable} from 'rxjs';\nimport {fromFetch} from 'rxjs/fetch';\nimport {shareReplay, switchMap} from 'rxjs/operators';\n\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiStaticRequestService {\n private readonly cache = new Map<string, Observable<string>>();\n\n constructor(\n @Inject(WINDOW) private readonly win: Window,\n @Inject(PLATFORM_ID) private readonly platformId: Record<string, unknown>,\n ) {}\n\n request(url: string): Observable<string> {\n const cache = this.cache.get(url);\n\n if (cache) {\n return cache;\n }\n\n const response$ =\n `AbortController` in this.win || isPlatformServer(this.platformId)\n ? fromFetch(url)\n : /**\n * Fallback for Firefox 55 and 56\n * TODO: drop after browser support bump\n */\n defer(() => from(fetch(url)));\n\n const piped = response$.pipe(\n switchMap(async response => {\n if (response.ok) {\n return response.text();\n }\n\n throw new Error(`Failed to load ${url} (${response.statusText})`);\n }),\n shareReplay({bufferSize: 1, refCount: false}),\n );\n\n this.cache.set(url, piped);\n\n return piped;\n }\n}\n","import {DOCUMENT} from '@angular/common';\nimport {ElementRef, Inject, Injectable} from '@angular/core';\nimport {TuiSwipe, TuiSwipeOptions} from '@taiga-ui/cdk/interfaces';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TUI_SWIPE_OPTIONS} from '@taiga-ui/cdk/tokens';\nimport {tuiGetSwipeDirection, tuiIsPresent} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {merge, Observable} from 'rxjs';\nimport {filter, map, pairwise} from 'rxjs/operators';\n\n@Injectable()\nexport class TuiSwipeService extends Observable<TuiSwipe> {\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<Element>,\n @Inject(TUI_SWIPE_OPTIONS) {timeout, threshold}: TuiSwipeOptions,\n @Inject(DOCUMENT) doc: Document,\n ) {\n super(subscriber => {\n merge(\n tuiTypedFromEvent(nativeElement, `touchstart`, {passive: true}),\n tuiTypedFromEvent(doc, `touchend`),\n )\n .pipe(\n pairwise(),\n filter(\n ([first, second]) =>\n !!first.touches.length &&\n first.touches[0].identifier ===\n second.changedTouches[0].identifier,\n ),\n map(([start, end]) => {\n const startX = start.touches[0].clientX;\n const startY = start.touches[0].clientY;\n const endX = end.changedTouches[0].clientX;\n const endY = end.changedTouches[0].clientY;\n\n const distanceX = startX - endX;\n const distanceY = startY - endY;\n const duration = end.timeStamp - start.timeStamp;\n\n if (\n (Math.abs(distanceX) > threshold ||\n Math.abs(distanceY) > threshold) &&\n duration < timeout\n ) {\n return {\n direction: tuiGetSwipeDirection(distanceX, distanceY),\n events: [start, end] as [TouchEvent, TouchEvent],\n };\n }\n\n return null;\n }),\n filter(tuiIsPresent),\n )\n .subscribe(subscriber);\n });\n }\n}\n","import {ElementRef, Inject, Injectable} from '@angular/core';\nimport {TuiZoom, TuiZoomOptions} from '@taiga-ui/cdk/interfaces';\nimport {tuiPreventDefault, tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {TUI_ZOOM_OPTIONS} from '@taiga-ui/cdk/tokens';\nimport {tuiDistanceBetweenTouches} from '@taiga-ui/cdk/utils';\nimport {merge, Observable} from 'rxjs';\nimport {filter, map, scan, switchMap, takeUntil} from 'rxjs/operators';\n\nconst TOUCH_SENSITIVITY = 0.01;\n\n@Injectable()\nexport class TuiZoomService extends Observable<TuiZoom> {\n constructor(\n @Inject(ElementRef) {nativeElement}: ElementRef<HTMLElement>,\n @Inject(TUI_ZOOM_OPTIONS) {wheelSensitivity}: TuiZoomOptions,\n ) {\n super(subscriber => {\n merge(\n tuiTypedFromEvent(nativeElement, `touchstart`, {passive: true}).pipe(\n filter(({touches}) => touches.length > 1),\n switchMap(startEvent =>\n tuiTypedFromEvent(nativeElement, `touchmove`, {\n passive: true,\n }).pipe(\n tuiPreventDefault(),\n scan(\n (prev, event) => {\n const distance = tuiDistanceBetweenTouches(event);\n\n return {\n event,\n distance,\n delta:\n (distance - prev.distance) *\n TOUCH_SENSITIVITY,\n };\n },\n {\n event: startEvent,\n distance: tuiDistanceBetweenTouches(startEvent),\n delta: 0,\n },\n ),\n map(({event, delta}) => {\n const clientX =\n (event.touches[0].clientX +\n event.touches[1].clientX) /\n 2;\n const clientY =\n (event.touches[0].clientY +\n event.touches[1].clientY) /\n 2;\n\n return {clientX, clientY, delta, event};\n }),\n takeUntil(tuiTypedFromEvent(nativeElement, `touchend`)),\n ),\n ),\n ),\n tuiTypedFromEvent(nativeElement, `wheel`, {passive: false}).pipe(\n tuiPreventDefault(),\n map(wheel => ({\n clientX: wheel.clientX,\n clientY: wheel.clientY,\n delta: -wheel.deltaY * wheelSensitivity,\n event: wheel,\n })),\n ),\n ).subscribe(subscriber);\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAGA;;;;;;;AAOG;AAEG,MAAO,iBAAkB,SAAQ,aAAmB,CAAA;AACtD,IAAA,WAAA,GAAA;QACI,KAAK,CAAC,CAAC,CAAC,CAAC;KACZ;IAED,WAAW,GAAA;QACP,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,IAAI,CAAC,QAAQ,EAAE,CAAC;KACnB;;+GARQ,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAAjB,iBAAiB,EAAA,CAAA,CAAA;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,UAAU;;;ACFX;;AAEG;MAIU,yBAAyB,CAAA;IAGlC,WAEqB,CAAA,QAAkC,EAChB,QAAkB,EAAA;QADpC,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAA0B;QAChB,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAU;AALxC,QAAA,IAAA,CAAA,GAAG,GAAG,IAAI,GAAG,EAA0B,CAAC;KAMrD;AAEJ,IAAA,YAAY,CAAC,SAAwB,EAAA;QACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;YAC1B,IAAI,CAAC,GAAG,CAAC,GAAG,CACR,SAAS,E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AO,EAAE,KAAK,EAAE,KAAK,EAAC,CAAC;AAC5C,aAAC,CAAC,EACF,SAAS,CAAC,iBAAiB,CAAC,aAAa,EAAE,CAAU,QAAA,CAAA,CAAC,CAAC,CAC1D,CACJ,CACJ,EACD,iBAAiB,CAAC,aAAa,EAAE,CAAO,KAAA,CAAA,EAAE,EAAC,OAAO,EAAE,KAAK,EAAC,CAAC,CAAC,IAAI,CAC5D,iBAAiB,EAAE,EACnB,GAAG,CAAC,KAAK,KAAK;gBACV,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE,KAAK,CAAC,OAAO;AACtB,gBAAA,KAAK,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,gBAAgB;AACvC,gBAAA,KAAK,EAAE,KAAK;aACf,CAAC,CAAC,CACN,CACJ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AAC5B,SAAC,CAAC,CAAC;KACN;;4GA3DQ,cAAc,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAEX,UAAU,EAAA,EAAA,EAAA,KAAA,EACV,gBAAgB,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;gHAHnB,cAAc,EAAA,CAAA,CAAA;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,UAAU;;0BAGF,MAAM;2BAAC,UAAU,CAAA;;0BACjB,MAAM;2BAAC,gBAAgB,CAAA;;;ACdhC;;AAEG;;;;"}
@@ -1,3 +1,4 @@
1
+ import { InjectionToken, Optional, SkipSelf } from '@angular/core';
1
2
  import { TuiDay } from '@taiga-ui/cdk/date-time';
2
3
  import { tuiAssert } from '@taiga-ui/cdk/classes';
3
4
  import { FormArray, FormGroup } from '@angular/forms';
@@ -28,6 +29,12 @@ function checkValueIsEmpty(value) {
28
29
  return [undefined, null, NaN, ``].includes(nextValue);
29
30
  }
30
31
 
32
+ function tuiCreateOptions(defaults) {
33
+ return new InjectionToken(``, {
34
+ factory: () => defaults,
35
+ });
36
+ }
37
+
31
38
  function tuiDefaultSort(x, y) {
32
39
  const a = x instanceof TuiDay ? Number(x.toUtcNativeDate()) : x;
33
40
  const b = y instanceof TuiDay ? Number(y.toUtcNativeDate()) : y;
@@ -155,6 +162,14 @@ function tuiObjectFromEntries(keyValuePairs) {
155
162
  return keyValuePairs.reduce((obj, [key, val]) => (Object.assign(Object.assign({}, obj), { [key]: val })), {});
156
163
  }
157
164
 
165
+ function tuiProvideOptions(provide, options, fallback) {
166
+ return {
167
+ provide,
168
+ deps: [[new Optional(), new SkipSelf(), provide]],
169
+ useFactory: (parent) => (Object.assign(Object.assign({}, (parent || fallback)), options)),
170
+ };
171
+ }
172
+
158
173
  function tuiUniqBy(array, key) {
159
174
  return Array.from(array
160
175
  .reduce((map, item) => (map.has(item[key]) ? map : map.set(item[key], item)), new Map())
@@ -165,5 +180,5 @@ function tuiUniqBy(array, key) {
165
180
  * Generated bundle index. Do not edit.
166
181
  */
167
182
 
168
- export { tuiArrayRemove, tuiArrayShallowEquals, tuiArrayToggle, tuiCleanObject, tuiDefaultSort, tuiDistanceBetweenTouches, tuiEaseInOutQuad, tuiFlatLength, tuiGetOriginalArrayFromQueryList, tuiGetSwipeDirection, tuiIsFalsy, tuiIsNumber, tuiIsObject, tuiIsPresent, tuiIsString, tuiIsValidUrl, tuiMarkControlAsTouchedAndValidate, tuiNullableSame, tuiObjectFromEntries, tuiUniqBy };
183
+ export { tuiArrayRemove, tuiArrayShallowEquals, tuiArrayToggle, tuiCleanObject, tuiCreateOptions, tuiDefaultSort, tuiDistanceBetweenTouches, tuiEaseInOutQuad, tuiFlatLength, tuiGetOriginalArrayFromQueryList, tuiGetSwipeDirection, tuiIsFalsy, tuiIsNumber, tuiIsObject, tuiIsPresent, tuiIsString, tuiIsValidUrl, tuiMarkControlAsTouchedAndValidate, tuiNullableSame, tuiObjectFromEntries, tuiProvideOptions, tuiUniqBy };
169
184
  //# sourceMappingURL=taiga-ui-cdk-utils-miscellaneous.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"taiga-ui-cdk-utils-miscellaneous.js","sources":["../../../projects/cdk/utils/miscellaneous/array-remove.ts","../../../projects/cdk/utils/miscellaneous/array-shallow-equals.ts","../../../projects/cdk/utils/miscellaneous/array-toggle.ts","../../../projects/cdk/utils/miscellaneous/is-string.ts","../../../projects/cdk/utils/miscellaneous/clean-object.ts","../../../projects/cdk/utils/miscellaneous/default-sort.ts","../../../projects/cdk/utils/miscellaneous/distance-between-touches.ts","../../../projects/cdk/utils/miscellaneous/ease-in-out-quad.ts","../../../projects/cdk/utils/miscellaneous/flat-length.ts","../../../projects/cdk/utils/miscellaneous/get-original-array-from-query-list.ts","../../../projects/cdk/utils/miscellaneous/get-swipe-direction.ts","../../../projects/cdk/utils/miscellaneous/is-falsy.ts","../../../projects/cdk/utils/miscellaneous/is-number.ts","../../../projects/cdk/utils/miscellaneous/is-object.ts","../../../projects/cdk/utils/miscellaneous/is-present.ts","../../../projects/cdk/utils/miscellaneous/is-valid-url.ts","../../../projects/cdk/utils/miscellaneous/mark-control-as-touched-and-validate.ts","../../../projects/cdk/utils/miscellaneous/nullable-same.ts","../../../projects/cdk/utils/miscellaneous/object-from-entries.ts","../../../projects/cdk/utils/miscellaneous/uniq-by.ts","../../../projects/cdk/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.ts"],"sourcesContent":["export function tuiArrayRemove<T>(array: readonly T[], index: number): T[] {\n return array.slice(0, Math.max(index, 0)).concat(array.slice(Math.max(index + 1, 0)));\n}\n","export function tuiArrayShallowEquals<T>(a: readonly T[], b: readonly T[]): boolean {\n return a.length === b.length && a.every((item, index) => item === b[index]);\n}\n","import {tuiArrayRemove} from './array-remove';\n\nexport function tuiArrayToggle<T>(array: readonly T[], item: T): T[] {\n const index = array.indexOf(item);\n\n return index === -1 ? [...array, item] : tuiArrayRemove(array, index);\n}\n","export function tuiIsString(value: unknown): value is string {\n // eslint-disable-next-line @taiga-ui/no-typeof\n return typeof value === `string`;\n}\n","import {TuiDeepPartial} from '@taiga-ui/cdk/types';\n\nimport {tuiIsString} from './is-string';\n\nexport function tuiCleanObject<T>(object: T): TuiDeepPartial<T> {\n return JSON.parse(\n JSON.stringify(object, (_key: string, value: unknown) =>\n checkValueIsEmpty(value) ? undefined : value,\n ),\n );\n}\n\ntype EmptyValue = '' | null | undefined;\n\nfunction checkValueIsEmpty<T>(value: EmptyValue | T): value is EmptyValue {\n const nextValue: any = tuiIsString(value) ? value.trim() : value;\n\n return [undefined, null, NaN, ``].includes(nextValue);\n}\n","import {TuiDay} from '@taiga-ui/cdk/date-time';\n\nimport {tuiIsString} from './is-string';\n\nexport function tuiDefaultSort<T>(x: T, y: T): number {\n const a = x instanceof TuiDay ? Number(x.toUtcNativeDate()) : x;\n const b = y instanceof TuiDay ? Number(y.toUtcNativeDate()) : y;\n\n if (a === b) {\n return 0;\n }\n\n if (tuiIsString(a) && tuiIsString(b)) {\n return a.localeCompare(b);\n }\n\n return a > b ? 1 : -1;\n}\n","export function tuiDistanceBetweenTouches({touches}: TouchEvent): number {\n return Math.hypot(\n touches[0].clientX - touches[1].clientX,\n touches[0].clientY - touches[1].clientY,\n );\n}\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\nexport function tuiEaseInOutQuad(t: number): number {\n ngDevMode &&\n tuiAssert.assert(\n t >= 0 && t <= 1,\n `Input must be between 0 and 1 inclusive but received `,\n t,\n );\n\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n}\n","/**\n * Flattens two-dimensional array and calculates resulting length\n *\n * @param array twi dimensional array\n */\nexport function tuiFlatLength(array: ReadonlyArray<readonly unknown[]>): number {\n return array.reduce((count, section) => count + section.length, 0);\n}\n","import {QueryList} from '@angular/core';\n\n/**\n * Extracts original array from {@link QueryList} rather than\n * creating a copy like {@link QueryList.toArray} does.\n * @param queryList\n * @returns original array from {@link QueryList}.\n */\nexport function tuiGetOriginalArrayFromQueryList<T>(\n queryList: QueryList<T>,\n): readonly T[] {\n let array: readonly T[] = [];\n\n queryList.find((_item, _index, originalArray) => {\n array = originalArray;\n\n return true;\n });\n\n return array;\n}\n","import {TuiSwipeDirection} from '@taiga-ui/cdk/interfaces';\n\nexport function tuiGetSwipeDirection(deltaX: number, deltaY: number): TuiSwipeDirection {\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n return deltaY > 0 ? `top` : `bottom`;\n }\n\n return deltaX > 0 ? `left` : `right`;\n}\n","export function tuiIsFalsy(value: unknown): boolean {\n return !value;\n}\n","export function tuiIsNumber(value: unknown): value is number {\n // eslint-disable-next-line @taiga-ui/no-typeof\n return typeof value === `number`;\n}\n","export function tuiIsObject<T extends Record<string, any>>(\n value: unknown,\n): value is NonNullable<T> {\n // eslint-disable-next-line @taiga-ui/no-typeof\n return typeof value === `object` && !!value;\n}\n","export function tuiIsPresent<T>(value?: T | null): value is T {\n return value !== null && value !== undefined;\n}\n","export function tuiIsValidUrl(url: string): boolean {\n const pattern = new RegExp(\n `^([a-zA-Z]+:\\\\/\\\\/)?` + // protocol\n `((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|localhost|` + // domain name\n `((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))` + // OR IP (v4) address\n `(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*` + // port and path\n `(\\\\?[;&a-z\\\\d%_.~+=-]*)?` + // query string\n `(\\\\#[-a-z\\\\d_]*)?$`, // fragment locator\n `i`,\n );\n\n return pattern.test(url);\n}\n","import {AbstractControl, FormArray, FormGroup} from '@angular/forms';\n\nexport function tuiMarkControlAsTouchedAndValidate(control: AbstractControl): void {\n if (control instanceof FormArray) {\n control.controls.forEach(nestedControl => {\n tuiMarkControlAsTouchedAndValidate(nestedControl);\n });\n }\n\n if (control instanceof FormGroup) {\n Object.values(control.controls).forEach(nestedControl => {\n tuiMarkControlAsTouchedAndValidate(nestedControl);\n });\n }\n\n control.markAsTouched();\n control.updateValueAndValidity();\n}\n","import {TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\n/**\n * Checks identity for nullable elements.\n *\n * @param a element a\n * @param b element b\n * @param handler called if both elements are not null\n * @return true if either both are null or they pass identity handler\n */\nexport function tuiNullableSame<T>(\n a: T | null,\n b: T | null,\n handler: TuiIdentityMatcher<T>,\n): boolean {\n if (a === null) {\n return b === null;\n }\n\n if (b === null) {\n return false;\n }\n\n return handler(a, b);\n}\n","/**\n * @deprecated use `Object.fromEntries` instead\n * (check browser support first https://caniuse.com/mdn-javascript_builtins_object_fromentries)\n * ___\n * TODO: after we bump Firefox to 63+ replace this function with `Object.fromEntries`.\n * TODO: Add `es2019.object` to `tsconfig.json` => `compilerOptions.lib`.\n *\n */\nexport function tuiObjectFromEntries<K extends number | string, V>(\n keyValuePairs: Array<[K, V]>,\n): Record<K, V> {\n return keyValuePairs.reduce(\n (obj, [key, val]) => ({...obj, [key]: val}),\n {} as Record<K, V>,\n );\n}\n","import {TuiValuesOf} from '@taiga-ui/cdk/types';\n\nexport function tuiUniqBy<T extends Record<string, any>>(\n array: readonly T[],\n key: keyof T,\n): readonly T[] {\n return Array.from(\n array\n .reduce(\n (map, item) => (map.has(item[key]) ? map : map.set(item[key], item)),\n new Map<TuiValuesOf<T>, T>(),\n )\n .values(),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAAgB,SAAA,cAAc,CAAI,KAAmB,EAAE,KAAa,EAAA;AAChE,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1F;;ACFgB,SAAA,qBAAqB,CAAI,CAAe,EAAE,CAAe,EAAA;IACrE,OAA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AA,SAAS,CACrB,KAAmB,EACnB,GAAY,EAAA;AAEZ,IAAA,OAAO,KAAK,CAAC,IAAI,CACb,KAAK;AACA,SAAA,MAAM,CACH,CAAC,GAAG,EAAE,IAAI,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,EACpE,IAAI,GAAG,EAAqB,CAC/B;SACA,MAAM,EAAE,CAChB,CAAC;AACN;;ACdA;;AAEG;;;;"}
1
+ {"version":3,"file":"taiga-ui-cdk-utils-miscellaneous.js","sources":["../../../projects/cdk/utils/miscellaneous/array-remove.ts","../../../projects/cdk/utils/miscellaneous/array-shallow-equals.ts","../../../projects/cdk/utils/miscellaneous/array-toggle.ts","../../../projects/cdk/utils/miscellaneous/is-string.ts","../../../projects/cdk/utils/miscellaneous/clean-object.ts","../../../projects/cdk/utils/miscellaneous/create-options.ts","../../../projects/cdk/utils/miscellaneous/default-sort.ts","../../../projects/cdk/utils/miscellaneous/distance-between-touches.ts","../../../projects/cdk/utils/miscellaneous/ease-in-out-quad.ts","../../../projects/cdk/utils/miscellaneous/flat-length.ts","../../../projects/cdk/utils/miscellaneous/get-original-array-from-query-list.ts","../../../projects/cdk/utils/miscellaneous/get-swipe-direction.ts","../../../projects/cdk/utils/miscellaneous/is-falsy.ts","../../../projects/cdk/utils/miscellaneous/is-number.ts","../../../projects/cdk/utils/miscellaneous/is-object.ts","../../../projects/cdk/utils/miscellaneous/is-present.ts","../../../projects/cdk/utils/miscellaneous/is-valid-url.ts","../../../projects/cdk/utils/miscellaneous/mark-control-as-touched-and-validate.ts","../../../projects/cdk/utils/miscellaneous/nullable-same.ts","../../../projects/cdk/utils/miscellaneous/object-from-entries.ts","../../../projects/cdk/utils/miscellaneous/provide-options.ts","../../../projects/cdk/utils/miscellaneous/uniq-by.ts","../../../projects/cdk/utils/miscellaneous/taiga-ui-cdk-utils-miscellaneous.ts"],"sourcesContent":["export function tuiArrayRemove<T>(array: readonly T[], index: number): T[] {\n return array.slice(0, Math.max(index, 0)).concat(array.slice(Math.max(index + 1, 0)));\n}\n","export function tuiArrayShallowEquals<T>(a: readonly T[], b: readonly T[]): boolean {\n return a.length === b.length && a.every((item, index) => item === b[index]);\n}\n","import {tuiArrayRemove} from './array-remove';\n\nexport function tuiArrayToggle<T>(array: readonly T[], item: T): T[] {\n const index = array.indexOf(item);\n\n return index === -1 ? [...array, item] : tuiArrayRemove(array, index);\n}\n","export function tuiIsString(value: unknown): value is string {\n // eslint-disable-next-line @taiga-ui/no-typeof\n return typeof value === `string`;\n}\n","import {TuiDeepPartial} from '@taiga-ui/cdk/types';\n\nimport {tuiIsString} from './is-string';\n\nexport function tuiCleanObject<T>(object: T): TuiDeepPartial<T> {\n return JSON.parse(\n JSON.stringify(object, (_key: string, value: unknown) =>\n checkValueIsEmpty(value) ? undefined : value,\n ),\n );\n}\n\ntype EmptyValue = '' | null | undefined;\n\nfunction checkValueIsEmpty<T>(value: EmptyValue | T): value is EmptyValue {\n const nextValue: any = tuiIsString(value) ? value.trim() : value;\n\n return [undefined, null, NaN, ``].includes(nextValue);\n}\n","import {InjectionToken} from '@angular/core';\n\nexport function tuiCreateOptions<T>(defaults: T): InjectionToken<T> {\n return new InjectionToken<T>(``, {\n factory: () => defaults,\n });\n}\n","import {TuiDay} from '@taiga-ui/cdk/date-time';\n\nimport {tuiIsString} from './is-string';\n\nexport function tuiDefaultSort<T>(x: T, y: T): number {\n const a = x instanceof TuiDay ? Number(x.toUtcNativeDate()) : x;\n const b = y instanceof TuiDay ? Number(y.toUtcNativeDate()) : y;\n\n if (a === b) {\n return 0;\n }\n\n if (tuiIsString(a) && tuiIsString(b)) {\n return a.localeCompare(b);\n }\n\n return a > b ? 1 : -1;\n}\n","export function tuiDistanceBetweenTouches({touches}: TouchEvent): number {\n return Math.hypot(\n touches[0].clientX - touches[1].clientX,\n touches[0].clientY - touches[1].clientY,\n );\n}\n","import {tuiAssert} from '@taiga-ui/cdk/classes';\n\nexport function tuiEaseInOutQuad(t: number): number {\n ngDevMode &&\n tuiAssert.assert(\n t >= 0 && t <= 1,\n `Input must be between 0 and 1 inclusive but received `,\n t,\n );\n\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n}\n","/**\n * Flattens two-dimensional array and calculates resulting length\n *\n * @param array twi dimensional array\n */\nexport function tuiFlatLength(array: ReadonlyArray<readonly unknown[]>): number {\n return array.reduce((count, section) => count + section.length, 0);\n}\n","import {QueryList} from '@angular/core';\n\n/**\n * Extracts original array from {@link QueryList} rather than\n * creating a copy like {@link QueryList.toArray} does.\n * @param queryList\n * @returns original array from {@link QueryList}.\n */\nexport function tuiGetOriginalArrayFromQueryList<T>(\n queryList: QueryList<T>,\n): readonly T[] {\n let array: readonly T[] = [];\n\n queryList.find((_item, _index, originalArray) => {\n array = originalArray;\n\n return true;\n });\n\n return array;\n}\n","import {TuiSwipeDirection} from '@taiga-ui/cdk/interfaces';\n\nexport function tuiGetSwipeDirection(deltaX: number, deltaY: number): TuiSwipeDirection {\n if (Math.abs(deltaY) > Math.abs(deltaX)) {\n return deltaY > 0 ? `top` : `bottom`;\n }\n\n return deltaX > 0 ? `left` : `right`;\n}\n","export function tuiIsFalsy(value: unknown): boolean {\n return !value;\n}\n","export function tuiIsNumber(value: unknown): value is number {\n // eslint-disable-next-line @taiga-ui/no-typeof\n return typeof value === `number`;\n}\n","export function tuiIsObject<T extends Record<string, any>>(\n value: unknown,\n): value is NonNullable<T> {\n // eslint-disable-next-line @taiga-ui/no-typeof\n return typeof value === `object` && !!value;\n}\n","export function tuiIsPresent<T>(value?: T | null): value is T {\n return value !== null && value !== undefined;\n}\n","export function tuiIsValidUrl(url: string): boolean {\n const pattern = new RegExp(\n `^([a-zA-Z]+:\\\\/\\\\/)?` + // protocol\n `((([a-z\\\\d]([a-z\\\\d-]*[a-z\\\\d])*)\\\\.)+[a-z]{2,}|localhost|` + // domain name\n `((\\\\d{1,3}\\\\.){3}\\\\d{1,3}))` + // OR IP (v4) address\n `(\\\\:\\\\d+)?(\\\\/[-a-z\\\\d%_.~+]*)*` + // port and path\n `(\\\\?[;&a-z\\\\d%_.~+=-]*)?` + // query string\n `(\\\\#[-a-z\\\\d_]*)?$`, // fragment locator\n `i`,\n );\n\n return pattern.test(url);\n}\n","import {AbstractControl, FormArray, FormGroup} from '@angular/forms';\n\nexport function tuiMarkControlAsTouchedAndValidate(control: AbstractControl): void {\n if (control instanceof FormArray) {\n control.controls.forEach(nestedControl => {\n tuiMarkControlAsTouchedAndValidate(nestedControl);\n });\n }\n\n if (control instanceof FormGroup) {\n Object.values(control.controls).forEach(nestedControl => {\n tuiMarkControlAsTouchedAndValidate(nestedControl);\n });\n }\n\n control.markAsTouched();\n control.updateValueAndValidity();\n}\n","import {TuiIdentityMatcher} from '@taiga-ui/cdk/types';\n\n/**\n * Checks identity for nullable elements.\n *\n * @param a element a\n * @param b element b\n * @param handler called if both elements are not null\n * @return true if either both are null or they pass identity handler\n */\nexport function tuiNullableSame<T>(\n a: T | null,\n b: T | null,\n handler: TuiIdentityMatcher<T>,\n): boolean {\n if (a === null) {\n return b === null;\n }\n\n if (b === null) {\n return false;\n }\n\n return handler(a, b);\n}\n","/**\n * @deprecated use `Object.fromEntries` instead\n * (check browser support first https://caniuse.com/mdn-javascript_builtins_object_fromentries)\n * ___\n * TODO: after we bump Firefox to 63+ replace this function with `Object.fromEntries`.\n * TODO: Add `es2019.object` to `tsconfig.json` => `compilerOptions.lib`.\n *\n */\nexport function tuiObjectFromEntries<K extends number | string, V>(\n keyValuePairs: Array<[K, V]>,\n): Record<K, V> {\n return keyValuePairs.reduce(\n (obj, [key, val]) => ({...obj, [key]: val}),\n {} as Record<K, V>,\n );\n}\n","import {FactoryProvider, InjectionToken, Optional, SkipSelf} from '@angular/core';\n\nexport function tuiProvideOptions<T>(\n provide: InjectionToken<T>,\n options: Partial<T>,\n fallback: T,\n): FactoryProvider {\n return {\n provide,\n deps: [[new Optional(), new SkipSelf(), provide]],\n useFactory: (parent: T | null): T => ({\n ...(parent || fallback),\n ...options,\n }),\n };\n}\n","import {TuiValuesOf} from '@taiga-ui/cdk/types';\n\nexport function tuiUniqBy<T extends Record<string, any>>(\n array: readonly T[],\n key: keyof T,\n): readonly T[] {\n return Array.from(\n array\n .reduce(\n (map, item) => (map.has(item[key]) ? map : map.set(item[key], item)),\n new Map<TuiValuesOf<T>, T>(),\n )\n .values(),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAAgB,SAAA,cAAc,CAAI,KAAmB,EAAE,KAAa,EAAA;AAChE,IAAA,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAC1F;;ACFgB,SAAA,qBAAqB,CAAI,CAAe,EAAE,CAAe,EAAA;IACrE,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,KAAK,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AAChF;;ACAgB,SAAA,cAAc,CAAI,KAAmB,EAAE,IAAO,EAAA;IAC1D,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC,OAAO,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC1E;;ACNM,SAAU,WAAW,CAAC,KAAc,EAAA;;AAEtC,IAAA,OAAO,OAAO,KAAK,KAAK,CA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,CAAA;KACL,CAAC;AACN;;ACbgB,SAAA,SAAS,CACrB,KAAmB,EACnB,GAAY,EAAA;AAEZ,IAAA,OAAO,KAAK,CAAC,IAAI,CACb,KAAK;AACA,SAAA,MAAM,CACH,CAAC,GAAG,EAAE,IAAI,MAAM,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC,EACpE,IAAI,GAAG,EAAqB,CAC/B;SACA,MAAM,EAAE,CAChB,CAAC;AACN;;ACdA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/cdk",
3
- "version": "3.36.0",
3
+ "version": "3.36.1-dev.main-a90e3e6",
4
4
  "description": "Base library for creating Angular components and applications using Taiga UI principles regarding of actual visual appearance",
5
5
  "keywords": [
6
6
  "angular",