@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
|
@@ -42,7 +42,6 @@ const __sfc__ = defineComponent({
|
|
|
42
42
|
inheritAttrs: false,
|
|
43
43
|
props,
|
|
44
44
|
setup(props2) {
|
|
45
|
-
const ownTop = ref(0);
|
|
46
45
|
const disabled = ref(false);
|
|
47
46
|
const name2 = computed(() => props2.index);
|
|
48
47
|
const anchorEl = ref(null);
|
|
@@ -51,16 +50,15 @@ const __sfc__ = defineComponent({
|
|
|
51
50
|
const indexAnchorProvider = {
|
|
52
51
|
index,
|
|
53
52
|
name: name2,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
setDisabled
|
|
53
|
+
setDisabled,
|
|
54
|
+
getOffsetTop
|
|
57
55
|
};
|
|
58
56
|
bindIndexBar(indexAnchorProvider);
|
|
59
|
-
function
|
|
57
|
+
function getOffsetTop() {
|
|
60
58
|
if (!anchorEl.value) {
|
|
61
|
-
return;
|
|
59
|
+
return 0;
|
|
62
60
|
}
|
|
63
|
-
|
|
61
|
+
return anchorEl.value.$el ? anchorEl.value.$el.offsetTop : anchorEl.value.offsetTop;
|
|
64
62
|
}
|
|
65
63
|
function setDisabled(value) {
|
|
66
64
|
disabled.value = value;
|
|
@@ -112,10 +112,9 @@ const __sfc__ = defineComponent({
|
|
|
112
112
|
() => length.value,
|
|
113
113
|
() => __async(this, null, function* () {
|
|
114
114
|
yield doubleRaf();
|
|
115
|
-
indexAnchors.forEach(({ name: name2
|
|
115
|
+
indexAnchors.forEach(({ name: name2 }) => {
|
|
116
116
|
if (name2.value)
|
|
117
117
|
anchorNameList.value.push(name2.value);
|
|
118
|
-
setOwnTop();
|
|
119
118
|
});
|
|
120
119
|
})
|
|
121
120
|
);
|
|
@@ -158,9 +157,9 @@ const __sfc__ = defineComponent({
|
|
|
158
157
|
const scrollHeight = scroller === window ? document.body.scrollHeight : scroller.scrollHeight;
|
|
159
158
|
const offsetTop = getOffsetTop();
|
|
160
159
|
indexAnchors.forEach((anchor, index) => {
|
|
161
|
-
const anchorTop = anchor.
|
|
160
|
+
const anchorTop = anchor.getOffsetTop();
|
|
162
161
|
const top = scrollTop - anchorTop + stickyOffsetTop.value - offsetTop;
|
|
163
|
-
const distance = index === indexAnchors.length - 1 ? scrollHeight : indexAnchors[index + 1].
|
|
162
|
+
const distance = index === indexAnchors.length - 1 ? scrollHeight : indexAnchors[index + 1].getOffsetTop() - anchor.getOffsetTop();
|
|
164
163
|
anchor.setDisabled(true);
|
|
165
164
|
if (top >= 0 && top < distance && clickedName.value === "") {
|
|
166
165
|
anchor.setDisabled(false);
|
|
@@ -181,7 +180,8 @@ const __sfc__ = defineComponent({
|
|
|
181
180
|
return;
|
|
182
181
|
}
|
|
183
182
|
const offsetTop = getOffsetTop();
|
|
184
|
-
const
|
|
183
|
+
const indexAnchorTop = indexAnchor.getOffsetTop();
|
|
184
|
+
const top = indexAnchorTop - stickyOffsetTop.value + offsetTop;
|
|
185
185
|
const left = getScrollLeft(scroller);
|
|
186
186
|
clickedName.value = anchorName;
|
|
187
187
|
emitEvent(anchorName, options);
|
package/es/index.bundle.mjs
CHANGED
|
@@ -262,7 +262,7 @@ import './tooltip/style/index.mjs'
|
|
|
262
262
|
import './uploader/style/index.mjs'
|
|
263
263
|
import './watermark/style/index.mjs'
|
|
264
264
|
|
|
265
|
-
const version = '2.22.1
|
|
265
|
+
const version = '2.22.1'
|
|
266
266
|
|
|
267
267
|
function install(app) {
|
|
268
268
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/index.mjs
CHANGED
|
@@ -174,7 +174,7 @@ export * from './tooltip/index.mjs'
|
|
|
174
174
|
export * from './uploader/index.mjs'
|
|
175
175
|
export * from './watermark/index.mjs'
|
|
176
176
|
|
|
177
|
-
const version = '2.22.1
|
|
177
|
+
const version = '2.22.1'
|
|
178
178
|
|
|
179
179
|
function install(app) {
|
|
180
180
|
ActionSheet.install && app.use(ActionSheet)
|
package/es/menu/usePopover.mjs
CHANGED