@dolphinweex/weex-vue-render 0.2.1 → 0.2.3
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/dist/index.common.js +181 -86
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -8,21 +8,6 @@ console.log('START WEEX VUE RENDER: 1.0.36, Build 2018-12-29 17:52.');
|
|
|
8
8
|
(global.WeexVueRender = factory());
|
|
9
9
|
}(this, (function () { 'use strict';
|
|
10
10
|
|
|
11
|
-
function isAbsoluteOrFixedPositioned(element, deep=2) {
|
|
12
|
-
let currentElement = element;
|
|
13
|
-
|
|
14
|
-
let deep_ = 0;
|
|
15
|
-
while (currentElement && deep_ <= deep) {
|
|
16
|
-
deep_++;
|
|
17
|
-
const position = window.getComputedStyle(currentElement).position;
|
|
18
|
-
if (position === 'absolute' || position === 'fixed') {
|
|
19
|
-
return true;
|
|
20
|
-
}
|
|
21
|
-
currentElement = currentElement.parentElement;
|
|
22
|
-
}
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
11
|
function __$styleInject(css, returnValue) {
|
|
27
12
|
if (typeof document === 'undefined') {
|
|
28
13
|
return returnValue;
|
|
@@ -4004,8 +3989,8 @@ function initEnv (viewportInfo, envInfo) {
|
|
|
4004
3989
|
isFullScreen: device_display.isFullScreen,
|
|
4005
3990
|
weexVersion: device_display.weexVersion,
|
|
4006
3991
|
osName: device_display.osName,
|
|
4007
|
-
statusBarHeight: device_display.statusBarHeight,
|
|
4008
|
-
safeAreaBottomHeight: device_display.safeAreaBottomHeight,
|
|
3992
|
+
statusBarHeight: device_display.statusBarHeight * device_display.scale,
|
|
3993
|
+
safeAreaBottomHeight: device_display.safeAreaBottomHeight * device_display.scale,
|
|
4009
3994
|
isImmersion: device_display.isImmersion,
|
|
4010
3995
|
|
|
4011
3996
|
};
|
|
@@ -5680,6 +5665,8 @@ var DEFAULT_LOADMORE_OFFSET = 0;
|
|
|
5680
5665
|
|
|
5681
5666
|
function getThrottledScroll (context) {
|
|
5682
5667
|
var scale = weex.config.env.scale;
|
|
5668
|
+
var rate = 750 / document.documentElement.clientWidth // 750设计稿放缩倍率
|
|
5669
|
+
|
|
5683
5670
|
if (!context._throttleScroll) {
|
|
5684
5671
|
var wrapper = context.$refs.wrapper;
|
|
5685
5672
|
var inner = context.$refs.inner;
|
|
@@ -5710,7 +5697,7 @@ function getThrottledScroll (context) {
|
|
|
5710
5697
|
* v y
|
|
5711
5698
|
*
|
|
5712
5699
|
*/
|
|
5713
|
-
y: -wrapper.scrollTop
|
|
5700
|
+
y: -wrapper.scrollTop * rate
|
|
5714
5701
|
}
|
|
5715
5702
|
};
|
|
5716
5703
|
if (context.$el) {
|
|
@@ -5946,23 +5933,59 @@ var scrollable$1 = {
|
|
|
5946
5933
|
},
|
|
5947
5934
|
|
|
5948
5935
|
handleTouchStart: function handleTouchStart (event) {
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
this.
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
};
|
|
5959
|
-
}
|
|
5936
|
+
var touch = event.changedTouches[0];
|
|
5937
|
+
this._touchParams = {
|
|
5938
|
+
reachTop: this.reachTop(),
|
|
5939
|
+
reachBottom: this.reachBottom(),
|
|
5940
|
+
startTouchEvent: touch,
|
|
5941
|
+
startX: touch.pageX,
|
|
5942
|
+
startY: touch.pageY,
|
|
5943
|
+
timeStamp: event.timeStamp
|
|
5944
|
+
};
|
|
5960
5945
|
},
|
|
5961
5946
|
|
|
5962
5947
|
handleTouchMove: function handleTouchMove (event) {
|
|
5963
|
-
if (!this._touchParams
|
|
5948
|
+
if (!this._touchParams) {
|
|
5949
|
+
return
|
|
5950
|
+
}
|
|
5951
|
+
|
|
5952
|
+
var tp = this._touchParams;
|
|
5953
|
+
if (!tp) { return }
|
|
5954
|
+
|
|
5955
|
+
var ref = this._touchParams;
|
|
5956
|
+
var startX = ref.startX;
|
|
5957
|
+
var startY = ref.startY;
|
|
5958
|
+
var touch = event.changedTouches[0];
|
|
5959
|
+
var offsetX = touch.pageX - startX;
|
|
5960
|
+
var offsetY = touch.pageY - startY;
|
|
5961
|
+
tp.offsetX = offsetX;
|
|
5962
|
+
tp.offsetY = offsetY;
|
|
5963
|
+
var isV = tp.isVertical;
|
|
5964
|
+
if (typeof isV === 'undefined') {
|
|
5965
|
+
isV = tp.isVertical = Math.abs(offsetX) < Math.abs(offsetY);
|
|
5966
|
+
}
|
|
5967
|
+
|
|
5968
|
+
// 如果是水平滚动,并且手势是水平方向,则阻止冒泡
|
|
5969
|
+
// 如果是垂直滚动,并且手势是垂直方向,则阻止冒泡
|
|
5970
|
+
var isScrollHorizontal = this.$el.classList.value.indexOf("weex-scroller-horizontal") > -1 || this.$el.classList.value.indexOf("weex-recycle-horizontal") > -1
|
|
5971
|
+
console.log("dom", this.$el.classList.value)
|
|
5972
|
+
if (isScrollHorizontal) {
|
|
5973
|
+
if (!isV) {
|
|
5974
|
+
// 水平
|
|
5975
|
+
event.stopPropagation();
|
|
5976
|
+
return;
|
|
5977
|
+
}
|
|
5978
|
+
return;
|
|
5979
|
+
}else {
|
|
5980
|
+
if (!isV) {
|
|
5981
|
+
return;
|
|
5982
|
+
}
|
|
5983
|
+
}
|
|
5984
|
+
|
|
5985
|
+
if (!this._refresh && !this._loading) {
|
|
5964
5986
|
return
|
|
5965
5987
|
}
|
|
5988
|
+
|
|
5966
5989
|
var inner = this.$refs.inner;
|
|
5967
5990
|
var ref = this._touchParams;
|
|
5968
5991
|
var startY = ref.startY;
|
|
@@ -5986,6 +6009,18 @@ var scrollable$1 = {
|
|
|
5986
6009
|
if (!this._touchParams || !this._refresh && !this._loading) {
|
|
5987
6010
|
return
|
|
5988
6011
|
}
|
|
6012
|
+
var tp = this._touchParams;
|
|
6013
|
+
var isV = tp.isVertical;
|
|
6014
|
+
if (this.scrollDirection === 'horizontal' && !isV) {
|
|
6015
|
+
// 水平
|
|
6016
|
+
event.stopPropagation();
|
|
6017
|
+
}else if (isV) {
|
|
6018
|
+
// 垂直
|
|
6019
|
+
event.stopPropagation();
|
|
6020
|
+
}else {
|
|
6021
|
+
return;
|
|
6022
|
+
}
|
|
6023
|
+
|
|
5989
6024
|
var inner = this.$refs.inner;
|
|
5990
6025
|
var ref = this._touchParams;
|
|
5991
6026
|
var startY = ref.startY;
|
|
@@ -6061,11 +6096,13 @@ function getList (weex) {
|
|
|
6061
6096
|
},
|
|
6062
6097
|
mounted: function mounted () {
|
|
6063
6098
|
var this$1 = this;
|
|
6064
|
-
if (isAbsoluteOrFixedPositioned(this$1.$el)) {
|
|
6065
|
-
this$1.$el.classList.remove("height-0");
|
|
6066
|
-
}
|
|
6067
6099
|
setTimeout(() => {
|
|
6068
|
-
|
|
6100
|
+
var computedStyle = window.getComputedStyle(this$1.$el)
|
|
6101
|
+
var paddingTop = parseFloat(computedStyle.paddingTop)
|
|
6102
|
+
var paddingBottom = parseFloat(computedStyle.paddingBottom)
|
|
6103
|
+
var height = parseFloat(computedStyle.height)
|
|
6104
|
+
|
|
6105
|
+
if (height - paddingTop - paddingBottom <= 1) {
|
|
6069
6106
|
this$1.$el.classList.remove("height-0");
|
|
6070
6107
|
}
|
|
6071
6108
|
}, 0);
|
|
@@ -6080,7 +6117,10 @@ function getList (weex) {
|
|
|
6080
6117
|
return [
|
|
6081
6118
|
h('article', {
|
|
6082
6119
|
ref: 'inner',
|
|
6083
|
-
staticClass: 'weex-list-inner weex-ct'
|
|
6120
|
+
staticClass: 'weex-list-inner weex-ct',
|
|
6121
|
+
staticStyle: {
|
|
6122
|
+
width: "100%"
|
|
6123
|
+
}
|
|
6084
6124
|
}, this._cells)
|
|
6085
6125
|
]
|
|
6086
6126
|
}
|
|
@@ -6102,7 +6142,7 @@ function getList (weex) {
|
|
|
6102
6142
|
on: {
|
|
6103
6143
|
scroll: this.handleScroll,
|
|
6104
6144
|
touchstart: this.handleTouchStart,
|
|
6105
|
-
touchmove: this.handleTouchMove,
|
|
6145
|
+
touchmove: this.handleTouchMove.bind(this),
|
|
6106
6146
|
touchend: this.handleTouchEnd
|
|
6107
6147
|
},
|
|
6108
6148
|
staticStyle: extractComponentStyle(this)
|
|
@@ -6157,11 +6197,13 @@ function getScroller (weex) {
|
|
|
6157
6197
|
},
|
|
6158
6198
|
mounted: function mounted () {
|
|
6159
6199
|
var this$1 = this;
|
|
6160
|
-
if (isAbsoluteOrFixedPositioned(this$1.$el)) {
|
|
6161
|
-
this$1.$el.classList.remove("height-0");
|
|
6162
|
-
}
|
|
6163
6200
|
setTimeout(() => {
|
|
6164
|
-
|
|
6201
|
+
var computedStyle = window.getComputedStyle(this$1.$el)
|
|
6202
|
+
var paddingTop = parseFloat(computedStyle.paddingTop)
|
|
6203
|
+
var paddingBottom = parseFloat(computedStyle.paddingBottom)
|
|
6204
|
+
var height = parseFloat(computedStyle.height)
|
|
6205
|
+
|
|
6206
|
+
if (height - paddingTop - paddingBottom <= 1) {
|
|
6165
6207
|
this$1.$el.classList.remove("height-0");
|
|
6166
6208
|
}
|
|
6167
6209
|
}, 0);
|
|
@@ -6220,7 +6262,7 @@ function getScroller (weex) {
|
|
|
6220
6262
|
on: {
|
|
6221
6263
|
scroll: this.handleScroll,
|
|
6222
6264
|
touchstart: this.handleTouchStart,
|
|
6223
|
-
touchmove: this.handleTouchMove,
|
|
6265
|
+
touchmove: this.handleTouchMove.bind(this),
|
|
6224
6266
|
touchend: this.handleTouchEnd
|
|
6225
6267
|
},
|
|
6226
6268
|
staticClass: this.wrapperClass,
|
|
@@ -6611,7 +6653,7 @@ function getWaterfall (weex) {
|
|
|
6611
6653
|
on: {
|
|
6612
6654
|
scroll: this.handleScroll,
|
|
6613
6655
|
touchstart: this.handleTouchStart,
|
|
6614
|
-
touchmove: this.handleTouchMove,
|
|
6656
|
+
touchmove: this.handleTouchMove.bind(this),
|
|
6615
6657
|
touchend: this.handleTouchEnd
|
|
6616
6658
|
},
|
|
6617
6659
|
staticClass: 'weex-waterfall weex-waterfall-wrapper weex-ct',
|
|
@@ -7073,11 +7115,13 @@ function getList$1 (weex) {
|
|
|
7073
7115
|
},
|
|
7074
7116
|
mounted: function mounted () {
|
|
7075
7117
|
var this$1 = this;
|
|
7076
|
-
if (isAbsoluteOrFixedPositioned(this$1.$el)) {
|
|
7077
|
-
this$1.$el.classList.remove("height-0");
|
|
7078
|
-
}
|
|
7079
7118
|
setTimeout(() => {
|
|
7080
|
-
|
|
7119
|
+
var computedStyle = window.getComputedStyle(this$1.$el)
|
|
7120
|
+
var paddingTop = parseFloat(computedStyle.paddingTop)
|
|
7121
|
+
var paddingBottom = parseFloat(computedStyle.paddingBottom)
|
|
7122
|
+
var height = parseFloat(computedStyle.height)
|
|
7123
|
+
|
|
7124
|
+
if (height - paddingTop - paddingBottom <= 1) {
|
|
7081
7125
|
this$1.$el.classList.remove("height-0");
|
|
7082
7126
|
}
|
|
7083
7127
|
}, 0);
|
|
@@ -7104,7 +7148,10 @@ function getList$1 (weex) {
|
|
|
7104
7148
|
return [
|
|
7105
7149
|
h('article', {
|
|
7106
7150
|
ref: 'inner',
|
|
7107
|
-
staticClass: 'weex-recycle-inner weex-ct'
|
|
7151
|
+
staticClass: 'weex-recycle-inner weex-ct',
|
|
7152
|
+
staticStyle: {
|
|
7153
|
+
width: this.scrollDirection == 'vertical' ? "100%" : undefined,
|
|
7154
|
+
}
|
|
7108
7155
|
}, [
|
|
7109
7156
|
_vm._l(_vm._items, function (item, index) {
|
|
7110
7157
|
return [
|
|
@@ -7143,7 +7190,7 @@ function getList$1 (weex) {
|
|
|
7143
7190
|
on: {
|
|
7144
7191
|
scroll: this.handleScroll,
|
|
7145
7192
|
touchstart: this.handleTouchStart,
|
|
7146
|
-
touchmove: this.handleTouchMove,
|
|
7193
|
+
touchmove: this.handleTouchMove.bind(this),
|
|
7147
7194
|
touchend: this.handleTouchEnd
|
|
7148
7195
|
},
|
|
7149
7196
|
staticStyle: extractComponentStyle(this)
|
|
@@ -7158,7 +7205,7 @@ var recycleList = {
|
|
|
7158
7205
|
}
|
|
7159
7206
|
};
|
|
7160
7207
|
|
|
7161
|
-
__$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 overflow-y: scroll !important;\n overflow-x: hidden !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}\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);
|
|
7208
|
+
__$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}\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);
|
|
7162
7209
|
|
|
7163
7210
|
/*
|
|
7164
7211
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
@@ -7224,6 +7271,8 @@ var MAIN_SLIDE_OPACITY = 1;
|
|
|
7224
7271
|
var THROTTLE_SCROLL_TIME = 25;
|
|
7225
7272
|
var INTERVAL_MINIMUM = 200;
|
|
7226
7273
|
|
|
7274
|
+
var touchSliderInstance = null;
|
|
7275
|
+
|
|
7227
7276
|
var slideMixin = {
|
|
7228
7277
|
created: function created () {
|
|
7229
7278
|
this._clones = [];
|
|
@@ -7335,7 +7384,7 @@ var slideMixin = {
|
|
|
7335
7384
|
attrs: { 'weex-type': this.isNeighbor ? 'slider-neighbor' : 'slider' },
|
|
7336
7385
|
on: {
|
|
7337
7386
|
touchstart: this._handleTouchStart,
|
|
7338
|
-
touchmove: weex.utils.throttle(weex.utils.bind(this._handleTouchMove, this),
|
|
7387
|
+
touchmove: weex.utils.throttle(weex.utils.bind(this._handleTouchMove, this), 10),
|
|
7339
7388
|
touchend: this._handleTouchEnd,
|
|
7340
7389
|
touchcancel: this._handleTouchCancel
|
|
7341
7390
|
},
|
|
@@ -7412,16 +7461,19 @@ var slideMixin = {
|
|
|
7412
7461
|
this._prepareNodes();
|
|
7413
7462
|
var translate = weex.utils.getTransformObj(inner).translate;
|
|
7414
7463
|
var match = translate && translate.match(/translate[^(]+\(([+-\d.]+)/);
|
|
7415
|
-
var innerX = match && match[1] || 0;
|
|
7464
|
+
var innerX = parseFloat(inner.style.left); //match && match[1] || 0;
|
|
7416
7465
|
var dist = innerX - this.innerOffset;
|
|
7417
7466
|
this.innerOffset += step * this._wrapperWidth;
|
|
7418
7467
|
// transform the whole slides group.
|
|
7419
|
-
|
|
7420
|
-
inner.style.
|
|
7421
|
-
inner.style.
|
|
7422
|
-
inner.style.
|
|
7423
|
-
inner.style.
|
|
7424
|
-
inner.style.
|
|
7468
|
+
|
|
7469
|
+
inner.style.webkitTransition = "left " + (TRANSITION_TIME / 1000) + "s ease-in-out";
|
|
7470
|
+
inner.style.mozTransition = "left " + (TRANSITION_TIME / 1000) + "s ease-in-out";
|
|
7471
|
+
inner.style.transition = "left " + (TRANSITION_TIME / 1000) + "s ease-in-out";
|
|
7472
|
+
// inner.style.webkitTransform = "translate3d(" + (this.innerOffset) + "px, 0, 0)";
|
|
7473
|
+
// inner.style.mozTransform = "translate3d(" + (this.innerOffset) + "px, 0, 0)";
|
|
7474
|
+
// inner.style.transform = "translate3d(" + (this.innerOffset) + "px, 0, 0)";
|
|
7475
|
+
inner.style.left = this.innerOffset + 'px'
|
|
7476
|
+
|
|
7425
7477
|
|
|
7426
7478
|
// emit scroll events.
|
|
7427
7479
|
if (!isTouchScroll) {
|
|
@@ -7473,9 +7525,11 @@ var slideMixin = {
|
|
|
7473
7525
|
var node = this$1._showNodes[i];
|
|
7474
7526
|
node = node && node.firstElementChild;
|
|
7475
7527
|
if (!node) { continue }
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7528
|
+
// ddd
|
|
7529
|
+
// weex.utils.addTransform(this$1._showNodes[i].firstElementChild, {
|
|
7530
|
+
// translate: 'translate3d(0px, 0px, 0px)'
|
|
7531
|
+
// });
|
|
7532
|
+
this$1._showNodes[i].firstElementChild.left = '0px'
|
|
7479
7533
|
}
|
|
7480
7534
|
},
|
|
7481
7535
|
|
|
@@ -7591,9 +7645,12 @@ var slideMixin = {
|
|
|
7591
7645
|
|
|
7592
7646
|
node._inShow = true;
|
|
7593
7647
|
var translateX = index * this._wrapperWidth - this.innerOffset;
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7648
|
+
// ddd
|
|
7649
|
+
// weex.utils.addTransform(node, {
|
|
7650
|
+
// translate: ("translate3d(" + translateX + "px, 0px, 0px)")
|
|
7651
|
+
// });
|
|
7652
|
+
node.style.left = translateX + 'px'
|
|
7653
|
+
|
|
7597
7654
|
node.style.zIndex = 99 - Math.abs(index);
|
|
7598
7655
|
node.style.opacity = 1;
|
|
7599
7656
|
node._showIndex = index;
|
|
@@ -7681,15 +7738,18 @@ var slideMixin = {
|
|
|
7681
7738
|
if ( transformExtra === void 0 ) transformExtra = {};
|
|
7682
7739
|
|
|
7683
7740
|
weex.utils.extendKeys(to.style, from.style, styles);
|
|
7741
|
+
to.style.left = from.style.left;
|
|
7684
7742
|
var transObj = weex.utils.getTransformObj(from);
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7743
|
+
if (transObj) {
|
|
7744
|
+
for (var k in transformExtra) {
|
|
7745
|
+
transObj[k] = transformExtra[k];
|
|
7746
|
+
}
|
|
7747
|
+
weex.utils.addTransform(to, transObj);
|
|
7748
|
+
var fromInner = from.firstElementChild;
|
|
7749
|
+
var toInner = to.firstElementChild;
|
|
7750
|
+
toInner.style.opacity = fromInner.style.opacity;
|
|
7751
|
+
weex.utils.copyTransform(fromInner, toInner);
|
|
7752
|
+
}
|
|
7693
7753
|
},
|
|
7694
7754
|
|
|
7695
7755
|
/**
|
|
@@ -7707,7 +7767,7 @@ var slideMixin = {
|
|
|
7707
7767
|
return
|
|
7708
7768
|
}
|
|
7709
7769
|
var origShowIndex = origNode._showIndex;
|
|
7710
|
-
var styleProps = ['opacity', 'zIndex'];
|
|
7770
|
+
var styleProps = ['opacity', 'zIndex', 'left'];
|
|
7711
7771
|
var cl;
|
|
7712
7772
|
if (Math.abs(origShowIndex) <= 1) {
|
|
7713
7773
|
// leave a clone to replace the origNode in the show zone(-1 ~ 1).
|
|
@@ -7717,9 +7777,12 @@ var slideMixin = {
|
|
|
7717
7777
|
}
|
|
7718
7778
|
origNode._inShow = true;
|
|
7719
7779
|
var transObj = weex.utils.getTransformObj(clone);
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7780
|
+
if (transObj.translate) {
|
|
7781
|
+
transObj.translate = transObj.translate.replace(/[+-\d.]+[pw]x/, function ($0) {
|
|
7782
|
+
return pos * this$1._wrapperWidth - this$1.innerOffset + 'px'
|
|
7783
|
+
});
|
|
7784
|
+
}
|
|
7785
|
+
|
|
7723
7786
|
this._copyStyle(clone, origNode, styleProps, transObj);
|
|
7724
7787
|
this._removeClone(clone);
|
|
7725
7788
|
if (!cl) {
|
|
@@ -7802,7 +7865,11 @@ var slideMixin = {
|
|
|
7802
7865
|
translateX = 0;
|
|
7803
7866
|
}
|
|
7804
7867
|
transObj.translate = "translate3d(" + translateX + "px, 0px, 0px)";
|
|
7805
|
-
|
|
7868
|
+
|
|
7869
|
+
// ddd
|
|
7870
|
+
// weex.utils.addTransform(elm, transObj);
|
|
7871
|
+
elm.style.left = translateX + 'px'
|
|
7872
|
+
|
|
7806
7873
|
elm.style.opacity = i === 0 ? MAIN_SLIDE_OPACITY : this$1.neighborAlpha;
|
|
7807
7874
|
}
|
|
7808
7875
|
},
|
|
@@ -7841,9 +7908,7 @@ var slideMixin = {
|
|
|
7841
7908
|
_handleTouchMove: function _handleTouchMove (event) {
|
|
7842
7909
|
var tp = this._touchParams;
|
|
7843
7910
|
if (!tp) { return }
|
|
7844
|
-
|
|
7845
|
-
return
|
|
7846
|
-
}
|
|
7911
|
+
|
|
7847
7912
|
var ref = this._touchParams;
|
|
7848
7913
|
var startX = ref.startX;
|
|
7849
7914
|
var startY = ref.startY;
|
|
@@ -7863,9 +7928,24 @@ var slideMixin = {
|
|
|
7863
7928
|
if (isV) {
|
|
7864
7929
|
return
|
|
7865
7930
|
}
|
|
7866
|
-
|
|
7867
|
-
|
|
7931
|
+
|
|
7932
|
+
if (this._sliding) {
|
|
7933
|
+
event.stopPropagation();
|
|
7934
|
+
return
|
|
7935
|
+
}
|
|
7936
|
+
|
|
7868
7937
|
var inner = this.$refs.inner;
|
|
7938
|
+
// 如果已经有一个激活的slider,则不再处理其他slider
|
|
7939
|
+
if (touchSliderInstance && touchSliderInstance != inner) {
|
|
7940
|
+
event.stopPropagation();
|
|
7941
|
+
return;
|
|
7942
|
+
}
|
|
7943
|
+
|
|
7944
|
+
// horizontal scroll. trigger scroll event.
|
|
7945
|
+
event.stopPropagation()
|
|
7946
|
+
|
|
7947
|
+
touchSliderInstance = inner;
|
|
7948
|
+
|
|
7869
7949
|
if (inner && offsetX) {
|
|
7870
7950
|
if (!this._nodesOffsetCleared) {
|
|
7871
7951
|
this._nodesOffsetCleared = true;
|
|
@@ -7874,21 +7954,31 @@ var slideMixin = {
|
|
|
7874
7954
|
this._emitScrollEvent('weex$scroll', {
|
|
7875
7955
|
offsetXRatio: offsetX / this._wrapperWidth
|
|
7876
7956
|
});
|
|
7877
|
-
|
|
7878
|
-
inner.style.
|
|
7879
|
-
inner.style.
|
|
7957
|
+
// ddd
|
|
7958
|
+
// inner.style.webkitTransform = "translate3d(" + (this.innerOffset + offsetX) + "px, 0, 0)";
|
|
7959
|
+
// inner.style.mozTransform = "translate3d(" + (this.innerOffset + offsetX) + "px, 0, 0)";
|
|
7960
|
+
// inner.style.transform = "translate3d(" + (this.innerOffset + offsetX) + "px, 0, 0)";
|
|
7961
|
+
inner.style.left = (this .innerOffset + offsetX) + 'px'
|
|
7880
7962
|
}
|
|
7881
7963
|
},
|
|
7882
7964
|
|
|
7883
7965
|
_handleTouchEnd: function _handleTouchEnd (event) {
|
|
7966
|
+
var inner = this.$refs.inner;
|
|
7967
|
+
if (touchSliderInstance == inner) {
|
|
7968
|
+
touchSliderInstance= null;
|
|
7969
|
+
} else {
|
|
7970
|
+
return;
|
|
7971
|
+
}
|
|
7972
|
+
|
|
7884
7973
|
this._startAutoPlay();
|
|
7885
7974
|
var tp = this._touchParams;
|
|
7886
7975
|
if (!tp) { return }
|
|
7887
7976
|
var isV = tp.isVertical;
|
|
7888
|
-
if (typeof isV === 'undefined') {
|
|
7977
|
+
if (typeof isV === 'undefined' || isV) {
|
|
7889
7978
|
return
|
|
7890
7979
|
}
|
|
7891
|
-
|
|
7980
|
+
|
|
7981
|
+
event.stopPropagation();
|
|
7892
7982
|
var offsetX = tp.offsetX;
|
|
7893
7983
|
if (inner) {
|
|
7894
7984
|
this._nodesOffsetCleared = false;
|
|
@@ -7902,6 +7992,11 @@ var slideMixin = {
|
|
|
7902
7992
|
},
|
|
7903
7993
|
|
|
7904
7994
|
_handleTouchCancel: function _handleTouchCancel (event) {
|
|
7995
|
+
var inner = this.$refs.inner;
|
|
7996
|
+
if (touchSliderInstance == inner) {
|
|
7997
|
+
touchSliderInstance= null;
|
|
7998
|
+
}
|
|
7999
|
+
|
|
7905
8000
|
return this._handleTouchEnd(event)
|
|
7906
8001
|
},
|
|
7907
8002
|
|
package/package.json
CHANGED