canvas-datagrid 0.3.25 → 0.4.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.
package/lib/dom.js CHANGED
@@ -123,14 +123,27 @@ export default function (self) {
123
123
  self.input.style.width = self.width - borderWidth - 1 + 'px';
124
124
  return;
125
125
  }
126
+ let groupAreaOffsetY = self.getColumnGroupAreaHeight();
127
+ let groupAreaOffsetX = self.getRowGroupAreaWidth();
128
+ if (self.parentNode) {
129
+ const { columnGroupsAreaHeight, rowGroupsAreaWidth } = self.parentNode;
130
+ if (columnGroupsAreaHeight) groupAreaOffsetY += columnGroupsAreaHeight;
131
+ if (rowGroupsAreaWidth) groupAreaOffsetX += rowGroupsAreaWidth;
132
+ }
126
133
  self.input.style.left =
127
- pos.left + cell.x + self.canvasOffsetLeft - s.left + 'px';
134
+ pos.left +
135
+ cell.x +
136
+ self.canvasOffsetLeft -
137
+ s.left +
138
+ groupAreaOffsetX +
139
+ 'px';
128
140
  self.input.style.top =
129
141
  pos.top +
130
142
  cell.y -
131
143
  self.style.cellBorderWidth +
132
144
  self.canvasOffsetTop -
133
145
  s.top +
146
+ groupAreaOffsetY +
134
147
  'px';
135
148
  self.input.style.height = cell.height - borderWidth + 'px';
136
149
  self.input.style.width = cell.width - self.style.cellPaddingLeft + 'px';
@@ -171,6 +184,10 @@ export default function (self) {
171
184
  if (self.isChildGrid) {
172
185
  pos.x -= self.canvasOffsetLeft;
173
186
  pos.y -= self.canvasOffsetTop;
187
+ if (self.parentNode.rowGroupsAreaWidth)
188
+ pos.x -= self.parentNode.rowGroupsAreaWidth;
189
+ if (self.parentNode.columnGroupsAreaHeight)
190
+ pos.y -= self.parentNode.columnGroupsAreaHeight;
174
191
  }
175
192
  return {
176
193
  x: pos.x,