@imperosoft/cris-webui-components 1.1.2 → 1.1.3-beta.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.mts +53 -1
- package/dist/index.d.ts +53 -1
- package/dist/index.js +297 -55
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +296 -55
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -314,6 +314,58 @@ interface CrisCoDebugProps {
|
|
|
314
314
|
}
|
|
315
315
|
declare function CrisCoDebug({ oid, title, className, style, itemClassName, itemStyle, buttonClassName, buttonActiveClassName, iconEthOn, iconEthOff, iconRs232On, iconRs232Off, }: CrisCoDebugProps): react_jsx_runtime.JSX.Element | null;
|
|
316
316
|
|
|
317
|
+
/** Shape of a list item from the backend */
|
|
318
|
+
interface ListItem {
|
|
319
|
+
id: number;
|
|
320
|
+
lb: string;
|
|
321
|
+
/** Enabled state (default: true) */
|
|
322
|
+
en?: boolean;
|
|
323
|
+
/** Visible in list (default: true) */
|
|
324
|
+
vs?: boolean;
|
|
325
|
+
/** Additional data — available via renderItem */
|
|
326
|
+
[key: string]: unknown;
|
|
327
|
+
}
|
|
328
|
+
/** Shape of the list status from the backend */
|
|
329
|
+
interface ListStatus {
|
|
330
|
+
/** Settings (extensible, passed to renderItem via props) */
|
|
331
|
+
st?: Record<string, unknown>;
|
|
332
|
+
/** Selected item id */
|
|
333
|
+
si?: number;
|
|
334
|
+
/** List items */
|
|
335
|
+
it: ListItem[];
|
|
336
|
+
}
|
|
337
|
+
interface CrisCoListProps {
|
|
338
|
+
/** Custom object ID */
|
|
339
|
+
oid: string;
|
|
340
|
+
/** List title */
|
|
341
|
+
title?: string;
|
|
342
|
+
/** Show item id prefix before label (default: true) */
|
|
343
|
+
showIds?: boolean;
|
|
344
|
+
/** Action name sent on selection (default: "select") */
|
|
345
|
+
selectAction?: string;
|
|
346
|
+
/** Custom item renderer — receives item and selected state */
|
|
347
|
+
renderItem?: (item: ListItem, selected: boolean, settings?: Record<string, unknown>) => ReactNode;
|
|
348
|
+
/** Container className */
|
|
349
|
+
className?: string;
|
|
350
|
+
/** Container style */
|
|
351
|
+
style?: CSSProperties;
|
|
352
|
+
/** Header className */
|
|
353
|
+
headerClassName?: string;
|
|
354
|
+
/** Header style */
|
|
355
|
+
headerStyle?: CSSProperties;
|
|
356
|
+
/** Item className */
|
|
357
|
+
itemClassName?: string;
|
|
358
|
+
/** Item style */
|
|
359
|
+
itemStyle?: CSSProperties;
|
|
360
|
+
/** Item active (selected) className */
|
|
361
|
+
itemActiveClassName?: string;
|
|
362
|
+
/** Item active style */
|
|
363
|
+
itemActiveStyle?: CSSProperties;
|
|
364
|
+
/** Item disabled className */
|
|
365
|
+
itemDisabledClassName?: string;
|
|
366
|
+
}
|
|
367
|
+
declare function CrisCoList({ oid, title, showIds, selectAction, renderItem, className, style, headerClassName, headerStyle, itemClassName, itemStyle, itemActiveClassName, itemActiveStyle, itemDisabledClassName, }: CrisCoListProps): react_jsx_runtime.JSX.Element | null;
|
|
368
|
+
|
|
317
369
|
/** Shape of an input or output item from the backend */
|
|
318
370
|
interface MatrixItem {
|
|
319
371
|
id: number;
|
|
@@ -441,4 +493,4 @@ declare function getIconUrl(name: string): string;
|
|
|
441
493
|
*/
|
|
442
494
|
declare function getIconFilter(active: boolean): string | undefined;
|
|
443
495
|
|
|
444
|
-
export { CrisButton, type CrisButtonProps, CrisCoDebug, type CrisCoDebugProps, CrisCoMatrixListsTie, type CrisCoMatrixListsTieProps, CrisGauge, type CrisGaugeProps, CrisOfflinePage, type CrisOfflinePageProps, CrisSlider, type CrisSliderProps, CrisSpinner, type CrisSpinnerProps, CrisText, type CrisTextProps, type DebugModule, type IconConfig, type MatrixItem, type MatrixStatus, type SpinnerSpeed, configureIcons, getIconConfig, getIconFilter, getIconUrl };
|
|
496
|
+
export { CrisButton, type CrisButtonProps, CrisCoDebug, type CrisCoDebugProps, CrisCoList, type CrisCoListProps, CrisCoMatrixListsTie, type CrisCoMatrixListsTieProps, CrisGauge, type CrisGaugeProps, CrisOfflinePage, type CrisOfflinePageProps, CrisSlider, type CrisSliderProps, CrisSpinner, type CrisSpinnerProps, CrisText, type CrisTextProps, type DebugModule, type IconConfig, type ListItem, type ListStatus, type MatrixItem, type MatrixStatus, type SpinnerSpeed, configureIcons, getIconConfig, getIconFilter, getIconUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -314,6 +314,58 @@ interface CrisCoDebugProps {
|
|
|
314
314
|
}
|
|
315
315
|
declare function CrisCoDebug({ oid, title, className, style, itemClassName, itemStyle, buttonClassName, buttonActiveClassName, iconEthOn, iconEthOff, iconRs232On, iconRs232Off, }: CrisCoDebugProps): react_jsx_runtime.JSX.Element | null;
|
|
316
316
|
|
|
317
|
+
/** Shape of a list item from the backend */
|
|
318
|
+
interface ListItem {
|
|
319
|
+
id: number;
|
|
320
|
+
lb: string;
|
|
321
|
+
/** Enabled state (default: true) */
|
|
322
|
+
en?: boolean;
|
|
323
|
+
/** Visible in list (default: true) */
|
|
324
|
+
vs?: boolean;
|
|
325
|
+
/** Additional data — available via renderItem */
|
|
326
|
+
[key: string]: unknown;
|
|
327
|
+
}
|
|
328
|
+
/** Shape of the list status from the backend */
|
|
329
|
+
interface ListStatus {
|
|
330
|
+
/** Settings (extensible, passed to renderItem via props) */
|
|
331
|
+
st?: Record<string, unknown>;
|
|
332
|
+
/** Selected item id */
|
|
333
|
+
si?: number;
|
|
334
|
+
/** List items */
|
|
335
|
+
it: ListItem[];
|
|
336
|
+
}
|
|
337
|
+
interface CrisCoListProps {
|
|
338
|
+
/** Custom object ID */
|
|
339
|
+
oid: string;
|
|
340
|
+
/** List title */
|
|
341
|
+
title?: string;
|
|
342
|
+
/** Show item id prefix before label (default: true) */
|
|
343
|
+
showIds?: boolean;
|
|
344
|
+
/** Action name sent on selection (default: "select") */
|
|
345
|
+
selectAction?: string;
|
|
346
|
+
/** Custom item renderer — receives item and selected state */
|
|
347
|
+
renderItem?: (item: ListItem, selected: boolean, settings?: Record<string, unknown>) => ReactNode;
|
|
348
|
+
/** Container className */
|
|
349
|
+
className?: string;
|
|
350
|
+
/** Container style */
|
|
351
|
+
style?: CSSProperties;
|
|
352
|
+
/** Header className */
|
|
353
|
+
headerClassName?: string;
|
|
354
|
+
/** Header style */
|
|
355
|
+
headerStyle?: CSSProperties;
|
|
356
|
+
/** Item className */
|
|
357
|
+
itemClassName?: string;
|
|
358
|
+
/** Item style */
|
|
359
|
+
itemStyle?: CSSProperties;
|
|
360
|
+
/** Item active (selected) className */
|
|
361
|
+
itemActiveClassName?: string;
|
|
362
|
+
/** Item active style */
|
|
363
|
+
itemActiveStyle?: CSSProperties;
|
|
364
|
+
/** Item disabled className */
|
|
365
|
+
itemDisabledClassName?: string;
|
|
366
|
+
}
|
|
367
|
+
declare function CrisCoList({ oid, title, showIds, selectAction, renderItem, className, style, headerClassName, headerStyle, itemClassName, itemStyle, itemActiveClassName, itemActiveStyle, itemDisabledClassName, }: CrisCoListProps): react_jsx_runtime.JSX.Element | null;
|
|
368
|
+
|
|
317
369
|
/** Shape of an input or output item from the backend */
|
|
318
370
|
interface MatrixItem {
|
|
319
371
|
id: number;
|
|
@@ -441,4 +493,4 @@ declare function getIconUrl(name: string): string;
|
|
|
441
493
|
*/
|
|
442
494
|
declare function getIconFilter(active: boolean): string | undefined;
|
|
443
495
|
|
|
444
|
-
export { CrisButton, type CrisButtonProps, CrisCoDebug, type CrisCoDebugProps, CrisCoMatrixListsTie, type CrisCoMatrixListsTieProps, CrisGauge, type CrisGaugeProps, CrisOfflinePage, type CrisOfflinePageProps, CrisSlider, type CrisSliderProps, CrisSpinner, type CrisSpinnerProps, CrisText, type CrisTextProps, type DebugModule, type IconConfig, type MatrixItem, type MatrixStatus, type SpinnerSpeed, configureIcons, getIconConfig, getIconFilter, getIconUrl };
|
|
496
|
+
export { CrisButton, type CrisButtonProps, CrisCoDebug, type CrisCoDebugProps, CrisCoList, type CrisCoListProps, CrisCoMatrixListsTie, type CrisCoMatrixListsTieProps, CrisGauge, type CrisGaugeProps, CrisOfflinePage, type CrisOfflinePageProps, CrisSlider, type CrisSliderProps, CrisSpinner, type CrisSpinnerProps, CrisText, type CrisTextProps, type DebugModule, type IconConfig, type ListItem, type ListStatus, type MatrixItem, type MatrixStatus, type SpinnerSpeed, configureIcons, getIconConfig, getIconFilter, getIconUrl };
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
CrisButton: () => CrisButton,
|
|
24
24
|
CrisCoDebug: () => CrisCoDebug,
|
|
25
|
+
CrisCoList: () => CrisCoList,
|
|
25
26
|
CrisCoMatrixListsTie: () => CrisCoMatrixListsTie,
|
|
26
27
|
CrisGauge: () => CrisGauge,
|
|
27
28
|
CrisOfflinePage: () => CrisOfflinePage,
|
|
@@ -1344,10 +1345,250 @@ function CrisCoDebug({
|
|
|
1344
1345
|
);
|
|
1345
1346
|
}
|
|
1346
1347
|
|
|
1347
|
-
// src/components/
|
|
1348
|
+
// src/components/CrisCoList.tsx
|
|
1348
1349
|
var import_cris_webui_ch5_core8 = require("@imperosoft/cris-webui-ch5-core");
|
|
1349
1350
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1350
1351
|
var colors = {
|
|
1352
|
+
itemBg: "#4f5152",
|
|
1353
|
+
itemActiveBg: "#007ca0",
|
|
1354
|
+
text: "#ffffff",
|
|
1355
|
+
headerText: "#6b7280"
|
|
1356
|
+
};
|
|
1357
|
+
var defaults = {
|
|
1358
|
+
container: {
|
|
1359
|
+
display: "flex",
|
|
1360
|
+
flexDirection: "column",
|
|
1361
|
+
overflow: "hidden",
|
|
1362
|
+
height: "100%",
|
|
1363
|
+
width: "100%",
|
|
1364
|
+
padding: "1rem 2rem",
|
|
1365
|
+
minHeight: 0
|
|
1366
|
+
},
|
|
1367
|
+
header: {
|
|
1368
|
+
fontSize: "1.5em",
|
|
1369
|
+
fontWeight: 700,
|
|
1370
|
+
padding: "0.5rem 0.75rem",
|
|
1371
|
+
textTransform: "uppercase",
|
|
1372
|
+
letterSpacing: "0.05em",
|
|
1373
|
+
color: colors.headerText,
|
|
1374
|
+
flexShrink: 0,
|
|
1375
|
+
textAlign: "center"
|
|
1376
|
+
},
|
|
1377
|
+
scroll: {
|
|
1378
|
+
flex: 1,
|
|
1379
|
+
minHeight: 0,
|
|
1380
|
+
overflow: "auto",
|
|
1381
|
+
scrollbarWidth: "none",
|
|
1382
|
+
WebkitOverflowScrolling: "touch",
|
|
1383
|
+
display: "flex",
|
|
1384
|
+
flexDirection: "column",
|
|
1385
|
+
gap: "0.15rem"
|
|
1386
|
+
},
|
|
1387
|
+
item: {
|
|
1388
|
+
display: "flex",
|
|
1389
|
+
alignItems: "stretch",
|
|
1390
|
+
minHeight: "3.7rem",
|
|
1391
|
+
cursor: "pointer",
|
|
1392
|
+
userSelect: "none",
|
|
1393
|
+
background: colors.itemBg,
|
|
1394
|
+
borderRadius: "0.5rem",
|
|
1395
|
+
transition: "background 0.15s"
|
|
1396
|
+
},
|
|
1397
|
+
itemActive: {
|
|
1398
|
+
background: colors.itemActiveBg
|
|
1399
|
+
},
|
|
1400
|
+
itemBtn: {
|
|
1401
|
+
flex: 1,
|
|
1402
|
+
minWidth: 0,
|
|
1403
|
+
display: "flex",
|
|
1404
|
+
alignItems: "stretch",
|
|
1405
|
+
background: "transparent",
|
|
1406
|
+
border: "none",
|
|
1407
|
+
textAlign: "left",
|
|
1408
|
+
color: colors.text,
|
|
1409
|
+
height: "100%",
|
|
1410
|
+
borderRadius: "0.5rem",
|
|
1411
|
+
cursor: "pointer"
|
|
1412
|
+
},
|
|
1413
|
+
itemBtnInner: {
|
|
1414
|
+
display: "flex",
|
|
1415
|
+
alignItems: "center",
|
|
1416
|
+
gap: "0.4rem",
|
|
1417
|
+
width: "100%",
|
|
1418
|
+
flex: 1,
|
|
1419
|
+
padding: "0.5rem 0.9rem"
|
|
1420
|
+
},
|
|
1421
|
+
idNum: {
|
|
1422
|
+
flexShrink: 0,
|
|
1423
|
+
opacity: 0.6,
|
|
1424
|
+
minWidth: "1.7em",
|
|
1425
|
+
textAlign: "right",
|
|
1426
|
+
fontWeight: 400,
|
|
1427
|
+
marginRight: "0.4em"
|
|
1428
|
+
},
|
|
1429
|
+
itemLabel: {
|
|
1430
|
+
flex: 1,
|
|
1431
|
+
fontSize: "1.4em",
|
|
1432
|
+
fontWeight: 700,
|
|
1433
|
+
whiteSpace: "nowrap",
|
|
1434
|
+
overflow: "hidden",
|
|
1435
|
+
textOverflow: "ellipsis",
|
|
1436
|
+
color: colors.text
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
var INJECTED_CSS = `
|
|
1440
|
+
.cris-co-list-scroll::-webkit-scrollbar { display: none; }
|
|
1441
|
+
.cris-co-list-item > div:first-child > .cris-button { width: 100%; height: 100%; }
|
|
1442
|
+
`;
|
|
1443
|
+
var styleInjected = false;
|
|
1444
|
+
function injectStyle() {
|
|
1445
|
+
if (styleInjected) return;
|
|
1446
|
+
styleInjected = true;
|
|
1447
|
+
const style = document.createElement("style");
|
|
1448
|
+
style.textContent = INJECTED_CSS;
|
|
1449
|
+
document.head.appendChild(style);
|
|
1450
|
+
}
|
|
1451
|
+
function ListItemRow({
|
|
1452
|
+
item,
|
|
1453
|
+
selected,
|
|
1454
|
+
showIds,
|
|
1455
|
+
settings,
|
|
1456
|
+
onSelect,
|
|
1457
|
+
renderItem,
|
|
1458
|
+
itemClassName,
|
|
1459
|
+
itemStyle: itemStyleProp,
|
|
1460
|
+
itemActiveClassName,
|
|
1461
|
+
itemActiveStyle,
|
|
1462
|
+
itemDisabledClassName
|
|
1463
|
+
}) {
|
|
1464
|
+
const isEnabled = item.en !== false;
|
|
1465
|
+
const useDefaults = !itemClassName;
|
|
1466
|
+
const classes = [
|
|
1467
|
+
"cris-co-list-item",
|
|
1468
|
+
itemClassName,
|
|
1469
|
+
selected && (itemActiveClassName || "active"),
|
|
1470
|
+
!isEnabled && (itemDisabledClassName || "disabled")
|
|
1471
|
+
].filter(Boolean).join(" ");
|
|
1472
|
+
const computedStyle = useDefaults ? {
|
|
1473
|
+
...defaults.item,
|
|
1474
|
+
...itemStyleProp,
|
|
1475
|
+
...selected ? { ...defaults.itemActive, ...itemActiveStyle } : void 0,
|
|
1476
|
+
opacity: isEnabled ? 1 : 0.4
|
|
1477
|
+
} : { ...itemStyleProp };
|
|
1478
|
+
if (renderItem) {
|
|
1479
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: classes, style: computedStyle, children: useDefaults ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: defaults.itemBtn, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1480
|
+
CrisButton,
|
|
1481
|
+
{
|
|
1482
|
+
selected,
|
|
1483
|
+
enabled: isEnabled,
|
|
1484
|
+
onPress: onSelect,
|
|
1485
|
+
showLocalFeedback: false,
|
|
1486
|
+
children: renderItem(item, selected, settings)
|
|
1487
|
+
}
|
|
1488
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1489
|
+
CrisButton,
|
|
1490
|
+
{
|
|
1491
|
+
selected,
|
|
1492
|
+
enabled: isEnabled,
|
|
1493
|
+
onPress: onSelect,
|
|
1494
|
+
className: `cris-co-list-item-btn ${itemActiveClassName ?? ""}`,
|
|
1495
|
+
classActive: itemActiveClassName,
|
|
1496
|
+
children: renderItem(item, selected, settings)
|
|
1497
|
+
}
|
|
1498
|
+
) });
|
|
1499
|
+
}
|
|
1500
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: classes, style: computedStyle, children: useDefaults ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: defaults.itemBtn, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1501
|
+
CrisButton,
|
|
1502
|
+
{
|
|
1503
|
+
selected,
|
|
1504
|
+
enabled: isEnabled,
|
|
1505
|
+
onPress: onSelect,
|
|
1506
|
+
showLocalFeedback: false,
|
|
1507
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.itemBtnInner, children: [
|
|
1508
|
+
showIds && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-list-id", style: defaults.idNum, children: item.id }),
|
|
1509
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: defaults.itemLabel, children: item.lb || `Item ${item.id}` })
|
|
1510
|
+
] })
|
|
1511
|
+
}
|
|
1512
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1513
|
+
CrisButton,
|
|
1514
|
+
{
|
|
1515
|
+
selected,
|
|
1516
|
+
enabled: isEnabled,
|
|
1517
|
+
onPress: onSelect,
|
|
1518
|
+
className: `cris-co-list-item-btn ${itemActiveClassName ?? ""}`,
|
|
1519
|
+
classActive: itemActiveClassName,
|
|
1520
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "0.4rem", width: "100%" }, children: [
|
|
1521
|
+
showIds && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-list-id", style: { flexShrink: 0, opacity: 0.6 }, children: item.id }),
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { flex: 1, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: item.lb || `Item ${item.id}` })
|
|
1523
|
+
] })
|
|
1524
|
+
}
|
|
1525
|
+
) });
|
|
1526
|
+
}
|
|
1527
|
+
function CrisCoList({
|
|
1528
|
+
oid,
|
|
1529
|
+
title,
|
|
1530
|
+
showIds = true,
|
|
1531
|
+
selectAction = "select",
|
|
1532
|
+
renderItem,
|
|
1533
|
+
className,
|
|
1534
|
+
style,
|
|
1535
|
+
headerClassName,
|
|
1536
|
+
headerStyle,
|
|
1537
|
+
itemClassName,
|
|
1538
|
+
itemStyle,
|
|
1539
|
+
itemActiveClassName,
|
|
1540
|
+
itemActiveStyle,
|
|
1541
|
+
itemDisabledClassName
|
|
1542
|
+
}) {
|
|
1543
|
+
const list = (0, import_cris_webui_ch5_core8.useCustomObject)(oid);
|
|
1544
|
+
const send = (0, import_cris_webui_ch5_core8.useCustomObjectSend)();
|
|
1545
|
+
injectStyle();
|
|
1546
|
+
if (!list) return null;
|
|
1547
|
+
const { st: settings, si, it: items } = list;
|
|
1548
|
+
const visibleItems = items?.filter((item) => item.vs !== false);
|
|
1549
|
+
const handleSelect = (id) => {
|
|
1550
|
+
send(oid, { action: selectAction, id });
|
|
1551
|
+
};
|
|
1552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1553
|
+
"div",
|
|
1554
|
+
{
|
|
1555
|
+
className,
|
|
1556
|
+
style: className ? style : { ...defaults.container, ...style },
|
|
1557
|
+
children: [
|
|
1558
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1559
|
+
"div",
|
|
1560
|
+
{
|
|
1561
|
+
className: headerClassName,
|
|
1562
|
+
style: headerClassName ? headerStyle : { ...defaults.header, ...headerStyle },
|
|
1563
|
+
children: title
|
|
1564
|
+
}
|
|
1565
|
+
),
|
|
1566
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "cris-co-list-scroll", style: defaults.scroll, children: visibleItems?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1567
|
+
ListItemRow,
|
|
1568
|
+
{
|
|
1569
|
+
item,
|
|
1570
|
+
selected: si === item.id,
|
|
1571
|
+
showIds,
|
|
1572
|
+
settings,
|
|
1573
|
+
onSelect: () => handleSelect(item.id),
|
|
1574
|
+
renderItem,
|
|
1575
|
+
itemClassName,
|
|
1576
|
+
itemStyle,
|
|
1577
|
+
itemActiveClassName,
|
|
1578
|
+
itemActiveStyle,
|
|
1579
|
+
itemDisabledClassName
|
|
1580
|
+
},
|
|
1581
|
+
item.id
|
|
1582
|
+
)) })
|
|
1583
|
+
]
|
|
1584
|
+
}
|
|
1585
|
+
);
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
// src/components/CrisCoMatrixListsTie.tsx
|
|
1589
|
+
var import_cris_webui_ch5_core9 = require("@imperosoft/cris-webui-ch5-core");
|
|
1590
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1591
|
+
var colors2 = {
|
|
1351
1592
|
itemBg: "#4f5152",
|
|
1352
1593
|
itemActiveBg: "#007ca0",
|
|
1353
1594
|
vmActiveBg: "#dc2626",
|
|
@@ -1358,7 +1599,7 @@ var colors = {
|
|
|
1358
1599
|
sgOn: "#2196f3",
|
|
1359
1600
|
sgOff: "#666666"
|
|
1360
1601
|
};
|
|
1361
|
-
var
|
|
1602
|
+
var defaults2 = {
|
|
1362
1603
|
container: {
|
|
1363
1604
|
display: "flex",
|
|
1364
1605
|
flexDirection: "row",
|
|
@@ -1380,7 +1621,7 @@ var defaults = {
|
|
|
1380
1621
|
padding: "0.5rem 0.75rem",
|
|
1381
1622
|
textTransform: "uppercase",
|
|
1382
1623
|
letterSpacing: "0.05em",
|
|
1383
|
-
color:
|
|
1624
|
+
color: colors2.headerText,
|
|
1384
1625
|
flexShrink: 0,
|
|
1385
1626
|
textAlign: "center"
|
|
1386
1627
|
},
|
|
@@ -1402,12 +1643,12 @@ var defaults = {
|
|
|
1402
1643
|
minHeight: "3.7rem",
|
|
1403
1644
|
cursor: "pointer",
|
|
1404
1645
|
userSelect: "none",
|
|
1405
|
-
background:
|
|
1646
|
+
background: colors2.itemBg,
|
|
1406
1647
|
borderRadius: "0.5rem",
|
|
1407
1648
|
transition: "background 0.15s"
|
|
1408
1649
|
},
|
|
1409
1650
|
itemActive: {
|
|
1410
|
-
background:
|
|
1651
|
+
background: colors2.itemActiveBg
|
|
1411
1652
|
},
|
|
1412
1653
|
itemBtn: {
|
|
1413
1654
|
flex: 1,
|
|
@@ -1417,7 +1658,7 @@ var defaults = {
|
|
|
1417
1658
|
background: "transparent",
|
|
1418
1659
|
border: "none",
|
|
1419
1660
|
textAlign: "left",
|
|
1420
|
-
color:
|
|
1661
|
+
color: colors2.text,
|
|
1421
1662
|
height: "100%",
|
|
1422
1663
|
borderRadius: "0.5rem",
|
|
1423
1664
|
cursor: "pointer"
|
|
@@ -1445,7 +1686,7 @@ var defaults = {
|
|
|
1445
1686
|
whiteSpace: "nowrap",
|
|
1446
1687
|
overflow: "hidden",
|
|
1447
1688
|
textOverflow: "ellipsis",
|
|
1448
|
-
color:
|
|
1689
|
+
color: colors2.text
|
|
1449
1690
|
},
|
|
1450
1691
|
indicators: {
|
|
1451
1692
|
display: "flex",
|
|
@@ -1463,8 +1704,8 @@ var defaults = {
|
|
|
1463
1704
|
alignSelf: "stretch",
|
|
1464
1705
|
display: "flex",
|
|
1465
1706
|
alignItems: "center",
|
|
1466
|
-
background:
|
|
1467
|
-
color:
|
|
1707
|
+
background: colors2.itemBg,
|
|
1708
|
+
color: colors2.text,
|
|
1468
1709
|
border: "none",
|
|
1469
1710
|
borderRadius: "0.4rem",
|
|
1470
1711
|
padding: "0 0.6rem",
|
|
@@ -1475,11 +1716,11 @@ var defaults = {
|
|
|
1475
1716
|
transition: "background 0.15s"
|
|
1476
1717
|
},
|
|
1477
1718
|
vmBtnActive: {
|
|
1478
|
-
background:
|
|
1479
|
-
color:
|
|
1719
|
+
background: colors2.vmActiveBg,
|
|
1720
|
+
color: colors2.text
|
|
1480
1721
|
}
|
|
1481
1722
|
};
|
|
1482
|
-
var
|
|
1723
|
+
var INJECTED_CSS2 = `
|
|
1483
1724
|
.cris-co-matrix-scroll::-webkit-scrollbar { display: none; }
|
|
1484
1725
|
.cris-co-matrix-item > div:first-child > .cris-button { width: 100%; height: 100%; }
|
|
1485
1726
|
`;
|
|
@@ -1488,28 +1729,28 @@ function injectScrollbarStyle() {
|
|
|
1488
1729
|
if (scrollbarStyleInjected) return;
|
|
1489
1730
|
scrollbarStyleInjected = true;
|
|
1490
1731
|
const style = document.createElement("style");
|
|
1491
|
-
style.textContent =
|
|
1732
|
+
style.textContent = INJECTED_CSS2;
|
|
1492
1733
|
document.head.appendChild(style);
|
|
1493
1734
|
}
|
|
1494
1735
|
function DefaultIoIndicator({ on }) {
|
|
1495
|
-
return /* @__PURE__ */ (0,
|
|
1736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1496
1737
|
"div",
|
|
1497
1738
|
{
|
|
1498
1739
|
style: {
|
|
1499
|
-
...
|
|
1500
|
-
backgroundColor: on ?
|
|
1740
|
+
...defaults2.indicator,
|
|
1741
|
+
backgroundColor: on ? colors2.ioOn : colors2.ioOff
|
|
1501
1742
|
},
|
|
1502
1743
|
title: on ? "Online" : "Offline"
|
|
1503
1744
|
}
|
|
1504
1745
|
);
|
|
1505
1746
|
}
|
|
1506
1747
|
function DefaultSignalIndicator({ on }) {
|
|
1507
|
-
return /* @__PURE__ */ (0,
|
|
1748
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1508
1749
|
"div",
|
|
1509
1750
|
{
|
|
1510
1751
|
style: {
|
|
1511
|
-
...
|
|
1512
|
-
backgroundColor: on ?
|
|
1752
|
+
...defaults2.indicator,
|
|
1753
|
+
backgroundColor: on ? colors2.sgOn : colors2.sgOff
|
|
1513
1754
|
},
|
|
1514
1755
|
title: on ? "Signal detected" : "No signal"
|
|
1515
1756
|
}
|
|
@@ -1543,29 +1784,29 @@ function MatrixItemRow({
|
|
|
1543
1784
|
!isEnabled && (itemDisabledClassName || "disabled")
|
|
1544
1785
|
].filter(Boolean).join(" ");
|
|
1545
1786
|
const computedStyle = useDefaults ? {
|
|
1546
|
-
...
|
|
1787
|
+
...defaults2.item,
|
|
1547
1788
|
...itemStyleProp,
|
|
1548
|
-
...isActive ? { ...
|
|
1789
|
+
...isActive ? { ...defaults2.itemActive, ...itemActiveStyle } : void 0,
|
|
1549
1790
|
opacity: isEnabled ? 1 : 0.4
|
|
1550
1791
|
} : { ...itemStyleProp };
|
|
1551
|
-
return /* @__PURE__ */ (0,
|
|
1552
|
-
useDefaults ? /* @__PURE__ */ (0,
|
|
1792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: classes, style: computedStyle, children: [
|
|
1793
|
+
useDefaults ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: defaults2.itemBtn, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1553
1794
|
CrisButton,
|
|
1554
1795
|
{
|
|
1555
1796
|
selected: isActive,
|
|
1556
1797
|
enabled: isEnabled,
|
|
1557
1798
|
onPress: onSelect,
|
|
1558
1799
|
showLocalFeedback: false,
|
|
1559
|
-
children: /* @__PURE__ */ (0,
|
|
1560
|
-
showChannels && /* @__PURE__ */ (0,
|
|
1561
|
-
/* @__PURE__ */ (0,
|
|
1562
|
-
/* @__PURE__ */ (0,
|
|
1563
|
-
item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0,
|
|
1564
|
-
item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0,
|
|
1800
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: defaults2.itemBtnInner, children: [
|
|
1801
|
+
showChannels && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "cris-co-matrix-ch", style: defaults2.channelNum, children: item.id }),
|
|
1802
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: defaults2.itemLabel, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.id}` }),
|
|
1803
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: defaults2.indicators, children: [
|
|
1804
|
+
item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DefaultIoIndicator, { on: item.io.on })),
|
|
1805
|
+
item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
|
|
1565
1806
|
] })
|
|
1566
1807
|
] })
|
|
1567
1808
|
}
|
|
1568
|
-
) }) : /* @__PURE__ */ (0,
|
|
1809
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1569
1810
|
CrisButton,
|
|
1570
1811
|
{
|
|
1571
1812
|
selected: isActive,
|
|
@@ -1573,22 +1814,22 @@ function MatrixItemRow({
|
|
|
1573
1814
|
onPress: onSelect,
|
|
1574
1815
|
className: `cris-co-matrix-item-btn ${itemActiveClassName ?? ""}`,
|
|
1575
1816
|
classActive: itemActiveClassName,
|
|
1576
|
-
children: /* @__PURE__ */ (0,
|
|
1577
|
-
showChannels && /* @__PURE__ */ (0,
|
|
1578
|
-
/* @__PURE__ */ (0,
|
|
1579
|
-
/* @__PURE__ */ (0,
|
|
1580
|
-
item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0,
|
|
1581
|
-
item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0,
|
|
1817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "0.4rem", width: "100%" }, children: [
|
|
1818
|
+
showChannels && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "cris-co-matrix-ch", style: { flexShrink: 0, opacity: 0.6 }, children: item.id }),
|
|
1819
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { style: { flex: 1, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.id}` }),
|
|
1820
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { style: defaults2.indicators, children: [
|
|
1821
|
+
item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DefaultIoIndicator, { on: item.io.on })),
|
|
1822
|
+
item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
|
|
1582
1823
|
] })
|
|
1583
1824
|
] })
|
|
1584
1825
|
}
|
|
1585
1826
|
),
|
|
1586
|
-
item.vm.vs && (useDefaults && !vmButtonClassName ? /* @__PURE__ */ (0,
|
|
1587
|
-
...
|
|
1588
|
-
...item.vm.on ?
|
|
1827
|
+
item.vm.vs && (useDefaults && !vmButtonClassName ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { style: {
|
|
1828
|
+
...defaults2.vmBtn,
|
|
1829
|
+
...item.vm.on ? defaults2.vmBtnActive : void 0,
|
|
1589
1830
|
opacity: item.vm.en ? 1 : 0.4,
|
|
1590
1831
|
pointerEvents: item.vm.en ? "auto" : "none"
|
|
1591
|
-
}, children: /* @__PURE__ */ (0,
|
|
1832
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1592
1833
|
CrisButton,
|
|
1593
1834
|
{
|
|
1594
1835
|
selected: item.vm.on,
|
|
@@ -1597,7 +1838,7 @@ function MatrixItemRow({
|
|
|
1597
1838
|
onPress: onToggleVideoMute,
|
|
1598
1839
|
showLocalFeedback: false
|
|
1599
1840
|
}
|
|
1600
|
-
) }) : /* @__PURE__ */ (0,
|
|
1841
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1601
1842
|
CrisButton,
|
|
1602
1843
|
{
|
|
1603
1844
|
selected: item.vm.on,
|
|
@@ -1632,8 +1873,8 @@ function CrisCoMatrixListsTie({
|
|
|
1632
1873
|
renderIoIndicator,
|
|
1633
1874
|
renderSignalIndicator
|
|
1634
1875
|
}) {
|
|
1635
|
-
const matrix = (0,
|
|
1636
|
-
const send = (0,
|
|
1876
|
+
const matrix = (0, import_cris_webui_ch5_core9.useCustomObject)(oid);
|
|
1877
|
+
const send = (0, import_cris_webui_ch5_core9.useCustomObjectSend)();
|
|
1637
1878
|
injectScrollbarStyle();
|
|
1638
1879
|
if (!matrix) return null;
|
|
1639
1880
|
const { si, ip: inputs, op: outputs } = matrix;
|
|
@@ -1646,27 +1887,27 @@ function CrisCoMatrixListsTie({
|
|
|
1646
1887
|
const handleToggleVideoMute = (type, id) => {
|
|
1647
1888
|
send(oid, { action: "toggleVideoMute", type, id });
|
|
1648
1889
|
};
|
|
1649
|
-
return /* @__PURE__ */ (0,
|
|
1890
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1650
1891
|
"div",
|
|
1651
1892
|
{
|
|
1652
1893
|
className,
|
|
1653
|
-
style: className ? style : { ...
|
|
1894
|
+
style: className ? style : { ...defaults2.container, ...style },
|
|
1654
1895
|
children: [
|
|
1655
|
-
/* @__PURE__ */ (0,
|
|
1896
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1656
1897
|
"div",
|
|
1657
1898
|
{
|
|
1658
1899
|
className: listClassName,
|
|
1659
|
-
style: listClassName ? listStyle : { ...
|
|
1900
|
+
style: listClassName ? listStyle : { ...defaults2.list, ...listStyle },
|
|
1660
1901
|
children: [
|
|
1661
|
-
/* @__PURE__ */ (0,
|
|
1902
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1662
1903
|
"div",
|
|
1663
1904
|
{
|
|
1664
1905
|
className: headerClassName,
|
|
1665
|
-
style: headerClassName ? headerStyle : { ...
|
|
1906
|
+
style: headerClassName ? headerStyle : { ...defaults2.header, ...headerStyle },
|
|
1666
1907
|
children: inputTitle
|
|
1667
1908
|
}
|
|
1668
1909
|
),
|
|
1669
|
-
/* @__PURE__ */ (0,
|
|
1910
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "cris-co-matrix-scroll", style: defaults2.scroll, children: inputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1670
1911
|
MatrixItemRow,
|
|
1671
1912
|
{
|
|
1672
1913
|
item,
|
|
@@ -1691,21 +1932,21 @@ function CrisCoMatrixListsTie({
|
|
|
1691
1932
|
]
|
|
1692
1933
|
}
|
|
1693
1934
|
),
|
|
1694
|
-
/* @__PURE__ */ (0,
|
|
1935
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1695
1936
|
"div",
|
|
1696
1937
|
{
|
|
1697
1938
|
className: listClassName,
|
|
1698
|
-
style: listClassName ? listStyle : { ...
|
|
1939
|
+
style: listClassName ? listStyle : { ...defaults2.list, ...listStyle },
|
|
1699
1940
|
children: [
|
|
1700
|
-
/* @__PURE__ */ (0,
|
|
1941
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1701
1942
|
"div",
|
|
1702
1943
|
{
|
|
1703
1944
|
className: headerClassName,
|
|
1704
|
-
style: headerClassName ? headerStyle : { ...
|
|
1945
|
+
style: headerClassName ? headerStyle : { ...defaults2.header, ...headerStyle },
|
|
1705
1946
|
children: outputTitle
|
|
1706
1947
|
}
|
|
1707
1948
|
),
|
|
1708
|
-
/* @__PURE__ */ (0,
|
|
1949
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "cris-co-matrix-scroll", style: defaults2.scroll, children: outputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1709
1950
|
MatrixItemRow,
|
|
1710
1951
|
{
|
|
1711
1952
|
item,
|
|
@@ -1738,6 +1979,7 @@ function CrisCoMatrixListsTie({
|
|
|
1738
1979
|
0 && (module.exports = {
|
|
1739
1980
|
CrisButton,
|
|
1740
1981
|
CrisCoDebug,
|
|
1982
|
+
CrisCoList,
|
|
1741
1983
|
CrisCoMatrixListsTie,
|
|
1742
1984
|
CrisGauge,
|
|
1743
1985
|
CrisOfflinePage,
|