oolib 2.141.3 → 2.141.4

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.
@@ -1,8 +1,9 @@
1
- export function RowActionsMenu({ value, rowIdx, onChange, id, setActionsActiveOnRow, rowActionsButtonWidth, conditionsToRender }: {
1
+ export function RowActionsMenu({ value, rowIdx, onChange, id, disableAddRow, setActionsActiveOnRow, rowActionsButtonWidth, conditionsToRender }: {
2
2
  value: any;
3
3
  rowIdx: any;
4
4
  onChange: any;
5
5
  id: any;
6
+ disableAddRow: any;
6
7
  setActionsActiveOnRow: any;
7
8
  rowActionsButtonWidth: any;
8
9
  conditionsToRender?: boolean;
@@ -26,6 +26,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  __setModuleDefault(result, mod);
27
27
  return result;
28
28
  };
29
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
30
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
31
+ if (ar || !(i in from)) {
32
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
33
+ ar[i] = from[i];
34
+ }
35
+ }
36
+ return to.concat(ar || Array.prototype.slice.call(from));
37
+ };
29
38
  var __importDefault = (this && this.__importDefault) || function (mod) {
30
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
31
40
  };
@@ -41,7 +50,7 @@ var styled_1 = require("../styled");
41
50
  var StyledCustomSelectCompWrapper = styled_components_1.default.button(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ", "\n /* width: 1.5rem; */\n height: 2.5rem;\n"], ["\n ", "\n /* width: 1.5rem; */\n height: 2.5rem;\n"])), styled_1.commonRowColActionMenuStyles);
42
51
  // const CustomSelectComp =
43
52
  var RowActionsMenu = function (_a) {
44
- var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, setActionsActiveOnRow = _a.setActionsActiveOnRow, rowActionsButtonWidth = _a.rowActionsButtonWidth, _b = _a.conditionsToRender, conditionsToRender = _b === void 0 ? true : _b;
53
+ var value = _a.value, rowIdx = _a.rowIdx, onChange = _a.onChange, id = _a.id, disableAddRow = _a.disableAddRow, setActionsActiveOnRow = _a.setActionsActiveOnRow, rowActionsButtonWidth = _a.rowActionsButtonWidth, _b = _a.conditionsToRender, conditionsToRender = _b === void 0 ? true : _b;
45
54
  var _c = (0, react_1.useState)(false), actionMenuIsOpen = _c[0], setActionMenuIsOpen = _c[1];
46
55
  var isFirstMount = (0, react_1.useRef)(true);
47
56
  (0, react_1.useEffect)(function () {
@@ -67,7 +76,7 @@ var RowActionsMenu = function (_a) {
67
76
  var active = _a.active, onClick = _a.onClick;
68
77
  return (react_1.default.createElement(StyledCustomSelectCompWrapper, { style: { width: rowActionsButtonWidth + "px" }, onClick: onClick, active: active },
69
78
  react_1.default.createElement(DisplayIcon_1.DisplayIcon, { icon: "DotsThreeVertical", size: 16 })));
70
- }, actions: [
79
+ }, actions: __spreadArray(__spreadArray([], (!disableAddRow ? [
71
80
  {
72
81
  display: UIContent_1.UIContent.SimpleTable.delete,
73
82
  onClick: function () { return (0, handleRowActions_1.handleDeleteRow)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id }); },
@@ -88,13 +97,14 @@ var RowActionsMenu = function (_a) {
88
97
  return (0, handleRowActions_1.handleInsertRowAfter)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id });
89
98
  },
90
99
  },
100
+ ] : []), true), [
91
101
  {
92
102
  display: UIContent_1.UIContent.SimpleTable.clearContent,
93
103
  onClick: function () {
94
104
  return (0, handleRowActions_1.handleClearRowContent)({ value: value, rowIdx: rowIdx, onChange: onChange, id: id });
95
105
  },
96
106
  },
97
- ] })));
107
+ ], false) })));
98
108
  };
99
109
  exports.RowActionsMenu = RowActionsMenu;
100
110
  var templateObject_1;
@@ -219,7 +219,8 @@ function SimpleTable(_a) {
219
219
  enableColActions &&
220
220
  rowIdx === 0 &&
221
221
  hoveredRowAndCol.colIdx === cellIdx }),
222
- !config.disableRowActionsMenu && react_1.default.createElement(RowActionsMenu_1.RowActionsMenu, { value: value, rowIdx: rowIdx, onChange: onChange, id: id, setActionsActiveOnRow: setActionsActiveOnRow, rowActionsButtonWidth: rowActionsButtonWidth, conditionsToRender: !readOnly &&
222
+ !config.disableRowActionsMenu && react_1.default.createElement(RowActionsMenu_1.RowActionsMenu, { value: value, rowIdx: rowIdx, onChange: onChange, id: id, setActionsActiveOnRow: setActionsActiveOnRow, rowActionsButtonWidth: rowActionsButtonWidth, disableAddRow: config === null || config === void 0 ? void 0 : config.disableAddRow,
223
+ conditionsToRender: !readOnly &&
223
224
  enableRowActions &&
224
225
  cellIdx === 0 &&
225
226
  rowIdx !== undefined && //cuz for fixed col headers, rowIdx is undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oolib",
3
- "version": "2.141.3",
3
+ "version": "2.141.4",
4
4
  "description": " OKE Component Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",