@@ -31,7 +31,7 @@ import {
31
31
connectLocalized ,
32
32
disconnectLocalized ,
33
33
NumberingSystem ,
34
- numberStringFormatter ,
34
+ NumberStringFormat ,
35
35
} from "../../utils/locale" ;
36
36
import { onToggleOpenCloseComponent , OpenCloseComponent } from "../../utils/openCloseComponent" ;
37
37
import {
@@ -169,10 +169,17 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen
169
169
connectedCallback ( ) : void {
170
170
connectLocalized ( this ) ;
171
171
connectMessages ( this ) ;
172
+
172
173
const open = this . open ;
173
174
if ( open && ! this . queued ) {
174
175
this . calciteInternalAlertRegister . emit ( ) ;
175
176
}
177
+
178
+ this . numberStringFormatter . numberFormatOptions = {
179
+ locale : this . effectiveLocale ,
180
+ numberingSystem : this . numberingSystem ,
181
+ signDisplay : "always" ,
182
+ } ;
176
183
}
177
184
178
185
async componentWillLoad ( ) : Promise < void > {
@@ -201,12 +208,6 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen
201
208
}
202
209
203
210
render ( ) : VNode {
204
- numberStringFormatter . numberFormatOptions = {
205
- locale : this . effectiveLocale ,
206
- numberingSystem : this . numberingSystem ,
207
- signDisplay : "always" ,
208
- } ;
209
-
210
211
const { open, autoClose, label, placement, queued } = this ;
211
212
const role = autoClose ? "alert" : "alertdialog" ;
212
213
const hidden = ! open ;
@@ -265,7 +266,7 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen
265
266
266
267
private renderQueueCount ( ) : VNode {
267
268
const queueNumber = this . queueLength > 2 ? this . queueLength - 1 : 1 ;
268
- const queueText = numberStringFormatter . numberFormatter . format ( queueNumber ) ;
269
+ const queueText = this . numberStringFormatter . numberFormatter . format ( queueNumber ) ;
269
270
270
271
return (
271
272
< div
@@ -402,6 +403,22 @@ export class Alert implements OpenCloseComponent, LoadableComponent, T9nComponen
402
403
@Watch ( "effectiveLocale" )
403
404
effectiveLocaleChange ( ) : void {
404
405
updateMessages ( this , this . effectiveLocale ) ;
406
+ this . numberStringFormatter . numberFormatOptions = {
407
+ locale : this . effectiveLocale ,
408
+ numberingSystem : this . numberingSystem ,
409
+ signDisplay : "always" ,
410
+ } ;
411
+ }
412
+
413
+ @State ( ) numberStringFormatter = new NumberStringFormat ( ) ;
414
+
415
+ @Watch ( "numberingSystem" )
416
+ numberingSystemChange ( ) : void {
417
+ this . numberStringFormatter . numberFormatOptions = {
418
+ locale : this . effectiveLocale ,
419
+ numberingSystem : this . numberingSystem ,
420
+ signDisplay : "always" ,
421
+ } ;
405
422
}
406
423
407
424
@State ( ) hasEndActions = false ;
0 commit comments