@rxap/form-system 18.1.3 → 18.2.0-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 +13 -0
- package/compodoc/changelog.html +25 -0
- package/compodoc/dependencies.html +18 -14
- package/compodoc/directives/AutocompleteOptionsFromMethodDirective.html +1367 -0
- package/compodoc/directives/FormArrayItemButton.html +58 -19
- package/compodoc/directives/FormArrayItemRemoveButtonDirective.html +113 -10
- package/compodoc/directives/FormArrayItemRestoreButtonDirective.html +43 -5
- package/compodoc/directives/FormArrayRemovableDirective.html +25 -20
- package/compodoc/directives/OptionsFromMethodDirective.html +71 -66
- package/compodoc/interfaces/AutocompleteOptionsFromMethodDirectiveParameters.html +512 -0
- package/compodoc/interfaces/AutocompleteOptionsFromMethodDirectiveSettings.html +518 -0
- package/compodoc/interfaces/AutocompleteOptionsFromRemoteMethodTemplateContext.html +506 -0
- package/compodoc/interfaces/OptionsFromMethodDirectiveSettings.html +26 -14
- package/compodoc/interfaces/OptionsFromMethodTemplateContext.html +26 -14
- package/compodoc/js/menu-wc.js +12 -0
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/miscellaneous/functions.html +356 -0
- package/compodoc/overview.html +2 -2
- package/compodoc/properties.html +1 -1
- package/esm2022/index.mjs +2 -1
- package/esm2022/lib/directives/autocomplete-options-from-method.directive.mjs +168 -0
- package/esm2022/lib/directives/options-from-method.directive.mjs +17 -7
- package/fesm2022/rxap-form-system.mjs +250 -83
- package/fesm2022/rxap-form-system.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/lib/directives/autocomplete-options-from-method.directive.d.ts +71 -0
- package/lib/directives/options-from-method.directive.d.ts +6 -6
- package/package.json +29 -27
|
@@ -184,10 +184,6 @@
|
|
|
184
184
|
<span class="modifier">Protected</span>
|
|
185
185
|
<a href="#matFormField" >matFormField</a>
|
|
186
186
|
</li>
|
|
187
|
-
<li>
|
|
188
|
-
<span class="modifier">Protected</span>
|
|
189
|
-
<a href="#method" >method</a>
|
|
190
|
-
</li>
|
|
191
187
|
<li>
|
|
192
188
|
<span class="modifier">Protected</span>
|
|
193
189
|
<a href="#ngControl" >ngControl</a>
|
|
@@ -246,6 +242,9 @@
|
|
|
246
242
|
<tr>
|
|
247
243
|
<td class="col-md-4">
|
|
248
244
|
<ul class="index-list">
|
|
245
|
+
<li>
|
|
246
|
+
<a href="#rxapOptionsFromMethodCall" >rxapOptionsFromMethodCall</a>
|
|
247
|
+
</li>
|
|
249
248
|
<li>
|
|
250
249
|
<a href="#rxapOptionsFromMethodParameters" >rxapOptionsFromMethodParameters</a>
|
|
251
250
|
</li>
|
|
@@ -266,6 +265,27 @@
|
|
|
266
265
|
|
|
267
266
|
<section data-compodoc="block-inputs">
|
|
268
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="rxapOptionsFromMethodCall"></a>
|
|
273
|
+
<b>rxapOptionsFromMethodCall</b>
|
|
274
|
+
</td>
|
|
275
|
+
</tr>
|
|
276
|
+
<tr>
|
|
277
|
+
<td class="col-md-4">
|
|
278
|
+
<i>Type : </i> <code>Method<ControlOptions | Parameters></code>
|
|
279
|
+
|
|
280
|
+
</td>
|
|
281
|
+
</tr>
|
|
282
|
+
<tr>
|
|
283
|
+
<td class="col-md-2" colspan="2">
|
|
284
|
+
<div class="io-line">Defined in <a href="" data-line="66" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:66</a></div>
|
|
285
|
+
</td>
|
|
286
|
+
</tr>
|
|
287
|
+
</tbody>
|
|
288
|
+
</table>
|
|
269
289
|
<table class="table table-sm table-bordered">
|
|
270
290
|
<tbody>
|
|
271
291
|
<tr>
|
|
@@ -282,7 +302,7 @@
|
|
|
282
302
|
</tr>
|
|
283
303
|
<tr>
|
|
284
304
|
<td class="col-md-2" colspan="2">
|
|
285
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
305
|
+
<div class="io-line">Defined in <a href="" data-line="58" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:58</a></div>
|
|
286
306
|
</td>
|
|
287
307
|
</tr>
|
|
288
308
|
</tbody>
|
|
@@ -303,7 +323,7 @@
|
|
|
303
323
|
</tr>
|
|
304
324
|
<tr>
|
|
305
325
|
<td class="col-md-2" colspan="2">
|
|
306
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
326
|
+
<div class="io-line">Defined in <a href="" data-line="61" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:61</a></div>
|
|
307
327
|
</td>
|
|
308
328
|
</tr>
|
|
309
329
|
</tbody>
|
|
@@ -340,8 +360,8 @@
|
|
|
340
360
|
|
|
341
361
|
<tr>
|
|
342
362
|
<td class="col-md-4">
|
|
343
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
344
|
-
class="link-to-prism">src/lib/directives/options-from-method.directive.ts:
|
|
363
|
+
<div class="io-line">Defined in <a href="" data-line="100"
|
|
364
|
+
class="link-to-prism">src/lib/directives/options-from-method.directive.ts:100</a></div>
|
|
345
365
|
</td>
|
|
346
366
|
</tr>
|
|
347
367
|
|
|
@@ -377,7 +397,7 @@
|
|
|
377
397
|
</table>
|
|
378
398
|
</div>
|
|
379
399
|
<div class="io-description">
|
|
380
|
-
<b>Returns : </b> <code>Promise<ControlOptions></code>
|
|
400
|
+
<b>Returns : </b> <code>Promise<ControlOptions | null></code>
|
|
381
401
|
|
|
382
402
|
</div>
|
|
383
403
|
<div class="io-description">
|
|
@@ -409,8 +429,8 @@
|
|
|
409
429
|
|
|
410
430
|
<tr>
|
|
411
431
|
<td class="col-md-4">
|
|
412
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
413
|
-
class="link-to-prism">src/lib/directives/options-from-method.directive.ts:
|
|
432
|
+
<div class="io-line">Defined in <a href="" data-line="50"
|
|
433
|
+
class="link-to-prism">src/lib/directives/options-from-method.directive.ts:50</a></div>
|
|
414
434
|
</td>
|
|
415
435
|
</tr>
|
|
416
436
|
|
|
@@ -490,8 +510,8 @@
|
|
|
490
510
|
|
|
491
511
|
<tr>
|
|
492
512
|
<td class="col-md-4">
|
|
493
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
494
|
-
class="link-to-prism">src/lib/directives/options-from-method.directive.ts:
|
|
513
|
+
<div class="io-line">Defined in <a href="" data-line="104"
|
|
514
|
+
class="link-to-prism">src/lib/directives/options-from-method.directive.ts:104</a></div>
|
|
495
515
|
</td>
|
|
496
516
|
</tr>
|
|
497
517
|
|
|
@@ -522,15 +542,15 @@
|
|
|
522
542
|
<tr>
|
|
523
543
|
<td class="col-md-4">
|
|
524
544
|
<span class="modifier-icon icon ion-ios-reset"></span>
|
|
525
|
-
<code>setOptions(options: ControlOptions)</code>
|
|
545
|
+
<code>setOptions(options: ControlOptions | null)</code>
|
|
526
546
|
</td>
|
|
527
547
|
</tr>
|
|
528
548
|
|
|
529
549
|
|
|
530
550
|
<tr>
|
|
531
551
|
<td class="col-md-4">
|
|
532
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
533
|
-
class="link-to-prism">src/lib/directives/options-from-method.directive.ts:
|
|
552
|
+
<div class="io-line">Defined in <a href="" data-line="124"
|
|
553
|
+
class="link-to-prism">src/lib/directives/options-from-method.directive.ts:124</a></div>
|
|
534
554
|
</td>
|
|
535
555
|
</tr>
|
|
536
556
|
|
|
@@ -553,7 +573,7 @@
|
|
|
553
573
|
<tr>
|
|
554
574
|
<td>options</td>
|
|
555
575
|
<td>
|
|
556
|
-
<code>ControlOptions</code>
|
|
576
|
+
<code>ControlOptions | null</code>
|
|
557
577
|
</td>
|
|
558
578
|
|
|
559
579
|
<td>
|
|
@@ -608,7 +628,7 @@
|
|
|
608
628
|
</tr>
|
|
609
629
|
<tr>
|
|
610
630
|
<td class="col-md-4">
|
|
611
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
631
|
+
<div class="io-line">Defined in <a href="" data-line="72" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:72</a></div>
|
|
612
632
|
</td>
|
|
613
633
|
</tr>
|
|
614
634
|
|
|
@@ -641,7 +661,7 @@
|
|
|
641
661
|
</tr>
|
|
642
662
|
<tr>
|
|
643
663
|
<td class="col-md-4">
|
|
644
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
664
|
+
<div class="io-line">Defined in <a href="" data-line="71" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:71</a></div>
|
|
645
665
|
</td>
|
|
646
666
|
</tr>
|
|
647
667
|
|
|
@@ -673,34 +693,7 @@
|
|
|
673
693
|
</tr>
|
|
674
694
|
<tr>
|
|
675
695
|
<td class="col-md-4">
|
|
676
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
677
|
-
</td>
|
|
678
|
-
</tr>
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
</tbody>
|
|
682
|
-
</table>
|
|
683
|
-
<table class="table table-sm table-bordered">
|
|
684
|
-
<tbody>
|
|
685
|
-
<tr>
|
|
686
|
-
<td class="col-md-4">
|
|
687
|
-
<a name="method"></a>
|
|
688
|
-
<span class="name">
|
|
689
|
-
<span class="modifier">Protected</span>
|
|
690
|
-
<span ><b>method</b></span>
|
|
691
|
-
<a href="#method"><span class="icon ion-ios-link"></span></a>
|
|
692
|
-
</span>
|
|
693
|
-
</td>
|
|
694
|
-
</tr>
|
|
695
|
-
<tr>
|
|
696
|
-
<td class="col-md-4">
|
|
697
|
-
<i>Type : </i> <code>Method<ControlOptions | Parameters></code>
|
|
698
|
-
|
|
699
|
-
</td>
|
|
700
|
-
</tr>
|
|
701
|
-
<tr>
|
|
702
|
-
<td class="col-md-4">
|
|
703
|
-
<div class="io-line">Defined in <a href="" data-line="63" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:63</a></div>
|
|
696
|
+
<div class="io-line">Defined in <a href="" data-line="68" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:68</a></div>
|
|
704
697
|
</td>
|
|
705
698
|
</tr>
|
|
706
699
|
|
|
@@ -721,7 +714,7 @@
|
|
|
721
714
|
</tr>
|
|
722
715
|
<tr>
|
|
723
716
|
<td class="col-md-4">
|
|
724
|
-
<i>Type : </i> <code>NgControl | null</code>
|
|
717
|
+
<i>Type : </i> <code>NgControl | AbstractControlDirective | null</code>
|
|
725
718
|
|
|
726
719
|
</td>
|
|
727
720
|
</tr>
|
|
@@ -732,7 +725,7 @@
|
|
|
732
725
|
</tr>
|
|
733
726
|
<tr>
|
|
734
727
|
<td class="col-md-4">
|
|
735
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
728
|
+
<div class="io-line">Defined in <a href="" data-line="67" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:67</a></div>
|
|
736
729
|
</td>
|
|
737
730
|
</tr>
|
|
738
731
|
|
|
@@ -764,7 +757,7 @@
|
|
|
764
757
|
</tr>
|
|
765
758
|
<tr>
|
|
766
759
|
<td class="col-md-4">
|
|
767
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
760
|
+
<div class="io-line">Defined in <a href="" data-line="63" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:63</a></div>
|
|
768
761
|
</td>
|
|
769
762
|
</tr>
|
|
770
763
|
|
|
@@ -796,7 +789,7 @@
|
|
|
796
789
|
</tr>
|
|
797
790
|
<tr>
|
|
798
791
|
<td class="col-md-4">
|
|
799
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
792
|
+
<div class="io-line">Defined in <a href="" data-line="69" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:69</a></div>
|
|
800
793
|
</td>
|
|
801
794
|
</tr>
|
|
802
795
|
|
|
@@ -829,7 +822,7 @@
|
|
|
829
822
|
</tr>
|
|
830
823
|
<tr>
|
|
831
824
|
<td class="col-md-4">
|
|
832
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
825
|
+
<div class="io-line">Defined in <a href="" data-line="70" class="link-to-prism">src/lib/directives/options-from-method.directive.ts:70</a></div>
|
|
833
826
|
</td>
|
|
834
827
|
</tr>
|
|
835
828
|
|
|
@@ -856,8 +849,12 @@
|
|
|
856
849
|
TemplateRef,
|
|
857
850
|
ViewContainerRef,
|
|
858
851
|
} from '@angular/core';
|
|
859
|
-
import {
|
|
852
|
+
import {
|
|
853
|
+
AbstractControlDirective,
|
|
854
|
+
NgControl,
|
|
855
|
+
} from '@angular/forms';
|
|
860
856
|
import { MatFormField } from '@angular/material/form-field';
|
|
857
|
+
import { RxapFormControl } from '@rxap/forms';
|
|
861
858
|
import { Mixin } from '@rxap/mixin';
|
|
862
859
|
import { Method } from '@rxap/pattern';
|
|
863
860
|
import {
|
|
@@ -901,20 +898,23 @@ export class OptionsFromMethodDirective<Value = any, Parameters = a
|
|
|
901
898
|
@Input('rxapOptionsFromMethodResetOnChange')
|
|
902
899
|
public resetOnChange?: Value;
|
|
903
900
|
|
|
904
|
-
public options: ControlOptions | null
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
protected
|
|
909
|
-
protected
|
|
910
|
-
protected
|
|
901
|
+
public options: ControlOptions | null = null;
|
|
902
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
903
|
+
@Input('rxapOptionsFromMethodCall')
|
|
904
|
+
public method!: Method<ControlOptions, Parameters>;
|
|
905
|
+
protected ngControl: NgControl | AbstractControlDirective | null = null;
|
|
906
|
+
protected matFormField: MatFormField | null = null;
|
|
907
|
+
protected settings: OptionsFromMethodDirectiveSettings = {};
|
|
908
|
+
protected readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);
|
|
909
|
+
protected readonly injector: Injector = inject(INJECTOR);
|
|
911
910
|
protected readonly cdr: ChangeDetectorRef = inject(ChangeDetectorRef);
|
|
912
911
|
private readonly template: TemplateRef<OptionsFromMethodTemplateContext> = inject(TemplateRef);
|
|
913
912
|
|
|
914
913
|
public async ngAfterViewInit() {
|
|
915
|
-
this.ngControl = this.injector.get(NgControl, null);
|
|
916
914
|
this.matFormField = this.injector.get(MatFormField, null);
|
|
917
|
-
this.
|
|
915
|
+
this.ngControl = this.injector.get(NgControl, this.matFormField?._control.ngControl);
|
|
916
|
+
this.control = (this.ngControl?.control as RxapFormControl) ?? undefined;
|
|
917
|
+
this.method ??= this.extractOptionsMethod();
|
|
918
918
|
// ensure that the options are loaded. It is possible that the ngOnChange is triggered before the ngAfterViewInit
|
|
919
919
|
// then the options are not loaded.
|
|
920
920
|
if (!this.options) {
|
|
@@ -935,7 +935,7 @@ export class OptionsFromMethodDirective<Value = any, Parameters = a
|
|
|
935
935
|
}
|
|
936
936
|
}
|
|
937
937
|
|
|
938
|
-
protected async loadOptions(parameters?: Parameters): Promise<ControlOptions> {
|
|
938
|
+
protected async loadOptions(parameters?: Parameters): Promise<ControlOptions | null> {
|
|
939
939
|
return this.method.call(parameters);
|
|
940
940
|
}
|
|
941
941
|
|
|
@@ -959,9 +959,14 @@ export class OptionsFromMethodDirective<Value = any, Parameters = a
|
|
|
959
959
|
|
|
960
960
|
}
|
|
961
961
|
|
|
962
|
-
protected setOptions(options: ControlOptions) {
|
|
963
|
-
|
|
964
|
-
|
|
962
|
+
protected setOptions(options: ControlOptions | null) {
|
|
963
|
+
if (!options) {
|
|
964
|
+
this.options = null;
|
|
965
|
+
this.viewContainerRef.clear();
|
|
966
|
+
} else {
|
|
967
|
+
this.options = options.slice();
|
|
968
|
+
this.renderTemplate();
|
|
969
|
+
}
|
|
965
970
|
}
|
|
966
971
|
|
|
967
972
|
}
|