@luminati-io/uikit 3.6.1 → 3.6.2-beta.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -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,168 @@ 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
|
+
})(["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: 'offset',
|
40501
|
+
options: {
|
40502
|
+
offset: [-15, 0]
|
40503
|
+
}
|
40504
|
+
}, {
|
40505
|
+
name: 'flip',
|
40506
|
+
enabled: true,
|
40507
|
+
options: {
|
40508
|
+
fallbackPlacements: ['right']
|
40509
|
+
}
|
40510
|
+
}],
|
40511
|
+
placement: 'left'
|
40512
|
+
}),
|
40513
|
+
styles = _usePopper.styles,
|
40514
|
+
attributes = _usePopper.attributes,
|
40515
|
+
update = _usePopper.update;
|
40516
|
+
var onPointerEnter = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
40517
|
+
if (typeof update == 'function') update();
|
40518
|
+
!isDraggingRow && setVisibleHoverActions(true);
|
40519
|
+
}, [isDraggingRow, update]);
|
40520
|
+
var onPointerLeave = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
40521
|
+
return setVisibleHoverActions(false);
|
40522
|
+
}, []);
|
40523
|
+
var hoverProps = {
|
40524
|
+
onPointerEnter: onPointerEnter,
|
40525
|
+
onPointerLeave: onPointerLeave
|
40526
|
+
};
|
40527
|
+
var renderHoverActions = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
40528
|
+
var extraProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
40529
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowHoverActions, _extends({
|
40530
|
+
visible: visibleHoverActions,
|
40531
|
+
row: row,
|
40532
|
+
ref: setHoverActionsRef
|
40533
|
+
}, hoverProps, {
|
40534
|
+
style: styles.popper
|
40535
|
+
}, attributes.popper, extraProps));
|
40536
|
+
}, [row, visibleHoverActions, styles, attributes, hoverProps]);
|
40537
|
+
return {
|
40538
|
+
renderHoverActions: renderHoverActions,
|
40539
|
+
setRowRef: setRowRef,
|
40540
|
+
hoverProps: hoverProps
|
40541
|
+
};
|
40542
|
+
};
|
40348
40543
|
|
40349
40544
|
/***/ }),
|
40350
40545
|
|
@@ -40972,6 +41167,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
40972
41167
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
40973
41168
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ "styled-components");
|
40974
41169
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
41170
|
+
/* 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
41171
|
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
40976
41172
|
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util */ "./src/util/index.js");
|
40977
41173
|
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
@@ -41004,6 +41200,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
41004
41200
|
|
41005
41201
|
|
41006
41202
|
|
41203
|
+
|
41007
41204
|
var Table = function Table(props) {
|
41008
41205
|
var context = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)();
|
41009
41206
|
// not under context
|
@@ -41102,7 +41299,11 @@ var TableBody = function TableBody(props) {
|
|
41102
41299
|
LoadingComp = _useTableContext2.LoadingComp,
|
41103
41300
|
isLoading = _useTableContext2.isLoading,
|
41104
41301
|
getRowProps = _useTableContext2.getRowProps,
|
41105
|
-
renderRowSubComponent = _useTableContext2.renderRowSubComponent
|
41302
|
+
renderRowSubComponent = _useTableContext2.renderRowSubComponent,
|
41303
|
+
setIsDraggingRow = _useTableContext2.setIsDraggingRow,
|
41304
|
+
onRowDragStart = _useTableContext2.onRowDragStart,
|
41305
|
+
onRowDragEnd = _useTableContext2.onRowDragEnd,
|
41306
|
+
rowsById = _useTableContext2.rowsById;
|
41106
41307
|
var body = function () {
|
41107
41308
|
if (isLoading) return (0,_util__WEBPACK_IMPORTED_MODULE_5__.flexRender)(LoadingComp);
|
41108
41309
|
if (!page.length) return (0,_util__WEBPACK_IMPORTED_MODULE_5__.flexRender)(NoDataComp);
|
@@ -41117,21 +41318,38 @@ var TableBody = function TableBody(props) {
|
|
41117
41318
|
showExpand: row.canExpand,
|
41118
41319
|
className: className,
|
41119
41320
|
getRowProps: getRowProps,
|
41120
|
-
renderRowSubComponent: renderRowSubComponent
|
41321
|
+
renderRowSubComponent: renderRowSubComponent,
|
41322
|
+
dndIndex: i
|
41121
41323
|
});
|
41122
41324
|
});
|
41123
41325
|
}();
|
41124
41326
|
var bodyProps = getTableBodyProps();
|
41125
41327
|
var style = _objectSpread(_objectSpread({}, props.style), bodyProps.style);
|
41126
|
-
|
41328
|
+
var onDragStart = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (e) {
|
41329
|
+
setIsDraggingRow(true);
|
41330
|
+
onRowDragStart === null || onRowDragStart === void 0 || onRowDragStart(e, rowsById[e.draggableId]);
|
41331
|
+
}, [page]);
|
41332
|
+
var onDragEnd = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (e) {
|
41333
|
+
var _page$e$destination$i, _e$destination;
|
41334
|
+
setIsDraggingRow(false);
|
41335
|
+
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;
|
41336
|
+
onRowDragEnd === null || onRowDragEnd === void 0 || onRowDragEnd(e, rowsById[e.draggableId], rowsById[destinationRowId]);
|
41337
|
+
}, [page]);
|
41338
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_11__.DragDropContext, {
|
41339
|
+
onDragStart: onDragStart,
|
41340
|
+
onDragEnd: onDragEnd
|
41341
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(TableBodyRowGroup, _extends({
|
41127
41342
|
"data-rowgroup-type": "body"
|
41128
41343
|
}, bodyProps, {
|
41344
|
+
style: style,
|
41129
41345
|
className: (0,_util__WEBPACK_IMPORTED_MODULE_5__.classNames)(className, {
|
41130
41346
|
tableBody: true
|
41131
41347
|
}),
|
41132
|
-
style: style,
|
41133
41348
|
onScroll: onScroll
|
41134
|
-
}),
|
41349
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(DroppableBodyRowGroup, {
|
41350
|
+
id: "table-body-pinned-rows",
|
41351
|
+
type: "PINNED_ROWS"
|
41352
|
+
}, pinnedRows.map(function (row, i) {
|
41135
41353
|
prepareRow(row);
|
41136
41354
|
return (0,_render_row__WEBPACK_IMPORTED_MODULE_9__.renderRow)({
|
41137
41355
|
row: row,
|
@@ -41139,9 +41357,26 @@ var TableBody = function TableBody(props) {
|
|
41139
41357
|
onRowClick: onRowClick,
|
41140
41358
|
className: className,
|
41141
41359
|
getRowProps: getRowProps,
|
41142
|
-
renderRowSubComponent: renderRowSubComponent
|
41360
|
+
renderRowSubComponent: renderRowSubComponent,
|
41361
|
+
dndIndex: i
|
41143
41362
|
});
|
41144
|
-
}),
|
41363
|
+
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(DroppableBodyRowGroup, {
|
41364
|
+
id: "table-body-rows",
|
41365
|
+
type: "ROWS"
|
41366
|
+
}, body)));
|
41367
|
+
};
|
41368
|
+
var DroppableBodyRowGroup = function DroppableBodyRowGroup(props) {
|
41369
|
+
var children = props.children,
|
41370
|
+
id = props.id,
|
41371
|
+
type = props.type;
|
41372
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_11__.Droppable, {
|
41373
|
+
droppableId: id,
|
41374
|
+
type: type
|
41375
|
+
}, function (provided) {
|
41376
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", _extends({
|
41377
|
+
ref: provided.innerRef
|
41378
|
+
}, provided.droppableProps), children, provided.placeholder);
|
41379
|
+
});
|
41145
41380
|
};
|
41146
41381
|
var TableBodyRowGroup = styled_components__WEBPACK_IMPORTED_MODULE_3___default().div.withConfig({
|
41147
41382
|
displayName: "TableBodyRowGroup",
|
@@ -42056,7 +42291,6 @@ var defaultContainerStyle = {
|
|
42056
42291
|
};
|
42057
42292
|
var Toaster = function Toaster(props) {
|
42058
42293
|
var position = props.position,
|
42059
|
-
gap = props.gap,
|
42060
42294
|
maxToasts = props.maxToasts,
|
42061
42295
|
containerStyle = props.containerStyle,
|
42062
42296
|
children = props.children;
|
@@ -42067,7 +42301,6 @@ var Toaster = function Toaster(props) {
|
|
42067
42301
|
}
|
42068
42302
|
}, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(react_hot_toast__WEBPACK_IMPORTED_MODULE_2__.Toaster, {
|
42069
42303
|
position: position,
|
42070
|
-
gutter: gap,
|
42071
42304
|
toastOptions: {
|
42072
42305
|
duration: 5000
|
42073
42306
|
},
|
@@ -42076,12 +42309,10 @@ var Toaster = function Toaster(props) {
|
|
42076
42309
|
};
|
42077
42310
|
Toaster.defaultProps = {
|
42078
42311
|
position: 'bottom-left',
|
42079
|
-
gap: 8,
|
42080
42312
|
maxToasts: 2
|
42081
42313
|
};
|
42082
42314
|
Toaster.propTypes = {
|
42083
42315
|
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
42316
|
maxToasts: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
|
42086
42317
|
};
|
42087
42318
|
|
@@ -86376,7 +86607,7 @@ var symbol = new (_node_modules_svg_baker_runtime_browser_symbol_js__WEBPACK_IMP
|
|
86376
86607
|
"id": "mail_uikit_icon",
|
86377
86608
|
"use": "mail_uikit_icon-usage",
|
86378
86609
|
"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
|
86610
|
+
"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
86611
|
});
|
86381
86612
|
var result = _node_modules_svg_sprite_loader_runtime_browser_sprite_build_js__WEBPACK_IMPORTED_MODULE_1___default().add(symbol);
|
86382
86613
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (symbol);
|