@deot/vc 1.0.18 → 1.0.20

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.
@@ -36459,12 +36459,19 @@ var Vc = (function (exports, vue) {
36459
36459
  const refreshItemSize = (index) => {
36460
36460
  const current = props2.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
36461
36461
  if (!current) return;
36462
+ const oldSize = current.size;
36462
36463
  const dom = preloads.value[index] || curloads.value[props2.inverted ? index : index - firstItemIndex.value];
36463
36464
  if (dom) {
36464
36465
  current.size = dom[K.offsetSize] || placeholderSize.value;
36465
36466
  } else if (current) {
36466
36467
  current.size = placeholderSize.value;
36467
36468
  }
36469
+ if (oldSize !== current.size) {
36470
+ emit("row-resize", {
36471
+ index: current.id,
36472
+ size: current.size
36473
+ });
36474
+ }
36468
36475
  };
36469
36476
  const refreshItemPosition = () => {
36470
36477
  const sizes = Array.from({
@@ -36673,13 +36680,6 @@ var Vc = (function (exports, vue) {
36673
36680
  leading: false,
36674
36681
  trailing: true
36675
36682
  });
36676
- const handleRowChange = (e, row) => {
36677
- emit("row-resize", {
36678
- index: row.id,
36679
- height: e.height,
36680
- width: e.width
36681
- });
36682
- };
36683
36683
  const setDataSource = async (v, oldV) => {
36684
36684
  if (!Array.isArray(v) || oldV === v) return;
36685
36685
  if (props2.data.length % props2.pageSize > 0) {
@@ -36806,8 +36806,7 @@ var Vc = (function (exports, vue) {
36806
36806
  "data-column": item.column,
36807
36807
  "data-size": item.size,
36808
36808
  "data-position": item.position,
36809
- "onResize": handleResize,
36810
- "onChange": (e) => handleRowChange(e, item)
36809
+ "onResize": handleResize
36811
36810
  }, {
36812
36811
  default: () => [slots.default?.({
36813
36812
  row: item.data || {},
@@ -38157,8 +38156,7 @@ var Vc = (function (exports, vue) {
38157
38156
  const handleResize = (e, index) => {
38158
38157
  emit("row-resize", {
38159
38158
  index,
38160
- height: e.height,
38161
- width: e.width
38159
+ size: e.height
38162
38160
  });
38163
38161
  };
38164
38162
  return () => {
@@ -38419,7 +38417,9 @@ var Vc = (function (exports, vue) {
38419
38417
  const handleMergeRowResize = (v) => {
38420
38418
  if (table.props.rowHeight) return;
38421
38419
  states.list[v.index].rows.forEach((row) => {
38422
- row.heightMap[props2.fixed || "main"] = v.height;
38420
+ const old = row.heightMap[props2.fixed || "main"];
38421
+ if (old === v.size) return;
38422
+ row.heightMap[props2.fixed || "main"] = v.size;
38423
38423
  const heights = [row.heightMap.main];
38424
38424
  if (states.leftFixedCount) {
38425
38425
  heights.push(row.heightMap.left);
@@ -38741,7 +38741,7 @@ var Vc = (function (exports, vue) {
38741
38741
  "class": [
38742
38742
  "vc-table__cell",
38743
38743
  // {
38744
- // "highlight": column.filteredValue && column.filteredValue.length > 0
38744
+ // "is-highlight": column.filteredValue && column.filteredValue.length > 0
38745
38745
  // },
38746
38746
  column.labelClass
38747
38747
  ]
@@ -38776,6 +38776,7 @@ var Vc = (function (exports, vue) {
38776
38776
  border: Boolean
38777
38777
  },
38778
38778
  setup(props2) {
38779
+ vue.inject("vc-table");
38779
38780
  const states = useStates({
38780
38781
  data: "data",
38781
38782
  columns: "columns",
@@ -38869,7 +38870,8 @@ var Vc = (function (exports, vue) {
38869
38870
  "key": columnIndex,
38870
38871
  "class": [getRowClasses(column, columnIndex), "vc-table__td"],
38871
38872
  "style": [{
38872
- width: `${column.realWidth}px`
38873
+ width: `${column.realWidth}px`,
38874
+ height: `44px`
38873
38875
  }]
38874
38876
  }, [vue.createVNode("div", {
38875
38877
  "class": ["vc-table__cell", column.labelClass]
@@ -38957,7 +38959,7 @@ var Vc = (function (exports, vue) {
38957
38959
  getSpan: Function,
38958
38960
  placeholder: {
38959
38961
  type: [String, Function],
38960
- default: "--"
38962
+ default: "-"
38961
38963
  },
38962
38964
  /**
38963
38965
  * 排序全部交给外部处理,内部不处理数据,只做交互
@@ -39568,7 +39570,7 @@ var Vc = (function (exports, vue) {
39568
39570
  }
39569
39571
  let endIndex = 0;
39570
39572
  hiddenEl$1.innerText = suffix;
39571
- value.split("").forEach((item, i) => {
39573
+ (value || "").split("").forEach((item, i) => {
39572
39574
  let old = hiddenEl$1.innerText;
39573
39575
  old = old.substring(0, old.length - suffix.length);
39574
39576
  hiddenEl$1.innerText = old + item + suffix;
@@ -39779,7 +39781,7 @@ var Vc = (function (exports, vue) {
39779
39781
  return column.formatter(rowData);
39780
39782
  }
39781
39783
  const line = column.line || VcInstance.options.TableColumn?.line;
39782
- if (line) {
39784
+ if (line && value) {
39783
39785
  const style2 = {
39784
39786
  // 目前左右pading为10
39785
39787
  // TODO: 含有border还要-1
@@ -36462,12 +36462,19 @@
36462
36462
  const refreshItemSize = (index) => {
36463
36463
  const current = props2.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
36464
36464
  if (!current) return;
36465
+ const oldSize = current.size;
36465
36466
  const dom = preloads.value[index] || curloads.value[props2.inverted ? index : index - firstItemIndex.value];
36466
36467
  if (dom) {
36467
36468
  current.size = dom[K.offsetSize] || placeholderSize.value;
36468
36469
  } else if (current) {
36469
36470
  current.size = placeholderSize.value;
36470
36471
  }
36472
+ if (oldSize !== current.size) {
36473
+ emit("row-resize", {
36474
+ index: current.id,
36475
+ size: current.size
36476
+ });
36477
+ }
36471
36478
  };
36472
36479
  const refreshItemPosition = () => {
36473
36480
  const sizes = Array.from({
@@ -36676,13 +36683,6 @@
36676
36683
  leading: false,
36677
36684
  trailing: true
36678
36685
  });
36679
- const handleRowChange = (e, row) => {
36680
- emit("row-resize", {
36681
- index: row.id,
36682
- height: e.height,
36683
- width: e.width
36684
- });
36685
- };
36686
36686
  const setDataSource = async (v, oldV) => {
36687
36687
  if (!Array.isArray(v) || oldV === v) return;
36688
36688
  if (props2.data.length % props2.pageSize > 0) {
@@ -36809,8 +36809,7 @@
36809
36809
  "data-column": item.column,
36810
36810
  "data-size": item.size,
36811
36811
  "data-position": item.position,
36812
- "onResize": handleResize,
36813
- "onChange": (e) => handleRowChange(e, item)
36812
+ "onResize": handleResize
36814
36813
  }, {
36815
36814
  default: () => [slots.default?.({
36816
36815
  row: item.data || {},
@@ -38160,8 +38159,7 @@
38160
38159
  const handleResize = (e, index) => {
38161
38160
  emit("row-resize", {
38162
38161
  index,
38163
- height: e.height,
38164
- width: e.width
38162
+ size: e.height
38165
38163
  });
38166
38164
  };
38167
38165
  return () => {
@@ -38422,7 +38420,9 @@
38422
38420
  const handleMergeRowResize = (v) => {
38423
38421
  if (table.props.rowHeight) return;
38424
38422
  states.list[v.index].rows.forEach((row) => {
38425
- row.heightMap[props2.fixed || "main"] = v.height;
38423
+ const old = row.heightMap[props2.fixed || "main"];
38424
+ if (old === v.size) return;
38425
+ row.heightMap[props2.fixed || "main"] = v.size;
38426
38426
  const heights = [row.heightMap.main];
38427
38427
  if (states.leftFixedCount) {
38428
38428
  heights.push(row.heightMap.left);
@@ -38744,7 +38744,7 @@
38744
38744
  "class": [
38745
38745
  "vc-table__cell",
38746
38746
  // {
38747
- // "highlight": column.filteredValue && column.filteredValue.length > 0
38747
+ // "is-highlight": column.filteredValue && column.filteredValue.length > 0
38748
38748
  // },
38749
38749
  column.labelClass
38750
38750
  ]
@@ -38779,6 +38779,7 @@
38779
38779
  border: Boolean
38780
38780
  },
38781
38781
  setup(props2) {
38782
+ vue.inject("vc-table");
38782
38783
  const states = useStates({
38783
38784
  data: "data",
38784
38785
  columns: "columns",
@@ -38872,7 +38873,8 @@
38872
38873
  "key": columnIndex,
38873
38874
  "class": [getRowClasses(column, columnIndex), "vc-table__td"],
38874
38875
  "style": [{
38875
- width: `${column.realWidth}px`
38876
+ width: `${column.realWidth}px`,
38877
+ height: `44px`
38876
38878
  }]
38877
38879
  }, [vue.createVNode("div", {
38878
38880
  "class": ["vc-table__cell", column.labelClass]
@@ -38960,7 +38962,7 @@
38960
38962
  getSpan: Function,
38961
38963
  placeholder: {
38962
38964
  type: [String, Function],
38963
- default: "--"
38965
+ default: "-"
38964
38966
  },
38965
38967
  /**
38966
38968
  * 排序全部交给外部处理,内部不处理数据,只做交互
@@ -39571,7 +39573,7 @@
39571
39573
  }
39572
39574
  let endIndex = 0;
39573
39575
  hiddenEl$1.innerText = suffix;
39574
- value.split("").forEach((item, i) => {
39576
+ (value || "").split("").forEach((item, i) => {
39575
39577
  let old = hiddenEl$1.innerText;
39576
39578
  old = old.substring(0, old.length - suffix.length);
39577
39579
  hiddenEl$1.innerText = old + item + suffix;
@@ -39782,7 +39784,7 @@
39782
39784
  return column.formatter(rowData);
39783
39785
  }
39784
39786
  const line = column.line || VcInstance.options.TableColumn?.line;
39785
- if (line) {
39787
+ if (line && value) {
39786
39788
  const style2 = {
39787
39789
  // 目前左右pading为10
39788
39790
  // TODO: 含有border还要-1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -19,9 +19,9 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@deot/vc-components": "^1.0.18",
23
- "@deot/vc-hooks": "^1.0.18",
24
- "@deot/vc-shared": "^1.0.18"
22
+ "@deot/vc-components": "^1.0.20",
23
+ "@deot/vc-hooks": "^1.0.20",
24
+ "@deot/vc-shared": "^1.0.20"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vue": "*"