@rxap/directives 19.0.4-dev.0 → 19.1.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 (107) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/compodoc/changelog.html +7 -0
  3. package/compodoc/dependencies.html +4 -4
  4. package/compodoc/directives/ShareButtonDirective.html +234 -140
  5. package/compodoc/injectables/ShareService.html +109 -40
  6. package/compodoc/interfaces/ShareData.html +500 -0
  7. package/compodoc/js/menu-wc.js +3 -0
  8. package/compodoc/js/menu-wc_es5.js +1 -1
  9. package/compodoc/js/search/search_index.js +2 -2
  10. package/compodoc/overview.html +1 -1
  11. package/compodoc/properties.html +1 -1
  12. package/docs/documentation.json +645 -478
  13. package/docs/html/assets/hierarchy.js +1 -1
  14. package/docs/html/assets/navigation.js +1 -1
  15. package/docs/html/assets/search.js +1 -1
  16. package/docs/html/classes/AvatarBackgroundImageDirective.html +4 -4
  17. package/docs/html/classes/BackgroundImageDirective.html +4 -4
  18. package/docs/html/classes/ConfirmClick.html +2 -2
  19. package/docs/html/classes/ContenteditableDirective.html +2 -2
  20. package/docs/html/classes/FullWidthDirective.html +2 -2
  21. package/docs/html/classes/IfTruthyDirective.html +4 -4
  22. package/docs/html/classes/IsDevModeDirective.html +4 -4
  23. package/docs/html/classes/MethodDirective.html +4 -4
  24. package/docs/html/classes/MethodTemplateDirective.html +5 -5
  25. package/docs/html/classes/MovableDividerDirective.html +4 -4
  26. package/docs/html/classes/PreventDefaultDirective.html +2 -2
  27. package/docs/html/classes/ShareButtonDirective.html +5 -3
  28. package/docs/html/classes/ShareService.html +3 -2
  29. package/docs/html/classes/StopImmediatePropagationDirective.html +2 -2
  30. package/docs/html/classes/StopPropagationDirective.html +2 -2
  31. package/docs/html/enums/BackgroundPositionOptions.html +2 -2
  32. package/docs/html/enums/BackgroundRepeatOptions.html +2 -2
  33. package/docs/html/enums/BackgroundSizeOptions.html +2 -2
  34. package/docs/html/enums/GlobalStyleOptions.html +2 -2
  35. package/docs/html/hierarchy.html +1 -1
  36. package/docs/html/index.html +2 -2
  37. package/docs/html/interfaces/ContenteditableEvent.html +2 -2
  38. package/docs/html/interfaces/IfTruthyDirectiveTemplateContext.html +2 -2
  39. package/docs/html/interfaces/MethodTemplateDirectiveContext.html +2 -2
  40. package/docs/html/interfaces/MethodTemplateDirectiveErrorContext.html +2 -2
  41. package/docs/html/interfaces/ShareData.html +5 -0
  42. package/docs/html/modules.html +1 -1
  43. package/docs/html/types/BackgroundPosition.html +1 -1
  44. package/docs/html/types/BackgroundRepeat.html +1 -1
  45. package/docs/html/types/BackgroundSize.html +1 -1
  46. package/docs/markdown/README.md +1 -1
  47. package/docs/markdown/classes/AvatarBackgroundImageDirective.md +11 -11
  48. package/docs/markdown/classes/BackgroundImageDirective.md +10 -10
  49. package/docs/markdown/classes/ConfirmClick.md +6 -6
  50. package/docs/markdown/classes/ContenteditableDirective.md +11 -11
  51. package/docs/markdown/classes/FullWidthDirective.md +3 -3
  52. package/docs/markdown/classes/IfTruthyDirective.md +10 -10
  53. package/docs/markdown/classes/IsDevModeDirective.md +5 -5
  54. package/docs/markdown/classes/MethodDirective.md +19 -19
  55. package/docs/markdown/classes/MethodTemplateDirective.md +27 -27
  56. package/docs/markdown/classes/MovableDividerDirective.md +10 -10
  57. package/docs/markdown/classes/PreventDefaultDirective.md +3 -3
  58. package/docs/markdown/classes/ShareButtonDirective.md +30 -22
  59. package/docs/markdown/classes/ShareService.md +15 -17
  60. package/docs/markdown/classes/StopImmediatePropagationDirective.md +3 -3
  61. package/docs/markdown/classes/StopPropagationDirective.md +3 -3
  62. package/docs/markdown/enumerations/BackgroundPositionOptions.md +4 -4
  63. package/docs/markdown/enumerations/BackgroundRepeatOptions.md +3 -3
  64. package/docs/markdown/enumerations/BackgroundSizeOptions.md +5 -5
  65. package/docs/markdown/enumerations/GlobalStyleOptions.md +4 -4
  66. package/docs/markdown/globals.md +3 -2
  67. package/docs/markdown/interfaces/ContenteditableEvent.md +4 -4
  68. package/docs/markdown/interfaces/IfTruthyDirectiveTemplateContext.md +3 -3
  69. package/docs/markdown/interfaces/MethodTemplateDirectiveContext.md +3 -3
  70. package/docs/markdown/interfaces/MethodTemplateDirectiveErrorContext.md +4 -4
  71. package/docs/markdown/interfaces/ShareData.md +41 -0
  72. package/docs/markdown/type-aliases/BackgroundPosition.md +2 -2
  73. package/docs/markdown/type-aliases/BackgroundRepeat.md +2 -2
  74. package/docs/markdown/type-aliases/BackgroundSize.md +2 -2
  75. package/docs/wiki/Class.AvatarBackgroundImageDirective.md +10 -10
  76. package/docs/wiki/Class.BackgroundImageDirective.md +9 -9
  77. package/docs/wiki/Class.ConfirmClick.md +5 -5
  78. package/docs/wiki/Class.ContenteditableDirective.md +10 -10
  79. package/docs/wiki/Class.FullWidthDirective.md +2 -2
  80. package/docs/wiki/Class.IfTruthyDirective.md +9 -9
  81. package/docs/wiki/Class.IsDevModeDirective.md +4 -4
  82. package/docs/wiki/Class.MethodDirective.md +18 -18
  83. package/docs/wiki/Class.MethodTemplateDirective.md +26 -26
  84. package/docs/wiki/Class.MovableDividerDirective.md +9 -9
  85. package/docs/wiki/Class.PreventDefaultDirective.md +2 -2
  86. package/docs/wiki/Class.ShareButtonDirective.md +29 -21
  87. package/docs/wiki/Class.ShareService.md +14 -16
  88. package/docs/wiki/Class.StopImmediatePropagationDirective.md +2 -2
  89. package/docs/wiki/Class.StopPropagationDirective.md +2 -2
  90. package/docs/wiki/Enumeration.BackgroundPositionOptions.md +3 -3
  91. package/docs/wiki/Enumeration.BackgroundRepeatOptions.md +2 -2
  92. package/docs/wiki/Enumeration.BackgroundSizeOptions.md +4 -4
  93. package/docs/wiki/Enumeration.GlobalStyleOptions.md +3 -3
  94. package/docs/wiki/Interface.ContenteditableEvent.md +3 -3
  95. package/docs/wiki/Interface.IfTruthyDirectiveTemplateContext.md +2 -2
  96. package/docs/wiki/Interface.MethodTemplateDirectiveContext.md +2 -2
  97. package/docs/wiki/Interface.MethodTemplateDirectiveErrorContext.md +3 -3
  98. package/docs/wiki/Interface.ShareData.md +37 -0
  99. package/docs/wiki/TypeAlias.BackgroundPosition.md +1 -1
  100. package/docs/wiki/TypeAlias.BackgroundRepeat.md +1 -1
  101. package/docs/wiki/TypeAlias.BackgroundSize.md +1 -1
  102. package/docs/wiki/_Sidebar.md +1 -0
  103. package/docs/wiki/globals.md +2 -1
  104. package/fesm2022/rxap-directives.mjs +39 -34
  105. package/fesm2022/rxap-directives.mjs.map +1 -1
  106. package/lib/share-button.directive.d.ts +16 -14
  107. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [19.1.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/directives@19.0.4...@rxap/directives@19.1.0-dev.0) (2025-09-23)
7
+
8
+ ### Features
9
+
10
+ - **angular:** enhance share button directive with input/output properties and improved share service ([7523b36](https://gitlab.com/rxap/packages/commit/7523b36eee54cda6150facc9950e95abe834d29a))
11
+
12
+ ## [19.0.4](https://gitlab.com/rxap/packages/compare/@rxap/directives@19.0.4-dev.0...@rxap/directives@19.0.4) (2025-05-16)
13
+
14
+ **Note:** Version bump only for package @rxap/directives
15
+
6
16
  ## [19.0.4-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/directives@19.0.3...@rxap/directives@19.0.4-dev.0) (2025-03-12)
7
17
 
8
18
  **Note:** Version bump only for package @rxap/directives
@@ -85,6 +85,13 @@
85
85
  <h1>Change Log</h1>
86
86
  <p>All notable changes to this project will be documented in this file.
87
87
  See <a href="https://conventionalcommits.org">Conventional Commits</a> for commit guidelines.</p>
88
+ <h1><a href="https://gitlab.com/rxap/packages/compare/@rxap/directives@19.0.4...@rxap/directives@19.1.0-dev.0">19.1.0-dev.0</a> (2025-09-23)</h1>
89
+ <h3>Features</h3>
90
+ <ul>
91
+ <li><strong>angular:</strong> enhance share button directive with input/output properties and improved share service (<a href="https://gitlab.com/rxap/packages/commit/7523b36eee54cda6150facc9950e95abe834d29a">7523b36</a>)</li>
92
+ </ul>
93
+ <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/directives@19.0.4-dev.0...@rxap/directives@19.0.4">19.0.4</a> (2025-05-16)</h2>
94
+ <p><strong>Note:</strong> Version bump only for package @rxap/directives</p>
88
95
  <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/directives@19.0.3...@rxap/directives@19.0.4-dev.0">19.0.4-dev.0</a> (2025-03-12)</h2>
89
96
  <p><strong>Note:</strong> Version bump only for package @rxap/directives</p>
90
97
  <h2><a href="https://gitlab.com/rxap/packages/compare/@rxap/directives@19.0.3-dev.2...@rxap/directives@19.0.3">19.0.3</a> (2025-03-07)</h2>
@@ -115,13 +115,13 @@
115
115
  <li>
116
116
  <b>@angular/core</b> : ^19.2.1</li>
117
117
  <li>
118
- <b>@rxap/pattern</b> : ^1.1.13</li>
118
+ <b>@rxap/pattern</b> : ^1.1.14</li>
119
119
  <li>
120
- <b>@rxap/rxjs</b> : ^1.1.15</li>
120
+ <b>@rxap/rxjs</b> : ^1.1.16</li>
121
121
  <li>
122
- <b>@rxap/services</b> : ^19.0.3</li>
122
+ <b>@rxap/services</b> : ^19.0.4</li>
123
123
  <li>
124
- <b>@rxap/utilities</b> : ^16.4.3</li>
124
+ <b>@rxap/utilities</b> : ^16.5.0-dev.0</li>
125
125
  <li>
126
126
  <b>rxjs</b> : ^7.8.1</li>
127
127
  </ul>
@@ -129,7 +129,7 @@
129
129
 
130
130
  <tr>
131
131
  <td class="col-md-3">Selector</td>
132
- <td class="col-md-9"><code>[rxapShareButton]</code></td>
132
+ <td class="col-md-9"><code>[rxapShareButton],[rxapShare]</code></td>
133
133
  </tr>
134
134
 
135
135
  <tr>
@@ -147,6 +147,41 @@
147
147
  <h3 id="index">Index</h3>
148
148
  <table class="table table-sm table-bordered index-table">
149
149
  <tbody>
150
+ <tr>
151
+ <td class="col-md-4">
152
+ <h6><b>Properties</b></h6>
153
+ </td>
154
+ </tr>
155
+ <tr>
156
+ <td class="col-md-4">
157
+ <ul class="index-list">
158
+ <li>
159
+ <span class="modifier">Readonly</span>
160
+ <a href="#failed" >failed</a>
161
+ </li>
162
+ <li>
163
+ <span class="modifier">Readonly</span>
164
+ <a href="#files" >files</a>
165
+ </li>
166
+ <li>
167
+ <span class="modifier">Readonly</span>
168
+ <a href="#success" >success</a>
169
+ </li>
170
+ <li>
171
+ <span class="modifier">Readonly</span>
172
+ <a href="#text" >text</a>
173
+ </li>
174
+ <li>
175
+ <span class="modifier">Readonly</span>
176
+ <a href="#title" >title</a>
177
+ </li>
178
+ <li>
179
+ <span class="modifier">Readonly</span>
180
+ <a href="#url" >url</a>
181
+ </li>
182
+ </ul>
183
+ </td>
184
+ </tr>
150
185
 
151
186
  <tr>
152
187
  <td class="col-md-4">
@@ -158,7 +193,7 @@
158
193
  <ul class="index-list">
159
194
  <li>
160
195
  <span class="modifier"></span>
161
- <span class="modifier">Public</span>
196
+ <span class="modifier">Async</span>
162
197
  <a href="#share" >share</a>
163
198
  </li>
164
199
  </ul>
@@ -173,9 +208,6 @@
173
208
  <tr>
174
209
  <td class="col-md-4">
175
210
  <ul class="index-list">
176
- <li>
177
- <a href="#files" >files</a>
178
- </li>
179
211
  <li>
180
212
  <a href="#text" >text</a>
181
213
  </li>
@@ -210,78 +242,9 @@
210
242
  </table>
211
243
  </section>
212
244
 
213
- <section data-compodoc="block-constructor">
214
- <h3 id="constructor">Constructor</h3>
215
- <table class="table table-sm table-bordered">
216
- <tbody>
217
- <tr>
218
- <td class="col-md-4">
219
- <code>constructor(shareService: <a href="../injectables/ShareService.html" target="_self">ShareService</a>)</code>
220
- </td>
221
- </tr>
222
- <tr>
223
- <td class="col-md-4">
224
- <div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/share-button.directive.ts:53</a></div>
225
- </td>
226
- </tr>
227
-
228
- <tr>
229
- <td class="col-md-4">
230
- <div>
231
- <b>Parameters :</b>
232
- <table class="params">
233
- <thead>
234
- <tr>
235
- <td>Name</td>
236
- <td>Type</td>
237
- <td>Optional</td>
238
- </tr>
239
- </thead>
240
- <tbody>
241
- <tr>
242
- <td>shareService</td>
243
-
244
- <td>
245
- <code><a href="../injectables/ShareService.html" target="_self" >ShareService</a></code>
246
- </td>
247
-
248
- <td>
249
- No
250
- </td>
251
-
252
- </tr>
253
- </tbody>
254
- </table>
255
- </div>
256
- </td>
257
- </tr>
258
- </tbody>
259
- </table>
260
- </section>
261
245
 
262
246
  <section data-compodoc="block-inputs">
263
247
  <h3 id="inputs">Inputs</h3>
264
- <table class="table table-sm table-bordered">
265
- <tbody>
266
- <tr>
267
- <td class="col-md-4">
268
- <a name="files"></a>
269
- <b>files</b>
270
- </td>
271
- </tr>
272
- <tr>
273
- <td class="col-md-4">
274
- <i>Type : </i> <code>ReadonlyArray&lt;File&gt;</code>
275
-
276
- </td>
277
- </tr>
278
- <tr>
279
- <td class="col-md-2" colspan="2">
280
- <div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/share-button.directive.ts:53</a></div>
281
- </td>
282
- </tr>
283
- </tbody>
284
- </table>
285
248
  <table class="table table-sm table-bordered">
286
249
  <tbody>
287
250
  <tr>
@@ -289,16 +252,10 @@
289
252
  <a name="text"></a>
290
253
  <b>text</b>
291
254
  </td>
292
- </tr>
293
- <tr>
294
- <td class="col-md-4">
295
- <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
296
-
297
- </td>
298
255
  </tr>
299
256
  <tr>
300
257
  <td class="col-md-2" colspan="2">
301
- <div class="io-line">Defined in <a href="" data-line="47" class="link-to-prism">src/lib/share-button.directive.ts:47</a></div>
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>
302
259
  </td>
303
260
  </tr>
304
261
  </tbody>
@@ -310,21 +267,10 @@
310
267
  <a name="title"></a>
311
268
  <b>title</b>
312
269
  </td>
313
- </tr>
314
- <tr>
315
- <td class="col-md-4">
316
- <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
317
-
318
- </td>
319
- </tr>
320
- <tr>
321
- <td class="col-md-4">
322
- <i>Required : </i>&nbsp;<b>true</b>
323
- </td>
324
270
  </tr>
325
271
  <tr>
326
272
  <td class="col-md-2" colspan="2">
327
- <div class="io-line">Defined in <a href="" data-line="50" class="link-to-prism">src/lib/share-button.directive.ts:50</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>
328
274
  </td>
329
275
  </tr>
330
276
  </tbody>
@@ -336,16 +282,10 @@
336
282
  <a name="url"></a>
337
283
  <b>url</b>
338
284
  </td>
339
- </tr>
340
- <tr>
341
- <td class="col-md-4">
342
- <i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
343
-
344
- </td>
345
285
  </tr>
346
286
  <tr>
347
287
  <td class="col-md-2" colspan="2">
348
- <div class="io-line">Defined in <a href="" data-line="44" class="link-to-prism">src/lib/share-button.directive.ts:44</a></div>
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>
349
289
  </td>
350
290
  </tr>
351
291
  </tbody>
@@ -371,8 +311,8 @@
371
311
 
372
312
  <tr>
373
313
  <td class="col-md-4">
374
- <div class="io-line">Defined in <a href="" data-line="59"
375
- class="link-to-prism">src/lib/share-button.directive.ts:59</a></div>
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>
376
316
  </td>
377
317
  </tr>
378
318
 
@@ -392,7 +332,7 @@
392
332
  <a name="share"></a>
393
333
  <span class="name">
394
334
  <span class="modifier"></span>
395
- <span class="modifier">Public</span>
335
+ <span class="modifier">Async</span>
396
336
  <span ><b>share</b></span>
397
337
  <a href="#share"><span class="icon ion-ios-link"></span></a>
398
338
  </span>
@@ -415,8 +355,8 @@
415
355
 
416
356
  <tr>
417
357
  <td class="col-md-4">
418
- <div class="io-line">Defined in <a href="" data-line="59"
419
- class="link-to-prism">src/lib/share-button.directive.ts:59</a></div>
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>
420
360
  </td>
421
361
  </tr>
422
362
 
@@ -425,7 +365,7 @@
425
365
  <td class="col-md-4">
426
366
 
427
367
  <div class="io-description">
428
- <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
368
+ <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
429
369
 
430
370
  </div>
431
371
  </td>
@@ -433,6 +373,153 @@
433
373
  </tbody>
434
374
  </table>
435
375
  </section>
376
+ <section data-compodoc="block-properties">
377
+
378
+ <h3 id="inputs">
379
+ Properties
380
+ </h3>
381
+ <table class="table table-sm table-bordered">
382
+ <tbody>
383
+ <tr>
384
+ <td class="col-md-4">
385
+ <a name="failed"></a>
386
+ <span class="name">
387
+ <span class="modifier">Readonly</span>
388
+ <span ><b>failed</b></span>
389
+ <a href="#failed"><span class="icon ion-ios-link"></span></a>
390
+ </span>
391
+ </td>
392
+ </tr>
393
+ <tr>
394
+ <td class="col-md-4">
395
+ <i>Default value : </i><code>output&lt;any&gt;()</code>
396
+ </td>
397
+ </tr>
398
+ <tr>
399
+ <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>
401
+ </td>
402
+ </tr>
403
+
404
+
405
+ </tbody>
406
+ </table>
407
+ <table class="table table-sm table-bordered">
408
+ <tbody>
409
+ <tr>
410
+ <td class="col-md-4">
411
+ <a name="files"></a>
412
+ <span class="name">
413
+ <span class="modifier">Readonly</span>
414
+ <span ><b>files</b></span>
415
+ <a href="#files"><span class="icon ion-ios-link"></span></a>
416
+ </span>
417
+ </td>
418
+ </tr>
419
+ <tr>
420
+ <td class="col-md-4">
421
+ <i>Default value : </i><code>input&lt;File[] | undefined&gt;()</code>
422
+ </td>
423
+ </tr>
424
+ <tr>
425
+ <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>
427
+ </td>
428
+ </tr>
429
+
430
+
431
+ </tbody>
432
+ </table>
433
+ <table class="table table-sm table-bordered">
434
+ <tbody>
435
+ <tr>
436
+ <td class="col-md-4">
437
+ <a name="success"></a>
438
+ <span class="name">
439
+ <span class="modifier">Readonly</span>
440
+ <span ><b>success</b></span>
441
+ <a href="#success"><span class="icon ion-ios-link"></span></a>
442
+ </span>
443
+ </td>
444
+ </tr>
445
+ <tr>
446
+ <td class="col-md-4">
447
+ <i>Default value : </i><code>output&lt;void&gt;()</code>
448
+ </td>
449
+ </tr>
450
+ <tr>
451
+ <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>
453
+ </td>
454
+ </tr>
455
+
456
+
457
+ </tbody>
458
+ </table>
459
+ <table class="table table-sm table-bordered">
460
+ <tbody>
461
+ <tr>
462
+ <td class="col-md-4">
463
+ <a name="text"></a>
464
+ <span class="name">
465
+ <span class="modifier">Readonly</span>
466
+ <span ><b>text</b></span>
467
+ <a href="#text"><span class="icon ion-ios-link"></span></a>
468
+ </span>
469
+ </td>
470
+ </tr>
471
+ <tr>
472
+ <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>
474
+ </td>
475
+ </tr>
476
+
477
+
478
+ </tbody>
479
+ </table>
480
+ <table class="table table-sm table-bordered">
481
+ <tbody>
482
+ <tr>
483
+ <td class="col-md-4">
484
+ <a name="title"></a>
485
+ <span class="name">
486
+ <span class="modifier">Readonly</span>
487
+ <span ><b>title</b></span>
488
+ <a href="#title"><span class="icon ion-ios-link"></span></a>
489
+ </span>
490
+ </td>
491
+ </tr>
492
+ <tr>
493
+ <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>
495
+ </td>
496
+ </tr>
497
+
498
+
499
+ </tbody>
500
+ </table>
501
+ <table class="table table-sm table-bordered">
502
+ <tbody>
503
+ <tr>
504
+ <td class="col-md-4">
505
+ <a name="url"></a>
506
+ <span class="name">
507
+ <span class="modifier">Readonly</span>
508
+ <span ><b>url</b></span>
509
+ <a href="#url"><span class="icon ion-ios-link"></span></a>
510
+ </span>
511
+ </td>
512
+ </tr>
513
+ <tr>
514
+ <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>
516
+ </td>
517
+ </tr>
518
+
519
+
520
+ </tbody>
521
+ </table>
522
+ </section>
436
523
 
437
524
 
438
525
  </div>
@@ -442,70 +529,77 @@
442
529
  <pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
443
530
  Directive,
444
531
  HostListener,
532
+ inject,
445
533
  Injectable,
446
- Input,
534
+ input,
535
+ output,
447
536
  } from &#x27;@angular/core&#x27;;
448
- import { Required } from &#x27;@rxap/utilities&#x27;;
537
+
538
+ export interface ShareData {
539
+ files?: File[];
540
+ text?: string;
541
+ title?: string;
542
+ url?: string;
543
+ }
449
544
 
450
545
  @Injectable({ providedIn: &#x27;root&#x27; })
451
546
  export class ShareService {
452
547
 
453
- public async share(data: { url?: string, text?: string, title?: string, files?: ReadonlyArray&lt;File&gt; }) {
548
+ readonly isSupported &#x3D; &#x27;share&#x27; in navigator &amp;&amp; &#x27;canShare&#x27; in navigator &amp;&amp; typeof navigator.canShare &#x3D;&#x3D;&#x3D; &#x27;function&#x27; &amp;&amp; typeof navigator.share &#x3D;&#x3D;&#x3D; &#x27;function&#x27;;
549
+
550
+ async share(data: ShareData, softFail &#x3D; true) {
454
551
 
455
- if (this.isShareSupported()) {
552
+ if (this.isSupported) {
456
553
 
457
- if ((navigator as any).canShare(data)) {
554
+ if (navigator.canShare(data)) {
458
555
 
459
- await (navigator as any).share(data);
556
+ await navigator.share(data);
460
557
 
461
558
  } else {
462
- console.debug(&#x27;share data:&#x27;, data);
463
- throw new Error(&#x27;Can not share data. Data is invalid!&#x27;);
559
+ console.warn(&#x27;Can not share data&#x27;, data);
560
+ throw new Error(&#x27;Can not share data&#x27;);
464
561
  }
465
562
 
563
+ } else if (softFail) {
564
+ console.warn(&#x60;Native share is not supported!&#x60;);
466
565
  } else {
467
566
  alert(&#x27;Native share is not supported!&#x27;);
468
567
  }
469
568
 
470
569
  }
471
570
 
472
- private isShareSupported(): boolean {
473
- return !!(navigator as any).share;
474
- }
475
-
476
571
  }
477
572
 
478
573
  @Directive({
479
- selector: &#x27;[rxapShareButton]&#x27;,
574
+ selector: &#x27;[rxapShareButton],[rxapShare]&#x27;,
480
575
  standalone: true,
481
576
  })
482
577
  export class ShareButtonDirective {
483
578
 
484
- @Input()
485
- public url!: string;
486
-
487
- @Input()
488
- public text!: string;
579
+ readonly url &#x3D; input&lt;string&gt;();
580
+ readonly text &#x3D; input&lt;string&gt;();
581
+ readonly title &#x3D; input&lt;string&gt;();
582
+ readonly files &#x3D; input&lt;File[] | undefined&gt;();
489
583
 
490
- @Input({ required: true })
491
- public title!: string;
584
+ readonly failed &#x3D; output&lt;any&gt;();
585
+ readonly success &#x3D; output&lt;void&gt;();
492
586
 
493
- @Input()
494
- public files?: ReadonlyArray&lt;File&gt;;
495
-
496
- constructor(private readonly shareService: ShareService) {
497
- }
587
+ private readonly shareService &#x3D; inject(ShareService);
498
588
 
499
589
  @HostListener(&#x27;click&#x27;)
500
- public share() {
501
- this.shareService.share({
502
- url: this.url,
503
- text: this.text,
504
- files: this.files,
505
- title: this.title,
506
- })
507
- .then(() &#x3D;&gt; console.log(&#x27;share successfully&#x27;))
508
- .catch(err &#x3D;&gt; console.error(&#x27;share failed&#x27;, err.message));
590
+ async share() {
591
+ try {
592
+ await this.shareService.share({
593
+ url: this.url(),
594
+ text: this.text(),
595
+ files: this.files(),
596
+ title: this.title(),
597
+ });
598
+ this.success.emit();
599
+ } catch (err: any) {
600
+ console.error(&#x60;share failed: ${ err.message }&#x60;);
601
+ this.failed.emit(err);
602
+ }
509
603
  }
510
604
 
511
605
  }