vue-form-craft 4.6.1 → 4.6.2

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.
Files changed (26) hide show
  1. package/README.md +133 -0
  2. package/dist/lazy/{Card-C6gLACpI.js → Card-B8pKJPp_.js} +1 -1
  3. package/dist/lazy/{Cascader-C2vOBOMv.js → Cascader-Bj1MKP1h.js} +1 -1
  4. package/dist/lazy/{Checkbox-CqOoyq-D.js → Checkbox-C7cedqdm.js} +2 -2
  5. package/dist/lazy/{Collapse-Dz3-Lvqv.js → Collapse-B9aQfM0l.js} +1 -1
  6. package/dist/lazy/{Component-Dm720wpV.js → Component-90FKsVnF.js} +1 -1
  7. package/dist/lazy/{Component-B2ZMJVm4.js → Component-Bf-0vp25.js} +1 -1
  8. package/dist/lazy/{Component-DEc_14oo.js → Component-CYzr90VJ.js} +1 -1
  9. package/dist/lazy/{Component-AnQII5TC.js → Component-DBxHG6gd.js} +1 -1
  10. package/dist/lazy/{Component-CM8POmAY.js → Component-XLW-HW-w.js} +1 -1
  11. package/dist/lazy/{Custom-y4v7mrhd.js → Custom-DvBd4WJt.js} +1 -1
  12. package/dist/lazy/{FormList-BfvZLuTx.js → FormList-BU-Rshq5.js} +1 -1
  13. package/dist/lazy/{Grid-C9qf54R2.js → Grid-CCWNeHmC.js} +1 -1
  14. package/dist/lazy/{Inline-C48fwfZr.js → Inline-DjvYKa4Y.js} +1 -1
  15. package/dist/lazy/{JsonEdit-CgGJ7-zD.js → JsonEdit-DWa8IstP.js} +1 -1
  16. package/dist/lazy/{ObjGroup-BqSJ2vRP.js → ObjGroup-DXu3Ka-M.js} +1 -1
  17. package/dist/lazy/{Radio-bfCnRycA.js → Radio-DLWdhD-s.js} +2 -2
  18. package/dist/lazy/{Select-BDzuXjsw.js → Select-DyYeWnkW.js} +2 -2
  19. package/dist/lazy/{Tabs-DcIncTHH.js → Tabs-BxZUuNSL.js} +1 -1
  20. package/dist/lazy/{TextArea-CxzUeZFN.js → TextArea-6_Jr6BtE.js} +1 -1
  21. package/dist/lazy/{index-BFu1nOLd.js → index-EwHmlOuJ.js} +1428 -1394
  22. package/dist/lazy/{useSelect-CFkzMGeV.js → useSelect-B9KCdR90.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/vue-form-craft.js +1 -1
  25. package/dist/vue-form-craft.umd.cjs +23 -23
  26. package/package.json +36 -35
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # vue-form-craft
2
+
3
+ 基于 [vue](https://github.com/vuejs/vue) 和 [element-plus](https://github.com/ElemeFE/element) 实现的表单设计器 + 渲染器
4
+
5
+ 使用了最新的前端技术栈,可以让你免去vue项目中表单的烦恼。
6
+
7
+ - [在线预览](https://xinnian999.github.io/vue-form-craft/zh/form-design)
8
+ - [官方文档](https://xinnian999.github.io/vue-form-craft/zh/)
9
+ - 作者:Elin
10
+ - 联系方式:17803000829
11
+
12
+ ![ui](../../ui.png)
13
+
14
+ ## 特性
15
+
16
+ - 可视化设计表单
17
+ - 支持三十多种的表单组件(el所有表单组件、内置组件)
18
+ - 支持收集Array数据(自增组件)
19
+ - 用法简单,又非常灵活高效的表单联动
20
+ - 可预览生成的json配置
21
+ - 可预览生成的VUE组件
22
+ - 高扩展性、支持自定义组件、支持各种ui组件库来替换ui
23
+ - 支持表单填写校验
24
+ - 组件无限深层嵌套,深层校验
25
+
26
+ ## 第三方插件
27
+
28
+ - vuedraggable
29
+ - element-plus
30
+ - vue-form-craft
31
+ - lodash
32
+
33
+ ## 使用
34
+
35
+ ### 版本要求
36
+
37
+ vue@3.x
38
+
39
+ ### 安装
40
+
41
+ ```js
42
+ npm i vue-form-craft
43
+ //或
44
+ yarn add vue-form-craft
45
+ //或
46
+ pnpm i vue-form-craft
47
+ ```
48
+
49
+ ### 全局注册
50
+
51
+ ```js
52
+ import { createApp } from 'vue'
53
+ import VueFormCraft from 'vue-form-craft'
54
+ import ElementPlus from 'element-plus'
55
+ import 'element-plus/dist/index.css'
56
+ import App from './App.vue'
57
+
58
+ const app = createApp(App)
59
+
60
+ app.use(ElementPlus)
61
+ app.use(VueFormCraft)
62
+ app.mount('#app')
63
+ ```
64
+
65
+ ### 使用
66
+
67
+ > 使用表单设计器
68
+
69
+ ```vue
70
+ <template>
71
+ <div style="width:100vw;height:100vh">
72
+ <FormDesign />
73
+ </div>
74
+ </template>
75
+ ```
76
+
77
+ > 使用表单渲染器
78
+
79
+ ```vue
80
+ <template>
81
+ <FormRender v-model="formValues" :schema="schema" ref="formRef" />
82
+ <el-button @click="handleSubmit">提交</el-button>
83
+ </template>
84
+
85
+ <script setup lang="ts">
86
+ import { ref } from 'vue'
87
+ import type { FormSchema,FormInstance } from 'vue-form-craft'
88
+
89
+ const formRef = ref<FormInstance>()
90
+
91
+ const formValues = ref({})
92
+
93
+ const schema: FormSchema = {
94
+ labelWidth: 150,
95
+ labelAlign: 'right',
96
+ size: 'default',
97
+ items: [
98
+ {
99
+ label: '用户名',
100
+ component: 'Input',
101
+ name: 'username',
102
+ required: true,
103
+ props: {
104
+ placeholder: '请输入用户名'
105
+ }
106
+ },
107
+ {
108
+ label: '密码',
109
+ component: 'Password',
110
+ name: 'password',
111
+ required: true,
112
+ props: {
113
+ placeholder: '请输入密码'
114
+ }
115
+ }
116
+ ]
117
+ }
118
+
119
+ const handleSubmit = async () => {
120
+ await formRef.value?.validate()
121
+ alert(JSON.stringify(formValues.value,null,2))
122
+ }
123
+ </script>
124
+ ```
125
+
126
+ ## 捐赠 vue-form-craft 的开发
127
+
128
+ `vue-form-craft` 的文档和代码完全开源,如果该项目有帮助到你的开发工作,你可以捐赠`vue-form-craft`的研发工作,捐赠无门槛,哪怕是一杯可乐也好。
129
+
130
+ <div style="display:flex;gap:15px">
131
+ <img src="./docs/assets/wechat.png" style="height:400px" />
132
+ <img src="./docs/assets/zhifubao.png" style="height:400px" />
133
+ </div>
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as o, resolveComponent as t, openBlock as n, createBlock as a, normalizeProps as p, guardReactiveProps as s, withCtx as l, createVNode as c, unref as i } from "vue";
2
- import { _ as m } from "./index-BFu1nOLd.js";
2
+ import { _ as m } from "./index-EwHmlOuJ.js";
3
3
  import "element-plus";
4
4
  const h = /* @__PURE__ */ o({
5
5
  __name: "Card",
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as m, mergeModels as i, useModel as c, resolveComponent as f, openBlock as g, createBlock as v, mergeProps as y, unref as l } from "vue";
2
2
  import "element-plus";
3
- import { u as C } from "./useSelect-CFkzMGeV.js";
3
+ import { u as C } from "./useSelect-B9KCdR90.js";
4
4
  const B = /* @__PURE__ */ m({
5
5
  __name: "Cascader",
6
6
  props: /* @__PURE__ */ i({
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as w, mergeModels as B, useModel as D, watch as M, resolveComponent as u, resolveDirective as F, unref as a, openBlock as l, createElementBlock as t, toDisplayString as I, Fragment as d, createCommentVNode as i, withDirectives as S, createBlock as s, mergeProps as j, withCtx as f, renderList as k } from "vue";
2
2
  import "element-plus";
3
- import { u as E } from "./index-BFu1nOLd.js";
4
- import { u as L } from "./useSelect-CFkzMGeV.js";
3
+ import { u as E } from "./index-EwHmlOuJ.js";
4
+ import { u as L } from "./useSelect-B9KCdR90.js";
5
5
  const N = { key: 0 }, O = {
6
6
  key: 0,
7
7
  style: { "font-size": "12px" }
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as u, ref as f, onMounted as _, watch as h, resolveComponent as c, openBlock as o, createBlock as i, mergeProps as C, withCtx as r, createElementBlock as E, Fragment as k, renderList as v, createVNode as m, unref as V } from "vue";
2
- import { _ as y } from "./index-BFu1nOLd.js";
2
+ import { _ as y } from "./index-EwHmlOuJ.js";
3
3
  import "element-plus";
4
4
  import { _ as B } from "./Title.vue_vue_type_script_setup_true_lang-Ceco_9-w.js";
5
5
  const x = /* @__PURE__ */ u({
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as a, useModel as s, resolveComponent as p, unref as d, openBlock as n, createElementBlock as i, toDisplayString as c, createBlock as _, mergeProps as f } from "vue";
2
- import { u as v } from "./index-BFu1nOLd.js";
2
+ import { u as v } from "./index-EwHmlOuJ.js";
3
3
  const V = { key: 0 }, B = /* @__PURE__ */ a({
4
4
  __name: "Component",
5
5
  props: {
@@ -2,7 +2,7 @@ var u = Object.defineProperty;
2
2
  var m = (o, e, t) => e in o ? u(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
3
  var a = (o, e, t) => m(o, typeof e != "symbol" ? e + "" : e, t);
4
4
  import { defineComponent as g, mergeModels as v, useModel as I, ref as c, onMounted as w, resolveComponent as C, openBlock as y, createElementBlock as _, createVNode as V, createElementVNode as M } from "vue";
5
- import { u as b, a as x } from "./index-BFu1nOLd.js";
5
+ import { u as b, a as x } from "./index-EwHmlOuJ.js";
6
6
  function S() {
7
7
  return "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z".split(",");
8
8
  }
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as b, mergeModels as V, useModel as B, resolveComponent as d, openBlock as l, createBlock as n, createSlots as C, withCtx as a, createElementBlock as m, Fragment as w, createVNode as E, unref as r, createElementVNode as o, createTextVNode as i, toDisplayString as p, createCommentVNode as u } from "vue";
2
2
  import { ElMessage as M, ElMessageBox as N } from "element-plus";
3
- import { e as f } from "./index-BFu1nOLd.js";
3
+ import { e as f } from "./index-EwHmlOuJ.js";
4
4
  const $ = {
5
5
  key: 0,
6
6
  style: { "min-width": "300px" }
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as $, ref as v, computed as P, watch as L, onMounted as x, onBeforeUnmount as A, openBlock as T, createElementBlock as N, mergeModels as F, useModel as J, resolveComponent as G, unref as W, createElementVNode as E, createBlock as X, withCtx as D, createTextVNode as I, createCommentVNode as Y, createVNode as R } from "vue";
2
- import { a as H, u as K, b as Q } from "./index-BFu1nOLd.js";
2
+ import { a as H, u as K, b as Q } from "./index-EwHmlOuJ.js";
3
3
  const Z = $({
4
4
  props: {
5
5
  width: {
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as d, mergeModels as m, useModel as r, resolveComponent as u, openBlock as p, createBlock as i, mergeProps as c, unref as f } from "vue";
2
- import { u as V } from "./index-BFu1nOLd.js";
2
+ import { u as V } from "./index-EwHmlOuJ.js";
3
3
  const v = /* @__PURE__ */ d({
4
4
  __name: "Component",
5
5
  props: /* @__PURE__ */ m({
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as n, mergeModels as s, useModel as p, openBlock as t, createElementBlock as r, createBlock as d, resolveDynamicComponent as u, mergeProps as c } from "vue";
2
- import { a as i } from "./index-BFu1nOLd.js";
2
+ import { a as i } from "./index-EwHmlOuJ.js";
3
3
  const f = {
4
4
  key: 0,
5
5
  class: "empty"
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as A, mergeModels as q, useModel as P, computed as S, watch as T, resolveComponent as y, openBlock as l, createElementBlock as h, unref as u, createBlock as s, Fragment as g, renderList as $, withCtx as r, createElementVNode as C, createVNode as b, mergeProps as L, createCommentVNode as _, toDisplayString as F, createTextVNode as j, h as G } from "vue";
2
- import { u as H, l as B, c as J, d as D, e as I, f as K } from "./index-BFu1nOLd.js";
2
+ import { u as H, l as B, c as J, d as D, e as I, f as K } from "./index-EwHmlOuJ.js";
3
3
  import "element-plus";
4
4
  const O = { class: "vfc-formList" }, Q = { key: 1 }, U = { class: "list-item-content" }, W = { class: "card-header" }, X = { style: { "margin-top": "5px" } }, ee = /* @__PURE__ */ A({
5
5
  __name: "FormList",
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as t, computed as n, openBlock as p, createBlock as a, unref as c, normalizeStyle as m } from "vue";
2
- import { _ as s } from "./index-BFu1nOLd.js";
2
+ import { _ as s } from "./index-EwHmlOuJ.js";
3
3
  import "element-plus";
4
4
  const _ = /* @__PURE__ */ t({
5
5
  __name: "Grid",
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as o, computed as l, openBlock as p, createBlock as r, unref as i, normalizeStyle as s } from "vue";
2
- import { _ as c, a as f } from "./index-BFu1nOLd.js";
2
+ import { _ as c, a as f } from "./index-EwHmlOuJ.js";
3
3
  import "element-plus";
4
4
  const m = /* @__PURE__ */ o({
5
5
  __name: "Inline",
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as At, openBlock as mt, createElementBlock as wt, mergeProps as St, createElementVNode as pt, renderSlot as It, normalizeClass as bt, mergeModels as Tt, useModel as Et, createBlock as Rt, unref as $t, withCtx as _t, createVNode as Lt } from "vue";
2
- import { a as xt, g as Nt } from "./index-BFu1nOLd.js";
2
+ import { a as xt, g as Nt } from "./index-EwHmlOuJ.js";
3
3
  import "element-plus";
4
4
  const Mt = /* @__PURE__ */ At({
5
5
  __name: "Disabled",
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as c, openBlock as e, createElementBlock as s, unref as o, createBlock as a, Fragment as m, renderList as l, mergeProps as i } from "vue";
2
- import { u, c as p, d as _ } from "./index-BFu1nOLd.js";
2
+ import { u, c as p, d as _ } from "./index-EwHmlOuJ.js";
3
3
  import "element-plus";
4
4
  const d = { class: "vfc-ObjGroup" }, f = {
5
5
  key: 1,
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as w, mergeModels as z, useModel as B, watch as T, resolveComponent as d, resolveDirective as D, unref as o, openBlock as a, createElementBlock as n, toDisplayString as M, Fragment as i, createCommentVNode as N, withDirectives as S, createBlock as u, mergeProps as f, withCtx as b, createVNode as F, renderList as v } from "vue";
2
- import { u as I } from "./index-BFu1nOLd.js";
3
- import { u as $ } from "./useSelect-CFkzMGeV.js";
2
+ import { u as I } from "./index-EwHmlOuJ.js";
3
+ import { u as $ } from "./useSelect-B9KCdR90.js";
4
4
  const E = { key: 0 }, L = {
5
5
  key: 0,
6
6
  style: { "font-size": "12px" }
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as C, mergeModels as _, useModel as B, watch as S, resolveComponent as f, resolveDirective as w, unref as o, openBlock as t, createElementBlock as n, toDisplayString as d, withDirectives as D, createBlock as v, mergeProps as M, withCtx as c, Fragment as F, renderList as I, createTextVNode as N } from "vue";
2
- import { u as j } from "./index-BFu1nOLd.js";
3
- import { u as A } from "./useSelect-CFkzMGeV.js";
2
+ import { u as j } from "./index-EwHmlOuJ.js";
3
+ import { u as A } from "./useSelect-B9KCdR90.js";
4
4
  const E = { key: 0 }, L = { key: 0 }, O = { key: 1 }, $ = /* @__PURE__ */ C({
5
5
  __name: "Select",
6
6
  props: /* @__PURE__ */ _({
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as i, ref as m, watch as _, onMounted as h, resolveComponent as a, openBlock as l, createBlock as c, mergeProps as u, withCtx as d, createElementBlock as b, Fragment as v, renderList as y, createVNode as k, unref as K } from "vue";
2
- import { _ as V } from "./index-BFu1nOLd.js";
2
+ import { _ as V } from "./index-EwHmlOuJ.js";
3
3
  import "element-plus";
4
4
  const w = /* @__PURE__ */ i({
5
5
  __name: "Tabs",
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, useModel as s, resolveComponent as p, unref as d, openBlock as t, createElementBlock as i, toDisplayString as c, createBlock as f, mergeProps as _ } from "vue";
2
- import { u as v } from "./index-BFu1nOLd.js";
2
+ import { u as v } from "./index-EwHmlOuJ.js";
3
3
  const V = { key: 0 }, x = /* @__PURE__ */ m({
4
4
  __name: "TextArea",
5
5
  props: {