@luminati-io/uikit 3.4.11 → 3.4.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -37859,13 +37859,14 @@ __webpack_require__.r(__webpack_exports__);
37859
37859
  /* harmony import */ var _pinned_columns__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pinned_columns */ "./src/table/pinned_columns.js");
37860
37860
  /* harmony import */ var _expandable_rows__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./expandable_rows */ "./src/table/expandable_rows.js");
37861
37861
  /* harmony import */ var _select_rows__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./select_rows */ "./src/table/select_rows.js");
37862
- /* harmony import */ var _order_logic__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./order_logic */ "./src/table/order_logic.js");
37862
+ /* harmony import */ var _row_menu__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./row_menu */ "./src/table/row_menu.js");
37863
+ /* harmony import */ var _order_logic__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./order_logic */ "./src/table/order_logic.js");
37863
37864
  // LICENSE_CODE ZON
37864
37865
 
37865
37866
 
37866
37867
  /*jslint react:true*/
37867
37868
  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); }
37868
- var _excluded = ["data", "columnsSort", "pageSize", "pageSizes", "children", "stateManager", "hooks", "NoDataComp", "LoadingComp", "ExpandHandleComp", "noDataText", "loadingText", "isLoading", "onPageChange", "manualPagination", "totalCount", "paginateExpandedRows", "getHeaderProps", "getColumnProps", "getRowProps", "getCellProps", "getFooterProps", "selectedRowIds", "canOrderColumns"];
37869
+ var _excluded = ["data", "columnsSort", "pageSize", "pageSizes", "children", "stateManager", "hooks", "NoDataComp", "LoadingComp", "ExpandHandleComp", "noDataText", "loadingText", "isLoading", "onPageChange", "manualPagination", "totalCount", "paginateExpandedRows", "getHeaderProps", "getColumnProps", "getRowProps", "getCellProps", "getFooterProps", "selectedRowIds", "canOrderColumns", "rowActions"];
37869
37870
  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; }
37870
37871
  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; }
37871
37872
  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; }
@@ -37895,6 +37896,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
37895
37896
 
37896
37897
 
37897
37898
 
37899
+
37898
37900
  var assign = Object.assign;
37899
37901
  var defaultPropGetter = function defaultPropGetter() {
37900
37902
  return {};
@@ -37955,6 +37957,7 @@ var Provider = function Provider(props) {
37955
37957
  selectedRowIds = props.selectedRowIds,
37956
37958
  _props$canOrderColumn = props.canOrderColumns,
37957
37959
  canOrderColumns = _props$canOrderColumn === void 0 ? false : _props$canOrderColumn,
37960
+ rowActions = props.rowActions,
37958
37961
  rest = _objectWithoutProperties(props, _excluded);
37959
37962
  var _useState = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0),
37960
37963
  _useState2 = _slicedToArray(_useState, 2),
@@ -37990,7 +37993,7 @@ var Provider = function Provider(props) {
37990
37993
  getCellProps: getCellProps,
37991
37994
  getFooterProps: getFooterProps,
37992
37995
  ExpandHandleComp: ExpandHandleComp
37993
- }, rest), useCanHideColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useExpanded, _expandable_rows__WEBPACK_IMPORTED_MODULE_9__.useExpandHandle, react_table__WEBPACK_IMPORTED_MODULE_2__.usePagination, props.fullWidth ? react_table__WEBPACK_IMPORTED_MODULE_2__.useFlexLayout : react_table__WEBPACK_IMPORTED_MODULE_2__.useBlockLayout, react_table__WEBPACK_IMPORTED_MODULE_2__.useResizeColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useColumnOrder, _pinned_columns__WEBPACK_IMPORTED_MODULE_8__.usePinnedColumns, _editable_columns__WEBPACK_IMPORTED_MODULE_7__.useEditableColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useRowSelect, _select_rows__WEBPACK_IMPORTED_MODULE_10__.useSelectRows].concat(_toConsumableArray(hooks)));
37996
+ }, rest), useCanHideColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useExpanded, _expandable_rows__WEBPACK_IMPORTED_MODULE_9__.useExpandHandle, react_table__WEBPACK_IMPORTED_MODULE_2__.usePagination, props.fullWidth ? react_table__WEBPACK_IMPORTED_MODULE_2__.useFlexLayout : react_table__WEBPACK_IMPORTED_MODULE_2__.useBlockLayout, react_table__WEBPACK_IMPORTED_MODULE_2__.useResizeColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useColumnOrder, _pinned_columns__WEBPACK_IMPORTED_MODULE_8__.usePinnedColumns, _editable_columns__WEBPACK_IMPORTED_MODULE_7__.useEditableColumns, react_table__WEBPACK_IMPORTED_MODULE_2__.useRowSelect, _select_rows__WEBPACK_IMPORTED_MODULE_10__.useSelectRows].concat(_toConsumableArray(rowActions !== null && rowActions !== void 0 && rowActions.length ? [_row_menu__WEBPACK_IMPORTED_MODULE_11__.useRowMenu] : []), _toConsumableArray(hooks)));
37994
37997
  var _table$state = table.state,
37995
37998
  pageIndex = _table$state.pageIndex,
37996
37999
  _pageSize = _table$state.pageSize;
@@ -38007,14 +38010,15 @@ var Provider = function Provider(props) {
38007
38010
  }, [manualPagination, totalCount, pageIndex, _pageSize]);
38008
38011
  var _LoadingComp = useComp(loadingText, LoadingComp);
38009
38012
  var _NoDataComp = useComp(noDataText, NoDataComp);
38010
- var orderLogic = (0,_order_logic__WEBPACK_IMPORTED_MODULE_11__.useOrderLogic)(table);
38013
+ var orderLogic = (0,_order_logic__WEBPACK_IMPORTED_MODULE_12__.useOrderLogic)(table);
38011
38014
  var value = _objectSpread(_objectSpread({
38012
38015
  columnsSort: columnsSort
38013
38016
  }, table), {}, {
38014
38017
  canOrderColumns: canOrderColumns,
38015
38018
  orderLogic: orderLogic,
38016
38019
  LoadingComp: _LoadingComp,
38017
- NoDataComp: _NoDataComp
38020
+ NoDataComp: _NoDataComp,
38021
+ rowActions: rowActions
38018
38022
  });
38019
38023
  return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(TableContext.Provider, {
38020
38024
  value: value
@@ -38091,7 +38095,8 @@ Provider.propTypes = {
38091
38095
  scrollTarget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().any),
38092
38096
  className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
38093
38097
  onSelectRows: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
38094
- canOrderColumns: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
38098
+ canOrderColumns: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
38099
+ rowActions: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)
38095
38100
  };
38096
38101
  var calcPageCount = function calcPageCount(totalCount, pageSize) {
38097
38102
  return Math.ceil(totalCount / pageSize);
@@ -38923,6 +38928,7 @@ __webpack_require__.r(__webpack_exports__);
38923
38928
  /* harmony import */ var _typography__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../typography */ "./src/typography/index.js");
38924
38929
  /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants */ "./src/constants.js");
38925
38930
  /* harmony import */ var _sort_icon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./sort_icon */ "./src/table/sort_icon.js");
38931
+ /* harmony import */ var _order_logic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./order_logic */ "./src/table/order_logic.js");
38926
38932
  // LICENSE_CODE ZON
38927
38933
 
38928
38934
 
@@ -38937,11 +38943,13 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
38937
38943
 
38938
38944
 
38939
38945
 
38946
+
38940
38947
  var HeaderFunctions = function HeaderFunctions(props) {
38941
38948
  var header = props.header,
38942
38949
  visible = props.visible,
38943
38950
  onItemClick = props.onItemClick,
38944
38951
  orderLogic = props.orderLogic;
38952
+ if ((0,_order_logic__WEBPACK_IMPORTED_MODULE_9__.isSysColumn)(header.id)) return null;
38945
38953
  var id = header.id,
38946
38954
  on_sort = header.on_sort,
38947
38955
  canHide = header.canHide,
@@ -39194,6 +39202,7 @@ _table__WEBPACK_IMPORTED_MODULE_3__["default"].plugins = _plugin__WEBPACK_IMPORT
39194
39202
  "use strict";
39195
39203
  __webpack_require__.r(__webpack_exports__);
39196
39204
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39205
+ /* harmony export */ isSysColumn: () => (/* binding */ isSysColumn),
39197
39206
  /* harmony export */ useOrderLogic: () => (/* binding */ useOrderLogic)
39198
39207
  /* harmony export */ });
39199
39208
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
@@ -39219,6 +39228,10 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
39219
39228
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
39220
39229
  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; }
39221
39230
 
39231
+ var sysColumns = ['selection', 'row_menu'];
39232
+ var isSysColumn = function isSysColumn(id) {
39233
+ return sysColumns.includes(id);
39234
+ };
39222
39235
  var useOrderLogic = function useOrderLogic(table) {
39223
39236
  var _table$state = table.state,
39224
39237
  columnOrder = _table$state.columnOrder,
@@ -39227,7 +39240,12 @@ var useOrderLogic = function useOrderLogic(table) {
39227
39240
  setColumnOrder = table.setColumnOrder,
39228
39241
  setHiddenColumns = table.setHiddenColumns,
39229
39242
  togglePinColumn = table.togglePinColumn,
39230
- allColumns = table.allColumns;
39243
+ _allColumns = table.allColumns;
39244
+ var allColumns = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
39245
+ return _allColumns.filter(function (col) {
39246
+ return !isSysColumn(col.id);
39247
+ });
39248
+ }, [_allColumns]);
39231
39249
  var getColumnCategory = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id) {
39232
39250
  if (hiddenColumns.includes(id)) return 'hidden';
39233
39251
  if (pinnedColumns.includes(id)) return 'pinned';
@@ -39277,6 +39295,7 @@ var useOrderLogic = function useOrderLogic(table) {
39277
39295
  return setColumnOrder([].concat(_toConsumableArray(pinned), _toConsumableArray(visible), _toConsumableArray(hidden)));
39278
39296
  }, [setColumnOrder]);
39279
39297
  var moveBackwards = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id) {
39298
+ if (isSysColumn(id)) return;
39280
39299
  var category = getColumnCategory(id);
39281
39300
  var arr = orders[category];
39282
39301
  var n = arr.indexOf(id);
@@ -39288,6 +39307,7 @@ var useOrderLogic = function useOrderLogic(table) {
39288
39307
  setOrders(newOrder);
39289
39308
  }, [getColumnCategory, orders, setOrders]);
39290
39309
  var moveForward = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id) {
39310
+ if (isSysColumn(id)) return;
39291
39311
  var category = getColumnCategory(id);
39292
39312
  var arr = orders[category];
39293
39313
  var n = arr.indexOf(id);
@@ -39299,6 +39319,7 @@ var useOrderLogic = function useOrderLogic(table) {
39299
39319
  setOrders(newOrder);
39300
39320
  }, [getColumnCategory, orders, setOrders]);
39301
39321
  var moveColumn = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(function (id, cat, n) {
39322
+ if (isSysColumn(id)) return;
39302
39323
  var srcCat = getColumnCategory(id);
39303
39324
  if (srcCat == cat && orders[srcCat][n] == id) return;
39304
39325
  var newOrders = _objectSpread({}, orders);
@@ -39827,6 +39848,7 @@ var plugins = {};
39827
39848
  "use strict";
39828
39849
  __webpack_require__.r(__webpack_exports__);
39829
39850
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39851
+ /* harmony export */ preventOnClickClass: () => (/* binding */ preventOnClickClass),
39830
39852
  /* harmony export */ renderRow: () => (/* binding */ renderRow)
39831
39853
  /* harmony export */ });
39832
39854
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
@@ -39843,6 +39865,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
39843
39865
 
39844
39866
 
39845
39867
 
39868
+ var preventOnClickClass = 'tableCell--preventOnClick';
39846
39869
  var renderRow = function renderRow(opt) {
39847
39870
  var className = opt.className,
39848
39871
  row = opt.row,
@@ -39853,7 +39876,7 @@ var renderRow = function renderRow(opt) {
39853
39876
  renderRowSubComponent = opt.renderRowSubComponent;
39854
39877
  var rowProps = row.getRowProps(getRowProps === null || getRowProps === void 0 ? void 0 : getRowProps(row));
39855
39878
  var onClick = onRowClick ? function (evt) {
39856
- return onRowClick(row.original, evt);
39879
+ if (!evt.target.matches(".".concat(preventOnClickClass, " *"))) onRowClick(row.original, evt);
39857
39880
  } : undefined;
39858
39881
  var cursor = onRowClick ? 'pointer' : undefined;
39859
39882
  var tableRow = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_table_row__WEBPACK_IMPORTED_MODULE_3__.TableRow, _extends({}, rowProps, {
@@ -39888,6 +39911,157 @@ var renderRow = function renderRow(opt) {
39888
39911
 
39889
39912
  /***/ }),
39890
39913
 
39914
+ /***/ "./src/table/row_menu.js":
39915
+ /*!*******************************!*\
39916
+ !*** ./src/table/row_menu.js ***!
39917
+ \*******************************/
39918
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
39919
+
39920
+ "use strict";
39921
+ __webpack_require__.r(__webpack_exports__);
39922
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39923
+ /* harmony export */ addRowMenuInternalAction: () => (/* binding */ addRowMenuInternalAction),
39924
+ /* harmony export */ useRowMenu: () => (/* binding */ useRowMenu)
39925
+ /* harmony export */ });
39926
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
39927
+ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
39928
+ /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! styled-components */ "styled-components");
39929
+ /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_1__);
39930
+ /* harmony import */ var _hoc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hoc */ "./src/hoc/index.js");
39931
+ /* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../icon_button */ "./src/icon_button.js");
39932
+ /* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../menu */ "./src/menu/index.js");
39933
+ /* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
39934
+ /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./context */ "./src/table/context.js");
39935
+ /* harmony import */ var _render_row__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./render_row */ "./src/table/render_row.js");
39936
+ // LICENSE_CODE ZON
39937
+
39938
+
39939
+ /*jslint react:true*/
39940
+ 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); }
39941
+ 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; }
39942
+ 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; }
39943
+ 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; }
39944
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
39945
+ 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); }
39946
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
39947
+ 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."); }
39948
+ 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); }
39949
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
39950
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
39951
+ 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; }
39952
+
39953
+
39954
+
39955
+
39956
+
39957
+
39958
+
39959
+
39960
+ var RowMenuCell = function RowMenuCell(_ref) {
39961
+ var row = _ref.row,
39962
+ column = _ref.column;
39963
+ var _useTableContext = (0,_context__WEBPACK_IMPORTED_MODULE_6__.useTableContext)(),
39964
+ rowActions = _useTableContext.rowActions;
39965
+ var allActions = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
39966
+ return [].concat(_toConsumableArray(rowActions || []), _toConsumableArray(Object.values(column.internalActions))).map(function (item) {
39967
+ return typeof item == 'function' ? item(row) : item;
39968
+ }).filter(function (item) {
39969
+ return item && !item.hidden && item.key;
39970
+ });
39971
+ }, [rowActions, column, row]);
39972
+ if (!allActions.length) return null;
39973
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowMenuCellPopover, {
39974
+ popoverProps: {
39975
+ allActions: allActions,
39976
+ row: row
39977
+ }
39978
+ });
39979
+ };
39980
+ RowMenuCell.displayName = 'RowMenuCell';
39981
+ var RowMenuCellPopover = (0,_hoc__WEBPACK_IMPORTED_MODULE_2__.withPopover)(function (p) {
39982
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icon_button__WEBPACK_IMPORTED_MODULE_3__.IconButton, {
39983
+ onClick: p.popover.toggle,
39984
+ icon: "DotsHorizontal",
39985
+ variant: "ghost",
39986
+ className: _render_row__WEBPACK_IMPORTED_MODULE_7__.preventOnClickClass
39987
+ });
39988
+ }, function (p) {
39989
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(PopoverMenu, {
39990
+ allActions: p.allActions,
39991
+ row: p.row,
39992
+ togglePopover: p.popover.toggle
39993
+ });
39994
+ }, {
39995
+ placement: 'left'
39996
+ });
39997
+ var PopoverMenu = function PopoverMenu(props) {
39998
+ var allActions = props.allActions,
39999
+ row = props.row,
40000
+ togglePopover = props.togglePopover;
40001
+ var items = (0,react__WEBPACK_IMPORTED_MODULE_0__.useMemo)(function () {
40002
+ return allActions.map(function (item) {
40003
+ var func = item.onClick;
40004
+ var newFunc = function newFunc() {
40005
+ if (!item.keepPopover) togglePopover();
40006
+ func(row);
40007
+ };
40008
+ return _objectSpread(_objectSpread({}, item), {}, {
40009
+ onClick: newFunc
40010
+ });
40011
+ });
40012
+ }, [allActions]);
40013
+ return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_menu__WEBPACK_IMPORTED_MODULE_4__["default"], {
40014
+ items: items,
40015
+ size: "sm"
40016
+ });
40017
+ };
40018
+ var RowMenuButton = styled_components__WEBPACK_IMPORTED_MODULE_1___default().button.withConfig({
40019
+ displayName: "RowMenuButton",
40020
+ componentId: "sc-q7kjip-0"
40021
+ })(["box-sizing:border-box;min-width:180px;display:flex;align-items:center;padding:7px 12px;gap:10px;border:0 none;background-color:unset;white-space:nowrap;"]);
40022
+ RowMenuButton.displayName = 'RowMenuButton';
40023
+ var rowMenuStyle = {
40024
+ backgroundColor: _theme__WEBPACK_IMPORTED_MODULE_5__["default"].color.white,
40025
+ display: 'flex',
40026
+ alignItems: 'center',
40027
+ position: 'sticky',
40028
+ right: 0,
40029
+ overflow: 'visible'
40030
+ };
40031
+ var getRowMenuCellProps = function getRowMenuCellProps(props, _ref2) {
40032
+ var cell = _ref2.cell;
40033
+ if (cell.column.id == 'row_menu') return [props, {
40034
+ style: rowMenuStyle
40035
+ }];
40036
+ return props;
40037
+ };
40038
+ var rowMenuColumn = {
40039
+ id: 'row_menu',
40040
+ name: ' ',
40041
+ Cell: RowMenuCell,
40042
+ disableHiding: true,
40043
+ disableResizing: true,
40044
+ disablePinning: true,
40045
+ canEdit: false,
40046
+ width: 48,
40047
+ minWidth: 48,
40048
+ maxWidth: 48,
40049
+ internalActions: {}
40050
+ };
40051
+ var useRowMenu = function useRowMenu(hooks) {
40052
+ hooks.visibleColumns.push(function (columns) {
40053
+ if (columns[columns.length - 1] == rowMenuColumn) return columns;
40054
+ return [].concat(_toConsumableArray(columns), [rowMenuColumn]);
40055
+ });
40056
+ hooks.getCellProps.push(getRowMenuCellProps);
40057
+ };
40058
+ useRowMenu.pluginName = 'useRowMenu';
40059
+ var addRowMenuInternalAction = function addRowMenuInternalAction(id, action) {
40060
+ if (!rowMenuColumn.internalActions[id]) rowMenuColumn.internalActions[id] = action;
40061
+ };
40062
+
40063
+ /***/ }),
40064
+
39891
40065
  /***/ "./src/table/select_rows.js":
39892
40066
  /*!**********************************!*\
39893
40067
  !*** ./src/table/select_rows.js ***!
@@ -40198,24 +40372,13 @@ __webpack_require__.r(__webpack_exports__);
40198
40372
  /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
40199
40373
  /* harmony import */ var react_table__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-table */ "react-table");
40200
40374
  /* harmony import */ var react_table__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_table__WEBPACK_IMPORTED_MODULE_1__);
40201
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! styled-components */ "styled-components");
40202
- /* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_2__);
40203
- /* harmony import */ var _hoc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../hoc */ "./src/hoc/index.js");
40204
- /* harmony import */ var _icon_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../icon_button */ "./src/icon_button.js");
40205
- /* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../menu */ "./src/menu/index.js");
40206
- /* harmony import */ var _theme__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../theme */ "./src/theme.js");
40207
- /* harmony import */ var _plugin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./plugin */ "./src/table/plugin.js");
40375
+ /* harmony import */ var _plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./plugin */ "./src/table/plugin.js");
40376
+ /* harmony import */ var _row_menu_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./row_menu.js */ "./src/table/row_menu.js");
40208
40377
  // LICENSE_CODE ZON
40209
40378
 
40210
40379
 
40211
40380
  /*jslint react:true*/
40212
40381
  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); }
40213
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
40214
- 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."); }
40215
- 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); }
40216
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
40217
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
40218
- 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; }
40219
40382
  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; }
40220
40383
  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; }
40221
40384
  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; }
@@ -40225,35 +40388,25 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
40225
40388
 
40226
40389
 
40227
40390
 
40228
-
40229
-
40230
-
40231
-
40232
40391
  var assign = Object.assign;
40233
40392
  react_table__WEBPACK_IMPORTED_MODULE_1__.actions.resetPinnedRows = 'resetPinnedRows';
40234
40393
  react_table__WEBPACK_IMPORTED_MODULE_1__.actions.toggleRowPinned = 'toggleRowPinned';
40235
40394
  var useStickyRows = function useStickyRows(hooks) {
40236
- hooks.getCellProps.push(getStickyCellProps);
40237
40395
  hooks.stateReducers.push(stickyRowsReducer);
40238
40396
  hooks.useInstance.push(useStickyRowInstance);
40239
40397
  hooks.prepareRow.push(prepareStickyRow);
40398
+ (0,_row_menu_js__WEBPACK_IMPORTED_MODULE_3__.addRowMenuInternalAction)('stick_row', function (row) {
40399
+ return {
40400
+ key: 'stick_row',
40401
+ text: "".concat(row.isPinned ? 'Unpin' : 'Pin', " row"),
40402
+ icon: row.isPinned ? 'Unpin' : 'Pin',
40403
+ onClick: function onClick() {
40404
+ return row.toggleRowPinned(!row.isPinned);
40405
+ }
40406
+ };
40407
+ });
40240
40408
  };
40241
40409
  useStickyRows.pluginName = 'useStickyRows';
40242
- var rowMenuStyle = {
40243
- backgroundColor: _theme__WEBPACK_IMPORTED_MODULE_6__["default"].color.white,
40244
- display: 'flex',
40245
- alignItems: 'center',
40246
- position: 'sticky',
40247
- right: 0,
40248
- overflow: 'visible'
40249
- };
40250
- var getStickyCellProps = function getStickyCellProps(props, _ref) {
40251
- var cell = _ref.cell;
40252
- if (cell.column.id == 'row_menu') return [props, {
40253
- style: rowMenuStyle
40254
- }];
40255
- return props;
40256
- };
40257
40410
  var stickyRowsReducer = function stickyRowsReducer(state, action, previousState, instance) {
40258
40411
  if (action.type == react_table__WEBPACK_IMPORTED_MODULE_1__.actions.init) return _objectSpread({
40259
40412
  pinnedRowIds: {}
@@ -40312,70 +40465,16 @@ var useStickyRowInstance = function useStickyRowInstance(instance) {
40312
40465
  toggleRowPinned: toggleRowPinned
40313
40466
  });
40314
40467
  };
40315
- var prepareStickyRow = function prepareStickyRow(row, _ref2) {
40316
- var instance = _ref2.instance;
40468
+ var prepareStickyRow = function prepareStickyRow(row, _ref) {
40469
+ var instance = _ref.instance;
40317
40470
  row.toggleRowPinned = function (set) {
40318
40471
  return instance.toggleRowPinned(row.id, set);
40319
40472
  };
40320
40473
  };
40321
- var RowMenuCell = function RowMenuCell(props) {
40322
- var _props$row = props.row,
40323
- isPinned = _props$row.isPinned,
40324
- toggleRowPinned = _props$row.toggleRowPinned;
40325
- var items = [{
40326
- key: 'stick_row',
40327
- text: "".concat(isPinned ? 'Unpin' : 'Pin', " row"),
40328
- icon: isPinned ? 'Unpin' : 'Pin',
40329
- onClick: function onClick() {
40330
- return toggleRowPinned(!isPinned);
40331
- }
40332
- }];
40333
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RowMenuCellPopover, {
40334
- popoverProps: {
40335
- items: items
40336
- }
40337
- });
40338
- };
40339
- RowMenuCell.displayName = 'RowMenuCell';
40340
- var RowMenuCellPopover = (0,_hoc__WEBPACK_IMPORTED_MODULE_3__.withPopover)(function (p) {
40341
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icon_button__WEBPACK_IMPORTED_MODULE_4__.IconButton, {
40342
- onClick: p.popover.toggle,
40343
- icon: "DotsHorizontal",
40344
- variant: "ghost"
40345
- });
40346
- }, function (p) {
40347
- return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_menu__WEBPACK_IMPORTED_MODULE_5__["default"], {
40348
- items: p.items,
40349
- size: "sm"
40350
- });
40351
- }, {
40352
- placement: 'left'
40353
- });
40354
- var RowMenuButton = styled_components__WEBPACK_IMPORTED_MODULE_2___default().button.withConfig({
40355
- displayName: "RowMenuButton",
40356
- componentId: "sc-u1g3r9-0"
40357
- })(["box-sizing:border-box;min-width:180px;display:flex;align-items:center;padding:7px 12px;gap:10px;border:0 none;background-color:unset;white-space:nowrap;"]);
40358
- RowMenuButton.displayName = 'RowMenuButton';
40359
- var rowMenuColumn = {
40360
- id: 'row_menu',
40361
- name: ' ',
40362
- Cell: RowMenuCell,
40363
- disableHiding: true,
40364
- disableResizing: true,
40365
- disablePinning: true,
40366
- canEdit: false,
40367
- width: 48,
40368
- minWidth: 48,
40369
- maxWidth: 48
40370
- };
40371
- _plugin__WEBPACK_IMPORTED_MODULE_7__.plugins.stickyRows = function () {
40474
+ _plugin__WEBPACK_IMPORTED_MODULE_2__.plugins.stickyRows = function () {
40372
40475
  return {
40373
40476
  hooks: function hooks() {
40374
- return [useStickyRows, function (hooks) {
40375
- hooks.visibleColumns.push(function (columns) {
40376
- return [].concat(_toConsumableArray(columns), [rowMenuColumn]);
40377
- });
40378
- }];
40477
+ return [_row_menu_js__WEBPACK_IMPORTED_MODULE_3__.useRowMenu, useStickyRows];
40379
40478
  }
40380
40479
  };
40381
40480
  };