@luminati-io/uikit 3.7.9 → 3.7.10
Sign up to get free protection for your applications and to get access to all the features.
@@ -39922,7 +39922,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
39922
39922
|
/*jslint react:true*/
|
39923
39923
|
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); }
|
39924
39924
|
|
39925
|
-
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", "hoverActions", "hoverActionsDirection"];
|
39925
|
+
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", "hoverActions", "hoverActionsDirection", "virtualized"];
|
39926
39926
|
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; }
|
39927
39927
|
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; }
|
39928
39928
|
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; }
|
@@ -40013,6 +40013,7 @@ var Provider = function Provider(props) {
|
|
40013
40013
|
onRowDragEnd = props.onRowDragEnd,
|
40014
40014
|
hoverActions = props.hoverActions,
|
40015
40015
|
hoverActionsDirection = props.hoverActionsDirection,
|
40016
|
+
virtualized = props.virtualized,
|
40016
40017
|
rest = _objectWithoutProperties(props, _excluded);
|
40017
40018
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0),
|
40018
40019
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -40090,7 +40091,8 @@ var Provider = function Provider(props) {
|
|
40090
40091
|
onRowDragStart: onRowDragStart,
|
40091
40092
|
onRowDragEnd: onRowDragEnd,
|
40092
40093
|
hoverActions: hoverActions,
|
40093
|
-
hoverActionsDirection: hoverActionsDirection
|
40094
|
+
hoverActionsDirection: hoverActionsDirection,
|
40095
|
+
virtualized: virtualized
|
40094
40096
|
});
|
40095
40097
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(TableContext.Provider, {
|
40096
40098
|
value: value
|
@@ -40120,7 +40122,8 @@ Provider.defaultProps = {
|
|
40120
40122
|
return column.canEdit;
|
40121
40123
|
},
|
40122
40124
|
draggableRows: false,
|
40123
|
-
hoverActionsDirection: 'row'
|
40125
|
+
hoverActionsDirection: 'row',
|
40126
|
+
virtualized: false
|
40124
40127
|
};
|
40125
40128
|
Provider.propTypes = {
|
40126
40129
|
columns: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
@@ -40184,7 +40187,8 @@ Provider.propTypes = {
|
|
40184
40187
|
onRowDragStart: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
40185
40188
|
onRowDragEnd: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
40186
40189
|
hoverActions: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)]),
|
40187
|
-
hoverActionsDirection: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['row', 'column'])
|
40190
|
+
hoverActionsDirection: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['row', 'column']),
|
40191
|
+
virtualized: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
|
40188
40192
|
};
|
40189
40193
|
var calcPageCount = function calcPageCount(totalCount, pageSize) {
|
40190
40194
|
return Math.ceil(totalCount / pageSize);
|
@@ -40529,6 +40533,101 @@ var searchColumn = function searchColumn(search) {
|
|
40529
40533
|
|
40530
40534
|
/***/ }),
|
40531
40535
|
|
40536
|
+
/***/ "./src/table/dnd.js":
|
40537
|
+
/*!**************************!*\
|
40538
|
+
!*** ./src/table/dnd.js ***!
|
40539
|
+
\**************************/
|
40540
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
40541
|
+
|
40542
|
+
"use strict";
|
40543
|
+
__webpack_require__.r(__webpack_exports__);
|
40544
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
40545
|
+
/* harmony export */ DraggableWrapper: () => (/* binding */ DraggableWrapper),
|
40546
|
+
/* harmony export */ DroppableBody: () => (/* binding */ DroppableBody)
|
40547
|
+
/* harmony export */ });
|
40548
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
40549
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
40550
|
+
/* harmony import */ var react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-beautiful-dnd */ "./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js");
|
40551
|
+
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
40552
|
+
/* harmony import */ var _row_hover_actions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./row_hover_actions */ "./src/table/row_hover_actions.js");
|
40553
|
+
// LICENSE_CODE ZON
|
40554
|
+
|
40555
|
+
|
40556
|
+
/*jslint react:true*/
|
40557
|
+
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); }
|
40558
|
+
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); }
|
40559
|
+
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; }
|
40560
|
+
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; }
|
40561
|
+
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; }
|
40562
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
40563
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
40564
|
+
|
40565
|
+
|
40566
|
+
|
40567
|
+
|
40568
|
+
var useDraggableRowProps = function useDraggableRowProps(row, dndIndex) {
|
40569
|
+
var _rowProps$draggable;
|
40570
|
+
var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_1__.useTableContext)(),
|
40571
|
+
getRowProps = _useTableContext.getRowProps,
|
40572
|
+
draggableRows = _useTableContext.draggableRows,
|
40573
|
+
prepareRow = _useTableContext.prepareRow;
|
40574
|
+
prepareRow(row);
|
40575
|
+
var rowProps = row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row));
|
40576
|
+
var draggable = (_rowProps$draggable = rowProps === null || rowProps === void 0 ? void 0 : rowProps.draggable) !== null && _rowProps$draggable !== void 0 ? _rowProps$draggable : true;
|
40577
|
+
return {
|
40578
|
+
key: row.id,
|
40579
|
+
draggableId: row.id,
|
40580
|
+
index: dndIndex,
|
40581
|
+
isDragDisabled: !draggableRows || !draggable
|
40582
|
+
};
|
40583
|
+
};
|
40584
|
+
var DraggableWrapper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(function (props) {
|
40585
|
+
var render = props.render,
|
40586
|
+
row = props.row,
|
40587
|
+
index = props.index;
|
40588
|
+
var draggableProps = useDraggableRowProps(row, index);
|
40589
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_3__.Draggable, draggableProps, function (provided) {
|
40590
|
+
return render(_objectSpread(_objectSpread({}, provided.draggableProps), {}, {
|
40591
|
+
provided: provided,
|
40592
|
+
ref: provided.innerRef
|
40593
|
+
}), provided.dragHandleProps);
|
40594
|
+
});
|
40595
|
+
});
|
40596
|
+
DraggableWrapper.displayName = 'DraggableWrapper';
|
40597
|
+
var DroppableBody = function DroppableBody(props) {
|
40598
|
+
var _props$rows = props.rows,
|
40599
|
+
rows = _props$rows === void 0 ? [] : _props$rows,
|
40600
|
+
droppableProps = props.droppableProps,
|
40601
|
+
renderRow = props.renderRow;
|
40602
|
+
var _useRowHoverActions = (0,_row_hover_actions__WEBPACK_IMPORTED_MODULE_2__.useRowHoverActions)(),
|
40603
|
+
renderHoverActions = _useRowHoverActions.renderHoverActions,
|
40604
|
+
rowHoverEvents = _useRowHoverActions.rowHoverEvents;
|
40605
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_3__.Droppable, droppableProps, function (provided) {
|
40606
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({
|
40607
|
+
ref: provided.innerRef
|
40608
|
+
}, provided.droppableProps), rows.map(function (row, index) {
|
40609
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(DraggableWrapper, {
|
40610
|
+
key: row.id,
|
40611
|
+
row: row,
|
40612
|
+
index: index,
|
40613
|
+
render: function render(wrapperProps, dragHandleProps) {
|
40614
|
+
return renderRow({
|
40615
|
+
row: row,
|
40616
|
+
index: index,
|
40617
|
+
wrapperProps: _objectSpread(_objectSpread(_objectSpread({}, wrapperProps), rowHoverEvents), {}, {
|
40618
|
+
onPointerEnter: function onPointerEnter(e) {
|
40619
|
+
return rowHoverEvents.onPointerEnter(e, row, dragHandleProps);
|
40620
|
+
}
|
40621
|
+
})
|
40622
|
+
});
|
40623
|
+
}
|
40624
|
+
});
|
40625
|
+
}), provided.placeholder), renderHoverActions());
|
40626
|
+
});
|
40627
|
+
};
|
40628
|
+
|
40629
|
+
/***/ }),
|
40630
|
+
|
40532
40631
|
/***/ "./src/table/editable_columns.js":
|
40533
40632
|
/*!***************************************!*\
|
40534
40633
|
!*** ./src/table/editable_columns.js ***!
|
@@ -41976,25 +42075,28 @@ __webpack_require__.r(__webpack_exports__);
|
|
41976
42075
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
41977
42076
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
|
41978
42077
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
|
41979
|
-
/* 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");
|
41980
42078
|
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
41981
42079
|
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util */ "./src/util/index.js");
|
41982
42080
|
/* harmony import */ var _table_cell__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./table_cell */ "./src/table/table_cell.js");
|
41983
|
-
/* harmony import */ var _row_hover_actions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./row_hover_actions */ "./src/table/row_hover_actions.js");
|
41984
|
-
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
41985
42081
|
// LICENSE_CODE ZON
|
41986
42082
|
|
41987
42083
|
|
41988
42084
|
/*jslint react:true*/
|
42085
|
+
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); }
|
42086
|
+
var _excluded = ["provided", "style"];
|
42087
|
+
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; }
|
42088
|
+
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; }
|
42089
|
+
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; }
|
42090
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
42091
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
42092
|
+
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; }
|
42093
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
41989
42094
|
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); }
|
41990
42095
|
|
41991
42096
|
|
41992
42097
|
|
41993
42098
|
|
41994
42099
|
|
41995
|
-
|
41996
|
-
|
41997
|
-
|
41998
42100
|
var preventOnClickClass = 'tableCell--preventOnClick';
|
41999
42101
|
var renderRow = function renderRow(opt) {
|
42000
42102
|
var className = opt.className,
|
@@ -42004,7 +42106,7 @@ var renderRow = function renderRow(opt) {
|
|
42004
42106
|
rowDensity = opt.rowDensity,
|
42005
42107
|
isLast = opt.isLast,
|
42006
42108
|
renderRowSubComponent = opt.renderRowSubComponent,
|
42007
|
-
|
42109
|
+
wrapperProps = opt.wrapperProps;
|
42008
42110
|
var isExpanded = row.isExpanded,
|
42009
42111
|
isPinned = row.isPinned,
|
42010
42112
|
original = row.original;
|
@@ -42034,15 +42136,13 @@ var renderRow = function renderRow(opt) {
|
|
42034
42136
|
var wrapperKey = "".concat(rowProps.key || row.id, "_wrapper");
|
42035
42137
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowWrapper, {
|
42036
42138
|
key: wrapperKey,
|
42037
|
-
|
42038
|
-
row: row
|
42139
|
+
wrapperProps: wrapperProps
|
42039
42140
|
}, tableRow);
|
42040
42141
|
}
|
42041
42142
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
42042
42143
|
key: "".concat(rowProps.key, "_fragment")
|
42043
42144
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowWrapper, {
|
42044
|
-
|
42045
|
-
row: row
|
42145
|
+
wrapperProps: wrapperProps
|
42046
42146
|
}, tableRow, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(TableRow, _extends({}, rowProps, {
|
42047
42147
|
key: "".concat(rowProps.key, "_subcomponent"),
|
42048
42148
|
className: (0,_util__WEBPACK_IMPORTED_MODULE_3__.classNames)(className, {
|
@@ -42066,43 +42166,26 @@ var TableRow = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.with
|
|
42066
42166
|
white_spaced: '72'
|
42067
42167
|
}[props.$rowDensity] || '32';
|
42068
42168
|
}, _table_cell__WEBPACK_IMPORTED_MODULE_4__.TableCellContent, _theme__WEBPACK_IMPORTED_MODULE_2__["default"].color.gray_2);
|
42069
|
-
var
|
42070
|
-
var
|
42071
|
-
var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)(),
|
42072
|
-
getRowProps = _useTableContext.getRowProps,
|
42073
|
-
draggableRows = _useTableContext.draggableRows;
|
42074
|
-
var rowProps = row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row));
|
42075
|
-
var draggable = (_rowProps$draggable = rowProps === null || rowProps === void 0 ? void 0 : rowProps.draggable) !== null && _rowProps$draggable !== void 0 ? _rowProps$draggable : true;
|
42076
|
-
return {
|
42077
|
-
key: row.id,
|
42078
|
-
draggableId: row.id,
|
42079
|
-
index: dndIndex,
|
42080
|
-
isDragDisabled: !draggableRows || !draggable
|
42081
|
-
};
|
42082
|
-
};
|
42083
|
-
var RowWrapper = function RowWrapper(props) {
|
42169
|
+
var RowWrapper = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(function (props) {
|
42170
|
+
var _provided$draggablePr;
|
42084
42171
|
var children = props.children,
|
42085
|
-
|
42086
|
-
|
42087
|
-
var
|
42088
|
-
|
42089
|
-
|
42090
|
-
|
42091
|
-
|
42092
|
-
|
42093
|
-
|
42094
|
-
}, []);
|
42095
|
-
var draggableProps = useDraggableRowProps(row, dndIndex);
|
42096
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_7__.Draggable, draggableProps, function (provided) {
|
42097
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({}, provided.draggableProps, hoverProps, {
|
42098
|
-
ref: function ref(element) {
|
42099
|
-
return handleWrapperRef(element, provided.innerRef);
|
42100
|
-
}
|
42101
|
-
}), children, renderHoverActions({
|
42102
|
-
dragHandleProps: provided.dragHandleProps
|
42103
|
-
}));
|
42172
|
+
_props$wrapperProps = props.wrapperProps,
|
42173
|
+
wrapperProps = _props$wrapperProps === void 0 ? {} : _props$wrapperProps;
|
42174
|
+
var _wrapperProps$provide = wrapperProps.provided,
|
42175
|
+
provided = _wrapperProps$provide === void 0 ? {} : _wrapperProps$provide,
|
42176
|
+
_wrapperProps$style = wrapperProps.style,
|
42177
|
+
style = _wrapperProps$style === void 0 ? {} : _wrapperProps$style,
|
42178
|
+
rest = _objectWithoutProperties(wrapperProps, _excluded);
|
42179
|
+
var _wrapperProps = _objectSpread(_objectSpread(_objectSpread({}, rest), provided.draggableProps), {}, {
|
42180
|
+
style: _objectSpread(_objectSpread({}, style), (_provided$draggablePr = provided.draggableProps) === null || _provided$draggablePr === void 0 ? void 0 : _provided$draggablePr.style)
|
42104
42181
|
});
|
42105
|
-
|
42182
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _wrapperProps, children, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", _extends({
|
42183
|
+
style: {
|
42184
|
+
visibility: 'hidden'
|
42185
|
+
}
|
42186
|
+
}, provided.dragHandleProps)));
|
42187
|
+
});
|
42188
|
+
RowWrapper.displayName = 'RowWrapper';
|
42106
42189
|
|
42107
42190
|
/***/ }),
|
42108
42191
|
|
@@ -42129,7 +42212,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
42129
42212
|
|
42130
42213
|
|
42131
42214
|
/*jslint react:true*/
|
42215
|
+
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); }
|
42132
42216
|
var _excluded = ["visible", "dragHandleProps", "row"];
|
42217
|
+
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; }
|
42218
|
+
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; }
|
42219
|
+
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; }
|
42220
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
42221
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
42133
42222
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
42134
42223
|
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."); }
|
42135
42224
|
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); }
|
@@ -42155,7 +42244,9 @@ var RowHoverActions = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forward
|
|
42155
42244
|
getRowProps = _useTableContext.getRowProps,
|
42156
42245
|
draggableRows = _useTableContext.draggableRows,
|
42157
42246
|
contextHoverActions = _useTableContext.hoverActions,
|
42158
|
-
hoverActionsDirection = _useTableContext.hoverActionsDirection
|
42247
|
+
hoverActionsDirection = _useTableContext.hoverActionsDirection,
|
42248
|
+
prepareRow = _useTableContext.prepareRow;
|
42249
|
+
prepareRow(row);
|
42159
42250
|
var _row$getRowProps = row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row)),
|
42160
42251
|
draggable = _row$getRowProps.draggable;
|
42161
42252
|
var hoverActions = typeof contextHoverActions == 'function' ? contextHoverActions(row) : contextHoverActions;
|
@@ -42185,13 +42276,13 @@ var HoverActionsList = styled_components__WEBPACK_IMPORTED_MODULE_1___default().
|
|
42185
42276
|
}, _theme__WEBPACK_IMPORTED_MODULE_2__["default"].spacing['02'], function (props) {
|
42186
42277
|
return props.$visible ? 'visible' : 'hidden';
|
42187
42278
|
});
|
42188
|
-
var useRowHoverActions = function useRowHoverActions(
|
42279
|
+
var useRowHoverActions = function useRowHoverActions() {
|
42189
42280
|
var _useTableContext2 = (0,_context__WEBPACK_IMPORTED_MODULE_4__.useTableContext)(),
|
42190
42281
|
isDraggingRow = _useTableContext2.isDraggingRow;
|
42191
42282
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
42192
42283
|
_useState2 = _slicedToArray(_useState, 2),
|
42193
|
-
|
42194
|
-
|
42284
|
+
hoveredRow = _useState2[0],
|
42285
|
+
setHoveredRow = _useState2[1];
|
42195
42286
|
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null),
|
42196
42287
|
_useState4 = _slicedToArray(_useState3, 2),
|
42197
42288
|
hoverActionsRef = _useState4[0],
|
@@ -42200,7 +42291,7 @@ var useRowHoverActions = function useRowHoverActions(row) {
|
|
42200
42291
|
_useState6 = _slicedToArray(_useState5, 2),
|
42201
42292
|
visibleHoverActions = _useState6[0],
|
42202
42293
|
setVisibleHoverActions = _useState6[1];
|
42203
|
-
var _usePopper = (0,react_popper__WEBPACK_IMPORTED_MODULE_5__.usePopper)(
|
42294
|
+
var _usePopper = (0,react_popper__WEBPACK_IMPORTED_MODULE_5__.usePopper)(hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.ref, hoverActionsRef, {
|
42204
42295
|
modifiers: [{
|
42205
42296
|
name: 'flip',
|
42206
42297
|
enabled: true,
|
@@ -42213,31 +42304,47 @@ var useRowHoverActions = function useRowHoverActions(row) {
|
|
42213
42304
|
styles = _usePopper.styles,
|
42214
42305
|
attributes = _usePopper.attributes,
|
42215
42306
|
update = _usePopper.update;
|
42216
|
-
var
|
42307
|
+
var _onPointerEnter = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
42217
42308
|
if (typeof update == 'function') update();
|
42218
42309
|
!isDraggingRow && setVisibleHoverActions(true);
|
42219
42310
|
}, [isDraggingRow, update]);
|
42220
42311
|
var onPointerLeave = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
42221
42312
|
return setVisibleHoverActions(false);
|
42222
42313
|
}, []);
|
42223
|
-
var
|
42224
|
-
|
42225
|
-
|
42226
|
-
|
42227
|
-
|
42228
|
-
|
42229
|
-
|
42314
|
+
var rowHoverEvents = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
42315
|
+
return {
|
42316
|
+
onPointerEnter: function onPointerEnter(e, row, dragHandleProps) {
|
42317
|
+
setHoveredRow({
|
42318
|
+
row: row,
|
42319
|
+
ref: e.currentTarget,
|
42320
|
+
dragHandleProps: dragHandleProps
|
42321
|
+
});
|
42322
|
+
_onPointerEnter();
|
42323
|
+
},
|
42324
|
+
onPointerLeave: onPointerLeave
|
42325
|
+
};
|
42326
|
+
}, [_onPointerEnter, onPointerLeave]);
|
42327
|
+
var popperProps = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
42328
|
+
return _objectSpread(_objectSpread({
|
42329
|
+
onPointerEnter: _onPointerEnter,
|
42330
|
+
onPointerLeave: onPointerLeave
|
42331
|
+
}, attributes.popper), {}, {
|
42332
|
+
style: _objectSpread(_objectSpread({}, styles.popper), {}, {
|
42333
|
+
zIndex: 9999
|
42334
|
+
}),
|
42230
42335
|
visible: visibleHoverActions,
|
42231
|
-
row: row,
|
42232
|
-
ref: setHoverActionsRef
|
42233
|
-
|
42234
|
-
|
42235
|
-
|
42236
|
-
|
42336
|
+
row: hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.row,
|
42337
|
+
ref: setHoverActionsRef,
|
42338
|
+
dragHandleProps: hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.dragHandleProps
|
42339
|
+
});
|
42340
|
+
}, [_onPointerEnter, onPointerLeave, attributes, styles, isDraggingRow, visibleHoverActions, setHoverActionsRef, hoveredRow]);
|
42341
|
+
var renderHoverActions = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
42342
|
+
if (!(hoveredRow !== null && hoveredRow !== void 0 && hoveredRow.row) || !(hoveredRow !== null && hoveredRow !== void 0 && hoveredRow.ref)) return null;
|
42343
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowHoverActions, popperProps);
|
42344
|
+
}, [hoveredRow === null || hoveredRow === void 0 ? void 0 : hoveredRow.row, popperProps]);
|
42237
42345
|
return {
|
42238
42346
|
renderHoverActions: renderHoverActions,
|
42239
|
-
|
42240
|
-
hoverProps: hoverProps
|
42347
|
+
rowHoverEvents: rowHoverEvents
|
42241
42348
|
};
|
42242
42349
|
};
|
42243
42350
|
|
@@ -42872,14 +42979,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
42872
42979
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
|
42873
42980
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! styled-components */ "styled-components");
|
42874
42981
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
42875
|
-
/* harmony import */ var
|
42876
|
-
/* harmony import */ var
|
42877
|
-
/* harmony import */ var
|
42878
|
-
/* harmony import */ var
|
42879
|
-
/* harmony import */ var
|
42880
|
-
/* harmony import */ var
|
42881
|
-
/* harmony import */ var
|
42882
|
-
/* harmony import */ var
|
42982
|
+
/* harmony import */ var react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react-beautiful-dnd */ "./node_modules/react-beautiful-dnd/dist/react-beautiful-dnd.esm.js");
|
42983
|
+
/* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-virtualized */ "react-virtualized");
|
42984
|
+
/* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_virtualized__WEBPACK_IMPORTED_MODULE_4__);
|
42985
|
+
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
42986
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util */ "./src/util/index.js");
|
42987
|
+
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
42988
|
+
/* harmony import */ var _footer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./footer */ "./src/table/footer.js");
|
42989
|
+
/* harmony import */ var _header__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./header */ "./src/table/header.js");
|
42990
|
+
/* harmony import */ var _render_row__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./render_row */ "./src/table/render_row.js");
|
42991
|
+
/* harmony import */ var _sticky_header__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./sticky_header */ "./src/table/sticky_header.js");
|
42992
|
+
/* harmony import */ var _virtualized_body__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./virtualized_body */ "./src/table/virtualized_body.js");
|
42993
|
+
/* harmony import */ var _dnd__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dnd */ "./src/table/dnd.js");
|
42883
42994
|
// LICENSE_CODE ZON
|
42884
42995
|
|
42885
42996
|
|
@@ -42893,6 +43004,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
42893
43004
|
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; }
|
42894
43005
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
42895
43006
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
43007
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
43008
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
43009
|
+
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); }
|
43010
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
43011
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
43012
|
+
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; }
|
42896
43013
|
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); }
|
42897
43014
|
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; }
|
42898
43015
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } } return target; }
|
@@ -42906,27 +43023,31 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
42906
43023
|
|
42907
43024
|
|
42908
43025
|
|
43026
|
+
|
43027
|
+
|
43028
|
+
|
42909
43029
|
var Table = function Table(props) {
|
42910
|
-
var context = (0,
|
43030
|
+
var context = (0,_context__WEBPACK_IMPORTED_MODULE_7__.useTableContext)();
|
42911
43031
|
// not under context
|
42912
|
-
if (context ===
|
42913
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
|
43032
|
+
if (context === _context__WEBPACK_IMPORTED_MODULE_7__.defaultContextValue) {
|
43033
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_context__WEBPACK_IMPORTED_MODULE_7__["default"], props, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(InnerTable, props));
|
42914
43034
|
}
|
42915
43035
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(InnerTable, props);
|
42916
43036
|
};
|
42917
43037
|
Table.displayName = 'Table';
|
42918
|
-
Table.propTypes = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default()(
|
43038
|
+
Table.propTypes = lodash_cloneDeep__WEBPACK_IMPORTED_MODULE_1___default()(_context__WEBPACK_IMPORTED_MODULE_7__["default"].propTypes);
|
42919
43039
|
var InnerTable = function InnerTable(props) {
|
42920
|
-
var _useTableContext = (0,
|
43040
|
+
var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_7__.useTableContext)(),
|
42921
43041
|
getTableProps = _useTableContext.getTableProps,
|
42922
43042
|
context = _objectWithoutProperties(_useTableContext, _excluded);
|
42923
|
-
var className = (0,
|
42924
|
-
var rowDensity = (0,
|
42925
|
-
var onRowClick = (0,
|
42926
|
-
var stickyHeader = (0,
|
42927
|
-
var scrollTarget = (0,
|
42928
|
-
var scrollable = (0,
|
42929
|
-
var
|
43043
|
+
var className = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(props.className, context.className);
|
43044
|
+
var rowDensity = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(props.rowDensity, context.rowDensity);
|
43045
|
+
var onRowClick = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(props.onRowClick, context.onRowClick);
|
43046
|
+
var stickyHeader = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(props.stickyHeader, context.stickyHeader);
|
43047
|
+
var scrollTarget = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(props.scrollTarget, context.scrollTarget);
|
43048
|
+
var scrollable = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(props.scrollable, context.scrollable);
|
43049
|
+
var virtualized = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(props.virtualized, context.virtualized);
|
43050
|
+
var scrollHeight = (0,_util__WEBPACK_IMPORTED_MODULE_6__.firstDefined)(props.scrollHeight, context.scrollHeight);
|
42930
43051
|
var offsetTop = lodash_isObject__WEBPACK_IMPORTED_MODULE_0___default()(stickyHeader) && stickyHeader.offsetTop || 0;
|
42931
43052
|
var wrapperRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)();
|
42932
43053
|
var tableRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)();
|
@@ -42939,23 +43060,29 @@ var InnerTable = function InnerTable(props) {
|
|
42939
43060
|
var headStyle = scrollable ? {
|
42940
43061
|
overflow: 'hidden'
|
42941
43062
|
} : undefined;
|
42942
|
-
var bodyStyle =
|
42943
|
-
|
42944
|
-
|
42945
|
-
|
43063
|
+
var bodyStyle = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {
|
43064
|
+
if (virtualized) return {
|
43065
|
+
maxHeight: scrollHeight
|
43066
|
+
};
|
43067
|
+
if (scrollable) return {
|
43068
|
+
overflow: 'auto',
|
43069
|
+
maxHeight: scrollHeight
|
43070
|
+
};
|
43071
|
+
}, [virtualized, scrollable]);
|
42946
43072
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(TableWrapper, _extends({
|
42947
43073
|
ref: wrapperRef
|
42948
|
-
}, (0,
|
42949
|
-
|
43074
|
+
}, (0,_util__WEBPACK_IMPORTED_MODULE_6__.getCommonProps)(props), {
|
43075
|
+
$virtualized: virtualized,
|
43076
|
+
className: (0,_util__WEBPACK_IMPORTED_MODULE_6__.classNames)(className, {
|
42950
43077
|
container: true
|
42951
43078
|
}, className)
|
42952
43079
|
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(StyledTable, _extends({
|
42953
43080
|
ref: tableRef
|
42954
43081
|
}, getTableProps(), {
|
42955
|
-
className: (0,
|
43082
|
+
className: (0,_util__WEBPACK_IMPORTED_MODULE_6__.classNames)(className, {
|
42956
43083
|
table: true
|
42957
43084
|
})
|
42958
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
|
43085
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_header__WEBPACK_IMPORTED_MODULE_9__.TableHeader, {
|
42959
43086
|
ref: headerRef,
|
42960
43087
|
className: className,
|
42961
43088
|
style: headStyle
|
@@ -42965,12 +43092,12 @@ var InnerTable = function InnerTable(props) {
|
|
42965
43092
|
onRowClick: onRowClick,
|
42966
43093
|
style: bodyStyle,
|
42967
43094
|
onScroll: onScroll
|
42968
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
|
43095
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_footer__WEBPACK_IMPORTED_MODULE_8__.TableFooter, {
|
42969
43096
|
ref: footerRef,
|
42970
43097
|
rowDensity: rowDensity,
|
42971
43098
|
className: className,
|
42972
43099
|
style: headStyle
|
42973
|
-
}), !!stickyHeader && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(
|
43100
|
+
}), !!stickyHeader && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_sticky_header__WEBPACK_IMPORTED_MODULE_11__.StickyHeader, {
|
42974
43101
|
offsetTop: offsetTop,
|
42975
43102
|
onRowClick: onRowClick,
|
42976
43103
|
rowDensity: rowDensity,
|
@@ -42984,7 +43111,9 @@ InnerTable.displayName = 'InnerTable';
|
|
42984
43111
|
var TableWrapper = styled_components__WEBPACK_IMPORTED_MODULE_3___default().div.withConfig({
|
42985
43112
|
displayName: "TableWrapper",
|
42986
43113
|
componentId: "sc-ebeoik-0"
|
42987
|
-
})(["width:100%;border:1px solid ", ";border-radius:4px;overflow-x:
|
43114
|
+
})(["width:100%;border:1px solid ", ";border-radius:4px;overflow-x:", ";", ""], _theme__WEBPACK_IMPORTED_MODULE_5__["default"].color.gray_3, function (props) {
|
43115
|
+
return props.$virtualized ? 'unset' : 'auto';
|
43116
|
+
}, _theme__WEBPACK_IMPORTED_MODULE_5__["default"].scrollbars.thin);
|
42988
43117
|
var StyledTable = styled_components__WEBPACK_IMPORTED_MODULE_3___default().div.withConfig({
|
42989
43118
|
displayName: "StyledTable",
|
42990
43119
|
componentId: "sc-ebeoik-1"
|
@@ -42994,7 +43123,7 @@ var TableBody = function TableBody(props) {
|
|
42994
43123
|
rowDensity = props.rowDensity,
|
42995
43124
|
onRowClick = props.onRowClick,
|
42996
43125
|
onScroll = props.onScroll;
|
42997
|
-
var _useTableContext2 = (0,
|
43126
|
+
var _useTableContext2 = (0,_context__WEBPACK_IMPORTED_MODULE_7__.useTableContext)(),
|
42998
43127
|
getTableBodyProps = _useTableContext2.getTableBodyProps,
|
42999
43128
|
prepareRow = _useTableContext2.prepareRow,
|
43000
43129
|
page = _useTableContext2.page,
|
@@ -43009,23 +43138,39 @@ var TableBody = function TableBody(props) {
|
|
43009
43138
|
onRowDragStart = _useTableContext2.onRowDragStart,
|
43010
43139
|
onRowDragEnd = _useTableContext2.onRowDragEnd,
|
43011
43140
|
rowsById = _useTableContext2.rowsById;
|
43141
|
+
var rows = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {
|
43142
|
+
return [].concat(_toConsumableArray(pinnedRows), _toConsumableArray(page.filter(function (row) {
|
43143
|
+
return !row.isPinned;
|
43144
|
+
})));
|
43145
|
+
}, [pinnedRows, page]);
|
43146
|
+
var _renderRow = function _renderRow(_ref) {
|
43147
|
+
var row = _ref.row,
|
43148
|
+
index = _ref.index,
|
43149
|
+
wrapperProps = _ref.wrapperProps;
|
43150
|
+
prepareRow(row);
|
43151
|
+
return (0,_render_row__WEBPACK_IMPORTED_MODULE_10__.renderRow)({
|
43152
|
+
row: row,
|
43153
|
+
rowDensity: rowDensity,
|
43154
|
+
onRowClick: onRowClick,
|
43155
|
+
isLast: !row.isPinned && index == rows.length - 1,
|
43156
|
+
showExpand: !row.isPinned && row.canExpand,
|
43157
|
+
className: className,
|
43158
|
+
getRowProps: getRowProps,
|
43159
|
+
renderRowSubComponent: renderRowSubComponent,
|
43160
|
+
wrapperProps: wrapperProps
|
43161
|
+
});
|
43162
|
+
};
|
43163
|
+
var cache = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(new react_virtualized__WEBPACK_IMPORTED_MODULE_4__.CellMeasurerCache({
|
43164
|
+
fixedWidth: true,
|
43165
|
+
defaultHeight: 30
|
43166
|
+
}));
|
43012
43167
|
var body = function () {
|
43013
|
-
if (isLoading) return (0,
|
43014
|
-
if (!
|
43015
|
-
return
|
43016
|
-
|
43017
|
-
|
43018
|
-
|
43019
|
-
row: row,
|
43020
|
-
rowDensity: rowDensity,
|
43021
|
-
onRowClick: onRowClick,
|
43022
|
-
isLast: i == page.length - 1,
|
43023
|
-
showExpand: row.canExpand,
|
43024
|
-
className: className,
|
43025
|
-
getRowProps: getRowProps,
|
43026
|
-
renderRowSubComponent: renderRowSubComponent,
|
43027
|
-
dndIndex: i
|
43028
|
-
});
|
43168
|
+
if (isLoading) return (0,_util__WEBPACK_IMPORTED_MODULE_6__.flexRender)(LoadingComp);
|
43169
|
+
if (!rows.length) return (0,_util__WEBPACK_IMPORTED_MODULE_6__.flexRender)(NoDataComp);
|
43170
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(Body, {
|
43171
|
+
rows: rows,
|
43172
|
+
renderRow: _renderRow,
|
43173
|
+
measurerCache: cache
|
43029
43174
|
});
|
43030
43175
|
}();
|
43031
43176
|
var bodyProps = getTableBodyProps();
|
@@ -43033,66 +43178,57 @@ var TableBody = function TableBody(props) {
|
|
43033
43178
|
var onDragStart = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (e) {
|
43034
43179
|
setIsDraggingRow(true);
|
43035
43180
|
var context = {
|
43036
|
-
page:
|
43181
|
+
page: rows
|
43037
43182
|
};
|
43038
43183
|
onRowDragStart === null || onRowDragStart === void 0 || onRowDragStart(e, rowsById[e.draggableId], context);
|
43039
|
-
}, [
|
43184
|
+
}, [rows]);
|
43040
43185
|
var onDragEnd = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (e) {
|
43041
|
-
var
|
43186
|
+
var _rows$e$destination$i, _e$destination, _rowsById$destRowId;
|
43042
43187
|
setIsDraggingRow(false);
|
43043
|
-
var destRowId = (
|
43188
|
+
var destRowId = (_rows$e$destination$i = rows[(_e$destination = e.destination) === null || _e$destination === void 0 ? void 0 : _e$destination.index]) === null || _rows$e$destination$i === void 0 ? void 0 : _rows$e$destination$i.id;
|
43044
43189
|
var context = {
|
43045
|
-
previousPage:
|
43190
|
+
previousPage: rows
|
43046
43191
|
};
|
43047
|
-
|
43048
|
-
|
43049
|
-
|
43192
|
+
var originRow = rowsById[e.draggableId];
|
43193
|
+
var destRow = ((_rowsById$destRowId = rowsById[destRowId]) === null || _rowsById$destRowId === void 0 ? void 0 : _rowsById$destRowId.isPinned) == (originRow === null || originRow === void 0 ? void 0 : originRow.isPinned) ? rowsById[destRowId] : undefined;
|
43194
|
+
var event = destRow ? e : _objectSpread(_objectSpread({}, e), {}, {
|
43195
|
+
destination: null,
|
43196
|
+
combine: null
|
43197
|
+
});
|
43198
|
+
cache.current.clearAll();
|
43199
|
+
onRowDragEnd === null || onRowDragEnd === void 0 || onRowDragEnd(event, originRow, destRow, context);
|
43200
|
+
}, [rows, cache.current]);
|
43201
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_14__.DragDropContext, {
|
43050
43202
|
onDragStart: onDragStart,
|
43051
43203
|
onDragEnd: onDragEnd
|
43052
43204
|
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(TableBodyRowGroup, _extends({
|
43053
43205
|
"data-rowgroup-type": "body"
|
43054
43206
|
}, bodyProps, {
|
43055
43207
|
style: style,
|
43056
|
-
className: (0,
|
43208
|
+
className: (0,_util__WEBPACK_IMPORTED_MODULE_6__.classNames)(className, {
|
43057
43209
|
tableBody: true
|
43058
43210
|
}),
|
43059
43211
|
onScroll: onScroll
|
43060
|
-
}),
|
43061
|
-
id: "table-body-pinned-rows",
|
43062
|
-
type: "PINNED_ROWS"
|
43063
|
-
}, pinnedRows.map(function (row, i) {
|
43064
|
-
prepareRow(row);
|
43065
|
-
return (0,_render_row__WEBPACK_IMPORTED_MODULE_9__.renderRow)({
|
43066
|
-
row: row,
|
43067
|
-
rowDensity: rowDensity,
|
43068
|
-
onRowClick: onRowClick,
|
43069
|
-
className: className,
|
43070
|
-
getRowProps: getRowProps,
|
43071
|
-
renderRowSubComponent: renderRowSubComponent,
|
43072
|
-
dndIndex: i
|
43073
|
-
});
|
43074
|
-
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(DroppableBodyRowGroup, {
|
43075
|
-
id: "table-body-rows",
|
43076
|
-
type: "ROWS"
|
43077
|
-
}, body)));
|
43212
|
+
}), body));
|
43078
43213
|
};
|
43079
|
-
var
|
43080
|
-
var
|
43081
|
-
|
43082
|
-
|
43083
|
-
|
43084
|
-
|
43085
|
-
|
43086
|
-
|
43087
|
-
|
43088
|
-
|
43089
|
-
|
43090
|
-
|
43214
|
+
var Body = function Body(props) {
|
43215
|
+
var _useTableContext3 = (0,_context__WEBPACK_IMPORTED_MODULE_7__.useTableContext)(),
|
43216
|
+
virtualized = _useTableContext3.virtualized;
|
43217
|
+
var droppableProps = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {
|
43218
|
+
return {
|
43219
|
+
droppableId: 'table-body-rows',
|
43220
|
+
type: 'ROWS'
|
43221
|
+
};
|
43222
|
+
}, []);
|
43223
|
+
var BodyComp = virtualized ? _virtualized_body__WEBPACK_IMPORTED_MODULE_12__.VirtualizedBody : _dnd__WEBPACK_IMPORTED_MODULE_13__.DroppableBody;
|
43224
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(BodyComp, _extends({}, props, {
|
43225
|
+
droppableProps: droppableProps
|
43226
|
+
}));
|
43091
43227
|
};
|
43092
43228
|
var TableBodyRowGroup = styled_components__WEBPACK_IMPORTED_MODULE_3___default().div.withConfig({
|
43093
43229
|
displayName: "TableBodyRowGroup",
|
43094
43230
|
componentId: "sc-ebeoik-2"
|
43095
|
-
})(["", ""],
|
43231
|
+
})(["", ""], _theme__WEBPACK_IMPORTED_MODULE_5__["default"].scrollbars.thin);
|
43096
43232
|
|
43097
43233
|
/***/ }),
|
43098
43234
|
|
@@ -43216,6 +43352,194 @@ var EditableCellContent = styled_components__WEBPACK_IMPORTED_MODULE_1___default
|
|
43216
43352
|
|
43217
43353
|
/***/ }),
|
43218
43354
|
|
43355
|
+
/***/ "./src/table/virtualized_body.js":
|
43356
|
+
/*!***************************************!*\
|
43357
|
+
!*** ./src/table/virtualized_body.js ***!
|
43358
|
+
\***************************************/
|
43359
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
43360
|
+
|
43361
|
+
"use strict";
|
43362
|
+
__webpack_require__.r(__webpack_exports__);
|
43363
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
43364
|
+
/* harmony export */ VirtualizedBody: () => (/* binding */ VirtualizedBody)
|
43365
|
+
/* harmony export */ });
|
43366
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
43367
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
43368
|
+
/* 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");
|
43369
|
+
/* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-virtualized */ "react-virtualized");
|
43370
|
+
/* harmony import */ var react_virtualized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_virtualized__WEBPACK_IMPORTED_MODULE_1__);
|
43371
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! styled-components */ "styled-components");
|
43372
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_2__);
|
43373
|
+
/* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
|
43374
|
+
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
43375
|
+
/* harmony import */ var _dnd__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dnd */ "./src/table/dnd.js");
|
43376
|
+
/* harmony import */ var _row_hover_actions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./row_hover_actions */ "./src/table/row_hover_actions.js");
|
43377
|
+
// LICENSE_CODE ZON
|
43378
|
+
|
43379
|
+
|
43380
|
+
/*jslint react:true*/
|
43381
|
+
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); }
|
43382
|
+
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); }
|
43383
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
43384
|
+
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."); }
|
43385
|
+
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); }
|
43386
|
+
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; }
|
43387
|
+
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; } }
|
43388
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
43389
|
+
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; }
|
43390
|
+
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; }
|
43391
|
+
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; }
|
43392
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
43393
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
43394
|
+
|
43395
|
+
|
43396
|
+
|
43397
|
+
|
43398
|
+
|
43399
|
+
|
43400
|
+
|
43401
|
+
|
43402
|
+
var RowRenderer = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(function (props) {
|
43403
|
+
var row = props.row,
|
43404
|
+
cache = props.cache,
|
43405
|
+
renderRow = props.renderRow,
|
43406
|
+
index = props.index,
|
43407
|
+
style = props.style,
|
43408
|
+
parent = props.parent,
|
43409
|
+
rowHoverEvents = props.rowHoverEvents;
|
43410
|
+
// padding is needed to see the divider between rows when new rows are added
|
43411
|
+
var _style = _objectSpread(_objectSpread({}, style), {}, {
|
43412
|
+
padding: '0.3px 0'
|
43413
|
+
});
|
43414
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_1__.CellMeasurer, {
|
43415
|
+
cache: cache.current,
|
43416
|
+
parent: parent,
|
43417
|
+
columnIndex: 0,
|
43418
|
+
rowIndex: index
|
43419
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_dnd__WEBPACK_IMPORTED_MODULE_5__.DraggableWrapper, {
|
43420
|
+
key: row.id,
|
43421
|
+
row: row,
|
43422
|
+
index: index,
|
43423
|
+
render: function render(wrapperProps, dragHandleProps) {
|
43424
|
+
return renderRow({
|
43425
|
+
row: row,
|
43426
|
+
index: index,
|
43427
|
+
wrapperProps: _objectSpread(_objectSpread(_objectSpread({}, wrapperProps), rowHoverEvents), {}, {
|
43428
|
+
onPointerEnter: function onPointerEnter(e) {
|
43429
|
+
return rowHoverEvents.onPointerEnter(e, row, dragHandleProps);
|
43430
|
+
},
|
43431
|
+
style: _style
|
43432
|
+
})
|
43433
|
+
});
|
43434
|
+
}
|
43435
|
+
}));
|
43436
|
+
});
|
43437
|
+
RowRenderer.displayName = 'RowRenderer';
|
43438
|
+
var rowRenderer = function rowRenderer(rows, cache, renderRow, rowHoverEvents) {
|
43439
|
+
var RendererWrapper = function RendererWrapper(_ref) {
|
43440
|
+
var key = _ref.key,
|
43441
|
+
index = _ref.index,
|
43442
|
+
style = _ref.style,
|
43443
|
+
parent = _ref.parent;
|
43444
|
+
var row = rows[index];
|
43445
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowRenderer, {
|
43446
|
+
key: key,
|
43447
|
+
row: row,
|
43448
|
+
index: index,
|
43449
|
+
style: style,
|
43450
|
+
parent: parent,
|
43451
|
+
cache: cache,
|
43452
|
+
renderRow: renderRow,
|
43453
|
+
rowHoverEvents: rowHoverEvents
|
43454
|
+
});
|
43455
|
+
};
|
43456
|
+
return RendererWrapper;
|
43457
|
+
};
|
43458
|
+
var renderClone = function renderClone(rows, renderRow) {
|
43459
|
+
return function (provided, snapshot, rubric) {
|
43460
|
+
var row = rows[rubric.source.index];
|
43461
|
+
var wrapperProps = {
|
43462
|
+
provided: provided,
|
43463
|
+
ref: provided.innerRef
|
43464
|
+
};
|
43465
|
+
return renderRow({
|
43466
|
+
row: row,
|
43467
|
+
index: rubric.source.index,
|
43468
|
+
wrapperProps: wrapperProps
|
43469
|
+
});
|
43470
|
+
};
|
43471
|
+
};
|
43472
|
+
var listRefHandler = function listRefHandler(droppableProvided, setListRef) {
|
43473
|
+
return function (ref) {
|
43474
|
+
var _ref$Grid;
|
43475
|
+
if (!ref) return;
|
43476
|
+
var element = ref === null || ref === void 0 || (_ref$Grid = ref.Grid) === null || _ref$Grid === void 0 ? void 0 : _ref$Grid._scrollingContainer;
|
43477
|
+
if (element instanceof window.HTMLElement) {
|
43478
|
+
setListRef(element === null || element === void 0 ? void 0 : element.firstChild);
|
43479
|
+
droppableProvided.innerRef(element);
|
43480
|
+
}
|
43481
|
+
};
|
43482
|
+
};
|
43483
|
+
var VirtualizedBodyComp = function VirtualizedBodyComp(props) {
|
43484
|
+
var rows = props.rows,
|
43485
|
+
measurerCache = props.measurerCache,
|
43486
|
+
renderRow = props.renderRow,
|
43487
|
+
droppableProps = props.droppableProps;
|
43488
|
+
var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_4__.useTableContext)(),
|
43489
|
+
maxHeight = _useTableContext.scrollHeight;
|
43490
|
+
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(),
|
43491
|
+
_useState2 = _slicedToArray(_useState, 2),
|
43492
|
+
listRef = _useState2[0],
|
43493
|
+
setListRef = _useState2[1];
|
43494
|
+
var _useState3 = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0),
|
43495
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
43496
|
+
_height = _useState4[0],
|
43497
|
+
setHeight = _useState4[1];
|
43498
|
+
var _useRowHoverActions = (0,_row_hover_actions__WEBPACK_IMPORTED_MODULE_6__.useRowHoverActions)(),
|
43499
|
+
renderHoverActions = _useRowHoverActions.renderHoverActions,
|
43500
|
+
rowHoverEvents = _useRowHoverActions.rowHoverEvents;
|
43501
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
43502
|
+
if (listRef) listRef.style.overflow = 'unset';
|
43503
|
+
setHeight(rows.reduce(function (acc, row, index) {
|
43504
|
+
return acc += measurerCache.current.getHeight(index, 0);
|
43505
|
+
}, 0));
|
43506
|
+
}, [listRef, rows]);
|
43507
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_beautiful_dnd__WEBPACK_IMPORTED_MODULE_7__.Droppable, _extends({}, droppableProps, {
|
43508
|
+
mode: "virtual",
|
43509
|
+
renderClone: renderClone(rows, renderRow)
|
43510
|
+
}), function (provided) {
|
43511
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
|
43512
|
+
style: {
|
43513
|
+
height: _height,
|
43514
|
+
maxHeight: maxHeight,
|
43515
|
+
width: '100%'
|
43516
|
+
}
|
43517
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(react_virtualized__WEBPACK_IMPORTED_MODULE_1__.AutoSizer, null, function (_ref2) {
|
43518
|
+
var width = _ref2.width,
|
43519
|
+
height = _ref2.height;
|
43520
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(StyledList, {
|
43521
|
+
width: width,
|
43522
|
+
height: height,
|
43523
|
+
overscanRowCount: 7,
|
43524
|
+
estimatedRowSize: 30,
|
43525
|
+
rowHeight: measurerCache.current.rowHeight,
|
43526
|
+
rowCount: rows.length,
|
43527
|
+
deferredMeasurementCache: measurerCache.current,
|
43528
|
+
ref: listRefHandler(provided, setListRef),
|
43529
|
+
rowRenderer: rowRenderer(rows, measurerCache, renderRow, rowHoverEvents)
|
43530
|
+
});
|
43531
|
+
})), renderHoverActions());
|
43532
|
+
});
|
43533
|
+
};
|
43534
|
+
var VirtualizedBody = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().memo(VirtualizedBodyComp);
|
43535
|
+
VirtualizedBody.displayName = 'VirtualizedBody';
|
43536
|
+
var StyledList = styled_components__WEBPACK_IMPORTED_MODULE_2___default()(react_virtualized__WEBPACK_IMPORTED_MODULE_1__.List).withConfig({
|
43537
|
+
displayName: "StyledList",
|
43538
|
+
componentId: "sc-1mdy9tq-0"
|
43539
|
+
})(["", ""], _theme__WEBPACK_IMPORTED_MODULE_3__["default"].scrollbars.thin);
|
43540
|
+
|
43541
|
+
/***/ }),
|
43542
|
+
|
43219
43543
|
/***/ "./src/tag/base.js":
|
43220
43544
|
/*!*************************!*\
|
43221
43545
|
!*** ./src/tag/base.js ***!
|