@v-c/table 0.0.4 → 1.0.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/dist/Table.cjs CHANGED
@@ -176,11 +176,7 @@ var ImmutableTable = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, s
176
176
  target(scrollLeft);
177
177
  return;
178
178
  }
179
- if (target.scrollTo) {
180
- target.scrollTo({ left: scrollLeft });
181
- return;
182
- }
183
- const element = (0, _v_c_util_dist_Dom_findDOMNode.getDOM)(target);
179
+ const element = target.nativeElement ? (0, _v_c_util_dist_Dom_findDOMNode.getDOM)(target.nativeElement) : (0, _v_c_util_dist_Dom_findDOMNode.getDOM)(target);
184
180
  if (element && element.scrollLeft !== scrollLeft) {
185
181
  element.scrollLeft = scrollLeft;
186
182
  if (element.scrollLeft !== scrollLeft) setTimeout(() => {
package/dist/Table.js CHANGED
@@ -167,11 +167,7 @@ var ImmutableTable = /* @__PURE__ */ defineComponent((props, { attrs, slots, exp
167
167
  target(scrollLeft);
168
168
  return;
169
169
  }
170
- if (target.scrollTo) {
171
- target.scrollTo({ left: scrollLeft });
172
- return;
173
- }
174
- const element = getDOM(target);
170
+ const element = target.nativeElement ? getDOM(target.nativeElement) : getDOM(target);
175
171
  if (element && element.scrollLeft !== scrollLeft) {
176
172
  element.scrollLeft = scrollLeft;
177
173
  if (element.scrollLeft !== scrollLeft) setTimeout(() => {
@@ -82,8 +82,13 @@ var BodyGrid = /* @__PURE__ */ (0, vue.defineComponent)({
82
82
  if (!item) return null;
83
83
  const rowKey = item.rowKey;
84
84
  const getHeight = (rowSpan) => {
85
- const endItem = rawData[index + rowSpan - 1];
86
- if (!endItem) return 0;
85
+ const endItemIndex = index + rowSpan - 1;
86
+ const endItem = rawData[endItemIndex];
87
+ if (!endItem || !endItem.record) {
88
+ const endItemKey$1 = rawData[Math.min(endItemIndex, rawData.length - 1)].rowKey;
89
+ const sizeInfo$2 = getSize(rowKey, endItemKey$1);
90
+ return sizeInfo$2.bottom - sizeInfo$2.top;
91
+ }
87
92
  const endItemKey = endItem.rowKey;
88
93
  const sizeInfo$1 = getSize(rowKey, endItemKey);
89
94
  return sizeInfo$1.bottom - sizeInfo$1.top;
@@ -76,8 +76,13 @@ var BodyGrid_default = /* @__PURE__ */ defineComponent({
76
76
  if (!item) return null;
77
77
  const rowKey = item.rowKey;
78
78
  const getHeight = (rowSpan) => {
79
- const endItem = rawData[index + rowSpan - 1];
80
- if (!endItem) return 0;
79
+ const endItemIndex = index + rowSpan - 1;
80
+ const endItem = rawData[endItemIndex];
81
+ if (!endItem || !endItem.record) {
82
+ const endItemKey$1 = rawData[Math.min(endItemIndex, rawData.length - 1)].rowKey;
83
+ const sizeInfo$2 = getSize(rowKey, endItemKey$1);
84
+ return sizeInfo$2.bottom - sizeInfo$2.top;
85
+ }
81
86
  const endItemKey = endItem.rowKey;
82
87
  const sizeInfo$1 = getSize(rowKey, endItemKey);
83
88
  return sizeInfo$1.bottom - sizeInfo$1.top;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/table",
3
3
  "type": "module",
4
- "version": "0.0.4",
4
+ "version": "1.0.0",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -20,9 +20,9 @@
20
20
  "vue": "^3.0.0"
21
21
  },
22
22
  "dependencies": {
23
- "@v-c/resize-observer": "^1.0.7",
24
- "@v-c/virtual-list": "^1.0.4",
25
- "@v-c/util": "^1.0.8"
23
+ "@v-c/resize-observer": "^1.0.8",
24
+ "@v-c/util": "^1.0.9",
25
+ "@v-c/virtual-list": "^1.0.5"
26
26
  },
27
27
  "publishConfig": {
28
28
  "access": "public"