@taiga-ui/core 4.52.0-canary.ece97e9 → 4.52.0-canary.efbd0d4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +4 -5
- 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 +8 -13
- package/components/textfield/textfield.component.d.ts +20 -32
- package/components/textfield/textfield.d.ts +2 -3
- package/directives/date-format/date-format.directive.d.ts +3 -7
- 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/directives/number-format/number-format.directive.d.ts +3 -7
- 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 +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 +110 -279
- 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 +10 -11
- package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-input.mjs +103 -0
- package/fesm2022/taiga-ui-core-components-input.mjs.map +1 -0
- package/fesm2022/taiga-ui-core-components-label.mjs +11 -13
- package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +13 -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 +42 -51
- 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 +100 -262
- 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 -16
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-date-format.mjs +26 -20
- package/fesm2022/taiga-ui-core-directives-date-format.mjs.map +1 -1
- 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 -12
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +16 -40
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-number-format.mjs +32 -20
- package/fesm2022/taiga-ui-core-directives-number-format.mjs.map +1 -1
- 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 +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 +158 -0
- package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -0
- package/fesm2022/{taiga-ui-core-directives-dropdown.mjs → taiga-ui-core-portals-dropdown.mjs} +171 -302
- 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} +67 -69
- 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 +51 -60
- 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 +65 -95
- 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/{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-options.directive.d.ts +0 -4
- package/{directives → portals}/dropdown/dropdown-position-sided.directive.d.ts +3 -3
- package/{directives → portals}/dropdown/dropdown-position.directive.d.ts +5 -5
- package/{directives → portals}/dropdown/dropdown-selection.directive.d.ts +4 -5
- package/{directives → portals}/dropdown/dropdown.bindings.d.ts +0 -1
- package/{directives → portals}/dropdown/dropdown.d.ts +1 -2
- package/{directives → portals}/dropdown/dropdown.directive.d.ts +5 -6
- package/{directives → portals}/dropdown/index.d.ts +0 -1
- package/{directives → portals}/hint/hint-position.directive.d.ts +3 -3
- package/{directives → portals}/hint/hint.directive.d.ts +1 -1
- package/portals/index.d.ts +6 -0
- package/{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 +21 -22
- package/styles/components/textfield.less +129 -211
- package/styles/components/title.less +8 -8
- package/styles/mixins/appearance.less +10 -26
- package/styles/mixins/appearance.scss +8 -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 +1 -1
- package/styles/mixins/slider.scss +2 -3
- package/styles/taiga-ui-local.less +0 -1
- package/styles/taiga-ui-local.scss +0 -1
- package/styles/taiga-ui-theme.less +0 -1
- package/styles/theme/appearance/outline.less +9 -18
- package/styles/theme/appearance/primary.less +2 -4
- package/styles/theme/appearance/secondary.less +6 -14
- package/styles/theme/appearance/status.less +0 -4
- package/styles/theme/appearance/table.less +36 -35
- package/styles/theme/appearance/textfield.less +30 -27
- package/styles/theme/appearance.less +0 -1
- package/styles/theme/variables.less +16 -19
- package/tokens/breakpoint.d.ts +4 -0
- package/tokens/common-icons.d.ts +3 -3
- package/tokens/date-format.d.ts +2 -3
- package/tokens/icons.d.ts +0 -4
- package/tokens/index.d.ts +1 -4
- package/tokens/number-format.d.ts +2 -3
- 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/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 -227
- 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 -25
- package/fesm2022/taiga-ui-core-pipes-auto-color.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs +0 -94
- package/fesm2022/taiga-ui-core-pipes-calendar-sheet.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-flag.mjs +0 -32
- package/fesm2022/taiga-ui-core-pipes-flag.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs +0 -28
- package/fesm2022/taiga-ui-core-pipes-format-date.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-initials.mjs +0 -29
- package/fesm2022/taiga-ui-core-pipes-initials.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-month.mjs +0 -30
- package/fesm2022/taiga-ui-core-pipes-month.mjs.map +0 -1
- package/fesm2022/taiga-ui-core-pipes-order-week-days.mjs +0 -36
- 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-context.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-options.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-overflow.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-pointer.directive.d.ts +0 -0
- /package/{directives → portals}/hint/hint-unstyled.component.d.ts +0 -0
- /package/{directives → portals}/hint/hint.component.d.ts +0 -0
- /package/{directives → portals}/hint/hint.d.ts +0 -0
- /package/{directives → portals}/hint/hint.providers.d.ts +0 -0
- /package/{directives → portals}/hint/index.d.ts +0 -0
- /package/{components → portals}/modal/index.d.ts +0 -0
- /package/{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
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { inject, signal, ChangeDetectionStrategy, ViewEncapsulation, Component, Injectable } from '@angular/core';
|
|
4
|
+
import * as i1 from '@taiga-ui/cdk/directives/active-zone';
|
|
5
|
+
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
6
|
+
import * as i2 from '@taiga-ui/cdk/directives/focus-trap';
|
|
7
|
+
import { TuiFocusTrap } from '@taiga-ui/cdk/directives/focus-trap';
|
|
8
|
+
import { tuiGetFocused } from '@taiga-ui/cdk/utils/focus';
|
|
9
|
+
import * as i3 from '@taiga-ui/core/components/scrollbar';
|
|
10
|
+
import { TuiScrollControls, TuiScrollRef } from '@taiga-ui/core/components/scrollbar';
|
|
11
|
+
import { injectContext, PolymorpheusOutlet, PolymorpheusComponent } from '@taiga-ui/polymorpheus';
|
|
12
|
+
import { TUI_LEAVE } from '@taiga-ui/cdk/directives/animated';
|
|
13
|
+
import { TuiPortal } from '@taiga-ui/cdk/portals';
|
|
14
|
+
import { TuiPopupService } from '@taiga-ui/core/portals/popup';
|
|
15
|
+
|
|
16
|
+
class TuiModalComponent {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.current = inject(TuiActiveZone);
|
|
19
|
+
this.parent = findActive(inject(TuiActiveZone, { skipSelf: true }), tuiGetFocused(inject(DOCUMENT)));
|
|
20
|
+
this.context = injectContext();
|
|
21
|
+
this.component = signal(null);
|
|
22
|
+
}
|
|
23
|
+
ngOnInit() {
|
|
24
|
+
this.current.tuiActiveZoneParentSetter = this.parent;
|
|
25
|
+
}
|
|
26
|
+
ngOnDestroy() {
|
|
27
|
+
this.current.tuiActiveZoneParentSetter = null;
|
|
28
|
+
}
|
|
29
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
30
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TuiModalComponent, isStandalone: true, selector: "tui-modal", host: { attributes: { "role": "dialog", "aria-modal": "true" }, listeners: { "animationend.self": "$event.target.classList.remove(\"tui-enter\")" }, properties: { "attr.aria-labelledby": "context.id" }, classAttribute: "tui-enter" }, hostDirectives: [{ directive: i1.TuiActiveZone }, { directive: i2.TuiFocusTrap }, { directive: i3.TuiScrollRef }], ngImport: i0, template: `
|
|
31
|
+
<ng-container *polymorpheusOutlet="component(); context: context" />
|
|
32
|
+
<tui-scroll-controls class="t-scrollbars" />
|
|
33
|
+
`, isInline: true, styles: ["@keyframes tuiModalBackdrop{0%{-webkit-backdrop-filter:none;backdrop-filter:none}to{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}}tui-modal{transition-property:backdrop-filter;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;scrollbar-width:none;-ms-overflow-style:none;position:fixed;display:grid;inset:0;grid-template-rows:0;place-items:center;outline:none;overflow:auto;overscroll-behavior:none contain;transition-timing-function:linear;animation-timing-function:cubic-bezier(.14,.52,.35,.84)!important;perspective:10rem;transform:translateY(var(--t-root-top))}tui-modal::-webkit-scrollbar,tui-modal::-webkit-scrollbar-thumb{display:none}@supports not (selector(:has(*))) or not (selector(:nth-child(1 of *))){tui-modal:last-of-type:not(.tui-leave){-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}tui-modal:last-of-type.tui-enter,tui-modal:last-of-type.tui-leave{animation-name:tuiModalBackdrop}}@supports (selector(:has(*))) and (selector(:nth-child(1 of *))){tui-modal:nth-last-child(1 of tui-modal:not(.tui-leave):not(:has(.tui-backdrop-hidden))){-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}tui-modal:nth-last-child(1 of tui-modal:not(:has(.tui-backdrop-hidden))):is(.tui-enter,.tui-leave){animation-name:tuiModalBackdrop}}tui-modal:before{content:\"\";block-size:1px;inline-size:calc(100% + 1px)}tui-modal>.t-scrollbars{position:fixed;inset:0;margin:0;color:#747474}tui-modal>.t-scrollbars .t-bar_horizontal,tui-modal>.t-scrollbars .t-bar_vertical .t-thumb[style*=\"height: 100%\"]{display:none}tui-modal>.tui-enter+.t-scrollbars .t-bar_vertical,tui-modal>.tui-leave+.t-scrollbars .t-bar_vertical{display:none}\n"], dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: TuiScrollControls, selector: "tui-scroll-controls" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
34
|
+
}
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiModalComponent, decorators: [{
|
|
36
|
+
type: Component,
|
|
37
|
+
args: [{ selector: 'tui-modal', imports: [PolymorpheusOutlet, TuiScrollControls], template: `
|
|
38
|
+
<ng-container *polymorpheusOutlet="component(); context: context" />
|
|
39
|
+
<tui-scroll-controls class="t-scrollbars" />
|
|
40
|
+
`, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, hostDirectives: [TuiActiveZone, TuiFocusTrap, TuiScrollRef], host: {
|
|
41
|
+
role: 'dialog',
|
|
42
|
+
class: 'tui-enter',
|
|
43
|
+
'aria-modal': 'true',
|
|
44
|
+
'[attr.aria-labelledby]': 'context.id',
|
|
45
|
+
'(animationend.self)': '$event.target.classList.remove("tui-enter")',
|
|
46
|
+
}, styles: ["@keyframes tuiModalBackdrop{0%{-webkit-backdrop-filter:none;backdrop-filter:none}to{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}}tui-modal{transition-property:backdrop-filter;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;scrollbar-width:none;-ms-overflow-style:none;position:fixed;display:grid;inset:0;grid-template-rows:0;place-items:center;outline:none;overflow:auto;overscroll-behavior:none contain;transition-timing-function:linear;animation-timing-function:cubic-bezier(.14,.52,.35,.84)!important;perspective:10rem;transform:translateY(var(--t-root-top))}tui-modal::-webkit-scrollbar,tui-modal::-webkit-scrollbar-thumb{display:none}@supports not (selector(:has(*))) or not (selector(:nth-child(1 of *))){tui-modal:last-of-type:not(.tui-leave){-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}tui-modal:last-of-type.tui-enter,tui-modal:last-of-type.tui-leave{animation-name:tuiModalBackdrop}}@supports (selector(:has(*))) and (selector(:nth-child(1 of *))){tui-modal:nth-last-child(1 of tui-modal:not(.tui-leave):not(:has(.tui-backdrop-hidden))){-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}tui-modal:nth-last-child(1 of tui-modal:not(:has(.tui-backdrop-hidden))):is(.tui-enter,.tui-leave){animation-name:tuiModalBackdrop}}tui-modal:before{content:\"\";block-size:1px;inline-size:calc(100% + 1px)}tui-modal>.t-scrollbars{position:fixed;inset:0;margin:0;color:#747474}tui-modal>.t-scrollbars .t-bar_horizontal,tui-modal>.t-scrollbars .t-bar_vertical .t-thumb[style*=\"height: 100%\"]{display:none}tui-modal>.tui-enter+.t-scrollbars .t-bar_vertical,tui-modal>.tui-leave+.t-scrollbars .t-bar_vertical{display:none}\n"] }]
|
|
47
|
+
}] });
|
|
48
|
+
function findActive(zone, el) {
|
|
49
|
+
if (!el || !zone.contains(el)) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const active = zone.children.find((child) => !child['el'].matches('[tuiActiveZoneAdapter]') && child.contains(el));
|
|
53
|
+
return active ? findActive(active, el) : zone;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
class TuiModalService extends TuiPortal {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(inject(TuiPopupService));
|
|
59
|
+
this.component = TuiModalComponent;
|
|
60
|
+
}
|
|
61
|
+
add(component) {
|
|
62
|
+
const ref = this.service.add(component);
|
|
63
|
+
const el = ref.location.nativeElement;
|
|
64
|
+
ref.instance.component.set(new PolymorpheusComponent(this.content));
|
|
65
|
+
return () => {
|
|
66
|
+
ref.instance.component.set(null);
|
|
67
|
+
ref.changeDetectorRef.detectChanges();
|
|
68
|
+
el.classList.add(TUI_LEAVE);
|
|
69
|
+
Promise.allSettled(getAnimations(el))
|
|
70
|
+
.then(async () => Promise.allSettled(getAnimations(el.firstElementChild)))
|
|
71
|
+
.then(() => ref.destroy());
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
75
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiModalService }); }
|
|
76
|
+
}
|
|
77
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiModalService, decorators: [{
|
|
78
|
+
type: Injectable
|
|
79
|
+
}], ctorParameters: () => [] });
|
|
80
|
+
function getAnimations(el) {
|
|
81
|
+
return el?.getAnimations().map(async ({ finished }) => finished) || [];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Generated bundle index. Do not edit.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export { TuiModalComponent, TuiModalService };
|
|
89
|
+
//# sourceMappingURL=taiga-ui-core-portals-modal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-portals-modal.mjs","sources":["../../../projects/core/portals/modal/modal.component.ts","../../../projects/core/portals/modal/modal.service.ts","../../../projects/core/portals/modal/taiga-ui-core-portals-modal.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n type OnDestroy,\n type OnInit,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {TuiFocusTrap} from '@taiga-ui/cdk/directives/focus-trap';\nimport {type TuiPortalContext} from '@taiga-ui/cdk/portals';\nimport {tuiGetFocused} from '@taiga-ui/cdk/utils/focus';\nimport {TuiScrollControls, TuiScrollRef} from '@taiga-ui/core/components/scrollbar';\nimport {\n injectContext,\n type PolymorpheusContent,\n PolymorpheusOutlet,\n} from '@taiga-ui/polymorpheus';\n\n@Component({\n selector: 'tui-modal',\n imports: [PolymorpheusOutlet, TuiScrollControls],\n template: `\n <ng-container *polymorpheusOutlet=\"component(); context: context\" />\n <tui-scroll-controls class=\"t-scrollbars\" />\n `,\n styleUrl: './modal.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n hostDirectives: [TuiActiveZone, TuiFocusTrap, TuiScrollRef],\n host: {\n role: 'dialog',\n class: 'tui-enter',\n 'aria-modal': 'true',\n '[attr.aria-labelledby]': 'context.id',\n '(animationend.self)': '$event.target.classList.remove(\"tui-enter\")',\n },\n})\nexport class TuiModalComponent<T> implements OnDestroy, OnInit {\n private readonly current = inject(TuiActiveZone);\n private readonly parent = findActive(\n inject(TuiActiveZone, {skipSelf: true}),\n tuiGetFocused(inject(DOCUMENT)),\n );\n\n public readonly context = injectContext<TuiPortalContext<T>>();\n public readonly component = signal<PolymorpheusContent<TuiPortalContext<T>>>(null);\n\n public ngOnInit(): void {\n this.current.tuiActiveZoneParentSetter = this.parent;\n }\n\n public ngOnDestroy(): void {\n this.current.tuiActiveZoneParentSetter = null;\n }\n}\n\nfunction findActive(zone: TuiActiveZone, el: Element | null): TuiActiveZone | null {\n if (!el || !zone.contains(el)) {\n return null;\n }\n\n const active = zone.children.find(\n (child) => !child['el'].matches('[tuiActiveZoneAdapter]') && child.contains(el),\n );\n\n return active ? findActive(active, el) : zone;\n}\n","import {inject, Injectable, type Type} from '@angular/core';\nimport {TUI_LEAVE} from '@taiga-ui/cdk/directives/animated';\nimport {TuiPortal} from '@taiga-ui/cdk/portals';\nimport {TuiPopupService} from '@taiga-ui/core/portals/popup';\nimport {PolymorpheusComponent} from '@taiga-ui/polymorpheus';\n\nimport {TuiModalComponent} from './modal.component';\n\n@Injectable()\nexport abstract class TuiModalService<T, K = void> extends TuiPortal<T, K> {\n protected abstract readonly content: Type<unknown>;\n protected readonly component = TuiModalComponent;\n\n constructor() {\n super(inject(TuiPopupService));\n }\n\n protected override add(\n component: PolymorpheusComponent<TuiModalComponent<T>>,\n ): () => void {\n const ref = this.service.add(component);\n const el: HTMLElement = ref.location.nativeElement;\n\n ref.instance.component.set(new PolymorpheusComponent(this.content));\n\n return () => {\n ref.instance.component.set(null);\n ref.changeDetectorRef.detectChanges();\n el.classList.add(TUI_LEAVE);\n\n Promise.allSettled(getAnimations(el))\n .then(async () => Promise.allSettled(getAnimations(el.firstElementChild)))\n .then(() => ref.destroy());\n };\n }\n}\n\nfunction getAnimations(el: Element | null): ReadonlyArray<Promise<unknown>> {\n return el?.getAnimations().map(async ({finished}) => finished) || [];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;MAwCa,iBAAiB,CAAA;AAnB9B,IAAA,WAAA,GAAA;AAoBqB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC;QAC/B,IAAM,CAAA,MAAA,GAAG,UAAU,CAChC,MAAM,CAAC,aAAa,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,EACvC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAClC;QAEe,IAAO,CAAA,OAAA,GAAG,aAAa,EAAuB;AAC9C,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAA2C,IAAI,CAAC;AASrF;IAPU,QAAQ,GAAA;QACX,IAAI,CAAC,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,MAAM;;IAGjD,WAAW,GAAA;AACd,QAAA,IAAI,CAAC,OAAO,CAAC,yBAAyB,GAAG,IAAI;;+GAfxC,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,O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AAC,GAAG,CAAC,SAAS,CAAC;AAE3B,YAAA,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;AAC/B,iBAAA,IAAI,CAAC,YAAY,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAC;iBACxE,IAAI,CAAC,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;AAClC,SAAC;;+GAxBa,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAAf,eAAe,EAAA,CAAA,CAAA;;4FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBADpC;;AA6BD,SAAS,aAAa,CAAC,EAAkB,EAAA;AACrC,IAAA,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,OAAO,EAAC,QAAQ,EAAC,KAAK,QAAQ,CAAC,IAAI,EAAE;AACxE;;ACvCA;;AAEG;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Injectable, inject, TemplateRef, input, Directive, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
3
|
import { TuiPortalService, TuiPortals } from '@taiga-ui/cdk/portals';
|
|
4
|
-
import { tuiProvide } from '@taiga-ui/cdk/utils/
|
|
4
|
+
import { tuiProvide } from '@taiga-ui/cdk/utils/di';
|
|
5
5
|
|
|
6
6
|
class TuiPopupService extends TuiPortalService {
|
|
7
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
8
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
7
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPopupService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
8
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPopupService, providedIn: 'root' }); }
|
|
9
9
|
}
|
|
10
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
10
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPopupService, decorators: [{
|
|
11
11
|
type: Injectable,
|
|
12
12
|
args: [{
|
|
13
13
|
providedIn: 'root',
|
|
@@ -29,10 +29,10 @@ class TuiPopup {
|
|
|
29
29
|
ngOnDestroy() {
|
|
30
30
|
this.ref?.destroy();
|
|
31
31
|
}
|
|
32
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
33
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPopup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
33
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiPopup, isStandalone: true, selector: "ng-template[tuiPopup]", inputs: { show: { classPropertyName: "show", publicName: "tuiPopup", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 }); }
|
|
34
34
|
}
|
|
35
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
35
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPopup, decorators: [{
|
|
36
36
|
type: Directive,
|
|
37
37
|
args: [{
|
|
38
38
|
selector: 'ng-template[tuiPopup]',
|
|
@@ -40,10 +40,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
40
40
|
}] });
|
|
41
41
|
|
|
42
42
|
class TuiPopups extends TuiPortals {
|
|
43
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
44
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
43
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPopups, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
44
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: TuiPopups, isStandalone: true, selector: "tui-popups", providers: [tuiProvide(TuiPortalService, TuiPopupService)], usesInheritance: true, ngImport: i0, template: '<ng-content/><ng-container #vcr />', isInline: true, styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;display:grid;grid-template-rows:repeat(9,min-content) 1fr;pointer-events:none;overflow:hidden;overflow-wrap:break-word;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-left) env(safe-area-inset-bottom) env(safe-area-inset-right)}:host ::ng-deep>*{pointer-events:auto}:host:after{content:\"\";grid-row:10}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
45
45
|
}
|
|
46
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPopups, decorators: [{
|
|
47
47
|
type: Component,
|
|
48
48
|
args: [{ selector: 'tui-popups', template: '<ng-content/><ng-container #vcr />', changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiProvide(TuiPortalService, TuiPopupService)], styles: [":host{position:fixed;top:0;left:0;inline-size:100%;block-size:100%;display:grid;grid-template-rows:repeat(9,min-content) 1fr;pointer-events:none;overflow:hidden;overflow-wrap:break-word;box-sizing:border-box;padding:env(safe-area-inset-top) env(safe-area-inset-left) env(safe-area-inset-bottom) env(safe-area-inset-right)}:host ::ng-deep>*{pointer-events:auto}:host:after{content:\"\";grid-row:10}\n"] }]
|
|
49
49
|
}] });
|
|
@@ -53,4 +53,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
55
|
export { TuiPopup, TuiPopupService, TuiPopups };
|
|
56
|
-
//# sourceMappingURL=taiga-ui-core-
|
|
56
|
+
//# sourceMappingURL=taiga-ui-core-portals-popup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-portals-popup.mjs","sources":["../../../projects/core/portals/popup/popup.service.ts","../../../projects/core/portals/popup/popup.directive.ts","../../../projects/core/portals/popup/popups.component.ts","../../../projects/core/portals/popup/taiga-ui-core-portals-popup.ts"],"sourcesContent":["import {Injectable} from '@angular/core';\nimport {TuiPortalService} from '@taiga-ui/cdk/portals';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiPopupService extends TuiPortalService {}\n","import {\n Directive,\n type EmbeddedViewRef,\n inject,\n input,\n type OnChanges,\n type OnDestroy,\n TemplateRef,\n} from '@angular/core';\n\nimport {TuiPopupService} from './popup.service';\n\n@Directive({\n selector: 'ng-template[tuiPopup]',\n})\nexport class TuiPopup implements OnChanges, OnDestroy {\n private readonly template = inject(TemplateRef);\n private readonly service = inject(TuiPopupService);\n private ref?: EmbeddedViewRef<unknown>;\n\n public readonly show = input(false, {alias: 'tuiPopup'});\n\n public ngOnChanges(): void {\n this.ref?.destroy();\n\n if (this.show()) {\n this.ref = this.service.add(this.template);\n }\n }\n\n public ngOnDestroy(): void {\n this.ref?.destroy();\n }\n}\n","import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {TuiPortals, TuiPortalService} from '@taiga-ui/cdk/portals';\nimport {tuiProvide} from '@taiga-ui/cdk/utils/di';\n\nimport {TuiPopupService} from './popup.service';\n\n@Component({\n selector: 'tui-popups',\n template: '<ng-content/><ng-container #vcr />',\n styleUrl: './popups.style.less',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [tuiProvide(TuiPortalService, TuiPopupService)],\n})\nexport class TuiPopups extends TuiPortals {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAMM,MAAO,eAAgB,SAAQ,gBAAgB,CAAA;+GAAxC,eAAe,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFZ,MAAM,EAAA,CAAA,CAAA;;4FAET,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;MCUY,QAAQ,CAAA;AAHrB,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,WAAW,CAAC;AAC9B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,eAAe,CAAC;QAGlC,IAAI,CAAA,IAAA,GAAG,KAAK,CAAC,KAAK,EAAE,EAAC,KAAK,EAAE,UAAU,EAAC,CAAC;AAa3D;IAXU,WAAW,GAAA;AACd,QAAA,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE;AAEnB,QAAA,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE;AACb,YAAA,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;;;IAI3C,WAAW,GAAA;AACd,QAAA,IAAI,CAAC,GAAG,EAAE,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,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC,EAAA,MAAA,EAAA,CAAA,iZAAA,CAAA,EAAA;;;ACX9D;;AAEG;;;;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from '@taiga-ui/core/portals/alert';
|
|
2
|
+
export * from '@taiga-ui/core/portals/dialog';
|
|
3
|
+
export * from '@taiga-ui/core/portals/dropdown';
|
|
4
|
+
export * from '@taiga-ui/core/portals/hint';
|
|
5
|
+
export * from '@taiga-ui/core/portals/modal';
|
|
6
|
+
export * from '@taiga-ui/core/portals/popup';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Generated bundle index. Do not edit.
|
|
10
|
+
*/
|
|
11
|
+
//# sourceMappingURL=taiga-ui-core-portals.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-portals.mjs","sources":["../../../projects/core/portals/taiga-ui-core-portals.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAAA;;AAEG"}
|
|
@@ -1,91 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
-
import {
|
|
4
|
-
import { TUI_WINDOW_SIZE, TUI_IS_WEBKIT } from '@taiga-ui/cdk/tokens';
|
|
5
|
-
import { TUI_MEDIA } from '@taiga-ui/core/tokens';
|
|
6
|
-
import { Observable, map, distinctUntilChanged, shareReplay, fromEvent, startWith, of, finalize } from 'rxjs';
|
|
7
|
-
import { WA_WINDOW, WA_ANIMATION_FRAME } from '@ng-web-apis/common';
|
|
2
|
+
import { inject, NgZone, Injectable } from '@angular/core';
|
|
3
|
+
import { WA_ANIMATION_FRAME, WA_WINDOW } from '@ng-web-apis/common';
|
|
8
4
|
import { EMPTY_CLIENT_RECT } from '@taiga-ui/cdk/constants';
|
|
5
|
+
import { tuiZonefree } from '@taiga-ui/cdk/observables';
|
|
9
6
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
10
7
|
import { TuiPositionAccessor } from '@taiga-ui/core/classes';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* Service to provide the current breakpoint based on Taiga UI's media queries
|
|
14
|
-
*/
|
|
15
|
-
class TuiBreakpointService extends Observable {
|
|
16
|
-
constructor() {
|
|
17
|
-
super((subscriber) => this.stream$.subscribe(subscriber));
|
|
18
|
-
this.media = inject(TUI_MEDIA);
|
|
19
|
-
this.sorted = Object.values(this.media).sort((a, b) => a - b);
|
|
20
|
-
this.invert = Object.keys(this.media).reduce((ret, key) => ({
|
|
21
|
-
...ret,
|
|
22
|
-
[this.media[key]]: key,
|
|
23
|
-
}), {});
|
|
24
|
-
this.stream$ = inject(TUI_WINDOW_SIZE).pipe(map(({ width }) => this.sorted.find((size) => size > width)), map((key) => this.invert[key || this.sorted[this.sorted.length - 1] || 0] ?? null), distinctUntilChanged(), tuiZoneOptimized(), shareReplay({ bufferSize: 1, refCount: true }));
|
|
25
|
-
}
|
|
26
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiBreakpointService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
27
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiBreakpointService, providedIn: 'root' }); }
|
|
28
|
-
}
|
|
29
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiBreakpointService, decorators: [{
|
|
30
|
-
type: Injectable,
|
|
31
|
-
args: [{
|
|
32
|
-
providedIn: 'root',
|
|
33
|
-
}]
|
|
34
|
-
}], ctorParameters: () => [] });
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated use {@link TUI_DARK_MODE} instead
|
|
38
|
-
*/
|
|
39
|
-
class TuiDarkThemeService extends Observable {
|
|
40
|
-
constructor() {
|
|
41
|
-
const media = inject(WA_WINDOW).matchMedia('(prefers-color-scheme: dark)');
|
|
42
|
-
const media$ = fromEvent(media, 'change').pipe(startWith(null), map(() => media.matches), shareReplay({ bufferSize: 1, refCount: true }));
|
|
43
|
-
super((subscriber) => media$.subscribe(subscriber));
|
|
44
|
-
}
|
|
45
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDarkThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
46
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDarkThemeService, providedIn: 'root' }); }
|
|
47
|
-
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiDarkThemeService, decorators: [{
|
|
49
|
-
type: Injectable,
|
|
50
|
-
args: [{
|
|
51
|
-
providedIn: 'root',
|
|
52
|
-
}]
|
|
53
|
-
}], ctorParameters: () => [] });
|
|
54
|
-
|
|
55
|
-
class TuiFormatDateService {
|
|
56
|
-
constructor() {
|
|
57
|
-
this.locale = inject(LOCALE_ID);
|
|
58
|
-
}
|
|
59
|
-
format(timestamp) {
|
|
60
|
-
return of(new Date(timestamp).toLocaleTimeString(this.locale, {
|
|
61
|
-
hour: 'numeric',
|
|
62
|
-
minute: '2-digit',
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFormatDateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
66
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFormatDateService, providedIn: 'root' }); }
|
|
67
|
-
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiFormatDateService, decorators: [{
|
|
69
|
-
type: Injectable,
|
|
70
|
-
args: [{
|
|
71
|
-
providedIn: 'root',
|
|
72
|
-
}]
|
|
73
|
-
}] });
|
|
8
|
+
import { Observable, startWith, map, finalize } from 'rxjs';
|
|
9
|
+
import { TUI_IS_WEBKIT } from '@taiga-ui/cdk/tokens';
|
|
74
10
|
|
|
75
11
|
class TuiPositionService extends Observable {
|
|
76
12
|
constructor() {
|
|
77
13
|
const animationFrame$ = inject(WA_ANIMATION_FRAME);
|
|
78
14
|
const zone = inject(NgZone);
|
|
79
15
|
super((subscriber) => animationFrame$
|
|
80
|
-
.pipe(startWith(null), map(() => this.accessor.getPosition(this.el.getBoundingClientRect()
|
|
16
|
+
.pipe(startWith(null), map(() => this.accessor.getPosition(this.el.getBoundingClientRect())), tuiZonefree(zone), finalize(() => this.accessor.getPosition(EMPTY_CLIENT_RECT)))
|
|
81
17
|
.subscribe(subscriber));
|
|
82
18
|
this.el = tuiInjectElement();
|
|
83
19
|
this.accessor = inject(TuiPositionAccessor);
|
|
84
20
|
}
|
|
85
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
86
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
21
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPositionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
22
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPositionService }); }
|
|
87
23
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiPositionService, decorators: [{
|
|
89
25
|
type: Injectable
|
|
90
26
|
}], ctorParameters: () => [] });
|
|
91
27
|
|
|
@@ -98,15 +34,15 @@ class TuiVisualViewportService {
|
|
|
98
34
|
correct(point) {
|
|
99
35
|
return this.isWebkit
|
|
100
36
|
? [
|
|
101
|
-
point[0] + (this.win.visualViewport?.
|
|
102
|
-
point[1] + (this.win.visualViewport?.
|
|
37
|
+
point[0] + (this.win.visualViewport?.offsetLeft ?? 0),
|
|
38
|
+
point[1] + (this.win.visualViewport?.offsetTop ?? 0),
|
|
103
39
|
]
|
|
104
40
|
: point;
|
|
105
41
|
}
|
|
106
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
107
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
42
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiVisualViewportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
43
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiVisualViewportService, providedIn: 'root' }); }
|
|
108
44
|
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiVisualViewportService, decorators: [{
|
|
110
46
|
type: Injectable,
|
|
111
47
|
args: [{
|
|
112
48
|
providedIn: 'root',
|
|
@@ -117,5 +53,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
117
53
|
* Generated bundle index. Do not edit.
|
|
118
54
|
*/
|
|
119
55
|
|
|
120
|
-
export {
|
|
56
|
+
export { TuiPositionService, TuiVisualViewportService };
|
|
121
57
|
//# sourceMappingURL=taiga-ui-core-services.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-services.mjs","sources":["../../../projects/core/services/
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-services.mjs","sources":["../../../projects/core/services/position.service.ts","../../../projects/core/services/visual-viewport.service.ts","../../../projects/core/services/taiga-ui-core-services.ts"],"sourcesContent":["import {inject, Injectable, NgZone} from '@angular/core';\nimport {WA_ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {EMPTY_CLIENT_RECT} from '@taiga-ui/cdk/constants';\nimport {tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {TuiPositionAccessor} from '@taiga-ui/core/classes';\nimport {type TuiPoint} from '@taiga-ui/core/types';\nimport {finalize, map, Observable, startWith} from 'rxjs';\n\n@Injectable()\nexport class TuiPositionService extends Observable<TuiPoint> {\n private readonly el = tuiInjectElement();\n private readonly accessor = inject(TuiPositionAccessor);\n\n constructor() {\n const animationFrame$ = inject(WA_ANIMATION_FRAME);\n const zone = inject(NgZone);\n\n super((subscriber) =>\n animationFrame$\n .pipe(\n startWith(null),\n map(() => this.accessor.getPosition(this.el.getBoundingClientRect())),\n tuiZonefree(zone),\n finalize(() => this.accessor.getPosition(EMPTY_CLIENT_RECT)),\n )\n .subscribe(subscriber),\n );\n }\n}\n","import {inject, Injectable} from '@angular/core';\nimport {WA_WINDOW} from '@ng-web-apis/common';\nimport {TUI_IS_WEBKIT} from '@taiga-ui/cdk/tokens';\nimport {type TuiPoint} from '@taiga-ui/core/types';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiVisualViewportService {\n private readonly isWebkit = inject(TUI_IS_WEBKIT);\n private readonly win = inject(WA_WINDOW);\n\n // https://bugs.webkit.org/show_bug.cgi?id=207089\n public correct(point: TuiPoint): TuiPoint {\n return this.isWebkit\n ? [\n point[0] + (this.win.visualViewport?.offsetLeft ?? 0),\n point[1] + (this.win.visualViewport?.offsetTop ?? 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CAAC,cAAc,EAAE,UAAU,IAAI,CAAC,CAAC;AACrD,gBAAA,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,SAAS,IAAI,CAAC,CAAC;AACvD;cACD,KAAK;;+GAXN,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wBAAwB,cAFrB,MAAM,EAAA,CAAA,CAAA;;4FAET,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAHpC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;ACPD;;AAEG;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { InjectionToken, inject, signal, untracked, effect,
|
|
1
|
+
import { InjectionToken, inject, signal, untracked, effect, computed } from '@angular/core';
|
|
2
2
|
import { DOCUMENT } from '@angular/common';
|
|
3
|
-
import { tuiProvide,
|
|
4
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
3
|
+
import { tuiProvide, tuiCreateOptions } from '@taiga-ui/cdk/utils/di';
|
|
4
|
+
import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
+
import { tuiZoneOptimized, tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
|
|
6
|
+
import { TUI_WINDOW_SIZE } from '@taiga-ui/cdk/tokens';
|
|
7
|
+
import { map, distinctUntilChanged, fromEvent, filter, merge, switchMap, takeUntil, share } from 'rxjs';
|
|
5
8
|
import { WA_LOCAL_STORAGE, WA_WINDOW } from '@ng-web-apis/common';
|
|
6
|
-
import { fromEvent, filter, of, map, merge, switchMap, takeUntil, share } from 'rxjs';
|
|
7
|
-
import { TuiDayOfWeek } from '@taiga-ui/cdk/date-time';
|
|
8
9
|
import { tuiExtractI18n } from '@taiga-ui/i18n/utils';
|
|
9
10
|
import { CHAR_NO_BREAK_SPACE } from '@taiga-ui/cdk/constants';
|
|
10
|
-
import { tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
|
|
11
11
|
|
|
12
12
|
const TUI_REDUCED_MOTION = new InjectionToken(ngDevMode ? 'TUI_REDUCED_MOTION' : '', {
|
|
13
13
|
factory: () => inject(DOCUMENT).defaultView?.matchMedia?.('(prefers-reduced-motion: reduce)')
|
|
@@ -38,6 +38,30 @@ function tuiAsAuxiliary(x) {
|
|
|
38
38
|
return tuiProvide(TUI_AUXILIARY, x);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Token for media constant
|
|
43
|
+
*/
|
|
44
|
+
const TUI_MEDIA = new InjectionToken(ngDevMode ? 'TUI_MEDIA' : '', {
|
|
45
|
+
factory: () => ({
|
|
46
|
+
mobile: 768,
|
|
47
|
+
desktopSmall: 1280,
|
|
48
|
+
desktopLarge: Infinity,
|
|
49
|
+
}),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const TUI_BREAKPOINT = new InjectionToken(ngDevMode ? 'TUI_BREAKPOINT' : '', {
|
|
53
|
+
factory: () => {
|
|
54
|
+
const media = inject(TUI_MEDIA);
|
|
55
|
+
const sorted = Object.values(media).sort((a, b) => a - b);
|
|
56
|
+
const invert = Object.keys(media).reduce((ret, key) => ({
|
|
57
|
+
...ret,
|
|
58
|
+
[media[key]]: key,
|
|
59
|
+
}), {});
|
|
60
|
+
const stream$ = inject(TUI_WINDOW_SIZE).pipe(map(({ width }) => sorted.find((size) => size > width)), map((key) => invert[key || sorted[sorted.length - 1] || 0] ?? 'desktopLarge'), distinctUntilChanged(), tuiZoneOptimized());
|
|
61
|
+
return toSignal(stream$, { initialValue: 'desktopLarge' });
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
|
|
41
65
|
// TODO: Rename `ellipsis` to `more` in the next major version
|
|
42
66
|
const COMMON_ICONS = {
|
|
43
67
|
check: '@tui.check',
|
|
@@ -46,13 +70,10 @@ const COMMON_ICONS = {
|
|
|
46
70
|
more: '@tui.chevron-right',
|
|
47
71
|
search: '@tui.search',
|
|
48
72
|
ellipsis: '@tui.ellipsis',
|
|
73
|
+
decrement: '@tui.chevron-left',
|
|
74
|
+
increment: '@tui.chevron-right',
|
|
49
75
|
};
|
|
50
|
-
const TUI_COMMON_ICONS =
|
|
51
|
-
factory: () => COMMON_ICONS,
|
|
52
|
-
});
|
|
53
|
-
function tuiCommonIconsProvider(icons) {
|
|
54
|
-
return tuiProvideOptions(TUI_COMMON_ICONS, icons, COMMON_ICONS);
|
|
55
|
-
}
|
|
76
|
+
const [TUI_COMMON_ICONS, tuiCommonIconsProvider] = tuiCreateOptions(COMMON_ICONS);
|
|
56
77
|
|
|
57
78
|
const TUI_DARK_MODE_DEFAULT_KEY = 'tuiDark';
|
|
58
79
|
const TUI_DARK_MODE_KEY = new InjectionToken(ngDevMode ? 'TUI_DARK_MODE_KEY' : '', {
|
|
@@ -94,37 +115,28 @@ const TUI_DARK_MODE = new InjectionToken(ngDevMode ? 'TUI_DARK_MODE' : '', {
|
|
|
94
115
|
});
|
|
95
116
|
|
|
96
117
|
const TUI_DEFAULT_DATE_FORMAT = {
|
|
97
|
-
mode: '
|
|
118
|
+
mode: 'dd/mm/yyyy',
|
|
98
119
|
separator: '.',
|
|
99
120
|
};
|
|
100
121
|
/**
|
|
101
122
|
* Formatting configuration for displayed dates
|
|
102
123
|
*/
|
|
103
124
|
const TUI_DATE_FORMAT = new InjectionToken(ngDevMode ? 'TUI_DATE_FORMAT' : '', {
|
|
104
|
-
factory: () =>
|
|
125
|
+
factory: () => signal(TUI_DEFAULT_DATE_FORMAT),
|
|
105
126
|
});
|
|
106
127
|
function tuiDateFormatProvider(options) {
|
|
107
128
|
return {
|
|
108
129
|
provide: TUI_DATE_FORMAT,
|
|
109
|
-
|
|
110
|
-
|
|
130
|
+
useFactory: () => {
|
|
131
|
+
const parent = inject(TUI_DATE_FORMAT, { optional: true, skipSelf: true });
|
|
132
|
+
return computed(() => ({
|
|
133
|
+
...(parent?.() || TUI_DEFAULT_DATE_FORMAT),
|
|
134
|
+
...options,
|
|
135
|
+
}));
|
|
136
|
+
},
|
|
111
137
|
};
|
|
112
138
|
}
|
|
113
139
|
|
|
114
|
-
/**
|
|
115
|
-
* Token for adding data-type attribute to calendar cell
|
|
116
|
-
*/
|
|
117
|
-
const TUI_DAY_TYPE_HANDLER = new InjectionToken(ngDevMode ? 'TUI_DAY_TYPE_HANDLER' : '', {
|
|
118
|
-
factory: () => (day) => (day.isWeekend ? 'weekend' : 'weekday'),
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* The first day of the week index
|
|
123
|
-
*/
|
|
124
|
-
const TUI_FIRST_DAY_OF_WEEK = new InjectionToken(ngDevMode ? 'TUI_FIRST_DAY_OF_WEEK' : '', {
|
|
125
|
-
factory: () => TuiDayOfWeek.Monday,
|
|
126
|
-
});
|
|
127
|
-
|
|
128
140
|
/**
|
|
129
141
|
* Localized months names
|
|
130
142
|
*/
|
|
@@ -178,10 +190,6 @@ const TUI_ICON_END = new InjectionToken(ngDevMode ? 'TUI_ICON_END' : '', {
|
|
|
178
190
|
const TUI_ICON_REGISTRY = new InjectionToken(ngDevMode ? 'TUI_ICON_REGISTRY' : '', {
|
|
179
191
|
factory: () => ({}),
|
|
180
192
|
});
|
|
181
|
-
/**
|
|
182
|
-
* @deprecated: use {@link TUI_ICON_REGISTRY}
|
|
183
|
-
*/
|
|
184
|
-
const TUI_ICON_STARTS = TUI_ICON_REGISTRY;
|
|
185
193
|
function tuiIconsProvider(icons) {
|
|
186
194
|
return {
|
|
187
195
|
provide: TUI_ICON_REGISTRY,
|
|
@@ -221,17 +229,6 @@ function tuiIconResolverProvider(useValue) {
|
|
|
221
229
|
return { provide: TUI_ICON_RESOLVER, useValue };
|
|
222
230
|
}
|
|
223
231
|
|
|
224
|
-
/**
|
|
225
|
-
* Token for media constant
|
|
226
|
-
*/
|
|
227
|
-
const TUI_MEDIA = new InjectionToken(ngDevMode ? 'TUI_MEDIA' : '', {
|
|
228
|
-
factory: () => ({
|
|
229
|
-
mobile: 768,
|
|
230
|
-
desktopSmall: 1024,
|
|
231
|
-
desktopLarge: 1280,
|
|
232
|
-
}),
|
|
233
|
-
});
|
|
234
|
-
|
|
235
232
|
const TUI_DEFAULT_NUMBER_FORMAT = {
|
|
236
233
|
precision: NaN,
|
|
237
234
|
decimalSeparator: '.',
|
|
@@ -243,20 +240,21 @@ const TUI_DEFAULT_NUMBER_FORMAT = {
|
|
|
243
240
|
* Formatting configuration for displayed numbers
|
|
244
241
|
*/
|
|
245
242
|
const TUI_NUMBER_FORMAT = new InjectionToken(ngDevMode ? 'TUI_NUMBER_FORMAT' : '', {
|
|
246
|
-
factory: () =>
|
|
243
|
+
factory: () => signal(TUI_DEFAULT_NUMBER_FORMAT),
|
|
247
244
|
});
|
|
248
245
|
function tuiNumberFormatProvider(options) {
|
|
249
246
|
return {
|
|
250
247
|
provide: TUI_NUMBER_FORMAT,
|
|
251
|
-
|
|
252
|
-
|
|
248
|
+
useFactory: () => {
|
|
249
|
+
const parent = inject(TUI_NUMBER_FORMAT, { optional: true, skipSelf: true });
|
|
250
|
+
return computed(() => ({
|
|
251
|
+
...(parent?.() || TUI_DEFAULT_NUMBER_FORMAT),
|
|
252
|
+
...options,
|
|
253
|
+
}));
|
|
254
|
+
},
|
|
253
255
|
};
|
|
254
256
|
}
|
|
255
257
|
|
|
256
|
-
const TUI_SCROLL_REF = new InjectionToken(ngDevMode ? 'TUI_SCROLL_REF' : '', {
|
|
257
|
-
factory: () => new ElementRef(inject(DOCUMENT).documentElement),
|
|
258
|
-
});
|
|
259
|
-
|
|
260
258
|
/**
|
|
261
259
|
* A stream of possible selection changes
|
|
262
260
|
*/
|
|
@@ -267,13 +265,6 @@ const TUI_SELECTION_STREAM = new InjectionToken(ngDevMode ? 'TUI_SELECTION_STREA
|
|
|
267
265
|
},
|
|
268
266
|
});
|
|
269
267
|
|
|
270
|
-
const TUI_SPIN_ICONS = new InjectionToken(ngDevMode ? 'TUI_SPIN_ICONS' : '', {
|
|
271
|
-
factory: () => ({
|
|
272
|
-
decrement: '@tui.chevron-left',
|
|
273
|
-
increment: '@tui.chevron-right',
|
|
274
|
-
}),
|
|
275
|
-
});
|
|
276
|
-
|
|
277
268
|
const TUI_THEME = new InjectionToken(ngDevMode ? 'TUI_THEME' : '', {
|
|
278
269
|
factory: () => 'Taiga UI',
|
|
279
270
|
});
|
|
@@ -319,5 +310,5 @@ function tuiAsViewport(accessor) {
|
|
|
319
310
|
* Generated bundle index. Do not edit.
|
|
320
311
|
*/
|
|
321
312
|
|
|
322
|
-
export { TUI_ANIMATIONS_SPEED, TUI_ASSETS_PATH, TUI_AUXILIARY, TUI_CLEAR_WORD, TUI_CLOSE_WORD, TUI_COMMON_ICONS, TUI_DARK_MODE, TUI_DARK_MODE_DEFAULT_KEY, TUI_DARK_MODE_KEY, TUI_DATE_FORMAT,
|
|
313
|
+
export { TUI_ANIMATIONS_SPEED, TUI_ASSETS_PATH, TUI_AUXILIARY, TUI_BREAKPOINT, TUI_CLEAR_WORD, TUI_CLOSE_WORD, TUI_COMMON_ICONS, TUI_DARK_MODE, TUI_DARK_MODE_DEFAULT_KEY, TUI_DARK_MODE_KEY, TUI_DATE_FORMAT, TUI_DEFAULT_DATE_FORMAT, TUI_DEFAULT_ERROR_MESSAGE, TUI_DEFAULT_NUMBER_FORMAT, TUI_ICON_END, TUI_ICON_REGISTRY, TUI_ICON_RESOLVER, TUI_ICON_START, TUI_MEDIA, TUI_MONTHS, TUI_NOTHING_FOUND_MESSAGE, TUI_NUMBER_FORMAT, TUI_REDUCED_MOTION, TUI_SELECTION_STREAM, TUI_SHORT_WEEK_DAYS, TUI_SPIN_TEXTS, TUI_THEME, TUI_VALIDATION_ERRORS, TUI_VIEWPORT, tuiAsAuxiliary, tuiAsViewport, tuiAssetsPathProvider, tuiCommonIconsProvider, tuiDateFormatProvider, tuiGetIconMode, tuiIconResolverProvider, tuiIconsProvider, tuiInjectIconResolver, tuiNumberFormatProvider, tuiValidationErrorsProvider };
|
|
323
314
|
//# sourceMappingURL=taiga-ui-core-tokens.mjs.map
|