@taiga-ui/core 2.57.0 → 2.59.0
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/bundles/taiga-ui-core-components-alert.umd.js +2 -2
- package/bundles/taiga-ui-core-components-alert.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-alert.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-alert.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-calendar.umd.js +2 -2
- package/bundles/taiga-ui-core-components-calendar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-calendar.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-calendar.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.js +2 -2
- package/bundles/taiga-ui-core-components-dropdown-box.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-dropdown-box.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-error.umd.js +2 -2
- package/bundles/taiga-ui-core-components-error.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-error.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-error.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.js +2 -2
- package/bundles/taiga-ui-core-components-expand.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-expand.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js +2 -2
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-hosted-dropdown.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-label.umd.js +2 -2
- package/bundles/taiga-ui-core-components-label.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-label.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-label.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-notification.umd.js +2 -2
- package/bundles/taiga-ui-core-components-notification.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-notification.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-notification.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js +2 -2
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-checkbox.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js +2 -2
- package/bundles/taiga-ui-core-components-primitive-spin-button.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-spin-button.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-spin-button.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js +3 -3
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-primitive-textfield.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.js +2 -2
- package/bundles/taiga-ui-core-components-root.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-root.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-root.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-scroll-controls.umd.js +2 -2
- package/bundles/taiga-ui-core-components-scroll-controls.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-scroll-controls.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.umd.js +2 -2
- package/bundles/taiga-ui-core-components-scrollbar.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-scrollbar.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-svg.umd.js +2 -2
- package/bundles/taiga-ui-core-components-svg.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-svg.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-svg.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.js +2 -2
- package/bundles/taiga-ui-core-components-tooltip.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-tooltip.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-constants.umd.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.js.map +1 -1
- package/bundles/taiga-ui-core-constants.umd.min.js +1 -1
- package/bundles/taiga-ui-core-constants.umd.min.js.map +1 -1
- package/bundles/taiga-ui-core-enums.umd.js +1 -0
- package/bundles/taiga-ui-core-enums.umd.js.map +1 -1
- package/bundles/taiga-ui-core-enums.umd.min.js +1 -1
- package/bundles/taiga-ui-core-enums.umd.min.js.map +1 -1
- package/components/alert/taiga-ui-core-components-alert.metadata.json +1 -1
- package/components/calendar/taiga-ui-core-components-calendar.metadata.json +1 -1
- package/components/dropdown-box/taiga-ui-core-components-dropdown-box.metadata.json +1 -1
- package/components/error/taiga-ui-core-components-error.metadata.json +1 -1
- package/components/expand/taiga-ui-core-components-expand.metadata.json +1 -1
- package/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.metadata.json +1 -1
- package/components/label/taiga-ui-core-components-label.metadata.json +1 -1
- package/components/notification/taiga-ui-core-components-notification.metadata.json +1 -1
- package/components/primitive-checkbox/taiga-ui-core-components-primitive-checkbox.metadata.json +1 -1
- package/components/primitive-spin-button/taiga-ui-core-components-primitive-spin-button.metadata.json +1 -1
- package/components/primitive-textfield/taiga-ui-core-components-primitive-textfield.metadata.json +1 -1
- package/components/root/taiga-ui-core-components-root.metadata.json +1 -1
- package/components/scroll-controls/taiga-ui-core-components-scroll-controls.metadata.json +1 -1
- package/components/scrollbar/taiga-ui-core-components-scrollbar.metadata.json +1 -1
- package/components/svg/taiga-ui-core-components-svg.metadata.json +1 -1
- package/components/tooltip/taiga-ui-core-components-tooltip.metadata.json +1 -1
- package/constants/taiga-ui-core-constants.metadata.json +1 -1
- package/constants/version.d.ts +1 -1
- package/enums/appearance.d.ts +1 -0
- package/enums/taiga-ui-core-enums.metadata.json +1 -1
- package/esm2015/components/alert/alert.component.js +3 -3
- package/esm2015/components/calendar/calendar.component.js +3 -3
- package/esm2015/components/dropdown-box/dropdown-box.component.js +3 -3
- package/esm2015/components/error/error.component.js +3 -3
- package/esm2015/components/expand/expand.component.js +3 -3
- package/esm2015/components/hosted-dropdown/hosted-dropdown.component.js +3 -3
- package/esm2015/components/label/label.component.js +3 -3
- package/esm2015/components/notification/notification.component.js +3 -3
- package/esm2015/components/primitive-checkbox/primitive-checkbox.component.js +3 -3
- package/esm2015/components/primitive-spin-button/primitive-spin-button.component.js +3 -3
- package/esm2015/components/primitive-textfield/primitive-textfield.component.js +3 -3
- package/esm2015/components/primitive-textfield/textfield/textfield.component.js +1 -1
- package/esm2015/components/primitive-textfield/value-decoration/value-decoration.component.js +1 -1
- package/esm2015/components/root/root.component.js +3 -3
- package/esm2015/components/scroll-controls/scroll-controls.component.js +3 -3
- package/esm2015/components/scrollbar/scrollbar.component.js +3 -3
- package/esm2015/components/svg/svg.component.js +3 -3
- package/esm2015/components/tooltip/tooltip.component.js +3 -3
- package/esm2015/constants/version.js +2 -2
- package/esm2015/enums/appearance.js +2 -1
- package/esm5/components/alert/alert.component.js +3 -3
- package/esm5/components/calendar/calendar.component.js +3 -3
- package/esm5/components/dropdown-box/dropdown-box.component.js +3 -3
- package/esm5/components/error/error.component.js +3 -3
- package/esm5/components/expand/expand.component.js +3 -3
- package/esm5/components/hosted-dropdown/hosted-dropdown.component.js +3 -3
- package/esm5/components/label/label.component.js +3 -3
- package/esm5/components/notification/notification.component.js +3 -3
- package/esm5/components/primitive-checkbox/primitive-checkbox.component.js +3 -3
- package/esm5/components/primitive-spin-button/primitive-spin-button.component.js +3 -3
- package/esm5/components/primitive-textfield/primitive-textfield.component.js +3 -3
- package/esm5/components/primitive-textfield/textfield/textfield.component.js +1 -1
- package/esm5/components/primitive-textfield/value-decoration/value-decoration.component.js +1 -1
- package/esm5/components/root/root.component.js +3 -3
- package/esm5/components/scroll-controls/scroll-controls.component.js +3 -3
- package/esm5/components/scrollbar/scrollbar.component.js +3 -3
- package/esm5/components/svg/svg.component.js +3 -3
- package/esm5/components/tooltip/tooltip.component.js +3 -3
- package/esm5/constants/version.js +2 -2
- package/esm5/enums/appearance.js +2 -1
- package/fesm2015/taiga-ui-core-components-alert.js +2 -2
- package/fesm2015/taiga-ui-core-components-alert.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-calendar.js +2 -2
- package/fesm2015/taiga-ui-core-components-calendar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-dropdown-box.js +2 -2
- package/fesm2015/taiga-ui-core-components-dropdown-box.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-error.js +2 -2
- package/fesm2015/taiga-ui-core-components-error.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-expand.js +2 -2
- package/fesm2015/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js +2 -2
- package/fesm2015/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-label.js +2 -2
- package/fesm2015/taiga-ui-core-components-label.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-notification.js +2 -2
- package/fesm2015/taiga-ui-core-components-notification.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js +2 -2
- package/fesm2015/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-spin-button.js +2 -2
- package/fesm2015/taiga-ui-core-components-primitive-spin-button.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js +3 -3
- package/fesm2015/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-root.js +2 -2
- package/fesm2015/taiga-ui-core-components-root.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-scroll-controls.js +2 -2
- package/fesm2015/taiga-ui-core-components-scroll-controls.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-scrollbar.js +2 -2
- package/fesm2015/taiga-ui-core-components-scrollbar.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-svg.js +2 -2
- package/fesm2015/taiga-ui-core-components-svg.js.map +1 -1
- package/fesm2015/taiga-ui-core-components-tooltip.js +2 -2
- package/fesm2015/taiga-ui-core-components-tooltip.js.map +1 -1
- package/fesm2015/taiga-ui-core-constants.js +1 -1
- package/fesm2015/taiga-ui-core-constants.js.map +1 -1
- package/fesm2015/taiga-ui-core-enums.js +1 -0
- package/fesm2015/taiga-ui-core-enums.js.map +1 -1
- package/fesm5/taiga-ui-core-components-alert.js +2 -2
- package/fesm5/taiga-ui-core-components-alert.js.map +1 -1
- package/fesm5/taiga-ui-core-components-calendar.js +2 -2
- package/fesm5/taiga-ui-core-components-calendar.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dropdown-box.js +2 -2
- package/fesm5/taiga-ui-core-components-dropdown-box.js.map +1 -1
- package/fesm5/taiga-ui-core-components-error.js +2 -2
- package/fesm5/taiga-ui-core-components-error.js.map +1 -1
- package/fesm5/taiga-ui-core-components-expand.js +2 -2
- package/fesm5/taiga-ui-core-components-expand.js.map +1 -1
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js +2 -2
- package/fesm5/taiga-ui-core-components-hosted-dropdown.js.map +1 -1
- package/fesm5/taiga-ui-core-components-label.js +2 -2
- package/fesm5/taiga-ui-core-components-label.js.map +1 -1
- package/fesm5/taiga-ui-core-components-notification.js +2 -2
- package/fesm5/taiga-ui-core-components-notification.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-checkbox.js +2 -2
- package/fesm5/taiga-ui-core-components-primitive-checkbox.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-spin-button.js +2 -2
- package/fesm5/taiga-ui-core-components-primitive-spin-button.js.map +1 -1
- package/fesm5/taiga-ui-core-components-primitive-textfield.js +3 -3
- package/fesm5/taiga-ui-core-components-primitive-textfield.js.map +1 -1
- package/fesm5/taiga-ui-core-components-root.js +2 -2
- package/fesm5/taiga-ui-core-components-root.js.map +1 -1
- package/fesm5/taiga-ui-core-components-scroll-controls.js +2 -2
- package/fesm5/taiga-ui-core-components-scroll-controls.js.map +1 -1
- package/fesm5/taiga-ui-core-components-scrollbar.js +2 -2
- package/fesm5/taiga-ui-core-components-scrollbar.js.map +1 -1
- package/fesm5/taiga-ui-core-components-svg.js +2 -2
- package/fesm5/taiga-ui-core-components-svg.js.map +1 -1
- package/fesm5/taiga-ui-core-components-tooltip.js +2 -2
- package/fesm5/taiga-ui-core-components-tooltip.js.map +1 -1
- package/fesm5/taiga-ui-core-constants.js +1 -1
- package/fesm5/taiga-ui-core-constants.js.map +1 -1
- package/fesm5/taiga-ui-core-enums.js +1 -0
- package/fesm5/taiga-ui-core-enums.js.map +1 -1
- package/package.json +4 -4
- package/styles/markup/tui-skeleton.less +1 -1
- package/styles/markup/tui-table.less +33 -0
- package/styles/mixins/mixins.less +1 -2
- package/styles/mixins/textfield.less +2 -2
- package/styles/theme/wrapper/mono.less +22 -0
- package/styles/theme/wrapper/secondary-destructive.less +29 -0
- package/styles/theme/wrapper.less +2 -0
|
@@ -83,10 +83,10 @@ var TuiTooltipComponent = /** @class */ (function () {
|
|
|
83
83
|
TuiTooltipComponent = __decorate([
|
|
84
84
|
Component({
|
|
85
85
|
selector: "tui-tooltip",
|
|
86
|
-
template: "<span\n polymorpheus-outlet\n automation-id=\"tui-tooltip__icon\"\n class=\"icon\"\n [content]=\"icon\"\n [tuiHintId]=\"describeId\"\n [tuiHint]=\"content\"\n [tuiHintDirection]=\"direction\"\n [tuiHintShowDelay]=\"showDelay\"\n [tuiHintHideDelay]=\"hideDelay\"\n [tuiHintMode]=\"computedMode\"\n>\n <ng-template let-icon>\n <tui-svg [src]=\"icon\"></tui-svg>\n </ng-template>\n</span>\n",
|
|
86
|
+
template: "<span\n polymorpheus-outlet\n automation-id=\"tui-tooltip__icon\"\n class=\"t-tooltip-icon\"\n [content]=\"icon\"\n [tuiHintId]=\"describeId\"\n [tuiHint]=\"content\"\n [tuiHintDirection]=\"direction\"\n [tuiHintShowDelay]=\"showDelay\"\n [tuiHintHideDelay]=\"hideDelay\"\n [tuiHintMode]=\"computedMode\"\n>\n <ng-template let-icon>\n <tui-svg [src]=\"icon\"></tui-svg>\n </ng-template>\n</span>\n",
|
|
87
87
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
88
88
|
providers: [TuiDestroyService, MODE_PROVIDER],
|
|
89
|
-
styles: [":host{transition-property:color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:relative;display:inline-block;width:1.5rem;height:1.5rem;vertical-align:middle;font-size:0;line-height:0;cursor:pointer;color:var(--tui-text-03)}:host:hover{color:var(--tui-text-02)}:host[data-mode=onDark]{color:var(--tui-text-01-night)}:host[data-mode=onLight]{color:var(--tui-text-01)}:host[data-mode=error]{color:var(--tui-error-fill)}.icon{transition-property:opacity,color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:inline-block;width:100%;height:100%}:host:not([data-mode]) .icon._hint_hovered{color:var(--tui-text-02)}:host[data-mode=onDark] .icon,:host[data-mode=onLight] .icon{opacity:var(--tui-disabled-opacity)}:host[data-mode=onDark] .icon._hint_hovered,:host[data-mode=onDark] .icon:hover,:host[data-mode=onLight] .icon._hint_hovered,:host[data-mode=onLight] .icon:hover{opacity:1}"]
|
|
89
|
+
styles: [":host{transition-property:color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:relative;display:inline-block;width:1.5rem;height:1.5rem;vertical-align:middle;font-size:0;line-height:0;cursor:pointer;color:var(--tui-text-03)}:host:hover{color:var(--tui-text-02)}:host[data-mode=onDark]{color:var(--tui-text-01-night)}:host[data-mode=onLight]{color:var(--tui-text-01)}:host[data-mode=error]{color:var(--tui-error-fill)}.t-tooltip-icon{transition-property:opacity,color;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;display:inline-block;width:100%;height:100%}:host:not([data-mode]) .t-tooltip-icon._hint_hovered{color:var(--tui-text-02)}:host[data-mode=onDark] .t-tooltip-icon,:host[data-mode=onLight] .t-tooltip-icon{opacity:var(--tui-disabled-opacity)}:host[data-mode=onDark] .t-tooltip-icon._hint_hovered,:host[data-mode=onDark] .t-tooltip-icon:hover,:host[data-mode=onLight] .t-tooltip-icon._hint_hovered,:host[data-mode=onLight] .t-tooltip-icon:hover{opacity:1}"]
|
|
90
90
|
}),
|
|
91
91
|
__param(0, Inject(TuiDestroyService)),
|
|
92
92
|
__param(1, Inject(TUI_MODE)),
|
|
@@ -96,4 +96,4 @@ var TuiTooltipComponent = /** @class */ (function () {
|
|
|
96
96
|
return TuiTooltipComponent;
|
|
97
97
|
}());
|
|
98
98
|
export { TuiTooltipComponent };
|
|
99
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
99
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbHRpcC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AdGFpZ2EtdWkvY29yZS9jb21wb25lbnRzL3Rvb2x0aXAvIiwic291cmNlcyI6WyJ0b29sdGlwLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUNILHVCQUF1QixFQUN2QixTQUFTLEVBQ1QsV0FBVyxFQUNYLFlBQVksRUFDWixNQUFNLEVBQ04sS0FBSyxHQUNSLE1BQU0sZUFBZSxDQUFDO0FBQ3ZCLE9BQU8sRUFBQyxhQUFhLEVBQUUsY0FBYyxFQUFFLGlCQUFpQixFQUFDLE1B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VE9ETzogU2ltcGxpZnlcbiAgICBASG9zdEJpbmRpbmcoYGF0dHIuZGF0YS1tb2RlYClcbiAgICBnZXQgY29tcHV0ZWRNb2RlKCk6IFR1aUhpbnRNb2RlVCB8IG51bGwge1xuICAgICAgICByZXR1cm4gdGhpcy5tb2RlIHx8ICh0aGlzLmdsb2JhbE1vZGUgPT09IGBvbkRhcmtgID8gYG9uRGFya2AgOiBudWxsKTtcbiAgICB9XG5cbiAgICBASG9zdExpc3RlbmVyKGBtb3VzZWRvd25gLCBbYCRldmVudGBdKVxuICAgIEBIb3N0TGlzdGVuZXIoYGNsaWNrYCwgW2AkZXZlbnRgXSlcbiAgICBzdG9wT25Nb2JpbGUoZXZlbnQ6IE1vdXNlRXZlbnQpOiB2b2lkIHtcbiAgICAgICAgaWYgKHRoaXMuaXNNb2JpbGUpIHtcbiAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIGdldCBpY29uKCk6IFBvbHltb3JwaGV1c0NvbnRlbnQge1xuICAgICAgICByZXR1cm4gdGhpcy5vcHRpb25zLnRvb2x0aXBJY29uO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var VERSION = "2.
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export var VERSION = "2.59.0";
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWlnYS11aS9jb3JlL2NvbnN0YW50cy8iLCJzb3VyY2VzIjpbInZlcnNpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLElBQU0sT0FBTyxHQUFHLFFBQVEsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjb25zdCBWRVJTSU9OID0gYDIuNTkuMGA7XG4iXX0=
|
package/esm5/enums/appearance.js
CHANGED
|
@@ -4,6 +4,7 @@ export var TuiAppearance;
|
|
|
4
4
|
TuiAppearance["Primary"] = "primary";
|
|
5
5
|
TuiAppearance["Accent"] = "accent";
|
|
6
6
|
TuiAppearance["Secondary"] = "secondary";
|
|
7
|
+
TuiAppearance["SecondaryDestructive"] = "secondary-destructive";
|
|
7
8
|
TuiAppearance["Table"] = "table";
|
|
8
9
|
TuiAppearance["Textfield"] = "textfield";
|
|
9
10
|
TuiAppearance["Flat"] = "flat";
|
|
@@ -11,4 +12,4 @@ export var TuiAppearance;
|
|
|
11
12
|
TuiAppearance["Whiteblock"] = "whiteblock";
|
|
12
13
|
TuiAppearance["WhiteblockActive"] = "whiteblock-active";
|
|
13
14
|
})(TuiAppearance || (TuiAppearance = {}));
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwZWFyYW5jZS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWlnYS11aS9jb3JlL2VudW1zLyIsInNvdXJjZXMiOlsiYXBwZWFyYW5jZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQU4sSUFBa0IsYUFZakI7QUFaRCxXQUFrQixhQUFhO0lBQzNCLDhCQUFhLENBQUE7SUFDYixvQ0FBbUIsQ0FBQTtJQUNuQixrQ0FBaUIsQ0FBQTtJQUNqQix3Q0FBdUIsQ0FBQTtJQUN2QiwrREFBOEMsQ0FBQTtJQUM5QyxnQ0FBZSxDQUFBO0lBQ2Ysd0NBQXVCLENBQUE7SUFDdkIsOEJBQWEsQ0FBQTtJQUNiLG9DQUFtQixDQUFBO0lBQ25CLDBDQUF5QixDQUFBO0lBQ3pCLHVEQUFzQyxDQUFBO0FBQzFDLENBQUMsRUFaaUIsYUFBYSxLQUFiLGFBQWEsUUFZOUIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgZW51bSBUdWlBcHBlYXJhbmNlIHtcbiAgICBJY29uID0gYGljb25gLFxuICAgIFByaW1hcnkgPSBgcHJpbWFyeWAsXG4gICAgQWNjZW50ID0gYGFjY2VudGAsXG4gICAgU2Vjb25kYXJ5ID0gYHNlY29uZGFyeWAsXG4gICAgU2Vjb25kYXJ5RGVzdHJ1Y3RpdmUgPSBgc2Vjb25kYXJ5LWRlc3RydWN0aXZlYCxcbiAgICBUYWJsZSA9IGB0YWJsZWAsXG4gICAgVGV4dGZpZWxkID0gYHRleHRmaWVsZGAsXG4gICAgRmxhdCA9IGBmbGF0YCxcbiAgICBPdXRsaW5lID0gYG91dGxpbmVgLFxuICAgIFdoaXRlYmxvY2sgPSBgd2hpdGVibG9ja2AsXG4gICAgV2hpdGVibG9ja0FjdGl2ZSA9IGB3aGl0ZWJsb2NrLWFjdGl2ZWAsXG59XG4iXX0=
|
|
@@ -78,12 +78,12 @@ __decorate([
|
|
|
78
78
|
TuiAlertComponent = __decorate([
|
|
79
79
|
Component({
|
|
80
80
|
selector: `tui-alert`,
|
|
81
|
-
template: "<tui-notification\n *ngIf=\"item.hasCloseButton; else noClose\"\n [status]=\"item.status\"\n [hasIcon]=\"item.hasIcon\"\n (close)=\"closeNotification()\"\n>\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"heading\"\n [content]=\"$any(item.label)\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"content\"\n [content]=\"item.content\"\n [context]=\"$any(context)\"\n ></div>\n</tui-notification>\n<ng-template #noClose>\n <tui-notification\n [status]=\"item.status\"\n [hasIcon]=\"item.hasIcon\"\n >\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"heading\"\n [content]=\"$any(item.label)\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"content\"\n [content]=\"item.content\"\n [context]=\"$any(context)\"\n ></div>\n </tui-notification>\n</ng-template>\n",
|
|
81
|
+
template: "<tui-notification\n *ngIf=\"item.hasCloseButton; else noClose\"\n [status]=\"item.status\"\n [hasIcon]=\"item.hasIcon\"\n (close)=\"closeNotification()\"\n>\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"t-heading\"\n [content]=\"$any(item.label)\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"t-content\"\n [content]=\"item.content\"\n [context]=\"$any(context)\"\n ></div>\n</tui-notification>\n<ng-template #noClose>\n <tui-notification\n [status]=\"item.status\"\n [hasIcon]=\"item.hasIcon\"\n >\n <label\n *ngIf=\"item.label\"\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__heading\"\n class=\"t-heading\"\n [content]=\"$any(item.label)\"\n [context]=\"context\"\n ></label>\n <div\n polymorpheus-outlet\n automation-id=\"tui-notification-alert__content\"\n class=\"t-content\"\n [content]=\"item.content\"\n [context]=\"$any(context)\"\n ></div>\n </tui-notification>\n</ng-template>\n",
|
|
82
82
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
83
83
|
providers: [TuiDestroyService],
|
|
84
84
|
animations: [tuiFadeIn, tuiSlideInRight, tuiHeightCollapse],
|
|
85
85
|
host: { role: `alert` },
|
|
86
|
-
styles: [":host{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);display:block;border-radius:var(--tui-radius-m);width:18rem;margin:2rem 3rem 0 auto}:host-context(tui-root._mobile) :host{margin:1rem 1rem 0 auto}:host:not(:first-child){margin-top:.75rem}.heading{font:var(--tui-font-text-m);line-height:1.25rem;font-weight:700;margin:0}.content{color:var(--tui-text-01);word-wrap:break-word}.content:empty{display:none}"]
|
|
86
|
+
styles: [":host{box-shadow:0 .5rem 1rem rgba(0,0,0,.16);display:block;border-radius:var(--tui-radius-m);width:18rem;margin:2rem 3rem 0 auto}:host-context(tui-root._mobile) :host{margin:1rem 1rem 0 auto}:host:not(:first-child){margin-top:.75rem}.t-heading{font:var(--tui-font-text-m);line-height:1.25rem;font-weight:700;margin:0}.t-content{color:var(--tui-text-01);word-wrap:break-word}.t-content:empty{display:none}"]
|
|
87
87
|
}),
|
|
88
88
|
__param(0, Inject(ElementRef)),
|
|
89
89
|
__param(1, Inject(TuiDestroyService)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-alert.js","sources":["ng://@taiga-ui/core/components/alert/alert.component.ts","ng://@taiga-ui/core/components/alert/alert.service.ts","ng://@taiga-ui/core/components/alert/alert.module.ts","ng://@taiga-ui/core/components/alert/taiga-ui-core-components-alert.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n OnInit,\n} from '@angular/core';\nimport {\n isNumber,\n TuiContextWithImplicit,\n TuiDestroyService,\n TuiDialog,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {tuiFadeIn, tuiHeightCollapse, tuiSlideInRight} from '@taiga-ui/core/animations';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {TuiAlertOptions} from '@taiga-ui/core/interfaces';\nimport {\n TUI_ANIMATION_OPTIONS,\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {POLYMORPHEUS_CONTEXT, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {fromEvent, timer} from 'rxjs';\nimport {repeatWhen, takeUntil} from 'rxjs/operators';\n\n// TODO: 3.0 Remove and start using TuiDialog<TuiAlertOptions<I>, O>\nexport interface TuiNotificationContentContext<O = void, I = undefined>\n extends TuiContextWithImplicit<TuiNotification> {\n label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>>;\n data: I;\n closeHook: () => void;\n emitHook: (data: O) => void;\n emitAndCloseHook: (data: O) => void;\n}\n\n// TODO: 3.0 Refactor according to new context by 3.0 and get rid of $any in template\n@Component({\n selector: `tui-alert`,\n templateUrl: `./alert.template.html`,\n styleUrls: [`./alert.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n animations: [tuiFadeIn, tuiSlideInRight, tuiHeightCollapse],\n host: {role: `alert`},\n})\nexport class TuiAlertComponent<O, I> implements OnInit {\n private readonly autoClose =\n typeof this.item.autoClose === `function`\n ? this.item.autoClose(this.item.status)\n : this.item.autoClose;\n\n @HostBinding(`@tuiFadeIn`)\n @HostBinding(`@tuiSlideInRight`)\n @HostBinding(`@tuiHeightCollapse`)\n readonly animation = {value: ``, ...this.animationOptions} as const;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n private readonly options: TuiNotificationDefaultOptions,\n @Inject(TUI_ANIMATION_OPTIONS)\n private readonly animationOptions: AnimationOptions,\n @Inject(POLYMORPHEUS_CONTEXT) readonly item: TuiDialog<TuiAlertOptions<I>, O>,\n ) {}\n\n ngOnInit(): void {\n this.initAutoClose();\n }\n\n get context(): TuiNotificationContentContext<O, I> {\n return this.calculateContext(this.item);\n }\n\n closeNotification(): void {\n this.item.$implicit.complete();\n }\n\n @tuiPure\n private calculateContext({\n $implicit,\n status,\n data,\n label,\n }: TuiDialog<TuiAlertOptions<I>, O>): TuiNotificationContentContext<O, I> {\n return {\n $implicit: status,\n data,\n label,\n closeHook: () => {\n $implicit.complete();\n },\n emitHook: (data: O) => {\n $implicit.next(data);\n },\n emitAndCloseHook: (data: O) => {\n $implicit.next(data);\n $implicit.complete();\n },\n };\n }\n\n private initAutoClose(): void {\n if (!this.autoClose) {\n return;\n }\n\n timer(\n isNumber(this.autoClose) ? this.autoClose : this.options.defaultAutoCloseTime,\n )\n .pipe(\n takeUntil(fromEvent(this.elementRef.nativeElement, `mouseenter`)),\n // eslint-disable-next-line rxjs/no-ignored-notifier\n repeatWhen(() => fromEvent(this.elementRef.nativeElement, `mouseleave`)),\n takeUntil(this.destroy$),\n )\n .subscribe(() => this.closeNotification());\n }\n}\n","import {Inject, Injectable} from '@angular/core';\nimport {AbstractTuiDialogService, TuiIdService} from '@taiga-ui/cdk';\nimport {\n TuiAlertOptions,\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/tokens';\nimport {PolymorpheusComponent, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\nimport {TuiAlertComponent, TuiNotificationContentContext} from './alert.component';\n\n@Injectable({providedIn: `root`})\nexport class TuiAlertService extends AbstractTuiDialogService<TuiAlertOptions<any>> {\n protected readonly component = new PolymorpheusComponent(TuiAlertComponent);\n\n constructor(\n @Inject(TUI_NOTIFICATION_OPTIONS)\n protected readonly defaultOptions: TuiAlertOptions<any>,\n @Inject(TuiIdService) idService: TuiIdService,\n ) {\n super(idService);\n }\n}\n\n/** @deprecated use {@link TuiAlertService} */\n@Injectable({providedIn: `root`})\nexport class TuiNotificationsService {\n constructor(@Inject(TuiAlertService) private readonly alert: TuiAlertService) {}\n\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n ): Observable<O>;\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n options: TuiNotificationOptions,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptionsWithData<I>,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I> = {},\n ): Observable<O> {\n // @ts-ignore\n return this.alert.open(content, options);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TUI_ALERTS} from '@taiga-ui/cdk';\nimport {TuiNotificationModule} from '@taiga-ui/core/components/notification';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiAlertComponent} from './alert.component';\nimport {TuiAlertService} from './alert.service';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],\n declarations: [TuiAlertComponent],\n exports: [TuiAlertComponent],\n entryComponents: [TuiAlertComponent],\n providers: [\n {\n provide: TUI_ALERTS,\n useExisting: TuiAlertService,\n multi: true,\n },\n ],\n})\nexport class TuiAlertModule {}\n\n/** @deprecated use {@link TuiAlertModule} */\n@NgModule({imports: [TuiAlertModule]})\nexport class TuiNotificationsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAsCA;IAUa,iBAAiB,GAA9B,MAAa,iBAAiB;IAW1B,YACyC,UAAmC,EAC5B,QAA2B,EAEtD,OAAsC,EAEtC,gBAAkC,EACZ,IAAsC;QANxC,eAAU,GAAV,UAAU,CAAyB;QAC5B,aAAQ,GAAR,QAAQ,CAAmB;QAEtD,YAAO,GAAP,OAAO,CAA+B;QAEtC,qBAAgB,GAAhB,gBAAgB,CAAkB;QACZ,SAAI,GAAJ,IAAI,CAAkC;QAjBhE,cAAS,GACtB,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,KAAK,UAAU;cACnC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;cACrC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QAKrB,cAAS,GAAG,gBAAC,KAAK,EAAE,EAAE,IAAK,IAAI,CAAC,gBAAgB,CAAU,CAAC;KAUhE;IAEJ,QAAQ;QACJ,IAAI,CAAC,aAAa,EAAE,CAAC;KACxB;I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;QAAtB,UAAK,GAAL,KAAK,CAAiB;KAAI;IAahF,IAAI,CACA,OAAiE,EACjE,UAAsE,EAAE;;QAGxE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KAC5C;EACJ;;YApBgE,eAAe,uBAA/D,MAAM,SAAC,eAAe;;;AAD1B,uBAAuB;IADnC,UAAU,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;IAEhB,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;GAD3B,uBAAuB,CAqBnC;;IC3BY,cAAc,GAA3B,MAAa,cAAc;EAAG;AAAjB,cAAc;IAb1B,QAAQ,CAAC;QACN,OAAO,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,CAAC;QAClE,YAAY,EAAE,CAAC,iBAAiB,CAAC;QACjC,OAAO,EAAE,CAAC,iBAAiB,CAAC;QAC5B,eAAe,EAAE,CAAC,iBAAiB,CAAC;QACpC,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,UAAU;gBACnB,WAAW,EAAE,eAAe;gBAC5B,KAAK,EAAE,IAAI;aACd;SACJ;KACJ,CAAC;GACW,cAAc,CAAG;AAE9B;IAEa,sBAAsB,GAAnC,MAAa,sBAAsB;EAAG;AAAzB,sBAAsB;IADlC,QAAQ,CAAC,EAAC,OAAO,EAAE,CAAC,cAAc,CAAC,EAAC,CAAC;GACzB,sBAAsB,CAAG;;AC1BtC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-alert.js","sources":["ng://@taiga-ui/core/components/alert/alert.component.ts","ng://@taiga-ui/core/components/alert/alert.service.ts","ng://@taiga-ui/core/components/alert/alert.module.ts","ng://@taiga-ui/core/components/alert/taiga-ui-core-components-alert.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n OnInit,\n} from '@angular/core';\nimport {\n isNumber,\n TuiContextWithImplicit,\n TuiDestroyService,\n TuiDialog,\n tuiPure,\n} from '@taiga-ui/cdk';\nimport {tuiFadeIn, tuiHeightCollapse, tuiSlideInRight} from '@taiga-ui/core/animations';\nimport {TuiNotification} from '@taiga-ui/core/enums';\nimport {TuiAlertOptions} from '@taiga-ui/core/interfaces';\nimport {\n TUI_ANIMATION_OPTIONS,\n TUI_NOTIFICATION_OPTIONS,\n TuiNotificationDefaultOptions,\n} from '@taiga-ui/core/tokens';\nimport {POLYMORPHEUS_CONTEXT, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {fromEvent, timer} from 'rxjs';\nimport {repeatWhen, takeUntil} from 'rxjs/operators';\n\n// TODO: 3.0 Remove and start using TuiDialog<TuiAlertOptions<I>, O>\nexport interface TuiNotificationContentContext<O = void, I = undefined>\n extends TuiContextWithImplicit<TuiNotification> {\n label: PolymorpheusContent<TuiContextWithImplicit<TuiNotification>>;\n data: I;\n closeHook: () => void;\n emitHook: (data: O) => void;\n emitAndCloseHook: (data: O) => void;\n}\n\n// TODO: 3.0 Refactor according to new context by 3.0 and get rid of $any in template\n@Component({\n selector: `tui-alert`,\n templateUrl: `./alert.template.html`,\n styleUrls: [`./alert.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [TuiDestroyService],\n animations: [tuiFadeIn, tuiSlideInRight, tuiHeightCollapse],\n host: {role: `alert`},\n})\nexport class TuiAlertComponent<O, I> implements OnInit {\n private readonly autoClose =\n typeof this.item.autoClose === `function`\n ? this.item.autoClose(this.item.status)\n : this.item.autoClose;\n\n @HostBinding(`@tuiFadeIn`)\n @HostBinding(`@tuiSlideInRight`)\n @HostBinding(`@tuiHeightCollapse`)\n readonly animation = {value: ``, ...this.animationOptions} as const;\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(TuiDestroyService) private readonly destroy$: TuiDestroyService,\n @Inject(TUI_NOTIFICATION_OPTIONS)\n private readonly options: TuiNotificationDefaultOptions,\n @Inject(TUI_ANIMATION_OPTIONS)\n private readonly animationOptions: AnimationOptions,\n @Inject(POLYMORPHEUS_CONTEXT) readonly item: TuiDialog<TuiAlertOptions<I>, O>,\n ) {}\n\n ngOnInit(): void {\n this.initAutoClose();\n }\n\n get context(): TuiNotificationContentContext<O, I> {\n return this.calculateContext(this.item);\n }\n\n closeNotification(): void {\n this.item.$implicit.complete();\n }\n\n @tuiPure\n private calculateContext({\n $implicit,\n status,\n data,\n label,\n }: TuiDialog<TuiAlertOptions<I>, O>): TuiNotificationContentContext<O, I> {\n return {\n $implicit: status,\n data,\n label,\n closeHook: () => {\n $implicit.complete();\n },\n emitHook: (data: O) => {\n $implicit.next(data);\n },\n emitAndCloseHook: (data: O) => {\n $implicit.next(data);\n $implicit.complete();\n },\n };\n }\n\n private initAutoClose(): void {\n if (!this.autoClose) {\n return;\n }\n\n timer(\n isNumber(this.autoClose) ? this.autoClose : this.options.defaultAutoCloseTime,\n )\n .pipe(\n takeUntil(fromEvent(this.elementRef.nativeElement, `mouseenter`)),\n // eslint-disable-next-line rxjs/no-ignored-notifier\n repeatWhen(() => fromEvent(this.elementRef.nativeElement, `mouseleave`)),\n takeUntil(this.destroy$),\n )\n .subscribe(() => this.closeNotification());\n }\n}\n","import {Inject, Injectable} from '@angular/core';\nimport {AbstractTuiDialogService, TuiIdService} from '@taiga-ui/cdk';\nimport {\n TuiAlertOptions,\n TuiNotificationOptions,\n TuiNotificationOptionsWithData,\n} from '@taiga-ui/core/interfaces';\nimport {TUI_NOTIFICATION_OPTIONS} from '@taiga-ui/core/tokens';\nimport {PolymorpheusComponent, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\nimport {TuiAlertComponent, TuiNotificationContentContext} from './alert.component';\n\n@Injectable({providedIn: `root`})\nexport class TuiAlertService extends AbstractTuiDialogService<TuiAlertOptions<any>> {\n protected readonly component = new PolymorpheusComponent(TuiAlertComponent);\n\n constructor(\n @Inject(TUI_NOTIFICATION_OPTIONS)\n protected readonly defaultOptions: TuiAlertOptions<any>,\n @Inject(TuiIdService) idService: TuiIdService,\n ) {\n super(idService);\n }\n}\n\n/** @deprecated use {@link TuiAlertService} */\n@Injectable({providedIn: `root`})\nexport class TuiNotificationsService {\n constructor(@Inject(TuiAlertService) private readonly alert: TuiAlertService) {}\n\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n ): Observable<O>;\n show<O = void>(\n content: PolymorpheusContent<TuiNotificationContentContext<O>>,\n options: TuiNotificationOptions,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptionsWithData<I>,\n ): Observable<O>;\n show<O, I>(\n content: PolymorpheusContent<TuiNotificationContentContext<O, I>>,\n options: TuiNotificationOptions | TuiNotificationOptionsWithData<I> = {},\n ): Observable<O> {\n // @ts-ignore\n return this.alert.open(content, options);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TUI_ALERTS} from '@taiga-ui/cdk';\nimport {TuiNotificationModule} from '@taiga-ui/core/components/notification';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiAlertComponent} from './alert.component';\nimport {TuiAlertService} from './alert.service';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule, TuiNotificationModule],\n declarations: [TuiAlertComponent],\n exports: [TuiAlertComponent],\n entryComponents: [TuiAlertComponent],\n providers: [\n {\n provide: TUI_ALERTS,\n useExisting: TuiAlertService,\n multi: true,\n },\n ],\n})\nexport class TuiAlertModule {}\n\n/** @deprecated use {@link TuiAlertModule} */\n@NgModule({imports: [TuiAlertModule]})\nexport class TuiNotificationsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAsCA;IAUa,iBAAiB,GAA9B,MAAa,iBAAiB;IAW1B,YACyC,UAAmC,EAC5B,QAA2B,EAEtD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5B,KAAK,EAAE,IAAI;aACd;SACJ;KACJ,CAAC;GACW,cAAc,CAAG;AAE9B;IAEa,sBAAsB,GAAnC,MAAa,sBAAsB;EAAG;AAAzB,sBAAsB;IADlC,QAAQ,CAAC,EAAC,OAAO,EAAE,CAAC,cAAc,CAAC,EAAC,CAAC;GACzB,sBAAsB,CAAG;;AC1BtC;;;;;;"}
|
|
@@ -120,9 +120,9 @@ __decorate([
|
|
|
120
120
|
TuiCalendarComponent = __decorate([
|
|
121
121
|
Component({
|
|
122
122
|
selector: `tui-calendar`,
|
|
123
|
-
template: "<tui-scrollbar\n *ngIf=\"year; else calendar\"\n automation-id=\"tui-calendar__scrollbar\"\n class=\"scrollbar\"\n>\n <tui-primitive-year-picker\n automation-id=\"tui-calendar__year\"\n [min]=\"min\"\n [max]=\"max\"\n [initialItem]=\"year\"\n [value]=\"value\"\n (yearClick)=\"onPickerYearClick($event)\"\n ></tui-primitive-year-picker>\n</tui-scrollbar>\n<ng-template #calendar>\n <tui-primitive-year-month-pagination\n automation-id=\"tui-calendar__pagination\"\n class=\"pagination\"\n [min]=\"computedMinViewedMonth\"\n [max]=\"computedMaxViewedMonth\"\n [value]=\"month\"\n (valueChange)=\"onPaginationValueChange($event)\"\n (yearClick)=\"onPaginationYearClick($event)\"\n ></tui-primitive-year-month-pagination>\n <tui-primitive-calendar\n automation-id=\"tui-calendar__calendar\"\n [showAdjacent]=\"showAdjacent\"\n [value]=\"value\"\n [month]=\"month\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper:min:max\"\n [markerHandler]=\"markerHandler\"\n [hoveredItem]=\"hoveredItem\"\n (hoveredItemChange)=\"onHoveredItemChange($event)\"\n (dayClick)=\"onDayClick($event)\"\n ></tui-primitive-calendar>\n</ng-template>\n",
|
|
123
|
+
template: "<tui-scrollbar\n *ngIf=\"year; else calendar\"\n automation-id=\"tui-calendar__scrollbar\"\n class=\"t-scrollbar\"\n>\n <tui-primitive-year-picker\n automation-id=\"tui-calendar__year\"\n [min]=\"min\"\n [max]=\"max\"\n [initialItem]=\"year\"\n [value]=\"value\"\n (yearClick)=\"onPickerYearClick($event)\"\n ></tui-primitive-year-picker>\n</tui-scrollbar>\n<ng-template #calendar>\n <tui-primitive-year-month-pagination\n automation-id=\"tui-calendar__pagination\"\n class=\"t-pagination\"\n [min]=\"computedMinViewedMonth\"\n [max]=\"computedMaxViewedMonth\"\n [value]=\"month\"\n (valueChange)=\"onPaginationValueChange($event)\"\n (yearClick)=\"onPaginationYearClick($event)\"\n ></tui-primitive-year-month-pagination>\n <tui-primitive-calendar\n automation-id=\"tui-calendar__calendar\"\n [showAdjacent]=\"showAdjacent\"\n [value]=\"value\"\n [month]=\"month\"\n [disabledItemHandler]=\"disabledItemHandler | tuiMapper: disabledItemHandlerMapper:min:max\"\n [markerHandler]=\"markerHandler\"\n [hoveredItem]=\"hoveredItem\"\n (hoveredItemChange)=\"onHoveredItemChange($event)\"\n (dayClick)=\"onDayClick($event)\"\n ></tui-primitive-calendar>\n</ng-template>\n",
|
|
124
124
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
125
|
-
styles: [":host{display:block;height:18.25rem;width:15.75rem;padding:1rem 1.125rem;box-sizing:content-box}.scrollbar{height:18.25rem;width:16.875rem}.pagination{margin-bottom:1rem}"]
|
|
125
|
+
styles: [":host{display:block;height:18.25rem;width:15.75rem;padding:1rem 1.125rem;box-sizing:content-box}.t-scrollbar{height:18.25rem;width:16.875rem}.t-pagination{margin-bottom:1rem}"]
|
|
126
126
|
})
|
|
127
127
|
], TuiCalendarComponent);
|
|
128
128
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-calendar.js","sources":["ng://@taiga-ui/core/components/calendar/calendar.component.ts","ng://@taiga-ui/core/components/calendar/calendar.module.ts","ng://@taiga-ui/core/components/calendar/taiga-ui-core-components-calendar.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\nimport {\n ALWAYS_FALSE_HANDLER,\n nullableSame,\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiBooleanHandler,\n TuiDay,\n TuiDayRange,\n tuiDefaultProp,\n TuiMapper,\n TuiMonth,\n TuiYear,\n} from '@taiga-ui/cdk';\nimport {TUI_DEFAULT_MARKER_HANDLER} from '@taiga-ui/core/constants';\nimport {TuiWithOptionalMinMax} from '@taiga-ui/core/interfaces';\nimport {TuiMarkerHandler} from '@taiga-ui/core/types';\n\n// @dynamic\n@Component({\n selector: `tui-calendar`,\n templateUrl: `./calendar.template.html`,\n styleUrls: [`./calendar.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiCalendarComponent implements TuiWithOptionalMinMax<TuiDay> {\n @Input()\n @tuiDefaultProp()\n month: TuiMonth = TuiMonth.currentLocal();\n\n @Input()\n @tuiDefaultProp()\n value: TuiDayRange | TuiDay | null = null;\n\n @Input()\n @tuiDefaultProp()\n disabledItemHandler: TuiBooleanHandler<TuiDay> = ALWAYS_FALSE_HANDLER;\n\n @Input()\n @tuiDefaultProp()\n min = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n max = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n minViewedMonth: TuiMonth = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n maxViewedMonth: TuiMonth = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n hoveredItem: TuiDay | null = null;\n\n @Input()\n @tuiDefaultProp()\n showAdjacent = true;\n\n @Input()\n @tuiDefaultProp()\n markerHandler: TuiMarkerHandler = TUI_DEFAULT_MARKER_HANDLER;\n\n @Output()\n readonly dayClick = new EventEmitter<TuiDay>();\n\n @Output()\n readonly monthChange = new EventEmitter<TuiMonth>();\n\n @Output()\n readonly hoveredItemChange = new EventEmitter<TuiDay | null>();\n\n year: TuiYear | null = null;\n\n readonly disabledItemHandlerMapper: TuiMapper<\n TuiBooleanHandler<TuiDay>,\n TuiBooleanHandler<TuiDay>\n > = (disabledItemHandler, min: TuiDay, max: TuiDay) => item =>\n item.dayBefore(min) || item.dayAfter(max) || disabledItemHandler(item);\n\n get computedMinViewedMonth(): TuiMonth {\n return this.minViewedMonth.monthSameOrAfter(this.min)\n ? this.minViewedMonth\n : this.min;\n }\n\n get computedMaxViewedMonth(): TuiMonth {\n return this.maxViewedMonth.monthSameOrBefore(this.max)\n ? this.maxViewedMonth\n : this.max;\n }\n\n onPaginationYearClick(year: TuiYear): void {\n this.year = year;\n }\n\n onPickerYearClick({year}: TuiYear): void {\n this.year = null;\n this.updateViewedMonth(new TuiMonth(year, this.month.month));\n }\n\n onPaginationValueChange(month: TuiMonth): void {\n this.updateViewedMonth(month);\n }\n\n onDayClick(day: TuiDay): void {\n this.dayClick.emit(day);\n }\n\n onHoveredItemChange(day: TuiDay | null): void {\n this.updateHoveredDay(day);\n }\n\n private updateViewedMonth(month: TuiMonth): void {\n if (this.month.monthSame(month)) {\n return;\n }\n\n this.month = month;\n this.monthChange.emit(month);\n }\n\n private updateHoveredDay(day: TuiDay | null): void {\n if (nullableSame(this.hoveredItem, day, (a, b) => a.daySame(b))) {\n return;\n }\n\n this.hoveredItem = day;\n this.hoveredItemChange.emit(day);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiMapperPipeModule} from '@taiga-ui/cdk';\nimport {TuiPrimitiveCalendarModule} from '@taiga-ui/core/components/primitive-calendar';\nimport {TuiPrimitiveYearPickerModule} from '@taiga-ui/core/components/primitive-year-picker';\nimport {TuiScrollbarModule} from '@taiga-ui/core/components/scrollbar';\nimport {TuiPrimitiveYearMonthPaginationModule} from '@taiga-ui/core/internal/primitive-year-month-pagination';\n\nimport {TuiCalendarComponent} from './calendar.component';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiPrimitiveYearMonthPaginationModule,\n TuiPrimitiveCalendarModule,\n TuiPrimitiveYearPickerModule,\n TuiScrollbarModule,\n TuiMapperPipeModule,\n ],\n declarations: [TuiCalendarComponent],\n exports: [TuiCalendarComponent],\n})\nexport class TuiCalendarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAwBA;IAOa,oBAAoB,GAAjC,MAAa,oBAAoB;IAAjC;QAGI,UAAK,GAAa,QAAQ,CAAC,YAAY,EAAE,CAAC;QAI1C,UAAK,GAAgC,IAAI,CAAC;QAI1C,wBAAmB,GAA8B,oBAAoB,CAAC;QAItE,QAAG,GAAG,aAAa,CAAC;QAIpB,QAAG,GAAG,YAAY,CAAC;QAInB,mBAAc,GAAa,aAAa,CAAC;QAIzC,mBAAc,GAAa,YAAY,CAAC;QAIxC,gBAAW,GAAkB,IAAI,CAAC;QAIlC,iBAAY,GAAG,IAAI,CAAC;QAIpB,kBAAa,GAAqB,0BAA0B,CAAC;QAGpD,aAAQ,GAAG,IAAI,YAAY,EAAU,CAAC;QAGtC,gBAAW,GAAG,IAAI,YAAY,EAAY,CAAC;QAG3C,sBAAiB,GAAG,IAAI,YAAY,EAAiB,CAAC;QAE/D,SAAI,GAAmB,IAAI,CAAC;QAEnB,8BAAyB,GAG9B,CAAC,mBAAmB,EAAE,GAAW,EAAE,GAAW,KAAK,IAAI,IACvD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC;KAoD9E;IAlDG,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC;cAC/C,IAAI,CAAC,cAAc;cACnB,IAAI,CAAC,GAAG,CAAC;KAClB;IAED,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC;cAChD,IAAI,CAAC,cAAc;cACnB,IAAI,CAA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K,EAAE;IACP,cAAc,EAAE;iDACG;AAIpB;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;iDACE;AAInB;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;4DACwB;AAIzC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;4DACuB;AAIxC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;yDACiB;AAIlC;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;0DACG;AAIpB;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;2DAC4C;AAG7D;IADC,MAAM,EAAE;sDACsC;AAG/C;IADC,MAAM,EAAE;yDAC2C;AAGpD;IADC,MAAM,EAAE;+DACsD;AAhDtD,oBAAoB;IANhC,SAAS,CAAC;QACP,QAAQ,EAAE,cAAc;QACxB,
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-calendar.js","sources":["ng://@taiga-ui/core/components/calendar/calendar.component.ts","ng://@taiga-ui/core/components/calendar/calendar.module.ts","ng://@taiga-ui/core/components/calendar/taiga-ui-core-components-calendar.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\nimport {\n ALWAYS_FALSE_HANDLER,\n nullableSame,\n TUI_FIRST_DAY,\n TUI_LAST_DAY,\n TuiBooleanHandler,\n TuiDay,\n TuiDayRange,\n tuiDefaultProp,\n TuiMapper,\n TuiMonth,\n TuiYear,\n} from '@taiga-ui/cdk';\nimport {TUI_DEFAULT_MARKER_HANDLER} from '@taiga-ui/core/constants';\nimport {TuiWithOptionalMinMax} from '@taiga-ui/core/interfaces';\nimport {TuiMarkerHandler} from '@taiga-ui/core/types';\n\n// @dynamic\n@Component({\n selector: `tui-calendar`,\n templateUrl: `./calendar.template.html`,\n styleUrls: [`./calendar.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiCalendarComponent implements TuiWithOptionalMinMax<TuiDay> {\n @Input()\n @tuiDefaultProp()\n month: TuiMonth = TuiMonth.currentLocal();\n\n @Input()\n @tuiDefaultProp()\n value: TuiDayRange | TuiDay | null = null;\n\n @Input()\n @tuiDefaultProp()\n disabledItemHandler: TuiBooleanHandler<TuiDay> = ALWAYS_FALSE_HANDLER;\n\n @Input()\n @tuiDefaultProp()\n min = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n max = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n minViewedMonth: TuiMonth = TUI_FIRST_DAY;\n\n @Input()\n @tuiDefaultProp()\n maxViewedMonth: TuiMonth = TUI_LAST_DAY;\n\n @Input()\n @tuiDefaultProp()\n hoveredItem: TuiDay | null = null;\n\n @Input()\n @tuiDefaultProp()\n showAdjacent = true;\n\n @Input()\n @tuiDefaultProp()\n markerHandler: TuiMarkerHandler = TUI_DEFAULT_MARKER_HANDLER;\n\n @Output()\n readonly dayClick = new EventEmitter<TuiDay>();\n\n @Output()\n readonly monthChange = new EventEmitter<TuiMonth>();\n\n @Output()\n readonly hoveredItemChange = new EventEmitter<TuiDay | null>();\n\n year: TuiYear | null = null;\n\n readonly disabledItemHandlerMapper: TuiMapper<\n TuiBooleanHandler<TuiDay>,\n TuiBooleanHandler<TuiDay>\n > = (disabledItemHandler, min: TuiDay, max: TuiDay) => item =>\n item.dayBefore(min) || item.dayAfter(max) || disabledItemHandler(item);\n\n get computedMinViewedMonth(): TuiMonth {\n return this.minViewedMonth.monthSameOrAfter(this.min)\n ? this.minViewedMonth\n : this.min;\n }\n\n get computedMaxViewedMonth(): TuiMonth {\n return this.maxViewedMonth.monthSameOrBefore(this.max)\n ? this.maxViewedMonth\n : this.max;\n }\n\n onPaginationYearClick(year: TuiYear): void {\n this.year = year;\n }\n\n onPickerYearClick({year}: TuiYear): void {\n this.year = null;\n this.updateViewedMonth(new TuiMonth(year, this.month.month));\n }\n\n onPaginationValueChange(month: TuiMonth): void {\n this.updateViewedMonth(month);\n }\n\n onDayClick(day: TuiDay): void {\n this.dayClick.emit(day);\n }\n\n onHoveredItemChange(day: TuiDay | null): void {\n this.updateHoveredDay(day);\n }\n\n private updateViewedMonth(month: TuiMonth): void {\n if (this.month.monthSame(month)) {\n return;\n }\n\n this.month = month;\n this.monthChange.emit(month);\n }\n\n private updateHoveredDay(day: TuiDay | null): void {\n if (nullableSame(this.hoveredItem, day, (a, b) => a.daySame(b))) {\n return;\n }\n\n this.hoveredItem = day;\n this.hoveredItemChange.emit(day);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiMapperPipeModule} from '@taiga-ui/cdk';\nimport {TuiPrimitiveCalendarModule} from '@taiga-ui/core/components/primitive-calendar';\nimport {TuiPrimitiveYearPickerModule} from '@taiga-ui/core/components/primitive-year-picker';\nimport {TuiScrollbarModule} from '@taiga-ui/core/components/scrollbar';\nimport {TuiPrimitiveYearMonthPaginationModule} from '@taiga-ui/core/internal/primitive-year-month-pagination';\n\nimport {TuiCalendarComponent} from './calendar.component';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiPrimitiveYearMonthPaginationModule,\n TuiPrimitiveCalendarModule,\n TuiPrimitiveYearPickerModule,\n TuiScrollbarModule,\n TuiMapperPipeModule,\n ],\n declarations: [TuiCalendarComponent],\n exports: [TuiCalendarComponent],\n})\nexport class TuiCalendarModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAwBA;IAOa,oBAAoB,GAAjC,MAAa,oBAAoB;IAAjC;QAGI,UAAK,GAAa,QAAQ,CAAC,YAAY,EAAE,CAAC;QAI1C,UAAK,GAAgC,IAAI,CAAC;QAI1C,wBAAmB,GAA8B,oBAAoB,CAAC;QAItE,QAAG,GAAG,aAAa,CAAC;QAIpB,QAAG,GAAG,YAAY,CAAC;QAInB,mBAAc,GAAa,aAAa,CAAC;QAIzC,mBAAc,GAAa,YAAY,CAAC;QAIxC,gBAAW,GAAkB,IAAI,CAAC;QAIlC,iBAAY,GAAG,IAAI,CAAC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AM;;KAClD,CAAC;GACW,oBAAoB,CA4GhC;;ICrHY,iBAAiB,GAA9B,MAAa,iBAAiB;EAAG;AAApB,iBAAiB;IAZ7B,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,qCAAqC;YACrC,0BAA0B;YAC1B,4BAA4B;YAC5B,kBAAkB;YAClB,mBAAmB;SACtB;QACD,YAAY,EAAE,CAAC,oBAAoB,CAAC;QACpC,OAAO,EAAE,CAAC,oBAAoB,CAAC;KAClC,CAAC;GACW,iBAAiB,CAAG;;ACtBjC;;;;;;"}
|
|
@@ -284,11 +284,11 @@ __decorate([
|
|
|
284
284
|
TuiDropdownBoxComponent = __decorate([
|
|
285
285
|
Component({
|
|
286
286
|
selector: `tui-dropdown-box`,
|
|
287
|
-
template: "<div\n #activeZone=\"tuiActiveZone\"\n class=\"wrapper\"\n [tuiOverscroll]=\"overscroll\"\n [tuiMode]=\"null\"\n [tuiActiveZoneParent]=\"directive.activeZone || null\"\n>\n <tui-scrollbar class=\"scroll\">\n <div\n tabindex=\"0\"\n (focus)=\"onTopFocus()\"\n ></div>\n <div\n #content\n polymorpheus-outlet\n class=\"content\"\n [content]=\"directive.content\"\n [context]=\"getContext(directive.context, activeZone)\"\n ></div>\n <div\n tabindex=\"0\"\n (focus)=\"onBottomFocus()\"\n ></div>\n </tui-scrollbar>\n</div>\n",
|
|
287
|
+
template: "<div\n #activeZone=\"tuiActiveZone\"\n class=\"t-wrapper\"\n [tuiOverscroll]=\"overscroll\"\n [tuiMode]=\"null\"\n [tuiActiveZoneParent]=\"directive.activeZone || null\"\n>\n <tui-scrollbar class=\"t-scroll\">\n <div\n tabindex=\"0\"\n (focus)=\"onTopFocus()\"\n ></div>\n <div\n #content\n polymorpheus-outlet\n class=\"t-content\"\n [content]=\"directive.content\"\n [context]=\"getContext(directive.context, activeZone)\"\n ></div>\n <div\n tabindex=\"0\"\n (focus)=\"onBottomFocus()\"\n ></div>\n </tui-scrollbar>\n</div>\n",
|
|
288
288
|
changeDetection: ChangeDetectionStrategy.Default,
|
|
289
289
|
providers: [TuiDestroyService],
|
|
290
290
|
animations: [tuiDropdownAnimation],
|
|
291
|
-
styles: [":host{z-index:0;box-shadow:0 .5rem 1rem rgba(0,0,0,.16);position:absolute;top:0;left:0;display:flex;background-color:#fff;background-color:var(--tui-elevation-01);border-radius:var(--tui-radius-m);overflow:hidden;border:1px solid var(--tui-base-03);box-sizing:border-box}:host.ng-animating{pointer-events:none}.content{display:flex;flex-direction:column;max-height:100%}.wrapper{flex-grow:1;max-width:100%;max-height:inherit;overflow:visible}.scroll{height:100%}"]
|
|
291
|
+
styles: [":host{z-index:0;box-shadow:0 .5rem 1rem rgba(0,0,0,.16);position:absolute;top:0;left:0;display:flex;background-color:#fff;background-color:var(--tui-elevation-01);border-radius:var(--tui-radius-m);overflow:hidden;border:1px solid var(--tui-base-03);box-sizing:border-box}:host.ng-animating{pointer-events:none}.t-content{display:flex;flex-direction:column;max-height:100%}.t-wrapper{flex-grow:1;max-width:100%;max-height:inherit;overflow:visible}.t-scroll{height:100%}"]
|
|
292
292
|
}),
|
|
293
293
|
__param(0, Inject(TuiDestroyService)),
|
|
294
294
|
__param(1, Inject(NgZone)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-dropdown-box.js","sources":["ng://@taiga-ui/core/components/dropdown-box/dropdown-box.component.ts","ng://@taiga-ui/core/components/dropdown-box/dropdown-box.module.ts","ng://@taiga-ui/core/components/dropdown-box/taiga-ui-core-components-dropdown-box.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n NgZone,\n ViewChild,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {\n AbstractTuiPortalHostComponent,\n getClosestFocusable,\n inRange,\n POLLING_TIME,\n px,\n TuiActiveZoneDirective,\n tuiAssertIsHTMLElement,\n TuiDestroyService,\n TuiDropdownHostComponent,\n TuiOverscrollModeT,\n tuiPure,\n tuiZonefree,\n} from '@taiga-ui/cdk';\nimport {tuiDropdownAnimation} from '@taiga-ui/core/animations';\nimport {DEFAULT_MARGIN, DEFAULT_MAX_WIDTH} from '@taiga-ui/core/constants';\nimport {TuiDropdownAnimation} from '@taiga-ui/core/enums';\nimport {TuiAnimationOptions, TuiDropdown} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS, TUI_DROPDOWN_DIRECTIVE} from '@taiga-ui/core/tokens';\nimport {TuiHorizontalDirection, TuiVerticalDirection} from '@taiga-ui/core/types';\nimport {getScreenWidth, tuiGetViewportWidth} from '@taiga-ui/core/utils/dom';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {takeUntil, throttleTime} from 'rxjs/operators';\n\n/**\n * This component is used to show template in a portal using default style of white rounded box with a shadow\n */\n// @bad TODO: OnPush\n// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395\n// @dynamic\n@Component({\n selector: `tui-dropdown-box`,\n templateUrl: `./dropdown-box.template.html`,\n styleUrls: [`./dropdown-box.style.less`],\n changeDetection: ChangeDetectionStrategy.Default,\n providers: [TuiDestroyService],\n animations: [tuiDropdownAnimation],\n})\nexport class TuiDropdownBoxComponent implements AfterViewChecked {\n private readonly animationTop = {\n value: TuiDropdownAnimation.FadeInTop,\n ...this.options,\n };\n\n private readonly animationBottom = {\n value: TuiDropdownAnimation.FadeInBottom,\n ...this.options,\n };\n\n /**\n * Is previous position on top (to prevent jumping up and down on scroll)\n */\n private prevDirectionIsTop = false;\n\n @HostBinding(`@tuiDropdownAnimation`)\n dropdownAnimation!: TuiAnimationOptions;\n\n @ViewChild(`content`, {read: ElementRef})\n readonly contentElementRef?: ElementRef<HTMLElement>;\n\n constructor(\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TUI_DROPDOWN_DIRECTIVE) readonly directive: TuiDropdown,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(AbstractTuiPortalHostComponent)\n private readonly portalHost: TuiDropdownHostComponent,\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n merge(\n animationFrame$.pipe(throttleTime(POLLING_TIME)),\n this.directive.refresh$,\n fromEvent(this.windowRef, `resize`),\n )\n .pipe(tuiZonefree(ngZone), takeUntil(destroy$))\n .subscribe(() => {\n this.calculatePositionAndSize();\n });\n }\n\n get overscroll(): TuiOverscrollModeT {\n return this.inModal ? `all` : `scroll`;\n }\n\n @tuiPure\n getContext<T extends object>(\n context?: T,\n activeZone?: TuiActiveZoneDirective,\n ):\n | (T & {activeZone?: TuiActiveZoneDirective})\n | {activeZone?: TuiActiveZoneDirective} {\n return {...context, activeZone};\n }\n\n ngAfterViewChecked(): void {\n this.calculatePositionAndSize();\n }\n\n onTopFocus(): void {\n this.moveFocusOutside(true);\n }\n\n onBottomFocus(): void {\n this.moveFocusOutside(false);\n }\n\n @tuiPure\n private get inModal(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!this.directive.host.closest(`tui-dialog-host`);\n }\n\n @tuiPure\n private get inOption(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!this.directive.host.closest(`[tuiOption]`);\n }\n\n private calculatePositionAndSize(): void {\n const {clientRect} = this.directive;\n const {style} = this.elementRef.nativeElement;\n const hostRect = this.directive.fixed\n ? this.portalHost.fixedPositionOffset()\n : this.portalHost.clientRect;\n\n style.position = this.directive.fixed ? `fixed` : `absolute`;\n\n this.calculateVerticalPosition(style, clientRect, hostRect);\n this.calculateHorizontalPosition(style, clientRect, hostRect);\n this.calculateWidth(style, clientRect);\n }\n\n private getFinalAlign(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n ): TuiHorizontalDirection {\n const dropdownRect = this.elementRef.nativeElement.getBoundingClientRect();\n const dropdownWidth = this.elementRef.nativeElement.offsetWidth;\n const screenWidth = getScreenWidth(this.windowRef.document);\n const isDropdownSizeHypotheticallyFitsViewport =\n directiveRect.left + dropdownWidth < screenWidth ||\n directiveRect.right - dropdownWidth > 0;\n const isDropdownSizeActuallyFitsViewport =\n dropdownRect.right <= screenWidth && dropdownRect.left >= 0;\n let finalAlign: TuiHorizontalDirection = this.directive.align;\n\n switch (this.directive.align) {\n case `left`:\n if (\n isDropdownSizeHypotheticallyFitsViewport &&\n dropdownRect.right > screenWidth\n ) {\n finalAlign = `right`;\n }\n\n break;\n case `right`:\n if (isDropdownSizeHypotheticallyFitsViewport && dropdownRect.left < 0) {\n finalAlign = `left`;\n }\n\n break;\n }\n\n if (style.right === `auto` && isDropdownSizeActuallyFitsViewport) {\n finalAlign = `left`;\n }\n\n if (style.left === `auto` && isDropdownSizeActuallyFitsViewport) {\n finalAlign = `right`;\n }\n\n return finalAlign;\n }\n\n /**\n * Calculates horizontal position\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateHorizontalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const offset = this.directive.sided\n ? this.elementRef.nativeElement.getBoundingClientRect().width + DEFAULT_MARGIN\n : 0;\n const left = Math.ceil(directiveRect.left - hostRect.left - offset);\n const right = Math.floor(hostRect.right - directiveRect.right - offset);\n const viewportWidth = tuiGetViewportWidth(this.windowRef);\n\n switch (this.getFinalAlign(style, directiveRect)) {\n case `left`:\n if (\n right + DEFAULT_MARGIN > viewportWidth ||\n inRange(left + DEFAULT_MARGIN, 0, viewportWidth)\n ) {\n style.left = px(left);\n style.right = `auto`;\n } else {\n style.left = `auto`;\n style.right = px(right);\n }\n\n break;\n case `right`:\n if (\n inRange(right + DEFAULT_MARGIN, 0, viewportWidth) ||\n left + DEFAULT_MARGIN > viewportWidth\n ) {\n style.left = `auto`;\n style.right = px(right);\n } else {\n style.left = px(left);\n style.right = `auto`;\n }\n\n break;\n }\n }\n\n /**\n * Calculates vertical position and height\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateVerticalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const windowHeight = this.windowRef.innerHeight;\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n const finalDirection = this.getFinalDirection(directiveRect);\n const optionOffset = this.inOption ? DEFAULT_MARGIN * 2 : 0;\n\n this.prevDirectionIsTop = finalDirection === `top`;\n\n if (finalDirection === `top`) {\n this.dropdownAnimation = this.animationBottom;\n\n style.maxHeight = px(Math.min(boxHeightLimit, topAvailableHeight));\n style.top = `auto`;\n style.bottom = px(\n hostRect.bottom -\n directiveRect.top -\n DEFAULT_MARGIN +\n offset -\n optionOffset,\n );\n } else {\n this.dropdownAnimation = this.animationTop;\n\n style.maxHeight = px(Math.min(boxHeightLimit, bottomAvailableHeight));\n style.top = px(\n directiveRect.bottom -\n hostRect.top -\n DEFAULT_MARGIN +\n offset -\n optionOffset,\n );\n style.bottom = `auto`;\n }\n }\n\n private getFinalDirection(directiveRect: ClientRect): TuiVerticalDirection | null {\n const windowHeight = this.windowRef.innerHeight;\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n\n // Maximum space available on top and on the bottom in the viewport\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n\n let finalDirection: TuiVerticalDirection | null = null;\n\n // Given direction is applied if we can fit the box in the limits that way\n switch (this.directive.direction) {\n case `top`:\n if (topAvailableHeight >= this.directive.minHeight) {\n finalDirection = `top`;\n }\n\n break;\n case `bottom`:\n if (bottomAvailableHeight >= this.directive.minHeight) {\n finalDirection = `bottom`;\n }\n\n break;\n }\n\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n\n // Choose direction if given direction did not fit\n if (finalDirection === null && this.contentElementRef) {\n // Box height if it fits without scroll\n const visualHeight = Math.min(\n this.contentElementRef.nativeElement.getBoundingClientRect().height +\n (this.elementRef.nativeElement.offsetHeight -\n this.elementRef.nativeElement.clientHeight),\n boxHeightLimit,\n );\n\n // If there is enough space to fit below without scroll,\n // choose 'bottom', unless it was previously on the top\n if (this.prevDirectionIsTop && topAvailableHeight >= visualHeight) {\n finalDirection = `top`;\n } else if (bottomAvailableHeight >= visualHeight) {\n finalDirection = `bottom`;\n } else {\n // Corner case — select direction with more space\n finalDirection =\n bottomAvailableHeight >= topAvailableHeight ? `bottom` : `top`;\n }\n }\n\n return finalDirection;\n }\n\n /**\n * Calculates width\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n */\n private calculateWidth(style: CSSStyleDeclaration, directiveRect: ClientRect): void {\n style.width =\n this.directive.limitMinWidth === `fixed` && !this.directive.sided\n ? px(directiveRect.width)\n : ``;\n\n if (this.directive.limitMinWidth === `min` && !this.directive.sided) {\n style.minWidth = px(directiveRect.width);\n style.maxWidth = px(DEFAULT_MAX_WIDTH);\n\n return;\n }\n\n style.minWidth = ``;\n style.maxWidth = ``;\n }\n\n private moveFocusOutside(previous: boolean): void {\n const {host} = this.directive;\n const {ownerDocument} = host;\n const root = ownerDocument ? ownerDocument.body : host;\n\n tuiAssertIsHTMLElement(host);\n\n let focusable = getClosestFocusable(host, previous, root);\n\n while (focusable !== null && host.contains(focusable)) {\n focusable = getClosestFocusable(focusable, previous, root);\n }\n\n focusable?.focus();\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiOverscrollModule} from '@taiga-ui/cdk';\nimport {TuiScrollbarModule} from '@taiga-ui/core/components/scrollbar';\nimport {TuiModeModule} from '@taiga-ui/core/directives/mode';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDropdownBoxComponent} from './dropdown-box.component';\n\n@NgModule({\n imports: [\n TuiActiveZoneModule,\n PolymorpheusModule,\n TuiOverscrollModule,\n TuiScrollbarModule,\n TuiModeModule,\n ],\n entryComponents: [TuiDropdownBoxComponent],\n declarations: [TuiDropdownBoxComponent],\n exports: [TuiDropdownBoxComponent],\n})\nexport class TuiDropdownBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAoCA;;;AAGA;AACA;AACA;IASa,uBAAuB,GAApC,MAAa,uBAAuB;IAsBhC,YAEI,QAA2B,EACX,MAAc,EACW,SAAsB,EAC9B,SAAiB,EACb,UAAmC,EAEvD,UAAoC,EACL,OAAyB,EAChD,eAAmC;QANnB,cAAS,GAAT,SAAS,CAAa;QAC9B,cAAS,GAAT,SAAS,CAAQ;QACb,eAAU,GAAV,UAAU,CAAyB;QAEvD,eAAU,GAAV,UAAU,CAA0B;QACL,YAAO,GAAP,OAAO,CAAkB;QA9B5D,iBAAY,mBACzB,KAAK,iCACF,IAAI,CAAC,OAAO,EACjB;QAEe,oBAAe,mBAC5B,KAAK,uCACF,IAAI,CAAC,OAAO,EACjB;;;;QAKM,uBAAkB,GAAG,KAAK,CAAC;QAoB/B,KAAK,CACD,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,EAChD,IAAI,CAAC,SAAS,CAAC,QAAQ,EACvB,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtC;aACI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,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AC9B,WAAA,MAAM,CAAC,MAAM,CAAC,CAAA;IACd,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,8BAA8B,CAAC,CAAA;IAEtC,WAAA,MAAM,CAAC,qBAAqB,CAAC,CAAA;IAC7B,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;GAhCnB,uBAAuB,CAsVnC;;ICpXY,oBAAoB,GAAjC,MAAa,oBAAoB;EAAG;AAAvB,oBAAoB;IAZhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,kBAAkB;YAClB,aAAa;SAChB;QACD,eAAe,EAAE,CAAC,uBAAuB,CAAC;QAC1C,YAAY,EAAE,CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACpBpC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-dropdown-box.js","sources":["ng://@taiga-ui/core/components/dropdown-box/dropdown-box.component.ts","ng://@taiga-ui/core/components/dropdown-box/dropdown-box.module.ts","ng://@taiga-ui/core/components/dropdown-box/taiga-ui-core-components-dropdown-box.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostBinding,\n Inject,\n NgZone,\n ViewChild,\n} from '@angular/core';\nimport {ANIMATION_FRAME, WINDOW} from '@ng-web-apis/common';\nimport {\n AbstractTuiPortalHostComponent,\n getClosestFocusable,\n inRange,\n POLLING_TIME,\n px,\n TuiActiveZoneDirective,\n tuiAssertIsHTMLElement,\n TuiDestroyService,\n TuiDropdownHostComponent,\n TuiOverscrollModeT,\n tuiPure,\n tuiZonefree,\n} from '@taiga-ui/cdk';\nimport {tuiDropdownAnimation} from '@taiga-ui/core/animations';\nimport {DEFAULT_MARGIN, DEFAULT_MAX_WIDTH} from '@taiga-ui/core/constants';\nimport {TuiDropdownAnimation} from '@taiga-ui/core/enums';\nimport {TuiAnimationOptions, TuiDropdown} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATION_OPTIONS, TUI_DROPDOWN_DIRECTIVE} from '@taiga-ui/core/tokens';\nimport {TuiHorizontalDirection, TuiVerticalDirection} from '@taiga-ui/core/types';\nimport {getScreenWidth, tuiGetViewportWidth} from '@taiga-ui/core/utils/dom';\nimport {fromEvent, merge, Observable} from 'rxjs';\nimport {takeUntil, throttleTime} from 'rxjs/operators';\n\n/**\n * This component is used to show template in a portal using default style of white rounded box with a shadow\n */\n// @bad TODO: OnPush\n// Ambient type cannot be used without dynamic https://github.com/angular/angular/issues/23395\n// @dynamic\n@Component({\n selector: `tui-dropdown-box`,\n templateUrl: `./dropdown-box.template.html`,\n styleUrls: [`./dropdown-box.style.less`],\n changeDetection: ChangeDetectionStrategy.Default,\n providers: [TuiDestroyService],\n animations: [tuiDropdownAnimation],\n})\nexport class TuiDropdownBoxComponent implements AfterViewChecked {\n private readonly animationTop = {\n value: TuiDropdownAnimation.FadeInTop,\n ...this.options,\n };\n\n private readonly animationBottom = {\n value: TuiDropdownAnimation.FadeInBottom,\n ...this.options,\n };\n\n /**\n * Is previous position on top (to prevent jumping up and down on scroll)\n */\n private prevDirectionIsTop = false;\n\n @HostBinding(`@tuiDropdownAnimation`)\n dropdownAnimation!: TuiAnimationOptions;\n\n @ViewChild(`content`, {read: ElementRef})\n readonly contentElementRef?: ElementRef<HTMLElement>;\n\n constructor(\n @Inject(TuiDestroyService)\n destroy$: TuiDestroyService,\n @Inject(NgZone) ngZone: NgZone,\n @Inject(TUI_DROPDOWN_DIRECTIVE) readonly directive: TuiDropdown,\n @Inject(WINDOW) private readonly windowRef: Window,\n @Inject(ElementRef) private readonly elementRef: ElementRef<HTMLElement>,\n @Inject(AbstractTuiPortalHostComponent)\n private readonly portalHost: TuiDropdownHostComponent,\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(ANIMATION_FRAME) animationFrame$: Observable<number>,\n ) {\n merge(\n animationFrame$.pipe(throttleTime(POLLING_TIME)),\n this.directive.refresh$,\n fromEvent(this.windowRef, `resize`),\n )\n .pipe(tuiZonefree(ngZone), takeUntil(destroy$))\n .subscribe(() => {\n this.calculatePositionAndSize();\n });\n }\n\n get overscroll(): TuiOverscrollModeT {\n return this.inModal ? `all` : `scroll`;\n }\n\n @tuiPure\n getContext<T extends object>(\n context?: T,\n activeZone?: TuiActiveZoneDirective,\n ):\n | (T & {activeZone?: TuiActiveZoneDirective})\n | {activeZone?: TuiActiveZoneDirective} {\n return {...context, activeZone};\n }\n\n ngAfterViewChecked(): void {\n this.calculatePositionAndSize();\n }\n\n onTopFocus(): void {\n this.moveFocusOutside(true);\n }\n\n onBottomFocus(): void {\n this.moveFocusOutside(false);\n }\n\n @tuiPure\n private get inModal(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!this.directive.host.closest(`tui-dialog-host`);\n }\n\n @tuiPure\n private get inOption(): boolean {\n // @awful TODO: get rid of component tag name dependency\n return !!this.directive.host.closest(`[tuiOption]`);\n }\n\n private calculatePositionAndSize(): void {\n const {clientRect} = this.directive;\n const {style} = this.elementRef.nativeElement;\n const hostRect = this.directive.fixed\n ? this.portalHost.fixedPositionOffset()\n : this.portalHost.clientRect;\n\n style.position = this.directive.fixed ? `fixed` : `absolute`;\n\n this.calculateVerticalPosition(style, clientRect, hostRect);\n this.calculateHorizontalPosition(style, clientRect, hostRect);\n this.calculateWidth(style, clientRect);\n }\n\n private getFinalAlign(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n ): TuiHorizontalDirection {\n const dropdownRect = this.elementRef.nativeElement.getBoundingClientRect();\n const dropdownWidth = this.elementRef.nativeElement.offsetWidth;\n const screenWidth = getScreenWidth(this.windowRef.document);\n const isDropdownSizeHypotheticallyFitsViewport =\n directiveRect.left + dropdownWidth < screenWidth ||\n directiveRect.right - dropdownWidth > 0;\n const isDropdownSizeActuallyFitsViewport =\n dropdownRect.right <= screenWidth && dropdownRect.left >= 0;\n let finalAlign: TuiHorizontalDirection = this.directive.align;\n\n switch (this.directive.align) {\n case `left`:\n if (\n isDropdownSizeHypotheticallyFitsViewport &&\n dropdownRect.right > screenWidth\n ) {\n finalAlign = `right`;\n }\n\n break;\n case `right`:\n if (isDropdownSizeHypotheticallyFitsViewport && dropdownRect.left < 0) {\n finalAlign = `left`;\n }\n\n break;\n }\n\n if (style.right === `auto` && isDropdownSizeActuallyFitsViewport) {\n finalAlign = `left`;\n }\n\n if (style.left === `auto` && isDropdownSizeActuallyFitsViewport) {\n finalAlign = `right`;\n }\n\n return finalAlign;\n }\n\n /**\n * Calculates horizontal position\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateHorizontalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const offset = this.directive.sided\n ? this.elementRef.nativeElement.getBoundingClientRect().width + DEFAULT_MARGIN\n : 0;\n const left = Math.ceil(directiveRect.left - hostRect.left - offset);\n const right = Math.floor(hostRect.right - directiveRect.right - offset);\n const viewportWidth = tuiGetViewportWidth(this.windowRef);\n\n switch (this.getFinalAlign(style, directiveRect)) {\n case `left`:\n if (\n right + DEFAULT_MARGIN > viewportWidth ||\n inRange(left + DEFAULT_MARGIN, 0, viewportWidth)\n ) {\n style.left = px(left);\n style.right = `auto`;\n } else {\n style.left = `auto`;\n style.right = px(right);\n }\n\n break;\n case `right`:\n if (\n inRange(right + DEFAULT_MARGIN, 0, viewportWidth) ||\n left + DEFAULT_MARGIN > viewportWidth\n ) {\n style.left = `auto`;\n style.right = px(right);\n } else {\n style.left = px(left);\n style.right = `auto`;\n }\n\n break;\n }\n }\n\n /**\n * Calculates vertical position and height\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n * @param hostRect ClientRect of portal host\n */\n private calculateVerticalPosition(\n style: CSSStyleDeclaration,\n directiveRect: ClientRect,\n hostRect: ClientRect,\n ): void {\n const windowHeight = this.windowRef.innerHeight;\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n const finalDirection = this.getFinalDirection(directiveRect);\n const optionOffset = this.inOption ? DEFAULT_MARGIN * 2 : 0;\n\n this.prevDirectionIsTop = finalDirection === `top`;\n\n if (finalDirection === `top`) {\n this.dropdownAnimation = this.animationBottom;\n\n style.maxHeight = px(Math.min(boxHeightLimit, topAvailableHeight));\n style.top = `auto`;\n style.bottom = px(\n hostRect.bottom -\n directiveRect.top -\n DEFAULT_MARGIN +\n offset -\n optionOffset,\n );\n } else {\n this.dropdownAnimation = this.animationTop;\n\n style.maxHeight = px(Math.min(boxHeightLimit, bottomAvailableHeight));\n style.top = px(\n directiveRect.bottom -\n hostRect.top -\n DEFAULT_MARGIN +\n offset -\n optionOffset,\n );\n style.bottom = `auto`;\n }\n }\n\n private getFinalDirection(directiveRect: ClientRect): TuiVerticalDirection | null {\n const windowHeight = this.windowRef.innerHeight;\n const offset = this.directive.sided\n ? DEFAULT_MARGIN - directiveRect.height\n : DEFAULT_MARGIN * 2;\n\n // Maximum space available on top and on the bottom in the viewport\n const topAvailableHeight = directiveRect.top - offset;\n const bottomAvailableHeight = windowHeight - directiveRect.bottom - offset;\n\n let finalDirection: TuiVerticalDirection | null = null;\n\n // Given direction is applied if we can fit the box in the limits that way\n switch (this.directive.direction) {\n case `top`:\n if (topAvailableHeight >= this.directive.minHeight) {\n finalDirection = `top`;\n }\n\n break;\n case `bottom`:\n if (bottomAvailableHeight >= this.directive.minHeight) {\n finalDirection = `bottom`;\n }\n\n break;\n }\n\n // Maximum height of the box\n const boxHeightLimit = Math.min(\n this.directive.maxHeight,\n windowHeight - DEFAULT_MARGIN * 2,\n );\n\n // Choose direction if given direction did not fit\n if (finalDirection === null && this.contentElementRef) {\n // Box height if it fits without scroll\n const visualHeight = Math.min(\n this.contentElementRef.nativeElement.getBoundingClientRect().height +\n (this.elementRef.nativeElement.offsetHeight -\n this.elementRef.nativeElement.clientHeight),\n boxHeightLimit,\n );\n\n // If there is enough space to fit below without scroll,\n // choose 'bottom', unless it was previously on the top\n if (this.prevDirectionIsTop && topAvailableHeight >= visualHeight) {\n finalDirection = `top`;\n } else if (bottomAvailableHeight >= visualHeight) {\n finalDirection = `bottom`;\n } else {\n // Corner case — select direction with more space\n finalDirection =\n bottomAvailableHeight >= topAvailableHeight ? `bottom` : `top`;\n }\n }\n\n return finalDirection;\n }\n\n /**\n * Calculates width\n *\n * @param style dropdownBox elementRef styles object\n * @param directiveRect ClientRect of hosting directive\n */\n private calculateWidth(style: CSSStyleDeclaration, directiveRect: ClientRect): void {\n style.width =\n this.directive.limitMinWidth === `fixed` && !this.directive.sided\n ? px(directiveRect.width)\n : ``;\n\n if (this.directive.limitMinWidth === `min` && !this.directive.sided) {\n style.minWidth = px(directiveRect.width);\n style.maxWidth = px(DEFAULT_MAX_WIDTH);\n\n return;\n }\n\n style.minWidth = ``;\n style.maxWidth = ``;\n }\n\n private moveFocusOutside(previous: boolean): void {\n const {host} = this.directive;\n const {ownerDocument} = host;\n const root = ownerDocument ? ownerDocument.body : host;\n\n tuiAssertIsHTMLElement(host);\n\n let focusable = getClosestFocusable(host, previous, root);\n\n while (focusable !== null && host.contains(focusable)) {\n focusable = getClosestFocusable(focusable, previous, root);\n }\n\n focusable?.focus();\n }\n}\n","import {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiOverscrollModule} from '@taiga-ui/cdk';\nimport {TuiScrollbarModule} from '@taiga-ui/core/components/scrollbar';\nimport {TuiModeModule} from '@taiga-ui/core/directives/mode';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDropdownBoxComponent} from './dropdown-box.component';\n\n@NgModule({\n imports: [\n TuiActiveZoneModule,\n PolymorpheusModule,\n TuiOverscrollModule,\n TuiScrollbarModule,\n TuiModeModule,\n ],\n entryComponents: [TuiDropdownBoxComponent],\n declarations: [TuiDropdownBoxComponent],\n exports: [TuiDropdownBoxComponent],\n})\nexport class TuiDropdownBoxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAoCA;;;AAGA;AACA;AACA;IASa,uBAAuB,GAApC,MAAa,uBAAuB;IAsBhC,YAEI,QAA2B,EACX,MAAc,EACW,SAAsB,EAC9B,SAAiB,EACb,UAAmC,EAEvD,UAAoC,EACL,OAAyB,EAChD,eAAmC;QANnB,cAAS,GAAT,SAAS,CAAa;QAC9B,cAAS,GAAT,SAAS,CAAQ;QACb,eAAU,GAAV,UAAU,CAAyB;QAEvD,eAAU,GAAV,UAAU,CAA0B;QACL,YAAO,GAAP,OAAO,CAAkB;QA9B5D,iBAAY,mBACzB,KAAK,iCACF,IAAI,CAAC,OAAO,EACjB;QAEe,oBAAe,mBAC5B,KAAK,uCACF,IAAI,CAAC,OAAO,EACjB;;;;QAKM,uBAAkB,GAAG,KAAK,CAAC;QAoB/B,KAAK,CACD,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,EAChD,IAAI,CAAC,SAAS,CAAC,QAAQ,EACvB,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CACtC;aACI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;aAC9C,SAAS,CAAC;YACP,IAAI,CAAC,wBAAwB,EAAE,CAAC;SACnC,CAAC,CAAC;KACV;IAED,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;KAC1C;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AAM,CAAC,eAAe,CAAC,CAAA;GAhCnB,uBAAuB,CAsVnC;;ICpXY,oBAAoB,GAAjC,MAAa,oBAAoB;EAAG;AAAvB,oBAAoB;IAZhC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,kBAAkB;YAClB,aAAa;SAChB;QACD,eAAe,EAAE,CAAC,uBAAuB,CAAC;QAC1C,YAAY,EAAE,CAAC,uBAAuB,CAAC;QACvC,OAAO,EAAE,CAAC,uBAAuB,CAAC;KACrC,CAAC;GACW,oBAAoB,CAAG;;ACpBpC;;;;;;"}
|
|
@@ -32,11 +32,11 @@ __decorate([
|
|
|
32
32
|
TuiErrorComponent = __decorate([
|
|
33
33
|
Component({
|
|
34
34
|
selector: `tui-error`,
|
|
35
|
-
template: "<div\n *ngIf=\"error\"\n polymorpheus-outlet\n automation-id=\"tui-error__text\"\n class=\"message-text\"\n [@tuiHeightCollapse]=\"animation\"\n [@tuiFadeIn]=\"animation\"\n [class.message-text_light]=\"(mode$ | async) === 'onDark'\"\n [content]=\"error.message || (defaultErrorMessage$ | async)\"\n [context]=\"error.context || {}\"\n></div>\n",
|
|
35
|
+
template: "<div\n *ngIf=\"error\"\n polymorpheus-outlet\n automation-id=\"tui-error__text\"\n class=\"t-message-text\"\n [@tuiHeightCollapse]=\"animation\"\n [@tuiFadeIn]=\"animation\"\n [class.t-message-text_light]=\"(mode$ | async) === 'onDark'\"\n [content]=\"error.message || (defaultErrorMessage$ | async)\"\n [context]=\"error.context || {}\"\n></div>\n",
|
|
36
36
|
providers: [MODE_PROVIDER],
|
|
37
37
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
38
38
|
animations: [tuiHeightCollapse, tuiFadeIn],
|
|
39
|
-
styles: [":host{font:var(--tui-font-text-s);color:var(--tui-text-01);display:block;color:var(--tui-negative);word-wrap:break-word}.message-text{margin-top:.25rem;white-space:pre-wrap}.message-text_light{color:var(--tui-negative-night)}"]
|
|
39
|
+
styles: [":host{font:var(--tui-font-text-s);color:var(--tui-text-01);display:block;color:var(--tui-negative);word-wrap:break-word}.t-message-text{margin-top:.25rem;white-space:pre-wrap}.t-message-text_light{color:var(--tui-negative-night)}"]
|
|
40
40
|
}),
|
|
41
41
|
__param(0, Inject(TUI_ANIMATION_OPTIONS)),
|
|
42
42
|
__param(1, Inject(TUI_MODE)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-error.js","sources":["ng://@taiga-ui/core/components/error/error.component.ts","ng://@taiga-ui/core/components/error/error.module.ts","ng://@taiga-ui/core/components/error/taiga-ui-core-components-error.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core';\nimport {tuiDefaultProp, TuiValidationError} from '@taiga-ui/cdk';\nimport {tuiFadeIn, tuiHeightCollapse} from '@taiga-ui/core/animations';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {\n TUI_ANIMATION_OPTIONS,\n TUI_DEFAULT_ERROR_MESSAGE,\n TUI_MODE,\n} from '@taiga-ui/core/tokens';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: `tui-error`,\n templateUrl: `./error.template.html`,\n styleUrls: [`./error.style.less`],\n providers: [MODE_PROVIDER],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiHeightCollapse, tuiFadeIn],\n})\nexport class TuiErrorComponent {\n @Input(`error`)\n @tuiDefaultProp()\n set errorSetter(error: TuiValidationError | string | null) {\n this.error = typeof error === `string` ? new TuiValidationError(error) : error;\n }\n\n error: TuiValidationError | null = null;\n\n readonly animation = {value: ``, ...this.options} as const;\n\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_DEFAULT_ERROR_MESSAGE)\n readonly defaultErrorMessage$: Observable<string>,\n ) {}\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiErrorComponent} from './error.component';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule],\n declarations: [TuiErrorComponent],\n exports: [TuiErrorComponent],\n})\nexport class TuiErrorModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;IAqBa,iBAAiB,GAA9B,MAAa,iBAAiB;IAW1B,YACoD,OAAyB,EAC9C,KAAuC,EAEzD,oBAAwC;QAHD,YAAO,GAAP,OAAO,CAAkB;QAC9C,UAAK,GAAL,KAAK,CAAkC;QAEzD,yBAAoB,GAApB,oBAAoB,CAAoB;QARrD,UAAK,GAA8B,IAAI,CAAC;QAE/B,cAAS,GAAG,gBAAC,KAAK,EAAE,EAAE,IAAK,IAAI,CAAC,OAAO,CAAU,CAAC;KAOvD;IAbJ,IAAI,WAAW,CAAC,KAAyC;QACrD,IAAI,CAAC,KAAK,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;KAClF;EAYJ;;4CALQ,MAAM,SAAC,qBAAqB;YACK,UAAU,uBAA3C,MAAM,SAAC,QAAQ;YAEe,UAAU,uBADxC,MAAM,SAAC,yBAAyB;;AAXrC;IAFC,KAAK,CAAC,OAAO,CAAC;IACd,cAAc,EAAE;oDAGhB;AALQ,iBAAiB;IAR7B,SAAS,CAAC;QACP,QAAQ,EAAE,WAAW;QACrB
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-error.js","sources":["ng://@taiga-ui/core/components/error/error.component.ts","ng://@taiga-ui/core/components/error/error.module.ts","ng://@taiga-ui/core/components/error/taiga-ui-core-components-error.ts"],"sourcesContent":["import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, Inject, Input} from '@angular/core';\nimport {tuiDefaultProp, TuiValidationError} from '@taiga-ui/cdk';\nimport {tuiFadeIn, tuiHeightCollapse} from '@taiga-ui/core/animations';\nimport {MODE_PROVIDER} from '@taiga-ui/core/providers';\nimport {\n TUI_ANIMATION_OPTIONS,\n TUI_DEFAULT_ERROR_MESSAGE,\n TUI_MODE,\n} from '@taiga-ui/core/tokens';\nimport {TuiBrightness} from '@taiga-ui/core/types';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: `tui-error`,\n templateUrl: `./error.template.html`,\n styleUrls: [`./error.style.less`],\n providers: [MODE_PROVIDER],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiHeightCollapse, tuiFadeIn],\n})\nexport class TuiErrorComponent {\n @Input(`error`)\n @tuiDefaultProp()\n set errorSetter(error: TuiValidationError | string | null) {\n this.error = typeof error === `string` ? new TuiValidationError(error) : error;\n }\n\n error: TuiValidationError | null = null;\n\n readonly animation = {value: ``, ...this.options} as const;\n\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(TUI_MODE) readonly mode$: Observable<TuiBrightness | null>,\n @Inject(TUI_DEFAULT_ERROR_MESSAGE)\n readonly defaultErrorMessage$: Observable<string>,\n ) {}\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiErrorComponent} from './error.component';\n\n@NgModule({\n imports: [CommonModule, PolymorpheusModule],\n declarations: [TuiErrorComponent],\n exports: [TuiErrorComponent],\n})\nexport class TuiErrorModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;IAqBa,iBAAiB,GAA9B,MAAa,iBAAiB;IAW1B,YACoD,OAAyB,EAC9C,KAAuC,EAEzD,oBAAwC;QAHD,YAAO,GAAP,OAAO,CAAkB;QAC9C,UAAK,GAAL,KAAK,CAAkC;QAEzD,yBAAoB,GAAp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apper\"\n>\n <ng-container *ngIf=\"contentVisible\">\n <ng-content></ng-content>\n <!-- TODO: 3.0 collision with async pipe, fix after upgrade to ng11 -->\n <tui-loader\n *ngIf=\"this.async; else content\"\n size=\"l\"\n [overlay]=\"true\"\n [showLoader]=\"loading\"\n >\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n </tui-loader>\n </ng-container>\n</div>\n",
|
|
135
|
+
template: "<div\n #wrapper\n class=\"t-wrapper\"\n>\n <ng-container *ngIf=\"contentVisible\">\n <ng-content></ng-content>\n <!-- TODO: 3.0 collision with async pipe, fix after upgrade to ng11 -->\n <tui-loader\n *ngIf=\"this.async; else content\"\n size=\"l\"\n [overlay]=\"true\"\n [showLoader]=\"loading\"\n >\n <ng-container [ngTemplateOutlet]=\"content\"></ng-container>\n </tui-loader>\n </ng-container>\n</div>\n",
|
|
136
136
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
137
|
-
styles: [":host{display:block;transition-property:opacity,height,visibility;transition-duration:var(--tui-duration,300ms);opacity:0}:host._overflow{overflow:hidden}:host._expanded{opacity:1;transform:translate3d(0,0,0)}:host._loading{opacity:.99}.wrapper:after,.wrapper:before{content:'';display:table}"]
|
|
137
|
+
styles: [":host{display:block;transition-property:opacity,height,visibility;transition-duration:var(--tui-duration,300ms);opacity:0}:host._overflow{overflow:hidden}:host._expanded{opacity:1;transform:translate3d(0,0,0)}:host._loading{opacity:.99}.t-wrapper:after,.t-wrapper:before{content:'';display:table}"]
|
|
138
138
|
}),
|
|
139
139
|
__param(0, Inject(ChangeDetectorRef))
|
|
140
140
|
], TuiExpandComponent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-expand.js","sources":["ng://@taiga-ui/core/components/expand/expand-content.directive.ts","ng://@taiga-ui/core/components/expand/expand.component.ts","ng://@taiga-ui/core/components/expand/expand.module.ts","ng://@taiga-ui/core/components/expand/taiga-ui-core-components-expand.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n// @bad TODO: 3.0 Replace with PolymorpheusContent\n@Directive({\n selector: `[tuiExpandContent]`,\n})\nexport class TuiExpandContentDirective {}\n","import {NgIfContext} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {isCurrentTarget, tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk';\nimport {TUI_EXPAND_LOADED} from '@taiga-ui/core/constants';\n\nimport {TuiExpandContentDirective} from './expand-content.directive';\n\nenum State {\n Idle,\n Loading,\n Prepared,\n Animated,\n}\n\nconst LOADER_HEIGHT = 48;\n\n@Component({\n selector: `tui-expand`,\n templateUrl: `./expand.template.html`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: [`./expand.style.less`],\n})\nexport class TuiExpandComponent {\n @ViewChild(`wrapper`)\n private readonly contentWrapper?: ElementRef<HTMLDivElement>;\n\n private state = State.Idle;\n\n @Input()\n @tuiDefaultProp()\n async = false;\n\n @Input(`expanded`)\n @tuiRequiredSetter()\n set expandedSetter(expanded: boolean | null) {\n if (this.expanded === null) {\n this.expanded = expanded;\n\n return;\n }\n\n if (this.state !== State.Idle) {\n this.expanded = expanded;\n this.state = State.Animated;\n\n return;\n }\n\n this.expanded = expanded;\n this.retrigger(this.async && expanded ? State.Loading : State.Animated);\n }\n\n @ContentChild(TuiExpandContentDirective, {read: TemplateRef})\n content: TemplateRef<NgIfContext<boolean>> | null = null;\n\n @HostBinding(`class._expanded`)\n @HostBinding(`attr.aria-expanded`)\n expanded: boolean | null = null;\n\n constructor(\n @Inject(ChangeDetectorRef) private readonly changeDetectorRef: ChangeDetectorRef,\n ) {}\n\n @HostBinding(`class._overflow`)\n get overflow(): boolean {\n return this.state !== State.Idle;\n }\n\n @HostBinding(`class._loading`)\n get loading(): boolean {\n return !!this.expanded && this.async && this.state === State.Loading;\n }\n\n @HostBinding(`style.height.px`)\n get height(): number | null {\n const {expanded, state, contentWrapper} = this;\n\n if (\n (expanded && state === State.Prepared) ||\n (!expanded && state === State.Animated)\n ) {\n return 0;\n }\n\n if (\n contentWrapper &&\n ((!expanded && state === State.Prepared) ||\n (expanded && state === State.Animated))\n ) {\n return contentWrapper.nativeElement.offsetHeight;\n }\n\n if (contentWrapper && expanded && state === State.Loading) {\n return Math.max(contentWrapper.nativeElement.offsetHeight, LOADER_HEIGHT);\n }\n\n return null;\n }\n\n get contentVisible(): boolean {\n return this.expanded || this.state !== State.Idle;\n }\n\n @HostListener(`transitionend`, [`$event`])\n onTransitionEnd(event: TransitionEvent): void {\n if (\n isCurrentTarget(event) &&\n event.propertyName === `opacity` &&\n this.state === State.Animated\n ) {\n this.state = State.Idle;\n }\n }\n\n @HostListener(TUI_EXPAND_LOADED, [`$event`])\n onExpandLoaded(event: Event): void {\n event.stopPropagation();\n\n if (this.state === State.Loading) {\n this.retrigger(State.Animated);\n }\n }\n\n private retrigger(state: State): void {\n this.state = State.Prepared;\n\n // We need delay to re-trigger CSS height transition from the correct number\n setTimeout(() => {\n if (this.state !== State.Prepared) {\n return;\n }\n\n this.state = state;\n this.changeDetectorRef.markForCheck();\n });\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLoaderModule} from '@taiga-ui/core/components/loader';\n\nimport {TuiExpandComponent} from './expand.component';\nimport {TuiExpandContentDirective} from './expand-content.directive';\n\n@NgModule({\n imports: [CommonModule, TuiLoaderModule],\n declarations: [TuiExpandComponent, TuiExpandContentDirective],\n exports: [TuiExpandComponent, TuiExpandContentDirective],\n})\nexport class TuiExpandModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;IAIa,yBAAyB,GAAtC,MAAa,yBAAyB;EAAG;AAA5B,yBAAyB;IAHrC,SAAS,CAAC;QACP,QAAQ,EAAE,oBAAoB;KACjC,CA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,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,QAAQ,EAAE;gBAC/B,OAAO;aACV;YAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YACnB,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC;SACzC,CAAC,CAAC;KACN;EACJ;;YA5EsE,iBAAiB,uBAA/E,MAAM,SAAC,iBAAiB;;AApC7B;IADC,SAAS,CAAC,SAAS,CAAC;0DACwC;AAM7D;IAFC,KAAK,EAAE;IACP,cAAc,EAAE;iDACH;AAId;IAFC,KAAK,CAAC,UAAU,CAAC;IACjB,iBAAiB,EAAE;wDAiBnB;AAGD;IADC,YAAY,CAAC,yBAAyB,EAAE,EAAC,IAAI,EAAE,WAAW,EAAC,CAAC;mDACJ;AAIzD;IAFC,WAAW,CAAC,iBAAiB,CAAC;IAC9B,WAAW,CAAC,oBAAoB,CAAC;oDACF;AAOhC;IADC,WAAW,CAAC,iBAAiB,CAAC;kDAG9B;AAGD;IADC,WAAW,CAAC,gBAAgB,CAAC;iDAG7B;AAGD;IADC,WAAW,CAAC,iBAAiB,CAAC;gDAwB9B;AAOD;IADC,YAAY,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,CAAC;yDASzC;AAGD;IADC,YAAY,CAAC,iBAAiB,EAAE,CAAC,QAAQ,CAAC,CAAC;wDAO3C;AAnGQ,kBAAkB;IAN9B,SAAS,CAAC;QACP,QAAQ,EAAE,YAAY;QACtB,
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-expand.js","sources":["ng://@taiga-ui/core/components/expand/expand-content.directive.ts","ng://@taiga-ui/core/components/expand/expand.component.ts","ng://@taiga-ui/core/components/expand/expand.module.ts","ng://@taiga-ui/core/components/expand/taiga-ui-core-components-expand.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n// @bad TODO: 3.0 Replace with PolymorpheusContent\n@Directive({\n selector: `[tuiExpandContent]`,\n})\nexport class TuiExpandContentDirective {}\n","import {NgIfContext} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChild,\n ElementRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n TemplateRef,\n ViewChild,\n} from '@angular/core';\nimport {isCurrentTarget, tuiDefaultProp, tuiRequiredSetter} from '@taiga-ui/cdk';\nimport {TUI_EXPAND_LOADED} from '@taiga-ui/core/constants';\n\nimport {TuiExpandContentDirective} from './expand-content.directive';\n\nenum State {\n Idle,\n Loading,\n Prepared,\n Animated,\n}\n\nconst LOADER_HEIGHT = 48;\n\n@Component({\n selector: `tui-expand`,\n templateUrl: `./expand.template.html`,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: [`./expand.style.less`],\n})\nexport class TuiExpandComponent {\n @ViewChild(`wrapper`)\n private readonly contentWrapper?: ElementRef<HTMLDivElement>;\n\n private state = State.Idle;\n\n @Input()\n @tuiDefaultProp()\n async = false;\n\n @Input(`expanded`)\n @tuiRequiredSetter()\n set expandedSetter(expanded: boolean | null) {\n if (this.expanded === null) {\n this.expanded = expanded;\n\n return;\n }\n\n if (this.state !== State.Idle) {\n this.expanded = expanded;\n this.state = State.Animated;\n\n return;\n }\n\n this.expanded = expanded;\n this.retrigger(this.async && expanded ? State.Loading : State.Animated);\n }\n\n @ContentChild(TuiExpandContentDirective, {read: TemplateRef})\n content: TemplateRef<NgIfContext<boolean>> | null = null;\n\n @HostBinding(`class._expanded`)\n @HostBinding(`attr.aria-expanded`)\n expanded: boolean | null = null;\n\n constructor(\n @Inject(ChangeDetectorRef) private readonly changeDetectorRef: ChangeDetectorRef,\n ) {}\n\n @HostBinding(`class._overflow`)\n get overflow(): boolean {\n return this.state !== State.Idle;\n }\n\n @HostBinding(`class._loading`)\n get loading(): boolean {\n return !!this.expanded && this.async && this.state === State.Loading;\n }\n\n @HostBinding(`style.height.px`)\n get height(): number | null {\n const {expanded, state, contentWrapper} = this;\n\n if (\n (expanded && state === State.Prepared) ||\n (!expanded && state === State.Animated)\n ) {\n return 0;\n }\n\n if (\n contentWrapper &&\n ((!expanded && state === State.Prepared) ||\n (expanded && state === State.Animated))\n ) {\n return contentWrapper.nativeElement.offsetHeight;\n }\n\n if (contentWrapper && expanded && state === State.Loading) {\n return Math.max(contentWrapper.nativeElement.offsetHeight, LOADER_HEIGHT);\n }\n\n return null;\n }\n\n get contentVisible(): boolean {\n return this.expanded || this.state !== State.Idle;\n }\n\n @HostListener(`transitionend`, [`$event`])\n onTransitionEnd(event: TransitionEvent): void {\n if (\n isCurrentTarget(event) &&\n event.propertyName === `opacity` &&\n this.state === State.Animated\n ) {\n this.state = State.Idle;\n }\n }\n\n @HostListener(TUI_EXPAND_LOADED, [`$event`])\n onExpandLoaded(event: Event): void {\n event.stopPropagation();\n\n if (this.state === State.Loading) {\n this.retrigger(State.Animated);\n }\n }\n\n private retrigger(state: State): void {\n this.state = State.Prepared;\n\n // We need delay to re-trigger CSS height transition from the correct number\n setTimeout(() => {\n if (this.state !== State.Prepared) {\n return;\n }\n\n this.state = state;\n this.changeDetectorRef.markForCheck();\n });\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiLoaderModule} from '@taiga-ui/core/components/loader';\n\nimport {TuiExpandComponent} from './expand.component';\nimport {TuiExpandContentDirective} from './expand-content.directive';\n\n@NgModule({\n imports: [CommonModule, TuiLoaderModule],\n declarations: [TuiExpandComponent, TuiExpandContentDirective],\n exports: [TuiExpandComponent, TuiExpandContentDirective],\n})\nexport class TuiExpandModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;IAIa,yBAAyB,GAAtC,MAAa,yBAAyB;EAAG;AAA5B,yBAAyB;IAHrC,SAAS,CAAC;QACP,QAAQ,EAAE,oBAAoB;KACjC,CAAC;GACW,yBAAyB,CAAG;;ACazC,IAAK,KAKJ;AALD,WAAK,KAAK;IACN,iCAAI,CAAA;IACJ,uCAAO,CAAA;IACP,yCAAQ,CAAA;IAC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|
TuiHostedDropdownComponent = TuiHostedDropdownComponent_1 = __decorate([
|
|
200
200
|
Component({
|
|
201
201
|
selector: `tui-hosted-dropdown`,
|
|
202
|
-
template: "<div\n #activeZone=\"tuiActiveZone\"\n class=\"wrapper\"\n [tuiDropdownAlign]=\"controller.align\"\n [tuiDropdownDirection]=\"controller.direction\"\n [tuiDropdownHost]=\"nativeFocusableElement\"\n [tuiDropdownLimitWidth]=\"controller.limitWidth\"\n [tuiDropdownMinHeight]=\"controller.minHeight\"\n [tuiDropdownMaxHeight]=\"controller.maxHeight\"\n [tuiDropdownSided]=\"controller.sided\"\n [tuiDropdownContent]=\"dropdown\"\n [tuiDropdown]=\"open && canOpen\"\n [tuiObscuredEnabled]=\"open\"\n (tuiObscured)=\"onHostObscured($event)\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <ng-content></ng-content>\n <ng-template\n #dropdown=\"polymorpheus\"\n polymorpheus\n >\n <div\n #wrapper\n polymorpheus-outlet\n [content]=\"content\"\n [context]=\"{$implicit: activeZone}\"\n (keydown.esc)=\"onKeyDownEsc($event)\"\n (keydown)=\"onKeydown($event)\"\n ></div>\n <!--This DIV is here to start backwards TreeWalker for focusing last focusable item on ArrowUp-->\n <div></div>\n </ng-template>\n</div>\n",
|
|
202
|
+
template: "<div\n #activeZone=\"tuiActiveZone\"\n class=\"t-wrapper\"\n [tuiDropdownAlign]=\"controller.align\"\n [tuiDropdownDirection]=\"controller.direction\"\n [tuiDropdownHost]=\"nativeFocusableElement\"\n [tuiDropdownLimitWidth]=\"controller.limitWidth\"\n [tuiDropdownMinHeight]=\"controller.minHeight\"\n [tuiDropdownMaxHeight]=\"controller.maxHeight\"\n [tuiDropdownSided]=\"controller.sided\"\n [tuiDropdownContent]=\"dropdown\"\n [tuiDropdown]=\"open && canOpen\"\n [tuiObscuredEnabled]=\"open\"\n (tuiObscured)=\"onHostObscured($event)\"\n (tuiActiveZoneChange)=\"onActiveZone($event)\"\n>\n <ng-content></ng-content>\n <ng-template\n #dropdown=\"polymorpheus\"\n polymorpheus\n >\n <div\n #wrapper\n polymorpheus-outlet\n [content]=\"content\"\n [context]=\"{$implicit: activeZone}\"\n (keydown.esc)=\"onKeyDownEsc($event)\"\n (keydown)=\"onKeydown($event)\"\n ></div>\n <!--This DIV is here to start backwards TreeWalker for focusing last focusable item on ArrowUp-->\n <div></div>\n </ng-template>\n</div>\n",
|
|
203
203
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
204
204
|
providers: [
|
|
205
205
|
{
|
|
@@ -208,7 +208,7 @@ TuiHostedDropdownComponent = TuiHostedDropdownComponent_1 = __decorate([
|
|
|
208
208
|
},
|
|
209
209
|
DROPDOWN_CONTROLLER_PROVIDER,
|
|
210
210
|
],
|
|
211
|
-
styles: [":host{display:inline-flex}.wrapper{border-radius:inherit;height:inherit;flex:1 1 auto;width:100%}
|
|
211
|
+
styles: [":host{display:inline-flex}.t-wrapper{border-radius:inherit;height:inherit;flex:1 1 auto;width:100%}"]
|
|
212
212
|
}),
|
|
213
213
|
__param(0, Inject(ElementRef)),
|
|
214
214
|
__param(1, Inject(TUI_DROPDOWN_WATCHED_CONTROLLER))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-hosted-dropdown.js","sources":["ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown-connector.directive.ts","ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown.component.ts","ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown.module.ts","ng://@taiga-ui/core/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n@Directive({\n selector: `[tuiHostedDropdownHost]`,\n})\nexport class TuiHostedDropdownConnectorDirective {}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport {\n getClosestFocusable,\n isElementEditable,\n isNativeFocusedIn,\n isNativeKeyboardFocusable,\n setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiActiveZoneDirective,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {\n DROPDOWN_CONTROLLER_PROVIDER,\n TUI_DROPDOWN_WATCHED_CONTROLLER,\n TuiDropdownControllerDirective,\n} from '@taiga-ui/core/directives/dropdown-controller';\nimport {isEditingKey} from '@taiga-ui/core/utils/miscellaneous';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHostedDropdownConnectorDirective} from './hosted-dropdown-connector.directive';\n\n@Component({\n selector: `tui-hosted-dropdown`,\n templateUrl: `./hosted-dropdown.template.html`,\n styleUrls: [`./hosted-dropdown.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiHostedDropdownComponent),\n },\n DROPDOWN_CONTROLLER_PROVIDER,\n ],\n})\nexport class TuiHostedDropdownComponent implements TuiFocusableElementAccessor {\n @ContentChild(TuiHostedDropdownConnectorDirective, {read: ElementRef})\n private readonly dropdownHost?: ElementRef<HTMLElement>;\n\n @ViewChild(`wrapper`, {read: ElementRef})\n private readonly wrapper?: ElementRef<HTMLDivElement>;\n\n @ViewChild(TuiDropdownDirective)\n private readonly dropdownDirective?: TuiDropdownDirective;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent<TuiContextWithImplicit<TuiActiveZoneDirective>> = ``;\n\n @Input()\n @tuiDefaultProp()\n canOpen = true;\n\n @Input()\n @tuiDefaultProp()\n open = false;\n\n @Output()\n readonly openChange = new EventEmitter<boolean>();\n\n @Output()\n readonly focusedChange = new EventEmitter<boolean>();\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef,\n @Inject(TUI_DROPDOWN_WATCHED_CONTROLLER)\n readonly controller: TuiDropdownControllerDirective,\n ) {}\n\n get host(): HTMLElement {\n return this.dropdownHost\n ? this.dropdownHost.nativeElement\n : this.elementRef.nativeElement;\n }\n\n get dropdown(): HTMLElement | null {\n return !this.dropdownDirective || this.dropdownDirective.dropdownBoxRef === null\n ? null\n : this.dropdownDirective.dropdownBoxRef.location.nativeElement;\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return isNativeKeyboardFocusable(this.host)\n ? this.host\n : getClosestFocusable(this.host, false, this.elementRef.nativeElement);\n }\n\n @HostBinding(`class._hosted_dropdown_focused`)\n get focused(): boolean {\n return (\n isNativeFocusedIn(this.host) ||\n (this.open && !!this.wrapper && isNativeFocusedIn(this.wrapper.nativeElement))\n );\n }\n\n @HostListener(`focusin`, [`$event.target`])\n onFocusIn(target: HTMLElement): void {\n const host = this.dropdownHost\n ? this.dropdownHost.nativeElement\n : this.nativeFocusableElement || this.elementRef.nativeElement;\n\n if (!host.contains(target)) {\n this.updateOpen(false);\n }\n }\n\n @HostListener(`click`, [`$event.target`])\n onClick(target: HTMLElement): void {\n const host = this.nativeFocusableElement || this.host;\n const dropdownHost = this.dropdownHost ? this.dropdownHost.nativeElement : host;\n\n if (!this.hostEditable && dropdownHost.contains(target)) {\n this.updateOpen(!this.open);\n }\n }\n\n @HostListener(`keydown.esc`, [`$event`])\n onKeyDownEsc(event: Event): void {\n if (!this.canOpen || !this.open) {\n return;\n }\n\n event.stopPropagation();\n this.closeDropdown();\n }\n\n @HostListener(`keydown.arrowDown`, [`$event`, `true`])\n @HostListener(`keydown.arrowUp`, [`$event`, `false`])\n onArrow(event: KeyboardEvent, down: boolean): void {\n this.focusDropdown(event, down);\n }\n\n onKeydown({key, target, defaultPrevented}: KeyboardEvent): void {\n if (\n !defaultPrevented &&\n isEditingKey(key) &&\n this.hostEditable &&\n // TODO: iframe warning\n target instanceof HTMLElement &&\n !isElementEditable(target)\n ) {\n this.focusHost();\n }\n }\n\n onActiveZone(active: boolean): void {\n this.updateFocused(active);\n\n if (!active) {\n this.updateOpen(false);\n }\n }\n\n onHostObscured(obscured: boolean): void {\n if (obscured) {\n this.closeDropdown();\n }\n }\n\n updateOpen(open: boolean): void {\n if (open && !this.canOpen) {\n return;\n }\n\n this.open = open;\n this.openChange.emit(open);\n }\n\n private get hostEditable(): boolean {\n const host = this.nativeFocusableElement || this.host;\n\n // TODO: iframe warning\n return host instanceof HTMLElement && isElementEditable(host);\n }\n\n private focusDropdown(event: KeyboardEvent, first: boolean): void {\n const host = this.nativeFocusableElement;\n\n // TODO: iframe warning\n if (\n !host ||\n !(host instanceof HTMLElement) ||\n !(event.target instanceof Node) ||\n !host.contains(event.target)\n ) {\n return;\n }\n\n if (\n !this.wrapper ||\n !this.open ||\n this.dropdown === null ||\n // TODO: iframe warning\n !(this.wrapper.nativeElement.nextElementSibling instanceof HTMLElement)\n ) {\n this.updateOpen(true);\n\n if (!isElementEditable(host)) {\n event.preventDefault();\n }\n\n return;\n }\n\n const initial = first\n ? this.wrapper.nativeElement\n : this.wrapper.nativeElement.nextElementSibling;\n const focusable = getClosestFocusable(\n initial,\n !first,\n this.wrapper.nativeElement,\n );\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n event.preventDefault();\n }\n\n private closeDropdown(): void {\n if (this.focused) {\n this.focusHost();\n }\n\n this.updateOpen(false);\n }\n\n private focusHost(): void {\n const host = this.nativeFocusableElement;\n\n if (host !== null) {\n setNativeFocused(host, true, true);\n }\n }\n\n private updateFocused(focused: boolean): void {\n this.focusedChange.emit(focused);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiObscuredModule} from '@taiga-ui/cdk';\nimport {TuiDropdownModule} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHostedDropdownComponent} from './hosted-dropdown.component';\nimport {TuiHostedDropdownConnectorDirective} from './hosted-dropdown-connector.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiObscuredModule,\n PolymorpheusModule,\n TuiActiveZoneModule,\n TuiDropdownModule,\n ],\n declarations: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],\n exports: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],\n})\nexport class TuiHostedDropdownModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAKa,mCAAmC,GAAhD,MAAa,mCAAmC;EAAG;AAAtC,mCAAmC;IAH/C,SAAS,CAAC;QACP,QAAQ,EAAE,yBAAyB;KACtC,CAAC;GACW,mCAAmC,CAAG;;;IC8CtC,0BAA0B,kCAAvC,MAAa,0BAA0B;IA4BnC,YACyC,UAAsB,EAElD,UAA0C;QAFd,eAAU,GAAV,UAAU,CAAY;QAElD,eAAU,GAAV,UAAU,CAAgC;QAnBvD,YAAO,GAAwE,EAAE,CAAC;QAIlF,YAAO,GAAG,IAAI,CAAC;QAIf,SAAI,GAAG,KAAK,CAAC;QAGJ,eAAU,GAAG,IAAI,YAAY,EAAW,CAAC;QAGzC,kBAAa,GAAG,IAAI,YAAY,EAAW,CAAC;KAMjD;IAEJ,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,YAAY;cAClB,IAAI,CAAC,YAAY,CAAC,aAAa;cAC/B,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;KACvC;IAED,IAAI,QAAQ;QACR,OAAO,CAAC,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,iBAAiB,CAAC,cAAc,KAAK,IAAI;cAC1E,IAAI;cACJ,IAAI,CAAC,iBAAiB,CAAC,cAAc,CAAC,QAAQ,CAAC,aAAa,CAAC;KACtE;IAED,IAAI,sBAAsB;QACtB,OAAO,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC;cACrC,IAAI,CA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OAAO,EAAE;YACL,YAAY;YACZ,iBAAiB;YACjB,kBAAkB;YAClB,mBAAmB;YACnB,iBAAiB;SACpB;QACD,YAAY,EAAE,CAAC,0BAA0B,EAAE,mCAAmC,CAAC;QAC/E,OAAO,EAAE,CAAC,0BAA0B,EAAE,mCAAmC,CAAC;KAC7E,CAAC;GACW,uBAAuB,CAAG;;ACpBvC;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-hosted-dropdown.js","sources":["ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown-connector.directive.ts","ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown.component.ts","ng://@taiga-ui/core/components/hosted-dropdown/hosted-dropdown.module.ts","ng://@taiga-ui/core/components/hosted-dropdown/taiga-ui-core-components-hosted-dropdown.ts"],"sourcesContent":["import {Directive} from '@angular/core';\n\n@Directive({\n selector: `[tuiHostedDropdownHost]`,\n})\nexport class TuiHostedDropdownConnectorDirective {}\n","import {\n ChangeDetectionStrategy,\n Component,\n ContentChild,\n ElementRef,\n EventEmitter,\n forwardRef,\n HostBinding,\n HostListener,\n Inject,\n Input,\n Output,\n ViewChild,\n} from '@angular/core';\nimport {\n getClosestFocusable,\n isElementEditable,\n isNativeFocusedIn,\n isNativeKeyboardFocusable,\n setNativeFocused,\n TUI_FOCUSABLE_ITEM_ACCESSOR,\n TuiActiveZoneDirective,\n TuiContextWithImplicit,\n tuiDefaultProp,\n TuiFocusableElementAccessor,\n TuiNativeFocusableElement,\n} from '@taiga-ui/cdk';\nimport {TuiDropdownDirective} from '@taiga-ui/core/directives/dropdown';\nimport {\n DROPDOWN_CONTROLLER_PROVIDER,\n TUI_DROPDOWN_WATCHED_CONTROLLER,\n TuiDropdownControllerDirective,\n} from '@taiga-ui/core/directives/dropdown-controller';\nimport {isEditingKey} from '@taiga-ui/core/utils/miscellaneous';\nimport {PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHostedDropdownConnectorDirective} from './hosted-dropdown-connector.directive';\n\n@Component({\n selector: `tui-hosted-dropdown`,\n templateUrl: `./hosted-dropdown.template.html`,\n styleUrls: [`./hosted-dropdown.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: TUI_FOCUSABLE_ITEM_ACCESSOR,\n useExisting: forwardRef(() => TuiHostedDropdownComponent),\n },\n DROPDOWN_CONTROLLER_PROVIDER,\n ],\n})\nexport class TuiHostedDropdownComponent implements TuiFocusableElementAccessor {\n @ContentChild(TuiHostedDropdownConnectorDirective, {read: ElementRef})\n private readonly dropdownHost?: ElementRef<HTMLElement>;\n\n @ViewChild(`wrapper`, {read: ElementRef})\n private readonly wrapper?: ElementRef<HTMLDivElement>;\n\n @ViewChild(TuiDropdownDirective)\n private readonly dropdownDirective?: TuiDropdownDirective;\n\n @Input()\n @tuiDefaultProp()\n content: PolymorpheusContent<TuiContextWithImplicit<TuiActiveZoneDirective>> = ``;\n\n @Input()\n @tuiDefaultProp()\n canOpen = true;\n\n @Input()\n @tuiDefaultProp()\n open = false;\n\n @Output()\n readonly openChange = new EventEmitter<boolean>();\n\n @Output()\n readonly focusedChange = new EventEmitter<boolean>();\n\n constructor(\n @Inject(ElementRef) private readonly elementRef: ElementRef,\n @Inject(TUI_DROPDOWN_WATCHED_CONTROLLER)\n readonly controller: TuiDropdownControllerDirective,\n ) {}\n\n get host(): HTMLElement {\n return this.dropdownHost\n ? this.dropdownHost.nativeElement\n : this.elementRef.nativeElement;\n }\n\n get dropdown(): HTMLElement | null {\n return !this.dropdownDirective || this.dropdownDirective.dropdownBoxRef === null\n ? null\n : this.dropdownDirective.dropdownBoxRef.location.nativeElement;\n }\n\n get nativeFocusableElement(): TuiNativeFocusableElement | null {\n return isNativeKeyboardFocusable(this.host)\n ? this.host\n : getClosestFocusable(this.host, false, this.elementRef.nativeElement);\n }\n\n @HostBinding(`class._hosted_dropdown_focused`)\n get focused(): boolean {\n return (\n isNativeFocusedIn(this.host) ||\n (this.open && !!this.wrapper && isNativeFocusedIn(this.wrapper.nativeElement))\n );\n }\n\n @HostListener(`focusin`, [`$event.target`])\n onFocusIn(target: HTMLElement): void {\n const host = this.dropdownHost\n ? this.dropdownHost.nativeElement\n : this.nativeFocusableElement || this.elementRef.nativeElement;\n\n if (!host.contains(target)) {\n this.updateOpen(false);\n }\n }\n\n @HostListener(`click`, [`$event.target`])\n onClick(target: HTMLElement): void {\n const host = this.nativeFocusableElement || this.host;\n const dropdownHost = this.dropdownHost ? this.dropdownHost.nativeElement : host;\n\n if (!this.hostEditable && dropdownHost.contains(target)) {\n this.updateOpen(!this.open);\n }\n }\n\n @HostListener(`keydown.esc`, [`$event`])\n onKeyDownEsc(event: Event): void {\n if (!this.canOpen || !this.open) {\n return;\n }\n\n event.stopPropagation();\n this.closeDropdown();\n }\n\n @HostListener(`keydown.arrowDown`, [`$event`, `true`])\n @HostListener(`keydown.arrowUp`, [`$event`, `false`])\n onArrow(event: KeyboardEvent, down: boolean): void {\n this.focusDropdown(event, down);\n }\n\n onKeydown({key, target, defaultPrevented}: KeyboardEvent): void {\n if (\n !defaultPrevented &&\n isEditingKey(key) &&\n this.hostEditable &&\n // TODO: iframe warning\n target instanceof HTMLElement &&\n !isElementEditable(target)\n ) {\n this.focusHost();\n }\n }\n\n onActiveZone(active: boolean): void {\n this.updateFocused(active);\n\n if (!active) {\n this.updateOpen(false);\n }\n }\n\n onHostObscured(obscured: boolean): void {\n if (obscured) {\n this.closeDropdown();\n }\n }\n\n updateOpen(open: boolean): void {\n if (open && !this.canOpen) {\n return;\n }\n\n this.open = open;\n this.openChange.emit(open);\n }\n\n private get hostEditable(): boolean {\n const host = this.nativeFocusableElement || this.host;\n\n // TODO: iframe warning\n return host instanceof HTMLElement && isElementEditable(host);\n }\n\n private focusDropdown(event: KeyboardEvent, first: boolean): void {\n const host = this.nativeFocusableElement;\n\n // TODO: iframe warning\n if (\n !host ||\n !(host instanceof HTMLElement) ||\n !(event.target instanceof Node) ||\n !host.contains(event.target)\n ) {\n return;\n }\n\n if (\n !this.wrapper ||\n !this.open ||\n this.dropdown === null ||\n // TODO: iframe warning\n !(this.wrapper.nativeElement.nextElementSibling instanceof HTMLElement)\n ) {\n this.updateOpen(true);\n\n if (!isElementEditable(host)) {\n event.preventDefault();\n }\n\n return;\n }\n\n const initial = first\n ? this.wrapper.nativeElement\n : this.wrapper.nativeElement.nextElementSibling;\n const focusable = getClosestFocusable(\n initial,\n !first,\n this.wrapper.nativeElement,\n );\n\n if (focusable === null) {\n return;\n }\n\n setNativeFocused(focusable);\n event.preventDefault();\n }\n\n private closeDropdown(): void {\n if (this.focused) {\n this.focusHost();\n }\n\n this.updateOpen(false);\n }\n\n private focusHost(): void {\n const host = this.nativeFocusableElement;\n\n if (host !== null) {\n setNativeFocused(host, true, true);\n }\n }\n\n private updateFocused(focused: boolean): void {\n this.focusedChange.emit(focused);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TuiActiveZoneModule, TuiObscuredModule} from '@taiga-ui/cdk';\nimport {TuiDropdownModule} from '@taiga-ui/core/directives/dropdown';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiHostedDropdownComponent} from './hosted-dropdown.component';\nimport {TuiHostedDropdownConnectorDirective} from './hosted-dropdown-connector.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n TuiObscuredModule,\n PolymorpheusModule,\n TuiActiveZoneModule,\n TuiDropdownModule,\n ],\n declarations: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],\n exports: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],\n})\nexport class TuiHostedDropdownModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;IAKa,mCAAmC,GAAhD,MAAa,mCAAmC;EAAG;AAAtC,mCAAmC;IAH/C,SAAS,CAAC;QACP,QAAQ,EAAE,yBAAyB;KACtC,CAAC;GACW,mCAAmC,CAAG;;;IC8CtC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,CAAC,OAAO,EAAE,CAAC,eAAe,CAAC,CAAC;yDAQxC;AAGD;IADC,YAAY,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAC;8DAQvC;AAID;IAFC,YAAY,CAAC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACrD,YAAY,CAAC,iBAAiB,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;yDAGpD;AA/FQ,0BAA0B;IAbtC,SAAS,CAAC;QACP,QAAQ,EAAE,qBAAqB;QAC/B,iqCAA8C;QAE9C,eAAe,EAAE,uBAAuB,CAAC,MAAM;QAC/C,SAAS,EAAE;YACP;gBACI,OAAO,EAAE,2BAA2B;gBACpC,WAAW,EAAE,UAAU,CAAC,MAAM,4BAA0B,CAAC;aAC5D;YACD,4BAA4B;SAC/B;;KACJ,CAAC;IA8BO,WAAA,MAAM,CAAC,UAAU,CAAC,CAAA;IAClB,WAAA,MAAM,CAAC,+BAA+B,CAAC,CAAA;GA9BnC,0BAA0B,CA6MtC;;IC5OY,uBAAuB,GAApC,MAAa,uBAAuB;EAAG;AAA1B,uBAAuB;IAXnC,QAAQ,CAAC;QACN,OAAO,EAAE;YACL,YAAY;YACZ,iBAAiB;YACjB,kBAAkB;YAClB,mBAAmB;YACnB,iBAAiB;SACpB;QACD,YAAY,EAAE,CAAC,0BAA0B,EAAE,mCAAmC,CAAC;QAC/E,OAAO,EAAE,CAAC,0BAA0B,EAAE,mCAAmC,CAAC;KAC7E,CAAC;GACW,uBAAuB,CAAG;;ACpBvC;;;;;;"}
|
|
@@ -35,13 +35,13 @@ __decorate([
|
|
|
35
35
|
TuiLabelComponent = __decorate([
|
|
36
36
|
Component({
|
|
37
37
|
selector: `label[tuiLabel]`,
|
|
38
|
-
template: "<span\n polymorpheus-outlet\n class=\"label\"\n [content]=\"label\"\n [context]=\"context\"\n>\n <ng-template let-text>\n <span class=\"text\">{{ text }}</span>\n </ng-template>\n</span>\n<span class=\"content\"><ng-content></ng-content></span>\n",
|
|
38
|
+
template: "<span\n polymorpheus-outlet\n class=\"t-label\"\n [content]=\"label\"\n [context]=\"context\"\n>\n <ng-template let-text>\n <span class=\"t-text\">{{ text }}</span>\n </ng-template>\n</span>\n<span class=\"t-content\"><ng-content></ng-content></span>\n",
|
|
39
39
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
40
40
|
providers: [MODE_PROVIDER],
|
|
41
41
|
host: {
|
|
42
42
|
'($.data-mode.attr)': `mode$`,
|
|
43
43
|
},
|
|
44
|
-
styles: [":host{display:flex;min-height:2.75rem;justify-content:space-between;flex-direction:column;pointer-events:none}.label{font:var(--tui-font-text-s);max-width:100%;align-self:inherit;overflow:inherit;pointer-events:auto}.text{display:block;overflow:inherit;text-overflow:ellipsis}:host:not(._control) .text{color:var(--tui-text-02)}:host([data-mode=onDark]) .text{color:var(--tui-text-02-night)}.content{line-height:1.5rem;overflow:inherit;text-overflow:ellipsis;pointer-events:auto}"]
|
|
44
|
+
styles: [":host{display:flex;min-height:2.75rem;justify-content:space-between;flex-direction:column;pointer-events:none}.t-label{font:var(--tui-font-text-s);max-width:100%;align-self:inherit;overflow:inherit;pointer-events:auto}.t-text{display:block;overflow:inherit;text-overflow:ellipsis}:host:not(._control) .t-text{color:var(--tui-text-02)}:host([data-mode=onDark]) .t-text{color:var(--tui-text-02-night)}.t-content{line-height:1.5rem;overflow:inherit;text-overflow:ellipsis;pointer-events:auto}"]
|
|
45
45
|
}),
|
|
46
46
|
__param(0, Inject(TUI_MODE))
|
|
47
47
|
], TuiLabelComponent);
|