@taiga-ui/addon-mobile 3.66.0 → 3.67.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-addon-mobile-components-mobile-calendar.umd.js +4 -4
- package/bundles/taiga-ui-addon-mobile-components-mobile-calendar.umd.js.map +1 -1
- package/bundles/taiga-ui-addon-mobile-components-sheet.umd.js +73 -67
- package/bundles/taiga-ui-addon-mobile-components-sheet.umd.js.map +1 -1
- package/components/sheet/components/sheet/sheet.component.d.ts +3 -2
- package/components/sheet/ios.hacks.d.ts +0 -1
- package/esm2015/components/mobile-calendar/mobile-calendar.component.js +6 -6
- package/esm2015/components/sheet/components/sheet/sheet.component.js +22 -8
- package/esm2015/components/sheet/directives/sheet-stop/sheet-stop.directive.js +7 -3
- package/esm2015/components/sheet/ios.hacks.js +1 -10
- package/fesm2015/taiga-ui-addon-mobile-components-mobile-calendar.js +6 -6
- package/fesm2015/taiga-ui-addon-mobile-components-mobile-calendar.js.map +1 -1
- package/fesm2015/taiga-ui-addon-mobile-components-sheet.js +43 -35
- package/fesm2015/taiga-ui-addon-mobile-components-sheet.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk'), require('@taiga-ui/core'), require('@taiga-ui/kit'), require('rxjs
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@taiga-ui/addon-mobile/components/sheet', ['exports', '@angular/core', '@taiga-ui/cdk', '@taiga-ui/core', '@taiga-ui/kit', 'rxjs
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-mobile"] = global["taiga-ui"]["addon-mobile"] || {}, global["taiga-ui"]["addon-mobile"].components = global["taiga-ui"]["addon-mobile"].components || {}, global["taiga-ui"]["addon-mobile"].components.sheet = {}), global.ng.core, global.i3, global.i1
|
|
5
|
-
})(this, (function (exports, i0, i3, i1
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@taiga-ui/cdk'), require('@taiga-ui/core'), require('@taiga-ui/kit'), require('rxjs'), require('rxjs/operators'), require('@angular/common'), require('@ng-web-apis/common'), require('@tinkoff/ng-polymorpheus')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@taiga-ui/addon-mobile/components/sheet', ['exports', '@angular/core', '@taiga-ui/cdk', '@taiga-ui/core', '@taiga-ui/kit', 'rxjs', 'rxjs/operators', '@angular/common', '@ng-web-apis/common', '@tinkoff/ng-polymorpheus'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["taiga-ui"] = global["taiga-ui"] || {}, global["taiga-ui"]["addon-mobile"] = global["taiga-ui"]["addon-mobile"] || {}, global["taiga-ui"]["addon-mobile"].components = global["taiga-ui"]["addon-mobile"].components || {}, global["taiga-ui"]["addon-mobile"].components.sheet = {}), global.ng.core, global.i3, global.i1, global.kit, global.rxjs, global.rxjs.operators, global.ng.common, global.common, global.i5));
|
|
5
|
+
})(this, (function (exports, i0, i3, i1, kit, i1$1, operators, i2, common, i5) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
26
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
27
|
-
var i1__namespace = /*#__PURE__*/_interopNamespace(i1
|
|
28
|
-
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1);
|
|
27
|
+
var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
|
|
28
|
+
var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
|
|
29
29
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
30
30
|
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
31
31
|
|
|
@@ -347,37 +347,6 @@
|
|
|
347
347
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
351
|
-
function iosScrollFactory(element, doc, zone) {
|
|
352
|
-
var load$ = i3.tuiTypedFromEvent(element, 'load', { capture: true });
|
|
353
|
-
var touchstart$ = i3.tuiTypedFromEvent(element, 'touchstart', { passive: true });
|
|
354
|
-
var touchmove$ = i3.tuiTypedFromEvent(doc, 'touchmove', { passive: true });
|
|
355
|
-
var touchend$ = i3.tuiTypedFromEvent(doc, 'touchend');
|
|
356
|
-
var scroll$ = i3.tuiTypedFromEvent(element, 'scroll').pipe(operators.map(function () { return element.scrollTop; }));
|
|
357
|
-
var result$ = i1.merge(load$.pipe(operators.delay(0), operators.map(function () { return element.scrollTop; })), touchstart$.pipe(operators.switchMap(function (_a) {
|
|
358
|
-
var touches = _a.touches;
|
|
359
|
-
var screenY = touches[0].screenY;
|
|
360
|
-
var scrollTop = element.scrollTop;
|
|
361
|
-
return i1.concat(
|
|
362
|
-
// Sometimes touch is triggered without scroll in iOS, filter that
|
|
363
|
-
i1.zip(touchmove$, scroll$).pipe(operators.map(function (_a) {
|
|
364
|
-
var _b = __read(_a, 1), touches = _b[0].touches;
|
|
365
|
-
return scrollTop + screenY - touches[0].screenY;
|
|
366
|
-
}), operators.takeUntil(touchend$)), scroll$);
|
|
367
|
-
})));
|
|
368
|
-
return i1.concat(scroll$.pipe(operators.take(1)), result$).pipe(i3.tuiZonefree(zone), operators.share());
|
|
369
|
-
}
|
|
370
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
371
|
-
function fakeSmoothScroll(_a, offset) {
|
|
372
|
-
var style = _a.style;
|
|
373
|
-
style.transition = 'none';
|
|
374
|
-
style.transform = "scaleX(-1) translate3d(0, " + offset + "px, 0)";
|
|
375
|
-
setTimeout(function () {
|
|
376
|
-
style.transition = '';
|
|
377
|
-
style.transform = '';
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
|
|
381
350
|
/**
|
|
382
351
|
* Sheet main component
|
|
383
352
|
*/
|
|
@@ -409,7 +378,7 @@
|
|
|
409
378
|
};
|
|
410
379
|
return TuiSheetHeadingComponent;
|
|
411
380
|
}());
|
|
412
|
-
TuiSheetHeadingComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetHeadingComponent, deps: [{ token: i3.TuiIdService }, { token: i0.ElementRef }, { token: i1
|
|
381
|
+
TuiSheetHeadingComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetHeadingComponent, deps: [{ token: i3.TuiIdService }, { token: i0.ElementRef }, { token: i1.TUI_CLOSE_WORD }, { token: i1.TUI_COMMON_ICONS }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
413
382
|
TuiSheetHeadingComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiSheetHeadingComponent, selector: "[tuiSheetHeading]", ngImport: i0__namespace, template: "<button\n appearance=\"icon\"\n size=\"xs\"\n tuiIconButton\n type=\"button\"\n class=\"t-close\"\n [icon]=\"icons.close\"\n [title]=\"closeWord$ | async\"\n (click)=\"onClick()\"\n></button>\n<span [id]=\"id\">\n <ng-content></ng-content>\n</span>\n", styles: [":host{position:-webkit-sticky;position:sticky;top:0;z-index:1;min-height:2rem;box-sizing:border-box;margin:-1.25rem -1rem 0;padding:1.5rem 1rem 1rem;background:var(--tui-elevation-01);border-radius:.75rem .75rem 0 0;font:var(--tui-font-heading-6);box-shadow:inset 0 1px #ffffff40}:host:after{content:\"\";position:absolute;top:100%;left:0;right:0;height:1px;background:var(--tui-base-03);opacity:0}:host :host-context(._stuck):after{opacity:1}.t-close{display:none;float:right;margin-right:-.25rem}:host-context(.t-wrapper_closeable) .t-close{display:block}\n"], components: [{ type: i1__namespace.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], pipes: { "async": i2__namespace.AsyncPipe }, changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
414
383
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetHeadingComponent, decorators: [{
|
|
415
384
|
type: i0.Component,
|
|
@@ -428,20 +397,41 @@
|
|
|
428
397
|
args: [i0.ElementRef]
|
|
429
398
|
}] }, { type: i1__namespace$1.Observable, decorators: [{
|
|
430
399
|
type: i0.Inject,
|
|
431
|
-
args: [i1
|
|
400
|
+
args: [i1.TUI_CLOSE_WORD]
|
|
432
401
|
}] }, { type: undefined, decorators: [{
|
|
433
402
|
type: i0.Inject,
|
|
434
|
-
args: [i1
|
|
403
|
+
args: [i1.TUI_COMMON_ICONS]
|
|
435
404
|
}] }];
|
|
436
405
|
} });
|
|
437
406
|
|
|
407
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
408
|
+
function iosScrollFactory(element, doc, zone) {
|
|
409
|
+
var load$ = i3.tuiTypedFromEvent(element, 'load', { capture: true });
|
|
410
|
+
var touchstart$ = i3.tuiTypedFromEvent(element, 'touchstart', { passive: true });
|
|
411
|
+
var touchmove$ = i3.tuiTypedFromEvent(doc, 'touchmove', { passive: true });
|
|
412
|
+
var touchend$ = i3.tuiTypedFromEvent(doc, 'touchend');
|
|
413
|
+
var scroll$ = i3.tuiTypedFromEvent(element, 'scroll').pipe(operators.map(function () { return element.scrollTop; }));
|
|
414
|
+
var result$ = i1$1.merge(load$.pipe(operators.delay(0), operators.map(function () { return element.scrollTop; })), touchstart$.pipe(operators.switchMap(function (_a) {
|
|
415
|
+
var touches = _a.touches;
|
|
416
|
+
var screenY = touches[0].screenY;
|
|
417
|
+
var scrollTop = element.scrollTop;
|
|
418
|
+
return i1$1.concat(
|
|
419
|
+
// Sometimes touch is triggered without scroll in iOS, filter that
|
|
420
|
+
i1$1.zip(touchmove$, scroll$).pipe(operators.map(function (_a) {
|
|
421
|
+
var _b = __read(_a, 1), touches = _b[0].touches;
|
|
422
|
+
return scrollTop + screenY - touches[0].screenY;
|
|
423
|
+
}), operators.takeUntil(touchend$)), scroll$);
|
|
424
|
+
})));
|
|
425
|
+
return i1$1.concat(scroll$.pipe(operators.take(1)), result$).pipe(i3.tuiZonefree(zone), operators.share());
|
|
426
|
+
}
|
|
427
|
+
|
|
438
428
|
var TUI_SHEET_PROVIDERS = [
|
|
439
429
|
{
|
|
440
430
|
provide: TUI_SHEET_DRAGGED,
|
|
441
431
|
deps: [i0.ElementRef],
|
|
442
432
|
useFactory: function (_a) {
|
|
443
433
|
var nativeElement = _a.nativeElement;
|
|
444
|
-
return i1.merge(i3.tuiTypedFromEvent(nativeElement, 'touchstart', { passive: true }).pipe(operators.map(i3.ALWAYS_TRUE_HANDLER)), i3.tuiTypedFromEvent(nativeElement, 'touchend').pipe(operators.map(i3.ALWAYS_FALSE_HANDLER)));
|
|
434
|
+
return i1$1.merge(i3.tuiTypedFromEvent(nativeElement, 'touchstart', { passive: true }).pipe(operators.map(i3.ALWAYS_TRUE_HANDLER)), i3.tuiTypedFromEvent(nativeElement, 'touchend').pipe(operators.map(i3.ALWAYS_FALSE_HANDLER)));
|
|
445
435
|
},
|
|
446
436
|
},
|
|
447
437
|
{
|
|
@@ -451,7 +441,7 @@
|
|
|
451
441
|
var nativeElement = _a.nativeElement;
|
|
452
442
|
return isIos
|
|
453
443
|
? iosScrollFactory(nativeElement, doc, zone)
|
|
454
|
-
: i1.merge(i3.tuiTypedFromEvent(nativeElement, 'scroll'), i3.tuiTypedFromEvent(nativeElement, 'load', { capture: true })).pipe(operators.map(function () { return nativeElement.scrollTop; }), i3.tuiZonefree(zone), operators.share());
|
|
444
|
+
: i1$1.merge(i3.tuiTypedFromEvent(nativeElement, 'scroll'), i3.tuiTypedFromEvent(nativeElement, 'load', { capture: true })).pipe(operators.map(function () { return nativeElement.scrollTop; }), i3.tuiZonefree(zone), operators.share());
|
|
455
445
|
},
|
|
456
446
|
},
|
|
457
447
|
{
|
|
@@ -470,7 +460,7 @@
|
|
|
470
460
|
this.sheet = sheet;
|
|
471
461
|
this.scroll$ = scroll$;
|
|
472
462
|
this.zone = zone;
|
|
473
|
-
this.rotate$ = this.scroll$.pipe(i1
|
|
463
|
+
this.rotate$ = this.scroll$.pipe(i1.tuiZonefulMap(function (y) { return i3.tuiClamp(10 - (y - _this.stop) / 5, 0, 10); }, this.zone));
|
|
474
464
|
}
|
|
475
465
|
Object.defineProperty(TuiSheetBarComponent.prototype, "stop", {
|
|
476
466
|
get: function () {
|
|
@@ -567,9 +557,12 @@
|
|
|
567
557
|
nativeElement.style.overflow = 'hidden';
|
|
568
558
|
nativeElement.classList.remove('_stuck'); // iOS
|
|
569
559
|
nativeElement.scrollTop = el.nativeElement.offsetTop;
|
|
570
|
-
|
|
560
|
+
i1$1.timer(100)
|
|
561
|
+
.pipe(operators.takeUntil(destroy$))
|
|
562
|
+
// eslint-disable-next-line rxjs/no-nested-subscribe
|
|
563
|
+
.subscribe(function () {
|
|
571
564
|
nativeElement.style.overflow = '';
|
|
572
|
-
}
|
|
565
|
+
});
|
|
573
566
|
});
|
|
574
567
|
}
|
|
575
568
|
return TuiSheetStopDirective;
|
|
@@ -604,13 +597,14 @@
|
|
|
604
597
|
} });
|
|
605
598
|
|
|
606
599
|
var TuiSheetComponent = /** @class */ (function () {
|
|
607
|
-
function TuiSheetComponent(scroll$, el, zone, isIos, moreWord$) {
|
|
600
|
+
function TuiSheetComponent(scroll$, el, zone, isIos, moreWord$, destroy$) {
|
|
608
601
|
var _this = this;
|
|
609
602
|
this.scroll$ = scroll$;
|
|
610
603
|
this.el = el;
|
|
611
604
|
this.zone = zone;
|
|
612
605
|
this.isIos = isIos;
|
|
613
606
|
this.moreWord$ = moreWord$;
|
|
607
|
+
this.destroy$ = destroy$;
|
|
614
608
|
this.stopsRefs = i3.EMPTY_QUERY;
|
|
615
609
|
this.id = '';
|
|
616
610
|
this.stuck$ = this.scroll$.pipe(operators.map(function (y) { return Math.floor(y) > _this.contentTop; }));
|
|
@@ -653,7 +647,15 @@
|
|
|
653
647
|
if (top === void 0) { top = this.sheetTop; }
|
|
654
648
|
var nativeElement = this.el.nativeElement;
|
|
655
649
|
if (this.isIos) {
|
|
656
|
-
|
|
650
|
+
var offset = top - nativeElement.scrollTop - 16;
|
|
651
|
+
nativeElement.style.transition = 'none';
|
|
652
|
+
nativeElement.style.transform = "scaleX(-1) translate3d(0, " + offset + "px, 0)";
|
|
653
|
+
i1$1.timer(0)
|
|
654
|
+
.pipe(operators.takeUntil(this.destroy$))
|
|
655
|
+
.subscribe(function () {
|
|
656
|
+
nativeElement.style.transition = '';
|
|
657
|
+
nativeElement.style.transform = '';
|
|
658
|
+
});
|
|
657
659
|
}
|
|
658
660
|
nativeElement.scrollTo({ top: top, behavior: 'smooth' });
|
|
659
661
|
};
|
|
@@ -686,8 +688,8 @@
|
|
|
686
688
|
};
|
|
687
689
|
return TuiSheetComponent;
|
|
688
690
|
}());
|
|
689
|
-
TuiSheetComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetComponent, deps: [{ token: TUI_SHEET_SCROLL }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.TUI_IS_IOS }, { token: kit.TUI_MORE_WORD }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
690
|
-
TuiSheetComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiSheetComponent, selector: "tui-sheet", inputs: { item: "item" }, host: { attributes: { "role": "dialog" }, listeners: { "$.class._stuck": "stuck$", "tui-sheet-id": "onId($event.detail)" }, properties: { "attr.aria-labelledby": "id", "class._ios": "isIos", "$.class._stuck": "stuck$" } }, providers: TUI_SHEET_PROVIDERS, viewQueries: [{ propertyName: "sheet", first: true, predicate: ["sheet"], descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true }, { propertyName: "stopsRefs", predicate: ["stops"], descendants: true }], ngImport: i0__namespace, template: "<div\n class=\"t-bumpers\"\n (click)=\"close()\"\n>\n <div\n *ngFor=\"let stop of item.stops\"\n #stops\n class=\"t-bumper\"\n [style.marginTop]=\"stop\"\n ></div>\n</div>\n<div\n #sheet\n class=\"t-wrapper\"\n [class.t-wrapper_shadow]=\"!item.image\"\n>\n <header\n *ngIf=\"item.image\"\n class=\"t-top\"\n [tuiSheetTop]=\"imageStop\"\n >\n <img\n *polymorpheusOutlet=\"item.image as src; context: context\"\n alt=\"\"\n class=\"t-image\"\n [src]=\"src\"\n />\n </header>\n <section\n #content\n tuiSheetStop\n class=\"t-sheet\"\n >\n <div class=\"t-bar\"></div>\n <tui-sheet-bar>\n <button\n type=\"button\"\n class=\"t-button\"\n [title]=\"moreWord$ | async\"\n (click)=\"scrollTo(stops[1])\"\n ></button>\n </tui-sheet-bar>\n <div class=\"t-content\">\n <h2\n *polymorpheusOutlet=\"item.content as text; context: context\"\n tuiSheetHeading\n class=\"t-heading\"\n >\n {{ text }}\n </h2>\n </div>\n </section>\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;position:absolute;top:0;left:0;bottom:0;right:0;transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;top:auto;border-radius:.75rem .75rem 0 0;overflow-y:auto;overflow-x:hidden;scroll-snap-type:y mandatory;box-shadow:0 50vh var(--tui-elevation-01);padding-right:1rem;margin-left:-1rem;transform:scaleX(-1);-webkit-clip-path:inset(0 1rem 0 0 round .75rem .75rem 0 0);clip-path:inset(0 1rem 0 0 round .75rem .75rem 0 0)}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host._stuck{scroll-snap-type:none}@supports (-moz-appearance: none){:host{scroll-snap-type:none}}.t-bumpers{display:flex;height:100%}:host-context(.t-wrapper_closeable) .t-bumpers{scroll-snap-stop:always;scroll-snap-align:start;scroll-margin:-1px}.t-bumper{scroll-snap-stop:always;scroll-snap-align:start;height:1rem;width:1rem}.t-wrapper{border-radius:inherit;scroll-snap-stop:always;scroll-snap-align:start}.t-wrapper_shadow{box-shadow:var(--tui-shadow)}.t-top{position:-webkit-sticky;position:sticky;top:0;border-radius:.8rem .8rem 0 0;box-shadow:var(--tui-shadow);transform:scaleX(-1);overflow:hidden}.t-top._clickthrough{pointer-events:none}:host-context(._overlay:not(._visible)) .t-top{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;transform:scaleX(-1)!important}.t-image{display:block;width:100%}.t-sheet{position:relative;border-radius:inherit;scroll-snap-stop:always;scroll-snap-align:start;transform:scaleX(-1)}.t-top:not(._rounded)~.t-sheet .t-bar{border-radius:0}.t-bar{transition-property:border-radius;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:-webkit-sticky;position:sticky;top:0;z-index:1;height:1.5rem;margin-bottom:-1.5rem;border-radius:inherit;background:var(--tui-elevation-01);box-shadow:inset 0 1px #ffffff40}.t-button{position:absolute;top:0;height:1.5rem;width:3rem;padding:0;border:0;opacity:0}.t-content{padding:1rem;margin-top:-1rem;border-radius:inherit;background:var(--tui-elevation-01)}.t-heading{padding-bottom:.5rem;background:var(--tui-elevation-01)}\n"], components: [{ type: TuiSheetBarComponent, selector: "tui-sheet-bar" }, { type: TuiSheetHeadingComponent, selector: "[tuiSheetHeading]" }], directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: TuiSheetTopDirective, selector: "[tuiSheetTop]", inputs: ["tuiSheetTop"] }, { type: i5__namespace.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { type: TuiSheetStopDirective, selector: "[tuiSheetStop]" }], pipes: { "async": i2__namespace.AsyncPipe }, animations: [i1
|
|
691
|
+
TuiSheetComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetComponent, deps: [{ token: TUI_SHEET_SCROLL }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i3.TUI_IS_IOS }, { token: kit.TUI_MORE_WORD }, { token: i3.TuiDestroyService, self: true }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
692
|
+
TuiSheetComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiSheetComponent, selector: "tui-sheet", inputs: { item: "item" }, host: { attributes: { "role": "dialog" }, listeners: { "$.class._stuck": "stuck$", "tui-sheet-id": "onId($event.detail)" }, properties: { "attr.aria-labelledby": "id", "class._ios": "isIos", "$.class._stuck": "stuck$" } }, providers: TUI_SHEET_PROVIDERS, viewQueries: [{ propertyName: "sheet", first: true, predicate: ["sheet"], descendants: true }, { propertyName: "content", first: true, predicate: ["content"], descendants: true }, { propertyName: "stopsRefs", predicate: ["stops"], descendants: true }], ngImport: i0__namespace, template: "<div\n class=\"t-bumpers\"\n (click)=\"close()\"\n>\n <div\n *ngFor=\"let stop of item.stops\"\n #stops\n class=\"t-bumper\"\n [style.marginTop]=\"stop\"\n ></div>\n</div>\n<div\n #sheet\n class=\"t-wrapper\"\n [class.t-wrapper_shadow]=\"!item.image\"\n>\n <header\n *ngIf=\"item.image\"\n class=\"t-top\"\n [tuiSheetTop]=\"imageStop\"\n >\n <img\n *polymorpheusOutlet=\"item.image as src; context: context\"\n alt=\"\"\n class=\"t-image\"\n [src]=\"src\"\n />\n </header>\n <section\n #content\n tuiSheetStop\n class=\"t-sheet\"\n >\n <div class=\"t-bar\"></div>\n <tui-sheet-bar>\n <button\n type=\"button\"\n class=\"t-button\"\n [title]=\"moreWord$ | async\"\n (click)=\"scrollTo(stops[1])\"\n ></button>\n </tui-sheet-bar>\n <div class=\"t-content\">\n <h2\n *polymorpheusOutlet=\"item.content as text; context: context\"\n tuiSheetHeading\n class=\"t-heading\"\n >\n {{ text }}\n </h2>\n </div>\n </section>\n</div>\n", styles: [":host{scrollbar-width:none;-ms-overflow-style:none;position:absolute;top:0;left:0;bottom:0;right:0;transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;top:auto;border-radius:.75rem .75rem 0 0;overflow-y:auto;overflow-x:hidden;scroll-snap-type:y mandatory;box-shadow:0 50vh var(--tui-elevation-01);padding-right:1rem;margin-left:-1rem;transform:scaleX(-1);-webkit-clip-path:inset(0 1rem 0 0 round .75rem .75rem 0 0);clip-path:inset(0 1rem 0 0 round .75rem .75rem 0 0)}:host::-webkit-scrollbar,:host::-webkit-scrollbar-thumb{display:none}:host._stuck{scroll-snap-type:none}@supports (-moz-appearance: none){:host{scroll-snap-type:none}}.t-bumpers{display:flex;height:100%}:host-context(.t-wrapper_closeable) .t-bumpers{scroll-snap-stop:always;scroll-snap-align:start;scroll-margin:-1px}.t-bumper{scroll-snap-stop:always;scroll-snap-align:start;height:1rem;width:1rem}.t-wrapper{border-radius:inherit;scroll-snap-stop:always;scroll-snap-align:start}.t-wrapper_shadow{box-shadow:var(--tui-shadow)}.t-top{position:-webkit-sticky;position:sticky;top:0;border-radius:.8rem .8rem 0 0;box-shadow:var(--tui-shadow);transform:scaleX(-1);overflow:hidden}.t-top._clickthrough{pointer-events:none}:host-context(._overlay:not(._visible)) .t-top{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;transform:scaleX(-1)!important}.t-image{display:block;width:100%}.t-sheet{position:relative;border-radius:inherit;scroll-snap-stop:always;scroll-snap-align:start;transform:scaleX(-1)}.t-top:not(._rounded)~.t-sheet .t-bar{border-radius:0}.t-bar{transition-property:border-radius;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:-webkit-sticky;position:sticky;top:0;z-index:1;height:1.5rem;margin-bottom:-1.5rem;border-radius:inherit;background:var(--tui-elevation-01);box-shadow:inset 0 1px #ffffff40}.t-button{position:absolute;top:0;height:1.5rem;width:3rem;padding:0;border:0;opacity:0}.t-content{padding:1rem;margin-top:-1rem;border-radius:inherit;background:var(--tui-elevation-01)}.t-heading{padding-bottom:.5rem;background:var(--tui-elevation-01)}\n"], components: [{ type: TuiSheetBarComponent, selector: "tui-sheet-bar" }, { type: TuiSheetHeadingComponent, selector: "[tuiSheetHeading]" }], directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: TuiSheetTopDirective, selector: "[tuiSheetTop]", inputs: ["tuiSheetTop"] }, { type: i5__namespace.PolymorpheusOutletDirective, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { type: TuiSheetStopDirective, selector: "[tuiSheetStop]" }], pipes: { "async": i2__namespace.AsyncPipe }, animations: [i1.tuiSlideInTop], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
691
693
|
__decorate([
|
|
692
694
|
i3.tuiPure
|
|
693
695
|
], TuiSheetComponent.prototype, "context", null);
|
|
@@ -710,7 +712,7 @@
|
|
|
710
712
|
'[$.class._stuck]': 'stuck$',
|
|
711
713
|
'($.class._stuck)': 'stuck$',
|
|
712
714
|
},
|
|
713
|
-
animations: [i1
|
|
715
|
+
animations: [i1.tuiSlideInTop],
|
|
714
716
|
}]
|
|
715
717
|
}], ctorParameters: function () {
|
|
716
718
|
return [{ type: i1__namespace$1.Observable, decorators: [{
|
|
@@ -728,6 +730,11 @@
|
|
|
728
730
|
}] }, { type: i1__namespace$1.Observable, decorators: [{
|
|
729
731
|
type: i0.Inject,
|
|
730
732
|
args: [kit.TUI_MORE_WORD]
|
|
733
|
+
}] }, { type: i1__namespace$1.Observable, decorators: [{
|
|
734
|
+
type: i0.Self
|
|
735
|
+
}, {
|
|
736
|
+
type: i0.Inject,
|
|
737
|
+
args: [i3.TuiDestroyService]
|
|
731
738
|
}] }];
|
|
732
739
|
}, propDecorators: { sheet: [{
|
|
733
740
|
type: i0.ViewChild,
|
|
@@ -771,17 +778,17 @@
|
|
|
771
778
|
function TuiSheetService(doc, options) {
|
|
772
779
|
this.doc = doc;
|
|
773
780
|
this.options = options;
|
|
774
|
-
this.sheets$ = new i1.BehaviorSubject([]);
|
|
781
|
+
this.sheets$ = new i1$1.BehaviorSubject([]);
|
|
775
782
|
}
|
|
776
783
|
TuiSheetService.prototype.open = function (content, options) {
|
|
777
784
|
var _this = this;
|
|
778
785
|
if (options === void 0) { options = {}; }
|
|
779
|
-
return new i1.Observable(function ($implicit) {
|
|
786
|
+
return new i1$1.Observable(function ($implicit) {
|
|
780
787
|
var completeWith = function (result) {
|
|
781
788
|
$implicit.next(result);
|
|
782
789
|
$implicit.complete();
|
|
783
790
|
};
|
|
784
|
-
var sheet = Object.assign(Object.assign(Object.assign({}, _this.options), options), { content: content, completeWith: completeWith, $implicit: $implicit, scroll$: i1.EMPTY });
|
|
791
|
+
var sheet = Object.assign(Object.assign(Object.assign({}, _this.options), options), { content: content, completeWith: completeWith, $implicit: $implicit, scroll$: i1$1.EMPTY });
|
|
785
792
|
var focused = i3.tuiGetNativeFocused(_this.doc);
|
|
786
793
|
if (i3.tuiIsHTMLElement(focused) && sheet.overlay) {
|
|
787
794
|
focused.blur();
|
|
@@ -816,7 +823,7 @@
|
|
|
816
823
|
function processDragged(dragged$, scroll$) {
|
|
817
824
|
var touchstart$ = dragged$.pipe(operators.filter(Boolean));
|
|
818
825
|
var touchend$ = dragged$.pipe(operators.filter(i3.tuiIsFalsy));
|
|
819
|
-
var race$ = i1.race(scroll$, i1.timer(100)).pipe(operators.debounceTime(200), operators.take(1), operators.map(i3.ALWAYS_FALSE_HANDLER));
|
|
826
|
+
var race$ = i1$1.race(scroll$, i1$1.timer(100)).pipe(operators.debounceTime(200), operators.take(1), operators.map(i3.ALWAYS_FALSE_HANDLER));
|
|
820
827
|
return touchstart$.pipe(operators.switchMap(function () { return touchend$.pipe(operators.switchMap(function () { return race$; }), operators.startWith(true)); }), operators.startWith(false));
|
|
821
828
|
}
|
|
822
829
|
var TuiSheetWrapperDirective = /** @class */ (function () {
|
|
@@ -908,7 +915,7 @@
|
|
|
908
915
|
this.win = win;
|
|
909
916
|
this.el = el;
|
|
910
917
|
this.sheet = sheet;
|
|
911
|
-
this.close = i1.merge(i3.tuiTypedFromEvent(this.el.nativeElement, TUI_SHEET_CLOSE), this.dragged$.pipe(i3.tuiIfMap(function () { return _this.scroll$.pipe(operators.startWith(_this.el.nativeElement.scrollTop)); }, i3.tuiIsFalsy), operators.filter(function (y) { var _a; return ((_a = _this.sheet.item) === null || _a === void 0 ? void 0 : _a.closeable) && _this.shouldClose(y); }), operators.distinctUntilChanged(), i3.tuiZonefull(this.zone)));
|
|
918
|
+
this.close = i1$1.merge(i3.tuiTypedFromEvent(this.el.nativeElement, TUI_SHEET_CLOSE), this.dragged$.pipe(i3.tuiIfMap(function () { return _this.scroll$.pipe(operators.startWith(_this.el.nativeElement.scrollTop)); }, i3.tuiIsFalsy), operators.filter(function (y) { var _a; return ((_a = _this.sheet.item) === null || _a === void 0 ? void 0 : _a.closeable) && _this.shouldClose(y); }), operators.distinctUntilChanged(), i3.tuiZonefull(this.zone)));
|
|
912
919
|
}
|
|
913
920
|
TuiSheetCloseDirective.prototype.shouldClose = function (scrollTop) {
|
|
914
921
|
var height = Math.min(this.win.innerHeight, this.el.nativeElement.scrollHeight - this.win.innerHeight);
|
|
@@ -974,8 +981,8 @@
|
|
|
974
981
|
};
|
|
975
982
|
return TuiSheetsHostComponent;
|
|
976
983
|
}());
|
|
977
|
-
TuiSheetsHostComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetsHostComponent, deps: [{ token: i1
|
|
978
|
-
TuiSheetsHostComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiSheetsHostComponent, selector: "tui-sheets-host", providers: [i3.TuiDestroyService], ngImport: i0__namespace, template: "<div\n *ngFor=\"let item of sheets\"\n #wrapper=\"tuiSheetWrapper\"\n class=\"t-wrapper\"\n [@tuiFadeIn]=\"options\"\n [@tuiSlideInTop]=\"options\"\n [class.t-wrapper_closeable]=\"item.closeable\"\n [class.t-wrapper_overlay]=\"item.overlay || (wrapper.overlay$ | async)\"\n [class.t-wrapper_visible]=\"wrapper.visible$ | async\"\n [style.height.px]=\"wrapper.height$ | async\"\n [tuiSheetWrapper]=\"item.offset\"\n (click.self)=\"close(item)\"\n>\n <tui-sheet\n tuiOverscroll=\"all\"\n tuiScrollRef\n [item]=\"item\"\n [style.height.px]=\"((height$ | async) || 0) - item.offset\"\n (close)=\"close(item)\"\n ></tui-sheet>\n</div>\n<div\n class=\"t-overlay\"\n (click)=\"close(sheets[0])\"\n></div>\n", styles: [":host{position:-webkit-sticky;position:sticky;bottom:0;display:block;height:0}.t-overlay{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:fixed;top:0;left:0;width:100%;z-index:-1;height:100%;background:#000;opacity:.001;pointer-events:none}.t-wrapper_overlay~.t-overlay{opacity:.8;pointer-events:auto;touch-action:none}.t-wrapper{position:absolute;bottom:0;z-index:0;width:100%;height:100vh;overflow:hidden}.t-wrapper_visible{overflow:visible}\n"], components: [{ type: TuiSheetComponent, selector: "tui-sheet", inputs: ["item"] }], directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: TuiSheetWrapperDirective, selector: "[tuiSheetWrapper]", inputs: ["tuiSheetWrapper"], exportAs: ["tuiSheetWrapper"] }, { type: TuiSheetCloseDirective, selector: "tui-sheet[close]", outputs: ["close"] }, { type: i3__namespace.TuiOverscrollDirective, selector: "[tuiOverscroll]", inputs: ["tuiOverscroll"] }, { type: i1__namespace.TuiScrollRefDirective, selector: "[tuiScrollRef]" }], pipes: { "async": i2__namespace.AsyncPipe }, animations: [i1
|
|
984
|
+
TuiSheetsHostComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetsHostComponent, deps: [{ token: i1.TUI_ANIMATION_OPTIONS }, { token: TuiSheetService }, { token: i3.TUI_WINDOW_HEIGHT }, { token: i3.TuiDestroyService, self: true }, { token: i0.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
985
|
+
TuiSheetsHostComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TuiSheetsHostComponent, selector: "tui-sheets-host", providers: [i3.TuiDestroyService], ngImport: i0__namespace, template: "<div\n *ngFor=\"let item of sheets\"\n #wrapper=\"tuiSheetWrapper\"\n class=\"t-wrapper\"\n [@tuiFadeIn]=\"options\"\n [@tuiSlideInTop]=\"options\"\n [class.t-wrapper_closeable]=\"item.closeable\"\n [class.t-wrapper_overlay]=\"item.overlay || (wrapper.overlay$ | async)\"\n [class.t-wrapper_visible]=\"wrapper.visible$ | async\"\n [style.height.px]=\"wrapper.height$ | async\"\n [tuiSheetWrapper]=\"item.offset\"\n (click.self)=\"close(item)\"\n>\n <tui-sheet\n tuiOverscroll=\"all\"\n tuiScrollRef\n [item]=\"item\"\n [style.height.px]=\"((height$ | async) || 0) - item.offset\"\n (close)=\"close(item)\"\n ></tui-sheet>\n</div>\n<div\n class=\"t-overlay\"\n (click)=\"close(sheets[0])\"\n></div>\n", styles: [":host{position:-webkit-sticky;position:sticky;bottom:0;display:block;height:0}.t-overlay{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:fixed;top:0;left:0;width:100%;z-index:-1;height:100%;background:#000;opacity:.001;pointer-events:none}.t-wrapper_overlay~.t-overlay{opacity:.8;pointer-events:auto;touch-action:none}.t-wrapper{position:absolute;bottom:0;z-index:0;width:100%;height:100vh;overflow:hidden}.t-wrapper_visible{overflow:visible}\n"], components: [{ type: TuiSheetComponent, selector: "tui-sheet", inputs: ["item"] }], directives: [{ type: i2__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: TuiSheetWrapperDirective, selector: "[tuiSheetWrapper]", inputs: ["tuiSheetWrapper"], exportAs: ["tuiSheetWrapper"] }, { type: TuiSheetCloseDirective, selector: "tui-sheet[close]", outputs: ["close"] }, { type: i3__namespace.TuiOverscrollDirective, selector: "[tuiOverscroll]", inputs: ["tuiOverscroll"] }, { type: i1__namespace.TuiScrollRefDirective, selector: "[tuiScrollRef]" }], pipes: { "async": i2__namespace.AsyncPipe }, animations: [i1.tuiSlideInTop, i1.tuiFadeIn], changeDetection: i0__namespace.ChangeDetectionStrategy.OnPush });
|
|
979
986
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetsHostComponent, decorators: [{
|
|
980
987
|
type: i0.Component,
|
|
981
988
|
args: [{
|
|
@@ -984,12 +991,12 @@
|
|
|
984
991
|
styleUrls: ['./sheets-host.style.less'],
|
|
985
992
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
986
993
|
providers: [i3.TuiDestroyService],
|
|
987
|
-
animations: [i1
|
|
994
|
+
animations: [i1.tuiSlideInTop, i1.tuiFadeIn],
|
|
988
995
|
}]
|
|
989
996
|
}], ctorParameters: function () {
|
|
990
997
|
return [{ type: undefined, decorators: [{
|
|
991
998
|
type: i0.Inject,
|
|
992
|
-
args: [i1
|
|
999
|
+
args: [i1.TUI_ANIMATION_OPTIONS]
|
|
993
1000
|
}] }, { type: TuiSheetService, decorators: [{
|
|
994
1001
|
type: i0.Inject,
|
|
995
1002
|
args: [TuiSheetService]
|
|
@@ -1016,7 +1023,7 @@
|
|
|
1016
1023
|
function TuiSheetDirective(cdr, templateRef, service) {
|
|
1017
1024
|
var _this = _super.call(this, templateRef, cdr) || this;
|
|
1018
1025
|
_this.service = service;
|
|
1019
|
-
_this.open$ = new i1.Subject();
|
|
1026
|
+
_this.open$ = new i1$1.Subject();
|
|
1020
1027
|
_this.options = {};
|
|
1021
1028
|
_this.tuiSheetChange = _this.open$.pipe(i3.tuiIfMap(function () { return _this.service.open(_this, _this.options).pipe(operators.ignoreElements(), operators.endWith(false)); }), operators.share());
|
|
1022
1029
|
return _this;
|
|
@@ -1078,9 +1085,9 @@
|
|
|
1078
1085
|
TuiSheetStopDirective], imports: [i2.CommonModule,
|
|
1079
1086
|
i5.PolymorpheusModule,
|
|
1080
1087
|
i3.TuiLetModule,
|
|
1081
|
-
i1
|
|
1088
|
+
i1.TuiButtonModule,
|
|
1082
1089
|
i3.TuiOverscrollModule,
|
|
1083
|
-
i1
|
|
1090
|
+
i1.TuiScrollbarModule], exports: [TuiSheetsHostComponent,
|
|
1084
1091
|
TuiSheetComponent,
|
|
1085
1092
|
TuiSheetHeadingComponent,
|
|
1086
1093
|
TuiSheetDirective] });
|
|
@@ -1088,9 +1095,9 @@
|
|
|
1088
1095
|
i2.CommonModule,
|
|
1089
1096
|
i5.PolymorpheusModule,
|
|
1090
1097
|
i3.TuiLetModule,
|
|
1091
|
-
i1
|
|
1098
|
+
i1.TuiButtonModule,
|
|
1092
1099
|
i3.TuiOverscrollModule,
|
|
1093
|
-
i1
|
|
1100
|
+
i1.TuiScrollbarModule,
|
|
1094
1101
|
]] });
|
|
1095
1102
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: TuiSheetModule, decorators: [{
|
|
1096
1103
|
type: i0.NgModule,
|
|
@@ -1099,9 +1106,9 @@
|
|
|
1099
1106
|
i2.CommonModule,
|
|
1100
1107
|
i5.PolymorpheusModule,
|
|
1101
1108
|
i3.TuiLetModule,
|
|
1102
|
-
i1
|
|
1109
|
+
i1.TuiButtonModule,
|
|
1103
1110
|
i3.TuiOverscrollModule,
|
|
1104
|
-
i1
|
|
1111
|
+
i1.TuiScrollbarModule,
|
|
1105
1112
|
],
|
|
1106
1113
|
declarations: [
|
|
1107
1114
|
TuiSheetsHostComponent,
|
|
@@ -1144,7 +1151,6 @@
|
|
|
1144
1151
|
exports.TuiSheetTopDirective = TuiSheetTopDirective;
|
|
1145
1152
|
exports.TuiSheetWrapperDirective = TuiSheetWrapperDirective;
|
|
1146
1153
|
exports.TuiSheetsHostComponent = TuiSheetsHostComponent;
|
|
1147
|
-
exports.fakeSmoothScroll = fakeSmoothScroll;
|
|
1148
1154
|
exports.iosScrollFactory = iosScrollFactory;
|
|
1149
1155
|
|
|
1150
1156
|
Object.defineProperty(exports, '__esModule', { value: true });
|