@taiga-ui/core 3.19.0 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abstract/abstract-driver.directive.d.ts +9 -2
- package/abstract/driver.d.ts +1 -0
- package/abstract/position-accessor.d.ts +3 -1
- package/abstract/rect-accessor.d.ts +4 -1
- package/abstract/vehicle.d.ts +1 -0
- package/bundles/taiga-ui-core-abstract.umd.js +49 -10
- package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-button.umd.js +4 -1
- package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.js +8 -2
- package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-loader.umd.js +4 -1
- package/bundles/taiga-ui-core-components-loader.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js +4 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.js +1 -1
- package/bundles/taiga-ui-core-components-svg.umd.js +4 -1
- package/bundles/taiga-ui-core-components-svg.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-dropdown.umd.js +167 -110
- package/bundles/taiga-ui-core-directives-dropdown.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-hint.umd.js +242 -181
- package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.js +15 -12
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.js.map +1 -1
- package/bundles/taiga-ui-core-tokens.umd.js +129 -37
- package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
- package/components/button/button-options.d.ts +3 -0
- package/components/dialog/dialog.tokens.d.ts +6 -0
- package/components/loader/loader-options.d.ts +3 -0
- package/components/primitive-checkbox/checkbox-options.d.ts +3 -0
- package/components/svg/svg-options.d.ts +3 -0
- package/directives/dropdown/dropdown-context.directive.d.ts +1 -0
- package/directives/dropdown/dropdown-driver.directive.d.ts +5 -2
- package/directives/dropdown/dropdown-host.directive.d.ts +1 -0
- package/directives/dropdown/dropdown-hover-options.directive.d.ts +3 -0
- package/directives/dropdown/dropdown-hover.directive.d.ts +1 -0
- package/directives/dropdown/dropdown-manual.directive.d.ts +1 -0
- package/directives/dropdown/dropdown-options.directive.d.ts +3 -0
- package/directives/dropdown/dropdown-position-sided.directive.d.ts +4 -3
- package/directives/dropdown/dropdown-position.directive.d.ts +7 -3
- package/directives/dropdown/dropdown-selection.directive.d.ts +1 -0
- package/directives/dropdown/dropdown.directive.d.ts +7 -4
- package/directives/dropdown/dropdown.providers.d.ts +3 -0
- package/directives/hint/hint-describe.directive.d.ts +3 -5
- package/directives/hint/hint-driver.directive.d.ts +5 -2
- package/directives/hint/hint-host.directive.d.ts +1 -0
- package/directives/hint/hint-hover.directive.d.ts +2 -0
- package/directives/hint/hint-manual.directive.d.ts +3 -1
- package/directives/hint/hint-options.directive.d.ts +3 -0
- package/directives/hint/hint-position.directive.d.ts +6 -3
- package/directives/hint/hint.directive.d.ts +3 -2
- package/directives/hint/hint.providers.d.ts +3 -0
- package/directives/textfield-controller/textfield-options.d.ts +3 -0
- package/esm2015/abstract/abstract-driver.directive.js +15 -7
- package/esm2015/abstract/driver.js +2 -1
- package/esm2015/abstract/position-accessor.js +10 -1
- package/esm2015/abstract/rect-accessor.js +14 -1
- package/esm2015/abstract/vehicle.js +2 -1
- package/esm2015/components/button/button-options.js +5 -2
- package/esm2015/components/dialog/dialog.tokens.js +9 -3
- package/esm2015/components/loader/loader-options.js +5 -2
- package/esm2015/components/primitive-checkbox/checkbox-options.js +5 -2
- package/esm2015/components/root/root.component.js +1 -1
- package/esm2015/components/svg/svg-options.js +5 -2
- package/esm2015/directives/dropdown/dropdown-context.directive.js +2 -1
- package/esm2015/directives/dropdown/dropdown-driver.directive.js +22 -5
- package/esm2015/directives/dropdown/dropdown-host.directive.js +5 -1
- package/esm2015/directives/dropdown/dropdown-hover-options.directive.js +5 -2
- package/esm2015/directives/dropdown/dropdown-hover.directive.js +2 -1
- package/esm2015/directives/dropdown/dropdown-manual.directive.js +4 -3
- package/esm2015/directives/dropdown/dropdown-options.directive.js +5 -2
- package/esm2015/directives/dropdown/dropdown-position-sided.directive.js +13 -12
- package/esm2015/directives/dropdown/dropdown-position.directive.js +27 -10
- package/esm2015/directives/dropdown/dropdown-selection.directive.js +2 -1
- package/esm2015/directives/dropdown/dropdown.component.js +19 -9
- package/esm2015/directives/dropdown/dropdown.directive.js +14 -19
- package/esm2015/directives/dropdown/dropdown.providers.js +5 -2
- package/esm2015/directives/hint/hint-describe.directive.js +5 -11
- package/esm2015/directives/hint/hint-driver.directive.js +22 -5
- package/esm2015/directives/hint/hint-host.directive.js +5 -1
- package/esm2015/directives/hint/hint-hover.directive.js +5 -3
- package/esm2015/directives/hint/hint-manual.directive.js +12 -5
- package/esm2015/directives/hint/hint-options.directive.js +5 -2
- package/esm2015/directives/hint/hint-position.directive.js +24 -10
- package/esm2015/directives/hint/hint.component.js +18 -4
- package/esm2015/directives/hint/hint.directive.js +3 -1
- package/esm2015/directives/hint/hint.providers.js +6 -2
- package/esm2015/directives/textfield-controller/textfield-appearance.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-cleaner.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-controller.provider.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-custom-content.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-filler.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-icon-left.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-icon.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-label-outside.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-options.js +5 -2
- package/esm2015/directives/textfield-controller/textfield-postfix.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-prefix.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-size.directive.js +2 -2
- package/esm2015/tokens/animation-options.js +5 -2
- package/esm2015/tokens/animations-duration.js +5 -2
- package/esm2015/tokens/assert-enabled.js +5 -2
- package/esm2015/tokens/data-list-accessor.js +5 -2
- package/esm2015/tokens/data-list-host.js +5 -2
- package/esm2015/tokens/day-type-handler.js +5 -2
- package/esm2015/tokens/document-or-shadow-root.js +2 -2
- package/esm2015/tokens/element-ref.js +5 -2
- package/esm2015/tokens/first-day-of-week.js +5 -2
- package/esm2015/tokens/i18n.js +25 -7
- package/esm2015/tokens/icon-place.js +3 -2
- package/esm2015/tokens/icons-path.js +5 -2
- package/esm2015/tokens/icons.js +5 -2
- package/esm2015/tokens/is-mobile-resolution.js +5 -2
- package/esm2015/tokens/media.js +5 -2
- package/esm2015/tokens/mode.js +5 -2
- package/esm2015/tokens/notification-options.js +5 -2
- package/esm2015/tokens/number-format.js +5 -2
- package/esm2015/tokens/option-content.js +5 -2
- package/esm2015/tokens/ordered-short-week-days.js +3 -2
- package/esm2015/tokens/sanitizer.js +5 -2
- package/esm2015/tokens/scroll-ref.js +5 -2
- package/esm2015/tokens/selection-stream.js +5 -2
- package/esm2015/tokens/svg-content-processor.js +3 -2
- package/esm2015/tokens/svg-src-processor.js +3 -2
- package/esm2015/tokens/textfield-appearance.js +7 -4
- package/esm2015/tokens/textfield-host.js +5 -2
- package/esm2015/tokens/theme.js +2 -2
- package/esm2015/tokens/value-accessor.js +5 -2
- package/esm2015/tokens/viewport.js +6 -2
- package/fesm2015/taiga-ui-core-abstract.js +39 -9
- package/fesm2015/taiga-ui-core-abstract.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-button.js +4 -1
- package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dialog.js +8 -2
- package/fesm2015/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-loader.js +4 -1
- package/fesm2015/taiga-ui-core-components-loader.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js +4 -1
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-root.js +1 -1
- package/fesm2015/taiga-ui-core-components-svg.js +4 -1
- package/fesm2015/taiga-ui-core-components-svg.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-dropdown.js +104 -53
- package/fesm2015/taiga-ui-core-directives-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-hint.js +187 -132
- package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-textfield-controller.js +15 -12
- package/fesm2015/taiga-ui-core-directives-textfield-controller.js.map +1 -1
- package/fesm2015/taiga-ui-core-tokens.js +129 -37
- package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
- package/package.json +4 -4
- package/tokens/animation-options.d.ts +3 -0
- package/tokens/animations-duration.d.ts +3 -0
- package/tokens/assert-enabled.d.ts +3 -0
- package/tokens/data-list-accessor.d.ts +3 -0
- package/tokens/data-list-host.d.ts +3 -0
- package/tokens/day-type-handler.d.ts +3 -0
- package/tokens/element-ref.d.ts +3 -0
- package/tokens/first-day-of-week.d.ts +3 -0
- package/tokens/i18n.d.ts +18 -0
- package/tokens/icon-place.d.ts +1 -0
- package/tokens/icons-path.d.ts +1 -0
- package/tokens/icons.d.ts +3 -0
- package/tokens/is-mobile-resolution.d.ts +3 -0
- package/tokens/media.d.ts +3 -0
- package/tokens/mode.d.ts +3 -0
- package/tokens/notification-options.d.ts +3 -0
- package/tokens/number-format.d.ts +3 -0
- package/tokens/option-content.d.ts +3 -0
- package/tokens/ordered-short-week-days.d.ts +1 -0
- package/tokens/sanitizer.d.ts +3 -0
- package/tokens/scroll-ref.d.ts +3 -0
- package/tokens/selection-stream.d.ts +3 -0
- package/tokens/svg-content-processor.d.ts +1 -0
- package/tokens/svg-src-processor.d.ts +1 -0
- package/tokens/textfield-appearance.d.ts +5 -1
- package/tokens/textfield-host.d.ts +3 -0
- package/tokens/value-accessor.d.ts +3 -0
- package/tokens/viewport.d.ts +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-svg.js","sources":["../../../projects/core/components/svg/deprecated-icons.ts","../../../projects/core/components/svg/svg-options.ts","../../../projects/core/components/svg/svg.component.ts","../../../projects/core/components/svg/svg.template.html","../../../projects/core/components/svg/svg.module.ts","../../../projects/core/components/svg/taiga-ui-core-components-svg.ts"],"sourcesContent":["export const TUI_DEPRECATED_ICONS: Record<string, string> = {\n tuiIconAttach: `tuiIconPaperclip`,\n tuiIconAttention: `tuiIconAlertCircle`,\n tuiIconBackCircle: `tuiIconArrowLeftCircle`,\n tuiIconCall: `tuiIconPhone`,\n tuiIconCallIn: `tuiIconPhoneIncoming`,\n tuiIconCallOut: `tuiIconPhoneOutgoing`,\n tuiIconCallTransfer: `tuiIconPhoneForwarded`,\n tuiIconCancel: `tuiIconXCircle`,\n tuiIconCancelCircle: `tuiIconSlash`,\n tuiIconCard: `tuiIconCreditCard`,\n tuiIconCards: `tuiIconCreditCard`,\n tuiIconChartBar: `tuiIconBarChart`,\n tuiIconChart: `tuiIconBarChart`,\n tuiIconCheckList: `tuiIconClipboard`,\n tuiIconCloseCircle: `tuiIconXCircle`,\n tuiIconCollapse: `tuiIconMinimize`,\n tuiIconComment: `tuiIconMessageSquare`,\n tuiIconCommentFw: `tuiIconMessageForward`,\n tuiIconCompany: `tuiIconBriefcase`,\n tuiIconDefaultDoc: `tuiIconFile`,\n tuiIconDesktop: `tuiIconMonitor`,\n tuiIconDesktopOff: `tuiIconMonitorOff`,\n tuiIconDislike: `tuiIconThumbsDown`,\n tuiIconDone: `tuiIconCheckCircle`,\n tuiIconDraft: `tuiIconEdit2`,\n tuiIconEyeOpen: `tuiIconEye`,\n tuiIconEyeClosed: `tuiIconEyeOff`,\n tuiIconExpand: `tuiIconMaximize`,\n tuiIconExternal: `tuiIconExternalLink`,\n tuiIconFrame: `tuiIconLayout`,\n tuiIconGeo: `tuiIconMapPin`,\n tuiIconHeartFilled: `tuiIconHeart`,\n tuiIconHide: `tuiIconEyeOff`,\n tuiIconImg: `tuiIconImage`,\n tuiIconInfoCircle: `tuiIconInfo`,\n tuiIconLike: `tuiIconThumbsUp`,\n tuiIconLockOpen: `tuiIconUnlock`,\n tuiIconMobile: `tuiIconSmartphone`,\n tuiIconMoreHor: `tuiIconMoreHorizontal`,\n tuiIconMoreVer: `tuiIconMoreVertical`,\n tuiIconMoreVert: `tuiIconMoreVertical`,\n tuiIconPicture: `tuiIconImage`,\n tuiIconPin: `tuiIconMapPin`,\n tuiIconPrint: `tuiIconPrinter`,\n tuiIconRefresh: `tuiIconRefreshCw`,\n tuiIconRemove: `tuiIconX`,\n tuiIconShow: `tuiIconEye`,\n tuiIconSound: `tuiIconVolume`,\n tuiIconSoundOff: `tuiIconVolumeX`,\n tuiIconStarFilled: `tuiIconStar`,\n tuiIconStop: `tuiIconSquare`,\n tuiIconStructure: `tuiIconGrid`,\n tuiIconTime: `tuiIconClock`,\n tuiIconTooltip: `tuiIconHelpCircle`,\n tuiIconViewList: `tuiIconList`,\n tuiIconWifiOn: `tuiIconWifi`,\n};\n","import {inject, InjectionToken, ValueProvider} from '@angular/core';\nimport {SafeHtml} from '@angular/platform-browser';\nimport {\n TuiHandler,\n tuiIsString,\n TuiStringHandler,\n tuiSvgLinearGradientProcessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_ICONS_PATH,\n TUI_SVG_CONTENT_PROCESSOR,\n TUI_SVG_SRC_PROCESSOR,\n} from '@taiga-ui/core/tokens';\nimport {tuiIconsPathFactory} from '@taiga-ui/core/utils';\nimport {identity} from 'rxjs';\n\nimport {TUI_DEPRECATED_ICONS} from './deprecated-icons';\n\nexport interface TuiSvgOptions {\n readonly path: TuiStringHandler<string>;\n readonly deprecated: TuiStringHandler<string>;\n readonly srcProcessor: TuiHandler<SafeHtml | string, SafeHtml | string>;\n readonly contentProcessor: TuiHandler<SafeHtml | string, SafeHtml | string>;\n}\n\nexport const TUI_SVG_DEFAULT_OPTIONS: TuiSvgOptions = {\n path: tuiIconsPathFactory(`assets/taiga-ui/icons`),\n srcProcessor: identity,\n contentProcessor: tuiSvgLinearGradientProcessor,\n deprecated: src =>\n TUI_DEPRECATED_ICONS[src.replace(`Large`, ``).replace(`Outline`, ``)]\n ? `${src} is deprecated, use ${\n TUI_DEPRECATED_ICONS[src.replace(`Large`, ``)]\n }/Large instead`\n : ``,\n};\n\nexport const TUI_SVG_OPTIONS = new InjectionToken<TuiSvgOptions>(\n `[TUI_SVG_OPTIONS]: SVG component options`,\n {\n factory: () => ({\n path: inject(TUI_ICONS_PATH),\n deprecated: TUI_SVG_DEFAULT_OPTIONS.deprecated,\n srcProcessor: inject(TUI_SVG_SRC_PROCESSOR),\n contentProcessor: inject(TUI_SVG_CONTENT_PROCESSOR),\n }),\n },\n);\n\nexport const tuiSvgOptionsProvider: (\n options: Partial<Omit<TuiSvgOptions, 'path'>> & {\n path?: TuiSvgOptions['path'] | string;\n },\n) => ValueProvider = options => ({\n provide: TUI_SVG_OPTIONS,\n useValue: {\n ...TUI_SVG_DEFAULT_OPTIONS,\n ...options,\n path: tuiIsString(options.path)\n ? tuiIconsPathFactory(options.path)\n : options.path || TUI_SVG_DEFAULT_OPTIONS.path,\n },\n});\n","import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n Input,\n Optional,\n Sanitizer,\n SecurityContext,\n} from '@angular/core';\nimport {DomSanitizer, SafeHtml} from '@angular/platform-browser';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {\n tuiAssert,\n tuiGetDocumentOrShadowRoot,\n tuiIsString,\n tuiPure,\n tuiRequiredSetter,\n TuiStaticRequestService,\n TuiStringHandler,\n} from '@taiga-ui/cdk';\nimport {TUI_ICON_ERROR} from '@taiga-ui/core/constants';\nimport {TuiIconError} from '@taiga-ui/core/interfaces';\nimport {TuiSvgService} from '@taiga-ui/core/services';\nimport {TUI_SANITIZER} from '@taiga-ui/core/tokens';\nimport {tuiIsPresumedHTMLString} from '@taiga-ui/core/utils/miscellaneous';\nimport {Observable, of, ReplaySubject} from 'rxjs';\nimport {catchError, map, startWith, switchMap} from 'rxjs/operators';\n\nimport {TUI_SVG_OPTIONS, TuiSvgOptions} from './svg-options';\n\nconst UNDEFINED_NAMED_ICON = 'Attempted to use undefined named icon';\nconst MISSING_EXTERNAL_ICON = 'External icon is missing on the given URL';\nconst FAILED_EXTERNAL_ICON = 'Failed to load external SVG';\n\n// TODO: Consider moving to CDK along with SvgService and SvgDefsHostComponent\n@Component({\n selector: 'tui-svg',\n templateUrl: './svg.template.html',\n styleUrls: ['./svg.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiSvgComponent {\n private readonly src$ = new ReplaySubject<void>(1);\n private icon: SafeHtml | string = '';\n\n readonly innerHTML$: Observable<SafeHtml>;\n\n constructor(\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(TUI_SVG_OPTIONS) private readonly options: TuiSvgOptions,\n @Optional()\n @Inject(TUI_SANITIZER)\n private readonly tuiSanitizer: Sanitizer | null,\n @Inject(TuiSvgService) private readonly svgService: TuiSvgService,\n @Inject(TuiStaticRequestService)\n private readonly staticRequestService: TuiStaticRequestService,\n @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer,\n @Inject(ElementRef) private readonly elementRef: ElementRef<Element>,\n ) {\n this.innerHTML$ = this.src$.pipe(\n switchMap(() => {\n if (tuiIsString(this.icon)) {\n return this.isExternal\n ? this.getExternalIcon(this.icon)\n : of(this.getSafeHtml(this.icon));\n }\n\n return of(this.icon);\n }),\n startWith(''),\n );\n }\n\n @Input()\n @tuiRequiredSetter()\n set src(src: SafeHtml | string) {\n const deprecated = this.options.deprecated(String(src));\n\n tuiAssert.assert(!deprecated, deprecated);\n this.icon = this.options.srcProcessor(src);\n this.src$.next();\n }\n\n get src(): SafeHtml | string {\n return this.icon;\n }\n\n get use(): string {\n if (tuiIsString(this.icon)) {\n return this.icon.includes('.svg#')\n ? this.icon\n : this.resolveName(this.icon, this.options.path);\n }\n\n return '';\n }\n\n get isInnerHTML(): boolean {\n return (\n !tuiIsString(this.icon) ||\n this.isSrc ||\n this.isExternal ||\n (this.isName && this.isShadowDOM)\n );\n }\n\n private get isShadowDOM(): boolean {\n return (\n tuiGetDocumentOrShadowRoot(this.elementRef.nativeElement) !== this.documentRef\n );\n }\n\n private get isUse(): boolean {\n return this.use.includes('.svg#');\n }\n\n private get isExternal(): boolean {\n return this.isUrl || this.isCrossDomain;\n }\n\n private get isUrl(): boolean {\n return tuiIsString(this.icon) && this.icon.endsWith('.svg');\n }\n\n private get isSrc(): boolean {\n return tuiIsString(this.icon) && tuiIsPresumedHTMLString(this.icon);\n }\n\n private get isName(): boolean {\n return !this.isUrl && !this.isUse && !this.isSrc;\n }\n\n private get isCrossDomain(): boolean {\n const {use, isUse, windowRef} = this;\n\n return (\n isUse &&\n use.startsWith('http') &&\n !!windowRef.origin &&\n !use.startsWith(windowRef.origin)\n );\n }\n\n onError(message: string = MISSING_EXTERNAL_ICON): void {\n const {icon} = this;\n const event = new CustomEvent<TuiIconError>(TUI_ICON_ERROR, {\n bubbles: true,\n detail: {\n message,\n icon: icon as string,\n },\n });\n\n tuiAssert.assert(false, message, icon);\n this.elementRef.nativeElement.dispatchEvent(event);\n }\n\n @tuiPure\n private resolveName(name: string, iconsPath: TuiStringHandler<string>): string {\n return iconsPath(name);\n }\n\n private getSafeHtml(src: string): SafeHtml {\n return this.isSrc ? this.sanitize(src) : this.process(src);\n }\n\n private process(src: string): SafeHtml {\n const icon = this.svgService.getOriginal(src);\n\n if (this.isName && !icon && !!src) {\n this.onError(UNDEFINED_NAMED_ICON);\n }\n\n // Empty line for innerHTML when icon is shown through USE tag\n return !this.isShadowDOM || !this.isName ? '' : this.sanitize(icon || '');\n }\n\n private sanitize(src: SafeHtml | string): SafeHtml | string {\n src = this.options.contentProcessor(src);\n\n return this.tuiSanitizer && tuiIsString(src)\n ? this.sanitizer.bypassSecurityTrustHtml(\n this.tuiSanitizer.sanitize(SecurityContext.HTML, src) || '',\n )\n : src;\n }\n\n private getExternalIcon(src: string): Observable<SafeHtml> {\n const url = src.includes('.svg') ? src : this.use;\n\n return this.staticRequestService.request(url).pipe(\n catchError(() => {\n this.onError(FAILED_EXTERNAL_ICON);\n\n return of('');\n }),\n map(response =>\n this.sanitize(response.replace('<svg', '<svg focusable=\"false\"')),\n ),\n );\n }\n}\n","<ng-container *tuiLet=\"innerHTML$ | async as innerHTML\">\n <div\n *ngIf=\"isInnerHTML; else useTemplate\"\n class=\"t-src\"\n [innerHTML]=\"innerHTML\"\n ></div>\n <ng-template #useTemplate>\n <svg\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n focusable=\"false\"\n width=\"100%\"\n height=\"100%\"\n class=\"t-svg\"\n (error)=\"onError()\"\n >\n <use [attr.xlink:href]=\"use\"></use>\n </svg>\n </ng-template>\n</ng-container>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLetModule} from '@taiga-ui/cdk';\n\nimport {TuiSvgComponent} from './svg.component';\n\n@NgModule({\n imports: [CommonModule, TuiLetModule],\n declarations: [TuiSvgComponent],\n exports: [TuiSvgComponent],\n})\nexport class TuiSvgModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAa,MAAA,oBAAoB,GAA2B;AACxD,IAAA,aAAa,EAAE,CAAkB,gBAAA,CAAA;AACjC,IAAA,gBAAgB,EAAE,CAAoB,kBAAA,CAAA;AACtC,IAAA,iBAAiB,EAAE,CAAwB,sBAAA,CAAA;AAC3C,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;AAC3B,IAAA,aAA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AA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,EAJZ,OAAA,EAAA,CAAA,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA,EAAA,CAAA,CAAA;4FAI5B,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;oBACrC,YAAY,EAAE,CAAC,eAAe,CAAC;oBAC/B,OAAO,EAAE,CAAC,eAAe,CAAC;AAC7B,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-svg.js","sources":["../../../projects/core/components/svg/deprecated-icons.ts","../../../projects/core/components/svg/svg-options.ts","../../../projects/core/components/svg/svg.component.ts","../../../projects/core/components/svg/svg.template.html","../../../projects/core/components/svg/svg.module.ts","../../../projects/core/components/svg/taiga-ui-core-components-svg.ts"],"sourcesContent":["export const TUI_DEPRECATED_ICONS: Record<string, string> = {\n tuiIconAttach: `tuiIconPaperclip`,\n tuiIconAttention: `tuiIconAlertCircle`,\n tuiIconBackCircle: `tuiIconArrowLeftCircle`,\n tuiIconCall: `tuiIconPhone`,\n tuiIconCallIn: `tuiIconPhoneIncoming`,\n tuiIconCallOut: `tuiIconPhoneOutgoing`,\n tuiIconCallTransfer: `tuiIconPhoneForwarded`,\n tuiIconCancel: `tuiIconXCircle`,\n tuiIconCancelCircle: `tuiIconSlash`,\n tuiIconCard: `tuiIconCreditCard`,\n tuiIconCards: `tuiIconCreditCard`,\n tuiIconChartBar: `tuiIconBarChart`,\n tuiIconChart: `tuiIconBarChart`,\n tuiIconCheckList: `tuiIconClipboard`,\n tuiIconCloseCircle: `tuiIconXCircle`,\n tuiIconCollapse: `tuiIconMinimize`,\n tuiIconComment: `tuiIconMessageSquare`,\n tuiIconCommentFw: `tuiIconMessageForward`,\n tuiIconCompany: `tuiIconBriefcase`,\n tuiIconDefaultDoc: `tuiIconFile`,\n tuiIconDesktop: `tuiIconMonitor`,\n tuiIconDesktopOff: `tuiIconMonitorOff`,\n tuiIconDislike: `tuiIconThumbsDown`,\n tuiIconDone: `tuiIconCheckCircle`,\n tuiIconDraft: `tuiIconEdit2`,\n tuiIconEyeOpen: `tuiIconEye`,\n tuiIconEyeClosed: `tuiIconEyeOff`,\n tuiIconExpand: `tuiIconMaximize`,\n tuiIconExternal: `tuiIconExternalLink`,\n tuiIconFrame: `tuiIconLayout`,\n tuiIconGeo: `tuiIconMapPin`,\n tuiIconHeartFilled: `tuiIconHeart`,\n tuiIconHide: `tuiIconEyeOff`,\n tuiIconImg: `tuiIconImage`,\n tuiIconInfoCircle: `tuiIconInfo`,\n tuiIconLike: `tuiIconThumbsUp`,\n tuiIconLockOpen: `tuiIconUnlock`,\n tuiIconMobile: `tuiIconSmartphone`,\n tuiIconMoreHor: `tuiIconMoreHorizontal`,\n tuiIconMoreVer: `tuiIconMoreVertical`,\n tuiIconMoreVert: `tuiIconMoreVertical`,\n tuiIconPicture: `tuiIconImage`,\n tuiIconPin: `tuiIconMapPin`,\n tuiIconPrint: `tuiIconPrinter`,\n tuiIconRefresh: `tuiIconRefreshCw`,\n tuiIconRemove: `tuiIconX`,\n tuiIconShow: `tuiIconEye`,\n tuiIconSound: `tuiIconVolume`,\n tuiIconSoundOff: `tuiIconVolumeX`,\n tuiIconStarFilled: `tuiIconStar`,\n tuiIconStop: `tuiIconSquare`,\n tuiIconStructure: `tuiIconGrid`,\n tuiIconTime: `tuiIconClock`,\n tuiIconTooltip: `tuiIconHelpCircle`,\n tuiIconViewList: `tuiIconList`,\n tuiIconWifiOn: `tuiIconWifi`,\n};\n","import {inject, InjectionToken, ValueProvider} from '@angular/core';\nimport {SafeHtml} from '@angular/platform-browser';\nimport {\n TuiHandler,\n tuiIsString,\n TuiStringHandler,\n tuiSvgLinearGradientProcessor,\n} from '@taiga-ui/cdk';\nimport {\n TUI_ICONS_PATH,\n TUI_SVG_CONTENT_PROCESSOR,\n TUI_SVG_SRC_PROCESSOR,\n} from '@taiga-ui/core/tokens';\nimport {tuiIconsPathFactory} from '@taiga-ui/core/utils';\nimport {identity} from 'rxjs';\n\nimport {TUI_DEPRECATED_ICONS} from './deprecated-icons';\n\nexport interface TuiSvgOptions {\n readonly path: TuiStringHandler<string>;\n readonly deprecated: TuiStringHandler<string>;\n readonly srcProcessor: TuiHandler<SafeHtml | string, SafeHtml | string>;\n readonly contentProcessor: TuiHandler<SafeHtml | string, SafeHtml | string>;\n}\n\nexport const TUI_SVG_DEFAULT_OPTIONS: TuiSvgOptions = {\n path: tuiIconsPathFactory(`assets/taiga-ui/icons`),\n srcProcessor: identity,\n contentProcessor: tuiSvgLinearGradientProcessor,\n deprecated: src =>\n TUI_DEPRECATED_ICONS[src.replace(`Large`, ``).replace(`Outline`, ``)]\n ? `${src} is deprecated, use ${\n TUI_DEPRECATED_ICONS[src.replace(`Large`, ``)]\n }/Large instead`\n : ``,\n};\n\n/**\n * SVG component options\n */\nexport const TUI_SVG_OPTIONS = new InjectionToken<TuiSvgOptions>(`[TUI_SVG_OPTIONS]`, {\n factory: () => ({\n path: inject(TUI_ICONS_PATH),\n deprecated: TUI_SVG_DEFAULT_OPTIONS.deprecated,\n srcProcessor: inject(TUI_SVG_SRC_PROCESSOR),\n contentProcessor: inject(TUI_SVG_CONTENT_PROCESSOR),\n }),\n});\n\nexport const tuiSvgOptionsProvider: (\n options: Partial<Omit<TuiSvgOptions, 'path'>> & {\n path?: TuiSvgOptions['path'] | string;\n },\n) => ValueProvider = options => ({\n provide: TUI_SVG_OPTIONS,\n useValue: {\n ...TUI_SVG_DEFAULT_OPTIONS,\n ...options,\n path: tuiIsString(options.path)\n ? tuiIconsPathFactory(options.path)\n : options.path || TUI_SVG_DEFAULT_OPTIONS.path,\n },\n});\n","import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Inject,\n Input,\n Optional,\n Sanitizer,\n SecurityContext,\n} from '@angular/core';\nimport {DomSanitizer, SafeHtml} from '@angular/platform-browser';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {\n tuiAssert,\n tuiGetDocumentOrShadowRoot,\n tuiIsString,\n tuiPure,\n tuiRequiredSetter,\n TuiStaticRequestService,\n TuiStringHandler,\n} from '@taiga-ui/cdk';\nimport {TUI_ICON_ERROR} from '@taiga-ui/core/constants';\nimport {TuiIconError} from '@taiga-ui/core/interfaces';\nimport {TuiSvgService} from '@taiga-ui/core/services';\nimport {TUI_SANITIZER} from '@taiga-ui/core/tokens';\nimport {tuiIsPresumedHTMLString} from '@taiga-ui/core/utils/miscellaneous';\nimport {Observable, of, ReplaySubject} from 'rxjs';\nimport {catchError, map, startWith, switchMap} from 'rxjs/operators';\n\nimport {TUI_SVG_OPTIONS, TuiSvgOptions} from './svg-options';\n\nconst UNDEFINED_NAMED_ICON = 'Attempted to use undefined named icon';\nconst MISSING_EXTERNAL_ICON = 'External icon is missing on the given URL';\nconst FAILED_EXTERNAL_ICON = 'Failed to load external SVG';\n\n// TODO: Consider moving to CDK along with SvgService and SvgDefsHostComponent\n@Component({\n selector: 'tui-svg',\n templateUrl: './svg.template.html',\n styleUrls: ['./svg.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiSvgComponent {\n private readonly src$ = new ReplaySubject<void>(1);\n private icon: SafeHtml | string = '';\n\n readonly innerHTML$: Observable<SafeHtml>;\n\n constructor(\n @Inject(DOCUMENT) private readonly documentRef: Document,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(TUI_SVG_OPTIONS) private readonly options: TuiSvgOptions,\n @Optional()\n @Inject(TUI_SANITIZER)\n private readonly tuiSanitizer: Sanitizer | null,\n @Inject(TuiSvgService) private readonly svgService: TuiSvgService,\n @Inject(TuiStaticRequestService)\n private readonly staticRequestService: TuiStaticRequestService,\n @Inject(DomSanitizer) private readonly sanitizer: DomSanitizer,\n @Inject(ElementRef) private readonly elementRef: ElementRef<Element>,\n ) {\n this.innerHTML$ = this.src$.pipe(\n switchMap(() => {\n if (tuiIsString(this.icon)) {\n return this.isExternal\n ? this.getExternalIcon(this.icon)\n : of(this.getSafeHtml(this.icon));\n }\n\n return of(this.icon);\n }),\n startWith(''),\n );\n }\n\n @Input()\n @tuiRequiredSetter()\n set src(src: SafeHtml | string) {\n const deprecated = this.options.deprecated(String(src));\n\n tuiAssert.assert(!deprecated, deprecated);\n this.icon = this.options.srcProcessor(src);\n this.src$.next();\n }\n\n get src(): SafeHtml | string {\n return this.icon;\n }\n\n get use(): string {\n if (tuiIsString(this.icon)) {\n return this.icon.includes('.svg#')\n ? this.icon\n : this.resolveName(this.icon, this.options.path);\n }\n\n return '';\n }\n\n get isInnerHTML(): boolean {\n return (\n !tuiIsString(this.icon) ||\n this.isSrc ||\n this.isExternal ||\n (this.isName && this.isShadowDOM)\n );\n }\n\n private get isShadowDOM(): boolean {\n return (\n tuiGetDocumentOrShadowRoot(this.elementRef.nativeElement) !== this.documentRef\n );\n }\n\n private get isUse(): boolean {\n return this.use.includes('.svg#');\n }\n\n private get isExternal(): boolean {\n return this.isUrl || this.isCrossDomain;\n }\n\n private get isUrl(): boolean {\n return tuiIsString(this.icon) && this.icon.endsWith('.svg');\n }\n\n private get isSrc(): boolean {\n return tuiIsString(this.icon) && tuiIsPresumedHTMLString(this.icon);\n }\n\n private get isName(): boolean {\n return !this.isUrl && !this.isUse && !this.isSrc;\n }\n\n private get isCrossDomain(): boolean {\n const {use, isUse, windowRef} = this;\n\n return (\n isUse &&\n use.startsWith('http') &&\n !!windowRef.origin &&\n !use.startsWith(windowRef.origin)\n );\n }\n\n onError(message: string = MISSING_EXTERNAL_ICON): void {\n const {icon} = this;\n const event = new CustomEvent<TuiIconError>(TUI_ICON_ERROR, {\n bubbles: true,\n detail: {\n message,\n icon: icon as string,\n },\n });\n\n tuiAssert.assert(false, message, icon);\n this.elementRef.nativeElement.dispatchEvent(event);\n }\n\n @tuiPure\n private resolveName(name: string, iconsPath: TuiStringHandler<string>): string {\n return iconsPath(name);\n }\n\n private getSafeHtml(src: string): SafeHtml {\n return this.isSrc ? this.sanitize(src) : this.process(src);\n }\n\n private process(src: string): SafeHtml {\n const icon = this.svgService.getOriginal(src);\n\n if (this.isName && !icon && !!src) {\n this.onError(UNDEFINED_NAMED_ICON);\n }\n\n // Empty line for innerHTML when icon is shown through USE tag\n return !this.isShadowDOM || !this.isName ? '' : this.sanitize(icon || '');\n }\n\n private sanitize(src: SafeHtml | string): SafeHtml | string {\n src = this.options.contentProcessor(src);\n\n return this.tuiSanitizer && tuiIsString(src)\n ? this.sanitizer.bypassSecurityTrustHtml(\n this.tuiSanitizer.sanitize(SecurityContext.HTML, src) || '',\n )\n : src;\n }\n\n private getExternalIcon(src: string): Observable<SafeHtml> {\n const url = src.includes('.svg') ? src : this.use;\n\n return this.staticRequestService.request(url).pipe(\n catchError(() => {\n this.onError(FAILED_EXTERNAL_ICON);\n\n return of('');\n }),\n map(response =>\n this.sanitize(response.replace('<svg', '<svg focusable=\"false\"')),\n ),\n );\n }\n}\n","<ng-container *tuiLet=\"innerHTML$ | async as innerHTML\">\n <div\n *ngIf=\"isInnerHTML; else useTemplate\"\n class=\"t-src\"\n [innerHTML]=\"innerHTML\"\n ></div>\n <ng-template #useTemplate>\n <svg\n version=\"1.1\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n focusable=\"false\"\n width=\"100%\"\n height=\"100%\"\n class=\"t-svg\"\n (error)=\"onError()\"\n >\n <use [attr.xlink:href]=\"use\"></use>\n </svg>\n </ng-template>\n</ng-container>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLetModule} from '@taiga-ui/cdk';\n\nimport {TuiSvgComponent} from './svg.component';\n\n@NgModule({\n imports: [CommonModule, TuiLetModule],\n declarations: [TuiSvgComponent],\n exports: [TuiSvgComponent],\n})\nexport class TuiSvgModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAa,MAAA,oBAAoB,GAA2B;AACxD,IAAA,aAAa,EAAE,CAAkB,gBAAA,CAAA;AACjC,IAAA,gBAAgB,EAAE,CAAoB,kBAAA,CAAA;AACtC,IAAA,iBAAiB,EAAE,CAAwB,sBAAA,CAAA;AAC3C,IAAA,WAAW,EAAE,CAAc,YAAA,CAAA;AAC3B,IAAA,aAAa,EAAE,CAAsB,oBAAA,CAAA;AACrC,IAAA,cAAc,EAAE,CAAsB,oBAAA,CAAA;AACtC,IAAA,mBAAmB,EAAE,CAAuB,qBAAA,CAAA;AAC5C,IAAA,aAAa,EAAE,CAAgB,cAAA,CAAA;AAC/B,IAAA,mBAAmB,EAAE,CAAc,YAAA,CAAA;AACnC,IAAA,WAAW,EAAE,CAAmB,iBAAA,CAAA;AAChC,IAAA,YAAY,EAAE,CAAmB,iBAAA,CAAA;AACjC,IAAA,eAAe,EAAE,CAAiB,eAAA,CAAA;AAClC,IAAA,YAAY,EAAE,CAAiB,eAAA,CAAA;AAC/B,IAAA,gBAAgB,EAAE,CAAkB,gBAAA,CAAA;AACpC,IAAA,kBAAkB,EAAE,CAAgB,cAAA,CAAA;AACpC,IAAA,eAAe,EAAE,CAAiB,eAAA,CAAA;AAClC,IAAA,cAAc,EAAE,CAAsB,oBAAA,CAAA;AACtC,IAAA,gBAAgB,EAAE,CAAuB,qBAAA,CAAA;AACzC,IAAA,cAAc,EAAE,CAAkB,gBAAA,CAAA;AAClC,IAAA,iBAAiB,EAAE,CAAa,WAAA,CAAA;AAChC,IAAA,cAAc,EAAE,CAAgB,cAAA,CAAA;AAChC,IAAA,iBAAiB,EAAE,CAAmB,iBAAA,CAAA;AACtC,IAAA,cAAc,EAAE,CAAmB,iBAAA,CAAA;AACnC,IAAA,WAAW,EAAE,CAAoB,kBAAA,CAA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,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAZ,YAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,iBAHN,eAAe,CAAA,EAAA,OAAA,EAAA,CADpB,YAAY,EAAE,YAAY,aAE1B,eAAe,CAAA,EAAA,CAAA,CAAA;AAEhB,YAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,EAJZ,OAAA,EAAA,CAAA,CAAC,YAAY,EAAE,YAAY,CAAC,CAAA,EAAA,CAAA,CAAA;4FAI5B,YAAY,EAAA,UAAA,EAAA,CAAA;kBALxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;oBACrC,YAAY,EAAE,CAAC,eAAe,CAAC;oBAC/B,OAAO,EAAE,CAAC,eAAe,CAAC;AAC7B,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
@@ -4,16 +4,16 @@ import { WINDOW } from '@ng-web-apis/common';
|
|
|
4
4
|
import * as i2 from '@taiga-ui/cdk';
|
|
5
5
|
import { TuiDropdownPortalService, tuiDefaultProp, tuiPure, TuiHoveredService, tuiPx, tuiGetClosestFocusable, TuiDestroyService, AbstractTuiPortalHostComponent, EMPTY_CLIENT_RECT, tuiPointToClientRect, TuiActiveZoneDirective, ALWAYS_TRUE_HANDLER, tuiIsTextNode, tuiIsString, tuiIsElement, tuiGetNativeFocused, tuiIsTextfield, CHAR_ZERO_WIDTH_SPACE, CHAR_NO_BREAK_SPACE, TUI_RANGE, TuiActiveZoneModule, TuiOverscrollModule, TuiHoveredModule } from '@taiga-ui/cdk';
|
|
6
6
|
import * as i1$2 from '@taiga-ui/core/abstract';
|
|
7
|
-
import { tuiAsRectAccessor, tuiAsVehicle, TuiDriver, tuiAsDriver, TuiRectAccessor, AbstractTuiDriverDirective, tuiAsPositionAccessor } from '@taiga-ui/core/abstract';
|
|
7
|
+
import { tuiAsRectAccessor, tuiAsVehicle, TuiDriver, tuiAsDriver, TuiRectAccessor, tuiPositionAccessorFor, tuiRectAccessorFor, AbstractTuiDriverDirective, TuiVehicle, TuiPositionAccessor, tuiFallbackRectAccessor, tuiAsPositionAccessor } from '@taiga-ui/core/abstract';
|
|
8
8
|
import { tuiDropdownAnimation } from '@taiga-ui/core/animations';
|
|
9
9
|
import { TuiPositionService } from '@taiga-ui/core/services';
|
|
10
10
|
import { TUI_ANIMATION_OPTIONS, TUI_VIEWPORT, TUI_SELECTION_STREAM } from '@taiga-ui/core/tokens';
|
|
11
11
|
import { switchMap, delay, tap, share, takeUntil, map, distinctUntilChanged } from 'rxjs/operators';
|
|
12
12
|
import { __decorate } from 'tslib';
|
|
13
13
|
import { tuiCheckFixedPosition, tuiOverrideOptions, tuiGetWordRange } from '@taiga-ui/core/utils';
|
|
14
|
-
import * as
|
|
14
|
+
import * as i4 from '@tinkoff/ng-polymorpheus';
|
|
15
15
|
import { PolymorpheusComponent, PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
16
|
-
import * as
|
|
16
|
+
import * as i1 from 'rxjs';
|
|
17
17
|
import { Subject, merge, of, BehaviorSubject, combineLatest } from 'rxjs';
|
|
18
18
|
import * as i1$1 from '@taiga-ui/core/components/scrollbar';
|
|
19
19
|
import { TuiScrollbarModule } from '@taiga-ui/core/components/scrollbar';
|
|
@@ -22,17 +22,23 @@ import { TuiModeModule } from '@taiga-ui/core/directives/mode';
|
|
|
22
22
|
import { shouldCall } from '@tinkoff/ng-event-plugins';
|
|
23
23
|
import { DOCUMENT } from '@angular/common';
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* A component to display a dropdown
|
|
27
|
+
*/
|
|
28
|
+
const TUI_DROPDOWN_COMPONENT = new InjectionToken(`[TUI_DROPDOWN_COMPONENT]`, {
|
|
26
29
|
factory: () => TuiDropdownComponent,
|
|
27
30
|
});
|
|
28
31
|
|
|
29
32
|
class TuiDropdownDirective {
|
|
30
|
-
constructor(elementRef,
|
|
33
|
+
constructor(elementRef, hapica, injector, dropdownService) {
|
|
31
34
|
this.elementRef = elementRef;
|
|
32
|
-
this.
|
|
35
|
+
this.hapica = hapica;
|
|
36
|
+
this.injector = injector;
|
|
33
37
|
this.dropdownService = dropdownService;
|
|
34
38
|
this.content = '';
|
|
35
39
|
this.dropdownBoxRef = null;
|
|
40
|
+
this.type = 'dropdown';
|
|
41
|
+
this.component = new PolymorpheusComponent(this.hapica, this.injector);
|
|
36
42
|
}
|
|
37
43
|
get position() {
|
|
38
44
|
return tuiCheckFixedPosition(this.elementRef.nativeElement)
|
|
@@ -65,15 +71,10 @@ class TuiDropdownDirective {
|
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
|
-
TuiDropdownDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownDirective, deps: [{ token: ElementRef }, { token:
|
|
74
|
+
TuiDropdownDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownDirective, deps: [{ token: ElementRef }, { token: TUI_DROPDOWN_COMPONENT }, { token: INJECTOR }, { token: TuiDropdownPortalService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
69
75
|
TuiDropdownDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: { content: ["tuiDropdown", "content"] }, providers: [
|
|
70
76
|
tuiAsRectAccessor(TuiDropdownDirective),
|
|
71
77
|
tuiAsVehicle(TuiDropdownDirective),
|
|
72
|
-
{
|
|
73
|
-
provide: PolymorpheusComponent,
|
|
74
|
-
deps: [TUI_DROPDOWN_COMPONENT, INJECTOR],
|
|
75
|
-
useClass: PolymorpheusComponent,
|
|
76
|
-
},
|
|
77
78
|
], exportAs: ["tuiDropdown"], usesOnChanges: true, ngImport: i0 });
|
|
78
79
|
__decorate([
|
|
79
80
|
tuiDefaultProp()
|
|
@@ -89,19 +90,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
89
90
|
providers: [
|
|
90
91
|
tuiAsRectAccessor(TuiDropdownDirective),
|
|
91
92
|
tuiAsVehicle(TuiDropdownDirective),
|
|
92
|
-
{
|
|
93
|
-
provide: PolymorpheusComponent,
|
|
94
|
-
deps: [TUI_DROPDOWN_COMPONENT, INJECTOR],
|
|
95
|
-
useClass: PolymorpheusComponent,
|
|
96
|
-
},
|
|
97
93
|
],
|
|
98
94
|
}]
|
|
99
95
|
}], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
|
|
100
96
|
type: Inject,
|
|
101
97
|
args: [ElementRef]
|
|
102
|
-
}] }, { type:
|
|
98
|
+
}] }, { type: i0.Type, decorators: [{
|
|
103
99
|
type: Inject,
|
|
104
|
-
args: [
|
|
100
|
+
args: [TUI_DROPDOWN_COMPONENT]
|
|
101
|
+
}] }, { type: i0.Injector, decorators: [{
|
|
102
|
+
type: Inject,
|
|
103
|
+
args: [INJECTOR]
|
|
105
104
|
}] }, { type: i2.TuiDropdownPortalService, decorators: [{
|
|
106
105
|
type: Inject,
|
|
107
106
|
args: [TuiDropdownPortalService]
|
|
@@ -115,7 +114,10 @@ const TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS = {
|
|
|
115
114
|
showDelay: 200,
|
|
116
115
|
hideDelay: 500,
|
|
117
116
|
};
|
|
118
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Default parameters for dropdown hover directive
|
|
119
|
+
*/
|
|
120
|
+
const TUI_DROPDOWN_HOVER_OPTIONS = new InjectionToken('[TUI_DROPDOWN_HOVER_OPTIONS]', {
|
|
119
121
|
factory: () => TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS,
|
|
120
122
|
});
|
|
121
123
|
const tuiDropdownHoverOptionsProvider = (options) => ({
|
|
@@ -135,6 +137,7 @@ class TuiDropdownHoverDirective extends TuiDriver {
|
|
|
135
137
|
this.showDelay = this.options.showDelay;
|
|
136
138
|
this.hideDelay = this.options.hideDelay;
|
|
137
139
|
this.hovered = false;
|
|
140
|
+
this.type = 'dropdown';
|
|
138
141
|
}
|
|
139
142
|
toggle(visible) {
|
|
140
143
|
this.toggle$.next(visible);
|
|
@@ -154,7 +157,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
154
157
|
selector: '[tuiDropdownHover]:not(ng-container)',
|
|
155
158
|
providers: [tuiAsDriver(TuiDropdownHoverDirective), TuiHoveredService],
|
|
156
159
|
}]
|
|
157
|
-
}], ctorParameters: function () { return [{ type:
|
|
160
|
+
}], ctorParameters: function () { return [{ type: i1.Observable, decorators: [{
|
|
158
161
|
type: Inject,
|
|
159
162
|
args: [TuiHoveredService]
|
|
160
163
|
}] }, { type: undefined, decorators: [{
|
|
@@ -177,7 +180,10 @@ const TUI_DROPDOWN_DEFAULT_OPTIONS = {
|
|
|
177
180
|
minHeight: 80,
|
|
178
181
|
offset: 4,
|
|
179
182
|
};
|
|
180
|
-
|
|
183
|
+
/**
|
|
184
|
+
* Default parameters for dropdown directive
|
|
185
|
+
*/
|
|
186
|
+
const TUI_DROPDOWN_OPTIONS = new InjectionToken('[TUI_DROPDOWN_OPTIONS]', {
|
|
181
187
|
factory: () => TUI_DROPDOWN_DEFAULT_OPTIONS,
|
|
182
188
|
});
|
|
183
189
|
const tuiDropdownOptionsProvider = (override) => ({
|
|
@@ -332,34 +338,44 @@ class TuiDropdownComponent {
|
|
|
332
338
|
}
|
|
333
339
|
}
|
|
334
340
|
moveFocusOutside(previous) {
|
|
335
|
-
const
|
|
336
|
-
const { ownerDocument } =
|
|
337
|
-
const root = ownerDocument ? ownerDocument.body :
|
|
338
|
-
let focusable = tuiGetClosestFocusable({ initial:
|
|
339
|
-
while (focusable !== null &&
|
|
341
|
+
const { nativeElement } = this.directive.elementRef;
|
|
342
|
+
const { ownerDocument } = nativeElement;
|
|
343
|
+
const root = ownerDocument ? ownerDocument.body : nativeElement;
|
|
344
|
+
let focusable = tuiGetClosestFocusable({ initial: nativeElement, root, previous });
|
|
345
|
+
while (focusable !== null && nativeElement.contains(focusable)) {
|
|
340
346
|
focusable = tuiGetClosestFocusable({ initial: focusable, root, previous });
|
|
341
347
|
}
|
|
342
348
|
focusable === null || focusable === void 0 ? void 0 : focusable.focus();
|
|
343
349
|
}
|
|
344
350
|
}
|
|
345
351
|
TuiDropdownComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownComponent, deps: [{ token: TuiPositionService }, { token: TuiDestroyService, self: true }, { token: TuiDropdownDirective }, { token: ElementRef }, { token: AbstractTuiPortalHostComponent }, { token: TuiRectAccessor }, { token: WINDOW }, { token: TUI_ANIMATION_OPTIONS }, { token: TUI_DROPDOWN_OPTIONS }, { token: TuiDropdownHoverDirective, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
346
|
-
TuiDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownComponent, selector: "tui-dropdown", host: { properties: { "@tuiDropdownAnimation": "this.dropdownAnimation" } }, providers: [
|
|
352
|
+
TuiDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownComponent, selector: "tui-dropdown", host: { properties: { "@tuiDropdownAnimation": "this.dropdownAnimation" } }, providers: [
|
|
353
|
+
TuiDestroyService,
|
|
354
|
+
TuiPositionService,
|
|
355
|
+
tuiPositionAccessorFor('dropdown'),
|
|
356
|
+
tuiRectAccessorFor('dropdown', TuiDropdownDirective),
|
|
357
|
+
], ngImport: i0, template: "<div\n #activeZone=\"tuiActiveZone\"\n tuiActiveZone\n tuiOverscroll=\"all\"\n class=\"t-wrapper\"\n [tuiMode]=\"null\"\n (tuiHoveredChange)=\"onHoveredChange($event)\"\n>\n <tui-scrollbar class=\"t-scroll\">\n <div\n tabindex=\"0\"\n (focus)=\"onTopFocus()\"\n ></div>\n <div\n *polymorpheusOutlet=\"directive.content as text; context: {$implicit: activeZone}\"\n class=\"t-primitive\"\n >\n {{ text }}\n </div>\n <div\n tabindex=\"0\"\n (focus)=\"onBottomFocus()\"\n ></div>\n </tui-scrollbar>\n</div>\n", styles: [":host{position:relative;z-index:0;box-shadow:0 1.5rem 1rem rgba(0,0,0,.03),0 .75rem .75rem rgba(0,0,0,.04),0 .25rem .375rem rgba(0,0,0,.05);position:absolute;display:flex;background-color:var(--tui-elevation-01);border-radius:var(--tui-radius-m);overflow:hidden;border:1px solid var(--tui-base-04);box-sizing:border-box;max-width:calc(100% - 8px)}:host.ng-animating{pointer-events:none}:host:not([style*=\"top\"]){visibility:hidden}.t-wrapper{flex-grow:1;max-width:100%;max-height:inherit;overflow:visible}.t-scroll{height:100%}.t-primitive{padding:1rem}\n"], components: [{ type: i1$1.TuiScrollbarComponent, selector: "tui-scrollbar", inputs: ["hidden"] }], directives: [{ type: i2.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i2.TuiOverscrollDirective, selector: "[tuiOverscroll]", inputs: ["tuiOverscroll"] }, { type: i3.TuiModeDirective, selector: "[tuiMode]", inputs: ["tuiMode"] }, { type: i2.TuiHoveredDirective, selector: "[tuiHoveredChange]", outputs: ["tuiHoveredChange"] }, { type: i4.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], animations: [tuiDropdownAnimation], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
347
358
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownComponent, decorators: [{
|
|
348
359
|
type: Component,
|
|
349
360
|
args: [{
|
|
350
361
|
selector: 'tui-dropdown',
|
|
351
362
|
templateUrl: './dropdown.template.html',
|
|
352
363
|
styleUrls: ['./dropdown.style.less'],
|
|
353
|
-
providers: [
|
|
364
|
+
providers: [
|
|
365
|
+
TuiDestroyService,
|
|
366
|
+
TuiPositionService,
|
|
367
|
+
tuiPositionAccessorFor('dropdown'),
|
|
368
|
+
tuiRectAccessorFor('dropdown', TuiDropdownDirective),
|
|
369
|
+
],
|
|
354
370
|
animations: [tuiDropdownAnimation],
|
|
355
371
|
// @bad TODO: OnPush
|
|
356
372
|
// eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
|
|
357
373
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
358
374
|
}]
|
|
359
|
-
}], ctorParameters: function () { return [{ type:
|
|
375
|
+
}], ctorParameters: function () { return [{ type: i1.Observable, decorators: [{
|
|
360
376
|
type: Inject,
|
|
361
377
|
args: [TuiPositionService]
|
|
362
|
-
}] }, { type:
|
|
378
|
+
}] }, { type: i1.Observable, decorators: [{
|
|
363
379
|
type: Self
|
|
364
380
|
}, {
|
|
365
381
|
type: Inject,
|
|
@@ -404,6 +420,7 @@ class TuiDropdownContextDirective extends TuiDriver {
|
|
|
404
420
|
this.activeZone = activeZone;
|
|
405
421
|
this.stream$ = new Subject();
|
|
406
422
|
this.currentRect = EMPTY_CLIENT_RECT;
|
|
423
|
+
this.type = 'dropdown';
|
|
407
424
|
}
|
|
408
425
|
onContextMenu(x, y) {
|
|
409
426
|
this.currentRect = tuiPointToClientRect(x, y);
|
|
@@ -453,8 +470,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
453
470
|
}] } });
|
|
454
471
|
|
|
455
472
|
class TuiDropdownDriverDirective extends AbstractTuiDriverDirective {
|
|
473
|
+
// TODO: Figure out why this is necessary under nx test runner
|
|
474
|
+
constructor(destroy$, drivers, vehicles) {
|
|
475
|
+
super(destroy$, drivers, vehicles);
|
|
476
|
+
this.type = 'dropdown';
|
|
477
|
+
}
|
|
456
478
|
}
|
|
457
|
-
TuiDropdownDriverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownDriverDirective, deps:
|
|
479
|
+
TuiDropdownDriverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownDriverDirective, deps: [{ token: TuiDestroyService, self: true }, { token: TuiDriver }, { token: TuiVehicle }], target: i0.ɵɵFactoryTarget.Directive });
|
|
458
480
|
TuiDropdownDriverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownDriverDirective, selector: "[tuiDropdown]", providers: [TuiDestroyService], usesInheritance: true, ngImport: i0 });
|
|
459
481
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownDriverDirective, decorators: [{
|
|
460
482
|
type: Directive,
|
|
@@ -462,9 +484,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
462
484
|
selector: '[tuiDropdown]',
|
|
463
485
|
providers: [TuiDestroyService],
|
|
464
486
|
}]
|
|
465
|
-
}]
|
|
487
|
+
}], ctorParameters: function () { return [{ type: i1.Observable, decorators: [{
|
|
488
|
+
type: Self
|
|
489
|
+
}, {
|
|
490
|
+
type: Inject,
|
|
491
|
+
args: [TuiDestroyService]
|
|
492
|
+
}] }, { type: undefined, decorators: [{
|
|
493
|
+
type: Inject,
|
|
494
|
+
args: [TuiDriver]
|
|
495
|
+
}] }, { type: undefined, decorators: [{
|
|
496
|
+
type: Inject,
|
|
497
|
+
args: [TuiVehicle]
|
|
498
|
+
}] }]; } });
|
|
466
499
|
|
|
467
500
|
class TuiDropdownHostDirective extends TuiRectAccessor {
|
|
501
|
+
constructor() {
|
|
502
|
+
super(...arguments);
|
|
503
|
+
this.type = 'dropdown';
|
|
504
|
+
}
|
|
468
505
|
getClientRect() {
|
|
469
506
|
var _a;
|
|
470
507
|
return ((_a = this.tuiDropdownHost) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || EMPTY_CLIENT_RECT;
|
|
@@ -485,8 +522,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
485
522
|
class TuiDropdownManualDirective extends TuiDriver {
|
|
486
523
|
constructor() {
|
|
487
524
|
super(subscriber => this.stream$.subscribe(subscriber));
|
|
488
|
-
this.stream$ = new
|
|
525
|
+
this.stream$ = new BehaviorSubject(false);
|
|
489
526
|
this.tuiDropdownManual = false;
|
|
527
|
+
this.type = 'dropdown';
|
|
490
528
|
}
|
|
491
529
|
ngOnChanges() {
|
|
492
530
|
this.stream$.next(this.tuiDropdownManual);
|
|
@@ -504,14 +542,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
504
542
|
type: Input
|
|
505
543
|
}] } });
|
|
506
544
|
|
|
507
|
-
class TuiDropdownPositionDirective {
|
|
508
|
-
constructor(options, viewport,
|
|
545
|
+
class TuiDropdownPositionDirective extends TuiPositionAccessor {
|
|
546
|
+
constructor(options, viewport, accessors, directive) {
|
|
547
|
+
super();
|
|
509
548
|
this.options = options;
|
|
510
549
|
this.viewport = viewport;
|
|
511
|
-
this.
|
|
550
|
+
this.accessors = accessors;
|
|
551
|
+
this.directive = directive;
|
|
552
|
+
this.type = 'dropdown';
|
|
512
553
|
}
|
|
513
554
|
getPosition({ width, height }) {
|
|
514
|
-
|
|
555
|
+
var _a, _b;
|
|
556
|
+
const hostRect = (_b = (_a = this.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : EMPTY_CLIENT_RECT;
|
|
515
557
|
const viewport = this.viewport.getClientRect();
|
|
516
558
|
const { minHeight, align, direction, offset } = this.options;
|
|
517
559
|
const previous = this.previous || direction || 'bottom';
|
|
@@ -534,9 +576,15 @@ class TuiDropdownPositionDirective {
|
|
|
534
576
|
this.previous = better;
|
|
535
577
|
return [position[better], position[align]];
|
|
536
578
|
}
|
|
579
|
+
get accessor() {
|
|
580
|
+
return tuiFallbackRectAccessor('dropdown')(this.accessors, this.directive);
|
|
581
|
+
}
|
|
537
582
|
}
|
|
538
|
-
TuiDropdownPositionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownPositionDirective, deps: [{ token: TUI_DROPDOWN_OPTIONS }, { token: TUI_VIEWPORT }, { token: TuiRectAccessor }], target: i0.ɵɵFactoryTarget.Directive });
|
|
539
|
-
TuiDropdownPositionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])", providers: [tuiAsPositionAccessor(TuiDropdownPositionDirective)], ngImport: i0 });
|
|
583
|
+
TuiDropdownPositionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownPositionDirective, deps: [{ token: TUI_DROPDOWN_OPTIONS }, { token: TUI_VIEWPORT }, { token: TuiRectAccessor }, { token: TuiDropdownDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
584
|
+
TuiDropdownPositionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])", providers: [tuiAsPositionAccessor(TuiDropdownPositionDirective)], usesInheritance: true, ngImport: i0 });
|
|
585
|
+
__decorate([
|
|
586
|
+
tuiPure
|
|
587
|
+
], TuiDropdownPositionDirective.prototype, "accessor", null);
|
|
540
588
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownPositionDirective, decorators: [{
|
|
541
589
|
type: Directive,
|
|
542
590
|
args: [{
|
|
@@ -549,27 +597,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
549
597
|
}] }, { type: i1$2.TuiRectAccessor, decorators: [{
|
|
550
598
|
type: Inject,
|
|
551
599
|
args: [TUI_VIEWPORT]
|
|
552
|
-
}] }, { type:
|
|
600
|
+
}] }, { type: undefined, decorators: [{
|
|
553
601
|
type: Inject,
|
|
554
602
|
args: [TuiRectAccessor]
|
|
555
|
-
}] }
|
|
603
|
+
}] }, { type: TuiDropdownDirective, decorators: [{
|
|
604
|
+
type: Inject,
|
|
605
|
+
args: [TuiDropdownDirective]
|
|
606
|
+
}] }]; }, propDecorators: { accessor: [] } });
|
|
556
607
|
|
|
557
|
-
class TuiDropdownPositionSidedDirective {
|
|
558
|
-
constructor(options, viewport,
|
|
608
|
+
class TuiDropdownPositionSidedDirective extends TuiPositionAccessor {
|
|
609
|
+
constructor(options, viewport, vertical) {
|
|
610
|
+
super();
|
|
559
611
|
this.options = options;
|
|
560
612
|
this.viewport = viewport;
|
|
561
|
-
this.accessor = accessor;
|
|
562
613
|
this.vertical = vertical;
|
|
563
614
|
this.previous = this.options.direction || 'bottom';
|
|
564
615
|
this.tuiDropdownSided = '';
|
|
565
616
|
this.tuiDropdownSidedOffset = 4;
|
|
617
|
+
this.type = 'dropdown';
|
|
566
618
|
}
|
|
567
619
|
getPosition(rect) {
|
|
620
|
+
var _a, _b;
|
|
568
621
|
if (this.tuiDropdownSided === false) {
|
|
569
622
|
return this.vertical.getPosition(rect);
|
|
570
623
|
}
|
|
571
624
|
const { height, width } = rect;
|
|
572
|
-
const hostRect = this.accessor.getClientRect();
|
|
625
|
+
const hostRect = (_b = (_a = this.vertical.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : EMPTY_CLIENT_RECT;
|
|
573
626
|
const viewport = this.viewport.getClientRect();
|
|
574
627
|
const { align, direction, minHeight, offset } = this.options;
|
|
575
628
|
const available = {
|
|
@@ -595,11 +648,11 @@ class TuiDropdownPositionSidedDirective {
|
|
|
595
648
|
return [position[better], left];
|
|
596
649
|
}
|
|
597
650
|
}
|
|
598
|
-
TuiDropdownPositionSidedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownPositionSidedDirective, deps: [{ token: TUI_DROPDOWN_OPTIONS }, { token: TUI_VIEWPORT }, { token:
|
|
651
|
+
TuiDropdownPositionSidedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownPositionSidedDirective, deps: [{ token: TUI_DROPDOWN_OPTIONS }, { token: TUI_VIEWPORT }, { token: TuiDropdownPositionDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
599
652
|
TuiDropdownPositionSidedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownPositionSidedDirective, selector: "[tuiDropdownSided]", inputs: { tuiDropdownSided: "tuiDropdownSided", tuiDropdownSidedOffset: "tuiDropdownSidedOffset" }, providers: [
|
|
600
653
|
TuiDropdownPositionDirective,
|
|
601
654
|
tuiAsPositionAccessor(TuiDropdownPositionSidedDirective),
|
|
602
|
-
], ngImport: i0 });
|
|
655
|
+
], usesInheritance: true, ngImport: i0 });
|
|
603
656
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownPositionSidedDirective, decorators: [{
|
|
604
657
|
type: Directive,
|
|
605
658
|
args: [{
|
|
@@ -615,10 +668,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
615
668
|
}] }, { type: i1$2.TuiRectAccessor, decorators: [{
|
|
616
669
|
type: Inject,
|
|
617
670
|
args: [TUI_VIEWPORT]
|
|
618
|
-
}] }, { type:
|
|
619
|
-
type: Inject,
|
|
620
|
-
args: [TuiRectAccessor]
|
|
621
|
-
}] }, { type: i1$2.TuiPositionAccessor, decorators: [{
|
|
671
|
+
}] }, { type: TuiDropdownPositionDirective, decorators: [{
|
|
622
672
|
type: Inject,
|
|
623
673
|
args: [TuiDropdownPositionDirective]
|
|
624
674
|
}] }]; }, propDecorators: { tuiDropdownSided: [{
|
|
@@ -649,6 +699,7 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
649
699
|
return (contained && handler(this.range)) || this.inDropdown(range);
|
|
650
700
|
}));
|
|
651
701
|
this.position = 'selection';
|
|
702
|
+
this.type = 'dropdown';
|
|
652
703
|
}
|
|
653
704
|
set tuiDropdownSelection(visible) {
|
|
654
705
|
if (!tuiIsString(visible)) {
|
|
@@ -762,7 +813,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
762
813
|
}] }, { type: Document, decorators: [{
|
|
763
814
|
type: Inject,
|
|
764
815
|
args: [DOCUMENT]
|
|
765
|
-
}] }, { type:
|
|
816
|
+
}] }, { type: i1.Observable, decorators: [{
|
|
766
817
|
type: Inject,
|
|
767
818
|
args: [TUI_SELECTION_STREAM]
|
|
768
819
|
}] }, { type: i0.ElementRef, decorators: [{
|