@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.cjs +44 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +44 -34
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1347,6 +1347,7 @@ function DeviceControlPanelImpl({
|
|
|
1347
1347
|
const statusColor = statusEntry.bg;
|
|
1348
1348
|
const isUnknownStatus = normalizeDeviceStatus(binding.state.status) === "unknown";
|
|
1349
1349
|
const startStopRowShown = binding.display?.showStartStop !== false && (activeCapabilities?.canStart === true || activeCapabilities?.canStop === true);
|
|
1350
|
+
const customActionsInRow = binding.display?.customActionsLayout === "row";
|
|
1350
1351
|
const startEnabledNow = activeCapabilities?.canStart === true && activeCapabilities?.startEnabled !== false && !startPending;
|
|
1351
1352
|
const stopEnabledNow = activeCapabilities?.canStop === true && activeCapabilities?.stopEnabled !== false;
|
|
1352
1353
|
const startStopFontPx = Math.max(18, Math.round(18 * fontScale));
|
|
@@ -2186,41 +2187,50 @@ function DeviceControlPanelImpl({
|
|
|
2186
2187
|
]
|
|
2187
2188
|
}
|
|
2188
2189
|
),
|
|
2189
|
-
activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
},
|
|
2197
|
-
disabled: actionDisabled,
|
|
2198
|
-
title: actionDisabled ? action.disabledReason : void 0,
|
|
2199
|
-
style: {
|
|
2200
|
-
flex: 1,
|
|
2201
|
-
minWidth: "120px",
|
|
2202
|
-
height: touchSize,
|
|
2203
|
-
backgroundColor: surfaceColor,
|
|
2204
|
-
color: textColor,
|
|
2205
|
-
border: `1px solid ${borderColor}`,
|
|
2206
|
-
borderRadius: "6px",
|
|
2207
|
-
fontSize: "11px",
|
|
2208
|
-
fontWeight: 600,
|
|
2209
|
-
fontFamily: "monospace",
|
|
2210
|
-
letterSpacing: "0.5px",
|
|
2211
|
-
textTransform: "uppercase",
|
|
2212
|
-
cursor: actionDisabled ? "not-allowed" : "pointer",
|
|
2213
|
-
opacity: actionDisabled ? 0.4 : 1,
|
|
2214
|
-
transition: "all 0.15s"
|
|
2215
|
-
},
|
|
2216
|
-
children: [
|
|
2217
|
-
action.icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { marginRight: "6px" }, children: action.icon }),
|
|
2218
|
-
action.label
|
|
2219
|
-
]
|
|
2190
|
+
activeCapabilities?.customActions && activeCapabilities.customActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2191
|
+
"div",
|
|
2192
|
+
{
|
|
2193
|
+
style: {
|
|
2194
|
+
display: "flex",
|
|
2195
|
+
flexWrap: customActionsInRow ? "nowrap" : "wrap",
|
|
2196
|
+
gap: "8px"
|
|
2220
2197
|
},
|
|
2221
|
-
action
|
|
2222
|
-
|
|
2223
|
-
|
|
2198
|
+
children: activeCapabilities.customActions.map((action) => {
|
|
2199
|
+
const actionDisabled = action.disabled === true;
|
|
2200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2201
|
+
"button",
|
|
2202
|
+
{
|
|
2203
|
+
onClick: () => {
|
|
2204
|
+
if (!actionDisabled) onCustomAction?.(action.id);
|
|
2205
|
+
},
|
|
2206
|
+
disabled: actionDisabled,
|
|
2207
|
+
title: actionDisabled ? action.disabledReason : void 0,
|
|
2208
|
+
style: {
|
|
2209
|
+
...customActionsInRow ? { flex: "1 1 0px", minWidth: 0, paddingLeft: "4px", paddingRight: "4px" } : { flex: 1, minWidth: "120px" },
|
|
2210
|
+
height: touchSize,
|
|
2211
|
+
backgroundColor: surfaceColor,
|
|
2212
|
+
color: textColor,
|
|
2213
|
+
border: `1px solid ${borderColor}`,
|
|
2214
|
+
borderRadius: "6px",
|
|
2215
|
+
fontSize: "11px",
|
|
2216
|
+
fontWeight: 600,
|
|
2217
|
+
fontFamily: "monospace",
|
|
2218
|
+
letterSpacing: "0.5px",
|
|
2219
|
+
textTransform: "uppercase",
|
|
2220
|
+
cursor: actionDisabled ? "not-allowed" : "pointer",
|
|
2221
|
+
opacity: actionDisabled ? 0.4 : 1,
|
|
2222
|
+
transition: "all 0.15s"
|
|
2223
|
+
},
|
|
2224
|
+
children: [
|
|
2225
|
+
action.icon && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { marginRight: "6px" }, children: action.icon }),
|
|
2226
|
+
action.label
|
|
2227
|
+
]
|
|
2228
|
+
},
|
|
2229
|
+
action.id
|
|
2230
|
+
);
|
|
2231
|
+
})
|
|
2232
|
+
}
|
|
2233
|
+
)
|
|
2224
2234
|
] }),
|
|
2225
2235
|
binding.state.lastCommandResult && showToast && showBuiltInToast && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2226
2236
|
"div",
|