@rxap/directives 19.0.4 → 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.
- package/CHANGELOG.md +6 -0
- package/compodoc/changelog.html +5 -0
- package/compodoc/dependencies.html +4 -4
- package/compodoc/directives/ShareButtonDirective.html +234 -140
- package/compodoc/injectables/ShareService.html +109 -40
- package/compodoc/interfaces/ShareData.html +500 -0
- package/compodoc/js/menu-wc.js +3 -0
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/overview.html +1 -1
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +645 -478
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/AvatarBackgroundImageDirective.html +4 -4
- package/docs/html/classes/BackgroundImageDirective.html +4 -4
- package/docs/html/classes/ConfirmClick.html +2 -2
- package/docs/html/classes/ContenteditableDirective.html +2 -2
- package/docs/html/classes/FullWidthDirective.html +2 -2
- package/docs/html/classes/IfTruthyDirective.html +4 -4
- package/docs/html/classes/IsDevModeDirective.html +4 -4
- package/docs/html/classes/MethodDirective.html +4 -4
- package/docs/html/classes/MethodTemplateDirective.html +5 -5
- package/docs/html/classes/MovableDividerDirective.html +4 -4
- package/docs/html/classes/PreventDefaultDirective.html +2 -2
- package/docs/html/classes/ShareButtonDirective.html +5 -3
- package/docs/html/classes/ShareService.html +3 -2
- package/docs/html/classes/StopImmediatePropagationDirective.html +2 -2
- package/docs/html/classes/StopPropagationDirective.html +2 -2
- package/docs/html/enums/BackgroundPositionOptions.html +2 -2
- package/docs/html/enums/BackgroundRepeatOptions.html +2 -2
- package/docs/html/enums/BackgroundSizeOptions.html +2 -2
- package/docs/html/enums/GlobalStyleOptions.html +2 -2
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/ContenteditableEvent.html +2 -2
- package/docs/html/interfaces/IfTruthyDirectiveTemplateContext.html +2 -2
- package/docs/html/interfaces/MethodTemplateDirectiveContext.html +2 -2
- package/docs/html/interfaces/MethodTemplateDirectiveErrorContext.html +2 -2
- package/docs/html/interfaces/ShareData.html +5 -0
- package/docs/html/modules.html +1 -1
- package/docs/html/types/BackgroundPosition.html +1 -1
- package/docs/html/types/BackgroundRepeat.html +1 -1
- package/docs/html/types/BackgroundSize.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/AvatarBackgroundImageDirective.md +11 -11
- package/docs/markdown/classes/BackgroundImageDirective.md +10 -10
- package/docs/markdown/classes/ConfirmClick.md +6 -6
- package/docs/markdown/classes/ContenteditableDirective.md +11 -11
- package/docs/markdown/classes/FullWidthDirective.md +3 -3
- package/docs/markdown/classes/IfTruthyDirective.md +10 -10
- package/docs/markdown/classes/IsDevModeDirective.md +5 -5
- package/docs/markdown/classes/MethodDirective.md +19 -19
- package/docs/markdown/classes/MethodTemplateDirective.md +27 -27
- package/docs/markdown/classes/MovableDividerDirective.md +10 -10
- package/docs/markdown/classes/PreventDefaultDirective.md +3 -3
- package/docs/markdown/classes/ShareButtonDirective.md +30 -22
- package/docs/markdown/classes/ShareService.md +15 -17
- package/docs/markdown/classes/StopImmediatePropagationDirective.md +3 -3
- package/docs/markdown/classes/StopPropagationDirective.md +3 -3
- package/docs/markdown/enumerations/BackgroundPositionOptions.md +4 -4
- package/docs/markdown/enumerations/BackgroundRepeatOptions.md +3 -3
- package/docs/markdown/enumerations/BackgroundSizeOptions.md +5 -5
- package/docs/markdown/enumerations/GlobalStyleOptions.md +4 -4
- package/docs/markdown/globals.md +3 -2
- package/docs/markdown/interfaces/ContenteditableEvent.md +4 -4
- package/docs/markdown/interfaces/IfTruthyDirectiveTemplateContext.md +3 -3
- package/docs/markdown/interfaces/MethodTemplateDirectiveContext.md +3 -3
- package/docs/markdown/interfaces/MethodTemplateDirectiveErrorContext.md +4 -4
- package/docs/markdown/interfaces/ShareData.md +41 -0
- package/docs/markdown/type-aliases/BackgroundPosition.md +2 -2
- package/docs/markdown/type-aliases/BackgroundRepeat.md +2 -2
- package/docs/markdown/type-aliases/BackgroundSize.md +2 -2
- package/docs/wiki/Class.AvatarBackgroundImageDirective.md +10 -10
- package/docs/wiki/Class.BackgroundImageDirective.md +9 -9
- package/docs/wiki/Class.ConfirmClick.md +5 -5
- package/docs/wiki/Class.ContenteditableDirective.md +10 -10
- package/docs/wiki/Class.FullWidthDirective.md +2 -2
- package/docs/wiki/Class.IfTruthyDirective.md +9 -9
- package/docs/wiki/Class.IsDevModeDirective.md +4 -4
- package/docs/wiki/Class.MethodDirective.md +18 -18
- package/docs/wiki/Class.MethodTemplateDirective.md +26 -26
- package/docs/wiki/Class.MovableDividerDirective.md +9 -9
- package/docs/wiki/Class.PreventDefaultDirective.md +2 -2
- package/docs/wiki/Class.ShareButtonDirective.md +29 -21
- package/docs/wiki/Class.ShareService.md +14 -16
- package/docs/wiki/Class.StopImmediatePropagationDirective.md +2 -2
- package/docs/wiki/Class.StopPropagationDirective.md +2 -2
- package/docs/wiki/Enumeration.BackgroundPositionOptions.md +3 -3
- package/docs/wiki/Enumeration.BackgroundRepeatOptions.md +2 -2
- package/docs/wiki/Enumeration.BackgroundSizeOptions.md +4 -4
- package/docs/wiki/Enumeration.GlobalStyleOptions.md +3 -3
- package/docs/wiki/Interface.ContenteditableEvent.md +3 -3
- package/docs/wiki/Interface.IfTruthyDirectiveTemplateContext.md +2 -2
- package/docs/wiki/Interface.MethodTemplateDirectiveContext.md +2 -2
- package/docs/wiki/Interface.MethodTemplateDirectiveErrorContext.md +3 -3
- package/docs/wiki/Interface.ShareData.md +37 -0
- package/docs/wiki/TypeAlias.BackgroundPosition.md +1 -1
- package/docs/wiki/TypeAlias.BackgroundRepeat.md +1 -1
- package/docs/wiki/TypeAlias.BackgroundSize.md +1 -1
- package/docs/wiki/_Sidebar.md +1 -0
- package/docs/wiki/globals.md +2 -1
- package/fesm2022/rxap-directives.mjs +39 -34
- package/fesm2022/rxap-directives.mjs.map +1 -1
- package/lib/share-button.directive.d.ts +16 -14
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
|
|
6
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)
|
|
7
13
|
|
|
8
14
|
**Note:** Version bump only for package @rxap/directives
|
package/compodoc/changelog.html
CHANGED
|
@@ -85,6 +85,11 @@
|
|
|
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>
|
|
88
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>
|
|
89
94
|
<p><strong>Note:</strong> Version bump only for package @rxap/directives</p>
|
|
90
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>
|
|
@@ -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.14
|
|
118
|
+
<b>@rxap/pattern</b> : ^1.1.14</li>
|
|
119
119
|
<li>
|
|
120
|
-
<b>@rxap/rxjs</b> : ^1.1.16
|
|
120
|
+
<b>@rxap/rxjs</b> : ^1.1.16</li>
|
|
121
121
|
<li>
|
|
122
|
-
<b>@rxap/services</b> : ^19.0.4
|
|
122
|
+
<b>@rxap/services</b> : ^19.0.4</li>
|
|
123
123
|
<li>
|
|
124
|
-
<b>@rxap/utilities</b> : ^16.
|
|
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">
|
|
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<File></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="
|
|
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> <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="
|
|
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="
|
|
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="
|
|
375
|
-
class="link-to-prism">src/lib/share-button.directive.ts:
|
|
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">
|
|
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="
|
|
419
|
-
class="link-to-prism">src/lib/share-button.directive.ts:
|
|
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" >
|
|
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<any>()</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<File[] | undefined>()</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<void>()</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
|
-
|
|
534
|
+
input,
|
|
535
|
+
output,
|
|
447
536
|
} from '@angular/core';
|
|
448
|
-
|
|
537
|
+
|
|
538
|
+
export interface ShareData {
|
|
539
|
+
files?: File[];
|
|
540
|
+
text?: string;
|
|
541
|
+
title?: string;
|
|
542
|
+
url?: string;
|
|
543
|
+
}
|
|
449
544
|
|
|
450
545
|
@Injectable({ providedIn: 'root' })
|
|
451
546
|
export class ShareService {
|
|
452
547
|
|
|
453
|
-
|
|
548
|
+
readonly isSupported = 'share' in navigator && 'canShare' in navigator && typeof navigator.canShare === 'function' && typeof navigator.share === 'function';
|
|
549
|
+
|
|
550
|
+
async share(data: ShareData, softFail = true) {
|
|
454
551
|
|
|
455
|
-
if (this.
|
|
552
|
+
if (this.isSupported) {
|
|
456
553
|
|
|
457
|
-
if (
|
|
554
|
+
if (navigator.canShare(data)) {
|
|
458
555
|
|
|
459
|
-
await
|
|
556
|
+
await navigator.share(data);
|
|
460
557
|
|
|
461
558
|
} else {
|
|
462
|
-
console.
|
|
463
|
-
throw new Error('Can not share data
|
|
559
|
+
console.warn('Can not share data', data);
|
|
560
|
+
throw new Error('Can not share data');
|
|
464
561
|
}
|
|
465
562
|
|
|
563
|
+
} else if (softFail) {
|
|
564
|
+
console.warn(`Native share is not supported!`);
|
|
466
565
|
} else {
|
|
467
566
|
alert('Native share is not supported!');
|
|
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: '[rxapShareButton]',
|
|
574
|
+
selector: '[rxapShareButton],[rxapShare]',
|
|
480
575
|
standalone: true,
|
|
481
576
|
})
|
|
482
577
|
export class ShareButtonDirective {
|
|
483
578
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
public text!: string;
|
|
579
|
+
readonly url = input<string>();
|
|
580
|
+
readonly text = input<string>();
|
|
581
|
+
readonly title = input<string>();
|
|
582
|
+
readonly files = input<File[] | undefined>();
|
|
489
583
|
|
|
490
|
-
|
|
491
|
-
|
|
584
|
+
readonly failed = output<any>();
|
|
585
|
+
readonly success = output<void>();
|
|
492
586
|
|
|
493
|
-
|
|
494
|
-
public files?: ReadonlyArray<File>;
|
|
495
|
-
|
|
496
|
-
constructor(private readonly shareService: ShareService) {
|
|
497
|
-
}
|
|
587
|
+
private readonly shareService = inject(ShareService);
|
|
498
588
|
|
|
499
589
|
@HostListener('click')
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
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(`share failed: ${ err.message }`);
|
|
601
|
+
this.failed.emit(err);
|
|
602
|
+
}
|
|
509
603
|
}
|
|
510
604
|
|
|
511
605
|
}
|