@dolphinweex/weex-vue-render 0.2.8 → 0.2.10

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.
@@ -3460,7 +3460,7 @@ function applySrc (item, src, placeholderSrc) {
3460
3460
  * 1. apply src immediately in case javscript blocks the image loading
3461
3461
  * before next tick.
3462
3462
  */
3463
- item.style.backgroundImage = "url(" + (src ? encodeURI(src) : '') + ")";
3463
+ item.style.backgroundImage = "url(" + (src ? encodeURI(decodeURI(src)) : '') + ")";
3464
3464
  item.removeAttribute(lazyloadAttr);
3465
3465
  /**
3466
3466
  * 2. then load the img src with Image constructor (but would not post
@@ -3468,7 +3468,7 @@ function applySrc (item, src, placeholderSrc) {
3468
3468
  */
3469
3469
  item._src_loading = src;
3470
3470
  preLoadImg(src, function (evt) {
3471
- item.style.backgroundImage = "url(" + (src ? encodeURI(src) : '') + ")";
3471
+ item.style.backgroundImage = "url(" + (src ? encodeURI(decodeURI(src)) : '') + ")";
3472
3472
  var ref = this;
3473
3473
  var naturalWidth = ref.width;
3474
3474
  var naturalHeight = ref.height;
@@ -3486,7 +3486,7 @@ function applySrc (item, src, placeholderSrc) {
3486
3486
  dispatchNativeEvent(item, 'load', params);
3487
3487
  if (placeholderSrc) {
3488
3488
  preLoadImg(placeholderSrc, function () {
3489
- item.style.backgroundImage = "url(" + (placeholderSrc ? encodeURI(placeholderSrc) : '') + ")";
3489
+ item.style.backgroundImage = "url(" + (placeholderSrc ? encodeURI(decodeURI(placeholderSrc)) : '') + ")";
3490
3490
  });
3491
3491
  }
3492
3492
  finallCb();
@@ -6368,6 +6368,7 @@ var gcanvas = {
6368
6368
 
6369
6369
  var NORMAL_GAP_SIZE = 32;
6370
6370
  var DEFAULT_COLUMN_COUNT = 1;
6371
+ var DEFAULT_GAP = 0;
6371
6372
 
6372
6373
  function getWaterfall (weex) {
6373
6374
  var extractComponentStyle = weex.extractComponentStyle;
@@ -6417,6 +6418,22 @@ function getWaterfall (weex) {
6417
6418
  val = parseInt(val);
6418
6419
  return !isNaN(val) && val > 0
6419
6420
  }
6421
+ },
6422
+ leftGap: {
6423
+ type: [String, Number],
6424
+ default: DEFAULT_GAP,
6425
+ validator: function validator (val) {
6426
+ val = parseInt(val);
6427
+ return !isNaN(val) && val > 0
6428
+ }
6429
+ },
6430
+ rightGap: {
6431
+ type: [String, Number],
6432
+ default: DEFAULT_GAP,
6433
+ validator: function validator (val) {
6434
+ val = parseInt(val);
6435
+ return !isNaN(val) && val > 0
6436
+ }
6420
6437
  }
6421
6438
  },
6422
6439
 
@@ -6429,7 +6446,7 @@ function getWaterfall (weex) {
6429
6446
  },
6430
6447
 
6431
6448
  methods: {
6432
- _createChildren: function _createChildren (h, rootStyle) {
6449
+ _createChildren: function _createChildren (h, rootStyle, leftAndRightGapStyle) {
6433
6450
  var this$1 = this;
6434
6451
 
6435
6452
  var slots = (this.$slots.default || []).slice();
@@ -6498,7 +6515,8 @@ function getWaterfall (weex) {
6498
6515
  // .concat(this._others)
6499
6516
  children.push(h('html:div', {
6500
6517
  ref: 'columns',
6501
- staticClass: 'weex-waterfall-inner-columns weex-ct'
6518
+ staticClass: 'weex-waterfall-inner-columns weex-ct',
6519
+ staticStyle: leftAndRightGapStyle
6502
6520
  }, this._columns));
6503
6521
  children.push(h('html:div', {
6504
6522
  ref: 'footers',
@@ -6711,6 +6729,17 @@ function getWaterfall (weex) {
6711
6729
  this$1.updateLayout();
6712
6730
  });
6713
6731
  var mergedStyle = extractComponentStyle(this);
6732
+
6733
+ var rate = 750 / document.documentElement.clientWidth // 750设计稿放缩倍率
6734
+
6735
+ var leftAndRightGapStyle = {}
6736
+ if (this.leftGap) {
6737
+ leftAndRightGapStyle.paddingLeft = this.leftGap / rate + 'px';
6738
+ }
6739
+ if (this.rightGap) {
6740
+ leftAndRightGapStyle.paddingRight = this.leftGap / rate + 'px';
6741
+ }
6742
+
6714
6743
  return createElement('main', {
6715
6744
  ref: 'wrapper',
6716
6745
  attrs: { 'weex-type': 'waterfall' },
@@ -6722,7 +6751,7 @@ function getWaterfall (weex) {
6722
6751
  },
6723
6752
  staticClass: 'weex-waterfall weex-waterfall-wrapper weex-ct',
6724
6753
  staticStyle: mergedStyle
6725
- }, this._createChildren(createElement, mergedStyle))
6754
+ }, this._createChildren(createElement, mergedStyle, leftAndRightGapStyle))
6726
6755
  }
6727
6756
  }
6728
6757
  }
@@ -6768,7 +6797,12 @@ function getHeader (weex) {
6768
6797
  },
6769
6798
  ref: 'header',
6770
6799
  staticClass: 'weex-header weex-ct',
6771
- staticStyle: extractComponentStyle(this)
6800
+ staticStyle: {
6801
+ ...extractComponentStyle(this),
6802
+ ...{
6803
+ maxWidth: '100vw'
6804
+ }
6805
+ }
6772
6806
  }, this.$slots.default)
6773
6807
  }
6774
6808
  }
@@ -7269,7 +7303,7 @@ var recycleList = {
7269
7303
  }
7270
7304
  };
7271
7305
 
7272
- __$styleInject("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nbody > .weex-list,\nbody > .weex-recycle,\nbody > .weex-scroller,\nbody > .weex-waterfall {\n max-height: 100%;\n}\n\n.weex-list-wrapper,\n.weex-recycle-wrapper,\n.weex-scroller-wrapper,\n.weex-waterfall-wrapper {\n -webkit-overflow-scrolling: touch;\n}\n\n.weex-list-wrapper,\n.weex-waterfall-wrapper, \n.weex-recycle-wrapper {\n overflow-y: scroll !important;\n overflow-x: hidden !important;\n align-items: flex-start !important;\n justify-content: flex-start !important;\n}\n\n.weex-list-inner,\n.weex-recycle-inner,\n.weex-scroller-inner,\n.weex-waterfall-inner {\n -webkit-overflow-scrolling: touch;\n align-items: inherit; \n}\n\n.weex-waterfall-inner-columns {\n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n}\n\n.weex-scroller-wrapper.weex-scroller-vertical,\n.weex-recycle-wrapper.weex-recycle-vertical {\n overflow-x: hidden;\n overflow-y: scroll;\n}\n\n.weex-scroller-wrapper.weex-scroller-horizontal,\n.weex-recycle-wrapper.weex-recycle-horizontal {\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.weex-scroller-wrapper.weex-scroller-disabled {\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.weex-scroller-horizontal .weex-scroller-inner,\n.weex-recycle-horizontal .weex-recycle-inner {\n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n height: 100%;\n}\n\n.weex-cell {\n width: 100%;\n}\n\n.weex-refresh,\n.weex-loading {\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n}\n",undefined);
7306
+ __$styleInject("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nbody > .weex-list,\nbody > .weex-recycle,\nbody > .weex-scroller,\nbody > .weex-waterfall {\n max-height: 100%;\n}\n\n.weex-list-wrapper,\n.weex-recycle-wrapper,\n.weex-scroller-wrapper,\n.weex-waterfall-wrapper {\n -webkit-overflow-scrolling: touch;\n}\n\n.weex-list-wrapper,\n.weex-waterfall-wrapper, \n.weex-recycle-wrapper {\n overflow-y: scroll !important;\n overflow-x: hidden !important;\n align-items: flex-start !important;\n justify-content: flex-start !important;\n}\n\n.weex-list-inner,\n.weex-recycle-inner,\n.weex-scroller-inner,\n.weex-waterfall-inner {\n -webkit-overflow-scrolling: touch;\n align-items: inherit; \n}\n\n.weex-waterfall-inner-columns { \n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n}\n\n.weex-scroller-wrapper.weex-scroller-vertical,\n.weex-recycle-wrapper.weex-recycle-vertical {\n overflow-x: hidden;\n overflow-y: scroll;\n}\n\n.weex-scroller-wrapper.weex-scroller-horizontal,\n.weex-recycle-wrapper.weex-recycle-horizontal {\n overflow-x: scroll;\n overflow-y: hidden;\n}\n\n.weex-scroller-wrapper.weex-scroller-disabled {\n overflow-x: hidden;\n overflow-y: hidden;\n}\n\n.weex-scroller-horizontal .weex-scroller-inner,\n.weex-recycle-horizontal .weex-recycle-inner {\n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n height: 100%;\n}\n\n.weex-cell {\n width: 100%;\n}\n\n.weex-refresh,\n.weex-loading {\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n justify-content: center;\n width: 100%;\n overflow: hidden;\n}\n",undefined);
7273
7307
 
7274
7308
  /*
7275
7309
  * Licensed to the Apache Software Foundation (ASF) under one
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "type": "git",
50
50
  "url": "git+ssh://git@github.com/weexteam/weex-vue-render.git"
51
51
  },
52
- "version": "0.2.8"
52
+ "version": "0.2.10"
53
53
  }