@pega/lists-core 9.0.0-build.6.1 → 9.0.0-build.6.11
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/features/uIFeatures/beforeRender/grouping.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js +4 -6
- package/lib/src/core/features/uIFeatures/beforeRender/grouping.js.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.d.ts.map +1 -1
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js +2 -1
- package/lib/src/core/features/uIFeatures/beforeRender/stateHydration.js.map +1 -1
- package/lib/src/core/features/uIFeatures/index.d.ts.map +1 -1
- package/lib/src/core/generators/ColumnGenerator.types.d.ts +1 -1
- package/lib/src/core/generators/ColumnGenerator.types.d.ts.map +1 -1
- package/lib/src/core/generators/ColumnGenerator.types.js.map +1 -1
- package/lib/src/core/generators/GroupGenerator.d.ts +4 -1
- package/lib/src/core/generators/GroupGenerator.d.ts.map +1 -1
- package/lib/src/core/generators/GroupGenerator.js +4 -1
- package/lib/src/core/generators/GroupGenerator.js.map +1 -1
- package/lib/src/core/generators/viewUtilityMethods.js +3 -3
- package/lib/src/core/generators/viewUtilityMethods.js.map +1 -1
- package/lib/src/core/reducers/error.d.ts.map +1 -1
- package/lib/src/core/reducers/index.d.ts.map +1 -1
- package/lib/types/ApiContext.types.d.ts +21 -1
- package/lib/types/ApiContext.types.d.ts.map +1 -1
- package/lib/types/ApiContext.types.js.map +1 -1
- package/lib/types/Meta.types.d.ts +3 -1
- package/lib/types/Meta.types.d.ts.map +1 -1
- package/lib/types/Meta.types.js.map +1 -1
- package/lib/types/State.types.d.ts +20 -1
- package/lib/types/State.types.d.ts.map +1 -1
- package/lib/types/State.types.js.map +1 -1
- package/lib/types.d.ts +4 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
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,EAAE;gBAClE,GAAG,CAAC,UAAU,EAAE,CAAC,iBAAiB,IAAI;oBACpC,eAAe,EAAE,IAAI;oBACrB,oBAAoB,EAAE,UAAU,EAAE,CAAC,YAAY;iBAChD,CAAC;aACH,CAAC;iBACD,KAAK,CAAC,GAAG,CAAC,EAAE;gBACX,kBAAkB,EAAE,CAAC,QAAQ,CAC3B,OAAO,CAAC,qBAAqB,CAAC;oBAC5B,OAAO,EAAE,GAAG;iBACb,CAAC,CACH,CAAC;YACJ,CAAC,CAAC,CAAC;QACP,CAAC;QAED;;;WAGG;QACH,WAAW;YACT,OAAO,UAAU,EAAE;iBAChB,UAAU,CAAC,eAAe,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,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;iBACD,KAAK,CAAC,GAAG,CAAC,EAAE;gBACX,kBAAkB,EAAE,CAAC,QAAQ,CAC3B,OAAO,CAAC,qBAAqB,CAAC;oBAC5B,OAAO,EAAE,GAAG;iBACb,CAAC,CACH,CAAC;YACJ,CAAC,CAAC,CAAC;QACP,CAAC;QAED;;;WAGG;QACH,uBAAuB,CAAC,OAA2C;YACjE,kBAAkB,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,CAAC;QAED,0BAA0B,CACxB,uBAAsE;YAEtE,kBAAkB,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC7F,CAAC;KACF,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\nimport type { ModalManagerContextValue } from '@pega/cosmos-react-core/lib/components/Modal/Modal.types';\n\nimport type RsInternal from '../RsInternal';\nimport ActionTypes from '../actions/actionConstants';\nimport * as actions from '../actions/actions';\nimport { rowSelectColumnMeta } from '../constants';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { SUPPORTED_AVOIDABLE_FEATURES, SUPPORTED_FLUSH_KEYS } from '../constants';\nimport { validateAction, passablePromise, deepCopy } from '../utils/util';\nimport type { Errors, State } from '../../../types/State.types';\n// This is being used in JSdoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions } from '../../../types/ApiContext.types';\n// This is being used in JSdoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { FieldDef, Meta, ROW_DENSITY } from '../../../types/Meta.types';\nimport type {\n ActionMeta,\n ApplyAliasesActionPayload,\n ColumnFilteringActionPayload,\n ExpandCollapsePayload,\n PaginationPayload\n} from '../actions/actions.types';\n\nimport type View from './ViewGenerator';\nimport type { RowData } from './RowGenerator.types';\nimport type { DebugInfo, RefreshNotification, RequiredDefinition } from './ViewGenerator.types';\n\nexport type RefreshNotificationForConsumer = OmitStrict<RefreshNotification, 'id'>;\n\nexport type SupportedConsumerPayloads = {\n [ActionTypes.USER_CONFIRMATION_ACTION]: OmitStrict<\n NonNullable<View['confirmationActionDetails']>,\n 'onSubmit' | 'onCancel'\n >;\n [ActionTypes.UPDATE_DEBUG_INFO]: DebugInfo;\n [ActionTypes.TOGGLE_DISABLE_SELECTION]: boolean;\n [ActionTypes.TOGGLE_REQUIRED]: RequiredDefinition;\n [ActionTypes.NOTIFY_DATA_REFRESH]: RefreshNotificationForConsumer;\n [ActionTypes.SET_IN_EXTERNAL_STATE]: NonNullable<State['externalState']>;\n [ActionTypes.UPDATE_SELECTED_ROWS]: undefined;\n};\n\nexport type SupportedConsumerActionType = keyof SupportedConsumerPayloads;\n\nfunction syncData(key: string, sourceArray: RowData[], modifiedArray: RowData[]) {\n return sourceArray.map(item => {\n const item2 = modifiedArray.find(i2 => i2[key] === item[key]);\n return item2 || item;\n });\n}\n\nexport default function viewUtilityMethods(rsInternal: RsInternal) {\n const { getRsProps, getRsStateResolver, getView, getRsStore } = rsInternal;\n\n const utilMethods = {\n /**\n * Dispatches an action that creates a new state object without any internal modifications.\n *\n * If {@link instantRender} is false and {@link forceUpdateFeatures} are provided,\n * it updates the {@link State.forceUpdateFeatures forceUpdateFeatures} slice in the state.\n *\n * @param instantRender - Determines if the render should happen instantly.\n * @param forceUpdateFeatures - The features to force update in the state on next render cycle.\n */\n forceUpdate(instantRender?: boolean, forceUpdateFeatures?: State['forceUpdateFeatures']) {\n getRsStateResolver().dispatch(actions.actionForceUpdate(instantRender, forceUpdateFeatures));\n },\n\n /**\n * Handles the reordering of rows.\n *\n * If {@link Meta.moveListRecords moveListRecords} is set to true in Meta, it dispatches an action\n * that updates the keys of the {@link sourceKey source} row and the {@link destinationKey destination} row\n * in the {@link State.sourceKey sourceKey} and {@link State.destinationKey destinationKey} state slices, respectively.\n *\n * Otherwise, it calls {@link ApiContext.applyRowReorder applyRowReorder} from the apiContext and triggers\n * a {@link utilMethods.forceRefresh forceRefresh} on the state.\n *\n * @param sourceKey - The itemKey for the row being dragged.\n * @param destinationKey - The itemKey for the row on which it is dropped.\n * @returns\n */\n handleRowReorder(sourceKey: string, destinationKey: string) {\n if (getView()?.meta?.moveListRecords) {\n getRsStateResolver().dispatch(\n actions.actionMoveRecordKeysUpdate({\n sourceKey,\n destinationKey\n })\n );\n return;\n }\n getRsProps()\n .apiContext.applyRowReorder?.(sourceKey, destinationKey)\n .then(() => {\n utilMethods.forceRefresh();\n });\n },\n\n /**\n * Sets the count-related information onto the {@link View view} via {@link View.setProp setProp} and triggers {@link utilMethods.forceUpdate forceUpdate}.\n *\n * @param args - The count information object.\n * @param args.count - The total record count of the view, including group headers.\n * @param args.hasMoreResults - Indicates if the view has more records.\n * @param args.selectedRecordsCount - The total count of selected records.\n * @param args._countGeneratedInternally - Indicates if the count is generated internally. This is used for RS core internal purposes. Setting this from apiContext might lead to erroneous behavior.\n * @returns void\n */\n setRecordCount({\n count,\n hasMoreResults,\n selectedRecordsCount,\n _countGeneratedInternally,\n announce\n }: {\n count?: View['resultsCount'];\n hasMoreResults?: View['hasMoreResults'];\n selectedRecordsCount?: View['selectedRecordsCount'];\n _countGeneratedInternally?: View['countGeneratedInternally'];\n announce?: View['announceCount'];\n }) {\n // NOTE: setRecordCount can be called with partial props. So while doing setProp we need to make sure to check the existence of incoming prop value.\n // If incoming prop is undefined then it should have a fallback otherwise it will override existing value on view to undefined.\n getView().setProp({\n countGeneratedInternally: !!_countGeneratedInternally,\n hasMoreResults: hasMoreResults ?? false,\n resultsCount: count,\n selectedRecordsCount: selectedRecordsCount ?? getView().selectedRecordsCount,\n showCount: !Number.isFinite(count) ? false : !_countGeneratedInternally,\n announceCount: announce\n });\n // If count is not finite then do instantRender as we want to hide the count immediately and don't want the StateResolver queue to be empty.\n // Else the count will be displayed after the StateResolver queue becomes empty.\n const instantRender = !Number.isFinite(count);\n utilMethods.forceUpdate(instantRender);\n },\n\n /**\n * Dispatches an action to interact with repeating structures, allowing consumers\n * to perform operations using standard actions and payloads.\n *\n * @param action The action to be dispatched.\n * @param payload The payload associated with the action.\n * @returns The return value after the action has been processed by the repeating structure.\n */\n // TODO Refactor- this method to have only one parameter action object that contains type and payload. Maintenance of it will be easy.\n // TODO Make it generic specific.\n dispatchAction<T extends SupportedConsumerActionType>(\n action: T,\n payload?: SupportedConsumerPayloads[T]\n ): Promise<any> | undefined {\n const { dispatch } = getRsStateResolver();\n validateAction(action, payload, getView().externalStateKeys);\n\n let actionReturnValue;\n switch (action) {\n case ActionTypes.USER_CONFIRMATION_ACTION:\n // eslint-disable-next-line no-case-declarations\n const [promise, onSubmit, onCancel] = passablePromise<any>();\n getView().setProp({\n confirmationActionDetails: {\n onSubmit,\n onCancel,\n ...(payload as OmitStrict<\n NonNullable<View['confirmationActionDetails']>,\n 'onSubmit' | 'onCancel'\n >)\n }\n });\n dispatch(actions.showConfirmationAction());\n actionReturnValue = promise;\n break;\n case ActionTypes.UPDATE_DEBUG_INFO:\n getView().setProp({ debugInfo: [payload as DebugInfo] });\n utilMethods.forceUpdate(false);\n break;\n case ActionTypes.TOGGLE_DISABLE_SELECTION: {\n let rowSelectColumn = getView().columns?.find(\n column => column.field.name === rowSelectColumnMeta.field.name\n );\n if (rowSelectColumn) {\n rowSelectColumn = rowSelectColumn.setProp({\n disableSelection: payload as boolean\n });\n utilMethods.forceUpdate(false);\n }\n break;\n }\n case ActionTypes.TOGGLE_REQUIRED:\n getView().setProp({ requiredDef: payload as RequiredDefinition });\n utilMethods.forceUpdate(false);\n break;\n case ActionTypes.NOTIFY_DATA_REFRESH:\n getView().setProp('refreshNotification', {\n id: Date.now(),\n ...(payload as RefreshNotificationForConsumer)\n });\n utilMethods.forceUpdate(false);\n break;\n case ActionTypes.SET_IN_EXTERNAL_STATE:\n dispatch(actions.setExternalState(payload as NonNullable<State['externalState']>));\n break;\n case ActionTypes.UPDATE_SELECTED_ROWS:\n utilMethods.forceUpdate(false, {\n updateSelectedRows: new Date().getTime()\n });\n break;\n\n default:\n }\n return actionReturnValue;\n },\n\n /** Returns the Html events required for reordering a column. */\n getFieldReorderProps() {\n return getRsStore().getFieldReorderProps?.();\n },\n\n // TODO: this should be moved to group generator instance.\n /**\n * Triggers the expand or collapse action for a group header.\n * Dispatches an action to update the {@link State.groupToggle groupToggle} slices in the state.\n *\n * @param payload The data related to the groups.\n */\n toggleGroupExpansion(payload: OmitStrict<ExpandCollapsePayload, 'groups'>) {\n getRsStateResolver().dispatch(actions.actionToggleExpandCollpase(payload));\n },\n\n /**\n * Clears hierarchical groups by dispatching an action to reset the {@link State.hierarchicalGroup hierarchicalGroup} slice in the state.\n */\n clearHierarchicalGroup() {\n getRsStore().groupingInfo = [];\n getRsStateResolver().dispatch(actions.actionUpdateDisplayMode({}));\n },\n\n /**\n * Dispatches a pagination action to update {@link State.paginationOptions paginationOptions} in the state slice.\n *\n * @param payload - The pagination options to update.\n * @param actionMeta - The action metadata.\n */\n onPaginate(payload: PaginationPayload, actionMeta?: ActionMeta) {\n getRsStateResolver().dispatch(actions.actionPaginate(payload, actionMeta));\n },\n\n /**\n * Removes a notification message.\n * Dispatches an action to update the {@link State.notifications notifications} slice in the state.\n *\n * @param payload The notification messages to be removed.\n */\n removeNotification(payload: string[]) {\n getRsStateResolver().dispatch(actions.actionNotificationRemove(payload));\n },\n\n /**\n * Applies a filter to the repeating structures.\n * Dispatches an action that updates the {@link State.filterExpression filterExpression} in the state.\n *\n * @param params The filter expression to apply.\n */\n applyFilter(params: ColumnFilteringActionPayload) {\n getRsStateResolver().dispatch(actions.actionColumnFiltering(params));\n },\n\n /**\n * Dispatches an action to replace the {@link State.columnAlias columnAlias} slice in the state.\n *\n * @param params - Parameters for the action. Specify the necessary details.\n */\n applyAliases(params: ApplyAliasesActionPayload) {\n getRsStateResolver().dispatch(actions.actionReplaceLabels(params));\n },\n\n /**\n * Clears filters for the specified {@link columnId}.\n * Dispatches an action to update the {@link State.clearColFilter clearColFilter} slice in the state.\n * @param columnId - The column on which the filter should be cleared.\n */\n clearFilter(columnId: string) {\n getRsStateResolver().dispatch(actions.actionClearFiltering(columnId));\n },\n\n /**\n * Applies grouping to repeating structures.\n * Dispatches an action that adds {@link State.groups groups} in the state.\n * @param payload\n */\n applyGrouping(payload: NonNullable<State['groups']>) {\n getRsStateResolver().dispatch(actions.actionAddGroups(payload));\n },\n\n /**\n * Applies sorting the repeating structures.\n * Dispatches an action that adds {@link State.sortingOrder sortingOrder} in state.\n * @param payload\n */\n applySorting(payload: NonNullable<State['sortingOrder']>) {\n getRsStateResolver().dispatch(actions.actionUpdateSort(payload));\n },\n\n /**\n * Toggles the visibility of header icons.\n * Dispatches an action to update {@link State.showHeaderIcons} in the state.\n *\n * @param status The status indicating whether to show or hide header icons.\n */\n updateHeaderIconsVisibility(status: NonNullable<State['showHeaderIcons']>) {\n getRsStateResolver().dispatch(actions.actionShowHeaderIcons(status));\n },\n\n /**\n * Applies freezing to a set of columns.\n * Dispatches an action to update {@link State.freezeColumns freezeColumns} in the state.\n *\n * @param payload The payload containing information about the columns to freeze.\n */\n applyFreeze(payload: string[]) {\n getRsStateResolver().dispatch(actions.actionColumnPin(payload));\n },\n\n /**\n * Toggles the visibility of columns.\n * Dispatches an action that updates {@link State.hiddenColumns hiddenColumns} in the state.\n * @param payload\n */\n applyToggleVisibility(payload: string[]) {\n getRsStateResolver().dispatch(actions.actionColumnToggle(payload));\n },\n\n /**\n * Sets the {@link State.hiddenColumns hiddenColumns} in the state, including out-of-the-box columns like dragHandle.\n *\n * @param payload - The payload containing columns to hide.\n * @param ootbColumns - The out-of-the-box columns to include in {@link State.hiddenColumns hiddenColumns}.\n */\n applyHiddenColumns(payload: string[], ootbColumns?: { dragHandle?: boolean }) {\n getRsStateResolver().dispatch(actions.actionHiddenColumnUpdate(payload, ootbColumns));\n },\n\n /**\n * Dispatches an action that replace {@link State.aggregationInfo aggregationInfo} slice in the state with the given {@link payload}.\n * @param payload\n */\n applyAggregations(payload: NonNullable<State['aggregationInfo']>) {\n getRsStateResolver().dispatch(actions.actionUpdateAggregations(payload));\n },\n\n /**\n * Applies order to columns of a repeatings structure with the given {@link payload}.\n * Dispatches an action that sets {@link State.colOrder columnOrder} in the state with the given {@link payload}.\n * @param payload\n */\n applyOrder(payload: string[]) {\n getRsStateResolver().dispatch(actions.actionNewColumnOrder(payload));\n },\n\n /**\n * Saves the current personalization state.\n * Dispatches an action that invokes {@link ApiContext.updatePersonalization} to persist the changes.\n *\n * @param personalizationKey The key representing the current personalization.\n * @param markAsDefault Whether to mark the current personalization as default.\n * @param markAsAppDefault Whether to mark the current personalization as app default.\n */\n updatePersonalization(\n personalizationKey: string,\n markAsDefault: boolean,\n markAsAppDefault: boolean\n ) {\n getRsStateResolver().dispatch(\n actions.actionPersonalizationUpdate(personalizationKey, markAsDefault, markAsAppDefault)\n );\n },\n\n /**\n * Sets the selected personalization state as the current state of the repeating structures.\n * Dispatches an action to update the {@link State} of the repeating structures with the selected personalization state,\n * and updates the active personalization in the {@link State.personalization personalization} state slice.\n *\n * @param args Method arguments.\n * @param args.id ID of the personalization to be set active.\n * @param args.isPreset Indicates if the personalization is preset.\n */\n applyActivePersonalization({ id, isPreset = false }: { id: string; isPreset: boolean }) {\n getRsStateResolver().dispatch(\n actions.actionPersonalizationSetActive({\n id,\n isPreset\n })\n );\n getRsStateResolver().dispatch(actions.actionUpdateStateVersion());\n },\n\n /**\n * Creates a new personalization in the state.\n * Dispatches an action that calls {@link ApiContext.createPersonalization createPersonalization} API to create\n * a new personalization with the provided name and saves it in the {@link State.personalization personalization}.\n *\n * @param name The name of the personalization.\n * @param markAsDefault Indicates whether the new personalization should be marked as default.\n */\n createPersonalization(name: string, markAsDefault: boolean) {\n getRsStateResolver().dispatch(actions.actionPersonalizationCreate(name, markAsDefault));\n },\n\n /**\n * Updates the name, markAsDefault, and markAsAppDefault flags of the current personalization.\n *\n * @param active The current active personalization key.\n * @param name The updated name.\n * @param markAsDefault Indicates whether the current personalization should be marked as default.\n * @param markAsAppDefault Indicates whether the current personalization should be marked as app default.\n */\n editPersonalization(\n active: string,\n name: string,\n markAsDefault: boolean,\n markAsAppDefault: boolean\n ) {\n getRsStateResolver().dispatch(\n actions.actionPersonalizationEdit(active, name, markAsDefault, markAsAppDefault)\n );\n },\n\n /**\n * Deletes the current personalization identified by the given key.\n * Dispatches an action that calls {@link ApiContext.deletePersonalization deletePersonalization} API\n * and updates the {@link State.personalization personalization} state by removing the deleted personalization.\n *\n * @param personalizationKey - The key or ID of the personalization to be deleted.\n */\n deletePersonalization(personalizationKey: string) {\n getRsStateResolver().dispatch(actions.actionPersonalizationDelete(personalizationKey));\n },\n\n /**\n * Sets the current personalization key as the default personalization.\n * Dispatches an action to update `defaultPersonalization` in the `personalization` state slice\n * and calls {@link ApiContext.updatePersonalization updatePersonalization} API.\n *\n * @param personalizationKey - The key identifying the personalization to set as default.\n */\n setDefaultPersonalization(personalizationKey: string) {\n getRsStateResolver().dispatch(actions.actionPersonalizationSetDefault(personalizationKey));\n },\n\n /**\n * Sets the current {@link personalizationKey} as the app's default personalization.\n * Dispatches an action that invokes {@link ApiContext.updatePersonalization updatePersonalization} api with markAsAppDefault=true for the current personalization.\n *\n * @param personalizationKey The key of the personalization to set as default.\n * @param trimmedName The name of the personalization to update.\n */\n setAppDefaultPersonalization(personalizationKey: string, trimmedName: string) {\n getRsStateResolver().dispatch(\n actions.actionPersonalizationSetAppDefault(personalizationKey, trimmedName)\n );\n },\n\n /**\n * Applies the provided search value as a filter expression in the state,\n * using an OR condition with a contains clause.\n *\n * @param value The search value to apply.\n */\n\n applySearch(value: string) {\n getRsStateResolver().dispatch(actions.actionSearchGlobal(value));\n },\n\n /**\n * Applies the given row density in {@link State.selectedHeightOption selectedHeightOption} state slice.\n *\n * @param payload the row density id.\n */\n applyRowHeight(payload: (typeof ROW_DENSITY)[keyof typeof ROW_DENSITY]) {\n getRsStateResolver().dispatch(actions.actionRowHeightChange(payload));\n },\n\n /**\n * Sets the {@link State.bootstrap bootstrap} status of repeating structures and update the {@link State.version version}in state.\n */\n doBootstrap() {\n getRsStateResolver().dispatch(actions.actionBootstrap());\n getRsStateResolver().dispatch(actions.actionUpdateStateVersion());\n },\n\n /**\n * Triggers a refresh of data in repeating structures.\n * Dispatches an action that injects {@link State.refresh refresh} flag in the state.\n * @param flushState The state slice that needs to be reset on refresh. See {@link SUPPORTED_AVOIDABLE_FEATURES}.\n * @param featuresToAvoid The features that should not run as part of refresh. See {@link SUPPORTED_FLUSH_KEYS}.\n */\n forceRefresh(flushState: { [k: string]: boolean } = {}, featuresToAvoid: string[] = []) {\n // If a refresh is in progress, don't trigger another refresh.\n if (getRsStore().refreshInProgress) return;\n\n getRsStore().refreshInProgress = true;\n getRsStore().refreshToken = Date.now();\n\n getRsStateResolver().dispatch(actions.actionForceRefresh(flushState, featuresToAvoid));\n },\n\n /**\n * Fetches actions for the {@link selectedItems} using {@link ApiContext.fetchActions fetchActions} api.\n * @param selectedItems\n * @returns\n */\n fetchActions(selectedItems: string[]) {\n return getRsProps().apiContext.fetchActions?.(selectedItems);\n },\n\n /**\n * This resets the selection and refreshes the {@link rows} data.\n * @param rows\n */\n async clearSelectionAndRefreshRows(rows: string[]) {\n await Promise.allSettled([utilMethods.selectAllRows(false), utilMethods.refreshRows(rows)]);\n },\n\n /**\n * This removes {@link State.showConfirmationAction confirmationAction} from the state.\n */\n completeConfirmationAction() {\n getRsStateResolver().dispatch(actions.completeConfirmationAction());\n },\n\n /**\n * This sets the {@link State.errors errors} in the state.\n * @param payload\n */\n setErrors(payload: Errors) {\n if (payload.dataErrors) {\n getRsStateResolver().dispatch(actions.setDataErrors(payload.dataErrors));\n }\n },\n\n /**\n * Dispatches the dom container responsive breakpoints to state.\n * @param {*} breakpoint\n * @param {*} value\n */\n setDomContainerResponsiveBreakpoints(breakpoint: string, value: boolean) {\n const payload = { breakpoint, value };\n getRsStateResolver().dispatch(actions.setDomContainerResponsiveBreakpoints(payload));\n },\n\n /**\n * Refreshes the {@link View.data data} for {@link rows} by calling {@link ApiContext.fetchRowsData fetchRowsData} api.\n * It also calls {@link utilMethods.forceUpdate forceUpdate } to trigger state change for re-rendering.\n * @param rows\n * @returns\n */\n async refreshRows(rows: string[] = []) {\n const rsProps = getRsProps();\n if (rows.length === 0) {\n return;\n }\n const state = getRsStateResolver().getState();\n const { fetchRowsData } = rsProps.apiContext;\n const response = await fetchRowsData?.(\n deepCopy(state),\n getView().meta,\n rows,\n getView().meta.itemKey,\n {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n }\n );\n\n const data = syncData(getView().meta.itemKey, getView().data!, response!);\n getView().setProp({\n data: [...data]\n });\n utilMethods.forceUpdate(false, { forceRenderOnNextRun: true });\n },\n\n /**\n * Select/Deselect all rows(all pages in case of paginated data) by calling {@link ApiContext.setSelectedRows setSelectedRows}/ {@link ApiContext.clearSelectedRows clearSelectedRows} api.\n * It also updates the selected rows received from {@link ApiContext.getSelectedRows getSelectedRows} api in {@link State.selectedRows selectedRows} state slice.\n * @param isSelected\n */\n async selectAllRows(isSelected: boolean) {\n const rsProps = getRsProps();\n let selectedRows: (RowData & { $selected: boolean })[] = [];\n if (isSelected) {\n const response = await rsProps.apiContext.fetchData(\n {\n ...getRsStateResolver().getState(),\n paginationOptions: {\n rootVirtualiser: {\n startIndex: 0,\n endIndex: getView().resultsCount! - 1\n }\n },\n // passing groups as null to get all rows irrespective of groupfilters\n // @ts-expect-error Why groups is set to null? it should be set as undefined.\n groups: null\n },\n getView().meta,\n {}\n );\n if (response) {\n const { data = [] } = response;\n selectedRows = data.map(item => ({ ...item, $selected: true })) || [];\n }\n try {\n await rsProps.apiContext.setSelectedRows?.(selectedRows);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('setSelectedRows api resulting into error.', e);\n }\n } else {\n // clear all selections when selectAll is unchecked\n await rsProps.apiContext.clearSelectedRows?.();\n }\n\n const rows = await rsProps.apiContext.getSelectedRows?.();\n\n if (rows)\n getRsStateResolver().dispatch(\n actions.actionRowSelectionItemsUpdate({\n selectedRows: rows,\n mode: getView().meta.selectionMode!\n })\n );\n },\n\n /**\n * Triggers {@link ApiContext.importCSVData importCSVData} api.\n * @param create\n * @returns\n */\n importCSVData(create: ModalManagerContextValue['create']) {\n return getRsProps()\n .apiContext.importCSVData?.(create)\n .catch(err => {\n getRsStateResolver().dispatch(\n actions.actionNotificationAdd({\n content: err\n })\n );\n });\n },\n\n /**\n * Triggers {@link ApiContext.exportData exportData} api.\n * @returns\n */\n exportToExcel() {\n return getRsProps()\n .apiContext.exportData?.(deepCopy(getView().state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })\n .catch(err => {\n getRsStateResolver().dispatch(\n actions.actionNotificationAdd({\n content: err\n })\n );\n });\n },\n\n /**\n * Triggers {@link ApiContext.exportDataToCSV exportDataToCSV} api.\n * @returns\n */\n exportToCSV() {\n return getRsProps()\n .apiContext.exportDataToCSV?.(deepCopy(getView().state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })\n .catch(err => {\n getRsStateResolver().dispatch(\n actions.actionNotificationAdd({\n content: err\n })\n );\n });\n },\n\n /**\n * Updates the visibility of columns by modifying {@link State.hiddenColumns}.\n * @param columns - An object mapping column IDs to their visibility status. `true` indicates the column is visible, and `false` means it is hidden.\n */\n updateColumnsVisibility(columns: { [key: FieldDef['id']]: boolean }) {\n getRsStateResolver().dispatch(actions.updateColumnsVisibility(columns));\n },\n\n setConditionalStyleFormats(\n conditionalStyleFormats: NonNullable<State['conditionalStyleFormats']>\n ) {\n getRsStateResolver().dispatch(actions.setConditionalStyleFormats(conditionalStyleFormats));\n }\n };\n return utilMethods;\n}\nexport type UtilityFunctions = ReturnType<typeof viewUtilityMethods>;\n"]}
|
|
1
|
+
{"version":3,"file":"viewUtilityMethods.js","sourceRoot":"","sources":["../../../../src/core/generators/viewUtilityMethods.ts"],"names":[],"mappings":"AAIA,OAAO,WAAW,MAAM,4BAA4B,CAAC;AACrD,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAqC1E,SAAS,QAAQ,CAAC,GAAW,EAAE,WAAsB,EAAE,aAAwB;IAC7E,OAAO,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAC5B,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,OAAO,KAAK,IAAI,IAAI,CAAC;I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oBACrB,oBAAoB,EAAE,UAAU,EAAE,CAAC,YAAY;iBAChD,CAAC;aACH,CAAC;iBACD,KAAK,CAAC,GAAG,CAAC,EAAE;gBACX,kBAAkB,EAAE,CAAC,QAAQ,CAC3B,OAAO,CAAC,qBAAqB,CAAC;oBAC5B,OAAO,EAAE,GAAG;iBACb,CAAC,CACH,CAAC;YACJ,CAAC,CAAC,CAAC;QACP,CAAC;QAED;;;WAGG;QACH,uBAAuB,CAAC,OAA2C;YACjE,kBAAkB,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC,CAAC;QAC1E,CAAC;QAED,0BAA0B,CACxB,uBAAsE;YAEtE,kBAAkB,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC,CAAC;QAC7F,CAAC;KACF,CAAC;IACF,OAAO,WAAW,CAAC;AACrB,CAAC","sourcesContent":["import type { OmitStrict } from '@pega/cosmos-react-core';\nimport type { ModalManagerContextValue } from '@pega/cosmos-react-core/lib/components/Modal/Modal.types';\n\nimport type RsInternal from '../RsInternal';\nimport ActionTypes from '../actions/actionConstants';\nimport * as actions from '../actions/actions';\nimport { rowSelectColumnMeta } from '../constants';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { SUPPORTED_AVOIDABLE_FEATURES, SUPPORTED_FLUSH_KEYS } from '../constants';\nimport { validateAction, passablePromise, deepCopy } from '../utils/util';\nimport type { Errors, State } from '../../../types/State.types';\n// This is being used in JSdoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { ApiContext, ApiOptions } from '../../../types/ApiContext.types';\n// This is being used in JSdoc.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type { FieldDef, Meta, ROW_DENSITY } from '../../../types/Meta.types';\nimport type {\n ActionMeta,\n ApplyAliasesActionPayload,\n ColumnFilteringActionPayload,\n ExpandCollapsePayload,\n PaginationPayload\n} from '../actions/actions.types';\n\nimport type View from './ViewGenerator';\nimport type { RowData } from './RowGenerator.types';\nimport type { DebugInfo, RefreshNotification, RequiredDefinition } from './ViewGenerator.types';\n\nexport type RefreshNotificationForConsumer = OmitStrict<RefreshNotification, 'id'>;\n\nexport type SupportedConsumerPayloads = {\n [ActionTypes.USER_CONFIRMATION_ACTION]: OmitStrict<\n NonNullable<View['confirmationActionDetails']>,\n 'onSubmit' | 'onCancel'\n >;\n [ActionTypes.UPDATE_DEBUG_INFO]: DebugInfo;\n [ActionTypes.TOGGLE_DISABLE_SELECTION]: boolean;\n [ActionTypes.TOGGLE_REQUIRED]: RequiredDefinition;\n [ActionTypes.NOTIFY_DATA_REFRESH]: RefreshNotificationForConsumer;\n [ActionTypes.SET_IN_EXTERNAL_STATE]: NonNullable<State['externalState']>;\n [ActionTypes.UPDATE_SELECTED_ROWS]: undefined;\n};\n\nexport type SupportedConsumerActionType = keyof SupportedConsumerPayloads;\n\nfunction syncData(key: string, sourceArray: RowData[], modifiedArray: RowData[]) {\n return sourceArray.map(item => {\n const item2 = modifiedArray.find(i2 => i2[key] === item[key]);\n return item2 || item;\n });\n}\n\nexport default function viewUtilityMethods(rsInternal: RsInternal) {\n const { getRsProps, getRsStateResolver, getView, getRsStore } = rsInternal;\n\n const utilMethods = {\n /**\n * Dispatches an action that creates a new state object without any internal modifications.\n *\n * If {@link instantRender} is false and {@link forceUpdateFeatures} are provided,\n * it updates the {@link State.forceUpdateFeatures forceUpdateFeatures} slice in the state.\n *\n * @param instantRender - Determines if the render should happen instantly.\n * @param forceUpdateFeatures - The features to force update in the state on next render cycle.\n */\n forceUpdate(instantRender?: boolean, forceUpdateFeatures?: State['forceUpdateFeatures']) {\n getRsStateResolver().dispatch(actions.actionForceUpdate(instantRender, forceUpdateFeatures));\n },\n\n /**\n * Handles the reordering of rows.\n *\n * If {@link Meta.moveListRecords moveListRecords} is set to true in Meta, it dispatches an action\n * that updates the keys of the {@link sourceKey source} row and the {@link destinationKey destination} row\n * in the {@link State.sourceKey sourceKey} and {@link State.destinationKey destinationKey} state slices, respectively.\n *\n * Otherwise, it calls {@link ApiContext.applyRowReorder applyRowReorder} from the apiContext and triggers\n * a {@link utilMethods.forceRefresh forceRefresh} on the state.\n *\n * @param sourceKey - The itemKey for the row being dragged.\n * @param destinationKey - The itemKey for the row on which it is dropped.\n * @returns\n */\n handleRowReorder(sourceKey: string, destinationKey: string) {\n if (getView()?.meta?.moveListRecords) {\n getRsStateResolver().dispatch(\n actions.actionMoveRecordKeysUpdate({\n sourceKey,\n destinationKey\n })\n );\n return;\n }\n getRsProps()\n .apiContext.applyRowReorder?.(sourceKey, destinationKey)\n .then(() => {\n utilMethods.forceRefresh();\n });\n },\n\n /**\n * Sets the count-related information onto the {@link View view} via {@link View.setProp setProp} and triggers {@link utilMethods.forceUpdate forceUpdate}.\n *\n * @param args - The count information object.\n * @param args.count - The total record count of the view, including group headers.\n * @param args.hasMoreResults - Indicates if the view has more records.\n * @param args.selectedRecordsCount - The total count of selected records.\n * @param args._countGeneratedInternally - Indicates if the count is generated internally. This is used for RS core internal purposes. Setting this from apiContext might lead to erroneous behavior.\n * @returns void\n */\n setRecordCount({\n count,\n hasMoreResults,\n selectedRecordsCount,\n _countGeneratedInternally,\n announce\n }: {\n count?: View['resultsCount'];\n hasMoreResults?: View['hasMoreResults'];\n selectedRecordsCount?: View['selectedRecordsCount'];\n _countGeneratedInternally?: View['countGeneratedInternally'];\n announce?: View['announceCount'];\n }) {\n // NOTE: setRecordCount can be called with partial props. So while doing setProp we need to make sure to check the existence of incoming prop value.\n // If incoming prop is undefined then it should have a fallback otherwise it will override existing value on view to undefined.\n getView().setProp({\n countGeneratedInternally: !!_countGeneratedInternally,\n hasMoreResults: hasMoreResults ?? false,\n resultsCount: count,\n selectedRecordsCount: selectedRecordsCount ?? getView().selectedRecordsCount,\n showCount: !Number.isFinite(count) ? false : !_countGeneratedInternally,\n announceCount: announce\n });\n // If count is not finite then do instantRender as we want to hide the count immediately and don't want the StateResolver queue to be empty.\n // Else the count will be displayed after the StateResolver queue becomes empty.\n const instantRender = !Number.isFinite(count);\n utilMethods.forceUpdate(instantRender);\n },\n\n /**\n * Dispatches an action to interact with repeating structures, allowing consumers\n * to perform operations using standard actions and payloads.\n *\n * @param action The action to be dispatched.\n * @param payload The payload associated with the action.\n * @returns The return value after the action has been processed by the repeating structure.\n */\n // TODO Refactor- this method to have only one parameter action object that contains type and payload. Maintenance of it will be easy.\n // TODO Make it generic specific.\n dispatchAction<T extends SupportedConsumerActionType>(\n action: T,\n payload?: SupportedConsumerPayloads[T]\n ): Promise<any> | undefined {\n const { dispatch } = getRsStateResolver();\n validateAction(action, payload, getView().externalStateKeys);\n\n let actionReturnValue;\n switch (action) {\n case ActionTypes.USER_CONFIRMATION_ACTION:\n // eslint-disable-next-line no-case-declarations\n const [promise, onSubmit, onCancel] = passablePromise<any>();\n getView().setProp({\n confirmationActionDetails: {\n onSubmit,\n onCancel,\n ...(payload as OmitStrict<\n NonNullable<View['confirmationActionDetails']>,\n 'onSubmit' | 'onCancel'\n >)\n }\n });\n dispatch(actions.showConfirmationAction());\n actionReturnValue = promise;\n break;\n case ActionTypes.UPDATE_DEBUG_INFO:\n getView().setProp({ debugInfo: [payload as DebugInfo] });\n utilMethods.forceUpdate(false);\n break;\n case ActionTypes.TOGGLE_DISABLE_SELECTION: {\n let rowSelectColumn = getView().columns?.find(\n column => column.field.name === rowSelectColumnMeta.field.name\n );\n if (rowSelectColumn) {\n rowSelectColumn = rowSelectColumn.setProp({\n disableSelection: payload as boolean\n });\n utilMethods.forceUpdate(false);\n }\n break;\n }\n case ActionTypes.TOGGLE_REQUIRED:\n getView().setProp({ requiredDef: payload as RequiredDefinition });\n utilMethods.forceUpdate(false);\n break;\n case ActionTypes.NOTIFY_DATA_REFRESH:\n getView().setProp('refreshNotification', {\n id: Date.now(),\n ...(payload as RefreshNotificationForConsumer)\n });\n utilMethods.forceUpdate(false);\n break;\n case ActionTypes.SET_IN_EXTERNAL_STATE:\n dispatch(actions.setExternalState(payload as NonNullable<State['externalState']>));\n break;\n case ActionTypes.UPDATE_SELECTED_ROWS:\n utilMethods.forceUpdate(false, {\n updateSelectedRows: new Date().getTime()\n });\n break;\n\n default:\n }\n return actionReturnValue;\n },\n\n /** Returns the Html events required for reordering a column. */\n getFieldReorderProps() {\n return getRsStore().getFieldReorderProps?.();\n },\n\n // TODO: this should be moved to group generator instance.\n /**\n * Triggers the expand or collapse action for a group header.\n * Dispatches an action to update the {@link State.groupToggle groupToggle} slices in the state.\n *\n * @param payload The data related to the groups.\n */\n toggleGroupExpansion(payload: OmitStrict<ExpandCollapsePayload, 'groups'>) {\n getRsStateResolver().dispatch(actions.actionToggleExpandCollpase(payload));\n },\n\n /**\n * Clears hierarchical groups by dispatching an action to reset the {@link State.hierarchicalGroup hierarchicalGroup} slice in the state.\n */\n clearHierarchicalGroup() {\n getRsStore().groupingInfo = [];\n getRsStateResolver().dispatch(actions.actionUpdateDisplayMode({}));\n },\n\n /**\n * Dispatches a pagination action to update {@link State.paginationOptions paginationOptions} in the state slice.\n *\n * @param payload - The pagination options to update.\n * @param actionMeta - The action metadata.\n */\n onPaginate(payload: PaginationPayload, actionMeta?: ActionMeta) {\n getRsStateResolver().dispatch(actions.actionPaginate(payload, actionMeta));\n },\n\n /**\n * Removes a notification message.\n * Dispatches an action to update the {@link State.notifications notifications} slice in the state.\n *\n * @param payload The notification messages to be removed.\n */\n removeNotification(payload: string[]) {\n getRsStateResolver().dispatch(actions.actionNotificationRemove(payload));\n },\n\n /**\n * Applies a filter to the repeating structures.\n * Dispatches an action that updates the {@link State.filterExpression filterExpression} in the state.\n *\n * @param params The filter expression to apply.\n */\n applyFilter(params: ColumnFilteringActionPayload) {\n getRsStateResolver().dispatch(actions.actionColumnFiltering(params));\n },\n\n /**\n * Dispatches an action to replace the {@link State.columnAlias columnAlias} slice in the state.\n *\n * @param params - Parameters for the action. Specify the necessary details.\n */\n applyAliases(params: ApplyAliasesActionPayload) {\n getRsStateResolver().dispatch(actions.actionReplaceLabels(params));\n },\n\n /**\n * Clears filters for the specified {@link columnId}.\n * Dispatches an action to update the {@link State.clearColFilter clearColFilter} slice in the state.\n * @param columnId - The column on which the filter should be cleared.\n */\n clearFilter(columnId: string) {\n getRsStateResolver().dispatch(actions.actionClearFiltering(columnId));\n },\n\n /**\n * Applies grouping to repeating structures.\n * Dispatches an action that adds {@link State.groups groups} in the state.\n * @param payload\n */\n applyGrouping(payload: NonNullable<State['groups']>) {\n getRsStateResolver().dispatch(actions.actionAddGroups(payload));\n },\n\n /**\n * Applies sorting the repeating structures.\n * Dispatches an action that adds {@link State.sortingOrder sortingOrder} in state.\n * @param payload\n */\n applySorting(payload: NonNullable<State['sortingOrder']>) {\n getRsStateResolver().dispatch(actions.actionUpdateSort(payload));\n },\n\n /**\n * Toggles the visibility of header icons.\n * Dispatches an action to update {@link State.showHeaderIcons} in the state.\n *\n * @param status The status indicating whether to show or hide header icons.\n */\n updateHeaderIconsVisibility(status: NonNullable<State['showHeaderIcons']>) {\n getRsStateResolver().dispatch(actions.actionShowHeaderIcons(status));\n },\n\n /**\n * Applies freezing to a set of columns.\n * Dispatches an action to update {@link State.freezeColumns freezeColumns} in the state.\n *\n * @param payload The payload containing information about the columns to freeze.\n */\n applyFreeze(payload: string[]) {\n getRsStateResolver().dispatch(actions.actionColumnPin(payload));\n },\n\n /**\n * Toggles the visibility of columns.\n * Dispatches an action that updates {@link State.hiddenColumns hiddenColumns} in the state.\n * @param payload\n */\n applyToggleVisibility(payload: string[]) {\n getRsStateResolver().dispatch(actions.actionColumnToggle(payload));\n },\n\n /**\n * Sets the {@link State.hiddenColumns hiddenColumns} in the state, including out-of-the-box columns like dragHandle.\n *\n * @param payload - The payload containing columns to hide.\n * @param ootbColumns - The out-of-the-box columns to include in {@link State.hiddenColumns hiddenColumns}.\n */\n applyHiddenColumns(payload: string[], ootbColumns?: { dragHandle?: boolean }) {\n getRsStateResolver().dispatch(actions.actionHiddenColumnUpdate(payload, ootbColumns));\n },\n\n /**\n * Dispatches an action that replace {@link State.aggregationInfo aggregationInfo} slice in the state with the given {@link payload}.\n * @param payload\n */\n applyAggregations(payload: NonNullable<State['aggregationInfo']>) {\n getRsStateResolver().dispatch(actions.actionUpdateAggregations(payload));\n },\n\n /**\n * Applies order to columns of a repeatings structure with the given {@link payload}.\n * Dispatches an action that sets {@link State.colOrder columnOrder} in the state with the given {@link payload}.\n * @param payload\n */\n applyOrder(payload: string[]) {\n getRsStateResolver().dispatch(actions.actionNewColumnOrder(payload));\n },\n\n /**\n * Saves the current personalization state.\n * Dispatches an action that invokes {@link ApiContext.updatePersonalization} to persist the changes.\n *\n * @param personalizationKey The key representing the current personalization.\n * @param markAsDefault Whether to mark the current personalization as default.\n * @param markAsAppDefault Whether to mark the current personalization as app default.\n */\n updatePersonalization(\n personalizationKey: string,\n markAsDefault: boolean,\n markAsAppDefault: boolean\n ) {\n getRsStateResolver().dispatch(\n actions.actionPersonalizationUpdate(personalizationKey, markAsDefault, markAsAppDefault)\n );\n },\n\n /**\n * Sets the selected personalization state as the current state of the repeating structures.\n * Dispatches an action to update the {@link State} of the repeating structures with the selected personalization state,\n * and updates the active personalization in the {@link State.personalization personalization} state slice.\n *\n * @param args Method arguments.\n * @param args.id ID of the personalization to be set active.\n * @param args.isPreset Indicates if the personalization is preset.\n */\n applyActivePersonalization({ id, isPreset = false }: { id: string; isPreset: boolean }) {\n getRsStateResolver().dispatch(\n actions.actionPersonalizationSetActive({\n id,\n isPreset\n })\n );\n getRsStateResolver().dispatch(actions.actionUpdateStateVersion());\n },\n\n /**\n * Creates a new personalization in the state.\n * Dispatches an action that calls {@link ApiContext.createPersonalization createPersonalization} API to create\n * a new personalization with the provided name and saves it in the {@link State.personalization personalization}.\n *\n * @param name The name of the personalization.\n * @param markAsDefault Indicates whether the new personalization should be marked as default.\n */\n createPersonalization(name: string, markAsDefault: boolean) {\n getRsStateResolver().dispatch(actions.actionPersonalizationCreate(name, markAsDefault));\n },\n\n /**\n * Updates the name, markAsDefault, and markAsAppDefault flags of the current personalization.\n *\n * @param active The current active personalization key.\n * @param name The updated name.\n * @param markAsDefault Indicates whether the current personalization should be marked as default.\n * @param markAsAppDefault Indicates whether the current personalization should be marked as app default.\n */\n editPersonalization(\n active: string,\n name: string,\n markAsDefault: boolean,\n markAsAppDefault: boolean\n ) {\n getRsStateResolver().dispatch(\n actions.actionPersonalizationEdit(active, name, markAsDefault, markAsAppDefault)\n );\n },\n\n /**\n * Deletes the current personalization identified by the given key.\n * Dispatches an action that calls {@link ApiContext.deletePersonalization deletePersonalization} API\n * and updates the {@link State.personalization personalization} state by removing the deleted personalization.\n *\n * @param personalizationKey - The key or ID of the personalization to be deleted.\n */\n deletePersonalization(personalizationKey: string) {\n getRsStateResolver().dispatch(actions.actionPersonalizationDelete(personalizationKey));\n },\n\n /**\n * Sets the current personalization key as the default personalization.\n * Dispatches an action to update `defaultPersonalization` in the `personalization` state slice\n * and calls {@link ApiContext.updatePersonalization updatePersonalization} API.\n *\n * @param personalizationKey - The key identifying the personalization to set as default.\n */\n setDefaultPersonalization(personalizationKey: string) {\n getRsStateResolver().dispatch(actions.actionPersonalizationSetDefault(personalizationKey));\n },\n\n /**\n * Sets the current {@link personalizationKey} as the app's default personalization.\n * Dispatches an action that invokes {@link ApiContext.updatePersonalization updatePersonalization} api with markAsAppDefault=true for the current personalization.\n *\n * @param personalizationKey The key of the personalization to set as default.\n * @param trimmedName The name of the personalization to update.\n */\n setAppDefaultPersonalization(personalizationKey: string, trimmedName: string) {\n getRsStateResolver().dispatch(\n actions.actionPersonalizationSetAppDefault(personalizationKey, trimmedName)\n );\n },\n\n /**\n * Applies the provided search value as a filter expression in the state,\n * using an OR condition with a contains clause.\n *\n * @param value The search value to apply.\n */\n\n applySearch(value: string) {\n getRsStateResolver().dispatch(actions.actionSearchGlobal(value));\n },\n\n /**\n * Applies the given row density in {@link State.selectedHeightOption selectedHeightOption} state slice.\n *\n * @param payload the row density id.\n */\n applyRowHeight(payload: (typeof ROW_DENSITY)[keyof typeof ROW_DENSITY]) {\n getRsStateResolver().dispatch(actions.actionRowHeightChange(payload));\n },\n\n /**\n * Sets the {@link State.bootstrap bootstrap} status of repeating structures and update the {@link State.version version}in state.\n */\n doBootstrap() {\n getRsStateResolver().dispatch(actions.actionBootstrap());\n getRsStateResolver().dispatch(actions.actionUpdateStateVersion());\n },\n\n /**\n * Triggers a refresh of data in repeating structures.\n * Dispatches an action that injects {@link State.refresh refresh} flag in the state.\n * @param flushState The state slice that needs to be reset on refresh. See {@link SUPPORTED_AVOIDABLE_FEATURES}.\n * @param featuresToAvoid The features that should not run as part of refresh. See {@link SUPPORTED_FLUSH_KEYS}.\n */\n forceRefresh(flushState: { [k: string]: boolean } = {}, featuresToAvoid: string[] = []) {\n // If a refresh is in progress, don't trigger another refresh.\n if (getRsStore().refreshInProgress) return;\n\n getRsStore().refreshInProgress = true;\n getRsStore().refreshToken = Date.now();\n\n getRsStateResolver().dispatch(actions.actionForceRefresh(flushState, featuresToAvoid));\n },\n\n /**\n * Fetches actions for the {@link selectedItems} using {@link ApiContext.fetchActions fetchActions} api.\n * @param selectedItems\n * @returns\n */\n fetchActions(selectedItems: string[]) {\n return getRsProps().apiContext.fetchActions?.(selectedItems);\n },\n\n /**\n * This resets the selection and refreshes the {@link rows} data.\n * @param rows\n */\n async clearSelectionAndRefreshRows(rows: string[]) {\n await Promise.allSettled([utilMethods.selectAllRows(false), utilMethods.refreshRows(rows)]);\n },\n\n /**\n * This removes {@link State.showConfirmationAction confirmationAction} from the state.\n */\n completeConfirmationAction() {\n getRsStateResolver().dispatch(actions.completeConfirmationAction());\n },\n\n /**\n * This sets the {@link State.errors errors} in the state.\n * @param payload\n */\n setErrors(payload: Errors) {\n if (payload.dataErrors) {\n getRsStateResolver().dispatch(actions.setDataErrors(payload.dataErrors));\n }\n },\n\n /**\n * Dispatches the dom container responsive breakpoints to state.\n * @param {*} breakpoint\n * @param {*} value\n */\n setDomContainerResponsiveBreakpoints(breakpoint: string, value: boolean) {\n const payload = { breakpoint, value };\n getRsStateResolver().dispatch(actions.setDomContainerResponsiveBreakpoints(payload));\n },\n\n /**\n * Refreshes the {@link View.data data} for {@link rows} by calling {@link ApiContext.fetchRowsData fetchRowsData} api.\n * It also calls {@link utilMethods.forceUpdate forceUpdate } to trigger state change for re-rendering.\n * @param rows\n * @returns\n */\n async refreshRows(rows: string[] = []) {\n const rsProps = getRsProps();\n if (rows.length === 0) {\n return;\n }\n const state = getRsStateResolver().getState();\n const { fetchRowsData } = rsProps.apiContext;\n const response = await fetchRowsData?.(\n deepCopy(state),\n getView().meta,\n rows,\n getView().meta.itemKey,\n {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n }\n );\n\n const data = syncData(getView().meta.itemKey, getView().data!, response!);\n getView().setProp({\n data: [...data]\n });\n utilMethods.forceUpdate(false, { forceRenderOnNextRun: true });\n },\n\n /**\n * Select/Deselect all rows(all pages in case of paginated data) by calling {@link ApiContext.setSelectedRows setSelectedRows}/ {@link ApiContext.clearSelectedRows clearSelectedRows} api.\n * It also updates the selected rows received from {@link ApiContext.getSelectedRows getSelectedRows} api in {@link State.selectedRows selectedRows} state slice.\n * @param isSelected\n */\n async selectAllRows(isSelected: boolean) {\n const rsProps = getRsProps();\n let selectedRows: (RowData & { $selected: boolean })[] = [];\n if (isSelected) {\n const response = await rsProps.apiContext.fetchData(\n {\n ...getRsStateResolver().getState(),\n paginationOptions: {\n rootVirtualiser: {\n startIndex: 0,\n endIndex: getView().resultsCount! - 1\n }\n },\n // passing groups and groupFilters as undefined to get all rows\n groups: undefined,\n groupFilters: undefined\n },\n getView().meta,\n {}\n );\n if (response) {\n const { data = [] } = response;\n selectedRows = data.map(item => ({ ...item, $selected: true })) || [];\n }\n try {\n await rsProps.apiContext.setSelectedRows?.(selectedRows);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.error('setSelectedRows api resulting into error.', e);\n }\n } else {\n // clear all selections when selectAll is unchecked\n await rsProps.apiContext.clearSelectedRows?.();\n }\n\n const rows = await rsProps.apiContext.getSelectedRows?.();\n\n if (rows)\n getRsStateResolver().dispatch(\n actions.actionRowSelectionItemsUpdate({\n selectedRows: rows,\n mode: getView().meta.selectionMode!\n })\n );\n },\n\n /**\n * Triggers {@link ApiContext.importCSVData importCSVData} api.\n * @param create\n * @returns\n */\n importCSVData(create: ModalManagerContextValue['create']) {\n return getRsProps()\n .apiContext.importCSVData?.(create)\n .catch(err => {\n getRsStateResolver().dispatch(\n actions.actionNotificationAdd({\n content: err\n })\n );\n });\n },\n\n /**\n * Triggers {@link ApiContext.exportData exportData} api.\n * @returns\n */\n exportToExcel() {\n return getRsProps()\n .apiContext.exportData?.(deepCopy(getView().state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })\n .catch(err => {\n getRsStateResolver().dispatch(\n actions.actionNotificationAdd({\n content: err\n })\n );\n });\n },\n\n /**\n * Triggers {@link ApiContext.exportDataToCSV exportDataToCSV} api.\n * @returns\n */\n exportToCSV() {\n return getRsProps()\n .apiContext.exportDataToCSV?.(deepCopy(getView().state), getView().meta, {\n ...(getRsStore().refreshInProgress && {\n invalidateCache: true,\n invalidateCacheToken: getRsStore().refreshToken\n })\n })\n .catch(err => {\n getRsStateResolver().dispatch(\n actions.actionNotificationAdd({\n content: err\n })\n );\n });\n },\n\n /**\n * Updates the visibility of columns by modifying {@link State.hiddenColumns}.\n * @param columns - An object mapping column IDs to their visibility status. `true` indicates the column is visible, and `false` means it is hidden.\n */\n updateColumnsVisibility(columns: { [key: FieldDef['id']]: boolean }) {\n getRsStateResolver().dispatch(actions.updateColumnsVisibility(columns));\n },\n\n setConditionalStyleFormats(\n conditionalStyleFormats: NonNullable<State['conditionalStyleFormats']>\n ) {\n getRsStateResolver().dispatch(actions.setConditionalStyleFormats(conditionalStyleFormats));\n }\n };\n return utilMethods;\n}\nexport type UtilityFunctions = ReturnType<typeof viewUtilityMethods>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;yBAEvC,OAAO,KAAK,EAAE,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;yBAEvC,OAAO,KAAK,EAAE,QAAQ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;4BAmBy3T,CAAC;+BAAkI,CAAC;0BAAmJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnB7rU,wBAkBE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAgExD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,IAC3D,OAAO,KAAK,EAAE,QAAQ,MAAM,EAAE,YAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/reducers/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,UAAU,MAAM,eAAe,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAgExD,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,IAC3D,OAAO,KAAK,EAAE,QAAQ,MAAM,EAAE,YAAY,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;4BAekjQ,CAAC;+BAAkI,CAAC;0BAAmJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EADv4Q"}
|
|
@@ -107,7 +107,7 @@ export interface ApiOptions {
|
|
|
107
107
|
in the same refresh cycle receive the same identifier. */
|
|
108
108
|
invalidateCacheToken?: number;
|
|
109
109
|
}
|
|
110
|
-
type AggregationTypeResp = 'avg' | 'max' | 'min' | 'nonNullCount' | 'sum';
|
|
110
|
+
type AggregationTypeResp = 'avg' | 'max' | 'min' | 'nonNullCount' | 'sum' | 'distinctCount';
|
|
111
111
|
/** An object with key equal to {@link AggregationTypeResp aggregation type} and value is equal to the actual value of that aggregation type */
|
|
112
112
|
type AggregationOptions = {
|
|
113
113
|
[agg in AggregationTypeResp]?: number | null;
|
|
@@ -116,6 +116,24 @@ type AggregationOptions = {
|
|
|
116
116
|
export type AggregationResp = {
|
|
117
117
|
[columnId: string]: AggregationOptions;
|
|
118
118
|
};
|
|
119
|
+
export type AdditionalFieldData = {
|
|
120
|
+
/** {@link FieldDef.id Field Id} of the additional field. */
|
|
121
|
+
id: string;
|
|
122
|
+
/** Value of the additional field that should be displayed for additional field.
|
|
123
|
+
* The value can represent:
|
|
124
|
+
* - An aggregated value (e.g., sum, max, min, avg) for {@link FieldType.NUMBER number} type fields when
|
|
125
|
+
* {@link NumberGroupAdditionalField.aggregation aggregation} is selected in additional fields meta.
|
|
126
|
+
* - A date function value (e.g., Day, Month, Year) for {@link FieldType.DATE 'date'} / {@link FieldType.DATE_TIME 'datetime'}
|
|
127
|
+
* fields when a {@link DateGroupAdditionalField.dateFunction date function} is selected in the additional fields metadata..
|
|
128
|
+
* - A scalar or single value for the additional field.
|
|
129
|
+
*/
|
|
130
|
+
value: null | string | number | boolean | Date;
|
|
131
|
+
/** Represents the distinct count of
|
|
132
|
+
* occurrences for the additional field data. This is generally required,
|
|
133
|
+
* but may be omitted if {@link NumberGroupAdditionalField.aggregation aggregation} is selected for number type fields
|
|
134
|
+
* in the additional fields metadata. */
|
|
135
|
+
count?: number;
|
|
136
|
+
};
|
|
119
137
|
export interface GroupedInfo {
|
|
120
138
|
/** Value for the current group node. */
|
|
121
139
|
name: null | string | number | boolean | Date;
|
|
@@ -123,6 +141,8 @@ export interface GroupedInfo {
|
|
|
123
141
|
count: number;
|
|
124
142
|
/** An optional data row from the group node that is used to process extra information required by group node */
|
|
125
143
|
data?: RowData;
|
|
144
|
+
/** Additional fields data for the current group node */
|
|
145
|
+
additionalFieldsData?: AdditionalFieldData[];
|
|
126
146
|
/** Aggregation values of a column if applied */
|
|
127
147
|
agg?: AggregationResp;
|
|
128
148
|
/** Nested groups within the parent group node */
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"ApiContext.types.d.ts","sourceRoot":"","sources":["../../types/ApiContext.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBA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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"]}
|
|
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 /* eslint-disable @typescript-eslint/no-unused-vars */\n DateGroupAdditionalField,\n NumberGroupAdditionalField\n /* eslint-enable @typescript-eslint/no-unused-vars */\n} from './State.types';\nimport type {\n Meta,\n RowAction,\n FieldDef,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n FieldType\n} 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' | 'distinctCount';\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\nexport type AdditionalFieldData = {\n /** {@link FieldDef.id Field Id} of the additional field. */\n id: string;\n /** Value of the additional field that should be displayed for additional field.\n * The value can represent:\n * - An aggregated value (e.g., sum, max, min, avg) for {@link FieldType.NUMBER number} type fields when\n * {@link NumberGroupAdditionalField.aggregation aggregation} is selected in additional fields meta.\n * - A date function value (e.g., Day, Month, Year) for {@link FieldType.DATE 'date'} / {@link FieldType.DATE_TIME 'datetime'}\n * fields when a {@link DateGroupAdditionalField.dateFunction date function} is selected in the additional fields metadata..\n * - A scalar or single value for the additional field.\n */\n value: null | string | number | boolean | Date;\n /** Represents the distinct count of\n * occurrences for the additional field data. This is generally required,\n * but may be omitted if {@link NumberGroupAdditionalField.aggregation aggregation} is selected for number type fields\n * in the additional fields metadata. */\n count?: number;\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 /** Additional fields data for the current group node */\n additionalFieldsData?: AdditionalFieldData[];\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"]}
|
|
@@ -5,7 +5,7 @@ import type { ActivityObject } from '@pega/cosmos-react-work/lib/components/Time
|
|
|
5
5
|
import type { FilterConfig } from '../src/core/config/filterConfig';
|
|
6
6
|
import type Row from '../src/core/generators/RowGenerator';
|
|
7
7
|
import type { RowData } from '../src/core/generators/RowGenerator.types';
|
|
8
|
-
import type { AggregationType, SortDirection } from './State.types';
|
|
8
|
+
import type { AggregationType, GroupAdditionalField, SortDirection } from './State.types';
|
|
9
9
|
type CSSVariable = `--${string}`;
|
|
10
10
|
export interface RowAction {
|
|
11
11
|
/** A label to be displayed to end user for this action */
|
|
@@ -172,6 +172,8 @@ export interface FieldDef {
|
|
|
172
172
|
grouped?: boolean;
|
|
173
173
|
/** Choose date function {@link DateFunction} to group by when `grouped` is enabled for date/time field. Fallbacks to grouping by equality if undefined. */
|
|
174
174
|
groupedDateFunction?: DateFunction;
|
|
175
|
+
/** Additional field config for current field, if grouping is applied */
|
|
176
|
+
groupedAdditionalFields?: GroupAdditionalField[];
|
|
175
177
|
/** Allow resizing on this field
|
|
176
178
|
* @default true
|
|
177
179
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Meta.types.d.ts","sourceRoot":"","sources":["../../types/Meta.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iFAAiF,CAAC;AACpH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gEAAgE,CAAC;AAErG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,GAAG,MAAM,qCAAqC,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AAIzE,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAS,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"Meta.types.d.ts","sourceRoot":"","sources":["../../types/Meta.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,mB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