File tree Expand file tree Collapse file tree 3 files changed +34
-3
lines changed
src/plugins/vis_type_table/public Expand file tree Collapse file tree 3 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -147,5 +147,6 @@ function TableOptions({
147147 </ EuiPanel >
148148 ) ;
149149}
150-
151- export { TableOptions } ;
150+ // default export required for React.Lazy
151+ // eslint-disable-next-line import/no-default-export
152+ export { TableOptions as default } ;
Original file line number Diff line number Diff line change 1+ /*
2+ * Licensed to Elasticsearch B.V. under one or more contributor
3+ * license agreements. See the NOTICE file distributed with
4+ * this work for additional information regarding copyright
5+ * ownership. Elasticsearch B.V. licenses this file to you under
6+ * the Apache License, Version 2.0 (the "License"); you may
7+ * not use this file except in compliance with the License.
8+ * You may obtain a copy of the License at
9+ *
10+ * http://www.apache.org/licenses/LICENSE-2.0
11+ *
12+ * Unless required by applicable law or agreed to in writing,
13+ * software distributed under the License is distributed on an
14+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+ * KIND, either express or implied. See the License for the
16+ * specific language governing permissions and limitations
17+ * under the License.
18+ */
19+ import React , { lazy , Suspense } from 'react' ;
20+ import { EuiLoadingSpinner } from '@elastic/eui' ;
21+ import { VisOptionsProps } from 'src/plugins/vis_default_editor/public' ;
22+ import { TableVisParams } from '../types' ;
23+
24+ const TableOptionsComponent = lazy ( ( ) => import ( './table_vis_options' ) ) ;
25+
26+ export const TableOptions = ( props : VisOptionsProps < TableVisParams > ) => (
27+ < Suspense fallback = { < EuiLoadingSpinner /> } >
28+ < TableOptionsComponent { ...props } />
29+ </ Suspense >
30+ ) ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import { Vis } from '../../visualizations/public';
2424import { tableVisResponseHandler } from './table_vis_response_handler' ;
2525// @ts -ignore
2626import tableVisTemplate from './table_vis.html' ;
27- import { TableOptions } from './components/table_vis_options ' ;
27+ import { TableOptions } from './components/table_vis_options_lazy ' ;
2828import { getTableVisualizationControllerClass } from './vis_controller' ;
2929
3030export function getTableVisTypeDefinition ( core : CoreSetup , context : PluginInitializerContext ) {
You can’t perform that action at this time.
0 commit comments