diff --git a/packages/ui-components/src/components/Matrix/MatrixContext.ts b/packages/ui-components/src/components/Matrix/MatrixContext.ts index 7606c9387a..4f636d7baa 100644 --- a/packages/ui-components/src/components/Matrix/MatrixContext.ts +++ b/packages/ui-components/src/components/Matrix/MatrixContext.ts @@ -4,7 +4,7 @@ */ import { Dispatch, ReactNode, createContext } from 'react'; -import { MatrixConfig, PresentationOptions } from '@tupaia/types'; +import { MatrixConfig } from '@tupaia/types'; import { MatrixColumnType, MatrixRowType } from '../../types'; type RowTitle = MatrixRowType['title']; diff --git a/packages/ui-components/src/components/Matrix/utils.ts b/packages/ui-components/src/components/Matrix/utils.ts index 425608ade2..ee8e3c1cdc 100644 --- a/packages/ui-components/src/components/Matrix/utils.ts +++ b/packages/ui-components/src/components/Matrix/utils.ts @@ -4,7 +4,7 @@ */ import { find, isString, isNumber } from 'lodash'; import { - PresentationOptions, + MatrixPresentationOptions, ConditionValue, RangePresentationOptions, ConditionalPresentationOptions, @@ -29,7 +29,7 @@ export const getFullHex = (hex: string) => { }; export const findByKey = ( - collection: PresentationOptions['conditions'], + collection: MatrixPresentationOptions['conditions'], key: string, caseSensitive = true, ) => @@ -57,8 +57,10 @@ const CONDITION_CHECK_METHOD = { }; // This function is used to get the presentation option from the conditions, where the key is the value -const getPresentationOptionFromKey = (options: PresentationOptions['conditions'], value: any) => - findByKey(options, value, false) || null; +const getPresentationOptionFromKey = ( + options: MatrixPresentationOptions['conditions'], + value: any, +) => findByKey(options, value, false) || null; // This function is used to get the presentation option from the conditions, when conditions is an array const getPresentationOptionFromCondition = ( @@ -110,7 +112,7 @@ export const getPresentationOptionFromRange = (options: RangePresentationOptions }; // This function returns the applicable presentation option from the presentation options, for the value -export const getPresentationOption = (options: PresentationOptions, value: any) => { +export const getPresentationOption = (options: MatrixPresentationOptions, value: any) => { switch (options.type) { case PRESENTATION_TYPES.RANGE: return getPresentationOptionFromRange(options as RangePresentationOptions, value); @@ -121,7 +123,7 @@ export const getPresentationOption = (options: PresentationOptions, value: any) } }; -export function getIsUsingDots(presentationOptions: PresentationOptions = {}) { +export function getIsUsingDots(presentationOptions: MatrixPresentationOptions = {}) { return ( Object.keys(presentationOptions).filter(optionName => !optionName.includes('export')).length > 0 );