@luminati-io/uikit 3.6.1 → 3.6.2-beta.4
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.
@@ -38241,7 +38241,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
38241
38241
|
/*jslint react:true*/
|
38242
38242
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
38243
38243
|
|
38244
|
-
var _excluded = ["columns", "data", "pageSize", "pageSizes", "children", "stateManager", "hooks", "NoDataComp", "LoadingComp", "ExpandHandleComp", "noDataText", "loadingText", "isLoading", "onPageChange", "manualPagination", "totalCount", "paginateExpandedRows", "getHeaderProps", "getColumnProps", "getRowProps", "getCellProps", "getFooterProps", "selectedRowIds", "canOrderColumns", "rowActions", "columnSort", "onColumnSortChanged", "isCellEditable", "onStartEdit"];
|
38244
|
+
var _excluded = ["columns", "data", "pageSize", "pageSizes", "children", "stateManager", "hooks", "NoDataComp", "LoadingComp", "ExpandHandleComp", "noDataText", "loadingText", "isLoading", "onPageChange", "manualPagination", "totalCount", "paginateExpandedRows", "getHeaderProps", "getColumnProps", "getRowProps", "getCellProps", "getFooterProps", "selectedRowIds", "canOrderColumns", "rowActions", "columnSort", "onColumnSortChanged", "isCellEditable", "onStartEdit", "draggableRows", "onRowDragStart", "onRowDragEnd"];
|
38245
38245
|
function ownKeys(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; }
|
38246
38246
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
38247
38247
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
@@ -38327,11 +38327,18 @@ var Provider = function Provider(props) {
|
|
38327
38327
|
onColumnSortChanged = props.onColumnSortChanged,
|
38328
38328
|
isCellEditable = props.isCellEditable,
|
38329
38329
|
onStartEdit = props.onStartEdit,
|
38330
|
+
draggableRows = props.draggableRows,
|
38331
|
+
onRowDragStart = props.onRowDragStart,
|
38332
|
+
onRowDragEnd = props.onRowDragEnd,
|
38330
38333
|
rest = _objectWithoutProperties(props, _excluded);
|
38331
38334
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0),
|
38332
38335
|
_useState2 = _slicedToArray(_useState, 2),
|
38333
38336
|
pageCount = _useState2[0],
|
38334
38337
|
setPageCount = _useState2[1];
|
38338
|
+
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false),
|
38339
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
38340
|
+
isDraggingRow = _useState4[0],
|
38341
|
+
setIsDraggingRow = _useState4[1];
|
38335
38342
|
var hiddenColumns = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('hiddenColumns'), props.hiddenColumns);
|
38336
38343
|
var pinnedColumns = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('pinnedColumns'), props.pinnedColumns);
|
38337
38344
|
var columnOrder = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('columnOrder'), props.columnOrder);
|
@@ -38393,7 +38400,12 @@ var Provider = function Provider(props) {
|
|
38393
38400
|
LoadingComp: _LoadingComp,
|
38394
38401
|
NoDataComp: _NoDataComp,
|
38395
38402
|
rowActions: rowActions,
|
38396
|
-
expandColumnId: expandColumnId
|
38403
|
+
expandColumnId: expandColumnId,
|
38404
|
+
draggableRows: draggableRows,
|
38405
|
+
isDraggingRow: isDraggingRow,
|
38406
|
+
setIsDraggingRow: setIsDraggingRow,
|
38407
|
+
onRowDragStart: onRowDragStart,
|
38408
|
+
onRowDragEnd: onRowDragEnd
|
38397
38409
|
});
|
38398
38410
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(TableContext.Provider, {
|
38399
38411
|
value: value
|
@@ -38421,7 +38433,8 @@ Provider.defaultProps = {
|
|
38421
38433
|
isCellEditable: function isCellEditable(_ref) {
|
38422
38434
|
var column = _ref.column;
|
38423
38435
|
return column.canEdit;
|
38424
|
-
}
|
38436
|
+
},
|
38437
|
+
draggableRows: false
|
38425
38438
|
};
|
38426
38439
|
Provider.propTypes = {
|
38427
38440
|
columns: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
@@ -38480,7 +38493,10 @@ Provider.propTypes = {
|
|
38480
38493
|
rowActions: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array),
|
38481
38494
|
scrollable: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38482
38495
|
scrollHeight: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
|
38483
|
-
expandColumnId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
|
38496
|
+
expandColumnId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
|
38497
|
+
draggableRows: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38498
|
+
onRowDragStart: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38499
|
+
onRowDragEnd: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
|
38484
38500
|
};
|
38485
38501
|
var calcPageCount = function calcPageCount(totalCount, pageSize) {
|
38486
38502
|
return Math.ceil(totalCount / pageSize);
|
@@ -40272,9 +40288,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
40272
40288
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
40273
40289
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
|
40274
40290
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
|
40291
|
+
/* harmony import */ var react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-beautiful-dnd */ "./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js");
|
40275
40292
|
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
40276
40293
|
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util */ "./src/util/index.js");
|
40277
40294
|
/* harmony import */ var _table_cell__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./table_cell */ "./src/table/table_cell.js");
|
40295
|
+
/* harmony import */ var _row_hover_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./row_hover_actions */ "./src/table/row_hover_actions.js");
|
40296
|
+
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
40278
40297
|
// LICENSE_CODE ZON
|
40279
40298
|
|
40280
40299
|
|
@@ -40285,6 +40304,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
40285
40304
|
|
40286
40305
|
|
40287
40306
|
|
40307
|
+
|
40308
|
+
|
40309
|
+
|
40288
40310
|
var preventOnClickClass = 'tableCell--preventOnClick';
|
40289
40311
|
var renderRow = function renderRow(opt) {
|
40290
40312
|
var className = opt.className,
|
@@ -40293,7 +40315,8 @@ var renderRow = function renderRow(opt) {
|
|
40293
40315
|
getRowProps = opt.getRowProps,
|
40294
40316
|
rowDensity = opt.rowDensity,
|
40295
40317
|
isLast = opt.isLast,
|
40296
|
-
renderRowSubComponent = opt.renderRowSubComponent
|
40318
|
+
renderRowSubComponent = opt.renderRowSubComponent,
|
40319
|
+
dndIndex = opt.dndIndex;
|
40297
40320
|
var isExpanded = row.isExpanded,
|
40298
40321
|
isPinned = row.isPinned,
|
40299
40322
|
original = row.original;
|
@@ -40319,9 +40342,19 @@ var renderRow = function renderRow(opt) {
|
|
40319
40342
|
className: className
|
40320
40343
|
});
|
40321
40344
|
}));
|
40322
|
-
if (!isExpanded || !renderRowSubComponent)
|
40345
|
+
if (!isExpanded || !renderRowSubComponent) {
|
40346
|
+
var wrapperKey = "".concat(rowProps.key || row.id, "_wrapper");
|
40347
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowWrapper, {
|
40348
|
+
key: wrapperKey,
|
40349
|
+
dndIndex: dndIndex,
|
40350
|
+
row: row
|
40351
|
+
}, tableRow);
|
40352
|
+
}
|
40323
40353
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
40324
40354
|
key: "".concat(rowProps.key, "_fragment")
|
40355
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowWrapper, {
|
40356
|
+
dndIndex: dndIndex,
|
40357
|
+
row: row
|
40325
40358
|
}, tableRow, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(TableRow, _extends({}, rowProps, {
|
40326
40359
|
key: "".concat(rowProps.key, "_subcomponent"),
|
40327
40360
|
className: (0,_util__WEBPACK_IMPORTED_MODULE_3__.classNames)(className, {
|
@@ -40330,7 +40363,7 @@ var renderRow = function renderRow(opt) {
|
|
40330
40363
|
}), renderRowSubComponent({
|
40331
40364
|
row: row,
|
40332
40365
|
rowProps: rowProps
|
40333
|
-
})));
|
40366
|
+
}))));
|
40334
40367
|
};
|
40335
40368
|
var TableRow = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
|
40336
40369
|
displayName: "TableRow",
|
@@ -40345,6 +40378,163 @@ var TableRow = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.with
|
|
40345
40378
|
white_spaced: '72'
|
40346
40379
|
}[props.$rowDensity] || '32';
|
40347
40380
|
}, _table_cell__WEBPACK_IMPORTED_MODULE_4__.TableCellContent, _theme__WEBPACK_IMPORTED_MODULE_2__["default"].color.gray_2);
|
40381
|
+
var useDraggableRowProps = function useDraggableRowProps(row, dndIndex) {
|
40382
|
+
var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)(),
|
40383
|
+
draggableRows = _useTableContext.draggableRows;
|
40384
|
+
return {
|
40385
|
+
key: row.id,
|
40386
|
+
draggableId: row.id,
|
40387
|
+
index: dndIndex,
|
40388
|
+
isDragDisabled: !draggableRows
|
40389
|
+
};
|
40390
|
+
};
|
40391
|
+
var RowWrapper = function RowWrapper(props) {
|
40392
|
+
var children = props.children,
|
40393
|
+
dndIndex = props.dndIndex,
|
40394
|
+
row = props.row;
|
40395
|
+
var _useRowHoverActions = (0,_row_hover_actions__WEBPACK_IMPORTED_MODULE_5__.useRowHoverActions)(row),
|
40396
|
+
renderHoverActions = _useRowHoverActions.renderHoverActions,
|
40397
|
+
setRowRef = _useRowHoverActions.setRowRef,
|
40398
|
+
hoverProps = _useRowHoverActions.hoverProps;
|
40399
|
+
var handleWrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (rowElment, cb) {
|
40400
|
+
setRowRef(rowElment);
|
40401
|
+
cb(rowElment);
|
40402
|
+
}, []);
|
40403
|
+
var draggableProps = useDraggableRowProps(row, dndIndex);
|
40404
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_7__.Draggable, draggableProps, function (provided) {
|
40405
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({}, provided.draggableProps, hoverProps, {
|
40406
|
+
ref: function ref(element) {
|
40407
|
+
return handleWrapperRef(element, provided.innerRef);
|
40408
|
+
}
|
40409
|
+
}), children, renderHoverActions({
|
40410
|
+
dragHandleProps: provided.dragHandleProps
|
40411
|
+
}));
|
40412
|
+
});
|
40413
|
+
};
|
40414
|
+
|
40415
|
+
/***/ }),
|
40416
|
+
|
40417
|
+
/***/ "./src/table/row_hover_actions.js":
|
40418
|
+
/*!****************************************!*\
|
40419
|
+
!*** ./src/table/row_hover_actions.js ***!
|
40420
|
+
\****************************************/
|
40421
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
40422
|
+
|
40423
|
+
"use strict";
|
40424
|
+
__webpack_require__.r(__webpack_exports__);
|
40425
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
40426
|
+
/* harmony export */ useRowHoverActions: () => (/* binding */ useRowHoverActions)
|
40427
|
+
/* harmony export */ });
|
40428
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
40429
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
40430
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
|
40431
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
|
40432
|
+
/* harmony import */ var react_popper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-popper */ "./node_modules/react-popper/lib/esm/usePopper.js");
|
40433
|
+
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
40434
|
+
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon_button */ "./src/icon_button.js");
|
40435
|
+
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
40436
|
+
// LICENSE_CODE ZON
|
40437
|
+
|
40438
|
+
|
40439
|
+
/*jslint react:true*/
|
40440
|
+
var _excluded = ["visible", "dragHandleProps", "row"];
|
40441
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
40442
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
40443
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
40444
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
40445
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
40446
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
40447
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
40448
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
40449
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
40450
|
+
|
40451
|
+
|
40452
|
+
|
40453
|
+
|
40454
|
+
|
40455
|
+
|
40456
|
+
var RowHoverActions = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(function (props, ref) {
|
40457
|
+
var visible = props.visible,
|
40458
|
+
dragHandleProps = props.dragHandleProps,
|
40459
|
+
row = props.row,
|
40460
|
+
wrapperProps = _objectWithoutProperties(props, _excluded);
|
40461
|
+
var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_4__.useTableContext)(),
|
40462
|
+
getRowProps = _useTableContext.getRowProps,
|
40463
|
+
draggableRows = _useTableContext.draggableRows;
|
40464
|
+
var _row$getRowProps = row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row)),
|
40465
|
+
draggable = _row$getRowProps.draggable;
|
40466
|
+
var showDndButton = dragHandleProps && draggableRows;
|
40467
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(HoverActionsList, _extends({
|
40468
|
+
$visible: visible,
|
40469
|
+
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({
|
40471
|
+
disabled: !(draggable !== null && draggable !== void 0 ? draggable : true),
|
40472
|
+
variant: "icon",
|
40473
|
+
icon: "DragAndDrop"
|
40474
|
+
}, dragHandleProps))));
|
40475
|
+
});
|
40476
|
+
RowHoverActions.displayName = 'RowHoverActions';
|
40477
|
+
var HoverActionsList = styled_components__WEBPACK_IMPORTED_MODULE_1___default().ul.withConfig({
|
40478
|
+
displayName: "HoverActionsList",
|
40479
|
+
componentId: "sc-1xb8hvf-0"
|
40480
|
+
})(["list-style-type:none;margin:0;padding:0 ", ";visibility:", ";"], _theme__WEBPACK_IMPORTED_MODULE_2__["default"].spacing['02'], function (props) {
|
40481
|
+
return props.$visible ? 'visible' : 'hidden';
|
40482
|
+
});
|
40483
|
+
var useRowHoverActions = function useRowHoverActions(row) {
|
40484
|
+
var _useTableContext2 = (0,_context__WEBPACK_IMPORTED_MODULE_4__.useTableContext)(),
|
40485
|
+
isDraggingRow = _useTableContext2.isDraggingRow;
|
40486
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
40487
|
+
_useState2 = _slicedToArray(_useState, 2),
|
40488
|
+
rowRef = _useState2[0],
|
40489
|
+
setRowRef = _useState2[1];
|
40490
|
+
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
40491
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
40492
|
+
hoverActionsRef = _useState4[0],
|
40493
|
+
setHoverActionsRef = _useState4[1];
|
40494
|
+
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false),
|
40495
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
40496
|
+
visibleHoverActions = _useState6[0],
|
40497
|
+
setVisibleHoverActions = _useState6[1];
|
40498
|
+
var _usePopper = (0,react_popper__WEBPACK_IMPORTED_MODULE_5__.usePopper)(rowRef, hoverActionsRef, {
|
40499
|
+
modifiers: [{
|
40500
|
+
name: 'flip',
|
40501
|
+
enabled: true,
|
40502
|
+
options: {
|
40503
|
+
fallbackPlacements: ['right']
|
40504
|
+
}
|
40505
|
+
}],
|
40506
|
+
placement: 'left'
|
40507
|
+
}),
|
40508
|
+
styles = _usePopper.styles,
|
40509
|
+
attributes = _usePopper.attributes,
|
40510
|
+
update = _usePopper.update;
|
40511
|
+
var onPointerEnter = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
40512
|
+
if (typeof update == 'function') update();
|
40513
|
+
!isDraggingRow && setVisibleHoverActions(true);
|
40514
|
+
}, [isDraggingRow, update]);
|
40515
|
+
var onPointerLeave = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
40516
|
+
return setVisibleHoverActions(false);
|
40517
|
+
}, []);
|
40518
|
+
var hoverProps = {
|
40519
|
+
onPointerEnter: onPointerEnter,
|
40520
|
+
onPointerLeave: onPointerLeave
|
40521
|
+
};
|
40522
|
+
var renderHoverActions = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
40523
|
+
var extraProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
40524
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowHoverActions, _extends({
|
40525
|
+
visible: visibleHoverActions,
|
40526
|
+
row: row,
|
40527
|
+
ref: setHoverActionsRef
|
40528
|
+
}, hoverProps, {
|
40529
|
+
style: styles.popper
|
40530
|
+
}, attributes.popper, extraProps));
|
40531
|
+
}, [row, visibleHoverActions, styles, attributes, hoverProps]);
|
40532
|
+
return {
|
40533
|
+
renderHoverActions: renderHoverActions,
|
40534
|
+
setRowRef: setRowRef,
|
40535
|
+
hoverProps: hoverProps
|
40536
|
+
};
|
40537
|
+
};
|
40348
40538
|
|
40349
40539
|
/***/ }),
|
40350
40540
|
|
@@ -40972,6 +41162,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
40972
41162
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
40973
41163
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ "styled-components");
|
40974
41164
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
41165
|
+
/* harmony import */ var react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react-beautiful-dnd */ "./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js");
|
40975
41166
|
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
40976
41167
|
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util */ "./src/util/index.js");
|
40977
41168
|
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
@@ -41004,6 +41195,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
41004
41195
|
|
41005
41196
|
|
41006
41197
|
|
41198
|
+
|
41007
41199
|
var Table = function Table(props) {
|
41008
41200
|
var context = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)();
|
41009
41201
|
// not under context
|
@@ -41102,7 +41294,11 @@ var TableBody = function TableBody(props) {
|
|
41102
41294
|
LoadingComp = _useTableContext2.LoadingComp,
|
41103
41295
|
isLoading = _useTableContext2.isLoading,
|
41104
41296
|
getRowProps = _useTableContext2.getRowProps,
|
41105
|
-
renderRowSubComponent = _useTableContext2.renderRowSubComponent
|
41297
|
+
renderRowSubComponent = _useTableContext2.renderRowSubComponent,
|
41298
|
+
setIsDraggingRow = _useTableContext2.setIsDraggingRow,
|
41299
|
+
onRowDragStart = _useTableContext2.onRowDragStart,
|
41300
|
+
onRowDragEnd = _useTableContext2.onRowDragEnd,
|
41301
|
+
rowsById = _useTableContext2.rowsById;
|
41106
41302
|
var body = function () {
|
41107
41303
|
if (isLoading) return (0,_util__WEBPACK_IMPORTED_MODULE_5__.flexRender)(LoadingComp);
|
41108
41304
|
if (!page.length) return (0,_util__WEBPACK_IMPORTED_MODULE_5__.flexRender)(NoDataComp);
|
@@ -41117,21 +41313,38 @@ var TableBody = function TableBody(props) {
|
|
41117
41313
|
showExpand: row.canExpand,
|
41118
41314
|
className: className,
|
41119
41315
|
getRowProps: getRowProps,
|
41120
|
-
renderRowSubComponent: renderRowSubComponent
|
41316
|
+
renderRowSubComponent: renderRowSubComponent,
|
41317
|
+
dndIndex: i
|
41121
41318
|
});
|
41122
41319
|
});
|
41123
41320
|
}();
|
41124
41321
|
var bodyProps = getTableBodyProps();
|
41125
41322
|
var style = _objectSpread(_objectSpread({}, props.style), bodyProps.style);
|
41126
|
-
|
41323
|
+
var onDragStart = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (e) {
|
41324
|
+
setIsDraggingRow(true);
|
41325
|
+
onRowDragStart === null || onRowDragStart === void 0 || onRowDragStart(e, rowsById[e.draggableId]);
|
41326
|
+
}, [page]);
|
41327
|
+
var onDragEnd = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (e) {
|
41328
|
+
var _page$e$destination$i, _e$destination;
|
41329
|
+
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]);
|
41332
|
+
}, [page]);
|
41333
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_11__.DragDropContext, {
|
41334
|
+
onDragStart: onDragStart,
|
41335
|
+
onDragEnd: onDragEnd
|
41336
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(TableBodyRowGroup, _extends({
|
41127
41337
|
"data-rowgroup-type": "body"
|
41128
41338
|
}, bodyProps, {
|
41339
|
+
style: style,
|
41129
41340
|
className: (0,_util__WEBPACK_IMPORTED_MODULE_5__.classNames)(className, {
|
41130
41341
|
tableBody: true
|
41131
41342
|
}),
|
41132
|
-
style: style,
|
41133
41343
|
onScroll: onScroll
|
41134
|
-
}),
|
41344
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(DroppableBodyRowGroup, {
|
41345
|
+
id: "table-body-pinned-rows",
|
41346
|
+
type: "PINNED_ROWS"
|
41347
|
+
}, pinnedRows.map(function (row, i) {
|
41135
41348
|
prepareRow(row);
|
41136
41349
|
return (0,_render_row__WEBPACK_IMPORTED_MODULE_9__.renderRow)({
|
41137
41350
|
row: row,
|
@@ -41139,9 +41352,26 @@ var TableBody = function TableBody(props) {
|
|
41139
41352
|
onRowClick: onRowClick,
|
41140
41353
|
className: className,
|
41141
41354
|
getRowProps: getRowProps,
|
41142
|
-
renderRowSubComponent: renderRowSubComponent
|
41355
|
+
renderRowSubComponent: renderRowSubComponent,
|
41356
|
+
dndIndex: i
|
41143
41357
|
});
|
41144
|
-
}),
|
41358
|
+
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(DroppableBodyRowGroup, {
|
41359
|
+
id: "table-body-rows",
|
41360
|
+
type: "ROWS"
|
41361
|
+
}, body)));
|
41362
|
+
};
|
41363
|
+
var DroppableBodyRowGroup = function DroppableBodyRowGroup(props) {
|
41364
|
+
var children = props.children,
|
41365
|
+
id = props.id,
|
41366
|
+
type = props.type;
|
41367
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_11__.Droppable, {
|
41368
|
+
droppableId: id,
|
41369
|
+
type: type
|
41370
|
+
}, function (provided) {
|
41371
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", _extends({
|
41372
|
+
ref: provided.innerRef
|
41373
|
+
}, provided.droppableProps), children, provided.placeholder);
|
41374
|
+
});
|
41145
41375
|
};
|
41146
41376
|
var TableBodyRowGroup = styled_components__WEBPACK_IMPORTED_MODULE_3___default().div.withConfig({
|
41147
41377
|
displayName: "TableBodyRowGroup",
|
@@ -42056,7 +42286,6 @@ var defaultContainerStyle = {
|
|
42056
42286
|
};
|
42057
42287
|
var Toaster = function Toaster(props) {
|
42058
42288
|
var position = props.position,
|
42059
|
-
gap = props.gap,
|
42060
42289
|
maxToasts = props.maxToasts,
|
42061
42290
|
containerStyle = props.containerStyle,
|
42062
42291
|
children = props.children;
|
@@ -42067,7 +42296,6 @@ var Toaster = function Toaster(props) {
|
|
42067
42296
|
}
|
42068
42297
|
}, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_hot_toast__WEBPACK_IMPORTED_MODULE_2__.Toaster, {
|
42069
42298
|
position: position,
|
42070
|
-
gutter: gap,
|
42071
42299
|
toastOptions: {
|
42072
42300
|
duration: 5000
|
42073
42301
|
},
|
@@ -42076,12 +42304,10 @@ var Toaster = function Toaster(props) {
|
|
42076
42304
|
};
|
42077
42305
|
Toaster.defaultProps = {
|
42078
42306
|
position: 'bottom-left',
|
42079
|
-
gap: 8,
|
42080
42307
|
maxToasts: 2
|
42081
42308
|
};
|
42082
42309
|
Toaster.propTypes = {
|
42083
42310
|
position: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(_utils__WEBPACK_IMPORTED_MODULE_3__.toastPositions),
|
42084
|
-
gap: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
|
42085
42311
|
maxToasts: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
|
42086
42312
|
};
|
42087
42313
|
|
@@ -86376,7 +86602,7 @@ var symbol = new (_node_modules_svg_baker_runtime_browser_symbol_js__WEBPACK_IMP
|
|
86376
86602
|
"id": "mail_uikit_icon",
|
86377
86603
|
"use": "mail_uikit_icon-usage",
|
86378
86604
|
"viewBox": "0 0 20 20",
|
86379
|
-
"content": "<symbol xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\" id=\"mail_uikit_icon\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M17.7 3h-15A1.7 1.7 0 0 0 1 4.7v10a1.7 1.7 0 0 0 1.7 1.7h15a1.7 1.7 0 0 0 1.7-1.7v-10A1.7 1.7 0 0 0 17.7
|
86605
|
+
"content": "<symbol xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 20 20\" id=\"mail_uikit_icon\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M17.7 3h-15A1.7 1.7 0 0 0 1 4.7v10a1.7 1.7 0 0 0 1.7 1.7h15a1.7 1.7 0 0 0 1.7-1.7v-10A1.7 1.7 0 0 0 17.7 3M2.2 5.166V14.7a.5.5 0 0 0 .5.5h15a.5.5 0 0 0 .5-.5V5.166l-7.656 5.359a.6.6 0 0 1-.688 0L2.2 5.165ZM17.487 4.2H2.913L10.2 9.3z\" clip-rule=\"evenodd\" /></symbol>"
|
86380
86606
|
});
|
86381
86607
|
var result = _node_modules_svg_sprite_loader_runtime_browser_sprite_build_js__WEBPACK_IMPORTED_MODULE_1___default().add(symbol);
|
86382
86608
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (symbol);
|