@taiga-ui/kit 2.61.0 → 2.62.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-kit-components-files.umd.js +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.min.js +1 -1
- package/bundles/taiga-ui-kit-components-files.umd.min.js.map +1 -1
- package/bundles/taiga-ui-kit-components-push.umd.js +501 -0
- package/bundles/taiga-ui-kit-components-push.umd.js.map +1 -0
- package/bundles/taiga-ui-kit-components-push.umd.min.js +2 -0
- package/bundles/taiga-ui-kit-components-push.umd.min.js.map +1 -0
- package/bundles/taiga-ui-kit-components.umd.js +12 -4
- package/bundles/taiga-ui-kit-components.umd.js.map +1 -1
- package/bundles/taiga-ui-kit-components.umd.min.js +1 -1
- package/components/index.d.ts +1 -0
- package/components/push/index.d.ts +7 -0
- package/components/push/package.json +13 -0
- package/components/push/push-alert.component.d.ts +16 -0
- package/components/push/push-alert.directive.d.ts +9 -0
- package/components/push/push.component.d.ts +11 -0
- package/components/push/push.directive.d.ts +10 -0
- package/components/push/push.module.d.ts +2 -0
- package/components/push/push.options.d.ts +10 -0
- package/components/push/push.service.d.ts +10 -0
- package/components/push/taiga-ui-kit-components-push.d.ts +4 -0
- package/components/push/taiga-ui-kit-components-push.metadata.json +1 -0
- package/components/taiga-ui-kit-components.metadata.json +1 -1
- package/esm2015/components/files/file/file.component.js +3 -3
- package/esm2015/components/index.js +2 -1
- package/esm2015/components/push/index.js +8 -0
- package/esm2015/components/push/push-alert.component.js +38 -0
- package/esm2015/components/push/push-alert.directive.js +40 -0
- package/esm2015/components/push/push.component.js +46 -0
- package/esm2015/components/push/push.directive.js +42 -0
- package/esm2015/components/push/push.module.js +46 -0
- package/esm2015/components/push/push.options.js +10 -0
- package/esm2015/components/push/push.service.js +26 -0
- package/esm2015/components/push/taiga-ui-kit-components-push.js +5 -0
- package/esm5/components/files/file/file.component.js +3 -3
- package/esm5/components/index.js +2 -1
- package/esm5/components/push/index.js +8 -0
- package/esm5/components/push/push-alert.component.js +43 -0
- package/esm5/components/push/push-alert.directive.js +47 -0
- package/esm5/components/push/push.component.js +51 -0
- package/esm5/components/push/push.directive.js +50 -0
- package/esm5/components/push/push.module.js +49 -0
- package/esm5/components/push/push.options.js +10 -0
- package/esm5/components/push/push.service.js +30 -0
- package/esm5/components/push/taiga-ui-kit-components-push.js +5 -0
- package/fesm2015/taiga-ui-kit-components-files.js +2 -2
- package/fesm2015/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm2015/taiga-ui-kit-components-push.js +218 -0
- package/fesm2015/taiga-ui-kit-components-push.js.map +1 -0
- package/fesm2015/taiga-ui-kit-components.js +1 -0
- package/fesm2015/taiga-ui-kit-components.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-files.js +2 -2
- package/fesm5/taiga-ui-kit-components-files.js.map +1 -1
- package/fesm5/taiga-ui-kit-components-push.js +250 -0
- package/fesm5/taiga-ui-kit-components-push.js.map +1 -0
- package/fesm5/taiga-ui-kit-components.js +1 -0
- package/fesm5/taiga-ui-kit-components.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { __decorate, __param, __extends, __assign } from 'tslib';
|
|
2
|
+
import { EventEmitter, Inject, Input, Output, Component, ChangeDetectionStrategy, Optional, SkipSelf, Directive, TemplateRef, ChangeDetectorRef, forwardRef, HostBinding, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule } from '@angular/core';
|
|
3
|
+
import { tuiIsObserved, tuiDefaultProp, TuiDestroyService, AbstractTuiDialogService, TUI_ALERTS } from '@taiga-ui/cdk';
|
|
4
|
+
import { TUI_CLOSE_WORD, TuiModeDirective, TUI_BUTTON_OPTIONS, TUI_ANIMATION_OPTIONS, tuiFadeIn, tuiSlideInRight, tuiHeightCollapse, TuiButtonModule, TuiLinkModule, TuiSvgModule, TuiFormatDatePipeModule } from '@taiga-ui/core';
|
|
5
|
+
import { Observable, Subject, EMPTY } from 'rxjs';
|
|
6
|
+
import { CommonModule } from '@angular/common';
|
|
7
|
+
import { PolymorpheusTemplate, POLYMORPHEUS_CONTEXT, PolymorpheusComponent, PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
8
|
+
import { switchMap, takeUntil } from 'rxjs/operators';
|
|
9
|
+
import { TuiIdService } from '@taiga-ui/cdk/services';
|
|
10
|
+
|
|
11
|
+
var TuiPushComponent = /** @class */ (function () {
|
|
12
|
+
function TuiPushComponent(closeWord$) {
|
|
13
|
+
this.closeWord$ = closeWord$;
|
|
14
|
+
this.heading = "";
|
|
15
|
+
this.type = "";
|
|
16
|
+
this.timestamp = 0;
|
|
17
|
+
this.close = new EventEmitter();
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(TuiPushComponent.prototype, "closeable", {
|
|
20
|
+
get: function () {
|
|
21
|
+
return tuiIsObserved(this.close);
|
|
22
|
+
},
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true
|
|
25
|
+
});
|
|
26
|
+
TuiPushComponent.ctorParameters = function () { return [
|
|
27
|
+
{ type: Observable, decorators: [{ type: Inject, args: [TUI_CLOSE_WORD,] }] }
|
|
28
|
+
]; };
|
|
29
|
+
__decorate([
|
|
30
|
+
Input(),
|
|
31
|
+
tuiDefaultProp()
|
|
32
|
+
], TuiPushComponent.prototype, "heading", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
Input(),
|
|
35
|
+
tuiDefaultProp()
|
|
36
|
+
], TuiPushComponent.prototype, "type", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
Input(),
|
|
39
|
+
tuiDefaultProp()
|
|
40
|
+
], TuiPushComponent.prototype, "timestamp", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
Output()
|
|
43
|
+
], TuiPushComponent.prototype, "close", void 0);
|
|
44
|
+
TuiPushComponent = __decorate([
|
|
45
|
+
Component({
|
|
46
|
+
selector: "tui-push",
|
|
47
|
+
template: "<div class=\"t-image\"><ng-content select=\"img\"></ng-content></div>\n<button\n *ngIf=\"closeable\"\n tuiIconButton\n icon=\"tuiIconCloseLarge\"\n size=\"xs\"\n appearance=\"\"\n shape=\"rounded\"\n class=\"t-close\"\n [title]=\"closeWord$ | async\"\n (click)=\"close.emit()\"\n></button>\n<div class=\"t-top\">\n <span class=\"t-icon\"><ng-content select=\"tui-svg\"></ng-content></span>\n {{ type }}\n <span\n *ngIf=\"timestamp\"\n class=\"t-time\"\n [textContent]=\"timestamp | tuiFormatDate | async\"\n ></span>\n</div>\n<h3 class=\"t-heading\">{{ heading }}</h3>\n<div class=\"t-content\">\n <ng-content></ng-content>\n</div>\n<div class=\"t-actions\">\n <span class=\"t-button\"><ng-content select=\"[tuiButton]\"></ng-content></span>\n <span class=\"t-link\"><ng-content select=\"[tuiLink]\"></ng-content></span>\n</div>\n",
|
|
48
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
49
|
+
styles: [":host{box-shadow:0 .25rem 1.5rem rgba(0,0,0,.12);position:relative;display:block;width:22.5rem;max-width:100%;box-sizing:border-box;padding:1.25rem 1.25rem .25rem;overflow:hidden;font:var(--tui-font-text-m);border-radius:var(--tui-radius-l);background:var(--tui-elevation-02)}.t-image{display:flex;flex-direction:column;max-height:10.625rem;overflow:hidden;margin:-1.25rem -1.25rem 1.25rem}.t-close{position:absolute;top:.75rem;right:.75rem;color:rgba(0,0,0,.54);background:rgba(242,242,242,.32);-webkit-backdrop-filter:blur(1rem);backdrop-filter:blur(1rem)}.t-top{display:flex;align-items:center;font:var(--tui-font-text-s);color:var(--tui-text-02)}.t-icon{height:1.25rem;margin-right:.5rem;transform:scale(.833);transform-origin:top left;color:var(--tui-link)}.t-time:before{content:'\u2022';display:inline-block;width:1rem;text-align:center}.t-heading{line-height:1.25rem;font-weight:700;margin:.75rem 0 .25rem}.t-content,.t-heading{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;word-break:break-word;overflow:hidden}.t-actions{display:flex;align-items:center;font:var(--tui-font-text-s)}.t-button:not(:empty){margin:.75rem .75rem .75rem 0}.t-link{margin:.75rem 0}.t-link:empty{margin:.5rem}"]
|
|
50
|
+
}),
|
|
51
|
+
__param(0, Inject(TUI_CLOSE_WORD))
|
|
52
|
+
], TuiPushComponent);
|
|
53
|
+
return TuiPushComponent;
|
|
54
|
+
}());
|
|
55
|
+
|
|
56
|
+
var TuiPushDirective = /** @class */ (function (_super) {
|
|
57
|
+
__extends(TuiPushDirective, _super);
|
|
58
|
+
function TuiPushDirective(modeDirective) {
|
|
59
|
+
var _a;
|
|
60
|
+
var _this = _super.call(this) || this;
|
|
61
|
+
_this.modeDirective = modeDirective;
|
|
62
|
+
_this.size = "s";
|
|
63
|
+
_this.shape = null;
|
|
64
|
+
_this.change$ = ((_a = _this.modeDirective) === null || _a === void 0 ? void 0 : _a.change$) || new Subject();
|
|
65
|
+
return _this;
|
|
66
|
+
}
|
|
67
|
+
TuiPushDirective_1 = TuiPushDirective;
|
|
68
|
+
Object.defineProperty(TuiPushDirective.prototype, "appearance", {
|
|
69
|
+
get: function () {
|
|
70
|
+
var _a;
|
|
71
|
+
return ((_a = this.modeDirective) === null || _a === void 0 ? void 0 : _a.mode) === "onDark" ? "accent" : "secondary";
|
|
72
|
+
},
|
|
73
|
+
enumerable: true,
|
|
74
|
+
configurable: true
|
|
75
|
+
});
|
|
76
|
+
var TuiPushDirective_1;
|
|
77
|
+
TuiPushDirective.ctorParameters = function () { return [
|
|
78
|
+
{ type: TuiModeDirective, decorators: [{ type: Optional }, { type: SkipSelf }, { type: Inject, args: [TuiModeDirective,] }] }
|
|
79
|
+
]; };
|
|
80
|
+
TuiPushDirective = TuiPushDirective_1 = __decorate([
|
|
81
|
+
Directive({
|
|
82
|
+
selector: "tui-push",
|
|
83
|
+
providers: [
|
|
84
|
+
{
|
|
85
|
+
provide: TuiModeDirective,
|
|
86
|
+
useExisting: TuiPushDirective_1,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
provide: TUI_BUTTON_OPTIONS,
|
|
90
|
+
useExisting: TuiPushDirective_1,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
}),
|
|
94
|
+
__param(0, Optional()),
|
|
95
|
+
__param(0, SkipSelf()),
|
|
96
|
+
__param(0, Inject(TuiModeDirective))
|
|
97
|
+
], TuiPushDirective);
|
|
98
|
+
return TuiPushDirective;
|
|
99
|
+
}(TuiModeDirective));
|
|
100
|
+
|
|
101
|
+
var TUI_PUSH_DEFAULT_OPTIONS = {
|
|
102
|
+
heading: "",
|
|
103
|
+
type: "",
|
|
104
|
+
timestamp: 0,
|
|
105
|
+
image: "",
|
|
106
|
+
icon: "",
|
|
107
|
+
iconColor: "",
|
|
108
|
+
buttons: [],
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
var TuiPushAlertDirective = /** @class */ (function (_super) {
|
|
112
|
+
__extends(TuiPushAlertDirective, _super);
|
|
113
|
+
function TuiPushAlertDirective(template, changeDetectorRef, destroy$, push) {
|
|
114
|
+
var _this = _super.call(this, template, changeDetectorRef) || this;
|
|
115
|
+
_this.show$ = new Subject();
|
|
116
|
+
_this.show$
|
|
117
|
+
.pipe(switchMap(function (show) { return (show ? push.open(_this) : EMPTY); }), takeUntil(destroy$))
|
|
118
|
+
.subscribe();
|
|
119
|
+
return _this;
|
|
120
|
+
}
|
|
121
|
+
Object.defineProperty(TuiPushAlertDirective.prototype, "tuiPush", {
|
|
122
|
+
set: function (show) {
|
|
123
|
+
this.show$.next(show);
|
|
124
|
+
},
|
|
125
|
+
enumerable: true,
|
|
126
|
+
configurable: true
|
|
127
|
+
});
|
|
128
|
+
TuiPushAlertDirective.ctorParameters = function () { return [
|
|
129
|
+
{ type: TemplateRef, decorators: [{ type: Inject, args: [TemplateRef,] }] },
|
|
130
|
+
{ type: ChangeDetectorRef, decorators: [{ type: Inject, args: [ChangeDetectorRef,] }] },
|
|
131
|
+
{ type: Observable, decorators: [{ type: Inject, args: [TuiDestroyService,] }] },
|
|
132
|
+
{ type: TuiPushService, decorators: [{ type: Inject, args: [forwardRef(function () { return TuiPushService; }),] }] }
|
|
133
|
+
]; };
|
|
134
|
+
__decorate([
|
|
135
|
+
Input()
|
|
136
|
+
], TuiPushAlertDirective.prototype, "tuiPush", null);
|
|
137
|
+
TuiPushAlertDirective = __decorate([
|
|
138
|
+
Directive({
|
|
139
|
+
selector: "[tuiPush]",
|
|
140
|
+
providers: [TuiDestroyService],
|
|
141
|
+
}),
|
|
142
|
+
__param(0, Inject(TemplateRef)),
|
|
143
|
+
__param(1, Inject(ChangeDetectorRef)),
|
|
144
|
+
__param(2, Inject(TuiDestroyService)),
|
|
145
|
+
__param(3, Inject(forwardRef(function () { return TuiPushService; })))
|
|
146
|
+
], TuiPushAlertDirective);
|
|
147
|
+
return TuiPushAlertDirective;
|
|
148
|
+
}(PolymorpheusTemplate));
|
|
149
|
+
|
|
150
|
+
var TuiPushAlertComponent = /** @class */ (function () {
|
|
151
|
+
function TuiPushAlertComponent(options, context) {
|
|
152
|
+
this.options = options;
|
|
153
|
+
this.context = context;
|
|
154
|
+
this.animation = __assign({ value: "" }, this.options);
|
|
155
|
+
}
|
|
156
|
+
Object.defineProperty(TuiPushAlertComponent.prototype, "isDirective", {
|
|
157
|
+
get: function () {
|
|
158
|
+
return this.context.content instanceof TuiPushAlertDirective;
|
|
159
|
+
},
|
|
160
|
+
enumerable: true,
|
|
161
|
+
configurable: true
|
|
162
|
+
});
|
|
163
|
+
TuiPushAlertComponent.ctorParameters = function () { return [
|
|
164
|
+
{ type: undefined, decorators: [{ type: Inject, args: [TUI_ANIMATION_OPTIONS,] }] },
|
|
165
|
+
{ type: undefined, decorators: [{ type: Inject, args: [POLYMORPHEUS_CONTEXT,] }] }
|
|
166
|
+
]; };
|
|
167
|
+
__decorate([
|
|
168
|
+
HostBinding("@tuiFadeIn"),
|
|
169
|
+
HostBinding("@tuiSlideInRight"),
|
|
170
|
+
HostBinding("@tuiHeightCollapse")
|
|
171
|
+
], TuiPushAlertComponent.prototype, "animation", void 0);
|
|
172
|
+
TuiPushAlertComponent = __decorate([
|
|
173
|
+
Component({
|
|
174
|
+
selector: "tui-push-alert",
|
|
175
|
+
template: "<tui-push\n *ngIf=\"!isDirective; else content\"\n [heading]=\"context.heading\"\n [type]=\"context.type\"\n [timestamp]=\"context.timestamp\"\n (close)=\"context.$implicit.complete()\"\n>\n <img\n *ngIf=\"context.image\"\n alt=\"\"\n [src]=\"context.image\"\n />\n <tui-svg\n *ngIf=\"context.icon\"\n [style.color]=\"context.iconColor\"\n [src]=\"context.icon\"\n ></tui-svg>\n <div\n polymorpheus-outlet\n [content]=\"context.content\"\n ></div>\n <button\n *ngIf=\"context.buttons.length > 1\"\n tuiButton\n (click)=\"context.$implicit.next(context.buttons[0])\"\n >\n {{ context.buttons[0] }}\n </button>\n <button\n *ngIf=\"context.buttons.length\"\n tuiLink\n (click)=\"context.$implicit.next(context.buttons[context.buttons.length - 1])\"\n >\n {{ context.buttons[context.buttons.length - 1] }}\n </button>\n</tui-push>\n<ng-template #content>\n <div\n polymorpheus-outlet\n [content]=\"context.content\"\n ></div>\n</ng-template>\n",
|
|
176
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
177
|
+
animations: [tuiFadeIn, tuiSlideInRight, tuiHeightCollapse],
|
|
178
|
+
host: { role: "alert" },
|
|
179
|
+
styles: [":host{max-width:calc(100% - 2rem);margin:0 1rem 1rem auto}:host:first-child{margin-top:auto}"]
|
|
180
|
+
}),
|
|
181
|
+
__param(0, Inject(TUI_ANIMATION_OPTIONS)),
|
|
182
|
+
__param(1, Inject(POLYMORPHEUS_CONTEXT))
|
|
183
|
+
], TuiPushAlertComponent);
|
|
184
|
+
return TuiPushAlertComponent;
|
|
185
|
+
}());
|
|
186
|
+
|
|
187
|
+
var TuiPushService = /** @class */ (function (_super) {
|
|
188
|
+
__extends(TuiPushService, _super);
|
|
189
|
+
function TuiPushService() {
|
|
190
|
+
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
191
|
+
_this.component = new PolymorpheusComponent(TuiPushAlertComponent);
|
|
192
|
+
_this.defaultOptions = TUI_PUSH_DEFAULT_OPTIONS;
|
|
193
|
+
return _this;
|
|
194
|
+
}
|
|
195
|
+
// TODO: fix types
|
|
196
|
+
// @ts-ignore
|
|
197
|
+
TuiPushService.prototype.open = function (content, options) {
|
|
198
|
+
if (options === void 0) { options = {}; }
|
|
199
|
+
return _super.prototype.open.call(this, content, options);
|
|
200
|
+
};
|
|
201
|
+
TuiPushService.ɵprov = ɵɵdefineInjectable({ factory: function TuiPushService_Factory() { return new TuiPushService(ɵɵinject(TuiIdService)); }, token: TuiPushService, providedIn: "root" });
|
|
202
|
+
TuiPushService = __decorate([
|
|
203
|
+
Injectable({ providedIn: "root" })
|
|
204
|
+
], TuiPushService);
|
|
205
|
+
return TuiPushService;
|
|
206
|
+
}(AbstractTuiDialogService));
|
|
207
|
+
|
|
208
|
+
var TuiPushModule = /** @class */ (function () {
|
|
209
|
+
function TuiPushModule() {
|
|
210
|
+
}
|
|
211
|
+
TuiPushModule = __decorate([
|
|
212
|
+
NgModule({
|
|
213
|
+
imports: [
|
|
214
|
+
CommonModule,
|
|
215
|
+
PolymorpheusModule,
|
|
216
|
+
TuiButtonModule,
|
|
217
|
+
TuiLinkModule,
|
|
218
|
+
TuiSvgModule,
|
|
219
|
+
TuiFormatDatePipeModule,
|
|
220
|
+
],
|
|
221
|
+
declarations: [
|
|
222
|
+
TuiPushComponent,
|
|
223
|
+
TuiPushDirective,
|
|
224
|
+
TuiPushAlertComponent,
|
|
225
|
+
TuiPushAlertDirective,
|
|
226
|
+
],
|
|
227
|
+
exports: [
|
|
228
|
+
TuiPushComponent,
|
|
229
|
+
TuiPushDirective,
|
|
230
|
+
TuiPushAlertComponent,
|
|
231
|
+
TuiPushAlertDirective,
|
|
232
|
+
],
|
|
233
|
+
providers: [
|
|
234
|
+
{
|
|
235
|
+
provide: TUI_ALERTS,
|
|
236
|
+
useExisting: TuiPushService,
|
|
237
|
+
multi: true,
|
|
238
|
+
},
|
|
239
|
+
],
|
|
240
|
+
})
|
|
241
|
+
], TuiPushModule);
|
|
242
|
+
return TuiPushModule;
|
|
243
|
+
}());
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Generated bundle index. Do not edit.
|
|
247
|
+
*/
|
|
248
|
+
|
|
249
|
+
export { TUI_PUSH_DEFAULT_OPTIONS, TuiPushAlertComponent, TuiPushAlertDirective, TuiPushComponent, TuiPushDirective, TuiPushModule, TuiPushService };
|
|
250
|
+
//# sourceMappingURL=taiga-ui-kit-components-push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components-push.js","sources":["ng://@taiga-ui/kit/components/push/push.component.ts","ng://@taiga-ui/kit/components/push/push.directive.ts","ng://@taiga-ui/kit/components/push/push.options.ts","ng://@taiga-ui/kit/components/push/push-alert.directive.ts","ng://@taiga-ui/kit/components/push/push-alert.component.ts","ng://@taiga-ui/kit/components/push/push.service.ts","ng://@taiga-ui/kit/components/push/push.module.ts","ng://@taiga-ui/kit/components/push/taiga-ui-kit-components-push.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Inject,\n Input,\n Output,\n} from '@angular/core';\nimport {tuiDefaultProp, tuiIsObserved} from '@taiga-ui/cdk';\nimport {TUI_CLOSE_WORD} from '@taiga-ui/core';\nimport {Observable} from 'rxjs';\n\n@Component({\n selector: `tui-push`,\n templateUrl: `./push.template.html`,\n styleUrls: [`./push.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiPushComponent {\n @Input()\n @tuiDefaultProp()\n heading = ``;\n\n @Input()\n @tuiDefaultProp()\n type = ``;\n\n @Input()\n @tuiDefaultProp()\n timestamp = 0;\n\n @Output()\n readonly close = new EventEmitter<void>();\n\n constructor(@Inject(TUI_CLOSE_WORD) readonly closeWord$: Observable<string>) {}\n\n get closeable(): boolean {\n return tuiIsObserved(this.close);\n }\n}\n","import {Directive, Inject, Optional, SkipSelf} from '@angular/core';\nimport {TUI_BUTTON_OPTIONS, TuiButtonOptions, TuiModeDirective} from '@taiga-ui/core';\nimport {Subject} from 'rxjs';\n\n@Directive({\n selector: `tui-push`,\n providers: [\n {\n provide: TuiModeDirective,\n useExisting: TuiPushDirective,\n },\n {\n provide: TUI_BUTTON_OPTIONS,\n useExisting: TuiPushDirective,\n },\n ],\n})\nexport class TuiPushDirective extends TuiModeDirective implements TuiButtonOptions {\n size: TuiButtonOptions['size'] = `s`;\n\n shape = null;\n\n readonly change$ = this.modeDirective?.change$ || new Subject();\n\n constructor(\n @Optional()\n @SkipSelf()\n @Inject(TuiModeDirective)\n private readonly modeDirective: TuiModeDirective | null,\n ) {\n super();\n }\n\n get appearance(): string {\n return this.modeDirective?.mode === `onDark` ? `accent` : `secondary`;\n }\n}\n","export interface TuiPushOptions {\n readonly heading: string;\n readonly type: string;\n readonly timestamp: number;\n readonly image: string;\n readonly icon: string;\n readonly iconColor: string;\n readonly buttons: readonly string[];\n}\n\nexport const TUI_PUSH_DEFAULT_OPTIONS: TuiPushOptions = {\n heading: ``,\n type: ``,\n timestamp: 0,\n image: ``,\n icon: ``,\n iconColor: ``,\n buttons: [],\n};\n","import {\n ChangeDetectorRef,\n Directive,\n forwardRef,\n Inject,\n Input,\n TemplateRef,\n} from '@angular/core';\nimport {TuiDestroyService} from '@taiga-ui/cdk';\nimport {PolymorpheusTemplate} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, Observable, Subject} from 'rxjs';\nimport {switchMap, takeUntil} from 'rxjs/operators';\n\nimport {TuiPushService} from './push.service';\n\n@Directive({\n selector: `[tuiPush]`,\n providers: [TuiDestroyService],\n})\nexport class TuiPushAlertDirective extends PolymorpheusTemplate<any> {\n private readonly show$ = new Subject<boolean>();\n\n @Input()\n set tuiPush(show: boolean) {\n this.show$.next(show);\n }\n\n constructor(\n @Inject(TemplateRef) template: TemplateRef<any>,\n @Inject(ChangeDetectorRef) changeDetectorRef: ChangeDetectorRef,\n @Inject(TuiDestroyService) destroy$: Observable<unknown>,\n @Inject(forwardRef(() => TuiPushService)) push: TuiPushService,\n ) {\n super(template, changeDetectorRef);\n\n this.show$\n .pipe(\n switchMap(show => (show ? push.open(this) : EMPTY)),\n takeUntil(destroy$),\n )\n .subscribe();\n }\n}\n","import {AnimationOptions} from '@angular/animations';\nimport {ChangeDetectionStrategy, Component, HostBinding, Inject} from '@angular/core';\nimport {TuiDialog} from '@taiga-ui/cdk';\nimport {\n TUI_ANIMATION_OPTIONS,\n tuiFadeIn,\n tuiHeightCollapse,\n tuiSlideInRight,\n} from '@taiga-ui/core';\nimport {POLYMORPHEUS_CONTEXT} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiPushOptions} from './push.options';\nimport {TuiPushAlertDirective} from './push-alert.directive';\n\n@Component({\n selector: `tui-push-alert`,\n templateUrl: `./push-alert.template.html`,\n styleUrls: [`./push-alert.style.less`],\n changeDetection: ChangeDetectionStrategy.OnPush,\n animations: [tuiFadeIn, tuiSlideInRight, tuiHeightCollapse],\n host: {role: `alert`},\n})\nexport class TuiPushAlertComponent {\n @HostBinding(`@tuiFadeIn`)\n @HostBinding(`@tuiSlideInRight`)\n @HostBinding(`@tuiHeightCollapse`)\n readonly animation = {value: ``, ...this.options} as const;\n\n constructor(\n @Inject(TUI_ANIMATION_OPTIONS) private readonly options: AnimationOptions,\n @Inject(POLYMORPHEUS_CONTEXT)\n readonly context: TuiDialog<TuiPushOptions, string>,\n ) {}\n\n get isDirective(): boolean {\n return this.context.content instanceof TuiPushAlertDirective;\n }\n}\n","import {Injectable} from '@angular/core';\nimport {AbstractTuiDialogService, TuiBaseDialogContext} from '@taiga-ui/cdk';\nimport {PolymorpheusComponent, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\nimport {TUI_PUSH_DEFAULT_OPTIONS, TuiPushOptions} from './push.options';\nimport {TuiPushAlertComponent} from './push-alert.component';\n\n@Injectable({providedIn: `root`})\nexport class TuiPushService extends AbstractTuiDialogService<TuiPushOptions> {\n protected readonly component = new PolymorpheusComponent(TuiPushAlertComponent);\n protected readonly defaultOptions = TUI_PUSH_DEFAULT_OPTIONS;\n\n // TODO: fix types\n // @ts-ignore\n open(\n content: PolymorpheusContent<TuiBaseDialogContext<string> & TuiPushOptions>,\n options: Partial<TuiPushOptions> = {},\n ): Observable<string> {\n return super.open(content, options);\n }\n}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TUI_ALERTS} from '@taiga-ui/cdk';\nimport {\n TuiButtonModule,\n TuiFormatDatePipeModule,\n TuiLinkModule,\n TuiSvgModule,\n} from '@taiga-ui/core';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiPushComponent} from './push.component';\nimport {TuiPushDirective} from './push.directive';\nimport {TuiPushService} from './push.service';\nimport {TuiPushAlertComponent} from './push-alert.component';\nimport {TuiPushAlertDirective} from './push-alert.directive';\n\n@NgModule({\n imports: [\n CommonModule,\n PolymorpheusModule,\n TuiButtonModule,\n TuiLinkModule,\n TuiSvgModule,\n TuiFormatDatePipeModule,\n ],\n declarations: [\n TuiPushComponent,\n TuiPushDirective,\n TuiPushAlertComponent,\n TuiPushAlertDirective,\n ],\n exports: [\n TuiPushComponent,\n TuiPushDirective,\n TuiPushAlertComponent,\n TuiPushAlertDirective,\n ],\n providers: [\n {\n provide: TUI_ALERTS,\n useExisting: TuiPushService,\n multi: true,\n },\n ],\n})\nexport class TuiPushModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;IAkCI,0BAA6C,UAA8B;QAA9B,eAAU,GAAV,UAAU,CAAoB;QAb3E,YAAO,GAAG,EAAE,CAAC;QAIb,SAAI,GAAG,EAAE,CAAC;QAIV,cAAS,GAAG,CAAC,CAAC;QAGL,UAAK,GAAG,IAAI,YAA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BAAwB,CAAC;;KAUhE;;;IANG,6BAAI,GAAJ,UACI,OAA2E,EAC3E,OAAqC;QAArC,wBAAA,EAAA,YAAqC;QAErC,OAAO,iBAAM,IAAI,YAAC,OAAO,EAAE,OAAO,CAAC,CAAC;KACvC;;IAXQ,cAAc;QAD1B,UAAU,CAAC,EAAC,UAAU,EAAE,MAAM,EAAC,CAAC;OACpB,cAAc,CAY1B;yBArBD;CAqBC,CAZmC,wBAAwB;;;ICqC5D;KAA6B;IAAhB,aAAa;QA7BzB,QAAQ,CAAC;YACN,OAAO,EAAE;gBACL,YAAY;gBACZ,kBAAkB;gBAClB,eAAe;gBACf,aAAa;gBACb,YAAY;gBACZ,uBAAuB;aAC1B;YACD,YAAY,EAAE;gBACV,gBAAgB;gBAChB,gBAAgB;gBAChB,qBAAqB;gBACrB,qBAAqB;aACxB;YACD,OAAO,EAAE;gBACL,gBAAgB;gBAChB,gBAAgB;gBAChB,qBAAqB;gBACrB,qBAAqB;aACxB;YACD,SAAS,EAAE;gBACP;oBACI,OAAO,EAAE,UAAU;oBACnB,WAAW,EAAE,cAAc;oBAC3B,KAAK,EAAE,IAAI;iBACd;aACJ;SACJ,CAAC;OACW,aAAa,CAAG;IAAD,oBAAC;CAA7B;;AC9CA;;;;;;"}
|
|
@@ -43,6 +43,7 @@ export * from '@taiga-ui/kit/components/multi-select-option';
|
|
|
43
43
|
export * from '@taiga-ui/kit/components/pagination';
|
|
44
44
|
export * from '@taiga-ui/kit/components/pdf-viewer';
|
|
45
45
|
export * from '@taiga-ui/kit/components/progress';
|
|
46
|
+
export * from '@taiga-ui/kit/components/push';
|
|
46
47
|
export * from '@taiga-ui/kit/components/radio';
|
|
47
48
|
export * from '@taiga-ui/kit/components/radio-block';
|
|
48
49
|
export * from '@taiga-ui/kit/components/radio-group';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-kit-components.js","sources":["ng://@taiga-ui/kit/components/taiga-ui-kit-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taiga-ui-kit-components.js","sources":["ng://@taiga-ui/kit/components/taiga-ui-kit-components.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taiga-ui/kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.62.0",
|
|
4
4
|
"description": "Taiga UI Angular main components kit",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@angular/router": ">=9.0.0",
|
|
25
25
|
"@ng-web-apis/common": ">=1.12.1 < 2",
|
|
26
26
|
"@ng-web-apis/mutation-observer": ">=1.1.0 < 2",
|
|
27
|
-
"@taiga-ui/cdk": ">=2.
|
|
28
|
-
"@taiga-ui/core": ">=2.
|
|
29
|
-
"@taiga-ui/i18n": ">=2.
|
|
27
|
+
"@taiga-ui/cdk": ">=2.62.0",
|
|
28
|
+
"@taiga-ui/core": ">=2.62.0",
|
|
29
|
+
"@taiga-ui/i18n": ">=2.62.0",
|
|
30
30
|
"@tinkoff/ng-polymorpheus": ">=3.1.12 < 4",
|
|
31
31
|
"rxjs": ">=6.0.0"
|
|
32
32
|
},
|