admin
2020-12-08 7f2d1daf6af6ecebad84d80de46a0e5024bbf5da
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
export default function classnames(dir, wrap, justify, align, alignContent) {
  const prefixCls = 'am-flexbox';
  const classes = [];
 
  const dirMaps = {
    row: `${prefixCls}-dir-row`,
    'row-reverse': `${prefixCls}-dir-row-reverse`,
    column: `${prefixCls}-dir-column`,
    'column-reverse': `${prefixCls}-dir-column-reverse`,
  };
 
  const wrapMaps = {
    nowrap: `${prefixCls}-nowrap`,
    wrap: `${prefixCls}-wrap`,
    'wrap-reverse': `${prefixCls}-wrap-reverse`,
  };
 
  const justifyMaps = {
    start: `${prefixCls}-justify-start`,
    end: `${prefixCls}-justify-end`,
    center: `${prefixCls}-justify-center`,
    between: `${prefixCls}-justify-between`,
    around: `${prefixCls}-justify-around`,
  };
 
  const alignMaps = {
    start: `${prefixCls}-align-start`,
    center: `${prefixCls}-align-center`,
    end: `${prefixCls}-align-end`,
    baseline: `${prefixCls}-align-baseline`,
    stretch: `${prefixCls}-align-stretch`,
  };
 
  const alignContentMaps = {
    start: `${prefixCls}-align-content-start`,
    end: `${prefixCls}-align-content-end`,
    center: `${prefixCls}-align-content-center`,
    between: `${prefixCls}-align-content-between`,
    around: `${prefixCls}-align-content-around`,
    stretch: `${prefixCls}-align-content-stretch`,
  };
 
  if (dirMaps[dir]) {
    classes.push(dirMaps[dir]);
  }
 
  if (wrapMaps[wrap]) {
    classes.push(wrapMaps[wrap]);
  }
 
  if (justifyMaps[justify]) {
    classes.push(justifyMaps[justify]);
  }
 
  if (alignMaps[align]) {
    classes.push(alignMaps[align]);
  }
 
  if (alignContentMaps[alignContent]) {
    classes.push(alignContentMaps[alignContent]);
  }
 
  return classes.join(' ');
}