@form-create/element-ui 3.1.0 → 3.1.3

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,5 +1,5 @@
1
1
  /*!
2
- * @form-create/element-ui v3.1.0
2
+ * @form-create/element-ui v3.1.3
3
3
  * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -346,9 +346,124 @@
346
346
  }
347
347
  }
348
348
 
349
- 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}._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{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}";
349
+ 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}";
350
350
  styleInject(css_248z$2);
351
351
 
352
+ var script$8 = {
353
+ name: 'IconCircleClose'
354
+ };
355
+
356
+ var _hoisted_1$8 = {
357
+ "class": "icon",
358
+ viewBox: "0 0 1024 1024",
359
+ xmlns: "http://www.w3.org/2000/svg"
360
+ };
361
+
362
+ var _hoisted_2$8 = /*#__PURE__*/vue.createElementVNode("path", {
363
+ fill: "currentColor",
364
+ 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"
365
+ }, null, -1);
366
+
367
+ var _hoisted_3$8 = /*#__PURE__*/vue.createElementVNode("path", {
368
+ fill: "currentColor",
369
+ d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
370
+ }, null, -1);
371
+
372
+ var _hoisted_4$2 = [_hoisted_2$8, _hoisted_3$8];
373
+ function render$8(_ctx, _cache, $props, $setup, $data, $options) {
374
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$8, _hoisted_4$2);
375
+ }
376
+
377
+ script$8.render = render$8;
378
+
379
+ var script$7 = {
380
+ name: 'IconDocument'
381
+ };
382
+
383
+ var _hoisted_1$7 = {
384
+ "class": "icon",
385
+ viewBox: "0 0 1024 1024",
386
+ xmlns: "http://www.w3.org/2000/svg"
387
+ };
388
+
389
+ var _hoisted_2$7 = /*#__PURE__*/vue.createElementVNode("path", {
390
+ fill: "currentColor",
391
+ 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"
392
+ }, null, -1);
393
+
394
+ var _hoisted_3$7 = [_hoisted_2$7];
395
+ function render$7(_ctx, _cache, $props, $setup, $data, $options) {
396
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$7, _hoisted_3$7);
397
+ }
398
+
399
+ script$7.render = render$7;
400
+
401
+ var script$6 = {
402
+ name: 'IconDelete'
403
+ };
404
+
405
+ var _hoisted_1$6 = {
406
+ "class": "icon",
407
+ viewBox: "0 0 1024 1024",
408
+ xmlns: "http://www.w3.org/2000/svg"
409
+ };
410
+
411
+ var _hoisted_2$6 = /*#__PURE__*/vue.createElementVNode("path", {
412
+ fill: "currentColor",
413
+ 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"
414
+ }, null, -1);
415
+
416
+ var _hoisted_3$6 = [_hoisted_2$6];
417
+ function render$6(_ctx, _cache, $props, $setup, $data, $options) {
418
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$6, _hoisted_3$6);
419
+ }
420
+
421
+ script$6.render = render$6;
422
+
423
+ var script$5 = {
424
+ name: 'IconView'
425
+ };
426
+
427
+ var _hoisted_1$5 = {
428
+ "class": "icon",
429
+ viewBox: "0 0 1024 1024",
430
+ xmlns: "http://www.w3.org/2000/svg"
431
+ };
432
+
433
+ var _hoisted_2$5 = /*#__PURE__*/vue.createElementVNode("path", {
434
+ fill: "currentColor",
435
+ 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"
436
+ }, null, -1);
437
+
438
+ var _hoisted_3$5 = [_hoisted_2$5];
439
+ function render$5(_ctx, _cache, $props, $setup, $data, $options) {
440
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$5, _hoisted_3$5);
441
+ }
442
+
443
+ script$5.render = render$5;
444
+
445
+ var script$4 = {
446
+ name: 'IconFolderOpened'
447
+ };
448
+
449
+ var _hoisted_1$4 = {
450
+ "class": "icon",
451
+ viewBox: "0 0 1024 1024",
452
+ xmlns: "http://www.w3.org/2000/svg"
453
+ };
454
+
455
+ var _hoisted_2$4 = /*#__PURE__*/vue.createElementVNode("path", {
456
+ fill: "currentColor",
457
+ 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"
458
+ }, null, -1);
459
+
460
+ var _hoisted_3$4 = [_hoisted_2$4];
461
+ function render$4(_ctx, _cache, $props, $setup, $data, $options) {
462
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$4, _hoisted_3$4);
463
+ }
464
+
465
+ script$4.render = render$4;
466
+
352
467
  function _isSlot$1(s) {
353
468
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
354
469
  }
@@ -376,7 +491,7 @@
376
491
  },
377
492
  icon: {
378
493
  type: String,
379
- "default": 'upload'
494
+ "default": 'IconFolderOpened'
380
495
  },
381
496
  width: {
382
497
  type: String,
@@ -461,6 +576,10 @@
461
576
  formCreateInject: Object
462
577
  },
463
578
  emits: ['update:modelValue', 'change'],
579
+ components: {
580
+ IconFolderOpened: script$4,
581
+ IconView: script$5
582
+ },
464
583
  data: function data() {
465
584
  return {
466
585
  fileList: toArray(this.modelValue),
@@ -519,7 +638,7 @@
519
638
  }), {
520
639
  append: function append() {
521
640
  return vue.createVNode(vue.resolveComponent("ElButton"), {
522
- "icon": _this.icon,
641
+ "icon": vue.resolveComponent(_this.icon),
523
642
  "onClick": function onClick() {
524
643
  return _this.showModel();
525
644
  }
@@ -527,7 +646,7 @@
527
646
  },
528
647
  suffix: function suffix() {
529
648
  return _this.fileList.length ? vue.createVNode(vue.resolveComponent("ElIcon"), {
530
- "class": "el-input__icon",
649
+ "class": "el-input__icon _fc-upload-icon",
531
650
  "onClick": function onClick() {
532
651
  _this.fileList = [];
533
652
 
@@ -535,7 +654,7 @@
535
654
  }
536
655
  }, {
537
656
  "default": function _default() {
538
- return [vue.createVNode(vue.resolveComponent("CircleClose"), null, null)];
657
+ return [vue.createVNode(script$8, null, null)];
539
658
  }
540
659
  }) : null;
541
660
  }
@@ -584,7 +703,7 @@
584
703
  makeHandleIcon: function makeHandleIcon(val, index) {
585
704
  var _this2 = this;
586
705
 
587
- var Type = vue.resolveComponent(this.handleIcon === true || this.handleIcon === undefined ? 'view' : this.handleIcon);
706
+ var Type = vue.resolveComponent(this.handleIcon === true || this.handleIcon === undefined ? 'icon-view' : this.handleIcon);
588
707
  return vue.createVNode(vue.resolveComponent("ElIcon"), {
589
708
  "onClick": function onClick() {
590
709
  return _this2.handleClick(val);
@@ -606,7 +725,7 @@
606
725
  "key": '6' + index
607
726
  }, {
608
727
  "default": function _default() {
609
- return [vue.createVNode(vue.resolveComponent("delete"), null, null)];
728
+ return [vue.createVNode(script$6, null, null)];
610
729
  }
611
730
  });
612
731
  },
@@ -620,7 +739,7 @@
620
739
  }
621
740
  }, {
622
741
  "default": function _default() {
623
- return [vue.createVNode(vue.resolveComponent("document"), null, null)];
742
+ return [vue.createVNode(script$7, null, null)];
624
743
  }
625
744
  }), _this4.makeIcons(src, index)]);
626
745
  }));
@@ -680,6 +799,7 @@
680
799
  try {
681
800
  if (this.helper === true) {
682
801
  iframe['form_create_helper'] = {
802
+ api: this.formCreateInject.api,
683
803
  close: function close(field) {
684
804
  _this7.valid(field);
685
805
 
@@ -1003,6 +1123,28 @@
1003
1123
  var css_248z$1 = "._fc-exceed .el-upload{display:none}";
1004
1124
  styleInject(css_248z$1);
1005
1125
 
1126
+ var script$3 = {
1127
+ name: 'IconUpload'
1128
+ };
1129
+
1130
+ var _hoisted_1$3 = {
1131
+ "class": "icon",
1132
+ viewBox: "0 0 1024 1024",
1133
+ xmlns: "http://www.w3.org/2000/svg"
1134
+ };
1135
+
1136
+ var _hoisted_2$3 = /*#__PURE__*/vue.createElementVNode("path", {
1137
+ fill: "currentColor",
1138
+ 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"
1139
+ }, null, -1);
1140
+
1141
+ var _hoisted_3$3 = [_hoisted_2$3];
1142
+ function render$3(_ctx, _cache, $props, $setup, $data, $options) {
1143
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$3, _hoisted_3$3);
1144
+ }
1145
+
1146
+ script$3.render = render$3;
1147
+
1006
1148
  function parseFile(file, i) {
1007
1149
  return {
1008
1150
  url: file,
@@ -1097,7 +1239,7 @@
1097
1239
  "default": function _default() {
1098
1240
  return [((_this$$slots$default = (_this$$slots = _this.$slots)["default"]) === null || _this$$slots$default === void 0 ? void 0 : _this$$slots$default.call(_this$$slots)) || vue.createVNode(vue.resolveComponent("ElIcon"), null, {
1099
1241
  "default": function _default() {
1100
- return [vue.createVNode(vue.resolveComponent("upload"), null, null)];
1242
+ return [vue.createVNode(script$3, null, null)];
1101
1243
  }
1102
1244
  })];
1103
1245
  }
@@ -1130,9 +1272,28 @@
1130
1272
  },
1131
1273
  trueArray: function trueArray(data) {
1132
1274
  return Array.isArray(data) && data.length > 0;
1275
+ },
1276
+ Function: function Function(v) {
1277
+ var type = this.getType(v);
1278
+ return type === 'Function' || type === 'AsyncFunction';
1279
+ },
1280
+ getType: function getType(v) {
1281
+ var str = Object.prototype.toString.call(v);
1282
+ return /^\[object (.*)\]$/.exec(str)[1];
1283
+ },
1284
+ empty: function empty(value) {
1285
+ if (value === undefined || value === null) {
1286
+ return true;
1287
+ }
1288
+
1289
+ if (Array.isArray(value) && Array.isArray(value) && !value.length) {
1290
+ return true;
1291
+ }
1292
+
1293
+ return typeof value === 'string' && !value;
1133
1294
  }
1134
1295
  };
1135
- ['Date', 'Object', 'Function', 'String', 'Boolean', 'Array', 'Number'].forEach(function (t) {
1296
+ ['Date', 'Object', 'String', 'Boolean', 'Array', 'Number'].forEach(function (t) {
1136
1297
  is[t] = function (arg) {
1137
1298
  return is.type(arg, t);
1138
1299
  };
@@ -1141,6 +1302,140 @@
1141
1302
  return {}.hasOwnProperty.call(rule, k);
1142
1303
  }
1143
1304
 
1305
+ var script$2 = {
1306
+ name: 'IconCirclePlus'
1307
+ };
1308
+
1309
+ var _hoisted_1$2 = {
1310
+ "class": "icon",
1311
+ viewBox: "0 0 1024 1024",
1312
+ xmlns: "http://www.w3.org/2000/svg"
1313
+ };
1314
+
1315
+ var _hoisted_2$2 = /*#__PURE__*/vue.createElementVNode("path", {
1316
+ fill: "currentColor",
1317
+ d: "M352 480h320a32 32 0 110 64H352a32 32 0 010-64z"
1318
+ }, null, -1);
1319
+
1320
+ var _hoisted_3$2 = /*#__PURE__*/vue.createElementVNode("path", {
1321
+ fill: "currentColor",
1322
+ d: "M480 672V352a32 32 0 1164 0v320a32 32 0 01-64 0z"
1323
+ }, null, -1);
1324
+
1325
+ var _hoisted_4$1 = /*#__PURE__*/vue.createElementVNode("path", {
1326
+ fill: "currentColor",
1327
+ d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
1328
+ }, null, -1);
1329
+
1330
+ var _hoisted_5 = [_hoisted_2$2, _hoisted_3$2, _hoisted_4$1];
1331
+ function render$2(_ctx, _cache, $props, $setup, $data, $options) {
1332
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$2, _hoisted_5);
1333
+ }
1334
+
1335
+ script$2.render = render$2;
1336
+
1337
+ var script$1 = {
1338
+ name: 'IconRemove'
1339
+ };
1340
+
1341
+ var _hoisted_1$1 = {
1342
+ "class": "icon",
1343
+ viewBox: "0 0 1024 1024",
1344
+ xmlns: "http://www.w3.org/2000/svg"
1345
+ };
1346
+
1347
+ var _hoisted_2$1 = /*#__PURE__*/vue.createElementVNode("path", {
1348
+ fill: "currentColor",
1349
+ d: "M352 480h320a32 32 0 110 64H352a32 32 0 010-64z"
1350
+ }, null, -1);
1351
+
1352
+ var _hoisted_3$1 = /*#__PURE__*/vue.createElementVNode("path", {
1353
+ fill: "currentColor",
1354
+ d: "M512 896a384 384 0 100-768 384 384 0 000 768zm0 64a448 448 0 110-896 448 448 0 010 896z"
1355
+ }, null, -1);
1356
+
1357
+ var _hoisted_4 = [_hoisted_2$1, _hoisted_3$1];
1358
+ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
1359
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$1, _hoisted_4);
1360
+ }
1361
+
1362
+ script$1.render = render$1;
1363
+
1364
+ function $set(target, field, value) {
1365
+ target[field] = value;
1366
+ }
1367
+ function $del(target, field) {
1368
+ delete target[field];
1369
+ }
1370
+
1371
+ function deepExtend(origin) {
1372
+ var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1373
+ var mode = arguments.length > 2 ? arguments[2] : undefined;
1374
+ var isArr = false;
1375
+
1376
+ for (var key in target) {
1377
+ if (Object.prototype.hasOwnProperty.call(target, key)) {
1378
+ var clone = target[key];
1379
+
1380
+ if ((isArr = Array.isArray(clone)) || is.Object(clone)) {
1381
+ var nst = origin[key] === undefined;
1382
+
1383
+ if (isArr) {
1384
+ isArr = false;
1385
+ nst && $set(origin, key, []);
1386
+ } else if (clone._clone && mode !== undefined) {
1387
+ if (mode) {
1388
+ clone = clone.getRule();
1389
+ nst && $set(origin, key, {});
1390
+ } else {
1391
+ $set(origin, key, clone._clone());
1392
+ continue;
1393
+ }
1394
+ } else {
1395
+ nst && $set(origin, key, {});
1396
+ }
1397
+
1398
+ origin[key] = deepExtend(origin[key], clone, mode);
1399
+ } else {
1400
+ $set(origin, key, clone);
1401
+
1402
+ if (!is.Undef(clone)) {
1403
+ if (!is.Undef(clone.__json)) {
1404
+ origin[key].__json = clone.__json;
1405
+ }
1406
+
1407
+ if (!is.Undef(clone.__origin)) {
1408
+ origin[key].__origin = clone.__origin;
1409
+ }
1410
+ }
1411
+ }
1412
+ }
1413
+ }
1414
+
1415
+ return mode !== undefined && Array.isArray(origin) ? origin.filter(function (v) {
1416
+ return !v || !v.__ctrl;
1417
+ }) : origin;
1418
+ }
1419
+ function deepCopy(value) {
1420
+ return deepExtend({}, {
1421
+ value: value
1422
+ }).value;
1423
+ }
1424
+
1425
+ var _extends = Object.assign || function (a) {
1426
+ for (var b, c = 1; c < arguments.length; c++) {
1427
+ for (var d in b = arguments[c], b) {
1428
+ Object.prototype.hasOwnProperty.call(b, d) && $set(a, d, b[d]);
1429
+ }
1430
+ }
1431
+
1432
+ return a;
1433
+ };
1434
+
1435
+ function extend() {
1436
+ return _extends.apply(this, arguments);
1437
+ }
1438
+
1144
1439
  function _isSlot(s) {
1145
1440
  return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
1146
1441
  }
@@ -1171,6 +1466,7 @@
1171
1466
  return [];
1172
1467
  }
1173
1468
  },
1469
+ defaultValue: Object,
1174
1470
  disabled: {
1175
1471
  type: Boolean,
1176
1472
  "default": false
@@ -1307,6 +1603,13 @@
1307
1603
  submitBtn: false,
1308
1604
  resetBtn: false
1309
1605
  };
1606
+
1607
+ if (this.defaultValue) {
1608
+ if (!options.formData) options.formData = {};
1609
+ var defVal = deepCopy(this.defaultValue);
1610
+ extend(options.formData, this.field ? _defineProperty({}, this.field, defVal) : defVal);
1611
+ }
1612
+
1310
1613
  this.cacheRule[++this.len] = {
1311
1614
  rule: rule,
1312
1615
  options: options
@@ -1323,6 +1626,7 @@
1323
1626
 
1324
1627
  this.cacheRule[key].$f = $f;
1325
1628
  this.subForm();
1629
+ this.formData(key, $f.formData());
1326
1630
  vue.nextTick(function () {
1327
1631
  if (_this4.syncDisabled) {
1328
1632
  $f.disabled(_this4.disabled);
@@ -1370,13 +1674,13 @@
1370
1674
  this.input(this.modelValue);
1371
1675
  },
1372
1676
  addIcon: function addIcon(key) {
1373
- return vue.createVNode(vue.resolveComponent("el-icon"), {
1677
+ return vue.createVNode(vue.resolveComponent("ElIcon"), {
1374
1678
  "key": "a".concat(key),
1375
1679
  "style": "font-size:".concat(this.fontSize, "px;cursor:").concat(this.disabled ? 'not-allowed;color:#c9cdd4' : 'pointer', ";"),
1376
1680
  "onClick": this.add
1377
1681
  }, {
1378
1682
  "default": function _default() {
1379
- return [vue.createVNode(vue.resolveComponent("circle-plus"), null, null)];
1683
+ return [vue.createVNode(script$2, null, null)];
1380
1684
  }
1381
1685
  });
1382
1686
  },
@@ -1392,7 +1696,7 @@
1392
1696
  }
1393
1697
  }, {
1394
1698
  "default": function _default() {
1395
- return [vue.createVNode(vue.resolveComponent("remove"), null, null)];
1699
+ return [vue.createVNode(script$1, null, null)];
1396
1700
  }
1397
1701
  });
1398
1702
  },
@@ -1449,12 +1753,15 @@
1449
1753
  return keys.length === 0 ? this.$slots["default"] ? this.$slots["default"]({
1450
1754
  vm: this,
1451
1755
  add: this.add
1452
- }) : vue.createVNode("i", {
1756
+ }) : vue.createVNode(vue.resolveComponent("ElIcon"), {
1453
1757
  "key": 1,
1454
- "class": "el-icon-circle-plus-outline",
1455
1758
  "style": "font-size:".concat(this.fontSize, "px;vertical-align:middle;color:").concat(this.disabled ? '#c9cdd4;cursor: not-allowed' : '#606266;cursor:pointer', ";"),
1456
1759
  "onClick": this.add
1457
- }, null) : vue.createVNode("div", {
1760
+ }, {
1761
+ "default": function _default() {
1762
+ return [vue.createVNode(script$2, null, null)];
1763
+ }
1764
+ }) : vue.createVNode("div", {
1458
1765
  "key": 2
1459
1766
  }, [keys.map(function (key, index) {
1460
1767
  var _slot;
@@ -1601,7 +1908,29 @@
1601
1908
  }
1602
1909
  });
1603
1910
 
1604
- var components = [Checkbox, Frame, Radio, Select, Tree, Upload, Group, Sub];
1911
+ var script = {
1912
+ name: 'IconWarning'
1913
+ };
1914
+
1915
+ var _hoisted_1 = {
1916
+ "class": "icon",
1917
+ viewBox: "0 0 1024 1024",
1918
+ xmlns: "http://www.w3.org/2000/svg"
1919
+ };
1920
+
1921
+ var _hoisted_2 = /*#__PURE__*/vue.createElementVNode("path", {
1922
+ fill: "currentColor",
1923
+ 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"
1924
+ }, null, -1);
1925
+
1926
+ var _hoisted_3 = [_hoisted_2];
1927
+ function render(_ctx, _cache, $props, $setup, $data, $options) {
1928
+ return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1, _hoisted_3);
1929
+ }
1930
+
1931
+ script.render = render;
1932
+
1933
+ var components = [Checkbox, Frame, Radio, Select, Tree, Upload, Group, Sub, script];
1605
1934
 
1606
1935
  var NAME$1 = 'FormCreate';
1607
1936
  function $FormCreate(FormCreate) {
@@ -1704,27 +2033,6 @@
1704
2033
  });
1705
2034
  }
1706
2035
 
1707
- function $set(target, field, value) {
1708
- target[field] = value;
1709
- }
1710
- function $del(target, field) {
1711
- delete target[field];
1712
- }
1713
-
1714
- var _extends = Object.assign || function (a) {
1715
- for (var b, c = 1; c < arguments.length; c++) {
1716
- for (var d in b = arguments[c], b) {
1717
- Object.prototype.hasOwnProperty.call(b, d) && $set(a, d, b[d]);
1718
- }
1719
- }
1720
-
1721
- return a;
1722
- };
1723
-
1724
- function extend() {
1725
- return _extends.apply(this, arguments);
1726
- }
1727
-
1728
2036
  var normalMerge = ['props'];
1729
2037
  var toArrayMerge = ['class', 'style', 'directives'];
1730
2038
  var functionalMerge = ['on'];
@@ -1794,67 +2102,13 @@
1794
2102
  };
1795
2103
  };
1796
2104
 
1797
- var keyAttrs = ['type', 'slot', 'emitPrefix', 'value', 'name', 'native', 'hidden', 'display', 'inject', 'options', 'emit', 'link', 'prefix', 'suffix', 'update', 'sync', 'optionsTo', 'key'];
2105
+ var keyAttrs = ['type', 'slot', 'emitPrefix', 'value', 'name', 'native', 'hidden', 'display', 'inject', 'options', 'emit', 'link', 'prefix', 'suffix', 'update', 'sync', 'optionsTo', 'key', 'slotUpdate'];
1798
2106
  var arrayAttrs = ['validate', 'children', 'control'];
1799
2107
  var normalAttrs = ['effect'];
1800
2108
  function attrs() {
1801
2109
  return [].concat(keyAttrs, _toConsumableArray(normalMerge), _toConsumableArray(toArrayMerge), _toConsumableArray(functionalMerge), arrayAttrs, normalAttrs);
1802
2110
  }
1803
2111
 
1804
- function deepExtend(origin) {
1805
- var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1806
- var mode = arguments.length > 2 ? arguments[2] : undefined;
1807
- var isArr = false;
1808
-
1809
- for (var key in target) {
1810
- if (Object.prototype.hasOwnProperty.call(target, key)) {
1811
- var clone = target[key];
1812
-
1813
- if ((isArr = Array.isArray(clone)) || is.Object(clone)) {
1814
- var nst = origin[key] === undefined;
1815
-
1816
- if (isArr) {
1817
- isArr = false;
1818
- nst && $set(origin, key, []);
1819
- } else if (clone._clone && mode !== undefined) {
1820
- if (mode) {
1821
- clone = clone.getRule();
1822
- nst && $set(origin, key, {});
1823
- } else {
1824
- $set(origin, key, clone._clone());
1825
- continue;
1826
- }
1827
- } else {
1828
- nst && $set(origin, key, {});
1829
- }
1830
-
1831
- origin[key] = deepExtend(origin[key], clone, mode);
1832
- } else {
1833
- $set(origin, key, clone);
1834
-
1835
- if (!is.Undef(clone)) {
1836
- if (!is.Undef(clone.__json)) {
1837
- origin[key].__json = clone.__json;
1838
- }
1839
-
1840
- if (!is.Undef(clone.__origin)) {
1841
- origin[key].__origin = clone.__origin;
1842
- }
1843
- }
1844
- }
1845
- }
1846
- }
1847
-
1848
- return mode !== undefined && Array.isArray(origin) ? origin.filter(function (v) {
1849
- return !v || !v.__ctrl;
1850
- }) : origin;
1851
- }
1852
- function deepCopy(value) {
1853
- return deepExtend({}, {
1854
- value: value
1855
- }).value;
1856
- }
1857
-
1858
2112
  function format(type, msg, rule) {
1859
2113
  return "[form-create ".concat(type, "]: ").concat(msg) + (rule ? '\n\nrule: ' + JSON.stringify(rule.getRule ? rule.getRule() : rule) : '');
1860
2114
  }
@@ -2012,14 +2266,14 @@
2012
2266
  if (!slotBag[slot]) slotBag[slot] = [];
2013
2267
  slotBag[slot].push(vnFn);
2014
2268
  },
2015
- getSlot: function getSlot(slot) {
2269
+ getSlot: function getSlot(slot, val) {
2016
2270
  slot = slotName(slot);
2017
2271
  var children = [];
2018
2272
  (slotBag[slot] || []).forEach(function (fn) {
2019
2273
  if (Array.isArray(fn)) {
2020
2274
  children.push.apply(children, _toConsumableArray(fn));
2021
2275
  } else if (is.Function(fn)) {
2022
- var res = fn();
2276
+ var res = fn.apply(void 0, _toConsumableArray(val || []));
2023
2277
 
2024
2278
  if (Array.isArray(res)) {
2025
2279
  children.push.apply(children, _toConsumableArray(res));
@@ -2038,7 +2292,11 @@
2038
2292
  var slots = {};
2039
2293
  Object.keys(slotBag).forEach(function (k) {
2040
2294
  slots[k] = function () {
2041
- return _this.getSlot(k);
2295
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2296
+ args[_key] = arguments[_key];
2297
+ }
2298
+
2299
+ return _this.getSlot(k, args);
2042
2300
  };
2043
2301
  });
2044
2302
  return slots;
@@ -2764,6 +3022,25 @@
2764
3022
  }
2765
3023
 
2766
3024
  vn = function vn() {
3025
+ for (var _len = arguments.length, slotValue = new Array(_len), _key = 0; _key < _len; _key++) {
3026
+ slotValue[_key] = arguments[_key];
3027
+ }
3028
+
3029
+ var inject = {
3030
+ rule: rule,
3031
+ prop: prop,
3032
+ preview: preview,
3033
+ api: _this4.$handle.api,
3034
+ model: prop.model || {},
3035
+ slotValue: slotValue
3036
+ };
3037
+
3038
+ if (slotValue.length && rule.slotUpdate) {
3039
+ invoke(function () {
3040
+ return rule.slotUpdate(inject);
3041
+ });
3042
+ }
3043
+
2767
3044
  var children = {};
2768
3045
 
2769
3046
  var _load = ctx.loadChildrenPending();
@@ -2779,14 +3056,8 @@
2779
3056
  var _vn;
2780
3057
 
2781
3058
  if (slot) {
2782
- _vn = slot({
2783
- rule: rule,
2784
- prop: prop,
2785
- preview: preview,
2786
- children: children,
2787
- api: _this4.$handle.api,
2788
- model: prop.model || {}
2789
- });
3059
+ inject.children = children;
3060
+ _vn = slot(inject);
2790
3061
  } else {
2791
3062
  _vn = preview ? ctx.parser.preview(children, ctx) : ctx.parser.render(children, ctx);
2792
3063
  }
@@ -2904,12 +3175,17 @@
2904
3175
 
2905
3176
  if (!custom && ctx.input) {
2906
3177
  var field = this.getModelField(ctx);
2907
- props.push({
2908
- on: _defineProperty({}, "update:".concat(field), function update(value) {
3178
+ var model = {
3179
+ callback: function callback(value) {
2909
3180
  _this7.onInput(ctx, value);
2910
- }),
2911
- props: _defineProperty({}, field, this.$handle.getFormData(ctx))
3181
+ },
3182
+ value: this.$handle.getFormData(ctx)
3183
+ };
3184
+ props.push({
3185
+ on: _defineProperty({}, "update:".concat(field), model.callback),
3186
+ props: _defineProperty({}, field, model.value)
2912
3187
  });
3188
+ ctx.prop.model = model;
2913
3189
  }
2914
3190
 
2915
3191
  mergeProps(props, ctx.prop);
@@ -3924,7 +4200,7 @@
3924
4200
  }
3925
4201
  },
3926
4202
  setFormData: function setFormData(ctx, value) {
3927
- $set(this.formData, ctx.id, value === undefined ? null : value);
4203
+ $set(this.formData, ctx.id, value === null ? undefined : value);
3928
4204
  },
3929
4205
  getFormData: function getFormData(ctx) {
3930
4206
  return this.formData[ctx.id];
@@ -4143,10 +4419,10 @@
4143
4419
  watchCtx: function watchCtx(ctx) {
4144
4420
  var _this = this;
4145
4421
 
4146
- var none = ['field', 'value', 'vm', 'template', 'name', 'config', 'control', 'inject', 'sync', 'payload', 'optionsTo', 'update'];
4422
+ var none = ['field', 'value', 'vm', 'template', 'name', 'config', 'control', 'inject', 'sync', 'payload', 'optionsTo', 'update', 'slotUpdate'];
4147
4423
  var all = attrs();
4148
4424
  all.filter(function (k) {
4149
- return k[0] !== '_' && none.indexOf(k) === -1;
4425
+ return k[0] !== '_' && k[0] !== '$' && none.indexOf(k) === -1;
4150
4426
  }).forEach(function (key) {
4151
4427
  var ref = vue.toRef(ctx.rule, key);
4152
4428
  var flag = key === 'children';
@@ -4351,10 +4627,21 @@
4351
4627
  watchEffect: function watchEffect(ctx) {
4352
4628
  var _this3 = this;
4353
4629
 
4630
+ var effect = {};
4354
4631
  Object.keys(ctx.rule.effect || {}).forEach(function (k) {
4355
- ctx.watch.push(vue.watch(function () {
4632
+ effect[k] = function () {
4356
4633
  return ctx.rule.effect[k];
4357
- }, function (n) {
4634
+ };
4635
+ });
4636
+ Object.keys(ctx.rule).forEach(function (k) {
4637
+ if (k[0] === '$') {
4638
+ effect[k.substr(1)] = function () {
4639
+ return ctx.rule[k];
4640
+ };
4641
+ }
4642
+ });
4643
+ Object.keys(effect).forEach(function (k) {
4644
+ ctx.watch.push(vue.watch(effect[k], function (n) {
4358
4645
  _this3.effect(ctx, 'watch', _defineProperty({}, k, n));
4359
4646
  }, {
4360
4647
  deep: true
@@ -4378,7 +4665,12 @@
4378
4665
  }, event);
4379
4666
  },
4380
4667
  getEffect: function getEffect(rule, name) {
4381
- if (hasProperty(rule, 'effect') && hasProperty(rule.effect, name)) return rule.effect[name];else return undefined;
4668
+ if (hasProperty(rule, '$' + name)) {
4669
+ return rule['$' + name];
4670
+ }
4671
+
4672
+ if (hasProperty(rule, 'effect') && hasProperty(rule.effect, name)) return rule.effect[name];
4673
+ return undefined;
4382
4674
  },
4383
4675
  emitEffect: function emitEffect(_ref, event, append) {
4384
4676
  var _this4 = this;
@@ -4389,7 +4681,13 @@
4389
4681
  type = _ref.type,
4390
4682
  custom = _ref.custom;
4391
4683
  if (!type || ['fcFragment', 'fragment'].indexOf(type) > -1) return;
4392
- var effect = custom ? custom : rule.effect || {};
4684
+ var effect = custom ? custom : Object.keys(rule).reduce(function (i, k) {
4685
+ if (k[0] === '$') {
4686
+ i[k.substr(1)] = rule[k];
4687
+ }
4688
+
4689
+ return i;
4690
+ }, _objectSpread2({}, rule.effect || {}));
4393
4691
  Object.keys(effect).forEach(function (attr) {
4394
4692
  var p = _this4.providers[attr];
4395
4693
  if (!p || p.input && !input) return;
@@ -4754,6 +5052,44 @@
4754
5052
  }
4755
5053
  }
4756
5054
  };
5055
+ var $required = {
5056
+ name: 'required',
5057
+ load: function load(inject, rule) {
5058
+ var val = parseVa(inject.getValue());
5059
+
5060
+ var validate = _objectSpread2(_objectSpread2({}, val), {}, {
5061
+ required: true,
5062
+ validator: function validator(_, v) {
5063
+ return new Promise(function (resolve, reject) {
5064
+ is.empty(v) ? reject(validate.message) : resolve();
5065
+ });
5066
+ }
5067
+ });
5068
+
5069
+ if (!validate.message) {
5070
+ validate.message = rule.title + ' is required';
5071
+ }
5072
+
5073
+ inject.getProp().validate = [validate];
5074
+ },
5075
+ watch: function watch() {
5076
+ $required.load.apply($required, arguments);
5077
+ }
5078
+ };
5079
+
5080
+ function parseVa(val) {
5081
+ if (is.Boolean(val)) {
5082
+ return {};
5083
+ } else if (is.String(val)) {
5084
+ return {
5085
+ message: val
5086
+ };
5087
+ } else if (!is.Object(val)) {
5088
+ return {};
5089
+ } else {
5090
+ return val;
5091
+ }
5092
+ }
4757
5093
 
4758
5094
  function parseOpt(option) {
4759
5095
  if (is.String(option)) {
@@ -4824,6 +5160,11 @@
4824
5160
  return true;
4825
5161
  }
4826
5162
 
5163
+ var $provider = {
5164
+ fetch: $fetch,
5165
+ required: $required
5166
+ };
5167
+
4827
5168
  var name$6 = 'html';
4828
5169
  var html = {
4829
5170
  name: name$6,
@@ -4883,9 +5224,9 @@
4883
5224
  var directives = {};
4884
5225
  var modelFields = {};
4885
5226
  var useApps = [];
4886
- var providers = {
4887
- fetch: $fetch
4888
- };
5227
+
5228
+ var providers = _objectSpread2({}, $provider);
5229
+
4889
5230
  var maker = makerFactory();
4890
5231
  var globalConfig = {
4891
5232
  global: {}
@@ -4939,7 +5280,7 @@
4939
5280
  return components[name];
4940
5281
  }
4941
5282
  } else {
4942
- name = toCase(id.name);
5283
+ name = toCase(id.displayName || id.name);
4943
5284
  component = id;
4944
5285
  }
4945
5286
 
@@ -4992,8 +5333,25 @@
4992
5333
  return vm.$refs.fc.fapi;
4993
5334
  }
4994
5335
 
4995
- function factory() {
4996
- return FormCreateFactory(config);
5336
+ function factory(inherit) {
5337
+ var _config = _objectSpread2({}, config);
5338
+
5339
+ if (inherit) {
5340
+ _config.inherit = {
5341
+ components: components,
5342
+ parsers: parsers,
5343
+ directives: directives,
5344
+ modelFields: modelFields,
5345
+ providers: providers,
5346
+ useApps: useApps,
5347
+ maker: maker,
5348
+ data: data
5349
+ };
5350
+ } else {
5351
+ delete _config.inherit;
5352
+ }
5353
+
5354
+ return FormCreateFactory(_config);
4997
5355
  }
4998
5356
 
4999
5357
  function setModelField(name, field) {
@@ -5186,6 +5544,19 @@
5186
5544
  });
5187
5545
  });
5188
5546
  parser(html);
5547
+
5548
+ if (config.inherit) {
5549
+ var inherit = config.inherit;
5550
+ inherit.components && extend(components, inherit.components);
5551
+ inherit.parsers && extend(parsers, inherit.parsers);
5552
+ inherit.directives && extend(directives, inherit.directives);
5553
+ inherit.modelFields && extend(modelFields, inherit.modelFields);
5554
+ inherit.providers && extend(providers, inherit.providers);
5555
+ inherit.useApps && extend(useApps, inherit.useApps);
5556
+ inherit.maker && extend(maker, inherit.maker);
5557
+ inherit.data && extend(data, inherit.data);
5558
+ }
5559
+
5189
5560
  return create;
5190
5561
  }
5191
5562
 
@@ -5598,7 +5969,7 @@
5598
5969
  }, {
5599
5970
  "default": function _default() {
5600
5971
  return _this4.$r({
5601
- type: infoProp.icon === true ? 'warning' : infoProp.icon
5972
+ type: infoProp.icon === true ? 'icon-warning' : infoProp.icon
5602
5973
  });
5603
5974
  }
5604
5975
  }, true);
@@ -5969,7 +6340,7 @@
5969
6340
  function elmFormCreate() {
5970
6341
  return FormCreateFactory({
5971
6342
  ui: 'element-ui',
5972
- version: '3.1.0',
6343
+ version: '3.1.3',
5973
6344
  manager: manager,
5974
6345
  extendApi: extendApi,
5975
6346
  install: install,