import { PivotAggsConfigDict , PivotGroupByConfigDict } from '../../../../../common' ; import { SearchItems } from '../../../../../hooks/use_search_items' ; import { defaultSearch , QUERY_LANGUAGE_KUERY } from './constants' ; import { StepDefineExposedState } from './types' ; import { TRANSFORM_FUNCTION } from '../../../../../../../common/constants' ; import { LatestFunctionConfigUI } from '../../../../../../../common/types/transform' ; export function getDefaultStepDefineState ( searchItems ) { return { transformFunction : TRANSFORM_FUNCTION . PIVOT , latestConfig : { } as LatestFunctionConfigUI , aggList : { } as PivotAggsConfigDict , groupByList : { } as PivotGroupByConfigDict , isAdvancedPivotEditorEnabled : false , isAdvancedSourceEditorEnabled : false , searchLanguage : QUERY_LANGUAGE_KUERY , searchString : undefined , searchQuery : searchItems . savedSearch !== undefined ? searchItems . combinedQuery : defaultSearch , sourceConfigUpdated : false , valid : false , validationStatus : { isValid : false , } , previewRequest : undefined , runtimeMappings : undefined , runtimeMappingsUpdated : false , isRuntimeMappingsEditorEnabled : false , } ; }