@luminati-io/uikit 3.6.2 → 3.6.4-beta.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -40379,13 +40379,17 @@ var TableRow = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.with
40379
40379
  }[props.$rowDensity] || '32';
40380
40380
  }, _table_cell__WEBPACK_IMPORTED_MODULE_4__.TableCellContent, _theme__WEBPACK_IMPORTED_MODULE_2__["default"].color.gray_2);
40381
40381
  var useDraggableRowProps = function useDraggableRowProps(row, dndIndex) {
40382
+ var _rowProps$draggable;
40382
40383
  var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)(),
40384
+ getRowProps = _useTableContext.getRowProps,
40383
40385
  draggableRows = _useTableContext.draggableRows;
40386
+ var rowProps = row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row));
40387
+ var draggable = (_rowProps$draggable = rowProps === null || rowProps === void 0 ? void 0 : rowProps.draggable) !== null && _rowProps$draggable !== void 0 ? _rowProps$draggable : true;
40384
40388
  return {
40385
40389
  key: row.id,
40386
40390
  draggableId: row.id,
40387
40391
  index: dndIndex,
40388
- isDragDisabled: !draggableRows
40392
+ isDragDisabled: !draggableRows || !draggable
40389
40393
  };
40390
40394
  };
40391
40395
  var RowWrapper = function RowWrapper(props) {
@@ -40455,7 +40459,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
40455
40459
 
40456
40460
  var RowHoverActions = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
40457
40461
  var visible = props.visible,
40458
- dragHandleProps = props.dragHandleProps,
40462
+ _props$dragHandleProp = props.dragHandleProps,
40463
+ dragHandleProps = _props$dragHandleProp === void 0 ? {} : _props$dragHandleProp,
40459
40464
  row = props.row,
40460
40465
  wrapperProps = _objectWithoutProperties(props, _excluded);
40461
40466
  var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_4__.useTableContext)(),
@@ -40463,11 +40468,10 @@ var RowHoverActions = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forward
40463
40468
  draggableRows = _useTableContext.draggableRows;
40464
40469
  var _row$getRowProps = row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row)),
40465
40470
  draggable = _row$getRowProps.draggable;
40466
- var showDndButton = dragHandleProps && draggableRows;
40467
40471
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(HoverActionsList, _extends({
40468
40472
  $visible: visible,
40469
40473
  ref: ref
40470
- }, wrapperProps), showDndButton && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icon_button__WEBPACK_IMPORTED_MODULE_3__.IconButton, _extends({
40474
+ }, wrapperProps), draggableRows && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icon_button__WEBPACK_IMPORTED_MODULE_3__.IconButton, _extends({
40471
40475
  disabled: !(draggable !== null && draggable !== void 0 ? draggable : true),
40472
40476
  variant: "icon",
40473
40477
  icon: "DragAndDrop"
@@ -41322,13 +41326,13 @@ var TableBody = function TableBody(props) {
41322
41326
  var style = _objectSpread(_objectSpread({}, props.style), bodyProps.style);
41323
41327
  var onDragStart = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (e) {
41324
41328
  setIsDraggingRow(true);
41325
- onRowDragStart === null || onRowDragStart === void 0 || onRowDragStart(e, rowsById[e.draggableId]);
41329
+ onRowDragStart === null || onRowDragStart === void 0 || onRowDragStart(e, rowsById[e.draggableId], page);
41326
41330
  }, [page]);
41327
41331
  var onDragEnd = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (e) {
41328
41332
  var _page$e$destination$i, _e$destination;
41329
41333
  setIsDraggingRow(false);
41330
- var destinationRowId = (_page$e$destination$i = page[(_e$destination = e.destination) === null || _e$destination === void 0 ? void 0 : _e$destination.index]) === null || _page$e$destination$i === void 0 ? void 0 : _page$e$destination$i.id;
41331
- onRowDragEnd === null || onRowDragEnd === void 0 || onRowDragEnd(e, rowsById[e.draggableId], rowsById[destinationRowId]);
41334
+ var destRowId = (_page$e$destination$i = page[(_e$destination = e.destination) === null || _e$destination === void 0 ? void 0 : _e$destination.index]) === null || _page$e$destination$i === void 0 ? void 0 : _page$e$destination$i.id;
41335
+ onRowDragEnd === null || onRowDragEnd === void 0 || onRowDragEnd(e, rowsById[e.draggableId], rowsById[destRowId], page);
41332
41336
  }, [page]);
41333
41337
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_11__.DragDropContext, {
41334
41338
  onDragStart: onDragStart,