react-querybuilder
Version:
React Query Builder component for constructing queries and filters, with utilities for executing them in various database and evaluation contexts
1 lines • 28.1 kB
Source Map (JSON)
{"version":3,"file":"async.mjs","names":["initialState","initialState","useRQB_INTERNAL_QueryBuilderDispatch","useRQB_INTERNAL_QueryBuilderSelector"],"sources":["../src/messages.ts","../src/redux/queriesSlice.ts","../src/redux/QueryBuilderStateContext.ts","../src/redux/warningsSlice.ts","../src/redux/rootReducer.ts","../src/redux/_internal/hooks.ts","../src/redux/_internal/index.ts","../src/redux/configureRqbStore.ts","../src/redux/getRqbStore.ts","../src/hooks/useAsyncOptionList/getOptionListsAsync.ts","../src/hooks/useAsyncOptionList/asyncOptionListsSlice.ts","../src/hooks/useAsyncOptionList/useAsyncCacheKey.ts","../src/hooks/useAsyncOptionList/index.ts"],"sourcesContent":["export const messages = {\n errorInvalidIndependentCombinatorsProp:\n 'QueryBuilder was rendered with a truthy independentCombinators prop. This prop is deprecated and unnecessary. Furthermore, the initial query/defaultQuery prop was of type RuleGroupType instead of type RuleGroupIC. More info: https://react-querybuilder.js.org/docs/components/querybuilder#independent-combinators',\n\n errorUnnecessaryIndependentCombinatorsProp:\n 'QueryBuilder was rendered with the deprecated and unnecessary independentCombinators prop. To use independent combinators, make sure the query/defaultQuery prop is of type RuleGroupIC when the component mounts. More info: https://react-querybuilder.js.org/docs/components/querybuilder#independent-combinators',\n\n errorDeprecatedRuleGroupProps:\n 'A custom RuleGroup component has rendered a standard RuleGroup component with deprecated props. The combinator, not, and rules props should not be used. Instead, the full group object should be passed as the ruleGroup prop.',\n\n errorDeprecatedRuleProps:\n 'A custom RuleGroup component has rendered a standard Rule component with deprecated props. The field, operator, value, and valueSource props should not be used. Instead, the full rule object should be passed as the rule prop.',\n\n errorBothQueryDefaultQuery:\n 'QueryBuilder was rendered with both query and defaultQuery props. QueryBuilder must be either controlled or uncontrolled (specify either the query prop, or the defaultQuery prop, but not both). Decide between using a controlled or uncontrolled query builder and remove one of these props. More info: https://reactjs.org/link/controlled-components',\n\n errorUncontrolledToControlled:\n 'QueryBuilder is changing from an uncontrolled component to be controlled. This is likely caused by the query changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled query builder for the lifetime of the component. More info: https://reactjs.org/link/controlled-components',\n\n errorControlledToUncontrolled:\n 'QueryBuilder is changing from a controlled component to be uncontrolled. This is likely caused by the query changing from defined to undefined, which should not happen. Decide between using a controlled or uncontrolled query builder for the lifetime of the component. More info: https://reactjs.org/link/controlled-components',\n\n errorEnabledDndWithoutReactDnD:\n 'QueryBuilder was rendered with the enableDragAndDrop prop set to true, but either react-dnd was not detected or one of react-dnd-html5-backend or react-dnd-touch-backend was not detected. To enable drag-and-drop functionality, install react-dnd and one of the backend packages and wrap QueryBuilder in QueryBuilderDnD from @react-querybuilder/dnd.',\n\n errorDeprecatedDebugImport: `Importing from react-querybuilder/debug is deprecated. To enable Redux DevTools for React Query Builder's internal store, set globalThis.__RQB_DEVTOOLS__ = true.`,\n} as const;\n","import type { RuleGroupTypeAny } from '@react-querybuilder/core';\nimport type { PayloadAction, Slice } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\n\nexport type QueriesSliceState = Record<string, RuleGroupTypeAny>;\n\nexport interface SetQueryStateParams {\n qbId: string;\n query: RuleGroupTypeAny;\n}\n\nconst initialState: QueriesSliceState = {};\n\nexport const queriesSlice: Slice<\n QueriesSliceState,\n {\n setQueryState: (\n state: QueriesSliceState,\n { payload: { qbId, query } }: PayloadAction<SetQueryStateParams>\n ) => void;\n },\n 'queries',\n 'queries',\n { getQuerySelectorById: (state: QueriesSliceState, qbId: string) => RuleGroupTypeAny }\n> = createSlice({\n name: 'queries',\n initialState,\n reducers: {\n setQueryState: (state, { payload: { qbId, query } }) => {\n state[qbId] = query;\n },\n },\n selectors: {\n getQuerySelectorById: (state, qbId) => state[qbId],\n },\n});\n","import * as React from 'react';\nimport type { ReactReduxContextValue } from 'react-redux';\nimport type { RqbState } from './types';\n\nexport const QueryBuilderStateContext: React.Context<ReactReduxContextValue<RqbState> | null> =\n React.createContext<ReactReduxContextValue<RqbState> | null>(null);\n","import type { PayloadAction, Slice } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\nimport { messages } from '../messages';\n\ntype ValuesAsKeys<T> =\n T extends Record<infer _K, infer V>\n ? [V] extends [string]\n ? { [Key in V]: boolean }\n : never\n : never;\ntype ValuesType<T> =\n T extends Record<infer _K, infer V> ? ([V] extends [string] ? V : never) : never;\nexport type WarningsSliceState = ValuesAsKeys<typeof messages>;\nexport type Messages = ValuesType<typeof messages>;\nconst initialState: WarningsSliceState = {\n [messages.errorInvalidIndependentCombinatorsProp]: false,\n [messages.errorUnnecessaryIndependentCombinatorsProp]: false,\n [messages.errorDeprecatedRuleGroupProps]: false,\n [messages.errorDeprecatedRuleProps]: false,\n [messages.errorBothQueryDefaultQuery]: false,\n [messages.errorUncontrolledToControlled]: false,\n [messages.errorControlledToUncontrolled]: false,\n [messages.errorEnabledDndWithoutReactDnD]: false,\n [messages.errorDeprecatedDebugImport]: false,\n};\n\nexport const warningsSlice: Slice<\n WarningsSliceState,\n {\n // oxlint-disable-next-line typescript/no-explicit-any\n rqbWarn: (state: any, { payload }: PayloadAction<Messages>) => void;\n },\n 'warnings'\n> = createSlice({\n name: 'warnings',\n initialState,\n reducers: {\n rqbWarn: (state, { payload }) => {\n if (!state[payload]) {\n console.error(payload);\n state[payload] = true;\n }\n },\n },\n});\n","import type { CombinedSliceReducer } from '@reduxjs/toolkit';\nimport { combineSlices } from '@reduxjs/toolkit';\nimport type { QueriesSliceState } from './queriesSlice';\nimport { queriesSlice } from './queriesSlice';\nimport type { WarningsSliceState } from './warningsSlice';\nimport { warningsSlice } from './warningsSlice';\n\nexport interface LazyLoadedSlices {}\n\nexport const rootReducer: CombinedSliceReducer<{\n queries: QueriesSliceState;\n warnings: WarningsSliceState;\n}> = combineSlices(queriesSlice, warningsSlice).withLazyLoadedSlices<LazyLoadedSlices>();\n","import type { Dispatch, Store, ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';\nimport React from 'react';\nimport type { ReactReduxContextValue, TypedUseSelectorHook, UseStore } from 'react-redux';\nimport { createDispatchHook, createSelectorHook, createStoreHook } from 'react-redux';\nimport type { RqbState } from '../types';\n\nconst genUseQueryBuilderDispatch = (\n ctx: React.Context<ReactReduxContextValue<RqbState> | null>\n): UseQueryBuilderDispatch => createDispatchHook(ctx);\nexport type UseQueryBuilderDispatch = () => ThunkDispatch<RqbState, undefined, UnknownAction> &\n Dispatch;\n\nconst genUseQueryBuilderStore = (\n ctx: React.Context<ReactReduxContextValue<RqbState> | null>\n): UseStore<Store<RqbState>> => createStoreHook(ctx);\n\nconst genUseQueryBuilderSelector = (\n ctx: React.Context<ReactReduxContextValue<RqbState> | null>\n): TypedUseSelectorHook<RqbState> => createSelectorHook(ctx);\n\nexport const getInternalHooks = (\n ctx: React.Context<ReactReduxContextValue<RqbState> | null>\n): {\n useRQB_INTERNAL_QueryBuilderDispatch: UseQueryBuilderDispatch;\n useRQB_INTERNAL_QueryBuilderStore: UseStore<Store<RqbState>>;\n useRQB_INTERNAL_QueryBuilderSelector: TypedUseSelectorHook<RqbState>;\n} => ({\n useRQB_INTERNAL_QueryBuilderDispatch: genUseQueryBuilderDispatch(ctx),\n useRQB_INTERNAL_QueryBuilderStore: genUseQueryBuilderStore(ctx),\n useRQB_INTERNAL_QueryBuilderSelector: genUseQueryBuilderSelector(ctx),\n});\n","import type { RuleGroupType, RuleGroupTypeIC } from '@react-querybuilder/core';\nimport type { ConfigureStoreOptions, PayloadAction, Store, ThunkAction } from '@reduxjs/toolkit';\nimport type { TypedUseSelectorHook, UseStore } from 'react-redux';\nimport type { SetQueryStateParams } from '../queriesSlice';\nimport { queriesSlice } from '../queriesSlice';\nimport { QueryBuilderStateContext } from '../QueryBuilderStateContext';\nimport { rootReducer } from '../rootReducer';\nimport type { RqbState } from '../types';\nimport type { Messages } from '../warningsSlice';\nimport { warningsSlice } from '../warningsSlice';\nimport type { UseQueryBuilderDispatch } from './hooks';\nimport { getInternalHooks } from './hooks';\n\nexport const _RQB_INTERNAL_dispatchThunk =\n ({\n payload,\n onQueryChange,\n }: {\n payload: SetQueryStateParams;\n onQueryChange?: ((query: RuleGroupType) => void) | ((query: RuleGroupTypeIC) => void);\n }): ThunkAction<void, RqbState, unknown, PayloadAction<SetQueryStateParams>> =>\n dispatch => {\n dispatch(queriesSlice.actions.setQueryState(payload));\n if (typeof onQueryChange === 'function') {\n onQueryChange(payload.query as never /* ??? */);\n }\n };\n\nconst internalHooks = getInternalHooks(QueryBuilderStateContext);\n\n/**\n * Gets the `dispatch` function for the RQB Redux store.\n */\nexport const useRQB_INTERNAL_QueryBuilderDispatch: UseQueryBuilderDispatch =\n internalHooks.useRQB_INTERNAL_QueryBuilderDispatch;\n/**\n * Gets the full RQB Redux store.\n */\nexport const useRQB_INTERNAL_QueryBuilderStore: UseStore<Store<RqbState>> =\n internalHooks.useRQB_INTERNAL_QueryBuilderStore;\n/**\n * General purpose selector hook for the RQB Redux store.\n */\nexport const useRQB_INTERNAL_QueryBuilderSelector: TypedUseSelectorHook<RqbState> =\n internalHooks.useRQB_INTERNAL_QueryBuilderSelector;\n\nconst { rqbWarn: _SYNC_rqbWarn } = warningsSlice.actions;\n\nexport const rqbWarn =\n (msg: Messages): ThunkAction<void, RqbState, unknown, PayloadAction<Messages>> =>\n dispatch => {\n setTimeout(() => dispatch(_SYNC_rqbWarn(msg)));\n };\n\nconst preloadedState = {\n queries: queriesSlice.getInitialState(),\n warnings: warningsSlice.getInitialState(),\n // Avoid importing the async slice itself to ensure lazy loading\n // asyncOptionLists: { cache: {}, loading: {}, errors: {} },\n} as RqbState;\n\nexport const storeCommon: ConfigureStoreOptions = {\n reducer: rootReducer,\n preloadedState,\n middleware: getDefaultMiddleware =>\n getDefaultMiddleware({\n // Ignore non-serializable values in setQueryState actions and rule `value`s\n // https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data\n serializableCheck: {\n ignoredActions: [queriesSlice.actions.setQueryState.type],\n ignoredPaths: [/^queries\\b.*\\.rules\\.\\d+\\.value$/],\n },\n }),\n};\n","import type { Slice } from '@reduxjs/toolkit';\nimport { configureStore } from '@reduxjs/toolkit';\nimport { storeCommon } from './_internal';\nimport { rootReducer } from './rootReducer';\nimport type { RqbStore } from './types';\n\nexport const configureRqbStore = (devTools?: boolean): RqbStore => {\n const queryBuilderStore = configureStore({\n ...storeCommon,\n devTools: devTools ? /* v8 ignore next -- @preserve */ { name: 'React Query Builder' } : false,\n }) as RqbStore;\n\n queryBuilderStore.addSlice = (slice: Slice) => {\n rootReducer.inject(slice);\n // Initialize state for the new slice. This action is a no-op because\n // the `type` is random and will never match any reducers.\n queryBuilderStore.dispatch({\n type: crypto.randomUUID().slice(0, 8),\n meta: `Initializing state for slice \"${slice.name}\"`,\n });\n };\n\n return queryBuilderStore;\n};\n","import type { Slice } from '@reduxjs/toolkit';\nimport { configureRqbStore } from './configureRqbStore';\nimport type { RqbStore } from './types';\n\nlet _store: RqbStore | null = null;\n\ndeclare global {\n var __RQB_DEVTOOLS__: boolean | undefined;\n}\n\n/**\n * Gets the singleton React Query Builder store instance.\n * DevTools are enabled if either:\n * - globalThis.__RQB_DEVTOOLS__ is truthy\n * - window.__RQB_DEVTOOLS__ is truthy\n */\nexport function getRqbStore(devTools?: boolean): RqbStore {\n if (!_store) {\n const devToolsEnabled = devTools || globalThis?.__RQB_DEVTOOLS__;\n\n _store = configureRqbStore(devToolsEnabled);\n }\n return _store;\n}\n\n/**\n * Injects a slice into the React Query Builder store. Useful for extensions\n * that need to integrate their own state management.\n */\nexport const injectSlice = (slice: Slice): void => getRqbStore().addSlice(slice);\n","import type {\n BaseOption,\n FlexibleOptionListProp,\n FullOption,\n FullOptionList,\n RuleGroupTypeAny,\n RuleType,\n} from '@react-querybuilder/core';\nimport { prepareOptionList } from '@react-querybuilder/core';\nimport type { AsyncThunk, AsyncThunkConfig } from '@reduxjs/toolkit';\nimport { createAsyncThunk } from '@reduxjs/toolkit';\nimport type { AsyncOptionListsSliceState } from './types';\n\nexport const DEFAULT_CACHE_TTL = 1_800_000; // 30 minutes\n\n// Generic async thunk for fetching with cache check\nexport const getOptionListsAsync: AsyncThunk<\n { cacheKey: string; data: FullOptionList<FullOption>; fromCache: boolean },\n {\n cacheKey: string;\n cacheTTL?: number;\n value: string | undefined;\n ruleOrGroup?: RuleType | RuleGroupTypeAny;\n loadOptionList: (\n value: string | undefined,\n meta: { ruleOrGroup?: RuleType | RuleGroupTypeAny }\n ) => Promise<FlexibleOptionListProp<BaseOption>>;\n },\n AsyncThunkConfig\n> = createAsyncThunk(\n 'asyncOptionLists/asyncOptionListsThunk',\n async (params, { getState, rejectWithValue }) => {\n const { cacheKey, cacheTTL, value, loadOptionList } = params;\n const state = getState() as { asyncOptionLists: AsyncOptionListsSliceState };\n const cached = state.asyncOptionLists.cache[cacheKey];\n\n // Check if cache is still valid\n if (\n cached &&\n Date.now() - cached.timestamp <\n (cacheTTL ??\n /* v8 ignore start -- @preserve */ DEFAULT_CACHE_TTL) /* v8 ignore stop -- @preserve */\n ) {\n return { cacheKey, data: cached.data, fromCache: true };\n }\n\n try {\n const rawList = await loadOptionList(value, params);\n // TODO?: accept additional params for this function\n const data = prepareOptionList({ optionList: rawList }).optionList;\n return { cacheKey, data, fromCache: false };\n } catch (error) {\n return rejectWithValue((error as Error).message);\n }\n },\n {\n condition: ({ cacheKey }, { getState }) => {\n const state = getState() as { asyncOptionLists: AsyncOptionListsSliceState };\n const loading = state.asyncOptionLists.loading[cacheKey];\n return !loading;\n },\n }\n);\n","import type { PayloadAction, Slice } from '@reduxjs/toolkit';\nimport { createSlice } from '@reduxjs/toolkit';\nimport { DEFAULT_CACHE_TTL, getOptionListsAsync } from './getOptionListsAsync';\nimport type { AsyncOptionListsSliceState, CachedOptionList } from './types';\n\nexport { DEFAULT_CACHE_TTL, getOptionListsAsync };\n\ntype State = AsyncOptionListsSliceState;\n\nconst initialState: State = { cache: {}, loading: {}, errors: {} };\n\nconst sliceName = 'asyncOptionLists';\n\nexport const asyncOptionListsSlice: Slice<\n State,\n {\n invalidateCache: (state: State, action: PayloadAction<string>) => void;\n clearAllCache: (state: State) => void;\n },\n typeof sliceName,\n typeof sliceName,\n {\n selectCache: (state: State) => typeof state.cache;\n selectLoading: (state: State) => typeof state.loading;\n selectErrors: (state: State) => typeof state.errors;\n selectCacheByKey: (state: State, cacheKey: string) => CachedOptionList;\n selectIsLoadingByKey: (state: State, cacheKey: string) => boolean;\n selectErrorByKey: (state: State, cacheKey: string) => string | null;\n }\n> = createSlice({\n name: sliceName,\n initialState,\n reducers: {\n /* v8 ignore start -- -- @preserve */\n invalidateCache: (state, { payload }) => {\n delete state.cache[payload];\n delete state.errors[payload];\n },\n clearAllCache: state => {\n state.cache = {};\n state.errors = {};\n state.loading = {};\n },\n /* v8 ignore stop -- -- @preserve */\n },\n // prettier-ignore\n selectors: {\n /* v8 ignore start -- -- @preserve */\n selectCache: state => state.cache,\n selectLoading: state => state.loading,\n selectErrors: state => state.errors,\n selectCacheByKey: (state, cacheKey) => state.cache[cacheKey] || null,\n selectIsLoadingByKey: (state, cacheKey) => state.loading[cacheKey] || false,\n selectErrorByKey: (state, cacheKey) => {\n const error = state.errors[cacheKey];\n return error && error !== '' ? error : null;\n },\n /* v8 ignore stop -- -- @preserve */\n },\n extraReducers: builder => {\n builder.addAsyncThunk(getOptionListsAsync, {\n pending: (state, action) => {\n state.loading[action.meta.arg.cacheKey] = true;\n state.errors[action.meta.arg.cacheKey] = '';\n },\n fulfilled: (state, action) => {\n const { cacheKey, data } = action.payload;\n state.cache[cacheKey] = {\n data,\n timestamp: Date.now(),\n validUntil:\n Date.now() +\n (action.meta.arg.cacheTTL ??\n /* v8 ignore start -- @preserve */ DEFAULT_CACHE_TTL) /* v8 ignore stop -- @preserve */,\n };\n state.loading[cacheKey] = false;\n },\n rejected: (state, action) => {\n state.loading[action.meta.arg.cacheKey] = false;\n state.errors[action.meta.arg.cacheKey] = action.payload as string;\n },\n });\n },\n});\n","import { useMemo } from 'react';\nimport type { ValueEditorProps, VersatileSelectorProps } from '../../types';\nimport type { UseAsyncOptionListParams } from './types';\n\n/**\n * Generates a cache key given the same props and params as {@link useAsyncOptionList}.\n *\n * @group Hooks\n */\nexport const useAsyncCacheKey = <PropsType extends VersatileSelectorProps | ValueEditorProps>(\n props: PropsType,\n // v8 ignore next\n { getCacheKey }: UseAsyncOptionListParams<PropsType> = {}\n): string => {\n const ruleOrGroup = props.rule ?? (props as VersatileSelectorProps).ruleGroup;\n\n return useMemo(\n () =>\n typeof getCacheKey === 'string'\n ? (ruleOrGroup?.[getCacheKey as 'id'] ?? '')\n : typeof getCacheKey === 'function'\n ? getCacheKey(props)\n : Array.isArray(getCacheKey) && getCacheKey.length > 0 && ruleOrGroup\n ? getCacheKey.map(ck => `${ruleOrGroup[ck as 'id']}`).join('|')\n : '',\n [\n getCacheKey,\n // Spread all properties of `props`—in alphabetical order—to allow passing `props`\n // to `getCacheKey` function without having `props` in the dependency array.\n // oxlint-disable exhaustive-deps\n ...Object.keys(props)\n .toSorted()\n // oxlint-disable-next-line no-explicit-any\n .map(k => (props as any)[k]),\n // oxlint-enable exhaustive-deps\n ]\n );\n};\n","import { clsx, standardClassnames } from '@react-querybuilder/core';\nimport { useEffect, useMemo } from 'react';\nimport { injectSlice, QueryBuilderStateContext } from 'react-querybuilder';\nimport { getInternalHooks } from '../../redux/_internal/hooks';\nimport type { ValueEditorProps, VersatileSelectorProps } from '../../types';\nimport { asyncOptionListsSlice, getOptionListsAsync } from './asyncOptionListsSlice';\nimport type { UseAsyncOptionList, UseAsyncOptionListParams } from './types';\nimport { useAsyncCacheKey } from './useAsyncCacheKey';\n\nexport * from './asyncOptionListsSlice';\nexport * from './types';\nexport * from './useAsyncCacheKey';\n\nconst { useRQB_INTERNAL_QueryBuilderDispatch, useRQB_INTERNAL_QueryBuilderSelector } =\n getInternalHooks(QueryBuilderStateContext);\n\ninjectSlice(asyncOptionListsSlice);\n\n/**\n * Augments a {@link ValueSelectorProps} object with async option loading.\n *\n * @group Hooks\n */\nexport function useAsyncOptionList(\n props: VersatileSelectorProps,\n params?: UseAsyncOptionListParams<VersatileSelectorProps>\n): UseAsyncOptionList<VersatileSelectorProps>;\n/**\n * Augments a {@link ValueEditorProps} object with async option (`values`) loading.\n *\n * @group Hooks\n */\nexport function useAsyncOptionList(\n props: ValueEditorProps,\n params?: UseAsyncOptionListParams<ValueEditorProps>\n): UseAsyncOptionList<ValueEditorProps>;\nexport function useAsyncOptionList<PropsType extends VersatileSelectorProps | ValueEditorProps>(\n props: PropsType,\n params: UseAsyncOptionListParams<PropsType> = {}\n) {\n const queryBuilderDispatch = useRQB_INTERNAL_QueryBuilderDispatch();\n\n const { cacheTTL, loadOptionList } = params;\n const {\n options: optionsProp,\n values: valuesProp,\n value,\n } = props as VersatileSelectorProps & ValueEditorProps;\n\n const ruleOrGroup = props.rule ?? (props as VersatileSelectorProps).ruleGroup;\n\n const cacheKey = useAsyncCacheKey(props, params);\n\n const cached = useRQB_INTERNAL_QueryBuilderSelector(s =>\n asyncOptionListsSlice.selectors.selectCacheByKey(s, cacheKey)\n );\n\n const cacheIsValid = !!cached && Date.now() <= cached.validUntil;\n\n const options = cached?.data ?? optionsProp ?? valuesProp;\n\n const isLoading =\n params.isLoading ||\n useRQB_INTERNAL_QueryBuilderSelector(s =>\n asyncOptionListsSlice.selectors.selectIsLoadingByKey(s, cacheKey)\n );\n\n const errors = useRQB_INTERNAL_QueryBuilderSelector(s =>\n asyncOptionListsSlice.selectors.selectErrorByKey(s, cacheKey)\n );\n\n const className = useMemo(\n () =>\n clsx(\n props.className,\n isLoading && [\n props.schema.suppressStandardClassnames || standardClassnames.loading,\n props.schema.classNames.loading,\n ]\n ),\n [\n props.schema.suppressStandardClassnames,\n isLoading,\n props.className,\n props.schema.classNames.loading,\n ]\n );\n\n useEffect(() => {\n if (\n !isLoading &&\n (!cacheIsValid || !cached) &&\n !errors &&\n typeof loadOptionList === 'function'\n ) {\n queryBuilderDispatch(\n getOptionListsAsync({ cacheKey, cacheTTL, value, ruleOrGroup, loadOptionList })\n );\n }\n }, [\n cacheKey,\n cacheIsValid,\n cacheTTL,\n isLoading,\n loadOptionList,\n cached,\n queryBuilderDispatch,\n ruleOrGroup,\n value,\n errors,\n ]);\n\n return {\n ...props,\n ...(optionsProp ? { options } : { values: options }),\n // Alternative to the previous line:\n // options,\n // values: options,\n className,\n isLoading,\n errors,\n };\n}\n"],"mappings":";;;;;;AAAA,MAAa,WAAW;CACtB,wCACE;CAEF,4CACE;CAEF,+BACE;CAEF,0BACE;CAEF,4BACE;CAEF,+BACE;CAEF,+BACE;CAEF,gCACE;CAEF,4BAA4B;AAC9B;ACbA,MAAa,eAWT,YAAY;CACd,MAAM;CACN,cAAA,CAAA;CACA,UAAU,EACR,gBAAgB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc;EACtD,MAAM,QAAQ;CAChB,EACF;CACA,WAAW,EACT,uBAAuB,OAAO,SAAS,MAAM,MAC/C;AACF,CAAC;;;AC/BD,MAAa,2BACX,MAAM,cAAuD,IAAI;ACqBnE,MAAa,gBAOT,YAAY;CACd,MAAM;CACN,cAAA;GApBC,SAAS,yCAAyC;GAClD,SAAS,6CAA6C;GACtD,SAAS,gCAAgC;GACzC,SAAS,2BAA2B;GACpC,SAAS,6BAA6B;GACtC,SAAS,gCAAgC;GACzC,SAAS,gCAAgC;GACzC,SAAS,iCAAiC;GAC1C,SAAS,6BAA6B;CAYvC;CACA,UAAU,EACR,UAAU,OAAO,EAAE,cAAc;EAC/B,IAAI,CAAC,MAAM,UAAU;GACnB,QAAQ,MAAM,OAAO;GACrB,MAAM,WAAW;EACnB;CACF,EACF;AACF,CAAC;;;ACnCD,MAAa,cAGR,cAAc,cAAc,aAAa,EAAE,qBAAuC;;;ACNvF,MAAM,8BACJ,QAC4B,mBAAmB,GAAG;AAIpD,MAAM,2BACJ,QAC8B,gBAAgB,GAAG;AAEnD,MA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