@king-one/form-design 0.0.28 → 0.0.30
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/CHANGELOG.md +12 -0
- package/dist/es/index.mjs +10 -8
- package/dist/es/src/components/form-material.vue.mjs +44 -49
- package/dist/es/src/components/panel/widget/grid.vue2.mjs +1 -1
- package/dist/es/src/components/props/widget/GridProps.vue2.mjs +15 -20
- package/dist/es/src/config/index.mjs +225 -149
- package/dist/es/src/core/FormSchema.mjs +37 -58
- package/dist/es/src/index.mjs +15 -14
- package/dist/es/src/plugins/modules/drag-add.mjs +1 -1
- package/dist/es/src/utils/index.mjs +15 -13
- package/dist/es/src/utils/schema.mjs +29 -0
- package/dist/lib/index.js +1 -1
- package/dist/lib/src/components/form-material.vue.js +1 -1
- package/dist/lib/src/components/panel/widget/grid.vue2.js +1 -1
- package/dist/lib/src/components/props/widget/GridProps.vue2.js +1 -1
- package/dist/lib/src/config/index.js +14 -14
- package/dist/lib/src/core/FormSchema.js +1 -1
- package/dist/lib/src/index.js +1 -1
- package/dist/lib/src/plugins/modules/drag-add.js +1 -1
- package/dist/lib/src/utils/index.js +1 -1
- package/dist/lib/src/utils/schema.js +1 -0
- package/dist/theme-chalk/icon.css +1 -1
- package/dist/theme-chalk/index.css +1 -1
- package/dist/types/src/core/Design.d.ts +546 -186
- package/dist/types/src/core/FormSchema.d.ts +176 -62
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/types.d.ts +41 -30
- package/dist/types/src/utils/index.d.ts +1 -0
- package/dist/types/src/utils/schema.d.ts +2 -0
- package/package.json +1 -1
|
@@ -12,10 +12,6 @@ const o = {
|
|
|
12
12
|
"x-component-props": {
|
|
13
13
|
gutter: 20
|
|
14
14
|
},
|
|
15
|
-
"x-design-props": {
|
|
16
|
-
"convert-key": "properties",
|
|
17
|
-
"convert-type": "base"
|
|
18
|
-
},
|
|
19
15
|
"x-decorator": "Void"
|
|
20
16
|
}
|
|
21
17
|
]
|
|
@@ -117,17 +113,27 @@ const o = {
|
|
|
117
113
|
type: e.object,
|
|
118
114
|
icon: "form-area",
|
|
119
115
|
"x-component": "FormArea",
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
type: e.string
|
|
123
|
-
|
|
124
|
-
city: {
|
|
125
|
-
type: e.string
|
|
116
|
+
children: [
|
|
117
|
+
{
|
|
118
|
+
type: e.string,
|
|
119
|
+
name: "province"
|
|
126
120
|
},
|
|
127
|
-
|
|
128
|
-
type: e.string
|
|
121
|
+
{
|
|
122
|
+
type: e.string,
|
|
123
|
+
name: "city"
|
|
129
124
|
}
|
|
130
|
-
|
|
125
|
+
]
|
|
126
|
+
// 'properties': {
|
|
127
|
+
// province: {
|
|
128
|
+
// type: valueTypeMap.string
|
|
129
|
+
// },
|
|
130
|
+
// city: {
|
|
131
|
+
// type: valueTypeMap.string
|
|
132
|
+
// },
|
|
133
|
+
// county: {
|
|
134
|
+
// type: valueTypeMap.string
|
|
135
|
+
// }
|
|
136
|
+
// }
|
|
131
137
|
}
|
|
132
138
|
]
|
|
133
139
|
}, a = {
|
|
@@ -139,11 +145,7 @@ const o = {
|
|
|
139
145
|
key: "k-object",
|
|
140
146
|
type: e.object,
|
|
141
147
|
icon: "form-object",
|
|
142
|
-
children: []
|
|
143
|
-
"x-design-props": {
|
|
144
|
-
"convert-key": "properties",
|
|
145
|
-
"convert-type": "base"
|
|
146
|
-
}
|
|
148
|
+
children: []
|
|
147
149
|
},
|
|
148
150
|
{
|
|
149
151
|
title: "列表容器",
|
|
@@ -152,11 +154,7 @@ const o = {
|
|
|
152
154
|
icon: "form-list",
|
|
153
155
|
children: [],
|
|
154
156
|
"x-component": "ArrayCard",
|
|
155
|
-
"x-decorator": "Void"
|
|
156
|
-
"x-design-props": {
|
|
157
|
-
"convert-key": "items",
|
|
158
|
-
"convert-type": "object"
|
|
159
|
-
}
|
|
157
|
+
"x-decorator": "Void"
|
|
160
158
|
},
|
|
161
159
|
{
|
|
162
160
|
title: "明细表",
|
|
@@ -164,12 +162,9 @@ const o = {
|
|
|
164
162
|
type: e.array,
|
|
165
163
|
icon: "form-table",
|
|
166
164
|
"x-component": "ArrayTable",
|
|
165
|
+
children: [],
|
|
167
166
|
"x-decorator-props": {
|
|
168
167
|
labelAlign: "top"
|
|
169
|
-
},
|
|
170
|
-
"x-design-props": {
|
|
171
|
-
"convert-key": "items",
|
|
172
|
-
"convert-type": "object"
|
|
173
168
|
}
|
|
174
169
|
}
|
|
175
170
|
]
|
|
@@ -190,67 +185,63 @@ const o = {
|
|
|
190
185
|
message: ""
|
|
191
186
|
}
|
|
192
187
|
},
|
|
193
|
-
|
|
194
|
-
|
|
188
|
+
children: [
|
|
189
|
+
{
|
|
195
190
|
type: e.array,
|
|
191
|
+
name: "details",
|
|
196
192
|
title: "加班明细",
|
|
197
193
|
"x-component": "ArrayCard",
|
|
198
194
|
"x-decorator": "Void",
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
type: e.
|
|
205
|
-
|
|
206
|
-
format: "date",
|
|
207
|
-
items: {
|
|
208
|
-
type: e.string,
|
|
209
|
-
format: "date"
|
|
210
|
-
},
|
|
211
|
-
name: "date",
|
|
212
|
-
"x-component": "DateRange",
|
|
213
|
-
"x-component-props": {
|
|
214
|
-
valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
215
|
-
showTime: !0,
|
|
216
|
-
placeholder: [
|
|
217
|
-
"开始日期",
|
|
218
|
-
"结束日期"
|
|
219
|
-
]
|
|
220
|
-
}
|
|
195
|
+
children: [
|
|
196
|
+
{
|
|
197
|
+
type: e.array,
|
|
198
|
+
title: "加班日期",
|
|
199
|
+
items: {
|
|
200
|
+
type: e.string,
|
|
201
|
+
format: "date"
|
|
221
202
|
},
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
"x-validator": [
|
|
231
|
-
{
|
|
232
|
-
validator: `{{const sourceValue = $parent.date
|
|
233
|
-
if (!sourceValue || !sourceValue.length) {
|
|
234
|
-
return true
|
|
235
|
-
}else{
|
|
236
|
-
const [start, end] = sourceValue
|
|
237
|
-
const s = new Date(start)
|
|
238
|
-
const e = new Date(end)
|
|
239
|
-
const hoursDiff = Math.abs(e - s) / (1000 * 60 * 60)
|
|
240
|
-
const actualHours = Math.round(hoursDiff * 100) / 100
|
|
241
|
-
if ( $value> actualHours) {
|
|
242
|
-
return new Error(\`不得超过\${actualHours}小时\`)
|
|
243
|
-
}
|
|
244
|
-
return true
|
|
245
|
-
}
|
|
246
|
-
}}`
|
|
247
|
-
}
|
|
203
|
+
name: "date",
|
|
204
|
+
"x-component": "DateRange",
|
|
205
|
+
"x-component-props": {
|
|
206
|
+
valueFormat: "YYYY-MM-DD HH:mm:ss",
|
|
207
|
+
showTime: !0,
|
|
208
|
+
placeholder: [
|
|
209
|
+
"开始日期",
|
|
210
|
+
"结束日期"
|
|
248
211
|
]
|
|
249
212
|
}
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
type: e.number,
|
|
216
|
+
title: "加班时长",
|
|
217
|
+
name: "hours",
|
|
218
|
+
"x-component": "InputNumber",
|
|
219
|
+
"x-component-props": {
|
|
220
|
+
placeholder: "请输入"
|
|
221
|
+
},
|
|
222
|
+
"x-validator": [
|
|
223
|
+
{
|
|
224
|
+
validator: `{{const sourceValue = $parent.date
|
|
225
|
+
if (!sourceValue || !sourceValue.length) {
|
|
226
|
+
return true
|
|
227
|
+
}else{
|
|
228
|
+
const [start, end] = sourceValue
|
|
229
|
+
const s = new Date(start)
|
|
230
|
+
const e = new Date(end)
|
|
231
|
+
const hoursDiff = Math.abs(e - s) / (1000 * 60 * 60)
|
|
232
|
+
const actualHours = Math.round(hoursDiff * 100) / 100
|
|
233
|
+
if ( $value> actualHours) {
|
|
234
|
+
return new Error(\`不得超过\${actualHours}小时\`)
|
|
235
|
+
}
|
|
236
|
+
return true
|
|
237
|
+
}
|
|
238
|
+
}}`
|
|
239
|
+
}
|
|
240
|
+
]
|
|
250
241
|
}
|
|
251
|
-
|
|
242
|
+
]
|
|
252
243
|
},
|
|
253
|
-
|
|
244
|
+
{
|
|
254
245
|
type: e.number,
|
|
255
246
|
title: "总时长",
|
|
256
247
|
name: "total",
|
|
@@ -274,78 +265,163 @@ const o = {
|
|
|
274
265
|
}
|
|
275
266
|
}
|
|
276
267
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
268
|
+
]
|
|
269
|
+
// 'properties': {
|
|
270
|
+
// details: {
|
|
271
|
+
// 'type': valueTypeMap.array,
|
|
272
|
+
// 'title': '加班明细',
|
|
273
|
+
// 'x-component': 'ArrayCard',
|
|
274
|
+
// 'x-decorator': 'Void',
|
|
275
|
+
// 'name': 'details',
|
|
276
|
+
// 'items': {
|
|
277
|
+
// type: valueTypeMap.object,
|
|
278
|
+
// properties: {
|
|
279
|
+
// date: {
|
|
280
|
+
// 'type': valueTypeMap.array,
|
|
281
|
+
// 'title': '加班日期',
|
|
282
|
+
// 'format': 'date',
|
|
283
|
+
// 'items': {
|
|
284
|
+
// type: valueTypeMap.string,
|
|
285
|
+
// format: 'date'
|
|
286
|
+
// },
|
|
287
|
+
// 'name': 'date',
|
|
288
|
+
// 'x-component': 'DateRange',
|
|
289
|
+
// 'x-component-props': {
|
|
290
|
+
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
291
|
+
// showTime: true,
|
|
292
|
+
// placeholder: [
|
|
293
|
+
// '开始日期',
|
|
294
|
+
// '结束日期'
|
|
295
|
+
// ]
|
|
296
|
+
// }
|
|
297
|
+
// },
|
|
298
|
+
// hours: {
|
|
299
|
+
// 'type': valueTypeMap.number,
|
|
300
|
+
// 'title': '加班时长',
|
|
301
|
+
// 'name': 'hours',
|
|
302
|
+
// 'x-component': 'InputNumber',
|
|
303
|
+
// 'x-component-props': {
|
|
304
|
+
// placeholder: '请输入'
|
|
305
|
+
// },
|
|
306
|
+
// 'x-validator': [
|
|
307
|
+
// {
|
|
308
|
+
// validator: `{{const sourceValue = \$parent.date
|
|
309
|
+
// if (!sourceValue || !sourceValue.length) {
|
|
310
|
+
// return true
|
|
311
|
+
// }else{
|
|
312
|
+
// const [start, end] = sourceValue
|
|
313
|
+
// const s = new Date(start)
|
|
314
|
+
// const e = new Date(end)
|
|
315
|
+
// const hoursDiff = Math.abs(e - s) / (1000 * 60 * 60)
|
|
316
|
+
// const actualHours = Math.round(hoursDiff * 100) / 100
|
|
317
|
+
// if ( \$value> actualHours) {
|
|
318
|
+
// return new Error(\`不得超过\${actualHours}小时\`)
|
|
319
|
+
// }
|
|
320
|
+
// return true
|
|
321
|
+
// }
|
|
322
|
+
// }}`
|
|
323
|
+
// }
|
|
324
|
+
// ]
|
|
325
|
+
// }
|
|
326
|
+
// }
|
|
327
|
+
// }
|
|
328
|
+
// },
|
|
329
|
+
// total: {
|
|
330
|
+
// 'type': valueTypeMap.number,
|
|
331
|
+
// 'title': '总时长',
|
|
332
|
+
// 'name': 'total',
|
|
333
|
+
// 'x-component': 'InputNumber',
|
|
334
|
+
// 'x-component-props': {
|
|
335
|
+
// placeholder: '请输入'
|
|
336
|
+
// },
|
|
337
|
+
// 'x-reactions': {
|
|
338
|
+
// dependencies: [
|
|
339
|
+
// {
|
|
340
|
+
// property: 'value',
|
|
341
|
+
// type: 'string',
|
|
342
|
+
// source: '.details',
|
|
343
|
+
// name: 'details'
|
|
344
|
+
// }
|
|
345
|
+
// ],
|
|
346
|
+
// fulfill: {
|
|
347
|
+
// state: {
|
|
348
|
+
// value: '{{$deps.details.reduce((acc, cur) => acc + cur.hours, 0)}}'
|
|
349
|
+
// }
|
|
350
|
+
// }
|
|
351
|
+
// }
|
|
352
|
+
// }
|
|
353
|
+
// }
|
|
347
354
|
}
|
|
348
355
|
}
|
|
356
|
+
// {
|
|
357
|
+
// name: '请假模版',
|
|
358
|
+
// key: 'liveTime',
|
|
359
|
+
// icon: 'form-kit-liveTime',
|
|
360
|
+
// schema: {
|
|
361
|
+
// 'title': '请假模版',
|
|
362
|
+
// 'key': 'k-liveTime',
|
|
363
|
+
// 'type': valueTypeMap.object,
|
|
364
|
+
// 'name': 'liveTime',
|
|
365
|
+
// 'id': 'liveTime',
|
|
366
|
+
// 'x-design-props': {
|
|
367
|
+
// validate: {
|
|
368
|
+
// status: '',
|
|
369
|
+
// message: ''
|
|
370
|
+
// }
|
|
371
|
+
// },
|
|
372
|
+
// 'properties': {
|
|
373
|
+
// details: {
|
|
374
|
+
// 'type': valueTypeMap.array,
|
|
375
|
+
// 'title': '加班明细',
|
|
376
|
+
// 'x-component': 'ArrayCard',
|
|
377
|
+
// 'x-decorator': 'Void',
|
|
378
|
+
// 'name': 'details',
|
|
379
|
+
// 'items': {
|
|
380
|
+
// type: valueTypeMap.object,
|
|
381
|
+
// properties: {
|
|
382
|
+
// date: {
|
|
383
|
+
// 'type': valueTypeMap.array,
|
|
384
|
+
// 'title': '加班日期',
|
|
385
|
+
// 'format': 'date',
|
|
386
|
+
// 'items': {
|
|
387
|
+
// type: valueTypeMap.string,
|
|
388
|
+
// format: 'date'
|
|
389
|
+
// },
|
|
390
|
+
// 'name': 'date',
|
|
391
|
+
// 'x-component': 'DateRange',
|
|
392
|
+
// 'x-component-props': {
|
|
393
|
+
// valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
394
|
+
// showTime: true,
|
|
395
|
+
// placeholder: [
|
|
396
|
+
// '开始日期',
|
|
397
|
+
// '结束日期'
|
|
398
|
+
// ]
|
|
399
|
+
// }
|
|
400
|
+
// },
|
|
401
|
+
// hours: {
|
|
402
|
+
// 'type': valueTypeMap.number,
|
|
403
|
+
// 'title': '加班时长',
|
|
404
|
+
// 'name': 'hours',
|
|
405
|
+
// 'x-component': 'InputNumber',
|
|
406
|
+
// 'x-component-props': {
|
|
407
|
+
// placeholder: '请输入'
|
|
408
|
+
// }
|
|
409
|
+
// }
|
|
410
|
+
// }
|
|
411
|
+
// }
|
|
412
|
+
// },
|
|
413
|
+
// total: {
|
|
414
|
+
// 'type': valueTypeMap.number,
|
|
415
|
+
// 'title': '总时长',
|
|
416
|
+
// 'name': 'total',
|
|
417
|
+
// 'x-component': 'InputNumber',
|
|
418
|
+
// 'x-component-props': {
|
|
419
|
+
// placeholder: '请输入'
|
|
420
|
+
// }
|
|
421
|
+
// }
|
|
422
|
+
// }
|
|
423
|
+
// }
|
|
424
|
+
// }
|
|
349
425
|
];
|
|
350
426
|
export {
|
|
351
427
|
r as BaseSchema,
|
|
@@ -1,79 +1,58 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as
|
|
5
|
-
import { uid as
|
|
6
|
-
import { Field as
|
|
7
|
-
class
|
|
1
|
+
var l = Object.defineProperty;
|
|
2
|
+
var a = (s, e, t) => e in s ? l(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var n = (s, e, t) => a(s, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { ref as h, toRaw as m } from "vue";
|
|
5
|
+
import { uid as c } from "@king-one/utils";
|
|
6
|
+
import { Field as d } from "./Field.mjs";
|
|
7
|
+
class g {
|
|
8
8
|
constructor() {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
n(this, "version", "1.0.0");
|
|
10
|
+
n(this, "fields", h([]));
|
|
11
11
|
}
|
|
12
12
|
getSchema() {
|
|
13
|
-
const
|
|
14
|
-
console.log(t, "s");
|
|
15
|
-
const s = this.jsonToschema(t);
|
|
13
|
+
const e = m(this.fields.value), t = this.jsonToSchema(e);
|
|
16
14
|
return {
|
|
17
15
|
version: this.version,
|
|
18
16
|
form: {
|
|
19
|
-
schema:
|
|
17
|
+
schema: t
|
|
20
18
|
}
|
|
21
19
|
};
|
|
22
20
|
}
|
|
23
21
|
getFieldList() {
|
|
24
|
-
return this.fields.value.map((
|
|
22
|
+
return this.fields.value.map((e) => new d(e));
|
|
25
23
|
}
|
|
26
24
|
clearFields() {
|
|
27
25
|
return this.fields.value = [];
|
|
28
26
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
...
|
|
37
|
-
properties: this.
|
|
38
|
-
} :
|
|
39
|
-
...
|
|
40
|
-
|
|
27
|
+
setFields(e) {
|
|
28
|
+
this.fields.value = e;
|
|
29
|
+
}
|
|
30
|
+
jsonToSchema(e, t = {}) {
|
|
31
|
+
return e.forEach((o) => {
|
|
32
|
+
const i = this.omit(o, ["children"]), r = o.children || [];
|
|
33
|
+
i.type === "object" && r.length ? t[i.name] = {
|
|
34
|
+
...i,
|
|
35
|
+
properties: this.jsonToSchema(r)
|
|
36
|
+
} : i.type === "void" && r.length ? t[i.name] = {
|
|
37
|
+
...i,
|
|
38
|
+
properties: this.jsonToSchema(r)
|
|
39
|
+
} : i.type === "array" && r.length ? t[i.name] = {
|
|
40
|
+
...i,
|
|
41
|
+
items: i.items || {
|
|
41
42
|
type: "object",
|
|
42
|
-
id:
|
|
43
|
-
properties: this.
|
|
43
|
+
id: c(),
|
|
44
|
+
properties: this.jsonToSchema(r)
|
|
44
45
|
}
|
|
45
|
-
} :
|
|
46
|
-
}),
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 将 schema 对象格式还原为数组格式
|
|
50
|
-
* @param schema schema 对象
|
|
51
|
-
* @returns FieldSchema[] 数组格式
|
|
52
|
-
*/
|
|
53
|
-
schemaToJson(t) {
|
|
54
|
-
const s = [];
|
|
55
|
-
return Object.keys(t).forEach((i) => {
|
|
56
|
-
var h;
|
|
57
|
-
const e = t[i], o = e["x-design-props"], l = o == null ? void 0 : o["convert-key"], p = o == null ? void 0 : o["convert-type"];
|
|
58
|
-
if (!l || !p) {
|
|
59
|
-
s.push(e);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const n = this.omit(e, ["properties", "items"]);
|
|
63
|
-
e.type === "object" || e.type === "void" ? n.children = e.properties ? this.schemaToJson(e.properties) : [] : e.type === "array" && ((h = e.items) != null && h.properties) && (n.children = this.schemaToJson(e.items.properties)), s.push(n);
|
|
64
|
-
}), s;
|
|
46
|
+
} : t[i.name] = i;
|
|
47
|
+
}), t;
|
|
65
48
|
}
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const i = { ...t };
|
|
72
|
-
return s.forEach((e) => {
|
|
73
|
-
delete i[e];
|
|
74
|
-
}), i;
|
|
49
|
+
omit(e, t) {
|
|
50
|
+
const o = { ...e };
|
|
51
|
+
return t.forEach((i) => {
|
|
52
|
+
delete o[i];
|
|
53
|
+
}), o;
|
|
75
54
|
}
|
|
76
55
|
}
|
|
77
56
|
export {
|
|
78
|
-
|
|
57
|
+
g as FormSchema
|
|
79
58
|
};
|
package/dist/es/src/index.mjs
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import "./components/base/Carousel.vue2.mjs";
|
|
2
2
|
import "./components/panel/panel-item.vue2.mjs";
|
|
3
|
-
import { useInjectDesignContext as
|
|
4
|
-
import { default as
|
|
5
|
-
import { CreateFormDesign as
|
|
3
|
+
import { useInjectDesignContext as i } from "./context/design.mjs";
|
|
4
|
+
import { default as p } from "./components/form-desgin.mjs";
|
|
5
|
+
import { CreateFormDesign as x } from "./core/index.mjs";
|
|
6
6
|
import "./components/index.mjs";
|
|
7
|
-
import { BaseSchema as
|
|
8
|
-
import { onDesignFieldChange as
|
|
7
|
+
import { BaseSchema as g, ExtendSchema as c, LayoutSchema as h, tempSchema as D } from "./config/index.mjs";
|
|
8
|
+
import { onDesignFieldChange as d, onDesignInit as u } from "./effects/onEffects.mjs";
|
|
9
|
+
import "./utils/index.mjs";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
|
19
20
|
};
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { getType as s, isArr as
|
|
2
|
-
import { debounce as
|
|
1
|
+
import { getType as s, isArr as o, isBool as r, isFn as t, isHTMLElement as m, isMap as a, isNum as p, isNumberLike as n, isObj as b, isPlainObj as l, isReactElement as x, isRegExp as S, isSet as c, isStr as f, isWeakMap as j, isWeakSet as k } from "./checkers.mjs";
|
|
2
|
+
import { debounce as E } from "./debounce.mjs";
|
|
3
|
+
import { jsonToSchema as T } from "./schema.mjs";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
+
E as debounce,
|
|
5
6
|
s as getType,
|
|
6
|
-
|
|
7
|
+
o as isArr,
|
|
7
8
|
r as isBool,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
t as isFn,
|
|
10
|
+
m as isHTMLElement,
|
|
11
|
+
a as isMap,
|
|
11
12
|
p as isNum,
|
|
12
13
|
n as isNumberLike,
|
|
13
14
|
b as isObj,
|
|
14
15
|
l as isPlainObj,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
x as isReactElement,
|
|
17
|
+
S as isRegExp,
|
|
18
|
+
c as isSet,
|
|
19
|
+
f as isStr,
|
|
20
|
+
j as isWeakMap,
|
|
21
|
+
k as isWeakSet,
|
|
22
|
+
T as jsonToSchema
|
|
21
23
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { uid as p } from "@king-one/utils";
|
|
2
|
+
function l(o, t) {
|
|
3
|
+
const n = { ...o };
|
|
4
|
+
return t.forEach((e) => {
|
|
5
|
+
delete n[e];
|
|
6
|
+
}), n;
|
|
7
|
+
}
|
|
8
|
+
function i(o, t = {}) {
|
|
9
|
+
return o.forEach((n) => {
|
|
10
|
+
const e = l(n, ["children"]), r = n.children || [];
|
|
11
|
+
e.type === "object" && r.length ? t[e.name] = {
|
|
12
|
+
...e,
|
|
13
|
+
properties: i(r)
|
|
14
|
+
} : e.type === "void" && r.length ? t[e.name] = {
|
|
15
|
+
...e,
|
|
16
|
+
properties: i(r)
|
|
17
|
+
} : e.type === "array" && r.length ? t[e.name] = {
|
|
18
|
+
...e,
|
|
19
|
+
items: e.items || {
|
|
20
|
+
type: "object",
|
|
21
|
+
id: p(),
|
|
22
|
+
properties: i(r)
|
|
23
|
+
}
|
|
24
|
+
} : t[e.name] = e;
|
|
25
|
+
}), t;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
i as jsonToSchema
|
|
29
|
+
};
|