@form-create/element-ui 2.5.16 → 2.5.17

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,6 +1,6 @@
1
1
  /*!
2
- * @form-create/element-ui v2.5.16
3
- * (c) 2018-2021 xaboy
2
+ * @form-create/element-ui v2.5.17
3
+ * (c) 2018-2022 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
6
6
  */
@@ -2061,11 +2061,11 @@
2061
2061
  $set(origin, key, clone);
2062
2062
 
2063
2063
  if (!is.Undef(clone)) {
2064
- if (clone.__json !== undefined) {
2064
+ if (!is.Undef(clone.__json)) {
2065
2065
  origin[key].__json = clone.__json;
2066
2066
  }
2067
2067
 
2068
- if (clone.__origin !== undefined) {
2068
+ if (!is.Undef(clone.__origin)) {
2069
2069
  origin[key].__origin = clone.__origin;
2070
2070
  }
2071
2071
  }
@@ -2096,7 +2096,7 @@
2096
2096
  return val;
2097
2097
  }
2098
2098
 
2099
- if (hasProperty(val, '__json')) {
2099
+ if (val.__json) {
2100
2100
  return val.__json;
2101
2101
  }
2102
2102
 
@@ -2207,39 +2207,6 @@
2207
2207
  return def;
2208
2208
  }
2209
2209
 
2210
- function toString(val) {
2211
- return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
2212
- }
2213
-
2214
- function toLine(name) {
2215
- var line = name.replace(/([A-Z])/g, '-$1').toLocaleLowerCase();
2216
- if (line.indexOf('-') === 0) line = line.substr(1);
2217
- return line;
2218
- }
2219
-
2220
- var id = 0;
2221
- function uniqueId() {
2222
- return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id)).toString(36);
2223
- }
2224
-
2225
- function deepSet(data, idx, val) {
2226
- var _data = data,
2227
- to;
2228
- (idx || '').split('.').forEach(function (v) {
2229
- if (to) {
2230
- if (!_data[to] || _typeof(_data[to]) != 'object') {
2231
- _data[to] = {};
2232
- }
2233
-
2234
- _data = _data[to];
2235
- }
2236
-
2237
- to = v;
2238
- });
2239
- _data[to] = val;
2240
- return _data;
2241
- }
2242
-
2243
2210
  function baseRule() {
2244
2211
  return {
2245
2212
  props: {},
@@ -2761,6 +2728,39 @@
2761
2728
  return str.replace(str[0], str[0].toLowerCase());
2762
2729
  }
2763
2730
 
2731
+ function toString(val) {
2732
+ return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
2733
+ }
2734
+
2735
+ function toLine(name) {
2736
+ var line = name.replace(/([A-Z])/g, '-$1').toLocaleLowerCase();
2737
+ if (line.indexOf('-') === 0) line = line.substr(1);
2738
+ return line;
2739
+ }
2740
+
2741
+ var id = 0;
2742
+ function uniqueId() {
2743
+ return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id)).toString(36);
2744
+ }
2745
+
2746
+ function deepSet(data, idx, val) {
2747
+ var _data = data,
2748
+ to;
2749
+ (idx || '').split('.').forEach(function (v) {
2750
+ if (to) {
2751
+ if (!_data[to] || _typeof(_data[to]) != 'object') {
2752
+ _data[to] = {};
2753
+ }
2754
+
2755
+ _data = _data[to];
2756
+ }
2757
+
2758
+ to = v;
2759
+ });
2760
+ _data[to] = val;
2761
+ return _data;
2762
+ }
2763
+
2764
2764
  function useRender(Render) {
2765
2765
  extend(Render.prototype, {
2766
2766
  initRender: function initRender() {
@@ -2781,6 +2781,23 @@
2781
2781
  clearOrgChildren: function clearOrgChildren() {
2782
2782
  this.orgChildren = {};
2783
2783
  },
2784
+ getTypeSlot: function getTypeSlot(type) {
2785
+ var name = 'type-' + toLine(type);
2786
+
2787
+ var _fn = function _fn(vm) {
2788
+ if (vm) {
2789
+ var slot = vm.$scopedSlots[name] || vm.$scopedSlots['type-' + type];
2790
+
2791
+ if (slot) {
2792
+ return slot;
2793
+ }
2794
+
2795
+ return _fn(vm.$pfc);
2796
+ }
2797
+ };
2798
+
2799
+ return _fn(this.vm);
2800
+ },
2784
2801
  render: function render() {
2785
2802
  var _this = this;
2786
2803
 
@@ -2976,10 +2993,10 @@
2976
2993
  children = this.renderChildren(ctx);
2977
2994
  }
2978
2995
 
2979
- var slot = 'type-' + toLine(ctx.type);
2996
+ var slot = this.getTypeSlot(ctx.type);
2980
2997
 
2981
- if (this.vm.$scopedSlots[slot]) {
2982
- vn = this.vm.$scopedSlots[slot]({
2998
+ if (slot) {
2999
+ vn = slot({
2983
3000
  rule: rule,
2984
3001
  prop: prop,
2985
3002
  preview: preview,
@@ -4298,7 +4315,7 @@
4298
4315
  var vm = this.vm;
4299
4316
  var none = ['field', 'value', 'vm', 'template', 'name', 'config', 'control', 'inject', 'sync', 'payload', 'optionsTo', 'update'];
4300
4317
  Object.keys(ctx.rule).filter(function (k) {
4301
- return none.indexOf(k) === -1;
4318
+ return k[0] !== '_' && none.indexOf(k) === -1;
4302
4319
  }).forEach(function (key) {
4303
4320
  var flag = key === 'children';
4304
4321
  ctx.watch.push(vm.$watch(function () {
@@ -6072,7 +6089,7 @@
6072
6089
  function elmFormCreate() {
6073
6090
  return FormCreateFactory({
6074
6091
  ui: "".concat("element-ui"),
6075
- version: "".concat("2.5.16"),
6092
+ version: "".concat("2.5.17"),
6076
6093
  manager: manager,
6077
6094
  extendApi: extendApi,
6078
6095
  install: install,