@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.
package/dist/index.cjs CHANGED
@@ -8542,6 +8542,14 @@ const props$P = {
8542
8542
  type: [String, Boolean],
8543
8543
  default: "取消"
8544
8544
  },
8545
+ okDisabled: {
8546
+ type: Boolean,
8547
+ default: false
8548
+ },
8549
+ cancelDisabled: {
8550
+ type: Boolean,
8551
+ default: false
8552
+ },
8545
8553
  footer: {
8546
8554
  type: Boolean,
8547
8555
  default: true
@@ -8691,11 +8699,13 @@ const DrawerView = /* @__PURE__ */ vue.defineComponent({
8691
8699
  "class": ['vc-drawer__footer']
8692
8700
  }, [slots['footer-extra']?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props.cancelText && vue.createVNode(Button, {
8693
8701
  "style": "margin-right: 8px;",
8702
+ "disabled": props.cancelDisabled,
8694
8703
  "onClick": e => handleBefore(e, handleCancel)
8695
8704
  }, {
8696
8705
  default: () => [props.cancelText]
8697
8706
  }), props.okText && vue.createVNode(Button, {
8698
8707
  "type": "primary",
8708
+ "disabled": props.okDisabled,
8699
8709
  "onClick": e => handleBefore(e, handleOk)
8700
8710
  }, {
8701
8711
  default: () => [props.okText]
@@ -10353,6 +10363,14 @@ const props$z = {
10353
10363
  type: Boolean,
10354
10364
  default: false
10355
10365
  },
10366
+ okDisabled: {
10367
+ type: Boolean,
10368
+ default: false
10369
+ },
10370
+ cancelDisabled: {
10371
+ type: Boolean,
10372
+ default: false
10373
+ },
10356
10374
  /**
10357
10375
  * 兼容portal设计, 实现Promise方式
10358
10376
  */
@@ -10698,11 +10716,13 @@ const ModalView = /* @__PURE__ */ vue.defineComponent({
10698
10716
  }, 'vc-modal__footer']
10699
10717
  }, [slots['footer-extra']?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props.cancelText && vue.createVNode(Button, {
10700
10718
  "style": "margin-right: 8px;",
10719
+ "disabled": props.cancelDisabled,
10701
10720
  "onClick": e => handleBefore(e, handleCancel)
10702
10721
  }, {
10703
10722
  default: () => [props.cancelText]
10704
10723
  }), props.okText && vue.createVNode(Button, {
10705
10724
  "type": "primary",
10725
+ "disabled": props.okDisabled,
10706
10726
  "onClick": e => handleBefore(e, handleOk)
10707
10727
  }, {
10708
10728
  default: () => [props.okText]
@@ -13109,12 +13129,21 @@ const RecycleList = /* @__PURE__ */ vue.defineComponent({
13109
13129
  const current = props.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
13110
13130
  if (!current) return; // 受到`removeUnusedPlaceholders`影响,无效的会被回收
13111
13131
 
13132
+ const oldSize = current.size;
13112
13133
  const dom = preloads.value[index] || curloads.value[props.inverted ? index : index - firstItemIndex.value];
13113
13134
  if (dom) {
13114
13135
  current.size = dom[K.offsetSize] || placeholderSize.value;
13115
13136
  } else if (current) {
13116
13137
  current.size = placeholderSize.value;
13117
13138
  }
13139
+
13140
+ // 这样的考虑欠佳,待优化
13141
+ if (oldSize !== current.size) {
13142
+ emit('row-resize', {
13143
+ index: current.id,
13144
+ size: current.size
13145
+ });
13146
+ }
13118
13147
  };
13119
13148
  const refreshItemPosition = () => {
13120
13149
  const sizes = Array.from({
@@ -13344,13 +13373,6 @@ const RecycleList = /* @__PURE__ */ vue.defineComponent({
13344
13373
  leading: false,
13345
13374
  trailing: true
13346
13375
  });
13347
- const handleRowChange = (e, row) => {
13348
- emit('row-resize', {
13349
- index: row.id,
13350
- height: e.height,
13351
- width: e.width
13352
- });
13353
- };
13354
13376
 
13355
13377
  // 设置初始数据
13356
13378
  const setDataSource = async (v, oldV) => {
@@ -13481,8 +13503,7 @@ const RecycleList = /* @__PURE__ */ vue.defineComponent({
13481
13503
  "data-column": item.column,
13482
13504
  "data-size": item.size,
13483
13505
  "data-position": item.position,
13484
- "onResize": handleResize,
13485
- "onChange": e => handleRowChange(e, item)
13506
+ "onResize": handleResize
13486
13507
  }, {
13487
13508
  default: () => [slots.default?.({
13488
13509
  row: item.data || {},
@@ -14871,8 +14892,7 @@ const NormalList = /* @__PURE__ */ vue.defineComponent({
14871
14892
  const handleResize = (e, index) => {
14872
14893
  emit('row-resize', {
14873
14894
  index,
14874
- height: e.height,
14875
- width: e.width
14895
+ size: e.height
14876
14896
  });
14877
14897
  };
14878
14898
  return () => {
@@ -15134,7 +15154,9 @@ const TableBody = /* @__PURE__ */ vue.defineComponent({
15134
15154
  const handleMergeRowResize = v => {
15135
15155
  if (table.props.rowHeight) return;
15136
15156
  states.list[v.index].rows.forEach(row => {
15137
- row.heightMap[props.fixed || 'main'] = v.height;
15157
+ const old = row.heightMap[props.fixed || 'main'];
15158
+ if (old === v.size) return;
15159
+ row.heightMap[props.fixed || 'main'] = v.size;
15138
15160
  const heights = [row.heightMap.main];
15139
15161
  if (states.leftFixedCount) {
15140
15162
  heights.push(row.heightMap.left);
@@ -15456,7 +15478,7 @@ const TableHeader = /* @__PURE__ */ vue.defineComponent({
15456
15478
  }, [vue.createVNode("div", {
15457
15479
  "class": ['vc-table__cell',
15458
15480
  // {
15459
- // "highlight": column.filteredValue && column.filteredValue.length > 0
15481
+ // "is-highlight": column.filteredValue && column.filteredValue.length > 0
15460
15482
  // },
15461
15483
  column.labelClass]
15462
15484
  }, [column.renderHeader ? column.renderHeader({
@@ -15490,6 +15512,7 @@ const TableFooter = /* @__PURE__ */ vue.defineComponent({
15490
15512
  border: Boolean
15491
15513
  },
15492
15514
  setup(props) {
15515
+ vue.inject('vc-table');
15493
15516
  const states = useStates({
15494
15517
  data: 'data',
15495
15518
  columns: 'columns',
@@ -15583,7 +15606,8 @@ const TableFooter = /* @__PURE__ */ vue.defineComponent({
15583
15606
  "key": columnIndex,
15584
15607
  "class": [getRowClasses(column, columnIndex), 'vc-table__td'],
15585
15608
  "style": [{
15586
- width: `${column.realWidth}px`
15609
+ width: `${column.realWidth}px`,
15610
+ height: `44px`
15587
15611
  }]
15588
15612
  }, [vue.createVNode("div", {
15589
15613
  "class": ['vc-table__cell', column.labelClass]
@@ -15672,7 +15696,7 @@ const props$c = {
15672
15696
  getSpan: Function,
15673
15697
  placeholder: {
15674
15698
  type: [String, Function],
15675
- default: "--"
15699
+ default: "-"
15676
15700
  },
15677
15701
  /**
15678
15702
  * 排序全部交给外部处理,内部不处理数据,只做交互
@@ -16311,7 +16335,7 @@ const getFitIndex = (options = {}) => {
16311
16335
  }
16312
16336
  let endIndex = 0;
16313
16337
  hiddenEl$1.innerText = suffix;
16314
- value.split("").forEach((item, i) => {
16338
+ (value || "").split("").forEach((item, i) => {
16315
16339
  let old = hiddenEl$1.innerText;
16316
16340
  old = old.substring(0, old.length - suffix.length);
16317
16341
  hiddenEl$1.innerText = old + item + suffix;
@@ -16362,9 +16386,10 @@ const Text = /* @__PURE__ */ vue.defineComponent({
16362
16386
  emit('clip', endIndex.value);
16363
16387
  };
16364
16388
  const handleResize = props.resize === true || props.resize === 0 ? calcPosition : lodashEs.debounce(calcPosition, props.resize || 0);
16389
+ let poper;
16365
16390
  const handleMouseOver = e => {
16366
16391
  if (endIndex.value > 0) {
16367
- Popover.open({
16392
+ poper = Popover.open({
16368
16393
  el: document.body,
16369
16394
  name: 'vc-text-popover',
16370
16395
  // 确保不重复创建
@@ -16389,6 +16414,7 @@ const Text = /* @__PURE__ */ vue.defineComponent({
16389
16414
  });
16390
16415
  vue.onBeforeUnmount(() => {
16391
16416
  props.resize !== false && helperResize.Resize.off(instance.vnode.el, handleResize);
16417
+ poper?.destroy?.();
16392
16418
  });
16393
16419
  const Content = props.tag;
16394
16420
  return () => {
@@ -16531,7 +16557,7 @@ const defaultRenderCell = (rowData = {}) => {
16531
16557
  return column.formatter(rowData);
16532
16558
  }
16533
16559
  const line = column.line || VcInstance.options.TableColumn?.line;
16534
- if (line) {
16560
+ if (line && value) {
16535
16561
  const style = {
16536
16562
  // 目前左右pading为10
16537
16563
  // TODO: 含有border还要-1
package/dist/index.d.ts CHANGED
@@ -872,6 +872,14 @@ export declare const Drawer: {
872
872
  type: (StringConstructor | BooleanConstructor)[];
873
873
  default: string;
874
874
  };
875
+ okDisabled: {
876
+ type: BooleanConstructor;
877
+ default: boolean;
878
+ };
879
+ cancelDisabled: {
880
+ type: BooleanConstructor;
881
+ default: boolean;
882
+ };
875
883
  footer: {
876
884
  type: BooleanConstructor;
877
885
  default: boolean;
@@ -899,6 +907,8 @@ export declare const Drawer: {
899
907
  closeWithCancel: boolean;
900
908
  okText: string | boolean;
901
909
  cancelText: string | boolean;
910
+ okDisabled: boolean;
911
+ cancelDisabled: boolean;
902
912
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
903
913
  P: {};
904
914
  B: {};
@@ -955,6 +965,14 @@ export declare const Drawer: {
955
965
  type: (StringConstructor | BooleanConstructor)[];
956
966
  default: string;
957
967
  };
968
+ okDisabled: {
969
+ type: BooleanConstructor;
970
+ default: boolean;
971
+ };
972
+ cancelDisabled: {
973
+ type: BooleanConstructor;
974
+ default: boolean;
975
+ };
958
976
  footer: {
959
977
  type: BooleanConstructor;
960
978
  default: boolean;
@@ -982,6 +1000,8 @@ export declare const Drawer: {
982
1000
  closeWithCancel: boolean;
983
1001
  okText: string | boolean;
984
1002
  cancelText: string | boolean;
1003
+ okDisabled: boolean;
1004
+ cancelDisabled: boolean;
985
1005
  }>;
986
1006
  __isFragment?: never;
987
1007
  __isTeleport?: never;
@@ -1035,6 +1055,14 @@ cancelText: {
1035
1055
  type: (StringConstructor | BooleanConstructor)[];
1036
1056
  default: string;
1037
1057
  };
1058
+ okDisabled: {
1059
+ type: BooleanConstructor;
1060
+ default: boolean;
1061
+ };
1062
+ cancelDisabled: {
1063
+ type: BooleanConstructor;
1064
+ default: boolean;
1065
+ };
1038
1066
  footer: {
1039
1067
  type: BooleanConstructor;
1040
1068
  default: boolean;
@@ -1062,6 +1090,8 @@ scrollable: boolean;
1062
1090
  closeWithCancel: boolean;
1063
1091
  okText: string | boolean;
1064
1092
  cancelText: string | boolean;
1093
+ okDisabled: boolean;
1094
+ cancelDisabled: boolean;
1065
1095
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
1066
1096
  open: (options: Options) => PortalLeaf;
1067
1097
  destroy: () => void;
@@ -1116,6 +1146,14 @@ cancelText: {
1116
1146
  type: (StringConstructor | BooleanConstructor)[];
1117
1147
  default: string;
1118
1148
  };
1149
+ okDisabled: {
1150
+ type: BooleanConstructor;
1151
+ default: boolean;
1152
+ };
1153
+ cancelDisabled: {
1154
+ type: BooleanConstructor;
1155
+ default: boolean;
1156
+ };
1119
1157
  footer: {
1120
1158
  type: BooleanConstructor;
1121
1159
  default: boolean;
@@ -1175,6 +1213,14 @@ cancelText: {
1175
1213
  type: (StringConstructor | BooleanConstructor)[];
1176
1214
  default: string;
1177
1215
  };
1216
+ okDisabled: {
1217
+ type: BooleanConstructor;
1218
+ default: boolean;
1219
+ };
1220
+ cancelDisabled: {
1221
+ type: BooleanConstructor;
1222
+ default: boolean;
1223
+ };
1178
1224
  footer: {
1179
1225
  type: BooleanConstructor;
1180
1226
  default: boolean;
@@ -1202,6 +1248,8 @@ scrollable: boolean;
1202
1248
  closeWithCancel: boolean;
1203
1249
  okText: string | boolean;
1204
1250
  cancelText: string | boolean;
1251
+ okDisabled: boolean;
1252
+ cancelDisabled: boolean;
1205
1253
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
1206
1254
 
1207
1255
  export declare const Dropdown: DefineComponent<ExtractPropTypes< {
@@ -2868,6 +2916,14 @@ export declare const MDrawer: {
2868
2916
  type: (StringConstructor | BooleanConstructor)[];
2869
2917
  default: string;
2870
2918
  };
2919
+ okDisabled: {
2920
+ type: BooleanConstructor;
2921
+ default: boolean;
2922
+ };
2923
+ cancelDisabled: {
2924
+ type: BooleanConstructor;
2925
+ default: boolean;
2926
+ };
2871
2927
  footer: {
2872
2928
  type: BooleanConstructor;
2873
2929
  default: boolean;
@@ -2895,6 +2951,8 @@ export declare const MDrawer: {
2895
2951
  closeWithCancel: boolean;
2896
2952
  okText: string | boolean;
2897
2953
  cancelText: string | boolean;
2954
+ okDisabled: boolean;
2955
+ cancelDisabled: boolean;
2898
2956
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
2899
2957
  P: {};
2900
2958
  B: {};
@@ -2951,6 +3009,14 @@ export declare const MDrawer: {
2951
3009
  type: (StringConstructor | BooleanConstructor)[];
2952
3010
  default: string;
2953
3011
  };
3012
+ okDisabled: {
3013
+ type: BooleanConstructor;
3014
+ default: boolean;
3015
+ };
3016
+ cancelDisabled: {
3017
+ type: BooleanConstructor;
3018
+ default: boolean;
3019
+ };
2954
3020
  footer: {
2955
3021
  type: BooleanConstructor;
2956
3022
  default: boolean;
@@ -2978,6 +3044,8 @@ export declare const MDrawer: {
2978
3044
  closeWithCancel: boolean;
2979
3045
  okText: string | boolean;
2980
3046
  cancelText: string | boolean;
3047
+ okDisabled: boolean;
3048
+ cancelDisabled: boolean;
2981
3049
  }>;
2982
3050
  __isFragment?: never;
2983
3051
  __isTeleport?: never;
@@ -3031,6 +3099,14 @@ cancelText: {
3031
3099
  type: (StringConstructor | BooleanConstructor)[];
3032
3100
  default: string;
3033
3101
  };
3102
+ okDisabled: {
3103
+ type: BooleanConstructor;
3104
+ default: boolean;
3105
+ };
3106
+ cancelDisabled: {
3107
+ type: BooleanConstructor;
3108
+ default: boolean;
3109
+ };
3034
3110
  footer: {
3035
3111
  type: BooleanConstructor;
3036
3112
  default: boolean;
@@ -3058,6 +3134,8 @@ scrollable: boolean;
3058
3134
  closeWithCancel: boolean;
3059
3135
  okText: string | boolean;
3060
3136
  cancelText: string | boolean;
3137
+ okDisabled: boolean;
3138
+ cancelDisabled: boolean;
3061
3139
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
3062
3140
  open: (options: Partial<{
3063
3141
  footer: boolean;
@@ -3072,6 +3150,8 @@ cancelText: string | boolean;
3072
3150
  closeWithCancel: boolean;
3073
3151
  okText: string | boolean;
3074
3152
  cancelText: string | boolean;
3153
+ okDisabled: boolean;
3154
+ cancelDisabled: boolean;
3075
3155
  } & {
3076
3156
  title?: string | undefined;
3077
3157
  onCancel?: Function | undefined;
@@ -3134,6 +3214,14 @@ cancelText: {
3134
3214
  type: (StringConstructor | BooleanConstructor)[];
3135
3215
  default: string;
3136
3216
  };
3217
+ okDisabled: {
3218
+ type: BooleanConstructor;
3219
+ default: boolean;
3220
+ };
3221
+ cancelDisabled: {
3222
+ type: BooleanConstructor;
3223
+ default: boolean;
3224
+ };
3137
3225
  footer: {
3138
3226
  type: BooleanConstructor;
3139
3227
  default: boolean;
@@ -3193,6 +3281,14 @@ cancelText: {
3193
3281
  type: (StringConstructor | BooleanConstructor)[];
3194
3282
  default: string;
3195
3283
  };
3284
+ okDisabled: {
3285
+ type: BooleanConstructor;
3286
+ default: boolean;
3287
+ };
3288
+ cancelDisabled: {
3289
+ type: BooleanConstructor;
3290
+ default: boolean;
3291
+ };
3196
3292
  footer: {
3197
3293
  type: BooleanConstructor;
3198
3294
  default: boolean;
@@ -3220,6 +3316,8 @@ scrollable: boolean;
3220
3316
  closeWithCancel: boolean;
3221
3317
  okText: string | boolean;
3222
3318
  cancelText: string | boolean;
3319
+ okDisabled: boolean;
3320
+ cancelDisabled: boolean;
3223
3321
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
3224
3322
 
3225
3323
  export declare const MDropdown: DefineComponent<ExtractPropTypes< {
@@ -5210,6 +5308,14 @@ export declare const Modal: {
5210
5308
  type: BooleanConstructor;
5211
5309
  default: boolean;
5212
5310
  };
5311
+ okDisabled: {
5312
+ type: BooleanConstructor;
5313
+ default: boolean;
5314
+ };
5315
+ cancelDisabled: {
5316
+ type: BooleanConstructor;
5317
+ default: boolean;
5318
+ };
5213
5319
  onOk: {
5214
5320
  type: FunctionConstructor;
5215
5321
  };
@@ -5236,6 +5342,8 @@ export declare const Modal: {
5236
5342
  closeWithCancel: boolean;
5237
5343
  okText: string | boolean;
5238
5344
  cancelText: string | boolean;
5345
+ okDisabled: boolean;
5346
+ cancelDisabled: boolean;
5239
5347
  escClosable: boolean;
5240
5348
  draggable: boolean;
5241
5349
  }, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
@@ -5315,6 +5423,14 @@ export declare const Modal: {
5315
5423
  type: BooleanConstructor;
5316
5424
  default: boolean;
5317
5425
  };
5426
+ okDisabled: {
5427
+ type: BooleanConstructor;
5428
+ default: boolean;
5429
+ };
5430
+ cancelDisabled: {
5431
+ type: BooleanConstructor;
5432
+ default: boolean;
5433
+ };
5318
5434
  onOk: {
5319
5435
  type: FunctionConstructor;
5320
5436
  };
@@ -5341,6 +5457,8 @@ export declare const Modal: {
5341
5457
  closeWithCancel: boolean;
5342
5458
  okText: string | boolean;
5343
5459
  cancelText: string | boolean;
5460
+ okDisabled: boolean;
5461
+ cancelDisabled: boolean;
5344
5462
  escClosable: boolean;
5345
5463
  draggable: boolean;
5346
5464
  }>;
@@ -5417,6 +5535,14 @@ border: {
5417
5535
  type: BooleanConstructor;
5418
5536
  default: boolean;
5419
5537
  };
5538
+ okDisabled: {
5539
+ type: BooleanConstructor;
5540
+ default: boolean;
5541
+ };
5542
+ cancelDisabled: {
5543
+ type: BooleanConstructor;
5544
+ default: boolean;
5545
+ };
5420
5546
  onOk: {
5421
5547
  type: FunctionConstructor;
5422
5548
  };
@@ -5443,6 +5569,8 @@ scrollable: boolean;
5443
5569
  closeWithCancel: boolean;
5444
5570
  okText: string | boolean;
5445
5571
  cancelText: string | boolean;
5572
+ okDisabled: boolean;
5573
+ cancelDisabled: boolean;
5446
5574
  escClosable: boolean;
5447
5575
  draggable: boolean;
5448
5576
  }, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & VNodeProps & AllowedComponentProps & ComponentCustomProps & {
@@ -5523,6 +5651,14 @@ border: {
5523
5651
  type: BooleanConstructor;
5524
5652
  default: boolean;
5525
5653
  };
5654
+ okDisabled: {
5655
+ type: BooleanConstructor;
5656
+ default: boolean;
5657
+ };
5658
+ cancelDisabled: {
5659
+ type: BooleanConstructor;
5660
+ default: boolean;
5661
+ };
5526
5662
  onOk: {
5527
5663
  type: FunctionConstructor;
5528
5664
  };
@@ -5599,6 +5735,14 @@ border: {
5599
5735
  type: BooleanConstructor;
5600
5736
  default: boolean;
5601
5737
  };
5738
+ okDisabled: {
5739
+ type: BooleanConstructor;
5740
+ default: boolean;
5741
+ };
5742
+ cancelDisabled: {
5743
+ type: BooleanConstructor;
5744
+ default: boolean;
5745
+ };
5602
5746
  onOk: {
5603
5747
  type: FunctionConstructor;
5604
5748
  };
@@ -5625,6 +5769,8 @@ scrollable: boolean;
5625
5769
  closeWithCancel: boolean;
5626
5770
  okText: string | boolean;
5627
5771
  cancelText: string | boolean;
5772
+ okDisabled: boolean;
5773
+ cancelDisabled: boolean;
5628
5774
  escClosable: boolean;
5629
5775
  draggable: boolean;
5630
5776
  }, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
@@ -9367,6 +9513,14 @@ declare const props_2: {
9367
9513
  type: (StringConstructor | BooleanConstructor)[];
9368
9514
  default: string;
9369
9515
  };
9516
+ okDisabled: {
9517
+ type: BooleanConstructor;
9518
+ default: boolean;
9519
+ };
9520
+ cancelDisabled: {
9521
+ type: BooleanConstructor;
9522
+ default: boolean;
9523
+ };
9370
9524
  footer: {
9371
9525
  type: BooleanConstructor;
9372
9526
  default: boolean;
@@ -9525,6 +9679,14 @@ declare const props_5: {
9525
9679
  type: BooleanConstructor;
9526
9680
  default: boolean;
9527
9681
  };
9682
+ okDisabled: {
9683
+ type: BooleanConstructor;
9684
+ default: boolean;
9685
+ };
9686
+ cancelDisabled: {
9687
+ type: BooleanConstructor;
9688
+ default: boolean;
9689
+ };
9528
9690
  onOk: {
9529
9691
  type: FunctionConstructor;
9530
9692
  };