@daxiangme/form-vue 0.1.3 → 0.1.5

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
@@ -20,7 +20,14 @@ pnpm add @daxiangme/form-vue
20
20
  pnpm add @daxiangme/form-vue vue element-plus
21
21
  ```
22
22
 
23
- 按以下顺序引入样式:
23
+ 按需宿主(`unplugin-vue-components` 等)只需引入包自身样式。入口会副作用导入所用 Element Plus 组件的 `style/css`,宿主已有的 `--el-*` 变量和全局 `.el-*` 补丁会作用在设计器上,**不必**全量 `element-plus/dist/index.css`,也**不必** `app.use(ElementPlus)`:
24
+
25
+ ```ts
26
+ import '@daxiangme/form-vue/style.css'
27
+ import { FormDesigner, FormRenderer } from '@daxiangme/form-vue'
28
+ ```
29
+
30
+ 已经全量引入 Element Plus 样式的工程仍然兼容,可继续:
24
31
 
25
32
  ```ts
26
33
  import 'element-plus/dist/index.css'
@@ -30,7 +37,7 @@ import '@daxiangme/form-vue/style.css'
30
37
 
31
38
  ## 注册组件
32
39
 
33
- 库构建已把 Element Plus 控件编译为 `import { ElButton } from 'element-plus'`。按需宿主(`unplugin-vue-components` 等)**不必** `app.use(ElementPlus)`;引入 Vue 3、Element Plus peer 与样式后直接导入两个公共组件即可:
40
+ 库构建会为模板用到的 Element Plus 控件注入对应 `style/css` 副作用导入。按需宿主直接导入两个公共组件即可:
34
41
 
35
42
  ```ts
36
43
  import { createApp } from 'vue'
@@ -126,6 +133,8 @@ function handleSubmit(projection: DesignerSubmissionProjection) {
126
133
 
127
134
  弹窗和抽屉在运行态使用真实 Element Plus 外壳。组件默认消费 Element Plus CSS Variables,深色模式直接跟随宿主的 `html.dark`。
128
135
 
136
+ 新建文档默认标签位于顶部且左对齐。圆角取值是 `THEME` 或 0~32 的 4 的倍数像素:`THEME` 跟随宿主 `--el-border-radius-base`;旧档位 `NONE` / `SMALL` / `BASE` / `LARGE` 解码为 0 / 4 / 8 / 12。自定义像素会写入 `--daxiang-form-container-radius` 等变量,而不是空的档位 class。
137
+
129
138
  ![表单运行预览](https://raw.githubusercontent.com/daxiangme/form-builder/v0.1.1/docs/assets/screenshots/runtime-preview.png)
130
139
 
131
140
  ![Element Plus 深色主题](https://raw.githubusercontent.com/daxiangme/form-builder/v0.1.1/docs/assets/screenshots/dark-theme.png)
package/dist/index.d.ts CHANGED
@@ -18,6 +18,7 @@ import { DesignerFieldId } from '@daxiangme/form-core';
18
18
  import { DesignerInitialDataModel } from '@daxiangme/form-core';
19
19
  import { DesignerLayoutNode } from '@daxiangme/form-core';
20
20
  import { DesignerOverlayModule } from '@daxiangme/form-core';
21
+ import { DesignerRadiusValue } from '@daxiangme/form-core';
21
22
  import { DesignerRuntimeAdapters } from '@daxiangme/form-core';
22
23
  import { DesignerRuntimeMode } from '@daxiangme/form-core';
23
24
  import { DesignerRuntimeValueStore } from '@daxiangme/form-core';
@@ -151,6 +152,7 @@ onClosed?: (() => any) | undefined;
151
152
  }>, {
152
153
  title: string;
153
154
  dialogClass: string;
155
+ radius: DesignerRadiusValue;
154
156
  width: string | number;
155
157
  maxHeight: string | number;
156
158
  loading: boolean;
@@ -205,6 +207,8 @@ declare type __VLS_Props_4 = {
205
207
  modelValue: boolean;
206
208
  title?: string;
207
209
  dialogClass?: string;
210
+ /** 弹窗外壳圆角;`THEME` 跟随宿主 `--el-border-radius-base`。 */
211
+ radius?: DesignerRadiusValue;
208
212
  width?: string | number;
209
213
  maxHeight?: string | number;
210
214
  loading?: boolean;
@@ -405,16 +409,16 @@ export declare const FormModalShell: __VLS_WithTemplateSlots_2<typeof __VLS_comp
405
409
 
406
410
  export declare const FormRenderer: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
407
411
  "update:modelValue": (value: DesignerRuntimeValueStore) => any;
408
- submit: (projection: DesignerSubmissionProjection) => any;
409
412
  reset: (value: DesignerRuntimeValueStore) => any;
413
+ submit: (projection: DesignerSubmissionProjection) => any;
410
414
  "runtime-warning": (message: string) => any;
411
415
  action: (action: "SUBMIT" | "RESET" | "PRINT") => any;
412
416
  "overlay-closed": () => any;
413
417
  "overlay-open-failed": (message: string) => any;
414
418
  }, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
415
419
  "onUpdate:modelValue"?: ((value: DesignerRuntimeValueStore) => any) | undefined;
416
- onSubmit?: ((projection: DesignerSubmissionProjection) => any) | undefined;
417
420
  onReset?: ((value: DesignerRuntimeValueStore) => any) | undefined;
421
+ onSubmit?: ((projection: DesignerSubmissionProjection) => any) | undefined;
418
422
  "onRuntime-warning"?: ((message: string) => any) | undefined;
419
423
  onAction?: ((action: "SUBMIT" | "RESET" | "PRINT") => any) | undefined;
420
424
  "onOverlay-closed"?: (() => any) | undefined;