@vunk/form 2.19.24 → 2.19.26
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/components/ai-provider/index.cjs +1 -1
- package/components/ai-provider/index.d.ts +2 -2
- package/components/ai-provider/index.mjs +98 -44
- package/components/ai-provider/src/ctx.d.ts +9 -1
- package/components/ai-provider/src/index.vue.d.ts +43 -6
- package/components/ai-provider/src/types.d.ts +45 -0
- package/components/ai-provider/src/use.d.ts +3 -1
- package/components/api-tables-select/src/ctx.d.ts +7 -7
- package/components/api-tables-select/src/index.vue.d.ts +9 -9
- package/components/button/src/ctx.d.ts +7 -7
- package/components/button/src/index.vue.d.ts +35 -35
- package/components/card-input-collection/src/core.vue.d.ts +12 -12
- package/components/card-input-collection/src/ctx.d.ts +5 -5
- package/components/card-input-collection/src/index.vue.d.ts +12 -12
- package/components/cascader/src/ctx.d.ts +8 -109
- package/components/cascader/src/index.vue.d.ts +16 -217
- package/components/checkbox/src/ctx.d.ts +7 -7
- package/components/checkbox/src/index.vue.d.ts +54 -54
- package/components/color-picker/src/ctx.d.ts +7 -108
- package/components/color-picker/src/index.vue.d.ts +16 -217
- package/components/components.css +1 -1
- package/components/date-picker/src/ctx.d.ts +9 -110
- package/components/date-picker/src/index.vue.d.ts +20 -221
- package/components/date-picker-range/src/ctx.d.ts +6 -107
- package/components/date-picker-range/src/index.vue.d.ts +34 -436
- package/components/dialog/src/ctx.d.ts +4 -4
- package/components/dialog/src/index.vue.d.ts +12 -8
- package/components/dialog-input-collection/src/ctx.d.ts +5 -5
- package/components/dialog-input-collection/src/index.vue.d.ts +11 -11
- package/components/download-plus/src/ctx.d.ts +5 -5
- package/components/download-plus/src/index.vue.d.ts +75 -75
- package/components/editable-text/src/ctx.d.ts +5 -5
- package/components/editable-text/src/index.vue.d.ts +11 -11
- package/components/esri-input-geojson/src/append.vue.d.ts +25 -25
- package/components/esri-input-geojson/src/ctx.d.ts +11 -11
- package/components/esri-input-geojson/src/index.vue.d.ts +101 -101
- package/components/form/src/ctx.d.ts +2 -2
- package/components/form/src/index.vue.d.ts +12 -12
- package/components/form-item/index.cjs +1 -1
- package/components/form-item/index.mjs +218 -144
- package/components/form-item/src/core.vue.d.ts +7 -7
- package/components/form-item/src/ctx.d.ts +3 -3
- package/components/form-item/src/index.vue.d.ts +5 -5
- package/components/form-item/src/use.d.ts +5 -1
- package/components/form-item/src/validate-guard.vue.d.ts +25 -0
- package/components/information-collection/src/ctx.d.ts +5 -5
- package/components/information-collection/src/index.vue.d.ts +11 -11
- package/components/information-tag/src/ctx.d.ts +1 -1
- package/components/information-tag/src/index.vue.d.ts +3 -3
- package/components/input/src/ctx.d.ts +11 -11
- package/components/input/src/index.vue.d.ts +71 -71
- package/components/input-array/src/ctx.d.ts +5 -5
- package/components/input-array/src/index.vue.d.ts +11 -11
- package/components/input-collection/src/core.vue.d.ts +15 -15
- package/components/input-collection/src/ctx.d.ts +5 -5
- package/components/input-collection/src/index.vue.d.ts +15 -15
- package/components/input-file/src/index.vue.d.ts +12 -12
- package/components/input-link/src/ctx.d.ts +9 -9
- package/components/input-link/src/index.vue.d.ts +95 -95
- package/components/input-number/src/ctx.d.ts +9 -9
- package/components/input-number/src/index.vue.d.ts +51 -51
- package/components/input-tag/src/ctx.d.ts +8 -8
- package/components/input-tag/src/index.vue.d.ts +41 -41
- package/components/monaco-editor/src/ctx.d.ts +5 -5
- package/components/monaco-editor/src/index.vue.d.ts +16 -16
- package/components/radio/src/ctx.d.ts +6 -6
- package/components/radio/src/index.vue.d.ts +33 -33
- package/components/radio/src/wraper.vue.d.ts +13 -13
- package/components/select/src/core.vue.d.ts +34 -43
- package/components/select/src/ctx.d.ts +9 -14
- package/components/select/src/index.vue.d.ts +25 -34
- package/components/slider/src/ctx.d.ts +8 -8
- package/components/slider/src/index.vue.d.ts +18 -18
- package/components/switch/src/ctx.d.ts +6 -6
- package/components/switch/src/index.vue.d.ts +13 -13
- package/components/tables-select/index.mjs +4 -1
- package/components/tables-select/src/ctx.d.ts +13 -13
- package/components/tables-select/src/index.vue.d.ts +15 -15
- package/components/templates-default/src/index.vue.d.ts +420 -1131
- package/components/templates-esri/src/index.vue.d.ts +101 -101
- package/components/templates-layout/src/index.vue.d.ts +3 -3
- package/components/templates-variant/src/index.vue.d.ts +34 -436
- package/components/time-picker/src/ctx.d.ts +9 -110
- package/components/time-picker/src/index.vue.d.ts +19 -220
- package/components/upload/src/ctx.d.ts +6 -6
- package/components/upload/src/file.vue.d.ts +21 -21
- package/components/upload/src/index.vue.d.ts +45 -45
- package/components/upload/src/wraper.vue.d.ts +12 -12
- package/components/upload-plus/src/ctx.d.ts +5 -5
- package/components/upload-plus/src/index.vue.d.ts +11 -11
- package/components/van-cascader/src/ctx.d.ts +7 -108
- package/components/van-cascader/src/index.vue.d.ts +16 -217
- package/components/var-datetime-picker/src/const.d.ts +1 -1
- package/components/var-datetime-picker/src/ctx.d.ts +5 -5
- package/components/var-datetime-picker/src/index.vue.d.ts +37 -238
- package/components/vditor/src/ctx.d.ts +5 -5
- package/components/vditor/src/index.vue.d.ts +17 -17
- package/index.css +1 -1
- package/locale/index.cjs +1 -1
- package/locale/index.mjs +9 -3
- package/locale/lang/ar.d.ts +2 -0
- package/locale/lang/en.d.ts +2 -0
- package/locale/lang/zh-cn.d.ts +2 -0
- package/package.json +1 -1
- package/shared/element-plus/ctx.d.ts +2 -2
- package/shared/element-plus/instances.d.ts +6 -208
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("../index-D0D9ABpH.js"),d={model:{type:Object,default:void 0},client:{type:Object,default:void 0}},k=Object.freeze(Object.defineProperty({__proto__:null,props:d},Symbol.toStringTag,{value:"Module"})),v=Symbol("vkfAiContextKey"),m=Symbol("vkfAiHostKey");function g(r){return e.provide(v,r),r}function C(){return e.inject(v,null)}function y(r){return e.provide(m,r),r}function P(){return e.inject(m,null)}const A=e.defineComponent({name:"VkfAiProvider",__name:"index",props:d,setup(r){const l=r,_=e.useSlots();function S(o){return{async generate(t){const n={model:o,prompt:t.ai.prompt,output:t.ai.output},i=await f.generateText(n);return t.ai.output?i.output:{[t.formItem?.prop]:i.text}},async generateStream(t,n){try{const i={model:o,prompt:t.ai.prompt,output:t.ai.output},j=f.streamText(i);for await(const s of j.stream)s.type==="text-delta"?n.onChunk(s.text):s.type==="reasoning-delta"&&n.onReasoning?.(s.text);n.onDone?.()}catch(i){n.onError?.(i)}}}}const a=e.computed(()=>l.client?l.client:l.model?S(l.model):null),b={generate(o){const t=a.value;if(!t)throw new Error("[VkfAiProvider] `model` or `client` is required");return t.generate(o)},get generateStream(){const o=a.value;if(o?.generateStream)return(t,n)=>o.generateStream(t,n)}};a.value&&g(b);const u=e.ref(null),c=e.computed(()=>!!u.value);function x(o){u.value=o}function p(){u.value=null}return y({get hasDialog(){return!!_.dialog},active:u,visible:c,openDialog:x,closeDialog:p}),(o,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.renderSlot(o.$slots,"default"),e.renderSlot(o.$slots,"dialog",{ctx:u.value,visible:c.value,close:p})],64))}}),O=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.VkfAiProvider=A;exports._VkfAiProviderCtx=k;exports.__VkfAiProvider=O;exports.default=A;exports.initAiContext=g;exports.initAiHost=y;exports.useAi=C;exports.useAiHost=P;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import VkfAiProvider from './src/index.vue';
|
|
2
2
|
export * as __VkfAiProvider from './src/types';
|
|
3
3
|
export * as _VkfAiProviderCtx from './src/ctx';
|
|
4
|
-
export { useAi, initAiContext } from './src/use';
|
|
5
|
-
export type { AiFormClient, AiStreamCallbacks, AiGenerateContext, AiConfig, } from './src/types';
|
|
4
|
+
export { useAi, initAiContext, useAiHost, initAiHost } from './src/use';
|
|
5
|
+
export type { AiFormClient, AiStreamCallbacks, AiGenerateContext, AiDialogContext, AiGenerateHooks, AiHost, AiConfig, } from './src/types';
|
|
6
6
|
export { VkfAiProvider };
|
|
7
7
|
export default VkfAiProvider;
|
|
@@ -1,61 +1,115 @@
|
|
|
1
|
-
import { provide as
|
|
2
|
-
import { s as
|
|
3
|
-
const
|
|
1
|
+
import { provide as d, inject as m, defineComponent as x, useSlots as j, computed as p, ref as C, openBlock as P, createElementBlock as O, Fragment as V, renderSlot as f } from "vue";
|
|
2
|
+
import { s as h, g as w } from "../index-BIo_4rr_.mjs";
|
|
3
|
+
const v = {
|
|
4
4
|
model: {
|
|
5
5
|
type: Object,
|
|
6
|
-
|
|
6
|
+
default: void 0
|
|
7
|
+
},
|
|
8
|
+
/**
|
|
9
|
+
* 自定义 AI 客户端,优先于 `model`
|
|
10
|
+
*/
|
|
11
|
+
client: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: void 0
|
|
7
14
|
}
|
|
8
|
-
},
|
|
15
|
+
}, E = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9
16
|
__proto__: null,
|
|
10
|
-
props:
|
|
11
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
12
|
-
function
|
|
13
|
-
return
|
|
17
|
+
props: v
|
|
18
|
+
}, Symbol.toStringTag, { value: "Module" })), g = /* @__PURE__ */ Symbol("vkfAiContextKey"), y = /* @__PURE__ */ Symbol("vkfAiHostKey");
|
|
19
|
+
function D(r) {
|
|
20
|
+
return d(g, r), r;
|
|
21
|
+
}
|
|
22
|
+
function M() {
|
|
23
|
+
return m(g, null);
|
|
24
|
+
}
|
|
25
|
+
function H(r) {
|
|
26
|
+
return d(y, r), r;
|
|
14
27
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
28
|
+
function z() {
|
|
29
|
+
return m(y, null);
|
|
17
30
|
}
|
|
18
|
-
const
|
|
31
|
+
const B = /* @__PURE__ */ x({
|
|
19
32
|
name: "VkfAiProvider",
|
|
20
33
|
__name: "index",
|
|
21
|
-
props:
|
|
34
|
+
props: v,
|
|
22
35
|
setup(r) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
prompt: t.ai.prompt,
|
|
28
|
-
output: t.ai.output
|
|
29
|
-
}, o = await y(e);
|
|
30
|
-
return t.ai.output ? o.output : {
|
|
31
|
-
[t.formItem?.prop]: o.text
|
|
32
|
-
};
|
|
33
|
-
},
|
|
34
|
-
async generateStream(t, e) {
|
|
35
|
-
try {
|
|
36
|
+
const u = r, _ = j();
|
|
37
|
+
function A(t) {
|
|
38
|
+
return {
|
|
39
|
+
async generate(e) {
|
|
36
40
|
const o = {
|
|
37
|
-
model:
|
|
38
|
-
prompt:
|
|
39
|
-
output:
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
e.
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
|
|
41
|
+
model: t,
|
|
42
|
+
prompt: e.ai.prompt,
|
|
43
|
+
output: e.ai.output
|
|
44
|
+
}, n = await w(o);
|
|
45
|
+
return e.ai.output ? n.output : {
|
|
46
|
+
[e.formItem?.prop]: n.text
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
async generateStream(e, o) {
|
|
50
|
+
try {
|
|
51
|
+
const n = {
|
|
52
|
+
model: t,
|
|
53
|
+
prompt: e.ai.prompt,
|
|
54
|
+
output: e.ai.output
|
|
55
|
+
}, k = h(n);
|
|
56
|
+
for await (const a of k.stream)
|
|
57
|
+
a.type === "text-delta" ? o.onChunk(a.text) : a.type === "reasoning-delta" && o.onReasoning?.(a.text);
|
|
58
|
+
o.onDone?.();
|
|
59
|
+
} catch (n) {
|
|
60
|
+
o.onError?.(n);
|
|
61
|
+
}
|
|
46
62
|
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
const l = p(() => u.client ? u.client : u.model ? A(u.model) : null), S = {
|
|
66
|
+
generate(t) {
|
|
67
|
+
const e = l.value;
|
|
68
|
+
if (!e)
|
|
69
|
+
throw new Error("[VkfAiProvider] `model` or `client` is required");
|
|
70
|
+
return e.generate(t);
|
|
71
|
+
},
|
|
72
|
+
get generateStream() {
|
|
73
|
+
const t = l.value;
|
|
74
|
+
if (t?.generateStream)
|
|
75
|
+
return (e, o) => t.generateStream(e, o);
|
|
47
76
|
}
|
|
48
|
-
}
|
|
49
|
-
|
|
77
|
+
};
|
|
78
|
+
l.value && D(S);
|
|
79
|
+
const i = C(null), s = p(() => !!i.value);
|
|
80
|
+
function b(t) {
|
|
81
|
+
i.value = t;
|
|
82
|
+
}
|
|
83
|
+
function c() {
|
|
84
|
+
i.value = null;
|
|
85
|
+
}
|
|
86
|
+
return H({
|
|
87
|
+
get hasDialog() {
|
|
88
|
+
return !!_.dialog;
|
|
89
|
+
},
|
|
90
|
+
active: i,
|
|
91
|
+
visible: s,
|
|
92
|
+
openDialog: b,
|
|
93
|
+
closeDialog: c
|
|
94
|
+
}), (t, e) => (P(), O(V, null, [
|
|
95
|
+
f(t.$slots, "default"),
|
|
96
|
+
f(t.$slots, "dialog", {
|
|
97
|
+
ctx: i.value,
|
|
98
|
+
visible: s.value,
|
|
99
|
+
close: c
|
|
100
|
+
})
|
|
101
|
+
], 64));
|
|
50
102
|
}
|
|
51
|
-
}),
|
|
103
|
+
}), $ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
52
104
|
__proto__: null
|
|
53
105
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
54
106
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
107
|
+
B as VkfAiProvider,
|
|
108
|
+
E as _VkfAiProviderCtx,
|
|
109
|
+
$ as __VkfAiProvider,
|
|
110
|
+
B as default,
|
|
111
|
+
D as initAiContext,
|
|
112
|
+
H as initAiHost,
|
|
113
|
+
M as useAi,
|
|
114
|
+
z as useAiHost
|
|
61
115
|
};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import type { PropType } from 'vue';
|
|
2
2
|
import type { LanguageModel } from 'ai';
|
|
3
|
+
import type { AiFormClient } from './types';
|
|
3
4
|
export declare const props: {
|
|
4
5
|
model: {
|
|
5
6
|
type: PropType<LanguageModel>;
|
|
6
|
-
|
|
7
|
+
default: undefined;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 自定义 AI 客户端,优先于 `model`
|
|
11
|
+
*/
|
|
12
|
+
client: {
|
|
13
|
+
type: PropType<AiFormClient>;
|
|
14
|
+
default: undefined;
|
|
7
15
|
};
|
|
8
16
|
};
|
|
@@ -1,18 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
import type { LanguageModel } from 'ai';
|
|
2
|
+
import type { AiFormClient, AiGenerateContext, AiStreamCallbacks } from './types';
|
|
3
|
+
declare function closeDialog(): void;
|
|
4
|
+
declare var __VLS_1: {}, __VLS_3: {
|
|
5
|
+
ctx: {
|
|
6
|
+
el?: HTMLElement | undefined;
|
|
7
|
+
generate: (ai?: Partial<import("./types").AiConfig>, hooks?: import("./types").AiGenerateHooks) => Promise<void>;
|
|
8
|
+
formItem?: Record<string, any> | undefined;
|
|
9
|
+
ai: {
|
|
10
|
+
enable?: boolean | undefined;
|
|
11
|
+
stream?: boolean | undefined;
|
|
12
|
+
prompt?: string | undefined;
|
|
13
|
+
output?: any;
|
|
14
|
+
};
|
|
15
|
+
data?: import("@vunk/shared").NormalObject | undefined;
|
|
16
|
+
getDataValue?: ((k: any) => any) | undefined;
|
|
17
|
+
emitSetData?: ((e: import("@vunk/core").SetDataEvent) => void) | undefined;
|
|
18
|
+
client: {
|
|
19
|
+
generate: (ctx: AiGenerateContext) => Promise<Record<string, any>>;
|
|
20
|
+
generateStream?: ((ctx: AiGenerateContext, callbacks: AiStreamCallbacks) => Promise<void>) | undefined;
|
|
21
|
+
};
|
|
22
|
+
} | null;
|
|
23
|
+
visible: boolean;
|
|
24
|
+
close: typeof closeDialog;
|
|
25
|
+
};
|
|
2
26
|
type __VLS_Slots = {} & {
|
|
3
27
|
default?: (props: typeof __VLS_1) => any;
|
|
28
|
+
} & {
|
|
29
|
+
dialog?: (props: typeof __VLS_3) => any;
|
|
4
30
|
};
|
|
5
31
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
32
|
model: {
|
|
7
|
-
type: import("vue").PropType<
|
|
8
|
-
|
|
33
|
+
type: import("vue").PropType<LanguageModel>;
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
36
|
+
client: {
|
|
37
|
+
type: import("vue").PropType<AiFormClient>;
|
|
38
|
+
default: undefined;
|
|
9
39
|
};
|
|
10
40
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
11
41
|
model: {
|
|
12
|
-
type: import("vue").PropType<
|
|
13
|
-
|
|
42
|
+
type: import("vue").PropType<LanguageModel>;
|
|
43
|
+
default: undefined;
|
|
44
|
+
};
|
|
45
|
+
client: {
|
|
46
|
+
type: import("vue").PropType<AiFormClient>;
|
|
47
|
+
default: undefined;
|
|
14
48
|
};
|
|
15
|
-
}>> & Readonly<{}>, {
|
|
49
|
+
}>> & Readonly<{}>, {
|
|
50
|
+
model: LanguageModel;
|
|
51
|
+
client: AiFormClient;
|
|
52
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
16
53
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
17
54
|
declare const _default: typeof __VLS_export;
|
|
18
55
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
1
2
|
import type { SetDataEvent } from '@vunk/core';
|
|
2
3
|
import type { NormalObject } from '@vunk/shared';
|
|
3
4
|
export interface AiFormClient {
|
|
@@ -6,6 +7,10 @@ export interface AiFormClient {
|
|
|
6
7
|
}
|
|
7
8
|
export interface AiStreamCallbacks {
|
|
8
9
|
onChunk: (chunk: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* 思考模型的推理增量,模型不产生推理时不会触发
|
|
12
|
+
*/
|
|
13
|
+
onReasoning?: (chunk: string) => void;
|
|
9
14
|
onDone?: (result?: Record<string, any>) => void;
|
|
10
15
|
onError?: (error: Error) => void;
|
|
11
16
|
}
|
|
@@ -54,3 +59,43 @@ export interface AiConfig {
|
|
|
54
59
|
*/
|
|
55
60
|
output?: any;
|
|
56
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* 生成过程的时机回调
|
|
64
|
+
*/
|
|
65
|
+
export interface AiGenerateHooks {
|
|
66
|
+
/**
|
|
67
|
+
* 流式生成的首个分块到达,参数为已累积正文。
|
|
68
|
+
* 推理增量也算分块,因此思考模型往往在正文之前就会触发一次。
|
|
69
|
+
* 常用于关闭弹窗,让生成过程可见。
|
|
70
|
+
*/
|
|
71
|
+
onFirstChunk?: (text: string) => void;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 传递给 `VkfAiProvider` 的 `dialog` 插槽的上下文
|
|
75
|
+
*/
|
|
76
|
+
export interface AiDialogContext extends AiGenerateContext {
|
|
77
|
+
/**
|
|
78
|
+
* 触发按钮的元素,可用于锚定 popover
|
|
79
|
+
*/
|
|
80
|
+
el?: HTMLElement;
|
|
81
|
+
/**
|
|
82
|
+
* 以当前上下文执行生成流程,可覆盖部分 AI 配置
|
|
83
|
+
*/
|
|
84
|
+
generate: (ai?: Partial<AiConfig>, hooks?: AiGenerateHooks) => Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 生成入口与 `dialog` 插槽之间的桥接层
|
|
88
|
+
*/
|
|
89
|
+
export interface AiHost {
|
|
90
|
+
/**
|
|
91
|
+
* 是否提供了 `dialog` 插槽
|
|
92
|
+
*/
|
|
93
|
+
hasDialog: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* 当前打开的生成上下文
|
|
96
|
+
*/
|
|
97
|
+
active: Ref<AiDialogContext | null>;
|
|
98
|
+
visible: ComputedRef<boolean>;
|
|
99
|
+
openDialog: (ctx: AiDialogContext) => void;
|
|
100
|
+
closeDialog: () => void;
|
|
101
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import type { AiFormClient } from './types';
|
|
1
|
+
import type { AiFormClient, AiHost } from './types';
|
|
2
2
|
export declare function initAiContext(client: AiFormClient): AiFormClient;
|
|
3
3
|
export declare function useAi(): AiFormClient | null;
|
|
4
|
+
export declare function initAiHost(host: AiHost): AiHost;
|
|
5
|
+
export declare function useAiHost(): AiHost | null;
|
|
@@ -40,6 +40,10 @@ export declare const props: {
|
|
|
40
40
|
required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
41
41
|
error: StringConstructor;
|
|
42
42
|
prop: null;
|
|
43
|
+
ai: {
|
|
44
|
+
type: PropType<import("../../ai-provider").AiConfig>;
|
|
45
|
+
default: undefined;
|
|
46
|
+
};
|
|
43
47
|
className: StringConstructor;
|
|
44
48
|
popperClass: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | ((new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | null)[], unknown, unknown, "", boolean>;
|
|
45
49
|
popperStyle: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | ((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | null)[], unknown, unknown, undefined, boolean>;
|
|
@@ -91,10 +95,6 @@ export declare const props: {
|
|
|
91
95
|
type: PropType<import("element-plus").UseTooltipProps>;
|
|
92
96
|
default: () => {};
|
|
93
97
|
};
|
|
94
|
-
ai: {
|
|
95
|
-
type: PropType<import("../../ai-provider").AiConfig>;
|
|
96
|
-
default: undefined;
|
|
97
|
-
};
|
|
98
98
|
aiOutput: null;
|
|
99
99
|
label: StringConstructor;
|
|
100
100
|
labelWidth: {
|
|
@@ -110,7 +110,7 @@ export declare const props: {
|
|
|
110
110
|
__epPropKey: true;
|
|
111
111
|
};
|
|
112
112
|
validateStatus: {
|
|
113
|
-
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "
|
|
113
|
+
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
114
114
|
readonly required: false;
|
|
115
115
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
116
116
|
__epPropKey: true;
|
|
@@ -231,13 +231,13 @@ export declare const props: {
|
|
|
231
231
|
showOverflowTooltip: PropType<boolean | Partial<Omit<import("element-plus").UseTooltipProps, "content" | "visible" | "referenceEl" | "triggerTargetEl" | "virtualTriggering" | "persistent" | "rawContent" | "autoClose" | "virtualRef">>>;
|
|
232
232
|
appendFilterPanelTo: StringConstructor;
|
|
233
233
|
scrollbarTabindex: {
|
|
234
|
-
type: (
|
|
234
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
235
235
|
default: any;
|
|
236
236
|
};
|
|
237
237
|
labelClassName: StringConstructor;
|
|
238
238
|
property: StringConstructor;
|
|
239
239
|
minWidth: {
|
|
240
|
-
type: (
|
|
240
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
241
241
|
default: string;
|
|
242
242
|
};
|
|
243
243
|
renderHeader: PropType<(data: {
|
|
@@ -32,6 +32,10 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
32
32
|
required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
33
33
|
error: StringConstructor;
|
|
34
34
|
prop: null;
|
|
35
|
+
ai: {
|
|
36
|
+
type: import("vue").PropType<import("../../ai-provider").AiConfig>;
|
|
37
|
+
default: undefined;
|
|
38
|
+
};
|
|
35
39
|
className: StringConstructor;
|
|
36
40
|
popperClass: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | ((new (...args: any[]) => string | false | Record<string, any> | import("element-plus/es/utils/typescript.mjs").ClassValue[]) | (() => import("element-plus/es/utils/typescript.mjs").ClassValue) | null)[], unknown, unknown, "", boolean>;
|
|
37
41
|
popperStyle: import("element-plus/es/utils/index.mjs").EpPropFinalized<(new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | ((new (...args: any[]) => string | false | import("vue").CSSProperties | import("vue").StyleValue[]) | (() => import("vue").StyleValue) | null)[], unknown, unknown, undefined, boolean>;
|
|
@@ -83,10 +87,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
83
87
|
type: import("vue").PropType<import("element-plus").UseTooltipProps>;
|
|
84
88
|
default: () => {};
|
|
85
89
|
};
|
|
86
|
-
ai: {
|
|
87
|
-
type: import("vue").PropType<import("../../ai-provider").AiConfig>;
|
|
88
|
-
default: undefined;
|
|
89
|
-
};
|
|
90
90
|
aiOutput: null;
|
|
91
91
|
label: StringConstructor;
|
|
92
92
|
labelWidth: {
|
|
@@ -102,7 +102,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
102
102
|
__epPropKey: true;
|
|
103
103
|
};
|
|
104
104
|
validateStatus: {
|
|
105
|
-
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "
|
|
105
|
+
readonly type: import("vue").PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
106
106
|
readonly required: false;
|
|
107
107
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
108
108
|
__epPropKey: true;
|
|
@@ -223,13 +223,13 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
223
223
|
showOverflowTooltip: import("vue").PropType<boolean | Partial<Omit<import("element-plus").UseTooltipProps, "content" | "visible" | "referenceEl" | "triggerTargetEl" | "virtualTriggering" | "persistent" | "rawContent" | "autoClose" | "virtualRef">>>;
|
|
224
224
|
appendFilterPanelTo: StringConstructor;
|
|
225
225
|
scrollbarTabindex: {
|
|
226
|
-
type: (
|
|
226
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
227
227
|
default: any;
|
|
228
228
|
};
|
|
229
229
|
labelClassName: StringConstructor;
|
|
230
230
|
property: StringConstructor;
|
|
231
231
|
minWidth: {
|
|
232
|
-
type: (
|
|
232
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
233
233
|
default: string;
|
|
234
234
|
};
|
|
235
235
|
renderHeader: import("vue").PropType<(data: {
|
|
@@ -324,7 +324,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
324
324
|
type: string;
|
|
325
325
|
small: boolean;
|
|
326
326
|
required: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
327
|
-
|
|
327
|
+
ai: import("../../ai-provider").AiConfig;
|
|
328
|
+
popperClass: import("element-plus/es/utils/typescript.mjs").ClassValue;
|
|
328
329
|
popperStyle: import("vue").StyleValue;
|
|
329
330
|
labelPosition: "start" | "left" | "right" | "top" | "end";
|
|
330
331
|
formItemSize: "small" | "default" | "large";
|
|
@@ -336,7 +337,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
336
337
|
labelTip: string;
|
|
337
338
|
information: boolean;
|
|
338
339
|
labelTipProps: import("element-plus").UseTooltipProps;
|
|
339
|
-
ai: import("../../ai-provider").AiConfig;
|
|
340
340
|
inlineMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
341
341
|
showMessage: import("element-plus/es/utils/index.mjs").EpPropMergeType<BooleanConstructor, unknown, unknown>;
|
|
342
342
|
disabled: boolean;
|
|
@@ -14,13 +14,13 @@ export declare const props: {
|
|
|
14
14
|
default: boolean;
|
|
15
15
|
};
|
|
16
16
|
size: {
|
|
17
|
-
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "
|
|
17
|
+
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "default" | "large" | "small", never>>;
|
|
18
18
|
readonly required: false;
|
|
19
19
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
20
20
|
__epPropKey: true;
|
|
21
21
|
};
|
|
22
22
|
disabled: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
23
|
-
type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "" | "
|
|
23
|
+
type: import("element-plus/es/utils/index.mjs").EpPropFinalized<StringConstructor, "" | "default" | "text" | "info" | "primary" | "success" | "warning" | "danger", unknown, "", boolean>;
|
|
24
24
|
icon: {
|
|
25
25
|
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown>>;
|
|
26
26
|
readonly required: false;
|
|
@@ -45,6 +45,10 @@ export declare const props: {
|
|
|
45
45
|
required: import("element-plus/es/utils/index.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
46
46
|
error: StringConstructor;
|
|
47
47
|
prop: null;
|
|
48
|
+
ai: {
|
|
49
|
+
type: PropType<import("../../ai-provider").AiConfig>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
48
52
|
labelPosition: {
|
|
49
53
|
type: PropType<"left" | "right" | "top" | "start" | "end">;
|
|
50
54
|
default: undefined;
|
|
@@ -87,10 +91,6 @@ export declare const props: {
|
|
|
87
91
|
type: PropType<import("element-plus").UseTooltipProps>;
|
|
88
92
|
default: () => {};
|
|
89
93
|
};
|
|
90
|
-
ai: {
|
|
91
|
-
type: PropType<import("../../ai-provider").AiConfig>;
|
|
92
|
-
default: undefined;
|
|
93
|
-
};
|
|
94
94
|
aiOutput: null;
|
|
95
95
|
label: StringConstructor;
|
|
96
96
|
labelWidth: {
|
|
@@ -106,7 +106,7 @@ export declare const props: {
|
|
|
106
106
|
__epPropKey: true;
|
|
107
107
|
};
|
|
108
108
|
validateStatus: {
|
|
109
|
-
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "
|
|
109
|
+
readonly type: PropType<import("element-plus/es/utils/index.mjs").EpPropMergeType<StringConstructor, "" | "error" | "success" | "validating", unknown>>;
|
|
110
110
|
readonly required: false;
|
|
111
111
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
112
112
|
__epPropKey: true;
|