@dolphinweex/weex-vue-render 0.2.12 → 0.2.14

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.
@@ -1789,9 +1789,17 @@ function touchendHandler(event) {
1789
1789
  if (gesture.status === 'tapping') {
1790
1790
  gesture.timestamp = Date.now();
1791
1791
  // fire click, not tap.
1792
+ var rect = gesture.element.getBoundingClientRect();
1793
+ var rate = 750 / document.documentElement.clientWidth;
1792
1794
  fireEvent(gesture.element, 'weex$tap', {
1793
1795
  touch: touch,
1794
- touchEvent: event
1796
+ touchEvent: event,
1797
+ position: {
1798
+ x: rect.x * rate,
1799
+ y: rect.y * rate,
1800
+ width: rect.width * rate,
1801
+ height: rect.height * rate,
1802
+ }
1795
1803
  });
1796
1804
 
1797
1805
  if (lastTap && gesture.timestamp - lastTap.timestamp < 300) {
@@ -5460,6 +5468,12 @@ function getInput (weex) {
5460
5468
  returnKeyType: String
5461
5469
  },
5462
5470
 
5471
+ mounted: function mounted () {
5472
+ if (this.autofocus !== 'false' && this.autofocus !== false) {
5473
+ this.focus()
5474
+ }
5475
+ },
5476
+
5463
5477
  render: function render (createElement) {
5464
5478
  if (!this._id) {
5465
5479
  this._id = idCount++;
@@ -6118,7 +6132,8 @@ function getList (weex) {
6118
6132
  createChildren: function createChildren (h) {
6119
6133
  var slots = this.$slots.default || [];
6120
6134
  this._cells = slots.filter(function (vnode) {
6121
- if (!vnode.tag && !vnode.componentOptions) { return false }
6135
+ const trimmedText = vnode.text&&vnode.text.replace(/\s+/g, '').trim();
6136
+ if (!vnode.tag && !trimmedText) { return false }
6122
6137
  return true
6123
6138
  });
6124
6139
  return [
@@ -6236,7 +6251,8 @@ function getScroller (weex) {
6236
6251
  createChildren: function createChildren (h) {
6237
6252
  var slots = this.$slots.default || [];
6238
6253
  this._cells = slots.filter(function (vnode) {
6239
- if (!vnode.tag && !vnode.componentOptions) { return false }
6254
+ const trimmedText = vnode.text&&vnode.text.replace(/\s+/g, '').trim();
6255
+ if (!vnode.tag && !trimmedText) { return false }
6240
6256
  return true
6241
6257
  });
6242
6258
  return [
@@ -7310,7 +7326,7 @@ var recycleList = {
7310
7326
  }
7311
7327
  };
7312
7328
 
7313
- __$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 max-width: 100vw; \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 max-width: 100vw; \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);
7329
+ __$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 max-width: 100vw; \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 flex:1; \n}\n\n.weex-waterfall-inner-columns { \n -webkit-flex-direction: row;\n flex-direction: row;\n -webkit-box-orient: horizontal;\n max-width: 100vw; \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);
7314
7330
 
7315
7331
  /*
7316
7332
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -7550,7 +7566,7 @@ var slideMixin = {
7550
7566
  this._preIndex = this._showNodes[0].index;
7551
7567
  }
7552
7568
  else {
7553
- this._preIndex = this.currentIndex;
7569
+ this._preIndex = 0;
7554
7570
  }
7555
7571
  }
7556
7572
 
@@ -7568,7 +7584,7 @@ var slideMixin = {
7568
7584
  var translate = weex.utils.getTransformObj(inner).translate;
7569
7585
  var match = translate && translate.match(/translate[^(]+\(([+-\d.]+)/);
7570
7586
  var innerX = parseFloat(inner.style.left); //match && match[1] || 0;
7571
- var dist = innerX - this.innerOffset;
7587
+ var dist = innerX - this.innerOffset + step; // 点击的时候是没有滚动距离的会导致没有差值,所以这里需要使用上一个下标-下一个下标得到差值这样才能有变化然后进行滚动方向判断
7572
7588
  this.innerOffset += step * this._wrapperWidth;
7573
7589
  // transform the whole slides group.
7574
7590
 
@@ -7673,7 +7689,7 @@ var slideMixin = {
7673
7689
  this._showStartIdx = this._showEndIdx = 0;
7674
7690
  var node = this._cells[0].elm;
7675
7691
  node.style.opacity = 1;
7676
- node.style.zIndex = 99;
7692
+ // node.style.zIndex = 99;
7677
7693
  node.index = 0;
7678
7694
  this._showNodes[0] = node;
7679
7695
  node._inShow = true;
@@ -7744,7 +7760,7 @@ var slideMixin = {
7744
7760
  var holder = this._showNodes[index];
7745
7761
  if (node._inShow && (holder !== node || holder._showIndex !== index)) {
7746
7762
  if (holder && holder._isClone) { this._removeClone(holder); }
7747
- if( this.autoPlay ){
7763
+ if( this.autoPlay ){
7748
7764
  node = this._getClone(node.index);
7749
7765
  }
7750
7766
  }
@@ -7760,7 +7776,7 @@ var slideMixin = {
7760
7776
  // });
7761
7777
  // node.style.left = translateX + 'px'
7762
7778
 
7763
- node.style.zIndex = 99 - Math.abs(index);
7779
+ // node.style.zIndex = 99 - Math.abs(index);
7764
7780
  node.style.opacity = 1;
7765
7781
  node._showIndex = index;
7766
7782
  this._showNodes[index] = node;
@@ -8445,7 +8461,7 @@ var indicator$1 = {
8445
8461
  }
8446
8462
  };
8447
8463
 
8448
- __$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 \n.weex-slider-wrapper {\n overflow: hidden;\n}\n\n.weex-slider-inner {\n width: 100%;\n height: 100%;\n overflow: visible;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n}\n\n.weex-slider-cell {\n width: 100%;\n height: 100%;\n float:left;\n top: 0px;\n left: 0px;\n background: transparent !important;\n overflow: hidden;\n -webkit-box-align: center;\n -webkit-align-items: center;\n align-items: center;\n -webkit-box-pack: center;\n}\n\n.neighbor-cell {\n overflow: visible !important;\n}\n\nnav.weex-indicator {\n position: absolute;\n z-index: 10;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n margin: 0;\n padding: 0;\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 -webkit-transform: translate(-10rem, 0px);\n transform: translate(-10rem, 0px)\n}\n\ndiv.weex-indicator-inner {\n -webkit-transform: translate(10rem, 0px);\n transform: translate(10rem, 0px);\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n display: flex; \n}\n\n.weex-indicator-item {\n display: inline-block;\n position: relative;\n border-radius: 50%;\n width: 0.266667rem;\n height: 0.266667rem;\n background-color: #BBBBBB;\n}\n.weex-indicator-item + .weex-indicator-item {\n margin-left: 0.133333rem;\n}\n\n.weex-indicator-item-active {\n background-color: blue;\n}",undefined);
8464
+ __$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 \n.weex-slider-wrapper {\n overflow: hidden;\n}\n\n.weex-slider-inner {\n width: 100%;\n height: 100%;\n overflow: visible;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n}\n\n.weex-slider-cell {\n width: 100%;\n height: 100%;\n float:left;\n top: 0px;\n left: 0px;\n background: transparent !important;\n overflow: hidden;\n -webkit-box-align: center;\n -webkit-align-items: flex-start;\n align-items: flex-start;\n -webkit-box-pack: center;\n}\n\n.neighbor-cell {\n overflow: visible !important;\n}\n\nnav.weex-indicator {\n position: absolute;\n z-index: 10;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n margin: 0;\n padding: 0;\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 -webkit-transform: translate(-10rem, 0px);\n transform: translate(-10rem, 0px)\n}\n\ndiv.weex-indicator-inner {\n -webkit-transform: translate(10rem, 0px);\n transform: translate(10rem, 0px);\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n display: flex; \n}\n\n.weex-indicator-item {\n display: inline-block;\n position: relative;\n border-radius: 50%;\n width: 0.266667rem;\n height: 0.266667rem;\n background-color: #BBBBBB;\n}\n.weex-indicator-item + .weex-indicator-item {\n margin-left: 0.133333rem;\n}\n\n.weex-indicator-item-active {\n background-color: blue;\n}",undefined);
8449
8465
 
8450
8466
  /*
8451
8467
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -8523,6 +8539,12 @@ function getTextarea (weex) {
8523
8539
  returnKeyType: String
8524
8540
  },
8525
8541
 
8542
+ mounted: function mounted () {
8543
+ if (this.autofocus !== 'false' && this.autofocus !== false) {
8544
+ this.focus()
8545
+ }
8546
+ },
8547
+
8526
8548
  render: function render (createElement) {
8527
8549
  /* istanbul ignore next */
8528
8550
  // if ("production" === 'development') {
@@ -9975,6 +9997,11 @@ function transitionOnce (vnode, config, callback) {
9975
9997
  dom.addEventListener(endEvent, transitionEndHandler);
9976
9998
  }
9977
9999
  nextFrame(function () {
10000
+ // 修改 transform:translate让它支持传3个参数,且第三个参数无效
10001
+ if (config.styles["transform"]) {
10002
+ config.styles["transform"] = config.styles["transform"].replace(/(translate\([^,]+,[^,]+),[^)]+\)/, '$1)')
10003
+ }
10004
+
9978
10005
  dom.style.cssText
9979
10006
  += toCSSText(styleObject2rem(config.styles, DESIGN_ROOT_VALUE) || {});
9980
10007
  });
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.12"
52
+ "version": "0.2.14"
53
53
  }