@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.d.cts CHANGED
@@ -246,6 +246,26 @@ interface NodeControlsPanelProps extends react__default.HTMLAttributes<HTMLDivEl
246
246
  */
247
247
  declare const NodeControlsPanel: react__default.FC<NodeControlsPanelProps>;
248
248
 
249
+ /**
250
+ * Device control capabilities and commands
251
+ */
252
+ interface ControlCapabilities {
253
+ /** Can the device be started? */
254
+ canStart?: boolean;
255
+ /** Can the device be stopped? */
256
+ canStop?: boolean;
257
+ /** Can the device be paused? */
258
+ canPause?: boolean;
259
+ /** Can the device be reset? */
260
+ canReset?: boolean;
261
+ /** Custom actions available */
262
+ customActions?: Array<{
263
+ id: string;
264
+ label: string;
265
+ icon?: string;
266
+ variant?: 'primary' | 'secondary' | 'alarm' | 'warning';
267
+ }>;
268
+ }
249
269
  /**
250
270
  * Device control mode option
251
271
  */
@@ -258,6 +278,8 @@ interface ControlMode {
258
278
  enabled?: boolean;
259
279
  /** Icon or emoji to display (optional) */
260
280
  icon?: string;
281
+ /** Mode-specific capabilities (overrides binding-level capabilities when mode is active) */
282
+ capabilities?: ControlCapabilities;
261
283
  }
262
284
  /**
263
285
  * Control parameter definition (setpoint, adjustment, etc.)
@@ -290,26 +312,8 @@ interface ControlParameter {
290
312
  }>;
291
313
  /** Custom validation function */
292
314
  validate?: (value: any) => boolean | string;
293
- }
294
- /**
295
- * Device control capabilities and commands
296
- */
297
- interface ControlCapabilities {
298
- /** Can the device be started? */
299
- canStart?: boolean;
300
- /** Can the device be stopped? */
301
- canStop?: boolean;
302
- /** Can the device be paused? */
303
- canPause?: boolean;
304
- /** Can the device be reset? */
305
- canReset?: boolean;
306
- /** Custom actions available */
307
- customActions?: Array<{
308
- id: string;
309
- label: string;
310
- icon?: string;
311
- variant?: 'primary' | 'secondary' | 'alarm' | 'warning';
312
- }>;
315
+ /** Modes where this parameter is visible (if empty/undefined, visible in all modes) */
316
+ modes?: string[];
313
317
  }
314
318
  /**
315
319
  * Device control state
@@ -460,6 +464,10 @@ interface DeviceControlPanelProps {
460
464
  position?: 'bottom' | 'side';
461
465
  /** Optimize for touch (larger targets) */
462
466
  touchOptimized?: boolean;
467
+ /** Maximum height for bottom position (default: 70vh) */
468
+ maxHeight?: string;
469
+ /** Maximum width for bottom position (default: none) */
470
+ maxWidth?: string;
463
471
  /** Called when mode changes */
464
472
  onModeChange?: (mode: string) => void;
465
473
  /** Called when parameter changes */
@@ -471,7 +479,7 @@ interface DeviceControlPanelProps {
471
479
  /** Called when custom action clicked */
472
480
  onCustomAction?: (actionId: string) => void;
473
481
  }
474
- declare function DeviceControlPanel({ binding, onClose, position, touchOptimized, onModeChange, onParameterChange, onStart, onStop, onCustomAction, }: DeviceControlPanelProps): react_jsx_runtime.JSX.Element | null;
482
+ declare function DeviceControlPanel({ binding, onClose, position, touchOptimized, maxHeight, maxWidth, onModeChange, onParameterChange, onStart, onStop, onCustomAction, }: DeviceControlPanelProps): react_jsx_runtime.JSX.Element | null;
475
483
 
476
484
  type DisplayMode = 'standard' | 'dashboard';
477
485
  interface FullscreenContainerProps {
package/dist/index.d.ts CHANGED
@@ -246,6 +246,26 @@ interface NodeControlsPanelProps extends react__default.HTMLAttributes<HTMLDivEl
246
246
  */
247
247
  declare const NodeControlsPanel: react__default.FC<NodeControlsPanelProps>;
248
248
 
249
+ /**
250
+ * Device control capabilities and commands
251
+ */
252
+ interface ControlCapabilities {
253
+ /** Can the device be started? */
254
+ canStart?: boolean;
255
+ /** Can the device be stopped? */
256
+ canStop?: boolean;
257
+ /** Can the device be paused? */
258
+ canPause?: boolean;
259
+ /** Can the device be reset? */
260
+ canReset?: boolean;
261
+ /** Custom actions available */
262
+ customActions?: Array<{
263
+ id: string;
264
+ label: string;
265
+ icon?: string;
266
+ variant?: 'primary' | 'secondary' | 'alarm' | 'warning';
267
+ }>;
268
+ }
249
269
  /**
250
270
  * Device control mode option
251
271
  */
@@ -258,6 +278,8 @@ interface ControlMode {
258
278
  enabled?: boolean;
259
279
  /** Icon or emoji to display (optional) */
260
280
  icon?: string;
281
+ /** Mode-specific capabilities (overrides binding-level capabilities when mode is active) */
282
+ capabilities?: ControlCapabilities;
261
283
  }
262
284
  /**
263
285
  * Control parameter definition (setpoint, adjustment, etc.)
@@ -290,26 +312,8 @@ interface ControlParameter {
290
312
  }>;
291
313
  /** Custom validation function */
292
314
  validate?: (value: any) => boolean | string;
293
- }
294
- /**
295
- * Device control capabilities and commands
296
- */
297
- interface ControlCapabilities {
298
- /** Can the device be started? */
299
- canStart?: boolean;
300
- /** Can the device be stopped? */
301
- canStop?: boolean;
302
- /** Can the device be paused? */
303
- canPause?: boolean;
304
- /** Can the device be reset? */
305
- canReset?: boolean;
306
- /** Custom actions available */
307
- customActions?: Array<{
308
- id: string;
309
- label: string;
310
- icon?: string;
311
- variant?: 'primary' | 'secondary' | 'alarm' | 'warning';
312
- }>;
315
+ /** Modes where this parameter is visible (if empty/undefined, visible in all modes) */
316
+ modes?: string[];
313
317
  }
314
318
  /**
315
319
  * Device control state
@@ -460,6 +464,10 @@ interface DeviceControlPanelProps {
460
464
  position?: 'bottom' | 'side';
461
465
  /** Optimize for touch (larger targets) */
462
466
  touchOptimized?: boolean;
467
+ /** Maximum height for bottom position (default: 70vh) */
468
+ maxHeight?: string;
469
+ /** Maximum width for bottom position (default: none) */
470
+ maxWidth?: string;
463
471
  /** Called when mode changes */
464
472
  onModeChange?: (mode: string) => void;
465
473
  /** Called when parameter changes */
@@ -471,7 +479,7 @@ interface DeviceControlPanelProps {
471
479
  /** Called when custom action clicked */
472
480
  onCustomAction?: (actionId: string) => void;
473
481
  }
474
- declare function DeviceControlPanel({ binding, onClose, position, touchOptimized, onModeChange, onParameterChange, onStart, onStop, onCustomAction, }: DeviceControlPanelProps): react_jsx_runtime.JSX.Element | null;
482
+ declare function DeviceControlPanel({ binding, onClose, position, touchOptimized, maxHeight, maxWidth, onModeChange, onParameterChange, onStart, onStop, onCustomAction, }: DeviceControlPanelProps): react_jsx_runtime.JSX.Element | null;
475
483
 
476
484
  type DisplayMode = 'standard' | 'dashboard';
477
485
  interface FullscreenContainerProps {
package/dist/index.js CHANGED
@@ -901,6 +901,8 @@ function DeviceControlPanel({
901
901
  onClose,
902
902
  position = "bottom",
903
903
  touchOptimized = true,
904
+ maxHeight,
905
+ maxWidth,
904
906
  onModeChange,
905
907
  onParameterChange,
906
908
  onStart,
@@ -922,6 +924,8 @@ function DeviceControlPanel({
922
924
  const currentMode = binding.state.currentMode;
923
925
  const currentParams = binding.parameters[currentMode] || [];
924
926
  const touchSize = touchOptimized ? 56 : 40;
927
+ const currentModeObj = binding.modes.find((m) => m.value === currentMode);
928
+ const activeCapabilities = currentModeObj?.capabilities ?? binding.capabilities ?? {};
925
929
  const backgroundColor = binding.theme?.backgroundColor || "#edeeef";
926
930
  const surfaceColor = "#f5f6f7";
927
931
  const borderColor = "#d2d2d2";
@@ -960,7 +964,10 @@ function DeviceControlPanel({
960
964
  bottom: 0,
961
965
  left: 0,
962
966
  right: 0,
963
- animation: "slideUp 0.3s ease-out"
967
+ animation: "slideUp 0.3s ease-out",
968
+ maxWidth,
969
+ marginLeft: "auto",
970
+ marginRight: "auto"
964
971
  } : {
965
972
  right: 0,
966
973
  top: 0,
@@ -975,7 +982,7 @@ function DeviceControlPanel({
975
982
  border: `2px solid ${borderColor}`,
976
983
  padding: "20px",
977
984
  zIndex: 9999,
978
- maxHeight: position === "bottom" ? "70vh" : "100vh",
985
+ maxHeight: maxHeight || (position === "bottom" ? "70vh" : "100vh"),
979
986
  overflowY: "auto",
980
987
  ...binding.display?.style
981
988
  };
@@ -1312,8 +1319,8 @@ function DeviceControlPanel({
1312
1319
  param.id
1313
1320
  ))
1314
1321
  ] }),
1315
- binding.display?.showStartStop !== false && (binding.capabilities?.canStart || binding.capabilities?.canStop) && /* @__PURE__ */ jsxs7("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: [
1316
- binding.capabilities?.canStart && /* @__PURE__ */ jsx8(
1322
+ binding.display?.showStartStop !== false && (activeCapabilities?.canStart || activeCapabilities?.canStop) && /* @__PURE__ */ jsxs7("div", { style: { display: "flex", gap: "8px", marginBottom: "16px" }, children: [
1323
+ activeCapabilities?.canStart && /* @__PURE__ */ jsx8(
1317
1324
  "button",
1318
1325
  {
1319
1326
  onClick: onStart,
@@ -1335,7 +1342,7 @@ function DeviceControlPanel({
1335
1342
  children: "START"
1336
1343
  }
1337
1344
  ),
1338
- binding.capabilities?.canStop && /* @__PURE__ */ jsx8(
1345
+ activeCapabilities?.canStop && /* @__PURE__ */ jsx8(
1339
1346
  "button",
1340
1347
  {
1341
1348
  onClick: onStop,
@@ -1358,7 +1365,7 @@ function DeviceControlPanel({
1358
1365
  }
1359
1366
  )
1360
1367
  ] }),
1361
- binding.capabilities?.customActions && binding.capabilities.customActions.length > 0 && /* @__PURE__ */ jsx8("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: binding.capabilities.customActions.map((action) => /* @__PURE__ */ jsxs7(
1368
+ activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ jsx8("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: activeCapabilities.customActions.map((action) => /* @__PURE__ */ jsxs7(
1362
1369
  "button",
1363
1370
  {
1364
1371
  onClick: () => onCustomAction?.(action.id),