@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.
- package/CHANGELOG.md +19 -0
- package/compodoc/changelog.html +18 -0
- package/compodoc/dependencies.html +4 -4
- package/compodoc/directives/AvatarBackgroundImageDirective.html +216 -386
- package/compodoc/directives/BackgroundImageDirective.html +230 -243
- package/compodoc/directives/ConfirmClick.html +466 -0
- package/compodoc/directives/ContenteditableDirective.html +137 -373
- package/compodoc/directives/FullWidthDirective.html +8 -139
- package/compodoc/directives/IfTruthyDirective.html +136 -182
- package/compodoc/directives/IsDevModeDirective.html +4 -74
- package/compodoc/directives/MethodDirective.html +272 -346
- package/compodoc/directives/MethodTemplateDirective.html +736 -697
- package/compodoc/directives/MovableDividerDirective.html +103 -243
- package/compodoc/directives/PreventDefaultDirective.html +6 -65
- package/compodoc/directives/ShareButtonDirective.html +14 -62
- package/compodoc/directives/StopImmediatePropagationDirective.html +6 -65
- package/compodoc/directives/StopPropagationDirective.html +6 -65
- package/compodoc/injectables/ShareService.html +6 -5
- package/compodoc/interfaces/ContenteditableEvent.html +25 -32
- package/compodoc/interfaces/IfTruthyDirectiveTemplateContext.html +22 -36
- package/compodoc/interfaces/MethodTemplateDirectiveContext.html +42 -66
- package/compodoc/interfaces/MethodTemplateDirectiveErrorContext.html +42 -66
- package/compodoc/interfaces/ShareData.html +3 -2
- package/compodoc/js/menu-wc.js +3 -3
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/overview.html +2 -2
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +2432 -3183
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/AvatarBackgroundImageDirective.html +9 -16
- package/docs/html/classes/BackgroundImageDirective.html +8 -17
- package/docs/html/classes/ConfirmClick.html +3 -3
- package/docs/html/classes/ContenteditableDirective.html +8 -7
- package/docs/html/classes/FullWidthDirective.html +2 -3
- package/docs/html/classes/IfTruthyDirective.html +3 -9
- package/docs/html/classes/IsDevModeDirective.html +4 -4
- package/docs/html/classes/MethodDirective.html +8 -7
- package/docs/html/classes/MethodTemplateDirective.html +10 -15
- package/docs/html/classes/MovableDividerDirective.html +3 -13
- package/docs/html/classes/PreventDefaultDirective.html +2 -2
- package/docs/html/classes/ShareButtonDirective.html +2 -2
- package/docs/html/classes/ShareService.html +2 -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 +2 -2
- 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 +40 -101
- package/docs/markdown/classes/BackgroundImageDirective.md +24 -81
- package/docs/markdown/classes/ConfirmClick.md +8 -20
- package/docs/markdown/classes/ContenteditableDirective.md +21 -34
- package/docs/markdown/classes/FullWidthDirective.md +2 -10
- package/docs/markdown/classes/IfTruthyDirective.md +14 -69
- package/docs/markdown/classes/IsDevModeDirective.md +5 -17
- package/docs/markdown/classes/MethodDirective.md +40 -44
- package/docs/markdown/classes/MethodTemplateDirective.md +50 -84
- package/docs/markdown/classes/MovableDividerDirective.md +11 -71
- package/docs/markdown/classes/PreventDefaultDirective.md +3 -3
- package/docs/markdown/classes/ShareButtonDirective.md +9 -9
- package/docs/markdown/classes/ShareService.md +4 -4
- 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 +2 -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 +6 -6
- 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 +39 -100
- package/docs/wiki/Class.BackgroundImageDirective.md +23 -80
- package/docs/wiki/Class.ConfirmClick.md +7 -19
- package/docs/wiki/Class.ContenteditableDirective.md +20 -33
- package/docs/wiki/Class.FullWidthDirective.md +1 -9
- package/docs/wiki/Class.IfTruthyDirective.md +13 -68
- package/docs/wiki/Class.IsDevModeDirective.md +4 -16
- package/docs/wiki/Class.MethodDirective.md +39 -43
- package/docs/wiki/Class.MethodTemplateDirective.md +49 -83
- package/docs/wiki/Class.MovableDividerDirective.md +10 -70
- package/docs/wiki/Class.PreventDefaultDirective.md +2 -2
- package/docs/wiki/Class.ShareButtonDirective.md +8 -8
- package/docs/wiki/Class.ShareService.md +3 -3
- 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 +5 -5
- 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/globals.md +1 -1
- package/fesm2022/rxap-directives.mjs +259 -360
- package/fesm2022/rxap-directives.mjs.map +1 -1
- package/package.json +9 -9
- package/types/rxap-directives.d.ts +104 -102
|
@@ -120,13 +120,6 @@
|
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
|
|
123
|
-
<p class="comment">
|
|
124
|
-
<h3>Implements</h3>
|
|
125
|
-
</p>
|
|
126
|
-
<p class="comment">
|
|
127
|
-
<code>OnChanges</code>
|
|
128
|
-
<code>OnInit</code>
|
|
129
|
-
</p>
|
|
130
123
|
|
|
131
124
|
|
|
132
125
|
<section data-compodoc="block-metadata">
|
|
@@ -154,29 +147,42 @@
|
|
|
154
147
|
<h3 id="index">Index</h3>
|
|
155
148
|
<table class="table table-sm table-bordered index-table">
|
|
156
149
|
<tbody>
|
|
157
|
-
|
|
158
|
-
|
|
159
150
|
<tr>
|
|
160
151
|
<td class="col-md-4">
|
|
161
|
-
<h6><b>
|
|
152
|
+
<h6><b>Properties</b></h6>
|
|
162
153
|
</td>
|
|
163
154
|
</tr>
|
|
164
155
|
<tr>
|
|
165
156
|
<td class="col-md-4">
|
|
166
157
|
<ul class="index-list">
|
|
167
158
|
<li>
|
|
159
|
+
<span class="modifier">Public</span>
|
|
160
|
+
<span class="modifier">Readonly</span>
|
|
161
|
+
<a href="#imageUrl" >imageUrl</a>
|
|
162
|
+
</li>
|
|
163
|
+
<li>
|
|
164
|
+
<span class="modifier">Protected</span>
|
|
165
|
+
<span class="modifier">Readonly</span>
|
|
166
|
+
<a href="#placeholder" >placeholder</a>
|
|
167
|
+
</li>
|
|
168
|
+
<li>
|
|
169
|
+
<span class="modifier">Public</span>
|
|
170
|
+
<span class="modifier">Readonly</span>
|
|
168
171
|
<a href="#placeholderImageUrl" >placeholderImageUrl</a>
|
|
169
172
|
</li>
|
|
170
173
|
<li>
|
|
174
|
+
<span class="modifier">Public</span>
|
|
175
|
+
<span class="modifier">Readonly</span>
|
|
171
176
|
<a href="#position" >position</a>
|
|
172
177
|
</li>
|
|
173
178
|
<li>
|
|
179
|
+
<span class="modifier">Public</span>
|
|
180
|
+
<span class="modifier">Readonly</span>
|
|
174
181
|
<a href="#repeat" >repeat</a>
|
|
175
182
|
</li>
|
|
176
183
|
<li>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
<li>
|
|
184
|
+
<span class="modifier">Public</span>
|
|
185
|
+
<span class="modifier">Readonly</span>
|
|
180
186
|
<a href="#size" >size</a>
|
|
181
187
|
</li>
|
|
182
188
|
</ul>
|
|
@@ -186,6 +192,8 @@
|
|
|
186
192
|
|
|
187
193
|
|
|
188
194
|
|
|
195
|
+
|
|
196
|
+
|
|
189
197
|
</tbody>
|
|
190
198
|
</table>
|
|
191
199
|
</section>
|
|
@@ -196,206 +204,206 @@
|
|
|
196
204
|
<tbody>
|
|
197
205
|
<tr>
|
|
198
206
|
<td class="col-md-4">
|
|
199
|
-
<code>constructor(
|
|
207
|
+
<code>constructor()</code>
|
|
200
208
|
</td>
|
|
201
209
|
</tr>
|
|
202
210
|
<tr>
|
|
203
211
|
<td class="col-md-4">
|
|
204
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
212
|
+
<div class="io-line">Defined in <a href="" data-line="65" class="link-to-prism">src/lib/background-image.directive.ts:65</a></div>
|
|
205
213
|
</td>
|
|
206
214
|
</tr>
|
|
207
215
|
|
|
208
|
-
<tr>
|
|
209
|
-
<td class="col-md-4">
|
|
210
|
-
<div>
|
|
211
|
-
<b>Parameters :</b>
|
|
212
|
-
<table class="params">
|
|
213
|
-
<thead>
|
|
214
|
-
<tr>
|
|
215
|
-
<td>Name</td>
|
|
216
|
-
<td>Type</td>
|
|
217
|
-
<td>Optional</td>
|
|
218
|
-
</tr>
|
|
219
|
-
</thead>
|
|
220
|
-
<tbody>
|
|
221
|
-
<tr>
|
|
222
|
-
<td>host</td>
|
|
223
|
-
|
|
224
|
-
<td>
|
|
225
|
-
<code>ElementRef</code>
|
|
226
|
-
</td>
|
|
227
|
-
|
|
228
|
-
<td>
|
|
229
|
-
No
|
|
230
|
-
</td>
|
|
231
|
-
|
|
232
|
-
</tr>
|
|
233
|
-
<tr>
|
|
234
|
-
<td>renderer</td>
|
|
235
|
-
|
|
236
|
-
<td>
|
|
237
|
-
<code>Renderer2</code>
|
|
238
|
-
</td>
|
|
239
|
-
|
|
240
|
-
<td>
|
|
241
|
-
No
|
|
242
|
-
</td>
|
|
243
|
-
|
|
244
|
-
</tr>
|
|
245
|
-
<tr>
|
|
246
|
-
<td>imageLoader</td>
|
|
247
|
-
|
|
248
|
-
<td>
|
|
249
|
-
<code>ImageLoaderService</code>
|
|
250
|
-
</td>
|
|
251
|
-
|
|
252
|
-
<td>
|
|
253
|
-
No
|
|
254
|
-
</td>
|
|
255
|
-
|
|
256
|
-
</tr>
|
|
257
|
-
</tbody>
|
|
258
|
-
</table>
|
|
259
|
-
</div>
|
|
260
|
-
</td>
|
|
261
|
-
</tr>
|
|
262
216
|
</tbody>
|
|
263
217
|
</table>
|
|
264
218
|
</section>
|
|
265
219
|
|
|
266
|
-
<section data-compodoc="block-inputs">
|
|
267
|
-
<h3 id="inputs">Inputs</h3>
|
|
268
|
-
<table class="table table-sm table-bordered">
|
|
269
|
-
<tbody>
|
|
270
|
-
<tr>
|
|
271
|
-
<td class="col-md-4">
|
|
272
|
-
<a name="placeholderImageUrl"></a>
|
|
273
|
-
<b>placeholderImageUrl</b>
|
|
274
|
-
</td>
|
|
275
|
-
</tr>
|
|
276
|
-
<tr>
|
|
277
|
-
<td class="col-md-4">
|
|
278
|
-
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
279
220
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
<section data-compodoc="block-properties">
|
|
226
|
+
|
|
227
|
+
<h3 id="inputs">
|
|
228
|
+
Properties
|
|
229
|
+
</h3>
|
|
230
|
+
<table class="table table-sm table-bordered">
|
|
231
|
+
<tbody>
|
|
232
|
+
<tr>
|
|
233
|
+
<td class="col-md-4">
|
|
234
|
+
<a name="imageUrl"></a>
|
|
235
|
+
<span class="name">
|
|
236
|
+
<span class="modifier">Public</span>
|
|
237
|
+
<span class="modifier">Readonly</span>
|
|
238
|
+
<span ><b>imageUrl</b></span>
|
|
239
|
+
<a href="#imageUrl"><span class="icon ion-ios-link"></span></a>
|
|
240
|
+
</span>
|
|
241
|
+
</td>
|
|
242
|
+
</tr>
|
|
291
243
|
<tr>
|
|
292
244
|
<td class="col-md-4">
|
|
293
|
-
<
|
|
294
|
-
<b>position</b>
|
|
245
|
+
<i>Default value : </i><code>input<string | null | undefined>(null, { alias: "rxapBackgroundImage" })</code>
|
|
295
246
|
</td>
|
|
296
247
|
</tr>
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
248
|
+
<tr>
|
|
249
|
+
<td class="col-md-4">
|
|
250
|
+
<div class="io-line">Defined in <a href="" data-line="51" class="link-to-prism">src/lib/background-image.directive.ts:51</a></div>
|
|
251
|
+
</td>
|
|
252
|
+
</tr>
|
|
300
253
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
254
|
+
|
|
255
|
+
</tbody>
|
|
256
|
+
</table>
|
|
257
|
+
<table class="table table-sm table-bordered">
|
|
258
|
+
<tbody>
|
|
259
|
+
<tr>
|
|
260
|
+
<td class="col-md-4">
|
|
261
|
+
<a name="placeholder"></a>
|
|
262
|
+
<span class="name">
|
|
263
|
+
<span class="modifier">Protected</span>
|
|
264
|
+
<span class="modifier">Readonly</span>
|
|
265
|
+
<span ><b>placeholder</b></span>
|
|
266
|
+
<a href="#placeholder"><span class="icon ion-ios-link"></span></a>
|
|
267
|
+
</span>
|
|
268
|
+
</td>
|
|
269
|
+
</tr>
|
|
312
270
|
<tr>
|
|
313
271
|
<td class="col-md-4">
|
|
314
|
-
<
|
|
315
|
-
<b>repeat</b>
|
|
272
|
+
<i>Default value : </i><code>computed(() => this.placeholderImageUrl())</code>
|
|
316
273
|
</td>
|
|
317
274
|
</tr>
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
275
|
+
<tr>
|
|
276
|
+
<td class="col-md-4">
|
|
277
|
+
<div class="io-line">Defined in <a href="" data-line="65" class="link-to-prism">src/lib/background-image.directive.ts:65</a></div>
|
|
278
|
+
</td>
|
|
279
|
+
</tr>
|
|
321
280
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
</
|
|
331
|
-
|
|
332
|
-
|
|
281
|
+
<tr>
|
|
282
|
+
<td class="col-md-4">
|
|
283
|
+
<div class="io-description"><p>The placeholder url that is used until the image is loaded. Derived
|
|
284
|
+
directives can override this to provide a fallback.</p>
|
|
285
|
+
</div>
|
|
286
|
+
</td>
|
|
287
|
+
</tr>
|
|
288
|
+
|
|
289
|
+
</tbody>
|
|
290
|
+
</table>
|
|
291
|
+
<table class="table table-sm table-bordered">
|
|
292
|
+
<tbody>
|
|
293
|
+
<tr>
|
|
294
|
+
<td class="col-md-4">
|
|
295
|
+
<a name="placeholderImageUrl"></a>
|
|
296
|
+
<span class="name">
|
|
297
|
+
<span class="modifier">Public</span>
|
|
298
|
+
<span class="modifier">Readonly</span>
|
|
299
|
+
<span ><b>placeholderImageUrl</b></span>
|
|
300
|
+
<a href="#placeholderImageUrl"><span class="icon ion-ios-link"></span></a>
|
|
301
|
+
</span>
|
|
302
|
+
</td>
|
|
303
|
+
</tr>
|
|
333
304
|
<tr>
|
|
334
305
|
<td class="col-md-4">
|
|
335
|
-
<
|
|
336
|
-
<b>rxapBackgroundImage</b>
|
|
306
|
+
<i>Default value : </i><code>input<string | null | undefined>()</code>
|
|
337
307
|
</td>
|
|
338
308
|
</tr>
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
309
|
+
<tr>
|
|
310
|
+
<td class="col-md-4">
|
|
311
|
+
<div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/background-image.directive.ts:53</a></div>
|
|
312
|
+
</td>
|
|
313
|
+
</tr>
|
|
342
314
|
|
|
343
|
-
|
|
344
|
-
|
|
315
|
+
|
|
316
|
+
</tbody>
|
|
317
|
+
</table>
|
|
318
|
+
<table class="table table-sm table-bordered">
|
|
319
|
+
<tbody>
|
|
320
|
+
<tr>
|
|
321
|
+
<td class="col-md-4">
|
|
322
|
+
<a name="position"></a>
|
|
323
|
+
<span class="name">
|
|
324
|
+
<span class="modifier">Public</span>
|
|
325
|
+
<span class="modifier">Readonly</span>
|
|
326
|
+
<span ><b>position</b></span>
|
|
327
|
+
<a href="#position"><span class="icon ion-ios-link"></span></a>
|
|
328
|
+
</span>
|
|
329
|
+
</td>
|
|
330
|
+
</tr>
|
|
345
331
|
<tr>
|
|
346
332
|
<td class="col-md-4">
|
|
347
|
-
<i>Default value : </i><code>null</code>
|
|
333
|
+
<i>Default value : </i><code>input<BackgroundPosition | null | undefined>()</code>
|
|
348
334
|
</td>
|
|
349
335
|
</tr>
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
336
|
+
<tr>
|
|
337
|
+
<td class="col-md-4">
|
|
338
|
+
<div class="io-line">Defined in <a href="" data-line="59" class="link-to-prism">src/lib/background-image.directive.ts:59</a></div>
|
|
339
|
+
</td>
|
|
340
|
+
</tr>
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
</tbody>
|
|
344
|
+
</table>
|
|
345
|
+
<table class="table table-sm table-bordered">
|
|
346
|
+
<tbody>
|
|
347
|
+
<tr>
|
|
348
|
+
<td class="col-md-4">
|
|
349
|
+
<a name="repeat"></a>
|
|
350
|
+
<span class="name">
|
|
351
|
+
<span class="modifier">Public</span>
|
|
352
|
+
<span class="modifier">Readonly</span>
|
|
353
|
+
<span ><b>repeat</b></span>
|
|
354
|
+
<a href="#repeat"><span class="icon ion-ios-link"></span></a>
|
|
355
|
+
</span>
|
|
356
|
+
</td>
|
|
357
|
+
</tr>
|
|
359
358
|
<tr>
|
|
360
359
|
<td class="col-md-4">
|
|
361
|
-
<
|
|
362
|
-
<b>size</b>
|
|
360
|
+
<i>Default value : </i><code>input<BackgroundRepeat | null | undefined>()</code>
|
|
363
361
|
</td>
|
|
364
362
|
</tr>
|
|
363
|
+
<tr>
|
|
364
|
+
<td class="col-md-4">
|
|
365
|
+
<div class="io-line">Defined in <a href="" data-line="57" class="link-to-prism">src/lib/background-image.directive.ts:57</a></div>
|
|
366
|
+
</td>
|
|
367
|
+
</tr>
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
</tbody>
|
|
371
|
+
</table>
|
|
372
|
+
<table class="table table-sm table-bordered">
|
|
373
|
+
<tbody>
|
|
374
|
+
<tr>
|
|
375
|
+
<td class="col-md-4">
|
|
376
|
+
<a name="size"></a>
|
|
377
|
+
<span class="name">
|
|
378
|
+
<span class="modifier">Public</span>
|
|
379
|
+
<span class="modifier">Readonly</span>
|
|
380
|
+
<span ><b>size</b></span>
|
|
381
|
+
<a href="#size"><span class="icon ion-ios-link"></span></a>
|
|
382
|
+
</span>
|
|
383
|
+
</td>
|
|
384
|
+
</tr>
|
|
365
385
|
<tr>
|
|
366
386
|
<td class="col-md-4">
|
|
367
|
-
<i>
|
|
368
|
-
|
|
387
|
+
<i>Default value : </i><code>input<BackgroundSize | null | undefined>()</code>
|
|
369
388
|
</td>
|
|
370
389
|
</tr>
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
</tbody>
|
|
377
|
-
</table>
|
|
378
|
-
</section>
|
|
379
|
-
|
|
380
|
-
|
|
390
|
+
<tr>
|
|
391
|
+
<td class="col-md-4">
|
|
392
|
+
<div class="io-line">Defined in <a href="" data-line="55" class="link-to-prism">src/lib/background-image.directive.ts:55</a></div>
|
|
393
|
+
</td>
|
|
394
|
+
</tr>
|
|
381
395
|
|
|
382
396
|
|
|
397
|
+
</tbody>
|
|
398
|
+
</table>
|
|
399
|
+
</section>
|
|
383
400
|
|
|
384
401
|
|
|
385
402
|
</div>
|
|
386
403
|
|
|
387
404
|
|
|
388
405
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
389
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
390
|
-
Directive,
|
|
391
|
-
ElementRef,
|
|
392
|
-
Inject,
|
|
393
|
-
Input,
|
|
394
|
-
OnChanges,
|
|
395
|
-
OnInit,
|
|
396
|
-
Renderer2,
|
|
397
|
-
SimpleChanges,
|
|
398
|
-
} from '@angular/core';
|
|
406
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { computed, Directive, effect, ElementRef, inject, input, Renderer2, untracked } from '@angular/core';
|
|
399
407
|
import { ImageLoaderService } from '@rxap/services';
|
|
400
408
|
|
|
401
409
|
export enum GlobalStyleOptions {
|
|
@@ -440,87 +448,67 @@ export type BackgroundPosition =
|
|
|
440
448
|
selector: '[rxapBackgroundImage]',
|
|
441
449
|
standalone: true,
|
|
442
450
|
})
|
|
443
|
-
export class BackgroundImageDirective
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
public
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
public repeat
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
451
|
+
export class BackgroundImageDirective {
|
|
452
|
+
private readonly host = inject<ElementRef>(ElementRef);
|
|
453
|
+
private readonly renderer = inject<Renderer2>(Renderer2);
|
|
454
|
+
private readonly imageLoader = inject<ImageLoaderService>(ImageLoaderService);
|
|
455
|
+
|
|
456
|
+
public readonly imageUrl = input<string | null | undefined>(null, { alias: "rxapBackgroundImage" });
|
|
457
|
+
|
|
458
|
+
public readonly placeholderImageUrl = input<string | null | undefined>();
|
|
459
|
+
|
|
460
|
+
public readonly size = input<BackgroundSize | null | undefined>();
|
|
461
|
+
|
|
462
|
+
public readonly repeat = input<BackgroundRepeat | null | undefined>();
|
|
463
|
+
|
|
464
|
+
public readonly position = input<BackgroundPosition | null | undefined>();
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* The placeholder url that is used until the image is loaded. Derived
|
|
468
|
+
* directives can override this to provide a fallback.
|
|
469
|
+
*/
|
|
470
|
+
protected readonly placeholder = computed(() => this.placeholderImageUrl());
|
|
471
|
+
|
|
472
|
+
constructor() {
|
|
473
|
+
effect(() => {
|
|
474
|
+
const size = this.size();
|
|
475
|
+
untracked(() => this.sizeChange(size));
|
|
476
|
+
});
|
|
477
|
+
effect(() => {
|
|
478
|
+
const position = this.position();
|
|
479
|
+
untracked(() => this.positionChange(position));
|
|
480
|
+
});
|
|
481
|
+
effect(() => {
|
|
482
|
+
const repeat = this.repeat();
|
|
483
|
+
untracked(() => this.repeatChange(repeat));
|
|
484
|
+
});
|
|
485
|
+
effect(() => {
|
|
486
|
+
const imageUrl = this.imageUrl();
|
|
487
|
+
// the placeholder is tracked too, so it is applied as soon as it changes
|
|
488
|
+
this.placeholder();
|
|
489
|
+
// call unconditionally so clearing the value (null/empty) is handled
|
|
490
|
+
untracked(() => this.imageUrlChange(imageUrl));
|
|
491
|
+
});
|
|
469
492
|
}
|
|
470
493
|
|
|
471
|
-
|
|
472
|
-
if (
|
|
473
|
-
this.
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
this.positionChange(this.position);
|
|
477
|
-
}
|
|
478
|
-
if (this.repeat) {
|
|
479
|
-
this.repeatChange(this.repeat);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
public ngOnChanges(changes: SimpleChanges) {
|
|
484
|
-
for (const propertyKey of Object.keys(changes)) {
|
|
485
|
-
switch (propertyKey) {
|
|
486
|
-
case 'imageUrl':
|
|
487
|
-
// call unconditionally so clearing the value (null/empty) is handled
|
|
488
|
-
this.imageUrlChange(changes['imageUrl'].currentValue);
|
|
489
|
-
break;
|
|
490
|
-
|
|
491
|
-
case 'size':
|
|
492
|
-
this.sizeChange(changes['size'].currentValue);
|
|
493
|
-
break;
|
|
494
|
-
|
|
495
|
-
case 'repeat':
|
|
496
|
-
this.repeatChange(changes['repeat'].currentValue);
|
|
497
|
-
break;
|
|
498
|
-
|
|
499
|
-
case 'position':
|
|
500
|
-
this.positionChange(changes['position'].currentValue);
|
|
501
|
-
break;
|
|
502
|
-
}
|
|
494
|
+
private applyStyle(style: string, value: string | null | undefined): void {
|
|
495
|
+
if (value) {
|
|
496
|
+
this.renderer.setStyle(this.host.nativeElement, style, value);
|
|
497
|
+
} else {
|
|
498
|
+
this.renderer.removeStyle(this.host.nativeElement, style);
|
|
503
499
|
}
|
|
504
500
|
}
|
|
505
501
|
|
|
506
|
-
private repeatChange(repeat: string): void {
|
|
507
|
-
this.
|
|
508
|
-
this.host.nativeElement,
|
|
509
|
-
'background-repeat',
|
|
510
|
-
repeat,
|
|
511
|
-
);
|
|
502
|
+
private repeatChange(repeat: string | null | undefined): void {
|
|
503
|
+
this.applyStyle('background-repeat', repeat);
|
|
512
504
|
}
|
|
513
505
|
|
|
514
|
-
private positionChange(position: string): void {
|
|
515
|
-
this.
|
|
516
|
-
this.host.nativeElement,
|
|
517
|
-
'background-position',
|
|
518
|
-
position,
|
|
519
|
-
);
|
|
506
|
+
private positionChange(position: string | null | undefined): void {
|
|
507
|
+
this.applyStyle('background-position', position);
|
|
520
508
|
}
|
|
521
509
|
|
|
522
|
-
private sizeChange(size: string): void {
|
|
523
|
-
this.
|
|
510
|
+
private sizeChange(size: string | null | undefined): void {
|
|
511
|
+
this.applyStyle('background-size', size);
|
|
524
512
|
}
|
|
525
513
|
|
|
526
514
|
private _latestImageUrl: string | null | undefined;
|
|
@@ -528,11 +516,12 @@ export class BackgroundImageDirective implements OnChanges, OnInit {
|
|
|
528
516
|
private async imageUrlChange(imageUrl: string | null | undefined): Promise<void> {
|
|
529
517
|
// track the most recently requested url so out-of-order loads can be ignored
|
|
530
518
|
this._latestImageUrl = imageUrl;
|
|
531
|
-
|
|
519
|
+
const placeholderImageUrl = this.placeholder();
|
|
520
|
+
if (placeholderImageUrl) {
|
|
532
521
|
this.renderer.setStyle(
|
|
533
522
|
this.host.nativeElement,
|
|
534
523
|
'background-image',
|
|
535
|
-
`url("${
|
|
524
|
+
`url("${ placeholderImageUrl }")`,
|
|
536
525
|
);
|
|
537
526
|
}
|
|
538
527
|
if (imageUrl) {
|
|
@@ -546,14 +535,12 @@ export class BackgroundImageDirective implements OnChanges, OnInit {
|
|
|
546
535
|
'background-image',
|
|
547
536
|
`url("${ imageUrl }")`,
|
|
548
537
|
);
|
|
549
|
-
} else if (!
|
|
538
|
+
} else if (!placeholderImageUrl) {
|
|
550
539
|
// clearing the image and no placeholder to fall back to
|
|
551
540
|
this.renderer.removeStyle(this.host.nativeElement, 'background-image');
|
|
552
541
|
}
|
|
553
542
|
}
|
|
554
543
|
}
|
|
555
|
-
|
|
556
|
-
|
|
557
544
|
</code></pre>
|
|
558
545
|
</div>
|
|
559
546
|
|