@dolphinweex/weex-vue-render 0.2.11 → 0.2.13

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) {
@@ -3825,6 +3833,11 @@ function px2rem (px, rootValue) {
3825
3833
  if (px.indexOf("--harmory") > -1) return px;
3826
3834
 
3827
3835
  return px.replace(/([+-]?\d+(?:\.\d*)?)([p|w]x)?/g, function ($0, $1, $2, offset, str) {
3836
+ // 判断是否包含 scale 或 rotate,直接跳过
3837
+ const filterKey = ['scale', 'rotate'];
3838
+ if (filterKey.some(keyword => str.slice(0, offset).includes(keyword))) {
3839
+ return $0; // 保留原字符串不替换
3840
+ }
3828
3841
  if (ignoreSubKey.filter(k => str.slice(offset - k.length - 1, offset - 1) === k).length) return $1
3829
3842
  if ($2 === 'wx') { // 'wx' -> px
3830
3843
  // return ($midea_harmony_native ? $midea_harmony_native.vp2px($1) : $1) + 'px'
@@ -5033,7 +5046,6 @@ var style = {
5033
5046
  * specific language governing permissions and limitations
5034
5047
  * under the License.
5035
5048
  */
5036
-
5037
5049
  // input and textare has some common api and event
5038
5050
  var findEnterKeyType = function (key) {
5039
5051
  var keys = ['default', 'go', 'next', 'search', 'send'];
@@ -6292,7 +6304,7 @@ function getGCanvas (weex) {
6292
6304
  var wrapper = this.$refs.gcanvas;
6293
6305
  var rate = 750 / document.documentElement.clientWidth
6294
6306
  wrapper.width = wrapper.clientWidth * rate;
6295
- wrapper.height = wrapper.clientWidth * rate;
6307
+ wrapper.height = wrapper.clientHeight * rate;
6296
6308
 
6297
6309
  var context = wrapper.getContext(type || '2d')
6298
6310
  context.scale(rate, rate)
@@ -7306,7 +7318,7 @@ var recycleList = {
7306
7318
  }
7307
7319
  };
7308
7320
 
7309
- __$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);
7321
+ __$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);
7310
7322
 
7311
7323
  /*
7312
7324
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -7632,7 +7644,7 @@ var slideMixin = {
7632
7644
  // weex.utils.addTransform(this$1._showNodes[i].firstElementChild, {
7633
7645
  // translate: 'translate3d(0px, 0px, 0px)'
7634
7646
  // });
7635
- this$1._showNodes[i].firstElementChild.left = '0px'
7647
+ // this$1._showNodes[i].firstElementChild.left = '0px'
7636
7648
  }
7637
7649
  },
7638
7650
 
@@ -7669,7 +7681,7 @@ var slideMixin = {
7669
7681
  this._showStartIdx = this._showEndIdx = 0;
7670
7682
  var node = this._cells[0].elm;
7671
7683
  node.style.opacity = 1;
7672
- node.style.zIndex = 99;
7684
+ // node.style.zIndex = 99;
7673
7685
  node.index = 0;
7674
7686
  this._showNodes[0] = node;
7675
7687
  node._inShow = true;
@@ -7740,7 +7752,9 @@ var slideMixin = {
7740
7752
  var holder = this._showNodes[index];
7741
7753
  if (node._inShow && (holder !== node || holder._showIndex !== index)) {
7742
7754
  if (holder && holder._isClone) { this._removeClone(holder); }
7743
- node = this._getClone(node.index);
7755
+ if( this.autoPlay ){
7756
+ node = this._getClone(node.index);
7757
+ }
7744
7758
  }
7745
7759
  else if (node._inShow) { // holder === node
7746
7760
  return
@@ -7752,9 +7766,9 @@ var slideMixin = {
7752
7766
  // weex.utils.addTransform(node, {
7753
7767
  // translate: ("translate3d(" + translateX + "px, 0px, 0px)")
7754
7768
  // });
7755
- node.style.left = translateX + 'px'
7769
+ // node.style.left = translateX + 'px'
7756
7770
 
7757
- node.style.zIndex = 99 - Math.abs(index);
7771
+ // node.style.zIndex = 99 - Math.abs(index);
7758
7772
  node.style.opacity = 1;
7759
7773
  node._showIndex = index;
7760
7774
  this._showNodes[index] = node;
@@ -7971,7 +7985,7 @@ var slideMixin = {
7971
7985
 
7972
7986
  // ddd
7973
7987
  // weex.utils.addTransform(elm, transObj);
7974
- elm.style.left = translateX + 'px'
7988
+ // elm.style.left = translateX + 'px'
7975
7989
 
7976
7990
  elm.style.opacity = i === 0 ? MAIN_SLIDE_OPACITY : this$1.neighborAlpha;
7977
7991
  }
@@ -8439,7 +8453,7 @@ var indicator$1 = {
8439
8453
  }
8440
8454
  };
8441
8455
 
8442
- __$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 position: absolute;\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 -webkit-justify-content: center;\n justify-content: 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);
8456
+ __$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);
8443
8457
 
8444
8458
  /*
8445
8459
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -9969,6 +9983,11 @@ function transitionOnce (vnode, config, callback) {
9969
9983
  dom.addEventListener(endEvent, transitionEndHandler);
9970
9984
  }
9971
9985
  nextFrame(function () {
9986
+ // 修改 transform:translate让它支持传3个参数,且第三个参数无效
9987
+ if (config.styles["transform"]) {
9988
+ config.styles["transform"] = config.styles["transform"].replace(/(translate\([^,]+,[^,]+),[^)]+\)/, '$1)')
9989
+ }
9990
+
9972
9991
  dom.style.cssText
9973
9992
  += toCSSText(styleObject2rem(config.styles, DESIGN_ROOT_VALUE) || {});
9974
9993
  });
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.11"
52
+ "version": "0.2.13"
53
53
  }