@genesislcap/foundation-utils 14.260.1 → 14.260.2-alpha-9e268e0.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 +207 -173
- package/dist/dts/design-system/design-system.d.ts +13 -0
- package/dist/dts/design-system/design-system.d.ts.map +1 -1
- package/dist/esm/design-system/design-system.js +32 -0
- package/dist/foundation-utils.api.json +62 -0
- package/dist/foundation-utils.d.ts +14 -0
- package/docs/api/foundation-utils.getcurrentdesignsystemprefix.md +35 -0
- package/docs/api/foundation-utils.md +1 -0
- package/docs/api-report.md +3 -0
- package/package.json +10 -10
|
@@ -169,6 +169,113 @@
|
|
|
169
169
|
}
|
|
170
170
|
]
|
|
171
171
|
},
|
|
172
|
+
{
|
|
173
|
+
"kind": "javascript-module",
|
|
174
|
+
"path": "src/directives/index.ts",
|
|
175
|
+
"declarations": [],
|
|
176
|
+
"exports": [
|
|
177
|
+
{
|
|
178
|
+
"kind": "js",
|
|
179
|
+
"name": "*",
|
|
180
|
+
"declaration": {
|
|
181
|
+
"name": "*",
|
|
182
|
+
"package": "./sync"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"kind": "js",
|
|
187
|
+
"name": "*",
|
|
188
|
+
"declaration": {
|
|
189
|
+
"name": "*",
|
|
190
|
+
"package": "./when-else"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"kind": "javascript-module",
|
|
197
|
+
"path": "src/design-system/design-system.ts",
|
|
198
|
+
"declarations": [
|
|
199
|
+
{
|
|
200
|
+
"kind": "function",
|
|
201
|
+
"name": "assureDesignSystem",
|
|
202
|
+
"return": {
|
|
203
|
+
"type": {
|
|
204
|
+
"text": "DesignSystemModule"
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"parameters": [
|
|
208
|
+
{
|
|
209
|
+
"name": "module",
|
|
210
|
+
"type": {
|
|
211
|
+
"text": "DesignSystemModule"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
"description": "assureDesignSystem.",
|
|
216
|
+
"privacy": "public"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"kind": "function",
|
|
220
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
221
|
+
"return": {
|
|
222
|
+
"type": {
|
|
223
|
+
"text": ""
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"parameters": [
|
|
227
|
+
{
|
|
228
|
+
"name": "element",
|
|
229
|
+
"type": {
|
|
230
|
+
"text": "HTMLElement"
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "fallbackPrefix",
|
|
235
|
+
"type": {
|
|
236
|
+
"text": "string"
|
|
237
|
+
},
|
|
238
|
+
"description": "The prefix to fallback to if the provider is not available"
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"description": "Get the current design system prefix. If the provider is not available, fallback to the provided prefix.",
|
|
242
|
+
"privacy": "public"
|
|
243
|
+
}
|
|
244
|
+
],
|
|
245
|
+
"exports": [
|
|
246
|
+
{
|
|
247
|
+
"kind": "js",
|
|
248
|
+
"name": "assureDesignSystem",
|
|
249
|
+
"declaration": {
|
|
250
|
+
"name": "assureDesignSystem",
|
|
251
|
+
"module": "src/design-system/design-system.ts"
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"kind": "js",
|
|
256
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
257
|
+
"declaration": {
|
|
258
|
+
"name": "getCurrentDesignSystemPrefix",
|
|
259
|
+
"module": "src/design-system/design-system.ts"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
"kind": "javascript-module",
|
|
266
|
+
"path": "src/design-system/index.ts",
|
|
267
|
+
"declarations": [],
|
|
268
|
+
"exports": [
|
|
269
|
+
{
|
|
270
|
+
"kind": "js",
|
|
271
|
+
"name": "*",
|
|
272
|
+
"declaration": {
|
|
273
|
+
"name": "*",
|
|
274
|
+
"package": "./design-system"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
},
|
|
172
279
|
{
|
|
173
280
|
"kind": "javascript-module",
|
|
174
281
|
"path": "src/data/inMemoryDatabase.ts",
|
|
@@ -420,79 +527,6 @@
|
|
|
420
527
|
}
|
|
421
528
|
]
|
|
422
529
|
},
|
|
423
|
-
{
|
|
424
|
-
"kind": "javascript-module",
|
|
425
|
-
"path": "src/directives/index.ts",
|
|
426
|
-
"declarations": [],
|
|
427
|
-
"exports": [
|
|
428
|
-
{
|
|
429
|
-
"kind": "js",
|
|
430
|
-
"name": "*",
|
|
431
|
-
"declaration": {
|
|
432
|
-
"name": "*",
|
|
433
|
-
"package": "./sync"
|
|
434
|
-
}
|
|
435
|
-
},
|
|
436
|
-
{
|
|
437
|
-
"kind": "js",
|
|
438
|
-
"name": "*",
|
|
439
|
-
"declaration": {
|
|
440
|
-
"name": "*",
|
|
441
|
-
"package": "./when-else"
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
]
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
"kind": "javascript-module",
|
|
448
|
-
"path": "src/design-system/design-system.ts",
|
|
449
|
-
"declarations": [
|
|
450
|
-
{
|
|
451
|
-
"kind": "function",
|
|
452
|
-
"name": "assureDesignSystem",
|
|
453
|
-
"return": {
|
|
454
|
-
"type": {
|
|
455
|
-
"text": "DesignSystemModule"
|
|
456
|
-
}
|
|
457
|
-
},
|
|
458
|
-
"parameters": [
|
|
459
|
-
{
|
|
460
|
-
"name": "module",
|
|
461
|
-
"type": {
|
|
462
|
-
"text": "DesignSystemModule"
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
],
|
|
466
|
-
"description": "assureDesignSystem.",
|
|
467
|
-
"privacy": "public"
|
|
468
|
-
}
|
|
469
|
-
],
|
|
470
|
-
"exports": [
|
|
471
|
-
{
|
|
472
|
-
"kind": "js",
|
|
473
|
-
"name": "assureDesignSystem",
|
|
474
|
-
"declaration": {
|
|
475
|
-
"name": "assureDesignSystem",
|
|
476
|
-
"module": "src/design-system/design-system.ts"
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
]
|
|
480
|
-
},
|
|
481
|
-
{
|
|
482
|
-
"kind": "javascript-module",
|
|
483
|
-
"path": "src/design-system/index.ts",
|
|
484
|
-
"declarations": [],
|
|
485
|
-
"exports": [
|
|
486
|
-
{
|
|
487
|
-
"kind": "js",
|
|
488
|
-
"name": "*",
|
|
489
|
-
"declaration": {
|
|
490
|
-
"name": "*",
|
|
491
|
-
"package": "./design-system"
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
]
|
|
495
|
-
},
|
|
496
530
|
{
|
|
497
531
|
"kind": "javascript-module",
|
|
498
532
|
"path": "src/encoding/index.ts",
|
|
@@ -2598,6 +2632,106 @@
|
|
|
2598
2632
|
}
|
|
2599
2633
|
]
|
|
2600
2634
|
},
|
|
2635
|
+
{
|
|
2636
|
+
"kind": "javascript-module",
|
|
2637
|
+
"path": "src/mappers/dto/index.ts",
|
|
2638
|
+
"declarations": [],
|
|
2639
|
+
"exports": [
|
|
2640
|
+
{
|
|
2641
|
+
"kind": "js",
|
|
2642
|
+
"name": "*",
|
|
2643
|
+
"declaration": {
|
|
2644
|
+
"name": "*",
|
|
2645
|
+
"package": "./serverRow"
|
|
2646
|
+
}
|
|
2647
|
+
},
|
|
2648
|
+
{
|
|
2649
|
+
"kind": "js",
|
|
2650
|
+
"name": "*",
|
|
2651
|
+
"declaration": {
|
|
2652
|
+
"name": "*",
|
|
2653
|
+
"package": "./types"
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
]
|
|
2657
|
+
},
|
|
2658
|
+
{
|
|
2659
|
+
"kind": "javascript-module",
|
|
2660
|
+
"path": "src/mappers/dto/serverRow.ts",
|
|
2661
|
+
"declarations": [
|
|
2662
|
+
{
|
|
2663
|
+
"kind": "class",
|
|
2664
|
+
"description": "The default `ServerRowDTOMapper`.",
|
|
2665
|
+
"name": "DefaultServerRowDTOMapper",
|
|
2666
|
+
"members": [
|
|
2667
|
+
{
|
|
2668
|
+
"kind": "field",
|
|
2669
|
+
"name": "fromDTO",
|
|
2670
|
+
"description": "Converts a server row DTO to an entity.",
|
|
2671
|
+
"parameters": [
|
|
2672
|
+
{
|
|
2673
|
+
"description": "The DTO to convert.",
|
|
2674
|
+
"name": "dto"
|
|
2675
|
+
}
|
|
2676
|
+
],
|
|
2677
|
+
"return": {
|
|
2678
|
+
"type": {
|
|
2679
|
+
"text": ""
|
|
2680
|
+
}
|
|
2681
|
+
},
|
|
2682
|
+
"privacy": "public"
|
|
2683
|
+
},
|
|
2684
|
+
{
|
|
2685
|
+
"kind": "field",
|
|
2686
|
+
"name": "toDTO",
|
|
2687
|
+
"description": "Converts a server row entity to a DTO.",
|
|
2688
|
+
"parameters": [
|
|
2689
|
+
{
|
|
2690
|
+
"description": "The entity to convert.",
|
|
2691
|
+
"name": "entity"
|
|
2692
|
+
}
|
|
2693
|
+
],
|
|
2694
|
+
"return": {
|
|
2695
|
+
"type": {
|
|
2696
|
+
"text": ""
|
|
2697
|
+
}
|
|
2698
|
+
},
|
|
2699
|
+
"privacy": "public"
|
|
2700
|
+
}
|
|
2701
|
+
]
|
|
2702
|
+
},
|
|
2703
|
+
{
|
|
2704
|
+
"kind": "variable",
|
|
2705
|
+
"name": "ServerRowDTOMapper",
|
|
2706
|
+
"description": "A DI token used to obtain a `ServerRowDTOMapper` instance.",
|
|
2707
|
+
"privacy": "public"
|
|
2708
|
+
}
|
|
2709
|
+
],
|
|
2710
|
+
"exports": [
|
|
2711
|
+
{
|
|
2712
|
+
"kind": "js",
|
|
2713
|
+
"name": "DefaultServerRowDTOMapper",
|
|
2714
|
+
"declaration": {
|
|
2715
|
+
"name": "DefaultServerRowDTOMapper",
|
|
2716
|
+
"module": "src/mappers/dto/serverRow.ts"
|
|
2717
|
+
}
|
|
2718
|
+
},
|
|
2719
|
+
{
|
|
2720
|
+
"kind": "js",
|
|
2721
|
+
"name": "ServerRowDTOMapper",
|
|
2722
|
+
"declaration": {
|
|
2723
|
+
"name": "ServerRowDTOMapper",
|
|
2724
|
+
"module": "src/mappers/dto/serverRow.ts"
|
|
2725
|
+
}
|
|
2726
|
+
}
|
|
2727
|
+
]
|
|
2728
|
+
},
|
|
2729
|
+
{
|
|
2730
|
+
"kind": "javascript-module",
|
|
2731
|
+
"path": "src/mappers/dto/types.ts",
|
|
2732
|
+
"declarations": [],
|
|
2733
|
+
"exports": []
|
|
2734
|
+
},
|
|
2601
2735
|
{
|
|
2602
2736
|
"kind": "javascript-module",
|
|
2603
2737
|
"path": "src/encoding/base64/decode.ts",
|
|
@@ -2752,106 +2886,6 @@
|
|
|
2752
2886
|
}
|
|
2753
2887
|
]
|
|
2754
2888
|
},
|
|
2755
|
-
{
|
|
2756
|
-
"kind": "javascript-module",
|
|
2757
|
-
"path": "src/mappers/dto/index.ts",
|
|
2758
|
-
"declarations": [],
|
|
2759
|
-
"exports": [
|
|
2760
|
-
{
|
|
2761
|
-
"kind": "js",
|
|
2762
|
-
"name": "*",
|
|
2763
|
-
"declaration": {
|
|
2764
|
-
"name": "*",
|
|
2765
|
-
"package": "./serverRow"
|
|
2766
|
-
}
|
|
2767
|
-
},
|
|
2768
|
-
{
|
|
2769
|
-
"kind": "js",
|
|
2770
|
-
"name": "*",
|
|
2771
|
-
"declaration": {
|
|
2772
|
-
"name": "*",
|
|
2773
|
-
"package": "./types"
|
|
2774
|
-
}
|
|
2775
|
-
}
|
|
2776
|
-
]
|
|
2777
|
-
},
|
|
2778
|
-
{
|
|
2779
|
-
"kind": "javascript-module",
|
|
2780
|
-
"path": "src/mappers/dto/serverRow.ts",
|
|
2781
|
-
"declarations": [
|
|
2782
|
-
{
|
|
2783
|
-
"kind": "class",
|
|
2784
|
-
"description": "The default `ServerRowDTOMapper`.",
|
|
2785
|
-
"name": "DefaultServerRowDTOMapper",
|
|
2786
|
-
"members": [
|
|
2787
|
-
{
|
|
2788
|
-
"kind": "field",
|
|
2789
|
-
"name": "fromDTO",
|
|
2790
|
-
"description": "Converts a server row DTO to an entity.",
|
|
2791
|
-
"parameters": [
|
|
2792
|
-
{
|
|
2793
|
-
"description": "The DTO to convert.",
|
|
2794
|
-
"name": "dto"
|
|
2795
|
-
}
|
|
2796
|
-
],
|
|
2797
|
-
"return": {
|
|
2798
|
-
"type": {
|
|
2799
|
-
"text": ""
|
|
2800
|
-
}
|
|
2801
|
-
},
|
|
2802
|
-
"privacy": "public"
|
|
2803
|
-
},
|
|
2804
|
-
{
|
|
2805
|
-
"kind": "field",
|
|
2806
|
-
"name": "toDTO",
|
|
2807
|
-
"description": "Converts a server row entity to a DTO.",
|
|
2808
|
-
"parameters": [
|
|
2809
|
-
{
|
|
2810
|
-
"description": "The entity to convert.",
|
|
2811
|
-
"name": "entity"
|
|
2812
|
-
}
|
|
2813
|
-
],
|
|
2814
|
-
"return": {
|
|
2815
|
-
"type": {
|
|
2816
|
-
"text": ""
|
|
2817
|
-
}
|
|
2818
|
-
},
|
|
2819
|
-
"privacy": "public"
|
|
2820
|
-
}
|
|
2821
|
-
]
|
|
2822
|
-
},
|
|
2823
|
-
{
|
|
2824
|
-
"kind": "variable",
|
|
2825
|
-
"name": "ServerRowDTOMapper",
|
|
2826
|
-
"description": "A DI token used to obtain a `ServerRowDTOMapper` instance.",
|
|
2827
|
-
"privacy": "public"
|
|
2828
|
-
}
|
|
2829
|
-
],
|
|
2830
|
-
"exports": [
|
|
2831
|
-
{
|
|
2832
|
-
"kind": "js",
|
|
2833
|
-
"name": "DefaultServerRowDTOMapper",
|
|
2834
|
-
"declaration": {
|
|
2835
|
-
"name": "DefaultServerRowDTOMapper",
|
|
2836
|
-
"module": "src/mappers/dto/serverRow.ts"
|
|
2837
|
-
}
|
|
2838
|
-
},
|
|
2839
|
-
{
|
|
2840
|
-
"kind": "js",
|
|
2841
|
-
"name": "ServerRowDTOMapper",
|
|
2842
|
-
"declaration": {
|
|
2843
|
-
"name": "ServerRowDTOMapper",
|
|
2844
|
-
"module": "src/mappers/dto/serverRow.ts"
|
|
2845
|
-
}
|
|
2846
|
-
}
|
|
2847
|
-
]
|
|
2848
|
-
},
|
|
2849
|
-
{
|
|
2850
|
-
"kind": "javascript-module",
|
|
2851
|
-
"path": "src/mappers/dto/types.ts",
|
|
2852
|
-
"declarations": [],
|
|
2853
|
-
"exports": []
|
|
2854
|
-
},
|
|
2855
2889
|
{
|
|
2856
2890
|
"kind": "javascript-module",
|
|
2857
2891
|
"path": "src/mappers/genesis-json-schema/index.ts",
|
|
@@ -51,4 +51,17 @@ export type DesignSystemResource<T = DesignSystemModule> = Promise<T>;
|
|
|
51
51
|
* @public
|
|
52
52
|
*/
|
|
53
53
|
export declare function assureDesignSystem(module: DesignSystemModule): DesignSystemModule;
|
|
54
|
+
/**
|
|
55
|
+
* Get the current design system prefix. If the provider is not available, fallback to the provided prefix.
|
|
56
|
+
* @param fallbackPrefix - The prefix to fallback to if the provider is not available
|
|
57
|
+
* @returns The current design system prefix
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const prefix = getCurrentDesignSystemPrefix('my-prefix');
|
|
62
|
+
* logger.debug(prefix); // May return 'zero' or 'rapid' if the provider is available or 'my-prefix' if not
|
|
63
|
+
* ```
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export declare function getCurrentDesignSystemPrefix(element: HTMLElement, fallbackPrefix: string): string;
|
|
54
67
|
//# sourceMappingURL=design-system.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"design-system.d.ts","sourceRoot":"","sources":["../../../src/design-system/design-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"design-system.d.ts","sourceRoot":"","sources":["../../../src/design-system/design-system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,mBAAmB,CACjB,OAAO,CAAC,EAAE,WAAW,EACrB,MAAM,CAAC,EAAE,MAAM,GACd,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IACjD,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,GAAG,kBAAkB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAQjF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM,CA2BjG"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DesignSystem } from '@microsoft/fast-foundation';
|
|
2
|
+
import { logger } from '../utils';
|
|
1
3
|
/**
|
|
2
4
|
* assureDesignSystem.
|
|
3
5
|
*
|
|
@@ -45,3 +47,33 @@ export function assureDesignSystem(module) {
|
|
|
45
47
|
}
|
|
46
48
|
return module;
|
|
47
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Get the current design system prefix. If the provider is not available, fallback to the provided prefix.
|
|
52
|
+
* @param fallbackPrefix - The prefix to fallback to if the provider is not available
|
|
53
|
+
* @returns The current design system prefix
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const prefix = getCurrentDesignSystemPrefix('my-prefix');
|
|
58
|
+
* logger.debug(prefix); // May return 'zero' or 'rapid' if the provider is available or 'my-prefix' if not
|
|
59
|
+
* ```
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export function getCurrentDesignSystemPrefix(element, fallbackPrefix) {
|
|
63
|
+
// Start with the target element and traverse up the DOM tree
|
|
64
|
+
let currentElement = element;
|
|
65
|
+
while (currentElement) {
|
|
66
|
+
// Try to find a design system specifically responsible for this element in the hierarchy
|
|
67
|
+
const provider = DesignSystem.responsibleFor(currentElement);
|
|
68
|
+
// If we found a valid provider that's associated with the current element
|
|
69
|
+
// or one of its ancestors (owner === currentElement)
|
|
70
|
+
if (provider && provider.prefix) {
|
|
71
|
+
return provider.prefix;
|
|
72
|
+
}
|
|
73
|
+
// Move up the DOM tree
|
|
74
|
+
currentElement = currentElement.parentElement;
|
|
75
|
+
}
|
|
76
|
+
// If no appropriate provider was found in the hierarchy
|
|
77
|
+
logger.warn(`DesignSystem provider not found for ${element.localName} element or its ancestors, falling back to ${fallbackPrefix} prefix.`);
|
|
78
|
+
return fallbackPrefix;
|
|
79
|
+
}
|
|
@@ -3716,6 +3716,68 @@
|
|
|
3716
3716
|
}
|
|
3717
3717
|
]
|
|
3718
3718
|
},
|
|
3719
|
+
{
|
|
3720
|
+
"kind": "Function",
|
|
3721
|
+
"canonicalReference": "@genesislcap/foundation-utils!getCurrentDesignSystemPrefix:function(1)",
|
|
3722
|
+
"docComment": "/**\n * Get the current design system prefix. If the provider is not available, fallback to the provided prefix.\n *\n * @param fallbackPrefix - The prefix to fallback to if the provider is not available\n *\n * @returns The current design system prefix\n *\n * @example\n * ```ts\n * const prefix = getCurrentDesignSystemPrefix('my-prefix');\n * logger.debug(prefix); // May return 'zero' or 'rapid' if the provider is available or 'my-prefix' if not\n * ```\n *\n * @public\n */\n",
|
|
3723
|
+
"excerptTokens": [
|
|
3724
|
+
{
|
|
3725
|
+
"kind": "Content",
|
|
3726
|
+
"text": "export declare function getCurrentDesignSystemPrefix(element: "
|
|
3727
|
+
},
|
|
3728
|
+
{
|
|
3729
|
+
"kind": "Reference",
|
|
3730
|
+
"text": "HTMLElement",
|
|
3731
|
+
"canonicalReference": "!HTMLElement:interface"
|
|
3732
|
+
},
|
|
3733
|
+
{
|
|
3734
|
+
"kind": "Content",
|
|
3735
|
+
"text": ", fallbackPrefix: "
|
|
3736
|
+
},
|
|
3737
|
+
{
|
|
3738
|
+
"kind": "Content",
|
|
3739
|
+
"text": "string"
|
|
3740
|
+
},
|
|
3741
|
+
{
|
|
3742
|
+
"kind": "Content",
|
|
3743
|
+
"text": "): "
|
|
3744
|
+
},
|
|
3745
|
+
{
|
|
3746
|
+
"kind": "Content",
|
|
3747
|
+
"text": "string"
|
|
3748
|
+
},
|
|
3749
|
+
{
|
|
3750
|
+
"kind": "Content",
|
|
3751
|
+
"text": ";"
|
|
3752
|
+
}
|
|
3753
|
+
],
|
|
3754
|
+
"fileUrlPath": "src/design-system/design-system.ts",
|
|
3755
|
+
"returnTypeTokenRange": {
|
|
3756
|
+
"startIndex": 5,
|
|
3757
|
+
"endIndex": 6
|
|
3758
|
+
},
|
|
3759
|
+
"releaseTag": "Public",
|
|
3760
|
+
"overloadIndex": 1,
|
|
3761
|
+
"parameters": [
|
|
3762
|
+
{
|
|
3763
|
+
"parameterName": "element",
|
|
3764
|
+
"parameterTypeTokenRange": {
|
|
3765
|
+
"startIndex": 1,
|
|
3766
|
+
"endIndex": 2
|
|
3767
|
+
},
|
|
3768
|
+
"isOptional": false
|
|
3769
|
+
},
|
|
3770
|
+
{
|
|
3771
|
+
"parameterName": "fallbackPrefix",
|
|
3772
|
+
"parameterTypeTokenRange": {
|
|
3773
|
+
"startIndex": 3,
|
|
3774
|
+
"endIndex": 4
|
|
3775
|
+
},
|
|
3776
|
+
"isOptional": false
|
|
3777
|
+
}
|
|
3778
|
+
],
|
|
3779
|
+
"name": "getCurrentDesignSystemPrefix"
|
|
3780
|
+
},
|
|
3719
3781
|
{
|
|
3720
3782
|
"kind": "Function",
|
|
3721
3783
|
"canonicalReference": "@genesislcap/foundation-utils!getDateFormatter:function(1)",
|
|
@@ -521,6 +521,20 @@ export declare namespace Genesis {
|
|
|
521
521
|
*/
|
|
522
522
|
export declare const GENESIS_SOCKET_URL: string;
|
|
523
523
|
|
|
524
|
+
/**
|
|
525
|
+
* Get the current design system prefix. If the provider is not available, fallback to the provided prefix.
|
|
526
|
+
* @param fallbackPrefix - The prefix to fallback to if the provider is not available
|
|
527
|
+
* @returns The current design system prefix
|
|
528
|
+
*
|
|
529
|
+
* @example
|
|
530
|
+
* ```ts
|
|
531
|
+
* const prefix = getCurrentDesignSystemPrefix('my-prefix');
|
|
532
|
+
* logger.debug(prefix); // May return 'zero' or 'rapid' if the provider is available or 'my-prefix' if not
|
|
533
|
+
* ```
|
|
534
|
+
* @public
|
|
535
|
+
*/
|
|
536
|
+
export declare function getCurrentDesignSystemPrefix(element: HTMLElement, fallbackPrefix: string): string;
|
|
537
|
+
|
|
524
538
|
/**
|
|
525
539
|
* @public
|
|
526
540
|
*/
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [@genesislcap/foundation-utils](./foundation-utils.md) > [getCurrentDesignSystemPrefix](./foundation-utils.getcurrentdesignsystemprefix.md)
|
|
4
|
+
|
|
5
|
+
## getCurrentDesignSystemPrefix() function
|
|
6
|
+
|
|
7
|
+
Get the current design system prefix. If the provider is not available, fallback to the provided prefix.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function getCurrentDesignSystemPrefix(element: HTMLElement, fallbackPrefix: string): string;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| element | HTMLElement | |
|
|
20
|
+
| fallbackPrefix | string | The prefix to fallback to if the provider is not available |
|
|
21
|
+
|
|
22
|
+
**Returns:**
|
|
23
|
+
|
|
24
|
+
string
|
|
25
|
+
|
|
26
|
+
The current design system prefix
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
const prefix = getCurrentDesignSystemPrefix('my-prefix');
|
|
33
|
+
logger.debug(prefix); // May return 'zero' or 'rapid' if the provider is available or 'my-prefix' if not
|
|
34
|
+
```
|
|
35
|
+
|
|
@@ -32,6 +32,7 @@
|
|
|
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
|
+
| [getCurrentDesignSystemPrefix(element, fallbackPrefix)](./foundation-utils.getcurrentdesignsystemprefix.md) | Get the current design system prefix. If the provider is not available, fallback to the provided prefix. |
|
|
35
36
|
| [getDateFormatter(locale, options)](./foundation-utils.getdateformatter.md) | |
|
|
36
37
|
| [getNumberFormatter(format, locale)](./foundation-utils.getnumberformatter.md) | |
|
|
37
38
|
| [JSONReplacer(key, value)](./foundation-utils.jsonreplacer.md) | JSON replacer function. |
|
package/docs/api-report.md
CHANGED
|
@@ -297,6 +297,9 @@ export namespace Genesis {
|
|
|
297
297
|
// @public
|
|
298
298
|
export const GENESIS_SOCKET_URL: string;
|
|
299
299
|
|
|
300
|
+
// @public
|
|
301
|
+
export function getCurrentDesignSystemPrefix(element: HTMLElement, fallbackPrefix: string): string;
|
|
302
|
+
|
|
300
303
|
// @public (undocumented)
|
|
301
304
|
export function getDateFormatter(locale?: string, options?: Intl.DateTimeFormatOptions): (params: any) => string;
|
|
302
305
|
|
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.260.
|
|
4
|
+
"version": "14.260.2-alpha-9e268e0.0",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -27,19 +27,19 @@
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@genesislcap/foundation-testing": "14.260.
|
|
31
|
-
"@genesislcap/genx": "14.260.
|
|
32
|
-
"@genesislcap/rollup-builder": "14.260.
|
|
33
|
-
"@genesislcap/ts-builder": "14.260.
|
|
34
|
-
"@genesislcap/uvu-playwright-builder": "14.260.
|
|
35
|
-
"@genesislcap/vite-builder": "14.260.
|
|
36
|
-
"@genesislcap/webpack-builder": "14.260.
|
|
30
|
+
"@genesislcap/foundation-testing": "14.260.2-alpha-9e268e0.0",
|
|
31
|
+
"@genesislcap/genx": "14.260.2-alpha-9e268e0.0",
|
|
32
|
+
"@genesislcap/rollup-builder": "14.260.2-alpha-9e268e0.0",
|
|
33
|
+
"@genesislcap/ts-builder": "14.260.2-alpha-9e268e0.0",
|
|
34
|
+
"@genesislcap/uvu-playwright-builder": "14.260.2-alpha-9e268e0.0",
|
|
35
|
+
"@genesislcap/vite-builder": "14.260.2-alpha-9e268e0.0",
|
|
36
|
+
"@genesislcap/webpack-builder": "14.260.2-alpha-9e268e0.0",
|
|
37
37
|
"@types/json-schema": "^7.0.11",
|
|
38
38
|
"rimraf": "^5.0.0"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@genesislcap/expression-builder": "14.258.1",
|
|
42
|
-
"@genesislcap/foundation-logger": "14.260.
|
|
42
|
+
"@genesislcap/foundation-logger": "14.260.2-alpha-9e268e0.0",
|
|
43
43
|
"@microsoft/fast-components": "2.30.6",
|
|
44
44
|
"@microsoft/fast-element": "1.14.0",
|
|
45
45
|
"@microsoft/fast-foundation": "2.49.6",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
59
|
"customElements": "dist/custom-elements.json",
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "1095d5b866fc1f13c98386aa2d06b22415225bbf"
|
|
61
61
|
}
|