@taiga-ui/core 3.14.0-dev.main-6fca3d4 → 3.14.0-dev.main-49a682e
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 +3 -3
- package/bundles/taiga-ui-core-components-calendar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-data-list.umd.js +32 -32
- 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 +14 -14
- 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 +12 -12
- 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 +57 -57
- 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 +6 -6
- 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 +55 -55
- 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/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 +4 -4
- package/esm2015/components/data-list/data-list.component.js +16 -16
- 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 +13 -13
- 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 +14 -14
- 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 +12 -12
- 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 +14 -14
- package/esm2015/components/primitive-year-picker/primitive-year-picker.component.js +5 -5
- package/esm2015/components/root/root.component.js +7 -7
- 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 +6 -6
- 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 +11 -11
- package/esm2015/directives/dropdown/dropdown-position-sided.directive.js +5 -5
- package/esm2015/directives/dropdown/dropdown-position.directive.js +4 -4
- package/esm2015/directives/dropdown/dropdown-selection.directive.js +11 -11
- package/esm2015/directives/dropdown/dropdown.component.js +12 -12
- 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 +3 -3
- package/fesm2015/taiga-ui-core-components-calendar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-data-list.js +32 -32
- 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 +14 -14
- 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 +12 -12
- 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 +57 -57
- 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 +6 -6
- 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 +55 -55
- 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 +1 -1
|
@@ -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,22 +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
150
|
/** Default values for dropdown options */
|
|
151
151
|
const TUI_DROPDOWN_DEFAULT_OPTIONS = {
|
|
152
|
-
align:
|
|
152
|
+
align: 'left',
|
|
153
153
|
direction: null,
|
|
154
|
-
limitWidth:
|
|
154
|
+
limitWidth: 'auto',
|
|
155
155
|
maxHeight: 400,
|
|
156
156
|
minHeight: 80,
|
|
157
157
|
offset: 4,
|
|
158
158
|
};
|
|
159
|
-
const TUI_DROPDOWN_OPTIONS = new InjectionToken(
|
|
159
|
+
const TUI_DROPDOWN_OPTIONS = new InjectionToken('[TUI_DROPDOWN_OPTIONS] Default parameters for dropdown directive', {
|
|
160
160
|
factory: () => TUI_DROPDOWN_DEFAULT_OPTIONS,
|
|
161
161
|
});
|
|
162
162
|
const tuiDropdownOptionsProvider = (override) => ({
|
|
@@ -206,7 +206,7 @@ __decorate([
|
|
|
206
206
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownOptionsDirective, decorators: [{
|
|
207
207
|
type: Directive,
|
|
208
208
|
args: [{
|
|
209
|
-
selector:
|
|
209
|
+
selector: '[tuiDropdownAlign], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]',
|
|
210
210
|
providers: [
|
|
211
211
|
{
|
|
212
212
|
provide: TUI_DROPDOWN_OPTIONS,
|
|
@@ -221,22 +221,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
221
221
|
args: [TUI_DROPDOWN_OPTIONS]
|
|
222
222
|
}] }]; }, propDecorators: { align: [{
|
|
223
223
|
type: Input,
|
|
224
|
-
args: [
|
|
224
|
+
args: ['tuiDropdownAlign']
|
|
225
225
|
}], direction: [{
|
|
226
226
|
type: Input,
|
|
227
|
-
args: [
|
|
227
|
+
args: ['tuiDropdownDirection']
|
|
228
228
|
}], limitWidth: [{
|
|
229
229
|
type: Input,
|
|
230
|
-
args: [
|
|
230
|
+
args: ['tuiDropdownLimitWidth']
|
|
231
231
|
}], minHeight: [{
|
|
232
232
|
type: Input,
|
|
233
|
-
args: [
|
|
233
|
+
args: ['tuiDropdownMinHeight']
|
|
234
234
|
}], maxHeight: [{
|
|
235
235
|
type: Input,
|
|
236
|
-
args: [
|
|
236
|
+
args: ['tuiDropdownMaxHeight']
|
|
237
237
|
}], offset: [{
|
|
238
238
|
type: Input,
|
|
239
|
-
args: [
|
|
239
|
+
args: ['tuiDropdownOffset']
|
|
240
240
|
}] } });
|
|
241
241
|
|
|
242
242
|
/**
|
|
@@ -277,8 +277,8 @@ class TuiDropdownComponent {
|
|
|
277
277
|
const { clientRect } = this.host;
|
|
278
278
|
const { position } = this.directive;
|
|
279
279
|
const rect = this.accessor.getClientRect();
|
|
280
|
-
const offsetX = position ===
|
|
281
|
-
const offsetY = position ===
|
|
280
|
+
const offsetX = position === 'fixed' ? 0 : -clientRect.left;
|
|
281
|
+
const offsetY = position === 'fixed' ? 0 : -clientRect.top;
|
|
282
282
|
top += offsetY;
|
|
283
283
|
left += offsetX;
|
|
284
284
|
const isIntersecting = left < rect.right &&
|
|
@@ -291,18 +291,18 @@ class TuiDropdownComponent {
|
|
|
291
291
|
style.top = tuiPx(Math.max(top, offsetY + this.options.offset));
|
|
292
292
|
style.left = tuiPx(left);
|
|
293
293
|
style.maxHeight = tuiPx(Math.min(maxHeight, available));
|
|
294
|
-
style.width =
|
|
295
|
-
style.minWidth =
|
|
294
|
+
style.width = '';
|
|
295
|
+
style.minWidth = '';
|
|
296
296
|
switch (limitWidth) {
|
|
297
|
-
case
|
|
297
|
+
case 'min':
|
|
298
298
|
style.minWidth = tuiPx(rect.width);
|
|
299
299
|
break;
|
|
300
|
-
case
|
|
300
|
+
case 'fixed':
|
|
301
301
|
style.width = tuiPx(rect.width);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
moveFocusOutside(previous) {
|
|
305
|
-
const host = document.createElement(
|
|
305
|
+
const host = document.createElement('div');
|
|
306
306
|
const { ownerDocument } = host;
|
|
307
307
|
const root = ownerDocument ? ownerDocument.body : host;
|
|
308
308
|
let focusable = tuiGetClosestFocusable({ initial: host, root, previous });
|
|
@@ -317,9 +317,9 @@ TuiDropdownComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", v
|
|
|
317
317
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownComponent, decorators: [{
|
|
318
318
|
type: Component,
|
|
319
319
|
args: [{
|
|
320
|
-
selector:
|
|
321
|
-
templateUrl:
|
|
322
|
-
styleUrls: [
|
|
320
|
+
selector: 'tui-dropdown',
|
|
321
|
+
templateUrl: './dropdown.template.html',
|
|
322
|
+
styleUrls: ['./dropdown.style.less'],
|
|
323
323
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
324
324
|
providers: [TuiDestroyService, TuiPositionService],
|
|
325
325
|
animations: [tuiDropdownAnimation],
|
|
@@ -360,7 +360,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
360
360
|
args: [TuiDropdownHoverDirective]
|
|
361
361
|
}] }]; }, propDecorators: { dropdownAnimation: [{
|
|
362
362
|
type: HostBinding,
|
|
363
|
-
args: [
|
|
363
|
+
args: ['@tuiDropdownAnimation']
|
|
364
364
|
}] } });
|
|
365
365
|
|
|
366
366
|
class TuiDropdownContextDirective extends TuiDriver {
|
|
@@ -392,7 +392,7 @@ TuiDropdownContextDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.
|
|
|
392
392
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownContextDirective, decorators: [{
|
|
393
393
|
type: Directive,
|
|
394
394
|
args: [{
|
|
395
|
-
selector:
|
|
395
|
+
selector: '[tuiDropdown][tuiDropdownContext]',
|
|
396
396
|
providers: [
|
|
397
397
|
TuiActiveZoneDirective,
|
|
398
398
|
tuiAsDriver(TuiDropdownContextDirective),
|
|
@@ -404,16 +404,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
404
404
|
args: [TuiActiveZoneDirective]
|
|
405
405
|
}] }]; }, propDecorators: { onContextMenu: [{
|
|
406
406
|
type: HostListener,
|
|
407
|
-
args: [
|
|
407
|
+
args: ['contextmenu.prevent.stop', ['$event.clientX', '$event.clientY']]
|
|
408
408
|
}], closeDropdown: [{
|
|
409
409
|
type: HostListener,
|
|
410
|
-
args: [
|
|
410
|
+
args: ['document:click.silent', ['$event.target']]
|
|
411
411
|
}, {
|
|
412
412
|
type: HostListener,
|
|
413
|
-
args: [
|
|
413
|
+
args: ['document:contextmenu.capture.silent', ['$event.target']]
|
|
414
414
|
}, {
|
|
415
415
|
type: HostListener,
|
|
416
|
-
args: [
|
|
416
|
+
args: ['document:keydown.esc', ['$event.currentTarget']]
|
|
417
417
|
}] } });
|
|
418
418
|
|
|
419
419
|
class TuiDropdownDriverDirective extends AbstractTuiDriverDirective {
|
|
@@ -423,7 +423,7 @@ TuiDropdownDriverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0
|
|
|
423
423
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownDriverDirective, decorators: [{
|
|
424
424
|
type: Directive,
|
|
425
425
|
args: [{
|
|
426
|
-
selector:
|
|
426
|
+
selector: '[tuiDropdown]',
|
|
427
427
|
providers: [TuiDestroyService],
|
|
428
428
|
}]
|
|
429
429
|
}] });
|
|
@@ -439,7 +439,7 @@ TuiDropdownHostDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0
|
|
|
439
439
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownHostDirective, decorators: [{
|
|
440
440
|
type: Directive,
|
|
441
441
|
args: [{
|
|
442
|
-
selector:
|
|
442
|
+
selector: '[tuiDropdown][tuiDropdownHost]',
|
|
443
443
|
providers: [tuiAsRectAccessor(TuiDropdownHostDirective)],
|
|
444
444
|
}]
|
|
445
445
|
}], propDecorators: { tuiDropdownHost: [{
|
|
@@ -461,7 +461,7 @@ TuiDropdownManualDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0
|
|
|
461
461
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownManualDirective, decorators: [{
|
|
462
462
|
type: Directive,
|
|
463
463
|
args: [{
|
|
464
|
-
selector:
|
|
464
|
+
selector: '[tuiDropdown][tuiDropdownManual]',
|
|
465
465
|
providers: [tuiAsDriver(TuiDropdownManualDirective)],
|
|
466
466
|
}]
|
|
467
467
|
}], ctorParameters: function () { return []; }, propDecorators: { tuiDropdownManual: [{
|
|
@@ -478,7 +478,7 @@ class TuiDropdownPositionDirective {
|
|
|
478
478
|
const hostRect = this.accessor.getClientRect();
|
|
479
479
|
const { innerHeight, innerWidth } = this.windowRef;
|
|
480
480
|
const { minHeight, align, direction } = this.options;
|
|
481
|
-
const previous = this.previous || direction ||
|
|
481
|
+
const previous = this.previous || direction || 'bottom';
|
|
482
482
|
const right = Math.max(hostRect.right - width, this.options.offset);
|
|
483
483
|
const available = {
|
|
484
484
|
top: hostRect.top - 2 * this.options.offset,
|
|
@@ -492,7 +492,7 @@ class TuiDropdownPositionDirective {
|
|
|
492
492
|
? hostRect.left
|
|
493
493
|
: right,
|
|
494
494
|
};
|
|
495
|
-
const better = available.top > available.bottom ?
|
|
495
|
+
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
496
496
|
if ((available[previous] > minHeight && direction) ||
|
|
497
497
|
available[previous] > height) {
|
|
498
498
|
return [position[previous], position[align]];
|
|
@@ -506,7 +506,7 @@ TuiDropdownPositionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12
|
|
|
506
506
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownPositionDirective, decorators: [{
|
|
507
507
|
type: Directive,
|
|
508
508
|
args: [{
|
|
509
|
-
selector:
|
|
509
|
+
selector: '[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])',
|
|
510
510
|
providers: [tuiAsPositionAccessor(TuiDropdownPositionDirective)],
|
|
511
511
|
}]
|
|
512
512
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -526,8 +526,8 @@ class TuiDropdownPositionSidedDirective {
|
|
|
526
526
|
this.windowRef = windowRef;
|
|
527
527
|
this.accessor = accessor;
|
|
528
528
|
this.vertical = vertical;
|
|
529
|
-
this.previous = this.options.direction ||
|
|
530
|
-
this.tuiDropdownSided =
|
|
529
|
+
this.previous = this.options.direction || 'bottom';
|
|
530
|
+
this.tuiDropdownSided = '';
|
|
531
531
|
}
|
|
532
532
|
getPosition(rect) {
|
|
533
533
|
if (this.tuiDropdownSided === false) {
|
|
@@ -549,7 +549,7 @@ class TuiDropdownPositionSidedDirective {
|
|
|
549
549
|
right: hostRect.right + this.options.offset,
|
|
550
550
|
bottom: hostRect.top - 1, // 1 for border
|
|
551
551
|
};
|
|
552
|
-
const better = available.top > available.bottom ?
|
|
552
|
+
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
553
553
|
const maxLeft = available.left > available.right ? position.left : position.right;
|
|
554
554
|
const left = available[align] > width ? position[align] : maxLeft;
|
|
555
555
|
if ((available[this.previous] > minHeight && direction) ||
|
|
@@ -568,7 +568,7 @@ TuiDropdownPositionSidedDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion
|
|
|
568
568
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownPositionSidedDirective, decorators: [{
|
|
569
569
|
type: Directive,
|
|
570
570
|
args: [{
|
|
571
|
-
selector:
|
|
571
|
+
selector: '[tuiDropdownSided]',
|
|
572
572
|
providers: [
|
|
573
573
|
TuiDropdownPositionDirective,
|
|
574
574
|
tuiAsPositionAccessor(TuiDropdownPositionSidedDirective),
|
|
@@ -611,7 +611,7 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
611
611
|
: this.range;
|
|
612
612
|
return (contained && handler(this.range)) || this.inDropdown(range);
|
|
613
613
|
}));
|
|
614
|
-
this.position =
|
|
614
|
+
this.position = 'selection';
|
|
615
615
|
}
|
|
616
616
|
set tuiDropdownSelection(visible) {
|
|
617
617
|
if (!tuiIsString(visible)) {
|
|
@@ -620,7 +620,7 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
620
620
|
}
|
|
621
621
|
getClientRect() {
|
|
622
622
|
switch (this.position) {
|
|
623
|
-
case
|
|
623
|
+
case 'tag': {
|
|
624
624
|
const { commonAncestorContainer } = this.range;
|
|
625
625
|
const element = tuiIsElement(commonAncestorContainer)
|
|
626
626
|
? commonAncestorContainer
|
|
@@ -629,7 +629,7 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
629
629
|
? element.getBoundingClientRect()
|
|
630
630
|
: EMPTY_CLIENT_RECT;
|
|
631
631
|
}
|
|
632
|
-
case
|
|
632
|
+
case 'word':
|
|
633
633
|
return tuiGetWordRange(this.range).getBoundingClientRect();
|
|
634
634
|
default:
|
|
635
635
|
return this.range.getBoundingClientRect();
|
|
@@ -686,13 +686,13 @@ class TuiDropdownSelectionDirective extends TuiDriver {
|
|
|
686
686
|
* Create an invisible DIV styled exactly like input/textarea element inside directive
|
|
687
687
|
*/
|
|
688
688
|
initGhost(element) {
|
|
689
|
-
const ghost = this.documentRef.createElement(
|
|
689
|
+
const ghost = this.documentRef.createElement('div');
|
|
690
690
|
const { nativeElement } = this.viewContainerRef.element;
|
|
691
691
|
const { font, letterSpacing, textTransform, padding } = getComputedStyle(element);
|
|
692
|
-
ghost.style.position =
|
|
693
|
-
ghost.style.pointerEvents =
|
|
694
|
-
ghost.style.opacity =
|
|
695
|
-
ghost.style.whiteSpace =
|
|
692
|
+
ghost.style.position = 'absolute';
|
|
693
|
+
ghost.style.pointerEvents = 'none';
|
|
694
|
+
ghost.style.opacity = '0';
|
|
695
|
+
ghost.style.whiteSpace = 'pre-wrap';
|
|
696
696
|
ghost.style.font = font;
|
|
697
697
|
ghost.style.letterSpacing = letterSpacing;
|
|
698
698
|
ghost.style.textTransform = textTransform;
|
|
@@ -713,7 +713,7 @@ __decorate([
|
|
|
713
713
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: TuiDropdownSelectionDirective, decorators: [{
|
|
714
714
|
type: Directive,
|
|
715
715
|
args: [{
|
|
716
|
-
selector:
|
|
716
|
+
selector: '[tuiDropdown][tuiDropdownSelection]',
|
|
717
717
|
providers: [
|
|
718
718
|
tuiAsDriver(TuiDropdownSelectionDirective),
|
|
719
719
|
tuiAsRectAccessor(TuiDropdownSelectionDirective),
|
|
@@ -739,7 +739,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
739
739
|
args: [TuiDropdownDirective]
|
|
740
740
|
}] }]; }, propDecorators: { position: [{
|
|
741
741
|
type: Input,
|
|
742
|
-
args: [
|
|
742
|
+
args: ['tuiDropdownSelectionPosition']
|
|
743
743
|
}], tuiDropdownSelection: [{
|
|
744
744
|
type: Input
|
|
745
745
|
}] } });
|