@deot/vc-components 1.0.19 → 1.0.21

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.
@@ -14741,6 +14741,14 @@
14741
14741
  type: [String, Boolean],
14742
14742
  default: "取消"
14743
14743
  },
14744
+ okDisabled: {
14745
+ type: Boolean,
14746
+ default: false
14747
+ },
14748
+ cancelDisabled: {
14749
+ type: Boolean,
14750
+ default: false
14751
+ },
14744
14752
  footer: {
14745
14753
  type: Boolean,
14746
14754
  default: true
@@ -14890,11 +14898,13 @@
14890
14898
  "class": ['vc-drawer__footer']
14891
14899
  }, [slots['footer-extra']?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props.cancelText && vue.createVNode(Button, {
14892
14900
  "style": "margin-right: 8px;",
14901
+ "disabled": props.cancelDisabled,
14893
14902
  "onClick": e => handleBefore(e, handleCancel)
14894
14903
  }, {
14895
14904
  default: () => [props.cancelText]
14896
14905
  }), props.okText && vue.createVNode(Button, {
14897
14906
  "type": "primary",
14907
+ "disabled": props.okDisabled,
14898
14908
  "onClick": e => handleBefore(e, handleOk)
14899
14909
  }, {
14900
14910
  default: () => [props.okText]
@@ -17105,6 +17115,14 @@
17105
17115
  type: Boolean,
17106
17116
  default: false
17107
17117
  },
17118
+ okDisabled: {
17119
+ type: Boolean,
17120
+ default: false
17121
+ },
17122
+ cancelDisabled: {
17123
+ type: Boolean,
17124
+ default: false
17125
+ },
17108
17126
  /**
17109
17127
  * 兼容portal设计, 实现Promise方式
17110
17128
  */
@@ -17450,11 +17468,13 @@
17450
17468
  }, 'vc-modal__footer']
17451
17469
  }, [slots['footer-extra']?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props.cancelText && vue.createVNode(Button, {
17452
17470
  "style": "margin-right: 8px;",
17471
+ "disabled": props.cancelDisabled,
17453
17472
  "onClick": e => handleBefore(e, handleCancel)
17454
17473
  }, {
17455
17474
  default: () => [props.cancelText]
17456
17475
  }), props.okText && vue.createVNode(Button, {
17457
17476
  "type": "primary",
17477
+ "disabled": props.okDisabled,
17458
17478
  "onClick": e => handleBefore(e, handleOk)
17459
17479
  }, {
17460
17480
  default: () => [props.okText]
@@ -19975,12 +19995,21 @@
19975
19995
  const current = props.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
19976
19996
  if (!current) return; // 受到`removeUnusedPlaceholders`影响,无效的会被回收
19977
19997
 
19998
+ const oldSize = current.size;
19978
19999
  const dom = preloads.value[index] || curloads.value[props.inverted ? index : index - firstItemIndex.value];
19979
20000
  if (dom) {
19980
20001
  current.size = dom[K.offsetSize] || placeholderSize.value;
19981
20002
  } else if (current) {
19982
20003
  current.size = placeholderSize.value;
19983
20004
  }
20005
+
20006
+ // 这样的考虑欠佳,待优化
20007
+ if (oldSize !== current.size) {
20008
+ emit('row-resize', {
20009
+ index: current.id,
20010
+ size: current.size
20011
+ });
20012
+ }
19984
20013
  };
19985
20014
  const refreshItemPosition = () => {
19986
20015
  const sizes = Array.from({
@@ -20210,13 +20239,6 @@
20210
20239
  leading: false,
20211
20240
  trailing: true
20212
20241
  });
20213
- const handleRowChange = (e, row) => {
20214
- emit('row-resize', {
20215
- index: row.id,
20216
- height: e.height,
20217
- width: e.width
20218
- });
20219
- };
20220
20242
 
20221
20243
  // 设置初始数据
20222
20244
  const setDataSource = async (v, oldV) => {
@@ -20347,8 +20369,7 @@
20347
20369
  "data-column": item.column,
20348
20370
  "data-size": item.size,
20349
20371
  "data-position": item.position,
20350
- "onResize": handleResize,
20351
- "onChange": e => handleRowChange(e, item)
20372
+ "onResize": handleResize
20352
20373
  }, {
20353
20374
  default: () => [slots.default?.({
20354
20375
  row: item.data || {},
@@ -38948,8 +38969,7 @@
38948
38969
  const handleResize = (e, index) => {
38949
38970
  emit('row-resize', {
38950
38971
  index,
38951
- height: e.height,
38952
- width: e.width
38972
+ size: e.height
38953
38973
  });
38954
38974
  };
38955
38975
  return () => {
@@ -39211,7 +39231,9 @@
39211
39231
  const handleMergeRowResize = v => {
39212
39232
  if (table.props.rowHeight) return;
39213
39233
  states.list[v.index].rows.forEach(row => {
39214
- row.heightMap[props.fixed || 'main'] = v.height;
39234
+ const old = row.heightMap[props.fixed || 'main'];
39235
+ if (old === v.size) return;
39236
+ row.heightMap[props.fixed || 'main'] = v.size;
39215
39237
  const heights = [row.heightMap.main];
39216
39238
  if (states.leftFixedCount) {
39217
39239
  heights.push(row.heightMap.left);
@@ -39533,7 +39555,7 @@
39533
39555
  }, [vue.createVNode("div", {
39534
39556
  "class": ['vc-table__cell',
39535
39557
  // {
39536
- // "highlight": column.filteredValue && column.filteredValue.length > 0
39558
+ // "is-highlight": column.filteredValue && column.filteredValue.length > 0
39537
39559
  // },
39538
39560
  column.labelClass]
39539
39561
  }, [column.renderHeader ? column.renderHeader({
@@ -39567,6 +39589,7 @@
39567
39589
  border: Boolean
39568
39590
  },
39569
39591
  setup(props) {
39592
+ vue.inject('vc-table');
39570
39593
  const states = useStates({
39571
39594
  data: 'data',
39572
39595
  columns: 'columns',
@@ -39660,7 +39683,8 @@
39660
39683
  "key": columnIndex,
39661
39684
  "class": [getRowClasses(column, columnIndex), 'vc-table__td'],
39662
39685
  "style": [{
39663
- width: `${column.realWidth}px`
39686
+ width: `${column.realWidth}px`,
39687
+ height: `44px`
39664
39688
  }]
39665
39689
  }, [vue.createVNode("div", {
39666
39690
  "class": ['vc-table__cell', column.labelClass]
@@ -39749,7 +39773,7 @@
39749
39773
  getSpan: Function,
39750
39774
  placeholder: {
39751
39775
  type: [String, Function],
39752
- default: "--"
39776
+ default: "-"
39753
39777
  },
39754
39778
  /**
39755
39779
  * 排序全部交给外部处理,内部不处理数据,只做交互
@@ -40388,7 +40412,7 @@
40388
40412
  }
40389
40413
  let endIndex = 0;
40390
40414
  hiddenEl$1.innerText = suffix;
40391
- value.split("").forEach((item, i) => {
40415
+ (value || "").split("").forEach((item, i) => {
40392
40416
  let old = hiddenEl$1.innerText;
40393
40417
  old = old.substring(0, old.length - suffix.length);
40394
40418
  hiddenEl$1.innerText = old + item + suffix;
@@ -40439,9 +40463,10 @@
40439
40463
  emit('clip', endIndex.value);
40440
40464
  };
40441
40465
  const handleResize = props.resize === true || props.resize === 0 ? calcPosition : debounce$1(calcPosition, props.resize || 0);
40466
+ let poper;
40442
40467
  const handleMouseOver = e => {
40443
40468
  if (endIndex.value > 0) {
40444
- Popover.open({
40469
+ poper = Popover.open({
40445
40470
  el: document.body,
40446
40471
  name: 'vc-text-popover',
40447
40472
  // 确保不重复创建
@@ -40466,6 +40491,7 @@
40466
40491
  });
40467
40492
  vue.onBeforeUnmount(() => {
40468
40493
  props.resize !== false && Resize.off(instance.vnode.el, handleResize);
40494
+ poper?.destroy?.();
40469
40495
  });
40470
40496
  const Content = props.tag;
40471
40497
  return () => {
@@ -40608,7 +40634,7 @@
40608
40634
  return column.formatter(rowData);
40609
40635
  }
40610
40636
  const line = column.line || VcInstance.options.TableColumn?.line;
40611
- if (line) {
40637
+ if (line && value) {
40612
40638
  const style = {
40613
40639
  // 目前左右pading为10
40614
40640
  // TODO: 含有border还要-1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc-components",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",