qbs-react-grid 1.0.43 → 1.0.44

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.
@@ -67,13 +67,14 @@ var ToolBar = function ToolBar(_ref) {
67
67
  return onSelect === null || onSelect === void 0 ? void 0 : onSelect([]);
68
68
  }
69
69
  }, "Clear"), selectedRowActions === null || selectedRowActions === void 0 ? void 0 : selectedRowActions.map(function (actions, index) {
70
- return /*#__PURE__*/React.createElement("button", {
70
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !actions.hidden && /*#__PURE__*/React.createElement("button", {
71
71
  key: index.toString(),
72
72
  className: "btn",
73
+ disabled: actions.disabled,
73
74
  onClick: function onClick() {
74
75
  return actions === null || actions === void 0 ? void 0 : actions.action(checkedKeys);
75
76
  }
76
- }, actions.actionTitle);
77
+ }, actions.actionTitle));
77
78
  }))) : /*#__PURE__*/React.createElement("div", null, pagination && paginationProps && /*#__PURE__*/React.createElement("div", {
78
79
  className: "rows-count"
79
80
  }, getRowDisplayRange((_paginationProps$tota = paginationProps.total) != null ? _paginationProps$tota : 0, (_paginationProps$rows = paginationProps.rowsPerPage) != null ? _paginationProps$rows : 0, (_paginationProps$curr = paginationProps.currentPage) != null ? _paginationProps$curr : 0)))));
@@ -87,6 +87,7 @@ export interface QbsTableProps {
87
87
  actionTitle?: string;
88
88
  action: (checked: (number | string)[]) => void;
89
89
  disabled?: boolean;
90
+ hidden?: boolean;
90
91
  }[];
91
92
  selectedRows?: (number | string)[];
92
93
  classes?: {
@@ -120,6 +121,7 @@ export interface QbsTableToolbarProps {
120
121
  actionTitle?: string;
121
122
  action: (checked: (number | string)[]) => void;
122
123
  disabled?: boolean;
124
+ hidden?: boolean;
123
125
  }[];
124
126
  }
125
127
  export {};
@@ -74,13 +74,14 @@ var ToolBar = function ToolBar(_ref) {
74
74
  return onSelect === null || onSelect === void 0 ? void 0 : onSelect([]);
75
75
  }
76
76
  }, "Clear"), selectedRowActions === null || selectedRowActions === void 0 ? void 0 : selectedRowActions.map(function (actions, index) {
77
- return /*#__PURE__*/_react["default"].createElement("button", {
77
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, !actions.hidden && /*#__PURE__*/_react["default"].createElement("button", {
78
78
  key: index.toString(),
79
79
  className: "btn",
80
+ disabled: actions.disabled,
80
81
  onClick: function onClick() {
81
82
  return actions === null || actions === void 0 ? void 0 : actions.action(checkedKeys);
82
83
  }
83
- }, actions.actionTitle);
84
+ }, actions.actionTitle));
84
85
  }))) : /*#__PURE__*/_react["default"].createElement("div", null, pagination && paginationProps && /*#__PURE__*/_react["default"].createElement("div", {
85
86
  className: "rows-count"
86
87
  }, (0, _tablecalc.getRowDisplayRange)((_paginationProps$tota = paginationProps.total) != null ? _paginationProps$tota : 0, (_paginationProps$rows = paginationProps.rowsPerPage) != null ? _paginationProps$rows : 0, (_paginationProps$curr = paginationProps.currentPage) != null ? _paginationProps$curr : 0)))));
@@ -87,6 +87,7 @@ export interface QbsTableProps {
87
87
  actionTitle?: string;
88
88
  action: (checked: (number | string)[]) => void;
89
89
  disabled?: boolean;
90
+ hidden?: boolean;
90
91
  }[];
91
92
  selectedRows?: (number | string)[];
92
93
  classes?: {
@@ -120,6 +121,7 @@ export interface QbsTableToolbarProps {
120
121
  actionTitle?: string;
121
122
  action: (checked: (number | string)[]) => void;
122
123
  disabled?: boolean;
124
+ hidden?: boolean;
123
125
  }[];
124
126
  }
125
127
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qbs-react-grid",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "A React table component",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -74,13 +74,18 @@ const ToolBar: React.FC<QbsTableToolbarProps> = ({
74
74
  Clear
75
75
  </button>
76
76
  {selectedRowActions?.map((actions, index: number) => (
77
- <button
78
- key={index.toString()}
79
- className="btn"
80
- onClick={() => actions?.action(checkedKeys)}
81
- >
82
- {actions.actionTitle}
83
- </button>
77
+ <>
78
+ {!actions.hidden && (
79
+ <button
80
+ key={index.toString()}
81
+ className="btn"
82
+ disabled={actions.disabled}
83
+ onClick={() => actions?.action(checkedKeys)}
84
+ >
85
+ {actions.actionTitle}
86
+ </button>
87
+ )}
88
+ </>
84
89
  ))}
85
90
  </div>
86
91
  </div>
@@ -92,6 +92,7 @@ export interface QbsTableProps {
92
92
  actionTitle?: string;
93
93
  action: (checked: (number | string)[]) => void;
94
94
  disabled?: boolean;
95
+ hidden?: boolean;
95
96
  }[];
96
97
  selectedRows?: (number | string)[];
97
98
  classes?: { [key: string]: any };
@@ -124,5 +125,6 @@ export interface QbsTableToolbarProps {
124
125
  actionTitle?: string;
125
126
  action: (checked: (number | string)[]) => void;
126
127
  disabled?: boolean;
128
+ hidden?: boolean;
127
129
  }[];
128
130
  }