@zeng-alt/formkit-form-builder 1.2.0 → 1.4.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/dist/index.d.ts CHANGED
@@ -68,6 +68,7 @@ declare const __VLS_component_3: DefineComponent<__VLS_Props_5, {
68
68
  onSubmit?: ((formData: ModelValue_3, id: string | undefined, version: number | undefined) => any) | undefined;
69
69
  "onUpdate:modelValue"?: ((value: ModelValue_3) => any) | undefined;
70
70
  }>, {
71
+ disabled: boolean;
71
72
  actions: boolean;
72
73
  formClass: string;
73
74
  dataStructure: "flat" | "nested";
@@ -122,6 +123,7 @@ declare type __VLS_Props_3 = {
122
123
  formClass?: string;
123
124
  interactiveContainers?: boolean;
124
125
  resetOnSubmit?: boolean;
126
+ disabled?: boolean;
125
127
  };
126
128
 
127
129
  declare type __VLS_Props_4 = {
@@ -142,6 +144,7 @@ declare type __VLS_Props_4 = {
142
144
  /** 右侧数据面板宽度 */
143
145
  dataPanelWidth?: string;
144
146
  resetOnSubmit?: boolean;
147
+ disabled?: boolean;
145
148
  };
146
149
 
147
150
  declare type __VLS_Props_5 = {
@@ -176,6 +179,8 @@ declare type __VLS_Props_5 = {
176
179
  theme?: BuilderTheme;
177
180
  /** 自定义 HTTP 请求库实例:供 JS 绑定代码里的 axios 变量使用;缺省使用内置 axios */
178
181
  http?: AxiosInstance;
182
+ /** 禁用整个表单(所有输入 + 操作区按钮);缺省 false */
183
+ disabled?: boolean;
179
184
  } & Omit<Partial<ConfigProviderProps>, 'theme'>;
180
185
 
181
186
  declare function __VLS_template(): {
@@ -285,9 +290,7 @@ declare interface BaseNode {
285
290
  props?: Record<string, unknown>;
286
291
  /** 条件显示:布尔表达式 AST */
287
292
  visibleIf?: Expr;
288
- /** 布局信息(colspan / rowspan) */
289
- layout?: NodeLayout;
290
- /** 原始 outerClass(含 pt-2 等附加类;与 layout 同时保留保证往返无损) */
293
+ /** 原始 outerClass(col-span-N / row-span-N 与任意附加类,宽度唯一来源) */
291
294
  outerClass?: string;
292
295
  events?: EventBinding[];
293
296
  /** 任意业务元数据,Java 原样透传 */
@@ -307,6 +310,7 @@ submit: (formData: ModelValue, id: string | undefined, version: number | undefin
307
310
  onSubmit?: ((formData: ModelValue, id: string | undefined, version: number | undefined) => any) | undefined;
308
311
  "onUpdate:show"?: ((value: boolean) => any) | undefined;
309
312
  }>, {
313
+ disabled: boolean;
310
314
  actions: boolean;
311
315
  formClass: string;
312
316
  interactiveContainers: boolean;
@@ -338,6 +342,7 @@ readonly interactiveContainers?: boolean | undefined;
338
342
  readonly config?: FormBuilderConfig | undefined;
339
343
  readonly theme?: BuilderTheme | undefined;
340
344
  readonly http?: AxiosInstance | undefined;
345
+ readonly disabled?: boolean | undefined;
341
346
  readonly themeOverrides?: GlobalThemeOverrides | null | undefined;
342
347
  readonly tag?: string | undefined;
343
348
  readonly bordered?: boolean | undefined;
@@ -500,6 +505,7 @@ type?: string;
500
505
  name?: string;
501
506
  actions?: boolean;
502
507
  formClass?: string;
508
+ disabled?: boolean;
503
509
  modelValue?: {
504
510
  [x: string]: unknown;
505
511
  };
@@ -521,6 +527,7 @@ type?: string;
521
527
  name?: string;
522
528
  actions?: boolean;
523
529
  formClass?: string;
530
+ disabled?: boolean;
524
531
  modelValue?: {
525
532
  [x: string]: unknown;
526
533
  };
@@ -566,6 +573,7 @@ interactiveContainers?: boolean;
566
573
  config?: FormBuilderConfig;
567
574
  theme?: BuilderTheme;
568
575
  http?: AxiosInstance;
576
+ disabled?: boolean;
569
577
  } & Omit<Partial<Partial<ExtractPropTypes< {
570
578
  readonly abstract: BooleanConstructor;
571
579
  readonly bordered: {
@@ -619,6 +627,7 @@ submit: (formData: {
619
627
  [x: string]: unknown;
620
628
  }) => any;
621
629
  }, string, {
630
+ disabled: boolean;
622
631
  actions: boolean;
623
632
  formClass: string;
624
633
  dataStructure: "flat" | "nested";
@@ -645,6 +654,7 @@ $forceUpdate: () => void;
645
654
  $nextTick: typeof nextTick;
646
655
  $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
656
  } & Readonly<{
657
+ disabled: boolean;
648
658
  actions: boolean;
649
659
  formClass: string;
650
660
  dataStructure: "flat" | "nested";
@@ -672,6 +682,7 @@ interactiveContainers?: boolean;
672
682
  config?: FormBuilderConfig;
673
683
  theme?: BuilderTheme;
674
684
  http?: AxiosInstance;
685
+ disabled?: boolean;
675
686
  } & Omit<Partial<Partial<ExtractPropTypes< {
676
687
  readonly abstract: BooleanConstructor;
677
688
  readonly bordered: {
@@ -712,7 +723,7 @@ onSubmit?: ((formData: {
712
723
  "onUpdate:modelValue"?: ((value: {
713
724
  [x: string]: unknown;
714
725
  }) => any) | undefined;
715
- }>, "submit" | "reset" | "loading" | "validate" | ("actions" | "formClass" | "dataStructure" | "actionsJustify" | "interactiveContainers")> & {
726
+ }>, "submit" | "reset" | "loading" | "validate" | ("disabled" | "actions" | "formClass" | "dataStructure" | "actionsJustify" | "interactiveContainers")> & {
716
727
  submit: () => void | undefined;
717
728
  reset: () => void | undefined;
718
729
  validate: () => Promise<boolean>;
@@ -983,6 +994,7 @@ declare type FormActionsScope = {
983
994
  submit: () => void;
984
995
  reset: () => void;
985
996
  loading: boolean;
997
+ disabled: boolean;
986
998
  };
987
999
 
988
1000
  export declare interface FormBuilderConfig {
@@ -1059,6 +1071,7 @@ submit: (formData: ModelValue_2, id: string | undefined, version: number | undef
1059
1071
  onSubmit?: ((formData: ModelValue_2, id: string | undefined, version: number | undefined) => any) | undefined;
1060
1072
  "onUpdate:show"?: ((value: boolean) => any) | undefined;
1061
1073
  }>, {
1074
+ disabled: boolean;
1062
1075
  title: string;
1063
1076
  actions: boolean;
1064
1077
  formClass: string;
@@ -1093,6 +1106,7 @@ readonly interactiveContainers?: boolean | undefined;
1093
1106
  readonly config?: FormBuilderConfig | undefined;
1094
1107
  readonly theme?: BuilderTheme | undefined;
1095
1108
  readonly http?: AxiosInstance | undefined;
1109
+ readonly disabled?: boolean | undefined;
1096
1110
  readonly themeOverrides?: GlobalThemeOverrides | null | undefined;
1097
1111
  readonly tag?: string | undefined;
1098
1112
  readonly bordered?: boolean | undefined;
@@ -1255,6 +1269,7 @@ type?: string;
1255
1269
  name?: string;
1256
1270
  actions?: boolean;
1257
1271
  formClass?: string;
1272
+ disabled?: boolean;
1258
1273
  modelValue?: {
1259
1274
  [x: string]: unknown;
1260
1275
  };
@@ -1276,6 +1291,7 @@ type?: string;
1276
1291
  name?: string;
1277
1292
  actions?: boolean;
1278
1293
  formClass?: string;
1294
+ disabled?: boolean;
1279
1295
  modelValue?: {
1280
1296
  [x: string]: unknown;
1281
1297
  };
@@ -1321,6 +1337,7 @@ interactiveContainers?: boolean;
1321
1337
  config?: FormBuilderConfig;
1322
1338
  theme?: BuilderTheme;
1323
1339
  http?: AxiosInstance;
1340
+ disabled?: boolean;
1324
1341
  } & Omit<Partial<Partial<ExtractPropTypes< {
1325
1342
  readonly abstract: BooleanConstructor;
1326
1343
  readonly bordered: {
@@ -1374,6 +1391,7 @@ submit: (formData: {
1374
1391
  [x: string]: unknown;
1375
1392
  }) => any;
1376
1393
  }, string, {
1394
+ disabled: boolean;
1377
1395
  actions: boolean;
1378
1396
  formClass: string;
1379
1397
  dataStructure: "flat" | "nested";
@@ -1400,6 +1418,7 @@ $forceUpdate: () => void;
1400
1418
  $nextTick: typeof nextTick;
1401
1419
  $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
1420
  } & Readonly<{
1421
+ disabled: boolean;
1403
1422
  actions: boolean;
1404
1423
  formClass: string;
1405
1424
  dataStructure: "flat" | "nested";
@@ -1427,6 +1446,7 @@ interactiveContainers?: boolean;
1427
1446
  config?: FormBuilderConfig;
1428
1447
  theme?: BuilderTheme;
1429
1448
  http?: AxiosInstance;
1449
+ disabled?: boolean;
1430
1450
  } & Omit<Partial<Partial<ExtractPropTypes< {
1431
1451
  readonly abstract: BooleanConstructor;
1432
1452
  readonly bordered: {
@@ -1467,7 +1487,7 @@ onSubmit?: ((formData: {
1467
1487
  "onUpdate:modelValue"?: ((value: {
1468
1488
  [x: string]: unknown;
1469
1489
  }) => any) | undefined;
1470
- }>, "submit" | "reset" | "loading" | "validate" | ("actions" | "formClass" | "dataStructure" | "actionsJustify" | "interactiveContainers")> & {
1490
+ }>, "submit" | "reset" | "loading" | "validate" | ("disabled" | "actions" | "formClass" | "dataStructure" | "actionsJustify" | "interactiveContainers")> & {
1471
1491
  submit: () => void | undefined;
1472
1492
  reset: () => void | undefined;
1473
1493
  validate: () => Promise<boolean>;
@@ -1507,6 +1527,7 @@ declare type FormKitTypedProps = {
1507
1527
  name?: string;
1508
1528
  actions?: boolean;
1509
1529
  formClass?: string;
1530
+ disabled?: boolean;
1510
1531
  modelValue?: ModelValue_3;
1511
1532
  'onUpdate:modelValue'?: (value: ModelValue_3) => void;
1512
1533
  onSubmit?: (formData: ModelValue_3) => void;
@@ -1556,22 +1577,6 @@ declare type ModelValue_3 = Record<string, unknown>;
1556
1577
 
1557
1578
  export declare type NodeCategory = 'field' | 'container' | 'layout' | 'static';
1558
1579
 
1559
- declare interface NodeLayout {
1560
- /** 栅格占位(基于 settings.columns,默认 12) */
1561
- colspan?: number;
1562
- rowspan?: number;
1563
- /** 显式宽度(px / 百分比),grid 模式下忽略 */
1564
- width?: number | string;
1565
- order?: number;
1566
- /** 响应式断点覆盖 */
1567
- responsive?: {
1568
- sm?: NodeLayout;
1569
- md?: NodeLayout;
1570
- lg?: NodeLayout;
1571
- xl?: NodeLayout;
1572
- };
1573
- }
1574
-
1575
1580
  declare interface OptionItem {
1576
1581
  label: string;
1577
1582
  value: StaticValue;
package/package.json CHANGED
@@ -1,25 +1,31 @@
1
1
  {
2
2
  "name": "@zeng-alt/formkit-form-builder",
3
- "version": "1.2.0",
3
+ "version": "1.4.0",
4
4
  "description": "A visual FormKit schema builder for Vue 3",
5
- "type": "module",
5
+ "keywords": [
6
+ "drag-and-drop",
7
+ "form-builder",
8
+ "formkit",
9
+ "schema",
10
+ "vue",
11
+ "vue3"
12
+ ],
6
13
  "license": "LGPL",
7
14
  "repository": {
8
15
  "type": "git",
9
16
  "url": "https://github.com/zeng-alt/formkit-form-builder.git"
10
17
  },
11
- "keywords": [
12
- "vue",
13
- "vue3",
14
- "formkit",
15
- "form-builder",
16
- "schema",
17
- "drag-and-drop"
18
+ "style": "./dist/builder.css",
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "type": "module",
23
+ "sideEffects": [
24
+ "**/*.css"
18
25
  ],
19
26
  "main": "./dist/builder.umd.js",
20
27
  "module": "./dist/builder.es.js",
21
28
  "types": "./dist/index.d.ts",
22
- "style": "./dist/builder.css",
23
29
  "exports": {
24
30
  ".": {
25
31
  "types": "./dist/index.d.ts",
@@ -31,45 +37,7 @@
31
37
  "publishConfig": {
32
38
  "access": "public"
33
39
  },
34
- "files": [
35
- "dist"
36
- ],
37
- "sideEffects": [
38
- "**/*.css"
39
- ],
40
- "scripts": {
41
- "dev": "vite",
42
- "build": "run-p type-check \"build-only {@}\" --",
43
- "preview": "vite preview",
44
- "build-only": "vite build",
45
- "type-check": "vue-tsc --build",
46
- "lint": "run-s lint:*",
47
- "lint:oxlint": "oxlint . --fix",
48
- "lint:eslint": "eslint . --fix --cache",
49
- "format": "oxfmt src/"
50
- },
51
- "peerDependencies": {
52
- "@vueuse/core": "^14.2.1",
53
- "naive-ui": "^2.44.0",
54
- "vue": "^3.5.0",
55
- "@codemirror/autocomplete": "^6.20.1",
56
- "@codemirror/commands": "^6.10.3",
57
- "@codemirror/language": "^6.9.2",
58
- "@codemirror/state": "^6.5.2",
59
- "@codemirror/view": "^6.38.2",
60
- "@codemirror/lang-javascript": "^6.2.4",
61
- "@codemirror/theme-one-dark": "^6.1.3",
62
- "@codemirror/lint": "^6.8.5"
63
- },
64
40
  "dependencies": {
65
- "@codemirror/autocomplete": "^6.20.1",
66
- "@codemirror/commands": "^6.10.3",
67
- "@codemirror/language": "^6.9.2",
68
- "@codemirror/state": "^6.5.2",
69
- "@codemirror/view": "^6.38.2",
70
- "@codemirror/lang-javascript": "^6.2.4",
71
- "@codemirror/theme-one-dark": "^6.1.3",
72
- "@codemirror/lint": "^6.8.5",
73
41
  "@formkit/core": "^2.0.0",
74
42
  "@formkit/drag-and-drop": "^0.5.0",
75
43
  "@formkit/i18n": "^2.0.0",
@@ -81,6 +49,14 @@
81
49
  "vue-sonner": "^2.0.9"
82
50
  },
83
51
  "devDependencies": {
52
+ "@codemirror/autocomplete": "^6.20.1",
53
+ "@codemirror/commands": "^6.10.3",
54
+ "@codemirror/lang-javascript": "^6.2.4",
55
+ "@codemirror/language": "^6.9.2",
56
+ "@codemirror/lint": "^6.8.5",
57
+ "@codemirror/state": "^6.5.2",
58
+ "@codemirror/theme-one-dark": "^6.1.3",
59
+ "@codemirror/view": "^6.38.2",
84
60
  "@formkit/core": "^2.0.0",
85
61
  "@formkit/drag-and-drop": "^0.5.3",
86
62
  "@formkit/vue": "^2.0.0",
@@ -89,6 +65,9 @@
89
65
  "@iconify/utils": "^3.1.0",
90
66
  "@tsconfig/node24": "^24.0.4",
91
67
  "@types/node": "^24.12.0",
68
+ "@unocss/eslint-config": "^66.7.0",
69
+ "@unocss/eslint-plugin": "^66.7.0",
70
+ "@unocss/preset-rem-to-px": "^66.7.0",
92
71
  "@vitejs/plugin-vue": "^6.0.5",
93
72
  "@vitejs/plugin-vue-jsx": "^5.1.5",
94
73
  "@vue/eslint-config-typescript": "^14.7.0",
@@ -108,9 +87,6 @@
108
87
  "tsx": "^4.21.0",
109
88
  "typescript": "~6.0.0",
110
89
  "unocss": "^66.7.0",
111
- "@unocss/preset-rem-to-px": "^66.7.0",
112
- "@unocss/eslint-config": "^66.7.0",
113
- "@unocss/eslint-plugin": "^66.7.0",
114
90
  "unplugin-auto-import": "^21.1.0",
115
91
  "unplugin-vue-components": "^32.1.0",
116
92
  "vite": "^8.0.3",
@@ -119,7 +95,31 @@
119
95
  "vue": "^3.5.31",
120
96
  "vue-tsc": "^3.2.6"
121
97
  },
98
+ "peerDependencies": {
99
+ "@codemirror/autocomplete": "^6.20.1",
100
+ "@codemirror/commands": "^6.10.3",
101
+ "@codemirror/lang-javascript": "^6.2.4",
102
+ "@codemirror/language": "^6.9.2",
103
+ "@codemirror/lint": "^6.8.5",
104
+ "@codemirror/state": "^6.5.2",
105
+ "@codemirror/theme-one-dark": "^6.1.3",
106
+ "@codemirror/view": "^6.38.2",
107
+ "@vueuse/core": "^14.2.1",
108
+ "naive-ui": "^2.44.0",
109
+ "vue": "^3.5.0"
110
+ },
122
111
  "engines": {
123
112
  "node": "^20.19.0 || >=22.12.0"
113
+ },
114
+ "scripts": {
115
+ "dev": "vite",
116
+ "build": "run-p type-check \"build-only {@}\" --",
117
+ "preview": "vite preview",
118
+ "build-only": "vite build",
119
+ "type-check": "vue-tsc --build",
120
+ "lint": "run-s lint:*",
121
+ "lint:oxlint": "oxlint . --fix",
122
+ "lint:eslint": "eslint . --fix --cache",
123
+ "format": "oxfmt src/"
124
124
  }
125
- }
125
+ }