@rxap/directives 21.0.1-dev.0 → 21.0.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 +39 -0
- package/compodoc/changelog.html +37 -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
|
@@ -143,160 +143,29 @@
|
|
|
143
143
|
</table>
|
|
144
144
|
</section>
|
|
145
145
|
|
|
146
|
-
<section data-compodoc="block-index">
|
|
147
|
-
<h3 id="index">Index</h3>
|
|
148
|
-
<table class="table table-sm table-bordered index-table">
|
|
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"></span>
|
|
160
|
-
<span class="modifier">Public</span>
|
|
161
|
-
<a href="#width" >width</a>
|
|
162
|
-
</li>
|
|
163
|
-
</ul>
|
|
164
|
-
</td>
|
|
165
|
-
</tr>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<tr>
|
|
171
|
-
<td class="col-md-4">
|
|
172
|
-
<h6><b>HostBindings</b></h6>
|
|
173
|
-
</td>
|
|
174
|
-
</tr>
|
|
175
|
-
<tr>
|
|
176
|
-
<td class="col-md-4">
|
|
177
|
-
<ul class="index-list">
|
|
178
|
-
<li>
|
|
179
|
-
<a href="#style.width" >style.width</a>
|
|
180
|
-
</li>
|
|
181
|
-
</ul>
|
|
182
|
-
</td>
|
|
183
|
-
</tr>
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
</tbody>
|
|
187
|
-
</table>
|
|
188
|
-
</section>
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
<section data-compodoc="block-properties">
|
|
194
|
-
<h3>HostBindings</h3> <table class="table table-sm table-bordered">
|
|
195
|
-
<tbody>
|
|
196
|
-
<tr>
|
|
197
|
-
<td class="col-md-4">
|
|
198
|
-
<a name="style.width"></a>
|
|
199
|
-
<span class="name">
|
|
200
|
-
<span ><b>style.width</b></span>
|
|
201
|
-
<a href="#style.width"><span class="icon ion-ios-link"></span></a>
|
|
202
|
-
</span>
|
|
203
|
-
</td>
|
|
204
|
-
</tr>
|
|
205
|
-
<tr>
|
|
206
|
-
<td class="col-md-4">
|
|
207
|
-
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
208
|
-
|
|
209
|
-
</td>
|
|
210
|
-
</tr>
|
|
211
|
-
<tr>
|
|
212
|
-
<td class="col-md-4">
|
|
213
|
-
<i>Default value : </i><code>'100%'</code>
|
|
214
|
-
</td>
|
|
215
|
-
</tr>
|
|
216
|
-
<tr>
|
|
217
|
-
<td class="col-md-4">
|
|
218
|
-
<div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/lib/full-width.directive.ts:13</a></div>
|
|
219
|
-
</td>
|
|
220
|
-
</tr>
|
|
221
146
|
|
|
222
147
|
|
|
223
|
-
</tbody>
|
|
224
|
-
</table>
|
|
225
|
-
</section>
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
<section data-compodoc="block-properties">
|
|
230
|
-
|
|
231
|
-
<h3 id="inputs">
|
|
232
|
-
Properties
|
|
233
|
-
</h3>
|
|
234
|
-
<table class="table table-sm table-bordered">
|
|
235
|
-
<tbody>
|
|
236
|
-
<tr>
|
|
237
|
-
<td class="col-md-4">
|
|
238
|
-
<a name="width"></a>
|
|
239
|
-
<span class="name">
|
|
240
|
-
<span class="modifier"></span>
|
|
241
|
-
<span class="modifier">Public</span>
|
|
242
|
-
<span ><b>width</b></span>
|
|
243
|
-
<a href="#width"><span class="icon ion-ios-link"></span></a>
|
|
244
|
-
</span>
|
|
245
|
-
</td>
|
|
246
|
-
</tr>
|
|
247
|
-
<tr>
|
|
248
|
-
<td class="col-md-4">
|
|
249
|
-
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
250
|
-
|
|
251
|
-
</td>
|
|
252
|
-
</tr>
|
|
253
|
-
<tr>
|
|
254
|
-
<td class="col-md-4">
|
|
255
|
-
<i>Default value : </i><code>'100%'</code>
|
|
256
|
-
</td>
|
|
257
|
-
</tr>
|
|
258
|
-
<tr>
|
|
259
|
-
<td class="col-md-4">
|
|
260
|
-
<b>Decorators : </b>
|
|
261
|
-
<br />
|
|
262
|
-
<code>
|
|
263
|
-
@HostBinding('style.width')<br />
|
|
264
|
-
</code>
|
|
265
|
-
</td>
|
|
266
|
-
</tr>
|
|
267
|
-
<tr>
|
|
268
|
-
<td class="col-md-4">
|
|
269
|
-
<div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/lib/full-width.directive.ts:13</a></div>
|
|
270
|
-
</td>
|
|
271
|
-
</tr>
|
|
272
148
|
|
|
273
149
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
277
153
|
|
|
278
154
|
|
|
279
155
|
</div>
|
|
280
156
|
|
|
281
157
|
|
|
282
158
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
283
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
284
|
-
Directive,
|
|
285
|
-
HostBinding,
|
|
286
|
-
} from '@angular/core';
|
|
159
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Directive } from '@angular/core';
|
|
287
160
|
|
|
288
161
|
@Directive({
|
|
289
162
|
selector: '[rxapFullWidth]',
|
|
290
163
|
standalone: true,
|
|
164
|
+
host: {
|
|
165
|
+
style: 'width: 100%',
|
|
166
|
+
},
|
|
291
167
|
})
|
|
292
|
-
export class FullWidthDirective {
|
|
293
|
-
|
|
294
|
-
@HostBinding('style.width')
|
|
295
|
-
public width = '100%';
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
|
|
168
|
+
export class FullWidthDirective {}
|
|
300
169
|
</code></pre>
|
|
301
170
|
</div>
|
|
302
171
|
|
|
@@ -120,12 +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
|
-
</p>
|
|
129
123
|
|
|
130
124
|
|
|
131
125
|
<section data-compodoc="block-metadata">
|
|
@@ -153,27 +147,28 @@
|
|
|
153
147
|
<h3 id="index">Index</h3>
|
|
154
148
|
<table class="table table-sm table-bordered index-table">
|
|
155
149
|
<tbody>
|
|
156
|
-
|
|
157
150
|
<tr>
|
|
158
151
|
<td class="col-md-4">
|
|
159
|
-
<h6><b>
|
|
152
|
+
<h6><b>Properties</b></h6>
|
|
160
153
|
</td>
|
|
161
154
|
</tr>
|
|
162
155
|
<tr>
|
|
163
156
|
<td class="col-md-4">
|
|
164
157
|
<ul class="index-list">
|
|
165
158
|
<li>
|
|
166
|
-
<span class="modifier">
|
|
167
|
-
<span class="modifier">
|
|
168
|
-
<a href="#
|
|
159
|
+
<span class="modifier">Public</span>
|
|
160
|
+
<span class="modifier">Readonly</span>
|
|
161
|
+
<a href="#method" >method</a>
|
|
169
162
|
</li>
|
|
170
163
|
<li>
|
|
171
|
-
<span class="modifier">
|
|
172
|
-
|
|
164
|
+
<span class="modifier">Public</span>
|
|
165
|
+
<span class="modifier">Readonly</span>
|
|
166
|
+
<a href="#parameters" >parameters</a>
|
|
173
167
|
</li>
|
|
174
168
|
<li>
|
|
175
|
-
<span class="modifier">
|
|
176
|
-
|
|
169
|
+
<span class="modifier">Public</span>
|
|
170
|
+
<span class="modifier">Readonly</span>
|
|
171
|
+
<a href="#trackBy" >trackBy</a>
|
|
177
172
|
</li>
|
|
178
173
|
</ul>
|
|
179
174
|
</td>
|
|
@@ -181,20 +176,24 @@
|
|
|
181
176
|
|
|
182
177
|
<tr>
|
|
183
178
|
<td class="col-md-4">
|
|
184
|
-
<h6><b>
|
|
179
|
+
<h6><b>Methods</b></h6>
|
|
185
180
|
</td>
|
|
186
181
|
</tr>
|
|
187
182
|
<tr>
|
|
188
183
|
<td class="col-md-4">
|
|
189
184
|
<ul class="index-list">
|
|
190
185
|
<li>
|
|
191
|
-
|
|
186
|
+
<span class="modifier">Protected</span>
|
|
187
|
+
<span class="modifier">Async</span>
|
|
188
|
+
<a href="#execute" >execute</a>
|
|
192
189
|
</li>
|
|
193
190
|
<li>
|
|
194
|
-
|
|
191
|
+
<span class="modifier">Protected</span>
|
|
192
|
+
<a href="#hasChanged" >hasChanged</a>
|
|
195
193
|
</li>
|
|
196
194
|
<li>
|
|
197
|
-
|
|
195
|
+
<span class="modifier">Static</span>
|
|
196
|
+
<a href="#ngTemplateContextGuard" >ngTemplateContextGuard</a>
|
|
198
197
|
</li>
|
|
199
198
|
</ul>
|
|
200
199
|
</td>
|
|
@@ -203,6 +202,7 @@
|
|
|
203
202
|
|
|
204
203
|
|
|
205
204
|
|
|
205
|
+
|
|
206
206
|
</tbody>
|
|
207
207
|
</table>
|
|
208
208
|
</section>
|
|
@@ -213,139 +213,20 @@
|
|
|
213
213
|
<tbody>
|
|
214
214
|
<tr>
|
|
215
215
|
<td class="col-md-4">
|
|
216
|
-
<code>constructor(
|
|
216
|
+
<code>constructor()</code>
|
|
217
217
|
</td>
|
|
218
218
|
</tr>
|
|
219
219
|
<tr>
|
|
220
220
|
<td class="col-md-4">
|
|
221
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
221
|
+
<div class="io-line">Defined in <a href="" data-line="35" class="link-to-prism">src/lib/if-truthy.directive.ts:35</a></div>
|
|
222
222
|
</td>
|
|
223
223
|
</tr>
|
|
224
224
|
|
|
225
|
-
<tr>
|
|
226
|
-
<td class="col-md-4">
|
|
227
|
-
<div>
|
|
228
|
-
<b>Parameters :</b>
|
|
229
|
-
<table class="params">
|
|
230
|
-
<thead>
|
|
231
|
-
<tr>
|
|
232
|
-
<td>Name</td>
|
|
233
|
-
<td>Type</td>
|
|
234
|
-
<td>Optional</td>
|
|
235
|
-
</tr>
|
|
236
|
-
</thead>
|
|
237
|
-
<tbody>
|
|
238
|
-
<tr>
|
|
239
|
-
<td>templateRef</td>
|
|
240
|
-
|
|
241
|
-
<td>
|
|
242
|
-
<code><a href="../interfaces/IfTruthyDirectiveTemplateContext.html" target="_self" >TemplateRef<IfTruthyDirectiveTemplateContext<Data>></a></code>
|
|
243
|
-
</td>
|
|
244
|
-
|
|
245
|
-
<td>
|
|
246
|
-
No
|
|
247
|
-
</td>
|
|
248
|
-
|
|
249
|
-
</tr>
|
|
250
|
-
<tr>
|
|
251
|
-
<td>viewContainerRef</td>
|
|
252
|
-
|
|
253
|
-
<td>
|
|
254
|
-
<code>ViewContainerRef</code>
|
|
255
|
-
</td>
|
|
256
|
-
|
|
257
|
-
<td>
|
|
258
|
-
No
|
|
259
|
-
</td>
|
|
260
|
-
|
|
261
|
-
</tr>
|
|
262
|
-
<tr>
|
|
263
|
-
<td>cdr</td>
|
|
264
|
-
|
|
265
|
-
<td>
|
|
266
|
-
<code>ChangeDetectorRef</code>
|
|
267
|
-
</td>
|
|
268
|
-
|
|
269
|
-
<td>
|
|
270
|
-
No
|
|
271
|
-
</td>
|
|
272
|
-
|
|
273
|
-
</tr>
|
|
274
|
-
</tbody>
|
|
275
|
-
</table>
|
|
276
|
-
</div>
|
|
277
|
-
</td>
|
|
278
|
-
</tr>
|
|
279
225
|
</tbody>
|
|
280
226
|
</table>
|
|
281
227
|
</section>
|
|
282
228
|
|
|
283
|
-
<section data-compodoc="block-inputs">
|
|
284
|
-
<h3 id="inputs">Inputs</h3>
|
|
285
|
-
<table class="table table-sm table-bordered">
|
|
286
|
-
<tbody>
|
|
287
|
-
<tr>
|
|
288
|
-
<td class="col-md-4">
|
|
289
|
-
<a name="rxapIfTruthy"></a>
|
|
290
|
-
<b>rxapIfTruthy</b>
|
|
291
|
-
</td>
|
|
292
|
-
</tr>
|
|
293
|
-
<tr>
|
|
294
|
-
<td class="col-md-4">
|
|
295
|
-
<i>Type : </i> <code>Method<Data | Parameters></code>
|
|
296
|
-
|
|
297
|
-
</td>
|
|
298
|
-
</tr>
|
|
299
|
-
<tr>
|
|
300
|
-
<td class="col-md-2" colspan="2">
|
|
301
|
-
<div class="io-line">Defined in <a href="" data-line="25" class="link-to-prism">src/lib/if-truthy.directive.ts:25</a></div>
|
|
302
|
-
</td>
|
|
303
|
-
</tr>
|
|
304
|
-
</tbody>
|
|
305
|
-
</table>
|
|
306
|
-
<table class="table table-sm table-bordered">
|
|
307
|
-
<tbody>
|
|
308
|
-
<tr>
|
|
309
|
-
<td class="col-md-4">
|
|
310
|
-
<a name="rxapIfTruthyParameters"></a>
|
|
311
|
-
<b>rxapIfTruthyParameters</b>
|
|
312
|
-
</td>
|
|
313
|
-
</tr>
|
|
314
|
-
<tr>
|
|
315
|
-
<td class="col-md-4">
|
|
316
|
-
<i>Type : </i> <code>Parameters</code>
|
|
317
|
-
|
|
318
|
-
</td>
|
|
319
|
-
</tr>
|
|
320
|
-
<tr>
|
|
321
|
-
<td class="col-md-2" colspan="2">
|
|
322
|
-
<div class="io-line">Defined in <a href="" data-line="27" class="link-to-prism">src/lib/if-truthy.directive.ts:27</a></div>
|
|
323
|
-
</td>
|
|
324
|
-
</tr>
|
|
325
|
-
</tbody>
|
|
326
|
-
</table>
|
|
327
|
-
<table class="table table-sm table-bordered">
|
|
328
|
-
<tbody>
|
|
329
|
-
<tr>
|
|
330
|
-
<td class="col-md-4">
|
|
331
|
-
<a name="rxapIfTruthyTrackBy"></a>
|
|
332
|
-
<b>rxapIfTruthyTrackBy</b>
|
|
333
|
-
</td>
|
|
334
|
-
</tr>
|
|
335
|
-
<tr>
|
|
336
|
-
<td class="col-md-4">
|
|
337
|
-
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function" target="_blank" >function</a></code>
|
|
338
229
|
|
|
339
|
-
</td>
|
|
340
|
-
</tr>
|
|
341
|
-
<tr>
|
|
342
|
-
<td class="col-md-2" colspan="2">
|
|
343
|
-
<div class="io-line">Defined in <a href="" data-line="29" class="link-to-prism">src/lib/if-truthy.directive.ts:29</a></div>
|
|
344
|
-
</td>
|
|
345
|
-
</tr>
|
|
346
|
-
</tbody>
|
|
347
|
-
</table>
|
|
348
|
-
</section>
|
|
349
230
|
|
|
350
231
|
|
|
351
232
|
|
|
@@ -377,8 +258,8 @@
|
|
|
377
258
|
|
|
378
259
|
<tr>
|
|
379
260
|
<td class="col-md-4">
|
|
380
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
381
|
-
class="link-to-prism">src/lib/if-truthy.directive.ts:
|
|
261
|
+
<div class="io-line">Defined in <a href="" data-line="47"
|
|
262
|
+
class="link-to-prism">src/lib/if-truthy.directive.ts:47</a></div>
|
|
382
263
|
</td>
|
|
383
264
|
</tr>
|
|
384
265
|
|
|
@@ -416,8 +297,8 @@
|
|
|
416
297
|
|
|
417
298
|
<tr>
|
|
418
299
|
<td class="col-md-4">
|
|
419
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
420
|
-
class="link-to-prism">src/lib/if-truthy.directive.ts:
|
|
300
|
+
<div class="io-line">Defined in <a href="" data-line="66"
|
|
301
|
+
class="link-to-prism">src/lib/if-truthy.directive.ts:66</a></div>
|
|
421
302
|
</td>
|
|
422
303
|
</tr>
|
|
423
304
|
|
|
@@ -485,8 +366,8 @@
|
|
|
485
366
|
|
|
486
367
|
<tr>
|
|
487
368
|
<td class="col-md-4">
|
|
488
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
489
|
-
class="link-to-prism">src/lib/if-truthy.directive.ts:
|
|
369
|
+
<div class="io-line">Defined in <a href="" data-line="30"
|
|
370
|
+
class="link-to-prism">src/lib/if-truthy.directive.ts:30</a></div>
|
|
490
371
|
</td>
|
|
491
372
|
</tr>
|
|
492
373
|
|
|
@@ -557,21 +438,100 @@
|
|
|
557
438
|
</tbody>
|
|
558
439
|
</table>
|
|
559
440
|
</section>
|
|
441
|
+
<section data-compodoc="block-properties">
|
|
442
|
+
|
|
443
|
+
<h3 id="inputs">
|
|
444
|
+
Properties
|
|
445
|
+
</h3>
|
|
446
|
+
<table class="table table-sm table-bordered">
|
|
447
|
+
<tbody>
|
|
448
|
+
<tr>
|
|
449
|
+
<td class="col-md-4">
|
|
450
|
+
<a name="method"></a>
|
|
451
|
+
<span class="name">
|
|
452
|
+
<span class="modifier">Public</span>
|
|
453
|
+
<span class="modifier">Readonly</span>
|
|
454
|
+
<span ><b>method</b></span>
|
|
455
|
+
<a href="#method"><span class="icon ion-ios-link"></span></a>
|
|
456
|
+
</span>
|
|
457
|
+
</td>
|
|
458
|
+
</tr>
|
|
459
|
+
<tr>
|
|
460
|
+
<td class="col-md-4">
|
|
461
|
+
<i>Default value : </i><code>input.required<Method<Data, Parameters>>({ alias: "rxapIfTruthy" })</code>
|
|
462
|
+
</td>
|
|
463
|
+
</tr>
|
|
464
|
+
<tr>
|
|
465
|
+
<td class="col-md-4">
|
|
466
|
+
<div class="io-line">Defined in <a href="" data-line="19" class="link-to-prism">src/lib/if-truthy.directive.ts:19</a></div>
|
|
467
|
+
</td>
|
|
468
|
+
</tr>
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
</tbody>
|
|
472
|
+
</table>
|
|
473
|
+
<table class="table table-sm table-bordered">
|
|
474
|
+
<tbody>
|
|
475
|
+
<tr>
|
|
476
|
+
<td class="col-md-4">
|
|
477
|
+
<a name="parameters"></a>
|
|
478
|
+
<span class="name">
|
|
479
|
+
<span class="modifier">Public</span>
|
|
480
|
+
<span class="modifier">Readonly</span>
|
|
481
|
+
<span ><b>parameters</b></span>
|
|
482
|
+
<a href="#parameters"><span class="icon ion-ios-link"></span></a>
|
|
483
|
+
</span>
|
|
484
|
+
</td>
|
|
485
|
+
</tr>
|
|
486
|
+
<tr>
|
|
487
|
+
<td class="col-md-4">
|
|
488
|
+
<i>Default value : </i><code>input.required<Parameters>({ alias: "rxapIfTruthyParameters" })</code>
|
|
489
|
+
</td>
|
|
490
|
+
</tr>
|
|
491
|
+
<tr>
|
|
492
|
+
<td class="col-md-4">
|
|
493
|
+
<div class="io-line">Defined in <a href="" data-line="20" class="link-to-prism">src/lib/if-truthy.directive.ts:20</a></div>
|
|
494
|
+
</td>
|
|
495
|
+
</tr>
|
|
496
|
+
|
|
497
|
+
|
|
498
|
+
</tbody>
|
|
499
|
+
</table>
|
|
500
|
+
<table class="table table-sm table-bordered">
|
|
501
|
+
<tbody>
|
|
502
|
+
<tr>
|
|
503
|
+
<td class="col-md-4">
|
|
504
|
+
<a name="trackBy"></a>
|
|
505
|
+
<span class="name">
|
|
506
|
+
<span class="modifier">Public</span>
|
|
507
|
+
<span class="modifier">Readonly</span>
|
|
508
|
+
<span ><b>trackBy</b></span>
|
|
509
|
+
<a href="#trackBy"><span class="icon ion-ios-link"></span></a>
|
|
510
|
+
</span>
|
|
511
|
+
</td>
|
|
512
|
+
</tr>
|
|
513
|
+
<tr>
|
|
514
|
+
<td class="col-md-4">
|
|
515
|
+
<i>Default value : </i><code>input<((data: Data) => any) | undefined>(undefined, { alias: "rxapIfTruthyTrackBy" })</code>
|
|
516
|
+
</td>
|
|
517
|
+
</tr>
|
|
518
|
+
<tr>
|
|
519
|
+
<td class="col-md-4">
|
|
520
|
+
<div class="io-line">Defined in <a href="" data-line="21" class="link-to-prism">src/lib/if-truthy.directive.ts:21</a></div>
|
|
521
|
+
</td>
|
|
522
|
+
</tr>
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
</tbody>
|
|
526
|
+
</table>
|
|
527
|
+
</section>
|
|
560
528
|
|
|
561
529
|
|
|
562
530
|
</div>
|
|
563
531
|
|
|
564
532
|
|
|
565
533
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
566
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
567
|
-
ChangeDetectorRef,
|
|
568
|
-
Directive,
|
|
569
|
-
Input,
|
|
570
|
-
OnChanges,
|
|
571
|
-
SimpleChanges,
|
|
572
|
-
TemplateRef,
|
|
573
|
-
ViewContainerRef,
|
|
574
|
-
} from '@angular/core';
|
|
534
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Directive, effect, inject, input, TemplateRef, untracked, ViewContainerRef } from '@angular/core';
|
|
575
535
|
import { Method } from '@rxap/pattern';
|
|
576
536
|
|
|
577
537
|
export interface IfTruthyDirectiveTemplateContext<Data> {
|
|
@@ -584,22 +544,15 @@ export interface IfTruthyDirectiveTemplateContext<Data> {
|
|
|
584
544
|
selector: '[rxapIfTruthy]',
|
|
585
545
|
standalone: true,
|
|
586
546
|
})
|
|
587
|
-
export class IfTruthyDirective<Data, Parameters = any>
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
public method!: Method<Data, Parameters>;
|
|
591
|
-
@Input('rxapIfTruthyParameters')
|
|
592
|
-
public parameters!: Parameters;
|
|
593
|
-
@Input('rxapIfTruthyTrackBy')
|
|
594
|
-
public trackBy!: (data: Data) => any;
|
|
595
|
-
private _last?: Data;
|
|
547
|
+
export class IfTruthyDirective<Data, Parameters = any> {
|
|
548
|
+
private readonly templateRef = inject<TemplateRef<IfTruthyDirectiveTemplateContext<Data>>>(TemplateRef);
|
|
549
|
+
private readonly viewContainerRef = inject(ViewContainerRef);
|
|
596
550
|
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
}
|
|
551
|
+
|
|
552
|
+
public readonly method = input.required<Method<Data, Parameters>>({ alias: "rxapIfTruthy" });
|
|
553
|
+
public readonly parameters = input.required<Parameters>({ alias: "rxapIfTruthyParameters" });
|
|
554
|
+
public readonly trackBy = input<((data: Data) => any) | undefined>(undefined, { alias: "rxapIfTruthyTrackBy" });
|
|
555
|
+
private _last?: Data;
|
|
603
556
|
|
|
604
557
|
/**
|
|
605
558
|
* Asserts the correct type of the context for the template that `NgForOf` will render.
|
|
@@ -614,24 +567,26 @@ export class IfTruthyDirective<Data, Parameters = any> implements OnC
|
|
|
614
567
|
return true;
|
|
615
568
|
}
|
|
616
569
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
this.
|
|
621
|
-
|
|
622
|
-
|
|
570
|
+
constructor() {
|
|
571
|
+
effect(() => {
|
|
572
|
+
const method = this.method();
|
|
573
|
+
const parameters = this.parameters();
|
|
574
|
+
if (method && parameters) {
|
|
575
|
+
untracked(() => this.execute());
|
|
576
|
+
}
|
|
577
|
+
});
|
|
623
578
|
}
|
|
624
579
|
|
|
625
580
|
protected async execute() {
|
|
626
581
|
|
|
627
|
-
const result = await this.method.call(this.parameters);
|
|
582
|
+
const result = await this.method().call(this.parameters());
|
|
628
583
|
|
|
629
584
|
if (this.hasChanged(result)) {
|
|
630
585
|
|
|
631
586
|
this.viewContainerRef.clear();
|
|
632
587
|
|
|
633
588
|
if (result) {
|
|
634
|
-
this.viewContainerRef.createEmbeddedView(this.templateRef, { $implicit: result });
|
|
589
|
+
this.viewContainerRef.createEmbeddedView(this.templateRef, { $implicit: result }).markForCheck();
|
|
635
590
|
}
|
|
636
591
|
|
|
637
592
|
// remember the last applied result so unchanged values don't rebuild the view
|
|
@@ -639,14 +594,13 @@ export class IfTruthyDirective<Data, Parameters = any> implements OnC
|
|
|
639
594
|
|
|
640
595
|
}
|
|
641
596
|
|
|
642
|
-
this.cdr.detectChanges();
|
|
643
|
-
|
|
644
597
|
}
|
|
645
598
|
|
|
646
599
|
protected hasChanged(current: Data) {
|
|
647
600
|
if (this._last !== undefined) {
|
|
648
|
-
const
|
|
649
|
-
const
|
|
601
|
+
const trackBy = this.trackBy();
|
|
602
|
+
const currentTrackBy = trackBy ? trackBy(current) : current;
|
|
603
|
+
const lastTrackBy = trackBy ? trackBy(this._last) : this._last;
|
|
650
604
|
return currentTrackBy !== lastTrackBy;
|
|
651
605
|
}
|
|
652
606
|
|