@cashub/ui 0.29.4 → 0.31.0

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.
@@ -106,12 +106,13 @@ const ModalHeader = _ref2 => {
106
106
  })]
107
107
  });
108
108
  };
109
- const ModalBody = _ref3 => {
109
+ const ModalBody = /*#__PURE__*/(0, _react.forwardRef)((_ref3, ref) => {
110
110
  let {
111
111
  children
112
112
  } = _ref3,
113
113
  props = _objectWithoutProperties(_ref3, _excluded);
114
- const bodyRef = (0, _react.useRef)(null);
114
+ const ownRef = (0, _react.useRef)(null);
115
+ const bodyRef = ref || ownRef;
115
116
  const recalculateHeight = () => {
116
117
  // body element not render yet
117
118
  if (!bodyRef.current) return;
@@ -137,7 +138,8 @@ const ModalBody = _ref3 => {
137
138
  }, props), {}, {
138
139
  children: children
139
140
  }));
140
- };
141
+ });
142
+ ModalBody.displayName = 'ModalBody';
141
143
  const ModalFooter = _ref4 => {
142
144
  let {
143
145
  children
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.29.4",
3
+ "version": "0.31.0",
4
4
  "private": false,
5
5
  "author": "CasHUB Team",
6
6
  "description": "CasHUB UI components library",
package/table/Table.js CHANGED
@@ -44,6 +44,10 @@ const Table = _ref => {
44
44
  select,
45
45
  selected,
46
46
  onRowClick,
47
+ onRowDragEnter,
48
+ onRowDragLeave,
49
+ onRowDragOver,
50
+ onRowDrop,
47
51
  backgroundReverse,
48
52
  translation,
49
53
  beforeCreateRow,
@@ -72,6 +76,26 @@ const Table = _ref => {
72
76
  onRowClick(event, rowData);
73
77
  }
74
78
  }, [onRowClick]);
79
+ const handleRowDragEnter = (0, _react.useCallback)((event, rowData) => {
80
+ if (onRowDragEnter) {
81
+ onRowDragEnter(event, rowData);
82
+ }
83
+ }, [onRowDragEnter]);
84
+ const handleRowDragLeave = (0, _react.useCallback)((event, rowData) => {
85
+ if (onRowDragLeave) {
86
+ onRowDragLeave(event, rowData);
87
+ }
88
+ }, [onRowDragLeave]);
89
+ const handleRowDragOver = (0, _react.useCallback)((event, rowData) => {
90
+ if (onRowDragOver) {
91
+ onRowDragOver(event, rowData);
92
+ }
93
+ }, [onRowDragOver]);
94
+ const handleRowDrop = (0, _react.useCallback)((event, rowData) => {
95
+ if (onRowDrop) {
96
+ onRowDrop(event, rowData);
97
+ }
98
+ }, [onRowDrop]);
75
99
  const showFullValue = (0, _react.useCallback)((event, customContent) => {
76
100
  let {
77
101
  id
@@ -202,10 +226,22 @@ const Table = _ref => {
202
226
  onClick: event => {
203
227
  handleRowClick(event, row);
204
228
  },
229
+ onDragEnter: event => {
230
+ handleRowDragEnter(event, row);
231
+ },
232
+ onDragLeave: event => {
233
+ handleRowDragLeave(event, row);
234
+ },
235
+ onDragOver: event => {
236
+ handleRowDragOver(event, row);
237
+ },
238
+ onDrop: event => {
239
+ handleRowDrop(event, row);
240
+ },
205
241
  children: tds
206
242
  }, rowIndex);
207
243
  });
208
- }, [backgroundReverse, beforeCreateRow, columns, data, handleRowClick, onRowClick, select, selected, showFullValue]);
244
+ }, [backgroundReverse, beforeCreateRow, columns, data, handleRowClick, handleRowDragEnter, handleRowDragLeave, handleRowDragOver, handleRowDrop, onRowClick, select, selected, showFullValue]);
209
245
  const generateEmptyMessage = (0, _react.useCallback)(() => {
210
246
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(BodyTR, {
211
247
  noData: true,