@opentiny/tiny-robot 0.4.2-alpha.3 → 0.4.2-alpha.5
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/dist/action-group/ActionGroup.vue.d.ts +26 -0
- package/dist/action-group/ActionGroupItem.vue.d.ts +18 -0
- package/dist/action-group/index.d.ts +12 -0
- package/dist/action-group/index.js +3 -3
- package/dist/action-group/index.type.d.ts +17 -0
- package/dist/anchor/components/AnchorItem.vue.d.ts +24 -0
- package/dist/anchor/components/AnchorList.vue.d.ts +20 -0
- package/dist/anchor/components/AnchorOverlay.vue.d.ts +33 -0
- package/dist/anchor/components/AnchorSearch.vue.d.ts +7 -0
- package/dist/anchor/composables/index.d.ts +5 -0
- package/dist/anchor/composables/useActiveSync.d.ts +10 -0
- package/dist/anchor/composables/useFloatingOffset.d.ts +6 -0
- package/dist/anchor/composables/useNavController.d.ts +12 -0
- package/dist/anchor/composables/useOverlayInteractions.d.ts +6 -0
- package/dist/anchor/composables/useTargetFeedback.d.ts +5 -0
- package/dist/anchor/defaults.d.ts +16 -0
- package/dist/anchor/index.d.ts +7 -0
- package/dist/anchor/index.js +44 -44
- package/dist/anchor/index.type.d.ts +60 -0
- package/dist/anchor/index.vue.d.ts +159 -0
- package/dist/anchor/internal.type.d.ts +103 -0
- package/dist/anchor/utils/scroll.d.ts +7 -0
- package/dist/anchor/utils/target.d.ts +6 -0
- package/dist/attachments/components/FileCard.vue.d.ts +18 -0
- package/dist/attachments/components/ImagePreview.vue.d.ts +17 -0
- package/dist/attachments/components/index.d.ts +2 -0
- package/dist/attachments/composables/index.d.ts +5 -0
- package/dist/attachments/composables/useFileCard.d.ts +15 -0
- package/dist/attachments/composables/useFileType.d.ts +20 -0
- package/dist/attachments/composables/useImagePreview.d.ts +18 -0
- package/dist/attachments/composables/useListType.d.ts +11 -0
- package/dist/attachments/index.d.ts +7 -0
- package/dist/attachments/index.js +96 -96
- package/dist/attachments/index.type.d.ts +70 -0
- package/dist/attachments/index.vue.d.ts +27 -0
- package/dist/attachments/utils.d.ts +3 -0
- package/dist/base-popper/components/Popper.vue.d.ts +28 -0
- package/dist/base-popper/index.d.ts +2 -0
- package/dist/base-popper/index.vue.d.ts +41 -0
- package/dist/bubble/Bubble.vue.d.ts +39 -0
- package/dist/bubble/BubbleBoxWrapper.vue.d.ts +22 -0
- package/dist/bubble/BubbleContentWrapper.vue.d.ts +16 -0
- package/dist/bubble/BubbleItem.vue.d.ts +36 -0
- package/dist/bubble/BubbleList.vue.d.ts +41 -0
- package/dist/bubble/BubbleProvider.vue.d.ts +18 -0
- package/dist/bubble/composables/index.d.ts +10 -0
- package/dist/bubble/composables/useBubbleBoxRenderer.d.ts +18 -0
- package/dist/bubble/composables/useBubbleContentRenderer.d.ts +18 -0
- package/dist/bubble/composables/useBubbleStateChange.d.ts +2 -0
- package/dist/bubble/composables/useBubbleStore.d.ts +16 -0
- package/dist/bubble/composables/useContentResolver.d.ts +5 -0
- package/dist/bubble/composables/useCopyCleanup.d.ts +6 -0
- package/dist/bubble/composables/useMessageContent.d.ts +5 -0
- package/dist/bubble/composables/useMessageGroup.d.ts +4 -0
- package/dist/bubble/composables/useOmitMessageFields.d.ts +12 -0
- package/dist/bubble/composables/useToolCall.d.ts +25 -0
- package/dist/bubble/constants.d.ts +42 -0
- package/dist/bubble/index.d.ts +19 -0
- package/dist/bubble/index.type.d.ts +171 -0
- package/dist/bubble/renderers/Box.vue.d.ts +18 -0
- package/dist/bubble/renderers/Image.vue.d.ts +4 -0
- package/dist/bubble/renderers/Loading.vue.d.ts +4 -0
- package/dist/bubble/renderers/Markdown.vue.d.ts +4 -0
- package/dist/bubble/renderers/Reasoning.vue.d.ts +9 -0
- package/dist/bubble/renderers/Text.vue.d.ts +4 -0
- package/dist/bubble/renderers/Tool.vue.d.ts +14 -0
- package/dist/bubble/renderers/ToolRole.vue.d.ts +4 -0
- package/dist/bubble/renderers/Tools.vue.d.ts +4 -0
- package/dist/bubble/renderers/allRenderers.d.ts +93 -0
- package/dist/bubble/renderers/defaultRenderers.d.ts +27 -0
- package/dist/bubble/utils.d.ts +7 -0
- package/dist/chat/components/ChatConversation.vue.d.ts +70 -0
- package/dist/chat/components/ChatLauncherButton.vue.d.ts +12 -0
- package/dist/chat/components/ChatMcpTrigger.vue.d.ts +30 -0
- package/dist/chat/components/ChatThemeToggleButton.vue.d.ts +2 -0
- package/dist/chat/components/ChatWelcome.vue.d.ts +13 -0
- package/dist/chat/composables/useChatConversation.d.ts +37 -0
- package/dist/chat/composables/useChatMcp.d.ts +29 -0
- package/dist/chat/composables/useChatModel.d.ts +27 -0
- package/dist/chat/index.d.ts +9 -0
- package/dist/chat/index.js +13701 -0
- package/dist/chat/index.type.d.ts +88 -0
- package/dist/chat/index.vue.d.ts +58 -0
- package/dist/container/index.d.ts +7 -0
- package/dist/container/index.js +13 -13
- package/dist/container/index.type.d.ts +20 -0
- package/dist/container/index.vue.d.ts +32 -0
- package/dist/conversations/index.d.ts +7 -0
- package/dist/conversations/index.vue.d.ts +2 -0
- package/dist/drag-overlay/constants.d.ts +17 -0
- package/dist/drag-overlay/directives/vDropzone.d.ts +14 -0
- package/dist/drag-overlay/index.d.ts +7 -0
- package/dist/drag-overlay/index.js +1 -1
- package/dist/drag-overlay/index.type.d.ts +105 -0
- package/dist/drag-overlay/index.vue.d.ts +20 -0
- package/dist/dropdown-menu/composables/usePopperHover.d.ts +6 -0
- package/dist/dropdown-menu/index.d.ts +7 -0
- package/dist/dropdown-menu/index.js +18 -18
- package/dist/dropdown-menu/index.type.d.ts +42 -0
- package/dist/dropdown-menu/index.vue.d.ts +217 -0
- package/dist/feedback/components/SourceList.vue.d.ts +11 -0
- package/dist/feedback/components/index.d.ts +1 -0
- package/dist/feedback/index.d.ts +7 -0
- package/dist/feedback/index.type.d.ts +25 -0
- package/dist/feedback/index.vue.d.ts +13 -0
- package/dist/flow-layout-buttons/index.d.ts +7 -0
- package/dist/flow-layout-buttons/index.js +1 -1
- package/dist/flow-layout-buttons/index.type.d.ts +35 -0
- package/dist/flow-layout-buttons/index.vue.d.ts +22 -0
- package/dist/history/components/Empty.vue.d.ts +7 -0
- package/dist/history/components/MenuList.vue.d.ts +24 -0
- package/dist/history/composables/useRenameEditor.d.ts +22 -0
- package/dist/history/constants.d.ts +1 -0
- package/dist/history/index.d.ts +7 -0
- package/dist/history/index.type.d.ts +33 -0
- package/dist/history/index.vue.d.ts +18 -0
- package/dist/icon-button/index.d.ts +7 -0
- package/dist/icon-button/index.type.d.ts +7 -0
- package/dist/icon-button/index.vue.d.ts +6 -0
- package/dist/index.d.ts +49 -4999
- package/dist/index.js +3 -3
- package/dist/index2.js +139 -121
- package/dist/index3.js +1 -1
- package/dist/index4.js +13 -13
- package/dist/index6.js +19 -19
- package/dist/index7.js +30 -30
- package/dist/index8.js +8 -8
- package/dist/mcp-add-form/components/CodeEditor.vue.d.ts +9 -0
- package/dist/mcp-add-form/components/FormEditor.vue.d.ts +10 -0
- package/dist/mcp-add-form/components/index.d.ts +2 -0
- package/dist/mcp-add-form/index.d.ts +7 -0
- package/dist/mcp-add-form/index.type.d.ts +19 -0
- package/dist/mcp-add-form/index.vue.d.ts +13 -0
- package/dist/mcp-server-picker/components/NoData.vue.d.ts +7 -0
- package/dist/mcp-server-picker/components/PluginCard.vue.d.ts +40 -0
- package/dist/mcp-server-picker/components/PluginModal.vue.d.ts +15 -0
- package/dist/mcp-server-picker/components/index.d.ts +3 -0
- package/dist/mcp-server-picker/index.d.ts +7 -0
- package/dist/mcp-server-picker/index.js +178 -177
- package/dist/mcp-server-picker/index.type.d.ts +99 -0
- package/dist/mcp-server-picker/index.vue.d.ts +71 -0
- package/dist/prompts/index.d.ts +12 -0
- package/dist/prompts/index.type.d.ts +59 -0
- package/dist/prompts/prompt.vue.d.ts +5 -0
- package/dist/prompts/prompts.vue.d.ts +20 -0
- package/dist/sender/components/editor-content/index.vue.d.ts +4 -0
- package/dist/sender/components/footer/index.vue.d.ts +38 -0
- package/dist/sender/components/layouts/MultiLineLayout.vue.d.ts +43 -0
- package/dist/sender/components/layouts/SingleLineLayout.vue.d.ts +32 -0
- package/dist/sender/composables/index.d.ts +7 -0
- package/dist/sender/composables/useAutoSize.d.ts +5 -0
- package/dist/sender/composables/useEditor.d.ts +13 -0
- package/dist/sender/composables/useKeyboardShortcuts.d.ts +7 -0
- package/dist/sender/composables/useModeSwitch.d.ts +4 -0
- package/dist/sender/composables/useSenderCore.d.ts +31 -0
- package/dist/sender/composables/useSlotScope.d.ts +10 -0
- package/dist/sender/context/index.d.ts +6 -0
- package/dist/sender/context/types.d.ts +7 -0
- package/dist/sender/extensions/constants.d.ts +94 -0
- package/dist/sender/extensions/index.d.ts +12 -0
- package/dist/sender/extensions/mention/commands.d.ts +20 -0
- package/dist/sender/extensions/mention/components/mention-list.vue.d.ts +18 -0
- package/dist/sender/extensions/mention/components/mention-view.vue.d.ts +19 -0
- package/dist/sender/extensions/mention/extension.d.ts +6 -0
- package/dist/sender/extensions/mention/index.d.ts +22 -0
- package/dist/sender/extensions/mention/plugin.d.ts +16 -0
- package/dist/sender/extensions/mention/types.d.ts +126 -0
- package/dist/sender/extensions/mention/utils.d.ts +34 -0
- package/dist/sender/extensions/suggestion/extension.d.ts +8 -0
- package/dist/sender/extensions/suggestion/index.d.ts +20 -0
- package/dist/sender/extensions/suggestion/plugin.d.ts +21 -0
- package/dist/sender/extensions/suggestion/suggestion-list.vue.d.ts +46 -0
- package/dist/sender/extensions/suggestion/types.d.ts +254 -0
- package/dist/sender/extensions/suggestion/utils/filter.d.ts +29 -0
- package/dist/sender/extensions/suggestion/utils/highlight.d.ts +73 -0
- package/dist/sender/extensions/template/block/extension.d.ts +6 -0
- package/dist/sender/extensions/template/block/plugins.d.ts +13 -0
- package/dist/sender/extensions/template/block/template-block-view.vue.d.ts +14 -0
- package/dist/sender/extensions/template/commands.d.ts +31 -0
- package/dist/sender/extensions/template/extension.d.ts +6 -0
- package/dist/sender/extensions/template/index.d.ts +21 -0
- package/dist/sender/extensions/template/select/dropdown-manager.d.ts +23 -0
- package/dist/sender/extensions/template/select/extension.d.ts +5 -0
- package/dist/sender/extensions/template/select/plugins.d.ts +34 -0
- package/dist/sender/extensions/template/select/template-select-view.vue.d.ts +20 -0
- package/dist/sender/extensions/template/types.d.ts +100 -0
- package/dist/sender/extensions/template/utils.d.ts +20 -0
- package/dist/sender/extensions/utils/id-generator.d.ts +16 -0
- package/dist/sender/extensions/utils/index.d.ts +7 -0
- package/dist/sender/extensions/utils/keyboard.d.ts +49 -0
- package/dist/sender/extensions/utils/position.d.ts +25 -0
- package/dist/sender/index.d.ts +136 -0
- package/dist/sender/index.js +178 -164
- package/dist/sender/index.type.d.ts +302 -0
- package/dist/sender/index.vue.d.ts +90 -0
- package/dist/sender/types/base.d.ts +239 -0
- package/dist/sender/types/components.d.ts +68 -0
- package/dist/sender/types/composables.d.ts +122 -0
- package/dist/sender/types/context.d.ts +132 -0
- package/dist/sender/types/slots.d.ts +67 -0
- package/dist/sender/utils/countGraphemes.d.ts +1 -0
- package/dist/sender-actions/action-button/index.vue.d.ts +23 -0
- package/dist/sender-actions/clear-button/index.vue.d.ts +2 -0
- package/dist/sender-actions/clear-button/useClearButtonState.d.ts +6 -0
- package/dist/sender-actions/default-actions/index.vue.d.ts +17 -0
- package/dist/sender-actions/index.d.ts +21 -0
- package/dist/sender-actions/index.js +1 -1
- package/dist/sender-actions/index.type.d.ts +7 -0
- package/dist/sender-actions/submit-button/index.vue.d.ts +2 -0
- package/dist/sender-actions/types/common.d.ts +40 -0
- package/dist/sender-actions/types/index.d.ts +5 -0
- package/dist/sender-actions/types/tooltip.d.ts +7 -0
- package/dist/sender-actions/upload-button/index.type.d.ts +57 -0
- package/dist/sender-actions/upload-button/index.vue.d.ts +16 -0
- package/dist/sender-actions/utils/tooltip.d.ts +8 -0
- package/dist/sender-actions/voice-button/index.type.d.ts +78 -0
- package/dist/sender-actions/voice-button/index.vue.d.ts +43 -0
- package/dist/sender-actions/voice-button/speech.types.d.ts +40 -0
- package/dist/sender-actions/voice-button/useSpeechHandler.d.ts +10 -0
- package/dist/sender-actions/voice-button/webSpeechHandler.d.ts +40 -0
- package/dist/sender-actions/word-counter/index.vue.d.ts +2 -0
- package/dist/sender-compat/index.d.ts +7 -0
- package/dist/sender-compat/index.type.d.ts +91 -0
- package/dist/sender-compat/index.vue.d.ts +532 -0
- package/dist/shared/composables/createTeleport.d.ts +2 -0
- package/dist/shared/composables/index.d.ts +5 -0
- package/dist/shared/composables/useAutoScroll.d.ts +25 -0
- package/dist/shared/composables/useSlotRefs.d.ts +12 -0
- package/dist/shared/composables/useTeleportTarget.d.ts +11 -0
- package/dist/shared/composables/useTouchDevice.d.ts +3 -0
- package/dist/shared/utils.d.ts +7 -0
- package/dist/style.css +1 -1
- package/dist/suggestion-pills/components/PillButton.vue.d.ts +16 -0
- package/dist/suggestion-pills/components/index.d.ts +1 -0
- package/dist/suggestion-pills/index.d.ts +13 -0
- package/dist/suggestion-pills/index.js +13 -13
- package/dist/suggestion-pills/index.type.d.ts +45 -0
- package/dist/suggestion-pills/index.vue.d.ts +44 -0
- package/dist/suggestion-popover/components/Backdrop.vue.d.ts +5 -0
- package/dist/suggestion-popover/components/Header.vue.d.ts +4 -0
- package/dist/suggestion-popover/components/Loading.vue.d.ts +17 -0
- package/dist/suggestion-popover/components/NoData.vue.d.ts +17 -0
- package/dist/suggestion-popover/components/Tooltip.vue.d.ts +19 -0
- package/dist/suggestion-popover/index.d.ts +7 -0
- package/dist/suggestion-popover/index.js +122 -125
- package/dist/suggestion-popover/index.type.d.ts +80 -0
- package/dist/suggestion-popover/index.vue.d.ts +262 -0
- package/dist/theme-provider/constants.d.ts +6 -0
- package/dist/theme-provider/index.d.ts +9 -0
- package/dist/theme-provider/index.js +32 -41
- package/dist/theme-provider/index.type.d.ts +18 -0
- package/dist/theme-provider/index.vue.d.ts +32 -0
- package/dist/theme-provider/useTheme.d.ts +11 -0
- package/dist/useSlotRefs.js +1 -1
- package/dist/useTheme.js +22 -0
- package/dist/utils.js +1 -1
- package/dist/welcome/index.d.ts +7 -0
- package/dist/welcome/index.type.d.ts +10 -0
- package/dist/welcome/index.vue.d.ts +18 -0
- package/package.json +22 -3
- package/dist/no-data.js +0 -4
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ActionGroupProps, ActionGroupSlots } from './index.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<ActionGroupSlots> & ActionGroupSlots;
|
|
5
|
+
refs: {
|
|
6
|
+
moreBtnRef: HTMLSpanElement;
|
|
7
|
+
dropDownRef: HTMLUListElement;
|
|
8
|
+
};
|
|
9
|
+
rootEl: HTMLDivElement;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<ActionGroupProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
13
|
+
"item-click": (name: string) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<ActionGroupProps> & Readonly<{
|
|
15
|
+
"onItem-click"?: ((name: string) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
17
|
+
moreBtnRef: HTMLSpanElement;
|
|
18
|
+
dropDownRef: HTMLUListElement;
|
|
19
|
+
}, HTMLDivElement>;
|
|
20
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionGroupItemProps } from './index.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
};
|
|
7
|
+
refs: {};
|
|
8
|
+
rootEl: any;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<ActionGroupItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ActionGroupItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { default as ActionGroup } from './ActionGroup.vue';
|
|
3
|
+
import { default as ActionGroupItemComp } from './ActionGroupItem.vue';
|
|
4
|
+
declare const install: <T>(app: App<T>) => void;
|
|
5
|
+
declare const _default: typeof ActionGroup & {
|
|
6
|
+
install: typeof install;
|
|
7
|
+
};
|
|
8
|
+
export default _default;
|
|
9
|
+
declare const installActionGroupItem: <T>(app: App<T>) => void;
|
|
10
|
+
export declare const ActionGroupItem: typeof ActionGroupItemComp & {
|
|
11
|
+
install: typeof installActionGroupItem;
|
|
12
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as $, useSlots as H, computed as i, ref as f, watch as I, nextTick as W, openBlock as o, createElementBlock as _, Fragment as N, renderList as R, createBlock as v, unref as h, withCtx as S, createElementVNode as w, resolveDynamicComponent as G, renderSlot as L, createVNode as x, Transition as j, withDirectives as q, normalizeClass as J, withModifiers as K, createCommentVNode as E, toDisplayString as Q, vShow as U } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { IconMoreCircle as Y } from "@opentiny/tiny-robot-svgs";
|
|
3
3
|
import { TinyTooltip as M } from "@opentiny/vue";
|
|
4
|
-
import { o as Z,
|
|
4
|
+
import { o as Z, l as ee } from "../index4.js";
|
|
5
5
|
import te from "../icon-button/index.js";
|
|
6
6
|
import { _ as oe } from "../_plugin-vue_export-helper.js";
|
|
7
7
|
const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae = { class: "tr-action-group__dropdown-item-text" }, ce = /* @__PURE__ */ $({
|
|
@@ -120,7 +120,7 @@ const ne = { class: "tr-action-group" }, re = ["onClick"], le = ["onClick"], ae
|
|
|
120
120
|
}, 8, ["disabled"])) : E("", !0)
|
|
121
121
|
]));
|
|
122
122
|
}
|
|
123
|
-
}), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-
|
|
123
|
+
}), g = /* @__PURE__ */ oe(ce, [["__scopeId", "data-v-5a06be84"]]), u = /* @__PURE__ */ $({
|
|
124
124
|
__name: "ActionGroupItem",
|
|
125
125
|
props: {
|
|
126
126
|
name: {},
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
export interface ActionGroupProps {
|
|
3
|
+
maxNum?: number;
|
|
4
|
+
showTooltip?: boolean;
|
|
5
|
+
dropDownShowLabelOnly?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ActionGroupEvents {
|
|
8
|
+
(e: 'item-click', name: string): void;
|
|
9
|
+
}
|
|
10
|
+
export interface ActionGroupSlots {
|
|
11
|
+
default: () => VNode | VNode[];
|
|
12
|
+
moreBtn: () => VNode;
|
|
13
|
+
}
|
|
14
|
+
export interface ActionGroupItemProps {
|
|
15
|
+
name: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AnchorItemProps, AnchorItemSlots } from '../internal.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<AnchorItemSlots> & AnchorItemSlots;
|
|
5
|
+
refs: {
|
|
6
|
+
itemButtonRef: HTMLButtonElement;
|
|
7
|
+
};
|
|
8
|
+
rootEl: HTMLLIElement;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
11
|
+
declare const __VLS_component: import('vue').DefineComponent<AnchorItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
select: (item: import('../index.type').AnchorItem) => any;
|
|
13
|
+
}, string, import('vue').PublicProps, Readonly<AnchorItemProps> & Readonly<{
|
|
14
|
+
onSelect?: ((item: import('../index.type').AnchorItem) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
16
|
+
itemButtonRef: HTMLButtonElement;
|
|
17
|
+
}, HTMLLIElement>;
|
|
18
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AnchorListProps, AnchorListSlots } from '../internal.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: Readonly<AnchorListSlots> & AnchorListSlots;
|
|
5
|
+
refs: {};
|
|
6
|
+
rootEl: HTMLUListElement;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
9
|
+
declare const __VLS_component: import('vue').DefineComponent<AnchorListProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
select: (item: import('../index.type').AnchorItem) => any;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<AnchorListProps> & Readonly<{
|
|
12
|
+
onSelect?: ((item: import('../index.type').AnchorItem) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLUListElement>;
|
|
14
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
17
|
+
new (): {
|
|
18
|
+
$slots: S;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AnchorOverlayProps } from '../internal.type';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
search?(_: {}): any;
|
|
6
|
+
default?(_: {}): any;
|
|
7
|
+
};
|
|
8
|
+
refs: {
|
|
9
|
+
hostEl: HTMLDivElement;
|
|
10
|
+
overlayEl: HTMLDivElement;
|
|
11
|
+
navEl: HTMLElement;
|
|
12
|
+
};
|
|
13
|
+
rootEl: HTMLDivElement;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
+
declare const __VLS_component: import('vue').DefineComponent<AnchorOverlayProps, {
|
|
17
|
+
hostEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
18
|
+
overlayEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
19
|
+
navEl: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
20
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AnchorOverlayProps> & Readonly<{}>, {
|
|
21
|
+
floatingOffset: number;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
23
|
+
hostEl: HTMLDivElement;
|
|
24
|
+
overlayEl: HTMLDivElement;
|
|
25
|
+
navEl: HTMLElement;
|
|
26
|
+
}, HTMLDivElement>;
|
|
27
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AnchorSearchProps } from '../internal.type';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<AnchorSearchProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
"update:searchQuery": (value: string) => any;
|
|
4
|
+
}, string, import('vue').PublicProps, Readonly<AnchorSearchProps> & Readonly<{
|
|
5
|
+
"onUpdate:searchQuery"?: ((value: string) => any) | undefined;
|
|
6
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLInputElement>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnchorActiveSyncOptions } from '../internal.type';
|
|
2
|
+
export declare function useActiveSync(options: AnchorActiveSyncOptions): {
|
|
3
|
+
activeId: import('vue').ComputedRef<string | undefined>;
|
|
4
|
+
scrollTo: (id: string) => void;
|
|
5
|
+
sync: () => void;
|
|
6
|
+
clearPendingScroll: () => void;
|
|
7
|
+
releaseSelectionLock: () => void;
|
|
8
|
+
handleUserScrollIntent: () => void;
|
|
9
|
+
handleScrollIntentKeydown: (event: KeyboardEvent) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AnchorFloatingOffsetOptions } from '../internal.type';
|
|
2
|
+
export declare function useFloatingOffset(options: AnchorFloatingOffsetOptions): {
|
|
3
|
+
offset: import('vue').Ref<number, number>;
|
|
4
|
+
sync: () => void;
|
|
5
|
+
resizeTargets: import('vue').ComputedRef<HTMLElement[]>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnchorControllerOptions, AnchorFilteredItem } from '../internal.type';
|
|
2
|
+
export declare function useNavController(options: AnchorControllerOptions): {
|
|
3
|
+
expanded: import('vue').ComputedRef<boolean>;
|
|
4
|
+
searchQuery: import('vue').ComputedRef<string>;
|
|
5
|
+
filteredItems: import('vue').ComputedRef<AnchorFilteredItem[]>;
|
|
6
|
+
highlightedIndex: import('vue').ComputedRef<number>;
|
|
7
|
+
highlightedId: import('vue').ComputedRef<string>;
|
|
8
|
+
setExpanded: (value: boolean) => void;
|
|
9
|
+
setSearchQuery: (value: string) => void;
|
|
10
|
+
getHighlightedItem: () => import('../index.type').AnchorItem;
|
|
11
|
+
handleNavigationKeydown: (event: KeyboardEvent) => boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AnchorOverlayInteractionsOptions } from '../internal.type';
|
|
2
|
+
export declare function useOverlayInteractions(options: AnchorOverlayInteractionsOptions): {
|
|
3
|
+
handleKeydown: (event: KeyboardEvent) => void;
|
|
4
|
+
handleMouseLeave: () => void;
|
|
5
|
+
handleFocusOut: (event: FocusEvent) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AnchorHighlightSegment, AnchorItem, AnchorSearchMatcher } from './index.type';
|
|
2
|
+
export declare const defaultAnchorSearchMatcher: AnchorSearchMatcher;
|
|
3
|
+
export declare function defaultAnchorActiveResolver(options: {
|
|
4
|
+
viewport: {
|
|
5
|
+
top: number;
|
|
6
|
+
scrollTop: number;
|
|
7
|
+
clientHeight: number;
|
|
8
|
+
scrollHeight: number;
|
|
9
|
+
};
|
|
10
|
+
anchors: Array<{
|
|
11
|
+
id: string;
|
|
12
|
+
el: HTMLElement;
|
|
13
|
+
}>;
|
|
14
|
+
activeOffset?: number;
|
|
15
|
+
}): string | undefined;
|
|
16
|
+
export declare function ensureAnchorSegments(item: AnchorItem, segments: false | AnchorHighlightSegment[]): AnchorHighlightSegment[];
|
package/dist/anchor/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as G, ref as _, computed as g, watch as F, openBlock as M, createElementBlock as R, normalizeClass as pe, createElementVNode as D, renderSlot as L, Fragment as W, renderList as ye, toDisplayString as te, createTextVNode as Te, createCommentVNode as re, createBlock as xe, createSlots as ne, withCtx as P, mergeProps as ae, useSlots as Ae, normalizeStyle as
|
|
2
|
-
import {
|
|
3
|
-
import { _ as
|
|
1
|
+
import { defineComponent as G, ref as _, computed as g, watch as F, openBlock as M, createElementBlock as R, normalizeClass as pe, createElementVNode as D, renderSlot as L, Fragment as W, renderList as ye, toDisplayString as te, createTextVNode as Te, createCommentVNode as re, createBlock as xe, createSlots as ne, withCtx as P, mergeProps as ae, useSlots as Ae, normalizeStyle as ke, onBeforeUnmount as oe, nextTick as be, useAttrs as Ce, toRefs as Me, unref as E, createVNode as se, normalizeProps as ue, guardReactiveProps as de } from "vue";
|
|
2
|
+
import { k as Ee, h as _e, d as V, i as he } from "../index4.js";
|
|
3
|
+
import { _ as j } from "../_plugin-vue_export-helper.js";
|
|
4
4
|
const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"], we = { class: "tr-anchor__marker-slot" }, Re = { class: "tr-anchor__item-content" }, Le = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "tr-anchor__highlight"
|
|
@@ -38,24 +38,24 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
|
|
|
38
38
|
function y(p) {
|
|
39
39
|
return !!(p && p.scrollWidth > p.clientWidth);
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function k() {
|
|
42
42
|
var p;
|
|
43
43
|
return ((p = h.value) == null ? void 0 : p.querySelector(".tr-anchor__item-label")) ?? null;
|
|
44
44
|
}
|
|
45
45
|
function S() {
|
|
46
|
-
n.value = l.expanded && r.value && y(
|
|
46
|
+
n.value = l.expanded && r.value && y(k());
|
|
47
47
|
}
|
|
48
48
|
function I() {
|
|
49
49
|
s(), n.value = !1, !(!l.expanded || !r.value) && c();
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function b() {
|
|
52
52
|
s(), n.value = !1;
|
|
53
53
|
}
|
|
54
54
|
function $() {
|
|
55
55
|
r.value = !0, I();
|
|
56
56
|
}
|
|
57
57
|
function H() {
|
|
58
|
-
r.value = !1,
|
|
58
|
+
r.value = !1, b();
|
|
59
59
|
}
|
|
60
60
|
function A(p) {
|
|
61
61
|
p.propertyName === "max-width" && r.value && S();
|
|
@@ -64,7 +64,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
|
|
|
64
64
|
() => l.expanded,
|
|
65
65
|
(p) => {
|
|
66
66
|
if (!p) {
|
|
67
|
-
|
|
67
|
+
b();
|
|
68
68
|
return;
|
|
69
69
|
}
|
|
70
70
|
r.value && I();
|
|
@@ -118,7 +118,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
|
|
|
118
118
|
], 40, He)
|
|
119
119
|
], 10, Oe));
|
|
120
120
|
}
|
|
121
|
-
}), Be = /* @__PURE__ */
|
|
121
|
+
}), Be = /* @__PURE__ */ j($e, [["__scopeId", "data-v-f39ebac0"]]), Ne = {
|
|
122
122
|
class: "tr-anchor__list",
|
|
123
123
|
role: "list"
|
|
124
124
|
}, De = {
|
|
@@ -173,7 +173,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
|
|
|
173
173
|
]), 1032, ["entry", "active-id", "expanded", "highlighted", "placement", "tooltip-delay"]))), 128))
|
|
174
174
|
]));
|
|
175
175
|
}
|
|
176
|
-
}), Qe = /* @__PURE__ */
|
|
176
|
+
}), Qe = /* @__PURE__ */ j(Fe, [["__scopeId", "data-v-ff2e0912"]]), Pe = {
|
|
177
177
|
key: 0,
|
|
178
178
|
class: "tr-anchor__search-cap"
|
|
179
179
|
}, Ue = { class: "tr-anchor__surface" }, Ke = /* @__PURE__ */ G({
|
|
@@ -203,7 +203,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
|
|
|
203
203
|
ref_key: "hostEl",
|
|
204
204
|
ref: i,
|
|
205
205
|
class: pe(c.value),
|
|
206
|
-
style:
|
|
206
|
+
style: ke(s.value)
|
|
207
207
|
}, [
|
|
208
208
|
D("div", {
|
|
209
209
|
ref_key: "overlayEl",
|
|
@@ -227,7 +227,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
|
|
|
227
227
|
], 512)
|
|
228
228
|
], 6));
|
|
229
229
|
}
|
|
230
|
-
}), qe = /* @__PURE__ */
|
|
230
|
+
}), qe = /* @__PURE__ */ j(Ke, [["__scopeId", "data-v-276fbba1"]]), ze = ["value", "placeholder", "aria-label"], Ve = /* @__PURE__ */ G({
|
|
231
231
|
name: "AnchorSearch",
|
|
232
232
|
__name: "AnchorSearch",
|
|
233
233
|
props: {
|
|
@@ -250,7 +250,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
|
|
|
250
250
|
}, null, 40, ze);
|
|
251
251
|
};
|
|
252
252
|
}
|
|
253
|
-
}), Ge = /* @__PURE__ */
|
|
253
|
+
}), Ge = /* @__PURE__ */ j(Ve, [["__scopeId", "data-v-89c7e60e"]]), We = (e, a) => {
|
|
254
254
|
const l = a.trim().toLowerCase(), i = (e.searchText || e.label).trim();
|
|
255
255
|
if (!l)
|
|
256
256
|
return [{ text: e.label, highlighted: !1 }];
|
|
@@ -261,7 +261,7 @@ const Oe = ["data-tooltip"], He = ["data-item-id", "aria-current", "tabindex"],
|
|
|
261
261
|
{ text: e.label.slice(r + l.length), highlighted: !1 }
|
|
262
262
|
].filter((n) => n.text.length > 0) : i.toLowerCase().includes(l) ? [{ text: e.label, highlighted: !1 }] : !1;
|
|
263
263
|
};
|
|
264
|
-
function
|
|
264
|
+
function Ye(e) {
|
|
265
265
|
var c, s;
|
|
266
266
|
const { viewport: a, anchors: l } = e;
|
|
267
267
|
if (!l.length)
|
|
@@ -278,7 +278,7 @@ function je(e) {
|
|
|
278
278
|
break;
|
|
279
279
|
return n;
|
|
280
280
|
}
|
|
281
|
-
function
|
|
281
|
+
function je(e, a) {
|
|
282
282
|
return !a || a.length === 0 ? [{ text: e.label, highlighted: !1 }] : a;
|
|
283
283
|
}
|
|
284
284
|
function Ze(e) {
|
|
@@ -299,7 +299,7 @@ function Ze(e) {
|
|
|
299
299
|
const v = d.value(u, t), T = Array.isArray(v) && v.length > 0;
|
|
300
300
|
return t && !T ? null : {
|
|
301
301
|
item: u,
|
|
302
|
-
segments:
|
|
302
|
+
segments: je(u, v)
|
|
303
303
|
};
|
|
304
304
|
}).filter((u) => u !== null);
|
|
305
305
|
}), y = g(
|
|
@@ -307,16 +307,16 @@ function Ze(e) {
|
|
|
307
307
|
var t;
|
|
308
308
|
return (t = f.value.find((u) => u.item.id === e.activeId.value)) == null ? void 0 : t.item.id;
|
|
309
309
|
}
|
|
310
|
-
),
|
|
310
|
+
), k = g(() => {
|
|
311
311
|
var t;
|
|
312
312
|
return h.value && i.value && f.value.some((u) => u.item.id === i.value) ? i.value : y.value ?? ((t = f.value[0]) == null ? void 0 : t.item.id);
|
|
313
313
|
}), S = g(() => {
|
|
314
314
|
if (!f.value.length)
|
|
315
315
|
return 0;
|
|
316
|
-
const t = f.value.findIndex((u) => u.item.id ===
|
|
316
|
+
const t = f.value.findIndex((u) => u.item.id === k.value);
|
|
317
317
|
return t === -1 ? 0 : t;
|
|
318
|
-
}), I = g(() =>
|
|
319
|
-
function
|
|
318
|
+
}), I = g(() => k.value);
|
|
319
|
+
function b() {
|
|
320
320
|
h.value = !1, i.value = void 0;
|
|
321
321
|
}
|
|
322
322
|
function $(t) {
|
|
@@ -330,7 +330,7 @@ function Ze(e) {
|
|
|
330
330
|
function A(t) {
|
|
331
331
|
var v;
|
|
332
332
|
if (!f.value.length) {
|
|
333
|
-
|
|
333
|
+
b();
|
|
334
334
|
return;
|
|
335
335
|
}
|
|
336
336
|
const u = Math.max(0, Math.min(t, f.value.length - 1));
|
|
@@ -347,20 +347,20 @@ function Ze(e) {
|
|
|
347
347
|
f,
|
|
348
348
|
(t) => {
|
|
349
349
|
if (!t.length) {
|
|
350
|
-
|
|
350
|
+
b();
|
|
351
351
|
return;
|
|
352
352
|
}
|
|
353
353
|
if (y.value) {
|
|
354
|
-
|
|
354
|
+
b();
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
357
|
-
h.value && i.value && t.some((u) => u.item.id === i.value) ||
|
|
357
|
+
h.value && i.value && t.some((u) => u.item.id === i.value) || b();
|
|
358
358
|
},
|
|
359
359
|
{ immediate: !0, flush: "sync" }
|
|
360
360
|
), F(
|
|
361
361
|
() => e.activeId.value,
|
|
362
362
|
(t) => {
|
|
363
|
-
t &&
|
|
363
|
+
t && b();
|
|
364
364
|
},
|
|
365
365
|
{ immediate: !0, flush: "sync" }
|
|
366
366
|
), {
|
|
@@ -433,7 +433,7 @@ function Xe(e) {
|
|
|
433
433
|
function y() {
|
|
434
434
|
d(), f();
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function k(o) {
|
|
437
437
|
return o instanceof HTMLElement ? o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement || o.isContentEditable : !1;
|
|
438
438
|
}
|
|
439
439
|
function S(o) {
|
|
@@ -448,7 +448,7 @@ function Xe(e) {
|
|
|
448
448
|
const t = Number.parseFloat(window.getComputedStyle(o).scrollMarginTop || "0");
|
|
449
449
|
return Number.isFinite(t) ? t : 0;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
451
|
+
function b() {
|
|
452
452
|
var Q, K;
|
|
453
453
|
const o = le(e.container.value);
|
|
454
454
|
if (!o)
|
|
@@ -476,7 +476,7 @@ function Xe(e) {
|
|
|
476
476
|
const w = e.resolveTarget(C.id);
|
|
477
477
|
return w ? [{ id: C.id, el: w }] : [];
|
|
478
478
|
})
|
|
479
|
-
), U =
|
|
479
|
+
), U = Ye({
|
|
480
480
|
viewport: {
|
|
481
481
|
top: u,
|
|
482
482
|
scrollTop: t,
|
|
@@ -506,7 +506,7 @@ function Xe(e) {
|
|
|
506
506
|
if (o.defaultPrevented || o.altKey || o.ctrlKey || o.metaKey)
|
|
507
507
|
return;
|
|
508
508
|
const t = (u = e.host) == null ? void 0 : u.value;
|
|
509
|
-
t && o.target instanceof Node && t.contains(o.target) ||
|
|
509
|
+
t && o.target instanceof Node && t.contains(o.target) || k(o.target) || ["ArrowDown", "ArrowUp", "PageDown", "PageUp", "Home", "End", " "].includes(o.key) && y();
|
|
510
510
|
}
|
|
511
511
|
return F(
|
|
512
512
|
() => {
|
|
@@ -521,7 +521,7 @@ function Xe(e) {
|
|
|
521
521
|
}), {
|
|
522
522
|
activeId: n,
|
|
523
523
|
scrollTo: $,
|
|
524
|
-
sync:
|
|
524
|
+
sync: b,
|
|
525
525
|
clearPendingScroll: d,
|
|
526
526
|
releaseSelectionLock: y,
|
|
527
527
|
handleUserScrollIntent: H,
|
|
@@ -555,12 +555,12 @@ function et(e) {
|
|
|
555
555
|
a.value = 0;
|
|
556
556
|
return;
|
|
557
557
|
}
|
|
558
|
-
const f = d.getBoundingClientRect(), y = s.getBoundingClientRect(),
|
|
559
|
-
if (!y.height || !
|
|
558
|
+
const f = d.getBoundingClientRect(), y = s.getBoundingClientRect(), k = c.getBoundingClientRect().height || 0;
|
|
559
|
+
if (!y.height || !k) {
|
|
560
560
|
a.value = 0;
|
|
561
561
|
return;
|
|
562
562
|
}
|
|
563
|
-
const S = y.top - f.top, I = y.bottom - f.top, $ = S + y.height / 2 -
|
|
563
|
+
const S = y.top - f.top, I = y.bottom - f.top, $ = S + y.height / 2 - k / 2, H = S + 24, A = Math.max(H, I - k - 24);
|
|
564
564
|
a.value = Math.max(H, Math.min($, A));
|
|
565
565
|
}
|
|
566
566
|
return {
|
|
@@ -584,7 +584,7 @@ function ot(e) {
|
|
|
584
584
|
return n instanceof HTMLElement ? n instanceof HTMLInputElement || n instanceof HTMLTextAreaElement || n instanceof HTMLSelectElement || n.isContentEditable : !1;
|
|
585
585
|
}
|
|
586
586
|
function l() {
|
|
587
|
-
|
|
587
|
+
be(() => {
|
|
588
588
|
var s, d;
|
|
589
589
|
const n = e.highlightedId.value, c = (s = e.overlay.value) == null ? void 0 : s.navEl;
|
|
590
590
|
!n || !c || (d = rt(c, n)) == null || d.focus();
|
|
@@ -660,7 +660,7 @@ function ct(e) {
|
|
|
660
660
|
clear: n
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
|
-
const
|
|
663
|
+
const Y = /* @__PURE__ */ G({
|
|
664
664
|
name: "TrAnchor",
|
|
665
665
|
inheritAttrs: !1,
|
|
666
666
|
__name: "index",
|
|
@@ -689,16 +689,16 @@ const j = /* @__PURE__ */ G({
|
|
|
689
689
|
expanded: d,
|
|
690
690
|
items: f,
|
|
691
691
|
placement: y,
|
|
692
|
-
searchOptions:
|
|
692
|
+
searchOptions: k,
|
|
693
693
|
searchQuery: S,
|
|
694
694
|
scrollContainer: I,
|
|
695
|
-
targetFeedbackClass:
|
|
695
|
+
targetFeedbackClass: b,
|
|
696
696
|
targetFeedbackDuration: $,
|
|
697
697
|
tooltipDelay: H
|
|
698
698
|
} = Me(l), A = _(null), p = g(() => {
|
|
699
699
|
var m;
|
|
700
700
|
return ((m = A.value) == null ? void 0 : m.hostEl) ?? null;
|
|
701
|
-
}), o = g(() =>
|
|
701
|
+
}), o = g(() => k.value), t = g(() => o.value ?? {});
|
|
702
702
|
function u(m) {
|
|
703
703
|
const O = I.value;
|
|
704
704
|
return O ? ge(O, m) ?? null : ge(document, m) ?? null;
|
|
@@ -717,7 +717,7 @@ const j = /* @__PURE__ */ G({
|
|
|
717
717
|
expanded: d,
|
|
718
718
|
expandTrigger: s,
|
|
719
719
|
searchQuery: S,
|
|
720
|
-
searchOptions:
|
|
720
|
+
searchOptions: k,
|
|
721
721
|
onUpdateExpanded: (m) => i("update:expanded", m),
|
|
722
722
|
onUpdateSearchQuery: (m) => i("update:searchQuery", m)
|
|
723
723
|
}), U = g(() => v.value.length > 0), Q = g(() => !!o.value && x.expanded.value), K = g(() => s.value === "hover"), C = g(() => le(I.value)), w = et({
|
|
@@ -725,7 +725,7 @@ const j = /* @__PURE__ */ G({
|
|
|
725
725
|
host: p
|
|
726
726
|
}), J = ct({
|
|
727
727
|
resolveTarget: u,
|
|
728
|
-
feedbackClass:
|
|
728
|
+
feedbackClass: b,
|
|
729
729
|
feedbackDuration: $
|
|
730
730
|
});
|
|
731
731
|
function z(m) {
|
|
@@ -846,11 +846,11 @@ const j = /* @__PURE__ */ G({
|
|
|
846
846
|
]), 1040, ["expanded", "placement", "floating-offset", "onMouseleave", "onFocusout", "onKeydown"])) : re("", !0);
|
|
847
847
|
}
|
|
848
848
|
});
|
|
849
|
-
|
|
849
|
+
Y.name = "TrAnchor";
|
|
850
850
|
const st = function(e) {
|
|
851
|
-
e.component(
|
|
851
|
+
e.component(Y.name, Y);
|
|
852
852
|
};
|
|
853
|
-
|
|
853
|
+
Y.install = st;
|
|
854
854
|
export {
|
|
855
|
-
|
|
855
|
+
Y as default
|
|
856
856
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
export interface AnchorItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
searchText?: string;
|
|
6
|
+
tooltipText?: string;
|
|
7
|
+
meta?: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
export interface AnchorHighlightSegment {
|
|
10
|
+
text: string;
|
|
11
|
+
highlighted: boolean;
|
|
12
|
+
}
|
|
13
|
+
export type AnchorSearchMatcher = (item: AnchorItem, searchQuery: string) => false | AnchorHighlightSegment[];
|
|
14
|
+
export type AnchorPlacement = 'left' | 'right';
|
|
15
|
+
export type AnchorExpandTrigger = 'hover' | 'manual';
|
|
16
|
+
export interface AnchorSearchOptions {
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
matcher?: AnchorSearchMatcher;
|
|
19
|
+
clearOnCollapse?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface AnchorProps {
|
|
22
|
+
items: AnchorItem[];
|
|
23
|
+
scrollContainer?: HTMLElement | null;
|
|
24
|
+
activeId?: string;
|
|
25
|
+
activeOffset?: number;
|
|
26
|
+
expanded?: boolean;
|
|
27
|
+
searchQuery?: string;
|
|
28
|
+
placement?: AnchorPlacement;
|
|
29
|
+
expandTrigger?: AnchorExpandTrigger;
|
|
30
|
+
searchOptions?: AnchorSearchOptions;
|
|
31
|
+
tooltipDelay?: number;
|
|
32
|
+
targetFeedbackClass?: string;
|
|
33
|
+
targetFeedbackDuration?: number;
|
|
34
|
+
emptyText?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface AnchorEmits {
|
|
37
|
+
'update:activeId': [value: string | undefined];
|
|
38
|
+
'update:expanded': [value: boolean];
|
|
39
|
+
'update:searchQuery': [value: string];
|
|
40
|
+
select: [item: AnchorItem];
|
|
41
|
+
}
|
|
42
|
+
export interface AnchorSlots {
|
|
43
|
+
item?: (slotProps: {
|
|
44
|
+
item: AnchorItem;
|
|
45
|
+
segments: AnchorHighlightSegment[];
|
|
46
|
+
active: boolean;
|
|
47
|
+
expanded: boolean;
|
|
48
|
+
highlighted: boolean;
|
|
49
|
+
}) => VNode | VNode[];
|
|
50
|
+
marker?: (slotProps: {
|
|
51
|
+
item: AnchorItem;
|
|
52
|
+
active: boolean;
|
|
53
|
+
}) => VNode | VNode[];
|
|
54
|
+
search?: (slotProps: {
|
|
55
|
+
searchQuery: string;
|
|
56
|
+
setSearchQuery: (value: string) => void;
|
|
57
|
+
searchOptions: AnchorSearchOptions;
|
|
58
|
+
}) => VNode | VNode[];
|
|
59
|
+
empty?: () => VNode | VNode[];
|
|
60
|
+
}
|