@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 +44 -18
- package/dist/index.d.ts +162 -0
- package/dist/index.iife.js +44 -18
- package/dist/index.js +44 -18
- package/dist/index.style.css +1 -1
- package/dist/index.umd.cjs +44 -18
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -14738,6 +14738,14 @@ var VcComponents = (function (exports, vue) {
|
|
|
14738
14738
|
type: [String, Boolean],
|
|
14739
14739
|
default: "取消"
|
|
14740
14740
|
},
|
|
14741
|
+
okDisabled: {
|
|
14742
|
+
type: Boolean,
|
|
14743
|
+
default: false
|
|
14744
|
+
},
|
|
14745
|
+
cancelDisabled: {
|
|
14746
|
+
type: Boolean,
|
|
14747
|
+
default: false
|
|
14748
|
+
},
|
|
14741
14749
|
footer: {
|
|
14742
14750
|
type: Boolean,
|
|
14743
14751
|
default: true
|
|
@@ -14887,11 +14895,13 @@ var VcComponents = (function (exports, vue) {
|
|
|
14887
14895
|
"class": ['vc-drawer__footer']
|
|
14888
14896
|
}, [slots['footer-extra']?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props.cancelText && vue.createVNode(Button, {
|
|
14889
14897
|
"style": "margin-right: 8px;",
|
|
14898
|
+
"disabled": props.cancelDisabled,
|
|
14890
14899
|
"onClick": e => handleBefore(e, handleCancel)
|
|
14891
14900
|
}, {
|
|
14892
14901
|
default: () => [props.cancelText]
|
|
14893
14902
|
}), props.okText && vue.createVNode(Button, {
|
|
14894
14903
|
"type": "primary",
|
|
14904
|
+
"disabled": props.okDisabled,
|
|
14895
14905
|
"onClick": e => handleBefore(e, handleOk)
|
|
14896
14906
|
}, {
|
|
14897
14907
|
default: () => [props.okText]
|
|
@@ -17102,6 +17112,14 @@ var VcComponents = (function (exports, vue) {
|
|
|
17102
17112
|
type: Boolean,
|
|
17103
17113
|
default: false
|
|
17104
17114
|
},
|
|
17115
|
+
okDisabled: {
|
|
17116
|
+
type: Boolean,
|
|
17117
|
+
default: false
|
|
17118
|
+
},
|
|
17119
|
+
cancelDisabled: {
|
|
17120
|
+
type: Boolean,
|
|
17121
|
+
default: false
|
|
17122
|
+
},
|
|
17105
17123
|
/**
|
|
17106
17124
|
* 兼容portal设计, 实现Promise方式
|
|
17107
17125
|
*/
|
|
@@ -17447,11 +17465,13 @@ var VcComponents = (function (exports, vue) {
|
|
|
17447
17465
|
}, 'vc-modal__footer']
|
|
17448
17466
|
}, [slots['footer-extra']?.(), !slots.footer ? vue.createVNode(vue.Fragment, null, [props.cancelText && vue.createVNode(Button, {
|
|
17449
17467
|
"style": "margin-right: 8px;",
|
|
17468
|
+
"disabled": props.cancelDisabled,
|
|
17450
17469
|
"onClick": e => handleBefore(e, handleCancel)
|
|
17451
17470
|
}, {
|
|
17452
17471
|
default: () => [props.cancelText]
|
|
17453
17472
|
}), props.okText && vue.createVNode(Button, {
|
|
17454
17473
|
"type": "primary",
|
|
17474
|
+
"disabled": props.okDisabled,
|
|
17455
17475
|
"onClick": e => handleBefore(e, handleOk)
|
|
17456
17476
|
}, {
|
|
17457
17477
|
default: () => [props.okText]
|
|
@@ -19972,12 +19992,21 @@ var VcComponents = (function (exports, vue) {
|
|
|
19972
19992
|
const current = props.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
|
|
19973
19993
|
if (!current) return; // 受到`removeUnusedPlaceholders`影响,无效的会被回收
|
|
19974
19994
|
|
|
19995
|
+
const oldSize = current.size;
|
|
19975
19996
|
const dom = preloads.value[index] || curloads.value[props.inverted ? index : index - firstItemIndex.value];
|
|
19976
19997
|
if (dom) {
|
|
19977
19998
|
current.size = dom[K.offsetSize] || placeholderSize.value;
|
|
19978
19999
|
} else if (current) {
|
|
19979
20000
|
current.size = placeholderSize.value;
|
|
19980
20001
|
}
|
|
20002
|
+
|
|
20003
|
+
// 这样的考虑欠佳,待优化
|
|
20004
|
+
if (oldSize !== current.size) {
|
|
20005
|
+
emit('row-resize', {
|
|
20006
|
+
index: current.id,
|
|
20007
|
+
size: current.size
|
|
20008
|
+
});
|
|
20009
|
+
}
|
|
19981
20010
|
};
|
|
19982
20011
|
const refreshItemPosition = () => {
|
|
19983
20012
|
const sizes = Array.from({
|
|
@@ -20207,13 +20236,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
20207
20236
|
leading: false,
|
|
20208
20237
|
trailing: true
|
|
20209
20238
|
});
|
|
20210
|
-
const handleRowChange = (e, row) => {
|
|
20211
|
-
emit('row-resize', {
|
|
20212
|
-
index: row.id,
|
|
20213
|
-
height: e.height,
|
|
20214
|
-
width: e.width
|
|
20215
|
-
});
|
|
20216
|
-
};
|
|
20217
20239
|
|
|
20218
20240
|
// 设置初始数据
|
|
20219
20241
|
const setDataSource = async (v, oldV) => {
|
|
@@ -20344,8 +20366,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
20344
20366
|
"data-column": item.column,
|
|
20345
20367
|
"data-size": item.size,
|
|
20346
20368
|
"data-position": item.position,
|
|
20347
|
-
"onResize": handleResize
|
|
20348
|
-
"onChange": e => handleRowChange(e, item)
|
|
20369
|
+
"onResize": handleResize
|
|
20349
20370
|
}, {
|
|
20350
20371
|
default: () => [slots.default?.({
|
|
20351
20372
|
row: item.data || {},
|
|
@@ -38945,8 +38966,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
38945
38966
|
const handleResize = (e, index) => {
|
|
38946
38967
|
emit('row-resize', {
|
|
38947
38968
|
index,
|
|
38948
|
-
|
|
38949
|
-
width: e.width
|
|
38969
|
+
size: e.height
|
|
38950
38970
|
});
|
|
38951
38971
|
};
|
|
38952
38972
|
return () => {
|
|
@@ -39208,7 +39228,9 @@ var VcComponents = (function (exports, vue) {
|
|
|
39208
39228
|
const handleMergeRowResize = v => {
|
|
39209
39229
|
if (table.props.rowHeight) return;
|
|
39210
39230
|
states.list[v.index].rows.forEach(row => {
|
|
39211
|
-
row.heightMap[props.fixed || 'main']
|
|
39231
|
+
const old = row.heightMap[props.fixed || 'main'];
|
|
39232
|
+
if (old === v.size) return;
|
|
39233
|
+
row.heightMap[props.fixed || 'main'] = v.size;
|
|
39212
39234
|
const heights = [row.heightMap.main];
|
|
39213
39235
|
if (states.leftFixedCount) {
|
|
39214
39236
|
heights.push(row.heightMap.left);
|
|
@@ -39530,7 +39552,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
39530
39552
|
}, [vue.createVNode("div", {
|
|
39531
39553
|
"class": ['vc-table__cell',
|
|
39532
39554
|
// {
|
|
39533
|
-
// "highlight": column.filteredValue && column.filteredValue.length > 0
|
|
39555
|
+
// "is-highlight": column.filteredValue && column.filteredValue.length > 0
|
|
39534
39556
|
// },
|
|
39535
39557
|
column.labelClass]
|
|
39536
39558
|
}, [column.renderHeader ? column.renderHeader({
|
|
@@ -39564,6 +39586,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
39564
39586
|
border: Boolean
|
|
39565
39587
|
},
|
|
39566
39588
|
setup(props) {
|
|
39589
|
+
vue.inject('vc-table');
|
|
39567
39590
|
const states = useStates({
|
|
39568
39591
|
data: 'data',
|
|
39569
39592
|
columns: 'columns',
|
|
@@ -39657,7 +39680,8 @@ var VcComponents = (function (exports, vue) {
|
|
|
39657
39680
|
"key": columnIndex,
|
|
39658
39681
|
"class": [getRowClasses(column, columnIndex), 'vc-table__td'],
|
|
39659
39682
|
"style": [{
|
|
39660
|
-
width: `${column.realWidth}px
|
|
39683
|
+
width: `${column.realWidth}px`,
|
|
39684
|
+
height: `44px`
|
|
39661
39685
|
}]
|
|
39662
39686
|
}, [vue.createVNode("div", {
|
|
39663
39687
|
"class": ['vc-table__cell', column.labelClass]
|
|
@@ -39746,7 +39770,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
39746
39770
|
getSpan: Function,
|
|
39747
39771
|
placeholder: {
|
|
39748
39772
|
type: [String, Function],
|
|
39749
|
-
default: "
|
|
39773
|
+
default: "-"
|
|
39750
39774
|
},
|
|
39751
39775
|
/**
|
|
39752
39776
|
* 排序全部交给外部处理,内部不处理数据,只做交互
|
|
@@ -40385,7 +40409,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
40385
40409
|
}
|
|
40386
40410
|
let endIndex = 0;
|
|
40387
40411
|
hiddenEl$1.innerText = suffix;
|
|
40388
|
-
value.split("").forEach((item, i) => {
|
|
40412
|
+
(value || "").split("").forEach((item, i) => {
|
|
40389
40413
|
let old = hiddenEl$1.innerText;
|
|
40390
40414
|
old = old.substring(0, old.length - suffix.length);
|
|
40391
40415
|
hiddenEl$1.innerText = old + item + suffix;
|
|
@@ -40436,9 +40460,10 @@ var VcComponents = (function (exports, vue) {
|
|
|
40436
40460
|
emit('clip', endIndex.value);
|
|
40437
40461
|
};
|
|
40438
40462
|
const handleResize = props.resize === true || props.resize === 0 ? calcPosition : debounce$1(calcPosition, props.resize || 0);
|
|
40463
|
+
let poper;
|
|
40439
40464
|
const handleMouseOver = e => {
|
|
40440
40465
|
if (endIndex.value > 0) {
|
|
40441
|
-
Popover.open({
|
|
40466
|
+
poper = Popover.open({
|
|
40442
40467
|
el: document.body,
|
|
40443
40468
|
name: 'vc-text-popover',
|
|
40444
40469
|
// 确保不重复创建
|
|
@@ -40463,6 +40488,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
40463
40488
|
});
|
|
40464
40489
|
vue.onBeforeUnmount(() => {
|
|
40465
40490
|
props.resize !== false && Resize.off(instance.vnode.el, handleResize);
|
|
40491
|
+
poper?.destroy?.();
|
|
40466
40492
|
});
|
|
40467
40493
|
const Content = props.tag;
|
|
40468
40494
|
return () => {
|
|
@@ -40605,7 +40631,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
40605
40631
|
return column.formatter(rowData);
|
|
40606
40632
|
}
|
|
40607
40633
|
const line = column.line || VcInstance.options.TableColumn?.line;
|
|
40608
|
-
if (line) {
|
|
40634
|
+
if (line && value) {
|
|
40609
40635
|
const style = {
|
|
40610
40636
|
// 目前左右pading为10
|
|
40611
40637
|
// TODO: 含有border还要-1
|
package/dist/index.js
CHANGED
|
@@ -8520,6 +8520,14 @@ const props$P = {
|
|
|
8520
8520
|
type: [String, Boolean],
|
|
8521
8521
|
default: "取消"
|
|
8522
8522
|
},
|
|
8523
|
+
okDisabled: {
|
|
8524
|
+
type: Boolean,
|
|
8525
|
+
default: false
|
|
8526
|
+
},
|
|
8527
|
+
cancelDisabled: {
|
|
8528
|
+
type: Boolean,
|
|
8529
|
+
default: false
|
|
8530
|
+
},
|
|
8523
8531
|
footer: {
|
|
8524
8532
|
type: Boolean,
|
|
8525
8533
|
default: true
|
|
@@ -8669,11 +8677,13 @@ const DrawerView = /* @__PURE__ */ defineComponent({
|
|
|
8669
8677
|
"class": ['vc-drawer__footer']
|
|
8670
8678
|
}, [slots['footer-extra']?.(), !slots.footer ? createVNode(Fragment$1, null, [props.cancelText && createVNode(Button, {
|
|
8671
8679
|
"style": "margin-right: 8px;",
|
|
8680
|
+
"disabled": props.cancelDisabled,
|
|
8672
8681
|
"onClick": e => handleBefore(e, handleCancel)
|
|
8673
8682
|
}, {
|
|
8674
8683
|
default: () => [props.cancelText]
|
|
8675
8684
|
}), props.okText && createVNode(Button, {
|
|
8676
8685
|
"type": "primary",
|
|
8686
|
+
"disabled": props.okDisabled,
|
|
8677
8687
|
"onClick": e => handleBefore(e, handleOk)
|
|
8678
8688
|
}, {
|
|
8679
8689
|
default: () => [props.okText]
|
|
@@ -10331,6 +10341,14 @@ const props$z = {
|
|
|
10331
10341
|
type: Boolean,
|
|
10332
10342
|
default: false
|
|
10333
10343
|
},
|
|
10344
|
+
okDisabled: {
|
|
10345
|
+
type: Boolean,
|
|
10346
|
+
default: false
|
|
10347
|
+
},
|
|
10348
|
+
cancelDisabled: {
|
|
10349
|
+
type: Boolean,
|
|
10350
|
+
default: false
|
|
10351
|
+
},
|
|
10334
10352
|
/**
|
|
10335
10353
|
* 兼容portal设计, 实现Promise方式
|
|
10336
10354
|
*/
|
|
@@ -10676,11 +10694,13 @@ const ModalView = /* @__PURE__ */ defineComponent({
|
|
|
10676
10694
|
}, 'vc-modal__footer']
|
|
10677
10695
|
}, [slots['footer-extra']?.(), !slots.footer ? createVNode(Fragment$1, null, [props.cancelText && createVNode(Button, {
|
|
10678
10696
|
"style": "margin-right: 8px;",
|
|
10697
|
+
"disabled": props.cancelDisabled,
|
|
10679
10698
|
"onClick": e => handleBefore(e, handleCancel)
|
|
10680
10699
|
}, {
|
|
10681
10700
|
default: () => [props.cancelText]
|
|
10682
10701
|
}), props.okText && createVNode(Button, {
|
|
10683
10702
|
"type": "primary",
|
|
10703
|
+
"disabled": props.okDisabled,
|
|
10684
10704
|
"onClick": e => handleBefore(e, handleOk)
|
|
10685
10705
|
}, {
|
|
10686
10706
|
default: () => [props.okText]
|
|
@@ -13087,12 +13107,21 @@ const RecycleList = /* @__PURE__ */ defineComponent({
|
|
|
13087
13107
|
const current = props.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
|
|
13088
13108
|
if (!current) return; // 受到`removeUnusedPlaceholders`影响,无效的会被回收
|
|
13089
13109
|
|
|
13110
|
+
const oldSize = current.size;
|
|
13090
13111
|
const dom = preloads.value[index] || curloads.value[props.inverted ? index : index - firstItemIndex.value];
|
|
13091
13112
|
if (dom) {
|
|
13092
13113
|
current.size = dom[K.offsetSize] || placeholderSize.value;
|
|
13093
13114
|
} else if (current) {
|
|
13094
13115
|
current.size = placeholderSize.value;
|
|
13095
13116
|
}
|
|
13117
|
+
|
|
13118
|
+
// 这样的考虑欠佳,待优化
|
|
13119
|
+
if (oldSize !== current.size) {
|
|
13120
|
+
emit('row-resize', {
|
|
13121
|
+
index: current.id,
|
|
13122
|
+
size: current.size
|
|
13123
|
+
});
|
|
13124
|
+
}
|
|
13096
13125
|
};
|
|
13097
13126
|
const refreshItemPosition = () => {
|
|
13098
13127
|
const sizes = Array.from({
|
|
@@ -13322,13 +13351,6 @@ const RecycleList = /* @__PURE__ */ defineComponent({
|
|
|
13322
13351
|
leading: false,
|
|
13323
13352
|
trailing: true
|
|
13324
13353
|
});
|
|
13325
|
-
const handleRowChange = (e, row) => {
|
|
13326
|
-
emit('row-resize', {
|
|
13327
|
-
index: row.id,
|
|
13328
|
-
height: e.height,
|
|
13329
|
-
width: e.width
|
|
13330
|
-
});
|
|
13331
|
-
};
|
|
13332
13354
|
|
|
13333
13355
|
// 设置初始数据
|
|
13334
13356
|
const setDataSource = async (v, oldV) => {
|
|
@@ -13459,8 +13481,7 @@ const RecycleList = /* @__PURE__ */ defineComponent({
|
|
|
13459
13481
|
"data-column": item.column,
|
|
13460
13482
|
"data-size": item.size,
|
|
13461
13483
|
"data-position": item.position,
|
|
13462
|
-
"onResize": handleResize
|
|
13463
|
-
"onChange": e => handleRowChange(e, item)
|
|
13484
|
+
"onResize": handleResize
|
|
13464
13485
|
}, {
|
|
13465
13486
|
default: () => [slots.default?.({
|
|
13466
13487
|
row: item.data || {},
|
|
@@ -14849,8 +14870,7 @@ const NormalList = /* @__PURE__ */ defineComponent({
|
|
|
14849
14870
|
const handleResize = (e, index) => {
|
|
14850
14871
|
emit('row-resize', {
|
|
14851
14872
|
index,
|
|
14852
|
-
|
|
14853
|
-
width: e.width
|
|
14873
|
+
size: e.height
|
|
14854
14874
|
});
|
|
14855
14875
|
};
|
|
14856
14876
|
return () => {
|
|
@@ -15112,7 +15132,9 @@ const TableBody = /* @__PURE__ */ defineComponent({
|
|
|
15112
15132
|
const handleMergeRowResize = v => {
|
|
15113
15133
|
if (table.props.rowHeight) return;
|
|
15114
15134
|
states.list[v.index].rows.forEach(row => {
|
|
15115
|
-
row.heightMap[props.fixed || 'main']
|
|
15135
|
+
const old = row.heightMap[props.fixed || 'main'];
|
|
15136
|
+
if (old === v.size) return;
|
|
15137
|
+
row.heightMap[props.fixed || 'main'] = v.size;
|
|
15116
15138
|
const heights = [row.heightMap.main];
|
|
15117
15139
|
if (states.leftFixedCount) {
|
|
15118
15140
|
heights.push(row.heightMap.left);
|
|
@@ -15434,7 +15456,7 @@ const TableHeader = /* @__PURE__ */ defineComponent({
|
|
|
15434
15456
|
}, [createVNode("div", {
|
|
15435
15457
|
"class": ['vc-table__cell',
|
|
15436
15458
|
// {
|
|
15437
|
-
// "highlight": column.filteredValue && column.filteredValue.length > 0
|
|
15459
|
+
// "is-highlight": column.filteredValue && column.filteredValue.length > 0
|
|
15438
15460
|
// },
|
|
15439
15461
|
column.labelClass]
|
|
15440
15462
|
}, [column.renderHeader ? column.renderHeader({
|
|
@@ -15468,6 +15490,7 @@ const TableFooter = /* @__PURE__ */ defineComponent({
|
|
|
15468
15490
|
border: Boolean
|
|
15469
15491
|
},
|
|
15470
15492
|
setup(props) {
|
|
15493
|
+
inject('vc-table');
|
|
15471
15494
|
const states = useStates({
|
|
15472
15495
|
data: 'data',
|
|
15473
15496
|
columns: 'columns',
|
|
@@ -15561,7 +15584,8 @@ const TableFooter = /* @__PURE__ */ defineComponent({
|
|
|
15561
15584
|
"key": columnIndex,
|
|
15562
15585
|
"class": [getRowClasses(column, columnIndex), 'vc-table__td'],
|
|
15563
15586
|
"style": [{
|
|
15564
|
-
width: `${column.realWidth}px
|
|
15587
|
+
width: `${column.realWidth}px`,
|
|
15588
|
+
height: `44px`
|
|
15565
15589
|
}]
|
|
15566
15590
|
}, [createVNode("div", {
|
|
15567
15591
|
"class": ['vc-table__cell', column.labelClass]
|
|
@@ -15650,7 +15674,7 @@ const props$c = {
|
|
|
15650
15674
|
getSpan: Function,
|
|
15651
15675
|
placeholder: {
|
|
15652
15676
|
type: [String, Function],
|
|
15653
|
-
default: "
|
|
15677
|
+
default: "-"
|
|
15654
15678
|
},
|
|
15655
15679
|
/**
|
|
15656
15680
|
* 排序全部交给外部处理,内部不处理数据,只做交互
|
|
@@ -16289,7 +16313,7 @@ const getFitIndex = (options = {}) => {
|
|
|
16289
16313
|
}
|
|
16290
16314
|
let endIndex = 0;
|
|
16291
16315
|
hiddenEl$1.innerText = suffix;
|
|
16292
|
-
value.split("").forEach((item, i) => {
|
|
16316
|
+
(value || "").split("").forEach((item, i) => {
|
|
16293
16317
|
let old = hiddenEl$1.innerText;
|
|
16294
16318
|
old = old.substring(0, old.length - suffix.length);
|
|
16295
16319
|
hiddenEl$1.innerText = old + item + suffix;
|
|
@@ -16340,9 +16364,10 @@ const Text = /* @__PURE__ */ defineComponent({
|
|
|
16340
16364
|
emit('clip', endIndex.value);
|
|
16341
16365
|
};
|
|
16342
16366
|
const handleResize = props.resize === true || props.resize === 0 ? calcPosition : debounce(calcPosition, props.resize || 0);
|
|
16367
|
+
let poper;
|
|
16343
16368
|
const handleMouseOver = e => {
|
|
16344
16369
|
if (endIndex.value > 0) {
|
|
16345
|
-
Popover.open({
|
|
16370
|
+
poper = Popover.open({
|
|
16346
16371
|
el: document.body,
|
|
16347
16372
|
name: 'vc-text-popover',
|
|
16348
16373
|
// 确保不重复创建
|
|
@@ -16367,6 +16392,7 @@ const Text = /* @__PURE__ */ defineComponent({
|
|
|
16367
16392
|
});
|
|
16368
16393
|
onBeforeUnmount(() => {
|
|
16369
16394
|
props.resize !== false && Resize.off(instance.vnode.el, handleResize);
|
|
16395
|
+
poper?.destroy?.();
|
|
16370
16396
|
});
|
|
16371
16397
|
const Content = props.tag;
|
|
16372
16398
|
return () => {
|
|
@@ -16509,7 +16535,7 @@ const defaultRenderCell = (rowData = {}) => {
|
|
|
16509
16535
|
return column.formatter(rowData);
|
|
16510
16536
|
}
|
|
16511
16537
|
const line = column.line || VcInstance.options.TableColumn?.line;
|
|
16512
|
-
if (line) {
|
|
16538
|
+
if (line && value) {
|
|
16513
16539
|
const style = {
|
|
16514
16540
|
// 目前左右pading为10
|
|
16515
16541
|
// TODO: 含有border还要-1
|