@imperosoft/cris-webui-components 1.1.2-beta.2 → 1.1.2-beta.20
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 +78 -1
- package/dist/index.d.ts +78 -1
- package/dist/index.js +416 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +415 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -314,6 +314,83 @@ 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 an input or output item from the backend */
|
|
318
|
+
interface MatrixItem {
|
|
319
|
+
id: number;
|
|
320
|
+
lb: string;
|
|
321
|
+
gp: number;
|
|
322
|
+
/** Selection state: en=enabled, vs=visible */
|
|
323
|
+
sl: {
|
|
324
|
+
en: boolean;
|
|
325
|
+
vs: boolean;
|
|
326
|
+
};
|
|
327
|
+
/** Tied input id (outputs only) — which input is routed to this output */
|
|
328
|
+
ti?: number;
|
|
329
|
+
io: {
|
|
330
|
+
on: boolean;
|
|
331
|
+
vs: boolean;
|
|
332
|
+
};
|
|
333
|
+
sg: {
|
|
334
|
+
on: boolean;
|
|
335
|
+
vs: boolean;
|
|
336
|
+
};
|
|
337
|
+
vm: {
|
|
338
|
+
on: boolean;
|
|
339
|
+
en: boolean;
|
|
340
|
+
vs: boolean;
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
/** Shape of the matrix status from the backend */
|
|
344
|
+
interface MatrixStatus {
|
|
345
|
+
/** Selected input id (exclusive selection) */
|
|
346
|
+
si: number;
|
|
347
|
+
ip: MatrixItem[];
|
|
348
|
+
op: MatrixItem[];
|
|
349
|
+
}
|
|
350
|
+
interface CrisCoMatrixListsTieProps {
|
|
351
|
+
/** Custom object ID (e.g., "MTX1_VID") */
|
|
352
|
+
oid: string;
|
|
353
|
+
/** Input list title */
|
|
354
|
+
inputTitle?: string;
|
|
355
|
+
/** Output list title */
|
|
356
|
+
outputTitle?: string;
|
|
357
|
+
/** Container className */
|
|
358
|
+
className?: string;
|
|
359
|
+
/** Container style */
|
|
360
|
+
style?: CSSProperties;
|
|
361
|
+
/** List column className */
|
|
362
|
+
listClassName?: string;
|
|
363
|
+
/** List column style */
|
|
364
|
+
listStyle?: CSSProperties;
|
|
365
|
+
/** List header className */
|
|
366
|
+
headerClassName?: string;
|
|
367
|
+
/** List header style */
|
|
368
|
+
headerStyle?: CSSProperties;
|
|
369
|
+
/** Item className */
|
|
370
|
+
itemClassName?: string;
|
|
371
|
+
/** Item style */
|
|
372
|
+
itemStyle?: CSSProperties;
|
|
373
|
+
/** Item active (selected/tied) className */
|
|
374
|
+
itemActiveClassName?: string;
|
|
375
|
+
/** Item active style */
|
|
376
|
+
itemActiveStyle?: CSSProperties;
|
|
377
|
+
/** Item disabled className */
|
|
378
|
+
itemDisabledClassName?: string;
|
|
379
|
+
/** Video mute button text (default: "Mute") */
|
|
380
|
+
vmText?: string;
|
|
381
|
+
/** Video mute button className */
|
|
382
|
+
vmButtonClassName?: string;
|
|
383
|
+
/** Video mute button active className */
|
|
384
|
+
vmButtonActiveClassName?: string;
|
|
385
|
+
/** Show channel number prefix before label (default: true) */
|
|
386
|
+
showChannels?: boolean;
|
|
387
|
+
/** Custom render for I/O online indicator */
|
|
388
|
+
renderIoIndicator?: (on: boolean) => ReactNode;
|
|
389
|
+
/** Custom render for signal indicator */
|
|
390
|
+
renderSignalIndicator?: (on: boolean) => ReactNode;
|
|
391
|
+
}
|
|
392
|
+
declare function CrisCoMatrixListsTie({ oid, inputTitle, outputTitle, showChannels, className, style, listClassName, listStyle, headerClassName, headerStyle, itemClassName, itemStyle, itemActiveClassName, itemActiveStyle, itemDisabledClassName, vmText, vmButtonClassName, vmButtonActiveClassName, renderIoIndicator, renderSignalIndicator, }: CrisCoMatrixListsTieProps): react_jsx_runtime.JSX.Element | null;
|
|
393
|
+
|
|
317
394
|
/**
|
|
318
395
|
* Icon configuration and utilities for CRIS components
|
|
319
396
|
*
|
|
@@ -364,4 +441,4 @@ declare function getIconUrl(name: string): string;
|
|
|
364
441
|
*/
|
|
365
442
|
declare function getIconFilter(active: boolean): string | undefined;
|
|
366
443
|
|
|
367
|
-
export { CrisButton, type CrisButtonProps, CrisCoDebug, type CrisCoDebugProps, CrisGauge, type CrisGaugeProps, CrisOfflinePage, type CrisOfflinePageProps, CrisSlider, type CrisSliderProps, CrisSpinner, type CrisSpinnerProps, CrisText, type CrisTextProps, type DebugModule, type IconConfig, type SpinnerSpeed, configureIcons, getIconConfig, getIconFilter, getIconUrl };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -314,6 +314,83 @@ 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 an input or output item from the backend */
|
|
318
|
+
interface MatrixItem {
|
|
319
|
+
id: number;
|
|
320
|
+
lb: string;
|
|
321
|
+
gp: number;
|
|
322
|
+
/** Selection state: en=enabled, vs=visible */
|
|
323
|
+
sl: {
|
|
324
|
+
en: boolean;
|
|
325
|
+
vs: boolean;
|
|
326
|
+
};
|
|
327
|
+
/** Tied input id (outputs only) — which input is routed to this output */
|
|
328
|
+
ti?: number;
|
|
329
|
+
io: {
|
|
330
|
+
on: boolean;
|
|
331
|
+
vs: boolean;
|
|
332
|
+
};
|
|
333
|
+
sg: {
|
|
334
|
+
on: boolean;
|
|
335
|
+
vs: boolean;
|
|
336
|
+
};
|
|
337
|
+
vm: {
|
|
338
|
+
on: boolean;
|
|
339
|
+
en: boolean;
|
|
340
|
+
vs: boolean;
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
/** Shape of the matrix status from the backend */
|
|
344
|
+
interface MatrixStatus {
|
|
345
|
+
/** Selected input id (exclusive selection) */
|
|
346
|
+
si: number;
|
|
347
|
+
ip: MatrixItem[];
|
|
348
|
+
op: MatrixItem[];
|
|
349
|
+
}
|
|
350
|
+
interface CrisCoMatrixListsTieProps {
|
|
351
|
+
/** Custom object ID (e.g., "MTX1_VID") */
|
|
352
|
+
oid: string;
|
|
353
|
+
/** Input list title */
|
|
354
|
+
inputTitle?: string;
|
|
355
|
+
/** Output list title */
|
|
356
|
+
outputTitle?: string;
|
|
357
|
+
/** Container className */
|
|
358
|
+
className?: string;
|
|
359
|
+
/** Container style */
|
|
360
|
+
style?: CSSProperties;
|
|
361
|
+
/** List column className */
|
|
362
|
+
listClassName?: string;
|
|
363
|
+
/** List column style */
|
|
364
|
+
listStyle?: CSSProperties;
|
|
365
|
+
/** List header className */
|
|
366
|
+
headerClassName?: string;
|
|
367
|
+
/** List header style */
|
|
368
|
+
headerStyle?: CSSProperties;
|
|
369
|
+
/** Item className */
|
|
370
|
+
itemClassName?: string;
|
|
371
|
+
/** Item style */
|
|
372
|
+
itemStyle?: CSSProperties;
|
|
373
|
+
/** Item active (selected/tied) className */
|
|
374
|
+
itemActiveClassName?: string;
|
|
375
|
+
/** Item active style */
|
|
376
|
+
itemActiveStyle?: CSSProperties;
|
|
377
|
+
/** Item disabled className */
|
|
378
|
+
itemDisabledClassName?: string;
|
|
379
|
+
/** Video mute button text (default: "Mute") */
|
|
380
|
+
vmText?: string;
|
|
381
|
+
/** Video mute button className */
|
|
382
|
+
vmButtonClassName?: string;
|
|
383
|
+
/** Video mute button active className */
|
|
384
|
+
vmButtonActiveClassName?: string;
|
|
385
|
+
/** Show channel number prefix before label (default: true) */
|
|
386
|
+
showChannels?: boolean;
|
|
387
|
+
/** Custom render for I/O online indicator */
|
|
388
|
+
renderIoIndicator?: (on: boolean) => ReactNode;
|
|
389
|
+
/** Custom render for signal indicator */
|
|
390
|
+
renderSignalIndicator?: (on: boolean) => ReactNode;
|
|
391
|
+
}
|
|
392
|
+
declare function CrisCoMatrixListsTie({ oid, inputTitle, outputTitle, showChannels, className, style, listClassName, listStyle, headerClassName, headerStyle, itemClassName, itemStyle, itemActiveClassName, itemActiveStyle, itemDisabledClassName, vmText, vmButtonClassName, vmButtonActiveClassName, renderIoIndicator, renderSignalIndicator, }: CrisCoMatrixListsTieProps): react_jsx_runtime.JSX.Element | null;
|
|
393
|
+
|
|
317
394
|
/**
|
|
318
395
|
* Icon configuration and utilities for CRIS components
|
|
319
396
|
*
|
|
@@ -364,4 +441,4 @@ declare function getIconUrl(name: string): string;
|
|
|
364
441
|
*/
|
|
365
442
|
declare function getIconFilter(active: boolean): string | undefined;
|
|
366
443
|
|
|
367
|
-
export { CrisButton, type CrisButtonProps, CrisCoDebug, type CrisCoDebugProps, CrisGauge, type CrisGaugeProps, CrisOfflinePage, type CrisOfflinePageProps, CrisSlider, type CrisSliderProps, CrisSpinner, type CrisSpinnerProps, CrisText, type CrisTextProps, type DebugModule, type IconConfig, type SpinnerSpeed, configureIcons, getIconConfig, getIconFilter, getIconUrl };
|
|
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 };
|
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
|
+
CrisCoMatrixListsTie: () => CrisCoMatrixListsTie,
|
|
25
26
|
CrisGauge: () => CrisGauge,
|
|
26
27
|
CrisOfflinePage: () => CrisOfflinePage,
|
|
27
28
|
CrisSlider: () => CrisSlider,
|
|
@@ -136,6 +137,8 @@ function CrisButton({
|
|
|
136
137
|
const pressedRef = (0, import_react.useRef)(false);
|
|
137
138
|
const touchingRef = (0, import_react.useRef)(false);
|
|
138
139
|
const touchStartedHereRef = (0, import_react.useRef)(false);
|
|
140
|
+
const touchStartYRef = (0, import_react.useRef)(0);
|
|
141
|
+
const touchMovedRef = (0, import_react.useRef)(false);
|
|
139
142
|
const feedbackJoin = joinFeedback ?? join;
|
|
140
143
|
const feedback = (0, import_cris_webui_ch5_core.useDigital)(feedbackJoin ?? 0);
|
|
141
144
|
const enabledJoin = (0, import_cris_webui_ch5_core.useDigital)(joinEnable ?? 0);
|
|
@@ -218,30 +221,42 @@ function CrisButton({
|
|
|
218
221
|
dSet(join, false);
|
|
219
222
|
}
|
|
220
223
|
};
|
|
221
|
-
const
|
|
224
|
+
const SCROLL_THRESHOLD = 8;
|
|
225
|
+
const handleTouchStart = (e) => {
|
|
222
226
|
log("handleTouchStart");
|
|
223
227
|
touchStart();
|
|
224
228
|
touchingRef.current = true;
|
|
225
229
|
touchStartedHereRef.current = true;
|
|
226
|
-
|
|
230
|
+
touchMovedRef.current = false;
|
|
231
|
+
touchStartYRef.current = e.touches[0]?.clientY ?? 0;
|
|
232
|
+
};
|
|
233
|
+
const handleTouchMove = (e) => {
|
|
234
|
+
if (touchMovedRef.current) return;
|
|
235
|
+
const dy = Math.abs((e.touches[0]?.clientY ?? 0) - touchStartYRef.current);
|
|
236
|
+
if (dy > SCROLL_THRESHOLD) {
|
|
237
|
+
touchMovedRef.current = true;
|
|
238
|
+
log("touchMove: scroll detected, dy:", dy);
|
|
239
|
+
}
|
|
227
240
|
};
|
|
228
241
|
const handleTouchEnd = () => {
|
|
229
|
-
log("handleTouchEnd", {
|
|
242
|
+
log("handleTouchEnd", { touchStartedHere: touchStartedHereRef.current, moved: touchMovedRef.current });
|
|
230
243
|
touchEnd();
|
|
231
244
|
touchingRef.current = true;
|
|
232
|
-
if (touchStartedHereRef.current) {
|
|
245
|
+
if (touchStartedHereRef.current && !touchMovedRef.current) {
|
|
233
246
|
touchStartedHereRef.current = false;
|
|
247
|
+
handlePress();
|
|
234
248
|
handleRelease();
|
|
235
249
|
} else {
|
|
236
|
-
|
|
250
|
+
touchStartedHereRef.current = false;
|
|
251
|
+
log("SKIPPED: touch moved or did not start here");
|
|
237
252
|
}
|
|
238
253
|
};
|
|
239
254
|
const handleTouchCancel = () => {
|
|
240
|
-
log("handleTouchCancel");
|
|
255
|
+
log("handleTouchCancel (scroll detected)");
|
|
241
256
|
touchEnd();
|
|
242
257
|
touchingRef.current = true;
|
|
243
258
|
touchStartedHereRef.current = false;
|
|
244
|
-
|
|
259
|
+
touchMovedRef.current = false;
|
|
245
260
|
};
|
|
246
261
|
const handleMouseDown = () => {
|
|
247
262
|
if (isTouchActive() || touchingRef.current) return;
|
|
@@ -342,7 +357,7 @@ function CrisButton({
|
|
|
342
357
|
cursor: suppressKeyClicks ? "default" : "pointer",
|
|
343
358
|
position: isFreePositioned ? void 0 : "relative",
|
|
344
359
|
overflow: isFreePositioned ? void 0 : "hidden",
|
|
345
|
-
touchAction: "
|
|
360
|
+
touchAction: "pan-x pan-y",
|
|
346
361
|
userSelect: "none",
|
|
347
362
|
WebkitUserSelect: "none"
|
|
348
363
|
},
|
|
@@ -350,6 +365,7 @@ function CrisButton({
|
|
|
350
365
|
onMouseUp: handleMouseUp,
|
|
351
366
|
onMouseLeave: handleMouseLeave,
|
|
352
367
|
onTouchStart: handleTouchStart,
|
|
368
|
+
onTouchMove: handleTouchMove,
|
|
353
369
|
onTouchEnd: handleTouchEnd,
|
|
354
370
|
onTouchCancel: handleTouchCancel,
|
|
355
371
|
children: [
|
|
@@ -1327,10 +1343,402 @@ function CrisCoDebug({
|
|
|
1327
1343
|
}
|
|
1328
1344
|
);
|
|
1329
1345
|
}
|
|
1346
|
+
|
|
1347
|
+
// src/components/CrisCoMatrixListsTie.tsx
|
|
1348
|
+
var import_cris_webui_ch5_core8 = require("@imperosoft/cris-webui-ch5-core");
|
|
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
|
+
};
|
|
1361
|
+
var defaults = {
|
|
1362
|
+
container: {
|
|
1363
|
+
display: "flex",
|
|
1364
|
+
flexDirection: "row",
|
|
1365
|
+
gap: "1.5rem",
|
|
1366
|
+
padding: "1rem 2rem",
|
|
1367
|
+
height: "100%",
|
|
1368
|
+
width: "100%"
|
|
1369
|
+
},
|
|
1370
|
+
list: {
|
|
1371
|
+
flex: 1,
|
|
1372
|
+
display: "flex",
|
|
1373
|
+
flexDirection: "column",
|
|
1374
|
+
overflow: "hidden",
|
|
1375
|
+
minHeight: 0
|
|
1376
|
+
},
|
|
1377
|
+
header: {
|
|
1378
|
+
fontSize: "1.5em",
|
|
1379
|
+
fontWeight: 700,
|
|
1380
|
+
padding: "0.5rem 0.75rem",
|
|
1381
|
+
textTransform: "uppercase",
|
|
1382
|
+
letterSpacing: "0.05em",
|
|
1383
|
+
color: colors.headerText,
|
|
1384
|
+
flexShrink: 0,
|
|
1385
|
+
textAlign: "center"
|
|
1386
|
+
},
|
|
1387
|
+
scroll: {
|
|
1388
|
+
flex: 1,
|
|
1389
|
+
minHeight: 0,
|
|
1390
|
+
overflow: "auto",
|
|
1391
|
+
scrollbarWidth: "none",
|
|
1392
|
+
WebkitOverflowScrolling: "touch",
|
|
1393
|
+
display: "flex",
|
|
1394
|
+
flexDirection: "column",
|
|
1395
|
+
gap: "0.15rem"
|
|
1396
|
+
},
|
|
1397
|
+
item: {
|
|
1398
|
+
display: "flex",
|
|
1399
|
+
alignItems: "stretch",
|
|
1400
|
+
gap: "0.5rem",
|
|
1401
|
+
padding: "0 0.4rem 0 0",
|
|
1402
|
+
minHeight: "3.7rem",
|
|
1403
|
+
cursor: "pointer",
|
|
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
|
+
display: "flex",
|
|
1416
|
+
alignItems: "stretch",
|
|
1417
|
+
background: "transparent",
|
|
1418
|
+
border: "none",
|
|
1419
|
+
textAlign: "left",
|
|
1420
|
+
color: colors.text,
|
|
1421
|
+
height: "100%",
|
|
1422
|
+
borderRadius: "0.5rem",
|
|
1423
|
+
cursor: "pointer"
|
|
1424
|
+
},
|
|
1425
|
+
itemBtnInner: {
|
|
1426
|
+
display: "flex",
|
|
1427
|
+
alignItems: "center",
|
|
1428
|
+
gap: "0.4rem",
|
|
1429
|
+
width: "100%",
|
|
1430
|
+
flex: 1,
|
|
1431
|
+
padding: "0.5rem 0.9rem"
|
|
1432
|
+
},
|
|
1433
|
+
channelNum: {
|
|
1434
|
+
flexShrink: 0,
|
|
1435
|
+
opacity: 0.6,
|
|
1436
|
+
minWidth: "1.7em",
|
|
1437
|
+
textAlign: "right",
|
|
1438
|
+
fontWeight: 400,
|
|
1439
|
+
marginRight: "0.4em"
|
|
1440
|
+
},
|
|
1441
|
+
itemLabel: {
|
|
1442
|
+
flex: 1,
|
|
1443
|
+
fontSize: "1.4em",
|
|
1444
|
+
fontWeight: 700,
|
|
1445
|
+
whiteSpace: "nowrap",
|
|
1446
|
+
overflow: "hidden",
|
|
1447
|
+
textOverflow: "ellipsis",
|
|
1448
|
+
color: colors.text
|
|
1449
|
+
},
|
|
1450
|
+
indicators: {
|
|
1451
|
+
display: "flex",
|
|
1452
|
+
gap: "0.25rem",
|
|
1453
|
+
alignItems: "center"
|
|
1454
|
+
},
|
|
1455
|
+
indicator: {
|
|
1456
|
+
width: "1rem",
|
|
1457
|
+
height: "1rem",
|
|
1458
|
+
borderRadius: "50%",
|
|
1459
|
+
flexShrink: 0
|
|
1460
|
+
},
|
|
1461
|
+
vmBtn: {
|
|
1462
|
+
flexShrink: 0,
|
|
1463
|
+
alignSelf: "stretch",
|
|
1464
|
+
display: "flex",
|
|
1465
|
+
alignItems: "center",
|
|
1466
|
+
background: colors.itemBg,
|
|
1467
|
+
color: colors.text,
|
|
1468
|
+
border: "none",
|
|
1469
|
+
borderRadius: "0.4rem",
|
|
1470
|
+
padding: "0 0.6rem",
|
|
1471
|
+
margin: "0.3rem 0.3rem 0.3rem 0",
|
|
1472
|
+
fontSize: "0.85em",
|
|
1473
|
+
fontWeight: 700,
|
|
1474
|
+
cursor: "pointer",
|
|
1475
|
+
transition: "background 0.15s"
|
|
1476
|
+
},
|
|
1477
|
+
vmBtnActive: {
|
|
1478
|
+
background: colors.vmActiveBg,
|
|
1479
|
+
color: colors.text
|
|
1480
|
+
}
|
|
1481
|
+
};
|
|
1482
|
+
var INJECTED_CSS = `
|
|
1483
|
+
.cris-co-matrix-scroll::-webkit-scrollbar { display: none; }
|
|
1484
|
+
.cris-co-matrix-item > div:first-child > .cris-button { width: 100%; height: 100%; }
|
|
1485
|
+
`;
|
|
1486
|
+
var scrollbarStyleInjected = false;
|
|
1487
|
+
function injectScrollbarStyle() {
|
|
1488
|
+
if (scrollbarStyleInjected) return;
|
|
1489
|
+
scrollbarStyleInjected = true;
|
|
1490
|
+
const style = document.createElement("style");
|
|
1491
|
+
style.textContent = INJECTED_CSS;
|
|
1492
|
+
document.head.appendChild(style);
|
|
1493
|
+
}
|
|
1494
|
+
function DefaultIoIndicator({ on }) {
|
|
1495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1496
|
+
"div",
|
|
1497
|
+
{
|
|
1498
|
+
style: {
|
|
1499
|
+
...defaults.indicator,
|
|
1500
|
+
backgroundColor: on ? colors.ioOn : colors.ioOff
|
|
1501
|
+
},
|
|
1502
|
+
title: on ? "Online" : "Offline"
|
|
1503
|
+
}
|
|
1504
|
+
);
|
|
1505
|
+
}
|
|
1506
|
+
function DefaultSignalIndicator({ on }) {
|
|
1507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1508
|
+
"div",
|
|
1509
|
+
{
|
|
1510
|
+
style: {
|
|
1511
|
+
...defaults.indicator,
|
|
1512
|
+
backgroundColor: on ? colors.sgOn : colors.sgOff
|
|
1513
|
+
},
|
|
1514
|
+
title: on ? "Signal detected" : "No signal"
|
|
1515
|
+
}
|
|
1516
|
+
);
|
|
1517
|
+
}
|
|
1518
|
+
function MatrixItemRow({
|
|
1519
|
+
item,
|
|
1520
|
+
type,
|
|
1521
|
+
active,
|
|
1522
|
+
showChannels,
|
|
1523
|
+
vmText,
|
|
1524
|
+
onSelect,
|
|
1525
|
+
onToggleVideoMute,
|
|
1526
|
+
itemClassName,
|
|
1527
|
+
itemStyle: itemStyleProp,
|
|
1528
|
+
itemActiveClassName,
|
|
1529
|
+
itemActiveStyle,
|
|
1530
|
+
itemDisabledClassName,
|
|
1531
|
+
vmButtonClassName,
|
|
1532
|
+
vmButtonActiveClassName,
|
|
1533
|
+
renderIoIndicator,
|
|
1534
|
+
renderSignalIndicator
|
|
1535
|
+
}) {
|
|
1536
|
+
const isActive = active;
|
|
1537
|
+
const isEnabled = item.sl.en;
|
|
1538
|
+
const useDefaults = !itemClassName;
|
|
1539
|
+
const classes = [
|
|
1540
|
+
"cris-co-matrix-item",
|
|
1541
|
+
itemClassName,
|
|
1542
|
+
isActive && (itemActiveClassName || "active"),
|
|
1543
|
+
!isEnabled && (itemDisabledClassName || "disabled")
|
|
1544
|
+
].filter(Boolean).join(" ");
|
|
1545
|
+
const computedStyle = useDefaults ? {
|
|
1546
|
+
...defaults.item,
|
|
1547
|
+
...itemStyleProp,
|
|
1548
|
+
...isActive ? { ...defaults.itemActive, ...itemActiveStyle } : void 0,
|
|
1549
|
+
opacity: isEnabled ? 1 : 0.4
|
|
1550
|
+
} : { ...itemStyleProp };
|
|
1551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: classes, style: computedStyle, children: [
|
|
1552
|
+
useDefaults ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: defaults.itemBtn, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1553
|
+
CrisButton,
|
|
1554
|
+
{
|
|
1555
|
+
selected: isActive,
|
|
1556
|
+
enabled: isEnabled,
|
|
1557
|
+
onPress: onSelect,
|
|
1558
|
+
showLocalFeedback: false,
|
|
1559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.itemBtnInner, children: [
|
|
1560
|
+
showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: defaults.channelNum, children: item.id }),
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { style: defaults.itemLabel, children: item.lb || `${type === "input" ? "Input" : "Output"} ${item.id}` }),
|
|
1562
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.indicators, children: [
|
|
1563
|
+
item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultIoIndicator, { on: item.io.on })),
|
|
1564
|
+
item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
|
|
1565
|
+
] })
|
|
1566
|
+
] })
|
|
1567
|
+
}
|
|
1568
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1569
|
+
CrisButton,
|
|
1570
|
+
{
|
|
1571
|
+
selected: isActive,
|
|
1572
|
+
enabled: isEnabled,
|
|
1573
|
+
onPress: onSelect,
|
|
1574
|
+
className: `cris-co-matrix-item-btn ${itemActiveClassName ?? ""}`,
|
|
1575
|
+
classActive: itemActiveClassName,
|
|
1576
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "0.4rem", width: "100%" }, children: [
|
|
1577
|
+
showChannels && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "cris-co-matrix-ch", style: { flexShrink: 0, opacity: 0.6 }, children: item.id }),
|
|
1578
|
+
/* @__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}` }),
|
|
1579
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { style: defaults.indicators, children: [
|
|
1580
|
+
item.io.vs && (renderIoIndicator ? renderIoIndicator(item.io.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultIoIndicator, { on: item.io.on })),
|
|
1581
|
+
item.sg.vs && (renderSignalIndicator ? renderSignalIndicator(item.sg.on) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DefaultSignalIndicator, { on: item.sg.on }))
|
|
1582
|
+
] })
|
|
1583
|
+
] })
|
|
1584
|
+
}
|
|
1585
|
+
),
|
|
1586
|
+
item.vm.vs && (useDefaults && !vmButtonClassName ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { style: {
|
|
1587
|
+
...defaults.vmBtn,
|
|
1588
|
+
...item.vm.on ? defaults.vmBtnActive : void 0,
|
|
1589
|
+
opacity: item.vm.en ? 1 : 0.4,
|
|
1590
|
+
pointerEvents: item.vm.en ? "auto" : "none"
|
|
1591
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1592
|
+
CrisButton,
|
|
1593
|
+
{
|
|
1594
|
+
selected: item.vm.on,
|
|
1595
|
+
enabled: item.vm.en,
|
|
1596
|
+
text: vmText,
|
|
1597
|
+
onPress: onToggleVideoMute,
|
|
1598
|
+
showLocalFeedback: false
|
|
1599
|
+
}
|
|
1600
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1601
|
+
CrisButton,
|
|
1602
|
+
{
|
|
1603
|
+
selected: item.vm.on,
|
|
1604
|
+
enabled: item.vm.en,
|
|
1605
|
+
text: vmText,
|
|
1606
|
+
onPress: onToggleVideoMute,
|
|
1607
|
+
className: vmButtonClassName,
|
|
1608
|
+
classActive: vmButtonActiveClassName
|
|
1609
|
+
}
|
|
1610
|
+
))
|
|
1611
|
+
] });
|
|
1612
|
+
}
|
|
1613
|
+
function CrisCoMatrixListsTie({
|
|
1614
|
+
oid,
|
|
1615
|
+
inputTitle = "Inputs",
|
|
1616
|
+
outputTitle = "Outputs",
|
|
1617
|
+
showChannels = true,
|
|
1618
|
+
className,
|
|
1619
|
+
style,
|
|
1620
|
+
listClassName,
|
|
1621
|
+
listStyle,
|
|
1622
|
+
headerClassName,
|
|
1623
|
+
headerStyle,
|
|
1624
|
+
itemClassName,
|
|
1625
|
+
itemStyle,
|
|
1626
|
+
itemActiveClassName,
|
|
1627
|
+
itemActiveStyle,
|
|
1628
|
+
itemDisabledClassName,
|
|
1629
|
+
vmText = "Mute",
|
|
1630
|
+
vmButtonClassName,
|
|
1631
|
+
vmButtonActiveClassName,
|
|
1632
|
+
renderIoIndicator,
|
|
1633
|
+
renderSignalIndicator
|
|
1634
|
+
}) {
|
|
1635
|
+
const matrix = (0, import_cris_webui_ch5_core8.useCustomObject)(oid);
|
|
1636
|
+
const send = (0, import_cris_webui_ch5_core8.useCustomObjectSend)();
|
|
1637
|
+
injectScrollbarStyle();
|
|
1638
|
+
if (!matrix) return null;
|
|
1639
|
+
const { si, ip: inputs, op: outputs } = matrix;
|
|
1640
|
+
const handleSelectInput = (id) => {
|
|
1641
|
+
send(oid, { action: "selectInput", id });
|
|
1642
|
+
};
|
|
1643
|
+
const handleTie = (id) => {
|
|
1644
|
+
send(oid, { action: "tie", id });
|
|
1645
|
+
};
|
|
1646
|
+
const handleToggleVideoMute = (type, id) => {
|
|
1647
|
+
send(oid, { action: "toggleVideoMute", type, id });
|
|
1648
|
+
};
|
|
1649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1650
|
+
"div",
|
|
1651
|
+
{
|
|
1652
|
+
className,
|
|
1653
|
+
style: className ? style : { ...defaults.container, ...style },
|
|
1654
|
+
children: [
|
|
1655
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1656
|
+
"div",
|
|
1657
|
+
{
|
|
1658
|
+
className: listClassName,
|
|
1659
|
+
style: listClassName ? listStyle : { ...defaults.list, ...listStyle },
|
|
1660
|
+
children: [
|
|
1661
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1662
|
+
"div",
|
|
1663
|
+
{
|
|
1664
|
+
className: headerClassName,
|
|
1665
|
+
style: headerClassName ? headerStyle : { ...defaults.header, ...headerStyle },
|
|
1666
|
+
children: inputTitle
|
|
1667
|
+
}
|
|
1668
|
+
),
|
|
1669
|
+
/* @__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)(
|
|
1670
|
+
MatrixItemRow,
|
|
1671
|
+
{
|
|
1672
|
+
item,
|
|
1673
|
+
type: "input",
|
|
1674
|
+
active: si === item.id,
|
|
1675
|
+
showChannels,
|
|
1676
|
+
vmText,
|
|
1677
|
+
onSelect: () => handleSelectInput(item.id),
|
|
1678
|
+
onToggleVideoMute: () => handleToggleVideoMute("input", item.id),
|
|
1679
|
+
itemClassName,
|
|
1680
|
+
itemStyle,
|
|
1681
|
+
itemActiveClassName,
|
|
1682
|
+
itemActiveStyle,
|
|
1683
|
+
itemDisabledClassName,
|
|
1684
|
+
vmButtonClassName,
|
|
1685
|
+
vmButtonActiveClassName,
|
|
1686
|
+
renderIoIndicator,
|
|
1687
|
+
renderSignalIndicator
|
|
1688
|
+
},
|
|
1689
|
+
item.id
|
|
1690
|
+
)) })
|
|
1691
|
+
]
|
|
1692
|
+
}
|
|
1693
|
+
),
|
|
1694
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
1695
|
+
"div",
|
|
1696
|
+
{
|
|
1697
|
+
className: listClassName,
|
|
1698
|
+
style: listClassName ? listStyle : { ...defaults.list, ...listStyle },
|
|
1699
|
+
children: [
|
|
1700
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1701
|
+
"div",
|
|
1702
|
+
{
|
|
1703
|
+
className: headerClassName,
|
|
1704
|
+
style: headerClassName ? headerStyle : { ...defaults.header, ...headerStyle },
|
|
1705
|
+
children: outputTitle
|
|
1706
|
+
}
|
|
1707
|
+
),
|
|
1708
|
+
/* @__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)(
|
|
1709
|
+
MatrixItemRow,
|
|
1710
|
+
{
|
|
1711
|
+
item,
|
|
1712
|
+
type: "output",
|
|
1713
|
+
active: item.ti === si,
|
|
1714
|
+
showChannels,
|
|
1715
|
+
vmText,
|
|
1716
|
+
onSelect: () => handleTie(item.id),
|
|
1717
|
+
onToggleVideoMute: () => handleToggleVideoMute("output", item.id),
|
|
1718
|
+
itemClassName,
|
|
1719
|
+
itemStyle,
|
|
1720
|
+
itemActiveClassName,
|
|
1721
|
+
itemActiveStyle,
|
|
1722
|
+
itemDisabledClassName,
|
|
1723
|
+
vmButtonClassName,
|
|
1724
|
+
vmButtonActiveClassName,
|
|
1725
|
+
renderIoIndicator,
|
|
1726
|
+
renderSignalIndicator
|
|
1727
|
+
},
|
|
1728
|
+
item.id
|
|
1729
|
+
)) })
|
|
1730
|
+
]
|
|
1731
|
+
}
|
|
1732
|
+
)
|
|
1733
|
+
]
|
|
1734
|
+
}
|
|
1735
|
+
);
|
|
1736
|
+
}
|
|
1330
1737
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1331
1738
|
0 && (module.exports = {
|
|
1332
1739
|
CrisButton,
|
|
1333
1740
|
CrisCoDebug,
|
|
1741
|
+
CrisCoMatrixListsTie,
|
|
1334
1742
|
CrisGauge,
|
|
1335
1743
|
CrisOfflinePage,
|
|
1336
1744
|
CrisSlider,
|