@taiga-ui/core 3.14.0 → 3.15.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/bundles/taiga-ui-core-components-alert.umd.js +11 -11
- package/bundles/taiga-ui-core-components-alert.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-button.umd.js +16 -16
- package/bundles/taiga-ui-core-components-button.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-calendar.umd.js +23 -10
- package/bundles/taiga-ui-core-components-calendar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.js +34 -37
- package/bundles/taiga-ui-core-components-data-list.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.js +16 -16
- package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-error.umd.js +5 -5
- package/bundles/taiga-ui-core-components-error.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.js +17 -18
- package/bundles/taiga-ui-core-components-expand.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-group.umd.js +17 -17
- package/bundles/taiga-ui-core-components-group.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hints-host.umd.js +4 -4
- package/bundles/taiga-ui-core-components-hints-host.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js +13 -13
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-label.umd.js +6 -6
- package/bundles/taiga-ui-core-components-label.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-link.umd.js +14 -14
- package/bundles/taiga-ui-core-components-link.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-loader.umd.js +5 -5
- package/bundles/taiga-ui-core-components-loader.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-notification.umd.js +10 -10
- package/bundles/taiga-ui-core-components-notification.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-calendar.umd.js +5 -5
- package/bundles/taiga-ui-core-components-primitive-calendar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js +5 -5
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js +5 -5
- package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +58 -58
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js +4 -4
- package/bundles/taiga-ui-core-components-primitive-year-picker.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.js +7 -7
- package/bundles/taiga-ui-core-components-root.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-scroll-controls.umd.js +28 -28
- package/bundles/taiga-ui-core-components-scroll-controls.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.umd.js +10 -10
- package/bundles/taiga-ui-core-components-scrollbar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-svg.umd.js +18 -18
- package/bundles/taiga-ui-core-components-svg.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-theme-night.umd.js +4 -4
- package/bundles/taiga-ui-core-components-theme-night.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.js +9 -9
- package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-dropdown.umd.js +94 -91
- package/bundles/taiga-ui-core-directives-dropdown.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-hint.umd.js +61 -61
- package/bundles/taiga-ui-core-directives-hint.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-mask-accessor.umd.js +1 -1
- package/bundles/taiga-ui-core-directives-mask-accessor.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-mode.umd.js +2 -2
- package/bundles/taiga-ui-core-directives-mode.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-scroll-into-view.umd.js +1 -1
- package/bundles/taiga-ui-core-directives-scroll-into-view.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.js +34 -34
- package/bundles/taiga-ui-core-directives-textfield-controller.umd.js.map +1 -1
- package/bundles/taiga-ui-core-directives-wrapper.umd.js +9 -9
- package/bundles/taiga-ui-core-directives-wrapper.umd.js.map +1 -1
- package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.js +3 -3
- package/bundles/taiga-ui-core-internal-primitive-year-month-pagination.umd.js.map +1 -1
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js +3 -3
- package/bundles/taiga-ui-core-internal-svg-defs-host.umd.js.map +1 -1
- package/components/calendar/calendar.component.d.ts +4 -2
- package/components/expand/expand.component.d.ts +1 -1
- package/directives/dropdown/dropdown-context.directive.d.ts +4 -4
- package/directives/dropdown/dropdown-options.directive.d.ts +3 -5
- package/directives/dropdown/dropdown-position-sided.directive.d.ts +2 -1
- package/directives/dropdown/dropdown.directive.d.ts +1 -1
- package/esm2015/components/alert/alert.component.js +12 -12
- package/esm2015/components/button/button.component.js +17 -17
- package/esm2015/components/calendar/calendar.component.js +21 -12
- package/esm2015/components/data-list/data-list.component.js +17 -17
- package/esm2015/components/data-list/data-list.directive.js +2 -2
- package/esm2015/components/data-list/opt-group.directive.js +5 -5
- package/esm2015/components/data-list/option/option.component.js +14 -17
- package/esm2015/components/dialog/dialog.component.js +14 -14
- package/esm2015/components/dialog/dialog.directive.js +4 -4
- package/esm2015/components/error/error.component.js +6 -6
- package/esm2015/components/expand/expand-content.directive.js +2 -2
- package/esm2015/components/expand/expand.component.js +17 -19
- package/esm2015/components/group/group-styles.component.js +4 -4
- package/esm2015/components/group/group.directive.js +15 -15
- package/esm2015/components/hints-host/hints-host.component.js +5 -5
- package/esm2015/components/hosted-dropdown/hosted-dropdown-connector.directive.js +2 -2
- package/esm2015/components/hosted-dropdown/hosted-dropdown.component.js +13 -13
- package/esm2015/components/label/label.component.js +7 -7
- package/esm2015/components/link/link.component.js +15 -15
- package/esm2015/components/loader/loader.component.js +6 -6
- package/esm2015/components/notification/notification.component.js +11 -11
- package/esm2015/components/primitive-calendar/primitive-calendar.component.js +6 -6
- package/esm2015/components/primitive-checkbox/primitive-checkbox.component.js +6 -6
- package/esm2015/components/primitive-spin-button/primitive-spin-button.component.js +6 -6
- package/esm2015/components/primitive-textfield/primitive-textfield.component.js +32 -32
- package/esm2015/components/primitive-textfield/primitive-textfield.directive.js +2 -2
- package/esm2015/components/primitive-textfield/textfield/textfield.component.js +13 -13
- package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +15 -15
- package/esm2015/components/primitive-year-picker/primitive-year-picker.component.js +5 -5
- package/esm2015/components/root/root.component.js +8 -8
- package/esm2015/components/scroll-controls/scroll-controls.component.js +6 -6
- package/esm2015/components/scroll-controls/scrollbar-wrapper.directive.js +2 -2
- package/esm2015/components/scroll-controls/scrollbar.directive.js +23 -23
- package/esm2015/components/scrollbar/scroll-ref.directive.js +2 -2
- package/esm2015/components/scrollbar/scrollable.directive.js +2 -2
- package/esm2015/components/scrollbar/scrollbar.component.js +9 -9
- package/esm2015/components/svg/svg.component.js +19 -19
- package/esm2015/components/theme-night/theme-night.component.js +5 -5
- package/esm2015/components/tooltip/tooltip.component.js +10 -10
- package/esm2015/directives/dropdown/dropdown-context.directive.js +16 -16
- package/esm2015/directives/dropdown/dropdown-driver.directive.js +2 -2
- package/esm2015/directives/dropdown/dropdown-host.directive.js +2 -2
- package/esm2015/directives/dropdown/dropdown-hover.directive.js +4 -4
- package/esm2015/directives/dropdown/dropdown-manual.directive.js +2 -2
- package/esm2015/directives/dropdown/dropdown-options.directive.js +19 -15
- package/esm2015/directives/dropdown/dropdown-position-sided.directive.js +17 -14
- package/esm2015/directives/dropdown/dropdown-position.directive.js +12 -14
- package/esm2015/directives/dropdown/dropdown-selection.directive.js +11 -11
- package/esm2015/directives/dropdown/dropdown.component.js +18 -20
- package/esm2015/directives/dropdown/dropdown.directive.js +7 -7
- package/esm2015/directives/hint/hint-describe.directive.js +5 -5
- package/esm2015/directives/hint/hint-driver.directive.js +2 -2
- package/esm2015/directives/hint/hint-host.directive.js +2 -2
- package/esm2015/directives/hint/hint-hover.directive.js +5 -5
- package/esm2015/directives/hint/hint-manual.directive.js +2 -2
- package/esm2015/directives/hint/hint-options.directive.js +12 -12
- package/esm2015/directives/hint/hint-pointer.directive.js +3 -3
- package/esm2015/directives/hint/hint-position.directive.js +25 -25
- package/esm2015/directives/hint/hint.component.js +10 -10
- package/esm2015/directives/hint/hint.directive.js +5 -5
- package/esm2015/directives/mask-accessor/mask-accessor.directive.js +2 -2
- package/esm2015/directives/mode/mode.directive.js +3 -3
- package/esm2015/directives/scroll-into-view/scroll-into-view.directive.js +2 -2
- package/esm2015/directives/textfield-controller/textfield-cleaner.directive.js +4 -4
- package/esm2015/directives/textfield-controller/textfield-custom-content.directive.js +5 -5
- package/esm2015/directives/textfield-controller/textfield-filler.directive.js +5 -5
- package/esm2015/directives/textfield-controller/textfield-icon-left.directive.js +5 -5
- package/esm2015/directives/textfield-controller/textfield-icon.directive.js +5 -5
- package/esm2015/directives/textfield-controller/textfield-label-outside.directive.js +4 -4
- package/esm2015/directives/textfield-controller/textfield-postfix.directive.js +5 -5
- package/esm2015/directives/textfield-controller/textfield-prefix.directive.js +5 -5
- package/esm2015/directives/textfield-controller/textfield-size.directive.js +5 -5
- package/esm2015/directives/wrapper/wrapper.directive.js +10 -10
- package/esm2015/internal/primitive-year-month-pagination/primitive-year-month-pagination.component.js +4 -4
- package/esm2015/internal/svg-defs-host/svg-defs-host.component.js +4 -4
- package/fesm2015/taiga-ui-core-components-alert.js +11 -11
- package/fesm2015/taiga-ui-core-components-alert.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-button.js +16 -16
- package/fesm2015/taiga-ui-core-components-button.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-calendar.js +20 -11
- package/fesm2015/taiga-ui-core-components-calendar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-data-list.js +34 -37
- package/fesm2015/taiga-ui-core-components-data-list.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dialog.js +16 -16
- package/fesm2015/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-error.js +5 -5
- package/fesm2015/taiga-ui-core-components-error.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js +17 -19
- package/fesm2015/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-group.js +17 -17
- package/fesm2015/taiga-ui-core-components-group.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hints-host.js +4 -4
- package/fesm2015/taiga-ui-core-components-hints-host.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js +13 -13
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-label.js +6 -6
- package/fesm2015/taiga-ui-core-components-label.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-link.js +14 -14
- package/fesm2015/taiga-ui-core-components-link.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-loader.js +5 -5
- package/fesm2015/taiga-ui-core-components-loader.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-notification.js +10 -10
- package/fesm2015/taiga-ui-core-components-notification.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-calendar.js +5 -5
- package/fesm2015/taiga-ui-core-components-primitive-calendar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js +5 -5
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-spin-button.js +5 -5
- package/fesm2015/taiga-ui-core-components-primitive-spin-button.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js +59 -59
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-year-picker.js +4 -4
- package/fesm2015/taiga-ui-core-components-primitive-year-picker.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-root.js +7 -7
- package/fesm2015/taiga-ui-core-components-root.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-scroll-controls.js +28 -28
- package/fesm2015/taiga-ui-core-components-scroll-controls.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-scrollbar.js +10 -10
- package/fesm2015/taiga-ui-core-components-scrollbar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-svg.js +18 -18
- package/fesm2015/taiga-ui-core-components-svg.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-theme-night.js +4 -4
- package/fesm2015/taiga-ui-core-components-theme-night.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-tooltip.js +9 -9
- package/fesm2015/taiga-ui-core-components-tooltip.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-dropdown.js +96 -92
- package/fesm2015/taiga-ui-core-directives-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-hint.js +61 -61
- package/fesm2015/taiga-ui-core-directives-hint.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-mask-accessor.js +1 -1
- package/fesm2015/taiga-ui-core-directives-mask-accessor.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-mode.js +2 -2
- package/fesm2015/taiga-ui-core-directives-mode.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-scroll-into-view.js +1 -1
- package/fesm2015/taiga-ui-core-directives-scroll-into-view.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-textfield-controller.js +34 -34
- package/fesm2015/taiga-ui-core-directives-textfield-controller.js.map +1 -1
- package/fesm2015/taiga-ui-core-directives-wrapper.js +9 -9
- package/fesm2015/taiga-ui-core-directives-wrapper.js.map +1 -1
- package/fesm2015/taiga-ui-core-internal-primitive-year-month-pagination.js +3 -3
- package/fesm2015/taiga-ui-core-internal-primitive-year-month-pagination.js.map +1 -1
- package/fesm2015/taiga-ui-core-internal-svg-defs-host.js +3 -3
- package/fesm2015/taiga-ui-core-internal-svg-defs-host.js.map +1 -1
- package/package.json +6 -6
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { InjectionToken, ElementRef, INJECTOR, Directive, Inject, Input, Optional, SkipSelf, forwardRef, Component, ChangeDetectionStrategy, Self, HostBinding, HostListener, ViewContainerRef, NgModule } from '@angular/core';
|
|
3
3
|
import { WINDOW } from '@ng-web-apis/common';
|
|
4
4
|
import * as i2 from '@taiga-ui/cdk';
|
|
5
|
-
import { TuiDropdownPortalService, tuiDefaultProp, tuiPure, TuiHoveredService, tuiPx, tuiGetClosestFocusable, TuiDestroyService, AbstractTuiPortalHostComponent, EMPTY_CLIENT_RECT, tuiPointToClientRect, 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';
|
|
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
7
|
import { tuiAsRectAccessor, tuiAsVehicle, TuiDriver, tuiAsDriver, TuiRectAccessor, AbstractTuiDriverDirective, tuiAsPositionAccessor } from '@taiga-ui/core/abstract';
|
|
8
8
|
import { tuiDropdownAnimation } from '@taiga-ui/core/animations';
|
|
@@ -30,13 +30,13 @@ class TuiDropdownDirective {
|
|
|
30
30
|
this.elementRef = elementRef;
|
|
31
31
|
this.component = component;
|
|
32
32
|
this.dropdownService = dropdownService;
|
|
33
|
-
this.content =
|
|
33
|
+
this.content = '';
|
|
34
34
|
this.dropdownBoxRef = null;
|
|
35
35
|
}
|
|
36
36
|
get position() {
|
|
37
37
|
return tuiCheckFixedPosition(this.elementRef.nativeElement)
|
|
38
|
-
?
|
|
39
|
-
:
|
|
38
|
+
? 'fixed'
|
|
39
|
+
: 'absolute';
|
|
40
40
|
}
|
|
41
41
|
ngAfterViewChecked() {
|
|
42
42
|
var _a, _b;
|
|
@@ -83,8 +83,8 @@ __decorate([
|
|
|
83
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownDirective, decorators: [{
|
|
84
84
|
type: Directive,
|
|
85
85
|
args: [{
|
|
86
|
-
selector:
|
|
87
|
-
exportAs:
|
|
86
|
+
selector: '[tuiDropdown]:not(ng-container)',
|
|
87
|
+
exportAs: 'tuiDropdown',
|
|
88
88
|
providers: [
|
|
89
89
|
tuiAsRectAccessor(TuiDropdownDirective),
|
|
90
90
|
tuiAsVehicle(TuiDropdownDirective),
|
|
@@ -106,7 +106,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
106
106
|
args: [TuiDropdownPortalService]
|
|
107
107
|
}] }]; }, propDecorators: { content: [{
|
|
108
108
|
type: Input,
|
|
109
|
-
args: [
|
|
109
|
+
args: ['tuiDropdown']
|
|
110
110
|
}], position: [] } });
|
|
111
111
|
|
|
112
112
|
class TuiDropdownHoverDirective extends TuiDriver {
|
|
@@ -133,7 +133,7 @@ __decorate([
|
|
|
133
133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownHoverDirective, decorators: [{
|
|
134
134
|
type: Directive,
|
|
135
135
|
args: [{
|
|
136
|
-
selector:
|
|
136
|
+
selector: '[tuiDropdownHover]:not(ng-container)',
|
|
137
137
|
providers: [tuiAsDriver(TuiDropdownHoverDirective), TuiHoveredService],
|
|
138
138
|
}]
|
|
139
139
|
}], ctorParameters: function () { return [{ type: i5.Observable, decorators: [{
|
|
@@ -141,25 +141,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
141
141
|
args: [TuiHoveredService]
|
|
142
142
|
}] }]; }, propDecorators: { showDelay: [{
|
|
143
143
|
type: Input,
|
|
144
|
-
args: [
|
|
144
|
+
args: ['tuiDropdownShowDelay']
|
|
145
145
|
}], hideDelay: [{
|
|
146
146
|
type: Input,
|
|
147
|
-
args: [
|
|
147
|
+
args: ['tuiDropdownHideDelay']
|
|
148
148
|
}] } });
|
|
149
149
|
|
|
150
|
-
/**
|
|
151
|
-
* Safe space around host and screen edges
|
|
152
|
-
*/
|
|
153
|
-
const TUI_DROPDOWN_OFFSET = 4;
|
|
154
150
|
/** Default values for dropdown options */
|
|
155
151
|
const TUI_DROPDOWN_DEFAULT_OPTIONS = {
|
|
156
|
-
align:
|
|
152
|
+
align: 'left',
|
|
157
153
|
direction: null,
|
|
158
|
-
limitWidth:
|
|
154
|
+
limitWidth: 'auto',
|
|
159
155
|
maxHeight: 400,
|
|
160
156
|
minHeight: 80,
|
|
157
|
+
offset: 4,
|
|
161
158
|
};
|
|
162
|
-
const TUI_DROPDOWN_OPTIONS = new InjectionToken(
|
|
159
|
+
const TUI_DROPDOWN_OPTIONS = new InjectionToken('[TUI_DROPDOWN_OPTIONS] Default parameters for dropdown directive', {
|
|
163
160
|
factory: () => TUI_DROPDOWN_DEFAULT_OPTIONS,
|
|
164
161
|
});
|
|
165
162
|
const tuiDropdownOptionsProvider = (override) => ({
|
|
@@ -178,10 +175,11 @@ class TuiDropdownOptionsDirective {
|
|
|
178
175
|
this.limitWidth = this.options.limitWidth;
|
|
179
176
|
this.minHeight = this.options.minHeight;
|
|
180
177
|
this.maxHeight = this.options.maxHeight;
|
|
178
|
+
this.offset = this.options.offset;
|
|
181
179
|
}
|
|
182
180
|
}
|
|
183
181
|
TuiDropdownOptionsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownOptionsDirective, deps: [{ token: TUI_DROPDOWN_OPTIONS, skipSelf: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
184
|
-
TuiDropdownOptionsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiDropdownOptionsDirective, selector: "[tuiDropdownAlign], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight]", inputs: { align: ["tuiDropdownAlign", "align"], direction: ["tuiDropdownDirection", "direction"], limitWidth: ["tuiDropdownLimitWidth", "limitWidth"], minHeight: ["tuiDropdownMinHeight", "minHeight"], maxHeight: ["tuiDropdownMaxHeight", "maxHeight"] }, providers: [
|
|
182
|
+
TuiDropdownOptionsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiDropdownOptionsDirective, selector: "[tuiDropdownAlign], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]", inputs: { align: ["tuiDropdownAlign", "align"], direction: ["tuiDropdownDirection", "direction"], limitWidth: ["tuiDropdownLimitWidth", "limitWidth"], minHeight: ["tuiDropdownMinHeight", "minHeight"], maxHeight: ["tuiDropdownMaxHeight", "maxHeight"], offset: ["tuiDropdownOffset", "offset"] }, providers: [
|
|
185
183
|
{
|
|
186
184
|
provide: TUI_DROPDOWN_OPTIONS,
|
|
187
185
|
useExisting: forwardRef(() => TuiDropdownOptionsDirective),
|
|
@@ -202,10 +200,13 @@ __decorate([
|
|
|
202
200
|
__decorate([
|
|
203
201
|
tuiDefaultProp()
|
|
204
202
|
], TuiDropdownOptionsDirective.prototype, "maxHeight", void 0);
|
|
203
|
+
__decorate([
|
|
204
|
+
tuiDefaultProp()
|
|
205
|
+
], TuiDropdownOptionsDirective.prototype, "offset", void 0);
|
|
205
206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownOptionsDirective, decorators: [{
|
|
206
207
|
type: Directive,
|
|
207
208
|
args: [{
|
|
208
|
-
selector:
|
|
209
|
+
selector: '[tuiDropdownAlign], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]',
|
|
209
210
|
providers: [
|
|
210
211
|
{
|
|
211
212
|
provide: TUI_DROPDOWN_OPTIONS,
|
|
@@ -220,19 +221,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
220
221
|
args: [TUI_DROPDOWN_OPTIONS]
|
|
221
222
|
}] }]; }, propDecorators: { align: [{
|
|
222
223
|
type: Input,
|
|
223
|
-
args: [
|
|
224
|
+
args: ['tuiDropdownAlign']
|
|
224
225
|
}], direction: [{
|
|
225
226
|
type: Input,
|
|
226
|
-
args: [
|
|
227
|
+
args: ['tuiDropdownDirection']
|
|
227
228
|
}], limitWidth: [{
|
|
228
229
|
type: Input,
|
|
229
|
-
args: [
|
|
230
|
+
args: ['tuiDropdownLimitWidth']
|
|
230
231
|
}], minHeight: [{
|
|
231
232
|
type: Input,
|
|
232
|
-
args: [
|
|
233
|
+
args: ['tuiDropdownMinHeight']
|
|
233
234
|
}], maxHeight: [{
|
|
234
235
|
type: Input,
|
|
235
|
-
args: [
|
|
236
|
+
args: ['tuiDropdownMaxHeight']
|
|
237
|
+
}], offset: [{
|
|
238
|
+
type: Input,
|
|
239
|
+
args: ['tuiDropdownOffset']
|
|
236
240
|
}] } });
|
|
237
241
|
|
|
238
242
|
/**
|
|
@@ -268,37 +272,35 @@ class TuiDropdownComponent {
|
|
|
268
272
|
update(top, left) {
|
|
269
273
|
const { style } = this.elementRef.nativeElement;
|
|
270
274
|
const { right } = this.elementRef.nativeElement.getBoundingClientRect();
|
|
271
|
-
const { limitWidth, maxHeight } = this.options;
|
|
275
|
+
const { limitWidth, maxHeight, offset } = this.options;
|
|
272
276
|
const { innerHeight } = this.windowRef;
|
|
273
277
|
const { clientRect } = this.host;
|
|
274
278
|
const { position } = this.directive;
|
|
275
279
|
const rect = this.accessor.getClientRect();
|
|
276
|
-
const offsetX = position ===
|
|
277
|
-
const offsetY = position ===
|
|
280
|
+
const offsetX = position === 'fixed' ? 0 : -clientRect.left;
|
|
281
|
+
const offsetY = position === 'fixed' ? 0 : -clientRect.top;
|
|
278
282
|
top += offsetY;
|
|
279
283
|
left += offsetX;
|
|
280
|
-
const isIntersecting = left < rect.right &&
|
|
281
|
-
right > rect.left &&
|
|
282
|
-
top < offsetY + 2 * TUI_DROPDOWN_OFFSET;
|
|
284
|
+
const isIntersecting = left < rect.right && right > rect.left && top < offsetY + 2 * offset;
|
|
283
285
|
const available = isIntersecting
|
|
284
|
-
? rect.top - 2 *
|
|
285
|
-
: offsetY + innerHeight - top -
|
|
286
|
+
? rect.top - 2 * offset
|
|
287
|
+
: offsetY + innerHeight - top - offset;
|
|
286
288
|
style.position = position;
|
|
287
|
-
style.top = tuiPx(Math.max(top, offsetY +
|
|
289
|
+
style.top = tuiPx(Math.max(top, offsetY + offset));
|
|
288
290
|
style.left = tuiPx(left);
|
|
289
291
|
style.maxHeight = tuiPx(Math.min(maxHeight, available));
|
|
290
|
-
style.width =
|
|
291
|
-
style.minWidth =
|
|
292
|
+
style.width = '';
|
|
293
|
+
style.minWidth = '';
|
|
292
294
|
switch (limitWidth) {
|
|
293
|
-
case
|
|
295
|
+
case 'min':
|
|
294
296
|
style.minWidth = tuiPx(rect.width);
|
|
295
297
|
break;
|
|
296
|
-
case
|
|
298
|
+
case 'fixed':
|
|
297
299
|
style.width = tuiPx(rect.width);
|
|
298
300
|
}
|
|
299
301
|
}
|
|
300
302
|
moveFocusOutside(previous) {
|
|
301
|
-
const host = document.createElement(
|
|
303
|
+
const host = document.createElement('div');
|
|
302
304
|
const { ownerDocument } = host;
|
|
303
305
|
const root = ownerDocument ? ownerDocument.body : host;
|
|
304
306
|
let focusable = tuiGetClosestFocusable({ initial: host, root, previous });
|
|
@@ -313,9 +315,9 @@ TuiDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
|
|
|
313
315
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownComponent, decorators: [{
|
|
314
316
|
type: Component,
|
|
315
317
|
args: [{
|
|
316
|
-
selector:
|
|
317
|
-
templateUrl:
|
|
318
|
-
styleUrls: [
|
|
318
|
+
selector: 'tui-dropdown',
|
|
319
|
+
templateUrl: './dropdown.template.html',
|
|
320
|
+
styleUrls: ['./dropdown.style.less'],
|
|
319
321
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
320
322
|
providers: [TuiDestroyService, TuiPositionService],
|
|
321
323
|
animations: [tuiDropdownAnimation],
|
|
@@ -356,13 +358,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
356
358
|
args: [TuiDropdownHoverDirective]
|
|
357
359
|
}] }]; }, propDecorators: { dropdownAnimation: [{
|
|
358
360
|
type: HostBinding,
|
|
359
|
-
args: [
|
|
361
|
+
args: ['@tuiDropdownAnimation']
|
|
360
362
|
}] } });
|
|
361
363
|
|
|
362
364
|
class TuiDropdownContextDirective extends TuiDriver {
|
|
363
|
-
constructor(
|
|
365
|
+
constructor(activeZone) {
|
|
364
366
|
super(subscriber => this.stream$.subscribe(subscriber));
|
|
365
|
-
this.
|
|
367
|
+
this.activeZone = activeZone;
|
|
366
368
|
this.stream$ = new Subject();
|
|
367
369
|
this.currentRect = EMPTY_CLIENT_RECT;
|
|
368
370
|
}
|
|
@@ -371,8 +373,7 @@ class TuiDropdownContextDirective extends TuiDriver {
|
|
|
371
373
|
this.stream$.next(true);
|
|
372
374
|
}
|
|
373
375
|
closeDropdown(target) {
|
|
374
|
-
|
|
375
|
-
if (!((_a = this.dropdown.dropdownBoxRef) === null || _a === void 0 ? void 0 : _a.location.nativeElement.contains(target))) {
|
|
376
|
+
if (!this.activeZone.contains(target)) {
|
|
376
377
|
this.stream$.next(false);
|
|
377
378
|
}
|
|
378
379
|
}
|
|
@@ -380,35 +381,37 @@ class TuiDropdownContextDirective extends TuiDriver {
|
|
|
380
381
|
return this.currentRect;
|
|
381
382
|
}
|
|
382
383
|
}
|
|
383
|
-
TuiDropdownContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownContextDirective, deps: [{ token:
|
|
384
|
+
TuiDropdownContextDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownContextDirective, deps: [{ token: TuiActiveZoneDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
384
385
|
TuiDropdownContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiDropdownContextDirective, selector: "[tuiDropdown][tuiDropdownContext]", host: { listeners: { "contextmenu.prevent.stop": "onContextMenu($event.clientX,$event.clientY)", "document:click.silent": "closeDropdown($event.target)", "document:contextmenu.capture.silent": "closeDropdown($event.target)", "document:keydown.esc": "closeDropdown($event.currentTarget)" } }, providers: [
|
|
386
|
+
TuiActiveZoneDirective,
|
|
385
387
|
tuiAsDriver(TuiDropdownContextDirective),
|
|
386
388
|
tuiAsRectAccessor(TuiDropdownContextDirective),
|
|
387
389
|
], usesInheritance: true, ngImport: i0 });
|
|
388
390
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownContextDirective, decorators: [{
|
|
389
391
|
type: Directive,
|
|
390
392
|
args: [{
|
|
391
|
-
selector:
|
|
393
|
+
selector: '[tuiDropdown][tuiDropdownContext]',
|
|
392
394
|
providers: [
|
|
395
|
+
TuiActiveZoneDirective,
|
|
393
396
|
tuiAsDriver(TuiDropdownContextDirective),
|
|
394
397
|
tuiAsRectAccessor(TuiDropdownContextDirective),
|
|
395
398
|
],
|
|
396
399
|
}]
|
|
397
|
-
}], ctorParameters: function () { return [{ type:
|
|
400
|
+
}], ctorParameters: function () { return [{ type: i2.TuiActiveZoneDirective, decorators: [{
|
|
398
401
|
type: Inject,
|
|
399
|
-
args: [
|
|
402
|
+
args: [TuiActiveZoneDirective]
|
|
400
403
|
}] }]; }, propDecorators: { onContextMenu: [{
|
|
401
404
|
type: HostListener,
|
|
402
|
-
args: [
|
|
405
|
+
args: ['contextmenu.prevent.stop', ['$event.clientX', '$event.clientY']]
|
|
403
406
|
}], closeDropdown: [{
|
|
404
407
|
type: HostListener,
|
|
405
|
-
args: [
|
|
408
|
+
args: ['document:click.silent', ['$event.target']]
|
|
406
409
|
}, {
|
|
407
410
|
type: HostListener,
|
|
408
|
-
args: [
|
|
411
|
+
args: ['document:contextmenu.capture.silent', ['$event.target']]
|
|
409
412
|
}, {
|
|
410
413
|
type: HostListener,
|
|
411
|
-
args: [
|
|
414
|
+
args: ['document:keydown.esc', ['$event.currentTarget']]
|
|
412
415
|
}] } });
|
|
413
416
|
|
|
414
417
|
class TuiDropdownDriverDirective extends AbstractTuiDriverDirective {
|
|
@@ -418,7 +421,7 @@ TuiDropdownDriverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0
|
|
|
418
421
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownDriverDirective, decorators: [{
|
|
419
422
|
type: Directive,
|
|
420
423
|
args: [{
|
|
421
|
-
selector:
|
|
424
|
+
selector: '[tuiDropdown]',
|
|
422
425
|
providers: [TuiDestroyService],
|
|
423
426
|
}]
|
|
424
427
|
}] });
|
|
@@ -434,7 +437,7 @@ TuiDropdownHostDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0
|
|
|
434
437
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownHostDirective, decorators: [{
|
|
435
438
|
type: Directive,
|
|
436
439
|
args: [{
|
|
437
|
-
selector:
|
|
440
|
+
selector: '[tuiDropdown][tuiDropdownHost]',
|
|
438
441
|
providers: [tuiAsRectAccessor(TuiDropdownHostDirective)],
|
|
439
442
|
}]
|
|
440
443
|
}], propDecorators: { tuiDropdownHost: [{
|
|
@@ -456,7 +459,7 @@ TuiDropdownManualDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0
|
|
|
456
459
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownManualDirective, decorators: [{
|
|
457
460
|
type: Directive,
|
|
458
461
|
args: [{
|
|
459
|
-
selector:
|
|
462
|
+
selector: '[tuiDropdown][tuiDropdownManual]',
|
|
460
463
|
providers: [tuiAsDriver(TuiDropdownManualDirective)],
|
|
461
464
|
}]
|
|
462
465
|
}], ctorParameters: function () { return []; }, propDecorators: { tuiDropdownManual: [{
|
|
@@ -472,22 +475,20 @@ class TuiDropdownPositionDirective {
|
|
|
472
475
|
getPosition({ width, height }) {
|
|
473
476
|
const hostRect = this.accessor.getClientRect();
|
|
474
477
|
const { innerHeight, innerWidth } = this.windowRef;
|
|
475
|
-
const { minHeight, align, direction } = this.options;
|
|
476
|
-
const previous = this.previous || direction ||
|
|
477
|
-
const right = Math.max(hostRect.right - width,
|
|
478
|
+
const { minHeight, align, direction, offset } = this.options;
|
|
479
|
+
const previous = this.previous || direction || 'bottom';
|
|
480
|
+
const right = Math.max(hostRect.right - width, offset);
|
|
478
481
|
const available = {
|
|
479
|
-
top: hostRect.top - 2 *
|
|
480
|
-
bottom: innerHeight - hostRect.bottom - 2 *
|
|
482
|
+
top: hostRect.top - 2 * offset,
|
|
483
|
+
bottom: innerHeight - hostRect.bottom - 2 * offset,
|
|
481
484
|
};
|
|
482
485
|
const position = {
|
|
483
|
-
top: hostRect.top -
|
|
484
|
-
bottom: hostRect.bottom +
|
|
486
|
+
top: hostRect.top - offset - height,
|
|
487
|
+
bottom: hostRect.bottom + offset,
|
|
485
488
|
right,
|
|
486
|
-
left: hostRect.left + width < innerWidth -
|
|
487
|
-
? hostRect.left
|
|
488
|
-
: right,
|
|
489
|
+
left: hostRect.left + width < innerWidth - offset ? hostRect.left : right,
|
|
489
490
|
};
|
|
490
|
-
const better = available.top > available.bottom ?
|
|
491
|
+
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
491
492
|
if ((available[previous] > minHeight && direction) ||
|
|
492
493
|
available[previous] > height) {
|
|
493
494
|
return [position[previous], position[align]];
|
|
@@ -501,7 +502,7 @@ TuiDropdownPositionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12
|
|
|
501
502
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownPositionDirective, decorators: [{
|
|
502
503
|
type: Directive,
|
|
503
504
|
args: [{
|
|
504
|
-
selector:
|
|
505
|
+
selector: '[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])',
|
|
505
506
|
providers: [tuiAsPositionAccessor(TuiDropdownPositionDirective)],
|
|
506
507
|
}]
|
|
507
508
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -521,8 +522,9 @@ class TuiDropdownPositionSidedDirective {
|
|
|
521
522
|
this.windowRef = windowRef;
|
|
522
523
|
this.accessor = accessor;
|
|
523
524
|
this.vertical = vertical;
|
|
524
|
-
this.previous = this.options.direction ||
|
|
525
|
-
this.tuiDropdownSided =
|
|
525
|
+
this.previous = this.options.direction || 'bottom';
|
|
526
|
+
this.tuiDropdownSided = '';
|
|
527
|
+
this.tuiDropdownSidedOffset = 4;
|
|
526
528
|
}
|
|
527
529
|
getPosition(rect) {
|
|
528
530
|
if (this.tuiDropdownSided === false) {
|
|
@@ -531,20 +533,20 @@ class TuiDropdownPositionSidedDirective {
|
|
|
531
533
|
const { height, width } = rect;
|
|
532
534
|
const hostRect = this.accessor.getClientRect();
|
|
533
535
|
const { innerHeight, innerWidth } = this.windowRef;
|
|
534
|
-
const { align, direction, minHeight } = this.options;
|
|
536
|
+
const { align, direction, minHeight, offset } = this.options;
|
|
535
537
|
const available = {
|
|
536
538
|
top: hostRect.bottom,
|
|
537
|
-
left: hostRect.left -
|
|
538
|
-
right: innerWidth - hostRect.right -
|
|
539
|
+
left: hostRect.left - offset,
|
|
540
|
+
right: innerWidth - hostRect.right - offset,
|
|
539
541
|
bottom: innerHeight - hostRect.top,
|
|
540
542
|
};
|
|
541
543
|
const position = {
|
|
542
|
-
top: hostRect.bottom - height +
|
|
543
|
-
left: hostRect.left - width -
|
|
544
|
-
right: hostRect.right +
|
|
545
|
-
bottom: hostRect.top -
|
|
544
|
+
top: hostRect.bottom - height + this.tuiDropdownSidedOffset + 1,
|
|
545
|
+
left: hostRect.left - width - offset,
|
|
546
|
+
right: hostRect.right + offset,
|
|
547
|
+
bottom: hostRect.top - this.tuiDropdownSidedOffset - 1, // 1 for border
|
|
546
548
|
};
|
|
547
|
-
const better = available.top > available.bottom ?
|
|
549
|
+
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
548
550
|
const maxLeft = available.left > available.right ? position.left : position.right;
|
|
549
551
|
const left = available[align] > width ? position[align] : maxLeft;
|
|
550
552
|
if ((available[this.previous] > minHeight && direction) ||
|
|
@@ -556,14 +558,14 @@ class TuiDropdownPositionSidedDirective {
|
|
|
556
558
|
}
|
|
557
559
|
}
|
|
558
560
|
TuiDropdownPositionSidedDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownPositionSidedDirective, deps: [{ token: TUI_DROPDOWN_OPTIONS }, { token: WINDOW }, { token: TuiRectAccessor }, { token: TuiDropdownPositionDirective }], target: i0.ɵɵFactoryTarget.Directive });
|
|
559
|
-
TuiDropdownPositionSidedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiDropdownPositionSidedDirective, selector: "[tuiDropdownSided]", inputs: { tuiDropdownSided: "tuiDropdownSided" }, providers: [
|
|
561
|
+
TuiDropdownPositionSidedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.16", type: TuiDropdownPositionSidedDirective, selector: "[tuiDropdownSided]", inputs: { tuiDropdownSided: "tuiDropdownSided", tuiDropdownSidedOffset: "tuiDropdownSidedOffset" }, providers: [
|
|
560
562
|
TuiDropdownPositionDirective,
|
|
561
563
|
tuiAsPositionAccessor(TuiDropdownPositionSidedDirective),
|
|
562
564
|
], ngImport: i0 });
|
|
563
565
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownPositionSidedDirective, decorators: [{
|
|
564
566
|
type: Directive,
|
|
565
567
|
args: [{
|
|
566
|
-
selector:
|
|
568
|
+
selector: '[tuiDropdownSided]',
|
|
567
569
|
providers: [
|
|
568
570
|
TuiDropdownPositionDirective,
|
|
569
571
|
tuiAsPositionAccessor(TuiDropdownPositionSidedDirective),
|
|
@@ -583,6 +585,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
583
585
|
args: [TuiDropdownPositionDirective]
|
|
584
586
|
}] }]; }, propDecorators: { tuiDropdownSided: [{
|
|
585
587
|
type: Input
|
|
588
|
+
}], tuiDropdownSidedOffset: [{
|
|
589
|
+
type: Input
|
|
586
590
|
}] } });
|
|
587
591
|
|
|
588
592
|
class TuiDropdownSelectionDirective extends TuiDriver {
|
|
@@ -606,7 +610,7 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
606
610
|
: this.range;
|
|
607
611
|
return (contained && handler(this.range)) || this.inDropdown(range);
|
|
608
612
|
}));
|
|
609
|
-
this.position =
|
|
613
|
+
this.position = 'selection';
|
|
610
614
|
}
|
|
611
615
|
set tuiDropdownSelection(visible) {
|
|
612
616
|
if (!tuiIsString(visible)) {
|
|
@@ -615,7 +619,7 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
615
619
|
}
|
|
616
620
|
getClientRect() {
|
|
617
621
|
switch (this.position) {
|
|
618
|
-
case
|
|
622
|
+
case 'tag': {
|
|
619
623
|
const { commonAncestorContainer } = this.range;
|
|
620
624
|
const element = tuiIsElement(commonAncestorContainer)
|
|
621
625
|
? commonAncestorContainer
|
|
@@ -624,7 +628,7 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
624
628
|
? element.getBoundingClientRect()
|
|
625
629
|
: EMPTY_CLIENT_RECT;
|
|
626
630
|
}
|
|
627
|
-
case
|
|
631
|
+
case 'word':
|
|
628
632
|
return tuiGetWordRange(this.range).getBoundingClientRect();
|
|
629
633
|
default:
|
|
630
634
|
return this.range.getBoundingClientRect();
|
|
@@ -681,13 +685,13 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
681
685
|
* Create an invisible DIV styled exactly like input/textarea element inside directive
|
|
682
686
|
*/
|
|
683
687
|
initGhost(element) {
|
|
684
|
-
const ghost = this.documentRef.createElement(
|
|
688
|
+
const ghost = this.documentRef.createElement('div');
|
|
685
689
|
const { nativeElement } = this.viewContainerRef.element;
|
|
686
690
|
const { font, letterSpacing, textTransform, padding } = getComputedStyle(element);
|
|
687
|
-
ghost.style.position =
|
|
688
|
-
ghost.style.pointerEvents =
|
|
689
|
-
ghost.style.opacity =
|
|
690
|
-
ghost.style.whiteSpace =
|
|
691
|
+
ghost.style.position = 'absolute';
|
|
692
|
+
ghost.style.pointerEvents = 'none';
|
|
693
|
+
ghost.style.opacity = '0';
|
|
694
|
+
ghost.style.whiteSpace = 'pre-wrap';
|
|
691
695
|
ghost.style.font = font;
|
|
692
696
|
ghost.style.letterSpacing = letterSpacing;
|
|
693
697
|
ghost.style.textTransform = textTransform;
|
|
@@ -708,7 +712,7 @@ __decorate([
|
|
|
708
712
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownSelectionDirective, decorators: [{
|
|
709
713
|
type: Directive,
|
|
710
714
|
args: [{
|
|
711
|
-
selector:
|
|
715
|
+
selector: '[tuiDropdown][tuiDropdownSelection]',
|
|
712
716
|
providers: [
|
|
713
717
|
tuiAsDriver(TuiDropdownSelectionDirective),
|
|
714
718
|
tuiAsRectAccessor(TuiDropdownSelectionDirective),
|
|
@@ -734,7 +738,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
734
738
|
args: [TuiDropdownDirective]
|
|
735
739
|
}] }]; }, propDecorators: { position: [{
|
|
736
740
|
type: Input,
|
|
737
|
-
args: [
|
|
741
|
+
args: ['tuiDropdownSelectionPosition']
|
|
738
742
|
}], tuiDropdownSelection: [{
|
|
739
743
|
type: Input
|
|
740
744
|
}] } });
|
|
@@ -820,5 +824,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
820
824
|
* Generated bundle index. Do not edit.
|
|
821
825
|
*/
|
|
822
826
|
|
|
823
|
-
export { TUI_DROPDOWN_COMPONENT, TUI_DROPDOWN_DEFAULT_OPTIONS,
|
|
827
|
+
export { TUI_DROPDOWN_COMPONENT, TUI_DROPDOWN_DEFAULT_OPTIONS, TUI_DROPDOWN_OPTIONS, TuiDropdownComponent, TuiDropdownContextDirective, TuiDropdownDirective, TuiDropdownDriverDirective, TuiDropdownHostDirective, TuiDropdownHoverDirective, TuiDropdownManualDirective, TuiDropdownModule, TuiDropdownOptionsDirective, TuiDropdownPositionDirective, TuiDropdownPositionSidedDirective, TuiDropdownSelectionDirective, tuiDropdownOptionsProvider };
|
|
824
828
|
//# sourceMappingURL=taiga-ui-core-directives-dropdown.js.map
|