@taiga-ui/cdk 4.52.0-canary.24b31eb → 4.52.0-canary.2fa3dd5
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 +1 -1
- package/classes/control.d.ts +4 -6
- package/classes/index.d.ts +0 -1
- package/constants/index.d.ts +0 -1
- package/constants/used-icons.d.ts +1 -1
- package/constants/version.d.ts +1 -1
- package/constants/version.js +1 -1
- package/date-time/time.d.ts +2 -2
- package/date-time/types.d.ts +0 -5
- package/directives/auto-focus/autofocus.directive.d.ts +2 -3
- package/directives/auto-focus/autofocus.options.d.ts +1 -1
- package/directives/click-outside/click-outside.directive.d.ts +2 -2
- package/directives/copy-processor/copy-processor.directive.d.ts +2 -2
- package/directives/droppable/droppable.directive.d.ts +4 -2
- package/directives/hovered/hovered.directive.d.ts +1 -2
- package/directives/index.d.ts +0 -1
- package/directives/media/media.directive.d.ts +8 -12
- package/directives/native-validator/native-validator.directive.d.ts +2 -2
- package/directives/obscured/obscured.directive.d.ts +4 -4
- package/directives/pan/pan.directive.d.ts +1 -2
- package/directives/platform/platform.directive.d.ts +2 -2
- package/directives/repeat-times/repeat-times.directive.d.ts +5 -4
- package/directives/resizer/resizer.directive.d.ts +3 -4
- package/directives/swipe/swipe.directive.d.ts +1 -2
- package/directives/value-changes/value-changes.directive.d.ts +2 -2
- package/fesm2022/taiga-ui-cdk-classes.mjs +6 -89
- package/fesm2022/taiga-ui-cdk-classes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-constants.mjs +14 -7
- package/fesm2022/taiga-ui-cdk-constants.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-date-time.mjs +13 -1
- package/fesm2022/taiga-ui-cdk-date-time.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-active-zone.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-animated.mjs +0 -2
- package/fesm2022/taiga-ui-cdk-directives-animated.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs +8 -11
- package/fesm2022/taiga-ui-cdk-directives-auto-focus.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs +5 -6
- package/fesm2022/taiga-ui-cdk-directives-click-outside.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-control.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-control.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs +5 -8
- package/fesm2022/taiga-ui-cdk-directives-copy-processor.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs +7 -9
- package/fesm2022/taiga-ui-cdk-directives-droppable.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-element.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-element.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-focus-trap.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-font-size.mjs +1 -4
- package/fesm2022/taiga-ui-cdk-directives-font-size.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-high-dpi.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs +4 -7
- package/fesm2022/taiga-ui-cdk-directives-hovered.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-item.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-item.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-let.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-let.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-media.mjs +30 -55
- package/fesm2022/taiga-ui-cdk-directives-media.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs +5 -8
- package/fesm2022/taiga-ui-cdk-directives-native-validator.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs +8 -14
- package/fesm2022/taiga-ui-cdk-directives-obscured.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs +4 -6
- package/fesm2022/taiga-ui-cdk-directives-pan.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs +7 -10
- package/fesm2022/taiga-ui-cdk-directives-platform.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs +20 -21
- package/fesm2022/taiga-ui-cdk-directives-repeat-times.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-resizer.mjs +14 -18
- package/fesm2022/taiga-ui-cdk-directives-resizer.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs +4 -6
- package/fesm2022/taiga-ui-cdk-directives-swipe.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-transitioned.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-validator.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-validator.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs +5 -6
- package/fesm2022/taiga-ui-cdk-directives-value-changes.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-visual-viewport.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives-zoom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-directives.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-directives.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-observables.mjs +8 -4
- package/fesm2022/taiga-ui-cdk-observables.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-animation.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-animation.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-filter.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-is-present.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-keys.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-keys.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-mapper.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-obfuscate.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-repeat-times.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-replace.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-replace.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs +0 -1
- package/fesm2022/taiga-ui-cdk-pipes-to-array.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-portals.mjs +127 -0
- package/fesm2022/taiga-ui-cdk-portals.mjs.map +1 -0
- package/fesm2022/taiga-ui-cdk-services.mjs +3 -43
- package/fesm2022/taiga-ui-cdk-services.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs +1 -23
- package/fesm2022/taiga-ui-cdk-utils-browser.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs +2 -1
- package/fesm2022/taiga-ui-cdk-utils-color.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs +2 -2
- package/fesm2022/taiga-ui-cdk-utils-dom.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs +7 -11
- package/fesm2022/taiga-ui-cdk-utils-miscellaneous.mjs.map +1 -1
- package/fesm2022/taiga-ui-cdk.mjs +1 -0
- package/fesm2022/taiga-ui-cdk.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +13 -10
- package/pipes/obfuscate/obfuscate.options.d.ts +1 -1
- package/portals/directive.d.ts +11 -0
- package/portals/index.d.ts +4 -0
- package/portals/portal.d.ts +25 -0
- package/portals/portals.d.ts +12 -0
- package/portals/service.d.ts +15 -0
- package/schematics/collection.json +2 -1
- package/schematics/migrate-tui-let/index.js +4 -3
- package/schematics/migrate-tui-let/index.js.map +1 -1
- package/schematics/migrate-tui-let/schema.json +7 -0
- package/schematics/ng-add/constants/versions.d.ts +1 -1
- package/schematics/ng-update/interfaces/html-comment.d.ts +1 -1
- package/schematics/ng-update/interfaces/removable-input.d.ts +1 -1
- package/schematics/ng-update/interfaces/replacement-attribute-to-directive.d.ts +1 -1
- package/schematics/ng-update/interfaces/replacement-attribute-value.d.ts +1 -1
- package/schematics/ng-update/interfaces/replacement-attribute.d.ts +1 -1
- package/schematics/ng-update/interfaces/replacement-tag.d.ts +1 -1
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js +1 -1
- package/schematics/ng-update/v4/migrate-css-vars/rename-css-vars.js.map +1 -1
- package/schematics/ng-update/v4/steps/constants/migration-warnings.js +1 -1
- package/schematics/ng-update/v4/steps/constants/migration-warnings.js.map +1 -1
- package/schematics/ng-update/v4/steps/migrate-templates.d.ts +2 -2
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js +1 -1
- package/schematics/ng-update/v4/steps/restore-tui-mapper.js.map +1 -1
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js +1 -1
- package/schematics/ng-update/v4/steps/restore-tui-matcher.js.map +1 -1
- package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js +1 -1
- package/schematics/ng-update/v4/steps/styles/migrate-space-mixins.js.map +1 -1
- package/schematics/ng-update/v5/index.js +5 -0
- package/schematics/ng-update/v5/index.js.map +1 -1
- package/schematics/ng-update/v5/steps/constants/functions.js +36 -0
- package/schematics/ng-update/v5/steps/constants/functions.js.map +1 -1
- package/schematics/ng-update/v5/steps/constants/html-comments.d.ts +2 -0
- package/schematics/ng-update/v5/steps/constants/html-comments.js +11 -0
- package/schematics/ng-update/v5/steps/constants/html-comments.js.map +1 -0
- package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.d.ts +2 -0
- package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.js +22 -0
- package/schematics/ng-update/v5/steps/constants/identifiers-to-replace.js.map +1 -0
- package/schematics/ng-update/v5/steps/migrate-templates.d.ts +17 -0
- package/schematics/ng-update/v5/steps/migrate-templates.js +42 -0
- package/schematics/ng-update/v5/steps/migrate-templates.js.map +1 -0
- package/schematics/ng-update/v5/steps/templates/migrate-input-year.d.ts +8 -0
- package/schematics/ng-update/v5/steps/templates/migrate-input-year.js +52 -0
- package/schematics/ng-update/v5/steps/templates/migrate-input-year.js.map +1 -0
- package/schematics/utils/angular-json-manipulations.js +0 -2
- package/schematics/utils/angular-json-manipulations.js.map +1 -1
- package/schematics/utils/run-migration.d.ts +14 -0
- package/schematics/utils/run-migration.js +26 -0
- package/schematics/utils/run-migration.js.map +1 -0
- package/schematics/utils/templates/elements.js +4 -12
- package/schematics/utils/templates/elements.js.map +1 -1
- package/schematics/utils/templates/ng-component-input-manipulations.d.ts +3 -3
- package/schematics/utils/templates/ng-component-input-manipulations.js +1 -3
- package/schematics/utils/templates/ng-component-input-manipulations.js.map +1 -1
- package/services/index.d.ts +0 -1
- package/utils/browser/index.d.ts +0 -2
- package/utils/miscellaneous/index.d.ts +1 -1
- package/utils/miscellaneous/object-shallow-equals.d.ts +1 -0
- package/classes/portals.d.ts +0 -33
- package/constants/allow-signal-writes.d.ts +0 -2
- package/directives/popover/index.d.ts +0 -1
- package/directives/popover/popover.directive.d.ts +0 -14
- package/fesm2022/taiga-ui-cdk-directives-popover.mjs +0 -32
- package/fesm2022/taiga-ui-cdk-directives-popover.mjs.map +0 -1
- package/services/popover.service.d.ts +0 -25
- package/utils/browser/is-apple.d.ts +0 -11
- package/utils/browser/is-ios.d.ts +0 -6
- package/utils/miscellaneous/directive-listener.d.ts +0 -9
|
@@ -1,65 +1,55 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { effect, untracked, input, model, Directive } from '@angular/core';
|
|
3
3
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils';
|
|
4
4
|
|
|
5
5
|
class TuiMedia {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.el = tuiInjectElement();
|
|
8
|
-
this.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
this.
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
get currentTime() {
|
|
32
|
-
return this.el.currentTime ?? 0;
|
|
33
|
-
}
|
|
34
|
-
get paused() {
|
|
35
|
-
return this.el.paused;
|
|
8
|
+
this.setElCurrentTime = effect(() => {
|
|
9
|
+
if (Math.abs(this.currentTime() - this.el.currentTime) > 0.05) {
|
|
10
|
+
this.el.currentTime = this.currentTime();
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
this.setElPlaybackRate = effect(() => {
|
|
14
|
+
this.updatePlaybackRate(this.playbackRate());
|
|
15
|
+
});
|
|
16
|
+
this.setElPaused = effect(() => {
|
|
17
|
+
const paused = this.paused();
|
|
18
|
+
if (paused) {
|
|
19
|
+
this.el.pause?.();
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
void this.el.play?.();
|
|
23
|
+
}
|
|
24
|
+
this.updatePlaybackRate(untracked(this.playbackRate));
|
|
25
|
+
});
|
|
26
|
+
this.playbackRate = input(1);
|
|
27
|
+
this.volume = model(1);
|
|
28
|
+
this.currentTime = model(this.el.currentTime ?? 0);
|
|
29
|
+
this.paused = model(this.el.paused);
|
|
36
30
|
}
|
|
37
31
|
onPausedChange(paused) {
|
|
38
|
-
this.
|
|
39
|
-
this.updatePlaybackRate(this.playbackRate);
|
|
32
|
+
this.paused.set(paused);
|
|
40
33
|
}
|
|
41
34
|
onVolumeChange() {
|
|
42
|
-
this.volume
|
|
43
|
-
this.volumeChange.emit(this.volume);
|
|
35
|
+
this.volume.set(this.el.volume);
|
|
44
36
|
}
|
|
45
37
|
onCurrentTimeChange() {
|
|
46
|
-
this.
|
|
38
|
+
this.currentTime.set(this.el.currentTime);
|
|
47
39
|
}
|
|
48
40
|
updatePlaybackRate(playbackRate) {
|
|
49
|
-
this.playbackRate = playbackRate;
|
|
50
|
-
this.el.playbackRate = this.playbackRate;
|
|
41
|
+
this.el.playbackRate = playbackRate;
|
|
51
42
|
}
|
|
52
43
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMedia, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
53
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
44
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiMedia, isStandalone: true, selector: "video[tuiMedia], audio[tuiMedia]", inputs: { playbackRate: { classPropertyName: "playbackRate", publicName: "playbackRate", isSignal: true, isRequired: false, transformFunction: null }, volume: { classPropertyName: "volume", publicName: "volume", isSignal: true, isRequired: false, transformFunction: null }, currentTime: { classPropertyName: "currentTime", publicName: "currentTime", isSignal: true, isRequired: false, transformFunction: null }, paused: { classPropertyName: "paused", publicName: "paused", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { volume: "volumeChange", currentTime: "currentTimeChange", paused: "pausedChange" }, host: { listeners: { "durationchange": "0", "ended": "onPausedChange(true)", "pause": "onPausedChange(true)", "play": "onPausedChange(false)", "volumechange": "onVolumeChange()", "timeupdate": "onCurrentTimeChange()", "seeking": "onCurrentTimeChange()", "seeked": "onCurrentTimeChange()" }, properties: { "volume": "volume()" } }, exportAs: ["tuiMedia"], ngImport: i0 }); }
|
|
54
45
|
}
|
|
55
46
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiMedia, decorators: [{
|
|
56
47
|
type: Directive,
|
|
57
48
|
args: [{
|
|
58
|
-
standalone: true,
|
|
59
49
|
selector: 'video[tuiMedia], audio[tuiMedia]',
|
|
60
50
|
exportAs: 'tuiMedia',
|
|
61
51
|
host: {
|
|
62
|
-
'[volume]': 'volume',
|
|
52
|
+
'[volume]': 'volume()',
|
|
63
53
|
'(durationchange)': '0',
|
|
64
54
|
'(ended)': 'onPausedChange(true)',
|
|
65
55
|
'(pause)': 'onPausedChange(true)',
|
|
@@ -70,22 +60,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
70
60
|
'(seeked)': 'onCurrentTimeChange()',
|
|
71
61
|
},
|
|
72
62
|
}]
|
|
73
|
-
}]
|
|
74
|
-
type: Input
|
|
75
|
-
}], currentTimeChange: [{
|
|
76
|
-
type: Output
|
|
77
|
-
}], pausedChange: [{
|
|
78
|
-
type: Output
|
|
79
|
-
}], volumeChange: [{
|
|
80
|
-
type: Output
|
|
81
|
-
}], playbackRateSetter: [{
|
|
82
|
-
type: Input,
|
|
83
|
-
args: ['playbackRate']
|
|
84
|
-
}], currentTime: [{
|
|
85
|
-
type: Input
|
|
86
|
-
}], paused: [{
|
|
87
|
-
type: Input
|
|
88
|
-
}] } });
|
|
63
|
+
}] });
|
|
89
64
|
|
|
90
65
|
/**
|
|
91
66
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-media.mjs","sources":["../../../projects/cdk/directives/media/media.directive.ts","../../../projects/cdk/directives/media/taiga-ui-cdk-directives-media.ts"],"sourcesContent":["import {Directive,
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-media.mjs","sources":["../../../projects/cdk/directives/media/media.directive.ts","../../../projects/cdk/directives/media/taiga-ui-cdk-directives-media.ts"],"sourcesContent":["import {Directive, effect, input, model, untracked} from '@angular/core';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils';\n\n@Directive({\n selector: 'video[tuiMedia], audio[tuiMedia]',\n exportAs: 'tuiMedia',\n host: {\n '[volume]': 'volume()',\n '(durationchange)': '0',\n '(ended)': 'onPausedChange(true)',\n '(pause)': 'onPausedChange(true)',\n '(play)': 'onPausedChange(false)',\n '(volumechange)': 'onVolumeChange()',\n '(timeupdate)': 'onCurrentTimeChange()',\n '(seeking)': 'onCurrentTimeChange()',\n '(seeked)': 'onCurrentTimeChange()',\n },\n})\nexport class TuiMedia {\n private readonly el = tuiInjectElement<HTMLMediaElement>();\n\n protected readonly setElCurrentTime = effect(() => {\n if (Math.abs(this.currentTime() - this.el.currentTime) > 0.05) {\n this.el.currentTime = this.currentTime();\n }\n });\n\n protected readonly setElPlaybackRate = effect(() => {\n this.updatePlaybackRate(this.playbackRate());\n });\n\n protected readonly setElPaused = effect(() => {\n const paused = this.paused();\n\n if (paused) {\n this.el.pause?.();\n } else {\n void this.el.play?.();\n }\n\n this.updatePlaybackRate(untracked(this.playbackRate));\n });\n\n public readonly playbackRate = input<number>(1);\n\n public readonly volume = model<number>(1);\n\n public readonly currentTime = model<number>(this.el.currentTime ?? 0);\n\n public readonly paused = model<boolean>(this.el.paused);\n\n protected onPausedChange(paused: boolean): void {\n this.paused.set(paused);\n }\n\n protected onVolumeChange(): void {\n this.volume.set(this.el.volume);\n }\n\n protected onCurrentTimeChange(): void {\n this.currentTime.set(this.el.currentTime);\n }\n\n private updatePlaybackRate(playbackRate: number): void {\n this.el.playbackRate = playbackRate;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAkBa,QAAQ,CAAA;AAfrB,IAAA,WAAA,GAAA;QAgBqB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAoB;AAEvC,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,MAAK;AAC9C,YAAA,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,IAAI,EAAE;gBAC3D,IAAI,CAAC,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE;;AAEhD,SAAC,CAAC;AAEiB,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,MAAK;YAC/C,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;AAChD,SAAC,CAAC;AAEiB,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,MAAK;AACzC,YAAA,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE;YAE5B,IAAI,MAAM,EAAE;AACR,gBAAA,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI;;iBACd;AACH,gBAAA,KAAK,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI;;YAGzB,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;AACzD,SAAC,CAAC;AAEc,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAAS,CAAC,CAAC;AAE/B,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAS,CAAC,CAAC;QAEzB,IAAW,CAAA,WAAA,GAAG,KAAK,CAAS,IAAI,CAAC,EAAE,CAAC,WAAW,IAAI,CAAC,CAAC;QAErD,IAAM,CAAA,MAAA,GAAG,KAAK,CAAU,IAAI,CAAC,EAAE,CAAC,M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cAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,cAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,gBAAA,EAAA,GAAA,EAAA,OAAA,EAAA,sBAAA,EAAA,OAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,uBAAA,EAAA,cAAA,EAAA,kBAAA,EAAA,YAAA,EAAA,uBAAA,EAAA,SAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,QAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAfpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kCAAkC;AAC5C,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;AACF,wBAAA,UAAU,EAAE,UAAU;AACtB,wBAAA,kBAAkB,EAAE,GAAG;AACvB,wBAAA,SAAS,EAAE,sBAAsB;AACjC,wBAAA,SAAS,EAAE,sBAAsB;AACjC,wBAAA,QAAQ,EAAE,uBAAuB;AACjC,wBAAA,gBAAgB,EAAE,kBAAkB;AACpC,wBAAA,cAAc,EAAE,uBAAuB;AACvC,wBAAA,WAAW,EAAE,uBAAuB;AACpC,wBAAA,UAAU,EAAE,uBAAuB;AACtC,qBAAA;AACJ,iBAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, Directive } from '@angular/core';
|
|
3
3
|
import { NG_VALIDATORS } from '@angular/forms';
|
|
4
4
|
import { tuiZonefree, tuiTakeUntilDestroyed } from '@taiga-ui/cdk/observables';
|
|
5
5
|
import { tuiInjectElement, tuiProvide } from '@taiga-ui/cdk/utils';
|
|
@@ -12,7 +12,7 @@ class TuiNativeValidator {
|
|
|
12
12
|
this.sub = this.control$
|
|
13
13
|
.pipe(switchMap((control) => control?.events || of(null)), delay(0), tuiZonefree(), tuiTakeUntilDestroyed())
|
|
14
14
|
.subscribe(() => this.handleValidation());
|
|
15
|
-
this.tuiNativeValidator = 'Invalid';
|
|
15
|
+
this.tuiNativeValidator = input('Invalid');
|
|
16
16
|
}
|
|
17
17
|
validate(control) {
|
|
18
18
|
this.control$.next(control);
|
|
@@ -22,24 +22,21 @@ class TuiNativeValidator {
|
|
|
22
22
|
const invalid = !!this.control$.value?.touched && this.control$.value?.invalid;
|
|
23
23
|
// TODO: Replace with :has(:invalid) when supported
|
|
24
24
|
this.el.closest('tui-textfield')?.classList.toggle('tui-invalid', invalid);
|
|
25
|
-
this.el.setCustomValidity?.(invalid ? this.tuiNativeValidator : '');
|
|
25
|
+
this.el.setCustomValidity?.(invalid ? this.tuiNativeValidator() : '');
|
|
26
26
|
}
|
|
27
27
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
28
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
28
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiNativeValidator, isStandalone: true, selector: "[tuiNativeValidator]", inputs: { tuiNativeValidator: { classPropertyName: "tuiNativeValidator", publicName: "tuiNativeValidator", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusout": "handleValidation()" } }, providers: [tuiProvide(NG_VALIDATORS, TuiNativeValidator, true)], ngImport: i0 }); }
|
|
29
29
|
}
|
|
30
30
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiNativeValidator, decorators: [{
|
|
31
31
|
type: Directive,
|
|
32
32
|
args: [{
|
|
33
|
-
standalone: true,
|
|
34
33
|
selector: '[tuiNativeValidator]',
|
|
35
34
|
providers: [tuiProvide(NG_VALIDATORS, TuiNativeValidator, true)],
|
|
36
35
|
host: {
|
|
37
36
|
'(focusout)': 'handleValidation()',
|
|
38
37
|
},
|
|
39
38
|
}]
|
|
40
|
-
}]
|
|
41
|
-
type: Input
|
|
42
|
-
}] } });
|
|
39
|
+
}] });
|
|
43
40
|
|
|
44
41
|
/**
|
|
45
42
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-native-validator.mjs","sources":["../../../projects/cdk/directives/native-validator/native-validator.directive.ts","../../../projects/cdk/directives/native-validator/taiga-ui-cdk-directives-native-validator.ts"],"sourcesContent":["import {Directive,
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-native-validator.mjs","sources":["../../../projects/cdk/directives/native-validator/native-validator.directive.ts","../../../projects/cdk/directives/native-validator/taiga-ui-cdk-directives-native-validator.ts"],"sourcesContent":["import {Directive, input} from '@angular/core';\nimport {type AbstractControl, NG_VALIDATORS, type Validator} from '@angular/forms';\nimport {tuiTakeUntilDestroyed, tuiZonefree} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement, tuiProvide} from '@taiga-ui/cdk/utils';\nimport {BehaviorSubject, delay, of, switchMap} from 'rxjs';\n\n@Directive({\n selector: '[tuiNativeValidator]',\n providers: [tuiProvide(NG_VALIDATORS, TuiNativeValidator, true)],\n host: {\n '(focusout)': 'handleValidation()',\n },\n})\nexport class TuiNativeValidator implements Validator {\n private readonly el = tuiInjectElement<HTMLInputElement>();\n private readonly control$ = new BehaviorSubject<AbstractControl | null>(null);\n\n protected readonly sub = this.control$\n .pipe(\n switchMap((control: any) => control?.events || of(null)),\n delay(0),\n tuiZonefree(),\n tuiTakeUntilDestroyed(),\n )\n .subscribe(() => this.handleValidation());\n\n public readonly tuiNativeValidator = input('Invalid');\n\n public validate(control: AbstractControl): null {\n this.control$.next(control);\n\n return null;\n }\n\n protected handleValidation(): void {\n const invalid = !!this.control$.value?.touched && this.control$.value?.invalid;\n\n // TODO: Replace with :has(:invalid) when supported\n this.el.closest('tui-textfield')?.classList.toggle('tui-invalid', invalid);\n this.el.setCustomValidity?.(invalid ? this.tuiNativeValidator() : '');\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAaa,kBAAkB,CAAA;AAP/B,IAAA,WAAA,GAAA;QAQqB,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAoB;AACzC,QAAA,IAAA,CAAA,QAAQ,GAAG,IAAI,eAAe,CAAyB,IAAI,CAAC;QAE1D,IAAG,CAAA,GAAA,GAAG,IAAI,CAAC;AACzB,aAAA,IAAI,CACD,SAAS,CAAC,CAAC,OAAY,KAAK,OAAO,EAAE,MAAM,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,EACxD,KAAK,CAAC,CAAC,CAAC,EACR,WAAW,EAAE,EACb,qBAAqB,EAAE;aAE1B,SAAS,CAAC,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;AAE7B,QAAA,IAAA,CAAA,kBAAkB,GAAG,KAAK,CAAC,SAAS,CAAC;AAexD;AAbU,IAAA,QAAQ,CAAC,OAAwB,EAAA;AACpC,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;AAE3B,QAAA,OAAO,IAAI;;IAGL,gBAAgB,GAAA;AACtB,QAAA,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO;;AAG9E,QAAA,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC;AAC1E,QAAA,IAAI,CAAC,EAAE,CAAC,iBAAiB,GAAG,OAAO,GAAG,IAAI,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC;;+GA1BhE,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,EAAA,kBAAA,EAAA,EAAA,iBAAA,EAAA,oBAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,UAAA,EAAA,oBAAA,EAAA,EAAA,EAAA,SAAA,EALhB,CAAC,UAAU,CAAC,aAAa,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAKvD,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAP9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EAAE,CAAC,UAAU,CAAC,aAAa,EAAsB,kBAAA,EAAA,IAAI,CAAC,CAAC;AAChE,oBAAA,IAAI,EAAE;AACF,wBAAA,YAAY,EAAE,oBAAoB;AACrC,qBAAA;AACJ,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable,
|
|
2
|
+
import { inject, Injectable, input, Directive } from '@angular/core';
|
|
3
|
+
import { toObservable, outputFromObservable } from '@angular/core/rxjs-interop';
|
|
3
4
|
import { TuiActiveZone } from '@taiga-ui/cdk/directives/active-zone';
|
|
4
5
|
import { tuiZonefreeScheduler, tuiZoneOptimized, tuiIfMap } from '@taiga-ui/cdk/observables';
|
|
5
|
-
import { Observable, throttleTime, map, startWith, distinctUntilChanged
|
|
6
|
+
import { Observable, throttleTime, map, startWith, distinctUntilChanged } from 'rxjs';
|
|
6
7
|
import { WA_ANIMATION_FRAME } from '@ng-web-apis/common';
|
|
7
8
|
import { tuiInjectElement, tuiGetElementObscures } from '@taiga-ui/cdk/utils/dom';
|
|
8
9
|
|
|
@@ -29,28 +30,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
29
30
|
class TuiObscured {
|
|
30
31
|
constructor() {
|
|
31
32
|
this.activeZone = inject(TuiActiveZone, { optional: true });
|
|
32
|
-
this.enabled$ = new BehaviorSubject(false);
|
|
33
33
|
this.obscured$ = inject(TuiObscuredService, { self: true }).pipe(map((by) => !!by?.every((el) => check(el) || !this.activeZone?.contains(el))));
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.enabled$.next(enabled);
|
|
34
|
+
this.tuiObscuredEnabled = input();
|
|
35
|
+
this.tuiObscured$ = toObservable(this.tuiObscuredEnabled).pipe(tuiIfMap(() => this.obscured$));
|
|
36
|
+
this.tuiObscured = outputFromObservable(this.tuiObscured$);
|
|
38
37
|
}
|
|
39
38
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiObscured, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
40
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
39
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiObscured, isStandalone: true, selector: "[tuiObscured]", inputs: { tuiObscuredEnabled: { classPropertyName: "tuiObscuredEnabled", publicName: "tuiObscuredEnabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tuiObscured: "tuiObscured" }, providers: [TuiObscuredService], ngImport: i0 }); }
|
|
41
40
|
}
|
|
42
41
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiObscured, decorators: [{
|
|
43
42
|
type: Directive,
|
|
44
43
|
args: [{
|
|
45
|
-
standalone: true,
|
|
46
44
|
selector: '[tuiObscured]',
|
|
47
45
|
providers: [TuiObscuredService],
|
|
48
46
|
}]
|
|
49
|
-
}]
|
|
50
|
-
type: Output
|
|
51
|
-
}], tuiObscuredEnabled: [{
|
|
52
|
-
type: Input
|
|
53
|
-
}] } });
|
|
47
|
+
}] });
|
|
54
48
|
// TODO: Refactor so that dropdowns and dialogs work properly without hacks
|
|
55
49
|
function check(el) {
|
|
56
50
|
return (!!el.closest('tui-dialogs') &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-obscured.mjs","sources":["../../../projects/cdk/directives/obscured/obscured.service.ts","../../../projects/cdk/directives/obscured/obscured.directive.ts","../../../projects/cdk/directives/obscured/taiga-ui-cdk-directives-obscured.ts"],"sourcesContent":["import {inject, Injectable} from '@angular/core';\nimport {WA_ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {tuiZonefreeScheduler, tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiGetElementObscures, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {distinctUntilChanged, map, Observable, startWith, throttleTime} from 'rxjs';\n\n/**\n * Service that monitors element visibility by polling and returning\n * either null or an array of elements that overlap given element edges\n */\n@Injectable()\nexport class TuiObscuredService extends Observable<readonly Element[] | null> {\n private readonly el = tuiInjectElement();\n private readonly obscured$ = inject(WA_ANIMATION_FRAME).pipe(\n throttleTime(100, tuiZonefreeScheduler()),\n map(() => tuiGetElementObscures(this.el)),\n startWith(null),\n distinctUntilChanged(),\n tuiZoneOptimized(),\n );\n\n constructor() {\n super((subscriber) => this.obscured$.subscribe(subscriber));\n }\n}\n","import {Directive, inject,
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-obscured.mjs","sources":["../../../projects/cdk/directives/obscured/obscured.service.ts","../../../projects/cdk/directives/obscured/obscured.directive.ts","../../../projects/cdk/directives/obscured/taiga-ui-cdk-directives-obscured.ts"],"sourcesContent":["import {inject, Injectable} from '@angular/core';\nimport {WA_ANIMATION_FRAME} from '@ng-web-apis/common';\nimport {tuiZonefreeScheduler, tuiZoneOptimized} from '@taiga-ui/cdk/observables';\nimport {tuiGetElementObscures, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {distinctUntilChanged, map, Observable, startWith, throttleTime} from 'rxjs';\n\n/**\n * Service that monitors element visibility by polling and returning\n * either null or an array of elements that overlap given element edges\n */\n@Injectable()\nexport class TuiObscuredService extends Observable<readonly Element[] | null> {\n private readonly el = tuiInjectElement();\n private readonly obscured$ = inject(WA_ANIMATION_FRAME).pipe(\n throttleTime(100, tuiZonefreeScheduler()),\n map(() => tuiGetElementObscures(this.el)),\n startWith(null),\n distinctUntilChanged(),\n tuiZoneOptimized(),\n );\n\n constructor() {\n super((subscriber) => this.obscured$.subscribe(subscriber));\n }\n}\n","import {Directive, inject, input} from '@angular/core';\nimport {outputFromObservable, toObservable} from '@angular/core/rxjs-interop';\nimport {TuiActiveZone} from '@taiga-ui/cdk/directives/active-zone';\nimport {tuiIfMap} from '@taiga-ui/cdk/observables';\nimport {map} from 'rxjs';\n\nimport {TuiObscuredService} from './obscured.service';\n\n/**\n * Directive that monitors element visibility\n */\n@Directive({\n selector: '[tuiObscured]',\n providers: [TuiObscuredService],\n})\nexport class TuiObscured {\n private readonly activeZone = inject(TuiActiveZone, {optional: true});\n private readonly obscured$ = inject(TuiObscuredService, {self: true}).pipe(\n map((by) => !!by?.every((el) => check(el) || !this.activeZone?.contains(el))),\n );\n\n public readonly tuiObscuredEnabled = input<boolean>();\n\n public readonly tuiObscured$ = toObservable(this.tuiObscuredEnabled).pipe(\n tuiIfMap(() => this.obscured$),\n );\n\n public readonly tuiObscured = outputFromObservable(this.tuiObscured$);\n}\n\n// TODO: Refactor so that dropdowns and dialogs work properly without hacks\nfunction check(el: Element): boolean {\n return (\n !!el.closest('tui-dialogs') &&\n // eslint-disable-next-line unicorn/prefer-query-selector\n !!el.ownerDocument.documentElement.getElementsByTagName('tui-dropdown').length\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAMA;;;AAGG;AAEG,MAAO,kBAAmB,SAAQ,UAAqC,CAAA;AAUzE,IAAA,WAAA,GAAA;AACI,QAAA,KAAK,CAAC,CAAC,UAAU,KAAK,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAV9C,IAAE,CAAA,EAAA,GAAG,gBAAgB,EAAE;AACvB,QAAA,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC,IAAI,CACxD,YAAY,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC,EACzC,GAAG,CAAC,MAAM,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EACzC,SAAS,CAAC,IAAI,CAAC,EACf,oBAAoB,EAAE,EACtB,gBAAgB,EAAE,CACrB;;+GARQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;mHAAlB,kBAAkB,EAAA,CAAA,CAAA;;4FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAD9B;;;ACFD;;AAEG;MAKU,WAAW,CAAA;AAJxB,IAAA,WAAA,GAAA;QAKqB,IAAU,CAAA,UAAA,GAAG,MAAM,CAAC,aAAa,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;QACpD,IAAS,CAAA,SAAA,GAAG,MAAM,CAAC,kBAAkB,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,IAAI,CACtE,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,EAAE,KAAK,KAAK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|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, Injectable,
|
|
2
|
+
import { inject, Injectable, Directive } from '@angular/core';
|
|
3
|
+
import { outputFromObservable } from '@angular/core/rxjs-interop';
|
|
3
4
|
import { DOCUMENT } from '@angular/common';
|
|
4
5
|
import { tuiTypedFromEvent } from '@taiga-ui/cdk/observables';
|
|
5
6
|
import { tuiInjectElement } from '@taiga-ui/cdk/utils/dom';
|
|
@@ -28,7 +29,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
28
29
|
|
|
29
30
|
class TuiPan {
|
|
30
31
|
constructor() {
|
|
31
|
-
this.tuiPan = inject(TuiPanService);
|
|
32
|
+
this.tuiPan = outputFromObservable(inject(TuiPanService));
|
|
32
33
|
}
|
|
33
34
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPan, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
34
35
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.15", type: TuiPan, isStandalone: true, selector: "[tuiPan]", outputs: { tuiPan: "tuiPan" }, providers: [TuiPanService], ngImport: i0 }); }
|
|
@@ -36,13 +37,10 @@ class TuiPan {
|
|
|
36
37
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPan, decorators: [{
|
|
37
38
|
type: Directive,
|
|
38
39
|
args: [{
|
|
39
|
-
standalone: true,
|
|
40
40
|
selector: '[tuiPan]',
|
|
41
41
|
providers: [TuiPanService],
|
|
42
42
|
}]
|
|
43
|
-
}]
|
|
44
|
-
type: Output
|
|
45
|
-
}] } });
|
|
43
|
+
}] });
|
|
46
44
|
|
|
47
45
|
/**
|
|
48
46
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-pan.mjs","sources":["../../../projects/cdk/directives/pan/pan.service.ts","../../../projects/cdk/directives/pan/pan.directive.ts","../../../projects/cdk/directives/pan/taiga-ui-cdk-directives-pan.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, Injectable} from '@angular/core';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n filter,\n map,\n merge,\n Observable,\n pairwise,\n repeat,\n switchMap,\n takeUntil,\n} from 'rxjs';\n\n@Injectable()\nexport class TuiPanService extends Observable<readonly [number, number]> {\n constructor() {\n const el = tuiInjectElement();\n const doc = inject(DOCUMENT);\n\n super((subscriber) =>\n merge(\n tuiTypedFromEvent(el, 'touchstart', {passive: true}),\n tuiTypedFromEvent(el, 'mousedown'),\n )\n .pipe(\n switchMap(() =>\n merge(\n tuiTypedFromEvent(doc, 'touchmove', {\n passive: true,\n }).pipe(\n filter(({touches}) => touches.length < 2),\n map(({touches}) => touches[0]),\n ),\n tuiTypedFromEvent(doc, 'mousemove'),\n ),\n ),\n pairwise(),\n map(([first, second]) => {\n const deltaX = (second?.clientX ?? 0) - (first?.clientX ?? 0);\n const deltaY = (second?.clientY ?? 0) - (first?.clientY ?? 0);\n\n return [deltaX, deltaY] as [number, number];\n }),\n takeUntil(\n merge(\n tuiTypedFromEvent(doc, 'touchend'),\n tuiTypedFromEvent(doc, 'mouseup'),\n ),\n ),\n repeat(),\n )\n .subscribe(subscriber),\n );\n }\n}\n","import {Directive, inject
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-pan.mjs","sources":["../../../projects/cdk/directives/pan/pan.service.ts","../../../projects/cdk/directives/pan/pan.directive.ts","../../../projects/cdk/directives/pan/taiga-ui-cdk-directives-pan.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {inject, Injectable} from '@angular/core';\nimport {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';\nimport {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';\nimport {\n filter,\n map,\n merge,\n Observable,\n pairwise,\n repeat,\n switchMap,\n takeUntil,\n} from 'rxjs';\n\n@Injectable()\nexport class TuiPanService extends Observable<readonly [number, number]> {\n constructor() {\n const el = tuiInjectElement();\n const doc = inject(DOCUMENT);\n\n super((subscriber) =>\n merge(\n tuiTypedFromEvent(el, 'touchstart', {passive: true}),\n tuiTypedFromEvent(el, 'mousedown'),\n )\n .pipe(\n switchMap(() =>\n merge(\n tuiTypedFromEvent(doc, 'touchmove', {\n passive: true,\n }).pipe(\n filter(({touches}) => touches.length < 2),\n map(({touches}) => touches[0]),\n ),\n tuiTypedFromEvent(doc, 'mousemove'),\n ),\n ),\n pairwise(),\n map(([first, second]) => {\n const deltaX = (second?.clientX ?? 0) - (first?.clientX ?? 0);\n const deltaY = (second?.clientY ?? 0) - (first?.clientY ?? 0);\n\n return [deltaX, deltaY] as [number, number];\n }),\n takeUntil(\n merge(\n tuiTypedFromEvent(doc, 'touchend'),\n tuiTypedFromEvent(doc, 'mouseup'),\n ),\n ),\n repeat(),\n )\n .subscribe(subscriber),\n );\n }\n}\n","import {Directive, inject} from '@angular/core';\nimport {outputFromObservable} from '@angular/core/rxjs-interop';\n\nimport {TuiPanService} from './pan.service';\n\n@Directive({\n selector: '[tuiPan]',\n providers: [TuiPanService],\n})\nexport class TuiPan {\n public readonly tuiPan = outputFromObservable(inject(TuiPanService));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAgBM,MAAO,aAAc,SAAQ,UAAqC,CAAA;AACpE,IAAA,WAAA,GAAA;AACI,QAAA,MAAM,EAAE,GAAG,gBAAgB,EAAE;AAC7B,QAAA,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;QAE5B,KAAK,CAAC,CAAC,UAAU,KACb,KAAK,CACD,iBAAiB,CAAC,EAAE,EAAE,YAAY,EAAE,EAAC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AAA,GAAG,oBAAoB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;AACvE;+GAFY,MAAM,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAN,MAAM,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,UAAA,EAAA,OAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,EAAA,SAAA,EAFJ,CAAC,aAAa,CAAC,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAEjB,MAAM,EAAA,UAAA,EAAA,CAAA;kBAJlB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,UAAU;oBACpB,SAAS,EAAE,CAAC,aAAa,CAAC;AAC7B,iBAAA;;;ACRD;;AAEG;;;;"}
|
|
@@ -1,37 +1,34 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, inject, Directive } from '@angular/core';
|
|
3
3
|
import { TUI_PLATFORM } from '@taiga-ui/cdk/tokens';
|
|
4
4
|
|
|
5
5
|
class TuiPlatform {
|
|
6
6
|
constructor() {
|
|
7
|
-
this.tuiPlatform = inject(TUI_PLATFORM, { skipSelf: true });
|
|
7
|
+
this.tuiPlatform = input(inject(TUI_PLATFORM, { skipSelf: true }));
|
|
8
8
|
}
|
|
9
9
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPlatform, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
10
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
10
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiPlatform, isStandalone: true, selector: "[tuiPlatform]", inputs: { tuiPlatform: { classPropertyName: "tuiPlatform", publicName: "tuiPlatform", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.data-platform": "tuiPlatform()" } }, providers: [
|
|
11
11
|
{
|
|
12
12
|
provide: TUI_PLATFORM,
|
|
13
|
-
useFactory: () => inject(TuiPlatform).tuiPlatform,
|
|
13
|
+
useFactory: () => inject(TuiPlatform).tuiPlatform(),
|
|
14
14
|
},
|
|
15
15
|
], ngImport: i0 }); }
|
|
16
16
|
}
|
|
17
17
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiPlatform, decorators: [{
|
|
18
18
|
type: Directive,
|
|
19
19
|
args: [{
|
|
20
|
-
standalone: true,
|
|
21
20
|
selector: '[tuiPlatform]',
|
|
22
21
|
providers: [
|
|
23
22
|
{
|
|
24
23
|
provide: TUI_PLATFORM,
|
|
25
|
-
useFactory: () => inject(TuiPlatform).tuiPlatform,
|
|
24
|
+
useFactory: () => inject(TuiPlatform).tuiPlatform(),
|
|
26
25
|
},
|
|
27
26
|
],
|
|
28
27
|
host: {
|
|
29
|
-
'[attr.data-platform]': 'tuiPlatform',
|
|
28
|
+
'[attr.data-platform]': 'tuiPlatform()',
|
|
30
29
|
},
|
|
31
30
|
}]
|
|
32
|
-
}]
|
|
33
|
-
type: Input
|
|
34
|
-
}] } });
|
|
31
|
+
}] });
|
|
35
32
|
|
|
36
33
|
/**
|
|
37
34
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-platform.mjs","sources":["../../../projects/cdk/directives/platform/platform.directive.ts","../../../projects/cdk/directives/platform/taiga-ui-cdk-directives-platform.ts"],"sourcesContent":["import {Directive, inject,
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-platform.mjs","sources":["../../../projects/cdk/directives/platform/platform.directive.ts","../../../projects/cdk/directives/platform/taiga-ui-cdk-directives-platform.ts"],"sourcesContent":["import {Directive, inject, input} from '@angular/core';\nimport {TUI_PLATFORM} from '@taiga-ui/cdk/tokens';\n\n@Directive({\n selector: '[tuiPlatform]',\n providers: [\n {\n provide: TUI_PLATFORM,\n useFactory: () => inject(TuiPlatform).tuiPlatform(),\n },\n ],\n host: {\n '[attr.data-platform]': 'tuiPlatform()',\n },\n})\nexport class TuiPlatform {\n public readonly tuiPlatform = input(inject(TUI_PLATFORM, {skipSelf: true}));\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAea,WAAW,CAAA;AAZxB,IAAA,WAAA,GAAA;AAaoB,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;AAC9E;+GAFY,WAAW,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAX,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,WAAW,EAVT,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,EAAA,WAAA,EAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,aAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,eAAA,EAAA,EAAA,EAAA,SAAA,EAAA;AACP,YAAA;AACI,gBAAA,OAAO,EAAE,YAAY;gBACrB,UAAU,EAAE,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE;AACtD,aAAA;AACJ,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAKQ,WAAW,EAAA,UAAA,EAAA,CAAA;kBAZvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,SAAS,EAAE;AACP,wBAAA;AACI,4BAAA,OAAO,EAAE,YAAY;4BACrB,UAAU,EAAE,MAAM,MAAM,CAAa,WAAA,CAAA,CAAC,WAAW,EAAE;AACtD,yBAAA;AACJ,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,sBAAsB,EAAE,eAAe;AAC1C,qBAAA;AACJ,iBAAA;;;ACdD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ViewContainerRef, TemplateRef,
|
|
2
|
+
import { inject, ViewContainerRef, TemplateRef, input, effect, Directive } from '@angular/core';
|
|
3
3
|
import { tuiClamp } from '@taiga-ui/cdk/utils/math';
|
|
4
4
|
|
|
5
5
|
const MAX_VALUE = 0x10000;
|
|
@@ -17,41 +17,40 @@ class TuiRepeatTimesContext {
|
|
|
17
17
|
*/
|
|
18
18
|
class TuiRepeatTimes {
|
|
19
19
|
constructor() {
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
this.vcr = inject(ViewContainerRef);
|
|
21
|
+
this.template = inject((TemplateRef));
|
|
22
|
+
this.tuiRepeatTimesOf = input.required();
|
|
23
|
+
this.setCount = effect(() => {
|
|
24
|
+
const count = this.tuiRepeatTimesOf();
|
|
25
|
+
const safeCount = Math.floor(tuiClamp(count, 0, MAX_VALUE));
|
|
26
|
+
const { length } = this.vcr;
|
|
27
|
+
if (count < length) {
|
|
28
|
+
this.removeContainers(length - count);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.addContainers(safeCount);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
32
34
|
}
|
|
33
35
|
addContainers(count) {
|
|
34
|
-
for (let index = this.
|
|
35
|
-
this.
|
|
36
|
+
for (let index = this.vcr.length; index < count; index++) {
|
|
37
|
+
this.vcr.createEmbeddedView(this.template, new TuiRepeatTimesContext(index));
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
removeContainers(amount) {
|
|
39
41
|
for (let index = 0; index < amount; index++) {
|
|
40
|
-
this.
|
|
42
|
+
this.vcr.remove();
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRepeatTimes, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
44
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
46
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiRepeatTimes, isStandalone: true, selector: "[tuiRepeatTimes][tuiRepeatTimesOf]", inputs: { tuiRepeatTimesOf: { classPropertyName: "tuiRepeatTimesOf", publicName: "tuiRepeatTimesOf", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 }); }
|
|
45
47
|
}
|
|
46
48
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiRepeatTimes, decorators: [{
|
|
47
49
|
type: Directive,
|
|
48
50
|
args: [{
|
|
49
|
-
standalone: true,
|
|
50
51
|
selector: '[tuiRepeatTimes][tuiRepeatTimesOf]',
|
|
51
52
|
}]
|
|
52
|
-
}]
|
|
53
|
-
type: Input
|
|
54
|
-
}] } });
|
|
53
|
+
}] });
|
|
55
54
|
|
|
56
55
|
/**
|
|
57
56
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-cdk-directives-repeat-times.mjs","sources":["../../../projects/cdk/directives/repeat-times/repeat-times.directive.ts","../../../projects/cdk/directives/repeat-times/taiga-ui-cdk-directives-repeat-times.ts"],"sourcesContent":["import {Directive
|
|
1
|
+
{"version":3,"file":"taiga-ui-cdk-directives-repeat-times.mjs","sources":["../../../projects/cdk/directives/repeat-times/repeat-times.directive.ts","../../../projects/cdk/directives/repeat-times/taiga-ui-cdk-directives-repeat-times.ts"],"sourcesContent":["import {\n Directive,\n effect,\n inject,\n input,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport {type TuiContext} from '@taiga-ui/cdk/types';\nimport {tuiClamp} from '@taiga-ui/cdk/utils/math';\n\nconst MAX_VALUE = 0x10000;\n\nexport class TuiRepeatTimesContext implements TuiContext<number> {\n constructor(public readonly $implicit: number) {}\n}\n\n/**\n * Directive similar to ngFor but using a number of repetitions rather than an array\n *\n * {@link TuiRepeatTimes.tuiRepeatTimesOf requested number of times}.\n * {@link TuiRepeatTimesContext context} for every instance of the template inherits outer context and stores\n * {@link TuiRepeatTimesContext.$implicit index} of a template instance.\n */\n@Directive({\n selector: '[tuiRepeatTimes][tuiRepeatTimesOf]',\n})\nexport class TuiRepeatTimes {\n private readonly vcr = inject(ViewContainerRef);\n private readonly template = inject(TemplateRef<TuiRepeatTimesContext>);\n\n public readonly tuiRepeatTimesOf = input.required<number>();\n\n protected readonly setCount = effect(() => {\n const count = this.tuiRepeatTimesOf();\n\n const safeCount = Math.floor(tuiClamp(count, 0, MAX_VALUE));\n\n const {length} = this.vcr;\n\n if (count < length) {\n this.removeContainers(length - count);\n } else {\n this.addContainers(safeCount);\n }\n });\n\n private addContainers(count: number): void {\n for (let index = this.vcr.length; index < count; index++) {\n this.vcr.createEmbeddedView<TuiRepeatTimesContext>(\n this.template,\n new TuiRepeatTimesContext(index),\n );\n }\n }\n\n private removeContainers(amount: number): void {\n for (let index = 0; index < amount; index++) {\n this.vcr.remove();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAWA,MAAM,SAAS,GAA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E;AACzC,YAAA,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE;;;+GA/BhB,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oCAAA,EAAA,MAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,oCAAoC;AACjD,iBAAA;;;AC1BD;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Directive, inject,
|
|
2
|
+
import { Directive, inject, input, output } from '@angular/core';
|
|
3
3
|
import { TuiElement } from '@taiga-ui/cdk/directives/element';
|
|
4
4
|
import { tuiPx } from '@taiga-ui/cdk/utils/miscellaneous';
|
|
5
5
|
|
|
@@ -10,7 +10,6 @@ class TuiResizable extends TuiElement {
|
|
|
10
10
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiResizable, decorators: [{
|
|
11
11
|
type: Directive,
|
|
12
12
|
args: [{
|
|
13
|
-
standalone: true,
|
|
14
13
|
selector: '[tuiResizable]',
|
|
15
14
|
}]
|
|
16
15
|
}] });
|
|
@@ -22,17 +21,18 @@ class TuiResizer {
|
|
|
22
21
|
this.y = NaN;
|
|
23
22
|
this.width = 0;
|
|
24
23
|
this.height = 0;
|
|
25
|
-
this.tuiResizer = [0, 0];
|
|
26
|
-
this.tuiSizeChange =
|
|
24
|
+
this.tuiResizer = input([0, 0]);
|
|
25
|
+
this.tuiSizeChange = output();
|
|
27
26
|
}
|
|
28
27
|
get cursor() {
|
|
29
|
-
|
|
28
|
+
const tuiResizer = this.tuiResizer();
|
|
29
|
+
if (!tuiResizer[0]) {
|
|
30
30
|
return 'ns-resize';
|
|
31
31
|
}
|
|
32
|
-
if (!
|
|
32
|
+
if (!tuiResizer[1]) {
|
|
33
33
|
return 'ew-resize';
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
35
|
+
if (tuiResizer[0] * tuiResizer[1] > 0) {
|
|
36
36
|
return 'nwse-resize';
|
|
37
37
|
}
|
|
38
38
|
return 'nesw-resize';
|
|
@@ -55,29 +55,29 @@ class TuiResizer {
|
|
|
55
55
|
this.x = NaN;
|
|
56
56
|
}
|
|
57
57
|
onMove(x, y) {
|
|
58
|
+
const tuiResizer = this.tuiResizer();
|
|
58
59
|
if (Number.isNaN(this.x)) {
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
61
62
|
const { style } = this.resizable.nativeElement;
|
|
62
63
|
const size = [
|
|
63
|
-
this.width +
|
|
64
|
-
this.height +
|
|
64
|
+
this.width + tuiResizer[0] * (x - this.x),
|
|
65
|
+
this.height + tuiResizer[1] * (y - this.y),
|
|
65
66
|
];
|
|
66
|
-
if (
|
|
67
|
+
if (tuiResizer[0]) {
|
|
67
68
|
style.width = tuiPx(size[0]);
|
|
68
69
|
}
|
|
69
|
-
if (
|
|
70
|
+
if (tuiResizer[1]) {
|
|
70
71
|
style.height = tuiPx(size[1]);
|
|
71
72
|
}
|
|
72
73
|
this.tuiSizeChange.emit(size);
|
|
73
74
|
}
|
|
74
75
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiResizer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
75
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
76
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.15", type: TuiResizer, isStandalone: true, selector: "[tuiResizer]", inputs: { tuiResizer: { classPropertyName: "tuiResizer", publicName: "tuiResizer", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { tuiSizeChange: "tuiSizeChange" }, host: { listeners: { "pointerdown.zoneless.prevent": "onPointerDown($event.x, $event.y)", "document:pointermove.zoneless": "onPointerMove($event)", "document:pointerup.zoneless": "onPointerUp()" }, properties: { "style.cursor": "cursor", "style.touchAction": "\"none\"" } }, ngImport: i0 }); }
|
|
76
77
|
}
|
|
77
78
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TuiResizer, decorators: [{
|
|
78
79
|
type: Directive,
|
|
79
80
|
args: [{
|
|
80
|
-
standalone: true,
|
|
81
81
|
selector: '[tuiResizer]',
|
|
82
82
|
host: {
|
|
83
83
|
'[style.cursor]': 'cursor',
|
|
@@ -87,11 +87,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImpo
|
|
|
87
87
|
'(document:pointerup.zoneless)': 'onPointerUp()',
|
|
88
88
|
},
|
|
89
89
|
}]
|
|
90
|
-
}]
|
|
91
|
-
type: Input
|
|
92
|
-
}], tuiSizeChange: [{
|
|
93
|
-
type: Output
|
|
94
|
-
}] } });
|
|
90
|
+
}] });
|
|
95
91
|
|
|
96
92
|
/**
|
|
97
93
|
* Generated bundle index. Do not edit.
|