@eui/core 17.0.1 → 17.0.2-snapshot-1701743166803
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/docs/dependencies.html +2 -2
- package/docs/injectables/LocaleService.html +112 -7
- package/docs/injectables/LocaleServiceMock.html +7 -2
- package/docs/js/search/search_index.js +2 -2
- package/docs/properties.html +1 -1
- package/esm2022/lib/services/locale/locale.service.mjs +60 -59
- package/fesm2022/eui-core.mjs +57 -56
- package/fesm2022/eui-core.mjs.map +1 -1
- package/lib/services/locale/locale.service.d.ts +68 -25
- package/lib/services/locale/locale.service.d.ts.map +1 -1
- package/package.json +2 -2
package/docs/dependencies.html
CHANGED
|
@@ -309,9 +309,9 @@
|
|
|
309
309
|
<li>
|
|
310
310
|
<b>@stackblitz/sdk</b> : 1.9.0</li>
|
|
311
311
|
<li>
|
|
312
|
-
<b>@eui/styles-base</b> : 17.0.1
|
|
312
|
+
<b>@eui/styles-base</b> : 17.0.1</li>
|
|
313
313
|
<li>
|
|
314
|
-
<b>@eui/ecl</b> : 17.0.1
|
|
314
|
+
<b>@eui/ecl</b> : 17.0.1</li>
|
|
315
315
|
<li>
|
|
316
316
|
<b>@eui/tools</b> : ^6.0.0</li>
|
|
317
317
|
</ul>
|
|
@@ -121,6 +121,20 @@
|
|
|
121
121
|
</p>
|
|
122
122
|
|
|
123
123
|
|
|
124
|
+
<p class="comment">
|
|
125
|
+
<h3>Description</h3>
|
|
126
|
+
</p>
|
|
127
|
+
<p class="comment">
|
|
128
|
+
<p>LocaleService is responsible for managing locale states and configurations in an Angular application.
|
|
129
|
+
It utilizes the CLDR library to load and construct the locale for each region. This service allows
|
|
130
|
+
for dynamic loading of locales upon request and updates the state of the EUI app accordingly.</p>
|
|
131
|
+
<p>Key functionalities include:</p>
|
|
132
|
+
<ul>
|
|
133
|
+
<li>Binding to a translation service for locale changes.</li>
|
|
134
|
+
<li>Updating the Angular LOCALE_ID token.</li>
|
|
135
|
+
</ul>
|
|
136
|
+
|
|
137
|
+
</p>
|
|
124
138
|
|
|
125
139
|
<p class="comment">
|
|
126
140
|
<h3>Extends</h3>
|
|
@@ -144,7 +158,7 @@
|
|
|
144
158
|
<td class="col-md-4">
|
|
145
159
|
<ul class="index-list">
|
|
146
160
|
<li>
|
|
147
|
-
<a href="#addLocale" >addLocale</a>
|
|
161
|
+
<a href="#addLocale" class="deprecated-name">addLocale</a>
|
|
148
162
|
</li>
|
|
149
163
|
<li>
|
|
150
164
|
<a href="#getState" >getState</a>
|
|
@@ -305,11 +319,16 @@
|
|
|
305
319
|
<td class="col-md-4">
|
|
306
320
|
<a name="addLocale"></a>
|
|
307
321
|
<span class="name">
|
|
308
|
-
<span ><b>addLocale</b></span>
|
|
322
|
+
<span class="deprecated-name"><b>addLocale</b></span>
|
|
309
323
|
<a href="#addLocale"><span class="icon ion-ios-link"></span></a>
|
|
310
324
|
</span>
|
|
311
325
|
</td>
|
|
312
326
|
</tr>
|
|
327
|
+
<tr>
|
|
328
|
+
<td class="col-md-4 deprecated">
|
|
329
|
+
eui does not offer a way to dynamically add locale it will be removed in future versions
|
|
330
|
+
</td>
|
|
331
|
+
</tr>
|
|
313
332
|
<tr>
|
|
314
333
|
<td class="col-md-4">
|
|
315
334
|
<code>addLocale(id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
|
@@ -390,6 +409,8 @@
|
|
|
390
409
|
|
|
391
410
|
<tr>
|
|
392
411
|
<td class="col-md-4">
|
|
412
|
+
<div class="io-description"><p>Retrieves the state of the locale service. This method is overloaded to allow different ways of accessing the state.</p>
|
|
413
|
+
<b>Example :</b><div><pre class="line-numbers"><code class="language-none"> Takes the current state as an argument and returns the transformed state.</code></pre></div></div>
|
|
393
414
|
|
|
394
415
|
<div class="io-description">
|
|
395
416
|
<b>Parameters :</b>
|
|
@@ -400,6 +421,7 @@
|
|
|
400
421
|
<td>Name</td>
|
|
401
422
|
<td>Type</td>
|
|
402
423
|
<td>Optional</td>
|
|
424
|
+
<td>Description</td>
|
|
403
425
|
</tr>
|
|
404
426
|
</thead>
|
|
405
427
|
<tbody>
|
|
@@ -414,6 +436,13 @@
|
|
|
414
436
|
</td>
|
|
415
437
|
|
|
416
438
|
|
|
439
|
+
<td>
|
|
440
|
+
<ul>
|
|
441
|
+
<li>A function that maps the state to a specific form.
|
|
442
|
+
Takes the current state as an argument and returns the transformed state.</li>
|
|
443
|
+
</ul>
|
|
444
|
+
|
|
445
|
+
</td>
|
|
417
446
|
</tr>
|
|
418
447
|
</tbody>
|
|
419
448
|
</table>
|
|
@@ -423,7 +452,10 @@
|
|
|
423
452
|
|
|
424
453
|
</div>
|
|
425
454
|
<div class="io-description">
|
|
426
|
-
|
|
455
|
+
<ul>
|
|
456
|
+
<li>An observable that emits the transformed state.</li>
|
|
457
|
+
</ul>
|
|
458
|
+
|
|
427
459
|
</div>
|
|
428
460
|
</td>
|
|
429
461
|
</tr>
|
|
@@ -459,6 +491,7 @@
|
|
|
459
491
|
|
|
460
492
|
<tr>
|
|
461
493
|
<td class="col-md-4">
|
|
494
|
+
<div class="io-description"><b>Example :</b><div><pre class="line-numbers"><code class="language-none"> The key should be a property name of the state object.</code></pre></div></div>
|
|
462
495
|
|
|
463
496
|
<div class="io-description">
|
|
464
497
|
<b>Parameters :</b>
|
|
@@ -469,6 +502,7 @@
|
|
|
469
502
|
<td>Name</td>
|
|
470
503
|
<td>Type</td>
|
|
471
504
|
<td>Optional</td>
|
|
505
|
+
<td>Description</td>
|
|
472
506
|
</tr>
|
|
473
507
|
</thead>
|
|
474
508
|
<tbody>
|
|
@@ -483,6 +517,13 @@
|
|
|
483
517
|
</td>
|
|
484
518
|
|
|
485
519
|
|
|
520
|
+
<td>
|
|
521
|
+
<ul>
|
|
522
|
+
<li>A specific key to access a part of the state.
|
|
523
|
+
The key should be a property name of the state object.</li>
|
|
524
|
+
</ul>
|
|
525
|
+
|
|
526
|
+
</td>
|
|
486
527
|
</tr>
|
|
487
528
|
</tbody>
|
|
488
529
|
</table>
|
|
@@ -492,7 +533,10 @@
|
|
|
492
533
|
|
|
493
534
|
</div>
|
|
494
535
|
<div class="io-description">
|
|
495
|
-
|
|
536
|
+
<ul>
|
|
537
|
+
<li>An observable that emits the value of the specified key in the state.</li>
|
|
538
|
+
</ul>
|
|
539
|
+
|
|
496
540
|
</div>
|
|
497
541
|
</td>
|
|
498
542
|
</tr>
|
|
@@ -528,6 +572,8 @@
|
|
|
528
572
|
|
|
529
573
|
<tr>
|
|
530
574
|
<td class="col-md-4">
|
|
575
|
+
<div class="io-description"><b>Example :</b><div><pre class="line-numbers"><code class="language-none"> If a string is provided, it uses dot notation to access nested properties.</code></pre></div><p>If no parameter is provided, the method returns the entire state.</p>
|
|
576
|
+
</div>
|
|
531
577
|
|
|
532
578
|
<div class="io-description">
|
|
533
579
|
<b>Parameters :</b>
|
|
@@ -538,6 +584,7 @@
|
|
|
538
584
|
<td>Name</td>
|
|
539
585
|
<td>Type</td>
|
|
540
586
|
<td>Optional</td>
|
|
587
|
+
<td>Description</td>
|
|
541
588
|
</tr>
|
|
542
589
|
</thead>
|
|
543
590
|
<tbody>
|
|
@@ -552,6 +599,13 @@
|
|
|
552
599
|
</td>
|
|
553
600
|
|
|
554
601
|
|
|
602
|
+
<td>
|
|
603
|
+
<ul>
|
|
604
|
+
<li>Either a mapping function or a string key.
|
|
605
|
+
If a string is provided, it uses dot notation to access nested properties.</li>
|
|
606
|
+
</ul>
|
|
607
|
+
|
|
608
|
+
</td>
|
|
555
609
|
</tr>
|
|
556
610
|
</tbody>
|
|
557
611
|
</table>
|
|
@@ -561,7 +615,11 @@
|
|
|
561
615
|
|
|
562
616
|
</div>
|
|
563
617
|
<div class="io-description">
|
|
564
|
-
|
|
618
|
+
<ul>
|
|
619
|
+
<li>An observable that emits the selected or transformed state.</li>
|
|
620
|
+
</ul>
|
|
621
|
+
<p>If no parameter is provided, the method returns the entire state.</p>
|
|
622
|
+
|
|
565
623
|
</div>
|
|
566
624
|
</td>
|
|
567
625
|
</tr>
|
|
@@ -589,6 +647,9 @@
|
|
|
589
647
|
|
|
590
648
|
<tr>
|
|
591
649
|
<td class="col-md-4">
|
|
650
|
+
<div class="io-description"><p>Initializes the LocaleService with necessary configurations and state.
|
|
651
|
+
Binds language changes to the state and dynamically loads the appropriate locales.</p>
|
|
652
|
+
</div>
|
|
592
653
|
|
|
593
654
|
<div class="io-description">
|
|
594
655
|
<b>Parameters :</b>
|
|
@@ -599,6 +660,7 @@
|
|
|
599
660
|
<td>Name</td>
|
|
600
661
|
<td>Type</td>
|
|
601
662
|
<td>Optional</td>
|
|
663
|
+
<td>Description</td>
|
|
602
664
|
</tr>
|
|
603
665
|
</thead>
|
|
604
666
|
<tbody>
|
|
@@ -613,6 +675,12 @@
|
|
|
613
675
|
</td>
|
|
614
676
|
|
|
615
677
|
|
|
678
|
+
<td>
|
|
679
|
+
<ul>
|
|
680
|
+
<li>Optional initial state for the locale service.</li>
|
|
681
|
+
</ul>
|
|
682
|
+
|
|
683
|
+
</td>
|
|
616
684
|
</tr>
|
|
617
685
|
</tbody>
|
|
618
686
|
</table>
|
|
@@ -622,7 +690,10 @@
|
|
|
622
690
|
|
|
623
691
|
</div>
|
|
624
692
|
<div class="io-description">
|
|
625
|
-
|
|
693
|
+
<ul>
|
|
694
|
+
<li>Observable emitting the status of the initialization.</li>
|
|
695
|
+
</ul>
|
|
696
|
+
|
|
626
697
|
</div>
|
|
627
698
|
</td>
|
|
628
699
|
</tr>
|
|
@@ -650,7 +721,8 @@
|
|
|
650
721
|
|
|
651
722
|
<tr>
|
|
652
723
|
<td class="col-md-4">
|
|
653
|
-
<div class="io-description"><p>
|
|
724
|
+
<div class="io-description"><p>Updates the locale state within the application. If the new state is not available,
|
|
725
|
+
it throws an error. Also updates the global LOCALE_ID token if configured to do so.</p>
|
|
654
726
|
</div>
|
|
655
727
|
|
|
656
728
|
<div class="io-description">
|
|
@@ -662,6 +734,7 @@
|
|
|
662
734
|
<td>Name</td>
|
|
663
735
|
<td>Type</td>
|
|
664
736
|
<td>Optional</td>
|
|
737
|
+
<td>Description</td>
|
|
665
738
|
</tr>
|
|
666
739
|
</thead>
|
|
667
740
|
<tbody>
|
|
@@ -676,6 +749,12 @@
|
|
|
676
749
|
</td>
|
|
677
750
|
|
|
678
751
|
|
|
752
|
+
<td>
|
|
753
|
+
<ul>
|
|
754
|
+
<li>The new state to be set for the locale.</li>
|
|
755
|
+
</ul>
|
|
756
|
+
|
|
757
|
+
</td>
|
|
679
758
|
</tr>
|
|
680
759
|
</tbody>
|
|
681
760
|
</table>
|
|
@@ -711,6 +790,19 @@
|
|
|
711
790
|
<span class="accessor"><b>get</b><code>previousLocale()</code></span>
|
|
712
791
|
</td>
|
|
713
792
|
</tr>
|
|
793
|
+
<tr>
|
|
794
|
+
<td class="col-md-4">
|
|
795
|
+
<div class="io-description"><p>Retrieves the previous locale used in the application.</p>
|
|
796
|
+
</div>
|
|
797
|
+
|
|
798
|
+
<div>
|
|
799
|
+
</div>
|
|
800
|
+
<div class="io-description">
|
|
801
|
+
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
802
|
+
|
|
803
|
+
</div>
|
|
804
|
+
</td>
|
|
805
|
+
</tr>
|
|
714
806
|
|
|
715
807
|
</tbody>
|
|
716
808
|
</table>
|
|
@@ -728,6 +820,19 @@
|
|
|
728
820
|
<span class="accessor"><b>get</b><code>currentLocale()</code></span>
|
|
729
821
|
</td>
|
|
730
822
|
</tr>
|
|
823
|
+
<tr>
|
|
824
|
+
<td class="col-md-4">
|
|
825
|
+
<div class="io-description"><p>Retrieves the current locale used in the application.</p>
|
|
826
|
+
</div>
|
|
827
|
+
|
|
828
|
+
<div>
|
|
829
|
+
</div>
|
|
830
|
+
<div class="io-description">
|
|
831
|
+
<b>Returns : </b> <code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
|
832
|
+
|
|
833
|
+
</div>
|
|
834
|
+
</td>
|
|
835
|
+
</tr>
|
|
731
836
|
|
|
732
837
|
</tbody>
|
|
733
838
|
</table>
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
<a href="#updateState" >updateState</a>
|
|
154
154
|
</li>
|
|
155
155
|
<li>
|
|
156
|
-
<a href="#addLocale" >addLocale</a>
|
|
156
|
+
<a href="#addLocale" class="deprecated-name">addLocale</a>
|
|
157
157
|
</li>
|
|
158
158
|
</ul>
|
|
159
159
|
</td>
|
|
@@ -375,11 +375,16 @@
|
|
|
375
375
|
<td class="col-md-4">
|
|
376
376
|
<a name="addLocale"></a>
|
|
377
377
|
<span class="name">
|
|
378
|
-
<span ><b>addLocale</b></span>
|
|
378
|
+
<span class="deprecated-name"><b>addLocale</b></span>
|
|
379
379
|
<a href="#addLocale"><span class="icon ion-ios-link"></span></a>
|
|
380
380
|
</span>
|
|
381
381
|
</td>
|
|
382
382
|
</tr>
|
|
383
|
+
<tr>
|
|
384
|
+
<td class="col-md-4 deprecated">
|
|
385
|
+
eui does not offer a way to dynamically add locale it will be removed in future versions
|
|
386
|
+
</td>
|
|
387
|
+
</tr>
|
|
383
388
|
<tr>
|
|
384
389
|
<td class="col-md-4">
|
|
385
390
|
<code>addLocale(id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|