@rxap/material-form-system 19.0.5 → 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 +37 -0
- package/compodoc/changelog.html +35 -0
- package/compodoc/classes/ExtractHideShowMixin.html +14 -28
- package/compodoc/classes/RecordViewTuple.html +9 -23
- package/compodoc/components/FormControlsComponent.html +184 -388
- package/compodoc/dependencies.html +13 -13
- package/compodoc/directives/ChipInputAdapterDirective.html +7 -53
- package/compodoc/directives/ChipListIteratorDirective.html +8 -106
- package/compodoc/directives/CompareWithDirective.html +44 -90
- package/compodoc/directives/ControlErrorDirective.html +150 -151
- package/compodoc/directives/ControlErrorsDirective.html +123 -109
- package/compodoc/directives/FormFieldHideShowDirective.html +11 -97
- package/compodoc/directives/InputClearButtonDirective.html +15 -251
- package/compodoc/directives/RequiredDirective.html +2 -58
- package/compodoc/graph/dependencies.svg +15 -153
- package/compodoc/interfaces/ChipListTemplateContext.html +6 -20
- package/compodoc/interfaces/ControlErrorDirectiveContext.html +8 -28
- package/compodoc/interfaces/ControlErrorsDirectiveContext.html +6 -21
- package/compodoc/js/menu-wc.js +0 -41
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/modules/MaterialFormSystemModule/dependencies.svg +4 -4
- package/compodoc/modules/MaterialFormSystemModule.html +4 -4
- package/compodoc/modules.html +0 -17
- package/compodoc/overview.html +1 -185
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +816 -1620
- package/docs/html/assets/hierarchy.js +1 -1
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/ChipInputAdapterDirective.html +4 -4
- package/docs/html/classes/ChipListIteratorDirective.html +4 -4
- package/docs/html/classes/CompareWithDirective.html +3 -3
- package/docs/html/classes/ControlErrorDirective.html +4 -4
- package/docs/html/classes/ControlErrorsDirective.html +4 -4
- package/docs/html/classes/ExtractHideShowMixin.html +2 -2
- package/docs/html/classes/FormControlsComponent.html +6 -7
- package/docs/html/classes/FormFieldHideShowDirective.html +5 -5
- package/docs/html/classes/InputClearButtonDirective.html +2 -2
- package/docs/html/classes/RequiredDirective.html +3 -3
- package/docs/html/hierarchy.html +1 -1
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/ChipListTemplateContext.html +2 -2
- package/docs/html/interfaces/ControlErrorDirectiveContext.html +2 -2
- package/docs/html/interfaces/ControlErrorsDirectiveContext.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/ChipInputAdapterDirective.md +6 -16
- package/docs/markdown/classes/ChipListIteratorDirective.md +6 -26
- package/docs/markdown/classes/CompareWithDirective.md +6 -14
- package/docs/markdown/classes/ControlErrorDirective.md +12 -32
- package/docs/markdown/classes/ControlErrorsDirective.md +10 -30
- package/docs/markdown/classes/ExtractHideShowMixin.md +8 -8
- package/docs/markdown/classes/FormControlsComponent.md +24 -74
- package/docs/markdown/classes/FormFieldHideShowDirective.md +13 -29
- package/docs/markdown/classes/InputClearButtonDirective.md +8 -16
- package/docs/markdown/classes/RequiredDirective.md +4 -12
- package/docs/markdown/globals.md +2 -3
- package/docs/markdown/interfaces/ChipListTemplateContext.md +4 -4
- package/docs/markdown/interfaces/ControlErrorDirectiveContext.md +4 -4
- package/docs/markdown/interfaces/ControlErrorsDirectiveContext.md +4 -4
- package/docs/wiki/Class.ChipInputAdapterDirective.md +5 -15
- package/docs/wiki/Class.ChipListIteratorDirective.md +5 -25
- package/docs/wiki/Class.CompareWithDirective.md +5 -13
- package/docs/wiki/Class.ControlErrorDirective.md +11 -31
- package/docs/wiki/Class.ControlErrorsDirective.md +9 -29
- package/docs/wiki/Class.ExtractHideShowMixin.md +7 -7
- package/docs/wiki/Class.FormControlsComponent.md +23 -73
- package/docs/wiki/Class.FormFieldHideShowDirective.md +12 -28
- package/docs/wiki/Class.InputClearButtonDirective.md +7 -15
- package/docs/wiki/Class.RequiredDirective.md +3 -11
- package/docs/wiki/Interface.ChipListTemplateContext.md +3 -3
- package/docs/wiki/Interface.ControlErrorDirectiveContext.md +3 -3
- package/docs/wiki/Interface.ControlErrorsDirectiveContext.md +3 -3
- package/docs/wiki/_Sidebar.md +0 -1
- package/docs/wiki/globals.md +1 -2
- package/fesm2022/rxap-material-form-system.mjs +107 -231
- package/fesm2022/rxap-material-form-system.mjs.map +1 -1
- package/package.json +42 -41
- package/types/rxap-material-form-system.d.ts +160 -0
- package/docs/html/classes/MaterialFormSystemModule.html +0 -2
- package/docs/markdown/classes/MaterialFormSystemModule.md +0 -19
- package/docs/wiki/Class.MaterialFormSystemModule.md +0 -15
- package/index.d.ts +0 -10
- package/lib/chip-input-adapter.directive.d.ts +0 -14
- package/lib/chip-list-iterator.directive.d.ts +0 -25
- package/lib/compare-with.directive.d.ts +0 -12
- package/lib/control-error.directive.d.ts +0 -24
- package/lib/control-errors.directive.d.ts +0 -23
- package/lib/form-controls/form-controls.component.d.ts +0 -34
- package/lib/form-field-hide-show.directive.d.ts +0 -32
- package/lib/input-clear-button.directive.d.ts +0 -13
- package/lib/material-form-system.module.d.ts +0 -11
- package/lib/required.directive.d.ts +0 -10
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
</ol>
|
|
102
102
|
<ul class="dependencies-list">
|
|
103
103
|
<li>
|
|
104
|
-
<b>@nx/devkit</b> :
|
|
104
|
+
<b>@nx/devkit</b> : 22.7.5</li>
|
|
105
105
|
<li>
|
|
106
106
|
<b>tslib</b> : 2.6.2</li>
|
|
107
107
|
</ul>
|
|
@@ -113,29 +113,29 @@
|
|
|
113
113
|
</ol>
|
|
114
114
|
<ul class="dependencies-list">
|
|
115
115
|
<li>
|
|
116
|
-
<b>@angular/cdk</b> : ^
|
|
116
|
+
<b>@angular/cdk</b> : ^21.2.9</li>
|
|
117
117
|
<li>
|
|
118
|
-
<b>@angular/common</b> : ^
|
|
118
|
+
<b>@angular/common</b> : ^21.2.9</li>
|
|
119
119
|
<li>
|
|
120
|
-
<b>@angular/core</b> : ^
|
|
120
|
+
<b>@angular/core</b> : ^21.2.9</li>
|
|
121
121
|
<li>
|
|
122
|
-
<b>@angular/forms</b> : ^
|
|
122
|
+
<b>@angular/forms</b> : ^21.2.9</li>
|
|
123
123
|
<li>
|
|
124
|
-
<b>@angular/material</b> : ^
|
|
124
|
+
<b>@angular/material</b> : ^21.2.9</li>
|
|
125
125
|
<li>
|
|
126
|
-
<b>@angular/router</b> : ^
|
|
126
|
+
<b>@angular/router</b> : ^21.2.9</li>
|
|
127
127
|
<li>
|
|
128
|
-
<b>@rxap/form-system</b> : ^
|
|
128
|
+
<b>@rxap/form-system</b> : ^21.0.1-dev.1</li>
|
|
129
129
|
<li>
|
|
130
|
-
<b>@rxap/forms</b> : ^
|
|
130
|
+
<b>@rxap/forms</b> : ^21.0.1-dev.1</li>
|
|
131
131
|
<li>
|
|
132
|
-
<b>@rxap/mixin</b> : ^16.0.
|
|
132
|
+
<b>@rxap/mixin</b> : ^16.0.17-dev.1</li>
|
|
133
133
|
<li>
|
|
134
|
-
<b>@rxap/reflect-metadata</b> : ^1.0.
|
|
134
|
+
<b>@rxap/reflect-metadata</b> : ^1.0.18-dev.1</li>
|
|
135
135
|
<li>
|
|
136
|
-
<b>@rxap/utilities</b> : ^16.5.1</li>
|
|
136
|
+
<b>@rxap/utilities</b> : ^16.5.2-dev.1</li>
|
|
137
137
|
<li>
|
|
138
|
-
<b>rxjs</b> : ^7.8.
|
|
138
|
+
<b>rxjs</b> : ^7.8.2</li>
|
|
139
139
|
</ul>
|
|
140
140
|
|
|
141
141
|
|
|
@@ -157,57 +157,15 @@
|
|
|
157
157
|
<tbody>
|
|
158
158
|
<tr>
|
|
159
159
|
<td class="col-md-4">
|
|
160
|
-
<code>constructor(
|
|
160
|
+
<code>constructor()</code>
|
|
161
161
|
</td>
|
|
162
162
|
</tr>
|
|
163
163
|
<tr>
|
|
164
164
|
<td class="col-md-4">
|
|
165
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
165
|
+
<div class="io-line">Defined in <a href="" data-line="23" class="link-to-prism">src/lib/chip-input-adapter.directive.ts:23</a></div>
|
|
166
166
|
</td>
|
|
167
167
|
</tr>
|
|
168
168
|
|
|
169
|
-
<tr>
|
|
170
|
-
<td class="col-md-4">
|
|
171
|
-
<div>
|
|
172
|
-
<b>Parameters :</b>
|
|
173
|
-
<table class="params">
|
|
174
|
-
<thead>
|
|
175
|
-
<tr>
|
|
176
|
-
<td>Name</td>
|
|
177
|
-
<td>Type</td>
|
|
178
|
-
<td>Optional</td>
|
|
179
|
-
</tr>
|
|
180
|
-
</thead>
|
|
181
|
-
<tbody>
|
|
182
|
-
<tr>
|
|
183
|
-
<td>matChipInput</td>
|
|
184
|
-
|
|
185
|
-
<td>
|
|
186
|
-
<code>MatChipInput</code>
|
|
187
|
-
</td>
|
|
188
|
-
|
|
189
|
-
<td>
|
|
190
|
-
No
|
|
191
|
-
</td>
|
|
192
|
-
|
|
193
|
-
</tr>
|
|
194
|
-
<tr>
|
|
195
|
-
<td>ngControl</td>
|
|
196
|
-
|
|
197
|
-
<td>
|
|
198
|
-
<code>NgControl</code>
|
|
199
|
-
</td>
|
|
200
|
-
|
|
201
|
-
<td>
|
|
202
|
-
No
|
|
203
|
-
</td>
|
|
204
|
-
|
|
205
|
-
</tr>
|
|
206
|
-
</tbody>
|
|
207
|
-
</table>
|
|
208
|
-
</div>
|
|
209
|
-
</td>
|
|
210
|
-
</tr>
|
|
211
169
|
</tbody>
|
|
212
170
|
</table>
|
|
213
171
|
</section>
|
|
@@ -227,11 +185,7 @@
|
|
|
227
185
|
COMMA,
|
|
228
186
|
ENTER,
|
|
229
187
|
} from '@angular/cdk/keycodes';
|
|
230
|
-
import {
|
|
231
|
-
Directive,
|
|
232
|
-
OnDestroy,
|
|
233
|
-
OnInit,
|
|
234
|
-
} from '@angular/core';
|
|
188
|
+
import { Directive, OnDestroy, OnInit, inject } from '@angular/core';
|
|
235
189
|
import { NgControl } from '@angular/forms';
|
|
236
190
|
import { MatChipInput } from '@angular/material/chips';
|
|
237
191
|
import { unique } from '@rxap/utilities';
|
|
@@ -246,12 +200,12 @@ import {
|
|
|
246
200
|
standalone: true,
|
|
247
201
|
})
|
|
248
202
|
export class ChipInputAdapterDirective implements OnDestroy, OnInit {
|
|
203
|
+
private readonly matChipInput = inject(MatChipInput);
|
|
204
|
+
private readonly ngControl = inject(NgControl);
|
|
205
|
+
|
|
249
206
|
private _subscription?: Subscription;
|
|
250
207
|
|
|
251
|
-
constructor(
|
|
252
|
-
private readonly matChipInput: MatChipInput,
|
|
253
|
-
private readonly ngControl: NgControl,
|
|
254
|
-
) {
|
|
208
|
+
constructor() {
|
|
255
209
|
this.matChipInput.separatorKeyCodes = [ ENTER, COMMA ] as const;
|
|
256
210
|
this.matChipInput.addOnBlur = true;
|
|
257
211
|
}
|
|
@@ -179,90 +179,6 @@
|
|
|
179
179
|
</table>
|
|
180
180
|
</section>
|
|
181
181
|
|
|
182
|
-
<section data-compodoc="block-constructor">
|
|
183
|
-
<h3 id="constructor">Constructor</h3>
|
|
184
|
-
<table class="table table-sm table-bordered">
|
|
185
|
-
<tbody>
|
|
186
|
-
<tr>
|
|
187
|
-
<td class="col-md-4">
|
|
188
|
-
<code>constructor(template: <a href="../interfaces/ChipListTemplateContext.html" target="_self">TemplateRef<ChipListTemplateContext></a>, viewContainerRef: ViewContainerRef, ngControl: NgControl, differs: IterableDiffers)</code>
|
|
189
|
-
</td>
|
|
190
|
-
</tr>
|
|
191
|
-
<tr>
|
|
192
|
-
<td class="col-md-4">
|
|
193
|
-
<div class="io-line">Defined in <a href="" data-line="47" class="link-to-prism">src/lib/chip-list-iterator.directive.ts:47</a></div>
|
|
194
|
-
</td>
|
|
195
|
-
</tr>
|
|
196
|
-
|
|
197
|
-
<tr>
|
|
198
|
-
<td class="col-md-4">
|
|
199
|
-
<div>
|
|
200
|
-
<b>Parameters :</b>
|
|
201
|
-
<table class="params">
|
|
202
|
-
<thead>
|
|
203
|
-
<tr>
|
|
204
|
-
<td>Name</td>
|
|
205
|
-
<td>Type</td>
|
|
206
|
-
<td>Optional</td>
|
|
207
|
-
</tr>
|
|
208
|
-
</thead>
|
|
209
|
-
<tbody>
|
|
210
|
-
<tr>
|
|
211
|
-
<td>template</td>
|
|
212
|
-
|
|
213
|
-
<td>
|
|
214
|
-
<code><a href="../interfaces/ChipListTemplateContext.html" target="_self" >TemplateRef<ChipListTemplateContext></a></code>
|
|
215
|
-
</td>
|
|
216
|
-
|
|
217
|
-
<td>
|
|
218
|
-
No
|
|
219
|
-
</td>
|
|
220
|
-
|
|
221
|
-
</tr>
|
|
222
|
-
<tr>
|
|
223
|
-
<td>viewContainerRef</td>
|
|
224
|
-
|
|
225
|
-
<td>
|
|
226
|
-
<code>ViewContainerRef</code>
|
|
227
|
-
</td>
|
|
228
|
-
|
|
229
|
-
<td>
|
|
230
|
-
No
|
|
231
|
-
</td>
|
|
232
|
-
|
|
233
|
-
</tr>
|
|
234
|
-
<tr>
|
|
235
|
-
<td>ngControl</td>
|
|
236
|
-
|
|
237
|
-
<td>
|
|
238
|
-
<code>NgControl</code>
|
|
239
|
-
</td>
|
|
240
|
-
|
|
241
|
-
<td>
|
|
242
|
-
No
|
|
243
|
-
</td>
|
|
244
|
-
|
|
245
|
-
</tr>
|
|
246
|
-
<tr>
|
|
247
|
-
<td>differs</td>
|
|
248
|
-
|
|
249
|
-
<td>
|
|
250
|
-
<code>IterableDiffers</code>
|
|
251
|
-
</td>
|
|
252
|
-
|
|
253
|
-
<td>
|
|
254
|
-
No
|
|
255
|
-
</td>
|
|
256
|
-
|
|
257
|
-
</tr>
|
|
258
|
-
</tbody>
|
|
259
|
-
</table>
|
|
260
|
-
</div>
|
|
261
|
-
</td>
|
|
262
|
-
</tr>
|
|
263
|
-
</tbody>
|
|
264
|
-
</table>
|
|
265
|
-
</section>
|
|
266
182
|
|
|
267
183
|
|
|
268
184
|
|
|
@@ -295,8 +211,8 @@
|
|
|
295
211
|
|
|
296
212
|
<tr>
|
|
297
213
|
<td class="col-md-4">
|
|
298
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
299
|
-
class="link-to-prism">src/lib/chip-list-iterator.directive.ts:
|
|
214
|
+
<div class="io-line">Defined in <a href="" data-line="78"
|
|
215
|
+
class="link-to-prism">src/lib/chip-list-iterator.directive.ts:78</a></div>
|
|
300
216
|
</td>
|
|
301
217
|
</tr>
|
|
302
218
|
|
|
@@ -349,18 +265,7 @@
|
|
|
349
265
|
|
|
350
266
|
|
|
351
267
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
352
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
353
|
-
Directive,
|
|
354
|
-
EmbeddedViewRef,
|
|
355
|
-
IterableChangeRecord,
|
|
356
|
-
IterableChanges,
|
|
357
|
-
IterableDiffer,
|
|
358
|
-
IterableDiffers,
|
|
359
|
-
OnDestroy,
|
|
360
|
-
OnInit,
|
|
361
|
-
TemplateRef,
|
|
362
|
-
ViewContainerRef,
|
|
363
|
-
} from '@angular/core';
|
|
268
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Directive, EmbeddedViewRef, IterableChangeRecord, IterableChanges, IterableDiffer, IterableDiffers, OnDestroy, OnInit, TemplateRef, ViewContainerRef, inject } from '@angular/core';
|
|
364
269
|
import { NgControl } from '@angular/forms';
|
|
365
270
|
import { MatChipEvent } from '@angular/material/chips';
|
|
366
271
|
import { Subscription } from 'rxjs';
|
|
@@ -392,19 +297,16 @@ class RecordViewTuple {
|
|
|
392
297
|
standalone: true,
|
|
393
298
|
})
|
|
394
299
|
export class ChipListIteratorDirective implements OnInit, OnDestroy {
|
|
300
|
+
private readonly template = inject<TemplateRef<ChipListTemplateContext>>(TemplateRef);
|
|
301
|
+
private readonly viewContainerRef = inject(ViewContainerRef);
|
|
302
|
+
private readonly ngControl = inject(NgControl);
|
|
303
|
+
private readonly differs = inject(IterableDiffers);
|
|
304
|
+
|
|
395
305
|
private _subscription?: Subscription;
|
|
396
306
|
|
|
397
307
|
private _dirty = true;
|
|
398
308
|
private _differ: IterableDiffer<string> | null = null;
|
|
399
309
|
|
|
400
|
-
constructor(
|
|
401
|
-
private readonly template: TemplateRef<ChipListTemplateContext>,
|
|
402
|
-
private readonly viewContainerRef: ViewContainerRef,
|
|
403
|
-
private readonly ngControl: NgControl,
|
|
404
|
-
private readonly differs: IterableDiffers,
|
|
405
|
-
) {
|
|
406
|
-
}
|
|
407
|
-
|
|
408
310
|
public ngOnInit() {
|
|
409
311
|
this._subscription = this.ngControl.valueChanges
|
|
410
312
|
?.pipe(
|
|
@@ -153,18 +153,18 @@
|
|
|
153
153
|
<h3 id="index">Index</h3>
|
|
154
154
|
<table class="table table-sm table-bordered index-table">
|
|
155
155
|
<tbody>
|
|
156
|
-
|
|
157
|
-
|
|
158
156
|
<tr>
|
|
159
157
|
<td class="col-md-4">
|
|
160
|
-
<h6><b>
|
|
158
|
+
<h6><b>Properties</b></h6>
|
|
161
159
|
</td>
|
|
162
160
|
</tr>
|
|
163
161
|
<tr>
|
|
164
162
|
<td class="col-md-4">
|
|
165
163
|
<ul class="index-list">
|
|
166
164
|
<li>
|
|
167
|
-
|
|
165
|
+
<span class="modifier">Public</span>
|
|
166
|
+
<span class="modifier">Readonly</span>
|
|
167
|
+
<a href="#objectPath" >objectPath</a>
|
|
168
168
|
</li>
|
|
169
169
|
</ul>
|
|
170
170
|
</td>
|
|
@@ -173,100 +173,58 @@
|
|
|
173
173
|
|
|
174
174
|
|
|
175
175
|
|
|
176
|
+
|
|
177
|
+
|
|
176
178
|
</tbody>
|
|
177
179
|
</table>
|
|
178
180
|
</section>
|
|
179
181
|
|
|
180
|
-
<section data-compodoc="block-constructor">
|
|
181
|
-
<h3 id="constructor">Constructor</h3>
|
|
182
|
-
<table class="table table-sm table-bordered">
|
|
183
|
-
<tbody>
|
|
184
|
-
<tr>
|
|
185
|
-
<td class="col-md-4">
|
|
186
|
-
<code>constructor(matSelect: MatSelect)</code>
|
|
187
|
-
</td>
|
|
188
|
-
</tr>
|
|
189
|
-
<tr>
|
|
190
|
-
<td class="col-md-4">
|
|
191
|
-
<div class="io-line">Defined in <a href="" data-line="20" class="link-to-prism">src/lib/compare-with.directive.ts:20</a></div>
|
|
192
|
-
</td>
|
|
193
|
-
</tr>
|
|
194
182
|
|
|
195
|
-
<tr>
|
|
196
|
-
<td class="col-md-4">
|
|
197
|
-
<div>
|
|
198
|
-
<b>Parameters :</b>
|
|
199
|
-
<table class="params">
|
|
200
|
-
<thead>
|
|
201
|
-
<tr>
|
|
202
|
-
<td>Name</td>
|
|
203
|
-
<td>Type</td>
|
|
204
|
-
<td>Optional</td>
|
|
205
|
-
</tr>
|
|
206
|
-
</thead>
|
|
207
|
-
<tbody>
|
|
208
|
-
<tr>
|
|
209
|
-
<td>matSelect</td>
|
|
210
|
-
|
|
211
|
-
<td>
|
|
212
|
-
<code>MatSelect</code>
|
|
213
|
-
</td>
|
|
214
|
-
|
|
215
|
-
<td>
|
|
216
|
-
No
|
|
217
|
-
</td>
|
|
218
|
-
|
|
219
|
-
</tr>
|
|
220
|
-
</tbody>
|
|
221
|
-
</table>
|
|
222
|
-
</div>
|
|
223
|
-
</td>
|
|
224
|
-
</tr>
|
|
225
|
-
</tbody>
|
|
226
|
-
</table>
|
|
227
|
-
</section>
|
|
228
183
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
<section data-compodoc="block-properties">
|
|
189
|
+
|
|
190
|
+
<h3 id="inputs">
|
|
191
|
+
Properties
|
|
192
|
+
</h3>
|
|
193
|
+
<table class="table table-sm table-bordered">
|
|
194
|
+
<tbody>
|
|
195
|
+
<tr>
|
|
196
|
+
<td class="col-md-4">
|
|
197
|
+
<a name="objectPath"></a>
|
|
198
|
+
<span class="name">
|
|
199
|
+
<span class="modifier">Public</span>
|
|
200
|
+
<span class="modifier">Readonly</span>
|
|
201
|
+
<span ><b>objectPath</b></span>
|
|
202
|
+
<a href="#objectPath"><span class="icon ion-ios-link"></span></a>
|
|
203
|
+
</span>
|
|
204
|
+
</td>
|
|
205
|
+
</tr>
|
|
239
206
|
<tr>
|
|
240
207
|
<td class="col-md-4">
|
|
241
|
-
<i>
|
|
242
|
-
|
|
208
|
+
<i>Default value : </i><code>input.required<string>({ alias: "rxapCompareWith" })</code>
|
|
243
209
|
</td>
|
|
244
210
|
</tr>
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
</tbody>
|
|
251
|
-
</table>
|
|
252
|
-
</section>
|
|
253
|
-
|
|
254
|
-
|
|
211
|
+
<tr>
|
|
212
|
+
<td class="col-md-4">
|
|
213
|
+
<div class="io-line">Defined in <a href="" data-line="15" class="link-to-prism">src/lib/compare-with.directive.ts:15</a></div>
|
|
214
|
+
</td>
|
|
215
|
+
</tr>
|
|
255
216
|
|
|
256
217
|
|
|
218
|
+
</tbody>
|
|
219
|
+
</table>
|
|
220
|
+
</section>
|
|
257
221
|
|
|
258
222
|
|
|
259
223
|
</div>
|
|
260
224
|
|
|
261
225
|
|
|
262
226
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
263
|
-
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import {
|
|
264
|
-
Directive,
|
|
265
|
-
Inject,
|
|
266
|
-
Input,
|
|
267
|
-
isDevMode,
|
|
268
|
-
OnInit,
|
|
269
|
-
} from '@angular/core';
|
|
227
|
+
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Directive, isDevMode, OnInit, input, inject } from '@angular/core';
|
|
270
228
|
import { MatSelect } from '@angular/material/select';
|
|
271
229
|
import {
|
|
272
230
|
equals,
|
|
@@ -278,21 +236,17 @@ import {
|
|
|
278
236
|
standalone: true,
|
|
279
237
|
})
|
|
280
238
|
export class CompareWithDirective implements OnInit {
|
|
281
|
-
|
|
282
|
-
public objectPath!: string;
|
|
239
|
+
private readonly matSelect = inject<MatSelect>(MatSelect);
|
|
283
240
|
|
|
284
|
-
|
|
285
|
-
@Inject(MatSelect)
|
|
286
|
-
private readonly matSelect: MatSelect,
|
|
287
|
-
) {
|
|
288
|
-
}
|
|
241
|
+
public readonly objectPath = input.required<string>({ alias: "rxapCompareWith" });
|
|
289
242
|
|
|
290
243
|
public ngOnInit() {
|
|
291
244
|
this.matSelect.compareWith = this.compareWith.bind(this);
|
|
292
245
|
}
|
|
293
246
|
|
|
294
247
|
private compareWith(o1: any, o2: any): boolean {
|
|
295
|
-
|
|
248
|
+
const objectPath = this.objectPath();
|
|
249
|
+
if (objectPath) {
|
|
296
250
|
if (typeof o1 !== 'object' || typeof o2 !== 'object') {
|
|
297
251
|
if (isDevMode()) {
|
|
298
252
|
console.warn(
|
|
@@ -309,8 +263,8 @@ export class CompareWithDirective implements OnInit {
|
|
|
309
263
|
}
|
|
310
264
|
return false;
|
|
311
265
|
}
|
|
312
|
-
const o1Value = getFromObject(o1,
|
|
313
|
-
const o2Value = getFromObject(o2,
|
|
266
|
+
const o1Value = getFromObject(o1, objectPath);
|
|
267
|
+
const o2Value = getFromObject(o2, objectPath);
|
|
314
268
|
if (o1Value === undefined || o2Value === undefined) {
|
|
315
269
|
return false;
|
|
316
270
|
}
|