@taiga-ui/core 4.52.0-canary.6ee9658 → 4.52.0-canary.763e67d
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/{textfield/textfield.directive.d.ts → input/input.directive.d.ts} +7 -8
- 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.options.d.ts +1 -1
- package/components/notification/notification.service.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-multi.component.d.ts +2 -2
- package/components/textfield/textfield.component.d.ts +3 -4
- 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 +7 -9
- 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 +94 -230
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +9 -9
- 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 +104 -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 -24
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +3 -3
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +22 -24
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +5 -5
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs +42 -47
- 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 +50 -132
- 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 -2
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +10 -10
- 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 +9 -9
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +15 -36
- 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-components-dialog.mjs → taiga-ui-core-portals-dialog.mjs} +16 -16
- 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} +149 -237
- 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} +57 -57
- 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} +10 -10
- 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 +5 -33
- 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 +37 -62
- 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-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 -2
- package/styles/components/appearance.less +5 -0
- package/styles/components/button.less +1 -1
- package/styles/components/link.less +8 -23
- package/styles/components/notification.less +4 -4
- package/styles/components/textfield.less +32 -65
- package/styles/mixins/appearance.less +9 -25
- package/styles/mixins/appearance.scss +8 -24
- package/styles/mixins/slider.scss +1 -2
- 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 +38 -31
- package/styles/theme/appearance.less +0 -1
- package/styles/theme/variables.less +15 -15
- package/tokens/common-icons.d.ts +2 -0
- 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/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/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.map +0 -1
- 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/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-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.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,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 { __decorate } from 'tslib';
|
|
20
|
+
import { TuiPopupService } from '@taiga-ui/core/portals/popup';
|
|
21
|
+
import { tuiCheckFixedPosition, tuiGetWordRange } from '@taiga-ui/core/utils/dom';
|
|
23
22
|
import { tuiProvide, tuiCreateOptions, tuiDirectiveBinding } from '@taiga-ui/cdk/utils/di';
|
|
23
|
+
import { tuiOverrideOptions, tuiIsEditingKey } from '@taiga-ui/core/utils/miscellaneous';
|
|
24
24
|
import { isPlatformBrowser, DOCUMENT } from '@angular/common';
|
|
25
|
-
import {
|
|
25
|
+
import { __decorate } from 'tslib';
|
|
26
|
+
import { TUI_IS_TOUCH } from '@taiga-ui/cdk/tokens';
|
|
26
27
|
import { shouldCall } from '@taiga-ui/event-plugins';
|
|
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
|
|
|
@@ -95,10 +95,10 @@ class TuiDropdownOptionsDirective {
|
|
|
95
95
|
this.maxHeight = this.options.maxHeight;
|
|
96
96
|
this.offset = this.options.offset;
|
|
97
97
|
}
|
|
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.
|
|
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 }); }
|
|
100
100
|
}
|
|
101
|
-
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: [{
|
|
102
102
|
type: Directive,
|
|
103
103
|
args: [{
|
|
104
104
|
selector: '[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]',
|
|
@@ -133,14 +133,10 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
133
133
|
this.el = tuiInjectElement();
|
|
134
134
|
this.options = inject(TUI_DROPDOWN_OPTIONS);
|
|
135
135
|
this.viewport = inject(TUI_VIEWPORT);
|
|
136
|
-
this.
|
|
136
|
+
this.direction = new Subject();
|
|
137
137
|
this.type = 'dropdown';
|
|
138
|
-
this.accessor = tuiFallbackAccessor('dropdown')(inject(TuiRectAccessor, { optional: true }), {
|
|
139
|
-
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
emitDirection(direction) {
|
|
143
|
-
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()));
|
|
144
140
|
}
|
|
145
141
|
getPosition({ width, height }) {
|
|
146
142
|
if (!width && !height) {
|
|
@@ -176,12 +172,12 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
176
172
|
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
177
173
|
if ((available[previous] > minHeight && direction) ||
|
|
178
174
|
available[previous] > height) {
|
|
179
|
-
this.
|
|
180
|
-
return [position[
|
|
175
|
+
this.direction.next(previous);
|
|
176
|
+
return [position[align], position[previous]];
|
|
181
177
|
}
|
|
182
178
|
this.previous = better;
|
|
183
|
-
this.
|
|
184
|
-
return [position[
|
|
179
|
+
this.direction.next(better);
|
|
180
|
+
return [position[align], position[better]];
|
|
185
181
|
}
|
|
186
182
|
getAlign(align) {
|
|
187
183
|
const rtl = this.el.matches('[dir="rtl"] :scope');
|
|
@@ -190,25 +186,18 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
190
186
|
}
|
|
191
187
|
return rtl && align === 'right' ? 'left' : align;
|
|
192
188
|
}
|
|
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.
|
|
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 }); }
|
|
195
191
|
}
|
|
196
|
-
|
|
197
|
-
tuiPure
|
|
198
|
-
], TuiDropdownPosition.prototype, "emitDirection", null);
|
|
199
|
-
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: [{
|
|
200
193
|
type: Directive
|
|
201
|
-
}]
|
|
202
|
-
type: Output,
|
|
203
|
-
args: ['tuiDropdownDirectionChange']
|
|
204
|
-
}], emitDirection: [] } });
|
|
194
|
+
}] });
|
|
205
195
|
|
|
206
196
|
class TuiDropdownDirective {
|
|
207
197
|
constructor() {
|
|
208
198
|
this.refresh$ = new Subject();
|
|
209
199
|
this.service = inject(TuiPopupService);
|
|
210
200
|
this.cdr = inject(ChangeDetectorRef);
|
|
211
|
-
// TODO: think of a better solution later
|
|
212
201
|
this.drivers = coerceArray(inject(TuiDropdownDriver, { self: true, optional: true }));
|
|
213
202
|
this.sub = this.refresh$
|
|
214
203
|
.pipe(throttleTime(0, tuiZonefreeScheduler()), takeUntilDestroyed())
|
|
@@ -216,33 +205,25 @@ class TuiDropdownDirective {
|
|
|
216
205
|
this.ref()?.changeDetectorRef.detectChanges();
|
|
217
206
|
this.ref()?.changeDetectorRef.markForCheck();
|
|
218
207
|
});
|
|
208
|
+
this.autoClose = effect(() => {
|
|
209
|
+
if (!this.content()) {
|
|
210
|
+
this.toggle(false);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
this.ref = signal(null);
|
|
219
214
|
this.el = tuiInjectElement();
|
|
220
215
|
this.type = 'dropdown';
|
|
221
216
|
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
|
-
}
|
|
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
|
+
});
|
|
234
223
|
}
|
|
235
224
|
get position() {
|
|
236
225
|
return tuiCheckFixedPosition(this.el) ? 'fixed' : 'absolute';
|
|
237
226
|
}
|
|
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
227
|
ngAfterViewChecked() {
|
|
247
228
|
this.refresh$.next();
|
|
248
229
|
}
|
|
@@ -254,21 +235,21 @@ class TuiDropdownDirective {
|
|
|
254
235
|
}
|
|
255
236
|
toggle(show) {
|
|
256
237
|
const ref = this.ref();
|
|
257
|
-
if (show && this.
|
|
238
|
+
if (show && this.content() && !ref) {
|
|
258
239
|
this.ref.set(this.service.add(this.component));
|
|
259
240
|
}
|
|
260
241
|
else if (!show && ref) {
|
|
261
242
|
this.ref.set(null);
|
|
262
243
|
ref.destroy();
|
|
263
244
|
}
|
|
264
|
-
this.drivers.forEach((driver) => driver?.next(show));
|
|
265
245
|
// TODO: Remove in v5, only needed in Angular 16
|
|
266
246
|
this.cdr.markForCheck();
|
|
247
|
+
this.drivers.forEach((driver) => driver?.next(show));
|
|
267
248
|
}
|
|
268
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
269
|
-
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 }); }
|
|
270
251
|
}
|
|
271
|
-
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: [{
|
|
272
253
|
type: Directive,
|
|
273
254
|
args: [{
|
|
274
255
|
selector: '[tuiDropdown]:not(ng-container):not(ng-template)',
|
|
@@ -285,9 +266,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
285
266
|
'[class.tui-dropdown-open]': 'ref()',
|
|
286
267
|
},
|
|
287
268
|
}]
|
|
288
|
-
}]
|
|
289
|
-
type: Input
|
|
290
|
-
}] } });
|
|
269
|
+
}] });
|
|
291
270
|
|
|
292
271
|
/**
|
|
293
272
|
* @description:
|
|
@@ -301,7 +280,7 @@ class TuiDropdownComponent {
|
|
|
301
280
|
this.viewport = inject(TUI_VIEWPORT);
|
|
302
281
|
this.vvs = inject(TuiVisualViewportService);
|
|
303
282
|
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((
|
|
283
|
+
!!this.directive.el.getBoundingClientRect().height), map((v) => (this.position === 'fixed' ? this.vvs.correct(v) : v)), map((point) => this.getStyles(...point)), takeUntilDestroyed());
|
|
305
284
|
this.options = inject(TUI_DROPDOWN_OPTIONS);
|
|
306
285
|
this.directive = inject(TuiDropdownDirective);
|
|
307
286
|
this.context = inject(TUI_DROPDOWN_CONTEXT, { optional: true });
|
|
@@ -340,14 +319,14 @@ class TuiDropdownComponent {
|
|
|
340
319
|
maxWidth: tuiPx(Math.round(viewport.width) - 16), // 8px min gap from each side
|
|
341
320
|
};
|
|
342
321
|
}
|
|
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.
|
|
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: [
|
|
345
324
|
TuiPositionService,
|
|
346
325
|
tuiPositionAccessorFor('dropdown', TuiDropdownPosition),
|
|
347
326
|
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.
|
|
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 }); }
|
|
349
328
|
}
|
|
350
|
-
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: [{
|
|
351
330
|
type: Component,
|
|
352
331
|
args: [{ selector: 'tui-dropdown', imports: [PolymorpheusOutlet, TuiScrollbar], changeDetection: ChangeDetectionStrategy.Default, providers: [
|
|
353
332
|
TuiPositionService,
|
|
@@ -356,25 +335,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
356
335
|
], hostDirectives: [TuiActiveZone, TuiAnimated], host: {
|
|
357
336
|
'[attr.data-appearance]': 'options.appearance',
|
|
358
337
|
'[attr.tuiTheme]': 'theme()',
|
|
359
|
-
}, 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"] }]
|
|
360
339
|
}] });
|
|
361
340
|
|
|
362
341
|
class TuiDropdownContent {
|
|
363
342
|
constructor() {
|
|
364
343
|
this.directive = inject(TuiDropdownDirective);
|
|
365
|
-
this.directive.tuiDropdown
|
|
344
|
+
tuiSetSignal(this.directive.tuiDropdown, inject(TemplateRef));
|
|
366
345
|
if (isPlatformBrowser(inject(PLATFORM_ID)) &&
|
|
367
346
|
this.directive.el.matches(':focus-within')) {
|
|
368
347
|
this.directive.toggle(true);
|
|
369
348
|
}
|
|
370
349
|
}
|
|
371
350
|
ngOnDestroy() {
|
|
372
|
-
this.directive.tuiDropdown
|
|
351
|
+
tuiSetSignal(this.directive.tuiDropdown, null);
|
|
373
352
|
}
|
|
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.
|
|
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 }); }
|
|
376
355
|
}
|
|
377
|
-
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: [{
|
|
378
357
|
type: Directive,
|
|
379
358
|
args: [{
|
|
380
359
|
selector: 'ng-template[tuiDropdown]',
|
|
@@ -410,8 +389,8 @@ class TuiDropdownContext extends TuiRectAccessor {
|
|
|
410
389
|
this.currentRect = tuiPointToClientRect(x, y);
|
|
411
390
|
this.driver.next(true);
|
|
412
391
|
}
|
|
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.
|
|
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: [
|
|
415
394
|
TuiActiveZone,
|
|
416
395
|
TuiDropdownDriver,
|
|
417
396
|
tuiAsDriver(TuiDropdownDriver),
|
|
@@ -421,7 +400,7 @@ class TuiDropdownContext extends TuiRectAccessor {
|
|
|
421
400
|
__decorate([
|
|
422
401
|
shouldCall(activeZoneFilter)
|
|
423
402
|
], TuiDropdownContext.prototype, "closeDropdown", null);
|
|
424
|
-
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: [{
|
|
425
404
|
type: Directive,
|
|
426
405
|
args: [{
|
|
427
406
|
selector: '[tuiDropdownContext]',
|
|
@@ -455,37 +434,34 @@ function shouldClose(event) {
|
|
|
455
434
|
return (
|
|
456
435
|
// @ts-ignore
|
|
457
436
|
typeof CloseWatcher === 'undefined' &&
|
|
458
|
-
// ?. for
|
|
437
|
+
// ?. for autofill events
|
|
459
438
|
event.key?.toLowerCase() === 'escape' &&
|
|
460
|
-
this.
|
|
461
|
-
|
|
439
|
+
this.enabled() &&
|
|
440
|
+
this.open() &&
|
|
462
441
|
!this['dropdown']()?.nextElementSibling);
|
|
463
442
|
}
|
|
464
443
|
class TuiDropdownOpen {
|
|
465
444
|
constructor() {
|
|
445
|
+
this.dropdownHost = contentChild('tuiDropdownHost', {
|
|
446
|
+
descendants: true,
|
|
447
|
+
read: ElementRef,
|
|
448
|
+
});
|
|
466
449
|
this.directive = inject(TuiDropdownDirective);
|
|
467
450
|
this.el = tuiInjectElement();
|
|
468
451
|
this.obscured = inject(TuiObscured);
|
|
469
452
|
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
453
|
this.driver = inject(TuiDropdownDriver);
|
|
476
|
-
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
|
|
477
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)) ||
|
|
478
463
|
!this.directive.ref())))), tuiZonefull(), tuiWatch(), takeUntilDestroyed())
|
|
479
464
|
.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
465
|
}
|
|
490
466
|
toggle(open) {
|
|
491
467
|
if (this.focused && !open) {
|
|
@@ -499,14 +475,14 @@ class TuiDropdownOpen {
|
|
|
499
475
|
}
|
|
500
476
|
onClick(target) {
|
|
501
477
|
if (!this.editable && this.host.contains(target)) {
|
|
502
|
-
this.update(!this.
|
|
478
|
+
this.update(!this.open());
|
|
503
479
|
}
|
|
504
480
|
}
|
|
505
481
|
onArrow(event, up) {
|
|
506
482
|
if (!tuiIsElement(event.target) ||
|
|
507
483
|
!this.host.contains(event.target) ||
|
|
508
|
-
!this.
|
|
509
|
-
!this.directive.
|
|
484
|
+
!this.enabled() ||
|
|
485
|
+
!this.directive.content()) {
|
|
510
486
|
return;
|
|
511
487
|
}
|
|
512
488
|
event.preventDefault();
|
|
@@ -524,11 +500,11 @@ class TuiDropdownOpen {
|
|
|
524
500
|
}
|
|
525
501
|
}
|
|
526
502
|
get host() {
|
|
527
|
-
const initial = this.dropdownHost?.nativeElement || this.el;
|
|
528
|
-
const focusable =
|
|
503
|
+
const initial = this.dropdownHost()?.nativeElement || this.el;
|
|
504
|
+
const focusable = tuiIsFocusable(initial)
|
|
529
505
|
? initial
|
|
530
506
|
: tuiGetClosestFocusable({ initial, root: this.el });
|
|
531
|
-
return this.dropdownHost?.nativeElement || focusable || this.el;
|
|
507
|
+
return this.dropdownHost()?.nativeElement || focusable || this.el;
|
|
532
508
|
}
|
|
533
509
|
get editable() {
|
|
534
510
|
return tuiIsElementEditable(this.host);
|
|
@@ -537,14 +513,13 @@ class TuiDropdownOpen {
|
|
|
537
513
|
return tuiIsFocusedIn(this.host) || tuiIsFocusedIn(this.dropdown());
|
|
538
514
|
}
|
|
539
515
|
update(open) {
|
|
540
|
-
if (open && !this.
|
|
516
|
+
if (open && !this.enabled()) {
|
|
541
517
|
return this.drive();
|
|
542
518
|
}
|
|
543
|
-
this.
|
|
544
|
-
this.tuiDropdownOpenChange.emit(open);
|
|
519
|
+
this.open.set(open);
|
|
545
520
|
this.drive();
|
|
546
521
|
}
|
|
547
|
-
drive(open =
|
|
522
|
+
drive(open = this.open() && this.enabled()) {
|
|
548
523
|
tuiSetSignal(this.obscured.tuiObscuredEnabled, open);
|
|
549
524
|
this.driver.next(open);
|
|
550
525
|
}
|
|
@@ -561,16 +536,16 @@ class TuiDropdownOpen {
|
|
|
561
536
|
child.remove();
|
|
562
537
|
focusable?.focus();
|
|
563
538
|
}
|
|
564
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
565
|
-
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 }); }
|
|
566
541
|
}
|
|
567
542
|
__decorate([
|
|
568
543
|
shouldCall(shouldClose)
|
|
569
544
|
], TuiDropdownOpen.prototype, "onEsc", null);
|
|
570
|
-
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: [{
|
|
571
546
|
type: Directive,
|
|
572
547
|
args: [{
|
|
573
|
-
selector: '[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]',
|
|
548
|
+
selector: '[tuiDropdown][tuiDropdownAuto],[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]',
|
|
574
549
|
providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)],
|
|
575
550
|
hostDirectives: [
|
|
576
551
|
TuiObscured,
|
|
@@ -590,37 +565,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
590
565
|
'(tuiActiveZoneChange)': '0',
|
|
591
566
|
},
|
|
592
567
|
}]
|
|
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: [] } });
|
|
568
|
+
}], propDecorators: { onEsc: [] } });
|
|
603
569
|
|
|
604
570
|
class TuiDropdownHover extends TuiDriver {
|
|
605
571
|
constructor() {
|
|
606
572
|
super((subscriber) => this.stream$.subscribe(subscriber));
|
|
573
|
+
this.dropdownHost = contentChild('tuiDropdownHost', {
|
|
574
|
+
descendants: true,
|
|
575
|
+
read: ElementRef,
|
|
576
|
+
});
|
|
577
|
+
this.hovered = false;
|
|
607
578
|
this.el = tuiInjectElement();
|
|
608
579
|
this.doc = inject(DOCUMENT);
|
|
609
580
|
this.options = inject(TUI_DROPDOWN_HOVER_OPTIONS);
|
|
610
581
|
this.activeZone = inject(TuiActiveZone);
|
|
611
582
|
this.open = inject(TuiDropdownOpen, { optional: true });
|
|
583
|
+
this.stream$ = merge(
|
|
612
584
|
/**
|
|
613
585
|
* Dropdown can be removed not only via click/touch –
|
|
614
586
|
* swipe on mobile devices removes dropdown sheet without triggering new mouseover / mouseout events.
|
|
615
587
|
*/
|
|
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) => {
|
|
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) => {
|
|
618
589
|
this.hovered = hovered;
|
|
619
590
|
this.open?.toggle(hovered);
|
|
620
591
|
}), share());
|
|
621
|
-
this.
|
|
622
|
-
this.
|
|
623
|
-
this.hovered = false;
|
|
592
|
+
this.tuiDropdownShowDelay = input(this.options.showDelay);
|
|
593
|
+
this.tuiDropdownHideDelay = input(this.options.hideDelay);
|
|
624
594
|
this.type = 'dropdown';
|
|
625
595
|
}
|
|
626
596
|
onClick(event) {
|
|
@@ -629,15 +599,15 @@ class TuiDropdownHover extends TuiDriver {
|
|
|
629
599
|
}
|
|
630
600
|
}
|
|
631
601
|
isHovered(element) {
|
|
632
|
-
const host = this.dropdownHost?.nativeElement || this.el;
|
|
602
|
+
const host = this.dropdownHost()?.nativeElement || this.el;
|
|
633
603
|
const hovered = host.contains(element);
|
|
634
604
|
const child = !this.el.contains(element) && this.activeZone.contains(element);
|
|
635
605
|
return hovered || child;
|
|
636
606
|
}
|
|
637
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
638
|
-
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 }); }
|
|
639
609
|
}
|
|
640
|
-
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: [{
|
|
641
611
|
type: Directive,
|
|
642
612
|
args: [{
|
|
643
613
|
selector: '[tuiDropdownHover]',
|
|
@@ -646,65 +616,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
646
616
|
'(click.capture)': 'onClick($event)',
|
|
647
617
|
},
|
|
648
618
|
}]
|
|
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
|
-
}] } });
|
|
619
|
+
}], ctorParameters: () => [] });
|
|
659
620
|
|
|
660
621
|
class TuiDropdownManual {
|
|
661
622
|
constructor() {
|
|
662
623
|
this.driver = inject(TuiDropdownDriver);
|
|
663
|
-
this.tuiDropdownManual = false;
|
|
624
|
+
this.tuiDropdownManual = input(false);
|
|
664
625
|
}
|
|
665
626
|
ngOnChanges() {
|
|
666
|
-
this.driver.next(!!this.tuiDropdownManual);
|
|
627
|
+
this.driver.next(!!this.tuiDropdownManual());
|
|
667
628
|
}
|
|
668
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
669
|
-
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 }); }
|
|
670
631
|
}
|
|
671
|
-
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: [{
|
|
672
633
|
type: Directive,
|
|
673
634
|
args: [{
|
|
674
635
|
selector: '[tuiDropdownManual]',
|
|
675
636
|
providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)],
|
|
676
637
|
}]
|
|
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
|
-
}] } });
|
|
638
|
+
}] });
|
|
708
639
|
|
|
709
640
|
class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
710
641
|
constructor() {
|
|
@@ -713,12 +644,12 @@ class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
|
713
644
|
this.viewport = inject(TUI_VIEWPORT);
|
|
714
645
|
this.vertical = inject(TuiDropdownPosition);
|
|
715
646
|
this.previous = this.options.direction || 'bottom';
|
|
716
|
-
this.tuiDropdownSided = '';
|
|
717
|
-
this.tuiDropdownSidedOffset = 4;
|
|
647
|
+
this.tuiDropdownSided = input('');
|
|
648
|
+
this.tuiDropdownSidedOffset = input(4);
|
|
718
649
|
this.type = 'dropdown';
|
|
719
650
|
}
|
|
720
651
|
getPosition(rect) {
|
|
721
|
-
if (this.tuiDropdownSided === false) {
|
|
652
|
+
if (this.tuiDropdownSided() === false) {
|
|
722
653
|
return this.vertical.getPosition(rect);
|
|
723
654
|
}
|
|
724
655
|
const { height, width } = rect;
|
|
@@ -734,37 +665,33 @@ class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
|
734
665
|
bottom: viewport.bottom - hostRect.top,
|
|
735
666
|
};
|
|
736
667
|
const position = {
|
|
737
|
-
top: hostRect.bottom - height + this.tuiDropdownSidedOffset + 1, // 1 for border
|
|
668
|
+
top: hostRect.bottom - height + this.tuiDropdownSidedOffset() + 1, // 1 for border
|
|
738
669
|
left: hostRect.left - width - offset,
|
|
739
670
|
right: hostRect.right + offset,
|
|
740
|
-
bottom: hostRect.top - this.tuiDropdownSidedOffset - 1, // 1 for border
|
|
671
|
+
bottom: hostRect.top - this.tuiDropdownSidedOffset() - 1, // 1 for border
|
|
741
672
|
};
|
|
742
673
|
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
743
674
|
const maxLeft = available.left > available.right ? position.left : position.right;
|
|
744
675
|
const left = available[align] > width ? position[align] : maxLeft;
|
|
745
676
|
if ((available[this.previous] > height && direction) ||
|
|
746
677
|
this.previous === better) {
|
|
747
|
-
this.vertical.
|
|
748
|
-
return [position[this.previous]
|
|
678
|
+
this.vertical.direction.next(this.previous);
|
|
679
|
+
return [left, position[this.previous]];
|
|
749
680
|
}
|
|
750
681
|
this.previous = better;
|
|
751
|
-
this.vertical.
|
|
752
|
-
return [position[better]
|
|
682
|
+
this.vertical.direction.next(better);
|
|
683
|
+
return [left, position[better]];
|
|
753
684
|
}
|
|
754
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
755
|
-
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 }); }
|
|
756
687
|
}
|
|
757
|
-
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: [{
|
|
758
689
|
type: Directive,
|
|
759
690
|
args: [{
|
|
760
691
|
selector: '[tuiDropdownSided]',
|
|
761
692
|
providers: [TuiDropdownPosition, tuiAsPositionAccessor(TuiDropdownPositionSided)],
|
|
762
693
|
}]
|
|
763
|
-
}]
|
|
764
|
-
type: Input
|
|
765
|
-
}], tuiDropdownSidedOffset: [{
|
|
766
|
-
type: Input
|
|
767
|
-
}] } });
|
|
694
|
+
}] });
|
|
768
695
|
|
|
769
696
|
class TuiDropdownSelection extends TuiDriver {
|
|
770
697
|
constructor() {
|
|
@@ -773,9 +700,9 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
773
700
|
this.vcr = inject(ViewContainerRef);
|
|
774
701
|
this.dropdown = inject(TuiDropdownDirective);
|
|
775
702
|
this.el = tuiInjectElement();
|
|
776
|
-
this.handler
|
|
703
|
+
this.handler = computed((visible = this.tuiDropdownSelection()) => tuiIsString(visible) ? TUI_TRUE_HANDLER : visible);
|
|
777
704
|
this.stream$ = combineLatest([
|
|
778
|
-
this.handler
|
|
705
|
+
toObservable(this.handler),
|
|
779
706
|
inject(TUI_SELECTION_STREAM).pipe(map(() => this.getRange()), filter((range) => this.isValid(range)), distinctUntilChanged((x, y) => x.startOffset === y.startOffset &&
|
|
780
707
|
x.endOffset === y.endOffset &&
|
|
781
708
|
x.commonAncestorContainer === y.commonAncestorContainer)),
|
|
@@ -787,17 +714,15 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
787
714
|
: this.range;
|
|
788
715
|
return (contained && handler(this.range)) || this.inDropdown(range);
|
|
789
716
|
}));
|
|
790
|
-
this.range = inject(
|
|
791
|
-
|
|
717
|
+
this.range = isPlatformBrowser(inject(PLATFORM_ID))
|
|
718
|
+
? new Range()
|
|
719
|
+
: {};
|
|
792
720
|
this.type = 'dropdown';
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
if (!tuiIsString(visible)) {
|
|
796
|
-
this.handler$.next(visible);
|
|
797
|
-
}
|
|
721
|
+
this.tuiDropdownSelection = input('');
|
|
722
|
+
this.tuiDropdownSelectionPosition = input('selection');
|
|
798
723
|
}
|
|
799
724
|
getClientRect() {
|
|
800
|
-
switch (this.
|
|
725
|
+
switch (this.tuiDropdownSelectionPosition()) {
|
|
801
726
|
case 'tag': {
|
|
802
727
|
const { commonAncestorContainer } = this.range;
|
|
803
728
|
const element = tuiIsElement(commonAncestorContainer)
|
|
@@ -888,13 +813,13 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
888
813
|
this.ghost = ghost;
|
|
889
814
|
return ghost;
|
|
890
815
|
}
|
|
891
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
892
|
-
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: [
|
|
893
818
|
tuiAsDriver(TuiDropdownSelection),
|
|
894
819
|
tuiAsRectAccessor(TuiDropdownSelection),
|
|
895
820
|
], usesInheritance: true, ngImport: i0 }); }
|
|
896
821
|
}
|
|
897
|
-
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: [{
|
|
898
823
|
type: Directive,
|
|
899
824
|
args: [{
|
|
900
825
|
selector: '[tuiDropdownSelection]',
|
|
@@ -903,12 +828,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
903
828
|
tuiAsRectAccessor(TuiDropdownSelection),
|
|
904
829
|
],
|
|
905
830
|
}]
|
|
906
|
-
}], ctorParameters: () => []
|
|
907
|
-
type: Input,
|
|
908
|
-
args: ['tuiDropdownSelectionPosition']
|
|
909
|
-
}], tuiDropdownSelection: [{
|
|
910
|
-
type: Input
|
|
911
|
-
}] } });
|
|
831
|
+
}], ctorParameters: () => [] });
|
|
912
832
|
|
|
913
833
|
const TuiDropdown = [
|
|
914
834
|
TuiDropdownOptionsDirective,
|
|
@@ -916,7 +836,6 @@ const TuiDropdown = [
|
|
|
916
836
|
TuiDropdownDirective,
|
|
917
837
|
TuiDropdownComponent,
|
|
918
838
|
TuiDropdownOpen,
|
|
919
|
-
TuiDropdownOpenLegacy,
|
|
920
839
|
TuiDropdownManual,
|
|
921
840
|
TuiDropdownHover,
|
|
922
841
|
TuiDropdownContent,
|
|
@@ -930,25 +849,18 @@ function tuiDropdown(value) {
|
|
|
930
849
|
return tuiDirectiveBinding(TuiDropdownDirective, 'tuiDropdown', value, {});
|
|
931
850
|
}
|
|
932
851
|
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;
|
|
852
|
+
return tuiDirectiveBinding(TuiDropdownOpen, 'enabled', value, {});
|
|
941
853
|
}
|
|
942
854
|
|
|
943
855
|
class TuiDropdownFixed {
|
|
944
856
|
constructor() {
|
|
945
|
-
const override = tuiOverrideOptions
|
|
857
|
+
const override = tuiOverrideOptions({ limitWidth: 'fixed' }, TUI_DROPDOWN_DEFAULT_OPTIONS);
|
|
946
858
|
override(inject(TUI_DROPDOWN_OPTIONS, { self: true, optional: true }), null);
|
|
947
859
|
}
|
|
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.
|
|
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 }); }
|
|
950
862
|
}
|
|
951
|
-
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: [{
|
|
952
864
|
type: Directive,
|
|
953
865
|
args: [{
|
|
954
866
|
providers: [tuiDropdownOptionsProvider({})],
|
|
@@ -962,18 +874,18 @@ class TuiDropdownAuto {
|
|
|
962
874
|
*/
|
|
963
875
|
inject(TUI_DROPDOWN_OPTIONS).limitWidth = 'auto';
|
|
964
876
|
}
|
|
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.
|
|
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 }); }
|
|
967
879
|
}
|
|
968
|
-
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: [{
|
|
969
881
|
type: Directive
|
|
970
882
|
}], ctorParameters: () => [] });
|
|
971
883
|
|
|
972
884
|
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.
|
|
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 }); }
|
|
975
887
|
}
|
|
976
|
-
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: [{
|
|
977
889
|
type: Directive,
|
|
978
890
|
args: [{
|
|
979
891
|
hostDirectives: [
|
|
@@ -990,5 +902,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
990
902
|
* Generated bundle index. Do not edit.
|
|
991
903
|
*/
|
|
992
904
|
|
|
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-
|
|
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
|