@taiga-ui/core 4.52.0-canary.c107f6a → 4.52.0-canary.c8448e0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/classes/accessors.d.ts +2 -2
- package/components/calendar/calendar-sheet.component.d.ts +1 -1
- package/components/calendar/calendar-sheet.options.d.ts +1 -3
- package/{pipes/calendar-sheet → components/calendar}/calendar-sheet.pipe.d.ts +2 -2
- package/components/calendar/calendar-spin.component.d.ts +1 -0
- package/components/calendar/calendar-year.component.d.ts +1 -1
- package/components/calendar/calendar.options.d.ts +9 -0
- package/components/calendar/index.d.ts +3 -0
- package/{pipes/order-week-days → components/calendar}/order-week-days.pipe.d.ts +1 -1
- package/components/data-list/data-list.component.d.ts +7 -11
- package/components/data-list/data-list.d.ts +3 -4
- package/components/data-list/data-list.tokens.d.ts +1 -23
- package/components/data-list/index.d.ts +3 -4
- package/components/data-list/opt-group.directive.d.ts +2 -2
- package/components/data-list/option-content.directive.d.ts +14 -0
- package/components/data-list/option-with-value.directive.d.ts +9 -0
- package/components/data-list/option.directive.d.ts +19 -0
- package/components/icon/icon.component.d.ts +2 -2
- package/components/index.d.ts +2 -4
- 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/loader/loader.options.d.ts +1 -3
- package/components/notification/index.d.ts +3 -0
- package/components/notification/notification.component.d.ts +14 -0
- package/components/notification/notification.d.ts +3 -0
- package/components/notification/notification.directive.d.ts +5 -6
- package/components/notification/notification.options.d.ts +10 -7
- package/components/notification/notification.service.d.ts +17 -0
- package/components/root/root.component.d.ts +1 -1
- package/components/scrollbar/scroll-ref.directive.d.ts +2 -0
- package/components/scrollbar/scrollbar.component.d.ts +1 -5
- package/components/spin-button/spin-button.component.d.ts +1 -1
- package/components/textfield/index.d.ts +0 -1
- package/components/textfield/select-like.directive.d.ts +1 -0
- 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 -33
- package/components/textfield/textfield.d.ts +2 -3
- package/directives/appearance/appearance.directive.d.ts +1 -1
- package/directives/appearance/appearance.options.d.ts +1 -2
- package/directives/button-x/button-x.directive.d.ts +6 -0
- package/directives/button-x/index.d.ts +1 -0
- package/directives/group/group.directive.d.ts +7 -7
- package/directives/group/group.options.d.ts +1 -3
- package/directives/index.d.ts +1 -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 +9 -11
- 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 +138 -37
- package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-cell.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +109 -271
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +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 +100 -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 -28
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +7 -12
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +99 -29
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +9 -13
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs +43 -49
- 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 +128 -282
- 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 -4
- package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
- 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-button-x.mjs +51 -0
- package/fesm2022/taiga-ui-core-directives-button-x.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-group.mjs +23 -35
- 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 +1 -5
- package/fesm2022/taiga-ui-core-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs +21 -15
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes.mjs +0 -7
- package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-alert.mjs +73 -0
- package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-portals-dialog.mjs +159 -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} +220 -329
- 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} +102 -160
- 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 +35 -54
- package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-format.mjs +1 -22
- 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 +40 -69
- package/pipes/format-number/format-number.pipe.d.ts +6 -4
- package/pipes/index.d.ts +0 -7
- package/{directives/notification/notification.directive.d.ts → portals/alert/alert.directive.d.ts} +3 -3
- package/{directives/notification/notification.service.d.ts → portals/alert/alert.service.d.ts} +3 -3
- package/portals/alert/index.d.ts +2 -0
- package/{components → portals}/dialog/dialog.component.d.ts +2 -3
- package/{components → portals}/dialog/dialog.options.d.ts +2 -3
- package/{components → portals}/dialog/dialog.providers.d.ts +1 -2
- package/{components → portals}/dialog/dialog.service.d.ts +1 -1
- package/{components → portals}/dialog/index.d.ts +0 -1
- package/portals/dropdown/dropdown-close.directive.d.ts +15 -0
- package/{directives → portals}/dropdown/dropdown-context.directive.d.ts +0 -1
- package/{directives → portals}/dropdown/dropdown-hover.directive.d.ts +5 -10
- package/{directives → portals}/dropdown/dropdown-hover.options.d.ts +1 -3
- package/{directives → portals}/dropdown/dropdown-manual.directive.d.ts +2 -2
- package/portals/dropdown/dropdown-open.directive.d.ts +29 -0
- package/{directives → portals}/dropdown/dropdown-options.directive.d.ts +1 -5
- package/{directives → portals}/dropdown/dropdown-position-sided.directive.d.ts +3 -3
- package/{directives → portals}/dropdown/dropdown-position.directive.d.ts +6 -6
- 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 +1 -1
- package/portals/hint/hint-options.directive.d.ts +17 -0
- package/{directives → portals}/hint/hint-position.directive.d.ts +5 -5
- package/{directives → portals}/hint/hint.d.ts +1 -2
- package/{directives → portals}/hint/hint.directive.d.ts +2 -2
- package/portals/index.d.ts +6 -0
- package/{components → portals}/modal/modal.component.d.ts +3 -3
- package/{components → portals}/modal/modal.service.d.ts +3 -3
- 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 +9 -24
- package/styles/components/notification.less +31 -65
- package/styles/components/textfield.less +130 -211
- package/styles/components/title.less +8 -8
- package/styles/mixins/appearance.less +11 -26
- package/styles/mixins/appearance.scss +9 -24
- package/styles/mixins/date-picker.less +1 -1
- package/styles/mixins/mixins.less +0 -5
- package/styles/mixins/mixins.scss +0 -5
- package/styles/mixins/picker.less +1 -1
- package/styles/mixins/picker.scss +1 -1
- package/styles/mixins/slider.less +4 -10
- package/styles/mixins/slider.scss +23 -22
- 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 +26 -27
- package/styles/theme/appearance.less +0 -1
- package/styles/theme/variables.less +16 -19
- package/styles/variables/media.less +13 -18
- package/styles/variables/media.scss +13 -13
- package/tokens/breakpoint.d.ts +4 -0
- package/tokens/common-icons.d.ts +3 -3
- package/tokens/icons.d.ts +0 -4
- package/tokens/index.d.ts +1 -4
- package/types/direction.d.ts +1 -1
- 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/alert/alert.component.d.ts +0 -14
- package/components/alert/alert.directive.d.ts +0 -8
- package/components/alert/alert.interfaces.d.ts +0 -13
- package/components/alert/alert.service.d.ts +0 -11
- package/components/alert/alert.tokens.d.ts +0 -6
- package/components/alert/index.d.ts +0 -5
- package/components/data-list/data-list.directive.d.ts +0 -7
- package/components/data-list/option/option-content.d.ts +0 -16
- package/components/data-list/option/option-legacy.component.d.ts +0 -24
- package/components/data-list/option/option.directive.d.ts +0 -27
- package/components/dialog/active-zone-adapter.directive.d.ts +0 -11
- package/components/dialog/dialogs.component.d.ts +0 -8
- package/components/header/header.directive.d.ts +0 -17
- package/components/header/index.d.ts +0 -1
- package/components/link/link.options.d.ts +0 -12
- package/components/textfield/textfield.directive.d.ts +0 -35
- package/directives/dropdown/dropdown-open-legacy.directive.d.ts +0 -12
- package/directives/dropdown/dropdown-open.directive.d.ts +0 -33
- package/directives/hint/hint-options.directive.d.ts +0 -36
- package/directives/notification/index.d.ts +0 -2
- package/fesm2022/taiga-ui-core-animations.mjs +0 -370
- package/fesm2022/taiga-ui-core-animations.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-alert.mjs +0 -110
- package/fesm2022/taiga-ui-core-components-alert.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs +0 -226
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-header.mjs +0 -42
- package/fesm2022/taiga-ui-core-components-header.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-dropdown.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-hint.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-notification.mjs +0 -73
- package/fesm2022/taiga-ui-core-directives-notification.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-popup.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +0 -24
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +0 -93
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-flag.mjs +0 -31
- package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs +0 -27
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-initials.mjs +0 -28
- package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs +0 -29
- package/fesm2022/taiga-ui-core-pipes-month.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +0 -35
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +0 -1
- package/pipes/auto-color/auto-color.pipe.d.ts +0 -7
- package/pipes/auto-color/index.d.ts +0 -1
- package/pipes/calendar-sheet/index.d.ts +0 -1
- package/pipes/calendar-sheet/utils.d.ts +0 -20
- package/pipes/flag/flag.pipe.d.ts +0 -14
- package/pipes/flag/index.d.ts +0 -1
- package/pipes/format-date/format-date.pipe.d.ts +0 -9
- package/pipes/format-date/index.d.ts +0 -1
- package/pipes/initials/index.d.ts +0 -1
- package/pipes/initials/initials.pipe.d.ts +0 -7
- package/pipes/month/index.d.ts +0 -1
- package/pipes/month/month.pipe.d.ts +0 -10
- package/pipes/order-week-days/index.d.ts +0 -1
- package/services/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/{components → portals}/dialog/dialog.directive.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.factory.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-content.directive.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-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.providers.d.ts +0 -0
- /package/{directives → portals}/hint/index.d.ts +0 -0
- /package/{components → portals}/modal/index.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,42 +1,41 @@
|
|
|
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';
|
|
7
7
|
import * as i2 from '@taiga-ui/cdk/directives/animated';
|
|
8
8
|
import { TuiAnimated } from '@taiga-ui/cdk/directives/animated';
|
|
9
|
-
import { tuiInjectElement, tuiGetActualTarget, tuiPointToClientRect, tuiIsElement,
|
|
9
|
+
import { tuiInjectElement, tuiGetActualTarget, tuiPointToClientRect, tuiIsElement, tuiIsElementEditable, tuiIsHTMLElement, tuiIsTextNode, tuiIsTextfield } from '@taiga-ui/cdk/utils/dom';
|
|
10
10
|
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
11
|
-
import {
|
|
12
|
-
import { TuiDriverDirective, TuiPositionAccessor, tuiFallbackAccessor, TuiRectAccessor,
|
|
11
|
+
import { tuiPx, tuiSetSignal, tuiIsString } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
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,
|
|
17
|
+
import { BehaviorSubject, Subject, distinctUntilChanged, throttleTime, takeWhile, map, merge, filter, EMPTY, switchMap, delay, startWith, takeUntil, fromEvent, of, tap, share, combineLatest } from 'rxjs';
|
|
18
18
|
import { coerceArray } from '@angular/cdk/coercion';
|
|
19
|
-
import { tuiZonefreeScheduler, tuiTypedFromEvent,
|
|
20
|
-
import { TuiPopupService } from '@taiga-ui/core/
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
19
|
+
import { tuiZonefreeScheduler, tuiTypedFromEvent, tuiZoneOptimized, tuiIfMap, tuiCloseWatcher, tuiStopPropagation } from '@taiga-ui/cdk/observables';
|
|
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 { TUI_IS_TOUCH
|
|
25
|
-
import { shouldCall } from '@taiga-ui/event-plugins';
|
|
25
|
+
import { TUI_IS_TOUCH } from '@taiga-ui/cdk/tokens';
|
|
26
26
|
import * as i1$1 from '@taiga-ui/cdk/directives/obscured';
|
|
27
27
|
import { TuiObscured } from '@taiga-ui/cdk/directives/obscured';
|
|
28
|
-
import {
|
|
29
|
-
import { tuiIsEditingKey, tuiOverrideOptions as tuiOverrideOptions$1 } from '@taiga-ui/core/utils/miscellaneous';
|
|
28
|
+
import { tuiIsFocusable, tuiGetClosestFocusable, tuiIsFocusedIn, tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
30
29
|
|
|
31
30
|
class TuiDropdownDriver extends BehaviorSubject {
|
|
32
31
|
constructor() {
|
|
33
32
|
super(false);
|
|
34
33
|
this.type = 'dropdown';
|
|
35
34
|
}
|
|
36
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
37
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
36
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriver }); }
|
|
38
37
|
}
|
|
39
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriver, decorators: [{
|
|
40
39
|
type: Injectable
|
|
41
40
|
}], ctorParameters: () => [] });
|
|
42
41
|
class TuiDropdownDriverDirective extends TuiDriverDirective {
|
|
@@ -44,10 +43,10 @@ class TuiDropdownDriverDirective extends TuiDriverDirective {
|
|
|
44
43
|
super(...arguments);
|
|
45
44
|
this.type = 'dropdown';
|
|
46
45
|
}
|
|
47
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
48
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriverDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
47
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownDriverDirective, isStandalone: true, usesInheritance: true, ngImport: i0 }); }
|
|
49
48
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDriverDirective, decorators: [{
|
|
51
50
|
type: Directive
|
|
52
51
|
}] });
|
|
53
52
|
|
|
@@ -59,9 +58,8 @@ const TUI_DROPDOWN_COMPONENT = new InjectionToken(ngDevMode ? 'TUI_DROPDOWN_COMP
|
|
|
59
58
|
});
|
|
60
59
|
const TUI_DROPDOWN_CONTEXT = new InjectionToken(ngDevMode ? 'TUI_DROPDOWN_CONTEXT' : '');
|
|
61
60
|
|
|
62
|
-
/** Default values for dropdown options */
|
|
63
61
|
const TUI_DROPDOWN_DEFAULT_OPTIONS = {
|
|
64
|
-
align: '
|
|
62
|
+
align: 'start',
|
|
65
63
|
direction: null,
|
|
66
64
|
limitWidth: 'auto',
|
|
67
65
|
maxHeight: 400,
|
|
@@ -69,9 +67,6 @@ const TUI_DROPDOWN_DEFAULT_OPTIONS = {
|
|
|
69
67
|
offset: 4,
|
|
70
68
|
appearance: '',
|
|
71
69
|
};
|
|
72
|
-
/**
|
|
73
|
-
* Default parameters for dropdown directive
|
|
74
|
-
*/
|
|
75
70
|
const TUI_DROPDOWN_OPTIONS = new InjectionToken(ngDevMode ? 'TUI_DROPDOWN_OPTIONS' : '', {
|
|
76
71
|
factory: () => TUI_DROPDOWN_DEFAULT_OPTIONS,
|
|
77
72
|
});
|
|
@@ -94,37 +89,25 @@ class TuiDropdownOptionsDirective {
|
|
|
94
89
|
this.maxHeight = this.options.maxHeight;
|
|
95
90
|
this.offset = this.options.offset;
|
|
96
91
|
}
|
|
97
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
98
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
92
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOptionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
93
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownOptionsDirective, isStandalone: true, selector: "[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]", inputs: { align: ["tuiDropdownAlign", "align"], appearance: ["tuiDropdownAppearance", "appearance"], direction: ["tuiDropdownDirection", "direction"], limitWidth: ["tuiDropdownLimitWidth", "limitWidth"], minHeight: ["tuiDropdownMinHeight", "minHeight"], maxHeight: ["tuiDropdownMaxHeight", "maxHeight"], offset: ["tuiDropdownOffset", "offset"] }, providers: [tuiProvide(TUI_DROPDOWN_OPTIONS, TuiDropdownOptionsDirective)], ngImport: i0 }); }
|
|
99
94
|
}
|
|
100
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOptionsDirective, decorators: [{
|
|
101
96
|
type: Directive,
|
|
102
97
|
args: [{
|
|
103
98
|
selector: '[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]',
|
|
99
|
+
inputs: [
|
|
100
|
+
'align: tuiDropdownAlign',
|
|
101
|
+
'appearance: tuiDropdownAppearance',
|
|
102
|
+
'direction: tuiDropdownDirection',
|
|
103
|
+
'limitWidth: tuiDropdownLimitWidth',
|
|
104
|
+
'minHeight: tuiDropdownMinHeight',
|
|
105
|
+
'maxHeight: tuiDropdownMaxHeight',
|
|
106
|
+
'offset: tuiDropdownOffset',
|
|
107
|
+
],
|
|
104
108
|
providers: [tuiProvide(TUI_DROPDOWN_OPTIONS, TuiDropdownOptionsDirective)],
|
|
105
109
|
}]
|
|
106
|
-
}]
|
|
107
|
-
type: Input,
|
|
108
|
-
args: ['tuiDropdownAlign']
|
|
109
|
-
}], appearance: [{
|
|
110
|
-
type: Input,
|
|
111
|
-
args: ['tuiDropdownAppearance']
|
|
112
|
-
}], direction: [{
|
|
113
|
-
type: Input,
|
|
114
|
-
args: ['tuiDropdownDirection']
|
|
115
|
-
}], limitWidth: [{
|
|
116
|
-
type: Input,
|
|
117
|
-
args: ['tuiDropdownLimitWidth']
|
|
118
|
-
}], minHeight: [{
|
|
119
|
-
type: Input,
|
|
120
|
-
args: ['tuiDropdownMinHeight']
|
|
121
|
-
}], maxHeight: [{
|
|
122
|
-
type: Input,
|
|
123
|
-
args: ['tuiDropdownMaxHeight']
|
|
124
|
-
}], offset: [{
|
|
125
|
-
type: Input,
|
|
126
|
-
args: ['tuiDropdownOffset']
|
|
127
|
-
}] } });
|
|
110
|
+
}] });
|
|
128
111
|
|
|
129
112
|
class TuiDropdownPosition extends TuiPositionAccessor {
|
|
130
113
|
constructor() {
|
|
@@ -132,18 +115,16 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
132
115
|
this.el = tuiInjectElement();
|
|
133
116
|
this.options = inject(TUI_DROPDOWN_OPTIONS);
|
|
134
117
|
this.viewport = inject(TUI_VIEWPORT);
|
|
135
|
-
this.
|
|
118
|
+
this.direction = new Subject();
|
|
136
119
|
this.type = 'dropdown';
|
|
137
|
-
this.accessor = tuiFallbackAccessor('dropdown')(inject(TuiRectAccessor
|
|
138
|
-
|
|
139
|
-
emitDirection(direction) {
|
|
140
|
-
this.directionChange.emit(direction);
|
|
120
|
+
this.accessor = tuiFallbackAccessor('dropdown')(inject(TuiRectAccessor, { optional: true }), { getClientRect: () => this.el.getBoundingClientRect() });
|
|
121
|
+
this.tuiDropdownDirectionChange = outputFromObservable(this.direction.pipe(distinctUntilChanged()));
|
|
141
122
|
}
|
|
142
123
|
getPosition({ width, height }) {
|
|
143
124
|
if (!width && !height) {
|
|
144
125
|
this.previous = undefined;
|
|
145
126
|
}
|
|
146
|
-
const hostRect = this.accessor
|
|
127
|
+
const hostRect = this.accessor.getClientRect();
|
|
147
128
|
const viewportRect = this.viewport.getClientRect();
|
|
148
129
|
const { minHeight, direction, offset, limitWidth } = this.options;
|
|
149
130
|
const align = this.getAlign(this.options.align);
|
|
@@ -173,39 +154,38 @@ class TuiDropdownPosition extends TuiPositionAccessor {
|
|
|
173
154
|
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
174
155
|
if ((available[previous] > minHeight && direction) ||
|
|
175
156
|
available[previous] > height) {
|
|
176
|
-
this.
|
|
177
|
-
return [position[
|
|
157
|
+
this.direction.next(previous);
|
|
158
|
+
return [position[align], position[previous]];
|
|
178
159
|
}
|
|
179
160
|
this.previous = better;
|
|
180
|
-
this.
|
|
181
|
-
return [position[
|
|
161
|
+
this.direction.next(better);
|
|
162
|
+
return [position[align], position[better]];
|
|
182
163
|
}
|
|
183
164
|
getAlign(align) {
|
|
184
165
|
const rtl = this.el.matches('[dir="rtl"] :scope');
|
|
185
|
-
if (rtl && align === '
|
|
166
|
+
if (rtl && align === 'start') {
|
|
186
167
|
return 'right';
|
|
187
168
|
}
|
|
188
|
-
|
|
169
|
+
if (rtl && align === 'end') {
|
|
170
|
+
return 'left';
|
|
171
|
+
}
|
|
172
|
+
if (align === 'center') {
|
|
173
|
+
return 'center';
|
|
174
|
+
}
|
|
175
|
+
return align === 'end' ? 'right' : 'left';
|
|
189
176
|
}
|
|
190
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
191
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
177
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPosition, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
178
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownPosition, isStandalone: true, outputs: { tuiDropdownDirectionChange: "tuiDropdownDirectionChange" }, usesInheritance: true, ngImport: i0 }); }
|
|
192
179
|
}
|
|
193
|
-
|
|
194
|
-
tuiPure
|
|
195
|
-
], TuiDropdownPosition.prototype, "emitDirection", null);
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownPosition, decorators: [{
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPosition, decorators: [{
|
|
197
181
|
type: Directive
|
|
198
|
-
}]
|
|
199
|
-
type: Output,
|
|
200
|
-
args: ['tuiDropdownDirectionChange']
|
|
201
|
-
}], emitDirection: [] } });
|
|
182
|
+
}] });
|
|
202
183
|
|
|
203
184
|
class TuiDropdownDirective {
|
|
204
185
|
constructor() {
|
|
205
186
|
this.refresh$ = new Subject();
|
|
206
187
|
this.service = inject(TuiPopupService);
|
|
207
188
|
this.cdr = inject(ChangeDetectorRef);
|
|
208
|
-
// TODO: think of a better solution later
|
|
209
189
|
this.drivers = coerceArray(inject(TuiDropdownDriver, { self: true, optional: true }));
|
|
210
190
|
this.sub = this.refresh$
|
|
211
191
|
.pipe(throttleTime(0, tuiZonefreeScheduler()), takeUntilDestroyed())
|
|
@@ -213,33 +193,25 @@ class TuiDropdownDirective {
|
|
|
213
193
|
this.ref()?.changeDetectorRef.detectChanges();
|
|
214
194
|
this.ref()?.changeDetectorRef.markForCheck();
|
|
215
195
|
});
|
|
196
|
+
this.autoClose = effect(() => {
|
|
197
|
+
if (!this.content()) {
|
|
198
|
+
this.toggle(false);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
this.ref = signal(null);
|
|
216
202
|
this.el = tuiInjectElement();
|
|
217
203
|
this.type = 'dropdown';
|
|
218
204
|
this.component = new PolymorpheusComponent(inject(TUI_DROPDOWN_COMPONENT), inject(INJECTOR));
|
|
219
|
-
this.
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
this._content.set(content instanceof TemplateRef
|
|
226
|
-
? new PolymorpheusTemplate(content, this.cdr)
|
|
227
|
-
: content);
|
|
228
|
-
if (!this._content()) {
|
|
229
|
-
this.toggle(false);
|
|
230
|
-
}
|
|
205
|
+
this.tuiDropdown = input();
|
|
206
|
+
this.content = computed((content = this.tuiDropdown()) => {
|
|
207
|
+
return content instanceof TemplateRef
|
|
208
|
+
? new PolymorpheusTemplate(content, this.cdr)
|
|
209
|
+
: content;
|
|
210
|
+
});
|
|
231
211
|
}
|
|
232
212
|
get position() {
|
|
233
213
|
return tuiCheckFixedPosition(this.el) ? 'fixed' : 'absolute';
|
|
234
214
|
}
|
|
235
|
-
// TODO(v5): delete
|
|
236
|
-
get content() {
|
|
237
|
-
return this._content();
|
|
238
|
-
}
|
|
239
|
-
// TODO(v5): delete
|
|
240
|
-
set content(x) {
|
|
241
|
-
this._content.set(x);
|
|
242
|
-
}
|
|
243
215
|
ngAfterViewChecked() {
|
|
244
216
|
this.refresh$.next();
|
|
245
217
|
}
|
|
@@ -251,31 +223,25 @@ class TuiDropdownDirective {
|
|
|
251
223
|
}
|
|
252
224
|
toggle(show) {
|
|
253
225
|
const ref = this.ref();
|
|
254
|
-
if (show && this.
|
|
226
|
+
if (show && this.content() && !ref) {
|
|
255
227
|
this.ref.set(this.service.add(this.component));
|
|
256
228
|
}
|
|
257
229
|
else if (!show && ref) {
|
|
258
230
|
this.ref.set(null);
|
|
259
231
|
ref.destroy();
|
|
260
232
|
}
|
|
261
|
-
this.drivers.forEach((driver) => driver?.next(show));
|
|
262
233
|
// TODO: Remove in v5, only needed in Angular 16
|
|
263
234
|
this.cdr.markForCheck();
|
|
235
|
+
this.drivers.forEach((driver) => driver?.next(show));
|
|
264
236
|
}
|
|
265
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
266
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
267
|
-
tuiAsRectAccessor(TuiDropdownDirective),
|
|
268
|
-
tuiAsVehicle(TuiDropdownDirective),
|
|
269
|
-
], exportAs: ["tuiDropdown"], hostDirectives: [{ directive: TuiDropdownDriverDirective }, { directive: TuiDropdownPosition, outputs: ["tuiDropdownDirectionChange", "tuiDropdownDirectionChange"] }], ngImport: i0 }); }
|
|
237
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
238
|
+
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
239
|
}
|
|
271
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
240
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownDirective, decorators: [{
|
|
272
241
|
type: Directive,
|
|
273
242
|
args: [{
|
|
274
243
|
selector: '[tuiDropdown]:not(ng-container):not(ng-template)',
|
|
275
|
-
providers: [
|
|
276
|
-
tuiAsRectAccessor(TuiDropdownDirective),
|
|
277
|
-
tuiAsVehicle(TuiDropdownDirective),
|
|
278
|
-
],
|
|
244
|
+
providers: [tuiAsVehicle(TuiDropdownDirective)],
|
|
279
245
|
exportAs: 'tuiDropdown',
|
|
280
246
|
hostDirectives: [
|
|
281
247
|
TuiDropdownDriverDirective,
|
|
@@ -288,9 +254,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
288
254
|
'[class.tui-dropdown-open]': 'ref()',
|
|
289
255
|
},
|
|
290
256
|
}]
|
|
291
|
-
}]
|
|
292
|
-
type: Input
|
|
293
|
-
}] } });
|
|
257
|
+
}] });
|
|
294
258
|
|
|
295
259
|
/**
|
|
296
260
|
* @description:
|
|
@@ -304,7 +268,7 @@ class TuiDropdownComponent {
|
|
|
304
268
|
this.viewport = inject(TUI_VIEWPORT);
|
|
305
269
|
this.vvs = inject(TuiVisualViewportService);
|
|
306
270
|
this.styles$ = inject(TuiPositionService).pipe(takeWhile(() => this.directive.el.isConnected &&
|
|
307
|
-
!!this.directive.el.getBoundingClientRect().height), map((v) => (this.position === 'fixed' ? this.vvs.correct(v) : v)), map((
|
|
271
|
+
!!this.directive.el.getBoundingClientRect().height), map((v) => (this.position === 'fixed' ? this.vvs.correct(v) : v)), map((point) => this.getStyles(...point)), takeUntilDestroyed());
|
|
308
272
|
this.options = inject(TUI_DROPDOWN_OPTIONS);
|
|
309
273
|
this.directive = inject(TuiDropdownDirective);
|
|
310
274
|
this.context = inject(TUI_DROPDOWN_CONTEXT, { optional: true });
|
|
@@ -343,51 +307,47 @@ class TuiDropdownComponent {
|
|
|
343
307
|
maxWidth: tuiPx(Math.round(viewport.width) - 16), // 8px min gap from each side
|
|
344
308
|
};
|
|
345
309
|
}
|
|
346
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
347
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
310
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
311
|
+
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: [
|
|
348
312
|
TuiPositionService,
|
|
349
313
|
tuiPositionAccessorFor('dropdown', TuiDropdownPosition),
|
|
350
|
-
tuiRectAccessorFor('dropdown', TuiDropdownDirective),
|
|
351
|
-
], hostDirectives: [{ directive: i1.TuiActiveZone }, { directive: i2.TuiAnimated }], ngImport: i0, template: "<tui-scrollbar class=\"t-scroll\">\n <div\n *polymorpheusOutlet=\"directive.
|
|
314
|
+
tuiRectAccessorFor('dropdown', forwardRef(() => TuiDropdownDirective)),
|
|
315
|
+
], 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 }); }
|
|
352
316
|
}
|
|
353
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
317
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownComponent, decorators: [{
|
|
354
318
|
type: Component,
|
|
355
319
|
args: [{ selector: 'tui-dropdown', imports: [PolymorpheusOutlet, TuiScrollbar], changeDetection: ChangeDetectionStrategy.Default, providers: [
|
|
356
320
|
TuiPositionService,
|
|
357
321
|
tuiPositionAccessorFor('dropdown', TuiDropdownPosition),
|
|
358
|
-
tuiRectAccessorFor('dropdown', TuiDropdownDirective),
|
|
322
|
+
tuiRectAccessorFor('dropdown', forwardRef(() => TuiDropdownDirective)),
|
|
359
323
|
], hostDirectives: [TuiActiveZone, TuiAnimated], host: {
|
|
360
324
|
'[attr.data-appearance]': 'options.appearance',
|
|
361
325
|
'[attr.tuiTheme]': 'theme()',
|
|
362
|
-
}, template: "<tui-scrollbar class=\"t-scroll\">\n <div\n *polymorpheusOutlet=\"directive.
|
|
326
|
+
}, 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"] }]
|
|
363
327
|
}] });
|
|
364
328
|
|
|
365
329
|
class TuiDropdownContent {
|
|
366
330
|
constructor() {
|
|
367
331
|
this.directive = inject(TuiDropdownDirective);
|
|
368
|
-
this.directive.tuiDropdown
|
|
332
|
+
tuiSetSignal(this.directive.tuiDropdown, inject(TemplateRef));
|
|
369
333
|
if (isPlatformBrowser(inject(PLATFORM_ID)) &&
|
|
370
334
|
this.directive.el.matches(':focus-within')) {
|
|
371
335
|
this.directive.toggle(true);
|
|
372
336
|
}
|
|
373
337
|
}
|
|
374
338
|
ngOnDestroy() {
|
|
375
|
-
this.directive.tuiDropdown
|
|
339
|
+
tuiSetSignal(this.directive.tuiDropdown, null);
|
|
376
340
|
}
|
|
377
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
378
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
341
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
342
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownContent, isStandalone: true, selector: "ng-template[tuiDropdown]", ngImport: i0 }); }
|
|
379
343
|
}
|
|
380
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContent, decorators: [{
|
|
381
345
|
type: Directive,
|
|
382
346
|
args: [{
|
|
383
347
|
selector: 'ng-template[tuiDropdown]',
|
|
384
348
|
}]
|
|
385
349
|
}], ctorParameters: () => [] });
|
|
386
350
|
|
|
387
|
-
function activeZoneFilter(event) {
|
|
388
|
-
return (!event ||
|
|
389
|
-
(this.driver.value && !this.activeZone.contains(tuiGetActualTarget(event))));
|
|
390
|
-
}
|
|
391
351
|
class TuiDropdownContext extends TuiRectAccessor {
|
|
392
352
|
constructor() {
|
|
393
353
|
super(...arguments);
|
|
@@ -397,34 +357,31 @@ class TuiDropdownContext extends TuiRectAccessor {
|
|
|
397
357
|
this.activeZone = inject(TuiActiveZone);
|
|
398
358
|
this.driver = inject(TuiDropdownDriver);
|
|
399
359
|
this.doc = inject(DOCUMENT);
|
|
400
|
-
this.sub = merge(tuiTypedFromEvent(this.doc, 'pointerdown'), tuiTypedFromEvent(this.doc, 'contextmenu', { capture: true }))
|
|
401
|
-
.pipe(
|
|
402
|
-
.
|
|
360
|
+
this.sub = merge(tuiTypedFromEvent(this.doc, 'pointerdown'), tuiTypedFromEvent(this.doc, 'keydown').pipe(filter(({ key }) => key === 'Escape')), tuiTypedFromEvent(this.doc, 'contextmenu', { capture: true }))
|
|
361
|
+
.pipe(filter((event) => this.driver.value &&
|
|
362
|
+
!this.activeZone.contains(tuiGetActualTarget(event))), tuiZoneOptimized(), takeUntilDestroyed())
|
|
363
|
+
.subscribe(() => {
|
|
364
|
+
this.driver.next(false);
|
|
365
|
+
this.currentRect = EMPTY_CLIENT_RECT;
|
|
366
|
+
});
|
|
403
367
|
this.type = 'dropdown';
|
|
404
368
|
}
|
|
405
369
|
getClientRect() {
|
|
406
370
|
return this.currentRect;
|
|
407
371
|
}
|
|
408
|
-
closeDropdown(_event) {
|
|
409
|
-
this.driver.next(false);
|
|
410
|
-
this.currentRect = EMPTY_CLIENT_RECT;
|
|
411
|
-
}
|
|
412
372
|
onContextMenu(x, y) {
|
|
413
373
|
this.currentRect = tuiPointToClientRect(x, y);
|
|
414
374
|
this.driver.next(true);
|
|
415
375
|
}
|
|
416
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
417
|
-
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: { "longtap": "onContextMenu($event.detail.clientX, $event.detail.clientY)" }, properties: { "style.user-select": "userSelect()", "style.-webkit-user-select": "userSelect()", "style.-webkit-touch-callout": "userSelect()" } }, providers: [
|
|
418
378
|
TuiActiveZone,
|
|
419
379
|
TuiDropdownDriver,
|
|
420
380
|
tuiAsDriver(TuiDropdownDriver),
|
|
421
381
|
tuiAsRectAccessor(TuiDropdownContext),
|
|
422
382
|
], usesInheritance: true, ngImport: i0 }); }
|
|
423
383
|
}
|
|
424
|
-
|
|
425
|
-
shouldCall(activeZoneFilter)
|
|
426
|
-
], TuiDropdownContext.prototype, "closeDropdown", null);
|
|
427
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownContext, decorators: [{
|
|
384
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownContext, decorators: [{
|
|
428
385
|
type: Directive,
|
|
429
386
|
args: [{
|
|
430
387
|
selector: '[tuiDropdownContext]',
|
|
@@ -438,11 +395,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
438
395
|
'[style.user-select]': 'userSelect()',
|
|
439
396
|
'[style.-webkit-user-select]': 'userSelect()',
|
|
440
397
|
'[style.-webkit-touch-callout]': 'userSelect()',
|
|
441
|
-
'(document:keydown.esc)': 'closeDropdown()',
|
|
442
398
|
'(longtap)': 'onContextMenu($event.detail.clientX, $event.detail.clientY)',
|
|
443
399
|
},
|
|
444
400
|
}]
|
|
445
|
-
}]
|
|
401
|
+
}] });
|
|
446
402
|
|
|
447
403
|
/** Default values for hint options */
|
|
448
404
|
const TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS = {
|
|
@@ -452,48 +408,58 @@ const TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS = {
|
|
|
452
408
|
/**
|
|
453
409
|
* Default parameters for dropdown hover directive
|
|
454
410
|
*/
|
|
455
|
-
const TUI_DROPDOWN_HOVER_OPTIONS =
|
|
456
|
-
factory: () => TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS,
|
|
457
|
-
});
|
|
458
|
-
function tuiDropdownHoverOptionsProvider(options) {
|
|
459
|
-
return tuiProvideOptions(TUI_DROPDOWN_HOVER_OPTIONS, options, TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS);
|
|
460
|
-
}
|
|
411
|
+
const [TUI_DROPDOWN_HOVER_OPTIONS, tuiDropdownHoverOptionsProvider] = tuiCreateOptions(TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS);
|
|
461
412
|
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
this.
|
|
469
|
-
|
|
470
|
-
|
|
413
|
+
class TuiDropdownClose {
|
|
414
|
+
constructor() {
|
|
415
|
+
this.el = tuiInjectElement();
|
|
416
|
+
this.ref = inject(TuiDropdownDirective).ref;
|
|
417
|
+
this.open = inject(TuiDropdownOpen);
|
|
418
|
+
this.obscured = inject(TuiObscured);
|
|
419
|
+
this.activeZone = inject(TuiActiveZone);
|
|
420
|
+
this.tuiDropdownClose = outputFromObservable(merge(inject(TuiDropdownDriver).pipe(tuiIfMap(() => merge(tuiCloseWatcher(), this.obscured.tuiObscured$.pipe(filter(Boolean)), this.activeZone.tuiActiveZoneChange.pipe(filter((a) => !a)), tuiTypedFromEvent(this.el, 'focusin').pipe(filter((event) => !this.open.host.contains(tuiGetActualTarget(event)) ||
|
|
421
|
+
!this.ref()))))),
|
|
422
|
+
// @ts-ignore
|
|
423
|
+
typeof CloseWatcher === 'undefined'
|
|
424
|
+
? tuiTypedFromEvent(inject(DOCUMENT), 'keydown', { capture: true }).pipe(filter(({ key }) => key === 'Escape' &&
|
|
425
|
+
this.open.open() &&
|
|
426
|
+
!this.ref()?.location.nativeElement?.nextElementSibling), tuiStopPropagation())
|
|
427
|
+
: EMPTY));
|
|
428
|
+
}
|
|
429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownClose, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
430
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownClose, isStandalone: true, outputs: { tuiDropdownClose: "tuiDropdownClose" }, ngImport: i0 }); }
|
|
471
431
|
}
|
|
432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownClose, decorators: [{
|
|
433
|
+
type: Directive
|
|
434
|
+
}] });
|
|
435
|
+
|
|
472
436
|
class TuiDropdownOpen {
|
|
473
437
|
constructor() {
|
|
438
|
+
this.dropdownHost = contentChild('tuiDropdownHost', {
|
|
439
|
+
descendants: true,
|
|
440
|
+
read: ElementRef,
|
|
441
|
+
});
|
|
474
442
|
this.directive = inject(TuiDropdownDirective);
|
|
475
443
|
this.el = tuiInjectElement();
|
|
476
444
|
this.obscured = inject(TuiObscured);
|
|
477
|
-
this.activeZone = inject(TuiActiveZone);
|
|
478
|
-
this.dropdown = computed(() => this.directive.ref()?.location.nativeElement);
|
|
479
|
-
this.tuiDropdownEnabled = true;
|
|
480
|
-
this.tuiDropdownOpen = false;
|
|
481
|
-
this.tuiDropdownOpenChange = new EventEmitter();
|
|
482
|
-
// TODO: make it private when all legacy controls will be deleted from @taiga-ui/legacy (5.0)
|
|
483
445
|
this.driver = inject(TuiDropdownDriver);
|
|
484
|
-
this.
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
this.
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
446
|
+
this.dropdown = computed(() => this.directive.ref()?.location.nativeElement);
|
|
447
|
+
this.enabled = input(true, { alias: 'tuiDropdownEnabled' });
|
|
448
|
+
this.open = model(false, { alias: 'tuiDropdownOpen' });
|
|
449
|
+
this.driveEffect = effect(() => this.drive(this.open()));
|
|
450
|
+
this.syncSub = this.driver
|
|
451
|
+
.pipe(filter((open) => open !== this.open()), takeUntilDestroyed())
|
|
452
|
+
.subscribe((open) => this.update(open));
|
|
453
|
+
this.keydownSub = tuiTypedFromEvent(inject(DOCUMENT), 'keydown')
|
|
454
|
+
.pipe(takeUntilDestroyed())
|
|
455
|
+
.subscribe((event) => this.onKeydown(event));
|
|
493
456
|
}
|
|
494
|
-
|
|
495
|
-
this.
|
|
496
|
-
|
|
457
|
+
get host() {
|
|
458
|
+
const initial = this.dropdownHost()?.nativeElement || this.el;
|
|
459
|
+
const focusable = tuiIsFocusable(initial)
|
|
460
|
+
? initial
|
|
461
|
+
: tuiGetClosestFocusable({ initial, root: this.el });
|
|
462
|
+
return this.dropdownHost()?.nativeElement || focusable || this.el;
|
|
497
463
|
}
|
|
498
464
|
toggle(open) {
|
|
499
465
|
if (this.focused && !open) {
|
|
@@ -501,25 +467,27 @@ class TuiDropdownOpen {
|
|
|
501
467
|
}
|
|
502
468
|
this.update(open);
|
|
503
469
|
}
|
|
504
|
-
onEsc(event) {
|
|
505
|
-
event.preventDefault();
|
|
506
|
-
this.toggle(false);
|
|
507
|
-
}
|
|
508
470
|
onClick(target) {
|
|
509
471
|
if (!this.editable && this.host.contains(target)) {
|
|
510
|
-
this.update(!this.
|
|
472
|
+
this.update(!this.open());
|
|
511
473
|
}
|
|
512
474
|
}
|
|
513
475
|
onArrow(event, up) {
|
|
514
476
|
if (!tuiIsElement(event.target) ||
|
|
515
477
|
!this.host.contains(event.target) ||
|
|
516
|
-
!this.
|
|
517
|
-
!this.directive.
|
|
478
|
+
!this.enabled() ||
|
|
479
|
+
!this.directive.content()) {
|
|
518
480
|
return;
|
|
519
481
|
}
|
|
520
482
|
event.preventDefault();
|
|
521
483
|
this.focusDropdown(up);
|
|
522
484
|
}
|
|
485
|
+
get editable() {
|
|
486
|
+
return tuiIsElementEditable(this.host);
|
|
487
|
+
}
|
|
488
|
+
get focused() {
|
|
489
|
+
return tuiIsFocusedIn(this.host) || tuiIsFocusedIn(this.dropdown());
|
|
490
|
+
}
|
|
523
491
|
onKeydown(event) {
|
|
524
492
|
const target = tuiGetActualTarget(event);
|
|
525
493
|
if (!event.defaultPrevented &&
|
|
@@ -531,29 +499,15 @@ class TuiDropdownOpen {
|
|
|
531
499
|
this.host.focus({ preventScroll: true });
|
|
532
500
|
}
|
|
533
501
|
}
|
|
534
|
-
get host() {
|
|
535
|
-
const initial = this.dropdownHost?.nativeElement || this.el;
|
|
536
|
-
const focusable = tuiIsKeyboardFocusable(initial)
|
|
537
|
-
? initial
|
|
538
|
-
: tuiGetClosestFocusable({ initial, root: this.el });
|
|
539
|
-
return this.dropdownHost?.nativeElement || focusable || this.el;
|
|
540
|
-
}
|
|
541
|
-
get editable() {
|
|
542
|
-
return tuiIsElementEditable(this.host);
|
|
543
|
-
}
|
|
544
|
-
get focused() {
|
|
545
|
-
return tuiIsFocusedIn(this.host) || tuiIsFocusedIn(this.dropdown());
|
|
546
|
-
}
|
|
547
502
|
update(open) {
|
|
548
|
-
if (open && !this.
|
|
503
|
+
if (open && !this.enabled()) {
|
|
549
504
|
return this.drive();
|
|
550
505
|
}
|
|
551
|
-
this.
|
|
552
|
-
this.tuiDropdownOpenChange.emit(open);
|
|
506
|
+
this.open.set(open);
|
|
553
507
|
this.drive();
|
|
554
508
|
}
|
|
555
|
-
drive(open =
|
|
556
|
-
this.obscured.tuiObscuredEnabled
|
|
509
|
+
drive(open = this.open() && this.enabled()) {
|
|
510
|
+
tuiSetSignal(this.obscured.tuiObscuredEnabled, open);
|
|
557
511
|
this.driver.next(open);
|
|
558
512
|
}
|
|
559
513
|
focusDropdown(previous) {
|
|
@@ -569,19 +523,20 @@ class TuiDropdownOpen {
|
|
|
569
523
|
child.remove();
|
|
570
524
|
focusable?.focus();
|
|
571
525
|
}
|
|
572
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
573
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
526
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
527
|
+
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)", "tuiActiveZoneChange": "0", "tuiDropdownClose": "toggle(false)" } }, providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)], queries: [{ propertyName: "dropdownHost", first: true, predicate: ["tuiDropdownHost"], descendants: true, read: ElementRef, isSignal: true }], hostDirectives: [{ directive: i1$1.TuiObscured }, { directive: TuiDropdownClose, outputs: ["tuiDropdownClose", "tuiDropdownClose"] }, { directive: i1.TuiActiveZone, inputs: ["tuiActiveZoneParent", "tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange", "tuiActiveZoneChange"] }], ngImport: i0 }); }
|
|
574
528
|
}
|
|
575
|
-
|
|
576
|
-
shouldCall(shouldClose)
|
|
577
|
-
], TuiDropdownOpen.prototype, "onEsc", null);
|
|
578
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownOpen, decorators: [{
|
|
529
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownOpen, decorators: [{
|
|
579
530
|
type: Directive,
|
|
580
531
|
args: [{
|
|
581
|
-
selector: '[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]',
|
|
532
|
+
selector: '[tuiDropdown][tuiDropdownAuto],[tuiDropdown][tuiDropdownOpen],[tuiDropdown][tuiDropdownOpenChange]',
|
|
582
533
|
providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)],
|
|
583
534
|
hostDirectives: [
|
|
584
535
|
TuiObscured,
|
|
536
|
+
{
|
|
537
|
+
directive: TuiDropdownClose,
|
|
538
|
+
outputs: ['tuiDropdownClose'],
|
|
539
|
+
},
|
|
585
540
|
{
|
|
586
541
|
directive: TuiActiveZone,
|
|
587
542
|
inputs: ['tuiActiveZoneParent'],
|
|
@@ -592,43 +547,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
592
547
|
'(click)': 'onClick($event.target)',
|
|
593
548
|
'(keydown.arrowDown)': 'onArrow($event, false)',
|
|
594
549
|
'(keydown.arrowUp)': 'onArrow($event, true)',
|
|
595
|
-
'(document:keydown.zoneless.capture)': 'onEsc($event)',
|
|
596
|
-
'(document:keydown.zoneless)': 'onKeydown($event)',
|
|
597
550
|
// TODO: Necessary because startWith(false) + distinctUntilChanged() in TuiActiveZone, think of better solution
|
|
598
551
|
'(tuiActiveZoneChange)': '0',
|
|
552
|
+
'(tuiDropdownClose)': 'toggle(false)',
|
|
599
553
|
},
|
|
600
554
|
}]
|
|
601
|
-
}]
|
|
602
|
-
type: ContentChild,
|
|
603
|
-
args: ['tuiDropdownHost', { descendants: true, read: ElementRef }]
|
|
604
|
-
}], tuiDropdownEnabled: [{
|
|
605
|
-
type: Input
|
|
606
|
-
}], tuiDropdownOpen: [{
|
|
607
|
-
type: Input
|
|
608
|
-
}], tuiDropdownOpenChange: [{
|
|
609
|
-
type: Output
|
|
610
|
-
}], onEsc: [] } });
|
|
555
|
+
}] });
|
|
611
556
|
|
|
612
557
|
class TuiDropdownHover extends TuiDriver {
|
|
613
558
|
constructor() {
|
|
614
559
|
super((subscriber) => this.stream$.subscribe(subscriber));
|
|
560
|
+
this.dropdownHost = contentChild('tuiDropdownHost', {
|
|
561
|
+
descendants: true,
|
|
562
|
+
read: ElementRef,
|
|
563
|
+
});
|
|
564
|
+
this.hovered = false;
|
|
615
565
|
this.el = tuiInjectElement();
|
|
616
566
|
this.doc = inject(DOCUMENT);
|
|
617
567
|
this.options = inject(TUI_DROPDOWN_HOVER_OPTIONS);
|
|
618
568
|
this.activeZone = inject(TuiActiveZone);
|
|
619
569
|
this.open = inject(TuiDropdownOpen, { optional: true });
|
|
570
|
+
this.stream$ = merge(
|
|
620
571
|
/**
|
|
621
572
|
* Dropdown can be removed not only via click/touch –
|
|
622
573
|
* swipe on mobile devices removes dropdown sheet without triggering new mouseover / mouseout events.
|
|
623
574
|
*/
|
|
624
|
-
|
|
625
|
-
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) => {
|
|
575
|
+
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) => {
|
|
626
576
|
this.hovered = hovered;
|
|
627
577
|
this.open?.toggle(hovered);
|
|
628
578
|
}), share());
|
|
629
|
-
this.
|
|
630
|
-
this.
|
|
631
|
-
this.hovered = false;
|
|
579
|
+
this.tuiDropdownShowDelay = input(this.options.showDelay);
|
|
580
|
+
this.tuiDropdownHideDelay = input(this.options.hideDelay);
|
|
632
581
|
this.type = 'dropdown';
|
|
633
582
|
}
|
|
634
583
|
onClick(event) {
|
|
@@ -637,15 +586,15 @@ class TuiDropdownHover extends TuiDriver {
|
|
|
637
586
|
}
|
|
638
587
|
}
|
|
639
588
|
isHovered(element) {
|
|
640
|
-
const host = this.dropdownHost?.nativeElement || this.el;
|
|
589
|
+
const host = this.dropdownHost()?.nativeElement || this.el;
|
|
641
590
|
const hovered = host.contains(element);
|
|
642
591
|
const child = !this.el.contains(element) && this.activeZone.contains(element);
|
|
643
592
|
return hovered || child;
|
|
644
593
|
}
|
|
645
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
646
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
594
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownHover, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
595
|
+
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 }); }
|
|
647
596
|
}
|
|
648
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownHover, decorators: [{
|
|
649
598
|
type: Directive,
|
|
650
599
|
args: [{
|
|
651
600
|
selector: '[tuiDropdownHover]',
|
|
@@ -654,65 +603,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
654
603
|
'(click.capture)': 'onClick($event)',
|
|
655
604
|
},
|
|
656
605
|
}]
|
|
657
|
-
}], ctorParameters: () => []
|
|
658
|
-
type: ContentChild,
|
|
659
|
-
args: ['tuiDropdownHost', { descendants: true, read: ElementRef }]
|
|
660
|
-
}], showDelay: [{
|
|
661
|
-
type: Input,
|
|
662
|
-
args: ['tuiDropdownShowDelay']
|
|
663
|
-
}], hideDelay: [{
|
|
664
|
-
type: Input,
|
|
665
|
-
args: ['tuiDropdownHideDelay']
|
|
666
|
-
}] } });
|
|
606
|
+
}], ctorParameters: () => [] });
|
|
667
607
|
|
|
668
608
|
class TuiDropdownManual {
|
|
669
609
|
constructor() {
|
|
670
610
|
this.driver = inject(TuiDropdownDriver);
|
|
671
|
-
this.tuiDropdownManual = false;
|
|
611
|
+
this.tuiDropdownManual = input(false);
|
|
672
612
|
}
|
|
673
613
|
ngOnChanges() {
|
|
674
|
-
this.driver.next(!!this.tuiDropdownManual);
|
|
614
|
+
this.driver.next(!!this.tuiDropdownManual());
|
|
675
615
|
}
|
|
676
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
677
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
616
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownManual, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
617
|
+
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 }); }
|
|
678
618
|
}
|
|
679
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
619
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownManual, decorators: [{
|
|
680
620
|
type: Directive,
|
|
681
621
|
args: [{
|
|
682
622
|
selector: '[tuiDropdownManual]',
|
|
683
623
|
providers: [TuiDropdownDriver, tuiAsDriver(TuiDropdownDriver)],
|
|
684
624
|
}]
|
|
685
|
-
}]
|
|
686
|
-
type: Input
|
|
687
|
-
}] } });
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* @deprecated TODO: remove in v.5 when legacy controls are dropped
|
|
691
|
-
*/
|
|
692
|
-
class TuiDropdownOpenLegacy {
|
|
693
|
-
constructor() {
|
|
694
|
-
this.openStateSub = new Subject();
|
|
695
|
-
this.tuiDropdownOpenChange = this.openStateSub.pipe(distinctUntilChanged());
|
|
696
|
-
}
|
|
697
|
-
set tuiDropdownOpen(open) {
|
|
698
|
-
this.emitOpenChange(open);
|
|
699
|
-
}
|
|
700
|
-
emitOpenChange(open) {
|
|
701
|
-
this.openStateSub.next(open);
|
|
702
|
-
}
|
|
703
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownOpenLegacy, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
704
|
-
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 }); }
|
|
705
|
-
}
|
|
706
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDropdownOpenLegacy, decorators: [{
|
|
707
|
-
type: Directive,
|
|
708
|
-
args: [{
|
|
709
|
-
selector: '[tuiDropdownOpen]:not([tuiDropdown]),[tuiDropdownOpenChange]:not([tuiDropdown])',
|
|
710
|
-
}]
|
|
711
|
-
}], propDecorators: { tuiDropdownOpenChange: [{
|
|
712
|
-
type: Output
|
|
713
|
-
}], tuiDropdownOpen: [{
|
|
714
|
-
type: Input
|
|
715
|
-
}] } });
|
|
625
|
+
}] });
|
|
716
626
|
|
|
717
627
|
class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
718
628
|
constructor() {
|
|
@@ -721,12 +631,12 @@ class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
|
721
631
|
this.viewport = inject(TUI_VIEWPORT);
|
|
722
632
|
this.vertical = inject(TuiDropdownPosition);
|
|
723
633
|
this.previous = this.options.direction || 'bottom';
|
|
724
|
-
this.tuiDropdownSided = '';
|
|
725
|
-
this.tuiDropdownSidedOffset = 4;
|
|
634
|
+
this.tuiDropdownSided = input('');
|
|
635
|
+
this.tuiDropdownSidedOffset = input(4);
|
|
726
636
|
this.type = 'dropdown';
|
|
727
637
|
}
|
|
728
638
|
getPosition(rect) {
|
|
729
|
-
if (this.tuiDropdownSided === false) {
|
|
639
|
+
if (this.tuiDropdownSided() === false) {
|
|
730
640
|
return this.vertical.getPosition(rect);
|
|
731
641
|
}
|
|
732
642
|
const { height, width } = rect;
|
|
@@ -742,37 +652,33 @@ class TuiDropdownPositionSided extends TuiPositionAccessor {
|
|
|
742
652
|
bottom: viewport.bottom - hostRect.top,
|
|
743
653
|
};
|
|
744
654
|
const position = {
|
|
745
|
-
top: hostRect.bottom - height + this.tuiDropdownSidedOffset + 1, // 1 for border
|
|
655
|
+
top: hostRect.bottom - height + this.tuiDropdownSidedOffset() + 1, // 1 for border
|
|
746
656
|
left: hostRect.left - width - offset,
|
|
747
657
|
right: hostRect.right + offset,
|
|
748
|
-
bottom: hostRect.top - this.tuiDropdownSidedOffset - 1, // 1 for border
|
|
658
|
+
bottom: hostRect.top - this.tuiDropdownSidedOffset() - 1, // 1 for border
|
|
749
659
|
};
|
|
750
660
|
const better = available.top > available.bottom ? 'top' : 'bottom';
|
|
751
661
|
const maxLeft = available.left > available.right ? position.left : position.right;
|
|
752
662
|
const left = available[align] > width ? position[align] : maxLeft;
|
|
753
663
|
if ((available[this.previous] > height && direction) ||
|
|
754
664
|
this.previous === better) {
|
|
755
|
-
this.vertical.
|
|
756
|
-
return [position[this.previous]
|
|
665
|
+
this.vertical.direction.next(this.previous);
|
|
666
|
+
return [left, position[this.previous]];
|
|
757
667
|
}
|
|
758
668
|
this.previous = better;
|
|
759
|
-
this.vertical.
|
|
760
|
-
return [position[better]
|
|
669
|
+
this.vertical.direction.next(better);
|
|
670
|
+
return [left, position[better]];
|
|
761
671
|
}
|
|
762
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
763
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
672
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPositionSided, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
673
|
+
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 }); }
|
|
764
674
|
}
|
|
765
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
675
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownPositionSided, decorators: [{
|
|
766
676
|
type: Directive,
|
|
767
677
|
args: [{
|
|
768
678
|
selector: '[tuiDropdownSided]',
|
|
769
679
|
providers: [TuiDropdownPosition, tuiAsPositionAccessor(TuiDropdownPositionSided)],
|
|
770
680
|
}]
|
|
771
|
-
}]
|
|
772
|
-
type: Input
|
|
773
|
-
}], tuiDropdownSidedOffset: [{
|
|
774
|
-
type: Input
|
|
775
|
-
}] } });
|
|
681
|
+
}] });
|
|
776
682
|
|
|
777
683
|
class TuiDropdownSelection extends TuiDriver {
|
|
778
684
|
constructor() {
|
|
@@ -781,9 +687,9 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
781
687
|
this.vcr = inject(ViewContainerRef);
|
|
782
688
|
this.dropdown = inject(TuiDropdownDirective);
|
|
783
689
|
this.el = tuiInjectElement();
|
|
784
|
-
this.handler
|
|
690
|
+
this.handler = computed((visible = this.tuiDropdownSelection()) => tuiIsString(visible) ? TUI_TRUE_HANDLER : visible);
|
|
785
691
|
this.stream$ = combineLatest([
|
|
786
|
-
this.handler
|
|
692
|
+
toObservable(this.handler),
|
|
787
693
|
inject(TUI_SELECTION_STREAM).pipe(map(() => this.getRange()), filter((range) => this.isValid(range)), distinctUntilChanged((x, y) => x.startOffset === y.startOffset &&
|
|
788
694
|
x.endOffset === y.endOffset &&
|
|
789
695
|
x.commonAncestorContainer === y.commonAncestorContainer)),
|
|
@@ -795,17 +701,15 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
795
701
|
: this.range;
|
|
796
702
|
return (contained && handler(this.range)) || this.inDropdown(range);
|
|
797
703
|
}));
|
|
798
|
-
this.range = inject(
|
|
799
|
-
|
|
704
|
+
this.range = isPlatformBrowser(inject(PLATFORM_ID))
|
|
705
|
+
? new Range()
|
|
706
|
+
: {};
|
|
800
707
|
this.type = 'dropdown';
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
if (!tuiIsString(visible)) {
|
|
804
|
-
this.handler$.next(visible);
|
|
805
|
-
}
|
|
708
|
+
this.tuiDropdownSelection = input('');
|
|
709
|
+
this.tuiDropdownSelectionPosition = input('selection');
|
|
806
710
|
}
|
|
807
711
|
getClientRect() {
|
|
808
|
-
switch (this.
|
|
712
|
+
switch (this.tuiDropdownSelectionPosition()) {
|
|
809
713
|
case 'tag': {
|
|
810
714
|
const { commonAncestorContainer } = this.range;
|
|
811
715
|
const element = tuiIsElement(commonAncestorContainer)
|
|
@@ -896,13 +800,13 @@ class TuiDropdownSelection extends TuiDriver {
|
|
|
896
800
|
this.ghost = ghost;
|
|
897
801
|
return ghost;
|
|
898
802
|
}
|
|
899
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
900
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
803
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSelection, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
804
|
+
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: [
|
|
901
805
|
tuiAsDriver(TuiDropdownSelection),
|
|
902
806
|
tuiAsRectAccessor(TuiDropdownSelection),
|
|
903
807
|
], usesInheritance: true, ngImport: i0 }); }
|
|
904
808
|
}
|
|
905
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSelection, decorators: [{
|
|
906
810
|
type: Directive,
|
|
907
811
|
args: [{
|
|
908
812
|
selector: '[tuiDropdownSelection]',
|
|
@@ -911,12 +815,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
911
815
|
tuiAsRectAccessor(TuiDropdownSelection),
|
|
912
816
|
],
|
|
913
817
|
}]
|
|
914
|
-
}], ctorParameters: () => []
|
|
915
|
-
type: Input,
|
|
916
|
-
args: ['tuiDropdownSelectionPosition']
|
|
917
|
-
}], tuiDropdownSelection: [{
|
|
918
|
-
type: Input
|
|
919
|
-
}] } });
|
|
818
|
+
}], ctorParameters: () => [] });
|
|
920
819
|
|
|
921
820
|
const TuiDropdown = [
|
|
922
821
|
TuiDropdownOptionsDirective,
|
|
@@ -924,7 +823,6 @@ const TuiDropdown = [
|
|
|
924
823
|
TuiDropdownDirective,
|
|
925
824
|
TuiDropdownComponent,
|
|
926
825
|
TuiDropdownOpen,
|
|
927
|
-
TuiDropdownOpenLegacy,
|
|
928
826
|
TuiDropdownManual,
|
|
929
827
|
TuiDropdownHover,
|
|
930
828
|
TuiDropdownContent,
|
|
@@ -938,25 +836,18 @@ function tuiDropdown(value) {
|
|
|
938
836
|
return tuiDirectiveBinding(TuiDropdownDirective, 'tuiDropdown', value, {});
|
|
939
837
|
}
|
|
940
838
|
function tuiDropdownEnabled(value) {
|
|
941
|
-
return tuiDirectiveBinding(TuiDropdownOpen, '
|
|
942
|
-
}
|
|
943
|
-
function tuiDropdownOpen() {
|
|
944
|
-
const open = tuiDirectiveBinding(TuiDropdownOpen, 'tuiDropdownOpen', false, {});
|
|
945
|
-
inject(TuiDropdownOpen)
|
|
946
|
-
.tuiDropdownOpenChange.pipe(takeUntilDestroyed())
|
|
947
|
-
.subscribe((value) => open.set(value));
|
|
948
|
-
return open;
|
|
839
|
+
return tuiDirectiveBinding(TuiDropdownOpen, 'enabled', value, {});
|
|
949
840
|
}
|
|
950
841
|
|
|
951
842
|
class TuiDropdownFixed {
|
|
952
843
|
constructor() {
|
|
953
|
-
const override = tuiOverrideOptions
|
|
844
|
+
const override = tuiOverrideOptions({ limitWidth: 'fixed' }, TUI_DROPDOWN_DEFAULT_OPTIONS);
|
|
954
845
|
override(inject(TUI_DROPDOWN_OPTIONS, { self: true, optional: true }), null);
|
|
955
846
|
}
|
|
956
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
957
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
847
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownFixed, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
848
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownFixed, isStandalone: true, providers: [tuiDropdownOptionsProvider({})], ngImport: i0 }); }
|
|
958
849
|
}
|
|
959
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
850
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownFixed, decorators: [{
|
|
960
851
|
type: Directive,
|
|
961
852
|
args: [{
|
|
962
853
|
providers: [tuiDropdownOptionsProvider({})],
|
|
@@ -970,18 +861,18 @@ class TuiDropdownAuto {
|
|
|
970
861
|
*/
|
|
971
862
|
inject(TUI_DROPDOWN_OPTIONS).limitWidth = 'auto';
|
|
972
863
|
}
|
|
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.
|
|
864
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownAuto, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
865
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiDropdownAuto, isStandalone: true, ngImport: i0 }); }
|
|
975
866
|
}
|
|
976
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
867
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownAuto, decorators: [{
|
|
977
868
|
type: Directive
|
|
978
869
|
}], ctorParameters: () => [] });
|
|
979
870
|
|
|
980
871
|
class TuiWithDropdownOpen {
|
|
981
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
982
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
872
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithDropdownOpen, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
873
|
+
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 }); }
|
|
983
874
|
}
|
|
984
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
875
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithDropdownOpen, decorators: [{
|
|
985
876
|
type: Directive,
|
|
986
877
|
args: [{
|
|
987
878
|
hostDirectives: [
|
|
@@ -998,5 +889,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
998
889
|
* Generated bundle index. Do not edit.
|
|
999
890
|
*/
|
|
1000
891
|
|
|
1001
|
-
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,
|
|
1002
|
-
//# sourceMappingURL=taiga-ui-core-
|
|
892
|
+
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, TuiDropdownClose, TuiDropdownComponent, TuiDropdownContent, TuiDropdownContext, TuiDropdownDirective, TuiDropdownDriver, TuiDropdownDriverDirective, TuiDropdownFixed, TuiDropdownHover, TuiDropdownManual, TuiDropdownOpen, TuiDropdownOptionsDirective, TuiDropdownPosition, TuiDropdownPositionSided, TuiDropdownSelection, TuiWithDropdownOpen, tuiDropdown, tuiDropdownEnabled, tuiDropdownHoverOptionsProvider, tuiDropdownOptionsProvider };
|
|
893
|
+
//# sourceMappingURL=taiga-ui-core-portals-dropdown.mjs.map
|