@form-create/element-ui 3.0.1 → 3.1.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.
@@ -1,19 +1,24 @@
1
1
  /*!
2
- * @form-create/element-ui v3.0.1
2
+ * @form-create/element-ui v3.1.2
3
3
  * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
6
6
  */
7
- import { defineComponent, toRefs, inject, ref, toRef, watch, resolveComponent, createVNode, mergeProps as mergeProps$1, isVNode, nextTick, markRaw, reactive, getCurrentInstance, provide, onMounted, onBeforeUnmount, onUpdated, computed, customRef, withDirectives, resolveDirective, createApp, h } from 'vue';
7
+ import { defineComponent, toRef, resolveComponent, createVNode, mergeProps as mergeProps$1, openBlock, createElementBlock, createElementVNode, isVNode, nextTick, Fragment, markRaw, reactive, getCurrentInstance, provide, inject, toRefs, onMounted, onBeforeUnmount, onUpdated, watch, computed, customRef, withDirectives, resolveDirective, createApp, h, ref } from 'vue';
8
8
 
9
9
  function ownKeys(object, enumerableOnly) {
10
10
  var keys = Object.keys(object);
11
11
 
12
12
  if (Object.getOwnPropertySymbols) {
13
13
  var symbols = Object.getOwnPropertySymbols(object);
14
- enumerableOnly && (symbols = symbols.filter(function (sym) {
15
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
16
- })), keys.push.apply(keys, symbols);
14
+
15
+ if (enumerableOnly) {
16
+ symbols = symbols.filter(function (sym) {
17
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
18
+ });
19
+ }
20
+
21
+ keys.push.apply(keys, symbols);
17
22
  }
18
23
 
19
24
  return keys;
@@ -21,12 +26,19 @@ function ownKeys(object, enumerableOnly) {
21
26
 
22
27
  function _objectSpread2(target) {
23
28
  for (var i = 1; i < arguments.length; i++) {
24
- var source = null != arguments[i] ? arguments[i] : {};
25
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
26
- _defineProperty(target, key, source[key]);
27
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
28
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
29
- });
29
+ var source = arguments[i] != null ? arguments[i] : {};
30
+
31
+ if (i % 2) {
32
+ ownKeys(Object(source), true).forEach(function (key) {
33
+ _defineProperty(target, key, source[key]);
34
+ });
35
+ } else if (Object.getOwnPropertyDescriptors) {
36
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
37
+ } else {
38
+ ownKeys(Object(source)).forEach(function (key) {
39
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
40
+ });
41
+ }
30
42
  }
31
43
 
32
44
  return target;
@@ -35,11 +47,17 @@ function _objectSpread2(target) {
35
47
  function _typeof(obj) {
36
48
  "@babel/helpers - typeof";
37
49
 
38
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
39
- return typeof obj;
40
- } : function (obj) {
41
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
42
- }, _typeof(obj);
50
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
51
+ _typeof = function (obj) {
52
+ return typeof obj;
53
+ };
54
+ } else {
55
+ _typeof = function (obj) {
56
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
57
+ };
58
+ }
59
+
60
+ return _typeof(obj);
43
61
  }
44
62
 
45
63
  function _classCallCheck(instance, Constructor) {
@@ -48,25 +66,6 @@ function _classCallCheck(instance, Constructor) {
48
66
  }
49
67
  }
50
68
 
51
- function _defineProperties(target, props) {
52
- for (var i = 0; i < props.length; i++) {
53
- var descriptor = props[i];
54
- descriptor.enumerable = descriptor.enumerable || false;
55
- descriptor.configurable = true;
56
- if ("value" in descriptor) descriptor.writable = true;
57
- Object.defineProperty(target, descriptor.key, descriptor);
58
- }
59
- }
60
-
61
- function _createClass(Constructor, protoProps, staticProps) {
62
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
63
- if (staticProps) _defineProperties(Constructor, staticProps);
64
- Object.defineProperty(Constructor, "prototype", {
65
- writable: false
66
- });
67
- return Constructor;
68
- }
69
-
70
69
  function _defineProperty(obj, key, value) {
71
70
  if (key in obj) {
72
71
  Object.defineProperty(obj, key, {
@@ -94,9 +93,6 @@ function _inherits(subClass, superClass) {
94
93
  configurable: true
95
94
  }
96
95
  });
97
- Object.defineProperty(subClass, "prototype", {
98
- writable: false
99
- });
100
96
  if (superClass) _setPrototypeOf(subClass, superClass);
101
97
  }
102
98
 
@@ -209,11 +205,12 @@ function getSlot(slots, exclude) {
209
205
  }, []);
210
206
  }
211
207
 
212
- var NAME$a = 'fcCheckbox';
208
+ var NAME$9 = 'fcCheckbox';
213
209
  var Checkbox = defineComponent({
214
- name: NAME$a,
210
+ name: NAME$9,
215
211
  inheritAttrs: false,
216
212
  props: {
213
+ formCreateInject: Object,
217
214
  modelValue: {
218
215
  type: Array,
219
216
  "default": function _default() {
@@ -224,51 +221,21 @@ var Checkbox = defineComponent({
224
221
  },
225
222
  emits: ['update:modelValue'],
226
223
  setup: function setup(props, _) {
227
- var _toRefs = toRefs(inject('formCreateInject')),
228
- options = _toRefs.options;
229
-
230
- var trueValue = ref([]);
224
+ var options = toRef(props.formCreateInject, 'options', []);
231
225
  var value = toRef(props, 'modelValue');
232
226
 
233
227
  var _options = function _options() {
234
228
  return Array.isArray(options.value) ? options.value : [];
235
229
  };
236
230
 
237
- var update = function update() {
238
- trueValue.value = value.value ? _options().filter(function (opt) {
239
- return value.value.indexOf(opt.value) !== -1;
240
- }).map(function (option) {
241
- return option.label;
242
- }) : [];
243
- };
244
-
245
- watch(options, function () {
246
- update();
247
- }, {
248
- deep: true,
249
- immediate: true
250
- });
251
231
  return {
252
232
  options: _options,
253
- trueValue: trueValue,
254
233
  value: value,
255
234
  onInput: function onInput(n) {
256
- _.emit('update:modelValue', _options().filter(function (opt) {
257
- return n.indexOf(opt.label) !== -1;
258
- }).map(function (opt) {
259
- return opt.value;
260
- }).filter(function (v) {
261
- return v !== undefined;
262
- }));
263
- },
264
- update: update
235
+ _.emit('update:modelValue', n);
236
+ }
265
237
  };
266
238
  },
267
- watch: {
268
- modelValue: function modelValue() {
269
- this.update();
270
- }
271
- },
272
239
  render: function render() {
273
240
  var _this$$slots$default,
274
241
  _this$$slots,
@@ -277,17 +244,23 @@ var Checkbox = defineComponent({
277
244
  var name = this.type === 'button' ? 'ElCheckboxButton' : 'ElCheckbox';
278
245
  var Type = resolveComponent(name);
279
246
  return createVNode(resolveComponent("ElCheckboxGroup"), mergeProps$1(this.$attrs, {
280
- "modelValue": this.trueValue,
247
+ "modelValue": this.value,
281
248
  "onUpdate:modelValue": this.onInput
282
249
  }), _objectSpread2({
283
250
  "default": function _default() {
284
251
  return [_this.options().map(function (opt, index) {
285
252
  var props = _objectSpread2({}, opt);
286
253
 
254
+ var value = props.value;
287
255
  delete props.value;
288
256
  return createVNode(Type, mergeProps$1(props, {
257
+ "label": value,
289
258
  "key": name + index + opt.value
290
- }), null);
259
+ }), {
260
+ "default": function _default() {
261
+ return [props.label || props.value || ''];
262
+ }
263
+ });
291
264
  }), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
292
265
  }
293
266
  }, getSlot(this.$slots, ['default'])));
@@ -369,16 +342,131 @@ function styleInject(css, ref) {
369
342
  }
370
343
  }
371
344
 
372
- var css_248z$2 = "._fc-frame .fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame .fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame .fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-frame .fc-files:hover .fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame .fc-upload-btn,.fc-files{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}";
345
+ var css_248z$2 = "._fc-frame ._fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-frame ._fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-frame ._fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-frame ._fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-frame ._fc-files:hover ._fc-upload-cover{opacity:1}._fc-frame .el-upload{display:block}._fc-frame ._fc-upload-icon{cursor:pointer}._fc-files,._fc-frame ._fc-upload-btn{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}";
373
346
  styleInject(css_248z$2);
374
347
 
348
+ var script$8 = {
349
+ name: 'IconCircleClose'
350
+ };
351
+
352
+ var _hoisted_1$8 = {
353
+ "class": "icon",
354
+ viewBox: "0 0 1024 1024",
355
+ xmlns: "http://www.w3.org/2000/svg"
356
+ };
357
+
358
+ var _hoisted_2$8 = /*#__PURE__*/createElementVNode("path", {
359
+ fill: "currentColor",
360
+ d: "M466.752 512l-90.496-90.496a32 32 0 0145.248-45.248L512 466.752l90.496-90.496a32 32 0 1145.248 45.248L557.248 512l90.496 90.496a32 32 0 11-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 01-45.248-45.248L466.752 512z"
361
+ }, null, -1);
362
+
363
+ var _hoisted_3$8 = /*#__PURE__*/createElementVNode("path", {
364
+ fill: "currentColor",
365
+ d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
366
+ }, null, -1);
367
+
368
+ var _hoisted_4$2 = [_hoisted_2$8, _hoisted_3$8];
369
+ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
370
+ return openBlock(), createElementBlock("svg", _hoisted_1$8, _hoisted_4$2);
371
+ }
372
+
373
+ script$8.render = render$8;
374
+
375
+ var script$7 = {
376
+ name: 'IconDocument'
377
+ };
378
+
379
+ var _hoisted_1$7 = {
380
+ "class": "icon",
381
+ viewBox: "0 0 1024 1024",
382
+ xmlns: "http://www.w3.org/2000/svg"
383
+ };
384
+
385
+ var _hoisted_2$7 = /*#__PURE__*/createElementVNode("path", {
386
+ fill: "currentColor",
387
+ d: "M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 01-32 32H160a32 32 0 01-32-32V96a32 32 0 0132-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"
388
+ }, null, -1);
389
+
390
+ var _hoisted_3$7 = [_hoisted_2$7];
391
+ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
392
+ return openBlock(), createElementBlock("svg", _hoisted_1$7, _hoisted_3$7);
393
+ }
394
+
395
+ script$7.render = render$7;
396
+
397
+ var script$6 = {
398
+ name: 'IconDelete'
399
+ };
400
+
401
+ var _hoisted_1$6 = {
402
+ "class": "icon",
403
+ viewBox: "0 0 1024 1024",
404
+ xmlns: "http://www.w3.org/2000/svg"
405
+ };
406
+
407
+ var _hoisted_2$6 = /*#__PURE__*/createElementVNode("path", {
408
+ fill: "currentColor",
409
+ d: "M160 256H96a32 32 0 010-64h256V95.936a32 32 0 0132-32h256a32 32 0 0132 32V192h256a32 32 0 110 64h-64v672a32 32 0 01-32 32H192a32 32 0 01-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32zm192 0a32 32 0 01-32-32V416a32 32 0 0164 0v320a32 32 0 01-32 32z"
410
+ }, null, -1);
411
+
412
+ var _hoisted_3$6 = [_hoisted_2$6];
413
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
414
+ return openBlock(), createElementBlock("svg", _hoisted_1$6, _hoisted_3$6);
415
+ }
416
+
417
+ script$6.render = render$6;
418
+
419
+ var script$5 = {
420
+ name: 'IconView'
421
+ };
422
+
423
+ var _hoisted_1$5 = {
424
+ "class": "icon",
425
+ viewBox: "0 0 1024 1024",
426
+ xmlns: "http://www.w3.org/2000/svg"
427
+ };
428
+
429
+ var _hoisted_2$5 = /*#__PURE__*/createElementVNode("path", {
430
+ fill: "currentColor",
431
+ d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 110 448 224 224 0 010-448zm0 64a160.192 160.192 0 00-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"
432
+ }, null, -1);
433
+
434
+ var _hoisted_3$5 = [_hoisted_2$5];
435
+ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
436
+ return openBlock(), createElementBlock("svg", _hoisted_1$5, _hoisted_3$5);
437
+ }
438
+
439
+ script$5.render = render$5;
440
+
441
+ var script$4 = {
442
+ name: 'IconFolderOpened'
443
+ };
444
+
445
+ var _hoisted_1$4 = {
446
+ "class": "icon",
447
+ viewBox: "0 0 1024 1024",
448
+ xmlns: "http://www.w3.org/2000/svg"
449
+ };
450
+
451
+ var _hoisted_2$4 = /*#__PURE__*/createElementVNode("path", {
452
+ fill: "currentColor",
453
+ d: "M878.08 448H241.92l-96 384h636.16l96-384zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 01216.96 384H832zm-24.96 512H96a32 32 0 01-32-32V160a32 32 0 0132-32h287.872l128.384 128H864a32 32 0 0132 32v96h23.04a32 32 0 0131.04 39.744l-112 448A32 32 0 01807.04 896z"
454
+ }, null, -1);
455
+
456
+ var _hoisted_3$4 = [_hoisted_2$4];
457
+ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
458
+ return openBlock(), createElementBlock("svg", _hoisted_1$4, _hoisted_3$4);
459
+ }
460
+
461
+ script$4.render = render$4;
462
+
375
463
  function _isSlot$1(s) {
376
464
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
377
465
  }
378
466
 
379
- var NAME$9 = 'fcFrame';
467
+ var NAME$8 = 'fcFrame';
380
468
  var Frame = defineComponent({
381
- name: NAME$9,
469
+ name: NAME$8,
382
470
  props: {
383
471
  type: {
384
472
  type: String,
@@ -399,7 +487,7 @@ var Frame = defineComponent({
399
487
  },
400
488
  icon: {
401
489
  type: String,
402
- "default": 'el-icon-upload2'
490
+ "default": 'IconFolderOpened'
403
491
  },
404
492
  width: {
405
493
  type: String,
@@ -422,7 +510,10 @@ var Frame = defineComponent({
422
510
  "default": '关闭'
423
511
  },
424
512
  modalTitle: String,
425
- handleIcon: [String, Boolean],
513
+ handleIcon: {
514
+ type: [String, Boolean],
515
+ "default": undefined
516
+ },
426
517
  title: String,
427
518
  allowRemove: {
428
519
  type: Boolean,
@@ -477,10 +568,14 @@ var Frame = defineComponent({
477
568
  okBtn: {
478
569
  type: Boolean,
479
570
  "default": true
480
- }
571
+ },
572
+ formCreateInject: Object
481
573
  },
482
- inject: ['formCreateInject'],
483
574
  emits: ['update:modelValue', 'change'],
575
+ components: {
576
+ IconFolderOpened: script$4,
577
+ IconView: script$5
578
+ },
484
579
  data: function data() {
485
580
  return {
486
581
  fileList: toArray(this.modelValue),
@@ -496,9 +591,6 @@ var Frame = defineComponent({
496
591
  }
497
592
  },
498
593
  methods: {
499
- key: function key(unique) {
500
- return unique;
501
- },
502
594
  close: function close() {
503
595
  this.closeModel(true);
504
596
  },
@@ -538,25 +630,29 @@ var Frame = defineComponent({
538
630
  }).toString(),
539
631
  readonly: true
540
632
  }, {
541
- "key": this.key('input')
633
+ "key": 1
542
634
  }), {
543
635
  append: function append() {
544
636
  return createVNode(resolveComponent("ElButton"), {
545
- "icon": _this.icon,
637
+ "icon": resolveComponent(_this.icon),
546
638
  "onClick": function onClick() {
547
639
  return _this.showModel();
548
640
  }
549
641
  }, null);
550
642
  },
551
643
  suffix: function suffix() {
552
- return _this.fileList.length ? createVNode("i", {
553
- "class": "el-input__icon el-icon-circle-close",
644
+ return _this.fileList.length ? createVNode(resolveComponent("ElIcon"), {
645
+ "class": "el-input__icon _fc-upload-icon",
554
646
  "onClick": function onClick() {
555
647
  _this.fileList = [];
556
648
 
557
649
  _this.input();
558
650
  }
559
- }, null) : null;
651
+ }, {
652
+ "default": function _default() {
653
+ return [createVNode(script$8, null, null)];
654
+ }
655
+ }) : null;
560
656
  }
561
657
  });
562
658
  },
@@ -566,13 +662,13 @@ var Frame = defineComponent({
566
662
  }
567
663
 
568
664
  return createVNode("div", {
569
- "key": this.key('group')
665
+ "key": 2
570
666
  }, [children]);
571
667
  },
572
668
  makeItem: function makeItem(index, children) {
573
669
  return createVNode("div", {
574
- "class": "fc-files",
575
- "key": this.key('file' + index)
670
+ "class": "_fc-files",
671
+ "key": '3' + index
576
672
  }, [children]);
577
673
  },
578
674
  valid: function valid(f) {
@@ -595,43 +691,53 @@ var Frame = defineComponent({
595
691
  }
596
692
 
597
693
  return createVNode("div", {
598
- "class": "fc-upload-cover",
599
- "key": this.key('uc')
694
+ "class": "_fc-upload-cover",
695
+ "key": 4
600
696
  }, [icons]);
601
697
  }
602
698
  },
603
699
  makeHandleIcon: function makeHandleIcon(val, index) {
604
700
  var _this2 = this;
605
701
 
606
- return createVNode("i", {
607
- "class": this.handleIcon === true || this.handleIcon === undefined ? 'el-icon-view' : this.handleIcon,
702
+ var Type = resolveComponent(this.handleIcon === true || this.handleIcon === undefined ? 'icon-view' : this.handleIcon);
703
+ return createVNode(resolveComponent("ElIcon"), {
608
704
  "onClick": function onClick() {
609
705
  return _this2.handleClick(val);
610
706
  },
611
- "key": this.key('hi' + index)
612
- }, null);
707
+ "key": '5' + index
708
+ }, {
709
+ "default": function _default() {
710
+ return [createVNode(Type, null, null)];
711
+ }
712
+ });
613
713
  },
614
714
  makeRemoveIcon: function makeRemoveIcon(val, index) {
615
715
  var _this3 = this;
616
716
 
617
- return createVNode("i", {
618
- "class": "el-icon-delete",
717
+ return createVNode(resolveComponent("ElIcon"), {
619
718
  "onClick": function onClick() {
620
719
  return _this3.handleRemove(val);
621
720
  },
622
- "key": this.key('ri' + index)
623
- }, null);
721
+ "key": '6' + index
722
+ }, {
723
+ "default": function _default() {
724
+ return [createVNode(script$6, null, null)];
725
+ }
726
+ });
624
727
  },
625
728
  makeFiles: function makeFiles() {
626
729
  var _this4 = this;
627
730
 
628
731
  return this.makeGroup(this.fileList.map(function (src, index) {
629
- return _this4.makeItem(index, [createVNode("i", {
630
- "class": "el-icon-tickets",
732
+ return _this4.makeItem(index, [createVNode(resolveComponent("ElIcon"), {
631
733
  "onClick": function onClick() {
632
734
  return _this4.handleClick(src);
633
735
  }
634
- }, null), _this4.makeIcons(src, index)]);
736
+ }, {
737
+ "default": function _default() {
738
+ return [createVNode(script$7, null, null)];
739
+ }
740
+ }), _this4.makeIcons(src, index)]);
635
741
  }));
636
742
  },
637
743
  makeImages: function makeImages() {
@@ -646,15 +752,18 @@ var Frame = defineComponent({
646
752
  makeBtn: function makeBtn() {
647
753
  var _this6 = this;
648
754
 
755
+ var Type = resolveComponent(this.icon);
649
756
  return createVNode("div", {
650
- "class": "fc-upload-btn",
757
+ "class": "_fc-upload-btn",
651
758
  "onClick": function onClick() {
652
759
  return _this6.showModel();
653
760
  },
654
- "key": this.key('btn')
655
- }, [createVNode("i", {
656
- "class": this.icon
657
- }, null)]);
761
+ "key": 7
762
+ }, [createVNode(resolveComponent("ElIcon"), null, {
763
+ "default": function _default() {
764
+ return [createVNode(Type, null, null)];
765
+ }
766
+ })]);
658
767
  },
659
768
  handleClick: function handleClick(src) {
660
769
  if (this.onHandle) {
@@ -805,7 +914,7 @@ var Frame = defineComponent({
805
914
  "src": src,
806
915
  "frameBorder": "0",
807
916
  "style": {
808
- 'height': height,
917
+ height: height,
809
918
  'border': '0 none',
810
919
  'width': '100%'
811
920
  }
@@ -834,11 +943,12 @@ var Frame = defineComponent({
834
943
  }
835
944
  });
836
945
 
837
- var NAME$8 = 'fcRadio';
946
+ var NAME$7 = 'fcRadio';
838
947
  var Radio = defineComponent({
839
- name: NAME$8,
948
+ name: NAME$7,
840
949
  inheritAttrs: false,
841
950
  props: {
951
+ formCreateInject: Object,
842
952
  modelValue: {
843
953
  type: [String, Number, Boolean],
844
954
  "default": ''
@@ -847,49 +957,21 @@ var Radio = defineComponent({
847
957
  },
848
958
  emits: ['update:modelValue'],
849
959
  setup: function setup(props, _) {
850
- var _toRefs = toRefs(inject('formCreateInject')),
851
- options = _toRefs.options;
852
-
853
- var trueValue = ref([]);
960
+ var options = toRef(props.formCreateInject, 'options', []);
854
961
  var value = toRef(props, 'modelValue');
855
962
 
856
963
  var _options = function _options() {
857
964
  return Array.isArray(options.value) ? options.value : [];
858
965
  };
859
966
 
860
- var update = function update() {
861
- trueValue.value = _options().filter(function (opt) {
862
- return opt.value === value.value;
863
- }).reduce(function (initial, opt) {
864
- return opt.label;
865
- }, '');
866
- };
867
-
868
- watch(options, function () {
869
- update();
870
- }, {
871
- deep: true,
872
- immediate: true
873
- });
874
967
  return {
875
968
  options: _options,
876
- trueValue: trueValue,
877
969
  value: value,
878
970
  onInput: function onInput(n) {
879
- _.emit('update:modelValue', _options().filter(function (opt) {
880
- return opt.label === n;
881
- }).reduce(function (initial, opt) {
882
- return opt.value;
883
- }, ''));
884
- },
885
- update: update
971
+ _.emit('update:modelValue', n);
972
+ }
886
973
  };
887
974
  },
888
- watch: {
889
- modelValue: function modelValue() {
890
- this.update();
891
- }
892
- },
893
975
  render: function render() {
894
976
  var _this$$slots$default,
895
977
  _this$$slots,
@@ -898,28 +980,35 @@ var Radio = defineComponent({
898
980
  var name = this.type === 'button' ? 'ElRadioButton' : 'ElRadio';
899
981
  var Type = resolveComponent(name);
900
982
  return createVNode(resolveComponent("ElRadioGroup"), mergeProps$1(this.$attrs, {
901
- "modelValue": this.trueValue,
983
+ "modelValue": this.value,
902
984
  "onUpdate:modelValue": this.onInput
903
985
  }), _objectSpread2({
904
986
  "default": function _default() {
905
987
  return [_this.options().map(function (opt, index) {
906
988
  var props = _objectSpread2({}, opt);
907
989
 
990
+ var value = props.value;
908
991
  delete props.value;
909
992
  return createVNode(Type, mergeProps$1(props, {
993
+ "label": value,
910
994
  "key": name + index + opt.value
911
- }), null);
995
+ }), {
996
+ "default": function _default() {
997
+ return [props.label || props.value || ''];
998
+ }
999
+ });
912
1000
  }), (_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)];
913
1001
  }
914
1002
  }, getSlot(this.$slots, ['default'])));
915
1003
  }
916
1004
  });
917
1005
 
918
- var NAME$7 = 'fcSelect';
1006
+ var NAME$6 = 'fcSelect';
919
1007
  var Select = defineComponent({
920
- name: NAME$7,
1008
+ name: NAME$6,
921
1009
  inheritAttrs: false,
922
1010
  props: {
1011
+ formCreateInject: Object,
923
1012
  modelValue: {
924
1013
  type: [Array, String, Number, Boolean, Object],
925
1014
  "default": undefined
@@ -928,9 +1017,7 @@ var Select = defineComponent({
928
1017
  },
929
1018
  emits: ['update:modelValue'],
930
1019
  setup: function setup(props) {
931
- var _toRefs = toRefs(inject('formCreateInject')),
932
- options = _toRefs.options;
933
-
1020
+ var options = toRef(props.formCreateInject, 'options', []);
934
1021
  var value = toRef(props, 'modelValue');
935
1022
 
936
1023
  var _options = function _options() {
@@ -964,9 +1051,9 @@ var Select = defineComponent({
964
1051
  }
965
1052
  });
966
1053
 
967
- var NAME$6 = 'fcTree';
1054
+ var NAME$5 = 'fcTree';
968
1055
  var Tree = defineComponent({
969
- name: NAME$6,
1056
+ name: NAME$5,
970
1057
  inheritAttrs: false,
971
1058
  formCreateParser: {
972
1059
  mergeProp: function mergeProp(ctx) {
@@ -1028,9 +1115,31 @@ var Tree = defineComponent({
1028
1115
  }
1029
1116
  });
1030
1117
 
1031
- var css_248z$1 = "._fc-upload .fc-files img{display:inline-block;height:100%;vertical-align:top;width:100%}._fc-upload .fc-upload-btn{border:1px dashed #c0ccda;cursor:pointer}._fc-upload .fc-upload-cover{background:rgba(0,0,0,.6);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;-webkit-transition:opacity .3s;-o-transition:opacity .3s;transition:opacity .3s}._fc-upload .fc-upload-cover i{color:#fff;cursor:pointer;font-size:20px;margin:0 2px}._fc-upload .fc-files:hover .fc-upload-cover{opacity:1}._fc-upload .el-upload{display:block}._fc-upload .fc-files,._fc-upload .fc-upload-btn{background:#fff;border:1px solid #c0ccda;border-radius:4px;-webkit-box-shadow:2px 2px 5px rgba(0,0,0,.1);box-shadow:2px 2px 5px rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;height:58px;line-height:58px;margin-right:4px;overflow:hidden;position:relative;text-align:center;width:58px}";
1118
+ var css_248z$1 = "._fc-exceed .el-upload{display:none}";
1032
1119
  styleInject(css_248z$1);
1033
1120
 
1121
+ var script$3 = {
1122
+ name: 'IconUpload'
1123
+ };
1124
+
1125
+ var _hoisted_1$3 = {
1126
+ "class": "icon",
1127
+ viewBox: "0 0 1024 1024",
1128
+ xmlns: "http://www.w3.org/2000/svg"
1129
+ };
1130
+
1131
+ var _hoisted_2$3 = /*#__PURE__*/createElementVNode("path", {
1132
+ fill: "currentColor",
1133
+ d: "M160 832h704a32 32 0 110 64H160a32 32 0 110-64zm384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248L544 253.696z"
1134
+ }, null, -1);
1135
+
1136
+ var _hoisted_3$3 = [_hoisted_2$3];
1137
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
1138
+ return openBlock(), createElementBlock("svg", _hoisted_1$3, _hoisted_3$3);
1139
+ }
1140
+
1141
+ script$3.render = render$3;
1142
+
1034
1143
  function parseFile(file, i) {
1035
1144
  return {
1036
1145
  url: file,
@@ -1043,37 +1152,21 @@ function getFileName(file) {
1043
1152
  return ('' + file).split('/').pop();
1044
1153
  }
1045
1154
 
1046
- var NAME$5 = 'fcUpload';
1155
+ var NAME$4 = 'fcUpload';
1047
1156
  var Upload = defineComponent({
1048
- name: NAME$5,
1157
+ name: NAME$4,
1049
1158
  inheritAttrs: false,
1050
1159
  props: {
1051
- onHandle: Function,
1052
- uploadType: {
1053
- type: String,
1054
- "default": 'file'
1055
- },
1056
- limit: {
1057
- type: Number,
1058
- "default": 0
1059
- },
1060
- allowRemove: {
1061
- type: Boolean,
1062
- "default": true
1063
- },
1064
1160
  previewMask: undefined,
1065
1161
  modalTitle: String,
1066
- handleIcon: [String, Boolean],
1067
1162
  modelValue: [Array, String]
1068
1163
  },
1069
- emits: ['update:modelValue'],
1164
+ emits: ['update:modelValue', 'change', 'remove'],
1070
1165
  data: function data() {
1071
1166
  return {
1072
- uploadList: [],
1073
1167
  previewVisible: false,
1074
1168
  previewImage: '',
1075
- fileList: [],
1076
- cacheFiles: []
1169
+ fileList: []
1077
1170
  };
1078
1171
  },
1079
1172
  created: function created() {
@@ -1081,13 +1174,6 @@ var Upload = defineComponent({
1081
1174
  },
1082
1175
  watch: {
1083
1176
  modelValue: function modelValue(n) {
1084
- if (this.$refs.upload.uploadFiles.every(function (file) {
1085
- return !file.status || file.status === 'success';
1086
- })) {
1087
- this.$refs.upload.uploadFiles = toArray(n).map(parseFile);
1088
- this.uploadList = this.$refs.upload.uploadFiles;
1089
- }
1090
-
1091
1177
  this.fileList = toArray(n).map(parseFile);
1092
1178
  },
1093
1179
  limit: function limit(n, o) {
@@ -1097,141 +1183,62 @@ var Upload = defineComponent({
1097
1183
  }
1098
1184
  },
1099
1185
  methods: {
1100
- key: function key(unique) {
1101
- return unique;
1102
- },
1103
- isDisabled: function isDisabled() {
1104
- return this.$attrs.disabled === true;
1105
- },
1106
- onRemove: function onRemove(file) {
1107
- if (this.isDisabled()) {
1108
- return;
1109
- }
1110
-
1111
- this.$refs.upload.handleRemove(file);
1112
- },
1113
- handleClick: function handleClick(file) {
1114
- if (this.onHandle) {
1115
- return this.onHandle(file);
1186
+ handlePreview: function handlePreview(file) {
1187
+ if (this.onPreview) {
1188
+ this.onPreview.apply(this, arguments);
1116
1189
  } else {
1117
1190
  this.previewImage = file.url;
1118
1191
  this.previewVisible = true;
1119
1192
  }
1120
1193
  },
1121
- makeItem: function makeItem(file, index) {
1122
- return this.uploadType === 'image' ? createVNode("img", {
1123
- "src": file.url,
1124
- "key": this.key('img' + index)
1125
- }, null) : createVNode("i", {
1126
- "class": "el-icon-document",
1127
- "key": this.key('i' + index)
1128
- }, null);
1129
- },
1130
- makeRemoveIcon: function makeRemoveIcon(file, index) {
1131
- var _this = this;
1132
-
1133
- return createVNode("i", {
1134
- "class": "el-icon-delete",
1135
- "onClick": function onClick() {
1136
- return _this.onRemove(file);
1137
- },
1138
- "key": this.key('ri' + index)
1139
- }, null);
1140
- },
1141
- makeHandleIcon: function makeHandleIcon(file, index) {
1142
- var _this2 = this;
1143
-
1144
- return createVNode("i", {
1145
- "class": this.handleIcon === true || this.handleIcon === undefined ? 'el-icon-view' : this.handleIcon,
1146
- "onClick": function onClick() {
1147
- return _this2.handleClick(file);
1148
- },
1149
- "key": this.key('hi' + index)
1150
- }, null);
1151
- },
1152
- makeProgress: function makeProgress(file, index) {
1153
- return createVNode(resolveComponent("ElProgress"), mergeProps$1({
1154
- percentage: file.percentage,
1155
- type: 'circle',
1156
- width: 52
1157
- }, {
1158
- "style": "margin-top:2px;",
1159
- "key": this.key('pg' + index)
1160
- }), null);
1161
- },
1162
- makeIcons: function makeIcons(file, index) {
1163
- var icons = [];
1164
-
1165
- if (this.allowRemove || this.handleIcon !== false) {
1166
- if (this.uploadType !== 'file' && this.handleIcon !== false || this.uploadType === 'file' && this.handleIcon) {
1167
- icons.push(this.makeHandleIcon(file, index));
1168
- }
1169
-
1170
- if (this.allowRemove) {
1171
- icons.push(this.makeRemoveIcon(file, index));
1172
- }
1173
-
1174
- return createVNode("div", {
1175
- "class": "fc-upload-cover"
1176
- }, [icons]);
1177
- }
1178
- },
1179
- makeFiles: function makeFiles() {
1180
- var _this3 = this;
1181
-
1182
- return this.uploadList.map(function (file, index) {
1183
- return createVNode("div", {
1184
- "key": _this3.key(index),
1185
- "class": "fc-files"
1186
- }, [file.percentage !== undefined && file.status !== 'success' ? _this3.makeProgress(file, index) : [_this3.makeItem(file, index), _this3.makeIcons(file, index)]]);
1187
- });
1188
- },
1189
- makeUpload: function makeUpload() {
1190
- var _this$$slots$default,
1191
- _this$$slots,
1192
- _this4 = this;
1193
-
1194
- var isShow = !this.limit || this.limit > this.uploadList.length;
1195
- return createVNode(resolveComponent("ElUpload"), mergeProps$1(this.$attrs, {
1196
- "showFileList": false,
1197
- "fileList": this.fileList,
1198
- "ref": "upload",
1199
- "style": {
1200
- display: 'inline-block'
1201
- },
1202
- "key": this.key('upload')
1203
- }), _objectSpread2({
1204
- "default": function _default() {
1205
- return [isShow ? ((_this$$slots$default = (_this$$slots = _this4.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)) || createVNode("div", {
1206
- "class": "fc-upload-btn"
1207
- }, [createVNode("i", {
1208
- "class": "el-icon-upload2"
1209
- }, null)]) : undefined];
1210
- }
1211
- }, getSlot(this.$slots, ['default'])));
1212
- },
1213
- update: function update() {
1214
- var files = this.$refs.upload.uploadFiles.map(function (file) {
1194
+ update: function update(fileList) {
1195
+ var files = fileList.map(function (file) {
1215
1196
  return file.url;
1216
1197
  }).filter(function (url) {
1217
1198
  return url !== undefined;
1218
1199
  });
1219
-
1220
- if (this.cacheFiles.length !== files.length) {
1221
- this.cacheFiles = _toConsumableArray(files);
1222
- this.$emit('update:modelValue', this.limit === 1 ? files[0] || '' : files);
1223
- }
1200
+ this.$emit('update:modelValue', this.limit === 1 ? files[0] || '' : files);
1224
1201
  },
1225
1202
  handleCancel: function handleCancel() {
1226
1203
  this.previewVisible = false;
1204
+ },
1205
+ handleChange: function handleChange(file, fileList) {
1206
+ this.$emit.apply(this, ['change'].concat(Array.prototype.slice.call(arguments)));
1207
+
1208
+ if (file.status === 'success') {
1209
+ this.update(fileList);
1210
+ }
1211
+ },
1212
+ handleRemove: function handleRemove(file, fileList) {
1213
+ this.$emit.apply(this, ['remove'].concat(Array.prototype.slice.call(arguments)));
1214
+ this.update(fileList);
1227
1215
  }
1228
1216
  },
1229
1217
  render: function render() {
1230
- var _this5 = this;
1218
+ var _this$$slots$default,
1219
+ _this$$slots,
1220
+ _this = this;
1231
1221
 
1232
- return createVNode("div", {
1233
- "class": "_fc-upload"
1234
- }, [[this.$attrs.showFileList ? [] : this.makeFiles(), this.makeUpload()], createVNode(resolveComponent("ElDialog"), {
1222
+ return createVNode(Fragment, null, [createVNode(resolveComponent("ElUpload"), mergeProps$1({
1223
+ "key": this.modelValue.length,
1224
+ "list-type": "picture-card"
1225
+ }, this.$attrs, {
1226
+ "class": {
1227
+ '_fc-exceed': this.$attrs.limit ? this.$attrs.limit <= this.modelValue.length : false
1228
+ },
1229
+ "onPreview": this.handlePreview,
1230
+ "onChange": this.handleChange,
1231
+ "onRemove": this.handleRemove,
1232
+ "fileList": this.fileList
1233
+ }), _objectSpread2({
1234
+ "default": function _default() {
1235
+ return [((_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)) || createVNode(resolveComponent("ElIcon"), null, {
1236
+ "default": function _default() {
1237
+ return [createVNode(script$3, null, null)];
1238
+ }
1239
+ })];
1240
+ }
1241
+ }, getSlot(this.$slots, ['default']))), createVNode(resolveComponent("ElDialog"), {
1235
1242
  "appendToBody": true,
1236
1243
  "modal": this.previewMask,
1237
1244
  "title": this.modalTitle,
@@ -1240,24 +1247,11 @@ var Upload = defineComponent({
1240
1247
  }, {
1241
1248
  "default": function _default() {
1242
1249
  return [createVNode("img", {
1243
- "alt": "example",
1244
1250
  "style": "width: 100%",
1245
- "src": _this5.previewImage
1251
+ "src": _this.previewImage
1246
1252
  }, null)];
1247
1253
  }
1248
1254
  })]);
1249
- },
1250
- mounted: function mounted() {
1251
- var _this6 = this;
1252
-
1253
- this.uploadList = this.$refs.upload.uploadFiles;
1254
- this.$watch(function () {
1255
- return _this6.$refs.upload.uploadFiles;
1256
- }, function () {
1257
- _this6.update();
1258
- }, {
1259
- deep: true
1260
- });
1261
1255
  }
1262
1256
  });
1263
1257
 
@@ -1284,13 +1278,72 @@ function hasProperty(rule, k) {
1284
1278
  return {}.hasOwnProperty.call(rule, k);
1285
1279
  }
1286
1280
 
1281
+ var script$2 = {
1282
+ name: 'IconCirclePlus'
1283
+ };
1284
+
1285
+ var _hoisted_1$2 = {
1286
+ "class": "icon",
1287
+ viewBox: "0 0 1024 1024",
1288
+ xmlns: "http://www.w3.org/2000/svg"
1289
+ };
1290
+
1291
+ var _hoisted_2$2 = /*#__PURE__*/createElementVNode("path", {
1292
+ fill: "currentColor",
1293
+ d: "M352 480h320a32 32 0 110 64H352a32 32 0 010-64z"
1294
+ }, null, -1);
1295
+
1296
+ var _hoisted_3$2 = /*#__PURE__*/createElementVNode("path", {
1297
+ fill: "currentColor",
1298
+ d: "M480 672V352a32 32 0 1164 0v320a32 32 0 01-64 0z"
1299
+ }, null, -1);
1300
+
1301
+ var _hoisted_4$1 = /*#__PURE__*/createElementVNode("path", {
1302
+ fill: "currentColor",
1303
+ d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
1304
+ }, null, -1);
1305
+
1306
+ var _hoisted_5 = [_hoisted_2$2, _hoisted_3$2, _hoisted_4$1];
1307
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
1308
+ return openBlock(), createElementBlock("svg", _hoisted_1$2, _hoisted_5);
1309
+ }
1310
+
1311
+ script$2.render = render$2;
1312
+
1313
+ var script$1 = {
1314
+ name: 'IconRemove'
1315
+ };
1316
+
1317
+ var _hoisted_1$1 = {
1318
+ "class": "icon",
1319
+ viewBox: "0 0 1024 1024",
1320
+ xmlns: "http://www.w3.org/2000/svg"
1321
+ };
1322
+
1323
+ var _hoisted_2$1 = /*#__PURE__*/createElementVNode("path", {
1324
+ fill: "currentColor",
1325
+ d: "M352 480h320a32 32 0 110 64H352a32 32 0 010-64z"
1326
+ }, null, -1);
1327
+
1328
+ var _hoisted_3$1 = /*#__PURE__*/createElementVNode("path", {
1329
+ fill: "currentColor",
1330
+ d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
1331
+ }, null, -1);
1332
+
1333
+ var _hoisted_4 = [_hoisted_2$1, _hoisted_3$1];
1334
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1335
+ return openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_4);
1336
+ }
1337
+
1338
+ script$1.render = render$1;
1339
+
1287
1340
  function _isSlot(s) {
1288
1341
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
1289
1342
  }
1290
1343
 
1291
- var NAME$4 = 'fcGroup';
1344
+ var NAME$3 = 'fcGroup';
1292
1345
  var Group = defineComponent({
1293
- name: NAME$4,
1346
+ name: NAME$3,
1294
1347
  props: {
1295
1348
  field: String,
1296
1349
  rule: Array,
@@ -1333,9 +1386,9 @@ var Group = defineComponent({
1333
1386
  onBeforeAdd: {
1334
1387
  type: Function,
1335
1388
  "default": function _default() {}
1336
- }
1389
+ },
1390
+ formCreateInject: Object
1337
1391
  },
1338
- inject: ['formCreateInject'],
1339
1392
  data: function data() {
1340
1393
  return {
1341
1394
  len: 0,
@@ -1513,24 +1566,31 @@ var Group = defineComponent({
1513
1566
  this.input(this.modelValue);
1514
1567
  },
1515
1568
  addIcon: function addIcon(key) {
1516
- return createVNode("i", {
1569
+ return createVNode(resolveComponent("ElIcon"), {
1517
1570
  "key": "a".concat(key),
1518
- "class": "el-icon-circle-plus-outline",
1519
1571
  "style": "font-size:".concat(this.fontSize, "px;cursor:").concat(this.disabled ? 'not-allowed;color:#c9cdd4' : 'pointer', ";"),
1520
1572
  "onClick": this.add
1521
- }, null);
1573
+ }, {
1574
+ "default": function _default() {
1575
+ return [createVNode(script$2, null, null)];
1576
+ }
1577
+ });
1522
1578
  },
1523
1579
  delIcon: function delIcon(index, key) {
1524
1580
  var _this7 = this;
1525
1581
 
1526
- return createVNode("i", {
1582
+ return createVNode(resolveComponent("ElIcon"), {
1527
1583
  "key": "d".concat(key),
1528
1584
  "class": "el-icon-remove-outline",
1529
1585
  "style": "font-size:".concat(this.fontSize, "px;cursor:").concat(this.disabled ? 'not-allowed;color:#c9cdd4' : 'pointer;color:#606266', ";"),
1530
1586
  "onClick": function onClick() {
1531
1587
  return _this7.del(index, key);
1532
1588
  }
1533
- }, null);
1589
+ }, {
1590
+ "default": function _default() {
1591
+ return [createVNode(script$1, null, null)];
1592
+ }
1593
+ });
1534
1594
  },
1535
1595
  makeIcon: function makeIcon(total, index, key) {
1536
1596
  var _this8 = this;
@@ -1585,13 +1645,16 @@ var Group = defineComponent({
1585
1645
  return keys.length === 0 ? this.$slots["default"] ? this.$slots["default"]({
1586
1646
  vm: this,
1587
1647
  add: this.add
1588
- }) : createVNode("i", {
1589
- "key": 'a_def',
1590
- "class": "el-icon-circle-plus-outline",
1648
+ }) : createVNode(resolveComponent("ElIcon"), {
1649
+ "key": 1,
1591
1650
  "style": "font-size:".concat(this.fontSize, "px;vertical-align:middle;color:").concat(this.disabled ? '#c9cdd4;cursor: not-allowed' : '#606266;cursor:pointer', ";"),
1592
1651
  "onClick": this.add
1593
- }, null) : createVNode("div", {
1594
- "key": 'con'
1652
+ }, {
1653
+ "default": function _default() {
1654
+ return [createVNode(script$2, null, null)];
1655
+ }
1656
+ }) : createVNode("div", {
1657
+ "key": 2
1595
1658
  }, [keys.map(function (key, index) {
1596
1659
  var _slot;
1597
1660
 
@@ -1649,9 +1712,9 @@ var Group = defineComponent({
1649
1712
  }
1650
1713
  });
1651
1714
 
1652
- var NAME$3 = 'fcSubForm';
1715
+ var NAME$2 = 'fcSubForm';
1653
1716
  var Sub = defineComponent({
1654
- name: NAME$3,
1717
+ name: NAME$2,
1655
1718
  props: {
1656
1719
  rule: Array,
1657
1720
  options: {
@@ -1676,9 +1739,9 @@ var Sub = defineComponent({
1676
1739
  syncDisabled: {
1677
1740
  type: Boolean,
1678
1741
  "default": true
1679
- }
1742
+ },
1743
+ formCreateInject: Object
1680
1744
  },
1681
- inject: ['formCreateInject'],
1682
1745
  data: function data() {
1683
1746
  return {
1684
1747
  cacheValue: {},
@@ -1737,12 +1800,34 @@ var Sub = defineComponent({
1737
1800
  }
1738
1801
  });
1739
1802
 
1740
- var components = [Checkbox, Frame, Radio, Select, Tree, Upload, Group, Sub];
1803
+ var script = {
1804
+ name: 'IconWarning'
1805
+ };
1806
+
1807
+ var _hoisted_1 = {
1808
+ "class": "icon",
1809
+ viewBox: "0 0 1024 1024",
1810
+ xmlns: "http://www.w3.org/2000/svg"
1811
+ };
1812
+
1813
+ var _hoisted_2 = /*#__PURE__*/createElementVNode("path", {
1814
+ fill: "currentColor",
1815
+ d: "M512 64a448 448 0 110 896 448 448 0 010-896zm0 832a384 384 0 000-768 384 384 0 000 768zm48-176a48 48 0 11-96 0 48 48 0 0196 0zm-48-464a32 32 0 0132 32v288a32 32 0 01-64 0V288a32 32 0 0132-32z"
1816
+ }, null, -1);
1817
+
1818
+ var _hoisted_3 = [_hoisted_2];
1819
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
1820
+ return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_3);
1821
+ }
1822
+
1823
+ script.render = render;
1824
+
1825
+ var components = [Checkbox, Frame, Radio, Select, Tree, Upload, Group, Sub, script];
1741
1826
 
1742
- var NAME$2 = 'FormCreate';
1827
+ var NAME$1 = 'FormCreate';
1743
1828
  function $FormCreate(FormCreate) {
1744
1829
  return defineComponent({
1745
- name: NAME$2,
1830
+ name: NAME$1,
1746
1831
  props: {
1747
1832
  rule: {
1748
1833
  type: Array,
@@ -1759,7 +1844,8 @@ function $FormCreate(FormCreate) {
1759
1844
  },
1760
1845
  extendOption: Boolean,
1761
1846
  modelValue: Object,
1762
- api: Object
1847
+ api: Object,
1848
+ name: String
1763
1849
  },
1764
1850
  emits: ['update:api', 'update:modelValue', 'mounted', 'submit', 'change', 'emit-event', 'control', 'remove-rule', 'remove-field', 'sync', 'reload', 'repeat-field', 'update'],
1765
1851
  render: function render() {
@@ -1775,6 +1861,7 @@ function $FormCreate(FormCreate) {
1775
1861
  modelValue = _toRefs.modelValue;
1776
1862
 
1777
1863
  var data = reactive({
1864
+ ctxInject: {},
1778
1865
  destroyed: false,
1779
1866
  isShow: true,
1780
1867
  unique: 1,
@@ -2423,7 +2510,8 @@ function Api(h) {
2423
2510
 
2424
2511
  if (ctx) {
2425
2512
  if (child) {
2426
- rules = ctx.rule.children;
2513
+ rules = ctx.getPending('children', ctx.rule.children);
2514
+ if (!Array.isArray(rules)) return;
2427
2515
  index = ctx.rule.children.length - 1;
2428
2516
  } else {
2429
2517
  index = ctx.root.indexOf(ctx.origin);
@@ -2440,7 +2528,8 @@ function Api(h) {
2440
2528
 
2441
2529
  if (ctx) {
2442
2530
  if (child) {
2443
- rules = ctx.rule.children;
2531
+ rules = ctx.getPending('children', ctx.rule.children);
2532
+ if (!Array.isArray(rules)) return;
2444
2533
  } else {
2445
2534
  index = ctx.root.indexOf(ctx.origin);
2446
2535
  rules = ctx.root;
@@ -2744,9 +2833,9 @@ function toString(val) {
2744
2833
  return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
2745
2834
  }
2746
2835
 
2747
- var id$1 = 0;
2836
+ var id$2 = 0;
2748
2837
  function uniqueId() {
2749
- return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id$1)).toString(36);
2838
+ return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id$2)).toString(36);
2750
2839
  }
2751
2840
 
2752
2841
  function deepSet(data, idx, val) {
@@ -2809,7 +2898,7 @@ function useRender$1(Render) {
2809
2898
  ctx.initProp();
2810
2899
  this.mergeGlobal(ctx);
2811
2900
  ctx.initNone();
2812
- var slots = this.renderChildren(ctx);
2901
+ var slots = this.renderChildren(ctx.loadChildrenPending(), ctx);
2813
2902
  var def = slots["default"];
2814
2903
  def && slotBag.setSlot(ctx.rule.slot, function () {
2815
2904
  return def();
@@ -2836,8 +2925,15 @@ function useRender$1(Render) {
2836
2925
  ctx.prop = mergeRule({}, [this.cacheConfig[ctx.trueType].value, ctx.prop]);
2837
2926
  },
2838
2927
  setOptions: function setOptions(ctx) {
2839
- if (ctx.prop.optionsTo && ctx.prop.options) {
2840
- deepSet(ctx.prop, ctx.prop.optionsTo, ctx.prop.options);
2928
+ var opt = ctx.loadPending({
2929
+ key: 'options',
2930
+ origin: ctx.prop.options,
2931
+ def: []
2932
+ });
2933
+ ctx.prop.options = opt;
2934
+
2935
+ if (ctx.prop.optionsTo && opt) {
2936
+ deepSet(ctx.prop, ctx.prop.optionsTo, opt);
2841
2937
  }
2842
2938
  },
2843
2939
  deepSet: function deepSet$1(ctx) {
@@ -2866,34 +2962,37 @@ function useRender$1(Render) {
2866
2962
  renderCtx: function renderCtx(ctx, parent) {
2867
2963
  var _this4 = this;
2868
2964
 
2869
- if (ctx.type === 'hidden') return;
2870
- var rule = ctx.rule;
2871
- var preview = this.options.preview || false;
2872
-
2873
- if (!this.cache[ctx.id] || this.cache[ctx.id].slot !== rule.slot) {
2874
- var vn;
2875
- ctx.initProp();
2876
- this.mergeGlobal(ctx);
2877
- ctx.initNone();
2878
- this.$manager.tidyRule(ctx);
2879
- this.deepSet(ctx);
2880
- this.setOptions(ctx);
2881
- this.ctxProp(ctx);
2882
- var prop = ctx.prop;
2883
-
2884
- if (prop.hidden) {
2885
- this.setCache(ctx, undefined, parent);
2886
- return;
2887
- }
2965
+ try {
2966
+ if (ctx.type === 'hidden') return;
2967
+ var rule = ctx.rule;
2968
+ var preview = this.options.preview || false;
2969
+
2970
+ if (!this.cache[ctx.id] || this.cache[ctx.id].slot !== rule.slot) {
2971
+ var vn;
2972
+ ctx.initProp();
2973
+ this.mergeGlobal(ctx);
2974
+ ctx.initNone();
2975
+ this.$manager.tidyRule(ctx);
2976
+ this.deepSet(ctx);
2977
+ this.setOptions(ctx);
2978
+ this.ctxProp(ctx);
2979
+ var prop = ctx.prop;
2980
+ prop.props.formCreateInject = this.injectProp(ctx);
2981
+
2982
+ if (prop.hidden) {
2983
+ this.setCache(ctx, undefined, parent);
2984
+ return;
2985
+ }
2888
2986
 
2889
- vn = function vn() {
2890
- return _this4.item(ctx, function () {
2987
+ vn = function vn() {
2891
2988
  var children = {};
2892
2989
 
2990
+ var _load = ctx.loadChildrenPending();
2991
+
2893
2992
  if (ctx.parser.renderChildren) {
2894
- children = ctx.parser.renderChildren(ctx);
2993
+ children = ctx.parser.renderChildren(_load, ctx);
2895
2994
  } else if (ctx.parser.loadChildren !== false) {
2896
- children = _this4.renderChildren(ctx);
2995
+ children = _this4.renderChildren(_load, ctx);
2897
2996
  }
2898
2997
 
2899
2998
  var slot = _this4.getTypeSlot(ctx.type);
@@ -2923,15 +3022,22 @@ function useRender$1(Render) {
2923
3022
  _vn = _this4.display(_vn);
2924
3023
  }
2925
3024
 
3025
+ _this4.setCache(ctx, function () {
3026
+ return _vn;
3027
+ }, parent);
3028
+
2926
3029
  return _vn;
2927
- });
2928
- };
3030
+ };
2929
3031
 
2930
- this.setCache(ctx, vn, parent);
2931
- return vn;
2932
- }
3032
+ this.setCache(ctx, vn, parent);
3033
+ return vn;
3034
+ }
2933
3035
 
2934
- return this.getCache(ctx);
3036
+ return this.getCache(ctx);
3037
+ } catch (e) {
3038
+ console.error(e);
3039
+ return;
3040
+ }
2935
3041
  },
2936
3042
  getModelField: function getModelField(ctx) {
2937
3043
  return ctx.rule.modelField || ctx.parser.modelField || this.fc.modelFields[this.vNode.aliasMap[ctx.field]] || this.fc.modelFields[ctx.field] || this.fc.modelFields[ctx.originType] || 'modelValue';
@@ -2965,30 +3071,36 @@ function useRender$1(Render) {
2965
3071
  return vn;
2966
3072
  }
2967
3073
  },
2968
- item: function item(ctx, vn) {
2969
- return this.vNode.h('FcFragment', {
2970
- key: ctx.prop.key,
2971
- formCreateInject: this.injectProp(ctx)
2972
- }, vn);
2973
- },
2974
3074
  isFragment: function isFragment(ctx) {
2975
3075
  return ctx.type === 'fragment' || ctx.type === 'template';
2976
3076
  },
2977
3077
  injectProp: function injectProp(ctx) {
2978
3078
  var _this6 = this;
2979
3079
 
2980
- return {
3080
+ var state = this.vm.setupState;
3081
+
3082
+ if (!state.ctxInject[ctx.id]) {
3083
+ state.ctxInject[ctx.id] = {
3084
+ api: this.$handle.api,
3085
+ form: this.fc.create,
3086
+ subForm: function subForm(_subForm) {
3087
+ _this6.$handle.addSubForm(ctx, _subForm);
3088
+ },
3089
+ options: [],
3090
+ children: [],
3091
+ preview: false,
3092
+ field: ctx.field,
3093
+ rule: ctx.rule
3094
+ };
3095
+ }
3096
+
3097
+ var inject = state.ctxInject[ctx.id];
3098
+ extend(inject, {
2981
3099
  preview: this.options.preview || false,
2982
- api: this.$handle.api,
2983
- form: this.fc.create,
2984
- subForm: function subForm(_subForm) {
2985
- _this6.$handle.addSubForm(ctx, _subForm);
2986
- },
2987
- field: ctx.field,
2988
- options: ctx.prop.options || [],
2989
- children: ctx.rule.children,
2990
- rule: ctx.rule
2991
- };
3100
+ options: ctx.prop.options,
3101
+ children: ctx.loadChildrenPending()
3102
+ });
3103
+ return inject;
2992
3104
  },
2993
3105
  ctxProp: function ctxProp(ctx, custom) {
2994
3106
  var _this7 = this;
@@ -3032,10 +3144,9 @@ function useRender$1(Render) {
3032
3144
  onInput: function onInput(ctx, value) {
3033
3145
  this.$handle.onInput(ctx, value);
3034
3146
  },
3035
- renderChildren: function renderChildren(ctx) {
3147
+ renderChildren: function renderChildren(children, ctx) {
3036
3148
  var _this8 = this;
3037
3149
 
3038
- var children = ctx.rule.children;
3039
3150
  if (!is.trueArray(children)) return {};
3040
3151
  var slotBag = makeSlotBag();
3041
3152
  children.map(function (child) {
@@ -3101,7 +3212,7 @@ function useRender$1(Render) {
3101
3212
  });
3102
3213
  }
3103
3214
 
3104
- var id = 1;
3215
+ var id$1 = 1;
3105
3216
  function Render(handle) {
3106
3217
  extend(this, {
3107
3218
  $handle: handle,
@@ -3109,7 +3220,7 @@ function Render(handle) {
3109
3220
  vm: handle.vm,
3110
3221
  $manager: handle.$manager,
3111
3222
  vNode: new handle.fc.CreateNode(handle.vm),
3112
- id: id++
3223
+ id: id$1++
3113
3224
  });
3114
3225
  funcProxy(this, {
3115
3226
  options: function options() {
@@ -3357,6 +3468,7 @@ function RuleContext(handle, rule) {
3357
3468
  rule: rule,
3358
3469
  origin: rule.__origin__ || rule,
3359
3470
  name: rule.name,
3471
+ pending: {},
3360
3472
  none: false,
3361
3473
  watch: [],
3362
3474
  linkOn: [],
@@ -3379,6 +3491,102 @@ function RuleContext(handle, rule) {
3379
3491
  this.update(handle, true);
3380
3492
  }
3381
3493
  extend(RuleContext.prototype, {
3494
+ loadChildrenPending: function loadChildrenPending() {
3495
+ var _this = this;
3496
+
3497
+ var children = this.rule.children || [];
3498
+ if (Array.isArray(children)) return children;
3499
+ return this.loadPending({
3500
+ key: 'children',
3501
+ origin: children,
3502
+ def: [],
3503
+ onLoad: function onLoad(data) {
3504
+ _this.$handle && _this.$handle.loadChildren(data, _this);
3505
+ },
3506
+ onUpdate: function onUpdate(value, oldValue) {
3507
+ if (_this.$handle) {
3508
+ value === oldValue ? _this.$handle.loadChildren(value, _this) : _this.$handle.updateChildren(_this, value, oldValue);
3509
+ }
3510
+ },
3511
+ onReload: function onReload(value) {
3512
+ if (_this.$handle) {
3513
+ _this.$handle.updateChildren(_this, [], value);
3514
+ } else {
3515
+ delete _this.pending.children;
3516
+ }
3517
+ }
3518
+ });
3519
+ },
3520
+ loadPending: function loadPending(config) {
3521
+ var _this2 = this;
3522
+
3523
+ var key = config.key,
3524
+ origin = config.origin,
3525
+ def = config.def,
3526
+ onLoad = config.onLoad,
3527
+ onReload = config.onReload,
3528
+ onUpdate = config.onUpdate;
3529
+
3530
+ if (this.pending[key] && this.pending[key].origin === origin) {
3531
+ return this.getPending(key, def);
3532
+ }
3533
+
3534
+ delete this.pending[key];
3535
+ var value = origin;
3536
+
3537
+ if (is.Function(origin)) {
3538
+ var source = invoke(function () {
3539
+ return origin({
3540
+ rule: _this2.rule,
3541
+ api: _this2.$api,
3542
+ update: function update(data) {
3543
+ var value = data || def;
3544
+
3545
+ var oldValue = _this2.getPending(key, def);
3546
+
3547
+ _this2.setPending(key, origin, value);
3548
+
3549
+ onUpdate && onUpdate(value, oldValue);
3550
+ },
3551
+ reload: function reload() {
3552
+ var oldValue = _this2.getPending(key, def);
3553
+
3554
+ delete _this2.pending[key];
3555
+ onReload && onReload(oldValue);
3556
+ _this2.$api && _this2.$api.sync(_this2.rule);
3557
+ }
3558
+ });
3559
+ });
3560
+
3561
+ if (source && is.Function(source.then)) {
3562
+ source.then(function (data) {
3563
+ var value = data || def;
3564
+
3565
+ _this2.setPending(key, origin, value);
3566
+
3567
+ onLoad && onLoad(value);
3568
+ _this2.$api && _this2.$api.sync(_this2.rule);
3569
+ });
3570
+ value = def;
3571
+ this.setPending(key, origin, value);
3572
+ } else {
3573
+ value = source || def;
3574
+ this.setPending(key, origin, value);
3575
+ onLoad && onLoad(value);
3576
+ }
3577
+ }
3578
+
3579
+ return value;
3580
+ },
3581
+ getPending: function getPending(key, def) {
3582
+ return this.pending[key] && this.pending[key].value || def;
3583
+ },
3584
+ setPending: function setPending(key, origin, value) {
3585
+ this.pending[key] = {
3586
+ origin: origin,
3587
+ value: reactive(value)
3588
+ };
3589
+ },
3382
3590
  effectData: function effectData(name) {
3383
3591
  if (!this.payload[name]) {
3384
3592
  this.payload[name] = {};
@@ -3402,13 +3610,13 @@ extend(RuleContext.prototype, {
3402
3610
  parser.init(this);
3403
3611
  },
3404
3612
  initProp: function initProp() {
3405
- var _this = this;
3613
+ var _this3 = this;
3406
3614
 
3407
3615
  var rule = _objectSpread2({}, this.rule);
3408
3616
 
3409
3617
  delete rule.children;
3410
3618
  this.prop = mergeProps([rule].concat(_toConsumableArray(Object.keys(this.payload).map(function (k) {
3411
- return _this.payload[k];
3619
+ return _this3.payload[k];
3412
3620
  })), [this.computed]));
3413
3621
  },
3414
3622
  initNone: function initNone() {
@@ -3435,10 +3643,10 @@ extend(RuleContext.prototype, {
3435
3643
  this.$handle.appendLink(this);
3436
3644
  },
3437
3645
  watchTo: function watchTo() {
3438
- var _this2 = this;
3646
+ var _this4 = this;
3439
3647
 
3440
3648
  nextTick(function () {
3441
- _this2.$handle && _this2.$handle.watchCtx(_this2);
3649
+ _this4.$handle && _this4.$handle.watchCtx(_this4);
3442
3650
  });
3443
3651
  },
3444
3652
  "delete": function _delete() {
@@ -3468,15 +3676,15 @@ extend(RuleContext.prototype, {
3468
3676
  this.ctrlRule = [];
3469
3677
  },
3470
3678
  rm: function rm() {
3471
- var _this3 = this;
3679
+ var _this5 = this;
3472
3680
 
3473
3681
  var _rm = function _rm() {
3474
- var index = _this3.root.indexOf(_this3.origin);
3682
+ var index = _this5.root.indexOf(_this5.origin);
3475
3683
 
3476
3684
  if (index > -1) {
3477
- _this3.root.splice(index, 1);
3685
+ _this5.root.splice(index, 1);
3478
3686
 
3479
- _this3.$handle && _this3.$handle.refresh();
3687
+ _this5.$handle && _this5.$handle.refresh();
3480
3688
  }
3481
3689
  };
3482
3690
 
@@ -3487,17 +3695,17 @@ extend(RuleContext.prototype, {
3487
3695
  }
3488
3696
 
3489
3697
  this.$handle.noWatch(function () {
3490
- _this3.$handle.deferSyncValue(function () {
3491
- _this3.rmCtrl();
3698
+ _this5.$handle.deferSyncValue(function () {
3699
+ _this5.rmCtrl();
3492
3700
 
3493
3701
  _rm();
3494
3702
 
3495
- _this3.$handle.rmCtx(_this3);
3703
+ _this5.$handle.rmCtx(_this5);
3496
3704
 
3497
- extend(_this3, {
3705
+ extend(_this5, {
3498
3706
  root: []
3499
3707
  });
3500
- }, _this3.input);
3708
+ }, _this5.input);
3501
3709
  });
3502
3710
  },
3503
3711
  update: function update(handle, init) {
@@ -3536,7 +3744,6 @@ function useLoader(Handler) {
3536
3744
  });
3537
3745
  fullRule(rule);
3538
3746
  this.appendValue(rule);
3539
- rule.options = Array.isArray(rule.options) ? rule.options : [];
3540
3747
  [rule, rule['prefix'], rule['suffix']].forEach(function (item) {
3541
3748
  if (!item) {
3542
3749
  return;
@@ -3656,7 +3863,7 @@ function useLoader(Handler) {
3656
3863
  if (!is.Object(_rule) || !getRule(_rule).type) return err('未定义生成规则的 type 字段', _rule);
3657
3864
 
3658
3865
  if (_rule.__fc__ && _rule.__fc__.root === rules && _this6.ctxs[_rule.__fc__.id]) {
3659
- loadChildren(_rule.__fc__.rule.children, _rule.__fc__);
3866
+ loadChildren(_rule.__fc__.loadChildrenPending(), _rule.__fc__);
3660
3867
  return _rule.__fc__;
3661
3868
  }
3662
3869
 
@@ -3727,7 +3934,10 @@ function useLoader(Handler) {
3727
3934
  _this6.setCtx(ctx);
3728
3935
 
3729
3936
  !isCopy && !isInit && _this6.effect(ctx, 'load');
3730
- ctx.parser.loadChildren === false || loadChildren(ctx.rule.children, ctx);
3937
+
3938
+ var _load = ctx.loadChildrenPending();
3939
+
3940
+ ctx.parser.loadChildren === false || loadChildren(_load, ctx);
3731
3941
 
3732
3942
  if (!parent) {
3733
3943
  var _preIndex = preIndex(index);
@@ -3823,7 +4033,7 @@ function useLoader(Handler) {
3823
4033
  if (valid) {
3824
4034
  flag = true;
3825
4035
  var ruleCon = {
3826
- type: 'template',
4036
+ type: 'fragment',
3827
4037
  "native": true,
3828
4038
  __ctrl: true,
3829
4039
  children: rule
@@ -3935,7 +4145,7 @@ function useInput(Handler) {
3935
4145
  }
3936
4146
  },
3937
4147
  setFormData: function setFormData(ctx, value) {
3938
- $set(this.formData, ctx.id, value === undefined ? null : value);
4148
+ $set(this.formData, ctx.id, value === null ? undefined : value);
3939
4149
  },
3940
4150
  getFormData: function getFormData(ctx) {
3941
4151
  return this.formData[ctx.id];
@@ -4163,7 +4373,7 @@ function useContext(Handler) {
4163
4373
  var flag = key === 'children';
4164
4374
  ctx.refRule[key] = ref;
4165
4375
  ctx.watch.push(watch(flag ? function () {
4166
- return _toConsumableArray(ref.value || []);
4376
+ return is.Function(ref.value) ? ref.value : _toConsumableArray(ref.value || []);
4167
4377
  } : function () {
4168
4378
  return ref.value;
4169
4379
  }, function (_, o) {
@@ -4193,20 +4403,16 @@ function useContext(Handler) {
4193
4403
  ctx.updateType();
4194
4404
 
4195
4405
  _this.bindParser(ctx);
4196
- } else if (key === 'children') {
4197
- _this.deferSyncValue(function () {
4198
- o && o.forEach(function (child) {
4199
- if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__ && !_this.ctxs[child.__fc__.id]) {
4200
- _this.rmCtx(child.__fc__);
4201
- }
4202
- });
4406
+ } else if (flag) {
4407
+ if (is.Function(o)) {
4408
+ o = ctx.getPending('children', []);
4409
+ }
4203
4410
 
4204
- if (is.trueArray(n)) {
4205
- _this.loadChildren(n, ctx);
4411
+ if (is.Function(n)) {
4412
+ n = ctx.loadChildrenPending();
4413
+ }
4206
4414
 
4207
- _this.bus.$emit('update', _this.api);
4208
- }
4209
- });
4415
+ _this.updateChildren(ctx, n, o);
4210
4416
  }
4211
4417
 
4212
4418
  _this.$render.clearCache(ctx);
@@ -4233,15 +4439,32 @@ function useContext(Handler) {
4233
4439
 
4234
4440
  this.watchEffect(ctx);
4235
4441
  },
4236
- rmSub: function rmSub(sub) {
4442
+ updateChildren: function updateChildren(ctx, n, o) {
4237
4443
  var _this2 = this;
4238
4444
 
4445
+ this.deferSyncValue(function () {
4446
+ o && o.forEach(function (child) {
4447
+ if ((n || []).indexOf(child) === -1 && child && !is.String(child) && child.__fc__) {
4448
+ _this2.rmCtx(child.__fc__);
4449
+ }
4450
+ });
4451
+
4452
+ if (is.trueArray(n)) {
4453
+ _this2.loadChildren(n, ctx);
4454
+
4455
+ _this2.bus.$emit('update', _this2.api);
4456
+ }
4457
+ });
4458
+ },
4459
+ rmSub: function rmSub(sub) {
4460
+ var _this3 = this;
4461
+
4239
4462
  is.trueArray(sub) && sub.forEach(function (r) {
4240
- r && r.__fc__ && _this2.rmCtx(r.__fc__);
4463
+ r && r.__fc__ && _this3.rmCtx(r.__fc__);
4241
4464
  });
4242
4465
  },
4243
4466
  rmCtx: function rmCtx(ctx) {
4244
- var _this3 = this;
4467
+ var _this4 = this;
4245
4468
 
4246
4469
  if (ctx.deleted) return;
4247
4470
  var id = ctx.id,
@@ -4251,20 +4474,23 @@ function useContext(Handler) {
4251
4474
  $del(this.ctxs, id);
4252
4475
  $del(this.formData, id);
4253
4476
  $del(this.subForm, id);
4477
+ $del(this.vm.setupState.ctxInject, id);
4254
4478
  input && this.rmIdCtx(ctx, field, 'field');
4255
4479
  name && this.rmIdCtx(ctx, name, 'name');
4256
4480
  this.deferSyncValue(function () {
4257
- if (!_this3.reloading) {
4481
+ if (!_this4.reloading) {
4258
4482
  if (ctx.parser.loadChildren !== false) {
4259
- if (is.trueArray(ctx.rule.children)) {
4260
- ctx.rule.children.forEach(function (h) {
4261
- return h.__fc__ && _this3.rmCtx(h.__fc__);
4483
+ var children = ctx.getPending('children', ctx.rule.children);
4484
+
4485
+ if (is.trueArray(children)) {
4486
+ children.forEach(function (h) {
4487
+ return h.__fc__ && _this4.rmCtx(h.__fc__);
4262
4488
  });
4263
4489
  }
4264
4490
  }
4265
4491
 
4266
- if (ctx.root === _this3.rules) {
4267
- _this3.vm.setupState.renderRule();
4492
+ if (ctx.root === _this4.rules) {
4493
+ _this4.vm.setupState.renderRule();
4268
4494
  }
4269
4495
  }
4270
4496
  }, input);
@@ -4383,7 +4609,7 @@ function useEffect(Handler) {
4383
4609
  input = _ref.input,
4384
4610
  type = _ref.type,
4385
4611
  custom = _ref.custom;
4386
- if (!type || type === 'fcFragment') return;
4612
+ if (!type || ['fcFragment', 'fragment'].indexOf(type) > -1) return;
4387
4613
  var effect = custom ? custom : rule.effect || {};
4388
4614
  Object.keys(effect).forEach(function (attr) {
4389
4615
  var p = _this4.providers[attr];
@@ -4580,26 +4806,8 @@ function fetch(option) {
4580
4806
  xhr.send(formData);
4581
4807
  }
4582
4808
 
4583
- var NAME$1 = 'FcFragment';
4809
+ var NAME = 'fcFragment';
4584
4810
  var fragment = defineComponent({
4585
- name: NAME$1,
4586
- inheritAttrs: false,
4587
- props: ['formCreateInject'],
4588
- setup: function setup(props) {
4589
- var data = toRef(props, 'formCreateInject');
4590
- var $inject = reactive(_objectSpread2({}, data.value));
4591
- watch(data, function () {
4592
- extend($inject, data.value);
4593
- });
4594
- provide('formCreateInject', $inject);
4595
- },
4596
- render: function render() {
4597
- return this.$slots["default"]();
4598
- }
4599
- });
4600
-
4601
- var NAME = 'FcVnode';
4602
- var vnode = defineComponent({
4603
4811
  name: NAME,
4604
4812
  inheritAttrs: false,
4605
4813
  props: ['vnode'],
@@ -4642,8 +4850,14 @@ function CreateNodeFactory() {
4642
4850
  return makeDirective(data, this.h(tag, toProps(data), children));
4643
4851
  },
4644
4852
  h: function h(tag, data, children) {
4853
+ var isNativeTag = getCurrentInstance().appContext.config.isNativeTag(tag);
4854
+
4855
+ if (isNativeTag) {
4856
+ delete data.formCreateInject;
4857
+ }
4858
+
4645
4859
  try {
4646
- return createVNode(getCurrentInstance().appContext.config.isNativeTag(tag) ? tag : resolveComponent(tag), data, children);
4860
+ return createVNode(isNativeTag ? tag : resolveComponent(tag), data, children);
4647
4861
  } catch (e) {
4648
4862
  console.error(e);
4649
4863
  return createVNode('');
@@ -4686,7 +4900,7 @@ function createManager(proto) {
4686
4900
  return _super.apply(this, arguments);
4687
4901
  }
4688
4902
 
4689
- return _createClass(CustomManager);
4903
+ return CustomManager;
4690
4904
  }(Manager);
4691
4905
 
4692
4906
  Object.assign(CustomManager.prototype, proto);
@@ -4831,6 +5045,25 @@ function run(inject, rule, api) {
4831
5045
  return true;
4832
5046
  }
4833
5047
 
5048
+ var name$6 = 'html';
5049
+ var html = {
5050
+ name: name$6,
5051
+ loadChildren: false,
5052
+ render: function render(children, ctx) {
5053
+ ctx.prop.props.innerHTML = children["default"]();
5054
+ return ctx.vNode.make(ctx.prop.props.tag || 'div', ctx.prop);
5055
+ },
5056
+ renderChildren: function renderChildren(children) {
5057
+ return {
5058
+ "default": function _default() {
5059
+ return children.filter(function (v) {
5060
+ return is.String(v);
5061
+ }).join('');
5062
+ }
5063
+ };
5064
+ }
5065
+ };
5066
+
4834
5067
  function parseProp(name, id) {
4835
5068
  var prop;
4836
5069
 
@@ -4859,8 +5092,10 @@ function exportAttrs(attrs) {
4859
5092
  arrayAttrs.push.apply(arrayAttrs, _toConsumableArray(array));
4860
5093
  normalAttrs.push.apply(normalAttrs, _toConsumableArray(normal));
4861
5094
  appendProto([].concat(_toConsumableArray(key), _toConsumableArray(array), _toConsumableArray(normal)));
4862
- } //todo 表单嵌套
5095
+ }
4863
5096
 
5097
+ var id = 1;
5098
+ var instance = {}; //todo 表单嵌套
4864
5099
 
4865
5100
  function FormCreateFactory(config) {
4866
5101
  var components = _defineProperty({}, fragment.name, fragment);
@@ -4868,6 +5103,7 @@ function FormCreateFactory(config) {
4868
5103
  var parsers = {};
4869
5104
  var directives = {};
4870
5105
  var modelFields = {};
5106
+ var useApps = [];
4871
5107
  var providers = {
4872
5108
  fetch: $fetch
4873
5109
  };
@@ -4879,6 +5115,14 @@ function FormCreateFactory(config) {
4879
5115
  var CreateNode = CreateNodeFactory();
4880
5116
  exportAttrs(config.attrs || {});
4881
5117
 
5118
+ function getApi(name) {
5119
+ return instance[name];
5120
+ }
5121
+
5122
+ function useApp(fn) {
5123
+ useApps.push(fn);
5124
+ }
5125
+
4882
5126
  function directive() {
4883
5127
  var data = nameProp.apply(void 0, arguments);
4884
5128
  if (data.id && data.prop) directives[data.id] = data.prop;
@@ -4916,7 +5160,7 @@ function FormCreateFactory(config) {
4916
5160
  return components[name];
4917
5161
  }
4918
5162
  } else {
4919
- name = toCase(id.name);
5163
+ name = toCase(id.displayName || id.name);
4920
5164
  component = id;
4921
5165
  }
4922
5166
 
@@ -4947,7 +5191,7 @@ function FormCreateFactory(config) {
4947
5191
  }
4948
5192
 
4949
5193
  function $vnode() {
4950
- return vnode;
5194
+ return fragment;
4951
5195
  } //todo 检查回调函数作用域
4952
5196
 
4953
5197
 
@@ -4958,7 +5202,11 @@ function FormCreateFactory(config) {
4958
5202
 
4959
5203
  function create(rules, option) {
4960
5204
  var app = createFormApp(rules, option || {});
4961
- config.appUse && config.appUse(app);
5205
+ useApps.forEach(function (v) {
5206
+ invoke(function () {
5207
+ return v(create, app);
5208
+ });
5209
+ });
4962
5210
  var div = document.createElement('div');
4963
5211
  ((option === null || option === void 0 ? void 0 : option.el) || document.body).appendChild(div);
4964
5212
  var vm = app.mount(div);
@@ -4977,6 +5225,7 @@ function FormCreateFactory(config) {
4977
5225
  var _this = this;
4978
5226
 
4979
5227
  extend(this, {
5228
+ id: id++,
4980
5229
  create: create,
4981
5230
  vm: vm,
4982
5231
  manager: createManager(config.manager),
@@ -4984,6 +5233,7 @@ function FormCreateFactory(config) {
4984
5233
  providers: providers,
4985
5234
  modelFields: modelFields,
4986
5235
  rules: vm.props.rule,
5236
+ name: vm.props.name,
4987
5237
  prop: {
4988
5238
  components: components,
4989
5239
  directives: directives
@@ -5008,6 +5258,10 @@ function FormCreateFactory(config) {
5008
5258
  extend(vm.appContext.components, components);
5009
5259
  extend(vm.appContext.directives, directives);
5010
5260
  this.$handle = new Handler(this);
5261
+
5262
+ if (this.name) {
5263
+ instance[this.name] = this.api();
5264
+ }
5011
5265
  }
5012
5266
 
5013
5267
  extend(FormCreate.prototype, {
@@ -5073,6 +5327,10 @@ function FormCreateFactory(config) {
5073
5327
  this.$handle.mounted();
5074
5328
  },
5075
5329
  unmount: function unmount() {
5330
+ if (this.name) {
5331
+ delete instance[this.name];
5332
+ }
5333
+
5076
5334
  this.unwatch && this.unwatch();
5077
5335
  this.$handle.reloadRule([]);
5078
5336
  },
@@ -5106,17 +5364,19 @@ function FormCreateFactory(config) {
5106
5364
  $form: $form,
5107
5365
  parseFn: parseFn,
5108
5366
  parseJson: parseJson,
5109
- toJson: toJson
5367
+ toJson: toJson,
5368
+ useApp: useApp,
5369
+ getApi: getApi
5110
5370
  });
5111
5371
  }
5112
5372
 
5113
5373
  function useStatic(formCreate) {
5114
5374
  extend(formCreate, {
5115
5375
  create: create,
5116
- install: function install(Vue, options) {
5376
+ install: function install(app, options) {
5117
5377
  globalConfig = _objectSpread2(_objectSpread2({}, globalConfig), options || {});
5118
- if (Vue._installedFormCreate === true) return;
5119
- Vue._installedFormCreate = true;
5378
+ if (app._installedFormCreate === true) return;
5379
+ app._installedFormCreate = true;
5120
5380
 
5121
5381
  var $formCreate = function $formCreate(rules) {
5122
5382
  var opt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -5124,9 +5384,13 @@ function FormCreateFactory(config) {
5124
5384
  };
5125
5385
 
5126
5386
  useAttr($formCreate);
5127
- Vue.config.globalProperties.$formCreate = $formCreate;
5128
- Vue.component('FormCreate', $form());
5129
- Vue.component('fc-vnode', vnode);
5387
+ app.config.globalProperties.$formCreate = $formCreate;
5388
+ app.component('FormCreate', $form());
5389
+ useApps.forEach(function (v) {
5390
+ invoke(function () {
5391
+ return v(formCreate, app);
5392
+ });
5393
+ });
5130
5394
  }
5131
5395
  });
5132
5396
  }
@@ -5136,7 +5400,13 @@ function FormCreateFactory(config) {
5136
5400
  CreateNode.use({
5137
5401
  fragment: 'fcFragment'
5138
5402
  });
5139
- if (config.install) create.use(config);
5403
+ config.install && create.use(config);
5404
+ useApp(function (_, app) {
5405
+ app.mixin({
5406
+ props: ['formCreateInject']
5407
+ });
5408
+ });
5409
+ parser(html);
5140
5410
  return create;
5141
5411
  }
5142
5412
 
@@ -5281,7 +5551,7 @@ var parsers = [datePicker, hidden, input, slider, timePicker, row, select];
5281
5551
  var PRE = 'el';
5282
5552
  var alias = {
5283
5553
  button: PRE + '-button',
5284
- icon: 'i',
5554
+ icon: PRE + '-icon',
5285
5555
  slider: PRE + '-slider',
5286
5556
  rate: PRE + '-rate',
5287
5557
  upload: 'fc-upload',
@@ -5338,7 +5608,6 @@ function getConfig() {
5338
5608
  type: 'default',
5339
5609
  loading: false,
5340
5610
  disabled: false,
5341
- icon: 'el-icon-refresh',
5342
5611
  innerText: '重置',
5343
5612
  show: false,
5344
5613
  col: undefined,
@@ -5428,7 +5697,7 @@ var manager = {
5428
5697
  info: {
5429
5698
  trigger: 'hover',
5430
5699
  placement: 'top-start',
5431
- icon: 'el-icon-warning'
5700
+ icon: true
5432
5701
  },
5433
5702
  title: {},
5434
5703
  col: {
@@ -5544,10 +5813,16 @@ var manager = {
5544
5813
 
5545
5814
  children[infoProp.align !== 'left' ? 'unshift' : 'push'](this.$r(mergeProps([infoProp, prop]), _defineProperty({}, titleProp.slot || (isTip ? 'default' : 'reference'), function () {
5546
5815
  return _this4.$r({
5547
- type: 'i',
5548
- "class": infoProp.icon === true ? 'el-icon-warning' : infoProp.icon,
5816
+ type: 'ElIcon',
5817
+ style: 'top:2px',
5549
5818
  key: "".concat(uni, "i")
5550
- }, {}, true);
5819
+ }, {
5820
+ "default": function _default() {
5821
+ return _this4.$r({
5822
+ type: infoProp.icon === true ? 'icon-warning' : infoProp.icon
5823
+ });
5824
+ }
5825
+ }, true);
5551
5826
  })));
5552
5827
  }
5553
5828
 
@@ -5904,12 +6179,18 @@ function install(FormCreate) {
5904
6179
  Object.keys(maker$1).forEach(function (name) {
5905
6180
  FormCreate.maker[name] = maker$1[name];
5906
6181
  });
6182
+
6183
+ if (typeof window !== 'undefined' && window.ElementPlus) {
6184
+ FormCreate.useApp(function (_, app) {
6185
+ app.use(window.ElementPlus);
6186
+ });
6187
+ }
5907
6188
  }
5908
6189
 
5909
6190
  function elmFormCreate() {
5910
6191
  return FormCreateFactory({
5911
6192
  ui: 'element-ui',
5912
- version: '3.0.1',
6193
+ version: '3.1.2',
5913
6194
  manager: manager,
5914
6195
  extendApi: extendApi,
5915
6196
  install: install,