@varlet/ui 2.22.1-alpha.1706370837642 → 2.22.1
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/es/index-anchor/IndexAnchor.mjs +5 -7
- package/es/index-bar/IndexBar.mjs +5 -5
- package/es/index.bundle.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/menu/usePopover.mjs +3 -0
- package/es/style.css +1 -1
- package/es/tabs/tabs.css +1 -1
- package/es/varlet.esm.js +687 -686
- package/highlight/web-types.en-US.json +2 -2
- package/highlight/web-types.zh-CN.json +2 -2
- package/lib/style.css +1 -1
- package/lib/varlet.cjs.js +14 -13
- package/package.json +7 -7
- package/umd/varlet.js +5 -5
package/lib/varlet.cjs.js
CHANGED
|
@@ -13183,6 +13183,9 @@ function usePopover(options) {
|
|
|
13183
13183
|
let enterPopover = false;
|
|
13184
13184
|
let enterHost = false;
|
|
13185
13185
|
const computeHostSize = () => {
|
|
13186
|
+
if (!host.value) {
|
|
13187
|
+
return;
|
|
13188
|
+
}
|
|
13186
13189
|
const { width, height } = getStyle$1(host.value);
|
|
13187
13190
|
hostSize.value = {
|
|
13188
13191
|
width: toPxNum(width),
|
|
@@ -15780,7 +15783,6 @@ const __sfc__$G = vue.defineComponent({
|
|
|
15780
15783
|
inheritAttrs: false,
|
|
15781
15784
|
props: props$C,
|
|
15782
15785
|
setup(props2) {
|
|
15783
|
-
const ownTop = vue.ref(0);
|
|
15784
15786
|
const disabled = vue.ref(false);
|
|
15785
15787
|
const name2 = vue.computed(() => props2.index);
|
|
15786
15788
|
const anchorEl = vue.ref(null);
|
|
@@ -15789,16 +15791,15 @@ const __sfc__$G = vue.defineComponent({
|
|
|
15789
15791
|
const indexAnchorProvider = {
|
|
15790
15792
|
index,
|
|
15791
15793
|
name: name2,
|
|
15792
|
-
|
|
15793
|
-
|
|
15794
|
-
setDisabled
|
|
15794
|
+
setDisabled,
|
|
15795
|
+
getOffsetTop
|
|
15795
15796
|
};
|
|
15796
15797
|
bindIndexBar(indexAnchorProvider);
|
|
15797
|
-
function
|
|
15798
|
+
function getOffsetTop() {
|
|
15798
15799
|
if (!anchorEl.value) {
|
|
15799
|
-
return;
|
|
15800
|
+
return 0;
|
|
15800
15801
|
}
|
|
15801
|
-
|
|
15802
|
+
return anchorEl.value.$el ? anchorEl.value.$el.offsetTop : anchorEl.value.offsetTop;
|
|
15802
15803
|
}
|
|
15803
15804
|
function setDisabled(value) {
|
|
15804
15805
|
disabled.value = value;
|
|
@@ -15944,10 +15945,9 @@ const __sfc__$F = vue.defineComponent({
|
|
|
15944
15945
|
() => length.value,
|
|
15945
15946
|
() => __async$6(this, null, function* () {
|
|
15946
15947
|
yield doubleRaf();
|
|
15947
|
-
indexAnchors.forEach(({ name: name2
|
|
15948
|
+
indexAnchors.forEach(({ name: name2 }) => {
|
|
15948
15949
|
if (name2.value)
|
|
15949
15950
|
anchorNameList.value.push(name2.value);
|
|
15950
|
-
setOwnTop();
|
|
15951
15951
|
});
|
|
15952
15952
|
})
|
|
15953
15953
|
);
|
|
@@ -15990,9 +15990,9 @@ const __sfc__$F = vue.defineComponent({
|
|
|
15990
15990
|
const scrollHeight = scroller === window ? document.body.scrollHeight : scroller.scrollHeight;
|
|
15991
15991
|
const offsetTop = getOffsetTop();
|
|
15992
15992
|
indexAnchors.forEach((anchor, index) => {
|
|
15993
|
-
const anchorTop = anchor.
|
|
15993
|
+
const anchorTop = anchor.getOffsetTop();
|
|
15994
15994
|
const top2 = scrollTop - anchorTop + stickyOffsetTop.value - offsetTop;
|
|
15995
|
-
const distance = index === indexAnchors.length - 1 ? scrollHeight : indexAnchors[index + 1].
|
|
15995
|
+
const distance = index === indexAnchors.length - 1 ? scrollHeight : indexAnchors[index + 1].getOffsetTop() - anchor.getOffsetTop();
|
|
15996
15996
|
anchor.setDisabled(true);
|
|
15997
15997
|
if (top2 >= 0 && top2 < distance && clickedName.value === "") {
|
|
15998
15998
|
anchor.setDisabled(false);
|
|
@@ -16013,7 +16013,8 @@ const __sfc__$F = vue.defineComponent({
|
|
|
16013
16013
|
return;
|
|
16014
16014
|
}
|
|
16015
16015
|
const offsetTop = getOffsetTop();
|
|
16016
|
-
const
|
|
16016
|
+
const indexAnchorTop = indexAnchor.getOffsetTop();
|
|
16017
|
+
const top2 = indexAnchorTop - stickyOffsetTop.value + offsetTop;
|
|
16017
16018
|
const left2 = getScrollLeft(scroller);
|
|
16018
16019
|
clickedName.value = anchorName;
|
|
16019
16020
|
emitEvent(anchorName, options);
|
|
@@ -25146,7 +25147,7 @@ withInstall(stdin_default$1);
|
|
|
25146
25147
|
withPropsDefaultsSetter(stdin_default$1, props);
|
|
25147
25148
|
const _WatermarkComponent = stdin_default$1;
|
|
25148
25149
|
var stdin_default = stdin_default$1;
|
|
25149
|
-
const version = "2.22.1
|
|
25150
|
+
const version = "2.22.1";
|
|
25150
25151
|
function install(app) {
|
|
25151
25152
|
stdin_default$3m.install && app.use(stdin_default$3m);
|
|
25152
25153
|
stdin_default$3k.install && app.use(stdin_default$3k);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/ui",
|
|
3
|
-
"version": "2.22.1
|
|
3
|
+
"version": "2.22.1",
|
|
4
4
|
"description": "A material like components library",
|
|
5
5
|
"main": "lib/varlet.cjs.js",
|
|
6
6
|
"module": "es/index.mjs",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@popperjs/core": "^2.11.6",
|
|
49
49
|
"dayjs": "^1.10.4",
|
|
50
50
|
"decimal.js": "^10.2.1",
|
|
51
|
-
"@varlet/
|
|
52
|
-
"@varlet/
|
|
53
|
-
"@varlet/
|
|
51
|
+
"@varlet/icons": "2.22.1",
|
|
52
|
+
"@varlet/shared": "2.22.1",
|
|
53
|
+
"@varlet/use": "2.22.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@vue/runtime-core": "3.4.3",
|
|
@@ -66,9 +66,9 @@
|
|
|
66
66
|
"typescript": "^5.1.5",
|
|
67
67
|
"vue": "3.4.3",
|
|
68
68
|
"vue-router": "4.2.0",
|
|
69
|
-
"@varlet/
|
|
70
|
-
"@varlet/
|
|
71
|
-
"@varlet/touch-emulator": "2.22.1
|
|
69
|
+
"@varlet/cli": "2.22.1",
|
|
70
|
+
"@varlet/ui": "2.22.1",
|
|
71
|
+
"@varlet/touch-emulator": "2.22.1"
|
|
72
72
|
},
|
|
73
73
|
"scripts": {
|
|
74
74
|
"dev": "varlet-cli dev",
|