@opentiny/vue-renderless 3.20.1 → 3.20.2
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/anchor/index.js +6 -5
- package/common/index.js +1 -1
- package/common/runtime.js +1 -1
- package/package.json +1 -1
- package/types/date-picker.type.d.ts +1 -1
package/anchor/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "../chunk-G2ADBYYC.js";
|
|
2
2
|
import { addClass, removeClass } from "../common/deps/dom";
|
|
3
|
+
const getEleMentBySelect = (parent, selector) => (selector == null ? void 0 : selector.startsWith("#")) ? document.getElementById("selector") : parent.querySelector(selector);
|
|
3
4
|
const setFixAnchor = ({ vm, props }) => () => {
|
|
4
5
|
const { anchorWrapRef } = vm.$refs;
|
|
5
6
|
if (anchorWrapRef && props.isAffix) {
|
|
@@ -10,7 +11,7 @@ const setFixAnchor = ({ vm, props }) => () => {
|
|
|
10
11
|
const setMarkClass = ({ state, props }) => {
|
|
11
12
|
const { scrollContainer } = state;
|
|
12
13
|
const { markClass } = props;
|
|
13
|
-
const activeContentEl = scrollContainer
|
|
14
|
+
const activeContentEl = getEleMentBySelect(scrollContainer, `${state.currentLink}`);
|
|
14
15
|
if (markClass) {
|
|
15
16
|
addClass(activeContentEl, markClass);
|
|
16
17
|
setTimeout(() => {
|
|
@@ -66,7 +67,7 @@ const addObserver = ({ props, state }) => {
|
|
|
66
67
|
list.forEach((item) => {
|
|
67
68
|
const link = item.link;
|
|
68
69
|
expandLink[link] = item;
|
|
69
|
-
const linkEl = document
|
|
70
|
+
const linkEl = getEleMentBySelect(document, link);
|
|
70
71
|
linkEl && intersectionObserver.observe(linkEl);
|
|
71
72
|
if (item.children) {
|
|
72
73
|
observer(item.children);
|
|
@@ -94,9 +95,9 @@ const setChildOffsetTop = ({ state, props }) => {
|
|
|
94
95
|
if (!((_a = props.links) == null ? void 0 : _a.length)) {
|
|
95
96
|
return;
|
|
96
97
|
}
|
|
97
|
-
state.childOffsetTop = ((_b = document
|
|
98
|
+
state.childOffsetTop = ((_b = getEleMentBySelect(document, props.links[0].link)) == null ? void 0 : _b.offsetTop) || 0;
|
|
98
99
|
};
|
|
99
|
-
const getContainer = ({ props }) => () => props.containerId && document
|
|
100
|
+
const getContainer = ({ props }) => () => props.containerId && getEleMentBySelect(document, props.containerId) || document.body;
|
|
100
101
|
const mounted = ({ state, api, props, nextTick }) => () => {
|
|
101
102
|
nextTick(() => {
|
|
102
103
|
api.setScrollContainer();
|
|
@@ -170,7 +171,7 @@ const linkClick = ({ state, vm, emit, props, api }) => (e, item) => {
|
|
|
170
171
|
updateSkidPosition({ vm, state, emit });
|
|
171
172
|
setMarkClass({ state, props });
|
|
172
173
|
if (scrollContainer && scrollContainer !== document.body && !isChangeHash) {
|
|
173
|
-
const linkEl = scrollContainer
|
|
174
|
+
const linkEl = getEleMentBySelect(scrollContainer, item.link);
|
|
174
175
|
const top = (linkEl == null ? void 0 : linkEl.getBoundingClientRect().top) - scrollContainer.getBoundingClientRect().top + scrollContainer.scrollTop - props.offsetTop;
|
|
175
176
|
const param = { top, left: 0, behavior: "smooth" };
|
|
176
177
|
scrollContainer == null ? void 0 : scrollContainer.scrollTo(param);
|
package/common/index.js
CHANGED
package/common/runtime.js
CHANGED
package/package.json
CHANGED
|
@@ -61,7 +61,7 @@ declare const datePickerProps: {
|
|
|
61
61
|
default: boolean;
|
|
62
62
|
};
|
|
63
63
|
type: {
|
|
64
|
-
type: PropType<"date" | "dates" | "
|
|
64
|
+
type: PropType<"date" | "dates" | "year" | "years" | "yearrange" | "month" | "week" | "daterange" | "datetimerange" | "monthrange" | "datetime">;
|
|
65
65
|
default: string;
|
|
66
66
|
};
|
|
67
67
|
_constants: {
|