@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.js
CHANGED
|
@@ -6277,7 +6277,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6277
6277
|
|
|
6278
6278
|
// --- Create logic (DASH-191: moved above useEffect so ref captures actual function) ---
|
|
6279
6279
|
var handleCreate = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6280
|
-
var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, template, layoutObj, widgetOrder, cells, _loop, i, workspace, _t;
|
|
6280
|
+
var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, template, layoutObj, widgetOrder, cells, widgetItems, nextId, _loop, i, fullLayout, workspace, _t;
|
|
6281
6281
|
return _regeneratorRuntime.wrap(function (_context2) {
|
|
6282
6282
|
while (1) switch (_context2.prev = _context2.next) {
|
|
6283
6283
|
case 0:
|
|
@@ -6344,13 +6344,15 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6344
6344
|
}
|
|
6345
6345
|
throw new Error("No layout template selected.");
|
|
6346
6346
|
case 8:
|
|
6347
|
-
layoutObj = createLayoutFromTemplate(template, menuId || 1); // Place widgets into grid cells
|
|
6347
|
+
layoutObj = createLayoutFromTemplate(template, menuId || 1); // Place widgets into grid cells as proper layout items
|
|
6348
6348
|
widgetOrder = state.layout.widgetOrder || [];
|
|
6349
6349
|
cells = template.cells.filter(function (c) {
|
|
6350
6350
|
return !c.hide;
|
|
6351
6351
|
});
|
|
6352
|
+
widgetItems = [];
|
|
6353
|
+
nextId = 2; // grid container is ID 1
|
|
6352
6354
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(i) {
|
|
6353
|
-
var widget;
|
|
6355
|
+
var widget, widgetKey;
|
|
6354
6356
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
6355
6357
|
while (1) switch (_context.prev = _context.next) {
|
|
6356
6358
|
case 0:
|
|
@@ -6358,7 +6360,18 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6358
6360
|
return (w.name || w.key) === widgetOrder[i];
|
|
6359
6361
|
});
|
|
6360
6362
|
if (widget && layoutObj.grid[cells[i].key]) {
|
|
6361
|
-
|
|
6363
|
+
widgetKey = widget.component || widget.name || widget.key;
|
|
6364
|
+
widgetItems.push({
|
|
6365
|
+
id: nextId,
|
|
6366
|
+
component: widgetKey,
|
|
6367
|
+
parent: 1,
|
|
6368
|
+
order: i + 1,
|
|
6369
|
+
hasChildren: 0,
|
|
6370
|
+
scrollable: true,
|
|
6371
|
+
workspace: "layout"
|
|
6372
|
+
});
|
|
6373
|
+
layoutObj.grid[cells[i].key].component = nextId;
|
|
6374
|
+
nextId++;
|
|
6362
6375
|
}
|
|
6363
6376
|
case 1:
|
|
6364
6377
|
case "end":
|
|
@@ -6378,12 +6391,13 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6378
6391
|
_context2.next = 9;
|
|
6379
6392
|
break;
|
|
6380
6393
|
case 11:
|
|
6394
|
+
fullLayout = [layoutObj].concat(widgetItems);
|
|
6381
6395
|
if (!onCreateWorkspace) {
|
|
6382
6396
|
_context2.next = 13;
|
|
6383
6397
|
break;
|
|
6384
6398
|
}
|
|
6385
6399
|
_context2.next = 12;
|
|
6386
|
-
return onCreateWorkspace(
|
|
6400
|
+
return onCreateWorkspace(fullLayout, theme, name.trim());
|
|
6387
6401
|
case 12:
|
|
6388
6402
|
result = _context2.sent;
|
|
6389
6403
|
_context2.next = 15;
|
|
@@ -6397,7 +6411,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
6397
6411
|
name: name.trim(),
|
|
6398
6412
|
menuId: menuId || 1,
|
|
6399
6413
|
themeKey: theme,
|
|
6400
|
-
layout:
|
|
6414
|
+
layout: fullLayout
|
|
6401
6415
|
};
|
|
6402
6416
|
_context2.next = 14;
|
|
6403
6417
|
return window.mainApi.workspace.saveWorkspaceForApplication(appId, workspace);
|
|
@@ -7750,10 +7764,10 @@ var syntax = SyntaxError;
|
|
|
7750
7764
|
var type = TypeError;
|
|
7751
7765
|
|
|
7752
7766
|
/** @type {import('./gOPD')} */
|
|
7753
|
-
var gOPD$
|
|
7767
|
+
var gOPD$6 = Object.getOwnPropertyDescriptor;
|
|
7754
7768
|
|
|
7755
7769
|
/** @type {import('.')} */
|
|
7756
|
-
var $gOPD$2 = gOPD$
|
|
7770
|
+
var $gOPD$2 = gOPD$6;
|
|
7757
7771
|
|
|
7758
7772
|
if ($gOPD$2) {
|
|
7759
7773
|
try {
|
|
@@ -7888,7 +7902,7 @@ defineProperties$1.supportsDescriptors = !!supportsDescriptors$2;
|
|
|
7888
7902
|
|
|
7889
7903
|
var defineProperties_1 = defineProperties$1;
|
|
7890
7904
|
|
|
7891
|
-
var callBind$
|
|
7905
|
+
var callBind$7 = {exports: {}};
|
|
7892
7906
|
|
|
7893
7907
|
/** @type {import('.')} */
|
|
7894
7908
|
var esObjectAtoms = Object;
|
|
@@ -8188,78 +8202,60 @@ var callBindApplyHelpers = function callBindBasic(args) {
|
|
|
8188
8202
|
return $actualApply(bind$3, $call$1, args);
|
|
8189
8203
|
};
|
|
8190
8204
|
|
|
8191
|
-
var
|
|
8192
|
-
var
|
|
8193
|
-
|
|
8194
|
-
function requireGet () {
|
|
8195
|
-
if (hasRequiredGet) return get;
|
|
8196
|
-
hasRequiredGet = 1;
|
|
8205
|
+
var callBind$6 = callBindApplyHelpers;
|
|
8206
|
+
var gOPD$5 = gopd$1;
|
|
8197
8207
|
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
|
|
8201
|
-
|
|
8202
|
-
|
|
8203
|
-
|
|
8204
|
-
|
|
8205
|
-
} catch (e) {
|
|
8206
|
-
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
|
|
8207
|
-
throw e;
|
|
8208
|
-
}
|
|
8208
|
+
var hasProtoAccessor;
|
|
8209
|
+
try {
|
|
8210
|
+
// eslint-disable-next-line no-extra-parens, no-proto
|
|
8211
|
+
hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
|
|
8212
|
+
} catch (e) {
|
|
8213
|
+
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
|
|
8214
|
+
throw e;
|
|
8209
8215
|
}
|
|
8210
|
-
|
|
8211
|
-
// eslint-disable-next-line no-extra-parens
|
|
8212
|
-
var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
|
|
8213
|
-
|
|
8214
|
-
var $Object = Object;
|
|
8215
|
-
var $getPrototypeOf = $Object.getPrototypeOf;
|
|
8216
|
-
|
|
8217
|
-
/** @type {import('./get')} */
|
|
8218
|
-
get = desc && typeof desc.get === 'function'
|
|
8219
|
-
? callBind([desc.get])
|
|
8220
|
-
: typeof $getPrototypeOf === 'function'
|
|
8221
|
-
? /** @type {import('./get')} */ function getDunder(value) {
|
|
8222
|
-
// eslint-disable-next-line eqeqeq
|
|
8223
|
-
return $getPrototypeOf(value == null ? value : $Object(value));
|
|
8224
|
-
}
|
|
8225
|
-
: false;
|
|
8226
|
-
return get;
|
|
8227
8216
|
}
|
|
8228
8217
|
|
|
8229
|
-
|
|
8230
|
-
var
|
|
8218
|
+
// eslint-disable-next-line no-extra-parens
|
|
8219
|
+
var desc = !!hasProtoAccessor && gOPD$5 && gOPD$5(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
|
|
8231
8220
|
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
hasRequiredGetProto = 1;
|
|
8221
|
+
var $Object$3 = Object;
|
|
8222
|
+
var $getPrototypeOf = $Object$3.getPrototypeOf;
|
|
8235
8223
|
|
|
8236
|
-
|
|
8237
|
-
|
|
8224
|
+
/** @type {import('./get')} */
|
|
8225
|
+
var get = desc && typeof desc.get === 'function'
|
|
8226
|
+
? callBind$6([desc.get])
|
|
8227
|
+
: typeof $getPrototypeOf === 'function'
|
|
8228
|
+
? /** @type {import('./get')} */ function getDunder(value) {
|
|
8229
|
+
// eslint-disable-next-line eqeqeq
|
|
8230
|
+
return $getPrototypeOf(value == null ? value : $Object$3(value));
|
|
8231
|
+
}
|
|
8232
|
+
: false;
|
|
8238
8233
|
|
|
8239
|
-
|
|
8234
|
+
var reflectGetProto = requireReflect_getPrototypeOf();
|
|
8235
|
+
var originalGetProto = requireObject_getPrototypeOf();
|
|
8240
8236
|
|
|
8241
|
-
|
|
8242
|
-
|
|
8237
|
+
var getDunderProto = get;
|
|
8238
|
+
|
|
8239
|
+
/** @type {import('.')} */
|
|
8240
|
+
var getProto$3 = reflectGetProto
|
|
8241
|
+
? function getProto(O) {
|
|
8242
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
8243
|
+
return reflectGetProto(O);
|
|
8244
|
+
}
|
|
8245
|
+
: originalGetProto
|
|
8243
8246
|
? function getProto(O) {
|
|
8247
|
+
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
8248
|
+
throw new TypeError('getProto: not an object');
|
|
8249
|
+
}
|
|
8244
8250
|
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
8245
|
-
return
|
|
8251
|
+
return originalGetProto(O);
|
|
8246
8252
|
}
|
|
8247
|
-
:
|
|
8253
|
+
: getDunderProto
|
|
8248
8254
|
? function getProto(O) {
|
|
8249
|
-
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
8250
|
-
throw new TypeError('getProto: not an object');
|
|
8251
|
-
}
|
|
8252
8255
|
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
8253
|
-
return
|
|
8256
|
+
return getDunderProto(O);
|
|
8254
8257
|
}
|
|
8255
|
-
:
|
|
8256
|
-
? function getProto(O) {
|
|
8257
|
-
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
8258
|
-
return getDunderProto(O);
|
|
8259
|
-
}
|
|
8260
|
-
: null;
|
|
8261
|
-
return getProto$3;
|
|
8262
|
-
}
|
|
8258
|
+
: null;
|
|
8263
8259
|
|
|
8264
8260
|
var call = Function.prototype.call;
|
|
8265
8261
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
@@ -8322,7 +8318,7 @@ var ThrowTypeError = $gOPD$1
|
|
|
8322
8318
|
|
|
8323
8319
|
var hasSymbols$3 = hasSymbols$4();
|
|
8324
8320
|
|
|
8325
|
-
var getProto$2 =
|
|
8321
|
+
var getProto$2 = getProto$3;
|
|
8326
8322
|
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
8327
8323
|
var $ReflectGPO = requireReflect_getPrototypeOf();
|
|
8328
8324
|
|
|
@@ -8719,9 +8715,9 @@ var applyBind = function applyBind() {
|
|
|
8719
8715
|
} else {
|
|
8720
8716
|
module.exports.apply = applyBind$1;
|
|
8721
8717
|
}
|
|
8722
|
-
} (callBind$
|
|
8718
|
+
} (callBind$7));
|
|
8723
8719
|
|
|
8724
|
-
var callBindExports = callBind$
|
|
8720
|
+
var callBindExports = callBind$7.exports;
|
|
8725
8721
|
|
|
8726
8722
|
var GetIntrinsic$7 = getIntrinsic;
|
|
8727
8723
|
|
|
@@ -9020,7 +9016,7 @@ var getPolyfill$3 = polyfill$2;
|
|
|
9020
9016
|
var gOPD$2 = gopd$1;
|
|
9021
9017
|
var defineProperty = Object.defineProperty;
|
|
9022
9018
|
var $TypeError$5 = esErrors;
|
|
9023
|
-
var getProto$1 =
|
|
9019
|
+
var getProto$1 = getProto$3;
|
|
9024
9020
|
var regex = /a/;
|
|
9025
9021
|
|
|
9026
9022
|
var shim$3 = function shimFlags() {
|
|
@@ -11136,7 +11132,7 @@ var availableTypedArrays = availableTypedArrays$1;
|
|
|
11136
11132
|
var callBind = callBindExports;
|
|
11137
11133
|
var callBound$2 = callBound$i;
|
|
11138
11134
|
var gOPD = gopd$1;
|
|
11139
|
-
var getProto =
|
|
11135
|
+
var getProto = getProto$3;
|
|
11140
11136
|
|
|
11141
11137
|
var $toString = callBound$2('Object.prototype.toString');
|
|
11142
11138
|
var hasToStringTag = shams();
|
|
@@ -37922,9 +37918,9 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
37922
37918
|
className: "flex flex-col h-full",
|
|
37923
37919
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37924
37920
|
className: "flex-shrink-0 flex flex-col gap-2 px-3 py-2 ".concat(headerStyles.backgroundColor || ""),
|
|
37925
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
37921
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
37926
37922
|
className: "flex items-center gap-2",
|
|
37927
|
-
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37923
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
37928
37924
|
className: "flex-1",
|
|
37929
37925
|
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.SearchInput, {
|
|
37930
37926
|
value: searchQuery,
|
|
@@ -37932,7 +37928,15 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
37932
37928
|
placeholder: "Search dashboards...",
|
|
37933
37929
|
inputClassName: "py-1.5 text-xs"
|
|
37934
37930
|
})
|
|
37935
|
-
})
|
|
37931
|
+
}), onOpenWizard && /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
37932
|
+
onClick: onOpenWizard,
|
|
37933
|
+
className: "flex-shrink-0 p-1.5 rounded opacity-60 hover:opacity-100 transition-opacity",
|
|
37934
|
+
title: "Dashboard Wizard",
|
|
37935
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
37936
|
+
icon: "wand-magic-sparkles",
|
|
37937
|
+
className: "h-3.5 w-3.5"
|
|
37938
|
+
})
|
|
37939
|
+
})]
|
|
37936
37940
|
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3, {
|
|
37937
37941
|
value: installMode === "marketplace" ? "marketplace" : viewMode,
|
|
37938
37942
|
onValueChange: function onValueChange(val) {
|
|
@@ -37961,14 +37965,6 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
37961
37965
|
value: "marketplace",
|
|
37962
37966
|
className: "flex-1",
|
|
37963
37967
|
children: "Marketplace"
|
|
37964
|
-
}), onOpenWizard && /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
37965
|
-
value: "wizard",
|
|
37966
|
-
className: "flex-1",
|
|
37967
|
-
onClick: function onClick(e) {
|
|
37968
|
-
e.preventDefault();
|
|
37969
|
-
onOpenWizard();
|
|
37970
|
-
},
|
|
37971
|
-
children: "Wizard"
|
|
37972
37968
|
})]
|
|
37973
37969
|
})
|
|
37974
37970
|
})]
|
|
@@ -48129,14 +48125,15 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
48129
48125
|
function handleClickNewFromEmpty() {
|
|
48130
48126
|
setIsLayoutPickerOpen(true);
|
|
48131
48127
|
}
|
|
48132
|
-
function handleCreateFromTemplate(
|
|
48128
|
+
function handleCreateFromTemplate(layoutObjOrArray) {
|
|
48133
48129
|
var themeKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
48134
48130
|
var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
48135
48131
|
try {
|
|
48132
|
+
var layout = Array.isArray(layoutObjOrArray) ? layoutObjOrArray : [layoutObjOrArray];
|
|
48136
48133
|
var newWorkspace = WorkspaceModel({
|
|
48137
|
-
layout:
|
|
48134
|
+
layout: layout,
|
|
48138
48135
|
themeKey: themeKey,
|
|
48139
|
-
menuId:
|
|
48136
|
+
menuId: layout[0].menuId,
|
|
48140
48137
|
name: name || undefined
|
|
48141
48138
|
});
|
|
48142
48139
|
handleOpenTab(newWorkspace);
|