@v2coding/ui 0.1.52 → 0.1.54

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.
@@ -7755,30 +7755,50 @@ var script$g = {
7755
7755
  * (函数节流. 600ms内只执行一次, 防止 form 表单多次提交)
7756
7756
  * @private
7757
7757
  */
7758
- onSubmit: lodash.throttle(function () {
7758
+ onSubmit: lodash.throttle( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7759
7759
  var _this = this;
7760
7760
 
7761
- var formData = this.getValues();
7762
- var allow = this.beforeSubmit(formData);
7761
+ var formData, allow;
7762
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
7763
+ while (1) {
7764
+ switch (_context.prev = _context.next) {
7765
+ case 0:
7766
+ formData = this.getValues();
7767
+ _context.next = 3;
7768
+ return this.beforeSubmit(formData);
7763
7769
 
7764
- if (typeof allow === 'boolean' && allow === false) {
7765
- return;
7766
- }
7770
+ case 3:
7771
+ allow = _context.sent;
7767
7772
 
7768
- if (_typeof(allow) === 'object') {
7769
- formData = allow;
7770
- }
7773
+ if (!(typeof allow === 'boolean' && allow === false)) {
7774
+ _context.next = 6;
7775
+ break;
7776
+ }
7771
7777
 
7772
- this.validate(function (valid) {
7773
- if (!valid) {
7774
- return;
7775
- }
7778
+ return _context.abrupt("return");
7776
7779
 
7777
- _this.$emit('submit', formData);
7780
+ case 6:
7781
+ if (_typeof(allow) === 'object') {
7782
+ formData = allow;
7783
+ }
7778
7784
 
7779
- _this.doAction(formData);
7780
- });
7781
- }, 600, {
7785
+ this.validate(function (valid) {
7786
+ if (!valid) {
7787
+ return;
7788
+ }
7789
+
7790
+ _this.$emit('submit', formData);
7791
+
7792
+ _this.doAction(formData);
7793
+ });
7794
+
7795
+ case 8:
7796
+ case "end":
7797
+ return _context.stop();
7798
+ }
7799
+ }
7800
+ }, _callee, this);
7801
+ })), 600, {
7782
7802
  trailing: false
7783
7803
  }),
7784
7804
  doAction: function doAction(data) {
@@ -7968,8 +7988,8 @@ var __vue_staticRenderFns__$f = [];
7968
7988
 
7969
7989
  var __vue_inject_styles__$g = function __vue_inject_styles__(inject) {
7970
7990
  if (!inject) return;
7971
- inject("data-v-a797a0b6_0", {
7972
- source: ".el-form--inline[data-v-a797a0b6] .el-form-item{display:inline-flex}",
7991
+ inject("data-v-3dfdaaf7_0", {
7992
+ source: ".el-form--inline[data-v-3dfdaaf7] .el-form-item{display:inline-flex}",
7973
7993
  map: undefined,
7974
7994
  media: undefined
7975
7995
  });
@@ -7977,10 +7997,10 @@ var __vue_inject_styles__$g = function __vue_inject_styles__(inject) {
7977
7997
  /* scoped */
7978
7998
 
7979
7999
 
7980
- var __vue_scope_id__$g = "data-v-a797a0b6";
8000
+ var __vue_scope_id__$g = "data-v-3dfdaaf7";
7981
8001
  /* module identifier */
7982
8002
 
7983
- var __vue_module_identifier__$g = "data-v-a797a0b6";
8003
+ var __vue_module_identifier__$g = "data-v-3dfdaaf7";
7984
8004
  /* functional template */
7985
8005
 
7986
8006
  var __vue_is_functional_template__$g = false;
@@ -8139,13 +8159,6 @@ var script$f = {
8139
8159
 
8140
8160
  this.$refs.form.resetValues(values, all);
8141
8161
  },
8142
- clearValidate: function clearValidate() {
8143
- if (!this.$refs.form) {
8144
- return;
8145
- }
8146
-
8147
- this.$refs.form.clearValidate();
8148
- },
8149
8162
  getValues: function getValues() {
8150
8163
  if (!this.$refs.form) {
8151
8164
  return;
@@ -8160,51 +8173,106 @@ var script$f = {
8160
8173
 
8161
8174
  this.$refs.form.setValues(values);
8162
8175
  },
8163
- onSubmit: function onSubmit(formData) {
8164
- var _this2 = this;
8176
+ validate: function validate() {
8177
+ var _this$$refs$form;
8165
8178
 
8166
- if (!this.ready) {
8179
+ if (!this.$refs.form) {
8167
8180
  return;
8168
8181
  }
8169
8182
 
8170
- this.$emit('submit', _objectSpread2({}, formData));
8171
- var allow = this.beforeSubmit(formData);
8183
+ return (_this$$refs$form = this.$refs.form).validate.apply(_this$$refs$form, arguments);
8184
+ },
8185
+ validateField: function validateField() {
8186
+ var _this$$refs$form2;
8172
8187
 
8173
- if (typeof allow === 'boolean' && allow === false) {
8188
+ if (!this.$refs.form) {
8174
8189
  return;
8175
8190
  }
8176
8191
 
8177
- if (_typeof(allow) === 'object') {
8178
- formData = allow;
8179
- }
8180
-
8181
- if (!this.url) {
8192
+ return (_this$$refs$form2 = this.$refs.form).validateField.apply(_this$$refs$form2, arguments);
8193
+ },
8194
+ clearValidate: function clearValidate() {
8195
+ if (!this.$refs.form) {
8182
8196
  return;
8183
8197
  }
8184
8198
 
8185
- var def;
8186
- this.submitting = true;
8199
+ this.$refs.form.clearValidate();
8200
+ },
8201
+ onSubmit: function onSubmit(formData) {
8202
+ var _this2 = this;
8187
8203
 
8188
- if (this.method === 'get') {
8189
- def = this.getWithMessage(this.url, {
8190
- params: formData
8191
- });
8192
- } else {
8193
- def = this.postWithMessage(this.url, formData);
8194
- }
8204
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
8205
+ var allow, def;
8206
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8207
+ while (1) {
8208
+ switch (_context2.prev = _context2.next) {
8209
+ case 0:
8210
+ if (_this2.ready) {
8211
+ _context2.next = 2;
8212
+ break;
8213
+ }
8195
8214
 
8196
- def.then(function () {
8197
- _this2.submitting = false;
8215
+ return _context2.abrupt("return");
8198
8216
 
8199
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8200
- args[_key] = arguments[_key];
8201
- }
8217
+ case 2:
8218
+ _this2.$emit('submit', _objectSpread2({}, formData));
8202
8219
 
8203
- _this2.$emit.apply(_this2, ['after-submit'].concat(args));
8204
- }).catch(function () {
8205
- _this2.submitting = false;
8206
- return Promise.reject.apply(Promise, arguments);
8207
- });
8220
+ _context2.next = 5;
8221
+ return _this2.beforeSubmit(formData);
8222
+
8223
+ case 5:
8224
+ allow = _context2.sent;
8225
+
8226
+ if (!(typeof allow === 'boolean' && allow === false)) {
8227
+ _context2.next = 8;
8228
+ break;
8229
+ }
8230
+
8231
+ return _context2.abrupt("return");
8232
+
8233
+ case 8:
8234
+ if (_typeof(allow) === 'object') {
8235
+ formData = allow;
8236
+ }
8237
+
8238
+ if (_this2.url) {
8239
+ _context2.next = 11;
8240
+ break;
8241
+ }
8242
+
8243
+ return _context2.abrupt("return");
8244
+
8245
+ case 11:
8246
+ _this2.submitting = true;
8247
+
8248
+ if (_this2.method === 'get') {
8249
+ def = _this2.getWithMessage(_this2.url, {
8250
+ params: formData
8251
+ });
8252
+ } else {
8253
+ def = _this2.postWithMessage(_this2.url, formData);
8254
+ }
8255
+
8256
+ def.then(function () {
8257
+ _this2.submitting = false;
8258
+
8259
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8260
+ args[_key] = arguments[_key];
8261
+ }
8262
+
8263
+ _this2.$emit.apply(_this2, ['after-submit'].concat(args));
8264
+ }).catch(function () {
8265
+ _this2.submitting = false;
8266
+ return Promise.reject.apply(Promise, arguments);
8267
+ });
8268
+
8269
+ case 14:
8270
+ case "end":
8271
+ return _context2.stop();
8272
+ }
8273
+ }
8274
+ }, _callee2);
8275
+ }))();
8208
8276
  },
8209
8277
  onOpen: function onOpen() {},
8210
8278
  onOpened: function onOpened() {},
@@ -8278,8 +8346,8 @@ var __vue_staticRenderFns__$e = [];
8278
8346
 
8279
8347
  var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
8280
8348
  if (!inject) return;
8281
- inject("data-v-3f84d6b9_0", {
8282
- source: ".action-button[data-v-3f84d6b9]{text-align:right;margin:0 -20px -20px;padding:10px 20px;border-top:1px solid #e8e8e8}",
8349
+ inject("data-v-42a629ae_0", {
8350
+ source: ".action-button[data-v-42a629ae]{text-align:right;margin:0 -20px -20px;padding:10px 20px;border-top:1px solid #e8e8e8}",
8283
8351
  map: undefined,
8284
8352
  media: undefined
8285
8353
  });
@@ -8287,10 +8355,10 @@ var __vue_inject_styles__$f = function __vue_inject_styles__(inject) {
8287
8355
  /* scoped */
8288
8356
 
8289
8357
 
8290
- var __vue_scope_id__$f = "data-v-3f84d6b9";
8358
+ var __vue_scope_id__$f = "data-v-42a629ae";
8291
8359
  /* module identifier */
8292
8360
 
8293
- var __vue_module_identifier__$f = "data-v-3f84d6b9";
8361
+ var __vue_module_identifier__$f = "data-v-42a629ae";
8294
8362
  /* functional template */
8295
8363
 
8296
8364
  var __vue_is_functional_template__$f = false;
@@ -8575,59 +8643,103 @@ var script$d = {
8575
8643
 
8576
8644
  this.$refs.form.setValues(values);
8577
8645
  },
8578
- clearValidate: function clearValidate() {
8646
+ validate: function validate() {
8579
8647
  var _this$$refs$form;
8580
8648
 
8581
8649
  if (!this.$refs.form) {
8582
8650
  return;
8583
8651
  }
8584
8652
 
8585
- (_this$$refs$form = this.$refs.form).clearValidate.apply(_this$$refs$form, arguments);
8653
+ return (_this$$refs$form = this.$refs.form).validate.apply(_this$$refs$form, arguments);
8586
8654
  },
8587
- onSubmit: function onSubmit(formData) {
8588
- var _this2 = this;
8589
-
8590
- // if (!this.ready) {
8591
- // return;
8592
- // }
8593
- this.$emit('submit', _objectSpread2({}, formData));
8594
- var allow = this.beforeSubmit(formData);
8655
+ validateField: function validateField() {
8656
+ var _this$$refs$form2;
8595
8657
 
8596
- if (typeof allow === 'boolean' && allow === false) {
8658
+ if (!this.$refs.form) {
8597
8659
  return;
8598
8660
  }
8599
8661
 
8600
- if (_typeof(allow) === 'object') {
8601
- formData = allow;
8602
- }
8662
+ return (_this$$refs$form2 = this.$refs.form).validateField.apply(_this$$refs$form2, arguments);
8663
+ },
8664
+ clearValidate: function clearValidate() {
8665
+ var _this$$refs$form3;
8603
8666
 
8604
- if (!this.url) {
8667
+ if (!this.$refs.form) {
8605
8668
  return;
8606
8669
  }
8607
8670
 
8608
- var def;
8609
- this.submitting = true;
8671
+ (_this$$refs$form3 = this.$refs.form).clearValidate.apply(_this$$refs$form3, arguments);
8672
+ },
8673
+ onSubmit: function onSubmit(formData) {
8674
+ var _this2 = this;
8610
8675
 
8611
- if (this.method === 'get') {
8612
- def = this.getWithMessage(this.url, {
8613
- params: formData
8614
- });
8615
- } else {
8616
- def = this.postWithMessage(this.url, formData);
8617
- }
8676
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
8677
+ var allow, def;
8678
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8679
+ while (1) {
8680
+ switch (_context2.prev = _context2.next) {
8681
+ case 0:
8682
+ // if (!this.ready) {
8683
+ // return;
8684
+ // }
8685
+ _this2.$emit('submit', _objectSpread2({}, formData));
8618
8686
 
8619
- def.then(function () {
8620
- _this2.submitting = false;
8687
+ _context2.next = 3;
8688
+ return _this2.beforeSubmit(formData);
8621
8689
 
8622
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8623
- args[_key] = arguments[_key];
8624
- }
8690
+ case 3:
8691
+ allow = _context2.sent;
8625
8692
 
8626
- _this2.$emit.apply(_this2, ['after-submit'].concat(args));
8627
- }).catch(function () {
8628
- _this2.submitting = false;
8629
- return Promise.reject.apply(Promise, arguments);
8630
- });
8693
+ if (!(typeof allow === 'boolean' && allow === false)) {
8694
+ _context2.next = 6;
8695
+ break;
8696
+ }
8697
+
8698
+ return _context2.abrupt("return");
8699
+
8700
+ case 6:
8701
+ if (_typeof(allow) === 'object') {
8702
+ formData = allow;
8703
+ }
8704
+
8705
+ if (_this2.url) {
8706
+ _context2.next = 9;
8707
+ break;
8708
+ }
8709
+
8710
+ return _context2.abrupt("return");
8711
+
8712
+ case 9:
8713
+ _this2.submitting = true;
8714
+
8715
+ if (_this2.method === 'get') {
8716
+ def = _this2.getWithMessage(_this2.url, {
8717
+ params: formData
8718
+ });
8719
+ } else {
8720
+ def = _this2.postWithMessage(_this2.url, formData);
8721
+ }
8722
+
8723
+ def.then(function () {
8724
+ _this2.submitting = false;
8725
+
8726
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8727
+ args[_key] = arguments[_key];
8728
+ }
8729
+
8730
+ _this2.$emit.apply(_this2, ['after-submit'].concat(args));
8731
+ }).catch(function () {
8732
+ _this2.submitting = false;
8733
+ return Promise.reject.apply(Promise, arguments);
8734
+ });
8735
+
8736
+ case 12:
8737
+ case "end":
8738
+ return _context2.stop();
8739
+ }
8740
+ }
8741
+ }, _callee2);
8742
+ }))();
8631
8743
  }
8632
8744
  }
8633
8745
  };/* script */
@@ -8698,7 +8810,7 @@ var __vue_staticRenderFns__$c = [];
8698
8810
 
8699
8811
  var __vue_inject_styles__$d = function __vue_inject_styles__(inject) {
8700
8812
  if (!inject) return;
8701
- inject("data-v-4b8320b5_0", {
8813
+ inject("data-v-0dd33ec0_0", {
8702
8814
  source: ".ui-form-drawer{display:flex;flex-direction:column;padding:0;outline:0}.ui-form-drawer .el-drawer-body{flex:1;padding:0;overflow:hidden;display:flex;flex-direction:column}.ui-form-drawer .el-drawer-body>.el-form{flex:1;overflow:auto}.ui-form-drawer .el-drawer-body>.action-button{flex:none}.ui-form-drawer .ui-form-drawer-wrapper{flex:1;overflow:hidden}.ui-form-drawer .ui-form-drawer-wrapper .el-form{width:100%;height:100%;overflow:auto;padding:16px;box-sizing:border-box}.ui-form-drawer .action-button{flex:none;padding:16px;border-top:1px solid #e8eaec;display:flex;flex-direction:row-reverse}.ui-form-drawer .action-button button+button{margin-right:16px}.ui-form-drawer .action-button::after{content:'';clear:both}",
8703
8815
  map: undefined,
8704
8816
  media: undefined
@@ -8710,7 +8822,7 @@ var __vue_inject_styles__$d = function __vue_inject_styles__(inject) {
8710
8822
  var __vue_scope_id__$d = undefined;
8711
8823
  /* module identifier */
8712
8824
 
8713
- var __vue_module_identifier__$d = "data-v-4b8320b5";
8825
+ var __vue_module_identifier__$d = "data-v-0dd33ec0";
8714
8826
  /* functional template */
8715
8827
 
8716
8828
  var __vue_is_functional_template__$d = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@v2coding/ui",
3
- "version": "0.1.52",
3
+ "version": "0.1.54",
4
4
  "description": "",
5
5
 
6
6
  "main": "dist/v2coding-ui.ssr.js",