@trops/dash-core 0.1.229 → 0.1.231
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 +35 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +83 -86
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -6259,7 +6259,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6259
6259
|
|
|
6260
6260
|
// --- Create logic (DASH-191: moved above useEffect so ref captures actual function) ---
|
|
6261
6261
|
var handleCreate = useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6262
|
-
var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, template, layoutObj, widgetOrder, cells, _loop, i, workspace, _t;
|
|
6262
|
+
var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, template, layoutObj, widgetOrder, cells, widgetItems, nextId, _loop, i, fullLayout, workspace, _t;
|
|
6263
6263
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
6264
6264
|
while (1) switch (_context2.prev = _context2.next) {
|
|
6265
6265
|
case 0:
|
|
@@ -6326,13 +6326,15 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6326
6326
|
}
|
|
6327
6327
|
throw new Error("No layout template selected.");
|
|
6328
6328
|
case 8:
|
|
6329
|
-
layoutObj = createLayoutFromTemplate(template, menuId || 1); // Place widgets into grid cells
|
|
6329
|
+
layoutObj = createLayoutFromTemplate(template, menuId || 1); // Place widgets into grid cells as proper layout items
|
|
6330
6330
|
widgetOrder = state.layout.widgetOrder || [];
|
|
6331
6331
|
cells = template.cells.filter(function (c) {
|
|
6332
6332
|
return !c.hide;
|
|
6333
6333
|
});
|
|
6334
|
+
widgetItems = [];
|
|
6335
|
+
nextId = 2; // grid container is ID 1
|
|
6334
6336
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(i) {
|
|
6335
|
-
var widget;
|
|
6337
|
+
var widget, widgetKey;
|
|
6336
6338
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
6337
6339
|
while (1) switch (_context.prev = _context.next) {
|
|
6338
6340
|
case 0:
|
|
@@ -6340,7 +6342,18 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6340
6342
|
return (w.name || w.key) === widgetOrder[i];
|
|
6341
6343
|
});
|
|
6342
6344
|
if (widget && layoutObj.grid[cells[i].key]) {
|
|
6343
|
-
|
|
6345
|
+
widgetKey = widget.component || widget.name || widget.key;
|
|
6346
|
+
widgetItems.push({
|
|
6347
|
+
id: nextId,
|
|
6348
|
+
component: widgetKey,
|
|
6349
|
+
parent: 1,
|
|
6350
|
+
order: i + 1,
|
|
6351
|
+
hasChildren: 0,
|
|
6352
|
+
scrollable: true,
|
|
6353
|
+
workspace: "layout"
|
|
6354
|
+
});
|
|
6355
|
+
layoutObj.grid[cells[i].key].component = nextId;
|
|
6356
|
+
nextId++;
|
|
6344
6357
|
}
|
|
6345
6358
|
case 1:
|
|
6346
6359
|
case "end":
|
|
@@ -6360,12 +6373,13 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6360
6373
|
_context2.next = 9;
|
|
6361
6374
|
break;
|
|
6362
6375
|
case 11:
|
|
6376
|
+
fullLayout = [layoutObj].concat(widgetItems);
|
|
6363
6377
|
if (!onCreateWorkspace) {
|
|
6364
6378
|
_context2.next = 13;
|
|
6365
6379
|
break;
|
|
6366
6380
|
}
|
|
6367
6381
|
_context2.next = 12;
|
|
6368
|
-
return onCreateWorkspace(
|
|
6382
|
+
return onCreateWorkspace(fullLayout, theme, name.trim());
|
|
6369
6383
|
case 12:
|
|
6370
6384
|
result = _context2.sent;
|
|
6371
6385
|
_context2.next = 15;
|
|
@@ -6379,7 +6393,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6379
6393
|
name: name.trim(),
|
|
6380
6394
|
menuId: menuId || 1,
|
|
6381
6395
|
themeKey: theme,
|
|
6382
|
-
layout:
|
|
6396
|
+
layout: fullLayout
|
|
6383
6397
|
};
|
|
6384
6398
|
_context2.next = 14;
|
|
6385
6399
|
return window.mainApi.workspace.saveWorkspaceForApplication(appId, workspace);
|
|
@@ -37886,9 +37900,9 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
37886
37900
|
className: "flex flex-col h-full",
|
|
37887
37901
|
children: [/*#__PURE__*/jsxs("div", {
|
|
37888
37902
|
className: "flex-shrink-0 flex flex-col gap-2 px-3 py-2 ".concat(headerStyles.backgroundColor || ""),
|
|
37889
|
-
children: [/*#__PURE__*/
|
|
37903
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
37890
37904
|
className: "flex items-center gap-2",
|
|
37891
|
-
children: /*#__PURE__*/jsx("div", {
|
|
37905
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
37892
37906
|
className: "flex-1",
|
|
37893
37907
|
children: /*#__PURE__*/jsx(SearchInput, {
|
|
37894
37908
|
value: searchQuery,
|
|
@@ -37896,7 +37910,15 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
37896
37910
|
placeholder: "Search dashboards...",
|
|
37897
37911
|
inputClassName: "py-1.5 text-xs"
|
|
37898
37912
|
})
|
|
37899
|
-
})
|
|
37913
|
+
}), onOpenWizard && /*#__PURE__*/jsx("button", {
|
|
37914
|
+
onClick: onOpenWizard,
|
|
37915
|
+
className: "flex-shrink-0 p-1.5 rounded opacity-60 hover:opacity-100 transition-opacity",
|
|
37916
|
+
title: "Dashboard Wizard",
|
|
37917
|
+
children: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
37918
|
+
icon: "wand-magic-sparkles",
|
|
37919
|
+
className: "h-3.5 w-3.5"
|
|
37920
|
+
})
|
|
37921
|
+
})]
|
|
37900
37922
|
}), /*#__PURE__*/jsx(Tabs3, {
|
|
37901
37923
|
value: installMode === "marketplace" ? "marketplace" : viewMode,
|
|
37902
37924
|
onValueChange: function onValueChange(val) {
|
|
@@ -37925,14 +37947,6 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
37925
37947
|
value: "marketplace",
|
|
37926
37948
|
className: "flex-1",
|
|
37927
37949
|
children: "Marketplace"
|
|
37928
|
-
}), onOpenWizard && /*#__PURE__*/jsx(Tabs3.Trigger, {
|
|
37929
|
-
value: "wizard",
|
|
37930
|
-
className: "flex-1",
|
|
37931
|
-
onClick: function onClick(e) {
|
|
37932
|
-
e.preventDefault();
|
|
37933
|
-
onOpenWizard();
|
|
37934
|
-
},
|
|
37935
|
-
children: "Wizard"
|
|
37936
37950
|
})]
|
|
37937
37951
|
})
|
|
37938
37952
|
})]
|
|
@@ -48093,14 +48107,15 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
48093
48107
|
function handleClickNewFromEmpty() {
|
|
48094
48108
|
setIsLayoutPickerOpen(true);
|
|
48095
48109
|
}
|
|
48096
|
-
function handleCreateFromTemplate(
|
|
48110
|
+
function handleCreateFromTemplate(layoutObjOrArray) {
|
|
48097
48111
|
var themeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
48098
48112
|
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
48099
48113
|
try {
|
|
48114
|
+
var layout = Array.isArray(layoutObjOrArray) ? layoutObjOrArray : [layoutObjOrArray];
|
|
48100
48115
|
var newWorkspace = WorkspaceModel({
|
|
48101
|
-
layout:
|
|
48116
|
+
layout: layout,
|
|
48102
48117
|
themeKey: themeKey,
|
|
48103
|
-
menuId:
|
|
48118
|
+
menuId: layout[0].menuId,
|
|
48104
48119
|
name: name || undefined
|
|
48105
48120
|
});
|
|
48106
48121
|
handleOpenTab(newWorkspace);
|