@form-create/view-design 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/view-design v2.5.16
3
- * (c) 2018-2021 xaboy
2
+ * @form-create/view-design 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
  */
@@ -2047,11 +2047,11 @@
2047
2047
  $set(origin, key, clone);
2048
2048
 
2049
2049
  if (!is.Undef(clone)) {
2050
- if (clone.__json !== undefined) {
2050
+ if (!is.Undef(clone.__json)) {
2051
2051
  origin[key].__json = clone.__json;
2052
2052
  }
2053
2053
 
2054
- if (clone.__origin !== undefined) {
2054
+ if (!is.Undef(clone.__origin)) {
2055
2055
  origin[key].__origin = clone.__origin;
2056
2056
  }
2057
2057
  }
@@ -2082,7 +2082,7 @@
2082
2082
  return val;
2083
2083
  }
2084
2084
 
2085
- if (hasProperty(val, '__json')) {
2085
+ if (val.__json) {
2086
2086
  return val.__json;
2087
2087
  }
2088
2088
 
@@ -2193,39 +2193,6 @@
2193
2193
  return def;
2194
2194
  }
2195
2195
 
2196
- function toString$1(val) {
2197
- return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
2198
- }
2199
-
2200
- function toLine(name) {
2201
- var line = name.replace(/([A-Z])/g, '-$1').toLocaleLowerCase();
2202
- if (line.indexOf('-') === 0) line = line.substr(1);
2203
- return line;
2204
- }
2205
-
2206
- var id = 0;
2207
- function uniqueId() {
2208
- return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id)).toString(36);
2209
- }
2210
-
2211
- function deepSet(data, idx, val) {
2212
- var _data = data,
2213
- to;
2214
- (idx || '').split('.').forEach(function (v) {
2215
- if (to) {
2216
- if (!_data[to] || _typeof(_data[to]) != 'object') {
2217
- _data[to] = {};
2218
- }
2219
-
2220
- _data = _data[to];
2221
- }
2222
-
2223
- to = v;
2224
- });
2225
- _data[to] = val;
2226
- return _data;
2227
- }
2228
-
2229
2196
  function baseRule() {
2230
2197
  return {
2231
2198
  props: {},
@@ -2747,6 +2714,39 @@
2747
2714
  return str.replace(str[0], str[0].toLowerCase());
2748
2715
  }
2749
2716
 
2717
+ function toString$1(val) {
2718
+ return val == null ? '' : _typeof(val) === 'object' ? JSON.stringify(val, null, 2) : String(val);
2719
+ }
2720
+
2721
+ function toLine(name) {
2722
+ var line = name.replace(/([A-Z])/g, '-$1').toLocaleLowerCase();
2723
+ if (line.indexOf('-') === 0) line = line.substr(1);
2724
+ return line;
2725
+ }
2726
+
2727
+ var id = 0;
2728
+ function uniqueId() {
2729
+ return Math.random().toString(36).substr(3, 3) + Number("".concat(Date.now()).concat(++id)).toString(36);
2730
+ }
2731
+
2732
+ function deepSet(data, idx, val) {
2733
+ var _data = data,
2734
+ to;
2735
+ (idx || '').split('.').forEach(function (v) {
2736
+ if (to) {
2737
+ if (!_data[to] || _typeof(_data[to]) != 'object') {
2738
+ _data[to] = {};
2739
+ }
2740
+
2741
+ _data = _data[to];
2742
+ }
2743
+
2744
+ to = v;
2745
+ });
2746
+ _data[to] = val;
2747
+ return _data;
2748
+ }
2749
+
2750
2750
  function useRender(Render) {
2751
2751
  extend(Render.prototype, {
2752
2752
  initRender: function initRender() {
@@ -2767,6 +2767,23 @@
2767
2767
  clearOrgChildren: function clearOrgChildren() {
2768
2768
  this.orgChildren = {};
2769
2769
  },
2770
+ getTypeSlot: function getTypeSlot(type) {
2771
+ var name = 'type-' + toLine(type);
2772
+
2773
+ var _fn = function _fn(vm) {
2774
+ if (vm) {
2775
+ var slot = vm.$scopedSlots[name] || vm.$scopedSlots['type-' + type];
2776
+
2777
+ if (slot) {
2778
+ return slot;
2779
+ }
2780
+
2781
+ return _fn(vm.$pfc);
2782
+ }
2783
+ };
2784
+
2785
+ return _fn(this.vm);
2786
+ },
2770
2787
  render: function render() {
2771
2788
  var _this = this;
2772
2789
 
@@ -2962,10 +2979,10 @@
2962
2979
  children = this.renderChildren(ctx);
2963
2980
  }
2964
2981
 
2965
- var slot = 'type-' + toLine(ctx.type);
2982
+ var slot = this.getTypeSlot(ctx.type);
2966
2983
 
2967
- if (this.vm.$scopedSlots[slot]) {
2968
- vn = this.vm.$scopedSlots[slot]({
2984
+ if (slot) {
2985
+ vn = slot({
2969
2986
  rule: rule,
2970
2987
  prop: prop,
2971
2988
  preview: preview,
@@ -4284,7 +4301,7 @@
4284
4301
  var vm = this.vm;
4285
4302
  var none = ['field', 'value', 'vm', 'template', 'name', 'config', 'control', 'inject', 'sync', 'payload', 'optionsTo', 'update'];
4286
4303
  Object.keys(ctx.rule).filter(function (k) {
4287
- return none.indexOf(k) === -1;
4304
+ return k[0] !== '_' && none.indexOf(k) === -1;
4288
4305
  }).forEach(function (key) {
4289
4306
  var flag = key === 'children';
4290
4307
  ctx.watch.push(vm.$watch(function () {
@@ -6100,7 +6117,7 @@
6100
6117
  function ivuFormCreate() {
6101
6118
  return FormCreateFactory({
6102
6119
  ui: "".concat("view-design"),
6103
- version: "".concat("2.5.16"),
6120
+ version: "".concat("2.5.17"),
6104
6121
  manager: manager,
6105
6122
  install: install,
6106
6123
  extendApi: extendApi,