1+ 'use strict' ;
2+
3+ Object . defineProperty ( exports , "__esModule" , {
4+ value : true
5+ } ) ;
6+
7+ var _deepClone = require ( '../../src/utils/deepClone.js' ) ;
8+
9+ var _deepClone2 = _interopRequireDefault ( _deepClone ) ;
10+
11+ var _utils = require ( '../../src/utils/utils.js' ) ;
12+
13+ var _utils2 = _interopRequireDefault ( _utils ) ;
14+
15+ function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
16+
17+ exports . default = {
18+
19+ computed : {
20+ frozenFooterCols : function frozenFooterCols ( ) {
21+
22+ var result = [ ] ;
23+
24+ if ( this . initInternalFooter . length > 0 ) {
25+
26+ this . initInternalFooter . forEach ( function ( columns ) {
27+
28+ result . push ( columns . filter ( function ( col ) {
29+ return col . isFrozen ;
30+ } ) ) ;
31+ } ) ;
32+ }
33+
34+ return result ;
35+ } ,
36+ noFrozenFooterCols : function noFrozenFooterCols ( ) {
37+ var result = [ ] ;
38+
39+ if ( this . initInternalFooter . length > 0 ) {
40+
41+ this . initInternalFooter . forEach ( function ( columns ) {
42+
43+ result . push ( columns . filter ( function ( col ) {
44+ return ! col . isFrozen ;
45+ } ) ) ;
46+ } ) ;
47+ }
48+
49+ return result ;
50+ } ,
51+ getFooterTotalRowHeight : function getFooterTotalRowHeight ( ) {
52+
53+ if ( Array . isArray ( this . footer ) && this . footer . length > 0 ) {
54+
55+ return this . footer . length * this . footerRowHeight ;
56+ }
57+ return 0 ;
58+ } ,
59+ getFooterContainerHeight : function getFooterContainerHeight ( ) {
60+
61+ var result = 0 ;
62+ if ( this . getFooterTotalRowHeight > 0 ) {
63+
64+ result = this . getFooterTotalRowHeight ;
65+
66+ if ( this . hasBodyHorizontalScrollBar ( ) ) {
67+
68+ result += _utils2 . default . getScrollbarWidth ( ) ;
69+ }
70+ }
71+
72+ return result ;
73+ } ,
74+ hasTableFooter : function hasTableFooter ( ) {
75+
76+ return Array . isArray ( this . footer ) && this . footer . length ;
77+ } ,
78+ initInternalFooter : function initInternalFooter ( ) {
79+
80+ if ( ! ( Array . isArray ( this . footer ) && this . footer . length > 0 ) ) {
81+
82+ return [ ] ;
83+ }
84+
85+ var result = [ ] ,
86+ resultRow = [ ] ,
87+ cloneInternalColumns ;
88+
89+ cloneInternalColumns = ( 0 , _deepClone2 . default ) ( this . internalColumns ) ;
90+
91+ cloneInternalColumns . sort ( function ( a , b ) {
92+
93+ if ( a . isFrozen ) {
94+
95+ return - 1 ;
96+ } else if ( b . isFrozen ) {
97+
98+ return 1 ;
99+ }
100+ return 0 ;
101+ } ) ;
102+
103+ this . footer . forEach ( function ( items , rows ) {
104+
105+ resultRow = [ ] ;
106+
107+ items . forEach ( function ( value , index ) {
108+
109+ resultRow . push ( {
110+ content : value ,
111+ width : cloneInternalColumns [ index ] . width ,
112+ align : cloneInternalColumns [ index ] . columnAlign ,
113+ isFrozen : cloneInternalColumns [ index ] . isFrozen ? true : false
114+ } ) ;
115+ } ) ;
116+
117+ result . push ( resultRow ) ;
118+ } ) ;
119+ return result ;
120+ }
121+ } ,
122+
123+ methods : {
124+ setFooterCellClassName : function setFooterCellClassName ( isLeftView , rowIndex , colIndex , value ) {
125+
126+ var _colIndex = colIndex ;
127+
128+ if ( ! isLeftView && this . hasFrozenColumn ) {
129+
130+ _colIndex += this . frozenCols . length ;
131+ }
132+
133+ return this . footerCellClassName && this . footerCellClassName ( rowIndex , _colIndex , value ) ;
134+ }
135+ }
136+
137+ } ;
0 commit comments