@imperosoft/cris-webui-components 1.1.2-beta.13 → 1.1.2-beta.14

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.js CHANGED
@@ -1347,12 +1347,25 @@ function CrisCoDebug({
1347
1347
  // src/components/CrisCoMatrixListsTie.tsx
1348
1348
  var import_cris_webui_ch5_core8 = require("@imperosoft/cris-webui-ch5-core");
1349
1349
  var import_jsx_runtime8 = require("react/jsx-runtime");
1350
+ var colors = {
1351
+ itemBg: "#4f5152",
1352
+ itemActiveBg: "#007ca0",
1353
+ vmActiveBg: "#dc2626",
1354
+ text: "#ffffff",
1355
+ headerText: "#6b7280",
1356
+ ioOn: "#4caf50",
1357
+ ioOff: "#f44336",
1358
+ sgOn: "#2196f3",
1359
+ sgOff: "#666666"
1360
+ };
1350
1361
  var defaults = {
1351
1362
  container: {
1352
1363
  display: "flex",
1353
1364
  flexDirection: "row",
1354
- gap: 8,
1355
- height: "100%"
1365
+ gap: "1.5rem",
1366
+ padding: "1rem 2rem",
1367
+ height: "100%",
1368
+ width: "100%"
1356
1369
  },
1357
1370
  list: {
1358
1371
  flex: 1,
@@ -1362,57 +1375,125 @@ var defaults = {
1362
1375
  minHeight: 0
1363
1376
  },
1364
1377
  header: {
1365
- fontSize: 13,
1366
- fontWeight: 600,
1367
- padding: "6px 10px",
1378
+ fontSize: "1.5em",
1379
+ fontWeight: 700,
1380
+ padding: "0.5rem 0.75rem",
1368
1381
  textTransform: "uppercase",
1369
- opacity: 0.6,
1370
- flexShrink: 0
1382
+ letterSpacing: "0.05em",
1383
+ color: colors.headerText,
1384
+ flexShrink: 0,
1385
+ textAlign: "center"
1371
1386
  },
1372
1387
  scroll: {
1373
1388
  flex: 1,
1374
1389
  minHeight: 0,
1375
1390
  overflow: "auto",
1391
+ scrollbarWidth: "none",
1376
1392
  WebkitOverflowScrolling: "touch",
1377
1393
  display: "flex",
1378
1394
  flexDirection: "column",
1379
- gap: 2
1395
+ gap: "0.15rem"
1380
1396
  },
1381
1397
  item: {
1382
1398
  display: "flex",
1383
- alignItems: "center",
1384
- gap: 6,
1385
- padding: "6px 10px",
1386
- minHeight: 40,
1399
+ alignItems: "stretch",
1400
+ gap: "0.5rem",
1401
+ padding: "0 0.4rem 0 0",
1402
+ minHeight: "3.7rem",
1387
1403
  cursor: "pointer",
1388
- userSelect: "none"
1404
+ userSelect: "none",
1405
+ background: colors.itemBg,
1406
+ borderRadius: "0.5rem",
1407
+ transition: "background 0.15s"
1408
+ },
1409
+ itemActive: {
1410
+ background: colors.itemActiveBg
1411
+ },
1412
+ itemBtn: {
1413
+ flex: 1,
1414
+ minWidth: 0,
1415
+ background: "transparent",
1416
+ border: "none",
1417
+ padding: "0.5rem 0.9rem",
1418
+ textAlign: "left",
1419
+ color: colors.text,
1420
+ height: "100%",
1421
+ borderRadius: "0.5rem",
1422
+ cursor: "pointer"
1423
+ },
1424
+ itemBtnInner: {
1425
+ display: "flex",
1426
+ alignItems: "center",
1427
+ gap: "0.4rem",
1428
+ width: "100%"
1429
+ },
1430
+ channelNum: {
1431
+ flexShrink: 0,
1432
+ opacity: 0.6,
1433
+ minWidth: "1.7em",
1434
+ textAlign: "right",
1435
+ fontWeight: 400,
1436
+ marginRight: "0.4em"
1389
1437
  },
1390
1438
  itemLabel: {
1391
1439
  flex: 1,
1392
- fontSize: 13,
1440
+ fontSize: "1.4em",
1441
+ fontWeight: 700,
1393
1442
  whiteSpace: "nowrap",
1394
1443
  overflow: "hidden",
1395
- textOverflow: "ellipsis"
1444
+ textOverflow: "ellipsis",
1445
+ color: colors.text
1396
1446
  },
1397
1447
  indicators: {
1398
1448
  display: "flex",
1399
- gap: 4,
1449
+ gap: "0.25rem",
1400
1450
  alignItems: "center"
1401
1451
  },
1402
1452
  indicator: {
1403
- width: 8,
1404
- height: 8,
1453
+ width: "1rem",
1454
+ height: "1rem",
1405
1455
  borderRadius: "50%",
1406
1456
  flexShrink: 0
1457
+ },
1458
+ vmBtn: {
1459
+ flexShrink: 0,
1460
+ alignSelf: "stretch",
1461
+ display: "flex",
1462
+ alignItems: "center",
1463
+ background: colors.itemBg,
1464
+ color: colors.text,
1465
+ border: "none",
1466
+ borderRadius: "0.4rem",
1467
+ padding: "0 0.6rem",
1468
+ margin: "0.3rem 0.3rem 0.3rem 0",
1469
+ fontSize: "0.85em",
1470
+ fontWeight: 700,
1471
+ cursor: "pointer",
1472
+ transition: "background 0.15s"
1473
+ },
1474
+ vmBtnActive: {
1475
+ background: colors.vmActiveBg,
1476
+ color: colors.text
1407
1477
  }
1408
1478
  };
1479
+ var SCROLLBAR_CSS = `
1480
+ .cris-co-matrix-scroll::-webkit-scrollbar { display: none; }
1481
+ `;
1482
+ var scrollbarStyleInjected = false;
1483
+ function injectScrollbarStyle() {
1484
+ if (scrollbarStyleInjected) return;
1485
+ scrollbarStyleInjected = true;
1486
+ const style = document.createElement("style");
1487
+ style.textContent = SCROLLBAR_CSS;
1488
+ document.head.appendChild(style);
1489
+ }
1409
1490
  function DefaultIoIndicator({ on }) {
1410
1491
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1411
1492
  "div",
1412
1493
  {
1413
1494
  style: {
1414
1495
  ...defaults.indicator,
1415
- backgroundColor: on ? "#4caf50" : "#f44336"
1496
+ backgroundColor: on ? colors.ioOn : colors.ioOff
1416
1497
  },
1417
1498
  title: on ? "Online" : "Offline"
1418
1499
  }
@@ -1424,7 +1505,7 @@ function DefaultSignalIndicator({ on }) {
1424
1505
  {
1425
1506
  style: {
1426
1507
  ...defaults.indicator,
1427
- backgroundColor: on ? "#2196f3" : "#666"
1508
+ backgroundColor: on ? colors.sgOn : colors.sgOff
1428
1509
  },
1429
1510
  title: on ? "Signal detected" : "No signal"
1430
1511
  }
@@ -1450,18 +1531,19 @@ function MatrixItemRow({
1450
1531
  }) {
1451
1532
  const isActive = active;
1452
1533
  const isEnabled = item.sl.en;
1534
+ const useDefaults = !itemClassName;
1453
1535
  const classes = [
1454
1536
  "cris-co-matrix-item",
1455
1537
  itemClassName,
1456
1538
  isActive && (itemActiveClassName || "active"),
1457
1539
  !isEnabled && (itemDisabledClassName || "disabled")
1458
1540
  ].filter(Boolean).join(" ");
1459
- const computedStyle = itemClassName ? { ...itemStyleProp } : {
1541
+ const computedStyle = useDefaults ? {
1460
1542
  ...defaults.item,
1461
1543
  ...itemStyleProp,
1462
- ...isActive ? itemActiveStyle : void 0,
1544
+ ...isActive ? { ...defaults.itemActive, ...itemActiveStyle } : void 0,
1463
1545
  opacity: isEnabled ? 1 : 0.4
1464
- };
1546
+ } : { ...itemStyleProp };
1465
1547
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: classes, style: computedStyle, children: [
1466
1548
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1467
1549
  CrisButton,
@@ -1469,19 +1551,40 @@ function MatrixItemRow({
1469
1551
  selected: isActive,
1470
1552
  enabled: isEnabled,
1471
1553
  onPress: onSelect,
1472
- className: `cris-co-matrix-item-btn ${itemActiveClassName ?? ""}`,
1473
- classActive: itemActiveClassName,
1474
- children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: 6, width: "100%" }, children: [
1475
- showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: { flexShrink: 0, opacity: 0.6 }, children: item.id }),
1554
+ className: itemClassName ? `cris-co-matrix-item-btn ${itemActiveClassName ?? ""}` : void 0,
1555
+ classActive: itemClassName ? itemActiveClassName : void 0,
1556
+ children: useDefaults ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.itemBtnInner, children: [
1557
+ showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: defaults.channelNum, children: item.id }),
1476
1558
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: defaults.itemLabel, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.id}` }),
1477
1559
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.indicators, children: [
1478
1560
  item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultIoIndicator, { on: item.io.on })),
1479
1561
  item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
1480
1562
  ] })
1563
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "0.4rem", width: "100%" }, children: [
1564
+ showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: { flexShrink: 0, opacity: 0.6 }, children: item.id }),
1565
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: { flex: 1, whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.id}` }),
1566
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.indicators, children: [
1567
+ item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultIoIndicator, { on: item.io.on })),
1568
+ item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
1569
+ ] })
1481
1570
  ] })
1482
1571
  }
1483
1572
  ),
1484
- item.vm.vs && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1573
+ item.vm.vs && (useDefaults && !vmButtonClassName ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: {
1574
+ ...defaults.vmBtn,
1575
+ ...item.vm.on ? defaults.vmBtnActive : void 0,
1576
+ opacity: item.vm.en ? 1 : 0.4,
1577
+ pointerEvents: item.vm.en ? "auto" : "none"
1578
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1579
+ CrisButton,
1580
+ {
1581
+ selected: item.vm.on,
1582
+ enabled: item.vm.en,
1583
+ text: vmText,
1584
+ onPress: onToggleVideoMute,
1585
+ showLocalFeedback: false
1586
+ }
1587
+ ) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1485
1588
  CrisButton,
1486
1589
  {
1487
1590
  selected: item.vm.on,
@@ -1491,7 +1594,7 @@ function MatrixItemRow({
1491
1594
  className: vmButtonClassName,
1492
1595
  classActive: vmButtonActiveClassName
1493
1596
  }
1494
- )
1597
+ ))
1495
1598
  ] });
1496
1599
  }
1497
1600
  function CrisCoMatrixListsTie({
@@ -1518,6 +1621,7 @@ function CrisCoMatrixListsTie({
1518
1621
  }) {
1519
1622
  const matrix = (0, import_cris_webui_ch5_core8.useCustomObject)(oid);
1520
1623
  const send = (0, import_cris_webui_ch5_core8.useCustomObjectSend)();
1624
+ injectScrollbarStyle();
1521
1625
  if (!matrix) return null;
1522
1626
  const { si, ip: inputs, op: outputs } = matrix;
1523
1627
  const handleSelectInput = (id) => {
@@ -1549,7 +1653,7 @@ function CrisCoMatrixListsTie({
1549
1653
  children: inputTitle
1550
1654
  }
1551
1655
  ),
1552
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: defaults.scroll, children: inputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1656
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "cris-co-matrix-scroll", style: defaults.scroll, children: inputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1553
1657
  MatrixItemRow,
1554
1658
  {
1555
1659
  item,
@@ -1588,7 +1692,7 @@ function CrisCoMatrixListsTie({
1588
1692
  children: outputTitle
1589
1693
  }
1590
1694
  ),
1591
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: defaults.scroll, children: outputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1695
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "cris-co-matrix-scroll", style: defaults.scroll, children: outputs?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1592
1696
  MatrixItemRow,
1593
1697
  {
1594
1698
  item,