@form-create/element-ui 3.2.26 → 3.2.28

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.2.26
2
+ * @form-create/element-ui v3.2.28
3
3
  * (c) 2018-2025 xaboy
4
4
  * Github https://github.com/xaboy/form-create
5
5
  * Released under the MIT License.
@@ -2927,7 +2927,8 @@
2927
2927
  fc.initOptions();
2928
2928
  fapi.refresh();
2929
2929
  }, {
2930
- deep: true
2930
+ deep: true,
2931
+ flush: 'sync'
2931
2932
  });
2932
2933
  vue.watch(function () {
2933
2934
  return _toConsumableArray(rule.value);
@@ -3596,6 +3597,28 @@
3596
3597
  return origin ? ctx.origin : ctx.rule;
3597
3598
  }
3598
3599
  },
3600
+ findType: function findType(type, origin) {
3601
+ var rule = undefined;
3602
+ Object.keys(h.ctxs).forEach(function (k) {
3603
+ var ctx = h.ctxs[k];
3604
+
3605
+ if (ctx.rule.type === type) {
3606
+ rule = origin ? ctx.origin : ctx.rule;
3607
+ }
3608
+ });
3609
+ return rule;
3610
+ },
3611
+ findTypes: function findTypes(type, origin) {
3612
+ var rules = [];
3613
+ Object.keys(h.ctxs).forEach(function (k) {
3614
+ var ctx = h.ctxs[k];
3615
+
3616
+ if (ctx.rule.type === type) {
3617
+ rules.push(origin ? ctx.origin : ctx.rule);
3618
+ }
3619
+ });
3620
+ return rules;
3621
+ },
3599
3622
  getRenderRule: function getRenderRule(id) {
3600
3623
  var ctx = h.getCtx(id);
3601
3624
 
@@ -3817,6 +3840,12 @@
3817
3840
  }
3818
3841
  });
3819
3842
  },
3843
+ setGlobalData: function setGlobalData(name, value) {
3844
+ api.setData('$globalData.' + name, value);
3845
+ },
3846
+ setGlobalVar: function setGlobalVar(name, value) {
3847
+ api.setData('$var.' + name, value);
3848
+ },
3820
3849
  renderRule: function renderRule(id, onInput, force) {
3821
3850
  var flag = _typeof(id) === 'object';
3822
3851
  var ctx = flag ? byCtx(id) : h.getCtx(id);
@@ -4318,6 +4347,9 @@
4318
4347
  slots: function slots() {
4319
4348
  return _this6.vm.setupState.top.slots;
4320
4349
  },
4350
+ getWrap: function getWrap() {
4351
+ return _this6.vm.refs[ctx.wrapRef];
4352
+ },
4321
4353
  options: [],
4322
4354
  children: [],
4323
4355
  preview: false,
@@ -5666,6 +5698,8 @@
5666
5698
  });
5667
5699
  });
5668
5700
  }
5701
+
5702
+ this.$manager.fieldChange(ctx, value, formValue, setFlag);
5669
5703
  },
5670
5704
  onInput: function onInput(ctx, value) {
5671
5705
  var val;
@@ -7307,6 +7341,7 @@
7307
7341
  getDefaultOptions: function getDefaultOptions() {
7308
7342
  return {};
7309
7343
  },
7344
+ fieldChange: function fieldChange(ctx, value, formValue, setFlag) {},
7310
7345
  render: function render(children) {}
7311
7346
  });
7312
7347
 
@@ -8195,7 +8230,8 @@
8195
8230
 
8196
8231
  _this2.$handle.api.refresh();
8197
8232
  }, {
8198
- deep: true
8233
+ deep: true,
8234
+ flush: 'sync'
8199
8235
  }));
8200
8236
  }
8201
8237
 
@@ -8381,17 +8417,11 @@
8381
8417
  var handle = is.Function(option) ? option : parseFn(option.handle);
8382
8418
 
8383
8419
  if (handle) {
8384
- var val;
8385
- var unwatch = this.watchLoadData(function (get, flag) {
8386
- if (flag) {
8387
- _this5.bus.$emit('$loadData.$var.' + key);
8420
+ var val = handle(function () {
8421
+ var _this5$$handle$api;
8388
8422
 
8389
- unwatch();
8390
- } else {
8391
- val = handle(get, _this5.$handle.api);
8392
- }
8393
- });
8394
- this.unwatch.push(unwatch);
8423
+ return (_this5$$handle$api = _this5.$handle.api).getData.apply(_this5$$handle$api, arguments);
8424
+ }, this.$handle.api);
8395
8425
  return deepGet(val, split);
8396
8426
  }
8397
8427
  }
@@ -8410,8 +8440,11 @@
8410
8440
  if (id != null) {
8411
8441
  var split = id.split('.');
8412
8442
  var key = split.shift();
8443
+ val = deepGet(this.vm.setupState.top.setupState.fc.tmpData, id);
8413
8444
 
8414
- if (key === '$topForm') {
8445
+ if (val != null) {
8446
+ return val;
8447
+ } else if (key === '$topForm') {
8415
8448
  val = this.$handle.api.top.formData(true);
8416
8449
  } else if (key === '$scopeForm') {
8417
8450
  val = this.$handle.api.scope.formData(true);
@@ -8434,13 +8467,7 @@
8434
8467
  } else if (key === '$preview') {
8435
8468
  return this.$handle.preview;
8436
8469
  } else {
8437
- var tmpData = this.vm.setupState.top.setupState.fc.tmpData;
8438
-
8439
- if (!hasProperty(tmpData, key)) {
8440
- tmpData[key] = defValueTag;
8441
- }
8442
-
8443
- val = tmpData[key] !== defValueTag ? deepGet(tmpData, id) : getData(id);
8470
+ val = getData(id);
8444
8471
  split = [];
8445
8472
  }
8446
8473
 
@@ -8999,6 +9026,13 @@
8999
9026
  fItem.clearValidate();
9000
9027
  }
9001
9028
  },
9029
+ fieldChange: function fieldChange(ctx, value, formValue, setFlag) {
9030
+ if (!setFlag) {
9031
+ var _this$vm$refs$ctx$wra, _this$vm$refs$ctx$wra2;
9032
+
9033
+ (_this$vm$refs$ctx$wra = this.vm.refs[ctx.wrapRef]) === null || _this$vm$refs$ctx$wra === void 0 ? void 0 : (_this$vm$refs$ctx$wra2 = _this$vm$refs$ctx$wra.validate('change')) === null || _this$vm$refs$ctx$wra2 === void 0 ? void 0 : _this$vm$refs$ctx$wra2["catch"](function () {});
9034
+ }
9035
+ },
9002
9036
  tidyOptions: function tidyOptions(options) {
9003
9037
  ['submitBtn', 'resetBtn', 'row', 'info', 'wrap', 'col', 'title'].forEach(function (name) {
9004
9038
  tidyBool(options, name);
@@ -9404,6 +9438,9 @@
9404
9438
  h.vm.emit('validate-fail', e, {
9405
9439
  api: api
9406
9440
  });
9441
+ h.emitEvent('validate-fail', e, {
9442
+ api: api
9443
+ });
9407
9444
  });
9408
9445
  });
9409
9446
  },
@@ -9637,7 +9674,7 @@
9637
9674
  function elmFormCreate() {
9638
9675
  return FormCreateFactory({
9639
9676
  ui: 'element-ui',
9640
- version: '3.2.26',
9677
+ version: '3.2.28',
9641
9678
  manager: manager,
9642
9679
  extendApi: extendApi,
9643
9680
  install: install,