@luminati-io/uikit 6.3.128 → 6.3.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +24 -24
- package/dist/index.js.map +1 -1
- package/dist/umd/uikit.development.js +104 -15
- package/dist/umd/uikit.development.js.map +1 -1
- package/dist/umd/uikit.production.min.js +24 -24
- package/package.json +1 -1
|
@@ -57187,6 +57187,10 @@ var Provider = function Provider(_ref3) {
|
|
|
57187
57187
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
57188
57188
|
isDraggingRow = _useState4[0],
|
|
57189
57189
|
setIsDraggingRow = _useState4[1];
|
|
57190
|
+
var _useState5 = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null),
|
|
57191
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
57192
|
+
contextMenu = _useState6[0],
|
|
57193
|
+
setContextMenu = _useState6[1];
|
|
57190
57194
|
var hiddenColumns = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('hiddenColumns'), _hiddenColumns);
|
|
57191
57195
|
var pinnedColumns = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('pinnedColumns'), _pinnedColumns);
|
|
57192
57196
|
var columnOrder = (0,_util__WEBPACK_IMPORTED_MODULE_7__.firstDefined)(stateManager === null || stateManager === void 0 ? void 0 : stateManager.get('columnOrder'), _columnOrder);
|
|
@@ -57279,7 +57283,9 @@ var Provider = function Provider(_ref3) {
|
|
|
57279
57283
|
hoverActionsDirection: hoverActionsDirection,
|
|
57280
57284
|
virtualized: virtualized,
|
|
57281
57285
|
skeletonLoader: skeletonLoader,
|
|
57282
|
-
skeletonRowCount: skeletonRowCount
|
|
57286
|
+
skeletonRowCount: skeletonRowCount,
|
|
57287
|
+
contextMenu: contextMenu,
|
|
57288
|
+
setContextMenu: setContextMenu
|
|
57283
57289
|
});
|
|
57284
57290
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(TableContext.Provider, {
|
|
57285
57291
|
value: value
|
|
@@ -59606,6 +59612,7 @@ var renderRow = function renderRow(opt) {
|
|
|
59606
59612
|
var className = opt.className,
|
|
59607
59613
|
row = opt.row,
|
|
59608
59614
|
onRowClick = opt.onRowClick,
|
|
59615
|
+
onContextMenu = opt.onContextMenu,
|
|
59609
59616
|
getRowProps = opt.getRowProps,
|
|
59610
59617
|
rowDensity = opt.rowDensity,
|
|
59611
59618
|
isLast = opt.isLast,
|
|
@@ -59618,9 +59625,16 @@ var renderRow = function renderRow(opt) {
|
|
|
59618
59625
|
var onClick = onRowClick ? function (evt) {
|
|
59619
59626
|
if (!evt.target.matches(".".concat(preventOnClickClass, " *"))) onRowClick(original, evt);
|
|
59620
59627
|
} : undefined;
|
|
59628
|
+
var onContextMenuHandler = onContextMenu ? function (evt) {
|
|
59629
|
+
if (!evt.target.matches(".".concat(preventOnClickClass, " *"))) {
|
|
59630
|
+
evt.preventDefault();
|
|
59631
|
+
onContextMenu(row, evt);
|
|
59632
|
+
}
|
|
59633
|
+
} : undefined;
|
|
59621
59634
|
var cursor = onRowClick ? 'pointer' : undefined;
|
|
59622
59635
|
var tableRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(TableRow, _extends({}, rowProps, {
|
|
59623
59636
|
onClick: onClick,
|
|
59637
|
+
onContextMenu: onContextMenuHandler,
|
|
59624
59638
|
className: (0,_util__WEBPACK_IMPORTED_MODULE_2__.cn)(className, {
|
|
59625
59639
|
tableRow: true,
|
|
59626
59640
|
'tableRow--is-pinned': isPinned,
|
|
@@ -59882,16 +59896,20 @@ var useRowHoverActions = function useRowHoverActions() {
|
|
|
59882
59896
|
"use strict";
|
|
59883
59897
|
__webpack_require__.r(__webpack_exports__);
|
|
59884
59898
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
59899
|
+
/* harmony export */ RowContextMenu: () => (/* binding */ RowContextMenu),
|
|
59885
59900
|
/* harmony export */ addRowMenuInternalAction: () => (/* binding */ addRowMenuInternalAction),
|
|
59886
59901
|
/* harmony export */ useRowMenu: () => (/* binding */ useRowMenu)
|
|
59887
59902
|
/* harmony export */ });
|
|
59888
59903
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
|
59889
59904
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
|
59890
|
-
/* harmony import */ var
|
|
59891
|
-
/* harmony import */ var
|
|
59892
|
-
/* harmony import */ var
|
|
59893
|
-
/* harmony import */ var
|
|
59894
|
-
/* harmony import */ var
|
|
59905
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
|
|
59906
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
|
|
59907
|
+
/* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../popover */ "./src/popover/index.js");
|
|
59908
|
+
/* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon_button */ "./src/icon_button.js");
|
|
59909
|
+
/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../menu */ "./src/menu/index.js");
|
|
59910
|
+
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants */ "./src/constants.js");
|
|
59911
|
+
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
|
|
59912
|
+
/* harmony import */ var _render_row__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./render_row */ "./src/table/render_row.js");
|
|
59895
59913
|
// LICENSE_CODE ZON
|
|
59896
59914
|
|
|
59897
59915
|
|
|
@@ -59921,10 +59939,12 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
59921
59939
|
|
|
59922
59940
|
|
|
59923
59941
|
|
|
59942
|
+
|
|
59943
|
+
|
|
59924
59944
|
var RowMenuCell = function RowMenuCell(_ref) {
|
|
59925
59945
|
var row = _ref.row,
|
|
59926
59946
|
column = _ref.column;
|
|
59927
|
-
var _useTableContext = (0,
|
|
59947
|
+
var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)(),
|
|
59928
59948
|
rowActions = _useTableContext.rowActions;
|
|
59929
59949
|
var allActions = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
|
|
59930
59950
|
return [].concat(_toConsumableArray(rowActions || []), _toConsumableArray(Object.values(column.internalActions))).map(function (item) {
|
|
@@ -59946,7 +59966,7 @@ var RowMenuCellPopover = function RowMenuCellPopover(_ref2) {
|
|
|
59946
59966
|
_useState2 = _slicedToArray(_useState, 2),
|
|
59947
59967
|
visible = _useState2[0],
|
|
59948
59968
|
setVisible = _useState2[1];
|
|
59949
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
59969
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_popover__WEBPACK_IMPORTED_MODULE_2__.Popover, {
|
|
59950
59970
|
placement: "left",
|
|
59951
59971
|
visible: visible,
|
|
59952
59972
|
onVisibleChange: setVisible,
|
|
@@ -59958,11 +59978,11 @@ var RowMenuCellPopover = function RowMenuCellPopover(_ref2) {
|
|
|
59958
59978
|
return setVisible(false);
|
|
59959
59979
|
}
|
|
59960
59980
|
})
|
|
59961
|
-
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
59981
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icon_button__WEBPACK_IMPORTED_MODULE_3__.IconButton, {
|
|
59962
59982
|
"data-testid": "row-actions-toggle",
|
|
59963
59983
|
icon: "DotsHorizontal",
|
|
59964
59984
|
size: "xs",
|
|
59965
|
-
className:
|
|
59985
|
+
className: _render_row__WEBPACK_IMPORTED_MODULE_7__.preventOnClickClass
|
|
59966
59986
|
}));
|
|
59967
59987
|
};
|
|
59968
59988
|
var PopoverMenu = function PopoverMenu(_ref3) {
|
|
@@ -59983,8 +60003,8 @@ var PopoverMenu = function PopoverMenu(_ref3) {
|
|
|
59983
60003
|
});
|
|
59984
60004
|
});
|
|
59985
60005
|
}, [allActions]);
|
|
59986
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(
|
|
59987
|
-
className:
|
|
60006
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_menu__WEBPACK_IMPORTED_MODULE_4__.Menu, {
|
|
60007
|
+
className: _render_row__WEBPACK_IMPORTED_MODULE_7__.preventOnClickClass,
|
|
59988
60008
|
items: items,
|
|
59989
60009
|
size: "sm",
|
|
59990
60010
|
unstyled: true
|
|
@@ -60035,6 +60055,63 @@ useRowMenu.pluginName = 'useRowMenu';
|
|
|
60035
60055
|
var addRowMenuInternalAction = function addRowMenuInternalAction(id, action) {
|
|
60036
60056
|
if (!rowMenuColumn.internalActions[id]) rowMenuColumn.internalActions[id] = action;
|
|
60037
60057
|
};
|
|
60058
|
+
var theme = function theme(cb) {
|
|
60059
|
+
return function (p) {
|
|
60060
|
+
return cb(p.theme);
|
|
60061
|
+
};
|
|
60062
|
+
};
|
|
60063
|
+
var ContextMenuOverlay = styled_components__WEBPACK_IMPORTED_MODULE_1___default().div.withConfig({
|
|
60064
|
+
displayName: "ContextMenuOverlay",
|
|
60065
|
+
componentId: "sc-q7kjip-0"
|
|
60066
|
+
})(["position:fixed;z-index:", ";border-radius:4px;border:1px solid ", ";background:", ";box-shadow:", ";"], _constants__WEBPACK_IMPORTED_MODULE_5__.Z_INDEX.popover, theme(function (t) {
|
|
60067
|
+
return t.color.popover_border;
|
|
60068
|
+
}), theme(function (t) {
|
|
60069
|
+
return t.color.bg;
|
|
60070
|
+
}), theme(function (t) {
|
|
60071
|
+
return t.color.popover_shadow;
|
|
60072
|
+
}));
|
|
60073
|
+
var RowContextMenu = function RowContextMenu() {
|
|
60074
|
+
var _useTableContext2 = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)(),
|
|
60075
|
+
contextMenu = _useTableContext2.contextMenu,
|
|
60076
|
+
setContextMenu = _useTableContext2.setContextMenu,
|
|
60077
|
+
rowActions = _useTableContext2.rowActions;
|
|
60078
|
+
var menuRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
|
|
60079
|
+
var hideMenu = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function () {
|
|
60080
|
+
return setContextMenu(null);
|
|
60081
|
+
}, [setContextMenu]);
|
|
60082
|
+
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
60083
|
+
if (!contextMenu) return;
|
|
60084
|
+
var handle = function handle(evt) {
|
|
60085
|
+
if (menuRef.current && !menuRef.current.contains(evt.target)) hideMenu();
|
|
60086
|
+
};
|
|
60087
|
+
document.addEventListener('mousedown', handle, true);
|
|
60088
|
+
return function () {
|
|
60089
|
+
return document.removeEventListener('mousedown', handle, true);
|
|
60090
|
+
};
|
|
60091
|
+
}, [contextMenu, hideMenu]);
|
|
60092
|
+
if (!contextMenu) return null;
|
|
60093
|
+
var x = contextMenu.x,
|
|
60094
|
+
y = contextMenu.y,
|
|
60095
|
+
row = contextMenu.row;
|
|
60096
|
+
var allActions = [].concat(_toConsumableArray(rowActions || []), _toConsumableArray(Object.values(rowMenuColumn.internalActions))).map(function (item) {
|
|
60097
|
+
return typeof item == 'function' ? item(row) : item;
|
|
60098
|
+
}).filter(function (item) {
|
|
60099
|
+
return item && item.key;
|
|
60100
|
+
});
|
|
60101
|
+
if (!allActions.length) return null;
|
|
60102
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ContextMenuOverlay, {
|
|
60103
|
+
ref: menuRef,
|
|
60104
|
+
style: {
|
|
60105
|
+
top: y,
|
|
60106
|
+
left: x
|
|
60107
|
+
},
|
|
60108
|
+
className: _render_row__WEBPACK_IMPORTED_MODULE_7__.preventOnClickClass
|
|
60109
|
+
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PopoverMenu, {
|
|
60110
|
+
allActions: allActions,
|
|
60111
|
+
row: row,
|
|
60112
|
+
hidePopover: hideMenu
|
|
60113
|
+
}));
|
|
60114
|
+
};
|
|
60038
60115
|
|
|
60039
60116
|
/***/ }),
|
|
60040
60117
|
|
|
@@ -60588,6 +60665,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
60588
60665
|
/* harmony import */ var _dnd__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dnd */ "./src/table/dnd.js");
|
|
60589
60666
|
/* harmony import */ var _row_hover_actions__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./row_hover_actions */ "./src/table/row_hover_actions.js");
|
|
60590
60667
|
/* harmony import */ var _skeleton_loader__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./skeleton_loader */ "./src/table/skeleton_loader.js");
|
|
60668
|
+
/* harmony import */ var _row_menu__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./row_menu */ "./src/table/row_menu.js");
|
|
60591
60669
|
// LICENSE_CODE ZON
|
|
60592
60670
|
|
|
60593
60671
|
|
|
@@ -60624,6 +60702,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
60624
60702
|
|
|
60625
60703
|
|
|
60626
60704
|
|
|
60705
|
+
|
|
60627
60706
|
var Table = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().forwardRef(function _Table(props, ref) {
|
|
60628
60707
|
var context = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)();
|
|
60629
60708
|
// not under context
|
|
@@ -60715,7 +60794,7 @@ var InnerTable = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().forwa
|
|
|
60715
60794
|
tableRef: tableRef,
|
|
60716
60795
|
scrollTarget: scrollTarget,
|
|
60717
60796
|
wrapperRef: wrapperRef
|
|
60718
|
-
})));
|
|
60797
|
+
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_row_menu__WEBPACK_IMPORTED_MODULE_15__.RowContextMenu, null));
|
|
60719
60798
|
});
|
|
60720
60799
|
InnerTable.displayName = 'InnerTable';
|
|
60721
60800
|
var TableWrapper = styled_components__WEBPACK_IMPORTED_MODULE_3___default().div.withConfig({
|
|
@@ -60749,12 +60828,21 @@ var TableBody = function TableBody(_ref4) {
|
|
|
60749
60828
|
pinnedRows = _useTableContext2$pin === void 0 ? [] : _useTableContext2$pin,
|
|
60750
60829
|
getRowProps = _useTableContext2.getRowProps,
|
|
60751
60830
|
renderRowSubComponent = _useTableContext2.renderRowSubComponent,
|
|
60752
|
-
draggableRows = _useTableContext2.draggableRows
|
|
60831
|
+
draggableRows = _useTableContext2.draggableRows,
|
|
60832
|
+
rowActions = _useTableContext2.rowActions,
|
|
60833
|
+
setContextMenu = _useTableContext2.setContextMenu;
|
|
60753
60834
|
var rows = (0,react__WEBPACK_IMPORTED_MODULE_2__.useMemo)(function () {
|
|
60754
60835
|
return [].concat(_toConsumableArray(pinnedRows), _toConsumableArray(page.filter(function (row) {
|
|
60755
60836
|
return !row.isPinned;
|
|
60756
60837
|
})));
|
|
60757
60838
|
}, [pinnedRows, page]);
|
|
60839
|
+
var onContextMenu = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (row, evt) {
|
|
60840
|
+
return setContextMenu({
|
|
60841
|
+
x: evt.clientX,
|
|
60842
|
+
y: evt.clientY,
|
|
60843
|
+
row: row
|
|
60844
|
+
});
|
|
60845
|
+
}, [setContextMenu]);
|
|
60758
60846
|
var renderRowCb = (0,react__WEBPACK_IMPORTED_MODULE_2__.useCallback)(function (_ref5) {
|
|
60759
60847
|
var row = _ref5.row,
|
|
60760
60848
|
index = _ref5.index,
|
|
@@ -60764,6 +60852,7 @@ var TableBody = function TableBody(_ref4) {
|
|
|
60764
60852
|
row: row,
|
|
60765
60853
|
rowDensity: rowDensity,
|
|
60766
60854
|
onRowClick: onRowClick,
|
|
60855
|
+
onContextMenu: rowActions !== null && rowActions !== void 0 && rowActions.length ? onContextMenu : undefined,
|
|
60767
60856
|
isLast: !row.isPinned && index == rows.length - 1,
|
|
60768
60857
|
showExpand: !row.isPinned && row.canExpand,
|
|
60769
60858
|
className: className,
|
|
@@ -60771,7 +60860,7 @@ var TableBody = function TableBody(_ref4) {
|
|
|
60771
60860
|
renderRowSubComponent: renderRowSubComponent,
|
|
60772
60861
|
wrapperProps: wrapperProps
|
|
60773
60862
|
});
|
|
60774
|
-
}, [prepareRow, rowDensity, onRowClick, className, getRowProps, renderRowSubComponent]);
|
|
60863
|
+
}, [prepareRow, rowDensity, onRowClick, onContextMenu, rowActions, className, getRowProps, renderRowSubComponent]);
|
|
60775
60864
|
var cache = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(new react_virtualized__WEBPACK_IMPORTED_MODULE_4__.CellMeasurerCache({
|
|
60776
60865
|
fixedWidth: true,
|
|
60777
60866
|
defaultHeight: 30
|