@rxap/directives 21.0.1-dev.0 → 21.0.1-dev.1

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 (122) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/compodoc/changelog.html +18 -0
  3. package/compodoc/dependencies.html +4 -4
  4. package/compodoc/directives/AvatarBackgroundImageDirective.html +216 -386
  5. package/compodoc/directives/BackgroundImageDirective.html +230 -243
  6. package/compodoc/directives/ConfirmClick.html +466 -0
  7. package/compodoc/directives/ContenteditableDirective.html +137 -373
  8. package/compodoc/directives/FullWidthDirective.html +8 -139
  9. package/compodoc/directives/IfTruthyDirective.html +136 -182
  10. package/compodoc/directives/IsDevModeDirective.html +4 -74
  11. package/compodoc/directives/MethodDirective.html +272 -346
  12. package/compodoc/directives/MethodTemplateDirective.html +736 -697
  13. package/compodoc/directives/MovableDividerDirective.html +103 -243
  14. package/compodoc/directives/PreventDefaultDirective.html +6 -65
  15. package/compodoc/directives/ShareButtonDirective.html +14 -62
  16. package/compodoc/directives/StopImmediatePropagationDirective.html +6 -65
  17. package/compodoc/directives/StopPropagationDirective.html +6 -65
  18. package/compodoc/injectables/ShareService.html +6 -5
  19. package/compodoc/interfaces/ContenteditableEvent.html +25 -32
  20. package/compodoc/interfaces/IfTruthyDirectiveTemplateContext.html +22 -36
  21. package/compodoc/interfaces/MethodTemplateDirectiveContext.html +42 -66
  22. package/compodoc/interfaces/MethodTemplateDirectiveErrorContext.html +42 -66
  23. package/compodoc/interfaces/ShareData.html +3 -2
  24. package/compodoc/js/menu-wc.js +3 -3
  25. package/compodoc/js/menu-wc_es5.js +1 -1
  26. package/compodoc/js/search/search_index.js +2 -2
  27. package/compodoc/overview.html +2 -2
  28. package/compodoc/properties.html +1 -1
  29. package/docs/documentation.json +2432 -3183
  30. package/docs/html/assets/hierarchy.js +1 -1
  31. package/docs/html/assets/search.js +1 -1
  32. package/docs/html/classes/AvatarBackgroundImageDirective.html +9 -16
  33. package/docs/html/classes/BackgroundImageDirective.html +8 -17
  34. package/docs/html/classes/ConfirmClick.html +3 -3
  35. package/docs/html/classes/ContenteditableDirective.html +8 -7
  36. package/docs/html/classes/FullWidthDirective.html +2 -3
  37. package/docs/html/classes/IfTruthyDirective.html +3 -9
  38. package/docs/html/classes/IsDevModeDirective.html +4 -4
  39. package/docs/html/classes/MethodDirective.html +8 -7
  40. package/docs/html/classes/MethodTemplateDirective.html +10 -15
  41. package/docs/html/classes/MovableDividerDirective.html +3 -13
  42. package/docs/html/classes/PreventDefaultDirective.html +2 -2
  43. package/docs/html/classes/ShareButtonDirective.html +2 -2
  44. package/docs/html/classes/ShareService.html +2 -2
  45. package/docs/html/classes/StopImmediatePropagationDirective.html +2 -2
  46. package/docs/html/classes/StopPropagationDirective.html +2 -2
  47. package/docs/html/enums/BackgroundPositionOptions.html +2 -2
  48. package/docs/html/enums/BackgroundRepeatOptions.html +2 -2
  49. package/docs/html/enums/BackgroundSizeOptions.html +2 -2
  50. package/docs/html/enums/GlobalStyleOptions.html +2 -2
  51. package/docs/html/hierarchy.html +1 -1
  52. package/docs/html/index.html +2 -2
  53. package/docs/html/interfaces/ContenteditableEvent.html +2 -2
  54. package/docs/html/interfaces/IfTruthyDirectiveTemplateContext.html +2 -2
  55. package/docs/html/interfaces/MethodTemplateDirectiveContext.html +2 -2
  56. package/docs/html/interfaces/MethodTemplateDirectiveErrorContext.html +2 -2
  57. package/docs/html/interfaces/ShareData.html +2 -2
  58. package/docs/html/modules.html +1 -1
  59. package/docs/html/types/BackgroundPosition.html +1 -1
  60. package/docs/html/types/BackgroundRepeat.html +1 -1
  61. package/docs/html/types/BackgroundSize.html +1 -1
  62. package/docs/markdown/README.md +1 -1
  63. package/docs/markdown/classes/AvatarBackgroundImageDirective.md +40 -101
  64. package/docs/markdown/classes/BackgroundImageDirective.md +24 -81
  65. package/docs/markdown/classes/ConfirmClick.md +8 -20
  66. package/docs/markdown/classes/ContenteditableDirective.md +21 -34
  67. package/docs/markdown/classes/FullWidthDirective.md +2 -10
  68. package/docs/markdown/classes/IfTruthyDirective.md +14 -69
  69. package/docs/markdown/classes/IsDevModeDirective.md +5 -17
  70. package/docs/markdown/classes/MethodDirective.md +40 -44
  71. package/docs/markdown/classes/MethodTemplateDirective.md +50 -84
  72. package/docs/markdown/classes/MovableDividerDirective.md +11 -71
  73. package/docs/markdown/classes/PreventDefaultDirective.md +3 -3
  74. package/docs/markdown/classes/ShareButtonDirective.md +9 -9
  75. package/docs/markdown/classes/ShareService.md +4 -4
  76. package/docs/markdown/classes/StopImmediatePropagationDirective.md +3 -3
  77. package/docs/markdown/classes/StopPropagationDirective.md +3 -3
  78. package/docs/markdown/enumerations/BackgroundPositionOptions.md +4 -4
  79. package/docs/markdown/enumerations/BackgroundRepeatOptions.md +3 -3
  80. package/docs/markdown/enumerations/BackgroundSizeOptions.md +5 -5
  81. package/docs/markdown/enumerations/GlobalStyleOptions.md +4 -4
  82. package/docs/markdown/globals.md +2 -2
  83. package/docs/markdown/interfaces/ContenteditableEvent.md +4 -4
  84. package/docs/markdown/interfaces/IfTruthyDirectiveTemplateContext.md +3 -3
  85. package/docs/markdown/interfaces/MethodTemplateDirectiveContext.md +3 -3
  86. package/docs/markdown/interfaces/MethodTemplateDirectiveErrorContext.md +4 -4
  87. package/docs/markdown/interfaces/ShareData.md +6 -6
  88. package/docs/markdown/type-aliases/BackgroundPosition.md +2 -2
  89. package/docs/markdown/type-aliases/BackgroundRepeat.md +2 -2
  90. package/docs/markdown/type-aliases/BackgroundSize.md +2 -2
  91. package/docs/wiki/Class.AvatarBackgroundImageDirective.md +39 -100
  92. package/docs/wiki/Class.BackgroundImageDirective.md +23 -80
  93. package/docs/wiki/Class.ConfirmClick.md +7 -19
  94. package/docs/wiki/Class.ContenteditableDirective.md +20 -33
  95. package/docs/wiki/Class.FullWidthDirective.md +1 -9
  96. package/docs/wiki/Class.IfTruthyDirective.md +13 -68
  97. package/docs/wiki/Class.IsDevModeDirective.md +4 -16
  98. package/docs/wiki/Class.MethodDirective.md +39 -43
  99. package/docs/wiki/Class.MethodTemplateDirective.md +49 -83
  100. package/docs/wiki/Class.MovableDividerDirective.md +10 -70
  101. package/docs/wiki/Class.PreventDefaultDirective.md +2 -2
  102. package/docs/wiki/Class.ShareButtonDirective.md +8 -8
  103. package/docs/wiki/Class.ShareService.md +3 -3
  104. package/docs/wiki/Class.StopImmediatePropagationDirective.md +2 -2
  105. package/docs/wiki/Class.StopPropagationDirective.md +2 -2
  106. package/docs/wiki/Enumeration.BackgroundPositionOptions.md +3 -3
  107. package/docs/wiki/Enumeration.BackgroundRepeatOptions.md +2 -2
  108. package/docs/wiki/Enumeration.BackgroundSizeOptions.md +4 -4
  109. package/docs/wiki/Enumeration.GlobalStyleOptions.md +3 -3
  110. package/docs/wiki/Interface.ContenteditableEvent.md +3 -3
  111. package/docs/wiki/Interface.IfTruthyDirectiveTemplateContext.md +2 -2
  112. package/docs/wiki/Interface.MethodTemplateDirectiveContext.md +2 -2
  113. package/docs/wiki/Interface.MethodTemplateDirectiveErrorContext.md +3 -3
  114. package/docs/wiki/Interface.ShareData.md +5 -5
  115. package/docs/wiki/TypeAlias.BackgroundPosition.md +1 -1
  116. package/docs/wiki/TypeAlias.BackgroundRepeat.md +1 -1
  117. package/docs/wiki/TypeAlias.BackgroundSize.md +1 -1
  118. package/docs/wiki/globals.md +1 -1
  119. package/fesm2022/rxap-directives.mjs +259 -360
  120. package/fesm2022/rxap-directives.mjs.map +1 -1
  121. package/package.json +9 -9
  122. package/types/rxap-directives.d.ts +104 -102
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ElementRef, Renderer2, Input, Inject, Directive, HostListener, Injectable, EventEmitter, Output, HostBinding, isDevMode, TemplateRef, ViewContainerRef, ChangeDetectorRef, input, output, inject } from '@angular/core';
3
- import * as i1 from '@rxap/services';
2
+ import { inject, ElementRef, Renderer2, input, computed, effect, untracked, Directive, output, linkedSignal, TemplateRef, ViewContainerRef, isDevMode, Injectable } from '@angular/core';
4
3
  import { ImageLoaderService, AvatarImageService } from '@rxap/services';
5
4
  import { coerceBoolean, DebounceCall } from '@rxap/utilities';
6
5
  import { __decorate, __metadata } from 'tslib';
6
+ import { outputFromObservable } from '@angular/core/rxjs-interop';
7
7
  import { ToggleSubject } from '@rxap/rxjs';
8
8
  import { Subscription, fromEvent } from 'rxjs';
9
9
  import { tap } from 'rxjs/operators';
@@ -35,57 +35,63 @@ var BackgroundPositionOptions;
35
35
  BackgroundPositionOptions["CENTER_CENTER"] = "center center";
36
36
  })(BackgroundPositionOptions || (BackgroundPositionOptions = {}));
37
37
  class BackgroundImageDirective {
38
- // TODO : add inputs for all 'background-*' styles
39
- constructor(host, renderer, imageLoader) {
40
- this.host = host;
41
- this.renderer = renderer;
42
- this.imageLoader = imageLoader;
43
- this.imageUrl = null;
44
- }
45
- ngOnInit() {
46
- if (this.size) {
47
- this.sizeChange(this.size);
48
- }
49
- if (this.position) {
50
- this.positionChange(this.position);
51
- }
52
- if (this.repeat) {
53
- this.repeatChange(this.repeat);
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);
54
75
  }
55
- }
56
- ngOnChanges(changes) {
57
- for (const propertyKey of Object.keys(changes)) {
58
- switch (propertyKey) {
59
- case 'imageUrl':
60
- // call unconditionally so clearing the value (null/empty) is handled
61
- this.imageUrlChange(changes['imageUrl'].currentValue);
62
- break;
63
- case 'size':
64
- this.sizeChange(changes['size'].currentValue);
65
- break;
66
- case 'repeat':
67
- this.repeatChange(changes['repeat'].currentValue);
68
- break;
69
- case 'position':
70
- this.positionChange(changes['position'].currentValue);
71
- break;
72
- }
76
+ else {
77
+ this.renderer.removeStyle(this.host.nativeElement, style);
73
78
  }
74
79
  }
75
80
  repeatChange(repeat) {
76
- this.renderer.setStyle(this.host.nativeElement, 'background-repeat', repeat);
81
+ this.applyStyle('background-repeat', repeat);
77
82
  }
78
83
  positionChange(position) {
79
- this.renderer.setStyle(this.host.nativeElement, 'background-position', position);
84
+ this.applyStyle('background-position', position);
80
85
  }
81
86
  sizeChange(size) {
82
- this.renderer.setStyle(this.host.nativeElement, 'background-size', size);
87
+ this.applyStyle('background-size', size);
83
88
  }
84
89
  async imageUrlChange(imageUrl) {
85
90
  // track the most recently requested url so out-of-order loads can be ignored
86
91
  this._latestImageUrl = imageUrl;
87
- if (this.placeholderImageUrl) {
88
- this.renderer.setStyle(this.host.nativeElement, 'background-image', `url("${this.placeholderImageUrl}")`);
92
+ const placeholderImageUrl = this.placeholder();
93
+ if (placeholderImageUrl) {
94
+ this.renderer.setStyle(this.host.nativeElement, 'background-image', `url("${placeholderImageUrl}")`);
89
95
  }
90
96
  if (imageUrl) {
91
97
  await this.imageLoader.load(imageUrl);
@@ -95,13 +101,13 @@ class BackgroundImageDirective {
95
101
  }
96
102
  this.renderer.setStyle(this.host.nativeElement, 'background-image', `url("${imageUrl}")`);
97
103
  }
98
- else if (!this.placeholderImageUrl) {
104
+ else if (!placeholderImageUrl) {
99
105
  // clearing the image and no placeholder to fall back to
100
106
  this.renderer.removeStyle(this.host.nativeElement, 'background-image');
101
107
  }
102
108
  }
103
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: BackgroundImageDirective, deps: [{ token: ElementRef }, { token: Renderer2 }, { token: ImageLoaderService }], target: i0.ɵɵFactoryTarget.Directive }); }
104
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: BackgroundImageDirective, isStandalone: true, selector: "[rxapBackgroundImage]", inputs: { imageUrl: ["rxapBackgroundImage", "imageUrl"], placeholderImageUrl: "placeholderImageUrl", size: "size", repeat: "repeat", position: "position" }, usesOnChanges: true, ngImport: i0 }); }
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 }); }
105
111
  }
106
112
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: BackgroundImageDirective, decorators: [{
107
113
  type: Directive,
@@ -109,43 +115,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
109
115
  selector: '[rxapBackgroundImage]',
110
116
  standalone: true,
111
117
  }]
112
- }], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
113
- type: Inject,
114
- args: [ElementRef]
115
- }] }, { type: i0.Renderer2, decorators: [{
116
- type: Inject,
117
- args: [Renderer2]
118
- }] }, { type: i1.ImageLoaderService, decorators: [{
119
- type: Inject,
120
- args: [ImageLoaderService]
121
- }] }], propDecorators: { imageUrl: [{
122
- type: Input,
123
- args: ['rxapBackgroundImage']
124
- }], placeholderImageUrl: [{
125
- type: Input
126
- }], size: [{
127
- type: Input
128
- }], repeat: [{
129
- type: Input
130
- }], position: [{
131
- type: Input
132
- }] } });
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 }] }] } });
133
119
 
134
120
  class AvatarBackgroundImageDirective extends BackgroundImageDirective {
135
- constructor(host, renderer, imageLoader, avatarImage) {
136
- super(host, renderer, imageLoader);
137
- this.avatarImage = avatarImage;
138
- this.imageUrl = null;
139
- this.size = BackgroundSizeOptions.COVER;
140
- this.repeat = BackgroundRepeatOptions.NO_REPEAT;
141
- }
142
- set name(name) {
143
- if (!this.placeholderImageUrl) {
144
- this.placeholderImageUrl = this.avatarImage.get({ name });
145
- }
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 */ []));
146
141
  }
147
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AvatarBackgroundImageDirective, deps: [{ token: ElementRef }, { token: Renderer2 }, { token: ImageLoaderService }, { token: AvatarImageService }], target: i0.ɵɵFactoryTarget.Directive }); }
148
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: AvatarBackgroundImageDirective, isStandalone: true, selector: "[rxapAvatarBackgroundImage]", inputs: { imageUrl: ["rxapAvatarBackgroundImage", "imageUrl"], name: "name" }, usesInheritance: true, ngImport: i0 }); }
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 }); }
149
144
  }
150
145
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AvatarBackgroundImageDirective, decorators: [{
151
146
  type: Directive,
@@ -153,62 +148,46 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
153
148
  selector: '[rxapAvatarBackgroundImage]',
154
149
  standalone: true,
155
150
  }]
156
- }], ctorParameters: () => [{ type: i0.ElementRef, decorators: [{
157
- type: Inject,
158
- args: [ElementRef]
159
- }] }, { type: i0.Renderer2, decorators: [{
160
- type: Inject,
161
- args: [Renderer2]
162
- }] }, { type: i1.ImageLoaderService, decorators: [{
163
- type: Inject,
164
- args: [ImageLoaderService]
165
- }] }, { type: i1.AvatarImageService, decorators: [{
166
- type: Inject,
167
- args: [AvatarImageService]
168
- }] }], propDecorators: { imageUrl: [{
169
- type: Input,
170
- args: ['rxapAvatarBackgroundImage']
171
- }], name: [{
172
- type: Input
173
- }] } });
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 }] }] } });
174
152
 
175
153
  class ConfirmClick {
176
154
  constructor() {
177
- this._hasConfirmDirective = false;
178
- }
179
- set hasConfirmDirective(value) {
180
- this._hasConfirmDirective = coerceBoolean(value);
155
+ this.hasConfirmDirective = input(false, { ...(ngDevMode ? { debugName: "hasConfirmDirective" } : /* istanbul ignore next */ {}), alias: 'rxapConfirm', transform: coerceBoolean });
181
156
  }
182
157
  onClick() {
183
- if (!this._hasConfirmDirective) {
158
+ if (!this.hasConfirmDirective()) {
184
159
  this.execute();
185
160
  }
186
161
  }
187
162
  onConfirm() {
188
163
  this.execute();
189
164
  }
190
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfirmClick, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
191
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfirmClick }); }
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 }); }
192
167
  }
193
168
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ConfirmClick, decorators: [{
194
- type: Injectable
195
- }], propDecorators: { hasConfirmDirective: [{
196
- type: Input,
197
- args: ['rxapConfirm']
198
- }], onClick: [{
199
- type: HostListener,
200
- args: ['click']
201
- }], onConfirm: [{
202
- type: HostListener,
203
- args: ['confirmed']
204
- }] } });
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 }] }] } });
205
177
 
206
178
  class ContenteditableDirective {
207
- constructor(elementRef) {
208
- this.elementRef = elementRef;
209
- this.contenteditable = true;
210
- this.spellcheck = false;
211
- this.change = new EventEmitter();
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 */ []));
212
191
  }
213
192
  onClick($event) {
214
193
  $event.stopPropagation();
@@ -218,31 +197,33 @@ class ContenteditableDirective {
218
197
  if (value && value.length >= 2) {
219
198
  const event = {
220
199
  value,
221
- parameters: this.parameters,
200
+ parameters: this.parameters(),
222
201
  };
223
202
  this.change.emit(event);
224
203
  try {
225
- const result = await this.method?.call(event);
204
+ const result = await this.method()?.call(event);
226
205
  if (result && typeof result === 'string') {
227
206
  // the handler returned a canonical value - apply and remember it
228
- this.initial = this.elementRef.nativeElement.innerText = result;
207
+ this.elementRef.nativeElement.innerText = result;
208
+ this.initial.set(result);
229
209
  }
230
210
  else {
231
211
  // successful save without a return value - keep the user's text and
232
212
  // update the baseline (do NOT revert what was just typed)
233
- this.initial = value;
213
+ this.initial.set(value);
234
214
  }
235
215
  }
236
216
  catch {
237
217
  // the save failed - revert to the last known good value if available
238
- if (this.initial) {
239
- this.elementRef.nativeElement.innerText = this.initial;
218
+ const initial = this.initial();
219
+ if (initial) {
220
+ this.elementRef.nativeElement.innerText = initial;
240
221
  }
241
222
  }
242
223
  }
243
224
  }
244
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: ContenteditableDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
245
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: ContenteditableDirective, isStandalone: true, selector: "[rxapContenteditable]", inputs: { method: ["rxapContenteditable", "method"], parameters: "parameters", initial: "initial" }, outputs: { change: "rxapContenteditable" }, host: { listeners: { "click": "onClick($event)", "input": "onInput($event)" }, properties: { "attr.contenteditable": "this.contenteditable", "attr.spellcheck": "this.spellcheck" } }, ngImport: i0 }); }
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 }); }
246
227
  }
247
228
  __decorate([
248
229
  DebounceCall(1000),
@@ -255,56 +236,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
255
236
  args: [{
256
237
  selector: '[rxapContenteditable]',
257
238
  standalone: true,
239
+ host: {
240
+ '[attr.contenteditable]': 'true',
241
+ '[attr.spellcheck]': 'false',
242
+ '(click)': 'onClick($event)',
243
+ '(input)': 'onInput($event)',
244
+ },
258
245
  }]
259
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { contenteditable: [{
260
- type: HostBinding,
261
- args: ['attr.contenteditable']
262
- }], spellcheck: [{
263
- type: HostBinding,
264
- args: ['attr.spellcheck']
265
- }], method: [{
266
- type: Input,
267
- args: ['rxapContenteditable']
268
- }], change: [{
269
- type: Output,
270
- args: ['rxapContenteditable']
271
- }], parameters: [{
272
- type: Input
273
- }], initial: [{
274
- type: Input
275
- }], onClick: [{
276
- type: HostListener,
277
- args: ['click', ['$event']]
278
- }], onInput: [{
279
- type: HostListener,
280
- args: ['input', ['$event']]
281
- }] } });
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: [] } });
282
247
 
283
248
  class FullWidthDirective {
284
- constructor() {
285
- this.width = '100%';
286
- }
287
249
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FullWidthDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
288
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: FullWidthDirective, isStandalone: true, selector: "[rxapFullWidth]", host: { properties: { "style.width": "this.width" } }, ngImport: i0 }); }
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 }); }
289
251
  }
290
252
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: FullWidthDirective, decorators: [{
291
253
  type: Directive,
292
254
  args: [{
293
255
  selector: '[rxapFullWidth]',
294
256
  standalone: true,
257
+ host: {
258
+ style: 'width: 100%',
259
+ },
295
260
  }]
296
- }], propDecorators: { width: [{
297
- type: HostBinding,
298
- args: ['style.width']
299
- }] } });
261
+ }] });
300
262
 
301
263
  // TODO : mv to rxap package
302
264
  class IfTruthyDirective {
303
- constructor(templateRef, viewContainerRef, cdr) {
304
- this.templateRef = templateRef;
305
- this.viewContainerRef = viewContainerRef;
306
- this.cdr = cdr;
307
- }
308
265
  /**
309
266
  * Asserts the correct type of the context for the template that `NgForOf` will render.
310
267
  *
@@ -314,33 +271,42 @@ class IfTruthyDirective {
314
271
  static ngTemplateContextGuard(dir, ctx) {
315
272
  return true;
316
273
  }
317
- ngOnChanges(changes) {
318
- if (this.method && this.parameters) {
319
- this.execute();
320
- }
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
+ });
321
287
  }
322
288
  async execute() {
323
- const result = await this.method.call(this.parameters);
289
+ const result = await this.method().call(this.parameters());
324
290
  if (this.hasChanged(result)) {
325
291
  this.viewContainerRef.clear();
326
292
  if (result) {
327
- this.viewContainerRef.createEmbeddedView(this.templateRef, { $implicit: result });
293
+ this.viewContainerRef.createEmbeddedView(this.templateRef, { $implicit: result }).markForCheck();
328
294
  }
329
295
  // remember the last applied result so unchanged values don't rebuild the view
330
296
  this._last = result;
331
297
  }
332
- this.cdr.detectChanges();
333
298
  }
334
299
  hasChanged(current) {
335
300
  if (this._last !== undefined) {
336
- const currentTrackBy = this.trackBy ? this.trackBy(current) : current;
337
- const lastTrackBy = this.trackBy ? this.trackBy(this._last) : this._last;
301
+ const trackBy = this.trackBy();
302
+ const currentTrackBy = trackBy ? trackBy(current) : current;
303
+ const lastTrackBy = trackBy ? trackBy(this._last) : this._last;
338
304
  return currentTrackBy !== lastTrackBy;
339
305
  }
340
306
  return true;
341
307
  }
342
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IfTruthyDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
343
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: IfTruthyDirective, isStandalone: true, selector: "[rxapIfTruthy]", inputs: { method: ["rxapIfTruthy", "method"], parameters: ["rxapIfTruthyParameters", "parameters"], trackBy: ["rxapIfTruthyTrackBy", "trackBy"] }, usesOnChanges: true, ngImport: i0 }); }
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 }); }
344
310
  }
345
311
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IfTruthyDirective, decorators: [{
346
312
  type: Directive,
@@ -348,21 +314,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
348
314
  selector: '[rxapIfTruthy]',
349
315
  standalone: true,
350
316
  }]
351
- }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: i0.ChangeDetectorRef }], propDecorators: { method: [{
352
- type: Input,
353
- args: ['rxapIfTruthy']
354
- }], parameters: [{
355
- type: Input,
356
- args: ['rxapIfTruthyParameters']
357
- }], trackBy: [{
358
- type: Input,
359
- args: ['rxapIfTruthyTrackBy']
360
- }] } });
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 }] }] } });
361
318
 
362
319
  class IsDevModeDirective {
363
- constructor(template, vcr) {
364
- this.template = template;
365
- this.vcr = vcr;
320
+ constructor() {
321
+ this.template = inject(TemplateRef);
322
+ this.vcr = inject(ViewContainerRef);
366
323
  }
367
324
  ngOnInit() {
368
325
  if (isDevMode()) {
@@ -373,7 +330,7 @@ class IsDevModeDirective {
373
330
  this.embeddedViewRef?.destroy();
374
331
  this.vcr.clear();
375
332
  }
376
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsDevModeDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
333
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsDevModeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
377
334
  static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: IsDevModeDirective, isStandalone: true, selector: "[rxapIsDevMode]", ngImport: i0 }); }
378
335
  }
379
336
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: IsDevModeDirective, decorators: [{
@@ -382,46 +339,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
382
339
  selector: '[rxapIsDevMode]',
383
340
  standalone: true,
384
341
  }]
385
- }], ctorParameters: () => [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }] });
342
+ }] });
386
343
 
387
344
  class MethodTemplateDirective {
388
- constructor(template, viewContainerRef, cdr) {
389
- this.template = template;
390
- this.viewContainerRef = viewContainerRef;
391
- this.cdr = cdr;
392
- this.withoutParameters = false;
393
- this.immediately = false;
394
- this.executed$ = new EventEmitter();
395
- this.failure$ = new EventEmitter();
396
- this.successful$ = new EventEmitter();
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' });
397
361
  /**
398
362
  * true - a remote method call is in progress
399
363
  */
400
364
  this.executing$ = new ToggleSubject();
401
- this.embedded = new EventEmitter();
402
- }
403
- static ngTemplateContextGuard(dir, ctx) {
404
- return true;
405
- }
406
- ngOnChanges(changes) {
407
- const parametersChanges = changes['parameters'];
408
- if (parametersChanges) {
409
- this.execute(parametersChanges.currentValue);
410
- }
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
+ });
411
374
  }
412
375
  ngOnInit() {
413
376
  this.renderLoadingTemplate();
414
- if (this.withoutParameters) {
377
+ if (this.withoutParameters()) {
415
378
  this.execute();
416
379
  }
417
380
  }
418
381
  onConfirmed() {
419
382
  return this.execute();
420
383
  }
421
- async execute(parameters = this.parameters) {
384
+ async execute(parameters = this.currentParameters()) {
422
385
  this.executing$.enable();
423
386
  try {
424
- const result = await this.method.call(parameters);
387
+ const result = await this.method().call(parameters);
425
388
  this.executed(result);
426
389
  this.renderTemplate(result);
427
390
  this.successful(result);
@@ -441,7 +404,7 @@ class MethodTemplateDirective {
441
404
  this.updateParameters({ [parameterKey]: value });
442
405
  }
443
406
  updateParameters(parameters) {
444
- this.parameters = { ...(this.parameters ?? {}), ...parameters };
407
+ this.currentParameters.set({ ...(this.currentParameters() ?? {}), ...parameters });
445
408
  }
446
409
  executed(result) {
447
410
  this.executed$.emit(result);
@@ -453,10 +416,11 @@ class MethodTemplateDirective {
453
416
  this.successful$.emit(result);
454
417
  }
455
418
  renderErrorTemplate(error) {
456
- if (this.errorTemplate) {
419
+ const errorTemplate = this.errorTemplate();
420
+ if (errorTemplate) {
457
421
  this.viewContainerRef.clear();
458
- if (this.errorTemplate) {
459
- this.viewContainerRef.createEmbeddedView(this.errorTemplate, {
422
+ if (errorTemplate) {
423
+ this.viewContainerRef.createEmbeddedView(errorTemplate, {
460
424
  $implicit: error,
461
425
  message: error.message,
462
426
  });
@@ -466,7 +430,7 @@ class MethodTemplateDirective {
466
430
  renderTemplate(result) {
467
431
  this.viewContainerRef.clear();
468
432
  try {
469
- this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result });
433
+ this.viewContainerRef.createEmbeddedView(this.template, { $implicit: result }).markForCheck();
470
434
  }
471
435
  catch (error) {
472
436
  this.renderErrorTemplate(error);
@@ -474,16 +438,16 @@ class MethodTemplateDirective {
474
438
  throw error;
475
439
  }
476
440
  this.embedded.emit();
477
- this.cdr.detectChanges();
478
441
  }
479
442
  renderLoadingTemplate() {
480
- if (this.loadingTemplate) {
443
+ const loadingTemplate = this.loadingTemplate();
444
+ if (loadingTemplate) {
481
445
  this.viewContainerRef.clear();
482
- this.viewContainerRef.createEmbeddedView(this.loadingTemplate);
446
+ this.viewContainerRef.createEmbeddedView(loadingTemplate);
483
447
  }
484
448
  }
485
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodTemplateDirective, deps: [{ token: TemplateRef }, { token: ViewContainerRef }, { token: ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
486
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: MethodTemplateDirective, isStandalone: true, selector: "[rxapMethod]", inputs: { method: ["rxapMethodCall", "method"], parameters: ["rxapMethodParameters", "parameters"], errorTemplate: ["rxapMethodError", "errorTemplate"], loadingTemplate: ["rxapMethodLoading", "loadingTemplate"], withoutParameters: ["rxapMethodWithoutParameters", "withoutParameters"], immediately: "immediately" }, outputs: { executed$: "executed", failure$: "failure", successful$: "successful", executing$: "executing", embedded: "embedded" }, host: { listeners: { "confirmed": "onConfirmed()" } }, exportAs: ["rxapMethod"], usesOnChanges: true, ngImport: i0 }); }
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 }); }
487
451
  }
488
452
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodTemplateDirective, decorators: [{
489
453
  type: Directive,
@@ -491,69 +455,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
491
455
  selector: '[rxapMethod]',
492
456
  exportAs: 'rxapMethod',
493
457
  standalone: true,
458
+ host: {
459
+ '(confirmed)': 'onConfirmed()',
460
+ },
494
461
  }]
495
- }], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
496
- type: Inject,
497
- args: [TemplateRef]
498
- }] }, { type: i0.ViewContainerRef, decorators: [{
499
- type: Inject,
500
- args: [ViewContainerRef]
501
- }] }, { type: i0.ChangeDetectorRef, decorators: [{
502
- type: Inject,
503
- args: [ChangeDetectorRef]
504
- }] }], propDecorators: { method: [{
505
- type: Input,
506
- args: ['rxapMethodCall']
507
- }], parameters: [{
508
- type: Input,
509
- args: ['rxapMethodParameters']
510
- }], errorTemplate: [{
511
- type: Input,
512
- args: ['rxapMethodError']
513
- }], loadingTemplate: [{
514
- type: Input,
515
- args: ['rxapMethodLoading']
516
- }], withoutParameters: [{
517
- type: Input,
518
- args: ['rxapMethodWithoutParameters']
519
- }], immediately: [{
520
- type: Input
521
- }], executed$: [{
522
- type: Output,
523
- args: ['executed']
524
- }], failure$: [{
525
- type: Output,
526
- args: ['failure']
527
- }], successful$: [{
528
- type: Output,
529
- args: ['successful']
530
- }], executing$: [{
531
- type: Output,
532
- args: ['executing']
533
- }], embedded: [{
534
- type: Output
535
- }], onConfirmed: [{
536
- type: HostListener,
537
- args: ['confirmed']
538
- }] } });
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"] }] } });
539
463
 
540
464
  class MethodDirective {
541
465
  constructor() {
542
- this.immediately = false;
543
- this.executed$ = new EventEmitter();
544
- this.failure$ = new EventEmitter();
545
- this.successful$ = new EventEmitter();
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' });
546
473
  /**
547
474
  * true - a remote method call is in progress
548
475
  */
549
476
  this.executing$ = new ToggleSubject();
550
- this._hasConfirmDirective = false;
551
- }
552
- set hasConfirmDirective(value) {
553
- this._hasConfirmDirective = coerceBoolean(value);
477
+ this.hasConfirmDirective = input(false, { ...(ngDevMode ? { debugName: "hasConfirmDirective" } : /* istanbul ignore next */ {}), alias: 'rxapConfirm', transform: coerceBoolean });
554
478
  }
555
479
  ngOnInit() {
556
- if (this.immediately) {
480
+ if (this.immediately()) {
557
481
  this.execute();
558
482
  }
559
483
  }
@@ -561,7 +485,7 @@ class MethodDirective {
561
485
  return this.execute();
562
486
  }
563
487
  onClick() {
564
- if (!this._hasConfirmDirective) {
488
+ if (!this.hasConfirmDirective()) {
565
489
  return this.execute();
566
490
  }
567
491
  else {
@@ -574,7 +498,7 @@ class MethodDirective {
574
498
  async execute() {
575
499
  this.executing$.enable();
576
500
  try {
577
- const result = await this.method.call(this.parameters);
501
+ const result = await this.method().call(this.currentParameters());
578
502
  this.executed(result);
579
503
  this.successful(result);
580
504
  }
@@ -592,7 +516,7 @@ class MethodDirective {
592
516
  this.updateParameters({ [parameterKey]: value });
593
517
  }
594
518
  updateParameters(parameters) {
595
- this.parameters = { ...(this.parameters ?? {}), ...parameters };
519
+ this.currentParameters.set({ ...(this.currentParameters() ?? {}), ...parameters });
596
520
  }
597
521
  executed(result) {
598
522
  this.executed$.emit(result);
@@ -604,7 +528,7 @@ class MethodDirective {
604
528
  this.successful$.emit(result);
605
529
  }
606
530
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
607
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: MethodDirective, isStandalone: true, selector: "[rxapMethod]", inputs: { method: ["rxapMethod", "method"], parameters: "parameters", immediately: "immediately", hasConfirmDirective: ["rxapConfirm", "hasConfirmDirective"] }, outputs: { executed$: "executed", failure$: "failure", successful$: "successful" }, host: { listeners: { "confirmed": "onConfirmed()", "click": "onClick()" } }, exportAs: ["rxapMethod"], ngImport: i0 }); }
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 }); }
608
532
  }
609
533
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodDirective, decorators: [{
610
534
  type: Directive,
@@ -612,40 +536,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
612
536
  selector: '[rxapMethod]',
613
537
  exportAs: 'rxapMethod',
614
538
  standalone: true,
539
+ host: {
540
+ '(confirmed)': 'onConfirmed()',
541
+ '(click)': 'onClick()',
542
+ },
615
543
  }]
616
- }], propDecorators: { method: [{
617
- type: Input,
618
- args: ['rxapMethod']
619
- }], parameters: [{
620
- type: Input
621
- }], immediately: [{
622
- type: Input
623
- }], executed$: [{
624
- type: Output,
625
- args: ['executed']
626
- }], failure$: [{
627
- type: Output,
628
- args: ['failure']
629
- }], successful$: [{
630
- type: Output,
631
- args: ['successful']
632
- }], hasConfirmDirective: [{
633
- type: Input,
634
- args: ['rxapConfirm']
635
- }], onConfirmed: [{
636
- type: HostListener,
637
- args: ['confirmed']
638
- }], onClick: [{
639
- type: HostListener,
640
- args: ['click']
641
- }] } });
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 }] }] } });
642
545
 
643
546
  class MovableDividerDirective {
644
- constructor(renderer) {
645
- this.renderer = renderer;
646
- this.origin = 'right';
647
- this.cursor = 'ew-resize';
648
- this._subscription = new Subscription();
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 */ []));
649
552
  /**
650
553
  * Indicates that the divider is moved with mouse down
651
554
  * @private
@@ -658,68 +561,64 @@ class MovableDividerDirective {
658
561
  * @private
659
562
  */
660
563
  this._fixedElementWidth = null;
661
- }
662
- ngOnDestroy() {
663
- this._subscription?.unsubscribe();
664
- }
665
- ngOnInit() {
666
- this._subscription.add(fromEvent(this.containerElement, 'mousemove').pipe(tap(($event) => {
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) => {
667
573
  if (this._moveDivider) {
668
574
  if (!this._fixedElementWidth) {
669
- this._fixedElementWidth = this.fixedElement.clientWidth;
575
+ this._fixedElementWidth = this.fixedElement().clientWidth;
670
576
  }
671
- if (this.origin === 'right') {
672
- this._fixedElementWidth = $event.clientX - this.containerElement.getBoundingClientRect().left;
577
+ const origin = this.origin();
578
+ if (origin === 'right') {
579
+ this._fixedElementWidth = $event.clientX - this.containerElement().getBoundingClientRect().left;
673
580
  }
674
- else if (this.origin === 'left') {
581
+ else if (origin === 'left') {
582
+ const containerElementValue = this.containerElement();
675
583
  if (isDevMode()) {
676
584
  console.log({
677
- clientWidth: this.containerElement.clientWidth,
585
+ clientWidth: containerElementValue.clientWidth,
678
586
  clientX: $event.clientX,
679
- clientLeft: this.containerElement.getBoundingClientRect().left,
587
+ clientLeft: containerElementValue.getBoundingClientRect().left,
680
588
  });
681
589
  }
682
590
  this._fixedElementWidth =
683
- this.containerElement.clientWidth - $event.clientX + this.containerElement.getBoundingClientRect().left;
591
+ containerElementValue.clientWidth - $event.clientX + containerElementValue.getBoundingClientRect().left;
684
592
  }
685
593
  else {
686
- throw new Error(`The origin '${this.origin}' is not supported.`);
594
+ throw new Error(`The origin '${origin}' is not supported.`);
687
595
  }
688
596
  const width = this._fixedElementWidth + 'px';
689
- this.renderer.setStyle(this.fixedElement, 'max-width', width);
690
- this.renderer.setStyle(this.fixedElement, 'min-width', width);
691
- this.renderer.setStyle(this.fixedElement, 'flex-basis', width);
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);
692
601
  }
693
602
  })).subscribe());
694
- this._subscription.add(fromEvent(this.containerElement, 'mouseup').pipe(tap(() => this._moveDivider = false)).subscribe());
603
+ subscription.add(fromEvent(containerElement, 'mouseup').pipe(tap(() => this._moveDivider = false)).subscribe());
695
604
  }
696
605
  onMousedown() {
697
606
  this._moveDivider = true;
698
607
  }
699
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MovableDividerDirective, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
700
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.9", type: MovableDividerDirective, isStandalone: true, selector: "[rxapMovableDivider]", inputs: { containerElement: "containerElement", fixedElement: "fixedElement", origin: "origin" }, host: { listeners: { "mousedown": "onMousedown()" }, properties: { "style.cursor": "this.cursor" } }, ngImport: i0 }); }
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 }); }
701
610
  }
702
611
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MovableDividerDirective, decorators: [{
703
612
  type: Directive,
704
613
  args: [{
705
614
  selector: '[rxapMovableDivider]',
706
615
  standalone: true,
616
+ host: {
617
+ style: 'cursor: ew-resize',
618
+ '(mousedown)': 'onMousedown()',
619
+ },
707
620
  }]
708
- }], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { containerElement: [{
709
- type: Input,
710
- args: [{ required: true }]
711
- }], fixedElement: [{
712
- type: Input,
713
- args: [{ required: true }]
714
- }], origin: [{
715
- type: Input
716
- }], cursor: [{
717
- type: HostBinding,
718
- args: ['style.cursor']
719
- }], onMousedown: [{
720
- type: HostListener,
721
- args: ['mousedown']
722
- }] } });
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 }] }] } });
723
622
 
724
623
  class PreventDefaultDirective {
725
624
  onClick($event) {
@@ -733,11 +632,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
733
632
  args: [{
734
633
  selector: '[rxapPreventDefault]',
735
634
  standalone: true,
635
+ host: {
636
+ '(click)': 'onClick($event)',
637
+ },
736
638
  }]
737
- }], propDecorators: { onClick: [{
738
- type: HostListener,
739
- args: ['click', ['$event']]
740
- }] } });
639
+ }] });
741
640
 
742
641
  class ShareService {
743
642
  constructor() {
@@ -800,11 +699,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
800
699
  args: [{
801
700
  selector: '[rxapShareButton],[rxapShare]',
802
701
  standalone: true,
702
+ host: {
703
+ '(click)': 'share()',
704
+ },
803
705
  }]
804
- }], 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"] }], share: [{
805
- type: HostListener,
806
- args: ['click']
807
- }] } });
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"] }] } });
808
707
 
809
708
  class StopImmediatePropagationDirective {
810
709
  onClick($event) {
@@ -818,11 +717,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
818
717
  args: [{
819
718
  selector: '[rxapStopImmediatePropagation]',
820
719
  standalone: true,
720
+ host: {
721
+ '(click)': 'onClick($event)',
722
+ },
821
723
  }]
822
- }], propDecorators: { onClick: [{
823
- type: HostListener,
824
- args: ['click', ['$event']]
825
- }] } });
724
+ }] });
826
725
 
827
726
  class StopPropagationDirective {
828
727
  onClick($event) {
@@ -836,11 +735,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
836
735
  args: [{
837
736
  selector: '[rxapStopPropagation]',
838
737
  standalone: true,
738
+ host: {
739
+ '(click)': 'onClick($event)',
740
+ },
839
741
  }]
840
- }], propDecorators: { onClick: [{
841
- type: HostListener,
842
- args: ['click', ['$event']]
843
- }] } });
742
+ }] });
844
743
 
845
744
  // region
846
745
  // endregion