@devicechain/widgets 0.19.0-rc.1 → 0.20.0-rc.4
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/README.md +13 -3
- package/dist/binding-policy.d.ts +4 -0
- package/dist/builtin-descriptors.d.ts +390 -0
- package/dist/builtin-registry.d.ts +378 -0
- package/dist/connected-widget.d.ts +4 -2
- package/dist/dashboard-renderer.d.ts +9 -4
- package/dist/default-registry.d.ts +2 -0
- package/dist/definition-options.d.ts +9 -5
- package/dist/index.d.ts +8 -10
- package/dist/index.js +1329 -1343
- package/dist/index.js.map +4 -4
- package/dist/options.d.ts +8 -302
- package/dist/registry.d.ts +6 -40
- package/dist/widget-containment.d.ts +9 -0
- package/dist/widget-host.d.ts +7 -0
- package/dist/widgets/alarm-count.d.ts +47 -2
- package/dist/widgets/alarm-table.d.ts +77 -2
- package/dist/widgets/command-button.d.ts +39 -2
- package/dist/widgets/entity-selector.d.ts +16 -1
- package/dist/widgets/gauge.d.ts +43 -1
- package/dist/widgets/image.d.ts +32 -2
- package/dist/widgets/label.d.ts +34 -2
- package/dist/widgets/latest-card.d.ts +42 -1
- package/dist/widgets/map.d.ts +22 -2
- package/dist/widgets/table.d.ts +31 -1
- package/dist/widgets/time-series-chart.d.ts +16 -1
- package/package.json +21 -20
- package/dist/chart-options.d.ts +0 -14
- package/dist/echart.d.ts +0 -8
- package/dist/flash.d.ts +0 -13
- package/dist/format.d.ts +0 -3
- package/dist/frame.d.ts +0 -25
- package/dist/hooks.d.ts +0 -54
- package/dist/theme.d.ts +0 -9
- package/dist/widget.d.ts +0 -16
package/dist/options.d.ts
CHANGED
|
@@ -1,304 +1,12 @@
|
|
|
1
|
-
import { type WidgetType } from '@devicechain/dashboards';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
kind: 'string';
|
|
8
|
-
format?: 'json';
|
|
9
|
-
}
|
|
10
|
-
export interface NumberOptionSpec extends OptionSpecBase {
|
|
11
|
-
kind: 'number';
|
|
12
|
-
min?: number;
|
|
13
|
-
max?: number;
|
|
14
|
-
integer?: true;
|
|
15
|
-
}
|
|
16
|
-
export interface BooleanOptionSpec extends OptionSpecBase {
|
|
17
|
-
kind: 'boolean';
|
|
18
|
-
}
|
|
19
|
-
export interface EnumOptionSpec<V extends string = string> extends OptionSpecBase {
|
|
20
|
-
kind: 'enum';
|
|
21
|
-
values: readonly V[];
|
|
22
|
-
}
|
|
23
|
-
export type OptionSpec = StringOptionSpec | NumberOptionSpec | BooleanOptionSpec | EnumOptionSpec;
|
|
24
|
-
export type WidgetOptionSpecs = Record<string, OptionSpec>;
|
|
25
|
-
export declare const WIDGET_OPTIONS: {
|
|
26
|
-
readonly 'timeseries-chart': {
|
|
27
|
-
readonly title: {
|
|
28
|
-
readonly kind: 'string';
|
|
29
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
30
|
-
};
|
|
31
|
-
readonly window: {
|
|
32
|
-
readonly kind: 'number';
|
|
33
|
-
readonly integer: true;
|
|
34
|
-
readonly min: 1;
|
|
35
|
-
readonly doc: 'Samples retained across ALL of the widget\'s measurements before the oldest are dropped. Bounds memory; only the chart draws them. Default 300.';
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
readonly 'latest-card': {
|
|
39
|
-
readonly title: {
|
|
40
|
-
readonly kind: 'string';
|
|
41
|
-
readonly doc: 'Heading shown in the widget frame. Defaults to the displayed measurement name.';
|
|
42
|
-
};
|
|
43
|
-
readonly measurement: {
|
|
44
|
-
readonly kind: 'string';
|
|
45
|
-
readonly doc: 'Which measurement to display. Defaults to the first the datasource selects.';
|
|
46
|
-
};
|
|
47
|
-
readonly unit: {
|
|
48
|
-
readonly kind: 'string';
|
|
49
|
-
readonly doc: 'Unit suffix shown beside the value.';
|
|
50
|
-
};
|
|
51
|
-
readonly precision: {
|
|
52
|
-
readonly kind: 'number';
|
|
53
|
-
readonly integer: true;
|
|
54
|
-
readonly min: 0;
|
|
55
|
-
readonly max: 100;
|
|
56
|
-
readonly doc: 'Decimal places to round displayed values to. Unset shows the raw value.';
|
|
57
|
-
};
|
|
58
|
-
readonly flashOnChange: {
|
|
59
|
-
readonly kind: 'boolean';
|
|
60
|
-
readonly doc: 'Briefly tint a value green on a rise and red on a fall when it changes.';
|
|
61
|
-
};
|
|
62
|
-
readonly window: {
|
|
63
|
-
readonly kind: 'number';
|
|
64
|
-
readonly integer: true;
|
|
65
|
-
readonly min: 1;
|
|
66
|
-
readonly doc: 'Samples retained across ALL of the widget\'s measurements before the oldest are dropped. Bounds memory; only the chart draws them. Default 300.';
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
readonly gauge: {
|
|
70
|
-
readonly title: {
|
|
71
|
-
readonly kind: 'string';
|
|
72
|
-
readonly doc: 'Heading shown in the widget frame. Defaults to the displayed measurement name.';
|
|
73
|
-
};
|
|
74
|
-
readonly measurement: {
|
|
75
|
-
readonly kind: 'string';
|
|
76
|
-
readonly doc: 'Which measurement to display. Defaults to the first the datasource selects.';
|
|
77
|
-
};
|
|
78
|
-
readonly min: {
|
|
79
|
-
readonly kind: 'number';
|
|
80
|
-
readonly doc: 'Low end of the gauge scale. Default 0.';
|
|
81
|
-
};
|
|
82
|
-
readonly max: {
|
|
83
|
-
readonly kind: 'number';
|
|
84
|
-
readonly doc: 'High end of the gauge scale. Default 100.';
|
|
85
|
-
};
|
|
86
|
-
readonly unit: {
|
|
87
|
-
readonly kind: 'string';
|
|
88
|
-
readonly doc: 'Unit suffix shown beside the value.';
|
|
89
|
-
};
|
|
90
|
-
readonly flashOnChange: {
|
|
91
|
-
readonly kind: 'boolean';
|
|
92
|
-
readonly doc: 'Briefly tint a value green on a rise and red on a fall when it changes.';
|
|
93
|
-
};
|
|
94
|
-
readonly window: {
|
|
95
|
-
readonly kind: 'number';
|
|
96
|
-
readonly integer: true;
|
|
97
|
-
readonly min: 1;
|
|
98
|
-
readonly doc: 'Samples retained across ALL of the widget\'s measurements before the oldest are dropped. Bounds memory; only the chart draws them. Default 300.';
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
readonly table: {
|
|
102
|
-
readonly title: {
|
|
103
|
-
readonly kind: 'string';
|
|
104
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
105
|
-
};
|
|
106
|
-
readonly precision: {
|
|
107
|
-
readonly kind: 'number';
|
|
108
|
-
readonly integer: true;
|
|
109
|
-
readonly min: 0;
|
|
110
|
-
readonly max: 100;
|
|
111
|
-
readonly doc: 'Decimal places to round displayed values to. Unset shows the raw value.';
|
|
112
|
-
};
|
|
113
|
-
readonly flashOnChange: {
|
|
114
|
-
readonly kind: 'boolean';
|
|
115
|
-
readonly doc: 'Briefly tint a value green on a rise and red on a fall when it changes.';
|
|
116
|
-
};
|
|
117
|
-
readonly window: {
|
|
118
|
-
readonly kind: 'number';
|
|
119
|
-
readonly integer: true;
|
|
120
|
-
readonly min: 1;
|
|
121
|
-
readonly doc: 'Samples retained across ALL of the widget\'s measurements before the oldest are dropped. Bounds memory; only the chart draws them. Default 300.';
|
|
122
|
-
};
|
|
123
|
-
};
|
|
124
|
-
readonly label: {
|
|
125
|
-
readonly title: {
|
|
126
|
-
readonly kind: 'string';
|
|
127
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
128
|
-
};
|
|
129
|
-
readonly text: {
|
|
130
|
-
readonly kind: 'string';
|
|
131
|
-
readonly required: true;
|
|
132
|
-
readonly doc: 'The text to show. Rendered as plain text — markup is never interpreted.';
|
|
133
|
-
};
|
|
134
|
-
readonly align: {
|
|
135
|
-
readonly kind: 'enum';
|
|
136
|
-
readonly values: readonly ["left", "center", "right"];
|
|
137
|
-
readonly doc: 'Horizontal alignment of the text. Default center.';
|
|
138
|
-
};
|
|
139
|
-
readonly fontSize: {
|
|
140
|
-
readonly kind: 'number';
|
|
141
|
-
readonly min: 1;
|
|
142
|
-
readonly doc: 'Text size in pixels. Default 16.';
|
|
143
|
-
};
|
|
144
|
-
};
|
|
145
|
-
readonly image: {
|
|
146
|
-
readonly title: {
|
|
147
|
-
readonly kind: 'string';
|
|
148
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
149
|
-
};
|
|
150
|
-
readonly url: {
|
|
151
|
-
readonly kind: 'string';
|
|
152
|
-
readonly required: true;
|
|
153
|
-
readonly doc: 'Source URL of the image.';
|
|
154
|
-
};
|
|
155
|
-
readonly alt: {
|
|
156
|
-
readonly kind: 'string';
|
|
157
|
-
readonly doc: 'Alternative text describing the image for assistive technology.';
|
|
158
|
-
};
|
|
159
|
-
readonly fit: {
|
|
160
|
-
readonly kind: 'enum';
|
|
161
|
-
readonly values: readonly ["contain", "cover", "fill"];
|
|
162
|
-
readonly doc: 'How the image fills its box. Default contain.';
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
readonly 'alarm-table': {
|
|
166
|
-
readonly title: {
|
|
167
|
-
readonly kind: 'string';
|
|
168
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
169
|
-
};
|
|
170
|
-
readonly state: {
|
|
171
|
-
readonly kind: 'enum';
|
|
172
|
-
readonly values: readonly ["ACTIVE", "CLEARED"];
|
|
173
|
-
readonly doc: 'Show only alarms in this state. Unset shows every state.';
|
|
174
|
-
};
|
|
175
|
-
readonly severity: {
|
|
176
|
-
readonly kind: 'enum';
|
|
177
|
-
readonly values: readonly ["CRITICAL", "MAJOR", "MINOR", "WARNING", "INDETERMINATE"];
|
|
178
|
-
readonly doc: 'Show only alarms at this severity. Unset shows every severity.';
|
|
179
|
-
};
|
|
180
|
-
readonly acknowledged: {
|
|
181
|
-
readonly kind: 'enum';
|
|
182
|
-
readonly values: readonly ["true", "false"];
|
|
183
|
-
readonly doc: "Show only acknowledged ('true') or unacknowledged ('false') alarms. Unset shows both.";
|
|
184
|
-
};
|
|
185
|
-
readonly maxRows: {
|
|
186
|
-
readonly kind: 'number';
|
|
187
|
-
readonly integer: true;
|
|
188
|
-
readonly min: 1;
|
|
189
|
-
readonly doc: 'Alarms loaded into the table. Default 50.';
|
|
190
|
-
};
|
|
191
|
-
readonly precision: {
|
|
192
|
-
readonly kind: 'number';
|
|
193
|
-
readonly integer: true;
|
|
194
|
-
readonly min: 0;
|
|
195
|
-
readonly max: 100;
|
|
196
|
-
readonly doc: 'Decimal places to round displayed values to. Unset shows the raw value.';
|
|
197
|
-
};
|
|
198
|
-
readonly flashOnChange: {
|
|
199
|
-
readonly kind: 'boolean';
|
|
200
|
-
readonly doc: 'Briefly tint a value green on a rise and red on a fall when it changes.';
|
|
201
|
-
};
|
|
202
|
-
readonly selectionTarget: {
|
|
203
|
-
readonly kind: 'string';
|
|
204
|
-
readonly doc: 'Name of the slot this widget re-points when the viewer picks an entity.';
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
readonly 'alarm-count': {
|
|
208
|
-
readonly title: {
|
|
209
|
-
readonly kind: 'string';
|
|
210
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
211
|
-
};
|
|
212
|
-
readonly state: {
|
|
213
|
-
readonly kind: 'enum';
|
|
214
|
-
readonly values: readonly ["ACTIVE", "CLEARED"];
|
|
215
|
-
readonly doc: 'Show only alarms in this state. Unset shows every state.';
|
|
216
|
-
};
|
|
217
|
-
readonly severity: {
|
|
218
|
-
readonly kind: 'enum';
|
|
219
|
-
readonly values: readonly ["CRITICAL", "MAJOR", "MINOR", "WARNING", "INDETERMINATE"];
|
|
220
|
-
readonly doc: 'Show only alarms at this severity. Unset shows every severity.';
|
|
221
|
-
};
|
|
222
|
-
readonly acknowledged: {
|
|
223
|
-
readonly kind: 'enum';
|
|
224
|
-
readonly values: readonly ["true", "false"];
|
|
225
|
-
readonly doc: "Show only acknowledged ('true') or unacknowledged ('false') alarms. Unset shows both.";
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
readonly 'command-button': {
|
|
229
|
-
readonly title: {
|
|
230
|
-
readonly kind: 'string';
|
|
231
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
232
|
-
};
|
|
233
|
-
readonly commandName: {
|
|
234
|
-
readonly kind: 'string';
|
|
235
|
-
readonly required: true;
|
|
236
|
-
readonly doc: 'Command key issued to the target device. Without it the widget cannot send.';
|
|
237
|
-
};
|
|
238
|
-
readonly commandLabel: {
|
|
239
|
-
readonly kind: 'string';
|
|
240
|
-
readonly doc: 'Text on the send button. Defaults to the command key.';
|
|
241
|
-
};
|
|
242
|
-
readonly parameterSchema: {
|
|
243
|
-
readonly kind: 'string';
|
|
244
|
-
readonly format: 'json';
|
|
245
|
-
readonly doc: "The command's parameter descriptors, baked in as JSON at author time. Drives the typed form.";
|
|
246
|
-
};
|
|
247
|
-
readonly maxRows: {
|
|
248
|
-
readonly kind: 'number';
|
|
249
|
-
readonly integer: true;
|
|
250
|
-
readonly min: 1;
|
|
251
|
-
readonly doc: 'Recent commands shown in the history. Default 20.';
|
|
252
|
-
};
|
|
253
|
-
};
|
|
254
|
-
readonly 'entity-selector': {
|
|
255
|
-
readonly title: {
|
|
256
|
-
readonly kind: 'string';
|
|
257
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
258
|
-
};
|
|
259
|
-
readonly selectionTarget: {
|
|
260
|
-
readonly kind: 'string';
|
|
261
|
-
readonly doc: 'Name of the slot this widget re-points when the viewer picks an entity.';
|
|
262
|
-
readonly required: true;
|
|
263
|
-
};
|
|
264
|
-
};
|
|
265
|
-
readonly map: {
|
|
266
|
-
readonly title: {
|
|
267
|
-
readonly kind: 'string';
|
|
268
|
-
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
269
|
-
};
|
|
270
|
-
readonly tileUrl: {
|
|
271
|
-
readonly kind: 'string';
|
|
272
|
-
readonly doc: "Raster tile URL template, e.g. https://tiles.example.com/{z}/{x}/{y}.png. Leave empty to inherit the tenant's basemap; setting one overrides it for this board only.";
|
|
273
|
-
};
|
|
274
|
-
readonly attribution: {
|
|
275
|
-
readonly kind: 'string';
|
|
276
|
-
readonly doc: 'Credit line the tile source requires, shown on the map. Set whatever the provider you chose asks for.';
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
};
|
|
280
|
-
type SpecValue<S> = S extends {
|
|
281
|
-
kind: 'enum';
|
|
282
|
-
values: readonly (infer V)[];
|
|
283
|
-
} ? V extends string ? V : never : S extends {
|
|
284
|
-
kind: 'number';
|
|
285
|
-
} ? number : S extends {
|
|
286
|
-
kind: 'boolean';
|
|
287
|
-
} ? boolean : S extends {
|
|
288
|
-
kind: 'string';
|
|
289
|
-
} ? string : never;
|
|
290
|
-
type RequiredOptionKeys<S> = {
|
|
291
|
-
[K in keyof S]: S[K] extends {
|
|
292
|
-
required: true;
|
|
293
|
-
} ? K : never;
|
|
294
|
-
}[keyof S];
|
|
295
|
-
type OptionsFor<T extends WidgetType> = {
|
|
296
|
-
[K in RequiredOptionKeys<(typeof WIDGET_OPTIONS)[T]>]: SpecValue<(typeof WIDGET_OPTIONS)[T][K]>;
|
|
297
|
-
} & {
|
|
298
|
-
[K in Exclude<keyof (typeof WIDGET_OPTIONS)[T], RequiredOptionKeys<(typeof WIDGET_OPTIONS)[T]>>]?: SpecValue<(typeof WIDGET_OPTIONS)[T][K]>;
|
|
1
|
+
import { clampNumberOption, type NumberOptionSpec, type OptionIssueCode, type BuiltinWidgetId, type OptionsOf, type WidgetType } from '@devicechain/dashboards';
|
|
2
|
+
import { builtinWidgetDescriptors } from './builtin-descriptors';
|
|
3
|
+
export type { BooleanOptionSpec, EnumOptionSpec, NumberOptionSpec, OptionIssueCode, OptionSpec, StringOptionSpec, WidgetOptionSpecs, } from '@devicechain/dashboards';
|
|
4
|
+
export { clampNumberOption };
|
|
5
|
+
type OptionsById = {
|
|
6
|
+
readonly [K in BuiltinWidgetId]: (typeof builtinWidgetDescriptors)[K]['options'];
|
|
299
7
|
};
|
|
300
|
-
export
|
|
301
|
-
export type
|
|
8
|
+
export declare const WIDGET_OPTIONS: OptionsById;
|
|
9
|
+
export type WidgetOptions<T extends WidgetType> = T extends WidgetType ? OptionsOf<(typeof WIDGET_OPTIONS)[T]> : never;
|
|
302
10
|
export interface OptionIssue {
|
|
303
11
|
widgetType: WidgetType;
|
|
304
12
|
key: string;
|
|
@@ -307,6 +15,4 @@ export interface OptionIssue {
|
|
|
307
15
|
}
|
|
308
16
|
export declare function validateWidgetOptions(widgetType: WidgetType, options: Record<string, unknown> | undefined): OptionIssue[];
|
|
309
17
|
export declare function numberOptionSpec(type: WidgetType, key: string): NumberOptionSpec | undefined;
|
|
310
|
-
export declare function clampNumberOption(spec: NumberOptionSpec | undefined, value: number): number | undefined;
|
|
311
18
|
export declare function enumOptionValues(type: WidgetType, key: string): readonly string[] | undefined;
|
|
312
|
-
export {};
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,44 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type { BuiltinWidgetId, WidgetChannel } from '@devicechain/dashboards';
|
|
2
|
+
import { builtinWidgetDescriptors } from './builtin-descriptors';
|
|
3
|
+
export type { WidgetChannel };
|
|
4
|
+
type Descriptors = typeof builtinWidgetDescriptors;
|
|
5
5
|
export declare const WIDGET_CHANNEL: {
|
|
6
|
-
readonly
|
|
7
|
-
readonly 'latest-card': 'measurement';
|
|
8
|
-
readonly gauge: 'measurement';
|
|
9
|
-
readonly table: 'measurement';
|
|
10
|
-
readonly label: 'measurement';
|
|
11
|
-
readonly image: 'measurement';
|
|
12
|
-
readonly 'alarm-table': 'alarm';
|
|
13
|
-
readonly 'alarm-count': 'alarm';
|
|
14
|
-
readonly 'command-button': 'control';
|
|
15
|
-
readonly 'entity-selector': 'selection';
|
|
16
|
-
readonly map: 'location';
|
|
6
|
+
readonly [K in BuiltinWidgetId]: Descriptors[K]['channel'];
|
|
17
7
|
};
|
|
18
|
-
type WidgetTypeOn<C extends WidgetChannel> = {
|
|
19
|
-
[K in WidgetType]: (typeof WIDGET_CHANNEL)[K] extends C ? K : never;
|
|
20
|
-
}[WidgetType];
|
|
21
|
-
type MeasurementWidgetType = WidgetTypeOn<'measurement'>;
|
|
22
|
-
type AlarmWidgetType = WidgetTypeOn<'alarm'>;
|
|
23
|
-
type ControlWidgetType = WidgetTypeOn<'control'>;
|
|
24
|
-
type SelectionWidgetType = WidgetTypeOn<'selection'>;
|
|
25
|
-
type LocationWidgetType = WidgetTypeOn<'location'>;
|
|
26
|
-
export declare const WIDGET_REGISTRY: Record<MeasurementWidgetType, WidgetComponent>;
|
|
27
|
-
export declare const ALARM_WIDGET_REGISTRY: Record<AlarmWidgetType, WidgetComponent<AlarmStreamState>>;
|
|
28
|
-
export declare const CONTROL_WIDGET_REGISTRY: Record<ControlWidgetType, WidgetComponent<CommandStreamState>>;
|
|
29
|
-
export declare const SELECTION_WIDGET_REGISTRY: Record<SelectionWidgetType, WidgetComponent<null>>;
|
|
30
|
-
export declare const LOCATION_WIDGET_REGISTRY: Record<LocationWidgetType, WidgetComponent<LocationStreamState>>;
|
|
31
8
|
export declare const WIDGET_BINDS_DATASOURCE: {
|
|
32
|
-
readonly
|
|
33
|
-
readonly 'latest-card': true;
|
|
34
|
-
readonly gauge: true;
|
|
35
|
-
readonly table: true;
|
|
36
|
-
readonly label: false;
|
|
37
|
-
readonly image: false;
|
|
38
|
-
readonly 'alarm-table': true;
|
|
39
|
-
readonly 'alarm-count': true;
|
|
40
|
-
readonly 'command-button': true;
|
|
41
|
-
readonly 'entity-selector': false;
|
|
42
|
-
readonly map: true;
|
|
9
|
+
readonly [K in BuiltinWidgetId]: boolean;
|
|
43
10
|
};
|
|
44
|
-
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ReportRejection } from './widget-host';
|
|
3
|
+
export declare function useReportRejection(): ReportRejection;
|
|
4
|
+
export interface WidgetContainmentProps {
|
|
5
|
+
title?: string;
|
|
6
|
+
resetKey: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function WidgetContainment({ title, resetKey, children }: WidgetContainmentProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WidgetActions, WidgetDescriptor } from '@devicechain/dashboards';
|
|
2
|
+
import { type WidgetCandidates, type WidgetSelect } from '@devicechain/widget-sdk';
|
|
3
|
+
export type ReportRejection = (message: string) => void;
|
|
4
|
+
export declare function describeError(error: unknown): string;
|
|
5
|
+
export declare function narrowActions(actions: WidgetActions | undefined, descriptor: WidgetDescriptor, report: ReportRejection): WidgetActions | undefined;
|
|
6
|
+
export declare function narrowSelect(select: WidgetSelect | undefined, descriptor: WidgetDescriptor): WidgetSelect | undefined;
|
|
7
|
+
export declare function narrowCandidates(candidates: WidgetCandidates | undefined, descriptor: WidgetDescriptor, report: ReportRejection): WidgetCandidates | undefined;
|
|
@@ -1,3 +1,48 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type WidgetProps } from '../widget';
|
|
1
|
+
import { type AlarmStreamState, type WidgetProps } from '@devicechain/widget-sdk';
|
|
3
2
|
export declare function AlarmCount({ widget, data }: WidgetProps<AlarmStreamState>): import("react").JSX.Element;
|
|
3
|
+
export declare const alarmCountWidget: import("@devicechain/widget-sdk").WidgetDefinition<"alarm", {
|
|
4
|
+
readonly title: {
|
|
5
|
+
readonly kind: 'string';
|
|
6
|
+
readonly labelId: 'widgetLabelTitle';
|
|
7
|
+
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
8
|
+
};
|
|
9
|
+
readonly state: {
|
|
10
|
+
readonly kind: 'enum';
|
|
11
|
+
readonly values: readonly ["ACTIVE", "CLEARED"];
|
|
12
|
+
readonly labelId: 'widgetLabelState';
|
|
13
|
+
readonly helpId: 'widgetStateHint';
|
|
14
|
+
readonly valueLabelIds: {
|
|
15
|
+
readonly ACTIVE: 'widgetAlarmStateActive';
|
|
16
|
+
readonly CLEARED: 'widgetAlarmStateCleared';
|
|
17
|
+
};
|
|
18
|
+
readonly placeholderId: 'widgetPlaceholderAny';
|
|
19
|
+
readonly doc: 'Show only alarms in this state. Unset shows every state.';
|
|
20
|
+
};
|
|
21
|
+
readonly severity: {
|
|
22
|
+
readonly kind: 'enum';
|
|
23
|
+
readonly values: readonly ["CRITICAL", "MAJOR", "MINOR", "WARNING", "INDETERMINATE"];
|
|
24
|
+
readonly labelId: 'widgetLabelSeverity';
|
|
25
|
+
readonly helpId: 'widgetSeverityHint';
|
|
26
|
+
readonly valueLabelIds: {
|
|
27
|
+
readonly CRITICAL: 'widgetAlarmSeverityCritical';
|
|
28
|
+
readonly MAJOR: 'widgetAlarmSeverityMajor';
|
|
29
|
+
readonly MINOR: 'widgetAlarmSeverityMinor';
|
|
30
|
+
readonly WARNING: 'widgetAlarmSeverityWarning';
|
|
31
|
+
readonly INDETERMINATE: 'widgetAlarmSeverityIndeterminate';
|
|
32
|
+
};
|
|
33
|
+
readonly placeholderId: 'widgetPlaceholderAny';
|
|
34
|
+
readonly doc: 'Show only alarms at this severity. Unset shows every severity.';
|
|
35
|
+
};
|
|
36
|
+
readonly acknowledged: {
|
|
37
|
+
readonly kind: 'enum';
|
|
38
|
+
readonly values: readonly ["true", "false"];
|
|
39
|
+
readonly labelId: 'widgetLabelAcknowledged';
|
|
40
|
+
readonly helpId: 'widgetAcknowledgedHint';
|
|
41
|
+
readonly valueLabelIds: {
|
|
42
|
+
readonly true: 'widgetAlarmAckAcknowledged';
|
|
43
|
+
readonly false: 'widgetAlarmAckUnacknowledged';
|
|
44
|
+
};
|
|
45
|
+
readonly placeholderId: 'widgetPlaceholderAny';
|
|
46
|
+
readonly doc: "Show only acknowledged ('true') or unacknowledged ('false') alarms. Unset shows both.";
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
@@ -1,3 +1,78 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type WidgetProps } from '../widget';
|
|
1
|
+
import { type AlarmStreamState, type WidgetProps } from '@devicechain/widget-sdk';
|
|
3
2
|
export declare function AlarmTable({ widget, data, actions }: WidgetProps<AlarmStreamState>): import("react").JSX.Element;
|
|
3
|
+
export declare const alarmTableWidget: import("@devicechain/widget-sdk").WidgetDefinition<"alarm", {
|
|
4
|
+
readonly title: {
|
|
5
|
+
readonly kind: 'string';
|
|
6
|
+
readonly labelId: 'widgetLabelTitle';
|
|
7
|
+
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
8
|
+
};
|
|
9
|
+
readonly state: {
|
|
10
|
+
readonly kind: 'enum';
|
|
11
|
+
readonly values: readonly ["ACTIVE", "CLEARED"];
|
|
12
|
+
readonly labelId: 'widgetLabelState';
|
|
13
|
+
readonly helpId: 'widgetStateHint';
|
|
14
|
+
readonly valueLabelIds: {
|
|
15
|
+
readonly ACTIVE: 'widgetAlarmStateActive';
|
|
16
|
+
readonly CLEARED: 'widgetAlarmStateCleared';
|
|
17
|
+
};
|
|
18
|
+
readonly placeholderId: 'widgetPlaceholderAny';
|
|
19
|
+
readonly doc: 'Show only alarms in this state. Unset shows every state.';
|
|
20
|
+
};
|
|
21
|
+
readonly severity: {
|
|
22
|
+
readonly kind: 'enum';
|
|
23
|
+
readonly values: readonly ["CRITICAL", "MAJOR", "MINOR", "WARNING", "INDETERMINATE"];
|
|
24
|
+
readonly labelId: 'widgetLabelSeverity';
|
|
25
|
+
readonly helpId: 'widgetSeverityHint';
|
|
26
|
+
readonly valueLabelIds: {
|
|
27
|
+
readonly CRITICAL: 'widgetAlarmSeverityCritical';
|
|
28
|
+
readonly MAJOR: 'widgetAlarmSeverityMajor';
|
|
29
|
+
readonly MINOR: 'widgetAlarmSeverityMinor';
|
|
30
|
+
readonly WARNING: 'widgetAlarmSeverityWarning';
|
|
31
|
+
readonly INDETERMINATE: 'widgetAlarmSeverityIndeterminate';
|
|
32
|
+
};
|
|
33
|
+
readonly placeholderId: 'widgetPlaceholderAny';
|
|
34
|
+
readonly doc: 'Show only alarms at this severity. Unset shows every severity.';
|
|
35
|
+
};
|
|
36
|
+
readonly acknowledged: {
|
|
37
|
+
readonly kind: 'enum';
|
|
38
|
+
readonly values: readonly ["true", "false"];
|
|
39
|
+
readonly labelId: 'widgetLabelAcknowledged';
|
|
40
|
+
readonly helpId: 'widgetAcknowledgedHint';
|
|
41
|
+
readonly valueLabelIds: {
|
|
42
|
+
readonly true: 'widgetAlarmAckAcknowledged';
|
|
43
|
+
readonly false: 'widgetAlarmAckUnacknowledged';
|
|
44
|
+
};
|
|
45
|
+
readonly placeholderId: 'widgetPlaceholderAny';
|
|
46
|
+
readonly doc: "Show only acknowledged ('true') or unacknowledged ('false') alarms. Unset shows both.";
|
|
47
|
+
};
|
|
48
|
+
readonly maxRows: {
|
|
49
|
+
readonly kind: "number";
|
|
50
|
+
readonly integer: true;
|
|
51
|
+
readonly min: 1;
|
|
52
|
+
readonly labelId: "widgetLabelMaxRows";
|
|
53
|
+
readonly helpId: "widgetMaxRowsAlarmHint";
|
|
54
|
+
readonly doc: "Alarms loaded into the table. Default 50.";
|
|
55
|
+
};
|
|
56
|
+
readonly precision: {
|
|
57
|
+
readonly kind: 'number';
|
|
58
|
+
readonly integer: true;
|
|
59
|
+
readonly min: 0;
|
|
60
|
+
readonly max: 100;
|
|
61
|
+
readonly labelId: 'widgetLabelPrecision';
|
|
62
|
+
readonly helpId: 'widgetHintPrecision';
|
|
63
|
+
readonly doc: 'Decimal places to round displayed values to. Unset shows the raw value.';
|
|
64
|
+
};
|
|
65
|
+
readonly flashOnChange: {
|
|
66
|
+
readonly kind: 'boolean';
|
|
67
|
+
readonly labelId: 'widgetFlashOnChange';
|
|
68
|
+
readonly helpId: 'widgetFlashOnChangeHint';
|
|
69
|
+
readonly doc: 'Briefly tint a value green on a rise and red on a fall when it changes.';
|
|
70
|
+
};
|
|
71
|
+
readonly selectionTarget: {
|
|
72
|
+
readonly kind: 'string';
|
|
73
|
+
readonly labelId: 'widgetLabelTargetSlot';
|
|
74
|
+
readonly helpId: 'widgetTargetSlotHint';
|
|
75
|
+
readonly control: 'slot-target';
|
|
76
|
+
readonly doc: 'Name of the slot this widget re-points when the viewer picks an entity.';
|
|
77
|
+
};
|
|
78
|
+
}>;
|
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type WidgetProps } from '../widget';
|
|
1
|
+
import { type CommandStreamState, type WidgetProps } from '@devicechain/widget-sdk';
|
|
3
2
|
export declare function CommandButton({ widget, data, actions }: WidgetProps<CommandStreamState>): import("react").JSX.Element;
|
|
3
|
+
export declare const commandButtonWidget: import("@devicechain/widget-sdk").WidgetDefinition<"control", {
|
|
4
|
+
readonly title: {
|
|
5
|
+
readonly kind: 'string';
|
|
6
|
+
readonly labelId: 'widgetLabelTitle';
|
|
7
|
+
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
8
|
+
};
|
|
9
|
+
readonly commandName: {
|
|
10
|
+
readonly kind: "string";
|
|
11
|
+
readonly required: true;
|
|
12
|
+
readonly labelId: "widgetCommandHeading";
|
|
13
|
+
readonly helpId: "widgetCommandFieldHint";
|
|
14
|
+
readonly control: "command-vocabulary";
|
|
15
|
+
readonly doc: "Command key issued to the target device. Without it the widget cannot send.";
|
|
16
|
+
};
|
|
17
|
+
readonly commandLabel: {
|
|
18
|
+
readonly kind: "string";
|
|
19
|
+
readonly labelId: "widgetCommandHeading";
|
|
20
|
+
readonly helpId: "widgetCommandFieldHint";
|
|
21
|
+
readonly control: "command-vocabulary";
|
|
22
|
+
readonly doc: "Text on the send button. Defaults to the command key.";
|
|
23
|
+
};
|
|
24
|
+
readonly parameterSchema: {
|
|
25
|
+
readonly kind: "string";
|
|
26
|
+
readonly format: "json";
|
|
27
|
+
readonly labelId: "widgetCommandHeading";
|
|
28
|
+
readonly helpId: "widgetCommandFieldHint";
|
|
29
|
+
readonly control: "command-vocabulary";
|
|
30
|
+
readonly doc: "The command's parameter descriptors, baked in as JSON at author time. Drives the typed form.";
|
|
31
|
+
};
|
|
32
|
+
readonly maxRows: {
|
|
33
|
+
readonly kind: "number";
|
|
34
|
+
readonly integer: true;
|
|
35
|
+
readonly min: 1;
|
|
36
|
+
readonly labelId: "widgetLabelMaxRows";
|
|
37
|
+
readonly helpId: "widgetMaxRowsCommandHint";
|
|
38
|
+
readonly doc: "Recent commands shown in the history. Default 20.";
|
|
39
|
+
};
|
|
40
|
+
}>;
|
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
import { type WidgetProps } from '
|
|
1
|
+
import { type WidgetProps } from '@devicechain/widget-sdk';
|
|
2
2
|
export declare function EntitySelector({ widget }: WidgetProps<null>): import("react").JSX.Element;
|
|
3
|
+
export declare const entitySelectorWidget: import("@devicechain/widget-sdk").WidgetDefinition<"selection", {
|
|
4
|
+
readonly title: {
|
|
5
|
+
readonly kind: 'string';
|
|
6
|
+
readonly labelId: 'widgetLabelTitle';
|
|
7
|
+
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
8
|
+
};
|
|
9
|
+
readonly selectionTarget: {
|
|
10
|
+
readonly kind: 'string';
|
|
11
|
+
readonly labelId: 'widgetLabelTargetSlot';
|
|
12
|
+
readonly helpId: 'widgetTargetSlotHint';
|
|
13
|
+
readonly control: 'slot-target';
|
|
14
|
+
readonly doc: 'Name of the slot this widget re-points when the viewer picks an entity.';
|
|
15
|
+
readonly required: true;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
package/dist/widgets/gauge.d.ts
CHANGED
|
@@ -1,2 +1,44 @@
|
|
|
1
|
-
import { type WidgetProps } from '
|
|
1
|
+
import { type WidgetProps } from '@devicechain/widget-sdk';
|
|
2
2
|
export declare function Gauge({ widget, data }: WidgetProps): import("react").JSX.Element;
|
|
3
|
+
export declare const gaugeWidget: import("@devicechain/widget-sdk").WidgetDefinition<"measurement", {
|
|
4
|
+
readonly title: {
|
|
5
|
+
readonly kind: 'string';
|
|
6
|
+
readonly labelId: 'widgetLabelTitle';
|
|
7
|
+
readonly doc: 'Heading shown in the widget frame. Defaults to the displayed measurement name.';
|
|
8
|
+
};
|
|
9
|
+
readonly measurement: {
|
|
10
|
+
readonly kind: "string";
|
|
11
|
+
readonly labelId: "widgetLabelMeasurement";
|
|
12
|
+
readonly helpId: "widgetHintMeasurement";
|
|
13
|
+
readonly doc: "Which measurement to display. Defaults to the first the datasource selects.";
|
|
14
|
+
};
|
|
15
|
+
readonly min: {
|
|
16
|
+
readonly kind: "number";
|
|
17
|
+
readonly labelId: "widgetLabelMin";
|
|
18
|
+
readonly doc: "Low end of the gauge scale. Default 0.";
|
|
19
|
+
};
|
|
20
|
+
readonly max: {
|
|
21
|
+
readonly kind: "number";
|
|
22
|
+
readonly labelId: "widgetLabelMax";
|
|
23
|
+
readonly doc: "High end of the gauge scale. Default 100.";
|
|
24
|
+
};
|
|
25
|
+
readonly unit: {
|
|
26
|
+
readonly kind: 'string';
|
|
27
|
+
readonly labelId: 'widgetLabelUnit';
|
|
28
|
+
readonly doc: 'Unit suffix shown beside the value.';
|
|
29
|
+
};
|
|
30
|
+
readonly flashOnChange: {
|
|
31
|
+
readonly kind: 'boolean';
|
|
32
|
+
readonly labelId: 'widgetFlashOnChange';
|
|
33
|
+
readonly helpId: 'widgetFlashOnChangeHint';
|
|
34
|
+
readonly doc: 'Briefly tint a value green on a rise and red on a fall when it changes.';
|
|
35
|
+
};
|
|
36
|
+
readonly window: {
|
|
37
|
+
readonly kind: 'number';
|
|
38
|
+
readonly integer: true;
|
|
39
|
+
readonly min: 1;
|
|
40
|
+
readonly labelId: 'widgetLabelWindow';
|
|
41
|
+
readonly helpId: 'widgetHintWindow';
|
|
42
|
+
readonly doc: 'Samples retained across ALL of the widget\'s measurements before the oldest are dropped. Bounds memory; only the chart draws them. Default 300.';
|
|
43
|
+
};
|
|
44
|
+
}>;
|
package/dist/widgets/image.d.ts
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
import { type WidgetProps } from '
|
|
2
|
-
export declare function Image({ widget }: WidgetProps): import("react").JSX.Element;
|
|
1
|
+
import { type WidgetProps } from '@devicechain/widget-sdk';
|
|
2
|
+
export declare function Image({ widget }: WidgetProps<null>): import("react").JSX.Element;
|
|
3
|
+
export declare const imageWidget: import("@devicechain/widget-sdk").WidgetDefinition<"none", {
|
|
4
|
+
readonly title: {
|
|
5
|
+
readonly kind: 'string';
|
|
6
|
+
readonly labelId: 'widgetLabelTitle';
|
|
7
|
+
readonly doc: 'Heading shown in the widget frame. Blank hides the frame heading.';
|
|
8
|
+
};
|
|
9
|
+
readonly url: {
|
|
10
|
+
readonly kind: "string";
|
|
11
|
+
readonly required: true;
|
|
12
|
+
readonly labelId: "widgetLabelImageUrl";
|
|
13
|
+
readonly doc: "Source URL of the image.";
|
|
14
|
+
};
|
|
15
|
+
readonly alt: {
|
|
16
|
+
readonly kind: "string";
|
|
17
|
+
readonly labelId: "widgetLabelAltText";
|
|
18
|
+
readonly doc: "Alternative text describing the image for assistive technology.";
|
|
19
|
+
};
|
|
20
|
+
readonly fit: {
|
|
21
|
+
readonly kind: "enum";
|
|
22
|
+
readonly values: readonly ["contain", "cover", "fill"];
|
|
23
|
+
readonly labelId: "widgetLabelFit";
|
|
24
|
+
readonly valueLabelIds: {
|
|
25
|
+
readonly contain: "widgetFitContain";
|
|
26
|
+
readonly cover: "widgetFitCover";
|
|
27
|
+
readonly fill: "widgetFitFill";
|
|
28
|
+
};
|
|
29
|
+
readonly placeholderId: "widgetPlaceholderDefault";
|
|
30
|
+
readonly doc: "How the image fills its box. Default contain.";
|
|
31
|
+
};
|
|
32
|
+
}>;
|