@procaaso/alphinity-ui-components 1.0.7 → 1.0.8
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/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -258,6 +258,8 @@ interface ControlMode {
|
|
|
258
258
|
enabled?: boolean;
|
|
259
259
|
/** Icon or emoji to display (optional) */
|
|
260
260
|
icon?: string;
|
|
261
|
+
/** Mode-specific capabilities (overrides binding-level capabilities when mode is active) */
|
|
262
|
+
capabilities?: ControlCapabilities;
|
|
261
263
|
}
|
|
262
264
|
/**
|
|
263
265
|
* Control parameter definition (setpoint, adjustment, etc.)
|
package/dist/index.d.ts
CHANGED
|
@@ -258,6 +258,8 @@ interface ControlMode {
|
|
|
258
258
|
enabled?: boolean;
|
|
259
259
|
/** Icon or emoji to display (optional) */
|
|
260
260
|
icon?: string;
|
|
261
|
+
/** Mode-specific capabilities (overrides binding-level capabilities when mode is active) */
|
|
262
|
+
capabilities?: ControlCapabilities;
|
|
261
263
|
}
|
|
262
264
|
/**
|
|
263
265
|
* Control parameter definition (setpoint, adjustment, etc.)
|
package/dist/index.js
CHANGED
|
@@ -922,6 +922,8 @@ function DeviceControlPanel({
|
|
|
922
922
|
const currentMode = binding.state.currentMode;
|
|
923
923
|
const currentParams = binding.parameters[currentMode] || [];
|
|
924
924
|
const touchSize = touchOptimized ? 56 : 40;
|
|
925
|
+
const currentModeObj = binding.modes.find((m) => m.value === currentMode);
|
|
926
|
+
const activeCapabilities = currentModeObj?.capabilities ?? binding.capabilities ?? {};
|
|
925
927
|
const backgroundColor = binding.theme?.backgroundColor || "#edeeef";
|
|
926
928
|
const surfaceColor = "#f5f6f7";
|
|
927
929
|
const borderColor = "#d2d2d2";
|
|
@@ -1312,8 +1314,8 @@ function DeviceControlPanel({
|
|
|
1312
1314
|
param.id
|
|
1313
1315
|
))
|
|
1314
1316
|
] }),
|
|
1315
|
-
binding.display?.showStartStop !== false && (
|
|
1316
|
-
|
|
1317
|
+
binding.display?.showStartStop !== false && (activeCapabilities?.canStart || activeCapabilities?.canStop) && /* @__PURE__ */ jsxs7("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: [
|
|
1318
|
+
activeCapabilities?.canStart && /* @__PURE__ */ jsx8(
|
|
1317
1319
|
"button",
|
|
1318
1320
|
{
|
|
1319
1321
|
onClick: onStart,
|
|
@@ -1335,7 +1337,7 @@ function DeviceControlPanel({
|
|
|
1335
1337
|
children: "START"
|
|
1336
1338
|
}
|
|
1337
1339
|
),
|
|
1338
|
-
|
|
1340
|
+
activeCapabilities?.canStop && /* @__PURE__ */ jsx8(
|
|
1339
1341
|
"button",
|
|
1340
1342
|
{
|
|
1341
1343
|
onClick: onStop,
|
|
@@ -1358,7 +1360,7 @@ function DeviceControlPanel({
|
|
|
1358
1360
|
}
|
|
1359
1361
|
)
|
|
1360
1362
|
] }),
|
|
1361
|
-
|
|
1363
|
+
activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ jsx8("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: activeCapabilities.customActions.map((action) => /* @__PURE__ */ jsxs7(
|
|
1362
1364
|
"button",
|
|
1363
1365
|
{
|
|
1364
1366
|
onClick: () => onCustomAction?.(action.id),
|