@taiga-ui/core 4.52.0-canary.ec0802b → 4.52.0-canary.efbd0d4
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/classes/accessors.d.ts +1 -1
- package/components/calendar/calendar-sheet.component.d.ts +1 -1
- 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 +2 -4
- 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/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 -2
- package/components/input/index.d.ts +2 -0
- package/components/input/input.d.ts +5 -0
- package/components/input/input.directive.d.ts +29 -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/notification/notification.component.d.ts +1 -1
- package/components/notification/notification.directive.d.ts +1 -1
- package/components/notification/notification.options.d.ts +4 -3
- package/components/notification/notification.service.d.ts +1 -1
- 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 +8 -13
- package/components/textfield/textfield.component.d.ts +20 -32
- package/components/textfield/textfield.d.ts +2 -3
- package/directives/group/group.directive.d.ts +7 -7
- 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 +7 -7
- package/fesm2022/taiga-ui-core-components-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-calendar.mjs +135 -26
- 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 +98 -233
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +12 -11
- 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 +9 -9
- 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 +11 -13
- package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +13 -24
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +4 -4
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +27 -29
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +7 -9
- 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 +6 -6
- package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-textfield.mjs +99 -254
- 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} +8 -8
- 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 -2
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +16 -15
- 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 +20 -28
- package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs +12 -11
- 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-directives-alert.mjs → taiga-ui-core-portals-alert.mjs} +12 -12
- package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-portals-dialog.mjs +158 -0
- 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} +160 -264
- 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} +62 -61
- package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-portals-modal.mjs +89 -0
- 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 +15 -79
- package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs +34 -49
- 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 +19 -19
- 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 +62 -87
- package/pipes/format-number/format-number.pipe.d.ts +1 -1
- package/pipes/index.d.ts +0 -7
- 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-manual.directive.d.ts +2 -2
- package/portals/dropdown/dropdown-open.directive.d.ts +30 -0
- package/{directives → portals}/dropdown/dropdown-options.directive.d.ts +0 -4
- 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 +3 -3
- package/{directives → portals}/hint/hint.directive.d.ts +1 -1
- package/portals/index.d.ts +6 -0
- package/services/index.d.ts +0 -3
- package/styles/components/appearance.less +5 -0
- package/styles/components/button.less +10 -20
- package/styles/components/icon.less +11 -0
- package/styles/components/icons.less +2 -1
- package/styles/components/label.less +3 -12
- package/styles/components/link.less +8 -24
- package/styles/components/notification.less +21 -22
- package/styles/components/textfield.less +129 -211
- package/styles/components/title.less +8 -8
- package/styles/mixins/appearance.less +9 -25
- package/styles/mixins/appearance.scss +8 -24
- package/styles/mixins/date-picker.less +1 -1
- package/styles/mixins/picker.less +1 -1
- package/styles/mixins/picker.scss +1 -1
- package/styles/mixins/slider.less +1 -1
- package/styles/mixins/slider.scss +2 -3
- package/styles/taiga-ui-local.less +0 -1
- package/styles/taiga-ui-local.scss +0 -1
- package/styles/taiga-ui-theme.less +0 -1
- package/styles/theme/appearance/outline.less +9 -18
- package/styles/theme/appearance/primary.less +2 -4
- package/styles/theme/appearance/secondary.less +6 -14
- package/styles/theme/appearance/status.less +0 -4
- package/styles/theme/appearance/table.less +36 -35
- package/styles/theme/appearance/textfield.less +30 -27
- package/styles/theme/appearance.less +0 -1
- package/styles/theme/variables.less +16 -17
- package/tokens/breakpoint.d.ts +4 -0
- package/tokens/common-icons.d.ts +2 -0
- package/tokens/icons.d.ts +0 -4
- package/tokens/index.d.ts +1 -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/font-scaling.d.ts +2 -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/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 -26
- package/components/link/link.options.d.ts +0 -10
- 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/fesm2022/taiga-ui-core-animations.mjs +0 -370
- package/fesm2022/taiga-ui-core-animations.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs +0 -158
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-modal.mjs +0 -89
- package/fesm2022/taiga-ui-core-components-modal.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-alert.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-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/breakpoint.service.d.ts +0 -16
- package/services/dark-theme.service.d.ts +0 -10
- package/services/format-date.service.d.ts +0 -8
- package/styles/mixins/wrapper.less +0 -64
- package/styles/mixins/wrapper.scss +0 -61
- package/styles/theme/appearance/opposite.less +0 -17
- package/styles/theme/wrapper.less +0 -211
- 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/{directives → portals}/alert/alert.directive.d.ts +0 -0
- /package/{directives → portals}/alert/alert.service.d.ts +0 -0
- /package/{directives → portals}/alert/index.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-hover.options.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-limit-width.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.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,
|
|
3
|
-
import { takeUntilDestroyed, toObservable } from '@angular/core/rxjs-interop';
|
|
2
|
+
import { Injectable, Directive, InjectionToken, Optional, Self, SkipSelf, inject, 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,36 +8,36 @@ 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/
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
20
|
+
import { TuiPopupService } from '@taiga-ui/core/portals/popup';
|
|
21
|
+
import { tuiCheckFixedPosition, tuiGetWordRange } from '@taiga-ui/core/utils/dom';
|
|
22
|
+
import { tuiProvide, tuiCreateOptions, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/di';
|
|
23
|
+
import { tuiOverrideOptions, tuiIsEditingKey } from '@taiga-ui/core/utils/miscellaneous';
|
|
23
24
|
import { isPlatformBrowser, DOCUMENT } from '@angular/common';
|
|
24
|
-
import {
|
|
25
|
+
import { __decorate } from 'tslib';
|
|
26
|
+
import { TUI_IS_TOUCH } from '@taiga-ui/cdk/tokens';
|
|
25
27
|
import { shouldCall } from '@taiga-ui/event-plugins';
|
|
26
|
-
import { tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
27
28
|
import * as i1$1 from '@taiga-ui/cdk/directives/obscured';
|
|
28
29
|
import { TuiObscured } from '@taiga-ui/cdk/directives/obscured';
|
|
29
|
-
import {
|
|
30
|
-
import { tuiIsEditingKey, tuiOverrideOptions as tuiOverrideOptions$1 } from '@taiga-ui/core/utils/miscellaneous';
|
|
30
|
+
import { tuiIsFocusable, tuiGetClosestFocusable, tuiIsFocusedIn, tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
31
31
|
|
|
32
32
|
class TuiDropdownDriver extends BehaviorSubject {
|
|
33
33
|
constructor() {
|
|
34
34
|
super(false);
|
|
35
35
|
this.type = 'dropdown';
|
|
36
36
|
}
|
|
37
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
38
|
-
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 }); }
|
|
39
39
|
}
|
|
40
|
-
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: [{
|
|
41
41
|
type: Injectable
|
|
42
42
|
}], ctorParameters: () => [] });
|
|
43
43
|
class TuiDropdownDriverDirective extends TuiDriverDirective {
|
|
@@ -45,10 +45,10 @@ class TuiDropdownDriverDirective extends TuiDriverDirective {
|
|
|
45
45
|
super(...arguments);
|
|
46
46
|
this.type = 'dropdown';
|
|
47
47
|
}
|
|
48
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
49
|
-
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 }); }
|
|
50
50
|
}
|
|
51
|
-
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: [{
|
|
52
52
|
type: Directive
|
|
53
53
|
}] });
|
|
54
54
|
|
|
@@ -60,7 +60,6 @@ const TUI_DROPDOWN_COMPONENT = new InjectionToken(ngDevMode ? 'TUI_DROPDOWN_COMP
|
|
|
60
60
|
});
|
|
61
61
|
const TUI_DROPDOWN_CONTEXT = new InjectionToken(ngDevMode ? 'TUI_DROPDOWN_CONTEXT' : '');
|
|
62
62
|
|
|
63
|
-
/** Default values for dropdown options */
|
|
64
63
|
const TUI_DROPDOWN_DEFAULT_OPTIONS = {
|
|
65
64
|
align: 'left',
|
|
66
65
|
direction: null,
|
|
@@ -70,9 +69,6 @@ const TUI_DROPDOWN_DEFAULT_OPTIONS = {
|
|
|
70
69
|
offset: 4,
|
|
71
70
|
appearance: '',
|
|
72
71
|
};
|
|
73
|
-
/**
|
|
74
|
-
* Default parameters for dropdown directive
|
|
75
|
-
*/
|
|
76
72
|
const TUI_DROPDOWN_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_DROPDOWN_OPTIONS' : '', {
|
|
77
73
|
factory: () => TUI_DROPDOWN_DEFAULT_OPTIONS,
|
|
78
74
|
});
|
|
@@ -95,37 +91,25 @@ class TuiDropdownOptionsDirective {
|
|
|
95
91
|
this.maxHeight = this.options.maxHeight;
|
|
96
92
|
this.offset = this.options.offset;
|
|
97
93
|
}
|
|
98
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
99
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
94
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOptionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
95
|
+
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 }); }
|
|
100
96
|
}
|
|
101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOptionsDirective, decorators: [{
|
|
102
98
|
type: Directive,
|
|
103
99
|
args: [{
|
|
104
100
|
selector: '[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]',
|
|
101
|
+
inputs: [
|
|
102
|
+
'align: tuiDropdownAlign',
|
|
103
|
+
'appearance: tuiDropdownAppearance',
|
|
104
|
+
'direction: tuiDropdownDirection',
|
|
105
|
+
'limitWidth: tuiDropdownLimitWidth',
|
|
106
|
+
'minHeight: tuiDropdownMinHeight',
|
|
107
|
+
'maxHeight: tuiDropdownMaxHeight',
|
|
108
|
+
'offset: tuiDropdownOffset',
|
|
109
|
+
],
|
|
105
110
|
providers: [tuiProvide(TUI_DROPDOWN_OPTIONS, TuiDropdownOptionsDirective)],
|
|
106
111
|
}]
|
|
107
|
-
}]
|
|
108
|
-
type: Input,
|
|
109
|
-
args: ['tuiDropdownAlign']
|
|
110
|
-
}], appearance: [{
|
|
111
|
-
type: Input,
|
|
112
|
-
args: ['tuiDropdownAppearance']
|
|
113
|
-
}], direction: [{
|
|
114
|
-
type: Input,
|
|
115
|
-
args: ['tuiDropdownDirection']
|
|
116
|
-
}], limitWidth: [{
|
|
117
|
-
type: Input,
|
|
118
|
-
args: ['tuiDropdownLimitWidth']
|
|
119
|
-
}], minHeight: [{
|
|
120
|
-
type: Input,
|
|
121
|
-
args: ['tuiDropdownMinHeight']
|
|
122
|
-
}], maxHeight: [{
|
|
123
|
-
type: Input,
|
|
124
|
-
args: ['tuiDropdownMaxHeight']
|
|
125
|
-
}], offset: [{
|
|
126
|
-
type: Input,
|
|
127
|
-
args: ['tuiDropdownOffset']
|
|
128
|
-
}] } });
|
|
112
|
+
}] });
|
|
129
113
|
|
|
130
114
|
class TuiDropdownPosition extends TuiPositionAccessor {
|
|
131
115
|
constructor() {
|
|
@@ -133,14 +117,10 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
133
117
|
this.el = tuiInjectElement();
|
|
134
118
|
this.options = inject(TUI_DROPDOWN_OPTIONS);
|
|
135
119
|
this.viewport = inject(TUI_VIEWPORT);
|
|
136
|
-
this.
|
|
120
|
+
this.direction = new Subject();
|
|
137
121
|
this.type = 'dropdown';
|
|
138
|
-
this.accessor = tuiFallbackAccessor('dropdown')(inject(TuiRectAccessor, { optional: true }), {
|
|
139
|
-
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
emitDirection(direction) {
|
|
143
|
-
this.directionChange.emit(direction);
|
|
122
|
+
this.accessor = tuiFallbackAccessor('dropdown')(inject(TuiRectAccessor, { optional: true }), { getClientRect: () => this.el.getBoundingClientRect() });
|
|
123
|
+
this.tuiDropdownDirectionChange = outputFromObservable(this.direction.pipe(distinctUntilChanged()));
|
|
144
124
|
}
|
|
145
125
|
getPosition({ width, height }) {
|
|
146
126
|
if (!width && !height) {
|
|
@@ -176,12 +156,12 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
176
156
|
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
177
157
|
if ((available[previous] > minHeight && direction) ||
|
|
178
158
|
available[previous] > height) {
|
|
179
|
-
this.
|
|
180
|
-
return [position[
|
|
159
|
+
this.direction.next(previous);
|
|
160
|
+
return [position[align], position[previous]];
|
|
181
161
|
}
|
|
182
162
|
this.previous = better;
|
|
183
|
-
this.
|
|
184
|
-
return [position[
|
|
163
|
+
this.direction.next(better);
|
|
164
|
+
return [position[align], position[better]];
|
|
185
165
|
}
|
|
186
166
|
getAlign(align) {
|
|
187
167
|
const rtl = this.el.matches('[dir="rtl"] :scope');
|
|
@@ -190,25 +170,18 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
190
170
|
}
|
|
191
171
|
return rtl && align === 'right' ? 'left' : align;
|
|
192
172
|
}
|
|
193
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
194
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
173
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPosition, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
174
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownPosition, isStandalone: true, outputs: { tuiDropdownDirectionChange: "tuiDropdownDirectionChange" }, usesInheritance: true, ngImport: i0 }); }
|
|
195
175
|
}
|
|
196
|
-
|
|
197
|
-
tuiPure
|
|
198
|
-
], TuiDropdownPosition.prototype, "emitDirection", null);
|
|
199
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownPosition, decorators: [{
|
|
176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPosition, decorators: [{
|
|
200
177
|
type: Directive
|
|
201
|
-
}]
|
|
202
|
-
type: Output,
|
|
203
|
-
args: ['tuiDropdownDirectionChange']
|
|
204
|
-
}], emitDirection: [] } });
|
|
178
|
+
}] });
|
|
205
179
|
|
|
206
180
|
class TuiDropdownDirective {
|
|
207
181
|
constructor() {
|
|
208
182
|
this.refresh$ = new Subject();
|
|
209
183
|
this.service = inject(TuiPopupService);
|
|
210
184
|
this.cdr = inject(ChangeDetectorRef);
|
|
211
|
-
// TODO: think of a better solution later
|
|
212
185
|
this.drivers = coerceArray(inject(TuiDropdownDriver, { self: true, optional: true }));
|
|
213
186
|
this.sub = this.refresh$
|
|
214
187
|
.pipe(throttleTime(0, tuiZonefreeScheduler()), takeUntilDestroyed())
|
|
@@ -216,33 +189,25 @@ class TuiDropdownDirective {
|
|
|
216
189
|
this.ref()?.changeDetectorRef.detectChanges();
|
|
217
190
|
this.ref()?.changeDetectorRef.markForCheck();
|
|
218
191
|
});
|
|
192
|
+
this.autoClose = effect(() => {
|
|
193
|
+
if (!this.content()) {
|
|
194
|
+
this.toggle(false);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
this.ref = signal(null);
|
|
219
198
|
this.el = tuiInjectElement();
|
|
220
199
|
this.type = 'dropdown';
|
|
221
200
|
this.component = new PolymorpheusComponent(inject(TUI_DROPDOWN_COMPONENT), inject(INJECTOR));
|
|
222
|
-
this.
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
this._content.set(content instanceof TemplateRef
|
|
229
|
-
? new PolymorpheusTemplate(content, this.cdr)
|
|
230
|
-
: content);
|
|
231
|
-
if (!this._content()) {
|
|
232
|
-
this.toggle(false);
|
|
233
|
-
}
|
|
201
|
+
this.tuiDropdown = input();
|
|
202
|
+
this.content = computed((content = this.tuiDropdown()) => {
|
|
203
|
+
return content instanceof TemplateRef
|
|
204
|
+
? new PolymorpheusTemplate(content, this.cdr)
|
|
205
|
+
: content;
|
|
206
|
+
});
|
|
234
207
|
}
|
|
235
208
|
get position() {
|
|
236
209
|
return tuiCheckFixedPosition(this.el) ? 'fixed' : 'absolute';
|
|
237
210
|
}
|
|
238
|
-
// TODO(v5): delete
|
|
239
|
-
get content() {
|
|
240
|
-
return this._content();
|
|
241
|
-
}
|
|
242
|
-
// TODO(v5): delete
|
|
243
|
-
set content(x) {
|
|
244
|
-
this._content.set(x);
|
|
245
|
-
}
|
|
246
211
|
ngAfterViewChecked() {
|
|
247
212
|
this.refresh$.next();
|
|
248
213
|
}
|
|
@@ -254,21 +219,21 @@ class TuiDropdownDirective {
|
|
|
254
219
|
}
|
|
255
220
|
toggle(show) {
|
|
256
221
|
const ref = this.ref();
|
|
257
|
-
if (show && this.
|
|
222
|
+
if (show && this.content() && !ref) {
|
|
258
223
|
this.ref.set(this.service.add(this.component));
|
|
259
224
|
}
|
|
260
225
|
else if (!show && ref) {
|
|
261
226
|
this.ref.set(null);
|
|
262
227
|
ref.destroy();
|
|
263
228
|
}
|
|
264
|
-
this.drivers.forEach((driver) => driver?.next(show));
|
|
265
229
|
// TODO: Remove in v5, only needed in Angular 16
|
|
266
230
|
this.cdr.markForCheck();
|
|
231
|
+
this.drivers.forEach((driver) => driver?.next(show));
|
|
267
232
|
}
|
|
268
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
269
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
233
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
234
|
+
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 }); }
|
|
270
235
|
}
|
|
271
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
236
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDirective, decorators: [{
|
|
272
237
|
type: Directive,
|
|
273
238
|
args: [{
|
|
274
239
|
selector: '[tuiDropdown]:not(ng-container):not(ng-template)',
|
|
@@ -285,9 +250,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
285
250
|
'[class.tui-dropdown-open]': 'ref()',
|
|
286
251
|
},
|
|
287
252
|
}]
|
|
288
|
-
}]
|
|
289
|
-
type: Input
|
|
290
|
-
}] } });
|
|
253
|
+
}] });
|
|
291
254
|
|
|
292
255
|
/**
|
|
293
256
|
* @description:
|
|
@@ -301,7 +264,7 @@ class TuiDropdownComponent {
|
|
|
301
264
|
this.viewport = inject(TUI_VIEWPORT);
|
|
302
265
|
this.vvs = inject(TuiVisualViewportService);
|
|
303
266
|
this.styles$ = inject(TuiPositionService).pipe(takeWhile(() => this.directive.el.isConnected &&
|
|
304
|
-
!!this.directive.el.getBoundingClientRect().height), map((v) => (this.position === 'fixed' ? this.vvs.correct(v) : v)), map((
|
|
267
|
+
!!this.directive.el.getBoundingClientRect().height), map((v) => (this.position === 'fixed' ? this.vvs.correct(v) : v)), map((point) => this.getStyles(...point)), takeUntilDestroyed());
|
|
305
268
|
this.options = inject(TUI_DROPDOWN_OPTIONS);
|
|
306
269
|
this.directive = inject(TuiDropdownDirective);
|
|
307
270
|
this.context = inject(TUI_DROPDOWN_CONTEXT, { optional: true });
|
|
@@ -340,14 +303,14 @@ class TuiDropdownComponent {
|
|
|
340
303
|
maxWidth: tuiPx(Math.round(viewport.width) - 16), // 8px min gap from each side
|
|
341
304
|
};
|
|
342
305
|
}
|
|
343
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
344
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
306
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
307
|
+
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: [
|
|
345
308
|
TuiPositionService,
|
|
346
309
|
tuiPositionAccessorFor('dropdown', TuiDropdownPosition),
|
|
347
310
|
tuiRectAccessorFor('dropdown', forwardRef(() => TuiDropdownDirective)),
|
|
348
|
-
], hostDirectives: [{ directive: i1.TuiActiveZone }, { directive: i2.TuiAnimated }], ngImport: i0, template: "<tui-scrollbar class=\"t-scroll\">\n <div\n *polymorpheusOutlet=\"directive.
|
|
311
|
+
], 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 }); }
|
|
349
312
|
}
|
|
350
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
313
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownComponent, decorators: [{
|
|
351
314
|
type: Component,
|
|
352
315
|
args: [{ selector: 'tui-dropdown', imports: [PolymorpheusOutlet, TuiScrollbar], changeDetection: ChangeDetectionStrategy.Default, providers: [
|
|
353
316
|
TuiPositionService,
|
|
@@ -356,25 +319,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
356
319
|
], hostDirectives: [TuiActiveZone, TuiAnimated], host: {
|
|
357
320
|
'[attr.data-appearance]': 'options.appearance',
|
|
358
321
|
'[attr.tuiTheme]': 'theme()',
|
|
359
|
-
}, template: "<tui-scrollbar class=\"t-scroll\">\n <div\n *polymorpheusOutlet=\"directive.
|
|
322
|
+
}, 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"] }]
|
|
360
323
|
}] });
|
|
361
324
|
|
|
362
325
|
class TuiDropdownContent {
|
|
363
326
|
constructor() {
|
|
364
327
|
this.directive = inject(TuiDropdownDirective);
|
|
365
|
-
this.directive.tuiDropdown
|
|
328
|
+
tuiSetSignal(this.directive.tuiDropdown, inject(TemplateRef));
|
|
366
329
|
if (isPlatformBrowser(inject(PLATFORM_ID)) &&
|
|
367
330
|
this.directive.el.matches(':focus-within')) {
|
|
368
331
|
this.directive.toggle(true);
|
|
369
332
|
}
|
|
370
333
|
}
|
|
371
334
|
ngOnDestroy() {
|
|
372
|
-
this.directive.tuiDropdown
|
|
335
|
+
tuiSetSignal(this.directive.tuiDropdown, null);
|
|
373
336
|
}
|
|
374
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
375
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
337
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
338
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownContent, isStandalone: true, selector: "ng-template[tuiDropdown]", ngImport: i0 }); }
|
|
376
339
|
}
|
|
377
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContent, decorators: [{
|
|
378
341
|
type: Directive,
|
|
379
342
|
args: [{
|
|
380
343
|
selector: 'ng-template[tuiDropdown]',
|
|
@@ -410,8 +373,8 @@ class TuiDropdownContext extends TuiRectAccessor {
|
|
|
410
373
|
this.currentRect = tuiPointToClientRect(x, y);
|
|
411
374
|
this.driver.next(true);
|
|
412
375
|
}
|
|
413
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
414
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
376
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContext, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
377
|
+
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: [
|
|
415
378
|
TuiActiveZone,
|
|
416
379
|
TuiDropdownDriver,
|
|
417
380
|
tuiAsDriver(TuiDropdownDriver),
|
|
@@ -421,7 +384,7 @@ class TuiDropdownContext extends TuiRectAccessor {
|
|
|
421
384
|
__decorate([
|
|
422
385
|
shouldCall(activeZoneFilter)
|
|
423
386
|
], TuiDropdownContext.prototype, "closeDropdown", null);
|
|
424
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContext, decorators: [{
|
|
425
388
|
type: Directive,
|
|
426
389
|
args: [{
|
|
427
390
|
selector: '[tuiDropdownContext]',
|
|
@@ -455,37 +418,34 @@ function shouldClose(event) {
|
|
|
455
418
|
return (
|
|
456
419
|
// @ts-ignore
|
|
457
420
|
typeof CloseWatcher === 'undefined' &&
|
|
458
|
-
// ?. for
|
|
421
|
+
// ?. for autofill events
|
|
459
422
|
event.key?.toLowerCase() === 'escape' &&
|
|
460
|
-
this.
|
|
461
|
-
|
|
423
|
+
this.enabled() &&
|
|
424
|
+
this.open() &&
|
|
462
425
|
!this['dropdown']()?.nextElementSibling);
|
|
463
426
|
}
|
|
464
427
|
class TuiDropdownOpen {
|
|
465
428
|
constructor() {
|
|
429
|
+
this.dropdownHost = contentChild('tuiDropdownHost', {
|
|
430
|
+
descendants: true,
|
|
431
|
+
read: ElementRef,
|
|
432
|
+
});
|
|
466
433
|
this.directive = inject(TuiDropdownDirective);
|
|
467
434
|
this.el = tuiInjectElement();
|
|
468
435
|
this.obscured = inject(TuiObscured);
|
|
469
436
|
this.activeZone = inject(TuiActiveZone);
|
|
470
|
-
this.dropdown = computed(() => this.directive.ref()?.location.nativeElement);
|
|
471
|
-
this.tuiDropdownEnabled = true;
|
|
472
|
-
this.tuiDropdownOpen = false;
|
|
473
|
-
this.tuiDropdownOpenChange = new EventEmitter();
|
|
474
|
-
// TODO: make it private when all legacy controls will be deleted from @taiga-ui/legacy (5.0)
|
|
475
437
|
this.driver = inject(TuiDropdownDriver);
|
|
476
|
-
this.
|
|
438
|
+
this.dropdown = computed(() => this.directive.ref()?.location.nativeElement);
|
|
439
|
+
this.enabled = input(true, { alias: 'tuiDropdownEnabled' });
|
|
440
|
+
this.open = model(false, { alias: 'tuiDropdownOpen' });
|
|
441
|
+
this.driveEffect = effect(() => this.drive(this.open()));
|
|
442
|
+
this.syncSub = this.driver
|
|
443
|
+
.pipe(filter((open) => open !== this.open()), takeUntilDestroyed())
|
|
444
|
+
.subscribe((open) => this.update(open));
|
|
445
|
+
this.closeSub = this.driver
|
|
477
446
|
.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)) ||
|
|
478
447
|
!this.directive.ref())))), tuiZonefull(), tuiWatch(), takeUntilDestroyed())
|
|
479
448
|
.subscribe(() => this.toggle(false));
|
|
480
|
-
this.sync = this.driver.pipe(takeUntilDestroyed()).subscribe((open) => {
|
|
481
|
-
if (open !== this.tuiDropdownOpen) {
|
|
482
|
-
this.update(open);
|
|
483
|
-
}
|
|
484
|
-
});
|
|
485
|
-
}
|
|
486
|
-
ngOnChanges() {
|
|
487
|
-
this.drive(!!this.tuiDropdownOpen);
|
|
488
|
-
this.tuiDropdownOpenChange.emit(!!this.tuiDropdownOpen);
|
|
489
449
|
}
|
|
490
450
|
toggle(open) {
|
|
491
451
|
if (this.focused && !open) {
|
|
@@ -499,14 +459,14 @@ class TuiDropdownOpen {
|
|
|
499
459
|
}
|
|
500
460
|
onClick(target) {
|
|
501
461
|
if (!this.editable && this.host.contains(target)) {
|
|
502
|
-
this.update(!this.
|
|
462
|
+
this.update(!this.open());
|
|
503
463
|
}
|
|
504
464
|
}
|
|
505
465
|
onArrow(event, up) {
|
|
506
466
|
if (!tuiIsElement(event.target) ||
|
|
507
467
|
!this.host.contains(event.target) ||
|
|
508
|
-
!this.
|
|
509
|
-
!this.directive.
|
|
468
|
+
!this.enabled() ||
|
|
469
|
+
!this.directive.content()) {
|
|
510
470
|
return;
|
|
511
471
|
}
|
|
512
472
|
event.preventDefault();
|
|
@@ -524,11 +484,11 @@ class TuiDropdownOpen {
|
|
|
524
484
|
}
|
|
525
485
|
}
|
|
526
486
|
get host() {
|
|
527
|
-
const initial = this.dropdownHost?.nativeElement || this.el;
|
|
528
|
-
const focusable =
|
|
487
|
+
const initial = this.dropdownHost()?.nativeElement || this.el;
|
|
488
|
+
const focusable = tuiIsFocusable(initial)
|
|
529
489
|
? initial
|
|
530
490
|
: tuiGetClosestFocusable({ initial, root: this.el });
|
|
531
|
-
return this.dropdownHost?.nativeElement || focusable || this.el;
|
|
491
|
+
return this.dropdownHost()?.nativeElement || focusable || this.el;
|
|
532
492
|
}
|
|
533
493
|
get editable() {
|
|
534
494
|
return tuiIsElementEditable(this.host);
|
|
@@ -537,14 +497,13 @@ class TuiDropdownOpen {
|
|
|
537
497
|
return tuiIsFocusedIn(this.host) || tuiIsFocusedIn(this.dropdown());
|
|
538
498
|
}
|
|
539
499
|
update(open) {
|
|
540
|
-
if (open && !this.
|
|
500
|
+
if (open && !this.enabled()) {
|
|
541
501
|
return this.drive();
|
|
542
502
|
}
|
|
543
|
-
this.
|
|
544
|
-
this.tuiDropdownOpenChange.emit(open);
|
|
503
|
+
this.open.set(open);
|
|
545
504
|
this.drive();
|
|
546
505
|
}
|
|
547
|
-
drive(open =
|
|
506
|
+
drive(open = this.open() && this.enabled()) {
|
|
548
507
|
tuiSetSignal(this.obscured.tuiObscuredEnabled, open);
|
|
549
508
|
this.driver.next(open);
|
|
550
509
|
}
|
|
@@ -561,16 +520,16 @@ class TuiDropdownOpen {
|
|
|
561
520
|
child.remove();
|
|
562
521
|
focusable?.focus();
|
|
563
522
|
}
|
|
564
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
565
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
523
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
524
|
+
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 }); }
|
|
566
525
|
}
|
|
567
526
|
__decorate([
|
|
568
527
|
shouldCall(shouldClose)
|
|
569
528
|
], TuiDropdownOpen.prototype, "onEsc", null);
|
|
570
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOpen, decorators: [{
|
|
571
530
|
type: Directive,
|
|
572
531
|
args: [{
|
|
573
|
-
selector: '[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]',
|
|
532
|
+
selector: '[tuiDropdown][tuiDropdownAuto],[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]',
|
|
574
533
|
providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)],
|
|
575
534
|
hostDirectives: [
|
|
576
535
|
TuiObscured,
|
|
@@ -590,37 +549,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
590
549
|
'(tuiActiveZoneChange)': '0',
|
|
591
550
|
},
|
|
592
551
|
}]
|
|
593
|
-
}], propDecorators: {
|
|
594
|
-
type: ContentChild,
|
|
595
|
-
args: ['tuiDropdownHost', { descendants: true, read: ElementRef }]
|
|
596
|
-
}], tuiDropdownEnabled: [{
|
|
597
|
-
type: Input
|
|
598
|
-
}], tuiDropdownOpen: [{
|
|
599
|
-
type: Input
|
|
600
|
-
}], tuiDropdownOpenChange: [{
|
|
601
|
-
type: Output
|
|
602
|
-
}], onEsc: [] } });
|
|
552
|
+
}], propDecorators: { onEsc: [] } });
|
|
603
553
|
|
|
604
554
|
class TuiDropdownHover extends TuiDriver {
|
|
605
555
|
constructor() {
|
|
606
556
|
super((subscriber) => this.stream$.subscribe(subscriber));
|
|
557
|
+
this.dropdownHost = contentChild('tuiDropdownHost', {
|
|
558
|
+
descendants: true,
|
|
559
|
+
read: ElementRef,
|
|
560
|
+
});
|
|
561
|
+
this.hovered = false;
|
|
607
562
|
this.el = tuiInjectElement();
|
|
608
563
|
this.doc = inject(DOCUMENT);
|
|
609
564
|
this.options = inject(TUI_DROPDOWN_HOVER_OPTIONS);
|
|
610
565
|
this.activeZone = inject(TuiActiveZone);
|
|
611
566
|
this.open = inject(TuiDropdownOpen, { optional: true });
|
|
567
|
+
this.stream$ = merge(
|
|
612
568
|
/**
|
|
613
569
|
* Dropdown can be removed not only via click/touch –
|
|
614
570
|
* swipe on mobile devices removes dropdown sheet without triggering new mouseover / mouseout events.
|
|
615
571
|
*/
|
|
616
|
-
|
|
617
|
-
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) => {
|
|
572
|
+
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) => {
|
|
618
573
|
this.hovered = hovered;
|
|
619
574
|
this.open?.toggle(hovered);
|
|
620
575
|
}), share());
|
|
621
|
-
this.
|
|
622
|
-
this.
|
|
623
|
-
this.hovered = false;
|
|
576
|
+
this.tuiDropdownShowDelay = input(this.options.showDelay);
|
|
577
|
+
this.tuiDropdownHideDelay = input(this.options.hideDelay);
|
|
624
578
|
this.type = 'dropdown';
|
|
625
579
|
}
|
|
626
580
|
onClick(event) {
|
|
@@ -629,15 +583,15 @@ class TuiDropdownHover extends TuiDriver {
|
|
|
629
583
|
}
|
|
630
584
|
}
|
|
631
585
|
isHovered(element) {
|
|
632
|
-
const host = this.dropdownHost?.nativeElement || this.el;
|
|
586
|
+
const host = this.dropdownHost()?.nativeElement || this.el;
|
|
633
587
|
const hovered = host.contains(element);
|
|
634
588
|
const child = !this.el.contains(element) && this.activeZone.contains(element);
|
|
635
589
|
return hovered || child;
|
|
636
590
|
}
|
|
637
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
638
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
591
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownHover, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
592
|
+
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 }); }
|
|
639
593
|
}
|
|
640
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
594
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownHover, decorators: [{
|
|
641
595
|
type: Directive,
|
|
642
596
|
args: [{
|
|
643
597
|
selector: '[tuiDropdownHover]',
|
|
@@ -646,65 +600,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
646
600
|
'(click.capture)': 'onClick($event)',
|
|
647
601
|
},
|
|
648
602
|
}]
|
|
649
|
-
}], ctorParameters: () => []
|
|
650
|
-
type: ContentChild,
|
|
651
|
-
args: ['tuiDropdownHost', { descendants: true, read: ElementRef }]
|
|
652
|
-
}], showDelay: [{
|
|
653
|
-
type: Input,
|
|
654
|
-
args: ['tuiDropdownShowDelay']
|
|
655
|
-
}], hideDelay: [{
|
|
656
|
-
type: Input,
|
|
657
|
-
args: ['tuiDropdownHideDelay']
|
|
658
|
-
}] } });
|
|
603
|
+
}], ctorParameters: () => [] });
|
|
659
604
|
|
|
660
605
|
class TuiDropdownManual {
|
|
661
606
|
constructor() {
|
|
662
607
|
this.driver = inject(TuiDropdownDriver);
|
|
663
|
-
this.tuiDropdownManual = false;
|
|
608
|
+
this.tuiDropdownManual = input(false);
|
|
664
609
|
}
|
|
665
610
|
ngOnChanges() {
|
|
666
|
-
this.driver.next(!!this.tuiDropdownManual);
|
|
611
|
+
this.driver.next(!!this.tuiDropdownManual());
|
|
667
612
|
}
|
|
668
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
669
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
613
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownManual, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
614
|
+
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 }); }
|
|
670
615
|
}
|
|
671
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
616
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownManual, decorators: [{
|
|
672
617
|
type: Directive,
|
|
673
618
|
args: [{
|
|
674
619
|
selector: '[tuiDropdownManual]',
|
|
675
620
|
providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)],
|
|
676
621
|
}]
|
|
677
|
-
}]
|
|
678
|
-
type: Input
|
|
679
|
-
}] } });
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* @deprecated TODO: remove in v.5 when legacy controls are dropped
|
|
683
|
-
*/
|
|
684
|
-
class TuiDropdownOpenLegacy {
|
|
685
|
-
constructor() {
|
|
686
|
-
this.openStateSub = new Subject();
|
|
687
|
-
this.tuiDropdownOpenChange = this.openStateSub.pipe(distinctUntilChanged());
|
|
688
|
-
}
|
|
689
|
-
set tuiDropdownOpen(open) {
|
|
690
|
-
this.emitOpenChange(open);
|
|
691
|
-
}
|
|
692
|
-
emitOpenChange(open) {
|
|
693
|
-
this.openStateSub.next(open);
|
|
694
|
-
}
|
|
695
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownOpenLegacy, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
696
|
-
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 }); }
|
|
697
|
-
}
|
|
698
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownOpenLegacy, decorators: [{
|
|
699
|
-
type: Directive,
|
|
700
|
-
args: [{
|
|
701
|
-
selector: '[tuiDropdownOpen]:not([tuiDropdown]),[tuiDropdownOpenChange]:not([tuiDropdown])',
|
|
702
|
-
}]
|
|
703
|
-
}], propDecorators: { tuiDropdownOpenChange: [{
|
|
704
|
-
type: Output
|
|
705
|
-
}], tuiDropdownOpen: [{
|
|
706
|
-
type: Input
|
|
707
|
-
}] } });
|
|
622
|
+
}] });
|
|
708
623
|
|
|
709
624
|
class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
710
625
|
constructor() {
|
|
@@ -713,12 +628,12 @@ class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
|
713
628
|
this.viewport = inject(TUI_VIEWPORT);
|
|
714
629
|
this.vertical = inject(TuiDropdownPosition);
|
|
715
630
|
this.previous = this.options.direction || 'bottom';
|
|
716
|
-
this.tuiDropdownSided = '';
|
|
717
|
-
this.tuiDropdownSidedOffset = 4;
|
|
631
|
+
this.tuiDropdownSided = input('');
|
|
632
|
+
this.tuiDropdownSidedOffset = input(4);
|
|
718
633
|
this.type = 'dropdown';
|
|
719
634
|
}
|
|
720
635
|
getPosition(rect) {
|
|
721
|
-
if (this.tuiDropdownSided === false) {
|
|
636
|
+
if (this.tuiDropdownSided() === false) {
|
|
722
637
|
return this.vertical.getPosition(rect);
|
|
723
638
|
}
|
|
724
639
|
const { height, width } = rect;
|
|
@@ -734,37 +649,33 @@ class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
|
734
649
|
bottom: viewport.bottom - hostRect.top,
|
|
735
650
|
};
|
|
736
651
|
const position = {
|
|
737
|
-
top: hostRect.bottom - height + this.tuiDropdownSidedOffset + 1, // 1 for border
|
|
652
|
+
top: hostRect.bottom - height + this.tuiDropdownSidedOffset() + 1, // 1 for border
|
|
738
653
|
left: hostRect.left - width - offset,
|
|
739
654
|
right: hostRect.right + offset,
|
|
740
|
-
bottom: hostRect.top - this.tuiDropdownSidedOffset - 1, // 1 for border
|
|
655
|
+
bottom: hostRect.top - this.tuiDropdownSidedOffset() - 1, // 1 for border
|
|
741
656
|
};
|
|
742
657
|
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
743
658
|
const maxLeft = available.left > available.right ? position.left : position.right;
|
|
744
659
|
const left = available[align] > width ? position[align] : maxLeft;
|
|
745
660
|
if ((available[this.previous] > height && direction) ||
|
|
746
661
|
this.previous === better) {
|
|
747
|
-
this.vertical.
|
|
748
|
-
return [position[this.previous]
|
|
662
|
+
this.vertical.direction.next(this.previous);
|
|
663
|
+
return [left, position[this.previous]];
|
|
749
664
|
}
|
|
750
665
|
this.previous = better;
|
|
751
|
-
this.vertical.
|
|
752
|
-
return [position[better]
|
|
666
|
+
this.vertical.direction.next(better);
|
|
667
|
+
return [left, position[better]];
|
|
753
668
|
}
|
|
754
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
755
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
669
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPositionSided, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
670
|
+
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 }); }
|
|
756
671
|
}
|
|
757
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPositionSided, decorators: [{
|
|
758
673
|
type: Directive,
|
|
759
674
|
args: [{
|
|
760
675
|
selector: '[tuiDropdownSided]',
|
|
761
676
|
providers: [TuiDropdownPosition, tuiAsPositionAccessor(TuiDropdownPositionSided)],
|
|
762
677
|
}]
|
|
763
|
-
}]
|
|
764
|
-
type: Input
|
|
765
|
-
}], tuiDropdownSidedOffset: [{
|
|
766
|
-
type: Input
|
|
767
|
-
}] } });
|
|
678
|
+
}] });
|
|
768
679
|
|
|
769
680
|
class TuiDropdownSelection extends TuiDriver {
|
|
770
681
|
constructor() {
|
|
@@ -773,9 +684,9 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
773
684
|
this.vcr = inject(ViewContainerRef);
|
|
774
685
|
this.dropdown = inject(TuiDropdownDirective);
|
|
775
686
|
this.el = tuiInjectElement();
|
|
776
|
-
this.handler
|
|
687
|
+
this.handler = computed((visible = this.tuiDropdownSelection()) => tuiIsString(visible) ? TUI_TRUE_HANDLER : visible);
|
|
777
688
|
this.stream$ = combineLatest([
|
|
778
|
-
this.handler
|
|
689
|
+
toObservable(this.handler),
|
|
779
690
|
inject(TUI_SELECTION_STREAM).pipe(map(() => this.getRange()), filter((range) => this.isValid(range)), distinctUntilChanged((x, y) => x.startOffset === y.startOffset &&
|
|
780
691
|
x.endOffset === y.endOffset &&
|
|
781
692
|
x.commonAncestorContainer === y.commonAncestorContainer)),
|
|
@@ -787,17 +698,15 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
787
698
|
: this.range;
|
|
788
699
|
return (contained && handler(this.range)) || this.inDropdown(range);
|
|
789
700
|
}));
|
|
790
|
-
this.range = inject(
|
|
791
|
-
|
|
701
|
+
this.range = isPlatformBrowser(inject(PLATFORM_ID))
|
|
702
|
+
? new Range()
|
|
703
|
+
: {};
|
|
792
704
|
this.type = 'dropdown';
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
if (!tuiIsString(visible)) {
|
|
796
|
-
this.handler$.next(visible);
|
|
797
|
-
}
|
|
705
|
+
this.tuiDropdownSelection = input('');
|
|
706
|
+
this.tuiDropdownSelectionPosition = input('selection');
|
|
798
707
|
}
|
|
799
708
|
getClientRect() {
|
|
800
|
-
switch (this.
|
|
709
|
+
switch (this.tuiDropdownSelectionPosition()) {
|
|
801
710
|
case 'tag': {
|
|
802
711
|
const { commonAncestorContainer } = this.range;
|
|
803
712
|
const element = tuiIsElement(commonAncestorContainer)
|
|
@@ -888,13 +797,13 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
888
797
|
this.ghost = ghost;
|
|
889
798
|
return ghost;
|
|
890
799
|
}
|
|
891
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
892
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
800
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSelection, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
801
|
+
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: [
|
|
893
802
|
tuiAsDriver(TuiDropdownSelection),
|
|
894
803
|
tuiAsRectAccessor(TuiDropdownSelection),
|
|
895
804
|
], usesInheritance: true, ngImport: i0 }); }
|
|
896
805
|
}
|
|
897
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
806
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSelection, decorators: [{
|
|
898
807
|
type: Directive,
|
|
899
808
|
args: [{
|
|
900
809
|
selector: '[tuiDropdownSelection]',
|
|
@@ -903,12 +812,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
903
812
|
tuiAsRectAccessor(TuiDropdownSelection),
|
|
904
813
|
],
|
|
905
814
|
}]
|
|
906
|
-
}], ctorParameters: () => []
|
|
907
|
-
type: Input,
|
|
908
|
-
args: ['tuiDropdownSelectionPosition']
|
|
909
|
-
}], tuiDropdownSelection: [{
|
|
910
|
-
type: Input
|
|
911
|
-
}] } });
|
|
815
|
+
}], ctorParameters: () => [] });
|
|
912
816
|
|
|
913
817
|
const TuiDropdown = [
|
|
914
818
|
TuiDropdownOptionsDirective,
|
|
@@ -916,7 +820,6 @@ const TuiDropdown = [
|
|
|
916
820
|
TuiDropdownDirective,
|
|
917
821
|
TuiDropdownComponent,
|
|
918
822
|
TuiDropdownOpen,
|
|
919
|
-
TuiDropdownOpenLegacy,
|
|
920
823
|
TuiDropdownManual,
|
|
921
824
|
TuiDropdownHover,
|
|
922
825
|
TuiDropdownContent,
|
|
@@ -930,25 +833,18 @@ function tuiDropdown(value) {
|
|
|
930
833
|
return tuiDirectiveBinding(TuiDropdownDirective, 'tuiDropdown', value, {});
|
|
931
834
|
}
|
|
932
835
|
function tuiDropdownEnabled(value) {
|
|
933
|
-
return tuiDirectiveBinding(TuiDropdownOpen, '
|
|
934
|
-
}
|
|
935
|
-
function tuiDropdownOpen() {
|
|
936
|
-
const open = tuiDirectiveBinding(TuiDropdownOpen, 'tuiDropdownOpen', false, {});
|
|
937
|
-
inject(TuiDropdownOpen)
|
|
938
|
-
.tuiDropdownOpenChange.pipe(takeUntilDestroyed())
|
|
939
|
-
.subscribe((value) => open.set(value));
|
|
940
|
-
return open;
|
|
836
|
+
return tuiDirectiveBinding(TuiDropdownOpen, 'enabled', value, {});
|
|
941
837
|
}
|
|
942
838
|
|
|
943
839
|
class TuiDropdownFixed {
|
|
944
840
|
constructor() {
|
|
945
|
-
const override = tuiOverrideOptions
|
|
841
|
+
const override = tuiOverrideOptions({ limitWidth: 'fixed' }, TUI_DROPDOWN_DEFAULT_OPTIONS);
|
|
946
842
|
override(inject(TUI_DROPDOWN_OPTIONS, { self: true, optional: true }), null);
|
|
947
843
|
}
|
|
948
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
949
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
844
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownFixed, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
845
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownFixed, isStandalone: true, providers: [tuiDropdownOptionsProvider({})], ngImport: i0 }); }
|
|
950
846
|
}
|
|
951
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
847
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownFixed, decorators: [{
|
|
952
848
|
type: Directive,
|
|
953
849
|
args: [{
|
|
954
850
|
providers: [tuiDropdownOptionsProvider({})],
|
|
@@ -962,18 +858,18 @@ class TuiDropdownAuto {
|
|
|
962
858
|
*/
|
|
963
859
|
inject(TUI_DROPDOWN_OPTIONS).limitWidth = 'auto';
|
|
964
860
|
}
|
|
965
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
966
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
861
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownAuto, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
862
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownAuto, isStandalone: true, ngImport: i0 }); }
|
|
967
863
|
}
|
|
968
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
864
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownAuto, decorators: [{
|
|
969
865
|
type: Directive
|
|
970
866
|
}], ctorParameters: () => [] });
|
|
971
867
|
|
|
972
868
|
class TuiWithDropdownOpen {
|
|
973
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
974
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
869
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithDropdownOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
870
|
+
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 }); }
|
|
975
871
|
}
|
|
976
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
872
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithDropdownOpen, decorators: [{
|
|
977
873
|
type: Directive,
|
|
978
874
|
args: [{
|
|
979
875
|
hostDirectives: [
|
|
@@ -990,5 +886,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
990
886
|
* Generated bundle index. Do not edit.
|
|
991
887
|
*/
|
|
992
888
|
|
|
993
|
-
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,
|
|
994
|
-
//# sourceMappingURL=taiga-ui-core-
|
|
889
|
+
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 };
|
|
890
|
+
//# sourceMappingURL=taiga-ui-core-portals-dropdown.mjs.map
|