@deot/vc 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.
package/dist/index.d.ts CHANGED
@@ -1613,6 +1613,14 @@ export declare const Components: {
1613
1613
  type: (StringConstructor | BooleanConstructor)[];
1614
1614
  default: string;
1615
1615
  };
1616
+ okDisabled: {
1617
+ type: BooleanConstructor;
1618
+ default: boolean;
1619
+ };
1620
+ cancelDisabled: {
1621
+ type: BooleanConstructor;
1622
+ default: boolean;
1623
+ };
1616
1624
  footer: {
1617
1625
  type: BooleanConstructor;
1618
1626
  default: boolean;
@@ -1640,6 +1648,8 @@ export declare const Components: {
1640
1648
  closeWithCancel: boolean;
1641
1649
  okText: string | boolean;
1642
1650
  cancelText: string | boolean;
1651
+ okDisabled: boolean;
1652
+ cancelDisabled: boolean;
1643
1653
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
1644
1654
  P: {};
1645
1655
  B: {};
@@ -1696,6 +1706,14 @@ export declare const Components: {
1696
1706
  type: (StringConstructor | BooleanConstructor)[];
1697
1707
  default: string;
1698
1708
  };
1709
+ okDisabled: {
1710
+ type: BooleanConstructor;
1711
+ default: boolean;
1712
+ };
1713
+ cancelDisabled: {
1714
+ type: BooleanConstructor;
1715
+ default: boolean;
1716
+ };
1699
1717
  footer: {
1700
1718
  type: BooleanConstructor;
1701
1719
  default: boolean;
@@ -1723,6 +1741,8 @@ export declare const Components: {
1723
1741
  closeWithCancel: boolean;
1724
1742
  okText: string | boolean;
1725
1743
  cancelText: string | boolean;
1744
+ okDisabled: boolean;
1745
+ cancelDisabled: boolean;
1726
1746
  }>;
1727
1747
  __isFragment?: never;
1728
1748
  __isTeleport?: never;
@@ -1776,6 +1796,14 @@ export declare const Components: {
1776
1796
  type: (StringConstructor | BooleanConstructor)[];
1777
1797
  default: string;
1778
1798
  };
1799
+ okDisabled: {
1800
+ type: BooleanConstructor;
1801
+ default: boolean;
1802
+ };
1803
+ cancelDisabled: {
1804
+ type: BooleanConstructor;
1805
+ default: boolean;
1806
+ };
1779
1807
  footer: {
1780
1808
  type: BooleanConstructor;
1781
1809
  default: boolean;
@@ -1803,6 +1831,8 @@ export declare const Components: {
1803
1831
  closeWithCancel: boolean;
1804
1832
  okText: string | boolean;
1805
1833
  cancelText: string | boolean;
1834
+ okDisabled: boolean;
1835
+ cancelDisabled: boolean;
1806
1836
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
1807
1837
  open: (options: Partial<{
1808
1838
  footer: boolean;
@@ -1817,6 +1847,8 @@ export declare const Components: {
1817
1847
  closeWithCancel: boolean;
1818
1848
  okText: string | boolean;
1819
1849
  cancelText: string | boolean;
1850
+ okDisabled: boolean;
1851
+ cancelDisabled: boolean;
1820
1852
  } & {
1821
1853
  title?: string | undefined;
1822
1854
  onCancel?: Function | undefined;
@@ -1879,6 +1911,14 @@ export declare const Components: {
1879
1911
  type: (StringConstructor | BooleanConstructor)[];
1880
1912
  default: string;
1881
1913
  };
1914
+ okDisabled: {
1915
+ type: BooleanConstructor;
1916
+ default: boolean;
1917
+ };
1918
+ cancelDisabled: {
1919
+ type: BooleanConstructor;
1920
+ default: boolean;
1921
+ };
1882
1922
  footer: {
1883
1923
  type: BooleanConstructor;
1884
1924
  default: boolean;
@@ -1906,6 +1946,8 @@ export declare const Components: {
1906
1946
  closeWithCancel: boolean;
1907
1947
  okText: string | boolean;
1908
1948
  cancelText: string | boolean;
1949
+ okDisabled: boolean;
1950
+ cancelDisabled: boolean;
1909
1951
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
1910
1952
  P: {};
1911
1953
  B: {};
@@ -1962,6 +2004,14 @@ export declare const Components: {
1962
2004
  type: (StringConstructor | BooleanConstructor)[];
1963
2005
  default: string;
1964
2006
  };
2007
+ okDisabled: {
2008
+ type: BooleanConstructor;
2009
+ default: boolean;
2010
+ };
2011
+ cancelDisabled: {
2012
+ type: BooleanConstructor;
2013
+ default: boolean;
2014
+ };
1965
2015
  footer: {
1966
2016
  type: BooleanConstructor;
1967
2017
  default: boolean;
@@ -1989,6 +2039,8 @@ export declare const Components: {
1989
2039
  closeWithCancel: boolean;
1990
2040
  okText: string | boolean;
1991
2041
  cancelText: string | boolean;
2042
+ okDisabled: boolean;
2043
+ cancelDisabled: boolean;
1992
2044
  }>;
1993
2045
  __isFragment?: never;
1994
2046
  __isTeleport?: never;
@@ -2042,6 +2094,14 @@ export declare const Components: {
2042
2094
  type: (StringConstructor | BooleanConstructor)[];
2043
2095
  default: string;
2044
2096
  };
2097
+ okDisabled: {
2098
+ type: BooleanConstructor;
2099
+ default: boolean;
2100
+ };
2101
+ cancelDisabled: {
2102
+ type: BooleanConstructor;
2103
+ default: boolean;
2104
+ };
2045
2105
  footer: {
2046
2106
  type: BooleanConstructor;
2047
2107
  default: boolean;
@@ -2069,6 +2129,8 @@ export declare const Components: {
2069
2129
  closeWithCancel: boolean;
2070
2130
  okText: string | boolean;
2071
2131
  cancelText: string | boolean;
2132
+ okDisabled: boolean;
2133
+ cancelDisabled: boolean;
2072
2134
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
2073
2135
  open: (options: Partial<{
2074
2136
  footer: boolean;
@@ -2083,6 +2145,8 @@ export declare const Components: {
2083
2145
  closeWithCancel: boolean;
2084
2146
  okText: string | boolean;
2085
2147
  cancelText: string | boolean;
2148
+ okDisabled: boolean;
2149
+ cancelDisabled: boolean;
2086
2150
  } & {
2087
2151
  title?: string | undefined;
2088
2152
  onCancel?: Function | undefined;
@@ -2144,6 +2208,14 @@ export declare const Components: {
2144
2208
  type: (StringConstructor | BooleanConstructor)[];
2145
2209
  default: string;
2146
2210
  };
2211
+ okDisabled: {
2212
+ type: BooleanConstructor;
2213
+ default: boolean;
2214
+ };
2215
+ cancelDisabled: {
2216
+ type: BooleanConstructor;
2217
+ default: boolean;
2218
+ };
2147
2219
  footer: {
2148
2220
  type: BooleanConstructor;
2149
2221
  default: boolean;
@@ -2203,6 +2275,14 @@ export declare const Components: {
2203
2275
  type: (StringConstructor | BooleanConstructor)[];
2204
2276
  default: string;
2205
2277
  };
2278
+ okDisabled: {
2279
+ type: BooleanConstructor;
2280
+ default: boolean;
2281
+ };
2282
+ cancelDisabled: {
2283
+ type: BooleanConstructor;
2284
+ default: boolean;
2285
+ };
2206
2286
  footer: {
2207
2287
  type: BooleanConstructor;
2208
2288
  default: boolean;
@@ -2230,6 +2310,8 @@ export declare const Components: {
2230
2310
  closeWithCancel: boolean;
2231
2311
  okText: string | boolean;
2232
2312
  cancelText: string | boolean;
2313
+ okDisabled: boolean;
2314
+ cancelDisabled: boolean;
2233
2315
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
2234
2316
  MDrawerView: DefineComponent<ExtractPropTypes< {
2235
2317
  title: StringConstructor;
@@ -2280,6 +2362,14 @@ export declare const Components: {
2280
2362
  type: (StringConstructor | BooleanConstructor)[];
2281
2363
  default: string;
2282
2364
  };
2365
+ okDisabled: {
2366
+ type: BooleanConstructor;
2367
+ default: boolean;
2368
+ };
2369
+ cancelDisabled: {
2370
+ type: BooleanConstructor;
2371
+ default: boolean;
2372
+ };
2283
2373
  footer: {
2284
2374
  type: BooleanConstructor;
2285
2375
  default: boolean;
@@ -2339,6 +2429,14 @@ export declare const Components: {
2339
2429
  type: (StringConstructor | BooleanConstructor)[];
2340
2430
  default: string;
2341
2431
  };
2432
+ okDisabled: {
2433
+ type: BooleanConstructor;
2434
+ default: boolean;
2435
+ };
2436
+ cancelDisabled: {
2437
+ type: BooleanConstructor;
2438
+ default: boolean;
2439
+ };
2342
2440
  footer: {
2343
2441
  type: BooleanConstructor;
2344
2442
  default: boolean;
@@ -2366,6 +2464,8 @@ export declare const Components: {
2366
2464
  closeWithCancel: boolean;
2367
2465
  okText: string | boolean;
2368
2466
  cancelText: string | boolean;
2467
+ okDisabled: boolean;
2468
+ cancelDisabled: boolean;
2369
2469
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
2370
2470
  Dropdown: DefineComponent<ExtractPropTypes< {
2371
2471
  tag: {
@@ -4227,6 +4327,14 @@ export declare const Components: {
4227
4327
  type: BooleanConstructor;
4228
4328
  default: boolean;
4229
4329
  };
4330
+ okDisabled: {
4331
+ type: BooleanConstructor;
4332
+ default: boolean;
4333
+ };
4334
+ cancelDisabled: {
4335
+ type: BooleanConstructor;
4336
+ default: boolean;
4337
+ };
4230
4338
  onOk: {
4231
4339
  type: FunctionConstructor;
4232
4340
  };
@@ -4253,6 +4361,8 @@ export declare const Components: {
4253
4361
  closeWithCancel: boolean;
4254
4362
  okText: string | boolean;
4255
4363
  cancelText: string | boolean;
4364
+ okDisabled: boolean;
4365
+ cancelDisabled: boolean;
4256
4366
  escClosable: boolean;
4257
4367
  draggable: boolean;
4258
4368
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
@@ -4332,6 +4442,14 @@ export declare const Components: {
4332
4442
  type: BooleanConstructor;
4333
4443
  default: boolean;
4334
4444
  };
4445
+ okDisabled: {
4446
+ type: BooleanConstructor;
4447
+ default: boolean;
4448
+ };
4449
+ cancelDisabled: {
4450
+ type: BooleanConstructor;
4451
+ default: boolean;
4452
+ };
4335
4453
  onOk: {
4336
4454
  type: FunctionConstructor;
4337
4455
  };
@@ -4358,6 +4476,8 @@ export declare const Components: {
4358
4476
  closeWithCancel: boolean;
4359
4477
  okText: string | boolean;
4360
4478
  cancelText: string | boolean;
4479
+ okDisabled: boolean;
4480
+ cancelDisabled: boolean;
4361
4481
  escClosable: boolean;
4362
4482
  draggable: boolean;
4363
4483
  }>;
@@ -4434,6 +4554,14 @@ export declare const Components: {
4434
4554
  type: BooleanConstructor;
4435
4555
  default: boolean;
4436
4556
  };
4557
+ okDisabled: {
4558
+ type: BooleanConstructor;
4559
+ default: boolean;
4560
+ };
4561
+ cancelDisabled: {
4562
+ type: BooleanConstructor;
4563
+ default: boolean;
4564
+ };
4437
4565
  onOk: {
4438
4566
  type: FunctionConstructor;
4439
4567
  };
@@ -4460,6 +4588,8 @@ export declare const Components: {
4460
4588
  closeWithCancel: boolean;
4461
4589
  okText: string | boolean;
4462
4590
  cancelText: string | boolean;
4591
+ okDisabled: boolean;
4592
+ cancelDisabled: boolean;
4463
4593
  escClosable: boolean;
4464
4594
  draggable: boolean;
4465
4595
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
@@ -4477,6 +4607,8 @@ export declare const Components: {
4477
4607
  closeWithCancel: boolean;
4478
4608
  okText: string | boolean;
4479
4609
  cancelText: string | boolean;
4610
+ okDisabled: boolean;
4611
+ cancelDisabled: boolean;
4480
4612
  escClosable: boolean;
4481
4613
  draggable: boolean;
4482
4614
  } & {
@@ -4503,6 +4635,8 @@ export declare const Components: {
4503
4635
  closeWithCancel: boolean;
4504
4636
  okText: string | boolean;
4505
4637
  cancelText: string | boolean;
4638
+ okDisabled: boolean;
4639
+ cancelDisabled: boolean;
4506
4640
  escClosable: boolean;
4507
4641
  draggable: boolean;
4508
4642
  } & {
@@ -4529,6 +4663,8 @@ export declare const Components: {
4529
4663
  closeWithCancel: boolean;
4530
4664
  okText: string | boolean;
4531
4665
  cancelText: string | boolean;
4666
+ okDisabled: boolean;
4667
+ cancelDisabled: boolean;
4532
4668
  escClosable: boolean;
4533
4669
  draggable: boolean;
4534
4670
  } & {
@@ -4555,6 +4691,8 @@ export declare const Components: {
4555
4691
  closeWithCancel: boolean;
4556
4692
  okText: string | boolean;
4557
4693
  cancelText: string | boolean;
4694
+ okDisabled: boolean;
4695
+ cancelDisabled: boolean;
4558
4696
  escClosable: boolean;
4559
4697
  draggable: boolean;
4560
4698
  } & {
@@ -4640,6 +4778,14 @@ export declare const Components: {
4640
4778
  type: BooleanConstructor;
4641
4779
  default: boolean;
4642
4780
  };
4781
+ okDisabled: {
4782
+ type: BooleanConstructor;
4783
+ default: boolean;
4784
+ };
4785
+ cancelDisabled: {
4786
+ type: BooleanConstructor;
4787
+ default: boolean;
4788
+ };
4643
4789
  onOk: {
4644
4790
  type: FunctionConstructor;
4645
4791
  };
@@ -4716,6 +4862,14 @@ export declare const Components: {
4716
4862
  type: BooleanConstructor;
4717
4863
  default: boolean;
4718
4864
  };
4865
+ okDisabled: {
4866
+ type: BooleanConstructor;
4867
+ default: boolean;
4868
+ };
4869
+ cancelDisabled: {
4870
+ type: BooleanConstructor;
4871
+ default: boolean;
4872
+ };
4719
4873
  onOk: {
4720
4874
  type: FunctionConstructor;
4721
4875
  };
@@ -4742,6 +4896,8 @@ export declare const Components: {
4742
4896
  closeWithCancel: boolean;
4743
4897
  okText: string | boolean;
4744
4898
  cancelText: string | boolean;
4899
+ okDisabled: boolean;
4900
+ cancelDisabled: boolean;
4745
4901
  escClosable: boolean;
4746
4902
  draggable: boolean;
4747
4903
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -32206,6 +32206,14 @@ var Vc = (function (exports, vue) {
32206
32206
  type: [String, Boolean],
32207
32207
  default: "取消"
32208
32208
  },
32209
+ okDisabled: {
32210
+ type: Boolean,
32211
+ default: false
32212
+ },
32213
+ cancelDisabled: {
32214
+ type: Boolean,
32215
+ default: false
32216
+ },
32209
32217
  footer: {
32210
32218
  type: Boolean,
32211
32219
  default: true
@@ -32341,11 +32349,13 @@ var Vc = (function (exports, vue) {
32341
32349
  "class": ["vc-drawer__footer"]
32342
32350
  }, [slots["footer-extra"]?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props2.cancelText && vue.createVNode(Button, {
32343
32351
  "style": "margin-right: 8px;",
32352
+ "disabled": props2.cancelDisabled,
32344
32353
  "onClick": (e) => handleBefore(e, handleCancel)
32345
32354
  }, {
32346
32355
  default: () => [props2.cancelText]
32347
32356
  }), props2.okText && vue.createVNode(Button, {
32348
32357
  "type": "primary",
32358
+ "disabled": props2.okDisabled,
32349
32359
  "onClick": (e) => handleBefore(e, handleOk)
32350
32360
  }, {
32351
32361
  default: () => [props2.okText]
@@ -33909,6 +33919,14 @@ var Vc = (function (exports, vue) {
33909
33919
  type: Boolean,
33910
33920
  default: false
33911
33921
  },
33922
+ okDisabled: {
33923
+ type: Boolean,
33924
+ default: false
33925
+ },
33926
+ cancelDisabled: {
33927
+ type: Boolean,
33928
+ default: false
33929
+ },
33912
33930
  /**
33913
33931
  * 兼容portal设计, 实现Promise方式
33914
33932
  */
@@ -34209,11 +34227,13 @@ var Vc = (function (exports, vue) {
34209
34227
  }, "vc-modal__footer"]
34210
34228
  }, [slots["footer-extra"]?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props2.cancelText && vue.createVNode(Button, {
34211
34229
  "style": "margin-right: 8px;",
34230
+ "disabled": props2.cancelDisabled,
34212
34231
  "onClick": (e) => handleBefore(e, handleCancel)
34213
34232
  }, {
34214
34233
  default: () => [props2.cancelText]
34215
34234
  }), props2.okText && vue.createVNode(Button, {
34216
34235
  "type": "primary",
34236
+ "disabled": props2.okDisabled,
34217
34237
  "onClick": (e) => handleBefore(e, handleOk)
34218
34238
  }, {
34219
34239
  default: () => [props2.okText]
@@ -36459,12 +36479,19 @@ var Vc = (function (exports, vue) {
36459
36479
  const refreshItemSize = (index) => {
36460
36480
  const current = props2.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
36461
36481
  if (!current) return;
36482
+ const oldSize = current.size;
36462
36483
  const dom = preloads.value[index] || curloads.value[props2.inverted ? index : index - firstItemIndex.value];
36463
36484
  if (dom) {
36464
36485
  current.size = dom[K.offsetSize] || placeholderSize.value;
36465
36486
  } else if (current) {
36466
36487
  current.size = placeholderSize.value;
36467
36488
  }
36489
+ if (oldSize !== current.size) {
36490
+ emit("row-resize", {
36491
+ index: current.id,
36492
+ size: current.size
36493
+ });
36494
+ }
36468
36495
  };
36469
36496
  const refreshItemPosition = () => {
36470
36497
  const sizes = Array.from({
@@ -36673,13 +36700,6 @@ var Vc = (function (exports, vue) {
36673
36700
  leading: false,
36674
36701
  trailing: true
36675
36702
  });
36676
- const handleRowChange = (e, row) => {
36677
- emit("row-resize", {
36678
- index: row.id,
36679
- height: e.height,
36680
- width: e.width
36681
- });
36682
- };
36683
36703
  const setDataSource = async (v, oldV) => {
36684
36704
  if (!Array.isArray(v) || oldV === v) return;
36685
36705
  if (props2.data.length % props2.pageSize > 0) {
@@ -36806,8 +36826,7 @@ var Vc = (function (exports, vue) {
36806
36826
  "data-column": item.column,
36807
36827
  "data-size": item.size,
36808
36828
  "data-position": item.position,
36809
- "onResize": handleResize,
36810
- "onChange": (e) => handleRowChange(e, item)
36829
+ "onResize": handleResize
36811
36830
  }, {
36812
36831
  default: () => [slots.default?.({
36813
36832
  row: item.data || {},
@@ -38157,8 +38176,7 @@ var Vc = (function (exports, vue) {
38157
38176
  const handleResize = (e, index) => {
38158
38177
  emit("row-resize", {
38159
38178
  index,
38160
- height: e.height,
38161
- width: e.width
38179
+ size: e.height
38162
38180
  });
38163
38181
  };
38164
38182
  return () => {
@@ -38419,7 +38437,9 @@ var Vc = (function (exports, vue) {
38419
38437
  const handleMergeRowResize = (v) => {
38420
38438
  if (table.props.rowHeight) return;
38421
38439
  states.list[v.index].rows.forEach((row) => {
38422
- row.heightMap[props2.fixed || "main"] = v.height;
38440
+ const old = row.heightMap[props2.fixed || "main"];
38441
+ if (old === v.size) return;
38442
+ row.heightMap[props2.fixed || "main"] = v.size;
38423
38443
  const heights = [row.heightMap.main];
38424
38444
  if (states.leftFixedCount) {
38425
38445
  heights.push(row.heightMap.left);
@@ -38741,7 +38761,7 @@ var Vc = (function (exports, vue) {
38741
38761
  "class": [
38742
38762
  "vc-table__cell",
38743
38763
  // {
38744
- // "highlight": column.filteredValue && column.filteredValue.length > 0
38764
+ // "is-highlight": column.filteredValue && column.filteredValue.length > 0
38745
38765
  // },
38746
38766
  column.labelClass
38747
38767
  ]
@@ -38776,6 +38796,7 @@ var Vc = (function (exports, vue) {
38776
38796
  border: Boolean
38777
38797
  },
38778
38798
  setup(props2) {
38799
+ vue.inject("vc-table");
38779
38800
  const states = useStates({
38780
38801
  data: "data",
38781
38802
  columns: "columns",
@@ -38869,7 +38890,8 @@ var Vc = (function (exports, vue) {
38869
38890
  "key": columnIndex,
38870
38891
  "class": [getRowClasses(column, columnIndex), "vc-table__td"],
38871
38892
  "style": [{
38872
- width: `${column.realWidth}px`
38893
+ width: `${column.realWidth}px`,
38894
+ height: `44px`
38873
38895
  }]
38874
38896
  }, [vue.createVNode("div", {
38875
38897
  "class": ["vc-table__cell", column.labelClass]
@@ -38957,7 +38979,7 @@ var Vc = (function (exports, vue) {
38957
38979
  getSpan: Function,
38958
38980
  placeholder: {
38959
38981
  type: [String, Function],
38960
- default: "--"
38982
+ default: "-"
38961
38983
  },
38962
38984
  /**
38963
38985
  * 排序全部交给外部处理,内部不处理数据,只做交互
@@ -39568,7 +39590,7 @@ var Vc = (function (exports, vue) {
39568
39590
  }
39569
39591
  let endIndex = 0;
39570
39592
  hiddenEl$1.innerText = suffix;
39571
- value.split("").forEach((item, i) => {
39593
+ (value || "").split("").forEach((item, i) => {
39572
39594
  let old = hiddenEl$1.innerText;
39573
39595
  old = old.substring(0, old.length - suffix.length);
39574
39596
  hiddenEl$1.innerText = old + item + suffix;
@@ -39616,9 +39638,10 @@ var Vc = (function (exports, vue) {
39616
39638
  emit("clip", endIndex.value);
39617
39639
  };
39618
39640
  const handleResize = props2.resize === true || props2.resize === 0 ? calcPosition : debounce$1(calcPosition, props2.resize || 0);
39641
+ let poper;
39619
39642
  const handleMouseOver = (e) => {
39620
39643
  if (endIndex.value > 0) {
39621
- Popover.open({
39644
+ poper = Popover.open({
39622
39645
  el: document.body,
39623
39646
  name: "vc-text-popover",
39624
39647
  // 确保不重复创建
@@ -39642,6 +39665,7 @@ var Vc = (function (exports, vue) {
39642
39665
  });
39643
39666
  vue.onBeforeUnmount(() => {
39644
39667
  props2.resize !== false && Resize.off(instance.vnode.el, handleResize);
39668
+ poper?.destroy?.();
39645
39669
  });
39646
39670
  const Content = props2.tag;
39647
39671
  return () => {
@@ -39779,7 +39803,7 @@ var Vc = (function (exports, vue) {
39779
39803
  return column.formatter(rowData);
39780
39804
  }
39781
39805
  const line = column.line || VcInstance.options.TableColumn?.line;
39782
- if (line) {
39806
+ if (line && value) {
39783
39807
  const style2 = {
39784
39808
  // 目前左右pading为10
39785
39809
  // TODO: 含有border还要-1
@@ -32209,6 +32209,14 @@
32209
32209
  type: [String, Boolean],
32210
32210
  default: "取消"
32211
32211
  },
32212
+ okDisabled: {
32213
+ type: Boolean,
32214
+ default: false
32215
+ },
32216
+ cancelDisabled: {
32217
+ type: Boolean,
32218
+ default: false
32219
+ },
32212
32220
  footer: {
32213
32221
  type: Boolean,
32214
32222
  default: true
@@ -32344,11 +32352,13 @@
32344
32352
  "class": ["vc-drawer__footer"]
32345
32353
  }, [slots["footer-extra"]?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props2.cancelText && vue.createVNode(Button, {
32346
32354
  "style": "margin-right: 8px;",
32355
+ "disabled": props2.cancelDisabled,
32347
32356
  "onClick": (e) => handleBefore(e, handleCancel)
32348
32357
  }, {
32349
32358
  default: () => [props2.cancelText]
32350
32359
  }), props2.okText && vue.createVNode(Button, {
32351
32360
  "type": "primary",
32361
+ "disabled": props2.okDisabled,
32352
32362
  "onClick": (e) => handleBefore(e, handleOk)
32353
32363
  }, {
32354
32364
  default: () => [props2.okText]
@@ -33912,6 +33922,14 @@
33912
33922
  type: Boolean,
33913
33923
  default: false
33914
33924
  },
33925
+ okDisabled: {
33926
+ type: Boolean,
33927
+ default: false
33928
+ },
33929
+ cancelDisabled: {
33930
+ type: Boolean,
33931
+ default: false
33932
+ },
33915
33933
  /**
33916
33934
  * 兼容portal设计, 实现Promise方式
33917
33935
  */
@@ -34212,11 +34230,13 @@
34212
34230
  }, "vc-modal__footer"]
34213
34231
  }, [slots["footer-extra"]?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props2.cancelText && vue.createVNode(Button, {
34214
34232
  "style": "margin-right: 8px;",
34233
+ "disabled": props2.cancelDisabled,
34215
34234
  "onClick": (e) => handleBefore(e, handleCancel)
34216
34235
  }, {
34217
34236
  default: () => [props2.cancelText]
34218
34237
  }), props2.okText && vue.createVNode(Button, {
34219
34238
  "type": "primary",
34239
+ "disabled": props2.okDisabled,
34220
34240
  "onClick": (e) => handleBefore(e, handleOk)
34221
34241
  }, {
34222
34242
  default: () => [props2.okText]
@@ -36462,12 +36482,19 @@
36462
36482
  const refreshItemSize = (index) => {
36463
36483
  const current = props2.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
36464
36484
  if (!current) return;
36485
+ const oldSize = current.size;
36465
36486
  const dom = preloads.value[index] || curloads.value[props2.inverted ? index : index - firstItemIndex.value];
36466
36487
  if (dom) {
36467
36488
  current.size = dom[K.offsetSize] || placeholderSize.value;
36468
36489
  } else if (current) {
36469
36490
  current.size = placeholderSize.value;
36470
36491
  }
36492
+ if (oldSize !== current.size) {
36493
+ emit("row-resize", {
36494
+ index: current.id,
36495
+ size: current.size
36496
+ });
36497
+ }
36471
36498
  };
36472
36499
  const refreshItemPosition = () => {
36473
36500
  const sizes = Array.from({
@@ -36676,13 +36703,6 @@
36676
36703
  leading: false,
36677
36704
  trailing: true
36678
36705
  });
36679
- const handleRowChange = (e, row) => {
36680
- emit("row-resize", {
36681
- index: row.id,
36682
- height: e.height,
36683
- width: e.width
36684
- });
36685
- };
36686
36706
  const setDataSource = async (v, oldV) => {
36687
36707
  if (!Array.isArray(v) || oldV === v) return;
36688
36708
  if (props2.data.length % props2.pageSize > 0) {
@@ -36809,8 +36829,7 @@
36809
36829
  "data-column": item.column,
36810
36830
  "data-size": item.size,
36811
36831
  "data-position": item.position,
36812
- "onResize": handleResize,
36813
- "onChange": (e) => handleRowChange(e, item)
36832
+ "onResize": handleResize
36814
36833
  }, {
36815
36834
  default: () => [slots.default?.({
36816
36835
  row: item.data || {},
@@ -38160,8 +38179,7 @@
38160
38179
  const handleResize = (e, index) => {
38161
38180
  emit("row-resize", {
38162
38181
  index,
38163
- height: e.height,
38164
- width: e.width
38182
+ size: e.height
38165
38183
  });
38166
38184
  };
38167
38185
  return () => {
@@ -38422,7 +38440,9 @@
38422
38440
  const handleMergeRowResize = (v) => {
38423
38441
  if (table.props.rowHeight) return;
38424
38442
  states.list[v.index].rows.forEach((row) => {
38425
- row.heightMap[props2.fixed || "main"] = v.height;
38443
+ const old = row.heightMap[props2.fixed || "main"];
38444
+ if (old === v.size) return;
38445
+ row.heightMap[props2.fixed || "main"] = v.size;
38426
38446
  const heights = [row.heightMap.main];
38427
38447
  if (states.leftFixedCount) {
38428
38448
  heights.push(row.heightMap.left);
@@ -38744,7 +38764,7 @@
38744
38764
  "class": [
38745
38765
  "vc-table__cell",
38746
38766
  // {
38747
- // "highlight": column.filteredValue && column.filteredValue.length > 0
38767
+ // "is-highlight": column.filteredValue && column.filteredValue.length > 0
38748
38768
  // },
38749
38769
  column.labelClass
38750
38770
  ]
@@ -38779,6 +38799,7 @@
38779
38799
  border: Boolean
38780
38800
  },
38781
38801
  setup(props2) {
38802
+ vue.inject("vc-table");
38782
38803
  const states = useStates({
38783
38804
  data: "data",
38784
38805
  columns: "columns",
@@ -38872,7 +38893,8 @@
38872
38893
  "key": columnIndex,
38873
38894
  "class": [getRowClasses(column, columnIndex), "vc-table__td"],
38874
38895
  "style": [{
38875
- width: `${column.realWidth}px`
38896
+ width: `${column.realWidth}px`,
38897
+ height: `44px`
38876
38898
  }]
38877
38899
  }, [vue.createVNode("div", {
38878
38900
  "class": ["vc-table__cell", column.labelClass]
@@ -38960,7 +38982,7 @@
38960
38982
  getSpan: Function,
38961
38983
  placeholder: {
38962
38984
  type: [String, Function],
38963
- default: "--"
38985
+ default: "-"
38964
38986
  },
38965
38987
  /**
38966
38988
  * 排序全部交给外部处理,内部不处理数据,只做交互
@@ -39571,7 +39593,7 @@
39571
39593
  }
39572
39594
  let endIndex = 0;
39573
39595
  hiddenEl$1.innerText = suffix;
39574
- value.split("").forEach((item, i) => {
39596
+ (value || "").split("").forEach((item, i) => {
39575
39597
  let old = hiddenEl$1.innerText;
39576
39598
  old = old.substring(0, old.length - suffix.length);
39577
39599
  hiddenEl$1.innerText = old + item + suffix;
@@ -39619,9 +39641,10 @@
39619
39641
  emit("clip", endIndex.value);
39620
39642
  };
39621
39643
  const handleResize = props2.resize === true || props2.resize === 0 ? calcPosition : debounce$1(calcPosition, props2.resize || 0);
39644
+ let poper;
39622
39645
  const handleMouseOver = (e) => {
39623
39646
  if (endIndex.value > 0) {
39624
- Popover.open({
39647
+ poper = Popover.open({
39625
39648
  el: document.body,
39626
39649
  name: "vc-text-popover",
39627
39650
  // 确保不重复创建
@@ -39645,6 +39668,7 @@
39645
39668
  });
39646
39669
  vue.onBeforeUnmount(() => {
39647
39670
  props2.resize !== false && Resize.off(instance.vnode.el, handleResize);
39671
+ poper?.destroy?.();
39648
39672
  });
39649
39673
  const Content = props2.tag;
39650
39674
  return () => {
@@ -39782,7 +39806,7 @@
39782
39806
  return column.formatter(rowData);
39783
39807
  }
39784
39808
  const line = column.line || VcInstance.options.TableColumn?.line;
39785
- if (line) {
39809
+ if (line && value) {
39786
39810
  const style2 = {
39787
39811
  // 目前左右pading为10
39788
39812
  // TODO: 含有border还要-1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deot/vc",
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",
@@ -19,9 +19,9 @@
19
19
  "access": "public"
20
20
  },
21
21
  "dependencies": {
22
- "@deot/vc-components": "^1.0.19",
23
- "@deot/vc-hooks": "^1.0.19",
24
- "@deot/vc-shared": "^1.0.19"
22
+ "@deot/vc-components": "^1.0.21",
23
+ "@deot/vc-hooks": "^1.0.21",
24
+ "@deot/vc-shared": "^1.0.21"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "vue": "*"