inquirer-form 0.2.1 → 0.3.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 CHANGED
@@ -28,6 +28,8 @@ This package requires `agilebuilder-form` as a core dependency:
28
28
  npm install agilebuilder-form
29
29
  ```
30
30
 
31
+ > **Note**: `vue-i18n` is bundled within this package, so you don't need to install it separately.
32
+
31
33
  ### Peer Dependencies
32
34
 
33
35
  Make sure to install the following peer dependencies:
@@ -70,7 +72,19 @@ import 'element-plus/dist/index.css'
70
72
 
71
73
  ## Quick Start
72
74
 
73
- ### 1. Register Controls
75
+ ### 1. Install Plugin (Optional)
76
+
77
+ If you're using the default export, i18n will be automatically installed:
78
+
79
+ ```typescript
80
+ import InquirerForm from 'inquirer-form'
81
+ import { createApp } from 'vue'
82
+
83
+ const app = createApp(App)
84
+ app.use(InquirerForm) // Automatically installs i18n and registers components
85
+ ```
86
+
87
+ Or register controls manually:
74
88
 
75
89
  ```typescript
76
90
  import { registerInquirerControls } from 'inquirer-form'
package/README.zh-CN.md CHANGED
@@ -28,6 +28,8 @@ npm install inquirer-form
28
28
  npm install agilebuilder-form
29
29
  ```
30
30
 
31
+ > **注意**:`vue-i18n` 已内置在本包中,无需单独安装。
32
+
31
33
  ### Peer Dependencies
32
34
 
33
35
  确保安装以下对等依赖:
@@ -70,7 +72,19 @@ import 'element-plus/dist/index.css'
70
72
 
71
73
  ## 🚀 快速开始
72
74
 
73
- ### 1. 注册控件
75
+ ### 1. 安装插件(可选)
76
+
77
+ 如果使用默认导出,i18n 将自动安装:
78
+
79
+ ```typescript
80
+ import InquirerForm from 'inquirer-form'
81
+ import { createApp } from 'vue'
82
+
83
+ const app = createApp(App)
84
+ app.use(InquirerForm) // 自动安装 i18n 并注册组件
85
+ ```
86
+
87
+ 或手动注册控件:
74
88
 
75
89
  ```typescript
76
90
  import { registerInquirerControls } from 'inquirer-form'
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { ControlMeta } from 'agilebuilder-form';
5
5
  import { DefineComponent } from 'vue';
6
6
  import { FormData as FormData_2 } from 'agilebuilder-form';
7
7
  import { FormSchema } from 'agilebuilder-form';
8
+ import { I18n } from 'vue-i18n';
8
9
  import { PublicProps } from 'vue';
9
10
  import { SchemaEngine } from 'agilebuilder-form';
10
11
  import { SchemaNode } from 'agilebuilder-form';
@@ -20,7 +21,11 @@ declare type __VLS_Props_2 = {
20
21
  modelValue?: FormData_2;
21
22
  };
22
23
 
23
- export declare function createInquirerSampleControls(t: (key: string) => string): SchemaNode[];
24
+ /**
25
+ * 创建示例表单控件
26
+ * @param t 可选的翻译函数,如果不提供则使用内置的 i18n
27
+ */
28
+ export declare function createInquirerSampleControls(t?: (key: string) => string): SchemaNode[];
24
29
 
25
30
  declare const _default: {
26
31
  install(app: App): void;
@@ -43,6 +48,10 @@ seedSample: boolean;
43
48
  autoRegisterControls: boolean;
44
49
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
45
50
 
51
+ export declare const inquirerFormI18n: I18n;
52
+
53
+ export declare const inquirerFormI18nPlugin: I18n<{}, {}, {}, string, boolean>;
54
+
46
55
  export declare const InquirerFormPlayground: DefineComponent< {}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, HTMLDivElement>;
47
56
 
48
57
  export declare const InquirerFormRuntime: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {