@deot/vc-components 1.0.56 → 1.0.58
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 +63 -60
- package/dist/index.d.ts +6 -6
- package/dist/index.iife.js +63 -61
- package/dist/index.js +63 -60
- package/dist/index.style.css +2 -2
- package/dist/index.umd.cjs +63 -61
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -7,7 +7,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
7
7
|
if (!message || !target) return;
|
|
8
8
|
message = `[@deot/vc - ${target}]: ${message}`;
|
|
9
9
|
this.message = message;
|
|
10
|
-
/* istanbul ignore next -- @preserve */
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
|
|
@@ -607,7 +606,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
607
606
|
const key = `${prefix}${url}`;
|
|
608
607
|
const cache = window.localStorage.getItem(key);
|
|
609
608
|
let icons = JSON.parse(cache || '""');
|
|
610
|
-
/* istanbul ignore next -- @preserve */
|
|
611
609
|
if (!icons) {
|
|
612
610
|
const data = await new Promise((resolve$) => {
|
|
613
611
|
const request = new XMLHttpRequest();
|
|
@@ -642,7 +640,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
642
640
|
});
|
|
643
641
|
resolve();
|
|
644
642
|
} catch (e) {
|
|
645
|
-
/* istanbul ignore next -- @preserve */
|
|
646
643
|
reject(new VcError("icon", e));
|
|
647
644
|
}
|
|
648
645
|
})();
|
|
@@ -654,7 +651,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
654
651
|
const icons = {};
|
|
655
652
|
setTimeout(() => {
|
|
656
653
|
try {
|
|
657
|
-
/* istanbul ignore next -- @preserve */
|
|
658
654
|
IS_DEV && console.time(url);
|
|
659
655
|
svgStr.replace(svgReg, "$1")?.match(symbolReg)?.forEach(
|
|
660
656
|
(i) => i.replace(basicReg, (_, ...args) => {
|
|
@@ -669,23 +665,19 @@ var VcComponents = (function (exports, vue) {
|
|
|
669
665
|
return "";
|
|
670
666
|
})
|
|
671
667
|
);
|
|
672
|
-
/* istanbul ignore next -- @preserve */
|
|
673
668
|
IS_DEV && console.timeEnd(url);
|
|
674
669
|
resolve(icons);
|
|
675
670
|
} catch (e) {
|
|
676
|
-
/* istanbul ignore next -- @preserve */
|
|
677
671
|
reject(new VcError("icon", e));
|
|
678
672
|
}
|
|
679
673
|
}, 0);
|
|
680
674
|
});
|
|
681
675
|
}
|
|
682
676
|
on(type, fn) {
|
|
683
|
-
/* istanbul ignore next -- @preserve */
|
|
684
677
|
if (typeof type !== "string" || typeof fn !== "function") return this;
|
|
685
678
|
this.events[type] = this.events[type] || [];
|
|
686
679
|
if (this.events[type].length >= 100) {
|
|
687
680
|
delete this.events[type];
|
|
688
|
-
/* istanbul ignore else -- @preserve */
|
|
689
681
|
if (!IS_SERVER$2) {
|
|
690
682
|
throw new VcError("icon", `${type} nonexistent`);
|
|
691
683
|
}
|
|
@@ -694,7 +686,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
694
686
|
return this;
|
|
695
687
|
}
|
|
696
688
|
off(type, fn) {
|
|
697
|
-
/* istanbul ignore next -- @preserve */
|
|
698
689
|
if (typeof type !== "string" || typeof fn !== "function") return this;
|
|
699
690
|
this.events[type] = this.events[type]?.filter((i) => i != fn);
|
|
700
691
|
return this;
|
|
@@ -958,7 +949,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
958
949
|
const handleBeforeEnter = (el) => {
|
|
959
950
|
const duration = props.duration.enter || props.duration;
|
|
960
951
|
el.style.transition = getTransitionStyle(duration);
|
|
961
|
-
/* istanbul ignore next -- @preserve */
|
|
962
952
|
if (!el.dataset) {
|
|
963
953
|
el.dataset = {};
|
|
964
954
|
}
|
|
@@ -975,7 +965,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
975
965
|
const next = createNext(done, duration);
|
|
976
966
|
try {
|
|
977
967
|
el.dataset.oldOverflow = el.style.overflow;
|
|
978
|
-
/* istanbul ignore next -- @preserve */
|
|
979
968
|
if (el.scrollHeight !== 0) {
|
|
980
969
|
el.style.height = el.scrollHeight + "px";
|
|
981
970
|
el.style.paddingTop = el.dataset.oldPaddingTop + "px";
|
|
@@ -998,7 +987,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
998
987
|
attrs.onAfterEnter?.(el);
|
|
999
988
|
};
|
|
1000
989
|
const handleBeforeLeave = (el) => {
|
|
1001
|
-
/* istanbul ignore next -- @preserve */
|
|
1002
990
|
if (!el.dataset) {
|
|
1003
991
|
el.dataset = {};
|
|
1004
992
|
}
|
|
@@ -1015,7 +1003,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
1015
1003
|
const next = createNext(done, duration);
|
|
1016
1004
|
try {
|
|
1017
1005
|
const leaveDuration = props.duration.leave || props.duration;
|
|
1018
|
-
/* istanbul ignore next -- @preserve */
|
|
1019
1006
|
if (el.scrollHeight !== 0) {
|
|
1020
1007
|
el.style.transition = getTransitionStyle(leaveDuration);
|
|
1021
1008
|
el.style.height = "0px";
|
|
@@ -6805,7 +6792,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
6805
6792
|
() => {
|
|
6806
6793
|
const { wait, exclude, include } = props;
|
|
6807
6794
|
const ons = Object.entries(attrs).reduce((pre, [key, callback]) => {
|
|
6808
|
-
/* istanbul ignore else -- @preserve */
|
|
6809
6795
|
if ((!exclude || !exclude.test(key)) && (!include || include.test(key)) && typeof callback === "function") {
|
|
6810
6796
|
pre[key] = debounce(callback, wait, {
|
|
6811
6797
|
leading: true,
|
|
@@ -7137,7 +7123,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
7137
7123
|
const instance = vue.getCurrentInstance();
|
|
7138
7124
|
const regex = new RegExp(`${componentName}$`);
|
|
7139
7125
|
let parent = instance.parent;
|
|
7140
|
-
/* istanbul ignore next -- @preserve */
|
|
7141
7126
|
while (parent && !(parent?.type?.name && regex.test(parent.type.name)) && (!privateKey || !parent?.[privateKey] || !parent?.proxy?.[privateKey])) {
|
|
7142
7127
|
parent = parent.parent || parent?.type?.parent;
|
|
7143
7128
|
}
|
|
@@ -8451,7 +8436,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
8451
8436
|
}
|
|
8452
8437
|
}
|
|
8453
8438
|
} catch (e) {
|
|
8454
|
-
/* istanbul ignore next -- @preserve */
|
|
8455
8439
|
throw new VcError("instance", e);
|
|
8456
8440
|
}
|
|
8457
8441
|
}
|
|
@@ -8462,7 +8446,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
8462
8446
|
try {
|
|
8463
8447
|
Portal.leafs.forEach((leaf) => leaf.destroy());
|
|
8464
8448
|
} catch (e) {
|
|
8465
|
-
/* istanbul ignore next -- @preserve */
|
|
8466
8449
|
throw new VcError("instance", e);
|
|
8467
8450
|
}
|
|
8468
8451
|
}
|
|
@@ -8535,7 +8518,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
8535
8518
|
return (...args) => {
|
|
8536
8519
|
const done = () => {
|
|
8537
8520
|
const leaf = getLeaf();
|
|
8538
|
-
/* istanbul ignore next -- @preserve */
|
|
8539
8521
|
if (!leaf) {
|
|
8540
8522
|
throw new VcError("portal", "实例不存在或已卸载");
|
|
8541
8523
|
}
|
|
@@ -8586,7 +8568,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
8586
8568
|
if (isDestroyed()) return;
|
|
8587
8569
|
onDestroyed?.(...args);
|
|
8588
8570
|
leaf.app?.unmount();
|
|
8589
|
-
/* istanbul ignore else -- @preserve */
|
|
8590
8571
|
if (useAllNodes) {
|
|
8591
8572
|
root?.contains(container) && root.removeChild(container);
|
|
8592
8573
|
} else if (container && container._children) {
|
|
@@ -8614,16 +8595,13 @@ var VcComponents = (function (exports, vue) {
|
|
|
8614
8595
|
const handleExtra = (e) => {
|
|
8615
8596
|
try {
|
|
8616
8597
|
const path = e.path || composedPath(e);
|
|
8617
|
-
/* istanbul ignore else -- @preserve */
|
|
8618
8598
|
if (container && e.target && !container.contains(e.target) && !path?.some((item) => utils.eleInRegExp(item, aliveRegExp))) {
|
|
8619
|
-
/* istanbul ignore else -- @preserve */
|
|
8620
8599
|
if (leaf.wrapper && leaf.wrapper?.[aliveVisibleKey]) {
|
|
8621
8600
|
typeof leaf.wrapper[aliveVisibleKey] === "function" ? leaf.wrapper[aliveVisibleKey](false) : leaf.wrapper[aliveVisibleKey] = false;
|
|
8622
8601
|
}
|
|
8623
8602
|
leaveDelay ? setTimeout($onDestroyed, leaveDelay) : $onDestroyed();
|
|
8624
8603
|
}
|
|
8625
8604
|
} catch (error) {
|
|
8626
|
-
/* istanbul ignore next -- @preserve */
|
|
8627
8605
|
throw new VcError("portal", error);
|
|
8628
8606
|
}
|
|
8629
8607
|
};
|
|
@@ -9725,7 +9703,8 @@ var VcComponents = (function (exports, vue) {
|
|
|
9725
9703
|
emits: [...EVENTS$1, 'ready'],
|
|
9726
9704
|
setup(props, {
|
|
9727
9705
|
emit,
|
|
9728
|
-
slots
|
|
9706
|
+
slots,
|
|
9707
|
+
expose
|
|
9729
9708
|
}) {
|
|
9730
9709
|
const instance = vue.getCurrentInstance();
|
|
9731
9710
|
const chart = vue.shallowRef(null);
|
|
@@ -9824,6 +9803,10 @@ var VcComponents = (function (exports, vue) {
|
|
|
9824
9803
|
}
|
|
9825
9804
|
});
|
|
9826
9805
|
});
|
|
9806
|
+
expose({
|
|
9807
|
+
chart,
|
|
9808
|
+
refresh
|
|
9809
|
+
});
|
|
9827
9810
|
vue.onUnmounted(destroy);
|
|
9828
9811
|
return () => {
|
|
9829
9812
|
return vue.createVNode("div", {
|
|
@@ -16470,7 +16453,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
16470
16453
|
}) {
|
|
16471
16454
|
const owner = getInstance$1('dropdown', 'dropdownId');
|
|
16472
16455
|
const currentValue = vue.computed(() => {
|
|
16473
|
-
const v = typeof props.value === 'undefined'
|
|
16456
|
+
const v = typeof props.value === 'undefined' ? props.label : props.value;
|
|
16474
16457
|
return v;
|
|
16475
16458
|
});
|
|
16476
16459
|
const classes = vue.computed(() => {
|
|
@@ -16780,6 +16763,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
16780
16763
|
}
|
|
16781
16764
|
});
|
|
16782
16765
|
};
|
|
16766
|
+
const handlePrevent = e => e.preventDefault();
|
|
16783
16767
|
vue.onMounted(() => {
|
|
16784
16768
|
insertStyle(buttons.value);
|
|
16785
16769
|
});
|
|
@@ -16790,7 +16774,8 @@ var VcComponents = (function (exports, vue) {
|
|
|
16790
16774
|
});
|
|
16791
16775
|
return () => {
|
|
16792
16776
|
return vue.createVNode("div", {
|
|
16793
|
-
"id": props.elementId
|
|
16777
|
+
"id": props.elementId,
|
|
16778
|
+
"onClick": handlePrevent
|
|
16794
16779
|
}, [renderButtonGroup(buttons.value), slots?.extend?.()]);
|
|
16795
16780
|
};
|
|
16796
16781
|
}
|
|
@@ -21932,7 +21917,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
21932
21917
|
default: "div"
|
|
21933
21918
|
},
|
|
21934
21919
|
fill: {
|
|
21935
|
-
type: Boolean,
|
|
21920
|
+
type: [Boolean, Array],
|
|
21936
21921
|
default: true
|
|
21937
21922
|
}
|
|
21938
21923
|
};
|
|
@@ -21946,6 +21931,13 @@ var VcComponents = (function (exports, vue) {
|
|
|
21946
21931
|
const width = vue.ref(0);
|
|
21947
21932
|
const height = vue.ref(0);
|
|
21948
21933
|
const current = vue.ref();
|
|
21934
|
+
const classes = vue.computed(() => {
|
|
21935
|
+
const v = Array.isArray(props.fill) ? props.fill : [props.fill, props.fill];
|
|
21936
|
+
return {
|
|
21937
|
+
"is-fill-width": v[0],
|
|
21938
|
+
"is-fill-height": v[1]
|
|
21939
|
+
};
|
|
21940
|
+
});
|
|
21949
21941
|
const currentExposed = vue.computed(() => {
|
|
21950
21942
|
return {
|
|
21951
21943
|
height: height.value,
|
|
@@ -21996,7 +21988,7 @@ var VcComponents = (function (exports, vue) {
|
|
|
21996
21988
|
props.tag,
|
|
21997
21989
|
{
|
|
21998
21990
|
ref: current,
|
|
21999
|
-
class: ["vc-resizer",
|
|
21991
|
+
class: ["vc-resizer", classes.value]
|
|
22000
21992
|
},
|
|
22001
21993
|
slots.default?.(currentExposed.value)
|
|
22002
21994
|
);
|
|
@@ -25427,26 +25419,22 @@ var VcComponents = (function (exports, vue) {
|
|
|
25427
25419
|
const index$ = rebuildDataIndexMap.value[index];
|
|
25428
25420
|
typeof index$ === 'undefined' ? rebuildData.value.unshift(node) : rebuildData.value[index$] = node;
|
|
25429
25421
|
};
|
|
25430
|
-
// 更新item.size
|
|
25431
25422
|
const refreshItemSize = index => {
|
|
25432
25423
|
const current = props.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
|
|
25433
|
-
if (!current) return; // 受到`removeUnusedPlaceholders`影响,无效的会被回收
|
|
25434
25424
|
|
|
25435
|
-
|
|
25425
|
+
// 受到`removeUnusedPlaceholders`影响,无效的会被回收
|
|
25426
|
+
if (!current) return;
|
|
25427
|
+
const original = Object.assign({}, current);
|
|
25436
25428
|
const dom = preloads.value[index] || curloads.value[props.inverted ? index : index - firstItemIndex.value];
|
|
25437
25429
|
if (dom) {
|
|
25438
25430
|
current.size = dom[K.offsetSize] || placeholderSize.value;
|
|
25439
25431
|
} else if (current) {
|
|
25440
25432
|
current.size = placeholderSize.value;
|
|
25441
25433
|
}
|
|
25442
|
-
|
|
25443
|
-
|
|
25444
|
-
|
|
25445
|
-
|
|
25446
|
-
index: current.id,
|
|
25447
|
-
size: current.size
|
|
25448
|
-
});
|
|
25449
|
-
}
|
|
25434
|
+
return {
|
|
25435
|
+
original,
|
|
25436
|
+
changed: current
|
|
25437
|
+
};
|
|
25450
25438
|
};
|
|
25451
25439
|
const refreshItemPosition = () => {
|
|
25452
25440
|
const sizes = Array.from({
|
|
@@ -25516,18 +25504,24 @@ var VcComponents = (function (exports, vue) {
|
|
|
25516
25504
|
const refreshLayout = async (start, end) => {
|
|
25517
25505
|
isRefreshLayout = 1;
|
|
25518
25506
|
const promiseTasks = [];
|
|
25507
|
+
const resizeChanges = [];
|
|
25519
25508
|
let item;
|
|
25520
25509
|
for (let i = start; i < end; i++) {
|
|
25521
25510
|
item = props.inverted ? rebuildData.value[rebuildDataIndexMap.value[i]] : rebuildData.value[i];
|
|
25522
|
-
if (item && item.loaded)
|
|
25523
|
-
continue;
|
|
25524
|
-
}
|
|
25511
|
+
if (item && item.loaded) continue;
|
|
25525
25512
|
setItemData(i, originalData[i]);
|
|
25526
|
-
promiseTasks.push(vue.nextTick(() =>
|
|
25513
|
+
promiseTasks.push(vue.nextTick(() => {
|
|
25514
|
+
const e = refreshItemSize(i);
|
|
25515
|
+
e && resizeChanges.push(e.changed);
|
|
25516
|
+
}));
|
|
25527
25517
|
}
|
|
25528
25518
|
await Promise.all(promiseTasks);
|
|
25529
25519
|
refreshItemPosition();
|
|
25530
25520
|
setFirstItemIndex();
|
|
25521
|
+
resizeChanges.length > 0 && emit('row-resize', resizeChanges.map(i => ({
|
|
25522
|
+
size: i.size,
|
|
25523
|
+
index: i.id
|
|
25524
|
+
})));
|
|
25531
25525
|
interrupter.next();
|
|
25532
25526
|
isRefreshLayout = 0;
|
|
25533
25527
|
};
|
|
@@ -27242,11 +27236,19 @@ var VcComponents = (function (exports, vue) {
|
|
|
27242
27236
|
emit,
|
|
27243
27237
|
slots
|
|
27244
27238
|
}) {
|
|
27239
|
+
let resizeChanges = [];
|
|
27240
|
+
const emitChanges = () => {
|
|
27241
|
+
if (resizeChanges.length > 0) {
|
|
27242
|
+
emit('row-resize', resizeChanges);
|
|
27243
|
+
resizeChanges = [];
|
|
27244
|
+
}
|
|
27245
|
+
};
|
|
27245
27246
|
const handleResize = (e, index) => {
|
|
27246
|
-
|
|
27247
|
+
resizeChanges.push({
|
|
27247
27248
|
index,
|
|
27248
27249
|
size: e.height
|
|
27249
27250
|
});
|
|
27251
|
+
vue.nextTick(emitChanges);
|
|
27250
27252
|
};
|
|
27251
27253
|
return () => {
|
|
27252
27254
|
return props.data.map((mergeData, index) => {
|
|
@@ -27605,22 +27607,25 @@ var VcComponents = (function (exports, vue) {
|
|
|
27605
27607
|
return renderRow(row, row.index);
|
|
27606
27608
|
})]);
|
|
27607
27609
|
};
|
|
27608
|
-
const handleMergeRowResize =
|
|
27610
|
+
const handleMergeRowResize = changes => {
|
|
27609
27611
|
if (table.props.rowHeight) return;
|
|
27610
|
-
|
|
27611
|
-
|
|
27612
|
-
|
|
27613
|
-
|
|
27614
|
-
|
|
27615
|
-
|
|
27616
|
-
heights
|
|
27617
|
-
|
|
27618
|
-
|
|
27619
|
-
|
|
27620
|
-
|
|
27621
|
-
|
|
27622
|
-
|
|
27623
|
-
|
|
27612
|
+
// 批量处理所有尺寸变化
|
|
27613
|
+
changes.forEach(v => {
|
|
27614
|
+
states.list[v.index].rows.forEach(row => {
|
|
27615
|
+
const old = row.heightMap[props.fixed || 'main'];
|
|
27616
|
+
if (old === v.size) return;
|
|
27617
|
+
row.heightMap[props.fixed || 'main'] = v.size;
|
|
27618
|
+
const heights = [row.heightMap.main];
|
|
27619
|
+
if (states.leftFixedCount) {
|
|
27620
|
+
heights.push(row.heightMap.left);
|
|
27621
|
+
}
|
|
27622
|
+
if (states.rightFixedCount) {
|
|
27623
|
+
heights.push(row.heightMap.right);
|
|
27624
|
+
}
|
|
27625
|
+
if (heights.every(i => !!i)) {
|
|
27626
|
+
row.height = Math.max(row.heightMap.left, row.heightMap.main, row.heightMap.right) || '';
|
|
27627
|
+
}
|
|
27628
|
+
});
|
|
27624
27629
|
});
|
|
27625
27630
|
};
|
|
27626
27631
|
expose({
|
|
@@ -30566,7 +30571,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
30566
30571
|
setup(props, { slots }) {
|
|
30567
30572
|
const themeId = getUid("vc-theme");
|
|
30568
30573
|
const setVar = (name) => {
|
|
30569
|
-
/* istanbul ignore next -- @preserve */
|
|
30570
30574
|
if (!name) return "";
|
|
30571
30575
|
const globals = VcInstance.options.Theme?.variables;
|
|
30572
30576
|
return props.variables?.[name] || globals?.[name] || `var(--${name})`;
|
|
@@ -30602,7 +30606,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
30602
30606
|
}
|
|
30603
30607
|
});
|
|
30604
30608
|
const setCss = (attrs) => {
|
|
30605
|
-
/* istanbul ignore next -- @preserve */
|
|
30606
30609
|
if (!attrs || typeof attrs === "string") return attrs;
|
|
30607
30610
|
let content = "";
|
|
30608
30611
|
Object.entries(attrs).forEach(([key, val]) => {
|
|
@@ -30611,7 +30614,6 @@ var VcComponents = (function (exports, vue) {
|
|
|
30611
30614
|
return content;
|
|
30612
30615
|
};
|
|
30613
30616
|
const resetPseudo = () => {
|
|
30614
|
-
/* istanbul ignore next -- @preserve */
|
|
30615
30617
|
if (typeof document === "undefined") return;
|
|
30616
30618
|
const { pseudo } = props;
|
|
30617
30619
|
if (!pseudo) return removeStyle(themeId);
|