@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 CHANGED
@@ -1020,6 +1020,8 @@ function DeviceControlPanel({
1020
1020
  const currentMode = binding.state.currentMode;
1021
1021
  const currentParams = binding.parameters[currentMode] || [];
1022
1022
  const touchSize = touchOptimized ? 56 : 40;
1023
+ const currentModeObj = binding.modes.find((m) => m.value === currentMode);
1024
+ const activeCapabilities = currentModeObj?.capabilities ?? binding.capabilities ?? {};
1023
1025
  const backgroundColor = binding.theme?.backgroundColor || "#edeeef";
1024
1026
  const surfaceColor = "#f5f6f7";
1025
1027
  const borderColor = "#d2d2d2";
@@ -1410,8 +1412,8 @@ function DeviceControlPanel({
1410
1412
  param.id
1411
1413
  ))
1412
1414
  ] }),
1413
- binding.display?.showStartStop !== false && (binding.capabilities?.canStart || binding.capabilities?.canStop) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: [
1414
- binding.capabilities?.canStart && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1415
+ binding.display?.showStartStop !== false && (activeCapabilities?.canStart || activeCapabilities?.canStop) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: [
1416
+ activeCapabilities?.canStart && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1415
1417
  "button",
1416
1418
  {
1417
1419
  onClick: onStart,
@@ -1433,7 +1435,7 @@ function DeviceControlPanel({
1433
1435
  children: "START"
1434
1436
  }
1435
1437
  ),
1436
- binding.capabilities?.canStop && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1438
+ activeCapabilities?.canStop && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1437
1439
  "button",
1438
1440
  {
1439
1441
  onClick: onStop,
@@ -1456,7 +1458,7 @@ function DeviceControlPanel({
1456
1458
  }
1457
1459
  )
1458
1460
  ] }),
1459
- binding.capabilities?.customActions && binding.capabilities.customActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: binding.capabilities.customActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1461
+ activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: activeCapabilities.customActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1460
1462
  "button",
1461
1463
  {
1462
1464
  onClick: () => onCustomAction?.(action.id),