@taiga-ui/core 4.52.0-canary.2c75afa → 4.52.0-canary.2d877cf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/classes/accessors.d.ts +1 -1
- package/components/calendar/calendar-sheet.component.d.ts +1 -1
- package/components/calendar/calendar-sheet.options.d.ts +1 -3
- package/{pipes/calendar-sheet → components/calendar}/calendar-sheet.pipe.d.ts +2 -2
- package/components/calendar/calendar-spin.component.d.ts +1 -0
- package/components/calendar/calendar-year.component.d.ts +1 -1
- package/components/calendar/calendar.options.d.ts +9 -0
- package/components/calendar/index.d.ts +3 -0
- package/{pipes/order-week-days → components/calendar}/order-week-days.pipe.d.ts +1 -1
- package/components/data-list/data-list.component.d.ts +7 -11
- package/components/data-list/data-list.d.ts +3 -4
- package/components/data-list/data-list.tokens.d.ts +1 -23
- package/components/data-list/index.d.ts +3 -4
- package/components/data-list/opt-group.directive.d.ts +2 -2
- package/components/data-list/option-content.directive.d.ts +14 -0
- package/components/data-list/option-with-value.directive.d.ts +9 -0
- package/components/data-list/option.directive.d.ts +19 -0
- package/components/icon/icon.component.d.ts +2 -2
- package/components/index.d.ts +2 -3
- package/components/input/index.d.ts +2 -0
- package/components/input/input.d.ts +5 -0
- package/components/input/input.directive.d.ts +30 -0
- package/components/label/label.directive.d.ts +1 -1
- package/components/link/index.d.ts +0 -1
- package/components/link/link.directive.d.ts +8 -6
- package/components/loader/loader.options.d.ts +1 -3
- package/components/notification/index.d.ts +3 -0
- package/components/notification/notification.component.d.ts +14 -0
- package/components/notification/notification.d.ts +3 -0
- package/components/notification/notification.directive.d.ts +3 -3
- package/components/notification/notification.options.d.ts +10 -7
- package/components/notification/notification.service.d.ts +17 -0
- package/components/root/root.component.d.ts +1 -1
- package/components/scrollbar/scroll-ref.directive.d.ts +2 -0
- package/components/scrollbar/scrollbar.component.d.ts +1 -5
- package/components/spin-button/spin-button.component.d.ts +1 -1
- package/components/textfield/index.d.ts +0 -1
- package/components/textfield/textfield-multi/textfield-item.component.d.ts +3 -2
- package/components/textfield/textfield-multi/textfield-multi.component.d.ts +9 -13
- package/components/textfield/textfield.component.d.ts +23 -35
- package/components/textfield/textfield.d.ts +2 -3
- package/directives/group/group.directive.d.ts +7 -7
- package/directives/group/group.options.d.ts +1 -3
- package/directives/index.d.ts +0 -5
- package/directives/items-handlers/items-handlers.directive.d.ts +5 -9
- package/directives/items-handlers/items-handlers.tokens.d.ts +4 -4
- package/fesm2022/taiga-ui-core-classes.mjs +8 -10
- package/fesm2022/taiga-ui-core-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-button.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-calendar.mjs +137 -32
- package/fesm2022/taiga-ui-core-components-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-cell.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +109 -271
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +11 -10
- package/fesm2022/taiga-ui-core-components-error.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-expand.mjs +3 -3
- package/fesm2022/taiga-ui-core-components-icon.mjs +8 -8
- package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-input.mjs +103 -0
- package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-components-label.mjs +10 -12
- package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +13 -28
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +6 -11
- package/fesm2022/taiga-ui-core-components-loader.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-notification.mjs +95 -24
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +7 -8
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs +42 -48
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-spin-button.mjs +5 -5
- package/fesm2022/taiga-ui-core-components-spin-button.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-textfield.mjs +102 -257
- package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
- package/fesm2022/{taiga-ui-core-directives-title.mjs → taiga-ui-core-components-title.mjs} +7 -7
- package/fesm2022/{taiga-ui-core-directives-title.mjs.map → taiga-ui-core-components-title.mjs.map} +1 -1
- package/fesm2022/taiga-ui-core-components.mjs +2 -3
- package/fesm2022/taiga-ui-core-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +15 -14
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-group.mjs +22 -34
- package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs +11 -10
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +16 -37
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-number-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives.mjs +0 -5
- package/fesm2022/taiga-ui-core-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs +5 -8
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-pipes.mjs +0 -7
- package/fesm2022/taiga-ui-core-pipes.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-alert.mjs +73 -0
- package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-components-dialog.mjs → taiga-ui-core-portals-dialog.mjs} +15 -15
- package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-directives-dropdown.mjs → taiga-ui-core-portals-dropdown.mjs} +148 -240
- package/fesm2022/taiga-ui-core-portals-dropdown.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-directives-hint.mjs → taiga-ui-core-portals-hint.mjs} +49 -50
- package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-components-modal.mjs → taiga-ui-core-portals-modal.mjs} +10 -10
- package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-directives-popup.mjs → taiga-ui-core-portals-popup.mjs} +11 -11
- package/fesm2022/taiga-ui-core-portals-popup.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-portals.mjs +11 -0
- package/fesm2022/taiga-ui-core-portals.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-services.mjs +16 -55
- package/fesm2022/taiga-ui-core-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-tokens.mjs +8 -41
- package/fesm2022/taiga-ui-core-tokens.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-format.mjs +1 -23
- package/fesm2022/taiga-ui-core-utils-format.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +7 -16
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
- package/fesm2022/taiga-ui-core.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +70 -99
- package/pipes/format-number/format-number.pipe.d.ts +1 -1
- package/pipes/index.d.ts +0 -7
- package/{directives/notification/notification.directive.d.ts → portals/alert/alert.directive.d.ts} +3 -3
- package/{directives/notification/notification.service.d.ts → portals/alert/alert.service.d.ts} +3 -3
- package/portals/alert/index.d.ts +2 -0
- package/{components → portals}/dialog/dialog.service.d.ts +1 -1
- package/{directives → portals}/dropdown/dropdown-hover.directive.d.ts +5 -10
- package/{directives → portals}/dropdown/dropdown-hover.options.d.ts +1 -3
- package/{directives → portals}/dropdown/dropdown-manual.directive.d.ts +2 -2
- package/portals/dropdown/dropdown-open.directive.d.ts +30 -0
- package/{directives → portals}/dropdown/dropdown-position-sided.directive.d.ts +3 -3
- package/{directives → portals}/dropdown/dropdown-position.directive.d.ts +4 -4
- package/{directives → portals}/dropdown/dropdown-selection.directive.d.ts +4 -5
- package/{directives → portals}/dropdown/dropdown.bindings.d.ts +0 -1
- package/{directives → portals}/dropdown/dropdown.d.ts +1 -2
- package/{directives → portals}/dropdown/dropdown.directive.d.ts +5 -6
- package/{directives → portals}/dropdown/index.d.ts +0 -1
- package/{directives → portals}/hint/hint-position.directive.d.ts +1 -1
- package/portals/index.d.ts +6 -0
- package/services/index.d.ts +0 -2
- package/styles/components/link.less +8 -23
- package/styles/components/textfield.less +10 -7
- package/styles/mixins/appearance.less +1 -1
- package/styles/mixins/slider.scss +1 -2
- package/tokens/common-icons.d.ts +3 -3
- package/tokens/icons.d.ts +0 -4
- package/tokens/index.d.ts +0 -4
- package/types/index.d.ts +0 -2
- package/types/point.d.ts +1 -1
- package/types/size.d.ts +0 -11
- package/utils/format/index.d.ts +0 -1
- package/utils/miscellaneous/get-duration.d.ts +2 -0
- package/utils/miscellaneous/index.d.ts +1 -1
- package/animations/animations.d.ts +0 -109
- package/animations/index.d.ts +0 -1
- package/components/alert/alert.component.d.ts +0 -14
- package/components/alert/alert.directive.d.ts +0 -8
- package/components/alert/alert.interfaces.d.ts +0 -12
- package/components/alert/alert.service.d.ts +0 -11
- package/components/alert/alert.tokens.d.ts +0 -6
- package/components/alert/index.d.ts +0 -5
- package/components/data-list/data-list.directive.d.ts +0 -7
- package/components/data-list/option/option-content.d.ts +0 -16
- package/components/data-list/option/option-legacy.component.d.ts +0 -24
- package/components/data-list/option/option.directive.d.ts +0 -27
- package/components/link/link.options.d.ts +0 -12
- package/components/textfield/textfield.directive.d.ts +0 -35
- package/directives/dropdown/dropdown-open-legacy.directive.d.ts +0 -12
- package/directives/dropdown/dropdown-open.directive.d.ts +0 -33
- package/directives/notification/index.d.ts +0 -2
- package/fesm2022/taiga-ui-core-animations.mjs +0 -370
- package/fesm2022/taiga-ui-core-animations.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-alert.mjs +0 -110
- package/fesm2022/taiga-ui-core-components-alert.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-dialog.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-components-modal.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-dropdown.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-hint.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-notification.mjs +0 -73
- package/fesm2022/taiga-ui-core-directives-notification.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-directives-popup.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs +0 -24
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +0 -93
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-flag.mjs +0 -31
- package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs +0 -27
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-initials.mjs +0 -28
- package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs +0 -29
- package/fesm2022/taiga-ui-core-pipes-month.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +0 -35
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs.map +0 -1
- package/pipes/auto-color/auto-color.pipe.d.ts +0 -7
- package/pipes/auto-color/index.d.ts +0 -1
- package/pipes/calendar-sheet/index.d.ts +0 -1
- package/pipes/calendar-sheet/utils.d.ts +0 -20
- package/pipes/flag/flag.pipe.d.ts +0 -14
- package/pipes/flag/index.d.ts +0 -1
- package/pipes/format-date/format-date.pipe.d.ts +0 -9
- package/pipes/format-date/index.d.ts +0 -1
- package/pipes/initials/index.d.ts +0 -1
- package/pipes/initials/initials.pipe.d.ts +0 -7
- package/pipes/month/index.d.ts +0 -1
- package/pipes/month/month.pipe.d.ts +0 -10
- package/pipes/order-week-days/index.d.ts +0 -1
- package/services/dark-theme.service.d.ts +0 -10
- package/services/format-date.service.d.ts +0 -8
- package/tokens/day-type-handler.d.ts +0 -7
- package/tokens/first-day-of-week.d.ts +0 -5
- package/tokens/scroll-ref.d.ts +0 -2
- package/tokens/spin-icons.d.ts +0 -6
- package/types/range-state.d.ts +0 -4
- package/types/value-content-context.d.ts +0 -4
- package/utils/format/string-hash-to-hsl.d.ts +0 -6
- package/utils/miscellaneous/to-animation-options.d.ts +0 -4
- /package/{directives → components}/title/index.d.ts +0 -0
- /package/{directives → components}/title/title.directive.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.component.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.directive.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.factory.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.options.d.ts +0 -0
- /package/{components → portals}/dialog/dialog.providers.d.ts +0 -0
- /package/{components → portals}/dialog/index.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-content.directive.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-context.directive.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-limit-width.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown-options.directive.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown.component.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown.driver.d.ts +0 -0
- /package/{directives → portals}/dropdown/dropdown.providers.d.ts +0 -0
- /package/{directives → portals}/dropdown/with-dropdown-open.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-describe.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-driver.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-host.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-hover.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-manual.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-options.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-overflow.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-pointer.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-unstyled.component.d.ts +0 -0
- /package/{directives → portals}/hint/hint.component.d.ts +0 -0
- /package/{directives → portals}/hint/hint.d.ts +0 -0
- /package/{directives → portals}/hint/hint.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint.providers.d.ts +0 -0
- /package/{directives → portals}/hint/index.d.ts +0 -0
- /package/{components → portals}/modal/index.d.ts +0 -0
- /package/{components → portals}/modal/modal.component.d.ts +0 -0
- /package/{components → portals}/modal/modal.service.d.ts +0 -0
- /package/{directives → portals}/popup/index.d.ts +0 -0
- /package/{directives → portals}/popup/popup.directive.d.ts +0 -0
- /package/{directives → portals}/popup/popup.service.d.ts +0 -0
- /package/{directives → portals}/popup/popups.component.d.ts +0 -0
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, ContentChild, Directive,
|
|
3
|
-
import {
|
|
4
|
-
import { EMPTY_QUERY } from '@taiga-ui/cdk/constants';
|
|
5
|
-
import { tuiQueryListChanges, tuiZonefree, tuiTakeUntilDestroyed } from '@taiga-ui/cdk/observables';
|
|
2
|
+
import { InjectionToken, inject, ContentChild, Directive, input, NgZone, DestroyRef, ChangeDetectorRef, contentChildren, forwardRef, signal, computed, ChangeDetectionStrategy, ViewEncapsulation, Component, ViewContainerRef, createComponent, INJECTOR, EnvironmentInjector } from '@angular/core';
|
|
3
|
+
import { tuiZonefree, tuiTakeUntilDestroyed } from '@taiga-ui/cdk/observables';
|
|
6
4
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
5
|
+
import { tuiMoveFocus, tuiIsFocusedIn, tuiIsFocused } from '@taiga-ui/cdk/utils/focus';
|
|
6
|
+
import { tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
7
|
+
import * as i2 from '@taiga-ui/core/components/cell';
|
|
8
|
+
import { TuiCell, tuiCellOptionsProvider } from '@taiga-ui/core/components/cell';
|
|
9
|
+
import { TUI_NOTHING_FOUND_MESSAGE, tuiAsAuxiliary } from '@taiga-ui/core/tokens';
|
|
10
10
|
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
11
|
-
import {
|
|
11
|
+
import { timer } from 'rxjs';
|
|
12
|
+
import { tuiProvide } from '@taiga-ui/cdk/utils/di';
|
|
12
13
|
import { TUI_IS_MOBILE } from '@taiga-ui/cdk/tokens';
|
|
13
|
-
import { TuiDropdownDirective } from '@taiga-ui/core/directives/dropdown';
|
|
14
14
|
import * as i1 from '@taiga-ui/core/directives/icons';
|
|
15
15
|
import { TuiWithIcons } from '@taiga-ui/core/directives/icons';
|
|
16
|
+
import { TuiDropdownDirective } from '@taiga-ui/core/portals/dropdown';
|
|
16
17
|
|
|
17
|
-
/**
|
|
18
|
-
* Accessor for data-list options
|
|
19
|
-
*/
|
|
20
|
-
const TUI_DATA_LIST_ACCESSOR = new InjectionToken(ngDevMode ? 'TUI_DATA_LIST_ACCESSOR' : '');
|
|
21
|
-
function tuiAsDataListAccessor(accessor) {
|
|
22
|
-
return [tuiProvide(TUI_DATA_LIST_ACCESSOR, accessor), tuiAsAuxiliary(accessor)];
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* DataList controller
|
|
26
|
-
*/
|
|
27
18
|
const TUI_DATA_LIST_HOST = new InjectionToken(ngDevMode ? 'TUI_DATA_LIST_HOST' : '');
|
|
28
19
|
function tuiAsDataListHost(host) {
|
|
29
20
|
return tuiProvide(TUI_DATA_LIST_HOST, host);
|
|
@@ -34,200 +25,47 @@ function tuiAsDataListHost(host) {
|
|
|
34
25
|
*/
|
|
35
26
|
const TUI_OPTION_CONTENT = new InjectionToken(ngDevMode ? 'TUI_OPTION_CONTENT' : '');
|
|
36
27
|
function tuiAsOptionContent(useValue) {
|
|
37
|
-
return {
|
|
38
|
-
provide: TUI_OPTION_CONTENT,
|
|
39
|
-
useValue,
|
|
40
|
-
};
|
|
28
|
+
return { provide: TUI_OPTION_CONTENT, useValue };
|
|
41
29
|
}
|
|
42
30
|
class TuiWithOptionContent {
|
|
43
31
|
constructor() {
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
optional: true,
|
|
47
|
-
});
|
|
32
|
+
this.local = null;
|
|
33
|
+
this.global = inject(TUI_OPTION_CONTENT, { optional: true });
|
|
48
34
|
}
|
|
49
35
|
get content() {
|
|
50
|
-
return this.
|
|
36
|
+
return this.global ?? this.local;
|
|
51
37
|
}
|
|
52
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
53
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithOptionContent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
39
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiWithOptionContent, isStandalone: true, queries: [{ propertyName: "local", first: true, predicate: TUI_OPTION_CONTENT, descendants: true }], ngImport: i0 }); }
|
|
54
40
|
}
|
|
55
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiWithOptionContent, decorators: [{
|
|
56
42
|
type: Directive
|
|
57
|
-
}], propDecorators: {
|
|
43
|
+
}], propDecorators: { local: [{
|
|
58
44
|
type: ContentChild,
|
|
59
45
|
args: [TUI_OPTION_CONTENT, { descendants: true }]
|
|
60
46
|
}] } });
|
|
61
47
|
|
|
62
|
-
// TODO(v5): rename `TuiOptionNew` => `TuiOption` & remove [new] from selector
|
|
63
|
-
// TODO: Consider all use cases for aria roles
|
|
64
|
-
class TuiOptionNew {
|
|
65
|
-
constructor() {
|
|
66
|
-
this.vcr = inject(ViewContainerRef);
|
|
67
|
-
this.isMobile = inject(TUI_IS_MOBILE);
|
|
68
|
-
this.el = tuiInjectElement();
|
|
69
|
-
this.dataList = inject(forwardRef(() => TuiDataListComponent), { optional: true });
|
|
70
|
-
this.content = inject(TUI_OPTION_CONTENT, {
|
|
71
|
-
optional: true,
|
|
72
|
-
});
|
|
73
|
-
this.ref = this.content &&
|
|
74
|
-
createComponent(this.content, {
|
|
75
|
-
environmentInjector: inject(EnvironmentInjector),
|
|
76
|
-
elementInjector: inject(INJECTOR),
|
|
77
|
-
hostElement: tuiInjectElement(),
|
|
78
|
-
});
|
|
79
|
-
this.dropdown = inject(TuiDropdownDirective, {
|
|
80
|
-
self: true,
|
|
81
|
-
optional: true,
|
|
82
|
-
})?.ref;
|
|
83
|
-
this.disabled = false;
|
|
84
|
-
if (this.ref) {
|
|
85
|
-
this.vcr.insert(this.ref.hostView);
|
|
86
|
-
this.ref.changeDetectorRef.detectChanges();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// Preventing focus loss upon focused option removal
|
|
90
|
-
ngOnDestroy() {
|
|
91
|
-
this.dataList?.handleFocusLossIfNecessary(this.el);
|
|
92
|
-
}
|
|
93
|
-
onMouseMove() {
|
|
94
|
-
if (!this.isMobile &&
|
|
95
|
-
!tuiIsFocused(this.el) &&
|
|
96
|
-
this.dataList &&
|
|
97
|
-
this.el.closest('[tuiDataListDropdownManager]')) {
|
|
98
|
-
this.el.focus({ preventScroll: true });
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOptionNew, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
102
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiOptionNew, isStandalone: true, selector: "button[tuiOption][new], a[tuiOption][new], label[tuiOption][new]", inputs: { disabled: "disabled" }, host: { attributes: { "type": "button", "role": "option" }, listeners: { "mousemove.zoneless": "onMouseMove()" }, properties: { "attr.disabled": "disabled || null", "class._with-dropdown": "dropdown?.()" } }, hostDirectives: [{ directive: i1.TuiWithIcons }], ngImport: i0 }); }
|
|
103
|
-
}
|
|
104
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOptionNew, decorators: [{
|
|
105
|
-
type: Directive,
|
|
106
|
-
args: [{
|
|
107
|
-
selector: 'button[tuiOption][new], a[tuiOption][new], label[tuiOption][new]',
|
|
108
|
-
hostDirectives: [TuiWithIcons],
|
|
109
|
-
host: {
|
|
110
|
-
type: 'button',
|
|
111
|
-
role: 'option',
|
|
112
|
-
'[attr.disabled]': 'disabled || null',
|
|
113
|
-
'[class._with-dropdown]': 'dropdown?.()',
|
|
114
|
-
'(mousemove.zoneless)': 'onMouseMove()',
|
|
115
|
-
},
|
|
116
|
-
}]
|
|
117
|
-
}], ctorParameters: () => [], propDecorators: { disabled: [{
|
|
118
|
-
type: Input
|
|
119
|
-
}] } });
|
|
120
|
-
// TODO(v5): remove [new] from selector
|
|
121
48
|
class TuiOptionWithValue {
|
|
122
49
|
constructor() {
|
|
123
|
-
this.host = inject(TUI_DATA_LIST_HOST, {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
this.disabled = false;
|
|
127
|
-
this.value = signal(undefined);
|
|
128
|
-
}
|
|
129
|
-
// TODO(v5): use `input.required<T>()` to remove `undefined` from `this.value()`
|
|
130
|
-
set valueSetter(x) {
|
|
131
|
-
this.value.set(x);
|
|
50
|
+
this.host = inject(TUI_DATA_LIST_HOST, { optional: true });
|
|
51
|
+
this.disabled = input(false);
|
|
52
|
+
this.value = input();
|
|
132
53
|
}
|
|
133
54
|
onClick(value = this.value()) {
|
|
134
|
-
if (
|
|
135
|
-
this.host
|
|
55
|
+
if (value !== undefined) {
|
|
56
|
+
this.host?.handleOption?.(value);
|
|
136
57
|
}
|
|
137
58
|
}
|
|
138
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
139
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOptionWithValue, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
60
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiOptionWithValue, isStandalone: true, selector: "button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 }); }
|
|
140
61
|
}
|
|
141
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOptionWithValue, decorators: [{
|
|
142
63
|
type: Directive,
|
|
143
64
|
args: [{
|
|
144
|
-
selector: 'button[tuiOption][value]
|
|
145
|
-
host: {
|
|
146
|
-
'(click)': 'onClick()',
|
|
147
|
-
},
|
|
65
|
+
selector: 'button[tuiOption][value], a[tuiOption][value], label[tuiOption][value]',
|
|
66
|
+
host: { '(click)': 'onClick()' },
|
|
148
67
|
}]
|
|
149
|
-
}]
|
|
150
|
-
type: Input
|
|
151
|
-
}], valueSetter: [{
|
|
152
|
-
type: Input,
|
|
153
|
-
args: [{ alias: 'value', required: true }]
|
|
154
|
-
}] } });
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* TODO(v5): delete
|
|
158
|
-
* @deprecated use `<button tuiOption new />` / `<a tuiOption new /> / `<label tuiOption new /> instead
|
|
159
|
-
*/
|
|
160
|
-
class TuiOption {
|
|
161
|
-
constructor() {
|
|
162
|
-
this.isMobile = inject(TUI_IS_MOBILE);
|
|
163
|
-
this.el = tuiInjectElement();
|
|
164
|
-
this.dataList = inject(forwardRef(() => TuiDataListComponent), { optional: true });
|
|
165
|
-
this.host = inject(TUI_DATA_LIST_HOST, {
|
|
166
|
-
optional: true,
|
|
167
|
-
});
|
|
168
|
-
this.content = inject(TUI_OPTION_CONTENT, { optional: true });
|
|
169
|
-
this.dropdown = inject(TuiDropdownDirective, {
|
|
170
|
-
self: true,
|
|
171
|
-
optional: true,
|
|
172
|
-
})?.ref;
|
|
173
|
-
this.disabled = false;
|
|
174
|
-
}
|
|
175
|
-
// Preventing focus loss upon focused option removal
|
|
176
|
-
ngOnDestroy() {
|
|
177
|
-
this.dataList?.handleFocusLossIfNecessary(this.el);
|
|
178
|
-
}
|
|
179
|
-
onClick() {
|
|
180
|
-
if (this.host?.handleOption && this.value !== undefined) {
|
|
181
|
-
this.host.handleOption(this.value);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
onMouseMove() {
|
|
185
|
-
if (!this.isMobile &&
|
|
186
|
-
!tuiIsFocused(this.el) &&
|
|
187
|
-
this.dataList &&
|
|
188
|
-
this.el.closest('[tuiDataListDropdownManager]')) {
|
|
189
|
-
this.el.focus({ preventScroll: true });
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOption, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
193
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", type: TuiOption, isStandalone: true, selector: "button[tuiOption]:not([new]), a[tuiOption]:not([new]), label[tuiOption]:not([new])", inputs: { disabled: "disabled", value: "value" }, host: { attributes: { "type": "button", "role": "option" }, listeners: { "click": "onClick()", "mousemove.zoneless": "onMouseMove()" }, properties: { "attr.disabled": "disabled || null", "class._with-dropdown": "dropdown?.()" } }, hostDirectives: [{ directive: i1.TuiWithIcons }], ngImport: i0, template: `
|
|
194
|
-
<ng-container *polymorpheusOutlet="content || t as text; context: {$implicit: t}">
|
|
195
|
-
{{ text }}
|
|
196
|
-
</ng-container>
|
|
197
|
-
<ng-template #t>
|
|
198
|
-
<ng-content />
|
|
199
|
-
</ng-template>
|
|
200
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
201
|
-
}
|
|
202
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiOption, decorators: [{
|
|
203
|
-
type: Component,
|
|
204
|
-
args: [{
|
|
205
|
-
selector: 'button[tuiOption]:not([new]), a[tuiOption]:not([new]), label[tuiOption]:not([new])',
|
|
206
|
-
imports: [PolymorpheusOutlet],
|
|
207
|
-
template: `
|
|
208
|
-
<ng-container *polymorpheusOutlet="content || t as text; context: {$implicit: t}">
|
|
209
|
-
{{ text }}
|
|
210
|
-
</ng-container>
|
|
211
|
-
<ng-template #t>
|
|
212
|
-
<ng-content />
|
|
213
|
-
</ng-template>
|
|
214
|
-
`,
|
|
215
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
216
|
-
hostDirectives: [TuiWithIcons],
|
|
217
|
-
host: {
|
|
218
|
-
type: 'button',
|
|
219
|
-
role: 'option',
|
|
220
|
-
'[attr.disabled]': 'disabled || null',
|
|
221
|
-
'[class._with-dropdown]': 'dropdown?.()',
|
|
222
|
-
'(click)': 'onClick()',
|
|
223
|
-
'(mousemove.zoneless)': 'onMouseMove()',
|
|
224
|
-
},
|
|
225
|
-
}]
|
|
226
|
-
}], propDecorators: { disabled: [{
|
|
227
|
-
type: Input
|
|
228
|
-
}], value: [{
|
|
229
|
-
type: Input
|
|
230
|
-
}] } });
|
|
68
|
+
}] });
|
|
231
69
|
|
|
232
70
|
function tuiInjectDataListSize() {
|
|
233
71
|
const sizes = ['s', 'm', 'l'];
|
|
@@ -237,25 +75,18 @@ function tuiInjectDataListSize() {
|
|
|
237
75
|
// TODO: Consider aria-activedescendant for proper accessibility implementation
|
|
238
76
|
class TuiDataListComponent {
|
|
239
77
|
constructor() {
|
|
240
|
-
// TODO(v5): delete
|
|
241
|
-
this.legacyOptionsQuery = EMPTY_QUERY;
|
|
242
|
-
this.optionsQuery = EMPTY_QUERY;
|
|
243
78
|
this.ngZone = inject(NgZone);
|
|
244
79
|
this.destroyRef = inject(DestroyRef);
|
|
245
80
|
this.el = tuiInjectElement();
|
|
246
81
|
this.cdr = inject(ChangeDetectorRef);
|
|
247
|
-
this.
|
|
82
|
+
this.optionsQuery = contentChildren(forwardRef(() => TuiOptionWithValue), { descendants: true });
|
|
248
83
|
this.fallback = inject(TUI_NOTHING_FOUND_MESSAGE);
|
|
249
84
|
this.empty = signal(false);
|
|
250
|
-
this.
|
|
251
|
-
|
|
252
|
-
this.options =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
])), map(([legacyOptions, options]) => [
|
|
256
|
-
...legacyOptions.map(({ value }) => value),
|
|
257
|
-
...options.map(({ value }) => value()),
|
|
258
|
-
].filter(tuiIsPresent)), startWith([])), { requireSync: true });
|
|
85
|
+
this.emptyContent = input();
|
|
86
|
+
this.size = input(tuiInjectDataListSize());
|
|
87
|
+
this.options = computed(() => this.optionsQuery()
|
|
88
|
+
.map(({ value }) => value())
|
|
89
|
+
.filter(tuiIsPresent));
|
|
259
90
|
}
|
|
260
91
|
onKeyDownArrow(current, step) {
|
|
261
92
|
const { elements } = this;
|
|
@@ -266,9 +97,6 @@ class TuiDataListComponent {
|
|
|
266
97
|
this.origin?.focus({ preventScroll: true });
|
|
267
98
|
}
|
|
268
99
|
}
|
|
269
|
-
ngAfterContentInit() {
|
|
270
|
-
this.contentReady$.next(true);
|
|
271
|
-
}
|
|
272
100
|
// TODO: Refactor to :has after Safari support bumped to 15
|
|
273
101
|
ngAfterContentChecked() {
|
|
274
102
|
timer(0)
|
|
@@ -278,58 +106,38 @@ class TuiDataListComponent {
|
|
|
278
106
|
this.cdr.detectChanges();
|
|
279
107
|
});
|
|
280
108
|
}
|
|
281
|
-
// TODO(v5): delete
|
|
282
|
-
getOptions(includeDisabled = false) {
|
|
283
|
-
return [
|
|
284
|
-
...this.legacyOptionsQuery, // TODO(v5): delete
|
|
285
|
-
...this.optionsQuery,
|
|
286
|
-
]
|
|
287
|
-
.filter(({ disabled }) => includeDisabled || !disabled)
|
|
288
|
-
.map(({ value }) => (isSignal(value) ? value() : value))
|
|
289
|
-
.filter(tuiIsPresent);
|
|
290
|
-
}
|
|
291
109
|
onFocusIn(relatedTarget, currentTarget) {
|
|
292
110
|
if (!currentTarget.contains(relatedTarget) && !this.origin) {
|
|
293
111
|
this.origin = relatedTarget;
|
|
294
112
|
}
|
|
295
113
|
}
|
|
296
114
|
get elements() {
|
|
297
|
-
return Array.from(this.el.querySelectorAll('[tuiOption]'));
|
|
115
|
+
return Array.from(this.el.querySelectorAll('[tuiOption]:not(.t-empty)'));
|
|
298
116
|
}
|
|
299
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
300
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
301
|
-
|
|
117
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDataListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
118
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TuiDataListComponent, isStandalone: true, selector: "tui-data-list", inputs: { emptyContent: { classPropertyName: "emptyContent", publicName: "emptyContent", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "listbox" }, listeners: { "focusin": "onFocusIn($event.relatedTarget, $event.currentTarget)", "mousedown.prevent": "(0)", "wheel.zoneless.passive": "handleFocusLossIfNecessary()", "mouseleave": "handleFocusLossIfNecessary($event.target)", "keydown.tab": "handleFocusLossIfNecessary()", "keydown.shift.tab": "handleFocusLossIfNecessary()", "keydown.arrowDown.prevent": "onKeyDownArrow($event.target, 1)", "keydown.arrowUp.prevent": "onKeyDownArrow($event.target, -1)" }, properties: { "attr.data-size": "size()" } }, providers: [
|
|
119
|
+
tuiCellOptionsProvider(() => ({ size: inject(TuiDataListComponent).size() })),
|
|
120
|
+
tuiAsAuxiliary(TuiDataListComponent),
|
|
302
121
|
{
|
|
303
122
|
provide: TUI_OPTION_CONTENT,
|
|
304
123
|
useFactory: () => inject(TuiWithOptionContent, { optional: true })?.content ??
|
|
305
|
-
// TODO(v5): remove when all legacy controls are deleted
|
|
306
|
-
inject(TUI_OPTION_CONTENT, {
|
|
307
|
-
host: true,
|
|
308
|
-
skipSelf: true,
|
|
309
|
-
optional: true,
|
|
310
|
-
}) ??
|
|
311
124
|
inject(TUI_OPTION_CONTENT, { skipSelf: true, optional: true }),
|
|
312
125
|
},
|
|
313
|
-
], queries: [{ propertyName: "
|
|
126
|
+
], queries: [{ propertyName: "optionsQuery", predicate: i0.forwardRef(() => TuiOptionWithValue), descendants: true, isSignal: true }], ngImport: i0, template: "<ng-content />\n@if (empty()) {\n <!-- tuiOption selector purely for cosmetics, do not import -->\n <span\n tuiCell\n tuiOption\n class=\"t-empty\"\n >\n <ng-container *polymorpheusOutlet=\"emptyContent() || fallback() as text\">\n {{ text }}\n </ng-container>\n </span>\n}\n", styles: ["tui-data-list{display:flex;flex-direction:column;padding:calc(var(--tui-data-list-padding) - var(--tui-data-list-margin)) var(--tui-data-list-padding)}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background:transparent}tui-data-list[data-size=s]{--tui-data-list-margin: 0rem;--tui-data-list-padding: .25rem}tui-data-list[data-size=s] [tuiOption]{font:var(--tui-font-text-s);min-block-size:2rem;padding:.3125rem .375rem}tui-data-list[data-size=s] [tuiOption]:before{font-size:1rem}tui-data-list[data-size=m]{--tui-data-list-margin: .0625rem;--tui-data-list-padding: .25rem}tui-data-list[data-size=m] [tuiOption]{font:var(--tui-font-text-s);min-block-size:2.5rem;padding:.375rem .5rem}tui-data-list[data-size=l]{--tui-data-list-margin: .125rem;--tui-data-list-padding: .375rem}tui-data-list[data-size=l] [tuiOption]{font:var(--tui-font-text-m);min-block-size:2.75rem;padding:.375rem .625rem}tui-data-list [tuiOption]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;border-radius:var(--tui-radius-s);outline:none!important;cursor:pointer;word-break:break-word}tui-data-list [tuiOption]:disabled{opacity:var(--tui-disabled-opacity);cursor:default}@media (hover: hover) and (pointer: fine){tui-data-list [tuiOption]:hover:not(:disabled){background:var(--tui-background-neutral-1)}}tui-data-list [tuiOption]:active:not(:disabled),tui-data-list [tuiOption]:focus-within,tui-data-list [tuiOption]._with-dropdown{background:var(--tui-background-neutral-1)}tui-data-list [tuiOption]:after{font-size:1rem;margin-inline:auto -.625rem;border-inline:.5rem solid}tui-data-list>.t-empty{pointer-events:none;color:var(--tui-text-tertiary)}tui-opt-group{position:relative;display:flex;font:var(--tui-font-text-xs);font-weight:700;color:var(--tui-text-primary);flex-direction:column;line-height:1rem}tui-data-list[data-size=s] tui-opt-group:before{padding-inline:.375rem}tui-data-list[data-size=l] tui-opt-group{font:var(--tui-font-text-m);font-weight:700;line-height:1.25rem}tui-data-list[data-size=l] tui-opt-group:before{padding-inline:.625rem}tui-data-list[data-size=l] tui-opt-group:after{inset-inline:.625rem}tui-opt-group:empty:before,tui-opt-group:empty:after{display:none}tui-opt-group:before{content:attr(data-label);padding:var(--tui-data-list-padding) .5rem;margin:var(--tui-data-list-margin) 0;white-space:normal;word-break:break-word}tui-sheet-dialog tui-opt-group:before{font:var(--tui-font-heading-6);padding:.5rem 0!important;margin:0}tui-opt-group:after{position:absolute;top:var(--tui-data-list-padding);inset-inline:.5rem;block-size:1px;background:var(--tui-border-normal)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-block-start:calc(.75rem + var(--tui-data-list-padding))}tui-opt-group:not(:empty)~tui-opt-group[data-label=\"\"]:before{padding:var(--tui-data-list-padding) 0}tui-opt-group:not(:empty)~tui-opt-group:after{content:\"\"}tui-opt-group[data-label=\"\"]:before{content:\"\";padding:0;margin:0}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "directive", type: TuiCell, selector: "[tuiCell]:not(ng-template)", inputs: ["tuiCell", "tuiCellHeight"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
314
127
|
}
|
|
315
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
128
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDataListComponent, decorators: [{
|
|
316
129
|
type: Component,
|
|
317
|
-
args: [{ selector: 'tui-data-list', imports: [PolymorpheusOutlet], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
318
|
-
|
|
130
|
+
args: [{ selector: 'tui-data-list', imports: [PolymorpheusOutlet, TuiCell], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
131
|
+
tuiCellOptionsProvider(() => ({ size: inject(TuiDataListComponent).size() })),
|
|
132
|
+
tuiAsAuxiliary(TuiDataListComponent),
|
|
319
133
|
{
|
|
320
134
|
provide: TUI_OPTION_CONTENT,
|
|
321
135
|
useFactory: () => inject(TuiWithOptionContent, { optional: true })?.content ??
|
|
322
|
-
// TODO(v5): remove when all legacy controls are deleted
|
|
323
|
-
inject(TUI_OPTION_CONTENT, {
|
|
324
|
-
host: true,
|
|
325
|
-
skipSelf: true,
|
|
326
|
-
optional: true,
|
|
327
|
-
}) ??
|
|
328
136
|
inject(TUI_OPTION_CONTENT, { skipSelf: true, optional: true }),
|
|
329
137
|
},
|
|
330
138
|
], host: {
|
|
331
139
|
role: 'listbox',
|
|
332
|
-
'[attr.data-size]': 'size',
|
|
140
|
+
'[attr.data-size]': 'size()',
|
|
333
141
|
'(focusin)': 'onFocusIn($event.relatedTarget, $event.currentTarget)',
|
|
334
142
|
'(mousedown.prevent)': '(0)',
|
|
335
143
|
'(wheel.zoneless.passive)': 'handleFocusLossIfNecessary()',
|
|
@@ -338,55 +146,85 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
338
146
|
'(keydown.shift.tab)': 'handleFocusLossIfNecessary()',
|
|
339
147
|
'(keydown.arrowDown.prevent)': 'onKeyDownArrow($event.target, 1)',
|
|
340
148
|
'(keydown.arrowUp.prevent)': 'onKeyDownArrow($event.target, -1)',
|
|
341
|
-
}, template: "<ng-content />\n@if (empty()) {\n <
|
|
342
|
-
}]
|
|
343
|
-
type: ContentChildren,
|
|
344
|
-
args: [forwardRef(() => TuiOption), { descendants: true }]
|
|
345
|
-
}], optionsQuery: [{
|
|
346
|
-
type: ContentChildren,
|
|
347
|
-
args: [forwardRef(() => TuiOptionWithValue), { descendants: true }]
|
|
348
|
-
}], emptyContent: [{
|
|
349
|
-
type: Input
|
|
350
|
-
}], size: [{
|
|
351
|
-
type: Input
|
|
352
|
-
}] } });
|
|
149
|
+
}, template: "<ng-content />\n@if (empty()) {\n <!-- tuiOption selector purely for cosmetics, do not import -->\n <span\n tuiCell\n tuiOption\n class=\"t-empty\"\n >\n <ng-container *polymorpheusOutlet=\"emptyContent() || fallback() as text\">\n {{ text }}\n </ng-container>\n </span>\n}\n", styles: ["tui-data-list{display:flex;flex-direction:column;padding:calc(var(--tui-data-list-padding) - var(--tui-data-list-margin)) var(--tui-data-list-padding)}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background:transparent}tui-data-list[data-size=s]{--tui-data-list-margin: 0rem;--tui-data-list-padding: .25rem}tui-data-list[data-size=s] [tuiOption]{font:var(--tui-font-text-s);min-block-size:2rem;padding:.3125rem .375rem}tui-data-list[data-size=s] [tuiOption]:before{font-size:1rem}tui-data-list[data-size=m]{--tui-data-list-margin: .0625rem;--tui-data-list-padding: .25rem}tui-data-list[data-size=m] [tuiOption]{font:var(--tui-font-text-s);min-block-size:2.5rem;padding:.375rem .5rem}tui-data-list[data-size=l]{--tui-data-list-margin: .125rem;--tui-data-list-padding: .375rem}tui-data-list[data-size=l] [tuiOption]{font:var(--tui-font-text-m);min-block-size:2.75rem;padding:.375rem .625rem}tui-data-list [tuiOption]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;border-radius:var(--tui-radius-s);outline:none!important;cursor:pointer;word-break:break-word}tui-data-list [tuiOption]:disabled{opacity:var(--tui-disabled-opacity);cursor:default}@media (hover: hover) and (pointer: fine){tui-data-list [tuiOption]:hover:not(:disabled){background:var(--tui-background-neutral-1)}}tui-data-list [tuiOption]:active:not(:disabled),tui-data-list [tuiOption]:focus-within,tui-data-list [tuiOption]._with-dropdown{background:var(--tui-background-neutral-1)}tui-data-list [tuiOption]:after{font-size:1rem;margin-inline:auto -.625rem;border-inline:.5rem solid}tui-data-list>.t-empty{pointer-events:none;color:var(--tui-text-tertiary)}tui-opt-group{position:relative;display:flex;font:var(--tui-font-text-xs);font-weight:700;color:var(--tui-text-primary);flex-direction:column;line-height:1rem}tui-data-list[data-size=s] tui-opt-group:before{padding-inline:.375rem}tui-data-list[data-size=l] tui-opt-group{font:var(--tui-font-text-m);font-weight:700;line-height:1.25rem}tui-data-list[data-size=l] tui-opt-group:before{padding-inline:.625rem}tui-data-list[data-size=l] tui-opt-group:after{inset-inline:.625rem}tui-opt-group:empty:before,tui-opt-group:empty:after{display:none}tui-opt-group:before{content:attr(data-label);padding:var(--tui-data-list-padding) .5rem;margin:var(--tui-data-list-margin) 0;white-space:normal;word-break:break-word}tui-sheet-dialog tui-opt-group:before{font:var(--tui-font-heading-6);padding:.5rem 0!important;margin:0}tui-opt-group:after{position:absolute;top:var(--tui-data-list-padding);inset-inline:.5rem;block-size:1px;background:var(--tui-border-normal)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-block-start:calc(.75rem + var(--tui-data-list-padding))}tui-opt-group:not(:empty)~tui-opt-group[data-label=\"\"]:before{padding:var(--tui-data-list-padding) 0}tui-opt-group:not(:empty)~tui-opt-group:after{content:\"\"}tui-opt-group[data-label=\"\"]:before{content:\"\";padding:0;margin:0}\n"] }]
|
|
150
|
+
}] });
|
|
353
151
|
|
|
354
|
-
class
|
|
355
|
-
|
|
356
|
-
|
|
152
|
+
class TuiOptGroup {
|
|
153
|
+
constructor() {
|
|
154
|
+
this.label = input();
|
|
155
|
+
}
|
|
156
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOptGroup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
157
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiOptGroup, isStandalone: true, selector: "tui-opt-group", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.data-label": "label() || \"\"" } }, ngImport: i0 }); }
|
|
357
158
|
}
|
|
358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOptGroup, decorators: [{
|
|
359
160
|
type: Directive,
|
|
360
161
|
args: [{
|
|
361
|
-
selector: '
|
|
162
|
+
selector: 'tui-opt-group',
|
|
163
|
+
host: {
|
|
164
|
+
role: 'group',
|
|
165
|
+
'[attr.data-label]': 'label() || ""',
|
|
166
|
+
},
|
|
362
167
|
}]
|
|
363
168
|
}] });
|
|
364
|
-
function tuiAsDataList(list) {
|
|
365
|
-
return tuiProvide(TuiDataListDirective, list);
|
|
366
|
-
}
|
|
367
169
|
|
|
368
|
-
class
|
|
369
|
-
|
|
370
|
-
|
|
170
|
+
class TuiOption {
|
|
171
|
+
constructor() {
|
|
172
|
+
this.vcr = inject(ViewContainerRef);
|
|
173
|
+
this.isMobile = inject(TUI_IS_MOBILE);
|
|
174
|
+
this.el = tuiInjectElement();
|
|
175
|
+
this.datalist = inject(forwardRef(() => TuiDataListComponent), { optional: true });
|
|
176
|
+
this.content = inject(TUI_OPTION_CONTENT, {
|
|
177
|
+
optional: true,
|
|
178
|
+
});
|
|
179
|
+
this.ref = this.content &&
|
|
180
|
+
createComponent(this.content, {
|
|
181
|
+
environmentInjector: inject(EnvironmentInjector),
|
|
182
|
+
elementInjector: inject(INJECTOR),
|
|
183
|
+
hostElement: tuiInjectElement(),
|
|
184
|
+
});
|
|
185
|
+
this.dropdown = inject(TuiDropdownDirective, {
|
|
186
|
+
self: true,
|
|
187
|
+
optional: true,
|
|
188
|
+
})?.ref;
|
|
189
|
+
this.disabled = input(false);
|
|
190
|
+
if (this.ref) {
|
|
191
|
+
this.vcr.insert(this.ref.hostView);
|
|
192
|
+
this.ref.changeDetectorRef.detectChanges();
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Preventing focus loss upon focused option removal
|
|
196
|
+
ngOnDestroy() {
|
|
197
|
+
this.datalist?.handleFocusLossIfNecessary(this.el);
|
|
198
|
+
}
|
|
199
|
+
onMouseMove() {
|
|
200
|
+
if (!this.isMobile &&
|
|
201
|
+
!tuiIsFocused(this.el) &&
|
|
202
|
+
this.datalist &&
|
|
203
|
+
this.el.closest('[tuiDataListDropdownManager]')) {
|
|
204
|
+
this.el.focus({ preventScroll: true });
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOption, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
208
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiOption, isStandalone: true, selector: "button[tuiOption], a[tuiOption], label[tuiOption]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "role": "option" }, listeners: { "mousemove.zoneless": "onMouseMove()" }, properties: { "attr.disabled": "disabled() || null", "class._with-dropdown": "dropdown?.()" } }, hostDirectives: [{ directive: i1.TuiWithIcons }, { directive: i2.TuiCell }], ngImport: i0 }); }
|
|
371
209
|
}
|
|
372
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiOption, decorators: [{
|
|
373
211
|
type: Directive,
|
|
374
212
|
args: [{
|
|
375
|
-
selector: '
|
|
213
|
+
selector: 'button[tuiOption], a[tuiOption], label[tuiOption]',
|
|
214
|
+
hostDirectives: [TuiWithIcons, TuiCell],
|
|
376
215
|
host: {
|
|
377
|
-
|
|
378
|
-
|
|
216
|
+
type: 'button',
|
|
217
|
+
role: 'option',
|
|
218
|
+
'[attr.disabled]': 'disabled() || null',
|
|
219
|
+
'[class._with-dropdown]': 'dropdown?.()',
|
|
220
|
+
'(mousemove.zoneless)': 'onMouseMove()',
|
|
379
221
|
},
|
|
380
222
|
}]
|
|
381
|
-
}],
|
|
382
|
-
type: Input
|
|
383
|
-
}] } });
|
|
223
|
+
}], ctorParameters: () => [] });
|
|
384
224
|
|
|
385
225
|
const TuiDataList = [
|
|
386
226
|
TuiDataListComponent,
|
|
387
|
-
TuiDataListDirective,
|
|
388
227
|
TuiOption,
|
|
389
|
-
TuiOptionNew,
|
|
390
228
|
TuiOptionWithValue,
|
|
391
229
|
TuiOptGroup,
|
|
392
230
|
];
|
|
@@ -395,5 +233,5 @@ const TuiDataList = [
|
|
|
395
233
|
* Generated bundle index. Do not edit.
|
|
396
234
|
*/
|
|
397
235
|
|
|
398
|
-
export {
|
|
236
|
+
export { TUI_DATA_LIST_HOST, TUI_OPTION_CONTENT, TuiDataList, TuiDataListComponent, TuiOptGroup, TuiOption, TuiOptionWithValue, TuiWithOptionContent, tuiAsDataListHost, tuiAsOptionContent, tuiInjectDataListSize };
|
|
399
237
|
//# sourceMappingURL=taiga-ui-core-components-data-list.mjs.map
|