11'use strict' ;
22
33Object . defineProperty ( exports , "__esModule" , {
4- value : true
4+ value : true
55} ) ;
66
77var _deepClone = require ( '../../src/utils/deepClone.js' ) ;
88
99var _deepClone2 = _interopRequireDefault ( _deepClone ) ;
1010
11- var _utils = require ( '../../src/utils/utils.js' ) ;
12-
13- var _utils2 = _interopRequireDefault ( _utils ) ;
14-
1511function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
1612
1713exports . default = {
14+ data : function data ( ) {
1815
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- }
16+ return {
3317
34- return result ;
35- } ,
36- noFrozenFooterCols : function noFrozenFooterCols ( ) {
37- var result = [ ] ;
18+ footerTotalHeight : 0
19+ } ;
20+ } ,
3821
39- if ( this . initInternalFooter . length > 0 ) {
22+ computed : {
23+ frozenFooterCols : function frozenFooterCols ( ) {
4024
41- this . initInternalFooter . forEach ( function ( columns ) {
25+ var result = [ ] ;
4226
43- result . push ( columns . filter ( function ( col ) {
44- return ! col . isFrozen ;
45- } ) ) ;
46- } ) ;
47- }
27+ if ( this . initInternalFooter . length > 0 ) {
4828
49- return result ;
50- } ,
51- getFooterTotalRowHeight : function getFooterTotalRowHeight ( ) {
29+ this . initInternalFooter . forEach ( function ( columns ) {
5230
53- if ( Array . isArray ( this . footer ) && this . footer . length > 0 ) {
31+ result . push ( columns . filter ( function ( col ) {
32+ return col . isFrozen ;
33+ } ) ) ;
34+ } ) ;
35+ }
5436
55- return this . footer . length * this . footerRowHeight ;
56- }
57- return 0 ;
58- } ,
59- getFooterContainerHeight : function getFooterContainerHeight ( ) {
37+ return result ;
38+ } ,
39+ noFrozenFooterCols : function noFrozenFooterCols ( ) {
40+ var result = [ ] ;
6041
61- var result = 0 ;
62- if ( this . getFooterTotalRowHeight > 0 ) {
42+ if ( this . initInternalFooter . length > 0 ) {
6343
64- result = this . getFooterTotalRowHeight ;
44+ this . initInternalFooter . forEach ( function ( columns ) {
6545
66- if ( this . hasBodyHorizontalScrollBar ( ) ) {
46+ result . push ( columns . filter ( function ( col ) {
47+ return ! col . isFrozen ;
48+ } ) ) ;
49+ } ) ;
50+ }
6751
68- result += _utils2 . default . getScrollbarWidth ( ) ;
69- }
70- }
52+ return result ;
53+ } ,
54+ getFooterTotalRowHeight : function getFooterTotalRowHeight ( ) {
7155
72- return result ;
73- } ,
74- hasTableFooter : function hasTableFooter ( ) {
56+ if ( Array . isArray ( this . footer ) && this . footer . length > 0 ) {
7557
76- return Array . isArray ( this . footer ) && this . footer . length ;
77- } ,
78- initInternalFooter : function initInternalFooter ( ) {
58+ return this . footer . length * this . footerRowHeight ;
59+ }
60+ return 0 ;
61+ } ,
62+ hasTableFooter : function hasTableFooter ( ) {
7963
80- if ( ! ( Array . isArray ( this . footer ) && this . footer . length > 0 ) ) {
64+ return Array . isArray ( this . footer ) && this . footer . length ;
65+ } ,
66+ initInternalFooter : function initInternalFooter ( ) {
8167
82- return [ ] ;
83- }
68+ if ( ! ( Array . isArray ( this . footer ) && this . footer . length > 0 ) ) {
8469
85- var result = [ ] ,
86- resultRow = [ ] ,
87- cloneInternalColumns ;
70+ return [ ] ;
71+ }
8872
89- cloneInternalColumns = ( 0 , _deepClone2 . default ) ( this . internalColumns ) ;
73+ var result = [ ] ,
74+ resultRow = [ ] ,
75+ cloneInternalColumns ;
9076
91- cloneInternalColumns . sort ( function ( a , b ) {
77+ cloneInternalColumns = ( 0 , _deepClone2 . default ) ( this . internalColumns ) ;
9278
93- if ( a . isFrozen ) {
79+ cloneInternalColumns . sort ( function ( a , b ) {
9480
95- return - 1 ;
96- } else if ( b . isFrozen ) {
81+ if ( a . isFrozen ) {
9782
98- return 1 ;
99- }
100- return 0 ;
101- } ) ;
83+ return - 1 ;
84+ } else if ( b . isFrozen ) {
10285
103- this . footer . forEach ( function ( items , rows ) {
86+ return 1 ;
87+ }
88+ return 0 ;
89+ } ) ;
10490
105- resultRow = [ ] ;
91+ this . footer . forEach ( function ( items , rows ) {
10692
107- items . forEach ( function ( value , index ) {
93+ resultRow = [ ] ;
10894
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- } ) ;
95+ items . forEach ( function ( value , index ) {
11696
117- result . push ( resultRow ) ;
118- } ) ;
119- return result ;
120- }
121- } ,
97+ resultRow . push ( {
98+ content : value ,
99+ width : cloneInternalColumns [ index ] . width ,
100+ align : cloneInternalColumns [ index ] . columnAlign ,
101+ isFrozen : cloneInternalColumns [ index ] . isFrozen ? true : false
102+ } ) ;
103+ } ) ;
122104
123- methods : {
124- setFooterCellClassName : function setFooterCellClassName ( isLeftView , rowIndex , colIndex , value ) {
105+ result . push ( resultRow ) ;
106+ } ) ;
107+ return result ;
108+ }
109+ } ,
125110
126- var _colIndex = colIndex ;
111+ methods : {
112+ setFooterCellClassName : function setFooterCellClassName ( isLeftView , rowIndex , colIndex , value ) {
127113
128- if ( ! isLeftView && this . hasFrozenColumn ) {
114+ var _colIndex = colIndex ;
129115
130- _colIndex += this . frozenCols . length ;
131- }
116+ if ( ! isLeftView && this . hasFrozenColumn ) {
132117
133- return this . footerCellClassName && this . footerCellClassName ( rowIndex , _colIndex , value ) ;
134- }
118+ _colIndex += this . frozenCols . length ;
135119 }
136120
121+ return this . footerCellClassName && this . footerCellClassName ( rowIndex , _colIndex , value ) ;
122+ }
123+ }
124+
137125} ;
0 commit comments