@taiga-ui/addon-mobile 4.65.0 → 5.0.0-canary.2e92594
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/components/bottom-sheet/bottom-sheet.component.d.ts +3 -3
- package/components/index.d.ts +0 -1
- package/components/mobile-calendar/calendar-date-stream.d.ts +6 -0
- package/components/mobile-calendar/index.d.ts +1 -0
- package/components/mobile-calendar/mobile-calendar.component.d.ts +20 -22
- package/components/mobile-calendar/mobile-calendar.strategy.d.ts +3 -7
- package/components/mobile-calendar-dropdown/mobile-calendar-dropdown.component.d.ts +10 -12
- package/components/mobile-calendar-dropdown/mobile-calendar-dropdown.directive.d.ts +6 -6
- package/components/pull-to-refresh/pull-to-refresh.component.d.ts +8 -7
- package/components/sheet-dialog/sheet-dialog.component.d.ts +2 -2
- package/components/sheet-dialog/sheet-dialog.directive.d.ts +4 -3
- package/components/sheet-dialog/sheet-dialog.options.d.ts +4 -10
- package/components/sheet-dialog/sheet-dialog.service.d.ts +9 -4
- package/components/swipe-action/swipe-actions-auto-close.directive.d.ts +2 -2
- package/components/tab-bar/tab-bar-item.component.d.ts +3 -3
- package/components/tab-bar/tab-bar.component.d.ts +4 -7
- package/directives/dropdown-mobile/dropdown-mobile.component.d.ts +10 -14
- package/directives/dropdown-mobile/dropdown-mobile.directive.d.ts +1 -2
- package/directives/dropdown-sheet/dropdown-sheet.component.d.ts +14 -0
- package/directives/dropdown-sheet/dropdown-sheet.directive.d.ts +6 -0
- package/directives/dropdown-sheet/index.d.ts +2 -0
- package/directives/elastic-sticky/elastic-sticky.directive.d.ts +1 -2
- package/directives/index.d.ts +1 -1
- package/directives/responsive-dialog/responsive-dialog.directive.d.ts +5 -4
- package/directives/responsive-dialog/responsive-dialog.service.d.ts +4 -7
- package/directives/ripple/ripple.directive.d.ts +3 -3
- package/directives/touchable/touchable.directive.d.ts +5 -5
- package/fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs +14 -23
- package/fesm2022/taiga-ui-addon-mobile-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs +35 -57
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs +10 -14
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs +130 -165
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-calendar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs +49 -60
- package/fesm2022/taiga-ui-addon-mobile-components-pull-to-refresh.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs +62 -61
- package/fesm2022/taiga-ui-addon-mobile-components-sheet-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-swipe-action.mjs +12 -20
- package/fesm2022/taiga-ui-addon-mobile-components-swipe-action.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs +32 -53
- package/fesm2022/taiga-ui-addon-mobile-components-tab-bar.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-components.mjs +0 -1
- package/fesm2022/taiga-ui-addon-mobile-components.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +67 -90
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-sheet.mjs +83 -0
- package/fesm2022/taiga-ui-addon-mobile-directives-dropdown-sheet.mjs.map +1 -0
- package/fesm2022/taiga-ui-addon-mobile-directives-elastic-sticky.mjs +12 -16
- package/fesm2022/taiga-ui-addon-mobile-directives-elastic-sticky.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-responsive-dialog.mjs +46 -29
- package/fesm2022/taiga-ui-addon-mobile-directives-responsive-dialog.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs +21 -44
- package/fesm2022/taiga-ui-addon-mobile-directives-ripple.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs +20 -27
- package/fesm2022/taiga-ui-addon-mobile-directives-touchable.mjs.map +1 -1
- package/fesm2022/taiga-ui-addon-mobile-directives.mjs +1 -1
- package/fesm2022/taiga-ui-addon-mobile-services.mjs +36 -7
- package/fesm2022/taiga-ui-addon-mobile-services.mjs.map +1 -1
- package/package.json +23 -61
- package/services/index.d.ts +1 -0
- package/services/theme-color.service.d.ts +18 -0
- package/styles/android/app-bar.less +1 -1
- package/styles/android/checkbox.less +2 -3
- package/styles/common/badge-notification.less +1 -1
- package/styles/common/badge.less +2 -3
- package/styles/common/block-status.less +1 -1
- package/styles/common/button.less +1 -1
- package/styles/common/card-large.less +1 -1
- package/styles/common/chip.less +3 -9
- package/styles/common/header.less +1 -1
- package/styles/common/message.less +1 -1
- package/styles/common/segmented.less +1 -1
- package/styles/common/title.less +0 -1
- package/styles/common/toast.less +3 -4
- package/styles/ios/checkbox.less +2 -4
- package/styles/ios/switch.less +51 -2
- package/components/mobile-dialog/index.d.ts +0 -3
- package/components/mobile-dialog/mobile-dialog.component.d.ts +0 -10
- package/components/mobile-dialog/mobile-dialog.options.d.ts +0 -12
- package/components/mobile-dialog/mobile-dialog.service.d.ts +0 -10
- package/directives/sidebar/index.d.ts +0 -3
- package/directives/sidebar/sidebar.component.d.ts +0 -21
- package/directives/sidebar/sidebar.d.ts +0 -6
- package/directives/sidebar/sidebar.directive.d.ts +0 -22
- package/esm2022/components/bottom-sheet/bottom-sheet.component.mjs +0 -50
- package/esm2022/components/bottom-sheet/index.mjs +0 -2
- package/esm2022/components/bottom-sheet/taiga-ui-addon-mobile-components-bottom-sheet.mjs +0 -5
- package/esm2022/components/index.mjs +0 -10
- package/esm2022/components/mobile-calendar/index.mjs +0 -5
- package/esm2022/components/mobile-calendar/mobile-calendar.component.mjs +0 -308
- package/esm2022/components/mobile-calendar/mobile-calendar.const.mjs +0 -35
- package/esm2022/components/mobile-calendar/mobile-calendar.providers.mjs +0 -27
- package/esm2022/components/mobile-calendar/mobile-calendar.strategy.mjs +0 -126
- package/esm2022/components/mobile-calendar/taiga-ui-addon-mobile-components-mobile-calendar.mjs +0 -5
- package/esm2022/components/mobile-calendar-dropdown/index.mjs +0 -3
- package/esm2022/components/mobile-calendar-dropdown/mobile-calendar-dropdown.component.mjs +0 -113
- package/esm2022/components/mobile-calendar-dropdown/mobile-calendar-dropdown.directive.mjs +0 -53
- package/esm2022/components/mobile-calendar-dropdown/taiga-ui-addon-mobile-components-mobile-calendar-dropdown.mjs +0 -5
- package/esm2022/components/mobile-calendar-sheet/index.mjs +0 -2
- package/esm2022/components/mobile-calendar-sheet/mobile-calendar-sheet.component.mjs +0 -25
- package/esm2022/components/mobile-calendar-sheet/taiga-ui-addon-mobile-components-mobile-calendar-sheet.mjs +0 -5
- package/esm2022/components/mobile-dialog/index.mjs +0 -4
- package/esm2022/components/mobile-dialog/mobile-dialog.component.mjs +0 -26
- package/esm2022/components/mobile-dialog/mobile-dialog.options.mjs +0 -17
- package/esm2022/components/mobile-dialog/mobile-dialog.service.mjs +0 -22
- package/esm2022/components/mobile-dialog/taiga-ui-addon-mobile-components-mobile-dialog.mjs +0 -5
- package/esm2022/components/pull-to-refresh/index.mjs +0 -6
- package/esm2022/components/pull-to-refresh/loader-android/loader-android.component.mjs +0 -46
- package/esm2022/components/pull-to-refresh/loader-ios/loader-ios.component.mjs +0 -39
- package/esm2022/components/pull-to-refresh/pull-to-refresh.component.mjs +0 -51
- package/esm2022/components/pull-to-refresh/pull-to-refresh.providers.mjs +0 -24
- package/esm2022/components/pull-to-refresh/pull-to-refresh.service.mjs +0 -37
- package/esm2022/components/pull-to-refresh/taiga-ui-addon-mobile-components-pull-to-refresh.mjs +0 -5
- package/esm2022/components/sheet-dialog/index.mjs +0 -5
- package/esm2022/components/sheet-dialog/sheet-dialog.component.mjs +0 -81
- package/esm2022/components/sheet-dialog/sheet-dialog.directive.mjs +0 -21
- package/esm2022/components/sheet-dialog/sheet-dialog.options.mjs +0 -24
- package/esm2022/components/sheet-dialog/sheet-dialog.service.mjs +0 -38
- package/esm2022/components/sheet-dialog/taiga-ui-addon-mobile-components-sheet-dialog.mjs +0 -5
- package/esm2022/components/swipe-action/index.mjs +0 -3
- package/esm2022/components/swipe-action/swipe-actions-auto-close.directive.mjs +0 -34
- package/esm2022/components/swipe-action/swipe-actions.component.mjs +0 -23
- package/esm2022/components/swipe-action/taiga-ui-addon-mobile-components-swipe-action.mjs +0 -5
- package/esm2022/components/tab-bar/index.mjs +0 -5
- package/esm2022/components/tab-bar/tab-bar-item.component.mjs +0 -26
- package/esm2022/components/tab-bar/tab-bar-item.directive.mjs +0 -27
- package/esm2022/components/tab-bar/tab-bar.component.mjs +0 -46
- package/esm2022/components/tab-bar/tab-bar.mjs +0 -9
- package/esm2022/components/tab-bar/taiga-ui-addon-mobile-components-tab-bar.mjs +0 -5
- package/esm2022/components/taiga-ui-addon-mobile-components.mjs +0 -5
- package/esm2022/directives/dropdown-mobile/dropdown-mobile.component.mjs +0 -98
- package/esm2022/directives/dropdown-mobile/dropdown-mobile.directive.mjs +0 -54
- package/esm2022/directives/dropdown-mobile/index.mjs +0 -3
- package/esm2022/directives/dropdown-mobile/taiga-ui-addon-mobile-directives-dropdown-mobile.mjs +0 -5
- package/esm2022/directives/elastic-sticky/elastic-sticky.directive.mjs +0 -23
- package/esm2022/directives/elastic-sticky/elastic-sticky.service.mjs +0 -53
- package/esm2022/directives/elastic-sticky/index.mjs +0 -3
- package/esm2022/directives/elastic-sticky/taiga-ui-addon-mobile-directives-elastic-sticky.mjs +0 -5
- package/esm2022/directives/index.mjs +0 -7
- package/esm2022/directives/responsive-dialog/index.mjs +0 -3
- package/esm2022/directives/responsive-dialog/responsive-dialog.directive.mjs +0 -21
- package/esm2022/directives/responsive-dialog/responsive-dialog.service.mjs +0 -34
- package/esm2022/directives/responsive-dialog/taiga-ui-addon-mobile-directives-responsive-dialog.mjs +0 -5
- package/esm2022/directives/ripple/index.mjs +0 -2
- package/esm2022/directives/ripple/ripple.directive.mjs +0 -98
- package/esm2022/directives/ripple/taiga-ui-addon-mobile-directives-ripple.mjs +0 -5
- package/esm2022/directives/sidebar/index.mjs +0 -4
- package/esm2022/directives/sidebar/sidebar.component.mjs +0 -45
- package/esm2022/directives/sidebar/sidebar.directive.mjs +0 -64
- package/esm2022/directives/sidebar/sidebar.mjs +0 -7
- package/esm2022/directives/sidebar/taiga-ui-addon-mobile-directives-sidebar.mjs +0 -5
- package/esm2022/directives/taiga-ui-addon-mobile-directives.mjs +0 -5
- package/esm2022/directives/touchable/index.mjs +0 -2
- package/esm2022/directives/touchable/taiga-ui-addon-mobile-directives-touchable.mjs +0 -5
- package/esm2022/directives/touchable/touchable.directive.mjs +0 -71
- package/esm2022/index.mjs +0 -4
- package/esm2022/services/index.mjs +0 -2
- package/esm2022/services/keyboard.service.mjs +0 -53
- package/esm2022/services/taiga-ui-addon-mobile-services.mjs +0 -5
- package/esm2022/taiga-ui-addon-mobile.mjs +0 -5
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-dialog.mjs +0 -65
- package/fesm2022/taiga-ui-addon-mobile-components-mobile-dialog.mjs.map +0 -1
- package/fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs +0 -114
- package/fesm2022/taiga-ui-addon-mobile-directives-sidebar.mjs.map +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, inject, Directive, viewChild, TemplateRef, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { TuiSheetDialogService } from '@taiga-ui/addon-mobile/components/sheet-dialog';
|
|
5
|
+
import { tuiIfMap } from '@taiga-ui/cdk/observables';
|
|
6
|
+
import { TUI_DROPDOWN_COMPONENT, TuiDropdownDirective } from '@taiga-ui/core/portals/dropdown';
|
|
7
|
+
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
|
|
8
|
+
import { WA_IS_MOBILE } from '@ng-web-apis/platform';
|
|
9
|
+
|
|
10
|
+
class TuiDropdownSheet {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.tuiDropdownSheet = input('');
|
|
13
|
+
}
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSheet, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
15
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiDropdownSheet, isStandalone: true, selector: "[tuiDropdownSheet]", inputs: { tuiDropdownSheet: { classPropertyName: "tuiDropdownSheet", publicName: "tuiDropdownSheet", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
16
|
+
{
|
|
17
|
+
provide: TUI_DROPDOWN_COMPONENT,
|
|
18
|
+
useFactory: () => inject(WA_IS_MOBILE)
|
|
19
|
+
? TuiDropdownSheetComponent
|
|
20
|
+
: inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
|
|
21
|
+
},
|
|
22
|
+
], ngImport: i0 }); }
|
|
23
|
+
}
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSheet, decorators: [{
|
|
25
|
+
type: Directive,
|
|
26
|
+
args: [{
|
|
27
|
+
selector: '[tuiDropdownSheet]',
|
|
28
|
+
providers: [
|
|
29
|
+
{
|
|
30
|
+
provide: TUI_DROPDOWN_COMPONENT,
|
|
31
|
+
useFactory: () => inject(WA_IS_MOBILE)
|
|
32
|
+
? TuiDropdownSheetComponent
|
|
33
|
+
: inject(TUI_DROPDOWN_COMPONENT, { skipSelf: true }),
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
}]
|
|
37
|
+
}] });
|
|
38
|
+
|
|
39
|
+
class TuiDropdownSheetComponent {
|
|
40
|
+
constructor() {
|
|
41
|
+
this.content = viewChild(TemplateRef);
|
|
42
|
+
this.dialogs = inject(TuiSheetDialogService);
|
|
43
|
+
this.directive = inject(TuiDropdownSheet);
|
|
44
|
+
this.dropdown = inject(TuiDropdownDirective);
|
|
45
|
+
this.context = { $implicit: () => this.dropdown.toggle(false) };
|
|
46
|
+
this.sub = toObservable(this.content)
|
|
47
|
+
.pipe(tuiIfMap((content) => this.dialogs.open(content, { label: this.directive.tuiDropdownSheet() })), takeUntilDestroyed())
|
|
48
|
+
.subscribe({ complete: () => this.dropdown.toggle(false) });
|
|
49
|
+
}
|
|
50
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
51
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.17", type: TuiDropdownSheetComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "content", first: true, predicate: TemplateRef, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
52
|
+
<ng-template>
|
|
53
|
+
<ng-container
|
|
54
|
+
*polymorpheusOutlet="dropdown.content() as text; context: context"
|
|
55
|
+
>
|
|
56
|
+
{{ text }}
|
|
57
|
+
</ng-container>
|
|
58
|
+
</ng-template>
|
|
59
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
60
|
+
}
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiDropdownSheetComponent, decorators: [{
|
|
62
|
+
type: Component,
|
|
63
|
+
args: [{
|
|
64
|
+
imports: [PolymorpheusOutlet],
|
|
65
|
+
template: `
|
|
66
|
+
<ng-template>
|
|
67
|
+
<ng-container
|
|
68
|
+
*polymorpheusOutlet="dropdown.content() as text; context: context"
|
|
69
|
+
>
|
|
70
|
+
{{ text }}
|
|
71
|
+
</ng-container>
|
|
72
|
+
</ng-template>
|
|
73
|
+
`,
|
|
74
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
|
+
}]
|
|
76
|
+
}] });
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Generated bundle index. Do not edit.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
export { TuiDropdownSheet, TuiDropdownSheetComponent };
|
|
83
|
+
//# sourceMappingURL=taiga-ui-addon-mobile-directives-dropdown-sheet.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-directives-dropdown-sheet.mjs","sources":["../../../projects/addon-mobile/directives/dropdown-sheet/dropdown-sheet.directive.ts","../../../projects/addon-mobile/directives/dropdown-sheet/dropdown-sheet.component.ts","../../../projects/addon-mobile/directives/dropdown-sheet/taiga-ui-addon-mobile-directives-dropdown-sheet.ts"],"sourcesContent":["import {Directive, inject, input} from '@angular/core';\nimport {WA_IS_MOBILE} from '@ng-web-apis/platform';\nimport {TUI_DROPDOWN_COMPONENT} from '@taiga-ui/core/portals/dropdown';\n\nimport {TuiDropdownSheetComponent} from './dropdown-sheet.component';\n\n@Directive({\n selector: '[tuiDropdownSheet]',\n providers: [\n {\n provide: TUI_DROPDOWN_COMPONENT,\n useFactory: () =>\n inject(WA_IS_MOBILE)\n ? TuiDropdownSheetComponent\n : inject(TUI_DROPDOWN_COMPONENT, {skipSelf: true}),\n },\n ],\n})\nexport class TuiDropdownSheet {\n public readonly tuiDropdownSheet = input('');\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n inject,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport {takeUntilDestroyed, toObservable} from '@angular/core/rxjs-interop';\nimport {TuiSheetDialogService} from '@taiga-ui/addon-mobile/components/sheet-dialog';\nimport {tuiIfMap} from '@taiga-ui/cdk/observables';\nimport {TuiDropdownDirective} from '@taiga-ui/core/portals/dropdown';\nimport {PolymorpheusOutlet} from '@taiga-ui/polymorpheus';\n\nimport {TuiDropdownSheet} from './dropdown-sheet.directive';\n\n@Component({\n imports: [PolymorpheusOutlet],\n template: `\n <ng-template>\n <ng-container\n *polymorpheusOutlet=\"dropdown.content() as text; context: context\"\n >\n {{ text }}\n </ng-container>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TuiDropdownSheetComponent {\n private readonly content = viewChild(TemplateRef);\n private readonly dialogs = inject(TuiSheetDialogService);\n private readonly directive = inject(TuiDropdownSheet);\n\n protected readonly dropdown = inject(TuiDropdownDirective);\n protected readonly context = {$implicit: (): void => this.dropdown.toggle(false)};\n protected readonly sub = toObservable(this.content)\n .pipe(\n tuiIfMap((content) =>\n this.dialogs.open(content, {label: this.directive.tuiDropdownSheet()}),\n ),\n takeUntilDestroyed(),\n )\n .subscribe({complete: () => this.dropdown.toggle(false)});\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAkBa,gBAAgB,CAAA;AAZ7B,IAAA,WAAA,GAAA;AAaoB,QAAA,IAAA,CAAA,gBAAgB,GAAG,KAAK,CAAC,EAAE,CAAC;AAC/C;+GAFY,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,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;;;AAQT,IAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAClD,iBAAA;;;AC3BD;;AAEG;;;;"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { afterNextRender, inject, INJECTOR, DestroyRef, NgZone, Injectable, Directive
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
2
|
+
import { afterNextRender, inject, INJECTOR, DestroyRef, NgZone, Injectable, Directive } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { tuiScrollFrom, tuiZoneOptimized } from '@taiga-ui/cdk/observables';
|
|
5
5
|
import { tuiInjectElement, tuiGetElementOffset } from '@taiga-ui/cdk/utils/dom';
|
|
6
|
-
import { SCROLL_REF_SELECTOR } from '@taiga-ui/core/components/scrollbar';
|
|
7
|
-
import { TUI_SCROLL_REF } from '@taiga-ui/core/tokens';
|
|
6
|
+
import { TUI_SCROLL_REF, SCROLL_REF_SELECTOR } from '@taiga-ui/core/components/scrollbar';
|
|
8
7
|
import { Observable, Subscription, scan, map, distinctUntilChanged } from 'rxjs';
|
|
9
8
|
|
|
10
9
|
class TuiElasticStickyService extends Observable {
|
|
@@ -44,31 +43,28 @@ class TuiElasticStickyService extends Observable {
|
|
|
44
43
|
this.host.getBoundingClientRect().top ===
|
|
45
44
|
0);
|
|
46
45
|
}
|
|
47
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
48
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
46
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiElasticStickyService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
47
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiElasticStickyService }); }
|
|
49
48
|
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiElasticStickyService, decorators: [{
|
|
51
50
|
type: Injectable
|
|
52
|
-
}], ctorParameters:
|
|
51
|
+
}], ctorParameters: () => [] });
|
|
53
52
|
|
|
54
53
|
class TuiElasticSticky {
|
|
55
54
|
constructor() {
|
|
56
|
-
this.tuiElasticSticky = inject(TuiElasticStickyService);
|
|
55
|
+
this.tuiElasticSticky = outputFromObservable(inject(TuiElasticStickyService));
|
|
57
56
|
}
|
|
58
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
59
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
57
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiElasticSticky, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
58
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TuiElasticSticky, isStandalone: true, selector: "[tuiElasticSticky]", outputs: { tuiElasticSticky: "tuiElasticSticky" }, providers: [TuiElasticStickyService], exportAs: ["tuiElasticSticky"], ngImport: i0 }); }
|
|
60
59
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
60
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiElasticSticky, decorators: [{
|
|
62
61
|
type: Directive,
|
|
63
62
|
args: [{
|
|
64
|
-
standalone: true,
|
|
65
63
|
selector: '[tuiElasticSticky]',
|
|
66
64
|
providers: [TuiElasticStickyService],
|
|
67
65
|
exportAs: 'tuiElasticSticky',
|
|
68
66
|
}]
|
|
69
|
-
}]
|
|
70
|
-
type: Output
|
|
71
|
-
}] } });
|
|
67
|
+
}] });
|
|
72
68
|
|
|
73
69
|
/**
|
|
74
70
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-directives-elastic-sticky.mjs","sources":["../../../projects/addon-mobile/directives/elastic-sticky/elastic-sticky.service.ts","../../../projects/addon-mobile/directives/elastic-sticky/elastic-sticky.directive.ts","../../../projects/addon-mobile/directives/elastic-sticky/taiga-ui-addon-mobile-directives-elastic-sticky.ts"],"sourcesContent":["import {\n afterNextRender,\n DestroyRef,\n inject,\n Injectable,\n INJECTOR,\n NgZone,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiScrollFrom, tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiGetElementOffset, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {SCROLL_REF_SELECTOR} from '@taiga-ui/core/components/scrollbar';\nimport {
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-directives-elastic-sticky.mjs","sources":["../../../projects/addon-mobile/directives/elastic-sticky/elastic-sticky.service.ts","../../../projects/addon-mobile/directives/elastic-sticky/elastic-sticky.directive.ts","../../../projects/addon-mobile/directives/elastic-sticky/taiga-ui-addon-mobile-directives-elastic-sticky.ts"],"sourcesContent":["import {\n afterNextRender,\n DestroyRef,\n inject,\n Injectable,\n INJECTOR,\n NgZone,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiScrollFrom, tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiGetElementOffset, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {SCROLL_REF_SELECTOR, TUI_SCROLL_REF} from '@taiga-ui/core/components/scrollbar';\nimport {distinctUntilChanged, map, Observable, scan, Subscription} from 'rxjs';\n\n@Injectable()\nexport class TuiElasticStickyService extends Observable<number> {\n private readonly injector = inject(INJECTOR);\n private readonly el = tuiInjectElement();\n private readonly scrollRef = inject(TUI_SCROLL_REF).nativeElement;\n private readonly destroyRef = inject(DestroyRef);\n private readonly zone = inject(NgZone);\n\n constructor() {\n super((subscriber) => {\n const subscription = new Subscription();\n\n afterNextRender(\n () => {\n const teardown = tuiScrollFrom(this.host)\n .pipe(\n scan(\n (top) => (this.pinned ? top : this.offsetTop),\n this.offsetTop,\n ),\n map((top) =>\n Math.max(\n 1 -\n Math.max(\n Math.round(this.host.scrollTop) - top,\n 0,\n ) /\n this.el.offsetHeight,\n 0,\n ),\n ),\n distinctUntilChanged(),\n tuiZoneOptimized(this.zone),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe(subscriber);\n\n if (!subscription.closed) {\n subscription.add(teardown);\n } else {\n teardown.unsubscribe();\n }\n },\n {injector: this.injector},\n );\n\n return subscription;\n });\n }\n\n private get host(): Element {\n // TODO: Test if we still need it now, that templates pass injector\n return this.el.closest(SCROLL_REF_SELECTOR) || this.scrollRef;\n }\n\n private get offsetTop(): number {\n return tuiGetElementOffset(this.host, this.el).offsetTop;\n }\n\n private get pinned(): boolean {\n return (\n this.el.getBoundingClientRect().top -\n this.host.getBoundingClientRect().top ===\n 0\n );\n }\n}\n","import {Directive, inject} from '@angular/core';\nimport {outputFromObservable} from '@angular/core/rxjs-interop';\n\nimport {TuiElasticStickyService} from './elastic-sticky.service';\n\n@Directive({\n selector: '[tuiElasticSticky]',\n providers: [TuiElasticStickyService],\n exportAs: 'tuiElasticSticky',\n})\nexport class TuiElasticSticky {\n public readonly tuiElasticSticky = outputFromObservable(\n inject(TuiElasticStickyService),\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAeM,MAAO,uBAAwB,SAAQ,UAAkB,CAAA;AAO3D,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,CAAC,CAAC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S,EAAE,CAAC,uBAAuB,CAAC;AACpC,oBAAA,QAAQ,EAAE,kBAAkB;AAC/B,iBAAA;;;ACTD;;AAEG;;;;"}
|
|
@@ -1,54 +1,71 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { tuiAsPopover } from '@taiga-ui/cdk/services';
|
|
2
|
+
import { input, inject, Directive, Injectable } from '@angular/core';
|
|
3
|
+
import { WA_IS_MOBILE } from '@ng-web-apis/platform';
|
|
5
4
|
import { TuiSheetDialogService } from '@taiga-ui/addon-mobile/components/sheet-dialog';
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { TuiDialogService } from '@taiga-ui/core/
|
|
5
|
+
import * as i1 from '@taiga-ui/cdk/portals';
|
|
6
|
+
import { TuiPortal, TuiPortalDirective } from '@taiga-ui/cdk/portals';
|
|
7
|
+
import { TuiDialogService } from '@taiga-ui/core/portals/dialog';
|
|
8
|
+
|
|
9
|
+
class TuiResponsiveDialog {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.tuiResponsiveDialogOptions = input({});
|
|
12
|
+
}
|
|
13
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiResponsiveDialog, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
14
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiResponsiveDialog, isStandalone: true, selector: "ng-template[tuiResponsiveDialog]", inputs: { tuiResponsiveDialogOptions: { classPropertyName: "tuiResponsiveDialogOptions", publicName: "tuiResponsiveDialogOptions", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
15
|
+
{
|
|
16
|
+
provide: TuiPortal,
|
|
17
|
+
useFactory: () => inject(WA_IS_MOBILE)
|
|
18
|
+
? inject(TuiSheetDialogService)
|
|
19
|
+
: inject(TuiDialogService),
|
|
20
|
+
},
|
|
21
|
+
], hostDirectives: [{ directive: i1.TuiPortalDirective, inputs: ["options", "tuiResponsiveDialogOptions", "open", "tuiResponsiveDialog"], outputs: ["openChange", "tuiResponsiveDialogChange"] }], ngImport: i0 }); }
|
|
22
|
+
}
|
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiResponsiveDialog, decorators: [{
|
|
24
|
+
type: Directive,
|
|
25
|
+
args: [{
|
|
26
|
+
selector: 'ng-template[tuiResponsiveDialog]',
|
|
27
|
+
providers: [
|
|
28
|
+
{
|
|
29
|
+
provide: TuiPortal,
|
|
30
|
+
useFactory: () => inject(WA_IS_MOBILE)
|
|
31
|
+
? inject(TuiSheetDialogService)
|
|
32
|
+
: inject(TuiDialogService),
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
hostDirectives: [
|
|
36
|
+
{
|
|
37
|
+
directive: TuiPortalDirective,
|
|
38
|
+
inputs: ['options: tuiResponsiveDialogOptions', 'open: tuiResponsiveDialog'],
|
|
39
|
+
outputs: ['openChange: tuiResponsiveDialogChange'],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
}]
|
|
43
|
+
}] });
|
|
9
44
|
|
|
10
45
|
/**
|
|
11
46
|
* Same as `TuiDialogService` but automatically switches to `TuiSheetDialogService` on mobile
|
|
12
47
|
*/
|
|
13
48
|
class TuiResponsiveDialogService {
|
|
14
49
|
constructor() {
|
|
15
|
-
this.isMobile = inject(
|
|
50
|
+
this.isMobile = inject(WA_IS_MOBILE);
|
|
16
51
|
this.dialogs = inject(TuiDialogService);
|
|
17
52
|
this.sheets = inject(TuiSheetDialogService);
|
|
18
53
|
}
|
|
19
54
|
open(content, options = {}) {
|
|
20
55
|
return this.isMobile
|
|
21
56
|
? this.sheets.open(content, options)
|
|
22
|
-
: this.dialogs.open(content,
|
|
23
|
-
...options,
|
|
24
|
-
label: tuiIsString(options.label) ? options.label : '',
|
|
25
|
-
});
|
|
57
|
+
: this.dialogs.open(content, options);
|
|
26
58
|
}
|
|
27
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
28
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
59
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiResponsiveDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
60
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiResponsiveDialogService, providedIn: 'root' }); }
|
|
29
61
|
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiResponsiveDialogService, decorators: [{
|
|
31
63
|
type: Injectable,
|
|
32
64
|
args: [{
|
|
33
65
|
providedIn: 'root',
|
|
34
66
|
}]
|
|
35
67
|
}] });
|
|
36
68
|
|
|
37
|
-
class TuiResponsiveDialog extends TuiPopoverDirective {
|
|
38
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiResponsiveDialog, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
39
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: TuiResponsiveDialog, isStandalone: true, selector: "ng-template[tuiResponsiveDialog]", inputs: { options: ["tuiResponsiveDialogOptions", "options"], open: ["tuiResponsiveDialog", "open"] }, outputs: { openChange: "tuiResponsiveDialogChange" }, providers: [tuiAsPopover(TuiResponsiveDialogService)], usesInheritance: true, ngImport: i0 }); }
|
|
40
|
-
}
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiResponsiveDialog, decorators: [{
|
|
42
|
-
type: Directive,
|
|
43
|
-
args: [{
|
|
44
|
-
standalone: true,
|
|
45
|
-
selector: 'ng-template[tuiResponsiveDialog]',
|
|
46
|
-
inputs: ['options: tuiResponsiveDialogOptions', 'open: tuiResponsiveDialog'],
|
|
47
|
-
outputs: ['openChange: tuiResponsiveDialogChange'],
|
|
48
|
-
providers: [tuiAsPopover(TuiResponsiveDialogService)],
|
|
49
|
-
}]
|
|
50
|
-
}] });
|
|
51
|
-
|
|
52
69
|
/**
|
|
53
70
|
* Generated bundle index. Do not edit.
|
|
54
71
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-directives-responsive-dialog.mjs","sources":["../../../projects/addon-mobile/directives/responsive-dialog/responsive-dialog.
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-directives-responsive-dialog.mjs","sources":["../../../projects/addon-mobile/directives/responsive-dialog/responsive-dialog.directive.ts","../../../projects/addon-mobile/directives/responsive-dialog/responsive-dialog.service.ts","../../../projects/addon-mobile/directives/responsive-dialog/taiga-ui-addon-mobile-directives-responsive-dialog.ts"],"sourcesContent":["import {Directive, inject, input} from '@angular/core';\nimport {WA_IS_MOBILE} from '@ng-web-apis/platform';\nimport {TuiSheetDialogService} from '@taiga-ui/addon-mobile/components/sheet-dialog';\nimport {TuiPortal, TuiPortalDirective} from '@taiga-ui/cdk/portals';\nimport {TuiDialogService} from '@taiga-ui/core/portals/dialog';\n\nimport {type TuiResponsiveDialogOptions} from './responsive-dialog.service';\n\n@Directive({\n selector: 'ng-template[tuiResponsiveDialog]',\n providers: [\n {\n provide: TuiPortal,\n useFactory: () =>\n inject(WA_IS_MOBILE)\n ? inject(TuiSheetDialogService)\n : inject(TuiDialogService),\n },\n ],\n hostDirectives: [\n {\n directive: TuiPortalDirective,\n inputs: ['options: tuiResponsiveDialogOptions', 'open: tuiResponsiveDialog'],\n outputs: ['openChange: tuiResponsiveDialogChange'],\n },\n ],\n})\nexport class TuiResponsiveDialog<T> {\n public readonly tuiResponsiveDialogOptions = input<\n Partial<TuiResponsiveDialogOptions<T>>\n >({});\n}\n","import {inject, Injectable} from '@angular/core';\nimport {WA_IS_MOBILE} from '@ng-web-apis/platform';\nimport {\n type TuiSheetDialogOptions,\n TuiSheetDialogService,\n} from '@taiga-ui/addon-mobile/components/sheet-dialog';\nimport {type TuiPortalContext} from '@taiga-ui/cdk/portals';\nimport {type TuiDialogOptions, TuiDialogService} from '@taiga-ui/core/portals/dialog';\nimport {type PolymorpheusContent} from '@taiga-ui/polymorpheus';\nimport {type Observable} from 'rxjs';\n\nexport interface TuiResponsiveDialogOptions<I = undefined>\n extends TuiDialogOptions<I>, TuiSheetDialogOptions<I> {}\n\n/**\n * Same as `TuiDialogService` but automatically switches to `TuiSheetDialogService` on mobile\n */\n@Injectable({\n providedIn: 'root',\n})\nexport class TuiResponsiveDialogService {\n private readonly isMobile = inject(WA_IS_MOBILE);\n private readonly dialogs = inject(TuiDialogService);\n private readonly sheets = inject(TuiSheetDialogService);\n\n public open<G = void>(\n content: PolymorpheusContent<TuiPortalContext<TuiResponsiveDialogOptions, G>>,\n options: Partial<TuiResponsiveDialogOptions<any>> = {},\n ): Observable<G> {\n return this.isMobile\n ? this.sheets.open(content, options)\n : this.dialogs.open(content, options);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MA2Ba,mBAAmB,CAAA;AAnBhC,IAAA,WAAA,GAAA;AAoBoB,QAAA,IAAA,CAAA,0BAA0B,GAAG,KAAK,CAEhD,EAAE,CAAC;AACR;+GAJY,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EA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,yBAAA;AACJ,qBAAA;AACJ,iBAAA;;;ACZD;;AAEG;MAIU,0BAA0B,CAAA;AAHvC,IAAA,WAAA,GAAA;AAIqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,YAAY,CAAC;AAC/B,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAClC,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAU1D;AARU,IAAA,IAAI,CACP,OAA6E,EAC7E,OAAA,GAAoD,EAAE,EAAA;QAEtD,OAAO,IAAI,CAAC;cACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO;cACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;;+GAXpC,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cAFvB,MAAM,EAAA,CAAA,CAAA;;4FAET,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAHtC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,UAAU,EAAE,MAAM;AACrB,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -1,62 +1,42 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { ChangeDetectionStrategy, ViewEncapsulation, Component, inject, DestroyRef, input, Directive } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import { tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
|
|
6
5
|
import { tuiIsHTMLElement } from '@taiga-ui/cdk/utils/dom';
|
|
7
6
|
import { tuiWithStyles, tuiPx } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
8
7
|
import { TUI_ANIMATIONS_SPEED } from '@taiga-ui/core/tokens';
|
|
9
8
|
import { tuiGetDuration } from '@taiga-ui/core/utils/miscellaneous';
|
|
10
|
-
import { merge, race, switchMap, first, tap } from 'rxjs';
|
|
9
|
+
import { merge, fromEvent, race, switchMap, first, tap } from 'rxjs';
|
|
11
10
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
opacity: '0.12',
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
const FROM_KEYFRAMES = [
|
|
22
|
-
{
|
|
23
|
-
opacity: '0.12',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
opacity: '0',
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
class TuiRippleStyles {
|
|
30
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiRippleStyles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
31
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiRippleStyles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-ripple-styles" }, ngImport: i0, template: '', isInline: true, styles: [".tui-ripple{position:absolute;z-index:100;opacity:.12;border-radius:100%;background:var(--tui-ripple-background, currentColor);animation-fill-mode:forwards;pointer-events:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
11
|
+
const TO = [{ transform: 'scale(0)', opacity: '0.12' }, { opacity: '0.12' }];
|
|
12
|
+
const FROM = [{ opacity: '0.12' }, { opacity: '0' }];
|
|
13
|
+
class Styles {
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: Styles, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: Styles, isStandalone: true, selector: "ng-component", host: { classAttribute: "tui-ripple" }, ngImport: i0, template: '', isInline: true, styles: [".tui-ripple{position:absolute;z-index:100;opacity:.12;border-radius:100%;background:var(--tui-ripple-background, currentColor);animation-fill-mode:forwards;pointer-events:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
32
16
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: Styles, decorators: [{
|
|
34
18
|
type: Component,
|
|
35
|
-
args: [{
|
|
36
|
-
class: 'tui-ripple-styles',
|
|
37
|
-
}, styles: [".tui-ripple{position:absolute;z-index:100;opacity:.12;border-radius:100%;background:var(--tui-ripple-background, currentColor);animation-fill-mode:forwards;pointer-events:none}\n"] }]
|
|
19
|
+
args: [{ template: '', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'tui-ripple' }, styles: [".tui-ripple{position:absolute;z-index:100;opacity:.12;border-radius:100%;background:var(--tui-ripple-background, currentColor);animation-fill-mode:forwards;pointer-events:none}\n"] }]
|
|
38
20
|
}] });
|
|
39
21
|
class TuiRipple {
|
|
40
22
|
constructor() {
|
|
41
23
|
this.doc = inject(DOCUMENT);
|
|
42
24
|
this.destroyRef = inject(DestroyRef);
|
|
43
|
-
this.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.nothing = tuiWithStyles(TuiRippleStyles);
|
|
47
|
-
this.tuiRipple = '';
|
|
25
|
+
this.duration = tuiGetDuration(inject(TUI_ANIMATIONS_SPEED));
|
|
26
|
+
this.nothing = tuiWithStyles(Styles);
|
|
27
|
+
this.tuiRipple = input('');
|
|
48
28
|
}
|
|
49
29
|
start(x, y, target, el) {
|
|
50
|
-
const element = this.tuiRipple ? target.closest(this.tuiRipple) : el;
|
|
30
|
+
const element = this.tuiRipple() ? target.closest(this.tuiRipple()) : el;
|
|
51
31
|
if (!tuiIsHTMLElement(element)) {
|
|
52
32
|
return;
|
|
53
33
|
}
|
|
54
34
|
const ripple = this.createRipple(x, y, element.getBoundingClientRect());
|
|
55
|
-
const touchEnd$ = merge(
|
|
35
|
+
const touchEnd$ = merge(fromEvent(element, 'pointerup'), fromEvent(element, 'pointercancel'), fromEvent(element, 'pointermove'));
|
|
56
36
|
element.appendChild(ripple);
|
|
57
|
-
const
|
|
58
|
-
race(touchEnd$.pipe(switchMap(() =>
|
|
59
|
-
.pipe(first(), switchMap(() =>
|
|
37
|
+
const animationEnd$ = fromEvent(ripple.animate(TO, this.duration), 'finish');
|
|
38
|
+
race(touchEnd$.pipe(switchMap(() => animationEnd$)), animationEnd$.pipe(switchMap(() => touchEnd$)))
|
|
39
|
+
.pipe(first(), switchMap(() => fromEvent(ripple.animate(FROM, this.duration), 'finish')), first(), tap(() => element.removeChild(ripple)), takeUntilDestroyed(this.destroyRef))
|
|
60
40
|
.subscribe();
|
|
61
41
|
}
|
|
62
42
|
createRipple(clientX, clientY, { width, height, top, left }) {
|
|
@@ -80,21 +60,18 @@ class TuiRipple {
|
|
|
80
60
|
});
|
|
81
61
|
return ripple;
|
|
82
62
|
}
|
|
83
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
84
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
63
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiRipple, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
64
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiRipple, isStandalone: true, selector: "[tuiRipple]", inputs: { tuiRipple: { classPropertyName: "tuiRipple", publicName: "tuiRipple", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "pointerdown.zoneless": "start($event.clientX, $event.clientY, $event.target, $event.currentTarget)" } }, ngImport: i0 }); }
|
|
85
65
|
}
|
|
86
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
66
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiRipple, decorators: [{
|
|
87
67
|
type: Directive,
|
|
88
68
|
args: [{
|
|
89
|
-
standalone: true,
|
|
90
69
|
selector: '[tuiRipple]',
|
|
91
70
|
host: {
|
|
92
71
|
'(pointerdown.zoneless)': 'start($event.clientX, $event.clientY, $event.target, $event.currentTarget)',
|
|
93
72
|
},
|
|
94
73
|
}]
|
|
95
|
-
}]
|
|
96
|
-
type: Input
|
|
97
|
-
}] } });
|
|
74
|
+
}] });
|
|
98
75
|
|
|
99
76
|
/**
|
|
100
77
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-addon-mobile-directives-ripple.mjs","sources":["../../../projects/addon-mobile/directives/ripple/ripple.directive.ts","../../../projects/addon-mobile/directives/ripple/taiga-ui-addon-mobile-directives-ripple.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n inject,\n
|
|
1
|
+
{"version":3,"file":"taiga-ui-addon-mobile-directives-ripple.mjs","sources":["../../../projects/addon-mobile/directives/ripple/ripple.directive.ts","../../../projects/addon-mobile/directives/ripple/taiga-ui-addon-mobile-directives-ripple.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n Directive,\n inject,\n input,\n ViewEncapsulation,\n} from '@angular/core';\nimport {takeUntilDestroyed} from '@angular/core/rxjs-interop';\nimport {tuiIsHTMLElement} from '@taiga-ui/cdk/utils/dom';\nimport {tuiPx, tuiWithStyles} from '@taiga-ui/cdk/utils/miscellaneous';\nimport {TUI_ANIMATIONS_SPEED} from '@taiga-ui/core/tokens';\nimport {tuiGetDuration} from '@taiga-ui/core/utils/miscellaneous';\nimport {first, fromEvent, merge, race, switchMap, tap} from 'rxjs';\n\nconst TO = [{transform: 'scale(0)', opacity: '0.12'}, {opacity: '0.12'}];\nconst FROM = [{opacity: '0.12'}, {opacity: '0'}];\n\n@Component({\n template: '',\n styleUrl: './ripple.style.less',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {class: 'tui-ripple'},\n})\nclass Styles {}\n\n@Directive({\n selector: '[tuiRipple]',\n host: {\n '(pointerdown.zoneless)':\n 'start($event.clientX, $event.clientY, $event.target, $event.currentTarget)',\n },\n})\nexport class TuiRipple {\n private readonly doc = inject(DOCUMENT);\n private readonly destroyRef = inject(DestroyRef);\n private readonly duration = tuiGetDuration(inject(TUI_ANIMATIONS_SPEED));\n\n protected readonly nothing = tuiWithStyles(Styles);\n\n public readonly tuiRipple = input('');\n\n protected start(x: number, y: number, target: HTMLElement, el: HTMLElement): void {\n const element = this.tuiRipple() ? target.closest(this.tuiRipple()) : el;\n\n if (!tuiIsHTMLElement(element)) {\n return;\n }\n\n const ripple = this.createRipple(x, y, element.getBoundingClientRect());\n const touchEnd$ = merge(\n fromEvent(element, 'pointerup'),\n fromEvent(element, 'pointercancel'),\n fromEvent(element, 'pointermove'),\n );\n\n element.appendChild(ripple);\n\n const animationEnd$ = fromEvent(ripple.animate(TO, this.duration), 'finish');\n\n race(\n touchEnd$.pipe(switchMap(() => animationEnd$)),\n animationEnd$.pipe(switchMap(() => touchEnd$)),\n )\n .pipe(\n first(),\n switchMap(() => fromEvent(ripple.animate(FROM, this.duration), 'finish')),\n first(),\n tap(() => element.removeChild(ripple)),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe();\n }\n\n private createRipple(\n clientX: number,\n clientY: number,\n {width, height, top, left}: DOMRect,\n ): HTMLElement {\n const ripple: HTMLElement = this.doc.createElement('div');\n const radius = Math.sqrt(width * width + height * height);\n const dimension = radius * 2;\n const x = clientX - left - radius;\n const y = clientY - top - radius;\n\n Object.assign(ripple.style, {\n position: 'absolute',\n top: tuiPx(y),\n left: tuiPx(x),\n width: tuiPx(dimension),\n height: tuiPx(dimension),\n zIndex: 100,\n opacity: 0.12,\n borderRadius: '100%',\n background: 'var(--tui-ripple-background, currentColor)',\n animationFillMode: 'forwards',\n pointerEvents: 'none',\n });\n\n return ripple;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAiBA,MAAM,EAAE,GAAG,CAAC,EAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAC,EAAE,EAAC,OAAO,EAAE,MAAM,EAAC,CAAC;AACxE,MAAM,IAAI,GAAG,CAAC,EAAC,OAAO,EAAE,MAAM,EAAC,EAAE,EAAC,OAAO,EAAE,GAAG,EAAC,CAAC;AAEhD,MAOM,MAAM,CAAA;+GAAN,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAN,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,MAAM,gHANE,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,oLAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,C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AK,EAAE,KAAK,CAAC,SAAS,CAAC;AACvB,YAAA,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC;AACxB,YAAA,MAAM,EAAE,GAAG;AACX,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,YAAY,EAAE,MAAM;AACpB,YAAA,UAAU,EAAE,4CAA4C;AACxD,YAAA,iBAAiB,EAAE,UAAU;AAC7B,YAAA,aAAa,EAAE,MAAM;AACxB,SAAA,CAAC;AAEF,QAAA,OAAO,MAAM;;+GAlER,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAT,SAAS,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,WAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,sBAAA,EAAA,4EAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBAPrB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,IAAI,EAAE;AACF,wBAAA,wBAAwB,EACpB,4EAA4E;AACnF,qBAAA;AACJ,iBAAA;;;ACnCD;;AAEG;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
3
|
+
import { inject, computed, input, Directive } from '@angular/core';
|
|
3
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
+
import { WA_IS_IOS } from '@ng-web-apis/platform';
|
|
4
6
|
import { tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
|
|
5
|
-
import { TUI_IS_IOS } from '@taiga-ui/cdk/tokens';
|
|
6
7
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
7
8
|
import { tap, map, switchMap, race, filter, take } from 'rxjs';
|
|
8
9
|
|
|
@@ -11,7 +12,7 @@ const STYLE = {
|
|
|
11
12
|
opacity: '0.6',
|
|
12
13
|
background: 'rgba(146, 153, 162, 0.12)',
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
+
function findIndex(touches, id = 0) {
|
|
15
16
|
for (let i = 0; i < touches.length; i++) {
|
|
16
17
|
if (touches[i]?.identifier === id) {
|
|
17
18
|
return i;
|
|
@@ -21,57 +22,49 @@ function tuiFindTouchIndex(touches, id) {
|
|
|
21
22
|
}
|
|
22
23
|
class TuiTouchable {
|
|
23
24
|
constructor() {
|
|
24
|
-
this.isIOS = inject(
|
|
25
|
+
this.isIOS = inject(WA_IS_IOS);
|
|
25
26
|
this.el = tuiInjectElement();
|
|
26
|
-
this.
|
|
27
|
+
this.doc = inject(DOCUMENT);
|
|
28
|
+
this.style = computed(() => this.tuiTouchable() || 'transform');
|
|
29
|
+
this.tuiTouchable = input('');
|
|
27
30
|
if (!this.isIOS) {
|
|
28
31
|
return;
|
|
29
32
|
}
|
|
30
33
|
tuiTypedFromEvent(this.el, 'touchstart', { passive: true })
|
|
31
|
-
.pipe(tap(() => this.onTouchStart()), map(({ touches }) => touches[touches.length - 1]?.identifier), switchMap((
|
|
34
|
+
.pipe(tap(() => this.onTouchStart()), map(({ touches }) => touches[touches.length - 1]?.identifier), switchMap((id) => race(tuiTypedFromEvent(this.el, 'touchend'), tuiTypedFromEvent(this.el, 'touchmove', { passive: true }).pipe(filter(({ touches }) => this.hasTouches(this.el, touches, id)))).pipe(take(1))), takeUntilDestroyed())
|
|
32
35
|
.subscribe(() => {
|
|
33
36
|
this.el.style.removeProperty('transform');
|
|
34
37
|
this.el.style.removeProperty('opacity');
|
|
35
38
|
this.el.style.removeProperty('background');
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const { ownerDocument } = element;
|
|
43
|
-
const id = tuiFindTouchIndex(touches, identifier);
|
|
44
|
-
if (!ownerDocument || id === -1) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
const { clientX = 0, clientY = 0 } = touches[id] ?? {};
|
|
48
|
-
return !element.contains(ownerDocument.elementFromPoint(clientX, clientY));
|
|
41
|
+
hasTouches(el, touches, id) {
|
|
42
|
+
const index = findIndex(touches, id);
|
|
43
|
+
const { clientX = 0, clientY = 0 } = touches[index] ?? {};
|
|
44
|
+
return index === -1 || !el.contains(this.doc.elementFromPoint(clientX, clientY));
|
|
49
45
|
}
|
|
50
46
|
onTouchStart() {
|
|
51
|
-
if (this.style !== 'transform') {
|
|
47
|
+
if (this.style() !== 'transform') {
|
|
52
48
|
this.el.style.removeProperty('transition');
|
|
53
49
|
}
|
|
54
50
|
else {
|
|
55
51
|
this.el.style.setProperty('transition', 'transform 0.2s');
|
|
56
52
|
}
|
|
57
|
-
this.el.style.setProperty(this.style, STYLE[this.style]);
|
|
53
|
+
this.el.style.setProperty(this.style(), STYLE[this.style()]);
|
|
58
54
|
}
|
|
59
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
60
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTouchable, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
56
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.17", type: TuiTouchable, isStandalone: true, selector: "[tuiTouchable]", inputs: { tuiTouchable: { classPropertyName: "tuiTouchable", publicName: "tuiTouchable", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
61
57
|
}
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TuiTouchable, decorators: [{
|
|
63
59
|
type: Directive,
|
|
64
60
|
args: [{
|
|
65
|
-
standalone: true,
|
|
66
61
|
selector: '[tuiTouchable]',
|
|
67
62
|
}]
|
|
68
|
-
}], ctorParameters:
|
|
69
|
-
type: Input
|
|
70
|
-
}] } });
|
|
63
|
+
}], ctorParameters: () => [] });
|
|
71
64
|
|
|
72
65
|
/**
|
|
73
66
|
* Generated bundle index. Do not edit.
|
|
74
67
|
*/
|
|
75
68
|
|
|
76
|
-
export { TuiTouchable
|
|
69
|
+
export { TuiTouchable };
|
|
77
70
|
//# sourceMappingURL=taiga-ui-addon-mobile-directives-touchable.mjs.map
|