xusd
7 days ago 998218675eb243d43912c203174a6b72b299c0f8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* eslint-disable */
var style = require('../wxs/style.wxs');
var addUnit = require('../wxs/add-unit.wxs');
var array = require('../wxs/array.wxs');
 
function columnsStyle(data) {
  return style({
    height: addUnit(data.itemHeight * data.visibleItemCount),
  });
}
 
function maskStyle(data) {
  return style({
    'background-size':
      '100% ' + addUnit((data.itemHeight * (data.visibleItemCount - 1)) / 2),
  });
}
 
function frameStyle(data) {
  return style({
    height: addUnit(data.itemHeight),
  });
}
 
function columns(columns) {
  if (!array.isArray(columns)) {
    return [];
  }
 
  if (columns.length && !columns[0].values) {
    return [{ values: columns }];
  }
 
  return columns;
}
 
module.exports = {
  columnsStyle: columnsStyle,
  frameStyle: frameStyle,
  maskStyle: maskStyle,
  columns: columns,
};