@rxap/directives 21.0.1-dev.1 → 22.0.0-dev.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/compodoc/changelog.html +24 -0
  3. package/compodoc/dependencies.html +6 -6
  4. package/compodoc/js/search/search_index.js +2 -2
  5. package/compodoc/properties.html +1 -1
  6. package/docs/documentation.json +184 -184
  7. package/docs/html/classes/AvatarBackgroundImageDirective.html +4 -4
  8. package/docs/html/classes/BackgroundImageDirective.html +3 -3
  9. package/docs/html/classes/ConfirmClick.html +2 -2
  10. package/docs/html/classes/ContenteditableDirective.html +3 -3
  11. package/docs/html/classes/FullWidthDirective.html +2 -2
  12. package/docs/html/classes/IfTruthyDirective.html +3 -3
  13. package/docs/html/classes/IsDevModeDirective.html +3 -3
  14. package/docs/html/classes/MethodDirective.html +4 -4
  15. package/docs/html/classes/MethodTemplateDirective.html +4 -4
  16. package/docs/html/classes/MovableDividerDirective.html +2 -2
  17. package/docs/html/classes/PreventDefaultDirective.html +2 -2
  18. package/docs/html/classes/ShareButtonDirective.html +2 -2
  19. package/docs/html/classes/ShareService.html +2 -2
  20. package/docs/html/classes/StopImmediatePropagationDirective.html +2 -2
  21. package/docs/html/classes/StopPropagationDirective.html +2 -2
  22. package/docs/html/enums/BackgroundPositionOptions.html +2 -2
  23. package/docs/html/enums/BackgroundRepeatOptions.html +2 -2
  24. package/docs/html/enums/BackgroundSizeOptions.html +2 -2
  25. package/docs/html/enums/GlobalStyleOptions.html +2 -2
  26. package/docs/html/hierarchy.html +1 -1
  27. package/docs/html/index.html +2 -2
  28. package/docs/html/interfaces/ContenteditableEvent.html +2 -2
  29. package/docs/html/interfaces/IfTruthyDirectiveTemplateContext.html +2 -2
  30. package/docs/html/interfaces/MethodTemplateDirectiveContext.html +2 -2
  31. package/docs/html/interfaces/MethodTemplateDirectiveErrorContext.html +2 -2
  32. package/docs/html/interfaces/ShareData.html +2 -2
  33. package/docs/html/modules.html +1 -1
  34. package/docs/html/types/BackgroundPosition.html +1 -1
  35. package/docs/html/types/BackgroundRepeat.html +1 -1
  36. package/docs/html/types/BackgroundSize.html +1 -1
  37. package/docs/markdown/README.md +1 -1
  38. package/docs/markdown/classes/AvatarBackgroundImageDirective.md +10 -10
  39. package/docs/markdown/classes/BackgroundImageDirective.md +9 -9
  40. package/docs/markdown/classes/ConfirmClick.md +6 -6
  41. package/docs/markdown/classes/ContenteditableDirective.md +9 -9
  42. package/docs/markdown/classes/FullWidthDirective.md +2 -2
  43. package/docs/markdown/classes/IfTruthyDirective.md +9 -9
  44. package/docs/markdown/classes/IsDevModeDirective.md +4 -4
  45. package/docs/markdown/classes/MethodDirective.md +20 -20
  46. package/docs/markdown/classes/MethodTemplateDirective.md +27 -27
  47. package/docs/markdown/classes/MovableDividerDirective.md +7 -7
  48. package/docs/markdown/classes/PreventDefaultDirective.md +3 -3
  49. package/docs/markdown/classes/ShareButtonDirective.md +9 -9
  50. package/docs/markdown/classes/ShareService.md +4 -4
  51. package/docs/markdown/classes/StopImmediatePropagationDirective.md +3 -3
  52. package/docs/markdown/classes/StopPropagationDirective.md +3 -3
  53. package/docs/markdown/enumerations/BackgroundPositionOptions.md +4 -4
  54. package/docs/markdown/enumerations/BackgroundRepeatOptions.md +3 -3
  55. package/docs/markdown/enumerations/BackgroundSizeOptions.md +5 -5
  56. package/docs/markdown/enumerations/GlobalStyleOptions.md +4 -4
  57. package/docs/markdown/globals.md +2 -2
  58. package/docs/markdown/interfaces/ContenteditableEvent.md +4 -4
  59. package/docs/markdown/interfaces/IfTruthyDirectiveTemplateContext.md +3 -3
  60. package/docs/markdown/interfaces/MethodTemplateDirectiveContext.md +3 -3
  61. package/docs/markdown/interfaces/MethodTemplateDirectiveErrorContext.md +4 -4
  62. package/docs/markdown/interfaces/ShareData.md +6 -6
  63. package/docs/markdown/type-aliases/BackgroundPosition.md +2 -2
  64. package/docs/markdown/type-aliases/BackgroundRepeat.md +2 -2
  65. package/docs/markdown/type-aliases/BackgroundSize.md +2 -2
  66. package/docs/wiki/Class.AvatarBackgroundImageDirective.md +9 -9
  67. package/docs/wiki/Class.BackgroundImageDirective.md +8 -8
  68. package/docs/wiki/Class.ConfirmClick.md +5 -5
  69. package/docs/wiki/Class.ContenteditableDirective.md +8 -8
  70. package/docs/wiki/Class.FullWidthDirective.md +1 -1
  71. package/docs/wiki/Class.IfTruthyDirective.md +8 -8
  72. package/docs/wiki/Class.IsDevModeDirective.md +3 -3
  73. package/docs/wiki/Class.MethodDirective.md +19 -19
  74. package/docs/wiki/Class.MethodTemplateDirective.md +26 -26
  75. package/docs/wiki/Class.MovableDividerDirective.md +6 -6
  76. package/docs/wiki/Class.PreventDefaultDirective.md +2 -2
  77. package/docs/wiki/Class.ShareButtonDirective.md +8 -8
  78. package/docs/wiki/Class.ShareService.md +3 -3
  79. package/docs/wiki/Class.StopImmediatePropagationDirective.md +2 -2
  80. package/docs/wiki/Class.StopPropagationDirective.md +2 -2
  81. package/docs/wiki/Enumeration.BackgroundPositionOptions.md +3 -3
  82. package/docs/wiki/Enumeration.BackgroundRepeatOptions.md +2 -2
  83. package/docs/wiki/Enumeration.BackgroundSizeOptions.md +4 -4
  84. package/docs/wiki/Enumeration.GlobalStyleOptions.md +3 -3
  85. package/docs/wiki/Interface.ContenteditableEvent.md +3 -3
  86. package/docs/wiki/Interface.IfTruthyDirectiveTemplateContext.md +2 -2
  87. package/docs/wiki/Interface.MethodTemplateDirectiveContext.md +2 -2
  88. package/docs/wiki/Interface.MethodTemplateDirectiveErrorContext.md +3 -3
  89. package/docs/wiki/Interface.ShareData.md +5 -5
  90. package/docs/wiki/TypeAlias.BackgroundPosition.md +1 -1
  91. package/docs/wiki/TypeAlias.BackgroundRepeat.md +1 -1
  92. package/docs/wiki/TypeAlias.BackgroundSize.md +1 -1
  93. package/docs/wiki/globals.md +1 -1
  94. package/fesm2022/rxap-directives.mjs +1633 -741
  95. package/fesm2022/rxap-directives.mjs.map +1 -1
  96. package/package.json +14 -14
  97. package/types/rxap-directives.d.ts +429 -249
@@ -1,752 +1,1644 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Renderer2, input, computed, effect, untracked, Directive, output, linkedSignal, TemplateRef, ViewContainerRef, isDevMode, Injectable } from '@angular/core';
3
- import { ImageLoaderService, AvatarImageService } from '@rxap/services';
4
- import { coerceBoolean, DebounceCall } from '@rxap/utilities';
5
- import { __decorate, __metadata } from 'tslib';
6
- import { outputFromObservable } from '@angular/core/rxjs-interop';
7
- import { ToggleSubject } from '@rxap/rxjs';
8
- import { Subscription, fromEvent } from 'rxjs';
9
- import { tap } from 'rxjs/operators';
10
-
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, ElementRef, Injectable, Renderer2, TemplateRef, ViewContainerRef, computed, effect, inject, input, isDevMode, linkedSignal, output, untracked } from "@angular/core";
3
+ import { AvatarImageService, ImageLoaderService } from "@rxap/services";
4
+ import { DebounceCall, coerceBoolean } from "@rxap/utilities";
5
+ import { __decorate, __metadata } from "tslib";
6
+ import { outputFromObservable } from "@angular/core/rxjs-interop";
7
+ import { ToggleSubject } from "@rxap/rxjs";
8
+ import { Subscription, fromEvent } from "rxjs";
9
+ import { tap } from "rxjs/operators";
11
10
  var GlobalStyleOptions;
12
- (function (GlobalStyleOptions) {
13
- GlobalStyleOptions["INITIAL"] = "initial";
14
- GlobalStyleOptions["INHERIT"] = "inherit";
11
+ (function(GlobalStyleOptions) {
12
+ GlobalStyleOptions["INITIAL"] = "initial";
13
+ GlobalStyleOptions["INHERIT"] = "inherit";
15
14
  })(GlobalStyleOptions || (GlobalStyleOptions = {}));
16
- // TODO : complete description
17
- // https://www.w3schools.com/cssref/css3_pr_background-size.asp
18
15
  var BackgroundSizeOptions;
19
- (function (BackgroundSizeOptions) {
20
- BackgroundSizeOptions["AUTO"] = "auto";
21
- BackgroundSizeOptions["COVER"] = "cover";
22
- BackgroundSizeOptions["CONTAIN"] = "contain";
16
+ (function(BackgroundSizeOptions) {
17
+ BackgroundSizeOptions["AUTO"] = "auto";
18
+ BackgroundSizeOptions["COVER"] = "cover";
19
+ BackgroundSizeOptions["CONTAIN"] = "contain";
23
20
  })(BackgroundSizeOptions || (BackgroundSizeOptions = {}));
24
- // TODO : complete options and description
25
- // https://www.w3schools.com/cssref/pr_background-repeat.asp
26
21
  var BackgroundRepeatOptions;
27
- (function (BackgroundRepeatOptions) {
28
- BackgroundRepeatOptions["NO_REPEAT"] = "no-repeat";
22
+ (function(BackgroundRepeatOptions) {
23
+ BackgroundRepeatOptions["NO_REPEAT"] = "no-repeat";
29
24
  })(BackgroundRepeatOptions || (BackgroundRepeatOptions = {}));
30
- // TODO : complete options and description
31
- // https://www.w3schools.com/cssref/pr_background-position.asp
32
25
  var BackgroundPositionOptions;
33
- (function (BackgroundPositionOptions) {
34
- BackgroundPositionOptions["CENTER"] = "center";
35
- BackgroundPositionOptions["CENTER_CENTER"] = "center center";
26
+ (function(BackgroundPositionOptions) {
27
+ BackgroundPositionOptions["CENTER"] = "center";
28
+ BackgroundPositionOptions["CENTER_CENTER"] = "center center";
36
29
  })(BackgroundPositionOptions || (BackgroundPositionOptions = {}));
37
- class BackgroundImageDirective {
38
- constructor() {
39
- this.host = inject(ElementRef);
40
- this.renderer = inject(Renderer2);
41
- this.imageLoader = inject(ImageLoaderService);
42
- this.imageUrl = input(null, { ...(ngDevMode ? { debugName: "imageUrl" } : /* istanbul ignore next */ {}), alias: "rxapBackgroundImage" });
43
- this.placeholderImageUrl = input(...(ngDevMode ? [undefined, { debugName: "placeholderImageUrl" }] : /* istanbul ignore next */ []));
44
- this.size = input(...(ngDevMode ? [undefined, { debugName: "size" }] : /* istanbul ignore next */ []));
45
- this.repeat = input(...(ngDevMode ? [undefined, { debugName: "repeat" }] : /* istanbul ignore next */ []));
46
- this.position = input(...(ngDevMode ? [undefined, { debugName: "position" }] : /* istanbul ignore next */ []));
47
- /**
48
- * The placeholder url that is used until the image is loaded. Derived
49
- * directives can override this to provide a fallback.
50
- */
51
- this.placeholder = computed(() => this.placeholderImageUrl(), ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
52
- effect(() => {
53
- const size = this.size();
54
- untracked(() => this.sizeChange(size));
55
- });
56
- effect(() => {
57
- const position = this.position();
58
- untracked(() => this.positionChange(position));
59
- });
60
- effect(() => {
61
- const repeat = this.repeat();
62
- untracked(() => this.repeatChange(repeat));
63
- });
64
- effect(() => {
65
- const imageUrl = this.imageUrl();
66
- // the placeholder is tracked too, so it is applied as soon as it changes
67
- this.placeholder();
68
- // call unconditionally so clearing the value (null/empty) is handled
69
- untracked(() => this.imageUrlChange(imageUrl));
70
- });
71
- }
72
- applyStyle(style, value) {
73
- if (value) {
74
- this.renderer.setStyle(this.host.nativeElement, style, value);
75
- }
76
- else {
77
- this.renderer.removeStyle(this.host.nativeElement, style);
78
- }
79
- }
80
- repeatChange(repeat) {
81
- this.applyStyle('background-repeat', repeat);
82
- }
83
- positionChange(position) {
84
- this.applyStyle('background-position', position);
85
- }
86
- sizeChange(size) {
87
- this.applyStyle('background-size', size);
88
- }
89
- async imageUrlChange(imageUrl) {
90
- // track the most recently requested url so out-of-order loads can be ignored
91
- this._latestImageUrl = imageUrl;
92
- const placeholderImageUrl = this.placeholder();
93
- if (placeholderImageUrl) {
94
- this.renderer.setStyle(this.host.nativeElement, 'background-image', `url("${placeholderImageUrl}")`);
95
- }
96
- if (imageUrl) {
97
- await this.imageLoader.load(imageUrl);
98
- // a newer imageUrl was requested while this one was loading - drop the stale result
99
- if (this._latestImageUrl !== imageUrl) {
100
- return;
101
- }
102
- this.renderer.setStyle(this.host.nativeElement, 'background-image', `url("${imageUrl}")`);
103
- }
104
- else if (!placeholderImageUrl) {
105
- // clearing the image and no placeholder to fall back to
106
- this.renderer.removeStyle(this.host.nativeElement, 'background-image');
107
- }
108
- }
109
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: BackgroundImageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
110
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: BackgroundImageDirective, isStandalone: true, selector: "[rxapBackgroundImage]", inputs: { imageUrl: { classPropertyName: "imageUrl", publicName: "rxapBackgroundImage", isSignal: true, isRequired: false, transformFunction: null }, placeholderImageUrl: { classPropertyName: "placeholderImageUrl", publicName: "placeholderImageUrl", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, repeat: { classPropertyName: "repeat", publicName: "repeat", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
111
- }
112
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: BackgroundImageDirective, decorators: [{
113
- type: Directive,
114
- args: [{
115
- selector: '[rxapBackgroundImage]',
116
- standalone: true,
117
- }]
118
- }], ctorParameters: () => [], propDecorators: { imageUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapBackgroundImage", required: false }] }], placeholderImageUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderImageUrl", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], repeat: [{ type: i0.Input, args: [{ isSignal: true, alias: "repeat", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
119
-
120
- class AvatarBackgroundImageDirective extends BackgroundImageDirective {
121
- constructor() {
122
- super(...arguments);
123
- this.avatarImage = inject(AvatarImageService);
124
- this.imageUrl = input(null, { ...(ngDevMode ? { debugName: "imageUrl" } : /* istanbul ignore next */ {}), alias: 'rxapAvatarBackgroundImage' });
125
- this.size = input(BackgroundSizeOptions.COVER, ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
126
- this.repeat = input(BackgroundRepeatOptions.NO_REPEAT, ...(ngDevMode ? [{ debugName: "repeat" }] : /* istanbul ignore next */ []));
127
- this.position = input(...(ngDevMode ? [undefined, { debugName: "position" }] : /* istanbul ignore next */ []));
128
- /**
129
- * The name used to generate a placeholder avatar if no explicit
130
- * placeholderImageUrl is provided.
131
- */
132
- this.name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : /* istanbul ignore next */ []));
133
- this.placeholder = computed(() => {
134
- const placeholderImageUrl = this.placeholderImageUrl();
135
- if (placeholderImageUrl) {
136
- return placeholderImageUrl;
137
- }
138
- const name = this.name();
139
- return name ? this.avatarImage.get({ name }) : undefined;
140
- }, ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
141
- }
142
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AvatarBackgroundImageDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
143
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: AvatarBackgroundImageDirective, isStandalone: true, selector: "[rxapAvatarBackgroundImage]", inputs: { imageUrl: { classPropertyName: "imageUrl", publicName: "rxapAvatarBackgroundImage", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, repeat: { classPropertyName: "repeat", publicName: "repeat", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null } }, usesInheritance: true, ngImport: i0 }); }
144
- }
145
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AvatarBackgroundImageDirective, decorators: [{
146
- type: Directive,
147
- args: [{
148
- selector: '[rxapAvatarBackgroundImage]',
149
- standalone: true,
150
- }]
151
- }], propDecorators: { imageUrl: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapAvatarBackgroundImage", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], repeat: [{ type: i0.Input, args: [{ isSignal: true, alias: "repeat", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }] } });
152
-
153
- class ConfirmClick {
154
- constructor() {
155
- this.hasConfirmDirective = input(false, { ...(ngDevMode ? { debugName: "hasConfirmDirective" } : /* istanbul ignore next */ {}), alias: 'rxapConfirm', transform: coerceBoolean });
156
- }
157
- onClick() {
158
- if (!this.hasConfirmDirective()) {
159
- this.execute();
160
- }
161
- }
162
- onConfirm() {
163
- this.execute();
164
- }
165
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfirmClick, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
166
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: ConfirmClick, isStandalone: true, inputs: { hasConfirmDirective: { classPropertyName: "hasConfirmDirective", publicName: "rxapConfirm", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick()", "confirmed": "onConfirm()" } }, ngImport: i0 }); }
167
- }
168
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfirmClick, decorators: [{
169
- type: Directive,
170
- args: [{
171
- host: {
172
- '(click)': 'onClick()',
173
- '(confirmed)': 'onConfirm()',
174
- },
175
- }]
176
- }], propDecorators: { hasConfirmDirective: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapConfirm", required: false }] }] } });
177
-
178
- class ContenteditableDirective {
179
- constructor() {
180
- this.elementRef = inject(ElementRef);
181
- this.method = input(undefined, { ...(ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {}), alias: "rxapContenteditable" });
182
- // eslint-disable-next-line @angular-eslint/no-output-native
183
- this.change = output({ alias: 'rxapContenteditable' });
184
- this.parameters = input(...(ngDevMode ? [undefined, { debugName: "parameters" }] : /* istanbul ignore next */ []));
185
- this.initialValue = input(undefined, { ...(ngDevMode ? { debugName: "initialValue" } : /* istanbul ignore next */ {}), alias: 'initial' });
186
- /**
187
- * The last known good value. Follows the bound `initial` input and is
188
- * updated after a successful save.
189
- */
190
- this.initial = linkedSignal(() => this.initialValue(), ...(ngDevMode ? [{ debugName: "initial" }] : /* istanbul ignore next */ []));
191
- }
192
- onClick($event) {
193
- $event.stopPropagation();
194
- }
195
- async onInput($event) {
196
- const value = ($event.target.textContent)?.trim();
197
- if (value && value.length >= 2) {
198
- const event = {
199
- value,
200
- parameters: this.parameters(),
201
- };
202
- this.change.emit(event);
203
- try {
204
- const result = await this.method()?.call(event);
205
- if (result && typeof result === 'string') {
206
- // the handler returned a canonical value - apply and remember it
207
- this.elementRef.nativeElement.innerText = result;
208
- this.initial.set(result);
209
- }
210
- else {
211
- // successful save without a return value - keep the user's text and
212
- // update the baseline (do NOT revert what was just typed)
213
- this.initial.set(value);
214
- }
215
- }
216
- catch {
217
- // the save failed - revert to the last known good value if available
218
- const initial = this.initial();
219
- if (initial) {
220
- this.elementRef.nativeElement.innerText = initial;
221
- }
222
- }
223
- }
224
- }
225
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ContenteditableDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
226
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: ContenteditableDirective, isStandalone: true, selector: "[rxapContenteditable]", inputs: { method: { classPropertyName: "method", publicName: "rxapContenteditable", isSignal: true, isRequired: false, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initial", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "rxapContenteditable" }, host: { listeners: { "click": "onClick($event)", "input": "onInput($event)" }, properties: { "attr.contenteditable": "true", "attr.spellcheck": "false" } }, ngImport: i0 }); }
227
- }
30
+ var BackgroundImageDirective = class BackgroundImageDirective {
31
+ constructor() {
32
+ this.host = inject(ElementRef);
33
+ this.renderer = inject(Renderer2);
34
+ this.imageLoader = inject(ImageLoaderService);
35
+ this.imageUrl = input(null, {
36
+ ...ngDevMode ? { debugName: "imageUrl" } : /* istanbul ignore next */ {},
37
+ alias: "rxapBackgroundImage"
38
+ });
39
+ this.placeholderImageUrl = input(...ngDevMode ? [void 0, { debugName: "placeholderImageUrl" }] : /* istanbul ignore next */ []);
40
+ this.size = input(...ngDevMode ? [void 0, { debugName: "size" }] : /* istanbul ignore next */ []);
41
+ this.repeat = input(...ngDevMode ? [void 0, { debugName: "repeat" }] : /* istanbul ignore next */ []);
42
+ this.position = input(...ngDevMode ? [void 0, { debugName: "position" }] : /* istanbul ignore next */ []);
43
+ this.placeholder = computed(() => this.placeholderImageUrl(), ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
44
+ effect(() => {
45
+ const size = this.size();
46
+ untracked(() => this.sizeChange(size));
47
+ });
48
+ effect(() => {
49
+ const position = this.position();
50
+ untracked(() => this.positionChange(position));
51
+ });
52
+ effect(() => {
53
+ const repeat = this.repeat();
54
+ untracked(() => this.repeatChange(repeat));
55
+ });
56
+ effect(() => {
57
+ const imageUrl = this.imageUrl();
58
+ this.placeholder();
59
+ untracked(() => this.imageUrlChange(imageUrl));
60
+ });
61
+ }
62
+ applyStyle(style, value) {
63
+ if (value) this.renderer.setStyle(this.host.nativeElement, style, value);
64
+ else this.renderer.removeStyle(this.host.nativeElement, style);
65
+ }
66
+ repeatChange(repeat) {
67
+ this.applyStyle("background-repeat", repeat);
68
+ }
69
+ positionChange(position) {
70
+ this.applyStyle("background-position", position);
71
+ }
72
+ sizeChange(size) {
73
+ this.applyStyle("background-size", size);
74
+ }
75
+ async imageUrlChange(imageUrl) {
76
+ this._latestImageUrl = imageUrl;
77
+ const placeholderImageUrl = this.placeholder();
78
+ if (placeholderImageUrl) this.renderer.setStyle(this.host.nativeElement, "background-image", `url("${placeholderImageUrl}")`);
79
+ if (imageUrl) {
80
+ await this.imageLoader.load(imageUrl);
81
+ if (this._latestImageUrl !== imageUrl) return;
82
+ this.renderer.setStyle(this.host.nativeElement, "background-image", `url("${imageUrl}")`);
83
+ } else if (!placeholderImageUrl) this.renderer.removeStyle(this.host.nativeElement, "background-image");
84
+ }
85
+ static {
86
+ this.ɵfac = i0.ɵɵngDeclareFactory({
87
+ minVersion: "12.0.0",
88
+ version: "22.3.0",
89
+ ngImport: i0,
90
+ type: BackgroundImageDirective,
91
+ deps: [],
92
+ target: i0.ɵɵFactoryTarget.Directive
93
+ });
94
+ }
95
+ static {
96
+ this.ɵdir = i0.ɵɵngDeclareDirective({
97
+ minVersion: "17.1.0",
98
+ version: "22.3.0",
99
+ type: BackgroundImageDirective,
100
+ isStandalone: true,
101
+ selector: "[rxapBackgroundImage]",
102
+ inputs: {
103
+ imageUrl: {
104
+ classPropertyName: "imageUrl",
105
+ publicName: "rxapBackgroundImage",
106
+ isSignal: true,
107
+ isRequired: false,
108
+ transformFunction: null
109
+ },
110
+ placeholderImageUrl: {
111
+ classPropertyName: "placeholderImageUrl",
112
+ publicName: "placeholderImageUrl",
113
+ isSignal: true,
114
+ isRequired: false,
115
+ transformFunction: null
116
+ },
117
+ size: {
118
+ classPropertyName: "size",
119
+ publicName: "size",
120
+ isSignal: true,
121
+ isRequired: false,
122
+ transformFunction: null
123
+ },
124
+ repeat: {
125
+ classPropertyName: "repeat",
126
+ publicName: "repeat",
127
+ isSignal: true,
128
+ isRequired: false,
129
+ transformFunction: null
130
+ },
131
+ position: {
132
+ classPropertyName: "position",
133
+ publicName: "position",
134
+ isSignal: true,
135
+ isRequired: false,
136
+ transformFunction: null
137
+ }
138
+ },
139
+ ngImport: i0
140
+ });
141
+ }
142
+ };
143
+ i0.ɵɵngDeclareClassMetadata({
144
+ minVersion: "12.0.0",
145
+ version: "22.3.0",
146
+ ngImport: i0,
147
+ type: BackgroundImageDirective,
148
+ decorators: [{
149
+ type: Directive,
150
+ args: [{
151
+ selector: "[rxapBackgroundImage]",
152
+ standalone: true
153
+ }]
154
+ }],
155
+ ctorParameters: () => [],
156
+ propDecorators: {
157
+ imageUrl: [{
158
+ type: i0.Input,
159
+ args: [{
160
+ isSignal: true,
161
+ alias: "rxapBackgroundImage",
162
+ required: false
163
+ }]
164
+ }],
165
+ placeholderImageUrl: [{
166
+ type: i0.Input,
167
+ args: [{
168
+ isSignal: true,
169
+ alias: "placeholderImageUrl",
170
+ required: false
171
+ }]
172
+ }],
173
+ size: [{
174
+ type: i0.Input,
175
+ args: [{
176
+ isSignal: true,
177
+ alias: "size",
178
+ required: false
179
+ }]
180
+ }],
181
+ repeat: [{
182
+ type: i0.Input,
183
+ args: [{
184
+ isSignal: true,
185
+ alias: "repeat",
186
+ required: false
187
+ }]
188
+ }],
189
+ position: [{
190
+ type: i0.Input,
191
+ args: [{
192
+ isSignal: true,
193
+ alias: "position",
194
+ required: false
195
+ }]
196
+ }]
197
+ }
198
+ });
199
+ var AvatarBackgroundImageDirective = class AvatarBackgroundImageDirective extends BackgroundImageDirective {
200
+ constructor() {
201
+ super(...arguments);
202
+ this.avatarImage = inject(AvatarImageService);
203
+ this.imageUrl = input(null, {
204
+ ...ngDevMode ? { debugName: "imageUrl" } : /* istanbul ignore next */ {},
205
+ alias: "rxapAvatarBackgroundImage"
206
+ });
207
+ this.size = input(BackgroundSizeOptions.COVER, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
208
+ this.repeat = input(BackgroundRepeatOptions.NO_REPEAT, ...ngDevMode ? [{ debugName: "repeat" }] : /* istanbul ignore next */ []);
209
+ this.position = input(...ngDevMode ? [void 0, { debugName: "position" }] : /* istanbul ignore next */ []);
210
+ this.name = input(...ngDevMode ? [void 0, { debugName: "name" }] : /* istanbul ignore next */ []);
211
+ this.placeholder = computed(() => {
212
+ const placeholderImageUrl = this.placeholderImageUrl();
213
+ if (placeholderImageUrl) return placeholderImageUrl;
214
+ const name = this.name();
215
+ return name ? this.avatarImage.get({ name }) : void 0;
216
+ }, ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
217
+ }
218
+ static {
219
+ this.ɵfac = i0.ɵɵngDeclareFactory({
220
+ minVersion: "12.0.0",
221
+ version: "22.3.0",
222
+ ngImport: i0,
223
+ type: AvatarBackgroundImageDirective,
224
+ deps: null,
225
+ target: i0.ɵɵFactoryTarget.Directive
226
+ });
227
+ }
228
+ static {
229
+ this.ɵdir = i0.ɵɵngDeclareDirective({
230
+ minVersion: "17.1.0",
231
+ version: "22.3.0",
232
+ type: AvatarBackgroundImageDirective,
233
+ isStandalone: true,
234
+ selector: "[rxapAvatarBackgroundImage]",
235
+ inputs: {
236
+ imageUrl: {
237
+ classPropertyName: "imageUrl",
238
+ publicName: "rxapAvatarBackgroundImage",
239
+ isSignal: true,
240
+ isRequired: false,
241
+ transformFunction: null
242
+ },
243
+ size: {
244
+ classPropertyName: "size",
245
+ publicName: "size",
246
+ isSignal: true,
247
+ isRequired: false,
248
+ transformFunction: null
249
+ },
250
+ repeat: {
251
+ classPropertyName: "repeat",
252
+ publicName: "repeat",
253
+ isSignal: true,
254
+ isRequired: false,
255
+ transformFunction: null
256
+ },
257
+ position: {
258
+ classPropertyName: "position",
259
+ publicName: "position",
260
+ isSignal: true,
261
+ isRequired: false,
262
+ transformFunction: null
263
+ },
264
+ name: {
265
+ classPropertyName: "name",
266
+ publicName: "name",
267
+ isSignal: true,
268
+ isRequired: false,
269
+ transformFunction: null
270
+ }
271
+ },
272
+ usesInheritance: true,
273
+ ngImport: i0
274
+ });
275
+ }
276
+ };
277
+ i0.ɵɵngDeclareClassMetadata({
278
+ minVersion: "12.0.0",
279
+ version: "22.3.0",
280
+ ngImport: i0,
281
+ type: AvatarBackgroundImageDirective,
282
+ decorators: [{
283
+ type: Directive,
284
+ args: [{
285
+ selector: "[rxapAvatarBackgroundImage]",
286
+ standalone: true
287
+ }]
288
+ }],
289
+ propDecorators: {
290
+ imageUrl: [{
291
+ type: i0.Input,
292
+ args: [{
293
+ isSignal: true,
294
+ alias: "rxapAvatarBackgroundImage",
295
+ required: false
296
+ }]
297
+ }],
298
+ size: [{
299
+ type: i0.Input,
300
+ args: [{
301
+ isSignal: true,
302
+ alias: "size",
303
+ required: false
304
+ }]
305
+ }],
306
+ repeat: [{
307
+ type: i0.Input,
308
+ args: [{
309
+ isSignal: true,
310
+ alias: "repeat",
311
+ required: false
312
+ }]
313
+ }],
314
+ position: [{
315
+ type: i0.Input,
316
+ args: [{
317
+ isSignal: true,
318
+ alias: "position",
319
+ required: false
320
+ }]
321
+ }],
322
+ name: [{
323
+ type: i0.Input,
324
+ args: [{
325
+ isSignal: true,
326
+ alias: "name",
327
+ required: false
328
+ }]
329
+ }]
330
+ }
331
+ });
332
+ var ConfirmClick = class ConfirmClick {
333
+ constructor() {
334
+ this.hasConfirmDirective = input(false, {
335
+ ...ngDevMode ? { debugName: "hasConfirmDirective" } : /* istanbul ignore next */ {},
336
+ alias: "rxapConfirm",
337
+ transform: coerceBoolean
338
+ });
339
+ }
340
+ onClick() {
341
+ if (!this.hasConfirmDirective()) this.execute();
342
+ }
343
+ onConfirm() {
344
+ this.execute();
345
+ }
346
+ static {
347
+ this.ɵfac = i0.ɵɵngDeclareFactory({
348
+ minVersion: "12.0.0",
349
+ version: "22.3.0",
350
+ ngImport: i0,
351
+ type: ConfirmClick,
352
+ deps: [],
353
+ target: i0.ɵɵFactoryTarget.Directive
354
+ });
355
+ }
356
+ static {
357
+ this.ɵdir = i0.ɵɵngDeclareDirective({
358
+ minVersion: "17.1.0",
359
+ version: "22.3.0",
360
+ type: ConfirmClick,
361
+ isStandalone: true,
362
+ inputs: { hasConfirmDirective: {
363
+ classPropertyName: "hasConfirmDirective",
364
+ publicName: "rxapConfirm",
365
+ isSignal: true,
366
+ isRequired: false,
367
+ transformFunction: null
368
+ } },
369
+ host: { listeners: {
370
+ "click": "onClick()",
371
+ "confirmed": "onConfirm()"
372
+ } },
373
+ ngImport: i0
374
+ });
375
+ }
376
+ };
377
+ i0.ɵɵngDeclareClassMetadata({
378
+ minVersion: "12.0.0",
379
+ version: "22.3.0",
380
+ ngImport: i0,
381
+ type: ConfirmClick,
382
+ decorators: [{
383
+ type: Directive,
384
+ args: [{ host: {
385
+ "(click)": "onClick()",
386
+ "(confirmed)": "onConfirm()"
387
+ } }]
388
+ }],
389
+ propDecorators: { hasConfirmDirective: [{
390
+ type: i0.Input,
391
+ args: [{
392
+ isSignal: true,
393
+ alias: "rxapConfirm",
394
+ required: false
395
+ }]
396
+ }] }
397
+ });
398
+ var ContenteditableDirective = class ContenteditableDirective {
399
+ constructor() {
400
+ this.elementRef = inject(ElementRef);
401
+ this.method = input(void 0, {
402
+ ...ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {},
403
+ alias: "rxapContenteditable"
404
+ });
405
+ this.change = output({ alias: "rxapContenteditable" });
406
+ this.parameters = input(...ngDevMode ? [void 0, { debugName: "parameters" }] : /* istanbul ignore next */ []);
407
+ this.initialValue = input(void 0, {
408
+ ...ngDevMode ? { debugName: "initialValue" } : /* istanbul ignore next */ {},
409
+ alias: "initial"
410
+ });
411
+ this.initial = linkedSignal(() => this.initialValue(), ...ngDevMode ? [{ debugName: "initial" }] : /* istanbul ignore next */ []);
412
+ }
413
+ onClick($event) {
414
+ $event.stopPropagation();
415
+ }
416
+ async onInput($event) {
417
+ const value = $event.target.textContent?.trim();
418
+ if (value && value.length >= 2) {
419
+ const event = {
420
+ value,
421
+ parameters: this.parameters()
422
+ };
423
+ this.change.emit(event);
424
+ try {
425
+ const result = await this.method()?.call(event);
426
+ if (result && typeof result === "string") {
427
+ this.elementRef.nativeElement.innerText = result;
428
+ this.initial.set(result);
429
+ } else this.initial.set(value);
430
+ } catch {
431
+ const initial = this.initial();
432
+ if (initial) this.elementRef.nativeElement.innerText = initial;
433
+ }
434
+ }
435
+ }
436
+ static {
437
+ this.ɵfac = i0.ɵɵngDeclareFactory({
438
+ minVersion: "12.0.0",
439
+ version: "22.3.0",
440
+ ngImport: i0,
441
+ type: ContenteditableDirective,
442
+ deps: [],
443
+ target: i0.ɵɵFactoryTarget.Directive
444
+ });
445
+ }
446
+ static {
447
+ this.ɵdir = i0.ɵɵngDeclareDirective({
448
+ minVersion: "17.1.0",
449
+ version: "22.3.0",
450
+ type: ContenteditableDirective,
451
+ isStandalone: true,
452
+ selector: "[rxapContenteditable]",
453
+ inputs: {
454
+ method: {
455
+ classPropertyName: "method",
456
+ publicName: "rxapContenteditable",
457
+ isSignal: true,
458
+ isRequired: false,
459
+ transformFunction: null
460
+ },
461
+ parameters: {
462
+ classPropertyName: "parameters",
463
+ publicName: "parameters",
464
+ isSignal: true,
465
+ isRequired: false,
466
+ transformFunction: null
467
+ },
468
+ initialValue: {
469
+ classPropertyName: "initialValue",
470
+ publicName: "initial",
471
+ isSignal: true,
472
+ isRequired: false,
473
+ transformFunction: null
474
+ }
475
+ },
476
+ outputs: { change: "rxapContenteditable" },
477
+ host: {
478
+ listeners: {
479
+ "click": "onClick($event)",
480
+ "input": "onInput($event)"
481
+ },
482
+ properties: {
483
+ "attr.contenteditable": "true",
484
+ "attr.spellcheck": "false"
485
+ }
486
+ },
487
+ ngImport: i0
488
+ });
489
+ }
490
+ };
228
491
  __decorate([
229
- DebounceCall(1000),
230
- __metadata("design:type", Function),
231
- __metadata("design:paramtypes", [Object]),
232
- __metadata("design:returntype", Promise)
492
+ DebounceCall(1e3),
493
+ __metadata("design:type", Function),
494
+ __metadata("design:paramtypes", [Object]),
495
+ __metadata("design:returntype", Promise)
233
496
  ], ContenteditableDirective.prototype, "onInput", null);
234
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ContenteditableDirective, decorators: [{
235
- type: Directive,
236
- args: [{
237
- selector: '[rxapContenteditable]',
238
- standalone: true,
239
- host: {
240
- '[attr.contenteditable]': 'true',
241
- '[attr.spellcheck]': 'false',
242
- '(click)': 'onClick($event)',
243
- '(input)': 'onInput($event)',
244
- },
245
- }]
246
- }], propDecorators: { method: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapContenteditable", required: false }] }], change: [{ type: i0.Output, args: ["rxapContenteditable"] }], parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initial", required: false }] }], onInput: [] } });
247
-
248
- class FullWidthDirective {
249
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FullWidthDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
250
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FullWidthDirective, isStandalone: true, selector: "[rxapFullWidth]", host: { styleAttribute: "width: 100%" }, ngImport: i0 }); }
251
- }
252
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FullWidthDirective, decorators: [{
253
- type: Directive,
254
- args: [{
255
- selector: '[rxapFullWidth]',
256
- standalone: true,
257
- host: {
258
- style: 'width: 100%',
259
- },
260
- }]
261
- }] });
262
-
263
- // TODO : mv to rxap package
264
- class IfTruthyDirective {
265
- /**
266
- * Asserts the correct type of the context for the template that `NgForOf` will render.
267
- *
268
- * The presence of this method is a signal to the Ivy template type-check compiler that the
269
- * `NgForOf` structural directive renders its template with a specific context type.
270
- */
271
- static ngTemplateContextGuard(dir, ctx) {
272
- return true;
273
- }
274
- constructor() {
275
- this.templateRef = inject(TemplateRef);
276
- this.viewContainerRef = inject(ViewContainerRef);
277
- this.method = input.required({ ...(ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {}), alias: "rxapIfTruthy" });
278
- this.parameters = input.required({ ...(ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {}), alias: "rxapIfTruthyParameters" });
279
- this.trackBy = input(undefined, { ...(ngDevMode ? { debugName: "trackBy" } : /* istanbul ignore next */ {}), alias: "rxapIfTruthyTrackBy" });
280
- effect(() => {
281
- const method = this.method();
282
- const parameters = this.parameters();
283
- if (method && parameters) {
284
- untracked(() => this.execute());
285
- }
286
- });
287
- }
288
- async execute() {
289
- const result = await this.method().call(this.parameters());
290
- if (this.hasChanged(result)) {
291
- this.viewContainerRef.clear();
292
- if (result) {
293
- this.viewContainerRef.createEmbeddedView(this.templateRef, { $implicit: result }).markForCheck();
294
- }
295
- // remember the last applied result so unchanged values don't rebuild the view
296
- this._last = result;
297
- }
298
- }
299
- hasChanged(current) {
300
- if (this._last !== undefined) {
301
- const trackBy = this.trackBy();
302
- const currentTrackBy = trackBy ? trackBy(current) : current;
303
- const lastTrackBy = trackBy ? trackBy(this._last) : this._last;
304
- return currentTrackBy !== lastTrackBy;
305
- }
306
- return true;
307
- }
308
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IfTruthyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
309
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: IfTruthyDirective, isStandalone: true, selector: "[rxapIfTruthy]", inputs: { method: { classPropertyName: "method", publicName: "rxapIfTruthy", isSignal: true, isRequired: true, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "rxapIfTruthyParameters", isSignal: true, isRequired: true, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "rxapIfTruthyTrackBy", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
310
- }
311
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IfTruthyDirective, decorators: [{
312
- type: Directive,
313
- args: [{
314
- selector: '[rxapIfTruthy]',
315
- standalone: true,
316
- }]
317
- }], ctorParameters: () => [], propDecorators: { method: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapIfTruthy", required: true }] }], parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapIfTruthyParameters", required: true }] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapIfTruthyTrackBy", required: false }] }] } });
318
-
319
- class IsDevModeDirective {
320
- constructor() {
321
- this.template = inject(TemplateRef);
322
- this.vcr = inject(ViewContainerRef);
323
- }
324
- ngOnInit() {
325
- if (isDevMode()) {
326
- this.embeddedViewRef = this.vcr.createEmbeddedView(this.template);
327
- }
328
- }
329
- ngOnDestroy() {
330
- this.embeddedViewRef?.destroy();
331
- this.vcr.clear();
332
- }
333
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsDevModeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
334
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: IsDevModeDirective, isStandalone: true, selector: "[rxapIsDevMode]", ngImport: i0 }); }
335
- }
336
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsDevModeDirective, decorators: [{
337
- type: Directive,
338
- args: [{
339
- selector: '[rxapIsDevMode]',
340
- standalone: true,
341
- }]
342
- }] });
343
-
344
- class MethodTemplateDirective {
345
- static ngTemplateContextGuard(dir, ctx) {
346
- return true;
347
- }
348
- constructor() {
349
- this.template = inject(TemplateRef);
350
- this.viewContainerRef = inject(ViewContainerRef);
351
- this.method = input.required({ ...(ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {}), alias: "rxapMethodCall" });
352
- this.parameters = input(undefined, { ...(ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {}), alias: "rxapMethodParameters" });
353
- this.currentParameters = linkedSignal(() => this.parameters(), ...(ngDevMode ? [{ debugName: "currentParameters" }] : /* istanbul ignore next */ []));
354
- this.errorTemplate = input(undefined, { ...(ngDevMode ? { debugName: "errorTemplate" } : /* istanbul ignore next */ {}), alias: "rxapMethodError" });
355
- this.loadingTemplate = input(undefined, { ...(ngDevMode ? { debugName: "loadingTemplate" } : /* istanbul ignore next */ {}), alias: "rxapMethodLoading" });
356
- this.withoutParameters = input(false, { ...(ngDevMode ? { debugName: "withoutParameters" } : /* istanbul ignore next */ {}), alias: "rxapMethodWithoutParameters" });
357
- this.immediately = input(false, ...(ngDevMode ? [{ debugName: "immediately" }] : /* istanbul ignore next */ []));
358
- this.executed$ = output({ alias: 'executed' });
359
- this.failure$ = output({ alias: 'failure' });
360
- this.successful$ = output({ alias: 'successful' });
361
- /**
362
- * true - a remote method call is in progress
363
- */
364
- this.executing$ = new ToggleSubject();
365
- this.executing = outputFromObservable(this.executing$, { alias: 'executing' });
366
- this.embedded = output();
367
- // re-run whenever the bound parameters change
368
- effect(() => {
369
- const parameters = this.parameters();
370
- if (parameters !== undefined) {
371
- untracked(() => this.execute(parameters));
372
- }
373
- });
374
- }
375
- ngOnInit() {
376
- this.renderLoadingTemplate();
377
- if (this.withoutParameters()) {
378
- this.execute();
379
- }
380
- }
381
- onConfirmed() {
382
- return this.execute();
383
- }
384
- async execute(parameters = this.currentParameters()) {
385
- this.executing$.enable();
386
- try {
387
- const result = await this.method().call(parameters);
388
- this.executed(result);
389
- this.renderTemplate(result);
390
- this.successful(result);
391
- }
392
- catch (error) {
393
- if (isDevMode()) {
394
- console.error(`Method directive execution failed:`, error.message);
395
- }
396
- this.renderErrorTemplate(error);
397
- this.failure(error);
398
- }
399
- finally {
400
- this.executing$.disable();
401
- }
402
- }
403
- setParameter(parameterKey, value) {
404
- this.updateParameters({ [parameterKey]: value });
405
- }
406
- updateParameters(parameters) {
407
- this.currentParameters.set({ ...(this.currentParameters() ?? {}), ...parameters });
408
- }
409
- executed(result) {
410
- this.executed$.emit(result);
411
- }
412
- failure(error) {
413
- this.failure$.emit(error);
414
- }
415
- successful(result) {
416
- this.successful$.emit(result);
417
- }
418
- renderErrorTemplate(error) {
419
- const errorTemplate = this.errorTemplate();
420
- if (errorTemplate) {
421
- this.viewContainerRef.clear();
422
- if (errorTemplate) {
423
- this.viewContainerRef.createEmbeddedView(errorTemplate, {
424
- $implicit: error,
425
- message: error.message,
426
- });
427
- }
428
- }
429
- }
430
- renderTemplate(result) {
431
- this.viewContainerRef.clear();
432
- try {
433
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result }).markForCheck();
434
- }
435
- catch (error) {
436
- this.renderErrorTemplate(error);
437
- console.error(error.message);
438
- throw error;
439
- }
440
- this.embedded.emit();
441
- }
442
- renderLoadingTemplate() {
443
- const loadingTemplate = this.loadingTemplate();
444
- if (loadingTemplate) {
445
- this.viewContainerRef.clear();
446
- this.viewContainerRef.createEmbeddedView(loadingTemplate);
447
- }
448
- }
449
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
450
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: MethodTemplateDirective, isStandalone: true, selector: "[rxapMethod]", inputs: { method: { classPropertyName: "method", publicName: "rxapMethodCall", isSignal: true, isRequired: true, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "rxapMethodParameters", isSignal: true, isRequired: false, transformFunction: null }, errorTemplate: { classPropertyName: "errorTemplate", publicName: "rxapMethodError", isSignal: true, isRequired: false, transformFunction: null }, loadingTemplate: { classPropertyName: "loadingTemplate", publicName: "rxapMethodLoading", isSignal: true, isRequired: false, transformFunction: null }, withoutParameters: { classPropertyName: "withoutParameters", publicName: "rxapMethodWithoutParameters", isSignal: true, isRequired: false, transformFunction: null }, immediately: { classPropertyName: "immediately", publicName: "immediately", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { executed$: "executed", failure$: "failure", successful$: "successful", executing: "executing", embedded: "embedded" }, host: { listeners: { "confirmed": "onConfirmed()" } }, exportAs: ["rxapMethod"], ngImport: i0 }); }
451
- }
452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodTemplateDirective, decorators: [{
453
- type: Directive,
454
- args: [{
455
- selector: '[rxapMethod]',
456
- exportAs: 'rxapMethod',
457
- standalone: true,
458
- host: {
459
- '(confirmed)': 'onConfirmed()',
460
- },
461
- }]
462
- }], ctorParameters: () => [], propDecorators: { method: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapMethodCall", required: true }] }], parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapMethodParameters", required: false }] }], errorTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapMethodError", required: false }] }], loadingTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapMethodLoading", required: false }] }], withoutParameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapMethodWithoutParameters", required: false }] }], immediately: [{ type: i0.Input, args: [{ isSignal: true, alias: "immediately", required: false }] }], executed$: [{ type: i0.Output, args: ["executed"] }], failure$: [{ type: i0.Output, args: ["failure"] }], successful$: [{ type: i0.Output, args: ["successful"] }], executing: [{ type: i0.Output, args: ["executing"] }], embedded: [{ type: i0.Output, args: ["embedded"] }] } });
463
-
464
- class MethodDirective {
465
- constructor() {
466
- this.method = input.required({ ...(ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {}), alias: "rxapMethod" });
467
- this.parameters = input(...(ngDevMode ? [undefined, { debugName: "parameters" }] : /* istanbul ignore next */ []));
468
- this.currentParameters = linkedSignal(() => this.parameters(), ...(ngDevMode ? [{ debugName: "currentParameters" }] : /* istanbul ignore next */ []));
469
- this.immediately = input(false, ...(ngDevMode ? [{ debugName: "immediately" }] : /* istanbul ignore next */ []));
470
- this.executed$ = output({ alias: 'executed' });
471
- this.failure$ = output({ alias: 'failure' });
472
- this.successful$ = output({ alias: 'successful' });
473
- /**
474
- * true - a remote method call is in progress
475
- */
476
- this.executing$ = new ToggleSubject();
477
- this.hasConfirmDirective = input(false, { ...(ngDevMode ? { debugName: "hasConfirmDirective" } : /* istanbul ignore next */ {}), alias: 'rxapConfirm', transform: coerceBoolean });
478
- }
479
- ngOnInit() {
480
- if (this.immediately()) {
481
- this.execute();
482
- }
483
- }
484
- onConfirmed() {
485
- return this.execute();
486
- }
487
- onClick() {
488
- if (!this.hasConfirmDirective()) {
489
- return this.execute();
490
- }
491
- else {
492
- if (isDevMode()) {
493
- console.debug('Skip method call. Wait for confirmation.');
494
- }
495
- }
496
- return Promise.resolve();
497
- }
498
- async execute() {
499
- this.executing$.enable();
500
- try {
501
- const result = await this.method().call(this.currentParameters());
502
- this.executed(result);
503
- this.successful(result);
504
- }
505
- catch (error) {
506
- if (isDevMode()) {
507
- console.error(`Method directive execution failed:`, error.message);
508
- }
509
- this.failure(error);
510
- }
511
- finally {
512
- this.executing$.disable();
513
- }
514
- }
515
- setParameter(parameterKey, value) {
516
- this.updateParameters({ [parameterKey]: value });
517
- }
518
- updateParameters(parameters) {
519
- this.currentParameters.set({ ...(this.currentParameters() ?? {}), ...parameters });
520
- }
521
- executed(result) {
522
- this.executed$.emit(result);
523
- }
524
- failure(error) {
525
- this.failure$.emit(error);
526
- }
527
- successful(result) {
528
- this.successful$.emit(result);
529
- }
530
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
531
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: MethodDirective, isStandalone: true, selector: "[rxapMethod]", inputs: { method: { classPropertyName: "method", publicName: "rxapMethod", isSignal: true, isRequired: true, transformFunction: null }, parameters: { classPropertyName: "parameters", publicName: "parameters", isSignal: true, isRequired: false, transformFunction: null }, immediately: { classPropertyName: "immediately", publicName: "immediately", isSignal: true, isRequired: false, transformFunction: null }, hasConfirmDirective: { classPropertyName: "hasConfirmDirective", publicName: "rxapConfirm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { executed$: "executed", failure$: "failure", successful$: "successful" }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick()" } }, exportAs: ["rxapMethod"], ngImport: i0 }); }
532
- }
533
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodDirective, decorators: [{
534
- type: Directive,
535
- args: [{
536
- selector: '[rxapMethod]',
537
- exportAs: 'rxapMethod',
538
- standalone: true,
539
- host: {
540
- '(confirmed)': 'onConfirmed()',
541
- '(click)': 'onClick()',
542
- },
543
- }]
544
- }], propDecorators: { method: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapMethod", required: true }] }], parameters: [{ type: i0.Input, args: [{ isSignal: true, alias: "parameters", required: false }] }], immediately: [{ type: i0.Input, args: [{ isSignal: true, alias: "immediately", required: false }] }], executed$: [{ type: i0.Output, args: ["executed"] }], failure$: [{ type: i0.Output, args: ["failure"] }], successful$: [{ type: i0.Output, args: ["successful"] }], hasConfirmDirective: [{ type: i0.Input, args: [{ isSignal: true, alias: "rxapConfirm", required: false }] }] } });
545
-
546
- class MovableDividerDirective {
547
- constructor() {
548
- this.renderer = inject(Renderer2);
549
- this.containerElement = input.required(...(ngDevMode ? [{ debugName: "containerElement" }] : /* istanbul ignore next */ []));
550
- this.fixedElement = input.required(...(ngDevMode ? [{ debugName: "fixedElement" }] : /* istanbul ignore next */ []));
551
- this.origin = input('right', ...(ngDevMode ? [{ debugName: "origin" }] : /* istanbul ignore next */ []));
552
- /**
553
- * Indicates that the divider is moved with mouse down
554
- * @private
555
- */
556
- this._moveDivider = false;
557
- /**
558
- * Holds the current fixed element width.
559
- * If null the move divider feature was not yet used and the initial
560
- * fixed element width is not calculated
561
- * @private
562
- */
563
- this._fixedElementWidth = null;
564
- effect((onCleanup) => {
565
- const containerElement = this.containerElement();
566
- const subscription = new Subscription();
567
- onCleanup(() => subscription.unsubscribe());
568
- this.listen(containerElement, subscription);
569
- });
570
- }
571
- listen(containerElement, subscription) {
572
- subscription.add(fromEvent(containerElement, 'mousemove').pipe(tap(($event) => {
573
- if (this._moveDivider) {
574
- if (!this._fixedElementWidth) {
575
- this._fixedElementWidth = this.fixedElement().clientWidth;
576
- }
577
- const origin = this.origin();
578
- if (origin === 'right') {
579
- this._fixedElementWidth = $event.clientX - this.containerElement().getBoundingClientRect().left;
580
- }
581
- else if (origin === 'left') {
582
- const containerElementValue = this.containerElement();
583
- if (isDevMode()) {
584
- console.log({
585
- clientWidth: containerElementValue.clientWidth,
586
- clientX: $event.clientX,
587
- clientLeft: containerElementValue.getBoundingClientRect().left,
588
- });
589
- }
590
- this._fixedElementWidth =
591
- containerElementValue.clientWidth - $event.clientX + containerElementValue.getBoundingClientRect().left;
592
- }
593
- else {
594
- throw new Error(`The origin '${origin}' is not supported.`);
595
- }
596
- const width = this._fixedElementWidth + 'px';
597
- const fixedElement = this.fixedElement();
598
- this.renderer.setStyle(fixedElement, 'max-width', width);
599
- this.renderer.setStyle(fixedElement, 'min-width', width);
600
- this.renderer.setStyle(fixedElement, 'flex-basis', width);
601
- }
602
- })).subscribe());
603
- subscription.add(fromEvent(containerElement, 'mouseup').pipe(tap(() => this._moveDivider = false)).subscribe());
604
- }
605
- onMousedown() {
606
- this._moveDivider = true;
607
- }
608
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MovableDividerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
609
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: MovableDividerDirective, isStandalone: true, selector: "[rxapMovableDivider]", inputs: { containerElement: { classPropertyName: "containerElement", publicName: "containerElement", isSignal: true, isRequired: true, transformFunction: null }, fixedElement: { classPropertyName: "fixedElement", publicName: "fixedElement", isSignal: true, isRequired: true, transformFunction: null }, origin: { classPropertyName: "origin", publicName: "origin", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "onMousedown()" }, styleAttribute: "cursor: ew-resize" }, ngImport: i0 }); }
610
- }
611
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MovableDividerDirective, decorators: [{
612
- type: Directive,
613
- args: [{
614
- selector: '[rxapMovableDivider]',
615
- standalone: true,
616
- host: {
617
- style: 'cursor: ew-resize',
618
- '(mousedown)': 'onMousedown()',
619
- },
620
- }]
621
- }], ctorParameters: () => [], propDecorators: { containerElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "containerElement", required: true }] }], fixedElement: [{ type: i0.Input, args: [{ isSignal: true, alias: "fixedElement", required: true }] }], origin: [{ type: i0.Input, args: [{ isSignal: true, alias: "origin", required: false }] }] } });
622
-
623
- class PreventDefaultDirective {
624
- onClick($event) {
625
- $event.preventDefault();
626
- }
627
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
628
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: PreventDefaultDirective, isStandalone: true, selector: "[rxapPreventDefault]", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
629
- }
630
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: PreventDefaultDirective, decorators: [{
631
- type: Directive,
632
- args: [{
633
- selector: '[rxapPreventDefault]',
634
- standalone: true,
635
- host: {
636
- '(click)': 'onClick($event)',
637
- },
638
- }]
639
- }] });
640
-
641
- class ShareService {
642
- constructor() {
643
- this.isSupported = 'share' in navigator && 'canShare' in navigator && typeof navigator.canShare === 'function' && typeof navigator.share === 'function';
644
- }
645
- async share(data, softFail = true) {
646
- if (this.isSupported) {
647
- if (navigator.canShare(data)) {
648
- await navigator.share(data);
649
- }
650
- else {
651
- console.warn('Can not share data', data);
652
- throw new Error('Can not share data');
653
- }
654
- }
655
- else if (softFail) {
656
- console.warn(`Native share is not supported!`);
657
- }
658
- else {
659
- alert('Native share is not supported!');
660
- }
661
- }
662
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ShareService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
663
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ShareService, providedIn: 'root' }); }
664
- }
665
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ShareService, decorators: [{
666
- type: Injectable,
667
- args: [{ providedIn: 'root' }]
668
- }] });
669
- class ShareButtonDirective {
670
- constructor() {
671
- this.url = input(...(ngDevMode ? [undefined, { debugName: "url" }] : /* istanbul ignore next */ []));
672
- this.text = input(...(ngDevMode ? [undefined, { debugName: "text" }] : /* istanbul ignore next */ []));
673
- this.title = input(...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
674
- this.files = input(...(ngDevMode ? [undefined, { debugName: "files" }] : /* istanbul ignore next */ []));
675
- this.failed = output();
676
- this.success = output();
677
- this.shareService = inject(ShareService);
678
- }
679
- async share() {
680
- try {
681
- await this.shareService.share({
682
- url: this.url(),
683
- text: this.text(),
684
- files: this.files(),
685
- title: this.title(),
686
- });
687
- this.success.emit();
688
- }
689
- catch (err) {
690
- console.error(`share failed: ${err.message}`);
691
- this.failed.emit(err);
692
- }
693
- }
694
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ShareButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
695
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.9", type: ShareButtonDirective, isStandalone: true, selector: "[rxapShareButton],[rxapShare]", inputs: { url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, files: { classPropertyName: "files", publicName: "files", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { failed: "failed", success: "success" }, host: { listeners: { "click": "share()" } }, ngImport: i0 }); }
696
- }
697
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ShareButtonDirective, decorators: [{
698
- type: Directive,
699
- args: [{
700
- selector: '[rxapShareButton],[rxapShare]',
701
- standalone: true,
702
- host: {
703
- '(click)': 'share()',
704
- },
705
- }]
706
- }], propDecorators: { url: [{ type: i0.Input, args: [{ isSignal: true, alias: "url", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], files: [{ type: i0.Input, args: [{ isSignal: true, alias: "files", required: false }] }], failed: [{ type: i0.Output, args: ["failed"] }], success: [{ type: i0.Output, args: ["success"] }] } });
707
-
708
- class StopImmediatePropagationDirective {
709
- onClick($event) {
710
- $event.stopImmediatePropagation();
711
- }
712
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StopImmediatePropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
713
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: StopImmediatePropagationDirective, isStandalone: true, selector: "[rxapStopImmediatePropagation]", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
714
- }
715
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StopImmediatePropagationDirective, decorators: [{
716
- type: Directive,
717
- args: [{
718
- selector: '[rxapStopImmediatePropagation]',
719
- standalone: true,
720
- host: {
721
- '(click)': 'onClick($event)',
722
- },
723
- }]
724
- }] });
725
-
726
- class StopPropagationDirective {
727
- onClick($event) {
728
- $event.stopPropagation();
729
- }
730
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
731
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: StopPropagationDirective, isStandalone: true, selector: "[rxapStopPropagation]", host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 }); }
732
- }
733
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: StopPropagationDirective, decorators: [{
734
- type: Directive,
735
- args: [{
736
- selector: '[rxapStopPropagation]',
737
- standalone: true,
738
- host: {
739
- '(click)': 'onClick($event)',
740
- },
741
- }]
742
- }] });
743
-
744
- // region
745
- // endregion
746
-
747
- /**
748
- * Generated bundle index. Do not edit.
749
- */
750
-
497
+ i0.ɵɵngDeclareClassMetadata({
498
+ minVersion: "12.0.0",
499
+ version: "22.3.0",
500
+ ngImport: i0,
501
+ type: ContenteditableDirective,
502
+ decorators: [{
503
+ type: Directive,
504
+ args: [{
505
+ selector: "[rxapContenteditable]",
506
+ standalone: true,
507
+ host: {
508
+ "[attr.contenteditable]": "true",
509
+ "[attr.spellcheck]": "false",
510
+ "(click)": "onClick($event)",
511
+ "(input)": "onInput($event)"
512
+ }
513
+ }]
514
+ }],
515
+ propDecorators: {
516
+ method: [{
517
+ type: i0.Input,
518
+ args: [{
519
+ isSignal: true,
520
+ alias: "rxapContenteditable",
521
+ required: false
522
+ }]
523
+ }],
524
+ change: [{
525
+ type: i0.Output,
526
+ args: ["rxapContenteditable"]
527
+ }],
528
+ parameters: [{
529
+ type: i0.Input,
530
+ args: [{
531
+ isSignal: true,
532
+ alias: "parameters",
533
+ required: false
534
+ }]
535
+ }],
536
+ initialValue: [{
537
+ type: i0.Input,
538
+ args: [{
539
+ isSignal: true,
540
+ alias: "initial",
541
+ required: false
542
+ }]
543
+ }],
544
+ onInput: []
545
+ }
546
+ });
547
+ var FullWidthDirective = class FullWidthDirective {
548
+ static {
549
+ this.ɵfac = i0.ɵɵngDeclareFactory({
550
+ minVersion: "12.0.0",
551
+ version: "22.3.0",
552
+ ngImport: i0,
553
+ type: FullWidthDirective,
554
+ deps: [],
555
+ target: i0.ɵɵFactoryTarget.Directive
556
+ });
557
+ }
558
+ static {
559
+ this.ɵdir = i0.ɵɵngDeclareDirective({
560
+ minVersion: "14.0.0",
561
+ version: "22.3.0",
562
+ type: FullWidthDirective,
563
+ isStandalone: true,
564
+ selector: "[rxapFullWidth]",
565
+ host: { styleAttribute: "width: 100%" },
566
+ ngImport: i0
567
+ });
568
+ }
569
+ };
570
+ i0.ɵɵngDeclareClassMetadata({
571
+ minVersion: "12.0.0",
572
+ version: "22.3.0",
573
+ ngImport: i0,
574
+ type: FullWidthDirective,
575
+ decorators: [{
576
+ type: Directive,
577
+ args: [{
578
+ selector: "[rxapFullWidth]",
579
+ standalone: true,
580
+ host: { style: "width: 100%" }
581
+ }]
582
+ }]
583
+ });
584
+ var IfTruthyDirective = class IfTruthyDirective {
585
+ static ngTemplateContextGuard(dir, ctx) {
586
+ return true;
587
+ }
588
+ constructor() {
589
+ this.templateRef = inject(TemplateRef);
590
+ this.viewContainerRef = inject(ViewContainerRef);
591
+ this.method = input.required({
592
+ ...ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {},
593
+ alias: "rxapIfTruthy"
594
+ });
595
+ this.parameters = input.required({
596
+ ...ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {},
597
+ alias: "rxapIfTruthyParameters"
598
+ });
599
+ this.trackBy = input(void 0, {
600
+ ...ngDevMode ? { debugName: "trackBy" } : /* istanbul ignore next */ {},
601
+ alias: "rxapIfTruthyTrackBy"
602
+ });
603
+ effect(() => {
604
+ const method = this.method();
605
+ const parameters = this.parameters();
606
+ if (method && parameters) untracked(() => this.execute());
607
+ });
608
+ }
609
+ async execute() {
610
+ const result = await this.method().call(this.parameters());
611
+ if (this.hasChanged(result)) {
612
+ this.viewContainerRef.clear();
613
+ if (result) this.viewContainerRef.createEmbeddedView(this.templateRef, { $implicit: result }).markForCheck();
614
+ this._last = result;
615
+ }
616
+ }
617
+ hasChanged(current) {
618
+ if (this._last !== void 0) {
619
+ const trackBy = this.trackBy();
620
+ return (trackBy ? trackBy(current) : current) !== (trackBy ? trackBy(this._last) : this._last);
621
+ }
622
+ return true;
623
+ }
624
+ static {
625
+ this.ɵfac = i0.ɵɵngDeclareFactory({
626
+ minVersion: "12.0.0",
627
+ version: "22.3.0",
628
+ ngImport: i0,
629
+ type: IfTruthyDirective,
630
+ deps: [],
631
+ target: i0.ɵɵFactoryTarget.Directive
632
+ });
633
+ }
634
+ static {
635
+ this.ɵdir = i0.ɵɵngDeclareDirective({
636
+ minVersion: "17.1.0",
637
+ version: "22.3.0",
638
+ type: IfTruthyDirective,
639
+ isStandalone: true,
640
+ selector: "[rxapIfTruthy]",
641
+ inputs: {
642
+ method: {
643
+ classPropertyName: "method",
644
+ publicName: "rxapIfTruthy",
645
+ isSignal: true,
646
+ isRequired: true,
647
+ transformFunction: null
648
+ },
649
+ parameters: {
650
+ classPropertyName: "parameters",
651
+ publicName: "rxapIfTruthyParameters",
652
+ isSignal: true,
653
+ isRequired: true,
654
+ transformFunction: null
655
+ },
656
+ trackBy: {
657
+ classPropertyName: "trackBy",
658
+ publicName: "rxapIfTruthyTrackBy",
659
+ isSignal: true,
660
+ isRequired: false,
661
+ transformFunction: null
662
+ }
663
+ },
664
+ ngImport: i0
665
+ });
666
+ }
667
+ };
668
+ i0.ɵɵngDeclareClassMetadata({
669
+ minVersion: "12.0.0",
670
+ version: "22.3.0",
671
+ ngImport: i0,
672
+ type: IfTruthyDirective,
673
+ decorators: [{
674
+ type: Directive,
675
+ args: [{
676
+ selector: "[rxapIfTruthy]",
677
+ standalone: true
678
+ }]
679
+ }],
680
+ ctorParameters: () => [],
681
+ propDecorators: {
682
+ method: [{
683
+ type: i0.Input,
684
+ args: [{
685
+ isSignal: true,
686
+ alias: "rxapIfTruthy",
687
+ required: true
688
+ }]
689
+ }],
690
+ parameters: [{
691
+ type: i0.Input,
692
+ args: [{
693
+ isSignal: true,
694
+ alias: "rxapIfTruthyParameters",
695
+ required: true
696
+ }]
697
+ }],
698
+ trackBy: [{
699
+ type: i0.Input,
700
+ args: [{
701
+ isSignal: true,
702
+ alias: "rxapIfTruthyTrackBy",
703
+ required: false
704
+ }]
705
+ }]
706
+ }
707
+ });
708
+ var IsDevModeDirective = class IsDevModeDirective {
709
+ constructor() {
710
+ this.template = inject(TemplateRef);
711
+ this.vcr = inject(ViewContainerRef);
712
+ }
713
+ ngOnInit() {
714
+ if (isDevMode()) this.embeddedViewRef = this.vcr.createEmbeddedView(this.template);
715
+ }
716
+ ngOnDestroy() {
717
+ this.embeddedViewRef?.destroy();
718
+ this.vcr.clear();
719
+ }
720
+ static {
721
+ this.ɵfac = i0.ɵɵngDeclareFactory({
722
+ minVersion: "12.0.0",
723
+ version: "22.3.0",
724
+ ngImport: i0,
725
+ type: IsDevModeDirective,
726
+ deps: [],
727
+ target: i0.ɵɵFactoryTarget.Directive
728
+ });
729
+ }
730
+ static {
731
+ this.ɵdir = i0.ɵɵngDeclareDirective({
732
+ minVersion: "14.0.0",
733
+ version: "22.3.0",
734
+ type: IsDevModeDirective,
735
+ isStandalone: true,
736
+ selector: "[rxapIsDevMode]",
737
+ ngImport: i0
738
+ });
739
+ }
740
+ };
741
+ i0.ɵɵngDeclareClassMetadata({
742
+ minVersion: "12.0.0",
743
+ version: "22.3.0",
744
+ ngImport: i0,
745
+ type: IsDevModeDirective,
746
+ decorators: [{
747
+ type: Directive,
748
+ args: [{
749
+ selector: "[rxapIsDevMode]",
750
+ standalone: true
751
+ }]
752
+ }]
753
+ });
754
+ var MethodTemplateDirective = class MethodTemplateDirective {
755
+ static ngTemplateContextGuard(dir, ctx) {
756
+ return true;
757
+ }
758
+ constructor() {
759
+ this.template = inject(TemplateRef);
760
+ this.viewContainerRef = inject(ViewContainerRef);
761
+ this.method = input.required({
762
+ ...ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {},
763
+ alias: "rxapMethodCall"
764
+ });
765
+ this.parameters = input(void 0, {
766
+ ...ngDevMode ? { debugName: "parameters" } : /* istanbul ignore next */ {},
767
+ alias: "rxapMethodParameters"
768
+ });
769
+ this.currentParameters = linkedSignal(() => this.parameters(), ...ngDevMode ? [{ debugName: "currentParameters" }] : /* istanbul ignore next */ []);
770
+ this.errorTemplate = input(void 0, {
771
+ ...ngDevMode ? { debugName: "errorTemplate" } : /* istanbul ignore next */ {},
772
+ alias: "rxapMethodError"
773
+ });
774
+ this.loadingTemplate = input(void 0, {
775
+ ...ngDevMode ? { debugName: "loadingTemplate" } : /* istanbul ignore next */ {},
776
+ alias: "rxapMethodLoading"
777
+ });
778
+ this.withoutParameters = input(false, {
779
+ ...ngDevMode ? { debugName: "withoutParameters" } : /* istanbul ignore next */ {},
780
+ alias: "rxapMethodWithoutParameters"
781
+ });
782
+ this.immediately = input(false, ...ngDevMode ? [{ debugName: "immediately" }] : /* istanbul ignore next */ []);
783
+ this.executed$ = output({ alias: "executed" });
784
+ this.failure$ = output({ alias: "failure" });
785
+ this.successful$ = output({ alias: "successful" });
786
+ this.executing$ = new ToggleSubject();
787
+ this.executing = outputFromObservable(this.executing$, { alias: "executing" });
788
+ this.embedded = output();
789
+ effect(() => {
790
+ const parameters = this.parameters();
791
+ if (parameters !== void 0) untracked(() => this.execute(parameters));
792
+ });
793
+ }
794
+ ngOnInit() {
795
+ this.renderLoadingTemplate();
796
+ if (this.withoutParameters()) this.execute();
797
+ }
798
+ onConfirmed() {
799
+ return this.execute();
800
+ }
801
+ async execute(parameters = this.currentParameters()) {
802
+ this.executing$.enable();
803
+ try {
804
+ const result = await this.method().call(parameters);
805
+ this.executed(result);
806
+ this.renderTemplate(result);
807
+ this.successful(result);
808
+ } catch (error) {
809
+ if (isDevMode()) console.error(`Method directive execution failed:`, error.message);
810
+ this.renderErrorTemplate(error);
811
+ this.failure(error);
812
+ } finally {
813
+ this.executing$.disable();
814
+ }
815
+ }
816
+ setParameter(parameterKey, value) {
817
+ this.updateParameters({ [parameterKey]: value });
818
+ }
819
+ updateParameters(parameters) {
820
+ this.currentParameters.set({
821
+ ...this.currentParameters() ?? {},
822
+ ...parameters
823
+ });
824
+ }
825
+ executed(result) {
826
+ this.executed$.emit(result);
827
+ }
828
+ failure(error) {
829
+ this.failure$.emit(error);
830
+ }
831
+ successful(result) {
832
+ this.successful$.emit(result);
833
+ }
834
+ renderErrorTemplate(error) {
835
+ const errorTemplate = this.errorTemplate();
836
+ if (errorTemplate) {
837
+ this.viewContainerRef.clear();
838
+ if (errorTemplate) this.viewContainerRef.createEmbeddedView(errorTemplate, {
839
+ $implicit: error,
840
+ message: error.message
841
+ });
842
+ }
843
+ }
844
+ renderTemplate(result) {
845
+ this.viewContainerRef.clear();
846
+ try {
847
+ this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result }).markForCheck();
848
+ } catch (error) {
849
+ this.renderErrorTemplate(error);
850
+ console.error(error.message);
851
+ throw error;
852
+ }
853
+ this.embedded.emit();
854
+ }
855
+ renderLoadingTemplate() {
856
+ const loadingTemplate = this.loadingTemplate();
857
+ if (loadingTemplate) {
858
+ this.viewContainerRef.clear();
859
+ this.viewContainerRef.createEmbeddedView(loadingTemplate);
860
+ }
861
+ }
862
+ static {
863
+ this.ɵfac = i0.ɵɵngDeclareFactory({
864
+ minVersion: "12.0.0",
865
+ version: "22.3.0",
866
+ ngImport: i0,
867
+ type: MethodTemplateDirective,
868
+ deps: [],
869
+ target: i0.ɵɵFactoryTarget.Directive
870
+ });
871
+ }
872
+ static {
873
+ this.ɵdir = i0.ɵɵngDeclareDirective({
874
+ minVersion: "17.1.0",
875
+ version: "22.3.0",
876
+ type: MethodTemplateDirective,
877
+ isStandalone: true,
878
+ selector: "[rxapMethod]",
879
+ inputs: {
880
+ method: {
881
+ classPropertyName: "method",
882
+ publicName: "rxapMethodCall",
883
+ isSignal: true,
884
+ isRequired: true,
885
+ transformFunction: null
886
+ },
887
+ parameters: {
888
+ classPropertyName: "parameters",
889
+ publicName: "rxapMethodParameters",
890
+ isSignal: true,
891
+ isRequired: false,
892
+ transformFunction: null
893
+ },
894
+ errorTemplate: {
895
+ classPropertyName: "errorTemplate",
896
+ publicName: "rxapMethodError",
897
+ isSignal: true,
898
+ isRequired: false,
899
+ transformFunction: null
900
+ },
901
+ loadingTemplate: {
902
+ classPropertyName: "loadingTemplate",
903
+ publicName: "rxapMethodLoading",
904
+ isSignal: true,
905
+ isRequired: false,
906
+ transformFunction: null
907
+ },
908
+ withoutParameters: {
909
+ classPropertyName: "withoutParameters",
910
+ publicName: "rxapMethodWithoutParameters",
911
+ isSignal: true,
912
+ isRequired: false,
913
+ transformFunction: null
914
+ },
915
+ immediately: {
916
+ classPropertyName: "immediately",
917
+ publicName: "immediately",
918
+ isSignal: true,
919
+ isRequired: false,
920
+ transformFunction: null
921
+ }
922
+ },
923
+ outputs: {
924
+ executed$: "executed",
925
+ failure$: "failure",
926
+ successful$: "successful",
927
+ executing: "executing",
928
+ embedded: "embedded"
929
+ },
930
+ host: { listeners: { "confirmed": "onConfirmed()" } },
931
+ exportAs: ["rxapMethod"],
932
+ ngImport: i0
933
+ });
934
+ }
935
+ };
936
+ i0.ɵɵngDeclareClassMetadata({
937
+ minVersion: "12.0.0",
938
+ version: "22.3.0",
939
+ ngImport: i0,
940
+ type: MethodTemplateDirective,
941
+ decorators: [{
942
+ type: Directive,
943
+ args: [{
944
+ selector: "[rxapMethod]",
945
+ exportAs: "rxapMethod",
946
+ standalone: true,
947
+ host: { "(confirmed)": "onConfirmed()" }
948
+ }]
949
+ }],
950
+ ctorParameters: () => [],
951
+ propDecorators: {
952
+ method: [{
953
+ type: i0.Input,
954
+ args: [{
955
+ isSignal: true,
956
+ alias: "rxapMethodCall",
957
+ required: true
958
+ }]
959
+ }],
960
+ parameters: [{
961
+ type: i0.Input,
962
+ args: [{
963
+ isSignal: true,
964
+ alias: "rxapMethodParameters",
965
+ required: false
966
+ }]
967
+ }],
968
+ errorTemplate: [{
969
+ type: i0.Input,
970
+ args: [{
971
+ isSignal: true,
972
+ alias: "rxapMethodError",
973
+ required: false
974
+ }]
975
+ }],
976
+ loadingTemplate: [{
977
+ type: i0.Input,
978
+ args: [{
979
+ isSignal: true,
980
+ alias: "rxapMethodLoading",
981
+ required: false
982
+ }]
983
+ }],
984
+ withoutParameters: [{
985
+ type: i0.Input,
986
+ args: [{
987
+ isSignal: true,
988
+ alias: "rxapMethodWithoutParameters",
989
+ required: false
990
+ }]
991
+ }],
992
+ immediately: [{
993
+ type: i0.Input,
994
+ args: [{
995
+ isSignal: true,
996
+ alias: "immediately",
997
+ required: false
998
+ }]
999
+ }],
1000
+ executed$: [{
1001
+ type: i0.Output,
1002
+ args: ["executed"]
1003
+ }],
1004
+ failure$: [{
1005
+ type: i0.Output,
1006
+ args: ["failure"]
1007
+ }],
1008
+ successful$: [{
1009
+ type: i0.Output,
1010
+ args: ["successful"]
1011
+ }],
1012
+ executing: [{
1013
+ type: i0.Output,
1014
+ args: ["executing"]
1015
+ }],
1016
+ embedded: [{
1017
+ type: i0.Output,
1018
+ args: ["embedded"]
1019
+ }]
1020
+ }
1021
+ });
1022
+ var MethodDirective = class MethodDirective {
1023
+ constructor() {
1024
+ this.method = input.required({
1025
+ ...ngDevMode ? { debugName: "method" } : /* istanbul ignore next */ {},
1026
+ alias: "rxapMethod"
1027
+ });
1028
+ this.parameters = input(...ngDevMode ? [void 0, { debugName: "parameters" }] : /* istanbul ignore next */ []);
1029
+ this.currentParameters = linkedSignal(() => this.parameters(), ...ngDevMode ? [{ debugName: "currentParameters" }] : /* istanbul ignore next */ []);
1030
+ this.immediately = input(false, ...ngDevMode ? [{ debugName: "immediately" }] : /* istanbul ignore next */ []);
1031
+ this.executed$ = output({ alias: "executed" });
1032
+ this.failure$ = output({ alias: "failure" });
1033
+ this.successful$ = output({ alias: "successful" });
1034
+ this.executing$ = new ToggleSubject();
1035
+ this.hasConfirmDirective = input(false, {
1036
+ ...ngDevMode ? { debugName: "hasConfirmDirective" } : /* istanbul ignore next */ {},
1037
+ alias: "rxapConfirm",
1038
+ transform: coerceBoolean
1039
+ });
1040
+ }
1041
+ ngOnInit() {
1042
+ if (this.immediately()) this.execute();
1043
+ }
1044
+ onConfirmed() {
1045
+ return this.execute();
1046
+ }
1047
+ onClick() {
1048
+ if (!this.hasConfirmDirective()) return this.execute();
1049
+ else if (isDevMode()) console.debug("Skip method call. Wait for confirmation.");
1050
+ return Promise.resolve();
1051
+ }
1052
+ async execute() {
1053
+ this.executing$.enable();
1054
+ try {
1055
+ const result = await this.method().call(this.currentParameters());
1056
+ this.executed(result);
1057
+ this.successful(result);
1058
+ } catch (error) {
1059
+ if (isDevMode()) console.error(`Method directive execution failed:`, error.message);
1060
+ this.failure(error);
1061
+ } finally {
1062
+ this.executing$.disable();
1063
+ }
1064
+ }
1065
+ setParameter(parameterKey, value) {
1066
+ this.updateParameters({ [parameterKey]: value });
1067
+ }
1068
+ updateParameters(parameters) {
1069
+ this.currentParameters.set({
1070
+ ...this.currentParameters() ?? {},
1071
+ ...parameters
1072
+ });
1073
+ }
1074
+ executed(result) {
1075
+ this.executed$.emit(result);
1076
+ }
1077
+ failure(error) {
1078
+ this.failure$.emit(error);
1079
+ }
1080
+ successful(result) {
1081
+ this.successful$.emit(result);
1082
+ }
1083
+ static {
1084
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1085
+ minVersion: "12.0.0",
1086
+ version: "22.3.0",
1087
+ ngImport: i0,
1088
+ type: MethodDirective,
1089
+ deps: [],
1090
+ target: i0.ɵɵFactoryTarget.Directive
1091
+ });
1092
+ }
1093
+ static {
1094
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1095
+ minVersion: "17.1.0",
1096
+ version: "22.3.0",
1097
+ type: MethodDirective,
1098
+ isStandalone: true,
1099
+ selector: "[rxapMethod]",
1100
+ inputs: {
1101
+ method: {
1102
+ classPropertyName: "method",
1103
+ publicName: "rxapMethod",
1104
+ isSignal: true,
1105
+ isRequired: true,
1106
+ transformFunction: null
1107
+ },
1108
+ parameters: {
1109
+ classPropertyName: "parameters",
1110
+ publicName: "parameters",
1111
+ isSignal: true,
1112
+ isRequired: false,
1113
+ transformFunction: null
1114
+ },
1115
+ immediately: {
1116
+ classPropertyName: "immediately",
1117
+ publicName: "immediately",
1118
+ isSignal: true,
1119
+ isRequired: false,
1120
+ transformFunction: null
1121
+ },
1122
+ hasConfirmDirective: {
1123
+ classPropertyName: "hasConfirmDirective",
1124
+ publicName: "rxapConfirm",
1125
+ isSignal: true,
1126
+ isRequired: false,
1127
+ transformFunction: null
1128
+ }
1129
+ },
1130
+ outputs: {
1131
+ executed$: "executed",
1132
+ failure$: "failure",
1133
+ successful$: "successful"
1134
+ },
1135
+ host: { listeners: {
1136
+ "confirmed": "onConfirmed()",
1137
+ "click": "onClick()"
1138
+ } },
1139
+ exportAs: ["rxapMethod"],
1140
+ ngImport: i0
1141
+ });
1142
+ }
1143
+ };
1144
+ i0.ɵɵngDeclareClassMetadata({
1145
+ minVersion: "12.0.0",
1146
+ version: "22.3.0",
1147
+ ngImport: i0,
1148
+ type: MethodDirective,
1149
+ decorators: [{
1150
+ type: Directive,
1151
+ args: [{
1152
+ selector: "[rxapMethod]",
1153
+ exportAs: "rxapMethod",
1154
+ standalone: true,
1155
+ host: {
1156
+ "(confirmed)": "onConfirmed()",
1157
+ "(click)": "onClick()"
1158
+ }
1159
+ }]
1160
+ }],
1161
+ propDecorators: {
1162
+ method: [{
1163
+ type: i0.Input,
1164
+ args: [{
1165
+ isSignal: true,
1166
+ alias: "rxapMethod",
1167
+ required: true
1168
+ }]
1169
+ }],
1170
+ parameters: [{
1171
+ type: i0.Input,
1172
+ args: [{
1173
+ isSignal: true,
1174
+ alias: "parameters",
1175
+ required: false
1176
+ }]
1177
+ }],
1178
+ immediately: [{
1179
+ type: i0.Input,
1180
+ args: [{
1181
+ isSignal: true,
1182
+ alias: "immediately",
1183
+ required: false
1184
+ }]
1185
+ }],
1186
+ executed$: [{
1187
+ type: i0.Output,
1188
+ args: ["executed"]
1189
+ }],
1190
+ failure$: [{
1191
+ type: i0.Output,
1192
+ args: ["failure"]
1193
+ }],
1194
+ successful$: [{
1195
+ type: i0.Output,
1196
+ args: ["successful"]
1197
+ }],
1198
+ hasConfirmDirective: [{
1199
+ type: i0.Input,
1200
+ args: [{
1201
+ isSignal: true,
1202
+ alias: "rxapConfirm",
1203
+ required: false
1204
+ }]
1205
+ }]
1206
+ }
1207
+ });
1208
+ var MovableDividerDirective = class MovableDividerDirective {
1209
+ constructor() {
1210
+ this.renderer = inject(Renderer2);
1211
+ this.containerElement = input.required(...ngDevMode ? [{ debugName: "containerElement" }] : /* istanbul ignore next */ []);
1212
+ this.fixedElement = input.required(...ngDevMode ? [{ debugName: "fixedElement" }] : /* istanbul ignore next */ []);
1213
+ this.origin = input("right", ...ngDevMode ? [{ debugName: "origin" }] : /* istanbul ignore next */ []);
1214
+ this._moveDivider = false;
1215
+ this._fixedElementWidth = null;
1216
+ effect((onCleanup) => {
1217
+ const containerElement = this.containerElement();
1218
+ const subscription = new Subscription();
1219
+ onCleanup(() => subscription.unsubscribe());
1220
+ this.listen(containerElement, subscription);
1221
+ });
1222
+ }
1223
+ listen(containerElement, subscription) {
1224
+ subscription.add(fromEvent(containerElement, "mousemove").pipe(tap(($event) => {
1225
+ if (this._moveDivider) {
1226
+ if (!this._fixedElementWidth) this._fixedElementWidth = this.fixedElement().clientWidth;
1227
+ const origin = this.origin();
1228
+ if (origin === "right") this._fixedElementWidth = $event.clientX - this.containerElement().getBoundingClientRect().left;
1229
+ else if (origin === "left") {
1230
+ const containerElementValue = this.containerElement();
1231
+ if (isDevMode()) console.log({
1232
+ clientWidth: containerElementValue.clientWidth,
1233
+ clientX: $event.clientX,
1234
+ clientLeft: containerElementValue.getBoundingClientRect().left
1235
+ });
1236
+ this._fixedElementWidth = containerElementValue.clientWidth - $event.clientX + containerElementValue.getBoundingClientRect().left;
1237
+ } else throw new Error(`The origin '${origin}' is not supported.`);
1238
+ const width = this._fixedElementWidth + "px";
1239
+ const fixedElement = this.fixedElement();
1240
+ this.renderer.setStyle(fixedElement, "max-width", width);
1241
+ this.renderer.setStyle(fixedElement, "min-width", width);
1242
+ this.renderer.setStyle(fixedElement, "flex-basis", width);
1243
+ }
1244
+ })).subscribe());
1245
+ subscription.add(fromEvent(containerElement, "mouseup").pipe(tap(() => this._moveDivider = false)).subscribe());
1246
+ }
1247
+ onMousedown() {
1248
+ this._moveDivider = true;
1249
+ }
1250
+ static {
1251
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1252
+ minVersion: "12.0.0",
1253
+ version: "22.3.0",
1254
+ ngImport: i0,
1255
+ type: MovableDividerDirective,
1256
+ deps: [],
1257
+ target: i0.ɵɵFactoryTarget.Directive
1258
+ });
1259
+ }
1260
+ static {
1261
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1262
+ minVersion: "17.1.0",
1263
+ version: "22.3.0",
1264
+ type: MovableDividerDirective,
1265
+ isStandalone: true,
1266
+ selector: "[rxapMovableDivider]",
1267
+ inputs: {
1268
+ containerElement: {
1269
+ classPropertyName: "containerElement",
1270
+ publicName: "containerElement",
1271
+ isSignal: true,
1272
+ isRequired: true,
1273
+ transformFunction: null
1274
+ },
1275
+ fixedElement: {
1276
+ classPropertyName: "fixedElement",
1277
+ publicName: "fixedElement",
1278
+ isSignal: true,
1279
+ isRequired: true,
1280
+ transformFunction: null
1281
+ },
1282
+ origin: {
1283
+ classPropertyName: "origin",
1284
+ publicName: "origin",
1285
+ isSignal: true,
1286
+ isRequired: false,
1287
+ transformFunction: null
1288
+ }
1289
+ },
1290
+ host: {
1291
+ listeners: { "mousedown": "onMousedown()" },
1292
+ styleAttribute: "cursor: ew-resize"
1293
+ },
1294
+ ngImport: i0
1295
+ });
1296
+ }
1297
+ };
1298
+ i0.ɵɵngDeclareClassMetadata({
1299
+ minVersion: "12.0.0",
1300
+ version: "22.3.0",
1301
+ ngImport: i0,
1302
+ type: MovableDividerDirective,
1303
+ decorators: [{
1304
+ type: Directive,
1305
+ args: [{
1306
+ selector: "[rxapMovableDivider]",
1307
+ standalone: true,
1308
+ host: {
1309
+ style: "cursor: ew-resize",
1310
+ "(mousedown)": "onMousedown()"
1311
+ }
1312
+ }]
1313
+ }],
1314
+ ctorParameters: () => [],
1315
+ propDecorators: {
1316
+ containerElement: [{
1317
+ type: i0.Input,
1318
+ args: [{
1319
+ isSignal: true,
1320
+ alias: "containerElement",
1321
+ required: true
1322
+ }]
1323
+ }],
1324
+ fixedElement: [{
1325
+ type: i0.Input,
1326
+ args: [{
1327
+ isSignal: true,
1328
+ alias: "fixedElement",
1329
+ required: true
1330
+ }]
1331
+ }],
1332
+ origin: [{
1333
+ type: i0.Input,
1334
+ args: [{
1335
+ isSignal: true,
1336
+ alias: "origin",
1337
+ required: false
1338
+ }]
1339
+ }]
1340
+ }
1341
+ });
1342
+ var PreventDefaultDirective = class PreventDefaultDirective {
1343
+ onClick($event) {
1344
+ $event.preventDefault();
1345
+ }
1346
+ static {
1347
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1348
+ minVersion: "12.0.0",
1349
+ version: "22.3.0",
1350
+ ngImport: i0,
1351
+ type: PreventDefaultDirective,
1352
+ deps: [],
1353
+ target: i0.ɵɵFactoryTarget.Directive
1354
+ });
1355
+ }
1356
+ static {
1357
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1358
+ minVersion: "14.0.0",
1359
+ version: "22.3.0",
1360
+ type: PreventDefaultDirective,
1361
+ isStandalone: true,
1362
+ selector: "[rxapPreventDefault]",
1363
+ host: { listeners: { "click": "onClick($event)" } },
1364
+ ngImport: i0
1365
+ });
1366
+ }
1367
+ };
1368
+ i0.ɵɵngDeclareClassMetadata({
1369
+ minVersion: "12.0.0",
1370
+ version: "22.3.0",
1371
+ ngImport: i0,
1372
+ type: PreventDefaultDirective,
1373
+ decorators: [{
1374
+ type: Directive,
1375
+ args: [{
1376
+ selector: "[rxapPreventDefault]",
1377
+ standalone: true,
1378
+ host: { "(click)": "onClick($event)" }
1379
+ }]
1380
+ }]
1381
+ });
1382
+ var ShareService = class ShareService {
1383
+ constructor() {
1384
+ this.isSupported = "share" in navigator && "canShare" in navigator && typeof navigator.canShare === "function" && typeof navigator.share === "function";
1385
+ }
1386
+ async share(data, softFail = true) {
1387
+ if (this.isSupported) {
1388
+ if (navigator.canShare(data)) await navigator.share(data);
1389
+ else {
1390
+ console.warn("Can not share data", data);
1391
+ throw new Error("Can not share data");
1392
+ }
1393
+ } else if (softFail) console.warn(`Native share is not supported!`);
1394
+ else alert("Native share is not supported!");
1395
+ }
1396
+ static {
1397
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1398
+ minVersion: "12.0.0",
1399
+ version: "22.3.0",
1400
+ ngImport: i0,
1401
+ type: ShareService,
1402
+ deps: [],
1403
+ target: i0.ɵɵFactoryTarget.Injectable
1404
+ });
1405
+ }
1406
+ static {
1407
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
1408
+ minVersion: "12.0.0",
1409
+ version: "22.3.0",
1410
+ ngImport: i0,
1411
+ type: ShareService,
1412
+ providedIn: "root"
1413
+ });
1414
+ }
1415
+ };
1416
+ i0.ɵɵngDeclareClassMetadata({
1417
+ minVersion: "12.0.0",
1418
+ version: "22.3.0",
1419
+ ngImport: i0,
1420
+ type: ShareService,
1421
+ decorators: [{
1422
+ type: Injectable,
1423
+ args: [{ providedIn: "root" }]
1424
+ }]
1425
+ });
1426
+ var ShareButtonDirective = class ShareButtonDirective {
1427
+ constructor() {
1428
+ this.url = input(...ngDevMode ? [void 0, { debugName: "url" }] : /* istanbul ignore next */ []);
1429
+ this.text = input(...ngDevMode ? [void 0, { debugName: "text" }] : /* istanbul ignore next */ []);
1430
+ this.title = input(...ngDevMode ? [void 0, { debugName: "title" }] : /* istanbul ignore next */ []);
1431
+ this.files = input(...ngDevMode ? [void 0, { debugName: "files" }] : /* istanbul ignore next */ []);
1432
+ this.failed = output();
1433
+ this.success = output();
1434
+ this.shareService = inject(ShareService);
1435
+ }
1436
+ async share() {
1437
+ try {
1438
+ await this.shareService.share({
1439
+ url: this.url(),
1440
+ text: this.text(),
1441
+ files: this.files(),
1442
+ title: this.title()
1443
+ });
1444
+ this.success.emit();
1445
+ } catch (err) {
1446
+ console.error(`share failed: ${err.message}`);
1447
+ this.failed.emit(err);
1448
+ }
1449
+ }
1450
+ static {
1451
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1452
+ minVersion: "12.0.0",
1453
+ version: "22.3.0",
1454
+ ngImport: i0,
1455
+ type: ShareButtonDirective,
1456
+ deps: [],
1457
+ target: i0.ɵɵFactoryTarget.Directive
1458
+ });
1459
+ }
1460
+ static {
1461
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1462
+ minVersion: "17.1.0",
1463
+ version: "22.3.0",
1464
+ type: ShareButtonDirective,
1465
+ isStandalone: true,
1466
+ selector: "[rxapShareButton],[rxapShare]",
1467
+ inputs: {
1468
+ url: {
1469
+ classPropertyName: "url",
1470
+ publicName: "url",
1471
+ isSignal: true,
1472
+ isRequired: false,
1473
+ transformFunction: null
1474
+ },
1475
+ text: {
1476
+ classPropertyName: "text",
1477
+ publicName: "text",
1478
+ isSignal: true,
1479
+ isRequired: false,
1480
+ transformFunction: null
1481
+ },
1482
+ title: {
1483
+ classPropertyName: "title",
1484
+ publicName: "title",
1485
+ isSignal: true,
1486
+ isRequired: false,
1487
+ transformFunction: null
1488
+ },
1489
+ files: {
1490
+ classPropertyName: "files",
1491
+ publicName: "files",
1492
+ isSignal: true,
1493
+ isRequired: false,
1494
+ transformFunction: null
1495
+ }
1496
+ },
1497
+ outputs: {
1498
+ failed: "failed",
1499
+ success: "success"
1500
+ },
1501
+ host: { listeners: { "click": "share()" } },
1502
+ ngImport: i0
1503
+ });
1504
+ }
1505
+ };
1506
+ i0.ɵɵngDeclareClassMetadata({
1507
+ minVersion: "12.0.0",
1508
+ version: "22.3.0",
1509
+ ngImport: i0,
1510
+ type: ShareButtonDirective,
1511
+ decorators: [{
1512
+ type: Directive,
1513
+ args: [{
1514
+ selector: "[rxapShareButton],[rxapShare]",
1515
+ standalone: true,
1516
+ host: { "(click)": "share()" }
1517
+ }]
1518
+ }],
1519
+ propDecorators: {
1520
+ url: [{
1521
+ type: i0.Input,
1522
+ args: [{
1523
+ isSignal: true,
1524
+ alias: "url",
1525
+ required: false
1526
+ }]
1527
+ }],
1528
+ text: [{
1529
+ type: i0.Input,
1530
+ args: [{
1531
+ isSignal: true,
1532
+ alias: "text",
1533
+ required: false
1534
+ }]
1535
+ }],
1536
+ title: [{
1537
+ type: i0.Input,
1538
+ args: [{
1539
+ isSignal: true,
1540
+ alias: "title",
1541
+ required: false
1542
+ }]
1543
+ }],
1544
+ files: [{
1545
+ type: i0.Input,
1546
+ args: [{
1547
+ isSignal: true,
1548
+ alias: "files",
1549
+ required: false
1550
+ }]
1551
+ }],
1552
+ failed: [{
1553
+ type: i0.Output,
1554
+ args: ["failed"]
1555
+ }],
1556
+ success: [{
1557
+ type: i0.Output,
1558
+ args: ["success"]
1559
+ }]
1560
+ }
1561
+ });
1562
+ var StopImmediatePropagationDirective = class StopImmediatePropagationDirective {
1563
+ onClick($event) {
1564
+ $event.stopImmediatePropagation();
1565
+ }
1566
+ static {
1567
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1568
+ minVersion: "12.0.0",
1569
+ version: "22.3.0",
1570
+ ngImport: i0,
1571
+ type: StopImmediatePropagationDirective,
1572
+ deps: [],
1573
+ target: i0.ɵɵFactoryTarget.Directive
1574
+ });
1575
+ }
1576
+ static {
1577
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1578
+ minVersion: "14.0.0",
1579
+ version: "22.3.0",
1580
+ type: StopImmediatePropagationDirective,
1581
+ isStandalone: true,
1582
+ selector: "[rxapStopImmediatePropagation]",
1583
+ host: { listeners: { "click": "onClick($event)" } },
1584
+ ngImport: i0
1585
+ });
1586
+ }
1587
+ };
1588
+ i0.ɵɵngDeclareClassMetadata({
1589
+ minVersion: "12.0.0",
1590
+ version: "22.3.0",
1591
+ ngImport: i0,
1592
+ type: StopImmediatePropagationDirective,
1593
+ decorators: [{
1594
+ type: Directive,
1595
+ args: [{
1596
+ selector: "[rxapStopImmediatePropagation]",
1597
+ standalone: true,
1598
+ host: { "(click)": "onClick($event)" }
1599
+ }]
1600
+ }]
1601
+ });
1602
+ var StopPropagationDirective = class StopPropagationDirective {
1603
+ onClick($event) {
1604
+ $event.stopPropagation();
1605
+ }
1606
+ static {
1607
+ this.ɵfac = i0.ɵɵngDeclareFactory({
1608
+ minVersion: "12.0.0",
1609
+ version: "22.3.0",
1610
+ ngImport: i0,
1611
+ type: StopPropagationDirective,
1612
+ deps: [],
1613
+ target: i0.ɵɵFactoryTarget.Directive
1614
+ });
1615
+ }
1616
+ static {
1617
+ this.ɵdir = i0.ɵɵngDeclareDirective({
1618
+ minVersion: "14.0.0",
1619
+ version: "22.3.0",
1620
+ type: StopPropagationDirective,
1621
+ isStandalone: true,
1622
+ selector: "[rxapStopPropagation]",
1623
+ host: { listeners: { "click": "onClick($event)" } },
1624
+ ngImport: i0
1625
+ });
1626
+ }
1627
+ };
1628
+ i0.ɵɵngDeclareClassMetadata({
1629
+ minVersion: "12.0.0",
1630
+ version: "22.3.0",
1631
+ ngImport: i0,
1632
+ type: StopPropagationDirective,
1633
+ decorators: [{
1634
+ type: Directive,
1635
+ args: [{
1636
+ selector: "[rxapStopPropagation]",
1637
+ standalone: true,
1638
+ host: { "(click)": "onClick($event)" }
1639
+ }]
1640
+ }]
1641
+ });
751
1642
  export { AvatarBackgroundImageDirective, BackgroundImageDirective, BackgroundPositionOptions, BackgroundRepeatOptions, BackgroundSizeOptions, ConfirmClick, ContenteditableDirective, FullWidthDirective, GlobalStyleOptions, IfTruthyDirective, IsDevModeDirective, MethodDirective, MethodTemplateDirective, MovableDividerDirective, PreventDefaultDirective, ShareButtonDirective, ShareService, StopImmediatePropagationDirective, StopPropagationDirective };
752
- //# sourceMappingURL=rxap-directives.mjs.map
1643
+
1644
+ //# sourceMappingURL=rxap-directives.mjs.map