vant 2.12.52 → 2.12.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.
package/lib/index.js CHANGED
@@ -361,7 +361,7 @@ exports.TreeSelect = _treeSelect.default;
361
361
  var _uploader = _interopRequireDefault(require("./uploader"));
362
362
 
363
363
  exports.Uploader = _uploader.default;
364
- var version = '2.12.52';
364
+ var version = '2.12.54';
365
365
  exports.version = version;
366
366
 
367
367
  function install(Vue) {
@@ -72,13 +72,18 @@ var _default2 = createComponent({
72
72
  },
73
73
  beforeDestroy: function beforeDestroy() {
74
74
  if (this.popper) {
75
+ if (!_utils.isServer) {
76
+ window.removeEventListener('animationend', this.updateLocation);
77
+ window.removeEventListener('transitionend', this.updateLocation);
78
+ }
79
+
75
80
  this.popper.destroy();
76
81
  this.popper = null;
77
82
  }
78
83
  },
79
84
  methods: {
80
85
  createPopper: function createPopper() {
81
- return (0, _popperjs.createPopper)(this.$refs.wrapper, this.$refs.popover.$el, {
86
+ var popper = (0, _popperjs.createPopper)(this.$refs.wrapper, this.$refs.popover.$el, {
82
87
  placement: this.placement,
83
88
  modifiers: [{
84
89
  name: 'computeStyles',
@@ -92,6 +97,13 @@ var _default2 = createComponent({
92
97
  }
93
98
  })]
94
99
  });
100
+
101
+ if (!_utils.isServer) {
102
+ window.addEventListener('animationend', this.updateLocation);
103
+ window.addEventListener('transitionend', this.updateLocation);
104
+ }
105
+
106
+ return popper;
95
107
  },
96
108
  updateLocation: function updateLocation() {
97
109
  var _this = this;
@@ -1 +1 @@
1
- .van-search{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;padding:10px 12px;background-color:#fff}.van-search__content{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding-left:12px;background-color:#f7f8fa;border-radius:2px}.van-search__content--round{border-radius:999px}.van-search__label{padding:0 5px;color:#323233;font-size:14px;line-height:34px}.van-search .van-cell{-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:5px 8px 5px 0;background-color:transparent}.van-search .van-cell__left-icon{color:#969799}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:0 8px;color:#323233;font-size:14px;line-height:34px;cursor:pointer;-webkit-user-select:none;user-select:none}.van-search__action:active{background-color:#f2f3f5}
1
+ .van-search{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;padding:10px 12px;background-color:#fff}.van-search__content{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1;padding-left:12px;background-color:#f7f8fa;border-radius:2px}.van-search__content--round{border-radius:999px}.van-search__label{padding:0 5px;color:#323233;font-size:14px;line-height:34px}.van-search .van-cell{-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:5px 8px 5px 0;background-color:transparent}.van-search .van-cell .van-field__left-icon{color:#969799}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:0 8px;color:#323233;font-size:14px;line-height:34px;cursor:pointer;-webkit-user-select:none;user-select:none}.van-search__action:active{background-color:#f2f3f5}
@@ -31,7 +31,7 @@
31
31
  padding: 5px @padding-xs 5px 0;
32
32
  background-color: transparent;
33
33
 
34
- &__left-icon {
34
+ .van-field__left-icon {
35
35
  color: @search-left-icon-color;
36
36
  }
37
37
  }
package/lib/sku/Sku.js CHANGED
@@ -424,10 +424,18 @@ var _default2 = createComponent({
424
424
  k_id = item.k_id;
425
425
  var isHasConfigPrice = v.some(function (i) {
426
426
  return +i.price !== 0;
427
- });
427
+ }); // 没有加价属性
428
428
 
429
429
  if (!isHasConfigPrice) {
430
- _this3.selectedProp[k_id] = [v[0].id];
430
+ // 找到第一个不被禁用的属性
431
+ // 历史如果没有 text_status 字段的,就相当于沿用直接原来的逻辑取第一个属性
432
+ var firstEnableProp = v.find(function (prop) {
433
+ return prop.text_status !== 0;
434
+ });
435
+
436
+ if (firstEnableProp) {
437
+ _this3.selectedProp[k_id] = [firstEnableProp.id];
438
+ }
431
439
  }
432
440
  }
433
441
  });
@@ -722,7 +730,8 @@ var _default2 = createComponent({
722
730
  "skuKeyStr": skuTreeItem.k_id + '',
723
731
  "selectedProp": selectedProp,
724
732
  "skuEventBus": skuEventBus,
725
- "multiple": skuTreeItem.is_multiple
733
+ "multiple": skuTreeItem.is_multiple,
734
+ "disabled": skuValue.text_status === 0
726
735
  }
727
736
  });
728
737
  })]);
@@ -18,7 +18,8 @@ var _default = createComponent({
18
18
  skuKeyStr: String,
19
19
  skuEventBus: Object,
20
20
  selectedProp: Object,
21
- multiple: Boolean
21
+ multiple: Boolean,
22
+ disabled: Boolean
22
23
  },
23
24
  computed: {
24
25
  choosed: function choosed() {
@@ -35,6 +36,7 @@ var _default = createComponent({
35
36
  },
36
37
  methods: {
37
38
  onSelect: function onSelect() {
39
+ if (this.disabled) return;
38
40
  this.skuEventBus.$emit('sku:propSelect', (0, _extends2.default)({}, this.skuValue, {
39
41
  skuKeyStr: this.skuKeyStr,
40
42
  multiple: this.multiple
@@ -46,6 +48,8 @@ var _default = createComponent({
46
48
  return h("span", {
47
49
  "class": ['van-sku-row__item', {
48
50
  'van-sku-row__item--active': this.choosed
51
+ }, {
52
+ 'van-sku-row__item--disabled': this.disabled
49
53
  }],
50
54
  "on": {
51
55
  "click": this.onSelect
package/lib/vant.js CHANGED
@@ -17553,13 +17553,18 @@ var popover_createNamespace = Object(create["a" /* createNamespace */])('popover
17553
17553
  },
17554
17554
  beforeDestroy: function beforeDestroy() {
17555
17555
  if (this.popper) {
17556
+ if (!utils["h" /* isServer */]) {
17557
+ window.removeEventListener('animationend', this.updateLocation);
17558
+ window.removeEventListener('transitionend', this.updateLocation);
17559
+ }
17560
+
17556
17561
  this.popper.destroy();
17557
17562
  this.popper = null;
17558
17563
  }
17559
17564
  },
17560
17565
  methods: {
17561
17566
  createPopper: function createPopper() {
17562
- return esm_createPopper(this.$refs.wrapper, this.$refs.popover.$el, {
17567
+ var popper = esm_createPopper(this.$refs.wrapper, this.$refs.popover.$el, {
17563
17568
  placement: this.placement,
17564
17569
  modifiers: [{
17565
17570
  name: 'computeStyles',
@@ -17573,6 +17578,13 @@ var popover_createNamespace = Object(create["a" /* createNamespace */])('popover
17573
17578
  }
17574
17579
  })]
17575
17580
  });
17581
+
17582
+ if (!utils["h" /* isServer */]) {
17583
+ window.addEventListener('animationend', this.updateLocation);
17584
+ window.addEventListener('transitionend', this.updateLocation);
17585
+ }
17586
+
17587
+ return popper;
17576
17588
  },
17577
17589
  updateLocation: function updateLocation() {
17578
17590
  var _this = this;
@@ -19400,7 +19412,8 @@ var SkuRowPropItem_createNamespace = Object(create["a" /* createNamespace */])('
19400
19412
  skuKeyStr: String,
19401
19413
  skuEventBus: Object,
19402
19414
  selectedProp: Object,
19403
- multiple: Boolean
19415
+ multiple: Boolean,
19416
+ disabled: Boolean
19404
19417
  },
19405
19418
  computed: {
19406
19419
  choosed: function choosed() {
@@ -19417,6 +19430,7 @@ var SkuRowPropItem_createNamespace = Object(create["a" /* createNamespace */])('
19417
19430
  },
19418
19431
  methods: {
19419
19432
  onSelect: function onSelect() {
19433
+ if (this.disabled) return;
19420
19434
  this.skuEventBus.$emit('sku:propSelect', _extends({}, this.skuValue, {
19421
19435
  skuKeyStr: this.skuKeyStr,
19422
19436
  multiple: this.multiple
@@ -19428,6 +19442,8 @@ var SkuRowPropItem_createNamespace = Object(create["a" /* createNamespace */])('
19428
19442
  return h("span", {
19429
19443
  "class": ['van-sku-row__item', {
19430
19444
  'van-sku-row__item--active': this.choosed
19445
+ }, {
19446
+ 'van-sku-row__item--disabled': this.disabled
19431
19447
  }],
19432
19448
  "on": {
19433
19449
  "click": this.onSelect
@@ -21443,10 +21459,18 @@ var Sku_QUOTA_LIMIT = LIMIT_TYPE.QUOTA_LIMIT;
21443
21459
  k_id = item.k_id;
21444
21460
  var isHasConfigPrice = v.some(function (i) {
21445
21461
  return +i.price !== 0;
21446
- });
21462
+ }); // 没有加价属性
21447
21463
 
21448
21464
  if (!isHasConfigPrice) {
21449
- _this3.selectedProp[k_id] = [v[0].id];
21465
+ // 找到第一个不被禁用的属性
21466
+ // 历史如果没有 text_status 字段的,就相当于沿用直接原来的逻辑取第一个属性
21467
+ var firstEnableProp = v.find(function (prop) {
21468
+ return prop.text_status !== 0;
21469
+ });
21470
+
21471
+ if (firstEnableProp) {
21472
+ _this3.selectedProp[k_id] = [firstEnableProp.id];
21473
+ }
21450
21474
  }
21451
21475
  }
21452
21476
  });
@@ -21742,7 +21766,8 @@ var Sku_QUOTA_LIMIT = LIMIT_TYPE.QUOTA_LIMIT;
21742
21766
  "skuKeyStr": skuTreeItem.k_id + '',
21743
21767
  "selectedProp": selectedProp,
21744
21768
  "skuEventBus": skuEventBus,
21745
- "multiple": skuTreeItem.is_multiple
21769
+ "multiple": skuTreeItem.is_multiple,
21770
+ "disabled": skuValue.text_status === 0
21746
21771
  }
21747
21772
  });
21748
21773
  })]);
@@ -23180,7 +23205,7 @@ TreeSelect.props = {
23180
23205
 
23181
23206
 
23182
23207
 
23183
- var version = '2.12.52';
23208
+ var version = '2.12.54';
23184
23209
 
23185
23210
  function install(Vue) {
23186
23211
  var components = [action_sheet, address_edit, address_list, es_area, badge, es_button, calendar, card, cascader, cell, cell_group, es_checkbox, checkbox_group, circle, col, collapse, collapse_item, contact_card, contact_edit, contact_list, count_down, es_coupon, coupon_cell, coupon_list, datetime_picker, dialog, divider, dropdown_item, dropdown_menu, empty, es_field, es_form, goods_action, goods_action_button, goods_action_icon, grid, grid_item, es_icon, es_image, image_preview, index_anchor, index_bar, es_info, es_list, es_loading, locale["a" /* default */], nav_bar, notice_bar, notify, number_keyboard, es_overlay, pagination, panel, password_input, es_picker, popover, popup, es_progress, pull_refresh, es_radio, radio_group, es_rate, row, search, share_sheet, sidebar, sidebar_item, skeleton, es_sku, slider, es_step, stepper, steps, es_sticky, submit_bar, swipe, swipe_cell, swipe_item, es_switch, switch_cell, tab, tabbar, tabbar_item, tabs, es_tag, es_toast, tree_select, uploader];