@balena/ui-shared-components 13.0.0-build-rename-and-require-widget-extracontext-02517a1eb79682c0cdcb0dd0fe8ccb17c7a2f285-1 → 13.0.0-build-rename-and-require-widget-extracontext-e171aab42694be794a4f90dd4cac672b0d41c56e-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.
|
@@ -22,7 +22,7 @@ export interface WidgetProps<T extends object = object> {
|
|
|
22
22
|
resource: T;
|
|
23
23
|
}
|
|
24
24
|
export interface Widget<T extends object = object> {
|
|
25
|
-
uiOptions?:
|
|
25
|
+
uiOptions?: Record<string, JSONSchema>;
|
|
26
26
|
supportedTypes?: string[];
|
|
27
27
|
displayName: string;
|
|
28
28
|
(props: WidgetProps<T>): JSX.Element | null;
|
|
@@ -45,10 +45,6 @@ export interface JsonTypesTypeMap {
|
|
|
45
45
|
boolean: boolean;
|
|
46
46
|
null: null;
|
|
47
47
|
}
|
|
48
|
-
export type UiOptions = {
|
|
49
|
-
[key: string]: JSONSchema;
|
|
50
|
-
};
|
|
51
|
-
export declare const UiOption: UiOptions;
|
|
52
48
|
export declare const widgetFactory: <ST extends Array<keyof JsonTypesTypeMap>>(displayName: string, supportedTypes: ST) => <T extends object, V extends WidgetProps["value"] | null = JsonTypesTypeMap[ST[number]]>(widgetFn: (props: Overwrite<WidgetProps<T>, {
|
|
53
49
|
value: V;
|
|
54
50
|
}>) => JSX.Element | null) => Widget<T>;
|
|
@@ -12,24 +12,6 @@ export const JsonTypes = {
|
|
|
12
12
|
boolean: 'boolean',
|
|
13
13
|
null: 'null',
|
|
14
14
|
};
|
|
15
|
-
// Convenience object for common UI option schemas
|
|
16
|
-
export const UiOption = {
|
|
17
|
-
string: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
},
|
|
20
|
-
boolean: {
|
|
21
|
-
type: 'boolean',
|
|
22
|
-
},
|
|
23
|
-
number: {
|
|
24
|
-
type: 'number',
|
|
25
|
-
},
|
|
26
|
-
integer: {
|
|
27
|
-
type: 'integer',
|
|
28
|
-
},
|
|
29
|
-
object: {
|
|
30
|
-
type: 'object',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
15
|
// TODO: Replace the HOF with a plain function once TS supports optional generic types
|
|
34
16
|
// See: https://github.com/microsoft/TypeScript/issues/14400
|
|
35
17
|
// TODO: convert the fn args to an object once we bump TS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/ui-shared-components",
|
|
3
|
-
"version": "13.0.0-build-rename-and-require-widget-extracontext-
|
|
3
|
+
"version": "13.0.0-build-rename-and-require-widget-extracontext-e171aab42694be794a4f90dd4cac672b0d41c56e-1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -138,6 +138,6 @@
|
|
|
138
138
|
},
|
|
139
139
|
"homepage": "https://github.com/balena-io/ui-shared-components#readme",
|
|
140
140
|
"versionist": {
|
|
141
|
-
"publishedAt": "2025-05-
|
|
141
|
+
"publishedAt": "2025-05-08T19:09:01.290Z"
|
|
142
142
|
}
|
|
143
143
|
}
|