@taiga-ui/core 5.9.0 → 5.10.0-canary.ae2d96d
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/components/cell/cell-stretch.directive.d.ts +6 -0
- package/components/cell/index.d.ts +1 -0
- package/components/error/error.directive.d.ts +5 -0
- package/fesm2022/taiga-ui-core-classes.mjs +3 -3
- 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 +18 -18
- package/fesm2022/taiga-ui-core-components-carousel.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-cell.mjs +24 -8
- package/fesm2022/taiga-ui-core-components-cell.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-checkbox.mjs +4 -4
- package/fesm2022/taiga-ui-core-components-checkbox.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-data-list.mjs +20 -20
- package/fesm2022/taiga-ui-core-components-data-list.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-error.mjs +29 -13
- 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 +7 -7
- package/fesm2022/taiga-ui-core-components-icon.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-input.mjs +6 -6
- package/fesm2022/taiga-ui-core-components-label.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-label.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-link.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-link.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-loader.mjs +3 -3
- package/fesm2022/taiga-ui-core-components-notification.mjs +16 -16
- package/fesm2022/taiga-ui-core-components-notification.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-radio.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-radio.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-root.mjs +21 -5
- package/fesm2022/taiga-ui-core-components-root.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-scrollbar.mjs +21 -21
- package/fesm2022/taiga-ui-core-components-slider.mjs +15 -15
- package/fesm2022/taiga-ui-core-components-spin-button.mjs +3 -3
- package/fesm2022/taiga-ui-core-components-textfield.mjs +27 -32
- package/fesm2022/taiga-ui-core-components-textfield.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-components-title.mjs +7 -7
- package/fesm2022/taiga-ui-core-components-title.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-appearance.mjs +10 -10
- package/fesm2022/taiga-ui-core-directives-appearance.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-button-x.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-date-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-directives-group.mjs +7 -7
- package/fesm2022/taiga-ui-core-directives-group.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-icons.mjs +10 -10
- package/fesm2022/taiga-ui-core-directives-icons.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-directives-items-handlers.mjs +9 -9
- package/fesm2022/taiga-ui-core-directives-number-format.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-filter-by-input.mjs +3 -3
- package/fesm2022/taiga-ui-core-pipes-format-number.mjs +3 -3
- package/fesm2022/taiga-ui-core-portals-alert.mjs +10 -10
- package/fesm2022/taiga-ui-core-portals-alert.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-dialog.mjs +13 -13
- package/fesm2022/taiga-ui-core-portals-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-dropdown.mjs +54 -54
- package/fesm2022/taiga-ui-core-portals-hint.mjs +51 -50
- package/fesm2022/taiga-ui-core-portals-hint.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-modal.mjs +8 -8
- package/fesm2022/taiga-ui-core-portals-modal.mjs.map +1 -1
- package/fesm2022/taiga-ui-core-portals-popup.mjs +9 -9
- package/fesm2022/taiga-ui-core-services.mjs +6 -6
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs +2 -2
- package/fesm2022/taiga-ui-core-utils-miscellaneous.mjs.map +1 -1
- package/package.json +4 -4
- package/portals/hint/hint-options.directive.d.ts +1 -3
|
@@ -26,15 +26,15 @@ class TuiModalComponent {
|
|
|
26
26
|
ngOnDestroy() {
|
|
27
27
|
this.current.tuiActiveZoneParentSetter = null;
|
|
28
28
|
}
|
|
29
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
30
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
29
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
30
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: TuiModalComponent, isStandalone: true, selector: "tui-modal", host: { attributes: { "aria-modal": "true", "data-tui-version": "5.10.0-canary.ae2d96d", "role": "dialog" }, 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 }], ngImport: i0, template: `
|
|
31
31
|
<div tuiScrollRef>
|
|
32
32
|
<ng-container *polymorpheusOutlet="component(); context: context" />
|
|
33
33
|
<tui-scroll-controls class="t-scrollbars" />
|
|
34
34
|
</div>
|
|
35
|
-
`, isInline: true, styles: ["@keyframes tuiModalBackdrop{0%{-webkit-backdrop-filter:none;backdrop-filter:none}to{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}}@keyframes tuiDummy{to{color:currentColor}}tui-modal:where(*[data-tui-version=\"5.
|
|
35
|
+
`, isInline: true, styles: ["@keyframes tuiModalBackdrop{0%{-webkit-backdrop-filter:none;backdrop-filter:none}to{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}}@keyframes tuiDummy{to{color:currentColor}}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]){scrollbar-width:none;-ms-overflow-style:none;position:fixed;inset:0;outline:none;overflow:auto;overscroll-behavior:none;transform:translateY(var(--t-root-top))}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])::-webkit-scrollbar,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])::-webkit-scrollbar-thumb{display:none}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):not(:last-of-type){interactivity:inert}@supports not (selector(:has(*))) or not (selector(:nth-child(1 of *))){tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type:not(.tui-leave):before{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type.tui-enter,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type.tui-leave{animation-name:tuiDummy}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type.tui-enter:before,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type.tui-leave:before{animation-name:tuiModalBackdrop}}@supports (selector(:has(*))){tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):nth-last-child(1 of tui-modal:not(.tui-leave):not(:has(.tui-backdrop-hidden))):before{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):nth-last-child(1 of tui-modal:not(:has(.tui-backdrop-hidden))):is(.tui-enter,.tui-leave){animation-name:tuiDummy}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):nth-last-child(1 of tui-modal:not(:has(.tui-backdrop-hidden))):is(.tui-enter,.tui-leave):before{animation-name:tuiModalBackdrop}}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):before{transition-property:backdrop-filter;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:sticky;inset:0;display:block;block-size:200%;transition-timing-function:linear;animation-duration:var(--tui-duration);animation-timing-function:cubic-bezier(.14,.52,.35,.84);perspective:10rem}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]).tui-leave:before{animation-direction:reverse}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]{scrollbar-width:none;-ms-overflow-style:none;position:sticky;inset:0;display:grid;place-items:center;block-size:100%;overflow:auto;overscroll-behavior:none}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]::-webkit-scrollbar,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]::-webkit-scrollbar-thumb{display:none}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.t-scrollbars{position:fixed;inset:0;margin:0;color:#747474}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.t-scrollbars .t-bar_horizontal,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.t-scrollbars .t-bar_vertical .t-thumb[style*=\"height: 100%\"]{display:none}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.tui-enter+.t-scrollbars .t-bar_vertical,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.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" }, { kind: "directive", type: TuiScrollRef, selector: "[tuiScrollRef]" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None }); }
|
|
36
36
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiModalComponent, decorators: [{
|
|
38
38
|
type: Component,
|
|
39
39
|
args: [{ selector: 'tui-modal', imports: [PolymorpheusOutlet, TuiScrollControls, TuiScrollRef], template: `
|
|
40
40
|
<div tuiScrollRef>
|
|
@@ -48,7 +48,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.21", ngImpo
|
|
|
48
48
|
class: 'tui-enter',
|
|
49
49
|
'[attr.aria-labelledby]': 'context.id',
|
|
50
50
|
'(animationend.self)': '$event.target.classList.remove("tui-enter")',
|
|
51
|
-
}, styles: ["@keyframes tuiModalBackdrop{0%{-webkit-backdrop-filter:none;backdrop-filter:none}to{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}}@keyframes tuiDummy{to{color:currentColor}}tui-modal:where(*[data-tui-version=\"5.
|
|
51
|
+
}, styles: ["@keyframes tuiModalBackdrop{0%{-webkit-backdrop-filter:none;backdrop-filter:none}to{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}}@keyframes tuiDummy{to{color:currentColor}}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]){scrollbar-width:none;-ms-overflow-style:none;position:fixed;inset:0;outline:none;overflow:auto;overscroll-behavior:none;transform:translateY(var(--t-root-top))}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])::-webkit-scrollbar,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])::-webkit-scrollbar-thumb{display:none}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):not(:last-of-type){interactivity:inert}@supports not (selector(:has(*))) or not (selector(:nth-child(1 of *))){tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type:not(.tui-leave):before{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type.tui-enter,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type.tui-leave{animation-name:tuiDummy}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type.tui-enter:before,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):last-of-type.tui-leave:before{animation-name:tuiModalBackdrop}}@supports (selector(:has(*))){tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):nth-last-child(1 of tui-modal:not(.tui-leave):not(:has(.tui-backdrop-hidden))):before{-webkit-backdrop-filter:brightness(.25);backdrop-filter:brightness(.25)}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):nth-last-child(1 of tui-modal:not(:has(.tui-backdrop-hidden))):is(.tui-enter,.tui-leave){animation-name:tuiDummy}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):nth-last-child(1 of tui-modal:not(:has(.tui-backdrop-hidden))):is(.tui-enter,.tui-leave):before{animation-name:tuiModalBackdrop}}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]):before{transition-property:backdrop-filter;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;content:\"\";position:sticky;inset:0;display:block;block-size:200%;transition-timing-function:linear;animation-duration:var(--tui-duration);animation-timing-function:cubic-bezier(.14,.52,.35,.84);perspective:10rem}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"]).tui-leave:before{animation-direction:reverse}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]{scrollbar-width:none;-ms-overflow-style:none;position:sticky;inset:0;display:grid;place-items:center;block-size:100%;overflow:auto;overscroll-behavior:none}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]::-webkit-scrollbar,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]::-webkit-scrollbar-thumb{display:none}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.t-scrollbars{position:fixed;inset:0;margin:0;color:#747474}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.t-scrollbars .t-bar_horizontal,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.t-scrollbars .t-bar_vertical .t-thumb[style*=\"height: 100%\"]{display:none}tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.tui-enter+.t-scrollbars .t-bar_vertical,tui-modal:where(*[data-tui-version=\"5.10.0-canary.ae2d96d\"])>[tuiScrollRef]>.tui-leave+.t-scrollbars .t-bar_vertical{display:none}\n"] }]
|
|
52
52
|
}] });
|
|
53
53
|
function findActive(zone, el) {
|
|
54
54
|
if (!el || !zone.contains(el)) {
|
|
@@ -82,10 +82,10 @@ class TuiModalService extends TuiPortal {
|
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
}
|
|
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.
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
86
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiModalService }); }
|
|
87
87
|
}
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiModalService, decorators: [{
|
|
89
89
|
type: Injectable
|
|
90
90
|
}], ctorParameters: () => [] });
|
|
91
91
|
function getAnimations(el) {
|
|
@@ -1 +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 {TUI_VERSION} from '@taiga-ui/cdk/constants';\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, TuiScrollRef],\n template: `\n <div tuiScrollRef>\n <ng-container *polymorpheusOutlet=\"component(); context: context\" />\n <tui-scroll-controls class=\"t-scrollbars\" />\n </div>\n `,\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './modal.style.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection\n changeDetection: ChangeDetectionStrategy.Default,\n hostDirectives: [TuiActiveZone, TuiFocusTrap],\n host: {\n 'aria-modal': 'true',\n 'data-tui-version': TUI_VERSION,\n role: 'dialog',\n class: 'tui-enter',\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\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(() => {\n // Under zoneless + provideAnimations Angular's animation engine queues\n // the modal removal but engine.flush never runs from a microtask, so\n // the element stays in DOM with `tui-leave` class. Detach it manually.\n ref.destroy();\n el.remove();\n });\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":";;;;;;;;;;;;;;;MAiDa,iBAAiB,CAAA;AA3B9B,IAAA,WAAA,GAAA;AA4BqB,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,aAAa,CAAC;QAE/B,IAAA,CAAA,MAAM,GAAG,UAAU,CAChC,MAAM,CAAC,aAAa,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,EACvC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAClC;QAEe,IAAA,CAAA,OAAO,GAAG,aAAa,EAAuB;AAC9C,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAA2C,IAAI,CAAC;AASrF,IAAA;IAPU,QAAQ,GAAA;QACX,IAAI,CAAC,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,MAAM;IACxD;IAEO,WAAW,GAAA;AACd,QAAA,IAAI,CAAC,OAAO,CAAC,yBAAyB,GAAG,IAAI;IACjD;+GAjBS,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,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,YAAA,EAAA,MAAA,EAAA,kBAAA,EAAA,
|
|
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 {TUI_VERSION} from '@taiga-ui/cdk/constants';\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, TuiScrollRef],\n template: `\n <div tuiScrollRef>\n <ng-container *polymorpheusOutlet=\"component(); context: context\" />\n <tui-scroll-controls class=\"t-scrollbars\" />\n </div>\n `,\n styles: `\n [data-tui-version='${TUI_VERSION}'] {\n @import './modal.style.less';\n }\n `,\n encapsulation: ViewEncapsulation.None,\n // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection\n changeDetection: ChangeDetectionStrategy.Default,\n hostDirectives: [TuiActiveZone, TuiFocusTrap],\n host: {\n 'aria-modal': 'true',\n 'data-tui-version': TUI_VERSION,\n role: 'dialog',\n class: 'tui-enter',\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\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(() => {\n // Under zoneless + provideAnimations Angular's animation engine queues\n // the modal removal but engine.flush never runs from a microtask, so\n // the element stays in DOM with `tui-leave` class. Detach it manually.\n ref.destroy();\n el.remove();\n });\n };\n }\n}\n\nfunction getAnimations(el: Element | null): ReadonlyArray<Promise<unknown>> {\n return el?.getAnimations?.().map(async ({finished}) => finished) || [];\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BAAiB,CAAC,CAAC;iBACxE,IAAI,CAAC,MAAK;;;;gBAIP,GAAG,CAAC,OAAO,EAAE;gBACb,EAAE,CAAC,MAAM,EAAE;AACf,YAAA,CAAC,CAAC;AACV,QAAA,CAAC;IACL;+GA/BkB,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;;AAmCD,SAAS,aAAa,CAAC,EAAkB,EAAA;IACrC,OAAO,EAAE,EAAE,aAAa,IAAI,CAAC,GAAG,CAAC,OAAO,EAAC,QAAQ,EAAC,KAAK,QAAQ,CAAC,IAAI,EAAE;AAC1E;;AC7CA;;AAEG;;;;"}
|
|
@@ -5,10 +5,10 @@ import { TuiVCR } from '@taiga-ui/cdk/directives/vcr';
|
|
|
5
5
|
import { tuiProvide } from '@taiga-ui/cdk/utils/di';
|
|
6
6
|
|
|
7
7
|
class TuiPopupService extends TuiPortalService {
|
|
8
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
9
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
8
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPopupService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
9
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPopupService, providedIn: 'root' }); }
|
|
10
10
|
}
|
|
11
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPopupService, decorators: [{
|
|
12
12
|
type: Injectable,
|
|
13
13
|
args: [{ providedIn: 'root' }]
|
|
14
14
|
}] });
|
|
@@ -28,19 +28,19 @@ class TuiPopup {
|
|
|
28
28
|
ngOnDestroy() {
|
|
29
29
|
this.ref?.destroy();
|
|
30
30
|
}
|
|
31
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
32
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.
|
|
31
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPopup, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
32
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.22", type: TuiPopup, isStandalone: true, selector: "ng-template[tuiPopup]", inputs: { show: { classPropertyName: "show", publicName: "tuiPopup", isSignal: true, isRequired: false, transformFunction: null } }, usesOnChanges: true, ngImport: i0 }); }
|
|
33
33
|
}
|
|
34
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
34
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPopup, decorators: [{
|
|
35
35
|
type: Directive,
|
|
36
36
|
args: [{ selector: 'ng-template[tuiPopup]' }]
|
|
37
37
|
}] });
|
|
38
38
|
|
|
39
39
|
class TuiPopups extends TuiPortals {
|
|
40
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
41
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
40
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPopups, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
41
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.22", type: TuiPopups, isStandalone: true, selector: "tui-popups", providers: [tuiProvide(TuiPortalService, TuiPopupService)], usesInheritance: true, ngImport: i0, template: '<ng-content/><ng-container tuiVCR />', isInline: true, styles: [":host{position:fixed;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%;display:grid;grid-template-rows:repeat(14,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:15}\n"], dependencies: [{ kind: "directive", type: TuiVCR, selector: "[tuiVCR]" }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
|
|
42
42
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPopups, decorators: [{
|
|
44
44
|
type: Component,
|
|
45
45
|
args: [{ selector: 'tui-popups', imports: [TuiVCR], template: '<ng-content/><ng-container tuiVCR />', changeDetection: ChangeDetectionStrategy.Default, providers: [tuiProvide(TuiPortalService, TuiPopupService)], styles: [":host{position:fixed;inset-block-start:0;inset-inline-start:0;inline-size:100%;block-size:100%;display:grid;grid-template-rows:repeat(14,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:15}\n"] }]
|
|
46
46
|
}] });
|
|
@@ -18,10 +18,10 @@ class TuiPositionService extends Observable {
|
|
|
18
18
|
this.el = tuiInjectElement();
|
|
19
19
|
this.accessor = inject(TuiPositionAccessor);
|
|
20
20
|
}
|
|
21
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
22
|
-
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.22", ngImport: i0, type: TuiPositionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
22
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPositionService }); }
|
|
23
23
|
}
|
|
24
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiPositionService, decorators: [{
|
|
25
25
|
type: Injectable
|
|
26
26
|
}], ctorParameters: () => [] });
|
|
27
27
|
|
|
@@ -39,10 +39,10 @@ class TuiVisualViewportService {
|
|
|
39
39
|
]
|
|
40
40
|
: point;
|
|
41
41
|
}
|
|
42
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
43
|
-
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.22", ngImport: i0, type: TuiVisualViewportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
43
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiVisualViewportService, providedIn: 'root' }); }
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.22", ngImport: i0, type: TuiVisualViewportService, decorators: [{
|
|
46
46
|
type: Injectable,
|
|
47
47
|
args: [{ providedIn: 'root' }]
|
|
48
48
|
}] });
|
|
@@ -2,9 +2,9 @@ import { DOCUMENT } from '@angular/common';
|
|
|
2
2
|
import { InjectionToken, signal, inject, provideAppInitializer, effect } from '@angular/core';
|
|
3
3
|
import { TUI_FONT_SIZE_HANDLER } from '@taiga-ui/cdk/directives/font-size';
|
|
4
4
|
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
5
|
-
import { tuiPx, tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
6
5
|
import { tuiGetElementObscures } from '@taiga-ui/cdk/utils/dom';
|
|
7
6
|
import { REMOVE_STYLES_ON_COMPONENT_DESTROY, Meta } from '@angular/platform-browser';
|
|
7
|
+
import { tuiIsPresent } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
8
8
|
import { TUI_DARK_MODE } from '@taiga-ui/core/tokens';
|
|
9
9
|
import { provideEventPlugins } from '@taiga-ui/event-plugins';
|
|
10
10
|
|
|
@@ -18,7 +18,7 @@ function tuiEnableFontScaling() {
|
|
|
18
18
|
return (size) => {
|
|
19
19
|
const current = tuiClamp(size, 17, 28) - 17;
|
|
20
20
|
offset.set(current);
|
|
21
|
-
return documentElement.style.setProperty('--
|
|
21
|
+
return documentElement.style.setProperty('--t-font-offset', String(current));
|
|
22
22
|
};
|
|
23
23
|
},
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-utils-miscellaneous.mjs","sources":["../../../projects/core/utils/miscellaneous/font-scaling.ts","../../../projects/core/utils/miscellaneous/get-duration.ts","../../../projects/core/utils/miscellaneous/is-editing-key.ts","../../../projects/core/utils/miscellaneous/is-obscured.ts","../../../projects/core/utils/miscellaneous/override-options.ts","../../../projects/core/utils/miscellaneous/provide-taiga.ts","../../../projects/core/utils/miscellaneous/size-bigger.ts","../../../projects/core/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n inject,\n InjectionToken,\n type Provider,\n type Signal,\n signal,\n type WritableSignal,\n} from '@angular/core';\nimport {TUI_FONT_SIZE_HANDLER} from '@taiga-ui/cdk/directives/font-size';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-utils-miscellaneous.mjs","sources":["../../../projects/core/utils/miscellaneous/font-scaling.ts","../../../projects/core/utils/miscellaneous/get-duration.ts","../../../projects/core/utils/miscellaneous/is-editing-key.ts","../../../projects/core/utils/miscellaneous/is-obscured.ts","../../../projects/core/utils/miscellaneous/override-options.ts","../../../projects/core/utils/miscellaneous/provide-taiga.ts","../../../projects/core/utils/miscellaneous/size-bigger.ts","../../../projects/core/utils/miscellaneous/taiga-ui-core-utils-miscellaneous.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n inject,\n InjectionToken,\n type Provider,\n type Signal,\n signal,\n type WritableSignal,\n} from '@angular/core';\nimport {TUI_FONT_SIZE_HANDLER} from '@taiga-ui/cdk/directives/font-size';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\n\nexport const TUI_FONT_OFFSET = new InjectionToken<Signal<number>>(\n ngDevMode ? 'TUI_FONT_OFFSET' : '',\n {factory: () => signal(0)},\n);\n\nexport function tuiEnableFontScaling(): Provider {\n return {\n provide: TUI_FONT_SIZE_HANDLER,\n useFactory: () => {\n const offset = inject<WritableSignal<number>>(TUI_FONT_OFFSET);\n const {documentElement} = inject(DOCUMENT);\n\n return (size: number): void => {\n const current = tuiClamp(size, 17, 28) - 17;\n\n offset.set(current);\n\n return documentElement.style.setProperty(\n '--t-font-offset',\n String(current),\n );\n };\n },\n };\n}\n","export const TUI_ANIMATIONS_DEFAULT_DURATION = 300;\n\nexport function tuiGetDuration(speed: number): number {\n return speed && TUI_ANIMATIONS_DEFAULT_DURATION / speed;\n}\n","const KEYS: readonly string[] = [\n 'Spacebar',\n 'Backspace',\n 'Delete',\n 'ArrowLeft',\n 'ArrowRight',\n 'Left',\n 'Right',\n 'End',\n 'Home',\n];\n\n/**\n * Check if pressed key is interactive in terms of input field\n */\nexport function tuiIsEditingKey(key = ''): boolean {\n return key.length === 1 || KEYS.includes(key);\n}\n","import {tuiGetElementObscures} from '@taiga-ui/cdk/utils/dom';\n\n/**\n * @internal\n */\nexport function tuiIsObscured(el: HTMLElement, exceptSelector = 'tui-popups'): boolean {\n return !!tuiGetElementObscures(el)?.some((el) => !el.closest(exceptSelector));\n}\n","export function tuiOverrideOptions<T>(\n override: Partial<T>,\n fallback: T,\n): (directive: T | null, options: T | null) => T {\n return (directive, options) => {\n const result = directive || {...(options || fallback)};\n\n Object.keys(override).forEach((key) => {\n // Update directive props with new defaults before inputs are processed\n (result as Record<string, unknown>)[key] = override[key as keyof T];\n });\n\n return result;\n };\n}\n","import {DOCUMENT} from '@angular/common';\nimport {\n effect,\n type EnvironmentProviders,\n inject,\n InjectionToken,\n provideAppInitializer,\n type Provider,\n} from '@angular/core';\nimport {Meta, REMOVE_STYLES_ON_COMPONENT_DESTROY} from '@angular/platform-browser';\nimport {tuiIsPresent} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_DARK_MODE} from '@taiga-ui/core/tokens';\nimport {provideEventPlugins} from '@taiga-ui/event-plugins';\n\nimport {tuiEnableFontScaling} from './font-scaling';\n\ninterface ExperimentalAPIs {\n readonly all: boolean;\n}\n\nexport interface TuiOptions {\n readonly mode?: 'dark' | 'light';\n readonly apis: Partial<ExperimentalAPIs> | 'stable';\n readonly fontScaling: boolean;\n readonly scrollbars: 'custom' | 'native';\n}\n\nconst DEFAULT: TuiOptions = {\n apis: 'stable',\n fontScaling: true,\n scrollbars: 'custom',\n};\n\nexport const TUI_OPTIONS = new InjectionToken<TuiOptions>(ngDevMode ? 'TUI_OPTIONS' : '');\n\nexport function provideTaiga(\n config: Partial<TuiOptions> = {},\n): Array<EnvironmentProviders | Provider> {\n const options = {...DEFAULT, ...config};\n\n const providers: Array<EnvironmentProviders | Provider> = [\n {\n provide: REMOVE_STYLES_ON_COMPONENT_DESTROY,\n useValue: false,\n },\n {\n provide: TUI_OPTIONS,\n useValue: options,\n },\n provideEventPlugins(),\n provideAppInitializer(() => {\n const doc = inject(DOCUMENT);\n const meta = inject(Meta);\n const mode = inject(TUI_DARK_MODE);\n\n if (options.scrollbars === 'custom') {\n doc.documentElement.classList.add('tui-zero-scrollbar');\n }\n\n if (tuiIsPresent(options.mode)) {\n mode.set(options.mode === 'dark');\n }\n\n if (options.fontScaling && !meta.getTag('name=\"text-scale\"')) {\n meta.addTag({name: 'text-scale', content: 'scale'});\n }\n\n effect(() => {\n if (mode()) {\n doc.body.setAttribute('tuiTheme', 'dark');\n } else {\n doc.body.removeAttribute('tuiTheme');\n }\n });\n }),\n ];\n\n if (options.fontScaling) {\n providers.push(tuiEnableFontScaling());\n }\n\n return providers;\n}\n","import {type TuiSizeXXL, type TuiSizeXXS} from '@taiga-ui/core/types';\n\nconst SIZES: Record<TuiSizeXXL | TuiSizeXXS, number> = {\n xxs: 0,\n xs: 1,\n s: 2,\n m: 3,\n l: 4,\n xl: 5,\n xxl: 6,\n};\n\n/**\n * Compares size constants to determine if first size is bigger than the second\n *\n * @param size size that we need to compare\n * @param biggerThanSize size to compare with, 's' by default\n */\nexport function tuiSizeBigger(\n size: TuiSizeXXL | TuiSizeXXS,\n biggerThanSize: TuiSizeXXL | TuiSizeXXS = 's',\n): boolean {\n return SIZES[size] > SIZES[biggerThanSize];\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAYO,MAAM,eAAe,GAAG,IAAI,cAAc,CAC7C,SAAS,GAAG,iBAAiB,GAAG,EAAE,EAClC,EAAC,OAAO,EAAE,MAAM,MAAM,CAAC,CAAC,CAAC,EAAC;SAGd,oBAAoB,GAAA;IAChC,OAAO;AACH,QAAA,OAAO,EAAE,qBAAqB;QAC9B,UAAU,EAAE,MAAK;AAC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AA,IAAI,OAAO,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE;AAC1D,gBAAA,IAAI,CAAC,MAAM,CAAC,EAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAC,CAAC;YACvD;YAEA,MAAM,CAAC,MAAK;gBACR,IAAI,IAAI,EAAE,EAAE;oBACR,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC;gBAC7C;qBAAO;AACH,oBAAA,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC;gBACxC;AACJ,YAAA,CAAC,CAAC;AACN,QAAA,CAAC,CAAC;KACL;AAED,IAAA,IAAI,OAAO,CAAC,WAAW,EAAE;AACrB,QAAA,SAAS,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC1C;AAEA,IAAA,OAAO,SAAS;AACpB;;AChFA,MAAM,KAAK,GAA4C;AACnD,IAAA,GAAG,EAAE,CAAC;AACN,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,CAAC,EAAE,CAAC;AACJ,IAAA,EAAE,EAAE,CAAC;AACL,IAAA,GAAG,EAAE,CAAC;CACT;AAED;;;;;AAKG;SACa,aAAa,CACzB,IAA6B,EAC7B,iBAA0C,GAAG,EAAA;IAE7C,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,cAAc,CAAC;AAC9C;;ACvBA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/core",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.0-canary.ae2d96d",
|
|
4
4
|
"description": "Core library for creating Angular components and applications using Taiga UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"@ng-web-apis/intersection-observer": "^5.3.0",
|
|
42
42
|
"@ng-web-apis/mutation-observer": "^5.3.0",
|
|
43
43
|
"@ng-web-apis/platform": "^5.3.0",
|
|
44
|
-
"@taiga-ui/cdk": "5.
|
|
44
|
+
"@taiga-ui/cdk": "5.10.0",
|
|
45
45
|
"@taiga-ui/event-plugins": "^5.0.0",
|
|
46
|
-
"@taiga-ui/i18n": "5.
|
|
46
|
+
"@taiga-ui/i18n": "5.10.0",
|
|
47
47
|
"@taiga-ui/polymorpheus": "^5.0.1",
|
|
48
|
-
"@taiga-ui/styles": "5.
|
|
48
|
+
"@taiga-ui/styles": "5.10.0",
|
|
49
49
|
"rxjs": ">=7.0.0"
|
|
50
50
|
},
|
|
51
51
|
"schematics": "./schematics/collection.json",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type FactoryProvider, InjectionToken } from '@angular/core';
|
|
2
1
|
import { type TuiAppearanceOptions } from '@taiga-ui/core/directives/appearance';
|
|
3
2
|
export type TuiHintDirection = 'bottom-end' | 'bottom-start' | 'bottom' | 'end-bottom' | 'end-top' | 'end' | 'start-bottom' | 'start-top' | 'start' | 'top-end' | 'top-start' | 'top';
|
|
4
3
|
export declare const TUI_HINT_DIRECTIONS: readonly TuiHintDirection[];
|
|
@@ -13,5 +12,4 @@ export declare const TUI_HINT_DEFAULT_OPTIONS: TuiHintOptions;
|
|
|
13
12
|
/**
|
|
14
13
|
* Default parameters for hint directive
|
|
15
14
|
*/
|
|
16
|
-
export declare const TUI_HINT_OPTIONS: InjectionToken<TuiHintOptions
|
|
17
|
-
export declare const tuiHintOptionsProvider: (options: Partial<TuiHintOptions>) => FactoryProvider;
|
|
15
|
+
export declare const TUI_HINT_OPTIONS: import("@angular/core").InjectionToken<TuiHintOptions>, tuiHintOptionsProvider: (item: Partial<TuiHintOptions> | (() => Partial<TuiHintOptions>)) => import("@angular/core").FactoryProvider;
|