@dolphinweex/weex-vue-render 0.2.9 → 0.2.11
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 +46 -9
- package/package.json +1 -1
package/dist/index.common.js
CHANGED
|
@@ -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',
|
|
@@ -6524,7 +6542,7 @@ function getWaterfall (weex) {
|
|
|
6524
6542
|
* 3.1 if totalWidth < ctWidth then increase columnWidth
|
|
6525
6543
|
* 3.2 if totalWidth > ctWidth then decrease columnCount
|
|
6526
6544
|
*/
|
|
6527
|
-
var width, gap, cnt, ctWidth;
|
|
6545
|
+
var width, gap, cnt, ctWidth, leftGap, rightGap;
|
|
6528
6546
|
var scale = weex.config.env.scale;
|
|
6529
6547
|
var el = this.$el;
|
|
6530
6548
|
function getCtWidth (width, style) {
|
|
@@ -6551,6 +6569,9 @@ function getWaterfall (weex) {
|
|
|
6551
6569
|
}
|
|
6552
6570
|
gap = gap * scale;
|
|
6553
6571
|
|
|
6572
|
+
leftGap = this.leftGap * scale || 0;
|
|
6573
|
+
rightGap = this.rightGap * scale || 0;
|
|
6574
|
+
|
|
6554
6575
|
width = this.columnWidth;
|
|
6555
6576
|
cnt = this.columnCount;
|
|
6556
6577
|
if (width && width !== 'auto') {
|
|
@@ -6566,17 +6587,17 @@ function getWaterfall (weex) {
|
|
|
6566
6587
|
}
|
|
6567
6588
|
// 1. if columnCount = n then calc w.
|
|
6568
6589
|
else if (cnt !== 'auto' && width === 'auto') {
|
|
6569
|
-
width = (ctWidth - (cnt - 1) * gap) / cnt;
|
|
6590
|
+
width = (ctWidth - (cnt - 1) * gap - leftGap - rightGap) / cnt;
|
|
6570
6591
|
}
|
|
6571
6592
|
// 2. if columnWidth = w then calc n.
|
|
6572
6593
|
else if (cnt === 'auto' && width !== 'auto') {
|
|
6573
|
-
cnt = (ctWidth + gap) / (width + gap);
|
|
6594
|
+
cnt = (ctWidth + gap + leftGap + rightGap) / (width + gap + leftGap + rightGap);
|
|
6574
6595
|
}
|
|
6575
6596
|
// 3. if columnWidth = w and columnCount = n then calc totalWidth
|
|
6576
6597
|
else if (cnt !== 'auto' && width !== 'auto') {
|
|
6577
6598
|
var totalWidth;
|
|
6578
6599
|
var adjustCountAndWidth = function () {
|
|
6579
|
-
totalWidth = cnt * width + (cnt - 1) * gap;
|
|
6600
|
+
totalWidth = cnt * width + (cnt - 1) * gap + leftGap + rightGap;
|
|
6580
6601
|
if (totalWidth < ctWidth) {
|
|
6581
6602
|
width += (ctWidth - totalWidth) / cnt;
|
|
6582
6603
|
}
|
|
@@ -6711,6 +6732,17 @@ function getWaterfall (weex) {
|
|
|
6711
6732
|
this$1.updateLayout();
|
|
6712
6733
|
});
|
|
6713
6734
|
var mergedStyle = extractComponentStyle(this);
|
|
6735
|
+
|
|
6736
|
+
var rate = 750 / document.documentElement.clientWidth // 750设计稿放缩倍率
|
|
6737
|
+
|
|
6738
|
+
var leftAndRightGapStyle = {}
|
|
6739
|
+
if (this.leftGap) {
|
|
6740
|
+
leftAndRightGapStyle.paddingLeft = this.leftGap / rate + 'px';
|
|
6741
|
+
}
|
|
6742
|
+
if (this.rightGap) {
|
|
6743
|
+
leftAndRightGapStyle.paddingRight = this.leftGap / rate + 'px';
|
|
6744
|
+
}
|
|
6745
|
+
|
|
6714
6746
|
return createElement('main', {
|
|
6715
6747
|
ref: 'wrapper',
|
|
6716
6748
|
attrs: { 'weex-type': 'waterfall' },
|
|
@@ -6722,7 +6754,7 @@ function getWaterfall (weex) {
|
|
|
6722
6754
|
},
|
|
6723
6755
|
staticClass: 'weex-waterfall weex-waterfall-wrapper weex-ct',
|
|
6724
6756
|
staticStyle: mergedStyle
|
|
6725
|
-
}, this._createChildren(createElement, mergedStyle))
|
|
6757
|
+
}, this._createChildren(createElement, mergedStyle, leftAndRightGapStyle))
|
|
6726
6758
|
}
|
|
6727
6759
|
}
|
|
6728
6760
|
}
|
|
@@ -6768,7 +6800,12 @@ function getHeader (weex) {
|
|
|
6768
6800
|
},
|
|
6769
6801
|
ref: 'header',
|
|
6770
6802
|
staticClass: 'weex-header weex-ct',
|
|
6771
|
-
staticStyle:
|
|
6803
|
+
staticStyle: {
|
|
6804
|
+
...extractComponentStyle(this),
|
|
6805
|
+
...{
|
|
6806
|
+
maxWidth: '100vw'
|
|
6807
|
+
}
|
|
6808
|
+
}
|
|
6772
6809
|
}, this.$slots.default)
|
|
6773
6810
|
}
|
|
6774
6811
|
}
|
|
@@ -7269,7 +7306,7 @@ var recycleList = {
|
|
|
7269
7306
|
}
|
|
7270
7307
|
};
|
|
7271
7308
|
|
|
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
|
|
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);
|
|
7273
7310
|
|
|
7274
7311
|
/*
|
|
7275
7312
|
* Licensed to the Apache Software Foundation (ASF) under one
|
package/package.json
CHANGED