@taiga-ui/core 4.52.0-canary.2c75afa → 4.52.0-canary.2d877cf
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/README.md +1 -1
- package/classes/accessors.d.ts +1 -1
- package/components/calendar/calendar-sheet.component.d.ts +1 -1
- package/components/calendar/calendar-sheet.options.d.ts +1 -3
- package/{pipes/calendar-sheet → components/calendar}/calendar-sheet.pipe.d.ts +2 -2
- package/components/calendar/calendar-spin.component.d.ts +1 -0
- package/components/calendar/calendar-year.component.d.ts +1 -1
- package/components/calendar/calendar.options.d.ts +9 -0
- package/components/calendar/index.d.ts +3 -0
- package/{pipes/order-week-days → components/calendar}/order-week-days.pipe.d.ts +1 -1
- package/components/data-list/data-list.component.d.ts +7 -11
- package/components/data-list/data-list.d.ts +3 -4
- package/components/data-list/data-list.tokens.d.ts +1 -23
- package/components/data-list/index.d.ts +3 -4
- package/components/data-list/opt-group.directive.d.ts +2 -2
- package/components/data-list/option-content.directive.d.ts +14 -0
- package/components/data-list/option-with-value.directive.d.ts +9 -0
- package/components/data-list/option.directive.d.ts +19 -0
- package/components/icon/icon.component.d.ts +2 -2
- package/components/index.d.ts +2 -3
- package/components/input/index.d.ts +2 -0
- package/components/input/input.d.ts +5 -0
- package/components/input/input.directive.d.ts +30 -0
- package/components/label/label.directive.d.ts +1 -1
- package/components/link/index.d.ts +0 -1
- package/components/link/link.directive.d.ts +8 -6
- package/components/loader/loader.options.d.ts +1 -3
- package/components/notification/index.d.ts +3 -0
- package/components/notification/notification.component.d.ts +14 -0
- package/components/notification/notification.d.ts +3 -0
- package/components/notification/notification.directive.d.ts +3 -3
- package/components/notification/notification.options.d.ts +10 -7
- package/components/notification/notification.service.d.ts +17 -0
- package/components/root/root.component.d.ts +1 -1
- package/components/scrollbar/scroll-ref.directive.d.ts +2 -0
- package/components/scrollbar/scrollbar.component.d.ts +1 -5
- package/components/spin-button/spin-button.component.d.ts +1 -1
- package/components/textfield/index.d.ts +0 -1
- package/components/textfield/textfield-multi/textfield-item.component.d.ts +3 -2
- package/components/textfield/textfield-multi/textfield-multi.component.d.ts +9 -13
- package/components/textfield/textfield.component.d.ts +23 -35
- package/components/textfield/textfield.d.ts +2 -3
- package/directives/group/group.directive.d.ts +7 -7
- package/directives/group/group.options.d.ts +1 -3
- package/directives/index.d.ts +0 -5
- package/directives/items-handlers/items-handlers.directive.d.ts +5 -9
- package/directives/items-handlers/items-handlers.tokens.d.ts +4 -4
- package/fesm2022/taiga-ui-core-classes.mjs +8 -10
- package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-button.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-calendar.mjs +137 -32
- package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-cell.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +109 -271
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +11 -10
- package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-expand.mjs +3 -3
- package/fesm2022/taiga-ui-core-components-icon.mjs +8 -8
- package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-input.mjs +103 -0
- package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-components-label.mjs +10 -12
- package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +13 -28
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +6 -11
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +95 -24
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +7 -8
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs +42 -48
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-spin-button.mjs +5 -5
- package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-textfield.mjs +102 -257
- package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
- package/fesm2022/{taiga-ui-core-directives-title.mjs → taiga-ui-core-components-title.mjs} +7 -7
- package/fesm2022/{taiga-ui-core-directives-title.mjs.map → taiga-ui-core-components-title.mjs.map} +1 -1
- package/fesm2022/taiga-ui-core-components.mjs +2 -3
- package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +15 -14
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-group.mjs +22 -34
- package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs +11 -10
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +16 -37
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-number-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives.mjs +0 -5
- package/fesm2022/taiga-ui-core-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs +5 -8
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes.mjs +0 -7
- package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-alert.mjs +73 -0
- package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-components-dialog.mjs → taiga-ui-core-portals-dialog.mjs} +15 -15
- package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-directives-dropdown.mjs → taiga-ui-core-portals-dropdown.mjs} +148 -240
- package/fesm2022/taiga-ui-core-portals-dropdown.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-directives-hint.mjs → taiga-ui-core-portals-hint.mjs} +49 -50
- package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-components-modal.mjs → taiga-ui-core-portals-modal.mjs} +10 -10
- package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-directives-popup.mjs → taiga-ui-core-portals-popup.mjs} +11 -11
- package/fesm2022/taiga-ui-core-portals-popup.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-portals.mjs +11 -0
- package/fesm2022/taiga-ui-core-portals.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-services.mjs +16 -55
- package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs +8 -41
- package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-format.mjs +1 -23
- package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +7 -16
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
- package/fesm2022/taiga-ui-core.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +70 -99
- package/pipes/format-number/format-number.pipe.d.ts +1 -1
- package/pipes/index.d.ts +0 -7
- package/{directives/notification/notification.directive.d.ts → portals/alert/alert.directive.d.ts} +3 -3
- package/{directives/notification/notification.service.d.ts → portals/alert/alert.service.d.ts} +3 -3
- package/portals/alert/index.d.ts +2 -0
- package/{components → portals}/dialog/dialog.service.d.ts +1 -1
- package/{directives → portals}/dropdown/dropdown-hover.directive.d.ts +5 -10
- package/{directives → portals}/dropdown/dropdown-hover.options.d.ts +1 -3
- package/{directives → portals}/dropdown/dropdown-manual.directive.d.ts +2 -2
- package/portals/dropdown/dropdown-open.directive.d.ts +30 -0
- package/{directives → portals}/dropdown/dropdown-position-sided.directive.d.ts +3 -3
- package/{directives → portals}/dropdown/dropdown-position.directive.d.ts +4 -4
- package/{directives → portals}/dropdown/dropdown-selection.directive.d.ts +4 -5
- package/{directives → portals}/dropdown/dropdown.bindings.d.ts +0 -1
- package/{directives → portals}/dropdown/dropdown.d.ts +1 -2
- package/{directives → portals}/dropdown/dropdown.directive.d.ts +5 -6
- package/{directives → portals}/dropdown/index.d.ts +0 -1
- package/{directives → portals}/hint/hint-position.directive.d.ts +1 -1
- package/portals/index.d.ts +6 -0
- package/services/index.d.ts +0 -2
- package/styles/components/link.less +8 -23
- package/styles/components/textfield.less +10 -7
- package/styles/mixins/appearance.less +1 -1
- package/styles/mixins/slider.scss +1 -2
- package/tokens/common-icons.d.ts +3 -3
- package/tokens/icons.d.ts +0 -4
- package/tokens/index.d.ts +0 -4
- package/types/index.d.ts +0 -2
- package/types/point.d.ts +1 -1
- package/types/size.d.ts +0 -11
- package/utils/format/index.d.ts +0 -1
- package/utils/miscellaneous/get-duration.d.ts +2 -0
- package/utils/miscellaneous/index.d.ts +1 -1
- package/animations/animations.d.ts +0 -109
- package/animations/index.d.ts +0 -1
- package/components/alert/alert.component.d.ts +0 -14
- package/components/alert/alert.directive.d.ts +0 -8
- package/components/alert/alert.interfaces.d.ts +0 -12
- package/components/alert/alert.service.d.ts +0 -11
- package/components/alert/alert.tokens.d.ts +0 -6
- package/components/alert/index.d.ts +0 -5
- package/components/data-list/data-list.directive.d.ts +0 -7
- package/components/data-list/option/option-content.d.ts +0 -16
- package/components/data-list/option/option-legacy.component.d.ts +0 -24
- package/components/data-list/option/option.directive.d.ts +0 -27
- package/components/link/link.options.d.ts +0 -12
- package/components/textfield/textfield.directive.d.ts +0 -35
- package/directives/dropdown/dropdown-open-legacy.directive.d.ts +0 -12
- package/directives/dropdown/dropdown-open.directive.d.ts +0 -33
- package/directives/notification/index.d.ts +0 -2
- package/fesm2022/taiga-ui-core-animations.mjs +0 -370
- package/fesm2022/taiga-ui-core-animations.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-alert.mjs +0 -110
- package/fesm2022/taiga-ui-core-components-alert.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-modal.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-hint.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-notification.mjs +0 -73
- package/fesm2022/taiga-ui-core-directives-notification.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-popup.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +0 -24
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +0 -93
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-flag.mjs +0 -31
- package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs +0 -27
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-initials.mjs +0 -28
- package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs +0 -29
- package/fesm2022/taiga-ui-core-pipes-month.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +0 -35
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +0 -1
- package/pipes/auto-color/auto-color.pipe.d.ts +0 -7
- package/pipes/auto-color/index.d.ts +0 -1
- package/pipes/calendar-sheet/index.d.ts +0 -1
- package/pipes/calendar-sheet/utils.d.ts +0 -20
- package/pipes/flag/flag.pipe.d.ts +0 -14
- package/pipes/flag/index.d.ts +0 -1
- package/pipes/format-date/format-date.pipe.d.ts +0 -9
- package/pipes/format-date/index.d.ts +0 -1
- package/pipes/initials/index.d.ts +0 -1
- package/pipes/initials/initials.pipe.d.ts +0 -7
- package/pipes/month/index.d.ts +0 -1
- package/pipes/month/month.pipe.d.ts +0 -10
- package/pipes/order-week-days/index.d.ts +0 -1
- package/services/dark-theme.service.d.ts +0 -10
- package/services/format-date.service.d.ts +0 -8
- package/tokens/day-type-handler.d.ts +0 -7
- package/tokens/first-day-of-week.d.ts +0 -5
- package/tokens/scroll-ref.d.ts +0 -2
- package/tokens/spin-icons.d.ts +0 -6
- package/types/range-state.d.ts +0 -4
- package/types/value-content-context.d.ts +0 -4
- package/utils/format/string-hash-to-hsl.d.ts +0 -6
- package/utils/miscellaneous/to-animation-options.d.ts +0 -4
- /package/{directives → components}/title/index.d.ts +0 -0
- /package/{directives → components}/title/title.directive.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.component.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.directive.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.factory.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.options.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.providers.d.ts +0 -0
- /package/{components → portals}/dialog/index.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-content.directive.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-context.directive.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-limit-width.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-options.directive.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown.component.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown.driver.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown.providers.d.ts +0 -0
- /package/{directives → portals}/dropdown/with-dropdown-open.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-describe.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-driver.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-host.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-hover.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-manual.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-options.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-overflow.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-pointer.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-unstyled.component.d.ts +0 -0
- /package/{directives → portals}/hint/hint.component.d.ts +0 -0
- /package/{directives → portals}/hint/hint.d.ts +0 -0
- /package/{directives → portals}/hint/hint.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint.providers.d.ts +0 -0
- /package/{directives → portals}/hint/index.d.ts +0 -0
- /package/{components → portals}/modal/index.d.ts +0 -0
- /package/{components → portals}/modal/modal.component.d.ts +0 -0
- /package/{components → portals}/modal/modal.service.d.ts +0 -0
- /package/{directives → portals}/popup/index.d.ts +0 -0
- /package/{directives → portals}/popup/popup.directive.d.ts +0 -0
- /package/{directives → portals}/popup/popup.service.d.ts +0 -0
- /package/{directives → portals}/popup/popups.component.d.ts +0 -0
package/fesm2022/{taiga-ui-core-directives-dropdown.mjs → taiga-ui-core-portals-dropdown.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, Directive, InjectionToken, Optional, Self, SkipSelf, inject, Input,
|
|
3
|
-
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
2
|
+
import { Injectable, Directive, InjectionToken, Optional, Self, SkipSelf, inject, Input, ChangeDetectorRef, effect, signal, INJECTOR, input, computed, TemplateRef, forwardRef, ChangeDetectionStrategy, Component, PLATFORM_ID, contentChild, ElementRef, model, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import { outputFromObservable, takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { EMPTY_CLIENT_RECT, TUI_TRUE_HANDLER, CHAR_ZERO_WIDTH_SPACE, CHAR_NO_BREAK_SPACE } from '@taiga-ui/cdk/constants';
|
|
5
5
|
import * as i1 from '@taiga-ui/cdk/directives/active-zone';
|
|
6
6
|
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
@@ -8,24 +8,25 @@ import * as i2 from '@taiga-ui/cdk/directives/animated';
|
|
|
8
8
|
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
9
9
|
import { tuiInjectElement, tuiGetActualTarget, tuiPointToClientRect, tuiIsElement, tuiIsHTMLElement, tuiIsElementEditable, tuiIsTextNode, tuiIsTextfield } from '@taiga-ui/cdk/utils/dom';
|
|
10
10
|
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
11
|
-
import {
|
|
11
|
+
import { tuiPx, tuiSetSignal, tuiIsString } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
12
12
|
import { TuiDriverDirective, TuiPositionAccessor, tuiFallbackAccessor, TuiRectAccessor, tuiAsVehicle, tuiPositionAccessorFor, tuiRectAccessorFor, tuiAsDriver, tuiAsRectAccessor, TuiDriver, tuiAsPositionAccessor } from '@taiga-ui/core/classes';
|
|
13
13
|
import { TuiScrollbar } from '@taiga-ui/core/components/scrollbar';
|
|
14
14
|
import { TuiVisualViewportService, TuiPositionService } from '@taiga-ui/core/services';
|
|
15
15
|
import { TUI_VIEWPORT, TUI_DARK_MODE, TUI_SELECTION_STREAM } from '@taiga-ui/core/tokens';
|
|
16
16
|
import { PolymorpheusComponent, PolymorpheusTemplate, PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
17
|
-
import { BehaviorSubject, Subject, throttleTime, takeWhile, map, merge, filter, fromEvent, switchMap, delay, startWith, takeUntil,
|
|
17
|
+
import { BehaviorSubject, Subject, distinctUntilChanged, throttleTime, takeWhile, map, merge, filter, fromEvent, switchMap, delay, startWith, takeUntil, of, tap, share, combineLatest } from 'rxjs';
|
|
18
18
|
import { coerceArray } from '@angular/cdk/coercion';
|
|
19
19
|
import { tuiZonefreeScheduler, tuiTypedFromEvent, tuiZonefree, tuiIfMap, tuiCloseWatcher, tuiZonefull, tuiWatch, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
|
|
20
|
-
import { TuiPopupService } from '@taiga-ui/core/
|
|
20
|
+
import { TuiPopupService } from '@taiga-ui/core/portals/popup';
|
|
21
21
|
import { tuiOverrideOptions, tuiCheckFixedPosition, tuiGetWordRange } from '@taiga-ui/core/utils';
|
|
22
|
-
import {
|
|
22
|
+
import { tuiProvide, tuiCreateOptions, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/di';
|
|
23
23
|
import { isPlatformBrowser, DOCUMENT } from '@angular/common';
|
|
24
|
-
import {
|
|
24
|
+
import { __decorate } from 'tslib';
|
|
25
|
+
import { TUI_IS_TOUCH } from '@taiga-ui/cdk/tokens';
|
|
25
26
|
import { shouldCall } from '@taiga-ui/event-plugins';
|
|
26
27
|
import * as i1$1 from '@taiga-ui/cdk/directives/obscured';
|
|
27
28
|
import { TuiObscured } from '@taiga-ui/cdk/directives/obscured';
|
|
28
|
-
import {
|
|
29
|
+
import { tuiIsFocusable, tuiGetClosestFocusable, tuiIsFocusedIn, tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
29
30
|
import { tuiIsEditingKey, tuiOverrideOptions as tuiOverrideOptions$1 } from '@taiga-ui/core/utils/miscellaneous';
|
|
30
31
|
|
|
31
32
|
class TuiDropdownDriver extends BehaviorSubject {
|
|
@@ -33,10 +34,10 @@ class TuiDropdownDriver extends BehaviorSubject {
|
|
|
33
34
|
super(false);
|
|
34
35
|
this.type = 'dropdown';
|
|
35
36
|
}
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
37
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
38
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriver }); }
|
|
38
39
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriver, decorators: [{
|
|
40
41
|
type: Injectable
|
|
41
42
|
}], ctorParameters: () => [] });
|
|
42
43
|
class TuiDropdownDriverDirective extends TuiDriverDirective {
|
|
@@ -44,10 +45,10 @@ class TuiDropdownDriverDirective extends TuiDriverDirective {
|
|
|
44
45
|
super(...arguments);
|
|
45
46
|
this.type = 'dropdown';
|
|
46
47
|
}
|
|
47
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
48
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriverDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
49
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownDriverDirective, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
49
50
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriverDirective, decorators: [{
|
|
51
52
|
type: Directive
|
|
52
53
|
}] });
|
|
53
54
|
|
|
@@ -94,10 +95,10 @@ class TuiDropdownOptionsDirective {
|
|
|
94
95
|
this.maxHeight = this.options.maxHeight;
|
|
95
96
|
this.offset = this.options.offset;
|
|
96
97
|
}
|
|
97
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
98
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
98
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOptionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
99
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownOptionsDirective, isStandalone: true, selector: "[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]", inputs: { align: ["tuiDropdownAlign", "align"], appearance: ["tuiDropdownAppearance", "appearance"], direction: ["tuiDropdownDirection", "direction"], limitWidth: ["tuiDropdownLimitWidth", "limitWidth"], minHeight: ["tuiDropdownMinHeight", "minHeight"], maxHeight: ["tuiDropdownMaxHeight", "maxHeight"], offset: ["tuiDropdownOffset", "offset"] }, providers: [tuiProvide(TUI_DROPDOWN_OPTIONS, TuiDropdownOptionsDirective)], ngImport: i0 }); }
|
|
99
100
|
}
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOptionsDirective, decorators: [{
|
|
101
102
|
type: Directive,
|
|
102
103
|
args: [{
|
|
103
104
|
selector: '[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]',
|
|
@@ -132,14 +133,10 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
132
133
|
this.el = tuiInjectElement();
|
|
133
134
|
this.options = inject(TUI_DROPDOWN_OPTIONS);
|
|
134
135
|
this.viewport = inject(TUI_VIEWPORT);
|
|
135
|
-
this.
|
|
136
|
+
this.direction = new Subject();
|
|
136
137
|
this.type = 'dropdown';
|
|
137
|
-
this.accessor = tuiFallbackAccessor('dropdown')(inject(TuiRectAccessor, { optional: true }), {
|
|
138
|
-
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
emitDirection(direction) {
|
|
142
|
-
this.directionChange.emit(direction);
|
|
138
|
+
this.accessor = tuiFallbackAccessor('dropdown')(inject(TuiRectAccessor, { optional: true }), { getClientRect: () => this.el.getBoundingClientRect() });
|
|
139
|
+
this.tuiDropdownDirectionChange = outputFromObservable(this.direction.pipe(distinctUntilChanged()));
|
|
143
140
|
}
|
|
144
141
|
getPosition({ width, height }) {
|
|
145
142
|
if (!width && !height) {
|
|
@@ -175,12 +172,12 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
175
172
|
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
176
173
|
if ((available[previous] > minHeight && direction) ||
|
|
177
174
|
available[previous] > height) {
|
|
178
|
-
this.
|
|
179
|
-
return [position[
|
|
175
|
+
this.direction.next(previous);
|
|
176
|
+
return [position[align], position[previous]];
|
|
180
177
|
}
|
|
181
178
|
this.previous = better;
|
|
182
|
-
this.
|
|
183
|
-
return [position[
|
|
179
|
+
this.direction.next(better);
|
|
180
|
+
return [position[align], position[better]];
|
|
184
181
|
}
|
|
185
182
|
getAlign(align) {
|
|
186
183
|
const rtl = this.el.matches('[dir="rtl"] :scope');
|
|
@@ -189,25 +186,18 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
189
186
|
}
|
|
190
187
|
return rtl && align === 'right' ? 'left' : align;
|
|
191
188
|
}
|
|
192
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
193
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
189
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPosition, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
190
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownPosition, isStandalone: true, outputs: { tuiDropdownDirectionChange: "tuiDropdownDirectionChange" }, usesInheritance: true, ngImport: i0 }); }
|
|
194
191
|
}
|
|
195
|
-
|
|
196
|
-
tuiPure
|
|
197
|
-
], TuiDropdownPosition.prototype, "emitDirection", null);
|
|
198
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownPosition, decorators: [{
|
|
192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPosition, decorators: [{
|
|
199
193
|
type: Directive
|
|
200
|
-
}]
|
|
201
|
-
type: Output,
|
|
202
|
-
args: ['tuiDropdownDirectionChange']
|
|
203
|
-
}], emitDirection: [] } });
|
|
194
|
+
}] });
|
|
204
195
|
|
|
205
196
|
class TuiDropdownDirective {
|
|
206
197
|
constructor() {
|
|
207
198
|
this.refresh$ = new Subject();
|
|
208
199
|
this.service = inject(TuiPopupService);
|
|
209
200
|
this.cdr = inject(ChangeDetectorRef);
|
|
210
|
-
// TODO: think of a better solution later
|
|
211
201
|
this.drivers = coerceArray(inject(TuiDropdownDriver, { self: true, optional: true }));
|
|
212
202
|
this.sub = this.refresh$
|
|
213
203
|
.pipe(throttleTime(0, tuiZonefreeScheduler()), takeUntilDestroyed())
|
|
@@ -215,33 +205,25 @@ class TuiDropdownDirective {
|
|
|
215
205
|
this.ref()?.changeDetectorRef.detectChanges();
|
|
216
206
|
this.ref()?.changeDetectorRef.markForCheck();
|
|
217
207
|
});
|
|
208
|
+
this.autoClose = effect(() => {
|
|
209
|
+
if (!this.content()) {
|
|
210
|
+
this.toggle(false);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
this.ref = signal(null);
|
|
218
214
|
this.el = tuiInjectElement();
|
|
219
215
|
this.type = 'dropdown';
|
|
220
216
|
this.component = new PolymorpheusComponent(inject(TUI_DROPDOWN_COMPONENT), inject(INJECTOR));
|
|
221
|
-
this.
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
this._content.set(content instanceof TemplateRef
|
|
228
|
-
? new PolymorpheusTemplate(content, this.cdr)
|
|
229
|
-
: content);
|
|
230
|
-
if (!this._content()) {
|
|
231
|
-
this.toggle(false);
|
|
232
|
-
}
|
|
217
|
+
this.tuiDropdown = input();
|
|
218
|
+
this.content = computed((content = this.tuiDropdown()) => {
|
|
219
|
+
return content instanceof TemplateRef
|
|
220
|
+
? new PolymorpheusTemplate(content, this.cdr)
|
|
221
|
+
: content;
|
|
222
|
+
});
|
|
233
223
|
}
|
|
234
224
|
get position() {
|
|
235
225
|
return tuiCheckFixedPosition(this.el) ? 'fixed' : 'absolute';
|
|
236
226
|
}
|
|
237
|
-
// TODO(v5): delete
|
|
238
|
-
get content() {
|
|
239
|
-
return this._content();
|
|
240
|
-
}
|
|
241
|
-
// TODO(v5): delete
|
|
242
|
-
set content(x) {
|
|
243
|
-
this._content.set(x);
|
|
244
|
-
}
|
|
245
227
|
ngAfterViewChecked() {
|
|
246
228
|
this.refresh$.next();
|
|
247
229
|
}
|
|
@@ -253,21 +235,21 @@ class TuiDropdownDirective {
|
|
|
253
235
|
}
|
|
254
236
|
toggle(show) {
|
|
255
237
|
const ref = this.ref();
|
|
256
|
-
if (show && this.
|
|
238
|
+
if (show && this.content() && !ref) {
|
|
257
239
|
this.ref.set(this.service.add(this.component));
|
|
258
240
|
}
|
|
259
241
|
else if (!show && ref) {
|
|
260
242
|
this.ref.set(null);
|
|
261
243
|
ref.destroy();
|
|
262
244
|
}
|
|
263
|
-
this.drivers.forEach((driver) => driver?.next(show));
|
|
264
245
|
// TODO: Remove in v5, only needed in Angular 16
|
|
265
246
|
this.cdr.markForCheck();
|
|
247
|
+
this.drivers.forEach((driver) => driver?.next(show));
|
|
266
248
|
}
|
|
267
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
268
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
249
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
250
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiDropdownDirective, isStandalone: true, selector: "[tuiDropdown]:not(ng-container):not(ng-template)", inputs: { tuiDropdown: { classPropertyName: "tuiDropdown", publicName: "tuiDropdown", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.tui-dropdown-open": "ref()" } }, providers: [tuiAsVehicle(TuiDropdownDirective)], exportAs: ["tuiDropdown"], hostDirectives: [{ directive: TuiDropdownDriverDirective }, { directive: TuiDropdownPosition, outputs: ["tuiDropdownDirectionChange", "tuiDropdownDirectionChange"] }], ngImport: i0 }); }
|
|
269
251
|
}
|
|
270
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
252
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDirective, decorators: [{
|
|
271
253
|
type: Directive,
|
|
272
254
|
args: [{
|
|
273
255
|
selector: '[tuiDropdown]:not(ng-container):not(ng-template)',
|
|
@@ -284,9 +266,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
284
266
|
'[class.tui-dropdown-open]': 'ref()',
|
|
285
267
|
},
|
|
286
268
|
}]
|
|
287
|
-
}]
|
|
288
|
-
type: Input
|
|
289
|
-
}] } });
|
|
269
|
+
}] });
|
|
290
270
|
|
|
291
271
|
/**
|
|
292
272
|
* @description:
|
|
@@ -300,7 +280,7 @@ class TuiDropdownComponent {
|
|
|
300
280
|
this.viewport = inject(TUI_VIEWPORT);
|
|
301
281
|
this.vvs = inject(TuiVisualViewportService);
|
|
302
282
|
this.styles$ = inject(TuiPositionService).pipe(takeWhile(() => this.directive.el.isConnected &&
|
|
303
|
-
!!this.directive.el.getBoundingClientRect().height), map((v) => (this.position === 'fixed' ? this.vvs.correct(v) : v)), map((
|
|
283
|
+
!!this.directive.el.getBoundingClientRect().height), map((v) => (this.position === 'fixed' ? this.vvs.correct(v) : v)), map((point) => this.getStyles(...point)), takeUntilDestroyed());
|
|
304
284
|
this.options = inject(TUI_DROPDOWN_OPTIONS);
|
|
305
285
|
this.directive = inject(TuiDropdownDirective);
|
|
306
286
|
this.context = inject(TUI_DROPDOWN_CONTEXT, { optional: true });
|
|
@@ -339,14 +319,14 @@ class TuiDropdownComponent {
|
|
|
339
319
|
maxWidth: tuiPx(Math.round(viewport.width) - 16), // 8px min gap from each side
|
|
340
320
|
};
|
|
341
321
|
}
|
|
342
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
343
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
322
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
323
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownComponent, isStandalone: true, selector: "tui-dropdown", host: { properties: { "attr.data-appearance": "options.appearance", "attr.tuiTheme": "theme()" } }, providers: [
|
|
344
324
|
TuiPositionService,
|
|
345
325
|
tuiPositionAccessorFor('dropdown', TuiDropdownPosition),
|
|
346
326
|
tuiRectAccessorFor('dropdown', forwardRef(() => TuiDropdownDirective)),
|
|
347
|
-
], hostDirectives: [{ directive: i1.TuiActiveZone }, { directive: i2.TuiAnimated }], ngImport: i0, template: "<tui-scrollbar class=\"t-scroll\">\n <div\n *polymorpheusOutlet=\"directive.
|
|
327
|
+
], hostDirectives: [{ directive: i1.TuiActiveZone }, { directive: i2.TuiAnimated }], ngImport: i0, template: "<tui-scrollbar class=\"t-scroll\">\n <div\n *polymorpheusOutlet=\"directive.content() as text; context: {$implicit: close}\"\n class=\"t-primitive\"\n >\n {{ text }}\n </div>\n</tui-scrollbar>\n", styles: [":host{position:absolute;display:flex;box-shadow:var(--tui-shadow-medium);color:var(--tui-text-primary);background:var(--tui-background-elevation-3);border-radius:var(--tui-radius-m);overflow:hidden;border:1px solid var(--tui-border-normal);box-sizing:border-box;isolation:isolate;pointer-events:auto;--tui-from: translateY(-1rem)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}:host:not([style*=top]){visibility:hidden}.t-scroll{flex-grow:1;max-inline-size:100%;inline-size:max-content;overscroll-behavior:none}.t-primitive{padding:1rem}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: TuiScrollbar, selector: "tui-scrollbar" }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
|
348
328
|
}
|
|
349
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
329
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownComponent, decorators: [{
|
|
350
330
|
type: Component,
|
|
351
331
|
args: [{ selector: 'tui-dropdown', imports: [PolymorpheusOutlet, TuiScrollbar], changeDetection: ChangeDetectionStrategy.Default, providers: [
|
|
352
332
|
TuiPositionService,
|
|
@@ -355,25 +335,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
355
335
|
], hostDirectives: [TuiActiveZone, TuiAnimated], host: {
|
|
356
336
|
'[attr.data-appearance]': 'options.appearance',
|
|
357
337
|
'[attr.tuiTheme]': 'theme()',
|
|
358
|
-
}, template: "<tui-scrollbar class=\"t-scroll\">\n <div\n *polymorpheusOutlet=\"directive.
|
|
338
|
+
}, template: "<tui-scrollbar class=\"t-scroll\">\n <div\n *polymorpheusOutlet=\"directive.content() as text; context: {$implicit: close}\"\n class=\"t-primitive\"\n >\n {{ text }}\n </div>\n</tui-scrollbar>\n", styles: [":host{position:absolute;display:flex;box-shadow:var(--tui-shadow-medium);color:var(--tui-text-primary);background:var(--tui-background-elevation-3);border-radius:var(--tui-radius-m);overflow:hidden;border:1px solid var(--tui-border-normal);box-sizing:border-box;isolation:isolate;pointer-events:auto;--tui-from: translateY(-1rem)}:host.tui-enter,:host.tui-leave{animation-name:tuiFade,tuiSlide}:host:not([style*=top]){visibility:hidden}.t-scroll{flex-grow:1;max-inline-size:100%;inline-size:max-content;overscroll-behavior:none}.t-primitive{padding:1rem}\n"] }]
|
|
359
339
|
}] });
|
|
360
340
|
|
|
361
341
|
class TuiDropdownContent {
|
|
362
342
|
constructor() {
|
|
363
343
|
this.directive = inject(TuiDropdownDirective);
|
|
364
|
-
this.directive.tuiDropdown
|
|
344
|
+
tuiSetSignal(this.directive.tuiDropdown, inject(TemplateRef));
|
|
365
345
|
if (isPlatformBrowser(inject(PLATFORM_ID)) &&
|
|
366
346
|
this.directive.el.matches(':focus-within')) {
|
|
367
347
|
this.directive.toggle(true);
|
|
368
348
|
}
|
|
369
349
|
}
|
|
370
350
|
ngOnDestroy() {
|
|
371
|
-
this.directive.tuiDropdown
|
|
351
|
+
tuiSetSignal(this.directive.tuiDropdown, null);
|
|
372
352
|
}
|
|
373
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
374
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
353
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
354
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownContent, isStandalone: true, selector: "ng-template[tuiDropdown]", ngImport: i0 }); }
|
|
375
355
|
}
|
|
376
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContent, decorators: [{
|
|
377
357
|
type: Directive,
|
|
378
358
|
args: [{
|
|
379
359
|
selector: 'ng-template[tuiDropdown]',
|
|
@@ -409,8 +389,8 @@ class TuiDropdownContext extends TuiRectAccessor {
|
|
|
409
389
|
this.currentRect = tuiPointToClientRect(x, y);
|
|
410
390
|
this.driver.next(true);
|
|
411
391
|
}
|
|
412
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
413
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContext, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
393
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownContext, isStandalone: true, selector: "[tuiDropdownContext]", host: { listeners: { "document:keydown.esc": "closeDropdown()", "longtap": "onContextMenu($event.detail.clientX, $event.detail.clientY)" }, properties: { "style.user-select": "userSelect()", "style.-webkit-user-select": "userSelect()", "style.-webkit-touch-callout": "userSelect()" } }, providers: [
|
|
414
394
|
TuiActiveZone,
|
|
415
395
|
TuiDropdownDriver,
|
|
416
396
|
tuiAsDriver(TuiDropdownDriver),
|
|
@@ -420,7 +400,7 @@ class TuiDropdownContext extends TuiRectAccessor {
|
|
|
420
400
|
__decorate([
|
|
421
401
|
shouldCall(activeZoneFilter)
|
|
422
402
|
], TuiDropdownContext.prototype, "closeDropdown", null);
|
|
423
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContext, decorators: [{
|
|
424
404
|
type: Directive,
|
|
425
405
|
args: [{
|
|
426
406
|
selector: '[tuiDropdownContext]',
|
|
@@ -448,48 +428,40 @@ const TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS = {
|
|
|
448
428
|
/**
|
|
449
429
|
* Default parameters for dropdown hover directive
|
|
450
430
|
*/
|
|
451
|
-
const TUI_DROPDOWN_HOVER_OPTIONS =
|
|
452
|
-
factory: () => TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS,
|
|
453
|
-
});
|
|
454
|
-
function tuiDropdownHoverOptionsProvider(options) {
|
|
455
|
-
return tuiProvideOptions(TUI_DROPDOWN_HOVER_OPTIONS, options, TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS);
|
|
456
|
-
}
|
|
431
|
+
const [TUI_DROPDOWN_HOVER_OPTIONS, tuiDropdownHoverOptionsProvider] = tuiCreateOptions(TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS);
|
|
457
432
|
|
|
458
433
|
function shouldClose(event) {
|
|
459
434
|
return (
|
|
460
435
|
// @ts-ignore
|
|
461
436
|
typeof CloseWatcher === 'undefined' &&
|
|
462
|
-
// ?. for
|
|
437
|
+
// ?. for autofill events
|
|
463
438
|
event.key?.toLowerCase() === 'escape' &&
|
|
464
|
-
this.
|
|
465
|
-
|
|
439
|
+
this.enabled() &&
|
|
440
|
+
this.open() &&
|
|
466
441
|
!this['dropdown']()?.nextElementSibling);
|
|
467
442
|
}
|
|
468
443
|
class TuiDropdownOpen {
|
|
469
444
|
constructor() {
|
|
445
|
+
this.dropdownHost = contentChild('tuiDropdownHost', {
|
|
446
|
+
descendants: true,
|
|
447
|
+
read: ElementRef,
|
|
448
|
+
});
|
|
470
449
|
this.directive = inject(TuiDropdownDirective);
|
|
471
450
|
this.el = tuiInjectElement();
|
|
472
451
|
this.obscured = inject(TuiObscured);
|
|
473
452
|
this.activeZone = inject(TuiActiveZone);
|
|
474
|
-
this.dropdown = computed(() => this.directive.ref()?.location.nativeElement);
|
|
475
|
-
this.tuiDropdownEnabled = true;
|
|
476
|
-
this.tuiDropdownOpen = false;
|
|
477
|
-
this.tuiDropdownOpenChange = new EventEmitter();
|
|
478
|
-
// TODO: make it private when all legacy controls will be deleted from @taiga-ui/legacy (5.0)
|
|
479
453
|
this.driver = inject(TuiDropdownDriver);
|
|
480
|
-
this.
|
|
454
|
+
this.dropdown = computed(() => this.directive.ref()?.location.nativeElement);
|
|
455
|
+
this.enabled = input(true, { alias: 'tuiDropdownEnabled' });
|
|
456
|
+
this.open = model(false, { alias: 'tuiDropdownOpen' });
|
|
457
|
+
this.driveEffect = effect(() => this.drive(this.open()));
|
|
458
|
+
this.syncSub = this.driver
|
|
459
|
+
.pipe(filter((open) => open !== this.open()), takeUntilDestroyed())
|
|
460
|
+
.subscribe((open) => this.update(open));
|
|
461
|
+
this.closeSub = this.driver
|
|
481
462
|
.pipe(tuiIfMap(() => merge(tuiCloseWatcher(), this.obscured.tuiObscured$.pipe(filter(Boolean)), this.activeZone.tuiActiveZoneChange.pipe(filter((a) => !a)), fromEvent(this.el, 'focusin').pipe(filter((event) => !this.host.contains(tuiGetActualTarget(event)) ||
|
|
482
463
|
!this.directive.ref())))), tuiZonefull(), tuiWatch(), takeUntilDestroyed())
|
|
483
464
|
.subscribe(() => this.toggle(false));
|
|
484
|
-
this.sync = this.driver.pipe(takeUntilDestroyed()).subscribe((open) => {
|
|
485
|
-
if (open !== this.tuiDropdownOpen) {
|
|
486
|
-
this.update(open);
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
}
|
|
490
|
-
ngOnChanges() {
|
|
491
|
-
this.drive(!!this.tuiDropdownOpen);
|
|
492
|
-
this.tuiDropdownOpenChange.emit(!!this.tuiDropdownOpen);
|
|
493
465
|
}
|
|
494
466
|
toggle(open) {
|
|
495
467
|
if (this.focused && !open) {
|
|
@@ -503,14 +475,14 @@ class TuiDropdownOpen {
|
|
|
503
475
|
}
|
|
504
476
|
onClick(target) {
|
|
505
477
|
if (!this.editable && this.host.contains(target)) {
|
|
506
|
-
this.update(!this.
|
|
478
|
+
this.update(!this.open());
|
|
507
479
|
}
|
|
508
480
|
}
|
|
509
481
|
onArrow(event, up) {
|
|
510
482
|
if (!tuiIsElement(event.target) ||
|
|
511
483
|
!this.host.contains(event.target) ||
|
|
512
|
-
!this.
|
|
513
|
-
!this.directive.
|
|
484
|
+
!this.enabled() ||
|
|
485
|
+
!this.directive.content()) {
|
|
514
486
|
return;
|
|
515
487
|
}
|
|
516
488
|
event.preventDefault();
|
|
@@ -528,11 +500,11 @@ class TuiDropdownOpen {
|
|
|
528
500
|
}
|
|
529
501
|
}
|
|
530
502
|
get host() {
|
|
531
|
-
const initial = this.dropdownHost?.nativeElement || this.el;
|
|
532
|
-
const focusable =
|
|
503
|
+
const initial = this.dropdownHost()?.nativeElement || this.el;
|
|
504
|
+
const focusable = tuiIsFocusable(initial)
|
|
533
505
|
? initial
|
|
534
506
|
: tuiGetClosestFocusable({ initial, root: this.el });
|
|
535
|
-
return this.dropdownHost?.nativeElement || focusable || this.el;
|
|
507
|
+
return this.dropdownHost()?.nativeElement || focusable || this.el;
|
|
536
508
|
}
|
|
537
509
|
get editable() {
|
|
538
510
|
return tuiIsElementEditable(this.host);
|
|
@@ -541,14 +513,13 @@ class TuiDropdownOpen {
|
|
|
541
513
|
return tuiIsFocusedIn(this.host) || tuiIsFocusedIn(this.dropdown());
|
|
542
514
|
}
|
|
543
515
|
update(open) {
|
|
544
|
-
if (open && !this.
|
|
516
|
+
if (open && !this.enabled()) {
|
|
545
517
|
return this.drive();
|
|
546
518
|
}
|
|
547
|
-
this.
|
|
548
|
-
this.tuiDropdownOpenChange.emit(open);
|
|
519
|
+
this.open.set(open);
|
|
549
520
|
this.drive();
|
|
550
521
|
}
|
|
551
|
-
drive(open =
|
|
522
|
+
drive(open = this.open() && this.enabled()) {
|
|
552
523
|
tuiSetSignal(this.obscured.tuiObscuredEnabled, open);
|
|
553
524
|
this.driver.next(open);
|
|
554
525
|
}
|
|
@@ -565,16 +536,16 @@ class TuiDropdownOpen {
|
|
|
565
536
|
child.remove();
|
|
566
537
|
focusable?.focus();
|
|
567
538
|
}
|
|
568
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
569
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
539
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
540
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.17", type: TuiDropdownOpen, isStandalone: true, selector: "[tuiDropdown][tuiDropdownAuto],[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]", inputs: { enabled: { classPropertyName: "enabled", publicName: "tuiDropdownEnabled", isSignal: true, isRequired: false, transformFunction: null }, open: { classPropertyName: "open", publicName: "tuiDropdownOpen", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "tuiDropdownOpenChange" }, host: { listeners: { "click": "onClick($event.target)", "keydown.arrowDown": "onArrow($event, false)", "keydown.arrowUp": "onArrow($event, true)", "document:keydown.zoneless.capture": "onEsc($event)", "document:keydown.zoneless": "onKeydown($event)", "tuiActiveZoneChange": "0" } }, providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)], queries: [{ propertyName: "dropdownHost", first: true, predicate: ["tuiDropdownHost"], descendants: true, read: ElementRef, isSignal: true }], hostDirectives: [{ directive: i1$1.TuiObscured }, { directive: i1.TuiActiveZone, inputs: ["tuiActiveZoneParent", "tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange", "tuiActiveZoneChange"] }], ngImport: i0 }); }
|
|
570
541
|
}
|
|
571
542
|
__decorate([
|
|
572
543
|
shouldCall(shouldClose)
|
|
573
544
|
], TuiDropdownOpen.prototype, "onEsc", null);
|
|
574
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
545
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOpen, decorators: [{
|
|
575
546
|
type: Directive,
|
|
576
547
|
args: [{
|
|
577
|
-
selector: '[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]',
|
|
548
|
+
selector: '[tuiDropdown][tuiDropdownAuto],[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]',
|
|
578
549
|
providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)],
|
|
579
550
|
hostDirectives: [
|
|
580
551
|
TuiObscured,
|
|
@@ -594,37 +565,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
594
565
|
'(tuiActiveZoneChange)': '0',
|
|
595
566
|
},
|
|
596
567
|
}]
|
|
597
|
-
}], propDecorators: {
|
|
598
|
-
type: ContentChild,
|
|
599
|
-
args: ['tuiDropdownHost', { descendants: true, read: ElementRef }]
|
|
600
|
-
}], tuiDropdownEnabled: [{
|
|
601
|
-
type: Input
|
|
602
|
-
}], tuiDropdownOpen: [{
|
|
603
|
-
type: Input
|
|
604
|
-
}], tuiDropdownOpenChange: [{
|
|
605
|
-
type: Output
|
|
606
|
-
}], onEsc: [] } });
|
|
568
|
+
}], propDecorators: { onEsc: [] } });
|
|
607
569
|
|
|
608
570
|
class TuiDropdownHover extends TuiDriver {
|
|
609
571
|
constructor() {
|
|
610
572
|
super((subscriber) => this.stream$.subscribe(subscriber));
|
|
573
|
+
this.dropdownHost = contentChild('tuiDropdownHost', {
|
|
574
|
+
descendants: true,
|
|
575
|
+
read: ElementRef,
|
|
576
|
+
});
|
|
577
|
+
this.hovered = false;
|
|
611
578
|
this.el = tuiInjectElement();
|
|
612
579
|
this.doc = inject(DOCUMENT);
|
|
613
580
|
this.options = inject(TUI_DROPDOWN_HOVER_OPTIONS);
|
|
614
581
|
this.activeZone = inject(TuiActiveZone);
|
|
615
582
|
this.open = inject(TuiDropdownOpen, { optional: true });
|
|
583
|
+
this.stream$ = merge(
|
|
616
584
|
/**
|
|
617
585
|
* Dropdown can be removed not only via click/touch –
|
|
618
586
|
* swipe on mobile devices removes dropdown sheet without triggering new mouseover / mouseout events.
|
|
619
587
|
*/
|
|
620
|
-
|
|
621
|
-
this.stream$ = merge(this.dropdownExternalRemoval$.pipe(switchMap(() => tuiTypedFromEvent(this.doc, 'pointerdown').pipe(map(tuiGetActualTarget), delay(this.hideDelay), startWith(null), takeUntil(fromEvent(this.doc, 'mouseover'))))), tuiTypedFromEvent(this.doc, 'mouseover').pipe(map(tuiGetActualTarget)), tuiTypedFromEvent(this.doc, 'mouseout').pipe(map((e) => e.relatedTarget))).pipe(map((element) => tuiIsElement(element) && this.isHovered(element)), distinctUntilChanged(), switchMap((v) => of(v).pipe(delay(v ? this.showDelay : this.hideDelay))), tuiZoneOptimized(), tap((hovered) => {
|
|
588
|
+
toObservable(inject(TuiDropdownDirective).ref).pipe(filter((x) => !x && this.hovered), switchMap(() => tuiTypedFromEvent(this.doc, 'pointerdown').pipe(map(tuiGetActualTarget), delay(this.tuiDropdownHideDelay()), startWith(null), takeUntil(fromEvent(this.doc, 'mouseover'))))), tuiTypedFromEvent(this.doc, 'mouseover').pipe(map(tuiGetActualTarget)), tuiTypedFromEvent(this.doc, 'mouseout').pipe(map((e) => e.relatedTarget))).pipe(map((element) => tuiIsElement(element) && this.isHovered(element)), distinctUntilChanged(), switchMap((v) => of(v).pipe(delay(v ? this.tuiDropdownShowDelay() : this.tuiDropdownHideDelay()))), tuiZoneOptimized(), tap((hovered) => {
|
|
622
589
|
this.hovered = hovered;
|
|
623
590
|
this.open?.toggle(hovered);
|
|
624
591
|
}), share());
|
|
625
|
-
this.
|
|
626
|
-
this.
|
|
627
|
-
this.hovered = false;
|
|
592
|
+
this.tuiDropdownShowDelay = input(this.options.showDelay);
|
|
593
|
+
this.tuiDropdownHideDelay = input(this.options.hideDelay);
|
|
628
594
|
this.type = 'dropdown';
|
|
629
595
|
}
|
|
630
596
|
onClick(event) {
|
|
@@ -633,15 +599,15 @@ class TuiDropdownHover extends TuiDriver {
|
|
|
633
599
|
}
|
|
634
600
|
}
|
|
635
601
|
isHovered(element) {
|
|
636
|
-
const host = this.dropdownHost?.nativeElement || this.el;
|
|
602
|
+
const host = this.dropdownHost()?.nativeElement || this.el;
|
|
637
603
|
const hovered = host.contains(element);
|
|
638
604
|
const child = !this.el.contains(element) && this.activeZone.contains(element);
|
|
639
605
|
return hovered || child;
|
|
640
606
|
}
|
|
641
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
642
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
607
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownHover, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
608
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.2.17", type: TuiDropdownHover, isStandalone: true, selector: "[tuiDropdownHover]", inputs: { tuiDropdownShowDelay: { classPropertyName: "tuiDropdownShowDelay", publicName: "tuiDropdownShowDelay", isSignal: true, isRequired: false, transformFunction: null }, tuiDropdownHideDelay: { classPropertyName: "tuiDropdownHideDelay", publicName: "tuiDropdownHideDelay", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click.capture": "onClick($event)" } }, providers: [TuiActiveZone, tuiAsDriver(TuiDropdownHover)], queries: [{ propertyName: "dropdownHost", first: true, predicate: ["tuiDropdownHost"], descendants: true, read: ElementRef, isSignal: true }], usesInheritance: true, ngImport: i0 }); }
|
|
643
609
|
}
|
|
644
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
610
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownHover, decorators: [{
|
|
645
611
|
type: Directive,
|
|
646
612
|
args: [{
|
|
647
613
|
selector: '[tuiDropdownHover]',
|
|
@@ -650,65 +616,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
650
616
|
'(click.capture)': 'onClick($event)',
|
|
651
617
|
},
|
|
652
618
|
}]
|
|
653
|
-
}], ctorParameters: () => []
|
|
654
|
-
type: ContentChild,
|
|
655
|
-
args: ['tuiDropdownHost', { descendants: true, read: ElementRef }]
|
|
656
|
-
}], showDelay: [{
|
|
657
|
-
type: Input,
|
|
658
|
-
args: ['tuiDropdownShowDelay']
|
|
659
|
-
}], hideDelay: [{
|
|
660
|
-
type: Input,
|
|
661
|
-
args: ['tuiDropdownHideDelay']
|
|
662
|
-
}] } });
|
|
619
|
+
}], ctorParameters: () => [] });
|
|
663
620
|
|
|
664
621
|
class TuiDropdownManual {
|
|
665
622
|
constructor() {
|
|
666
623
|
this.driver = inject(TuiDropdownDriver);
|
|
667
|
-
this.tuiDropdownManual = false;
|
|
624
|
+
this.tuiDropdownManual = input(false);
|
|
668
625
|
}
|
|
669
626
|
ngOnChanges() {
|
|
670
|
-
this.driver.next(!!this.tuiDropdownManual);
|
|
627
|
+
this.driver.next(!!this.tuiDropdownManual());
|
|
671
628
|
}
|
|
672
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
673
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
629
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownManual, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
630
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiDropdownManual, isStandalone: true, selector: "[tuiDropdownManual]", inputs: { tuiDropdownManual: { classPropertyName: "tuiDropdownManual", publicName: "tuiDropdownManual", isSignal: true, isRequired: false, transformFunction: null } }, providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)], usesOnChanges: true, ngImport: i0 }); }
|
|
674
631
|
}
|
|
675
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
632
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownManual, decorators: [{
|
|
676
633
|
type: Directive,
|
|
677
634
|
args: [{
|
|
678
635
|
selector: '[tuiDropdownManual]',
|
|
679
636
|
providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)],
|
|
680
637
|
}]
|
|
681
|
-
}]
|
|
682
|
-
type: Input
|
|
683
|
-
}] } });
|
|
684
|
-
|
|
685
|
-
/**
|
|
686
|
-
* @deprecated TODO: remove in v.5 when legacy controls are dropped
|
|
687
|
-
*/
|
|
688
|
-
class TuiDropdownOpenLegacy {
|
|
689
|
-
constructor() {
|
|
690
|
-
this.openStateSub = new Subject();
|
|
691
|
-
this.tuiDropdownOpenChange = this.openStateSub.pipe(distinctUntilChanged());
|
|
692
|
-
}
|
|
693
|
-
set tuiDropdownOpen(open) {
|
|
694
|
-
this.emitOpenChange(open);
|
|
695
|
-
}
|
|
696
|
-
emitOpenChange(open) {
|
|
697
|
-
this.openStateSub.next(open);
|
|
698
|
-
}
|
|
699
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownOpenLegacy, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
700
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiDropdownOpenLegacy, isStandalone: true, selector: "[tuiDropdownOpen]:not([tuiDropdown]),[tuiDropdownOpenChange]:not([tuiDropdown])", inputs: { tuiDropdownOpen: "tuiDropdownOpen" }, outputs: { tuiDropdownOpenChange: "tuiDropdownOpenChange" }, ngImport: i0 }); }
|
|
701
|
-
}
|
|
702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownOpenLegacy, decorators: [{
|
|
703
|
-
type: Directive,
|
|
704
|
-
args: [{
|
|
705
|
-
selector: '[tuiDropdownOpen]:not([tuiDropdown]),[tuiDropdownOpenChange]:not([tuiDropdown])',
|
|
706
|
-
}]
|
|
707
|
-
}], propDecorators: { tuiDropdownOpenChange: [{
|
|
708
|
-
type: Output
|
|
709
|
-
}], tuiDropdownOpen: [{
|
|
710
|
-
type: Input
|
|
711
|
-
}] } });
|
|
638
|
+
}] });
|
|
712
639
|
|
|
713
640
|
class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
714
641
|
constructor() {
|
|
@@ -717,12 +644,12 @@ class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
|
717
644
|
this.viewport = inject(TUI_VIEWPORT);
|
|
718
645
|
this.vertical = inject(TuiDropdownPosition);
|
|
719
646
|
this.previous = this.options.direction || 'bottom';
|
|
720
|
-
this.tuiDropdownSided = '';
|
|
721
|
-
this.tuiDropdownSidedOffset = 4;
|
|
647
|
+
this.tuiDropdownSided = input('');
|
|
648
|
+
this.tuiDropdownSidedOffset = input(4);
|
|
722
649
|
this.type = 'dropdown';
|
|
723
650
|
}
|
|
724
651
|
getPosition(rect) {
|
|
725
|
-
if (this.tuiDropdownSided === false) {
|
|
652
|
+
if (this.tuiDropdownSided() === false) {
|
|
726
653
|
return this.vertical.getPosition(rect);
|
|
727
654
|
}
|
|
728
655
|
const { height, width } = rect;
|
|
@@ -738,37 +665,33 @@ class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
|
738
665
|
bottom: viewport.bottom - hostRect.top,
|
|
739
666
|
};
|
|
740
667
|
const position = {
|
|
741
|
-
top: hostRect.bottom - height + this.tuiDropdownSidedOffset + 1, // 1 for border
|
|
668
|
+
top: hostRect.bottom - height + this.tuiDropdownSidedOffset() + 1, // 1 for border
|
|
742
669
|
left: hostRect.left - width - offset,
|
|
743
670
|
right: hostRect.right + offset,
|
|
744
|
-
bottom: hostRect.top - this.tuiDropdownSidedOffset - 1, // 1 for border
|
|
671
|
+
bottom: hostRect.top - this.tuiDropdownSidedOffset() - 1, // 1 for border
|
|
745
672
|
};
|
|
746
673
|
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
747
674
|
const maxLeft = available.left > available.right ? position.left : position.right;
|
|
748
675
|
const left = available[align] > width ? position[align] : maxLeft;
|
|
749
676
|
if ((available[this.previous] > height && direction) ||
|
|
750
677
|
this.previous === better) {
|
|
751
|
-
this.vertical.
|
|
752
|
-
return [position[this.previous]
|
|
678
|
+
this.vertical.direction.next(this.previous);
|
|
679
|
+
return [left, position[this.previous]];
|
|
753
680
|
}
|
|
754
681
|
this.previous = better;
|
|
755
|
-
this.vertical.
|
|
756
|
-
return [position[better]
|
|
682
|
+
this.vertical.direction.next(better);
|
|
683
|
+
return [left, position[better]];
|
|
757
684
|
}
|
|
758
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
759
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
685
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPositionSided, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
686
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiDropdownPositionSided, isStandalone: true, selector: "[tuiDropdownSided]", inputs: { tuiDropdownSided: { classPropertyName: "tuiDropdownSided", publicName: "tuiDropdownSided", isSignal: true, isRequired: false, transformFunction: null }, tuiDropdownSidedOffset: { classPropertyName: "tuiDropdownSidedOffset", publicName: "tuiDropdownSidedOffset", isSignal: true, isRequired: false, transformFunction: null } }, providers: [TuiDropdownPosition, tuiAsPositionAccessor(TuiDropdownPositionSided)], usesInheritance: true, ngImport: i0 }); }
|
|
760
687
|
}
|
|
761
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
688
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPositionSided, decorators: [{
|
|
762
689
|
type: Directive,
|
|
763
690
|
args: [{
|
|
764
691
|
selector: '[tuiDropdownSided]',
|
|
765
692
|
providers: [TuiDropdownPosition, tuiAsPositionAccessor(TuiDropdownPositionSided)],
|
|
766
693
|
}]
|
|
767
|
-
}]
|
|
768
|
-
type: Input
|
|
769
|
-
}], tuiDropdownSidedOffset: [{
|
|
770
|
-
type: Input
|
|
771
|
-
}] } });
|
|
694
|
+
}] });
|
|
772
695
|
|
|
773
696
|
class TuiDropdownSelection extends TuiDriver {
|
|
774
697
|
constructor() {
|
|
@@ -777,9 +700,9 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
777
700
|
this.vcr = inject(ViewContainerRef);
|
|
778
701
|
this.dropdown = inject(TuiDropdownDirective);
|
|
779
702
|
this.el = tuiInjectElement();
|
|
780
|
-
this.handler
|
|
703
|
+
this.handler = computed((visible = this.tuiDropdownSelection()) => tuiIsString(visible) ? TUI_TRUE_HANDLER : visible);
|
|
781
704
|
this.stream$ = combineLatest([
|
|
782
|
-
this.handler
|
|
705
|
+
toObservable(this.handler),
|
|
783
706
|
inject(TUI_SELECTION_STREAM).pipe(map(() => this.getRange()), filter((range) => this.isValid(range)), distinctUntilChanged((x, y) => x.startOffset === y.startOffset &&
|
|
784
707
|
x.endOffset === y.endOffset &&
|
|
785
708
|
x.commonAncestorContainer === y.commonAncestorContainer)),
|
|
@@ -791,17 +714,15 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
791
714
|
: this.range;
|
|
792
715
|
return (contained && handler(this.range)) || this.inDropdown(range);
|
|
793
716
|
}));
|
|
794
|
-
this.range = inject(
|
|
795
|
-
|
|
717
|
+
this.range = isPlatformBrowser(inject(PLATFORM_ID))
|
|
718
|
+
? new Range()
|
|
719
|
+
: {};
|
|
796
720
|
this.type = 'dropdown';
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
if (!tuiIsString(visible)) {
|
|
800
|
-
this.handler$.next(visible);
|
|
801
|
-
}
|
|
721
|
+
this.tuiDropdownSelection = input('');
|
|
722
|
+
this.tuiDropdownSelectionPosition = input('selection');
|
|
802
723
|
}
|
|
803
724
|
getClientRect() {
|
|
804
|
-
switch (this.
|
|
725
|
+
switch (this.tuiDropdownSelectionPosition()) {
|
|
805
726
|
case 'tag': {
|
|
806
727
|
const { commonAncestorContainer } = this.range;
|
|
807
728
|
const element = tuiIsElement(commonAncestorContainer)
|
|
@@ -892,13 +813,13 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
892
813
|
this.ghost = ghost;
|
|
893
814
|
return ghost;
|
|
894
815
|
}
|
|
895
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
896
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
816
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSelection, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
817
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiDropdownSelection, isStandalone: true, selector: "[tuiDropdownSelection]", inputs: { tuiDropdownSelection: { classPropertyName: "tuiDropdownSelection", publicName: "tuiDropdownSelection", isSignal: true, isRequired: false, transformFunction: null }, tuiDropdownSelectionPosition: { classPropertyName: "tuiDropdownSelectionPosition", publicName: "tuiDropdownSelectionPosition", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
897
818
|
tuiAsDriver(TuiDropdownSelection),
|
|
898
819
|
tuiAsRectAccessor(TuiDropdownSelection),
|
|
899
820
|
], usesInheritance: true, ngImport: i0 }); }
|
|
900
821
|
}
|
|
901
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
822
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSelection, decorators: [{
|
|
902
823
|
type: Directive,
|
|
903
824
|
args: [{
|
|
904
825
|
selector: '[tuiDropdownSelection]',
|
|
@@ -907,12 +828,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
907
828
|
tuiAsRectAccessor(TuiDropdownSelection),
|
|
908
829
|
],
|
|
909
830
|
}]
|
|
910
|
-
}], ctorParameters: () => []
|
|
911
|
-
type: Input,
|
|
912
|
-
args: ['tuiDropdownSelectionPosition']
|
|
913
|
-
}], tuiDropdownSelection: [{
|
|
914
|
-
type: Input
|
|
915
|
-
}] } });
|
|
831
|
+
}], ctorParameters: () => [] });
|
|
916
832
|
|
|
917
833
|
const TuiDropdown = [
|
|
918
834
|
TuiDropdownOptionsDirective,
|
|
@@ -920,7 +836,6 @@ const TuiDropdown = [
|
|
|
920
836
|
TuiDropdownDirective,
|
|
921
837
|
TuiDropdownComponent,
|
|
922
838
|
TuiDropdownOpen,
|
|
923
|
-
TuiDropdownOpenLegacy,
|
|
924
839
|
TuiDropdownManual,
|
|
925
840
|
TuiDropdownHover,
|
|
926
841
|
TuiDropdownContent,
|
|
@@ -934,14 +849,7 @@ function tuiDropdown(value) {
|
|
|
934
849
|
return tuiDirectiveBinding(TuiDropdownDirective, 'tuiDropdown', value, {});
|
|
935
850
|
}
|
|
936
851
|
function tuiDropdownEnabled(value) {
|
|
937
|
-
return tuiDirectiveBinding(TuiDropdownOpen, '
|
|
938
|
-
}
|
|
939
|
-
function tuiDropdownOpen() {
|
|
940
|
-
const open = tuiDirectiveBinding(TuiDropdownOpen, 'tuiDropdownOpen', false, {});
|
|
941
|
-
inject(TuiDropdownOpen)
|
|
942
|
-
.tuiDropdownOpenChange.pipe(takeUntilDestroyed())
|
|
943
|
-
.subscribe((value) => open.set(value));
|
|
944
|
-
return open;
|
|
852
|
+
return tuiDirectiveBinding(TuiDropdownOpen, 'enabled', value, {});
|
|
945
853
|
}
|
|
946
854
|
|
|
947
855
|
class TuiDropdownFixed {
|
|
@@ -949,10 +857,10 @@ class TuiDropdownFixed {
|
|
|
949
857
|
const override = tuiOverrideOptions$1({ limitWidth: 'fixed' }, TUI_DROPDOWN_DEFAULT_OPTIONS);
|
|
950
858
|
override(inject(TUI_DROPDOWN_OPTIONS, { self: true, optional: true }), null);
|
|
951
859
|
}
|
|
952
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
953
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
860
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownFixed, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
861
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownFixed, isStandalone: true, providers: [tuiDropdownOptionsProvider({})], ngImport: i0 }); }
|
|
954
862
|
}
|
|
955
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
863
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownFixed, decorators: [{
|
|
956
864
|
type: Directive,
|
|
957
865
|
args: [{
|
|
958
866
|
providers: [tuiDropdownOptionsProvider({})],
|
|
@@ -966,18 +874,18 @@ class TuiDropdownAuto {
|
|
|
966
874
|
*/
|
|
967
875
|
inject(TUI_DROPDOWN_OPTIONS).limitWidth = 'auto';
|
|
968
876
|
}
|
|
969
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
970
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
877
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownAuto, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
878
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownAuto, isStandalone: true, ngImport: i0 }); }
|
|
971
879
|
}
|
|
972
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
880
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownAuto, decorators: [{
|
|
973
881
|
type: Directive
|
|
974
882
|
}], ctorParameters: () => [] });
|
|
975
883
|
|
|
976
884
|
class TuiWithDropdownOpen {
|
|
977
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
978
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
885
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithDropdownOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
886
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiWithDropdownOpen, isStandalone: true, hostDirectives: [{ directive: TuiDropdownOpen, inputs: ["tuiDropdownOpen", "open", "tuiDropdownEnabled", "tuiDropdownEnabled"], outputs: ["tuiDropdownOpenChange", "openChange"] }], ngImport: i0 }); }
|
|
979
887
|
}
|
|
980
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
888
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithDropdownOpen, decorators: [{
|
|
981
889
|
type: Directive,
|
|
982
890
|
args: [{
|
|
983
891
|
hostDirectives: [
|
|
@@ -994,5 +902,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
994
902
|
* Generated bundle index. Do not edit.
|
|
995
903
|
*/
|
|
996
904
|
|
|
997
|
-
export { TUI_DROPDOWN_COMPONENT, TUI_DROPDOWN_CONTEXT, TUI_DROPDOWN_DEFAULT_OPTIONS, TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS, TUI_DROPDOWN_HOVER_OPTIONS, TUI_DROPDOWN_OPTIONS, TuiDropdown, TuiDropdownAuto, TuiDropdownComponent, TuiDropdownContent, TuiDropdownContext, TuiDropdownDirective, TuiDropdownDriver, TuiDropdownDriverDirective, TuiDropdownFixed, TuiDropdownHover, TuiDropdownManual, TuiDropdownOpen,
|
|
998
|
-
//# sourceMappingURL=taiga-ui-core-
|
|
905
|
+
export { TUI_DROPDOWN_COMPONENT, TUI_DROPDOWN_CONTEXT, TUI_DROPDOWN_DEFAULT_OPTIONS, TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS, TUI_DROPDOWN_HOVER_OPTIONS, TUI_DROPDOWN_OPTIONS, TuiDropdown, TuiDropdownAuto, TuiDropdownComponent, TuiDropdownContent, TuiDropdownContext, TuiDropdownDirective, TuiDropdownDriver, TuiDropdownDriverDirective, TuiDropdownFixed, TuiDropdownHover, TuiDropdownManual, TuiDropdownOpen, TuiDropdownOptionsDirective, TuiDropdownPosition, TuiDropdownPositionSided, TuiDropdownSelection, TuiWithDropdownOpen, tuiDropdown, tuiDropdownEnabled, tuiDropdownHoverOptionsProvider, tuiDropdownOptionsProvider };
|
|
906
|
+
//# sourceMappingURL=taiga-ui-core-portals-dropdown.mjs.map
|