@trops/dash-core 0.1.145 → 0.1.146
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/electron/index.js +25 -25
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +102 -81
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +54 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -5647,10 +5647,10 @@ var syntax = SyntaxError;
|
|
|
5647
5647
|
var type = TypeError;
|
|
5648
5648
|
|
|
5649
5649
|
/** @type {import('./gOPD')} */
|
|
5650
|
-
var gOPD$
|
|
5650
|
+
var gOPD$6 = Object.getOwnPropertyDescriptor;
|
|
5651
5651
|
|
|
5652
5652
|
/** @type {import('.')} */
|
|
5653
|
-
var $gOPD$2 = gOPD$
|
|
5653
|
+
var $gOPD$2 = gOPD$6;
|
|
5654
5654
|
|
|
5655
5655
|
if ($gOPD$2) {
|
|
5656
5656
|
try {
|
|
@@ -5785,7 +5785,7 @@ defineProperties$1.supportsDescriptors = !!supportsDescriptors$2;
|
|
|
5785
5785
|
|
|
5786
5786
|
var defineProperties_1 = defineProperties$1;
|
|
5787
5787
|
|
|
5788
|
-
var callBind$
|
|
5788
|
+
var callBind$7 = {exports: {}};
|
|
5789
5789
|
|
|
5790
5790
|
/** @type {import('.')} */
|
|
5791
5791
|
var esObjectAtoms = Object;
|
|
@@ -6085,78 +6085,60 @@ var callBindApplyHelpers = function callBindBasic(args) {
|
|
|
6085
6085
|
return $actualApply(bind$3, $call$1, args);
|
|
6086
6086
|
};
|
|
6087
6087
|
|
|
6088
|
-
var
|
|
6089
|
-
var
|
|
6088
|
+
var callBind$6 = callBindApplyHelpers;
|
|
6089
|
+
var gOPD$5 = gopd$1;
|
|
6090
6090
|
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
var hasProtoAccessor;
|
|
6099
|
-
try {
|
|
6100
|
-
// eslint-disable-next-line no-extra-parens, no-proto
|
|
6101
|
-
hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
|
|
6102
|
-
} catch (e) {
|
|
6103
|
-
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
|
|
6104
|
-
throw e;
|
|
6105
|
-
}
|
|
6091
|
+
var hasProtoAccessor;
|
|
6092
|
+
try {
|
|
6093
|
+
// eslint-disable-next-line no-extra-parens, no-proto
|
|
6094
|
+
hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
|
|
6095
|
+
} catch (e) {
|
|
6096
|
+
if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
|
|
6097
|
+
throw e;
|
|
6106
6098
|
}
|
|
6107
|
-
|
|
6108
|
-
// eslint-disable-next-line no-extra-parens
|
|
6109
|
-
var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
|
|
6110
|
-
|
|
6111
|
-
var $Object = Object;
|
|
6112
|
-
var $getPrototypeOf = $Object.getPrototypeOf;
|
|
6113
|
-
|
|
6114
|
-
/** @type {import('./get')} */
|
|
6115
|
-
get = desc && typeof desc.get === 'function'
|
|
6116
|
-
? callBind([desc.get])
|
|
6117
|
-
: typeof $getPrototypeOf === 'function'
|
|
6118
|
-
? /** @type {import('./get')} */ function getDunder(value) {
|
|
6119
|
-
// eslint-disable-next-line eqeqeq
|
|
6120
|
-
return $getPrototypeOf(value == null ? value : $Object(value));
|
|
6121
|
-
}
|
|
6122
|
-
: false;
|
|
6123
|
-
return get;
|
|
6124
6099
|
}
|
|
6125
6100
|
|
|
6126
|
-
|
|
6127
|
-
var
|
|
6101
|
+
// eslint-disable-next-line no-extra-parens
|
|
6102
|
+
var desc = !!hasProtoAccessor && gOPD$5 && gOPD$5(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
|
|
6103
|
+
|
|
6104
|
+
var $Object$3 = Object;
|
|
6105
|
+
var $getPrototypeOf = $Object$3.getPrototypeOf;
|
|
6128
6106
|
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6107
|
+
/** @type {import('./get')} */
|
|
6108
|
+
var get = desc && typeof desc.get === 'function'
|
|
6109
|
+
? callBind$6([desc.get])
|
|
6110
|
+
: typeof $getPrototypeOf === 'function'
|
|
6111
|
+
? /** @type {import('./get')} */ function getDunder(value) {
|
|
6112
|
+
// eslint-disable-next-line eqeqeq
|
|
6113
|
+
return $getPrototypeOf(value == null ? value : $Object$3(value));
|
|
6114
|
+
}
|
|
6115
|
+
: false;
|
|
6132
6116
|
|
|
6133
|
-
|
|
6134
|
-
|
|
6117
|
+
var reflectGetProto = requireReflect_getPrototypeOf();
|
|
6118
|
+
var originalGetProto = requireObject_getPrototypeOf();
|
|
6135
6119
|
|
|
6136
|
-
|
|
6120
|
+
var getDunderProto = get;
|
|
6137
6121
|
|
|
6138
|
-
|
|
6139
|
-
|
|
6122
|
+
/** @type {import('.')} */
|
|
6123
|
+
var getProto$3 = reflectGetProto
|
|
6124
|
+
? function getProto(O) {
|
|
6125
|
+
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
6126
|
+
return reflectGetProto(O);
|
|
6127
|
+
}
|
|
6128
|
+
: originalGetProto
|
|
6140
6129
|
? function getProto(O) {
|
|
6130
|
+
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
6131
|
+
throw new TypeError('getProto: not an object');
|
|
6132
|
+
}
|
|
6141
6133
|
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
6142
|
-
return
|
|
6134
|
+
return originalGetProto(O);
|
|
6143
6135
|
}
|
|
6144
|
-
:
|
|
6136
|
+
: getDunderProto
|
|
6145
6137
|
? function getProto(O) {
|
|
6146
|
-
if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
|
|
6147
|
-
throw new TypeError('getProto: not an object');
|
|
6148
|
-
}
|
|
6149
6138
|
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
6150
|
-
return
|
|
6139
|
+
return getDunderProto(O);
|
|
6151
6140
|
}
|
|
6152
|
-
:
|
|
6153
|
-
? function getProto(O) {
|
|
6154
|
-
// @ts-expect-error TS can't narrow inside a closure, for some reason
|
|
6155
|
-
return getDunderProto(O);
|
|
6156
|
-
}
|
|
6157
|
-
: null;
|
|
6158
|
-
return getProto$3;
|
|
6159
|
-
}
|
|
6141
|
+
: null;
|
|
6160
6142
|
|
|
6161
6143
|
var call = Function.prototype.call;
|
|
6162
6144
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
@@ -6219,7 +6201,7 @@ var ThrowTypeError = $gOPD$1
|
|
|
6219
6201
|
|
|
6220
6202
|
var hasSymbols$3 = hasSymbols$4();
|
|
6221
6203
|
|
|
6222
|
-
var getProto$2 =
|
|
6204
|
+
var getProto$2 = getProto$3;
|
|
6223
6205
|
var $ObjectGPO = requireObject_getPrototypeOf();
|
|
6224
6206
|
var $ReflectGPO = requireReflect_getPrototypeOf();
|
|
6225
6207
|
|
|
@@ -6616,9 +6598,9 @@ var applyBind = function applyBind() {
|
|
|
6616
6598
|
} else {
|
|
6617
6599
|
module.exports.apply = applyBind$1;
|
|
6618
6600
|
}
|
|
6619
|
-
} (callBind$
|
|
6601
|
+
} (callBind$7));
|
|
6620
6602
|
|
|
6621
|
-
var callBindExports = callBind$
|
|
6603
|
+
var callBindExports = callBind$7.exports;
|
|
6622
6604
|
|
|
6623
6605
|
var GetIntrinsic$7 = getIntrinsic;
|
|
6624
6606
|
|
|
@@ -6917,7 +6899,7 @@ var getPolyfill$3 = polyfill$2;
|
|
|
6917
6899
|
var gOPD$2 = gopd$1;
|
|
6918
6900
|
var defineProperty = Object.defineProperty;
|
|
6919
6901
|
var $TypeError$5 = esErrors;
|
|
6920
|
-
var getProto$1 =
|
|
6902
|
+
var getProto$1 = getProto$3;
|
|
6921
6903
|
var regex = /a/;
|
|
6922
6904
|
|
|
6923
6905
|
var shim$3 = function shimFlags() {
|
|
@@ -9033,7 +9015,7 @@ var availableTypedArrays = availableTypedArrays$1;
|
|
|
9033
9015
|
var callBind = callBindExports;
|
|
9034
9016
|
var callBound$2 = callBound$i;
|
|
9035
9017
|
var gOPD = gopd$1;
|
|
9036
|
-
var getProto =
|
|
9018
|
+
var getProto = getProto$3;
|
|
9037
9019
|
|
|
9038
9020
|
var $toString = callBound$2('Object.prototype.toString');
|
|
9039
9021
|
var hasToStringTag = shams();
|
|
@@ -19879,9 +19861,11 @@ function _unsupportedIterableToArray$7(r, a) { if (r) { if ("string" == typeof r
|
|
|
19879
19861
|
function _arrayLikeToArray$7(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; }
|
|
19880
19862
|
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; }
|
|
19881
19863
|
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; }
|
|
19882
|
-
var
|
|
19864
|
+
var DraggableDroppableCellBody = function DraggableDroppableCellBody(_ref) {
|
|
19883
19865
|
var cellNumber = _ref.cellNumber,
|
|
19884
19866
|
gridContainerId = _ref.gridContainerId,
|
|
19867
|
+
onMoveWidgetToCell = _ref.onMoveWidgetToCell,
|
|
19868
|
+
hasSpan = _ref.hasSpan,
|
|
19885
19869
|
children = _ref.children,
|
|
19886
19870
|
padding = _ref.padding;
|
|
19887
19871
|
var _useDrag = useDrag(function () {
|
|
@@ -19889,7 +19873,8 @@ var DraggableCellBody = function DraggableCellBody(_ref) {
|
|
|
19889
19873
|
type: GRID_CELL_WIDGET_TYPE,
|
|
19890
19874
|
item: {
|
|
19891
19875
|
cellNumber: cellNumber,
|
|
19892
|
-
gridContainerId: gridContainerId
|
|
19876
|
+
gridContainerId: gridContainerId,
|
|
19877
|
+
hasSpan: hasSpan
|
|
19893
19878
|
},
|
|
19894
19879
|
collect: function collect(monitor) {
|
|
19895
19880
|
return {
|
|
@@ -19897,17 +19882,50 @@ var DraggableCellBody = function DraggableCellBody(_ref) {
|
|
|
19897
19882
|
};
|
|
19898
19883
|
}
|
|
19899
19884
|
};
|
|
19900
|
-
}, [cellNumber, gridContainerId]),
|
|
19885
|
+
}, [cellNumber, gridContainerId, hasSpan]),
|
|
19901
19886
|
_useDrag2 = _slicedToArray(_useDrag, 2),
|
|
19902
19887
|
isDragging = _useDrag2[0].isDragging,
|
|
19903
19888
|
drag = _useDrag2[1];
|
|
19904
|
-
|
|
19905
|
-
|
|
19906
|
-
|
|
19889
|
+
var _useDrop = useDrop(function () {
|
|
19890
|
+
return {
|
|
19891
|
+
accept: GRID_CELL_WIDGET_TYPE,
|
|
19892
|
+
canDrop: function canDrop(dragItem) {
|
|
19893
|
+
if (dragItem.gridContainerId !== gridContainerId) return false;
|
|
19894
|
+
if (dragItem.cellNumber === cellNumber) return false;
|
|
19895
|
+
if (dragItem.hasSpan || hasSpan) return false;
|
|
19896
|
+
return true;
|
|
19897
|
+
},
|
|
19898
|
+
drop: function drop(dragItem) {
|
|
19899
|
+
if (onMoveWidgetToCell) onMoveWidgetToCell(gridContainerId, dragItem.cellNumber, cellNumber);
|
|
19900
|
+
},
|
|
19901
|
+
collect: function collect(monitor) {
|
|
19902
|
+
return {
|
|
19903
|
+
isOver: monitor.isOver(),
|
|
19904
|
+
canDrop: monitor.canDrop()
|
|
19905
|
+
};
|
|
19906
|
+
}
|
|
19907
|
+
};
|
|
19908
|
+
}, [cellNumber, gridContainerId, onMoveWidgetToCell, hasSpan]),
|
|
19909
|
+
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
19910
|
+
_useDrop2$ = _useDrop2[0],
|
|
19911
|
+
isOver = _useDrop2$.isOver,
|
|
19912
|
+
canDrop = _useDrop2$.canDrop,
|
|
19913
|
+
drop = _useDrop2[1];
|
|
19914
|
+
return /*#__PURE__*/jsxs("div", {
|
|
19915
|
+
ref: function ref(node) {
|
|
19916
|
+
return drag(drop(node));
|
|
19917
|
+
},
|
|
19918
|
+
className: "flex-1 min-h-0 overflow-auto ".concat(padding, " ").concat(isDragging ? "opacity-30" : "", " ").concat(isOver && canDrop ? "ring-2 ring-blue-500 ring-inset" : ""),
|
|
19907
19919
|
style: {
|
|
19908
19920
|
cursor: "grab"
|
|
19909
19921
|
},
|
|
19910
|
-
children: children
|
|
19922
|
+
children: [children, isOver && canDrop && /*#__PURE__*/jsx("div", {
|
|
19923
|
+
className: "absolute inset-0 flex items-center justify-center bg-blue-600/30 rounded pointer-events-none",
|
|
19924
|
+
children: /*#__PURE__*/jsx("span", {
|
|
19925
|
+
className: "text-sm font-bold text-blue-200",
|
|
19926
|
+
children: "Swap"
|
|
19927
|
+
})
|
|
19928
|
+
})]
|
|
19911
19929
|
});
|
|
19912
19930
|
};
|
|
19913
19931
|
var DroppableEmptyCell = function DroppableEmptyCell(_ref2) {
|
|
@@ -19916,7 +19934,7 @@ var DroppableEmptyCell = function DroppableEmptyCell(_ref2) {
|
|
|
19916
19934
|
onMoveWidgetToCell = _ref2.onMoveWidgetToCell,
|
|
19917
19935
|
onDropWidgetFromSidebar = _ref2.onDropWidgetFromSidebar,
|
|
19918
19936
|
children = _ref2.children;
|
|
19919
|
-
var
|
|
19937
|
+
var _useDrop3 = useDrop(function () {
|
|
19920
19938
|
return {
|
|
19921
19939
|
accept: [GRID_CELL_WIDGET_TYPE, SIDEBAR_WIDGET_TYPE],
|
|
19922
19940
|
canDrop: function canDrop(dragItem, monitor) {
|
|
@@ -19940,11 +19958,11 @@ var DroppableEmptyCell = function DroppableEmptyCell(_ref2) {
|
|
|
19940
19958
|
}
|
|
19941
19959
|
};
|
|
19942
19960
|
}, [cellNumber, gridContainerId, onMoveWidgetToCell, onDropWidgetFromSidebar]),
|
|
19943
|
-
|
|
19944
|
-
|
|
19945
|
-
isOver =
|
|
19946
|
-
canDrop =
|
|
19947
|
-
drop =
|
|
19961
|
+
_useDrop4 = _slicedToArray(_useDrop3, 2),
|
|
19962
|
+
_useDrop4$ = _useDrop4[0],
|
|
19963
|
+
isOver = _useDrop4$.isOver,
|
|
19964
|
+
canDrop = _useDrop4$.canDrop,
|
|
19965
|
+
drop = _useDrop4[1];
|
|
19948
19966
|
return /*#__PURE__*/jsxs("div", {
|
|
19949
19967
|
ref: drop,
|
|
19950
19968
|
className: "flex-1 min-h-0 relative flex flex-col ".concat(isOver && canDrop ? "ring-2 ring-green-500 ring-inset bg-green-900/20" : ""),
|
|
@@ -20974,9 +20992,11 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
20974
20992
|
onDelete: cellComponent ? function () {
|
|
20975
20993
|
if (onClickRemove) onClickRemove(cellComponent.id);
|
|
20976
20994
|
} : undefined
|
|
20977
|
-
}), cellComponent && isWidgetResolvable(cellComponent.component) ? /*#__PURE__*/jsx(
|
|
20995
|
+
}), cellComponent && isWidgetResolvable(cellComponent.component) ? /*#__PURE__*/jsx(DraggableDroppableCellBody, {
|
|
20978
20996
|
cellNumber: cellNumber,
|
|
20979
20997
|
gridContainerId: id,
|
|
20998
|
+
onMoveWidgetToCell: onMoveWidgetToCell,
|
|
20999
|
+
hasSpan: !!(cellDef.span && (cellDef.span.row && cellDef.span.row > 1 || cellDef.span.col && cellDef.span.col > 1)),
|
|
20980
21000
|
padding: "p-3",
|
|
20981
21001
|
children: renderedWidget
|
|
20982
21002
|
}) : /*#__PURE__*/jsx(DroppableEmptyCell, {
|
|
@@ -24747,8 +24767,9 @@ var DashboardModel = /*#__PURE__*/function () {
|
|
|
24747
24767
|
var gridContainer = this.getComponentById(itemId);
|
|
24748
24768
|
var grid = gridContainer.grid;
|
|
24749
24769
|
var componentId = grid[sourceCellNumber].component;
|
|
24770
|
+
var targetComponentId = grid[targetCellNumber].component;
|
|
24750
24771
|
grid[targetCellNumber].component = componentId;
|
|
24751
|
-
grid[sourceCellNumber].component =
|
|
24772
|
+
grid[sourceCellNumber].component = targetComponentId;
|
|
24752
24773
|
this.updateLayoutItem(gridContainer);
|
|
24753
24774
|
}
|
|
24754
24775
|
}, {
|