@genesislcap/foundation-utils 14.423.0 → 14.424.0-react-dom-rendering.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.
@@ -250,6 +250,164 @@
250
250
  }
251
251
  ]
252
252
  },
253
+ {
254
+ "kind": "javascript-module",
255
+ "path": "src/directives/index.ts",
256
+ "declarations": [],
257
+ "exports": [
258
+ {
259
+ "kind": "js",
260
+ "name": "*",
261
+ "declaration": {
262
+ "name": "*",
263
+ "package": "./sync"
264
+ }
265
+ },
266
+ {
267
+ "kind": "js",
268
+ "name": "*",
269
+ "declaration": {
270
+ "name": "*",
271
+ "package": "./when-else"
272
+ }
273
+ }
274
+ ]
275
+ },
276
+ {
277
+ "kind": "javascript-module",
278
+ "path": "src/design-system/design-system.ts",
279
+ "declarations": [
280
+ {
281
+ "kind": "function",
282
+ "name": "assureDesignSystem",
283
+ "return": {
284
+ "type": {
285
+ "text": "DesignSystemModule"
286
+ }
287
+ },
288
+ "parameters": [
289
+ {
290
+ "name": "module",
291
+ "type": {
292
+ "text": "DesignSystemModule"
293
+ }
294
+ }
295
+ ],
296
+ "description": "assureDesignSystem.",
297
+ "privacy": "public"
298
+ },
299
+ {
300
+ "kind": "function",
301
+ "name": "getCurrentDesignSystem",
302
+ "return": {
303
+ "type": {
304
+ "text": ""
305
+ }
306
+ },
307
+ "parameters": [
308
+ {
309
+ "name": "element",
310
+ "type": {
311
+ "text": "HTMLElement"
312
+ },
313
+ "description": "The starting HTML element"
314
+ },
315
+ {
316
+ "name": "fallbackPrefix",
317
+ "type": {
318
+ "text": "string"
319
+ },
320
+ "description": "The prefix to fallback to if the provider is not available"
321
+ }
322
+ ],
323
+ "description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
324
+ "privacy": "public"
325
+ },
326
+ {
327
+ "kind": "function",
328
+ "name": "getCurrentDesignSystemPrefix",
329
+ "return": {
330
+ "type": {
331
+ "text": ""
332
+ }
333
+ },
334
+ "parameters": [
335
+ {
336
+ "name": "element",
337
+ "type": {
338
+ "text": "HTMLElement"
339
+ },
340
+ "description": "The starting HTML element"
341
+ },
342
+ {
343
+ "name": "fallbackPrefix",
344
+ "type": {
345
+ "text": "string"
346
+ },
347
+ "description": "The prefix to fallback to if the provider is not available"
348
+ }
349
+ ],
350
+ "description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
351
+ "privacy": "public"
352
+ }
353
+ ],
354
+ "exports": [
355
+ {
356
+ "kind": "js",
357
+ "name": "assureDesignSystem",
358
+ "declaration": {
359
+ "name": "assureDesignSystem",
360
+ "module": "src/design-system/design-system.ts"
361
+ }
362
+ },
363
+ {
364
+ "kind": "js",
365
+ "name": "getCurrentDesignSystem",
366
+ "declaration": {
367
+ "name": "getCurrentDesignSystem",
368
+ "module": "src/design-system/design-system.ts"
369
+ }
370
+ },
371
+ {
372
+ "kind": "js",
373
+ "name": "getCurrentDesignSystemPrefix",
374
+ "declaration": {
375
+ "name": "getCurrentDesignSystemPrefix",
376
+ "module": "src/design-system/design-system.ts"
377
+ }
378
+ }
379
+ ]
380
+ },
381
+ {
382
+ "kind": "javascript-module",
383
+ "path": "src/design-system/index.ts",
384
+ "declarations": [],
385
+ "exports": [
386
+ {
387
+ "kind": "js",
388
+ "name": "*",
389
+ "declaration": {
390
+ "name": "*",
391
+ "package": "./design-system"
392
+ }
393
+ }
394
+ ]
395
+ },
396
+ {
397
+ "kind": "javascript-module",
398
+ "path": "src/encoding/index.ts",
399
+ "declarations": [],
400
+ "exports": [
401
+ {
402
+ "kind": "js",
403
+ "name": "*",
404
+ "declaration": {
405
+ "name": "*",
406
+ "package": "./base64"
407
+ }
408
+ }
409
+ ]
410
+ },
253
411
  {
254
412
  "kind": "javascript-module",
255
413
  "path": "src/data/inMemoryDatabase.ts",
@@ -448,217 +606,6 @@
448
606
  }
449
607
  ]
450
608
  },
451
- {
452
- "kind": "javascript-module",
453
- "path": "src/design-system/design-system.ts",
454
- "declarations": [
455
- {
456
- "kind": "function",
457
- "name": "assureDesignSystem",
458
- "return": {
459
- "type": {
460
- "text": "DesignSystemModule"
461
- }
462
- },
463
- "parameters": [
464
- {
465
- "name": "module",
466
- "type": {
467
- "text": "DesignSystemModule"
468
- }
469
- }
470
- ],
471
- "description": "assureDesignSystem.",
472
- "privacy": "public"
473
- },
474
- {
475
- "kind": "function",
476
- "name": "getCurrentDesignSystem",
477
- "return": {
478
- "type": {
479
- "text": ""
480
- }
481
- },
482
- "parameters": [
483
- {
484
- "name": "element",
485
- "type": {
486
- "text": "HTMLElement"
487
- },
488
- "description": "The starting HTML element"
489
- },
490
- {
491
- "name": "fallbackPrefix",
492
- "type": {
493
- "text": "string"
494
- },
495
- "description": "The prefix to fallback to if the provider is not available"
496
- }
497
- ],
498
- "description": "Get the current design system provider element and prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
499
- "privacy": "public"
500
- },
501
- {
502
- "kind": "function",
503
- "name": "getCurrentDesignSystemPrefix",
504
- "return": {
505
- "type": {
506
- "text": ""
507
- }
508
- },
509
- "parameters": [
510
- {
511
- "name": "element",
512
- "type": {
513
- "text": "HTMLElement"
514
- },
515
- "description": "The starting HTML element"
516
- },
517
- {
518
- "name": "fallbackPrefix",
519
- "type": {
520
- "text": "string"
521
- },
522
- "description": "The prefix to fallback to if the provider is not available"
523
- }
524
- ],
525
- "description": "Get the current design system prefix by checking available providers.\nIf no provider is found, falls back to the provided prefix.",
526
- "privacy": "public"
527
- }
528
- ],
529
- "exports": [
530
- {
531
- "kind": "js",
532
- "name": "assureDesignSystem",
533
- "declaration": {
534
- "name": "assureDesignSystem",
535
- "module": "src/design-system/design-system.ts"
536
- }
537
- },
538
- {
539
- "kind": "js",
540
- "name": "getCurrentDesignSystem",
541
- "declaration": {
542
- "name": "getCurrentDesignSystem",
543
- "module": "src/design-system/design-system.ts"
544
- }
545
- },
546
- {
547
- "kind": "js",
548
- "name": "getCurrentDesignSystemPrefix",
549
- "declaration": {
550
- "name": "getCurrentDesignSystemPrefix",
551
- "module": "src/design-system/design-system.ts"
552
- }
553
- }
554
- ]
555
- },
556
- {
557
- "kind": "javascript-module",
558
- "path": "src/design-system/index.ts",
559
- "declarations": [],
560
- "exports": [
561
- {
562
- "kind": "js",
563
- "name": "*",
564
- "declaration": {
565
- "name": "*",
566
- "package": "./design-system"
567
- }
568
- }
569
- ]
570
- },
571
- {
572
- "kind": "javascript-module",
573
- "path": "src/decorators/index.ts",
574
- "declarations": [],
575
- "exports": [
576
- {
577
- "kind": "js",
578
- "name": "*",
579
- "declaration": {
580
- "name": "*",
581
- "package": "./renderOnChange"
582
- }
583
- }
584
- ]
585
- },
586
- {
587
- "kind": "javascript-module",
588
- "path": "src/decorators/renderOnChange.ts",
589
- "declarations": [
590
- {
591
- "kind": "function",
592
- "name": "renderOnChange",
593
- "parameters": [
594
- {
595
- "name": "target",
596
- "type": {
597
- "text": "FASTElement & { render(): void }"
598
- },
599
- "description": "The target to define the property change handler on."
600
- },
601
- {
602
- "name": "name",
603
- "type": {
604
- "text": "string"
605
- },
606
- "description": "The property name."
607
- }
608
- ],
609
- "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
610
- "privacy": "public"
611
- }
612
- ],
613
- "exports": [
614
- {
615
- "kind": "js",
616
- "name": "renderOnChange",
617
- "declaration": {
618
- "name": "renderOnChange",
619
- "module": "src/decorators/renderOnChange.ts"
620
- }
621
- }
622
- ]
623
- },
624
- {
625
- "kind": "javascript-module",
626
- "path": "src/directives/index.ts",
627
- "declarations": [],
628
- "exports": [
629
- {
630
- "kind": "js",
631
- "name": "*",
632
- "declaration": {
633
- "name": "*",
634
- "package": "./sync"
635
- }
636
- },
637
- {
638
- "kind": "js",
639
- "name": "*",
640
- "declaration": {
641
- "name": "*",
642
- "package": "./when-else"
643
- }
644
- }
645
- ]
646
- },
647
- {
648
- "kind": "javascript-module",
649
- "path": "src/encoding/index.ts",
650
- "declarations": [],
651
- "exports": [
652
- {
653
- "kind": "js",
654
- "name": "*",
655
- "declaration": {
656
- "name": "*",
657
- "package": "./base64"
658
- }
659
- }
660
- ]
661
- },
662
609
  {
663
610
  "kind": "javascript-module",
664
611
  "path": "src/env/index.ts",
@@ -1134,6 +1081,59 @@
1134
1081
  }
1135
1082
  ]
1136
1083
  },
1084
+ {
1085
+ "kind": "javascript-module",
1086
+ "path": "src/decorators/index.ts",
1087
+ "declarations": [],
1088
+ "exports": [
1089
+ {
1090
+ "kind": "js",
1091
+ "name": "*",
1092
+ "declaration": {
1093
+ "name": "*",
1094
+ "package": "./renderOnChange"
1095
+ }
1096
+ }
1097
+ ]
1098
+ },
1099
+ {
1100
+ "kind": "javascript-module",
1101
+ "path": "src/decorators/renderOnChange.ts",
1102
+ "declarations": [
1103
+ {
1104
+ "kind": "function",
1105
+ "name": "renderOnChange",
1106
+ "parameters": [
1107
+ {
1108
+ "name": "target",
1109
+ "type": {
1110
+ "text": "FASTElement & { render(): void }"
1111
+ },
1112
+ "description": "The target to define the property change handler on."
1113
+ },
1114
+ {
1115
+ "name": "name",
1116
+ "type": {
1117
+ "text": "string"
1118
+ },
1119
+ "description": "The property name."
1120
+ }
1121
+ ],
1122
+ "description": "Defines a property changed handler that calls a render() method on the target as an internal observation enhancement.",
1123
+ "privacy": "public"
1124
+ }
1125
+ ],
1126
+ "exports": [
1127
+ {
1128
+ "kind": "js",
1129
+ "name": "renderOnChange",
1130
+ "declaration": {
1131
+ "name": "renderOnChange",
1132
+ "module": "src/decorators/renderOnChange.ts"
1133
+ }
1134
+ }
1135
+ ]
1136
+ },
1137
1137
  {
1138
1138
  "kind": "javascript-module",
1139
1139
  "path": "src/error/errorMap.ts",
@@ -1 +1 @@
1
- {"version":3,"file":"localeNumberParser.d.ts","sourceRoot":"","sources":["../../../src/formatters/localeNumberParser.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,YAAY;IACvB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAM;gBACR,MAAM,EAAE,MAAM;IAc1B,KAAK,CAAC,YAAY,EAAE,MAAM;IAS1B,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;CAG5C"}
1
+ {"version":3,"file":"localeNumberParser.d.ts","sourceRoot":"","sources":["../../../src/formatters/localeNumberParser.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,qBAAa,YAAY;IACvB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAM;gBACR,MAAM,EAAE,MAAM;IAc1B,KAAK,CAAC,YAAY,EAAE,MAAM;IAa1B,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO;CAG5C"}
@@ -1,5 +1,11 @@
1
1
  const FORMAT_PARTS = 12345.6;
2
2
  const FORMAT_NUMERALS = 9876543210;
3
+ const SHORTCUT_MULTIPLIERS = {
4
+ k: 1000,
5
+ m: 1000000,
6
+ b: 1000000000,
7
+ };
8
+ const SHORTCUT_REGEX = /^(.*?)([kmb])$/i;
3
9
  /**
4
10
  * @public
5
11
  */
@@ -17,12 +23,15 @@ export class NumberParser {
17
23
  this._index = (d) => index.get(d);
18
24
  }
19
25
  parse(localeNumber) {
20
- return (localeNumber = localeNumber
26
+ const shortcutMatch = localeNumber.trim().match(SHORTCUT_REGEX);
27
+ const multiplier = shortcutMatch ? SHORTCUT_MULTIPLIERS[shortcutMatch[2].toLowerCase()] : 1;
28
+ const normalized = shortcutMatch ? shortcutMatch[1] : localeNumber;
29
+ return (localeNumber = normalized
21
30
  .trim()
22
31
  .replace(this._group, '')
23
32
  .replace(this._decimal, '.')
24
33
  .replace(this._numeral, this._index))
25
- ? +localeNumber
34
+ ? +localeNumber * multiplier
26
35
  : NaN;
27
36
  }
28
37
  hasSeparator(localeNumber) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-utils",
3
3
  "description": "Genesis Foundation Utils",
4
- "version": "14.423.0",
4
+ "version": "14.424.0-react-dom-rendering.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -29,18 +29,18 @@
29
29
  }
30
30
  },
31
31
  "devDependencies": {
32
- "@genesislcap/foundation-testing": "14.423.0",
33
- "@genesislcap/genx": "14.423.0",
34
- "@genesislcap/rollup-builder": "14.423.0",
35
- "@genesislcap/ts-builder": "14.423.0",
36
- "@genesislcap/uvu-playwright-builder": "14.423.0",
37
- "@genesislcap/vite-builder": "14.423.0",
38
- "@genesislcap/webpack-builder": "14.423.0",
32
+ "@genesislcap/foundation-testing": "14.424.0-react-dom-rendering.1",
33
+ "@genesislcap/genx": "14.424.0-react-dom-rendering.1",
34
+ "@genesislcap/rollup-builder": "14.424.0-react-dom-rendering.1",
35
+ "@genesislcap/ts-builder": "14.424.0-react-dom-rendering.1",
36
+ "@genesislcap/uvu-playwright-builder": "14.424.0-react-dom-rendering.1",
37
+ "@genesislcap/vite-builder": "14.424.0-react-dom-rendering.1",
38
+ "@genesislcap/webpack-builder": "14.424.0-react-dom-rendering.1",
39
39
  "@types/json-schema": "^7.0.11"
40
40
  },
41
41
  "dependencies": {
42
- "@genesislcap/expression-builder": "14.423.0",
43
- "@genesislcap/foundation-logger": "14.423.0",
42
+ "@genesislcap/expression-builder": "14.424.0-react-dom-rendering.1",
43
+ "@genesislcap/foundation-logger": "14.424.0-react-dom-rendering.1",
44
44
  "@microsoft/fast-components": "2.30.6",
45
45
  "@microsoft/fast-element": "1.14.0",
46
46
  "@microsoft/fast-foundation": "2.50.0",
@@ -58,5 +58,5 @@
58
58
  "access": "public"
59
59
  },
60
60
  "customElements": "dist/custom-elements.json",
61
- "gitHead": "ed1a188a19674ed48b3805cc907304148f1daf14"
61
+ "gitHead": "473707e03212a5dfd5eb534b224cedef9d06a145"
62
62
  }