@pega/lists-core 9.0.0-build.2.9 → 9.0.0-build.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/src/core/StateResolver.d.ts.map +1 -1
- package/lib/src/core/StateResolver.js +2 -1
- package/lib/src/core/StateResolver.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts +1 -0
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js +3 -1
- package/lib/src/core/features/uIFeatures/beforeRender/aggregation.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +2 -1
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -1
- package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
- package/lib/types/ApiContext.types.d.ts +5 -2
- package/lib/types/ApiContext.types.d.ts.map +1 -1
- package/lib/types/ApiContext.types.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StateResolver.d.ts","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,KAAK,EAAc,UAAU,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAgB9F,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,sBAAsB,EAAuB,MAAM,2BAA2B,CAAC;AAC7F,OAAO,KAAK,EAAoB,UAAU,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGpF,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,KAAK,KAAK,CAAC;AAC9F,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AQ,EAAE,CAAC;YAClB,IAAI,CAAC,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxD,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,KAAK,EAAE,KAAY,EAAE,gBAA4B,EAAE,EAAE;QAC1D;;;;;WAKG;QACH,QAAQ,CAAC,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,IAAK,CAAC;QAC/C,MAAM,YAAY,CAChB,CAAC,KAAK,EAAE,gBAAgB,CAAC,EACzB;YACE,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;YAClB,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,MAAM;YACZ,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,YAAY;SACnB,CACF,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/* eslint-disable no-console */\nimport type { State } from '../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions, FetchDataResponse } from '../../types/ApiContext.types';\n\nimport { AFTER_FETCH, BEFORE_FETCH } from './pubSub/events';\nimport {\n clearProcessedActionsFromLatestActions,\n isSignificantPaginationOverlap,\n isEmpty,\n isFilterCriteriaChanged,\n isSameActionPresent as isSameActionPresentInQueue,\n isStaleAction,\n pickProperties,\n withMemoization\n} from './utils/util';\nimport { personalizationProps } from './reducers/personalizationReducer';\nimport ActionTypes from './actions/actionConstants';\nimport type { ActionType } from './actions/actionConstants';\nimport type RsInternal from './RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { MiddleWareFeatureProps, UIFeatures, Feature } from './features/featureFactory';\nimport type { ActionAsFunction, BaseAction, Action } from './actions/actions.types';\nimport type RsProps from './RsProps';\n\nexport type ReducerFunction = (state: State, action: Action, rsInternal: RsInternal) => State;\nexport type FetchDataHandler = (\n state: State,\n fetchDataOptions: ApiOptions\n) => Promise<FetchDataResponse>;\n/** It manages state of RsCore. */\nexport default class StateResolver {\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n\n /** Reducer function to reduce RS Core actions to its respective state. */\n #reducers: ReducerFunction;\n\n /** A reference to beforeRender UI features */\n #middlewares?: (featureProps: MiddleWareFeatureProps) => Promise<void | null>;\n\n /** Handler to fetch and manage data using {@link ApiContext.fetchData fetchData} api. */\n #fetchDataHandler: FetchDataHandler;\n\n /** previously dispatched stable state excluding instant state */\n #state: State;\n\n /** Intermittent state generated based upon the processed actions from the queue */\n #currentState: State;\n\n /** State generated via actions with instantRender. */\n #instantState: State;\n\n /** Queue holding actions that are dispatched. */\n #queuedActions: Action[];\n\n /** Holds the action that is executed. */\n #previousExecutedActionQueue: Action[];\n\n /** It contains registered api's provided by consumer of RsCore */\n #externalStoreRef: NonNullable<RsProps['externalStore']>;\n\n /** Keep track of latest action of a type of that action is marked to ignore stale actions */\n #latestActions = new Map<ActionType, Action>();\n\n /** Indicates if an external dispatch to RS core consumer should ber skipped. */\n #skipExternalDispatch = false;\n\n /** Abort controller to abort the fetchData requests in transit */\n #abortController?: AbortController;\n\n /** Indicates if fetchData is in progress. */\n fetchDataInProgress?: boolean;\n\n /**\n * Create an instance of {@link StateResolver} class.\n * @param reducers Reducer function to reduce state for a given action\n * @param fetchDataHandler Fetch Data handler function to fetch the data of RSCore when required.\n * @param rsInternal Reference to {@link RsInternal} object.\n */\n constructor(\n reducers: ReducerFunction,\n fetchDataHandler: FetchDataHandler,\n rsInternal: RsInternal\n ) {\n this.#reducers = reducers;\n this.#fetchDataHandler = fetchDataHandler;\n this.#rsInternal = rsInternal;\n\n this.#externalStoreRef = rsInternal.getRsProps().externalStore!;\n\n this.#state = {};\n this.#currentState = {};\n this.#instantState = {};\n this.#queuedActions = [];\n this.#previousExecutedActionQueue = [];\n }\n\n /**\n * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.\n */\n #executePostStateUpdateCallbacks = () => {\n const visibleColumnsArr = this.#rsInternal.getView().getVisibleColumns();\n const visibleColumns = visibleColumnsArr.map(col => col.field.id);\n const { apiContext } = this.#rsInternal.getRsProps();\n if (apiContext?.stateUpdateCallback) {\n apiContext.stateUpdateCallback({\n ...pickProperties(this.getState(), personalizationProps),\n visibleColumns\n });\n }\n if (apiContext?.setComponentState && this.getState().personalization?.active) {\n apiContext.setComponentState({\n ...pickProperties(this.getState(), personalizationProps),\n activePersonalization: this.getState().personalization?.active\n });\n }\n };\n\n /**\n * Dispatches given {@link action} to update the RsCore {@link State state} based on the provided action type. Multiple actions are queued in the action queue.\n * It will further triggers various {@link UIFeatures features} and fetches data using {@link FetchDataHandler} according to the state changes.\n *\n * @param action - The action to be dispatched.\n */\n dispatch = (action: BaseAction): void => {\n if ('takeLatestAction' in action && action.takeLatestAction) {\n if (isSameActionPresentInQueue(action, this.#latestActions)) return;\n this.#latestActions.set(action.type, action);\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#abortController?.abort();\n }\n }\n if (typeof action === 'function')\n return (action as ActionAsFunction)(\n this.dispatch,\n this.getState,\n this.#rsInternal.getView().meta\n );\n if (!this.#queuedActions.length && !this.fetchDataInProgress) {\n // Don't do deep copy as we don't do deep comparison for arrays and objects in memoization in feature files\n this.#currentState = { ...this.#state };\n }\n\n if ('instantRender' in action && action.instantRender) {\n if (this.#rsInternal.getRsProps().mode === 'debug') {\n console.warn(\n 'Doing instant render. This might introduce performance issues. Check if this is really needed.'\n );\n }\n this.#instantState = this.#reducers(this.#instantState, action, this.#rsInternal);\n this.#rsInternal.getView().setProp({\n state: { ...this.getState(), ...this.#instantState },\n isInstantRender: true\n });\n this.#externalStoreRef.dispatch({\n ...this.#instantState\n });\n this.#executePostStateUpdateCallbacks();\n\n return;\n }\n if ('skipActionQueue' in action && action.skipActionQueue) {\n this.#currentState = this.#reducers(this.#currentState, action, this.#rsInternal);\n return;\n }\n\n this.#queuedActions.push(action);\n // We run next batch only after completing first batch, Fetch call should get completed.\n if (this.#queuedActions.length === 1 && !this.#previousExecutedActionQueue.length) {\n this.#runQueuedActions();\n }\n };\n\n /**\n * Returns the current state that is built using the {@link dispatch dispatched} action.\n */\n getState = () => {\n return Object.keys(this.#currentState).length > 0 ? this.#currentState : this.#state;\n };\n\n /**\n * Returns a snapshot of the previous stable state before the action queue starts executing via {@link dispatch}.\n */\n getOriginalState = () => {\n return this.#state;\n };\n\n /**\n * Sets a function to execute a set of {@link Feature features} before triggering a render.\n * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}\n * @param middlewares - A function that executes a set of {@link Feature features} before rendering.\n * @returns\n */\n setMiddlewares = (\n middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>\n ) => {\n if (this.#middlewares) return;\n this.#middlewares = middlewares;\n };\n\n /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .\n * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.\n */\n #runQueuedActions = async () => {\n const queuedAction = this.#queuedActions[0];\n if (queuedAction) {\n if (isStaleAction(queuedAction, this.#latestActions)) {\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n return;\n }\n\n this.#previousExecutedActionQueue.push(queuedAction);\n this.#currentState = this.#reducers(this.#currentState, queuedAction, this.#rsInternal);\n await this.#middlewares!({\n rsInternal: this.#rsInternal,\n getState: this.getState,\n getOriginalState: this.getOriginalState,\n dispatch: this.dispatch,\n queuedActions: [queuedAction]\n });\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n } else if (this.#rsInternal.getRsStore().isMounted) {\n this.fetchDataInProgress = true;\n\n await this.#fetchData({\n ...this.#currentState,\n ...this.#instantState\n });\n\n // if the processed action and latest action has same payload, delete the latestAction as all the actions have been processed.\n clearProcessedActionsFromLatestActions(\n this.#latestActions,\n this.#previousExecutedActionQueue\n );\n\n // if data has been ignored, don't dispatch to view layer as the there is no change in rows\n if (!this.#skipExternalDispatch) {\n await this.#externalStoreRef.dispatch({\n ...this.#currentState\n });\n }\n this.#skipExternalDispatch = false;\n this.fetchDataInProgress = false;\n this.#previousExecutedActionQueue = [];\n\n // this happens in cases of dispatches like query info. In that case, the props have been set on view directly and the dispatch has already happened\n // This will prevent unnecessary renders in case of server side table\n\n // Avoid skipping FORCE_UPDATE action in case feature has triggered it and is relying on forceUpdatedFeatures slice of state.\n // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.\n // For eg.renderHeader and autosize feature set forceRenderOnNextRun and forceCalculateAutoWidth in this slice so that they will get executed after the existing rendering cycle is complete and the rows are rendered on DOM.\n // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.\n if (\n this.#queuedActions.length === 1 &&\n this.#queuedActions[0]?.type === ActionTypes.FORCE_UPDATE &&\n !Object.keys(this.#queuedActions[0].payload.forceUpdateFeatures).length\n ) {\n this.#queuedActions.shift();\n }\n if (this.#queuedActions.length) {\n this.#runQueuedActions();\n } else {\n this.#state = { ...this.#currentState };\n this.#currentState = {};\n this.#executePostStateUpdateCallbacks();\n }\n }\n };\n\n /**\n * Calls the {@link FetchDataHandler fetchDataHandler} and updates the latest data in the {@link View}\n * @param latestState - Current state.\n */\n #fetchData = async (latestState: State) => {\n this.#abortController = new AbortController();\n const signal = this.#abortController.signal;\n this.#rsInternal.getPubSubUtils().publish(BEFORE_FETCH);\n\n const derivedState = {\n ...latestState,\n groupFilters: this.#rsInternal.getRsStore().groupFilters\n };\n // TODO: No need to fetch data if all the groups are collapsed.\n const res = await this.#fetchDataHandler(derivedState, {\n signal,\n ...(this.#rsInternal.getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: this.#rsInternal.getRsStore().refreshToken\n })\n });\n if (res) {\n const { totalRecordCount, filteredRecordCount, data = [] } = res;\n\n if (!isEmpty(totalRecordCount) || !isEmpty(filteredRecordCount)) {\n this.#rsInternal.getView().setProp({\n resultsCount: totalRecordCount || filteredRecordCount,\n countGeneratedInternally: false,\n showCount: true\n });\n }\n\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#skipExternalDispatch = true;\n } else {\n this.#rsInternal.getView().setProp({\n data,\n isCountUpdateRequired:\n isFilterCriteriaChanged(this.#rsInternal.getRsStore().meta, this.#state, latestState) ||\n latestState.refresh !== this.#state.refresh\n });\n }\n }\n\n this.#rsInternal.getPubSubUtils().publish(AFTER_FETCH);\n this.#rsInternal.getView().setProp({ state: latestState, isInstantRender: false });\n };\n}\n\n/** Initializes handler for {@link ApiContext.fetchData fetchData} api. */\nexport function initializeFetchDataHandler(rsCoreInternal: RsInternal) {\n let response = {} as FetchDataResponse;\n const fetchWrapper = withMemoization(async ([state, fetchDataOptions]: [State, ApiOptions]) => {\n try {\n response = await rsCoreInternal\n .getRsProps()\n .apiContext.fetchData(state, rsCoreInternal.getRsStore().meta, fetchDataOptions);\n } catch (err: any) {\n if (!['AbortError', 'CanceledError'].includes(err.name)) {\n console.error('API call failed', err);\n }\n }\n });\n\n return async (state: State, fetchDataOptions: ApiOptions) => {\n /**\n * Returning default data from getView() in case the actual apiContext.getData() doesn't get called.\n *\n * BUG-811621: in case of bulk actions and inline edit, the updated rows come from separate apiContext APIs\n * and the memo of below function won't break, so, it will give stale data. Using getView().data as the default fallback for such cases.\n */\n response.data = rsCoreInternal.getView().data!;\n await fetchWrapper(\n [state, fetchDataOptions],\n [\n state.filterExpression,\n state.search,\n state.paginationOptions,\n state.sortingOrder,\n state.refresh,\n state.groups,\n state.hierarchicalGroup,\n state.groupFilters\n ]\n );\n return response;\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StateResolver.js","sourceRoot":"","sources":["../../../src/core/StateResolver.ts"],"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disable no-console */\nimport type { State } from '../../types/State.types';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions, FetchDataResponse } from '../../types/ApiContext.types';\n\nimport { AFTER_FETCH, BEFORE_FETCH } from './pubSub/events';\nimport {\n clearProcessedActionsFromLatestActions,\n isSignificantPaginationOverlap,\n isEmpty,\n isFilterCriteriaChanged,\n isSameActionPresent as isSameActionPresentInQueue,\n isStaleAction,\n pickProperties,\n withMemoization\n} from './utils/util';\nimport { personalizationProps } from './reducers/personalizationReducer';\nimport ActionTypes from './actions/actionConstants';\nimport type { ActionType } from './actions/actionConstants';\nimport type RsInternal from './RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { MiddleWareFeatureProps, UIFeatures, Feature } from './features/featureFactory';\nimport type { ActionAsFunction, BaseAction, Action } from './actions/actions.types';\nimport type RsProps from './RsProps';\n\nexport type ReducerFunction = (state: State, action: Action, rsInternal: RsInternal) => State;\nexport type FetchDataHandler = (\n state: State,\n fetchDataOptions: ApiOptions\n) => Promise<FetchDataResponse>;\n/** It manages state of RsCore. */\nexport default class StateResolver {\n /** A reference to {@link RsInternal} object. */\n #rsInternal: RsInternal;\n\n /** Reducer function to reduce RS Core actions to its respective state. */\n #reducers: ReducerFunction;\n\n /** A reference to beforeRender UI features */\n #middlewares?: (featureProps: MiddleWareFeatureProps) => Promise<void | null>;\n\n /** Handler to fetch and manage data using {@link ApiContext.fetchData fetchData} api. */\n #fetchDataHandler: FetchDataHandler;\n\n /** previously dispatched stable state excluding instant state */\n #state: State;\n\n /** Intermittent state generated based upon the processed actions from the queue */\n #currentState: State;\n\n /** State generated via actions with instantRender. */\n #instantState: State;\n\n /** Queue holding actions that are dispatched. */\n #queuedActions: Action[];\n\n /** Holds the action that is executed. */\n #previousExecutedActionQueue: Action[];\n\n /** It contains registered api's provided by consumer of RsCore */\n #externalStoreRef: NonNullable<RsProps['externalStore']>;\n\n /** Keep track of latest action of a type of that action is marked to ignore stale actions */\n #latestActions = new Map<ActionType, Action>();\n\n /** Indicates if an external dispatch to RS core consumer should ber skipped. */\n #skipExternalDispatch = false;\n\n /** Abort controller to abort the fetchData requests in transit */\n #abortController?: AbortController;\n\n /** Indicates if fetchData is in progress. */\n fetchDataInProgress?: boolean;\n\n /**\n * Create an instance of {@link StateResolver} class.\n * @param reducers Reducer function to reduce state for a given action\n * @param fetchDataHandler Fetch Data handler function to fetch the data of RSCore when required.\n * @param rsInternal Reference to {@link RsInternal} object.\n */\n constructor(\n reducers: ReducerFunction,\n fetchDataHandler: FetchDataHandler,\n rsInternal: RsInternal\n ) {\n this.#reducers = reducers;\n this.#fetchDataHandler = fetchDataHandler;\n this.#rsInternal = rsInternal;\n\n this.#externalStoreRef = rsInternal.getRsProps().externalStore!;\n\n this.#state = {};\n this.#currentState = {};\n this.#instantState = {};\n this.#queuedActions = [];\n this.#previousExecutedActionQueue = [];\n }\n\n /**\n * Executes {@link ApiContext.stateUpdateCallback stateUpdateCallback} and {@link ApiContext.setComponentState setComponentState} api with latest state.\n */\n #executePostStateUpdateCallbacks = () => {\n const visibleColumnsArr = this.#rsInternal.getView().getVisibleColumns();\n const visibleColumns = visibleColumnsArr.map(col => col.field.id);\n const { apiContext } = this.#rsInternal.getRsProps();\n if (apiContext?.stateUpdateCallback) {\n apiContext.stateUpdateCallback({\n ...pickProperties(this.getState(), personalizationProps),\n visibleColumns\n });\n }\n if (apiContext?.setComponentState && this.getState().personalization?.active) {\n apiContext.setComponentState({\n ...pickProperties(this.getState(), personalizationProps),\n activePersonalization: this.getState().personalization?.active\n });\n }\n };\n\n /**\n * Dispatches given {@link action} to update the RsCore {@link State state} based on the provided action type. Multiple actions are queued in the action queue.\n * It will further triggers various {@link UIFeatures features} and fetches data using {@link FetchDataHandler} according to the state changes.\n *\n * @param action - The action to be dispatched.\n */\n dispatch = (action: BaseAction): void => {\n if ('takeLatestAction' in action && action.takeLatestAction) {\n if (isSameActionPresentInQueue(action, this.#latestActions)) return;\n this.#latestActions.set(action.type, action);\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#abortController?.abort();\n }\n }\n if (typeof action === 'function')\n return (action as ActionAsFunction)(\n this.dispatch,\n this.getState,\n this.#rsInternal.getView().meta\n );\n if (!this.#queuedActions.length && !this.fetchDataInProgress) {\n // Don't do deep copy as we don't do deep comparison for arrays and objects in memoization in feature files\n this.#currentState = { ...this.#state };\n }\n\n if ('instantRender' in action && action.instantRender) {\n if (this.#rsInternal.getRsProps().mode === 'debug') {\n console.warn(\n 'Doing instant render. This might introduce performance issues. Check if this is really needed.'\n );\n }\n this.#instantState = this.#reducers(this.#instantState, action, this.#rsInternal);\n this.#rsInternal.getView().setProp({\n state: { ...this.getState(), ...this.#instantState },\n isInstantRender: true\n });\n this.#externalStoreRef.dispatch({\n ...this.#instantState\n });\n this.#executePostStateUpdateCallbacks();\n\n return;\n }\n if ('skipActionQueue' in action && action.skipActionQueue) {\n this.#currentState = this.#reducers(this.#currentState, action, this.#rsInternal);\n return;\n }\n\n this.#queuedActions.push(action);\n // We run next batch only after completing first batch, Fetch call should get completed.\n if (this.#queuedActions.length === 1 && !this.#previousExecutedActionQueue.length) {\n this.#runQueuedActions();\n }\n };\n\n /**\n * Returns the current state that is built using the {@link dispatch dispatched} action.\n */\n getState = () => {\n return Object.keys(this.#currentState).length > 0 ? this.#currentState : this.#state;\n };\n\n /**\n * Returns a snapshot of the previous stable state before the action queue starts executing via {@link dispatch}.\n */\n getOriginalState = () => {\n return this.#state;\n };\n\n /**\n * Sets a function to execute a set of {@link Feature features} before triggering a render.\n * The provided function will be called with the {@link MiddleWareFeatureProps featureProps}\n * @param middlewares - A function that executes a set of {@link Feature features} before rendering.\n * @returns\n */\n setMiddlewares = (\n middlewares: (featureProps: MiddleWareFeatureProps) => Promise<void | null>\n ) => {\n if (this.#middlewares) return;\n this.#middlewares = middlewares;\n };\n\n /** This will reduce the RsCore {@link State state} for a {@link StateResolver.dispatch dispatched} action .\n * Additionally it will also run middlewares, fetches latest data using {@link FetchDataHandler} and executes post state update callback with latest reduced state.\n */\n #runQueuedActions = async () => {\n const queuedAction = this.#queuedActions[0];\n if (queuedAction) {\n if (isStaleAction(queuedAction, this.#latestActions)) {\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n return;\n }\n\n this.#previousExecutedActionQueue.push(queuedAction);\n this.#currentState = this.#reducers(this.#currentState, queuedAction, this.#rsInternal);\n await this.#middlewares!({\n rsInternal: this.#rsInternal,\n getState: this.getState,\n getOriginalState: this.getOriginalState,\n dispatch: this.dispatch,\n queuedActions: [queuedAction]\n });\n this.#queuedActions.shift();\n await this.#runQueuedActions();\n } else if (this.#rsInternal.getRsStore().isMounted) {\n this.fetchDataInProgress = true;\n\n await this.#fetchData({\n ...this.#currentState,\n ...this.#instantState\n });\n\n // if the processed action and latest action has same payload, delete the latestAction as all the actions have been processed.\n clearProcessedActionsFromLatestActions(\n this.#latestActions,\n this.#previousExecutedActionQueue\n );\n\n // if data has been ignored, don't dispatch to view layer as the there is no change in rows\n if (!this.#skipExternalDispatch) {\n await this.#externalStoreRef.dispatch({\n ...this.#currentState\n });\n }\n this.#skipExternalDispatch = false;\n this.fetchDataInProgress = false;\n this.#previousExecutedActionQueue = [];\n\n // this happens in cases of dispatches like query info. In that case, the props have been set on view directly and the dispatch has already happened\n // This will prevent unnecessary renders in case of server side table\n\n // Avoid skipping FORCE_UPDATE action in case feature has triggered it and is relying on forceUpdatedFeatures slice of state.\n // forceUpdateFeatures slice is generally used by features when they are not able to perform their task if the rendering cycle is not complete.\n // For eg.renderHeader and autosize feature set forceRenderOnNextRun and forceCalculateAutoWidth in this slice so that they will get executed after the existing rendering cycle is complete and the rows are rendered on DOM.\n // If we skip these types of FORCE_UPDATE action then the corresponding features execution will also be skipped.\n if (\n this.#queuedActions.length === 1 &&\n this.#queuedActions[0]?.type === ActionTypes.FORCE_UPDATE &&\n !Object.keys(this.#queuedActions[0].payload.forceUpdateFeatures).length\n ) {\n this.#queuedActions.shift();\n }\n if (this.#queuedActions.length) {\n this.#runQueuedActions();\n } else {\n this.#state = { ...this.#currentState };\n this.#currentState = {};\n this.#executePostStateUpdateCallbacks();\n }\n }\n };\n\n /**\n * Calls the {@link FetchDataHandler fetchDataHandler} and updates the latest data in the {@link View}\n * @param latestState - Current state.\n */\n #fetchData = async (latestState: State) => {\n this.#abortController = new AbortController();\n const signal = this.#abortController.signal;\n this.#rsInternal.getPubSubUtils().publish(BEFORE_FETCH);\n\n const derivedState = {\n ...latestState,\n groupFilters: this.#rsInternal.getRsStore().groupFilters\n };\n // TODO: No need to fetch data if all the groups are collapsed.\n const res = await this.#fetchDataHandler(derivedState, {\n signal,\n ...(this.#rsInternal.getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: this.#rsInternal.getRsStore().refreshToken\n })\n });\n if (res) {\n const { totalRecordCount, filteredRecordCount, data = [] } = res;\n\n if (!isEmpty(totalRecordCount) || !isEmpty(filteredRecordCount)) {\n this.#rsInternal.getView().setProp({\n resultsCount: totalRecordCount || filteredRecordCount,\n countGeneratedInternally: false,\n showCount: true\n });\n }\n\n if (isSignificantPaginationOverlap(this.#latestActions, this.#previousExecutedActionQueue)) {\n this.#skipExternalDispatch = true;\n } else {\n this.#rsInternal.getView().setProp({\n data,\n isCountUpdateRequired:\n isFilterCriteriaChanged(this.#rsInternal.getRsStore().meta, this.#state, latestState) ||\n latestState.refresh !== this.#state.refresh\n });\n }\n }\n\n this.#rsInternal.getPubSubUtils().publish(AFTER_FETCH);\n this.#rsInternal.getView().setProp({ state: latestState, isInstantRender: false });\n };\n}\n\n/** Initializes handler for {@link ApiContext.fetchData fetchData} api. */\nexport function initializeFetchDataHandler(rsCoreInternal: RsInternal) {\n let response = {} as FetchDataResponse;\n const fetchWrapper = withMemoization(async ([state, fetchDataOptions]: [State, ApiOptions]) => {\n try {\n response = await rsCoreInternal\n .getRsProps()\n .apiContext.fetchData(state, rsCoreInternal.getRsStore().meta, fetchDataOptions);\n } catch (err: any) {\n if (!['AbortError', 'CanceledError'].includes(err.name)) {\n console.error('API call failed', err);\n }\n }\n });\n\n return async (state: State, fetchDataOptions: ApiOptions) => {\n /**\n * Returning default data from getView() in case the actual apiContext.getData() doesn't get called.\n *\n * BUG-811621: in case of bulk actions and inline edit, the updated rows come from separate apiContext APIs\n * and the memo of below function won't break, so, it will give stale data. Using getView().data as the default fallback for such cases.\n */\n response.data = rsCoreInternal.getView().data!;\n await fetchWrapper(\n [state, fetchDataOptions],\n [\n state.filterExpression,\n state.search,\n state.paginationOptions,\n state.sortingOrder,\n state.refresh,\n state.groups,\n state.hierarchicalGroup,\n state.groupFilters,\n state.hiddenColumns\n ]\n );\n return response;\n };\n}\n"]}
|
|
@@ -5,6 +5,7 @@ import type { BeforeRenderFeatureProps } from '../../featureFactory';
|
|
|
5
5
|
* - {@link State.filterExpression}
|
|
6
6
|
* - `query` in {@link State.search}
|
|
7
7
|
* - `active` in {@link State.personalization}
|
|
8
|
+
* - {@link state.hiddenColumns}
|
|
8
9
|
*/
|
|
9
10
|
declare const _default: () => (featureProps: BeforeRenderFeatureProps) => Promise<void>;
|
|
10
11
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregation.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/aggregation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAwCrE
|
|
1
|
+
{"version":3,"file":"aggregation.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/aggregation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAwCrE;;;;;;;GAOG;+BAI6B,cAAc,wBAAwB;AAHtE,wBAiBE"}
|
|
@@ -36,6 +36,7 @@ const getAggregatedValues = async ([{ getView, getRsProps, getState, getRsStore
|
|
|
36
36
|
* - {@link State.filterExpression}
|
|
37
37
|
* - `query` in {@link State.search}
|
|
38
38
|
* - `active` in {@link State.personalization}
|
|
39
|
+
* - {@link state.hiddenColumns}
|
|
39
40
|
*/
|
|
40
41
|
export default () => {
|
|
41
42
|
const memoizedGetAggregatedValues = withMemoization(getAggregatedValues);
|
|
@@ -46,7 +47,8 @@ export default () => {
|
|
|
46
47
|
state.filterExpression,
|
|
47
48
|
state.search?.query,
|
|
48
49
|
state?.personalization?.active,
|
|
49
|
-
state.refresh
|
|
50
|
+
state.refresh,
|
|
51
|
+
state.hiddenColumns
|
|
50
52
|
]);
|
|
51
53
|
};
|
|
52
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregation.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/aggregation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKhE,qDAAqD;AAErD;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAEhF,EAAE,EAAE;IACH,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,gBAAgB,GACpB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YACtE,CAAC,CAAC,MAAM,UAAU,CAAC,qBAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE;gBACvE,GAAG,CAAC,UAAU,EAAE,CAAC,iBAAiB,IAAI;oBACpC,eAAe,EAAE,IAAI;oBACrB,oBAAoB,EAAE,UAAU,EAAE,CAAC,YAAY;iBAChD,CAAC;aACH,CAAC;YACJ,CAAC,CAAC,EAAE,CAAC;QACT,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE;YAClC,MAAM,WAAW,GACf,KAAK,CAAC,eAAe,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC3F,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC;gBACtB,UAAU,EAAE,CAAC,CAAC,WAAW;gBACzB,cAAc,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;gBACjD,eAAe,EAAE,WAAW,EAAE,IAAI;aACnC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,sCAAsC;QACtC,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IACxC,CAAC;AACH,CAAC,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"aggregation.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/aggregation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKhE,qDAAqD;AAErD;;;GAGG;AACH,MAAM,mBAAmB,GAAG,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAEhF,EAAE,EAAE;IACH,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAAC;IACpC,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,gBAAgB,GACpB,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC;YACtE,CAAC,CAAC,MAAM,UAAU,CAAC,qBAAs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;YAC9B,KAAK,CAAC,OAAO;YACb,KAAK,CAAC,aAAa;SACpB,CACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { deepCopy, withMemoization } from '../../../utils/util';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { State } from '../../../../../types/State.types';\nimport type { ApiContext } from '../../../../../types/ApiContext.types';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\n/**\n * Calculates the aggregate values for columns by calling {@link ApiContext.fetchAggregatedValues fetchAggregatedValues} api if {@link State.aggregationInfo aggregationInfo} is present.\n * @param param0 - {@link BeforeRenderFeatureProps}\n */\nconst getAggregatedValues = async ([{ getView, getRsProps, getState, getRsStore }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const { apiContext } = getRsProps();\n const state = getState();\n try {\n const aggregatedValues =\n Array.isArray(state.aggregationInfo) && state.aggregationInfo.length > 0\n ? await apiContext.fetchAggregatedValues!(deepCopy(state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })\n : {};\n getView().columns?.forEach(column => {\n const aggregation =\n state.aggregationInfo && state.aggregationInfo.find(t => t.columnId === column.field.id);\n column = column.setProp({\n aggregated: !!aggregation,\n aggregateValue: aggregatedValues[column.field.id],\n aggregationType: aggregation?.type\n });\n });\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('API call failed', err);\n }\n};\n\n/**\n * Calculates the aggregate values for columns when any of the following state properties are changed:\n * - {@link State.aggregationInfo}\n * - {@link State.filterExpression}\n * - `query` in {@link State.search}\n * - `active` in {@link State.personalization}\n * - {@link state.hiddenColumns}\n */\nexport default () => {\n const memoizedGetAggregatedValues = withMemoization(getAggregatedValues);\n\n return async function execute(featureProps: BeforeRenderFeatureProps) {\n const state = featureProps.getState();\n await memoizedGetAggregatedValues(\n [featureProps],\n [\n state.aggregationInfo,\n state.filterExpression,\n state.search?.query,\n state?.personalization?.active,\n state.refresh,\n state.hiddenColumns\n ]\n );\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/grouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAa1D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAOrE,OAAO,KAAK,EACV,WAAW,EACX,uBAAuB,EAGxB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,SAAS,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,EAAE,CAAC;IAChD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,GAC5D,kBAAkB,GAAG;IACnB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B,CAAC;AAEJ,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,uBAAuB,EAAE,UAAU,CAAC,GACpF,kBAAkB,GAAG;IACnB,QAAQ,CAAC,EAAE,wBAAwB,EAAE,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,IAAI,GAAG,MAAM,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AC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAChD,CAAC;AAoiBJ;;;;;;;;GAQG;yBACa,YAAY,UAAU,qBAYC,wBAAwB;AAZ/D,wBAoEE"}
|
|
@@ -425,7 +425,8 @@ export default (rsInternal) => {
|
|
|
425
425
|
state.search?.query,
|
|
426
426
|
state.personalization?.active,
|
|
427
427
|
state.refresh,
|
|
428
|
-
state.aggregationInfo
|
|
428
|
+
state.aggregationInfo,
|
|
429
|
+
state.hiddenColumns
|
|
429
430
|
]);
|
|
430
431
|
memoizedAutoExpandGroups([featureProps], [state.personalization?.active]);
|
|
431
432
|
await memorizeOnHierarchicalGroupChange([featureProps], [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grouping.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/grouping.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAqChE,SAAS,cAAc,CACrB,WAAoC,EACpC,IAA6C,EAC7C,YAAiC;IAEjC,oDAAoD;IACpD,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC,IAAI,CAAC,OAAQ,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,SAAU,CAAC,CAAC,CAAC;IACjG,MAAM,gBAAgB,GAAG,KAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CA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AC,eAAe;SACtB,CACF,CAAC;QAEF,wBAAwB,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC;QAE1E,MAAM,iCAAiC,CACrC,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM,EAAE,KAAK;YACnB,KAAK,CAAC,eAAe;YACrB,KAAK,CAAC,eAAe,EAAE,MAAM;SAC9B,CACF,CAAC;QACF,+CAA+C;QAC/C,+DAA+D;QAC/D,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,2HAA2H;YAC3H,sCAAsC;YACtC,kEAAkE;YAClE,0EAA0E;YAC1E,KAAK;YACL,0BAA0B,CACxB,CAAC,YAAY,CAAC,EACd;gBACE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtE,UAAU,EAAE,CAAC,YAAY;gBACzB,KAAK,CAAC,WAAW;gBACjB,KAAK,CAAC,iBAAiB;aACxB,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,+EAA+E;IAC/E,8DAA8D;IAC9D,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACvC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport {\n getGroupKey,\n getGroupFromKey,\n withMemoization,\n compareArray,\n dateFunctionLabels,\n deepCopy,\n isEmpty\n} from '../../../utils/util';\nimport { actionGroupingExpandCollapseAll } from '../../../actions/actions';\nimport { AFTER_FETCH } from '../../../pubSub/events';\nimport type RsInternal from '../../../RsInternal';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport type { MemoizedFunction } from '../../../utils/util.types';\nimport type { Group, GroupFilter, GroupToggle, State } from '../../../../../types/State.types';\nimport type { HierarchicalInfo } from '../../../../../types/Meta.types';\nimport GroupGenerator from '../../../generators/GroupGenerator';\nimport type View from '../../../generators/ViewGenerator';\nimport type RsStore from '../../../RsStore';\nimport type {\n GroupedInfo,\n HierarchicalGroupedInfo,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ApiContext\n} from '../../../../../types/ApiContext.types';\n\nexport interface CommonGroupingInfo {\n /** Id of the field on which grouping is applied. */\n groupBy: string;\n /** Current group level, starts with 0 for 1st level of grouping. */\n level: number;\n /** Path of the grouped column value. */\n hierarchy: (string | number | boolean | Date)[];\n visibleRow?: boolean;\n showHierarchicalFooter?: boolean;\n groupFrom?: number;\n groupTo?: number;\n isHierarchical?: boolean;\n}\n\nexport type GroupingInfo = OmitStrict<GroupedInfo, 'children'> &\n CommonGroupingInfo & {\n children?: GroupingInfo[];\n };\n\nexport type HierarchicalGroupingInfo = OmitStrict<HierarchicalGroupedInfo, 'children'> &\n CommonGroupingInfo & {\n children?: HierarchicalGroupingInfo[];\n parentId?: string;\n targetId?: string;\n name?: null | string | number | boolean | Date;\n };\n\nfunction isNodeExpanded(\n groupToggle: GroupToggle | undefined,\n node: GroupingInfo | HierarchicalGroupingInfo,\n defaultState: boolean | undefined\n): boolean {\n /** Groups with 0 count should not be expandable. */\n if (node.count === 0) {\n return false;\n }\n\n const index = groupToggle?.[node.groupBy!]?.findIndex(gct => compareArray(gct, node.hierarchy!));\n const childToggleState = index! >= 0 ? !defaultState : !!defaultState;\n return childToggleState === true;\n}\n\nconst getLabel = (view: View, groupBy: string, getState: BeforeRenderFeatureProps['getState']) => {\n const { columnId, dateFunction } = getGroupFromKey(groupBy, getState().groups)!;\n let { label } = view.columns!.find(column => column.field.id.toString() === columnId.toString())!;\n if (dateFunction) {\n // @ts-expect-error dateFunction cannot be used to index dateFunctionLabels. Check this.\n label += ` (${dateFunctionLabels[dateFunction]})`;\n }\n return label;\n};\n\n// This function checks if hierarchy exist or not.\n// which will decide whether start and end Index would be there on leaf node or on hierarchical node.\nconst doesExistInViewInfo = (\n viewInfo: GroupFilter[],\n hierarchy: (string | number | boolean | Date)[] = [],\n isHierarchical = false\n) => {\n return viewInfo.some(v => {\n const filters = Object.values(v.filters);\n\n if (isHierarchical) {\n return filters.every(value => value === [...hierarchy].pop());\n }\n\n if (filters.length === hierarchy.length) {\n const tempHierarchy = [...hierarchy];\n // eslint-disable-next-line @typescript-eslint/require-array-sort-compare\n tempHierarchy.sort();\n // eslint-disable-next-line @typescript-eslint/require-array-sort-compare\n return filters.sort().every((value, index) => value === tempHierarchy[index]);\n }\n return false;\n });\n};\n\nconst prepareGroupHeaders = (\n props: [\n groupingInfo: RsStore['groupingInfo'],\n groupFilters: RsStore['groupFilters'],\n rsInternal: RsInternal,\n groupToggle?: State['groupToggle'],\n allGroupsExpanded?: boolean\n ]\n) => {\n const [groupingInfo = [], viewInfo = [], rsInternal, groupToggle = {}, allGroupsExpanded] = props;\n\n // If group and viewInfo are empty, prerape group header for top level leaf node.\n // This is for easing on UI , one contract whether grouping is in place/not.\n // TODO: support for enabling feature on view.\n const view = rsInternal.getView();\n const { getState } = rsInternal.getRsStateResolver();\n if (groupingInfo.length === 0) {\n // construct view header object.\n\n const viewHeader = new GroupGenerator(\n {\n isVisible: false,\n isLeafNode: true,\n isExpanded: true,\n name: '',\n groupBy: '',\n level: 0,\n label: '',\n hierarchy: [],\n count: view.rows!.length\n },\n rsInternal\n );\n viewHeader.startIndex = 0;\n viewHeader.endIndex = view.rows ? view.rows.length : 0;\n view.setProp('groupHeaders', [viewHeader]);\n return;\n }\n // Creating flat objects from view group info using DFT.\n const result = [];\n let counter = 0;\n\n const stack = groupingInfo.map(v => ({ ...v }));\n let leafNodeCountInView = 0;\n let lastDataIndex = 0;\n while (stack.length) {\n const child = stack.shift();\n if (child) {\n const isExpanded = isNodeExpanded(groupToggle, child, allGroupsExpanded);\n const isSubGroupPresent = child.children && child.children.length;\n const label = child.isHierarchical ? '' : getLabel(view, child.groupBy!, getState);\n // construct view header object.\n const viewHeader = new GroupGenerator(\n {\n isVisible: !!child.visibleRow,\n isLeafNode: !isSubGroupPresent,\n isExpanded,\n name: child.name!,\n groupBy: child.groupBy,\n level: child.level,\n label: label!,\n hierarchy: child.hierarchy,\n count: child.count,\n aggregation: child.agg,\n showHierarchicalFooter: child.showHierarchicalFooter,\n isHierarchical: child.isHierarchical,\n info: (child as HierarchicalGroupingInfo).info,\n data: (child as GroupingInfo).data\n },\n rsInternal\n );\n // If header node is a leaf node then , add start index and endIndex to resolve data.\n if (\n (viewHeader.isLeafNode || viewHeader.isHierarchical) &&\n viewHeader.isExpanded &&\n doesExistInViewInfo(viewInfo, viewHeader.hierarchy, viewHeader.isHierarchical)\n ) {\n const { groupFrom, groupTo } = viewInfo[leafNodeCountInView] || {};\n if (groupFrom >= 0 && groupTo >= 0) {\n viewHeader.startIndex = lastDataIndex;\n viewHeader.endIndex = viewHeader.startIndex + groupTo - groupFrom;\n lastDataIndex = viewHeader.endIndex;\n leafNodeCountInView += 1;\n }\n }\n // BUG-775861 - Adding index to visible groupHeaders so that this can be used to set the z-index for groupHeaders\n if (viewHeader.isVisible) {\n viewHeader.index = counter;\n counter += 1;\n }\n result.push(viewHeader);\n if (isExpanded && isSubGroupPresent) {\n stack.unshift(...child.children!);\n }\n }\n }\n view.setProp('groupHeaders', result);\n};\n\nfunction includeGroup(\n group: GroupingInfo | HierarchicalGroupingInfo,\n groupFrom: number,\n groupTo: number,\n parentGroups: Record<string, any>,\n groupFilters: GroupFilter[]\n) {\n group.groupFrom = groupFrom;\n group.groupTo = groupTo;\n groupFilters.push({ groupFrom, groupTo, filters: parentGroups });\n}\n\nfunction getRecordsCount(\n group: NonNullable<RsStore['groupingInfo']>,\n count: number,\n includedRowCount: number,\n parentGroup: Record<string, any>,\n from: number,\n to: number,\n groupFilters: GroupFilter[],\n groupToggle: GroupToggle | undefined,\n allGroupsExpanded: boolean | undefined,\n state: State,\n getView: BeforeRenderFeatureProps['getView']\n): [count: number, includedRowCount: number] {\n const { aggregationInfo } = state;\n\n for (let i = 0; i < group.length; i += 1) {\n const parentGroups = { ...parentGroup };\n if ((group[i] as HierarchicalGroupingInfo).isHierarchical) {\n const currentGroup = group[i] as HierarchicalGroupingInfo;\n parentGroups[currentGroup.parentId!] = currentGroup.info![currentGroup.targetId!];\n } else {\n const currentGroup = group![i] as GroupingInfo;\n parentGroups[currentGroup.groupBy!] = currentGroup.name;\n }\n count += 1;\n // group has subgroups and group is expanded\n const isExpanded = isNodeExpanded(groupToggle, group[i], allGroupsExpanded);\n let includeThisGroup = false;\n if (count > from && count - 1 <= to) {\n includeThisGroup = true;\n includedRowCount += 1;\n }\n group[i].visibleRow = includeThisGroup;\n // Footer should be shown only if node expands.\n // groupToggle will effect footer visibility so reset footer flag.\n group[i].showHierarchicalFooter = false;\n\n if (group[i].children && isExpanded) {\n [count, includedRowCount] = getRecordsCount(\n group[i].children!,\n count,\n includedRowCount,\n parentGroups,\n from,\n to,\n groupFilters,\n groupToggle,\n allGroupsExpanded,\n state,\n getView\n );\n group[i].visibleRow =\n group[i].visibleRow ||\n !!group[i].children!.find(\n g => g.visibleRow && ((g as HierarchicalGroupingInfo).isHierarchical || !g.children)\n );\n } else if (!group[i].children && isExpanded) {\n // group doesn't have subgroups and group is expanded\n const innerCount = count + group[i].count;\n if (count <= to) {\n let groupFrom = 0;\n let groupTo = 0;\n if (innerCount >= from) {\n groupFrom = Math.max(from - count, 0);\n if (innerCount <= to + 1) {\n groupTo = group[i].count;\n } else {\n groupTo = groupFrom + (to + 1 - from - includedRowCount);\n }\n group[i].visibleRow = true;\n let updatedGroupFrom = groupFrom;\n // Sticky group header logic\n if (!includeThisGroup && groupTo > groupFrom + 2) {\n if (group[i].level! >= 1) {\n updatedGroupFrom = groupFrom + 2;\n } else {\n updatedGroupFrom = groupFrom + 1;\n }\n }\n includeGroup(group[i], updatedGroupFrom, groupTo, parentGroups, groupFilters);\n }\n includedRowCount += groupTo - groupFrom;\n }\n count = innerCount;\n }\n\n if (\n (group[i] as HierarchicalGroupingInfo).isHierarchical &&\n aggregationInfo &&\n aggregationInfo.length > 0 &&\n isExpanded\n ) {\n count += 1;\n group[i].showHierarchicalFooter = true;\n\n if (group[i].visibleRow && includedRowCount <= to) {\n includedRowCount += 1;\n }\n }\n }\n return [count, includedRowCount];\n}\n\nconst constructGroupingPagination = (\n groupingInfo: NonNullable<RsStore['groupingInfo']>,\n groupToggle: GroupToggle | undefined,\n paginationOptions: NonNullable<State['paginationOptions']>[keyof NonNullable<\n State['paginationOptions']\n >],\n allGroupsExpanded: boolean | undefined,\n state: State,\n getView: BeforeRenderFeatureProps['getView']\n) => {\n const groupFilters = [] as GroupFilter[];\n getRecordsCount(\n groupingInfo,\n 0,\n 0,\n {},\n paginationOptions.startIndex,\n paginationOptions.endIndex,\n groupFilters,\n groupToggle,\n allGroupsExpanded,\n state,\n getView\n );\n return groupFilters;\n};\n\n// This is basically used to update count on non leaf node.\n// which is sum of count of leaf node children in their hierarchy.\nfunction updateCountOnNonLeafNode(groupingInfo: GroupedInfo[]) {\n const updateCount = (child: GroupedInfo) => {\n if (child.count !== undefined) return child.count;\n child.count = child.children!.reduce((acc, c) => {\n acc += updateCount(c)!;\n return acc;\n }, 0);\n };\n groupingInfo.forEach(g => updateCount(g));\n}\n\nfunction updateGroupInfo(groupingInfo: GroupedInfo[], groups: Group[]): GroupingInfo[] {\n // iterate groupingInfo using BFS and update basic information.\n const queue = [...groupingInfo] as GroupingInfo[];\n while (queue.length) {\n const child = queue.pop();\n if (child) {\n if (!child.hierarchy) child.hierarchy = [child.name!];\n child.level = child.level || 0;\n const matchingGroup = groups.find(g => g.level === child.level);\n child.groupBy = getGroupKey(matchingGroup!);\n\n if (child.children) {\n // update level before pushing children to queue.\n child.children.forEach(c => {\n c.level = child.level + 1;\n c.hierarchy = [...child.hierarchy];\n c.hierarchy.push(c.name!);\n });\n queue.push(...child.children);\n }\n }\n }\n return groupingInfo as GroupingInfo[];\n}\n\nfunction updateCountFromGroupingInfo(\n getView: BeforeRenderFeatureProps['getView'],\n getRsStore: BeforeRenderFeatureProps['getRsStore']\n) {\n if (getView().countGeneratedInternally || isEmpty(getView().resultsCount)) {\n const countFromGroupingInfo = getRsStore().groupingInfo?.reduce(\n (acc, group) => (group.count ? acc + group.count : acc),\n 0\n );\n\n const countPayload = { count: countFromGroupingInfo, _countGeneratedInternally: true };\n getView().type.setRecordCount(countPayload);\n }\n}\n\nasync function onGroupsChange([{ getRsProps, getRsStore, getView, getState }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n const rsStore = getRsStore();\n const rsProps = getRsProps();\n const state = getState();\n const { groups } = state;\n\n if (groups?.length! > 0 && getView().meta.grouping) {\n try {\n const groupingInfo =\n (await rsProps.apiContext.fetchGroupedInfo?.(deepCopy(state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })) || [];\n // Here update group info with basic properties like level, group by, expand state etc.\n // to make calculation easy.\n // TODO: FIXME - Check if count on non leaf node is required\n updateCountOnNonLeafNode(groupingInfo);\n rsStore.groupingInfo = updateGroupInfo(groupingInfo, groups!);\n\n // FIXME: once infinite virtualizer supports the grouping, we need not compute the count from grouping\n // Prepare the count from the groups count until the actual count returns\n updateCountFromGroupingInfo(getView, getRsStore);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('API call failed', err);\n }\n } else rsStore.groupingInfo = [];\n\n getView().columns!.forEach(column => {\n const grouped = groups?.findIndex(group => group.columnId === column.field.id)! >= 0;\n column = column.setProp('grouped', grouped);\n });\n}\n\nfunction autoExpandGroups([{ dispatch, getState }]: [featureProps: BeforeRenderFeatureProps]) {\n const { allGroupsExpanded = true } = getState();\n dispatch(actionGroupingExpandCollapseAll(allGroupsExpanded));\n}\n\nfunction updateHierarchicalGroupInfo(\n groupingInfo: HierarchicalGroupedInfo[],\n hierarchicalGroup: HierarchicalInfo\n) {\n const queue = [...groupingInfo] as HierarchicalGroupingInfo[];\n\n while (queue.length) {\n const child = queue.pop();\n const node = child!.info;\n\n if (child) {\n child.level = child.level || 0;\n child.isHierarchical = true;\n child.parentId = hierarchicalGroup.parentId;\n child.targetId = hierarchicalGroup.targetId;\n child.groupBy = (hierarchicalGroup.sortById || hierarchicalGroup.targetId)!;\n\n if (node) {\n child.name = node[(hierarchicalGroup.sortById || hierarchicalGroup.targetId)!] as string;\n child.hierarchy = [node[hierarchicalGroup.targetId!] as string];\n }\n\n if (child.children) {\n // update level before pushing children to queue.\n child.children.forEach(c => {\n c.level = child.level! + 1;\n });\n queue.push(...child.children);\n }\n }\n }\n}\n\nasync function onHierarchicalGroupChange([{ getState, getRsProps, getRsStore, getView }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n const { hierarchicalGroup } = getState();\n const rsProps = getRsProps();\n const rsStore = getRsStore();\n if (hierarchicalGroup && hierarchicalGroup.parentId) {\n try {\n const groupingInfo =\n (await rsProps.apiContext.fetchHierarchicalGroupedInfo?.(\n deepCopy(getState()),\n getView().meta,\n {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n }\n )) || [];\n\n getView().setProp('hierarchicalGroupEnabled', true);\n\n updateHierarchicalGroupInfo(groupingInfo, hierarchicalGroup);\n rsStore.groupingInfo = groupingInfo as HierarchicalGroupingInfo[];\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('API call failed', err);\n }\n } else {\n getView().setProp('hierarchicalGroupEnabled', false);\n }\n}\n\nconst getTotalItemCount = (\n getView: BeforeRenderFeatureProps['getView'],\n state: State,\n groupingInfo: NonNullable<RsStore['groupingInfo']>\n) => {\n // Calculate total group count and update instance.\n // and datanode count based on group expand state.\n let totalItemCount = 0;\n const stack = [...groupingInfo];\n const { groupToggle, allGroupsExpanded } = state;\n\n while (stack.length) {\n const child = stack.shift();\n // We are considering header count whether if it is of hierarchical node or\n // a normal group node and it has data associated with it in its hierarchy.\n if (child) {\n totalItemCount += 1;\n const isSubGroupPresent = child.children && child.children.length;\n const isExpanded = isNodeExpanded(groupToggle, child, allGroupsExpanded);\n if (isExpanded && isSubGroupPresent) {\n stack.unshift(...child.children!);\n } else if (isExpanded && !isSubGroupPresent) {\n totalItemCount += child.count;\n }\n\n if (child.showHierarchicalFooter) {\n totalItemCount += 1;\n }\n }\n }\n return totalItemCount;\n};\n\nconst updateGroupFilters = ([{ getState, getRsStore, getView }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const { paginationOptions, groupToggle, allGroupsExpanded } = getState();\n const rsStore = getRsStore();\n const { groupingInfo } = rsStore;\n // group info is expected to be [] when there are no groups.\n if (groupingInfo) {\n if (!groupingInfo.length && rsStore.groupFilters && !rsStore.groupFilters.length) return;\n rsStore.groupFilters = constructGroupingPagination(\n groupingInfo,\n groupToggle,\n paginationOptions!.rootVirtualiser,\n allGroupsExpanded,\n getState(),\n getView\n );\n }\n};\n\nfunction postFetch(\n rsInternal: RsInternal,\n memoizedPrepareGroupHeaders: MemoizedFunction<\n [\n groupingInfo: RsStore['groupingInfo'],\n groupFilters: RsStore['groupFilters'],\n rsInternal: RsInternal,\n groupToggle?: State['groupToggle'],\n allGroupsExpanded?: State['allGroupsExpanded']\n ],\n ReturnType<typeof prepareGroupHeaders>\n >\n) {\n const { getRsStore, getView, getRsStateResolver } = rsInternal;\n const rsStore = getRsStore();\n const { getState } = getRsStateResolver();\n if (!rsStore.groupingInfo || !rsStore.groupingInfo.length) {\n // As we are giving ways to always use header though grouping is not in place\n // update total item count given by API.\n getView().setProp('totalItemCount', getView().resultsCount);\n memoizedPrepareGroupHeaders([[], [], rsInternal], [getView().rows!.length]);\n } else {\n // As our group headers are representing data in UI , so\n // like data after every fetch group headers should also change so that\n // UI get to know about latest group.\n getView().setProp(\n 'totalItemCount',\n getTotalItemCount(getView, getState(), rsStore.groupingInfo)\n );\n memoizedPrepareGroupHeaders([\n rsStore.groupingInfo,\n rsStore.groupFilters,\n rsInternal,\n getState().groupToggle,\n getState().allGroupsExpanded\n ]);\n }\n}\n\n// TODO: Need to make changes in grouping to support 0 based indexing inclusive start and end index.\n/**\n * Handles the grouping feature for repeating structures.\n *\n * This method performs the following tasks:\n * - Fetches the grouping information, either via {@link ApiContext.fetchGroupedInfo} or {@link ApiContext.fetchHierarchicalGroupedInfo}, and stores the result in {@link RsStore.groupingInfo}.\n * - Prepares group filters based on the grouping information, then sets these filters in {@link RsStore.groupFilters}.\n * - Manages the automatic expansion of groups.\n * - Prepares group headers from the fetched grouping information and sets them in {@link View.groupHeaders}.\n */\nexport default (rsInternal: RsInternal) => {\n const memoizedOnGroupsChange = withMemoization(onGroupsChange);\n const memorizeOnHierarchicalGroupChange = withMemoization(onHierarchicalGroupChange);\n const memoizedUpdateGroupFilters = withMemoization(updateGroupFilters);\n const memoizedAutoExpandGroups = withMemoization(autoExpandGroups);\n\n // Prepare group header even though groups are not present to have one flow.\n // depend on after fetch event as , it depends on data when no grouping is there.\n rsInternal\n .getPubSubUtils()\n .subscribe(AFTER_FETCH, () => postFetch(rsInternal, withMemoization(prepareGroupHeaders)));\n\n async function execute(featureProps: BeforeRenderFeatureProps) {\n const { getState, getRsStore } = featureProps;\n const state = getState();\n // TOdo: Fixme ISSUE-76344... try to not rely on state.personalization?.active\n await memoizedOnGroupsChange(\n [featureProps],\n [\n state.groups,\n state.filterExpression,\n state.search?.query,\n state.personalization?.active,\n state.refresh,\n state.aggregationInfo\n ]\n );\n\n memoizedAutoExpandGroups([featureProps], [state.personalization?.active]);\n\n await memorizeOnHierarchicalGroupChange(\n [featureProps],\n [\n state.hierarchicalGroup,\n state.filterExpression,\n state.search?.query,\n state.aggregationInfo,\n state.personalization?.active\n ]\n );\n // In new grouping, update group info in state.\n // Action dispatched for group info will prepare group headers.\n if (state.paginationOptions) {\n // TODO: use this comarator for optimization but isVisible calculated prop on grouping info needs to be handled.ISSUE-80012\n // const comparator =(prev, next) => {\n // if (prev[1] !== next[1] || prev[3] !== next[3]) return false;\n // return compareArray(prev[2], next[2], ['children', 'count', 'name']);\n // };\n memoizedUpdateGroupFilters(\n [featureProps],\n [\n state.paginationOptions[Object.keys(state.paginationOptions || {})[0]],\n getRsStore().groupingInfo,\n state.groupToggle,\n state.allGroupsExpanded\n ]\n );\n }\n }\n\n // As we are generating one flow, this is required. TODO: Need to take decision\n // conditional block on UI or feature push though not enabled.\n if (rsInternal.getView().meta.grouping) {\n return execute;\n }\n\n return undefined;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"grouping.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/grouping.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,eAAe,EACf,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,cAAc,MAAM,oCAAoC,CAAC;AAqChE,SAAS,cAAc,CACrB,WAAoC,EACpC,IAA6C,EAC7C,YAAiC;IAEjC,oDAAoD;IACpD,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC,IAAI,CAAC,OAAQ,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,SAAU,CAAC,CAAC,CAAC;IACjG,MAAM,gBAAgB,GAAG,KAAM,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC;IACtE,OAAO,gBAAgB,KAAK,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,QAAQ,GAAG,CAA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,CAAC,CAAC,CAAC;QAE1E,MAAM,iCAAiC,CACrC,CAAC,YAAY,CAAC,EACd;YACE,KAAK,CAAC,iBAAiB;YACvB,KAAK,CAAC,gBAAgB;YACtB,KAAK,CAAC,MAAM,EAAE,KAAK;YACnB,KAAK,CAAC,eAAe;YACrB,KAAK,CAAC,eAAe,EAAE,MAAM;SAC9B,CACF,CAAC;QACF,+CAA+C;QAC/C,+DAA+D;QAC/D,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;YAC5B,2HAA2H;YAC3H,sCAAsC;YACtC,kEAAkE;YAClE,0EAA0E;YAC1E,KAAK;YACL,0BAA0B,CACxB,CAAC,YAAY,CAAC,EACd;gBACE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtE,UAAU,EAAE,CAAC,YAAY;gBACzB,KAAK,CAAC,WAAW;gBACjB,KAAK,CAAC,iBAAiB;aACxB,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,+EAA+E;IAC/E,8DAA8D;IAC9D,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACvC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\n\nimport {\n getGroupKey,\n getGroupFromKey,\n withMemoization,\n compareArray,\n dateFunctionLabels,\n deepCopy,\n isEmpty\n} from '../../../utils/util';\nimport { actionGroupingExpandCollapseAll } from '../../../actions/actions';\nimport { AFTER_FETCH } from '../../../pubSub/events';\nimport type RsInternal from '../../../RsInternal';\nimport type { BeforeRenderFeatureProps } from '../../featureFactory';\nimport type { MemoizedFunction } from '../../../utils/util.types';\nimport type { Group, GroupFilter, GroupToggle, State } from '../../../../../types/State.types';\nimport type { HierarchicalInfo } from '../../../../../types/Meta.types';\nimport GroupGenerator from '../../../generators/GroupGenerator';\nimport type View from '../../../generators/ViewGenerator';\nimport type RsStore from '../../../RsStore';\nimport type {\n GroupedInfo,\n HierarchicalGroupedInfo,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n ApiContext\n} from '../../../../../types/ApiContext.types';\n\nexport interface CommonGroupingInfo {\n /** Id of the field on which grouping is applied. */\n groupBy: string;\n /** Current group level, starts with 0 for 1st level of grouping. */\n level: number;\n /** Path of the grouped column value. */\n hierarchy: (string | number | boolean | Date)[];\n visibleRow?: boolean;\n showHierarchicalFooter?: boolean;\n groupFrom?: number;\n groupTo?: number;\n isHierarchical?: boolean;\n}\n\nexport type GroupingInfo = OmitStrict<GroupedInfo, 'children'> &\n CommonGroupingInfo & {\n children?: GroupingInfo[];\n };\n\nexport type HierarchicalGroupingInfo = OmitStrict<HierarchicalGroupedInfo, 'children'> &\n CommonGroupingInfo & {\n children?: HierarchicalGroupingInfo[];\n parentId?: string;\n targetId?: string;\n name?: null | string | number | boolean | Date;\n };\n\nfunction isNodeExpanded(\n groupToggle: GroupToggle | undefined,\n node: GroupingInfo | HierarchicalGroupingInfo,\n defaultState: boolean | undefined\n): boolean {\n /** Groups with 0 count should not be expandable. */\n if (node.count === 0) {\n return false;\n }\n\n const index = groupToggle?.[node.groupBy!]?.findIndex(gct => compareArray(gct, node.hierarchy!));\n const childToggleState = index! >= 0 ? !defaultState : !!defaultState;\n return childToggleState === true;\n}\n\nconst getLabel = (view: View, groupBy: string, getState: BeforeRenderFeatureProps['getState']) => {\n const { columnId, dateFunction } = getGroupFromKey(groupBy, getState().groups)!;\n let { label } = view.columns!.find(column => column.field.id.toString() === columnId.toString())!;\n if (dateFunction) {\n // @ts-expect-error dateFunction cannot be used to index dateFunctionLabels. Check this.\n label += ` (${dateFunctionLabels[dateFunction]})`;\n }\n return label;\n};\n\n// This function checks if hierarchy exist or not.\n// which will decide whether start and end Index would be there on leaf node or on hierarchical node.\nconst doesExistInViewInfo = (\n viewInfo: GroupFilter[],\n hierarchy: (string | number | boolean | Date)[] = [],\n isHierarchical = false\n) => {\n return viewInfo.some(v => {\n const filters = Object.values(v.filters);\n\n if (isHierarchical) {\n return filters.every(value => value === [...hierarchy].pop());\n }\n\n if (filters.length === hierarchy.length) {\n const tempHierarchy = [...hierarchy];\n // eslint-disable-next-line @typescript-eslint/require-array-sort-compare\n tempHierarchy.sort();\n // eslint-disable-next-line @typescript-eslint/require-array-sort-compare\n return filters.sort().every((value, index) => value === tempHierarchy[index]);\n }\n return false;\n });\n};\n\nconst prepareGroupHeaders = (\n props: [\n groupingInfo: RsStore['groupingInfo'],\n groupFilters: RsStore['groupFilters'],\n rsInternal: RsInternal,\n groupToggle?: State['groupToggle'],\n allGroupsExpanded?: boolean\n ]\n) => {\n const [groupingInfo = [], viewInfo = [], rsInternal, groupToggle = {}, allGroupsExpanded] = props;\n\n // If group and viewInfo are empty, prerape group header for top level leaf node.\n // This is for easing on UI , one contract whether grouping is in place/not.\n // TODO: support for enabling feature on view.\n const view = rsInternal.getView();\n const { getState } = rsInternal.getRsStateResolver();\n if (groupingInfo.length === 0) {\n // construct view header object.\n\n const viewHeader = new GroupGenerator(\n {\n isVisible: false,\n isLeafNode: true,\n isExpanded: true,\n name: '',\n groupBy: '',\n level: 0,\n label: '',\n hierarchy: [],\n count: view.rows!.length\n },\n rsInternal\n );\n viewHeader.startIndex = 0;\n viewHeader.endIndex = view.rows ? view.rows.length : 0;\n view.setProp('groupHeaders', [viewHeader]);\n return;\n }\n // Creating flat objects from view group info using DFT.\n const result = [];\n let counter = 0;\n\n const stack = groupingInfo.map(v => ({ ...v }));\n let leafNodeCountInView = 0;\n let lastDataIndex = 0;\n while (stack.length) {\n const child = stack.shift();\n if (child) {\n const isExpanded = isNodeExpanded(groupToggle, child, allGroupsExpanded);\n const isSubGroupPresent = child.children && child.children.length;\n const label = child.isHierarchical ? '' : getLabel(view, child.groupBy!, getState);\n // construct view header object.\n const viewHeader = new GroupGenerator(\n {\n isVisible: !!child.visibleRow,\n isLeafNode: !isSubGroupPresent,\n isExpanded,\n name: child.name!,\n groupBy: child.groupBy,\n level: child.level,\n label: label!,\n hierarchy: child.hierarchy,\n count: child.count,\n aggregation: child.agg,\n showHierarchicalFooter: child.showHierarchicalFooter,\n isHierarchical: child.isHierarchical,\n info: (child as HierarchicalGroupingInfo).info,\n data: (child as GroupingInfo).data\n },\n rsInternal\n );\n // If header node is a leaf node then , add start index and endIndex to resolve data.\n if (\n (viewHeader.isLeafNode || viewHeader.isHierarchical) &&\n viewHeader.isExpanded &&\n doesExistInViewInfo(viewInfo, viewHeader.hierarchy, viewHeader.isHierarchical)\n ) {\n const { groupFrom, groupTo } = viewInfo[leafNodeCountInView] || {};\n if (groupFrom >= 0 && groupTo >= 0) {\n viewHeader.startIndex = lastDataIndex;\n viewHeader.endIndex = viewHeader.startIndex + groupTo - groupFrom;\n lastDataIndex = viewHeader.endIndex;\n leafNodeCountInView += 1;\n }\n }\n // BUG-775861 - Adding index to visible groupHeaders so that this can be used to set the z-index for groupHeaders\n if (viewHeader.isVisible) {\n viewHeader.index = counter;\n counter += 1;\n }\n result.push(viewHeader);\n if (isExpanded && isSubGroupPresent) {\n stack.unshift(...child.children!);\n }\n }\n }\n view.setProp('groupHeaders', result);\n};\n\nfunction includeGroup(\n group: GroupingInfo | HierarchicalGroupingInfo,\n groupFrom: number,\n groupTo: number,\n parentGroups: Record<string, any>,\n groupFilters: GroupFilter[]\n) {\n group.groupFrom = groupFrom;\n group.groupTo = groupTo;\n groupFilters.push({ groupFrom, groupTo, filters: parentGroups });\n}\n\nfunction getRecordsCount(\n group: NonNullable<RsStore['groupingInfo']>,\n count: number,\n includedRowCount: number,\n parentGroup: Record<string, any>,\n from: number,\n to: number,\n groupFilters: GroupFilter[],\n groupToggle: GroupToggle | undefined,\n allGroupsExpanded: boolean | undefined,\n state: State,\n getView: BeforeRenderFeatureProps['getView']\n): [count: number, includedRowCount: number] {\n const { aggregationInfo } = state;\n\n for (let i = 0; i < group.length; i += 1) {\n const parentGroups = { ...parentGroup };\n if ((group[i] as HierarchicalGroupingInfo).isHierarchical) {\n const currentGroup = group[i] as HierarchicalGroupingInfo;\n parentGroups[currentGroup.parentId!] = currentGroup.info![currentGroup.targetId!];\n } else {\n const currentGroup = group![i] as GroupingInfo;\n parentGroups[currentGroup.groupBy!] = currentGroup.name;\n }\n count += 1;\n // group has subgroups and group is expanded\n const isExpanded = isNodeExpanded(groupToggle, group[i], allGroupsExpanded);\n let includeThisGroup = false;\n if (count > from && count - 1 <= to) {\n includeThisGroup = true;\n includedRowCount += 1;\n }\n group[i].visibleRow = includeThisGroup;\n // Footer should be shown only if node expands.\n // groupToggle will effect footer visibility so reset footer flag.\n group[i].showHierarchicalFooter = false;\n\n if (group[i].children && isExpanded) {\n [count, includedRowCount] = getRecordsCount(\n group[i].children!,\n count,\n includedRowCount,\n parentGroups,\n from,\n to,\n groupFilters,\n groupToggle,\n allGroupsExpanded,\n state,\n getView\n );\n group[i].visibleRow =\n group[i].visibleRow ||\n !!group[i].children!.find(\n g => g.visibleRow && ((g as HierarchicalGroupingInfo).isHierarchical || !g.children)\n );\n } else if (!group[i].children && isExpanded) {\n // group doesn't have subgroups and group is expanded\n const innerCount = count + group[i].count;\n if (count <= to) {\n let groupFrom = 0;\n let groupTo = 0;\n if (innerCount >= from) {\n groupFrom = Math.max(from - count, 0);\n if (innerCount <= to + 1) {\n groupTo = group[i].count;\n } else {\n groupTo = groupFrom + (to + 1 - from - includedRowCount);\n }\n group[i].visibleRow = true;\n let updatedGroupFrom = groupFrom;\n // Sticky group header logic\n if (!includeThisGroup && groupTo > groupFrom + 2) {\n if (group[i].level! >= 1) {\n updatedGroupFrom = groupFrom + 2;\n } else {\n updatedGroupFrom = groupFrom + 1;\n }\n }\n includeGroup(group[i], updatedGroupFrom, groupTo, parentGroups, groupFilters);\n }\n includedRowCount += groupTo - groupFrom;\n }\n count = innerCount;\n }\n\n if (\n (group[i] as HierarchicalGroupingInfo).isHierarchical &&\n aggregationInfo &&\n aggregationInfo.length > 0 &&\n isExpanded\n ) {\n count += 1;\n group[i].showHierarchicalFooter = true;\n\n if (group[i].visibleRow && includedRowCount <= to) {\n includedRowCount += 1;\n }\n }\n }\n return [count, includedRowCount];\n}\n\nconst constructGroupingPagination = (\n groupingInfo: NonNullable<RsStore['groupingInfo']>,\n groupToggle: GroupToggle | undefined,\n paginationOptions: NonNullable<State['paginationOptions']>[keyof NonNullable<\n State['paginationOptions']\n >],\n allGroupsExpanded: boolean | undefined,\n state: State,\n getView: BeforeRenderFeatureProps['getView']\n) => {\n const groupFilters = [] as GroupFilter[];\n getRecordsCount(\n groupingInfo,\n 0,\n 0,\n {},\n paginationOptions.startIndex,\n paginationOptions.endIndex,\n groupFilters,\n groupToggle,\n allGroupsExpanded,\n state,\n getView\n );\n return groupFilters;\n};\n\n// This is basically used to update count on non leaf node.\n// which is sum of count of leaf node children in their hierarchy.\nfunction updateCountOnNonLeafNode(groupingInfo: GroupedInfo[]) {\n const updateCount = (child: GroupedInfo) => {\n if (child.count !== undefined) return child.count;\n child.count = child.children!.reduce((acc, c) => {\n acc += updateCount(c)!;\n return acc;\n }, 0);\n };\n groupingInfo.forEach(g => updateCount(g));\n}\n\nfunction updateGroupInfo(groupingInfo: GroupedInfo[], groups: Group[]): GroupingInfo[] {\n // iterate groupingInfo using BFS and update basic information.\n const queue = [...groupingInfo] as GroupingInfo[];\n while (queue.length) {\n const child = queue.pop();\n if (child) {\n if (!child.hierarchy) child.hierarchy = [child.name!];\n child.level = child.level || 0;\n const matchingGroup = groups.find(g => g.level === child.level);\n child.groupBy = getGroupKey(matchingGroup!);\n\n if (child.children) {\n // update level before pushing children to queue.\n child.children.forEach(c => {\n c.level = child.level + 1;\n c.hierarchy = [...child.hierarchy];\n c.hierarchy.push(c.name!);\n });\n queue.push(...child.children);\n }\n }\n }\n return groupingInfo as GroupingInfo[];\n}\n\nfunction updateCountFromGroupingInfo(\n getView: BeforeRenderFeatureProps['getView'],\n getRsStore: BeforeRenderFeatureProps['getRsStore']\n) {\n if (getView().countGeneratedInternally || isEmpty(getView().resultsCount)) {\n const countFromGroupingInfo = getRsStore().groupingInfo?.reduce(\n (acc, group) => (group.count ? acc + group.count : acc),\n 0\n );\n\n const countPayload = { count: countFromGroupingInfo, _countGeneratedInternally: true };\n getView().type.setRecordCount(countPayload);\n }\n}\n\nasync function onGroupsChange([{ getRsProps, getRsStore, getView, getState }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n const rsStore = getRsStore();\n const rsProps = getRsProps();\n const state = getState();\n const { groups } = state;\n\n if (groups?.length! > 0 && getView().meta.grouping) {\n try {\n const groupingInfo =\n (await rsProps.apiContext.fetchGroupedInfo?.(deepCopy(state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })) || [];\n // Here update group info with basic properties like level, group by, expand state etc.\n // to make calculation easy.\n // TODO: FIXME - Check if count on non leaf node is required\n updateCountOnNonLeafNode(groupingInfo);\n rsStore.groupingInfo = updateGroupInfo(groupingInfo, groups!);\n\n // FIXME: once infinite virtualizer supports the grouping, we need not compute the count from grouping\n // Prepare the count from the groups count until the actual count returns\n updateCountFromGroupingInfo(getView, getRsStore);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('API call failed', err);\n }\n } else rsStore.groupingInfo = [];\n\n getView().columns!.forEach(column => {\n const grouped = groups?.findIndex(group => group.columnId === column.field.id)! >= 0;\n column = column.setProp('grouped', grouped);\n });\n}\n\nfunction autoExpandGroups([{ dispatch, getState }]: [featureProps: BeforeRenderFeatureProps]) {\n const { allGroupsExpanded = true } = getState();\n dispatch(actionGroupingExpandCollapseAll(allGroupsExpanded));\n}\n\nfunction updateHierarchicalGroupInfo(\n groupingInfo: HierarchicalGroupedInfo[],\n hierarchicalGroup: HierarchicalInfo\n) {\n const queue = [...groupingInfo] as HierarchicalGroupingInfo[];\n\n while (queue.length) {\n const child = queue.pop();\n const node = child!.info;\n\n if (child) {\n child.level = child.level || 0;\n child.isHierarchical = true;\n child.parentId = hierarchicalGroup.parentId;\n child.targetId = hierarchicalGroup.targetId;\n child.groupBy = (hierarchicalGroup.sortById || hierarchicalGroup.targetId)!;\n\n if (node) {\n child.name = node[(hierarchicalGroup.sortById || hierarchicalGroup.targetId)!] as string;\n child.hierarchy = [node[hierarchicalGroup.targetId!] as string];\n }\n\n if (child.children) {\n // update level before pushing children to queue.\n child.children.forEach(c => {\n c.level = child.level! + 1;\n });\n queue.push(...child.children);\n }\n }\n }\n}\n\nasync function onHierarchicalGroupChange([{ getState, getRsProps, getRsStore, getView }]: [\n featureProps: BeforeRenderFeatureProps\n]) {\n const { hierarchicalGroup } = getState();\n const rsProps = getRsProps();\n const rsStore = getRsStore();\n if (hierarchicalGroup && hierarchicalGroup.parentId) {\n try {\n const groupingInfo =\n (await rsProps.apiContext.fetchHierarchicalGroupedInfo?.(\n deepCopy(getState()),\n getView().meta,\n {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n }\n )) || [];\n\n getView().setProp('hierarchicalGroupEnabled', true);\n\n updateHierarchicalGroupInfo(groupingInfo, hierarchicalGroup);\n rsStore.groupingInfo = groupingInfo as HierarchicalGroupingInfo[];\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('API call failed', err);\n }\n } else {\n getView().setProp('hierarchicalGroupEnabled', false);\n }\n}\n\nconst getTotalItemCount = (\n getView: BeforeRenderFeatureProps['getView'],\n state: State,\n groupingInfo: NonNullable<RsStore['groupingInfo']>\n) => {\n // Calculate total group count and update instance.\n // and datanode count based on group expand state.\n let totalItemCount = 0;\n const stack = [...groupingInfo];\n const { groupToggle, allGroupsExpanded } = state;\n\n while (stack.length) {\n const child = stack.shift();\n // We are considering header count whether if it is of hierarchical node or\n // a normal group node and it has data associated with it in its hierarchy.\n if (child) {\n totalItemCount += 1;\n const isSubGroupPresent = child.children && child.children.length;\n const isExpanded = isNodeExpanded(groupToggle, child, allGroupsExpanded);\n if (isExpanded && isSubGroupPresent) {\n stack.unshift(...child.children!);\n } else if (isExpanded && !isSubGroupPresent) {\n totalItemCount += child.count;\n }\n\n if (child.showHierarchicalFooter) {\n totalItemCount += 1;\n }\n }\n }\n return totalItemCount;\n};\n\nconst updateGroupFilters = ([{ getState, getRsStore, getView }]: [\n featureProps: BeforeRenderFeatureProps\n]) => {\n const { paginationOptions, groupToggle, allGroupsExpanded } = getState();\n const rsStore = getRsStore();\n const { groupingInfo } = rsStore;\n // group info is expected to be [] when there are no groups.\n if (groupingInfo) {\n if (!groupingInfo.length && rsStore.groupFilters && !rsStore.groupFilters.length) return;\n rsStore.groupFilters = constructGroupingPagination(\n groupingInfo,\n groupToggle,\n paginationOptions!.rootVirtualiser,\n allGroupsExpanded,\n getState(),\n getView\n );\n }\n};\n\nfunction postFetch(\n rsInternal: RsInternal,\n memoizedPrepareGroupHeaders: MemoizedFunction<\n [\n groupingInfo: RsStore['groupingInfo'],\n groupFilters: RsStore['groupFilters'],\n rsInternal: RsInternal,\n groupToggle?: State['groupToggle'],\n allGroupsExpanded?: State['allGroupsExpanded']\n ],\n ReturnType<typeof prepareGroupHeaders>\n >\n) {\n const { getRsStore, getView, getRsStateResolver } = rsInternal;\n const rsStore = getRsStore();\n const { getState } = getRsStateResolver();\n if (!rsStore.groupingInfo || !rsStore.groupingInfo.length) {\n // As we are giving ways to always use header though grouping is not in place\n // update total item count given by API.\n getView().setProp('totalItemCount', getView().resultsCount);\n memoizedPrepareGroupHeaders([[], [], rsInternal], [getView().rows!.length]);\n } else {\n // As our group headers are representing data in UI , so\n // like data after every fetch group headers should also change so that\n // UI get to know about latest group.\n getView().setProp(\n 'totalItemCount',\n getTotalItemCount(getView, getState(), rsStore.groupingInfo)\n );\n memoizedPrepareGroupHeaders([\n rsStore.groupingInfo,\n rsStore.groupFilters,\n rsInternal,\n getState().groupToggle,\n getState().allGroupsExpanded\n ]);\n }\n}\n\n// TODO: Need to make changes in grouping to support 0 based indexing inclusive start and end index.\n/**\n * Handles the grouping feature for repeating structures.\n *\n * This method performs the following tasks:\n * - Fetches the grouping information, either via {@link ApiContext.fetchGroupedInfo} or {@link ApiContext.fetchHierarchicalGroupedInfo}, and stores the result in {@link RsStore.groupingInfo}.\n * - Prepares group filters based on the grouping information, then sets these filters in {@link RsStore.groupFilters}.\n * - Manages the automatic expansion of groups.\n * - Prepares group headers from the fetched grouping information and sets them in {@link View.groupHeaders}.\n */\nexport default (rsInternal: RsInternal) => {\n const memoizedOnGroupsChange = withMemoization(onGroupsChange);\n const memorizeOnHierarchicalGroupChange = withMemoization(onHierarchicalGroupChange);\n const memoizedUpdateGroupFilters = withMemoization(updateGroupFilters);\n const memoizedAutoExpandGroups = withMemoization(autoExpandGroups);\n\n // Prepare group header even though groups are not present to have one flow.\n // depend on after fetch event as , it depends on data when no grouping is there.\n rsInternal\n .getPubSubUtils()\n .subscribe(AFTER_FETCH, () => postFetch(rsInternal, withMemoization(prepareGroupHeaders)));\n\n async function execute(featureProps: BeforeRenderFeatureProps) {\n const { getState, getRsStore } = featureProps;\n const state = getState();\n // TOdo: Fixme ISSUE-76344... try to not rely on state.personalization?.active\n await memoizedOnGroupsChange(\n [featureProps],\n [\n state.groups,\n state.filterExpression,\n state.search?.query,\n state.personalization?.active,\n state.refresh,\n state.aggregationInfo,\n state.hiddenColumns\n ]\n );\n\n memoizedAutoExpandGroups([featureProps], [state.personalization?.active]);\n\n await memorizeOnHierarchicalGroupChange(\n [featureProps],\n [\n state.hierarchicalGroup,\n state.filterExpression,\n state.search?.query,\n state.aggregationInfo,\n state.personalization?.active\n ]\n );\n // In new grouping, update group info in state.\n // Action dispatched for group info will prepare group headers.\n if (state.paginationOptions) {\n // TODO: use this comarator for optimization but isVisible calculated prop on grouping info needs to be handled.ISSUE-80012\n // const comparator =(prev, next) => {\n // if (prev[1] !== next[1] || prev[3] !== next[3]) return false;\n // return compareArray(prev[2], next[2], ['children', 'count', 'name']);\n // };\n memoizedUpdateGroupFilters(\n [featureProps],\n [\n state.paginationOptions[Object.keys(state.paginationOptions || {})[0]],\n getRsStore().groupingInfo,\n state.groupToggle,\n state.allGroupsExpanded\n ]\n );\n }\n }\n\n // As we are generating one flow, this is required. TODO: Need to take decision\n // conditional block on UI or feature push though not enabled.\n if (rsInternal.getView().meta.grouping) {\n return execute;\n }\n\n return undefined;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/features/uIFeatures/index.ts"],"names":[],"mappings":"AAiBA,OAAO,2BAA2B,MAAM,4CAA4C,CAAC;AAuBrF,OAAO,WAAW,MAAM,4BAA4B,CAAC;;;4EANrD,kEAAqC;6BAlBhC,kEAAsC;6BA2Eq3D,kEAAsC;uBAnB37D,kEACe;;0BAxDU,kEAAsC;;;uBActC,kEAC5B;6BA2DqO,kEAAsC;;4BAlE7O,kEACtB;8BAiEw1L,kEAAsC;kCAnC14L,kEAEA;6BAvCc,kEAClB;2BASoB,kEAAsC;2EA8DyzC,kEAAsC;yCA5D11C,kEAC5B;+BA2D6yG,kEAAsC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/features/uIFeatures/index.ts"],"names":[],"mappings":"AAiBA,OAAO,2BAA2B,MAAM,4CAA4C,CAAC;AAuBrF,OAAO,WAAW,MAAM,4BAA4B,CAAC;;;4EANrD,kEAAqC;6BAlBhC,kEAAsC;6BA2Eq3D,kEAAsC;uBAnB37D,kEACe;;0BAxDU,kEAAsC;;;uBActC,kEAC5B;6BA2DqO,kEAAsC;;4BAlE7O,kEACtB;8BAiEw1L,kEAAsC;kCAnC14L,kEAEA;6BAvCc,kEAClB;2BASoB,kEAAsC;2EA8DyzC,kEAAsC;yCA5D11C,kEAC5B;+BA2D6yG,kEAAsC;4BAxDr0G,kEACpB;kCAuDmsL,kEAAsC;;;gCArE9sL,kEAC5B;kCAJD,kEAClB;4BAgDD,kEAEN;qBAqBitC,kEAAsC;kCAvE5qC,kEAC1C;sCAQrB,kEAAsC;0EA8Dw/N,kEAAsC;wEAAh1H,kEAAsC;wCAlDpuG,kEAGxD;4BA8BG,kEAEM;6BAjEyC,kEAC5B;sEAwBhC,kEAAsC;2BAkDhC,kEACQ;4BA/DF,kEAAsC;;uCAmEirB,kEAAsC;;;0BAA6qC,sDAA0B;iCAAiwC,sDAA0B;yCA/D9sG,sDAA0B;;;AAezD,wBA+CE"}
|
|
@@ -178,7 +178,8 @@ export interface ApiContext {
|
|
|
178
178
|
sorting is changed OR\
|
|
179
179
|
forceRefresh is triggered by consumer OR\
|
|
180
180
|
groups are changed OR\
|
|
181
|
-
hierarchicalGroups are changed
|
|
181
|
+
hierarchicalGroups are changed OR\
|
|
182
|
+
hiddenColumns are changed
|
|
182
183
|
* @param {State} rsState - Current repeating structures {@link State}. Majorly used to build the criteria for query(e.g. filter, sort, group criteria, paginationOptions).
|
|
183
184
|
* @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields for which data needs to be fetched.
|
|
184
185
|
* @param {ApiOptions} apiOptions - Extra api options provided by repeating structures,
|
|
@@ -195,6 +196,7 @@ export interface ApiContext {
|
|
|
195
196
|
* search criteria is changed OR\
|
|
196
197
|
* personalization is toggled. OR\
|
|
197
198
|
* aggregation is changed OR\
|
|
199
|
+
* hiddenColumns are changed OR\
|
|
198
200
|
* forceRefresh of RS is triggered by consumer.
|
|
199
201
|
* @param {State} rsState - Current repeating structures {@link State}. Majorly used to build the criteria for query. For e.g. use rsState.groups and rsState.aggregationInfo to determine the query.
|
|
200
202
|
* @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields info for which data needs to be fetched.
|
|
@@ -208,7 +210,8 @@ export interface ApiContext {
|
|
|
208
210
|
* @invokedWhen When aggregation is applied on any {@link FieldDef fieldDef} OR\
|
|
209
211
|
* filters are changed OR\
|
|
210
212
|
* search criteria is changed OR\
|
|
211
|
-
* personalization is toggled.
|
|
213
|
+
* personalization is toggled. OR\
|
|
214
|
+
* hiddenColumns are changed.
|
|
212
215
|
* @param {State} rsState - Current repeating structures {@link State}. Majorly used to get current aggregations applied on the RS from aggregationInfo key in state. Apart from this current filters and search criteria can also be picked from state.
|
|
213
216
|
* @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields for which data needs to be fetched.
|
|
214
217
|
* @returns {Promise<AggregationResult>} - It should return a promise of type {@link AggregationResult}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiContext.types.d.ts","sourceRoot":"","sources":["../../types/ApiContext.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AACzG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAElF,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACL,KAAK,EACN,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE9D;;GAEG;AACH,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC;IAEvB;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAEzB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB;;;OAGG;IACH,WAAW,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAE9C;;;OAGG;IACH,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IAEnD;;;OAGG;IACH,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,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AAE,UAAU,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1F;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/E;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC;CACxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiContext.types.js","sourceRoot":"","sources":["../../types/ApiContext.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ModalManagerContextValue } from '@pega/cosmos-react-core/lib/components/Modal/Modal.types';\nimport type { Condition } from '@pega/cosmos-react-condition-builder';\n\nimport type { RowData } from '../src/core/generators/RowGenerator.types';\nimport type { UtilityFunctions } from '../src/core/generators/viewUtilityMethods';\n\nimport type {\n Personalization,\n PersonalizationInfo,\n PersonalizedState,\n State,\n Group\n} from './State.types';\nimport type { Meta, RowAction, FieldDef } from './Meta.types';\n\n/**\n * Represents information about the currently active view in the repeating structures.\n */\ntype ActiveViewInfo = {\n /**\n * The unique identifier of the active view.\n */\n id: string | undefined;\n\n /**\n * The name of the active view.\n */\n name: string | undefined;\n\n /**\n * Indicates whether the active view has unsaved changes.\n */\n isDirty: boolean;\n};\n\nexport type RsApi = {\n /**\n * Refreshes the current view.\n * @see {@link UtilityFunctions.refreshView}\n */\n refreshView: UtilityFunctions['forceRefresh'];\n\n /**\n * Sets the record count in the view.\n * @see {@link UtilityFunctions.setRecordCount}\n */\n setRecordCount: UtilityFunctions['setRecordCount'];\n\n /**\n * Dispatches an action to the repeating structures with an payload.\n * @see {@link UtilityFunctions.dispatchAction}\n */\n dispatchAction: UtilityFunctions['dispatchAction'];\n\n /**\n * Retrieves information about the currently active view.\n * @returns The {@link ActiveViewInfo active view information} or `void` if unavailable.\n */\n getActiveViewInfo: () => ActiveViewInfo | void;\n\n /**\n * Sets hidden columns of the view.\n * @param columns - An array of column IDs to hide.\n * @param ootbColumns - .\n * @param ootbColumns.dragHandle - Whether to hide the drag-and-drop column.\n */\n setHiddenColumns?: (columns: string[], ootbColumns?: { dragHandle: boolean }) => void;\n\n /**\n * Sets Column order of the view.\n * @param columns - An array of column IDs to reorder.\n */\n setColumnOrder?: (columns: string[]) => void;\n\n /**\n * Sets the filters of the view.\n * @param filter - The filter condition to apply.\n */\n setFilter: (filter: Condition) => void;\n\n /**\n * Sets the groups of the view.\n * @param groups - The grouping configuration.\n */\n setGrouping?: (groups: Group[]) => void;\n\n /**\n * Sets the sorting order of the view.\n * @param {NonNullable<State['sortingOrder']>} sorts - The sorting configuration.\n */\n setSorting: (sorts: NonNullable<State['sortingOrder']>) => void;\n\n /**\n * Sets the column aliases of the view.\n * @param aliases - The column alias configuration.\n */\n setAliases: (aliases: State['columnAlias']) => void;\n\n /**\n * Sets the aggregation information of the view.\n * @param {State['aggregationInfo']} agg - The aggregation configuration.\n */\n setAggregations: (agg: State['aggregationInfo']) => void;\n\n /**\n * Sets the visibility of the row reorder field.\n * @param {boolean} visibility - Whether the row reorder field should be visible.\n */\n setRowReorderFieldVisibility: (visibility: boolean) => void;\n\n /**\n * Updates the visibility of specific columns.\n * @param {Object} columns - A mapping of column IDs to their visibility state.\n */\n updateColumnsVisibility: (columns: { [key: FieldDef['id']]: boolean }) => void;\n\n /**\n * Sets the conditional style formats of the view.\n * @param conditionalStyleFormats - The conditional style formats to apply.\n */\n setConditionalStyleFormats: (\n conditionalStyleFormats: NonNullable<State['conditionalStyleFormats']>\n ) => void;\n};\n\nexport interface ApiOptions {\n signal?: AbortSignal;\n /** Indicates current api triggered should invalidate the cache if any and reload the data. */\n invalidateCache?: boolean;\n /** A unique token or version identifier that changes whenever a refresh is triggered. Unlike a boolean `invalidateCache` flag, the `invalidateCacheToken` ensures that multiple APIs triggered\n in the same refresh cycle receive the same identifier. */\n invalidateCacheToken?: number;\n}\n// Aggregation response type\ntype AggregationTypeResp = 'avg' | 'max' | 'min' | 'nonNullCount' | 'sum';\n/** An object with key equal to {@link AggregationTypeResp aggregation type} and value is equal to the actual value of that aggregation type */\ntype AggregationOptions = {\n [agg in AggregationTypeResp]?: number | null;\n};\n/** An object where key is equal to the column id (i.e. {@link FieldDef.id id} in FieldDef) and value is equal to its {@link AggregationOptions Aggregation values} */\nexport type AggregationResp = {\n [columnId: string]: AggregationOptions;\n};\n\n// Grouping response type\nexport interface GroupedInfo {\n /** Value for the current group node. */\n name: null | string | number | boolean | Date; // Value for the current node\n /** # of data rows in this node */\n count: number;\n /** An optional data row from the group node that is used to process extra information required by group node */\n data?: RowData;\n /** Aggregation values of a column if applied */\n agg?: AggregationResp;\n /** Nested groups within the parent group node */\n children?: GroupedInfo[];\n}\n\nexport interface HierarchicalGroupedInfo extends Pick<GroupedInfo, 'count' | 'agg'> {\n info: RowData;\n children?: HierarchicalGroupedInfo[];\n}\n\nexport type AggregateValueResponse = {\n [columnId: string]: number | null;\n};\n/** An object where key is equal to column id i.e. {@link FieldDef.id id key in fieldDef} and value is equal to the aggregation value for the given aggregation */\nexport type AggregationResult = {\n [columnId: string]: number;\n};\n\nexport interface FetchDataResponse {\n /** An array of {@link RowData} */\n data: RowData[];\n /** An optional parameter to provide the total record count for a given Repeating structures with a given filter criteria in the query. If not provided, use callback setRecordCount */\n totalRecordCount?: number;\n /** @deprecated An optional parameter to provide the total record count for a given Repeating structures with a given filter criteria in the query. If not provided, use callback setRecordCount */\n filteredRecordCount?: number;\n}\n\ntype BulkAction = Pick<RowAction, 'id' | 'text'> & {\n /**\n * @param rowIds - The values for the {@link Meta.itemKey 'itemkey'} for given rows.\n * @param clearSelectionAndRefreshRowsCallback - A callback used to trigger deselection of all the selected rows and then call\n * {@link ApiContext.fetchRowsData 'fetchRowsData'} api of to fetch latest data for given rows, after action is completed.\n * @return {void} - void\n */\n onClick: (rowIds: string[], clearSelectionAndRefreshRowsCallback: () => void) => void;\n};\n\ninterface ConditionConfig {\n condition: Condition;\n data: RowData;\n}\n\nexport type PersonalizationResponse = Pick<Personalization, 'defaultPersonalization'> & {\n allPersonalizations: {\n [personalizationKey: string]: Pick<PersonalizationInfo, 'name'> & {\n personalizationState: PersonalizedState;\n };\n };\n};\n\nexport interface ApiContext {\n /**\n * This api is used to fetch a list of raw data rows (excluding aggregations) for a given group or at the top level when no groups.\n *Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#29) documentation** for more details.\n * @requireWhen Always\n * @invokedWhen filters are changed OR\\\n * search criteria is changed OR\\\n end user scrolls through the RS records OR\\\n sorting is changed OR\\\n forceRefresh is triggered by consumer OR\\\n groups are changed OR\\\n hierarchicalGroups are changed\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to build the criteria for query(e.g. filter, sort, group criteria, paginationOptions).\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields for which data needs to be fetched.\n * @param {ApiOptions} apiOptions - Extra api options provided by repeating structures,\n * for instance, abort signal handler is sent which can be attached to the native fetch call or any framework like axios. Repeating structures will use to cancel the api calls which might be using stale state, e.g. in case of progressive scroll.\n * @returns {Promise<FetchDataResponse>} - It should return a promise of type {@link FetchDataResponse} that should contain data as one key of type Array<{@link RowData}> to provide data for given query.\n */\n fetchData: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<FetchDataResponse>;\n\n /**\n * This api is used to fetch details for any group/sub-group ribbons in the RS. Should return labels, counts, aggregation values at each group node.This can sometimes be called even when there are no groups. Avoid running into exceptions in those cases.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#59) documentation** for more details.\n * @requireWhen {@link Meta.grouping 'grouping'} key is set to true in\n * @invokedWhen Grouping is applied on any {@link FieldDef fieldDef} OR\\\n * filters are changed OR\\\n * search criteria is changed OR\\\n * personalization is toggled. OR\\\n * aggregation is changed OR\\\n * forceRefresh of RS is triggered by consumer.\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to build the criteria for query. For e.g. use rsState.groups and rsState.aggregationInfo to determine the query.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields info for which data needs to be fetched.\n * @returns {GroupedInfo[]} - It should return a promise of type array of all the {@link GroupedInfo } for the specific field. It can also include nested groups in children key.\n */\n fetchGroupedInfo?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<GroupedInfo[]>;\n\n /**\n * This api is used to fetch aggregation results for a given aggregation type(sum/min/max/count) on a field. This is called when aggregations are configured on one or more column.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#84) documentation** for more details.\n * @requireWhen {@link FieldDef.aggregation 'aggregation'} key is set to true for at least one FieldDef AND {@link FieldDef.type 'type'} key in FieldDef should be of number for that particular fieldDef.\n * @invokedWhen When aggregation is applied on any {@link FieldDef fieldDef} OR\\\n * filters are changed OR\\\n * search criteria is changed OR\\\n * personalization is toggled.\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to get current aggregations applied on the RS from aggregationInfo key in state. Apart from this current filters and search criteria can also be picked from state.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields for which data needs to be fetched.\n * @returns {Promise<AggregationResult>} - It should return a promise of type {@link AggregationResult}\n */\n fetchAggregatedValues?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<AggregationResult>;\n\n /**\n * This api is used to fetch unique values available for a particular field. It is generally called for a field which has {@link FieldDef.filterPickList filterPickList} key set to true.The unique values are presented to the user while filtering.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#99) documentation** for more details.\n * @requireWhen {@link FieldDef.filterPickList filterPickList} key set to true for at least one FieldDef\n * @invokedWhen Picklist Filter is invoked by end user from FieldDef header action menu.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {string} columnId - This is equal to { @link FieldDef.id 'id'} key of the field for which unique values needs to be fetched.\n * @returns {Promise<Array<string | number | boolean | Date>>} It should return a promise of type array of unique values for a given fieldDef id.\n */\n fetchUniqueColValues?: (\n rsState: State,\n rsMeta: Meta,\n columnId: string,\n apiOptions: ApiOptions\n ) => Promise<(string | number | boolean | Date)[]>;\n\n /**\n * This api is used to fetch the latest data for a given row identified uniquely by {@link FieldDef.itemKey itemKey}.\n * @requireWhen {@link Meta.editing 'editing'} OR {@link Meta.deleting 'deleting'} is set to true\n * @invokedWhen A {@link Meta.rowActions rowAction} is submitted by consumer of RS, as part of {@link RowAction. rowAction.onClick} 'refresRow' callback.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {string} key - A unique identifier for a given row. This is equal to {@link Meta.itemKey 'itemKey'}\n * @param {string} value - The value for the given {@link Meta.itemKey 'itemKey'} for given row.\n * @returns {Promise<RowData[]>} It should return a promise of type {@link RowData} array containing the data for a given row.Only 0th index is considered from the array.\n */\n fetchRowData?: (\n rsState: State,\n rsMeta: Meta,\n key: string,\n value: string,\n apiOptions: ApiOptions\n ) => Promise<RowData[]>;\n\n /**\n * This api is used to fetch the latest data for given set of rows identified uniquely by itemKey in {@link FieldDef}. This is passed as callback to all the {@link BulkAction.onClick bulk actions 'onClick'} method with {@link ApiContext.clearSelectedRows clearSelectedRows} api.\n * @requireWhen {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * @invokedWhen The bulk action is submitted, this can be called by bulk actions {@link BulkAction.onClick 'onClick'} method by RS consumer.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {Array<string | number | boolean | Date>} rowIds - The values for the given {@link Meta.itemKey 'itemKey'} for given rows.\n * @param itemKey - A unique identifier for a given row. This is equal to {@link Meta.itemKey 'itemKey'}\n * @returns {Promise<RowData[]>} It should return a promise of type {@link RowData} array containing the data for given rows.\n */\n fetchRowsData?: (\n rsState: State,\n rsMeta: Meta,\n rowIds: string[],\n itemKey: string,\n apiOptions: ApiOptions\n ) => Promise<RowData[]>;\n\n /**\n * This api is used to fetch the actions that is supported on rows of Repeating Structure. It is generally called when {@link Meta.editing 'editing'} is set to true.\n * @requireWhen {@link Meta.editing 'editing'} OR {@link Meta.deleting 'deleting'} is set to true\n * @invokedWhen The end user clicks on 'RowActionMenu'.Once fetched it is not refetched.\n * @param {} uniqueKey - A unique identifier for a given row. This is equal to value for {@link Meta.itemKey 'itemKey'} in {@link RowData} data.\n * @returns - A promise of type Array of {@link RowAction}\n */\n fetchRowActionDetails?: (uniqueKey: string, rowContext: RowData) => Promise<RowAction[]>;\n\n /**\n * This api is used to submit the updated row data to apiContext. It is generally called when {@link FieldDef.editable 'editable'} key is set to true for at least one FieldDef to enable inline editing for a cell.\n * @requireWhen {@link FieldDef.editable 'editable'} key is set to true for at least one FieldDef.\n * @invokedWhen The end user is done editing the cell using inline editing.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param dataToSubmit - Updated row data to be submitted to apiContext\n * @returns It should return a promise of type {@link RowData} with the updated contents that is passed in {@link dataToSubmit} param.\n */\n submitData?: (\n rsState: State,\n rsMeta: Meta,\n dataToSubmit: RowData\n ) => Promise<{ rowData: RowData }>;\n\n /**\n * This api is used to submit moved records in a repeating structure. It is called when {@link Meta.moveListRecords 'moveListRecords'} is set to true. Repeating structure allow moving of records based on it's value.\n * @requireWhen {@link Meta.moveListRecords 'moveListRecords'} is set to true\n * @invokedWhen The move process is completed by end user this api is called to provide the info related to move records.\n * @param moveInfo - It is an object that contains sourceID(the data of {@link Meta.itemKey 'itemKey'} for the given row) that user has selected to move and\n * destinationID(the data of {@link Meta.itemKey 'itemKey'} for the given row) where the user has dropped the source row.\n * @returns It should return a promise of type object that contains a refresh key if set to true, repeating structures will trigger a refresh and fetch the whole data agin using {@link ApiContext.fetchData 'fetchData'} api\n */\n moveListRecords?: (moveInfo: {\n sourceID: string;\n destinationID: string;\n }) => Promise<{ refresh: boolean }>;\n\n /**\n * This api is used to fetch the bulkActions for a repeating structures if {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * This is called on demand, when the bulk action button in repeating structures is clicked. The button will be disabled till the time at least one record is not selected in repeating structures to trigger bulk action.\n * @requireWhen {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * @invokedWhen End user clicks on 'Bulk actions' button in RS Toolbar.Once fetched it is not refetched.\n * @param {Array<string>} rowIds - The values for the given {@link Meta.itemKey 'itemKey'} for given rows.\n * @returns A promise of type Array of {@link BulkAction}\n */\n fetchActions?: (rowIds: string[]) => Promise<BulkAction[]>;\n\n /**\n * This API is used to pass utility callbacks to the consumer. Consumers can use these callbacks at any point in the lifecycle of Repeating Structures to interact with them.\n *\n * @returns {void} This function does not return any value.\n */\n addCallbacks?: (\n /**\n * @param rsUtilityCallbacks - A set of callbacks exposed by Repeating Structures, including methods for interacting with the view and managing state.\n * See {@link RsApi} for the list of available callbacks.\n *\n */\n rsUtilityCallbacks: RsApi & {\n /**\n * @deprecated This method will be removed in future versions. Please use {@link RsApi.refreshView refreshView} instead.\n *\n * It is used to trigger a force refresh the data and re-fetch selections using apiContext.getSelectedRows api (if any of the selection mode is enabled) of repeating structures\n * @returns {void} void\n */\n forceRefresh: UtilityFunctions['forceRefresh'];\n }\n ) => void;\n\n /**\n * This api passes a unique identifier to apiContext to identify a repeating structure instance. This can be used to uniquely identify a RS instance in case of multiple RS instances.\n * @requireWhen Optional\n * @invokedWhen On Repeating structures mount to share current repeating structure instance identifier.\n * @param {string} rsID - A unique identifier\n * @returns {void} void\n */\n setRsID?: (rsID: string) => void;\n\n /**\n * This api is called to fetch all the personalizations for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen On Repeating structures mount to fetch all personalizations.\n * @returns {PersonalizationResponse} It should return all the personalizations.\n */\n fetchPersonalizations?: () => Promise<PersonalizationResponse>;\n\n /**\n * This api is called to update the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user deletes a personalization.\n * @param {string} personalizationKey - Unique identifier for the personalization.\n * @param personalization - The updated personalization state.\n * @returns {void} void\n */\n updatePersonalization?: (\n personalizationKey: string,\n personalization: {\n markAsDefault?: boolean;\n markAsAppDefault?: boolean;\n name?: string;\n personalizationState?: PersonalizedState;\n }\n ) => Promise<void>;\n\n /**\n * This api is called to delete the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user deletes a personalization.\n * @param personalizationKey - Unique identifier for a personalization.\n * @returns {void} void\n */\n deletePersonalization?: (personalizationKey: string) => Promise<void>;\n\n /**\n * This api is called to create the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user create a new personalization.\n * @param {string} personalizationKey - Unique identifier for the personalization.\n * @param personalization - The personalization state to be saved\n * @returns {void} void\n */\n createPersonalization?: (\n personalizationKey: string,\n personalization: {\n markAsDefault: boolean;\n name: string;\n personalizationState: PersonalizedState;\n }\n ) => Promise<string> | Promise<{ data: string }>;\n\n /**\n * This api is used to communicate selectedRows in the repeating structures to the consumer.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen {@link Meta.selectionMode 'selectionMode'} key is set to true and whenever selection changes in RS.\n * @param {Array<RowData & { $selected: boolean }>} selectedRows The selectedRows that needs to be communicated.\n * @returns {Promise<void>} A promise\n */\n setSelectedRows?: (selectedRows: (RowData & { $selected: boolean })[]) => Promise<void>;\n\n /**\n * This api is used to get the selectedRows for the repeating structures from the consumer, to populate the selections in RS.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen {@link Meta.selectionMode 'selectionMode'} key is set to true and RS requires current selected rows from the consumer.\n * @returns {Promise<Array<string>>} A promise of type array of unique identifiers for all the row. It is value of {@link Meta.itemKey 'itemKey'}\n */\n getSelectedRows?: () => Promise<string[]>;\n\n /** This api is used to communicate the clearance of all the selectedRows for the repeating structures to the consumer.\n * This is also passed as callback to all the {@link BulkAction.onClick bulk actions 'onClick'} method with {@link ApiContext.fetchRowsData fetchRowsData} api.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen In case of {@link Meta.selectionMode \"multi\"} selection mode, while toggling all the selections OR\\\n * while switching personalizations OR\\\n * when the bulk action is submitted, this can be called by bulk actions {@link BulkAction.onClick 'onClick'} method by RS consumer.\n * @returns {Promise<void>} A promise\n */\n clearSelectedRows?: () => Promise<void>;\n\n /**\n * This api is used to fetch the hierarchical groups for an RS if {@link FieldDef.hierarchicalInfo 'hierarchicalInfo'} key is set to true for at least one FieldDef.\n * @requireWhen {@link FieldDef.hierarchicalInfo 'hierarchicalInfo'} key is set to true for at least one FieldDef\n * @invokedWhen Any change in filters, search criteria, hierarchichal groups, aggregations is detected in RS state or personalizations are toggled.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @returns {HierarchicalGroupedInfo[]} - It should return a promise of type array of all the {@link HierarchicalGroupedInfo } for the specific field. It can also include nested hierarchical groups in children key.\n */\n fetchHierarchicalGroupedInfo?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<HierarchicalGroupedInfo[]>;\n\n /**\n * This api is used to communicate repeating structure state to the consumer. It also includes visibleColumns apart from regular repeating structure state.\n * @requireWhen Optional\n * @invokedWhen After any action performed on Repeating structures that results in updating of state.\n * @param state Repeating structure state\n * @returns {void} void\n */\n stateUpdateCallback?: (state: PersonalizedState & { visibleColumns?: string[] }) => void;\n\n /**\n * This api is used to communicate repeating structure state to the consumer. It also includes active personalization in RS apart from regular repeating structure state.\n * @requireWhen Optional\n * @param state Repeating structure state\n * @returns {void} void\n */\n setComponentState?: (state: PersonalizedState & { activePersonalization?: string }) => void;\n /**\n * This api is used to communicate repeating structure state to RS from consumer.\n * @requireWhen Optional\n * @returns RS state.\n */\n getComponentState?: () => Promise<PersonalizedState & { activePersonalization?: string }>;\n /** This api is called on click of 'Import data' option in repeating structures toolbar and should open a modal to allow import of data from a CSV file.\n * @requireWhen {@link Meta.showImportDataOption showImportDataOption} is set to true in Meta.\n * @invokedWhen \"Import data\" button is clicked in the repeating structures toolbar\n * @param {ModalManagerContextValue['create']} create - The function to create a modal in the current context {@link ModalManagerContextValue['create']}.\n * @returns {void} void\n */\n importCSVData?: (create: ModalManagerContextValue['create']) => Promise<void>;\n /** This api is called on click of 'Export to excel' option in repeating structures toolbar and should export the data into a excel file.\n * @requireWhen {@link Meta.showExportToExcelOption showExportToExcelOption} is set to true in Meta.\n * @invokedWhen \"Export to excel\" button is clicked in the repeating structures toolbar\n * @param {State} rsState - Current repeating structures state {@link State}.\n * @param {Meta} rsMeta - Repeating structures meta {@link Meta}.\n * @returns {void} void\n */\n exportData?: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<void>;\n\n /** This api is called on click of 'Export to CSV' option in repeating structures toolbar and should export the data into a CSV file.\n * @requireWhen {@link Meta.showExportToCSVOption showExportToCSVOption} is set to true in Meta.\n * @invokedWhen \"Export to CSV\" button is clicked in the repeating structures toolbar\n * @param {State} rsState - Current repeating structures state {@link State}.\n * @param {Meta} rsMeta - Repeating structures meta {@link Meta}.\n * @returns {void} void\n */\n exportDataToCSV?: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<void>;\n\n /** This api is used to communicate source and destinaltion row keys to apiContext during row-reordering operation.\n * @requireWhen {@link Meta.reorderItems reorderItems} is set to true and {@link Meta.moveListRecords moveListRecords} is set to false in Meta.\n * @invokedWhen Reordering operations is being performed on rows.\n * @param {string} sourceKey - the value of {@link Meta.itemKey 'itemKey'} for the given row that user has selected to move.\n * @param {string} destinationKey - the value of {@link Meta.itemKey 'itemKey'} for the given row where the user has dropped the source row.\n * @returns {void} void\n */\n applyRowReorder?: (sourceKey: string, destinationKey: string) => Promise<void>;\n\n /**\n * This API allows Repeating Structures to determine if a given `data` meets a specified `condition`. It is utilized in the following features if provided:\n * - `Conditional Formatting` - Optional. If `evaluateCondition` is not provided, Repeating Structures will evaluate the row condition on their own. Otherwise, this function will be used.\n *\n * @param {State} rsState - The state of the Repeating Structures.\n * @param {Meta} rsMeta - The meta information of the Repeating Structures.\n * @param {ConditionConfig} config - The configuration for the condition.\n * @returns {Promise<boolean> | boolean} - Returns `true` if the data satisfies the condition, otherwise `false`.\n */\n evaluateCondition?: (rsState: State, rsMeta: Meta, config: ConditionConfig) => boolean;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ApiContext.types.js","sourceRoot":"","sources":["../../types/ApiContext.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ModalManagerContextValue } from '@pega/cosmos-react-core/lib/components/Modal/Modal.types';\nimport type { Condition } from '@pega/cosmos-react-condition-builder';\n\nimport type { RowData } from '../src/core/generators/RowGenerator.types';\nimport type { UtilityFunctions } from '../src/core/generators/viewUtilityMethods';\n\nimport type {\n Personalization,\n PersonalizationInfo,\n PersonalizedState,\n State,\n Group\n} from './State.types';\nimport type { Meta, RowAction, FieldDef } from './Meta.types';\n\n/**\n * Represents information about the currently active view in the repeating structures.\n */\ntype ActiveViewInfo = {\n /**\n * The unique identifier of the active view.\n */\n id: string | undefined;\n\n /**\n * The name of the active view.\n */\n name: string | undefined;\n\n /**\n * Indicates whether the active view has unsaved changes.\n */\n isDirty: boolean;\n};\n\nexport type RsApi = {\n /**\n * Refreshes the current view.\n * @see {@link UtilityFunctions.refreshView}\n */\n refreshView: UtilityFunctions['forceRefresh'];\n\n /**\n * Sets the record count in the view.\n * @see {@link UtilityFunctions.setRecordCount}\n */\n setRecordCount: UtilityFunctions['setRecordCount'];\n\n /**\n * Dispatches an action to the repeating structures with an payload.\n * @see {@link UtilityFunctions.dispatchAction}\n */\n dispatchAction: UtilityFunctions['dispatchAction'];\n\n /**\n * Retrieves information about the currently active view.\n * @returns The {@link ActiveViewInfo active view information} or `void` if unavailable.\n */\n getActiveViewInfo: () => ActiveViewInfo | void;\n\n /**\n * Sets hidden columns of the view.\n * @param columns - An array of column IDs to hide.\n * @param ootbColumns - .\n * @param ootbColumns.dragHandle - Whether to hide the drag-and-drop column.\n */\n setHiddenColumns?: (columns: string[], ootbColumns?: { dragHandle: boolean }) => void;\n\n /**\n * Sets Column order of the view.\n * @param columns - An array of column IDs to reorder.\n */\n setColumnOrder?: (columns: string[]) => void;\n\n /**\n * Sets the filters of the view.\n * @param filter - The filter condition to apply.\n */\n setFilter: (filter: Condition) => void;\n\n /**\n * Sets the groups of the view.\n * @param groups - The grouping configuration.\n */\n setGrouping?: (groups: Group[]) => void;\n\n /**\n * Sets the sorting order of the view.\n * @param {NonNullable<State['sortingOrder']>} sorts - The sorting configuration.\n */\n setSorting: (sorts: NonNullable<State['sortingOrder']>) => void;\n\n /**\n * Sets the column aliases of the view.\n * @param aliases - The column alias configuration.\n */\n setAliases: (aliases: State['columnAlias']) => void;\n\n /**\n * Sets the aggregation information of the view.\n * @param {State['aggregationInfo']} agg - The aggregation configuration.\n */\n setAggregations: (agg: State['aggregationInfo']) => void;\n\n /**\n * Sets the visibility of the row reorder field.\n * @param {boolean} visibility - Whether the row reorder field should be visible.\n */\n setRowReorderFieldVisibility: (visibility: boolean) => void;\n\n /**\n * Updates the visibility of specific columns.\n * @param {Object} columns - A mapping of column IDs to their visibility state.\n */\n updateColumnsVisibility: (columns: { [key: FieldDef['id']]: boolean }) => void;\n\n /**\n * Sets the conditional style formats of the view.\n * @param conditionalStyleFormats - The conditional style formats to apply.\n */\n setConditionalStyleFormats: (\n conditionalStyleFormats: NonNullable<State['conditionalStyleFormats']>\n ) => void;\n};\n\nexport interface ApiOptions {\n signal?: AbortSignal;\n /** Indicates current api triggered should invalidate the cache if any and reload the data. */\n invalidateCache?: boolean;\n /** A unique token or version identifier that changes whenever a refresh is triggered. Unlike a boolean `invalidateCache` flag, the `invalidateCacheToken` ensures that multiple APIs triggered\n in the same refresh cycle receive the same identifier. */\n invalidateCacheToken?: number;\n}\n// Aggregation response type\ntype AggregationTypeResp = 'avg' | 'max' | 'min' | 'nonNullCount' | 'sum';\n/** An object with key equal to {@link AggregationTypeResp aggregation type} and value is equal to the actual value of that aggregation type */\ntype AggregationOptions = {\n [agg in AggregationTypeResp]?: number | null;\n};\n/** An object where key is equal to the column id (i.e. {@link FieldDef.id id} in FieldDef) and value is equal to its {@link AggregationOptions Aggregation values} */\nexport type AggregationResp = {\n [columnId: string]: AggregationOptions;\n};\n\n// Grouping response type\nexport interface GroupedInfo {\n /** Value for the current group node. */\n name: null | string | number | boolean | Date; // Value for the current node\n /** # of data rows in this node */\n count: number;\n /** An optional data row from the group node that is used to process extra information required by group node */\n data?: RowData;\n /** Aggregation values of a column if applied */\n agg?: AggregationResp;\n /** Nested groups within the parent group node */\n children?: GroupedInfo[];\n}\n\nexport interface HierarchicalGroupedInfo extends Pick<GroupedInfo, 'count' | 'agg'> {\n info: RowData;\n children?: HierarchicalGroupedInfo[];\n}\n\nexport type AggregateValueResponse = {\n [columnId: string]: number | null;\n};\n/** An object where key is equal to column id i.e. {@link FieldDef.id id key in fieldDef} and value is equal to the aggregation value for the given aggregation */\nexport type AggregationResult = {\n [columnId: string]: number;\n};\n\nexport interface FetchDataResponse {\n /** An array of {@link RowData} */\n data: RowData[];\n /** An optional parameter to provide the total record count for a given Repeating structures with a given filter criteria in the query. If not provided, use callback setRecordCount */\n totalRecordCount?: number;\n /** @deprecated An optional parameter to provide the total record count for a given Repeating structures with a given filter criteria in the query. If not provided, use callback setRecordCount */\n filteredRecordCount?: number;\n}\n\ntype BulkAction = Pick<RowAction, 'id' | 'text'> & {\n /**\n * @param rowIds - The values for the {@link Meta.itemKey 'itemkey'} for given rows.\n * @param clearSelectionAndRefreshRowsCallback - A callback used to trigger deselection of all the selected rows and then call\n * {@link ApiContext.fetchRowsData 'fetchRowsData'} api of to fetch latest data for given rows, after action is completed.\n * @return {void} - void\n */\n onClick: (rowIds: string[], clearSelectionAndRefreshRowsCallback: () => void) => void;\n};\n\ninterface ConditionConfig {\n condition: Condition;\n data: RowData;\n}\n\nexport type PersonalizationResponse = Pick<Personalization, 'defaultPersonalization'> & {\n allPersonalizations: {\n [personalizationKey: string]: Pick<PersonalizationInfo, 'name'> & {\n personalizationState: PersonalizedState;\n };\n };\n};\n\nexport interface ApiContext {\n /**\n * This api is used to fetch a list of raw data rows (excluding aggregations) for a given group or at the top level when no groups.\n *Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#29) documentation** for more details.\n * @requireWhen Always\n * @invokedWhen filters are changed OR\\\n * search criteria is changed OR\\\n end user scrolls through the RS records OR\\\n sorting is changed OR\\\n forceRefresh is triggered by consumer OR\\\n groups are changed OR\\\n hierarchicalGroups are changed OR\\\n hiddenColumns are changed\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to build the criteria for query(e.g. filter, sort, group criteria, paginationOptions).\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields for which data needs to be fetched.\n * @param {ApiOptions} apiOptions - Extra api options provided by repeating structures,\n * for instance, abort signal handler is sent which can be attached to the native fetch call or any framework like axios. Repeating structures will use to cancel the api calls which might be using stale state, e.g. in case of progressive scroll.\n * @returns {Promise<FetchDataResponse>} - It should return a promise of type {@link FetchDataResponse} that should contain data as one key of type Array<{@link RowData}> to provide data for given query.\n */\n fetchData: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<FetchDataResponse>;\n\n /**\n * This api is used to fetch details for any group/sub-group ribbons in the RS. Should return labels, counts, aggregation values at each group node.This can sometimes be called even when there are no groups. Avoid running into exceptions in those cases.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#59) documentation** for more details.\n * @requireWhen {@link Meta.grouping 'grouping'} key is set to true in\n * @invokedWhen Grouping is applied on any {@link FieldDef fieldDef} OR\\\n * filters are changed OR\\\n * search criteria is changed OR\\\n * personalization is toggled. OR\\\n * aggregation is changed OR\\\n * hiddenColumns are changed OR\\\n * forceRefresh of RS is triggered by consumer.\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to build the criteria for query. For e.g. use rsState.groups and rsState.aggregationInfo to determine the query.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields info for which data needs to be fetched.\n * @returns {GroupedInfo[]} - It should return a promise of type array of all the {@link GroupedInfo } for the specific field. It can also include nested groups in children key.\n */\n fetchGroupedInfo?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<GroupedInfo[]>;\n\n /**\n * This api is used to fetch aggregation results for a given aggregation type(sum/min/max/count) on a field. This is called when aggregations are configured on one or more column.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#84) documentation** for more details.\n * @requireWhen {@link FieldDef.aggregation 'aggregation'} key is set to true for at least one FieldDef AND {@link FieldDef.type 'type'} key in FieldDef should be of number for that particular fieldDef.\n * @invokedWhen When aggregation is applied on any {@link FieldDef fieldDef} OR\\\n * filters are changed OR\\\n * search criteria is changed OR\\\n * personalization is toggled. OR\\\n * hiddenColumns are changed.\n * @param {State} rsState - Current repeating structures {@link State}. Majorly used to get current aggregations applied on the RS from aggregationInfo key in state. Apart from this current filters and search criteria can also be picked from state.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}. Majorly used to determine the fields for which data needs to be fetched.\n * @returns {Promise<AggregationResult>} - It should return a promise of type {@link AggregationResult}\n */\n fetchAggregatedValues?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<AggregationResult>;\n\n /**\n * This api is used to fetch unique values available for a particular field. It is generally called for a field which has {@link FieldDef.filterPickList filterPickList} key set to true.The unique values are presented to the user while filtering.\n * Refer **[apiContext](https://git.pega.io/projects/PS/repos/ui-lists-lib/browse/docs/apiContext.md?useDefaultHandler=true#99) documentation** for more details.\n * @requireWhen {@link FieldDef.filterPickList filterPickList} key set to true for at least one FieldDef\n * @invokedWhen Picklist Filter is invoked by end user from FieldDef header action menu.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {string} columnId - This is equal to { @link FieldDef.id 'id'} key of the field for which unique values needs to be fetched.\n * @returns {Promise<Array<string | number | boolean | Date>>} It should return a promise of type array of unique values for a given fieldDef id.\n */\n fetchUniqueColValues?: (\n rsState: State,\n rsMeta: Meta,\n columnId: string,\n apiOptions: ApiOptions\n ) => Promise<(string | number | boolean | Date)[]>;\n\n /**\n * This api is used to fetch the latest data for a given row identified uniquely by {@link FieldDef.itemKey itemKey}.\n * @requireWhen {@link Meta.editing 'editing'} OR {@link Meta.deleting 'deleting'} is set to true\n * @invokedWhen A {@link Meta.rowActions rowAction} is submitted by consumer of RS, as part of {@link RowAction. rowAction.onClick} 'refresRow' callback.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {string} key - A unique identifier for a given row. This is equal to {@link Meta.itemKey 'itemKey'}\n * @param {string} value - The value for the given {@link Meta.itemKey 'itemKey'} for given row.\n * @returns {Promise<RowData[]>} It should return a promise of type {@link RowData} array containing the data for a given row.Only 0th index is considered from the array.\n */\n fetchRowData?: (\n rsState: State,\n rsMeta: Meta,\n key: string,\n value: string,\n apiOptions: ApiOptions\n ) => Promise<RowData[]>;\n\n /**\n * This api is used to fetch the latest data for given set of rows identified uniquely by itemKey in {@link FieldDef}. This is passed as callback to all the {@link BulkAction.onClick bulk actions 'onClick'} method with {@link ApiContext.clearSelectedRows clearSelectedRows} api.\n * @requireWhen {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * @invokedWhen The bulk action is submitted, this can be called by bulk actions {@link BulkAction.onClick 'onClick'} method by RS consumer.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param {Array<string | number | boolean | Date>} rowIds - The values for the given {@link Meta.itemKey 'itemKey'} for given rows.\n * @param itemKey - A unique identifier for a given row. This is equal to {@link Meta.itemKey 'itemKey'}\n * @returns {Promise<RowData[]>} It should return a promise of type {@link RowData} array containing the data for given rows.\n */\n fetchRowsData?: (\n rsState: State,\n rsMeta: Meta,\n rowIds: string[],\n itemKey: string,\n apiOptions: ApiOptions\n ) => Promise<RowData[]>;\n\n /**\n * This api is used to fetch the actions that is supported on rows of Repeating Structure. It is generally called when {@link Meta.editing 'editing'} is set to true.\n * @requireWhen {@link Meta.editing 'editing'} OR {@link Meta.deleting 'deleting'} is set to true\n * @invokedWhen The end user clicks on 'RowActionMenu'.Once fetched it is not refetched.\n * @param {} uniqueKey - A unique identifier for a given row. This is equal to value for {@link Meta.itemKey 'itemKey'} in {@link RowData} data.\n * @returns - A promise of type Array of {@link RowAction}\n */\n fetchRowActionDetails?: (uniqueKey: string, rowContext: RowData) => Promise<RowAction[]>;\n\n /**\n * This api is used to submit the updated row data to apiContext. It is generally called when {@link FieldDef.editable 'editable'} key is set to true for at least one FieldDef to enable inline editing for a cell.\n * @requireWhen {@link FieldDef.editable 'editable'} key is set to true for at least one FieldDef.\n * @invokedWhen The end user is done editing the cell using inline editing.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @param dataToSubmit - Updated row data to be submitted to apiContext\n * @returns It should return a promise of type {@link RowData} with the updated contents that is passed in {@link dataToSubmit} param.\n */\n submitData?: (\n rsState: State,\n rsMeta: Meta,\n dataToSubmit: RowData\n ) => Promise<{ rowData: RowData }>;\n\n /**\n * This api is used to submit moved records in a repeating structure. It is called when {@link Meta.moveListRecords 'moveListRecords'} is set to true. Repeating structure allow moving of records based on it's value.\n * @requireWhen {@link Meta.moveListRecords 'moveListRecords'} is set to true\n * @invokedWhen The move process is completed by end user this api is called to provide the info related to move records.\n * @param moveInfo - It is an object that contains sourceID(the data of {@link Meta.itemKey 'itemKey'} for the given row) that user has selected to move and\n * destinationID(the data of {@link Meta.itemKey 'itemKey'} for the given row) where the user has dropped the source row.\n * @returns It should return a promise of type object that contains a refresh key if set to true, repeating structures will trigger a refresh and fetch the whole data agin using {@link ApiContext.fetchData 'fetchData'} api\n */\n moveListRecords?: (moveInfo: {\n sourceID: string;\n destinationID: string;\n }) => Promise<{ refresh: boolean }>;\n\n /**\n * This api is used to fetch the bulkActions for a repeating structures if {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * This is called on demand, when the bulk action button in repeating structures is clicked. The button will be disabled till the time at least one record is not selected in repeating structures to trigger bulk action.\n * @requireWhen {@link Meta.allowBulkActions 'allowBulkActions'} is set to true.\n * @invokedWhen End user clicks on 'Bulk actions' button in RS Toolbar.Once fetched it is not refetched.\n * @param {Array<string>} rowIds - The values for the given {@link Meta.itemKey 'itemKey'} for given rows.\n * @returns A promise of type Array of {@link BulkAction}\n */\n fetchActions?: (rowIds: string[]) => Promise<BulkAction[]>;\n\n /**\n * This API is used to pass utility callbacks to the consumer. Consumers can use these callbacks at any point in the lifecycle of Repeating Structures to interact with them.\n *\n * @returns {void} This function does not return any value.\n */\n addCallbacks?: (\n /**\n * @param rsUtilityCallbacks - A set of callbacks exposed by Repeating Structures, including methods for interacting with the view and managing state.\n * See {@link RsApi} for the list of available callbacks.\n *\n */\n rsUtilityCallbacks: RsApi & {\n /**\n * @deprecated This method will be removed in future versions. Please use {@link RsApi.refreshView refreshView} instead.\n *\n * It is used to trigger a force refresh the data and re-fetch selections using apiContext.getSelectedRows api (if any of the selection mode is enabled) of repeating structures\n * @returns {void} void\n */\n forceRefresh: UtilityFunctions['forceRefresh'];\n }\n ) => void;\n\n /**\n * This api passes a unique identifier to apiContext to identify a repeating structure instance. This can be used to uniquely identify a RS instance in case of multiple RS instances.\n * @requireWhen Optional\n * @invokedWhen On Repeating structures mount to share current repeating structure instance identifier.\n * @param {string} rsID - A unique identifier\n * @returns {void} void\n */\n setRsID?: (rsID: string) => void;\n\n /**\n * This api is called to fetch all the personalizations for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen On Repeating structures mount to fetch all personalizations.\n * @returns {PersonalizationResponse} It should return all the personalizations.\n */\n fetchPersonalizations?: () => Promise<PersonalizationResponse>;\n\n /**\n * This api is called to update the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user deletes a personalization.\n * @param {string} personalizationKey - Unique identifier for the personalization.\n * @param personalization - The updated personalization state.\n * @returns {void} void\n */\n updatePersonalization?: (\n personalizationKey: string,\n personalization: {\n markAsDefault?: boolean;\n markAsAppDefault?: boolean;\n name?: string;\n personalizationState?: PersonalizedState;\n }\n ) => Promise<void>;\n\n /**\n * This api is called to delete the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user deletes a personalization.\n * @param personalizationKey - Unique identifier for a personalization.\n * @returns {void} void\n */\n deletePersonalization?: (personalizationKey: string) => Promise<void>;\n\n /**\n * This api is called to create the personalization for a repeating structure.\n * @requireWhen {@link Meta.personalization 'personalization'} key is set to true.\n * @invokedWhen End user create a new personalization.\n * @param {string} personalizationKey - Unique identifier for the personalization.\n * @param personalization - The personalization state to be saved\n * @returns {void} void\n */\n createPersonalization?: (\n personalizationKey: string,\n personalization: {\n markAsDefault: boolean;\n name: string;\n personalizationState: PersonalizedState;\n }\n ) => Promise<string> | Promise<{ data: string }>;\n\n /**\n * This api is used to communicate selectedRows in the repeating structures to the consumer.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen {@link Meta.selectionMode 'selectionMode'} key is set to true and whenever selection changes in RS.\n * @param {Array<RowData & { $selected: boolean }>} selectedRows The selectedRows that needs to be communicated.\n * @returns {Promise<void>} A promise\n */\n setSelectedRows?: (selectedRows: (RowData & { $selected: boolean })[]) => Promise<void>;\n\n /**\n * This api is used to get the selectedRows for the repeating structures from the consumer, to populate the selections in RS.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen {@link Meta.selectionMode 'selectionMode'} key is set to true and RS requires current selected rows from the consumer.\n * @returns {Promise<Array<string>>} A promise of type array of unique identifiers for all the row. It is value of {@link Meta.itemKey 'itemKey'}\n */\n getSelectedRows?: () => Promise<string[]>;\n\n /** This api is used to communicate the clearance of all the selectedRows for the repeating structures to the consumer.\n * This is also passed as callback to all the {@link BulkAction.onClick bulk actions 'onClick'} method with {@link ApiContext.fetchRowsData fetchRowsData} api.\n * @requireWhen {@link Meta.selectionMode 'selectionMode'} key is set to true.\n * @invokedWhen In case of {@link Meta.selectionMode \"multi\"} selection mode, while toggling all the selections OR\\\n * while switching personalizations OR\\\n * when the bulk action is submitted, this can be called by bulk actions {@link BulkAction.onClick 'onClick'} method by RS consumer.\n * @returns {Promise<void>} A promise\n */\n clearSelectedRows?: () => Promise<void>;\n\n /**\n * This api is used to fetch the hierarchical groups for an RS if {@link FieldDef.hierarchicalInfo 'hierarchicalInfo'} key is set to true for at least one FieldDef.\n * @requireWhen {@link FieldDef.hierarchicalInfo 'hierarchicalInfo'} key is set to true for at least one FieldDef\n * @invokedWhen Any change in filters, search criteria, hierarchichal groups, aggregations is detected in RS state or personalizations are toggled.\n * @param {State} rsState - Current repeating structures {@link State}.\n * @param {Meta} rsMeta - Repeating structures {@link Meta}.\n * @returns {HierarchicalGroupedInfo[]} - It should return a promise of type array of all the {@link HierarchicalGroupedInfo } for the specific field. It can also include nested hierarchical groups in children key.\n */\n fetchHierarchicalGroupedInfo?: (\n rsState: State,\n rsMeta: Meta,\n apiOptions: ApiOptions\n ) => Promise<HierarchicalGroupedInfo[]>;\n\n /**\n * This api is used to communicate repeating structure state to the consumer. It also includes visibleColumns apart from regular repeating structure state.\n * @requireWhen Optional\n * @invokedWhen After any action performed on Repeating structures that results in updating of state.\n * @param state Repeating structure state\n * @returns {void} void\n */\n stateUpdateCallback?: (state: PersonalizedState & { visibleColumns?: string[] }) => void;\n\n /**\n * This api is used to communicate repeating structure state to the consumer. It also includes active personalization in RS apart from regular repeating structure state.\n * @requireWhen Optional\n * @param state Repeating structure state\n * @returns {void} void\n */\n setComponentState?: (state: PersonalizedState & { activePersonalization?: string }) => void;\n /**\n * This api is used to communicate repeating structure state to RS from consumer.\n * @requireWhen Optional\n * @returns RS state.\n */\n getComponentState?: () => Promise<PersonalizedState & { activePersonalization?: string }>;\n /** This api is called on click of 'Import data' option in repeating structures toolbar and should open a modal to allow import of data from a CSV file.\n * @requireWhen {@link Meta.showImportDataOption showImportDataOption} is set to true in Meta.\n * @invokedWhen \"Import data\" button is clicked in the repeating structures toolbar\n * @param {ModalManagerContextValue['create']} create - The function to create a modal in the current context {@link ModalManagerContextValue['create']}.\n * @returns {void} void\n */\n importCSVData?: (create: ModalManagerContextValue['create']) => Promise<void>;\n /** This api is called on click of 'Export to excel' option in repeating structures toolbar and should export the data into a excel file.\n * @requireWhen {@link Meta.showExportToExcelOption showExportToExcelOption} is set to true in Meta.\n * @invokedWhen \"Export to excel\" button is clicked in the repeating structures toolbar\n * @param {State} rsState - Current repeating structures state {@link State}.\n * @param {Meta} rsMeta - Repeating structures meta {@link Meta}.\n * @returns {void} void\n */\n exportData?: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<void>;\n\n /** This api is called on click of 'Export to CSV' option in repeating structures toolbar and should export the data into a CSV file.\n * @requireWhen {@link Meta.showExportToCSVOption showExportToCSVOption} is set to true in Meta.\n * @invokedWhen \"Export to CSV\" button is clicked in the repeating structures toolbar\n * @param {State} rsState - Current repeating structures state {@link State}.\n * @param {Meta} rsMeta - Repeating structures meta {@link Meta}.\n * @returns {void} void\n */\n exportDataToCSV?: (rsState: State, rsMeta: Meta, apiOptions: ApiOptions) => Promise<void>;\n\n /** This api is used to communicate source and destinaltion row keys to apiContext during row-reordering operation.\n * @requireWhen {@link Meta.reorderItems reorderItems} is set to true and {@link Meta.moveListRecords moveListRecords} is set to false in Meta.\n * @invokedWhen Reordering operations is being performed on rows.\n * @param {string} sourceKey - the value of {@link Meta.itemKey 'itemKey'} for the given row that user has selected to move.\n * @param {string} destinationKey - the value of {@link Meta.itemKey 'itemKey'} for the given row where the user has dropped the source row.\n * @returns {void} void\n */\n applyRowReorder?: (sourceKey: string, destinationKey: string) => Promise<void>;\n\n /**\n * This API allows Repeating Structures to determine if a given `data` meets a specified `condition`. It is utilized in the following features if provided:\n * - `Conditional Formatting` - Optional. If `evaluateCondition` is not provided, Repeating Structures will evaluate the row condition on their own. Otherwise, this function will be used.\n *\n * @param {State} rsState - The state of the Repeating Structures.\n * @param {Meta} rsMeta - The meta information of the Repeating Structures.\n * @param {ConditionConfig} config - The configuration for the condition.\n * @returns {Promise<boolean> | boolean} - Returns `true` if the data satisfies the condition, otherwise `false`.\n */\n evaluateCondition?: (rsState: State, rsMeta: Meta, config: ConditionConfig) => boolean;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-core",
|
|
3
|
-
"version": "9.0.0-build.
|
|
3
|
+
"version": "9.0.0-build.3.1",
|
|
4
4
|
"description": "Core headless UI library that the users can use to write their own UI and create repeating structures like table, gallery, timeline etc.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "9.0.0-build.
|
|
18
|
-
"@pega/cosmos-react-core": "9.0.0-build.
|
|
19
|
-
"@pega/cosmos-react-work": "9.0.0-build.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "9.0.0-build.3.1",
|
|
18
|
+
"@pega/cosmos-react-core": "9.0.0-build.3.1",
|
|
19
|
+
"@pega/cosmos-react-work": "9.0.0-build.3.1",
|
|
20
20
|
"@types/lodash.get": "^4.4.9",
|
|
21
21
|
"@types/uuid": "^9.0.0",
|
|
22
22
|
"dayjs": "^1.11.13",
|