@gpa-gemstone/react-table 1.2.67 → 1.2.69

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.
@@ -69,5 +69,5 @@ function ColumnHeaderWrapper(props) {
69
69
  } }, (_a = props.children) !== null && _a !== void 0 ? _a : props.colKey));
70
70
  }
71
71
  function ColumnDataWrapper(props) {
72
- return (React.createElement("td", { style: props.style, onClick: props.onClick, draggable: props.dragStart !== undefined, onDragStart: props.dragStart }, props.children));
72
+ return (React.createElement("td", { style: props.style, onClick: props.onClick, draggable: props.dragStart != undefined, onDragStart: props.dragStart }, props.children));
73
73
  }
@@ -76,7 +76,7 @@ const IsColumnAdjustable = (props) => {
76
76
  return propValue;
77
77
  return false;
78
78
  };
79
- const scrollBarWidth = getScrollbarWidth();
79
+ const scrollBarWidth = (0, helper_functions_1.GetScrollbarWidth)();
80
80
  const lastColumnWidth = 17;
81
81
  function Table(props) {
82
82
  const bodyRef = React.useRef(null);
@@ -313,18 +313,19 @@ function Rows(props) {
313
313
  data: d[(_b = element.props) === null || _b === void 0 ? void 0 : _b.Field],
314
314
  index: i,
315
315
  }, e);
316
- }, dragStart: (e) => {
317
- var _a, _b;
318
- if (props.DragStart == null)
319
- return;
320
- return props.DragStart({
321
- colKey: element.props.Key,
322
- colField: (_a = element.props) === null || _a === void 0 ? void 0 : _a.Field,
323
- row: d,
324
- data: d[(_b = element.props) === null || _b === void 0 ? void 0 : _b.Field],
325
- index: i,
326
- }, e);
327
- }, style: style }, ((_d = element.props) === null || _d === void 0 ? void 0 : _d.Content) != null
316
+ }, dragStart: props.DragStart == null ? undefined :
317
+ (e) => {
318
+ var _a, _b;
319
+ if (props.DragStart == null)
320
+ return;
321
+ return props.DragStart({
322
+ colKey: element.props.Key,
323
+ colField: (_a = element.props) === null || _a === void 0 ? void 0 : _a.Field,
324
+ row: d,
325
+ data: d[(_b = element.props) === null || _b === void 0 ? void 0 : _b.Field],
326
+ index: i,
327
+ }, e);
328
+ }, style: style }, ((_d = element.props) === null || _d === void 0 ? void 0 : _d.Content) != null
328
329
  ? element.props.Content({
329
330
  item: d,
330
331
  key: element.props.Key,
@@ -506,18 +507,3 @@ function Header(props) {
506
507
  React.createElement("th", { style: { width: lastColumnWidth, padding: 0, maxWidth: lastColumnWidth } }, props.LastColumn)
507
508
  : null)));
508
509
  }
509
- function getScrollbarWidth() {
510
- // Creating invisible container
511
- const outer = document.createElement('div');
512
- outer.style.visibility = 'hidden';
513
- outer.style.overflow = 'scroll'; // forcing scrollbar to appear
514
- document.body.appendChild(outer);
515
- // Creating inner element and placing it in the container
516
- const inner = document.createElement('div');
517
- outer.appendChild(inner);
518
- // Calculating difference between container's full width and the child width
519
- const scrollbarWidth = (outer.offsetWidth - inner.offsetWidth);
520
- // Removing temporary elements from the DOM
521
- outer.parentNode.removeChild(outer);
522
- return scrollbarWidth;
523
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gpa-gemstone/react-table",
3
- "version": "1.2.67",
3
+ "version": "1.2.69",
4
4
  "description": "Table for GPA web applications",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -44,8 +44,8 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@gpa-gemstone/gpa-symbols": "0.0.49",
47
- "@gpa-gemstone/helper-functions": "0.0.38",
48
- "@gpa-gemstone/react-interactive": "1.0.145",
47
+ "@gpa-gemstone/helper-functions": "0.0.39",
48
+ "@gpa-gemstone/react-interactive": "1.0.147",
49
49
  "@types/lodash": "^4.14.171",
50
50
  "@types/react": "^17.0.14",
51
51
  "lodash": "^4.17.21",