@rxap/components 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 +21 -0
- package/compodoc/changelog.html +20 -0
- package/compodoc/components/ConfirmComponent.html +106 -20
- package/compodoc/components/JsonViewerComponent.html +105 -188
- package/compodoc/dependencies.html +2 -2
- package/compodoc/directives/ConfirmDirective.html +271 -309
- package/compodoc/graph/dependencies.svg +4 -58
- package/compodoc/interfaces/Segment.html +40 -46
- package/compodoc/js/menu-wc.js +0 -43
- package/compodoc/js/menu-wc_es5.js +1 -1
- package/compodoc/js/search/search_index.js +2 -2
- package/compodoc/modules.html +0 -17
- package/compodoc/overview.html +1 -101
- package/compodoc/properties.html +1 -1
- package/docs/documentation.json +642 -963
- package/docs/html/assets/navigation.js +1 -1
- package/docs/html/assets/search.js +1 -1
- package/docs/html/classes/ConfirmComponent.html +2 -2
- package/docs/html/classes/ConfirmDirective.html +7 -5
- package/docs/html/classes/CopyToClipboardButtonComponent.html +2 -2
- package/docs/html/classes/CopyToClipboardComponent.html +2 -2
- package/docs/html/classes/EmptyRouterOutletComponent.html +2 -2
- package/docs/html/classes/JsonViewerComponent.html +3 -16
- package/docs/html/classes/NavigateBackButtonComponent.html +2 -2
- package/docs/html/index.html +2 -2
- package/docs/html/interfaces/Segment.html +2 -2
- package/docs/html/modules.html +1 -1
- package/docs/html/variables/JSON_VIEW_IGNORED_PROPERTIES.html +1 -1
- package/docs/html/variables/JSON_VIEW_IGNORED_TYPES.html +1 -1
- package/docs/markdown/README.md +1 -1
- package/docs/markdown/classes/ConfirmComponent.md +6 -6
- package/docs/markdown/classes/ConfirmDirective.md +41 -43
- package/docs/markdown/classes/CopyToClipboardButtonComponent.md +4 -4
- package/docs/markdown/classes/CopyToClipboardComponent.md +9 -9
- package/docs/markdown/classes/EmptyRouterOutletComponent.md +2 -2
- package/docs/markdown/classes/JsonViewerComponent.md +20 -96
- package/docs/markdown/classes/NavigateBackButtonComponent.md +3 -3
- package/docs/markdown/globals.md +2 -3
- package/docs/markdown/interfaces/Segment.md +7 -7
- package/docs/markdown/variables/JSON_VIEW_IGNORED_PROPERTIES.md +2 -2
- package/docs/markdown/variables/JSON_VIEW_IGNORED_TYPES.md +2 -2
- package/docs/wiki/Class.ConfirmComponent.md +5 -5
- package/docs/wiki/Class.ConfirmDirective.md +40 -42
- package/docs/wiki/Class.CopyToClipboardButtonComponent.md +3 -3
- package/docs/wiki/Class.CopyToClipboardComponent.md +8 -8
- package/docs/wiki/Class.EmptyRouterOutletComponent.md +1 -1
- package/docs/wiki/Class.JsonViewerComponent.md +19 -95
- package/docs/wiki/Class.NavigateBackButtonComponent.md +2 -2
- package/docs/wiki/Interface.Segment.md +6 -6
- package/docs/wiki/Variable.JSON_VIEW_IGNORED_PROPERTIES.md +1 -1
- package/docs/wiki/Variable.JSON_VIEW_IGNORED_TYPES.md +1 -1
- package/docs/wiki/_Sidebar.md +0 -1
- package/docs/wiki/globals.md +1 -2
- package/fesm2022/rxap-components.mjs +72 -118
- package/fesm2022/rxap-components.mjs.map +1 -1
- package/package.json +5 -5
- package/types/rxap-components.d.ts +41 -48
- package/docs/html/classes/ConfirmModule.html +0 -2
- package/docs/markdown/classes/ConfirmModule.md +0 -19
- package/docs/wiki/Class.ConfirmModule.md +0 -15
|
@@ -126,13 +126,6 @@
|
|
|
126
126
|
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
<p class="comment">
|
|
130
|
-
<h3>Implements</h3>
|
|
131
|
-
</p>
|
|
132
|
-
<p class="comment">
|
|
133
|
-
<code>OnInit</code>
|
|
134
|
-
<code>OnChanges</code>
|
|
135
|
-
</p>
|
|
136
129
|
|
|
137
130
|
|
|
138
131
|
<section data-compodoc="block-metadata">
|
|
@@ -209,9 +202,9 @@
|
|
|
209
202
|
<td class="col-md-4">
|
|
210
203
|
<ul class="index-list">
|
|
211
204
|
<li>
|
|
212
|
-
<span class="modifier"></span>
|
|
213
205
|
<span class="modifier">Public</span>
|
|
214
|
-
|
|
206
|
+
<span class="modifier">Readonly</span>
|
|
207
|
+
<a href="#expanded" >expanded</a>
|
|
215
208
|
</li>
|
|
216
209
|
<li>
|
|
217
210
|
<span class="modifier">Public</span>
|
|
@@ -223,10 +216,17 @@
|
|
|
223
216
|
</li>
|
|
224
217
|
<li>
|
|
225
218
|
<span class="modifier">Public</span>
|
|
219
|
+
<span class="modifier">Readonly</span>
|
|
226
220
|
<a href="#inspectValue" >inspectValue</a>
|
|
227
221
|
</li>
|
|
228
222
|
<li>
|
|
229
223
|
<span class="modifier">Public</span>
|
|
224
|
+
<span class="modifier">Readonly</span>
|
|
225
|
+
<a href="#json" >json</a>
|
|
226
|
+
</li>
|
|
227
|
+
<li>
|
|
228
|
+
<span class="modifier">Public</span>
|
|
229
|
+
<span class="modifier">Readonly</span>
|
|
230
230
|
<a href="#segments" >segments</a>
|
|
231
231
|
</li>
|
|
232
232
|
<li>
|
|
@@ -280,9 +280,6 @@
|
|
|
280
280
|
<li>
|
|
281
281
|
<a href="#expanded" >expanded</a>
|
|
282
282
|
</li>
|
|
283
|
-
<li>
|
|
284
|
-
<a href="#json" >json</a>
|
|
285
|
-
</li>
|
|
286
283
|
</ul>
|
|
287
284
|
</td>
|
|
288
285
|
</tr>
|
|
@@ -300,69 +297,15 @@
|
|
|
300
297
|
<tbody>
|
|
301
298
|
<tr>
|
|
302
299
|
<td class="col-md-4">
|
|
303
|
-
<code>constructor(
|
|
300
|
+
<code>constructor()</code>
|
|
304
301
|
</td>
|
|
305
302
|
</tr>
|
|
306
303
|
<tr>
|
|
307
304
|
<td class="col-md-4">
|
|
308
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
305
|
+
<div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:53</a></div>
|
|
309
306
|
</td>
|
|
310
307
|
</tr>
|
|
311
308
|
|
|
312
|
-
<tr>
|
|
313
|
-
<td class="col-md-4">
|
|
314
|
-
<div>
|
|
315
|
-
<b>Parameters :</b>
|
|
316
|
-
<table class="params">
|
|
317
|
-
<thead>
|
|
318
|
-
<tr>
|
|
319
|
-
<td>Name</td>
|
|
320
|
-
<td>Type</td>
|
|
321
|
-
<td>Optional</td>
|
|
322
|
-
</tr>
|
|
323
|
-
</thead>
|
|
324
|
-
<tbody>
|
|
325
|
-
<tr>
|
|
326
|
-
<td>ignoredProperties</td>
|
|
327
|
-
|
|
328
|
-
<td>
|
|
329
|
-
<code>Array<string | RegExp | Array></code>
|
|
330
|
-
</td>
|
|
331
|
-
|
|
332
|
-
<td>
|
|
333
|
-
No
|
|
334
|
-
</td>
|
|
335
|
-
|
|
336
|
-
</tr>
|
|
337
|
-
<tr>
|
|
338
|
-
<td>ignoredTypes</td>
|
|
339
|
-
|
|
340
|
-
<td>
|
|
341
|
-
<code>Array<any | []></code>
|
|
342
|
-
</td>
|
|
343
|
-
|
|
344
|
-
<td>
|
|
345
|
-
No
|
|
346
|
-
</td>
|
|
347
|
-
|
|
348
|
-
</tr>
|
|
349
|
-
<tr>
|
|
350
|
-
<td>cdr</td>
|
|
351
|
-
|
|
352
|
-
<td>
|
|
353
|
-
<code>ChangeDetectorRef</code>
|
|
354
|
-
</td>
|
|
355
|
-
|
|
356
|
-
<td>
|
|
357
|
-
No
|
|
358
|
-
</td>
|
|
359
|
-
|
|
360
|
-
</tr>
|
|
361
|
-
</tbody>
|
|
362
|
-
</table>
|
|
363
|
-
</div>
|
|
364
|
-
</td>
|
|
365
|
-
</tr>
|
|
366
309
|
</tbody>
|
|
367
310
|
</table>
|
|
368
311
|
</section>
|
|
@@ -377,42 +320,10 @@
|
|
|
377
320
|
<b>expanded</b>
|
|
378
321
|
</td>
|
|
379
322
|
</tr>
|
|
380
|
-
<tr>
|
|
381
|
-
<td class="col-md-4">
|
|
382
|
-
<i>Type : </i> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/boolean" target="_blank" >boolean</a></code>
|
|
383
|
-
|
|
384
|
-
</td>
|
|
385
|
-
</tr>
|
|
386
323
|
<tr>
|
|
387
324
|
<td class="col-md-4">
|
|
388
325
|
<i>Default value : </i><code>false</code>
|
|
389
326
|
</td>
|
|
390
|
-
</tr>
|
|
391
|
-
<tr>
|
|
392
|
-
<td class="col-md-2" colspan="2">
|
|
393
|
-
<div class="io-line">Defined in <a href="" data-line="45" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:45</a></div>
|
|
394
|
-
</td>
|
|
395
|
-
</tr>
|
|
396
|
-
</tbody>
|
|
397
|
-
</table>
|
|
398
|
-
<table class="table table-sm table-bordered">
|
|
399
|
-
<tbody>
|
|
400
|
-
<tr>
|
|
401
|
-
<td class="col-md-4">
|
|
402
|
-
<a name="json"></a>
|
|
403
|
-
<b>json</b>
|
|
404
|
-
</td>
|
|
405
|
-
</tr>
|
|
406
|
-
<tr>
|
|
407
|
-
<td class="col-md-4">
|
|
408
|
-
<i>Type : </i> <code>object | Record<string | number | symbol | ></code>
|
|
409
|
-
|
|
410
|
-
</td>
|
|
411
|
-
</tr>
|
|
412
|
-
<tr>
|
|
413
|
-
<td class="col-md-4">
|
|
414
|
-
<i>Default value : </i><code>{}</code>
|
|
415
|
-
</td>
|
|
416
327
|
</tr>
|
|
417
328
|
<tr>
|
|
418
329
|
<td class="col-md-2" colspan="2">
|
|
@@ -452,8 +363,8 @@
|
|
|
452
363
|
|
|
453
364
|
<tr>
|
|
454
365
|
<td class="col-md-4">
|
|
455
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
456
|
-
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:
|
|
366
|
+
<div class="io-line">Defined in <a href="" data-line="134"
|
|
367
|
+
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:134</a></div>
|
|
457
368
|
</td>
|
|
458
369
|
</tr>
|
|
459
370
|
|
|
@@ -521,8 +432,8 @@
|
|
|
521
432
|
|
|
522
433
|
<tr>
|
|
523
434
|
<td class="col-md-4">
|
|
524
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
525
|
-
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:
|
|
435
|
+
<div class="io-line">Defined in <a href="" data-line="86"
|
|
436
|
+
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:86</a></div>
|
|
526
437
|
</td>
|
|
527
438
|
</tr>
|
|
528
439
|
|
|
@@ -608,8 +519,8 @@
|
|
|
608
519
|
|
|
609
520
|
<tr>
|
|
610
521
|
<td class="col-md-4">
|
|
611
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
612
|
-
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:
|
|
522
|
+
<div class="io-line">Defined in <a href="" data-line="142"
|
|
523
|
+
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:142</a></div>
|
|
613
524
|
</td>
|
|
614
525
|
</tr>
|
|
615
526
|
|
|
@@ -677,8 +588,8 @@
|
|
|
677
588
|
|
|
678
589
|
<tr>
|
|
679
590
|
<td class="col-md-4">
|
|
680
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
681
|
-
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:
|
|
591
|
+
<div class="io-line">Defined in <a href="" data-line="121"
|
|
592
|
+
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:121</a></div>
|
|
682
593
|
</td>
|
|
683
594
|
</tr>
|
|
684
595
|
|
|
@@ -746,8 +657,8 @@
|
|
|
746
657
|
|
|
747
658
|
<tr>
|
|
748
659
|
<td class="col-md-4">
|
|
749
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
750
|
-
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:
|
|
660
|
+
<div class="io-line">Defined in <a href="" data-line="146"
|
|
661
|
+
class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:146</a></div>
|
|
751
662
|
</td>
|
|
752
663
|
</tr>
|
|
753
664
|
|
|
@@ -803,33 +714,23 @@
|
|
|
803
714
|
<tbody>
|
|
804
715
|
<tr>
|
|
805
716
|
<td class="col-md-4">
|
|
806
|
-
<a name="
|
|
717
|
+
<a name="expanded"></a>
|
|
807
718
|
<span class="name">
|
|
808
|
-
<span class="modifier"></span>
|
|
809
719
|
<span class="modifier">Public</span>
|
|
810
|
-
|
|
811
|
-
<
|
|
720
|
+
<span class="modifier">Readonly</span>
|
|
721
|
+
<span ><b>expanded</b></span>
|
|
722
|
+
<a href="#expanded"><span class="icon ion-ios-link"></span></a>
|
|
812
723
|
</span>
|
|
813
724
|
</td>
|
|
814
725
|
</tr>
|
|
815
726
|
<tr>
|
|
816
727
|
<td class="col-md-4">
|
|
817
|
-
<i>
|
|
818
|
-
|
|
819
|
-
</td>
|
|
820
|
-
</tr>
|
|
821
|
-
<tr>
|
|
822
|
-
<td class="col-md-4">
|
|
823
|
-
<b>Decorators : </b>
|
|
824
|
-
<br />
|
|
825
|
-
<code>
|
|
826
|
-
@Inject(ChangeDetectorRef)<br />
|
|
827
|
-
</code>
|
|
728
|
+
<i>Default value : </i><code>false</code>
|
|
828
729
|
</td>
|
|
829
730
|
</tr>
|
|
830
731
|
<tr>
|
|
831
732
|
<td class="col-md-4">
|
|
832
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
733
|
+
<div class="io-line">Defined in <a href="" data-line="44" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:44</a></div>
|
|
833
734
|
</td>
|
|
834
735
|
</tr>
|
|
835
736
|
|
|
@@ -861,7 +762,7 @@
|
|
|
861
762
|
</tr>
|
|
862
763
|
<tr>
|
|
863
764
|
<td class="col-md-4">
|
|
864
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
765
|
+
<div class="io-line">Defined in <a href="" data-line="48" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:48</a></div>
|
|
865
766
|
</td>
|
|
866
767
|
</tr>
|
|
867
768
|
|
|
@@ -893,7 +794,7 @@
|
|
|
893
794
|
</tr>
|
|
894
795
|
<tr>
|
|
895
796
|
<td class="col-md-4">
|
|
896
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
797
|
+
<div class="io-line">Defined in <a href="" data-line="49" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:49</a></div>
|
|
897
798
|
</td>
|
|
898
799
|
</tr>
|
|
899
800
|
|
|
@@ -907,6 +808,7 @@
|
|
|
907
808
|
<a name="inspectValue"></a>
|
|
908
809
|
<span class="name">
|
|
909
810
|
<span class="modifier">Public</span>
|
|
811
|
+
<span class="modifier">Readonly</span>
|
|
910
812
|
<span ><b>inspectValue</b></span>
|
|
911
813
|
<a href="#inspectValue"><span class="icon ion-ios-link"></span></a>
|
|
912
814
|
</span>
|
|
@@ -914,13 +816,12 @@
|
|
|
914
816
|
</tr>
|
|
915
817
|
<tr>
|
|
916
818
|
<td class="col-md-4">
|
|
917
|
-
<i>
|
|
918
|
-
|
|
819
|
+
<i>Default value : </i><code>signal<any>(undefined)</code>
|
|
919
820
|
</td>
|
|
920
821
|
</tr>
|
|
921
822
|
<tr>
|
|
922
823
|
<td class="col-md-4">
|
|
923
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
824
|
+
<div class="io-line">Defined in <a href="" data-line="46" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:46</a></div>
|
|
924
825
|
</td>
|
|
925
826
|
</tr>
|
|
926
827
|
|
|
@@ -931,28 +832,50 @@
|
|
|
931
832
|
<tbody>
|
|
932
833
|
<tr>
|
|
933
834
|
<td class="col-md-4">
|
|
934
|
-
<a name="
|
|
835
|
+
<a name="json"></a>
|
|
935
836
|
<span class="name">
|
|
936
837
|
<span class="modifier">Public</span>
|
|
937
|
-
|
|
938
|
-
<
|
|
838
|
+
<span class="modifier">Readonly</span>
|
|
839
|
+
<span ><b>json</b></span>
|
|
840
|
+
<a href="#json"><span class="icon ion-ios-link"></span></a>
|
|
939
841
|
</span>
|
|
940
842
|
</td>
|
|
941
843
|
</tr>
|
|
942
844
|
<tr>
|
|
943
845
|
<td class="col-md-4">
|
|
944
|
-
<i>
|
|
945
|
-
|
|
846
|
+
<i>Default value : </i><code>input<object | Record<string | number | symbol, unknown>>({})</code>
|
|
946
847
|
</td>
|
|
947
848
|
</tr>
|
|
849
|
+
<tr>
|
|
850
|
+
<td class="col-md-4">
|
|
851
|
+
<div class="io-line">Defined in <a href="" data-line="43" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:43</a></div>
|
|
852
|
+
</td>
|
|
853
|
+
</tr>
|
|
854
|
+
|
|
855
|
+
|
|
856
|
+
</tbody>
|
|
857
|
+
</table>
|
|
858
|
+
<table class="table table-sm table-bordered">
|
|
859
|
+
<tbody>
|
|
860
|
+
<tr>
|
|
861
|
+
<td class="col-md-4">
|
|
862
|
+
<a name="segments"></a>
|
|
863
|
+
<span class="name">
|
|
864
|
+
<span class="modifier">Public</span>
|
|
865
|
+
<span class="modifier">Readonly</span>
|
|
866
|
+
<span ><b>segments</b></span>
|
|
867
|
+
<a href="#segments"><span class="icon ion-ios-link"></span></a>
|
|
868
|
+
</span>
|
|
869
|
+
</td>
|
|
870
|
+
</tr>
|
|
948
871
|
<tr>
|
|
949
872
|
<td class="col-md-4">
|
|
950
|
-
<i>Default value : </i><code>[]</code>
|
|
873
|
+
<i>Default value : </i><code>signal<Segment[]>([])</code>
|
|
951
874
|
</td>
|
|
952
875
|
</tr>
|
|
953
876
|
<tr>
|
|
954
877
|
<td class="col-md-4">
|
|
955
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
878
|
+
<div class="io-line">Defined in <a href="" data-line="53" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:53</a></div>
|
|
956
879
|
</td>
|
|
957
880
|
</tr>
|
|
958
881
|
|
|
@@ -978,7 +901,7 @@
|
|
|
978
901
|
</tr>
|
|
979
902
|
<tr>
|
|
980
903
|
<td class="col-md-4">
|
|
981
|
-
<div class="io-line">Defined in <a href="" data-line="
|
|
904
|
+
<div class="io-line">Defined in <a href="" data-line="51" class="link-to-prism">src/lib/json-viewer/json-viewer.component.ts:51</a></div>
|
|
982
905
|
</td>
|
|
983
906
|
</tr>
|
|
984
907
|
|
|
@@ -992,18 +915,7 @@
|
|
|
992
915
|
|
|
993
916
|
<div class="tab-pane fade tab-source-code" id="source">
|
|
994
917
|
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { NgClass } from '@angular/common';
|
|
995
|
-
import {
|
|
996
|
-
ChangeDetectionStrategy,
|
|
997
|
-
ChangeDetectorRef,
|
|
998
|
-
Component,
|
|
999
|
-
forwardRef,
|
|
1000
|
-
Inject,
|
|
1001
|
-
Input,
|
|
1002
|
-
isDevMode,
|
|
1003
|
-
OnChanges,
|
|
1004
|
-
OnInit,
|
|
1005
|
-
SimpleChanges,
|
|
1006
|
-
} from '@angular/core';
|
|
918
|
+
import { ChangeDetectionStrategy, Component, effect, forwardRef, isDevMode, signal, untracked, input, inject } from '@angular/core';
|
|
1007
919
|
import { isTeardownLogic } from '@rxap/rxjs';
|
|
1008
920
|
import {
|
|
1009
921
|
clone,
|
|
@@ -1014,6 +926,7 @@ import {
|
|
|
1014
926
|
JSON_VIEW_IGNORED_PROPERTIES,
|
|
1015
927
|
JSON_VIEW_IGNORED_TYPES,
|
|
1016
928
|
} from './json-viewer.tokens';
|
|
929
|
+
import { Showcase } from '@ng-prism/core';
|
|
1017
930
|
|
|
1018
931
|
export interface Segment {
|
|
1019
932
|
key: string;
|
|
@@ -1023,6 +936,16 @@ export interface Segment {
|
|
|
1023
936
|
expanded: boolean;
|
|
1024
937
|
}
|
|
1025
938
|
|
|
939
|
+
@Showcase<JsonViewerComponent>({
|
|
940
|
+
title: 'JSON Viewer',
|
|
941
|
+
category: 'Components',
|
|
942
|
+
description: 'Renders an object as an expandable tree of key value pairs.',
|
|
943
|
+
status: 'stable',
|
|
944
|
+
variants: [
|
|
945
|
+
{ name: 'Collapsed', inputs: { json: { name: 'rxap', version: '22.0.0', tags: [ 'angular', 'nest' ], author: { name: 'RxAP' } } } },
|
|
946
|
+
{ name: 'Expanded', inputs: { expanded: true, json: { name: 'rxap', version: '22.0.0', tags: [ 'angular', 'nest' ], author: { name: 'RxAP' } } } },
|
|
947
|
+
],
|
|
948
|
+
})
|
|
1026
949
|
@Component({
|
|
1027
950
|
selector: 'rxap-json-viewer',
|
|
1028
951
|
templateUrl: './json-viewer.component.html',
|
|
@@ -1031,26 +954,24 @@ export interface Segment {
|
|
|
1031
954
|
host: { class: 'rxap-json-viewer' },
|
|
1032
955
|
imports: [NgClass, forwardRef(() => JsonViewerComponent)]
|
|
1033
956
|
})
|
|
1034
|
-
export class JsonViewerComponent
|
|
957
|
+
export class JsonViewerComponent {
|
|
1035
958
|
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
@Input() public expanded = false;
|
|
959
|
+
public readonly json = input<object | Record<string | number | symbol, unknown>>({});
|
|
960
|
+
public readonly expanded = input(false);
|
|
1039
961
|
|
|
1040
|
-
public inspectValue
|
|
962
|
+
public readonly inspectValue = signal<any>(undefined);
|
|
1041
963
|
|
|
1042
964
|
public ignoredProperties: Array<string | RegExp> = [];
|
|
1043
965
|
public ignoredTypes: any[] = [];
|
|
1044
966
|
|
|
1045
967
|
public subscriptions = new Subscription();
|
|
1046
968
|
|
|
1047
|
-
public segments
|
|
969
|
+
public readonly segments = signal<Segment[]>([]);
|
|
970
|
+
|
|
971
|
+
constructor() {
|
|
972
|
+
const ignoredProperties = inject<Array<string | RegExp | Array<string | RegExp>>>(JSON_VIEW_IGNORED_PROPERTIES);
|
|
973
|
+
const ignoredTypes = inject<Array<any | any[]>>(JSON_VIEW_IGNORED_TYPES);
|
|
1048
974
|
|
|
1049
|
-
constructor(
|
|
1050
|
-
@Inject(JSON_VIEW_IGNORED_PROPERTIES) ignoredProperties: Array<string | RegExp | Array<string | RegExp>>,
|
|
1051
|
-
@Inject(JSON_VIEW_IGNORED_TYPES) ignoredTypes: Array<any | any[]>,
|
|
1052
|
-
@Inject(ChangeDetectorRef) public cdr: ChangeDetectorRef,
|
|
1053
|
-
) {
|
|
1054
975
|
function flat(acc: any[], cur: any | any[]): any[] {
|
|
1055
976
|
if (Array.isArray(cur)) {
|
|
1056
977
|
acc.push(...cur.reduce(flat, []));
|
|
@@ -1063,24 +984,23 @@ export class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
1063
984
|
|
|
1064
985
|
this.ignoredProperties = ignoredProperties.reduce(flat, []);
|
|
1065
986
|
this.ignoredTypes = ignoredTypes.reduce(flat, []);
|
|
1066
|
-
}
|
|
1067
987
|
|
|
1068
|
-
|
|
1069
|
-
|
|
988
|
+
effect(() => {
|
|
989
|
+
const json = this.json();
|
|
990
|
+
untracked(() => {
|
|
991
|
+
if (isDevMode() && this.initialized) {
|
|
992
|
+
console.debug('json change');
|
|
993
|
+
}
|
|
994
|
+
this.initialized = true;
|
|
995
|
+
this.setInspectValue(json);
|
|
996
|
+
});
|
|
997
|
+
});
|
|
1070
998
|
}
|
|
1071
999
|
|
|
1072
|
-
|
|
1073
|
-
const jsonChange = changes['json'];
|
|
1074
|
-
if (jsonChange) {
|
|
1075
|
-
if (isDevMode()) {
|
|
1076
|
-
console.debug('json change');
|
|
1077
|
-
}
|
|
1078
|
-
this.setInspectValue(jsonChange.currentValue);
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1000
|
+
private initialized = false;
|
|
1081
1001
|
|
|
1082
1002
|
public cleanObject(obj: any, stack: any[] = []): any {
|
|
1083
|
-
if (typeof obj
|
|
1003
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
1084
1004
|
return obj;
|
|
1085
1005
|
}
|
|
1086
1006
|
if (stack.some(item => item === obj)) {
|
|
@@ -1121,21 +1041,17 @@ export class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
1121
1041
|
if (typeof json['toJSON'] === 'function') {
|
|
1122
1042
|
json = json.toJSON();
|
|
1123
1043
|
}
|
|
1124
|
-
|
|
1125
|
-
this.
|
|
1126
|
-
this.
|
|
1044
|
+
const inspectValue = this.cleanObject(clone(json));
|
|
1045
|
+
this.inspectValue.set(inspectValue);
|
|
1046
|
+
this.buildSegments(inspectValue);
|
|
1127
1047
|
}
|
|
1128
1048
|
}
|
|
1129
1049
|
|
|
1130
1050
|
public buildSegments(inspectValue: any) {
|
|
1131
|
-
this.segments = [];
|
|
1132
|
-
|
|
1133
1051
|
if (typeof inspectValue === 'object') {
|
|
1134
|
-
Object.keys(inspectValue).
|
|
1135
|
-
this.segments.push(this.parseKeyValue(key, inspectValue[key]));
|
|
1136
|
-
});
|
|
1052
|
+
this.segments.set(Object.keys(inspectValue).map(key => this.parseKeyValue(key, inspectValue[key])));
|
|
1137
1053
|
} else {
|
|
1138
|
-
this.segments.
|
|
1054
|
+
this.segments.set([ this.parseKeyValue(`(${ typeof inspectValue })`, inspectValue) ]);
|
|
1139
1055
|
}
|
|
1140
1056
|
}
|
|
1141
1057
|
|
|
@@ -1146,6 +1062,7 @@ export class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
1146
1062
|
public toggle(segment: Segment) {
|
|
1147
1063
|
if (this.isExpandable(segment)) {
|
|
1148
1064
|
segment.expanded = !segment.expanded;
|
|
1065
|
+
this.segments.update(segments => [ ...segments ]);
|
|
1149
1066
|
}
|
|
1150
1067
|
}
|
|
1151
1068
|
|
|
@@ -1155,7 +1072,7 @@ export class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
1155
1072
|
value: value,
|
|
1156
1073
|
type: undefined,
|
|
1157
1074
|
description: '' + value,
|
|
1158
|
-
expanded: this.expanded,
|
|
1075
|
+
expanded: this.expanded(),
|
|
1159
1076
|
};
|
|
1160
1077
|
|
|
1161
1078
|
switch (typeof segment.value) {
|
|
@@ -1208,7 +1125,7 @@ export class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
1208
1125
|
|
|
1209
1126
|
<div class="tab-pane fade " id="templateData">
|
|
1210
1127
|
<pre class="line-numbers"><code class="language-html"><section class="rxap-container">
|
|
1211
|
-
@for (segment of segments; track segment) {
|
|
1128
|
+
@for (segment of segments(); track segment) {
|
|
1212
1129
|
<section
|
|
1213
1130
|
[ngClass]="['segment', 'segment-type-' + segment.type]">
|
|
1214
1131
|
<section
|
|
@@ -1230,7 +1147,7 @@ export class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
1230
1147
|
</section>
|
|
1231
1148
|
@if (segment.expanded && isExpandable(segment)) {
|
|
1232
1149
|
<section class="children">
|
|
1233
|
-
<rxap-json-viewer [expanded]="expanded" [json]="segment.value"></rxap-json-viewer>
|
|
1150
|
+
<rxap-json-viewer [expanded]="expanded()" [json]="segment.value"></rxap-json-viewer>
|
|
1234
1151
|
</section>
|
|
1235
1152
|
}
|
|
1236
1153
|
</section>
|
|
@@ -1386,7 +1303,7 @@ export class JsonViewerComponent implements OnInit, OnChanges {
|
|
|
1386
1303
|
<script src="../js/libs/htmlparser.js"></script>
|
|
1387
1304
|
<script src="../js/libs/deep-iterator.js"></script>
|
|
1388
1305
|
<script>
|
|
1389
|
-
var COMPONENT_TEMPLATE = '<div><section class="rxap-container"> @for (segment of segments; track segment) { <section [ngClass]="[\'segment\', \'segment-type-\' + segment.type]"> <section (click)="toggle(segment)" [ngClass]="{ \'segment-main\': true, \'expandable\': isExpandable(segment), \'expanded\': segment.expanded }"> @if (isExpandable(segment)) { <div class="toggler"></div> } <span class="segment-key text-primary">{{ segment.key }}</span> <span class="segment-separator">: </span> @if (!segment.expanded || !isExpandable(segment)) { <span class="segment-value text-white dark:text-black">{{ segment.description }}</span> } </section> @if (segment.expanded && isExpandable(segment)) { <section class="children"> <rxap-json-viewer [expanded]="expanded" [json]="segment.value"></rxap-json-viewer> </section> } </section> }</section></div>'
|
|
1306
|
+
var COMPONENT_TEMPLATE = '<div><section class="rxap-container"> @for (segment of segments(); track segment) { <section [ngClass]="[\'segment\', \'segment-type-\' + segment.type]"> <section (click)="toggle(segment)" [ngClass]="{ \'segment-main\': true, \'expandable\': isExpandable(segment), \'expanded\': segment.expanded }"> @if (isExpandable(segment)) { <div class="toggler"></div> } <span class="segment-key text-primary">{{ segment.key }}</span> <span class="segment-separator">: </span> @if (!segment.expanded || !isExpandable(segment)) { <span class="segment-value text-white dark:text-black">{{ segment.description }}</span> } </section> @if (segment.expanded && isExpandable(segment)) { <section class="children"> <rxap-json-viewer [expanded]="expanded()" [json]="segment.value"></rxap-json-viewer> </section> } </section> }</section></div>'
|
|
1390
1307
|
var COMPONENTS = [{'name': 'ConfirmComponent', 'selector': 'rxap-confirm'},{'name': 'CopyToClipboardButtonComponent', 'selector': 'rxap-copy-to-clipboard-button'},{'name': 'CopyToClipboardComponent', 'selector': 'rxap-copy-to-clipboard'},{'name': 'EmptyRouterOutletComponent', 'selector': 'rxap-empty-router-outlet'},{'name': 'JsonViewerComponent', 'selector': 'rxap-json-viewer'},{'name': 'NavigateBackButtonComponent', 'selector': 'rxap-navigate-back-button'}];
|
|
1391
1308
|
var DIRECTIVES = [{'name': 'ConfirmDirective', 'selector': '[rxapConfirm]'}];
|
|
1392
1309
|
var ACTUAL_COMPONENT = {'name': 'JsonViewerComponent'};
|
|
@@ -123,9 +123,9 @@
|
|
|
123
123
|
<li>
|
|
124
124
|
<b>@angular/router</b> : ^21.2.9</li>
|
|
125
125
|
<li>
|
|
126
|
-
<b>@rxap/rxjs</b> : ^1.1.18-dev.
|
|
126
|
+
<b>@rxap/rxjs</b> : ^1.1.18-dev.1</li>
|
|
127
127
|
<li>
|
|
128
|
-
<b>@rxap/utilities</b> : ^16.5.2-dev.
|
|
128
|
+
<b>@rxap/utilities</b> : ^16.5.2-dev.1</li>
|
|
129
129
|
<li>
|
|
130
130
|
<b>rxjs</b> : ^7.8.2</li>
|
|
131
131
|
</ul>
|