@winm/vue-workbench-ui 0.0.0-stage → 0.1.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/README.md +55 -2
- package/dist/Toggle-Dcjn5G6M.js +387 -0
- package/dist/code-editor.css +189 -0
- package/dist/code-editor.d.ts +5 -0
- package/dist/code-editor.js +1272 -0
- package/dist/components/Badge.vue.d.ts +34 -0
- package/dist/components/BrandMark.vue.d.ts +6 -0
- package/dist/components/CodeEditor.vue.d.ts +32 -0
- package/dist/components/ConfirmationDialog.vue.d.ts +27 -0
- package/dist/components/ContextMenu.vue.d.ts +66 -0
- package/dist/components/CopyButton.vue.d.ts +35 -0
- package/dist/components/DataTable.vue.d.ts +87 -0
- package/dist/components/DatePicker.vue.d.ts +33 -0
- package/dist/components/DropdownMenu.vue.d.ts +88 -0
- package/dist/components/EmptyState.vue.d.ts +38 -0
- package/dist/components/ErrorBanner.vue.d.ts +30 -0
- package/dist/components/ExpandableCodeEditor.vue.d.ts +72 -0
- package/dist/components/Expander.vue.d.ts +75 -0
- package/dist/components/FilePicker.vue.d.ts +111 -0
- package/dist/components/Icon.vue.d.ts +8 -0
- package/dist/components/Ipv4Input.vue.d.ts +95 -0
- package/dist/components/KeyValueTable.vue.d.ts +96 -0
- package/dist/components/ModalDialog.vue.d.ts +75 -0
- package/dist/components/NumberInput.vue.d.ts +69 -0
- package/dist/components/Pagination.vue.d.ts +49 -0
- package/dist/components/PasswordInput.vue.d.ts +48 -0
- package/dist/components/PlaceholderInput.vue.d.ts +36 -0
- package/dist/components/PluginIcon.vue.d.ts +20 -0
- package/dist/components/Popover.vue.d.ts +91 -0
- package/dist/components/ProgressBar.vue.d.ts +46 -0
- package/dist/components/SearchInput.vue.d.ts +72 -0
- package/dist/components/SegmentedControl.vue.d.ts +45 -0
- package/dist/components/SliderInput.vue.d.ts +59 -0
- package/dist/components/StatusBadge.vue.d.ts +18 -0
- package/dist/components/SwitchField.vue.d.ts +38 -0
- package/dist/components/Tabs.vue.d.ts +51 -0
- package/dist/components/TextInput.vue.d.ts +120 -0
- package/dist/components/Toast.vue.d.ts +47 -0
- package/dist/components/Toggle.vue.d.ts +16 -0
- package/dist/components/Tooltip.vue.d.ts +32 -0
- package/dist/components/WorkbenchTabs.vue.d.ts +52 -0
- package/dist/components/flow/PanelResizer.vue.d.ts +23 -0
- package/dist/components/http/HttpJsonTree.vue.d.ts +6 -0
- package/dist/components/http/HttpJsonTreeNode.vue.d.ts +22 -0
- package/dist/composables/useClipboard.d.ts +23 -0
- package/dist/date-picker-range.d.ts +54 -0
- package/dist/date-picker.d.ts +31 -0
- package/dist/directives/tooltip.d.ts +32 -0
- package/dist/editors/languages.d.ts +10 -0
- package/dist/editors/script-completions.d.ts +23 -0
- package/dist/editors/script-linter.d.ts +7 -0
- package/dist/editors/theme.d.ts +3 -0
- package/dist/file-picker.d.ts +68 -0
- package/dist/index.d.ts +69 -0
- package/dist/index.js +6116 -0
- package/dist/media-icon.d.ts +5 -0
- package/dist/modal-enhancer.d.ts +28 -0
- package/dist/overlay-host.d.ts +2 -0
- package/dist/plugin.d.ts +22 -0
- package/dist/select-popup.d.ts +14 -0
- package/dist/style.css +2 -0
- package/dist/template-placeholders.d.ts +64 -0
- package/dist/ui-context.d.ts +18 -0
- package/package.json +71 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface WorkbenchTabItem {
|
|
2
|
+
id: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
dirty?: boolean;
|
|
5
|
+
closable?: boolean;
|
|
6
|
+
tooltip?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: <T extends WorkbenchTabItem = WorkbenchTabItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
9
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
10
|
+
tabs: T[];
|
|
11
|
+
activeTabId: string;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
addable?: boolean;
|
|
14
|
+
addLabel?: string;
|
|
15
|
+
minCount?: number;
|
|
16
|
+
tabClass?: string;
|
|
17
|
+
dirtyTooltip?: string;
|
|
18
|
+
} & {
|
|
19
|
+
onSelect?: ((id: string) => any) | undefined;
|
|
20
|
+
onClose?: ((id: string) => any) | undefined;
|
|
21
|
+
onAdd?: (() => any) | undefined;
|
|
22
|
+
}> & (typeof globalThis extends {
|
|
23
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
24
|
+
} ? P : {});
|
|
25
|
+
expose: (exposed: {}) => void;
|
|
26
|
+
attrs: any;
|
|
27
|
+
slots: {
|
|
28
|
+
left?: (props: {}) => any;
|
|
29
|
+
} & {
|
|
30
|
+
prefix?: (props: {
|
|
31
|
+
tab: T;
|
|
32
|
+
active: boolean;
|
|
33
|
+
}) => any;
|
|
34
|
+
} & {
|
|
35
|
+
label?: (props: {
|
|
36
|
+
tab: T;
|
|
37
|
+
active: boolean;
|
|
38
|
+
}) => any;
|
|
39
|
+
} & {
|
|
40
|
+
actions?: (props: {}) => any;
|
|
41
|
+
};
|
|
42
|
+
emit: ((evt: "select", id: string) => void) & ((evt: "close", id: string) => void) & ((evt: "add") => void);
|
|
43
|
+
}>) => import("vue").VNode & {
|
|
44
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
45
|
+
};
|
|
46
|
+
declare const _default: typeof __VLS_export;
|
|
47
|
+
export default _default;
|
|
48
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} : {
|
|
51
|
+
[K in keyof T as K]: T[K];
|
|
52
|
+
}) & {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** vertical 分隔左右区域(调整宽度),horizontal 分隔上下区域(调整高度)。 */
|
|
3
|
+
orientation: "vertical" | "horizontal";
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
min: number;
|
|
7
|
+
max: number;
|
|
8
|
+
/** 分隔条位于被调区域的前侧时反转方向,例如右侧详情栏和底部预览。 */
|
|
9
|
+
invert?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
reset: () => any;
|
|
13
|
+
resize: (value: number) => any;
|
|
14
|
+
commit: (value: number) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onReset?: (() => any) | undefined;
|
|
17
|
+
onResize?: ((value: number) => any) | undefined;
|
|
18
|
+
onCommit?: ((value: number) => any) | undefined;
|
|
19
|
+
}>, {
|
|
20
|
+
invert: boolean;
|
|
21
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
data: unknown;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
name?: string;
|
|
3
|
+
value: unknown;
|
|
4
|
+
path: string;
|
|
5
|
+
depth?: number;
|
|
6
|
+
defaultExpandedDepth?: number;
|
|
7
|
+
expandSignal?: number;
|
|
8
|
+
collapseSignal?: number;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
copy: (text: string, label: string) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onCopy?: ((text: string, label: string) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
name: string;
|
|
16
|
+
depth: number;
|
|
17
|
+
defaultExpandedDepth: number;
|
|
18
|
+
expandSignal: number;
|
|
19
|
+
collapseSignal: number;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type ClipboardNotifyTone = "success" | "error" | "warning";
|
|
2
|
+
export interface UseClipboardOptions {
|
|
3
|
+
/** 复制成功后的已复制状态保留毫秒数,默认 1600ms */
|
|
4
|
+
resetDelay?: number;
|
|
5
|
+
/** 可选全局提示回调,配合 successMessage/errorMessage 使用 */
|
|
6
|
+
notify?: (message: string, tone?: ClipboardNotifyTone) => void;
|
|
7
|
+
}
|
|
8
|
+
export interface CopyOptions {
|
|
9
|
+
/** 复制成功后的已复制状态保留毫秒数,默认 1600ms */
|
|
10
|
+
resetDelay?: number;
|
|
11
|
+
successMessage?: string;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
onSuccess?: (text: string) => void;
|
|
14
|
+
onError?: (error: Error) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 通用剪贴板写入组合式工具:封装权限失败兜底与“已复制”短时状态自动复位,
|
|
18
|
+
* 组件卸载时自动清理定时器,无业务 store 依赖。
|
|
19
|
+
*/
|
|
20
|
+
export declare function useClipboard(optionsOrDelay?: number | UseClipboardOptions): {
|
|
21
|
+
copied: import("vue").Ref<boolean, boolean>;
|
|
22
|
+
copy: (text: string, options?: CopyOptions) => Promise<boolean>;
|
|
23
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 日期/时间范围选择(Range)面板渲染与状态模块。
|
|
3
|
+
*
|
|
4
|
+
* 与 date-picker.ts 共用弹层定位、遮罩挂载与关闭生命周期,专注处理:
|
|
5
|
+
* 1. date / datetime-local 双月历联动、两次点选起止日期、逆序自动归一化与悬停区间预览;
|
|
6
|
+
* 2. datetime-local 起止时间切换编辑与合法性约束;
|
|
7
|
+
* 3. time 起止双时间列并排选择与全天快捷项;
|
|
8
|
+
* 4. 快捷范围(今天 / 近 7 天 / 近 30 天)自动遵循 min/max 边界。
|
|
9
|
+
*/
|
|
10
|
+
import type { DatePickerKind } from "./date-picker";
|
|
11
|
+
export type DatePickerRangeValue = [string, string] | null;
|
|
12
|
+
export interface RangeState {
|
|
13
|
+
mode: "range";
|
|
14
|
+
input: HTMLInputElement;
|
|
15
|
+
kind: DatePickerKind;
|
|
16
|
+
root: HTMLElement;
|
|
17
|
+
/** 左月历显示的年月(日固定为 1),右月历固定为左月 + 1 */
|
|
18
|
+
view: Date;
|
|
19
|
+
cursor: Date;
|
|
20
|
+
startDate: Date | null;
|
|
21
|
+
endDate: Date | null;
|
|
22
|
+
/** 已选起点、等待落定终点时的悬停预览日期 */
|
|
23
|
+
hoverDate: Date | null;
|
|
24
|
+
startHour: number;
|
|
25
|
+
startMinute: number;
|
|
26
|
+
endHour: number;
|
|
27
|
+
endMinute: number;
|
|
28
|
+
/** datetime-local 范围模式下右侧时间列当前编辑端 */
|
|
29
|
+
activeEdge: "start" | "end";
|
|
30
|
+
min: string;
|
|
31
|
+
max: string;
|
|
32
|
+
required: boolean;
|
|
33
|
+
onCommitRange?: (value: [string, string]) => void;
|
|
34
|
+
cleanup: () => void;
|
|
35
|
+
}
|
|
36
|
+
/** 将范围值格式化为控件展示文本(例如 2026-11-10 至 2026-11-18) */
|
|
37
|
+
export declare function formatDatePickerRangeDisplay(kind: DatePickerKind, value: DatePickerRangeValue | undefined, separator?: string): string;
|
|
38
|
+
/** 初始化范围选择面板状态 */
|
|
39
|
+
export declare function createRangeState(params: {
|
|
40
|
+
input: HTMLInputElement;
|
|
41
|
+
kind: DatePickerKind;
|
|
42
|
+
root: HTMLElement;
|
|
43
|
+
rangeValue?: DatePickerRangeValue;
|
|
44
|
+
min: string;
|
|
45
|
+
max: string;
|
|
46
|
+
required: boolean;
|
|
47
|
+
onCommitRange?: (value: [string, string]) => void;
|
|
48
|
+
}): RangeState;
|
|
49
|
+
/** 渲染范围选择面板 */
|
|
50
|
+
export declare function renderRangePanel(state: RangeState, closeAndFocus: () => void, scrollToSelected?: boolean): void;
|
|
51
|
+
/** 范围模式下点选日期:第一次定起点,第二次定终点并自动保证 start <= end */
|
|
52
|
+
export declare function pickRangeDay(state: RangeState, day: Date, closeAndFocus: () => void): void;
|
|
53
|
+
/** 范围模式键盘导航 */
|
|
54
|
+
export declare function handleRangeKey(state: RangeState, event: KeyboardEvent, closeAndFocus: () => void): void;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 主题化日期/时间选择面板引擎。
|
|
3
|
+
*
|
|
4
|
+
* 职责说明:
|
|
5
|
+
* 1. 为 DatePicker.vue 与原生 date / datetime-local / time 输入框提供统一主题化弹层,
|
|
6
|
+
* 支持浅/深色主题跟随、日历与时间同排并列展示、键盘导航与视口防溢出定位。
|
|
7
|
+
* 2. 让弹层继承触发器的主题,并保留对话框打开后的交互边界。
|
|
8
|
+
*/
|
|
9
|
+
import { formatDatePickerRangeDisplay, type DatePickerRangeValue } from "./date-picker-range";
|
|
10
|
+
export { formatDatePickerRangeDisplay, type DatePickerRangeValue };
|
|
11
|
+
export type DatePickerKind = "date" | "datetime-local" | "time";
|
|
12
|
+
export interface DatePickerOpenOptions {
|
|
13
|
+
kind?: DatePickerKind;
|
|
14
|
+
range?: boolean;
|
|
15
|
+
value?: string;
|
|
16
|
+
rangeValue?: DatePickerRangeValue;
|
|
17
|
+
min?: string;
|
|
18
|
+
max?: string;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
readonly?: boolean;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
onCommit?: (value: string) => void;
|
|
23
|
+
onCommitRange?: (value: [string, string]) => void;
|
|
24
|
+
}
|
|
25
|
+
/** 将标准值格式化为控件展示文本(日期时间去掉 T 改为空格) */
|
|
26
|
+
export declare function formatDatePickerDisplay(kind: DatePickerKind, value: string): string;
|
|
27
|
+
/** 关闭当前面板 */
|
|
28
|
+
export declare function closeDatePicker(): void;
|
|
29
|
+
/** 打开面板(若已针对当前控件打开则切换关闭) */
|
|
30
|
+
export declare function openDatePicker(input: HTMLInputElement, options?: DatePickerOpenOptions): void;
|
|
31
|
+
export declare function setupDatePicker(scope: HTMLElement): () => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Directive } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* Tooltip 配置选项
|
|
4
|
+
*/
|
|
5
|
+
export interface TooltipOptions {
|
|
6
|
+
text: string;
|
|
7
|
+
placement?: "top" | "bottom" | "left" | "right";
|
|
8
|
+
delay?: number;
|
|
9
|
+
/** 可选快捷键徽标(渲染为右侧紧凑 .ui-kbd) */
|
|
10
|
+
shortcut?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 显示提示
|
|
14
|
+
*/
|
|
15
|
+
export declare function showTooltip(el: HTMLElement, options: TooltipOptions, container?: HTMLElement): void;
|
|
16
|
+
/**
|
|
17
|
+
* 隐藏提示
|
|
18
|
+
*/
|
|
19
|
+
export declare function hideTooltip(): void;
|
|
20
|
+
interface TooltipElement extends HTMLElement {
|
|
21
|
+
_tooltipHandlers?: {
|
|
22
|
+
enter: (e: PointerEvent | FocusEvent) => void;
|
|
23
|
+
leave: (e: PointerEvent | FocusEvent) => void;
|
|
24
|
+
down: (e: PointerEvent) => void;
|
|
25
|
+
};
|
|
26
|
+
_tooltipOptions?: TooltipOptions;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Vue 3 自定义指令 v-tooltip
|
|
30
|
+
*/
|
|
31
|
+
export declare const tooltipDirective: Directive<TooltipElement>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ScriptCompletionHints, type ScriptFieldHint } from "./script-completions";
|
|
2
|
+
export type { ScriptFieldHint };
|
|
3
|
+
export type CodeLanguage = "sql" | "json" | "javascript" | "powershell" | "cmd" | "shell" | "xml" | "html" | "text";
|
|
4
|
+
export interface SQLHints extends ScriptCompletionHints {
|
|
5
|
+
tables?: Record<string, readonly string[]>;
|
|
6
|
+
parameters?: readonly string[];
|
|
7
|
+
defaultTable?: string;
|
|
8
|
+
}
|
|
9
|
+
export type CodeHints = SQLHints;
|
|
10
|
+
export declare function languageExtensions(language: CodeLanguage, dialect: string, hints: CodeHints): (import("@codemirror/language").Language | import("@codemirror/state").Extension)[];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type CompletionSource } from "@codemirror/autocomplete";
|
|
2
|
+
/**
|
|
3
|
+
* 自定义脚本提示所需的上游字段定义。
|
|
4
|
+
*/
|
|
5
|
+
export interface ScriptFieldHint {
|
|
6
|
+
name: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 自定义脚本编辑器提示上下文。
|
|
11
|
+
*/
|
|
12
|
+
export interface ScriptCompletionHints {
|
|
13
|
+
scriptFields?: readonly ScriptFieldHint[];
|
|
14
|
+
scriptJsonKeys?: readonly string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 将字段名格式化为合法的 JS 属性访问表达式(供代码补全与字段点击插入共用)。
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatFieldAccess(base: string, field: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* 构建自定义脚本节点的 JavaScript 代码提示源。
|
|
22
|
+
*/
|
|
23
|
+
export declare function scriptCompletionSource(hints: ScriptCompletionHints): CompletionSource;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FilePicker 通用文件/文件夹选择工具函数(零业务依赖):
|
|
3
|
+
* - 支持格式化字节体积、accept 格式匹配(后缀/通配符/MIME)
|
|
4
|
+
* - 支持拖拽 DataTransfer 递归读取文件夹目录树(保留 relativePath)
|
|
5
|
+
* - 统一处理多文件校验(类型、单文件大小、数量上限与去重)
|
|
6
|
+
*/
|
|
7
|
+
export type FilePickerMode = "file" | "directory" | "both";
|
|
8
|
+
export type FilePickerVariant = "dropzone" | "compact";
|
|
9
|
+
export interface FilePickerItem {
|
|
10
|
+
/** 唯一标识(用于列表 key、去重与移除) */
|
|
11
|
+
id: string;
|
|
12
|
+
/** 原始浏览器 File 对象 */
|
|
13
|
+
file: File;
|
|
14
|
+
/** 文件名 */
|
|
15
|
+
name: string;
|
|
16
|
+
/** 相对路径(选择或拖入文件夹时保留目录层级,如 "logs/2026/app.log";普通文件为文件名) */
|
|
17
|
+
relativePath: string;
|
|
18
|
+
/** 文件大小(字节) */
|
|
19
|
+
size: number;
|
|
20
|
+
/** MIME 类型 */
|
|
21
|
+
type: string;
|
|
22
|
+
/** 最后修改时间戳 */
|
|
23
|
+
lastModified: number;
|
|
24
|
+
}
|
|
25
|
+
export type FilePickerRejectReason = "accept" | "maxSize" | "maxCount" | "duplicate";
|
|
26
|
+
export interface FilePickerRejectItem {
|
|
27
|
+
file: File;
|
|
28
|
+
relativePath: string;
|
|
29
|
+
reason: FilePickerRejectReason;
|
|
30
|
+
message: string;
|
|
31
|
+
}
|
|
32
|
+
/** 格式化文件体积为人类可读文本(如 1.24 MB) */
|
|
33
|
+
export declare function formatFileSize(bytes: number): string;
|
|
34
|
+
/** 构造规范化的相对路径(统一使用 / 分隔并去掉前导斜杠) */
|
|
35
|
+
export declare function normalizeRelativePath(file: File, explicitPath?: string): string;
|
|
36
|
+
/** 生成用于去重和列表渲染的稳定 ID */
|
|
37
|
+
export declare function buildFileItemId(file: File, relativePath: string): string;
|
|
38
|
+
/** 将原生 File 转为 FilePickerItem */
|
|
39
|
+
export declare function createFilePickerItem(file: File, explicitPath?: string): FilePickerItem;
|
|
40
|
+
/** 校验单个文件是否符合 accept 规则(支持 ".csv,.json"、"image/*"、"application/pdf" 等逗号分隔格式) */
|
|
41
|
+
export declare function matchesFileAccept(file: File, accept?: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* 从拖拽事件的 DataTransfer 提取全部文件:
|
|
44
|
+
* - 若浏览器支持 webkitGetAsEntry,自动递归展开拖入的文件夹并保留相对路径
|
|
45
|
+
* - 否则回落到 dataTransfer.files
|
|
46
|
+
*/
|
|
47
|
+
export declare function extractDroppedFiles(dataTransfer: DataTransfer | null | undefined): Promise<Array<{
|
|
48
|
+
file: File;
|
|
49
|
+
relativePath: string;
|
|
50
|
+
}>>;
|
|
51
|
+
export interface ValidateFilesOptions {
|
|
52
|
+
existing: FilePickerItem[];
|
|
53
|
+
multiple: boolean;
|
|
54
|
+
accept?: string;
|
|
55
|
+
maxSize?: number;
|
|
56
|
+
maxCount?: number;
|
|
57
|
+
dedupe?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface ValidateFilesResult {
|
|
60
|
+
nextItems: FilePickerItem[];
|
|
61
|
+
added: FilePickerItem[];
|
|
62
|
+
rejected: FilePickerRejectItem[];
|
|
63
|
+
}
|
|
64
|
+
/** 合并并校验新选择/拖入的文件集合 */
|
|
65
|
+
export declare function mergePickedFiles(incoming: Array<{
|
|
66
|
+
file: File;
|
|
67
|
+
relativePath?: string;
|
|
68
|
+
}>, options: ValidateFilesOptions): ValidateFilesResult;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export { default as Badge } from "./components/Badge.vue";
|
|
2
|
+
export { default as BrandMark } from "./components/BrandMark.vue";
|
|
3
|
+
export { default as ConfirmationDialog } from "./components/ConfirmationDialog.vue";
|
|
4
|
+
export { default as ContextMenu } from "./components/ContextMenu.vue";
|
|
5
|
+
export { default as CopyButton } from "./components/CopyButton.vue";
|
|
6
|
+
export { default as DataTable, type DataTableColumn } from "./components/DataTable.vue";
|
|
7
|
+
export { default as DatePicker } from "./components/DatePicker.vue";
|
|
8
|
+
export { default as DropdownMenu, type DropdownMenuGroup, type DropdownMenuItem, } from "./components/DropdownMenu.vue";
|
|
9
|
+
export { default as EmptyState } from "./components/EmptyState.vue";
|
|
10
|
+
export { default as ErrorBanner } from "./components/ErrorBanner.vue";
|
|
11
|
+
export { default as Expander } from "./components/Expander.vue";
|
|
12
|
+
export { default as FilePicker } from "./components/FilePicker.vue";
|
|
13
|
+
export { default as Icon } from "./components/Icon.vue";
|
|
14
|
+
export { default as Ipv4Input, type Ipv4TestResult, type Ipv4TestStatus, } from "./components/Ipv4Input.vue";
|
|
15
|
+
export { default as KeyValueTable, createKeyValueRow, formatBulkKeyValue, parseBulkKeyValue, type KeyValueRow, } from "./components/KeyValueTable.vue";
|
|
16
|
+
export { default as ModalDialog } from "./components/ModalDialog.vue";
|
|
17
|
+
export { default as NumberInput } from "./components/NumberInput.vue";
|
|
18
|
+
export { default as Pagination } from "./components/Pagination.vue";
|
|
19
|
+
export { default as PasswordInput } from "./components/PasswordInput.vue";
|
|
20
|
+
export { default as PlaceholderInput } from "./components/PlaceholderInput.vue";
|
|
21
|
+
export { default as PluginIcon } from "./components/PluginIcon.vue";
|
|
22
|
+
export { default as Popover, type PopoverPlacement } from "./components/Popover.vue";
|
|
23
|
+
export { default as ProgressBar, type ProgressTone } from "./components/ProgressBar.vue";
|
|
24
|
+
export { default as SearchInput } from "./components/SearchInput.vue";
|
|
25
|
+
export { default as SegmentedControl, type SegmentedOption } from "./components/SegmentedControl.vue";
|
|
26
|
+
export { default as SliderInput } from "./components/SliderInput.vue";
|
|
27
|
+
export { default as StatusBadge, type StatusTone } from "./components/StatusBadge.vue";
|
|
28
|
+
export { default as SwitchField } from "./components/SwitchField.vue";
|
|
29
|
+
export { default as Tabs, type TabItem } from "./components/Tabs.vue";
|
|
30
|
+
export { default as TextInput } from "./components/TextInput.vue";
|
|
31
|
+
export { default as Toast, type ToastTone } from "./components/Toast.vue";
|
|
32
|
+
export { default as Toggle } from "./components/Toggle.vue";
|
|
33
|
+
export { default as Tooltip } from "./components/Tooltip.vue";
|
|
34
|
+
export { default as WorkbenchTabs, type WorkbenchTabItem } from "./components/WorkbenchTabs.vue";
|
|
35
|
+
export { default as PanelResizer } from "./components/flow/PanelResizer.vue";
|
|
36
|
+
export { default as HttpJsonTree } from "./components/http/HttpJsonTree.vue";
|
|
37
|
+
export declare const MediaIcon: import("vue").DefineComponent<{
|
|
38
|
+
name: string;
|
|
39
|
+
src?: unknown;
|
|
40
|
+
size?: number;
|
|
41
|
+
iconSize?: number;
|
|
42
|
+
boxClass?: string;
|
|
43
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
44
|
+
name: string;
|
|
45
|
+
src?: unknown;
|
|
46
|
+
size?: number;
|
|
47
|
+
iconSize?: number;
|
|
48
|
+
boxClass?: string;
|
|
49
|
+
}> & Readonly<{}>, {
|
|
50
|
+
size: number;
|
|
51
|
+
src: undefined;
|
|
52
|
+
iconSize: number;
|
|
53
|
+
boxClass: string;
|
|
54
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
|
+
export declare const JsonTreeViewer: import("vue").DefineComponent<{
|
|
56
|
+
data: unknown;
|
|
57
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
58
|
+
data: unknown;
|
|
59
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
60
|
+
export { useClipboard } from "./composables/useClipboard";
|
|
61
|
+
export { closeDatePicker, formatDatePickerDisplay, formatDatePickerRangeDisplay, setupDatePicker, type DatePickerKind, type DatePickerRangeValue, } from "./date-picker";
|
|
62
|
+
export { extractDroppedFiles, formatFileSize, matchesFileAccept, mergePickedFiles, type FilePickerItem, type FilePickerMode, type FilePickerRejectItem, type FilePickerRejectReason, type FilePickerVariant, } from "./file-picker";
|
|
63
|
+
export { hideTooltip, tooltipDirective, type TooltipOptions } from "./directives/tooltip";
|
|
64
|
+
export { boundedPngDataUri } from "./media-icon";
|
|
65
|
+
export { setupModalEnhancer } from "./modal-enhancer";
|
|
66
|
+
export { closeSelectPopup, openSelectPopup, setupSelectPopup } from "./select-popup";
|
|
67
|
+
export { analyzeTemplate, buildPlaceholderOptions, type PlaceholderContext } from "./template-placeholders";
|
|
68
|
+
export { provideUiContext, useUiContext, type WinmUiContext } from "./ui-context";
|
|
69
|
+
export { createWinmUi, type WinmUiPluginOptions } from "./plugin";
|