@trops/dash-core 0.1.725 → 0.1.726
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.esm.js +372 -332
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +371 -331
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6257,7 +6257,7 @@ var Layout = function Layout(_ref) {
|
|
|
6257
6257
|
});
|
|
6258
6258
|
};
|
|
6259
6259
|
|
|
6260
|
-
var _excluded$6 = ["id", "children", "direction", "className", "scrollable", "width", "height", "space", "grow", "debug", "onClick", "padding", "prefix"];
|
|
6260
|
+
var _excluded$6 = ["id", "children", "direction", "className", "scrollable", "width", "height", "space", "grow", "debug", "onClick", "padding", "prefix", "style"];
|
|
6261
6261
|
var LayoutContainer = function LayoutContainer(_ref) {
|
|
6262
6262
|
var id = _ref.id,
|
|
6263
6263
|
children = _ref.children,
|
|
@@ -6283,6 +6283,8 @@ var LayoutContainer = function LayoutContainer(_ref) {
|
|
|
6283
6283
|
padding = _ref$padding === void 0 ? "" : _ref$padding,
|
|
6284
6284
|
_ref$prefix = _ref.prefix,
|
|
6285
6285
|
prefix = _ref$prefix === void 0 ? "layout-container" : _ref$prefix,
|
|
6286
|
+
_ref$style = _ref.style,
|
|
6287
|
+
style = _ref$style === void 0 ? undefined : _ref$style,
|
|
6286
6288
|
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
6287
6289
|
var containerId = "uuid" in props ? props["uuid"] : DashReact.getUUID(id, prefix);
|
|
6288
6290
|
|
|
@@ -6319,6 +6321,7 @@ var LayoutContainer = function LayoutContainer(_ref) {
|
|
|
6319
6321
|
// id={`LayoutContainer-${containerId}-${id}`}
|
|
6320
6322
|
id: containerId,
|
|
6321
6323
|
className: "flex ".concat(classString, " ").concat(className),
|
|
6324
|
+
style: style,
|
|
6322
6325
|
onClick: onClick,
|
|
6323
6326
|
children: [debug === false && children, debug === true && renderDebugger(children, styles.string)]
|
|
6324
6327
|
});
|
|
@@ -22944,7 +22947,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22944
22947
|
className: "flex flex-col w-full h-full overflow-clip",
|
|
22945
22948
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
22946
22949
|
className: "flex flex-row w-full h-full overflow-clip",
|
|
22947
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
22950
|
+
children: /*#__PURE__*/jsxRuntime.jsx(LayoutContainer, {
|
|
22948
22951
|
id: "search-layout-builder",
|
|
22949
22952
|
scrollable: !preview,
|
|
22950
22953
|
direction: "col",
|
|
@@ -22952,45 +22955,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22952
22955
|
height: "h-full",
|
|
22953
22956
|
grow: true,
|
|
22954
22957
|
space: preview,
|
|
22955
|
-
children:
|
|
22956
|
-
dashboardId: dashboardId,
|
|
22957
|
-
isDraggable: true,
|
|
22958
|
-
workspace: currentWorkspace,
|
|
22959
|
-
header: currentWorkspace["name"],
|
|
22960
|
-
layout: currentWorkspace["layout"],
|
|
22961
|
-
parentKey: 0,
|
|
22962
|
-
debugMode: debugMode,
|
|
22963
|
-
previewMode: preview,
|
|
22964
|
-
onClickAdd: onClickAdd,
|
|
22965
|
-
onClickQuickAdd: onClickQuickAdd,
|
|
22966
|
-
onClickRemove: onClickRemove,
|
|
22967
|
-
onClickShrink: onClickShrink,
|
|
22968
|
-
onClickExpand: onClickExpand,
|
|
22969
|
-
onClickEmptyCell: handleOnClickEmptyCell,
|
|
22970
|
-
onSelectWidgetForCell: handleSelectWidgetForCell,
|
|
22971
|
-
onChangeDirection: onChangeDirection,
|
|
22972
|
-
onChangeOrder: onChangeOrder,
|
|
22973
|
-
onDropItem: onDropItem,
|
|
22974
|
-
onDragItem: onDragItem,
|
|
22975
|
-
onOpenConfig: handleClickEditItem,
|
|
22976
|
-
onOpenEvents: handleClickEvents,
|
|
22977
|
-
onSaveConfiguration: handleSaveConfiguration,
|
|
22978
|
-
onProviderSelect: handleSelectProvider,
|
|
22979
|
-
onCreateProvider: handleOpenProviderModal,
|
|
22980
|
-
onClickEdit: onTogglePreview,
|
|
22981
|
-
onSplitCell: handleSplitCell,
|
|
22982
|
-
onMergeCells: handleMergeCells,
|
|
22983
|
-
onAddGridRow: handleAddGridRow,
|
|
22984
|
-
onDeleteGridRow: handleDeleteGridRow,
|
|
22985
|
-
onAddGridColumn: handleAddGridColumn,
|
|
22986
|
-
onDeleteGridColumn: handleDeleteGridColumn,
|
|
22987
|
-
onChangeRowHeight: handleChangeRowHeight,
|
|
22988
|
-
onChangeRowMode: handleChangeRowMode,
|
|
22989
|
-
onChangeRowSizing: handleChangeRowSizing,
|
|
22990
|
-
onChangeColMode: handleChangeColMode,
|
|
22991
|
-
onMoveWidgetToCell: handleMoveWidgetToCell,
|
|
22992
|
-
onWidgetPopout: onWidgetPopout
|
|
22993
|
-
}, "layout-drag-".concat(dashboardId)), preview === false && editMode === "all" && /*#__PURE__*/jsxRuntime.jsx(LayoutDragBuilderEdit, {
|
|
22958
|
+
children: (preview === true || editMode === "all") && /*#__PURE__*/jsxRuntime.jsx(LayoutDragBuilderEdit, {
|
|
22994
22959
|
dashboardId: dashboardId,
|
|
22995
22960
|
isDraggable: true,
|
|
22996
22961
|
workspace: currentWorkspace,
|
|
@@ -23037,8 +23002,9 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
23037
23002
|
onChangeRowSizing: handleChangeRowSizing,
|
|
23038
23003
|
onChangeColMode: handleChangeColMode,
|
|
23039
23004
|
onMoveWidgetToCell: handleMoveWidgetToCell,
|
|
23040
|
-
onDropWidgetFromSidebar: handleDropWidgetFromSidebar
|
|
23041
|
-
|
|
23005
|
+
onDropWidgetFromSidebar: handleDropWidgetFromSidebar,
|
|
23006
|
+
onWidgetPopout: onWidgetPopout
|
|
23007
|
+
}, "layout-drag-".concat(dashboardId))
|
|
23042
23008
|
}, "search-layout-builder")
|
|
23043
23009
|
}), /*#__PURE__*/jsxRuntime.jsxs(AppThemeScope, {
|
|
23044
23010
|
children: [showWidgetDropdown && /*#__PURE__*/jsxRuntime.jsx(EnhancedWidgetDropdown, {
|
|
@@ -23257,7 +23223,9 @@ var LayoutDragBuilderEdit = function LayoutDragBuilderEdit(_ref) {
|
|
|
23257
23223
|
_ref$onMoveWidgetToCe = _ref.onMoveWidgetToCell,
|
|
23258
23224
|
onMoveWidgetToCell = _ref$onMoveWidgetToCe === void 0 ? null : _ref$onMoveWidgetToCe,
|
|
23259
23225
|
_ref$onDropWidgetFrom = _ref.onDropWidgetFromSidebar,
|
|
23260
|
-
onDropWidgetFromSidebar = _ref$onDropWidgetFrom === void 0 ? null : _ref$onDropWidgetFrom
|
|
23226
|
+
onDropWidgetFromSidebar = _ref$onDropWidgetFrom === void 0 ? null : _ref$onDropWidgetFrom,
|
|
23227
|
+
_ref$onWidgetPopout = _ref.onWidgetPopout,
|
|
23228
|
+
onWidgetPopout = _ref$onWidgetPopout === void 0 ? null : _ref$onWidgetPopout;
|
|
23261
23229
|
// DndProvider is supplied by DashboardStage — no local provider needed.
|
|
23262
23230
|
return _renderLayout({
|
|
23263
23231
|
dashboardId: dashboardId,
|
|
@@ -23296,7 +23264,8 @@ var LayoutDragBuilderEdit = function LayoutDragBuilderEdit(_ref) {
|
|
|
23296
23264
|
onChangeRowSizing: onChangeRowSizing,
|
|
23297
23265
|
onChangeColMode: onChangeColMode,
|
|
23298
23266
|
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
23299
|
-
onDropWidgetFromSidebar: onDropWidgetFromSidebar
|
|
23267
|
+
onDropWidgetFromSidebar: onDropWidgetFromSidebar,
|
|
23268
|
+
onWidgetPopout: onWidgetPopout
|
|
23300
23269
|
});
|
|
23301
23270
|
};
|
|
23302
23271
|
|
|
@@ -26291,6 +26260,45 @@ var ExternalWidget = function ExternalWidget(_ref) {
|
|
|
26291
26260
|
});
|
|
26292
26261
|
};
|
|
26293
26262
|
|
|
26263
|
+
function GridCellFrame(_ref) {
|
|
26264
|
+
var editing = _ref.editing,
|
|
26265
|
+
_ref$header = _ref.header,
|
|
26266
|
+
header = _ref$header === void 0 ? null : _ref$header,
|
|
26267
|
+
_ref$footer = _ref.footer,
|
|
26268
|
+
footer = _ref$footer === void 0 ? null : _ref$footer,
|
|
26269
|
+
_ref$onPopout = _ref.onPopout,
|
|
26270
|
+
onPopout = _ref$onPopout === void 0 ? null : _ref$onPopout,
|
|
26271
|
+
children = _ref.children;
|
|
26272
|
+
var _useState = React.useState(false),
|
|
26273
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
26274
|
+
hovered = _useState2[0],
|
|
26275
|
+
setHovered = _useState2[1];
|
|
26276
|
+
var showPopout = !editing && typeof onPopout === "function";
|
|
26277
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26278
|
+
className: editing ? "flex flex-col w-full h-full min-h-0 overflow-hidden rounded border border-dashed border-gray-700" : "relative w-full h-full",
|
|
26279
|
+
onMouseEnter: function onMouseEnter() {
|
|
26280
|
+
return setHovered(true);
|
|
26281
|
+
},
|
|
26282
|
+
onMouseLeave: function onMouseLeave() {
|
|
26283
|
+
return setHovered(false);
|
|
26284
|
+
},
|
|
26285
|
+
children: [editing ? header : null, children, editing ? footer : null, showPopout ? /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
26286
|
+
type: "button",
|
|
26287
|
+
"aria-label": "Pop out widget",
|
|
26288
|
+
title: "Pop out widget",
|
|
26289
|
+
className: "absolute top-1 right-1 p-1 rounded transition-opacity bg-black/60 hover:bg-black/80 text-gray-300 hover:text-white z-10 ".concat(hovered ? "opacity-100" : "opacity-0 pointer-events-none"),
|
|
26290
|
+
onClick: function onClick(e) {
|
|
26291
|
+
e.stopPropagation();
|
|
26292
|
+
onPopout();
|
|
26293
|
+
},
|
|
26294
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
26295
|
+
icon: "arrow-up-right-from-square",
|
|
26296
|
+
className: "h-3 w-3"
|
|
26297
|
+
})
|
|
26298
|
+
}) : null]
|
|
26299
|
+
});
|
|
26300
|
+
}
|
|
26301
|
+
|
|
26294
26302
|
var GRID_CELL_WIDGET_TYPE = "grid-cell-widget";
|
|
26295
26303
|
var SIDEBAR_WIDGET_TYPE = "sidebar-widget";
|
|
26296
26304
|
|
|
@@ -26306,14 +26314,36 @@ function _objectSpread$13(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
|
26306
26314
|
// the sidebar's LayoutBuilder with value "sidebar"; everything else
|
|
26307
26315
|
// defaults to "main".
|
|
26308
26316
|
var WorkspaceScopeContext = /*#__PURE__*/React.createContext("main");
|
|
26309
|
-
var DraggableDroppableCellBody = function DraggableDroppableCellBody(
|
|
26310
|
-
var
|
|
26311
|
-
|
|
26312
|
-
|
|
26313
|
-
|
|
26314
|
-
|
|
26315
|
-
|
|
26316
|
-
padding = _ref.padding
|
|
26317
|
+
var DraggableDroppableCellBody = function DraggableDroppableCellBody(props) {
|
|
26318
|
+
var dnd = React.useContext(reactDnd.DndContext);
|
|
26319
|
+
return dnd && dnd.dragDropManager ? /*#__PURE__*/jsxRuntime.jsx(DndCellBody, _objectSpread$13({}, props)) : /*#__PURE__*/jsxRuntime.jsx(PlainCellBody, _objectSpread$13({}, props));
|
|
26320
|
+
};
|
|
26321
|
+
var PlainCellBody = function PlainCellBody(_ref) {
|
|
26322
|
+
var _ref$enabled = _ref.enabled,
|
|
26323
|
+
enabled = _ref$enabled === void 0 ? true : _ref$enabled,
|
|
26324
|
+
_ref$padding = _ref.padding,
|
|
26325
|
+
padding = _ref$padding === void 0 ? "" : _ref$padding,
|
|
26326
|
+
children = _ref.children;
|
|
26327
|
+
return enabled ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26328
|
+
className: "flex-1 min-h-0 overflow-auto relative ".concat(padding),
|
|
26329
|
+
children: children
|
|
26330
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26331
|
+
style: {
|
|
26332
|
+
display: "contents"
|
|
26333
|
+
},
|
|
26334
|
+
children: children
|
|
26335
|
+
});
|
|
26336
|
+
};
|
|
26337
|
+
var DndCellBody = function DndCellBody(_ref2) {
|
|
26338
|
+
var _ref2$enabled = _ref2.enabled,
|
|
26339
|
+
enabled = _ref2$enabled === void 0 ? true : _ref2$enabled,
|
|
26340
|
+
cellNumber = _ref2.cellNumber,
|
|
26341
|
+
gridContainerId = _ref2.gridContainerId,
|
|
26342
|
+
onMoveWidgetToCell = _ref2.onMoveWidgetToCell,
|
|
26343
|
+
onDropWidgetFromSidebar = _ref2.onDropWidgetFromSidebar,
|
|
26344
|
+
hasSpan = _ref2.hasSpan,
|
|
26345
|
+
children = _ref2.children,
|
|
26346
|
+
padding = _ref2.padding;
|
|
26317
26347
|
var workspaceScope = React.useContext(WorkspaceScopeContext);
|
|
26318
26348
|
var _useDrag = reactDnd.useDrag(function () {
|
|
26319
26349
|
return {
|
|
@@ -26324,13 +26354,16 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26324
26354
|
hasSpan: hasSpan,
|
|
26325
26355
|
workspaceScope: workspaceScope
|
|
26326
26356
|
},
|
|
26357
|
+
canDrag: function canDrag() {
|
|
26358
|
+
return enabled;
|
|
26359
|
+
},
|
|
26327
26360
|
collect: function collect(monitor) {
|
|
26328
26361
|
return {
|
|
26329
26362
|
isDragging: monitor.isDragging()
|
|
26330
26363
|
};
|
|
26331
26364
|
}
|
|
26332
26365
|
};
|
|
26333
|
-
}, [cellNumber, gridContainerId, hasSpan, workspaceScope]),
|
|
26366
|
+
}, [cellNumber, gridContainerId, hasSpan, workspaceScope, enabled]),
|
|
26334
26367
|
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
26335
26368
|
isDragging = _useDrag2[0].isDragging,
|
|
26336
26369
|
drag = _useDrag2[1];
|
|
@@ -26338,6 +26371,7 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26338
26371
|
return {
|
|
26339
26372
|
accept: [GRID_CELL_WIDGET_TYPE, SIDEBAR_WIDGET_TYPE],
|
|
26340
26373
|
canDrop: function canDrop(dragItem, monitor) {
|
|
26374
|
+
if (!enabled) return false;
|
|
26341
26375
|
var itemType = monitor.getItemType();
|
|
26342
26376
|
if (itemType === SIDEBAR_WIDGET_TYPE) return true;
|
|
26343
26377
|
// Allow cross-scope drops (sidebar ↔ main dashboard). Same-scope
|
|
@@ -26384,7 +26418,7 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26384
26418
|
};
|
|
26385
26419
|
}
|
|
26386
26420
|
};
|
|
26387
|
-
}, [cellNumber, gridContainerId, onMoveWidgetToCell, onDropWidgetFromSidebar, hasSpan, workspaceScope]),
|
|
26421
|
+
}, [cellNumber, gridContainerId, onMoveWidgetToCell, onDropWidgetFromSidebar, hasSpan, workspaceScope, enabled]),
|
|
26388
26422
|
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
26389
26423
|
_useDrop2$ = _useDrop2[0],
|
|
26390
26424
|
isOver = _useDrop2$.isOver,
|
|
@@ -26392,6 +26426,17 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26392
26426
|
itemType = _useDrop2$.itemType,
|
|
26393
26427
|
drop = _useDrop2[1];
|
|
26394
26428
|
var isSidebarDrop = itemType === SIDEBAR_WIDGET_TYPE;
|
|
26429
|
+
if (!enabled) {
|
|
26430
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26431
|
+
ref: function ref(node) {
|
|
26432
|
+
return drag(drop(node));
|
|
26433
|
+
},
|
|
26434
|
+
style: {
|
|
26435
|
+
display: "contents"
|
|
26436
|
+
},
|
|
26437
|
+
children: children
|
|
26438
|
+
});
|
|
26439
|
+
}
|
|
26395
26440
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26396
26441
|
ref: function ref(node) {
|
|
26397
26442
|
return drag(drop(node));
|
|
@@ -26409,12 +26454,12 @@ var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
|
26409
26454
|
})]
|
|
26410
26455
|
});
|
|
26411
26456
|
};
|
|
26412
|
-
var DroppableEmptyCell = function DroppableEmptyCell(
|
|
26413
|
-
var cellNumber =
|
|
26414
|
-
gridContainerId =
|
|
26415
|
-
onMoveWidgetToCell =
|
|
26416
|
-
onDropWidgetFromSidebar =
|
|
26417
|
-
children =
|
|
26457
|
+
var DroppableEmptyCell = function DroppableEmptyCell(_ref3) {
|
|
26458
|
+
var cellNumber = _ref3.cellNumber,
|
|
26459
|
+
gridContainerId = _ref3.gridContainerId,
|
|
26460
|
+
onMoveWidgetToCell = _ref3.onMoveWidgetToCell,
|
|
26461
|
+
onDropWidgetFromSidebar = _ref3.onDropWidgetFromSidebar,
|
|
26462
|
+
children = _ref3.children;
|
|
26418
26463
|
var workspaceScope = React.useContext(WorkspaceScopeContext);
|
|
26419
26464
|
var _useDrop3 = reactDnd.useDrop(function () {
|
|
26420
26465
|
return {
|
|
@@ -26472,67 +26517,68 @@ var DroppableEmptyCell = function DroppableEmptyCell(_ref2) {
|
|
|
26472
26517
|
})]
|
|
26473
26518
|
});
|
|
26474
26519
|
};
|
|
26475
|
-
var LayoutGridContainer = /*#__PURE__*/React.memo(function (
|
|
26476
|
-
var
|
|
26477
|
-
|
|
26478
|
-
|
|
26479
|
-
preview =
|
|
26480
|
-
|
|
26481
|
-
|
|
26482
|
-
|
|
26483
|
-
|
|
26484
|
-
|
|
26485
|
-
|
|
26486
|
-
|
|
26487
|
-
|
|
26488
|
-
|
|
26489
|
-
|
|
26490
|
-
|
|
26491
|
-
|
|
26492
|
-
|
|
26493
|
-
|
|
26494
|
-
|
|
26495
|
-
|
|
26496
|
-
|
|
26497
|
-
|
|
26498
|
-
|
|
26499
|
-
|
|
26500
|
-
|
|
26501
|
-
|
|
26502
|
-
|
|
26503
|
-
|
|
26504
|
-
|
|
26505
|
-
|
|
26506
|
-
|
|
26507
|
-
|
|
26508
|
-
|
|
26509
|
-
|
|
26510
|
-
|
|
26511
|
-
|
|
26512
|
-
|
|
26513
|
-
|
|
26514
|
-
|
|
26515
|
-
onMergeCells =
|
|
26516
|
-
|
|
26517
|
-
onAddGridRow =
|
|
26518
|
-
|
|
26519
|
-
onDeleteGridRow =
|
|
26520
|
-
|
|
26521
|
-
onAddGridColumn =
|
|
26522
|
-
|
|
26523
|
-
|
|
26524
|
-
|
|
26525
|
-
|
|
26526
|
-
|
|
26527
|
-
|
|
26528
|
-
|
|
26529
|
-
onChangeColMode =
|
|
26530
|
-
|
|
26531
|
-
|
|
26532
|
-
|
|
26533
|
-
|
|
26534
|
-
|
|
26535
|
-
onWidgetPopout =
|
|
26520
|
+
var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
26521
|
+
var _item$grid3, _item$grid4, _item$grid5;
|
|
26522
|
+
var item = _ref4.item,
|
|
26523
|
+
workspace = _ref4.workspace,
|
|
26524
|
+
_ref4$preview = _ref4.preview,
|
|
26525
|
+
preview = _ref4$preview === void 0 ? false : _ref4$preview,
|
|
26526
|
+
id = _ref4.id;
|
|
26527
|
+
_ref4.parent;
|
|
26528
|
+
var scrollable = _ref4.scrollable;
|
|
26529
|
+
_ref4.space;
|
|
26530
|
+
var grow = _ref4.grow;
|
|
26531
|
+
_ref4.order;
|
|
26532
|
+
var _ref4$children = _ref4.children,
|
|
26533
|
+
children = _ref4$children === void 0 ? null : _ref4$children,
|
|
26534
|
+
onClickAdd = _ref4.onClickAdd;
|
|
26535
|
+
_ref4.onClickQuickAdd;
|
|
26536
|
+
var onClickRemove = _ref4.onClickRemove;
|
|
26537
|
+
_ref4.onChangeDirection;
|
|
26538
|
+
_ref4.onChangeOrder;
|
|
26539
|
+
_ref4.onClickExpand;
|
|
26540
|
+
_ref4.onClickShrink;
|
|
26541
|
+
var onOpenConfig = _ref4.onOpenConfig;
|
|
26542
|
+
_ref4.onOpenEvents;
|
|
26543
|
+
var _ref4$onProviderSelec = _ref4.onProviderSelect,
|
|
26544
|
+
onProviderSelect = _ref4$onProviderSelec === void 0 ? null : _ref4$onProviderSelec,
|
|
26545
|
+
_ref4$onCreateProvide = _ref4.onCreateProvider,
|
|
26546
|
+
onCreateProvider = _ref4$onCreateProvide === void 0 ? null : _ref4$onCreateProvide;
|
|
26547
|
+
_ref4.width;
|
|
26548
|
+
var _ref4$height = _ref4.height,
|
|
26549
|
+
height = _ref4$height === void 0 ? "h-full" : _ref4$height,
|
|
26550
|
+
direction = _ref4.direction,
|
|
26551
|
+
onDropItem = _ref4.onDropItem;
|
|
26552
|
+
_ref4.onDragItem;
|
|
26553
|
+
_ref4.editMode;
|
|
26554
|
+
_ref4.uuid;
|
|
26555
|
+
var layout = _ref4.layout;
|
|
26556
|
+
_ref4.component;
|
|
26557
|
+
_ref4.isDraggable;
|
|
26558
|
+
var _ref4$onSplitCell = _ref4.onSplitCell,
|
|
26559
|
+
onSplitCell = _ref4$onSplitCell === void 0 ? null : _ref4$onSplitCell,
|
|
26560
|
+
_ref4$onMergeCells = _ref4.onMergeCells,
|
|
26561
|
+
onMergeCells = _ref4$onMergeCells === void 0 ? null : _ref4$onMergeCells,
|
|
26562
|
+
_ref4$onAddGridRow = _ref4.onAddGridRow,
|
|
26563
|
+
onAddGridRow = _ref4$onAddGridRow === void 0 ? null : _ref4$onAddGridRow,
|
|
26564
|
+
_ref4$onDeleteGridRow = _ref4.onDeleteGridRow,
|
|
26565
|
+
onDeleteGridRow = _ref4$onDeleteGridRow === void 0 ? null : _ref4$onDeleteGridRow,
|
|
26566
|
+
_ref4$onAddGridColumn = _ref4.onAddGridColumn,
|
|
26567
|
+
onAddGridColumn = _ref4$onAddGridColumn === void 0 ? null : _ref4$onAddGridColumn,
|
|
26568
|
+
_ref4$onDeleteGridCol = _ref4.onDeleteGridColumn,
|
|
26569
|
+
onDeleteGridColumn = _ref4$onDeleteGridCol === void 0 ? null : _ref4$onDeleteGridCol;
|
|
26570
|
+
_ref4.onChangeRowHeight;
|
|
26571
|
+
_ref4.onChangeRowMode;
|
|
26572
|
+
var _ref4$onChangeRowSizi = _ref4.onChangeRowSizing,
|
|
26573
|
+
onChangeRowSizing = _ref4$onChangeRowSizi === void 0 ? null : _ref4$onChangeRowSizi,
|
|
26574
|
+
_ref4$onChangeColMode = _ref4.onChangeColMode,
|
|
26575
|
+
onChangeColMode = _ref4$onChangeColMode === void 0 ? null : _ref4$onChangeColMode,
|
|
26576
|
+
_ref4$onMoveWidgetToC = _ref4.onMoveWidgetToCell,
|
|
26577
|
+
onMoveWidgetToCell = _ref4$onMoveWidgetToC === void 0 ? null : _ref4$onMoveWidgetToC,
|
|
26578
|
+
_ref4$onDropWidgetFro = _ref4.onDropWidgetFromSidebar,
|
|
26579
|
+
onDropWidgetFromSidebar = _ref4$onDropWidgetFro === void 0 ? null : _ref4$onDropWidgetFro,
|
|
26580
|
+
_ref4$onWidgetPopout = _ref4.onWidgetPopout,
|
|
26581
|
+
onWidgetPopout = _ref4$onWidgetPopout === void 0 ? null : _ref4$onWidgetPopout;
|
|
26536
26582
|
// Get providers from AppContext (not DashboardContext, which has a structural
|
|
26537
26583
|
// issue where providers from AppWrapper don't flow through DashboardWrapper)
|
|
26538
26584
|
var appCtx = React.useContext(AppContext);
|
|
@@ -26540,10 +26586,10 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
26540
26586
|
|
|
26541
26587
|
// Convert providers object to array format expected by WidgetCardHeader
|
|
26542
26588
|
// Providers from context are stored as: { "provider-name": { name, type, credentials, ... }, ... }
|
|
26543
|
-
var availableProviders = providersObj && _typeof(providersObj) === "object" ? Object.entries(providersObj).map(function (
|
|
26544
|
-
var
|
|
26545
|
-
id =
|
|
26546
|
-
provider =
|
|
26589
|
+
var availableProviders = providersObj && _typeof(providersObj) === "object" ? Object.entries(providersObj).map(function (_ref5) {
|
|
26590
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
|
26591
|
+
id = _ref6[0],
|
|
26592
|
+
provider = _ref6[1];
|
|
26547
26593
|
return _objectSpread$13({
|
|
26548
26594
|
id: id
|
|
26549
26595
|
}, provider);
|
|
@@ -27343,44 +27389,13 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
27343
27389
|
className: "flex w-full ".concat(heightClass, " min-h-0 min-w-0 overflow-hidden relative ").concat(isCellSelected ? "ring-2 ring-blue-500 ring-inset rounded" : ""),
|
|
27344
27390
|
"data-cell": cellNumber,
|
|
27345
27391
|
style: spanStyle,
|
|
27346
|
-
children: preview ? cellDef.component ? renderCellComponent(cellDef.component) : renderPreviewEmptyCell(cellNumber) : renderEditCell(cellNumber, cellDef, selectableSet)
|
|
27392
|
+
children: preview ? cellDef.component ? renderCellComponent(cellDef.component, cellNumber) : renderPreviewEmptyCell(cellNumber) : renderEditCell(cellNumber, cellDef, selectableSet)
|
|
27347
27393
|
}, cellNumber));
|
|
27348
27394
|
}
|
|
27349
27395
|
}
|
|
27350
27396
|
return cells;
|
|
27351
27397
|
}
|
|
27352
27398
|
|
|
27353
|
-
// Hover-based popout overlay — avoids Tailwind named groups (requires v3.4+)
|
|
27354
|
-
function PopoutOverlay(_ref6) {
|
|
27355
|
-
var children = _ref6.children,
|
|
27356
|
-
onPopout = _ref6.onPopout;
|
|
27357
|
-
var _React$useState = React.useState(false),
|
|
27358
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27359
|
-
hovered = _React$useState2[0],
|
|
27360
|
-
setHovered = _React$useState2[1];
|
|
27361
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27362
|
-
className: "relative w-full h-full",
|
|
27363
|
-
onMouseEnter: function onMouseEnter() {
|
|
27364
|
-
return setHovered(true);
|
|
27365
|
-
},
|
|
27366
|
-
onMouseLeave: function onMouseLeave() {
|
|
27367
|
-
return setHovered(false);
|
|
27368
|
-
},
|
|
27369
|
-
children: [children, /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
27370
|
-
className: "absolute top-1 right-1 p-1 rounded transition-opacity bg-black/60 hover:bg-black/80 text-gray-300 hover:text-white z-10 ".concat(hovered ? "opacity-100" : "opacity-0 pointer-events-none"),
|
|
27371
|
-
onClick: function onClick(e) {
|
|
27372
|
-
e.stopPropagation();
|
|
27373
|
-
onPopout();
|
|
27374
|
-
},
|
|
27375
|
-
title: "Pop out widget",
|
|
27376
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27377
|
-
icon: "arrow-up-right-from-square",
|
|
27378
|
-
className: "h-3 w-3"
|
|
27379
|
-
})
|
|
27380
|
-
})]
|
|
27381
|
-
});
|
|
27382
|
-
}
|
|
27383
|
-
|
|
27384
27399
|
// Render component inside a grid cell (preview mode only)
|
|
27385
27400
|
function renderCellComponent(componentId, cellNumber, selectableSet) {
|
|
27386
27401
|
if (!layout || !workspace) {
|
|
@@ -27393,21 +27408,29 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
27393
27408
|
return null;
|
|
27394
27409
|
}
|
|
27395
27410
|
var rendered = renderComponent(cellComponent.component, cellComponent.id, cellComponent, null);
|
|
27396
|
-
|
|
27397
|
-
|
|
27398
|
-
|
|
27399
|
-
|
|
27400
|
-
|
|
27401
|
-
|
|
27402
|
-
|
|
27403
|
-
|
|
27404
|
-
|
|
27405
|
-
|
|
27406
|
-
|
|
27411
|
+
|
|
27412
|
+
// Prefer uuid over id — uuid is `${dashboardId}-${component}-${id}`
|
|
27413
|
+
// which is globally unique, while id is only unique within a
|
|
27414
|
+
// single page/container. Passing bare id causes WidgetPopoutStage
|
|
27415
|
+
// to find-first-match across layout/pages and render the wrong
|
|
27416
|
+
// widget when two pages share the same numeric id.
|
|
27417
|
+
var popoutKey = cellComponent.uuid || cellComponent.id;
|
|
27418
|
+
var onPopout = onWidgetPopout && cellComponent.component ? function () {
|
|
27419
|
+
return onWidgetPopout(popoutKey);
|
|
27420
|
+
} : null;
|
|
27421
|
+
|
|
27422
|
+
// Same frame and body types as edit mode (renderEditCell), so the
|
|
27423
|
+
// widget stays mounted across view ↔ edit (phase 1c).
|
|
27424
|
+
return /*#__PURE__*/jsxRuntime.jsx(GridCellFrame, {
|
|
27425
|
+
editing: false,
|
|
27426
|
+
onPopout: onPopout,
|
|
27427
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DraggableDroppableCellBody, {
|
|
27428
|
+
enabled: false,
|
|
27429
|
+
cellNumber: cellNumber,
|
|
27430
|
+
gridContainerId: id,
|
|
27407
27431
|
children: rendered
|
|
27408
|
-
})
|
|
27409
|
-
}
|
|
27410
|
-
return rendered;
|
|
27432
|
+
})
|
|
27433
|
+
});
|
|
27411
27434
|
}
|
|
27412
27435
|
|
|
27413
27436
|
// Render empty cell in preview mode
|
|
@@ -27478,69 +27501,88 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
27478
27501
|
renderedWidget = renderComponent(cellComponent.component, cellComponent.id, cellComponent, null);
|
|
27479
27502
|
}
|
|
27480
27503
|
}
|
|
27504
|
+
var header = /*#__PURE__*/jsxRuntime.jsx(WidgetCard.Header, {
|
|
27505
|
+
item: cellComponent,
|
|
27506
|
+
cellNumber: cellNumber,
|
|
27507
|
+
providers: cellComponent ? availableProviders || [] : [],
|
|
27508
|
+
selectedProviders: ((_cellComponent = cellComponent) === null || _cellComponent === void 0 ? void 0 : _cellComponent.selectedProviders) || {},
|
|
27509
|
+
isSelected: isCellSelected,
|
|
27510
|
+
isSelectable: isCellSelectable,
|
|
27511
|
+
onToggleSelect: function onToggleSelect() {
|
|
27512
|
+
return handleToggleCellSelection(cellNumber);
|
|
27513
|
+
},
|
|
27514
|
+
onSplitHorizontal: function onSplitHorizontal() {
|
|
27515
|
+
return handleInstantSplit(cellNumber, "horizontal");
|
|
27516
|
+
},
|
|
27517
|
+
onSplitVertical: function onSplitVertical() {
|
|
27518
|
+
return handleInstantSplit(cellNumber, "vertical");
|
|
27519
|
+
},
|
|
27520
|
+
onProviderChange: cellComponent ? function (providerType, providerId, isCreateNew) {
|
|
27521
|
+
if (isCreateNew) {
|
|
27522
|
+
if (onCreateProvider) {
|
|
27523
|
+
onCreateProvider(cellComponent.id, providerType, true);
|
|
27524
|
+
}
|
|
27525
|
+
} else {
|
|
27526
|
+
if (onProviderSelect) {
|
|
27527
|
+
onProviderSelect(cellComponent.id, providerType, providerId);
|
|
27528
|
+
}
|
|
27529
|
+
}
|
|
27530
|
+
} : undefined,
|
|
27531
|
+
onConfigure: cellComponent ? function (widgetItem, section) {
|
|
27532
|
+
if (onOpenConfig) onOpenConfig(cellComponent, section);
|
|
27533
|
+
} : undefined,
|
|
27534
|
+
onDelete: cellComponent ? function () {
|
|
27535
|
+
if (onClickRemove) onClickRemove(cellComponent.id);
|
|
27536
|
+
} : undefined,
|
|
27537
|
+
onEditWithAI: cellComponent ? function () {
|
|
27538
|
+
var _ComponentManager$con;
|
|
27539
|
+
window.dispatchEvent(new CustomEvent("dash:edit-widget-with-ai", {
|
|
27540
|
+
detail: {
|
|
27541
|
+
cellNumber: cellNumber,
|
|
27542
|
+
gridItemId: item.id,
|
|
27543
|
+
workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id,
|
|
27544
|
+
widgetComponentName: cellComponent.component,
|
|
27545
|
+
widgetId: cellComponent.id,
|
|
27546
|
+
selectedProviders: cellComponent.selectedProviders || null,
|
|
27547
|
+
// Pass the live widget's userPrefs so the
|
|
27548
|
+
// preview renders the same configured state
|
|
27549
|
+
// the user sees on the dashboard (titles,
|
|
27550
|
+
// defaults, etc.) instead of blank values.
|
|
27551
|
+
userPrefs: cellComponent.userPrefs || null,
|
|
27552
|
+
sourcePackage: ((_ComponentManager$con = ComponentManager.config(cellComponent.component, cellComponent)) === null || _ComponentManager$con === void 0 ? void 0 : _ComponentManager$con._sourcePackage) || null
|
|
27553
|
+
}
|
|
27554
|
+
}));
|
|
27555
|
+
} : undefined
|
|
27556
|
+
});
|
|
27557
|
+
var footer = cellComponent ? /*#__PURE__*/jsxRuntime.jsx(WidgetCard.Footer, {
|
|
27558
|
+
item: cellComponent,
|
|
27559
|
+
onConfigure: function onConfigure(item, section) {
|
|
27560
|
+
return onOpenConfig && onOpenConfig(item, section);
|
|
27561
|
+
}
|
|
27562
|
+
}) : null;
|
|
27563
|
+
|
|
27564
|
+
// An occupied cell uses GridCellFrame — the same element tree as view
|
|
27565
|
+
// mode — so its widget stays mounted across view ↔ edit (phase 1c).
|
|
27566
|
+
if (cellComponent && ComponentManager.config(cellComponent.component, cellComponent)) {
|
|
27567
|
+
return /*#__PURE__*/jsxRuntime.jsx(GridCellFrame, {
|
|
27568
|
+
editing: true,
|
|
27569
|
+
header: header,
|
|
27570
|
+
footer: footer,
|
|
27571
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DraggableDroppableCellBody, {
|
|
27572
|
+
enabled: true,
|
|
27573
|
+
cellNumber: cellNumber,
|
|
27574
|
+
gridContainerId: id,
|
|
27575
|
+
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
27576
|
+
onDropWidgetFromSidebar: onDropWidgetFromSidebar,
|
|
27577
|
+
hasSpan: !!(cellDef.span && (cellDef.span.row && cellDef.span.row > 1 || cellDef.span.col && cellDef.span.col > 1)),
|
|
27578
|
+
padding: "p-3",
|
|
27579
|
+
children: renderedWidget
|
|
27580
|
+
})
|
|
27581
|
+
});
|
|
27582
|
+
}
|
|
27481
27583
|
return /*#__PURE__*/jsxRuntime.jsxs(WidgetCard, {
|
|
27482
27584
|
preview: false,
|
|
27483
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
27484
|
-
item: cellComponent,
|
|
27485
|
-
cellNumber: cellNumber,
|
|
27486
|
-
providers: cellComponent ? availableProviders || [] : [],
|
|
27487
|
-
selectedProviders: ((_cellComponent = cellComponent) === null || _cellComponent === void 0 ? void 0 : _cellComponent.selectedProviders) || {},
|
|
27488
|
-
isSelected: isCellSelected,
|
|
27489
|
-
isSelectable: isCellSelectable,
|
|
27490
|
-
onToggleSelect: function onToggleSelect() {
|
|
27491
|
-
return handleToggleCellSelection(cellNumber);
|
|
27492
|
-
},
|
|
27493
|
-
onSplitHorizontal: function onSplitHorizontal() {
|
|
27494
|
-
return handleInstantSplit(cellNumber, "horizontal");
|
|
27495
|
-
},
|
|
27496
|
-
onSplitVertical: function onSplitVertical() {
|
|
27497
|
-
return handleInstantSplit(cellNumber, "vertical");
|
|
27498
|
-
},
|
|
27499
|
-
onProviderChange: cellComponent ? function (providerType, providerId, isCreateNew) {
|
|
27500
|
-
if (isCreateNew) {
|
|
27501
|
-
if (onCreateProvider) {
|
|
27502
|
-
onCreateProvider(cellComponent.id, providerType, true);
|
|
27503
|
-
}
|
|
27504
|
-
} else {
|
|
27505
|
-
if (onProviderSelect) {
|
|
27506
|
-
onProviderSelect(cellComponent.id, providerType, providerId);
|
|
27507
|
-
}
|
|
27508
|
-
}
|
|
27509
|
-
} : undefined,
|
|
27510
|
-
onConfigure: cellComponent ? function (widgetItem, section) {
|
|
27511
|
-
if (onOpenConfig) onOpenConfig(cellComponent, section);
|
|
27512
|
-
} : undefined,
|
|
27513
|
-
onDelete: cellComponent ? function () {
|
|
27514
|
-
if (onClickRemove) onClickRemove(cellComponent.id);
|
|
27515
|
-
} : undefined,
|
|
27516
|
-
onEditWithAI: cellComponent ? function () {
|
|
27517
|
-
var _ComponentManager$con;
|
|
27518
|
-
window.dispatchEvent(new CustomEvent("dash:edit-widget-with-ai", {
|
|
27519
|
-
detail: {
|
|
27520
|
-
cellNumber: cellNumber,
|
|
27521
|
-
gridItemId: item.id,
|
|
27522
|
-
workspaceId: workspace === null || workspace === void 0 ? void 0 : workspace.id,
|
|
27523
|
-
widgetComponentName: cellComponent.component,
|
|
27524
|
-
widgetId: cellComponent.id,
|
|
27525
|
-
selectedProviders: cellComponent.selectedProviders || null,
|
|
27526
|
-
// Pass the live widget's userPrefs so the
|
|
27527
|
-
// preview renders the same configured state
|
|
27528
|
-
// the user sees on the dashboard (titles,
|
|
27529
|
-
// defaults, etc.) instead of blank values.
|
|
27530
|
-
userPrefs: cellComponent.userPrefs || null,
|
|
27531
|
-
sourcePackage: ((_ComponentManager$con = ComponentManager.config(cellComponent.component, cellComponent)) === null || _ComponentManager$con === void 0 ? void 0 : _ComponentManager$con._sourcePackage) || null
|
|
27532
|
-
}
|
|
27533
|
-
}));
|
|
27534
|
-
} : undefined
|
|
27535
|
-
}), cellComponent && ComponentManager.config(cellComponent.component, cellComponent) ? /*#__PURE__*/jsxRuntime.jsx(DraggableDroppableCellBody, {
|
|
27536
|
-
cellNumber: cellNumber,
|
|
27537
|
-
gridContainerId: id,
|
|
27538
|
-
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
27539
|
-
onDropWidgetFromSidebar: onDropWidgetFromSidebar,
|
|
27540
|
-
hasSpan: !!(cellDef.span && (cellDef.span.row && cellDef.span.row > 1 || cellDef.span.col && cellDef.span.col > 1)),
|
|
27541
|
-
padding: "p-3",
|
|
27542
|
-
children: renderedWidget
|
|
27543
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(DroppableEmptyCell, {
|
|
27585
|
+
children: [header, /*#__PURE__*/jsxRuntime.jsx(DroppableEmptyCell, {
|
|
27544
27586
|
cellNumber: cellNumber,
|
|
27545
27587
|
gridContainerId: id,
|
|
27546
27588
|
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
@@ -27554,12 +27596,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
27554
27596
|
padding: "p-0",
|
|
27555
27597
|
children: renderEmptyCellContent(cellNumber)
|
|
27556
27598
|
})
|
|
27557
|
-
}),
|
|
27558
|
-
item: cellComponent,
|
|
27559
|
-
onConfigure: function onConfigure(item, section) {
|
|
27560
|
-
return onOpenConfig && onOpenConfig(item, section);
|
|
27561
|
-
}
|
|
27562
|
-
})]
|
|
27599
|
+
}), footer]
|
|
27563
27600
|
});
|
|
27564
27601
|
}
|
|
27565
27602
|
function handleClickAdd() {
|
|
@@ -27632,20 +27669,36 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
27632
27669
|
}
|
|
27633
27670
|
return item["parentWorkspaceName"];
|
|
27634
27671
|
}
|
|
27635
|
-
|
|
27636
|
-
|
|
27637
|
-
//
|
|
27638
|
-
|
|
27672
|
+
|
|
27673
|
+
// Grid layout: ONE element tree for view and edit (create-entry phase
|
|
27674
|
+
// 1c), so widgets stay mounted across modes. Edit-only parts (gutters,
|
|
27675
|
+
// merge/split UI, modals) render only while editing; edit-only wrappers
|
|
27676
|
+
// become display: contents in view mode, leaving view layout unchanged.
|
|
27677
|
+
var editing = preview === false;
|
|
27678
|
+
var hidden = editing ? undefined : {
|
|
27679
|
+
display: "contents"
|
|
27680
|
+
};
|
|
27681
|
+
var viewGridStyle = function viewGridStyle(overflow, rows) {
|
|
27682
|
+
return {
|
|
27683
|
+
gridTemplateRows: rows,
|
|
27684
|
+
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
27685
|
+
overflow: overflow
|
|
27686
|
+
};
|
|
27687
|
+
};
|
|
27688
|
+
var viewGap = "".concat(!((_item$grid3 = item.grid) !== null && _item$grid3 !== void 0 && _item$grid3.gap) || ((_item$grid4 = item.grid) === null || _item$grid4 === void 0 ? void 0 : _item$grid4.gap) === "gap-2" ? "dr-grid-gap" : "", " ").concat(((_item$grid5 = item.grid) === null || _item$grid5 === void 0 ? void 0 : _item$grid5.gap) || "gap-2");
|
|
27689
|
+
return useGridLayout ? /*#__PURE__*/jsxRuntime.jsxs(LayoutContainer, {
|
|
27690
|
+
style: hidden,
|
|
27639
27691
|
id: "grid-container-parent-".concat(id),
|
|
27640
27692
|
direction: "col",
|
|
27641
27693
|
width: "w-full",
|
|
27642
27694
|
height: "h-full",
|
|
27643
27695
|
scrollable: false,
|
|
27644
|
-
className: "rounded overflow-x-clip border-2 rounded ".concat(getContainerBorderColor(item), " ").concat(getBorderStyle(), " min-h-24 z-10"),
|
|
27696
|
+
className: editing ? "rounded overflow-x-clip border-2 rounded ".concat(getContainerBorderColor(item), " ").concat(getBorderStyle(), " min-h-24 z-10") : "",
|
|
27645
27697
|
space: false,
|
|
27646
27698
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27647
|
-
className: "flex flex-col flex-1 min-h-0 pt-2",
|
|
27648
|
-
|
|
27699
|
+
className: editing ? "flex flex-col flex-1 min-h-0 pt-2" : undefined,
|
|
27700
|
+
style: hidden,
|
|
27701
|
+
children: [editing && /*#__PURE__*/jsxRuntime.jsx(DashReact.ConfirmationModal, {
|
|
27649
27702
|
isOpen: selectedCellsForMerge.length >= 2,
|
|
27650
27703
|
setIsOpen: function setIsOpen() {
|
|
27651
27704
|
return setSelectedCellsForMerge([]);
|
|
@@ -27669,83 +27722,88 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
27669
27722
|
onCancel: function onCancel() {
|
|
27670
27723
|
return setSelectedCellsForMerge([]);
|
|
27671
27724
|
}
|
|
27672
|
-
}), renderColumnGutter(), scrollable ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27673
|
-
className: "relative flex-1 min-h-0",
|
|
27725
|
+
}), editing ? renderColumnGutter() : null, scrollable ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27726
|
+
className: editing ? "relative flex-1 min-h-0" : undefined,
|
|
27727
|
+
style: hidden,
|
|
27674
27728
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27675
|
-
className: "absolute inset-0 flex flex-row overflow-y-auto items-start",
|
|
27676
|
-
|
|
27729
|
+
className: editing ? "absolute inset-0 flex flex-row overflow-y-auto items-start" : undefined,
|
|
27730
|
+
style: hidden,
|
|
27731
|
+
children: [editing ? renderRowGutter() : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27677
27732
|
id: "grid-container-".concat(id),
|
|
27678
|
-
className: "grid flex-1 min-h-24 p-4 gap-5",
|
|
27679
|
-
style: {
|
|
27733
|
+
className: editing ? "grid flex-1 min-h-24 p-4 gap-5" : "dr-grid ".concat(viewGap, " grid w-full min-h-24 p-3"),
|
|
27734
|
+
style: editing ? {
|
|
27680
27735
|
gridTemplateRows: getRowTemplate(item.grid),
|
|
27681
27736
|
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)")
|
|
27682
|
-
},
|
|
27737
|
+
} : viewGridStyle("auto", getRowTemplate(item.grid)),
|
|
27683
27738
|
children: renderGridCells()
|
|
27684
27739
|
})]
|
|
27685
27740
|
})
|
|
27686
27741
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27687
|
-
className: "relative flex-1 min-h-0",
|
|
27742
|
+
className: editing ? "relative flex-1 min-h-0" : "relative w-full ".concat(height, " min-h-24"),
|
|
27688
27743
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27689
|
-
className: "absolute inset-0 flex flex-row overflow-hidden",
|
|
27690
|
-
|
|
27744
|
+
className: editing ? "absolute inset-0 flex flex-row overflow-hidden" : undefined,
|
|
27745
|
+
style: hidden,
|
|
27746
|
+
children: [editing ? renderRowGutter() : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27691
27747
|
id: "grid-container-".concat(id),
|
|
27692
|
-
className: "grid flex-1 p-4 gap-5",
|
|
27693
|
-
style: {
|
|
27748
|
+
className: editing ? "grid flex-1 p-4 gap-5" : "dr-grid ".concat(viewGap, " absolute inset-0 grid p-3"),
|
|
27749
|
+
style: editing ? {
|
|
27694
27750
|
gridTemplateRows: hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))"),
|
|
27695
27751
|
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
27696
27752
|
overflow: "hidden"
|
|
27697
|
-
},
|
|
27753
|
+
} : viewGridStyle("hidden", hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))")),
|
|
27698
27754
|
children: renderGridCells()
|
|
27699
27755
|
})]
|
|
27700
27756
|
})
|
|
27701
27757
|
})]
|
|
27702
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
27703
|
-
|
|
27704
|
-
|
|
27705
|
-
|
|
27706
|
-
|
|
27707
|
-
|
|
27708
|
-
|
|
27709
|
-
|
|
27710
|
-
|
|
27711
|
-
|
|
27712
|
-
|
|
27713
|
-
|
|
27714
|
-
|
|
27715
|
-
|
|
27716
|
-
|
|
27717
|
-
|
|
27718
|
-
|
|
27719
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27720
|
-
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27721
|
-
onClick: function onClick() {
|
|
27722
|
-
handleInstantSplit(contextMenuCell, "horizontal");
|
|
27723
|
-
handleCloseContextMenu();
|
|
27724
|
-
},
|
|
27725
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27726
|
-
icon: "arrows-left-right",
|
|
27727
|
-
className: "mr-2"
|
|
27728
|
-
}), "Split Horizontal"]
|
|
27729
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27730
|
-
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27731
|
-
onClick: function onClick() {
|
|
27732
|
-
handleInstantSplit(contextMenuCell, "vertical");
|
|
27733
|
-
handleCloseContextMenu();
|
|
27734
|
-
},
|
|
27735
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27736
|
-
icon: "arrows-up-down",
|
|
27737
|
-
className: "mr-2"
|
|
27738
|
-
}), "Split Vertical"]
|
|
27739
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27740
|
-
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27741
|
-
onClick: function onClick() {
|
|
27742
|
-
handleClickAdd();
|
|
27743
|
-
handleCloseContextMenu();
|
|
27758
|
+
}), editing && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
27759
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(MergeCellsModal, {
|
|
27760
|
+
open: mergeModalOpen,
|
|
27761
|
+
setIsOpen: setMergeModalOpen,
|
|
27762
|
+
cellNumbers: selectedCellsForMerge,
|
|
27763
|
+
gridContainer: item,
|
|
27764
|
+
conflictingComponents: getConflictingComponents(selectedCellsForMerge),
|
|
27765
|
+
onConfirm: handleMergeCellsConfirm
|
|
27766
|
+
}), contextMenuCell && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
27767
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27768
|
+
className: "fixed inset-0 z-40",
|
|
27769
|
+
onClick: handleCloseContextMenu
|
|
27770
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
27771
|
+
className: "fixed z-50 bg-gray-800 border border-gray-600 rounded shadow-lg py-1 min-w-48",
|
|
27772
|
+
style: {
|
|
27773
|
+
left: "".concat(contextMenuPosition.x, "px"),
|
|
27774
|
+
top: "".concat(contextMenuPosition.y, "px")
|
|
27744
27775
|
},
|
|
27745
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
27746
|
-
|
|
27747
|
-
|
|
27748
|
-
|
|
27776
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27777
|
+
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27778
|
+
onClick: function onClick() {
|
|
27779
|
+
handleInstantSplit(contextMenuCell, "horizontal");
|
|
27780
|
+
handleCloseContextMenu();
|
|
27781
|
+
},
|
|
27782
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27783
|
+
icon: "arrows-left-right",
|
|
27784
|
+
className: "mr-2"
|
|
27785
|
+
}), "Split Horizontal"]
|
|
27786
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27787
|
+
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27788
|
+
onClick: function onClick() {
|
|
27789
|
+
handleInstantSplit(contextMenuCell, "vertical");
|
|
27790
|
+
handleCloseContextMenu();
|
|
27791
|
+
},
|
|
27792
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27793
|
+
icon: "arrows-up-down",
|
|
27794
|
+
className: "mr-2"
|
|
27795
|
+
}), "Split Vertical"]
|
|
27796
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
27797
|
+
className: "w-full text-left px-4 py-2 text-sm text-gray-200 hover:bg-gray-700 flex items-center",
|
|
27798
|
+
onClick: function onClick() {
|
|
27799
|
+
handleClickAdd();
|
|
27800
|
+
handleCloseContextMenu();
|
|
27801
|
+
},
|
|
27802
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
27803
|
+
icon: "plus",
|
|
27804
|
+
className: "mr-2"
|
|
27805
|
+
}), "Add Widget"]
|
|
27806
|
+
})]
|
|
27749
27807
|
})]
|
|
27750
27808
|
})]
|
|
27751
27809
|
})]
|
|
@@ -27787,27 +27845,6 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
27787
27845
|
})
|
|
27788
27846
|
})
|
|
27789
27847
|
})
|
|
27790
|
-
}) : useGridLayout ? scrollable ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27791
|
-
id: "grid-container-".concat(id),
|
|
27792
|
-
className: "dr-grid ".concat(!item.grid.gap || item.grid.gap === "gap-2" ? "dr-grid-gap" : "", " grid w-full min-h-24 p-3 ").concat(item.grid.gap || "gap-2"),
|
|
27793
|
-
style: {
|
|
27794
|
-
gridTemplateRows: getRowTemplate(item.grid),
|
|
27795
|
-
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
27796
|
-
overflow: "auto"
|
|
27797
|
-
},
|
|
27798
|
-
children: renderGridCells()
|
|
27799
|
-
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27800
|
-
className: "relative w-full ".concat(height, " min-h-24"),
|
|
27801
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
27802
|
-
id: "grid-container-".concat(id),
|
|
27803
|
-
className: "dr-grid ".concat(!item.grid.gap || item.grid.gap === "gap-2" ? "dr-grid-gap" : "", " absolute inset-0 grid p-3 ").concat(item.grid.gap || "gap-2"),
|
|
27804
|
-
style: {
|
|
27805
|
-
gridTemplateRows: hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))"),
|
|
27806
|
-
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
27807
|
-
overflow: "hidden"
|
|
27808
|
-
},
|
|
27809
|
-
children: renderGridCells()
|
|
27810
|
-
})
|
|
27811
27848
|
}) : renderComponentContainer(children);
|
|
27812
27849
|
});
|
|
27813
27850
|
|
|
@@ -27934,7 +27971,10 @@ var _renderLayout = function renderLayout(_ref) {
|
|
|
27934
27971
|
|
|
27935
27972
|
// if (gridLayout) console.log("rendering grid ", child, childLayout);
|
|
27936
27973
|
|
|
27937
|
-
return hasChildren === 1 && canHaveChildren === true || component === "LayoutGridContainer" ? /*#__PURE__*/jsxRuntime.jsx(LayoutGridContainer
|
|
27974
|
+
return hasChildren === 1 && canHaveChildren === true || component === "LayoutGridContainer" ? /*#__PURE__*/jsxRuntime.jsx(LayoutGridContainer
|
|
27975
|
+
// No mode in the key: switching view ↔ edit must not remount the
|
|
27976
|
+
// grid and every widget in it (create-entry phase 1c).
|
|
27977
|
+
, {
|
|
27938
27978
|
uuid: uuid,
|
|
27939
27979
|
id: id,
|
|
27940
27980
|
item: childLayout,
|
|
@@ -28019,7 +28059,7 @@ var _renderLayout = function renderLayout(_ref) {
|
|
|
28019
28059
|
onDropWidgetFromSidebar: onDropWidgetFromSidebar,
|
|
28020
28060
|
onWidgetPopout: onWidgetPopout
|
|
28021
28061
|
})
|
|
28022
|
-
}, "grid-container-".concat(uuid
|
|
28062
|
+
}, "grid-container-".concat(uuid)) : /*#__PURE__*/jsxRuntime.jsx(LayoutBuilderGridItem, {
|
|
28023
28063
|
uuid: uuid,
|
|
28024
28064
|
item: childLayout,
|
|
28025
28065
|
layout: layout,
|
|
@@ -28056,7 +28096,7 @@ var _renderLayout = function renderLayout(_ref) {
|
|
|
28056
28096
|
onOpenEvents: onOpenEvents,
|
|
28057
28097
|
isDraggable: isDraggable,
|
|
28058
28098
|
workspace: workspace
|
|
28059
|
-
}, "grid-item-".concat(uuid
|
|
28099
|
+
}, "grid-item-".concat(uuid));
|
|
28060
28100
|
});
|
|
28061
28101
|
} catch (e) {
|
|
28062
28102
|
}
|
|
@@ -28136,7 +28176,7 @@ function renderGridLayout(gridLayout, args) {
|
|
|
28136
28176
|
onOpenEvents: onOpenEvents,
|
|
28137
28177
|
isDraggable: isDraggable,
|
|
28138
28178
|
workspace: workspace
|
|
28139
|
-
}, "grid-item-".concat(uuid
|
|
28179
|
+
}, "grid-item-".concat(uuid)));
|
|
28140
28180
|
}
|
|
28141
28181
|
} else {
|
|
28142
28182
|
if (previewMode === false) {
|
|
@@ -28361,7 +28401,7 @@ function renderGridCell(_ref3) {
|
|
|
28361
28401
|
onOpenEvents: onOpenEvents,
|
|
28362
28402
|
isDraggable: isDraggable,
|
|
28363
28403
|
workspace: workspace
|
|
28364
|
-
}, "grid-item-".concat(uuid
|
|
28404
|
+
}, "grid-item-".concat(uuid))
|
|
28365
28405
|
})
|
|
28366
28406
|
});
|
|
28367
28407
|
}
|