@procaaso/alphinity-ui-components 1.0.7 → 1.0.9

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
@@ -999,6 +999,8 @@ function DeviceControlPanel({
999
999
  onClose,
1000
1000
  position = "bottom",
1001
1001
  touchOptimized = true,
1002
+ maxHeight,
1003
+ maxWidth,
1002
1004
  onModeChange,
1003
1005
  onParameterChange,
1004
1006
  onStart,
@@ -1020,6 +1022,8 @@ function DeviceControlPanel({
1020
1022
  const currentMode = binding.state.currentMode;
1021
1023
  const currentParams = binding.parameters[currentMode] || [];
1022
1024
  const touchSize = touchOptimized ? 56 : 40;
1025
+ const currentModeObj = binding.modes.find((m) => m.value === currentMode);
1026
+ const activeCapabilities = currentModeObj?.capabilities ?? binding.capabilities ?? {};
1023
1027
  const backgroundColor = binding.theme?.backgroundColor || "#edeeef";
1024
1028
  const surfaceColor = "#f5f6f7";
1025
1029
  const borderColor = "#d2d2d2";
@@ -1058,7 +1062,10 @@ function DeviceControlPanel({
1058
1062
  bottom: 0,
1059
1063
  left: 0,
1060
1064
  right: 0,
1061
- animation: "slideUp 0.3s ease-out"
1065
+ animation: "slideUp 0.3s ease-out",
1066
+ maxWidth,
1067
+ marginLeft: "auto",
1068
+ marginRight: "auto"
1062
1069
  } : {
1063
1070
  right: 0,
1064
1071
  top: 0,
@@ -1073,7 +1080,7 @@ function DeviceControlPanel({
1073
1080
  border: `2px solid ${borderColor}`,
1074
1081
  padding: "20px",
1075
1082
  zIndex: 9999,
1076
- maxHeight: position === "bottom" ? "70vh" : "100vh",
1083
+ maxHeight: maxHeight || (position === "bottom" ? "70vh" : "100vh"),
1077
1084
  overflowY: "auto",
1078
1085
  ...binding.display?.style
1079
1086
  };
@@ -1410,8 +1417,8 @@ function DeviceControlPanel({
1410
1417
  param.id
1411
1418
  ))
1412
1419
  ] }),
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)(
1420
+ binding.display?.showStartStop !== false && (activeCapabilities?.canStart || activeCapabilities?.canStop) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: [
1421
+ activeCapabilities?.canStart && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1415
1422
  "button",
1416
1423
  {
1417
1424
  onClick: onStart,
@@ -1433,7 +1440,7 @@ function DeviceControlPanel({
1433
1440
  children: "START"
1434
1441
  }
1435
1442
  ),
1436
- binding.capabilities?.canStop && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1443
+ activeCapabilities?.canStop && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1437
1444
  "button",
1438
1445
  {
1439
1446
  onClick: onStop,
@@ -1456,7 +1463,7 @@ function DeviceControlPanel({
1456
1463
  }
1457
1464
  )
1458
1465
  ] }),
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)(
1466
+ 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
1467
  "button",
1461
1468
  {
1462
1469
  onClick: () => onCustomAction?.(action.id),