1717 * under the License.
1818 */
1919
20- import _ from 'lodash' ;
20+ import { find , template } from 'lodash' ;
2121import $ from 'jquery' ;
22- // @ts -ignore
2322import rison from 'rison-node' ;
2423import '../../doc_viewer' ;
25- // @ts -ignore
26- import { noWhiteSpace } from '../../../../../../../legacy/core_plugins/kibana/common/utils/no_white_space' ;
2724
2825import openRowHtml from './table_row/open.html' ;
2926import detailsHtml from './table_row/details.html' ;
@@ -35,6 +32,16 @@ import truncateByHeightTemplateHtml from '../components/table_row/truncate_by_he
3532import { esFilters } from '../../../../../../data/public' ;
3633import { getServices } from '../../../../kibana_services' ;
3734
35+ const TAGS_WITH_WS = / > \s + < / g;
36+
37+ /**
38+ * Remove all of the whitespace between html tags
39+ * so that inline elements don't have extra spaces.
40+ */
41+ export function noWhiteSpace ( html : string ) : string {
42+ return html . replace ( TAGS_WITH_WS , '><' ) ;
43+ }
44+
3845// guesstimate at the minimum number of chars wide cells in the table should be
3946const MIN_LINE_LENGTH = 20 ;
4047
@@ -43,8 +50,8 @@ interface LazyScope extends ng.IScope {
4350}
4451
4552export function createTableRowDirective ( $compile : ng . ICompileService , $httpParamSerializer : any ) {
46- const cellTemplate = _ . template ( noWhiteSpace ( cellTemplateHtml ) ) ;
47- const truncateByHeightTemplate = _ . template ( noWhiteSpace ( truncateByHeightTemplateHtml ) ) ;
53+ const cellTemplate = template ( noWhiteSpace ( cellTemplateHtml ) ) ;
54+ const truncateByHeightTemplate = template ( noWhiteSpace ( truncateByHeightTemplateHtml ) ) ;
4855
4956 return {
5057 restrict : 'A' ,
@@ -169,7 +176,7 @@ export function createTableRowDirective($compile: ng.ICompileService, $httpParam
169176 const $cell = $cells . eq ( i ) ;
170177 if ( $cell . data ( 'discover:html' ) === html ) return ;
171178
172- const reuse = _ . find ( $cells . slice ( i + 1 ) , function ( cell : any ) {
179+ const reuse = find ( $cells . slice ( i + 1 ) , function ( cell : any ) {
173180 return $ . data ( cell , 'discover:html' ) === html ;
174181 } ) ;
175182
0 commit comments