@luminati-io/uikit 3.6.4 → 3.6.5-beta.0
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", "draggableRows", "onRowDragStart", "onRowDragEnd"];
|
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", "hoverActions", "hoverActionsDirection"];
|
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; }
|
@@ -38330,6 +38330,8 @@ var Provider = function Provider(props) {
|
|
38330
38330
|
draggableRows = props.draggableRows,
|
38331
38331
|
onRowDragStart = props.onRowDragStart,
|
38332
38332
|
onRowDragEnd = props.onRowDragEnd,
|
38333
|
+
hoverActions = props.hoverActions,
|
38334
|
+
hoverActionsDirection = props.hoverActionsDirection,
|
38333
38335
|
rest = _objectWithoutProperties(props, _excluded);
|
38334
38336
|
var _useState = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(0),
|
38335
38337
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -38405,7 +38407,9 @@ var Provider = function Provider(props) {
|
|
38405
38407
|
isDraggingRow: isDraggingRow,
|
38406
38408
|
setIsDraggingRow: setIsDraggingRow,
|
38407
38409
|
onRowDragStart: onRowDragStart,
|
38408
|
-
onRowDragEnd: onRowDragEnd
|
38410
|
+
onRowDragEnd: onRowDragEnd,
|
38411
|
+
hoverActions: hoverActions,
|
38412
|
+
hoverActionsDirection: hoverActionsDirection
|
38409
38413
|
});
|
38410
38414
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(TableContext.Provider, {
|
38411
38415
|
value: value
|
@@ -38434,7 +38438,8 @@ Provider.defaultProps = {
|
|
38434
38438
|
var column = _ref.column;
|
38435
38439
|
return column.canEdit;
|
38436
38440
|
},
|
38437
|
-
draggableRows: false
|
38441
|
+
draggableRows: false,
|
38442
|
+
hoverActionsDirection: 'row'
|
38438
38443
|
};
|
38439
38444
|
Provider.propTypes = {
|
38440
38445
|
columns: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
|
@@ -38496,7 +38501,9 @@ Provider.propTypes = {
|
|
38496
38501
|
expandColumnId: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
|
38497
38502
|
draggableRows: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
|
38498
38503
|
onRowDragStart: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38499
|
-
onRowDragEnd: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
|
38504
|
+
onRowDragEnd: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
|
38505
|
+
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)]),
|
38506
|
+
hoverActionsDirection: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['row', 'column'])
|
38500
38507
|
};
|
38501
38508
|
var calcPageCount = function calcPageCount(totalCount, pageSize) {
|
38502
38509
|
return Math.ceil(totalCount / pageSize);
|
@@ -40465,13 +40472,24 @@ var RowHoverActions = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forward
|
|
40465
40472
|
wrapperProps = _objectWithoutProperties(props, _excluded);
|
40466
40473
|
var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_4__.useTableContext)(),
|
40467
40474
|
getRowProps = _useTableContext.getRowProps,
|
40468
|
-
draggableRows = _useTableContext.draggableRows
|
40475
|
+
draggableRows = _useTableContext.draggableRows,
|
40476
|
+
contextHoverActions = _useTableContext.hoverActions,
|
40477
|
+
hoverActionsDirection = _useTableContext.hoverActionsDirection;
|
40469
40478
|
var _row$getRowProps = row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row)),
|
40470
40479
|
draggable = _row$getRowProps.draggable;
|
40480
|
+
var hoverActions = typeof contextHoverActions == 'function' ? contextHoverActions(row) : contextHoverActions;
|
40471
40481
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(HoverActionsList, _extends({
|
40472
|
-
$visible: visible,
|
40473
40482
|
ref: ref
|
40474
|
-
}, wrapperProps
|
40483
|
+
}, wrapperProps, {
|
40484
|
+
$direction: hoverActionsDirection,
|
40485
|
+
$visible: visible
|
40486
|
+
}), hoverActions === null || hoverActions === void 0 ? void 0 : hoverActions.map(function (p) {
|
40487
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", {
|
40488
|
+
key: p.icon
|
40489
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icon_button__WEBPACK_IMPORTED_MODULE_3__.IconButton, _extends({}, p, {
|
40490
|
+
variant: "icon"
|
40491
|
+
})));
|
40492
|
+
}), draggableRows && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icon_button__WEBPACK_IMPORTED_MODULE_3__.IconButton, _extends({
|
40475
40493
|
disabled: !(draggable !== null && draggable !== void 0 ? draggable : true),
|
40476
40494
|
variant: "icon",
|
40477
40495
|
icon: "DragAndDrop"
|
@@ -40481,7 +40499,9 @@ RowHoverActions.displayName = 'RowHoverActions';
|
|
40481
40499
|
var HoverActionsList = styled_components__WEBPACK_IMPORTED_MODULE_1___default().ul.withConfig({
|
40482
40500
|
displayName: "HoverActionsList",
|
40483
40501
|
componentId: "sc-1xb8hvf-0"
|
40484
|
-
})(["list-style-type:none;margin:0;padding:0 ", ";visibility:", ";"],
|
40502
|
+
})(["display:flex;align-items:center;justify-content:center;flex-direction:", ";list-style-type:none;margin:0;padding:0 ", ";visibility:", ";"], function (props) {
|
40503
|
+
return props.$direction;
|
40504
|
+
}, _theme__WEBPACK_IMPORTED_MODULE_2__["default"].spacing['02'], function (props) {
|
40485
40505
|
return props.$visible ? 'visible' : 'hidden';
|
40486
40506
|
});
|
40487
40507
|
var useRowHoverActions = function useRowHoverActions(row) {
|