@form-create/element-ui 3.0.0-alpha.3 → 3.0.0-alpha.4

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,18 +1,14 @@
1
1
  /*!
2
- * @form-create/element-ui v3.0.0-alpha.3
3
- * (c) 2018-2021 xaboy
2
+ * @form-create/element-ui v3.0.0-alpha.4
3
+ * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
6
6
  */
7
7
  (function (global, factory) {
8
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('element-plus')) :
9
- typeof define === 'function' && define.amd ? define(['exports', 'vue', 'element-plus'], factory) :
10
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.formCreate = {}, global.Vue, global.ElementPlus));
11
- })(this, (function (exports, vue, ElementPlus) { 'use strict';
12
-
13
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
-
15
- var ElementPlus__default = /*#__PURE__*/_interopDefaultLegacy(ElementPlus);
8
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
9
+ typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.formCreate = {}, global.Vue));
11
+ })(this, (function (exports, vue) { 'use strict';
16
12
 
17
13
  function ownKeys(object, enumerableOnly) {
18
14
  var keys = Object.keys(object);
@@ -1401,7 +1397,8 @@
1401
1397
  });
1402
1398
  }
1403
1399
  },
1404
- deep: true
1400
+ deep: true,
1401
+ flush: 'post'
1405
1402
  }
1406
1403
  },
1407
1404
  methods: {
@@ -1576,13 +1573,13 @@
1576
1573
  created: function created() {
1577
1574
  var d = (this.expand || 0) - this.modelValue.length;
1578
1575
 
1579
- if (d > 0) {
1580
- this.expandRule(d);
1581
- }
1582
-
1583
1576
  for (var i = 0; i < this.modelValue.length; i++) {
1584
1577
  this.addRule(i);
1585
1578
  }
1579
+
1580
+ if (d > 0) {
1581
+ this.expandRule(d);
1582
+ }
1586
1583
  },
1587
1584
  render: function render() {
1588
1585
  var _this9 = this;
@@ -1975,11 +1972,11 @@
1975
1972
  $set(origin, key, clone);
1976
1973
 
1977
1974
  if (!is.Undef(clone)) {
1978
- if (clone.__json !== undefined) {
1975
+ if (!is.Undef(clone.__json)) {
1979
1976
  origin[key].__json = clone.__json;
1980
1977
  }
1981
1978
 
1982
- if (clone.__origin !== undefined) {
1979
+ if (!is.Undef(clone.__origin)) {
1983
1980
  origin[key].__origin = clone.__origin;
1984
1981
  }
1985
1982
  }
@@ -2030,7 +2027,7 @@
2030
2027
  return val;
2031
2028
  }
2032
2029
 
2033
- if (hasProperty(val, '__json')) {
2030
+ if (val.__json) {
2034
2031
  return val.__json;
2035
2032
  }
2036
2033
 
@@ -2231,33 +2228,6 @@
2231
2228
  return prop;
2232
2229
  }
2233
2230
 
2234
- function toString(val) {
2235
- return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
2236
- }
2237
-
2238
- var id$1 = 0;
2239
- function uniqueId() {
2240
- return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id$1)).toString(36);
2241
- }
2242
-
2243
- function deepSet(data, idx, val) {
2244
- var _data = data,
2245
- to;
2246
- (idx || '').split('.').forEach(function (v) {
2247
- if (to) {
2248
- if (!_data[to] || _typeof(_data[to]) != 'object') {
2249
- _data[to] = {};
2250
- }
2251
-
2252
- _data = _data[to];
2253
- }
2254
-
2255
- to = v;
2256
- });
2257
- _data[to] = val;
2258
- return _data;
2259
- }
2260
-
2261
2231
  function baseRule() {
2262
2232
  return {
2263
2233
  props: {},
@@ -2771,11 +2741,55 @@
2771
2741
  return str.replace(str[0], str[0].toLowerCase());
2772
2742
  }
2773
2743
 
2744
+ function toString(val) {
2745
+ return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
2746
+ }
2747
+
2748
+ var id$1 = 0;
2749
+ function uniqueId() {
2750
+ return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id$1)).toString(36);
2751
+ }
2752
+
2753
+ function deepSet(data, idx, val) {
2754
+ var _data = data,
2755
+ to;
2756
+ (idx || '').split('.').forEach(function (v) {
2757
+ if (to) {
2758
+ if (!_data[to] || _typeof(_data[to]) != 'object') {
2759
+ _data[to] = {};
2760
+ }
2761
+
2762
+ _data = _data[to];
2763
+ }
2764
+
2765
+ to = v;
2766
+ });
2767
+ _data[to] = val;
2768
+ return _data;
2769
+ }
2770
+
2774
2771
  function useRender$1(Render) {
2775
2772
  extend(Render.prototype, {
2776
2773
  initRender: function initRender() {
2777
2774
  this.cacheConfig = {};
2778
2775
  },
2776
+ getTypeSlot: function getTypeSlot(type) {
2777
+ var name = 'type-' + toLine(type);
2778
+
2779
+ var _fn = function _fn(vm) {
2780
+ if (vm) {
2781
+ var slot = vm.slots[name] || vm.slots['type-' + type];
2782
+
2783
+ if (slot) {
2784
+ return slot;
2785
+ }
2786
+
2787
+ return _fn(vm.setupState.parent);
2788
+ }
2789
+ };
2790
+
2791
+ return _fn(this.vm);
2792
+ },
2779
2793
  render: function render() {
2780
2794
  var _this = this;
2781
2795
 
@@ -2883,12 +2897,12 @@
2883
2897
  children = _this4.renderChildren(ctx);
2884
2898
  }
2885
2899
 
2886
- var slot = 'type-' + toLine(ctx.type);
2900
+ var slot = _this4.getTypeSlot(ctx.type);
2887
2901
 
2888
2902
  var _vn;
2889
2903
 
2890
- if (_this4.vm.slots[slot]) {
2891
- _vn = _this4.vm.slots[slot]({
2904
+ if (slot) {
2905
+ _vn = slot({
2892
2906
  rule: rule,
2893
2907
  prop: prop,
2894
2908
  preview: preview,
@@ -3422,7 +3436,7 @@
3422
3436
  var _this2 = this;
3423
3437
 
3424
3438
  vue.nextTick(function () {
3425
- _this2.$handle.watchCtx(_this2);
3439
+ _this2.$handle && _this2.$handle.watchCtx(_this2);
3426
3440
  });
3427
3441
  },
3428
3442
  "delete": function _delete() {
@@ -4141,7 +4155,7 @@
4141
4155
  var none = ['field', 'value', 'vm', 'template', 'name', 'config', 'control', 'inject', 'sync', 'payload', 'optionsTo', 'update'];
4142
4156
  var all = attrs();
4143
4157
  all.filter(function (k) {
4144
- return none.indexOf(k) === -1;
4158
+ return k[0] !== '_' && none.indexOf(k) === -1;
4145
4159
  }).forEach(function (key) {
4146
4160
  var ref = vue.toRef(ctx.rule, key);
4147
4161
  var flag = key === 'children';
@@ -4595,8 +4609,12 @@
4595
4609
 
4596
4610
  function tidyDirectives(directives) {
4597
4611
  return Object.keys(directives).map(function (n) {
4598
- var directive = directives[n];
4599
- return [vue.resolveDirective(n), directive.arg, directive.value, directive.modifiers];
4612
+ var data = directives[n];
4613
+ var directive = vue.resolveDirective(n);
4614
+ if (!directive) return;
4615
+ return [directive, data.value, data.arg, data.modifiers];
4616
+ }).filter(function (v) {
4617
+ return !!v;
4600
4618
  });
4601
4619
  }
4602
4620
 
@@ -5868,16 +5886,11 @@
5868
5886
  });
5869
5887
  }
5870
5888
 
5871
- function appUse(app) {
5872
- app.use(ElementPlus__default["default"]);
5873
- }
5874
-
5875
5889
  function elmFormCreate() {
5876
5890
  return FormCreateFactory({
5877
5891
  ui: 'element-ui',
5878
- version: '3.0.0-alpha.3',
5892
+ version: '3.0.0-alpha.4',
5879
5893
  manager: manager,
5880
- appUse: appUse,
5881
5894
  extendApi: extendApi,
5882
5895
  install: install,
5883
5896
  attrs: {