@rxap/directives 12.3.0 → 13.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/index.mjs +13 -0
- package/esm2020/lib/avatar-background-image.directive.mjs +58 -0
- package/esm2020/lib/background-image.directive.mjs +134 -0
- package/esm2020/lib/confirm-click.mjs +34 -0
- package/esm2020/lib/contenteditable.directive.mjs +81 -0
- package/esm2020/lib/full-width.directive.mjs +31 -0
- package/esm2020/lib/if-truthy.directive.mjs +72 -0
- package/esm2020/lib/method.directive.mjs +118 -0
- package/esm2020/lib/movable-divider.directive.mjs +101 -0
- package/esm2020/lib/prevent-default.directive.mjs +31 -0
- package/esm2020/lib/share-button.directive.mjs +75 -0
- package/esm2020/lib/stop-immediate-propagation.directive.mjs +31 -0
- package/esm2020/lib/stop-propagation.directive.mjs +31 -0
- package/esm2020/rxap-directives.mjs +5 -0
- package/fesm2015/{rxap-directives.js → rxap-directives.mjs} +111 -107
- package/fesm2015/rxap-directives.mjs.map +1 -0
- package/fesm2020/rxap-directives.mjs +773 -0
- package/fesm2020/rxap-directives.mjs.map +1 -0
- package/package.json +29 -15
- package/src/schematics/ng-add/index.js +1 -1
- package/src/schematics/ng-add/index.js.map +1 -1
- package/bundles/rxap-directives.umd.js +0 -1273
- package/bundles/rxap-directives.umd.js.map +0 -1
- package/esm2015/index.js +0 -13
- package/esm2015/index.js.map +0 -1
- package/esm2015/lib/avatar-background-image.directive.js +0 -58
- package/esm2015/lib/avatar-background-image.directive.js.map +0 -1
- package/esm2015/lib/background-image.directive.js +0 -137
- package/esm2015/lib/background-image.directive.js.map +0 -1
- package/esm2015/lib/confirm-click.js +0 -34
- package/esm2015/lib/confirm-click.js.map +0 -1
- package/esm2015/lib/contenteditable.directive.js +0 -84
- package/esm2015/lib/contenteditable.directive.js.map +0 -1
- package/esm2015/lib/full-width.directive.js +0 -31
- package/esm2015/lib/full-width.directive.js.map +0 -1
- package/esm2015/lib/if-truthy.directive.js +0 -75
- package/esm2015/lib/if-truthy.directive.js.map +0 -1
- package/esm2015/lib/method.directive.js +0 -122
- package/esm2015/lib/method.directive.js.map +0 -1
- package/esm2015/lib/movable-divider.directive.js +0 -102
- package/esm2015/lib/movable-divider.directive.js.map +0 -1
- package/esm2015/lib/prevent-default.directive.js +0 -31
- package/esm2015/lib/prevent-default.directive.js.map +0 -1
- package/esm2015/lib/share-button.directive.js +0 -77
- package/esm2015/lib/share-button.directive.js.map +0 -1
- package/esm2015/lib/stop-immediate-propagation.directive.js +0 -31
- package/esm2015/lib/stop-immediate-propagation.directive.js.map +0 -1
- package/esm2015/lib/stop-propagation.directive.js +0 -31
- package/esm2015/lib/stop-propagation.directive.js.map +0 -1
- package/esm2015/rxap-directives.js +0 -5
- package/esm2015/rxap-directives.js.map +0 -1
- package/fesm2015/rxap-directives.js.map +0 -1
|
@@ -0,0 +1,773 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { isDevMode, ElementRef, Renderer2, Directive, Inject, Input, NgModule, HostListener, Injectable, HostBinding, EventEmitter, Output } from '@angular/core';
|
|
3
|
+
import * as i1 from '@rxap/services';
|
|
4
|
+
import { ImageLoaderService, AvatarImageService } from '@rxap/services';
|
|
5
|
+
import { __decorate, __metadata } from 'tslib';
|
|
6
|
+
import { Required, DebounceCall, coerceBoolean } from '@rxap/utilities';
|
|
7
|
+
import { ToggleSubject } from '@rxap/utilities/rxjs';
|
|
8
|
+
import { Subscription, fromEvent } from 'rxjs';
|
|
9
|
+
import { tap } from 'rxjs/operators';
|
|
10
|
+
|
|
11
|
+
var GlobalStyleOptions;
|
|
12
|
+
(function (GlobalStyleOptions) {
|
|
13
|
+
GlobalStyleOptions["INITIAL"] = "initial";
|
|
14
|
+
GlobalStyleOptions["INHERIT"] = "inherit";
|
|
15
|
+
})(GlobalStyleOptions || (GlobalStyleOptions = {}));
|
|
16
|
+
// TODO : complete description
|
|
17
|
+
// https://www.w3schools.com/cssref/css3_pr_background-size.asp
|
|
18
|
+
var BackgroundSizeOptions;
|
|
19
|
+
(function (BackgroundSizeOptions) {
|
|
20
|
+
BackgroundSizeOptions["AUTO"] = "auto";
|
|
21
|
+
BackgroundSizeOptions["COVER"] = "cover";
|
|
22
|
+
BackgroundSizeOptions["CONTAIN"] = "contain";
|
|
23
|
+
})(BackgroundSizeOptions || (BackgroundSizeOptions = {}));
|
|
24
|
+
// TODO : complete options and description
|
|
25
|
+
// https://www.w3schools.com/cssref/pr_background-repeat.asp
|
|
26
|
+
var BackgroundRepeatOptions;
|
|
27
|
+
(function (BackgroundRepeatOptions) {
|
|
28
|
+
BackgroundRepeatOptions["NO_REPEAT"] = "no-repeat";
|
|
29
|
+
})(BackgroundRepeatOptions || (BackgroundRepeatOptions = {}));
|
|
30
|
+
// TODO : complete options and description
|
|
31
|
+
// https://www.w3schools.com/cssref/pr_background-position.asp
|
|
32
|
+
var BackgroundPositionOptions;
|
|
33
|
+
(function (BackgroundPositionOptions) {
|
|
34
|
+
BackgroundPositionOptions["CENTER"] = "center";
|
|
35
|
+
BackgroundPositionOptions["CENTER_CENTER"] = "center center";
|
|
36
|
+
})(BackgroundPositionOptions || (BackgroundPositionOptions = {}));
|
|
37
|
+
class BackgroundImageDirective {
|
|
38
|
+
// TODO : add inputs for all 'background-*' styles
|
|
39
|
+
constructor(host, renderer, imageLoader) {
|
|
40
|
+
this.host = host;
|
|
41
|
+
this.renderer = renderer;
|
|
42
|
+
this.imageLoader = imageLoader;
|
|
43
|
+
this.imageUrl = null;
|
|
44
|
+
}
|
|
45
|
+
ngOnInit() {
|
|
46
|
+
if (this.size) {
|
|
47
|
+
this.sizeChange(this.size);
|
|
48
|
+
}
|
|
49
|
+
if (this.position) {
|
|
50
|
+
this.positionChange(this.position);
|
|
51
|
+
}
|
|
52
|
+
if (this.repeat) {
|
|
53
|
+
this.repeatChange(this.repeat);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
ngOnChanges(changes) {
|
|
57
|
+
for (const propertyKey of Object.keys(changes)) {
|
|
58
|
+
switch (propertyKey) {
|
|
59
|
+
case 'imageUrl':
|
|
60
|
+
if (changes.imageUrl.currentValue) {
|
|
61
|
+
this.imageUrlChange(changes.imageUrl.currentValue);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
case 'size':
|
|
65
|
+
this.sizeChange(changes.size.currentValue);
|
|
66
|
+
break;
|
|
67
|
+
case 'repeat':
|
|
68
|
+
this.repeatChange(changes.repeat.currentValue);
|
|
69
|
+
break;
|
|
70
|
+
case 'position':
|
|
71
|
+
this.positionChange(changes.position.currentValue);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
repeatChange(repeat) {
|
|
77
|
+
this.renderer.setStyle(this.host.nativeElement, 'background-repeat', repeat);
|
|
78
|
+
}
|
|
79
|
+
positionChange(position) {
|
|
80
|
+
this.renderer.setStyle(this.host.nativeElement, 'background-position', position);
|
|
81
|
+
}
|
|
82
|
+
sizeChange(size) {
|
|
83
|
+
this.renderer.setStyle(this.host.nativeElement, 'background-size', size);
|
|
84
|
+
}
|
|
85
|
+
async imageUrlChange(imageUrl) {
|
|
86
|
+
if (this.placeholderImageUrl) {
|
|
87
|
+
this.renderer.setStyle(this.host.nativeElement, 'background-image', `url("${this.placeholderImageUrl}")`);
|
|
88
|
+
}
|
|
89
|
+
if (imageUrl) {
|
|
90
|
+
await this.imageLoader.load(imageUrl);
|
|
91
|
+
this.renderer.setStyle(this.host.nativeElement, 'background-image', `url("${imageUrl}")`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
if (isDevMode()) {
|
|
95
|
+
console.warn('background image url is not defined');
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
BackgroundImageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: BackgroundImageDirective, deps: [{ token: ElementRef }, { token: Renderer2 }, { token: ImageLoaderService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
101
|
+
BackgroundImageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: BackgroundImageDirective, selector: "[rxapBackgroundImage]", inputs: { imageUrl: ["rxapBackgroundImage", "imageUrl"], placeholderImageUrl: "placeholderImageUrl", size: "size", repeat: "repeat", position: "position" }, usesOnChanges: true, ngImport: i0 });
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: BackgroundImageDirective, decorators: [{
|
|
103
|
+
type: Directive,
|
|
104
|
+
args: [{
|
|
105
|
+
selector: '[rxapBackgroundImage]',
|
|
106
|
+
}]
|
|
107
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
|
|
108
|
+
type: Inject,
|
|
109
|
+
args: [ElementRef]
|
|
110
|
+
}] }, { type: i0.Renderer2, decorators: [{
|
|
111
|
+
type: Inject,
|
|
112
|
+
args: [Renderer2]
|
|
113
|
+
}] }, { type: i1.ImageLoaderService, decorators: [{
|
|
114
|
+
type: Inject,
|
|
115
|
+
args: [ImageLoaderService]
|
|
116
|
+
}] }]; }, propDecorators: { imageUrl: [{
|
|
117
|
+
type: Input,
|
|
118
|
+
args: ['rxapBackgroundImage']
|
|
119
|
+
}], placeholderImageUrl: [{
|
|
120
|
+
type: Input
|
|
121
|
+
}], size: [{
|
|
122
|
+
type: Input
|
|
123
|
+
}], repeat: [{
|
|
124
|
+
type: Input
|
|
125
|
+
}], position: [{
|
|
126
|
+
type: Input
|
|
127
|
+
}] } });
|
|
128
|
+
class BackgroundImageDirectiveModule {
|
|
129
|
+
}
|
|
130
|
+
BackgroundImageDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: BackgroundImageDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
131
|
+
BackgroundImageDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: BackgroundImageDirectiveModule, declarations: [BackgroundImageDirective], exports: [BackgroundImageDirective] });
|
|
132
|
+
BackgroundImageDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: BackgroundImageDirectiveModule });
|
|
133
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: BackgroundImageDirectiveModule, decorators: [{
|
|
134
|
+
type: NgModule,
|
|
135
|
+
args: [{
|
|
136
|
+
declarations: [BackgroundImageDirective],
|
|
137
|
+
exports: [BackgroundImageDirective],
|
|
138
|
+
}]
|
|
139
|
+
}] });
|
|
140
|
+
|
|
141
|
+
class PreventDefaultDirective {
|
|
142
|
+
onClick($event) {
|
|
143
|
+
$event.preventDefault();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
PreventDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
147
|
+
PreventDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: PreventDefaultDirective, selector: "[rxapPreventDefault]", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
|
|
148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PreventDefaultDirective, decorators: [{
|
|
149
|
+
type: Directive,
|
|
150
|
+
args: [{
|
|
151
|
+
selector: '[rxapPreventDefault]'
|
|
152
|
+
}]
|
|
153
|
+
}], propDecorators: { onClick: [{
|
|
154
|
+
type: HostListener,
|
|
155
|
+
args: ['click', ['$event']]
|
|
156
|
+
}] } });
|
|
157
|
+
class PreventDefaultDirectiveModule {
|
|
158
|
+
}
|
|
159
|
+
PreventDefaultDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PreventDefaultDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
160
|
+
PreventDefaultDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PreventDefaultDirectiveModule, declarations: [PreventDefaultDirective], exports: [PreventDefaultDirective] });
|
|
161
|
+
PreventDefaultDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PreventDefaultDirectiveModule });
|
|
162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PreventDefaultDirectiveModule, decorators: [{
|
|
163
|
+
type: NgModule,
|
|
164
|
+
args: [{
|
|
165
|
+
exports: [PreventDefaultDirective],
|
|
166
|
+
declarations: [PreventDefaultDirective]
|
|
167
|
+
}]
|
|
168
|
+
}] });
|
|
169
|
+
|
|
170
|
+
class StopImmediatePropagationDirective {
|
|
171
|
+
onClick($event) {
|
|
172
|
+
$event.stopImmediatePropagation();
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
StopImmediatePropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopImmediatePropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
176
|
+
StopImmediatePropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: StopImmediatePropagationDirective, selector: "[rxapStopImmediatePropagation]", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
|
|
177
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopImmediatePropagationDirective, decorators: [{
|
|
178
|
+
type: Directive,
|
|
179
|
+
args: [{
|
|
180
|
+
selector: '[rxapStopImmediatePropagation]'
|
|
181
|
+
}]
|
|
182
|
+
}], propDecorators: { onClick: [{
|
|
183
|
+
type: HostListener,
|
|
184
|
+
args: ['click', ['$event']]
|
|
185
|
+
}] } });
|
|
186
|
+
class StopImmediatePropagationDirectiveModule {
|
|
187
|
+
}
|
|
188
|
+
StopImmediatePropagationDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopImmediatePropagationDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
189
|
+
StopImmediatePropagationDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopImmediatePropagationDirectiveModule, declarations: [StopImmediatePropagationDirective], exports: [StopImmediatePropagationDirective] });
|
|
190
|
+
StopImmediatePropagationDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopImmediatePropagationDirectiveModule });
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopImmediatePropagationDirectiveModule, decorators: [{
|
|
192
|
+
type: NgModule,
|
|
193
|
+
args: [{
|
|
194
|
+
exports: [StopImmediatePropagationDirective],
|
|
195
|
+
declarations: [StopImmediatePropagationDirective]
|
|
196
|
+
}]
|
|
197
|
+
}] });
|
|
198
|
+
|
|
199
|
+
class StopPropagationDirective {
|
|
200
|
+
onClick($event) {
|
|
201
|
+
$event.stopPropagation();
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
StopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
205
|
+
StopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: StopPropagationDirective, selector: "[rxapStopPropagation]", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
|
|
206
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopPropagationDirective, decorators: [{
|
|
207
|
+
type: Directive,
|
|
208
|
+
args: [{
|
|
209
|
+
selector: '[rxapStopPropagation]'
|
|
210
|
+
}]
|
|
211
|
+
}], propDecorators: { onClick: [{
|
|
212
|
+
type: HostListener,
|
|
213
|
+
args: ['click', ['$event']]
|
|
214
|
+
}] } });
|
|
215
|
+
class StopPropagationDirectiveModule {
|
|
216
|
+
}
|
|
217
|
+
StopPropagationDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopPropagationDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
218
|
+
StopPropagationDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopPropagationDirectiveModule, declarations: [StopPropagationDirective], exports: [StopPropagationDirective] });
|
|
219
|
+
StopPropagationDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopPropagationDirectiveModule });
|
|
220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StopPropagationDirectiveModule, decorators: [{
|
|
221
|
+
type: NgModule,
|
|
222
|
+
args: [{
|
|
223
|
+
exports: [StopPropagationDirective],
|
|
224
|
+
declarations: [StopPropagationDirective]
|
|
225
|
+
}]
|
|
226
|
+
}] });
|
|
227
|
+
|
|
228
|
+
class ShareService {
|
|
229
|
+
async share(data) {
|
|
230
|
+
if (this.isShareSupported()) {
|
|
231
|
+
if (navigator.canShare(data)) {
|
|
232
|
+
await navigator.share(data);
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
console.debug('share data:', data);
|
|
236
|
+
throw new Error('Can not share data. Data is invalid!');
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
alert('Native share is not supported!');
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
isShareSupported() {
|
|
244
|
+
return !!navigator.share;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
ShareService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
248
|
+
ShareService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareService, providedIn: 'root' });
|
|
249
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareService, decorators: [{
|
|
250
|
+
type: Injectable,
|
|
251
|
+
args: [{ providedIn: 'root' }]
|
|
252
|
+
}] });
|
|
253
|
+
class ShareButtonDirective {
|
|
254
|
+
constructor(shareService) {
|
|
255
|
+
this.shareService = shareService;
|
|
256
|
+
}
|
|
257
|
+
share() {
|
|
258
|
+
this.shareService.share({ url: this.url, text: this.text, files: this.files, title: this.title })
|
|
259
|
+
.then(() => console.log('share successfully'))
|
|
260
|
+
.catch(err => console.error('share failed', err.message));
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
ShareButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareButtonDirective, deps: [{ token: ShareService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
264
|
+
ShareButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: ShareButtonDirective, selector: "[rxapShareButton]", inputs: { url: "url", text: "text", title: "title", files: "files" }, host: { listeners: { "click": "share()" } }, ngImport: i0 });
|
|
265
|
+
__decorate([
|
|
266
|
+
Required,
|
|
267
|
+
__metadata("design:type", String)
|
|
268
|
+
], ShareButtonDirective.prototype, "title", void 0);
|
|
269
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareButtonDirective, decorators: [{
|
|
270
|
+
type: Directive,
|
|
271
|
+
args: [{
|
|
272
|
+
selector: '[rxapShareButton]'
|
|
273
|
+
}]
|
|
274
|
+
}], ctorParameters: function () { return [{ type: ShareService }]; }, propDecorators: { url: [{
|
|
275
|
+
type: Input
|
|
276
|
+
}], text: [{
|
|
277
|
+
type: Input
|
|
278
|
+
}], title: [{
|
|
279
|
+
type: Input
|
|
280
|
+
}], files: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}], share: [{
|
|
283
|
+
type: HostListener,
|
|
284
|
+
args: ['click']
|
|
285
|
+
}] } });
|
|
286
|
+
class ShareButtonDirectiveModule {
|
|
287
|
+
}
|
|
288
|
+
ShareButtonDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareButtonDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
289
|
+
ShareButtonDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareButtonDirectiveModule, declarations: [ShareButtonDirective], exports: [ShareButtonDirective] });
|
|
290
|
+
ShareButtonDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareButtonDirectiveModule });
|
|
291
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ShareButtonDirectiveModule, decorators: [{
|
|
292
|
+
type: NgModule,
|
|
293
|
+
args: [{
|
|
294
|
+
exports: [ShareButtonDirective],
|
|
295
|
+
declarations: [ShareButtonDirective]
|
|
296
|
+
}]
|
|
297
|
+
}] });
|
|
298
|
+
|
|
299
|
+
class FullWidthDirective {
|
|
300
|
+
constructor() {
|
|
301
|
+
this.width = '100%';
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
FullWidthDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FullWidthDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
305
|
+
FullWidthDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FullWidthDirective, selector: "[rxapFullWidth]", host: { properties: { "style.width": "this.width" } }, ngImport: i0 });
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FullWidthDirective, decorators: [{
|
|
307
|
+
type: Directive,
|
|
308
|
+
args: [{
|
|
309
|
+
selector: '[rxapFullWidth]',
|
|
310
|
+
}]
|
|
311
|
+
}], propDecorators: { width: [{
|
|
312
|
+
type: HostBinding,
|
|
313
|
+
args: ['style.width']
|
|
314
|
+
}] } });
|
|
315
|
+
class FullWidthDirectiveModule {
|
|
316
|
+
}
|
|
317
|
+
FullWidthDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FullWidthDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
318
|
+
FullWidthDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FullWidthDirectiveModule, declarations: [FullWidthDirective], exports: [FullWidthDirective] });
|
|
319
|
+
FullWidthDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FullWidthDirectiveModule });
|
|
320
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FullWidthDirectiveModule, decorators: [{
|
|
321
|
+
type: NgModule,
|
|
322
|
+
args: [{
|
|
323
|
+
declarations: [FullWidthDirective],
|
|
324
|
+
exports: [FullWidthDirective]
|
|
325
|
+
}]
|
|
326
|
+
}] });
|
|
327
|
+
|
|
328
|
+
class AvatarBackgroundImageDirective extends BackgroundImageDirective {
|
|
329
|
+
constructor(host, renderer, imageLoader, avatarImage) {
|
|
330
|
+
super(host, renderer, imageLoader);
|
|
331
|
+
this.avatarImage = avatarImage;
|
|
332
|
+
this.imageUrl = null;
|
|
333
|
+
this.size = BackgroundSizeOptions.COVER;
|
|
334
|
+
this.repeat = BackgroundRepeatOptions.NO_REPEAT;
|
|
335
|
+
}
|
|
336
|
+
set name(name) {
|
|
337
|
+
if (!this.placeholderImageUrl) {
|
|
338
|
+
this.placeholderImageUrl = this.avatarImage.get({ name });
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
AvatarBackgroundImageDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AvatarBackgroundImageDirective, deps: [{ token: ElementRef }, { token: Renderer2 }, { token: ImageLoaderService }, { token: AvatarImageService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
343
|
+
AvatarBackgroundImageDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: AvatarBackgroundImageDirective, selector: "[rxapAvatarBackgroundImage]", inputs: { name: "name", imageUrl: ["rxapAvatarBackgroundImage", "imageUrl"] }, usesInheritance: true, ngImport: i0 });
|
|
344
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AvatarBackgroundImageDirective, decorators: [{
|
|
345
|
+
type: Directive,
|
|
346
|
+
args: [{
|
|
347
|
+
// tslint:disable-next-line:directive-selector
|
|
348
|
+
selector: '[rxapAvatarBackgroundImage]',
|
|
349
|
+
}]
|
|
350
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef, decorators: [{
|
|
351
|
+
type: Inject,
|
|
352
|
+
args: [ElementRef]
|
|
353
|
+
}] }, { type: i0.Renderer2, decorators: [{
|
|
354
|
+
type: Inject,
|
|
355
|
+
args: [Renderer2]
|
|
356
|
+
}] }, { type: i1.ImageLoaderService, decorators: [{
|
|
357
|
+
type: Inject,
|
|
358
|
+
args: [ImageLoaderService]
|
|
359
|
+
}] }, { type: i1.AvatarImageService, decorators: [{
|
|
360
|
+
type: Inject,
|
|
361
|
+
args: [AvatarImageService]
|
|
362
|
+
}] }]; }, propDecorators: { name: [{
|
|
363
|
+
type: Input
|
|
364
|
+
}], imageUrl: [{
|
|
365
|
+
type: Input,
|
|
366
|
+
args: ['rxapAvatarBackgroundImage']
|
|
367
|
+
}] } });
|
|
368
|
+
class AvatarBackgroundImageDirectiveModule {
|
|
369
|
+
}
|
|
370
|
+
AvatarBackgroundImageDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AvatarBackgroundImageDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
371
|
+
AvatarBackgroundImageDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AvatarBackgroundImageDirectiveModule, declarations: [AvatarBackgroundImageDirective], exports: [AvatarBackgroundImageDirective] });
|
|
372
|
+
AvatarBackgroundImageDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AvatarBackgroundImageDirectiveModule });
|
|
373
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AvatarBackgroundImageDirectiveModule, decorators: [{
|
|
374
|
+
type: NgModule,
|
|
375
|
+
args: [{
|
|
376
|
+
declarations: [AvatarBackgroundImageDirective],
|
|
377
|
+
exports: [AvatarBackgroundImageDirective],
|
|
378
|
+
}]
|
|
379
|
+
}] });
|
|
380
|
+
|
|
381
|
+
class ContenteditableDirective {
|
|
382
|
+
constructor(elementRef) {
|
|
383
|
+
this.elementRef = elementRef;
|
|
384
|
+
this.contenteditable = true;
|
|
385
|
+
this.spellcheck = false;
|
|
386
|
+
this.change = new EventEmitter();
|
|
387
|
+
}
|
|
388
|
+
onClick($event) {
|
|
389
|
+
$event.stopPropagation();
|
|
390
|
+
}
|
|
391
|
+
async onInput($event) {
|
|
392
|
+
const value = ($event.target.textContent)?.trim();
|
|
393
|
+
if (value && value.length >= 2) {
|
|
394
|
+
const event = {
|
|
395
|
+
value,
|
|
396
|
+
parameters: this.parameters
|
|
397
|
+
};
|
|
398
|
+
this.change.emit(event);
|
|
399
|
+
const result = await this.method?.call(event);
|
|
400
|
+
if (result && typeof result === 'string') {
|
|
401
|
+
this.initial = this.elementRef.nativeElement.innerText = result;
|
|
402
|
+
}
|
|
403
|
+
else if (this.initial) {
|
|
404
|
+
this.elementRef.nativeElement.innerText = this.initial;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
ContenteditableDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ContenteditableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
410
|
+
ContenteditableDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: ContenteditableDirective, selector: "[rxapContenteditable]", inputs: { method: ["rxapContenteditable", "method"], parameters: "parameters", initial: "initial" }, outputs: { change: "rxapContenteditable" }, host: { listeners: { "click": "onClick($event)", "input": "onInput($event)" }, properties: { "attr.contenteditable": "this.contenteditable", "attr.spellcheck": "this.spellcheck" } }, ngImport: i0 });
|
|
411
|
+
__decorate([
|
|
412
|
+
DebounceCall(1000),
|
|
413
|
+
__metadata("design:type", Function),
|
|
414
|
+
__metadata("design:paramtypes", [Object]),
|
|
415
|
+
__metadata("design:returntype", Promise)
|
|
416
|
+
], ContenteditableDirective.prototype, "onInput", null);
|
|
417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ContenteditableDirective, decorators: [{
|
|
418
|
+
type: Directive,
|
|
419
|
+
args: [{
|
|
420
|
+
selector: '[rxapContenteditable]'
|
|
421
|
+
}]
|
|
422
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { contenteditable: [{
|
|
423
|
+
type: HostBinding,
|
|
424
|
+
args: ['attr.contenteditable']
|
|
425
|
+
}], spellcheck: [{
|
|
426
|
+
type: HostBinding,
|
|
427
|
+
args: ['attr.spellcheck']
|
|
428
|
+
}], method: [{
|
|
429
|
+
type: Input,
|
|
430
|
+
args: ['rxapContenteditable']
|
|
431
|
+
}], change: [{
|
|
432
|
+
type: Output,
|
|
433
|
+
args: ['rxapContenteditable']
|
|
434
|
+
}], parameters: [{
|
|
435
|
+
type: Input
|
|
436
|
+
}], initial: [{
|
|
437
|
+
type: Input
|
|
438
|
+
}], onClick: [{
|
|
439
|
+
type: HostListener,
|
|
440
|
+
args: ['click', ['$event']]
|
|
441
|
+
}], onInput: [{
|
|
442
|
+
type: HostListener,
|
|
443
|
+
args: ['input', ['$event']]
|
|
444
|
+
}] } });
|
|
445
|
+
class ContenteditableDirectiveModule {
|
|
446
|
+
}
|
|
447
|
+
ContenteditableDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ContenteditableDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
448
|
+
ContenteditableDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ContenteditableDirectiveModule, declarations: [ContenteditableDirective], exports: [ContenteditableDirective] });
|
|
449
|
+
ContenteditableDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ContenteditableDirectiveModule });
|
|
450
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ContenteditableDirectiveModule, decorators: [{
|
|
451
|
+
type: NgModule,
|
|
452
|
+
args: [{
|
|
453
|
+
declarations: [ContenteditableDirective],
|
|
454
|
+
exports: [ContenteditableDirective]
|
|
455
|
+
}]
|
|
456
|
+
}] });
|
|
457
|
+
|
|
458
|
+
class ConfirmClick {
|
|
459
|
+
constructor() {
|
|
460
|
+
this._hasConfirmDirective = false;
|
|
461
|
+
}
|
|
462
|
+
set hasConfirmDirective(value) {
|
|
463
|
+
this._hasConfirmDirective = coerceBoolean(value);
|
|
464
|
+
}
|
|
465
|
+
onClick() {
|
|
466
|
+
if (!this._hasConfirmDirective) {
|
|
467
|
+
this.execute();
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
onConfirm() {
|
|
471
|
+
this.execute();
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
ConfirmClick.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ConfirmClick, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
475
|
+
ConfirmClick.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ConfirmClick });
|
|
476
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ConfirmClick, decorators: [{
|
|
477
|
+
type: Injectable
|
|
478
|
+
}], propDecorators: { hasConfirmDirective: [{
|
|
479
|
+
type: Input,
|
|
480
|
+
args: ['rxapConfirm']
|
|
481
|
+
}], onClick: [{
|
|
482
|
+
type: HostListener,
|
|
483
|
+
args: ['click']
|
|
484
|
+
}], onConfirm: [{
|
|
485
|
+
type: HostListener,
|
|
486
|
+
args: ['confirmed']
|
|
487
|
+
}] } });
|
|
488
|
+
|
|
489
|
+
class MethodDirective {
|
|
490
|
+
constructor() {
|
|
491
|
+
this._hasConfirmDirective = false;
|
|
492
|
+
this.immediately = false;
|
|
493
|
+
this.executed$ = new EventEmitter();
|
|
494
|
+
this.failure$ = new EventEmitter();
|
|
495
|
+
this.successful$ = new EventEmitter();
|
|
496
|
+
/**
|
|
497
|
+
* true - a remote method call is in progress
|
|
498
|
+
*/
|
|
499
|
+
this.executing$ = new ToggleSubject();
|
|
500
|
+
}
|
|
501
|
+
set hasConfirmDirective(value) {
|
|
502
|
+
this._hasConfirmDirective = coerceBoolean(value);
|
|
503
|
+
}
|
|
504
|
+
ngOnInit() {
|
|
505
|
+
if (this.immediately) {
|
|
506
|
+
this.execute();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
onConfirmed() {
|
|
510
|
+
return this.execute();
|
|
511
|
+
}
|
|
512
|
+
onClick() {
|
|
513
|
+
if (!this._hasConfirmDirective) {
|
|
514
|
+
return this.execute();
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
if (isDevMode()) {
|
|
518
|
+
console.debug('Skip method call. Wait for confirmation.');
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
return Promise.resolve();
|
|
522
|
+
}
|
|
523
|
+
async execute() {
|
|
524
|
+
this.executing$.enable();
|
|
525
|
+
try {
|
|
526
|
+
const result = await this.method.call(this.parameters);
|
|
527
|
+
this.executed(result);
|
|
528
|
+
this.successful(result);
|
|
529
|
+
}
|
|
530
|
+
catch (error) {
|
|
531
|
+
if (isDevMode()) {
|
|
532
|
+
console.error(`Method directive execution failed:`, error.message);
|
|
533
|
+
}
|
|
534
|
+
this.failure(error);
|
|
535
|
+
}
|
|
536
|
+
finally {
|
|
537
|
+
this.executing$.disable();
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
setParameter(parameterKey, value) {
|
|
541
|
+
this.updateParameters({ [parameterKey]: value });
|
|
542
|
+
}
|
|
543
|
+
updateParameters(parameters) {
|
|
544
|
+
this.parameters = { ...(this.parameters ?? {}), ...parameters };
|
|
545
|
+
}
|
|
546
|
+
executed(result) {
|
|
547
|
+
this.executed$.emit(result);
|
|
548
|
+
}
|
|
549
|
+
failure(error) {
|
|
550
|
+
this.failure$.emit(error);
|
|
551
|
+
}
|
|
552
|
+
successful(result) {
|
|
553
|
+
this.successful$.emit(result);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
MethodDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MethodDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
557
|
+
MethodDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: MethodDirective, selector: "[rxapMethod]", inputs: { hasConfirmDirective: ["rxapConfirm", "hasConfirmDirective"], method: ["rxapMethod", "method"], parameters: "parameters", immediately: "immediately" }, outputs: { executed$: "executed", failure$: "failure", successful$: "successful" }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick()" } }, exportAs: ["rxapMethod"], ngImport: i0 });
|
|
558
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MethodDirective, decorators: [{
|
|
559
|
+
type: Directive,
|
|
560
|
+
args: [{
|
|
561
|
+
selector: '[rxapMethod]',
|
|
562
|
+
exportAs: 'rxapMethod'
|
|
563
|
+
}]
|
|
564
|
+
}], ctorParameters: function () { return []; }, propDecorators: { hasConfirmDirective: [{
|
|
565
|
+
type: Input,
|
|
566
|
+
args: ['rxapConfirm']
|
|
567
|
+
}], method: [{
|
|
568
|
+
type: Input,
|
|
569
|
+
args: ['rxapMethod']
|
|
570
|
+
}], parameters: [{
|
|
571
|
+
type: Input
|
|
572
|
+
}], immediately: [{
|
|
573
|
+
type: Input
|
|
574
|
+
}], executed$: [{
|
|
575
|
+
type: Output,
|
|
576
|
+
args: ['executed']
|
|
577
|
+
}], failure$: [{
|
|
578
|
+
type: Output,
|
|
579
|
+
args: ['failure']
|
|
580
|
+
}], successful$: [{
|
|
581
|
+
type: Output,
|
|
582
|
+
args: ['successful']
|
|
583
|
+
}], onConfirmed: [{
|
|
584
|
+
type: HostListener,
|
|
585
|
+
args: ['confirmed']
|
|
586
|
+
}], onClick: [{
|
|
587
|
+
type: HostListener,
|
|
588
|
+
args: ['click']
|
|
589
|
+
}] } });
|
|
590
|
+
class MethodDirectiveModule {
|
|
591
|
+
}
|
|
592
|
+
MethodDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MethodDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
593
|
+
MethodDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MethodDirectiveModule, declarations: [MethodDirective], exports: [MethodDirective] });
|
|
594
|
+
MethodDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MethodDirectiveModule });
|
|
595
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MethodDirectiveModule, decorators: [{
|
|
596
|
+
type: NgModule,
|
|
597
|
+
args: [{
|
|
598
|
+
declarations: [MethodDirective],
|
|
599
|
+
exports: [MethodDirective]
|
|
600
|
+
}]
|
|
601
|
+
}] });
|
|
602
|
+
|
|
603
|
+
class MovableDividerDirective {
|
|
604
|
+
constructor(renderer) {
|
|
605
|
+
this.renderer = renderer;
|
|
606
|
+
this.origin = 'right';
|
|
607
|
+
this.cursor = 'ew-resize';
|
|
608
|
+
this._subscription = new Subscription();
|
|
609
|
+
/**
|
|
610
|
+
* Indicates that the divider is moved with mouse down
|
|
611
|
+
* @private
|
|
612
|
+
*/
|
|
613
|
+
this._moveDivider = false;
|
|
614
|
+
/**
|
|
615
|
+
* Holds the current fixed element width.
|
|
616
|
+
* If null the move divider feature was not yet used and the initial
|
|
617
|
+
* fixed element width is not calculated
|
|
618
|
+
* @private
|
|
619
|
+
*/
|
|
620
|
+
this._fixedElementWidth = null;
|
|
621
|
+
}
|
|
622
|
+
ngOnDestroy() {
|
|
623
|
+
this._subscription?.unsubscribe();
|
|
624
|
+
}
|
|
625
|
+
ngOnInit() {
|
|
626
|
+
this._subscription.add(fromEvent(this.containerElement, 'mousemove').pipe(tap(($event) => {
|
|
627
|
+
if (this._moveDivider) {
|
|
628
|
+
if (!this._fixedElementWidth) {
|
|
629
|
+
this._fixedElementWidth = this.fixedElement.clientWidth;
|
|
630
|
+
}
|
|
631
|
+
if (this.origin === 'right') {
|
|
632
|
+
this._fixedElementWidth = $event.clientX - this.containerElement.getBoundingClientRect().left;
|
|
633
|
+
}
|
|
634
|
+
else if (this.origin === 'left') {
|
|
635
|
+
console.log({
|
|
636
|
+
clientWidth: this.containerElement.clientWidth,
|
|
637
|
+
clientX: $event.clientX,
|
|
638
|
+
clientLeft: this.containerElement.getBoundingClientRect().left
|
|
639
|
+
});
|
|
640
|
+
this._fixedElementWidth = this.containerElement.clientWidth - $event.clientX + this.containerElement.getBoundingClientRect().left;
|
|
641
|
+
}
|
|
642
|
+
else {
|
|
643
|
+
throw new Error(`The origin '${this.origin}' is not supported.`);
|
|
644
|
+
}
|
|
645
|
+
const width = this._fixedElementWidth + 'px';
|
|
646
|
+
this.renderer.setStyle(this.fixedElement, 'max-width', width);
|
|
647
|
+
this.renderer.setStyle(this.fixedElement, 'min-width', width);
|
|
648
|
+
this.renderer.setStyle(this.fixedElement, 'flex-basis', width);
|
|
649
|
+
}
|
|
650
|
+
})).subscribe());
|
|
651
|
+
this._subscription.add(fromEvent(this.containerElement, 'mouseup').pipe(tap(() => this._moveDivider = false)).subscribe());
|
|
652
|
+
}
|
|
653
|
+
onMousedown() {
|
|
654
|
+
this._moveDivider = true;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
MovableDividerDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MovableDividerDirective, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
658
|
+
MovableDividerDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: MovableDividerDirective, selector: "[rxapMovableDivider]", inputs: { containerElement: "containerElement", fixedElement: "fixedElement", origin: "origin" }, host: { listeners: { "mousedown": "onMousedown()" }, properties: { "style.cursor": "this.cursor" } }, ngImport: i0 });
|
|
659
|
+
__decorate([
|
|
660
|
+
Required,
|
|
661
|
+
__metadata("design:type", HTMLDivElement)
|
|
662
|
+
], MovableDividerDirective.prototype, "containerElement", void 0);
|
|
663
|
+
__decorate([
|
|
664
|
+
Required,
|
|
665
|
+
__metadata("design:type", HTMLDivElement)
|
|
666
|
+
], MovableDividerDirective.prototype, "fixedElement", void 0);
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MovableDividerDirective, decorators: [{
|
|
668
|
+
type: Directive,
|
|
669
|
+
args: [{
|
|
670
|
+
selector: '[rxapMovableDivider]'
|
|
671
|
+
}]
|
|
672
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { containerElement: [{
|
|
673
|
+
type: Input
|
|
674
|
+
}], fixedElement: [{
|
|
675
|
+
type: Input
|
|
676
|
+
}], origin: [{
|
|
677
|
+
type: Input
|
|
678
|
+
}], cursor: [{
|
|
679
|
+
type: HostBinding,
|
|
680
|
+
args: ['style.cursor']
|
|
681
|
+
}], onMousedown: [{
|
|
682
|
+
type: HostListener,
|
|
683
|
+
args: ['mousedown']
|
|
684
|
+
}] } });
|
|
685
|
+
class MovableDividerDirectiveModule {
|
|
686
|
+
}
|
|
687
|
+
MovableDividerDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MovableDividerDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
688
|
+
MovableDividerDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MovableDividerDirectiveModule, declarations: [MovableDividerDirective], exports: [MovableDividerDirective] });
|
|
689
|
+
MovableDividerDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MovableDividerDirectiveModule });
|
|
690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MovableDividerDirectiveModule, decorators: [{
|
|
691
|
+
type: NgModule,
|
|
692
|
+
args: [{
|
|
693
|
+
declarations: [MovableDividerDirective],
|
|
694
|
+
exports: [MovableDividerDirective]
|
|
695
|
+
}]
|
|
696
|
+
}] });
|
|
697
|
+
|
|
698
|
+
// TODO : mv to rxap package
|
|
699
|
+
class IfTruthyDirective {
|
|
700
|
+
constructor(templateRef, viewContainerRef, cdr) {
|
|
701
|
+
this.templateRef = templateRef;
|
|
702
|
+
this.viewContainerRef = viewContainerRef;
|
|
703
|
+
this.cdr = cdr;
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Asserts the correct type of the context for the template that `NgForOf` will render.
|
|
707
|
+
*
|
|
708
|
+
* The presence of this method is a signal to the Ivy template type-check compiler that the
|
|
709
|
+
* `NgForOf` structural directive renders its template with a specific context type.
|
|
710
|
+
*/
|
|
711
|
+
static ngTemplateContextGuard(dir, ctx) {
|
|
712
|
+
return true;
|
|
713
|
+
}
|
|
714
|
+
ngOnChanges(changes) {
|
|
715
|
+
if (this.method && this.parameters) {
|
|
716
|
+
this.execute();
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
async execute() {
|
|
720
|
+
const result = await this.method.call(this.parameters);
|
|
721
|
+
if (this.hasChanged(result)) {
|
|
722
|
+
this.viewContainerRef.clear();
|
|
723
|
+
if (result) {
|
|
724
|
+
this.viewContainerRef.createEmbeddedView(this.templateRef, { $implicit: result });
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
this.cdr.detectChanges();
|
|
728
|
+
}
|
|
729
|
+
hasChanged(current) {
|
|
730
|
+
if (this._last !== undefined) {
|
|
731
|
+
const currentTrackBy = this.trackBy ? this.trackBy(current) : current;
|
|
732
|
+
const lastTrackBy = this.trackBy ? this.trackBy(this._last) : this._last;
|
|
733
|
+
return currentTrackBy !== lastTrackBy;
|
|
734
|
+
}
|
|
735
|
+
return true;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
IfTruthyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: IfTruthyDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
739
|
+
IfTruthyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: IfTruthyDirective, selector: "[rxapIfTruthy]", inputs: { method: ["rxapIfTruthy", "method"], parameters: ["rxapIfTruthyParameters", "parameters"], trackBy: ["rxapIfTruthyTrackBy", "trackBy"] }, usesOnChanges: true, ngImport: i0 });
|
|
740
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: IfTruthyDirective, decorators: [{
|
|
741
|
+
type: Directive,
|
|
742
|
+
args: [{
|
|
743
|
+
selector: '[rxapIfTruthy]'
|
|
744
|
+
}]
|
|
745
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { method: [{
|
|
746
|
+
type: Input,
|
|
747
|
+
args: ['rxapIfTruthy']
|
|
748
|
+
}], parameters: [{
|
|
749
|
+
type: Input,
|
|
750
|
+
args: ['rxapIfTruthyParameters']
|
|
751
|
+
}], trackBy: [{
|
|
752
|
+
type: Input,
|
|
753
|
+
args: ['rxapIfTruthyTrackBy']
|
|
754
|
+
}] } });
|
|
755
|
+
class IfTruthyDirectiveModule {
|
|
756
|
+
}
|
|
757
|
+
IfTruthyDirectiveModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: IfTruthyDirectiveModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
758
|
+
IfTruthyDirectiveModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: IfTruthyDirectiveModule, declarations: [IfTruthyDirective], exports: [IfTruthyDirective] });
|
|
759
|
+
IfTruthyDirectiveModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: IfTruthyDirectiveModule });
|
|
760
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: IfTruthyDirectiveModule, decorators: [{
|
|
761
|
+
type: NgModule,
|
|
762
|
+
args: [{
|
|
763
|
+
declarations: [IfTruthyDirective],
|
|
764
|
+
exports: [IfTruthyDirective]
|
|
765
|
+
}]
|
|
766
|
+
}] });
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Generated bundle index. Do not edit.
|
|
770
|
+
*/
|
|
771
|
+
|
|
772
|
+
export { AvatarBackgroundImageDirective, AvatarBackgroundImageDirectiveModule, BackgroundImageDirective, BackgroundImageDirectiveModule, BackgroundPositionOptions, BackgroundRepeatOptions, BackgroundSizeOptions, ConfirmClick, ContenteditableDirective, ContenteditableDirectiveModule, FullWidthDirective, FullWidthDirectiveModule, GlobalStyleOptions, IfTruthyDirective, IfTruthyDirectiveModule, MethodDirective, MethodDirectiveModule, MovableDividerDirective, MovableDividerDirectiveModule, PreventDefaultDirective, PreventDefaultDirectiveModule, ShareButtonDirective, ShareButtonDirectiveModule, ShareService, StopImmediatePropagationDirective, StopImmediatePropagationDirectiveModule, StopPropagationDirective, StopPropagationDirectiveModule };
|
|
773
|
+
//# sourceMappingURL=rxap-directives.mjs.map
|