@deot/vc 1.0.57 → 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.d.ts +6 -6
- package/dist/index.iife.js +57 -56
- package/dist/index.umd.cjs +57 -56
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -8835,7 +8835,7 @@ export declare const Components: {
|
|
|
8835
8835
|
default: string;
|
|
8836
8836
|
};
|
|
8837
8837
|
fill: {
|
|
8838
|
-
type: BooleanConstructor;
|
|
8838
|
+
type: (BooleanConstructor | ArrayConstructor)[];
|
|
8839
8839
|
default: boolean;
|
|
8840
8840
|
};
|
|
8841
8841
|
}>, () => VNode<RendererNode, RendererElement, {
|
|
@@ -8846,13 +8846,13 @@ export declare const Components: {
|
|
|
8846
8846
|
default: string;
|
|
8847
8847
|
};
|
|
8848
8848
|
fill: {
|
|
8849
|
-
type: BooleanConstructor;
|
|
8849
|
+
type: (BooleanConstructor | ArrayConstructor)[];
|
|
8850
8850
|
default: boolean;
|
|
8851
8851
|
};
|
|
8852
8852
|
}>> & Readonly<{
|
|
8853
8853
|
onResize?: ((...args: any[]) => any) | undefined;
|
|
8854
8854
|
}>, {
|
|
8855
|
-
fill: boolean;
|
|
8855
|
+
fill: boolean | unknown[];
|
|
8856
8856
|
tag: string;
|
|
8857
8857
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
8858
8858
|
MResizer: DefineComponent<ExtractPropTypes< {
|
|
@@ -8861,7 +8861,7 @@ export declare const Components: {
|
|
|
8861
8861
|
default: string;
|
|
8862
8862
|
};
|
|
8863
8863
|
fill: {
|
|
8864
|
-
type: BooleanConstructor;
|
|
8864
|
+
type: (BooleanConstructor | ArrayConstructor)[];
|
|
8865
8865
|
default: boolean;
|
|
8866
8866
|
};
|
|
8867
8867
|
}>, () => VNode<RendererNode, RendererElement, {
|
|
@@ -8872,13 +8872,13 @@ export declare const Components: {
|
|
|
8872
8872
|
default: string;
|
|
8873
8873
|
};
|
|
8874
8874
|
fill: {
|
|
8875
|
-
type: BooleanConstructor;
|
|
8875
|
+
type: (BooleanConstructor | ArrayConstructor)[];
|
|
8876
8876
|
default: boolean;
|
|
8877
8877
|
};
|
|
8878
8878
|
}>> & Readonly<{
|
|
8879
8879
|
onResize?: ((...args: any[]) => any) | undefined;
|
|
8880
8880
|
}>, {
|
|
8881
|
-
fill: boolean;
|
|
8881
|
+
fill: boolean | unknown[];
|
|
8882
8882
|
tag: string;
|
|
8883
8883
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
8884
8884
|
Scroller: DefineComponent<ExtractPropTypes< {
|
package/dist/index.iife.js
CHANGED
|
@@ -117,7 +117,6 @@ var Vc = (function (exports, vue) {
|
|
|
117
117
|
const instance = vue.getCurrentInstance();
|
|
118
118
|
const regex = new RegExp(`${componentName}$`);
|
|
119
119
|
let parent = instance.parent;
|
|
120
|
-
/* istanbul ignore next -- @preserve */
|
|
121
120
|
while (parent && !(parent?.type?.name && regex.test(parent.type.name)) && (!privateKey || !parent?.[privateKey] || !parent?.proxy?.[privateKey])) {
|
|
122
121
|
parent = parent.parent || parent?.type?.parent;
|
|
123
122
|
}
|
|
@@ -9076,7 +9075,6 @@ var Vc = (function (exports, vue) {
|
|
|
9076
9075
|
if (!message || !target) return;
|
|
9077
9076
|
message = `[@deot/vc - ${target}]: ${message}`;
|
|
9078
9077
|
this.message = message;
|
|
9079
|
-
/* istanbul ignore next -- @preserve */
|
|
9080
9078
|
}
|
|
9081
9079
|
}
|
|
9082
9080
|
const VARIABLES = {};
|
|
@@ -9439,7 +9437,6 @@ var Vc = (function (exports, vue) {
|
|
|
9439
9437
|
const key = `${prefix}${url}`;
|
|
9440
9438
|
const cache = window.localStorage.getItem(key);
|
|
9441
9439
|
let icons = JSON.parse(cache || '""');
|
|
9442
|
-
/* istanbul ignore next -- @preserve */
|
|
9443
9440
|
if (!icons) {
|
|
9444
9441
|
const data = await new Promise((resolve$) => {
|
|
9445
9442
|
const request = new XMLHttpRequest();
|
|
@@ -9474,7 +9471,6 @@ var Vc = (function (exports, vue) {
|
|
|
9474
9471
|
});
|
|
9475
9472
|
resolve();
|
|
9476
9473
|
} catch (e) {
|
|
9477
|
-
/* istanbul ignore next -- @preserve */
|
|
9478
9474
|
reject(new VcError("icon", e));
|
|
9479
9475
|
}
|
|
9480
9476
|
})();
|
|
@@ -9486,7 +9482,6 @@ var Vc = (function (exports, vue) {
|
|
|
9486
9482
|
const icons = {};
|
|
9487
9483
|
setTimeout(() => {
|
|
9488
9484
|
try {
|
|
9489
|
-
/* istanbul ignore next -- @preserve */
|
|
9490
9485
|
IS_DEV && console.time(url);
|
|
9491
9486
|
svgStr.replace(svgReg, "$1")?.match(symbolReg)?.forEach(
|
|
9492
9487
|
(i) => i.replace(basicReg, (_, ...args) => {
|
|
@@ -9501,23 +9496,19 @@ var Vc = (function (exports, vue) {
|
|
|
9501
9496
|
return "";
|
|
9502
9497
|
})
|
|
9503
9498
|
);
|
|
9504
|
-
/* istanbul ignore next -- @preserve */
|
|
9505
9499
|
IS_DEV && console.timeEnd(url);
|
|
9506
9500
|
resolve(icons);
|
|
9507
9501
|
} catch (e) {
|
|
9508
|
-
/* istanbul ignore next -- @preserve */
|
|
9509
9502
|
reject(new VcError("icon", e));
|
|
9510
9503
|
}
|
|
9511
9504
|
}, 0);
|
|
9512
9505
|
});
|
|
9513
9506
|
}
|
|
9514
9507
|
on(type, fn) {
|
|
9515
|
-
/* istanbul ignore next -- @preserve */
|
|
9516
9508
|
if (typeof type !== "string" || typeof fn !== "function") return this;
|
|
9517
9509
|
this.events[type] = this.events[type] || [];
|
|
9518
9510
|
if (this.events[type].length >= 100) {
|
|
9519
9511
|
delete this.events[type];
|
|
9520
|
-
/* istanbul ignore else -- @preserve */
|
|
9521
9512
|
if (!IS_SERVER) {
|
|
9522
9513
|
throw new VcError("icon", `${type} nonexistent`);
|
|
9523
9514
|
}
|
|
@@ -9526,7 +9517,6 @@ var Vc = (function (exports, vue) {
|
|
|
9526
9517
|
return this;
|
|
9527
9518
|
}
|
|
9528
9519
|
off(type, fn) {
|
|
9529
|
-
/* istanbul ignore next -- @preserve */
|
|
9530
9520
|
if (typeof type !== "string" || typeof fn !== "function") return this;
|
|
9531
9521
|
this.events[type] = this.events[type]?.filter((i) => i != fn);
|
|
9532
9522
|
return this;
|
|
@@ -9783,7 +9773,6 @@ var Vc = (function (exports, vue) {
|
|
|
9783
9773
|
const handleBeforeEnter = (el2) => {
|
|
9784
9774
|
const duration = props2.duration.enter || props2.duration;
|
|
9785
9775
|
el2.style.transition = getTransitionStyle(duration);
|
|
9786
|
-
/* istanbul ignore next -- @preserve */
|
|
9787
9776
|
if (!el2.dataset) {
|
|
9788
9777
|
el2.dataset = {};
|
|
9789
9778
|
}
|
|
@@ -9800,7 +9789,6 @@ var Vc = (function (exports, vue) {
|
|
|
9800
9789
|
const next = createNext(done, duration);
|
|
9801
9790
|
try {
|
|
9802
9791
|
el2.dataset.oldOverflow = el2.style.overflow;
|
|
9803
|
-
/* istanbul ignore next -- @preserve */
|
|
9804
9792
|
if (el2.scrollHeight !== 0) {
|
|
9805
9793
|
el2.style.height = el2.scrollHeight + "px";
|
|
9806
9794
|
el2.style.paddingTop = el2.dataset.oldPaddingTop + "px";
|
|
@@ -9823,7 +9811,6 @@ var Vc = (function (exports, vue) {
|
|
|
9823
9811
|
attrs.onAfterEnter?.(el2);
|
|
9824
9812
|
};
|
|
9825
9813
|
const handleBeforeLeave = (el2) => {
|
|
9826
|
-
/* istanbul ignore next -- @preserve */
|
|
9827
9814
|
if (!el2.dataset) {
|
|
9828
9815
|
el2.dataset = {};
|
|
9829
9816
|
}
|
|
@@ -9840,7 +9827,6 @@ var Vc = (function (exports, vue) {
|
|
|
9840
9827
|
const next = createNext(done, duration);
|
|
9841
9828
|
try {
|
|
9842
9829
|
const leaveDuration = props2.duration.leave || props2.duration;
|
|
9843
|
-
/* istanbul ignore next -- @preserve */
|
|
9844
9830
|
if (el2.scrollHeight !== 0) {
|
|
9845
9831
|
el2.style.transition = getTransitionStyle(leaveDuration);
|
|
9846
9832
|
el2.style.height = "0px";
|
|
@@ -10418,7 +10404,6 @@ var Vc = (function (exports, vue) {
|
|
|
10418
10404
|
() => {
|
|
10419
10405
|
const { wait, exclude, include } = props2;
|
|
10420
10406
|
const ons = Object.entries(attrs).reduce((pre, [key, callback]) => {
|
|
10421
|
-
/* istanbul ignore else -- @preserve */
|
|
10422
10407
|
if ((!exclude || !exclude.test(key)) && (!include || include.test(key)) && typeof callback === "function") {
|
|
10423
10408
|
pre[key] = debounce(callback, wait, {
|
|
10424
10409
|
leading: true,
|
|
@@ -11830,7 +11815,6 @@ var Vc = (function (exports, vue) {
|
|
|
11830
11815
|
}
|
|
11831
11816
|
}
|
|
11832
11817
|
} catch (e) {
|
|
11833
|
-
/* istanbul ignore next -- @preserve */
|
|
11834
11818
|
throw new VcError("instance", e);
|
|
11835
11819
|
}
|
|
11836
11820
|
}
|
|
@@ -11841,7 +11825,6 @@ var Vc = (function (exports, vue) {
|
|
|
11841
11825
|
try {
|
|
11842
11826
|
Portal.leafs.forEach((leaf) => leaf.destroy());
|
|
11843
11827
|
} catch (e) {
|
|
11844
|
-
/* istanbul ignore next -- @preserve */
|
|
11845
11828
|
throw new VcError("instance", e);
|
|
11846
11829
|
}
|
|
11847
11830
|
}
|
|
@@ -11914,7 +11897,6 @@ var Vc = (function (exports, vue) {
|
|
|
11914
11897
|
return (...args) => {
|
|
11915
11898
|
const done = () => {
|
|
11916
11899
|
const leaf = getLeaf();
|
|
11917
|
-
/* istanbul ignore next -- @preserve */
|
|
11918
11900
|
if (!leaf) {
|
|
11919
11901
|
throw new VcError("portal", "实例不存在或已卸载");
|
|
11920
11902
|
}
|
|
@@ -11965,7 +11947,6 @@ var Vc = (function (exports, vue) {
|
|
|
11965
11947
|
if (isDestroyed()) return;
|
|
11966
11948
|
onDestroyed?.(...args);
|
|
11967
11949
|
leaf.app?.unmount();
|
|
11968
|
-
/* istanbul ignore else -- @preserve */
|
|
11969
11950
|
if (useAllNodes) {
|
|
11970
11951
|
root?.contains(container) && root.removeChild(container);
|
|
11971
11952
|
} else if (container && container._children) {
|
|
@@ -11993,16 +11974,13 @@ var Vc = (function (exports, vue) {
|
|
|
11993
11974
|
const handleExtra = (e) => {
|
|
11994
11975
|
try {
|
|
11995
11976
|
const path = e.path || composedPath(e);
|
|
11996
|
-
/* istanbul ignore else -- @preserve */
|
|
11997
11977
|
if (container && e.target && !container.contains(e.target) && !path?.some((item) => utils.eleInRegExp(item, aliveRegExp))) {
|
|
11998
|
-
/* istanbul ignore else -- @preserve */
|
|
11999
11978
|
if (leaf.wrapper && leaf.wrapper?.[aliveVisibleKey]) {
|
|
12000
11979
|
typeof leaf.wrapper[aliveVisibleKey] === "function" ? leaf.wrapper[aliveVisibleKey](false) : leaf.wrapper[aliveVisibleKey] = false;
|
|
12001
11980
|
}
|
|
12002
11981
|
leaveDelay ? setTimeout($onDestroyed, leaveDelay) : $onDestroyed();
|
|
12003
11982
|
}
|
|
12004
11983
|
} catch (error2) {
|
|
12005
|
-
/* istanbul ignore next -- @preserve */
|
|
12006
11984
|
throw new VcError("portal", error2);
|
|
12007
11985
|
}
|
|
12008
11986
|
};
|
|
@@ -12971,7 +12949,8 @@ var Vc = (function (exports, vue) {
|
|
|
12971
12949
|
emits: [...EVENTS$1, "ready"],
|
|
12972
12950
|
setup(props2, {
|
|
12973
12951
|
emit,
|
|
12974
|
-
slots
|
|
12952
|
+
slots,
|
|
12953
|
+
expose
|
|
12975
12954
|
}) {
|
|
12976
12955
|
const instance = vue.getCurrentInstance();
|
|
12977
12956
|
const chart = vue.shallowRef(null);
|
|
@@ -13066,6 +13045,10 @@ var Vc = (function (exports, vue) {
|
|
|
13066
13045
|
}
|
|
13067
13046
|
});
|
|
13068
13047
|
});
|
|
13048
|
+
expose({
|
|
13049
|
+
chart,
|
|
13050
|
+
refresh
|
|
13051
|
+
});
|
|
13069
13052
|
vue.onUnmounted(destroy2);
|
|
13070
13053
|
return () => {
|
|
13071
13054
|
return vue.createVNode("div", {
|
|
@@ -18541,7 +18524,7 @@ var Vc = (function (exports, vue) {
|
|
|
18541
18524
|
}) {
|
|
18542
18525
|
const owner = getInstance$1("dropdown", "dropdownId");
|
|
18543
18526
|
const currentValue = vue.computed(() => {
|
|
18544
|
-
const v = typeof props2.value === "undefined"
|
|
18527
|
+
const v = typeof props2.value === "undefined" ? props2.label : props2.value;
|
|
18545
18528
|
return v;
|
|
18546
18529
|
});
|
|
18547
18530
|
const classes = vue.computed(() => {
|
|
@@ -21385,7 +21368,7 @@ var Vc = (function (exports, vue) {
|
|
|
21385
21368
|
default: "div"
|
|
21386
21369
|
},
|
|
21387
21370
|
fill: {
|
|
21388
|
-
type: Boolean,
|
|
21371
|
+
type: [Boolean, Array],
|
|
21389
21372
|
default: true
|
|
21390
21373
|
}
|
|
21391
21374
|
};
|
|
@@ -21398,6 +21381,13 @@ var Vc = (function (exports, vue) {
|
|
|
21398
21381
|
const width = vue.ref(0);
|
|
21399
21382
|
const height = vue.ref(0);
|
|
21400
21383
|
const current = vue.ref();
|
|
21384
|
+
const classes = vue.computed(() => {
|
|
21385
|
+
const v = Array.isArray(props2.fill) ? props2.fill : [props2.fill, props2.fill];
|
|
21386
|
+
return {
|
|
21387
|
+
"is-fill-width": v[0],
|
|
21388
|
+
"is-fill-height": v[1]
|
|
21389
|
+
};
|
|
21390
|
+
});
|
|
21401
21391
|
const currentExposed = vue.computed(() => {
|
|
21402
21392
|
return {
|
|
21403
21393
|
height: height.value,
|
|
@@ -21448,7 +21438,7 @@ var Vc = (function (exports, vue) {
|
|
|
21448
21438
|
props2.tag,
|
|
21449
21439
|
{
|
|
21450
21440
|
ref: current,
|
|
21451
|
-
class: ["vc-resizer",
|
|
21441
|
+
class: ["vc-resizer", classes.value]
|
|
21452
21442
|
},
|
|
21453
21443
|
slots.default?.(currentExposed.value)
|
|
21454
21444
|
);
|
|
@@ -24544,19 +24534,17 @@ var Vc = (function (exports, vue) {
|
|
|
24544
24534
|
const refreshItemSize = (index) => {
|
|
24545
24535
|
const current = props2.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
|
|
24546
24536
|
if (!current) return;
|
|
24547
|
-
const
|
|
24537
|
+
const original = Object.assign({}, current);
|
|
24548
24538
|
const dom = preloads.value[index] || curloads.value[props2.inverted ? index : index - firstItemIndex.value];
|
|
24549
24539
|
if (dom) {
|
|
24550
24540
|
current.size = dom[K.offsetSize] || placeholderSize.value;
|
|
24551
24541
|
} else if (current) {
|
|
24552
24542
|
current.size = placeholderSize.value;
|
|
24553
24543
|
}
|
|
24554
|
-
|
|
24555
|
-
|
|
24556
|
-
|
|
24557
|
-
|
|
24558
|
-
});
|
|
24559
|
-
}
|
|
24544
|
+
return {
|
|
24545
|
+
original,
|
|
24546
|
+
changed: current
|
|
24547
|
+
};
|
|
24560
24548
|
};
|
|
24561
24549
|
const refreshItemPosition = () => {
|
|
24562
24550
|
const sizes = Array.from({
|
|
@@ -24623,18 +24611,24 @@ var Vc = (function (exports, vue) {
|
|
|
24623
24611
|
const refreshLayout = async (start, end) => {
|
|
24624
24612
|
isRefreshLayout = 1;
|
|
24625
24613
|
const promiseTasks = [];
|
|
24614
|
+
const resizeChanges = [];
|
|
24626
24615
|
let item;
|
|
24627
24616
|
for (let i = start; i < end; i++) {
|
|
24628
24617
|
item = props2.inverted ? rebuildData.value[rebuildDataIndexMap.value[i]] : rebuildData.value[i];
|
|
24629
|
-
if (item && item.loaded)
|
|
24630
|
-
continue;
|
|
24631
|
-
}
|
|
24618
|
+
if (item && item.loaded) continue;
|
|
24632
24619
|
setItemData(i, originalData[i]);
|
|
24633
|
-
promiseTasks.push(vue.nextTick(() =>
|
|
24620
|
+
promiseTasks.push(vue.nextTick(() => {
|
|
24621
|
+
const e = refreshItemSize(i);
|
|
24622
|
+
e && resizeChanges.push(e.changed);
|
|
24623
|
+
}));
|
|
24634
24624
|
}
|
|
24635
24625
|
await Promise.all(promiseTasks);
|
|
24636
24626
|
refreshItemPosition();
|
|
24637
24627
|
setFirstItemIndex();
|
|
24628
|
+
resizeChanges.length > 0 && emit("row-resize", resizeChanges.map((i) => ({
|
|
24629
|
+
size: i.size,
|
|
24630
|
+
index: i.id
|
|
24631
|
+
})));
|
|
24638
24632
|
interrupter.next();
|
|
24639
24633
|
isRefreshLayout = 0;
|
|
24640
24634
|
};
|
|
@@ -26288,11 +26282,19 @@ var Vc = (function (exports, vue) {
|
|
|
26288
26282
|
emit,
|
|
26289
26283
|
slots
|
|
26290
26284
|
}) {
|
|
26285
|
+
let resizeChanges = [];
|
|
26286
|
+
const emitChanges = () => {
|
|
26287
|
+
if (resizeChanges.length > 0) {
|
|
26288
|
+
emit("row-resize", resizeChanges);
|
|
26289
|
+
resizeChanges = [];
|
|
26290
|
+
}
|
|
26291
|
+
};
|
|
26291
26292
|
const handleResize = (e, index) => {
|
|
26292
|
-
|
|
26293
|
+
resizeChanges.push({
|
|
26293
26294
|
index,
|
|
26294
26295
|
size: e.height
|
|
26295
26296
|
});
|
|
26297
|
+
vue.nextTick(emitChanges);
|
|
26296
26298
|
};
|
|
26297
26299
|
return () => {
|
|
26298
26300
|
return props2.data.map((mergeData, index) => {
|
|
@@ -26648,22 +26650,24 @@ var Vc = (function (exports, vue) {
|
|
|
26648
26650
|
return renderRow(row, row.index);
|
|
26649
26651
|
})]);
|
|
26650
26652
|
};
|
|
26651
|
-
const handleMergeRowResize = (
|
|
26653
|
+
const handleMergeRowResize = (changes) => {
|
|
26652
26654
|
if (table.props.rowHeight) return;
|
|
26653
|
-
|
|
26654
|
-
|
|
26655
|
-
|
|
26656
|
-
|
|
26657
|
-
|
|
26658
|
-
|
|
26659
|
-
|
|
26660
|
-
|
|
26661
|
-
|
|
26662
|
-
|
|
26663
|
-
|
|
26664
|
-
|
|
26665
|
-
|
|
26666
|
-
|
|
26655
|
+
changes.forEach((v) => {
|
|
26656
|
+
states.list[v.index].rows.forEach((row) => {
|
|
26657
|
+
const old = row.heightMap[props2.fixed || "main"];
|
|
26658
|
+
if (old === v.size) return;
|
|
26659
|
+
row.heightMap[props2.fixed || "main"] = v.size;
|
|
26660
|
+
const heights = [row.heightMap.main];
|
|
26661
|
+
if (states.leftFixedCount) {
|
|
26662
|
+
heights.push(row.heightMap.left);
|
|
26663
|
+
}
|
|
26664
|
+
if (states.rightFixedCount) {
|
|
26665
|
+
heights.push(row.heightMap.right);
|
|
26666
|
+
}
|
|
26667
|
+
if (heights.every((i) => !!i)) {
|
|
26668
|
+
row.height = Math.max(row.heightMap.left, row.heightMap.main, row.heightMap.right) || "";
|
|
26669
|
+
}
|
|
26670
|
+
});
|
|
26667
26671
|
});
|
|
26668
26672
|
};
|
|
26669
26673
|
expose({
|
|
@@ -29435,7 +29439,6 @@ var Vc = (function (exports, vue) {
|
|
|
29435
29439
|
setup(props2, { slots }) {
|
|
29436
29440
|
const themeId = getUid("vc-theme");
|
|
29437
29441
|
const setVar = (name) => {
|
|
29438
|
-
/* istanbul ignore next -- @preserve */
|
|
29439
29442
|
if (!name) return "";
|
|
29440
29443
|
const globals = VcInstance.options.Theme?.variables;
|
|
29441
29444
|
return props2.variables?.[name] || globals?.[name] || `var(--${name})`;
|
|
@@ -29471,7 +29474,6 @@ var Vc = (function (exports, vue) {
|
|
|
29471
29474
|
}
|
|
29472
29475
|
});
|
|
29473
29476
|
const setCss = (attrs) => {
|
|
29474
|
-
/* istanbul ignore next -- @preserve */
|
|
29475
29477
|
if (!attrs || typeof attrs === "string") return attrs;
|
|
29476
29478
|
let content = "";
|
|
29477
29479
|
Object.entries(attrs).forEach(([key, val]) => {
|
|
@@ -29480,7 +29482,6 @@ var Vc = (function (exports, vue) {
|
|
|
29480
29482
|
return content;
|
|
29481
29483
|
};
|
|
29482
29484
|
const resetPseudo = () => {
|
|
29483
|
-
/* istanbul ignore next -- @preserve */
|
|
29484
29485
|
if (typeof document === "undefined") return;
|
|
29485
29486
|
const { pseudo } = props2;
|
|
29486
29487
|
if (!pseudo) return removeStyle(themeId);
|
package/dist/index.umd.cjs
CHANGED
|
@@ -120,7 +120,6 @@
|
|
|
120
120
|
const instance = vue.getCurrentInstance();
|
|
121
121
|
const regex = new RegExp(`${componentName}$`);
|
|
122
122
|
let parent = instance.parent;
|
|
123
|
-
/* istanbul ignore next -- @preserve */
|
|
124
123
|
while (parent && !(parent?.type?.name && regex.test(parent.type.name)) && (!privateKey || !parent?.[privateKey] || !parent?.proxy?.[privateKey])) {
|
|
125
124
|
parent = parent.parent || parent?.type?.parent;
|
|
126
125
|
}
|
|
@@ -9079,7 +9078,6 @@
|
|
|
9079
9078
|
if (!message || !target) return;
|
|
9080
9079
|
message = `[@deot/vc - ${target}]: ${message}`;
|
|
9081
9080
|
this.message = message;
|
|
9082
|
-
/* istanbul ignore next -- @preserve */
|
|
9083
9081
|
}
|
|
9084
9082
|
}
|
|
9085
9083
|
const VARIABLES = {};
|
|
@@ -9442,7 +9440,6 @@
|
|
|
9442
9440
|
const key = `${prefix}${url}`;
|
|
9443
9441
|
const cache = window.localStorage.getItem(key);
|
|
9444
9442
|
let icons = JSON.parse(cache || '""');
|
|
9445
|
-
/* istanbul ignore next -- @preserve */
|
|
9446
9443
|
if (!icons) {
|
|
9447
9444
|
const data = await new Promise((resolve$) => {
|
|
9448
9445
|
const request = new XMLHttpRequest();
|
|
@@ -9477,7 +9474,6 @@
|
|
|
9477
9474
|
});
|
|
9478
9475
|
resolve();
|
|
9479
9476
|
} catch (e) {
|
|
9480
|
-
/* istanbul ignore next -- @preserve */
|
|
9481
9477
|
reject(new VcError("icon", e));
|
|
9482
9478
|
}
|
|
9483
9479
|
})();
|
|
@@ -9489,7 +9485,6 @@
|
|
|
9489
9485
|
const icons = {};
|
|
9490
9486
|
setTimeout(() => {
|
|
9491
9487
|
try {
|
|
9492
|
-
/* istanbul ignore next -- @preserve */
|
|
9493
9488
|
IS_DEV && console.time(url);
|
|
9494
9489
|
svgStr.replace(svgReg, "$1")?.match(symbolReg)?.forEach(
|
|
9495
9490
|
(i) => i.replace(basicReg, (_, ...args) => {
|
|
@@ -9504,23 +9499,19 @@
|
|
|
9504
9499
|
return "";
|
|
9505
9500
|
})
|
|
9506
9501
|
);
|
|
9507
|
-
/* istanbul ignore next -- @preserve */
|
|
9508
9502
|
IS_DEV && console.timeEnd(url);
|
|
9509
9503
|
resolve(icons);
|
|
9510
9504
|
} catch (e) {
|
|
9511
|
-
/* istanbul ignore next -- @preserve */
|
|
9512
9505
|
reject(new VcError("icon", e));
|
|
9513
9506
|
}
|
|
9514
9507
|
}, 0);
|
|
9515
9508
|
});
|
|
9516
9509
|
}
|
|
9517
9510
|
on(type, fn) {
|
|
9518
|
-
/* istanbul ignore next -- @preserve */
|
|
9519
9511
|
if (typeof type !== "string" || typeof fn !== "function") return this;
|
|
9520
9512
|
this.events[type] = this.events[type] || [];
|
|
9521
9513
|
if (this.events[type].length >= 100) {
|
|
9522
9514
|
delete this.events[type];
|
|
9523
|
-
/* istanbul ignore else -- @preserve */
|
|
9524
9515
|
if (!IS_SERVER) {
|
|
9525
9516
|
throw new VcError("icon", `${type} nonexistent`);
|
|
9526
9517
|
}
|
|
@@ -9529,7 +9520,6 @@
|
|
|
9529
9520
|
return this;
|
|
9530
9521
|
}
|
|
9531
9522
|
off(type, fn) {
|
|
9532
|
-
/* istanbul ignore next -- @preserve */
|
|
9533
9523
|
if (typeof type !== "string" || typeof fn !== "function") return this;
|
|
9534
9524
|
this.events[type] = this.events[type]?.filter((i) => i != fn);
|
|
9535
9525
|
return this;
|
|
@@ -9786,7 +9776,6 @@
|
|
|
9786
9776
|
const handleBeforeEnter = (el2) => {
|
|
9787
9777
|
const duration = props2.duration.enter || props2.duration;
|
|
9788
9778
|
el2.style.transition = getTransitionStyle(duration);
|
|
9789
|
-
/* istanbul ignore next -- @preserve */
|
|
9790
9779
|
if (!el2.dataset) {
|
|
9791
9780
|
el2.dataset = {};
|
|
9792
9781
|
}
|
|
@@ -9803,7 +9792,6 @@
|
|
|
9803
9792
|
const next = createNext(done, duration);
|
|
9804
9793
|
try {
|
|
9805
9794
|
el2.dataset.oldOverflow = el2.style.overflow;
|
|
9806
|
-
/* istanbul ignore next -- @preserve */
|
|
9807
9795
|
if (el2.scrollHeight !== 0) {
|
|
9808
9796
|
el2.style.height = el2.scrollHeight + "px";
|
|
9809
9797
|
el2.style.paddingTop = el2.dataset.oldPaddingTop + "px";
|
|
@@ -9826,7 +9814,6 @@
|
|
|
9826
9814
|
attrs.onAfterEnter?.(el2);
|
|
9827
9815
|
};
|
|
9828
9816
|
const handleBeforeLeave = (el2) => {
|
|
9829
|
-
/* istanbul ignore next -- @preserve */
|
|
9830
9817
|
if (!el2.dataset) {
|
|
9831
9818
|
el2.dataset = {};
|
|
9832
9819
|
}
|
|
@@ -9843,7 +9830,6 @@
|
|
|
9843
9830
|
const next = createNext(done, duration);
|
|
9844
9831
|
try {
|
|
9845
9832
|
const leaveDuration = props2.duration.leave || props2.duration;
|
|
9846
|
-
/* istanbul ignore next -- @preserve */
|
|
9847
9833
|
if (el2.scrollHeight !== 0) {
|
|
9848
9834
|
el2.style.transition = getTransitionStyle(leaveDuration);
|
|
9849
9835
|
el2.style.height = "0px";
|
|
@@ -10421,7 +10407,6 @@
|
|
|
10421
10407
|
() => {
|
|
10422
10408
|
const { wait, exclude, include } = props2;
|
|
10423
10409
|
const ons = Object.entries(attrs).reduce((pre, [key, callback]) => {
|
|
10424
|
-
/* istanbul ignore else -- @preserve */
|
|
10425
10410
|
if ((!exclude || !exclude.test(key)) && (!include || include.test(key)) && typeof callback === "function") {
|
|
10426
10411
|
pre[key] = debounce(callback, wait, {
|
|
10427
10412
|
leading: true,
|
|
@@ -11833,7 +11818,6 @@
|
|
|
11833
11818
|
}
|
|
11834
11819
|
}
|
|
11835
11820
|
} catch (e) {
|
|
11836
|
-
/* istanbul ignore next -- @preserve */
|
|
11837
11821
|
throw new VcError("instance", e);
|
|
11838
11822
|
}
|
|
11839
11823
|
}
|
|
@@ -11844,7 +11828,6 @@
|
|
|
11844
11828
|
try {
|
|
11845
11829
|
Portal.leafs.forEach((leaf) => leaf.destroy());
|
|
11846
11830
|
} catch (e) {
|
|
11847
|
-
/* istanbul ignore next -- @preserve */
|
|
11848
11831
|
throw new VcError("instance", e);
|
|
11849
11832
|
}
|
|
11850
11833
|
}
|
|
@@ -11917,7 +11900,6 @@
|
|
|
11917
11900
|
return (...args) => {
|
|
11918
11901
|
const done = () => {
|
|
11919
11902
|
const leaf = getLeaf();
|
|
11920
|
-
/* istanbul ignore next -- @preserve */
|
|
11921
11903
|
if (!leaf) {
|
|
11922
11904
|
throw new VcError("portal", "实例不存在或已卸载");
|
|
11923
11905
|
}
|
|
@@ -11968,7 +11950,6 @@
|
|
|
11968
11950
|
if (isDestroyed()) return;
|
|
11969
11951
|
onDestroyed?.(...args);
|
|
11970
11952
|
leaf.app?.unmount();
|
|
11971
|
-
/* istanbul ignore else -- @preserve */
|
|
11972
11953
|
if (useAllNodes) {
|
|
11973
11954
|
root?.contains(container) && root.removeChild(container);
|
|
11974
11955
|
} else if (container && container._children) {
|
|
@@ -11996,16 +11977,13 @@
|
|
|
11996
11977
|
const handleExtra = (e) => {
|
|
11997
11978
|
try {
|
|
11998
11979
|
const path = e.path || composedPath(e);
|
|
11999
|
-
/* istanbul ignore else -- @preserve */
|
|
12000
11980
|
if (container && e.target && !container.contains(e.target) && !path?.some((item) => utils.eleInRegExp(item, aliveRegExp))) {
|
|
12001
|
-
/* istanbul ignore else -- @preserve */
|
|
12002
11981
|
if (leaf.wrapper && leaf.wrapper?.[aliveVisibleKey]) {
|
|
12003
11982
|
typeof leaf.wrapper[aliveVisibleKey] === "function" ? leaf.wrapper[aliveVisibleKey](false) : leaf.wrapper[aliveVisibleKey] = false;
|
|
12004
11983
|
}
|
|
12005
11984
|
leaveDelay ? setTimeout($onDestroyed, leaveDelay) : $onDestroyed();
|
|
12006
11985
|
}
|
|
12007
11986
|
} catch (error2) {
|
|
12008
|
-
/* istanbul ignore next -- @preserve */
|
|
12009
11987
|
throw new VcError("portal", error2);
|
|
12010
11988
|
}
|
|
12011
11989
|
};
|
|
@@ -12974,7 +12952,8 @@
|
|
|
12974
12952
|
emits: [...EVENTS$1, "ready"],
|
|
12975
12953
|
setup(props2, {
|
|
12976
12954
|
emit,
|
|
12977
|
-
slots
|
|
12955
|
+
slots,
|
|
12956
|
+
expose
|
|
12978
12957
|
}) {
|
|
12979
12958
|
const instance = vue.getCurrentInstance();
|
|
12980
12959
|
const chart = vue.shallowRef(null);
|
|
@@ -13069,6 +13048,10 @@
|
|
|
13069
13048
|
}
|
|
13070
13049
|
});
|
|
13071
13050
|
});
|
|
13051
|
+
expose({
|
|
13052
|
+
chart,
|
|
13053
|
+
refresh
|
|
13054
|
+
});
|
|
13072
13055
|
vue.onUnmounted(destroy2);
|
|
13073
13056
|
return () => {
|
|
13074
13057
|
return vue.createVNode("div", {
|
|
@@ -18544,7 +18527,7 @@
|
|
|
18544
18527
|
}) {
|
|
18545
18528
|
const owner = getInstance$1("dropdown", "dropdownId");
|
|
18546
18529
|
const currentValue = vue.computed(() => {
|
|
18547
|
-
const v = typeof props2.value === "undefined"
|
|
18530
|
+
const v = typeof props2.value === "undefined" ? props2.label : props2.value;
|
|
18548
18531
|
return v;
|
|
18549
18532
|
});
|
|
18550
18533
|
const classes = vue.computed(() => {
|
|
@@ -21388,7 +21371,7 @@
|
|
|
21388
21371
|
default: "div"
|
|
21389
21372
|
},
|
|
21390
21373
|
fill: {
|
|
21391
|
-
type: Boolean,
|
|
21374
|
+
type: [Boolean, Array],
|
|
21392
21375
|
default: true
|
|
21393
21376
|
}
|
|
21394
21377
|
};
|
|
@@ -21401,6 +21384,13 @@
|
|
|
21401
21384
|
const width = vue.ref(0);
|
|
21402
21385
|
const height = vue.ref(0);
|
|
21403
21386
|
const current = vue.ref();
|
|
21387
|
+
const classes = vue.computed(() => {
|
|
21388
|
+
const v = Array.isArray(props2.fill) ? props2.fill : [props2.fill, props2.fill];
|
|
21389
|
+
return {
|
|
21390
|
+
"is-fill-width": v[0],
|
|
21391
|
+
"is-fill-height": v[1]
|
|
21392
|
+
};
|
|
21393
|
+
});
|
|
21404
21394
|
const currentExposed = vue.computed(() => {
|
|
21405
21395
|
return {
|
|
21406
21396
|
height: height.value,
|
|
@@ -21451,7 +21441,7 @@
|
|
|
21451
21441
|
props2.tag,
|
|
21452
21442
|
{
|
|
21453
21443
|
ref: current,
|
|
21454
|
-
class: ["vc-resizer",
|
|
21444
|
+
class: ["vc-resizer", classes.value]
|
|
21455
21445
|
},
|
|
21456
21446
|
slots.default?.(currentExposed.value)
|
|
21457
21447
|
);
|
|
@@ -24547,19 +24537,17 @@
|
|
|
24547
24537
|
const refreshItemSize = (index) => {
|
|
24548
24538
|
const current = props2.inverted ? rebuildData.value[rebuildDataIndexMap.value[index]] : rebuildData.value[index];
|
|
24549
24539
|
if (!current) return;
|
|
24550
|
-
const
|
|
24540
|
+
const original = Object.assign({}, current);
|
|
24551
24541
|
const dom = preloads.value[index] || curloads.value[props2.inverted ? index : index - firstItemIndex.value];
|
|
24552
24542
|
if (dom) {
|
|
24553
24543
|
current.size = dom[K.offsetSize] || placeholderSize.value;
|
|
24554
24544
|
} else if (current) {
|
|
24555
24545
|
current.size = placeholderSize.value;
|
|
24556
24546
|
}
|
|
24557
|
-
|
|
24558
|
-
|
|
24559
|
-
|
|
24560
|
-
|
|
24561
|
-
});
|
|
24562
|
-
}
|
|
24547
|
+
return {
|
|
24548
|
+
original,
|
|
24549
|
+
changed: current
|
|
24550
|
+
};
|
|
24563
24551
|
};
|
|
24564
24552
|
const refreshItemPosition = () => {
|
|
24565
24553
|
const sizes = Array.from({
|
|
@@ -24626,18 +24614,24 @@
|
|
|
24626
24614
|
const refreshLayout = async (start, end) => {
|
|
24627
24615
|
isRefreshLayout = 1;
|
|
24628
24616
|
const promiseTasks = [];
|
|
24617
|
+
const resizeChanges = [];
|
|
24629
24618
|
let item;
|
|
24630
24619
|
for (let i = start; i < end; i++) {
|
|
24631
24620
|
item = props2.inverted ? rebuildData.value[rebuildDataIndexMap.value[i]] : rebuildData.value[i];
|
|
24632
|
-
if (item && item.loaded)
|
|
24633
|
-
continue;
|
|
24634
|
-
}
|
|
24621
|
+
if (item && item.loaded) continue;
|
|
24635
24622
|
setItemData(i, originalData[i]);
|
|
24636
|
-
promiseTasks.push(vue.nextTick(() =>
|
|
24623
|
+
promiseTasks.push(vue.nextTick(() => {
|
|
24624
|
+
const e = refreshItemSize(i);
|
|
24625
|
+
e && resizeChanges.push(e.changed);
|
|
24626
|
+
}));
|
|
24637
24627
|
}
|
|
24638
24628
|
await Promise.all(promiseTasks);
|
|
24639
24629
|
refreshItemPosition();
|
|
24640
24630
|
setFirstItemIndex();
|
|
24631
|
+
resizeChanges.length > 0 && emit("row-resize", resizeChanges.map((i) => ({
|
|
24632
|
+
size: i.size,
|
|
24633
|
+
index: i.id
|
|
24634
|
+
})));
|
|
24641
24635
|
interrupter.next();
|
|
24642
24636
|
isRefreshLayout = 0;
|
|
24643
24637
|
};
|
|
@@ -26291,11 +26285,19 @@
|
|
|
26291
26285
|
emit,
|
|
26292
26286
|
slots
|
|
26293
26287
|
}) {
|
|
26288
|
+
let resizeChanges = [];
|
|
26289
|
+
const emitChanges = () => {
|
|
26290
|
+
if (resizeChanges.length > 0) {
|
|
26291
|
+
emit("row-resize", resizeChanges);
|
|
26292
|
+
resizeChanges = [];
|
|
26293
|
+
}
|
|
26294
|
+
};
|
|
26294
26295
|
const handleResize = (e, index) => {
|
|
26295
|
-
|
|
26296
|
+
resizeChanges.push({
|
|
26296
26297
|
index,
|
|
26297
26298
|
size: e.height
|
|
26298
26299
|
});
|
|
26300
|
+
vue.nextTick(emitChanges);
|
|
26299
26301
|
};
|
|
26300
26302
|
return () => {
|
|
26301
26303
|
return props2.data.map((mergeData, index) => {
|
|
@@ -26651,22 +26653,24 @@
|
|
|
26651
26653
|
return renderRow(row, row.index);
|
|
26652
26654
|
})]);
|
|
26653
26655
|
};
|
|
26654
|
-
const handleMergeRowResize = (
|
|
26656
|
+
const handleMergeRowResize = (changes) => {
|
|
26655
26657
|
if (table.props.rowHeight) return;
|
|
26656
|
-
|
|
26657
|
-
|
|
26658
|
-
|
|
26659
|
-
|
|
26660
|
-
|
|
26661
|
-
|
|
26662
|
-
|
|
26663
|
-
|
|
26664
|
-
|
|
26665
|
-
|
|
26666
|
-
|
|
26667
|
-
|
|
26668
|
-
|
|
26669
|
-
|
|
26658
|
+
changes.forEach((v) => {
|
|
26659
|
+
states.list[v.index].rows.forEach((row) => {
|
|
26660
|
+
const old = row.heightMap[props2.fixed || "main"];
|
|
26661
|
+
if (old === v.size) return;
|
|
26662
|
+
row.heightMap[props2.fixed || "main"] = v.size;
|
|
26663
|
+
const heights = [row.heightMap.main];
|
|
26664
|
+
if (states.leftFixedCount) {
|
|
26665
|
+
heights.push(row.heightMap.left);
|
|
26666
|
+
}
|
|
26667
|
+
if (states.rightFixedCount) {
|
|
26668
|
+
heights.push(row.heightMap.right);
|
|
26669
|
+
}
|
|
26670
|
+
if (heights.every((i) => !!i)) {
|
|
26671
|
+
row.height = Math.max(row.heightMap.left, row.heightMap.main, row.heightMap.right) || "";
|
|
26672
|
+
}
|
|
26673
|
+
});
|
|
26670
26674
|
});
|
|
26671
26675
|
};
|
|
26672
26676
|
expose({
|
|
@@ -29438,7 +29442,6 @@
|
|
|
29438
29442
|
setup(props2, { slots }) {
|
|
29439
29443
|
const themeId = getUid("vc-theme");
|
|
29440
29444
|
const setVar = (name) => {
|
|
29441
|
-
/* istanbul ignore next -- @preserve */
|
|
29442
29445
|
if (!name) return "";
|
|
29443
29446
|
const globals = VcInstance.options.Theme?.variables;
|
|
29444
29447
|
return props2.variables?.[name] || globals?.[name] || `var(--${name})`;
|
|
@@ -29474,7 +29477,6 @@
|
|
|
29474
29477
|
}
|
|
29475
29478
|
});
|
|
29476
29479
|
const setCss = (attrs) => {
|
|
29477
|
-
/* istanbul ignore next -- @preserve */
|
|
29478
29480
|
if (!attrs || typeof attrs === "string") return attrs;
|
|
29479
29481
|
let content = "";
|
|
29480
29482
|
Object.entries(attrs).forEach(([key, val]) => {
|
|
@@ -29483,7 +29485,6 @@
|
|
|
29483
29485
|
return content;
|
|
29484
29486
|
};
|
|
29485
29487
|
const resetPseudo = () => {
|
|
29486
|
-
/* istanbul ignore next -- @preserve */
|
|
29487
29488
|
if (typeof document === "undefined") return;
|
|
29488
29489
|
const { pseudo } = props2;
|
|
29489
29490
|
if (!pseudo) return removeStyle(themeId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deot/vc",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.58",
|
|
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.
|
|
23
|
-
"@deot/vc-hooks": "^1.0.
|
|
24
|
-
"@deot/vc-shared": "^1.0.
|
|
22
|
+
"@deot/vc-components": "^1.0.58",
|
|
23
|
+
"@deot/vc-hooks": "^1.0.58",
|
|
24
|
+
"@deot/vc-shared": "^1.0.58"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"vue": "*"
|