@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 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.querySelector(`${state.currentLink}`);
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.querySelector(link);
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.querySelector(props.links[0].link)) == null ? void 0 : _b.offsetTop) || 0;
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.querySelector(props.containerId) || document.body;
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.querySelector(item.link);
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
@@ -237,7 +237,7 @@ const CASCADER = {
237
237
  PropsHover: "hoverThreshold",
238
238
  MenuConnector: "cascader-menu-"
239
239
  };
240
- const version = "3.20.1";
240
+ const version = "3.20.2";
241
241
  const log = (data, type = "log") => {
242
242
  uLog.logger[type](data);
243
243
  };
package/common/runtime.js CHANGED
@@ -22,7 +22,7 @@ import vuePopup from "./deps/vue-popup";
22
22
  import validate from "./validate";
23
23
  import memorize from "./deps/memorize";
24
24
  import * as common from ".";
25
- const version = "3.20.1";
25
+ const version = "3.20.2";
26
26
  const Renderless = {
27
27
  browser,
28
28
  array,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-renderless",
3
- "version": "3.20.1",
3
+ "version": "3.20.2",
4
4
  "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
5
5
  "author": "OpenTiny Team",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@ declare const datePickerProps: {
61
61
  default: boolean;
62
62
  };
63
63
  type: {
64
- type: PropType<"date" | "dates" | "daterange" | "week" | "month" | "monthrange" | "year" | "years" | "yearrange" | "datetime" | "datetimerange">;
64
+ type: PropType<"date" | "dates" | "year" | "years" | "yearrange" | "month" | "week" | "daterange" | "datetimerange" | "monthrange" | "datetime">;
65
65
  default: string;
66
66
  };
67
67
  _constants: {