@king-one/form-design 0.0.16 → 0.0.18

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 (102) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/es/index.mjs +16 -13
  3. package/dist/es/src/components/base/Carousel.vue.mjs +92 -0
  4. package/dist/es/src/components/base/Carousel.vue2.mjs +4 -0
  5. package/dist/es/src/components/base/json-preview.vue.mjs +215 -151
  6. package/dist/es/src/components/form-material.vue.mjs +168 -96
  7. package/dist/es/src/components/form-panel.vue.mjs +71 -65
  8. package/dist/es/src/components/panel/index.mjs +23 -13
  9. package/dist/es/src/components/panel/panel-item.vue.mjs +29 -29
  10. package/dist/es/src/components/panel/panel-wrapper.mjs +1 -1
  11. package/dist/es/src/components/panel/widget/date-range.vue.mjs +4 -0
  12. package/dist/es/src/components/panel/widget/date-range.vue2.mjs +28 -0
  13. package/dist/es/src/components/panel/widget/date-single.vue.mjs +4 -0
  14. package/dist/es/src/components/panel/widget/date-single.vue2.mjs +28 -0
  15. package/dist/es/src/components/panel/widget/kit.vue.mjs +4 -0
  16. package/dist/es/src/components/panel/widget/kit.vue2.mjs +48 -0
  17. package/dist/es/src/components/panel/widget/object.vue2.mjs +25 -25
  18. package/dist/es/src/components/panel/widget/select.vue2.mjs +3 -3
  19. package/dist/es/src/components/props/form-config.vue.mjs +1 -1
  20. package/dist/es/src/components/props/widget/BaseProps.vue2.mjs +31 -46
  21. package/dist/es/src/components/props/widget/InputNumberProps.vue2.mjs +94 -109
  22. package/dist/es/src/components/props/widget/InputProps.vue2.mjs +49 -64
  23. package/dist/es/src/components/props/widget/OvertimeProps.vue.mjs +4 -0
  24. package/dist/es/src/components/props/widget/OvertimeProps.vue2.mjs +17 -0
  25. package/dist/es/src/components/props/widget/PropsDecorator.mjs +34 -0
  26. package/dist/es/src/components/props/widget/SelectProps.vue.mjs +4 -0
  27. package/dist/es/src/components/props/widget/SelectProps.vue2.mjs +88 -0
  28. package/dist/es/src/components/props/widget/TextareaProps.vue2.mjs +48 -63
  29. package/dist/es/src/components/props/widget/index.mjs +44 -36
  30. package/dist/es/src/config/index.mjs +165 -15
  31. package/dist/es/src/core/Design.mjs +24 -19
  32. package/dist/es/src/core/Field.mjs +1 -1
  33. package/dist/es/src/core/FormSchema.mjs +28 -26
  34. package/dist/es/src/index.mjs +15 -13
  35. package/dist/es/src/plugins/index.mjs +10 -7
  36. package/dist/es/src/plugins/modules/drag-put.mjs +14 -0
  37. package/dist/es/src/utils/debounce.mjs +16 -0
  38. package/dist/es/src/utils/index.mjs +15 -13
  39. package/dist/lib/index.js +1 -1
  40. package/dist/lib/src/components/base/Carousel.vue.js +1 -0
  41. package/dist/lib/src/components/base/Carousel.vue2.js +1 -0
  42. package/dist/lib/src/components/base/json-preview.vue.js +6 -6
  43. package/dist/lib/src/components/form-material.vue.js +10 -1
  44. package/dist/lib/src/components/form-panel.vue.js +2 -2
  45. package/dist/lib/src/components/panel/index.js +1 -1
  46. package/dist/lib/src/components/panel/panel-item.vue.js +1 -1
  47. package/dist/lib/src/components/panel/panel-wrapper.js +1 -1
  48. package/dist/lib/src/components/panel/widget/date-range.vue.js +1 -0
  49. package/dist/lib/src/components/panel/widget/date-range.vue2.js +1 -0
  50. package/dist/lib/src/components/panel/widget/date-single.vue.js +1 -0
  51. package/dist/lib/src/components/panel/widget/date-single.vue2.js +1 -0
  52. package/dist/lib/src/components/panel/widget/kit.vue.js +1 -0
  53. package/dist/lib/src/components/panel/widget/kit.vue2.js +1 -0
  54. package/dist/lib/src/components/panel/widget/object.vue2.js +1 -1
  55. package/dist/lib/src/components/panel/widget/select.vue2.js +1 -1
  56. package/dist/lib/src/components/props/form-config.vue.js +1 -1
  57. package/dist/lib/src/components/props/widget/BaseProps.vue2.js +1 -1
  58. package/dist/lib/src/components/props/widget/InputNumberProps.vue2.js +1 -1
  59. package/dist/lib/src/components/props/widget/InputProps.vue2.js +1 -1
  60. package/dist/lib/src/components/props/widget/OvertimeProps.vue.js +1 -0
  61. package/dist/lib/src/components/props/widget/OvertimeProps.vue2.js +1 -0
  62. package/dist/lib/src/components/props/widget/PropsDecorator.js +1 -0
  63. package/dist/lib/src/components/props/widget/SelectProps.vue.js +1 -0
  64. package/dist/lib/src/components/props/widget/SelectProps.vue2.js +1 -0
  65. package/dist/lib/src/components/props/widget/TextareaProps.vue2.js +1 -1
  66. package/dist/lib/src/components/props/widget/index.js +1 -1
  67. package/dist/lib/src/config/index.js +1 -1
  68. package/dist/lib/src/core/Design.js +1 -1
  69. package/dist/lib/src/core/Field.js +1 -1
  70. package/dist/lib/src/core/FormSchema.js +1 -1
  71. package/dist/lib/src/index.js +1 -1
  72. package/dist/lib/src/plugins/index.js +1 -1
  73. package/dist/lib/src/plugins/modules/drag-put.js +1 -0
  74. package/dist/lib/src/utils/debounce.js +1 -0
  75. package/dist/lib/src/utils/index.js +1 -1
  76. package/dist/theme-chalk/carousel.css +1 -0
  77. package/dist/theme-chalk/icon.css +1 -1
  78. package/dist/theme-chalk/index.css +1 -1
  79. package/dist/theme-chalk/json-preview.css +1 -1
  80. package/dist/theme-chalk/kit-panel.css +1 -0
  81. package/dist/theme-chalk/material.css +1 -1
  82. package/dist/theme-chalk/panel.css +1 -1
  83. package/dist/types/src/components/base/Carousel.vue.d.ts +65 -0
  84. package/dist/types/src/components/panel/widget/date-range.vue.d.ts +8 -0
  85. package/dist/types/src/components/panel/widget/date-single.vue.d.ts +8 -0
  86. package/dist/types/src/components/panel/widget/kit.vue.d.ts +8 -0
  87. package/dist/types/src/components/props/widget/OvertimeProps.vue.d.ts +3 -0
  88. package/dist/types/src/components/props/widget/PropsDecorator.d.ts +3 -0
  89. package/dist/types/src/components/props/widget/SelectProps.vue.d.ts +3 -0
  90. package/dist/types/src/components/props/widget/index.d.ts +1 -9
  91. package/dist/types/src/components/types.d.ts +4 -3
  92. package/dist/types/src/config/index.d.ts +2 -1
  93. package/dist/types/src/core/Design.d.ts +93 -41
  94. package/dist/types/src/core/FormSchema.d.ts +22 -10
  95. package/dist/types/src/hooks/usePolling.d.ts +5 -0
  96. package/dist/types/src/index.d.ts +1 -0
  97. package/dist/types/src/plugins/index.d.ts +3 -1
  98. package/dist/types/src/plugins/modules/drag-put.d.ts +5 -0
  99. package/dist/types/src/types.d.ts +29 -6
  100. package/dist/types/src/utils/debounce.d.ts +10 -0
  101. package/dist/types/src/utils/index.d.ts +1 -0
  102. package/package.json +2 -2
@@ -1,54 +1,62 @@
1
- import { defineComponent as u, h as i } from "vue";
2
- import { Collapse as d } from "ant-design-vue";
3
1
  import "./InputProps.vue.mjs";
4
2
  import "./TextareaProps.vue.mjs";
5
3
  import "./InputNumberProps.vue.mjs";
6
4
  import "./BaseProps.vue.mjs";
5
+ import "./SelectProps.vue.mjs";
6
+ import "./OvertimeProps.vue.mjs";
7
+ import { propsWidgetDecorator as a } from "./PropsDecorator.mjs";
8
+ import o from "./BaseProps.vue2.mjs";
7
9
  import s from "./InputProps.vue2.mjs";
8
- import c from "./TextareaProps.vue2.mjs";
9
- import a from "./InputNumberProps.vue2.mjs";
10
- import e from "./BaseProps.vue2.mjs";
11
- const j = {
12
- "k-input": s,
13
- "k-textarea": c,
14
- "k-input-number": a
15
- }, _ = {
10
+ import d from "./TextareaProps.vue2.mjs";
11
+ import f from "./InputNumberProps.vue2.mjs";
12
+ import h from "./SelectProps.vue2.mjs";
13
+ import g from "./OvertimeProps.vue2.mjs";
14
+ const _ = {
16
15
  "k-input": {
17
- component: [e, s]
16
+ component: [
17
+ { header: "基础设置", widget: o },
18
+ { header: "组件属性", widget: s }
19
+ ]
18
20
  },
19
21
  "k-textarea": {
20
- component: [e, c]
22
+ component: [
23
+ { header: "基础设置", widget: o },
24
+ { header: "组件属性", widget: d }
25
+ ]
21
26
  },
22
27
  "k-input-number": {
23
- component: [e, a]
28
+ component: [
29
+ { header: "基础设置", widget: o },
30
+ { header: "组件属性", widget: f }
31
+ ]
32
+ },
33
+ "k-select": {
34
+ component: [
35
+ { header: "基础设置", widget: o },
36
+ { header: "组件属性", widget: h }
37
+ ]
38
+ },
39
+ "k-overtime": {
40
+ component: [
41
+ { header: "组件属性", widget: g }
42
+ ]
24
43
  }
25
44
  };
26
- function D(n = []) {
27
- const o = {};
28
- for (const [t, f] of Object.entries(_)) {
29
- const p = [...f.component];
30
- for (const m of n) {
31
- const { keys: r } = m;
32
- (Array.isArray(r) ? r.includes(t) : r.test(t)) && p.push(m.component);
45
+ function T(c = []) {
46
+ const i = {};
47
+ for (const [e, p] of Object.entries(_)) {
48
+ const n = [...p.component];
49
+ for (const m of c) {
50
+ const { keys: r, exclude: t } = m;
51
+ if (t && (Array.isArray(t) ? t.includes(e) : t.test(e)))
52
+ continue;
53
+ (Array.isArray(r) ? r.includes(e) : r.test(e)) && n.push(m.component);
33
54
  }
34
- o[t] = k(t, p);
55
+ i[e] = a(e, n);
35
56
  }
36
- return o;
37
- }
38
- function k(n, o) {
39
- return u({
40
- name: `${n}-props`,
41
- inheritAttrs: !1,
42
- setup() {
43
- return () => i(d, null, {
44
- default: () => o.map((t) => i(t))
45
- });
46
- }
47
- });
57
+ return i;
48
58
  }
49
59
  export {
50
- j as components,
51
- D as expandProps,
52
- k as propsWidgetDecorator,
60
+ T as expandProps,
53
61
  _ as widgetProps
54
62
  };
@@ -7,7 +7,7 @@ const e = {
7
7
  icon: "k-form-grid",
8
8
  key: "form-layout",
9
9
  type: "void",
10
- "k-component": "FormLayout"
10
+ "x-component": "FormLayout"
11
11
  }
12
12
  ]
13
13
  }, t = {
@@ -19,8 +19,8 @@ const e = {
19
19
  key: "k-input",
20
20
  type: "string",
21
21
  icon: "form-input",
22
- "k-component": "Input",
23
- "k-component-props": {
22
+ "x-component": "Input",
23
+ "x-component-props": {
24
24
  placeholder: "请输入"
25
25
  }
26
26
  },
@@ -29,8 +29,8 @@ const e = {
29
29
  key: "k-textarea",
30
30
  type: "string",
31
31
  icon: "form-textarea",
32
- "k-component": "Textarea",
33
- "k-component-props": {
32
+ "x-component": "Textarea",
33
+ "x-component-props": {
34
34
  placeholder: "请输入"
35
35
  }
36
36
  },
@@ -39,17 +39,20 @@ const e = {
39
39
  key: "k-input-number",
40
40
  type: "number",
41
41
  icon: "form-number",
42
- "k-component": "InputNumber",
43
- "k-component-props": {
42
+ "x-component": "InputNumber",
43
+ "x-component-props": {
44
44
  placeholder: "请输入"
45
45
  }
46
46
  },
47
47
  {
48
48
  title: "下拉选择框",
49
49
  key: "k-select",
50
- type: "string",
50
+ type: "array",
51
+ items: {
52
+ type: "string"
53
+ },
51
54
  icon: "form-select",
52
- "k-component": "Select",
55
+ "x-component": "Select",
53
56
  enum: [
54
57
  {
55
58
  label: "选项1",
@@ -60,9 +63,46 @@ const e = {
60
63
  value: "2"
61
64
  }
62
65
  ],
63
- "k-component-props": {
64
- placeholder: "请选择"
66
+ "x-component-props": {
67
+ placeholder: "请选择",
68
+ allowClear: !0,
69
+ mode: "multiple"
70
+ },
71
+ "x-decorator": "FormItem"
72
+ },
73
+ {
74
+ title: "日期范围",
75
+ key: "k-date-range",
76
+ type: "array",
77
+ format: "date",
78
+ items: {
79
+ type: "string"
80
+ },
81
+ icon: "form-date",
82
+ "x-component": "InputNumber",
83
+ "x-component-props": {
84
+ placeholder: "请输入",
85
+ formatData: "YYYY-MM-DD"
65
86
  }
87
+ },
88
+ {
89
+ title: "单个日期",
90
+ key: "k-date-single",
91
+ type: "string",
92
+ format: "date",
93
+ icon: "form-date",
94
+ "x-component": "InputNumber",
95
+ "x-component-props": {
96
+ placeholder: "请输入",
97
+ formatData: "YYYY-MM-DD"
98
+ }
99
+ },
100
+ {
101
+ title: "地区选择",
102
+ key: "k-form-area",
103
+ type: "object",
104
+ icon: "form-area",
105
+ "x-component": "FormArea"
66
106
  }
67
107
  ]
68
108
  }, o = {
@@ -82,19 +122,129 @@ const e = {
82
122
  type: "array",
83
123
  icon: "form-list",
84
124
  children: [],
85
- "k-component": "ArrayCard"
125
+ "x-component": "ArrayCard",
126
+ "x-decorator": "Void"
86
127
  },
87
128
  {
88
129
  title: "明细表",
89
130
  key: "k-table",
90
131
  type: "array",
91
132
  icon: "form-table",
92
- "k-component": "FormLayout"
133
+ "x-component": "FormLayout"
93
134
  }
94
135
  ]
95
- };
136
+ }, a = [
137
+ {
138
+ name: "加班模版",
139
+ key: "overtime",
140
+ icon: "form-kit-overtime",
141
+ schema: {
142
+ title: "加班模版",
143
+ key: "k-overtime",
144
+ type: "object",
145
+ name: "overtime",
146
+ id: "overtime",
147
+ "x-design-props": {
148
+ validate: {
149
+ status: "",
150
+ message: ""
151
+ }
152
+ },
153
+ children: [
154
+ {
155
+ title: "加班人",
156
+ key: "k-input",
157
+ type: "string",
158
+ "x-component": "Input",
159
+ "x-component-props": {
160
+ placeholder: "请输入"
161
+ },
162
+ name: "vzhax44q5mg",
163
+ id: "vzhax44q5mg",
164
+ "x-design-props": {
165
+ validate: {
166
+ status: "",
167
+ message: ""
168
+ }
169
+ }
170
+ },
171
+ {
172
+ title: "加班时长",
173
+ key: "k-input-number",
174
+ type: "number",
175
+ "x-component": "InputNumber",
176
+ "x-component-props": {
177
+ placeholder: "请输入"
178
+ },
179
+ name: "aaaa",
180
+ id: "aaaa",
181
+ "x-design-props": {
182
+ validate: {
183
+ status: "",
184
+ message: ""
185
+ }
186
+ }
187
+ }
188
+ ]
189
+ }
190
+ },
191
+ {
192
+ name: "请假模版",
193
+ key: "leave",
194
+ icon: "form-kit-out",
195
+ schema: {
196
+ title: "请假模版",
197
+ key: "k-leave",
198
+ type: "object",
199
+ name: "leave",
200
+ id: "leave",
201
+ "x-design-props": {
202
+ validate: {
203
+ status: "",
204
+ message: ""
205
+ }
206
+ },
207
+ children: [
208
+ {
209
+ title: "下拉选择框",
210
+ key: "k-select",
211
+ type: "array",
212
+ items: {
213
+ type: "string"
214
+ },
215
+ "x-component": "Select",
216
+ enum: [
217
+ {
218
+ label: "选项1",
219
+ value: "1"
220
+ },
221
+ {
222
+ label: "选项2",
223
+ value: "2"
224
+ }
225
+ ],
226
+ "x-component-props": {
227
+ placeholder: "请选择",
228
+ allowClear: !0,
229
+ mode: "multiple"
230
+ },
231
+ "x-decorator": "FormItem",
232
+ name: "uvvs3k1v39k",
233
+ id: "uvvs3k1v39k",
234
+ "x-design-props": {
235
+ validate: {
236
+ status: "",
237
+ message: ""
238
+ }
239
+ }
240
+ }
241
+ ]
242
+ }
243
+ }
244
+ ];
96
245
  export {
97
246
  t as BaseSchema,
98
247
  o as ExtendSchema,
99
- e as LayoutSchema
248
+ e as LayoutSchema,
249
+ a as tempSchema
100
250
  };
@@ -1,45 +1,47 @@
1
1
  var m = Object.defineProperty;
2
- var p = (s, e, r) => e in s ? m(s, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[e] = r;
3
- var t = (s, e, r) => p(s, typeof e != "symbol" ? e + "" : e, r);
4
- import { ref as n } from "vue";
2
+ var p = (r, e, s) => e in r ? m(r, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : r[e] = s;
3
+ var t = (r, e, s) => p(r, typeof e != "symbol" ? e + "" : e, s);
4
+ import { ref as c } from "vue";
5
5
  import "../effects/index.mjs";
6
- import { widgetPanels as c } from "../components/panel/index.mjs";
6
+ import { widgetPanels as n } from "../components/panel/index.mjs";
7
7
  import "../components/props/index.mjs";
8
- import { Plugin as g } from "../plugins/index.mjs";
8
+ import { Plugin as l } from "../plugins/index.mjs";
9
9
  import { Heart as d } from "./Heart.mjs";
10
- import { FormSchema as l } from "./FormSchema.mjs";
11
- import { widgetProps as a } from "../components/props/widget/index.mjs";
10
+ import { FormSchema as a } from "./FormSchema.mjs";
11
+ import { widgetProps as g } from "../components/props/widget/index.mjs";
12
12
  import { runEffects as f } from "../effects/effective.mjs";
13
- class b {
13
+ class L {
14
14
  constructor(e) {
15
15
  t(this, "schema");
16
+ t(this, "tempSchema");
16
17
  t(this, "heart");
17
18
  t(this, "plugin");
18
- t(this, "FormSchema", new l());
19
+ t(this, "FormSchema", new a());
19
20
  t(this, "props");
20
- t(this, "checkedField", n({}));
21
+ t(this, "checkedField", c({}));
21
22
  t(this, "shared", {
22
23
  draggedContext: {
23
- key: ""
24
+ key: "",
25
+ field: null
24
26
  },
25
27
  panelWidgets: {},
26
28
  propsWidgets: {}
27
29
  });
28
30
  t(this, "extendFormProps", []);
29
- t(this, "notify", (e, ...r) => {
30
- this.heart.publish(e, ...r);
31
+ t(this, "notify", (e, ...s) => {
32
+ this.heart.publish(e, ...s);
31
33
  });
32
- const { extendFormProps: r = [], propsWidgets: i = {}, panelWidgets: o = {}, ...h } = e;
34
+ const { extendFormProps: s = [], propsWidgets: i = {}, panelWidgets: o = {}, ...h } = e;
33
35
  this.shared.panelWidgets = {
34
- ...c,
36
+ ...n,
35
37
  ...o
36
38
  }, this.shared.propsWidgets = {
37
- ...a,
39
+ ...g,
38
40
  ...i
39
- }, this.props = { ...h }, this.schema = e.schema, this.plugin = new g(), this.heart = new d({
41
+ }, this.props = { ...h }, this.schema = e.schema, this.tempSchema = e.tempSchema || [], this.plugin = new l(), this.heart = new d({
40
42
  lifecycles: this.lifecycles,
41
43
  context: this
42
- }), this.extendFormProps = r;
44
+ }), this.extendFormProps = s;
43
45
  }
44
46
  use(e) {
45
47
  this.plugin.use(e);
@@ -50,6 +52,9 @@ class b {
50
52
  getFieldList() {
51
53
  return this.FormSchema.getFieldList();
52
54
  }
55
+ setCheckedField(e) {
56
+ this.checkedField.value = e;
57
+ }
53
58
  get lifecycles() {
54
59
  return this.props.effects ? f(this, this.props.effects) : [];
55
60
  }
@@ -61,5 +66,5 @@ class b {
61
66
  }
62
67
  }
63
68
  export {
64
- b as FormDesign
69
+ L as FormDesign
65
70
  };
@@ -7,7 +7,7 @@ class p {
7
7
  this.field = i;
8
8
  }
9
9
  upDateValidate(i, s) {
10
- this.field["k-design-props"] && (this.field["k-design-props"].validate = {
10
+ this.field["x-design-props"] && (this.field["x-design-props"].validate = {
11
11
  status: i,
12
12
  message: s
13
13
  });
@@ -1,47 +1,49 @@
1
1
  var n = Object.defineProperty;
2
- var a = (r, e, t) => e in r ? n(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var i = (r, e, t) => a(r, typeof e != "symbol" ? e + "" : e, t);
4
- import { ref as m, toRaw as c } from "vue";
5
- import { uid as h } from "@king-one/utils";
6
- import { Field as l } from "./Field.mjs";
2
+ var a = (s, e, o) => e in s ? n(s, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[e] = o;
3
+ var i = (s, e, o) => a(s, typeof e != "symbol" ? e + "" : e, o);
4
+ import { ref as c, toRaw as h } from "vue";
5
+ import { uid as l } from "@king-one/utils";
6
+ import { Field as m } from "./Field.mjs";
7
7
  class j {
8
8
  constructor() {
9
9
  i(this, "version", "1.0.0");
10
- i(this, "fields", m([]));
10
+ i(this, "fields", c([]));
11
11
  }
12
12
  getSchema() {
13
- const e = c(this.fields.value), t = this.jsonToschema(e);
13
+ const e = h(this.fields.value);
14
+ console.log(e, "s");
15
+ const o = this.jsonToschema(e);
14
16
  return {
15
17
  version: this.version,
16
18
  form: {
17
- schema: t
19
+ schema: o
18
20
  }
19
21
  };
20
22
  }
21
23
  getFieldList() {
22
- return this.fields.value.map((e) => new l(e));
24
+ return this.fields.value.map((e) => new m(e));
23
25
  }
24
- jsonToschema(e, t = {}) {
25
- return e.forEach((s) => {
26
- const o = this.omit(s, ["children"]);
27
- o.type === "object" || o.type === "void" ? t[o.name] = {
28
- ...o,
29
- properties: this.jsonToschema(s.children)
30
- } : o.type === "array" ? t[o.name] = {
31
- ...o,
26
+ jsonToschema(e, o = {}) {
27
+ return e.forEach((r) => {
28
+ const t = this.omit(r, ["children"]);
29
+ t.type === "object" || t.type === "void" ? o[t.name] = {
30
+ ...t,
31
+ properties: this.jsonToschema(r.children)
32
+ } : t.type === "array" && r.children ? o[t.name] = {
33
+ ...t,
32
34
  items: {
33
35
  type: "object",
34
- id: h(),
35
- properties: this.jsonToschema(s.children)
36
+ id: l(),
37
+ properties: this.jsonToschema(r.children)
36
38
  }
37
- } : t[o.name] = o;
38
- }), t;
39
+ } : o[t.name] = t;
40
+ }), o;
39
41
  }
40
- omit(e, t) {
41
- const s = { ...e };
42
- return t.forEach((o) => {
43
- delete s[o];
44
- }), s;
42
+ omit(e, o) {
43
+ const r = { ...e };
44
+ return o.forEach((t) => {
45
+ delete r[t];
46
+ }), r;
45
47
  }
46
48
  }
47
49
  export {
@@ -1,18 +1,20 @@
1
1
  import "./style/index.mjs";
2
+ import "./components/base/Carousel.vue2.mjs";
2
3
  import "./components/panel/panel-item.vue2.mjs";
3
- import { useInjectDesignContext as n } from "./context/design.mjs";
4
- import { default as a } from "./components/form-desgin.mjs";
5
- import { CreateFormDesign as s } from "./core/index.mjs";
4
+ import { useInjectDesignContext as i } from "./context/design.mjs";
5
+ import { default as p } from "./components/form-desgin.mjs";
6
+ import { CreateFormDesign as x } from "./core/index.mjs";
6
7
  import "./components/index.mjs";
7
- import { BaseSchema as f, ExtendSchema as g, LayoutSchema as D } from "./config/index.mjs";
8
- import { onDesignFieldChange as h, onDesignInit as d } from "./effects/onEffects.mjs";
8
+ import { BaseSchema as g, ExtendSchema as c, LayoutSchema as h, tempSchema as D } from "./config/index.mjs";
9
+ import { onDesignFieldChange as d, onDesignInit as u } from "./effects/onEffects.mjs";
9
10
  export {
10
- f as BaseSchema,
11
- s as CreateFormDesign,
12
- g as ExtendSchema,
13
- a as FormDesign,
14
- D as LayoutSchema,
15
- h as onDesignFieldChange,
16
- d as onDesignInit,
17
- n as useInjectDesignContext
11
+ g as BaseSchema,
12
+ x as CreateFormDesign,
13
+ c as ExtendSchema,
14
+ p as FormDesign,
15
+ h as LayoutSchema,
16
+ d as onDesignFieldChange,
17
+ u as onDesignInit,
18
+ D as tempSchema,
19
+ i as useInjectDesignContext
18
20
  };
@@ -1,17 +1,20 @@
1
1
  var s = Object.defineProperty;
2
- var a = (l, e, o) => e in l ? s(l, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[e] = o;
3
- var i = (l, e, o) => a(l, typeof e != "symbol" ? e + "" : e, o);
4
- import { SyncBailHook as t } from "@king-one/tapable";
5
- class c {
2
+ var a = (o, e, t) => e in o ? s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var l = (o, e, t) => a(o, typeof e != "symbol" ? e + "" : e, t);
4
+ import { SyncBailHook as r } from "@king-one/tapable";
5
+ import { BaseDragPut as i } from "./modules/drag-put.mjs";
6
+ class m {
6
7
  constructor() {
7
- i(this, "hooks", {
8
- beforeDelete: new t(["value"])
8
+ l(this, "hooks", {
9
+ beforeDelete: new r(["value"]),
10
+ dragPut: new r(["value"])
9
11
  });
12
+ this.use(new i());
10
13
  }
11
14
  use(e) {
12
15
  e.install.call(void 0, this);
13
16
  }
14
17
  }
15
18
  export {
16
- c as Plugin
19
+ m as Plugin
17
20
  };
@@ -0,0 +1,14 @@
1
+ var s = Object.defineProperty;
2
+ var n = (a, e, r) => e in a ? s(a, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[e] = r;
3
+ var t = (a, e, r) => n(a, typeof e != "symbol" ? e + "" : e, r);
4
+ class l {
5
+ constructor() {
6
+ t(this, "name", "baseDragPut");
7
+ }
8
+ install(e) {
9
+ e.hooks.dragPut.tap("baseDragPut", (r) => r.region === "form-panel" ? !0 : r.region === "form-material");
10
+ }
11
+ }
12
+ export {
13
+ l as BaseDragPut
14
+ };
@@ -0,0 +1,16 @@
1
+ function s(t, u, o = !1) {
2
+ let e = null, l = !1;
3
+ const i = function(...n) {
4
+ e && (clearTimeout(e), e = null), o ? (l || (t.apply(this, n), l = !0), e = setTimeout(() => {
5
+ l = !1, e = null;
6
+ }, u)) : e = setTimeout(() => {
7
+ t.apply(this, n), e = null, l = !1;
8
+ }, u);
9
+ };
10
+ return i.cancel = () => {
11
+ e && (clearTimeout(e), e = null), l = !1;
12
+ }, i;
13
+ }
14
+ export {
15
+ s as debounce
16
+ };
@@ -1,19 +1,21 @@
1
- import { getType as s, isArr as t, isBool as a, isFn as r, isHTMLElement as m, isMap as p, isNum as l, isNumberLike as n, isObj as o, isPlainObj as b, isReactElement as k, isRegExp as E, isSet as M, isStr as S, isWeakMap as g, isWeakSet as j } from "./checkers.mjs";
1
+ import { getType as s, isArr as t, isBool as r, isFn as o, isHTMLElement as a, isMap as m, isNum as p, isNumberLike as n, isObj as b, isPlainObj as l, isReactElement as k, isRegExp as u, isSet as x, isStr as E, isWeakMap as M, isWeakSet as S } from "./checkers.mjs";
2
+ import { debounce as f } from "./debounce.mjs";
2
3
  export {
4
+ f as debounce,
3
5
  s as getType,
4
6
  t as isArr,
5
- a as isBool,
6
- r as isFn,
7
- m as isHTMLElement,
8
- p as isMap,
9
- l as isNum,
7
+ r as isBool,
8
+ o as isFn,
9
+ a as isHTMLElement,
10
+ m as isMap,
11
+ p as isNum,
10
12
  n as isNumberLike,
11
- o as isObj,
12
- b as isPlainObj,
13
+ b as isObj,
14
+ l as isPlainObj,
13
15
  k as isReactElement,
14
- E as isRegExp,
15
- M as isSet,
16
- S as isStr,
17
- g as isWeakMap,
18
- j as isWeakSet
16
+ u as isRegExp,
17
+ x as isSet,
18
+ E as isStr,
19
+ M as isWeakMap,
20
+ S as isWeakSet
19
21
  };
package/dist/lib/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./src/index.js");const t=require("./src/components/panel/panel-item.vue.js"),r=require("./src/context/design.js"),i=require("./src/components/form-desgin.js"),o=require("./src/core/index.js"),s=require("./src/components/props/form-config.vue.js"),e=require("./src/config/index.js"),n=require("./src/effects/onEffects.js");exports.FormPanelItem=t.default;exports.useInjectDesignContext=r.useInjectDesignContext;exports.FormDesign=i.default;exports.CreateFormDesign=o.CreateFormDesign;exports.FormConfig=s.default;exports.BaseSchema=e.BaseSchema;exports.ExtendSchema=e.ExtendSchema;exports.LayoutSchema=e.LayoutSchema;exports.onDesignFieldChange=n.onDesignFieldChange;exports.onDesignInit=n.onDesignInit;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./src/index.js");const n=require("./src/components/base/Carousel.vue.js"),r=require("./src/components/panel/panel-item.vue.js"),i=require("./src/context/design.js"),s=require("./src/components/form-desgin.js"),u=require("./src/core/index.js"),o=require("./src/components/props/form-config.vue.js"),e=require("./src/config/index.js"),t=require("./src/effects/onEffects.js");exports.Carousel=n.default;exports.FormPanelItem=r.default;exports.useInjectDesignContext=i.useInjectDesignContext;exports.FormDesign=s.default;exports.CreateFormDesign=u.CreateFormDesign;exports.FormConfig=o.default;exports.BaseSchema=e.BaseSchema;exports.ExtendSchema=e.ExtendSchema;exports.LayoutSchema=e.LayoutSchema;exports.tempSchema=e.tempSchema;exports.onDesignFieldChange=t.onDesignFieldChange;exports.onDesignInit=t.onDesignInit;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../internal.js");const y=require("../../hooks/use-namespace/index.js"),_=e.defineComponent({__name:"Carousel",props:{modelValue:{type:Number,default:0},isAnimating:{type:Boolean,default:!0},direction:{type:String,default:"horizontal",validator:r=>["horizontal","vertical"].includes(r)}},emits:["update:modelValue","afterChange"],setup(r,{expose:c,emit:f}){const a=r,l=f,{b:d}=y.useNamespace("carousel"),u=e.ref(),n=e.ref(a.modelValue),i=e.ref(0);function o(){u.value&&(i.value=u.value.children.length)}e.watch(()=>a.modelValue,t=>{t!==n.value&&(n.value=t)});function s(t){t<0||t>=i.value||(n.value=t,l("update:modelValue",t),a.isAnimating||l("afterChange",t))}function m(t){s(t)}function v(){e.nextTick(()=>{o(),n.value<i.value-1&&s(n.value+1)})}function p(){e.nextTick(()=>{o(),n.value>0&&s(n.value-1)})}function g(){l("afterChange",n.value)}const h=e.computed(()=>{const t=-n.value*100;return{transform:a.direction==="horizontal"?`translateX(${t}%)`:`translateY(${t}%)`,transition:a.isAnimating?"transform 0.3s ease-in-out":"none",flexDirection:a.direction==="horizontal"?"row":"column"}});return c({next:v,prev:p,goTo:m,currentIndex:n}),e.onMounted(o),e.onUpdated(o),(t,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(d)())},[e.createElementVNode("div",{ref_key:"trackRef",ref:u,class:"carousel-track",style:e.normalizeStyle(h.value),onTransitionend:g},[e.renderSlot(t.$slots,"default")],36)],2))}});exports.default=_;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Carousel.vue.js");exports.default=e.default;