@genesislcap/foundation-utils 14.196.0 → 14.197.0
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/dist/custom-elements.json +247 -174
- package/dist/dts/formatters/datetime.d.ts +4 -0
- package/dist/dts/formatters/datetime.d.ts.map +1 -1
- package/dist/dts/formatters/index.d.ts +1 -0
- package/dist/dts/formatters/index.d.ts.map +1 -1
- package/dist/dts/formatters/number.d.ts +6 -0
- package/dist/dts/formatters/number.d.ts.map +1 -0
- package/dist/esm/formatters/datetime.js +16 -0
- package/dist/esm/formatters/index.js +1 -0
- package/dist/esm/formatters/number.js +17 -0
- package/dist/foundation-utils.api.json +123 -0
- package/dist/foundation-utils.d.ts +10 -0
- package/docs/api/foundation-utils.getdateformatter.md +24 -0
- package/docs/api/foundation-utils.getnumberformatter.md +24 -0
- package/docs/api/foundation-utils.md +2 -0
- package/docs/api-report.md +6 -0
- package/package.json +11 -10
|
@@ -357,6 +357,56 @@
|
|
|
357
357
|
}
|
|
358
358
|
]
|
|
359
359
|
},
|
|
360
|
+
{
|
|
361
|
+
"kind": "javascript-module",
|
|
362
|
+
"path": "src/design-system/design-system.ts",
|
|
363
|
+
"declarations": [
|
|
364
|
+
{
|
|
365
|
+
"kind": "function",
|
|
366
|
+
"name": "assureDesignSystem",
|
|
367
|
+
"return": {
|
|
368
|
+
"type": {
|
|
369
|
+
"text": "DesignSystemModule"
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
"parameters": [
|
|
373
|
+
{
|
|
374
|
+
"name": "module",
|
|
375
|
+
"type": {
|
|
376
|
+
"text": "DesignSystemModule"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
],
|
|
380
|
+
"description": "assureDesignSystem.",
|
|
381
|
+
"privacy": "public"
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
"exports": [
|
|
385
|
+
{
|
|
386
|
+
"kind": "js",
|
|
387
|
+
"name": "assureDesignSystem",
|
|
388
|
+
"declaration": {
|
|
389
|
+
"name": "assureDesignSystem",
|
|
390
|
+
"module": "src/design-system/design-system.ts"
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"kind": "javascript-module",
|
|
397
|
+
"path": "src/design-system/index.ts",
|
|
398
|
+
"declarations": [],
|
|
399
|
+
"exports": [
|
|
400
|
+
{
|
|
401
|
+
"kind": "js",
|
|
402
|
+
"name": "*",
|
|
403
|
+
"declaration": {
|
|
404
|
+
"name": "*",
|
|
405
|
+
"package": "./design-system"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
]
|
|
409
|
+
},
|
|
360
410
|
{
|
|
361
411
|
"kind": "javascript-module",
|
|
362
412
|
"path": "src/decorators/index.ts",
|
|
@@ -433,56 +483,6 @@
|
|
|
433
483
|
}
|
|
434
484
|
]
|
|
435
485
|
},
|
|
436
|
-
{
|
|
437
|
-
"kind": "javascript-module",
|
|
438
|
-
"path": "src/design-system/design-system.ts",
|
|
439
|
-
"declarations": [
|
|
440
|
-
{
|
|
441
|
-
"kind": "function",
|
|
442
|
-
"name": "assureDesignSystem",
|
|
443
|
-
"return": {
|
|
444
|
-
"type": {
|
|
445
|
-
"text": "DesignSystemModule"
|
|
446
|
-
}
|
|
447
|
-
},
|
|
448
|
-
"parameters": [
|
|
449
|
-
{
|
|
450
|
-
"name": "module",
|
|
451
|
-
"type": {
|
|
452
|
-
"text": "DesignSystemModule"
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
],
|
|
456
|
-
"description": "assureDesignSystem.",
|
|
457
|
-
"privacy": "public"
|
|
458
|
-
}
|
|
459
|
-
],
|
|
460
|
-
"exports": [
|
|
461
|
-
{
|
|
462
|
-
"kind": "js",
|
|
463
|
-
"name": "assureDesignSystem",
|
|
464
|
-
"declaration": {
|
|
465
|
-
"name": "assureDesignSystem",
|
|
466
|
-
"module": "src/design-system/design-system.ts"
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
]
|
|
470
|
-
},
|
|
471
|
-
{
|
|
472
|
-
"kind": "javascript-module",
|
|
473
|
-
"path": "src/design-system/index.ts",
|
|
474
|
-
"declarations": [],
|
|
475
|
-
"exports": [
|
|
476
|
-
{
|
|
477
|
-
"kind": "js",
|
|
478
|
-
"name": "*",
|
|
479
|
-
"declaration": {
|
|
480
|
-
"name": "*",
|
|
481
|
-
"package": "./design-system"
|
|
482
|
-
}
|
|
483
|
-
}
|
|
484
|
-
]
|
|
485
|
-
},
|
|
486
486
|
{
|
|
487
487
|
"kind": "javascript-module",
|
|
488
488
|
"path": "src/env/index.ts",
|
|
@@ -988,6 +988,27 @@
|
|
|
988
988
|
],
|
|
989
989
|
"description": "Formats [DATE|DATETIME] Unix Timestamps to readable strings",
|
|
990
990
|
"privacy": "public"
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
"kind": "function",
|
|
994
|
+
"name": "getDateFormatter",
|
|
995
|
+
"parameters": [
|
|
996
|
+
{
|
|
997
|
+
"name": "locale",
|
|
998
|
+
"default": "'en-GB'",
|
|
999
|
+
"type": {
|
|
1000
|
+
"text": "string"
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
{
|
|
1004
|
+
"name": "options",
|
|
1005
|
+
"default": "defaultDateOptions",
|
|
1006
|
+
"type": {
|
|
1007
|
+
"text": "Intl.DateTimeFormatOptions"
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
],
|
|
1011
|
+
"privacy": "public"
|
|
991
1012
|
}
|
|
992
1013
|
],
|
|
993
1014
|
"exports": [
|
|
@@ -1014,6 +1035,14 @@
|
|
|
1014
1035
|
"name": "formatTimestamp",
|
|
1015
1036
|
"module": "src/formatters/datetime.ts"
|
|
1016
1037
|
}
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
"kind": "js",
|
|
1041
|
+
"name": "getDateFormatter",
|
|
1042
|
+
"declaration": {
|
|
1043
|
+
"name": "getDateFormatter",
|
|
1044
|
+
"module": "src/formatters/datetime.ts"
|
|
1045
|
+
}
|
|
1017
1046
|
}
|
|
1018
1047
|
]
|
|
1019
1048
|
},
|
|
@@ -1037,6 +1066,14 @@
|
|
|
1037
1066
|
"name": "*",
|
|
1038
1067
|
"package": "./localeNumberParser"
|
|
1039
1068
|
}
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
"kind": "js",
|
|
1072
|
+
"name": "*",
|
|
1073
|
+
"declaration": {
|
|
1074
|
+
"name": "*",
|
|
1075
|
+
"package": "./number"
|
|
1076
|
+
}
|
|
1040
1077
|
}
|
|
1041
1078
|
]
|
|
1042
1079
|
},
|
|
@@ -1132,6 +1169,42 @@
|
|
|
1132
1169
|
}
|
|
1133
1170
|
]
|
|
1134
1171
|
},
|
|
1172
|
+
{
|
|
1173
|
+
"kind": "javascript-module",
|
|
1174
|
+
"path": "src/formatters/number.ts",
|
|
1175
|
+
"declarations": [
|
|
1176
|
+
{
|
|
1177
|
+
"kind": "function",
|
|
1178
|
+
"name": "getNumberFormatter",
|
|
1179
|
+
"parameters": [
|
|
1180
|
+
{
|
|
1181
|
+
"name": "format",
|
|
1182
|
+
"type": {
|
|
1183
|
+
"text": "string"
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
"name": "locale",
|
|
1188
|
+
"optional": true,
|
|
1189
|
+
"type": {
|
|
1190
|
+
"text": "string | null"
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
],
|
|
1194
|
+
"privacy": "public"
|
|
1195
|
+
}
|
|
1196
|
+
],
|
|
1197
|
+
"exports": [
|
|
1198
|
+
{
|
|
1199
|
+
"kind": "js",
|
|
1200
|
+
"name": "getNumberFormatter",
|
|
1201
|
+
"declaration": {
|
|
1202
|
+
"name": "getNumberFormatter",
|
|
1203
|
+
"module": "src/formatters/number.ts"
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
]
|
|
1207
|
+
},
|
|
1135
1208
|
{
|
|
1136
1209
|
"kind": "javascript-module",
|
|
1137
1210
|
"path": "src/logger/index.ts",
|
|
@@ -2387,130 +2460,6 @@
|
|
|
2387
2460
|
"declarations": [],
|
|
2388
2461
|
"exports": []
|
|
2389
2462
|
},
|
|
2390
|
-
{
|
|
2391
|
-
"kind": "javascript-module",
|
|
2392
|
-
"path": "src/mixins/lifecycle/index.ts",
|
|
2393
|
-
"declarations": [],
|
|
2394
|
-
"exports": [
|
|
2395
|
-
{
|
|
2396
|
-
"kind": "js",
|
|
2397
|
-
"name": "*",
|
|
2398
|
-
"declaration": {
|
|
2399
|
-
"name": "*",
|
|
2400
|
-
"package": "./lifecycle"
|
|
2401
|
-
}
|
|
2402
|
-
}
|
|
2403
|
-
]
|
|
2404
|
-
},
|
|
2405
|
-
{
|
|
2406
|
-
"kind": "javascript-module",
|
|
2407
|
-
"path": "src/mixins/lifecycle/lifecycle.ts",
|
|
2408
|
-
"declarations": [
|
|
2409
|
-
{
|
|
2410
|
-
"kind": "mixin",
|
|
2411
|
-
"description": "",
|
|
2412
|
-
"name": "LifecycleMixin",
|
|
2413
|
-
"members": [
|
|
2414
|
-
{
|
|
2415
|
-
"kind": "method",
|
|
2416
|
-
"name": "cloneNode",
|
|
2417
|
-
"return": {
|
|
2418
|
-
"type": {
|
|
2419
|
-
"text": "Node"
|
|
2420
|
-
}
|
|
2421
|
-
},
|
|
2422
|
-
"parameters": [
|
|
2423
|
-
{
|
|
2424
|
-
"name": "deep",
|
|
2425
|
-
"optional": true,
|
|
2426
|
-
"type": {
|
|
2427
|
-
"text": "boolean"
|
|
2428
|
-
}
|
|
2429
|
-
}
|
|
2430
|
-
]
|
|
2431
|
-
},
|
|
2432
|
-
{
|
|
2433
|
-
"kind": "method",
|
|
2434
|
-
"name": "deepClone",
|
|
2435
|
-
"return": {
|
|
2436
|
-
"type": {
|
|
2437
|
-
"text": "Node"
|
|
2438
|
-
}
|
|
2439
|
-
}
|
|
2440
|
-
},
|
|
2441
|
-
{
|
|
2442
|
-
"kind": "field",
|
|
2443
|
-
"name": "shouldRunDisconnect",
|
|
2444
|
-
"return": {
|
|
2445
|
-
"type": {
|
|
2446
|
-
"text": ""
|
|
2447
|
-
}
|
|
2448
|
-
},
|
|
2449
|
-
"readonly": true
|
|
2450
|
-
},
|
|
2451
|
-
{
|
|
2452
|
-
"kind": "field",
|
|
2453
|
-
"name": "shouldRunConnect",
|
|
2454
|
-
"return": {
|
|
2455
|
-
"type": {
|
|
2456
|
-
"text": ""
|
|
2457
|
-
}
|
|
2458
|
-
},
|
|
2459
|
-
"readonly": true
|
|
2460
|
-
},
|
|
2461
|
-
{
|
|
2462
|
-
"kind": "method",
|
|
2463
|
-
"name": "#_blockLifecycleDueToTokenChange",
|
|
2464
|
-
"return": {
|
|
2465
|
-
"type": {
|
|
2466
|
-
"text": "boolean"
|
|
2467
|
-
}
|
|
2468
|
-
},
|
|
2469
|
-
"parameters": [
|
|
2470
|
-
{
|
|
2471
|
-
"name": "lifecycleType",
|
|
2472
|
-
"type": {
|
|
2473
|
-
"text": "Lifecycletype"
|
|
2474
|
-
}
|
|
2475
|
-
}
|
|
2476
|
-
]
|
|
2477
|
-
}
|
|
2478
|
-
],
|
|
2479
|
-
"parameters": [
|
|
2480
|
-
{
|
|
2481
|
-
"name": "Base",
|
|
2482
|
-
"type": {
|
|
2483
|
-
"text": "T"
|
|
2484
|
-
}
|
|
2485
|
-
}
|
|
2486
|
-
]
|
|
2487
|
-
},
|
|
2488
|
-
{
|
|
2489
|
-
"kind": "variable",
|
|
2490
|
-
"name": "layoutCacheDocument",
|
|
2491
|
-
"description": "Stored on the layout's internal cache to signify that the document is not part of the DOM",
|
|
2492
|
-
"privacy": "public"
|
|
2493
|
-
}
|
|
2494
|
-
],
|
|
2495
|
-
"exports": [
|
|
2496
|
-
{
|
|
2497
|
-
"kind": "js",
|
|
2498
|
-
"name": "LifecycleMixin",
|
|
2499
|
-
"declaration": {
|
|
2500
|
-
"name": "LifecycleMixin",
|
|
2501
|
-
"module": "src/mixins/lifecycle/lifecycle.ts"
|
|
2502
|
-
}
|
|
2503
|
-
},
|
|
2504
|
-
{
|
|
2505
|
-
"kind": "js",
|
|
2506
|
-
"name": "layoutCacheDocument",
|
|
2507
|
-
"declaration": {
|
|
2508
|
-
"name": "layoutCacheDocument",
|
|
2509
|
-
"module": "src/mixins/lifecycle/lifecycle.ts"
|
|
2510
|
-
}
|
|
2511
|
-
}
|
|
2512
|
-
]
|
|
2513
|
-
},
|
|
2514
2463
|
{
|
|
2515
2464
|
"kind": "javascript-module",
|
|
2516
2465
|
"path": "src/mixins/pendingState/index.ts",
|
|
@@ -2824,6 +2773,130 @@
|
|
|
2824
2773
|
"path": "src/serializers/json/types.ts",
|
|
2825
2774
|
"declarations": [],
|
|
2826
2775
|
"exports": []
|
|
2776
|
+
},
|
|
2777
|
+
{
|
|
2778
|
+
"kind": "javascript-module",
|
|
2779
|
+
"path": "src/mixins/lifecycle/index.ts",
|
|
2780
|
+
"declarations": [],
|
|
2781
|
+
"exports": [
|
|
2782
|
+
{
|
|
2783
|
+
"kind": "js",
|
|
2784
|
+
"name": "*",
|
|
2785
|
+
"declaration": {
|
|
2786
|
+
"name": "*",
|
|
2787
|
+
"package": "./lifecycle"
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
]
|
|
2791
|
+
},
|
|
2792
|
+
{
|
|
2793
|
+
"kind": "javascript-module",
|
|
2794
|
+
"path": "src/mixins/lifecycle/lifecycle.ts",
|
|
2795
|
+
"declarations": [
|
|
2796
|
+
{
|
|
2797
|
+
"kind": "mixin",
|
|
2798
|
+
"description": "",
|
|
2799
|
+
"name": "LifecycleMixin",
|
|
2800
|
+
"members": [
|
|
2801
|
+
{
|
|
2802
|
+
"kind": "method",
|
|
2803
|
+
"name": "cloneNode",
|
|
2804
|
+
"return": {
|
|
2805
|
+
"type": {
|
|
2806
|
+
"text": "Node"
|
|
2807
|
+
}
|
|
2808
|
+
},
|
|
2809
|
+
"parameters": [
|
|
2810
|
+
{
|
|
2811
|
+
"name": "deep",
|
|
2812
|
+
"optional": true,
|
|
2813
|
+
"type": {
|
|
2814
|
+
"text": "boolean"
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
]
|
|
2818
|
+
},
|
|
2819
|
+
{
|
|
2820
|
+
"kind": "method",
|
|
2821
|
+
"name": "deepClone",
|
|
2822
|
+
"return": {
|
|
2823
|
+
"type": {
|
|
2824
|
+
"text": "Node"
|
|
2825
|
+
}
|
|
2826
|
+
}
|
|
2827
|
+
},
|
|
2828
|
+
{
|
|
2829
|
+
"kind": "field",
|
|
2830
|
+
"name": "shouldRunDisconnect",
|
|
2831
|
+
"return": {
|
|
2832
|
+
"type": {
|
|
2833
|
+
"text": ""
|
|
2834
|
+
}
|
|
2835
|
+
},
|
|
2836
|
+
"readonly": true
|
|
2837
|
+
},
|
|
2838
|
+
{
|
|
2839
|
+
"kind": "field",
|
|
2840
|
+
"name": "shouldRunConnect",
|
|
2841
|
+
"return": {
|
|
2842
|
+
"type": {
|
|
2843
|
+
"text": ""
|
|
2844
|
+
}
|
|
2845
|
+
},
|
|
2846
|
+
"readonly": true
|
|
2847
|
+
},
|
|
2848
|
+
{
|
|
2849
|
+
"kind": "method",
|
|
2850
|
+
"name": "#_blockLifecycleDueToTokenChange",
|
|
2851
|
+
"return": {
|
|
2852
|
+
"type": {
|
|
2853
|
+
"text": "boolean"
|
|
2854
|
+
}
|
|
2855
|
+
},
|
|
2856
|
+
"parameters": [
|
|
2857
|
+
{
|
|
2858
|
+
"name": "lifecycleType",
|
|
2859
|
+
"type": {
|
|
2860
|
+
"text": "Lifecycletype"
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
]
|
|
2864
|
+
}
|
|
2865
|
+
],
|
|
2866
|
+
"parameters": [
|
|
2867
|
+
{
|
|
2868
|
+
"name": "Base",
|
|
2869
|
+
"type": {
|
|
2870
|
+
"text": "T"
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
]
|
|
2874
|
+
},
|
|
2875
|
+
{
|
|
2876
|
+
"kind": "variable",
|
|
2877
|
+
"name": "layoutCacheDocument",
|
|
2878
|
+
"description": "Stored on the layout's internal cache to signify that the document is not part of the DOM",
|
|
2879
|
+
"privacy": "public"
|
|
2880
|
+
}
|
|
2881
|
+
],
|
|
2882
|
+
"exports": [
|
|
2883
|
+
{
|
|
2884
|
+
"kind": "js",
|
|
2885
|
+
"name": "LifecycleMixin",
|
|
2886
|
+
"declaration": {
|
|
2887
|
+
"name": "LifecycleMixin",
|
|
2888
|
+
"module": "src/mixins/lifecycle/lifecycle.ts"
|
|
2889
|
+
}
|
|
2890
|
+
},
|
|
2891
|
+
{
|
|
2892
|
+
"kind": "js",
|
|
2893
|
+
"name": "layoutCacheDocument",
|
|
2894
|
+
"declaration": {
|
|
2895
|
+
"name": "layoutCacheDocument",
|
|
2896
|
+
"module": "src/mixins/lifecycle/lifecycle.ts"
|
|
2897
|
+
}
|
|
2898
|
+
}
|
|
2899
|
+
]
|
|
2827
2900
|
}
|
|
2828
2901
|
]
|
|
2829
2902
|
}
|
|
@@ -15,4 +15,8 @@ export declare function formatDateTimeTimestamp(timestamp: number): string;
|
|
|
15
15
|
* @param withTime - The flag to determine if formatted value should contain 'time' info.
|
|
16
16
|
*/
|
|
17
17
|
export declare function formatTimestamp(timestamp: number, withTime: boolean): string;
|
|
18
|
+
/**
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export declare function getDateFormatter(locale?: string, options?: Intl.DateTimeFormatOptions): (params: any) => string;
|
|
18
22
|
//# sourceMappingURL=datetime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../../src/formatters/datetime.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG7D;AAGD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAM5E"}
|
|
1
|
+
{"version":3,"file":"datetime.d.ts","sourceRoot":"","sources":["../../../src/formatters/datetime.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG7D;AAGD;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGjE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAM5E;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,GAAE,MAAgB,EACxB,OAAO,GAAE,IAAI,CAAC,qBAA0C,YAExC,GAAG,YAKpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formatters/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/formatters/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../../src/formatters/number.ts"],"names":[],"mappings":"AACA,OAAO,iBAAiB,CAAC;AAEzB;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,YACvD,GAAG,SAYpB"}
|
|
@@ -30,3 +30,19 @@ export function formatTimestamp(timestamp, withTime) {
|
|
|
30
30
|
}
|
|
31
31
|
return formatDateTimestamp(timestamp);
|
|
32
32
|
}
|
|
33
|
+
const defaultDateOptions = {
|
|
34
|
+
year: 'numeric',
|
|
35
|
+
month: '2-digit',
|
|
36
|
+
day: '2-digit',
|
|
37
|
+
timeZone: 'UTC',
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export function getDateFormatter(locale = 'en-GB', options = defaultDateOptions) {
|
|
43
|
+
return (params) => {
|
|
44
|
+
if (!(params && typeof params.value === 'number'))
|
|
45
|
+
return '';
|
|
46
|
+
return new Intl.DateTimeFormat(locale, options).format(params.value);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Numeral from 'numeral';
|
|
2
|
+
import 'numeral/locales';
|
|
3
|
+
/**
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export function getNumberFormatter(format, locale) {
|
|
7
|
+
return (params) => {
|
|
8
|
+
// bigdecimals are sent as strings
|
|
9
|
+
if (!(params && (typeof params.value === 'number' || typeof params.value === 'string'))) {
|
|
10
|
+
return '';
|
|
11
|
+
}
|
|
12
|
+
if (locale) {
|
|
13
|
+
Numeral.locale(locale);
|
|
14
|
+
}
|
|
15
|
+
return Numeral(params.value).format(format);
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -3376,6 +3376,68 @@
|
|
|
3376
3376
|
"endIndex": 2
|
|
3377
3377
|
}
|
|
3378
3378
|
},
|
|
3379
|
+
{
|
|
3380
|
+
"kind": "Function",
|
|
3381
|
+
"canonicalReference": "@genesislcap/foundation-utils!getDateFormatter:function(1)",
|
|
3382
|
+
"docComment": "/**\n * @public\n */\n",
|
|
3383
|
+
"excerptTokens": [
|
|
3384
|
+
{
|
|
3385
|
+
"kind": "Content",
|
|
3386
|
+
"text": "export declare function getDateFormatter(locale?: "
|
|
3387
|
+
},
|
|
3388
|
+
{
|
|
3389
|
+
"kind": "Content",
|
|
3390
|
+
"text": "string"
|
|
3391
|
+
},
|
|
3392
|
+
{
|
|
3393
|
+
"kind": "Content",
|
|
3394
|
+
"text": ", options?: "
|
|
3395
|
+
},
|
|
3396
|
+
{
|
|
3397
|
+
"kind": "Reference",
|
|
3398
|
+
"text": "Intl.DateTimeFormatOptions",
|
|
3399
|
+
"canonicalReference": "!Intl.DateTimeFormatOptions:interface"
|
|
3400
|
+
},
|
|
3401
|
+
{
|
|
3402
|
+
"kind": "Content",
|
|
3403
|
+
"text": "): "
|
|
3404
|
+
},
|
|
3405
|
+
{
|
|
3406
|
+
"kind": "Content",
|
|
3407
|
+
"text": "(params: any) => string"
|
|
3408
|
+
},
|
|
3409
|
+
{
|
|
3410
|
+
"kind": "Content",
|
|
3411
|
+
"text": ";"
|
|
3412
|
+
}
|
|
3413
|
+
],
|
|
3414
|
+
"fileUrlPath": "src/formatters/datetime.ts",
|
|
3415
|
+
"returnTypeTokenRange": {
|
|
3416
|
+
"startIndex": 5,
|
|
3417
|
+
"endIndex": 6
|
|
3418
|
+
},
|
|
3419
|
+
"releaseTag": "Public",
|
|
3420
|
+
"overloadIndex": 1,
|
|
3421
|
+
"parameters": [
|
|
3422
|
+
{
|
|
3423
|
+
"parameterName": "locale",
|
|
3424
|
+
"parameterTypeTokenRange": {
|
|
3425
|
+
"startIndex": 1,
|
|
3426
|
+
"endIndex": 2
|
|
3427
|
+
},
|
|
3428
|
+
"isOptional": true
|
|
3429
|
+
},
|
|
3430
|
+
{
|
|
3431
|
+
"parameterName": "options",
|
|
3432
|
+
"parameterTypeTokenRange": {
|
|
3433
|
+
"startIndex": 3,
|
|
3434
|
+
"endIndex": 4
|
|
3435
|
+
},
|
|
3436
|
+
"isOptional": true
|
|
3437
|
+
}
|
|
3438
|
+
],
|
|
3439
|
+
"name": "getDateFormatter"
|
|
3440
|
+
},
|
|
3379
3441
|
{
|
|
3380
3442
|
"kind": "Variable",
|
|
3381
3443
|
"canonicalReference": "@genesislcap/foundation-utils!getFontMixin:var",
|
|
@@ -3417,6 +3479,67 @@
|
|
|
3417
3479
|
"endIndex": 6
|
|
3418
3480
|
}
|
|
3419
3481
|
},
|
|
3482
|
+
{
|
|
3483
|
+
"kind": "Function",
|
|
3484
|
+
"canonicalReference": "@genesislcap/foundation-utils!getNumberFormatter:function(1)",
|
|
3485
|
+
"docComment": "/**\n * @public\n */\n",
|
|
3486
|
+
"excerptTokens": [
|
|
3487
|
+
{
|
|
3488
|
+
"kind": "Content",
|
|
3489
|
+
"text": "export declare function getNumberFormatter(format: "
|
|
3490
|
+
},
|
|
3491
|
+
{
|
|
3492
|
+
"kind": "Content",
|
|
3493
|
+
"text": "string"
|
|
3494
|
+
},
|
|
3495
|
+
{
|
|
3496
|
+
"kind": "Content",
|
|
3497
|
+
"text": ", locale?: "
|
|
3498
|
+
},
|
|
3499
|
+
{
|
|
3500
|
+
"kind": "Content",
|
|
3501
|
+
"text": "string | null"
|
|
3502
|
+
},
|
|
3503
|
+
{
|
|
3504
|
+
"kind": "Content",
|
|
3505
|
+
"text": "): "
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
"kind": "Content",
|
|
3509
|
+
"text": "(params: any) => any"
|
|
3510
|
+
},
|
|
3511
|
+
{
|
|
3512
|
+
"kind": "Content",
|
|
3513
|
+
"text": ";"
|
|
3514
|
+
}
|
|
3515
|
+
],
|
|
3516
|
+
"fileUrlPath": "src/formatters/number.ts",
|
|
3517
|
+
"returnTypeTokenRange": {
|
|
3518
|
+
"startIndex": 5,
|
|
3519
|
+
"endIndex": 6
|
|
3520
|
+
},
|
|
3521
|
+
"releaseTag": "Public",
|
|
3522
|
+
"overloadIndex": 1,
|
|
3523
|
+
"parameters": [
|
|
3524
|
+
{
|
|
3525
|
+
"parameterName": "format",
|
|
3526
|
+
"parameterTypeTokenRange": {
|
|
3527
|
+
"startIndex": 1,
|
|
3528
|
+
"endIndex": 2
|
|
3529
|
+
},
|
|
3530
|
+
"isOptional": false
|
|
3531
|
+
},
|
|
3532
|
+
{
|
|
3533
|
+
"parameterName": "locale",
|
|
3534
|
+
"parameterTypeTokenRange": {
|
|
3535
|
+
"startIndex": 3,
|
|
3536
|
+
"endIndex": 4
|
|
3537
|
+
},
|
|
3538
|
+
"isOptional": true
|
|
3539
|
+
}
|
|
3540
|
+
],
|
|
3541
|
+
"name": "getNumberFormatter"
|
|
3542
|
+
},
|
|
3420
3543
|
{
|
|
3421
3544
|
"kind": "Variable",
|
|
3422
3545
|
"canonicalReference": "@genesislcap/foundation-utils!HTTP_CONFIG:var",
|
|
@@ -451,6 +451,11 @@ export declare type FoundationLayoutContainer = {
|
|
|
451
451
|
*/
|
|
452
452
|
export declare const GENESIS_SOCKET_URL: string;
|
|
453
453
|
|
|
454
|
+
/**
|
|
455
|
+
* @public
|
|
456
|
+
*/
|
|
457
|
+
export declare function getDateFormatter(locale?: string, options?: Intl.DateTimeFormatOptions): (params: any) => string;
|
|
458
|
+
|
|
454
459
|
/**
|
|
455
460
|
* Generates a CSS mixin for the specified font family, style, and weight.
|
|
456
461
|
* @param family - The font family.
|
|
@@ -461,6 +466,11 @@ export declare const GENESIS_SOCKET_URL: string;
|
|
|
461
466
|
*/
|
|
462
467
|
export declare const getFontMixin: (family: string, style?: FontStyle, weight?: FontWeight) => string;
|
|
463
468
|
|
|
469
|
+
/**
|
|
470
|
+
* @public
|
|
471
|
+
*/
|
|
472
|
+
export declare function getNumberFormatter(format: string, locale?: string | null): (params: any) => any;
|
|
473
|
+
|
|
464
474
|
/**
|
|
465
475
|
* Configuration settings for HTTP, used in http connect flow [`genesislcap-foundation-comms.HttpConnectConfig`](https://link-to-docs).
|
|
466
476
|
* @remarks Optional.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [getDateFormatter](./foundation-utils.getdateformatter.md)
|
|
4
|
+
|
|
5
|
+
## getDateFormatter() function
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
**Signature:**
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
export declare function getDateFormatter(locale?: string, options?: Intl.DateTimeFormatOptions): (params: any) => string;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Type | Description |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| locale | string | _(Optional)_ |
|
|
19
|
+
| options | Intl.DateTimeFormatOptions | _(Optional)_ |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
(params: any) => string
|
|
24
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [getNumberFormatter](./foundation-utils.getnumberformatter.md)
|
|
4
|
+
|
|
5
|
+
## getNumberFormatter() function
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
**Signature:**
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
export declare function getNumberFormatter(format: string, locale?: string | null): (params: any) => any;
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
| Parameter | Type | Description |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| format | string | |
|
|
19
|
+
| locale | string \| null | _(Optional)_ |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
(params: any) => any
|
|
24
|
+
|
|
@@ -32,6 +32,8 @@
|
|
|
32
32
|
| [formatDateTimestamp(timestamp)](./foundation-utils.formatdatetimestamp.md) | Formats \[DATE\] UNIX Timestamps (without time) to readable strings |
|
|
33
33
|
| [formatDateTimeTimestamp(timestamp)](./foundation-utils.formatdatetimetimestamp.md) | Formats \[DATETIME\] UNIX Timestamps (with time) to readable strings |
|
|
34
34
|
| [formatTimestamp(timestamp, withTime)](./foundation-utils.formattimestamp.md) | Formats \[DATE\|DATETIME\] Unix Timestamps to readable strings |
|
|
35
|
+
| [getDateFormatter(locale, options)](./foundation-utils.getdateformatter.md) | |
|
|
36
|
+
| [getNumberFormatter(format, locale)](./foundation-utils.getnumberformatter.md) | |
|
|
35
37
|
| [JSONReplacer(key, value)](./foundation-utils.jsonreplacer.md) | JSON replacer function. |
|
|
36
38
|
| [JSONReviver(key, value)](./foundation-utils.jsonreviver.md) | JSON reviver function. |
|
|
37
39
|
| [reactive(object, deep)](./foundation-utils.reactive.md) | **_(BETA)_** Converts a plain object to a reactive, observable object. |
|
package/docs/api-report.md
CHANGED
|
@@ -256,9 +256,15 @@ export type FoundationLayoutContainer = {
|
|
|
256
256
|
// @public
|
|
257
257
|
export const GENESIS_SOCKET_URL: string;
|
|
258
258
|
|
|
259
|
+
// @public (undocumented)
|
|
260
|
+
export function getDateFormatter(locale?: string, options?: Intl.DateTimeFormatOptions): (params: any) => string;
|
|
261
|
+
|
|
259
262
|
// @public
|
|
260
263
|
export const getFontMixin: (family: string, style?: FontStyle, weight?: FontWeight) => string;
|
|
261
264
|
|
|
265
|
+
// @public (undocumented)
|
|
266
|
+
export function getNumberFormatter(format: string, locale?: string | null): (params: any) => any;
|
|
267
|
+
|
|
262
268
|
// @public
|
|
263
269
|
export let HTTP_CONFIG: string;
|
|
264
270
|
|
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.
|
|
4
|
+
"version": "14.197.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -27,21 +27,22 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@genesislcap/foundation-testing": "14.
|
|
31
|
-
"@genesislcap/genx": "14.
|
|
32
|
-
"@genesislcap/rollup-builder": "14.
|
|
33
|
-
"@genesislcap/ts-builder": "14.
|
|
34
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
|
35
|
-
"@genesislcap/vite-builder": "14.
|
|
36
|
-
"@genesislcap/webpack-builder": "14.
|
|
30
|
+
"@genesislcap/foundation-testing": "14.197.0",
|
|
31
|
+
"@genesislcap/genx": "14.197.0",
|
|
32
|
+
"@genesislcap/rollup-builder": "14.197.0",
|
|
33
|
+
"@genesislcap/ts-builder": "14.197.0",
|
|
34
|
+
"@genesislcap/uvu-playwright-builder": "14.197.0",
|
|
35
|
+
"@genesislcap/vite-builder": "14.197.0",
|
|
36
|
+
"@genesislcap/webpack-builder": "14.197.0",
|
|
37
37
|
"rimraf": "^5.0.0"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@genesislcap/foundation-logger": "14.
|
|
40
|
+
"@genesislcap/foundation-logger": "14.197.0",
|
|
41
41
|
"@microsoft/fast-components": "^2.30.6",
|
|
42
42
|
"@microsoft/fast-element": "^1.12.0",
|
|
43
43
|
"@microsoft/fast-foundation": "^2.49.4",
|
|
44
44
|
"lossless-json": "^2.0.11",
|
|
45
|
+
"numeral": "2.0.6",
|
|
45
46
|
"tslib": "^2.3.1",
|
|
46
47
|
"uuid": "^8.3.2"
|
|
47
48
|
},
|
|
@@ -54,5 +55,5 @@
|
|
|
54
55
|
"access": "public"
|
|
55
56
|
},
|
|
56
57
|
"customElements": "dist/custom-elements.json",
|
|
57
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "1520d802086369c1ef2feb25e9d06a27b6fd09d4"
|
|
58
59
|
}
|