@trops/dash-core 0.1.402 → 0.1.404
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 +226 -208
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +226 -207
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12782,15 +12782,12 @@ var deepEqual = function deepEqual(a, b, opts) {
|
|
|
12782
12782
|
|
|
12783
12783
|
var deepEqual$1 = /*@__PURE__*/getDefaultExportFromCjs(deepEqual);
|
|
12784
12784
|
|
|
12785
|
-
function ownKeys$O(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12786
|
-
function _objectSpread$O(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$O(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$O(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12787
12785
|
var PanelEditItem = function PanelEditItem(_ref) {
|
|
12788
12786
|
var _ComponentManager$get;
|
|
12789
12787
|
var workspace = _ref.workspace,
|
|
12790
12788
|
onUpdate = _ref.onUpdate,
|
|
12791
12789
|
_ref$item = _ref.item,
|
|
12792
12790
|
item = _ref$item === void 0 ? null : _ref$item;
|
|
12793
|
-
var appContext = React.useContext(AppContext);
|
|
12794
12791
|
var _useState = React.useState(item),
|
|
12795
12792
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12796
12793
|
itemSelected = _useState2[0],
|
|
@@ -12805,10 +12802,6 @@ var PanelEditItem = function PanelEditItem(_ref) {
|
|
|
12805
12802
|
var forceUpdate = React.useCallback(function () {
|
|
12806
12803
|
return updateState({});
|
|
12807
12804
|
}, []);
|
|
12808
|
-
var allProviders = (appContext === null || appContext === void 0 ? void 0 : appContext.providers) || {};
|
|
12809
|
-
var widgetConfig = itemSelected ? ComponentManager.config(itemSelected.component, itemSelected) : null;
|
|
12810
|
-
var providerRequirements = (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.providers) || [];
|
|
12811
|
-
var selectedProviders = (itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected.selectedProviders) || {};
|
|
12812
12805
|
React.useEffect(function () {
|
|
12813
12806
|
if (deepEqual$1(item, itemSelected) === false) {
|
|
12814
12807
|
setItemSelected(function () {
|
|
@@ -12831,23 +12824,6 @@ var PanelEditItem = function PanelEditItem(_ref) {
|
|
|
12831
12824
|
onUpdate(data, workspaceTemp);
|
|
12832
12825
|
forceUpdate();
|
|
12833
12826
|
}
|
|
12834
|
-
function handleProviderChange(providerType, providerId) {
|
|
12835
|
-
var newItem = JSON.parse(JSON.stringify(itemSelected));
|
|
12836
|
-
newItem.selectedProviders = newItem.selectedProviders || {};
|
|
12837
|
-
newItem.selectedProviders[providerType] = providerId;
|
|
12838
|
-
var workspaceTemp = WorkspaceModel(workspaceSelected);
|
|
12839
|
-
var newLayout = replaceItemInLayout(workspaceTemp.layout, newItem["id"], newItem);
|
|
12840
|
-
workspaceTemp.layout = newLayout;
|
|
12841
|
-
|
|
12842
|
-
// Also update workspace-level selectedProviders
|
|
12843
|
-
var uuid = newItem.uuid || newItem.uuidString;
|
|
12844
|
-
if (uuid) {
|
|
12845
|
-
workspaceTemp.selectedProviders = workspaceTemp.selectedProviders || {};
|
|
12846
|
-
workspaceTemp.selectedProviders[uuid] = _objectSpread$O(_objectSpread$O({}, workspaceTemp.selectedProviders[uuid] || {}), {}, _defineProperty({}, providerType, providerId));
|
|
12847
|
-
}
|
|
12848
|
-
onUpdate(newItem, workspaceTemp);
|
|
12849
|
-
forceUpdate();
|
|
12850
|
-
}
|
|
12851
12827
|
function renderCustomSettings() {
|
|
12852
12828
|
if (itemSelected) {
|
|
12853
12829
|
var componentConfig = ComponentManager.getComponent(itemSelected.component);
|
|
@@ -12948,68 +12924,15 @@ var PanelEditItem = function PanelEditItem(_ref) {
|
|
|
12948
12924
|
}, "config-item-".concat(key));
|
|
12949
12925
|
}
|
|
12950
12926
|
var hasCustomSettings = itemSelected && ((_ComponentManager$get = ComponentManager.getComponent(itemSelected.component)) === null || _ComponentManager$get === void 0 ? void 0 : _ComponentManager$get.userConfig);
|
|
12951
|
-
return itemSelected && workspaceSelected && /*#__PURE__*/jsxRuntime.
|
|
12927
|
+
return itemSelected && workspaceSelected && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
12952
12928
|
className: "flex flex-col flex-1 min-h-0 overflow-y-auto p-6 space-y-6",
|
|
12953
|
-
children:
|
|
12929
|
+
children: hasCustomSettings && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12954
12930
|
className: "flex flex-col space-y-3",
|
|
12955
12931
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
|
|
12956
12932
|
title: "Configuration",
|
|
12957
12933
|
padding: false
|
|
12958
12934
|
}), renderCustomSettings()]
|
|
12959
|
-
})
|
|
12960
|
-
className: "flex flex-col space-y-3",
|
|
12961
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
|
|
12962
|
-
title: "Providers",
|
|
12963
|
-
padding: false
|
|
12964
|
-
}), providerRequirements.map(function (req) {
|
|
12965
|
-
var providerType = req.type;
|
|
12966
|
-
var currentSelection = selectedProviders[providerType] || "";
|
|
12967
|
-
var availableProviders = Object.entries(allProviders).filter(function (_ref2) {
|
|
12968
|
-
var _ref3 = _slicedToArray(_ref2, 2),
|
|
12969
|
-
p = _ref3[1];
|
|
12970
|
-
return p.type === providerType;
|
|
12971
|
-
}).map(function (_ref4) {
|
|
12972
|
-
var _ref5 = _slicedToArray(_ref4, 2),
|
|
12973
|
-
name = _ref5[0],
|
|
12974
|
-
p = _ref5[1];
|
|
12975
|
-
return _objectSpread$O({
|
|
12976
|
-
name: name
|
|
12977
|
-
}, p);
|
|
12978
|
-
});
|
|
12979
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12980
|
-
className: "flex flex-col space-y-1",
|
|
12981
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
12982
|
-
className: "flex items-center gap-1",
|
|
12983
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FormLabel, {
|
|
12984
|
-
title: providerType,
|
|
12985
|
-
textSize: "text-sm"
|
|
12986
|
-
}), req.required && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
12987
|
-
className: "text-red-500 text-sm",
|
|
12988
|
-
children: "*"
|
|
12989
|
-
})]
|
|
12990
|
-
}), /*#__PURE__*/jsxRuntime.jsxs(DashReact.SelectMenu, {
|
|
12991
|
-
name: "provider-".concat(providerType),
|
|
12992
|
-
textSize: "text-sm",
|
|
12993
|
-
selectedValue: currentSelection,
|
|
12994
|
-
onChange: function onChange(e) {
|
|
12995
|
-
return handleProviderChange(providerType, e.target.value);
|
|
12996
|
-
},
|
|
12997
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("option", {
|
|
12998
|
-
value: "",
|
|
12999
|
-
children: "-- Select Provider --"
|
|
13000
|
-
}), availableProviders.map(function (provider) {
|
|
13001
|
-
return /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
13002
|
-
value: provider.name,
|
|
13003
|
-
children: provider.name
|
|
13004
|
-
}, provider.name);
|
|
13005
|
-
})]
|
|
13006
|
-
}), availableProviders.length === 0 && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
13007
|
-
className: "text-xs opacity-40",
|
|
13008
|
-
children: ["No ", providerType, " providers configured"]
|
|
13009
|
-
})]
|
|
13010
|
-
}, providerType);
|
|
13011
|
-
})]
|
|
13012
|
-
})]
|
|
12935
|
+
})
|
|
13013
12936
|
});
|
|
13014
12937
|
};
|
|
13015
12938
|
|
|
@@ -13017,8 +12940,8 @@ var _excluded$6 = ["rows", "cols"];
|
|
|
13017
12940
|
function _createForOfIteratorHelper$o(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$o(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13018
12941
|
function _unsupportedIterableToArray$o(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$o(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$o(r, a) : void 0; } }
|
|
13019
12942
|
function _arrayLikeToArray$o(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13020
|
-
function ownKeys$
|
|
13021
|
-
function _objectSpread$
|
|
12943
|
+
function ownKeys$O(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12944
|
+
function _objectSpread$O(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$O(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$O(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13022
12945
|
var defaultGrid = {
|
|
13023
12946
|
rows: 1,
|
|
13024
12947
|
cols: 1,
|
|
@@ -13039,7 +12962,7 @@ function GridEditor(_ref) {
|
|
|
13039
12962
|
setGrid = _useState2[1];
|
|
13040
12963
|
var addRow = function addRow() {
|
|
13041
12964
|
var newRow = grid.rows;
|
|
13042
|
-
var newGrid = _objectSpread$
|
|
12965
|
+
var newGrid = _objectSpread$O(_objectSpread$O({}, grid), {}, {
|
|
13043
12966
|
rows: grid.rows + 1
|
|
13044
12967
|
});
|
|
13045
12968
|
for (var col = 0; col < grid.cols; col++) {
|
|
@@ -13054,7 +12977,7 @@ function GridEditor(_ref) {
|
|
|
13054
12977
|
};
|
|
13055
12978
|
var addColumn = function addColumn() {
|
|
13056
12979
|
var newCol = grid.cols;
|
|
13057
|
-
var newGrid = _objectSpread$
|
|
12980
|
+
var newGrid = _objectSpread$O(_objectSpread$O({}, grid), {}, {
|
|
13058
12981
|
cols: grid.cols + 1
|
|
13059
12982
|
});
|
|
13060
12983
|
for (var row = 0; row < grid.rows; row++) {
|
|
@@ -13087,8 +13010,8 @@ function GridEditor(_ref) {
|
|
|
13087
13010
|
});
|
|
13088
13011
|
}
|
|
13089
13012
|
if (grid[nextKey]) {
|
|
13090
|
-
var newGrid = _objectSpread$
|
|
13091
|
-
newGrid[currentKey] = _objectSpread$
|
|
13013
|
+
var newGrid = _objectSpread$O({}, grid);
|
|
13014
|
+
newGrid[currentKey] = _objectSpread$O(_objectSpread$O({}, newGrid[currentKey]), {}, {
|
|
13092
13015
|
colSpan: newGrid[currentKey].colSpan + 1
|
|
13093
13016
|
});
|
|
13094
13017
|
delete newGrid[nextKey];
|
|
@@ -13101,8 +13024,8 @@ function GridEditor(_ref) {
|
|
|
13101
13024
|
var currentKey = "".concat(row, ".").concat(col);
|
|
13102
13025
|
var belowKey = "".concat(row + 1, ".").concat(col);
|
|
13103
13026
|
if (grid[belowKey]) {
|
|
13104
|
-
var newGrid = _objectSpread$
|
|
13105
|
-
newGrid[currentKey] = _objectSpread$
|
|
13027
|
+
var newGrid = _objectSpread$O({}, grid);
|
|
13028
|
+
newGrid[currentKey] = _objectSpread$O(_objectSpread$O({}, newGrid[currentKey]), {}, {
|
|
13106
13029
|
rowSpan: newGrid[currentKey].rowSpan + 1
|
|
13107
13030
|
});
|
|
13108
13031
|
delete newGrid[belowKey];
|
|
@@ -13119,7 +13042,7 @@ function GridEditor(_ref) {
|
|
|
13119
13042
|
var splitCell = function splitCell(row, col) {
|
|
13120
13043
|
var key = "".concat(row, ".").concat(col);
|
|
13121
13044
|
var cell = grid[key];
|
|
13122
|
-
var newGrid = _objectSpread$
|
|
13045
|
+
var newGrid = _objectSpread$O({}, grid);
|
|
13123
13046
|
|
|
13124
13047
|
// we have to check the colspan, and since the colspan is greater than 1
|
|
13125
13048
|
// Only handle horizontal split if colSpan > 1
|
|
@@ -13135,13 +13058,13 @@ function GridEditor(_ref) {
|
|
|
13135
13058
|
var oldKey = "".concat(row, ".").concat(c);
|
|
13136
13059
|
var newKey = "".concat(row, ".").concat(c + 1);
|
|
13137
13060
|
if (newGrid[oldKey]) {
|
|
13138
|
-
newGrid[newKey] = _objectSpread$
|
|
13061
|
+
newGrid[newKey] = _objectSpread$O({}, newGrid[oldKey]);
|
|
13139
13062
|
delete newGrid[oldKey];
|
|
13140
13063
|
}
|
|
13141
13064
|
}
|
|
13142
13065
|
|
|
13143
13066
|
// Update the original cell's colSpan
|
|
13144
|
-
newGrid[key] = _objectSpread$
|
|
13067
|
+
newGrid[key] = _objectSpread$O(_objectSpread$O({}, cell), {}, {
|
|
13145
13068
|
colSpan: cell.colSpan - 1
|
|
13146
13069
|
});
|
|
13147
13070
|
|
|
@@ -13153,7 +13076,7 @@ function GridEditor(_ref) {
|
|
|
13153
13076
|
};
|
|
13154
13077
|
}
|
|
13155
13078
|
if (cell.rowSpan > 1) {
|
|
13156
|
-
newGrid[key] = _objectSpread$
|
|
13079
|
+
newGrid[key] = _objectSpread$O(_objectSpread$O({}, newGrid[key]), {}, {
|
|
13157
13080
|
rowSpan: cell.rowSpan - 1
|
|
13158
13081
|
});
|
|
13159
13082
|
newGrid["".concat(row + 1, ".").concat(col)] = {
|
|
@@ -13272,7 +13195,7 @@ function GridEditor(_ref) {
|
|
|
13272
13195
|
var fromKey = "".concat(from.row, ".").concat(from.col);
|
|
13273
13196
|
var toKey = "".concat(to.row, ".").concat(to.col);
|
|
13274
13197
|
if (fromKey === toKey) return;
|
|
13275
|
-
var newGrid = _objectSpread$
|
|
13198
|
+
var newGrid = _objectSpread$O({}, grid);
|
|
13276
13199
|
|
|
13277
13200
|
// Swap the cells
|
|
13278
13201
|
var temp = newGrid[fromKey];
|
|
@@ -13298,7 +13221,7 @@ function GridEditor(_ref) {
|
|
|
13298
13221
|
// console.log("Grid updated:", sequencedGrid);
|
|
13299
13222
|
}
|
|
13300
13223
|
function resetGridLayout() {
|
|
13301
|
-
var newGrid = _objectSpread$
|
|
13224
|
+
var newGrid = _objectSpread$O({}, defaultGrid);
|
|
13302
13225
|
setGrid(newGrid);
|
|
13303
13226
|
onUpdate(newGrid);
|
|
13304
13227
|
}
|
|
@@ -13576,8 +13499,8 @@ var PanelEditItemGrid = function PanelEditItemGrid(_ref) {
|
|
|
13576
13499
|
});
|
|
13577
13500
|
};
|
|
13578
13501
|
|
|
13579
|
-
function ownKeys$
|
|
13580
|
-
function _objectSpread$
|
|
13502
|
+
function ownKeys$N(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13503
|
+
function _objectSpread$N(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$N(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$N(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13581
13504
|
var PanelEditItemNotifications = function PanelEditItemNotifications(_ref) {
|
|
13582
13505
|
var item = _ref.item;
|
|
13583
13506
|
_ref.workspace;
|
|
@@ -13600,7 +13523,7 @@ var PanelEditItemNotifications = function PanelEditItemNotifications(_ref) {
|
|
|
13600
13523
|
}, [widgetUuid, notificationDefs.length]);
|
|
13601
13524
|
function handleNotifToggle(typeKey, value) {
|
|
13602
13525
|
var _window$mainApi2;
|
|
13603
|
-
var updated = _objectSpread$
|
|
13526
|
+
var updated = _objectSpread$N(_objectSpread$N({}, notifPrefs), {}, _defineProperty({}, typeKey, value));
|
|
13604
13527
|
setNotifPrefs(updated);
|
|
13605
13528
|
if ((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && (_window$mainApi2 = _window$mainApi2.notifications) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.setPreferences && widgetUuid) {
|
|
13606
13529
|
window.mainApi.notifications.setPreferences(widgetUuid, _defineProperty({}, typeKey, value));
|
|
@@ -13645,8 +13568,8 @@ var PanelEditItemNotifications = function PanelEditItemNotifications(_ref) {
|
|
|
13645
13568
|
function _createForOfIteratorHelper$n(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$n(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
13646
13569
|
function _unsupportedIterableToArray$n(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$n(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$n(r, a) : void 0; } }
|
|
13647
13570
|
function _arrayLikeToArray$n(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
13648
|
-
function ownKeys$
|
|
13649
|
-
function _objectSpread$
|
|
13571
|
+
function ownKeys$M(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13572
|
+
function _objectSpread$M(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$M(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$M(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13650
13573
|
var DAYS = [{
|
|
13651
13574
|
key: "mon",
|
|
13652
13575
|
label: "Mon"
|
|
@@ -13747,7 +13670,7 @@ function TaskScheduleEditor(_ref) {
|
|
|
13747
13670
|
var _window$mainApi;
|
|
13748
13671
|
var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
13749
13672
|
if (!((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && (_window$mainApi = _window$mainApi.scheduler) !== null && _window$mainApi !== void 0 && _window$mainApi.registerTask)) return;
|
|
13750
|
-
var payload = _objectSpread$
|
|
13673
|
+
var payload = _objectSpread$M({
|
|
13751
13674
|
widgetId: widgetId,
|
|
13752
13675
|
widgetName: widgetName,
|
|
13753
13676
|
workspaceId: workspaceId || "",
|
|
@@ -14368,11 +14291,147 @@ var PanelEditItemHandlers = function PanelEditItemHandlers(_ref) {
|
|
|
14368
14291
|
});
|
|
14369
14292
|
};
|
|
14370
14293
|
|
|
14294
|
+
var getUserConfigurableProviders = function getUserConfigurableProviders(providers) {
|
|
14295
|
+
if (!providers) return [];
|
|
14296
|
+
return providers.filter(function (p) {
|
|
14297
|
+
return p.providerClass !== "api";
|
|
14298
|
+
});
|
|
14299
|
+
};
|
|
14300
|
+
|
|
14301
|
+
function ownKeys$L(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14302
|
+
function _objectSpread$L(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$L(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$L(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14303
|
+
var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
|
|
14304
|
+
var workspace = _ref.workspace,
|
|
14305
|
+
onUpdate = _ref.onUpdate,
|
|
14306
|
+
_ref$item = _ref.item,
|
|
14307
|
+
item = _ref$item === void 0 ? null : _ref$item;
|
|
14308
|
+
var appCtx = React.useContext(AppContext);
|
|
14309
|
+
var appProviders = (appCtx === null || appCtx === void 0 ? void 0 : appCtx.providers) || {};
|
|
14310
|
+
var _useState = React.useState(item),
|
|
14311
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14312
|
+
itemSelected = _useState2[0],
|
|
14313
|
+
setItemSelected = _useState2[1];
|
|
14314
|
+
var _useState3 = React.useState(workspace),
|
|
14315
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
14316
|
+
workspaceSelected = _useState4[0],
|
|
14317
|
+
setWorkspaceSelected = _useState4[1];
|
|
14318
|
+
React.useEffect(function () {
|
|
14319
|
+
if (!deepEqual$1(item, itemSelected)) setItemSelected(function () {
|
|
14320
|
+
return item;
|
|
14321
|
+
});
|
|
14322
|
+
if (!deepEqual$1(workspace, workspaceSelected)) setWorkspaceSelected(function () {
|
|
14323
|
+
return workspace;
|
|
14324
|
+
});
|
|
14325
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14326
|
+
}, [workspace, item]);
|
|
14327
|
+
if (!itemSelected || !workspaceSelected) return null;
|
|
14328
|
+
var widgetConfig = ComponentManager.config(itemSelected.component, itemSelected);
|
|
14329
|
+
var declaredProviders = Array.isArray(widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.providers) ? widgetConfig.providers : Array.isArray(itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected.providers) ? itemSelected.providers : [];
|
|
14330
|
+
var providerRequirements = getUserConfigurableProviders(declaredProviders);
|
|
14331
|
+
var selectedProviders = itemSelected.selectedProviders || {};
|
|
14332
|
+
function handleProviderChange(providerType, providerName) {
|
|
14333
|
+
var updatedItem = DashReact.deepCopy(itemSelected);
|
|
14334
|
+
var nextProviders = _objectSpread$L({}, updatedItem.selectedProviders || {});
|
|
14335
|
+
if (providerName) {
|
|
14336
|
+
nextProviders[providerType] = providerName;
|
|
14337
|
+
} else {
|
|
14338
|
+
delete nextProviders[providerType];
|
|
14339
|
+
}
|
|
14340
|
+
updatedItem.selectedProviders = nextProviders;
|
|
14341
|
+
var updatedWorkspace = DashReact.deepCopy(workspaceSelected);
|
|
14342
|
+
updatedWorkspace.layout = replaceItemInLayout(updatedWorkspace.layout, updatedItem.id, updatedItem);
|
|
14343
|
+
setItemSelected(function () {
|
|
14344
|
+
return updatedItem;
|
|
14345
|
+
});
|
|
14346
|
+
setWorkspaceSelected(function () {
|
|
14347
|
+
return updatedWorkspace;
|
|
14348
|
+
});
|
|
14349
|
+
onUpdate(updatedItem, updatedWorkspace);
|
|
14350
|
+
}
|
|
14351
|
+
if (providerRequirements.length === 0) {
|
|
14352
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14353
|
+
className: "flex items-center justify-center h-full text-sm opacity-60 text-center px-6",
|
|
14354
|
+
children: "This widget doesn't declare any providers."
|
|
14355
|
+
});
|
|
14356
|
+
}
|
|
14357
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14358
|
+
className: "flex flex-col flex-1 min-h-0 overflow-y-auto p-6 space-y-4",
|
|
14359
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14360
|
+
className: "text-sm opacity-70",
|
|
14361
|
+
children: "Bind each required provider so the widget can connect to its data source. Changes save immediately."
|
|
14362
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14363
|
+
className: "space-y-3",
|
|
14364
|
+
children: providerRequirements.map(function (req) {
|
|
14365
|
+
var type = req.type;
|
|
14366
|
+
var current = selectedProviders[type] || "";
|
|
14367
|
+
var options = Object.entries(appProviders).filter(function (_ref2) {
|
|
14368
|
+
var _ref3 = _slicedToArray(_ref2, 2),
|
|
14369
|
+
p = _ref3[1];
|
|
14370
|
+
return p && p.type === type;
|
|
14371
|
+
}).map(function (_ref4) {
|
|
14372
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
14373
|
+
name = _ref5[0],
|
|
14374
|
+
p = _ref5[1];
|
|
14375
|
+
return _objectSpread$L({
|
|
14376
|
+
name: name
|
|
14377
|
+
}, p);
|
|
14378
|
+
});
|
|
14379
|
+
var isConfigured = !!current;
|
|
14380
|
+
var isMissing = req.required && !isConfigured;
|
|
14381
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14382
|
+
className: "rounded border px-3 py-2 ".concat(isMissing ? "bg-red-900 border-red-500" : "bg-gray-800 border-gray-700"),
|
|
14383
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14384
|
+
className: "flex items-center gap-2",
|
|
14385
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
14386
|
+
className: "text-sm font-medium ".concat(isMissing ? "text-red-100" : "text-gray-100"),
|
|
14387
|
+
children: type
|
|
14388
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
14389
|
+
className: "text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded font-semibold ".concat(isMissing ? "bg-red-600 text-white" : req.required ? "bg-indigo-800 text-indigo-100" : "bg-gray-700 text-gray-300"),
|
|
14390
|
+
children: req.required ? "required" : "optional"
|
|
14391
|
+
})]
|
|
14392
|
+
}), req.description && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14393
|
+
className: "text-xs opacity-60 mt-1",
|
|
14394
|
+
children: req.description
|
|
14395
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14396
|
+
className: "mt-2",
|
|
14397
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("select", {
|
|
14398
|
+
value: current,
|
|
14399
|
+
onChange: function onChange(e) {
|
|
14400
|
+
return handleProviderChange(type, e.target.value);
|
|
14401
|
+
},
|
|
14402
|
+
className: "w-full bg-gray-900 border rounded px-2 py-1.5 text-sm ".concat(isMissing ? "border-red-500" : "border-gray-700"),
|
|
14403
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("option", {
|
|
14404
|
+
value: "",
|
|
14405
|
+
children: req.required ? "— select a provider —" : "— none —"
|
|
14406
|
+
}), options.map(function (opt) {
|
|
14407
|
+
return /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
14408
|
+
value: opt.name,
|
|
14409
|
+
children: opt.name
|
|
14410
|
+
}, opt.name);
|
|
14411
|
+
})]
|
|
14412
|
+
}), options.length === 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14413
|
+
className: "mt-1 text-[11px] text-amber-300",
|
|
14414
|
+
children: ["No ", type, " providers configured. Add one in Settings > Providers."]
|
|
14415
|
+
})]
|
|
14416
|
+
})]
|
|
14417
|
+
}, type);
|
|
14418
|
+
})
|
|
14419
|
+
})]
|
|
14420
|
+
});
|
|
14421
|
+
};
|
|
14422
|
+
|
|
14371
14423
|
var getSections = function getSections(item) {
|
|
14372
14424
|
var _widgetConfig$notific, _widgetConfig$schedul;
|
|
14373
14425
|
var widgetConfig = item ? ComponentManager.config(item.component, item) : null;
|
|
14374
14426
|
var hasNotifications = (widgetConfig === null || widgetConfig === void 0 || (_widgetConfig$notific = widgetConfig.notifications) === null || _widgetConfig$notific === void 0 ? void 0 : _widgetConfig$notific.length) > 0;
|
|
14375
14427
|
var hasScheduledTasks = (widgetConfig === null || widgetConfig === void 0 || (_widgetConfig$schedul = widgetConfig.scheduledTasks) === null || _widgetConfig$schedul === void 0 ? void 0 : _widgetConfig$schedul.length) > 0;
|
|
14428
|
+
// Show the Providers section whenever the widget declares any
|
|
14429
|
+
// user-configurable providers. Previously provider selection lived
|
|
14430
|
+
// inline in the card header dropdown; this moves it into the
|
|
14431
|
+
// widget config modal so the header stays uncluttered and there's
|
|
14432
|
+
// room for richer per-provider UX.
|
|
14433
|
+
var declaredProviders = Array.isArray(widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.providers) ? widgetConfig.providers : Array.isArray(item === null || item === void 0 ? void 0 : item.providers) ? item.providers : [];
|
|
14434
|
+
var userConfigurableProviders = getUserConfigurableProviders(declaredProviders);
|
|
14376
14435
|
return [{
|
|
14377
14436
|
key: "edit",
|
|
14378
14437
|
label: "Settings",
|
|
@@ -14393,6 +14452,10 @@ var getSections = function getSections(item) {
|
|
|
14393
14452
|
key: "handlers",
|
|
14394
14453
|
label: "Listeners",
|
|
14395
14454
|
icon: "phone"
|
|
14455
|
+
}] : []), _toConsumableArray(userConfigurableProviders.length > 0 ? [{
|
|
14456
|
+
key: "providers",
|
|
14457
|
+
label: "Providers",
|
|
14458
|
+
icon: "plug"
|
|
14396
14459
|
}] : []), [{
|
|
14397
14460
|
key: "code",
|
|
14398
14461
|
label: "Code",
|
|
@@ -14515,6 +14578,10 @@ var LayoutBuilderConfigModal = function LayoutBuilderConfigModal(_ref) {
|
|
|
14515
14578
|
item: itemSelected,
|
|
14516
14579
|
onUpdate: handleEditChange,
|
|
14517
14580
|
workspace: workspaceSelected
|
|
14581
|
+
}), activeSection === "providers" && /*#__PURE__*/jsxRuntime.jsx(PanelEditItemProviders, {
|
|
14582
|
+
item: itemSelected,
|
|
14583
|
+
onUpdate: handleEditChange,
|
|
14584
|
+
workspace: workspaceSelected
|
|
14518
14585
|
}), activeSection === "code" && /*#__PURE__*/jsxRuntime.jsx(PanelCode, {
|
|
14519
14586
|
item: itemSelected,
|
|
14520
14587
|
onUpdate: handleEditChange,
|
|
@@ -16830,13 +16897,6 @@ function mcpJsonToFormState(jsonString, nextRowId) {
|
|
|
16830
16897
|
return result;
|
|
16831
16898
|
}
|
|
16832
16899
|
|
|
16833
|
-
var getUserConfigurableProviders = function getUserConfigurableProviders(providers) {
|
|
16834
|
-
if (!providers) return [];
|
|
16835
|
-
return providers.filter(function (p) {
|
|
16836
|
-
return p.providerClass !== "api";
|
|
16837
|
-
});
|
|
16838
|
-
};
|
|
16839
|
-
|
|
16840
16900
|
function _createForOfIteratorHelper$m(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$m(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
16841
16901
|
function _unsupportedIterableToArray$m(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$m(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$m(r, a) : void 0; } }
|
|
16842
16902
|
function _arrayLikeToArray$m(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -18710,13 +18770,12 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
18710
18770
|
var item = _ref.item,
|
|
18711
18771
|
widget = _ref.widget,
|
|
18712
18772
|
_ref$cellNumber = _ref.cellNumber,
|
|
18713
|
-
cellNumber = _ref$cellNumber === void 0 ? null : _ref$cellNumber
|
|
18714
|
-
_ref
|
|
18715
|
-
|
|
18716
|
-
_ref$selectedProvider
|
|
18717
|
-
|
|
18718
|
-
|
|
18719
|
-
onConfigure = _ref.onConfigure,
|
|
18773
|
+
cellNumber = _ref$cellNumber === void 0 ? null : _ref$cellNumber;
|
|
18774
|
+
_ref.providers;
|
|
18775
|
+
var _ref$selectedProvider = _ref.selectedProviders,
|
|
18776
|
+
selectedProviders = _ref$selectedProvider === void 0 ? {} : _ref$selectedProvider;
|
|
18777
|
+
_ref.onProviderChange;
|
|
18778
|
+
var onConfigure = _ref.onConfigure,
|
|
18720
18779
|
onDelete = _ref.onDelete,
|
|
18721
18780
|
onRemove = _ref.onRemove,
|
|
18722
18781
|
_ref$onSplitHorizonta = _ref.onSplitHorizontal,
|
|
@@ -18770,29 +18829,13 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
18770
18829
|
};
|
|
18771
18830
|
var providerRequirements = getProviderRequirements();
|
|
18772
18831
|
|
|
18773
|
-
//
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
return p.type === type;
|
|
18777
|
-
});
|
|
18778
|
-
};
|
|
18779
|
-
|
|
18780
|
-
// Check if provider is configured
|
|
18832
|
+
// Check if provider is configured — used only for the amber-dot
|
|
18833
|
+
// indicator now. Actual provider editing lives in the config
|
|
18834
|
+
// modal's Providers section (opened via the "Providers" menu item).
|
|
18781
18835
|
var isProviderConfigured = function isProviderConfigured(providerType) {
|
|
18782
18836
|
return selectedProviders[providerType] != null;
|
|
18783
18837
|
};
|
|
18784
18838
|
|
|
18785
|
-
// Handle provider selection
|
|
18786
|
-
var handleProviderSelect = function handleProviderSelect(providerType, providerId) {
|
|
18787
|
-
if (providerId === "_new") {
|
|
18788
|
-
onProviderChange(providerType, null, true); // true = create new
|
|
18789
|
-
} else if (providerId === "_unset") {
|
|
18790
|
-
onProviderChange(providerType, null, false); // unset — no provider
|
|
18791
|
-
} else {
|
|
18792
|
-
onProviderChange(providerType, providerId);
|
|
18793
|
-
}
|
|
18794
|
-
};
|
|
18795
|
-
|
|
18796
18839
|
// True when any required provider lacks a selection — drives the
|
|
18797
18840
|
// amber dot on the overflow button so the user can see unresolved
|
|
18798
18841
|
// state at a glance without opening the menu.
|
|
@@ -18800,8 +18843,12 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
18800
18843
|
return req.required && !isProviderConfigured(req.type);
|
|
18801
18844
|
});
|
|
18802
18845
|
|
|
18803
|
-
// Build overflow actions list — single source of truth for
|
|
18804
|
-
//
|
|
18846
|
+
// Build overflow actions list — single source of truth for the
|
|
18847
|
+
// dropdown items. Provider editing used to live inline in this
|
|
18848
|
+
// menu as dropdowns per provider; that's moved to the widget
|
|
18849
|
+
// config modal under a "Providers" section, so here we just show
|
|
18850
|
+
// a "Providers" entry (when the widget declares any) that opens
|
|
18851
|
+
// the modal pre-selected on that section.
|
|
18805
18852
|
var overflowActions = [];
|
|
18806
18853
|
if (onConfigure) {
|
|
18807
18854
|
overflowActions.push({
|
|
@@ -18813,6 +18860,27 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
18813
18860
|
}
|
|
18814
18861
|
});
|
|
18815
18862
|
}
|
|
18863
|
+
if (onConfigure && providerRequirements.length > 0) {
|
|
18864
|
+
overflowActions.push({
|
|
18865
|
+
icon: "plug",
|
|
18866
|
+
label: "Providers",
|
|
18867
|
+
badge: hasUnresolvedRequiredProvider ? "!" : null,
|
|
18868
|
+
onClick: function onClick() {
|
|
18869
|
+
onConfigure(widgetItem, "providers");
|
|
18870
|
+
setShowOverflowMenu(false);
|
|
18871
|
+
}
|
|
18872
|
+
});
|
|
18873
|
+
}
|
|
18874
|
+
if (onConfigure) {
|
|
18875
|
+
overflowActions.push({
|
|
18876
|
+
icon: "phone",
|
|
18877
|
+
label: "Listeners",
|
|
18878
|
+
onClick: function onClick() {
|
|
18879
|
+
onConfigure(widgetItem, "handlers");
|
|
18880
|
+
setShowOverflowMenu(false);
|
|
18881
|
+
}
|
|
18882
|
+
});
|
|
18883
|
+
}
|
|
18816
18884
|
if (onEditWithAI && widgetItem) {
|
|
18817
18885
|
overflowActions.push({
|
|
18818
18886
|
icon: "wand-magic-sparkles",
|
|
@@ -18907,7 +18975,7 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
18907
18975
|
className: "absolute top-1 right-1 h-2 w-2 rounded-full bg-amber-400 border border-black pointer-events-none",
|
|
18908
18976
|
title: "Required provider not set"
|
|
18909
18977
|
})]
|
|
18910
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
18978
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.DropdownPanel, {
|
|
18911
18979
|
isOpen: showOverflowMenu,
|
|
18912
18980
|
onClose: function onClose() {
|
|
18913
18981
|
return setShowOverflowMenu(false);
|
|
@@ -18915,71 +18983,21 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
18915
18983
|
position: "absolute top-full right-0 mt-1",
|
|
18916
18984
|
portal: true,
|
|
18917
18985
|
align: "right",
|
|
18918
|
-
children:
|
|
18919
|
-
|
|
18920
|
-
|
|
18921
|
-
|
|
18922
|
-
|
|
18923
|
-
|
|
18924
|
-
|
|
18925
|
-
|
|
18926
|
-
|
|
18927
|
-
|
|
18928
|
-
|
|
18929
|
-
|
|
18930
|
-
|
|
18931
|
-
|
|
18932
|
-
|
|
18933
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
18934
|
-
className: "font-medium text-gray-200",
|
|
18935
|
-
children: providerType
|
|
18936
|
-
}), providerReq.required && !isConfigured && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
18937
|
-
className: "text-[10px] text-amber-300 uppercase tracking-wide",
|
|
18938
|
-
children: "required"
|
|
18939
|
-
})]
|
|
18940
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("select", {
|
|
18941
|
-
value: selectedProviderId,
|
|
18942
|
-
onChange: function onChange(e) {
|
|
18943
|
-
var v = e.target.value;
|
|
18944
|
-
if (v === "_new") {
|
|
18945
|
-
handleProviderSelect(providerType, "_new");
|
|
18946
|
-
} else if (v === "") {
|
|
18947
|
-
handleProviderSelect(providerType, "_unset");
|
|
18948
|
-
} else {
|
|
18949
|
-
handleProviderSelect(providerType, v);
|
|
18950
|
-
}
|
|
18951
|
-
},
|
|
18952
|
-
className: "w-full bg-gray-800 border border-gray-700 text-gray-100 text-xs rounded px-2 py-1",
|
|
18953
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("option", {
|
|
18954
|
-
value: "",
|
|
18955
|
-
children: providerReq.required ? "— select provider —" : "— none —"
|
|
18956
|
-
}), availableProviders.map(function (provider) {
|
|
18957
|
-
return /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
18958
|
-
value: provider.id,
|
|
18959
|
-
children: provider.name
|
|
18960
|
-
}, provider.id);
|
|
18961
|
-
}), /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
18962
|
-
value: "_new",
|
|
18963
|
-
children: "+ Create new\u2026"
|
|
18964
|
-
})]
|
|
18965
|
-
})]
|
|
18966
|
-
}, providerType);
|
|
18967
|
-
}), overflowActions.length > 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.DropdownPanel.Divider, {})]
|
|
18968
|
-
}), overflowActions.length > 0 && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
18969
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.DropdownPanel.Header, {
|
|
18970
|
-
children: "Actions"
|
|
18971
|
-
}), overflowActions.map(function (action) {
|
|
18972
|
-
return /*#__PURE__*/jsxRuntime.jsxs(DashReact.MenuItem2, {
|
|
18973
|
-
onClick: action.onClick,
|
|
18974
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
18975
|
-
icon: action.icon,
|
|
18976
|
-
className: "w-4 text-center opacity-60"
|
|
18977
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
18978
|
-
children: action.label
|
|
18979
|
-
})]
|
|
18980
|
-
}, action.label);
|
|
18981
|
-
})]
|
|
18982
|
-
})]
|
|
18986
|
+
children: overflowActions.map(function (action) {
|
|
18987
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DashReact.MenuItem2, {
|
|
18988
|
+
onClick: action.onClick,
|
|
18989
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
18990
|
+
icon: action.icon,
|
|
18991
|
+
className: "w-4 text-center opacity-60"
|
|
18992
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
18993
|
+
className: "flex-1",
|
|
18994
|
+
children: action.label
|
|
18995
|
+
}), action.badge && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
18996
|
+
className: "ml-auto text-[10px] font-bold text-amber-300",
|
|
18997
|
+
children: action.badge
|
|
18998
|
+
})]
|
|
18999
|
+
}, action.label);
|
|
19000
|
+
})
|
|
18983
19001
|
})]
|
|
18984
19002
|
})]
|
|
18985
19003
|
});
|
|
@@ -22309,8 +22327,8 @@ var WidgetContainerGridItem = function WidgetContainerGridItem(_ref) {
|
|
|
22309
22327
|
function handleChangeOrder(direction) {
|
|
22310
22328
|
onChangeOrder(item, direction);
|
|
22311
22329
|
}
|
|
22312
|
-
function handleOpenConfig() {
|
|
22313
|
-
onOpenConfig(item);
|
|
22330
|
+
function handleOpenConfig(widgetItem, section) {
|
|
22331
|
+
onOpenConfig(item, section);
|
|
22314
22332
|
}
|
|
22315
22333
|
function handleProviderChange(providerType, providerId) {
|
|
22316
22334
|
var createNew = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
@@ -22617,8 +22635,8 @@ var LayoutBuilderGridItem = function LayoutBuilderGridItem(_ref) {
|
|
|
22617
22635
|
function handleChangeOrder(direction) {
|
|
22618
22636
|
onChangeOrder(item, direction);
|
|
22619
22637
|
}
|
|
22620
|
-
function handleOpenConfig() {
|
|
22621
|
-
onOpenConfig(item);
|
|
22638
|
+
function handleOpenConfig(widgetItem, section) {
|
|
22639
|
+
onOpenConfig(item, section);
|
|
22622
22640
|
}
|
|
22623
22641
|
function renderArrows() {
|
|
22624
22642
|
return preview === false && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -25555,8 +25573,8 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
25555
25573
|
}
|
|
25556
25574
|
}
|
|
25557
25575
|
} : undefined,
|
|
25558
|
-
onConfigure: cellComponent ? function () {
|
|
25559
|
-
if (onOpenConfig) onOpenConfig(cellComponent);
|
|
25576
|
+
onConfigure: cellComponent ? function (widgetItem, section) {
|
|
25577
|
+
if (onOpenConfig) onOpenConfig(cellComponent, section);
|
|
25560
25578
|
} : undefined,
|
|
25561
25579
|
onDelete: cellComponent ? function () {
|
|
25562
25580
|
if (onClickRemove) onClickRemove(cellComponent.id);
|
|
@@ -60288,6 +60306,7 @@ exports.PanelCode = PanelCode;
|
|
|
60288
60306
|
exports.PanelEditItem = PanelEditItem;
|
|
60289
60307
|
exports.PanelEditItemHandlers = PanelEditItemHandlers;
|
|
60290
60308
|
exports.PanelEditItemNotifications = PanelEditItemNotifications;
|
|
60309
|
+
exports.PanelEditItemProviders = PanelEditItemProviders;
|
|
60291
60310
|
exports.PinnedSidebar = PinnedSidebar;
|
|
60292
60311
|
exports.ProviderContext = ProviderContext;
|
|
60293
60312
|
exports.ProviderErrorBoundary = ProviderErrorBoundary;
|