@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
@@ -192,7 +192,6 @@
192
192
  <td class="col-md-4">
193
193
  <ul class="index-list">
194
194
  <li>
195
- <span class="modifier"></span>
196
195
  <span class="modifier">Async</span>
197
196
  <a href="#share" >share</a>
198
197
  </li>
@@ -223,20 +222,6 @@
223
222
 
224
223
 
225
224
 
226
- <tr>
227
- <td class="col-md-4">
228
- <h6><b>HostListeners</b></h6>
229
- </td>
230
- </tr>
231
- <tr>
232
- <td class="col-md-4">
233
- <ul class="index-list">
234
- <li>
235
- <a href="#click" >click</a>
236
- </li>
237
- </ul>
238
- </td>
239
- </tr>
240
225
 
241
226
  </tbody>
242
227
  </table>
@@ -255,7 +240,7 @@
255
240
  </tr>
256
241
  <tr>
257
242
  <td class="col-md-2" colspan="2">
258
- <div class="io-line">Defined in <a href="" data-line="52" class="link-to-prism">src/lib/share-button.directive.ts:52</a></div>
243
+ <div class="io-line">Defined in <a href="" data-line="54" class="link-to-prism">src/lib/share-button.directive.ts:54</a></div>
259
244
  </td>
260
245
  </tr>
261
246
  </tbody>
@@ -270,7 +255,7 @@
270
255
  </tr>
271
256
  <tr>
272
257
  <td class="col-md-2" colspan="2">
273
- <div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/share-button.directive.ts:53</a></div>
258
+ <div class="io-line">Defined in <a href="" data-line="55" class="link-to-prism">src/lib/share-button.directive.ts:55</a></div>
274
259
  </td>
275
260
  </tr>
276
261
  </tbody>
@@ -285,7 +270,7 @@
285
270
  </tr>
286
271
  <tr>
287
272
  <td class="col-md-2" colspan="2">
288
- <div class="io-line">Defined in <a href="" data-line="51" class="link-to-prism">src/lib/share-button.directive.ts:51</a></div>
273
+ <div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/share-button.directive.ts:53</a></div>
289
274
  </td>
290
275
  </tr>
291
276
  </tbody>
@@ -293,33 +278,7 @@
293
278
  </section>
294
279
 
295
280
 
296
- <section data-compodoc="block-host-listener">
297
- <h3>HostListeners</h3> <table class="table table-sm table-bordered">
298
- <tbody>
299
- <tr>
300
- <td class="col-md-4">
301
- <a name="click"></a>
302
- <span class="name">
303
- <b>
304
- click
305
- </b>
306
- <a href="#click"><span class="icon ion-ios-link"></span></a>
307
- </span>
308
- </td>
309
- </tr>
310
281
 
311
-
312
- <tr>
313
- <td class="col-md-4">
314
- <div class="io-line">Defined in <a href="" data-line="62"
315
- class="link-to-prism">src/lib/share-button.directive.ts:62</a></div>
316
- </td>
317
- </tr>
318
-
319
-
320
- </tbody>
321
- </table>
322
- </section>
323
282
  <section data-compodoc="block-methods">
324
283
 
325
284
  <h3 id="methods">
@@ -331,7 +290,6 @@
331
290
  <td class="col-md-4">
332
291
  <a name="share"></a>
333
292
  <span class="name">
334
- <span class="modifier"></span>
335
293
  <span class="modifier">Async</span>
336
294
  <span ><b>share</b></span>
337
295
  <a href="#share"><span class="icon ion-ios-link"></span></a>
@@ -345,18 +303,11 @@
345
303
  </td>
346
304
  </tr>
347
305
 
348
- <tr>
349
- <td class="col-md-4">
350
- <b>Decorators : </b>
351
- <br />
352
- <code>@HostListener(&#x27;click&#x27;)<br /></code>
353
- </td>
354
- </tr>
355
306
 
356
307
  <tr>
357
308
  <td class="col-md-4">
358
- <div class="io-line">Defined in <a href="" data-line="62"
359
- class="link-to-prism">src/lib/share-button.directive.ts:62</a></div>
309
+ <div class="io-line">Defined in <a href="" data-line="63"
310
+ class="link-to-prism">src/lib/share-button.directive.ts:63</a></div>
360
311
  </td>
361
312
  </tr>
362
313
 
@@ -397,7 +348,7 @@
397
348
  </tr>
398
349
  <tr>
399
350
  <td class="col-md-4">
400
- <div class="io-line">Defined in <a href="" data-line="56" class="link-to-prism">src/lib/share-button.directive.ts:56</a></div>
351
+ <div class="io-line">Defined in <a href="" data-line="58" class="link-to-prism">src/lib/share-button.directive.ts:58</a></div>
401
352
  </td>
402
353
  </tr>
403
354
 
@@ -423,7 +374,7 @@
423
374
  </tr>
424
375
  <tr>
425
376
  <td class="col-md-4">
426
- <div class="io-line">Defined in <a href="" data-line="54" class="link-to-prism">src/lib/share-button.directive.ts:54</a></div>
377
+ <div class="io-line">Defined in <a href="" data-line="56" class="link-to-prism">src/lib/share-button.directive.ts:56</a></div>
427
378
  </td>
428
379
  </tr>
429
380
 
@@ -449,7 +400,7 @@
449
400
  </tr>
450
401
  <tr>
451
402
  <td class="col-md-4">
452
- <div class="io-line">Defined in <a href="" data-line="57" class="link-to-prism">src/lib/share-button.directive.ts:57</a></div>
403
+ <div class="io-line">Defined in <a href="" data-line="59" class="link-to-prism">src/lib/share-button.directive.ts:59</a></div>
453
404
  </td>
454
405
  </tr>
455
406
 
@@ -470,7 +421,7 @@
470
421
  </tr>
471
422
  <tr>
472
423
  <td class="col-md-4">
473
- <div class="io-line">Defined in <a href="" data-line="52" class="link-to-prism">src/lib/share-button.directive.ts:52</a></div>
424
+ <div class="io-line">Defined in <a href="" data-line="54" class="link-to-prism">src/lib/share-button.directive.ts:54</a></div>
474
425
  </td>
475
426
  </tr>
476
427
 
@@ -491,7 +442,7 @@
491
442
  </tr>
492
443
  <tr>
493
444
  <td class="col-md-4">
494
- <div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/share-button.directive.ts:53</a></div>
445
+ <div class="io-line">Defined in <a href="" data-line="55" class="link-to-prism">src/lib/share-button.directive.ts:55</a></div>
495
446
  </td>
496
447
  </tr>
497
448
 
@@ -512,7 +463,7 @@
512
463
  </tr>
513
464
  <tr>
514
465
  <td class="col-md-4">
515
- <div class="io-line">Defined in <a href="" data-line="51" class="link-to-prism">src/lib/share-button.directive.ts:51</a></div>
466
+ <div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/share-button.directive.ts:53</a></div>
516
467
  </td>
517
468
  </tr>
518
469
 
@@ -528,7 +479,6 @@
528
479
  <div class="tab-pane fade tab-source-code" id="source">
529
480
  <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
530
481
  Directive,
531
- HostListener,
532
482
  inject,
533
483
  Injectable,
534
484
  input,
@@ -573,6 +523,9 @@ export class ShareService {
573
523
  @Directive({
574
524
  selector: &#x27;[rxapShareButton],[rxapShare]&#x27;,
575
525
  standalone: true,
526
+ host: {
527
+ &#x27;(click)&#x27;: &#x27;share()&#x27;,
528
+ },
576
529
  })
577
530
  export class ShareButtonDirective {
578
531
 
@@ -586,7 +539,6 @@ export class ShareButtonDirective {
586
539
 
587
540
  private readonly shareService &#x3D; inject(ShareService);
588
541
 
589
- @HostListener(&#x27;click&#x27;)
590
542
  async share() {
591
543
  try {
592
544
  await this.shareService.share({
@@ -157,7 +157,6 @@
157
157
  <td class="col-md-4">
158
158
  <ul class="index-list">
159
159
  <li>
160
- <span class="modifier"></span>
161
160
  <span class="modifier">Public</span>
162
161
  <a href="#onClick" >onClick</a>
163
162
  </li>
@@ -168,20 +167,6 @@
168
167
 
169
168
 
170
169
 
171
- <tr>
172
- <td class="col-md-4">
173
- <h6><b>HostListeners</b></h6>
174
- </td>
175
- </tr>
176
- <tr>
177
- <td class="col-md-4">
178
- <ul class="index-list">
179
- <li>
180
- <a href="#click" >click</a>
181
- </li>
182
- </ul>
183
- </td>
184
- </tr>
185
170
 
186
171
  </tbody>
187
172
  </table>
@@ -191,38 +176,7 @@
191
176
 
192
177
 
193
178
 
194
- <section data-compodoc="block-host-listener">
195
- <h3>HostListeners</h3> <table class="table table-sm table-bordered">
196
- <tbody>
197
- <tr>
198
- <td class="col-md-4">
199
- <a name="click"></a>
200
- <span class="name">
201
- <b>
202
- click
203
- </b>
204
- <a href="#click"><span class="icon ion-ios-link"></span></a>
205
- </span>
206
- </td>
207
- </tr>
208
- <tr>
209
- <td class="col-md-4">
210
- <i>Arguments : </i><code>'$event' </code>
211
- </td>
212
- </tr>
213
-
214
-
215
- <tr>
216
- <td class="col-md-4">
217
- <div class="io-line">Defined in <a href="" data-line="13"
218
- class="link-to-prism">src/lib/stop-immediate-propagation.directive.ts:13</a></div>
219
- </td>
220
- </tr>
221
179
 
222
-
223
- </tbody>
224
- </table>
225
- </section>
226
180
  <section data-compodoc="block-methods">
227
181
 
228
182
  <h3 id="methods">
@@ -234,7 +188,6 @@
234
188
  <td class="col-md-4">
235
189
  <a name="onClick"></a>
236
190
  <span class="name">
237
- <span class="modifier"></span>
238
191
  <span class="modifier">Public</span>
239
192
  <span ><b>onClick</b></span>
240
193
  <a href="#onClick"><span class="icon ion-ios-link"></span></a>
@@ -248,18 +201,11 @@
248
201
  </td>
249
202
  </tr>
250
203
 
251
- <tr>
252
- <td class="col-md-4">
253
- <b>Decorators : </b>
254
- <br />
255
- <code>@HostListener(&#x27;click&#x27;, [&#x27;$event&#x27;])<br /></code>
256
- </td>
257
- </tr>
258
204
 
259
205
  <tr>
260
206
  <td class="col-md-4">
261
- <div class="io-line">Defined in <a href="" data-line="13"
262
- class="link-to-prism">src/lib/stop-immediate-propagation.directive.ts:13</a></div>
207
+ <div class="io-line">Defined in <a href="" data-line="11"
208
+ class="link-to-prism">src/lib/stop-immediate-propagation.directive.ts:11</a></div>
263
209
  </td>
264
210
  </tr>
265
211
 
@@ -312,25 +258,20 @@
312
258
 
313
259
 
314
260
  <div class="tab-pane fade tab-source-code" id="source">
315
- <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
316
- Directive,
317
- HostListener,
318
- } from &#x27;@angular/core&#x27;;
261
+ <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Directive } from &#x27;@angular/core&#x27;;
319
262
 
320
263
  @Directive({
321
264
  selector: &#x27;[rxapStopImmediatePropagation]&#x27;,
322
265
  standalone: true,
266
+ host: {
267
+ &#x27;(click)&#x27;: &#x27;onClick($event)&#x27;,
268
+ },
323
269
  })
324
270
  export class StopImmediatePropagationDirective {
325
-
326
- @HostListener(&#x27;click&#x27;, [ &#x27;$event&#x27; ])
327
271
  public onClick($event: Event): void {
328
272
  $event.stopImmediatePropagation();
329
273
  }
330
-
331
274
  }
332
-
333
-
334
275
  </code></pre>
335
276
  </div>
336
277
 
@@ -157,7 +157,6 @@
157
157
  <td class="col-md-4">
158
158
  <ul class="index-list">
159
159
  <li>
160
- <span class="modifier"></span>
161
160
  <span class="modifier">Public</span>
162
161
  <a href="#onClick" >onClick</a>
163
162
  </li>
@@ -168,20 +167,6 @@
168
167
 
169
168
 
170
169
 
171
- <tr>
172
- <td class="col-md-4">
173
- <h6><b>HostListeners</b></h6>
174
- </td>
175
- </tr>
176
- <tr>
177
- <td class="col-md-4">
178
- <ul class="index-list">
179
- <li>
180
- <a href="#click" >click</a>
181
- </li>
182
- </ul>
183
- </td>
184
- </tr>
185
170
 
186
171
  </tbody>
187
172
  </table>
@@ -191,38 +176,7 @@
191
176
 
192
177
 
193
178
 
194
- <section data-compodoc="block-host-listener">
195
- <h3>HostListeners</h3> <table class="table table-sm table-bordered">
196
- <tbody>
197
- <tr>
198
- <td class="col-md-4">
199
- <a name="click"></a>
200
- <span class="name">
201
- <b>
202
- click
203
- </b>
204
- <a href="#click"><span class="icon ion-ios-link"></span></a>
205
- </span>
206
- </td>
207
- </tr>
208
- <tr>
209
- <td class="col-md-4">
210
- <i>Arguments : </i><code>'$event' </code>
211
- </td>
212
- </tr>
213
-
214
-
215
- <tr>
216
- <td class="col-md-4">
217
- <div class="io-line">Defined in <a href="" data-line="13"
218
- class="link-to-prism">src/lib/stop-propagation.directive.ts:13</a></div>
219
- </td>
220
- </tr>
221
179
 
222
-
223
- </tbody>
224
- </table>
225
- </section>
226
180
  <section data-compodoc="block-methods">
227
181
 
228
182
  <h3 id="methods">
@@ -234,7 +188,6 @@
234
188
  <td class="col-md-4">
235
189
  <a name="onClick"></a>
236
190
  <span class="name">
237
- <span class="modifier"></span>
238
191
  <span class="modifier">Public</span>
239
192
  <span ><b>onClick</b></span>
240
193
  <a href="#onClick"><span class="icon ion-ios-link"></span></a>
@@ -248,18 +201,11 @@
248
201
  </td>
249
202
  </tr>
250
203
 
251
- <tr>
252
- <td class="col-md-4">
253
- <b>Decorators : </b>
254
- <br />
255
- <code>@HostListener(&#x27;click&#x27;, [&#x27;$event&#x27;])<br /></code>
256
- </td>
257
- </tr>
258
204
 
259
205
  <tr>
260
206
  <td class="col-md-4">
261
- <div class="io-line">Defined in <a href="" data-line="13"
262
- class="link-to-prism">src/lib/stop-propagation.directive.ts:13</a></div>
207
+ <div class="io-line">Defined in <a href="" data-line="11"
208
+ class="link-to-prism">src/lib/stop-propagation.directive.ts:11</a></div>
263
209
  </td>
264
210
  </tr>
265
211
 
@@ -312,25 +258,20 @@
312
258
 
313
259
 
314
260
  <div class="tab-pane fade tab-source-code" id="source">
315
- <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
316
- Directive,
317
- HostListener,
318
- } from &#x27;@angular/core&#x27;;
261
+ <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Directive } from &#x27;@angular/core&#x27;;
319
262
 
320
263
  @Directive({
321
264
  selector: &#x27;[rxapStopPropagation]&#x27;,
322
265
  standalone: true,
266
+ host: {
267
+ &#x27;(click)&#x27;: &#x27;onClick($event)&#x27;,
268
+ },
323
269
  })
324
270
  export class StopPropagationDirective {
325
-
326
- @HostListener(&#x27;click&#x27;, [ &#x27;$event&#x27; ])
327
271
  public onClick($event: Event): void {
328
272
  $event.stopPropagation();
329
273
  }
330
-
331
274
  }
332
-
333
-
334
275
  </code></pre>
335
276
  </div>
336
277
 
@@ -194,8 +194,8 @@
194
194
 
195
195
  <tr>
196
196
  <td class="col-md-4">
197
- <div class="io-line">Defined in <a href="" data-line="22"
198
- class="link-to-prism">src/lib/share-button.directive.ts:22</a></div>
197
+ <div class="io-line">Defined in <a href="" data-line="21"
198
+ class="link-to-prism">src/lib/share-button.directive.ts:21</a></div>
199
199
  </td>
200
200
  </tr>
201
201
 
@@ -283,7 +283,7 @@
283
283
  </tr>
284
284
  <tr>
285
285
  <td class="col-md-4">
286
- <div class="io-line">Defined in <a href="" data-line="20" class="link-to-prism">src/lib/share-button.directive.ts:20</a></div>
286
+ <div class="io-line">Defined in <a href="" data-line="19" class="link-to-prism">src/lib/share-button.directive.ts:19</a></div>
287
287
  </td>
288
288
  </tr>
289
289
 
@@ -298,7 +298,6 @@
298
298
  <div class="tab-pane fade tab-source-code" id="source">
299
299
  <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
300
300
  Directive,
301
- HostListener,
302
301
  inject,
303
302
  Injectable,
304
303
  input,
@@ -343,6 +342,9 @@ export class ShareService {
343
342
  @Directive({
344
343
  selector: &#x27;[rxapShareButton],[rxapShare]&#x27;,
345
344
  standalone: true,
345
+ host: {
346
+ &#x27;(click)&#x27;: &#x27;share()&#x27;,
347
+ },
346
348
  })
347
349
  export class ShareButtonDirective {
348
350
 
@@ -356,7 +358,6 @@ export class ShareButtonDirective {
356
358
 
357
359
  private readonly shareService &#x3D; inject(ShareService);
358
360
 
359
- @HostListener(&#x27;click&#x27;)
360
361
  async share() {
361
362
  try {
362
363
  await this.shareService.share({
@@ -240,15 +240,7 @@
240
240
 
241
241
 
242
242
  <div class="tab-pane fade tab-source-code" id="source">
243
- <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
244
- Directive,
245
- ElementRef,
246
- EventEmitter,
247
- HostBinding,
248
- HostListener,
249
- Input,
250
- Output,
251
- } from &#x27;@angular/core&#x27;;
243
+ <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Directive, ElementRef, input, linkedSignal, output, inject } from &#x27;@angular/core&#x27;;
252
244
  import { DebounceCall } from &#x27;@rxap/utilities&#x27;;
253
245
  import { Method } from &#x27;@rxap/pattern&#x27;;
254
246
 
@@ -260,60 +252,61 @@ export interface ContenteditableEvent {
260
252
  @Directive({
261
253
  selector: &#x27;[rxapContenteditable]&#x27;,
262
254
  standalone: true,
255
+ host: {
256
+ &#x27;[attr.contenteditable]&#x27;: &#x27;true&#x27;,
257
+ &#x27;[attr.spellcheck]&#x27;: &#x27;false&#x27;,
258
+ &#x27;(click)&#x27;: &#x27;onClick($event)&#x27;,
259
+ &#x27;(input)&#x27;: &#x27;onInput($event)&#x27;,
260
+ },
263
261
  })
264
262
  export class ContenteditableDirective {
263
+ private readonly elementRef &#x3D; inject(ElementRef);
265
264
 
266
- @HostBinding(&#x27;attr.contenteditable&#x27;)
267
- public contenteditable &#x3D; true;
268
265
 
269
- @HostBinding(&#x27;attr.spellcheck&#x27;)
270
- public spellcheck &#x3D; false;
266
+ public readonly method &#x3D; input&lt;Method&lt;any, ContenteditableEvent&gt;&gt;(undefined, { alias: &quot;rxapContenteditable&quot; });
271
267
 
272
- @Input(&#x27;rxapContenteditable&#x27;)
273
- public method?: Method&lt;any, ContenteditableEvent&gt;;
274
-
275
- @Output(&#x27;rxapContenteditable&#x27;)
276
268
  // eslint-disable-next-line @angular-eslint/no-output-native
277
- public change &#x3D; new EventEmitter&lt;ContenteditableEvent&gt;();
269
+ public readonly change &#x3D; output&lt;ContenteditableEvent&gt;({ alias: &#x27;rxapContenteditable&#x27; });
278
270
 
279
- @Input()
280
- public parameters?: any;
271
+ public readonly parameters &#x3D; input&lt;any&gt;();
281
272
 
282
- @Input()
283
- public initial?: string;
273
+ public readonly initialValue &#x3D; input&lt;string&gt;(undefined, { alias: &#x27;initial&#x27; });
284
274
 
285
- constructor(private readonly elementRef: ElementRef) {
286
- }
275
+ /**
276
+ * The last known good value. Follows the bound &#x60;initial&#x60; input and is
277
+ * updated after a successful save.
278
+ */
279
+ public readonly initial &#x3D; linkedSignal(() &#x3D;&gt; this.initialValue());
287
280
 
288
- @HostListener(&#x27;click&#x27;, [ &#x27;$event&#x27; ])
289
281
  public onClick($event: Event) {
290
282
  $event.stopPropagation();
291
283
  }
292
284
 
293
- @HostListener(&#x27;input&#x27;, [ &#x27;$event&#x27; ])
294
285
  @DebounceCall(1000)
295
286
  public async onInput($event: any) {
296
287
  const value &#x3D; (($event.target as HTMLElement).textContent)?.trim();
297
288
  if (value &amp;&amp; value.length &gt;&#x3D; 2) {
298
289
  const event: ContenteditableEvent &#x3D; {
299
290
  value,
300
- parameters: this.parameters,
291
+ parameters: this.parameters(),
301
292
  };
302
293
  this.change.emit(event);
303
294
  try {
304
- const result &#x3D; await this.method?.call(event);
295
+ const result &#x3D; await this.method()?.call(event);
305
296
  if (result &amp;&amp; typeof result &#x3D;&#x3D;&#x3D; &#x27;string&#x27;) {
306
297
  // the handler returned a canonical value - apply and remember it
307
- this.initial &#x3D; this.elementRef.nativeElement.innerText &#x3D; result;
298
+ this.elementRef.nativeElement.innerText &#x3D; result;
299
+ this.initial.set(result);
308
300
  } else {
309
301
  // successful save without a return value - keep the user&#x27;s text and
310
302
  // update the baseline (do NOT revert what was just typed)
311
- this.initial &#x3D; value;
303
+ this.initial.set(value);
312
304
  }
313
305
  } catch {
314
306
  // the save failed - revert to the last known good value if available
315
- if (this.initial) {
316
- this.elementRef.nativeElement.innerText &#x3D; this.initial;
307
+ const initial &#x3D; this.initial();
308
+ if (initial) {
309
+ this.elementRef.nativeElement.innerText &#x3D; initial;
317
310
  }
318
311
  }
319
312
  }