@cccsaurora/howler-ui 2.13.0-dev.125 → 2.13.0-dev.129
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.
|
@@ -113,6 +113,7 @@ export interface APIConfiguration {
|
|
|
113
113
|
classification: string;
|
|
114
114
|
}[];
|
|
115
115
|
};
|
|
116
|
+
mapping: APIMappings;
|
|
116
117
|
features: {
|
|
117
118
|
borealis: boolean;
|
|
118
119
|
notebook: boolean;
|
|
@@ -257,9 +258,15 @@ export interface APIC12Ndef {
|
|
|
257
258
|
UNRESTRICTED: string;
|
|
258
259
|
RESTRICTED: string;
|
|
259
260
|
}
|
|
261
|
+
export interface APIMappings {
|
|
262
|
+
mapping: {
|
|
263
|
+
[index: string]: string;
|
|
264
|
+
};
|
|
265
|
+
}
|
|
260
266
|
export interface ApiType {
|
|
261
267
|
indexes: APIIndexes;
|
|
262
268
|
lookups: APILookups;
|
|
263
269
|
configuration: APIConfiguration;
|
|
264
270
|
c12nDef: APIC12Ndef;
|
|
271
|
+
mapping: APIMappings;
|
|
265
272
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Typography } from '@mui/material';
|
|
3
3
|
import { EnrichedTypography, useBorealisEnrichSelector } from 'borealis-ui';
|
|
4
|
-
import {
|
|
4
|
+
import { ApiConfigContext } from '@cccsaurora/howler-ui/components/app/providers/ApiConfigProvider';
|
|
5
|
+
import { memo, useContext } from 'react';
|
|
5
6
|
const BorealisTypography = ({ children, value, context, ...props }) => {
|
|
6
7
|
const guessType = useBorealisEnrichSelector(ctx => ctx.guessType);
|
|
7
|
-
const
|
|
8
|
+
const { config } = useContext(ApiConfigContext);
|
|
9
|
+
const type = config?.configuration?.mapping?.[value] ?? guessType(value);
|
|
8
10
|
if (!type) {
|
|
9
11
|
return _jsx(Typography, { ...props, children: children });
|
|
10
12
|
}
|