@opendesign-plus-test/components 0.0.1-rc.256 → 0.0.1-rc.258

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.
Files changed (75) hide show
  1. package/dist/chunk-OElCookieNotice.cjs.js +1 -1
  2. package/dist/chunk-OElCookieNotice.es.js +16 -14
  3. package/dist/components/article-anchor/OArticleAnchor.vue.d.ts +138 -1
  4. package/dist/components/article-anchor/index.d.ts +157 -5
  5. package/dist/components/article-anchor/types.d.ts +10 -2
  6. package/dist/components/doc-layout/ODocLayout.vue.d.ts +368 -6
  7. package/dist/components/doc-layout/index.d.ts +200 -10
  8. package/dist/components/meeting/config.d.ts +1 -0
  9. package/dist/components/meeting/types.d.ts +1 -1
  10. package/dist/components/meeting/utils.d.ts +1 -0
  11. package/dist/components.cjs.js +47 -47
  12. package/dist/components.css +2 -2
  13. package/dist/components.es.js +9840 -9785
  14. package/dist/treeshaking/_virtual/icon-email.mjs +9 -8
  15. package/dist/treeshaking/_virtual/icon-email2.mjs +8 -9
  16. package/dist/treeshaking/assets/styles/element-plus.css +297 -0
  17. package/dist/treeshaking/components/activity/OActivityApproval.vue.mjs +2 -2
  18. package/dist/treeshaking/components/activity/OActivityApproval2.css +8 -8
  19. package/dist/treeshaking/components/activity/OActivityForm.css +3 -3
  20. package/dist/treeshaking/components/activity/OActivityForm.vue.mjs +4 -4
  21. package/dist/treeshaking/components/activity/OActivityForm2.css +6 -6
  22. package/dist/treeshaking/components/activity/OActivityMyCalendar.vue.mjs +4 -4
  23. package/dist/treeshaking/components/activity/OActivityMyCalendar2.css +5 -5
  24. package/dist/treeshaking/components/article/OArticleList.css +22 -2
  25. package/dist/treeshaking/components/article/components/DocTitle.css +52 -49
  26. package/dist/treeshaking/components/article/components/DocTitle.vue.mjs +1 -1
  27. package/dist/treeshaking/components/article/components/DocTitle.vue2.mjs +24 -20
  28. package/dist/treeshaking/components/article-anchor/OArticleAnchor.css +4 -4
  29. package/dist/treeshaking/components/article-anchor/OArticleAnchor.vue.d.ts +138 -1
  30. package/dist/treeshaking/components/article-anchor/OArticleAnchor.vue.mjs +1 -1
  31. package/dist/treeshaking/components/article-anchor/OArticleAnchor.vue2.mjs +72 -5
  32. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorItems.css +3 -3
  33. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorItems.vue.mjs +1 -1
  34. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorItems.vue2.mjs +4 -3
  35. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorMobile.css +11 -11
  36. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorMobile.vue.mjs +1 -1
  37. package/dist/treeshaking/components/article-anchor/components/ArticleAnchorMobile.vue2.mjs +15 -13
  38. package/dist/treeshaking/components/article-anchor/index.d.ts +157 -5
  39. package/dist/treeshaking/components/article-anchor/types.d.ts +10 -2
  40. package/dist/treeshaking/components/article-pagination/OArticlePagination.css +42 -50
  41. package/dist/treeshaking/components/article-pagination/OArticlePagination.vue.mjs +1 -1
  42. package/dist/treeshaking/components/common/TooltipText.css +6 -6
  43. package/dist/treeshaking/components/common/TooltipText.vue.mjs +1 -1
  44. package/dist/treeshaking/components/doc-layout/ODocLayout.css +56 -41
  45. package/dist/treeshaking/components/doc-layout/ODocLayout.vue.d.ts +368 -6
  46. package/dist/treeshaking/components/doc-layout/ODocLayout.vue.mjs +1 -1
  47. package/dist/treeshaking/components/doc-layout/ODocLayout.vue2.mjs +41 -27
  48. package/dist/treeshaking/components/doc-layout/index.d.ts +200 -10
  49. package/dist/treeshaking/components/element-plus/OElCookieNotice.css +1 -1
  50. package/dist/treeshaking/components/element-plus/OElCookieNotice.vue.mjs +1 -1
  51. package/dist/treeshaking/components/element-plus/OElCookieNotice.vue2.mjs +1 -1
  52. package/dist/treeshaking/components/element-plus/OElCookieNotice2.css +143 -143
  53. package/dist/treeshaking/components/markdown/OMarkdown.vue.mjs +1 -1
  54. package/dist/treeshaking/components/markdown/OMarkdown.vue2.mjs +1 -1
  55. package/dist/treeshaking/components/markdown/OMarkdown2.css +3 -3
  56. package/dist/treeshaking/components/meeting/OMeetingForm.css +4 -3
  57. package/dist/treeshaking/components/meeting/OMeetingForm.vue.mjs +19 -14
  58. package/dist/treeshaking/components/meeting/OMeetingForm2.css +1 -1
  59. package/dist/treeshaking/components/meeting/OMeetingMyCalendar.vue.mjs +3 -3
  60. package/dist/treeshaking/components/meeting/OMeetingMyCalendar2.css +9 -9
  61. package/dist/treeshaking/components/meeting/components/OMeetingPlaybackSubtitles.vue.mjs +1 -1
  62. package/dist/treeshaking/components/meeting/components/OMeetingPlaybackSubtitles2.css +11 -11
  63. package/dist/treeshaking/components/meeting/components/OMeetingPlaybackVideo.css +72 -72
  64. package/dist/treeshaking/components/meeting/config.d.ts +1 -0
  65. package/dist/treeshaking/components/meeting/config.mjs +2 -0
  66. package/dist/treeshaking/components/meeting/types.d.ts +1 -1
  67. package/dist/treeshaking/components/meeting/utils.d.ts +1 -0
  68. package/dist/treeshaking/components/meeting/utils.mjs +5 -0
  69. package/dist/treeshaking/components/org/OOrgMembers.vue2.mjs +1 -1
  70. package/dist/treeshaking/components/sig/components/OSigItem.css +1 -1
  71. package/dist/treeshaking/components/user-center/OAccountSetting.vue2.mjs +1 -1
  72. package/dist/treeshaking/i18n/en.mjs +1 -0
  73. package/dist/treeshaking/i18n/zh.mjs +1 -0
  74. package/dist/treeshaking/index.mjs +1 -0
  75. package/package.json +1 -1
@@ -21,13 +21,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
21
21
  autoExtract: { type: Boolean, default: true },
22
22
  maxLevel: { default: 2 },
23
23
  writeId: { type: Boolean, default: true },
24
+ idPrefix: { default: "" },
24
25
  container: {},
25
26
  targetOffset: {},
27
+ bounds: { default: 5 },
28
+ changeHash: { type: Boolean, default: true },
26
29
  radius: { default: "var(--o-radius-xs)" }
27
30
  },
28
- setup(__props, { expose: __expose }) {
31
+ emits: ["change", "click"],
32
+ setup(__props, { expose: __expose, emit: __emit }) {
29
33
  const props = __props;
30
34
  const { t } = useI18n();
35
+ const emit = __emit;
31
36
  const autoItems = ref([]);
32
37
  const items = computed(() => props.items.length ? props.items : autoItems.value);
33
38
  const titleText = computed(() => props.title || t("articleAnchor.title"));
@@ -41,14 +46,62 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
41
46
  watch([() => props.size, expanded], () => {
42
47
  document.body.style.overflow = props.size === "mobile" && expanded.value ? "hidden" : "";
43
48
  });
44
- const onAnchorClick = () => {
49
+ const onAnchorClick = (ev, link) => {
50
+ emit("click", ev, link);
45
51
  if (props.size === "pad") {
46
52
  expanded.value = false;
47
53
  }
48
54
  };
55
+ const onAnchorChange = (link) => {
56
+ emit("change", link);
57
+ };
58
+ const hrefAliasMap = computed(() => {
59
+ const map = /* @__PURE__ */ new Map();
60
+ const walk = (list) => {
61
+ list.forEach((item) => {
62
+ var _a;
63
+ if (item.observeHref && item.observeHref !== item.href) {
64
+ map.set(item.href, item.observeHref);
65
+ }
66
+ if ((_a = item.children) == null ? void 0 : _a.length) {
67
+ walk(item.children);
68
+ }
69
+ });
70
+ };
71
+ walk(items.value);
72
+ return map;
73
+ });
74
+ const jumpFromHash = (hash) => {
75
+ var _a, _b;
76
+ const link = (_b = (_a = anchorRef.value) == null ? void 0 : _a.$el) == null ? void 0 : _b.querySelector(`a[href="${CSS.escape(hash)}"]`);
77
+ if (link) {
78
+ link.click();
79
+ return;
80
+ }
81
+ const observeHref = hrefAliasMap.value.get(hash);
82
+ const el = observeHref && document.getElementById(observeHref.replace(/^#/, ""));
83
+ if (!el) {
84
+ return;
85
+ }
86
+ const container = typeof props.container === "string" ? document.querySelector(props.container) || window : props.container || window;
87
+ const offsetTop = el.getBoundingClientRect().top - (container === window ? document.documentElement.clientTop : container.getBoundingClientRect().top);
88
+ const y = (container === window ? window.scrollY : container.scrollTop) + offsetTop - (props.targetOffset ?? 0);
89
+ if (container === window) {
90
+ window.scrollTo({ top: y });
91
+ } else {
92
+ container.scrollTo({ top: y });
93
+ }
94
+ };
95
+ const onHashChange = () => {
96
+ if (!window.location.hash) {
97
+ return;
98
+ }
99
+ jumpFromHash(decodeURIComponent(window.location.hash));
100
+ };
49
101
  const pcSlotRef = ref();
50
102
  const padSlotRef = ref();
51
103
  const hiddenSlotRef = ref();
104
+ const anchorRef = ref();
52
105
  const teleportTarget = computed(() => {
53
106
  if (props.size === "pc") {
54
107
  return pcSlotRef.value;
@@ -100,7 +153,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
100
153
  }
101
154
  }
102
155
  seen.add(id);
103
- const item = { id, title: (elH.textContent || "").trim(), children: [] };
156
+ let href = `#${id}`;
157
+ let observeHref;
158
+ if (props.idPrefix && id.startsWith(props.idPrefix) && id.length > props.idPrefix.length) {
159
+ href = `#${id.slice(props.idPrefix.length)}`;
160
+ observeHref = `#${id}`;
161
+ }
162
+ const item = { href, title: (elH.textContent || "").trim(), observeHref, children: [] };
104
163
  while (stack.length > 1 && stack[stack.length - 1].level >= level) {
105
164
  stack.pop();
106
165
  }
@@ -145,13 +204,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
145
204
  onMounted(() => {
146
205
  collect();
147
206
  ensureObserver();
207
+ onHashChange();
208
+ window.addEventListener("hashchange", onHashChange);
148
209
  });
149
210
  onBeforeUnmount(() => {
150
211
  teardownObserver();
151
212
  document.body.style.overflow = "";
213
+ window.removeEventListener("hashchange", onHashChange);
152
214
  });
153
215
  watch(
154
- () => [props.selector, props.autoExtract, props.maxLevel],
216
+ () => [props.selector, props.autoExtract, props.maxLevel, props.idPrefix],
155
217
  () => {
156
218
  teardownObserver();
157
219
  collect();
@@ -214,17 +276,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
214
276
  }, [
215
277
  createElementVNode("div", _hoisted_2, [
216
278
  createVNode(unref(OAnchor), {
279
+ ref_key: "anchorRef",
280
+ ref: anchorRef,
217
281
  layout: "v",
218
282
  size: "small",
219
283
  container: __props.container,
220
284
  "target-offset": __props.targetOffset,
285
+ bounds: __props.bounds,
286
+ "change-hash": __props.changeHash,
287
+ onChange: onAnchorChange,
221
288
  onClick: onAnchorClick
222
289
  }, {
223
290
  default: withCtx(() => [
224
291
  createVNode(ArticleAnchorItems, { items: items.value }, null, 8, ["items"])
225
292
  ]),
226
293
  _: 1
227
- }, 8, ["container", "target-offset"])
294
+ }, 8, ["container", "target-offset", "bounds", "change-hash"])
228
295
  ])
229
296
  ], 8, ["to", "disabled"]))
230
297
  ])) : createCommentVNode("", true);
@@ -1,11 +1,11 @@
1
- .hover-icon-rotate .o-icon[data-v-c0fc5e57] {
1
+ .hover-icon-rotate .o-icon[data-v-126e1824] {
2
2
  transition: all var(--o-duration-m1) var(--o-easing-standard-in);
3
3
  }
4
4
  @media (hover: hover) {
5
- .hover-icon-rotate:hover .o-icon[data-v-c0fc5e57] {
5
+ .hover-icon-rotate:hover .o-icon[data-v-126e1824] {
6
6
  transform: rotate(-180deg);
7
7
  }
8
8
  }
9
- .o-article-anchor-item[data-v-c0fc5e57] {
9
+ .o-article-anchor-item[data-v-126e1824] {
10
10
  --link-color: var(--o-color-info2);
11
11
  }
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./ArticleAnchorItems.vue2.mjs";
2
2
  import './ArticleAnchorItems.css';
3
3
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const ArticleAnchorItems = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-c0fc5e57"]]);
4
+ const ArticleAnchorItems = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-126e1824"]]);
5
5
  export {
6
6
  ArticleAnchorItems as default
7
7
  };
@@ -10,9 +10,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
10
10
  return (_ctx, _cache) => {
11
11
  return openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
12
12
  return openBlock(), createBlock(unref(OAnchorItem), {
13
- key: item.id,
13
+ key: item.href,
14
14
  title: item.title,
15
- href: `#${item.id}`,
15
+ href: item.href,
16
+ "observe-href": item.observeHref,
16
17
  class: "o-article-anchor-item"
17
18
  }, {
18
19
  default: withCtx(() => {
@@ -25,7 +26,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
25
26
  ];
26
27
  }),
27
28
  _: 2
28
- }, 1032, ["title", "href"]);
29
+ }, 1032, ["title", "href", "observe-href"]);
29
30
  }), 128);
30
31
  };
31
32
  }
@@ -1,15 +1,15 @@
1
- .hover-icon-rotate .o-icon[data-v-648619c2] {
1
+ .hover-icon-rotate .o-icon[data-v-ccc0d33c] {
2
2
  transition: all var(--o-duration-m1) var(--o-easing-standard-in);
3
3
  }
4
4
  @media (hover: hover) {
5
- .hover-icon-rotate:hover .o-icon[data-v-648619c2] {
5
+ .hover-icon-rotate:hover .o-icon[data-v-ccc0d33c] {
6
6
  transform: rotate(-180deg);
7
7
  }
8
8
  }
9
- .o-article-anchor--mobile[data-v-648619c2] {
10
- --o-article-anchor-radius: var(--v1994d85b);
9
+ .o-article-anchor--mobile[data-v-ccc0d33c] {
10
+ --o-article-anchor-radius: var(--v3bf9ee34);
11
11
  }
12
- .o-article-anchor--mobile__fab[data-v-648619c2] {
12
+ .o-article-anchor--mobile__fab[data-v-ccc0d33c] {
13
13
  display: flex;
14
14
  align-items: center;
15
15
  justify-content: center;
@@ -21,27 +21,27 @@
21
21
  border-radius: 50%;
22
22
  box-shadow: var(--o-shadow-3);
23
23
  }
24
- .o-article-anchor--mobile__fab-icon[data-v-648619c2] {
24
+ .o-article-anchor--mobile__fab-icon[data-v-ccc0d33c] {
25
25
  font-size: 24px;
26
26
  color: var(--o-color-info2);
27
27
  line-height: 1;
28
28
  }
29
- .o-article-anchor--mobile__sheet-title[data-v-648619c2] {
29
+ .o-article-anchor--mobile__sheet-title[data-v-ccc0d33c] {
30
30
  color: var(--o-color-info1);
31
31
  font-weight: 600;
32
32
  font-size: 18px;
33
33
  line-height: 26px;
34
34
  }
35
- .o-article-anchor--mobile__menu[data-v-648619c2] {
35
+ .o-article-anchor--mobile__menu[data-v-ccc0d33c] {
36
36
  --menu-width: 100%;
37
37
  }
38
- .o-article-anchor--mobile__menu-sub[data-v-648619c2] {
38
+ .o-article-anchor--mobile__menu-sub[data-v-ccc0d33c] {
39
39
  padding-left: 16px;
40
40
  }
41
- .o-article-anchor--mobile__menu-item[data-v-648619c2] {
41
+ .o-article-anchor--mobile__menu-item[data-v-ccc0d33c] {
42
42
  padding: 12px 16px;
43
43
  }
44
- .o-article-anchor--mobile__menu-subitem[data-v-648619c2] {
44
+ .o-article-anchor--mobile__menu-subitem[data-v-ccc0d33c] {
45
45
  padding: 12px 16px;
46
46
  padding-left: 28px;
47
47
  }
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./ArticleAnchorMobile.vue2.mjs";
2
2
  import './ArticleAnchorMobile.css';
3
3
  import _export_sfc from "../../../_virtual/_plugin-vue_export-helper.mjs";
4
- const ArticleAnchorMobile = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-648619c2"]]);
4
+ const ArticleAnchorMobile = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-ccc0d33c"]]);
5
5
  export {
6
6
  ArticleAnchorMobile as default
7
7
  };
@@ -18,7 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  emits: ["toggle", "close", "update:visible"],
19
19
  setup(__props, { emit: __emit }) {
20
20
  useCssVars((_ctx) => ({
21
- "v1994d85b": _ctx.radius
21
+ "v3bf9ee34": _ctx.radius
22
22
  }));
23
23
  const props = __props;
24
24
  const emit = __emit;
@@ -66,16 +66,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
66
66
  const offset = (props.targetOffset ?? 0) + 1;
67
67
  let current = null;
68
68
  for (const item of flatItems.value) {
69
- const el = document.getElementById(item.id);
69
+ const observeId = (item.observeHref || item.href).replace(/^#/, "");
70
+ const el = document.getElementById(observeId);
70
71
  if (!el) {
71
72
  continue;
72
73
  }
73
74
  if (el.getBoundingClientRect().top - containerTop <= offset) {
74
- current = item.id;
75
+ current = item.href;
75
76
  }
76
77
  }
77
- if (current && active.value !== `#${current}`) {
78
- active.value = `#${current}`;
78
+ if (current && active.value !== current) {
79
+ active.value = current;
79
80
  }
80
81
  };
81
82
  useEventListener(scrollTarget, "scroll", updateActive);
@@ -94,9 +95,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
94
95
  },
95
96
  { deep: true }
96
97
  );
97
- const jump = (id) => {
98
+ const jump = (item) => {
98
99
  var _a;
99
- (_a = document.getElementById(id)) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "start" });
100
+ const target = item.observeHref || item.href;
101
+ (_a = document.getElementById(target.replace(/^#/, ""))) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth", block: "start" });
100
102
  emit("close");
101
103
  };
102
104
  return (_ctx, _cache) => {
@@ -138,12 +140,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
138
140
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
139
141
  var _a;
140
142
  return openBlock(), createElementBlock(Fragment, {
141
- key: item.id
143
+ key: item.href
142
144
  }, [
143
145
  createVNode(unref(OMenuItem), {
144
146
  class: "o-article-anchor--mobile__menu-item",
145
- value: `#${item.id}`,
146
- onClick: ($event) => jump(item.id)
147
+ value: item.href,
148
+ onClick: ($event) => jump(item)
147
149
  }, {
148
150
  default: withCtx(() => [
149
151
  createTextVNode(toDisplayString(item.title), 1)
@@ -152,10 +154,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
152
154
  }, 1032, ["value", "onClick"]),
153
155
  ((_a = item.children) == null ? void 0 : _a.length) ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(item.children, (child) => {
154
156
  return openBlock(), createBlock(unref(OMenuItem), {
155
- key: child.id,
156
- value: `#${child.id}`,
157
+ key: child.href,
158
+ value: child.href,
157
159
  class: "o-article-anchor--mobile__menu-subitem",
158
- onClick: ($event) => jump(child.id)
160
+ onClick: ($event) => jump(child)
159
161
  }, {
160
162
  default: withCtx(() => [
161
163
  createTextVNode(toDisplayString(child.title), 1)
@@ -1,21 +1,158 @@
1
1
  import { App } from 'vue';
2
2
  declare const OArticleAnchor: {
3
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./types').ArticleAnchorPropsT> & Readonly<{}>, {
3
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./types').ArticleAnchorPropsT> & Readonly<{
4
+ onChange?: ((link: string) => any) | undefined;
5
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
6
+ }>, {
4
7
  collect: () => void;
5
8
  items: import('vue').ComputedRef<import('./types').ArticleAnchorItemT[]>;
6
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
9
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ change: (link: string) => any;
11
+ click: (ev: MouseEvent, link?: string | undefined) => any;
12
+ }, import('vue').PublicProps, {
7
13
  size: "pc" | "pad" | "mobile";
8
14
  items: import('./types').ArticleAnchorItemT[];
15
+ bounds: number;
16
+ changeHash: boolean;
9
17
  radius: string;
10
18
  showTitle: boolean;
11
19
  selector: string | HTMLElement;
12
20
  autoExtract: boolean;
13
21
  maxLevel: number;
14
22
  writeId: boolean;
23
+ idPrefix: string;
15
24
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
16
25
  pcSlotRef: HTMLDivElement;
17
26
  padSlotRef: HTMLDivElement;
18
27
  hiddenSlotRef: HTMLDivElement;
28
+ anchorRef: ({
29
+ $: import('vue').ComponentInternalInstance;
30
+ $data: {};
31
+ $props: Partial<{
32
+ size: "medium" | "small" | "menu";
33
+ layout: "h" | "v";
34
+ bounds: number;
35
+ targetOffset: number;
36
+ changeHash: boolean;
37
+ }> & Omit<{
38
+ readonly size: "small" | "medium" | "menu";
39
+ readonly layout: "v" | "h";
40
+ readonly targetOffset: number;
41
+ readonly bounds: number;
42
+ readonly changeHash: boolean;
43
+ readonly container?: string | Window | HTMLElement | undefined;
44
+ readonly onChange?: ((link: string) => any) | undefined | undefined;
45
+ readonly onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined | undefined;
46
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "size" | "layout" | "targetOffset" | "bounds" | "changeHash">;
47
+ $attrs: import('vue').Attrs;
48
+ $refs: {
49
+ [x: string]: unknown;
50
+ } & {
51
+ anchorRef: HTMLDivElement;
52
+ anchorItemsRef: HTMLDivElement;
53
+ };
54
+ $slots: Readonly<{
55
+ [name: string]: import('vue').Slot<any> | undefined;
56
+ }>;
57
+ $root: import('vue').ComponentPublicInstance | null;
58
+ $parent: import('vue').ComponentPublicInstance | null;
59
+ $host: Element | null;
60
+ $emit: ((event: "change", link: string) => void) & ((event: "click", ev: MouseEvent, link?: string | undefined) => void);
61
+ $el: HTMLDivElement;
62
+ $options: import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
63
+ layout: {
64
+ type: import('vue').PropType<import('@opensig/opendesign').AnchorDirectionT>;
65
+ default: string;
66
+ };
67
+ size: {
68
+ type: import('vue').PropType<import('@opensig/opendesign').AnchorSizeT>;
69
+ default: string;
70
+ };
71
+ container: {
72
+ type: import('vue').PropType<string | HTMLElement | Window>;
73
+ };
74
+ bounds: {
75
+ type: NumberConstructor;
76
+ default: number;
77
+ };
78
+ targetOffset: {
79
+ type: NumberConstructor;
80
+ default: number;
81
+ };
82
+ changeHash: {
83
+ type: BooleanConstructor;
84
+ default: boolean;
85
+ };
86
+ }>> & Readonly<{
87
+ onChange?: ((link: string) => any) | undefined;
88
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
89
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
90
+ change: (link: string) => any;
91
+ click: (ev: MouseEvent, link?: string | undefined) => any;
92
+ }, string, {
93
+ size: "medium" | "small" | "menu";
94
+ layout: "h" | "v";
95
+ bounds: number;
96
+ targetOffset: number;
97
+ changeHash: boolean;
98
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
99
+ beforeCreate?: (() => void) | (() => void)[];
100
+ created?: (() => void) | (() => void)[];
101
+ beforeMount?: (() => void) | (() => void)[];
102
+ mounted?: (() => void) | (() => void)[];
103
+ beforeUpdate?: (() => void) | (() => void)[];
104
+ updated?: (() => void) | (() => void)[];
105
+ activated?: (() => void) | (() => void)[];
106
+ deactivated?: (() => void) | (() => void)[];
107
+ beforeDestroy?: (() => void) | (() => void)[];
108
+ beforeUnmount?: (() => void) | (() => void)[];
109
+ destroyed?: (() => void) | (() => void)[];
110
+ unmounted?: (() => void) | (() => void)[];
111
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
112
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
113
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
114
+ };
115
+ $forceUpdate: () => void;
116
+ $nextTick: typeof import('vue').nextTick;
117
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
118
+ } & Readonly<{
119
+ size: "medium" | "small" | "menu";
120
+ layout: "h" | "v";
121
+ bounds: number;
122
+ targetOffset: number;
123
+ changeHash: boolean;
124
+ }> & Omit<Readonly<import('vue').ExtractPropTypes<{
125
+ layout: {
126
+ type: import('vue').PropType<import('@opensig/opendesign').AnchorDirectionT>;
127
+ default: string;
128
+ };
129
+ size: {
130
+ type: import('vue').PropType<import('@opensig/opendesign').AnchorSizeT>;
131
+ default: string;
132
+ };
133
+ container: {
134
+ type: import('vue').PropType<string | HTMLElement | Window>;
135
+ };
136
+ bounds: {
137
+ type: NumberConstructor;
138
+ default: number;
139
+ };
140
+ targetOffset: {
141
+ type: NumberConstructor;
142
+ default: number;
143
+ };
144
+ changeHash: {
145
+ type: BooleanConstructor;
146
+ default: boolean;
147
+ };
148
+ }>> & Readonly<{
149
+ onChange?: ((link: string) => any) | undefined;
150
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
151
+ }>, "size" | "layout" | "targetOffset" | "bounds" | "changeHash"> & {} & import('vue').ComponentCustomProperties & {} & {
152
+ $slots: {
153
+ default?(_: {}): any;
154
+ };
155
+ }) | null;
19
156
  }, any, import('vue').ComponentProvideOptions, {
20
157
  P: {};
21
158
  B: {};
@@ -23,34 +160,49 @@ declare const OArticleAnchor: {
23
160
  C: {};
24
161
  M: {};
25
162
  Defaults: {};
26
- }, Readonly<import('./types').ArticleAnchorPropsT> & Readonly<{}>, {
163
+ }, Readonly<import('./types').ArticleAnchorPropsT> & Readonly<{
164
+ onChange?: ((link: string) => any) | undefined;
165
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
166
+ }>, {
27
167
  collect: () => void;
28
168
  items: import('vue').ComputedRef<import('./types').ArticleAnchorItemT[]>;
29
169
  }, {}, {}, {}, {
30
170
  size: "pc" | "pad" | "mobile";
31
171
  items: import('./types').ArticleAnchorItemT[];
172
+ bounds: number;
173
+ changeHash: boolean;
32
174
  radius: string;
33
175
  showTitle: boolean;
34
176
  selector: string | HTMLElement;
35
177
  autoExtract: boolean;
36
178
  maxLevel: number;
37
179
  writeId: boolean;
180
+ idPrefix: string;
38
181
  }>;
39
182
  __isFragment?: never;
40
183
  __isTeleport?: never;
41
184
  __isSuspense?: never;
42
- } & import('vue').ComponentOptionsBase<Readonly<import('./types').ArticleAnchorPropsT> & Readonly<{}>, {
185
+ } & import('vue').ComponentOptionsBase<Readonly<import('./types').ArticleAnchorPropsT> & Readonly<{
186
+ onChange?: ((link: string) => any) | undefined;
187
+ onClick?: ((ev: MouseEvent, link?: string | undefined) => any) | undefined;
188
+ }>, {
43
189
  collect: () => void;
44
190
  items: import('vue').ComputedRef<import('./types').ArticleAnchorItemT[]>;
45
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {
191
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
192
+ change: (link: string) => any;
193
+ click: (ev: MouseEvent, link?: string | undefined) => any;
194
+ }, string, {
46
195
  size: "pc" | "pad" | "mobile";
47
196
  items: import('./types').ArticleAnchorItemT[];
197
+ bounds: number;
198
+ changeHash: boolean;
48
199
  radius: string;
49
200
  showTitle: boolean;
50
201
  selector: string | HTMLElement;
51
202
  autoExtract: boolean;
52
203
  maxLevel: number;
53
204
  writeId: boolean;
205
+ idPrefix: string;
54
206
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
55
207
  install(app: App): void;
56
208
  };
@@ -1,8 +1,10 @@
1
1
  export interface ArticleAnchorItemT {
2
- /** 锚点 id(不含 #),对应页面元素 id */
3
- id: string;
2
+ /** 锚点链接(含 # 前缀),如 '#manual-a',对应页面元素 id */
3
+ href: string;
4
4
  /** 展示标题 */
5
5
  title: string;
6
+ /** 透传 OAnchorItem:锚点监听的目标元素(含 # 前缀),不传时监听 href */
7
+ observeHref?: string;
6
8
  /** 子锚点(嵌套渲染缩进) */
7
9
  children?: ArticleAnchorItemT[];
8
10
  }
@@ -23,10 +25,16 @@ export interface ArticleAnchorPropsT {
23
25
  maxLevel?: number;
24
26
  /** 无 id 标题自动生成 slug 并回写到元素 id(保证锚点可用),默认 true */
25
27
  writeId?: boolean;
28
+ /** 自动收集时,元素 id 若以该前缀开头(如 'user-content-'),则 item.href 去掉前缀展示(#a),observeHref 指向完整 id(#user-content-a);默认 '' 不处理 */
29
+ idPrefix?: string;
26
30
  /** 透传 OAnchor:滚动容器,默认 window */
27
31
  container?: string | HTMLElement | Window;
28
32
  /** 透传 OAnchor:滚动偏移量 */
29
33
  targetOffset?: number;
34
+ /** 透传 OAnchor:锚点激活的边界范围,默认 5 */
35
+ bounds?: number;
36
+ /** 透传 OAnchor:点击锚点时是否改变地址栏 hash,默认 true */
37
+ changeHash?: boolean;
30
38
  /** 卡片圆角 */
31
39
  radius?: string;
32
40
  }