@trops/dash-core 0.1.127 → 0.1.128
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 +45 -54
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +45 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4008,13 +4008,21 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4008
4008
|
// Reset state when modal opens
|
|
4009
4009
|
React.useEffect(function () {
|
|
4010
4010
|
if (open) {
|
|
4011
|
+
var _Object$entries$sort$;
|
|
4011
4012
|
setCreationMethod(null);
|
|
4012
4013
|
setDashboardName("");
|
|
4013
4014
|
setActiveStep(0);
|
|
4014
4015
|
setLocalMenuItems(menuItems || []);
|
|
4015
4016
|
setSelectedMenuId(menuItems && menuItems.length > 0 ? menuItems[0].id : 1);
|
|
4016
4017
|
setSelectedTemplate(layoutTemplates[0]);
|
|
4017
|
-
|
|
4018
|
+
var fallback = themes ? ((_Object$entries$sort$ = Object.entries(themes).sort(function (_ref2, _ref3) {
|
|
4019
|
+
var _ref4 = _slicedToArray(_ref2, 2),
|
|
4020
|
+
a = _ref4[1];
|
|
4021
|
+
var _ref5 = _slicedToArray(_ref3, 2),
|
|
4022
|
+
b = _ref5[1];
|
|
4023
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
4024
|
+
})[0]) === null || _Object$entries$sort$ === void 0 ? void 0 : _Object$entries$sort$[0]) || null : null;
|
|
4025
|
+
setSelectedThemeKey(appThemeKey || fallback);
|
|
4018
4026
|
setImportedWorkspace(null);
|
|
4019
4027
|
setSelectedFile(null);
|
|
4020
4028
|
setIsCreatingFolder(false);
|
|
@@ -4340,7 +4348,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4340
4348
|
textColor: "text-gray-300"
|
|
4341
4349
|
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
4342
4350
|
className: "text-base font-normal text-gray-400",
|
|
4343
|
-
children: "Choose a theme for this dashboard
|
|
4351
|
+
children: "Choose a theme for this dashboard."
|
|
4344
4352
|
}), selectedThemeKey !== null && themes && themes[selectedThemeKey] && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4345
4353
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4346
4354
|
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
@@ -4361,45 +4369,19 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4361
4369
|
className: "w-8 h-8 rounded bg-".concat(themes[selectedThemeKey].tertiary, "-500")
|
|
4362
4370
|
})]
|
|
4363
4371
|
})]
|
|
4364
|
-
}), selectedThemeKey === null && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4365
|
-
className: "flex flex-row items-center space-x-2 mt-4 pt-4 border-t border-gray-700",
|
|
4366
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
4367
|
-
icon: "palette",
|
|
4368
|
-
className: "text-blue-400"
|
|
4369
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
4370
|
-
className: "text-sm font-medium text-gray-300",
|
|
4371
|
-
children: "App Default"
|
|
4372
|
-
})]
|
|
4373
4372
|
})]
|
|
4374
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
4373
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4375
4374
|
className: "flex flex-col w-2/3 p-6 overflow-y-auto space-y-2",
|
|
4376
|
-
children:
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
children: "App Default"
|
|
4387
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4388
|
-
className: "flex flex-row space-x-1 ml-auto",
|
|
4389
|
-
children: themes && appThemeKey && themes[appThemeKey] && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
4390
|
-
children: [themes[appThemeKey].primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4391
|
-
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].primary, "-500")
|
|
4392
|
-
}), themes[appThemeKey].secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4393
|
-
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].secondary, "-500")
|
|
4394
|
-
}), themes[appThemeKey].tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4395
|
-
className: "w-4 h-4 rounded bg-".concat(themes[appThemeKey].tertiary, "-500")
|
|
4396
|
-
})]
|
|
4397
|
-
})
|
|
4398
|
-
})]
|
|
4399
|
-
}), themes && Object.entries(themes).map(function (_ref2) {
|
|
4400
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
4401
|
-
key = _ref3[0],
|
|
4402
|
-
t = _ref3[1];
|
|
4375
|
+
children: themes && Object.entries(themes).sort(function (_ref6, _ref7) {
|
|
4376
|
+
var _ref8 = _slicedToArray(_ref6, 2),
|
|
4377
|
+
a = _ref8[1];
|
|
4378
|
+
var _ref9 = _slicedToArray(_ref7, 2),
|
|
4379
|
+
b = _ref9[1];
|
|
4380
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
4381
|
+
}).map(function (_ref0) {
|
|
4382
|
+
var _ref1 = _slicedToArray(_ref0, 2),
|
|
4383
|
+
key = _ref1[0],
|
|
4384
|
+
t = _ref1[1];
|
|
4403
4385
|
var isThemeSelected = selectedThemeKey === key;
|
|
4404
4386
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4405
4387
|
className: "flex flex-row items-center px-4 py-3 rounded-lg cursor-pointer transition-all ".concat(isThemeSelected ? "ring-2 ring-blue-500 bg-gray-700" : "hover:bg-gray-750 hover:ring-1 hover:ring-gray-600 bg-gray-800/50"),
|
|
@@ -4423,7 +4405,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4423
4405
|
})]
|
|
4424
4406
|
})]
|
|
4425
4407
|
}, key);
|
|
4426
|
-
})
|
|
4408
|
+
})
|
|
4427
4409
|
})]
|
|
4428
4410
|
});
|
|
4429
4411
|
}
|
|
@@ -32782,18 +32764,21 @@ var DashboardDetail = function DashboardDetail(_ref2) {
|
|
|
32782
32764
|
value: String(m.id)
|
|
32783
32765
|
};
|
|
32784
32766
|
});
|
|
32785
|
-
var themeOptions =
|
|
32786
|
-
|
|
32787
|
-
|
|
32788
|
-
|
|
32789
|
-
|
|
32790
|
-
|
|
32791
|
-
|
|
32767
|
+
var themeOptions = _toConsumableArray(Object.entries(themes || {}).sort(function (_ref3, _ref4) {
|
|
32768
|
+
var _ref5 = _slicedToArray(_ref3, 2),
|
|
32769
|
+
a = _ref5[1];
|
|
32770
|
+
var _ref6 = _slicedToArray(_ref4, 2),
|
|
32771
|
+
b = _ref6[1];
|
|
32772
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
32773
|
+
}).map(function (_ref7) {
|
|
32774
|
+
var _ref8 = _slicedToArray(_ref7, 2),
|
|
32775
|
+
key = _ref8[0],
|
|
32776
|
+
t = _ref8[1];
|
|
32792
32777
|
return {
|
|
32793
32778
|
label: t.name || key,
|
|
32794
32779
|
value: key
|
|
32795
32780
|
};
|
|
32796
|
-
}))
|
|
32781
|
+
}));
|
|
32797
32782
|
function handleChangeFolder(val) {
|
|
32798
32783
|
if (!dashApi || !appId) return;
|
|
32799
32784
|
var updated = DashReact.deepCopy(ws);
|
|
@@ -32880,7 +32865,7 @@ var DashboardDetail = function DashboardDetail(_ref2) {
|
|
|
32880
32865
|
return handleChangeTheme(val);
|
|
32881
32866
|
},
|
|
32882
32867
|
options: themeOptions,
|
|
32883
|
-
placeholder: "
|
|
32868
|
+
placeholder: "Select a theme"
|
|
32884
32869
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
32885
32870
|
className: "flex flex-row items-center gap-2",
|
|
32886
32871
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
@@ -42211,10 +42196,16 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
42211
42196
|
className: "w-40 shrink-0"
|
|
42212
42197
|
}), onThemeChange && Object.keys(resolvedThemes).length > 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
|
|
42213
42198
|
value: workspaceSelected.themeKey || "",
|
|
42214
|
-
options: Object.entries(resolvedThemes).
|
|
42215
|
-
var
|
|
42216
|
-
|
|
42217
|
-
|
|
42199
|
+
options: Object.entries(resolvedThemes).sort(function (_ref2, _ref3) {
|
|
42200
|
+
var _ref4 = _slicedToArray(_ref2, 2),
|
|
42201
|
+
a = _ref4[1];
|
|
42202
|
+
var _ref5 = _slicedToArray(_ref3, 2),
|
|
42203
|
+
b = _ref5[1];
|
|
42204
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
42205
|
+
}).map(function (_ref6) {
|
|
42206
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
42207
|
+
key = _ref7[0],
|
|
42208
|
+
t = _ref7[1];
|
|
42218
42209
|
return {
|
|
42219
42210
|
label: t.name || key,
|
|
42220
42211
|
value: key,
|
|
@@ -42222,7 +42213,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
42222
42213
|
};
|
|
42223
42214
|
}),
|
|
42224
42215
|
onChange: onThemeChange,
|
|
42225
|
-
placeholder: "
|
|
42216
|
+
placeholder: "Select a theme",
|
|
42226
42217
|
backgroundColor: currentTheme["bg-primary-very-dark"],
|
|
42227
42218
|
textColor: currentTheme["text-primary-medium"],
|
|
42228
42219
|
borderColor: currentTheme["border-primary-dark"],
|