@zeng-alt/formkit-form-builder 1.0.1 → 1.2.0
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 +47 -0
- package/dist/builder.css +1 -1
- package/dist/builder.es.js +34247 -31696
- package/dist/builder.umd.js +74 -49
- package/dist/index.d.ts +943 -19
- package/package.json +32 -21
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,52 @@
|
|
|
1
|
+
import { AllowedComponentProps } from 'vue';
|
|
2
|
+
import { Attrs } from 'vue';
|
|
3
|
+
import { AxiosInstance } from 'axios';
|
|
4
|
+
import { Breakpoints } from 'naive-ui/es/config-provider/src/internal-interface';
|
|
1
5
|
import { Component } from 'vue';
|
|
6
|
+
import { ComponentCustomProperties } from 'vue';
|
|
7
|
+
import { ComponentCustomProps } from 'vue';
|
|
8
|
+
import { ComponentInternalInstance } from 'vue';
|
|
9
|
+
import { ComponentOptionsBase } from 'vue';
|
|
2
10
|
import { ComponentOptionsMixin } from 'vue';
|
|
3
11
|
import { ComponentProvideOptions } from 'vue';
|
|
12
|
+
import { ComponentPublicInstance } from 'vue';
|
|
4
13
|
import { ComputedOptions } from 'vue';
|
|
5
14
|
import { ComputedRef } from 'vue';
|
|
6
15
|
import { ConfigProviderProps } from 'naive-ui';
|
|
7
16
|
import { CreateComponentPublicInstanceWithMixins } from 'vue';
|
|
8
17
|
import { createInput } from '@formkit/vue';
|
|
18
|
+
import { DebuggerEvent } from 'vue';
|
|
9
19
|
import { defaultConfig } from '@formkit/vue';
|
|
10
20
|
import { DefineComponent } from 'vue';
|
|
21
|
+
import { ExtractPropTypes } from 'vue';
|
|
11
22
|
import { FormKitConfig } from '@formkit/core';
|
|
12
23
|
import { FormKitContext } from '@formkit/core';
|
|
13
24
|
import { FormKitNode } from '@formkit/core';
|
|
14
25
|
import { FormKitPlugin } from '@formkit/core';
|
|
15
26
|
import { FormKitProps } from '@formkit/core';
|
|
16
27
|
import { FormKitSchemaFormKit } from '@formkit/core';
|
|
28
|
+
import { GlobalComponentConfig } from 'naive-ui';
|
|
17
29
|
import { GlobalComponents } from 'vue';
|
|
18
30
|
import { GlobalDirectives } from 'vue';
|
|
31
|
+
import { GlobalIconConfig } from 'naive-ui';
|
|
32
|
+
import { GlobalTheme } from 'naive-ui';
|
|
33
|
+
import { GlobalThemeOverrides } from 'naive-ui';
|
|
34
|
+
import { Hljs } from 'naive-ui/es/_mixins';
|
|
35
|
+
import { Katex } from 'naive-ui/es/config-provider/src/katex';
|
|
19
36
|
import { MethodOptions } from 'vue';
|
|
37
|
+
import { NDateLocale } from 'naive-ui';
|
|
38
|
+
import { nextTick } from 'vue';
|
|
39
|
+
import { NLocale } from 'naive-ui';
|
|
40
|
+
import { OnCleanup } from '@vue/reactivity';
|
|
20
41
|
import { Plugin as Plugin_2 } from 'vue';
|
|
42
|
+
import { PropType } from 'vue';
|
|
21
43
|
import { PublicProps } from 'vue';
|
|
22
44
|
import { Ref } from 'vue';
|
|
45
|
+
import { RtlProp } from 'naive-ui/es/config-provider/src/internal-interface';
|
|
46
|
+
import { Slot } from 'vue';
|
|
47
|
+
import { VNodeProps } from 'vue';
|
|
48
|
+
import { WatchOptions } from 'vue';
|
|
49
|
+
import { WatchStopHandle } from 'vue';
|
|
23
50
|
|
|
24
51
|
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
25
52
|
"update:modelValue": (value: FormDefinition) => any;
|
|
@@ -29,16 +56,17 @@ declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, Comp
|
|
|
29
56
|
|
|
30
57
|
declare const __VLS_component_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
31
58
|
|
|
32
|
-
declare const __VLS_component_3: DefineComponent<
|
|
59
|
+
declare const __VLS_component_3: DefineComponent<__VLS_Props_5, {
|
|
33
60
|
submit: () => void | undefined;
|
|
34
61
|
reset: () => void | undefined;
|
|
62
|
+
validate: () => Promise<boolean>;
|
|
35
63
|
loading: Ref<boolean, boolean>;
|
|
36
64
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
37
|
-
submit: (formData:
|
|
38
|
-
"update:modelValue": (value:
|
|
39
|
-
}, string, PublicProps, Readonly<
|
|
40
|
-
onSubmit?: ((formData:
|
|
41
|
-
"onUpdate:modelValue"?: ((value:
|
|
65
|
+
submit: (formData: ModelValue_3, id: string | undefined, version: number | undefined) => any;
|
|
66
|
+
"update:modelValue": (value: ModelValue_3) => any;
|
|
67
|
+
}, string, PublicProps, Readonly<__VLS_Props_5> & Readonly<{
|
|
68
|
+
onSubmit?: ((formData: ModelValue_3, id: string | undefined, version: number | undefined) => any) | undefined;
|
|
69
|
+
"onUpdate:modelValue"?: ((value: ModelValue_3) => any) | undefined;
|
|
42
70
|
}>, {
|
|
43
71
|
actions: boolean;
|
|
44
72
|
formClass: string;
|
|
@@ -97,13 +125,33 @@ declare type __VLS_Props_3 = {
|
|
|
97
125
|
};
|
|
98
126
|
|
|
99
127
|
declare type __VLS_Props_4 = {
|
|
128
|
+
/** 控制弹窗显隐 */
|
|
129
|
+
show?: boolean;
|
|
130
|
+
/** 弹窗标题 */
|
|
131
|
+
title?: string;
|
|
132
|
+
/** 版本化 DSL 表单定义(设计器导出的 JSON),内部 dslToSchema 转换 */
|
|
133
|
+
formDefinition: FormDefinition;
|
|
134
|
+
/** 初始表单数据 */
|
|
135
|
+
initialData?: ModelValue_2;
|
|
136
|
+
/** 渲染默认操作区(提交/重置两按钮) */
|
|
137
|
+
actions?: boolean;
|
|
138
|
+
formClass?: string;
|
|
139
|
+
interactiveContainers?: boolean;
|
|
140
|
+
/** 是否显示右侧数据面板 */
|
|
141
|
+
showDataPanel?: boolean;
|
|
142
|
+
/** 右侧数据面板宽度 */
|
|
143
|
+
dataPanelWidth?: string;
|
|
144
|
+
resetOnSubmit?: boolean;
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
declare type __VLS_Props_5 = {
|
|
100
148
|
/** 主输入:版本化 DSL 表单定义(设计器导出的 JSON),内部 dslToSchema 转换 */
|
|
101
149
|
definition?: FormDefinition;
|
|
102
150
|
/** 备选输入:裸 FormKit schema 数组(灵活通道);与 definition 同传时优先 definition */
|
|
103
151
|
schema?: FormKitSchemaFormKit[];
|
|
104
152
|
/** 有 definition 时的数据输出结构:flat 扁平 | nested 容器转 group 嵌套 */
|
|
105
153
|
dataStructure?: 'flat' | 'nested';
|
|
106
|
-
modelValue?:
|
|
154
|
+
modelValue?: ModelValue_3;
|
|
107
155
|
/** 渲染默认操作区(提交/重置两按钮);false 则不显示,配合 #actions 槽自定义 */
|
|
108
156
|
actions?: boolean;
|
|
109
157
|
/** 默认提交按钮文案(缺省 i18n:提交 / Submit) */
|
|
@@ -122,8 +170,12 @@ declare type __VLS_Props_4 = {
|
|
|
122
170
|
labelWidth?: number;
|
|
123
171
|
schemaLibrary?: Record<string, Component>;
|
|
124
172
|
interactiveContainers?: boolean;
|
|
173
|
+
/** 本实例配置;传了则自给(registerElements + provide + locale/i18n),不传回落外层 Builder/BuilderProvider 注入 */
|
|
174
|
+
config?: FormBuilderConfig;
|
|
125
175
|
/** 自定义主题:内部映射到 naive-ui 的 darkTheme / lightTheme;缺省自动跟随系统 */
|
|
126
176
|
theme?: BuilderTheme;
|
|
177
|
+
/** 自定义 HTTP 请求库实例:供 JS 绑定代码里的 axios 变量使用;缺省使用内置 axios */
|
|
178
|
+
http?: AxiosInstance;
|
|
127
179
|
} & Omit<Partial<ConfigProviderProps>, 'theme'>;
|
|
128
180
|
|
|
129
181
|
declare function __VLS_template(): {
|
|
@@ -247,6 +299,7 @@ export declare function buildElementSchemaLibrary(): Record<string, Component>;
|
|
|
247
299
|
export declare const BuilderPreview: DefineComponent<__VLS_Props_3, {
|
|
248
300
|
open: () => void;
|
|
249
301
|
close: () => void;
|
|
302
|
+
validate: () => Promise<boolean>;
|
|
250
303
|
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
251
304
|
submit: (formData: ModelValue, id: string | undefined, version: number | undefined) => any;
|
|
252
305
|
"update:show": (value: boolean) => any;
|
|
@@ -259,7 +312,419 @@ formClass: string;
|
|
|
259
312
|
interactiveContainers: boolean;
|
|
260
313
|
showDataPanel: boolean;
|
|
261
314
|
resetOnSubmit: boolean;
|
|
262
|
-
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
315
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
316
|
+
rendererRef: ({
|
|
317
|
+
$: ComponentInternalInstance;
|
|
318
|
+
$data: {};
|
|
319
|
+
$props: {
|
|
320
|
+
readonly definition?: FormDefinition | undefined;
|
|
321
|
+
readonly schema?: FormKitSchemaFormKit[] | undefined;
|
|
322
|
+
readonly dataStructure?: "flat" | "nested" | undefined;
|
|
323
|
+
readonly modelValue?: {
|
|
324
|
+
[x: string]: unknown;
|
|
325
|
+
} | undefined;
|
|
326
|
+
readonly actions?: boolean | undefined;
|
|
327
|
+
readonly submitLabel?: string | undefined;
|
|
328
|
+
readonly resetLabel?: string | undefined;
|
|
329
|
+
readonly submitAttrs?: Record<string, unknown> | undefined;
|
|
330
|
+
readonly resetAttrs?: Record<string, unknown> | undefined;
|
|
331
|
+
readonly actionsJustify?: "start" | "center" | "end" | "space-between" | undefined;
|
|
332
|
+
readonly formClass?: string | undefined;
|
|
333
|
+
readonly formName?: string | undefined;
|
|
334
|
+
readonly labelPosition?: "top" | "left" | undefined;
|
|
335
|
+
readonly labelWidth?: number | undefined;
|
|
336
|
+
readonly schemaLibrary?: Record<string, Component> | undefined;
|
|
337
|
+
readonly interactiveContainers?: boolean | undefined;
|
|
338
|
+
readonly config?: FormBuilderConfig | undefined;
|
|
339
|
+
readonly theme?: BuilderTheme | undefined;
|
|
340
|
+
readonly http?: AxiosInstance | undefined;
|
|
341
|
+
readonly themeOverrides?: GlobalThemeOverrides | null | undefined;
|
|
342
|
+
readonly tag?: string | undefined;
|
|
343
|
+
readonly bordered?: boolean | undefined;
|
|
344
|
+
readonly namespace?: string | undefined;
|
|
345
|
+
readonly inlineThemeDisabled?: boolean | undefined;
|
|
346
|
+
readonly abstract?: boolean | undefined;
|
|
347
|
+
readonly as?: string | undefined;
|
|
348
|
+
readonly locale?: {
|
|
349
|
+
name: string;
|
|
350
|
+
global: {
|
|
351
|
+
undo: string;
|
|
352
|
+
redo: string;
|
|
353
|
+
confirm: string;
|
|
354
|
+
clear: string;
|
|
355
|
+
};
|
|
356
|
+
Popconfirm: {
|
|
357
|
+
positiveText: string;
|
|
358
|
+
negativeText: string;
|
|
359
|
+
};
|
|
360
|
+
Cascader: {
|
|
361
|
+
placeholder: string;
|
|
362
|
+
loading: string;
|
|
363
|
+
loadingRequiredMessage: (label: string) => string;
|
|
364
|
+
};
|
|
365
|
+
Time: {
|
|
366
|
+
dateFormat: string;
|
|
367
|
+
dateTimeFormat: string;
|
|
368
|
+
};
|
|
369
|
+
DatePicker: {
|
|
370
|
+
yearFormat: string;
|
|
371
|
+
monthFormat: string;
|
|
372
|
+
dayFormat: string;
|
|
373
|
+
yearTypeFormat: string;
|
|
374
|
+
monthTypeFormat: string;
|
|
375
|
+
dateFormat: string;
|
|
376
|
+
dateTimeFormat: string;
|
|
377
|
+
quarterFormat: string;
|
|
378
|
+
weekFormat: string;
|
|
379
|
+
clear: string;
|
|
380
|
+
now: string;
|
|
381
|
+
confirm: string;
|
|
382
|
+
selectTime: string;
|
|
383
|
+
selectDate: string;
|
|
384
|
+
datePlaceholder: string;
|
|
385
|
+
datetimePlaceholder: string;
|
|
386
|
+
monthPlaceholder: string;
|
|
387
|
+
yearPlaceholder: string;
|
|
388
|
+
quarterPlaceholder: string;
|
|
389
|
+
weekPlaceholder: string;
|
|
390
|
+
startDatePlaceholder: string;
|
|
391
|
+
endDatePlaceholder: string;
|
|
392
|
+
startDatetimePlaceholder: string;
|
|
393
|
+
endDatetimePlaceholder: string;
|
|
394
|
+
startMonthPlaceholder: string;
|
|
395
|
+
endMonthPlaceholder: string;
|
|
396
|
+
monthBeforeYear: boolean;
|
|
397
|
+
firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
398
|
+
today: string;
|
|
399
|
+
};
|
|
400
|
+
DataTable: {
|
|
401
|
+
checkTableAll: string;
|
|
402
|
+
uncheckTableAll: string;
|
|
403
|
+
confirm: string;
|
|
404
|
+
clear: string;
|
|
405
|
+
};
|
|
406
|
+
LegacyTransfer: {
|
|
407
|
+
sourceTitle: string;
|
|
408
|
+
targetTitle: string;
|
|
409
|
+
};
|
|
410
|
+
Transfer: {
|
|
411
|
+
selectAll: string;
|
|
412
|
+
unselectAll: string;
|
|
413
|
+
clearAll: string;
|
|
414
|
+
total: (num: number) => string;
|
|
415
|
+
selected: (num: number) => string;
|
|
416
|
+
};
|
|
417
|
+
Empty: {
|
|
418
|
+
description: string;
|
|
419
|
+
};
|
|
420
|
+
Select: {
|
|
421
|
+
placeholder: string;
|
|
422
|
+
};
|
|
423
|
+
TimePicker: {
|
|
424
|
+
placeholder: string;
|
|
425
|
+
positiveText: string;
|
|
426
|
+
negativeText: string;
|
|
427
|
+
now: string;
|
|
428
|
+
clear: string;
|
|
429
|
+
};
|
|
430
|
+
Pagination: {
|
|
431
|
+
goto: string;
|
|
432
|
+
selectionSuffix: string;
|
|
433
|
+
};
|
|
434
|
+
DynamicTags: {
|
|
435
|
+
add: string;
|
|
436
|
+
};
|
|
437
|
+
Log: {
|
|
438
|
+
loading: string;
|
|
439
|
+
};
|
|
440
|
+
Input: {
|
|
441
|
+
placeholder: string;
|
|
442
|
+
};
|
|
443
|
+
InputNumber: {
|
|
444
|
+
placeholder: string;
|
|
445
|
+
};
|
|
446
|
+
DynamicInput: {
|
|
447
|
+
create: string;
|
|
448
|
+
};
|
|
449
|
+
ThemeEditor: {
|
|
450
|
+
title: string;
|
|
451
|
+
clearAllVars: string;
|
|
452
|
+
clearSearch: string;
|
|
453
|
+
filterCompName: string;
|
|
454
|
+
filterVarName: string;
|
|
455
|
+
import: string;
|
|
456
|
+
export: string;
|
|
457
|
+
restore: string;
|
|
458
|
+
};
|
|
459
|
+
Image: {
|
|
460
|
+
tipPrevious: string;
|
|
461
|
+
tipNext: string;
|
|
462
|
+
tipCounterclockwise: string;
|
|
463
|
+
tipClockwise: string;
|
|
464
|
+
tipZoomOut: string;
|
|
465
|
+
tipZoomIn: string;
|
|
466
|
+
tipDownload: string;
|
|
467
|
+
tipClose: string;
|
|
468
|
+
tipOriginalSize: string;
|
|
469
|
+
};
|
|
470
|
+
Heatmap: {
|
|
471
|
+
less: string;
|
|
472
|
+
more: string;
|
|
473
|
+
monthFormat: string;
|
|
474
|
+
weekdayFormat: string;
|
|
475
|
+
};
|
|
476
|
+
} | null | undefined;
|
|
477
|
+
readonly clsPrefix?: string | undefined;
|
|
478
|
+
readonly dateLocale?: NDateLocale | null | undefined;
|
|
479
|
+
readonly rtl?: RtlProp | undefined;
|
|
480
|
+
readonly hljs?: Hljs | undefined;
|
|
481
|
+
readonly katex?: any;
|
|
482
|
+
readonly componentOptions?: GlobalComponentConfig | undefined;
|
|
483
|
+
readonly icons?: GlobalIconConfig | undefined;
|
|
484
|
+
readonly breakpoints?: Breakpoints;
|
|
485
|
+
readonly preflightStyleDisabled?: boolean | undefined;
|
|
486
|
+
readonly styleMountTarget?: ParentNode | null | undefined;
|
|
487
|
+
readonly onSubmit?: ((formData: {
|
|
488
|
+
[x: string]: unknown;
|
|
489
|
+
}, id: string | undefined, version: number | undefined) => any) | undefined;
|
|
490
|
+
readonly "onUpdate:modelValue"?: ((value: {
|
|
491
|
+
[x: string]: unknown;
|
|
492
|
+
}) => any) | undefined;
|
|
493
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
494
|
+
$attrs: Attrs;
|
|
495
|
+
$refs: {
|
|
496
|
+
[x: string]: unknown;
|
|
497
|
+
} & {
|
|
498
|
+
formKitRef: CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
499
|
+
type?: string;
|
|
500
|
+
name?: string;
|
|
501
|
+
actions?: boolean;
|
|
502
|
+
formClass?: string;
|
|
503
|
+
modelValue?: {
|
|
504
|
+
[x: string]: unknown;
|
|
505
|
+
};
|
|
506
|
+
'onUpdate:modelValue'?: (value: {
|
|
507
|
+
[x: string]: unknown;
|
|
508
|
+
}) => void;
|
|
509
|
+
onSubmit?: (formData: {
|
|
510
|
+
[x: string]: unknown;
|
|
511
|
+
}) => void;
|
|
512
|
+
}>, {}, {}, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
513
|
+
P: {};
|
|
514
|
+
B: {};
|
|
515
|
+
D: {};
|
|
516
|
+
C: {};
|
|
517
|
+
M: {};
|
|
518
|
+
Defaults: {};
|
|
519
|
+
}, Readonly<{
|
|
520
|
+
type?: string;
|
|
521
|
+
name?: string;
|
|
522
|
+
actions?: boolean;
|
|
523
|
+
formClass?: string;
|
|
524
|
+
modelValue?: {
|
|
525
|
+
[x: string]: unknown;
|
|
526
|
+
};
|
|
527
|
+
'onUpdate:modelValue'?: (value: {
|
|
528
|
+
[x: string]: unknown;
|
|
529
|
+
}) => void;
|
|
530
|
+
onSubmit?: (formData: {
|
|
531
|
+
[x: string]: unknown;
|
|
532
|
+
}) => void;
|
|
533
|
+
}>, {}, {}, ComputedOptions, MethodOptions, {}> | null;
|
|
534
|
+
};
|
|
535
|
+
$slots: Readonly<{
|
|
536
|
+
[name: string]: Slot<any> | undefined;
|
|
537
|
+
}>;
|
|
538
|
+
$root: ComponentPublicInstance | null;
|
|
539
|
+
$parent: ComponentPublicInstance | null;
|
|
540
|
+
$host: Element | null;
|
|
541
|
+
$emit: ((event: "submit", formData: {
|
|
542
|
+
[x: string]: unknown;
|
|
543
|
+
}, id: string | undefined, version: number | undefined) => void) & ((event: "update:modelValue", value: {
|
|
544
|
+
[x: string]: unknown;
|
|
545
|
+
}) => void);
|
|
546
|
+
$el: any;
|
|
547
|
+
$options: ComponentOptionsBase<Readonly<{
|
|
548
|
+
definition?: FormDefinition;
|
|
549
|
+
schema?: FormKitSchemaFormKit[];
|
|
550
|
+
dataStructure?: "flat" | "nested";
|
|
551
|
+
modelValue?: {
|
|
552
|
+
[x: string]: unknown;
|
|
553
|
+
};
|
|
554
|
+
actions?: boolean;
|
|
555
|
+
submitLabel?: string;
|
|
556
|
+
resetLabel?: string;
|
|
557
|
+
submitAttrs?: Record<string, unknown>;
|
|
558
|
+
resetAttrs?: Record<string, unknown>;
|
|
559
|
+
actionsJustify?: "start" | "center" | "end" | "space-between";
|
|
560
|
+
formClass?: string;
|
|
561
|
+
formName?: string;
|
|
562
|
+
labelPosition?: "top" | "left";
|
|
563
|
+
labelWidth?: number;
|
|
564
|
+
schemaLibrary?: Record<string, Component>;
|
|
565
|
+
interactiveContainers?: boolean;
|
|
566
|
+
config?: FormBuilderConfig;
|
|
567
|
+
theme?: BuilderTheme;
|
|
568
|
+
http?: AxiosInstance;
|
|
569
|
+
} & Omit<Partial<Partial<ExtractPropTypes< {
|
|
570
|
+
readonly abstract: BooleanConstructor;
|
|
571
|
+
readonly bordered: {
|
|
572
|
+
readonly type: PropType<boolean | undefined>;
|
|
573
|
+
readonly default: undefined;
|
|
574
|
+
};
|
|
575
|
+
readonly clsPrefix: StringConstructor;
|
|
576
|
+
readonly locale: PropType<NLocale | null>;
|
|
577
|
+
readonly dateLocale: PropType<NDateLocale | null>;
|
|
578
|
+
readonly namespace: StringConstructor;
|
|
579
|
+
readonly rtl: PropType<RtlProp>;
|
|
580
|
+
readonly tag: {
|
|
581
|
+
readonly type: StringConstructor;
|
|
582
|
+
readonly default: "div";
|
|
583
|
+
};
|
|
584
|
+
readonly hljs: PropType<Hljs>;
|
|
585
|
+
readonly katex: PropType<Katex>;
|
|
586
|
+
readonly theme: PropType<GlobalTheme | null>;
|
|
587
|
+
readonly themeOverrides: PropType<GlobalThemeOverrides | null>;
|
|
588
|
+
readonly componentOptions: PropType<GlobalComponentConfig>;
|
|
589
|
+
readonly icons: PropType<GlobalIconConfig>;
|
|
590
|
+
readonly breakpoints: PropType<Breakpoints>;
|
|
591
|
+
readonly preflightStyleDisabled: BooleanConstructor;
|
|
592
|
+
readonly styleMountTarget: PropType<ParentNode | null>;
|
|
593
|
+
readonly inlineThemeDisabled: {
|
|
594
|
+
readonly type: BooleanConstructor;
|
|
595
|
+
readonly default: undefined;
|
|
596
|
+
};
|
|
597
|
+
readonly as: {
|
|
598
|
+
readonly type: PropType<string | undefined>;
|
|
599
|
+
readonly validator: () => boolean;
|
|
600
|
+
readonly default: undefined;
|
|
601
|
+
};
|
|
602
|
+
}>>>, "theme">> & Readonly<{
|
|
603
|
+
onSubmit?: ((formData: {
|
|
604
|
+
[x: string]: unknown;
|
|
605
|
+
}, id: string | undefined, version: number | undefined) => any) | undefined;
|
|
606
|
+
"onUpdate:modelValue"?: ((value: {
|
|
607
|
+
[x: string]: unknown;
|
|
608
|
+
}) => any) | undefined;
|
|
609
|
+
}>, {
|
|
610
|
+
submit: () => void | undefined;
|
|
611
|
+
reset: () => void | undefined;
|
|
612
|
+
validate: () => Promise<boolean>;
|
|
613
|
+
loading: Ref<boolean, boolean>;
|
|
614
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
615
|
+
submit: (formData: {
|
|
616
|
+
[x: string]: unknown;
|
|
617
|
+
}, id: string | undefined, version: number | undefined) => any;
|
|
618
|
+
"update:modelValue": (value: {
|
|
619
|
+
[x: string]: unknown;
|
|
620
|
+
}) => any;
|
|
621
|
+
}, string, {
|
|
622
|
+
actions: boolean;
|
|
623
|
+
formClass: string;
|
|
624
|
+
dataStructure: "flat" | "nested";
|
|
625
|
+
actionsJustify: "start" | "center" | "end" | "space-between";
|
|
626
|
+
interactiveContainers: boolean;
|
|
627
|
+
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
628
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
629
|
+
created?: (() => void) | (() => void)[];
|
|
630
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
631
|
+
mounted?: (() => void) | (() => void)[];
|
|
632
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
633
|
+
updated?: (() => void) | (() => void)[];
|
|
634
|
+
activated?: (() => void) | (() => void)[];
|
|
635
|
+
deactivated?: (() => void) | (() => void)[];
|
|
636
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
637
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
638
|
+
destroyed?: (() => void) | (() => void)[];
|
|
639
|
+
unmounted?: (() => void) | (() => void)[];
|
|
640
|
+
renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
641
|
+
renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
642
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
643
|
+
};
|
|
644
|
+
$forceUpdate: () => void;
|
|
645
|
+
$nextTick: typeof nextTick;
|
|
646
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
|
|
647
|
+
} & Readonly<{
|
|
648
|
+
actions: boolean;
|
|
649
|
+
formClass: string;
|
|
650
|
+
dataStructure: "flat" | "nested";
|
|
651
|
+
actionsJustify: "start" | "center" | "end" | "space-between";
|
|
652
|
+
interactiveContainers: boolean;
|
|
653
|
+
}> & Omit<Readonly<{
|
|
654
|
+
definition?: FormDefinition;
|
|
655
|
+
schema?: FormKitSchemaFormKit[];
|
|
656
|
+
dataStructure?: "flat" | "nested";
|
|
657
|
+
modelValue?: {
|
|
658
|
+
[x: string]: unknown;
|
|
659
|
+
};
|
|
660
|
+
actions?: boolean;
|
|
661
|
+
submitLabel?: string;
|
|
662
|
+
resetLabel?: string;
|
|
663
|
+
submitAttrs?: Record<string, unknown>;
|
|
664
|
+
resetAttrs?: Record<string, unknown>;
|
|
665
|
+
actionsJustify?: "start" | "center" | "end" | "space-between";
|
|
666
|
+
formClass?: string;
|
|
667
|
+
formName?: string;
|
|
668
|
+
labelPosition?: "top" | "left";
|
|
669
|
+
labelWidth?: number;
|
|
670
|
+
schemaLibrary?: Record<string, Component>;
|
|
671
|
+
interactiveContainers?: boolean;
|
|
672
|
+
config?: FormBuilderConfig;
|
|
673
|
+
theme?: BuilderTheme;
|
|
674
|
+
http?: AxiosInstance;
|
|
675
|
+
} & Omit<Partial<Partial<ExtractPropTypes< {
|
|
676
|
+
readonly abstract: BooleanConstructor;
|
|
677
|
+
readonly bordered: {
|
|
678
|
+
readonly type: PropType<boolean | undefined>;
|
|
679
|
+
readonly default: undefined;
|
|
680
|
+
};
|
|
681
|
+
readonly clsPrefix: StringConstructor;
|
|
682
|
+
readonly locale: PropType<NLocale | null>;
|
|
683
|
+
readonly dateLocale: PropType<NDateLocale | null>;
|
|
684
|
+
readonly namespace: StringConstructor;
|
|
685
|
+
readonly rtl: PropType<RtlProp>;
|
|
686
|
+
readonly tag: {
|
|
687
|
+
readonly type: StringConstructor;
|
|
688
|
+
readonly default: "div";
|
|
689
|
+
};
|
|
690
|
+
readonly hljs: PropType<Hljs>;
|
|
691
|
+
readonly katex: PropType<Katex>;
|
|
692
|
+
readonly theme: PropType<GlobalTheme | null>;
|
|
693
|
+
readonly themeOverrides: PropType<GlobalThemeOverrides | null>;
|
|
694
|
+
readonly componentOptions: PropType<GlobalComponentConfig>;
|
|
695
|
+
readonly icons: PropType<GlobalIconConfig>;
|
|
696
|
+
readonly breakpoints: PropType<Breakpoints>;
|
|
697
|
+
readonly preflightStyleDisabled: BooleanConstructor;
|
|
698
|
+
readonly styleMountTarget: PropType<ParentNode | null>;
|
|
699
|
+
readonly inlineThemeDisabled: {
|
|
700
|
+
readonly type: BooleanConstructor;
|
|
701
|
+
readonly default: undefined;
|
|
702
|
+
};
|
|
703
|
+
readonly as: {
|
|
704
|
+
readonly type: PropType<string | undefined>;
|
|
705
|
+
readonly validator: () => boolean;
|
|
706
|
+
readonly default: undefined;
|
|
707
|
+
};
|
|
708
|
+
}>>>, "theme">> & Readonly<{
|
|
709
|
+
onSubmit?: ((formData: {
|
|
710
|
+
[x: string]: unknown;
|
|
711
|
+
}, id: string | undefined, version: number | undefined) => any) | undefined;
|
|
712
|
+
"onUpdate:modelValue"?: ((value: {
|
|
713
|
+
[x: string]: unknown;
|
|
714
|
+
}) => any) | undefined;
|
|
715
|
+
}>, "submit" | "reset" | "loading" | "validate" | ("actions" | "formClass" | "dataStructure" | "actionsJustify" | "interactiveContainers")> & {
|
|
716
|
+
submit: () => void | undefined;
|
|
717
|
+
reset: () => void | undefined;
|
|
718
|
+
validate: () => Promise<boolean>;
|
|
719
|
+
loading: boolean;
|
|
720
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
721
|
+
$slots: Readonly<{
|
|
722
|
+
actions?: (props: FormActionsScope) => unknown;
|
|
723
|
+
}> & {
|
|
724
|
+
actions?: (props: FormActionsScope) => unknown;
|
|
725
|
+
};
|
|
726
|
+
}) | null;
|
|
727
|
+
}, any>;
|
|
263
728
|
|
|
264
729
|
export declare type BuilderTheme = 'light' | 'dark';
|
|
265
730
|
|
|
@@ -278,7 +743,7 @@ declare interface ChildrenConvertCtx {
|
|
|
278
743
|
children?: (sc?: SchemaNode[]) => FormNode[];
|
|
279
744
|
}
|
|
280
745
|
|
|
281
|
-
declare type ContainerDataShape = 'object' | 'arrayOfObjects' | 'objectOfObjects' | 'none';
|
|
746
|
+
declare type ContainerDataShape = 'object' | 'array' | 'arrayOfObjects' | 'objectOfObjects' | 'none';
|
|
282
747
|
|
|
283
748
|
declare type ContainerDefinition = {
|
|
284
749
|
id: string;
|
|
@@ -313,7 +778,9 @@ export declare type ContainerRenderer<T> = (node: ContainerNode, ctx: RenderCont
|
|
|
313
778
|
declare interface ContainerSpec {
|
|
314
779
|
/** 数据结构(用户记法 → 语义名):
|
|
315
780
|
* object({}) 单对象:children 是对象字段(group 原生;card/inputGroup 壳 + group 包一层)
|
|
316
|
-
*
|
|
781
|
+
* array([]) 动态数组:单条记录是标量/单字段(list),
|
|
782
|
+
* 或预置 group 的对象数组 [{...}](nestedList 便捷项)
|
|
783
|
+
* arrayOfObjects([{}]) 遗留别名:语义等同 array(历史数据/扩展注册兼容),渲染同 list
|
|
317
784
|
* objectOfObjects({{}}) 对象之对象:每个子节点一个 group(tabs panes)
|
|
318
785
|
* none(-) 无数据:纯展示壳(buttonGroup)
|
|
319
786
|
*/
|
|
@@ -430,6 +897,11 @@ export declare interface ElementTemplate {
|
|
|
430
897
|
value?: unknown;
|
|
431
898
|
options?: unknown[];
|
|
432
899
|
validation?: string;
|
|
900
|
+
/** 容器/布局新建节点时的默认子节点(DSL 形态);如 nestedList 预置一个内部 group */
|
|
901
|
+
defaultChildren?: () => FormNode[];
|
|
902
|
+
/** 便捷预置:新建节点改用指定类型(如 nestedList → presetOf:'list',仅比 list 多内置 group),
|
|
903
|
+
* 生成的 DSL / schema 类型即该类型,本目录项仅作面板展示用 */
|
|
904
|
+
presetOf?: string;
|
|
433
905
|
/** 自定义 DSL→schema;缺省按 category+renderAs 走内置转换 */
|
|
434
906
|
toSchema?: (node: FormNode, ctx: DslToSchemaCtx) => SchemaNode;
|
|
435
907
|
/** 自定义 schema→DSL;缺省按 category 走内置转换 */
|
|
@@ -494,6 +966,8 @@ export declare interface FieldNode extends BaseNode {
|
|
|
494
966
|
category: 'field';
|
|
495
967
|
/** 初始值 */
|
|
496
968
|
value?: FieldValue;
|
|
969
|
+
/** 表达式字符串(如 "$price * $count"),由运行时 watch 求值并写入 FormKit node */
|
|
970
|
+
expr?: string;
|
|
497
971
|
validation?: ValidationRule[];
|
|
498
972
|
/** select / radio / checkbox 等选项(静态数组,或 { dynamic, code } 动态字典) */
|
|
499
973
|
options?: OptionItem[] | DynamicOptionSource;
|
|
@@ -501,10 +975,8 @@ export declare interface FieldNode extends BaseNode {
|
|
|
501
975
|
|
|
502
976
|
export declare type FieldRenderer<T> = (node: FieldNode, ctx: RenderContext<T>, children?: T[]) => T;
|
|
503
977
|
|
|
504
|
-
/** 字段值:静态值
|
|
505
|
-
declare type FieldValue = StaticValue
|
|
506
|
-
$expr: Expr;
|
|
507
|
-
};
|
|
978
|
+
/** 字段值:静态值 */
|
|
979
|
+
declare type FieldValue = StaticValue;
|
|
508
980
|
|
|
509
981
|
/** #actions 槽作用域:可由外部自定义操作区按钮,复用表单提交/重置 */
|
|
510
982
|
declare type FormActionsScope = {
|
|
@@ -514,7 +986,17 @@ declare type FormActionsScope = {
|
|
|
514
986
|
};
|
|
515
987
|
|
|
516
988
|
export declare interface FormBuilderConfig {
|
|
989
|
+
/** AI 服务 API Key(建议仅在服务端代理场景使用,勿在前端暴露真实密钥) */
|
|
517
990
|
apiKey?: string;
|
|
991
|
+
/** OpenAI 兼容接口地址,默认 https://api.deepseek.com(可指向自建服务端代理) */
|
|
992
|
+
aiBaseUrl?: string;
|
|
993
|
+
/** AI 模型名,默认 deepseek-chat(OpenAI 用户可设 gpt-4o-mini 等) */
|
|
994
|
+
aiModel?: string;
|
|
995
|
+
/** 自定义 AI 系统提示词;默认使用内置 Instructions.txt */
|
|
996
|
+
aiSystemPrompt?: string;
|
|
997
|
+
/** 自定义 HTTP 请求库实例:供 JS 绑定代码里的 axios 变量使用(画布预览 + 渲染器);
|
|
998
|
+
* 缺省使用内置 axios。FormRenderer 的 http prop 优先级更高。 */
|
|
999
|
+
http?: AxiosInstance;
|
|
518
1000
|
locale?: string;
|
|
519
1001
|
localeFallback?: string;
|
|
520
1002
|
messages?: Record<string, any>;
|
|
@@ -565,10 +1047,444 @@ export declare interface FormDefinition {
|
|
|
565
1047
|
meta?: Record<string, unknown>;
|
|
566
1048
|
}
|
|
567
1049
|
|
|
1050
|
+
export declare const FormDefinitionPreview: DefineComponent<__VLS_Props_4, {
|
|
1051
|
+
open: () => void;
|
|
1052
|
+
close: () => void;
|
|
1053
|
+
reset: () => void;
|
|
1054
|
+
validate: () => Promise<boolean>;
|
|
1055
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1056
|
+
submit: (formData: ModelValue_2, id: string | undefined, version: number | undefined) => any;
|
|
1057
|
+
"update:show": (value: boolean) => any;
|
|
1058
|
+
}, string, PublicProps, Readonly<__VLS_Props_4> & Readonly<{
|
|
1059
|
+
onSubmit?: ((formData: ModelValue_2, id: string | undefined, version: number | undefined) => any) | undefined;
|
|
1060
|
+
"onUpdate:show"?: ((value: boolean) => any) | undefined;
|
|
1061
|
+
}>, {
|
|
1062
|
+
title: string;
|
|
1063
|
+
actions: boolean;
|
|
1064
|
+
formClass: string;
|
|
1065
|
+
interactiveContainers: boolean;
|
|
1066
|
+
showDataPanel: boolean;
|
|
1067
|
+
initialData: ModelValue_2;
|
|
1068
|
+
resetOnSubmit: boolean;
|
|
1069
|
+
dataPanelWidth: string;
|
|
1070
|
+
}, {}, {}, {}, string, ComponentProvideOptions, false, {
|
|
1071
|
+
rendererRef: ({
|
|
1072
|
+
$: ComponentInternalInstance;
|
|
1073
|
+
$data: {};
|
|
1074
|
+
$props: {
|
|
1075
|
+
readonly definition?: FormDefinition | undefined;
|
|
1076
|
+
readonly schema?: FormKitSchemaFormKit[] | undefined;
|
|
1077
|
+
readonly dataStructure?: "flat" | "nested" | undefined;
|
|
1078
|
+
readonly modelValue?: {
|
|
1079
|
+
[x: string]: unknown;
|
|
1080
|
+
} | undefined;
|
|
1081
|
+
readonly actions?: boolean | undefined;
|
|
1082
|
+
readonly submitLabel?: string | undefined;
|
|
1083
|
+
readonly resetLabel?: string | undefined;
|
|
1084
|
+
readonly submitAttrs?: Record<string, unknown> | undefined;
|
|
1085
|
+
readonly resetAttrs?: Record<string, unknown> | undefined;
|
|
1086
|
+
readonly actionsJustify?: "start" | "center" | "end" | "space-between" | undefined;
|
|
1087
|
+
readonly formClass?: string | undefined;
|
|
1088
|
+
readonly formName?: string | undefined;
|
|
1089
|
+
readonly labelPosition?: "top" | "left" | undefined;
|
|
1090
|
+
readonly labelWidth?: number | undefined;
|
|
1091
|
+
readonly schemaLibrary?: Record<string, Component> | undefined;
|
|
1092
|
+
readonly interactiveContainers?: boolean | undefined;
|
|
1093
|
+
readonly config?: FormBuilderConfig | undefined;
|
|
1094
|
+
readonly theme?: BuilderTheme | undefined;
|
|
1095
|
+
readonly http?: AxiosInstance | undefined;
|
|
1096
|
+
readonly themeOverrides?: GlobalThemeOverrides | null | undefined;
|
|
1097
|
+
readonly tag?: string | undefined;
|
|
1098
|
+
readonly bordered?: boolean | undefined;
|
|
1099
|
+
readonly namespace?: string | undefined;
|
|
1100
|
+
readonly inlineThemeDisabled?: boolean | undefined;
|
|
1101
|
+
readonly abstract?: boolean | undefined;
|
|
1102
|
+
readonly as?: string | undefined;
|
|
1103
|
+
readonly locale?: {
|
|
1104
|
+
name: string;
|
|
1105
|
+
global: {
|
|
1106
|
+
undo: string;
|
|
1107
|
+
redo: string;
|
|
1108
|
+
confirm: string;
|
|
1109
|
+
clear: string;
|
|
1110
|
+
};
|
|
1111
|
+
Popconfirm: {
|
|
1112
|
+
positiveText: string;
|
|
1113
|
+
negativeText: string;
|
|
1114
|
+
};
|
|
1115
|
+
Cascader: {
|
|
1116
|
+
placeholder: string;
|
|
1117
|
+
loading: string;
|
|
1118
|
+
loadingRequiredMessage: (label: string) => string;
|
|
1119
|
+
};
|
|
1120
|
+
Time: {
|
|
1121
|
+
dateFormat: string;
|
|
1122
|
+
dateTimeFormat: string;
|
|
1123
|
+
};
|
|
1124
|
+
DatePicker: {
|
|
1125
|
+
yearFormat: string;
|
|
1126
|
+
monthFormat: string;
|
|
1127
|
+
dayFormat: string;
|
|
1128
|
+
yearTypeFormat: string;
|
|
1129
|
+
monthTypeFormat: string;
|
|
1130
|
+
dateFormat: string;
|
|
1131
|
+
dateTimeFormat: string;
|
|
1132
|
+
quarterFormat: string;
|
|
1133
|
+
weekFormat: string;
|
|
1134
|
+
clear: string;
|
|
1135
|
+
now: string;
|
|
1136
|
+
confirm: string;
|
|
1137
|
+
selectTime: string;
|
|
1138
|
+
selectDate: string;
|
|
1139
|
+
datePlaceholder: string;
|
|
1140
|
+
datetimePlaceholder: string;
|
|
1141
|
+
monthPlaceholder: string;
|
|
1142
|
+
yearPlaceholder: string;
|
|
1143
|
+
quarterPlaceholder: string;
|
|
1144
|
+
weekPlaceholder: string;
|
|
1145
|
+
startDatePlaceholder: string;
|
|
1146
|
+
endDatePlaceholder: string;
|
|
1147
|
+
startDatetimePlaceholder: string;
|
|
1148
|
+
endDatetimePlaceholder: string;
|
|
1149
|
+
startMonthPlaceholder: string;
|
|
1150
|
+
endMonthPlaceholder: string;
|
|
1151
|
+
monthBeforeYear: boolean;
|
|
1152
|
+
firstDayOfWeek: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
1153
|
+
today: string;
|
|
1154
|
+
};
|
|
1155
|
+
DataTable: {
|
|
1156
|
+
checkTableAll: string;
|
|
1157
|
+
uncheckTableAll: string;
|
|
1158
|
+
confirm: string;
|
|
1159
|
+
clear: string;
|
|
1160
|
+
};
|
|
1161
|
+
LegacyTransfer: {
|
|
1162
|
+
sourceTitle: string;
|
|
1163
|
+
targetTitle: string;
|
|
1164
|
+
};
|
|
1165
|
+
Transfer: {
|
|
1166
|
+
selectAll: string;
|
|
1167
|
+
unselectAll: string;
|
|
1168
|
+
clearAll: string;
|
|
1169
|
+
total: (num: number) => string;
|
|
1170
|
+
selected: (num: number) => string;
|
|
1171
|
+
};
|
|
1172
|
+
Empty: {
|
|
1173
|
+
description: string;
|
|
1174
|
+
};
|
|
1175
|
+
Select: {
|
|
1176
|
+
placeholder: string;
|
|
1177
|
+
};
|
|
1178
|
+
TimePicker: {
|
|
1179
|
+
placeholder: string;
|
|
1180
|
+
positiveText: string;
|
|
1181
|
+
negativeText: string;
|
|
1182
|
+
now: string;
|
|
1183
|
+
clear: string;
|
|
1184
|
+
};
|
|
1185
|
+
Pagination: {
|
|
1186
|
+
goto: string;
|
|
1187
|
+
selectionSuffix: string;
|
|
1188
|
+
};
|
|
1189
|
+
DynamicTags: {
|
|
1190
|
+
add: string;
|
|
1191
|
+
};
|
|
1192
|
+
Log: {
|
|
1193
|
+
loading: string;
|
|
1194
|
+
};
|
|
1195
|
+
Input: {
|
|
1196
|
+
placeholder: string;
|
|
1197
|
+
};
|
|
1198
|
+
InputNumber: {
|
|
1199
|
+
placeholder: string;
|
|
1200
|
+
};
|
|
1201
|
+
DynamicInput: {
|
|
1202
|
+
create: string;
|
|
1203
|
+
};
|
|
1204
|
+
ThemeEditor: {
|
|
1205
|
+
title: string;
|
|
1206
|
+
clearAllVars: string;
|
|
1207
|
+
clearSearch: string;
|
|
1208
|
+
filterCompName: string;
|
|
1209
|
+
filterVarName: string;
|
|
1210
|
+
import: string;
|
|
1211
|
+
export: string;
|
|
1212
|
+
restore: string;
|
|
1213
|
+
};
|
|
1214
|
+
Image: {
|
|
1215
|
+
tipPrevious: string;
|
|
1216
|
+
tipNext: string;
|
|
1217
|
+
tipCounterclockwise: string;
|
|
1218
|
+
tipClockwise: string;
|
|
1219
|
+
tipZoomOut: string;
|
|
1220
|
+
tipZoomIn: string;
|
|
1221
|
+
tipDownload: string;
|
|
1222
|
+
tipClose: string;
|
|
1223
|
+
tipOriginalSize: string;
|
|
1224
|
+
};
|
|
1225
|
+
Heatmap: {
|
|
1226
|
+
less: string;
|
|
1227
|
+
more: string;
|
|
1228
|
+
monthFormat: string;
|
|
1229
|
+
weekdayFormat: string;
|
|
1230
|
+
};
|
|
1231
|
+
} | null | undefined;
|
|
1232
|
+
readonly clsPrefix?: string | undefined;
|
|
1233
|
+
readonly dateLocale?: NDateLocale | null | undefined;
|
|
1234
|
+
readonly rtl?: RtlProp | undefined;
|
|
1235
|
+
readonly hljs?: Hljs | undefined;
|
|
1236
|
+
readonly katex?: any;
|
|
1237
|
+
readonly componentOptions?: GlobalComponentConfig | undefined;
|
|
1238
|
+
readonly icons?: GlobalIconConfig | undefined;
|
|
1239
|
+
readonly breakpoints?: Breakpoints;
|
|
1240
|
+
readonly preflightStyleDisabled?: boolean | undefined;
|
|
1241
|
+
readonly styleMountTarget?: ParentNode | null | undefined;
|
|
1242
|
+
readonly onSubmit?: ((formData: {
|
|
1243
|
+
[x: string]: unknown;
|
|
1244
|
+
}, id: string | undefined, version: number | undefined) => any) | undefined;
|
|
1245
|
+
readonly "onUpdate:modelValue"?: ((value: {
|
|
1246
|
+
[x: string]: unknown;
|
|
1247
|
+
}) => any) | undefined;
|
|
1248
|
+
} & VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1249
|
+
$attrs: Attrs;
|
|
1250
|
+
$refs: {
|
|
1251
|
+
[x: string]: unknown;
|
|
1252
|
+
} & {
|
|
1253
|
+
formKitRef: CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
1254
|
+
type?: string;
|
|
1255
|
+
name?: string;
|
|
1256
|
+
actions?: boolean;
|
|
1257
|
+
formClass?: string;
|
|
1258
|
+
modelValue?: {
|
|
1259
|
+
[x: string]: unknown;
|
|
1260
|
+
};
|
|
1261
|
+
'onUpdate:modelValue'?: (value: {
|
|
1262
|
+
[x: string]: unknown;
|
|
1263
|
+
}) => void;
|
|
1264
|
+
onSubmit?: (formData: {
|
|
1265
|
+
[x: string]: unknown;
|
|
1266
|
+
}) => void;
|
|
1267
|
+
}>, {}, {}, ComputedOptions, MethodOptions, ComponentOptionsMixin, ComponentOptionsMixin, {}, PublicProps, {}, true, {}, {}, GlobalComponents, GlobalDirectives, string, {}, any, ComponentProvideOptions, {
|
|
1268
|
+
P: {};
|
|
1269
|
+
B: {};
|
|
1270
|
+
D: {};
|
|
1271
|
+
C: {};
|
|
1272
|
+
M: {};
|
|
1273
|
+
Defaults: {};
|
|
1274
|
+
}, Readonly<{
|
|
1275
|
+
type?: string;
|
|
1276
|
+
name?: string;
|
|
1277
|
+
actions?: boolean;
|
|
1278
|
+
formClass?: string;
|
|
1279
|
+
modelValue?: {
|
|
1280
|
+
[x: string]: unknown;
|
|
1281
|
+
};
|
|
1282
|
+
'onUpdate:modelValue'?: (value: {
|
|
1283
|
+
[x: string]: unknown;
|
|
1284
|
+
}) => void;
|
|
1285
|
+
onSubmit?: (formData: {
|
|
1286
|
+
[x: string]: unknown;
|
|
1287
|
+
}) => void;
|
|
1288
|
+
}>, {}, {}, ComputedOptions, MethodOptions, {}> | null;
|
|
1289
|
+
};
|
|
1290
|
+
$slots: Readonly<{
|
|
1291
|
+
[name: string]: Slot<any> | undefined;
|
|
1292
|
+
}>;
|
|
1293
|
+
$root: ComponentPublicInstance | null;
|
|
1294
|
+
$parent: ComponentPublicInstance | null;
|
|
1295
|
+
$host: Element | null;
|
|
1296
|
+
$emit: ((event: "submit", formData: {
|
|
1297
|
+
[x: string]: unknown;
|
|
1298
|
+
}, id: string | undefined, version: number | undefined) => void) & ((event: "update:modelValue", value: {
|
|
1299
|
+
[x: string]: unknown;
|
|
1300
|
+
}) => void);
|
|
1301
|
+
$el: any;
|
|
1302
|
+
$options: ComponentOptionsBase<Readonly<{
|
|
1303
|
+
definition?: FormDefinition;
|
|
1304
|
+
schema?: FormKitSchemaFormKit[];
|
|
1305
|
+
dataStructure?: "flat" | "nested";
|
|
1306
|
+
modelValue?: {
|
|
1307
|
+
[x: string]: unknown;
|
|
1308
|
+
};
|
|
1309
|
+
actions?: boolean;
|
|
1310
|
+
submitLabel?: string;
|
|
1311
|
+
resetLabel?: string;
|
|
1312
|
+
submitAttrs?: Record<string, unknown>;
|
|
1313
|
+
resetAttrs?: Record<string, unknown>;
|
|
1314
|
+
actionsJustify?: "start" | "center" | "end" | "space-between";
|
|
1315
|
+
formClass?: string;
|
|
1316
|
+
formName?: string;
|
|
1317
|
+
labelPosition?: "top" | "left";
|
|
1318
|
+
labelWidth?: number;
|
|
1319
|
+
schemaLibrary?: Record<string, Component>;
|
|
1320
|
+
interactiveContainers?: boolean;
|
|
1321
|
+
config?: FormBuilderConfig;
|
|
1322
|
+
theme?: BuilderTheme;
|
|
1323
|
+
http?: AxiosInstance;
|
|
1324
|
+
} & Omit<Partial<Partial<ExtractPropTypes< {
|
|
1325
|
+
readonly abstract: BooleanConstructor;
|
|
1326
|
+
readonly bordered: {
|
|
1327
|
+
readonly type: PropType<boolean | undefined>;
|
|
1328
|
+
readonly default: undefined;
|
|
1329
|
+
};
|
|
1330
|
+
readonly clsPrefix: StringConstructor;
|
|
1331
|
+
readonly locale: PropType<NLocale | null>;
|
|
1332
|
+
readonly dateLocale: PropType<NDateLocale | null>;
|
|
1333
|
+
readonly namespace: StringConstructor;
|
|
1334
|
+
readonly rtl: PropType<RtlProp>;
|
|
1335
|
+
readonly tag: {
|
|
1336
|
+
readonly type: StringConstructor;
|
|
1337
|
+
readonly default: "div";
|
|
1338
|
+
};
|
|
1339
|
+
readonly hljs: PropType<Hljs>;
|
|
1340
|
+
readonly katex: PropType<Katex>;
|
|
1341
|
+
readonly theme: PropType<GlobalTheme | null>;
|
|
1342
|
+
readonly themeOverrides: PropType<GlobalThemeOverrides | null>;
|
|
1343
|
+
readonly componentOptions: PropType<GlobalComponentConfig>;
|
|
1344
|
+
readonly icons: PropType<GlobalIconConfig>;
|
|
1345
|
+
readonly breakpoints: PropType<Breakpoints>;
|
|
1346
|
+
readonly preflightStyleDisabled: BooleanConstructor;
|
|
1347
|
+
readonly styleMountTarget: PropType<ParentNode | null>;
|
|
1348
|
+
readonly inlineThemeDisabled: {
|
|
1349
|
+
readonly type: BooleanConstructor;
|
|
1350
|
+
readonly default: undefined;
|
|
1351
|
+
};
|
|
1352
|
+
readonly as: {
|
|
1353
|
+
readonly type: PropType<string | undefined>;
|
|
1354
|
+
readonly validator: () => boolean;
|
|
1355
|
+
readonly default: undefined;
|
|
1356
|
+
};
|
|
1357
|
+
}>>>, "theme">> & Readonly<{
|
|
1358
|
+
onSubmit?: ((formData: {
|
|
1359
|
+
[x: string]: unknown;
|
|
1360
|
+
}, id: string | undefined, version: number | undefined) => any) | undefined;
|
|
1361
|
+
"onUpdate:modelValue"?: ((value: {
|
|
1362
|
+
[x: string]: unknown;
|
|
1363
|
+
}) => any) | undefined;
|
|
1364
|
+
}>, {
|
|
1365
|
+
submit: () => void | undefined;
|
|
1366
|
+
reset: () => void | undefined;
|
|
1367
|
+
validate: () => Promise<boolean>;
|
|
1368
|
+
loading: Ref<boolean, boolean>;
|
|
1369
|
+
}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {} & {
|
|
1370
|
+
submit: (formData: {
|
|
1371
|
+
[x: string]: unknown;
|
|
1372
|
+
}, id: string | undefined, version: number | undefined) => any;
|
|
1373
|
+
"update:modelValue": (value: {
|
|
1374
|
+
[x: string]: unknown;
|
|
1375
|
+
}) => any;
|
|
1376
|
+
}, string, {
|
|
1377
|
+
actions: boolean;
|
|
1378
|
+
formClass: string;
|
|
1379
|
+
dataStructure: "flat" | "nested";
|
|
1380
|
+
actionsJustify: "start" | "center" | "end" | "space-between";
|
|
1381
|
+
interactiveContainers: boolean;
|
|
1382
|
+
}, {}, string, {}, GlobalComponents, GlobalDirectives, string, ComponentProvideOptions> & {
|
|
1383
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
1384
|
+
created?: (() => void) | (() => void)[];
|
|
1385
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
1386
|
+
mounted?: (() => void) | (() => void)[];
|
|
1387
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
1388
|
+
updated?: (() => void) | (() => void)[];
|
|
1389
|
+
activated?: (() => void) | (() => void)[];
|
|
1390
|
+
deactivated?: (() => void) | (() => void)[];
|
|
1391
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
1392
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
1393
|
+
destroyed?: (() => void) | (() => void)[];
|
|
1394
|
+
unmounted?: (() => void) | (() => void)[];
|
|
1395
|
+
renderTracked?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
1396
|
+
renderTriggered?: ((e: DebuggerEvent) => void) | ((e: DebuggerEvent) => void)[];
|
|
1397
|
+
errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
1398
|
+
};
|
|
1399
|
+
$forceUpdate: () => void;
|
|
1400
|
+
$nextTick: typeof nextTick;
|
|
1401
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
|
|
1402
|
+
} & Readonly<{
|
|
1403
|
+
actions: boolean;
|
|
1404
|
+
formClass: string;
|
|
1405
|
+
dataStructure: "flat" | "nested";
|
|
1406
|
+
actionsJustify: "start" | "center" | "end" | "space-between";
|
|
1407
|
+
interactiveContainers: boolean;
|
|
1408
|
+
}> & Omit<Readonly<{
|
|
1409
|
+
definition?: FormDefinition;
|
|
1410
|
+
schema?: FormKitSchemaFormKit[];
|
|
1411
|
+
dataStructure?: "flat" | "nested";
|
|
1412
|
+
modelValue?: {
|
|
1413
|
+
[x: string]: unknown;
|
|
1414
|
+
};
|
|
1415
|
+
actions?: boolean;
|
|
1416
|
+
submitLabel?: string;
|
|
1417
|
+
resetLabel?: string;
|
|
1418
|
+
submitAttrs?: Record<string, unknown>;
|
|
1419
|
+
resetAttrs?: Record<string, unknown>;
|
|
1420
|
+
actionsJustify?: "start" | "center" | "end" | "space-between";
|
|
1421
|
+
formClass?: string;
|
|
1422
|
+
formName?: string;
|
|
1423
|
+
labelPosition?: "top" | "left";
|
|
1424
|
+
labelWidth?: number;
|
|
1425
|
+
schemaLibrary?: Record<string, Component>;
|
|
1426
|
+
interactiveContainers?: boolean;
|
|
1427
|
+
config?: FormBuilderConfig;
|
|
1428
|
+
theme?: BuilderTheme;
|
|
1429
|
+
http?: AxiosInstance;
|
|
1430
|
+
} & Omit<Partial<Partial<ExtractPropTypes< {
|
|
1431
|
+
readonly abstract: BooleanConstructor;
|
|
1432
|
+
readonly bordered: {
|
|
1433
|
+
readonly type: PropType<boolean | undefined>;
|
|
1434
|
+
readonly default: undefined;
|
|
1435
|
+
};
|
|
1436
|
+
readonly clsPrefix: StringConstructor;
|
|
1437
|
+
readonly locale: PropType<NLocale | null>;
|
|
1438
|
+
readonly dateLocale: PropType<NDateLocale | null>;
|
|
1439
|
+
readonly namespace: StringConstructor;
|
|
1440
|
+
readonly rtl: PropType<RtlProp>;
|
|
1441
|
+
readonly tag: {
|
|
1442
|
+
readonly type: StringConstructor;
|
|
1443
|
+
readonly default: "div";
|
|
1444
|
+
};
|
|
1445
|
+
readonly hljs: PropType<Hljs>;
|
|
1446
|
+
readonly katex: PropType<Katex>;
|
|
1447
|
+
readonly theme: PropType<GlobalTheme | null>;
|
|
1448
|
+
readonly themeOverrides: PropType<GlobalThemeOverrides | null>;
|
|
1449
|
+
readonly componentOptions: PropType<GlobalComponentConfig>;
|
|
1450
|
+
readonly icons: PropType<GlobalIconConfig>;
|
|
1451
|
+
readonly breakpoints: PropType<Breakpoints>;
|
|
1452
|
+
readonly preflightStyleDisabled: BooleanConstructor;
|
|
1453
|
+
readonly styleMountTarget: PropType<ParentNode | null>;
|
|
1454
|
+
readonly inlineThemeDisabled: {
|
|
1455
|
+
readonly type: BooleanConstructor;
|
|
1456
|
+
readonly default: undefined;
|
|
1457
|
+
};
|
|
1458
|
+
readonly as: {
|
|
1459
|
+
readonly type: PropType<string | undefined>;
|
|
1460
|
+
readonly validator: () => boolean;
|
|
1461
|
+
readonly default: undefined;
|
|
1462
|
+
};
|
|
1463
|
+
}>>>, "theme">> & Readonly<{
|
|
1464
|
+
onSubmit?: ((formData: {
|
|
1465
|
+
[x: string]: unknown;
|
|
1466
|
+
}, id: string | undefined, version: number | undefined) => any) | undefined;
|
|
1467
|
+
"onUpdate:modelValue"?: ((value: {
|
|
1468
|
+
[x: string]: unknown;
|
|
1469
|
+
}) => any) | undefined;
|
|
1470
|
+
}>, "submit" | "reset" | "loading" | "validate" | ("actions" | "formClass" | "dataStructure" | "actionsJustify" | "interactiveContainers")> & {
|
|
1471
|
+
submit: () => void | undefined;
|
|
1472
|
+
reset: () => void | undefined;
|
|
1473
|
+
validate: () => Promise<boolean>;
|
|
1474
|
+
loading: boolean;
|
|
1475
|
+
} & {} & ComponentCustomProperties & {} & {
|
|
1476
|
+
$slots: Readonly<{
|
|
1477
|
+
actions?: (props: FormActionsScope) => unknown;
|
|
1478
|
+
}> & {
|
|
1479
|
+
actions?: (props: FormActionsScope) => unknown;
|
|
1480
|
+
};
|
|
1481
|
+
}) | null;
|
|
1482
|
+
}, any>;
|
|
1483
|
+
|
|
568
1484
|
declare interface FormDefinitionState {
|
|
569
1485
|
formDefinition: Ref<FormDefinition>;
|
|
570
1486
|
formSchema: ComputedRef<FormKitSchemaFormKit[]>;
|
|
571
|
-
commitSchemaChildren: (children: FormKitSchemaFormKit[], source?: Pick<FormDefinition,
|
|
1487
|
+
commitSchemaChildren: (children: FormKitSchemaFormKit[], source?: Pick<FormDefinition, 'name' | 'settings'>) => FormDefinition;
|
|
572
1488
|
}
|
|
573
1489
|
|
|
574
1490
|
declare type FormEvent = FormKitEvent | ElEvent;
|
|
@@ -591,9 +1507,9 @@ declare type FormKitTypedProps = {
|
|
|
591
1507
|
name?: string;
|
|
592
1508
|
actions?: boolean;
|
|
593
1509
|
formClass?: string;
|
|
594
|
-
modelValue?:
|
|
595
|
-
'onUpdate:modelValue'?: (value:
|
|
596
|
-
onSubmit?: (formData:
|
|
1510
|
+
modelValue?: ModelValue_3;
|
|
1511
|
+
'onUpdate:modelValue'?: (value: ModelValue_3) => void;
|
|
1512
|
+
onSubmit?: (formData: ModelValue_3) => void;
|
|
597
1513
|
};
|
|
598
1514
|
|
|
599
1515
|
export declare type FormNode = FieldNode | ContainerNode | LayoutNode | StaticNode;
|
|
@@ -630,12 +1546,14 @@ export declare interface LayoutNode extends BaseNode {
|
|
|
630
1546
|
|
|
631
1547
|
declare type LayoutRenderer<T> = (node: LayoutNode, ctx: RenderContext<T>, children?: T[]) => T;
|
|
632
1548
|
|
|
633
|
-
export declare type LayoutType = 'grid' | 'row' | 'column' | 'card' | 'tabs' | 'tabsPane';
|
|
1549
|
+
export declare type LayoutType = 'grid' | 'row' | 'column' | 'card' | 'tabs' | 'tabsPane' | 'steps' | 'stepsPane';
|
|
634
1550
|
|
|
635
1551
|
declare type ModelValue = Record<string, unknown>;
|
|
636
1552
|
|
|
637
1553
|
declare type ModelValue_2 = Record<string, unknown>;
|
|
638
1554
|
|
|
1555
|
+
declare type ModelValue_3 = Record<string, unknown>;
|
|
1556
|
+
|
|
639
1557
|
export declare type NodeCategory = 'field' | 'container' | 'layout' | 'static';
|
|
640
1558
|
|
|
641
1559
|
declare interface NodeLayout {
|
|
@@ -743,6 +1661,12 @@ declare interface SelectionState {
|
|
|
743
1661
|
selectedIndex: Ref<number>;
|
|
744
1662
|
selectedKey: Ref<string | null>;
|
|
745
1663
|
selectedTarget: Ref<'field' | 'form'>;
|
|
1664
|
+
/** 数据表格选中列下标(null = 未选中列;配合 selectedKey 定位所属数据表格节点) */
|
|
1665
|
+
selectedColumnIndex: Ref<number | null>;
|
|
1666
|
+
/** 元素属性编辑目标覆盖:列元素等非树节点复用标准字段编辑器时指向的工作节点 */
|
|
1667
|
+
elementEditTarget: Ref<FormNode | null>;
|
|
1668
|
+
/** 元素属性写回回调:工作节点变更后把结果落回(如 columns[i].element) */
|
|
1669
|
+
elementEditCommit: Ref<((node: FormNode) => void) | null>;
|
|
746
1670
|
}
|
|
747
1671
|
|
|
748
1672
|
export declare function setGlobalFormBuilderConfig(config?: FormBuilderConfig): void;
|