@devicechain/widgets 1.1.0-rc.1 → 1.2.0-rc.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.
- package/README.md +1 -1
- package/dist/builtin-descriptors.d.ts +236 -0
- package/dist/builtin-registry.d.ts +233 -0
- package/dist/chunks/{aggregate-widgets-EVJNAA26.js → aggregate-widgets-IFZUFYXV.js} +229 -2
- package/dist/chunks/{aggregate-widgets-EVJNAA26.js.map → aggregate-widgets-IFZUFYXV.js.map} +4 -4
- package/dist/chunks/{event-markers-feed-DMRW5GV5.js → event-markers-feed-BQO4T367.js} +14 -4
- package/dist/chunks/event-markers-feed-BQO4T367.js.map +7 -0
- package/dist/chunks/{history-widgets-DZBMNMEX.js → history-widgets-7GNKTE5X.js} +209 -2
- package/dist/chunks/{history-widgets-DZBMNMEX.js.map → history-widgets-7GNKTE5X.js.map} +4 -4
- package/dist/chunks/{level-widgets-HE6EDSWC.js → level-widgets-DKCQT2XF.js} +377 -36
- package/dist/chunks/{level-widgets-HE6EDSWC.js.map → level-widgets-DKCQT2XF.js.map} +4 -4
- package/dist/documented-descriptors.d.ts +737 -32
- package/dist/index.js +140 -6
- package/dist/index.js.map +2 -2
- package/dist/scada-model.d.ts +16 -0
- package/dist/scada-strings.d.ts +10 -0
- package/dist/scada-symbols.d.ts +14 -0
- package/dist/state-timeline-model.d.ts +19 -0
- package/dist/state-timeline-strings.d.ts +17 -0
- package/dist/status-grid-model.d.ts +19 -0
- package/dist/status-grid-strings.d.ts +9 -0
- package/dist/widgets/aggregate-lazy.d.ts +74 -0
- package/dist/widgets/aggregate-widgets.d.ts +1 -0
- package/dist/widgets/history-lazy.d.ts +53 -0
- package/dist/widgets/history-widgets.d.ts +1 -0
- package/dist/widgets/level-lazy.d.ts +109 -0
- package/dist/widgets/level-widgets.d.ts +1 -0
- package/dist/widgets/scada-symbol.d.ts +3 -0
- package/dist/widgets/state-timeline.d.ts +8 -0
- package/dist/widgets/status-grid.d.ts +2 -0
- package/package.json +7 -7
- package/dist/chunks/event-markers-feed-DMRW5GV5.js.map +0 -7
package/dist/index.js
CHANGED
|
@@ -1273,12 +1273,112 @@ var builtinWidgetDescriptors = {
|
|
|
1273
1273
|
freshness: true,
|
|
1274
1274
|
interactions: {},
|
|
1275
1275
|
layout: { defaultSpan: { cols: 6, rows: 5 }, minSpan: { cols: 4, rows: 3 } }
|
|
1276
|
+
}),
|
|
1277
|
+
// A process symbol (pump, valve, tank, motor, fan, pipe, sensor, breaker, light) in the state one
|
|
1278
|
+
// measurement puts it in.
|
|
1279
|
+
"scada-symbol": defineRuntimeDescriptor({
|
|
1280
|
+
id: "scada-symbol",
|
|
1281
|
+
version: VERSION,
|
|
1282
|
+
sdkApiVersion: 1,
|
|
1283
|
+
optionsVersion: 1,
|
|
1284
|
+
display: { title: "Scada symbol", category: "Telemetry", titleId: "widgetTypeScadaSymbol", categoryId: "widgetCategoryTelemetry" },
|
|
1285
|
+
channel: "measurement",
|
|
1286
|
+
datasource: { mode: "required", selectors: ONE_DEVICE },
|
|
1287
|
+
binding: { window: { option: "window", min: 1 } },
|
|
1288
|
+
options: {
|
|
1289
|
+
title: TITLE_OR_MEASUREMENT,
|
|
1290
|
+
measurement: MEASUREMENT,
|
|
1291
|
+
symbol: {
|
|
1292
|
+
kind: "enum",
|
|
1293
|
+
values: ["pump", "valve", "tank", "motor", "fan", "pipe", "sensor", "breaker", "light"],
|
|
1294
|
+
labelId: "widgetLabelScadaSymbol",
|
|
1295
|
+
helpId: "widgetHintScadaSymbol",
|
|
1296
|
+
valueLabelIds: {
|
|
1297
|
+
pump: "widgetScadaPump",
|
|
1298
|
+
valve: "widgetScadaValve",
|
|
1299
|
+
tank: "widgetScadaTank",
|
|
1300
|
+
motor: "widgetScadaMotor",
|
|
1301
|
+
fan: "widgetScadaFan",
|
|
1302
|
+
pipe: "widgetScadaPipe",
|
|
1303
|
+
sensor: "widgetScadaSensor",
|
|
1304
|
+
breaker: "widgetScadaBreaker",
|
|
1305
|
+
light: "widgetScadaLight"
|
|
1306
|
+
},
|
|
1307
|
+
placeholderId: "widgetPlaceholderDefault"
|
|
1308
|
+
},
|
|
1309
|
+
onAt: { kind: "number", labelId: "widgetLabelOnAt", helpId: "widgetHintScadaOnAt" },
|
|
1310
|
+
orientation: {
|
|
1311
|
+
kind: "enum",
|
|
1312
|
+
values: ["horizontal", "vertical"],
|
|
1313
|
+
labelId: "widgetLabelOrientation",
|
|
1314
|
+
valueLabelIds: { horizontal: "widgetOrientationHorizontal", vertical: "widgetOrientationVertical" },
|
|
1315
|
+
placeholderId: "widgetPlaceholderDefault"
|
|
1316
|
+
},
|
|
1317
|
+
min: { kind: "number", labelId: "widgetLabelMin" },
|
|
1318
|
+
max: { kind: "number", labelId: "widgetLabelMax" },
|
|
1319
|
+
unit: UNIT,
|
|
1320
|
+
precision: PRECISION,
|
|
1321
|
+
thresholds: THRESHOLDS,
|
|
1322
|
+
staleAfterSeconds: STALE_AFTER_SECONDS,
|
|
1323
|
+
window: WINDOW
|
|
1324
|
+
},
|
|
1325
|
+
constraints: [{ kind: "greater-than", key: "max", than: "min" }],
|
|
1326
|
+
defaults: { title: "Scada symbol" },
|
|
1327
|
+
interactions: {},
|
|
1328
|
+
freshness: true,
|
|
1329
|
+
layout: { defaultSpan: { cols: 3, rows: 3 }, minSpan: { cols: 2, rows: 2 }, maxSpan: { cols: 8, rows: 8 } }
|
|
1330
|
+
}),
|
|
1331
|
+
// A tile per device of a fleet for one measurement, coloured by its threshold band.
|
|
1332
|
+
"status-grid": defineRuntimeDescriptor({
|
|
1333
|
+
id: "status-grid",
|
|
1334
|
+
version: VERSION,
|
|
1335
|
+
sdkApiVersion: 1,
|
|
1336
|
+
optionsVersion: 1,
|
|
1337
|
+
display: { title: "Status grid", category: "Telemetry", titleId: "widgetTypeStatusGrid", categoryId: "widgetCategoryTelemetry" },
|
|
1338
|
+
channel: "measurement",
|
|
1339
|
+
datasource: { mode: "required", selectors: ALL_SELECTORS },
|
|
1340
|
+
binding: { windowSeconds: { option: "windowSeconds" }, members: { const: true } },
|
|
1341
|
+
options: {
|
|
1342
|
+
title: TITLE,
|
|
1343
|
+
measurement: MEASUREMENT,
|
|
1344
|
+
unit: UNIT,
|
|
1345
|
+
precision: PRECISION,
|
|
1346
|
+
thresholds: THRESHOLDS,
|
|
1347
|
+
worstFirst: { kind: "boolean", labelId: "widgetLabelWorstFirst", helpId: "widgetHintWorstFirst" },
|
|
1348
|
+
staleAfterSeconds: STALE_AFTER_SECONDS,
|
|
1349
|
+
windowSeconds: WINDOW_SECONDS
|
|
1350
|
+
},
|
|
1351
|
+
defaults: { title: "Status grid" },
|
|
1352
|
+
freshness: true,
|
|
1353
|
+
interactions: {},
|
|
1354
|
+
layout: { defaultSpan: { cols: 6, rows: 4 }, minSpan: { cols: 3, rows: 3 } }
|
|
1355
|
+
}),
|
|
1356
|
+
// Discrete states over time: one lane per measurement, the threshold bands as the states.
|
|
1357
|
+
"state-timeline": defineRuntimeDescriptor({
|
|
1358
|
+
id: "state-timeline",
|
|
1359
|
+
version: VERSION,
|
|
1360
|
+
sdkApiVersion: 1,
|
|
1361
|
+
optionsVersion: 1,
|
|
1362
|
+
display: { title: "State timeline", category: "Telemetry", titleId: "widgetTypeStateTimeline", categoryId: "widgetCategoryTelemetry" },
|
|
1363
|
+
channel: "measurement",
|
|
1364
|
+
datasource: { mode: "required", selectors: ONE_DEVICE },
|
|
1365
|
+
binding: { windowSeconds: { option: "windowSeconds" }, history: { const: true } },
|
|
1366
|
+
options: {
|
|
1367
|
+
title: TITLE,
|
|
1368
|
+
thresholds: { ...THRESHOLDS, required: true, helpId: "widgetHintStateThresholds" },
|
|
1369
|
+
staleAfterSeconds: STALE_AFTER_SECONDS,
|
|
1370
|
+
windowSeconds: WINDOW_SECONDS
|
|
1371
|
+
},
|
|
1372
|
+
defaults: { title: "State timeline" },
|
|
1373
|
+
freshness: true,
|
|
1374
|
+
interactions: {},
|
|
1375
|
+
layout: { defaultSpan: { cols: 8, rows: 3 }, minSpan: { cols: 4, rows: 2 } }
|
|
1276
1376
|
})
|
|
1277
1377
|
};
|
|
1278
1378
|
var builtinWidgetCatalog = createWidgetCatalog(Object.values(builtinWidgetDescriptors));
|
|
1279
1379
|
|
|
1280
1380
|
// src/widgets/aggregate-lazy.tsx
|
|
1281
|
-
var chunk = lazyChunk(() => import("./chunks/aggregate-widgets-
|
|
1381
|
+
var chunk = lazyChunk(() => import("./chunks/aggregate-widgets-IFZUFYXV.js"));
|
|
1282
1382
|
var loadAggregateWidgets = chunk.load;
|
|
1283
1383
|
var statCardWidget = defineWidget({
|
|
1284
1384
|
descriptor: builtinWidgetDescriptors["stat-card"],
|
|
@@ -1300,6 +1400,10 @@ var fleetTableWidget = defineWidget({
|
|
|
1300
1400
|
descriptor: builtinWidgetDescriptors["fleet-table"],
|
|
1301
1401
|
implementation: { kind: "trusted-react", component: chunk.component("FleetTable") }
|
|
1302
1402
|
});
|
|
1403
|
+
var statusGridWidget = defineWidget({
|
|
1404
|
+
descriptor: builtinWidgetDescriptors["status-grid"],
|
|
1405
|
+
implementation: { kind: "trusted-react", component: chunk.component("StatusGrid") }
|
|
1406
|
+
});
|
|
1303
1407
|
|
|
1304
1408
|
// src/widgets/alarm-lazy.tsx
|
|
1305
1409
|
import { defineWidget as defineWidget2 } from "@devicechain/widget-sdk";
|
|
@@ -1337,12 +1441,16 @@ var commandButtonWidget = defineWidget3({
|
|
|
1337
1441
|
|
|
1338
1442
|
// src/widgets/history-lazy.tsx
|
|
1339
1443
|
import { defineWidget as defineWidget4 } from "@devicechain/widget-sdk";
|
|
1340
|
-
var chunk4 = lazyChunk(() => import("./chunks/history-widgets-
|
|
1444
|
+
var chunk4 = lazyChunk(() => import("./chunks/history-widgets-7GNKTE5X.js"));
|
|
1341
1445
|
var loadHistoryWidgets = chunk4.load;
|
|
1342
1446
|
var historyTableWidget = defineWidget4({
|
|
1343
1447
|
descriptor: builtinWidgetDescriptors["history-table"],
|
|
1344
1448
|
implementation: { kind: "trusted-react", component: chunk4.component("HistoryTable") }
|
|
1345
1449
|
});
|
|
1450
|
+
var stateTimelineWidget = defineWidget4({
|
|
1451
|
+
descriptor: builtinWidgetDescriptors["state-timeline"],
|
|
1452
|
+
implementation: { kind: "trusted-react", component: chunk4.component("StateTimeline") }
|
|
1453
|
+
});
|
|
1346
1454
|
|
|
1347
1455
|
// src/widgets/presence-lazy.tsx
|
|
1348
1456
|
import { defineWidget as defineWidget5 } from "@devicechain/widget-sdk";
|
|
@@ -1679,7 +1787,7 @@ var latestCardWidget = defineWidget10({
|
|
|
1679
1787
|
// src/widgets/level-lazy.tsx
|
|
1680
1788
|
import { defineWidget as defineWidget11 } from "@devicechain/widget-sdk";
|
|
1681
1789
|
import { loadChartEngine as loadChartEngine2 } from "@devicechain/widget-sdk/echarts";
|
|
1682
|
-
var chunk7 = lazyChunk(() => import("./chunks/level-widgets-
|
|
1790
|
+
var chunk7 = lazyChunk(() => import("./chunks/level-widgets-DKCQT2XF.js"));
|
|
1683
1791
|
var loadLevelWidgets = chunk7.load;
|
|
1684
1792
|
var lazyComponent = chunk7.component;
|
|
1685
1793
|
var linearGaugeWidget = defineWidget11({
|
|
@@ -1710,6 +1818,10 @@ var progressRingWidget = defineWidget11({
|
|
|
1710
1818
|
descriptor: builtinWidgetDescriptors["progress-ring"],
|
|
1711
1819
|
implementation: { kind: "trusted-react", component: lazyComponent("ProgressRing") }
|
|
1712
1820
|
});
|
|
1821
|
+
var scadaSymbolWidget = defineWidget11({
|
|
1822
|
+
descriptor: builtinWidgetDescriptors["scada-symbol"],
|
|
1823
|
+
implementation: { kind: "trusted-react", component: lazyComponent("ScadaSymbol") }
|
|
1824
|
+
});
|
|
1713
1825
|
|
|
1714
1826
|
// src/widgets/map.tsx
|
|
1715
1827
|
import { useEffect as useEffect2, useRef, useState as useState2 } from "react";
|
|
@@ -2293,7 +2405,10 @@ var builtinWidgetDefinitions = [
|
|
|
2293
2405
|
fleetCountWidget,
|
|
2294
2406
|
deviceStatusWidget,
|
|
2295
2407
|
onlineDoughnutWidget,
|
|
2296
|
-
historyTableWidget
|
|
2408
|
+
historyTableWidget,
|
|
2409
|
+
scadaSymbolWidget,
|
|
2410
|
+
statusGridWidget,
|
|
2411
|
+
stateTimelineWidget
|
|
2297
2412
|
];
|
|
2298
2413
|
function createBuiltinWidgetRegistry() {
|
|
2299
2414
|
return createWidgetRegistry(builtinWidgetDefinitions);
|
|
@@ -2634,7 +2749,7 @@ function StaticConnectedWidget({ widget, Component: Component2, actions }) {
|
|
|
2634
2749
|
}
|
|
2635
2750
|
var FleetFeed = lazyChunk(() => import("./chunks/fleet-feed-AKJ7QIMP.js")).component("default", void 0, ChunkLoadingFrame);
|
|
2636
2751
|
var PresenceFeed = lazyChunk(() => import("./chunks/presence-widgets-7OGANOLB.js")).component("PresenceFeed");
|
|
2637
|
-
var HistoryFeed = lazyChunk(() => import("./chunks/history-widgets-
|
|
2752
|
+
var HistoryFeed = lazyChunk(() => import("./chunks/history-widgets-7GNKTE5X.js")).component("HistoryFeed");
|
|
2638
2753
|
function MeasurementConnectedWidget(props) {
|
|
2639
2754
|
if (presenceMode(props.descriptor)) {
|
|
2640
2755
|
return /* @__PURE__ */ jsx8(PresenceFeed, { hub: props.hub, widget: props.widget, descriptor: props.descriptor, Component: props.Component, actions: props.actions, ErrorFrame: WidgetErrorFrame });
|
|
@@ -2673,7 +2788,7 @@ function StreamConnectedWidget({ widget, hub, descriptor, Component: Component2,
|
|
|
2673
2788
|
if (data.error) return /* @__PURE__ */ jsx8(WidgetErrorFrame, { widget, error: data.error });
|
|
2674
2789
|
return /* @__PURE__ */ jsx8(WidgetFreshnessProvider, { freshness, children: wantsEventMarkers(descriptor, widget) ? /* @__PURE__ */ jsx8(EventMarkersFeed, { hub, widget, descriptor, data, Component: Component2, actions }) : /* @__PURE__ */ jsx8(Component2, { widget, data, actions }) });
|
|
2675
2790
|
}
|
|
2676
|
-
var EventMarkersFeed = lazyChunk(() => import("./chunks/event-markers-feed-
|
|
2791
|
+
var EventMarkersFeed = lazyChunk(() => import("./chunks/event-markers-feed-BQO4T367.js")).component("default");
|
|
2677
2792
|
var AggregateFeed = lazyChunk(() => import("./chunks/aggregate-feed-HCF5FYIJ.js")).component("default");
|
|
2678
2793
|
function AggregateConnectedWidget(channel) {
|
|
2679
2794
|
const props = { ...channel, ErrorFrame: WidgetErrorFrame };
|
|
@@ -3674,6 +3789,25 @@ var OPTION_DOC_OVERRIDES = {
|
|
|
3674
3789
|
pageSize: "Rows per page. Default 10. The CSV export holds every row, not just the page.",
|
|
3675
3790
|
staleAfterSeconds: "Marks the table stale once its history has not been read for longer than this many seconds (it is re-read at the end of each time bucket, so only reads that keep failing make it stale). Unset, the age is shown and nothing is marked stale."
|
|
3676
3791
|
},
|
|
3792
|
+
"scada-symbol": {
|
|
3793
|
+
symbol: "Which process symbol to draw. Default pump.",
|
|
3794
|
+
onAt: "The value at or above which the symbol is on (pump or motor running, valve open, breaker closed, light lit). Default 1. For a pipe, the smallest flow that counts; a negative flow shows the reverse direction. Not used by a tank or a sensor.",
|
|
3795
|
+
title: "Heading shown in the widget frame. Defaults to the displayed measurement name.",
|
|
3796
|
+
measurement: "The signal that drives the symbol. A 0/1 signal needs nothing else; a speed or current is read against On at.",
|
|
3797
|
+
min: "Value of an empty tank. Used by the tank symbol only; set it with Max.",
|
|
3798
|
+
max: "Value of a full tank. Used by the tank symbol only; set it with Min.",
|
|
3799
|
+
thresholds: "Severity bands over the value. A value in a major or critical band shows the symbol as faulted, in that band\u2019s colour; a tank takes its liquid colour from the band it is in."
|
|
3800
|
+
},
|
|
3801
|
+
"status-grid": {
|
|
3802
|
+
worstFirst: "Put the devices in the most severe band first (top-left). Off keeps the fleet\u2019s own order.",
|
|
3803
|
+
measurement: "The measurement each tile shows. Defaults to the first the datasource selects.",
|
|
3804
|
+
thresholds: "Severity bands over the measurement. A tile takes the colour of the band its device\u2019s latest reading is in; a reading outside every band, or in a normal band, keeps the neutral colour. A device with no reading is drawn hollow, never as OK.",
|
|
3805
|
+
staleAfterSeconds: "Marks the grid stale once its newest reading in the fleet is older than this many seconds. Unset, the age is shown and nothing is marked stale."
|
|
3806
|
+
},
|
|
3807
|
+
"state-timeline": {
|
|
3808
|
+
thresholds: "The states of the measurement, lowest first: each entry starts a state at its value that lasts until the next entry. Give each a label and a level that colours it. Below the first entry the lane reads Normal. Each stretch is the state of the average of a time bucket, not an exact moment of change.",
|
|
3809
|
+
staleAfterSeconds: "Marks the timeline stale once its history has not been read for longer than this many seconds (it is re-read at the end of each time bucket). Unset, the age is shown and nothing is marked stale."
|
|
3810
|
+
},
|
|
3677
3811
|
"fleet-count": {
|
|
3678
3812
|
measurement: "The measurement whose bands flag a device. Defaults to the first the datasource selects."
|
|
3679
3813
|
},
|