cx 24.3.1 → 24.3.2

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.
package/dist/util.js CHANGED
@@ -546,10 +546,12 @@ function findScrollableParent(sourceEl, horizontal) {
546
546
  }
547
547
 
548
548
  function getParentFrameBoundingClientRect(el) {
549
- if (el.ownerDocument != document) {
549
+ // if the ownerDocument is null, the element itself is the document
550
+ var ownerDocument = el.ownerDocument || el;
551
+ if (ownerDocument != document) {
550
552
  var frames = document.getElementsByTagName("iframe");
551
553
  for (var i = 0; i < frames.length; i++) {
552
- if (frames[i].contentDocument == el.ownerDocument) {
554
+ if (frames[i].contentDocument == ownerDocument) {
553
555
  return frames[i].getBoundingClientRect();
554
556
  }
555
557
  }
package/dist/widgets.js CHANGED
@@ -15775,10 +15775,7 @@ var Grid = /*#__PURE__*/ (function (_Container) {
15775
15775
  var headerTBody = e.target.parentElement.parentElement.parentElement;
15776
15776
  var uniqueColId = e.currentTarget.dataset.uniqueColId;
15777
15777
  var headerCell = findFirstChild(headerTBody, function (el) {
15778
- var _el$dataset;
15779
- return (
15780
- el.tagName == "TH" && ((_el$dataset = el.dataset) == null ? void 0 : _el$dataset.uniqueColId) == uniqueColId
15781
- );
15778
+ return el.tagName == "TH" && el.dataset && el.dataset.uniqueColId == uniqueColId;
15782
15779
  });
15783
15780
  var scrollAreaEl = headerTBody.parentElement.parentElement;
15784
15781
  var gridEl = scrollAreaEl.parentElement;
@@ -15871,13 +15868,14 @@ var Grid = /*#__PURE__*/ (function (_Container) {
15871
15868
  var headerRows = [];
15872
15869
  if (!header) return null;
15873
15870
  var skip = {};
15874
- header.children.forEach(function (line, lineIndex) {
15871
+ var lineIndex = 0;
15872
+ header.children.forEach(function (line) {
15875
15873
  var empty = [true, true, true];
15876
15874
  var result = [[], [], []];
15877
15875
  line.children.forEach(function (hdinst, colIndex) {
15878
15876
  var hdwidget = hdinst.widget;
15879
15877
  var _loop = function _loop(l) {
15880
- var colKey = lineIndex + "-" + colIndex + "-" + l;
15878
+ var colKey = lineIndex + l + "-" + colIndex;
15881
15879
  if (skip[colKey]) return 0; // continue
15882
15880
  if (Boolean(hdinst.data.fixed) != fixedColumns) return 0; // continue
15883
15881
  var header = hdinst.components["header" + (l + 1)];
@@ -15934,8 +15932,7 @@ var Grid = /*#__PURE__*/ (function (_Container) {
15934
15932
  colSpan = header.data.colSpan;
15935
15933
  rowSpan = header.data.rowSpan;
15936
15934
  for (var r = 0; r < header.data.rowSpan; r++)
15937
- for (var c = 0; c < header.data.colSpan; c++)
15938
- skip[lineIndex + "-" + (colIndex + c) + "-" + (l + r)] = true;
15935
+ for (var c = 0; c < header.data.colSpan; c++) skip[lineIndex + l + r + "-" + (colIndex + c)] = true;
15939
15936
  }
15940
15937
  if ((hdwidget.resizable || header.data.resizable) && header.data.colSpan < 2) {
15941
15938
  resizer = _this3.renderResizer(instance, hdinst, header, colIndex);
@@ -16003,6 +16000,7 @@ var Grid = /*#__PURE__*/ (function (_Container) {
16003
16000
  result = result.filter(function (_, i) {
16004
16001
  return !empty[i];
16005
16002
  });
16003
+ lineIndex += result.length;
16006
16004
  if (result[0]) {
16007
16005
  if (fixed && !fixedColumns) {
16008
16006
  result[0].push(
@@ -16642,6 +16640,7 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
16642
16640
  mod["draggable"] = draggable;
16643
16641
  mod["non-draggable"] = !draggable;
16644
16642
  var wrap = function wrap(children) {
16643
+ var skipCells = {};
16645
16644
  return /*#__PURE__*/ jsx(
16646
16645
  GridRowComponent,
16647
16646
  {
@@ -16691,6 +16690,20 @@ var GridComponent = /*#__PURE__*/ (function (_VDOM$Component) {
16691
16690
  maxWidth: width + "px",
16692
16691
  });
16693
16692
  }
16693
+ if (skipCells[line + "-" + cellIndex]) return null;
16694
+ if (data.colSpan > 1 || data.rowSpan > 1) {
16695
+ for (var r = line; r < line + ((_data$rowSpan = data.rowSpan) != null ? _data$rowSpan : 1); r++) {
16696
+ var _data$rowSpan;
16697
+ for (
16698
+ var c = cellIndex;
16699
+ c < cellIndex + ((_data$colSpan = data.colSpan) != null ? _data$colSpan : 1);
16700
+ c++
16701
+ ) {
16702
+ var _data$colSpan;
16703
+ skipCells[r + "-" + c] = true;
16704
+ }
16705
+ }
16706
+ }
16694
16707
  if (cellWrap) content = cellWrap(content);
16695
16708
  return /*#__PURE__*/ jsx(
16696
16709
  "td",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cx",
3
- "version": "24.3.1",
3
+ "version": "24.3.2",
4
4
  "description": "Advanced JavaScript UI framework for admin and dashboard applications with ready to use grid, form and chart components.",
5
5
  "main": "index.js",
6
6
  "jsnext:main": "src/index.js",
@@ -1,8 +1,10 @@
1
1
  export function getParentFrameBoundingClientRect(el) {
2
- if (el.ownerDocument != document) {
2
+ // if the ownerDocument is null, the element itself is the document
3
+ let ownerDocument = el.ownerDocument || el;
4
+ if (ownerDocument != document) {
3
5
  let frames = document.getElementsByTagName("iframe");
4
6
  for (let i = 0; i < frames.length; i++) {
5
- if (frames[i].contentDocument == el.ownerDocument) {
7
+ if (frames[i].contentDocument == ownerDocument) {
6
8
  return frames[i].getBoundingClientRect();
7
9
  }
8
10
  }
@@ -14,6 +16,6 @@ export function getParentFrameBoundingClientRect(el) {
14
16
  right: window.innerWidth,
15
17
  bottom: window.innerHeight,
16
18
  width: window.innerWidth,
17
- height: window.innerHeight
19
+ height: window.innerHeight,
18
20
  };
19
- }
21
+ }