@procaaso/alphinity-ui-components 1.14.0 → 1.16.0

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
@@ -698,6 +698,15 @@ interface DeviceControlBinding {
698
698
  style?: React.CSSProperties;
699
699
  /** Group parameters by category */
700
700
  groupParameters?: boolean;
701
+ /**
702
+ * Layout of the custom action buttons.
703
+ * - 'wrap' (default): each action has a 120px minimum width and the
704
+ * actions wrap onto more rows when the panel is narrow.
705
+ * - 'row': all actions share ONE row with no minimum width and a small
706
+ * side padding, so several actions fit in a narrow faceplate. A long
707
+ * label can wrap onto two lines inside its button.
708
+ */
709
+ customActionsLayout?: 'wrap' | 'row';
701
710
  };
702
711
  /** Styling overrides */
703
712
  theme?: {
package/dist/index.d.ts CHANGED
@@ -698,6 +698,15 @@ interface DeviceControlBinding {
698
698
  style?: React.CSSProperties;
699
699
  /** Group parameters by category */
700
700
  groupParameters?: boolean;
701
+ /**
702
+ * Layout of the custom action buttons.
703
+ * - 'wrap' (default): each action has a 120px minimum width and the
704
+ * actions wrap onto more rows when the panel is narrow.
705
+ * - 'row': all actions share ONE row with no minimum width and a small
706
+ * side padding, so several actions fit in a narrow faceplate. A long
707
+ * label can wrap onto two lines inside its button.
708
+ */
709
+ customActionsLayout?: 'wrap' | 'row';
701
710
  };
702
711
  /** Styling overrides */
703
712
  theme?: {
package/dist/index.js CHANGED
@@ -1224,6 +1224,7 @@ function DeviceControlPanelImpl({
1224
1224
  const statusColor = statusEntry.bg;
1225
1225
  const isUnknownStatus = normalizeDeviceStatus(binding.state.status) === "unknown";
1226
1226
  const startStopRowShown = binding.display?.showStartStop !== false && (activeCapabilities?.canStart === true || activeCapabilities?.canStop === true);
1227
+ const customActionsInRow = binding.display?.customActionsLayout === "row";
1227
1228
  const startEnabledNow = activeCapabilities?.canStart === true && activeCapabilities?.startEnabled !== false && !startPending;
1228
1229
  const stopEnabledNow = activeCapabilities?.canStop === true && activeCapabilities?.stopEnabled !== false;
1229
1230
  const startStopFontPx = Math.max(18, Math.round(18 * fontScale));
@@ -2063,41 +2064,50 @@ function DeviceControlPanelImpl({
2063
2064
  ]
2064
2065
  }
2065
2066
  ),
2066
- activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ jsx9("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: activeCapabilities.customActions.map((action) => {
2067
- const actionDisabled = action.disabled === true;
2068
- return /* @__PURE__ */ jsxs8(
2069
- "button",
2070
- {
2071
- onClick: () => {
2072
- if (!actionDisabled) onCustomAction?.(action.id);
2073
- },
2074
- disabled: actionDisabled,
2075
- title: actionDisabled ? action.disabledReason : void 0,
2076
- style: {
2077
- flex: 1,
2078
- minWidth: "120px",
2079
- height: touchSize,
2080
- backgroundColor: surfaceColor,
2081
- color: textColor,
2082
- border: `1px solid ${borderColor}`,
2083
- borderRadius: "6px",
2084
- fontSize: "11px",
2085
- fontWeight: 600,
2086
- fontFamily: "monospace",
2087
- letterSpacing: "0.5px",
2088
- textTransform: "uppercase",
2089
- cursor: actionDisabled ? "not-allowed" : "pointer",
2090
- opacity: actionDisabled ? 0.4 : 1,
2091
- transition: "all 0.15s"
2092
- },
2093
- children: [
2094
- action.icon && /* @__PURE__ */ jsx9("span", { style: { marginRight: "6px" }, children: action.icon }),
2095
- action.label
2096
- ]
2067
+ activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ jsx9(
2068
+ "div",
2069
+ {
2070
+ style: {
2071
+ display: "flex",
2072
+ flexWrap: customActionsInRow ? "nowrap" : "wrap",
2073
+ gap: "8px"
2097
2074
  },
2098
- action.id
2099
- );
2100
- }) })
2075
+ children: activeCapabilities.customActions.map((action) => {
2076
+ const actionDisabled = action.disabled === true;
2077
+ return /* @__PURE__ */ jsxs8(
2078
+ "button",
2079
+ {
2080
+ onClick: () => {
2081
+ if (!actionDisabled) onCustomAction?.(action.id);
2082
+ },
2083
+ disabled: actionDisabled,
2084
+ title: actionDisabled ? action.disabledReason : void 0,
2085
+ style: {
2086
+ ...customActionsInRow ? { flex: "1 1 0px", minWidth: 0, paddingLeft: "4px", paddingRight: "4px" } : { flex: 1, minWidth: "120px" },
2087
+ height: touchSize,
2088
+ backgroundColor: surfaceColor,
2089
+ color: textColor,
2090
+ border: `1px solid ${borderColor}`,
2091
+ borderRadius: "6px",
2092
+ fontSize: "11px",
2093
+ fontWeight: 600,
2094
+ fontFamily: "monospace",
2095
+ letterSpacing: "0.5px",
2096
+ textTransform: "uppercase",
2097
+ cursor: actionDisabled ? "not-allowed" : "pointer",
2098
+ opacity: actionDisabled ? 0.4 : 1,
2099
+ transition: "all 0.15s"
2100
+ },
2101
+ children: [
2102
+ action.icon && /* @__PURE__ */ jsx9("span", { style: { marginRight: "6px" }, children: action.icon }),
2103
+ action.label
2104
+ ]
2105
+ },
2106
+ action.id
2107
+ );
2108
+ })
2109
+ }
2110
+ )
2101
2111
  ] }),
2102
2112
  binding.state.lastCommandResult && showToast && showBuiltInToast && /* @__PURE__ */ jsx9(
2103
2113
  "div",