@taiga-ui/core 3.19.0-dev.main-8e6cab0 → 3.19.0-dev.main-9e6bc23

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 (63) hide show
  1. package/abstract/abstract-driver.directive.d.ts +9 -2
  2. package/abstract/driver.d.ts +1 -0
  3. package/abstract/position-accessor.d.ts +3 -1
  4. package/abstract/rect-accessor.d.ts +4 -1
  5. package/abstract/vehicle.d.ts +1 -0
  6. package/bundles/taiga-ui-core-abstract.umd.js +49 -10
  7. package/bundles/taiga-ui-core-abstract.umd.js.map +1 -1
  8. package/bundles/taiga-ui-core-directives-dropdown.umd.js +155 -107
  9. package/bundles/taiga-ui-core-directives-dropdown.umd.js.map +1 -1
  10. package/bundles/taiga-ui-core-directives-hint.umd.js +235 -180
  11. package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
  12. package/bundles/taiga-ui-core-tokens.umd.js +1 -0
  13. package/bundles/taiga-ui-core-tokens.umd.js.map +1 -1
  14. package/directives/dropdown/dropdown-context.directive.d.ts +1 -0
  15. package/directives/dropdown/dropdown-driver.directive.d.ts +5 -2
  16. package/directives/dropdown/dropdown-host.directive.d.ts +1 -0
  17. package/directives/dropdown/dropdown-hover.directive.d.ts +1 -0
  18. package/directives/dropdown/dropdown-manual.directive.d.ts +1 -0
  19. package/directives/dropdown/dropdown-position-sided.directive.d.ts +4 -3
  20. package/directives/dropdown/dropdown-position.directive.d.ts +7 -3
  21. package/directives/dropdown/dropdown-selection.directive.d.ts +1 -0
  22. package/directives/dropdown/dropdown.directive.d.ts +7 -4
  23. package/directives/hint/hint-describe.directive.d.ts +3 -5
  24. package/directives/hint/hint-driver.directive.d.ts +5 -2
  25. package/directives/hint/hint-host.directive.d.ts +1 -0
  26. package/directives/hint/hint-hover.directive.d.ts +2 -0
  27. package/directives/hint/hint-manual.directive.d.ts +3 -1
  28. package/directives/hint/hint-position.directive.d.ts +6 -3
  29. package/directives/hint/hint.directive.d.ts +3 -2
  30. package/esm2015/abstract/abstract-driver.directive.js +15 -7
  31. package/esm2015/abstract/driver.js +2 -1
  32. package/esm2015/abstract/position-accessor.js +10 -1
  33. package/esm2015/abstract/rect-accessor.js +14 -1
  34. package/esm2015/abstract/vehicle.js +2 -1
  35. package/esm2015/directives/dropdown/dropdown-context.directive.js +2 -1
  36. package/esm2015/directives/dropdown/dropdown-driver.directive.js +22 -5
  37. package/esm2015/directives/dropdown/dropdown-host.directive.js +5 -1
  38. package/esm2015/directives/dropdown/dropdown-hover.directive.js +2 -1
  39. package/esm2015/directives/dropdown/dropdown-manual.directive.js +4 -3
  40. package/esm2015/directives/dropdown/dropdown-position-sided.directive.js +13 -12
  41. package/esm2015/directives/dropdown/dropdown-position.directive.js +27 -10
  42. package/esm2015/directives/dropdown/dropdown-selection.directive.js +2 -1
  43. package/esm2015/directives/dropdown/dropdown.component.js +19 -9
  44. package/esm2015/directives/dropdown/dropdown.directive.js +14 -19
  45. package/esm2015/directives/hint/hint-describe.directive.js +5 -11
  46. package/esm2015/directives/hint/hint-driver.directive.js +22 -5
  47. package/esm2015/directives/hint/hint-host.directive.js +5 -1
  48. package/esm2015/directives/hint/hint-hover.directive.js +5 -3
  49. package/esm2015/directives/hint/hint-manual.directive.js +12 -5
  50. package/esm2015/directives/hint/hint-position.directive.js +24 -10
  51. package/esm2015/directives/hint/hint.component.js +18 -4
  52. package/esm2015/directives/hint/hint.directive.js +3 -1
  53. package/esm2015/directives/hint/hint.providers.js +2 -1
  54. package/esm2015/tokens/viewport.js +2 -1
  55. package/fesm2015/taiga-ui-core-abstract.js +39 -9
  56. package/fesm2015/taiga-ui-core-abstract.js.map +1 -1
  57. package/fesm2015/taiga-ui-core-directives-dropdown.js +92 -50
  58. package/fesm2015/taiga-ui-core-directives-dropdown.js.map +1 -1
  59. package/fesm2015/taiga-ui-core-directives-hint.js +180 -131
  60. package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
  61. package/fesm2015/taiga-ui-core-tokens.js +1 -0
  62. package/fesm2015/taiga-ui-core-tokens.js.map +1 -1
  63. package/package.json +1 -1
@@ -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 i1 from '@tinkoff/ng-polymorpheus';
14
+ import * as i4 from '@tinkoff/ng-polymorpheus';
15
15
  import { PolymorpheusComponent, PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
16
- import * as i5 from 'rxjs';
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';
@@ -27,12 +27,15 @@ const TUI_DROPDOWN_COMPONENT = new InjectionToken(`[TUI_DROPDOWN_COMPONENT] A co
27
27
  });
28
28
 
29
29
  class TuiDropdownDirective {
30
- constructor(elementRef, component, dropdownService) {
30
+ constructor(elementRef, hapica, injector, dropdownService) {
31
31
  this.elementRef = elementRef;
32
- this.component = component;
32
+ this.hapica = hapica;
33
+ this.injector = injector;
33
34
  this.dropdownService = dropdownService;
34
35
  this.content = '';
35
36
  this.dropdownBoxRef = null;
37
+ this.type = 'dropdown';
38
+ this.component = new PolymorpheusComponent(this.hapica, this.injector);
36
39
  }
37
40
  get position() {
38
41
  return tuiCheckFixedPosition(this.elementRef.nativeElement)
@@ -65,15 +68,10 @@ class TuiDropdownDirective {
65
68
  }
66
69
  }
67
70
  }
68
- TuiDropdownDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownDirective, deps: [{ token: ElementRef }, { token: PolymorpheusComponent }, { token: TuiDropdownPortalService }], target: i0.ɵɵFactoryTarget.Directive });
71
+ 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
72
  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
73
  tuiAsRectAccessor(TuiDropdownDirective),
71
74
  tuiAsVehicle(TuiDropdownDirective),
72
- {
73
- provide: PolymorpheusComponent,
74
- deps: [TUI_DROPDOWN_COMPONENT, INJECTOR],
75
- useClass: PolymorpheusComponent,
76
- },
77
75
  ], exportAs: ["tuiDropdown"], usesOnChanges: true, ngImport: i0 });
78
76
  __decorate([
79
77
  tuiDefaultProp()
@@ -89,19 +87,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
89
87
  providers: [
90
88
  tuiAsRectAccessor(TuiDropdownDirective),
91
89
  tuiAsVehicle(TuiDropdownDirective),
92
- {
93
- provide: PolymorpheusComponent,
94
- deps: [TUI_DROPDOWN_COMPONENT, INJECTOR],
95
- useClass: PolymorpheusComponent,
96
- },
97
90
  ],
98
91
  }]
99
92
  }], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
100
93
  type: Inject,
101
94
  args: [ElementRef]
102
- }] }, { type: i1.PolymorpheusComponent, decorators: [{
95
+ }] }, { type: i0.Type, decorators: [{
96
+ type: Inject,
97
+ args: [TUI_DROPDOWN_COMPONENT]
98
+ }] }, { type: i0.Injector, decorators: [{
103
99
  type: Inject,
104
- args: [PolymorpheusComponent]
100
+ args: [INJECTOR]
105
101
  }] }, { type: i2.TuiDropdownPortalService, decorators: [{
106
102
  type: Inject,
107
103
  args: [TuiDropdownPortalService]
@@ -135,6 +131,7 @@ class TuiDropdownHoverDirective extends TuiDriver {
135
131
  this.showDelay = this.options.showDelay;
136
132
  this.hideDelay = this.options.hideDelay;
137
133
  this.hovered = false;
134
+ this.type = 'dropdown';
138
135
  }
139
136
  toggle(visible) {
140
137
  this.toggle$.next(visible);
@@ -154,7 +151,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
154
151
  selector: '[tuiDropdownHover]:not(ng-container)',
155
152
  providers: [tuiAsDriver(TuiDropdownHoverDirective), TuiHoveredService],
156
153
  }]
157
- }], ctorParameters: function () { return [{ type: i5.Observable, decorators: [{
154
+ }], ctorParameters: function () { return [{ type: i1.Observable, decorators: [{
158
155
  type: Inject,
159
156
  args: [TuiHoveredService]
160
157
  }] }, { type: undefined, decorators: [{
@@ -332,34 +329,44 @@ class TuiDropdownComponent {
332
329
  }
333
330
  }
334
331
  moveFocusOutside(previous) {
335
- const host = document.createElement('div');
336
- const { ownerDocument } = host;
337
- const root = ownerDocument ? ownerDocument.body : host;
338
- let focusable = tuiGetClosestFocusable({ initial: host, root, previous });
339
- while (focusable !== null && host.contains(focusable)) {
332
+ const { nativeElement } = this.directive.elementRef;
333
+ const { ownerDocument } = nativeElement;
334
+ const root = ownerDocument ? ownerDocument.body : nativeElement;
335
+ let focusable = tuiGetClosestFocusable({ initial: nativeElement, root, previous });
336
+ while (focusable !== null && nativeElement.contains(focusable)) {
340
337
  focusable = tuiGetClosestFocusable({ initial: focusable, root, previous });
341
338
  }
342
339
  focusable === null || focusable === void 0 ? void 0 : focusable.focus();
343
340
  }
344
341
  }
345
342
  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: [TuiDestroyService, TuiPositionService], 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: i1.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], animations: [tuiDropdownAnimation], changeDetection: i0.ChangeDetectionStrategy.Default });
343
+ TuiDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownComponent, selector: "tui-dropdown", host: { properties: { "@tuiDropdownAnimation": "this.dropdownAnimation" } }, providers: [
344
+ TuiDestroyService,
345
+ TuiPositionService,
346
+ tuiPositionAccessorFor('dropdown'),
347
+ tuiRectAccessorFor('dropdown', TuiDropdownDirective),
348
+ ], 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
349
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownComponent, decorators: [{
348
350
  type: Component,
349
351
  args: [{
350
352
  selector: 'tui-dropdown',
351
353
  templateUrl: './dropdown.template.html',
352
354
  styleUrls: ['./dropdown.style.less'],
353
- providers: [TuiDestroyService, TuiPositionService],
355
+ providers: [
356
+ TuiDestroyService,
357
+ TuiPositionService,
358
+ tuiPositionAccessorFor('dropdown'),
359
+ tuiRectAccessorFor('dropdown', TuiDropdownDirective),
360
+ ],
354
361
  animations: [tuiDropdownAnimation],
355
362
  // @bad TODO: OnPush
356
363
  // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
357
364
  changeDetection: ChangeDetectionStrategy.Default,
358
365
  }]
359
- }], ctorParameters: function () { return [{ type: i5.Observable, decorators: [{
366
+ }], ctorParameters: function () { return [{ type: i1.Observable, decorators: [{
360
367
  type: Inject,
361
368
  args: [TuiPositionService]
362
- }] }, { type: i5.Observable, decorators: [{
369
+ }] }, { type: i1.Observable, decorators: [{
363
370
  type: Self
364
371
  }, {
365
372
  type: Inject,
@@ -404,6 +411,7 @@ class TuiDropdownContextDirective extends TuiDriver {
404
411
  this.activeZone = activeZone;
405
412
  this.stream$ = new Subject();
406
413
  this.currentRect = EMPTY_CLIENT_RECT;
414
+ this.type = 'dropdown';
407
415
  }
408
416
  onContextMenu(x, y) {
409
417
  this.currentRect = tuiPointToClientRect(x, y);
@@ -453,8 +461,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
453
461
  }] } });
454
462
 
455
463
  class TuiDropdownDriverDirective extends AbstractTuiDriverDirective {
464
+ // TODO: Figure out why this is necessary under nx test runner
465
+ constructor(destroy$, drivers, vehicles) {
466
+ super(destroy$, drivers, vehicles);
467
+ this.type = 'dropdown';
468
+ }
456
469
  }
457
- TuiDropdownDriverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownDriverDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
470
+ 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
471
  TuiDropdownDriverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownDriverDirective, selector: "[tuiDropdown]", providers: [TuiDestroyService], usesInheritance: true, ngImport: i0 });
459
472
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownDriverDirective, decorators: [{
460
473
  type: Directive,
@@ -462,9 +475,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
462
475
  selector: '[tuiDropdown]',
463
476
  providers: [TuiDestroyService],
464
477
  }]
465
- }] });
478
+ }], ctorParameters: function () { return [{ type: i1.Observable, decorators: [{
479
+ type: Self
480
+ }, {
481
+ type: Inject,
482
+ args: [TuiDestroyService]
483
+ }] }, { type: undefined, decorators: [{
484
+ type: Inject,
485
+ args: [TuiDriver]
486
+ }] }, { type: undefined, decorators: [{
487
+ type: Inject,
488
+ args: [TuiVehicle]
489
+ }] }]; } });
466
490
 
467
491
  class TuiDropdownHostDirective extends TuiRectAccessor {
492
+ constructor() {
493
+ super(...arguments);
494
+ this.type = 'dropdown';
495
+ }
468
496
  getClientRect() {
469
497
  var _a;
470
498
  return ((_a = this.tuiDropdownHost) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || EMPTY_CLIENT_RECT;
@@ -485,8 +513,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
485
513
  class TuiDropdownManualDirective extends TuiDriver {
486
514
  constructor() {
487
515
  super(subscriber => this.stream$.subscribe(subscriber));
488
- this.stream$ = new Subject();
516
+ this.stream$ = new BehaviorSubject(false);
489
517
  this.tuiDropdownManual = false;
518
+ this.type = 'dropdown';
490
519
  }
491
520
  ngOnChanges() {
492
521
  this.stream$.next(this.tuiDropdownManual);
@@ -504,14 +533,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
504
533
  type: Input
505
534
  }] } });
506
535
 
507
- class TuiDropdownPositionDirective {
508
- constructor(options, viewport, accessor) {
536
+ class TuiDropdownPositionDirective extends TuiPositionAccessor {
537
+ constructor(options, viewport, accessors, directive) {
538
+ super();
509
539
  this.options = options;
510
540
  this.viewport = viewport;
511
- this.accessor = accessor;
541
+ this.accessors = accessors;
542
+ this.directive = directive;
543
+ this.type = 'dropdown';
512
544
  }
513
545
  getPosition({ width, height }) {
514
- const hostRect = this.accessor.getClientRect();
546
+ var _a, _b;
547
+ const hostRect = (_b = (_a = this.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : EMPTY_CLIENT_RECT;
515
548
  const viewport = this.viewport.getClientRect();
516
549
  const { minHeight, align, direction, offset } = this.options;
517
550
  const previous = this.previous || direction || 'bottom';
@@ -534,9 +567,15 @@ class TuiDropdownPositionDirective {
534
567
  this.previous = better;
535
568
  return [position[better], position[align]];
536
569
  }
570
+ get accessor() {
571
+ return tuiFallbackRectAccessor('dropdown')(this.accessors, this.directive);
572
+ }
537
573
  }
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 });
574
+ 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 });
575
+ 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 });
576
+ __decorate([
577
+ tuiPure
578
+ ], TuiDropdownPositionDirective.prototype, "accessor", null);
540
579
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownPositionDirective, decorators: [{
541
580
  type: Directive,
542
581
  args: [{
@@ -549,27 +588,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
549
588
  }] }, { type: i1$2.TuiRectAccessor, decorators: [{
550
589
  type: Inject,
551
590
  args: [TUI_VIEWPORT]
552
- }] }, { type: i1$2.TuiRectAccessor, decorators: [{
591
+ }] }, { type: undefined, decorators: [{
553
592
  type: Inject,
554
593
  args: [TuiRectAccessor]
555
- }] }]; } });
594
+ }] }, { type: TuiDropdownDirective, decorators: [{
595
+ type: Inject,
596
+ args: [TuiDropdownDirective]
597
+ }] }]; }, propDecorators: { accessor: [] } });
556
598
 
557
- class TuiDropdownPositionSidedDirective {
558
- constructor(options, viewport, accessor, vertical) {
599
+ class TuiDropdownPositionSidedDirective extends TuiPositionAccessor {
600
+ constructor(options, viewport, vertical) {
601
+ super();
559
602
  this.options = options;
560
603
  this.viewport = viewport;
561
- this.accessor = accessor;
562
604
  this.vertical = vertical;
563
605
  this.previous = this.options.direction || 'bottom';
564
606
  this.tuiDropdownSided = '';
565
607
  this.tuiDropdownSidedOffset = 4;
608
+ this.type = 'dropdown';
566
609
  }
567
610
  getPosition(rect) {
611
+ var _a, _b;
568
612
  if (this.tuiDropdownSided === false) {
569
613
  return this.vertical.getPosition(rect);
570
614
  }
571
615
  const { height, width } = rect;
572
- const hostRect = this.accessor.getClientRect();
616
+ const hostRect = (_b = (_a = this.vertical.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : EMPTY_CLIENT_RECT;
573
617
  const viewport = this.viewport.getClientRect();
574
618
  const { align, direction, minHeight, offset } = this.options;
575
619
  const available = {
@@ -595,11 +639,11 @@ class TuiDropdownPositionSidedDirective {
595
639
  return [position[better], left];
596
640
  }
597
641
  }
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: TuiRectAccessor }, { token: TuiDropdownPositionDirective }], target: i0.ɵɵFactoryTarget.Directive });
642
+ 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
643
  TuiDropdownPositionSidedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.17", type: TuiDropdownPositionSidedDirective, selector: "[tuiDropdownSided]", inputs: { tuiDropdownSided: "tuiDropdownSided", tuiDropdownSidedOffset: "tuiDropdownSidedOffset" }, providers: [
600
644
  TuiDropdownPositionDirective,
601
645
  tuiAsPositionAccessor(TuiDropdownPositionSidedDirective),
602
- ], ngImport: i0 });
646
+ ], usesInheritance: true, ngImport: i0 });
603
647
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TuiDropdownPositionSidedDirective, decorators: [{
604
648
  type: Directive,
605
649
  args: [{
@@ -615,10 +659,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
615
659
  }] }, { type: i1$2.TuiRectAccessor, decorators: [{
616
660
  type: Inject,
617
661
  args: [TUI_VIEWPORT]
618
- }] }, { type: i1$2.TuiRectAccessor, decorators: [{
619
- type: Inject,
620
- args: [TuiRectAccessor]
621
- }] }, { type: i1$2.TuiPositionAccessor, decorators: [{
662
+ }] }, { type: TuiDropdownPositionDirective, decorators: [{
622
663
  type: Inject,
623
664
  args: [TuiDropdownPositionDirective]
624
665
  }] }]; }, propDecorators: { tuiDropdownSided: [{
@@ -649,6 +690,7 @@ class TuiDropdownSelectionDirective extends TuiDriver {
649
690
  return (contained && handler(this.range)) || this.inDropdown(range);
650
691
  }));
651
692
  this.position = 'selection';
693
+ this.type = 'dropdown';
652
694
  }
653
695
  set tuiDropdownSelection(visible) {
654
696
  if (!tuiIsString(visible)) {
@@ -762,7 +804,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
762
804
  }] }, { type: Document, decorators: [{
763
805
  type: Inject,
764
806
  args: [DOCUMENT]
765
- }] }, { type: i5.Observable, decorators: [{
807
+ }] }, { type: i1.Observable, decorators: [{
766
808
  type: Inject,
767
809
  args: [TUI_SELECTION_STREAM]
768
810
  }] }, { type: i0.ElementRef, decorators: [{